summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2010-05-01 09:01:04 +0200
committerAndreas Baumann <abaumann@yahoo.com>2010-05-01 09:01:04 +0200
commit47fe78107d08de7736d9bb6cf735545d3febd520 (patch)
treeef3def1775e3fa7c03789f77165292e84c62390c
parentf35da36ed925d639a4828096be2f1499e43f9489 (diff)
downloadtvisiontest-47fe78107d08de7736d9bb6cf735545d3febd520.tar.gz
tvisiontest-47fe78107d08de7736d9bb6cf735545d3febd520.tar.bz2
added setedit for testing
-rw-r--r--README4
-rw-r--r--setedit/.cvsignore3
-rw-r--r--setedit/INSTALL.txt33
-rw-r--r--setedit/Makefile81
-rw-r--r--setedit/Makefile.bcc120
-rw-r--r--setedit/Makefile.nmk16
-rw-r--r--setedit/README55
-rw-r--r--setedit/TODO39
-rw-r--r--setedit/WinNT/Makefile191
-rw-r--r--setedit/WinNT/Makefile.nmk181
-rw-r--r--setedit/WinNT/README38
-rw-r--r--setedit/WinNT/bccmake.in160
-rw-r--r--setedit/WinNT/configed.h34
-rw-r--r--setedit/WinNT/makeinfo/makeinfo.exebin0 -> 38371 bytes
-rw-r--r--setedit/WinNT/msvcmake.in150
-rw-r--r--setedit/WinNT/objs/delete.me2
-rw-r--r--setedit/calcu/calcu.cc182
-rw-r--r--setedit/calcu/calcu.h9
-rw-r--r--setedit/calcu/large.txt70
-rw-r--r--setedit/calcu/parser.c494
-rw-r--r--setedit/calcu/parser.txt72
-rw-r--r--setedit/calcu/parserbr.c494
-rw-r--r--setedit/calcu/parserml.c409
-rw-r--r--setedit/calcu/small.c229
-rw-r--r--setedit/cfgfiles/asm51.pmc97
-rw-r--r--setedit/cfgfiles/clippmac.pmc151
-rw-r--r--setedit/cfgfiles/cpmacros.pmc184
-rw-r--r--setedit/cfgfiles/editor.tip159
-rw-r--r--setedit/cfgfiles/errors.cle165
-rw-r--r--setedit/cfgfiles/eterm/Setedit/MAIN178
-rw-r--r--setedit/cfgfiles/eterm/Setedit/Setedit.menu28
-rw-r--r--setedit/cfgfiles/eterm/readme.txt87
-rw-r--r--setedit/cfgfiles/eterm/xterm-eterm-tv35
-rw-r--r--setedit/cfgfiles/examples.slp77
-rw-r--r--setedit/cfgfiles/htmlmac.pmc70
-rw-r--r--setedit/cfgfiles/macros.slp546
-rw-r--r--setedit/cfgfiles/menubind.smn801
-rw-r--r--setedit/cfgfiles/perlmac.pmc87
-rw-r--r--setedit/cfgfiles/pmacros.pmc13
-rw-r--r--setedit/cfgfiles/redmond.smn740
-rw-r--r--setedit/cfgfiles/simple.dstbin0 -> 2304 bytes
-rw-r--r--setedit/cfgfiles/simple.smn361
-rw-r--r--setedit/cfgfiles/simple.tip111
-rw-r--r--setedit/cfgfiles/syntaxhl.shl2764
-rw-r--r--setedit/cfgfiles/test_shl/test.vhdl81
-rw-r--r--setedit/cfgfiles/vhdl.pmc801
-rw-r--r--setedit/cfgfiles/wmlmac.pmc86
-rw-r--r--setedit/change.log7772
-rw-r--r--setedit/change0.log1705
-rw-r--r--setedit/config.pl2009
-rw-r--r--setedit/confignt.pl99
-rwxr-xr-xsetedit/configset24
-rw-r--r--setedit/configset.bat22
-rwxr-xr-xsetedit/configure2
-rw-r--r--setedit/configure.bat6
-rw-r--r--setedit/conflib.pl1558
-rw-r--r--setedit/copying.dj41
-rw-r--r--setedit/copying.gpl339
-rw-r--r--setedit/copying.lgp501
-rw-r--r--setedit/copying.rh46
-rw-r--r--setedit/copyrigh476
-rw-r--r--setedit/debian/README36
-rw-r--r--setedit/debian/README.debian83
-rwxr-xr-xsetedit/debian/buildpackage5
-rw-r--r--setedit/debian/changelog571
-rw-r--r--setedit/debian/control55
-rw-r--r--setedit/debian/copyright12
-rw-r--r--setedit/debian/files_to_backup11
-rw-r--r--setedit/debian/info.ex20
-rw-r--r--setedit/debian/infview.doc-base13
-rw-r--r--setedit/debian/infview.menu5
-rw-r--r--setedit/debian/infview.postinst14
-rw-r--r--setedit/debian/infview.postrm9
-rw-r--r--setedit/debian/infview.preinst8
-rw-r--r--setedit/debian/infview.prerm8
-rw-r--r--setedit/debian/maintainer.notes30
-rwxr-xr-xsetedit/debian/rules161
-rwxr-xr-xsetedit/debian/setedit.config35
-rw-r--r--setedit/debian/setedit.doc-base13
-rw-r--r--setedit/debian/setedit.menu5
-rw-r--r--setedit/debian/setedit.postinst65
-rw-r--r--setedit/debian/setedit.prerm14
-rw-r--r--setedit/debian/setedit.templates29
-rw-r--r--setedit/debian/setedit.templates.es51
-rw-r--r--setedit/debian/watch.ex5
-rwxr-xr-xsetedit/distrib/INSTALL.LINUX54
-rw-r--r--setedit/distrib/INSTALL.MAK58
-rwxr-xr-xsetedit/distrib/REMOVE_UNNEEDED22
-rwxr-xr-xsetedit/distrib/VCSA.SH19
-rw-r--r--setedit/distrib/arranca.bat15
-rwxr-xr-xsetedit/distrib/ask_config.sh135
-rw-r--r--setedit/distrib/calltpc7.zipbin0 -> 11602 bytes
-rw-r--r--setedit/distrib/default.map213
-rw-r--r--setedit/distrib/distrib1.txt577
-rw-r--r--setedit/distrib/distrib2.txt265
-rw-r--r--setedit/distrib/distrib3.txt192
-rw-r--r--setedit/distrib/example.zipbin0 -> 6715 bytes
-rw-r--r--setedit/distrib/examples/examp1.dstbin0 -> 3821 bytes
-rw-r--r--setedit/distrib/examples/examp1.eprbin0 -> 675 bytes
-rw-r--r--setedit/distrib/examples/test1.cc9
-rw-r--r--setedit/distrib/examples/tvrc7
-rw-r--r--setedit/distrib/infINSTALL.MAK50
-rwxr-xr-xsetedit/distrib/infREMOVE_UNNEEDED10
-rw-r--r--setedit/distrib/kextend.zipbin0 -> 3971 bytes
-rw-r--r--setedit/distrib/linux.faq374
-rw-r--r--setedit/distrib/setedit.pifbin0 -> 995 bytes
-rw-r--r--setedit/doc/.cvsignore21
-rw-r--r--setedit/doc/Makefile90
-rw-r--r--setedit/doc/Makefile.bcc85
-rw-r--r--setedit/doc/editor.tx9550
-rw-r--r--setedit/doc/gnumake.in90
-rw-r--r--setedit/doc/infeng.tx307
-rw-r--r--setedit/doc/infview.man98
-rw-r--r--setedit/doc/install/bcc.txt64
-rw-r--r--setedit/doc/install/cygwin.txt54
-rw-r--r--setedit/doc/install/djgpp.txt133
-rw-r--r--setedit/doc/install/linux.txt47
-rw-r--r--setedit/doc/install/mingwin.txt51
-rw-r--r--setedit/doc/install/msvc.txt30
-rw-r--r--setedit/doc/install/tools.txt233
-rw-r--r--setedit/doc/install/unix.txt123
-rw-r--r--setedit/doc/line.par1
-rw-r--r--setedit/doc/readme.1st31
-rw-r--r--setedit/doc/rhidemac.htm475
-rw-r--r--setedit/doc/rhidemac.txi116
-rw-r--r--setedit/doc/rhidemac.txt118
-rw-r--r--setedit/doc/sdg.tx1024
-rw-r--r--setedit/doc/sdh.c1497
-rw-r--r--setedit/doc/sdh.gprbin0 -> 8878 bytes
-rw-r--r--setedit/doc/set.htm250
-rw-r--r--setedit/doc/set.txi292
-rw-r--r--setedit/doc/set.txt205
-rw-r--r--setedit/doc/setedit.man203
-rw-r--r--setedit/easydiag/easydia1.h171
-rw-r--r--setedit/easydiag/easydiag.h109
-rw-r--r--setedit/easydiag/lablchek.cc48
-rw-r--r--setedit/easydiag/lablradi.cc49
-rw-r--r--setedit/easydiag/snostate.cc46
-rw-r--r--setedit/easydiag/snostate.h12
-rw-r--r--setedit/easydiag/tcheck2.cc38
-rw-r--r--setedit/easydiag/tcheck2.h73
-rw-r--r--setedit/easydiag/test.cc395
-rw-r--r--setedit/easydiag/tmiclust.cc304
-rw-r--r--setedit/easydiag/tmiclust.h86
-rw-r--r--setedit/easydiag/tsbutton.cc105
-rw-r--r--setedit/easydiag/tsbutton.h39
-rw-r--r--setedit/easydiag/tschkarr.cc28
-rw-r--r--setedit/easydiag/tschkarr.h14
-rw-r--r--setedit/easydiag/tschkbox.cc52
-rw-r--r--setedit/easydiag/tschkbox.h12
-rw-r--r--setedit/easydiag/tshscrol.cc21
-rw-r--r--setedit/easydiag/tshscrol.h16
-rw-r--r--setedit/easydiag/tshzgrp.cc90
-rw-r--r--setedit/easydiag/tshzgrp.h21
-rw-r--r--setedit/easydiag/tsinplin.cc62
-rw-r--r--setedit/easydiag/tsinplin.h54
-rw-r--r--setedit/easydiag/tsinplpi.cc60
-rw-r--r--setedit/easydiag/tsinplpi.h20
-rw-r--r--setedit/easydiag/tslabel.cc77
-rw-r--r--setedit/easydiag/tslabel.h35
-rw-r--r--setedit/easydiag/tslider.cc95
-rw-r--r--setedit/easydiag/tslider.h47
-rw-r--r--setedit/easydiag/tslistbo.cc62
-rw-r--r--setedit/easydiag/tslistbo.h36
-rw-r--r--setedit/easydiag/tsradbot.cc60
-rw-r--r--setedit/easydiag/tsradbot.h13
-rw-r--r--setedit/easydiag/tssortlb.cc9
-rw-r--r--setedit/easydiag/tssortlb.h8
-rw-r--r--setedit/easydiag/tssortva.h25
-rw-r--r--setedit/easydiag/tssosslb.cc8
-rw-r--r--setedit/easydiag/tssosslb.h8
-rw-r--r--setedit/easydiag/tstatext.cc91
-rw-r--r--setedit/easydiag/tstatext.h13
-rw-r--r--setedit/easydiag/tstextsc.cc63
-rw-r--r--setedit/easydiag/tstextsc.h17
-rw-r--r--setedit/easydiag/tstsorlb.cc8
-rw-r--r--setedit/easydiag/tstsorlb.h8
-rw-r--r--setedit/easydiag/tsvegrp.cc82
-rw-r--r--setedit/easydiag/tsvegrp.h22
-rw-r--r--setedit/easydiag/tsview.cc43
-rw-r--r--setedit/easydiag/tsview.h33
-rw-r--r--setedit/easydiag/tsviewco.cc292
-rw-r--r--setedit/easydiag/tsviewco.h29
-rw-r--r--setedit/easydiag/ttextscr.cc58
-rw-r--r--setedit/easydiag/ttextscr.h19
-rw-r--r--setedit/extra/djmdr.s59
-rw-r--r--setedit/extra/dyncat.cc121
-rw-r--r--setedit/extra/dyncat.h18
-rw-r--r--setedit/extra/memmove.s30
-rw-r--r--setedit/extra/mixer.c140
-rw-r--r--setedit/extra/mixer.h100
-rw-r--r--setedit/extra/mixersb.c532
-rw-r--r--setedit/extra/mixoss.c200
-rw-r--r--setedit/extra/stackdbg.c774
-rw-r--r--setedit/extra/stackdbg.h26
-rw-r--r--setedit/extra/strncpyz.cc12
-rw-r--r--setedit/extra/strndup.cc19
-rw-r--r--setedit/fonts/.cvsignore1
-rw-r--r--setedit/fonts/BTerminus.sftbin0 -> 44399 bytes
-rw-r--r--setedit/fonts/Makefile9
-rw-r--r--setedit/fonts/Terminus.sftbin0 -> 44401 bytes
-rw-r--r--setedit/fonts/XFont.sftbin0 -> 99549 bytes
-rw-r--r--setedit/fonts/antique.016bin0 -> 4096 bytes
-rw-r--r--setedit/fonts/antique.sftbin0 -> 4153 bytes
-rw-r--r--setedit/fonts/boxroun0.0001272
-rw-r--r--setedit/fonts/boxround.cc18
-rw-r--r--setedit/fonts/boxround.sftbin0 -> 19053 bytes
-rw-r--r--setedit/fonts/cntdown.cc18
-rw-r--r--setedit/fonts/cntdown.sftbin0 -> 19052 bytes
-rw-r--r--setedit/fonts/cntdown0.0001272
-rw-r--r--setedit/fonts/common1.h17
-rw-r--r--setedit/fonts/common2.h250
-rw-r--r--setedit/fonts/convpcf1.cc937
-rw-r--r--setedit/fonts/intcode.h706
-rw-r--r--setedit/fonts/let.txt668
-rw-r--r--setedit/fonts/medieval.016bin0 -> 4096 bytes
-rw-r--r--setedit/fonts/medieval.sftbin0 -> 4154 bytes
-rw-r--r--setedit/fonts/ocr.cc18
-rw-r--r--setedit/fonts/ocr.sftbin0 -> 19051 bytes
-rw-r--r--setedit/fonts/ocr0.0001272
-rw-r--r--setedit/fonts/raw2sft.cc61
-rw-r--r--setedit/fonts/roman.016bin0 -> 4096 bytes
-rw-r--r--setedit/fonts/roman.sftbin0 -> 4151 bytes
-rw-r--r--setedit/fonts/rombios.cc18
-rw-r--r--setedit/fonts/rombios.sftbin0 -> 19050 bytes
-rw-r--r--setedit/fonts/rombios0.0001272
-rw-r--r--setedit/fonts/thin.cc18
-rw-r--r--setedit/fonts/thin.sftbin0 -> 19054 bytes
-rw-r--r--setedit/fonts/thin0.0001272
-rw-r--r--setedit/fromdos.pl62
-rw-r--r--setedit/fromunix.pl48
-rw-r--r--setedit/gettext/.cvsignore4
-rw-r--r--setedit/gettext/Makefile77
-rw-r--r--setedit/gettext/Makefile.in77
-rw-r--r--setedit/gettext/bindtextdom.c368
-rw-r--r--setedit/gettext/config.h311
-rw-r--r--setedit/gettext/dcgettext.c57
-rw-r--r--setedit/gettext/dcigettext.c1258
-rw-r--r--setedit/gettext/dcngettext.c59
-rw-r--r--setedit/gettext/dgettext.c58
-rw-r--r--setedit/gettext/djgpp.h311
-rw-r--r--setedit/gettext/dngettext.c60
-rw-r--r--setedit/gettext/explodename.c191
-rw-r--r--setedit/gettext/finddomain.c197
-rw-r--r--setedit/gettext/gettext.c63
-rw-r--r--setedit/gettext/gettext.h101
-rw-r--r--setedit/gettext/gettextP.h251
-rw-r--r--setedit/gettext/hash-string.h58
-rw-r--r--setedit/gettext/intl-compat.c165
-rw-r--r--setedit/gettext/l10nflist.c404
-rw-r--r--setedit/gettext/libgettext.h48
-rw-r--r--setedit/gettext/libgnuintl.h127
-rw-r--r--setedit/gettext/loadinfo.h108
-rw-r--r--setedit/gettext/loadmsgcat.c566
-rw-r--r--setedit/gettext/localcharset.c271
-rw-r--r--setedit/gettext/localealias.c403
-rw-r--r--setedit/gettext/ngettext.c67
-rw-r--r--setedit/gettext/plural.c1325
-rw-r--r--setedit/gettext/plural.y412
-rw-r--r--setedit/gettext/textdomain.c141
-rw-r--r--setedit/holidays/.cvsignore2
-rw-r--r--setedit/holidays/Makefile26
-rw-r--r--setedit/holidays/Makefile.in26
-rw-r--r--setedit/holidays/README124
-rw-r--r--setedit/holidays/argentina.c106
-rw-r--r--setedit/holidays/datetools.c259
-rw-r--r--setedit/holidays/datetools.h25
-rw-r--r--setedit/holidays/defholidays.c55
-rw-r--r--setedit/holidays/holidays.conf4
-rw-r--r--setedit/include/.cvsignore1
-rw-r--r--setedit/include/bufun.h60
-rw-r--r--setedit/include/ced_clas.h774
-rw-r--r--setedit/include/ced_coma.h355
-rw-r--r--setedit/include/ced_exte.h417
-rw-r--r--setedit/include/ced_inte.h313
-rw-r--r--setedit/include/ced_pcre.h24
-rw-r--r--setedit/include/ceditint.h137
-rw-r--r--setedit/include/ceditor.h155
-rw-r--r--setedit/include/completi.h8
-rw-r--r--setedit/include/configed.h62
-rw-r--r--setedit/include/edmsg.h98
-rw-r--r--setedit/include/edspecs.h31
-rw-r--r--setedit/include/gzfiles.h59
-rw-r--r--setedit/include/keytrans.h155
-rw-r--r--setedit/include/loadkbin.h18
-rw-r--r--setedit/include/loadshl.h91
-rw-r--r--setedit/include/pathtool.h44
-rw-r--r--setedit/include/pmcoll.h29
-rw-r--r--setedit/include/runprog.h19
-rw-r--r--setedit/include/sdginter.h7
-rw-r--r--setedit/include/setconst.h13
-rw-r--r--setedit/include/sindicat.h43
-rw-r--r--setedit/include/slpinter.h12
-rw-r--r--setedit/include/splinman.h44
-rw-r--r--setedit/include/ssyntax.h11
-rw-r--r--setedit/include/tags.h235
-rw-r--r--setedit/include/tvsetuti.h69
-rw-r--r--setedit/include/ucdefs.h20
-rw-r--r--setedit/include/vername.h3
-rw-r--r--setedit/infview/change.log22
-rw-r--r--setedit/infview/include/inf.h367
-rw-r--r--setedit/infview/include/infalone.h73
-rw-r--r--setedit/infview/include/infbase.h239
-rw-r--r--setedit/infview/include/infbaser.h4
-rw-r--r--setedit/infview/include/infr.h16
-rw-r--r--setedit/infview/include/manview.h163
-rw-r--r--setedit/infview/inf.cc2514
-rw-r--r--setedit/infview/infbase.cc1996
-rw-r--r--setedit/infview/infdummy.cc4
-rw-r--r--setedit/infview/infmain.cc959
-rw-r--r--setedit/infview/infmenu.cc100
-rw-r--r--setedit/infview/manview.cc798
-rw-r--r--setedit/infview/names/nhiscoll.cc5
-rw-r--r--setedit/infview/names/ninfview.cc5
-rw-r--r--setedit/infview/names/ninfwind.cc5
-rw-r--r--setedit/infview/names/nmanwind.cc6
-rw-r--r--setedit/infview/streams/sinf.cc34
-rw-r--r--setedit/infview/streams/sman.cc20
-rw-r--r--setedit/infview/version.txt1
-rw-r--r--setedit/install/.cvsignore1
-rw-r--r--setedit/install/create.pl96
-rw-r--r--setedit/install/datafile.c1059
-rw-r--r--setedit/install/install.cc1665
-rw-r--r--setedit/install/readme.txt29
-rw-r--r--setedit/internac/.cvsignore6
-rw-r--r--setedit/internac/Makefile124
-rw-r--r--setedit/internac/colors.cc202
-rw-r--r--setedit/internac/de.po7715
-rw-r--r--setedit/internac/emptymsg.cc75
-rw-r--r--setedit/internac/es.po7413
-rw-r--r--setedit/internac/fix.c121
-rw-r--r--setedit/internac/fix.pl33
-rw-r--r--setedit/internac/getcolors.cc28
-rw-r--r--setedit/internac/getids.cc42
-rw-r--r--setedit/internac/gnumake.in124
-rw-r--r--setedit/internac/h_de.po15
-rw-r--r--setedit/internac/h_es.po15
-rw-r--r--setedit/internac/makelist.pl33
-rw-r--r--setedit/internac/po_list74
-rw-r--r--setedit/internac/utod.pl15
-rw-r--r--setedit/libbzip2/.cvsignore1
-rw-r--r--setedit/libbzip2/Makefile103
-rw-r--r--setedit/libbzip2/Makefile.bcc68
-rw-r--r--setedit/libbzip2/Makefile.nmk54
-rw-r--r--setedit/libbzip2/blocksort.c1134
-rw-r--r--setedit/libbzip2/bzlib.c1564
-rw-r--r--setedit/libbzip2/bzlib.h319
-rw-r--r--setedit/libbzip2/bzlib_private.h530
-rw-r--r--setedit/libbzip2/compress.c714
-rw-r--r--setedit/libbzip2/crctable.c144
-rw-r--r--setedit/libbzip2/decompress.c660
-rw-r--r--setedit/libbzip2/gnumake.in103
-rw-r--r--setedit/libbzip2/huffman.c228
-rw-r--r--setedit/libbzip2/license39
-rw-r--r--setedit/libbzip2/randtable.c124
-rw-r--r--setedit/libbzip2/readme166
-rw-r--r--setedit/libmigdb/DJGPP.why101
-rw-r--r--setedit/libmigdb/GPL-license340
-rw-r--r--setedit/libmigdb/Makefile15
-rw-r--r--setedit/libmigdb/README124
-rw-r--r--setedit/libmigdb/change.log182
-rwxr-xr-xsetedit/libmigdb/compress.sh3
-rw-r--r--setedit/libmigdb/doc/html.frt282
-rw-r--r--setedit/libmigdb/doc/reference.html5072
-rw-r--r--setedit/libmigdb/examples/Makefile31
-rw-r--r--setedit/libmigdb/examples/examples.epr.con_infobin0 -> 732 bytes
-rw-r--r--setedit/libmigdb/examples/linux_test.c195
-rw-r--r--setedit/libmigdb/examples/pty_test.c141
-rw-r--r--setedit/libmigdb/examples/pty_test.c.orig141
-rw-r--r--setedit/libmigdb/examples/remote_test.c179
-rw-r--r--setedit/libmigdb/examples/target_frames.cc23
-rw-r--r--setedit/libmigdb/examples/test.cc11
-rw-r--r--setedit/libmigdb/examples/test_bcd.codbin0 -> 6656 bytes
-rw-r--r--setedit/libmigdb/examples/test_target.cc22
-rw-r--r--setedit/libmigdb/examples/ticepic.c196
-rw-r--r--setedit/libmigdb/examples/x11_cpp_test.cc164
-rw-r--r--setedit/libmigdb/examples/x11_fr_test.c329
-rw-r--r--setedit/libmigdb/examples/x11_test.c192
-rw-r--r--setedit/libmigdb/examples/x11_wp_test.c292
-rw-r--r--setedit/libmigdb/files14
-rw-r--r--setedit/libmigdb/src/Makefile55
-rw-r--r--setedit/libmigdb/src/alloc.c307
-rw-r--r--setedit/libmigdb/src/breakpoint.c265
-rw-r--r--setedit/libmigdb/src/connect.c824
-rw-r--r--setedit/libmigdb/src/cpp_int.cc1109
-rw-r--r--setedit/libmigdb/src/data_man.c241
-rw-r--r--setedit/libmigdb/src/error.c38
-rw-r--r--setedit/libmigdb/src/get_free_pty.c132
-rw-r--r--setedit/libmigdb/src/get_free_vt.c153
-rw-r--r--setedit/libmigdb/src/mi_gdb.h958
-rw-r--r--setedit/libmigdb/src/misc.c109
-rw-r--r--setedit/libmigdb/src/parse.c1912
-rw-r--r--setedit/libmigdb/src/parse.c.orig1908
-rw-r--r--setedit/libmigdb/src/prg_control.c454
-rw-r--r--setedit/libmigdb/src/stack_man.c222
-rw-r--r--setedit/libmigdb/src/symbol_query.c32
-rw-r--r--setedit/libmigdb/src/target_man.c95
-rw-r--r--setedit/libmigdb/src/thread.c89
-rw-r--r--setedit/libmigdb/src/var_obj.c369
-rw-r--r--setedit/libpcre/.cvsignore4
-rw-r--r--setedit/libpcre/Makefile160
-rw-r--r--setedit/libpcre/Makefile.bcc73
-rw-r--r--setedit/libpcre/Makefile.nmk65
-rw-r--r--setedit/libpcre/README416
-rw-r--r--setedit/libpcre/dftables.c146
-rw-r--r--setedit/libpcre/get.c189
-rw-r--r--setedit/libpcre/gnumake.in160
-rw-r--r--setedit/libpcre/internal.h343
-rw-r--r--setedit/libpcre/licence32
-rw-r--r--setedit/libpcre/maketables.c113
-rw-r--r--setedit/libpcre/pcre.c4477
-rw-r--r--setedit/libpcre/pcre.h94
-rw-r--r--setedit/libpcre/study.c397
-rw-r--r--setedit/librhuti/abstorel.cc137
-rw-r--r--setedit/librhuti/back2sl.cc15
-rw-r--r--setedit/librhuti/basename.cc65
-rw-r--r--setedit/librhuti/expvar.cc48
-rw-r--r--setedit/librhuti/fexpand.cc24
-rw-r--r--setedit/librhuti/io.cc174
-rw-r--r--setedit/librhuti/rhutils.h196
-rw-r--r--setedit/librhuti/specs.cc890
-rw-r--r--setedit/librhuti/splitfn.cc134
-rw-r--r--setedit/librhuti/stricat.cc46
-rw-r--r--setedit/librhuti/stridown.cc23
-rw-r--r--setedit/librhuti/stridup.cc30
-rw-r--r--setedit/librhuti/strifree.cc13
-rw-r--r--setedit/libz/.cvsignore2
-rw-r--r--setedit/libz/Makefile175
-rw-r--r--setedit/libz/Makefile.bcc100
-rw-r--r--setedit/libz/Makefile.nmk95
-rw-r--r--setedit/libz/README148
-rw-r--r--setedit/libz/adler32.c48
-rw-r--r--setedit/libz/compress.c68
-rw-r--r--setedit/libz/crc32.c162
-rw-r--r--setedit/libz/deflate.c1350
-rw-r--r--setedit/libz/deflate.h318
-rw-r--r--setedit/libz/gnumake.in175
-rw-r--r--setedit/libz/gzio.c875
-rw-r--r--setedit/libz/infblock.c398
-rw-r--r--setedit/libz/infblock.h39
-rw-r--r--setedit/libz/infcodes.c257
-rw-r--r--setedit/libz/infcodes.h27
-rw-r--r--setedit/libz/inffast.c170
-rw-r--r--setedit/libz/inffast.h17
-rw-r--r--setedit/libz/inffixed.h151
-rw-r--r--setedit/libz/inflate.c366
-rw-r--r--setedit/libz/inftrees.c455
-rw-r--r--setedit/libz/inftrees.h58
-rw-r--r--setedit/libz/infutil.c87
-rw-r--r--setedit/libz/infutil.h98
-rw-r--r--setedit/libz/trees.c1214
-rw-r--r--setedit/libz/trees.h128
-rw-r--r--setedit/libz/uncompr.c58
-rw-r--r--setedit/libz/zconf.h279
-rw-r--r--setedit/libz/zlib.h893
-rw-r--r--setedit/libz/zutil.c225
-rw-r--r--setedit/libz/zutil.h220
-rw-r--r--setedit/mainsrc/accehtml.cc313
-rw-r--r--setedit/mainsrc/bufun.cc1024
-rw-r--r--setedit/mainsrc/ceditor.cc14361
-rw-r--r--setedit/mainsrc/completi.cc247
-rw-r--r--setedit/mainsrc/deedidia.cc527
-rw-r--r--setedit/mainsrc/doedidia.cc307
-rw-r--r--setedit/mainsrc/dumpfile.cc211
-rw-r--r--setedit/mainsrc/edconst.cc655
-rw-r--r--setedit/mainsrc/editorfo.cc3944
-rw-r--r--setedit/mainsrc/editwind.cc345
-rw-r--r--setedit/mainsrc/edspecs.cc275
-rw-r--r--setedit/mainsrc/fstrcmp.c664
-rw-r--r--setedit/mainsrc/gzfiles.cc752
-rw-r--r--setedit/mainsrc/keytrans.cc1281
-rw-r--r--setedit/mainsrc/linelen.cc104
-rw-r--r--setedit/mainsrc/loaddefl.cc727
-rw-r--r--setedit/mainsrc/loadfunc.cc165
-rw-r--r--setedit/mainsrc/loadshl.cc1469
-rw-r--r--setedit/mainsrc/loadusew.cc412
-rw-r--r--setedit/mainsrc/macrocom.cc120
-rw-r--r--setedit/mainsrc/pathtool.cc880
-rw-r--r--setedit/mainsrc/pclipper.cc284
-rw-r--r--setedit/mainsrc/pmacros.cc347
-rw-r--r--setedit/mainsrc/pperl.cc225
-rw-r--r--setedit/mainsrc/pphp.cc510
-rw-r--r--setedit/mainsrc/ppython.cc451
-rw-r--r--setedit/mainsrc/pvarious.cc378
-rw-r--r--setedit/mainsrc/pvhdl.cc335
-rw-r--r--setedit/mainsrc/rhideint.cc374
-rw-r--r--setedit/mainsrc/sdginter.cc218
-rw-r--r--setedit/mainsrc/search.cc630
-rw-r--r--setedit/mainsrc/slpinter.cc754
-rw-r--r--setedit/mainsrc/splinman.cc436
-rw-r--r--setedit/mainsrc/ssyntax.cc1083
-rw-r--r--setedit/mainsrc/tags.cc2127
-rw-r--r--setedit/mainsrc/tsindica.cc59
-rw-r--r--setedit/makes/.cvsignore5
-rw-r--r--setedit/makes/Makefile176
-rw-r--r--setedit/makes/allegro.cfg3
-rw-r--r--setedit/makes/amp3.gprbin0 -> 16302 bytes
-rw-r--r--setedit/makes/amp3.imk203
-rw-r--r--setedit/makes/amp3.umk16
-rw-r--r--setedit/makes/blink.c63
-rw-r--r--setedit/makes/common.bmk61
-rw-r--r--setedit/makes/common.imk35
-rw-r--r--setedit/makes/common.nmk63
-rw-r--r--setedit/makes/config.bcc42
-rw-r--r--setedit/makes/config.nmk34
-rw-r--r--setedit/makes/djgpp/compinf.pl333
-rwxr-xr-xsetedit/makes/djgpp/compress.bat6
-rw-r--r--setedit/makes/djgpp/compress.pl508
-rw-r--r--setedit/makes/djgppenv.env39
-rw-r--r--setedit/makes/easydiag.gprbin0 -> 46154 bytes
-rw-r--r--setedit/makes/easydiag.imk1072
-rw-r--r--setedit/makes/easydiag.umk108
-rw-r--r--setedit/makes/editor.bmk76
-rw-r--r--setedit/makes/editor.gprbin0 -> 206288 bytes
-rw-r--r--setedit/makes/editor.imk5750
-rw-r--r--setedit/makes/editor.mkf61
-rw-r--r--setedit/makes/editor.umk644
-rw-r--r--setedit/makes/extra.gprbin0 -> 7224 bytes
-rw-r--r--setedit/makes/extra.imk51
-rw-r--r--setedit/makes/extra.umk31
-rw-r--r--setedit/makes/extrimk.cc1062
-rw-r--r--setedit/makes/genimk.cc193
-rw-r--r--setedit/makes/includer.bmk35
-rw-r--r--setedit/makes/includer.imk35
-rw-r--r--setedit/makes/inffd.gprbin0 -> 19933 bytes
-rw-r--r--setedit/makes/inffd.imk378
-rw-r--r--setedit/makes/inffd.umk31
-rw-r--r--setedit/makes/infview.bmk68
-rw-r--r--setedit/makes/infview.gprbin0 -> 26360 bytes
-rw-r--r--setedit/makes/infview.imk635
-rw-r--r--setedit/makes/infview.mkf56
-rw-r--r--setedit/makes/infview.umk104
-rw-r--r--setedit/makes/install.gprbin0 -> 15519 bytes
-rw-r--r--setedit/makes/install.imk133
-rw-r--r--setedit/makes/install.mkf58
-rw-r--r--setedit/makes/install.umk56
-rw-r--r--setedit/makes/librhuti.gprbin0 -> 6699 bytes
-rw-r--r--setedit/makes/librhuti.imk81
-rw-r--r--setedit/makes/librhuti.umk52
-rw-r--r--setedit/makes/libset.gprbin0 -> 92539 bytes
-rw-r--r--setedit/makes/libset.imk2350
-rw-r--r--setedit/makes/libset.mkf60
-rw-r--r--setedit/makes/libset.umk245
-rw-r--r--setedit/makes/line.par5
-rw-r--r--setedit/makes/linux.env47
-rw-r--r--setedit/makes/linux/.cvsignore5
-rwxr-xr-xsetedit/makes/linux/compinf.pl371
-rwxr-xr-xsetedit/makes/linux/compress.pl590
-rw-r--r--setedit/makes/linux_set.env42
-rw-r--r--setedit/makes/lista892
-rw-r--r--setedit/makes/listaxtr6
-rw-r--r--setedit/makes/mlink.c73
-rw-r--r--setedit/makes/obj/delete.me2
-rw-r--r--setedit/makes/objinf/delete.me2
-rw-r--r--setedit/makes/objlib/delete.me2
-rw-r--r--setedit/makes/objsdg/delete.me2
-rw-r--r--setedit/makes/r.bat8
-rw-r--r--setedit/makes/readme.txt218
-rw-r--r--setedit/makes/rhide.env21
-rw-r--r--setedit/makes/sdgcline.gprbin0 -> 27404 bytes
-rw-r--r--setedit/makes/sdgcline.imk374
-rw-r--r--setedit/makes/sdgcline.mkf58
-rw-r--r--setedit/makes/sdgcline.umk89
-rw-r--r--setedit/makes/settv.gprbin0 -> 11663 bytes
-rw-r--r--setedit/makes/settv.imk261
-rw-r--r--setedit/makes/settv.umk124
-rw-r--r--setedit/makes/testeasy.gprbin0 -> 13796 bytes
-rw-r--r--setedit/makes/testeasy.imk96
-rw-r--r--setedit/makes/testeasy.mkf58
-rw-r--r--setedit/makes/testeasy.umk23
-rw-r--r--setedit/makes/tmp/delete.me2
-rw-r--r--setedit/makes/try-y.bat6
-rw-r--r--setedit/makes/yamd-off.bat5
-rw-r--r--setedit/makes/yamd-on.bat8
-rw-r--r--setedit/makes/yamddos.env43
-rw-r--r--setedit/miscperl.pl43
-rw-r--r--setedit/mp3/ampdiag.cc464
-rw-r--r--setedit/mp3/consts.h25
-rw-r--r--setedit/mp3/intermp3.cc279
-rw-r--r--setedit/mp3/intermp3.h102
-rw-r--r--setedit/mp3/libamp/.cvsignore2
-rw-r--r--setedit/mp3/libamp/amp.h59
-rw-r--r--setedit/mp3/libamp/audio.h180
-rw-r--r--setedit/mp3/libamp/audioalg.c422
-rw-r--r--setedit/mp3/libamp/audioio.h32
-rw-r--r--setedit/mp3/libamp/audiolib.c408
-rw-r--r--setedit/mp3/libamp/common.imk30
-rw-r--r--setedit/mp3/libamp/config.h67
-rw-r--r--setedit/mp3/libamp/controldata.h224
-rw-r--r--setedit/mp3/libamp/dump.c64
-rw-r--r--setedit/mp3/libamp/dump.h18
-rw-r--r--setedit/mp3/libamp/formats.c64
-rw-r--r--setedit/mp3/libamp/formats.h14
-rw-r--r--setedit/mp3/libamp/getbits.c274
-rw-r--r--setedit/mp3/libamp/getbits.h79
-rw-r--r--setedit/mp3/libamp/getdata.c235
-rw-r--r--setedit/mp3/libamp/getdata.h42
-rw-r--r--setedit/mp3/libamp/guicontr.c469
-rw-r--r--setedit/mp3/libamp/guicontrol.h3
-rw-r--r--setedit/mp3/libamp/huffman.c208
-rw-r--r--setedit/mp3/libamp/huffman.h259
-rw-r--r--setedit/mp3/libamp/layer2.c320
-rw-r--r--setedit/mp3/libamp/layer2.h190
-rw-r--r--setedit/mp3/libamp/layer3.c193
-rw-r--r--setedit/mp3/libamp/layer3.h16
-rw-r--r--setedit/mp3/libamp/libamp.gprbin0 -> 14072 bytes
-rw-r--r--setedit/mp3/libamp/libamp.h33
-rw-r--r--setedit/mp3/libamp/libamp.imk188
-rw-r--r--setedit/mp3/libamp/libamp.mkf39
-rw-r--r--setedit/mp3/libamp/libamp.umk68
-rw-r--r--setedit/mp3/libamp/misc2.c801
-rw-r--r--setedit/mp3/libamp/misc2.h253
-rw-r--r--setedit/mp3/libamp/obj/delete.me2
-rw-r--r--setedit/mp3/libamp/position.c101
-rw-r--r--setedit/mp3/libamp/position.h10
-rw-r--r--setedit/mp3/libamp/proto.h27
-rw-r--r--setedit/mp3/libamp/readme139
-rw-r--r--setedit/mp3/libamp/readme.txt41
-rw-r--r--setedit/mp3/libamp/rhide.env21
-rw-r--r--setedit/mp3/libamp/rtbuf.c535
-rw-r--r--setedit/mp3/libamp/rtbuf.h63
-rw-r--r--setedit/mp3/libamp/transfor.c1521
-rw-r--r--setedit/mp3/libamp/transform.h168
-rw-r--r--setedit/mp3/libamp/util.c109
-rw-r--r--setedit/mp3/mp3list.cc412
-rw-r--r--setedit/mp3/mp3play.cc684
-rw-r--r--setedit/mp3/mp3play.h74
-rw-r--r--setedit/mp3/mpegsound/.cvsignore3
-rw-r--r--setedit/mp3/mpegsound/bitwindow.cc64
-rw-r--r--setedit/mp3/mpegsound/common.imk30
-rw-r--r--setedit/mp3/mpegsound/fileinput.cc95
-rw-r--r--setedit/mp3/mpegsound/fileplayer.cc252
-rw-r--r--setedit/mp3/mpegsound/filter.cc341
-rw-r--r--setedit/mp3/mpegsound/filter_2.cc357
-rw-r--r--setedit/mp3/mpegsound/httpinput.cc308
-rw-r--r--setedit/mp3/mpegsound/huffmantable.cc587
-rw-r--r--setedit/mp3/mpegsound/mpegsnd.gprbin0 -> 14876 bytes
-rw-r--r--setedit/mp3/mpegsound/mpegsnd.imk148
-rw-r--r--setedit/mp3/mpegsound/mpegsnd.mkf39
-rw-r--r--setedit/mp3/mpegsound/mpegsnd.umk88
-rw-r--r--setedit/mp3/mpegsound/mpegsound.h790
-rw-r--r--setedit/mp3/mpegsound/mpegtable.cc191
-rw-r--r--setedit/mp3/mpegsound/mpegtoraw.cc850
-rw-r--r--setedit/mp3/mpegsound/mpegwtoraw.cc105
-rw-r--r--setedit/mp3/mpegsound/mpg_locals.h57
-rw-r--r--setedit/mp3/mpegsound/mpglayr1.cc107
-rw-r--r--setedit/mp3/mpegsound/mpglayr2.cc754
-rw-r--r--setedit/mp3/mpegsound/mpglayr3.cc1912
-rw-r--r--setedit/mp3/mpegsound/obj/delete.me2
-rw-r--r--setedit/mp3/mpegsound/osdisk.cc24
-rw-r--r--setedit/mp3/mpegsound/rawplayer.cc599
-rw-r--r--setedit/mp3/mpegsound/rawtofile.cc45
-rw-r--r--setedit/mp3/mpegsound/rawtowav.cc66
-rw-r--r--setedit/mp3/mpegsound/rhide.env21
-rw-r--r--setedit/mp3/mpegsound/soundinputstream.cc56
-rw-r--r--setedit/mp3/mpegsound/soundplayer.cc40
-rw-r--r--setedit/mp3/mpegsound/wavetoraw.cc112
-rw-r--r--setedit/names/nceditor.cc7
-rw-r--r--setedit/names/ndskwasc.cc5
-rw-r--r--setedit/names/ndskwcal.cc5
-rw-r--r--setedit/names/ndskwcli.cc5
-rw-r--r--setedit/names/ndskwclo.cc5
-rw-r--r--setedit/names/ndskwedi.cc5
-rw-r--r--setedit/names/ndskwhel.cc5
-rw-r--r--setedit/names/ndskwman.cc5
-rw-r--r--setedit/names/ndskwmes.cc5
-rw-r--r--setedit/names/ndskwmp3.cc5
-rw-r--r--setedit/names/ndskwprj.cc5
-rw-r--r--setedit/names/neditwin.cc6
-rw-r--r--setedit/names/nfileedi.cc5
-rw-r--r--setedit/names/nsindica.cc7
-rw-r--r--setedit/names/ntedcol.cc4
-rw-r--r--setedit/policy.txt41
-rw-r--r--setedit/redhat/README97
-rwxr-xr-xsetedit/redhat/config-rpm.sh8
-rwxr-xr-xsetedit/redhat/create-all-rpms.sh16
-rwxr-xr-xsetedit/redhat/create-dirs.sh13
-rwxr-xr-xsetedit/redhat/create-rpms.sh27
-rw-r--r--setedit/redhat/setedit.spec.in70
-rw-r--r--setedit/scrnsave/Makefile55
-rw-r--r--setedit/scrnsave/copying24
-rw-r--r--setedit/scrnsave/extrscsv.txt8
-rw-r--r--setedit/scrnsave/fakealle/fakealle.c117
-rw-r--r--setedit/scrnsave/fakealle/fakealle.gprbin0 -> 11210 bytes
-rw-r--r--setedit/scrnsave/fakealle/fakealle.mak319
-rw-r--r--setedit/scrnsave/fakealle/include/fakealle.h48
-rw-r--r--setedit/scrnsave/fakealle/include/putscree.h3
-rw-r--r--setedit/scrnsave/fakealle/include/varios.h8
-rw-r--r--setedit/scrnsave/fakealle/putscree.c8
-rw-r--r--setedit/scrnsave/fakealle/varios1.c34
-rw-r--r--setedit/scrnsave/how-to.txt75
-rw-r--r--setedit/scrnsave/plasma1/ps1.c226
-rw-r--r--setedit/scrnsave/plasma1/ps1.gprbin0 -> 9255 bytes
-rw-r--r--setedit/scrnsave/plasma1/ps1.mak324
-rw-r--r--setedit/scrnsave/plasma2/ps2.c216
-rw-r--r--setedit/scrnsave/plasma2/ps2.gprbin0 -> 9418 bytes
-rw-r--r--setedit/scrnsave/plasma2/ps2.mak335
-rw-r--r--setedit/scrnsave/plasma3/ps3.c145
-rw-r--r--setedit/scrnsave/plasma3/ps3.gprbin0 -> 9307 bytes
-rw-r--r--setedit/scrnsave/plasma3/ps3.mak334
-rw-r--r--setedit/scrnsave/plasma4/ps4.c186
-rw-r--r--setedit/scrnsave/plasma4/ps4.gprbin0 -> 9564 bytes
-rw-r--r--setedit/scrnsave/plasma4/ps4.mak338
-rw-r--r--setedit/scrnsave/plasmlib/include/lissa.h39
-rw-r--r--setedit/scrnsave/plasmlib/include/math1.h190
-rw-r--r--setedit/scrnsave/plasmlib/include/math2.h9
-rw-r--r--setedit/scrnsave/plasmlib/include/math4.h121
-rw-r--r--setedit/scrnsave/plasmlib/include/mixsurf.h40
-rw-r--r--setedit/scrnsave/plasmlib/include/mksurf.h13
-rw-r--r--setedit/scrnsave/plasmlib/include/mksurf4.h3
-rw-r--r--setedit/scrnsave/plasmlib/include/movsurf1.h12
-rw-r--r--setedit/scrnsave/plasmlib/include/movsurf2.h12
-rw-r--r--setedit/scrnsave/plasmlib/include/palette.h45
-rw-r--r--setedit/scrnsave/plasmlib/include/plasa1.h39
-rw-r--r--setedit/scrnsave/plasmlib/lissa.c303
-rw-r--r--setedit/scrnsave/plasmlib/math1.c45
-rw-r--r--setedit/scrnsave/plasmlib/math2.c51
-rw-r--r--setedit/scrnsave/plasmlib/math4.c230
-rw-r--r--setedit/scrnsave/plasmlib/mixsfake.gprbin0 -> 11166 bytes
-rw-r--r--setedit/scrnsave/plasmlib/mixsfake.mak318
-rw-r--r--setedit/scrnsave/plasmlib/mixsurf.c537
-rw-r--r--setedit/scrnsave/plasmlib/mksurf1.c36
-rw-r--r--setedit/scrnsave/plasmlib/mksurf2.c162
-rw-r--r--setedit/scrnsave/plasmlib/mksurf4.c266
-rw-r--r--setedit/scrnsave/plasmlib/movsurf1.c30
-rw-r--r--setedit/scrnsave/plasmlib/movsurf2.c16
-rw-r--r--setedit/scrnsave/plasmlib/obj/delete.me2
-rw-r--r--setedit/scrnsave/plasmlib/objfake/delete.me2
-rw-r--r--setedit/scrnsave/plasmlib/palette.c542
-rw-r--r--setedit/scrnsave/plasmlib/plasa1.c464
-rw-r--r--setedit/scrnsave/plasmlib/plasa2.c327
-rw-r--r--setedit/scrnsave/plasmlib/plasa2g.c133
-rw-r--r--setedit/scrnsave/plasmlib/plasa3.c173
-rw-r--r--setedit/scrnsave/plasmlib/plasmlib.gprbin0 -> 12782 bytes
-rw-r--r--setedit/scrnsave/plasmlib/plasmlib.mak359
-rw-r--r--setedit/scrnsave/readme.txt15
-rw-r--r--setedit/sdg/bufun2.cc370
-rw-r--r--setedit/sdg/edspecs2.cc129
-rw-r--r--setedit/sdg/gettext.c3
-rw-r--r--setedit/sdg/html.frt266
-rw-r--r--setedit/sdg/include/mli.h119
-rw-r--r--setedit/sdg/include/mliabase.h20
-rw-r--r--setedit/sdg/include/mliasimp.h22
-rw-r--r--setedit/sdg/include/mlibase.h130
-rw-r--r--setedit/sdg/include/mlicsdg.h21
-rw-r--r--setedit/sdg/include/mlieditd.h33
-rw-r--r--setedit/sdg/include/mliedito.h112
-rw-r--r--setedit/sdg/include/mlisdg.h19
-rw-r--r--setedit/sdg/include/mlisdgi.h19
-rw-r--r--setedit/sdg/include/mlivar.h179
-rw-r--r--setedit/sdg/include/txhgen.h22
-rw-r--r--setedit/sdg/mli.cc1731
-rw-r--r--setedit/sdg/mliasimp.cc67
-rw-r--r--setedit/sdg/mlicsdg.cc281
-rw-r--r--setedit/sdg/mliediti.cc178
-rw-r--r--setedit/sdg/mliedito.cc1179
-rw-r--r--setedit/sdg/mlisdg.cc93
-rw-r--r--setedit/sdg/multi.frt328
-rw-r--r--setedit/sdg/sdg.his29
-rw-r--r--setedit/sdg/tex.frt292
-rw-r--r--setedit/sdg/txhgen-i.htm582
-rw-r--r--setedit/sdg/txhgen-i.txi312
-rw-r--r--setedit/sdg/txhgen-i.txt251
-rw-r--r--setedit/sdg/txhgen.cc2105
-rw-r--r--setedit/sdg/txhgen.txt327
-rw-r--r--setedit/sdg/txhmain.cc187
-rwxr-xr-xsetedit/set_insed4
-rw-r--r--setedit/setedit/advice.cc261
-rw-r--r--setedit/setedit/ascii.cc217
-rw-r--r--setedit/setedit/boardmix.cc201
-rw-r--r--setedit/setedit/calendar.cc320
-rw-r--r--setedit/setedit/codepage.cc65
-rw-r--r--setedit/setedit/debug.cc8739
-rw-r--r--setedit/setedit/dskascii.cc70
-rw-r--r--setedit/setedit/dskcalen.cc80
-rw-r--r--setedit/setedit/dskclip.cc94
-rw-r--r--setedit/setedit/dskclose.cc103
-rw-r--r--setedit/setedit/dskedito.cc97
-rw-r--r--setedit/setedit/dskhelp.cc185
-rw-r--r--setedit/setedit/dskman.cc86
-rw-r--r--setedit/setedit/dskmessa.cc107
-rw-r--r--setedit/setedit/dskmp3.cc90
-rw-r--r--setedit/setedit/dskwin.cc265
-rw-r--r--setedit/setedit/dstfile.cc1474
-rw-r--r--setedit/setedit/edcolor.cc202
-rw-r--r--setedit/setedit/edfonts.cc184
-rw-r--r--setedit/setedit/editdiag.cc187
-rw-r--r--setedit/setedit/editmain.cc3395
-rw-r--r--setedit/setedit/editmenu.cc460
-rw-r--r--setedit/setedit/editpale.cc306
-rw-r--r--setedit/setedit/edkeys.cc634
-rw-r--r--setedit/setedit/edmsg.cc831
-rw-r--r--setedit/setedit/edprefs.cc1352
-rw-r--r--setedit/setedit/edprint.cc777
-rw-r--r--setedit/setedit/edprj.cc1469
-rw-r--r--setedit/setedit/getctxhl.cc275
-rw-r--r--setedit/setedit/holidays.cc351
-rw-r--r--setedit/setedit/include/advice.h22
-rw-r--r--setedit/setedit/include/ascii.h44
-rw-r--r--setedit/setedit/include/calendar.h50
-rw-r--r--setedit/setedit/include/codepage.h12
-rw-r--r--setedit/setedit/include/debug.h251
-rw-r--r--setedit/setedit/include/dskascii.h39
-rw-r--r--setedit/setedit/include/dskcalen.h39
-rw-r--r--setedit/setedit/include/dskclip.h41
-rw-r--r--setedit/setedit/include/dskclose.h44
-rw-r--r--setedit/setedit/include/dskedito.h45
-rw-r--r--setedit/setedit/include/dskhelp.h51
-rw-r--r--setedit/setedit/include/dskman.h38
-rw-r--r--setedit/setedit/include/dskmessa.h41
-rw-r--r--setedit/setedit/include/dskmp3.h42
-rw-r--r--setedit/setedit/include/dskprj.h48
-rw-r--r--setedit/setedit/include/dskwin.h62
-rw-r--r--setedit/setedit/include/edcollec.h80
-rw-r--r--setedit/setedit/include/editcoma.h107
-rw-r--r--setedit/setedit/include/edprint.h8
-rw-r--r--setedit/setedit/include/loadcle.h52
-rw-r--r--setedit/setedit/include/loadnobkp.h14
-rw-r--r--setedit/setedit/include/pal.h441
-rw-r--r--setedit/setedit/include/palbcc.h195
-rw-r--r--setedit/setedit/include/palconv.h208
-rw-r--r--setedit/setedit/include/paldjd.h208
-rw-r--r--setedit/setedit/include/palfte.h208
-rw-r--r--setedit/setedit/include/palmc.h195
-rw-r--r--setedit/setedit/include/pathlist.h13
-rw-r--r--setedit/setedit/include/setapp.h655
-rw-r--r--setedit/setedit/include/tpaltext.h43
-rw-r--r--setedit/setedit/intgrep.cc597
-rw-r--r--setedit/setedit/loadcle.cc384
-rw-r--r--setedit/setedit/loadnobkp.cc278
-rw-r--r--setedit/setedit/menuload.cc1498
-rw-r--r--setedit/setedit/msignal.cc142
-rw-r--r--setedit/setedit/pathlist.cc445
-rw-r--r--setedit/setedit/runprog.cc942
-rw-r--r--setedit/setedit/scresave.cc1156
-rw-r--r--setedit/setedit/streams/sdskasci.cc13
-rw-r--r--setedit/setedit/streams/sdskcale.cc13
-rw-r--r--setedit/setedit/streams/sdskclip.cc16
-rw-r--r--setedit/setedit/streams/sdskclos.cc17
-rw-r--r--setedit/setedit/streams/sdskedit.cc16
-rw-r--r--setedit/setedit/streams/sdskhelp.cc18
-rw-r--r--setedit/setedit/streams/sdskman.cc13
-rw-r--r--setedit/setedit/streams/sdskmess.cc15
-rw-r--r--setedit/setedit/streams/sdskmp3.cc13
-rw-r--r--setedit/setedit/streams/sdskprj.cc15
-rw-r--r--setedit/setedit/streams/sedcolle.cc15
-rw-r--r--setedit/setedit/tedcolle.cc956
-rw-r--r--setedit/setedit/tips.cc334
-rw-r--r--setedit/setedit/tpaltext.cc148
-rw-r--r--setedit/setedit/winlistd.cc170
-rw-r--r--setedit/settvuti/diaghelp.cc100
-rw-r--r--setedit/settvuti/dktclock.cc55
-rw-r--r--setedit/settvuti/fileopen.cc378
-rw-r--r--setedit/settvuti/fiopeaid.cc304
-rw-r--r--setedit/settvuti/include/diaghelp.h20
-rw-r--r--setedit/settvuti/include/dktclock.h18
-rw-r--r--setedit/settvuti/include/edhists.h50
-rw-r--r--setedit/settvuti/include/fileopen.h38
-rw-r--r--setedit/settvuti/include/fiopeaid.h22
-rw-r--r--setedit/settvuti/include/inputsca.h68
-rw-r--r--setedit/settvuti/include/nostatex.h18
-rw-r--r--setedit/settvuti/include/sarray.cc63
-rw-r--r--setedit/settvuti/include/sarray.h21
-rw-r--r--setedit/settvuti/include/setstack.h56
-rw-r--r--setedit/settvuti/include/settvuti.h273
-rw-r--r--setedit/settvuti/include/tdiagaid.h65
-rw-r--r--setedit/settvuti/include/tdiagrow.h34
-rw-r--r--setedit/settvuti/include/tinppipe.h37
-rw-r--r--setedit/settvuti/include/tnocastc.h286
-rw-r--r--setedit/settvuti/include/tnosostr.h37
-rw-r--r--setedit/settvuti/include/tprogbar.h43
-rw-r--r--setedit/settvuti/include/tprogdia.h11
-rw-r--r--setedit/settvuti/include/tprogrdi.h6
-rw-r--r--setedit/settvuti/include/tprogres.h27
-rw-r--r--setedit/settvuti/include/tstringa.h20
-rw-r--r--setedit/settvuti/include/tstrlbox.h43
-rw-r--r--setedit/settvuti/include/viewplus.h47
-rw-r--r--setedit/settvuti/inputsca.cc131
-rw-r--r--setedit/settvuti/names/ninputsc.cc6
-rw-r--r--setedit/settvuti/names/nprogbar.cc7
-rw-r--r--setedit/settvuti/names/nprogres.cc7
-rw-r--r--setedit/settvuti/names/ntnocast.cc6
-rw-r--r--setedit/settvuti/names/ntnosost.cc7
-rw-r--r--setedit/settvuti/nostatex.cc42
-rw-r--r--setedit/settvuti/setstack.cc381
-rw-r--r--setedit/settvuti/streams/sprogbar.cc8
-rw-r--r--setedit/settvuti/streams/sprogres.cc8
-rw-r--r--setedit/settvuti/streams/stnocast.cc23
-rw-r--r--setedit/settvuti/streams/stnonost.cc9
-rw-r--r--setedit/settvuti/tdiagaid.cc322
-rw-r--r--setedit/settvuti/tdiagrow.cc55
-rw-r--r--setedit/settvuti/tinppipe.cc229
-rw-r--r--setedit/settvuti/tnocastc.cc403
-rw-r--r--setedit/settvuti/tnosostr.cc18
-rw-r--r--setedit/settvuti/tprogbar.cc179
-rw-r--r--setedit/settvuti/tprogdia.cc75
-rw-r--r--setedit/settvuti/tprogrdi.cc44
-rw-r--r--setedit/settvuti/tprogres.cc80
-rw-r--r--setedit/settvuti/tstrlbox.cc102
-rw-r--r--setedit/settvuti/uisarray.cc8
-rw-r--r--setedit/settvuti/ussarray.cc8
-rw-r--r--setedit/settvuti/viewplus.cc249
-rw-r--r--setedit/snapshot.pl187
-rw-r--r--setedit/streams/sceditor.cc48
-rw-r--r--setedit/streams/sedhelp.cc42
-rw-r--r--setedit/streams/ssindica.cc12
-rw-r--r--setedit/tools/TVpo.pl15
-rwxr-xr-xsetedit/tools/applycvs.pl209
-rw-r--r--setedit/tools/cmclist.c46
-rw-r--r--setedit/tools/conv.cc81
-rw-r--r--setedit/tools/cvssget6
-rwxr-xr-xsetedit/tools/cvssput6
-rw-r--r--setedit/tools/cvssyncget.cc397
-rw-r--r--setedit/tools/cvssyncput.cc181
-rw-r--r--setedit/tools/kbv.c34
-rw-r--r--setedit/tools/lines.pl21
-rw-r--r--setedit/tools/makediff.bat5
-rw-r--r--setedit/tools/makediff.pl119
-rwxr-xr-xsetedit/tools/mapa.cc242
-rw-r--r--setedit/tools/mft.c29
-rw-r--r--setedit/tools/mft.gprbin0 -> 8784 bytes
-rw-r--r--setedit/tools/mideline.cc100
-rw-r--r--setedit/tools/moverepo.pl21
-rw-r--r--setedit/tools/putcopyr.pl122
-rw-r--r--setedit/tools/sarge.supp536
-rw-r--r--setedit/tools/symify.cc264
-rw-r--r--setedit/tools/valgrind.cmd1
-rw-r--r--setedit/tools/woody.supp127
-rwxr-xr-xsetedit/update16
-rwxr-xr-xsetedit/update.bat15
-rw-r--r--setedit/updaterev.pl24
-rw-r--r--setedit/version.txt1
-rw-r--r--setedit/windos.faq462
-rw-r--r--setedit/www-site/ComparativaGCC.html191
-rw-r--r--setedit/www-site/ComparativaGCC_html_m35e8e2b6.jpgbin0 -> 66009 bytes
-rw-r--r--setedit/www-site/Cygwin_install.txt135
-rw-r--r--setedit/www-site/announce.html266
-rw-r--r--setedit/www-site/change.html5928
-rw-r--r--setedit/www-site/examples.css26
-rw-r--r--setedit/www-site/iguazu.html40
-rw-r--r--setedit/www-site/index.html890
-rw-r--r--setedit/www-site/infview.html165
-rw-r--r--setedit/www-site/my_file1.html20
-rw-r--r--setedit/www-site/my_file2.html26
-rw-r--r--setedit/www-site/my_file3.html32
-rw-r--r--setedit/www-site/pmoreno.html32
-rw-r--r--setedit/www-site/readme.html578
-rw-r--r--setedit/www-site/readmeinf.html195
-rw-r--r--setedit/www-site/tag_imgs/a_project.pngbin0 -> 25901 bytes
-rw-r--r--setedit/www-site/tag_imgs/advice_tags.pngbin0 -> 3490 bytes
-rw-r--r--setedit/www-site/tag_imgs/class_child1.pngbin0 -> 4296 bytes
-rw-r--r--setedit/www-site/tag_imgs/class_list.pngbin0 -> 9791 bytes
-rw-r--r--setedit/www-site/tag_imgs/d_tag_options.pngbin0 -> 3295 bytes
-rw-r--r--setedit/www-site/tag_imgs/generate_tags.pngbin0 -> 2939 bytes
-rw-r--r--setedit/www-site/tag_imgs/jump_symbol.pngbin0 -> 13790 bytes
-rw-r--r--setedit/www-site/tag_imgs/name_project.pngbin0 -> 10501 bytes
-rw-r--r--setedit/www-site/tag_imgs/project_open.pngbin0 -> 16354 bytes
-rw-r--r--setedit/www-site/tag_imgs/sorted.pngbin0 -> 3990 bytes
-rw-r--r--setedit/www-site/tag_imgs/symbols_example.pngbin0 -> 28936 bytes
-rw-r--r--setedit/www-site/tag_imgs/tag_options.pngbin0 -> 12573 bytes
-rw-r--r--setedit/www-site/tag_imgs/this_and_parents.pngbin0 -> 4150 bytes
-rw-r--r--setedit/www-site/tag_imgs/this_class.pngbin0 -> 4102 bytes
-rw-r--r--setedit/www-site/tag_imgs/w_completion.pngbin0 -> 2173 bytes
-rw-r--r--setedit/www-site/tags.html318
-rwxr-xr-xsetedit/www-site/update2
-rw-r--r--setedit/www-site/xterm.html63
-rw-r--r--src/GNUmakefile4
967 files changed, 277104 insertions, 4 deletions
diff --git a/README b/README
index 94b5a68..32f9c72 100644
--- a/README
+++ b/README
@@ -5,6 +5,6 @@ gizmos, can go to windows
sigalatvision - the one from http://www.sigala.it/sergio/tvision/
freebsdtivison - the FreeBSD version, works completly without X, some
-trouble with std::streampos, BSDisms, etc.
-
+trouble with std::streampos, BSDisms, etc., some const char * problems
+http://sourceforge.net/projects/setedit/
diff --git a/setedit/.cvsignore b/setedit/.cvsignore
new file mode 100644
index 0000000..805c49d
--- /dev/null
+++ b/setedit/.cvsignore
@@ -0,0 +1,3 @@
+configure.cache
+Makefile
+setedit.epr
diff --git a/setedit/INSTALL.txt b/setedit/INSTALL.txt
new file mode 100644
index 0000000..126ac33
--- /dev/null
+++ b/setedit/INSTALL.txt
@@ -0,0 +1,33 @@
+ Read this file to know how to install from sources.
+
+ The editor have an unified methode to compile for all the available
+platforms. But even with it I give separated instructions for each target.
+ The first step is to get a copy of Turbo Vision library, last version
+available, and compile it. Even when you don't need to install Turbo Vision
+in order to compile the editor in some cases you'll need to install Turbo
+Vision to *run* the editor. You can unpack the Turbo Vision files in any
+directory but I recommend to unpack the files in a directory located at the
+same level as setedit sources. Example: if the editor files are located in
+the /usr/src/setedit directory then the Turbo Vision files should be located
+in the /usr/src/tvision. Just unpack both packages in the same directory and
+let them put their files in setedit and tvision dirs.
+ Note 1: Turbo Vision site is http://tvision.sf.net/
+ Note 2: The last recommendation is currently mandatory for Borland and
+Microsoft compilers.
+
+ Here are the files that describes how to compile for each target:
+ [alphabetically sorted]
+
+Borland C++ (5.5, 5.6) doc/install/bcc.txt
+CygWin doc/install/cygwin.txt
+DJGPP (2.02, 2.03) doc/install/djgpp.txt
+Linux doc/install/linux.txt
+Microsoft Visual C (5.0, 6.0, 7.0) doc/install/msvc.txt
+MingWin doc/install/mingwin.txt
+UNIX (POSIX) systems doc/install/unix.txt
+
+ Important: If you want to contribute to this project you can help me to
+keep any of these targets working. You just need to get the CVS changes
+periodically compile and tell me if it worked or not.
+
+$Id: INSTALL.txt,v 1.3 2004/06/09 15:08:34 set Exp $
diff --git a/setedit/Makefile b/setedit/Makefile
new file mode 100644
index 0000000..180c1ba
--- /dev/null
+++ b/setedit/Makefile
@@ -0,0 +1,81 @@
+# Generated automatically by the configure script
+
+ifneq ($(strip $(prefix)),)
+ MPREFIX=$(prefix)
+else
+ MPREFIX=/usr
+endif
+ifeq ($(INSTALL),)
+ INSTALL=install
+endif
+libdir=$(MPREFIX)/lib
+CFLAGS=-march=i686 -mtune=generic -O2 -pipe
+CXXFLAGS=-march=i686 -mtune=generic -O2 -pipe
+SET_USE_FHS=no
+export
+
+.PHONY: needed infview libmpegsnd internac doc-basic holidays libmigdb
+
+all: Makefile editor infview
+
+
+Makefile: config.pl conflib.pl
+ $(error Please reconfigure the package! Alternative: "touch Makefile")
+
+libmpegsnd:
+ $(MAKE) -C mp3/mpegsound -f mpegsnd.mkf
+
+libmigdb:
+ $(MAKE) -C libmigdb
+
+internac:
+ $(MAKE) -C internac
+
+doc-basic:
+ $(MAKE) -C doc txt info
+
+# Libraries not created by RHIDE projects
+needed: libmpegsnd holidays libmigdb internac doc-basic
+
+editor: needed
+ $(MAKE) -C makes
+
+infview:
+ $(MAKE) -C makes infview
+
+holidays:
+ $(MAKE) -C holidays
+
+install-editor: editor
+ $(MAKE) -C makes install "EXTRA_INS_OPS=--no-compress "
+
+install-infview: infview
+ $(MAKE) -C makes install-infview "EXTRA_INS_OPS=--no-compress "
+
+install: install-editor install-infview
+
+
+distrib-editor: needed
+ $(MAKE) -C makes distrib "EXTRA_INS_OPS=--no-compress "
+
+distrib-source:
+ $(MAKE) -C makes distrib-source "EXTRA_INS_OPS=--no-compress "
+
+distrib-infview: needed
+ $(MAKE) -C makes distrib-infview "EXTRA_INS_OPS=--no-compress "
+
+distrib: distrib-editor distrib-infview
+
+clean:
+ cd makes; $(MAKE) clean-o; $(MAKE) clean-docs; cd ..
+ rm -f configure.cache
+ rm -f Makefile
+ rm -f errormsg.txt
+ rm -f doc/sdh.exe
+ rm -f include/configed.h
+ rm -rf makes/linux/result makes/linux/resultInf makes/linux/setedit-* makes/linux/infview-*
+ rm -f makes/*.a makes/*.exe makes/*.gdt
+ rm -f mp3/libamp/*.a mp3/libamp/obj/*.o
+ rm -f mp3/mpegsound/*.a mp3/mpegsound/obj/*.o
+ $(MAKE) -C holidays clean
+ $(MAKE) -C libmigdb clean
diff --git a/setedit/Makefile.bcc b/setedit/Makefile.bcc
new file mode 100644
index 0000000..8817566
--- /dev/null
+++ b/setedit/Makefile.bcc
@@ -0,0 +1,120 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# That's the makefile for Borland C++ compiler.
+# I used BC++ 5.5 free command line tools for testing.
+#
+
+#
+# Used for a rudimentary install target.
+#
+DEST_BIN_DIR=c:\setedit
+DEST_SET_DIR=c:\setedit
+
+#
+# This file contains the definitions that configure the compilation.
+# i.e. CFLAGS
+# The path for TV includes and headers is configured in this file.
+#
+!ifndef FOR_NMAKE
+!include makes\config.bcc
+!else
+!include makes\config.nmk
+MAKE=nmake
+!endif
+
+#
+# Main targets
+#
+all: editor infview
+
+editor: libs
+ -cd makes
+ $(MAKE) MKF_EXT="$(MKF_EXT)" DEBUG="$(DEBUG)" -f editor.bmk all
+ -cd ..
+
+infview: libs
+ -cd makes
+ $(MAKE) MKF_EXT="$(MKF_EXT)" DEBUG="$(DEBUG)" -f infview.bmk all
+ -cd ..
+
+#
+# Support libraries
+#
+
+libs: libz\zlib.lib libpcre\pcre.lib libbzip2\bzip2.lib
+
+libz\zlib.lib:
+ cd libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..
+
+libpcre\pcre.lib:
+ cd libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..
+
+libbzip2\bzip2.lib:
+ cd libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..
+
+
+#
+# These are various targets I copied from the original make file.
+#
+
+install: editor.exe doc
+ cd makes
+ echo dummy >a.exe
+ xcopy /I *.exe $(DEST_BIN_DIR)
+ -del a.exe
+ -del $(DEST_BIN_DIR)\a.exe
+ xcopy /I /S /E ..\cfgfiles\*.* $(DEST_SET_DIR)
+ cd ..\doc
+ make -f Makefile$(MK_EXT) DEST_SET_DIR=$(DEST_SET_DIR) install
+ cd ..
+
+doc:
+ cd doc
+ make -f Makefile$(MK_EXT)
+ cd ..
+
+#
+# Clean targets
+#
+
+clean:
+ -del makes\obj\*.obj
+ -del makes\objinf\*.obj
+ -del makes\*.exe
+ -del makes\*.obj
+ -del makes\*.lib
+ -del makes\*.tds
+
+clean-zlib:
+ cd libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..
+
+clean-pcre:
+ cd libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..
+
+clean-bzip2:
+ cd libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..
+
+clean-libs: clean-zlib clean-pcre clean-bzip2
+
+clean-doc:
+ cd doc
+ make -f Makefile$(MK_EXT) clean
+ cd ..
+
+clean-all: clean clean-libs clean-doc
+
diff --git a/setedit/Makefile.nmk b/setedit/Makefile.nmk
new file mode 100644
index 0000000..f8db22e
--- /dev/null
+++ b/setedit/Makefile.nmk
@@ -0,0 +1,16 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2004 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# That's the makefile for MSVC compiler.
+#
+# This file reuses the Makefile.bcc file but defining FOR_NMAKE variable to
+# select Microsoft tools.
+#
+
+FOR_NMAKE=1
+# Uncomment to generate code with debug information.
+#DEBUG=1
+!include Makefile.bcc
+
diff --git a/setedit/README b/setedit/README
new file mode 100644
index 0000000..d0d0ac1
--- /dev/null
+++ b/setedit/README
@@ -0,0 +1,55 @@
+Hi! That's the readme file for the sources.
+
+0. Urgent! I'm in a hurry ...
+1. Introduction
+2. How to compile
+
+-----------------------------------------------------------------------------
+
+0. Urgent! I'm in a hurry ...
+
+ This is a really simple explanation, I strongly suggest reading the
+INSTALL.txt file.
+ If you are running Linux, djgpp, Cygwin or MinGW equiped with most UNIX
+tools (shell utils, file utils, perl, make, etc.) you can try the following:
+
+1) Install, configure, make and make install the Turbo Vision library (last
+version available).
+2) Do the same with the editor, here is how if you don't know:
+
+A) Run the configure script (./configure or configure).
+
+Examples:
+ linux:/usr/src/tvision# ./configure
+ c:\djgpp\contrib\tvision>configure
+
+B) If all is OK run "make".
+C) If all is OK just run "make install".
+
+ With it you'll get the editor compiled and installed.
+ If the installation prefix directory is wrongly guessed call the configure
+script passing --prefix=dir as argument.
+Example:
+ linux:/usr/src/tvision# ./configure --prefix=/usr/local
+
+
+
+1. Introduction:
+
+ For information about copyrights read the copyrigh file, the editor is
+mostly GPL/LGPL. I made it GPL because is the less restrictive license for
+developing, not for people trying to use the editor's sources. Why? if the
+code is GPL I can use GPL sources in my code without problems and I want to
+use good code from others instead of reinventing things.
+ Note: I put a lot of effort to make the compilation smooth but you should
+read all the docs and get all the needed tools.
+
+
+
+2. How to compile:
+
+ The file INSTALL.txt contains some basic instructions and explains which
+file you have to read according with your system.
+
+
+Happy hacking.
diff --git a/setedit/TODO b/setedit/TODO
new file mode 100644
index 0000000..cca2c4f
--- /dev/null
+++ b/setedit/TODO
@@ -0,0 +1,39 @@
+That's a list of things to do in the project:
+
+ gpg --batch --passphrase-fd 0 -d arena.dtd.asc
+
+ set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
+ set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0xC9C40C31 -- -r %r -- %f"
+ Mejorar la deteccin de errores, en particular de escritura cuando !ok
+
+* Una manera de especificar que un men lo que hace es cambiar una rama del men por otra.
+ De esa manera en el men de Debug podra haber una entrada "Debug mode: Valgrind" y
+ cuando se elije el men cambia por otro que tiene la opcin "Debug mode: GDB".
+ Esto podra controlarse como un parmetro ms de SubMenu: que permita variantes y algn
+ comando especial tipo cm[variante].
+ Luego el men del valgrind podra reusar la mayor parte de los comandos y dems del
+ del GDB.
+ Otro tema a resolver es a donde tira la info que recoge del wrapper.
+
+* Navigate projects changing the working directory. It should use a stack of
+current directories. Each time a subproject is opened the directory is changed
+and the old pushed to the stack. When the project is closed a pop should
+provide the previous dir and project. If the user breaks the chain by manually
+opening another project the stack should by flushed.
+ It will mostly help Windows users that likes to start an application from a
+central icon and then choose the working dir.
+
+* Add the TV templated suggested by JASC to simplify the code.
+
+* Fix problems with the code pages in Windows versions. Reference report:
+0001.txt.
+* Check what can be removed from:
+ SaveFontLoadedInfo(s);
+ SavePaletteSystem(s);
+ s << TScreen::screenMode;
+ s << UseExternPrgForMode;
+ s.writeString(ExternalPrgMode);
+* Remove: TSetEditorApp::ExternalPrgMode, UseExternPrgForMode
+* Clean code page and font code.
+* Clean all preferences dialogs.
+* Evaluate if the TTextPalette member should test Changed before calling the low level set.
diff --git a/setedit/WinNT/Makefile b/setedit/WinNT/Makefile
new file mode 100644
index 0000000..887b168
--- /dev/null
+++ b/setedit/WinNT/Makefile
@@ -0,0 +1,191 @@
+#
+# This makefile is deprecated, you should use it only if the "new" mechanism
+# fails. Please read the INSTALL.txt instructions.
+# If you must use this file please report it.
+#
+DEST_BIN_DIR = c:\setedit
+DEST_SET_DIR = c:\setedit
+
+TV_LIB = ..\..\tvision\winnt\rhtv.lib
+
+
+
+all: setedit.exe
+
+# Borland C++
+
+CC = bcc32
+LD = bcc32
+CXX = $(CC)
+INC = -I.\include -I..\include
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLDFLAGS = -WR
+!endif
+
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLDFLAGS) -WC -X -q $(CDEBUGFLAGS) \
+ -D__inline__=inline -DFOR_EDITOR
+# Note: rch == Unreachable code. BC++ 5.5 is idiot to detect code that is
+# disabled on purpose. i.e. if (0) ...
+CXXFLAGS = -P -RT- -w-hid -w-par -w-rch $(CFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+INC = -I. -I.\inc -I..\..\tvision\winnt\include -I..\..\tvision\include \
+ -I..\include -I..\setedit\include -I..\settvuti\include -I..\easydiag \
+ -I..\infview\include -I..\librhuti -I..\sdg\include -I..\mp3 -I..\extra \
+ -I..\calcu -I..\libz -I..\libpcre -I..\libbzip2 -I..\holidays
+
+{..\setedit}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\setedit\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\librhuti}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\easydiag}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\infview}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\infview\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\infview\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\calcu}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\settvuti}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\settvuti\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\settvuti\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\sdg}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\extra}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\mp3}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\mainsrc}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\mainsrc}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+{..\calcu}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+{..\extra}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+
+objs\edspecs.obj: ..\mainsrc\edspecs.cc
+objs\bufun.obj: ..\mainsrc\bufun.cc
+
+EDITOR_OBJS_ = +accehtml.obj +advice.obj +ampdiag.obj +intermp3.obj +mp3list.obj +mp3play.obj\
+ +ascii.obj +boardmix.obj +bufun.obj +calcu.obj +calendar.obj +ceditor.obj +codepage.obj\
+ +completi.obj +debug.obj +deedidia.obj +doedidia.obj +dskascii.obj +dskcalen.obj\
+ +dskclip.obj +dskclose.obj +dskedito.obj +dskhelp.obj +dskman.obj +dskmessa.obj\
+ +dskmp3.obj +dskwin.obj +dstfile.obj +dumpfile.obj +edcolor.obj +edconst.obj +edfonts.obj\
+ +editdiag.obj +editmain.obj +editmenu.obj +editorfo.obj +editpale.obj +editwind.obj\
+ +edkeys.obj +edmsg.obj +edprefs.obj +edprint.obj +edprj.obj +edspecs.obj \
+ +dyncat.obj +mixer.obj +stackdbg.obj +strncpyz.obj\
+ +strndup.obj +fstrcmp.obj +getctxhl.obj +gzfiles.obj +holidays.obj +inf.obj +infbase.obj\
+ +manview.obj +nhiscoll.obj +ninfview.obj +ninfwind.obj +nmanwind.obj +sinf.obj +sman.obj\
+ +intgrep.obj +keytrans.obj +linelen.obj +loadcle.obj +loaddefl.obj +loadfunc.obj\
+ +loadnobkp.obj +loadshl.obj +loadusew.obj +macrocom.obj +menuload.obj +mli.obj\
+ +mliasimp.obj +mlicsdg.obj +mliediti.obj +mliedito.obj +mlisdg.obj +msignal.obj\
+ +nceditor.obj +ndskwasc.obj +ndskwcal.obj +ndskwcli.obj +ndskwclo.obj +ndskwedi.obj\
+ +ndskwhel.obj +ndskwman.obj +ndskwmes.obj +ndskwmp3.obj +ndskwprj.obj +neditwin.obj\
+ +nfileedi.obj +nsindica.obj +ntedcol.obj +parser.obj +pathlist.obj +pathtool.obj\
+ +pclipper.obj +pmacros.obj +pperl.obj +pphp.obj +ppython.obj +pvarious.obj +pvhdl.obj\
+ +runprog.obj +sceditor.obj +scresave.obj +sdginter.obj +sdskasci.obj +sdskcale.obj\
+ +sdskclip.obj +sdskclos.obj +sdskedit.obj +sdskhelp.obj +sdskman.obj +sdskmess.obj\
+ +sdskmp3.obj +sdskprj.obj +search.obj +sedcolle.obj +slpinter.obj +splinman.obj\
+ +ssindica.obj +ssyntax.obj +tags.obj +tedcolle.obj +tips.obj +tpaltext.obj +tsindica.obj\
+ +txhgen.obj +winlistd.obj +lablchek.obj +lablradi.obj +snostate.obj +tcheck2.obj\
+ +tmiclust.obj +tsbutton.obj +tschkarr.obj +tschkbox.obj +tshscrol.obj +tshzgrp.obj\
+ +tsinplin.obj +tsinplpi.obj +tslabel.obj +tslider.obj +tslistbo.obj +tsradbot.obj\
+ +tssortlb.obj +tssosslb.obj +tstatext.obj +tstextsc.obj +tstsorlb.obj +tsvegrp.obj\
+ +tsview.obj +tsviewco.obj +ttextscr.obj +diaghelp.obj +dktclock.obj +fileopen.obj\
+ +fiopeaid.obj +inputsca.obj +ninputsc.obj +nostatex.obj +nprogbar.obj +nprogres.obj\
+ +ntnocast.obj +ntnosost.obj +setstack.obj +sprogbar.obj +sprogres.obj +stnocast.obj\
+ +stnonost.obj +tdiagaid.obj +tdiagrow.obj +tinppipe.obj +tnocastc.obj +tnosostr.obj\
+ +tprogbar.obj +tprogdia.obj +tprogrdi.obj +tprogres.obj +tstrlbox.obj +uisarray.obj\
+ +ussarray.obj +viewplus.obj +abstorel.obj +back2sl.obj +basename.obj +fexpand.obj +io.obj\
+ +specs.obj +splitfn.obj +stricat.obj +stridown.obj +stridup.obj +strifree.obj
+EDITOR_OBJS = $(EDITOR_OBJS_:+=objs\)
+
+EXTRA_LIBS = ..\libz\zlib.lib ..\libpcre\pcre.lib ..\libbzip2\bzip2.lib
+
+EXTRALIB_MAKE_ARGS = _SUBMAKE=1 CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.bcc
+
+libs: $(EXTRA_LIBS)
+
+..\libz\zlib.lib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libpcre\pcre.lib:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libbzip2\bzip2.lib:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+clean-zlib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-pcre:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-bzip2:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-libs: clean-zlib clean-pcre clean-bzip2
+
+setedit.exe: $(EXTRA_LIBS) $(EDITOR_OBJS)
+ $(LD) $(LDFLAGS) -esetedit $(EDITOR_OBJS) $(EXTRA_LIBS) $(TV_LIB)
+
+install: setedit.exe doc
+ echo dummy >a.exe
+ xcopy /I *.exe $(DEST_BIN_DIR)
+ -del a.exe
+ -del $(DEST_BIN_DIR)\a.exe
+ xcopy /I /S /E ..\cfgfiles\*.* $(DEST_SET_DIR)
+ cd ..\doc
+ make -f Makefile.bcc DEST_SET_DIR=$(DEST_SET_DIR) install
+ cd ..\winnt
+
+doc:
+ cd ..\doc
+ make -f Makefile.bcc
+ cd ..\winnt
+
+clean-doc:
+ cd ..\doc
+ make -f Makefile.bcc clean
+ cd ..\winnt
+
+clean:
+ -del objs\*.obj
+ -del *.exe
+ -del *.obj
+ -del *.lib
+ -del *.tds
+
+clean-all: clean clean-libs clean-doc
diff --git a/setedit/WinNT/Makefile.nmk b/setedit/WinNT/Makefile.nmk
new file mode 100644
index 0000000..f5b78a1
--- /dev/null
+++ b/setedit/WinNT/Makefile.nmk
@@ -0,0 +1,181 @@
+#
+# This makefile is deprecated, you should use it only if the "new" mechanism
+# fails. Please read the INSTALL.txt instructions.
+# If you must use this file please report it.
+#
+DEST_BIN_DIR = c:\setedit
+DEST_SET_DIR = c:\setedit
+
+TV_LIB = ..\..\tvision\winnt\libtv.lib
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+all:: setedit.exe
+
+# MSVC
+
+CC = cl /nologo
+CXX = $(CC)
+LD = $(CXX)
+INC = -I. -I.\inc -I..\..\tvision\winnt\include -I..\..\tvision\include \
+ -I..\include -I..\setedit\include -I..\settvuti\include -I..\easydiag \
+ -I..\infview\include -I..\librhuti -I..\sdg\include -I..\mp3 -I..\extra \
+ -I..\calcu -I..\libz -I..\libpcre -I..\libbzip2 -I..\holidays
+
+CFLAGS = -O2 $(INC) -D_WIN32 -DFOR_EDITOR /GR- /GX-
+CXXFLAGS = $(CFLAGS)
+LDFLAGS = -link $(TV_LIB) user32.lib
+OBJDIR = objs
+
+{..\setedit}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\setedit\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\names}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\librhuti}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\easydiag}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\infview}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\infview\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\infview\names}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\calcu}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\settvuti}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\settvuti\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\settvuti\names}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\sdg}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\extra}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\mp3}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\mainsrc}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+
+{..\mainsrc}.c{$(OBJDIR)}.o:
+ $(CC) -c $(CFLAGS) $(INC) $? -Fo$*.o
+{..\calcu}.c{$(OBJDIR)}.o:
+ $(CC) -c $(CFLAGS) $(INC) $? -Fo$*.o
+{..\extra}.c{$(OBJDIR)}.o:
+ $(CC) -c $(CFLAGS) $(INC) $? -Fo$*.o
+
+$(OBJDIR)\edspecs.o: ..\mainsrc\edspecs.cc
+$(OBJDIR)\bufun.o: ..\mainsrc\bufun.cc
+
+EDITOR_OBJS = $(OBJDIR)/accehtml.o $(OBJDIR)/advice.o $(OBJDIR)/ampdiag.o $(OBJDIR)/intermp3.o $(OBJDIR)/mp3list.o $(OBJDIR)/mp3play.o\
+ $(OBJDIR)/ascii.o $(OBJDIR)/boardmix.o $(OBJDIR)/bufun.o $(OBJDIR)/calcu.o $(OBJDIR)/calendar.o $(OBJDIR)/ceditor.o $(OBJDIR)/codepage.o\
+ $(OBJDIR)/completi.o $(OBJDIR)/debug.o $(OBJDIR)/deedidia.o $(OBJDIR)/doedidia.o $(OBJDIR)/dskascii.o $(OBJDIR)/dskcalen.o\
+ $(OBJDIR)/dskclip.o $(OBJDIR)/dskclose.o $(OBJDIR)/dskedito.o $(OBJDIR)/dskhelp.o $(OBJDIR)/dskman.o $(OBJDIR)/dskmessa.o\
+ $(OBJDIR)/dskmp3.o $(OBJDIR)/dskwin.o $(OBJDIR)/dstfile.o $(OBJDIR)/dumpfile.o $(OBJDIR)/edcolor.o $(OBJDIR)/edconst.o $(OBJDIR)/edfonts.o\
+ $(OBJDIR)/editdiag.o $(OBJDIR)/editmain.o $(OBJDIR)/editmenu.o $(OBJDIR)/editorfo.o $(OBJDIR)/editpale.o $(OBJDIR)/editwind.o\
+ $(OBJDIR)/edkeys.o $(OBJDIR)/edmsg.o $(OBJDIR)/edprefs.o $(OBJDIR)/edprint.o $(OBJDIR)/edprj.o $(OBJDIR)/edspecs.o \
+ $(OBJDIR)/dyncat.o $(OBJDIR)/mixer.o $(OBJDIR)/stackdbg.o $(OBJDIR)/strncpyz.o\
+ $(OBJDIR)/strndup.o $(OBJDIR)/fstrcmp.o $(OBJDIR)/getctxhl.o $(OBJDIR)/gzfiles.o $(OBJDIR)/holidays.o $(OBJDIR)/inf.o $(OBJDIR)/infbase.o\
+ $(OBJDIR)/manview.o $(OBJDIR)/nhiscoll.o $(OBJDIR)/ninfview.o $(OBJDIR)/ninfwind.o $(OBJDIR)/nmanwind.o $(OBJDIR)/sinf.o $(OBJDIR)/sman.o\
+ $(OBJDIR)/intgrep.o $(OBJDIR)/keytrans.o $(OBJDIR)/linelen.o $(OBJDIR)/loadcle.o $(OBJDIR)/loaddefl.o $(OBJDIR)/loadfunc.o\
+ $(OBJDIR)/loadnobkp.o $(OBJDIR)/loadshl.o $(OBJDIR)/loadusew.o $(OBJDIR)/macrocom.o $(OBJDIR)/menuload.o $(OBJDIR)/mli.o\
+ $(OBJDIR)/mliasimp.o $(OBJDIR)/mlicsdg.o $(OBJDIR)/mliediti.o $(OBJDIR)/mliedito.o $(OBJDIR)/mlisdg.o $(OBJDIR)/msignal.o\
+ $(OBJDIR)/nceditor.o $(OBJDIR)/ndskwasc.o $(OBJDIR)/ndskwcal.o $(OBJDIR)/ndskwcli.o $(OBJDIR)/ndskwclo.o $(OBJDIR)/ndskwedi.o\
+ $(OBJDIR)/ndskwhel.o $(OBJDIR)/ndskwman.o $(OBJDIR)/ndskwmes.o $(OBJDIR)/ndskwmp3.o $(OBJDIR)/ndskwprj.o $(OBJDIR)/neditwin.o\
+ $(OBJDIR)/nfileedi.o $(OBJDIR)/nsindica.o $(OBJDIR)/ntedcol.o $(OBJDIR)/parser.o $(OBJDIR)/pathlist.o $(OBJDIR)/pathtool.o\
+ $(OBJDIR)/pclipper.o $(OBJDIR)/pmacros.o $(OBJDIR)/pperl.o $(OBJDIR)/pphp.o $(OBJDIR)/ppython.o $(OBJDIR)/pvarious.o $(OBJDIR)/pvhdl.o\
+ $(OBJDIR)/runprog.o $(OBJDIR)/sceditor.o $(OBJDIR)/scresave.o $(OBJDIR)/sdginter.o $(OBJDIR)/sdskasci.o $(OBJDIR)/sdskcale.o\
+ $(OBJDIR)/sdskclip.o $(OBJDIR)/sdskclos.o $(OBJDIR)/sdskedit.o $(OBJDIR)/sdskhelp.o $(OBJDIR)/sdskman.o $(OBJDIR)/sdskmess.o\
+ $(OBJDIR)/sdskmp3.o $(OBJDIR)/sdskprj.o $(OBJDIR)/search.o $(OBJDIR)/sedcolle.o $(OBJDIR)/slpinter.o $(OBJDIR)/splinman.o\
+ $(OBJDIR)/ssindica.o $(OBJDIR)/ssyntax.o $(OBJDIR)/tags.o $(OBJDIR)/tedcolle.o $(OBJDIR)/tips.o $(OBJDIR)/tpaltext.o $(OBJDIR)/tsindica.o\
+ $(OBJDIR)/txhgen.o $(OBJDIR)/winlistd.o $(OBJDIR)/lablchek.o $(OBJDIR)/lablradi.o $(OBJDIR)/snostate.o $(OBJDIR)/tcheck2.o\
+ $(OBJDIR)/tmiclust.o $(OBJDIR)/tsbutton.o $(OBJDIR)/tschkarr.o $(OBJDIR)/tschkbox.o $(OBJDIR)/tshscrol.o $(OBJDIR)/tshzgrp.o\
+ $(OBJDIR)/tsinplin.o $(OBJDIR)/tsinplpi.o $(OBJDIR)/tslabel.o $(OBJDIR)/tslider.o $(OBJDIR)/tslistbo.o $(OBJDIR)/tsradbot.o\
+ $(OBJDIR)/tssortlb.o $(OBJDIR)/tssosslb.o $(OBJDIR)/tstatext.o $(OBJDIR)/tstextsc.o $(OBJDIR)/tstsorlb.o $(OBJDIR)/tsvegrp.o\
+ $(OBJDIR)/tsview.o $(OBJDIR)/tsviewco.o $(OBJDIR)/ttextscr.o $(OBJDIR)/diaghelp.o $(OBJDIR)/dktclock.o $(OBJDIR)/fileopen.o\
+ $(OBJDIR)/fiopeaid.o $(OBJDIR)/inputsca.o $(OBJDIR)/ninputsc.o $(OBJDIR)/nostatex.o $(OBJDIR)/nprogbar.o $(OBJDIR)/nprogres.o\
+ $(OBJDIR)/ntnocast.o $(OBJDIR)/ntnosost.o $(OBJDIR)/setstack.o $(OBJDIR)/sprogbar.o $(OBJDIR)/sprogres.o $(OBJDIR)/stnocast.o\
+ $(OBJDIR)/stnonost.o $(OBJDIR)/tdiagaid.o $(OBJDIR)/tdiagrow.o $(OBJDIR)/tinppipe.o $(OBJDIR)/tnocastc.o $(OBJDIR)/tnosostr.o\
+ $(OBJDIR)/tprogbar.o $(OBJDIR)/tprogdia.o $(OBJDIR)/tprogrdi.o $(OBJDIR)/tprogres.o $(OBJDIR)/tstrlbox.o $(OBJDIR)/uisarray.o\
+ $(OBJDIR)/ussarray.o $(OBJDIR)/viewplus.o $(OBJDIR)/abstorel.o $(OBJDIR)/back2sl.o $(OBJDIR)/basename.o $(OBJDIR)/fexpand.o $(OBJDIR)/io.o\
+ $(OBJDIR)/specs.o $(OBJDIR)/splitfn.o $(OBJDIR)/stricat.o $(OBJDIR)/stridown.o $(OBJDIR)/stridup.o $(OBJDIR)/strifree.o
+
+EXTRA_LIBS = ..\libz\zlib.lib ..\libpcre\pcre.lib ..\libbzip2\bzip2.lib
+
+EXTRALIB_MAKE_ARGS = _SUBMAKE=1 CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.nmk
+
+libs: $(EXTRA_LIBS)
+
+..\libz\zlib.lib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libpcre\pcre.lib:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libbzip2\bzip2.lib:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+clean-zlib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-pcre:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-bzip2:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-libs: clean-zlib clean-pcre clean-bzip2
+
+setedit.exe: $(EXTRA_LIBS) $(EDITOR_OBJS)
+ link @<< /verbose /out:setedit.exe
+ $(EDITOR_OBJS) $(TV_LIB) user32.lib $(EXTRA_LIBS)
+<<
+
+install: setedit.exe doc
+ echo dummy >a.exe
+ xcopy /I *.exe $(DEST_BIN_DIR)
+ -del a.exe
+ -del $(DEST_BIN_DIR)\a.exe
+ xcopy /I /S /E ..\cfgfiles\*.* $(DEST_SET_DIR)
+ cd ..\doc
+ make -f Makefile.nmk DEST_SET_DIR=$(DEST_SET_DIR) install
+ cd ..\winnt
+
+doc:
+ cd ..\doc
+ make -f Makefile.nmk
+ cd ..\winnt
+
+clean-doc:
+ cd ..\doc
+ make -f Makefile.nmk clean
+ cd ..\winnt
+
+clean:
+ -del $(OBJDIR)\*.o
+ -del *.exe
+ -del *.o
+ -del *.lib
+
+clean-all: clean clean-libs clean-doc
+
diff --git a/setedit/WinNT/README b/setedit/WinNT/README
new file mode 100644
index 0000000..99d786a
--- /dev/null
+++ b/setedit/WinNT/README
@@ -0,0 +1,38 @@
+ This directory contains the files needed to create the Windows NT version
+of SETEdit.
+ Most of the work of this port was done by Anatoli Soltan <anatoli@iname.com>
+ This readme is temporary.
+ Here is a modified version of the text he sent me (updated by me):
+
+Compiler:
+---------
+I used Borland C++ Builder 5 for debugging. If you do not have it
+you can use the free Borland command line tools that can be downloaded
+from Borland's web site. They include Borland C++ 5.5 compiler that is the
+same as in Builder 5.
+Porting to Visual C++ and mingw32 can be trivial.
+[SET Note: I used the free command line tools]
+
+Versions:
+---------
+Linux versions of TurboVision and SETEDIT were used:
+ TurboVision 1.0.10
+ SETEDIT 0.4.41
+[SET Note: I merged the code with 1.0.11 and 0.4.44]
+
+Brief compilation instructions:
+-------------------------------
+Be sure Turbo Vision is installed and compiled in the ../../tvision
+directory.
+Just run make in this directory.
+
+Known problems:
+---------------
+- Installation program has not been ported.
+- Sound support has not been ported.
+
+Additionally:
+_____________
+To reconfigure the make files you need Perl. The script is located in the
+root directory of the distribution. Run "perl confignt.pl --help" to get
+help.
diff --git a/setedit/WinNT/bccmake.in b/setedit/WinNT/bccmake.in
new file mode 100644
index 0000000..1b3fc59
--- /dev/null
+++ b/setedit/WinNT/bccmake.in
@@ -0,0 +1,160 @@
+#
+# This makefile is deprecated, you should use it only if the "new" mechanism
+# fails. Please read the INSTALL.txt instructions.
+# If you must use this file please report it.
+#
+DEST_BIN_DIR = @DEST_BIN_DIR@
+DEST_SET_DIR = @DEST_SET_DIR@
+
+TV_LIB = ..\..\tvision\winnt\rhtv.lib
+
+@DYNRTL@
+
+all: setedit.exe
+
+# Borland C++
+
+CC = bcc32
+LD = bcc32
+CXX = $(CC)
+INC = -I.\include -I..\include
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLDFLAGS = -WR
+!endif
+
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLDFLAGS) -WC -X -q $(CDEBUGFLAGS) \
+ -D__inline__=inline -DFOR_EDITOR
+# Note: rch == Unreachable code. BC++ 5.5 is idiot to detect code that is
+# disabled on purpose. i.e. if (0) ...
+CXXFLAGS = -P -RT- -w-hid -w-par -w-rch $(CFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+INC = -I. -I.\inc -I..\..\tvision\winnt\include -I..\..\tvision\include \
+ -I..\include -I..\setedit\include -I..\settvuti\include -I..\easydiag \
+ -I..\infview\include -I..\librhuti -I..\sdg\include -I..\mp3 -I..\extra \
+ -I..\calcu -I..\libz -I..\libpcre -I..\libbzip2 -I..\holidays
+
+{..\setedit}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\setedit\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\librhuti}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\easydiag}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\infview}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\infview\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\infview\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\calcu}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\settvuti}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\settvuti\streams}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\settvuti\names}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\sdg}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\extra}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\mp3}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+{..\mainsrc}.cc{objs}.obj:
+ $(CXX) -c $(CXXFLAGS) $(INC) -nobjs $<
+
+{..\mainsrc}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+{..\calcu}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+{..\extra}.c{objs}.obj:
+ $(CC) -c $(CFLAGS) $(INC) -nobjs $<
+
+objs\edspecs.obj: ..\mainsrc\edspecs.cc
+objs\bufun.obj: ..\mainsrc\bufun.cc
+
+EDITOR_OBJS_ = @EDITOR_OBJS@
+EDITOR_OBJS = $(EDITOR_OBJS_:+=objs\)
+
+EXTRA_LIBS = ..\libz\zlib.lib ..\libpcre\pcre.lib ..\libbzip2\bzip2.lib
+
+EXTRALIB_MAKE_ARGS = _SUBMAKE=1 CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.bcc
+
+libs: $(EXTRA_LIBS)
+
+..\libz\zlib.lib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libpcre\pcre.lib:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libbzip2\bzip2.lib:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+clean-zlib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-pcre:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-bzip2:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-libs: clean-zlib clean-pcre clean-bzip2
+
+setedit.exe: $(EXTRA_LIBS) $(EDITOR_OBJS)
+ $(LD) $(LDFLAGS) -esetedit $(EDITOR_OBJS) $(EXTRA_LIBS) $(TV_LIB)
+
+install: setedit.exe doc
+ echo dummy >a.exe
+ xcopy /I *.exe $(DEST_BIN_DIR)
+ -del a.exe
+ -del $(DEST_BIN_DIR)\a.exe
+ xcopy /I /S /E ..\cfgfiles\*.* $(DEST_SET_DIR)
+ cd ..\doc
+ make -f Makefile.bcc DEST_SET_DIR=$(DEST_SET_DIR) install
+ cd ..\winnt
+
+doc:
+ cd ..\doc
+ make -f Makefile.bcc
+ cd ..\winnt
+
+clean-doc:
+ cd ..\doc
+ make -f Makefile.bcc clean
+ cd ..\winnt
+
+clean:
+ -del objs\*.obj
+ -del *.exe
+ -del *.obj
+ -del *.lib
+ -del *.tds
+
+clean-all: clean clean-libs clean-doc
diff --git a/setedit/WinNT/configed.h b/setedit/WinNT/configed.h
new file mode 100644
index 0000000..047fe45
--- /dev/null
+++ b/setedit/WinNT/configed.h
@@ -0,0 +1,34 @@
+/* Generated automatically by the configure script */
+
+/* Allegro library is available */
+/*#define HAVE_ALLEGRO*/
+
+/* Perl Compatible Regular Expressions support */
+#define HAVE_PCRE_LIB 1
+
+/* PCRE version 2.0.6 or newer */
+#define HAVE_PCRE206 1
+
+/* PCRE version 2.0.6 or newer */
+#define HAVE_BZIP2 1
+
+#define PCRE_HEADER_NAME <pcre.h>
+
+#define CONFIG_PREFIX ""
+
+#define SEOS_Win32
+#define SEOS_STR "Win32"
+#define SEOSf_
+
+#if defined(_MSVC) || defined(__MSC_VER) || defined(_MSC_VER)
+ #define SEComp_MSC
+ #define SEComp_STR "MSC"
+#else
+ #define SEComp_BCPP
+ #define SEComp_STR "BCPP"
+#endif
+
+#define SECompf_
+#define SECPU_x86
+#define SECPU_STR "x86"
+
diff --git a/setedit/WinNT/makeinfo/makeinfo.exe b/setedit/WinNT/makeinfo/makeinfo.exe
new file mode 100644
index 0000000..2556a2a
--- /dev/null
+++ b/setedit/WinNT/makeinfo/makeinfo.exe
Binary files differ
diff --git a/setedit/WinNT/msvcmake.in b/setedit/WinNT/msvcmake.in
new file mode 100644
index 0000000..6a5f656
--- /dev/null
+++ b/setedit/WinNT/msvcmake.in
@@ -0,0 +1,150 @@
+#
+# This makefile is deprecated, you should use it only if the "new" mechanism
+# fails. Please read the INSTALL.txt instructions.
+# If you must use this file please report it.
+#
+DEST_BIN_DIR = @DEST_BIN_DIR@
+DEST_SET_DIR = @DEST_SET_DIR@
+
+TV_LIB = ..\..\tvision\winnt\libtv.lib
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+all:: setedit.exe
+
+# MSVC
+
+CC = cl /nologo
+CXX = $(CC)
+LD = $(CXX)
+INC = -I. -I.\inc -I..\..\tvision\winnt\include -I..\..\tvision\include \
+ -I..\include -I..\setedit\include -I..\settvuti\include -I..\easydiag \
+ -I..\infview\include -I..\librhuti -I..\sdg\include -I..\mp3 -I..\extra \
+ -I..\calcu -I..\libz -I..\libpcre -I..\libbzip2 -I..\holidays
+
+CFLAGS = -O2 $(INC) -D_WIN32 -DFOR_EDITOR /GR- /GX-
+CXXFLAGS = $(CFLAGS)
+LDFLAGS = -link $(TV_LIB) user32.lib
+OBJDIR = objs
+
+{..\setedit}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\setedit\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\names}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\librhuti}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\easydiag}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\infview}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\infview\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\infview\names}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\calcu}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\settvuti}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\settvuti\streams}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\settvuti\names}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\sdg}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\extra}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\mp3}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+{..\mainsrc}.cc{$(OBJDIR)}.o:
+ $(CXX) -c $(CXXFLAGS) $(INC) /Tp$? -Fo$*.o
+
+{..\mainsrc}.c{$(OBJDIR)}.o:
+ $(CC) -c $(CFLAGS) $(INC) $? -Fo$*.o
+{..\calcu}.c{$(OBJDIR)}.o:
+ $(CC) -c $(CFLAGS) $(INC) $? -Fo$*.o
+{..\extra}.c{$(OBJDIR)}.o:
+ $(CC) -c $(CFLAGS) $(INC) $? -Fo$*.o
+
+$(OBJDIR)\edspecs.o: ..\mainsrc\edspecs.cc
+$(OBJDIR)\bufun.o: ..\mainsrc\bufun.cc
+
+EDITOR_OBJS = @EDITOR_OBJS_MS@
+
+EXTRA_LIBS = ..\libz\zlib.lib ..\libpcre\pcre.lib ..\libbzip2\bzip2.lib
+
+EXTRALIB_MAKE_ARGS = _SUBMAKE=1 CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.nmk
+
+libs: $(EXTRA_LIBS)
+
+..\libz\zlib.lib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libpcre\pcre.lib:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+..\libbzip2\bzip2.lib:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS)
+ cd ..\winnt
+
+clean-zlib:
+ cd ..\libz
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-pcre:
+ cd ..\libpcre
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-bzip2:
+ cd ..\libbzip2
+ $(MAKE) $(EXTRALIB_MAKE_ARGS) clean
+ cd ..\winnt
+
+clean-libs: clean-zlib clean-pcre clean-bzip2
+
+setedit.exe: $(EXTRA_LIBS) $(EDITOR_OBJS)
+ link @<< /verbose /out:setedit.exe
+ $(EDITOR_OBJS) $(TV_LIB) user32.lib $(EXTRA_LIBS)
+<<
+
+install: setedit.exe doc
+ echo dummy >a.exe
+ xcopy /I *.exe $(DEST_BIN_DIR)
+ -del a.exe
+ -del $(DEST_BIN_DIR)\a.exe
+ xcopy /I /S /E ..\cfgfiles\*.* $(DEST_SET_DIR)
+ cd ..\doc
+ make -f Makefile.nmk DEST_SET_DIR=$(DEST_SET_DIR) install
+ cd ..\winnt
+
+doc:
+ cd ..\doc
+ make -f Makefile.nmk
+ cd ..\winnt
+
+clean-doc:
+ cd ..\doc
+ make -f Makefile.nmk clean
+ cd ..\winnt
+
+clean:
+ -del $(OBJDIR)\*.o
+ -del *.exe
+ -del *.o
+ -del *.lib
+
+clean-all: clean clean-libs clean-doc
+
diff --git a/setedit/WinNT/objs/delete.me b/setedit/WinNT/objs/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/WinNT/objs/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/calcu/calcu.cc b/setedit/calcu/calcu.cc
new file mode 100644
index 0000000..c26f38b
--- /dev/null
+++ b/setedit/calcu/calcu.cc
@@ -0,0 +1,182 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Calculator Interface.
+ See the editor files for details.
+
+ Notes:
+ defining FLEX_BISON you can use the old flex and bison parser.
+
+*****************************************************************************/
+
+#include <ceditint.h>
+
+// Before the rest because djgpp have a bug in the headers and redefines NULL.
+#include <locale.h>
+#define Uses_stdio
+#define Uses_string
+#define Uses_TEvent
+#define Uses_TInputLine
+#define Uses_TButton
+#define Uses_TLabel
+#define Uses_TRect
+#define Uses_THistory
+#define Uses_TDialog
+#define Uses_TApplication
+#define Uses_MsgBox
+#define Uses_TDeskTop
+#define Uses_TCEditWindow
+#define Uses_TInputLinePiped
+#define Uses_TCEditor_External
+#include <ceditor.h>
+#include <calcu.h>
+#include <setapp.h>
+
+#ifdef HAVE_CALCULATOR
+
+#ifdef FLEX_BISON
+extern "C" char *yyParseString(char *s);
+#else
+extern "C" int eval(char *mit,char **out);
+#endif
+
+class TRect;
+class TInputLine;
+
+class TCalcDialog : public TDialog
+{
+public:
+ TCalcDialog(const TRect & bounds, const char *Title, char *StartVal = NULL);
+ virtual void handleEvent(TEvent &);
+ TInputLine *input;
+ TInputLine *result;
+};
+
+const int MaxLinePipe=255;
+
+TCalcDialog::TCalcDialog(const TRect & bounds, const char *Title, char *StartVal)
+ : TWindowInit(TCalcDialog::initFrame),
+ TDialog(bounds,Title)
+
+{
+ TRect r;
+ helpCtx = hcCalculator;
+ r.a.x = 2;
+ r.a.y = 2;
+ r.b.x = size.x - 5;
+ r.b.y = r.a.y + 1;
+ // Piped and supports copy & paste
+ input = new TInputLinePiped(r,MaxLinePipe);
+ insert(new THistory(TRect(r.b.x,r.a.y,r.b.x+3,r.b.y), input,
+ hID_TCalcDialogExp));
+ if (StartVal)
+ {
+ // This will copy MaxLinePipe characters -1. For this reason the source
+ // *must* be at least MaxLinePipe in size.
+ char aux[MaxLinePipe];
+ strncpy(aux,StartVal,MaxLinePipe);
+ input->setData(aux);
+ }
+ insert(input);
+ r.move(0,-1);
+ insert(new TLabel(r,__("~E~xpression"),input));
+ r.move(0,3);
+ // Only supports copy
+ result = new TInputLinePiped(r,255,tilpNoPipe | tilpNoPaste);
+ insert(result);
+ r.move(0,-1);
+ insert(new TLabel(r,__("~R~esult"),result));
+ r.move(0,3);
+ r.b.x = r.a.x + 12;
+ r.b.y = r.a.y + 2;
+ insert(new TButton(r,__("E~v~al"),cmEval,bfDefault));
+ r.a.x = r.b.x + 2;
+ r.b.x = r.a.x + 12;
+ insert(new TButton(r,__("Cancel"),cmCancel,bfNormal));
+ r.a.x = r.b.x + 2;
+ r.b.x = r.a.x + 12;
+ insert(new TButton(r,__("~C~opy"),cmCaCopy,bfNormal));
+ r.a.x = r.b.x + 2;
+ r.b.x = r.a.x + 12;
+ insert(new TButton(r,__("~P~aste"),cmCaPaste,bfNormal));
+ input->select();
+ options |= ofCentered;
+}
+
+// The calculators aren't "locale safe" so I just switch to
+// C locale while using them
+static
+void Eval(char *input_buffer, char **ret)
+{
+ char *old_locale, *saved_locale;
+
+ old_locale=setlocale(LC_ALL,NULL);
+ saved_locale=strdup(old_locale);
+
+ setlocale(LC_ALL,"C");
+ #ifdef FLEX_BISON
+ ret=yyParseString(input_buffer);
+ #else
+ int err=eval(input_buffer,ret);
+ if (err)
+ messageBox(mfError | mfOKButton,__("Error in expression (%d)"),err);
+ #endif
+
+ setlocale(LC_ALL,saved_locale);
+ free(saved_locale);
+}
+
+void TCalcDialog::handleEvent(TEvent & event)
+{
+ char *ret;
+ TDialog::handleEvent(event);
+ switch (event.what)
+ {
+ case evCommand:
+ switch (event.message.command)
+ {
+ case cmEval:
+ {
+ char input_buffer[256];
+ input->getData(input_buffer);
+ Eval(input_buffer,&ret);
+ result->setData(ret);
+ input->selectAll(True);
+ clearEvent(event);
+ }
+ break;
+ case cmCaCopy:
+ event.message.command=cmtilCopy;
+ result->handleEvent(event);
+ break;
+ case cmCaPaste:
+ event.message.command=cmtilPaste;
+ input->handleEvent(event);
+ break;
+ }
+ break;
+ }
+}
+
+void executeCalc(char *startVal)
+{
+ TCalcDialog *d;
+ d=new TCalcDialog(TRect(10,2,72,11),__("Calculator"),startVal);
+ TProgram::deskTop->execView(d);
+ // Dialogs should be destroyed or your members won't de deleted.
+ CLY_destroy(d);
+ delete[] startVal;
+}
+
+#else
+
+void executeCalc(char *startVal)
+{
+ messageBox(__("This functionality was disabled at compile time"),
+ mfError | mfOKButton);
+ delete[] startVal;
+}
+
+#endif
+
diff --git a/setedit/calcu/calcu.h b/setedit/calcu/calcu.h
new file mode 100644
index 0000000..146c3e8
--- /dev/null
+++ b/setedit/calcu/calcu.h
@@ -0,0 +1,9 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// The history IDs
+#include <edhists.h>
+// The commands and help contexts
+#include <editcoma.h>
+
+extern void executeCalc(char *startVal);
+
diff --git a/setedit/calcu/large.txt b/setedit/calcu/large.txt
new file mode 100644
index 0000000..74fa433
--- /dev/null
+++ b/setedit/calcu/large.txt
@@ -0,0 +1,70 @@
+brcalcu is a small, semi-powerful, probably portable calculator. Now
+there's no reason not to have an expression evaluator in your project.
+
+The parser implements a very weird language that probably looks odder
+than it is due to its similarity to C. For example, while has a return
+value so you can use it in the middle of expressions. There is no need
+for if, since you can just use ? : for anything.
+
+I haven't thought the language completely through or worked out all
+behaviour. It's too complex. Simplify, simplify, simplify!
+
+Define a new variable by simple giving it's value, as in "x = 4". Other
+value-setting ops are available, see the list. Define a new function by
+giving its name, the argument name list, and its value as an =, for
+example "f(x) = x*2". The arguments are normally pre-expanded, meaning
+that they are as in C; when you call the function, they are expanded.
+Not so if you prefix an argument name immediately with '. When the
+argument is used in the function it will only be expanded on request.
+For example:
+ f(x) = y=4'x
+ f(y) -> 0
+
+ f('x) = z=4'x
+ f(z) -> 4
+
+This is useful for building more complex commands from the base control-flow
+structures. For example:
+ for ('start, 'test, 'body) = start' while (test) body
+
+The most surprised person that this worked was definitely myself. I
+thought the code was wrong. It's still ugly, but I find it amusing.
+
+ x { y Returns x or y, whichever is smallest.
+ x } y Returns x or y, whichever is smallest.
+ -----
+ x ' y Returns y. In C, this is ","; I thought ' would be better
+ x y since it allows it in arguments of functions (For what
+ that's worth). The second variant is alt-179 in ASCII.
+
+ Note that this IS ",", NOT ";". You don't use it to end
+ a statement, you use it to start a new one.
+ x ; Return x. This is not necessary normally; mostly for
+ control flow functions like while to serve as }.
+
+ Consider this:
+ rad(r, x) = radix = rx
+ I think this boils down an expression quite well, although
+ ' is jarring (I tried ., but that's required for a decimal
+ point). Only that which is necessary is described. The
+ equivalent in C is:
+ rad (r, x) { radix = r; return x; }
+ I didn't put the return or types in because that would be
+ unfair. The point is that this language I'm defining is
+ dreadfully compact.
+ ' x This is a subtle difference to x ' y but has a world of
+ effect. It is only for calling functions -- user
+ functions to be exact. When the first character in an
+ argument is a tick, the contents of the argument are
+ passed, not the result. This "forces" it to use a macro
+ result. Moreover, if the ticked value is a local argument,
+ then what's passed is a pointer to THAT value's expansion
+ allowing you to pass ticked arguments down the tree. If
+ the ticked value is a local argument that is not a quoted,
+ then just the normal value is passed.
+
+ rad (r, x) Set display radix to r, return x.
+ while (test) body; Expands body so long as test is true. Returns
+ the last value of body. For example:
+ while (x < 10) x ++; -> 10
+
diff --git a/setedit/calcu/parser.c b/setedit/calcu/parser.c
new file mode 100644
index 0000000..43106f4
--- /dev/null
+++ b/setedit/calcu/parser.c
@@ -0,0 +1,494 @@
+/*****************************************************************************
+
+ Advanced parser. It supports all the functions found in ML's parser and also
+ definition of variables, functions and loops.
+ Created by Burton Radons <loth@pacificcoast.net>.
+
+ Exception: Here , is used for a different purpose than in ML's parser.
+
+ Size of code with gcc 2.8.1 and -O2: 8824 bytes.
+
+*****************************************************************************/
+
+#include <configed.h>
+#include <ctype.h>
+#include <math.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define Uses_string
+#define CLY_DoNotDefineUTypes
+#include <compatlayer.h>
+
+#ifdef HAVE_CALCULATOR
+
+#define isprenum(STR) (STR == '.' || (STR >= '0' && STR <= '9'))
+#define isprevar(STR) (STR == '_' || (STR >= 'a' && STR <= 'z') || (STR >= 'A' && STR <= 'Z'))
+#define isintvar(STR) (isprevar (STR) || (STR >= '0' && STR <= '9'))
+#define isexpr(STR) (!isintvar (STR))
+
+#define resize(PTR, LEN) ((PTR) = realloc (PTR, sizeof (*(PTR)) * (LEN)))
+#define matchlen(NAME) ((int) (end - top) == (len = strlen (NAME)) && !strncasecmp (top, NAME, len))
+#define opsdo(NAME, LEN, EXPR) if (matchops (NAME, LEN)) EXPR
+#define findtop() for (top = str; isintvar (*str); str ++); end = str;
+#define matchops(NAME, LEN) (!strncmp (ops, NAME, LEN) && skipops (LEN))
+
+#ifdef TVComp_GCC
+#define ltype long long
+#define lprint "ll"
+#endif
+
+#if defined(TVComp_BCPP) || defined(TVComp_MSC)
+#define ltype __int64
+#define lprint "i64"
+#define strncasecmp strnicmp
+#endif
+
+#ifdef TVOSf_Linux
+// Why it fails in my machine?!
+#define ftype double
+#define fprint ""
+#else
+#define ftype long double
+#define fprint "L"
+#endif
+
+static char *str = NULL;
+static char ops [16];
+static ftype arg [16];
+static int cfun = -1;
+static jmp_buf jmp;
+static char *ret;
+static int pradix;
+
+typedef ftype (*bfuntype) (ftype a);
+#define easy(NAME) static ftype fun_##NAME (ftype a) { return NAME (a); }
+easy (sin); easy (cos); easy (tan); easy (sinh); easy (cosh); easy (tanh); easy (asin);
+easy (acos); easy (atan); easy (log); easy (log10); easy (exp); easy (abs); easy (sqrt);
+easy (ceil); easy (floor);
+#undef easy
+#define easy(NAME, RADIX) static ftype fun_##NAME (ftype a) { pradix = RADIX; return a; }
+easy (bin, 2); easy (oct, 8); easy (dec, 10); easy (hex, 16);
+#undef easy
+
+static char *bfunn [] = { "sin", "cos", "tan", "sinh", "cosh", "tanh", "asin", "acos",
+ "atan", "log", "log10", "exp", "abs", "sqrt", "ceil", "floor",
+ "bin", "oct", "dec", "hex" };
+static bfuntype bfunp [] = { fun_sin, fun_cos, fun_tan, fun_sinh, fun_cosh, fun_tanh, fun_asin,
+ fun_acos, fun_atan, fun_log, fun_log10, fun_exp, fun_abs, fun_sqrt,
+ fun_ceil, fun_floor, fun_bin, fun_oct, fun_dec, fun_hex };
+#define bnfun (int) (sizeof (bfunn) / sizeof (*bfunn))
+
+static char **funn = NULL;
+static char ***funa = NULL; /* Arguments name-list for temporary binding */
+static char **func = NULL; /* Function contents */
+static int nfun = 0;
+
+static char **varn = NULL;
+static ftype *varv = NULL;
+static int nvar = 0;
+
+static ftype expr (void);
+
+static void error (char *str)
+{
+ strcpy (ret, str);
+ longjmp (jmp, 1);
+}
+
+static char *My_strndup (char *ptr, int len)
+{
+ char *dat = malloc (len + 1);
+ memmove (dat, ptr, len);
+ dat [len] = '\0';
+ return dat;
+}
+
+static void skipspace (void)
+{
+ // The cast is a workaround for a bug in Solaris 9 for SPARC
+ while (isspace ((int)*str))
+ str ++;
+}
+
+static int skipops (int cnt)
+{
+ while (cnt --)
+ {
+ skipspace ();
+ str ++;
+ }
+ return 1;
+}
+
+static char *readops (void)
+{
+ char *top = str;
+ char *ptr = ops;
+ while (1)
+ {
+ skipspace ();
+ if (*str == '\0' || isintvar (*str))
+ break;
+ *ptr ++ = *str ++;
+ }
+ *ptr = '\0';
+ str = top;
+ return ops;
+}
+
+static ftype *findvar (char *top, char *end)
+{
+ int c, len;
+ if (cfun != -1)
+ {
+ for (c = 0; funa [cfun] [c] != NULL; c ++)
+ if (!strncasecmp (funa [cfun] [c], top, (int) (end - top)))
+ return &arg [c];
+ }
+ for (c = 0; c < nvar; c ++)
+ if (matchlen (varn [c]))
+ break;
+ if (c >= nvar)
+ {
+ resize (varn, c + 1);
+ resize (varv, c + 1);
+ varn [c] = My_strndup (top, (int) (end - top));
+ varv [c] = 0;
+ nvar ++;
+ }
+ return &varv [c];
+}
+
+static ftype readnum (void)
+{
+ ftype a [16];
+ int c, d, len;
+ char *top, *end;
+ ftype val = 0;
+
+ skipspace ();
+ if (isprenum (*str))
+ {
+ if (*str == '0')
+ {
+ if (*++ str == 'x')
+ return strtol (str + 1, &str, 16);
+ else if (*str == 'b')
+ return strtol (str + 1, &str, 2);
+ else if (*str != '.')
+ return strtol (str, &str, 8);
+ }
+ val = strtod (str, &str);
+ if (*str == 'x')
+ {
+ if (val < 1 || val > 36)
+ error ("Radix out of range (from 2 to 36)\n");
+ val = strtol (str + 1, &str, (int) val);
+ }
+ return val;
+ }
+ else if (isexpr (*str))
+ {
+ readops ();
+ opsdo ("++", 2, { findtop (); return ++ *findvar (top, end); })
+ else opsdo ("--", 2, { findtop (); return -- *findvar (top, end); })
+ else opsdo ("-", 1, return -readnum ());
+ else opsdo ("+", 1, return readnum ());
+ else opsdo ("~", 1, return ~(ltype) readnum ());
+ else opsdo ("!", 1, return !readnum ());
+ else if (matchops ("(", 1))
+ {
+ ftype val = expr ();
+ while (*str == ',')
+ str ++, val = expr ();
+ readops ();
+ if (!matchops (")", 1))
+ error ("Unbalanced or illegal expression");
+ return val;
+ }
+ }
+ else if (isprevar (*str))
+ {
+ findtop ();
+ for (c = 0; c < bnfun; c ++)
+ if (matchlen (bfunn [c]))
+ {
+ readops ();
+ if (!matchops ("(", 1))
+ error ("Expected (");
+ val = expr ();
+ readops ();
+ if (!matchops (")", 1))
+ error ("Too many arguments");
+ return bfunp [c] (val);
+ }
+
+ readops ();
+ if (matchops ("(", 1))
+ {
+ char *ostr;
+ int ocfun;
+ ftype val;
+
+ for (c = 0; str [c] != '('; c ++)
+ if (str [c] == ')')
+ {
+ str += c;
+ readops ();
+ str -= c;
+ if (ops [1] == '=' && ops [2] != '=')
+ {
+ for (c = 0; c < nfun; c ++)
+ if (matchlen (funn [c]))
+ goto redef;
+ goto newdef;
+ }
+ break;
+ }
+ for (c = 0; c < nfun; c ++)
+ if (matchlen (funn [c]))
+ {
+ for (d = 0; funa [c] [d] != NULL; d ++)
+ {
+ a [d] = arg [d];
+ arg [d] = expr ();
+ readops ();
+ if (!matchops (funa [c] [d + 1] != NULL ? "," : ")", 1))
+ error ("Too few or too many arguments");
+ }
+ if (d == 0)
+ {
+ readops ();
+ if (!matchops (")", 1))
+ error ("Expected )");
+ }
+ ostr = str; str = func [c];
+ ocfun = cfun; cfun = c;
+ val = expr ();
+ while (*str == ',')
+ str ++, val = expr ();
+ str = ostr; cfun = ocfun;
+ while (d --)
+ arg [d] = a [d];
+ return val;
+ }
+
+ newdef:
+ resize (funn, c + 1);
+ resize (funa, c + 1);
+ resize (func, c + 1);
+ redef:
+ funn [c] = My_strndup (top, (int) (end - top));
+ funa [c] = NULL;
+
+ readops (); d = 0;
+ if (!matchops (")", 1))
+ while (1)
+ {
+ for (top = str; isintvar (*str); str ++);
+ resize (funa [c], d + 1);
+ funa [c] [d] = My_strndup (top, (int) (str - top));
+ readops ();
+ d ++;
+ if (matchops (")", 1))
+ break;
+ else if (!matchops (",", 1))
+ error ("Broken command");
+ }
+
+ readops ();
+ if (!matchops ("=", 1))
+ error ("Expected =");
+ resize (funa [c], d + 1);
+ funa [c] [d] = NULL;
+ func [c] = strdup (str);
+ if (c >= nfun)
+ nfun ++;
+ str += strlen (str) - 1;
+ return 0;
+ }
+ else
+ {
+ ftype *vp = findvar (top, end);
+ opsdo ("=", 1, return *vp = expr ());
+ else opsdo ("+=", 2, return *vp += expr ());
+ else opsdo ("-=", 2, return *vp -= expr ());
+ else opsdo ("*=", 2, return *vp *= expr ());
+ else opsdo ("/=", 2, return *vp /= expr ());
+ else opsdo ("%=", 2, return *vp = fmod (*vp, expr ()));
+ else opsdo ("&=", 2, return *vp = (ltype) (*vp) & (ltype) expr ());
+ else opsdo ("^=", 2, return *vp = (ltype) (*vp) ^ (ltype) expr ());
+ else opsdo ("!=", 2, return *vp = (ltype) (*vp) | (ltype) expr ());
+ else opsdo ("<<=", 3, return *vp = (ltype) (*vp) << (ltype) expr ());
+ else opsdo (">>=", 3, return *vp = (ltype) (*vp) >> (ltype) expr ());
+ else opsdo ("++", 2, return (*vp) ++);
+ else opsdo ("--", 2, return (*vp) --);
+ else return *vp;
+ }
+ }
+ error ("Retarded command");
+ return 0;
+}
+
+static ftype term (int lvl)
+{
+ ftype val;
+ if (lvl -- < 0)
+ return readnum ();
+ val = term (lvl);
+ while (1)
+ {
+ readops ();
+ switch (lvl + 1)
+ {
+ case 0:
+ opsdo ("**", 2, val = pow (val, term (lvl)));
+ else
+ return val;
+ break;
+ case 1:
+ opsdo ("*", 1, val *= term (lvl));
+ else opsdo ("/", 1, val /= term (lvl));
+ else opsdo ("%", 1, val = fmod (val, term (lvl)));
+ else return val;
+ break;
+ case 2:
+ opsdo ("+", 1, val += term (lvl));
+ else opsdo ("-", 1, val -= term (lvl));
+ else return val;
+ break;
+ case 3:
+ opsdo ("<<", 2, val = (ltype) val << (ltype) term (lvl));
+ else opsdo (">>", 2, val = (ltype) val >> (ltype) term (lvl));
+ else return val;
+ break;
+ case 4:
+ opsdo ("<", 1, val = val < term (lvl));
+ else opsdo ("<=", 2, val = val <= term (lvl));
+ else opsdo (">", 1, val = val > term (lvl));
+ else opsdo (">=", 2, val = val >= term (lvl));
+ else return val;
+ break;
+ case 5:
+ opsdo ("==", 2, val = val == term (lvl));
+ else opsdo ("!=", 2, val = val != term (lvl));
+ else return val;
+ break;
+ case 6:
+ if (!strncmp (ops, "&&", 2)) return val;
+ else opsdo ("&", 1, val = (ltype) val & (ltype) term (lvl));
+ else return val;
+ break;
+ case 7:
+ opsdo ("^", 1, val = (ltype) val ^ (ltype) term (lvl));
+ else return val;
+ break;
+ case 8:
+ if (!strncmp (ops, "||", 2)) return val;
+ else opsdo ("|", 1, val = (ltype) val | (ltype) term (lvl));
+ else return val;
+ break;
+ case 9:
+ opsdo ("&&", 2, val = val && term (lvl));
+ else return val;
+ break;
+ case 10:
+ opsdo ("||", 2, val = val || term (lvl));
+ else return val;
+ break;
+ case 11:
+ if (matchops ("?", 1))
+ {
+ int c;
+ if (val)
+ {
+ val = expr ();
+ skipspace ();
+ if (*str ++ != ':')
+ error ("Expected :");
+ for (c = 0; *str != '\0' && c >= 0; str ++)
+ if (*str == '(') c ++;
+ else if (*str == ')') c --;
+ }
+ else
+ {
+ for (c = 0; *str != '\0' && c >= 0; str ++)
+ if (*str == '?') c ++;
+ else if (*str == ':') c --;
+ if (str [-1] != ':')
+ error ("Expected :");
+ val = expr ();
+ }
+ }
+ else return val;
+ }
+ }
+}
+
+static ftype expr (void)
+{
+ return term (11);
+}
+
+static char ret_buffer[140];
+
+/* Evaluate str, printing the result to ret, return 0 on failure */
+int eval (char *_str, char **_ret)
+{
+ ftype val;
+ int c;
+
+ pradix = 10;
+ str = _str;
+ *_ret = ret_buffer;
+ ret = ret_buffer;
+ if (setjmp (jmp))
+ return 1;
+ val = expr ();
+ while (*str == ',')
+ str ++, val = expr ();
+ if (*str != '\0' && *str != '\n')
+ error ("Broken command");
+ if (pradix == 10)
+ sprintf (ret, "%.10" fprint "g", val);
+ else if (pradix == 16)
+ sprintf (ret, "0x%" lprint "X", (ltype) val);
+ else if (pradix == 8)
+ sprintf (ret, "0%" lprint "o", (ltype) val);
+ else if (pradix == 2)
+ {
+ ltype bin = val;
+ *ret ++ = '0';
+ *ret ++ = 'b';
+ if (bin > 0)
+ for (c = 0; bin >> c; c ++);
+ else
+ c = 64; /* Negative integers use all the bits ;-) SET */
+ if (c == 0)
+ *ret ++ = '0';
+ ret += c;
+ *ret -- = '\0';
+ for (; c--; bin >>= 1)
+ *ret -- = (bin & 1) + '0';
+ }
+ return 0;
+}
+
+#ifdef TEST
+int main (int argc, char *argv [])
+{
+ char buf [256], *res, *s;
+ int c;
+ printf ("Write expression, get answer.\n");
+ while (fgets (buf, 256, stdin) == buf)
+ {
+ eval (buf, &res);
+ printf (" = %s\n", res);
+ }
+ return 0;
+}
+#endif /* TEST */
+
+#endif // HAVE_CALCULATOR
+
diff --git a/setedit/calcu/parser.txt b/setedit/calcu/parser.txt
new file mode 100644
index 0000000..c1f0458
--- /dev/null
+++ b/setedit/calcu/parser.txt
@@ -0,0 +1,72 @@
+
+Documentation for the calculator built in RHIDE v1.1
+----------------------------------------------------
+
+Author: Laszlo Molnar <s0052mol@sun10.vsz.bme.hu>
+Copying: parser.c is free software, you can use it anywhere you want
+Warranty: as usual: none
+
+
+ The purpose of this program, to provide a simple but powerful
+'calculator' for programmers, to help with coding and debugging, where GDB's
+expression evaluator is not enough.
+
+ You may say "Hey, I can write a better one with flex & bison", and you
+may be right. I can make a better one too. But it'll be 4-5 times longer!
+This calculator is only 10 kbytes of C code, what I think it's not that bad.
+
+ The parser algorithm I use is called 'Operator Precedence Parsing'
+(I translated this from hungarian, so I may be wrong ;-). It
+works with 'operator precedence grammars' (a subset of LR(1) grammars),
+which means that there can't be 2 non terminating token next to each other
+on the right side of your grammar rules. It's ideal for expression
+evaluation.
+
+ With this parser you can use numbers, operators, parentheses and functions
+like in C.
+
+Here are the operators in decreasing precedence:
+
+ ~ unary not
+ - unary minus
+-------
+ ** power
+-------
+ * multiplication
+ / division
+ % modulo
+-------
+ + plus
+ - binary minus
+-------
+ << shift left
+ >> shift right
+-------
+ & logical and
+-------
+ ^ logical xor
+-------
+ | logical or
+
+And here are the functions you can use:
+
+ sin,cos,tan,sinh,cosh,tanh,asin,acos,atan \ They works as you expected.
+ log,log10,exp,abs,sqrt,ceil,floor /
+ bin,oct,dec,hex - Radix conversion.
+
+ The calculator uses doubles, but you can use numbers in the usual integer
+formats also: 0x... for base 16, 0b... for base 2 and 0... for base 8.
+The result of the calculation is displayed as a double for base 10, and
+converted to long long format for the other radixes.
+
+ Error codes:
+
+ -1 yylex() failed e.g. '1+#'
+ -3 yyparse() failed e.g. '1+2)'
+ -4 floating point exception e.g. 'sqrt(-1)'
+
+
+
+
+
+
diff --git a/setedit/calcu/parserbr.c b/setedit/calcu/parserbr.c
new file mode 100644
index 0000000..43106f4
--- /dev/null
+++ b/setedit/calcu/parserbr.c
@@ -0,0 +1,494 @@
+/*****************************************************************************
+
+ Advanced parser. It supports all the functions found in ML's parser and also
+ definition of variables, functions and loops.
+ Created by Burton Radons <loth@pacificcoast.net>.
+
+ Exception: Here , is used for a different purpose than in ML's parser.
+
+ Size of code with gcc 2.8.1 and -O2: 8824 bytes.
+
+*****************************************************************************/
+
+#include <configed.h>
+#include <ctype.h>
+#include <math.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define Uses_string
+#define CLY_DoNotDefineUTypes
+#include <compatlayer.h>
+
+#ifdef HAVE_CALCULATOR
+
+#define isprenum(STR) (STR == '.' || (STR >= '0' && STR <= '9'))
+#define isprevar(STR) (STR == '_' || (STR >= 'a' && STR <= 'z') || (STR >= 'A' && STR <= 'Z'))
+#define isintvar(STR) (isprevar (STR) || (STR >= '0' && STR <= '9'))
+#define isexpr(STR) (!isintvar (STR))
+
+#define resize(PTR, LEN) ((PTR) = realloc (PTR, sizeof (*(PTR)) * (LEN)))
+#define matchlen(NAME) ((int) (end - top) == (len = strlen (NAME)) && !strncasecmp (top, NAME, len))
+#define opsdo(NAME, LEN, EXPR) if (matchops (NAME, LEN)) EXPR
+#define findtop() for (top = str; isintvar (*str); str ++); end = str;
+#define matchops(NAME, LEN) (!strncmp (ops, NAME, LEN) && skipops (LEN))
+
+#ifdef TVComp_GCC
+#define ltype long long
+#define lprint "ll"
+#endif
+
+#if defined(TVComp_BCPP) || defined(TVComp_MSC)
+#define ltype __int64
+#define lprint "i64"
+#define strncasecmp strnicmp
+#endif
+
+#ifdef TVOSf_Linux
+// Why it fails in my machine?!
+#define ftype double
+#define fprint ""
+#else
+#define ftype long double
+#define fprint "L"
+#endif
+
+static char *str = NULL;
+static char ops [16];
+static ftype arg [16];
+static int cfun = -1;
+static jmp_buf jmp;
+static char *ret;
+static int pradix;
+
+typedef ftype (*bfuntype) (ftype a);
+#define easy(NAME) static ftype fun_##NAME (ftype a) { return NAME (a); }
+easy (sin); easy (cos); easy (tan); easy (sinh); easy (cosh); easy (tanh); easy (asin);
+easy (acos); easy (atan); easy (log); easy (log10); easy (exp); easy (abs); easy (sqrt);
+easy (ceil); easy (floor);
+#undef easy
+#define easy(NAME, RADIX) static ftype fun_##NAME (ftype a) { pradix = RADIX; return a; }
+easy (bin, 2); easy (oct, 8); easy (dec, 10); easy (hex, 16);
+#undef easy
+
+static char *bfunn [] = { "sin", "cos", "tan", "sinh", "cosh", "tanh", "asin", "acos",
+ "atan", "log", "log10", "exp", "abs", "sqrt", "ceil", "floor",
+ "bin", "oct", "dec", "hex" };
+static bfuntype bfunp [] = { fun_sin, fun_cos, fun_tan, fun_sinh, fun_cosh, fun_tanh, fun_asin,
+ fun_acos, fun_atan, fun_log, fun_log10, fun_exp, fun_abs, fun_sqrt,
+ fun_ceil, fun_floor, fun_bin, fun_oct, fun_dec, fun_hex };
+#define bnfun (int) (sizeof (bfunn) / sizeof (*bfunn))
+
+static char **funn = NULL;
+static char ***funa = NULL; /* Arguments name-list for temporary binding */
+static char **func = NULL; /* Function contents */
+static int nfun = 0;
+
+static char **varn = NULL;
+static ftype *varv = NULL;
+static int nvar = 0;
+
+static ftype expr (void);
+
+static void error (char *str)
+{
+ strcpy (ret, str);
+ longjmp (jmp, 1);
+}
+
+static char *My_strndup (char *ptr, int len)
+{
+ char *dat = malloc (len + 1);
+ memmove (dat, ptr, len);
+ dat [len] = '\0';
+ return dat;
+}
+
+static void skipspace (void)
+{
+ // The cast is a workaround for a bug in Solaris 9 for SPARC
+ while (isspace ((int)*str))
+ str ++;
+}
+
+static int skipops (int cnt)
+{
+ while (cnt --)
+ {
+ skipspace ();
+ str ++;
+ }
+ return 1;
+}
+
+static char *readops (void)
+{
+ char *top = str;
+ char *ptr = ops;
+ while (1)
+ {
+ skipspace ();
+ if (*str == '\0' || isintvar (*str))
+ break;
+ *ptr ++ = *str ++;
+ }
+ *ptr = '\0';
+ str = top;
+ return ops;
+}
+
+static ftype *findvar (char *top, char *end)
+{
+ int c, len;
+ if (cfun != -1)
+ {
+ for (c = 0; funa [cfun] [c] != NULL; c ++)
+ if (!strncasecmp (funa [cfun] [c], top, (int) (end - top)))
+ return &arg [c];
+ }
+ for (c = 0; c < nvar; c ++)
+ if (matchlen (varn [c]))
+ break;
+ if (c >= nvar)
+ {
+ resize (varn, c + 1);
+ resize (varv, c + 1);
+ varn [c] = My_strndup (top, (int) (end - top));
+ varv [c] = 0;
+ nvar ++;
+ }
+ return &varv [c];
+}
+
+static ftype readnum (void)
+{
+ ftype a [16];
+ int c, d, len;
+ char *top, *end;
+ ftype val = 0;
+
+ skipspace ();
+ if (isprenum (*str))
+ {
+ if (*str == '0')
+ {
+ if (*++ str == 'x')
+ return strtol (str + 1, &str, 16);
+ else if (*str == 'b')
+ return strtol (str + 1, &str, 2);
+ else if (*str != '.')
+ return strtol (str, &str, 8);
+ }
+ val = strtod (str, &str);
+ if (*str == 'x')
+ {
+ if (val < 1 || val > 36)
+ error ("Radix out of range (from 2 to 36)\n");
+ val = strtol (str + 1, &str, (int) val);
+ }
+ return val;
+ }
+ else if (isexpr (*str))
+ {
+ readops ();
+ opsdo ("++", 2, { findtop (); return ++ *findvar (top, end); })
+ else opsdo ("--", 2, { findtop (); return -- *findvar (top, end); })
+ else opsdo ("-", 1, return -readnum ());
+ else opsdo ("+", 1, return readnum ());
+ else opsdo ("~", 1, return ~(ltype) readnum ());
+ else opsdo ("!", 1, return !readnum ());
+ else if (matchops ("(", 1))
+ {
+ ftype val = expr ();
+ while (*str == ',')
+ str ++, val = expr ();
+ readops ();
+ if (!matchops (")", 1))
+ error ("Unbalanced or illegal expression");
+ return val;
+ }
+ }
+ else if (isprevar (*str))
+ {
+ findtop ();
+ for (c = 0; c < bnfun; c ++)
+ if (matchlen (bfunn [c]))
+ {
+ readops ();
+ if (!matchops ("(", 1))
+ error ("Expected (");
+ val = expr ();
+ readops ();
+ if (!matchops (")", 1))
+ error ("Too many arguments");
+ return bfunp [c] (val);
+ }
+
+ readops ();
+ if (matchops ("(", 1))
+ {
+ char *ostr;
+ int ocfun;
+ ftype val;
+
+ for (c = 0; str [c] != '('; c ++)
+ if (str [c] == ')')
+ {
+ str += c;
+ readops ();
+ str -= c;
+ if (ops [1] == '=' && ops [2] != '=')
+ {
+ for (c = 0; c < nfun; c ++)
+ if (matchlen (funn [c]))
+ goto redef;
+ goto newdef;
+ }
+ break;
+ }
+ for (c = 0; c < nfun; c ++)
+ if (matchlen (funn [c]))
+ {
+ for (d = 0; funa [c] [d] != NULL; d ++)
+ {
+ a [d] = arg [d];
+ arg [d] = expr ();
+ readops ();
+ if (!matchops (funa [c] [d + 1] != NULL ? "," : ")", 1))
+ error ("Too few or too many arguments");
+ }
+ if (d == 0)
+ {
+ readops ();
+ if (!matchops (")", 1))
+ error ("Expected )");
+ }
+ ostr = str; str = func [c];
+ ocfun = cfun; cfun = c;
+ val = expr ();
+ while (*str == ',')
+ str ++, val = expr ();
+ str = ostr; cfun = ocfun;
+ while (d --)
+ arg [d] = a [d];
+ return val;
+ }
+
+ newdef:
+ resize (funn, c + 1);
+ resize (funa, c + 1);
+ resize (func, c + 1);
+ redef:
+ funn [c] = My_strndup (top, (int) (end - top));
+ funa [c] = NULL;
+
+ readops (); d = 0;
+ if (!matchops (")", 1))
+ while (1)
+ {
+ for (top = str; isintvar (*str); str ++);
+ resize (funa [c], d + 1);
+ funa [c] [d] = My_strndup (top, (int) (str - top));
+ readops ();
+ d ++;
+ if (matchops (")", 1))
+ break;
+ else if (!matchops (",", 1))
+ error ("Broken command");
+ }
+
+ readops ();
+ if (!matchops ("=", 1))
+ error ("Expected =");
+ resize (funa [c], d + 1);
+ funa [c] [d] = NULL;
+ func [c] = strdup (str);
+ if (c >= nfun)
+ nfun ++;
+ str += strlen (str) - 1;
+ return 0;
+ }
+ else
+ {
+ ftype *vp = findvar (top, end);
+ opsdo ("=", 1, return *vp = expr ());
+ else opsdo ("+=", 2, return *vp += expr ());
+ else opsdo ("-=", 2, return *vp -= expr ());
+ else opsdo ("*=", 2, return *vp *= expr ());
+ else opsdo ("/=", 2, return *vp /= expr ());
+ else opsdo ("%=", 2, return *vp = fmod (*vp, expr ()));
+ else opsdo ("&=", 2, return *vp = (ltype) (*vp) & (ltype) expr ());
+ else opsdo ("^=", 2, return *vp = (ltype) (*vp) ^ (ltype) expr ());
+ else opsdo ("!=", 2, return *vp = (ltype) (*vp) | (ltype) expr ());
+ else opsdo ("<<=", 3, return *vp = (ltype) (*vp) << (ltype) expr ());
+ else opsdo (">>=", 3, return *vp = (ltype) (*vp) >> (ltype) expr ());
+ else opsdo ("++", 2, return (*vp) ++);
+ else opsdo ("--", 2, return (*vp) --);
+ else return *vp;
+ }
+ }
+ error ("Retarded command");
+ return 0;
+}
+
+static ftype term (int lvl)
+{
+ ftype val;
+ if (lvl -- < 0)
+ return readnum ();
+ val = term (lvl);
+ while (1)
+ {
+ readops ();
+ switch (lvl + 1)
+ {
+ case 0:
+ opsdo ("**", 2, val = pow (val, term (lvl)));
+ else
+ return val;
+ break;
+ case 1:
+ opsdo ("*", 1, val *= term (lvl));
+ else opsdo ("/", 1, val /= term (lvl));
+ else opsdo ("%", 1, val = fmod (val, term (lvl)));
+ else return val;
+ break;
+ case 2:
+ opsdo ("+", 1, val += term (lvl));
+ else opsdo ("-", 1, val -= term (lvl));
+ else return val;
+ break;
+ case 3:
+ opsdo ("<<", 2, val = (ltype) val << (ltype) term (lvl));
+ else opsdo (">>", 2, val = (ltype) val >> (ltype) term (lvl));
+ else return val;
+ break;
+ case 4:
+ opsdo ("<", 1, val = val < term (lvl));
+ else opsdo ("<=", 2, val = val <= term (lvl));
+ else opsdo (">", 1, val = val > term (lvl));
+ else opsdo (">=", 2, val = val >= term (lvl));
+ else return val;
+ break;
+ case 5:
+ opsdo ("==", 2, val = val == term (lvl));
+ else opsdo ("!=", 2, val = val != term (lvl));
+ else return val;
+ break;
+ case 6:
+ if (!strncmp (ops, "&&", 2)) return val;
+ else opsdo ("&", 1, val = (ltype) val & (ltype) term (lvl));
+ else return val;
+ break;
+ case 7:
+ opsdo ("^", 1, val = (ltype) val ^ (ltype) term (lvl));
+ else return val;
+ break;
+ case 8:
+ if (!strncmp (ops, "||", 2)) return val;
+ else opsdo ("|", 1, val = (ltype) val | (ltype) term (lvl));
+ else return val;
+ break;
+ case 9:
+ opsdo ("&&", 2, val = val && term (lvl));
+ else return val;
+ break;
+ case 10:
+ opsdo ("||", 2, val = val || term (lvl));
+ else return val;
+ break;
+ case 11:
+ if (matchops ("?", 1))
+ {
+ int c;
+ if (val)
+ {
+ val = expr ();
+ skipspace ();
+ if (*str ++ != ':')
+ error ("Expected :");
+ for (c = 0; *str != '\0' && c >= 0; str ++)
+ if (*str == '(') c ++;
+ else if (*str == ')') c --;
+ }
+ else
+ {
+ for (c = 0; *str != '\0' && c >= 0; str ++)
+ if (*str == '?') c ++;
+ else if (*str == ':') c --;
+ if (str [-1] != ':')
+ error ("Expected :");
+ val = expr ();
+ }
+ }
+ else return val;
+ }
+ }
+}
+
+static ftype expr (void)
+{
+ return term (11);
+}
+
+static char ret_buffer[140];
+
+/* Evaluate str, printing the result to ret, return 0 on failure */
+int eval (char *_str, char **_ret)
+{
+ ftype val;
+ int c;
+
+ pradix = 10;
+ str = _str;
+ *_ret = ret_buffer;
+ ret = ret_buffer;
+ if (setjmp (jmp))
+ return 1;
+ val = expr ();
+ while (*str == ',')
+ str ++, val = expr ();
+ if (*str != '\0' && *str != '\n')
+ error ("Broken command");
+ if (pradix == 10)
+ sprintf (ret, "%.10" fprint "g", val);
+ else if (pradix == 16)
+ sprintf (ret, "0x%" lprint "X", (ltype) val);
+ else if (pradix == 8)
+ sprintf (ret, "0%" lprint "o", (ltype) val);
+ else if (pradix == 2)
+ {
+ ltype bin = val;
+ *ret ++ = '0';
+ *ret ++ = 'b';
+ if (bin > 0)
+ for (c = 0; bin >> c; c ++);
+ else
+ c = 64; /* Negative integers use all the bits ;-) SET */
+ if (c == 0)
+ *ret ++ = '0';
+ ret += c;
+ *ret -- = '\0';
+ for (; c--; bin >>= 1)
+ *ret -- = (bin & 1) + '0';
+ }
+ return 0;
+}
+
+#ifdef TEST
+int main (int argc, char *argv [])
+{
+ char buf [256], *res, *s;
+ int c;
+ printf ("Write expression, get answer.\n");
+ while (fgets (buf, 256, stdin) == buf)
+ {
+ eval (buf, &res);
+ printf (" = %s\n", res);
+ }
+ return 0;
+}
+#endif /* TEST */
+
+#endif // HAVE_CALCULATOR
+
diff --git a/setedit/calcu/parserml.c b/setedit/calcu/parserml.c
new file mode 100644
index 0000000..94039ee
--- /dev/null
+++ b/setedit/calcu/parserml.c
@@ -0,0 +1,409 @@
+/*
+ * PARSER.C V0.66 ML1050
+ *
+ * Author: Laszlo Molnar
+ *
+ * This program is free.
+
+ That's the original parser I used upto v0.4.41. Now is optional and the
+ default parser is the Burton's one because it incorporates interesting
+ features at a low cost.
+
+ Size of code with gcc 2.8.1 and -O2: 3456 bytes.
+
+ */
+
+#include <configed.h>
+#define Uses_string
+#define Uses_alloca
+#define Uses_stdlib
+#define Uses_stdio
+#define CLY_DoNotDefineUTypes
+#include <compatlayer.h>
+
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#ifdef TVCompf_djgpp
+ #include <float.h> /* for _clear87() */
+#endif
+
+#ifdef HAVE_CALCULATOR
+
+#ifdef TVComp_GCC
+ #define ltype long long
+ #define ltypes "ll"
+ #ifdef TVCompf_djgpp
+ #define strtol strtoll
+ #else
+ #define strtol strtoq
+ #endif
+#else
+ #if defined(TVComp_BCPP) || defined(TVComp_MSC)
+ #define ltype __int64
+ #define ltypes "i64"
+ #else
+ #define ltype long
+ #define ltypes "l"
+ #endif
+#endif
+
+#define OP_NEG 6 /* which is '-' in operators[] */
+
+static char *operators []= {
+ "|","^","&","<<",">>","+","-","*","/","%","**"," "};
+
+#define OPNUM (sizeof(operators)/sizeof(operators[0]))
+
+#define ULEVEL 6
+static char precedence [OPNUM]= {
+ 0 , 1 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 5 , 6 , ULEVEL};
+
+static char *functions []= {"sinh","cosh","tanh",
+ "asin","acos","atan",
+ "sin","cos","tan",
+ "log10","log","exp",
+ "abs","sqrt",
+ "ceil","floor",
+ "bin","oct","dec","hex"};
+
+#define FNUM (sizeof(functions)/sizeof(functions[0]))
+#define WHITESP " \n\t"
+#define SELF "()~"
+#define Y_EOS 0
+#define Y_ERR -1
+#define Y_NUMB 1
+#define Y_OPER 0x4000
+#define Y_UNAR (0x4800+OPNUM-1)
+
+#define OPENB 0x1000
+#define CLOSB 0x2000
+#define EPSI 0x3000 /* empty string */
+#define BIGE 0xE000
+
+static char *yyin;
+
+static double *numbers;
+static double yylval;
+
+static int nnumbers;
+static int radix;
+char yyout[140];
+
+static jmp_buf fperror;
+
+/********************************/
+static int
+yylex (void)
+{
+ int ic;
+ char *y=yyin;
+
+ while (*y && strchr (WHITESP,*y)!=NULL)
+ y++;
+ if (*y==0)
+ return Y_EOS; /* EOS */
+
+ if (strchr (SELF,*y)!=NULL)
+ return yyin=y+1,*y;
+
+ for (ic=OPNUM-1; ic>=0; ic--)
+ if (strncasecmp (y,operators[ic],strlen (operators[ic]))==0)
+ return yyin=y+strlen (operators[ic]),Y_OPER+ic;
+
+ if (*y>='0' && *y<='9')
+ {
+ yylval=0;
+ if (*y=='0')
+ {
+ if ((y[1]|0x20) == 'x')
+ yylval=strtol (y,&yyin,16);
+ else if ((y[1]|0x20) == 'b')
+ {
+ yyin=y+2;
+ while (*yyin=='0' || *yyin=='1')
+ yylval=yylval*2+*yyin++-'0';
+ }
+ else if (y[1] != '.')
+ yylval=strtol (y,&yyin,8);
+ }
+ if (yyin <= y+1)
+ yylval=strtod (y,&yyin);
+
+ return Y_NUMB;
+ }
+
+ for (ic=0; ic<FNUM; ic++)
+ {
+ if (strncasecmp (y,functions[ic],strlen (functions[ic])))
+ continue;
+ y+=strlen (functions[ic]);
+ while (*y && strchr (WHITESP,*y)!=NULL)
+ y++;
+ if (*y == '(')
+ return yyin=y+1,OPENB+ic+1;
+ }
+ if (*y=='\'' && y[2]=='\'')
+ return yyin+=3,yylval=y[1],Y_NUMB;
+ if (*y==',')
+ {
+ y++;
+ while (*y && strchr (WHITESP,*y)!=NULL)
+ y++;
+ yylval=*y|0x20;
+ radix=yylval=='x' ? 16 : yylval=='b' ? 2 : yylval=='o' ? 8 : 10;
+ yyin=y+1;
+ return yylex();
+ }
+
+ return Y_ERR;
+}
+
+/********************************/
+
+#undef R
+#undef S
+#undef _
+
+#define R 1 /* reduce */
+#define S 0 /* shift */
+#define A( a,b,c,d, e,f,g,h,i,j,k ) ((((((((((k*2+j)*2+i)*2+h)*2+g)*2+f)*2+e)*2+d)*2+c)*2+b)*2+a)
+
+static unsigned short opprec_table[]= {
+ /* LOOK AHEAD */
+ /* a ( ) e | ^ & < + * P */
+/* a */ A( R,R,R,R, R,R,R,R,R,R,R ), /* /\ TOKEN ON */
+/* ( */ A( S,S,S,R, S,S,S,S,S,S,S ), /* ][ THE TOP OF */
+/* ) */ A( R,R,R,R, R,R,R,R,R,R,R ), /* \/ THE STACK */
+/* e */ A( S,S,R,R, S,S,S,S,S,S,S ),
+
+/* | */ A( S,S,R,R, R,S,S,S,S,S,S ), /* lowest precedence */
+/* ^ */ A( S,S,R,R, R,R,S,S,S,S,S ),
+/* & */ A( S,S,R,R, R,R,R,S,S,S,S ),
+/* < */ A( S,S,R,R, R,R,R,R,S,S,S ),
+/* + */ A( S,S,R,R, R,R,R,R,R,S,S ),
+/* * */ A( S,S,R,R, R,R,R,R,R,R,S ),
+/* P */ A( S,S,R,R, R,R,R,R,R,R,S ) /* highest precedence */
+};
+
+#undef A
+
+#define isoper(x) ((x&0xf000)==Y_OPER)
+
+static int getprec (unsigned w1)
+{
+ if (!isoper (w1))
+ return w1>>12;
+ return 4+precedence[w1&0xff];
+}
+
+/********************************/ /* functions */
+static double mybin (double op) { radix=2; return op; }
+static double myoct (double op) { radix=8; return op; }
+static double mydec (double op) { radix=10; return op; }
+static double myhex (double op) { radix=16; return op; }
+/********************************/ /* operators */
+static double myor (double op1,double op2) {return (ltype)op1|(ltype)op2;}
+static double myxor (double op1,double op2) {return (ltype)op1^(ltype)op2;}
+static double myand (double op1,double op2) {return (ltype)op1&(ltype)op2;}
+static double left (double op1,double op2) {return (ltype)op1<<(int)op2;}
+static double right (double op1,double op2) {return (ltype)op1>>(int)op2;}
+static double plus (double op1,double op2) {return op1+op2;}
+static double minus (double op1,double op2) {return op1-op2;}
+static double mult (double op1,double op2) {return op1*op2;}
+static double mydiv (double op1,double op2) {return op1/op2;}
+static double mymod (double op1,double op2) {return (ltype)op1%(ltype)op2;}
+static double power (double op1,double op2) {return pow (op1,op2);}
+/********************************/
+
+static double (*op_table[])(double,double)= {myor,myxor,myand,left,right,
+ plus,minus,mult,mydiv,mymod,
+ power};
+
+static double (*func_table[])(double)= {sinh,cosh,tanh, asin,acos,atan,
+ sin,cos,tan, log10,log,exp,
+ fabs,sqrt, ceil,floor,
+ mybin,myoct,mydec,myhex};
+#define STACKSIZE 100
+
+static int yyparse (unsigned *mondat)
+{
+ unsigned akt=0,sp=0,ic,top;
+ unsigned stack [STACKSIZE];
+ double result;
+
+ stack[0]=EPSI;
+
+ while (!(stack[1]>=BIGE && sp==1 && mondat[akt]==EPSI))
+ {
+ top=stack[sp];
+ if (top>=BIGE)
+ {
+ if (sp>0)
+ top=stack[sp-1];
+ else
+ top=EPSI;
+ }
+
+ if (((opprec_table[getprec (top)] >> getprec (mondat[akt]))&1)==S)
+ {
+ if (STACKSIZE-1==sp) /* SHIFT */
+ return -3;
+ stack[++sp]=mondat[akt];
+ if (mondat[akt]!=EPSI)
+ akt++;
+ }
+ else /* REDUCE */
+ {
+ if ((stack[sp]&0xf000)==0x0) /* E=a */
+ stack[sp]+=BIGE;
+ else if (sp>2 && (stack[sp-2]&0xf000)==OPENB && stack[sp]==CLOSB &&
+ stack[sp-1]>=BIGE) /* E=function(E) */
+ {
+ if ((ic=stack[sp-2]&0xfff)!=0)
+ {
+ result=(func_table[ic-1])(numbers[stack[sp-1] & 0xfff]);
+ stack[sp-2]=nnumbers+BIGE;
+ numbers [nnumbers++]=result;
+ }
+ else
+ stack[sp-2]=stack[sp-1];
+ sp-=2;
+ }
+ else if (sp>2 && stack[sp]>=BIGE && stack[sp-2]>=BIGE &&
+ isoper (stack[sp-1])) /* E=E op E */
+ {
+ result=(op_table[(stack[sp-1]&0xff)])(numbers[stack[sp-2]&0xfff],
+ numbers[stack[sp]&0xfff]);
+ stack[sp-2]=nnumbers+BIGE;
+ numbers [nnumbers++]=result;
+ sp-=2;
+ }
+ else if (sp>1 && stack[sp]>=BIGE && (stack[sp-1]&Y_UNAR)==Y_UNAR)
+ {
+ result=numbers[stack[sp]&0xfff]; /* E=unaryop E */
+ if ((stack[sp-1]&0x700)==0x100)
+ result=~(ltype)result;
+ else
+ result=-result;
+ stack[sp-1]=nnumbers+BIGE;
+ numbers [nnumbers++]=result;
+ sp--;
+ }
+ else
+ return -1;
+ }
+ }
+ return stack[1]&0xfff;
+}
+
+/********************************/
+static void
+fperrhandle (int x)
+{
+ #ifdef TVCompf_djgpp
+ _clear87 (); /* hmm... we need this! */
+ #endif
+ longjmp (fperror,-4);
+}
+/********************************/
+int
+eval (char *mit,char **out)
+{
+ int inx=0,ic,jc=0;
+ unsigned *mondat;
+ static void (*prevfn)(int);
+
+ radix=10;
+ *out=yyout;
+ yyout[0]=0;
+ nnumbers=0;
+ yyin=mit; /* basic check */
+ while ((ic=yylex())!=Y_EOS && ic!=Y_ERR)
+ jc++; /* number of lexical elements */
+
+ if (ic==Y_ERR)
+ return -1;
+
+ mondat=(unsigned*) alloca ((jc+1)*sizeof(unsigned));
+ numbers=(double*) alloca (2*(1+jc)*sizeof(double));
+ yyin=mit;
+
+ while ((ic=yylex())!=Y_EOS)
+ if (ic==Y_NUMB)
+ {
+ mondat[inx++]=nnumbers;
+ numbers[nnumbers++]=yylval;
+ }
+ else if (ic=='(')
+ mondat[inx++]=OPENB;
+ else if (ic==')')
+ mondat[inx++]=CLOSB;
+ else if (ic=='~')
+ mondat[inx++]=Y_UNAR+0x100;
+ else if (ic==Y_OPER+OP_NEG)
+ {
+ if (inx==0 || (inx>0 && (mondat[inx-1]>=Y_OPER ||
+ (mondat[inx-1]&0xf000)==OPENB)))
+ {
+ mondat[inx++]=Y_UNAR+0x200;
+ }
+ else
+ mondat[inx++]=ic;
+ }
+ else
+ mondat[inx++]=ic;
+
+ mondat[inx++]=EPSI;
+
+ if (setjmp (fperror)==0)
+ prevfn=signal (SIGFPE,fperrhandle);
+ else
+ return signal (SIGFPE,prevfn),-4;
+
+ ic=yyparse (mondat);
+ signal (SIGFPE,prevfn);
+ if (ic<0)
+ return -3;
+
+ if (radix==10)
+ sprintf (yyout,"%.10g",numbers[ic]);
+ else if (radix==16)
+ sprintf (yyout,"0x%" ltypes "X",(ltype)numbers[ic]);
+ else if (radix==8)
+ sprintf (yyout,"0%" ltypes "o",(ltype)numbers[ic]);
+ else
+ {
+ unsigned ltype lc=(ltype) numbers[ic];
+ yyout[0]='0';
+ yyout[1]='b';
+ for (ic=0; lc; ic++,lc>>=1)
+ yyout[65+2+ic]=(lc&1)+'0';
+ if (ic==0)
+ yyout[65+2+ic++]='0';
+ for (jc=0; jc<ic; jc++)
+ yyout[jc+2]=yyout[65+2+ic-jc-1];
+ yyout[jc+2]=0;
+ }
+ return 0;
+}
+
+/********************************/
+#ifdef TEST
+int main (int argc,char **argv)
+{
+ int ic;
+ char *y;
+ if (argc < 2)
+ return printf ("Usage: %s expression-list\n",argv[0]);
+ while (--argc)
+ if ((ic=eval (argv[argc],&y)) < 0)
+ printf ("Error in expression: %d\n",ic);
+ else
+ printf("Result: %s\n",yyout);
+ return 0;
+}
+#endif
+
+#endif // HAVE_CALCULATOR
+
diff --git a/setedit/calcu/small.c b/setedit/calcu/small.c
new file mode 100644
index 0000000..f7a2c0a
--- /dev/null
+++ b/setedit/calcu/small.c
@@ -0,0 +1,229 @@
+/*****************************************************************************
+
+ Small parser. It supports all the functions found in ML's parser except the
+ use of ,base.
+ Created by Burton Radons <loth@pacificcoast.net>.
+
+ Size of code with gcc 2.8.1 and -O2: 3224 bytes.
+
+*****************************************************************************/
+
+#include <math.h>
+#include <setjmp.h>
+#define Uses_ctype
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define CLY_DoNotDefineUTypes
+#include <compatlayer.h>
+
+#define isintvar(STR) (STR == '_' || (STR >= 'a' && STR <= 'z') || (STR >= 'A' && STR <= 'Z') || (STR >= '0' && STR <= '9'))
+#define isexpr(STR) (!isintvar (STR))
+#define opsdo(NAME, EXPR) if (matchops (NAME)) EXPR
+
+#ifdef TVComp_GCC
+#define ltype long long
+#define lprint "ll"
+#endif
+
+#if defined(TVComp_BCPP) || defined(TVComp_MSC)
+#define ltype __int64
+#define lprint "i64"
+#endif
+
+#define ftype long double
+#define fprint "L"
+
+static char *str, *ret;
+static jmp_buf jmp;
+static int pradix;
+
+typedef ftype (*funtype) (ftype a);
+#define easy(NAME) static ftype fun_##NAME (ftype a) { return NAME (a); }
+easy (sin); easy (cos); easy (tan); easy (sinh); easy (cosh); easy (tanh); easy (asin);
+easy (acos); easy (atan); easy (log); easy (log10); easy (exp); easy (abs); easy (sqrt);
+easy (ceil); easy (floor);
+#undef easy
+#define easy(NAME, RADIX) static ftype fun_##NAME (ftype a) { pradix = RADIX; return a; }
+easy (bin, 2); easy (oct, 8); easy (dec, 10); easy (hex, 16);
+#undef easy
+
+static char *funn [] = { "sin", "cos", "tan", "sinh", "cosh", "tanh", "asin", "acos",
+ "atan", "log", "log10", "exp", "abs", "sqrt", "ceil", "floor",
+ "bin", "oct", "dec", "hex" };
+static funtype funp [] = { fun_sin, fun_cos, fun_tan, fun_sinh, fun_cosh, fun_tanh, fun_asin,
+ fun_acos, fun_atan, fun_log, fun_log10, fun_exp, fun_abs, fun_sqrt,
+ fun_ceil, fun_floor, fun_bin, fun_oct, fun_dec, fun_hex };
+#define nfun (int) (sizeof (funn) / sizeof (*funn))
+
+static ftype expr (void);
+
+static void error (int num)
+{
+ longjmp (jmp, num);
+}
+
+static void skipspace (void)
+{
+ while (isspace (*str))
+ str ++;
+}
+
+int matchops (char *name)
+{
+ skipspace ();
+ if (strncmp (str, name, strlen (name)))
+ return 0;
+ str += strlen (name);
+ return 1;
+}
+
+static ftype readnum (void)
+{
+ int c, len;
+ char *top, *end;
+ ftype val;
+
+ skipspace ();
+ if (*str == '.' || (*str >= '0' && *str <= '9'))
+ {
+ if (*str == '0')
+ {
+ if (*++ str == 'x')
+ return strtol (str + 1, &str, 16);
+ else if (*str == 'b')
+ return strtol (str + 1, &str, 2);
+ else if (*str != '.')
+ return strtol (str, &str, 8);
+ }
+ return strtod (str, &str);
+ }
+ else if (isexpr (*str))
+ {
+ opsdo ("-", return -readnum ());
+ else opsdo ("~", return ~(ltype) readnum ());
+ else if (matchops ("("))
+ {
+ val = expr ();
+ if (!matchops (")"))
+ error (-3);
+ return val;
+ }
+ }
+ else
+ {
+ for (top = str; isintvar (*str); str ++); end = str;
+ if (!matchops ("("))
+ error (-3);
+ val = expr ();
+ if (!matchops (")"))
+ error (-3);
+ for (c = 0; c < nfun; c ++)
+ if ((int) (end - top) == (len = strlen (funn [c])) && !strncasecmp (top, funn [c], len))
+ return funp [c] (val);
+ }
+ error (-1);
+ return 0;
+}
+
+static ftype term (int lvl)
+{
+ ftype val;
+ if (lvl -- < 0)
+ return readnum ();
+ val = term (lvl);
+ while (1)
+ {
+ switch (lvl + 1)
+ {
+ case 0: opsdo ("**", val = pow (val, term (lvl)));
+ else return val;
+ break;
+ case 1: opsdo ("*", val *= term (lvl));
+ else opsdo ("/", val /= term (lvl));
+ else opsdo ("%", val = fmod (val, term (lvl)));
+ else return val;
+ break;
+ case 2: opsdo ("+", val += term (lvl));
+ else opsdo ("-", val -= term (lvl));
+ else return val;
+ break;
+ case 3: opsdo ("<<", val = (ltype) val << (ltype) term (lvl));
+ else opsdo (">>", val = (ltype) val >> (ltype) term (lvl));
+ else return val;
+ break;
+ case 4: opsdo ("&", val = (ltype) val & (ltype) term (lvl));
+ else return val;
+ break;
+ case 5: opsdo ("^", val = (ltype) val ^ (ltype) term (lvl));
+ else return val;
+ break;
+ case 6: opsdo ("|", val = (ltype) val | (ltype) term (lvl));
+ else return val;
+ break;
+ }
+ }
+}
+
+static ftype expr (void)
+{
+ return term (6);
+}
+
+static char ret_buffer[140];
+
+/* Evaluate str, printing the result to ret, return -1 on failure */
+int eval (char *_str, char **_ret)
+{
+ ftype val;
+ int c;
+
+ pradix = 10;
+ str = _str;
+ *_ret = ret_buffer;
+ ret = ret_buffer;
+ if ((c = setjmp (jmp)))
+ return c;
+ val = expr ();
+ if (*str != '\0' && *str != '\n')
+ error (-3);
+ if (pradix == 10)
+ sprintf (ret, "%.10" fprint "g", val);
+ else if (pradix == 16)
+ sprintf (ret, "0x%" lprint "X", (ltype) val);
+ else if (pradix == 8)
+ sprintf (ret, "0%" lprint "o", (ltype) val);
+ else if (pradix == 2)
+ {
+ ltype bin = val;
+ *ret ++ = '0';
+ *ret ++ = 'b';
+ for (c = 0; bin >> c; c ++);
+ if (c == 0)
+ *ret ++ = '0';
+ ret += c;
+ *ret -- = '\0';
+ for (; bin; bin >>= 1)
+ *ret -- = (bin & 1) + '0';
+ }
+ return 0;
+}
+
+#ifdef TEST
+int main (int argc, char *argv [])
+{
+ char buf [256], *res, *s;
+ int c;
+ printf ("Write expression, get answer.\n");
+ while (fgets (buf, 256, stdin) == buf)
+ {
+ for (s=buf; *s && *s!='\n'; s++); *s=0;
+ c = eval (buf, &res);
+ if (c == 0)
+ printf (" = %s\n", res);
+ else
+ printf (" Error %d\n", c);
+ }
+ return 0;
+}
+#endif /* TEST */
diff --git a/setedit/cfgfiles/asm51.pmc b/setedit/cfgfiles/asm51.pmc
new file mode 100644
index 0000000..55ac424
--- /dev/null
+++ b/setedit/cfgfiles/asm51.pmc
@@ -0,0 +1,97 @@
+; Macros designed for 8x51 assembler files
+; by Alex Lozano
+
+
+Trigger: "i("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if plus else
+ "$IF (@0)\n"
+ "$ELSE (@1)\n"
+ "$ENDIF"
+
+Trigger: "I("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if, no else
+ "$IF (@0)\n"
+ "$ENDIF"
+
+Trigger: "m("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Macro
+ "@0\tMACRO\t@1\n"
+ "ENDM"
+
+Trigger: ".b"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: BSEG
+ "BSEG\tAT\t@0\n"
+
+Trigger: ".c"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: CSEG
+ "CSEG\tAT\t@0\n"
+
+Trigger: ".d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: DSEG
+ "DSEG\tAT\t@0\n"
+
+Trigger: ".i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: ISEG
+ "ISEG\tAT\t@0\n"
+
+Trigger: ".r"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: RSEG
+ "RSEG\tSEGMENT\t@0\n"
+
+Trigger: ".s"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: SEGMENT
+ "@0\tSEGMENT\t@1\n"
+
+Trigger: ".x"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: XSEG
+ "XSEG\tAT\t@0\n"
+
+Trigger: "ex"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Extern
+ "EXTRN\t@0 (@1)"
+
+Trigger: "pu"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Public
+ "PUBLIC\t@0,"
+
+Trigger: "us"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: USING
+ "USING\t@0"
+
+Trigger: "#i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Include
+ "$include (@0.inc)"
+
+Trigger: "#t"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Title
+ "$TT (@0)"
+
+Trigger: "/*"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Function comment
+"/*****************************************************************************\n"
+"\n"
+" Function: @0\n"
+"\n"
+ "Description: @1\n"
+ "Parameters: @2\n"
+ "Return: @3\n"
+"\n"
+"\b*****************************************************************************/\n"
+"\n"
+
diff --git a/setedit/cfgfiles/clippmac.pmc b/setedit/cfgfiles/clippmac.pmc
new file mode 100644
index 0000000..7c4f48d
--- /dev/null
+++ b/setedit/cfgfiles/clippmac.pmc
@@ -0,0 +1,151 @@
+; Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+; The following macros are designed for the Autoindent+Unindent mode.
+; \n is new line.
+; \b is backspace.
+; @0 is the position where the cursor is positioned after the insertion
+; @1 is memorized in ^Q7 (or Alt7)
+; @2 is memorized in ^Q8 (or Alt8)
+; @3 is memorized in ^Q9 (or Alt9)
+; Don't put only @ at the end of the string :-).
+;
+; The Mode keyword indicates the mode of the editor when the macro is
+; triggered, each mode can be 0 or 1:
+; Overwrite, Autoindent, Use Tabs, Persistent blocks, Inteligent C indent
+; For example: Mode: 0,1,0,1,0
+; Indicates: No overwrite, autoindent, don't use real tabs, the blocks are
+; persistent and don't be smart when indenting.
+; The Mode keyword can't be omitted.
+
+Trigger: "f("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: For/Next
+ "For @0:=@1 To @2\n"
+ "Next"
+
+Trigger: "d("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Do/While/EndDo
+ "Do While @0\n"
+ "EndDo"
+
+Trigger: "w("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Do/While/EndDo 2
+ "Do While @0\n"
+ "EndDo"
+
+Trigger: "i("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: If/Else/EndIf
+ "If @0\n"
+ "Else\n"
+ "EndIf"
+
+Trigger: "I("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: If/EndIf
+ "If @0\n"
+ "EndIf"
+
+Trigger: "s("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Do/Case/OtherWise/EndCase
+ "Do Case\n"
+ " Case @0\n"
+ "OtherWise\n"
+"\bEndCase\n"
+
+Trigger: "c:"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Case
+ "Case @0"
+
+Trigger: "pr"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Print
+ "? @0"
+
+Trigger: "#i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Include .ch
+ "#include \"@0.ch\""
+
+Trigger: "#I"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Include .h
+ "#include \"@0.h\""
+
+Trigger: "#d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Define
+ "#define @0"
+
+Trigger: "re"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Return
+ "Return @0"
+
+Trigger: "/*"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Comment
+"/*****************************************************************************\n"
+"\n"
+" Function: @0\n"
+"\n"
+ "Description:@1\n"
+ "Parameters:@2\n"
+ "Return:@3\n"
+"\n"
+"\b*****************************************************************************/\n"
+"\n"
+
+Trigger: "ma"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Main procedure
+"Procedure Main\n"
+"\n"
+"@0\n"
+"Return"
+
+Trigger: "/t"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: SDG comment long
+"/**[txh]********************************************************************\n"
+"\n"
+" Function:@0\n"
+ "Class:\n"
+ "Include:\n"
+ "Module:\n"
+ "Prototype:@1\n"
+ "Description:\n"
+ "@2\n"
+ "Return:@3\n"
+ "Example:\n"
+"\n"
+"\b***************************************************************************/\n"
+
+Trigger: "/d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: SDG comment short
+"/**[txh]********************************************************************\n"
+"\n"
+" Description: @0\n"
+ "@1\n"
+ "Return:@2\n"
+ "Example:@3\n"
+"\n"
+"\b***************************************************************************/\n"
+
+Trigger: "fu"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Function
+ "Function @0()\n"
+ "Return@1"
+
+Trigger: "po"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Procedure
+ "Procedure @0()\n"
+ "Return"
diff --git a/setedit/cfgfiles/cpmacros.pmc b/setedit/cfgfiles/cpmacros.pmc
new file mode 100644
index 0000000..156e151
--- /dev/null
+++ b/setedit/cfgfiles/cpmacros.pmc
@@ -0,0 +1,184 @@
+; Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+; The following macros are designed for the Autoindent+Unindent mode.
+; \n is new line.
+; \b is backspace.
+; \t is tab (not ASCII 9 but the smart tab)
+; @0 is the position where the cursor is positioned after the insertion
+; @1 is memorized in ^Q7 (or Alt7)
+; @2 is memorized in ^Q8 (or Alt8)
+; @3 is memorized in ^Q9 (or Alt9)
+; @@ is a simple @
+; @{Name} asks the user a value for "Name". Name becomes a variable.
+; @{Name;Def} asks the user a value for "Name". Name becomes a variable. The
+; default value is "Def".
+; @vN inserts the content of the "variable" number N. Variables are numbered
+; starting with 0.
+; Don't put only @ at the end of the string :-).
+;
+; The Mode keyword indicates the mode of the editor when the macro is
+; triggered, each mode can be 0 or 1:
+; Overwrite, Autoindent, Use Tabs, Persistent blocks, Inteligent C indent,
+; Column cursor, Row cursor, Show match pair, idem on the fly, idem inmediatly,
+; Transparent selection, Optimal fill, Wrap lines, Visible tabs, Don't move
+; inside tabs, Tab key indents, Use indent size, Don't purge spaces and
+; Backspace key unindents.
+; For example: Mode: 0,1,0,1,0
+; Indicates: No overwrite, autoindent, don't use real tabs, the blocks are
+; persistent and don't be smart when indenting.
+; The Mode keyword can't be omitted.
+
+Trigger: "f("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: For cycle
+ "for (@0; ; )\n"
+ " {\n"
+ " @1\n"
+ "}"
+
+Trigger: "d("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Do {} while
+ "do\n"
+ " {\n"
+ " @1\n"
+ "}\n"
+ "\bwhile (@0);"
+
+Trigger: "w("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: While cycle
+ "while (@0)\n"
+ " {\n"
+ " @1\n"
+ "}"
+
+Trigger: "i("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if plus else
+ "if (@0)\n"
+ " {\n"
+ " @1\n"
+ "}\n"
+ "\belse\n"
+ " {\n"
+ " @2\n"
+ "}"
+
+Trigger: "I("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if, no else
+ "if (@0)\n"
+ " {\n"
+ " @1\n"
+ "}"
+
+Trigger: "s("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Switch
+ "switch (@0)\n"
+ " {\n"
+ " case @1:\n"
+ " break;\n"
+ "\bdefault:@2\n"
+ "\b}"
+
+Trigger: "c:"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Case
+ "case @0:\n"
+ " break;"
+
+Trigger: "un"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Unsigned
+ "unsigned @0"
+
+Trigger: "ex"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Extern
+ "extern @0"
+
+Trigger: "pr"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Printf
+ "printf(\"@0\");"
+
+Trigger: "#i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Include <>
+ "#include <@0.h>"
+
+Trigger: "#I"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Include ""
+ "#include \"@0.h\""
+
+Trigger: "#d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Define
+ "#define @0"
+
+Trigger: "si"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Sizeof
+ "sizeof(@0)"
+
+Trigger: "re"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Return
+ "return @0;"
+
+Trigger: "/*"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Function comment
+"/*****************************************************************************\n"
+"\n"
+" Function: @0\n"
+"\n"
+ "Description: @1\n"
+ "Parameters: @2\n"
+ "Return: @3\n"
+"\n"
+"\b*****************************************************************************/\n"
+"\n"
+
+Trigger: "ma"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Main
+"int main(int argc, char *argv[])\n"
+"{\n"
+" @0\n"
+" return 0;\n"
+"\b}"
+
+Trigger: "/t"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: SDG Comment long
+"/**[txh]********************************************************************\n"
+"\n"
+" Function: @0\n"
+ "Class:\n"
+ "Include:\n"
+ "Module:\n"
+ "Prototype: @1\n"
+ "Description:\n"
+ "@2\n"
+ "Return: @3\n"
+ "Example:\n"
+"\n"
+"\b***************************************************************************/\n"
+
+Trigger: "/d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: SDG Comment short
+"/**[txh]********************************************************************\n"
+"\n"
+" Description: @0\n"
+ "@1\n"
+ "Return: @2\n"
+ "Example: @3\n"
+"\n"
+"\b***************************************************************************/\n"
+
diff --git a/setedit/cfgfiles/editor.tip b/setedit/cfgfiles/editor.tip
new file mode 100644
index 0000000..24d6a85
--- /dev/null
+++ b/setedit/cfgfiles/editor.tip
@@ -0,0 +1,159 @@
+~~~Start
+Hi! that's a tip. You can disable this
+dialog or you can choose to display
+the hints in the message window.
+The hints are showed ones a day to
+avoid annoying you, you can read the
+tips from the Help menu.
+In the dialog: at the right can appear
+one or more links to related topics,
+like the "About the Author" now. Just
+click in the button to go to this help
+topic.
+~~~End
+About the Author
+~~~Start
+When you press tab in the editor it
+normally doesn't insert a tab character
+but you can configure the editor to
+insert tab characters in your text.
+~~~End
+Real Tabs
+Set Global
+Set Local
+Compact text
+Expand all tabs
+~~~Start
+You can save the default options to
+avoid configuring the editor again and
+again.
+For that just run the editor in the
+directory pointed by the SET_FILES
+environment variable, configure the
+editor and exit with ALT-X.
+~~~End
+~~~Start
+You can reconfigure the keyboard to
+behave like you want. You can assign a
+command, a sequence of commands or a
+macro to any keyboard combination.
+~~~End
+Keyboard configuration
+~~~Start
+You have various features to indent
+your code. You can indent blocks by a
+space, by a tab or using a smart
+algorithm.
+~~~End
+Indentation
+~~~Start
+The editor supports macros. You can
+record the macros typing the sequence
+or write the macro in a language called
+sLisp.
+~~~End
+Macro
+sLisp macros
+~~~Start
+Under Windows GUI you can copy text to
+the clipboard using "Edit|Copy to
+Windows Clip." options. You can paste
+text from the clipboard using
+"Edit|Paste from Wind. Clip.".
+~~~End
+Clipboard
+~~~Start
+You can save keystrokes defining your
+own pseudo-macros. For example: to
+write a "Hello World" program you just
+need 26 keystrokes and the generated
+file is 101 bytes long.
+~~~End
+Pseudo Macros
+~~~Start
+You can select a column of text using
+the rectangular blocks feature of the
+editor. Then you can move, copy or
+delete this column of text.
+~~~End
+Rectangular Blocks
+~~~Start
+You can save a file without changing
+the date and time on disk. That's very
+useful to modify headers when you know
+what sources will be affected and don't
+want to build the whole project.
+~~~End
+Save with same time
+~~~Start
+You can use project files to group
+files that you usually edit together.
+~~~End
+Project
+~~~Start
+You can avoid the creation of back-up
+files if you don't like it.
+~~~End
+~~~Start
+You can use regular expressions when
+searching.
+~~~End
+Find
+Replace
+Regular Expressions
+~~~Start
+You can reconfigure the whole menu just
+editing a text file.
+~~~End
+Pull-down menus
+~~~Start
+You can avoid the creation of desktop
+files in each directory.
+~~~End
+Desktop Files
+~~~Start
+The editor supports fonts and code
+pages. You can use the encoding
+features of the editor to read texts in
+an encoding different than the one used
+by your OS. For example to read Linux
+text under DOS when it have ASCIIs over
+than 127.
+~~~End
+Screen Options
+~~~Start
+The editor contains a powerful
+built-in calculator made by Molnar
+Laszlo. It supports binary, octal,
+decimal and hexadecimal conversions and
+most of the functions of a scientific
+calculator.
+~~~End
+Calculator
+~~~Start
+If you are writing a library or a large
+project you can document your functions
+using a built-in documentation
+generator (SDG).
+~~~End
+SDG Options
+~~~Start
+You can exit the editor deleting all
+the backup and desktop files located in
+the current directory.
+~~~End
+Quit
+~~~Start
+You can customize the palette used by
+the editor. In this way you can choose
+the colors you want.
+~~~End
+Color Palette
+Colors
+~~~Start
+You can define your own reserved words
+for the syntax highlight. That's very
+useful for C's typedefs, Texinfo
+macros, etc.
+~~~End
+User Words
diff --git a/setedit/cfgfiles/errors.cle b/setedit/cfgfiles/errors.cle
new file mode 100644
index 0000000..8834681
--- /dev/null
+++ b/setedit/cfgfiles/errors.cle
@@ -0,0 +1,165 @@
+# Copyright (C) 1999-2005 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Command line errors description file for SET's editor
+#
+# Name must be the first.
+#
+
+#
+# GNU programs
+# Note: The `Internal' version is faster and also supports
+# internationalization.
+# The internal version also supports long lines cut
+# by gcc 3.x.
+#
+Name=GNU
+Pattern=((\w:[^:]+)|([^:]+)):(\d+): (.+)
+File=1
+Line=4
+Description=5
+EnterDirPat=[Ee]ntering dir(.+)`(.+)'
+EnterDirDir=2
+LeaveDir=[Ll]eaving dir
+UseInternal
+End
+
+#
+# Clipper 5.x
+#
+Name=Clipper
+Pattern=(.+)\((.+)\) +(Error|Warning) (.+)
+File=1
+Line=2
+Severity=3
+Description=4
+SevError=Error
+SevWarn=Warning
+End
+
+#
+# Visual C 5.0
+#
+# Textual description by Grzegorz Adam Hankiewicz <gradha@iname.com>
+# Not tested.
+#
+Name=Visual C
+Pattern=(.+)\((.+)\) :(.+):(.+)
+File=1
+Line=2
+Description=4
+End
+
+#
+# Borland C 5.5
+#
+# Textual description by Grzegorz Adam Hankiewicz <gradha@iname.com>
+# SET: I tested it and fixed some details. I used the free command line tools
+#
+Name=Borland C
+Pattern=(Error|Warning) (.+) (.+) (.+): (.+)
+Severity=1
+# 2 is the number of the error/warning
+File=3
+Line=4
+Description=5
+SevError=Error
+SevWarn=Warning
+End
+
+#
+# Turbo Pascal 7.0
+#
+# Textual description by Grzegorz Adam Hankiewicz <gradha@iname.com>
+# Not tested.
+#
+Name=Turbo Pascal
+Pattern=(.+)\((.+)\):(.+):(.+)
+File=1
+Line=2
+Description=4
+End
+
+#
+# Watcom 11
+#
+# Textual description by Grzegorz Adam Hankiewicz <gradha@iname.com>
+# Not tested.
+#
+Name=Watcom
+Pattern=(.+)\((.+)\) : (.+) : (.+)
+File=1
+Line=2
+Description=4
+End
+
+#
+# Turbo Assembler v 2.02
+#
+# Textual description by Alex Lozano <alex@inti.gov.ar>
+#
+# Messages format:
+# **Warning|Error|Fatal** filename(line) [macroname(macroline)] message
+#
+Name=Tasm 2.02
+Pattern=\*+(Error|Warning|Fatal)\*+\s([^\(]*)\((\d+)\)\s(.*)
+Severity=1
+File=2
+Line=3
+Description=4
+SevError=Error|Fatal
+SevWarn=Warning
+End
+
+#
+# ANT java builder
+# Contributed by Grzegorz Adam Hankiewicz <gradha@efaber.net>
+#
+Name=Ant (Java)
+Pattern=javac\] ([^:]+):(\d+): (.+)
+File=1
+Line=2
+Description=3
+End
+
+#
+# Perl
+# Contributed by Thiago F.G. Albuquerque
+#
+# Messages format:
+# <error> at <filename> line <lineno>
+#
+Name=Perl
+Pattern=at (.+) line (\d+)
+File=1
+Line=2
+End
+
+#
+# Xilinx tools, in particular xst
+#
+# Messages format:
+# <error|warning>:<program>:<error_code> - <filename> line <lineno>: <description>
+#
+Name=Xilinx
+Pattern=(WARNING|ERROR):([^:]+):(\d+) - \"?([^\"]+)\"? [lL]ine (\d+)[:\.] (.+)
+Severity=1
+File=4
+Line=5
+Description=6
+SevError=ERROR
+SevWarn=WARNING
+End
+
+#
+# PHP
+#
+# Messages format:
+# <error> in <filename> on line <lineno>
+#
+Name=PHP
+Pattern=in (.+) on line (\d+)
+File=1
+Line=2
+End
+
diff --git a/setedit/cfgfiles/eterm/Setedit/MAIN b/setedit/cfgfiles/eterm/Setedit/MAIN
new file mode 100644
index 0000000..143b925
--- /dev/null
+++ b/setedit/cfgfiles/eterm/Setedit/MAIN
@@ -0,0 +1,178 @@
+<Eterm-0.8>
+#
+# Eterm configuration file to be used with setedit
+#
+
+begin main
+
+ begin color
+
+# Foreground, background, cursor, scrollbar, pointer colors
+ foreground white
+ background black
+ cursor #ffff00
+ cursor_text #880000
+ menu_text white
+ scrollbar #3f1c00
+ unfocusedscrollbar #777777
+ pointer white
+
+# video attribute can either be "normal" or "reverse"
+ video normal
+
+# Redefine the 16 basic colors, if you really feel the need
+# First word is "color", next is the number (0-15, BD, or UL),
+# then the values for red, green, and blue separated by spaces
+# Numbers are base 10 unless preceded by "0x" (base 16) or '0'
+# (base 8). Alternatively, you can use color names or #xxxxxx
+# format.
+
+# The colors below are taken from Rasterman's .Xdefaults file. They are intended to
+# display ANSI art properly when combined with a good ANSI-art font (like vga or
+# Rasterman's nexus font).
+# color 0 0 0 0
+# color 1 0xaa 0 0
+# color 2 0 0210 0
+# color 3 0xaa 0x55 0x22
+# color 4 0 0 0xaa
+# color 5 0xaa 0 0xaa
+# color 6 0 0xaa 0xaa
+# color 7 0xaa 0xaa 0xaa
+# color 8 0x44 0x44 0x44
+# color 9 0xff 0x44 0x44
+# color 10 0x44 0xff 0x44
+# color 11 0xff 0xff 0x44
+# color 12 0x44 0x44 0xff
+# color 13 0xff 0x44 0xff
+# color 14 0x44 0xff 0xff
+# color 15 #ffffff
+# color bd #ffffff
+# color ul #ffffff
+
+ end color
+
+ begin attributes
+
+# Geometry == widthxheight+x_offset+y_offset, offsets from top left
+# if +, bottom right if -
+ geometry 94x34
+ title "Setedit - %appname()"
+ name ""
+ iconname Setedit
+
+# Set the fonts. These must be monospace fonts. The values shown are
+# the Eterm defaults. The "bold" font is the font used if color BD has
+# not been set and Eterm cannot map the foreground color to one of the
+# high-intensity colors (8-15).
+ font 0 fixed
+ font 1 6x10
+ font 2 6x13
+ font 3 8x13
+ font 4 9x15
+# font bold 7x14
+ end attributes
+
+# This section is for pixmap definitions. The only one used currently
+# is "background". The supplied numbers work just like they do for
+# Enlightenment: first is X (width), second is Y (height). -1 to
+# scale 100%, 0 to tile, any other number specifies W/H in pixels
+ begin pixmaps
+# background %random(`cat pixmaps.list 2>/dev/null`)
+# path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:/usr/share/Eterm/pix/"
+
+# Support for these is forthcoming
+# scroll_up -1 -1 ~/.Eterm/up_arrow.ppm
+# scroll_down -1 -1 ~/.Eterm/down_arrow.ppm
+# scroll_background 0 0 ~/.Eterm/scroll.ppm
+# scroll_anchor -1 -1 ~/.Eterm/anchor.ppm
+ end
+
+# The Kanji support options. Same goes for these fonts as for the normal
+# ones. The "encoding" attribute can be either "eucj" or "sjis".
+# begin kanji
+# font 0 k14
+# font 1 jiskan16
+# font 2 jiskan18
+# font 3 jiskan24
+# font 4 jiskan26
+# encoding eucj
+# end kanji
+
+# Boolean variables. The values can be "1", "on", or "true" for TRUE, or "0",
+# "off", or "false" for FALSE.
+ begin toggles
+
+# If true, Eterm will un-iconify itself when it receives a beep (ASCII 0x07)
+ map_alert on
+
+# If true, Eterm will flash rather than sending a beep.
+ visual_bell off
+
+# If true, Eterm will prepend '-' to the shell name when calling it.
+ login_shell true
+
+# If true, Eterm will display the scroll bar
+ scrollbar off
+
+# If true, Eterm will attempt to make an entry in the utmp file to record the
+# login information. Eterm *must* run privileged to do this.
+ utmp_logging on
+
+# If true, Eterm will handle the Meta (Alt) + keypress to set the 8th bit.
+# If false, Eterm will handle the Meta + keypress as an escape prefix. (default)
+# meta8 false
+
+# If true, Eterm will start iconified.
+ iconic false
+
+# If true, Eterm will jump to the bottom of the window when something is echoed
+# to the terminal, either by program output or user input.
+ home_on_echo 1
+
+# If true, Eterm will jump to the bottom of the window when you refresh the
+# screen (^L).
+ home_on_refresh 1
+
+# If true, Eterm will put the scrollbar on the right of the window (default is left).
+ scrollbar_right true
+
+# If true, the scrollbar will have no trough.
+ scrollbar_floating false
+
+# If true, Eterm will run with no window borders.
+ borderless false
+
+ end toggles
+
+ begin keyboard
+
+# Use the supplied keysym to reduce/enlarge the font
+ smallfont_key LessThan
+ bigfont_key GreaterThan
+
+# You can also associate a given keysym (0xff00 - 0xffff) with a string
+# keysym 0xffff "\r\n\e\007\t"
+ keysym 0xffea "ALT_R"
+
+# Greek keyboard mode. First the word "greek", then its boolean
+# state, then its mode (either "iso" or "ibm").
+# greek off iso
+ end keyboard
+
+ begin misc
+
+ save_lines 0
+ cut_chars "\t\\\`\\\"\'&() *,;<=>?@[]{|}"
+ border_width 5
+ menu Setedit.menu
+
+# Value to use for $TERM
+# The library will use some Eterm tricks if this terminal is detected:
+ term_name xterm-eterm-tv
+
+# Program to exec (intended for use with themes)
+ exec setedit
+# exec /usr/src/tvision/gkey.exe
+ end misc
+
+end main
diff --git a/setedit/cfgfiles/eterm/Setedit/Setedit.menu b/setedit/cfgfiles/eterm/Setedit/Setedit.menu
new file mode 100644
index 0000000..80bc74f
--- /dev/null
+++ b/setedit/cfgfiles/eterm/Setedit/Setedit.menu
@@ -0,0 +1,28 @@
+# Setedit control menu
+[menu:Eterm]
+
+/Font/*
+{Normal} ^@\e]50;#
+{Larger} ^@\e]50;#+
+{Smaller} ^@\e]50;#-
+{-}
+{Font 1} ^@\e]50;#1
+{Font 2} ^@\e]50;#2
+{Font 3} ^@\e]50;#3
+{Font 4} ^@\e]50;#4
+
+/Terminal/*
+./Toggles/*
+{Map Alert} ^@\e]6;21\a
+{Primary/Secondary Screen} ^@\e[?47t
+{Reverse Video} ^@\e[?5t
+{Visual Bell} ^@\e]6;20\a
+{Xterm Selection Behavior} ^@\e]6;22\a
+../Menubar/*
+{Toggle Visibility}{Ctrl-Button3} ^@\e[?10t
+{Refresh Menubar} ^@\e[?10h
+{Toggle Window Move by Menubar} ^@\e]6;15\a
+
+/
+[show]
+[done]
diff --git a/setedit/cfgfiles/eterm/readme.txt b/setedit/cfgfiles/eterm/readme.txt
new file mode 100644
index 0000000..c7dc410
--- /dev/null
+++ b/setedit/cfgfiles/eterm/readme.txt
@@ -0,0 +1,87 @@
+ This directory contains an example of how to exploit the new features found
+in Turbo Vision v1.0.7 (July 1999) under Eterm. The text is oriented for any
+program and as example I talk about my editor (setedit). As this file will be
+probably distributed with both (the library and the editor) don't get
+surprised if I sometimes I say "the editor" instead of "the program".
+ Eterm is a very good replacement for xterm (UNIX X11 terminal emulator).
+ You'll need Eterm v0.8.10 or a CVS snapshot that contains my patch to add
+the --report-as-keysyms option to Eterm. [Thanx to MEJ who accepted this
+crazy patch!].
+
+
+1. What I gain?
+2. What I need?
+3. How it works?
+4. Final comments
+
+
+1. What I gain?
+
+ When using Eterm and some associated things you gain a lot of information
+from the keyboard. Things like Shift+Arrows can be detected by TV (Turbo
+Vision).
+
+
+2. What I need?
+
+ You need Eterm 0.8.10 or newer, you also need to install the xterm-eterm-tv
+terminal description in your system. In Debian GNU/Linux v2.0 the process is
+this:
+
+a) Compile the file: (for more information see the tic(1m) manpages)
+# tic xterm-eterm-tv
+b) Copy the compiled terminal description file to the right directory:
+# cp /usr/share/terminfo/x/xterm-eterm-tv /etc/terminfo/x/
+
+ Finally you need to run Eterm with a "theme" for your program. The files
+contained here are a theme for the editor (setedit).
+ If you are installing this files for setedit just copy the Setedit
+directory to the directory where the Eterm themes are located, in my system
+that's: /usr/share/Eterm/themes/
+ Once this theme is installed you can invoke Eterm like this:
+
+# Eterm -t Setedit --report-as-keysyms
+
+ and it will automagically start setedit inside the window.
+ In the case you need to adapt this theme for other TV program just read the
+Eterm documentation or the comments in the theme called "Eterm" (that's the
+default and is very well commented).
+ You can then add an entry in the X wm menu or in GNOME menu or any other
+menu an entry to avoid typing such a long line.
+
+
+3. How it works?
+
+ When Eterm is started with --report-as-keysyms the special keys (all
+control keys) are passed to the program as escape sequences. X uses some
+codes called keysyms to identify the keys, these values are defined by the X
+consortium and includes all the keys known in UNIX consoles. The values are
+16 bits, the last 256 values (0xFFxx) are reserved for control keys. When
+Eterm receives one of these keys instead of translating it to a control key
+and then emit the corresponding escape sequence just informs the keysym to
+the application with the following sequence: \e[knn;xx~
+Where: \e is the ESC code (0x1B), nn are the lower 8 bits of the modifier
+keys (state of alt, shift, etc.) and xx the lower 8 bits of the keysym. Note
+that if nn and xx can be just one digit and are encoded in hexadecimal.
+ Why only the keysyms over 0xFF00? simple the keysyms under it are just
+letters, they include symbols from many alphabets (cyrilic, hebrew, japanese,
+etc.) but not control keys like arrows.
+ This mode can be also enabled/disabled sending some special escape
+sequences to Eterm, I don't remmember right now what Eterm extension number I
+used right now so look in the Eterm's manual (I taked the first available).
+ How the application knows that is running in a terminal with such a
+feature? Simple, TV looks in the term name and only if it is xterm-eterm-tv
+enables these things. The terminal name is defined in the Eterm theme and
+that's why you need to install the terminal description file.
+
+
+4. Final comments
+
+ I added it because I really wanted to see the editor working well under X.
+Even when I usually don't use the editor under X is nice to see it working as
+well.
+ I want feadback from this feature, what do you think about it? is too hard
+to setup? what are the steps in your Linux? etc.
+
+
+Enjoy, SET
diff --git a/setedit/cfgfiles/eterm/xterm-eterm-tv b/setedit/cfgfiles/eterm/xterm-eterm-tv
new file mode 100644
index 0000000..1e2a812
--- /dev/null
+++ b/setedit/cfgfiles/eterm/xterm-eterm-tv
@@ -0,0 +1,35 @@
+# Reconstructed via infocmp from file: /etc/terminfo/x/xterm-debian
+xterm-eterm-tv|Eterm description for Turbo Vision programs,
+ am, bce, km, mc5i, mir, msgr, xenl,
+ colors#8, cols#80, it#8, lines#24, pairs#64,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
+ clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
+ csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+ cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
+ cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+ cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K,
+ enacs=\E(B\E)0, flash=\E[?5h\E[?5l, home=\E[H,
+ hpa=\E[%i%p1%dG, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L,
+ ind=^J, is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,
+ ka1=\EOw, ka3=\EOu, kb2=\EOy, kbeg=\EOE, kbs=\177, kc1=\EOq,
+ kc3=\EOs, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+ kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+ kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
+ kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+ kfnd=\E[1~, khome=\EOH, kich1=\E[2~, kmous=\E[M, knp=\E[6~,
+ kpp=\E[5~, kslt=\E[4~, mc0=\E[i, mc4=\E[4i, mc5=\E[5i,
+ op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
+ rmam=\E[?7l, rmcup=\E[?1047l\E[?1048l, rmir=\E[4l,
+ rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+ rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, sc=\E7,
+ setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+ setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
+ setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
+ sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
+ sgr0=\E[m\017, smacs=^N, smam=\E[?7h,
+ smcup=\E[?1048h\E[?1047h, smir=\E[4h, smkx=\E[?1h\E=,
+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd,
diff --git a/setedit/cfgfiles/examples.slp b/setedit/cfgfiles/examples.slp
new file mode 100644
index 0000000..9bbb1d7
--- /dev/null
+++ b/setedit/cfgfiles/examples.slp
@@ -0,0 +1,77 @@
+; Copyright 1996,1997,1998,1999,2000 by Salvador E. Tropea [SET],
+; see copyrigh file for details
+;
+; This file contains some small examples of how to write sLisp macros.
+; To test any of these macros just copy/paste the macro in the macros.slp
+; file and restart the editor, then go to Macro|Choose menu option and
+; select the macro you want to test.
+;
+
+(defmacro 'Delete last char'
+ (SendCommands cmcLineEnd cmcBackSpace cmcLineStart cmcLineDown)
+)
+
+(defmacro 'Simple new line'
+ (InsertText CR)
+)
+
+(defmacro 'Testing 1 2 3 ;-)'
+ (eval
+ (SendCommands cmcLineEnd)
+ (InsertText (+ 'Hi!' CR 'How are you?'))
+ (SendCommands cmcLineUp cmcLineEnd)
+ )
+)
+
+(defmacro 'Recorded macro'
+ (eval
+ (SendCommands cmcWordRight cmcWordRight
+ cmcSelectOn cmcWordRight cmcSelectOff
+ cmcCopy cmcLineEnd cmcNewLine cmcPaste)
+ )
+)
+
+(defmacro 'Insert new line, no move'
+ (eval
+ (InsertText CR)
+ (SendCommands cmcLineUp cmcLineEnd)
+ )
+)
+
+;
+; Note: See how I can add a number to a string. In this case the integer is
+; converted to a string first and then concatenated.
+;
+(defmacro 'Test'
+ (eval
+ (setv "testVar" (+ "Hola" 1))
+ (InsertText (left testVar 2))
+ (InsertText "\n")
+ (InsertText (right testVar 2))
+ (InsertText "\n")
+ (InsertText (substr testVar 1 2))
+ (InsertText "\n")
+ (sstr testVar 3 (gstr testVar 0))
+ (InsertText testVar)
+ (InsertText "\n")
+ )
+)
+
+(defmacro 'Chooser'
+ (eval
+ (ShowInStatusLine (ComplChoose "first\nsecond\nthird\nlast" "\n"))
+ )
+)
+
+(defmacro 'Test getenv'
+ (eval
+ (ShowInStatusLine (+ "DJGPP directory is: " (getenv "DJDIR")))
+ )
+)
+
+; Nasty example, it calls another editor ;-)))
+(defmacro 'Test strxlt'
+ (eval
+ (RunProgram (strxlt (+ "edit " (WhichEditor)) "/" "\\") 1)
+ )
+)
diff --git a/setedit/cfgfiles/htmlmac.pmc b/setedit/cfgfiles/htmlmac.pmc
new file mode 100644
index 0000000..201cb86
--- /dev/null
+++ b/setedit/cfgfiles/htmlmac.pmc
@@ -0,0 +1,70 @@
+; Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+;
+; Some simple HTML macros.
+;
+
+Trigger: "<b"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Bold
+ "<b>@0</b>@1"
+
+Trigger: "<i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Italic
+ "<i>@0</i>@1"
+
+Trigger: "<u"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Underline
+ "<u>@0</u>@1"
+
+Trigger: "<c"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Centre
+ "<center>@0</center>@1"
+
+Trigger: "<a"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Link
+ "<a href=\"@0\">@1</a>@2"
+
+Trigger: "<m"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Image
+ "<img src=\"@0\">@1"
+
+Trigger: "<t"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Table
+ "<table>\n"
+ "<tr>@0</tr>\n"
+ "</table>@1"
+
+Trigger: "me"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Meta tag
+ "<meta name=\"@0\" content=\"@1\">"
+
+Trigger: "<!"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Comment
+ "<!-- @0 -->@1"
+
+Trigger: "ma"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Squeleton
+ "<HTML><head>\n"
+ "<title>@0</title>\n"
+ "</head>\n"
+ "<body>\n"
+ "@1\n"
+ "</body>\n"
+ "</HTML>\n"
+
+Trigger: "<f"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Font
+ "<font @0>@1</font>"
+
diff --git a/setedit/cfgfiles/macros.slp b/setedit/cfgfiles/macros.slp
new file mode 100644
index 0000000..0a93a30
--- /dev/null
+++ b/setedit/cfgfiles/macros.slp
@@ -0,0 +1,546 @@
+; Copyright 1996-2005 by Salvador E. Tropea [SET],
+; see copyrigh file for details
+;
+;;;
+;;; Here are 3 macros converted from TEML to sLisp
+;;;
+;******************************************************************
+;
+; MACRO: MakeFuncText: Sample macro to comment a function
+;
+; USE: Put the cursor immediately after a function name which is
+; at the left of the screen, then press Alt-T. Do not include
+; the return type or parameters before using this macro.
+;
+;******************************************************************
+
+(defmacro 'Make Function Text'
+ (eval
+ ; add white space
+ (InsertText '\n\n')
+ ; go before beginning of intended function name
+ (SendCommands cmcLineUp cmcLineUp cmcLineStart
+ ; mark function name
+ cmcSelectOn cmcWordRight cmcSelectOff)
+ ; copy for prototyping
+ (SendCommands cmcLineStart cmcLineDown cmcCopyBlock cmcLineUp cmcLineStart)
+ ; add "Function" to comment area
+ (InsertText '\nFunction: ')
+ ; put in comment lines before and after
+ (SendCommands cmcLineEnd cmcLineUp cmcLineStart)
+ (InsertText '/*****************************************************')
+ (SendCommands cmcLineStart cmcLineDown cmcLineEnd)
+ (InsertText '\n\n')
+ (SendCommands cmcLineStart)
+ (InsertText 'Description:\n')
+ (SendCommands cmcLineStart)
+ (InsertText '*****************************************************/\n')
+ ; go back to end of name
+ (SendCommands cmcLineDown cmcLineEnd)
+ )
+)
+
+;*******************************************************************
+;
+; MACRO: MakeStub
+;
+; DESCRIPTION: Creates a stub, based on a user-entered function name.
+; It assumes the cursor is positioned immediately after the name,
+; and the name is at the left of the screen.
+;
+;*******************************************************************
+
+(defmacro 'Make Stub'
+ (eval
+ ; go before beginning of intended function name
+ (SendCommands cmcLineStart)
+ ; void return type
+ (InsertText "void ")
+ (SendCommands cmcLineEnd)
+ ; void parameter
+ (InsertText "( void )\n{\n")
+ (InsertText "printf(\"This is ")
+ (SendCommands cmcLineUp cmcLineUp cmcLineStart cmcWordRight)
+ (SendCommands cmcSelectOn cmcWordRight cmcCharLeft cmcCharLeft cmcSelectOff)
+ (SendCommands cmcLineDown cmcLineDown cmcLineEnd)
+ (InsertText " ")
+ (SendCommands cmcCopyBlock cmcHideSelect cmcLineEnd)
+ (InsertText "\\n\");")
+ (InsertText "\n}")
+ )
+)
+
+;*******************************************************************
+;
+; MACRO: MainCIO
+;
+; DESCRIPTION: Inserts outline of main program for C that uses STDIO.H
+;
+;*******************************************************************/
+
+(defmacro 'Main C STDIO'
+ (eval
+ (InsertText "#include <stdio.h>\n\n")
+ (InsertText "int main(void)\n{\n\n return 0;\n")
+ (SendCommands cmcLineStart)
+ (InsertText "}")
+ (SendCommands cmcLineUp cmcLineUp cmcCharRight)
+ )
+)
+
+;*******************************************************************
+;
+; MACRO: Test RunProgam
+;
+; DESCRIPTION: Example of how to call an external program, in this
+; example the editor will call ls and put the directory list in the
+; Message Window.
+;
+;*******************************************************************/
+
+(defmacro 'Test RunProgram'
+ (eval
+ (InsertText
+ (RunProgramRedir
+ (AskString "The output of the program will be inserted" "External program")
+ )
+ )
+ )
+)
+
+;*******************************************************************
+;
+; MACRO: Test RunProgam Filter
+;
+; DESCRIPTION: Example of how to use an external filter program, it
+; takes the current selection, sends it to an external program (using
+; the shell input redirection) and collects the output of the
+; program. Finally the selected text is replaced by the output of
+; the filter.
+;
+;*******************************************************************/
+
+(defmacro 'Test RunProgram Filter'
+ (eval
+ (setv "input" (GetSelection))
+ (if (length input)
+ ; Call the filter
+ (eval
+ (setv "program" (AskString "The output of the filter will replace the selection" "External filter"))
+ (if (length program)
+ (eval
+ (setv "output" (RunProgramRedir program input))
+ (if (length output)
+ (eval
+ (SendCommands cmcCut)
+ (InsertText output 1)
+ )
+ ; Inform we didn't get text
+ (MessageBox "No output from the filter")
+ )
+ )
+ ; Ask the user to enter something
+ (MessageBox "Please enter the filter to use")
+ )
+ )
+ ; Ask the user to select something firt
+ (MessageBox "Please select a text first")
+ )
+ )
+)
+
+;*******************************************************************
+;
+; MACRO: Word Count
+;
+; DESCRIPTION: Example to show how to execute an external tool and
+; parse the output using regex.
+;
+;*******************************************************************/
+
+(defmacro 'Word Count'
+ (eval
+ (setv "input" (GetSelection))
+ (if (length input)
+ (eval
+ (setv "output" (RunProgramRedir "wc" input))
+ (if (length output)
+ (eval
+ (if (prex output "\\s*(\\d+)\\s*(\\d+)\\s*(\\d+)")
+ (ShowInStatusLine (+ "Lines: " _1 " Words: " _2 " Characters: " _3))
+ )
+ )
+ ; Inform we didn't get text
+ (MessageBox "No output from wc")
+ )
+ )
+ ; Ask the user to select something firt
+ (MessageBox "Please select a text first")
+ )
+ )
+)
+
+;*******************************************************************
+;
+; Macro to search and replace in all opened windows.
+;
+;*******************************************************************
+
+(defmacro 'S&R all opened'
+ (eval
+ ; Memorize the current window
+ (setv "curWin" (GetCurWindowNumber))
+ ; Search & Replace in window 2
+ (SelectWindowNumber 2)
+ (SendCommands cmcPushCursorPos cmcTextStart cmcReplace cmcPopCursorPos)
+ ; Repeat the search in the others
+ (setv "n" 3)
+ (loop
+ (if (not (SelectWindowNumber n)) (exitloop))
+ (SendCommands cmcPushCursorPos cmcTextStart cmcSearchAgain cmcPopCursorPos)
+ (setv "n" (+ n 1))
+ )
+ ; Restore the original window
+ (SelectWindowNumber curWin)
+ 1
+ )
+)
+
+;*******************************************************************
+;
+; Macro to search and replace in all project items.
+;
+;*******************************************************************
+
+(defmacro 'S&R all project'
+ (eval
+ ; Memorize the current window
+ (setv "curWin" (GetCurWindowNumber))
+ (setv "maxPrj" (GetMaxProjectItem))
+ (setv "firstWin" 1)
+ (setv "n" 0)
+ (loop
+ (if (== n maxPrj) (exitloop))
+ (setv "opened" (OpenFile (GetProjectItem n) 1))
+ (if (or (== opened 1) (== opened 2))
+ (if (== firstWin 1)
+ (eval
+ (setv "firstWin" 0)
+ (SendCommands cmcPushCursorPos cmcTextStart cmcReplace cmcPopCursorPos)
+ )
+ (SendCommands cmcPushCursorPos cmcTextStart cmcSearchAgain cmcPopCursorPos)
+ )
+ )
+ (if (== opened 1)
+ (CloseWindowNumber (GetCurWindowNumber))
+ )
+ (setv "n" (+ n 1))
+ )
+ ; Restore the original window
+ (SelectWindowNumber curWin)
+ 1
+ )
+)
+
+;*******************************************************************
+;
+; These macro were created by Rolf Campbell (Endlisnis)
+; email: s257m@unb.ca Endlisnis@hotmail.com
+; and uses an external program provided by him.
+;
+; MACRO: Prototype
+;
+; DESCRIPTION: Look ups the function under the cursor to report the
+; prototype, even when partially typed.
+;
+; http://www.geocities.com/CollegePark/Quad/1974/LEMUR02.ZIP
+; As Lemur is currently unavailable I commented these macros.
+;
+;*******************************************************************/
+
+; (defmacro 'List Members'
+; (eval
+; (RunProgram (+ "lemur " (WhichEditor) " -s " (WordUnderCursor 256 1)))
+; (SendCommands cmcGoEndOfWord)
+; )
+; )
+;
+; (defmacro 'Prototype'
+; (eval
+; (ShowInStatusLine
+; (RunProgramRedir
+; (+ "lemur " (WhichEditor) " " (WordUnderCursor 256 1))
+; )
+; )
+; )
+; )
+;
+; (defmacro 'Prototype Complete'
+; (eval
+; (setv "proto"
+; (RunProgramRedir
+; (+ "lemur " (WhichEditor) " -c " (WordUnderCursor 256 1))
+; )
+; )
+; (SendCommands cmcGoEndOfWord)
+; (InsertText (+ proto "(") 1)
+; (ShowInStatusLine (+ "Added: " proto))
+; )
+; )
+
+;*******************************************************************
+;
+; These examples were contributed by Thiago F.G. Albuquerque
+; <tfga@terra.com.br>.
+; I added them commented to save memory, you can uncoment them
+; using the "Indent uncommenting" editor command found in Tool&Ops|
+; Un/Indent block menu.
+;
+;*******************************************************************
+
+(defmacro 'DuplicateLineOrSelection'
+ (if (SelectionExists) (InsertText (GetSelection))
+
+ (progn ; else
+ (SendCommands cmcPushCursorPos cmcLineStart cmcSelectOn cmcLineEnd
+ cmcSelectOff)
+ (= "temp" (GetSelection))
+ (SendCommands cmcLineEnd)
+ (InsertText (+ "\n" temp))
+ (SendCommands cmcPopCursorPos cmcLineDown)
+ )
+ )
+)
+
+(defmacro 'EvalSelection_Print'
+ (InsertText (+ "\n" (EvalString (GetSelection))))
+)
+
+(defmacro 'EvalSelection_StatusLine'
+ (ShowInStatusLine (EvalString (GetSelection)))
+)
+
+; (defmacro 'EvalSelection_MessageWindow'
+; (eval
+; (ShowInMessageWindow "Return value:" 1)
+; (ShowInMessageWindow (EvalString (GetSelection)))
+; )
+; )
+;
+;
+; This example shows how to choose a compiler according to the file type.
+;
+; (defmacro 'Compile'
+; (progn
+; (setv "name" (WhichEditor edfWENameNoExt)) ; name without extension
+; (setv "ext" (WhichEditor edfWEExtension)) ; extension
+;
+; (cond (== (GetSyntaxLang) 'C/C++') (RunProgram (+ "make obj/" (WhichEditor edfWENameNoExt) ".o"))
+; (== (GetSyntaxLang) 'Perl') (RunProgram (+ "perl -cw " name ext) 0 'Perl')
+; (== (GetSyntaxLang) 'PHP') (RunProgram (+ "php -l " name ext) 0 'PHP')
+; (== (GetSyntaxLang) 'TeX') (RunProgram (+ "latex \'\\scrollmode\\input\' " name ext))
+; )
+; )
+; )
+;
+; (defmacro 'Make'
+; (eval
+; (RunProgram "make")
+; )
+; )
+;
+; If you are editing a file named "stuff.cpp",
+; this macro takes you to "stuff.h" and vice-versa.
+; (OpenFile) checks first if the file is already open,
+; in which case it just switches to the right window.
+;
+; (defmacro 'Switch-cpp-h'
+; (eval
+; (setv "name" (WhichEditor edfWENameNoExt)) ; name without extension
+; (setv "ext" (WhichEditor edfWEExtension)) ; extension
+; (cond (not (strcmp ext ".cpp")) (OpenFile (+ name ".h"))
+; (not (strcmp ext ".h")) (OpenFile (+ name ".cpp"))
+; )
+; )
+; )
+;
+; This is an implementation of pseudo-macros in sLisp.
+; Assign to Ctrl-Space.
+;
+; (defmacro 'pmacro'
+; (progn
+; (SendCommands cmcSelectOn cmcCharLeft cmcCharLeft cmcSelectOff)
+; (setv "str" (GetSelection))
+; (SendCommands cmcClear)
+; (cond (not (strcmp str "#I")) (progn (InsertText '#include ".h"')
+; (SendCommands cmcCharLeft cmcCharLeft cmcCharLeft)
+; )
+;
+; (not (strcmp str "#i")) (progn (InsertText '#include <.h>')
+; (SendCommands cmcCharLeft cmcCharLeft cmcCharLeft)
+; )
+;
+; (not (strcmp str "#d")) (InsertText '#define ')
+;
+; (not (strcmp str "pr")) (progn (InsertText 'printf("");')
+; (SendCommands cmcCharLeft cmcCharLeft cmcCharLeft)
+; )
+;
+; (not (strcmp str "re")) (progn (InsertText 'return ;')
+; (SendCommands cmcCharLeft)
+; )
+;
+; (not (strcmp str "{}")) (progn (InsertText "{}")
+; (SendCommands cmcCharLeft cmcNewLine cmcNewLine cmcLineUp)
+; (InsertText " ")
+; )
+;
+; (not (strcmp str "//")) (progn (InsertText "///////////////////////////////////////////////////////////////////////////")
+; (SendCommands cmcNewLine)
+; )
+;
+; (not (strcmp str "/*")) (progn (InsertText "/****************************************************************************")
+; (SendCommands cmcNewLine cmcNewLine)
+; (InsertText "*****************************************************************************/")
+; (SendCommands cmcNewLine cmcLineUp cmcLineUp)
+; )
+;
+; (not (strcmp str "in")) (progn (InsertText "#ifndef \n")
+; (InsertText "#define \n")
+; (InsertText "\n")
+; (InsertText "#endif")
+; (SendCommands cmcLineUp cmcLineUp cmcLineUp cmcLineEnd)
+; )
+;
+; (not (strcmp str ".h")) (progn
+; (setv "filename" (+ (WhichEditor edfWENameNoExt) "_h_____"))
+; (InsertText (+ "#ifndef " filename "\n"))
+; (InsertText (+ "#define " filename "\n"))
+; (InsertText "\n")
+; (InsertText "#endif")
+; )
+;
+; (not (strcmp str "fo")) (progn (InsertText "for (int i=0; i<; i++)")
+; (SendCommands cmcNewLine)
+; (InsertText "{}")
+; (SendCommands cmcCharLeft cmcNewLine cmcNewLine cmcLineUp)
+; (InsertText " ")
+; )
+;
+; (not (strcmp str "ma")) (progn (InsertText "int main(int argc, char *argv[])\n")
+; (InsertText "{\n")
+; (InsertText "\n")
+; (InsertText " return 0;\n")
+; (InsertText "}")
+; (SendCommands cmcLineUp cmcLineUp
+; cmcCharRight cmcCharRight cmcCharRight)
+; )
+;
+; (not (strcmp str "cl")) (progn (InsertText "class\n")
+; (InsertText "{\n")
+; (InsertText " public:\n")
+; (InsertText " // Data\n")
+; (InsertText " \n")
+; (InsertText " // Construction\n")
+; (InsertText " \n")
+; (InsertText " // Methods\n")
+; (InsertText " \n")
+; (InsertText " // Operators\n")
+; (InsertText "};")
+; (SendCommands cmcLineUp cmcLineUp cmcLineUp cmcLineUp cmcLineUp cmcLineUp cmcLineUp cmcLineUp cmcLineUp cmcLineUp
+; cmcLineEnd cmcCharRight)
+; )
+;
+; 1 (InsertText str)
+; )
+; )
+; )
+;
+; I assigned this to TAB and then I assigned cmcUnIndentBlk to Shift-Tab.
+;
+; (defmacro 'IndentLineOrBlock'
+; (if (SelectionExists)
+; (SendCommands cmcIndentBlk)
+; (InsertText " ")
+; )
+; )
+;
+; (defmacro 'Test_Loop'
+; (eval
+; (setv "i" 0)
+; (loop
+; (InsertText (tostr i))
+; (if (== i 5) (exitloop))
+; (setv "i" (++ i))
+; )
+; )
+; )
+;
+;-------------------------------------------------------------------------------------------
+;
+; More macros from Thiago, they are short and funny so I let them uncommented.
+;
+;-------------------------------------------------------------------------------------------
+; These 2 macros make cmcIndentBlk and cmcUnIndentBlk behave like
+; cmcCommentIndent and cmcCommentUnIndent, i.e.: if there's no selection,
+; indent/unindent the current line.
+
+(defmacro 'IndentLineOrSelection'
+ (if (SelectionExists) (SendCommands cmcIndentBlk)
+ (SendCommands cmcPushCursorPos
+ cmcLineStart cmcSelectOn cmcLineEnd cmcSelectOff
+ cmcIndentBlk
+ cmcPopCursorPos )
+ )
+)
+
+(defmacro 'UnIndentLineOrSelection'
+ (if (SelectionExists) (SendCommands cmcUnIndentBlk)
+ (SendCommands cmcPushCursorPos
+ cmcLineStart cmcSelectOn cmcLineEnd cmcSelectOff
+ cmcUnIndentBlk
+ cmcPopCursorPos )
+ )
+)
+
+;-------------------------------------------------------------------------------------------
+; ^Ins and no selection -> copy current word
+
+(defmacro 'CopySelectionOrCurWord'
+ (if (SelectionExists) (SendCommands cmcCopy)
+ (SendCommands cmcMarkWord cmcCopy)
+ )
+)
+
+;-------------------------------------------------------------------------------------------
+; Select the entire text
+
+(defmacro 'SelectAll'
+ (SendCommands cmcTextStart cmcSelectOn cmcTextEnd cmcSelectOff)
+)
+
+;-------------------------------------------------------------------------------------------
+; New (and simpler) version of CopyLine: uses cmcMarkLine now
+
+(defmacro 'CopyLine'
+ (SendCommands cmcMarkLine
+ cmcCopy
+ )
+)
+
+; CommentIndent uses the current syntax highlight to get the comment string
+; (e.g.: "//" for C++, "#" for Perl, etc.). If the current file has no syntax
+; highlight, it does nothing. In that case, you have to call ArbitraryIndent
+; and provide the comment string yourself. This macro makes this automatic.
+
+(defmacro 'CommentIndent'
+ (progn
+ (if (not (SelectionExists)) (SendCommands cmcMarkLine))
+
+ (if (== (GetSyntaxLang) '' ) (SendCommands cmcArbitraryIndent)
+ (SendCommands cmcCommentIndent)
+ )
+ )
+)
+
+
diff --git a/setedit/cfgfiles/menubind.smn b/setedit/cfgfiles/menubind.smn
new file mode 100644
index 0000000..4cbecd0
--- /dev/null
+++ b/setedit/cfgfiles/menubind.smn
@@ -0,0 +1,801 @@
+# Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+#
+# That's the menu definition for the editor.
+#
+# SubMenu: "Name", Key [,Context]
+# Creates a submenu, for example one of the pull-down or a menu inside another.
+# Context is hcNoContext by default.
+#
+# MenuItem: "Name", Command[, Key [, Context [,"KeyName"]]]
+# Creates an entry in a menu.
+# Context is hcNoContext by default.
+# Key is kbUnknown by default.
+#
+# MenuItemC: "Name", Command[, Key [,"KeyName"]]
+# Like MenuItem but Context is equal to Command.
+#
+# MenuSeparator
+# Adds a separator
+#
+# EndSubMenu
+# Ends a submenu
+#
+# The context help system is currently designed to use the same context value
+# as the command so you must normally use MenuItemC.
+# The context is used to bring help about the menu options.
+#
+# The file supports some primitive conditionals, you can use $ifdef and
+# $ifndef.
+#
+
+# AC ILNOPQST X
+# DOS/Win32: D UV
+# UNIX: DH U
+SubMenu: "~F~ile", kbAlF
+ MenuItemC: "~O~pen...", cmeOpen, kbF3, "F3"
+ MenuItemC: "~N~ew", cmeNew
+ MenuItemC: "Open Read-only ~c~opy", cmeOpenROCopy
+ MenuItemC: "~S~ave", cmcSave, kbF2, "F2"
+ MenuItemC: "S~a~ve as...", cmcSaveAs, kbUnknown
+ $if DOS or WIN32
+ MenuItemC: "Save as ~U~NIX...", cmcSaveAsConvertEOL
+ MenuItemC: "Save as ~D~OS...", cmcSaveAsNoConvertEOL
+ $else
+ MenuItemC: "Sa~v~e as DOS...", cmcSaveAsConvertEOL
+ MenuItemC: "Save as ~U~NIX...", cmcSaveAsNoConvertEOL
+ $endif
+ MenuItemC: "Save w/ same ~t~ime...", cmcSaveSameTime
+ MenuItemC: "Save a~l~l", cmeSaveAll
+ MenuSeparator
+ MenuItemC: "~P~rint", cmePrintEditor
+ MenuItemC: "Pr~i~nt Setup...", cmeSetUpPrinter
+ MenuSeparator
+ $if DOS or WIN32
+ MenuItemC: "~D~OS shell", cmeDosShell
+ $else
+ MenuItemC: "S~h~ell", cmeDosShell
+ $endif
+ MenuItemC: "~Q~uit", cmeQuitDelete, kbAlQ, "Alt+Q"
+ MenuItemC: "E~x~it", cmeQuit, kbAlX, "Alt+X"
+EndSubMenu
+
+# ABCDEFGHILMNOPRSTUWX
+SubMenu: "~E~dit", kbAlE
+ MenuItemC: "~U~ndo", cmcUndo, kbAlBackSpace, "Alt+BackSpace"
+ MenuItemC: "~R~edo", cmcRedo
+ MenuSeparator
+ MenuItemC: "Cu~t~", cmcCut, kbShDelete, "Shift+Del"
+ MenuItemC: "~C~opy", cmcCopy, kbCtInsert, "Ctrl+Ins"
+ MenuItemC: "~P~aste", cmcPaste, kbShInsert, "Shift+Ins"
+ MenuItemC: "~S~how clipboard", cmeShowClip
+ MenuItemC: "C~l~ear", cmcClear, kbCtDelete, "Ctrl+Del"
+ MenuSeparator
+ MenuItemC: "S~e~t Local options", cmcSetLocalOptions, kbAlL, "Alt+L"
+ MenuItemC: "Set ~G~lobal options", cmcSetGlobalOptions, kbAlG, "Alt+G"
+ MenuSeparator
+ MenuItemC: "E~x~pand all tabs", cmcExpandAllTabs
+ MenuItemC: "C~o~mpact text", cmcCompactBuffer
+ $if DOS or WIN32
+ MenuItemC: "Copy to ~W~indows Clip.", cmcCopyOSClip
+ MenuItemC: "Paste ~f~rom Wind. Clip.", cmcPasteOSClip
+ $else
+ MenuItemC: "Copy to OS Clipboar~d~", cmcCopyOSClip
+ MenuItemC: "Paste from OS Clip~b~oard", cmcPasteOSClip
+ MenuItemC: "Cop~y~ to file Clipboard", cmcCopyClipFile
+ MenuItemC: "Paste ~f~rom file Clipboard", cmcPasteClipFile
+ $endif
+ SubMenu: "~M~acro", kbAlM
+ MenuItemC: "~R~ecord", cmcRecordMacro, kbShF10, "Shift+F10"
+ MenuItemC: "~S~top", cmcStopMacro, kbAlF10, "Alt+F10"
+ MenuItemC: "~P~lay", cmcPlayMacro, kbCtF10, "Ctrl+F10"
+ EndSubMenu
+ MenuItemC: "Pus~h~ cursor position", cmcPushCursorPos
+ MenuItemC: "Pop cursor pos~i~tion", cmcPopCursorPos
+ SubMenu: "C~a~se (upper/lower)", kbAlA
+ MenuItemC: "Block to ~u~pper", cmcToUpper
+ MenuItemC: "Block to ~l~ower", cmcToLower
+ MenuItemC: "~C~haracter toggle", cmcToggleCharCase
+ MenuItemC: "Block ~i~nvert", cmcInvertCase
+ MenuItemC: "Block ~a~lternate", cmcAltCase
+ EndSubMenu
+ MenuItemC: "Insert ~n~ew line (don't move)", cmcInsertNewLine, kbCtN, "Ctrl+N"
+EndSubMenu
+
+# English: ABCEFGJHILNOPRSTUW
+# Spanish: ABCDEHILMNOPRSTUVY
+SubMenu: "~S~earch", kbAlS
+ MenuItemC: "~F~ind...", cmcFind, kbUnknown, "Ctrl+Q-F"
+ MenuItemC: "~R~eplace...", cmcReplace, kbUnknown, "Ctrl+Q-A"
+ MenuItemC: "~S~earch again", cmcSearchAgain, kbUnknown, "Ctrl+L"
+ MenuSeparator
+ MenuItemC: "S~e~arch selection forward", cmcSearchSelForward, kbShF8, "Shift+F8"
+ MenuItemC: "Search selection ~b~ackward", cmcSearchSelBackward, kbShF7, "Shift+F7"
+ MenuItemC: "Replace in ~a~ll opened...", cm(S&R all opened)
+ MenuItemC: "Replace in all project ~i~tems...", cm(S&R all project)
+ MenuSeparator
+ MenuItemC: "~N~ame current function", cmcWhichFunctionIs
+ MenuItemC: "~J~ump to function", cmcJumpToFunction, kbAlF2, "Alt+F2"
+ MenuItemC: "Jump to ~p~rototype", cmcJumpToPrototype
+ MenuItemC: "Jump ~t~o symbol", cmeSearchTag, kbCtF2, "Ctrl+F2"
+ MenuItemC: "~G~o to line", cmcGotoEditorLine, kbUnknown, "Ctrl+J"
+ MenuItemC: "~C~lass browser", cmeClassBrowser
+ MenuItemC: "~W~ord completion", cmeWordCompletion, kbCtTab, "Ctrl+Tab"
+ MenuItemC: "Jump to ~l~ast cursor position", cmcJumpLastCursorPos, kbUnknown, "Ctrl+Q-P"
+ MenuItemC: "Jump to last ~u~ndo position", cmcLastPosCur
+ MenuItemC: "Pus~h~ cursor position and window", cmeGPushCursorPos
+ MenuItemC: "P~o~p cursor position and window (tag ret)", cmeGPopCursorPos
+EndSubMenu
+
+# CEGMNOPRSU
+SubMenu: "~M~acro", kbAlM
+ MenuItemC: "~R~ecord", cmcRecordMacro, kbShF10, "Shift+F10"
+ MenuItemC: "~S~top", cmcStopMacro, kbAlF10, "Alt+F10"
+ MenuItemC: "~P~lay", cmcPlayMacro, kbCtF10, "Ctrl+F10"
+ MenuSeparator
+ MenuItemC: "~C~hoose...", cmcChooseMacro
+ MenuItemC: "R~e~peat", cmcRepeatMacro, kbShF3, "Shift+F3"
+ MenuItemC: "~G~enerate Code", cmcGenCodeForMacro
+ MenuItemC: "Ru~n~ selected code", cmcRunSel_sLisp
+ MenuItemC: "Enter c~o~de to run", cmcRunEnter_sLisp
+ MenuSeparator
+ MenuItemC: "Pse~u~do macros...", cmcChoosePMacrosList
+EndSubMenu
+
+SubMenu: "Re~c~tangle", kbAlR
+ MenuItemC: "~S~tart", cmcSelRectStart, kbUnknown, "Ctrl+K-Shift+B"
+ MenuItemC: "~E~nd", cmcSelRectEnd, kbUnknown, "Ctrl+K-Shift+K"
+ MenuItemC: "~H~ide", cmcSelRectHide, kbUnknown, "Ctrl+K-Shift+H"
+ MenuSeparator
+ MenuItemC: "~C~opy", cmcSelRectCopy, kbUnknown, "Ctrl+K-Shift+C"
+ MenuItemC: "~P~aste", cmcSelRectPaste, kbUnknown, "Ctrl+K-Shift+P"
+ MenuItemC: "Cu~t~", cmcSelRectCut, kbUnknown, "Ctrl+K-Shift+T"
+ MenuItemC: "C~l~ear", cmcSelRectDel, kbUnknown, "Ctrl+K-Shift+L"
+ MenuItemC: "~M~ove", cmcSelRectMove, kbUnknown, "Ctrl+K-Shift+M"
+ MenuSeparator
+ MenuItemC: "To ~u~pper", cmcSelRectToUpper, kbUnknown
+ MenuItemC: "To l~o~wer", cmcSelRectToLower, kbUnknown
+EndSubMenu
+
+# English: ACDEGJLMNPRSTUWZ0123456789
+# Spanish: ABCDEILMNOPRSUVZ0123456789
+SubMenu: "~W~indows", kbAlW
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~T~ile", cmeTile
+ MenuItemC: "C~a~scade", cmeCascade
+ MenuItemC: "~N~ext", cmeNext, kbF6, "F6"
+ MenuItemC: "~P~revious", cmePrev, kbShF6, "Shift+F6"
+ MenuItemC: "~C~lose", cmeClose, kbAlF3, "Alt+F3"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "~U~ser Screen", cmeUserScreen, kbAlF5, "Alt+F5"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+ MenuItemC: "~M~essage Window", cmeSelWinMessage
+ MenuItemC: "Debu~g~ger Window", cmeSelDebugWin
+ MenuItemC: "~W~atches Window", cmeSelWatchesWin
+ SubMenu: "~E~dition Windows", kbAlE
+ MenuItemC: "Window ~2~", cmeSelWindow2, kbAl2, "Alt+2"
+ MenuItemC: "Window ~3~", cmeSelWindow3, kbAl3, "Alt+3"
+ MenuItemC: "Window ~4~", cmeSelWindow4, kbAl4, "Alt+4"
+ MenuItemC: "Window ~5~", cmeSelWindow5, kbAl5, "Alt+5"
+ MenuItemC: "Window ~6~", cmeSelWindow6, kbAl6, "Alt+6"
+ MenuItemC: "Window ~7~", cmeSelWindow7, kbAl7, "Alt+7"
+ MenuItemC: "Window ~8~", cmeSelWindow8, kbAl8, "Alt+8"
+ MenuItemC: "Window ~9~", cmeSelWindow9, kbAl9, "Alt+9"
+ MenuItemC: "Window 10", cmeSelWindow10
+ MenuItemC: "Window 11", cmeSelWindow11
+ MenuItemC: "Window 12", cmeSelWindow12
+ MenuItemC: "Window 13", cmeSelWindow13
+ MenuItemC: "Window 14", cmeSelWindow14
+ MenuItemC: "Window 15", cmeSelWindow15
+ MenuItemC: "Window 16", cmeSelWindow16
+ MenuItemC: "Window 17", cmeSelWindow17
+ MenuItemC: "Window 18", cmeSelWindow18
+ MenuItemC: "Window 19", cmeSelWindow19
+ EndSubMenu
+ MenuSeparator
+ MenuItemC: "Sc~r~oll Up", cmcScrollUp, kbCtZ, "Ctrl+Z"
+ MenuItemC: "Scroll ~D~own", cmcScrollDown, kbCtW, "Ctrl+W"
+EndSubMenu
+
+# ABCDEFGHIKLMNOPRSXW
+SubMenu: "~T~ool&Ops", kbAlT
+ SubMenu: "~O~ptions", kbUnknown
+# ABCDEFGHIKLMNOPRSTU
+ SubMenu: "~C~olors", kbAlC
+ MenuItemC: "~C~ustomize...", cmeSetColors
+ $if DOS or Linux
+ MenuItemC: "~P~alette...", cmeEditPalette
+ $endif
+ MenuItemC: "~T~heme...", cmeColorTheme
+ EndSubMenu
+ MenuItemC: "~L~ocal edition...", cmcSetLocalOptions, kbAlL, "Alt+L"
+ MenuItemC: "Glo~b~al edition...", cmcSetGlobalOptions, kbAlG, "Alt+G"
+ MenuItemC: "Editor ~G~eneral...", cmeEdGralOptions
+ MenuItemC: "Checking for ~m~odified files...", cmeSetModiCkOps
+ MenuItemC: "Scr~e~en saver...", cmeScreenSaverOpts
+ MenuItemC: "S~D~G Options...", cmeSDGDialog
+ MenuItemC: "~R~un program (which one)...", cmeConfRunCommand
+ SubMenu: "~K~eyboard", kbAlK
+ MenuItemC: "~K~ey assignment", cmeEditKeyBind
+ MenuItemC: "~S~etup Alt keys", cmeSetUpAltKeys
+ MenuItemC: "~B~ack to defaults", cmeKbBackDefault
+ MenuItemC: "~C~onsult scan codes", cmeSeeScanCodes
+ $ifdef DOS
+ MenuItemC: "Key ~p~ad behavior", cmeKeyPadBehavior
+ $endif
+ EndSubMenu
+ MenuItemC: "~S~creen Options...", cmeSetScreenOps
+ MenuItemC: "Encod~i~ngs...", cmeEncodings
+ MenuItemC: "Fon~t~s...", cmeFonts
+ MenuItemC: "~U~ser words...", cmeEditUserWords
+ MenuItemC: "De~f~ault global edition...", cmeEditDeflOpts
+ MenuItemC: "File ~o~pen dialog...", cmeFileOpenOptions
+ MenuItemC: "Do~n~'t create backups for...", cmeEditNoBkp
+ MenuItemC: "Searc~h~ files under cursor in...", cmeIncludeList
+ SubMenu: "T~a~g files", kbAlA
+ MenuItemC: "~L~ist of tag files...", cmeTagFiles
+ MenuItemC: "~O~ptions...", cmeTagsOps
+ MenuItemC: "~R~egenerate central file", cmeTagsAutoRegen
+ EndSubMenu
+ $if CALENDAR
+ MenuItemC: "Calendar (holida~y~s)...", cmeHolidaysConf
+ $endif
+ MenuItemC: "Advice dialogs...", cmeAdviceDiagConf
+ EndSubMenu
+ $if CALCULATOR
+ MenuItemC: "~C~alculator", cmeCalculator, kbAlF4, "Alt+F4"
+ MenuItemC: "Poc~k~et calculator", cmePocketCalc
+ $endif
+ MenuItemC: "~S~DG", cmeSDG, kbF9, "F9"
+ MenuItemC: "~R~un program", cmeRunCommand, kbCtF9, "Ctrl+F9"
+ MenuItemC: "~G~rep...", cmeGrepDialog, kbShF2, "Shift+F2"
+ MenuItemC: "~A~SCII Chart", cmeASCIIChart
+ $if CALENDAR
+ MenuItemC: "Ca~l~endar", cmeCalendar
+ $endif
+ $if MP3
+ SubMenu: "MP~3~ songs", kbUnknown
+ MenuItemC: "~S~elect a song", cmeMP3Open
+ MenuItemC: "~P~lay selected", cmeMP3Start
+ MenuItemC: "S~t~op selected", cmeMP3Stop
+ MenuItemC: "~C~onvert to WAV", cmeMP3Convert
+ MenuSeparator
+ MenuItemC: "~E~dit/Create list", cmeMP3EditPlayList
+ MenuItemC: "P~l~ay list", cmeMP3PlayList
+ MenuItemC: "St~o~p list", cmeMP3StopList
+ MenuSeparator
+ $if MIXER
+ MenuItemC: "Sound board mi~x~er", cmeBoardMixer
+ $endif
+ EndSubMenu
+ $endif
+ SubMenu: "~H~TML Accents", kbUnknown
+ MenuItemC: "Convert ~a~ccents to tags", cmeHTMLAccents
+ MenuItemC: "Convert ~t~ags to accents", cmeHTMLTag2Accent
+ EndSubMenu
+ MenuItemC: "E~x~port as HTML...", cmeExportAsHTML
+ MenuItemC: "Insert key ~n~ame", cmcInsertKeyName
+ MenuItemC: "Re~m~ap code page...", cmeRemapCodePage
+ MenuItemC: "~P~rofile Editor", cmcProfileEditor
+ MenuItemC: "Paste ~E~macs mode", cmcPasteEmacsMode
+ MenuItemC: "Redra~w~ screen", cmeReDraw
+ MenuItemC: "~B~lock quoted printable decode", cmcQuotedPrintDecode
+ SubMenu: "Un/~I~ndent block", kbUnknown
+# ACNOTU
+ MenuItemC: "Indent ~o~ne space", cmcIndentBlkOne
+ MenuItemC: "Unindent o~n~e character", cmcUnIndentBlkOne
+ MenuItemC: "Indent one ~t~ab/gap", cmcIndentBlk
+ MenuItemC: "~U~nindent one tab/gap", cmcUnIndentBlk
+ MenuItemC: "~C~omment indent", cmcCommentIndent
+ MenuItemC: "Comment unin~d~ent", cmcCommentUnIndent
+ MenuItemC: "~A~rbitrary indent", cmcArbitraryIndent
+ EndSubMenu
+ MenuItemC: "Test of macro from menu", cm(Test RunProgram)
+# Here is an example of how you can to execute a piece of sLisp code.
+#MenuItemC: "Test of macro from menu", cm((ShowInMessageWindow "Hi! ;-)"))
+ MenuItemC: "~D~elete memorized backups", cmeDeleteBkps
+EndSubMenu
+
+SubMenu: "~P~roject", kbAlP
+ MenuItemC: "~O~pen...", cmeOpenPrj
+ MenuItemC: "~C~lose", cmeClosePrj
+ MenuItemC: "~S~ave", cmeSavePrj
+ MenuItemC: "Save ~d~esktop here", cmeSaveDesktop
+ MenuItemC: "E~x~port project", cmeExportPrj
+ MenuItemC: "~I~mport project items", cmeImportPrj
+EndSubMenu
+
+$if DEBUG
+# EN: ABCDEGHIKLMNOPRSTW 3
+# ES: ABCDEILMNOPRSTUVX 3
+SubMenu: "~D~ebug", kbAlD
+ SubMenu: "~O~ptions", kbUnknown
+# EN: AMPS
+# ES: AMPS
+ MenuItemC: "~P~rogram and mode...", cmeDebugOptions
+ MenuItemC: "Path for ~s~ources...", cmeSourceList
+ MenuItemC: "~M~essages displayed...", cmeDbgOptsMsgs
+ MenuItemC: "~A~dvanced...", cmeDbgOptionsAdv
+ EndSubMenu
+ SubMenu: "Go to st~a~te", kbUnknown
+# EN: CR
+# ES: CL
+ MenuItemC: "~C~onnected", cmeDbgGoConnected
+ MenuItemC: "~R~eady to run", cmeDbgGoReadyToRun
+ EndSubMenu
+ MenuItemC: "~B~reakpoint", cmeBreakpoint, kbCtF8, "Ctrl+F8"
+ MenuItemC: "Ed~i~t breakpoints...", cmeDbgEditBreakPts
+ MenuItemC: "Edit watchpoints... ~3~", cmeDbgEditWatchPts
+ MenuSeparator
+ MenuItemC: "~R~un/Continue/Atach", cmeDbgRunContinue, kbShF9, "Shift+F9"
+ MenuItemC: "~S~tep over", cmeDbgStepOver, kbF8, "F8"
+ MenuItemC: "~T~race into", cmeDbgTraceInto, kbF7, "F7"
+ MenuItemC: "~G~o to cursor", cmeDbgGoToCursor, kbF4, "F4"
+ MenuItemC: "~U~ntil return", cmeDbgFinishFun
+ MenuItemC: "Return ~n~ow", cmeDbgReturnNow
+ MenuItemC: "Sto~p~", cmeDbgStop
+ MenuItemC: "Restart (~K~ill)", cmeDbgKill
+ MenuItemC: "Se~l~ect thread...", cmeDbgThreadSel
+ MenuSeparator
+ MenuItemC: "Disasse~m~bler Window...", cmeDbgDisAsmWin
+ MenuItemC: "~E~valuate/Modify...", cmeDbgEvalModify, kbCtF4, "Ctrl+F4"
+ SubMenu: "~W~atch an expression", kbUnknown
+# EN: DNSUW
+# ES: CENPU
+ MenuItemC: "~N~ormal watch...", cmeDbgWatchExpNorm, kbCtF7, "Ctrl+F7"
+ MenuItemC: "~W~ith scope...", cmeDbgWatchExpScp
+ MenuItemC: "~U~sing the Inspector...", cmeDbgInspector, kbCtF6, "Ctrl+F6"
+ MenuItemC: "~D~ata window...", cmeDbgDataWindow
+ MenuItemC: "~S~tack window", cmeDbgStackWindow
+ EndSubMenu
+ MenuItemC: "~C~alling stack", cmeDbgCallStack, kbCtF3, "Ctrl+F3"
+ MenuSeparator
+ SubMenu: "~D~ebug session", kbUnknown
+#EN: DLTU
+#ES: BDES
+ MenuItemC: "De~t~ach", cmeDbgDetach
+ MenuItemC: "Clear deb~u~g elements...", cmeDbgCleanElem
+ MenuItemC: "C~l~ose", cmeDbgCloseSession
+ MenuItemC: "~D~estroy (DANGER!)", cmeDbgEndSession
+ EndSubMenu
+EndSubMenu
+$endif
+
+# ABIMST
+SubMenu: "~H~elp", kbAlH
+ MenuItemC: "~I~NF View", cmeInfView, kbF1, "F1"
+ MenuItemC: "~A~nother InfView", cmeAnotherInfView
+ MenuItemC: "~T~ip of the day", cmeTipOfTheDay
+ SubMenu: "~S~yntax help", kbUnknown
+ MenuItemC: "~O~ptions", cmeSyntaxHelpOps
+ MenuItemC: "~F~iles to search", cmeSyntaxHelpFiles
+ MenuItemC: "~S~earch", cmeSyntaxHelp, kbCtF1, "Ctrl+F1"
+ EndSubMenu
+ MenuItemC: "~M~an page View", cmeManPageView
+ MenuSeparator
+ MenuItemC: "A~b~out", cmeAboutBox
+EndSubMenu
+
+#
+# That's a special menu, it pop-ups when you right click in an editor
+# window. The cursor is first moved to the mouse position and then the
+# menu is displayed.
+#
+SubMenu: "Editor Right Click", kbUnknown
+ MenuItemC: "~S~yntax help", cmeSyntaxHelp, kbCtF1, "Ctrl+F1"
+ MenuItemC: "~F~ind...", cmcFind, kbUnknown, "Ctrl+Q-F"
+ MenuItemC: "~R~eplace...", cmcReplace, kbUnknown, "Ctrl+Q-A"
+ MenuItemC: "~J~ump to function", cmcJumpToFunction, kbAlF2, "Alt+F2"
+ MenuItemC: "Jump to ~p~rototype", cmcJumpToPrototype
+ MenuSeparator
+ MenuItemC: "~C~opy", cmcCopy, kbCtInsert, "Ctrl+Ins"
+ MenuItemC: "~P~aste", cmcPaste, kbShInsert, "Shift+Ins"
+ MenuItemC: "Cu~t~", cmcCut, kbShDelete, "Shift+Del"
+EndSubMenu
+
+#
+# You can define different menues for different contexts.
+# Currently we have a special menu for the Data Window. That's because this
+# window have tons of commands.
+#
+
+NewMenu: hcDataViewer, 0
+
+SubMenu: "~F~ile", kbAlF
+# EN: RWX
+ MenuItemC: "~R~ead block...", cmDWRead, kbCtR, "Ctrl+R"
+ MenuItemC: "~W~rite block...", cmDWWrite, kbCtW, "Ctrl+W"
+ MenuItemC: "E~x~it", cmeQuit, kbAlX, "Alt+X"
+EndSubMenu
+
+SubMenu: "~M~ove", kbAlM
+# EN: ADLOPRSTUW
+ MenuItemC: "~U~p", cmDWUp, kbUp, "Cursor up"
+ MenuItemC: "~D~own", cmDWDown, kbDown, "Cursor down"
+ MenuItemC: "~R~ight", cmDWRight, kbRight, "->"
+ MenuItemC: "~L~eft", cmDWLeft, kbLeft, "<-"
+ MenuItemC: "Page d~o~wn", cmDWPgDn, kbPgDn, "Page Down"
+ MenuItemC: "Page u~p~", cmDWPgUp, kbPgUp, "Page Up"
+ MenuItemC: "Fir~s~t column", cmDWFirstColumn, kbHome, "Home"
+ MenuItemC: "L~a~st column", cmDWLastColumn, kbEnd, "End"
+ MenuItemC: "First ro~w~", cmDWFirstRow, kbCtHome, "Ctrl+Home"
+ MenuItemC: "Las~t~ row", cmDWLastRow, kbCtEnd, "Ctrl+End"
+ MenuItemC: "First addr. ~i~ncrement", cmDWBaseIncrement, kbCtRight, "Ctrl+->"
+ MenuItemC: "~F~irst addr. decrement", cmDWBaseDecrement, kbCtLeft, "Ctrl+<-"
+EndSubMenu
+
+SubMenu: "~A~ddress", kbAlA
+# EN: BFGINPR
+ MenuItemC: "Change ~b~ase address...", cmDWBaseAddress, kbCtB, "Ctrl+B"
+ MenuItemC: "~G~o to new address...", cmDWGotoAddress, kbCtG, "Ctrl+G"
+ MenuItemC: "Follow ~p~ointer", cmDWFollowPointer, kbCtF, "Ctrl+F"
+ MenuItemC: "Follow pointer in ~n~ew window", cmDWFollowPtnNew, kbCtO, "Ctrl+O"
+ MenuItemC: "~R~ecompute address", cmDWRecompute, kbCtH, "Ctrl+H"
+EndSubMenu
+
+SubMenu: "M~o~de", kbAlO
+# EN: ADER
+ MenuItemC: "Toggle ~a~uto follow", cmDWTogAutoF, kbCtA, "Ctrl+A"
+ MenuItemC: "Change ~d~isplay mode", cmDWDispMode, kbCtD, "Ctrl+D"
+ MenuItemC: "Toggle ~e~ndian mode", cmDWTogEndian, kbCtE, "Ctrl+E"
+ MenuItemC: "Change ~r~adix", cmDWRadix, kbCtX, "Ctrl+X"
+EndSubMenu
+
+SubMenu: "~B~lock", kbAlB
+# EN: CFM
+ MenuItemC: "~F~ill...", cmDWFill, kbCtI, "Ctrl+I"
+ MenuItemC: "~C~lear...", cmDWClear, kbCtL, "Ctrl+L"
+ MenuItemC: "~M~ove...", cmDWMove, kbCtM, "Ctrl+M"
+EndSubMenu
+
+SubMenu: "~V~arious", kbAlV
+# EN: LMU
+ MenuItemC: "~L~ess bytes per line", cmDWLessLines, kbMinus, "-"
+ MenuItemC: "~M~ore bytes per line", cmDWMoreLines, kbPlus, "+"
+ MenuItemC: "~U~pdate memory", cmDWUpdateMemory, kbEnter, "Enter"
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+# EN: CGJLNPSWZ
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~N~ext", cmeNext, kbF6, "F6"
+ MenuItemC: "~P~revious", cmePrev, kbShF6, "Shift+F6"
+ MenuItemC: "~C~lose", cmeClose, kbAlF3, "Alt+F3"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+ MenuItemC: "Debu~g~ger Window", cmeSelDebugWin
+ MenuItemC: "~W~atches Window", cmeSelWatchesWin
+EndSubMenu
+
+
+
+#
+# A special menu for the InfView (help system)
+#
+
+NewMenu: hcInfView, 4
+
+SubMenu: "~F~ile", kbAlF
+ MenuItemC: "~O~pen info file...", cmInfOpen, kbCtA, "Ctrl+A"
+ MenuItemC: "E~x~it", cmeQuit, kbAlX, "Alt+X"
+EndSubMenu
+
+# EN: CDFHTW
+SubMenu: "~E~dit", kbAlE
+ MenuItemC: "~C~opy", cmcCopy, kbCtInsert, "Ctrl+Ins"
+ $if DOS or WIN32
+ MenuItemC: "Copy to ~W~indows Clip.", cmcCopyOSClip
+ $else
+ MenuItemC: "Copy to OS Clipboar~d~", cmcCopyOSClip
+ $endif
+ $if DOS
+# It only works for the djgpp's reference
+ MenuItemC: "Copy ~h~eader", cmInfPasteIn, kbCtI, "Ctrl+I"
+ $endif
+ MenuSeparator
+ MenuItemC: "Con~f~iguration dialog...", cmhConfigDia, kbCtF, "Ctrl+F"
+ MenuItemC: "Con~t~rol dialog...", cmInfControl, kbAlF10, "Alt+F10"
+EndSubMenu
+
+SubMenu: "~S~earch", kbAlS
+ MenuItemC: "~F~ind...", cmcFind, kbCtS, "Ctrl+S"
+ MenuItemC: "~S~earch again", cmcSearchAgain, kbCtL, "Ctrl+L"
+ MenuSeparator
+ MenuItemC: "~B~ookmarks...", cmInfBookM, kbCtB, "Ctrl+B"
+ MenuItemC: "List of ~n~odes...", cmInfNodes, kbCtO, "Ctrl+O"
+ MenuItemC: "~G~o to '(file)node'...", cmInfGoto, kbCtG, "Ctrl+G"
+EndSubMenu
+
+# EN: DGJLNPTU
+SubMenu: "~N~avigation", kbAlN
+ MenuItemC: "~L~ast visited topic", cmInfBack, kbAlF1, "Alt+F1"
+ MenuItemC: "~N~ext topic", cmhNext, kbCtN, "Ctrl+N"
+ MenuItemC: "~P~revious topic", cmhPrev, kbCtP, "Ctrl+P"
+ MenuItemC: "Go ~u~p in herarchy", cmhUp, kbCtU, "Ctrl+U"
+ MenuItemC: "Main menu for ~t~his file", cmInfTop, kbCtT, "Ctrl+T"
+ MenuItemC: "Info ~d~irectory", cmInfDir, kbCtD, "Ctrl+D"
+ MenuItemC: "~J~ump to last link", cmInfLastLink, kb0, "0"
+ SubMenu: "~G~o to link number", kbAlG
+ MenuItemC: "Link ~1~", cmInfLink1, kb1, "1"
+ MenuItemC: "Link ~2~", cmInfLink2, kb2, "2"
+ MenuItemC: "Link ~3~", cmInfLink3, kb3, "3"
+ MenuItemC: "Link ~4~", cmInfLink4, kb4, "4"
+ MenuItemC: "Link ~5~", cmInfLink5, kb5, "5"
+ MenuItemC: "Link ~6~", cmInfLink6, kb6, "6"
+ MenuItemC: "Link ~7~", cmInfLink7, kb7, "7"
+ MenuItemC: "Link ~8~", cmInfLink8, kb8, "8"
+ MenuItemC: "Link ~9~", cmInfLink9, kb9, "9"
+ EndSubMenu
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~N~ext", cmeNext, kbF6, "F6"
+ MenuItemC: "~P~revious", cmePrev, kbShF6, "Shift+F6"
+ MenuItemC: "~C~lose", cmeClose, kbAlF3, "Alt+F3"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+EndSubMenu
+
+SubMenu: "~H~elp", kbAlH
+ MenuItemC: "How to use the ~h~elp", cmInfHelp, kbCtH, "Ctrl+H"
+ MenuItemC: "~A~nother InfView", cmeAnotherInfView
+EndSubMenu
+
+#
+# The following is the declaration for the status line of the editor. It
+# contains short cuts. They are context sensitive so they apply to a range
+# of "help contexts".
+#
+# StatusRange: first context, number of contexts
+# Starts a declaration.
+#
+# StatusEntry: Label, Command, Key
+# Declares a short cut.
+#
+# StatusHiddenEntry: Command, Key
+# Declares a short cut that is invisible.
+#
+# EndStatusRange
+# Closes the declaration
+#
+
+#
+# Default short cuts for low range of contexts
+#
+StatusRange: 0, 255
+StatusEntry: "~F2~ Save", cmcSave, kbF2
+StatusEntry: "~F3~ Open", cmeOpen, kbF3
+StatusEntry: "~Alt+F3~ Close", cmeClose, kbAlF3
+StatusEntry: "~F5~ Zoom", cmeZoom, kbF5
+StatusEntry: "~F6~ Next", cmeNext, kbF6
+StatusEntry: "~F10~ Menu", cmMenu, kbF10
+StatusHiddenEntry: cmeResize, kbCtF5
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+StatusHiddenEntry: cmeNextMessage, kbAlF8
+StatusHiddenEntry: cmePrevMessage, kbAlF7
+StatusHiddenEntry: cmeInfView, kbF1
+EndStatusRange
+
+#
+# Find & replace
+#
+StatusRange: hcReplace, 2
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+Ins~ Copy", cmtilCopy, kbCtInsert
+StatusEntry: "~Shift+Ins~ Paste", cmtilPaste, kbShInsert
+EndStatusRange
+
+#
+# InfView short cuts
+#
+StatusRange: hcInfView, 4
+StatusEntry: "~Alt+F1~ Back", cmInfBack, kbAlF1
+StatusEntry: "~Alt+F10~ Control", cmInfControl, kbAlF10
+StatusEntry: "~^H~ Help", cmInfHelp, kbCtH
+$if DOS
+StatusEntry: "~Ctrl+I~ Include", cmInfPasteIn, kbCtI
+$endif
+StatusEntry: "~Ctrl+B~ Bookmark", cmInfBookM, kbCtB
+# Example of cmh* command: (for testing purposes)
+#StatusEntry: "~^D~ Up", cmhUp, kbCtD
+StatusHiddenEntry: cmZoom, kbF5
+EndStatusRange
+
+#
+# List of windows (Alt+0)
+#
+StatusRange: hcListWin, 4
+StatusEntry: "~Del~ Close", cmDelete, kbDelete
+StatusEntry: "~Ins~ Open", cmInsert, kbInsert
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+Del~ Delete File", cmDelFile, kbCtDelete
+EndStatusRange
+
+#
+# Project window
+#
+StatusRange: hcEditorProjectWindow, 4
+StatusEntry: "~Ins~ Insert", cmInsert, kbInsert
+StatusEntry: "~Del~ Delete", cmDelete, kbDelete
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Alt+V~ View mode", cmChangeSort, kbAlV
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+EndStatusRange
+
+#
+# Message window
+#
+StatusRange: hcMessageWindow, 1
+StatusEntry: "~Alt+F7~ Previous", cmePrevMessage, kbAlF7
+StatusEntry: "~Alt+F8~ Next", cmeNextMessage, kbAlF8
+StatusEntry: "~Ctrl+C~ Stop", cmeStopChild, kbCtC
+StatusEntry: "Save As", cmcSaveAs, kbUnknown
+StatusEntry: "~Ctrl+Ins~ Copy", cmcCopy, kbCtInsert
+StatusEntry: "Copy OS clip.", cmcCopyOSClip, kbUnknown
+StatusHiddenEntry: cmZoom, kbF5
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+EndStatusRange
+
+#
+# Calculator
+#
+StatusRange: hcCalculator, 4
+StatusEntry: "~ENTER~ Evaluate", cmEval, kbEnter
+StatusEntry: "~Ctrl+Ins~ Copy", cmtilCopy, kbCtInsert
+StatusEntry: "~Shift+Ins~ Paste", cmtilPaste, kbShInsert
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+EndStatusRange
+
+#
+# Grep window
+#
+StatusRange: hcGrepDialog, 1
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+Ins~ Copy", cmtilCopy, kbCtInsert
+StatusEntry: "~Shift+Ins~ Paste", cmtilPaste, kbShInsert
+StatusEntry: "~Ctrl+C~ Stop", cmeStopChild, kbCtC
+EndStatusRange
+
+#
+# Debug Watches
+#
+StatusRange: hcWatchesWin, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ins~ Add", cmInsert, kbInsert
+StatusEntry: "~Ctrl+A/+~ Add w/scope", cmInsertWScope, kbPlus
+StatusEntry: "~Del~ Delete", cmDelete, kbDelete
+StatusEntry: "~Enter~ Edit", cmEditWatch, kbEnter
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Alt+X", cmeQuit, kbAlX
+StatusHiddenEntry: cmInsertWScope, kbCtA
+EndStatusRange
+
+#
+# Debug Window
+#
+StatusRange: hcDebugMsgWin, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ins~ Send command", cmGDBCommand, kbInsert
+StatusEntry: "Save As", cmcSaveAs, kbUnknown
+StatusEntry: "~Ctrl+Ins~ Copy", cmcCopy, kbCtInsert
+StatusEntry: "Copy OS clip.", cmcCopyOSClip, kbUnknown
+StatusHiddenEntry: cmZoom, kbF5
+EndStatusRange
+
+#
+# Breakpoints window (also Watchpoints)
+#
+StatusRange: hcBkptDialog, 1
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ins~ Add", cmBkAdd, kbInsert
+StatusEntry: "~Del~ Delete", cmBkDel, kbDelete
+StatusEntry: "~+~ Enable", cmBkEnable, kbPlus
+StatusEntry: "~-~ Disable", cmBkDisable, kbMinus
+EndStatusRange
+
+#
+# Inspector windows
+#
+StatusRange: hcInspector, 0
+StatusEntry: "~E/+~ Expand", cmExpand, kbPlus
+StatusEntry: "~C/-~ Collapse", cmCollapse, kbMinus
+StatusEntry: "~ENTER~ Inspect", cmDbgInspect, kbEnter
+StatusEntry: "~^R~ Recycle", cmRecycle, kbCtR
+StatusEntry: "~^M~ Modify", cmModifyIns, kbCtM
+StatusEntry: "~^F~ Format", cmFormatIns, kbCtF
+StatusHiddenEntry: cmeInfView, kbF1
+StatusHiddenEntry: cmClose, kbEsc
+StatusHiddenEntry: cmExpand, kbE
+StatusHiddenEntry: cmCollapse, kbC
+EndStatusRange
+
+#
+# Data Windows
+#
+StatusRange: hcDataViewer, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Ctrl+Y~ Recycle", cmRecycle, kbCtY
+EndStatusRange
+
+#
+# Disassembler Windows
+#
+StatusRange: hcDisassembler, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~ENTER~ Modify register", cmModifyReg, kbEnter
+StatusHiddenEntry: cmClose, kbEsc
+EndStatusRange
+
+#
+# Deafault for the rest
+#
+StatusRange: 0, 0xFFFF
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+EndStatusRange
+
+#
+# Table for the assigned function keys.
+# Note I: I think F11 and F12 should be left for user usage.
+# Note II: Complex combinations (i.e. Shift+Alt+Fx) should be used carefully
+# because they aren't supported by all terminals and because they should be
+# reserved for OS level tasks or Window Manager.
+#
+# F1 Help
+# Ctrl+F1 Syntax help
+# Alt+F1 Last help
+#
+# F2 Save
+# Ctrl+F2 Jump symbol
+# Alt+F2 Jump function
+# Shift+F2 Grep
+#
+# F3 Open
+# Shift+F3 Repeat macro
+# Alt+F3 Close
+# Ctrl+F3 Calling stack (debug)
+#
+# F4 Go to cursor (debug)
+# Alt+F4 Calculator
+# Ctrl+F4 Evaluate/Modify (debug)
+#
+# F5 Zoom
+# Ctrl+F5 Size/Move
+# Alt+F5 User screen
+#
+# F6 Next Window
+# Shift+F6 Previous Window
+# Ctrl+F6 Inspector (debug)
+#
+# F7 Trace into (debug)
+# Ctrl+F7 Normal watch (debug)
+# Alt+F7 Previous message
+# Shift+F7 Search sel backwards
+#
+# F8 Step over (debug)
+# Ctrl+F8 Breakpoint (debug)
+# Alt+F8 Next message
+# Shift+F7 Search sel forward
+#
+# F9 SDG
+# Ctrl+F9 Run program
+# Shift+F9 Run (debug)
+#
+# F10 Menu
+# Shift+F10 Record macro
+# Alt+F10 Stop recording macro | Control dialog when InfView
+# Ctrl+F10 Play recorded macro
+#
+# F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
+# Alone X X X X X X X X X X U U
+# Shift X X X X X X X U U
+# Ctrl X X X X X X X X X X U U
+# Alt X X X X X X X X U U
+
diff --git a/setedit/cfgfiles/perlmac.pmc b/setedit/cfgfiles/perlmac.pmc
new file mode 100644
index 0000000..2c8f452
--- /dev/null
+++ b/setedit/cfgfiles/perlmac.pmc
@@ -0,0 +1,87 @@
+; Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+;
+; Perl macros. As you can see some of these macros are for C users my idea is
+; to make the pseudo macros a tool to handle various languages just
+; remmembering the C shortcuts.
+;
+
+Trigger: "re"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Return
+ "return @0;"
+
+Trigger: "i("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if plus else
+ "if (@0)\n"
+ " {\n"
+ " @1\n"
+ "}\n"
+ "\belse\n"
+ " {\n"
+ " @2\n"
+ "}"
+
+Trigger: "I("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if, no else
+ "if (@0)\n"
+ " {\n"
+ " @1\n"
+ "}"
+
+Trigger: "f("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: For cycle
+ "for (@0; ; )\n"
+ " {\n"
+ " @1\n"
+ "}"
+
+Trigger: "d("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Do {} while
+ "do\n"
+ " {\n"
+ " @1\n"
+ "}\n"
+ "\bwhile (@0);"
+
+Trigger: "w("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: While cycle
+ "while (@0)\n"
+ " {\n"
+ " @1\n"
+ "}"
+
+Trigger: "pr"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Print
+ "print @0;"
+
+Trigger: "#i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Require (include)
+ "require \"@0\";"
+
+Trigger: "#d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Define
+ "#define @0"
+
+Trigger: "/d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: SDG comment short
+"###[txh]####################################################################\n"
+"#\n"
+"# Prototype:\n"
+"# Description: @0\n"
+"# @1\n"
+"# Return: @2\n"
+"# Example:\n"
+"#\n"
+"####################################################################[txi]###\n"
+
diff --git a/setedit/cfgfiles/pmacros.pmc b/setedit/cfgfiles/pmacros.pmc
new file mode 100644
index 0000000..df31cea
--- /dev/null
+++ b/setedit/cfgfiles/pmacros.pmc
@@ -0,0 +1,13 @@
+; Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+;
+; That's the global pmacros file here you can put the pmacros that are
+; independent of the file type.
+; For more details look in the cpamcros.pmc file.
+;
+
+Trigger: "bb"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+"\\b: {@0}"
+
diff --git a/setedit/cfgfiles/redmond.smn b/setedit/cfgfiles/redmond.smn
new file mode 100644
index 0000000..57b205f
--- /dev/null
+++ b/setedit/cfgfiles/redmond.smn
@@ -0,0 +1,740 @@
+# Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# That's an example of a menu file that changes the following commands:
+#
+# Cut = ^X
+# Copy = ^C
+# Paste = ^V
+# Close Window = Ctrl+F4
+# Close Program = Alt+F4
+# Next Window = Ctrl+Tab
+# Previous Window = Shift+Ctrl+Tab
+# Undo = ^Z
+# Redo = ^Y
+#
+# You can figure out why the name of the file ;-)
+#
+# Note: that some of these commands are used by the editor and using this
+# menu they are hided and if you want to use these commands you should
+# reconfigure the keyboard.
+#
+# Note: I don't plan to update this file, that's just an example. This means
+# that new menu commands won't be here. It was created for v0.4.23 pre
+# release. If you really like this configuration you could help me to keep it
+# uptodate, in this case contact me.
+#
+
+SubMenu: "~F~ile", kbAlF
+ MenuItemC: "~O~pen...", cmeOpen, kbF3, "F3"
+ MenuItemC: "~N~ew", cmeNew
+ MenuItemC: "Open Read-only ~c~opy", cmeOpenROCopy
+ MenuItemC: "~S~ave", cmcSave, kbF2, "F2"
+ MenuItemC: "S~a~ve as...", cmcSaveAs, kbUnknown
+ $if DOS or WIN32
+ MenuItemC: "Save as ~U~NIX...", cmcSaveAsConvertEOL
+ MenuItemC: "Save as ~D~OS...", cmcSaveAsNoConvertEOL
+ $else
+ MenuItemC: "Sa~v~e as DOS...", cmcSaveAsConvertEOL
+ MenuItemC: "Save as ~U~NIX...", cmcSaveAsNoConvertEOL
+ $endif
+ MenuItemC: "Save w/ same ~t~ime...", cmcSaveSameTime
+ MenuItemC: "Save a~l~l", cmeSaveAll
+ MenuSeparator
+ MenuItemC: "~P~rint", cmePrintEditor
+ MenuItemC: "Pr~i~nt Setup...", cmeSetUpPrinter
+ MenuSeparator
+ $if DOS or WIN32
+ MenuItemC: "~D~OS shell", cmeDosShell
+ $else
+ MenuItemC: "S~h~ell", cmeDosShell
+ $endif
+ MenuItemC: "~Q~uit", cmeQuitDelete, kbAlQ, "Alt+Q"
+ MenuItemC: "E~x~it", cmeQuit, kbAlF4, "Alt+F4"
+EndSubMenu
+
+SubMenu: "~E~dit", kbAlE
+ MenuItemC: "~U~ndo", cmcUndo, kbCtZ, "Ctrl+Z"
+ MenuItemC: "~R~edo", cmcRedo, kbCtY, "Ctrl+Y"
+ MenuSeparator
+ MenuItemC: "Cu~t~", cmcCut, kbCtX, "Ctrl+X"
+ MenuItemC: "~C~opy", cmcCopy, kbCtC, "Ctrl+C"
+ MenuItemC: "~P~aste", cmcPaste, kbCtV, "Ctrl+V"
+#
+# You can use the following lines to use the Windows clipboard instead of the
+# internal one.
+#
+# MenuItemC: "Cu~t~", cmcCutOSClip, kbCtX, "Ctrl+X"
+# MenuItemC: "~C~opy", cmcCopyOSClip, kbCtC, "Ctrl+C"
+# MenuItemC: "~P~aste", cmcPasteOSClip, kbCtV, "Ctrl+V"
+#
+# And the commands for Linux can be:
+#
+# cmcCopyClipFile and cmcPasteClipFile
+#
+ MenuItemC: "~S~how clipboard", cmeShowClip
+ MenuItemC: "C~l~ear", cmcClear, kbCtDelete, "Ctrl+Del"
+ MenuSeparator
+ MenuItemC: "S~e~t Local options", cmcSetLocalOptions, kbAlL, "Alt+L"
+ MenuItemC: "Set ~G~lobal options", cmcSetGlobalOptions, kbAlG, "Alt+G"
+ MenuSeparator
+ MenuItemC: "E~x~pand all tabs", cmcExpandAllTabs
+ MenuItemC: "C~o~mpact text", cmcCompactBuffer
+ $if DOS or WIN32
+ MenuItemC: "Copy to ~W~indows Clip.", cmcCopyOSClip
+ MenuItemC: "Paste ~f~rom Wind. Clip.", cmcPasteOSClip
+ $else
+ MenuItemC: "Copy to OS Clipboar~d~", cmcCopyOSClip
+ MenuItemC: "Paste from OS Clip~b~oard", cmcPasteOSClip
+ MenuItemC: "Cop~y~ to file Clipboard", cmcCopyClipFile
+ MenuItemC: "Paste ~f~rom file Clipboard", cmcPasteClipFile
+ $endif
+ SubMenu: "~M~acro", kbAlM
+ MenuItemC: "~R~ecord", cmcRecordMacro, kbShF10, "Shift+F10"
+ MenuItemC: "~S~top", cmcStopMacro, kbAlF10, "Alt+F10"
+ MenuItemC: "~P~lay", cmcPlayMacro, kbCtF10, "Ctrl+F10"
+ EndSubMenu
+ MenuItemC: "Pus~h~ cursor position", cmcPushCursorPos
+ MenuItemC: "Pop cursor pos~i~tion", cmcPopCursorPos
+ SubMenu: "C~a~se (upper/lower)", kbAlA
+ MenuItemC: "Block to ~u~pper", cmcToUpper
+ MenuItemC: "Block to ~l~ower", cmcToLower
+ MenuItemC: "~C~haracter toggle", cmcToggleCharCase
+ MenuItemC: "Block ~i~nvert", cmcInvertCase
+ MenuItemC: "Block ~a~lternate", cmcAltCase
+ EndSubMenu
+ MenuItemC: "Insert ~n~ew line (don't move)", cmcInsertNewLine, kbCtN, "Ctrl+N"
+EndSubMenu
+
+SubMenu: "~S~earch", kbAlS
+ MenuItemC: "~F~ind...", cmcFind, kbUnknown, "Ctrl+Q-F"
+ MenuItemC: "~R~eplace...", cmcReplace, kbUnknown, "Ctrl+Q-A"
+ MenuItemC: "~S~earch again", cmcSearchAgain, kbUnknown, "Ctrl+L"
+ MenuSeparator
+ MenuItemC: "S~e~arch selection forward", cmcSearchSelForward, kbShF8, "Shift+F8"
+ MenuItemC: "Search selection ~b~ackward", cmcSearchSelBackward, kbShF7, "Shift+F7"
+ MenuItemC: "Replace in ~a~ll opened...", cm(S&R all opened)
+ MenuItemC: "Replace in all project ~i~tems...", cm(S&R all project)
+ MenuSeparator
+ MenuItemC: "~N~ame current function", cmcWhichFunctionIs
+ MenuItemC: "~J~ump to function", cmcJumpToFunction, kbAlF2, "Alt+F2"
+ MenuItemC: "Jump to ~p~rototype", cmcJumpToPrototype
+ MenuItemC: "Jump ~t~o symbol", cmeSearchTag, kbCtF2, "Ctrl+F2"
+ MenuItemC: "~G~o to line", cmcGotoEditorLine, kbUnknown, "Ctrl+J"
+ MenuItemC: "~C~lass browser", cmeClassBrowser
+ MenuItemC: "~W~ord completion", cmeWordCompletion, kbCtTab, "Ctrl+Tab"
+ MenuItemC: "Jump to ~l~ast cursor position", cmcJumpLastCursorPos, kbUnknown, "Ctrl+Q-P"
+ MenuItemC: "Jump to last ~u~ndo position", cmcLastPosCur
+EndSubMenu
+
+SubMenu: "~M~acro", kbAlM
+ MenuItemC: "~R~ecord", cmcRecordMacro, kbShF10, "Shift+F10"
+ MenuItemC: "~S~top", cmcStopMacro, kbAlF10, "Alt+F10"
+ MenuItemC: "~P~lay", cmcPlayMacro, kbCtF10, "Ctrl+F10"
+ MenuSeparator
+ MenuItemC: "~C~hoose...", cmcChooseMacro
+ MenuItemC: "R~e~peat", cmcRepeatMacro, kbShF3, "Shift+F3"
+ MenuItemC: "~G~enerate Code", cmcGenCodeForMacro
+ MenuItemC: "Ru~n~ selected code", cmcRunSel_sLisp
+ MenuItemC: "Enter c~o~de to run", cmcRunEnter_sLisp
+ MenuSeparator
+ MenuItemC: "Pse~u~do macros...", cmcChoosePMacrosList
+EndSubMenu
+
+SubMenu: "Re~c~tangle", kbAlR
+ MenuItemC: "~S~tart", cmcSelRectStart, kbUnknown, "Ctrl+K-Shift+B"
+ MenuItemC: "~E~nd", cmcSelRectEnd, kbUnknown, "Ctrl+K-Shift+K"
+ MenuItemC: "~H~ide", cmcSelRectHide, kbUnknown, "Ctrl+K-Shift+H"
+ MenuSeparator
+ MenuItemC: "~C~opy", cmcSelRectCopy, kbUnknown, "Ctrl+K-Shift+C"
+ MenuItemC: "~P~aste", cmcSelRectPaste, kbUnknown, "Ctrl+K-Shift+P"
+ MenuItemC: "Cu~t~", cmcSelRectCut, kbUnknown, "Ctrl+K-Shift+T"
+ MenuItemC: "C~l~ear", cmcSelRectDel, kbUnknown, "Ctrl+K-Shift+L"
+ MenuItemC: "~M~ove", cmcSelRectMove, kbUnknown, "Ctrl+K-Shift+M"
+ MenuSeparator
+ MenuItemC: "To ~u~pper", cmcSelRectToUpper, kbUnknown
+ MenuItemC: "To l~o~wer", cmcSelRectToLower, kbUnknown
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~T~ile", cmeTile
+ MenuItemC: "C~a~scade", cmeCascade
+ MenuItemC: "~N~ext", cmeNext, kbCtTab, "Ctrl+Tab"
+ MenuItemC: "~P~revious", cmePrev, kbShCtTab, "Ctrl+Shift+Tab"
+ MenuItemC: "~C~lose", cmeClose, kbCtF4, "Ctrl+F4"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "~U~ser Screen", cmeUserScreen, kbAlF5, "Alt+F5"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+ MenuItemC: "~M~essage Window", cmeSelWinMessage
+ SubMenu: "~E~dition Windows", kbAlE
+ MenuItemC: "Window ~2~", cmeSelWindow2, kbAl2, "Alt+2"
+ MenuItemC: "Window ~3~", cmeSelWindow3, kbAl3, "Alt+3"
+ MenuItemC: "Window ~4~", cmeSelWindow4, kbAl4, "Alt+4"
+ MenuItemC: "Window ~5~", cmeSelWindow5, kbAl5, "Alt+5"
+ MenuItemC: "Window ~6~", cmeSelWindow6, kbAl6, "Alt+6"
+ MenuItemC: "Window ~7~", cmeSelWindow7, kbAl7, "Alt+7"
+ MenuItemC: "Window ~8~", cmeSelWindow8, kbAl8, "Alt+8"
+ MenuItemC: "Window ~9~", cmeSelWindow9, kbAl9, "Alt+9"
+ MenuItemC: "Window 10", cmeSelWindow10
+ MenuItemC: "Window 11", cmeSelWindow11
+ MenuItemC: "Window 12", cmeSelWindow12
+ MenuItemC: "Window 13", cmeSelWindow13
+ MenuItemC: "Window 14", cmeSelWindow14
+ MenuItemC: "Window 15", cmeSelWindow15
+ MenuItemC: "Window 16", cmeSelWindow16
+ MenuItemC: "Window 17", cmeSelWindow17
+ MenuItemC: "Window 18", cmeSelWindow18
+ MenuItemC: "Window 19", cmeSelWindow19
+ EndSubMenu
+ MenuSeparator
+ MenuItemC: "Sc~r~oll Up", cmcScrollUp
+ MenuItemC: "Scroll ~D~own", cmcScrollDown, kbCtW, "Ctrl+W"
+EndSubMenu
+
+SubMenu: "~T~ool&Ops", kbAlT
+ SubMenu: "~O~ptions", kbUnknown
+ SubMenu: "~C~olors", kbAlC
+ MenuItemC: "~C~ustomize...", cmeSetColors
+ $if DOS or Linux
+ MenuItemC: "~P~alette...", cmeEditPalette
+ $endif
+ MenuItemC: "~T~heme...", cmeColorTheme
+ EndSubMenu
+ MenuItemC: "~L~ocal edition...", cmcSetLocalOptions, kbAlL, "Alt+L"
+ MenuItemC: "Glo~b~al edition...", cmcSetGlobalOptions, kbAlG, "Alt+G"
+ MenuItemC: "Editor ~G~eneral...", cmeEdGralOptions
+ MenuItemC: "Checking for ~m~odified files...", cmeSetModiCkOps
+ MenuItemC: "Scr~e~en saver...", cmeScreenSaverOpts
+ MenuItemC: "S~D~G Options...", cmeSDGDialog
+ MenuItemC: "~R~un program (which one)...", cmeConfRunCommand
+ SubMenu: "~K~eyboard", kbAlK
+ MenuItemC: "~K~ey assigment", cmeEditKeyBind
+ MenuItemC: "~S~etup Alt keys", cmeSetUpAltKeys
+ MenuItemC: "~B~ack to defaults", cmeKbBackDefault
+ MenuItemC: "Consult ~s~can codes", cmeSeeScanCodes
+ $ifdef DOS
+ MenuItemC: "Key ~p~ad behavior", cmeKeyPadBehavior
+ $endif
+ EndSubMenu
+ MenuItemC: "~S~creen Options...", cmeSetScreenOps
+ MenuItemC: "Encod~i~ngs...", cmeEncodings
+ MenuItemC: "Fon~t~s...", cmeFonts
+ MenuItemC: "~U~ser words...", cmeEditUserWords
+ MenuItemC: "De~f~ault global edition...", cmeEditDeflOpts
+ MenuItemC: "File ~o~pen dialog...", cmeFileOpenOptions
+ MenuItemC: "Do~n~'t create backups for...", cmeEditNoBkp
+ MenuItemC: "Searc~h~ files under cursor in...", cmeIncludeList
+ SubMenu: "T~a~g files", kbAlA
+ MenuItemC: "~L~ist of tag files...", cmeTagFiles
+ MenuItemC: "~O~ptions...", cmeTagsOps
+ MenuItemC: "~R~egenerate central file", cmeTagsAutoRegen
+ EndSubMenu
+ $if CALENDAR
+ MenuItemC: "Calendar (holida~y~s)...", cmeHolidaysConf
+ $endif
+ MenuItemC: "Advice dialogs...", cmeAdviceDiagConf
+ EndSubMenu
+ $if CALCULATOR
+ MenuItemC: "~C~alculator", cmeCalculator, kbAlF4, "Alt+F4"
+ MenuItemC: "Poc~k~et calculator", cmePocketCalc
+ $endif
+ MenuItemC: "~S~DG", cmeSDG, kbF9, "F9"
+ MenuItemC: "~R~un program", cmeRunCommand, kbCtF9, "Ctrl+F9"
+ MenuItemC: "~G~rep...", cmeGrepDialog, kbShF2, "Shift+F2"
+ MenuItemC: "~A~SCII Chart", cmeASCIIChart
+ $if CALENDAR
+ MenuItemC: "Ca~l~endar", cmeCalendar
+ $endif
+ $if MP3
+ SubMenu: "MP~3~ songs", kbUnknown
+ MenuItemC: "~S~elect a song", cmeMP3Open
+ MenuItemC: "~P~lay selected", cmeMP3Start
+ MenuItemC: "S~t~op selected", cmeMP3Stop
+ MenuItemC: "~C~onvert to WAV", cmeMP3Convert
+ MenuSeparator
+ MenuItemC: "~E~dit/Create list", cmeMP3EditPlayList
+ MenuItemC: "P~l~ay list", cmeMP3PlayList
+ MenuItemC: "St~o~p list", cmeMP3StopList
+ MenuSeparator
+ $if MIXER
+ MenuItemC: "Sound board mi~x~er", cmeBoardMixer
+ $endif
+ EndSubMenu
+ $endif
+ SubMenu: "~H~TML Accents", kbUnknown
+ MenuItemC: "Convert ~a~ccents to tags", cmeHTMLAccents
+ MenuItemC: "Convert ~t~ags to accents", cmeHTMLTag2Accent
+ EndSubMenu
+ MenuItemC: "E~x~port as HTML...", cmeExportAsHTML
+ MenuItemC: "Insert key ~n~ame", cmcInsertKeyName
+ MenuItemC: "Re~m~ap code page...", cmeRemapCodePage
+ MenuItemC: "~P~rofile Editor", cmcProfileEditor
+ MenuItemC: "Paste ~E~macs mode", cmcPasteEmacsMode
+ MenuItemC: "Redra~w~ screen", cmeReDraw
+ MenuItemC: "~B~lock quoted printable decode", cmcQuotedPrintDecode
+ SubMenu: "Un/~I~ndent block", kbUnknown
+ MenuItemC: "Indent ~o~ne space", cmcIndentBlkOne
+ MenuItemC: "Unindent o~n~e character", cmcUnIndentBlkOne
+ MenuItemC: "Indent one ~t~ab/gap", cmcIndentBlk
+ MenuItemC: "~U~nindent one tab/gap", cmcUnIndentBlk
+ MenuItemC: "~C~omment indent", cmcCommentIndent
+ MenuItemC: "Comment unin~d~ent", cmcCommentUnIndent
+ MenuItemC: "~A~rbitrary indent", cmcArbitraryIndent
+ EndSubMenu
+ MenuItemC: "Test of macro from menu", cm(Test RunProgram)
+ MenuItemC: "~D~elete memorized backups", cmeDeleteBkps
+EndSubMenu
+
+SubMenu: "~P~roject", kbAlP
+ MenuItemC: "~O~pen...", cmeOpenPrj
+ MenuItemC: "~C~lose", cmeClosePrj
+ MenuItemC: "~S~ave", cmeSavePrj
+ MenuItemC: "Save ~d~esktop here", cmeSaveDesktop
+ MenuItemC: "E~x~port project", cmeExportPrj
+ MenuItemC: "~I~mport project items", cmeImportPrj
+EndSubMenu
+
+$if DEBUG
+# EN: ABCDEGHIKLMNOPRSTW 3
+# ES: BCDEILMNPRTUVX 12
+SubMenu: "~D~ebug", kbAlD
+ SubMenu: "~O~ptions", kbUnknown
+# EN: AMPS
+# ES: MPS
+ MenuItemC: "~P~rogram and mode...", cmeDebugOptions
+ MenuItemC: "Path for ~s~ources...", cmeSourceList
+ MenuItemC: "~M~essages displayed...", cmeDbgOptsMsgs
+ MenuItemC: "~A~dvanced...", cmeDbgOptionsAdv
+ EndSubMenu
+ SubMenu: "Go to st~a~te", kbUnknown
+# EN: CR
+ MenuItemC: "~C~onnected", cmeDbgGoConnected
+ MenuItemC: "~R~eady to run", cmeDbgGoReadyToRun
+ EndSubMenu
+ MenuItemC: "~B~reakpoint", cmeBreakpoint, kbCtF8, "Ctrl+F8"
+ MenuItemC: "Ed~i~t breakpoints...", cmeDbgEditBreakPts
+ MenuItemC: "Edit watchpoints... ~3~", cmeDbgEditWatchPts
+ MenuSeparator
+ MenuItemC: "~R~un/Continue/Atach", cmeDbgRunContinue, kbShF9, "Shift+F9"
+ MenuItemC: "~S~tep over", cmeDbgStepOver, kbF8, "F8"
+ MenuItemC: "~T~race into", cmeDbgTraceInto, kbF7, "F7"
+ MenuItemC: "~G~o to cursor", cmeDbgGoToCursor, kbF4, "F4"
+ MenuItemC: "~U~ntil return", cmeDbgFinishFun
+ MenuItemC: "Return ~n~ow", cmeDbgReturnNow
+ MenuItemC: "Sto~p~", cmeDbgStop
+ MenuItemC: "Restart (~K~ill)", cmeDbgKill
+ MenuItemC: "Se~l~ect thread...", cmeDbgThreadSel
+ MenuSeparator
+ MenuItemC: "Disasse~m~bler Window...", cmeDbgDisAsmWin
+ MenuItemC: "~E~valuate/Modify...", cmeDbgEvalModify, kbCtF4, "Ctrl+F4"
+ SubMenu: "~W~atch an expression", kbUnknown
+# EN: DNSUW
+ MenuItemC: "~N~ormal watch...", cmeDbgWatchExpNorm, kbCtF7, "Ctrl+F7"
+ MenuItemC: "~W~ith scope...", cmeDbgWatchExpScp
+ MenuItemC: "~U~sing the Inspector...", cmeDbgInspector, kbCtF6, "Ctrl+F6"
+ MenuItemC: "~D~ata window...", cmeDbgDataWindow
+ MenuItemC: "~S~tack window", cmeDbgStackWindow
+ EndSubMenu
+ MenuItemC: "~C~alling stack", cmeDbgCallStack, kbCtF3, "Ctrl+F3"
+ MenuSeparator
+ SubMenu: "~D~ebug session", kbUnknown
+ MenuItemC: "De~t~ach", cmeDbgDetach
+ MenuItemC: "Clear deb~u~g elements...", cmeDbgCleanElem
+ MenuItemC: "C~l~ose", cmeDbgCloseSession
+ MenuItemC: "~D~estroy (DANGER!)", cmeDbgEndSession
+ EndSubMenu
+EndSubMenu
+$endif
+
+SubMenu: "~H~elp", kbAlH
+ MenuItemC: "~I~NF View", cmeInfView, kbF1, "F1"
+ MenuItemC: "~A~nother InfView", cmeAnotherInfView
+ MenuItemC: "~T~ip of the day", cmeTipOfTheDay
+ SubMenu: "~S~yntax help", kbUnknown
+ MenuItemC: "~O~ptions", cmeSyntaxHelpOps
+ MenuItemC: "~F~iles to search", cmeSyntaxHelpFiles
+ MenuItemC: "~S~earch", cmeSyntaxHelp, kbCtF1, "Ctrl+F1"
+ EndSubMenu
+ MenuItemC: "A~b~out", cmeAboutBox
+EndSubMenu
+
+#
+# That's a special menu, it pop-ups when you right click in an editor
+# window. The cursor is first moved to the mouse position and the the
+# menu is displayed.
+#
+SubMenu: "Editor Right Click", kbUnknown
+ MenuItemC: "~S~yntax help", cmeSyntaxHelp, kbCtF1, "Ctrl+F1"
+ MenuItemC: "~F~ind...", cmcFind, kbUnknown, "Ctrl+Q-F"
+ MenuItemC: "~R~eplace...", cmcReplace, kbUnknown, "Ctrl+Q-A"
+ MenuItemC: "~J~ump to function", cmcJumpToFunction, kbAlF2, "Alt+F2"
+ MenuItemC: "Jump to ~p~rototype", cmcJumpToPrototype
+ MenuSeparator
+ MenuItemC: "~C~opy", cmcCopy, kbCtC, "Ctrl+C"
+ MenuItemC: "~P~aste", cmcPaste, kbCtV, "Ctrl+V"
+ MenuItemC: "Cu~t~", cmcCut, kbCtX, "Ctrl+X"
+EndSubMenu
+
+#
+# You can define different menues for different contexts.
+# Currently we have a special menu for the Data Window. That's because this
+# window have tons of commands.
+#
+
+NewMenu: hcDataViewer, 0
+
+SubMenu: "~F~ile", kbAlF
+# EN: RWX
+ MenuItemC: "~R~ead block...", cmDWRead, kbCtR, "Ctrl+R"
+ MenuItemC: "~W~rite block...", cmDWWrite, kbCtW, "Ctrl+W"
+ MenuItemC: "E~x~it", cmeQuit, kbAlX, "Alt+X"
+EndSubMenu
+
+SubMenu: "~M~ove", kbAlM
+# EN: ADLOPRSTUW
+ MenuItemC: "~U~p", cmDWUp, kbUp, "Cursor up"
+ MenuItemC: "~D~own", cmDWDown, kbDown, "Cursor down"
+ MenuItemC: "~R~ight", cmDWRight, kbRight, "->"
+ MenuItemC: "~L~eft", cmDWLeft, kbLeft, "<-"
+ MenuItemC: "Page d~o~wn", cmDWPgDn, kbPgDn, "Page Down"
+ MenuItemC: "Page u~p~", cmDWPgUp, kbPgUp, "Page Up"
+ MenuItemC: "Fir~s~t column", cmDWFirstColumn, kbHome, "Home"
+ MenuItemC: "L~a~st column", cmDWLastColumn, kbEnd, "End"
+ MenuItemC: "First ro~w~", cmDWFirstRow, kbCtHome, "Ctrl+Home"
+ MenuItemC: "Las~t~ row", cmDWLastRow, kbCtEnd, "Ctrl+End"
+ MenuItemC: "First addr. ~i~ncrement", cmDWBaseIncrement, kbCtRight, "Ctrl+->"
+ MenuItemC: "~F~irst addr. decrement", cmDWBaseDecrement, kbCtLeft, "Ctrl+<-"
+EndSubMenu
+
+SubMenu: "~A~ddress", kbAlA
+# EN: BFGINPR
+ MenuItemC: "Change ~b~ase address...", cmDWBaseAddress, kbCtB, "Ctrl+B"
+ MenuItemC: "~G~o to new address...", cmDWGotoAddress, kbCtG, "Ctrl+G"
+ MenuItemC: "Follow ~p~ointer", cmDWFollowPointer, kbCtF, "Ctrl+F"
+ MenuItemC: "Follow pointer in ~n~ew window", cmDWFollowPtnNew, kbCtO, "Ctrl+O"
+ MenuItemC: "~R~ecompute address", cmDWRecompute, kbCtH, "Ctrl+H"
+EndSubMenu
+
+SubMenu: "M~o~de", kbAlO
+# EN: ADER
+ MenuItemC: "Toggle ~a~uto follow", cmDWTogAutoF, kbCtA, "Ctrl+A"
+ MenuItemC: "Change ~d~isplay mode", cmDWDispMode, kbCtD, "Ctrl+D"
+ MenuItemC: "Toggle ~e~ndian mode", cmDWTogEndian, kbCtE, "Ctrl+E"
+ MenuItemC: "Change ~r~adix", cmDWRadix, kbCtX, "Ctrl+X"
+EndSubMenu
+
+SubMenu: "~B~lock", kbAlB
+# EN: CFM
+ MenuItemC: "~F~ill...", cmDWFill, kbCtI, "Ctrl+I"
+ MenuItemC: "~C~lear...", cmDWClear, kbCtL, "Ctrl+L"
+ MenuItemC: "~M~ove...", cmDWMove, kbCtM, "Ctrl+M"
+EndSubMenu
+
+SubMenu: "~V~arious", kbAlV
+# EN: LMU
+ MenuItemC: "~L~ess bytes per line", cmDWLessLines, kbMinus, "-"
+ MenuItemC: "~M~ore bytes per line", cmDWMoreLines, kbPlus, "+"
+ MenuItemC: "~U~pdate memory", cmDWUpdateMemory, kbEnter, "Enter"
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+# EN: CGJLNPSWZ
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~N~ext", cmeNext, kbF6, "F6"
+ MenuItemC: "~P~revious", cmePrev, kbShF6, "Shift+F6"
+ MenuItemC: "~C~lose", cmeClose, kbAlF3, "Alt+F3"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+ MenuItemC: "Debu~g~ger Window", cmeSelDebugWin
+ MenuItemC: "~W~atches Window", cmeSelWatchesWin
+EndSubMenu
+
+
+
+#
+# A special menu for the InfView (help system)
+#
+
+NewMenu: hcInfView, 4
+
+SubMenu: "~F~ile", kbAlF
+ MenuItemC: "~O~pen info file...", cmInfOpen, kbCtA, "Ctrl+A"
+ MenuItemC: "E~x~it", cmeQuit, kbAlX, "Alt+X"
+EndSubMenu
+
+# EN: CDFHTW
+SubMenu: "~E~dit", kbAlE
+ MenuItemC: "~C~opy", cmcCopy, kbCtInsert, "Ctrl+Ins"
+ $if DOS or WIN32
+ MenuItemC: "Copy to ~W~indows Clip.", cmcCopyOSClip
+ $else
+ MenuItemC: "Copy to OS Clipboar~d~", cmcCopyOSClip
+ $endif
+ $if DOS
+# It only works for the djgpp's reference
+ MenuItemC: "Copy ~h~eader", cmInfPasteIn, kbCtI, "Ctrl+I"
+ $endif
+ MenuSeparator
+ MenuItemC: "Con~f~iguration dialog...", cmhConfigDia, kbCtF, "Ctrl+F"
+ MenuItemC: "Con~t~rol dialog...", cmInfControl, kbAlF10, "Alt+F10"
+EndSubMenu
+
+SubMenu: "~S~earch", kbAlS
+ MenuItemC: "~F~ind...", cmcFind, kbCtS, "Ctrl+S"
+ MenuItemC: "~S~earch again", cmcSearchAgain, kbCtL, "Ctrl+L"
+ MenuSeparator
+ MenuItemC: "~B~ookmarks...", cmInfBookM, kbCtB, "Ctrl+B"
+ MenuItemC: "List of ~n~odes...", cmInfNodes, kbCtO, "Ctrl+O"
+ MenuItemC: "~G~o to '(file)node'...", cmInfGoto, kbCtG, "Ctrl+G"
+EndSubMenu
+
+# EN: DGJLNPTU
+SubMenu: "~N~avigation", kbAlN
+ MenuItemC: "~L~ast visited topic", cmInfBack, kbAlF1, "Alt+F1"
+ MenuItemC: "~N~ext topic", cmhNext, kbCtN, "Ctrl+N"
+ MenuItemC: "~P~revious topic", cmhPrev, kbCtP, "Ctrl+P"
+ MenuItemC: "Go ~u~p in herarchy", cmhUp, kbCtU, "Ctrl+U"
+ MenuItemC: "Main menu for ~t~his file", cmInfTop, kbCtT, "Ctrl+T"
+ MenuItemC: "Info ~d~irectory", cmInfDir, kbCtD, "Ctrl+D"
+ MenuItemC: "~J~ump to last link", cmInfLastLink, kb0, "0"
+ SubMenu: "~G~o to link number", kbAlG
+ MenuItemC: "Link ~1~", cmInfLink1, kb1, "1"
+ MenuItemC: "Link ~2~", cmInfLink2, kb2, "2"
+ MenuItemC: "Link ~3~", cmInfLink3, kb3, "3"
+ MenuItemC: "Link ~4~", cmInfLink4, kb4, "4"
+ MenuItemC: "Link ~5~", cmInfLink5, kb5, "5"
+ MenuItemC: "Link ~6~", cmInfLink6, kb6, "6"
+ MenuItemC: "Link ~7~", cmInfLink7, kb7, "7"
+ MenuItemC: "Link ~8~", cmInfLink8, kb8, "8"
+ MenuItemC: "Link ~9~", cmInfLink9, kb9, "9"
+ EndSubMenu
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~N~ext", cmeNext, kbF6, "F6"
+ MenuItemC: "~P~revious", cmePrev, kbShF6, "Shift+F6"
+ MenuItemC: "~C~lose", cmeClose, kbAlF3, "Alt+F3"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+EndSubMenu
+
+SubMenu: "~H~elp", kbAlH
+ MenuItemC: "How to use the ~h~elp", cmInfHelp, kbCtH, "Ctrl+H"
+ MenuItemC: "~A~nother InfView", cmeAnotherInfView
+EndSubMenu
+
+#
+# The following is the declaration for the status line of the editor. It
+# contains short cuts. They are context sensitive so they apply to a range
+# of "help contexts".
+#
+# StatusRange: first context, number of contexts
+# Starts a declaration.
+#
+# StatusEntry: Label, Command, Key
+# Declares a short cut.
+#
+# StatusHiddenEntry: Command, Key
+# Declares a short cut that is invisible.
+#
+# EndStatusRange
+# Closes the declaration
+#
+
+#
+# Default short cuts for low range of contexts
+#
+StatusRange: 0, 255
+StatusEntry: "~F2~ Save", cmcSave, kbF2
+StatusEntry: "~F3~ Open", cmeOpen, kbF3
+StatusEntry: "~Ctrl+F4~ Close", cmeClose, kbCtF4
+StatusEntry: "~F5~ Zoom", cmeZoom, kbF5
+StatusEntry: "~Ctrl+Tab~ Next", cmeNext, kbCtTab
+StatusEntry: "~F10~ Menu", cmMenu, kbF10
+StatusHiddenEntry: cmeResize, kbCtF5
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+StatusHiddenEntry: cmeNextMessage, kbAlF8
+StatusHiddenEntry: cmePrevMessage, kbAlF7
+StatusHiddenEntry: cmeInfView, kbF1
+EndStatusRange
+
+#
+# Find & replace
+#
+StatusRange: hcReplace, 2
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+C~ Copy", cmtilCopy, kbCtC
+StatusEntry: "~Ctrl+V~ Paste", cmtilPaste, kbCtV
+#
+# You can use the following lines to use the Windows clipboard instead of the
+# internal one.
+#
+#StatusEntry: "~Ctrl+C~ Copy", cmtilCopyOS, kbCtC
+#StatusEntry: "~Ctrl+V~ Paste", cmtilPasteOS, kbCtV
+EndStatusRange
+
+#
+# InfView short cuts
+#
+StatusRange: hcInfView, 4
+StatusEntry: "~Alt+F1~ Back", cmInfBack, kbAlF1
+StatusEntry: "~Alt+F10~ Control", cmInfControl, kbAlF10
+StatusEntry: "~^H~ Help", cmInfHelp, kbCtH
+StatusEntry: "~ESC~ Close", cmClose, kbEsc
+StatusEntry: "~Alt+I~ Include", cmInfPasteIn, kbAlI
+StatusEntry: "~Alt+B~ Bookmark", cmInfBookM, kbAlB
+StatusHiddenEntry: cmZoom, kbF5
+EndStatusRange
+
+#
+# List of windows (Alt+0)
+#
+StatusRange: hcListWin, 4
+StatusEntry: "~Del~ Close", cmDelete, kbDelete
+StatusEntry: "~Ins~ Open", cmInsert, kbInsert
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+Del~ Delete File", cmDelFile, kbCtDelete
+EndStatusRange
+
+#
+# Project window
+#
+StatusRange: hcEditorProjectWindow, 4
+StatusEntry: "~Ins~ Insert", cmInsert, kbInsert
+StatusEntry: "~Del~ Delete", cmDelete, kbDelete
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Alt+V~ View mode", cmChangeSort, kbAlV
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+EndStatusRange
+
+#
+# Message window
+#
+StatusRange: hcMessageWindow, 1
+StatusEntry: "~Alt+F7~ Previous", cmePrevMessage, kbAlF7
+StatusEntry: "~Alt+F8~ Next", cmeNextMessage, kbAlF8
+StatusEntry: "~Ctrl+C~ Stop", cmeStopChild, kbCtC
+StatusEntry: "Save As", cmcSaveAs, kbUnknown
+StatusEntry: "~Ctrl+Ins~ Copy", cmcCopy, kbCtInsert
+#StatusEntry: "~Ctrl+Ins~ Copy", cmcCopyOSClip, kbCtInsert
+StatusHiddenEntry: cmZoom, kbF5
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+EndStatusRange
+
+#
+# Calculator
+#
+StatusRange: hcCalculator, 4
+StatusEntry: "~ENTER~ Evaluate", cmEval, kbEnter
+StatusEntry: "~Ctrl+C~ Copy", cmtilCopy, kbCtC
+StatusEntry: "~Ctrl+V~ Paste", cmtilPaste, kbCtV
+#StatusEntry: "~Ctrl+C~ Copy", cmtilCopyOS, kbCtC
+#StatusEntry: "~Ctrl+V~ Paste", cmtilPasteOS, kbCtV
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+EndStatusRange
+
+#
+# Grep window
+#
+StatusRange: hcGrepDialog, 1
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+C~ Copy", cmtilCopy, kbCtC
+StatusEntry: "~Ctrl+V~ Paste", cmtilPaste, kbCtV
+#StatusEntry: "~Ctrl+C~ Copy", cmtilCopyOS, kbCtC
+#StatusEntry: "~Ctrl+V~ Paste", cmtilPasteOS, kbCtV
+StatusEntry: "~Ctrl+C~ Stop", cmeStopChild, kbCtC
+EndStatusRange
+
+#
+# Debug Watches
+#
+StatusRange: hcWatchesWin, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ins~ Add", cmInsert, kbInsert
+StatusEntry: "~Ctrl+A/+~ Add w/scope", cmInsertWScope, kbPlus
+StatusEntry: "~Del~ Delete", cmDelete, kbDelete
+StatusEntry: "~Enter~ Edit", cmEditWatch, kbEnter
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Alt+X", cmeQuit, kbAlX
+StatusHiddenEntry: cmInsertWScope, kbCtA
+EndStatusRange
+
+#
+# Debug Window
+#
+StatusRange: hcDebugMsgWin, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ins~ Send command", cmGDBCommand, kbInsert
+StatusEntry: "Save As", cmcSaveAs, kbUnknown
+StatusEntry: "~Ctrl+Ins~ Copy", cmcCopy, kbCtInsert
+StatusEntry: "Copy OS clip.", cmcCopyOSClip, kbUnknown
+StatusHiddenEntry: cmZoom, kbF5
+EndStatusRange
+
+#
+# Breakpoints window (also Watchpoints)
+#
+StatusRange: hcBkptDialog, 1
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ins~ Add", cmBkAdd, kbInsert
+StatusEntry: "~Del~ Delete", cmBkDel, kbDelete
+StatusEntry: "~+~ Enable", cmBkEnable, kbPlus
+StatusEntry: "~-~ Disable", cmBkDisable, kbMinus
+EndStatusRange
+
+#
+# Inspector windows
+#
+StatusRange: hcInspector, 0
+StatusEntry: "~E/+~ Expand", cmExpand, kbPlus
+StatusEntry: "~C/-~ Collapse", cmCollapse, kbMinus
+StatusEntry: "~ENTER~ Inspect", cmDbgInspect, kbEnter
+StatusEntry: "~^R~ Recycle", cmRecycle, kbCtR
+StatusEntry: "~^M~ Modify", cmModifyIns, kbCtM
+StatusEntry: "~^F~ Format", cmFormatIns, kbCtF
+StatusHiddenEntry: cmeInfView, kbF1
+StatusHiddenEntry: cmClose, kbEsc
+StatusHiddenEntry: cmExpand, kbE
+StatusHiddenEntry: cmCollapse, kbC
+EndStatusRange
+
+#
+# Data Windows
+#
+StatusRange: hcDataViewer, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Ctrl+Y~ Recycle", cmRecycle, kbCtY
+EndStatusRange
+
+#
+# Disassembler Windows
+#
+StatusRange: hcDisassembler, 0
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~ENTER~ Modify register", cmModifyReg, kbEnter
+StatusHiddenEntry: cmClose, kbEsc
+EndStatusRange
+
+#
+# Deafault for the rest
+#
+StatusRange: 0, 0xFFFF
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+EndStatusRange
+
+#
+# Deafault for the rest
+#
+StatusRange: 0, 0xFFFF
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+EndStatusRange
+
diff --git a/setedit/cfgfiles/simple.dst b/setedit/cfgfiles/simple.dst
new file mode 100644
index 0000000..6090866
--- /dev/null
+++ b/setedit/cfgfiles/simple.dst
Binary files differ
diff --git a/setedit/cfgfiles/simple.smn b/setedit/cfgfiles/simple.smn
new file mode 100644
index 0000000..ae7ff5d
--- /dev/null
+++ b/setedit/cfgfiles/simple.smn
@@ -0,0 +1,361 @@
+# Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Simple menu to avoid confusing people with too much options.
+# It also have Wincrap key bindings.
+# Some important options aren't here just because they are hard to
+# understand, I should re-enable it when they have an easier option.
+#
+
+SubMenu: "~F~ile", kbAlF
+ MenuItemC: "~O~pen...", cmeOpen, kbF3, "F3"
+ MenuItemC: "~N~ew", cmeNew
+ MenuItemC: "~S~ave", cmcSave, kbF2, "F2"
+ MenuItemC: "S~a~ve as...", cmcSaveAs, kbUnknown
+ MenuItemC: "Save a~l~l", cmeSaveAll
+ MenuSeparator
+# MenuItemC: "~C~hange dir...", cmeChangeDrct
+ MenuItemC: "E~x~it", cmeQuit, kbAlF4, "Alt+F4"
+EndSubMenu
+
+SubMenu: "~E~dit", kbAlE
+ MenuItemC: "~U~ndo", cmcUndo, kbCtZ, "Ctrl+Z"
+ MenuItemC: "~R~edo", cmcRedo, kbCtY, "Ctrl+Y"
+ MenuSeparator
+ MenuItemC: "Cu~t~", cmcCut, kbCtX, "Ctrl+X"
+ MenuItemC: "~C~opy", cmcCopy, kbCtC, "Ctrl+C"
+ MenuItemC: "~P~aste", cmcPaste, kbCtV, "Ctrl+V"
+ MenuSeparator
+ MenuItemC: "C~l~ear", cmcClear, kbCtDelete, "Ctrl+Del"
+ MenuSeparator
+ MenuItemC: "S~e~t Local options", cmcSetLocalOptions, kbAlL, "Alt+L"
+ MenuItemC: "Set ~G~lobal options", cmcSetGlobalOptions, kbAlG, "Alt+G"
+ MenuSeparator
+ $if DOS or WIN32
+ MenuItemC: "Copy to ~W~indows Clip.", cmcCopyOSClip
+ MenuItemC: "Paste ~f~rom Wind. Clip.", cmcPasteOSClip
+ $else
+ MenuItemC: "Cop~y~ to OS Clipboard", cmcCopyOSClip
+ MenuItemC: "Past~e~ from OS Clipboard", cmcPasteOSClip
+ $endif
+ SubMenu: "Re~c~tangle", kbAlR
+ MenuItemC: "~S~tart", cmcSelRectStart, kbUnknown, "Ctrl+K-Shift+B"
+ MenuItemC: "~E~nd", cmcSelRectEnd, kbUnknown, "Ctrl+K-Shift+K"
+ MenuItemC: "~H~ide", cmcSelRectHide, kbUnknown, "Ctrl+K-Shift+H"
+ MenuSeparator
+ MenuItemC: "~C~opy", cmcSelRectCopy, kbUnknown, "Ctrl+K-Shift+C"
+ MenuItemC: "~P~aste", cmcSelRectPaste, kbUnknown, "Ctrl+K-Shift+P"
+ MenuItemC: "Cu~t~", cmcSelRectCut, kbUnknown, "Ctrl+K-Shift+T"
+ MenuItemC: "C~l~ear", cmcSelRectDel, kbUnknown, "Ctrl+K-Shift+L"
+ MenuItemC: "~M~ove", cmcSelRectMove, kbUnknown, "Ctrl+K-Shift+M"
+ MenuSeparator
+ MenuItemC: "To ~u~pper", cmcSelRectToUpper, kbUnknown
+ MenuItemC: "To l~o~wer", cmcSelRectToLower, kbUnknown
+ EndSubMenu
+EndSubMenu
+
+SubMenu: "~S~earch", kbAlS
+ MenuItemC: "~F~ind...", cmcFind, kbUnknown, "Ctrl+Q-F"
+ MenuItemC: "~R~eplace...", cmcReplace, kbUnknown, "Ctrl+Q-A"
+ MenuItemC: "~S~earch again", cmcSearchAgain, kbUnknown, "Ctrl+L"
+EndSubMenu
+
+SubMenu: "~M~acro", kbAlM
+ MenuItemC: "~R~ecord", cmcRecordMacro, kbShF10, "Shift+F10"
+ MenuItemC: "~S~top", cmcStopMacro, kbAlF10, "Alt+F10"
+ MenuItemC: "~P~lay", cmcPlayMacro, kbCtF10, "Ctrl+F10"
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~T~ile", cmeTile
+ MenuItemC: "C~a~scade", cmeCascade
+ MenuItemC: "~N~ext", cmeNext, kbCtTab, "Ctrl+Tab"
+ MenuItemC: "~P~revious", cmePrev, kbShCtTab, "Ctrl+Shift+Tab"
+ MenuItemC: "~C~lose", cmeClose, kbCtF4, "Ctrl+F4"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+ MenuItemC: "~M~essage Window", cmeSelWinMessage
+ SubMenu: "~E~dition Windows", kbAlE
+ MenuItemC: "Window ~2~", cmeSelWindow2, kbAl2, "Alt+2"
+ MenuItemC: "Window ~3~", cmeSelWindow3, kbAl3, "Alt+3"
+ MenuItemC: "Window ~4~", cmeSelWindow4, kbAl4, "Alt+4"
+ MenuItemC: "Window ~5~", cmeSelWindow5, kbAl5, "Alt+5"
+ MenuItemC: "Window ~6~", cmeSelWindow6, kbAl6, "Alt+6"
+ MenuItemC: "Window ~7~", cmeSelWindow7, kbAl7, "Alt+7"
+ MenuItemC: "Window ~8~", cmeSelWindow8, kbAl8, "Alt+8"
+ MenuItemC: "Window ~9~", cmeSelWindow9, kbAl9, "Alt+9"
+ MenuItemC: "Window 10", cmeSelWindow10
+ MenuItemC: "Window 11", cmeSelWindow11
+ MenuItemC: "Window 12", cmeSelWindow12
+ MenuItemC: "Window 13", cmeSelWindow13
+ MenuItemC: "Window 14", cmeSelWindow14
+ MenuItemC: "Window 15", cmeSelWindow15
+ MenuItemC: "Window 16", cmeSelWindow16
+ MenuItemC: "Window 17", cmeSelWindow17
+ MenuItemC: "Window 18", cmeSelWindow18
+ MenuItemC: "Window 19", cmeSelWindow19
+ EndSubMenu
+ MenuSeparator
+ MenuItemC: "Sc~r~oll Up", cmcScrollUp, kbCtZ, "Ctrl+Z"
+ MenuItemC: "Scroll ~D~own", cmcScrollDown, kbCtW, "Ctrl+W"
+EndSubMenu
+
+SubMenu: "~T~ool&Ops", kbAlT
+ SubMenu: "~O~ptions", kbUnknown
+ SubMenu: "~C~olors", kbAlC
+ MenuItemC: "~C~ustomize...", cmeSetColors
+ MenuItemC: "~T~heme...", cmeColorTheme
+ EndSubMenu
+ MenuItemC: "~L~ocal edition", cmcSetLocalOptions, kbAlL, "Alt+L"
+ MenuItemC: "Glo~b~al edition", cmcSetGlobalOptions, kbAlG, "Alt+G"
+ MenuItemC: "Scr~e~en saver", cmeScreenSaverOpts
+ SubMenu: "~K~eyboard", kbAlK
+ MenuItemC: "~K~ey assigment", cmeEditKeyBind
+ MenuItemC: "~B~ack to defaults", cmeKbBackDefault
+ EndSubMenu
+ MenuItemC: "~S~creen Options", cmeSetScreenOps
+ MenuItemC: "Encod~i~ngs...", cmeEncodings
+ MenuItemC: "Fon~t~s...", cmeFonts
+ $if CALENDAR
+ MenuItemC: "Calendar (holida~y~s)...", cmeHolidaysConf
+ $endif
+ EndSubMenu
+ $if CALCULATOR
+ MenuItemC: "~C~alculator", cmePocketCalc, kbAlF4, "Alt+F4"
+ $endif
+ $if CALENDAR
+ MenuItemC: "Ca~l~endar", cmeCalendar
+ $endif
+ $if MP3
+ SubMenu: "MP~3~ songs", kbUnknown
+ MenuItemC: "~S~elect a song", cmeMP3Open
+ MenuItemC: "~P~lay selected", cmeMP3Start
+ MenuItemC: "S~t~op selected", cmeMP3Stop
+ MenuItemC: "~C~onvert to WAV", cmeMP3Convert
+ MenuSeparator
+ MenuItemC: "~E~dit/Create list", cmeMP3EditPlayList
+ MenuItemC: "P~l~ay list", cmeMP3PlayList
+ MenuItemC: "St~o~p list", cmeMP3StopList
+ MenuSeparator
+ $if MIXER
+ MenuItemC: "Sound board mi~x~er", cmeBoardMixer
+ $endif
+ EndSubMenu
+ $endif
+EndSubMenu
+
+SubMenu: "~P~roject", kbAlP
+ MenuItemC: "~O~pen...", cmeOpenPrj
+ MenuItemC: "~C~lose", cmeClosePrj
+ MenuItemC: "~S~ave", cmeSavePrj
+EndSubMenu
+
+SubMenu: "~H~elp", kbAlH
+ MenuItemC: "~I~NF View", cmeInfView, kbF1, "F1"
+ MenuItemC: "~T~ip of the day", cmeTipOfTheDay
+ MenuItemC: "A~b~out", cmeAboutBox
+EndSubMenu
+
+#
+# That's a special menu, it pop-ups when you right click in an editor
+# window. The cursor is first moved to the mouse position and the the
+# menu is displayed.
+#
+SubMenu: "Editor Right Click", kbUnknown
+ MenuItemC: "~F~ind...", cmcFind, kbUnknown, "Ctrl+Q-F"
+ MenuItemC: "~R~eplace...", cmcReplace, kbUnknown, "Ctrl+Q-A"
+ MenuSeparator
+ MenuItemC: "~C~opy", cmcCopy, kbCtC, "Ctrl+C"
+ MenuItemC: "~P~aste", cmcPaste, kbCtV, "Ctrl+V"
+ MenuItemC: "Cu~t~", cmcCut, kbCtX, "Ctrl+X"
+EndSubMenu
+
+#
+# A special menu for the InfView (help system)
+#
+
+NewMenu: hcInfView, 4
+
+SubMenu: "~F~ile", kbAlF
+ MenuItemC: "~O~pen info file...", cmInfOpen, kbCtA, "Ctrl+A"
+ MenuItemC: "E~x~it", cmeQuit, kbAlX, "Alt+X"
+EndSubMenu
+
+# EN: CDFHTW
+SubMenu: "~E~dit", kbAlE
+ MenuItemC: "~C~opy", cmcCopy, kbCtInsert, "Ctrl+Ins"
+ $if DOS or WIN32
+ MenuItemC: "Copy to ~W~indows Clip.", cmcCopyOSClip
+ $else
+ MenuItemC: "Copy to OS Clipboar~d~", cmcCopyOSClip
+ $endif
+ $if DOS
+# It only works for the djgpp's reference
+ MenuItemC: "Copy ~h~eader", cmInfPasteIn, kbCtI, "Ctrl+I"
+ $endif
+ MenuSeparator
+ MenuItemC: "Con~f~iguration dialog...", cmhConfigDia, kbCtF, "Ctrl+F"
+ MenuItemC: "Con~t~rol dialog...", cmInfControl, kbAlF10, "Alt+F10"
+EndSubMenu
+
+SubMenu: "~S~earch", kbAlS
+ MenuItemC: "~F~ind...", cmcFind, kbCtS, "Ctrl+S"
+ MenuItemC: "~S~earch again", cmcSearchAgain, kbCtL, "Ctrl+L"
+ MenuSeparator
+ MenuItemC: "~B~ookmarks...", cmInfBookM, kbCtB, "Ctrl+B"
+ MenuItemC: "List of ~n~odes...", cmInfNodes, kbCtO, "Ctrl+O"
+ MenuItemC: "~G~o to '(file)node'...", cmInfGoto, kbCtG, "Ctrl+G"
+EndSubMenu
+
+# EN: DGJLNPTU
+SubMenu: "~N~avigation", kbAlN
+ MenuItemC: "~L~ast visited topic", cmInfBack, kbAlF1, "Alt+F1"
+ MenuItemC: "~N~ext topic", cmhNext, kbCtN, "Ctrl+N"
+ MenuItemC: "~P~revious topic", cmhPrev, kbCtP, "Ctrl+P"
+ MenuItemC: "Go ~u~p in herarchy", cmhUp, kbCtU, "Ctrl+U"
+ MenuItemC: "Main menu for ~t~his file", cmInfTop, kbCtT, "Ctrl+T"
+ MenuItemC: "Info ~d~irectory", cmInfDir, kbCtD, "Ctrl+D"
+ MenuItemC: "~J~ump to last link", cmInfLastLink, kb0, "0"
+ SubMenu: "~G~o to link number", kbAlG
+ MenuItemC: "Link ~1~", cmInfLink1, kb1, "1"
+ MenuItemC: "Link ~2~", cmInfLink2, kb2, "2"
+ MenuItemC: "Link ~3~", cmInfLink3, kb3, "3"
+ MenuItemC: "Link ~4~", cmInfLink4, kb4, "4"
+ MenuItemC: "Link ~5~", cmInfLink5, kb5, "5"
+ MenuItemC: "Link ~6~", cmInfLink6, kb6, "6"
+ MenuItemC: "Link ~7~", cmInfLink7, kb7, "7"
+ MenuItemC: "Link ~8~", cmInfLink8, kb8, "8"
+ MenuItemC: "Link ~9~", cmInfLink9, kb9, "9"
+ EndSubMenu
+EndSubMenu
+
+SubMenu: "~W~indows", kbAlW
+ MenuItemC: "~S~ize/move",cmeResize, kbCtF5, "Ctrl+F5"
+ MenuItemC: "~Z~oom", cmeZoom, kbF5, "F5"
+ MenuItemC: "~N~ext", cmeNext, kbF6, "F6"
+ MenuItemC: "~P~revious", cmePrev, kbShF6, "Shift+F6"
+ MenuItemC: "~C~lose", cmeClose, kbAlF3, "Alt+F3"
+ MenuItemC: "~L~ist", cmeListWin, kbAl0, "Alt+0"
+ MenuItemC: "Pro~j~ect Window", cmeSelWinPrj, kbAl1, "Alt+1"
+EndSubMenu
+
+SubMenu: "~H~elp", kbAlH
+ MenuItemC: "How to use the ~h~elp", cmInfHelp, kbCtH, "Ctrl+H"
+ MenuItemC: "~A~nother InfView", cmeAnotherInfView
+EndSubMenu
+
+#
+# The following is the declaration for the status line of the editor. It
+# contains short cuts. They are context sensitive so they apply to a range
+# of "help contexts".
+#
+
+#
+# Default short cuts for low range of contexts
+#
+StatusRange: 0, 255
+StatusEntry: "~F2~ Save", cmcSave, kbF2
+StatusEntry: "~F3~ Open", cmeOpen, kbF3
+StatusEntry: "~Ctrl+F4~ Close", cmeClose, kbCtF4
+StatusEntry: "~F5~ Zoom", cmeZoom, kbF5
+StatusEntry: "~Ctrl+Tab~ Next", cmeNext, kbCtTab
+StatusEntry: "~F10~ Menu", cmMenu, kbF10
+StatusHiddenEntry: cmeResize, kbCtF5
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+StatusHiddenEntry: cmeNextMessage, kbAlF8
+StatusHiddenEntry: cmePrevMessage, kbAlF7
+StatusHiddenEntry: cmeInfView, kbF1
+EndStatusRange
+
+#
+# Find & replace
+#
+StatusRange: hcReplace, 2
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+C~ Copy", cmtilCopy, kbCtC
+StatusEntry: "~Ctrl+V~ Paste", cmtilPaste, kbCtV
+#StatusEntry: "~Ctrl+C~ Copy", cmtilCopyOS, kbCtC
+#StatusEntry: "~Ctrl+V~ Paste", cmtilPasteOS, kbCtV
+EndStatusRange
+
+#
+# InfView short cuts
+#
+StatusRange: hcInfView, 4
+StatusEntry: "~Alt+F1~ Back", cmInfBack, kbAlF1
+StatusEntry: "~Alt+F10~ Control", cmInfControl, kbAlF10
+StatusEntry: "~^H~ Help", cmInfHelp, kbCtH
+StatusEntry: "~ESC~ Close", cmClose, kbEsc
+StatusEntry: "~Alt+I~ Include", cmInfPasteIn, kbAlI
+StatusEntry: "~Alt+B~ Bookmark", cmInfBookM, kbAlB
+StatusHiddenEntry: cmZoom, kbF5
+EndStatusRange
+
+#
+# List of windows (Alt+0)
+#
+StatusRange: hcListWin, 4
+StatusEntry: "~Del~ Close", cmDelete, kbDelete
+StatusEntry: "~Ins~ Open", cmInsert, kbInsert
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+Del~ Delete File", cmDelFile, kbCtDelete
+EndStatusRange
+
+#
+# Project window
+#
+StatusRange: hcEditorProjectWindow, 4
+StatusEntry: "~Ins~ Insert", cmInsert, kbInsert
+StatusEntry: "~Del~ Delete", cmDelete, kbDelete
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+StatusEntry: "~Alt+V~ View mode", cmChangeSort, kbAlV
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+EndStatusRange
+
+#
+# Message window
+#
+StatusRange: hcMessageWindow, 1
+StatusEntry: "~Alt+F7~ Previous", cmePrevMessage, kbAlF7
+StatusEntry: "~Alt+F8~ Next", cmeNextMessage, kbAlF8
+StatusEntry: "~Ctrl+C~ Stop", cmeStopChild, kbCtC
+StatusEntry: "Save As", cmcSaveAs, kbUnknown
+StatusEntry: "~Ctrl+Ins~ Copy", cmcCopy, kbCtInsert
+StatusHiddenEntry: cmZoom, kbF5
+StatusHiddenEntry: cmeLastHelp, kbAlF1
+EndStatusRange
+
+#
+# Calculator
+#
+StatusRange: hcCalculator, 4
+StatusEntry: "~ENTER~ Evaluate", cmEval, kbEnter
+StatusEntry: "~Ctrl+C~ Copy", cmtilCopy, kbCtC
+StatusEntry: "~Ctrl+V~ Paste", cmtilPaste, kbCtV
+#StatusEntry: "~Ctrl+C~ Copy", cmtilCopyOS, kbCtC
+#StatusEntry: "~Ctrl+V~ Paste", cmtilPasteOS, kbCtV
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+EndStatusRange
+
+#
+# Grep window
+#
+StatusRange: hcGrepDialog, 1
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~Ctrl+C~ Copy", cmtilCopy, kbCtC
+StatusEntry: "~Ctrl+V~ Paste", cmtilPaste, kbCtV
+#StatusEntry: "~Ctrl+C~ Copy", cmtilCopyOS, kbCtC
+#StatusEntry: "~Ctrl+V~ Paste", cmtilPasteOS, kbCtV
+StatusEntry: "~Ctrl+C~ Stop", cmeStopChild, kbCtC
+EndStatusRange
+
+#
+# Deafault for the rest
+#
+StatusRange: 0, 0xFFFF
+StatusEntry: "~F1~ Help", cmeInfView, kbF1
+StatusEntry: "~F5~ Zoom", cmZoom, kbF5
+EndStatusRange
+
diff --git a/setedit/cfgfiles/simple.tip b/setedit/cfgfiles/simple.tip
new file mode 100644
index 0000000..98812a3
--- /dev/null
+++ b/setedit/cfgfiles/simple.tip
@@ -0,0 +1,111 @@
+~~~Start
+Hi! that's a tip. You can disable this
+dialog or you can choose to display
+the hints in the message window.
+The hints are showed ones a day to
+avoid annoying you, you can read the
+tips from the Help menu.
+In the dialog: at the right can appear
+one or more links to related topics,
+like the "About the Author" now. Just
+click in the button to go to this help
+topic.
+~~~End
+About the Author
+~~~Start
+When you press tab in the editor it
+normally insert a tab character
+but you can configure the editor to
+insert spaces in your text.
+~~~End
+Real Tabs
+Set Global
+Set Local
+Compact text
+Expand all tabs
+~~~Start
+You can save the default options to
+avoid configuring the editor again and
+again.
+For that just run the editor in the
+directory pointed by the SET_FILES
+environment variable, configure the
+editor and exit with ALT-X.
+If you never defined it the directory
+is the one called share/setedit
+starting from the point where you
+installed the editor.
+~~~End
+~~~Start
+You can reconfigure the keyboard to
+behave like you want. You can assign a
+command, a sequence of commands or a
+macro to any keyboard combination.
+~~~End
+Keyboard configuration
+~~~Start
+You have various features to indent
+your code. You can indent blocks by a
+space, by a tab or using a smart
+algorithm.
+~~~End
+Indentation
+~~~Start
+The editor supports macros. You can
+record the macros typing the sequence
+or write the macro in a language called
+sLisp.
+~~~End
+Macro
+sLisp macros
+~~~Start
+Under Windows GUI you can copy text to
+the clipboard using "Edit|Copy to
+Windows Clip." options. You can paste
+text from the clipboard using
+"Edit|Paste from Wind. Clip.".
+~~~End
+Clipboard
+~~~Start
+You can select a column of text using
+the rectangular blocks feature of the
+editor. Then you can move, copy or
+delete this column of text.
+~~~End
+Rectangular Blocks
+~~~Start
+You can use project files to group
+files that you usually edit together.
+~~~End
+Project
+~~~Start
+You can reconfigure the whole menu just
+editing a text file.
+As you installed the editor with normal
+option (instead of programmer options)
+the menu is smaller and doesn't show
+the advanced features, just replace it
+by the one called default.smn to get
+all the available options.
+~~~End
+Pull-down menus
+~~~Start
+The editor supports fonts and code
+pages. You can use the encoding
+features of the editor to read texts in
+an encoding different than the one used
+by your OS. For example to read Linux
+text under DOS when it have ASCIIs over
+than 127.
+~~~End
+Screen Options
+~~~Start
+The editor contains a powerful
+built-in calculator made by Molnar
+Laszlo. It supports binary, octal,
+decimal and hexadecimal conversions and
+most of the functions of a cientific
+calculator.
+~~~End
+Calculator
+
diff --git a/setedit/cfgfiles/syntaxhl.shl b/setedit/cfgfiles/syntaxhl.shl
new file mode 100644
index 0000000..df2073b
--- /dev/null
+++ b/setedit/cfgfiles/syntaxhl.shl
@@ -0,0 +1,2764 @@
+# Copyright (C) 1996-2007 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Syntax highlight file for SET's editor
+
+# UseInternal values:
+# shlCSyntax=1 shlPascalSyntax=2 shlClipperSyntax=3
+
+# Put the Case switch before the rest!
+
+# ---------------- C/C++ ----------------
+# Here are the definitions for C/C++, but the UseInternal forces to use
+# the built-in routines.
+
+Name=C/C++
+Files=c,cpp,cxx,cc,h,hpp,i,ii,cgz,hh,C,CPP,H,c++,cp
+EmacsModes=C++
+UseInternal=1
+Case=1
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+HexMarker=0x
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+Preprocessor=#
+PMacros=cpmacros.pmc
+# Reverse order
+#NLIndent=,,,,AutoIndent,0
+NLIndent=FirstWord,if,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,do,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,for,NoLastChar,;,AutoIndent,3
+NLIndent=FirstWord,else,,,AutoIndent,2
+NLIndent=FirstWord,case,,,AutoIndent,5
+NLIndent=FirstWord,while,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,break,,,Unindent
+NLIndent=FirstWord,return,,,Unindent
+NLIndent=FirstWord,switch,,,AutoIndent,2
+NLIndent=FirstWord,default,,,AutoIndent,5
+NLIndent=FirstWord,{,,,AutoIndent,1
+NLIndent=FirstWord,},,,Unindent
+NLIndent=ParBalancePos,,,,MoveAfterPar
+NLIndent=ParBalanceNeg,,,,AutoIndent,0
+Preload
+Keywords=asm,auto,bool,break,case,catch,char,class,const,continue,default
+Keywords=delete,do,double,else,enum,except,extern,false,far,finally,float,for
+Keywords=friend,goto,huge,if,inline,int,long,near,new,operator,private
+Keywords=protected,public,register,return,short,signed,sizeof,static,struct
+Keywords=switch,template,this,throw,true,try,typedef,typename,union,unsigned
+Keywords=using,virtual,void,volatile,while,mutable
+End
+
+# ---------------- Pascal ----------------
+Name=Pascal
+Files=pas,inc,p
+EmacsModes=Pascal
+UseInternal=2
+OpenComment1={
+CloseComment1=}
+OpenComment2=(*
+CloseComment2=*)
+HexMarker=$
+Symbols1=*+-./:<=>@#
+Symbols2=()[],;
+String1='
+Keywords=abs,absolute,and,arctan,array,asm,assembler,array,begin,boolean
+Keywords=byte,bytebool,case,char,chr,const,constructor,cos,destructor
+Keywords=dispose,div,do,downto,else,end,eof,eoln,exp,export,exports,external
+Keywords=far,forward,file,for,function,get,goto,if,implementation,in,index
+Keywords=inherited,inline,integer,interface,interrupt,label,library,ln
+Keywords=longbool,longint,mod,near,new,nil,not,object,odd,of,or,ord,ordinal
+Keywords=pack,packed,page,pred,private,pointer,procedure,program,public,put
+Keywords=readln,read,real,record,repeat,reset,resident,rewrite,round,set,shl
+Keywords=shortint,shr,sin,sqrt,string,succ,then,to,trunc,type,unit,unpack
+Keywords=until,uses,var,virtual,while,with,word,wordbool,write,writeln,xor
+End
+
+# ---------------- Modula 2 ----------------
+Name=Modula 2
+Files=mod,def
+OpenComment1=(*
+CloseComment1=*)
+Symbols1=%&()*+,-./:;<=>[]^{|}~
+String1="'
+Keywords=abs,and,array,begin,bitset,boolean,by,cap,cardinal,case,char,chr
+Keywords=const,dec,definition,dispose,div,do,else,elsif,end,excl,exit,export
+Keywords=float,for,from,halt,high,if,implementation,import,incl,inc,integer
+Keywords=in,longcard,longfloat,longint,longord,longreal,longtrunc,long,loop
+Keywords=max,min,module,mod,new,not,odd,of,ord,or,pointer,procedure
+Keywords=qualified,real,record,repeat,return,set,short,size,then,to,trunc
+Keywords=type,until,val,var,while,with
+End
+
+# ---------------- Ada ----------------
+Name=Ada
+Files=adb,ads
+EOLComment1=--
+Symbols1=!&()*+,-./:;<=>?[]^{|}~
+String1="
+String2='
+AllowedInsideNames='
+Keywords=abort,abs,abstract,accept,access,aliased,all,and,array,at,begin
+Keywords=body,case,constant,declare,delay,delta,digits,do,else,elsif,end
+Keywords=entry,exception,exit,for,function,generic,goto,if,in,is,limited
+Keywords=loop,mod,new,not,null,of,or,others,out,package,raise,range,record
+Keywords=rem,renames,requeue,return,reverse,select,separate,subtype,tagged
+Keywords=task,terminate,then,type,until,use,when,while,with,xor
+End
+
+# ---------------- BASIC ----------------
+Name=BASIC
+Files=bas
+EOLComment1=rem
+EOLComment2='
+Symbols1=!()*+-/<=>^#
+String1="
+AllowedInsideNames=$
+Keywords=abs,and,any,as,asc,atn,base,call,case,cdbl,chdir,chr$,cint,circle
+Keywords=clear,clng,close,cls,color,com,const,cos,csng,csrlin,cvdmbf,cvsmbf
+Keywords=data,declare,def,defint,dim,do,else,end,eof,erase,erdev,erdev$,erl
+Keywords=err,error,exit,exp,fileattr,for,fre,freefile,function,get,gosub,goto
+Keywords=hex$,if,inkey$,inp,input,input$,instr,int,integer,key,kill,lcase$
+Keywords=left$,len,line,loc,locate,lock,lof,log,loop,lpos,lprint,lset,ltrim$
+Keywords=mid$,mkdir,name,next,not,oct$,on,open,option,or,out,paint,palette
+Keywords=pcopy,peek,pen,play,pmap,point,poke,pos,preset,print,pset,put
+Keywords=randomize,read,redim,repeat,restore,resume,return,right$,rmdir,rnd
+Keywords=rset,rtrim$,run,screen,seek,seg,select,sgn,shared,shell,sin,space$
+Keywords=spc,sqr,static,step,stop,str$,strig,string$,sub,swap,system,tab,tan
+Keywords=then,time$,timer,to,type,ucase$,unlock,until,using,val,view,wait
+Keywords=width,window,write
+# Remove these keywords if you are using a BASIC that doesn't support it:
+# (they are used by QBasic)
+Keywords=while,string,single,double,long,wend
+End
+
+# ---------------- 4DOS batch files ----------------
+#
+# Slight mods. by Robin Y. Millette <millette@bigfoot.com> noted 'RYM'
+#
+Name=4DOS batch files
+Files=bat,btm
+EOLComment1=rem
+Symbols1=%&(),<=>@[]^|!
+Symbols2=/\:;
+AllowedInsideNames=.*?-
+String1=`
+Escape=
+RelaxNumberCheck=1
+Keywords=alias,attrib,beep,break,by,call,cancel,cd,cdd,chcp,chdir,cls
+Keywords=color,copy,ctty,date,delay,del,describe,dirs,dir,do,drawbox
+Keywords=drawhline,drawvline,,echos,echo,else,elseiff,enddo,endiff,endlocal
+Keywords=erase,errorlevel,eset,except,exist,exit,fc,find,format,for,free
+Keywords=global,gosub,goto,history,iff,if,inkey,input,iterate,keybd,leave
+Keywords=lh,list,loadbtm,loadhigh,log,md,memory,mem,mkdir,mode,more,move
+Keywords=not,on,path,pause,popd,print,prompt,pushd,quit,rd,reboot,rename
+Keywords=ren,replace,return,rmdir,screen,scrput,select,setdos,setlocal
+Keywords=setver,set,shift,sort,start,subst,sys,tee,text,then,timer,time,to
+Keywords=tree,type,unalias,undelete,unset,until,verify,ver,vol,vscrput,while
+Keywords=window,xcopy
+# -- RYM 1999/02/15: added keywords from version 6 [begin] --
+# -- and, or and xor are already above, but I --
+# -- noticed the clipper shl use this notation --
+Keywords=switch,case,default,endswitch,touch,echo.
+Keywords=.and.,.or.,.xor.,eq,ne,lt,le,ge,gt
+Keywords=defined,isalias,isdir,direxist,isinternal,islabel
+CanStartAName=.
+EOLComment2=:
+# -- RYM 1999/02/15: added keywords from version 6 [end] --
+EOLCInFirstCol=1
+End
+
+# ---------------- 80x86 asm (AT&T syntax) ----------------
+Name=80x86 asm (AT&T syntax)
+Files=s,S
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=#
+EOLComment2=//
+HexMarker=0x
+Symbols1=!$%&(),-./:;<>?[]
+String1="
+String2="
+AllowedInsideNames=$.
+CanStartAName=.
+Keywords=aaa,aad,aam,aas,adc,adcb,adcw,adcl,add,addb,addw,addl,and,andb,andw
+Keywords=andl,arpl,bound,bsf,bsr,bswap,bt,btc,btr,bts,lcall,call,cbw,cbtw,cdq
+Keywords=cltd,clc,cld,cli,clts,cmc,cmp,cmpb,cmpw,cmpl,cmps,cmpsb,cmpsw,cmpsl
+Keywords=cmpxchg,cwd,cwtd,cwde,cwtl,daa,das,dec,decb,decw,decl,div,divw,divl
+Keywords=enter,esc,hlt,idiv,idivw,idivl,imul,imulw,imull,in,inb,inw,inl,inc
+Keywords=incb,incw,incl,ins,insb,insw,insl,int,into,invd,invlpg,iret,iretd,ja
+Keywords=jae,jb,jbe,jc,je,jg,jge,jl,jle,jmp,jna,jnae,jnb,jnbe,jnc,jne,jng
+Keywords=jnge,jnl,jnle,jno,jnp,jns,jnz,jo,jp,jpe,jpo,js,jz,jcxz,jecxz,jmp
+Keywords=ljmp,lahf,lar,lds,lea,leaw,leal,leave,les,lfs,lgdt,lidt,lgs,lldt
+Keywords=lmsw,lock,lods,lodsb,lodsw,lodsl,loop,loope,loopz,loopnz,loopne,lsl
+Keywords=lss,ltr,mov,movb,movw,movl,movs,movsb,movsw,movsl,movsx,movsbl
+Keywords=movsbw,movswl,movzx,movzbl,movzbw,movzwl,mul,mulw,mull,neg,negb,negw
+Keywords=negl,nop,not,notb,notw,notl,or,orb,orw,orl,out,outb,outw,outl,outs
+Keywords=outsb,outsw,outsl,pop,popb,popw,popl,popa,popad,popf,popfd,push
+Keywords=pushb,pushw,pushl,pusha,pushad,pushf,pushfd,rcl,rclb,rclw,rcll,rcr
+Keywords=rcrb,rcrw,rcrl,rep,repe,repz,repne,repnz,ret,retf,rol,rolb,rolw,roll
+Keywords=ror,rorb,rorw,rorl,sahf,sal,salb,salw,sall,shl,shlb,shlw,shll,sar
+Keywords=sarb,sarw,sarl,sbb,sbbb,sbbw,sbbl,scas,scasb,scasw,scasl,setae,setnb
+Keywords=setb,setnae,setbe,setna,sete,setz,setne,setnz,setl,setnge,setge
+Keywords=setnl,setle,setng,setg,setnle,sets,setns,setc,setnc,seto,setno,setp
+Keywords=setpe,setnp,setpo,sgdt,sidt,shl,shlb,shlw,shll,shr,shrb,shrw,shrl
+Keywords=shld,shldb,shldw,shldl,shrd,shrdb,shrdw,shrdl,sldt,smsw,stc,std,sti
+Keywords=stos,stosb,stosw,stosl,str,sub,subb,subw,subl,test,testb,testw,testl
+Keywords=verr,verw,wait,fwait,wbinvd,xchg,xchgb,xchgw,xchgl,xlat,xlatb,xor
+Keywords=xorb,xorw,xorl,ax,eax,ah,al,bx,ebx,bh,bl,cx,ecx,ch,cl,dx,edx,dh,dl
+Keywords=si,esi,di,edi,sp,esp,bp,ebp,cs,ds,ss,es,fs,gs
+# GAS specific
+Keywords=.abort,.ABORT,.align,.app-file,.ascii,.asciz,.balign,.byte,.comm
+Keywords=.data,.def,.desc,.dim,.double,.eject,.else,.endef,.endif,.equ
+Keywords=.extern,.file,.fill,.float,.global,.hword,.ident,.if,.include
+Keywords=.int,.irp,.irpc,.lcomm,.lflags,.line,.ln,.linkonce,.list,.long
+Keywords=.macro,.mri,.nolist,.octa,.org,.p2align,.psize,.quad,.rept
+Keywords=.sbttl,.scl,.section,.set,.short,.single,.size,.skip,.space
+Keywords=.stabd,.stabn,.stabs,.string,.tag,.text,.title,.type,.val,.word
+Keywords=.globl
+End
+
+# ---------------- 80x86 asm (Intel syntax) ----------------
+Name=80x86 asm (Intel syntax)
+Files=asm
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=;
+EOLComment2=//
+HexMarker=0x
+Symbols1=!$%&(),-./:<>?[]
+String1='"
+Keywords=aaa,aad,aam,aas,adc,add,and,arpl,bound,bsf,bsr,bswap,bt,btc,btr,bts
+Keywords=byte,call,cbw,cdq,clc,cld,cli,clts,cmc,cmp,cmps,cmpsb,cmpsw,cmpsl
+Keywords=cmpxchg,cwd,cwde,daa,das,dec,div,enter,esc,hlt,idiv,imul,in,inb,inw
+Keywords=inl,inc,ins,insb,insw,insl,int,into,invd,invlpg,iret,ja,jae,jb,jbe
+Keywords=jc,je,jg,jge,jl,jle,jmp,jna,jnae,jnb,jnbe,jnc,jne,jng,jnge,jnl,jnle
+Keywords=jno,jnp,jns,jnz,jo,jp,jpe,jpo,js,jz,jcxz,jecxz,jmp,lahf,lar,lds,lea
+Keywords=leave,les,lfs,lgdt,lidt,lgs,lldt,lmsw,lock,lods,lodsb,lodsw,lodsl
+Keywords=long,loop,loope,loopz,loopnz,loopne,lsl,lss,ltr,mov,movs,movsb,movsw
+Keywords=movsl,movsx,movzx,mul,neg,nop,not,or,out,outb,outw,outl,outs,outsb
+Keywords=outsw,outsl,pop,popa,popad,popf,popfd,ptr,push,pusha,pushad,pushf
+Keywords=pushfd,rcl,rcr,rep,repe,repz,repne,repnz,ret,retf,rol,ror,sahf,sal
+Keywords=shl,sar,sbb,scas,setae,setnb,setb,setnae,setbe,setna,sete,setz,setne
+Keywords=setnz,setl,setnge,setge,setnl,setle,setng,setg,setnle,sets,setns
+Keywords=setc,setnc,seto,setno,setp,setpe,setnp,setpo,sgdt,sidt,shl,shr,shld
+Keywords=shrd,sldt,smsw,stc,std,sti,stos,stosb,stosw,stosl,str,sub,test,verr
+Keywords=verw,wait,fwait,wbinvd,word,xchg,xlat,xlatb,xor,ax,eax,ah,al,bx,ebx
+Keywords=bh,bl,cx,ecx,ch,cl,dx,edx,dh,dl,si,esi,di,edi,sp,esp,bp,ebp,cs,ds,ss
+Keywords=es,fs,gs
+End
+
+# ---------------- Clipper ----------------
+Name=Clipper 5.x
+Files=prg,ch,PRG,CH
+UseInternal=3
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+EOLComment2=&&
+Symbols1=%&()*+,-./:;<=>[]^{|}~@
+String1="'
+Preprocessor=#
+AllowedInsideNames=.
+CanStartAName=.
+PMacros=clippmac.pmc
+NLIndent=FirstWord,for,,,AutoIndent,4
+NLIndent=FirstWord,do,,,AutoIndent,3
+NLIndent=FirstWord,if,,,AutoIndent,3
+NLIndent=FirstWord,else,,,AutoIndent,3
+NLIndent=FirstWord,case,,,AutoIndent,5
+NLIndent=FirstWord,otherwise,,,AutoIndent,5
+NLIndent=ParBalancePos,,,,MoveAfterPar
+NLIndent=ParBalanceNeg,,,,AutoIndent,0
+Keywords=announce,begin,break,call,case,declare,do,else,elseif,endcase,enddo
+Keywords=endif,exit,external,field,for,function,if,iif,in,init,local,loop
+Keywords=memvar,next,otherwise,parameters,private,procedure,public,recover
+Keywords=return,sequence,static,step,text,to,then,using,with,while
+Keywords=.and.,.or.,.not.,.t.,.f.
+End
+
+# ----------- HTML, that's really bad!, sorry ---------------
+Name=HTML
+Files=htm,html,sht,shtml,HTM,HTML
+OpenComment1=<!--
+CloseComment1=-->
+AllowedInsideNames=/!-
+CanStartAName=<
+String1="
+Escape=\
+Symbols1=>=,;{}()[]%
+NoCheckNumbers=1
+PMacros=htmlmac.pmc
+Keywords=break,case,continue,default
+Keywords=do,else,for,goto,if,return,switch,this,while
+Keywords=<a,<script,</script,href,<img,src,<pre,<p,</p,</a,<br,<b,http-equiv
+Keywords=</b,</pre,<xmp,</xmp,<table,</table,<center,</center,<i,</i
+Keywords=<h1,</h1,<h2,</h2,<h3,</h3,<h4,</h4,<h5,</h5,<h6,</h6
+Keywords=<td,</td,<tr,</tr,<li,</li,<menu,</menu,<u,</u,<font,</font,<hr
+Keywords=<title,</title,<html,</html,<head,</head,<meta,width,height,<body,</body
+Keywords=align,valign,<applet,<param,name,value,archive,code,codebase
+Keywords=</applet,alt,ismap,border,face,size,target,cellspacing,hspace,vspace
+Keywords=cellpadding,bgcolor,color,nowrap,center,bottom,left,right,colspan
+Keywords=<form,</form,methode,post,action,<input,type,top,_top,<tt,</tt,class
+Keywords=content,<map,</map,<area,shape,coords,nohref,onclick,onmouseover
+Keywords=rowspan,<blockquote,</blockquote,<em,</em,text,link,vlink,<ul,</ul
+Keywords=<ol,</ol,method,enctype,maxlength,<textarea,rows,cols,</textarea
+Keywords=<dl,</dl,<dt,<option,<select,</select,selected,onUnLoad,<sup,</sup
+Keywords=background,scrolling,noresize,frameborder,onload,alink,language
+Keywords=<div,</div,<frameset,</frameset,<noframes,</noframes,<frame,</frame
+Keywords=<strong,</strong,<dd,<base,<cite,</cite,<code,</code,</option,<nobr
+Keywords=<sub,</sub,<th,</th,<blink,</blink,<noscript,</noscript
+Keywords=style,clear,<link,<style,</style,<col,<colgroup,</colgroup,id
+Keywords=<tbody,</tbody,<thead,</thead,<tfoot,</tfoot,rel,rev,<!doctype,usemap
+End
+
+# ---------------- SDG Format files ----------------
+# These are the format files for the SET's
+# Documentation Generator
+Name=SDG Format
+Files=frt
+EmacsModes=sdg
+EOLComment1=#
+EOLCInFirstCol1=1
+AllowedInsideNames=]@
+CanStartAName=[@(
+String1="
+String2='
+Escape=\
+Case=1
+NoCheckNumbers=1
+Symbols1==,~{}()
+Keywords=[Delimiters],[Variables],[Associations],[Replace],[GenNode]
+Keywords=[GenMenu],[GenAssoMain],[GenAssoRest],[GenMain],[Commands]
+Keywords=[DefinedCommands],[ASCIIConvert],[Configuration]
+Keywords=CommandLine,Name,SectionStart,SectionEnd,AddDefinition
+Keywords=Distinguish,AddAssoc,Constant,EndOfPar,BreakLine,CrossRef,Double@
+Keywords=Start,Entry,End,(if,(cutCprot,(print,SectionSkip,Language
+End
+
+# ---------------- PMacros Files ----------------
+# For the editor's pmacros files.
+#
+Name=PMacros file
+Files=pmc
+EOLComment1=;
+EOLCInFirstCol1=1
+AllowedInsideNames=:
+String1="
+Escape=\
+Case=1
+Symbols1=,
+NoCheckNumbers=1
+Keywords=Trigger:,Mode:,Name:
+End
+
+# ---------------- Syntax Highlight Files ----------------
+# For this file ;-P.
+#
+Name=Syntax Highlight File
+Files=shl
+EOLComment1=#
+EOLCInFirstCol1=1
+Symbols1=,=
+NoCheckNumbers=1
+Keywords=Name,Files,OpenComment1,CloseComment1,OpenComment2,CloseComment2
+Keywords=EOLComment1,EOLComment2,HexMarker,Symbols1,Symbols2,String1,String2
+Keywords=Escape,Preprocessor,Case,UseInternal,Keywords,AllowedInsideNames
+Keywords=CanStartAName,PMacros,End,NoCheckNumbers,EOLCInFirstCol,Preprocessor2
+Keywords=String3,PartialKeywords,ShortString,SpecialSymbol,SpecialSymbolCont
+Keywords=RelaxNumberCheck,EmacsModes,ShellScript,EOLCInFirstCol2,FullNameMatch
+Keywords=EOLCInFirstUse1,EOLCInFirstUse2,EOLCInFirstCol1,NameMatch,NoLastChar
+Keywords=EscapeAnywhere,Preload,NLIndent,ParBalancePos,MoveAfterPar,VHDLStr2
+Keywords=ParBalanceNeg,AutoIndent,FirstWord,Unindent,VHDLNumbers,VHDLStr1
+Keywords=VHDLShortStr,UserKeywords
+End
+
+# ---------------- sLisp Files ----------------
+# For the editor's macros files.
+#
+Name=sLisp macros
+Files=slp
+EOLComment1=;
+String1="
+String2='
+Escape=\
+Case=1
+HexMarker=0x
+Symbols1=()
+Symbols2=+-&|~=!
+NLIndent=ParBalancePos,,,,MoveAfterPar
+NLIndent=ParBalanceNeg,,,,AutoIndent,0
+Keywords=InsertText,SendCommands,SendCommSel,defmacro,eval,CR,RunProgram,not
+Keywords=WhichEditor,GetSelection,left,right,substr,sstr,gstr,setv,strxlt,if
+Keywords=WordUnderCursor,RunProgramRedir,ShowInStatusLine,ComplChoose,getenv
+Keywords=or,and,GetSyntaxAtCursor,ForceUpdate,ShortFileName,AskString,strcmp
+Keywords=strcasecmp,length,strstr,OpenFile,print,MessageBox,progn,EvalString
+Keywords=cond,ShowInMessageWindow,SelectionExists,FindString,loop,GetCursorX
+Keywords=GetCursorY,SetCursorXY,repeat,GetSyntaxLang,FindAgain,ReplaceString
+Keywords=exitloop,ReplaceAgain,BindKey,SelectWindowNumber,GetCurWindowNumber
+Keywords=GetMaxWindowNumber,KeyBindings,prex,GetSystemInfo,GetMaxProjectItem
+Keywords=GetProjectItem,tostr,CloseWindowNumber
+# Flags
+Keywords=edfComInside,edfEndCom,edfEndCom2,edfExtCom,edfExtCom2,edfExtOneLineCom
+Keywords=edfExtPrepro,edfExtString,edfExtString2,edfExtString3,edfInsideCom
+Keywords=edfInsideCom2,edfMBCancelButton,edfMBConfirmation,edfMBError
+Keywords=edfMBInformation,edfMBNoButton,edfMBOKButton,edfMBOKCancel,edfMBWarning
+Keywords=edfMBYesButton,edfMBYesNoCancel,edfPrepro,edfRunNoRedirect,edfRunUserScreen
+Keywords=edfStartCom,edfStartCom2,edfStartInCom,edfStartInCom2,edfStartString
+Keywords=edfStartString2,edfStartString3,edfWEDisk,edfWEExtension,edfWEFull
+Keywords=edfWEFullNoExt,edfWENameNoExt,edfWEPath,edfBasicRegEx,edfCaseSensitive
+Keywords=edfDoReplace,edfExtendedRegEx,edfFromBeggining,edfFromCursor,edfInSelection
+Keywords=edfNoOptimizeRegEx,edfNormalText,edfOnlySelection,edfOptimizeRegEx
+Keywords=edfPerlRegEx,edfPromptOnReplace,edfRegularEx,edfReplaceAll,edfSearchInComm
+Keywords=edfSearchOutComm,edfShowFuncName,edfTagsText,edfWholeWordsOnly
+Keywords=edfWinASCII,edfWinCalendar,edfWinClipboard,edfWinHelp,edfWinMP3,edfWinMan
+Keywords=edfWinMessage,edfWinPrj,edfInfTVDriver,edfInfOS,edfInfOSFlavor
+Keywords=edfInfCPU,edfInfCompiler,edfInfCompilerFlavor
+End
+
+# ---------------- Menu File ------------------
+#
+Name=Menu File
+Files=smn
+EOLComment1=#
+EOLCInFirstCol1=1
+String1="
+Symbols1=:,
+Preprocessor=$
+HexMarker=0x
+Keywords=SubMenu,MenuItem,MenuItemC,MenuSeparator,EndSubMenu
+Keywords=StatusRange,StatusEntry,StatusHiddenEntry,EndStatusRange,NewMenu
+End
+
+#----------------------- Netwide Assembler (nasm) -------------------------
+#
+#
+Name=Netwide Assembler
+Files=nsm
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+EOLComment2=;
+HexMarker=0x
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+Preprocessor=#
+Preprocessor2=%
+Keywords=sets,setpo,setpe,setp,seto,setnz,setns,setnp
+Keywords=setno,setnle,setnl,setnge,setng,setne,setnc,setnbe
+Keywords=setnb,setnae,setna,setle,setl,setge,setg,setz
+Keywords=sete,setc,setbe,setb,setae,seta,js,jpo
+Keywords=jpe,jp,jo,jnz,jns,jnp,jno,jnle
+Keywords=jnl,jnge,jng,jne,jnc,jnbe,jnb,jnae
+Keywords=jna,jle,jl,jge,jg,jz,je,jc
+Keywords=jbe,jb,jae,ja,cmovs,cmovpo,cmovpe,cmovp
+Keywords=cmovo,cmovnz,cmovns,cmovnp,cmovno,cmovnle,cmovnl,cmovnge
+Keywords=cmovng,cmovne,cmovnc,cmovnbe,cmovnb,cmovnae,cmovna,cmovle
+Keywords=cmovl,cmovge,cmovg,cmovz,cmove,cmovc,cmovbe,cmovb
+Keywords=cmovae,cmova,xor,xlatb,xchg,xbts,xadd,wrmsr
+Keywords=wbinvd,wait,verw,verr,umov,test,sub,str
+Keywords=stosw,stosd,stosb,sti,std,stc,smsw,smi
+Keywords=sldt,sidt,shrd,shr,shld,shl,sgdt,scasw
+Keywords=scasd,scasb,sbb,sar,salc,sal,sahf,rsm
+Keywords=ror,rol,retn,retf,ret,resw,rest,resq
+Keywords=resd,resb,rdtsc,rdpmc,rdmsr,rcr,rcl,pxor
+Keywords=pushfw,pushfd,pushf,pushaw,pushad,pusha,push,punpcklwd
+Keywords=punpckldq,punpcklbw,punpckhwd,punpckhdq,punpckhbw,psubw,psubusw,psubusb
+Keywords=psubsw,psubsiw,psubsb,psubd,psubb,psrlw,psrlq,psrld
+Keywords=psraw,psrad,psllw,psllq,pslld,por,popfw,popfd
+Keywords=popf,popaw,popad,popa,pop,pmvzb,pmvnzb,pmvlzb
+Keywords=pmvgezb,pmullw,pmulhw,pmulhriw,pmulhrw,pmagw,pmaddwd,pmachriw
+Keywords=pdistib,pcmpgtw,pcmpgtd,pcmpgtb,pcmpeqw,pcmpeqd,pcmpeqb,paveb
+Keywords=pandn,pand,paddw,paddusw,paddusb,paddsw,paddsiw,paddsb
+Keywords=paddd,paddb,packuswb,packsswb,packssdw,outsw,outsd,outsb
+Keywords=out,or,not,nop,neg,mul,movzx,movsx
+Keywords=movsw,movsd,movsb,movq,movd,mov,ltr,lss
+Keywords=lsl,loopz,loopnz,loopne,loope,loop,lodsw,lodsd
+Keywords=lodsb,loadall286,loadall,lmsw,lldt,lidt,lgs,lgdt
+Keywords=lfs,les,leave,lea,lds,lar,lahf,jmp
+Keywords=jecxz,jcxz,iretw,iretd,iret,invlpg,invd,into
+Keywords=int3,int1,int01,int,insw,insd,insb,incbin
+Keywords=inc,in,imul,idiv,icebp,ibts,hlt,fyl2xp1
+Keywords=fyl2x,fxtract,fxch,fxam,fucompp,fucomp,fucomip,fucomi
+Keywords=fucom,ftst,fsubrp,fsubr,fsubp,fsub,fstsw,fstp
+Keywords=fstenv,fstcw,fst,fsqrt,fsincos,fsin,fsetpm,fscale
+Keywords=fsave,frstor,frndint,fptan,fprem1,fprem,fpatan,fnstsw
+Keywords=fnstenv,fnstcw,fnsave,fnop,fninit,fneni,fndisi,fnclex
+Keywords=fmulp,fmul,fldz,fldpi,fldln2,fldlg2,fldl2t,fldl2e
+Keywords=fldenv,fldcw,fld1,fld,fisubr,fisub,fistp,fist
+Keywords=finit,fincstp,fimul,fild,fidivr,fidiv,ficomp,ficom
+Keywords=fiadd,ffree,feni,fdivrp,fdivr,fdivp,fdiv,fdisi
+Keywords=fdecstp,fcos,fcompp,fcomp,fcomip,fcomi,fcom,fcmovu
+Keywords=fcmovnu,fcmovne,fcmovnbe,fcmovnb,fcmove,fcmovbe,fcmovb,fclex
+Keywords=fchs,fbstp,fbld,faddp,fadd,fabs,f2xm1,equ
+Keywords=enter,emms,dw,dt,dq,div,dec,dd
+Keywords=db,das,daa,cwde,cwd,cpuid,cmpxchg8b,cmpxchg486
+Keywords=cmpxchg,cmpsw,cmpsd,cmpsb,cmp,cmc,clts,cli
+Keywords=cld,clc,cdq,cbw,call,bts,btr,btc
+Keywords=bt,bswap,bsr,bsf,bound,arpl,and,add
+Keywords=adc,aas,aam,aad,aaa,ax,bx,cx,dx,si,di,bp,sp
+Keywords=eax,ebx,ecx,edx,esi,edi,ebp,esp
+Keywords=ah,al,bh,bl,ch,cl,dh,dl
+Keywords=cs,ss,ds,es,fs,gs
+Keywords=cr0,cr2,cr3,cr4
+Keywords=dr1,dr2,dr3,dr6,dr7
+Keywords=tr3,tr4,tr5,tr6,tr7
+Keywords=mm0,mm1,mm2,mm3,mm4,mm5,mm6,mm7
+Keywords=st0,st1,st2,st3,st4,st5,st6,st7
+Keywords=byte,dword,far,long,near,nosplit,qword,short,tword,word
+Keywords=a16,a32,o16,o32,lock,rep,repe,repne,repz,repnz, times
+Keywords=struc,endstruc,istruct,at,iend,align,alignb,extern,global
+Keywords=common,private,public,stack,class,overlay,use16,use32,flat
+Keywords=group,uppercase,import,export,resident,nodata,data,code,bss,parm
+Keywords=info,alloc,exec,write,progbits,gotpc,gotoff,got,plt,sym,start
+Keywords=function,library
+Keywords=incbin,wrt,seg,bits,section,segment,absolute,org
+End
+
+#---------------------------------- Perl ------------------------------------
+#
+# Original version contributed by Herb Kateley (herb@ke.com). Another version
+# was contributed by Jeff Wang (jeffw@enterprise.advance.com). What you see
+# here is the merger of those two, with other modifications. The "font normal"
+# line exists to prevent $# from being interpretted as a plain dollar sign
+# followed by a comment.
+# Ported to Set Editor by Daniel Mizyrycki (mdaniel@balug.org.ar)
+#
+# Adjusted by SET to make it closer to the real Perl syntax.
+#
+Name=Perl
+Files=pl,pm
+EmacsModes=Perl
+ShellScript=perl
+Case=1
+EOLComment1=#
+HexMarker=0x
+Symbols1=!&*+-:<=>?^|$~@\
+Symbols2=(){}[],;
+Escape=\
+EscapeAnywhere=1
+String1="
+String2='
+String3=`
+# $# is a special case and can be confused with a comment
+SpecialSymbol=$
+SpecialSymbolCont=#
+PMacros=perlmac.pmc
+NLIndent=FirstWord,if,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,unless,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,do,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,for,NoLastChar,;,AutoIndent,3
+NLIndent=FirstWord,foreach,NoLastChar,;,AutoIndent,3
+NLIndent=FirstWord,else,,,AutoIndent,2
+NLIndent=FirstWord,elsif,,,AutoIndent,2
+NLIndent=FirstWord,while,NoLastChar,;,AutoIndent,2
+NLIndent=FirstWord,return,,,Unindent
+NLIndent=FirstWord,{,,,AutoIndent,1
+NLIndent=FirstWord,},,,Unindent
+NLIndent=ParBalancePos,,,,MoveAfterPar
+NLIndent=ParBalanceNeg,,,,AutoIndent,0
+Preload
+Keywords=BEGIN,END,CORE,__END__,__FILE__,__LINE__,AUTOLOAD,DESTROY
+Keywords=abs,accept,alarm,and,atan2,bind,binmode,bless,caller,chdir,chmod
+Keywords=chomp,chop,chown,chr,chroot,close,closedir,cmp,connect,continue,cos
+Keywords=crypt,dbmclose,dbmopen,defined,delete,die,do,dump,each,else,elsif
+Keywords=endgrent,endhostent,endnetent,endprotoent,endpwent,endservent,eof
+Keywords=eq,eval,exec,exists,exit,exp,fcntl,fileno,flock,for,foreach,fork
+Keywords=format,formline,ge,getc,getgrent,getgrgid,getgrnam,gethostbyaddr
+Keywords=gethostbyname,gethostent,getlogin,getnetbyaddr,getnetbyname
+Keywords=getnetent,getpeername,getpgrp,getppid,getpriority,getprotobyname
+Keywords=getprotobynumber,getprotoent,getpwent,getpwnam,getpwuid
+Keywords=getservbyname,getservbyport,getservent,getsockname,getsockopt
+Keywords=glob,gmtime,goto,grep,gt,hex,if,index,int,ioctl,join,keys,kill
+Keywords=last,lc,lcfirst,le,length,link,listen,local,localtime,log,lstat
+Keywords=lt,m,map,mkdir,msgctl,msgget,msgrcv,msgsnd,my,ne,next,no,not,oct
+Keywords=open,opendir,or,ord,pack,package,pipe,pop,pos,print,printf,push,q
+Keywords=qq,quotemeta,qw,qx,rand,read,readdir,readline,readlink,readpipe
+Keywords=recv,redo,ref,rename,require,reset,return,reverse,rewinddir,rindex
+Keywords=rmdir,s,scalar,seek,seekdir,select,semctl,semget,semop,send,setgrent
+Keywords=sethostent,setnetent,setpgrp,setpriority,setprotoent,setpwent
+Keywords=setservent,setsockopt,shift,shmctl,shmget,shmread,shmwrite,shutdown
+Keywords=sin,sleep,socket,socketpair,sort,splice,split,sprintf,sqrt,srand
+Keywords=stat,study,sub,substr,symlink,syscall,sysread,system,syswrite,tell
+Keywords=telldir,tie,time,times,tr,truncate,uc,ucfirst,umask,undef,unless
+Keywords=unlink,unpack,unshift,untie,until,use,utime,values,vec,wait,waitpid
+Keywords=wantarray,warn,while,write,x,xor,y
+End
+
+
+# ---------------------------- 8051 asm ------------------------------------
+#
+# Contributed by Alex Lozano <alex@inti.gov.ar>
+# Keil A51 (8 bit) and A251 (16 bit) assembler for 8x51/52 and MCS 251
+# Extracted from the Keil A51/A251 User's Guide version 04.95
+# This replace the former 8051 Syntax Highlight definition
+# Compatible with the 'ASM51' CrossAssembler (freeware Version) by MetaLink
+#
+Name=8x51 asm
+Files=a51,inc
+EmacsModes=Asm51,Asm251
+Pmacros=asm51.pmc
+Preprocessor=$
+EOLComment1=;
+Escape=\
+Symbols1=-+*/=
+Symbols2=#@!$%&(),.:<>?[]
+String1='"
+AllowedInsideNames=.
+NoCheckNumbers=1
+# HexMarker only valid for A251 Assembler
+HexMarker=0x
+# A51, A251 Reserved Words
+Keywords=a,ab,and,ar0,ar1,ar2,ar3,ar4,ar5,ar6,ar7,at,bit,bitaddressable,block
+Keywords=bseg,byte,byte0,byte1,byte2,byte3,c,call,code,const,cseg,data,db,dbit
+Keywords=dd,dptr,dr0,dr12,dr16,dr20,dr24,dr28,dr4,dr56,dr60,dr8,ds,dsb,dsd
+Keywords=dseg,dsw,dw,dword,ebit,ebitaddressable,ecode,edata,else,elseif,end
+Keywords=endif,endm,endp,eq,equ,even,exitm,extern,extrn,far,ge,gt,hconst
+Keywords=hdata,high,idata,if,inblock,inpage,inseg,irp,irpc,iseg,label,le,lit
+Keywords=local,low,lt,macro,mod,h,name,nconst,ne,near,not,nul,number,offs,or
+Keywords=org,overlayable,page,pc,proc,public,r0,r1,r2,r3,r4,r5,r6,r7,r8,r9
+Keywords=r10,r11,r12,r13,r14,r15,rept,rseg,seg,segment,set,shl,shr,unit,using
+Keywords=word,word0,word2,wr0,wr2,wr4,wr6,wr8,wr10,wr12,wr14,wr16,wr18,wr20
+Keywords=wr22,wr24,wr26,wr28,wr30,xdata,xor,xseg
+# 8051 Instruction Set
+Keywords=acall,add,addc,ajmp,anl,cjne,clr,cmp,cpl,da,dec,div,djnz,inc,jb,jbc
+Keywords=jc,jmp,jnb,jnc,jnz,jz,lcall,ljmp,mov,movc,movx,mul,nop,orl,pop
+Keywords=push,ret,reti,rl,rlc,rr,rrc,setb,sjmp,subb,swap,xch,xchd,xrl
+# MCS 251 added Instruction Set
+Keywords=ecall,ejmp,eret,je,jg,jle,jne,jsg,jsge,jsl,jsle,movh,movs,movz,
+Keywords=sll,sra,srl,sub
+# ***** Special Function Registers *****
+# BYTE Registers:
+Keywords=P0,P1,P2,P3,PSW,ACC,B,SP,DPL,DPH,PCON,TCON,TMOD,TL0,TL1,TH0,TH1,IE,IP DATA 0B8H
+Keywords=SCON,SBUF
+# 8052 Extensions
+Keywords=T2CON,RCAP2L,RCAP2H,TL2,TH2
+# MCS 251 Extensions
+Keywords=
+# BIT Registers:
+# PSW
+Keywords=CY,AC,F0,RS1,RS0,OV,P
+# TCON
+Keywords=TF1,TR1,TF0,TR0,IE1,IT1,IE0,IT0,IE,ET1,EX1,ET0,EX0
+# IP
+Keywords=PS,PT1,PX1,PT0,PX0
+# IE
+Keywords=EA,ET2,ES,ET1,EX1,ET0,EX0
+# P3
+Keywords=RD,WR,T1,T0,INT1,INT0,TXD,RXD
+# SCON
+Keywords=SM0,SM1,SM2,REN,TB8,RB8,TI,RI
+# P1 (8052 only)
+Keywords=T2EX,T2
+# T2CON (8052 only)
+Keywords=TF2,EXF2,RCLK,TCLK,EXEN2,TR2,C_T2,CP_RL2
+# Port Bits addressing
+Keywords=p0.0,p0.1,p0.2,p0.3,p0.4,p0.5,p0.6,p0.7
+Keywords=p1.0,p1.1,p1.2,p1.3,p1.4,p1.5,p1.6,p1.7
+Keywords=p2.0,p2.1,p2.2,p2.3,p2.4,p2.5,p2.6,p2.7
+Keywords=p3.0,p3.1,p3.2,p3.3,p3.4,p3.5,p3.6,p3.7
+# PSW Bits addressing
+Keywords=psw.0,psw.1,psw.2,psw.3,psw.4,psw.5,psw.6,psw.7
+# ACC Bits addressing
+Keywords=acc.0,acc.1,acc.2,acc.3,acc.4,acc.5,acc.6,acc.7
+End
+
+# --------------------------- JAVA files ---------------------------
+#
+# Contributed by Louis Paul Santillan <lsantil@calstatela.edu>
+#
+Name=Java
+Files=j,jav,java
+EmacsModes=java,Java,JAVA
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+HexMarker=0x
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+PMacros=cpmacros.pmc
+Keywords=abstract,boolean,break,byte,byvalue,case,cast,catch,char,class
+Keywords=const,continue,default,do,double,else,extends,false,final,finally
+Keywords=float,for,future,generic,goto,if,inner,implements,import,instanceof
+Keywords=int,interface,long,native,new,null,operator,outer,package,private
+Keywords=protected,public,rest,return,short,static,super,switch,sychronized
+Keywords=this,threadsafe,throw,transient,true,try,car,void,while,throws
+End
+
+# ------------------------ Environment files ---------------------------------
+#
+# They are used by RHIDE and djgpp to extend the environment.
+#
+Name=Environment
+Files=env
+EOLComment1=#
+NoCheckNumbers=1
+Symbols1=$=
+Symbols2=()
+End
+
+# ----------------------- Python scripts ------------------------------------
+#
+# Contributed by David <david.stegbauer@cz.opel.com>, he says:
+#
+# Python is very cool object oriented script language,
+# as good as perl, but not so cryptic.
+# see also http://www.python.org/
+#
+Name=Python
+Files=py
+EmacsModes=Python,python
+ShellScript=python
+Case=1
+EOLComment1=#
+HexMarker=0x
+Symbols1=!&*+-/<=>?^|~
+Symbols2=(){}[],;:.
+String1="
+String2='
+Escape=\
+Keywords=and,assert,break,class,continue,def,del,elif,else,except,exec
+Keywords=finally,for,from,global,if,import,in,is,lambda,not,or,pass
+Keywords=print,raise,return,try,while,None,Ellipsis,yield
+#Special method names
+#Basic customization
+Keywords=__init__,__del__,__repr__,__str__,__cmp__,__hash__,__nonzero__
+#Customizing attribute access
+Keywords=__getattr__,__setattr__,__delattr__
+#Emulating callable objects
+Keywords=__call__
+#Emulating sequence and mapping types
+Keywords=__len__,__getitem__,__setitem__,__delitem__,__getslice__
+Keywords=__setslice__,__delslice__
+#Emulating numeric types
+Keywords=__add__,__sub__,__mul__,__div__,__mod__,__divmod__,__pow__
+Keywords=__lshift__,__rshift__,__and__,__xor__,__or__
+Keywords=__radd__,__rsub__,__rmul__,__rdiv__,__rmod__,__rdivmod__,__rpow__
+Keywords=__rlshift__,__rrshift__,__rand__,__rxor__,__ror__
+Keywords=__neg__,__pos__,__abs__,__invert__
+Keywords=__int__,__long__,__float__,__oct__,__hex__,__coerce__
+#Top level names
+Keywords=__main__,__builtin__
+End
+
+# ----------------------- UNIX shell scripts --------------------------------
+#
+Name=UNIX shell script
+Files=sh
+EmacsModes=Shell script,shell script
+ShellScript=bash,sh
+Case=1
+EOLComment1=#
+NoCheckNumbers=1
+Symbols1=!&*+\/<=>?^|~
+Symbols2=(){}[],;:.
+String1="
+String2='
+String3=`
+Escape=\
+EscapeAnywhere=1
+CanStartAName=-
+AllowedInsideNames=-
+# $# is a special case and can be confused with a comment
+SpecialSymbol=$
+SpecialSymbolCont=#
+Keywords=alias,bg,bind,break,builtin,case,cd,command,continue,declare,dirs
+Keywords=disown,do,done,echo,else,enable,esac,eval,exec,exit,export,fc,fg,fi,for,getopts
+Keywords=hash,help,history,if,in,jobs,kill,let,local,logout,popd,pushd,pwd,read
+Keywords=readonly,return,set,shift,shopt,source,suspend,then,times,trap,type
+Keywords=typeset,ulimit,umask,unalias,unset,until,wait,while
+# External programs, the most common
+Keywords=cat,cp,echo,fgrep,grep,ls,mv,rm,sed,sort,test,tr,uniq,wc
+End
+
+# ------------------------ Texinfo Source files (txi) ------------------------
+#
+# Contributed by Burton Radons <loth@pacificcoast.net> [ca]
+#
+Name=Texinfo source
+Files=txi,tx
+EmacsModes=Texinfo
+Case=1
+EOLComment1="@c "
+EOLComment2=@comment
+NoCheckNumbers=1
+PartialKeywords=1
+CanStartAName=@\
+AllowedInsideNames=-
+Symbols1=!"'*-.:=?@^`{}~,\
+SpecialSymbol=@
+SpecialSymbolCont=@,"'.:={}`^?!-~*
+Keywords=@defcodeindex,@defcv,@defcvx,@deffn,@deffnx,@appendixsubsubsec
+Keywords=@definfoenclose,@defivar,@defivarx,@defmac,@defmacx,@defmethod
+Keywords=@defmethodx,@defop,@defopx,@defopt,@defoptx,@defspec,@defspecx
+Keywords=@deftp,@deftpx,@deftypefn,@deftypefnx,@deftypefun,@deftypefunx
+Keywords=@deftypevr,@deftypevrx,@deftypevar,@deftypevarx,@defun,@defunx
+Keywords=@defvar,@defvarx,@defvr,@defvrx,@detailmenu,@dfn,@asis,@b,@bye
+Keywords=@dircategory,@direntry,@display,@dmn,@dots,@email,@emph,\input
+Keywords=@enddots,@enumerate,@equiv,@error,@evenfooting,@evenheading,@H
+Keywords=@everyfooting,@everyheading,@example,@exclamdown,@exdent,@page
+Keywords=@expansion,@file,@finalout,@findex,@flushleft,@flushright,@tab
+Keywords=@cite,@clear,@code,@contents,@copyright,@defindex,@AA
+Keywords=@footnote,@footnotestyle,@format,@ftable,@group,@heading,@node
+Keywords=@headings,@i,@ifclear,@ifhtml,@ifinfo,@ifset,@iftex,@smalllisp
+Keywords=@include,@inforef,@item,@itemize,@itemx,@kbd,@key,@end,@ignore
+Keywords=@kindex,@L,@l,@global,@lisp,@url,@lowersections,@macro,@author
+Keywords=@majorheading,@math,@menu,@minus,@OE,@multitable,@need,@vindex
+Keywords=@noindent,@O,@o,@oddfooting,@oddheading,@print,@appendixsubsec
+Keywords=@cartouche,@center,@centerchap,@chapheading,@chapter,@AE
+Keywords=@paragraphindent,@pindex,@point,@@,@pounds,@thistitle
+Keywords=@pxref,@questiondown,@quotation,@r,@raisesections,@ref,@refill
+Keywords=@result,@ringaccent,@samp,@sc,@section,@set,@setchapternewpage
+Keywords=@setfilename,@settitle,@shortcontents,@shorttitlepage,thisfile
+Keywords=@smallbook,@smallexample,@sp,@ss,@oe,@table
+Keywords=@subheading,@subsection,@w,@subsubheading,@xref,@subsubsection
+Keywords=@subtitle,@summarycontents,@appendix,@syncodeindex,@cindex,@aa
+Keywords=@TeX,@tex,@thischapter,@thischaptername,@vtable,@printindex
+Keywords=@thispage,@tindex,@title,@titlefont,@titlepage,@uC,@synindex
+Keywords=@t,@ubaraccentC,@udotaccentC,@unnumbered,@unnumberedsec,@bullet
+Keywords=@unnumberedsubsec,@unnumberedsubsubsec,@vC,@value,@var,@strong
+Keywords=@ae,@appendixsec,@appendixsection,@top,@today,@vskip
+End
+
+# ---------------- PICS asm ----------------
+#
+# Contributed by Diego Brengi <brengi@inti.gov.ar>
+#
+Name=PICs asm
+EmacsModes=mpasm
+EOLComment1=;
+HexMarker=0x
+Symbols1=!$%&(),-./:<>?[]
+String1="
+String2='
+AllowedInsideNames=.
+CanStartAName=#
+NoCheckNumbers=1
+# Instruction set PIC 16c7X
+Keywords=addwf,andwf,clrf,clrw,comf,decf,decfsz,incf,incfsz,iorwf,movf
+Keywords=movwf,nop,rlf,rrf,subwf,swapf,xorwf,bcf,bsf,btfsc,btfss,addlw
+Keywords=andlw,call,clrwdt,goto,iorlw,movlw,retfie,retlw,return,sleep
+Keywords=sublw,xorlw
+#Directive Summary
+Keywords=cbank,cblock,constant,data,db,dw,else,end,endc,endif,endm,endw
+Keywords=equ,error,exitm,expand,fill,if,ifdef,ifndef,include,list,local
+Keywords=macro,messg,noexpand,nolist,org,page,processor,radix,res,set
+Keywords=space,subtitle,title,#undefine,#define,variable,while
+
+Keywords=w,f,indf,tmr0,pcl,status,fsr,porta,portb,portc,portd,porte,pclath
+Keywords=intcon,pir1,pir2,tmr1l,tmr1h,t1con,tmr2,t2con,sspbuf,sspcon,ccpr1l
+Keywords=ccpr1h,ccp1con,rcsta,txreg,rcreg,ccpr2l,ccpr2h,ccp2con,adres,adcon0
+Keywords=option_reg,trisa,trisb,trisc,trisd,trise,pie1,pie2,pcon,pr2,sspadd
+Keywords=sspstat,txsta,spbrg,adcon1
+Keywords=irp,rp1,rp0,not_to,not_pd,z,dc,c
+Keywords=gie,peie,t0ie,inte,rbie,t0if,intf,rbif
+Keywords=pspif,adif,rcif,txif,sspif,ccp1if,tmr2if,tmr1if,ccp2if
+Keywords=t1ckps1,t1ckps0,t1oscen,not_t1sync,t1insync,tmr1cs,tmr1on
+Keywords=toutps3,toutps2,toutps1,toutps0,tmr2on,t2ckps1,t2ckps0
+Keywords=wcol,sspov,sspen,ckp,sspm3,sspm2,sspm1,sspm0
+Keywords=ccp1x,ccp1y,ccp1m3,ccp1m2,ccp1m1,ccp1m0
+Keywords=spen,rx9,rc9,not_rc8,rc8_9,sren,cren,ferr,oerr,rx9d,rcd8
+Keywords=ccp2x,ccp2y,ccp2m3,ccp2m2,ccp2m1,ccp2m0
+Keywords=adcs1,adcs0,chs2,chs1,chs0,go,not_done,go_done,adon
+Keywords=not_rbpu,intedg,t0cs,t0se,psa,ps2,ps1,ps0
+Keywords=ibf,obf,ibov,pspmode,trise2,trise1,trise0
+Keywords=pspie,adie,rcie,txie,sspie,ccp1ie,tmr2ie,tmr1ie,ccp2ie
+Keywords=not_por,not_bo,not_bor
+Keywords=d,i2c_data,not_a,not_address,d_a,data_address,p,i2c_stop,s,i2c_start
+Keywords=r,i2c_read,not_w,not_write,r_w,read_write,ua,bf
+Keywords=csrc,tx9,not_tx8,tx8_9,txen,sync,brgh,trmt,tx9d,txd8
+Keywords=pcfg2,pcfg1,pcfg0
+Keywords=_boden_on,_boden_off,_cp_all,_cp_75,_cp_50,_cp_off,_pwrte_off,_pwrte_on
+Keywords=_wdt_on,_wdt_off,_lp_osc,_xt_osc,_hs_osc,_rc_osc
+End
+
+# ----------------------------- Makefiles ------------------------------
+#
+# Very basic support, keywords from GNU Make 3.77
+#
+Name=Makefile
+Files=mak
+NameMatch=(GNU)?[mM]akefile
+ShellScript=make
+Escape=\
+Case=1
+EOLComment1=#
+NoCheckNumbers=1
+Symbols1=!&\<=>?^|~$%
+Symbols2=(){}[],;:
+String1="
+String2='
+String3=`
+CanStartAName=./
+AllowedInsideNames=./~+
+Preload
+# Special . definitions
+Keywords=.DEFAULT,.DELETE_ON_ERROR,.EXPORT_ALL_VARIABLES,.IGNORE
+Keywords=.INTERMEDIATE,.PHONY,.POSIX,.PRECIOUS,.SECONDARY,.SILENT,.SUFFIXES
+# Variables defined
+Keywords=AR,ARFLAGS,AS,ASFLAGS,CC,CFLAGS,CO,COFLAGS,COMSPEC,CPP,CPPFLAGS
+Keywords=CTANGLE,CWEAVE,CXX,CXXFLAGS,FC,FFLAGS,GET,GFLAGS,GPATH,LDFLAGS
+Keywords=LEX,LFLAGS,MAKE,MAKECMDGOALS,MAKEFILES,MAKEFLAGS,MAKEINFO,MAKELEVEL
+Keywords=MAKEOVERRIDES,MFLAGS,OUTPUT_OPTION,PC,PFLAGS,RFLAGS,RM,SHELL
+Keywords=SUFFIXES,TANGLE,TEX,TEXI2DVI,VPATH,WEAVE,YACC,YACCR,YFLAGS
+# Functions
+Keywords=addprefix,addsuffix,basename,define,dir,else,endef,endif,export
+Keywords=filter,filter-out,findstring,firstword,foreach,ifdef,ifeq,ifndef
+Keywords=ifneq,include,join,notdir,origin,override,patsubst,shell,sort,strip
+Keywords=subst,suffix,unexport,vpath,wildcard,word,wordlist,words
+End
+
+# -------------------------------- TCL/Tk scripts -----------------------------
+#
+# Contributed by Philip Moore <FireEgl@EMail.com>
+# TCL/Tk - http://Dev.Scriptics.com/software/tcltk/
+# Also, all of these integrate with or extend TCL/Tk.
+# Therefore their keywords are also listed below:
+# [incr Tcl] & [incr Tk] - http://www.TCLTk.com/itcl/ (TCL and Tk extensions)
+# TclX - http://www.NeoSoft.com/tclx/ (TCL extension)
+# Expect - http://Expect.Nist.Gov (TCL extension)
+# Eggdrop - http://www.EggHeads.org (IRC bot that uses TCL for it's scripting)
+#
+Name=TCL/Tk-Eggdrop
+Files=tcl,TCL,Tcl,tCL,tcL,TcL,tCl,TCl
+EmacsModes=tcl,TCL,Tcl
+ShellScript=tclsh
+Case=1
+RelaxNumberCheck=1
+EOLComment1=#
+EOLCInFirstUse1=1
+EOLComment2=;#
+AllowedInsideNames=1234567890-=\~!@#$%^&*_+|;,./:<>?`'
+CanStartAName=1234567890-=\~!@#$%^&*()_+|;,./:<>?`'
+HexMarker=\x
+Symbols1=!&*+-/<=>?^|~$%;:@#_\"(),`'".
+Symbols2={}[]()"
+String1="
+Escape=\
+# It doesn't seem to notice that characters after the Escape are escaped,
+# so that's why there's a SpecialSymbol setting here.
+SpecialSymbol=\
+SpecialSymbolCont={}[]()$\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=\~!@#%^&*_+|;,./:<>?`'
+
+# TCL (8.4a1) Specific:
+Keywords=after,append,array,auto_execok,auto_import,auto_load,auto_load_index
+Keywords=auto_mkindex,auto_mkindex_old,auto_qualify,auto_reset,bgerror,binary
+Keywords=break,case,catch,cd,clock,close,concat,continue,dde,encoding,eof
+Keywords=error,eval,exec,exit,expr,fblocked,fconfigure,fcopy,file,fileevent
+Keywords=filename,flush,for,foreach,format,gets,glob,global,history,if,incr
+Keywords=info,interp,join,lappend,library,lindex,linsert,list,llength,load
+Keywords=lrange,lreplace,lsearch,lsort,memory,msgcat,namespace,open,package
+Keywords=parray,pid,pkg_mkIndex,proc,puts,pwd,re_syntax,read,regexp,registry
+Keywords=regsub,rename,resource,return,scan,seek,set,socket,source,split
+Keywords=string,subst,switch,tclvars,tell,time,trace,unknown,unset,update
+Keywords=uplevel,upvar,variable,vwait,while
+Keywords=tcl_endOfWord,tcl_findLibrary,tcl_startOfNextWord
+Keywords=tcl_startOfPreviousWord,tcl_wordBreakAfter,tcl_wordBreakBefore
+Keywords=tclPkgSetup,tclLog,tclMacPkgSearch,tclPkgUnknown,pkg_compareExtension
+Keywords=else,then,elseif
+# Tk (8.4a1) Specific:
+Keywords=bell,bind,bindtags,bitmap,button,canvas,checkbutton,clipboard,colors
+Keywords=cursors,destroy,entry,event,focus,font,frame,grab,grid,image,keysyms
+Keywords=label,listbox,lower,menu,menubutton,message,option,options,pack,
+Keywords=pack-old,photo,place,radiobutton,raise,scale,scrollbar,selection,send
+Keywords=spinbox,text,tk,tk_bindForTraversal,tk_bisque,tk_chooseColor,tk_dialog
+Keywords=tk_focusFollowsMouse,tk_focusNext,tk_focusPrev,tk_getSaveFile
+Keywords=tk_menuBar,tk_messageBox,tk_optionMenu,tk_popup,tk_setPalette,tkerror
+Keywords=tkvars,tkwait,toplevel,winfo,wm,tk_chooseDirectory,tk_getOpenFile
+Keywords=tkButtonAutoInvoke,::safe::loadTk,::safe::InitTk
+# TCL package commands (tell me if I missed any):
+Keywords=::http::config,::http::geturl,::http::formatQuery
+Keywords=::http::reset,::http::wait,::http::status
+Keywords=::http::size,::http::code,::http::data,::http::cleanup
+Keywords=::http::register,::http::unregister,::http::Finish
+Keywords=::http::ncode,::http::error,::http::Connect,::http::Write
+Keywords=::http::Event,::http::CopyStart,http::CopyDone,::http::Eof
+Keywords=::http::mapReply,::http::ProxyRequired
+Keywords=::safe::interpCreate,::safe::interpInit,::safe::interpConfigure
+Keywords=::safe::interpDelete,::safe::interpAddToAccessPath
+Keywords=::safe::interpFindInAccessPath,::safe::setLogCmd
+Keywords=::safe::InterpStatics,InterpStatics,::safe::InterpNested,InterpNested
+Keywords=::safe::CheckInterp,::safe::interpConfigure,::safe::InterpSetConfig
+Keywords=::safe::InterpInit,::safe::AddSubDirs,::safe::SyncAccessPath
+Keywords=::safe::InterpStateName,::safe::IsInterp,::safe::PathToken
+Keywords=::safe::PathListName,::safe::VirtualPathListName
+Keywords=::safe::PathNumberName,::safe::StaticsOkName,::safe::NestedOkName
+Keywords=::safe::Toplevel,::safe::Set,::safe::Lappend,::safe::Unset
+Keywords=::safe::Exists,::safe::GetAccessPath,::safe::StaticsOk
+Keywords=::safe::NestedOk,::safe::DeleteHookName,::safe::TranslatePath
+Keywords=::safe::Log,::safe::CheckFileName,::safe::AliasSource
+Keywords=::safe::AliasLoad,::safe::FileInAccessPath,::safe::Subset
+Keywords=::safe::AliasSubset,::safe::AliasEncoding
+Keywords=::msgcat::mc,::msgcat::mclocale,::msgcat::mcpreferences
+Keywords=::msgcat::mcload,::msgcat::mcset,::msgcat::mcunknown
+Keywords=::tcltest::test,::tcltest::cleanupTests
+Keywords=::tcltest::getMatchingTestFiles,::tcltest::makeFile
+Keywords=::tcltest::removeFile,::tcltest::makeDirectory
+Keywords=::tcltest::removeDirectory,::tcltest::viewFile
+Keywords=::tcltest::normalizeMsg,::tcltest::bytestring,::tcltest::saveState
+Keywords=::tcltest::restoreState,::tcltest::threadReap
+Keywords=::tcltest::DebugPuts,::tcltest::DebugPArray,::tcltest::DebugDo
+Keywords=::tcltest::AddToSkippedBecause,::tcltest::PrintError
+Keywords=::tcltest::initConstraints,::tcltest::PrintUsageInfo
+Keywords=::tcltest::CheckDirectory,::tcltest::normalizePath
+Keywords=::tcltest::MakeAbsolutePath,::tcltest::processCmdLineArgs
+Keywords=::tcltest::loadTestedCommands,::tcltest::getMatchingFiles
+Keywords=::tcltest::openfiles,::tcltest::leakfiles,::tcltest::grep
+Keywords=::tcltest::set_iso8859_1_locale,::tcltest::restore_locale
+Keywords=::tcl::HistAdd,::tcl::HistKeep,::tcl::HistClear,::tcl::HistInfo
+Keywords=::tcl::HistRedo,::tcl::HistIndex,::tcl::HistEvent,::tcl::HistChange
+Keywords=::tcl::OptKeyRegister,::tcl::OptKeyDelete,::tcl::OptParse
+Keywords=::tcl::OptProc,::tcl::OptProcArgGiven,::tcl::OptKeyParse
+Keywords=::tcl::OptCheckType,::tcl::OptKeyError,::tcl::OptError,::tcl::Lempty
+Keywords=::tcl::Lget,::tcl::Lvarset,::tcl::Lvarset1,::tcl::Lvarset1nc
+Keywords=::tcl::Lvarincr,::tcl::Lvarincr1,::tcl::Lfirst,::tcl::Lrest
+Keywords=::tcl::Lvarpop1,::tcl::Lvarpop,::tcl::Lassign,::tcl::SetMax
+Keywords=::tcl::SetMin,::pkg::create
+# [incr Tcl] (8.3.1+) Specific commands:
+Keywords=itcl_info,itcl_class,delete,ensemble,local
+Keywords=body,find,scope,code,configbody,class
+# [incr Tk] (8.0.4) Specific commands:
+Keywords=tkCheckRadioInvoke,tkScrollByPages,tkCheckRadioEnter,tkPostOverPoint
+Keywords=tkTextNextWord,tkMenuNextMenu,tkListboxUpDown,tkMenuDownArrow
+Keywords=tkListboxBeginExtend,tk_textPaste,tkEntryTranspose,tkScaleButtonDown
+Keywords=tkEventMotifBindings,tkButtonLeave,tkMenuMotion,.,tkSaveGrabInfo
+Keywords=tkTextPaste,tkTextResetAnchor,tkTraverseToMenu,tkScaleControlPress
+Keywords=tkScrollButtonUp,tkTextTranspose,tkEntryNextWord,tkScaleActivate
+Keywords=tkListboxBeginSelect,tkTextScrollPages,tkButtonDown,tkMenuRightArrow
+Keywords=tkMenuFirstEntry,tkMenuInvoke,tkScrollButtonDown,tkEntrySeeInsert
+Keywords=tkScrollByUnits,tkFirstMenu,tkEntryInsert,tkMenuLeftArrow
+Keywords=tkEntrySetCursor,tkListboxDataExtend,tkMbMotion,tkCancelRepeat
+Keywords=tkGenerateMenuSelect,tkButtonUp,tkTabToWindow,tkCheckRadioDown
+Keywords=tkMbPost,tkEntryBackspace,tkTextAutoScan,tkScaleIncrement
+Keywords=tkMenuEscape,tkMenuUnpost,tkTextSetCursor,tkMbEnter,tkButtonInvoke
+Keywords=tkMenuButtonDown,tkTraverseWithinMenu,tkTextKeyExtend
+Keywords=tkRestoreOldGrab,tk_textCut,tkScrollToPos,tkScrollButton2Down
+Keywords=tkScaleEndDrag,tkTextPrevPara,tkEntryClosestGap,tkEntryKeySelect
+Keywords=tkEntryPreviousWord,tkTextNextPos,tkEntryMouseSelect,tkEntryAutoScan
+Keywords=tkListboxMotion,tkListboxAutoScan,tkMenuNextEntry,tkEntryButton1
+Keywords=tkTextNextPara,tkTextInsert,tkScreenChanged,tkScrollStartDrag
+Keywords=tkScaleDrag,tkMenuFind,tk_textCopy,tkScrollTopBottom,tkTextKeySelect
+Keywords=tkListboxSelectAll,tkTextSelectTo,tkTextClosestGap,tkTextPrevPos
+Keywords=tkMbLeave,tkScrollDrag,tkButtonEnter,tkScrollEndDrag,tkMenuFindName
+Keywords=tk_menuSetFocus,tkTextUpDownLine,tkTextButton1,tkListboxExtendUpDown
+Keywords=tkListboxBeginToggle,tkMenuLeave,tkListboxCancel,tkMenuUpArrow
+Keywords=tkScaleButton2Down,tkScrollSelect,tkEntryPaste,tkMbButtonUp
+Keywords=tkEntryGetSelection
+# TclX Specific:
+Keywords=auto_load_pkg,commandloop,fork,loop,funlock,cequal,sync,lvarpush
+Keywords=host_info,replicate,lassign,scanmatch,readdir,cconcat,cindex
+Keywords=ftruncate,catclose,try_eval,sleep,keylkeys,cmdtrace,clength,id,nice
+Keywords=crange,lcontain,execl,scancontext,min,max,chroot,fcntl,select,bsearch
+Keywords=umask,profile,kill,lvarcat,keylget,scanfile,signal,tclx_findinit
+Keywords=chown,ccollate,translit,lmatch,keyldel,infox,system,alarm,csubstr,dup
+Keywords=keylset,tclx_load_tndxs,times,catopen,fstat,chmod,lempty,chgrp,wait
+Keywords=ctype,lgets,flock,random,catgets,ctoken,lvarpop,pipe,loadlibindex
+# Expect Specific:
+Keywords=exp_timestamp,exp_getpid,exp_version,debug,expect_background,exp_pid
+Keywords=interact,expect_after,exp_debug,interpreter,exp_inter_return
+Keywords=exp_log_file,send_user,exp_interpreter,exp_system,spawn,exp_continue
+Keywords=strace,disconnect,expect_before,exp_send_user,exp_spawn,exp_sleep
+Keywords=exp_send,exp_remove_nulls,exp_send_log,log_user,parity,exp_wait
+Keywords=overlay,prompt1,send_error,prompt2,getpid,expect_version,exp_send_tty
+Keywords=exp_overlay,exp_exit,exp_stty,expect_tty,match_max,exp_close,exp_trap
+Keywords=exp_match_max,exp_open,exp_fork,inter_return,log_file,exp_interact
+Keywords=expect_user,exp_internal,remove_nulls,send_log,exp_strace
+Keywords=exp_disconnect,expect,send_tty,stty,timestamp,exp_log_user,exp_parity
+Keywords=trap,exp_send_error
+# Eggdrop (1.5.4) TCL Specific:
+Keywords=putserv,puthelp,putquick,putlog,putcmdlog,putxferlog,putloglev
+Keywords=dumpfile,queuesize,clearqueue,countusers,validuser,finduser,userlist
+Keywords=passwdok,getuser,setuser,chnick,chattr,botattr,matchattr
+Keywords=adduser,addbot,deluser,delhost,addchanrec,delchanrec,getchaninfo
+Keywords=setchaninfo,newchanban,newban,newchanexempt,newexempt,newchaninvite
+Keywords=newinvite,stick,unstick,killchanban,killban,killchanexempt
+Keywords=killexempt,killchaninvite,killinvite,isban,ispermban,isexempt
+Keywords=ispermexempt,isinvite,isperminvite,isbansticky,isexemptsticky
+Keywords=isinvitesticky,matchban,matchexempt,matchinvite,banlist,exemptlist
+Keywords=invitelist,newignore,killignore,ignorelist,isignore,save,reload
+Keywords=backup,getting-users,channel,savechannels,loadchannels,channels
+Keywords=isbotnick,botisop,botisvoice,botonchan,isop,isvoice,onchan,nick2hand
+Keywords=handonchan,hand2nick,ischanban,ischanexempt,ischaninvite,chanbans
+Keywords=chanexempts,chaninvites,resetbans,resetexempts,resetinvites,
+Keywords=resetchan,getchanhost,getchanjoin,onchansplit,chanlist,getchanidle
+Keywords=getchanmode,jump,pushmode,flushmode,topic,validchan,isdynamic
+Keywords=putdcc,dccbroadcast,dccputchan,boot,restart,rehash,dccsimul,hand2idx
+Keywords=idx2hand,valididx,getchan,setchan,console,echo,putbot,putallbots
+Keywords=killdcc,bots,botlist,islinked,dccused,dcclist,whom,getdccidle
+Keywords=getdccaway,setdccaway,connect,listen,dccdumpfile,bind,unbind,logfile
+Keywords=maskhost,timer,utimer,timers,utimers,killtimer,killutimer,unixtime
+Keywords=time,duration,strftime,date,ctime,myip,rand,control,sendnote,link
+Keywords=unlink,encrypt,decrypt,encpass,die,unames,matchchanattr,notes
+Keywords=erasenotes,listnotes,storenote,assoc,killassoc,setpwd,getpwd
+Keywords=getfiles,getdirs,dccsend,filesend,setdesc,getdesc,setowner,getowner
+Keywords=setlink,getlink,getfileq,setuploads,getuploads,setdnloads,getdnloads
+Keywords=mkdir,rmdir,mv,cp,getflags,setflags,stickexempt,unstickexempt
+Keywords=stickinvite,unstickinvite,ischanjuped,channame2dname,chandname2name
+Keywords=wasop,setudef,renudef,deludef,md5,compressfile,uncompressfile
+Keywords=iscompressed,putkick,chhandle,fileresend
+# Other Eggdrop TCL commands (undocumented):
+Keywords=putidx,unshare,reloadhelp,putdccraw,dellang,hide
+Keywords=page,loadhelp,unloadhelp,loadmodule,unloadmodule
+# procs found in alltools.tcl (an Eggdrop TCL script):
+Keywords=putmsg,putchan,putnotc,putact,strlwr,strupr,strcmp,stricmp,strlen
+Keywords=stridx,iscommand,timerexists,utimerexists,inchain,randstring
+Keywords=putdccall,putdccbut,killdccall,killdccbut,iso,realtime,testip
+Keywords=number_to_number,isnumber,ispermowner
+# procs found in compat.tcl (an Eggdrop TCL script):
+Keywords=gethosts,addhost,chpass,getxtra,setxtra,setinfo,getinfo,getaddr
+Keywords=setaddr,getdccdir,setdccdir,getcomment,setcomment,getemail
+Keywords=setemail,getchanlaston,time,date
+# procs found in mc.moretools.tcl by MC_8 (an Eggdrop TCL script):
+Keywords=findip,filt,strip:color,strip:bold,strip:uline,strip:reverse
+Keywords=strip:all,lremove,wholetime,dnslookup,llowest,lbiggest,islink
+Keywords=isparty,notice,msg,ctcp,bold,uline,reverse,color,str,findchanuser
+Keywords=masktype,replace,finduserchan,getchanhost2,which
+# procs found in netbots.tcl by slennox (an Eggdrop TCL script):
+Keywords=slindex,isbotnetnick,stl,nb_randomise,putwrap
+# procs found in..I've no idea where:
+Keywords=boolean,makedir,timesince,timeago
+# The built-in commands to Eggdrop bindings:
+Keywords=*raw:ERROR,*dcc:resetbans,*dcc:unstick,*msg:jump,*dcc:whom,*msg:who
+Keywords=*fil:cancel,*ctcp:ERRMSG,*raw:WALLOPS,*msg:addhost,*dcc:+lang
+Keywords=*dcc:topic,*dcc:noteigns,*msg:notes,*fil:pwd,*bot:notes2
+Keywords=*dcc:adduser,*dcc:unlink,*dcc:help,*msg:seen,*msg:ident,*dcc:bottree
+Keywords=*dcc:+chan,*fil:reget,*dcc:act,*dcc:channel,*dcc:resetinvites
+Keywords=*dcc:chaninfo,*fil:mkdir,*raw:irc:join,*dcc:handle
+Keywords=*dcc:+chrec,*dcc:msg,*chon:notes,*dcc:-host,*dcc:-ignore
+Keywords=*raw:lagcheck:401,*dcc:notes2,*dcc:note,*dcc:traffic,*dcc:-lsec
+Keywords=*raw:MODE,*dcc:store,*raw:irc:mode,*dcc:+ignore,*fil:get,*dcc:whois
+Keywords=*load:irc,*raw:lagcheck:441,*raw:lagcheck:MODE,*dcc:rehelp
+Keywords=*dcc:addlog,*dcc:link,*dcc:deop,*fil:share,*dcc:voice
+Keywords=*raw:lagcheck:478,*dcc:invite,*dcc:binds,*dcc:chanload,*dcc:-invite
+Keywords=*dcc:chhandle,*dcc:status,*dcc:+invite,*raw:KICK,*dcc:comment
+Keywords=*raw:irc:kick,*dcc:server:die,*dcc:+ban,*dcc:clearqueue,*msg:help
+Keywords=*raw:001,*dcc:me,*pub:seen,*dcc:chansave,*dcc:reset,*dcc:language
+Keywords=*load:notes:server,*dcc:kickban,*dcc:chaddr,*dcc:op,*msg:rehash
+Keywords=*fil:quit,*dcc:+host,*raw:PART,*dcc:strip,*dcc:die,*msg:whois
+Keywords=*raw:irc:part,*raw:irc:315,*dcc:+lsec,*dcc:module,*dcc:su
+Keywords=*dcc:page,*raw:irc:331,*raw:irc:332,*dcc:back,*dcc:ldump,*msg:voice
+Keywords=*raw:irc:346,*raw:irc:347,*dcc:debug,*raw:irc:348,*raw:irc:349
+Keywords=*away:notes,*raw:irc:352,*raw:irc:354,*dcc:newpass,*dcc:away
+Keywords=*raw:PONG,*fil:cp,*ctcp:CHAT,*raw:irc:367,*raw:irc:368
+Keywords=*raw:NICK,*dcc:+bot,*dcc:kick,*dcc:info,*raw:irc:nick,*dcc:assoc
+Keywords=*raw:irc:403,*raw:irc:405,*fil:unhide,*dcc:invites,*raw:200
+Keywords=*load:notes:irc,*raw:206,*dcc:motd,*msg:reset,*dcc:-chrec,*dcc:match
+Keywords=*dcc:chanset,*dcc:dump,*raw:irc:invite,*dcc:loadmod,*fil:ln
+Keywords=*dcc:bans,*dcc:say,*msg:die,*fil:ls,*raw:irc:471,*raw:irc:473
+Keywords=*ctcp:ECHO,*raw:irc:474,*raw:251,*raw:irc:475,*chon:channels:chon
+Keywords=*fil:mv,*dcc:set,*load:filesys:server,*raw:303,*ctcp:files:DCC
+Keywords=*fil:rm,*dcc:resetexempts,*dcc:uptime,*raw:318,*dcc:vbottree
+Keywords=*dcc:restart,*dcc:nick,*dcc:dccstat,*fil:rmdir,*raw:QUIT,*dcc:tcl
+Keywords=*ctcp:FINGER,*raw:irc:quit,*raw:346,*raw:348,*link:assoc
+Keywords=*dcc:stick,*raw:irc:msg,*raw:367,*dcc:boot,*dcc:-user,*msg:go
+Keywords=*raw:401,*raw:402,*chon:notes2,*msg:invite,*dcc:unloadmod,*dcc:fwd
+Keywords=*dcc:chat,*dcc:modules,*raw:432,*dcc:-noteign,*raw:433
+Keywords=*raw:irc:notice,*raw:437,*dcc:save,*raw:438,*dcc:bots,*raw:442
+Keywords=*dcc:ignores,*msg:status,*raw:451,*msg:info,*dcc:flush,*msg:op
+Keywords=*raw:482,*msg:memory,*ctcp:TIME,*fil:help,*fil:lsa,*raw:NOTICE
+Keywords=*dcc:quit,*dcc:-ban,*dcc:console,*dcc:files,*dcc:echo,*dcc:relay
+Keywords=*msg:pass,*dcc:chattr,*ctcp:USERINFO,*dcc:reload,*dcc:jump
+Keywords=*dcc:relang,*bot:notes2reply,*ctcp:CLIENTINFO,*fil:pending
+Keywords=*dcc:+user,*nkch:notes,*fil:note,*fil:stats,*dcc:seen
+Keywords=*chon:console:chon,*dcc:chinfo,*raw:irc:topic,*fil:optimise
+Keywords=*dcc:-lang,*dcc:botattr,*dcc:-bot,*ctcp:PING,*dcc:who,*dcc:-exempt
+Keywords=*dcc:banner,*fil:filestats,*dcc:servers,*dcc:-chan,*dcc:lstat
+Keywords=*dcc:notes,*msg:save,*dcc:+exempt,*join:notes,*dcc:resolve
+Keywords=*fil:desc,*fil:chdir,*msg:hello,*dcc:exempts,*dcc:+noteign
+Keywords=*dcc:chpass,*dcc:devoice,*fil:hide,*dcc:trace,*dcc:deluser
+Keywords=*load:server,*raw:PING,*dcc:botinfo,*dcc:backup,*dcc:rehash
+Keywords=*dcc:chnick,*bot:assoc,*dcc:fixcodes,*ctcp:VERSION,*fil:unshare
+Keywords=*raw:irc:324,*fil:cd,*ctcp:server:DCC,*msg:key,*ctcp:transfer:DCC
+Keywords=*raw:PRIVMSG,*dcc:simul
+End
+
+# ----------- TeX, that's really bad!, sorry ---------------
+#
+# Contributed by: Alexander Bokovoy <bokovoy@minsk.lug.net>
+# Modified by: Jan Cnops <Jan.Cnops@hogent.be>
+#
+Name=TeX
+Files=tex,ltx,sty,latex
+EOLComment1=%
+AllowedInsideNames=},*
+CanStartAName=\,{
+Case=1
+Symbols1=\.,;{}()[]%
+NoCheckNumbers=1
+Keywords=documentstyle,documentclass
+Keywords={document},{array},{equation},{eqnarray},{tabbing},{eqnarray*}
+Keywords={tabular},{center},{enumerate},{itemize},{theorem}
+Keywords={picture},{bibliography},{verbatim}
+Keywords=\pagestyle,\pagenumbering,\thispagestyle
+Keywords=\title,\author,\date,\maketitle,\begin,\end,\part,\chapter
+Keywords=\section,\subsection,\subsubsection
+Keywords=\chapter*,\section*,\subsection*,\subsubsection*
+Keywords=\paragraph,\subparagraph,\appendix,\tableofcontents,\listoffigures
+Keywords=\listoftables,\rm,\em,\bf,\sc,\it,\sl,\sf,\tt
+Keywords=\tiny,\scriptsize,\footnotesize,\small,\normalsize,\large,\Large
+Keywords=\LARGE,\huge,\HUGE,\bibitem,\cite
+Keywords=\label,\ref,\pageref,\footnote,\item,\caption,\kill,\hline,\cline,\multicolumn
+Keywords=\def,\hspace,\vspace,\linebreak,\nolinebreak,\newpage,\clearpage,\pagebreak,\nopagebreak,\samepage
+Keywords=\newcommand,\renewcommand,\newenvironment,\newtheorem,\newcounter,\setcounter,\addtocounter,\value,\stepcounter,\\the*
+Keywords=\newlength,\setlength,\addtolength,\settowidth,\textheight,\textwidth,\topmargin,\hoffset,\voffset,\oddsidemargin,\evensidemargin
+Keywords=\mbox,\makebox,\fbos,\framebox,\newsavebox,\sbox,\savebox,\usebox,\raisebox,\put,\framebox,\dashbox,\line,\vector,\circle,\oval
+Keywords=\frame,\shortstack,\multiput,\thinlines,\thicklines,\linethickness,\font,\magnification,\magstephalf,\magstep
+Keywords=\hsize,\vsize,\voffset,\hoffset,\topskip,\leftskip,\rightskip,\eject,\vfill,\eject,\goodbreak,\nobreak,\nopagenumbers
+Keywords=\headline,\headheight,\headsep,\footnote,\pageno,\folio,\par,\parindent,\noindent,\break,\hfill,\break,\line
+Keywords=\rightline,\centerline,\includegraphics,\enskip,\hskip,\hfil,\hfill,\hss,\smallskip
+Keywords=\vskip,\vglue,\vfil,\vfill,\vss,\baselineskip,\parskip,\topinsert,\midinsert,\handindent
+Keywords=\footnote,\hrule,\vrule,\leaders,\hrulefill,\settabs,\haling,\hbox,\vbox,\newbox,\setbox
+Keywords=\arccos,\cos,\csc,\exp,\ker,\limsup,\min,\sinh,\arcsin,\cosh,\deg,\gcd,\lg,\ln,\Pr,\sup
+Keywords=\arctan,\cot,\det,\hom,\lim,\log,\sec,\tan,\arg,\coth,\dim,\inf,\liminfo,\max,\sin,\tanh
+Keywords=\displaystyle,\textstyle,\alpha,\beta,\gamma,\delta,\epsilon,\varepsilon,\zeta
+Keywords=\eta,\theta,\vartheta,\iota,\kappa,\lambda,\mu,\nu,\xi,\o,\pi,\varpi,\rho,\varrho,\sigma,\varsigma
+Keywords=\tau,\upsilon,\phi,\varphi,\chi,\psi,\omega,\Gamma,\Delta,\Theta,\Lambda,\Xi,\Pi,\Sigma,\Upsilon
+Keywords=\Phi,\Psi,\Omega,\aleph,\hbar,\imath,\jmath,\ell,\wp,\Re,\Im,\partial,\infty,\backslash,\prime,\emptyset,\nabla
+Keywords=\surd,\triangle,\angle,\bot,\top,\forall,\exists,\neg,\lnot,\flat,\natural,\sharp,\clubsuit
+Keywords=\diamondsuit,\heartsuit,\spadesuit,\pm,\mp,\setminus,\cdot,\times,\ast,\star,\diamond,\circ,\bullet,\triangleleft,\cap,\cup,\uplus,\sqcap
+Keywords=\sqcup,\amalg,\div,\wr,\bigcirc,\vee,\lor,\wedge,\land,\oplus,\ominus,\otimes,\oslash,\odot,\dagger,\ddagger
+Keywords=\bigtriangleleft,\bigtriangledown,\sum,\prod,\coprod,\int,\oint,\bigcap,\bigcup,\bigsqcup,\bigvee,\bigwedge,\bigodot,\bigotimes,\bigoplus
+Keywords=\biguplus,\hat,\acute,\ddot,\vec,\check,\grave,\breve,\tilde,\dot,\bar,\widehat,\widetilde
+Keywords=\ldots,\vdots,\cdots,\ddots,\leq,\le,\prec,\preceq,\ll,\subset,\subsetqe,\supsetqe,\\in,\vdash,\smile,\frown,\geq,\ge
+Keywords=\succ,\succeq,\gg,\supset,\sqsubseteq,\sqsupsetqe,\ni,\owns,\dashv,\mid,\parallel,\equiv,\sim,\simeq,\asymp,\approx,\cong,\bowtie,\propto,\models
+Keywords=\doteq,\perp,\not,\leftarrow,\Leftarrow,\gets,\longleftarrow,\Longleftarrow,\rightarrow,\Rightarrow,\to,\longrightarrow,\Longrightarrow
+Keywords=\leftrightarrow,\Leftrightarrow,\longleftrightarrow,\Longleftrightarrow,\mapsto,\longmapsto,\hookleftarrow,\hookrightarrow
+Keywords=\leftharpoonup,\rightharpoonup,\leftharpoondown,\rightharpoondown,\uparrow,\Uparrow,\downarrow,\Downarrow
+Keywords=\updownarrow,\Updownarrow,\nearrow,\searrow,\swarrow,\nwarrow,\lbrack,\lfloor,\rbrack,\rfloor
+Keywords=\lceil,\lbrace,\langle,\rceil,\rbrace,\rangle,\quad,\qquad,\Biggl,\biggl,\Bigl,\bigl
+Keywords=\bigr,\Bigr,\biggr,\Biggr,\lgroup,\rgroup,\langle,\rangle,\vert,\Vert,\uparrow
+Keywords=\left,\right,\overline,\overrightarrow,\overleftarrow,\overbrace,\underbrace,\atop,\choose,\brack,\above,\brace
+Keywords=\pmatrix,\matrix,\bordermatrix,\eqalign,\eqno,\eqalignno,\quad,\def,\gdef,\edef
+Keywords=\newcount,\advance,\multiply,\divide,\number,\romannumeral,\newdimen,\newread
+Keywords=\openin,\closein,\input,\endinput,\newwrite,\openouput,\closeout,\write,\jobname,\if,\else,\fi,\ifx,\ifeof
+Keywords=\ifhmode,\ifvmode,\ifmmode,\ifcat,\ifnum,\ifdim,\ifodd,\ifcase,\or,\loop,\repeat
+Keywords=\beginpicture,\setcoordinatesystem,\endpicture,\plotheading,\lines,\putrule,\linethickness,\setlinear,\setquadratic,\sethistograms,\setsolid,\setdashes
+Keywords=\setdots,\setdashpattern,\setplotsymbol,\plot,\arrow,\put,\multiput,\circulararc,\ellipticarc,\startrotation,\stoprotation,\setshadegrid,\setshadesymbol
+Keywords=\shaderectangleson,\sharerectanglesoff,\vshade,\setquadratic,\hshade,\setplotarea,\inboundscheckon,\inboundscheckoff
+Keywords=\axis,\setbox,\endpicturesave,\newdimen,\Alph,\AtBeginDocument,\AtBeginDvi,\AtEndDocument,\AtEndOfPackage,\Big,\Bigg,\Box,\CheckCommand
+Keywords=\ClassError,\ClassInfo,\ClassWarning,\ClassWarningNoLine,\DeclareErrorFont,\DeclareFixedFont,\DeclareFontEncoding
+Keywords=\DeclareFontEncodingDefaults,\DeclareFontFamily,\DeclareFontShape,\DeclareFontSubstitution,\DeclareMathAccent,\DeclareMathAlphabet
+Keywords=\DeclareMathDelimiter,\DeclareMathRadical,\DeclareMathSizes,\DeclareMathSymbol,\DeclareMathVersion,\DeclareOldFontCommand
+Keywords=\DeclareOption,\DeclarePreloadSizes,\DeclareRobustCommand,\DeclareSizeFunction,\DeclareSymbolFont,\DeclareSymbolFontAlphabet
+Keywords=\DeclareTextAccent,\DeclareTextAccentDefault,\DeclareTextCommand,\DeclareTextCommandDefault,\DeclareTextComposite,\DeclareTextCompositeCommand
+Keywords=\DeclareTextFontCommand,\DeclareTextSymbol,\DeclareTextSymbolDefault,\ExecuteOptions,\IfFileExists,\InputIfFileExists
+Keywords=\Join,\LoadClass,\LoadClassWithOptions,\MessageBreak,\NeedsTeXFormat,\OptionNotUsed,\PackageError,\PackageInfo,\PackageWarning
+Keywords=\PackageWarningNoLine,\PassOptionsToClass,\PassOptionsToPackage,\ProcessOptions,\ProvideTextCommand,\ProvideTextCommandDefault
+Keywords=\ProvidesFile,\ProvidesPackage,\RequirePackage,\RequirePackageWithOptions,\Roman,\SetMathAlphabet,\SetSymbolFont,\TeX
+Keywords=\TextSymbolUnavailable,\UseTextAccent,\UseTextSymbol,\addcontentsline,\addpenalty,\addtocontents,\addtoversion,\addvspace,\afterassignment,\allocationnumber,\allowbreak
+Keywords=\alph,\arrayrulewidth,\arraystretch,\baselinestretch,\bezier,\bfdefault,\bfseries,\bibcite,\bibliography,\bibliographystyle,\big,\bigbreak,\bigg,\bigskip
+Keywords=\bigskipamount,\bigskipamount,\bmod,\boldmath,\buildrel,\cases,\catcode,\centering,\chardef,\cleardoublepage,\contentsline,\countdef
+Keywords=\cr,\csname,\depth,\discretionary,\displaymath,\dospecials,\dotfill,\encodingdefault,\endcsname,\everycr,\expandafter,\expandafter,\extracolsep
+Keywords=\familydefault,\familydefault,\fbox,\filbreak,\flushleft,\flushright,\fmtname,\fmtversion,\fontencoding,\fontfamily,\fontseries,\fontshape,\footnotemark,\footnoterule,\footnotetext,\frac
+Keywords=\frenchspacing,\fussy,\futurelet,\global,\glossary,\halign,\height,\hphantom,\ifinner,\immediate,\include,\includeonly,\itdefault,\iterate,\kern
+Keywords=\lastskip,\leadsto,\leavevmode,\lefteqn,\leftline,\leftmark,\let,\lhd,\liminf,\lineskip,\lower,\lowercase,\makeatletter,\makeatother,\makeglossary
+Keywords=\makeindex,\marginpar,\markboth,\markright,\mathclose,\mathop,\mathopen,\mathrel,\mathstrut,\mddefault,\medbreak,\medmuskip,\medskip,\mho,\minipage,\mskip
+Keywords=\multispan,\narrower,\negthinspace,\newfont,\newhelp,\newif,\newinsert,\newlabel,\newlanguage,\newline,\newmathalphabet,\newmuskip,\newskip,\newtoks,\nocite
+Keywords=\nocorrlist,\noexpand,\nointerlineskip,\nolimits,\nonfrenchspacing,\nonumber,\normalbaselines,\normallineskip,\normalmarginpar,\null,\numberline,\obeylines
+Keywords=\obeyspaces,\offinterlineskip,\onecolumn,\openup,\pagenumberin,\parbox,\penalty,\phantom,\pmod,\protect,\providecommand,\raggedbottom
+Keywords=\raggedleft,\raggedright,\refstepcounter,\relax,\removelastskip,\renewenvironment,\reversemarginpar,\rhd,\rightmark,\rlap,\rmdefault,\roman,\root,\rq,\rule
+Keywords=\scdefault,\secdef,\selectfont,\seriesdefault,\settodepth,\settoheight,\sfdefault,\shapedefault,\showhyphens,\showoutput,\showoverfull,\sldefault,\sloppy,\sloppypar,\smallbreak
+Keywords=\space,\spacefactor,\sqsubset,\stackrel,\stretch,\strut,\suppressfloats,\symbol,\tabskip,\thanks,\thefootnote,\thickmuskip,\thinmuskip,\thinspace,\today
+Keywords=\tracingfonts,\tracingoutput,\trivlist,\ttdefault,\twocolumn,\typein,\typeout,\unboldmath,\undefinedpagestyle,\underbar,\underline,\unlhd,\unrhd,\updefault
+Keywords=\usecounter,\usefont,\usepackage,\vcenter,\verb,\verbatim,\vline,\vphantom,\width,\wlog,\xdef
+End
+
+# ---------------- PLM/51 ----------------
+#
+# Syntax highlight definitions for PLM/51 (Jari Korhonen 08061999)
+#
+Name=PLM/51
+Files=plm,PLM
+OpenComment1=/*
+CloseComment1=*/
+Symbols1=.=/()+-'*<>:_
+Symbols2=(),;
+String1='
+Preprocessor=$
+NoCheckNumbers=1
+Keywords=address,and,at,aux,auxiliary,based,bit,by,byte,call,case,con,constant
+Keywords=declare,disable,do,else,enable,end,ext,external,go,goto,ida,idata
+Keywords=if,indirectly_callable,interrupt,label,lit,literally,main,minus,mod
+Keywords=not,or,plus,procedure,pub,public,register,return,structure,then
+Keywords=to,using,while,word,xor
+End
+
+# ---------------- Command Line Errors description files ----------------
+#
+Name=Command Line Errors File
+Files=cle
+EOLComment1=#
+EOLCInFirstCol1=1
+Symbols1=,=
+NoCheckNumbers=1
+Keywords=Name,Pattern,File,Line,Description,Severity,EnterDirPat,EnterDirDir
+Keywords=LeaveDir,UseInternal,End,SevError,SevWarn
+End
+
+# --------------------------------- SQL -----------------------------------
+#
+# Contributed by: Jeremy W. Murphy <jwm@amc.com.au>
+#
+Name=SQL
+Files=sql,SQL,dml,DML
+EmacsModes=sql,SQL
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=--
+#EOLCInFirstCol=1 MySQL and PostgreSQL supports it anywhere
+HexMarker=0x
+Symbols1=+-*/|&<>!=
+Symbols2=(),;
+String1="
+String2='
+Escape=\
+Keywords=action,add,all,alter,after,and,as,asc,auto_increment,between,bigint
+Keywords=bit,binary,blob,bool,both,by,cascade,char,character,change,check
+Keywords=column,columns,constraint,create,cross,current_date,current_time
+Keywords=current_timestamp,data,database,databases,date,datetime,day,day_hour
+Keywords=day_minute,day_second,dayofmonth,dayofweek,dayofyear,dec,decimal
+Keywords=default,delete,desc,describe,distinct,distinctrow,double,drop,escaped
+Keywords=enclosed,enum,explain,exists,fields,first,float,float4,float8,foreign
+Keywords=from,for,full,function,grant,group,having,hour,hour_minute,hour_second
+Keywords=ignore,in,index,infile,insert,int,integer,interval,int1,int2,int3,int4
+Keywords=int8,into,if,is,join,key,keys,last_insert_id,leading,left,like,lines
+Keywords=limit,load,lock,long,longblob,longtext,low_priority,match,mediumblob
+Keywords=mediumtext,mediumint,middleint,minute,minute_second,month,monthname
+Keywords=natural,numeric,no,not,null,on,option,optionally,or,order,outer,outfile
+Keywords=partial,password,precision,primary,procedure,processlist,privileges
+Keywords=quarter,read,real,references,rename,regexp,reverse,repeat,replace
+Keywords=restrict,returns,rlike,second,select,set,show,smallint,soname
+Keywords=sql_big_tables,sql_big_selects,sql_select_limit,sql_low_priority_updates
+Keywords=sql_log_off,sql_log_update,straight_join,starting,status,string,table
+Keywords=tables,terminated,text,time,timestamp,tinyblob,tinytext,tinyint
+Keywords=trailing,to,use,using,unique,unlock,unsigned,update,usage,values
+Keywords=varchar,variables,varying,varbinary,with,write,where,year,year_month
+Keywords=zerofill,sequence,begin,end,transaction,boolean
+Keywords=trigger,synonym,commit,varchar2,before,tablespace,then,number
+End
+
+# ---------------------------- Objective C ---------------------------------
+#
+# This are based on C/C++ definitions.
+# Contributed by: Beni Cherniavsky <cben@crosswinds.net>
+#
+Name=ObjC
+Files=m
+UseInternal=0
+Case=1
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+HexMarker=0x
+Symbols1=(){}[],;
+Symbols2=!&*+-./:<=>?^|~
+String1="
+String2='
+CanStartAName=@
+Escape=\
+Preprocessor=#
+PMacros=cpmacros.pmc
+# Keywords taken from C/C++ with anything I knew as C++ words stripped
+Keywords=asm,auto,break,case,char,const,continue,default,delete
+Keywords=do,double,else,enum,extern,far,float,for,goto
+Keywords=huge,if,inline,int,long,near,
+Keywords=register,return,short,signed,sizeof,static,struct,switch
+Keywords=typedef,union,unsigned,void,volatile,while
+# ObjC Keywords
+Keywords=id,Object,class,Class,@interface,@end,@class,@implementation,
+Keywords=@private,@protected,@public,SEL,@selector,self,super
+End
+
+# --------------------------------- PDP11 asm -------------------------------
+#
+# Contributed by: Beni Cherniavsky <cben@crosswinds.net>
+#
+Name=PDP11 asm
+Files=s11
+EOLComment1=;
+Escape=\
+AllowedInsideNames=$.?_-
+CanStartAName=.
+Symbols1=@#(),:=
+Symbols2=!-+`*/%<>&^|
+String1=<>
+NoCheckNumbers=1
+Keywords=adc,adcb,add,ash,ashc,asl,aslb,asr,asrb,bcc,bcs,beq,bge,bgt
+Keywords=bhi,bhis,bic,bicb,bis,bisb,bit,bitb,ble,blo,blos,blt,bmi
+Keywords=bne,bpl,bpt,br,bvc,bvs,clr,clrb,c,ccc,clc,cln,clv,clz,cmp
+Keywords=cmpb,com,comb,dec,decb,div,emt,halt,inc,incb,iot,jmp,jsr
+Keywords=mark,mfps,mtps,mov,movb,mul,neg,negb,,nop,reset,rol,rolb
+Keywords=ror,rorb,rti,rts,rtt,sbc,sbcb,s,scc,sec,sen,sev,sez,sob,spl
+Keywords=sub,swab,sxt,trap,tst,tstb,wait,xor
+#Registers
+Keywords=r0,r1,r2,r3,r4,r5,r6,sp,r7,pc
+#Floating Point
+Keywords=cfcc,setf,seti,setd,setl,ldfps,stfps,clrf,tstf
+Keywords=absf,negf,mulf,modf,addf,movf,subf,cmpf,divf
+Keywords=movei,movfi,movfo,movie,movif,movof
+#Directives
+Keywords=.ascii,.byte,.blkw,.bss,.even,.comm,.data,.endm,.endc
+Keywords=.endr,.globl,.if,.iff,.ift,.iftf,.iif,.include,.irp
+Keywords=.irpc,.list,.macro,.mexit,.narg,.nchr,.nolist,.align
+Keywords=.rept,.text,.word
+End
+
+# ---------------- Internationalization files ----------------
+#
+Name=Internationalization files
+Files=po
+EOLComment1=#
+EOLCInFirstCol1=1
+Symbols1=:
+String1="
+Escape=\
+NoCheckNumbers=1
+Keywords=msgid,msgstr
+End
+
+# ----------- Cascading Style Sheets version 2 -----------
+# Contributed by: S. M. Halloran <mitch@duzen.com.tr>
+#
+Name=Cascading Style Sheets v2
+Files=css,css2,cs2
+EmacsModes=css,Css,CSS
+HexMarker=#
+OpenComment1=/*
+CloseComment1=*/
+AllowedInsideNames=-
+CanStartAName=.
+String1="
+Symbols1={}[]>*=|~+()
+Symbols2=:;
+NoCheckNumbers=1
+Keywords=azimuth,background,background-attachment,background-color
+Keywords=background-image,background-position,background-repeat,border
+Keywords=border-collapse,border-color,border-spacing,border-style,border-top
+Keywords=border-right,border-bottom,border-left,border-top-color
+Keywords=border-right-color,border-bottom-color,border-left-color
+Keywords=border-top-style,border-right-style,border-bottom-style
+Keywords=border-left-style,border-top-width,border-right-width
+Keywords=border-bottom-width,border-left-width,border-width,bottom,caption-side
+Keywords=clear,clip,color,content,counter-increment,counter-reset,cue
+Keywords=cue-after,cue-before,cursor,direction,display,elevation,empty-cells
+Keywords=float,font,font-family,font-size,font-size-adjust,font-stretch
+Keywords=font-style,font-variant,font-weight,height,left,letter-spacing
+Keywords=line-height,list-style,list-style-image,list-style-position
+Keywords=list-style-type,margin,margin-top,margin-right,margin-bottom
+Keywords=margin-left,marker-offset,marks,max-height,max-width,min-height
+Keywords=min-width,orphans,outline,outline-color,outline-style,outline-width
+Keywords=overflow,padding,padding-top,padding-right,padding-bottom,padding-left
+Keywords=page,page-break-after,page-break-before,page-break-inside,pause
+Keywords=pause-after,pause-before,pitch,pitch-range,play-during,position
+Keywords=quotes,richness,right,size,speak,speak-header,speak-numeral
+Keywords=speak-punctuation,speech-rate,stress,table-layout,text-align
+Keywords=text-decoration,text-indent,text-shadow,text-transform,top,unicode-bidi
+Keywords=vertical-align,visibility,voice-family,volume,white-space,widows
+Keywords=width,word-spacing,z-index
+End
+
+# ----------------- JavaScript Files -----------------
+# Contributed by: S. M. Halloran <mitch@duzen.com.tr>
+#
+Name=JavaScript
+Files=js
+Case=1
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+HexMarker=0x
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+Keywords=break,case,catch,continue,default,delete,do,else,false,finally,for
+Keywords=function,if,new,return,switch,this,throw,true,try,var,while
+End
+
+# -------------------- PostScript Files --------------------
+# Contributed by: S. M. Halloran <mitch@duzen.com.tr>
+# Contains all reserved word to PostScript Language Level 3
+#
+Name=PostScript
+Files=ps
+Case=1
+EOLComment1=%
+HexMarker=<>
+Symbols1={}/
+String1=()
+Escape=\
+Keywords=pop,exch,dup,copy,index,roll,clear,count,mark,cleartomark
+Keywords=counttomark,add,div,idiv,mod,mul,sub,abs,neg,ceiling,floor
+Keywords=round,truncate,sqrt,atan,cos,sin,exp,ln,log,rand,srand,rrand
+Keywords=array,[,],length,get,put,getinterval,putinterval,astore,aload
+Keywords=forall,packedarray,setpacking,currentpacking,dict,maxlength
+Keywords=begin,end,def,load,store,undef,known,where,currentdict
+Keywords=errordict,$error,systemdict,userdict,globaldict,statusdict
+Keywords=countdictstack,dictstack,cleardictstack,string,anchorsearch
+Keywords=search,token,eq,ne,ge,gt,le,lt,and,not,or,xor,true,false,bitshift
+Keywords=exec,if,ifelse,for,repeat,loop,exit,stop,stopped,countexecstack
+Keywords=execstack,quit,start,type,cvlit,cvx,xcheck,executeonly,noaccess
+Keywords=readonly,rcheck,wcheck,cvi,cvn,cvr,cvrs,cvs,file,filter,closefile
+Keywords=read,write,readhexstring,writehexstring,readstring,writestring
+Keywords=readline,bytesavailable,flush,flushfile,resetfile,status,run
+Keywords=currentfile,deletefile,renamefile,filenameforall,setfileposition
+Keywords=fileposition,print,=,==,stack,pstack,printobject,writeobject
+Keywords=setobjectformat,currentobjectformat,defineresource,undefineresource
+Keywords=findresource,findcolorrendering,resourcestatus,resourceforall
+Keywords=save,restore,setglobal,currentglobal,gcheck,startjob,defineuserobject
+Keywords=execuserobject,undefineuserobject,UserObjects,bind,null,version,
+Keywords=realtime,usertime,languagelevel,product,revision,serialnumber
+Keywords=executive,echo,prompt,gsave,grestore,clipsave,cliprestore,grestoreall
+Keywords=initgraphics,gstate,setgstate,currentgstate,setlinewidth
+Keywords=currentlinewidth,setlinecap,currentlinecap,setlinejoin
+Keywords=currentlinejoin,setmiterlimit,currentmiterlimit,setstrokeadjust
+Keywords=currentstrokeadjust,setdash,currentdash,setcolorspace
+Keywords=currentcolorspace,setcolor,currentcolor,setgray,currentgray
+Keywords=setrgbcolor,currentrgbcolor,setcmykcolor,currentcymkcolor
+Keywords=sethalftone,currenthalftone,setscreen,currentscreen,setcolorscreen
+Keywords=currentcolorscreen,settransfer,currenttransfer,setcolortransfer
+Keywords=currentcolortransfer,setblackgeneration,currentblackgeneration
+Keywords=setundercolorremoval,currentundercolorremoval,setcolorrendering
+Keywords=currentcolorrendering,setflat,currentflat,setoverprint
+Keywords=currentoverprint,setsmoothness,currentsmoothness,matrix,initmatrix
+Keywords=identmatrix,defaultmatrix,currentmatrix,setmatrix,translate
+Keywords=scale,rotate,concat,concatmatrix,transform,dtransform,itransform
+Keywords=idtransform,invertmatrix,newpath,currentpoint,moveto,lineto,
+Keywords=rmoveto,rlineto,arc,arcn,arcto,curveto,rcurveto,closepath
+Keywords=flattenpath,reversepath,strokepath,ustrokepath,charpath
+Keywords=uappdend,clippath,setbbox,pathbbox,pathforall,upath,initclip,clip
+Keywords=eoclip,rectclip,ucache,erasepage,stroke,fill,eofill,rectstroke
+Keywords=rectfill,ustroke,ufill,ueofill,shfill,image,colorimage,imagemask
+Keywords=infill,ineofill,inufill,inueofill,instroke,inustroke,makepattern
+Keywords=setpattern,execform,showpage,copypage,setpagedevice
+Keywords=currentpagedevice,nulldevice,definefont,composefont,undefinefont
+Keywords=findfont,scalefont,makefont,setfont,rootfont,currentfont,selectfont
+Keywords=show,ashow,widthshow,awidthsho,xshow,xyshow,yshow,glyphshow
+Keywords=stringwidth,cshow,kshow,FontDirectory,GlobalFontDirectory
+Keywords=StandardEncoding,ISOLatin1Encoding,findencoding,setcachedevice
+Keywords=setcachedevice2,setcharwidth,setsystemparams,currentsystemparams
+Keywords=currentuserparams,setuserparams,setdevparams,currentdevparams
+Keywords=vmreclaim,setvmthreshold,vmstatus,cachestatus,setcachelimit
+Keywords=setcacheparams,currentcacheparams,setucacheparams,ucachestatus
+Keywords=configurationerror,dictfull,dictstackoverflow,dictstackunderflow
+Keywords=execstackoverflow,handleerror,interrupt,invalidaccess,invalidexit
+Keywords=invalidfileaccess,invalidfont,ioerror,limitcheck,nocurrentpoint
+Keywords=rangecheck,stackoverflow,stackunderflow,syntaxerror,timeout
+Keywords=typecheck,undefined,undefinedfilename,undefineresource
+Keywords=undefineresult,unmatchedmark,unregistered,VMerror
+Keywords=[,],<<,>>
+End
+
+# ---------------------- Fortran ----------------------
+# Contributed by: Martijn Versteegh <m.versteegh@hccnet.nl>.
+#
+Name=Fortran
+Files=F,f
+Case=0
+EOLComment1=c
+EOLCInFirstCol1=1
+EOLComment2=!
+Symbols1=+-/*=
+Symbols2=(){}[];
+String1="
+String2='
+NoChecknumbers=1
+Escape=\
+Keywords=common,integer,real,logical,character,double,precision,implicit,equivalence,kind
+Keywords=subroutine,parameter,program,include,save,intrinsic
+#flow control
+Keywords=do,end,stop,if,then,else,endif,elseif,goto,continue,call,return,select, case
+#file handling
+Keywords=read,write,format,rewind,open,close,print
+End
+#---------- end of fortran shl definition -----------------------
+
+# --------------------------------- Lua -----------------------------------
+# Contributed by: David A. Capello <dacap@users.sourceforge.net>.
+#
+Name=Lua
+Files=lua
+EOLComment1=--
+HexMarker=
+Symbols1=+-*/<=>.:%^~
+Symbols2=(){}[],;
+String1="
+String2='
+Keywords=do,end,while,repeat,until,if,then,elseif,else
+Keywords=return,break,for,in,function,local,and,or,not
+End
+
+#----------------------- Fasm V1.51 (Tomasz Grysztar) -------------------------
+#--------------- Website: http://flatassembler.net/ -----------------
+# Contributed by: "Matt C." <talktomatt@egl.net>
+#
+Name=Flat Assembler
+Files=.asm,.inc
+EOLComment1=;
+HexMarker=$
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+Preprocessor=#
+Preprocessor2=%
+# INTEL General Purpose instructions
+Keywords=aaa,aad,aam,aas,adc,add,and,arpl,bound,bsf,bsr,bswap,bt,btc
+Keywords=btr,bts,call,cbw,cdq,clc,cld,cli,clts,cmc,cmova,cmovae,cmovb
+Keywords=cmovbe,cmovc,cmovno,cmovnp,cmovns,cmovnz,cmove,cmovg,cmovge
+Keywords=cmovl,cmovle,cmovo,cmovp,cmovpe,cmovpo,cmovna,cmovnae,cmovnb
+Keywords=cmovnbe,cmovnc,cmovs,cmovz,cmovne,cmovng,cmovnge,cmovnl
+Keywords=cmovnle,cmp,cmps,cmpsb,cmpsw,cmpsd,cmpxchg,cmpxchg8b
+Keywords=cpuid,cwd,cwde,daa,das,dec,div,enter,hlt,idiv,imul,in,inc
+Keywords=ins,int,into,invd,invlpg,iret,iretd,ja,jae,jb,jbe,jc,jcxz,jecxz
+Keywords=je,jge,jg,jl,jle,jna,jnae,jnb,jnbe,jnc,jne,jng,jnge,jnl,jnle
+Keywords=jno,jnp,jns,jnz,jo,jp,jpe,jpo,js,jz,jmp,lahf,lar,lds,lea,leave
+Keywords=les,lfs.lgdt,lgs,lidt,lldt,lmsw,lock,lods,lodsb,lodsw,lodsd
+Keywords=loop,loopz,loope,loopnz,loopne,lsl,lss,ltr,mov,movs,movsb,movsw
+Keywords=movsd,movsx,movzx,mul,neg,nop,not,or,out,outs,pop,popa,popad
+Keywords=popf,popfd,push,pusha,pushad,pushf,pushfd,rcl,rcr,rdmsr,rdpmc
+Keywords=rdtsc,rep,ret,rol,ror,rsm,sahf,sal,sar,sbb,scas,scasb,scasw
+Keywords=scasd,seta,setae,setb,setbe,setc,sete,setg,setge,setl,setle
+Keywords=setna,setnae,setnb,setnbe,setnc,setne,setng,setnge,setnl,setnle
+Keywords=setno,setnp,setns,setnz,seto,setp,setpe,setpo,sets,setz,sgdt
+Keywords=shl,shld,shr,shrd,sidt,sldt,smsw,stc,std,sti,stos,stosb,stosw
+Keywords=stosd,str,sub,test,ud2,verr,verw,wait,wbinvd,wrmsr,xadd,xchg
+Keywords=xlat,xlatb,xor
+# INTEL General FPU Instructions
+Keywords=f2xm1,fabs,fadd,faddp,fbld,fbstp,fchs,fclex,fcmovb,fcmove
+Keywords=fcmovbe,fcmovu,fcmovnb,fcmovnbe,fcmovnu,fcom,fcomp,fcompp
+Keywords=fcomi,fcomip,fcos,fdecstp,fdiv,fdivp,fdivr,fdivrp,ffree,fiadd
+Keywords=ficom,ficomp,fidiv,fidivr,fild,fimul,fincstp,finit,fist,fistp
+Keywords=fisub,fisubr,fld,fld1,fldcw,fldenv,fldl2e,fldl2t,fldlg2,fldln2
+Keywords=fldpi,fldz,fmul,fmulp,fnop,fpatan,fprem,fprem1,fptan,frndint
+Keywords=frstor,fsave,fscale,fsin,fsincos,fsqrt,fst,fstcw,fstenv,fstp
+Keywords=fstsw,fsub,fsubp,fsubr,fsubrp,fist,fucom,fucomp,fucompp,fucomi
+Keywords=fucomip,fxam,fxch,fxtract,fyl2x,fyl2xp1,fwait,ftst
+# INTEL MMX instructions
+Keywords=emms,movd,movq,packssdw,packsswb,packuswb,padd,padds,paddus,pand
+Keywords=pandn,pcmpeq,pcmpgt,pmadd,pmulh,pmull,por,psll,psra,psrl,psub
+# INTEL Pentium 6 Instructions
+Keywords=psubs,psubus,punpckh,punpckh,punpckl,pxor,fxrstor,fxsave,sysenter
+Keywords=sysexit
+# INTEL SSE floating point instructions
+Keywords=addps,addss,andnps,andps,cmpps,cmpss,comiss,cvtpi2ps,cvtps2pi
+Keywords=cvtsi2ss,cvtss2si,cvttps2pi,cvttss2si,divps,divss,ldmxcsr,maxps
+Keywords=maxss,minps,minss,movaps,movhlps,movhps,movlhps,movlps,movmskps
+Keywords=movss,movups,mulps,mulss,orps,rcpps,rcpss,rsqrtps,rsqrtss,shufps
+Keywords=sqrtps,sqrtss,stmscsr,subps,subss,ucomiss,unpckhps,unpcklps,xorps
+# INTEL SSE Integer Instructions (AMD 3dNOW! MMX EXTENSION Instructions)
+Keywords=pavgb,pavgw,pextrw,pinsrw,pmaxsw,pmaxub,pminsw,pminub,pmovmskb
+Keywords=pmulhuw,psadbw,pshufw,maskmovq,movntps,movntq,prefetch0,prefetch1
+Keywords=prefetch2,prefetchnta,sfence
+# INTEL SSE2 Floating Point Instructions
+Keywords=addpd,addsd,andnpd,andpd,cmppd,cmpsd,comisd,cvtpi2pd,cvtpd2pi
+Keywords=cvtsi2sd,cvtsd2si,cvttpd2pi,cvttsd2si,cvtpd2ps,cvtps2pd,cvtsd2ss
+Keywords=cvtss2sd,cvtpd2dq,cvttpd2dq,cvtdq2pd,cvtps2dq,cvtps2dq,cvtdq2ps
+Keywords=divpd,divsd,maxpd,maxsd,minpd,minsd,movapd,movhpd,movlpd,movmskpd
+Keywords=movsd,movupd,mulpd,mulsd,orpd,shufpd,sqrtpd,sqrtsd,subpd,subsd
+Keywords=ucomisd,unpckhpd,unpcklpd,xorpd
+# INTEL SSE2 Integer Instructions
+Keywords=movdqa,movdqu,movq2dq,movdq2q,paddq,pavgb,pavgw,pextw,pinsw
+Keywords=pmaxsw,pmaxub,pminsw,pminub,pmovmskb,pmuludq,por,psadbw,pshuflw
+Keywords=pshufhw,pshufd,pslldq,punpckhqdq,punpcklqdq
+# INTEL Cacheability Instructions
+Keywords=maskmovdqu,clflush,movntpd,movntdq,movnti,pause,lfence,mfence
+# !!! INTEL New Prescott Instructions !!!
+Keywords=addsubpd,addsubps,fisttp,haddpd,haddps,hsubpd,hsubps,lddqu,monitor
+Keywords=movddup,movshdup,movsldup,mwait
+# AMD 3dNOW! Instructions
+Keywords=pavgusb,pfadd,pfsub,pfsubr,pfacc,pfcmpge,pcfcmpgt,pfcmpeq,pfmin
+Keywords=pfmax,pi2fd,pf2id,pfrcp,pfrsqrt,pfmul,pfrcpit1,pfrsqit1,pfrcpit2
+Keywords=pmulhrw,femms,prefetch,prefetchw
+# AMD 3dNOW! DSP Instructions
+Keywords=pf2iw,pfnacc,pfpnacc,pi2fw,pswapd
+# !!! AMD New AMD 64 instructions !!!
+Keywords=cdqe,cdwe,cmpsq,cdo,iretq,jrcxz,lodsq,movsq,movsxd,popfq,pushfq
+Keywords=scasq,stosq,swapgs
+# INTEL and AMD Cpu Registers, syntax operators
+Keywords=ah,al,bh,bl,ch,cl,dh,dl
+Keywords=ax,bx,cx,dx,di,si,bp,sp
+Keywords=eax,ebx,ecx,edx,esi,edi,ebp,esp
+Keywords=cs,ss,ds,es,fs,gs
+Keywords=cr0,cr2,cr3,cr4,cr8
+Keywords=dr0,dr1,dr2,dr3,dr6,dr7
+Keywords=tr3,tr4,tr5,tr6,tr7
+Keywords=xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7
+Keywords=mm0,mm1,mm2,mm3,mm4,mm5,mm6,mm7
+Keywords=st0,st1,st2,st3,st4,st5,st6,st7
+# !!! AMD LONG MODE [64-Bit,32-Bit,16-Bit] EXTENDED REGISTERS !!!
+Keywords=rax,rbx,rcx,rdx,rsi,rdi,rbp,rsp
+Keywords=r8w,r9w,r10w,r11w,r12w,r13w,r14w,r15w
+Keywords=r8d,r9d,r10d,r11d,r12d,r13d,r14d,r15d
+Keywords=r8,r9,r10,r11,r12,r13,r14,r15
+Keywords=xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15
+# FASM ASSEMBLER DIRECTIVES AND OPERATIONS
+Keywords=byte,word,dword,pword,qword,tword,dqword,use16,use32,binary,pe,gui,native
+Keywords=mod,rva,eq,equ,times,file,db,dw,dd,dp,dq,dt,du,rb,rw,rd,rp,rf,rq,rt
+Keywords=label,virual,at,eqtype,end,macro,eq,if,in,else,local,forward,reverse
+Keywords=common,invoke,struc,defined,purge,org,format,segment,section,entry
+Keywords=stack,used,heap,data,load,repeat,display,align,equ,code,readable,writeable
+Keywords=executable,shareable,discardable,notpageable,export,import,resource,fixups
+Keywords=extrn,public,align,coff,elf
+End
+
+#---------------------------------- PHP -------------------------------------
+# Contributed by: Richard Vrijhof <R.J.Vrijhof@bigfoot.com>.
+#
+Name=PHP
+Files=php,phtm,phtml
+EOLComment1=//
+EOLComment2=#
+HexMarker=0x
+Symbols1=!&*/+-:<=>?^|$~@\
+Symbols2=(){}[],;
+Escape=\
+EscapeAnywhere=1
+String1="
+String2='
+String3=`
+OpenComment1=/*
+CloseComment1=*/
+#Preload
+# Pre-defined Variables
+Keywords=_SERVER,HTTP_SERVER_VARS,_ENV,HTTP_ENV_VARS,_COOKIE
+Keywords=HTTP_COOKIE_VARS,_GET,HTTP_GET_VARS,_POST,HTTP_POST_VARS
+Keywords=_FILES,HTTP_POST_FILES,_REQUEST,_SESSION,HTTP_SESSION_VARS
+Keywords=GLOBALS
+# $_SERVER and/or $HTTP_SERVER_VARS Elements
+Keywords=PHP_SELF,argv,argc,GATEWAY_INTERFACE,SERVER_NAME,SERVER_SOFTWARE
+Keywords=SERVER_PROTOCOL,REQUEST_METHOD,QUERY_STRING,DOCUMENT_ROOT
+Keywords=HTTP_ACCEPT,HTTP_ACCEPT_CHARSET,HTTP_ACCEPT_ENCODING
+Keywords=HTTP_ACCEPT_LANGUAGE,HTTP_CONNECTION,HTTP_HOST,HTTP_REFERER
+Keywords=HTTP_USER_AGENT,REMOTE_ADDR,REMOTE_PORT,SCRIPT_FILENAME,SERVER_ADMIN
+Keywords=SERVER_PORT,SERVER_SIGNATURE,PATH_TRANSLATED,SCRIPT_NAME,REQUEST_URI
+############################
+# Pre-defined Classes
+# Standard Defined Classes
+Keywords=Directory,stdClass
+# Ming Defined Classes
+Keywords=swfshape,swffill,swfgradient,swfbitmap,swftext,swftextfield,swffont
+Keywords=swfdisplayitem,swfmovie,swfbutton,swfaction,swfmorph,swfsprite
+# Oracle 8 Defined Classes
+Keywords=OCI-Lob,OCI-Collection
+# qtdom Defined Classes
+Keywords=QDomDocument,QDomNode
+############################
+# Pre-defined Constants
+# Core Pre-defined Constants
+Keywords=__FILE__,__LINE__,NULL,TRUE,FALSE,PHP_VERSION,PHP_OS
+Keywords=DEFAULT_INCLUDE_PATH,PEAR_INSTALL_DIR,PEAR_EXTENSION_DIR
+Keywords=PHP_EXTENSION_DIR,PHP_BINDIR,PHP_LIBDIR,PHP_DATADIR,PHP_SYSCONFDIR
+Keywords=PHP_LOCALSTATEDIR,PHP_CONFIG_FILE_PATH,PHP_OUTPUT_HANDLER_START
+Keywords=PHP_OUTPUT_HANDLER_CONT,PHP_OUTPUT_HANDLER_END,E_ERROR,E_WARNING
+Keywords=E_PARSE,E_NOTICE,E_CORE_ERROR,E_CORE_WARNING,E_COMPILE_ERROR
+Keywords=E_COMPILE_WARNING,E_USER_ERROR,E_USER_WARNING,E_USER_NOTICE,E_ALL
+# Pre-defined Constants for Standard Functions
+Keywords=EXTR_OVERWRITE,EXTR_SKIP,EXTR_PREFIX_SAME,EXTR_PREFIX_ALL
+Keywords=EXTR_PREFIX_INVALID,EXTR_PREFIX_IF_EXISTS,EXTR_IF_EXISTS,SORT_ASC
+Keywords=SORT_DESC,SORT_REGULAR,SORT_NUMERIC,SORT_STRING,CASE_LOWER
+Keywords=CASE_UPPER,COUNT_NORMAL,COUNT_RECURSIVE,ASSERT_ACTIVE
+Keywords=ASSERT_CALLBACK,ASSERT_BAIL,ASSERT_WARNING,ASSERT_QUIET_EVAL
+Keywords=CONNECTION_ABORTED,CONNECTION_NORMAL,CONNECTION_TIMEOUT,INI_USER
+Keywords=INI_PERDIR,INI_SYSTEM,INI_ALL,M_E,M_LOG2E,M_LOG10E,M_LN2,M_LN10,M_PI
+Keywords=M_PI_2,M_PI_4,M_1_PI,M_2_PI,M_2_SQRTPI,M_SQRT2,M_SQRT1_2
+Keywords=CRYPT_SALT_LENGTH,CRYPT_STD_DES,CRYPT_EXT_DES,CRYPT_MD5
+Keywords=CRYPT_BLOWFISH,DIRECTORY_SEPARATOR,SEEK_SET,SEEK_CUR,SEEK_END
+Keywords=LOCK_SH,LOCK_EX,LOCK_UN,LOCK_NB,HTML_SPECIALCHARS,HTML_ENTITIES
+Keywords=ENT_COMPAT,ENT_QUOTES,ENT_NOQUOTES,INFO_GENERAL,INFO_CREDITS
+Keywords=INFO_CONFIGURATION,INFO_MODULES,INFO_ENVIRONMENT,INFO_VARIABLES
+Keywords=INFO_LICENSE,INFO_ALL,CREDITS_GROUP,CREDITS_GENERAL,CREDITS_SAPI
+Keywords=CREDITS_MODULES,CREDITS_DOCS,CREDITS_FULLPAGE,CREDITS_QA,CREDITS_ALL
+Keywords=STR_PAD_LEFT,STR_PAD_RIGHT,STR_PAD_BOTH,PATHINFO_DIRNAME
+Keywords=PATHINFO_BASENAME,PATHINFO_EXTENSION,CHAR_MAX,LC_CTYPE,LC_NUMERIC
+Keywords=LC_TIME,LC_COLLATE,LC_MONETARY,LC_ALL,LC_MESSAGES,ABDAY_1,ABDAY_2
+Keywords=ABDAY_3,ABDAY_4,ABDAY_5,ABDAY_6,ABDAY_7,DAY_1,DAY_2,DAY_3,DAY_4
+Keywords=DAY_5,DAY_6,DAY_7,ABMON_1,ABMON_2,ABMON_3,ABMON_4,ABMON_5,ABMON_6
+Keywords=ABMON_7,ABMON_8,ABMON_9,ABMON_10,ABMON_11,ABMON_12,MON_1,MON_2,MON_3
+Keywords=MON_4,MON_5,MON_6,MON_7,MON_8,MON_9,MON_10,MON_11,MON_12,AM_STR
+Keywords=PM_STR,D_T_FMT,D_FMT,T_FMT,T_FMT_AMPM,ERA,ERA_YEAR,ERA_D_T_FMT
+Keywords=ERA_D_FMT,ERA_T_FMT,ALT_DIGITS,INT_CURR_SYMBOL,CURRENCY_SYMBOL
+Keywords=CRNCYSTR,MON_DECIMAL_POINT,MON_THOUSANDS_SEP,MON_GROUPING
+Keywords=POSITIVE_SIGN,NEGATIVE_SIGN,INT_FRAC_DIGITS,FRAC_DIGITS
+Keywords=P_CS_PRECEDES,P_SEP_BY_SPACE,N_CS_PRECEDES,N_SEP_BY_SPACE
+Keywords=P_SIGN_POSN,N_SIGN_POSN,DECIMAL_POINT,RADIXCHAR,THOUSANDS_SEP,
+Keywords=THOUSEP,GROUPING,YESEXPR,NOEXPR,YESSTR,NOSTR,CODESET,LOG_EMERG
+Keywords=LOG_ALERT,LOG_CRIT,LOG_ERR,LOG_WARNING,LOG_NOTICE,LOG_INFO,LOG_DEBUG
+Keywords=LOG_KERN,LOG_USER,LOG_MAIL,LOG_DAEMON,LOG_AUTH,LOG_SYSLOG,LOG_LPR
+Keywords=LOG_NEWS,LOG_UUCP,LOG_CRON,LOG_AUTHPRIV,LOG_LOCAL0,LOG_LOCAL1
+Keywords=LOG_LOCAL2,LOG_LOCAL3,LOG_LOCAL4,LOG_LOCAL5,LOG_LOCAL6,LOG_LOCAL7
+Keywords=LOG_PID,LOG_CONS,LOG_ODELAY,LOG_NDELAY,LOG_NOWAIT,LOG_PERROR
+# Pre-defined Constants for Array Function array_change_key_case()
+Keywords=CASE_UPPER,CASE_LOWER
+# Pre-defined Constants for Calendar Functions
+Keywords=CAL_GREGORIAN,CAL_JULIAN,CAL_JEWISH,CAL_FRENCH,CAL_NUM_CALS
+Keywords=CAL_DOW_DAYNO,CAL_DOW_SHORT,CAL_DOW_LONG,CAL_MONTH_GREGORIAN_SHORT
+Keywords=CAL_MONTH_GREGORIAN_LONG,CAL_MONTH_JULIAN_SHORT
+Keywords=CAL_MONTH_JULIAN_LONG,CAL_MONTH_JEWISH,CAL_MONTH_FRENCH
+# Pre-defined Constants for FTP Functions
+Keywords=FTP_ASCII,FTP_BINARY,FTP_TEXT,FTP_IMAGE,FTP_TIMEOUT_SEC
+# Pre-defined Constants for LDAP Functions
+Keywords=LDAP_DEREF_NEVER,LDAP_DEREF_SEARCHING,LDAP_DEREF_FINDING
+Keywords=LDAP_DEREF_ALWAYS,LDAP_OPT_DEREF,LDAP_OPT_SIZELIMIT
+Keywords=LDAP_OPT_TIMELIMIT,LDAP_OPT_PROTOCOL_VERSION,LDAP_OPT_ERROR_NUMBER
+Keywords=LDAP_OPT_REFERRALS,LDAP_OPT_RESTART,LDAP_OPT_HOST_NAME
+Keywords=LDAP_OPT_ERROR_STRING,LDAP_OPT_MATCHED_DN,LDAP_OPT_SERVER_CONTROLS
+Keywords=LDAP_OPT_CLIENT_CONTROLS,LDAP_OPT_DEBUG_LEVEL,GSLC_SSL_NO_AUTH
+Keywords=GSLC_SSL_ONEWAY_AUTH,GSLC_SSL_TWOWAY_AUTH
+# Pre-defined Constants for Mathematical Functions
+Keywords=M_PI,M_E,M_LOG2E,M_LOG10E,M_LN2,M_LN10,M_PI_2,M_PI_4,M_1_PI,M_2_PI
+Keywords=M_SQRTPI,M_2_SQRTPI,M_SQRT2,M_SQRT3,M_SQRT1_2,M_LNPI,M_EULER
+# Pre-defined Constants for MySQL Functions
+Keywords=MYSQL_ASSOC,MYSQL_BOTH,MYSQL_NUM,MYSQL_STORE_RESULT,MYSQL_USE_RESULT
+# Pre-defined Constants for ODBC Functions
+Keywords=ODBC_TYPE,ODBC_BINMODE_PASSTHRU,ODBC_BINMODE_RETURN
+Keywords=ODBC_BINMODE_CONVERT,SQL_ODBC_CURSORS,SQL_CUR_USE_DRIVER
+Keywords=SQL_CUR_USE_IF_NEEDED,SQL_CUR_USE_ODBC,SQL_CONCURRENCY
+Keywords=SQL_CONCUR_READ_ONLY,SQL_CONCUR_LOCK,SQL_CONCUR_ROWVER
+Keywords=SQL_CONCUR_VALUES,SQL_CURSOR_TYPE,SQL_CURSOR_FORWARD_ONLY
+Keywords=SQL_CURSOR_KEYSET_DRIVEN,SQL_CURSOR_DYNAMIC,SQL_CURSOR_STATIC
+Keywords=SQL_KEYSET_SIZE,SQL_CHAR,SQL_VARCHAR,SQL_LONGVARCHAR,SQL_DECIMAL
+Keywords=SQL_NUMERIC,SQL_BIT,SQL_TINYINT,SQL_SMALLINT,SQL_INTEGER,SQL_BIGINT
+Keywords=SQL_REAL,SQL_FLOAT,SQL_DOUBLE,SQL_BINARY,SQL_VARBINARY
+Keywords=SQL_LONGVARBINARY,SQL_DATE,SQL_TIME,SQL_TIMESTAMP,SQL_TYPE_DATE
+Keywords=SQL_TYPE_TIME,SQL_TYPE_TIMESTAMP,SQL_BEST_ROWID,SQL_ROWVER
+Keywords=SQL_SCOPE_CURROW,SQL_SCOPE_SESSION,SQL_NO_NULLS,SQL_NULLABLE
+Keywords=SQL_INDEX_UNIQUE,SQL_INDEX_ALL,SQL_ENSURE,SQL_QUICK
+# Pre-defined Constants for Oracle Functions
+Keywords=ORA_BIND_INOUT,ORA_BIND_IN,ORA_BIND_OUT,ORA_FETCHINTO_ASSOC
+Keywords=ORA_FETCHINTO_NULLS
+# Pre-defined Constants for Perl-compatible Regexp Functions
+Keywords=PREG_PATTERN_ORDER,PREG_SET_ORDER,PREG_SPLIT_NO_EMPTY
+Keywords=PREG_SPLIT_DELIM_CAPTURE,PREG_GREP_INVERT
+# Pre-defined Constants for PostgreSQL Functions
+Keywords=PQSQL_ASSOC,PQSQL_NUM,PQSQL_BOTH,PQSQL_CONNECTION_BAD
+Keywords=PQSQL_CONNECTION_OK,PQSQL_SEEK_SET,PQSQL_SEEK_CUR,PQSQL_SEEK_END
+Keywords=PQSQL_ESCAPE_STRING,PQSQL_ESCAPE_BYTEA,PQSQL_EMPTY_QUERY
+Keywords=PQSQL_COMMAND_OK,PQSQL_TUPLES_OK,PQSQL_COPY_OUT,PQSQL_COPY_IN
+Keywords=PQSQL_BAD_RESPONSE,PQSQL_NONFATAL_ERROR,PQSQL_FATAL_ERROR
+# Pre-defined constants for Process Control Functions
+Keywords=SIGFPE,SIGCONT,SIGKILL,SIGSTOP,SIGUSR1,SIGTSTP,SIGHUP,SIGUSR2
+Keywords=SIGTTIN,SIGINT,SIGSEGV,SIGTTOU,SIGQUIT,SIGPIPE,SIGURG,SIGILL,SIGALRM
+Keywords=SIBXCPU,SIGTRAP,SIGTERM,SIGXFSZ,SIGABRT,SIGSTKFLT,SIGVTALRM,SIGIOT
+Keywords=SIGCHLD,SIGPROF,SIGBUS,SIGCLD,SIGWINCH,SIGPOLL,SIGIO,SIGPWR,SIGSYS
+# Pre-defined Constants for Pspell Functions
+Keywords=PSPELL_FAST,PSPELL_NORMAL,PSPELL_BAD_SPELLERS,PSPELL_RUN_TOGETHER
+# Pre-defined Constants for Session Functions
+Keywords=SID
+# Pre-defined Constants for XML Functions
+Keywords=XML_ERROR_NONE,XML_ERROR_NO_MEMORY,XML_ERROR_SYNTAX
+Keywords=XML_ERROR_NO_ELEMENTS,XML_ERROR_INVALID_TOKEN
+Keywords=XML_ERROR_UNCLOSED_TOKEN,XML_ERROR_PARTIAL_CHAR
+Keywords=XML_ERROR_TAG_MISMATCH,XML_ERROR_DUPLICATE_ATTRIBUTE
+Keywords=XML_ERROR_JUNK_AFTER_DOC_ELEMENT,XML_ERROR_PARAM_ENTITY_REF
+Keywords=XML_ERROR_UNDEFINED_ENTITY,XML_ERROR_RECURSIVE_ENTITY_REF
+Keywords=XML_ERROR_ASYNC_ENTITY,XML_ERROR_BAD_CHAR_REF
+Keywords=XML_ERROR_BINARY_ENTITY_REF,XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
+Keywords=XML_ERROR_MISPLACED_XML_PI,XML_ERROR_UNKNOWN_ENCODING
+Keywords=XML_ERROR_INCORRECT_ENCODING,XML_ERROR_UNCLOSED_CDATA_SECTION
+Keywords=XML_ERROR_EXTERNAL_ENTITY_HANDLING
+# Pre-defined Constants for Zlib Functions
+Keywords=FORCE_GZIP,FORCE_DEFLATE
+############################
+# Official Keywords. Cannot be used as name for constant, class or function.
+Keywords=and,as,break,case,cfunction,class,const,continue,declare,default,die
+Keywords=do,echo,else,elseif,empty,enddeclare,endfor,endforeach,endif
+Keywords=endswitch,endwhile,eval,exit,extends,for,foreach,function,global,if
+Keywords=include,include_once,isset,list,new,old_function,print,require
+Keywords=require_once,return,static,switch,unset,use,var,while
+# Apache-specific Functions
+Keywords=apache_child_terminate,apache_lookup_uri,apache_note,apache_setenv
+Keywords=ascii2ebcdic,ebcdic2ascii,getallheaders,virtual
+# Array Functions
+Keywords=array,array_change_key_case,array_chunk,array_count_values
+Keywords=array_diff,array_fill,array_filter,array_flip,array_intersect
+Keywords=array_key_exists,array_keys,array_map,array_merge
+Keywords=array_merge_recursive,array_multisort,array_pad,array_pop,array_push
+Keywords=array_rand,array_reduce,array_reverse,array_search,array_shift
+Keywords=array_slice,array_splice,array_sum,array_unique,array_unshift
+Keywords=array_values,array_walk,arsort,asort,compact,count,current,each,end
+Keywords=extract,in_array,key,krsort,ksort,list,natcasesort,natsort,next,pos
+Keywords=prev,range,reset,rsort,shuffle,sizeof,sort,uasort,uksort,usort
+# Aspell Functions
+Keywords=aspell_check,aspell_check_raw,aspell_new,aspell_suggest
+# BCMath Arbitrary Precision Mathematics Functions
+Keywords=bcadd,bccomp,bcdiv,bcmod,bcmul,bcpow,bcscale,bcsqrt,bcsub
+# Bzip2 Compression Functions
+Keywords=bzclose,bzcompress,bzdecompress,bzerrno,bzerror,bzerrstr,bzflush
+Keywords=bzopen,bzread,bzwrite
+# Calendar Functions
+Keywords=cal_days_in_month,cal_from_jd,cal_info,cal_to_jd,easter_date
+Keywords=easter_days,FrenchToJD,GregorianToJD,JDDayOfWeek,JDMonthName
+Keywords=JDToFrench,JDToGregorian,JDToJewish,JDToJulian,jdtounix,JewishToJD
+Keywords=JulianToJD,unixtojd
+# Class/Object Functions
+Keywords=call_user_method,call_user_method_array,class_exists,get_class
+Keywords=get_class_methods,get_class_vars,get_declared_classes
+Keywords=get_object_vars,get_parent_class,is_a,is_subclass_of,method_exists
+# Date and Time Functions
+Keywords=checkdate,date,getdate,gettimeofday,gmdate,gmmktime,gmstrftime
+Keywords=localtime,microtime,mktime,strftime,strtotime,time
+# Directory Functions
+Keywords=chdir,chroot,dir,closedir,getcwd,opendir,readdir,rewinddir
+# Error Handling and Logging Functions
+Keywords=error_log,error_reporting,restore_error_handler,set_error_handler
+Keywords=trigger_error,user_error
+# Filesystem Functions
+Keywords=basename,chgrp,chmod,chown,clearstatcache,copy,delete,dirname
+Keywords=disk_free_space,disk_total_space,diskfreespace,fclose,feof,fflush
+Keywords=fgetc,fgetcsv,fgets,fgetss,file,file,file_exists,file_get_contents
+Keywords=file_get_wrapper_data,file_register_wrapper,fileatime,filectime
+Keywords=filegroup,fileinode,filemtime,fileowner,fileperms,filesize,filetype
+Keywords=flock,fopen,fpassthru,fputs,fread,fscanf,fseek,fstat,ftell,ftruncate
+Keywords=fwrite,is_dir,is_executable,is_file,is_link,is_readable
+Keywords=is_uploaded_file,is_writable,is_writeable,link,linkinfo,lstat,mkdir
+Keywords=move_uploaded_file,parse_ini_file,pathinfo,pclose,popen,readfile
+Keywords=readlink,realpath,rename,rewind,rmdir,set_file_buffer,stat,symlink
+Keywords=tempnam,tmpfile,touch,umask,unlink
+# FTP Functions
+Keywords=ftp_cdup,ftp_chdir,ftp_close,ftp_connect,ftp_delete,ftp_exec
+Keywords=ftp_fget,ftp_fput,ftp_get,ftp_get_options,ftp_login,ftp_mdtm
+Keywords=ftp_mkdir,ftp_nlist,ftp_pasv,ftp_put,ftp_pwd,ftp_quit,ftp_rawlist
+Keywords=ftp_rename,ftp_rmdir,ftp_set_option,ftp_site,ftp_size,ftp_systype
+# Function-handling Functions
+Keywords=call_user_func,call_user_func_array,create_function,func_get_arg
+Keywords=func_get_args,func_num_args,functions_exists,get_defined_functions
+Keywords=register_shutdown_function,register_tick_function
+Keywords=unregister_tick_function
+# HTTP Functions
+Keywords=header,headers_sent,setcookie
+# Image Functions
+Keywords=exif_imagetype,exif_read_date,exif_thumbnail,getimagesize,image2wbmp
+Keywords=imagealphablending,imagearc,imagechar,imagecharup,imagecolorallocate
+Keywords=imagecolorat,imagecolorclosest,imagecolorclosestalpha
+Keywords=imagecolorclosesthwb,imagecolordeallocate,imagecolorexact
+Keywords=imagecolorexactalpha,imagecolorresolve,imagecolorresolvealpha
+Keywords=imagecolorset,imagecolorsforindex,imagecolorstotal
+Keywords=imagecolortransparent,imagecopy,imagecopymerge,imagecopymergegray
+Keywords=imagecopyresampled,imagecopyresized,imagecreate,imagecreatefromgd
+Keywords=imagecreatefromgd2,imagecreatefromgd2part,imagecreatefromgif
+Keywords=imagecreatefromjpeg,imagecreatefrompng,imagecreatefromstring
+Keywords=imagecreatefromwbmp,imagecreatefromxbm,imagecreatefromxpm
+Keywords=imagecreatetruecolor,imagedashedline,imagedestroy,imageellipse
+Keywords=imagefill,imagefilledarc,imagefilledellipse,imagefilledpolygon
+Keywords=imagefilledrectangle,imagefilltoborder,imagefontheight
+Keywords=imagefontwidth,imageftbbox,imagefttext,imagegammacorrect,imagegd
+Keywords=imagegd2,imagegif,imageinterlace,imagejpeg,imageline,imageloadfont
+Keywords=imagepalettecopy,imagepng,imagepolygon,imagepsbbox,ImagePSCopyFont
+Keywords=imagepsencodefont,imagepsextendfont,imagepsfreefont,imagepsloadfont
+Keywords=imagepsslantfont,imagepstext,imagerectangle,imagesetbrush
+Keywords=imagesetpixel,imagesetstyle,imagesetthickness,imagesettile
+Keywords=imagestring,imagestringup,imagesx,imagesy,imagetruecolortopalette
+Keywords=imagettfbbox,imagettftext,imagetypes,imagewbmp,iptcembed,jpeg2wbmp
+Keywords=png2wbmp,read_exif_data
+# LDAP Functions
+Keywords=ldap_8859_to_t61,ldap_add,ldap_bind,ldap_close,ldap_compare
+Keywords=ldap_connect,ldap_count_entries,ldap_delete,ldap_dn2ufn,ldap_err2str
+Keywords=ldap_errno,ldap_error,ldap_explode_dn,ldap_first_attribute
+Keywords=ldap_first_entry,ldap_first_reference,ldap_free_result
+Keywords=ldap_get_attributes,ldap_get_dn,ldap_get_entries,ldap_get_option
+Keywords=ldap_get_values,ldap_get_values_len,ldap_list,ldap_mod_add
+Keywords=ldap_mod_del,ldap_mod_replace,ldap_modify,ldap_next_attribute
+Keywords=ldap_next_entry,ldap_next_reference,ldap_parse_reference
+Keywords=ldap_parse_result,ldap_read,ldap_rename,ldap_search,ldap_set_option
+Keywords=ldap_set_rebind_proc,ldap_sort,ldap_start_tls,ldap_t61_to_8859
+Keywords=ldap_unbind
+# Mail Functions
+Keywords=ezmlm_hash,mail
+# Mathematical Functions
+Keywords=abs,acos,acosh,asin,asinh,atan,atan2,atanh,base_convert,bindec,ceil
+Keywords=cos,cosh,decbin,dechex,decoct,deg2rad,exp,expm1,floor,getrandmax
+Keywords=hexdec,hypot,is_finite,is_infinite,is_nan,log_value,log,log10,log1p
+Keywords=max,min,mt_getrandmax,mt_rand,mt_srand,number_format,octdec,pi,pow
+Keywords=rad2deg,rand,round,sin,sinh,sqrt,srand,tan,tanh
+# Miscellaneous Functions
+Keywords=connection_aborted,connection_status,connection_timeout,constant
+Keywords=define,defined,eval,get_browser,highlight_file,highlight_string
+Keywords=ignore_user_abort,iptcparse,leak,pack,show_source,sleep,uniqid
+Keywords=unpack,usleep
+# MySQL Functions
+Keywords=mysql_affected_rows,mysql_change_user,mysql_character_set_name
+Keywords=mysql_close,mysql_connect,mysql_create_db,mysql_data_seek
+Keywords=mysql_db_name,mysql_db_query,mysql_drop_db,mysql_errno,mysql_error
+Keywords=mysql_escape_string,mysql_fetch_array,mysql_fetch_assoc
+Keywords=mysql_fetch_field,mysql_fetch_lengths,mysql_fetch_object
+Keywords=mysql_fetch_row,mysql_field_flags,mysql_field_len,mysql_field_name
+Keywords=mysql_field_seek,mysql_field_table,mysql_field_type
+Keywords=mysql_free_result,mysql_get_client_info,mysql_get_host_info
+keywords=mysql_get_proto_info,mysql_get_server_info,mysql_info
+Keywords=mysql_insert_id,mysql_list_dbs,mysql_list_fields
+Keywords=mysql_list_processes,mysql_list_tables,mysql_num_fields
+Keywords=mysql_num_rows,mysql_pconnect,mysql_ping,mysql_query
+Keywords=mysql_real_escape_string,mysql_result,mysql_select_db,mysql_stat
+Keywords=mysql_tablename,mysql_thread_id,mysql_unbuffered_query
+# Network Functions
+Keywords=checkdnsrr,closelog,debugger_off,debugger_on,define_syslog_variables
+Keywords=fsockopen,gethostbyaddr,gethostbyname,gethostbynamel,getmxrr
+Keywords=getprotobyname,getprotobynumber,getservbyname,getservbyport,ip2long
+Keywords=long2ip,openlog,pfsockopen,socket_get_status,socket_set_blocking
+Keywords=socket_set_timeout,syslog
+# Output Control Functions
+Keywords=flush,ob_clean,ob_end_clean,ob_end_flush,ob_flush,ob_get_contents
+Keywords=ob_get_length,ob_get_level,ob_gzhandler,ob_implicit_flush,ob_start
+# PHP Options & Information Functions
+Keywords=assert,assert_options,dl,extension_loaded,get_cfg_var
+Keywords=get_current_user,get_defined_constants,get_extension_funcs
+Keywords=get_included_files,get_loaded_extensions,get_magic_quotes_gpc
+Keywords=get_magic_quotes_runtime,get_required_files,getenv,getlastmod
+Keywords=getmygid,getmyinode,getmypid,getmyuid,getrusage,ini_alter,ini_get
+Keywords=ini_get_all,ini_restore,ini_set,php_logo_guid,php_sapi_name
+Keywords=php_uname,phpcredits,phpinfo,phpversion,putenv
+Keywords=set_magic_quotes_runtime,set_time_limit,version_compare
+Keywords=zend_logo_guid,zend_version
+# PostgreSQL Functions for PHP < 4.2.0
+Keywords=pg_exec,pg_getlastoid,pg_cmdtuples,pg_numrows,pg_numfields
+Keywords=pg_fieldname,pg_fieldsize,pg_fieldnum,pg_fieldprtlen,pg_fieldisnull
+Keywords=pg_freeresult,pg_result,pg_loreadall,pg_locreate,pg_lounlink
+Keywords=pg_loopen,pg_loclose,pg_loread,pg_lowrite,pg_loimport,pg_loexport
+# PostgreSQL Functions for PHP >= 4.2.0 or unchanged in PHP >= 4.2.0
+Keywords=pg_affected_rows,pg_cancel_query,pg_client_encoding,pg_close
+Keywords=pg_connect,pg_connection_busy,pg_connection_reset
+Keywords=pg_connection_status,pg_convert,pg_copy_from,pg_copy_to,pg_dbname
+Keywords=pg_delete,pg_end_copy,pgescape,bytea,pg_escape_string,pg_fetch_array
+Keywords=pg_fetch_object,pg_fetch_result,pg_fetch_row,pg_field_is_null
+Keywords=pg_field_name,pg_field_num,pg_field_prtlen,pg_field_size
+Keywords=pg_field_type,pg_free_result,pg_get_result,pg_host,pg_insert
+Keywords=pg_last_error,pg_last_notice,pg_last_oid,pg_lo_close,pg_lo_create
+Keywords=pg_lo_export,pg_lo_import,pg_lo_open,pg_lo_read,pg_lo_read_all
+Keywords=pg_lo_seek,pg_lo_tell,pg_lo_unlink,pg_lo_write,pg_metadata
+Keywords=pg_num_fields,pg_num_rows,pg_options,pg_pconnect,pg_port,pg_put_line
+Keywords=pg_query,pg_result_error,pg_result_status,pg_select,pg_send_query
+Keywords=pg_set_client_encoding,pg_trace,pg_tty,pg_untrace,pg_update
+# Process Control Functions
+Keywords=pcntl_exec,pcntl_fork,pcntl_signal,pcntl_waitpid,pcntl_wexitstatus
+Keywords=pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig
+Keywords=pcntl_wtermsig
+# Program Execution Functions
+Keywords=escapeshellarg,escapeshellcmd,exec,passthru,proc_close,proc_open
+Keywords=shell_exec,system
+# Printer Functions
+Keywords=printer_abort,printer_close,printer_create_brush,printer_create_dc
+Keywords=printer_create_font,printer_create_pen,printer_delete_brush
+Keywords=printer_delete_dc,printer_delete_font,printer_delete_pen
+Keywords=printer_draw_bmp,printer_draw_chord,printer_draw_elipse
+Keywords=printer_draw_line,printer_draw_pie,printer_draw_rectangle
+Keywords=printer_draw_roundrect,printer_draw_text,printer_end_doc
+Keywords=printer_end_page,printer_get_option,printer_list
+Keywords=printer_logical_fontheight,printer_open,printer_select_brush
+Keywords=printer_select_font,printer_select_pen,printer_set_option
+Keywords=printer_start_doc,printer_start_page,printer_write
+# Pspell Functions
+Keywords=pspell_add_to_personal,pspell_add_to_session,pspell_check
+Keywords=pspell_clear_session,pspell_config_create,pspell_config_ignore
+Keywords=pspell_config_mode,pspell_config_personal,pspell_config_repl
+Keywords=pspell_config_runtogether,pspell_config_save_repl,pspell_new
+Keywords=pspell_new_config,pspell_new_personal,pspell_save_wordlist
+Keywords=pspell_store_replacement,pspell_suggest
+# GNU Readline Functions
+Keywords=readline,readline_add_history,readline_clear_history
+Keywords=readline_completion_function,readline_info,readline_list_history
+Keywords=readline_read_history,readline_write_history
+# GNU Recode Functions
+Keywords=recode,recode_file,recode_string
+# Regular Expression Functions (Perl-compatible)
+Keywords=preg_grep,preg_match,preg_match_all,preg_quote,preg_replace
+Keywords=preg_replace_callback,preg_split
+# Regular Expression Functions (POSIX Extended)
+Keywords=ereg,ereg_replace,eregi,eregi_replace,split,spliti,sql_regcase
+# Session Handling Functions
+Keywords=session_cache_expire,session_cache_limiter,session_decode
+Keywords=session_destroy,session_encode,session_get_cookie_params,session_id
+Keywords=session_is_registered,session_module_name,session_name
+Keywords=session_readonly,session_register,session_save_path
+Keywords=session_set_cookie_params,session_set_save_handler,session_start
+Keywords=session_unregister,session_unset,session_write_close
+# SNMP Functions
+Keywords=snmp_get_quick_print,snmp_set_quick_print,snmpget,snmprealwalk
+Keywords=snmpset,snmpwalk,snmpwalkoid
+# String Functions
+Keywords=addcslashes,addslashes,bin2hex,chop,chr,chunk_split
+Keywords=convert_cyr_string,count_chars,crc32,crypt,explode
+Keywords=get_html_translation_table,get_meta_tags,hebrev,hebrevc,htmlentities
+Keywords=htmlspecialchars,implode,join,levenshtein,localeconv,ltrim,md5
+Keywords=md5_file,metaphone,nl_langinfo,nl2br,ord,parse_str,print,printf
+Keywords=quoted_printable_decode,quotemeta,rtrim,setlocale,similar_text
+Keywords=soundex,sprintf,sscanf,str_pad,str_repeat,str_replace,str_rot13
+Keywords=strcasecmp,strchr,strcmp,strcoll,strcspn,strip_tags,stripcslashes
+Keywords=stripslashes,stristr,strlen,strnatcasecmp,strnatcmp,strncasecmp
+Keywords=strncmp,strpos,strrchr,strrev,strrpos,strspn,strstr,strtok
+Keywords=strtolower,strtoupper,strtr,substr,substr_count,substr_replace,trim
+Keywords=ucfirst,ucwords,vprintf,vsprintf,wordwrap
+# URL Functions
+Keywords=base64_decode,base64_encode,parse_url,rawurldecode,rawurlencode
+Keywords=urldecode,urlencode
+# Variable Functions
+Keywords=doubleval,empty,floatval,get_defined_vars,get_resource_type,gettype
+Keywords=import_request_variables,intval,is_array,is_bool,is_callable
+Keywords=is_double,is_float,is_int,is_integer,is_long,is_null,is_numeric
+Keywords=is_object,is_real,is_resource,is_scalar,is_string,isset,print_r
+Keywords=serialize,settype,strval,unserialize,unset,var_dump,var_export
+# XML Parser Functions
+Keywords=utf8_decode,utf8_encode,xml_error_string,xml_get_current_byte_index
+Keywords=xml_get_current_column_number,xml_get_current_line_number
+Keywords=xml_parse,xml_parser_create,xml_parser_create_ns,xml_parser_free
+Keywords=xml_parser_get_option,xml_parser_set_option
+Keywords=xml_set_character_data_handler,xml_set_default_handler
+Keywords=xml_set_element_handler,xml_set_end_namespace_decs_handler
+Keywords=xml_set_edternal_entity_ref_handler,xml_set_notation_decl_handler
+Keywords=xml_set_object,xml_set_processing_instruction_handler
+Keywords=xml_set_start_namespace_decl_handler
+Keywords=xml_set_unparsed_entity_decl_handler
+# XSLT Functions
+Keywords=xslt_create,xslt_errno,xslt_error,xslt_free,xslt_process
+Keywords=xslt_set_base,xslt_set_encoding,xslt_set_error_handler,xslt_set_log
+Keywords=xslt_set_sax_handler,xslt_set_sax_handlers,xslt_set_scheme_handler
+Keywords=xslt_set_scheme_handlers
+End
+#------------------------ end of PHP shl definition -------------------------
+
+#--------------------------------- .tvrc ------------------------------------
+# This is the format used for the Turbo Vision configuration files.
+#
+Name=TV Configuration
+NameMatch=\.?tvrc
+Case=1
+EOLComment1=#
+Symbols2==
+Symbols1={}[]
+String1="
+Escape=\
+# Sections
+Keywords=TV,DOS,Linux,QNX,X11,XTerm,Win32,WinNT,WinGr
+# Variables
+Keywords=Priority,UseVCS,UseMDA,PatchKeys,ShowCursorEver,Font10x20
+Keywords=ScreenWidth,ScreenHeight,FontWidth,FontHeight,UseSecondaryFont
+Keywords=ScreenPalette,zHideCursorWhenNoFocus,ExtProgVideoMode,VideoMode
+Keywords=DontResizeToCells,BIOSKey,UseShellScreen,InternalBusyCursor
+Keywords=VGABIOSState,SaveVGAState,DontMoveHiddenCursor,AppCP,ScrCP,InpCP
+Keywords=PollMouse,BrokenCursorShape,Unicode16,UnicodeFont,UseX11Fonts
+Keywords=X11Font,UseUpdateThread,AvoidMoire,AltKeysSetting
+End
+
+#--------------------------------- XML ------------------------------------
+# Very limited XML support
+#
+Name=XML
+Files=xml
+EmacsModes=XML,xml
+OpenComment1=<!--
+CloseComment1=-->
+AllowedInsideNames=!?
+CanStartAName=<#?
+String1="
+Escape=\
+Symbols1=</>=,;{}()[]%
+Symbols2=?+*|
+NoCheckNumbers=1
+Keywords=<?xml,version,encoding,<!DOCTYPE,<!ELEMENT,<!ATTLIST,EMPTY,CDATA
+Keywords=#IMPLIED,#REQUIRED,#PCDATA,<!ENTITY
+End
+
+# ----------------------------- Povray -----------------------------
+# Contributed by: Martijn Versteegh <m.versteegh@hccnet.nl>.
+# Based on the keyword list from v 3.5, #'s added where appropriate
+#
+Name=POV-ray
+Files=pov,inc
+EmacsModes=Povray
+Case=1
+OpenComment1=/*
+CloseComment1=*/
+CanStartAName=#
+EOLComment1=//
+HexMarker=0x
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+#Preprocessor=#
+Keywords=t,u,v,x,y,z
+Keywords=aa_level,aa_threshold,abs,absorption,accuracy,acos,acosh,adaptive,adc_bailout,agate,agate_turb,all
+Keywords=all_intersections,alpha,altitude,always_sample,ambient,ambient_light,angle,aperture,append,arc_angle
+Keywords=area_light,array,asc,ascii,asin,asinh,assumed_gamma,atan,atan2,atanh,autostop,average,b_spline
+Keywords=background,bezier_spline,bicubic_patch,black_hole,blob,blue,blur_samples,bounded_by,box
+Keywords=boxed,bozo,#break,brick,brick_size,brightness,brilliance,bump_map,bump_size,bumps,camera
+Keywords=#case,caustics,ceil,cells,charset,checker,chr,circular,clipped_by,clock,clock_delta,clock_on
+Keywords=collect,color,color_map,colour,colour_map,component,composite,concat,cone,confidence,conic_sweep
+Keywords=conserve_energy,contained_by,control0,control1,coords,cos,cosh,count,crackle,crand,cube
+Keywords=cubic,cubic_spline,cubic_wave,cutaway_textures,cylinder,cylindrical
+Keywords=#debug,#declare,#default,defined,degrees,density,density_file,density_map,dents,df3,difference
+Keywords=diffuse,dimension_size,dimensions,direction,disc,dispersion,dispersion_samples,dist_exp,distance,div,double_illuminate
+Keywords=eccentricity,#else,emission,#end,#error,error_bound,evaluate,exp,expand_thresholds,exponent,exterior,extinction
+Keywords=face_indices,facets,fade_color,fade_colour,fade_distance,fade_power,falloff,falloff_angle,false
+Keywords=#fclose,file_exists,filter,final_clock,final_frame,finish,fisheye,flatness,flip,floor,focal_point,fog
+Keywords=fog_alt,fog_offset,fog_type,#fopen,form,frame_number,frequency,fresnel,function
+Keywords=gather,gif,global_lights,global_settings,gradient,granite,gray,gray_threshold,green
+Keywords=height_field,hexagon,hf_gray_16,hierarchy,hypercomplex,hollow
+Keywords=#if,#ifdef,iff,#ifndef,image_height,image_map,image_pattern,image_width,#include,initial_clock
+Keywords=initial_frame,inside,inside_vector,int,interior,interior_texture,internal,interpolate,intersection
+Keywords=intervals,inverse,ior,irid,irid_wavelength,isosurface
+Keywords=jitter,jpeg,julia,julia_fractal
+Keywords=lambda,lathe,leopard,light_group,light_source,linear_spline,linear_sweep,ln,load_file,location
+Keywords=log,look_at,looks_like,low_error_factor,#local
+Keywords=#macro,magnet,major_radius,mandel,map_type,marble,material,material_map,matrix,max,max_extentmax_gradient
+Keywords=max_intersections,max_iteration,max_sample,max_trace,max_trace_level,media,media_attenuation
+Keywords=media_interaction,merge,mesh,mesh2,metallic,method,metric,min,min_extent,minimum_reuse,mod
+Keywords=mortar
+Keywords=natural_spline,nearest_count,no,no_bump_scale,no_image,no_reflection,no_shadow,noise_generator
+Keywords=normal,normal_indices,normal_map,normal_vectors,number_of_waves
+Keywords=object,octaves,off,offset,omega,omnimax,on,once,onion,open,orient,orientation,orthographic
+Keywords=panoramic,parallel,parametric,pass_through,pattern,perspective,pgm,phase,phong,phong_size
+Keywords=photons,pi,pigment,pigment_map,pigment_pattern,planar,plane,png,point_at,poly,poly_wave
+Keywords=polygon,pot,pow,ppm,precision,precompute,pretrace_end,pretrace_start,prism,prod,projected_through,pwr
+Keywords=quadratic_spline,quadric,quartic,quaternion,quick_color,quick_colour,quilted
+Keywords=radial,radians,radiosity,radius,rainbow,ramp_wave,rand,#range,ratio,#read,reciprocal,recursion_limit
+Keywords=red,reflection,reflection_exponent,refraction,render,repeat,rgb,rgbf,rgbft,rgbt,right,ripples
+Keywords=rotate,roughness
+Keywords=samples,save_file,scale,scallop_wave,scattering,seed,select,shadowless,sin,sine_wave,sinh,size
+Keywords=sky,sky_sphere,slice,slope,slope_map,smooth,smooth_triangle,solid,sor,spacing,specular,sphere
+Keywords=sphere_sweep,spherical,spiral1,spiral2,spline,split_union,spotlight,spotted,sqr,sqrt,statistics
+Keywords=str,strcmp,strength,strlen,strlwr,strupr,sturm,substr,sum,superellipsoid,switch,sys
+Keywords=tan,tanh,target,text,texture,texture_list,texture_map,tga,thickness,threshold,tiff,tightness
+Keywords=tile2,tiles,tolerance,toroidal,torus,trace,transform,translate,transmit,triangle,triangle_wave
+Keywords=true,ttf,turb_depth,turbulence,type
+Keywords=u_steps,ultra_wide_angle,undef,union,up,use_alpha,use_color,use_colour,use_index,utf8
+Keywords=uv_indices,uv_mapping,uv_vectors
+Keywords=v_steps,val,variance,vaxis_rotate,vcross,vdot,#version,vertex_vectors,vlength,vnormalize
+Keywords=vrotate,vstr,vturbulence
+Keywords=#warning,warp,water_level,waves,#while,width,wood,wrinkles,#write
+Keywords=yes
+End
+
+# ----------------------------- VHDL -----------------------------
+# Basic VHDL syntax
+#
+Name=VHDL
+Files=vhdl,vhd,vbe,vst
+EOLComment1=--
+String1="
+VHDLStr1=1
+String2=%
+VHDLStr2=1
+ShortString='
+VHDLShortStr=1
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+PMacros=vhdl.pmc
+VHDLNumbers=1
+NLIndent=FirstWord,if,,,AutoIndent,3
+NLIndent=FirstWord,for,,,AutoIndent,4
+NLIndent=FirstWord,else,,,AutoIndent,3
+NLIndent=FirstWord,case,,,AutoIndent,5
+NLIndent=FirstWord,when,,,AutoIndent,5
+NLIndent=FirstWord,with,,,AutoIndent,5
+NLIndent=FirstWord,while,,,AutoIndent,3
+NLIndent=FirstWord,elsif,,,AutoIndent,3
+NLIndent=FirstWord,begin,,,AutoIndent,3
+NLIndent=FirstWord,record,,,AutoIndent,3
+NLIndent=FirstWord,return,,,Unindent
+NLIndent=FirstWord,entity,,,AutoIndent,3
+NLIndent=FirstWord,component,,,AutoIndent,3
+NLIndent=FirstWord,assert,NoLastChar,;,AutoIndent,3
+NLIndent=ParBalancePos,,,,MoveAfterPar
+NLIndent=ParBalanceNeg,,,,AutoIndent,0
+NLIndent=FirstWord,port,,,AutoIndent,3
+NLIndent=FirstWord,generic,,,AutoIndent,3
+# List of reserved words (13.9)
+Keywords=abs,access,after,alias,all,and,architecture,array,assert,attribute
+Keywords=begin,block,body,buffer,bus,case,component,configuration,constant
+Keywords=disconnect,downto,else,elsif,end,entity,exit,file,for,function
+Keywords=generate,generic,group,guarded,if,impure,in,inertial,inout,is
+Keywords=label,library,linkage,literal,loop,map,mod,nand,new,next,nor,not
+Keywords=null,of,on,open,or,others,out,package,port,postponed,procedure
+Keywords=process,pure,range,record,register,reject,rem,report,return,rol
+Keywords=ror,select,severity,shared,signal,sla,sll,sra,srl,subtype,then,to
+Keywords=transport,type,unaffected,units,until,use,variable,wait,when,while
+Keywords=with,xnor,xor
+# Some words the user may want to highlight, They belong to the std and ieee
+# libraries. I think only std.standard is mandatory.
+# Libraries
+UserKeywords=std,ieee
+# Packages
+UserKeywords=textio,standard,std_logic_1164,numeric_std,numeric_bit
+# Data types
+# standard
+UserKeywords=boolean,bit,character,severity_level,natural,integer,real,time
+UserKeywords=delay_length,natural,positive,string,bit_vector,file_open_kind
+UserKeywords=file_open_status,file
+# textio
+UserKeywords=line,text,side,width
+# std_logic_1164
+UserKeywords=std_logic,std_logic_vector,std_ulogic,std_ulogic_vector,x01,x01z
+UserKeywords=ux01,ux01z
+# numeric_std
+UserKeywords=unsigned,signed
+# Enumerations
+# standard
+UserKeywords=read_mode,write_mode,append_mode,open_ok,status_error,name_error
+UserKeywords=mode_error,note,warning,error,failure,fs,ps,ns,us,ms,sec,min,hr
+UserKeywords=false,true,nul,soh,stx,etx,eot,enq,ack,bel,bs,ht,lf,vt,ff,cr,so
+UserKeywords=si,dle,dc1,dc2,dc3,dc4,nak,syn,etb,can,em,sub,esc,fsp,gsp,rsp,usp
+UserKeywords=del,c128,c129,c130,c131,c132,c133,c134,c135,c136,c137,c138,c139
+UserKeywords=c140,c141,c142,c143,c144,c145,c146,c147,c148,c149,c150,c151,c152
+UserKeywords=c153,c154,c155,c156,c157,c158,c159
+# Functions
+# standard
+UserKeywords=now
+# textio
+UserKeywords=input,output,read,readline,write,writeline
+# std_logic_1164
+UserKeywords=falling_edge,rising_edge,to_bit,to_bitvector,to_stdulogic
+UserKeywords=to_stdlogicvector,to_stdulogicvector,to_x01,to_x01z,to_ux01
+UserKeywords=to_ux01z,is_x
+# numeric_std
+UserKeywords=shift_left,shift_right,rotate_left,rotate_right,resize
+UserKeywords=to_integer,to_unsigned,to_signed,std_match,to_01,
+# Attributes
+UserKeywords=base,left,right,high,low,ascending,image,value,pos,val,succ
+UserKeywords=pred,leftof,rightof,range,reverse_range,length,delayed,stable
+UserKeywords=quiet,transaction,event,active,last_event,last_active,last_value
+UserKeywords=driving,driving_value,simple_name,instance_name
+# standard
+UserKeywords=foreign
+End
+
+#-----------------------------------Ruby---------------------------------#
+# Hacked By William E. Cullen (WECullen@comcast.net)
+# still neads some work.....Help if you can
+#
+Name=Ruby
+Files=rb
+EOLComment1=#
+EOLCInFirstCol=1
+OpenComment1= =begin
+CloseComment1= =end
+AllowedInsideNames=!?
+Symbols1=+?/.<=>^|
+Symbols2=(){}[]; /n
+String1=""
+String2='
+Keywords=BEGIN,END,alias,and,begin,break,case,class,def,defined,do,else,elsif,end,ensure,false,for,if,in,module,next,nill
+Keywords=not,or,redo,rescue,retry,return,self,super,then,true,undef,unless,until,when,while,yieldKeywords=do,else,elsif,end,ensure,false,for,if,module
+Keywords=Array,Float,Integer,String,at_exit,autoload,binding,caller,catch,chomp,chomp!,chop,chop!,eval,exec,exists
+Keywords=exit,exit!,exp!,fail,fork,format,gets,glob,global_variables,gmtime,goto,gsub,gsub!,gt,hex,import,iterator?,lamda
+Keywords=load,local_variables,loop,open,print,printf,proc,putc,puts,raise,rand,readline,readlines
+Keywords=require,select,sleep,split,sprintf,srand,sub,sub!,syscall,system,test,throw,trace_var,trap,untrace_var
+Keywords=TRUE,FALSE,NIL,STDIN,STDOUT,STDERR,ENV,ARGF,ARGV,DATA,VERSION,RUBY_RELEASE_DATE,RUBY_PLATFORM
+Keywords=ArgumentError,Array,Bignum,Class,Data,Dir,EOFError,Exception,File,Fixnum,Float,Hash,IO
+Keywords=IOError,IndexError,Integer,Interrupt,LoadError,LocalJumpError,MatchingData,Module,NameError,NilClass,NotImplementError
+Keywords=Numeric,Object,Proc,Range,Regexp,RuntimeError,SecurityError,SignalException,StandardError,String,Struct,SyntaxError
+Keywords=SystemCallError,SystemExit,SystemStackError,ThreadError,Time,TypeError,ZeroDivisionError,fatal
+Keywords=Comparable,Enumerable,Errno,FileTest,GC,Kernel,Marshal,Math,ObjectSpace,Precision,Process
+End
+#---------------------------End Ruby shl-----------------------------------#
+
+# -------------------------------- WML ------------------------------------
+#
+# Very basic WML syntax (I am learning!)
+# Contributed by Diego J. Brengi
+#
+Name=WML
+Files=wml,WML
+#Comment next line if you like to see WML keywords inside strings
+String1="
+Case=0
+#Next two lines ar usefull only if you comment "Preprocessor"
+EOLComment1=#
+EOLCInfirstcol1=1
+#For HTML Comments
+OpenComment1=<!--
+CloseComment1=-->
+CanStartAName=<
+Escape=\
+AllowedInsideNames=/-
+
+#Comment if you don't want to see comments like preprocessor instructions
+Preprocessor=#
+
+Symbols1==,;{}()[]#!
+Symbols2=%><"
+NoCheckNumbers=1
+PMacros=wmlmac.pmc
+
+SpecialSymbol=<
+SpecialSymbolCont=#
+SpecialSymbol=#
+SpecialSymbolCont=>
+
+#------------------words exctracted from /usr/bin/wmd wml_tags(7)------------------------
+Keywords=wml,include,depends,use
+
+Keywords=<add,<and,<array-add-unique,<array-concat,<array-member,<array-pop,<array-push,<array-shift
+Keywords=<array-size,<array-topvalue,<at-end-of-file,</at-end-of-file,<attributes-extract,<attributes-quote
+Keywords=<attributes-remove,<break,<bs,<capitalize,<char-offsets,<comment,</comment,<compound,</compound
+Keywords=<copy-var,<date,<debugfile,<debugging-off,<debugging-on,<debugmode,<decrement,<define-entity
+Keywords=</define-entity,<define-tag,</define-tag,<defvar,<directory-contents,<disjoin,<divert,</divert,<divide
+Keywords=<divnum,<dnl,<downcase,<dq,<eq,<exit,<expand,<file-exists,<foreach,</foreach,<frozen-dump,<function-def
+Keywords=<get-file-properties,<get-hook,<get-regexp-syntax,<get-var-once,<get-var,group,<gt,<if,<ifeq
+Keywords=<ifneq,<include,<increment,<lb,<let,<load,<lt,<match,<max,<min,<modulo,<mp4h-l10n,<mp4h-output-radix
+Keywords=<multiply,<neq,<noexpand,<nostrip,</nostrip,<not,<or,<preserve
+Keywords=<protect,</protect,<provide-tag,</provide-tag,<rb,<real-path,<restore,<return,<set-eol-comment
+Keywords=<set-hook,</set-hook,<set-quotes,<set-regexp-syntax,<set-var-verbatim,<set-var-x,</set-var-x
+Keywords=<set-var,<sort,<string-compare,<string-eq,<string-length,<string-neq,<subst-in-string,<subst-in-var
+Keywords=<substract,<substring,<suck,<symbol-info,<timer,<undef,<undivert,<unset-var,<upcase,<use,<var-case
+Keywords=<var-exists,<warning,<when,</when,<while,</while
+
+Keywords=endtag,whitespace
+End
+
+# ------------------------------- SPARC asm -------------------------------
+#
+# From the GNU opcodes library. Is that a "Reduced" instruction set? ;-)
+#
+Name=SPARC asm
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=!
+HexMarker=0x
+Symbols1=!$%&(),-./:;<>?[]
+String1="
+String2="
+AllowedInsideNames=$.
+CanStartAName=.
+Keywords=ld,lduw,ldd,ldq,ldsb,ldsh,ldstub,ldsw,ldub,lduh,ldx,lda,ldda,ldqa,ldsba
+Keywords=ldsha,ldstuba,ldswa,lduba,lduha,lduwa,ldxa,st,stw,stsw,spill,sta,stwa
+Keywords=stswa,stb,stsb,stub,stba,stsba,std,spilld,stda,sth,stsh,stha,stsha,stuha
+Keywords=stx,stxa,stq,stqa,swap,swapa,restore,rett,save,ret,retl,jmpl,done,retry
+Keywords=saved,restored,sir,flush,iflush,return,flushw,membar,stbar,prefetch
+Keywords=prefetcha,sll,sra,srl,sllx,srax,srlx,mulscc,divscc,scan,popc,clr,clrb
+Keywords=clrh,clrx,orcc,orncc,orn,tst,wr,rd,rdpr,wrpr,mov,or,bset,andn,andncc
+Keywords=bclr,cmp,sub,subcc,subx,subxcc,subccc,and,andcc,dec,deccc,inc,inccc,btst
+Keywords=neg,add,addcc,addx,addc,addccc,smul,smulcc,umul,umulcc,sdiv,sdivcc,udiv
+Keywords=udivcc,mulx,sdivx,udivx,call,b,ba,t,ta,bcc,tcc,bcs,tcs,be,te,beq,teq,bg
+Keywords=tg,bgt,tgt,bge,tge,bgeu,tgeu,bgu,tgu,bl,tl,blt,tlt,ble,tle,bleu,tleu,blu
+Keywords=tlu,bn,tn,bne,tne,bneg,tneg,bnz,tnz,bpos,tpos,bvc,tvc,bvs,tvs,bz,tz,brnz
+Keywords=brz,brgez,brlz,brlez,brgz,movrne,movre,movrgez,movrlz,movrlez,movrgz
+Keywords=movrnz,movrz,fmovrsne,fmovrse,fmovrsgez,fmovrslz,fmovrslez,fmovrsgz
+Keywords=fmovrsnz,fmovrsz,fmovrdne,fmovrde,fmovrdgez,fmovrdlz,fmovrdlez,fmovrdgz
+Keywords=fmovrdnz,fmovrdz,fmovrqne,fmovrqe,fmovrqgez,fmovrqlz,fmovrqlez,fmovrqgz
+Keywords=fmovrqnz,fmovrqz,mova,movcc,movgeu,movcs,movlu,move,movg,movge,movgu
+Keywords=movl,movle,movleu,movlg,movn,movne,movneg,movnz,movo,movpos,movu,movue
+Keywords=movug,movuge,movul,movule,movvc,movvs,movz,fmovda,fmovdcc,fmovdcs
+Keywords=fmovde,fmovdg,fmovdge,fmovdgeu,fmovdgu,fmovdl,fmovdle,fmovdleu,fmovdlg
+Keywords=fmovdlu,fmovdn,fmovdne,fmovdneg,fmovdnz,fmovdo,fmovdpos,fmovdu,fmovdue
+Keywords=fmovdug,fmovduge,fmovdul,fmovdule,fmovdvc,fmovdvs,fmovdz,fmovqa,fmovqcc
+Keywords=fmovqcs,fmovqe,fmovqg,fmovqge,fmovqgeu,fmovqgu,fmovql,fmovqle,fmovqleu
+Keywords=fmovqlg,fmovqlu,fmovqn,fmovqne,fmovqneg,fmovqnz,fmovqo,fmovqpos,fmovqu
+Keywords=fmovque,fmovqug,fmovquge,fmovqul,fmovqule,fmovqvc,fmovqvs,fmovqz,fmovsa
+Keywords=fmovscc,fmovscs,fmovse,fmovsg,fmovsge,fmovsgeu,fmovsgu,fmovsl,fmovsle
+Keywords=fmovsleu,fmovslg,fmovslu,fmovsn,fmovsne,fmovsneg,fmovsnz,fmovso,fmovspos
+Keywords=fmovsu,fmovsue,fmovsug,fmovsuge,fmovsul,fmovsule,fmovsvc,fmovsvs,fmovsz
+Keywords=fb,cb,fba,cba,fbe,cb0,fbz,fbg,cb2,fbge,cb02,fbl,cb1,fble,cb01,fblg,cb12
+Keywords=fbn,cbn,fbne,cb123,fbnz,fbo,cb012,fbu,cb3,fbue,cb03,fbug,cb23,fbuge,cb023
+Keywords=fbul,cb13,fbule,cb013,jmp,nop,set,setuw,setsw,setx,sethi,taddcc,taddcctv
+Keywords=tsubcc,tsubcctv,unimp,illtrap,xnor,xnorcc,xor,xorcc,not,btog,fdtoi,fstoi
+Keywords=fqtoi,fdtox,fstox,fqtox,fitod,fitos,fitoq,fxtod,fxtos,fxtoq,fdtoq,fdtos
+Keywords=fqtod,fqtos,fstod,fstoq,fdivd,fdivq,fdivx,fdivs,fmuld,fmulq,fmulx,fmuls
+Keywords=fdmulq,fdmulx,fsmuld,fsqrtd,fsqrtq,fsqrtx,fsqrts,fabsd,fabsq,fabsx,fabss
+Keywords=fmovd,fmovq,fmovx,fmovs,fnegd,fnegq,fnegx,fnegs,faddd,faddq,faddx,fadds
+Keywords=fsubd,fsubq,fsubx,fsubs,fcmpd,fcmped,fcmpq,fcmpeq,fcmpx,fcmpex,fcmps
+Keywords=fcmpes,cpop1,cpop2,shuffle,crdcxt,cwrcxt,cpush,cpusha,cpull,casa,casxa
+Keywords=iprefetch,signx,clruw,cas,casl,casx,casxl,shutdown,fpadd16,fpadd16s
+Keywords=fpadd32,fpadd32s,fpsub16,fpsub16s,fpsub32,fpsub32s,fpack32,fpack16
+Keywords=fpackfix,fexpand,fpmerge,fmul8x16,fmul8x16au,fmul8x16al,fmul8sux16
+Keywords=fmul8ulx16,fmuld8sux16,fmuld8ulx16,alignaddr,alignaddrl,faligndata,fzero
+Keywords=fzeros,fone,fones,fsrc1,fsrc1s,fsrc2,fsrc2s,fnot1,fnot1s,fnot2,fnot2s,for
+Keywords=fors,fnor,fnors,fand,fands,fnand,fnands,fxor,fxors,fxnor,fxnors,fornot1
+Keywords=fornot1s,fornot2,fornot2s,fandnot1,fandnot1s,fandnot2,fandnot2s,fcmpgt16
+Keywords=fcmpgt32,fcmple16,fcmple32,fcmpne16,fcmpne32,fcmpeq16,fcmpeq32,edge8
+Keywords=edge8l,edge16,edge16l,edge32,edge32l,pdist,array8,array16,array32,edge8n
+Keywords=edge8ln,edge16n,edge16ln,edge32n,edge32ln,bmask,bshuffle,siam,impdep1
+Keywords=impdep2,cbe,cbf,cbef,cbr,cber,cbfr,cbefr,cbne,cbnf,cbnef,cbnr,cbner,cbnfr
+Keywords=cbnefr,efitod,efitos,efdtoi,efstoi,efstod,efdtos,efmovs,efnegs,efabss
+Keywords=efsqrtd,efsqrts,efaddd,efadds,efsubd,efsubs,efdivd,efdivs,efmuld,efmuls
+Keywords=efsmuld,efcmpd,efcmped,efcmps,efcmpes,umac,smac,umacd,smacd,umuld,smuld
+# GAS specific
+Keywords=.abort,.ABORT,.align,.app-file,.ascii,.asciz,.balign,.byte,.comm
+Keywords=.data,.def,.desc,.dim,.double,.eject,.else,.endef,.endif,.equ
+Keywords=.extern,.file,.fill,.float,.global,.hword,.ident,.if,.include
+Keywords=.int,.irp,.irpc,.lcomm,.lflags,.line,.ln,.linkonce,.list,.long
+Keywords=.macro,.mri,.nolist,.octa,.org,.p2align,.psize,.quad,.rept
+Keywords=.sbttl,.scl,.section,.set,.short,.single,.size,.skip,.space
+Keywords=.stabd,.stabn,.stabs,.string,.tag,.text,.title,.type,.val,.word
+Keywords=.globl
+End
+
+# ------------------------------- Ch -------------------------------
+# Here are the definitions for Ch, a C/C++ interpreter used for
+# syntaxhl.shl
+# Contributed by Wayne W. Cheng <wcheng@softintegration.com>
+#
+Name=Ch
+Files=ch,chf
+EmacsModes=Ch,ch
+ShellScript=ch
+Case=1
+OpenComment1=/*
+CloseComment1=*/
+EOLComment1=//
+HexMarker=0x
+Symbols1=!&*+-./:<=>?^|~
+Symbols2=(){}[],;
+String1="
+String2='
+Escape=\
+Preprocessor=#
+PMacros=cpmacros.pmc
+Preload
+Keywords=asm,auto,bool,break,case,catch,char,class,const,continue,default
+Keywords=delete,do,double,else,enum,except,extern,false,far,finally,float,for
+Keywords=friend,goto,huge,if,inline,int,long,near,new,operator,private
+Keywords=protected,public,register,return,short,signed,sizeof,static,struct
+Keywords=switch,this,throw,true,try,typedef,typename,union,unsigned
+Keywords=using,virtual,void,volatile,while
+Keywords=foreach,__declspec,__declspe,string_t,array,complex,wchar_t
+End
+
+# -------------------------------- KICAD SCH ------------------------------------
+#
+# Basic SCH syntax for Kicad files
+# Contributed by Diego J. Brengi {Brengi at inti.gov.ar}
+#
+Name=KICAD Schematic
+Files=sch,SCH
+String1="
+CanStartAName=$#
+AllowedInsideNames=/-
+Symbols1=~":
+NoCheckNumbers=1
+Keywords=Sheet,Title,Date,Rev,Comp,Comment1,Comment2,Comment3,Comment4,Text
+Keywords=$Descr,$EndDescr,$Comp,$EndComp,$EndSCHEMATC,$Sheet,$EndSheet,Label
+Keywords=Wire,Line,Connection,NoConn,Bus,Notes,GLabel,LIBS,EELAYER,END
+Keywords=EESchema,Schematic,File,Version,UnSpc,3State,Output,Input
+UserKeywords=L,U,P,F,V,H,C,R,O,I,R,L
+End
+
+# -------------------------------- KICAD LIB DCM and STF -----------------------
+#
+# Basic .LIB, .DCM and .STF syntax for Kicad files
+# Contributed by Diego J. Brengi {Brengi at inti.gov.ar}
+#
+Name=KICAD Library
+Files=lib,LIB,dcm,DCM,stf,STF
+String1="
+EOLComment1=#
+EOLCInFirstCol=1
+AllowedInsideNames=/-
+Symbols1=~":
+CanStartAName=$
+NoCheckNumbers=1
+#For .LIB
+Keywords=EESchema-LIBRARY,Version,DRAW,ENDDRAW,ENDDEF,DEF,ALIAS,F0,F1,F2,F3,F4
+#For .DCM
+Keywords=EESchema-DOCLIB,Date,$CMP,$ENDCMP
+#For .STF
+Keywords=comp,module
+UserKeywords=A,B,C,F,H,I,L,N,O,P,R,S,T,U,V,W,X,Y
+End
+
+# -------------------------------- KICAD BRD ------------------------------------
+#
+# Basic BRD syntax for Kicad files
+# Contributed by Diego J. Brengi {Brengi at inti.gov.ar}
+#
+Name=KICAD PCB
+Files=brd,BRD,mod,MOD
+String1="
+Symbols1=="~$
+CanStartAName=$
+AllowedInsideNames=/-
+NoCheckNumbers=1
+Keywords=PCBNEW-BOARD,Version,date
+Keywords=$GENERAL,$EndGENERAL,$SHEETDESCR,$EndSHEETDESCR,$SETUP,$EndSETUP,$EQUIPOT
+Keywords=$MODULE,$EndMODULE,$PAD,$EndPAD,$SHAPE3D,$EndSHAPE3D,$BOARD,$EndBOARD,$ZONE
+Keywords=$MIREPCB,$EndMIREPCB,$EndTEXTPCB,$TEXTPCB,$DRAWSEGMENT,$EndDRAWSEGMENT
+Keywords=$TRACK,$EndTRACK,$COTATION,$EndCOTATION,$EndEQUIPOT,$EndZONE
+# $GENERAL words
+Keywords=LayerCount,Ly,Links,NoConn,Di,Ndraw,Ntrack,Nzone,Nmodule,Nnets
+#$SHEETDESCR words
+Keywords=Sheet,Title,Rev,Comp,Comment1,Comment2,Comment3,Comment4
+#$SETUP Words
+Keywords=InternalUnit,GridSize,ZoneGridSize,Layers,TrackWidth,TrackWidthHistory
+Keywords=ZoneClearence,DrawSegmWidth,EdgeSegmWidth,ViaSize,ViaDrill,ViaSizeHistory
+Keywords=TextPcbSize,EdgeModWidth,TextModSize,TextModWidth,PadSize,PadDrill
+Keywords=TrackClearence,AuxiliaryAxisOrg,TextPcbWidth
+#$EQUIPOT Words
+Keywords=Na,St
+#$MODULE, $PAD and $SHAPE3D Words
+Keywords=Po,Li,Cd,Kw,Sc,Op,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,DS,DC
+Keywords=Sh,Dr,At,Ne,Po,Of,Ro
+#$COTATION, $DRAWSEGMENT and $TEXTPCB Words
+Keywords=Sb,Sd,Sg,Ge,S1,S2,S3,S4
+Keywords=De,Te
+#For .mod files
+Keywords=PCBNEW-LibModule-V1,$INDEX,$EndINDEX,$EndLIBRARY
+End
+
+#--------------------------------- DocBook ------------------------------------
+# Very limited DocBook support
+#
+Name=DocBook (SGML)
+Files=sgml
+EmacsModes=docbook
+PMacros=docbook.pmc
+OpenComment1=<!--
+CloseComment1=-->
+AllowedInsideNames=!?=:/
+CanStartAName=<#?
+String1="
+#String2='
+Escape=\
+Symbols1=</>=,;{}()[]%
+Symbols2=?+*|
+NoCheckNumbers=1
+Keywords=<!DOCTYPE,<!ELEMENT,<!ATTLIST,EMPTY,CDATA
+Keywords=#IMPLIED,#REQUIRED,#PCDATA,<!ENTITY
+Keywords=<abbrev,<abstract,<accel,<ackno,<acronym,<action,<address
+Keywords=<affiliation,<alt,<anchor,<answer,<appendix,<appendixinfo,<application
+Keywords=<area,<areaset,<areaspec,<arg,<article,<articleinfo,<artpagenums
+Keywords=<attribution,<audiodata,<audioobject,<author,<authorblurb,<authorgroup
+Keywords=<authorinitials,<beginpage,<bibliocoverage,<bibliodiv,<biblioentry
+Keywords=<bibliography,<bibliographyinfo,<biblioid,<bibliolist,<bibliomisc
+Keywords=<bibliomixed,<bibliomset,<biblioref,<bibliorelation,<biblioset
+Keywords=<bibliosource,<blockinfo,<blockquote,<book,<bookinfo,<bridgehead
+Keywords=<callout,<calloutlist,<caption,<caution,<chapter,<chapterinfo,<citation
+Keywords=<citebiblioid,<citerefentry,<citetitle,<city,<classname,<classsynopsis
+Keywords=<classsynopsisinfo,<cmdsynopsis,<co,<code,<col,<colgroup,<collab
+Keywords=<collabname,<colophon,<colspec,<command,<computeroutput,<confdates
+Keywords=<confgroup,<confnum,<confsponsor,<conftitle,<constant,<constraint
+Keywords=<constraintdef,<constructorsynopsis,<contractnum,<contractsponsor
+Keywords=<contrib,<copyright,<coref,<corpauthor,<corpcredit,<corpname,<country
+Keywords=<database,<date,<dedication,<destructorsynopsis,<edition,<editor
+Keywords=<email,<emphasis,<entry,<entrytbl,<envar,<epigraph,<equation,<errorcode
+Keywords=<errorname,<errortext,<errortype,<example,<exceptionname,<fax
+Keywords=<fieldsynopsis,<figure,<filename,<firstname,<firstterm,<footnote
+Keywords=<footnoteref,<foreignphrase,<formalpara,<funcdef,<funcparams
+Keywords=<funcprototype,<funcsynopsis,<funcsynopsisinfo,<function,<glossary
+Keywords=<glossaryinfo,<glossdef,<glossdiv,<glossentry,<glosslist,<glosssee
+Keywords=<glossseealso,<glossterm,<graphic,<graphicco,<group,<guibutton,<guiicon
+Keywords=<guilabel,<guimenu,<guimenuitem,<guisubmenu,<hardware,<highlights
+Keywords=<holder,<honorific,<html:form,<imagedata,<imageobject,<imageobjectco
+Keywords=<important,<index,<indexdiv,<indexentry,<indexinfo,<indexterm
+Keywords=<informalequation,<informalexample,<informalfigure,<informaltable
+Keywords=<initializer,<inlineequation,<inlinegraphic,<inlinemediaobject
+Keywords=<interface,<interfacename,<invpartnumber,<isbn,<issn,<issuenum
+Keywords=<itemizedlist,<itermset,<jobtitle,<keycap,<keycode,<keycombo
+Keywords=<keysym,<keyword,<keywordset,<label,<legalnotice,<lhs,<lineage
+Keywords=<lineannotation,<link,<listitem,<literal,<literallayout,<lot,<lotentry
+Keywords=<manvolnum,<markup,<mathphrase,<medialabel,<mediaobject,<mediaobjectco
+Keywords=<member,<menuchoice,<methodname,<methodparam,<methodsynopsis,<mml:math
+Keywords=<modespec,<modifier,<mousebutton,<msg,<msgaud,<msgentry,<msgexplan
+Keywords=<msginfo,<msglevel,<msgmain,<msgorig,<msgrel,<msgset,<msgsub,<msgtext
+Keywords=<nonterminal,<note,<objectinfo,<olink,<ooclass,<ooexception,<oointerface
+Keywords=<option,<optional,<orderedlist,<orgdiv,<orgname,<otheraddr,<othercredit
+Keywords=<othername,<package,<pagenums,<para,<paramdef,<parameter,<part,<partinfo
+Keywords=<partintro,<personblurb,<personname,<phone,<phrase,<pob,<postcode
+Keywords=<preface,<prefaceinfo,<primary,<primaryie,<printhistory,<procedure
+Keywords=<production,<productionrecap,<productionset,<productname,<productnumber
+Keywords=<programlisting,<programlistingco,<prompt,<property,<pubdate,<publisher
+Keywords=<publishername,<pubsnumber,<qandadiv,<qandaentry,<qandaset,<question
+Keywords=<quote,<refclass,<refdescriptor,<refentry,<refentryinfo,<refentrytitle
+Keywords=<reference,<referenceinfo,<refmeta,<refmiscinfo,<refname,<refnamediv
+Keywords=<refpurpose,<refsect1,<refsect1info,<refsect2,<refsect2info,<refsect3
+Keywords=<refsect3info,<refsection,<refsectioninfo,<refsynopsisdiv
+Keywords=<refsynopsisdivinfo,<releaseinfo,<remark,<replaceable,<returnvalue
+Keywords=<revdescription,<revhistory,<revision,<revnumber,<revremark,<rhs,<row
+Keywords=<sbr,<screen,<screenco,<screeninfo,<screenshot,<secondary,<secondaryie
+Keywords=<sect1,<sect1info,<sect2,<sect2info,<sect3,<sect3info,<sect4,<sect4info
+Keywords=<sect5,<sect5info,<section,<sectioninfo,<see,<seealso,<seealsoie,<seeie
+Keywords=<seg,<seglistitem,<segmentedlist,<segtitle,<seriesvolnums,<set,<setindex
+Keywords=<setindexinfo,<setinfo,<sgmltag,<shortaffil,<shortcut,<sidebar
+Keywords=<sidebarinfo,<simpara,<simplelist,<simplemsgentry,<simplesect,<spanspec
+Keywords=<state,<step,<stepalternatives,<street,<structfield,<structname,<subject
+Keywords=<subjectset,<subjectterm,<subscript,<substeps,<subtitle,<superscript
+Keywords=<surname,<svg:svg,<symbol,<synopfragment,<synopfragmentref,<synopsis
+Keywords=<systemitem,<table,<task,<taskprerequisites,<taskrelated,<tasksummary
+Keywords=<tbody,<td,<term,<termdef,<tertiary,<tertiaryie,<textdata,<textobject
+Keywords=<tfoot,<tgroup,<th,<thead,<tip,<title,<titleabbrev,<toc,<tocback
+Keywords=<tocchap,<tocentry,<tocfront,<toclevel1,<toclevel2,<toclevel3,<toclevel4
+Keywords=<toclevel5,<tocpart,<token,<tr,<trademark,<type,<ulink,<uri,<userinput
+Keywords=<varargs,<variablelist,<varlistentry,<varname,<videodata,<videoobject
+Keywords=<void,<volumenum,<warning,<wordasword,<xref,<year
+Keywords=</abbrev,</abstract,</accel,</ackno,</acronym,</action,</address
+Keywords=</affiliation,</alt,</anchor,</answer,</appendix,</appendixinfo,</application
+Keywords=</area,</areaset,</areaspec,</arg,</article,</articleinfo,</artpagenums
+Keywords=</attribution,</audiodata,</audioobject,</author,</authorblurb,</authorgroup
+Keywords=</authorinitials,</beginpage,</bibliocoverage,</bibliodiv,</biblioentry
+Keywords=</bibliography,</bibliographyinfo,</biblioid,</bibliolist,</bibliomisc
+Keywords=</bibliomixed,</bibliomset,</biblioref,</bibliorelation,</biblioset
+Keywords=</bibliosource,</blockinfo,</blockquote,</book,</bookinfo,</bridgehead
+Keywords=</callout,</calloutlist,</caption,</caution,</chapter,</chapterinfo,</citation
+Keywords=</citebiblioid,</citerefentry,</citetitle,</city,</classname,</classsynopsis
+Keywords=</classsynopsisinfo,</cmdsynopsis,</co,</code,</col,</colgroup,</collab
+Keywords=</collabname,</colophon,</colspec,</command,</computeroutput,</confdates
+Keywords=</confgroup,</confnum,</confsponsor,</conftitle,</constant,</constraint
+Keywords=</constraintdef,</constructorsynopsis,</contractnum,</contractsponsor
+Keywords=</contrib,</copyright,</coref,</corpauthor,</corpcredit,</corpname,</country
+Keywords=</database,</date,</dedication,</destructorsynopsis,</edition,</editor
+Keywords=</email,</emphasis,</entry,</entrytbl,</envar,</epigraph,</equation,</errorcode
+Keywords=</errorname,</errortext,</errortype,</example,</exceptionname,</fax
+Keywords=</fieldsynopsis,</figure,</filename,</firstname,</firstterm,</footnote
+Keywords=</footnoteref,</foreignphrase,</formalpara,</funcdef,</funcparams
+Keywords=</funcprototype,</funcsynopsis,</funcsynopsisinfo,</function,</glossary
+Keywords=</glossaryinfo,</glossdef,</glossdiv,</glossentry,</glosslist,</glosssee
+Keywords=</glossseealso,</glossterm,</graphic,</graphicco,</group,</guibutton,</guiicon
+Keywords=</guilabel,</guimenu,</guimenuitem,</guisubmenu,</hardware,</highlights
+Keywords=</holder,</honorific,</html:form,</imagedata,</imageobject,</imageobjectco
+Keywords=</important,</index,</indexdiv,</indexentry,</indexinfo,</indexterm
+Keywords=</informalequation,</informalexample,</informalfigure,</informaltable
+Keywords=</initializer,</inlineequation,</inlinegraphic,</inlinemediaobject
+Keywords=</interface,</interfacename,</invpartnumber,</isbn,</issn,</issuenum
+Keywords=</itemizedlist,</itermset,</jobtitle,</keycap,</keycode,</keycombo
+Keywords=</keysym,</keyword,</keywordset,</label,</legalnotice,</lhs,</lineage
+Keywords=</lineannotation,</link,</listitem,</literal,</literallayout,</lot,</lotentry
+Keywords=</manvolnum,</markup,</mathphrase,</medialabel,</mediaobject,</mediaobjectco
+Keywords=</member,</menuchoice,</methodname,</methodparam,</methodsynopsis,</mml:math
+Keywords=</modespec,</modifier,</mousebutton,</msg,</msgaud,</msgentry,</msgexplan
+Keywords=</msginfo,</msglevel,</msgmain,</msgorig,</msgrel,</msgset,</msgsub,</msgtext
+Keywords=</nonterminal,</note,</objectinfo,</olink,</ooclass,</ooexception,</oointerface
+Keywords=</option,</optional,</orderedlist,</orgdiv,</orgname,</otheraddr,</othercredit
+Keywords=</othername,</package,</pagenums,</para,</paramdef,</parameter,</part,</partinfo
+Keywords=</partintro,</personblurb,</personname,</phone,</phrase,</pob,</postcode
+Keywords=</preface,</prefaceinfo,</primary,</primaryie,</printhistory,</procedure
+Keywords=</production,</productionrecap,</productionset,</productname,</productnumber
+Keywords=</programlisting,</programlistingco,</prompt,</property,</pubdate,</publisher
+Keywords=</publishername,</pubsnumber,</qandadiv,</qandaentry,</qandaset,</question
+Keywords=</quote,</refclass,</refdescriptor,</refentry,</refentryinfo,</refentrytitle
+Keywords=</reference,</referenceinfo,</refmeta,</refmiscinfo,</refname,</refnamediv
+Keywords=</refpurpose,</refsect1,</refsect1info,</refsect2,</refsect2info,</refsect3
+Keywords=</refsect3info,</refsection,</refsectioninfo,</refsynopsisdiv
+Keywords=</refsynopsisdivinfo,</releaseinfo,</remark,</replaceable,</returnvalue
+Keywords=</revdescription,</revhistory,</revision,</revnumber,</revremark,</rhs,</row
+Keywords=</sbr,</screen,</screenco,</screeninfo,</screenshot,</secondary,</secondaryie
+Keywords=</sect1,</sect1info,</sect2,</sect2info,</sect3,</sect3info,</sect4,</sect4info
+Keywords=</sect5,</sect5info,</section,</sectioninfo,</see,</seealso,</seealsoie,</seeie
+Keywords=</seg,</seglistitem,</segmentedlist,</segtitle,</seriesvolnums,</set,</setindex
+Keywords=</setindexinfo,</setinfo,</sgmltag,</shortaffil,</shortcut,</sidebar
+Keywords=</sidebarinfo,</simpara,</simplelist,</simplemsgentry,</simplesect,</spanspec
+Keywords=</state,</step,</stepalternatives,</street,</structfield,</structname,</subject
+Keywords=</subjectset,</subjectterm,</subscript,</substeps,</subtitle,</superscript
+Keywords=</surname,</svg:svg,</symbol,</synopfragment,</synopfragmentref,</synopsis
+Keywords=</systemitem,</table,</task,</taskprerequisites,</taskrelated,</tasksummary
+Keywords=</tbody,</td,</term,</termdef,</tertiary,</tertiaryie,</textdata,</textobject
+Keywords=</tfoot,</tgroup,</th,</thead,</tip,</title,</titleabbrev,</toc,</tocback
+Keywords=</tocchap,</tocentry,</tocfront,</toclevel1,</toclevel2,</toclevel3,</toclevel4
+Keywords=</toclevel5,</tocpart,</token,</tr,</trademark,</type,</ulink,</uri,</userinput
+Keywords=</varargs,</variablelist,</varlistentry,</varname,</videodata,</videoobject
+Keywords=</void,</volumenum,</warning,</wordasword,</xref,</year
+Keywords=lang=,id=,cols=,colwidth=,class=,fileref=,format=,align=,scale=,linkend=
+Keywords=url=
+End
+
diff --git a/setedit/cfgfiles/test_shl/test.vhdl b/setedit/cfgfiles/test_shl/test.vhdl
new file mode 100644
index 0000000..1ffeb1d
--- /dev/null
+++ b/setedit/cfgfiles/test_shl/test.vhdl
@@ -0,0 +1,81 @@
+-----------------------------------------------------------------------------
+-- Copyright (c) 2005 by Salvador E. Tropea --
+-- Distributed under the terms of the GPL license. --
+-- --
+-- This file is used to test the VHDL syntax highlight. --
+-----------------------------------------------------------------------------
+
+-- Bit string literals
+OK:
+B%111_110%
+B"111_000"
+B""
+O"1127"
+X"aF45"
+
+Wrong:
+-- Not closed
+B"11
+-- Digit out of base
+B%11112%
+-- Closed with wrong delimiter (no match)
+B"111%
+-- Two consecutive _
+B%11__0%
+-- Digit out of base
+O%181%
+-- Digit out of base
+X%aFg45%
+
+-- Abstract literals (numbers)
+
+OK:
+11.11e11
+125629
+111.32
+1_6#1.1af_2#E+1
+16#1.1af_2#E12
+1_000_000
+15#7E#E+1
+11.0e2
+1E9
+1.0e-9
+10#110.11#E-2
+
+Wrong:
+-- Negative exponent for integer
+11_1e-2
+-- Digit out of base
+112a
+-- Incomplete, needs at least 1 digit
+111.
+-- Two consecutive _
+110__20
+-- Incomplete, needs #
+10#12
+-- Wrong base (>16)
+17#10#
+-- Digit out of base
+15#EF#
+-- Negative exponent for integer
+10#10#E-2
+
+
+-- String literals
+Ok:
+"Hello"outside
+""outside
+"inside""inside"outside
+%inside%outside
+
+Wrong:
+"
+"""
+"aaaa
+
+-- Character literals
+Always ok:
+'a'outside
+signal'attribute
+'''outside
+
diff --git a/setedit/cfgfiles/vhdl.pmc b/setedit/cfgfiles/vhdl.pmc
new file mode 100644
index 0000000..4b57bd3
--- /dev/null
+++ b/setedit/cfgfiles/vhdl.pmc
@@ -0,0 +1,801 @@
+; Copyright (C) 2005-2007 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+; The following macros are designed for the Autoindent+Unindent mode.
+; \n is new line.
+; \b is backspace.
+; \t is tab (not ASCII 9 but the smart tab)
+; @0 is the position where the cursor is positioned after the insertion
+; @1 is memorized in ^Q7 (or Alt7)
+; @2 is memorized in ^Q8 (or Alt8)
+; @3 is memorized in ^Q9 (or Alt9)
+; @@ is a simple @
+; @{Name} asks the user a value for "Name". Name becomes a variable.
+; @{Name;Def} asks the user a value for "Name". Name becomes a variable. The
+; default value is "Def".
+; @vN inserts the content of the "variable" number N. Variables are numbered
+; starting with 0.
+; @{(sLisp)} executes the sLisp code.
+; Don't put only @ at the end of the string :-).
+;
+; The Mode keyword indicates the mode of the editor when the macro is
+; triggered, each mode can be 0 or 1:
+; Overwrite, Autoindent, Use Tabs, Persistent blocks, Inteligent C indent,
+; Column cursor, Row cursor, Show match pair, idem on the fly, idem inmediatly,
+; Transparent selection, Optimal fill, Wrap lines, Visible tabs, Don't move
+; inside tabs, Tab key indents, Use indent size, Don't purge spaces and
+; Backspace key unindents.
+; For example: Mode: 0,1,0,1,0
+; Indicates: No overwrite, autoindent, don't use real tabs, the blocks are
+; persistent and don't be smart when indenting.
+; The Mode keyword can't be omitted.
+
+Trigger: "ar"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Architecture
+ "architecture @{Architecture} of @{Entity} is\n"
+ "begin\n"
+ " @0;\n"
+ "\bend architecture @v0; -- Entity: @v1"
+
+Trigger: "bl"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Block
+ "@{Label}:\n"
+ "block\n"
+ "begin\n"
+ " @0;\n"
+ "\bend block @v0;"
+
+Trigger: "co"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Component declaration
+ "component @{Name} is\n"
+ " generic(@0\n"
+ " );\n"
+ "\bport(@1\n"
+ " );\n"
+ "\b\bend component @v0;"
+
+Trigger: "ci"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Component instantiation
+ "@{Label}: @{Component}\n"
+ " generic map(\n"
+ " @0 => @1,)\n"
+ "\bport map(\n"
+ " @2 => @3,);\n"
+
+Trigger: "wh"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Conditional signal assignment
+ "@0 <= @1 when @2 else @3;"
+
+Trigger: "#d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Constant
+ "constant @{Name} : @0:=@1;"
+
+Trigger: "en"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Entity
+ "entity @{Entity} is\n"
+ " generic(@0\n"
+ " );\n"
+ "\bport(@1\n"
+ " );\n"
+ "\b\bend entity @v0;"
+
+Trigger: "ma"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Entity/Architecture
+ "entity @{Entity} is\n"
+ " generic(@0\n"
+ " );\n"
+ "\bport(@1\n"
+ " );\n"
+ "\b\bend entity @v0;\n"
+ "\n"
+ "architecture @{Architecture} of @v0 is\n"
+ "begin\n"
+ " ;\n"
+ "\bend architecture @v1; -- Entity: @v0"
+
+Trigger: "ex"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Exit
+ "exit @{Label} when @0;"
+
+Trigger: "fg"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: For generate
+ "@{Label}:\n"
+ "for @0 in @1 to @2 generate\n"
+ " @3;\n"
+ "\bend generate @v0;"
+
+Trigger: "f("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: For loop
+ "for @0 in @1 to @2 loop\n"
+ " @3;\n"
+ "\bend loop;"
+
+Trigger: "fu"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Function declaration
+ "function @{Name}(@0) return @1 is\n"
+ "begin\n"
+ " @2;\n"
+ "\bend function @v0;"
+
+Trigger: "li"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: IEEE standard libraries
+ "library IEEE;\n"
+ "use IEEE.std_logic_1164.all;\n"
+ "use IEEE.numeric_std.all;\n\n"
+
+Trigger: "ig"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: If generate
+ "@{Label}:\n"
+ "if @0 generate\n"
+ " @1;\n"
+ "\bend generate @v0;"
+
+Trigger: "I("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: If, no else
+ "if @0 then\n"
+ " @1;\n"
+ "\bend if;"
+
+Trigger: "i("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: If plus else
+ "if @0 then\n"
+ " @1;\n"
+ "\belse\n"
+ " @2;\n"
+ "\bend if;"
+
+Trigger: "if"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: If/elsif/else/endif
+ "if @0 then\n"
+ " @1;\n"
+ "\belsif @2 then\n"
+ " @3;\n"
+ "\belse\n"
+ " @4;\n"
+ "\bend if;"
+
+Trigger: "s("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Case
+ "case @0 is\n"
+ " when @1 =>\n"
+ " @2;\n"
+ "\bwhen others =>\n"
+ " @3;\n"
+ "\b\bend case;"
+
+Trigger: "c:"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Case element (when)
+ "when @0 =>\n"
+ " @2;"
+
+Trigger: "#i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Library/Use
+ "library @{Library;IEEE};\n"
+ "use @v0.@{Package;std_logic_1164}.all;"
+
+Trigger: "ne"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Next
+ "next @{Label} when @0;"
+
+Trigger: "ot"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: (others => '')
+ "(others => @{Value;'0'});"
+
+Trigger: "pr"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Printf
+ "printf(\"@0\");"
+
+Trigger: "po"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Procedure declaration
+ "procedure @{Name}(@0) is\n"
+ "begin\n"
+ " @1;\n"
+ "\bend procedure @v0;"
+
+Trigger: "ps"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Process
+ "@{Label}:\n"
+ "process (@0)\n"
+ "begin\n"
+ " @1;\n"
+ "\bend process @v0;"
+
+Trigger: "pc"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Process for clock
+ "@{Label}:\n"
+ "process (@{Clock;clk})\n"
+ "begin\n"
+ " if rising_edge(@v1) then\n"
+ " @0;\n"
+ "\bend if;\n"
+ "\bend process @v0;"
+
+Trigger: "p1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Process w/clock+async rst
+ "@{Label}:\n"
+ "process (@{Clock;clk},@{Reset;rst})\n"
+ "begin\n"
+ " if @v2='1' then\n"
+ " @0;\n"
+ "\belsif rising_edge(@v1) then\n"
+ " @1;\n"
+ "\bend if;\n"
+ "\bend process @v0;"
+
+Trigger: "p2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Process w/clock+sync rst
+ "@{Label}:\n"
+ "process (@{Clock;clk},@{Reset;rst})\n"
+ "begin\n"
+ " if rising_edge(@v1) then\n"
+ " if @v2='1' then\n"
+ " @0;\n"
+ "\belse\n"
+ " @1;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend process @v0;"
+
+Trigger: "re"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Return
+ "return @0;"
+
+Trigger: "se"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Select signal (With)
+ "with @{Expression} select @{Signal} <=\n"
+ " @{Value to assign} when @{Value for expression},\n"
+ "@0when @1,\n"
+ "@{Default value} when others;"
+
+Trigger: "si"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Signal declaration
+ "signal @{Name} : @0;"
+
+Trigger: "sl"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Std_logic
+ "std_logic"
+
+Trigger: "sv"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Std_logic_vector
+ "std_logic_vector(@0 downto @1)"
+
+Trigger: "st"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Subtype
+ "subtype @0 is @1 range @2 to @3;"
+
+Trigger: "ty"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Type
+ "type @0 is @1;"
+
+Trigger: "un"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Unsigned
+ "unsigned(@0 downto @1);"
+
+Trigger: "#I"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Use
+ "use @0.@1.all;"
+
+Trigger: "va"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Variable declaration
+ "variable @{Name} : @0;"
+
+Trigger: "w("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: While loop
+ "while @0 loop\n"
+ " @1;\n"
+ "\bend loop;"
+
+Trigger: "pa"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Package
+ "package @{Package} is\n"
+ " @0;\n"
+ "\bend package @v0;"
+
+Trigger: "pb"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Package body
+ "package body @{Package} is\n"
+ " @0;\n"
+ "\bend package body @v0;"
+
+Trigger: "f1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: D Flip Flop
+ "@{Label;ffd_p}: -- D Flip Flop\n"
+ "process (@{Clock;clk})\n"
+ "begin\n"
+ " if rising_edge(@v1) then\n"
+ " @{Output;q} <= @{Input;d};\n"
+ "\bend if;\n"
+ "\bend process @v0;\n"
+
+Trigger: "f2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: D Flip Flop w/async reset
+ "@{Label;ffd_p}: -- D Flip Flop w/async reset\n"
+ "process (@{Clock;clk},@{Reset;rst})\n"
+ "begin\n"
+ " if @v2='1' then\n"
+ " @{Output;q} <= '0';\n"
+ "\belsif rising_edge(@v1) then\n"
+ " @v3 <= @{Input;d};\n"
+ "\bend if;\n"
+ "\bend process @v0;\n"
+
+Trigger: "f3"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: D Flip Flop w/sync reset
+ "@{Label;ffd_p}: -- D Flip Flop w/sync reset\n"
+ "process (@{Clock;clk},@{Reset;rst})\n"
+ "begin\n"
+ " if rising_edge(@v1) then\n"
+ " if @v2='1' then\n"
+ " @{Output;q} <= '0';\n"
+ "\belse\n"
+ " @v3 <= @{Input;d};\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend process @v0;\n"
+
+Trigger: "f4"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: D Flip Flop w/clock enable
+ "@{Label;ffd_p}: -- D Flip Flop w/clock enable\n"
+ "process (@{Clock;clk})\n"
+ "begin\n"
+ " if rising_edge(@v1) then\n"
+ " if @{Enable;ena}='1' then\n"
+ " @{Output;q} <= @{Input;d};\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend process @v0;\n"
+
+Trigger: "l1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: D Latch
+ "@{Label;latchd_p}: -- D Latch\n"
+ "process (@{Gate;gate},@{Input;d})\n"
+ "begin\n"
+ " if @v1='1' then\n"
+ " @{Output;q} <= @v2;\n"
+ "\bend if;\n"
+ "\bend process @v0;\n"
+
+Trigger: "l2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: D Latch w/reset
+ "@{Label;latchd_p}: -- D Latch w/reset\n"
+ "process (@{Gate;gate},@{Reset;rst},@{Input;d})\n"
+ "begin\n"
+ " if @v2='1' then\n"
+ " @{Output;q} <= '0';\n"
+ "\belsif @v1='1' then\n"
+ " @v4 <= @v3;\n"
+ "\bend if;\n"
+ "\bend process @v0;\n"
+
+Trigger: "h1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Hexa to 7-seg converter
+ "-- Hexadecimal to 7-segment decoder\n"
+ "-- @{Input;hex_val}: in std_logic_vector(3 downto 0);\n"
+ "-- @{Output;seven_seg}: out std_logic_vector(6 downto 0);\n"
+ "--\n"
+ "-- Bits used for each segment\n"
+ "-- 0\n"
+ "-- ---\n"
+ "-- 5 | | 1\n"
+ "-- --- <- 6\n"
+ "-- 4 | | 2\n"
+ "-- ---\n"
+ "-- 3\n"
+ "-- Note: segments are active low.\n\n"
+ "with @v0 select\n"
+ " @v1 <= \"1111001\" when \"0001\", -- 1\n"
+ " \"0100100\" when \"0010\", -- 2\n"
+ "\"0110000\" when \"0011\", -- 3\n"
+ "\"0011001\" when \"0100\", -- 4\n"
+ "\"0010010\" when \"0101\", -- 5\n"
+ "\"0000010\" when \"0110\", -- 6\n"
+ "\"1111000\" when \"0111\", -- 7\n"
+ "\"0000000\" when \"1000\", -- 8\n"
+ "\"0010000\" when \"1001\", -- 9\n"
+ "\"0001000\" when \"1010\", -- A\n"
+ "\"0000011\" when \"1011\", -- b\n"
+ "\"1000110\" when \"1100\", -- C\n"
+ "\"0100001\" when \"1101\", -- d\n"
+ "\"0000110\" when \"1110\", -- E\n"
+ "\"0001110\" when \"1111\", -- F\n"
+ "\"1000000\" when others; -- 0\n\n\b\b"
+
+Trigger: "m1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Multiplexer (logic version)
+ "-- Multiplexer (logic version)\n"
+ "-- @{Selection;sel}: in std_logic_vector(@0 downto 0);\n"
+ "-- @{Inputs;ins}: in std_logic_vector(@1 downto 0);\n"
+ "-- @{Output;ou}: out std_logic;\n\n"
+ "@{Label;mux_logic_p}:\n"
+ "process (@v0,@v1)\n"
+ " variable isel : integer;\n"
+ "\bbegin\n"
+ " isel:=to_integer(unsigned(@v0));\n"
+ "for i in ins'range loop\n"
+ " if i=isel then\n"
+ " @v2 <= @v1(isel);\n"
+ "\bend if;\n"
+ "\bend loop;\n"
+ "\bend process @v3;\n"
+
+Trigger: "m2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Multiplexer (three state version)
+ "-- Multiplexer (three state version)\n"
+ "-- @{Selection;sel}: in std_logic_vector(@0 downto 0);\n"
+ "-- @{Inputs;ins}: in std_logic_vector(@1 downto 0);\n"
+ "-- @{Output;ou}: out std_logic;\n\n"
+ "@{Label;mux_3s_p}:\n"
+ "for i in @v1'range generate\n"
+ " @v2 <= @v1(i) when to_integer(unsigned(@v0))=i else 'Z';\n"
+ "\bend generate @v0;"
+
+Trigger: "s1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Serial to Serial Shift Register
+ "-- Serial-in and serial-out shift register\n"
+ "-- @{Clock;clk}: in std_logic;\n"
+ "-- @{Input;sin}: in std_logic;\n"
+ "-- @{Output;sout}: out std_logic;\n"
+ "-- signal @{Register;reg}: std_logic_vector(@{Bits-1;7} downto 0);\n\n"
+ "@{Label;s2s_shift_p}:\n"
+ "process (@v0)\n"
+ "begin\n"
+ " if rising_edge(@v0) then\n"
+ " @v3 <= @v3(@v3'left-1 downto 0) & @v1;\n"
+ "\bend if;\n"
+ "@v2 <= @v3(@v3'left);\n"
+ "\bend process @v5;"
+
+Trigger: "s2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Serial to Parallel Shift Register
+ "-- Serial-in and parallel-out shift register\n"
+ "-- @{Clock;clk}: in std_logic;\n"
+ "-- @{Input;sin}: in std_logic;\n"
+ "-- @{Output;pout}: out std_logic_vector(@{Bits-1;7} downto 0);\n"
+ "-- signal @{Register;reg}: std_logic_vector(@v3 downto 0);\n\n"
+ "@{Label;s2p_shift_p}:\n"
+ "process (@v0)\n"
+ "begin\n"
+ " if rising_edge(@v0) then\n"
+ " @v4 <= @v4(@v4'left-1 downto 0) & @v1;\n"
+ "\bend if;\n"
+ "@v2 <= @v4;\n"
+ "\bend process @v5;"
+
+Trigger: "s3"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Loadable Shift Register
+ "-- Loadable serial-in and serial-out shift register\n"
+ "-- @{Clock;clk}: in std_logic;\n"
+ "-- @{Input;sin}: in std_logic;\n"
+ "-- @{Load;load}: in std_logic;\n"
+ "-- @{Load Data;pin}: in std_logic_vector(@{Bits-1;7} downto 0);\n"
+ "-- @{Output;sout}: out std_logic;\n"
+ "-- signal @{Register;reg}: std_logic_vector(@v4 downto 0);\n\n"
+ "@{Label;s2s_wLoad_shift_p}:\n"
+ "process (@v0)\n"
+ "begin\n"
+ " if rising_edge(@v0) then\n"
+ " if @v2='1' then\n"
+ " @v6 <= @v3;\n"
+ "\belse\n"
+ " @v6 <= @v6(@v6'left-1 downto 0) & @v1;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "@v5 <= @v6(@v6'left);\n"
+ "\bend process @v7;"
+
+Trigger: "c1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Counter w/load/dir/ena/reset
+ "-- Synchronous counter with count enable, async reset and sync load\n"
+; 0
+ "-- @{Clock;clk}: in std_logic;\n"
+; 1
+ "-- @{Reset;rst}: in std_logic;\n"
+; 2
+ "-- @{Enable;ena}: in std_logic;\n"
+; 3
+ "-- @{Load;load}: in std_logic;\n"
+; 4
+ "-- @{Direction;dir}: in std_logic;\n"
+; 5-6
+ "-- @{Data in;din}: in std_logic_vector(@{Bits-1;7} downto 0);\n"
+; 7
+ "-- @{Output;cnt}: out std_logic_vector(@v6 downto 0);\n\n"
+; 8
+ "@{Label;counter_p}:\n"
+ "process (@v0,@v1)\n"
+ " variable count : unsigned(@v6 downto 0);\n"
+ "\bbegin\n"
+ " if @v1='1' then -- w/async reset\n"
+ " count <= (others => '0');\n"
+ "\belsif rising_edge(@v0) then -- synchronous\n"
+ " if @v2='1' then -- w/enable\n"
+ " if @v3='1' then -- w/sync load\n"
+ " count <= @v5;\n"
+ "\belse\n"
+ " if @v4='1' then -- w/direction\n"
+ " count:=count+1;\n"
+ "\belse\n"
+ " count:=count-1;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "@v7 <= count;\n"
+ "\bend process @v8;"
+
+Trigger: "r1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: RAM Single Port Distributed
+ "library IEEE;\n"
+ "use IEEE.std_logic_1164.all;\n"
+ "use IEEE.numeric_std.all;\n\n"
+ "entity @{Entity;SinglePortDistRAM} is\n"
+ " port(clk : in std_logic;\n"
+ " we : in std_logic;\n"
+ "addr: in std_logic_vector(@{Bits addr-1;9} downto 0);\n"
+ "di : in std_logic_vector(@{Bits data-1;7} downto 0);\n"
+ "do : out std_logic_vector(@v2 downto 0));\n"
+ "\b\bend entity @v0;\n\n"
+ "architecture Xilinx of @v0 is\n"
+ " type ram_type is array(@{Size-1;1023} downto 0) of std_logic_vector (@v2 downto 0);\n"
+ "signal ram : ram_type;\n"
+ "\bbegin\n"
+ " the_ram:\n"
+ "process (clk)\n"
+ "begin\n"
+ " if rising_edge(clk) then\n"
+ " if we='1' then\n"
+ " ram(to_integer(unsigned(addr))) <= di;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend process the_ram;\n\n"
+ "do <= ram(to_integer(unsigned(addr)));\n"
+ "\bend architecture Xilinx; -- Entity: @v0\n"
+
+Trigger: "r2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: RAM Dual Port Distributed
+ "library IEEE;\n"
+ "use IEEE.std_logic_1164.all;\n"
+ "use IEEE.numeric_std.all;\n\n"
+ "entity @{Entity;DualPortDistRAM} is\n"
+ " port(clk : in std_logic;\n"
+ " we : in std_logic;\n"
+ "add1: in std_logic_vector(@{Bits addr-1;9} downto 0);\n"
+ "add2: in std_logic_vector(@v1 downto 0);\n"
+ "di : in std_logic_vector(@{Bits data-1;7} downto 0);\n"
+ "do1 : out std_logic_vector(@v2 downto 0);\n"
+ "do2 : out std_logic_vector(@v2 downto 0));\n"
+ "\b\bend entity @v0;\n\n"
+ "architecture Xilinx of @v0 is\n"
+ " type ram_type is array(@{Size-1;1023} downto 0) of std_logic_vector (@v2 downto 0);\n"
+ "signal ram : ram_type;\n"
+ "\bbegin\n"
+ " the_ram:\n"
+ "process (clk)\n"
+ "begin\n"
+ " if rising_edge(clk) then\n"
+ " if we='1' then\n"
+ " ram(to_integer(unsigned(add1))) <= di;\n"
+ "\bend if;\n"
+ "\bend if;\n"
+ "\bend process the_ram;\n\n"
+ "do1 <= ram(to_integer(unsigned(add1)));\n"
+ "do2 <= ram(to_integer(unsigned(add2)));\n"
+ "\bend architecture Xilinx; -- Entity: @v0\n"
+
+Trigger: "b1"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: BRAM Single Port
+ "library IEEE;\n"
+ "use IEEE.std_logic_1164.all;\n"
+ "use IEEE.numeric_std.all;\n\n"
+ "entity @{Entity;SinglePortBRAM} is\n"
+ " port(clk : in std_logic;\n"
+ " we : in std_logic;\n"
+ "addr: in std_logic_vector(@{Bits addr-1;9} downto 0);\n"
+ "di : in std_logic_vector(@{Bits data-1;7} downto 0);\n"
+ "do : out std_logic_vector(@v2 downto 0));\n"
+ "\b\bend entity @v0;\n\n"
+ "architecture Xilinx of @v0 is\n"
+ " type ram_type is array(@{Size-1;1023} downto 0) of std_logic_vector (@v2 downto 0);\n"
+ "signal ram : ram_type;\n"
+ "signal read_a: std_logic_vector(@v1 downto 0);\n"
+ "\bbegin\n"
+ " the_ram:\n"
+ "process (clk)\n"
+ "begin\n"
+ " if rising_edge(clk) then\n"
+ " if we='1' then\n"
+ " ram(to_integer(unsigned(addr))) <= di;\n"
+ "\bend if;\n"
+ "read_a <= addr;\n"
+ "\bend if;\n"
+ "\bend process the_ram;\n\n"
+ "do <= ram(to_integer(unsigned(read_a)));\n"
+ "\bend architecture Xilinx; -- Entity: @v0\n"
+
+Trigger: "b2"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: BRAM Dual Port
+ "library IEEE;\n"
+ "use IEEE.std_logic_1164.all;\n"
+ "use IEEE.numeric_std.all;\n\n"
+ "entity @{Entity;DualPortBRAM} is\n"
+ " port(clk : in std_logic;\n"
+ " we : in std_logic;\n"
+ "add1: in std_logic_vector(@{Bits addr-1;9} downto 0);\n"
+ "add2: in std_logic_vector(@v1 downto 0);\n"
+ "di : in std_logic_vector(@{Bits data-1;7} downto 0);\n"
+ "do1 : out std_logic_vector(@v2 downto 0);\n"
+ "do2 : out std_logic_vector(@v2 downto 0));\n"
+ "\b\bend entity @v0;\n\n"
+ "architecture Xilinx of @v0 is\n"
+ " type ram_type is array(@{Size-1;1023} downto 0) of std_logic_vector (@v2 downto 0);\n"
+ "signal ram : ram_type;\n"
+ "signal read_a1: std_logic_vector(@v1 downto 0);\n"
+ "signal read_a2: std_logic_vector(@v1 downto 0);\n"
+ "\bbegin\n"
+ " the_ram:\n"
+ "process (clk)\n"
+ "begin\n"
+ " if rising_edge(clk) then\n"
+ " if we='1' then\n"
+ " ram(to_integer(unsigned(add1))) <= di;\n"
+ "\bend if;\n"
+ "read_a1 <= add1;\n"
+ "read_a2 <= add2;\n"
+ "\bend if;\n"
+ "\bend process the_ram;\n\n"
+ "do1 <= ram(to_integer(unsigned(read_a1)));\n"
+ "do2 <= ram(to_integer(unsigned(read_a2)));\n"
+ "\bend architecture Xilinx; -- Entity: @v0\n"
+
+Trigger: "/i"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1
+Name: File header (long)
+ "------------------------------------------------------------------------------\n"
+ "---- ----\n"
+ "---- @{Title}\t----\n"
+ "---- ----\n"
+ "---- @{Downloaded from;Internal file, can't be downloaded.}\t----\n"
+ "---- ----\n"
+ "---- Description: ----\n"
+ "---- @0 ----\n"
+ "---- ----\n"
+ "---- To Do: ----\n"
+ "---- - ----\n"
+ "---- ----\n"
+ "---- Author: ----\n"
+ "---- - @{Author name}, @{e-mail}\t----\n"
+ "---- ----\n"
+ "------------------------------------------------------------------------------\n"
+ "---- ----\n"
+ "---- Copyright (c) @{"
+; sLisp code to get the year using the date command. Side effect: saves the file to disk
+ "(eval"
+ "(setv 'year' (RunProgramRedir 'date +%Y'))"
+ "(InsertText (left year (- (length year) 1)))"
+ ")"
+ "} @v2 <@v3>\t----\n"
+ "---- ----\n"
+ "---- @{License;For internal use, all rights reserved.}\t----\n"
+ "---- ----\n"
+ "------------------------------------------------------------------------------\n"
+ "----\n"
+ "---- Design unit: @{Design unit;Entity(architecture) (Entity and architecture)}\n"
+ "---- File name: @{"
+; sLisp code to get the filename and extension
+ "(InsertText"
+ "(+"
+ "(WhichEditor edfWENameNoExt)"
+ "(WhichEditor edfWEExtension)"
+ ")"
+ ")}\n"
+ "---- Note: None\n"
+ "---- Limitations: None known\n"
+ "---- Errors: None known\n"
+ "---- Library: @{Library;None}\n"
+ "---- Dependencies: IEEE.std_logic_1164\n"
+ "---- IEEE.numeric_std\n"
+ "---- Target FPGA: @{FPGA;Spartan II (XC2S100-5-PQ208)}\n"
+ "---- Language: VHDL\n"
+ "---- Wishbone: @{Wishbone;MASTER (rev B.3)}\n"
+ "---- Synthesis tools: @{Synthesis tools;Xilinx Release 6.2.03i - xst G.31a}\n"
+ "---- Simulation tools: @{Simulation tools;GHDL [Sokcho edition] (0.1x)}\n"
+ "---- Text editor: SETEdit 0.5.x\n"
+ "----\n"
+; sLisp code to make the comment look like a "box" (16 lines)
+ "@{(eval"
+ "(repeat 17 (SendCommands cmcLineUp))"
+ "(SendCommands cmcLineEnd)"
+ "(repeat 16"
+ "(SendCommands cmcCharLeft cmcCharLeft cmcCharLeft cmcCharLeft cmcLineDown)"
+ "(InsertText '----')"
+ ")"
+ "(SendCommands cmcLineStart cmcLineDown)"
+ ")}"
+ "------------------------------------------------------------------------------\n"
+ "--\n"
+ "-- CVS Revision History\n"
+ "--\n"
+; We need to fool CVS ;-)
+ "-- $"
+ "Log$\n"
+ "--\n"
+ "--\n"
+
+Trigger: "ri"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1
+Name: rising_edge
+ "rising_edge(@{Signal})"
+
+Trigger: "fa"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1
+Name: falling_edge
+ "falling_edge(@{Signal})"
+
+Trigger: "/d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1
+Name: SDG Comment short
+"---[txh]--------------------------------------------------------------------\n"
+"--\n"
+"-- Description:\n"
+"-- @0\n"
+"--\n"
+"-------------------------------------------------------------------[/txh]---\n"
+
diff --git a/setedit/cfgfiles/wmlmac.pmc b/setedit/cfgfiles/wmlmac.pmc
new file mode 100644
index 0000000..d752be2
--- /dev/null
+++ b/setedit/cfgfiles/wmlmac.pmc
@@ -0,0 +1,86 @@
+; Copyright (C) 2004 by Salvador E. Tropea (SET),
+; see copyrigh file for details
+;
+;
+; Some simple WML and HTML macros.
+; Contributed by Diego J. Brengi
+;
+
+Trigger: "<d"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Define-tag
+ "<define-tag @0 endtag=required whitespace=delete>\n"
+ "</define-tag>@1"
+
+Trigger: "<f"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Foreach
+ "<foreach @0></foreach>@1"
+
+Trigger: "<p"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Preserve
+ "<preserve @0 >@1"
+
+Trigger: "<r"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Restore
+ "<restore @0 >@1"
+
+
+Trigger: "<g"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Get-var
+ "<get-var @0>@1"
+
+Trigger: "<w"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: While
+ "<while @0>@1\n"
+ "</while>"
+
+Trigger: "<a"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Link
+ "<a href=\"@0\">@1</a>@2"
+
+Trigger: "<m"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Image
+ "<img src=\"@0\">@1"
+
+Trigger: "<t"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Table
+ "<table>\n"
+ "<tr>@0</tr>\n"
+ "</table>@1"
+
+Trigger: "me"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Meta tag
+ "<meta name=\"@0\" content=\"@1\">"
+
+Trigger: "<!"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Comment
+ "<!-- @0 -->@1"
+
+Trigger: "<f"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Font
+ "<font @0>@1</font>"
+
+Trigger: "ma"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Squeleton
+ "<HTML><head>\n"
+ "<title>@0</title>\n"
+ "</head>\n"
+ "<body>\n"
+ "@1\n"
+ "</body>\n"
+ "</HTML>\n"
+
+
+
diff --git a/setedit/change.log b/setedit/change.log
new file mode 100644
index 0000000..57a947a
--- /dev/null
+++ b/setedit/change.log
@@ -0,0 +1,7772 @@
+$Log: change.log,v $
+Revision 1.731 2007/04/23 14:55:33 set
+* Added: Copy and Save for the debug dialog contents (gdb dialog).
+* Modified: Debian release version (for Etch)
+* Modified: To ignore the "typeref:struct:" attribute from ectags 5.6.
+* Modified: To support the new spanish translation of the "Entering dir"
+message from make (some crazy changed it).
+.
+Revision 1.730 2007/04/18 19:15:17 set
+* Fixed: [manview.cc, edprefs.cc, runprog.cc] char verctors that requested
+pack attribute. They aren't really packed and gcc 4.1.1 provides a warning.
+* Modified: [keytrans.cc] to avoid a gcc warning in a dubious cast.
+
+Revision 1.729 2007/03/20 16:33:07 set
+* Added: [SHL] Basic syntax highlight for DocBook documents.
+* Added: [PMacros] Some DocBook pmacros.
+* Modified: [PMacros] Now the input lines are "piped" it allows pasting
+text.
+
+Revision 1.728 2007/03/12 13:48:17 set
+* Modified: [Debian] The build dependencies to support "unstable". SF Patch
+#1678083. Contributed by Baurzhan Ismagulov <ibr/radix50/net>
+
+Revision 1.727 2007/02/14 14:38:27 set
+* Fixed: [VHDL pmacros] package body wasn't properly eneded.
+* Added: [Function list] list of anchors for HTML files.
+
+Revision 1.726 2007/01/25 16:04:42 set
+* Added: [SDG] functionality to support other languages (not just C/C++).
+It currently works for VHDL.
+* Fixed: [PMacros] VHDL's component pmacro.
+* Added: [PMacros] VHDL: rising_edge, falling_edge and SDG short comment.
+
+Revision 1.725 2006/11/22 14:58:49 set
+* Modified: The configuration script to use -Wno-packed when gcc 4.x is
+detected (untested). Needed to eliminate a silly warning.
+* Modified: mp3list.cc to avoid an anonymous struct that generates a gcc
+4.x warning.
+* Modified: The www page to reflect the last pre-release.
+
+Revision 1.724 2006/11/17 12:18:28 set
+* Modified: Colors list.
+
+Revision 1.723 2006/11/16 20:18:48 set
+* Modified: To upload a new CVS snapshot.
+
+Revision 1.722 2006/11/16 16:26:26 set
+* Modified: Added some code to test if we can solve the following gcc 4.x
+issue:
+runprog.cc:116: error: cannot bind packed field 'box.ConfigureRunComm
+and()::<anonymous struct>::tl.TListBoxRec::selection' to 'ccIndex&'.
+
+Revision 1.721 2006/11/13 19:18:36 set
+* Fixed: [List of func.:VHDL] various errors in the functions parser.
+
+Revision 1.720 2006/11/13 14:41:39 set
+* Added: [SHL] Syntax for KICAD files (PCB, schematic and libs).
+Contributed by Diego J. Brengi.
+* Added: [List of funcs.] A simple parser to extract KICAD lib components
+and another for makefiles. Both are very silly, but usually work.
+
+Revision 1.719 2006/09/21 13:14:32 set
+* Fixed: [InfView/Compilation] Wrong destructor declaration in TInfWindow.
+* Added: [SHL] \ as escape character for makefiles.
+* Fixed: [sLisp/Crash] SIGSEGV when passing wrong arguments to if.
+
+Revision 1.718 2006/08/08 19:11:23 set
+* Fixed: Some delete and insert operations outside the visible area didn't
+properly update the drawPtr. As a result the "image" of the buffer went
+out of sync. The first useful report about it was by Focha
+focha2@fullzero.com.ar using ^K-V.
+
+Revision 1.717 2006/07/24 12:57:07 set
+* Fixed: The message window some times missed portions of the error lines.
+
+Revision 1.716 2006/07/17 14:16:40 set
+* Fixed: "bin(-1)" in the calculator made it enter in an endless loop.
+
+Revision 1.715 2006/06/27 10:51:25 set
+* Fixed: CVS usage in web page (lastest S.F. changes) Reported by Sergio
+Nuez.
+
+Revision 1.714 2006/05/15 19:01:19 set
+* Added: Small tool to move the CVS root. Used for S.F. changes.
+* Fixed: Incorrect comment in menu file.
+* Modified: Xilinx error pattern for the Linux 7.x WebPack.
+
+Revision 1.713 2006/03/15 17:39:22 set
+* Fixed: Missing cmOpen definition in last patch.
+
+Revision 1.712 2006/03/15 17:19:38 set
+* Added: Support for WinGr's drag'n drop.
+* Added: Some note about libmigdb to the install text.
+* Added: Rules to exclude DVI and PS from doc/.
+
+Revision 1.711 2006/03/14 17:29:38 set
+* Fixed: Problems using current Perl interpreter shipped with MSys (MinGW).
+Based on a patch by JASC.
+
+Revision 1.710 2006/02/13 14:06:57 set
+* Fixed: Indent rules not freed when unloading shl file.
+* Added: Sarge suppressions for valgrind.
+
+Revision 1.709 2006/02/07 17:46:40 set
+* Modified: The behavior of the cmcSearchAgainBackward command according
+to Thiango suggestions. Now it takes the word under cursor if no usable
+selection is available, the "whole words" flag is enabled (but only if we
+took a whole word) and we inform after wrapping.
+
+Revision 1.708 2006/02/06 18:11:12 set
+* Fixed: The powered grep code added lines to the message box without
+specifying their type. Some lines could get added as fitCont and the code
+could try to get the next line potentially crashing in the process.
+Reported by Thiago (gdb backtrace).
+
+Revision 1.707 2006/01/24 15:14:43 set
+* Fixed: GPG interface when writing big files (not waiting for child
+completion).
+* Modified: To avoid poping the message window after each GPG invocation.
+
+Revision 1.706 2006/01/20 18:07:18 set
+* Fixed: When saving a GPG encrypted file the editor hanged waiting for
+errors from gpg.
+
+Revision 1.705 2005/12/16 19:52:09 set
+* Modified: Now the temporal file that holds the uncrypted copy is deleted
+as soon as the file handle is created.
+* Added: The messages from gpg are sent to the message window when we can
+do it (not during start-up).
+* Added: Better error reporting when the encrypted file fails to be
+created.
+
+Revision 1.704 2005/12/16 14:24:16 set
+* Added: id and usemap HTML keywords.
+* Added: Support for "hided" input lines in EasyDiag (for passwords).
+* Fixed: esSelHaveEOL to edSelHaveEOL.
+* Added: Transparent support for GPG encrypted files.
+* Fixed: Crashes when failing to load a file at start-up.
+
+Revision 1.703 2005/11/08 20:24:54 set
+* Modified: New version of DuplicateLineOrSelection. It doesn't use the
+clipboard. Contributed by Thiago.
+
+Revision 1.702 2005/09/19 15:21:40 set
+* Added: [SHL] Ch syntax highlight.
+
+Revision 1.701 2005/09/19 13:15:09 set
+* Added: PHP errors parser. Contributed by Thiago.
+* Added: PHP "compilation" to the "Compile" macro example. Contributed by
+Thiago.
+
+Revision 1.700 2005/09/16 18:52:37 set
+* Fixed: [MSVC] the "all" target isn't special for nmake. After arranging
+things so the variable gets defined by the time all is used I introduced
+a side effect: all isn't the first anymore. So we must explicitly ask for
+"all" target. From information sent by Arnold.
+* Fixed: [MSVC] the mlink tool links the objects using "brut force". As a
+side effect some useless code gets linked. The librhuti/specs.cc code is
+one of them. The problem is that this code generates unresolved
+dependencies. So now I disabled the code. From information sent by Arnold.
+
+Revision 1.699 2005/09/12 16:39:13 set
+* Added: [sLisp] Three new commands GetWrapCol, GetWindowRows and
+GetWindowCols. Two of them are quite useful for text formating. From a
+mailing list thread by Grzegorz.
+
+Revision 1.698 2005/09/07 18:19:50 set
+* Modified: [MSVC] Cosmetic change in the makefiles to match TVs layout.
+
+Revision 1.697 2005/09/07 12:18:23 set
+* Fixed(?): [MSVC] The rule to create setedit/infview unconditionally took
+the .obj files from "obj", but for infview it must be "objinf". From the
+MSVC tools output sent by Arnold.
+
+Revision 1.696 2005/08/24 12:47:17 set
+* Added: [WWW] Links to a snapshot release of r1209 (tarball and Sarge).
+* Fixed: [WWW] A typo.
+* Modified: [Debian] Now we support more than 47 languages and not just 24
+as stated in the Debian description ;-)
+
+Revision 1.695 2005/08/23 16:31:13 set
+* Added: Debug code to find the source of some problems I'm experimenting
+when editing files on samba resources.
+* Modified: The parser of "error/warning" messages to support some GNU
+style errors reported by other tools (not gcc itself).
+
+Revision 1.694 2005/08/23 13:23:54 set
+* Added: [BC++/MSVC] DEBUG variable propagation. From Arnold.
+
+Revision 1.693 2005/08/22 16:00:49 set
+* Fixed: [Documentation] Missing "." at the end of some cross-references.
+Pointed out by Ivan.
+
+Revision 1.692 2005/08/10 13:28:43 set
+* Added: [SHL:XML] entity keyword.
+* Fixed: [MSVC] The call to mlink must indicate the obj dir to avoid a
+command line overflow. From info by Arnold.
+* Fixed: [MSVC] The path to TV library is ../../tvision/makes. From info
+by Arnold.
+* Fixed: [MSVC] nmake doesn't analyze the whole makefile before expanding
+variables, in order to create mlink.exe we need to first define
+HELPER_TARGET. From info by Arnold.
+
+Revision 1.691 2005/08/08 18:12:13 set
+* Added: Message box colors for parsers configured using errors.cle.
+
+Revision 1.690 2005/08/08 16:30:57 set
+* Added: When loading the "file under cursor" if we fail we try changing
+all \ to /.
+
+Revision 1.689 2005/08/08 16:15:17 set
+* Added: Colors to the Message Window. It now detects errors and warnings
+and paints them in different colors. That's only implemented for GNU
+parser.
+* Added: Support for gcc 3.x "long error messages". GCC cuts them and the
+continuations are displayed indented. I think Oswald said about it and now
+that I'm using gcc 3.3.5.
+
+Revision 1.688 2005/08/05 17:11:26 set
+* Fixed(?): [MSVC] mlink.exe compilation. The /OUT: option must be passed
+to the linker with /link. From a report by Arnold. Untested.
+
+Revision 1.687 2005/08/05 16:58:29 set
+* Modified: [MSVC] Wrapper to avoid an overflow in the command line length.
+Based on Arnold's feadback, but untested, will need adjusts.
+
+Revision 1.686 2005/08/05 14:47:19 set
+* Added: C++ reserved word "mutable". Suggested by Ivan.
+
+Revision 1.685 2005/08/04 20:09:05 set
+* Modified: Now cmcToggleCharCase moves the cursor to the right if the
+character didn't change. Patch by Thiago.
+
+Revision 1.684 2005/07/27 20:40:27 set
+* Fixed(?): [DJGPP] Compilation problems for infview. Reported by Thiago.
+
+Revision 1.683 2005/07/25 14:14:50 set
+* Fixed: [Not GCC] Code that needed gcc extensions (variable length local
+vector) Reported by Arnold.
+
+Revision 1.682 2005/07/21 20:37:23 set
+* Added: [WWW] CVS snapshot for Sarge (SPARC).
+
+Revision 1.681 2005/07/19 19:25:26 set
+* Updated: [Debian] The TV dependency to be 2.0.4.
+
+Revision 1.680 2005/07/19 18:38:39 set
+* Fixed: Some linkers needs the libraries in a particular order. In this
+case easydiag must be the last one. Now the extrimk tool handles it. Note:
+RHIDE alphabetically sorts the subprojects. Pointed out by Oswald.
+
+Revision 1.679 2005/07/19 16:17:14 set
+* Fixed: [djgpp] code in infbase.cc got outdated and used . instead of ->
+for a pointer. Patch by Thiago.
+
+Revision 1.678 2005/07/13 16:39:00 set
+* Added: [Cosmetic] When "Scroll Lock Centers" is selected now the editor
+polls the scroll lock key and if the scroll lock is set the current buffer
+is centered to avoid surprises. Suggested by Oswald. Closes SF FR #1237523.
+
+Revision 1.677 2005/07/12 20:41:11 set
+* Fixed: The command to meassure the selection to be more acqurate and
+descriptive. Based on a patch by Oswald. Fixes SF Bug #1236782.
+
+Revision 1.676 2005/07/11 13:57:52 set
+* Fixed: [config] Problems to detect GNU install under djgpp (missing
+ExeExt initialization). Reported by Thiago.
+
+Revision 1.675 2005/06/17 19:41:28 set
+* Added: [Config] Options to use the C++ compiler indicated by the CXX
+environment variable.
+
+Revision 1.674 2005/05/20 20:11:45 set
+* Fixed: Reverted the rev. 1.670 S.F. patch about starting to compute
+indentation only from the second line.
+
+Revision 1.673 2005/05/12 19:51:08 set
+* Added: c++ and cp as valid C++ extensions. GCC docs talks about them.
+* Added: indentation for Perl's unless sentence (if !)
+* Added: indentation for VHDL's record, component and assert.
+* Added: more VHDL user words from the std, textio and IEEE libraries.
+* Added: pmacros for VHDL's package and package body.
+* Fixed: VHDL's pmacro for long file header to avoid CVS expansion in the
+.pmc file of the Log keyword.
+* Fixed: last patches changed the color of second string, now reverted.
+* Fixed: VHDL bit string literals can start with lower case.
+
+Revision 1.672 2005/05/02 16:35:31 set
+* Modified: [SHL] Separated the functions to parse VHDL abstract and bit
+string literals.
+* Added: [VHDL/SHL] Added options to parse string and character literals.
+* Added: [SHL] Now the .shl files can contain default user words.
+* Added: [VHDL/SHL] Some default user words.
+* Fixed: [VHDL] The heuristic parser when parsing oveloaded operators.
+* Added: A test file to verify the VHDL SHL.
+
+Revision 1.671 2005/04/29 19:07:26 set
+* Added: [SHL/VHDL] A scpecial option to parse VHDL numbers, they are quite
+different to C/C++ numbers.
+* Fixed: [TAGS] The parser didn't properly interpret escape sequences in
+the regex.
+* Fixed(?): WordUndercursor taked at least one character, even for empty
+buffers.
+* Fixed: "Intelligent Indent" could crash when taking the first line of the
+buffer as reference if it was empty.
+
+Revision 1.670 2005/04/28 20:31:49 set
+* Added: [VHDL] Indent rules for port and generic.
+* Added: [sLisp] pmacros can execute sLisp code.
+* Modified: [VHDL] "Component instantiation" pmacro to follow port and
+generic indent.
+* Modified: [VHDL] "Select signal (With)" pmacro indentation, made simpler.
+* Added: [VHDL] A pmacro to generate a big file header, it conforms
+OpenCores guidelines and borrows some ideas from ESA guidelines.
+* Fixed: [Undo] Now we have upto 256 undo operations but the group counter
+was just a char.
+* Fixed: [Undo] When inserting text "out-of-the-buffer" the spaces added to
+fill the hole weren't recorded in the undo history.
+* Fixed: "Intellingent Indent" mode only applies for line 2 and above, not
+1 because by the time of this check we already added a line.
+
+Revision 1.669 2005/04/28 15:55:59 set
+* Fixed: Clipper 5.x functions parser to include numbers in names.
+* Fixed: Clipper 5.x pmacros without names.
+
+Revision 1.668 2005/04/26 19:51:16 set
+* Added: [TAGS] Support for the new languages and kinds added to ectags
+5.5.4. Including the new languages: C#, Erlang, JavaScript, SML, SQL, Vera
+and Verilog.
+* Added: [TAGS] Support for VHDL tags, not yet contributed to the project.
+* Fixed: In the "Intelligent indent" if the line ended with ( or ) the
+lastchar wasn't it.
+
+Revision 1.667 2005/04/25 14:59:20 set
+* Added: [sLisp] GetMaxProjectItem, GetProjectItem and CloseWindowNumber
+functions. They help to implement a search in all project items. SHL & DOC.
+* Added: [sLisp] Two new macros to search in all opened windows and in all
+project items.
+* Fixed: [sLisp] When selecting another window the current remained locked.
+
+Revision 1.666 2005/04/21 18:52:55 set
+* Updated: Spanish translation. Also fixed a typo reported by Andrs.
+
+Revision 1.665 2005/04/21 18:23:56 set
+* Fixed(?): The way undo/redo works with the spaces added/removed when
+editing/committing a line. The change is small but with a huge impact. It
+means undo/redo could have new bugs.
+
+Revision 1.664 2005/04/21 14:31:12 set
+* Fixed: The indent rules now checks if the language is case sensitive when
+comparing the "FirstWord".
+* Added: [configuration] A check for RHIDE tools when the user enables the
+maintainer mode.
+* Added: [configuration] AA-lib package example.
+* Added: Clipper and Perl indentation rules.
+* Fixed: [SHL] Perl *is* case sensitive.
+
+Revision 1.663 2005/04/20 19:21:39 set
+* Added: A simple configuration for the "Intelligent C Indent" mode, now
+renamed "Intelligent Indent". The new behavior isn't 100% equal to the
+previous.
+* Added: Indentation configuration for C/C++ and VHDL.
+* Added: Documentation for the new features.
+
+Revision 1.662 2005/04/15 19:16:08 set
+* Fixed: When using the option to see all pmacros and a pmacro without a
+name was included the editor crashed.
+* Added: Now the pmacro expansion is more cleaver. If you ask to expand
+outside the text or a wrong sequence the editor offers the list of
+available macros. If only one character is available at the left side of
+the cursor all the macros that start with it are offered (all if none makes
+a match).
+* Added: Default values for pmacros vars.
+* Added: Documentation for the new pmacros stuff.
+
+Revision 1.661 2005/04/14 20:18:39 set
+* Added: Pseudo-macros for VHDL.
+* Fixed: Xilinx errors parser.
+* Updated: Help to reflect all languages that supports "list of functions"
+* Added: A new constructor to TSHzLabel, it allows to pass an intl cache.
+* Modified: TAGS code to reuse newStrL.
+* Added: Heuristic parser to search definitions in .pmc files.
+* Modified: Undo array to hold 256 changes instead of 32.
+* Added: Now pmacros can ask values to the user and insert them in the
+expanded code. Very useful for VHDL.
+* Modified: The dialog to choose the pmacros now is sorted by name and
+supports incremental search.
+* Fixed: Match pair on the fly was broken by the changes in "modified"
+member.
+* Fixed: A bug in undo operations that involved the undo of "insertBuffer"
+that removed extra spaces.
+
+Revision 1.660 2005/03/22 19:04:03 set
+* Fixed(?): Undo operations involving spaces at the end of a line.
+
+Revision 1.659 2005/03/07 14:50:49 set
+* Added: InfView now tries to guess the INFOPATH using the SET_FILES
+environment variable. The editor also tries to guess SET_FILES so we have
+a good chance here ;-) Suggested by Arnold.
+* Fixed(?): To disable the "match pair on the fly" pending paint if the
+buffer is modified before the pair is painted. That's useful for sLisp
+macros where various operations are performed before the buffer is updated.
+It works cleaning the request in the "MarkAsModified" member.
+
+Revision 1.658 2005/02/23 19:36:19 set
+* Fixed: [Win32] Avoid to add the relative path to project items when they
+are UNCs. Pointed out by Grzegorz.
+
+Revision 1.657 2005/02/23 19:21:40 set
+* Fixed(?): When loading a project file with a smaller screen size than the
+last used and using vertical desktop windows you could get a crash.
+Reported by Grzegorz.
+* Fixed: MSVC doesn't support the mechanism to compare files by its inode.
+For this reason the searches by file name must be smarter and expand the
+names to the full path. Patch by Grzegorz.
+
+Revision 1.656 2005/02/21 19:06:26 set
+* Added: [Standalone InfView] Menu entry to copy to the OS clipboard. Patch
+by Thiago.
+
+Revision 1.655 2005/02/21 18:54:20 set
+* Fixed: [cosmetic] A couple of typos (interprete -> interpret). Reported
+by Thiago.
+
+Revision 1.654 2005/02/21 18:05:19 set
+* Modified: Now the "Tab" behavior is implemented by an editor command
+(cmcSmartTab). In this way sLisp code can insert "smart tabs". Tabs in
+pseudo macros are translated to this command and the default keyboard
+assigment for Tab is this command. People using a keybind.dat file will
+need to add this assigment in order to keep the same behavior. Added as a
+result of a thread in the mailing list (Arnold and Thiago).
+
+Revision 1.653 2005/01/31 14:13:33 set
+* Fixed: [MSVC] compilation problems in pvhdl.cc. Reported by Grzegorz.
+* Fixed: [TAGS] allocation of -1 for some files. Reported by Grzegorz.
+
+Revision 1.652 2005/01/05 13:10:32 set
+* Fixed: The growing mode of the "assigned to" widget in the kbd conf.
+Reported by Thiago.
+* Modified: The behavior of TNoStaticText, now the whole string is
+memorized when setText is used.
+
+Revision 1.651 2005/01/04 15:55:29 set
+* Added: VHDL heuristic parser.
+* Modified: [Cosmetic] Copyright year to include 2005.
+* Modified: [Cosmetic] The "assigned to" placement to be more clear (as
+Thiago suggested).
+
+Revision 1.650 2005/01/03 19:43:26 set
+* Added: [configuration] When the configure script doesn't detect libmigdb
+now it says where to download it.
+* Added: [Error parsers] Support for Xilinx tools (lamentably not really
+useful is they are used with wine :-(
+* Modified: Now messages in the "message window" that contains \r\n on UNIX
+systems are modified to also remove the \r. Useful when parsing the output
+of programs running with wine ;-)
+* Modified: Small patch from Grzegorz for the Python parser
+(STANDALONE_TEST stuff).
+* Modified: [Cosmetic] The error message generated when the editor can't
+load a desktop file. It now says that the problem could be the file belongs
+to other user.
+
+Revision 1.649 2004/12/13 15:45:52 set
+* Added: When configuring the keyboard the dialog to create a key sequence
+now shows information about what's currently assigned to the sequence we
+are creating. Suggested by Thiago.
+
+Revision 1.648 2004/12/07 14:35:46 set
+* Fixed: A bug in Ctrl+K-V (may be also in other places). Under some
+situations it could unsynchrnonize the drawing pointer making the text look
+strange. The problem was that deleteRange assumed that from pointer was
+buffer+selStart and hence used selStart as its offset (instead of
+from-buffer) when checking if the drawing pointer needed adjust.
+* Modified: Again ;-) the behavior of the selection search. Now the
+selection isn't copied into a temporal buffer. Instead editors claims the
+"current selection" and when the user performs a search we extract the
+text from the last editor that claimed to have it or from the current if
+none claimed it. When hidding a selection and the editor was the one with
+the current selection it informs that no longer have it. When unhidding a
+selection this editor claims to have the current selection.
+
+Revision 1.647 2004/12/06 17:58:53 set
+* Added: [config] Option to disable libmigdb support.
+* Added: [gcc 3.x] Use of a new macro in TV to cast pointers into 64 bits
+values.
+* Modified: [config] Now TV 2.0.4 is needed.
+
+Revision 1.646 2004/12/06 15:23:28 set
+* Modified: The behavior of the "selection search" to search for the last
+selected text instead of the current local selection.
+* Modified: To use the "case" of the current language.
+* Added: Shift+F7/F8 as short cut for these new commands.
+
+Revision 1.645 2004/12/02 20:34:12 set
+* Fixed: Both new menu extries were for forward search ;-)
+* Added: The new menu entries to be i15d.
+
+Revision 1.644 2004/12/02 20:07:17 set
+* Added: Two new commands to emulate what Ivan and Sergio described as
+a search mechanism using the selected text. Needs some adjustments.
+
+Revision 1.643 2004/12/01 19:15:56 set
+* Fixed: [WWW] The names of the images in the TAGs tutorials weren't 8+3
+clean. Pointed out by DJ Delorie.
+* Added: [WWW] A page about "Glaciar Perito Moreno"
+
+Revision 1.642 2004/12/01 17:26:29 set
+* Added: Search backwards. That's a first approach and even when it seems
+to work I'm sure it have various bugs ;-)
+* Added: A message when trying to search inside a selection and no
+selection is available.
+* Added: Column to error messages. Currently used by the internal GNU
+errors parser. I tested it with GHDL.
+* Updated: Link to the new 0.5.4 installer for Win32 in the web page.
+
+Revision 1.641 2004/11/29 18:10:59 set
+* Modified: Version to 0.5.5.
+* Updated: [WWW] To reflect the new release.
+* Added: Python heuristic for the list of functions, contributed by
+Grzegorz.
+
+-------- CVS TAG r0_5_4DOS
+
+Revision 1.640 2004/11/29 16:20:31 set
+* Fixed: [DJGPP][Maintainer dependencies] The path to system headers to be
+excluded from dependencies must include the gcc 3.x dir.
+* Fixed: [DJGPP][gcc 3.x] Inline assembler lines using more than one line.
+* Modified: [DJGPP][libamp] Moved some headers.
+
+-------- CVS TAG r0_5_4
+
+Revision 1.639 2004/11/23 00:42:57 terrible
+* Updated: Debian packaging to version 0.5.4-3 (no changes really).
+
+Revision 1.638 2004/11/22 14:42:08 set
+* Fixed: [X11+sLisp] When the OS had a secondary clipboard (selection
+clipboard) the selection was stopped after copying. This interferes with
+sLisp macros. Reported by Thiago.
+
+Revision 1.637 2004/11/02 20:19:01 set
+* Added: [WWW] Instructions to download using ftp and note about the new
+Win32 installer.
+
+Revision 1.636 2004/11/02 19:56:03 set
+* Added: [Compilation][MSVC] Option to compile with debug information.
+From information sent by Grzegorz.
+* Modified: [Configuration] ar and install detection. Now more robust.
+* Fixed: [Installation][Solaris] make can't be detected trying gmake.
+
+Revision 1.635 2004/10/20 20:41:07 set
+* Fixed: Last patch that involved copyright year was incomplete.
+
+Revision 1.634 2004/10/19 18:10:41 set
+* Fixed: [Compilation][MSVC] More empty -I options, this time in
+infview.bmk. Reported by Grzegorz.
+
+Revision 1.633 2004/10/18 20:58:01 set
+* Fixed: [Debug] when opening the disassembler window the editor failed to
+create the correct expression to find the starting address of the current
+function. This isn't critical but generates an error message and the
+function isn't disassembled from the beginning.
+
+Revision 1.632 2004/10/18 16:50:14 set
+* Fixed: [Cosmetic] Copyright year shown in the command line help. Unified
+with the one in the about box.
+
+Revision 1.631 2004/10/14 19:42:23 set
+* Modified: [Compilation] The dependencies extractor to put the OBJFILES
+definition before its use. It should help nmake.
+
+Revision 1.630 2004/10/13 14:44:08 set
+* Added: [WWW] New Win32 installer released by wec (v0.5.2).
+* Added: [WWW] SuSE 9.1 and Fedora Core 2 packages released by bbcat
+(v0.5.3).
+* Added: [WWW] XTerm snapshots for various systems.
+
+Revision 1.629 2004/10/12 20:43:44 set
+* Added: [Install] Support for Solaris' native install tool. It have
+nothing todo with POSIX install.
+* Modified: [Config] Looks like some versions of bzlib had the right
+prototypes in the header but the library contained the pre 1.0 and 1.0
+function names. To avoid detecting it as pre 1 now I test using C++ where
+function prototypes are mandatory. Seen on Solaris with bzlib 1.0.1.
+* Added: [Compilation] Support for Solaris 9 implementation of isspace when
+compiling with gcc 3.x. It uses the char value as index of an array.
+* Fixed: [Solaris] stackdbg.c didn't request alloca.
+* Fixed: [MSVC][Compilation] Missing () in comparissons like: overwrite !=
+((un.Flags & undoOverWrite)!=0) ? True : False. Reported by Grzegorz.
+* Modified: [MSVC][Compilation] The command to compile the assembler files.
+Not yet tested.
+* Modified: [MSVC][Compilation] Command line option to compile the code.
+It looks like new versions of MSVC can't compile code that includes
+iostream using /GX-
+* Fixed: [MSVC][Compilation] An empty include path made the unified
+makefile useless. Reported by Grzegorz.
+
+Revision 1.628 2004/10/12 15:41:45 set
+* Fixed: "Paste Emacs Mode" not grayed when the mode isn't available.
+Suggested by Grzegorz.
+* Added: [SHL] Emacs mode for shell scripts and XML files. Contributed by
+Grzegorz.
+
+Revision 1.627 2004/10/12 14:59:13 terrible
+* [Fixed][Config] Its weird, but in the Sarge I use at work, included
+scripts must have . ./binary, it isn't enough to have . binary. This change
+is very small so I am confident it will not break things.
+
+Revision 1.626 2004/10/10 21:13:16 terrible
+* [Debian] Updated to 0.5.4-2, just small cosmetic changes.
+
+Revision 1.625 2004/10/08 21:23:16 set
+* Fixed: [Config][Solaris] modified to avoid the holidays plug-in creation.
+They need more work to detect native ld.
+
+Revision 1.624 2004/10/08 21:15:55 set
+* Fixed: [Config][Solaris] native ar is usable.
+
+Revision 1.623 2004/10/08 14:51:32 set
+* Fixed: [Config] AAlib detection. Reported by Ivan.
+* Added: [Config][Tru64] Detection of Tru64 (OSF1), but the tools I found
+there have some major bugs, so you can't compile all.
+* Added: [DOCs] More info about the supported UNIX systems.
+
+Revision 1.622 2004/10/04 20:24:51 set
+* Fixed: [Config] Typo in last patch, sorry.
+
+Revision 1.621 2004/10/03 22:29:01 terrible
+* [Debian] Updated packaging to version 0.5.4-1.
+
+Revision 1.620 2004/10/02 20:51:23 set
+* Fixed: [Config][Darwin] Wrong TV dynamic lib search. My previous tries
+worked because I had .so files in this system ;-)
+* Added: [Config][SuSE 8] AA lib detection to try using C++ because we need
+to include the header in a C++ file an 1.2 have a bug that prevents it.
+* Fixed: [Install][UNIX] The REMOVE_UNNEEDED neede +x, now is just included
+* Fixed: [Compilation][SuSE] SuSE SLES 8 defines _GNU_SOURCE in the command
+line!!
+* Fixed: [Compilation] A couple of ambiguous casts when compiling for
+systems with 64 bits pointers (debug.cc, seen on AMD64).
+
+Revision 1.619 2004/10/01 21:33:26 set
+* Fixed: [Config] MP3 support must be disabled for any OS different than
+DOS, Linux and Solaris. In this way the user doesn't need to disable it
+by hand.
+* Fixed: [Config] Wrong C++ flags when none specified. Don't know when was
+introduced. Looks like an error while editing the file.
+* Added: Support for Darwin (6.8 MacOS X 10.2), the editor seems to be
+usable using xterm (some glitches are observed).
+ * Added PPC CPU detection in the way that's defined in Darwin.
+ * Added support for the native ar.
+* Added: Support for OpenBSD (3.4).
+* Verified: Working for NetBSD (1.6.1) and FreeBSD (4.8).
+
+Revision 1.618 2004/09/29 20:07:11 set
+* Fixed: [DOCs] Message about pressing F1 in the printed version. Also
+wrong copyright year.
+* Fixed: strdup vs delete[] in tips.cc, reported by valgrind.
+* Updated: [WWW] Main page, changes and readme. 0.5.4 is currently named
+as pre-release.
+-------- CVS TAG r0_5_4rc1
+
+Revision 1.617 2004/09/24 18:59:51 set
+* Fixed: The SF Rev 1.523 patch about holidays clean-up was buggy. It
+released the loaded stuff but didn't indicate it. So when opening the
+calendar again the code used freed memory.
+
+Revision 1.616 2004/09/23 19:45:33 set
+* Fixed: [sLisp] edf* constants not working. The WinDebugger definition was
+unsorted. Reported by Thiago.
+
+Revision 1.615 2004/09/23 19:19:07 set
+* Fixed: [RPMs] Problems to generate the RPMs using Red Hat 9.0. The
+changes introduced by bbcat should be enough (they are for Fedora Core 2),
+but more is needed to avoid problems with RH9.0. The problems are related
+to the generation of a RPM file with debug info.
+
+Revision 1.614 2004/09/23 19:05:45 set
+* Fixed: [BC++] The last change to support pcre/pcre.h needed changes in
+the configed.h file for Win32.
+
+Revision 1.613 2004/09/22 18:45:13 set
+* Fixed: [NHP] isDisassemblerEditor not initialized when loading from disk.
+
+Revision 1.612 2004/09/20 14:16:01 set
+* Fixed: [MSVC] When you compile for "Debug" the compiler disables *all*
+the optimizations. Including the dead code. For this reason MSVC also needs
+fake references.
+
+Revision 1.611 2004/09/20 14:13:03 set
+* Added: [Config] A command line option to specify a path for includes.
+This path is used for the configuration tests and for the editor.
+
+Revision 1.610 2004/09/17 20:52:41 set
+* Added: [WWW] Some changes towards the next release.
+
+Revision 1.609 2004/09/17 18:51:55 set
+* Fixed: [MSVC] Another min/max mix. Reported by Arnold.
+
+Revision 1.608 2004/09/17 16:38:35 set
+* Added: [Cygwin] Workaround for bugs in Cygwin's perl. Cygwin is
+configured to use DOS files, but when parsing DOS files you must match the
+/r char. DJGPP implementation is much more cleaver about it.
+* Added: [Cygwin] libmigdb detection.
+* Note: Current status of the editor using brand new Cygwin is "compile but
+the resulting binary is useless". Note that while compiling the editor I
+got SIGSEGVs from Perl and bash. It looks like Cygwin still alpha, at least
+for Windows 98 SE.
+
+Revision 1.607 2004/09/17 16:25:59 set
+* Modified: [Config] Now the .po files are regenerated only if the user
+configures enabling the maintainer mode. This should reduce CVS collisions.
+
+Revision 1.606 2004/09/17 16:09:46 set
+* Added: [Debug] An advice dialog when debugging in the Linux console
+indicating the program will be started in another VT. Also some explanation
+about it in the docs.
+
+Revision 1.605 2004/09/16 20:59:51 set
+* Added: [Config] AMD64 and NetBSD detection. It doesn't mean they are
+supported.
+
+Revision 1.604 2004/09/15 13:10:06 set
+* Fixed: [Config] wrong pcre header selected when using shipped pcre.
+Problem introduced by the recent patch to support pcre/pcre.h.
+
+Revision 1.603 2004/09/14 19:01:11 set
+* Added: [Config] Message warning about the lack of debug support.
+* Added: [Distrib] The list of added/fixed things. 66 new things and 40
+fixes.
+
+Revision 1.602 2004/09/10 19:55:06 set
+* Modified: To include libmigdb in the distro (if available).
+* Modified: [Config] To use the shipped libmigdb if none installed.
+* Modified: [Config] To detect installations where pcre header is in the
+pcre directory. Red Hat seems to use it according to Vik Heyndrickx.
+
+Revision 1.601 2004/09/10 18:11:57 set
+* Added: Debug and InfView stuff to redmond.smn. InfView stuff to
+simple.smn.
+* Added: [i18n] Data Window menu and missing debug menu entries to
+editmenu.cc.
+* Updated: [i18n] Spanish translation.
+
+Revision 1.600 2004/09/09 20:47:22 set
+* Fixed: [Debug] various menu entries associated to dialogs that didn't
+indicate it using "...".
+* Added: [i18n] various debug menu entries to editmenu.cc so they can be
+translated.
+
+Revision 1.599 2004/09/08 20:19:43 set
+* Added: [DOC] More debug documentation, now the core functionality is
+documented.
+* Added: [Help] Linked debug help contexts to the documentation.
+
+Revision 1.598 2004/09/08 18:14:32 set
+* Added: [SHL] For SPARC assembler.
+* Added: [Debug] syntax highlight for SPARC targets. Now the code can be
+adapted to other architectures with minor changes. Also tested stack window
+on an Ultra 60 machine.
+
+Revision 1.597 2004/09/07 20:00:02 set
+* Added: [Debug] Support for the Stack Window on SPARC machines. Not
+tested.
+* Fixed: [Debug] The disassembler window to hide tabs and use 8 as tab
+size.
+
+Revision 1.596 2004/09/06 17:15:46 set
+* Fixed: [Debug] Problems with the registers list when using gdb 6.x.
+That's a workaround for gdb bug "mi/1770".
+
+Revision 1.595 2004/09/06 16:25:32 set
+* Fixed: [RHIDE] Another name collision (InsertEnviromentVar).
+
+Revision 1.594 2004/09/06 13:30:20 set
+* Fixed: [Debug] cmInspect command collision with RHIDE's command. Reported
+by Vik Heyndrickx <v/pandora/be>.
+
+Revision 1.593 2004/09/01 20:24:44 set
+* Fixed: [Debug] cmDWGotoAddress doesn't have to validate if the address
+is valid, that's just a reference.
+* Fixed: [Debug] cmDWFollowPointer and cmDWFollowPtnNew failed because gdb
+interpreted "*0xXXXX" as just "0xXXXX". To avoid it and also avoid the
+mechanism we use to "take the address of"
+* Fixed: [Debug] Wrong state displayed in the Debug Window after closing
+the debug session and making it visible.
+* Modified: [Debug] Moved Data Window commands cmDWBaseIncrement and
+cmDWBaseDecrement to the movement submenu.
+* Added: [Debug] Documentation for all the debug commands. Help contexts
+isn't linked, yet.
+
+Revision 1.592 2004/08/30 15:34:05 set
+* Fixed: [Tags] Abort when doing word completion and the starting word was
+"bigger" than the last tag in the list. Reported by Juan Pablo.
+
+Revision 1.591 2004/08/27 18:27:00 set
+* Fixed: [Debug] Data Window commands not enabled after recycling a data
+window.
+* Fixed: [Debug] Data Window: Fill, Clear and Move operations didn't
+update the changes.
+* Added: [Debug] Data Window: Explicit error when trying to use a block
+of more than 1 MB. Warning about speed for more than 128 KB. Not sure if
+those limits are good.
+* Added: [Debug] Option to don't show again to 3 of the confirmations about
+closing the debug session and killing the debuggee.
+* Added: [Debug] Advice about setting debug options without a project.
+* Modified: [Debug] Data Window: When entering a wrong value in the block
+operations now we go back to the dialog so the user can fix the wrong
+value instead of entering all again.
+* Modified: [Debug] Data Window: Warning about empty fields in the dialog
+for addresses. This is much more descriptive than an error from gdb ;-)
+
+Revision 1.590 2004/08/26 20:49:05 set
+* Fixed: [MSVC] Calls to min/max with different arguments (unsigned vs
+signed). They generate errors with MSVC 6.0. Patch by Arnold.
+
+Revision 1.589 2004/08/25 20:51:54 set
+* Fixed: [Debug] Crash when gdb failed to report registers. Found because
+a bug in gdb CVS 2004-08-25.
+* Fixed: [Debug] TDataWindow go to new address not working.
+* Fixed: [Debug] CPU line disapearing when setting a breakpoint in other
+line.
+* Added: [Debug] "Go to cursor" for the disassembler window.
+* Added: [Debug] Made more robust the code that disassembles. Now we first
+try to solve the function name and if it can be solved we use it otherwise
+we disassemble from the current code. We also check if the distance
+between the start of the function and the current point isn't huge, some
+times gdb fails to detect the real function.
+* Added: [Debug] Command to detach from "PID target".
+* Modified: [Debug] The Run/Continue to also mean "Atach"
+
+Revision 1.588 2004/08/24 21:17:53 set
+* Added: [DOC] More documentation about debug features.
+* Fixed: [Cosmetic] Some menu entries that opens dialogs to indicate "..."
+* Modified: [Debug] Avoid asking for confirmation when closing a debug
+session that isn't stopped nor running.
+* Fixed: [Debug] If gdb failed to disassembler code we shortly SIGSEGVed in
+the idle update.
+* Fixed: [Debug] The debug options dialog didn't return success.
+
+Revision 1.587 2004/08/24 13:16:38 set
+* Fixed: [Debug] A couple of typos in new code.
+
+Revision 1.586 2004/08/24 00:01:16 set
+* Added: [config] libmigdb version detection.
+
+Revision 1.585 2004/08/23 15:54:41 set
+* Fixed: [MSVC] The way the linker is called from the makefile. Arnold
+Wiegert's patch.
+* Fixed: [MSVC] Lack of Boolean cast in ceditor.cc. From Arnold.
+* Fixed: [MSVC] Lack of bool definition in pphp.c. From Arnold.
+* Fixed: [RPMs] Wrong directive in specs. Patch from bbcat.
+
+Revision 1.584 2004/08/22 22:45:16 set
+* Fixed: [Debug] Debug Window, Watches Window, Inspector Windows and
+Data Windows now saves not only its current size but also the "unzoomed"
+size.
+* Fixed: [Debug] Inspectors can't be closed while "running".
+* Added: [Debug] Now when we add a file to the project its path is added
+to the list of paths for sources.
+* Added: [Debug] When we add a path to the list of sources paths the path
+is also passed to gdb.
+* Added: [Debug] The code to enable MI v2. Currently it only helps
+inspectors making them much faster.
+* Added: [Debug] The code to disable the psym search workaround for the bug
+in gdb. It will allow faster startup when the bug is fixed without needing
+to change the editor.
+* Added: [Tags] Busy indicator while we load the tags from disk.
+Lamentably only the X11 driver implements it.
+* Modified: [Debug] The way "ignore" is interpreted: it means the times
+the breakpoint will be ignored when starting the program or when modifying
+or setting the breakpoint.
+* Modified: [Debug] Instead of reporting "OK" as an error now we explain
+the operation can't be performed.
+
+Revision 1.583 2004/08/20 16:10:53 set
+* Added: [WWW] Links to the DOS precompiled snapshots.
+* Added: [WWW] Image showing the editor debugging itself.
+* Fixed: [RPM] Problems to create the rpms using Fedora Core 2. Patch by
+bbcat.
+
+Revision 1.582 2004/08/19 18:07:39 set
+* Added: [InfView] Its own menu.
+* Modified: [InfView] Alt+B and Alt+I shortcuts to avoid menu collisions.
+
+Revision 1.581 2004/08/18 14:15:42 set
+* Fixed: [BC++] Lack of sys/time.h used in debug.cc.
+
+Revision 1.580 2004/08/18 14:14:47 set
+* Fixed: [gcc] Some gcc 3.4.1 requirements:
+1) Default argument values for function pointers no longer allowed.
+2) Missing string header in one of the screen savers.
+3) Passing pointers to packed struct elements no longer supported.
+4) vsync collision with allegro, didn't annoy gcc 2.9x
+
+Revision 1.579 2004/08/17 15:06:50 set
+* Fixed: [config] wrong makeinfo 4.7 detection. Patch by Andrea.
+* Fixed: [Debug] missing dummies to compile without debug code.
+* Updated: [i18n] spanish translation.
+
+Revision 1.578 2004/08/16 21:24:50 set
+* Fixed+Modified: The "paste" operation for TInputLinePiped views. Now the
+text is pasted without destroying the previous value (unless it is selected).
+The old mechanism was broken when linking to the Unicode branch of TV because
+the way it changed the "data" member was incomplete.
+* Added: [Tags] an option to regenerate the central file. Some times ctags
+fails in the generation of incremental files and lets bogus registers. They
+can be very annoying and in this case the best is to just regenerate the
+whole file from scratch.
+* Fixed: The list for word completion had a wrong vertical size when we had
+repeated tags in the list to choose. Only one was visible but the size was
+computed counting the repetitions.
+* Modified: If the list of items in the word completion list box isn't bigger
+than the list's height we no longer add a useless scroll bar.
+* Added: [Debug] Disassembler window!!! a cute one ;-) It have an editor so
+you can see the assembler with syntax highlight. If the information about
+the source code is available it also shows the source code mixed with the
+assembler.
+* Added: [Debug] Optional key for the "add with scope" in the Watches Window.
+* Modified: DynStrCat* to accept NULL pointer for initialization and take
+const char * arguments.
+* Added: Moved the newStrL function from a static place to a public header,
+that's very useful.
+* Modified: The way openEditor works when using oedNoSelect flag. It should
+be better but could affect the message window browsing.
+
+Revision 1.577 2004/08/13 20:49:21 set
+* Modified: [Debug] +/- keys in the inspector gives problems when using
+italian keyboards and Linux console. So now + can be replaced by E and -
+by C (Expand/Collapse). Both work so the user can choose.
+* Modified: [Debug] Added more error checking to the inspectors creation.
+A bug in gdb makes it die when evaluating some expressions. So now the code
+checks it and goes to "disconnected" state. It will need much more adjusts
+before a gdb crash doesn't affect the editor.
+* Both from Andrea's reports.
+
+Revision 1.576 2004/08/13 19:01:51 set
+* Fixed: [DOC] txt generation details when using makeinfo 4.7. From more
+info provided by Andrea.
+
+Revision 1.575 2004/08/13 18:10:17 set
+* Added: [Debug] Options to configure: gdb binary, xterm binary, main
+function, max. number of lines in debug window, gdb response time
+out and disable gdb banner.
+* Added: [Debug] The messages in the debug window are limited in
+number and cleared when a new session is started.
+* Added: [Debug] A dialog to ask if we want to wait more when a time
+out in gdb response is detected. Not tested.
+
+Revision 1.574 2004/08/12 21:07:32 set
+* Fixed: [Debug] if we specified a path for sources when gdb wasn't running
+the editor crashed. It was only from the dialog to specify a file.
+* Added: The "FindFile" function now also looks for the filename alone. So
+if we look for ./examples/ex3d.c FindFile will try with it and then with
+ex3d.c alone.
+* Added: [Debug] frames of the available threads and also selection of
+current thread by default. So it can be used to display current threads.
+
+Revision 1.573 2004/08/11 21:06:29 set
+* Added: [Debug] Select thread option. But this is quite useless. GDB
+doesn't report any info, just the ID and doesn't remove finished threads
+from the list. Which is worst: selecting a finished thread doesn't return
+any error, the message is printed in the console. Yet another bug in gdb.
+* Added: [Debug] An option to delete all the breakpoints, watchpoints, etc.
+* Added: [Debug] When adding a watchpoint the word under cursor is used as
+starting point.
+* Fixed: cmcCutClipWin command not dis/enabled when selecting text.
+Reported by Arnold Wiegert.
+
+Revision 1.572 2004/08/11 16:30:07 set
+* Fixed: [DOC] More makeinfo 4.7 details. From Andrea's feedback.
+
+Revision 1.571 2004/08/11 15:08:37 set
+* Added: [Debug] Persistence to the Data Windows. Of course they need to be
+"recycled".
+* Added: [Debug] Shortcuts for "Run/Continue", "Inspectors" and "Calling
+Stack". The first could need to be exchanged with SDG shortcut, not sure.
+The other two are the same used in RHIDE.
+
+Revision 1.570 2004/08/10 19:56:45 set
+* Added: [Debug] A dialog asking for the file location when it couldn't be
+located in the current path for sources. It have a similar behavior to what
+RHIDE does.
+* Fixed: [Debug] The "calling stack" command crashed if the functions were
+located at different files.
+* Fixed: [Debug] The "calling stack" to add "solved filenames", not the
+names returned by gdb.
+* Added: [Debug] The "calling stack" to jump to the "frame 1"
+* Fixed: [Debug] When deleting recycled inspectors we deleted the "fake"
+tree twice.
+* Added: [Debug] Now the data window disables all its commands when they
+can't be used.
+* Fixed: [Debug] In one of the last optimizations in the watches window I
+forgot to redraw the window, so it looked like no item changed until we
+selected it.
+* Fixed: Leak in TPrjItemColl::addFile when trying to verify if a file
+existed.
+* Fixed: Leak in the TMultiMenuBar when the selected menu wasn't the first
+in the list.
+
+Revision 1.569 2004/08/09 23:50:42 set
+* Modified: [Cosmetic] The multi menu bar to avoid drawing the first menu
+and quickly switch to the default one (the last in the list).
+
+Revision 1.568 2004/08/09 21:21:43 set
+* Fixed: [DOC] @xref in sdg.tx without period.
+* Fixed: DOS' end of file in djmdr.s.
+* Both from Oswald.
+
+Revision 1.567 2004/08/09 20:59:24 set
+* Added: Context sensitive menues. Also extended the .smn file language to
+create such a thing. Currently used only for the data window.
+* Fixed: Problems in the data window when trying to display the ASCII 0.
+Also modified to show the full characters range, not just ASCII range.
+* Fixed: Data Window doing 2 reads when created.
+
+Revision 1.566 2004/08/09 15:14:29 set
+* Fixed: [DOC] Problems in the HTML generation using makeinfo 4.7.
+* Fixed: [DOC] Problems in the DVI/PS generation (macro name collision).
+Again from info sent by Andrea Mazzoleni (amadvance/users/sourceforge/net).
+
+Revision 1.565 2004/08/09 12:54:47 set
+*** Data Window stuff:
+*** Related to the new code
+* Fixed: isValidUL not working.
+* Fixed: No input box when starting from a value from the "word under
+cursor"
+* Added: Implemented the memory write.
+* Added: Error message to indicate a memory location can't be accessed when
+validating it. No silent fail.
+* Added: Stack Window.
+* Added: TDskWin wrapper.
+* Added: Update when debuggy stops.
+* Modified: EnterAddresses to show input lines without separation.
+*** Also related to the original code
+* Fixed: The FIXMEs about using smaller blocks.
+* Fixed: Buffer to hold selected file name wasn't as long as PATH_MAX
+(SIGSEGV).
+* Fixed: Lack of update after reading from a file.
+* Fixed: Creation of empty files if the from or length was wrong.
+* Fixed: When debugging two programs with different endian types without
+exiting the code taked only the first. Now it should work, but is hard to
+check ;-)
+* Fixed: The stack window first detects the target architecture, if it
+isn't x86 gives an error.
+* Fixed: Wrong color and frame of the indicator when the window wasn't
+selected.
+* Added: ESC closes the window.
+* Added: An attribute to show memory changes, that's really nice because
+you can see what changed in each program step very quickly.
+* Modified: When updating the memory modified cells are now reset to "not
+edited"
+* Modified: Removed %#lx in favor of 0x%lx, I think that's more portable.
+I encapsulated most of these printfs in one member.
+* Modified: All the stuff about a linked list of windows, now they update
+itself using the broadcast that indicates the debugger changed its state.
+I keep a counter of windows to avoid sending a broadcast to nobody ;-)
+
+Revision 1.564 2004/08/06 21:10:36 set
+* Added: A first part of the Molnar Laszlo's "Data Window v0.1" that he
+contributed to RHIDE. A lot of things must be solved because things are
+quite different when you can directly access the debuggy memory :-(
+* Fixed: A couple of leaks that happened when closing a project and loading
+another. Reported by Valgrind while debugging the "Data Window" stuff.
+* Note: The debugging stuff is quite functional, Inspectors are great for
+complex structures like trees. But the whole thing isn't stable, more
+adjusts are needed.
+
+Revision 1.563 2004/08/05 19:26:28 set
+* Fixed(?): [DOC] The complement part of the "@end menu" makeinfo 4.7
+problem. This time for the @itemize.
+* Fixed: [DOC] newer versions of the TeX package defines "html" macro which
+collides with the one in rhidemac.*.
+* Added: [DOC] SDH command line option to avoid numbering chapters. It
+looks like makeinfo 4.7 does it by itself (and by default!).
+From info sent by Andrea Mazzoleni (amadvance/users/sourceforge/net).
+
+Revision 1.562 2004/08/05 18:14:21 set
+* Modified: [sLisp] CommentIndent macro, enhanced version from Thiago.
+
+Revision 1.561 2004/08/04 20:09:47 set
+* Added: Inspectors!!! They are quite different to the RHIDE inspectors.
+They are suitable for complex structures and you can have various in the
+desktop.
+
+Revision 1.560 2004/08/02 15:23:03 set
+* Fixed: makeinfo 4.7 enforces the use of @pxref for (@x{...}).
+* Fixed(?): makeinfo 4.7 no longer supports "@end xxxx" commands inside
+macros :-( so I added an aditional intermediate file to avoid them.
+
+Revision 1.559 2004/08/02 13:22:41 set
+* Added: [sLisp] CommentIndent macro contributed by Thiago.
+
+Revision 1.558 2004/08/02 12:50:45 set
+* Added: Watchpoints!!!! now we can easily hunt wild writes ;-)
+* Modified: The breakpoints are moved only if the target changed its time
+stamp.
+* Added: i18n to the debug dialogs.
+* Fixed: i18n of the project window title.
+* Updated: Spanish translation.
+
+Revision 1.557 2004/08/02 12:44:28 set
+* Fixed: When going step by step and the "match pair on the fly" was
+enabled the code to restore the highlighted pairs did a mess with the
+background color if the pair involved a "CPU line".
+* Added: After using "Run a program" the editor updates the moved
+breakpoints. Also an option to disable it. Note: That's what made me create
+the splines, lamentably Robert never used them for RHIDE.
+* Added: A beep when "Run a program" finishes. Option to disable.
+* Added: Close the debug session before running the external program. An
+option to disable it. That's needed for OSs where we can't overwrite opened
+files and is also needed to woraround gdb bugs.
+* Added: Option to ask for confirmation if the "Run program" will kill the
+current debug session.
+* Added: [sLisp] edfRunStopDebug option to RunProgram.
+
+Revision 1.556 2004/07/30 21:10:17 set
+* Modified: Now the cmc*Win (Copy,Cut,Paste) commands are called cmc*OS to
+reflect their real use. The old names remains as aliases. From a suggestion
+by Thiago.
+* Added: Ins,Del,+,- shortcuts in the status line for the breakpoints
+dialog.
+* Added: [sLisp] new command GetSystemInfo to know the current OS, TV
+driver, CPU, etc. From a suggestion by Thiago.
+* Updated: docs, not yet the debug stuff.
+* Fixed: Error in the SpLines search that made funny things when trying to
+toggle a breakpoint (introduced during the structure change).
+* Added: The dialog to add a "watch" now is piped to an editor and the word
+under cursor is used. It also have a history (shared with evaluate).
+* Added: A history to the dialog to send gdb commands.
+* Modified: The "CPU line" is centered only if we jumped to another source.
+It is less annoying.
+* Added: The conditionals in menu files can use the TV driver, CPU, OS,
+etc. for conditions. From a suggestion by Thiago.
+* Added: $define and $undef and its expansion in menu files. From a
+suggestion by Thiago.
+* Fixed: The commands to select the watches and debug window are
+independent of the debugger state.
+
+Revision 1.555 2004/07/29 20:33:37 set
+* Added: The edit breakpoint dialog now disables the unneeded options. So
+if you will specify the location using file:line then you can't say the
+function or address.
+
+Revision 1.554 2004/07/28 21:03:23 set
+* Added: The second part of the "Breakpoints" dialog. Now is possible to
+add, modify, remove, enable, disable and jump to breakpoit locations. Some
+details remains to be adjusted and is lightly tested.
+* Fixed: A leak in SpLines, the new structures needs atFree and not just
+atRemove, found using valgrind, debugged using the editor. Note: gdb is
+quite bad and is sooooo buggy, now that I'm using it from the editor I can
+verify when the problem is in gdb and that's too common :-(
+
+Revision 1.553 2004/07/26 20:36:03 set
+* Modified: Now breakpoints and frames are searched in the "path for
+sources" and not only in the binary reference.
+* Modified: "Go To Line" now passes the full qualified name of the file to
+gdb. With both changes I debugged "rhgdb".
+
+Revision 1.552 2004/07/26 16:06:40 set
+* Modified: [MSVC] The WinNT/configed.h header to report "MSC" as compiler
+for MS compiler. Suggested by Arnold.
+* Updated: Copyright year in main about box. Suggested by Arnold.
+
+Revision 1.551 2004/07/26 15:35:37 set
+* Modified: Once again makeinfo breaks something. This time makeinfo 4.6
+doesn't like:
+@item xxxx @il{xxxx
+yyyy}
+The @il must end in the same line or makeinfo gets confused.
+
+Revision 1.550 2004/07/26 15:09:15 set
+* Added: The first part of the "Breakpoints" dialog. Currently you can
+just see the breakpoint.
+* Fixed: SpLineGetOldValueOf to match not only the position but also the
+spline id.
+* Fixed: All the TCEditor::SetSpecialLines logic because it was wrong and
+it needed adjustments to the new structures.
+* Modified: Moved all the breakpoint operations to a class so we can use
+it for a dialog.
+
+Revision 1.549 2004/07/26 15:04:10 set
+* Updated: Spanish translation.
+* Fixed(?): The last modification to the special lines stuff had a major
+flaw. If we keep a copy in the TCEditor then is quite hard to know which
+lines were moved. I changed the insternal structures used by SpLinMan to
+solve it. The code changed too much to be considered stable.
+* Modified: The internac/Makefile to update the translations every time a
+source that have strings to translate is modified. This will increase cvs
+traffic but will reduce collisions.
+
+Revision 1.548 2004/07/23 21:22:31 set
+* Fixed: [MSVC] The set_new_handler() function of MSVC 4.0 doesn't support
+NULL. It is possible to use _set_new_handler(), but as it is only tested
+for gcc I'm disabling this code for other compilers. From a report by
+Arnold. Note: with it Arnold compiled the editor for MSVC 4.0.
+
+Revision 1.547 2004/07/23 20:53:22 set
+* Added: Configuration options to disable the calculator and calendar.
+Suggested by Oswald.
+* Modified: Optimized cmcMoveBlock. Suggested by Oswald. Consider it
+unstable.
+* Modified: The meassure commanand to report the result in the status line.
+Suggested by Oswald.
+* Modified: The insertBuffer member to support some copies from the same
+buffer.
+* Fixed: Leak in tags code. Reported by valgrind.
+* Added: Options to zoom the editor windows when inserted in the desktop.
+Suggested by Oswald.
+* Fixed: Bug in stack position. Forgot to unlink the returned objects.
+
+Revision 1.546 2004/07/23 13:00:50 set
+* Fixed: [MSVC] Wrong prototype of LoadFileUnderCursor in ced_inte.h. Only
+reported by MSVC 4.0. From a report by Arnold.
+
+Revision 1.545 2004/07/22 00:59:15 set
+* Added: When using the tag search if we find a perfect match now we jump
+directly to the tag. Suggested by Thiago.
+* Added: Two new commands: cmeGPushCursorPos and cmeGPopCursorPos. They are
+"global push/pop cursor pos". So they also remmember the file. They help to
+implement a "tag stack". From what Thiago suggested.
+* Added: Before jumping to a tag the editor does a cmeGPushCursorPos.
+
+Revision 1.544 2004/07/21 19:59:04 set
+* Fixed: When deleting a breakpoint the editor could hang if the breakpoint
+couldn't be found.
+* Added: Now if the program to debug (the copy with debug info) is in a
+directory other than the current one this directory becomes the reference
+for filenames. It allowed me to debug SETEdit from SETEdit and using the
+setedit.epr file which is in "../" from the point of view of the binary.
+
+Revision 1.543 2004/07/20 20:45:00 set
+* Added: Now we can attach to running processes. Nice, but it expossed more
+gdb bugs :-(
+
+Revision 1.542 2004/07/20 19:33:17 set
+* Fixed: Added dummies to allow compilation when libmigdb isn't installed.
+
+Revision 1.541 2004/07/20 16:27:09 set
+* Added: The first part of the code to support debugging using libmigdb.
+* Synchronized some CVS details with my home CVS.
+* Version 0.5.4 (Glaciar P.Moreno I)
+
+Revision 1.540 2004/07/19 20:02:00 set
+* Fixed: [Debian] Applied patch S.F. #993014 submitted by Baurjan Ismagulov
+(ibr): "Add an include file required by rhide".
+
+Revision 1.539 2004/07/19 19:53:20 set
+* Fixed: [config] --cxx-flags flag was reported as --cpp-flags in the help.
+Now both are valid. Reported by Ullal Devappa Kini (wmbfqj/vsnl/net).
+* Fixed: [Win32] Cygwin can execute the "make install" target, but it
+installed binaries without .exe extension. That's quite annoying for Win32.
+I added a "--keep-extension" option to avoid it, isn't tested. Reported by
+Ullal Devappa Kini (wmbfqj/vsnl/net).
+
+Revision 1.538 2004/06/29 14:27:11 set
+* Fixed: [MSVC] The char */*name*/ sequence confused the compiler. Reported
+by Arnold.
+
+Revision 1.537 2004/06/28 17:57:49 set
+* Fixed: Corrupted MP3 files could produce a crash. It closes SF Bug
+#932091 reported by silverdirk, he sent me a file to reproduce the problem.
+
+Revision 1.536 2004/06/28 17:56:48 set
+* Fixed: The menu files uses nested preprocessor directives but it wasn't
+supported.
+
+Revision 1.535 2004/06/28 17:56:07 set
+* Fixed: [BC++] 5.5 can't really remove unreachable code. That's another
+evidence of the poor quality of Borland compilers in terms of optimization.
+
+Revision 1.534 2004/06/28 17:55:02 set
+* Fixed: Missing CleanUpHolidays() for targets that doesn't support dlopen.
+Additionaly I modified the code to use if (xxxx) instead of plain
+preprocessor.
+* Fixed: [djgpp] Problems in calcu.cc because of unconditional definition
+of NULL in locale.h.
+
+Revision 1.533 2004/06/25 19:46:21 set
+* Fixed: SUP_PCRE could be redefined :-(, added protection.
+
+Revision 1.532 2004/06/25 18:28:08 set
+* Added: [sLisp] A new command called "prex" to perform Perl regular
+expressions searches. It is documented and I also added an example to
+macros.slp, it calls wc and shows the results in the status line.
+* Modified: The SUP_PCRE macro to be 0 or 1 instead of un/defined. This
+could generate compilation problems for platforms where PCRE isn't
+supported, but the code is more clear now.
+
+Revision 1.531 2004/06/23 20:10:00 set
+* Fixed: Assignment of Boolean from int.
+* Fixed: Use of bool type (instead of int or Boolean).
+* Modified: "new" header inclusion to be selected by compatlayer.
+All from Arnold Wiegert information.
+
+Revision 1.530 2004/06/23 19:33:21 set
+* Modified: [MSVC] Use of /Tp<file> instead of /TP in makefiles. It looks
+like MSVC 4.0 only supports it. Reported by by Arnold Wiegert.
+* Fixed: Leaks in TCEditWindow (intl stuff), List of windows and
+loadnobkp.cc. valgrind.
+* Fixed: "New" buffers shouldn't be added to the list of closed windows
+when closed. It generated a read out of bounds and a write of unitialized
+data to disk. valgrind.
+
+Revision 1.529 2004/06/22 20:34:12 set
+* Fixed: [MSVC] References to make in the nmake files. Report and solution
+by Arnold Wiegert.
+* Modified: [Makefiles] extrimk to generate the first dependency with
+relative path. I should allow .umk files to be used without the need of
+"vpath" or ".path" directives. That's because nmake lacks both directives.
+
+Revision 1.528 2004/06/22 16:30:43 set
+* Added: [sLisp] More macros from Thiago. They are short and quite
+interesting because they show how to add particular behaviors or
+funtionalities with small code.
+
+Revision 1.527 2004/06/22 16:01:24 set
+* Fixed: [Cosmetic] Added a ; after the ListBoxImplement(..) macros. They
+looks more "correct" and doesn't confuse my heuristic to search fro
+functions ;-)
+
+Revision 1.526 2004/06/22 15:11:58 set
+* Added: [sLisp] Experimental!!! now you can use cme* commands for
+SendCommands. They are propperly sent to the application instead of the
+current editor.
+
+Revision 1.525 2004/06/18 14:21:19 set
+* Fixed: Some details in the heuristic C++ functions searcher. They address
+problems with the const and throw() attributes.
+* Modified: The program that extracts dependencies from the RHIDE's .mak
+files to avoid putting the creation date (I don't remmember why I needed it
+and it generates extra CVS traffic) and to sort dependencies (also reduces
+CVS traffic).
+
+Revision 1.524 2004/06/17 16:50:32 set
+* Added: Missing desktop examples. Reported as bug #974095 @ SF by Ognyan
+Kulev (ogi).
+
+Revision 1.523 2004/06/14 16:40:42 set
+- From valgrind
+* Added: Holidays clean-up.
+* Fixed: Memory leak in special lines.
+* Fixed: malloc/delete missmatch in grep interface.
+
+Revision 1.522 2004/06/14 14:39:20 set
+* Added: now extrimk.cc can also solve vpath sources.
+* Modified: valgrind command line script to report up-to 40 functions in
+the calling stack.
+- From valgrind:
+* Added: librhuti io and Special Lines clean-up at exit.
+* Fixed: new[]/delete missmatches related to WordUnderCursor, errors
+parser, pathtool, special lines and Tips.
+
+Revision 1.521 2004/06/14 14:34:15 set
+- From valgrind:
+* Fixed: duplicated keywords in syntaxhl.shl file. Additionaly now it
+doesn't leak memory.
+* Added: PathList* clean-up.
+
+Revision 1.520 2004/06/11 21:20:56 set
+* Added: Messages in BC++ and MSVC makefiles instructing to try the new
+mechanism.
+* Fixed: Warnings in holydays code now compiled with -Wall.
+- From valgrind
+* Fixed: Leak in TSetEditorApp::preLoadDesktop.
+* Fixed: Ruby highlight lack of End.
+* Fixed: new/delete[] missmatches in TInfIndex::TInfIndex and
+TFileEntryCollection::freeItem.
+* Fixed: SIGKILL mask.
+* Fixed: Potential portability problems with memcpy.
+
+Revision 1.519 2004/06/09 15:40:42 set
+* Modified: Removed from CVS various files that are generated by configure
+script. They are included in distribution but people using CVS must run
+the configure script.
+
+Revision 1.518 2004/06/09 15:08:33 set
+* Fixed: internac/gnumake.in didn't define CXX and instead replaced the
+two points where it was used. Suggested by Oswald.
+* Added: libbzip2, libpcre and libz. Now have configurable makefiles.
+* Modified: Now WinNT/Makefile* files are updated only in maintainer mode.
+
+Revision 1.517 2004/06/09 12:29:40 set
+* Fixed: [BC++] Wrong references to rhtv.lib instead of librhtv.lib.
+Reported by Arnold Wiegert (awiegert/telus/net).
+
+Revision 1.516 2004/06/08 13:21:06 set
+* Modified: [Debian] Applied patch #968507 S.F. submitted by Baurjan
+Ismagulov - ibr. Removes extra clean-up.
+
+Revision 1.515 2004/06/04 19:19:58 set
+* Fixed: Another strchr call.
+
+Revision 1.514 2004/06/04 13:27:22 set
+* Added: A small script to meassure the number of lines of code. Currently
+over than 108,000. It skips third party libs.
+* Fixed: strstr and strchr are declared different in C++ standard. BC++
+does it (not gcc 2.95.4) and it generated compilation errors when using
+BC++. Reported by Arnold Wiegert.
+
+Revision 1.513 2004/06/02 19:57:43 set
+* Added: [SHL] vbe and vst as VHDL extensions. Used by Alliance for "Vhdl
+BEhavioral" and "Vhdl STructural". Suggested by Juan Pablo.
+
+Revision 1.512 2004/05/31 14:09:22 set
+* Modified: [Debian] Applied patch #962884 S.F. submitted by Baurjan
+Ismagulov - ibr. Related to the libset package. It needs some adjustments.
+
+Revision 1.511 2004/05/31 13:44:16 set
+* Added: OS/OS flavor,CPU,Compiler/Compiler flavor and Driver to the about
+box. Suggested by Arnold Wiegert (awiegert/telus/net)
+* Added: C,H and CPP as valid C extensions for syntax highlight. C is the
+C++ extension for gcc and the others are for non-casesensitive OSs.
+
+Revision 1.510 2004/05/24 14:38:27 set
+* Modified: [config] Use of "g++" in favor of "gcc -lstdc++". This is
+because newer gcc 3.x compilers can't compile C++ code without doing a
+mess when we use the gcc frontend. From a report by Baurjan Ismagulov - ibr
+
+Revision 1.509 2004/05/24 13:40:41 set
+* Added: Applied patch #959018 Add libset-dev Debian package. Submitted by
+Baurjan Ismagulov - ibr (S.F.). It needs some adjustments but can be used.
+
+Revision 1.508 2004/05/21 16:16:19 set
+* Fixed: The heuristic C/C++ parser to support list of exceptions
+(function throw(...) {body}).
+
+Revision 1.507 2004/05/17 14:06:40 set
+* Fixed: Missing va_end and abuse of va_list type. It looks like the newer
+PPC's glibc implements things in a way that va_list variables can't be
+assigned to other va_list variables. Reported by MDaniel.
+
+Revision 1.506 2004/05/12 14:21:25 set
+* Modified: For the last changes to the TButton class.
+
+Revision 1.505 2004/05/07 20:07:31 set
+* Fixed: A couple of calls to memcpy to use CLY_memcpy. Reported by
+valgrind.
+* Added: Avoid a no-op copy reported by Oswald.
+* Fixed: Use of unitialized undo counter in some rectangular selection
+operations. Reported by valgrind.
+
+Revision 1.504 2004/05/06 19:33:09 set
+* Fixed: Some malloc/new/new[] v.s. free/delete/delete[] calls. Reported
+by Oswald using valgrind.
+* Fixed: memcpy shouldn't be used if blocks overlaps, no matters the
+copying direction. That's a portability issue. Reported by Oswald using
+valgrind.
+* Fixed: Undo count for the first undo wasn't initialized. Very dangerous.
+Reported by Oswald using valgrind.
+* Fixed: Some drawing variables not initialized. Could make the row/col
+cursor appear until a new redraw. Reported by Oswald using valgrind.
+
+Revision 1.503 2004/05/05 19:09:08 set
+* Fixed: When copying something from the calculator and the paste wasn't
+enabled before entering the calculator then you needed to at least move the
+cursor before you could paste. Now the Paste status is updated without
+needing any extra action.
+
+Revision 1.502 2004/04/22 19:09:28 set
+* Fixed: [tools] Problems when applying patches from branches that uses new
+files and cvs marks them as from Attic.
+
+Revision 1.501 2004/04/19 20:45:55 set
+* Added: Code needed to test with the AlCon branch.
+
+Revision 1.500 2004/04/13 18:21:44 set
+* Added: [SHL] Syntax and pmacros for WML, contributed by Diego J. Brengi.
+
+Revision 1.499 2004/04/12 13:17:13 set
+* Fixed: [Holydays] bug in movement and fixed april 2 movement in
+argentinian holydays.
+
+Revision 1.498 2004/04/06 19:10:48 set
+* Fixed: Problems with some texinfo versions reported by Cosmin T. (ctruta\
+hotmail\com).
+
+Revision 1.497 2004/03/30 14:54:36 set
+* Added: Information about how to install the Red Hat 7.3 RPMs in Fedora
+Core 1. Contributed by Rohan Carly.
+
+Revision 1.496 2004/03/25 20:11:29 set
+* Added: Non interactive versions of the cmcExpandAllTabs and
+cmcCompactBuffer commands to be used from sLisp. Suggested by Grzegorz.
+
+Revision 1.495 2004/03/17 20:50:23 set
+* Updated: [SHL] Flat Assembler, contributed by Matt C.
+
+Revision 1.494 2004/03/03 14:55:48 set
+* Modified: [SHL] Flat Assembler definition. Patch by Matt.
+
+Revision 1.493 2004/02/23 14:38:41 set
+* Fixed: [DOCs] the ctags --field switch because makeinfo needs ---field.
+Reported by Grzegorz.
+
+Revision 1.492 2004/02/02 16:13:50 set
+* Added: [WWW] A note about Red Hat RPMs, a user (Jan Cnops) reported that
+the Red Hat 7.3 packages (newer than the Red Hat 8.0 packages) install OK
+on Red Hat 9.0 systems.
+
+Revision 1.491 2004/02/02 14:52:50 set
+* Added: [WWW] SuSE 9.0 release by bbcat.
+
+Revision 1.490 2004/01/13 14:23:02 set
+* Modified: [WWW] The page to be more clear about how to try the Win32
+version. Suggested by Philippe Baucour.
+
+Revision 1.489 2004/01/06 15:54:37 set
+* Fixed: [DOCs] the "strxlt" example said "sstr". Reported by Dominik
+Grzelak.
+
+Revision 1.488 2004/01/06 15:42:01 set
+* Updated: Flat Assembler syntax highlight. Contributed by Matt Childress.
+
+Revision 1.487 2003/12/15 21:21:43 set
+* Fixed: [RPM] The prereq seems to be /sbin/install-info and not
+/usr/bin/... At least that's what most specs found by Google shows ;-)
+I also added install and delete for the info files.
+
+Revision 1.486 2003/12/15 14:59:16 set
+* Fixed: When pasting using the OS clipboard and the cursor was moved to
+the end of the selection it could go out of screen which is quite annoying.
+
+Revision 1.485 2003/12/15 14:58:36 set
+* Fixed: A couple of details about the last option and when is greyed.
+
+Revision 1.484 2003/12/15 14:56:46 set
+* Fixed: Some int v.s. unsigned details related to the last patch.
+* Modified: cmcSaveAsUNIX and cmcSaveAsDOS commands to be
+cmcSaveAsConvertEOL which is more clear.
+* Added: A new command cmcSaveAsNoConvertEOL used to avoid automatic
+conversions when they are enabled. From a suggestion by Oswald.
+
+Revision 1.483 2003/12/11 19:54:37 set
+* Fixed: Compilation problems with gcc 3.x. Patch from Oswald:
+ - Missing \n at end of palbcc.h
+ - Missing explicit parent constructor call in mp3/ampdiag.cc
+ - Constant out of range in include/ced_exte.h (I also modified
+ edconst.cc accordingly)
+
+Revision 1.482 2003/12/09 19:24:32 set
+* Modified: The 'Compile' macro example. It was contributed by Thiago and
+now he added an example on how to choose the compiler according to the
+syntax.
+
+Revision 1.481 2003/12/09 18:28:08 set
+* Added: Errors parser for Perl. Contributed by Thiago.
+
+Revision 1.480 2003/12/09 16:48:51 set
+* Fixed: When aborting an overwrite (in save as) the name of the window
+was changed anyway :-P
+
+Revision 1.479 2003/12/09 16:09:31 set
+* Fixed: The new code needed a conditional to avoid ridiculous small sizes.
+
+Revision 1.478 2003/12/09 16:07:51 set
+* Added: "File open" dialogs remmembers its size and position. Each kind of
+dialog have its own values, so open and save as are independent. I know it
+could confuse some people but it allows better customization. From a
+suggestion by gradha.
+
+Revision 1.477 2003/12/09 16:06:30 set
+* Added: Most lists (like functions list) now centers the focused item when
+a match is selected. Suggested by gradha.
+
+Revision 1.476 2003/12/03 14:44:21 set
+* Fixed: Missing wrapper for RHIDE's version of FindFile. Reported by Kevin
+Alm.
+
+Revision 1.475 2003/12/03 14:19:54 set
+* Fixed: Removed two comments containing non-ASCII chars. It seems to annoy
+gcc 3.3.1 according to a report by Kevin Alm.
+
+Revision 1.474 2003/11/24 15:54:29 set
+* Added: A button to recompute window numbers in the list of windows.
+Suggested bt Grzegorz.
+* Updated: The spanish traslation.
+* Added: Documentation for the last "File under cursor" additions and the
+list of windows addition.
+
+Revision 1.473 2003/11/24 15:48:19 set
+* Added: Some rudimentary $(VARIABLE) expansion to the "File under cursor"
+files list. Suggested by Grzegorz.
+* Added: To also search in the same directory where a file is located when
+using the "File under cursor" stuff. Suggested by Grzegorz.
+
+Revision 1.472 2003/11/24 15:47:10 set
+* Added: AltKeysSetting TV config keyword.
+
+Revision 1.471 2003/11/24 15:44:19 set
+* Fixed: Some gcc versions needs explicit use of libstdc++ to link C++ and
+intenac/getcolors didn't have it. Reported by Michel Catudal (bbcat).
+
+Revision 1.470 2003/11/18 14:30:19 set
+* Added: More cases to the code that detects "Emacs comments" at the end of
+the file. From information provided by Grzegorz.
+
+Revision 1.469 2003/11/17 16:10:39 set
+* Added: Now if you don't specify any path to "search files under cursor"
+the editor tries to automagically fills this list using the output of cpp.
+From a suggestion by Oswald.
+* Added: If the Ctrl+Enter fails to find the file under cursor now that's
+informed in the "status line" of the current editor. Suggested by Oswald.
+* Added: If the editor fails to find the file under cursor now it also
+looks for it in the project. From a suggestion by Oswald.
+
+Revision 1.468 2003/11/17 16:09:45 set
+* Fixed: When starting a project using a different window size the project
+window could get wrong size and even become outside the screen. Reported
+by Oswald.
+
+Revision 1.467 2003/11/17 16:08:05 set
+* Added: The posibility to override the "install" command in makefiles.
+Suggested by Oswald.
+
+Revision 1.466 2003/11/12 15:03:36 set
+* Added: More "intelligence" behind the "Paste Emacs Mode", now it only
+takes as valid entries that defines the "mode" variable.
+* Modified: The position of "Emacs mode" insertion is now the same of a
+previous definition. Both things comes from a talk with Grzegorz.
+
+Revision 1.465 2003/11/12 14:07:01 set
+* Added: Looks like the "Emacs Mode" comments can appear more than once in
+the same file defining different variables. Now when the editor looks for
+it doesn't stop in the first match. Note that it doesn't affect the
+behavior on the "Paste Emacs Mode" which only searchs for the first
+occurrence. From a report by Grzegorz.
+
+Revision 1.464 2003/11/05 18:51:11 set
+* Fixed: I forgot that global options also mentioned "purge spaces".
+Pointed out by Oswald.
+
+Revision 1.463 2003/11/03 16:19:53 set
+* Added: When "TScreen::avoidMoire" is enabled selected tabs uses '.' to
+indicate they are selected. From a suggestion by Oswald.
+
+Revision 1.462 2003/11/03 16:17:46 set
+* Added: A new color scheme called "Midnight Commander" contributed by
+Oswald.
+
+Revision 1.461 2003/11/03 16:15:52 set
+* Added: A new color scheme called "Classic Borland" contributed by Oswald.
+
+Revision 1.460 2003/10/28 21:09:42 set
+* Added: When asking for word completion if the word at the left looks like
+Class:: then the editor looks for the class and offers the members.
+Suggested by Ivan.
+
+Revision 1.459 2003/10/22 19:45:30 set
+* Fixed: When searching outside comments and the match was found in the
+first column of a line after a comment it was ignored. Reported by Alain.
+
+Revision 1.458 2003/10/20 15:33:02 set
+* Fixed: While locking the editor in the S&R y did it wrong and the S&R
+confirmation didn't move to the correct coordinate.
+
+Revision 1.457 2003/10/20 15:32:12 set
+* Added: Now sLisp can replace things like ^K key binding even when it
+implies removing all the ^K-x assignments. It allows a complete
+replacement.
+
+Revision 1.456 2003/10/20 15:31:16 set
+* Modified: "Do not purge spaces" option to be "Keep trailing whitespace"
+that's more descriptive. Suggested by Oswald.
+* Fixed: No match pair after deleting some text and the cursor goes to a
+symbol. Reported by Oswald.
+* Modified: To lock the screen while doing a search & replace operation to
+avoid "flashing" when doing a lot of S&R operations. Suggested by Oswald.
+* Fixed: Wrong match pair when the cursor was in the middle of a tab and
+the next character matched a pair (highlight in the middle of the tab).
+Reported by Oswald.
+* Fixed: Undo error when a character replaced a tab (overwrite enabled) and
+the cursor was inside the tab (not at the beggining). Reported by Oswald.
+* Added: History to the "arbitrary indent" and "run command" input lines.
+Suggested by Oswald.
+
+Revision 1.455 2003/10/16 20:02:35 set
+* Fixed: [Cygwin] Collision between strndup and calculator parser.
+Personally don't know mush about this issue but looks like a name space
+pollution in Cygwin.
+
+Revision 1.454 2003/10/16 19:42:47 set
+* Modified: To select the closest word when using double click and not the
+next. Suggested by Alain.
+
+Revision 1.453 2003/10/16 19:41:54 set
+* Fixed: A code page problem. A little bit complex to describe: If you
+started the editor for the first time in a Linux console and forced the
+encoding to "Latin 1u" (improperly configured system IMHO). Then you
+acessed remotly to this system using XTerm you got a messed code page and
+no way to fix it. This is because the editor tried to use Linux console
+settings but as XTerm can't change its code page you have no way to disable
+the "forced" check box for the screen code page. Now the editor avoids it.
+
+Revision 1.452 2003/10/16 19:40:54 set
+* Fixed: The "Jump" button in the main window of the class browser produced
+SIGSEGVs. I went too far reusing code ;-). Reported by Ivan.
+
+Revision 1.451 2003/10/16 19:39:10 set
+* Added: Some clarification in the docs about the meaning of the maximum
+number of R.O. copies.
+* Added: Now when the message window (and other sources) request to open
+a file that is part of the project it is opened using the relative path
+and not an absolute path. It annoyed me for a long time and Oswald insisted
+on it ;-)
+
+Revision 1.450 2003/10/16 19:38:02 set
+* Added: Project windows are "closed" (hided) when pressing ESC. Suggested
+by Oswald Budden.
+* Added: When opening new windows usually the editor checks if a project is
+opened, in this case windows aren't zoomed. Now if the project window isn't
+visible they are also zoomed, after all they weren't zoomed to avoid
+hidding the project window. Suggested by Oswald Budden.
+
+Revision 1.449 2003/10/16 19:35:20 set
+* Added: [sLisp] KeyBindings and BindKey commands. With them you can change
+key bindings from sLisp.
+* Fixed: Errors in the conditionals parser for menu files.
+* Added: More variables to check in menu files: MP3, PCRE, BZIP2, MIXER and
+UNIX. Suggested by Oswald.
+* Added: A new chapter to the docs: Documentation guide. It can be used to
+find other chapters and sections according to the topic they are related
+to.
+* Added: A new chapter to the docs: Menues configuration.
+* Added: A new section to the docs: Configuration files location.
+* Added: Now the index of the documentation also includes all the chapters,
+sections, etc.
+
+Revision 1.448 2003/10/16 19:34:02 set
+* Fixed: When the alternative sorting mode of the project window was
+enabled some internal searches failed because they expected the old sorting
+mode. Now the sorting mode is temporally changed.
+* Fixed: When switching between sorting modes the focused item changed.
+
+Revision 1.447 2003/10/16 19:12:45 set
+* Modified: [Configuration] TV 2.0.3 dependency because I'm currently using
+a couple of additions to the API and hence users needs CVS version.
+* Added: [sLisp] SelectWindowNumber used to change the focused window. when
+used for an edition window it also changes the sLisp target allowing to
+modify another buffer, not just the one selected when the macro was
+triggered.
+* Added: [sLisp] GetCurWindowNumber and GetMaxWindowNumber they can be used
+to apply an operation to all the windows and also to go back to the
+original window.
+* Modified: The Alt+window_number combination now belongs to the menues and
+isn't hardcoded in TV anymore.
+* Added: Commands to select the project and message windows, also to select
+the first 19 editors. With the help of sLisp and last aditions now is
+possible to select any window using just a key or menu entry.
+* Modified: To avoid status messages when running sLisp code binded to a
+key or menu entry.
+* Added: Documented and translated to spanish.
+* Version 0.5.3 (Iguazu II)
+
+Revision 1.446 2003/10/16 19:03:29 set
+* Added: [sLisp] now you can bind a small piece of sLisp code to a key or
+a menu entry. With it the user doesn't need to edit macros.slp for small
+stuff. It will also allow passing arguments when macros support it. I
+implemented it to solve a limitation pointed out by Alain.
+
+Revision 1.445 2003/10/14 15:51:26 set
+* Added: In the project window now you can choose between a way to display
+files that's easier to find by name and another suitable to find them by
+their directory. From suggestions by Sam Thursfield <samth@mail.ru> and
+Alain <alainm@pobox.com>, but I think others also asked for it.
+
+Revision 1.444 2003/10/14 15:39:27 set
+* Added: [sLisp] FindString, FindAgain, ReplaceString and ReplaceAgain sLisp
+commands. Based on code an ideas by Bernd.
+
+Revision 1.443 2003/10/06 18:49:21 set
+* Added: [WWW] Links to the Windows installer contributed by William.
+
+Revision 1.442 2003/10/06 18:26:17 set
+* Added: Some Ruby syntax highlighting. Contributed by William E. Cullen
+<WECullen@comcast.net>.
+
+Revision 1.441 2003/09/02 13:49:37 set
+* Updated: QNX configuration. Patch from Mike.
+
+Revision 1.440 2003/09/01 13:50:58 set
+* Fixed: Missing <body> tag when exporting as HTML, reported by Federico
+Bareilles <fede@lilen.fcaglp.unlp.edu.ar>
+
+Revision 1.439 2003/08/27 17:53:42 set
+* Added: HTML as html extension.
+* Fixed: The readme said it was a .0 release. Pointed out by Ivan.
+* Fixed: The configure scripts to pass the arguments using "". From a
+problem reported by Ivan.
+* Added: Nice screen shot contributed by Mike Conrad
+<conradme@email.uc.edu>
+* Fixed: An unhandled diff case in the applycvs.pl tool.
+
+Revision 1.438 2003/08/15 18:51:32 set
+* Fixed: [Configuration] The configure script didn't take the CXXFLAGS
+variable, instead always used rhtv-config output (only CXXFLAGS, no CFLAGS)
+I discovered it when Ivan starter to wonder why debian/rules wasn't able to
+change the compilation options ;-)
+
+Revision 1.437 2003/08/13 18:38:07 set
+* Added: A link to the "pure DOS" fix/test release to the web page and also
+made the more visible the link to S.F. summary page.
+
+Revision 1.436 2003/08/11 01:53:33 terrible
+* Updated: Debian version to 0.5.2-1.
+
+Revision 1.435 2003/07/23 19:37:56 set
+* Added: A small page about Iguaz to the site.
+
+Revision 1.434 2003/07/23 18:12:59 set
+* Fixed: If no tags files are present and you want to add one to the list
+now the editor doesn't suggest reading the docs.
+* Added: Support for the tags files generated by objdump (this is my small
+contribution to GNU binutils project ;-). In these files I use some new
+"keys" not defined by ctags. It also contains prototypes.
+
+Revision 1.433 2003/07/22 19:18:50 set
+* More small adjustments for the final release. Web page and docs.
+
+Revision 1.432 2003/07/22 14:52:22 set
+* Modified: The web page to reflect the new release. I'm finishing the
+"Release Candidate" stage.
+
+Revision 1.431 2003/07/16 13:33:37 set
+* Modified: The RPM scripts to support an environment variable to indicate
+where to create the RPMs. I needed it when using S.F. Compiler Farm and
+Red Hat 7.3 which always failed when using a directory mounted with NFS.
+* Modified: The source package creation to create the "result" directory
+if it doesn't exist.
+
+Revision 1.430 2003/07/14 17:54:07 set
+* Added: More SQL keywords. Contributed by Grzegorz.
+
+Revision 1.429 2003/07/10 20:22:17 set
+* Added: TVision configuration keyword. Note this keyword is currently
+available only in the experimental branch of TV.
+
+Revision 1.428 2003/07/07 21:12:32 set
+* Added: hh extension as C++ code. SAVANT/TyVis generates code with that
+extension.
+* Added: very basic VHDL syntax highlight.
+
+Revision 1.427 2003/07/07 15:29:41 set
+* Added: The TAGs tutorial to the distribution. It is a big (because of the
+images) but I think it could help users to quickly start using these
+features.
+
+Revision 1.426 2003/07/01 13:05:39 set
+* Added: Errors parser for ANT Java Builder. Cotributed by Grzegorz.
+* Added: Java emacs modes and throw keyword. Cotributed by Grzegorz.
+
+Revision 1.425 2003/06/30 13:10:18 set
+* Added: List of new and fixed stuff to the readme. Also the release name
+and revision.
+* Added: Link to TAGs tutorial in the docs.
+
+Revision 1.424 2003/06/30 13:09:15 set
+* Fixed: [BC++] a bug in the EasyDiag label and radio buttons that made
+Alt+L and similars to generate GPFs. This is very interesting: the GPF was
+generated by code that I forgot to remove while adapting to the new i18n
+mechanism. The code was useless and hence gcc simply removed it (2.81 to
+3.3 versions tested) but BC++ 5.5/5.6 seems to be quite inferior optimizing
+and didn't remove the code. This code walked a single chained list but
+using wrong pointers (NULL or released).
+
+Revision 1.423 2003/06/30 13:08:17 set
+* Added: [Config] makes directory to the library search path. It makes
+RHIDE projects easier.
+* Added: [Config] --libset to my DOS default config. I finally managed to
+compile RHIDE 1.5 CVS for DOS. It took me a day to figure out the problems
+in my system and workaround gdb make problems.
+* Added: [Config] less to the DOS cvs update batch.
+
+Revision 1.422 2003/06/30 13:07:09 set
+* Added: A script to update from CVS using the options I use. A DOS batch
+file and a shell script are provided.
+
+Revision 1.421 2003/06/27 19:52:07 set
+* Added: Some SQL keywords. Contributed by Grzegorz.
+
+Revision 1.420 2003/06/24 19:17:47 set
+* Added: A tutorial explaining how to use tags stuff step by step. It have
+graphics but I'm not sure about distributing them, size issue.
+* Fixed: Fails in the "Export as HTML" command when some text was selected.
+* Fixed: When using completion words and the word to complete made match
+with the last symbols the editor crashed.
+* Modified: added calls to gprexp and changed rules to create .imk files.
+
+Revision 1.419 2003/06/23 21:09:09 set
+* Updated: default .env files.
+* Added: link to the new nightly snapshots to the web page.
+
+Revision 1.418 2003/06/23 14:50:49 set
+* Fixed: error in spanish translation. Reported by Andres Trapanotto
+<andres_t@inti.gov.ar>.
+
+Revision 1.417 2003/06/23 14:31:44 set
+* Added: some TODO entries I want to add after the next release.
+* Updated: the copyrigh file.
+* Updated: the readme files for distribution. Copyright dates and also a
+more accurate description about keyboard under X11.
+
+Revision 1.416 2003/06/23 14:27:48 set
+* Fixed: [InfView] the code to paste the current selection to the secondary
+OS clipboard wrongly computed the condition to determine if the selection
+was valid or not. As a result it tried to paste a negative line. The
+consequence ranged from nothing to an infinite loop, including SIGSEGVs and
+wrong text in the window. It was exposed by some double click conditions
+but also with simple clicks.
+
+Revision 1.415 2003/06/23 14:21:10 set
+*** New name for release: Iguazu I ***
+* Added: now the releases will have names to identify them easier.
+* Added: revision number to the about dialogs, suggested by Ivan. The
+number will be based on my local CVS revision number. The S.F. offset could
+need adjustments. The revision number is only updated when compiling with
+the maintainer mode enabled.
+
+Revision 1.414 2003/06/18 19:55:12 set
+* Added: Now ManView window can be closed with ESC. Suggested by Thiago.
+* Added: Now you can copy from the message window to the OS clipboard.
+Suggested by Thiago.
+
+Revision 1.413 2003/06/17 15:50:25 set
+* Fixed: Find whole words and out/inside comments didn't work together.
+Reported by Alain <alainm@pobox.com>.
+
+Revision 1.412 2003/06/17 14:43:45 set
+* Added: SQL emacs modes and sequence keyword. Suggested by Grzegorz.
+
+Revision 1.411 2003/06/17 14:36:37 set
+* Added: cmcCommentIndent/cmcCommentUnIndent now indents the current line
+if nothing is selected. Suggested by Thiago.
+* Added: [sLisp] a command to find which syntax highlight is in use. From an
+idea suggested by Thiago.
+
+Revision 1.410 2003/06/17 13:09:25 set
+* Added: install instructions for djgpp, Cygwin, MinGW and MSVC.
+
+Revision 1.409 2003/06/17 13:04:19 set
+* Modified: To support the new CLY_destroy mechanism.
+
+Revision 1.408 2003/06/17 13:02:32 set
+* Added: [Linux] an script to create TV and SETEdit RPMs in one call.
+* Added: Documentation about compilation and installation for BC++, Linux
+and generic UNIX systems. Also explanation for the .deb files. I also
+removed the obsolete information found in the README that now points to
+INSTALL.txt and it points to individual files in doc/install.
+
+Revision 1.407 2003/06/17 12:55:04 set
+* Added: A script to generate the RPMs in an easy way.
+* Modified: RPMs release version to 1.
+
+Revision 1.406 2003/06/13 20:55:22 set
+* Added: Files and instructions to create RPMs. They are bbcat's .spec
+files with some additions and corrections. Things I'm not sure they will
+remain:
+1) Need of tar.bz2 file.
+2) Use of package-version dir.
+
+Revision 1.405 2003/06/13 12:22:11 set
+* Added: [sLisp] (repeat times commands...) from code and ideas contributed
+by Bernd.
+* Added: [sLisp] (= var value) as an alias for (setv ...
+* Added: [sLisp] (++ "var_name") and (-- "var_name"), they behaves as their
+C counterparts.
+* Added: Documentation for all of them.
+
+Revision 1.404 2003/06/12 21:10:05 set
+* Added: A new option to avoid redirecting stdout when running an external
+program. Useful for interactive applications that uses stdout. Documented.
+Translated to spanish.
+* Fixed: [UNIX] When running an external program and using the "OS screen"
+the editor made a complete mess because the routine redirected stdout and
+then suspended. It made the UNIX/Linux console drivers to try to use the
+file as a console 8-P
+* Fixed: [sLisp] The RunProgram command was affected by the options in the
+configuration dialog. Now they are independent.
+* Added: [sLisp] Two constants to be used by RunProgram. They are for the
+old option (use OS/user screen) and the new option to avoid redirecting
+stdout.
+* Added: The new sLisp commands and all the constants to syntaxhl.shl.
+
+Revision 1.403 2003/06/12 21:07:53 set
+* Added: [sLisp] GetCursorX, GetCursorY and SetCursorXY commands.
+Documented.
+* Added: A new command that inserts a new line without moving the cursor
+nor indenting. This is the old WordStar ^N command. Replaced the old ^N
+assignment. Added to menues. Translated to spanish.
+* Fixed: JumpLastCursorPos was interpreted as command 154 instead of 153
+when used from menues.
+* Fixed: + and - should change month in calendar, but used a very all (and
+nasty) legacy mechanism.
+* Added: Calendar windows can be closed pressing ESC.
+
+Revision 1.402 2003/06/11 20:18:38 set
+* Added: [sLisp] Find command, contributed by Bernd.
+
+Revision 1.401 2003/06/10 15:27:03 set
+* Added: [sLisp] loop and exitloop sentences, also ==, !=, ++ and --
+operators. All of them have some basic behavior that could be extended but
+is enough for a <2.5 hours hack ;-) I added some documentation and a small
+example. I implemented to show to Bernd Becker how to implement loop
+sentence.
+
+Revision 1.400 2003/06/05 20:12:29 set
+* Added: Menu entries for cmcLastPosCur.
+* Added: Documentation for both commands (new one and the older).
+* Fixed: Need of flushLine in both commands to avoid messing the line under
+edition.
+* Updated: Spanish translation.
+
+Revision 1.399 2003/06/05 20:11:20 set
+* Fixed: When genimk fails it must delete the partially generated .imk and
+.umk to force a new generation after fixing the problems.
+
+Revision 1.398 2003/06/05 20:08:57 set
+* Fixed: Compilation problems with gcc 3.3 patch from Andris. It fixes:
+1) The order we call the contructors for the base classes.
+2) Multiline strings no longer supported by gcc.
+3) Gcc no longer supports char values as array index.
+Comments:
+1) I don't understand why, I think it should be enforced only if the
+sequence is ambiguous, after all compilers are supposed to help people.
+2) I don't understand why, is so easy to support.
+3) I don't understand why it can be promoted to int as in any other place.
+
+Revision 1.397 2003/06/04 20:45:13 set
+* Added: A new command called cmcJumpLastCursorPos. It works similar to
+cmcLastPosCur but uses a different mechanism. I assigned this command to
+^Q-P that according to Alain <alainm@pobox.com> is the WordStar command for
+it. Looking for feedback.
+
+Revision 1.396 2003/06/04 17:36:39 set
+* Added: Support for makeinfo 4.4 and newer. For some reason the new
+versions doesn't support _ inside names (only -). Really uncompatible from
+my point of view. Lamentably this is currently shipped in a few rare Linux
+distributions like Slackware 9.0.0 and SuSE 8.2 (no in previous releases,
+nor in any Debian nor Red Hat nor Mandrake distro). And Andris and Michel
+didn't sent me the intermediate file needed to find the problem.
+
+Revision 1.395 2003/06/02 15:12:20 set
+* Modified: Configuration script to adapt to the new TV directory
+structure. Now the resulting lib is in ../tvision/makes.
+
+Revision 1.394 2003/05/30 19:51:37 set
+* Fixed: Config: Moved TV detection to be before detecting CFLAGS so we can
+be sure be can get TV settings.
+* Added: Config: Advices when using shipped libs.
+* Fixed: Config: AA lib detection when running the configure script in a
+remote console.
+* Removed: [Debian] recode as dependency.
+* Removed: [Debian] .mak files from "files to back-up".
+
+Revision 1.393 2003/05/26 14:30:58 set
+* Modified: Makefile.nmk to be a wrapper for Makefile.bcc by just including
+it. The only difference is that it defines FOR_NMAKE=1 and this will force
+to use definitions for MSVC compiler.
+
+Revision 1.392 2003/05/26 14:07:48 set
+* Modified: The mkf, imk and umk files to allow more abstraction regrading
+to file extensions. So now objects can be .o or .obj or anything.
+* Added: Makefiles to use the umk files with BC++. I successfully compiled
+the editor and infview using the .umk files called from a main Makefile.bcc
+I keep the old mechanism until this is more tested.
+* Added: Files for nmake, but they aren't tested and I'm quite sure they
+will need adjusts. I need a volunteer.
+
+Revision 1.391 2003/05/26 14:03:14 set
+* Modified: The makefiles to maintain the .imk and .umk files only when
+the "Maintainer Mode" is enabled.
+* Added: --no-prefix-h to configset because I use /usr as prefix and this
+is already in the list.
+
+Revision 1.390 2003/05/23 20:19:45 set
+* Modified: Sorted the configure options by category so people can find the
+needed option faster.
+
+Revision 1.389 2003/05/23 19:19:47 set
+* Modified: Now if you configure the editor without special options the
+makfiles avoids header dependencies. Using --enable-maintainer-mode enables
+the complex dependencies.
+
+Revision 1.388 2003/05/23 16:10:32 set
+* Added: Detection and use of rhtv-config even if it isn't installed.
+* Added: Error message if rhtv-config can't be found.
+* Removed: X11 headers stuff from configuration header. The editor doesn't
+really use it, is all abstracted by TV.
+* Added: Rules so make detects the configuration scripts are newer and
+forces the user to reconfigure.
+
+Revision 1.387 2003/05/23 13:23:52 set
+* Fixed: [DOS] Details about the new configuration.
+
+Revision 1.386 2003/05/23 13:20:05 set
+* Modified: Some details about the configuration process. Now the scripts
+takes C flags, C++ flags, libraries and path to libraries from TV
+configuration using rhtv-config tool. I'm testing it so please be patient.
+Sorry for inconvenients.
+
+--- CVS tag i0_5_2b ---
+--- Tarball uploaded to S.F. ---
+
+Revision 1.385 2003/05/22 20:47:31 set
+* Added: Support for "DOS files" to the .mak parser. Just in case.
+* Updated: .imk files to avoid the need of gpr2mak.
+
+Revision 1.384 2003/05/22 19:24:45 set
+* Fixed: It was wrong again ;-), if the source was newer than imks and the
+.exe didn't exist it failed. Thanks Kevin for the patience.
+
+Revision 1.383 2003/05/21 21:13:45 set
+* Fixed: Wrong dependencies for genimk and extrimk again! Hope this time
+they are ok. Reported by Kevin.
+
+Revision 1.382 2003/05/21 20:34:08 set
+* Fixed: A lot of pointer casts to compile for 64 bits processors. The code
+compiles for Itanium but isn't stable.
+
+Revision 1.381 2003/05/20 19:02:32 set
+* Modified: Some details of the powered grep to make it more friendly:
+1) During a blocking call to grep the "busy indicator" is enabled.
+2) During a recursive search you can stop the recursivity pressing ^C.
+3) Gives a change to update the screen after each run, very important for
+the X11 driver.
+
+Revision 1.380 2003/05/20 17:29:24 set
+* Added: Emacs modes for CSS files. From Grzegorz.
+
+Revision 1.379 2003/05/20 14:12:42 set
+* Added: A new couple of commands to copy and paste to/from the OS
+clipboard when using the TInputLinePiped input boxes. These commands must
+be used in menu files if you want to use the OS clipboard for it. They are
+called cmtilCopyOS and cmtilPasteOS. From a request by Thiago.
+
+Revision 1.378 2003/05/19 21:03:48 set
+* Fixed: When importing items to the project the editor:
+1) Didn't redraw the project window.
+2) Didn't use the base path for the project.
+From a report by Kevin.
+
+Revision 1.377 2003/05/19 14:18:16 set
+* Modified: [MinGW] Looks like pwd can be called from Perl, at least from
+the Perl I have. Most probably the problem is that MinGW have pwd only as
+an internal shell command.
+* Fixed: [Win32] Collision between Win32 API and GetLastError from holidays
+module.
+
+Revision 1.376 2003/05/19 14:12:56 set
+* Modified: [MinGW] Looks like pwd can be called from Perl, at least from
+the Perl I have. Most probably the problem is that MinGW have pwd only as
+an internal shell command.
+* Fixed: [Win32] Collision between Win32 API and GetLastError from holidays
+module.
+
+Revision 1.375 2003/05/19 14:11:09 set
+* Fixed: The confignt.pl script not collected all the object files needed
+for BC++ and MSVC.
+* Fixed: Missing -I..\holidays for BC++ and MSVC.
+* Modified: Disabled "Unreachable code" BC++ warning. The compiler
+generates it for code that was obviously coded to achieve it (if (0) ....).
+* Fixed: I can't beleive I left a ; at the end of a while in the code fixed
+by revision 1.830 (home CVS number). Detected by BC++.
+* Fixed: Assigment to Boolean from a boolean condition. Detected by BC++.
+
+Revision 1.374 2003/05/19 14:09:57 set
+* Fixed: The install.mkf needed settvuti path and also the addition of
+libwin.
+* Fixed: The distribution contained common.imk twice.
+
+Revision 1.373 2003/05/16 20:59:40 set
+* Added: Some text about RHIDE to the web page and a link to a patch that
+allows creating an RHIDE compiled with the current CVS code.
+
+Revision 1.372 2003/05/16 19:25:08 set
+* Fixed: clean target of holidays directory didn't ignore errors.
+* Fixed: extra \n at the end of distribution lists produced problems.
+* Fixed: missing .mkf files in distro.
+* Note: compiled (not tested) for Mandrake 9.1 and Red Hat 9.0. Compiled
+and tested for Solaris.
+
+Revision 1.371 2003/05/16 15:30:32 set
+* Fixed: Wrong dependencies for the .imk files. They depends on the imk
+generator, but the source, not the exe. The exe will be always newer than
+the imk files for fresh check outs and it forced to have gpr2mak. Seen on
+Solaris where I don't have grp2mak.
+
+Revision 1.370 2003/05/16 12:53:29 set
+* Fixed: Missing C++ lib for extrimk.cc and genimk.cc. Reported by Kevin
+Alm <kevinalm@shenessex.heartland.net>.
+
+Revision 1.369 2003/05/16 12:41:30 set
+* Modified: To ever include stdc++ as library in the worst case it will be
+listed twice.
+
+Revision 1.368 2003/05/15 18:10:26 set
+* Modified: configset to wait for ENTER instead of sleeping 2 seconds. As
+suggested by Ivan.
+
+Revision 1.367 2003/05/15 18:04:42 set
+* Fixed: The tool to transport patches from my home to SF CVS skipped some
+patches :-( I think it was the source for various misterious missing
+patches. I hope the new version really solves the problem.
+
+Revision 1.366 2003/05/14 19:54:09 set
+* Added: A check for makeinfo 4.5. It doesn't work and generates
+compilation problems. So now if that's detected the configuration assumes
+makeinfo isn't usable.
+
+Revision 1.365 2003/05/14 16:23:19 set
+* Modified: Moved the libset target to makes/Makefile so it is cleaner and
+includes the "makes" dependency.
+
+Revision 1.364 2003/05/14 16:01:48 set
+* Fixed: For some reason S.F. CVS had a configure script that didn't use
+libset.mkf (used the .mak).
+* Fixed: The code to extract BC++ and MSVC objects failed with the new .imk
+format of 1 dependency by line.
+* Added: RHIDE 1.5 CVS defines vpath for includes as all the include
+directories and then stripts these directories from dependencies. This is
+different to what previous versions used. Now the imks generator supports
+it.
+* Added: RHIDE 1.5 CVS generates some absolute path dependencies, I'm not
+sure if it only happends for old .gpr files. Now the .imk generator tries
+to convert them into relative and scan again looking for the proper include
+directory before giving up.
+* Fixed: The -m option was disabled during the TV 1.x to 2.x process, now
+is enabled again using TV 2.x mechanisms.
+
+Revision 1.363 2003/05/13 14:58:18 set
+* Fixed: Some details needed to compile RHIDE 1.5, CVS snapshot for today.
+
+Revision 1.362 2003/05/13 12:51:18 set
+* Fixed: More documentation details. Patch from Bernd.
+
+Revision 1.361 2003/05/12 19:31:18 set
+* Modified: Made the "Paste Emacs mode" more robust. If the first line is
+"#!..." the comment is pasted in the second. If the mode was already
+pasted by the editor it is first deleted. Suggested by Grzegorz.
+
+Revision 1.360 2003/05/12 15:55:23 set
+* Modified: Made more robust the "shell script" shl detection/ It now
+supports: "#!.../env command" => command and "#!.../commandVERSION" =>
+command (example python2.2 => python). From Grzegorz suggestions.
+
+Revision 1.359 2003/05/12 15:23:33 set
+* Modified: The imk generator to generate one dependency in each line. This
+makes files bigger (5.5 % for editor.imk) but reduces the CVS traffic
+because when a dependency is added only one line is affected and no all the
+lines after it.
+
+Revision 1.358 2003/05/12 14:39:33 set
+* Added: Emacs modes and shell names for Tcl and Python. Suggested by
+Grzegorz.
+
+Revision 1.357 2003/05/12 13:45:50 set
+* Added: A dialog to dis/enable any advice dialog (also the Quit + delete
+warning).
+* Modified: Now when you "Quit" (cmeQuitDelete) and the warning dialog pops
+up you can press Escape to abort the process. Suggested by Alex Lozano.
+* Added: Virtual members to TStringable to un/mark items. I used it for the
+new dialog.
+* Added: Un/mark facilities to TStringableListBox for TStringables that
+reports support for it.
+* Updated: Spanish translations.
+* Documented: "Check for modified files" and "Advice dialogs" configuration
+options. Both linked to contexts.
+
+Revision 1.356 2003/05/12 13:44:40 set
+* Fixed: Also infview.mkf needed FOR_EDITOR as extra flags and libset.mkf
+needed FOR_LIBSET.
+
+Revision 1.355 2003/05/12 13:43:36 set
+* Added: A dialog to configure if the editor will check modification times
+after running an external program and/or periodically. Also how many seconds
+to wait between checks. Saved to desktop file.
+* Fixed: When no project is available now the "Powered Grep" avoids using
+"search in projects" as default.
+* Fixed: I forgot the C_EXTRA_FLAGS in editor.mkf.
+* Fixed: The above mentioned error also existed for BC++ and MSVC producing
+wrong InfView colors.
+* Updated: Spanish translations.
+* Version 0.5.2
+
+Revision 1.354 2003/05/12 13:41:34 set
+* Added: Every 8 seconds and from the idle loop the editor checks if we
+are editing a file and in this case if the modification time of the file
+on disk changed.
+* Added: Every time we focuse an editor the idle loop checks the
+modification time of the copy on disk.
+* Added: When the editor detects the copy on disk is newer and that we also
+modified the copy in memory the editor asks for 4 options:
+1) Load the file from disk, it discards changes in the copy we have on
+memory.
+2) Don't do anything, the user must solve the problem.
+3) Like 1 but the editor invokes diff -u and shows the output.
+4) Like 2 but with diff like in 3.
+* Added: If GNU diff isn't isntalled we show an advice dialog.
+
+Revision 1.353 2003/05/12 13:40:08 set
+* Fixed: Deatails about handling RHIDE 1.4.7 and 1.5 projects.
+* Fixed: Difference between the criteria of return values between exit,
+djgpp, glibc and make.
+* Fixed: sdgcline compilation issues.
+* Added: Avoid to generate new rhide.env files if they won't change. Now
+they are dependencies.
+* Added: Support for the new .imk files to the BC++ and MSVC configuration
+process (confignt.pl).
+* Fixed: ../holidays shouldn't be in SUPPORT_INC.
+* Modified: To avoid dependencies from $(TVISION_INC)/cl
+
+Revision 1.352 2003/05/12 13:37:59 set
+* Added: A new system for the makefiles. Expect all kind of compilation
+problems. It will simplify the configuration process and reduce CVS patches
+to .mak files.
+* Fixed: libamp case sensitive include.
+* Fixed: sdgcline details to allow clean compilation.
+
+Revision 1.351 2003/05/09 13:09:03 set
+* Added: A check to determine if the configure script is newer than the
+cache. If that's the case the cache is discarded.
+
+Revision 1.350 2003/05/08 18:03:45 set
+* Fixed: After loading a file from a desktop file with column cursor
+enabled it wasn't visible until the cursor was moved.
+* Added: A bizarre desktop example with two fonts.
+
+Revision 1.349 2003/05/08 18:00:46 set
+* Added: Context sensitive help for the holidays configuration.
+
+Revision 1.348 2003/05/07 19:53:46 set
+* Fixed: Now the editor forces Tab==\t.
+* Modified: The word completion key to be Ctrl+Tab as suggested by Grzegorz
+I'll give a try to this combination.
+
+Revision 1.347 2003/05/07 19:44:21 set
+* Fixed: EasyDiag meassured the width of the dialog's title using the
+untranslated string.
+* Modified: The dialog to wait for a key during in the keyboard
+configuration to use EasyDiag.
+
+Revision 1.346 2003/05/07 15:01:20 set
+* Updated: Spanish translation for the fixed messages. Also committing a
+fresh german file that needs fixes.
+
+Revision 1.345 2003/05/07 14:26:16 set
+* Fixed: Applied a batch of patches from Bernd to fix messages in the code.
+
+Revision 1.344 2003/05/07 12:41:15 set
+* Added: holidays.cc to the project and makefiles. That's a whole update
+of the makefiles, please reconfigure the package if you are using CVS.
+
+Revision 1.343 2003/05/07 12:34:42 set
+* Fixed: The holidays directory must be used for includes even when
+dynamic libs are not supported.
+
+Revision 1.342 2003/05/07 12:33:57 set
+* Added: Some people to the list of contributors to the docs.
+
+Revision 1.341 2003/05/07 12:33:16 set
+* Fixed: Second lot of changes to docs from Bernd Becker
+<munin@munin.inka.de>.
+
+Revision 1.340 2003/05/06 20:45:13 set
+* Fixed: Tags: Some languages (the ones after PHP) had errors in the kind
+decoding.
+* Added: HTML language and kind:a to the list of supported tags, Grzegorz
+have a modified E.Ctags that supports it.
+
+Revision 1.339 2003/05/06 20:26:04 set
+* Added: A dialog to force a plug-in for the calendar. Useful if the user
+doesn't define the LANG environment variable or if that isn't enough to
+determine the country.
+* Modified: Moved most of holidays plug-in code to a separated file.
+
+Revision 1.338 2003/05/06 12:34:04 set
+* Added: a small doc explaining how to write a "holidays plug-in".
+
+Revision 1.337 2003/05/06 12:32:41 set
+* Fixed: A lot of typos and errors in docs. Revision by Bernd Becker
+<munin@munin.inka.de>.
+
+Revision 1.336 2003/05/06 12:31:49 set
+* Added: Conditional to compute statistics about the tags. Reports really
+interesting info.
+* Modified: The way that Tags are displayed in lists to make them more
+readable as suggested by Grzegorz. I used the stats to determine the sizes.
+
+Revision 1.335 2003/05/05 20:40:31 set
+* Added: A configuration file for the "holiday plug-ins", it maps a value
+of the LANG environment variable to a country and .so.
+* Added: A default plug-in with the most common holidays more or less used
+world-wide.
+
+Revision 1.334 2003/05/05 14:34:35 set
+* Added: yield to Python keywords (introduced in 2.2). Contributed by
+Grzegorz.
+
+Revision 1.333 2003/05/05 14:08:41 set
+* Added: The first step towards support for plug-ins to highlight holidays
+in the calendar. Currently is only supported for systems implementing
+dlopen() and I have a plug-in only for my country ;-). I'll soon make it
+selectable and write a mini-doc about how to write those plug-ins.
+
+Revision 1.332 2003/05/05 14:06:06 set
+* Modified: Now the dialog that shows the list of classes isn't case
+sensitive. That's why I feel that's much more intuitive and easier to use.
+* Fixed: When searching in classes without a perfect match of the word
+under cursor and jumping to a member the editor jumped but offered the list
+of classes again.
+* Fixed: The list of "functions" supports things that aren't strcitly
+programming languages, like texinfo sources, for this reason the "space"
+key should't act as item selector (can be part of the name in an
+incremental search).
+* Fixed: When switching from a window with some syntax highlight to another
+with a different shl and using Alt+F2 it was common to get a wrong result
+because the editor used the old shl. Now the cmcJumpTo... ensures the shl
+cache is filled with the proper values.
+* Added: A warning to the configset script as I did for DOS. BTW: What's
+the shell command to wait for a keystroke? I just put a sleep 2 but this
+isn't the best.
+
+Revision 1.331 2003/05/05 14:03:21 set
+* Added: A new option to control the size of newly opened files. When
+enabled the windows tries to avoid overlapping the message and project
+windows. The algorithm searchs for the bigger available rectangle that
+doesn't overlap. The code also ensures a minimal size of 24x6 and ensures
+the window is visible (not outside desktop). It was suggested by Ivn.
+* Documented and updated spanish translations.
+
+Revision 1.330 2003/05/05 13:57:49 set
+* Fixed: Some pmacros (Perl was the most notable) didn't indicate the right
+editing mode flags. It could make them fail to generate properly indented
+text.
+* Fixed: "Intelligent indent" mode needed "Backspace unindents" enabled in
+order to work as spected.
+
+Revision 1.329 2003/05/05 13:53:14 set
+* Added: A small tool I wrote to extract info from linker maps. Is quite
+useful for DOS to know how much comes from each lib.
+
+Revision 1.328 2003/05/05 13:51:10 set
+* Added: A warning to configset.bat because people thinks thats "set
+configuration" and not "configuration for SET" ;-)
+* Added: Now if shell utils aren't installed (I think djgpp is the only
+that can lack it) the configuration stops and explains the problem.
+* Modified: gcc 3.x doesn't like (unsigned char)var when var is unsigned.
+* Modified: [DOS] looks like djgpp defines time_t in a way that gcc can't
+see the difference between time_t and unsigned.
+* Modified: Looks like gcc 3.2.2 (may be all 3.x) doesn't support the
+__attribute__((constructor)) stuff for C++ code. So now I'm using C++ code
+for that, which is quite logical but ugly.
+
+Revision 1.327 2003/05/05 13:45:13 set
+* Modified: Now the tags file automagically maintained by the editor can't
+be removed manually from the list of tag files. Also: it isn't saved to the
+desktop file. Instead when you load a project the file is automatically
+inserted.
+* Fixed: What Exuberant Ctags claims to be a regex isn't such a thing. For
+this reaso any "regex" containing a pointer type (*) fails. For this reason
+I changed the way it is used. Now I do a simple search but specifying
+"whole words", it can fail, but I think it won't be usual to get a fail.
+
+Revision 1.326 2003/05/02 19:39:40 set
+* Modified: Now is possible to load projects outside the current working
+directory. From a report by Grzegorz. Note it was tested only for Linux
+(don't tested using drive letters).
+
+Revision 1.325 2003/05/02 12:45:16 set
+* Fixed: The modified CreateChooseDialog used cmOKApply and cmCancelApply
+commands instead of cmOK and cmCancel. Reported by Grzegorz.
+
+Revision 1.324 2003/04/30 20:28:34 set
+* Fixed: The editor wrongly interpreted the basic/extended regex option so
+the real mode was in fact tied to the case sensitive option.
+* Modified: Now the tags code uses real regex.
+
+Revision 1.323 2003/04/30 19:34:19 set
+* Added: A button to search for members of a class, struct, enum or union
+to the jump to tag dialog.
+
+Revision 1.322 2003/04/30 18:00:19 set
+* Fixed: TSortedListBox using SOStacks have a special incremental search,
+it had some bugs fixed in TV but not copied there.
+
+Revision 1.321 2003/04/30 16:05:59 set
+* Added: More documentation about tags.
+* Updated: Spanish translations.
+
+Revision 1.320 2003/04/30 14:23:02 set
+* Added: When you add an item to the project it doesn't have to be newer
+than the TAGs file. For this reason I created a new filed in project items
+to indicate the item is new and that it wasn't yet included in the tags
+file. The concept currently allows the same for other 31 targets.
+* Updated: Web page.
+
+Revision 1.319 2003/04/30 13:18:25 set
+* Added: An option to maintain a central tags file using the project items.
+This option checks if any of the project files is newer than the file
+"tags" and if that's the case calls ctags using the -a option and passing
+a list of files to scan. This makes ctags scan only the newer files saving
+time.
+* Added: Support for tag files where "kind:" is implicit.
+
+Revision 1.318 2003/04/29 18:23:35 set
+* Added: Options to export the project items to a text file and to import
+file names from a text file. Documented and linked to the docs.
+* Updated: Spanish translations.
+
+Revision 1.317 2003/04/29 15:04:51 set
+* Modified: CreateChooseDialog to use EasyDiag and made more configurable.
+* Added: TGrowDialogZ as a TGrowDialog that can handle cmeZoom.
+* Modified: TAGs code to reuse both things.
+
+Revision 1.316 2003/04/29 12:52:11 set
+* Added: A new member to EasyDiag objects to set the growMode option in an
+easier way (setGrowMode).
+* Added: A button to the list of tag files to see the information stored by
+the tags program (format, program version, etc.).
+* Modified: Redesigned the CreateAddInsDelDialog function using EasyDiag
+and added a new option for an "Info." button. The code is much more simple
+now.
+
+Revision 1.315 2003/04/29 12:50:44 set
+* Fixed: When doing a search in/outside comments close to the first line
+and having the cursor in the line of the first hit and this line was longer
+than the sum of the previous the editor evaluated line -1 generating a
+GPF. Reported by Bernd Becker <munin@munin.inka.de>.
+
+Revision 1.314 2003/04/28 19:42:28 set
+* Added: An advice dialog to warn about using tag files in format 1. And
+a button to jump to docs.
+* Added: If the tags file to load is the default and couldn't be loaded
+an advice about it with option to read the docs is used. If the user
+doesn't go to the docs we detect if ctags is installed, if installed we
+offer to generate a new tags files. If not installed we indicate the URL
+of the homepage.
+* Fixed: Tips code tried to jump to editor.inf which is no longer called
+like it. Does anybody read the tips?
+
+Revision 1.313 2003/04/28 16:44:12 set
+* Fixed: The tags code to support: original tags format (FORMAT=1), wrong
+tags files (Emacs tag files for example), backwards regex, etc. without
+crashing. Basically: made more robust when dealing with unexpected tag
+files.
+
+Revision 1.312 2003/04/28 14:02:05 set
+* Added: Some documentation about the new TAGS features.
+* Added: Connected the context sensitive help values with the new
+documentation.
+
+Revision 1.311 2003/04/28 14:00:31 set
+* Updated: Spanish translations.
+* Fixed: Shortcut collision in class browser.
+* Removed: Some debugging printfs.
+
+Revision 1.310 2003/04/28 13:58:19 set
+* Added: Word completion stuff! is based on the code I wrote for sLisp and
+Lemur. I used Alt+Right for it but I'm not sure if that's a good idea.
+Currently is only on user request, some options about it could be added.
+
+Revision 1.309 2003/04/28 13:56:15 set
+* Added: A class browser based on TAGs info. It allows to know which are
+the parents and childs for a class, also which members are declared, jump
+to any of them, see a list of the members plus the members of the parents
+and more. I coded it in less than 5 hours, don't spect perfect code.
+* Added: A new constant called tsveMakeSameW, when used (with or) for
+MakeVeGroup forces a call to makeSameW().
+
+Revision 1.308 2003/04/28 13:54:25 set
+* Fixed: When a directory contained a project with a desktop file newer
+than the current setedit version and a default desktop file from a version
+older than 0.5.0 the editor rejected the new file but preloaded it doing
+a mess at the time of loading the old file.
+
+Revision 1.307 2003/04/28 13:53:33 set
+* Added: When adding a tag file to list now the editor asks if we want to
+add it using a relative path.
+* Modified: The dialog to select a tag file now uses "tags*".
+* Added: The list of selected tag files is stored in the desktop file.
+* Version 0.5.1
+
+Revision 1.306 2003/04/25 18:41:43 set
+* Fixed: When typing at the end of the visible area and a horizontal scroll
+is forced the editor have to draw the whole window. To minimize the impact
+the editor does an 8 columns scroll. But if this width was less than the
+width of the larger line this scroll was automatically neutralized by the
+horizontal scrollbar. It not only defeated the effect but also generated a
+second full draw making things even worst.
+
+Revision 1.305 2003/04/25 18:15:10 set
+* Fixed: When jumping to a hit in the message window and the first column
+contained a matching [{( and the editor was configure to do match pair on
+the fly: the message quickly dissapear.
+
+Revision 1.304 2003/04/25 15:02:23 set
+* Fixed: TSCheckBoxes computed the with using untranslated messages. Same
+for TSRadioButtons.
+
+Revision 1.303 2003/04/25 12:22:25 set
+* Added: Now you can jump to any symbol from the TAGS file! looks like I
+can't get it working using real regex and also looks like they aren't real
+regex, just full lines marked similar to regexs.
+
+Revision 1.302 2003/04/24 20:05:11 set
+* Added: A new color scheme contributed by Juan Diego (bach) Ianelli
+<jdibach@yahoo.com.ar>. Is called "Dark JDI".
+
+Revision 1.301 2003/04/24 19:24:19 set
+* At last!! finally I added some basic supoprt for TAGS. I had some code
+I wrote in 1998, but I discarded it because ectags changed a lot. Currently
+you can setup which tag files to use (the list isn't stored to disk) and
+do a search pressing ^F2, for repited entries you'll even be able to jump
+to the line where the symbol is defined, but in most cases the position is
+obtained using regex and it isn't implemented yet. Be careful that's really
+experimental. Also: forget about using it if the editor is linked with
+efence and the tags file is big. I tried it with a 1.1 MB file and the
+editor died after eating more than 240 MB of memory (efence seems to need
+real memory, not swap).
+
+Revision 1.300 2003/04/22 15:32:56 set
+* Modified: To support the --with-ssc TV option.
+
+Revision 1.299 2003/04/21 19:38:34 set
+* Fixed: wrong rules to create internac/colors.cc.
+
+Revision 1.298 2003/04/21 18:30:05 set
+* Modified: i18n files to remove TV messages, now they are in a separated
+catalog (tvision domain).
+* Modified: The i18n initialization to use TVIntl::autoInit().
+
+Revision 1.297 2003/04/21 18:25:37 set
+* Added: Copy/paste to/from OS clipboard to the list of i18n strings.
+* Fixed: Shortcut collision between it and file clipboard.
+* Updated: Spanish translations, removed \r to shutup msgmerge.
+
+Revision 1.296 2003/04/21 18:23:44 set
+* Fixed: Color names now are coherent, all start with a capital letter.
+* Fixed: The f*ck#ng gettext doesn't like values outside ASCII in msgids so
+I changed Robert's last name and put the correct value in the spanish
+translation. Some day I'll discard GNU gettext in favor of a forked and
+sane replacement.
+* Added: A small tool to extract the names of the colors for i18n.
+* Updated: Spanish translation.
+
+Revision 1.295 2003/04/21 18:16:20 set
+* Adapted: Most of the remaining use of the old TV i18n API.
+* Added: Various calls to snprintf (while adapting i18n).
+* Added: A small tool to extract msgids from TV's .po file.
+* Fixed: Spanish .po header (wrong encoding in comments).
+* Updated: TV i18n messages.
+* Fixed: Memory leak in about dialog.
+* Updated: Spanish translation.
+
+Revision 1.294 2003/04/21 18:07:16 set
+* Modified: No more use of strstream, now I use messageBox, easier code.
+
+Revision 1.293 2003/04/16 20:29:42 set
+* Modified: All messageBox calls to the new i18n API.
+
+Revision 1.292 2003/04/10 21:39:42 set
+* Modified: Now the i18n catalogs are in ISO-8859-1 encoding for all
+targets. Under DOS they are recoded on-the-fly to get CP850.
+* Fixed: Some code in the installer that used _() as returning char *.
+
+Revision 1.291 2003/04/08 19:18:25 set
+* Modified: TWindow, TDialog and TButton use to follow TV.
+
+Revision 1.290 2003/04/08 14:08:01 set
+* Modified: Uses of TStaticText incarnations to follow new TV features. I
+hope the number of bugs is low ;-) This isn't really harmful but I think
+some bugs are there.
+
+Revision 1.289 2003/04/07 13:48:38 set
+* Modified: all uses of TCheckBoxes and TRadioButtons to match the new TV
+API. Now they also support code page changes on the fly.
+* Fixed: In the last MinGW fix to avoid annoying messages from the
+configure script I forgot to assign the return value making recode,
+xgettext and makeinfo detection to fail.
+
+Revision 1.288 2003/04/07 13:47:27 set
+* Modified: The menu and status line creation for the new TV i18n API. Now
+they adapt to code page changes!
+* Modified: The configuration to request TV 2.0.2.
+
+Revision 1.287 2003/04/07 13:46:32 set
+* Modified: To adapt to the new TVIntl class, just compilation details.
+More will come soon ;-)
+
+Revision 1.286 2003/04/03 19:57:28 set
+* Fixed: Even when gettext (intl library) returns a char * it should be
+used as a const char *. When I enforced it using the _() macro one wrong
+use was detected and this change allows compilations for const char * as
+return value.
+
+Revision 1.285 2003/04/02 13:40:10 set
+* Fixed: [MinGW] The configuration script shown the error messages created
+when running non-existent programs appear in the screen generating
+confusion. Now the command are executed redirecting stderr.
+
+Revision 1.284 2003/04/02 13:39:02 set
+* Fixed: Warnings about: return value in TCEditor::loadFile (this is
+because BC++ is idiot to detect the complete flow, but now the code is
+more clear for the compiler and also for humans ;-), Comparisson between
+unsigned char and unsigned int gave warnings (promotion to int?) in
+edprefs.cc and assigment of bool to a Boolean variable. All reported by
+BC++ 5.5 as warnings.
+
+Revision 1.283 2003/04/01 17:31:34 set
+* Added: The web site to CVS (for easier maintainance) and distro (for more
+information for the user).
+* Updated: The web site for the last release.
+
+Revision 1.282 2003/04/01 13:54:32 set
+* Fixed: Attribute handling for big endian platforms in TViewPlus class.
+
+Revision 1.281 2003/04/01 03:44:38 terrible
+* Updated: Debian packaging to version 0.5.0-1.
+* Modified: tell people to use the distribution name like for example
+potato/woody instead of unstable/stable.
+
+------------------------------------------------------------------------------
+v0.5.0 [tagged as r0_5_0]
+
+Revision 1.280 2003/03/21 18:02:58 set
+* Fixed: Syntax highlight propagation in "last line - 1" after pasting.
+
+Revision 1.279 2003/02/19 12:41:22 set
+* Fixed: Heuristic Perl parser didn't pay attention to the \ character, the
+code looked for it but didn't increment the index properly. Reported by
+Juan Diego Iannelli <jdibach@yahoo.com.ar>
+* Added: New keywords used in experimental TV for their configuration file.
+
+Revision 1.278 2003/02/11 13:41:01 set
+* Updated: Spanish translation.
+
+Revision 1.277 2003/02/11 13:32:11 set
+* Updated: Copyright date to include 2003 in the about dialog and also the
+date of the last documentation change.
+
+Revision 1.276 2003/02/06 18:55:29 set
+* Added: Save all option to save all unsaved editors. As suggested by
+lvaro (Cristina ;-) and Ivn.
+
+Revision 1.275 2003/01/31 15:55:59 set
+* Fixed: When "match pair on the fly" was enabled the editor forced a
+center cursor periodically interfering with the movement using the scroll
+bars. Reported by Ivn and lvaro.
+
+------------------------------------------------------------------------------
+v0.5.0 Release Candidate 1
+
+Revision 1.274 2003/01/29 12:45:58 set
+* Updated: project and makefiles because I added the PHP parser to libset
+and we are preparing for a release candidate.
+
+Revision 1.273 2003/01/28 12:56:50 set
+* Added: Last changes to distrib files in order to release the RC1.
+
+Revision 1.272 2003/01/17 17:56:19 set
+* Modified: [Linux] glibc 2.3.x deprecates the use of sys_errlist and
+the replacement (strerror) is available in glibc 2.2.x so now for
+glibc>=2.2.0 I use it. Reported by Andris.
+
+Revision 1.271 2003/01/17 14:34:08 set
+* Fixed: The function list failed for namespace::class::member()
+declarations. Reported by Andris.
+* Fixed: It also failed for function(namespace::identifier).
+
+Revision 1.270 2003/01/08 15:01:33 set
+* Fixed: Bug in match pair highlight on the fly, using the wrong line as
+shl reference. Reported by Ivan.
+
+Revision 1.269 2003/01/07 19:57:31 set
+* Fixed: Wrong SHL parsing of empty lines that propagates strings when they
+are under edition. Reported by Ivan.
+
+Revision 1.268 2003/01/07 19:12:54 set
+* Modified: The SQL syntax to properly understand MySQL and PostgreSQL
+comments.
+* Modified: Gave more priority to comments than simple symbols, should be
+carefully tested but it made SQL comments to fail. From Ivan report.
+
+Revision 1.267 2003/01/06 20:18:22 set
+* Added: An explanation about how to install setedit in the home directory
+and use it from any machine with access to it. Contributed by Grzegorz.
+* Modified: Some macros to work with the Texinfo provided by Woody.
+
+Revision 1.266 2003/01/06 13:54:09 set
+* Updated: Grzegorz example on how to use macros to externally process
+portions of text.
+
+Revision 1.265 2002/12/30 15:28:22 set
+* Updated: POVRay SHL, from Martijn.
+
+Revision 1.264 2002/12/30 15:24:44 set
+* Modified: Removed the line len limitation in the syntaxhighlight loader.
+Asked by Martijn, he used more than 100 columns for POVRay SHL ;-)
+
+Revision 1.263 2002/12/27 12:40:40 set
+* Fixed: Added/Removed entries to the list of files.
+* Added: A chmod to make the INSTALL script executable when generating the
+packages.
+
+Revision 1.262 2002/12/20 15:44:40 set
+* Fixed: Ivan forgot to comment STANDALONE in pphp.cc.
+* Added: A new environment variable: SET_LOCALEDIR. It tells to the editor
+where to look for i18n files. That's useful when you have to install in the
+home directory. From a problem pointed out by Grzegorz.
+* Added: Info about the new environment variable to the manpage and the
+Linux FAQ.
+
+Revision 1.261 2002/12/14 23:00:14 terrible
+* Modified: PHP Functions Parser: added benchmark results and a EXTRA_INLINE
+macro to activate the inlines that cause bloat but speed things (yes! because
+they are on the hot path and used very often), the default is to not inline
+those extra functions when compiling for the editor but inlining when
+compiling standalone. The default parameters on the function definitions are
+commented out instead of just not being there, I prefer that for code
+clarity.
+
+Revision 1.260 2002/12/12 19:05:39 set
+* Removed the cmeKeyboardSetUp option, it no longer exists. Now this is
+controlled by the input code page.
+
+Revision 1.259 2002/12/12 19:04:31 set
+* Modified: The greek keyboard tweak no longer compiles. Removed the code
+that prevented compilation.
+
+Revision 1.258 2002/12/10 18:32:00 set
+* Added: The new cyrillic and greek "repeated" symbols to the fonts.
+
+Revision 1.257 2002/12/10 18:27:55 set
+* Added: Last TV config keyword.
+
+Revision 1.256 2002/12/10 14:13:55 set
+* Added: Missing header for fonts conversion utility.
+
+Revision 1.255 2002/12/09 13:23:53 set
+* Fixed: Commented out atStartOfComment in pphp.cc, it isn't used.
+
+Revision 1.254 2002/12/09 13:23:11 set
+* Modified: Removed a lot of inline declarations in pphp.cc. They aren't
+good candidates for inline functions (no speed gain and code bloated).
+BC++ 5.5 made warnings about them.
+* Fixed: un/signed comparisson in editmain.cc.
+* Modified: BC++ 5.5 doesn't like empty declarations produced by 2
+consecutive ;.
+
+Revision 1.253 2002/12/09 13:21:39 set
+* Fixed: [Win32] gdi32 is needed to link. (new WinGr driver)
+* Fixed: configuration library to output less error messages during tests.
+* Fixed: default values in function declarations used in pphp.cc.
+* Modified: [MinGW] edprefs.cc to workaround a name space pollution in
+MinGW headers. (grp1 and grp2).
+
+Revision 1.252 2002/12/09 13:07:08 set
+* Fixed: [DOS] The greek hack. It should go away.
+
+Revision 1.251 2002/12/09 13:06:10 set
+* Fixed: A bug in the painting shl routine used for user defined syntax
+highlights. Failed for commented lines starting with blank spaces
+(specially tabs) and with text after the end of comment.
+
+Revision 1.250 2002/12/05 17:09:43 set
+* Added: Spanish translations for "Save as DOS" and "Shell". Pointed out
+by Ivan.
+
+Revision 1.249 2002/12/04 21:25:46 terrible
+* Corrected typo in change.log: spect should be expect.
+* Tested the editor, the Debian packaging didn't need any changes!
+
+Revision 1.248 2002/12/03 12:36:28 set
+* Fixed: The editor configured the secondary font using "screen" encoding
+at start-up.
+* Fixed: We didn't signal the need of loading a secondary font at start-up,
+I forgot to implement it in TV.
+
+Revision 1.247 2002/12/03 12:35:53 set
+* Added: [DOS] FAQ entry explaining that NT doesn't implement WinOldAP and
+hence you can't copy/paste using it.
+* Modified: [Linux] I heavily modified the Linux FAQ because now we have
+the X11 driver and it should remove most of the annoying limitations. I
+also added an entry explaining how to give access to /dev/vcs* to users.
+
+Revision 1.246 2002/12/03 12:35:10 set
+* Modified: Default global settings to be more similar to what a Windows
+user expects. Suggested by Ivan.
+
+Revision 1.245 2002/12/03 12:34:18 set
+* Modified: Removed all the conditionals for TV<2 and modified the
+configure script to request TV>=2.0.1.
+
+Revision 1.244 2002/12/03 12:32:44 set
+* Fixed: The special lines that doesn't exist are 0 and not -1.
+
+Revision 1.243 2002/12/03 12:31:56 set
+* Fixed: The KeyPad behavior. It is only for DOS driver. TV 2.0.1 is
+needed.
+
+Revision 1.242 2002/12/03 12:31:19 set
+* Added: More InfView commands to the commands parser used for sLisp and
+Menu files. I renamed the chcd* commands to cmh* so they can be parsed.
+I added a test example to the menubind.smn file. Closes SF FR #645731
+created by Martijn.
+
+Revision 1.241 2002/11/29 12:50:22 set
+* Modified: Now TV provides CLY_Beep for all platforms.
+
+Revision 1.240 2002/11/27 17:35:12 set
+* Fixed: When using Linux (without VCS access) and XTerm drivers and
+calling a child process in background the child shared the output file
+handle producing a nasty side effect. Now the stdout and stderr are dup2'ed
+in the child using the redirected file.
+* Fixed: When creating new entries in the project they had an empty resume
+and it made the editor bomb at load time. Introduced by Ivan's request ...
+I knew it will blow something ;-), now the editor fills the propper field
+before saving and also workarounds wrong projects.
+
+Revision 1.239 2002/11/27 13:11:58 set
+* Added: A resumed list of new and fixed stuff to the distribution list.
+
+Revision 1.238 2002/11/26 12:51:12 set
+* Added: An LRU algorithm to remove entries in the closed list, as
+suggested by Ivan. I changed (once again) the resume structure to add the
+time stamp of the resume. Expect all kind of stupid side effects, flames
+go to Ivan for the idea ;-)
+
+Revision 1.237 2002/11/26 12:50:17 set
+* Fixed: The GetSelection sLisp command read one extra character in a
+string copy. Only detectable thanks to efence (not harmful).
+
+Revision 1.236 2002/11/20 17:33:51 terrible
+* Fixed: the editor didn't like the carriage returns, tabs, etc. that the PHP
+parser was giving to him which is something very understandable, so we
+replace them toghether with comments (they disturb in the function list) by
+a single space.
+* Fixed: off by 1 error on the PHP parser, tAddFunc function expects len to
+be the length of the string _including_ the ending 0 instead of the real
+length.
+
+Revision 1.235 2002/11/12 14:09:15 set
+* Fixed: [configuration] The --without-aa option didn't work. Reported by
+Martijn Versteegh.
+* Fixed: [configuration] After disabling MP3 support it was impossible to
+enable it again without deleting the cache file. From a report by Martijn.
+* Added: The new parser to BC++ and MSVC makefiles.
+
+Revision 1.234 2002/11/12 13:12:39 set
+* Added: Linked the PHP Parser that Ivn added to the list of available
+parsers. I'll think about the indentation, after all my "weird" indentation
+is almost the same used by GNU project ;-)
+
+Revision 1.233 2002/11/11 21:47:40 terrible
+* Modified: added bool, true, false, typename and using to the C++ syntax
+highlight (both the .shl file and editmain.cc).
+* Added: PHP heuristic parser for function jumps and class recognition.
+Note: needs to be added to the building process and bufun.h, I don't have
+RHIDE so I can't do that myself, thanks :).
+Note 2: I am not as good as Salvador coding, but at least my indentation
+isn't so weird :-D, though if it is needed, I would indent it with Salvador's
+exotic style :-D, but if I am going to maintain it, I would prefer that it
+remains with my indentation style if possible.
+
+Revision 1.232 2002/11/11 20:15:58 set
+* Added: Now the matchpair and the complementary element jumps are affected
+by the syntax highlight. It was in the Feature Request for a long time and
+Ivan annoyed me to add it. It should be tested but seems to work,
+complementary elements only match if they belong to the same shl context.
+
+Revision 1.231 2002/11/11 17:43:20 set
+* Added: Now if you unindent uncommenting the editor checks that at least
+the first line is already indented, if not the operation is aborted.
+* Fixed: When indenting a block using the arbitrary indent or comment
+indent the syntax highlight wasn't recomputed.
+
+Revision 1.230 2002/11/11 16:21:22 set
+* Fixed: A bug introduced by the 1.197 (SF number) revision. It fixed
+problems in the overwrite undo but introduced problems in the normal
+overwrite use ;-). Now I reverted part of the patch and added a specific
+fix. *** Overwrite still unstable ***
+
+Revision 1.229 2002/11/08 12:42:45 set
+* Added: Some keywords to HTML syntax highlight.
+
+Revision 1.228 2002/11/08 12:40:44 set
+* Added: A very limited XML syntax highlight, I'm trying to learn about it
+so it currently highlights what I know ;-)
+
+Revision 1.227 2002/11/06 16:17:04 set
+* Added: An option to generate HTML 4.01 + CSS in the HTML export.
+
+Revision 1.226 2002/11/05 13:15:33 set
+* Fixed: applycvs.pl failed to apply new files in the root of the module.
+
+Revision 1.225 2002/11/05 13:13:33 set
+* Fixed: Now when choosing to "never remember windows" the options "resume"
+isn't applied. Note it was possible to choose such a behavior by choosing
+not to remmember the cursor position. From a suggestion by Grzegorz.
+
+Revision 1.224 2002/10/29 14:58:25 set
+* Fixed: When specifying a new project from command line the preLoad
+mechanism failed giving a SIGSEGV. Reported by Grzegorz.
+* Fixed: When specifying an existing project from command line the preload
+mechanism loaded the right desktop file but the second pass loaded the
+default desktop. From a report by Grzegorz.
+* Added: Now is possible to indicate a project to load without the
+extension in the command line. From a report by Grzegorz.
+
+Revision 1.223 2002/10/24 18:07:12 set
+* Added: "latex" to the TeX extensions. Suggested by Grzegorz.
+
+Revision 1.222 2002/10/07 19:25:22 set
+* Fixed: The "insert key name" option was broken for TV 2.0.0.
+* Added: / to PHP symbols as suggested by Ivan.
+
+Revision 1.221 2002/10/04 01:01:10 terrible
+* Updated: Debian packaging to version 0.5.0-0.4.
+
+Revision 1.220 2002/10/02 13:08:30 set
+* Added: A cursor restore after closing AAlib. That's just to test if it
+solves the SF issue #617251 submitted by Grzegorz. But I think this is a
+bug in AAlib or Linux kernel. I can't reproduce it in my system.
+
+Revision 1.219 2002/10/02 12:59:50 set
+* Added: Documentation for the new Screen, Encodings and Fonts options.
+
+Revision 1.218 2002/09/23 12:45:07 set
+* Fixed?: The TDskWin wrappers for InfView and the Clipboard deleted the
+windows intead of closing them. This can originate the use of already
+deleted objects because they remain inserted in the desktop. I saw it with
+efence, but I wonder why it wasn't exposed before, that's why I'm not sure
+about this fix.
+* Fixed: The TDskWinPrj() objects didn't set the wS and hS members when a
+new project was created giving crazy window sizes when loading the desktop.
+
+Revision 1.217 2002/09/23 12:43:30 set
+* Added: More TV configuration file keywords.
+
+Revision 1.216 2002/09/20 16:32:11 set
+* Fixed: The editor didn't allow to save ReadOnly files using "Save As",
+that's the only way we have to make a ReadWrite copy, so now that's
+allowed. Before writing the status is changed to RW and if the save goes
+wrong is reverted to RO.
+* Fixed: The selection adjust done when we leave a line under edition
+failed if the line had extra spaces at the end. I don't understand why the
+code comment said the right thing and the code had it wrong.
+
+Revision 1.215 2002/09/18 12:33:44 set
+* Added: DontMoveHiddenCursor to the tvrc syntax hl.
+
+Revision 1.214 2002/09/18 12:32:43 set
+* Added: The new TV config variables for DOS and XTerm drivers.
+
+Revision 1.213 2002/09/16 14:43:08 set
+* Fixed: The MP3 window character wasn't remapped after the last change.
+* Added: The last TV configuration keywords to the shl file.
+
+Revision 1.212 2002/09/13 12:30:31 set
+* Fixed: Lack of string.h in edfonts.cc. Reported by Anton Ustyancev
+<anton@cinvest.chel.su>.
+
+Revision 1.211 2002/09/13 12:28:07 set
+* Fixed: [DOS] Lack of Uses_TVCodePage in loadfunc.cc when compiling using
+djgpp.
+* Fixed: [DOS] When using the editor without djgpp the editor failed to
+find the internationalization files. Reported by Alex Lozano.
+
+Revision 1.210 2002/09/12 18:15:27 set
+* Modified: Removed code that used cmcUpdateCodePage, no longer needed.
+* Fixed: When loading a desktop that used fonts the code didn't indicate
+the font was loaded and hence encoding changes didn't change the font
+encoding.
+
+Revision 1.209 2002/09/12 18:14:17 set
+* Fixed: When the desktop file for a project was missing the loading
+routine didn't signal the "pre-load" state skipping the screen data
+initialization and hence generating a SIGSEGV.
+
+Revision 1.208 2002/09/12 18:13:31 set
+* Modified: The default ManView colors as suggested by Ivan, now they are
+more coherent with InfView.
+
+Revision 1.207 2002/09/12 01:16:26 terrible
+* Fixed: typo in internac/es.po.
+* Updated: Debian packaging to version 0.5.0-0.3.
+
+Revision 1.206 2002/09/11 13:14:32 set
+* Big code clean-up, I hope it isn't a big code breakage ;-)
+* Modified: all references to ctype functions to use TVCodePage members.
+* Added: application and input code page settings to InfView. Changed
+version to 0.2.8.
+* Modified: Removed old code in codepage.cc and adapted InfView and SETEdit
+to only use the new TV code.
+* Modified: Removed old code in edfonts.cc.
+* Updated: Project dependencies.
+
+Revision 1.205 2002/09/11 12:58:44 set
+* Fixed: The encoding options dialog failed to revert default values when
+the user disabled the "force" option.
+
+Revision 1.204 2002/09/10 19:07:29 set
+* Fixed: [Big Endian] the hexadecimal syntax highlight could use unaligned
+memory.
+
+Revision 1.203 2002/09/10 17:30:07 set
+* Modified: The code pages dialog to show what currently is used by the
+driver in the cps that aren't forced.
+
+Revision 1.202 2002/09/09 20:51:39 set [uid61297 <= Ugh! SF bug!]
+* Modified: removed code used for old screen options dialog.
+
+Revision 1.201 2002/09/09 13:33:54 set
+* Fixed: InfView compilation detail, problem introduced in last rev (1.715
+in my home CVS 1.200 @SF)
+
+Revision 1.200 2002/09/09 13:32:41 set
+* Added: Support for the secondary OS clipboard to InfView (X11 selection).
+* Added: Support fot copy from man page to: editor's clipboard, main OS
+clipboard and secondary OS clipboard.
+* Removed: Old code I used to compile InfView with Sigala's port. Also
+removed some TV 1.x code.
+
+Revision 1.199 2002/09/06 20:56:11 set
+* Added: The first steps towards selection support in the manpage viewer.
+Isn't functional yet. Suggested by Ivan.
+
+Revision 1.198 2002/09/06 18:47:01 terrible
+* Updated Debian packaging to 0.5.0-2.
+
+Revision 1.197 2002/09/06 16:12:11 set
+* Fixed: A bug in the undo of text typed while using overwrite mode. It
+could unsynchronize the cursor position. Is amazing it was there after so
+much time. And the next is even worst:
+* Fixed: When typing in overwrite mode the line length was wrongly
+computed. It wasn't too bad because it is computed again when the line is
+flushed but originated some nasty syntax highlight errors.
+*** The fixes seems ok, but the overwrite mode should be temporally
+ considered unstable ***
+Both found while testing David's report.
+.
+Revision 1.196 2002/09/06 15:27:18 set
+* Fixed: When restoring the settings of a closed window (or project item)
+the "overwrite" status wasn't reflected in the cursor shape. Reported by
+David A. Capello <dacap@users.sourceforge.net>
+
+Revision 1.195 2002/09/06 00:10:28 terrible
+* Updated: Debian packaging to version 0.5.0-0.1.
+
+Revision 1.194 2002/09/04 20:32:32 set
+* Added: When the editor loads a file the "busy indicator" is used.
+* Fixed: Added some rounding to the resume computations to make them more
+accurate.
+* Fixed: Some problems that made the editor crash when opening a file from
+the windows list dialog and this process needed to show a messageBox. In
+this case the "closed file" entry was deleted but the list box didn't know
+it. So now is protected against it.
+
+Revision 1.193 2002/09/04 18:16:48 set
+* Modified: Now editor "resumes" stores coordinates in a relative way. The
+screen is 100% == 16384. When restoring the values they are computed
+according to the current screen size. In this way closed windows that were
+opened using another screen size are restored correctly.
+
+Revision 1.192 2002/09/04 15:46:21 set
+* Updated: Spanish translation.
+
+Revision 1.191 2002/09/04 13:14:37 set
+* Added: The project windows are resized accroding to the desktop file when
+loading. Till now all the windows (from the dst) were resized but the
+project window (from the epr) wasn't. With this is quite smooth to load a
+project that was used with another desktop size.
+
+Revision 1.190 2002/09/04 13:13:48 set
+* Fixed: The TVOSClipboard::paste member returns a new[] allocated array
+and it should be freed usind delete[].
+
+Revision 1.189 2002/09/04 13:13:04 set
+* Modified: The middle button insert text at the cursor position not at the
+mouse position. I found the previous behavior annoying.
+
+Revision 1.188 2002/09/03 13:48:26 set
+* Fixed: Error in docs about delete left/right word. Reported by Chris
+Impens <ci@cage.rug.ac.be>.
+
+Revision 1.187 2002/09/03 13:45:32 set
+* Fixed: Now old desktop file information is also loaded translating to
+the new structure when isn't preloaded. Complex, no? :-P
+* Modified: I reworked most of the palette stuff to adapt to the new
+scheme. Now the palettes are stored in disk only if changed.
+
+Revision 1.186 2002/09/02 13:58:40 set
+* Added: Now the driver dependent settings are stored in the desktop file.
+For this reason the desktop file format changed and I'm switching to
+version 0.5.0. Consider it ***UNSTABLE***
+* Version: 0.5.0
+* Added: The code needed to adapt to a desktop file change once we are
+already initialized (change of project for example). This seems to work,
+but I'm quite sure is full of bugs.
+* Note: I was able to have different settings for X11 and Linux drivers in
+the same desktop file and properly handle a project with another fonts
+loaded. But it was hard to get working so I think a lot of work will be
+needed before it works for all the cases.
+
+Revision 1.185 2002/09/02 13:54:41 set
+* Modified: [DOS] Now -b/B are now deprecated in favor of the BIOSKey TV
+configuration option, but is supported.
+* Modified: [DOS] Ctrl+Break is now blocked, the idiot that put Break just
+above PageUp should be killed.
+* Added: BIOSKey TV config keyword.
+
+Revision 1.184 2002/09/02 13:53:49 set
+* Modified: [DOS] The installer now uses cwsdpmi and a regular stub. I
+changed it because A) A user reported problems in SF bug tracker and B)
+cwsdpmi is much more reliable than pmodedj. SF bug #594116.
+
+Revision 1.183 2002/08/27 17:21:41 set
+* Added: DontResizeToCells TV configuration keyword.
+
+Revision 1.182 2002/08/26 13:41:48 set
+* Added: ExtProgVideoMode and VideoMode TV config file keywords.
+* Added: More code for the video mode options. Next step will be save the
+options.
+
+Revision 1.181 2002/08/26 13:40:48 set
+* Modified: Moved edHelper and clipWindow to the main class.
+* Modified: Moved some global functions related to the load desktop to the
+class as statics. Also modified some code to adapt for it.
+* Modified: More code for the driver settings stuff, added a function to
+transfer the loaded values to the "config file" TV tree, the so member is
+now a pointer to the settings for the current driver in the settings
+collection, etc.
+
+Revision 1.180 2002/08/23 15:22:46 set
+* Added: HideCursorWhenNoFocus tvrc keyword.
+
+Revision 1.179 2002/08/23 14:10:21 set
+* Added: ScreenPalette to the tvrc syntax highlight.
+* Added: More code to the preLoadDesktop, now is loading all the screen
+information from old desktop files.
+* Added: Implemented TScOptsCol this collection will hold the settings for
+each driver.
+* Modified: Palette code to support the preload.
+* Modified: Removed more TV 1.x compatibility code.
+
+Revision 1.178 2002/08/20 14:23:28 set
+* Added: First step towards loading screen options before starting TV. It
+implies a "pre-load" of the desktop file loading only the screen related
+stuff. Currently I'm implementing what will become the "compatibility"
+code. The new desktop files (0.5.0) will store it in a better way and will
+have separated options for each driver.
+
+Revision 1.177 2002/08/13 13:38:59 set
+* Added: UseSecondaryFont TVRC keyword.
+* Fixed: I declared some const char * const members as const char *. MSVC
+detected the subtle difference, gcc nor BC++ detected it.
+
+Revision 1.176 2002/08/12 16:34:15 set
+* Modified: Moved all the new screen related options to a structure and
+it + the functions to the main program class.
+
+Revision 1.175 2002/08/12 16:33:23 set
+* Added: Configuration for the new "Input Code Page". I succesfully edited
+a text encoded in CP 850 using X. The library translated ISO-1 input into
+CP850 codes.
+
+Revision 1.174 2002/08/12 16:32:26 set
+* Modified: [MinGW] Configure script to avoid generating rules for doc and
+internac. The MinGW tools I tested fail to make this targets. I think the
+reasons are: buggy makeinfo and command line length limitations in gettext
+tools.
+* Modified: Included internac/po_list in the distribution, it can be
+generated using Perl but MinGW and Cygwin generates GPFs when running the
+perl script.
+
+Revision 1.173 2002/08/12 16:31:18 set
+* Modified: The default menu to say "Shell" instead of "DOS shell".
+* Added: "Window|User screen" disabled if it doesn't exist.
+
+Revision 1.172 2002/08/12 16:30:31 set
+* Added: Code to avoid calling a shell if TScreen::noUserScreen() returns
+True. Also for InfView and for the Run Program "Use OS screen" option.
+* Modified: Removed some TV 1.x code.
+
+Revision 1.171 2002/08/12 16:23:21 set
+* Fixed: Read out of bounds in man page viewer (detected by efence).
+* Fixed: The ASCII window grown after a window resize.
+
+Revision 1.170 2002/08/12 16:22:27 set
+* Added: Copyright information about the fonts and convpcf1.cc
+* Modified: The fonts dialog to keep the sizes well sorted, the
+alphabetical way is useless. Now is sorted by width and height (in this
+order).
+
+Revision 1.169 2002/08/12 16:18:20 set
+* Added: Three incomplete SFT files and a simple program to generate them
+from raw fonts. They just contain the first 256 symbols (CP 437) and in
+some cases the real symbols are just in the ASCII range the others are
+regular.
+
+Revision 1.168 2002/08/12 16:15:54 set
+* Fixed: Memory leaks in the new fonts code.
+
+Revision 1.167 2002/07/30 17:46:54 terrible
+* Updated: Debian packaging to 0.4.57-0.4.
+* Modified: my email changed from lubaldo to ibaldo.
+* Broked: everything, this is a sabotage!, SET is on vacations!!!
+
+Revision 1.166 2002/07/25 17:25:49 set
+* Fixed: InfView changed to use unique_name, but as it was working it
+didn't copy the real file name to the referenced buffer and it made InfView
+fail to remove temporal files used to uncompress .info files. Now
+unique_name does the copy. It didn't affect UNIX systems.
+* Modified: All the calls to unique_name using 0 as second parameter (is
+the default value).
+* Added: A fonts request call back, so now if you change the video mode and
+the new mode uses a font with a different size the call back can provide
+it. Currently it only helps for DOS.
+
+Revision 1.165 2002/07/24 20:03:22 set
+* Added: The "Fonts" dialog now works, the options aren't stored to disk
+yet but you can play with it. I tested a 2 fonts configuration under X11
+and put a snapshot in the site.
+* Fixed: The command line option -d N generated a SIGSEGV.
+
+Revision 1.164 2002/07/23 16:38:25 set
+* Added: [MSVC] /verbose to the link stage to get more information about
+the linking problems.
+
+Revision 1.163 2002/07/22 20:39:13 set
+* Fixed: [MSVC] makefile. Patch by WintiX.
+* Modifed: [MSVC] the screensaver sources to investigate the sources of
+problems when linking with MSVC.
+
+Revision 1.162 2002/07/22 19:41:14 set
+* Added: Connected the primary font collection with the available sizes.
+
+Revision 1.161 2002/07/22 19:40:35 set
+* Added: A fonts dialog. Currently does nothing, just shows some options.
+* Added: SFT files to UNIX distro.
+* Removed: Some code from edfonts that I moved to TV.
+
+Revision 1.160 2002/07/22 19:39:12 set
+* Added: Font10x20 keyword to TV config files.
+* Added: Warning about error in let.txt about 0x2578-0x257B unicodes that
+comes from Linux fonts errors.
+* Added: A 10x20 SFT.
+
+Revision 1.159 2002/07/22 19:20:38 set
+* Modified: getopt calls to use the new CLY_* methode.
+
+Revision 1.158 2002/07/19 20:45:54 set
+* Roll back of bzlib patch.
+* Modified: [MSVC] makefile to avoid command line limitations. Untested.
+* Fixed: Collisions between spec.cc and edspec.cc reported by MSVC from
+output by WintiX.
+
+Revision 1.157 2002/07/19 14:44:57 set
+* Fixed: bzip2 newer than 1.x uses BZ2_bzlibVersion and my test only tried
+bzlibVersion. Pointed out by Andris.
+* Added: Search for TV in /usr/local for all UNIX systems. Patch by Andris.
+
+Revision 1.156 2002/07/19 14:03:49 set
+* Fixed: Unconditional MP3 code pull in editmain.cc.
+
+Revision 1.155 2002/07/17 17:27:32 set
+* Fixed: [MSVC] The following sequence: type */* comment */ doesn't confuse
+gcc nor SETEdit, but makes MSC emit a warning. From output by WintiX.
+
+Revision 1.154 2002/07/16 19:40:09 set
+* Fixed: [MSVC] 3 more errors sent by WintiX (ceditor.cc).
+
+Revision 1.153 2002/07/16 19:31:18 set
+* Modified: MP3 dialog buttons to behave better after a recode.
+* Added: TSButtonRef wrapper for TButtonRef.
+* Added: First step to adapt the code to the new recoding scheme using a
+callback.
+* Added: Code to the new Encodings dialog, now works but only if no fonts
+are loaded.
+
+Revision 1.152 2002/07/16 13:19:28 set
+* Added: The first part of the new encodings settings stuff. This is
+complex and implies important changes.
+
+Revision 1.151 2002/07/15 18:13:52 set
+* Added: AA-lib support for UNIX targets. Also ported the Plasma effect and
+made it support any resolution.
+
+Revision 1.150 2002/07/12 16:48:42 set
+* Modified: [MSVC] avoided the inclusion of bzlib.h from ceditor.cc because
+it includes windows.h and this hence collides. Also removed _WIN32 from
+bzlib compilation, it doesn't have any sense for static link. Problem
+found from cl preprocessor output sent by WintiX.
+
+Revision 1.149 2002/07/11 19:14:00 set
+* Fixed: [MSVC] Small details to get it compiled. Most of them just
+involves proper use of compatlayer. From output sent by WintiX.
+
+Revision 1.148 2002/07/10 19:22:09 set
+* Modified: Temporally disabled font support because it isn't compatible
+with last TV changes.
+
+Revision 1.147 2002/07/08 15:43:31 set
+* Fixed: [MSVC] Small details to get it compiled. Most of them just
+involves proper use of compatlayer. From output sent by WintiX.
+
+Revision 1.146 2002/07/08 14:30:52 set
+* Fixed: One preprocessor combination that fooled the functions parser.
+Reported by David A. Capello <dacap@users.sourceforge.net>.
+
+Revision 1.145 2002/07/05 20:29:40 set
+* Fixed: [MSVC] small makefile details from WintiX.
+
+Revision 1.144 2002/07/05 12:49:54 set
+* Fixed: [MSVC] libpcre should be linked statically, added -DSTATIC. From
+warning sent by WintiX.
+* Fixed: [MSVC] minor details in makefiles. Suggested by WintiX.
+
+Revision 1.143 2002/07/04 19:30:45 set
+* Fixed: [MSVC] warnings from nmake in libz/Makefile.nmk. Patch from
+WintiX, he successfuly used it to create libz.lib.
+* Added: [MSVC] libbzip2 and libpcre makefiles.
+
+Revision 1.142 2002/07/03 18:27:49 set
+* Added: First versions of MSVC makefile and libz makefile.
+
+Revision 1.141 2002/07/02 20:50:00 set
+* Added: Mouse Wheel support. Currently works with X11 driver.
+
+Revision 1.140 2002/07/02 18:09:39 set
+* Added: [UNIX] Xmu to the X11 libs. It isn't needed for dynamic linking.
+
+Revision 1.139 2002/07/01 13:31:09 set
+* Fixed: One spanish translation pointed out by Ivan.
+
+Revision 1.138 2002/07/01 13:12:21 set
+* Fixed: Crash in InfView when no desktop file was available.
+
+Revision 1.137 2002/07/01 13:10:53 set
+* Fixed: A read out of bounds in the InfView draw routine. Detected by
+efence (of by 1).
+
+Revision 1.136 2002/07/01 13:09:50 set
+* Added: Support for the new TVOSClipboard I added to Turbo Vision 2.0
+replacing the old extra/winoldap.cc code.
+* Added: Support for a secondary OS clipboard used to copy/paste
+selections. That's for the X11 XA_PRIMARY selection mechanism. Now every
+time text is selected in the editor this is "copied" to X11 clipboard. The
+middle mouse button does the paste.
+
+Revision 1.135 2002/06/28 12:37:20 set
+* Fixed: A read out of bounds in the input line of the calculator. I must
+check it better because I think that's a bug in Turbo Vision. It isn't
+really important but isn't correct and efence SIGSEGVs.
+
+Revision 1.134 2002/06/28 12:36:29 set
+* Modified: The editor now checks if the screen saver is suitable for the
+current driver.
+
+Revision 1.133 2002/06/27 18:08:58 set
+* Fixed: Another use of a class after releasing the memory. Reported by
+efence.
+
+Revision 1.132 2002/06/25 15:40:38 set
+* Added: Syntax highlight for the Turbo Vision configuration files.
+
+Revision 1.131 2002/06/24 19:48:28 set
+* Added: PHP syntax highlight, contributed by "Richard Vrijhof"
+<R.J.Vrijhof@bigfoot.com>.
+
+Revision 1.130 2002/06/24 16:03:27 set
+* Fixed: [BC++] The sutil difference between struct Name and a typedef for
+it under C++. GCC treats both same way, but BC++ don't.
+
+Revision 1.129 2002/06/24 16:02:14 set
+* Fixed: Patchen.pl script.
+
+Revision 1.128 2002/06/24 16:01:29 set
+* Fixed: mp3play.h should be included only for the editor and not InfView
+in the codepage part.
+
+Revision 1.127 2002/06/20 20:11:05 set
+* Fixed: When starting the editor with a remmembered file that no longer
+exists located in a directory where we don't want backups the editor
+removed the dektop structure from the list and inmediatly used it. This
+wasn't detected until it happend with efence linked.
+
+Revision 1.126 2002/06/20 20:09:42 set
+* Modified: Now that TV can inform if the driver supports changing the
+shape of the cursor I use I/O indicator only if needed.
+
+Revision 1.125 2002/06/19 15:01:19 set
+* Fixed: The Desktop background recoding, it changed in new TV. Also added
+recode to the MP3 and calendar.
+
+Revision 1.124 2002/06/19 15:00:19 set
+* Modified: The applycvs.pl tool to support new files, needs some adjusts
+but can be used.
+
+Revision 1.123 2002/06/19 14:59:24 set
+* Added: Euro symbol to the fonts. I put the same drawing for all, this
+should be fixed, but that's better than nothing.
+
+Revision 1.122 2002/06/18 16:30:35 set
+* Added: Support for QNX to the configuration mechanism. Patches by Mike
+Gorchak <mike@malva.ua>.
+
+Revision 1.121 2002/06/18 15:08:19 set
+* Fixed: The config.pl failed to detect intl support becasue TV include
+was absent. Introduced in last changes. Reported by Ivan.
+
+Revision 1.120 2002/06/18 15:06:41 set
+* Added: Tasm 2.02 errors parser. Contributed by Alex Lozano.
+
+Revision 1.119 2002/06/11 19:07:51 set
+* Fixed: codepage code to support changes in TV 2.0.
+
+Revision 1.118 2002/06/10 13:12:16 set
+* Updated: README to clarify a little bit the available Win32 options. I
+tested MinGW+MSys+SiePerl as suggested by Thiago.
+* Fixed: When no intl lib is available we must try using tvfintl (provided
+by TV lib).
+* Fixed: Targets where the prefix have back-slashes. The prefix is used in
+the code and must contain escaped back-slashes.
+* Added: palconv.h and palfte.h to the distribution.
+* Fixed: patchenv.pl now is more cleaver and solves problems introduced in
+last RHIDE versions. I tried gprexp as Robert suggested but it make things
+even worst.
+* Fixed: PCRE for Win32 targets defaults to a DLL, avoided in editmain.cc.
+
+Revision 1.117 2002/06/10 13:11:19 set
+* Modified: When the editor fails to load a desktop file (wrong version,
+corrupted file, wrong access rights, ect.) the editor tries to load the
+global desktop file.
+
+Revision 1.116 2002/06/10 13:09:45 set
+* Fixed: When browsing the list of errors and selecting an error reported
+in a non-existant file the editor opened an empty buffer.
+
+Revision 1.115 2002/06/10 13:08:36 set
+* Added: Support for try/catch not in the body of a C++ function for the
+list of functions. It passes a couple of tests Andris sent me.
+* Fixed: C++ operators parsing in the list of functions.
+* Modified: Now if we find two identical functions (most probably only one
+is really used at compile time) both are listed in the list of functions.
+To differentiate the functions the starting line is added.
+* Fixed: A search in the list functions stack wasted extra stack space.
+
+Revision 1.114 2002/06/10 13:07:28 set
+* Added: A script to apply the synmail patches to my CVS copy at home.
+
+Revision 1.113 2002/06/07 19:03:34 set
+* Modified: [UNIX] the configuration to test if the X11 include directory
+is really needed. It looks like gcc 3.1 gives a warning if this is manually
+specified. Is a test because I don't have gcc 3.1 for Linux. Reported by
+Andris.
+
+Revision 1.112 2002/06/07 02:18:36 terrible
+* Updated: Debian packaging with small changes.
+
+Revision 1.111 2002/06/06 19:41:12 set
+* Added: [DOS] An entry to the FAQ about problems with the mouse while
+using NT, W2k, XP, and similar crap. From a post to RHIDE list posted by
+James Doyle and Tom Verhoeff.
+
+Revision 1.110 2002/06/04 19:42:57 set
+* Modified: Now the configuration determines the directories where extra
+libraries could be located and adds it to the list of directories.
+
+Revision 1.109 2002/06/04 15:36:48 set
+* Modified: To use the moved TView::specialChars (TV 2.0).
+
+Revision 1.108 2002/06/04 13:26:30 set
+* Modified: I dropped the code that workarounds all bugs in libstdc++. I
+think it was in gcc 2.7.x or perhaps 2.6.3. The code still there but just
+disabled. This will allow working with the new gcc 3.1 that drops any
+kind of C++ connected to a C stream/file handle.
+.
+Revision 1.107 2002/06/03 13:53:02 set
+* Fixed: [DOS] TViewPlus to compile with TV 2.0.
+
+Revision 1.106 2002/06/03 13:52:00 set
+* Fixed: The shipped gettext is only usable for djgpp. Looks like MinGW
+target tried to use it with logical fails. Reported by Thiago.
+
+Revision 1.105 2002/06/03 13:50:54 set
+* Added: [Win32] According to Thiago newer versions of MinGW have their own
+uname command that reports MINGW32_<windows flavor>. Added to the
+conflib.pl.
+
+Revision 1.104 2002/05/30 17:30:05 set
+* Added: Support for the TV 2.0 palette handling. Seems to work for Linux
+console.
+
+Revision 1.103 2002/05/27 19:58:17 set
+* Modified: [Solaris] Removed debug printfs in audio code.
+* Modified: [Linux] Added some code that should avoid big endian issues
+with the sample format, Martijn van Buul, needs testing.
+
+Revision 1.102 2002/05/27 19:36:23 set
+* Fixed: [Solaris] the audio problems, now we can play MP3!! The big endian
+issue was solved with the help of Martijn van Buul <pino@dohd.org> (PowerPC
+user of a library derived from splay) and Mikael Hedin <mikael.hedin@irf.se>
+currently maintainer of splay. I also fixed some stuff in the Solaris
+audio code, now seems to work quite nice.
+
+Revision 1.101 2002/05/20 18:08:31 set
+* Fixed: References to SendToTerminal, no longer used in TV 2.0.
+
+Revision 1.100 2002/05/20 17:59:44 set
+* Fixed: Removed linuxRH52 references no longer used by TV 2.0.
+
+Revision 1.99 2002/05/20 16:52:07 set
+* Added: Now InfView sets the window title. Suggested by Ivan.
+
+Revision 1.98 2002/05/17 15:33:04 set
+* Added: "Vertical project window" options, SF FR #553029. Saved to the
+desktop file, documented, updated spanish translations.
+* Changed: version to 0.4.57.
+
+Revision 1.97 2002/05/17 14:29:56 set
+* Added: The first part of Grzegorz request about adding options to create
+message and project windows in the vertical direction.
+
+Revision 1.96 2002/05/17 14:27:24 set
+* Fixed: The show match pair on the fly without waiting had another
+interaction with the syntax highlight computation (I already fixed one).
+
+Revision 1.95 2002/05/16 21:24:21 set
+* Fixed: TV link in copyrigh.
+
+Revision 1.94 2002/05/16 21:23:44 set
+* Modified: When the editor generates code for a recorded macro it now uses
+\t instead of an ASCII 9 embedded in the string. Suggested by Thiago.
+
+Revision 1.93 2002/05/15 19:05:39 set
+* Fixed: Default CFLAGS for FreeBSD used -L/usr/local/include. Reported by
+miniEleph (Andrew 'Onyx' Shevtsov).
+
+Revision 1.92 2002/05/14 14:40:12 set
+* Added: Now mpegsound library should detect SPARC as big endian. I don't
+know if it will be enough to get it working for Suns.
+
+Revision 1.91 2002/05/13 18:33:44 set
+* Modified: [UNIX] tar detection according to miniEleph info and separated
+tar from gzip calls. Is easier to find tar + gzip than GNU tar (-z option)
++ gzip.
+
+Revision 1.90 2002/05/13 15:59:49 set
+* Fixed: Endian issues related to drawLines when filling the empty lines
+at the end of files. Tested in an Ultra SPARC 60 thanks to Alex.
+
+Revision 1.89 2002/05/13 13:45:48 set
+* Fixed: When I switched to unique_name the code that converts UNIX->DOS
+and DOS->UNIX left the temporal. Now fixed.
+
+Revision 1.88 2002/05/13 12:50:21 set
+* Test: for big endian issue.
+
+Revision 1.87 2002/05/13 12:41:04 set
+* Modified: [UNIX] Now the FHS detection is more strict, the existance of
+share/doc is not enough, share/man and shared/info must exist.
+* Fixed: [UNIX] The FHS detection looks in $prefix and not in /usr.
+* Added: [FreeBSD] According to miniEleph in this case /share/doc is used
+but not shared/info nor shared/man.
+
+Revision 1.86 2002/05/13 12:36:53 set
+* Modified: [UNIX] Now the INSTALL.LINUX script is just called INSTALL.
+The script will work for FreeBSD and Solaris and is stupid to ask a BSD
+user to run "INSTALL.LINUX" ;-)
+
+Revision 1.85 2002/05/13 12:32:51 set
+* Fixed: Currently gettext is preconfigured only for djgpp so we should
+copy the djgpp.h to config.h header anyways.
+* Fixed: confignt.pl used winnt directory instead of WinNT.
+* Modified: Now the INSTALL.MAK file is configured to reflect the
+configured prefix (it was failing) and to support Solaris install tool.
+
+Revision 1.84 2002/05/13 12:30:28 set
+* Modified: Commented what parts of the Rawplayer class is really needed by
+the editor and what sizes are used (bytes, not samples). I also modified
+Solaris code to implement things this way.
+
+Revision 1.83 2002/05/08 13:48:54 set
+* Added: A new color scheme contributed by Thiago. It is dark (console
+style) plus some VIM like SHL.
+
+Revision 1.82 2002/05/07 12:54:46 set
+* Fixed: palfte.h didn't end with \n and failed for gcc 3.x. Patch by
+Andris.
+
+Revision 1.81 2002/05/06 15:13:46 set
+* Added: [FreeBSD] Support for libintl. Changes suggested by miniEleph
+<nyxo@dnuc.polyn.kiae.su>.
+
+Revision 1.80 2002/05/06 14:52:08 set.
+* Added: X11R6 include directory to the configuration script. It looks like
+this directory isn't automagically included in FreeBSD. Also added options
+to configure it -x-include and -x-lib. Reported by miniEleph
+<nyxo@dnuc.polyn.kiae.su>.
+
+Revision 1.79 2002/05/02 19:35:38 set
+* Modified: The use of tmpnam, now I use unique_name, based on mkstemp. It
+seems to be more secure.
+
+Revision 1.78 2002/05/02 19:34:13 set
+* Added: Support for Electric Fence to the configuration script.
+
+Revision 1.77 2002/05/02 19:33:22 set
+* Added: libdl detection to config.pl. Looks like some new library
+combinations (XFree86 4.2.0 + glibc 2.2.5) needs it. Time will say if this
+should be more optional. From problems reported by Andris to create a
+static editor with X11 support.
+
+Revision 1.76 2002/04/30 19:40:13 set
+* Fixed: InfView to compile with TV 2.0. As Andris tried to test it and
+couldn't I though it was time to fix the problems ;-)
+
+Revision 1.75 2002/04/30 18:08:57 set
+* Added: Ctrl+Arrows support to InfView. Suggested by Thiago (I think other
+people asked for it, Ivan?).
+
+Revision 1.74 2002/04/30 18:00:55 set
+* Added: An option to save a desktop file in the current directory. Useful
+for users that use a central desktop and don't want to create a project.
+
+Revision 1.73 2002/04/30 17:56:12 set
+* Modified: Now ~/setedit/.tcedit.dst have more priority than ~/tcedit.dst.
+
+Revision 1.72 2002/04/29 15:07:15 set
+* Fixed: A rare crash in InfView. Reported by Andris.
+
+Revision 1.71 2002/04/29 15:06:01 set
+* Added: Syntax highlight for "Flat Assembler", contributed by "Matt C."
+<talktomatt@egl.net>
+
+Revision 1.70 2002/04/29 15:05:13 set
+* Added: Example on how to bind a key to a filter, contributed by Grzegorz.
+
+Revision 1.69 2002/04/29 15:02:11 set
+* Added: An option to select a "Color Theme", currently only the "Default"
+and "FTE like" themes are available. Suggested by Ivan (he contributed the
+FTE Like theme).
+
+Revision 1.68 2002/04/29 15:00:10 set
+* Fixed: [Linux] Now ask_config is executed only once.
+
+Revision 1.67 2002/04/29 14:58:24 set
+* Fixed: roll-back of a FreeBSD patch that makes Linux use -lintl, this is
+not the way.
+* Fixed: Now ask_config.sh is copied to the editor's distribution.
+
+Revision 1.66 2002/04/22 19:00:05 set
+* Modified: Some details to cleanly compile under FreeBSD. Some details
+still need a solution. Some things changed: use of gmake instead of make,
+use of time in favor of ftime, support for BSD find, use of intl lib,
+default prefix, etc. From patches by miniEleph <nyxo@dnuc.polyn.kiae.su>
+
+Revision 1.570 2002/04/21 14:57:19 set
+* Fixed: Wrong separator detection in tools/cvssget.
+
+Revision 1.569 2002/04/21 14:37:42 set
+* Fixed: Some code that compiled only for TV 2.0.
+
+Revision 1.65 2002/04/15 13:57:48 set
+* Fixed: More potential buffer overflows because of the use of L_tmpnam.
+Patches suggested by Andris.
+
+Revision 1.64 2002/04/08 14:11:53 set
+* Fixed: Buffer overflow in temporary names created by infview. Patch by
+Andris.
+
+Revision 1.63 2002/03/26 13:40:55 set
+* Fixed: use of popen(...,"rt") that fails for glibc 2.2.5. Patch by Andris.
+
+Revision 1.62 2002/02/22 12:27:51 set
+
+Revision 1.568 2002/02/21 23:47:38 set
+* Added: Support for TV 2.0.0, lamentably it doesn't work reliably (no
+target is working ok).
+
+Revision 1.61 2002/02/20 19:56:44 set
+Revision 1.567 2002/02/20 01:13:21 set
+* Fixed?: A potential source of reported SIGSEGVs in Tool&Ops|Options|Run
+program. If no desktop is loaded is possible to have CurrentParser==0 and
+it generates a GPF. Could fix a report by David Z Kil
+<zosodk69@fuckmicrosoft.com>.
+
+Revision 1.566 2002/02/20 01:55:39 set
+Revision 1.59 2002/02/15 18:19:46 set
+* Fixed: Missing functions in rhideint.cc and unused variable in dstfile.cc.
+Patch by Andris needed to compile last CVS of RHIDE.
+
+Revision 1.565 2002/02/20 01:52:15 set
+Revision 1.58 SF 2002/02/08 00:33:59 terrible
+* Modified: made distrib/ask_config.sh Unix bourne shell script based on
+distrib/ask_config.pl Perl script as Salvador wanted and removed the Perl
+script. I will reindent it if Salvador likes.
+
+Revision 1.564 2002/02/20 01:46:24 set
+Revision 1.57 SF 2002/02/06 20:08:09 set
+* Added: Configuration questions to the DOS installer. Closes SF FR #510516.
+* Modified: Now the options are stored in install.log (already used by the
+DOS installer to store installation data).
+* Updated: Spanish translation and german file.
+
+Revision 1.563 2002/02/20 01:40:15 set
+Revision 1.56 SF 2002/02/06 15:49:25 set
+* Added: Now if no desktop file can be found the editor looks for a plain
+text file containing some options to configure: 1) Creation of one central
+desktop or one each dir, 2) Use of tabs or spaces for indentation and 3)
+Backup files creation. Currently this file is created by a simple perl
+script called by INSTALL.LINUX but I'll incorporate it to DOS/Win32
+installer and maybe Ivan will add it to the .deb options. Suggested by Ivan
+
+Revision 1.562 2002/02/20 01:34:47 set
+Revision 1.55 SF 2002/02/06 14:54:05 set
+* Fixed: The code to use last patched TV 1.1.4 that solves gcc 3.x issues.
+
+Revision 1.561 2002/02/20 01:26:54 set
+Revision 1.54 SF 2002/02/05 14:16:16 set
+* Added: Now when the editor warms about a R.O. file the dialog says the
+name of the file.
+
+Revision 1.560 2002/02/20 01:24:37 set
+Revision 1.53 SF 2002/02/05 13:56:13 set
+* Added: Explanation about the difference between lat1 and lat1u fonts,
+also about the damaged lat1 fonts to Linux FAQ.
+
+Revision 1.559 2002/02/04 23:58:22 set
+Revision 1.52 SF 2002/02/04 20:38:41 set
+* Added: A clipboard mechanism based on a special file. This is specially
+useful for Linux where no clipboard can share data between X and the
+console. Suggested by Grzegorz. SF FR #479359.
+* Added: Documentation and entry menues for it, also grayed the copy when
+nothing is available for copying.
+* Fixed: The regular copy command (and others) wasn't grayed when a
+selection existed but was hidded.
+
+Revision 1.558 2002/02/04 23:54:20 set
+Revision 1.51 SF 2002/02/04 19:29:13 set
+* Added: Explanation about tabs settings in DOS and Linux FAQs, also to the
+documentation. Triggered by a question of Ivan and chris <sscanf@gmx.net>.
+
+Revision 1.557 2002/02/04 23:52:07 set
+Revision 1.50 SF 2002/02/04 19:08:33 set
+* Added: Now when the user sets the "Use Tabs" option the editor checks if
+other options commonly used with tabs are also coherent. If not an advice
+dialog is created. Suggeste by Ivan. SF FR # 510514.
+
+Revision 1.556 2002/02/04 23:45:18 set
+Revision 1.49 SF 2002/02/04 15:32:08 set
+* Fixed: ncurses 5.2 collision in intgrep.cc. Patch by Andris.
+
+Revision 1.555 2002/02/04 23:43:26 set
+Revision 1.48 SF 2002/02/04 15:23:29 set
+* Fixed: The use of tmpnam and mktemp is currently deprecated so I changed
+it to use mkstemp. Pointed out by Andris (last Linux tools reports it).
+
+Revision 1.554 2002/02/04 23:39:11 set
+Revision 1.47 SF 2002/02/04 14:16:54 set
+* Fixed: compilation problems with gcc 3.0.x in mixoss.c. Patch by Andris.
+
+Revision 1.553 2002/02/04 23:35:58 set
+Revision 1.46 SF 2002/02/01 19:04:25 set
+* Added: Options to avoid reseting the horizontal position of the message
+window when new entries are added. Suggested by David A. Capello
+<dacap@users.sourceforge.net>. SF FR # 513607.
+* Changed to v0.4.55 to store new settings.
+
+Revision 1.552 2002/02/04 23:30:54 set
+Revision 1.45 SF 2002/02/01 15:26:51 set
+* Added: Lua syntax highlight. Contributed by David A. Capello
+<dacap@users.sourceforge.net>.
+
+Revision 1.551 2002/02/04 23:24:45 set
+------------------------------------------------------------------------------
+v0.4.54 1st stable release after 0.4.41
+* Synchronized home with v0.4.54 release.
+
+Revision 1.550 2002/02/04 23:15:54 set
+Revision 1.44 SF 2002/01/29 18:05:29 set
+* Updated: Man page version and ~/* paths (now ~/.setedit/*).
+
+Revision 1.549 2002/02/04 23:15:37 set
+Revision 1.43 SF 2002/01/29 17:53:33 set
+* Updated: Documentation version.
+
+Revision 1.548 2002/02/04 23:15:20 set
+Revision 1.42 SF 2002/01/29 17:50:03 set
+* Fixed: Now the distrib-* targets depends on needed. It allows to use "make
+distrib" even without doing make first.
+
+Revision 1.547 2002/02/04 23:14:52 set
+Revision 1.41 SF 2002/01/29 17:46:40 set
+* Modified: The compression scripts to generate more descriptive name for
+the debug files.
+
+Revision 1.546 2002/02/04 23:14:29 set
+Revision 1.40 SF 2002/01/29 17:42:43 set
+* Modified: Included libamp in Linux sources distro again.
+
+Revision 1.545 2002/02/04 23:14:05 set
+Revision 1.39 SF 2002/01/29 17:39:08 set
+* Fixed: asm51.pmc and html.frt wasn't marked as files that must be
+converted to native EOL by fromdos/unix scripts.
+
+Revision 1.544 2002/02/04 23:13:45 set
+Revision 1.38 SF 2002/01/29 04:38:07 terrible
+* Updated: Debian packaging to the "Brothers of Argentina have problems, I
+ hope they can get through it soon!" release version 0.4.54-1.
+
+Revision 1.543 2002/02/04 23:13:14 set
+Revision 1.37 SF 2002/01/28 15:40:39 set
+* Synchronized with home CVS.
+* Added: rel and rev keywords to HTML, suggested by Ivan.
+
+Revision 1.542 2002/01/27 21:36:49 set
+* Changed to version 0.4.54 for a new release.
+
+Revision 1.541 2002/01/27 16:55:11 set
+* Modified: debian/rules to avoid deleting doc/Makefile and
+internac/Makefile.
+
+Revision 1.540 2002/01/27 16:37:55 set
+* Added: Protection to avoid starting the screen saver if currently the TV
+library says the size of the screen is 0. It looks like Win32 code
+currently can do it if the window isn't visible. This check isn't a
+solution but avoids "div. by 0" problems. Reported by <James_Wilson@i2.com>
+
+Revision 1.539 2002/01/27 16:36:11 set
+* Added: A FAQ comment and warnings in the readme about the fact that Windows
+NT (4.0, 2k, XP, etc.) is case sensitive when looking for environment
+variables. Jim <James_Wilson@i2.com> had problems and all was because he used
+Set_Files=....
+
+Revision 1.538 2002/01/27 16:22:01 set
+* Modified: Test for djgpp/Cygwin fileutils to use cp instead of rm, it seems
+to be more reliable (optimized by djgpp's libc?). Patch by Alex Lozano.
+
+Revision 1.537 2002/01/27 16:19:23 set
+* Fixed: Allegro 4.0 moved the datafile_type definition to a same header but
+another directory and added an underscore. Patch by Andris.
+
+Revision 1.536 2002/01/27 15:43:59 set
+* Fixed: pathtool "defined but not used" warning when compiling libset.a for
+RHIDE. Patch by Andris.
+* Fixed: rhideint lack of tv.h. Patch by Andris.
+
+Revision 1.535 2002/01/27 15:36:10 set
+* Modified: Now Allegro 4.0 is released and supported for audio stuff. The
+configuration script now accepts it. Reported by Andris.
+
+Revision 1.534 2002/01/08 02:25:18 set
+* Fixed: The mpegsound library failed to load the ID3 data (my fault).
+Reported by Alex Lozano <alex@inti.gov.ar>.
+
+Revision 1.36 SF 2002/01/09 03:42:23 terrible
+* Updated: Debian packaging to the "Ivan hates computers after having good
+ vacations" release version 0.4.53-1.
+
+Revision 1.35 SF 2002/01/04 14:54:01 set
+* Synchronized with home CVS.
+
+Revision 1.533 2002/01/02 01:09:57 set
+* Fixed: Missing TV for Linux and Win32 targets in config.pl.
+* Modified: Some headers to use Uses_* intead of including other headers.
+That's needed because a bug in glibc that enforces the declaration of
+_GNU_SOURCE before any standard header is included so compatlayer *must*
+include the standard headers.
+* Fixed: Need of ./ in internac makefile.
+
+Revision 1.532 2002/01/02 00:46:35 set
+* Modified: Moved getline replacement to TV compatlayer.
+* Modified: Wow! we are in 2002, so I changed some dates to reflect it.
+
+Revision 1.531 2002/01/02 00:08:03 set
+* Modified: version to 0.4.53 for a new release.
+
+Revision 1.530 2002/01/02 00:02:09 set
+* Modified: At least in my Win98 SE box some calls to internac/fix.pl just
+reboots my system. I guess that's just some memory corruption on the Perl
+interpreter triggered by one of the regular expressions. I changed it by a
+small C program.
+* Fixed: Lack of locale.h inclusion in infmain.cc hidded by the inclusion of
+libintl.h.
+* Fixed: Another /n missing at the end of a file reported by gcc 3.1.
+
+Revision 1.529 2001/12/31 22:02:19 set
+* Fixed: A couple of printf format missmatches that gcc started to report
+after some changes in TV (don't ask me why).
+
+Revision 1.528 2001/12/31 00:13:37 set
+* Modified: Moved rhtv and z libraries to .env/configuration.
+* Fixed: pcre library was mandatory.
+* Added: MSS 1.2.1 support --with-mss configuration option.
+* Modified: configuration batch files to support long command lines.
+* Fixed: A doubly defined vpath keyword in syntaxhl.shl (MSS reported).
+* Added: Some routines to free memory at exit, they help to reduce the
+ammount of problems reported by memory debuggers.
+* Fixed: A lot of new/new[]/malloc/delete/delete[]/free missmatches reported
+by MSS.
+
+Revision 1.527 2001/12/30 15:55:25 set
+* Added: A pmc file fox x51 assembler and updated the syntax highlight for
+it. Contributed by Alex Lozano <alex@inti.gov.ar>
+
+Revision 1.526 2001/12/17 00:08:16 set
+* Fixed: SDG determined the line number of a function using an old methode,
+now modified to work in machines where data must be aligned. Reported by
+Grzegorz.
+
+Revision 1.525 2001/12/17 00:04:05 set
+* Fixed: Thiago's example that used underscores at the beggining of defines
+(reserved for compiler/libc).
+
+Revision 1.524 2001/12/16 23:42:44 set
+* Updated: Some dates in the copyrigh file.
+* Fixed: The section 9 of readme.1st to be more clear.
+
+Revision 1.523 2001/12/16 23:28:55 set
+* Fixed: Even when specifying not to save the sound mixer settings the
+editor initialized the sound system during start-up. As a result Windows
+reserved the sound board for the editor blocking the access to other
+applications. Reported by David J. Hughes <David.J.Hughes@nokia.com>.
+* Updated: Distrib files (new sLisp commands).
+
+Revision 1.522 2001/12/13 03:24:46 set
+* Added: Documentation for the new sLisp commands. Also added to the syntax
+highlight.
+
+Revision 1.521 2001/12/11 02:45:17 set
+* Added: New example (IndentLineOrBlock) and extended the copy line
+(DuplicateLineOrSelection). Contributed by Thiago.
+
+Revision 1.520 2001/12/11 02:42:50 set
+* Added: TMLIEditor::SelectionExists() to help a new command from Thiago
+(he suggested a concept for it).
+* Added: tostr and SelectionExists, contributed by Thiago.
+
+Revision 1.519 2001/12/11 02:34:15 set
+* Added and fixed some details in Thiago's macros. Patches by Thiago.
+
+Revision 1.518 2001/12/11 00:22:11 set
+Revision 1.32 SF 2001/12/04 14:35:12 set
+* Fixed: Applied patch from Robert for missing includes in the RHIDE interface
+module.
+
+Revision 1.517 2001/12/11 00:19:55 set
+* Fixed: The new ShowInMessageWindow function didn't return a value
+returning a command. Detected by a report from Thiago.
+* Fixed: It was possible to crash the editor writing a recursive sLisp
+macro. Now the recursion is limited. Reported by Thiago.
+
+Revision 1.516 2001/12/11 00:18:33 set
+* Added: More examples from Thiago (EvalSelection_Print,
+EvalSelection_StatusLine and EvalSelection_MessageWindow).
+
+Revision 1.515 2001/12/11 00:14:39 set
+* Fixed: When using "generate code" for a macro while editing a line the
+editor forgot to flush the line. It generated a SIGSEGV when it happend at
+the end of file. Reported by Thiago.
+
+Revision 1.514 2001/12/11 00:05:26 set
+Revision 1.33 SF 2001/12/04 15:15:17 set
+* Modified: The macros.slp file, I commented Lemur macros until a copy is
+available for the public. I also added some macros contributed by Thiago.
+They are good examples but most of them are commented because they eat
+memory and aren't 100% generic.
+
+Revision 1.31 SF 2001/12/04 13:57:13 set
+* Synchronized with my personal CVS.
+
+Revision 1.30 SF 2001/12/04 05:54:16 terrible
+* Updated: Debian packaging to 0.4.52-2, no changes, just new debs.
+
+Revision 1.513 2001/12/04 03:12:56 set
+* Added: A new sLisp command ShowInMessageWindow to print information in
+the message window. Suggested by Thiago.
+
+Revision 1.512 2001/12/04 02:28:14 set
+* Added: A new sLisp command contributed by Thiago: EvalString, it
+evaluates a string as sLisp code.
+* Fixed: Evaluate selected sLisp code didn't flush the line in edition.
+* Fixed: The sLisp interpreter didn't release the objects in the sLisp
+stack when an error ocurred. It generated memory leaks. It was this way
+because in this way was easier to report the exact point of the error
+without risking to use memory that we freed. It changed the strategy and I
+think this code must be tested and perhaps a branch will be needed if we'll
+release a 0.4.52 again.
+To achieve it now the code snapshot is taked just when the error appears.
+* Fixed: Some GetXXXX sLisp variable macros tried to use the returned
+object even if it was NULL generating SIGSEGVs.
+* Note: Most of this was triggered by a report by Thiago about problems to
+implement the new command.
+
+Revision 1.511 2001/12/03 23:55:52 set
+* Fixed: The ^Z key had a collision in the "redmond.smn" file. It was
+assigned to undo and scroll up confusing users. Now this key is assigned
+only by the menu and the redmond.smn doesn't have a short-cut for scroll
+up. Reported by David J. Hughes <David.J.Hughes@nokia.com>.
+* Added: Some notes about errors in xterm description shipped with Mandrake
+8.1 to Linux FAQ. From a report by ZhiJie <zhi4jie2@yahoo.com>.
+
+Revision 1.29 SF 2001/11/29 17:59:50 set
+* Synchronized with my personal CVS.
+
+Revision 1.510 2001/11/29 00:10:33 set
+* Fixed: The DOS' SET_FILES autodetection mechanism was failing. Reported
+by David J. Hughes <David.J.Hughes@nokia.com>.
+
+Revision 1.509 2001/11/28 23:49:06 set
+* Fixed: Some small details in the editor.tx file that made TeX fail to
+generate the documentation (also some box overflows).
+
+Revision 1.508 2001/11/28 23:24:17 set
+* Fixed: getline replacement details. (#ifdef 0 and lack of (char *) cast).
+* Fixed: Use of strerror for Solaris. Another candidate for compatlayer. It
+exists on Linux too.
+* Fixed: _S macro in pal.h (collides on Solaris). Never use _* ...
+* Fixed: Missing getopt in Solaris (must go to compatlayer).
+
+Revision 1.28 SF 2001/11/28 13:56:30 set
+* Synchronized with my personal CVS.
+
+Revision 1.507 2001/11/28 00:40:45 set
+* Added: Now is possible to execute a selected sLisp code even if it have
+spaces at the beggining. Patch by Thiago.
+* Added: When running a selected sLisp code the result is shown in the
+message window, like when running sLisp code entered in the dialog. Patch
+by Thiago.
+
+Revision 1.506 2001/11/28 00:28:30 set
+* Fixed: The editor didn't flush the line under edition before calling a
+sLisp macro. Reported by Grzegorz.
+* Fixed: Some old kibind.dat files could have commands with garbage in the
+upper 16 bits, it produce problems to show the name of this commands. Now
+the editor limits the values to 16 bits before trying to find the name.
+Reported by Thiago.
+
+Revision 1.505 2001/11/28 00:08:29 set
+* Modified: The sLisp 'Test RunProgram Filter' example to avoid running or
+pasting empty strings.
+* Fixed: sLisp if statement, it evaluated more than once the things. It was
+a side effect of a macro. Reported by Grzegorz.
+* Fixed: It wasn't possible to use ' and " in sLisp commands, was
+interpreted as a string start.
+* Fixed: It wasn't possible to put a comment just after a number in sLisp.
+* Fixed: When calling RunProgram* sLisp command passing an empty string as
+command to execute it was telling something about configuring it in the
+options menu. Reported by Grzegorz.
+* Fixed: In case of errors if a MLIRetObj was involved the editor generated
+a SIGSEGV.
+
+Revision 1.27 2001/11/27 13:00:25 set
+* Applied: Patch 485876: Tiny Info documentation changes for Debian by
+"terrible" (Ivan). It modifies the declared name of .info docs to avoid
+problems with the install-info found in Sid.
+* Applied: Patch 485877: Changes to Debian packaging by "terrible" (Ivan)
+
+Revision 1.26 2001/11/26 15:16:55 set
+* Trying to switch to stable ;-)
+
+Revision 1.504 2001/11/25 20:09:35 set
+* Fixed: Some logic in the about box for the first run. Was changed
+recently.
+* Added: Information in the README about the fact that now I'm switching to
+RHIDE 1.4.9.
+
+Revision 1.503 2001/11/25 19:55:54 set
+* Changed version to 0.4.52, a new stable release is coming soon ;-)
+
+Revision 1.502 2001/11/25 19:49:18 set
+* Added: More complete dependency solve in mli.h and settvuti.h to help
+compile RHIDE. Patches by Andris.
+
+Revision 1.501 2001/11/25 19:02:20 set
+* Fixed: EdReloadIfOpened(char const *, stEditorId *) in rhideint.cc and
+added a couple of support functions (plus comments) to help incorporate the
+new features in RHIDE. Andris tried to do it and reported these problems.
+
+Revision 1.500 2001/11/24 15:17:35 set
+* Fixed: Stack overflow in the closed windows sort under some particular
+cases. Reported by Grzegorz.
+
+Revision 1.499 2001/11/24 15:14:07 set
+* Modified: When a command assigned to a key is out-of range the returned
+name is Unknown instead of a NULL pointer. Somehow Thiago got a corrupted
+keybind.dat and the previous behavior made the program crash.
+
+Revision 1.498 2001/11/24 15:02:22 set
+* Modified: Some inline members in filter.cc and filter2.cc (Mpegsound) to
+avoid compilation problems reported by Thiago. I don't see the need to
+inline these big routines. May be I'll revert it but right now is better to
+avoid problems.
+
+Revision 1.497 2001/11/24 14:53:49 set
+* Fixed: Lack of string.h in some files, Reported by Thiago from RedHat 7.1.
+
+Revision 1.25 2001/11/11 21:31:47 terrible
+* Hello, it's me! I am trying to sabotage Salvador's editor while him is on
+vacations!!!
+* Updated: Debian packaging to 0.4.51-4, no changes really.
+* Fixed: Salvador mistakenly deleted change.log entry 0.23, it isn't that
+important, but anyway I enjoy contaminating this change.log.
+
+Revision 1.496 2001/11/08 00:57:48 set
+* Added: An explanation on how to extend sLisp in the DOS and Linux FAQ
+files. It is an e-mail I sent to Thiago answering some questions he had
+when tried to code cond.
+
+Revision 1.495 2001/11/08 00:37:27 set
+* Added: A temporal replacement for getline to be used in UNIX systems that
+doesn't have it. It must go to compatlayer but TV is frozen right now.
+
+Revision 1.494 2001/11/08 00:25:57 set
+* Fixed: Spanish translation of "Macro|Run selected code" have repeated
+shortcut.
+
+Revision 1.493 2001/11/08 00:22:30 set
+* Added: cond to the documentation and syntaxhl.shl.
+* Added: The last new and fixed things to readme.
+
+Revision 1.492 2001/11/08 00:14:50 set
+* Fixed: Write block didn't check if the fopen succeed or not. I got a
+SIGSEGV in my Linux box when trying to overwrite a root's file ;-)
+
+Revision 1.491 2001/11/08 00:07:08 set
+* Added: sLisp command cond works like some kind of switch/case. Is similar
+to Clipper's do case. Contributed by Thiago.
+* Fixed: [sLisp] When returning a variable that belongs to the stack (not a
+fresh copy) I used the MLIRetObj, but it didn't mark the variable as
+"floating" and hence was released from the stack. The result was that when
+used it was already released containing garbage or the original value or
+invalid pointers (random). I was exposed only if the variable wasn't the
+return value of a expression. It made cond to fail.
+
+Revision 1.24 2001/11/07 13:08:02 set
+Synchronized S.F. with my home CVS.
+
+Revision 1.490 2001/11/07 00:22:36 set
+* Fixed: InfView crashed when loading desktops of older versions. Reported
+by Thiago.
+
+Revision 1.489 2001/11/07 00:10:49 set
+* Fixed: The indent uncomenting was taking an extra line. Reported by
+Thiago.
+* Fixed: The undo of the indent commenting let the rectangle selection
+visible.
+
+Revision 1.488 2001/11/06 01:17:37 set
+* Modified: Reverted to non-BIOS keyboard by default. The BIOS stuff discards
+very used combinations. I put it in the FAQ and also modified the readme.
+
+Revision 1.487 2001/11/06 01:04:10 set
+* Added: Mazovia code page. That's a polish code page based on PC437. It
+discards some accents that aren't used by polish and puts the needed chars
+there. Piotr <piotr@asco.biz.pl> asked for it and helped me to add it.
+
+Revision 1.23 2001/11/02 21:17:28 terrible
+* Updated: Debian packaging to 0.4.51-3.
+
+Revision 1.486 2001/10/31 03:03:07 set
+* Fixed: When the editor was configured to forget about opened windows when
+specifying new files in the command line the editor put the old files in
+the list of closed files allowing to recover them easilly and remmembering
+things like window position and size. But the editor failed to remmember
+the cursor position. Reported by Ivan.
+
+Revision 1.485 2001/10/31 01:57:14 set
+* Fixed: The new compression scheme by "terrible" didn't apply to
+distribution (only installation). Also fixed the indentation.
+
+Revision 1.484 2001/10/31 01:37:57 set
+* Synchronized home CVS with S.F.
+
+Revision 1.23 2001/11/02 21:17:28 terrible
+* Updated: Debian packaging to 0.4.51-3.
+
+Revision 1.22 2001/10/29 18:40:35 terrible
+* Modified: added a '--comp-exe' switch to the configure script to force all
+executables produced to be compressed with UPX, and now the default behaviour
+is like before the modifications for the '--no-comp-exe' switch, in Unix the
+editor is not compressed but infview is, the rationale is that it is more
+common to have various editor instances than infview ones, and on other
+architectures they are both compressed since there is not much performance
+loss.
+
+Revision 1.21 2001/10/29 14:40:18 set
+* Added: --no-intl configuration option. Patch sent by jimmy@ncp.infonet.bg.
+
+Revision 1.20 2001/10/29 14:15:25 set
+* Synchronized S.F. CVS with changes made at home.
+
+Revision 1.19 2001/10/28 19:48:44 terrible
+* Added: --no-comp-exe option to configure script, to avoid compressing the
+executables with UPX.
+* Modified: now default behaviour for all platforms is to compress
+executables with UPX, previously on Unix the editor executable was not
+compressed (only the infview was).
+* Updated: Debian packaging to 0.4.51-2.
+
+Revision 1.483 2001/10/27 19:51:12 set
+* Added: ESC close the Message Window. Suggested by Thiago.
+
+Revision 1.482 2001/10/27 19:41:56 set
+* Added: sLisp command progn, that's just an alias for eval. This is how
+regular Lisp calls it. Suggested by Thiago.
+* Added: The last changes to the readme.1st.
+* Added: progn to the shl.
+
+Revision 1.481 2001/10/27 19:25:26 set
+* Added: The "Macro|Enter code to execute" gets the "macro under cursor"
+to offer it as code to execute.
+* Added: When using it the returned value is displayed in the message
+window. Thiago suggested something like it.
+* Added: A ~ operator to sLisp, it replaces the old not that now have a
+more coherent meaning (is like ! in C). Thiago reported problems about it.
+Documented.
+* Added: Hexadecimal shl to sLisp shl because that's supported.
+* Fixed: Now is possible to enter a negative integer in sLisp.
+* Fixed: After running a macro if it generated an error posterior runs
+indicated the same error.
+
+Revision 1.480 2001/10/27 17:21:47 set
+* Fixed: The list of functions stores the name of the function and the line
+number to jump. As the length of the name is arbitrary the line number
+could be stored in memory missaligned. This is not a performance issue
+because the process itself is complex but in SPARC machines generates a
+SIGBUS.
+
+Revision 1.479 2001/10/27 17:16:35 set
+* Fixed: It looks like most systems include locale.h implicitly (with other
+headers) but not Solaris.
+
+Revision 1.478 2001/10/27 17:08:29 set
+* Fixed: InfView code assumed Linux is the only UNIX ;-). Seen on Solaris.
+
+Revision 1.477 2001/10/27 16:09:07 set
+* Added: An example on how to use an external filter with sLisp. The
+example is for formating e-mails and was contributed by Grzegorz. (is in
+the documentation).
+
+Revision 1.476 2001/10/27 15:11:10 set
+* Fixed: [Linux/PPC and SPARC] For some bizarre reason gcc 2.95.2 is
+generating references for the inline TCEditor::TurnOffHighLight() in all
+the files that includes the TCEditor definition. This tries to pull the
+ceditor.cc file where all data members are declared. This isn't a problem
+for the editor but for InfView. So now the codepage.cc file doesn't
+declare TCEditor if it isn't really needed (faster compilation ;-). I saw
+it only on big endian platforms.
+
+Revision 1.475 2001/10/27 15:03:50 set
+* Fixed: When trying to use AM/PM clock and the system had a locale that
+doesn't support it (i.e. LC_ALL=es) strftime doesn't put anything for the
+%p value. It made the buffer of the desktop clock to have 1 character less
+than expected and this character was random. I also enlarged the clock 1
+character to make AM and PM visible and not just A and P. Reported by Ivan.
+
+Revision 1.474 2001/10/25 00:29:41 set
+* Added: A user remind me that some special keyboard combinations (like
+Alt+arrow keys) aren't detected when we use BIOS to extract keystrokes from
+the queue. For this reason I explain it and how to revert to the old methode
+in the readme.1st and windos.faq.
+
+Revision 1.473 2001/10/23 01:15:38 set
+* Fixed: Debian package distributes readme.1st compressed so the editor
+failed to load it. Now the editor can also locate it. In the future I could
+also distribute the file compressed in the tarball.
+
+Revision 1.472 2001/10/23 00:38:28 set
+* Fixed: The search tables used in editorfo.cc were allocated in one memory
+chunk. This generates missaligment. This isn't critic in Intel platforms
+(unless the OS explicitly enables a processor flag), but generates a kernel
+warning log in Linux/PPC platforms and a SIGBUS in Linux/SPARC platforms.
+As I was modifying it I did some more changes to make the code a little bit
+compact.
+
+Revision 1.471 2001/10/22 23:45:25 set
+* Fixed: The KeyTNode structure had a union that contained a short and an
+int value. As C seems to promote integers to int type gcc was choosing the
+int member to store const unsigned short values (instead of the ushort
+version of the union and in a static initialization) as a result of it the
+value was wrongly stored in big endian platforms. Seen on PPC.
+
+Revision 1.470 2001/10/22 23:40:31 set
+* Fixed: The TInfViewer::draw() member uses a function called moveChar() it
+was filling the buffer with character/attribute in an endian dependent
+order. TV expects a fixed order no matters which endianess is used. Seen on
+a Power PC machine (IBM RS/6000 at Source Forge).
+
+Revision 1.469 2001/10/22 23:29:24 set
+* Synchronized with Source Forge CVS including new Debian files.
+
+Revision 1.18 2001/10/22 13:27:34 set
+* Synchronized with my repository.
+
+Revision 1.16 2001/10/22 04:29:07 terrible
+Modified: Updated Debian packaging to version 0.4.51-1.
+
+Revision 1.468 2001/10/20 16:45:08 set
+* Fixed: [Win32] I forgot to put CONFIG_PREFIX in the BC++ 5.5 configuration
+file.
+* Fixed: [Win32] BC++ 5.5 doesn't even define a dummy for chown, getuid and
+getgid. I must move it to compatlayer but currently TV is in frozen.
+
+Revision 1.467 2001/10/20 15:12:33 set
+* Added: Acknowledge to VA Linux and S.F. crew, this service helped me to
+get at least quite close to have support for other Linuxes and FreeBSD.
+
+Revision 1.466 2001/10/20 15:07:36 set
+* Fixed: In loadcle and a member of the editor I assumed a char variable
+can hold a negative value or at least the compiler is smart enough to
+assume it means 0xFF. It isn't true for Power PC platforms. I changed it to
+work with explicit unsigned chars.
+* Fixed: The edspecs module used a non-endian clean code when saving the
+environment strings producing SIGSEGVs when loading the file in big endian
+systems. Lamentably I think it there are more things like it. Seen in Power
+PC.
+* Note: I compiled the editor for Alpha and PPC thanks to Source Forge's
+Compiler Farm. The editor is corrupting the heap in Alpha and had those
+problems in PPC. I'll test a fixed version but I really need some user on
+these platforms to help me.
+
+Revision 1.465 2001/10/20 01:16:54 set
+* Fixed: Missleading information about Debian version in the policy.txt
+file.
+
+Revision 1.464 2001/10/20 01:16:04 set
+* Added: a fix to the configuration script to have it in sync with TV.
+* Added: Now the editor can detect makefiles just because they have
+#!...make.
+
+Revision 1.463 2001/10/20 00:27:47 set
+* Fixed: [UNIX] some static functions in stackdbg.c weren't used in
+non-intel platforms generating warnings (seen in Power PC).
+
+Revision 1.462 2001/10/20 00:22:49 set
+* Fixed: When using the editor SUID root and the ~/.setedit directory
+wasn't yet created the editor created it as root because it didn't reach
+the point where priviledges are droped. Reported by Ivan.
+
+Revision 1.461 2001/10/20 00:17:16 set
+* Fixed: I was casting pointers to integers in the keyboard tables code. It
+doesn't work for the Alpha processor where sizeof(void *) == 8 and
+sizeof(int) == 4 ;-) I knew it, but is sometimes I forget such a details.
+
+Revision 1.460 2001/10/20 00:10:15 set
+* Added: A new target "internac" to the makefile, it creates the *.mo
+files.
+* Added: Anew target "doc-basic" to the makefile, it creates the txt and
+info documentation.
+* Modified: Now the needed target includes internac and doc-basic. It
+implies that "make editor" will also generate the i8n and doc files. It
+avoids generating the files while using "make install" that needs root and
+hence makes the files hard to delete. Reported by Grzegorz.
+* Modified: [UNIX] Now InfView's REMOVE_UNNEEDED only removes obsolete
+files that belong to InfView. Thiago installed InfView 0.2.7 having setedit
+0.4.41 and it deleted the help files of setedit.
+
+Revision 1.459 2001/10/19 23:26:44 set
+* Fixed: [InfView] It was unconditionally closing the opened windows even
+if the command line indicated a .info file. It was introduced when I added
+code pages support so it was present only in 0.2.7 beta. Reported by Ivan.
+
+Revision 1.458 2001/10/19 22:52:38 set
+* Added: Ivan is maintaining a Debian repository for the editor and
+InfView. I documented it in the readmes.
+
+Revision 1.457 2001/10/18 23:52:07 set
+* Modified: I moved the changelog information generated before the use of CVS
+to a new file called change0.log. I reformated it to be more like the current
+change.log. The file contains 424 entries and ranges from 1996/12/03 to
+1998/11/19, about 2 years.
+
+Revision 1.456 2001/10/17 23:38:16 set
+* Added: Now the configuration script informs if the configuration header was
+changed.
+* Copied some fixes in conflib.pl from TV to make them in sync.
+* Fixed: a warning generated by gcc 2.8.1 about a variable that could be used
+unitialized (wrong warning).
+
+Revision 1.455 2001/10/17 23:33:27 set
+* Synchronized with S.F.
+
+Revision 1.15 2001/10/15 13:57:48 set
++
+
+Revision 1.454 2001/10/14 22:27:26 set
+* Fixed: The detected CPU wasn't restored from the configure.cache
+producing a wrong configuration header.
+* Fixed: SIGSEGV produced if we inserted text in a new buffer after a grep
+search or errors collection.
+
+Revision 1.14 2001/10/14 06:44:45 terrible
+* Updated: Debian packaging to the "Let's see if I can release while I am
+sleeping" release, version 0.4.50-1. See debian/changelog for details.
+
+Revision 1.453 2001/10/13 22:17:46 set
+* Fixed: v0.4.50 needs TV 1.1.3 and the config.pl didn't enforce it.
+* Fixed: Global indent size wasn't stored in desktop files nor offered in
+the default global options based on the shl. Reported by Grzegorz.
+* Fixed: Accelerator for "Indent" (d) clashed with "To all" in the spanish
+version. Reported by Grzegorz.
+* Modified: version to 0.4.51.
+
+Revision 1.13 2001/10/12 12:39:32 set
++
+
+Revision 1.452 2001/10/12 02:50:38 set
+* Fixed: When opening the readme.1st the editor tried to make it read-only
+but it didn't prevent the editor for issuing a warning if the file was
+really read-only. Now the class takes isReadOnly as parameter in the
+constructor.
+* Fixed: [Linux] When using hidden desktop files and projects the editor
+failed to load the desktop file.
+
+Revision 1.451 2001/10/11 23:55:39 set
+* Updated the changes and fixes since 0.4.41 upto last revision.
+
+Revision 1.450 2001/10/11 23:46:36 set
+* Synchronized CVS with Source Forge.
+
+Revision 1.449 2001/10/09 22:37:54 set
+* Updated: Spanish translation.
+
+Revision 1.448 2001/10/09 22:32:20 set
+* Added: Column markers. That's another edition option and can be used to
+highlight columns. This is useful for languages that needs text in
+particular columns (Fortran and Cobol I think). I tested global and local
+settings and default global options. Documented. Suggested by Martijn
+Versteegh.
+* Modified: version to 0.4.50.
+
+Revision 1.447 2001/10/09 17:56:52 set
+* Updated: Tcl/Tk syntax highlight. Patch by Philip Moore <FireEgl@EMail.com>
+* Added: Fortran syntax highlight. Contributed by Martijn Versteegh
+<versteegh@kvi.nl>.
+
+Revision 1.446 2001/10/09 16:54:49 set
+* Tested the editor with PCRE 3.2, all works OK, I don't include it because
+now uses autotools and fails to be configured for djgpp needing tricks.
+* Fixed the allegro 3.9.38 headers to compile with gcc 3.1, will send patches
+to list.
+
+Revision 1.445 2001/10/09 14:05:21 set
+* Fixed: Typo in C/C++ parser (#elif)
+* Bad news: The editor compiled with gcc 3.1 runs slower than compiled with
+2.8.1 and is bigger: 11 % slower 20 % bigger. At least for my K6-2 CPU using
+-O2 optimization. That's really bad.
+
+Revision 1.444 2001/10/08 22:09:33 set
+* Added: Support for gcc 3.1. The code compiled OK, but I was forced to
+disable some part of Allegro's header :-(.
+
+Revision 1.443 2001/10/08 19:30:01 set
+* Added: Support for gcc 3.1 in the configuration scripts.
+* Added: Support for string streams in doedidia.cc (str streams doesn't exist
+anymore).
+* Added: Support for "namespace" and "using" C++ keywords to the internal
+syntax highlight.
+
+Revision 1.11 2001/10/07 23:46:19 terrible
+* Modified: updated Debian files to version 0.4.49-1.
+* Fixed: unnecesary compile of shipped libbzip2 because of typo in config.pl.
+
+Revision 1.442 2001/10/07 20:31:28 set
+* Added: a small script to create the .debs as a regular user
+(debian/buildpackage).
+
+Revision 1.441 2001/10/07 19:30:37 set
+* Added: More mechanisms to make gettext work with the .po files. The main
+problem is that old tools destroys the information needed for the new ones.
+Now the scripts also updates version and revision time.
+* Fixed: When running suid root the stderr redirected files were owned by
+root. Reported by Ivan.
+* Fixed: When using a central dst file and loading another in a directory
+the settings were transferred to the central one. Reported by Ivan.
+
+Revision 1.440 2001/10/07 14:30:57 set
+* Added: A command line option called --debug to the configuration script.
+It selects switches that can be used for debug and testing purposes. They
+are generic and could not match with the ones used to compile TV. Suggested
+by Grzegorz.
+
+Revision 1.439 2001/10/07 14:07:49 set
+* Added: Now if SET_FILES wasn't defined the editor also tries to guess
+using the prefix indicated during configuration. I also added an option to
+the configuration script to disabled it because I compile the editor in
+e:/... for DOS and it could be the CD-ROM in some sytems producing a test
+for the CD which is slow and annoying. Under UNIX I use /usr which is
+already in the list to search, so my prefix isn't needed either.
+
+Revision 1.438 2001/10/06 23:15:01 set
+* Modified: Now is possible to set the number of closed windows to
+something less than 3. Suggested by Thiago.
+* Added: Now ESC closes the man pages viewer. Suggested by Thiago.
+
+Revision 1.437 2001/10/06 22:42:34 set
+* Enhanced: Now the heuristic parser for C sources takes only one part of
+#if #elsif #else #endif sequences when they are inside a function. It
+solves a well known limitation. I hope it doesn't break all ;-) I did it
+after a report by Grzegorz, the funny thing is that limitation was clearly
+documented (RTFD).
+
+Revision 1.436 2001/10/06 19:58:10 set
+* Added: A couple of command to execute sLisp from the editor (selected
+text) or entering it in an input line. Documented. Suggested by Thiago.
+* Updated: Spanish traslation.
+* Modified: Now the Macros collection (list of sLisp macros defined by
+user) holds a copy of the macro code. It makes possible to define macros
+with the new mechanism without risking to lose them or leak memory.
+* Added: Support for commands with _ in their names to the meuload
+mechanism. The new commands have it.
+
+Revision 1.435 2001/10/06 17:22:41 set
+* Fixed: Calculator parsers aren't "locale aware" but libc is so it
+generated a mess. Now the locale is set to C before running them. Reported
+by Ivan.
+* Added: Some code to make the stackdbg module more robust when using
+strong optimizations.
+* Modified: Debian release version used by the editor to -0.1 and not -1.
+* Fixed: SIGSEGVs when using the -b command line option.
+
+Revision 1.434 2001/10/06 16:04:40 set
+* Fixed: [sLisp] The RunProgramRedir command was forking and hence didn't
+collect the external program output. Reported by Grzegorz.
+* Added: [sLisp] A new optional parameter to RunProgramRedir. If provided
+is used for the stdin of the external program. Documented. Suggested by
+Grzegorz.
+* Added: [sLisp] MessageBox command to communicate things to the user.
+Documented.
+* Added: [sLisp] An example of how to use the new RunProgramRedir to run an
+external filter program. I tested it with "recode ISO8859-1..html".
+
+Revision 1.433 2001/10/06 14:27:58 set
+* Added: Now the files listed in the "no back-ups" list aren't remmebered
+in the closed list. They are usually temporal files that won't exist
+anymore. Documented.
+
+Revision 1.432 2001/10/06 14:16:43 set
+* Added: Support for "Jump to function" in assembler files. It takes the
+labels excluding local gcc labels (they start with .). Documented.
+* Fixed: The syntax highlight for .s files didn't separate strings starting
+with " and '.
+
+Revision 1.431 2001/10/06 13:30:49 set
+* Added: New option to open R.O. files as R.O. buffers.
+* Documented: New option "Open R.O. as R.O." plus all the new stuff in the
+editor's general options.
+* Documented: Addition to menu: "Name current function"
+* Synchronized Source Forge CVS, tag sf0449_2.
+
+Revision 1.10 2001/10/05 13:13:08 set
++
+
+Revision 1.430 2001/10/05 00:38:47 set
+* Added: Name of current function to the menues. This command is old and is
+available as an option of find & replace but wasn't in the menues.
+* Added: My CVS sync tools to the distribution list.
+* Fixed: Now when jumping to a file reported by an external program and the
+file doesn't exist the editor doesn't open an empty window, it just ignores
+it.
+
+Revision 1.429 2001/10/05 00:07:31 set
+* Added: Comment about changes upto revision 1.386 of change.log to the
+readme file.
+
+Revision 1.428 2001/10/04 01:54:16 set
+* Added: Support for Allegro 3.9.x. It generates a bigger executable but
+support more sound systems. It also generates a marginally bigger installer
+(Not counting the editor increase). I provide a datafile replacement to avoid
+pulling another 80 Kb or so.
+
+Revision 1.427 2001/10/02 00:51:23 set
+* Modified: [DOS] If LFNs are supported and UNIX back-up style is selected
+the editor appends the ~ at the end as in UNIX. I think it could fail for
+remote file systems like Novell 3.12 ones but in this case the user should
+simply avoid using it.
+
+Revision 1.426 2001/10/02 00:32:57 set
+* Added: Documented that now Alt+F2 is not only for C. Also documented the
+browse button.
+* Modified: The inf.h header included tv.h. It produced multiple inclusions
+of a big header. Now you include infr.h and then settvuti.h (it includes
+tv.h) finally you can include inf.h. In this way settvuti.h+tv.h and
+related headers are included just once.
+
+Revision 1.425 2001/10/01 23:28:38 set
+* Merged with SourceForge (patches from Ivan and last minute adjustements).
+
+Revision 1.9 2001/10/01 17:28:06 set
+* Remerged Ivan patches.
+* Updated *.mak files.
+* Commited some files that failed in the batch process.
+
+Revision 1.7 2001/10/01 15:18:46 set
+* Removed "fixme" labels from Ivan, things seems to be OK.
+
+Revision 1.6 2001/10/01 13:33:14 set
+* Removed: tcedit.dst file from CVS, it was there by accident.
+
+Revision 1.5 2001/10/01 02:51:07 terrible
+Fixed: if we are not using shipped libbzip2 then use the system include files
+and not the shipped ones.
+Fixed: if we are not using shipped libbzip2, then not compile it.
+New: support old libbzip2 (before 1.0 version).
+Workaround: patchenv.pl checks if a variable needs replacing or not, the
+problem is that it only checks in the first occurence of the variable (in
+the .mak file), so if the first occurence of the variable not needed a
+change, then it didn't change the other occurences even if they had to be
+changed; so I have disabled that check and it always replaces the variables
+no matter what, a Perl guru should elaborate a correct solution to avoid
+changing everytime all the variables.
+To do: Salvador has to check the various "FIXME:"'s and correct my mistakes
+(though "It Works For Me TM" in Debian Potato and in Sid but maybe that's
+because of black magic).
+
+Revision 1.4 2001/09/30 04:08:29 terrible
+Updated Debian packaging to 0.4.47-2.
+
+Revision 1.3 2001/09/30 00:51:10 terrible
+Debian packaging updated to 0.4.47-1.
+
+Revision 1.2 2001/09/29 14:58:35 terrible
+Updated Debian files to version 0.4.45-1.
+
+Revision 1.424 2001/09/30 20:46:51 set
+* Modified: The new tools.
+
+Revision 1.423 2001/09/30 20:03:05 set
+* Added: A experimental tool to synchronize my CVS with Source Forge's cvs.
+
+Revision 1.422 2001/09/29 15:53:22 set
+* Many fixes to cleanly compile with gcc 3.0.1:
+* Modified: gcc 3 enforces /n at the end of files.
+* Fixed: Preprocessor expansion "]##." is deprecated.
+* Fixed: "#endif text" is deprecated.
+* Fixed: "condition ? object_type1 : object_type2" deprecated (casts
+enforced).
+* Fixed: Multi-line strings deprecated. That's a real pity because they are
+very convenient for inline assembler.
+* Fixed: Use of ios::bin (now CLY_IOSBin) in mp3list.cc.
+* Fixed: Missing memcpy prototype in mp3play.cc.
+* Modified: Now gcc doesn't provide set_new_handler() anymore.
+* Fixed: I put pathlist.h wrongly in the files list.
+
+Revision 1.421 2001/09/26 02:37:31 set
+* Adapted: The es.po, de.po, utod.pl and Makefile for internationalizations
+to work with gettext 0.10.39 tools (that seems to suppose files are in
+UTF-8 by default!!). I hope the old tools I use in Linux won't mess the
+whole thing.
+
+Revision 1.420 2001/09/26 02:05:23 set
+* Modified: [DOS] Now in TV the keyboard is by default handled by BIOS.
+Added command line switchs to revert it, documented and translated.
+F*ck|ng gettext package, it is a real piece of shit, I'm sick of te really
+stupid ideas incorporated to it.
+
+Revision 1.419 2001/09/25 23:50:44 set
+* Added: Now the first time the editor forces to load the readme.1st it is
+opened: 1) R.O. 2) Zoomed 3) With the cursor at the beginning.
+
+Revision 1.418 2001/09/23 23:37:09 set
+* Fixed: When running a program in background and it finished jumping to a
+source line the result was quite confusing if we were in a modal dialog. In
+this case the dialog remains with the keyboard focus but the select window
+is another, most probably oculting the dialog. Now the run program
+mechanism waits until we exit the dialog.
+
+Revision 1.417 2001/09/23 23:16:26 set
+* Fixed: When match on the fly was enabled and also no wait the editor
+failed to propagate some syntax highlight situations.
+
+Revision 1.416 2001/09/23 21:25:06 set
+* Updated: Calculator parsers that are and aren't compiled to compile with
+the changes in compatlayer.
+
+Revision 1.415 2001/09/23 21:22:03 set
+* Fixed: The routine that restores a line under edition failed to update
+the correct start of the selection when it purged spaces at the left of the
+cursor position.
+* Fixed: The undo of BackSpace inserted spaces at the wrong column when
+they were completly purged during the action.
+
+Revision 1.414 2001/09/23 20:11:34 set
+* Modified: Moved all the macros to define if we need \r\n or \n from
+setedit to the compatlayer library.
+
+Revision 1.413 2001/09/23 15:46:52 set
+* Added: An option to indicate in which directories to search files we
+indicate with Ctrl+Enter. Usually include dirs. Stored in the desktop file,
+documented. Translated to spanish.
+* Modified: version to 0.4.49.
+* Modified: The algorithm that takes the name of a file under the cursor to
+be smarter.
+
+Revision 1.412 2001/09/23 00:33:27 set
+* Fixed: After jumping to a function name extending the selection usually
+generated strange results. It was like extending an old selection. Now the
+selected line is made with a temporal selection like in the search
+mechanism.
+* Fixed: When jumping to a function already in the screen it wasn't
+highlighted.
+
+Revision 1.411 2001/09/22 23:53:20 set
+* Fixed: The C/C++ function parser failed with sequences like it: "\\\\".
+Reported by Grzegorz.
+* Fixed: Alt+F7/F8 without hits gave a SIGSEGV (produced by the addition of
+re-select the last if we passed it).
+
+Revision 1.410 2001/09/22 22:40:49 set
+* Added: A new command cmcInsertKeyName to insert the name of the key in
+the text you are editing. Suggested by "Thiago F.G. Albuquerque"
+<tfga@zaz.com.br>. Documented.
+
+Revision 1.409 2001/09/22 21:08:36 set
+* Modified: The TeX syntax highlight with some stuff contributed by Jan
+Cnops <jan.cnops@hogent.be>.
+
+Revision 1.408 2001/09/22 20:52:31 set
+* Updated: [InfView] readme to reflect last aditions.
+* Modified: [InfView] removed some unneeded code.
+* Fixed: [InfView] the "shell" menu option.
+* Added: [InfView] Internationalization files to the distro.
+
+Revision 1.407 2001/09/22 20:12:36 set
+* Fixed: [InfView] Now *all* the commands are enabled/disabled when an
+InfView gets/lose the focus.
+* Added: [InfView] The man pages viewer.
+* Added: [InfView] Screen configuration. No more broken frames for systems
+with ISO fonts! Ivan Baldo <lubaldo@adinet.com.uy> and Grzegorz Adam
+Hankiewicz <gradha@iname.com> were asking for it.
+* Added: [InfView] Internationalization for messages.
+* Updated: Spanish translations.
+* Modified: [InfView] Moved the new window option to the file menu.
+* Added: Code page support to the ManPageView scroll bars.
+* Fixed: All ManPageView windows didn't remmember the position (just
+centered every time).
+* Modified: edprefs.cc to use CLY_Packed.
+
+Revision 1.406 2001/09/22 14:58:51 set
+* Updated: [InfView] versions and dates in manpage and info file.
+* Updated: [InfView] readme file, removed no longer pertinent stuff and
+added the most relevant changes since last release.
+
+Revision 1.405 2001/09/22 14:46:03 set
+* Fixed: The editor didn't store staticUseIndentSize and
+staticDontPurgeSpaces in the desktop file. Reported by Martijn Versteegh.
+* Modified: version to 0.4.48.
+
+Revision 1.404 2001/09/22 14:41:44 set
+* Added: [InfView] Instructions about how to load info files stored in the
+current directory. Suggested by Thiago.
+* Fixed: [InfView] Now most commands are grayed when no window is available
+reflecting the truth.
+* Modidied: [InfView] version to 0.2.7. It have various changes since 0.2.6
+and nobody noticed it.
+
+Revision 1.403 2001/09/22 02:20:47 set
+* Added: An option to disable the R.O. file warning. In this case the
+editor will warn when you try to save so you have an oportunity to revert
+it. Suggested by Marc-Antoine Massicotte <marc.massicotte@videotron.ca>.
+
+Revision 1.402 2001/09/21 02:25:19 set
+* Added: [DOS] More fixes to avoid collisions between conio.h and shipped
+gettext.
+* Fixed: New standards seems to enforce a \n at the end of all sources. At
+least gcc 3.0 says that. I added it to all the tests in the configuration
+scripts.
+* Fixed: [DOS] GCC 3.0 doesn't compile C++ code using the C compiler. The
+configure script can detect it, but as it only happened with very old gcc
+versions the scripts were looking for gxx and currently the C++ compiler is
+inoked using gpp.
+
+Revision 1.401 2001/09/21 01:24:38 set
+* Modified: As now compatlayer defines uint* I needed to fix some
+collisions.
+
+Revision 1.400 2001/09/20 01:45:21 set
+* Modified: Now the configuration detects more details and defines
+preprocessor variables acording to it. The definitions are also less
+confusing. Now they are OS, OSf (subtype of OS), Comp (Compiler), Compf
+(subtype of compiler) and CPU. With it I removed almost all magic __*__ tests
+that are usually tricky and not so clear.
+* Added: Better prefix detection for MinGW.
+* Fixed: The version.txt file messed things if ended with \n, now is ok.
+* Added: Code to viewplus that I hope will reduce the problems when porting
+to big endian systems. Related to the column/row cursor.
+* Fixed: The Perl parser didn't include numbers in function names.
+
+Revision 1.399 2001/09/16 22:38:45 set
+* Added: A test to put the distrib target in the Makefile only if the needed
+tools are installed (zip for DOS and tar for UNIX).
+* Added: [DOS] Same for the installer target. The list of needed tools is
+huge. This is a new target and creates the DOS installer.
+* Added: [DOS] Instructions if the user doesn't have fileutils installed.
+* Added: Configuration of ar for the gettext library.
+* Added: A new target (needed) for the Makefile. It compiles any thing needed
+for the editor that isn't created by RHIDE projects.
+* Fixed: [DOS] The shipped gettext assumed the user already patched your
+djgpp installation as explained in the gettext 0.10.39 distribution. That's
+impossible if the user never installed it. Now I tweaked the headers and code
+to avoid collisions with conio gettext.
+* Fixed: [DOS] Some warnings from gcc 2.95.3 not detected by 2.95.2 for the
+installer.cc file. Related to implicit conversions.
+* Fixed: [DOS] Some warnings from binutils 2.11.2 not reported by 2.8.1 in
+mixsurf.c. Related to EOL C++ comments in inline assembler (must be in a
+separated line).
+
+Revision 1.398 2001/09/16 20:10:00 set
+* Fixed: Now the clean target of the Makefile also cleans mpegsound
+objects. Reported by Ivan.
+* Applied some fixes for the Debian stuff sent by Ivan.
+* Fixed: Now the scripts of distribution updates debian/changelog with my
+name and stating it was a script. Sugested by Ivan.
+
+Revision 1.397 2001/09/16 17:29:21 set
+* Added: Architecture detection to the configure. It defines SECPU_$(Arch).
+* Added: GNU make detection to the configure. It supports gmake as name.
+* Added: GNU ar detection to the configure. It supports gar as name.
+* Fixed: In systems different than Linux and DOS RHIDE makefiles doesn't
+include -lstdc++ (RHIDE_TYPED_LIBS_$(RHIDE_OS).cc is not defined). So now
+the configuration puts them as RHIDE_OS_LIBS. Seen on FreeBSD and Solaris.
+* Added: Support for ncurses installed as -lcurses (I saw it in Solaris).
+* Added: Now CFLAGS and CXXFLAGS can be passed to the configuration in the
+command line (must use the perl script directly, no the shell script!). It
+made the configset script usable with any UNIX shell (/bin/sh isn't bash in
+a lot of UNIX systems).
+* Added: SunOS to the list of systems supported by the configuration. It
+doesn't mean the library is working there.
+* Modified: References to __i386__ by SECPU_x86.
+* Fixed: Now gpm is detected and not assumed.
+* Fixed: The perl pmacros file made reference to an unexistant marker (@4).
+* Fixed: When specifying an out of range marker in pmacros a stack
+corruption ocurred.
+
+Revision 1.396 2001/09/15 22:52:13 set
+* Modified: [DOS] The compress script now deletes old manifest/version files
+that could be left by an old version package in the directory where the
+distribution is created.
+* Fixed: The arrangements in the order that main initializes things
+affected the SET_FILES error report (made invisible).
+
+Revision 1.395 2001/09/15 21:56:37 set
+* Fixed: If none file was loaded with syntax highlight pressing Atl+F2
+generated a SIGSEGV. Reported by Grzegorz.
+* Added: Really simple parsers for .txi and .shl files. (For the Alt+F2).
+* Fixed: Some small details to get libset.a compiled.
+* Fixed: Is the editor remmembered a file that is read-only at start-up a
+dialog pop-ups asking if we want to revert it, but it happends while the
+editor is still loading files and the problem is that the idle() makes some
+searchs in the list of opened windows. As it isn't completly loaded the
+result was a SIGSEGV.
+
+Revision 1.394 2001/09/15 19:28:45 set
+* Modified: [Linux] Now by default the editor isn't distributed as a
+compressed executable. According to Ivan it could make the kernel waste
+memory.
+
+Revision 1.393 2001/09/15 19:21:09 set
+* Fixed: [Linux] all editor functions that collected word characters (like
+ctrl+right/left arrows) wrongly stopped in accents. The problem was that it
+didn't reflect the selected code page, just CP 437.
+
+Revision 1.392 2001/09/15 18:45:43 set
+* Added: EdReloadIfOpened to rhideint.cc to avoid unresolved references in
+RHIDE. But I'm not sure if that's enough.
+
+Revision 1.391 2001/09/15 18:39:30 set
+* Fixed: When modifying files like ~/.setedit/deflopts.txt with the menues
+and the file was opened by the editor the opened buffer got out of sync.
+Now the editor checks if it was changed and then reloads the file. The same
+applies to nobkp.txt and userword.txt files.
+* Fixed: It was possible to fool the editor and open the same file twice
+if it was modified by an external program and saved with another i-node
+value. As a result:
+* Modified: Now the editor checks if any of the opened files changed inode
+before opening a new one. That's needed to avoid opening it twice.
+* Fixed: When collecting errors/messages the editor didn't check for names
+like it: /dir/../dir/file and similar situations. In this case the editor
+failed to find the information about this file in the project window. Now
+the editor shows only the name of the file as the external program repoted,
+internally adds the right path and ensures the name doesn't have such an
+artifacts.
+* Modified: The way I hold the inode/dev is more abstract so other values
+can be used. Currently Win32 target lacks inode information and it could
+help. Also added a mechanism to reload a buffer without closing the window
+and a more generic dialog that limits the lenght of file names.
+
+Revision 1.390 2001/09/14 02:09:15 set
+* Modified: [Linux] Now also the er* files are created in ~/.setedit
+[DOS] If the user defines a home directory they are stored there. Sugested
+by Martijn Versteegh.
+
+Revision 1.389 2001/09/14 01:50:34 set
+* Modified: All the references to the web page to point to Source Forge,
+also some e-mail references and the mailing list address.
+* Modified: The text of the readme files to better reflect the current
+situation.
+
+Revision 1.388 2001/09/12 03:01:34 set
+* Modified: Now when you jump to an error the editor puts in the status
+line only the description of the error and not the entire line generated by
+the compiler. That's very useful when you are in deep subdir and the file
+name is quite large using most of the space. After all the file name is the
+name of the window and the line is at the bottom of the window.
+
+Revision 1.387 2001/09/12 01:04:26 set
+* Added: A dialog to show where a file was stored. This dialog limits the
+file name to around 90 characters showing only the last characters and
+indicating with a ~ at the begining if the path was truncated.
+* Modified: Cleaned the pathtool interface a little bit now only two
+functions should be used to load/save configuration files: ExpandHome and
+ExpandHomeSave.
+* Modified: All modules to use the above mentioned functions.
+* Added: Now the editor tries to save configuration files modified by a
+user to ~/.setedit/file. I did it to avoid polluting the home directory and
+to put the default tcedit.dst in a place that nobody should run the editor.
+The editor will load all files from ~/.file but will save them in the
+directory. In this case (or when you load the original file from
+/usr/share/setedit and now the editor is saving it in the home) the editor
+informs the user with a dialog indicating where the file was stored.
+* Fixed: The editor failed to set the ShowMatchPairFly from the default
+flags file.
+
+Revision 1.1.1.1 2001/09/11 13:58:18 set
+Imported sources.
+
+Revision 1.386 2001/09/09 22:16:36 set
+* Fixed: [BC++/Win32] Some unused parameter warnings.
+* Fixed: [DOS] Missing header in stackdbg.c (code I blindly wrote on Linux)
+* Fixed: Unreachable break detected by BC++.
+* Fixed: BC++ doesn't like default argument values in the function itself.
+* Fixed: Missing string.h in pperl.cc (gcc 2.95.2 doesn't report it for
+internal functions).
+
+Revision 1.385 2001/09/09 20:31:58 set
+* Added: A tool to find the empty and fuzzy entries in a .po file. Is
+called emptymsg. If you call it passing the names of the .po files to it
+from the editor you'll get a list of missing/fuzzy entries that you can
+browse using Alt+F7/F8. It combined with the special lines (it moves line
+hits as text is added/deleted) and the .po SHL makes much more easy to
+complete .po files.
+
+Revision 1.384 2001/09/09 20:24:11 set
+* Added: A new option to avoid making backups for some particular files.
+The setting is just a list of regex (Perl style) stored in a text file. If
+a file name matches any of the regex the editor doesn't create a backup.
+This option is only available in the standalone editor but is relative
+easy to hook the needed stuff to the class (for RHIDE).
+* Added: The above mentioned option to the documentation. Also updated the
+File Open options and mentioned the Options button. Documented the new
+block case functions. Updated the list of SHLs supported.
+* Added: A new macro to the docs called @p{} to replace @paragraph{}, it
+is much more convenient.
+* Added: A separated header file for loadshl.cc.
+* Updated: The spanish translation. Also generated the german file so any
+user could complete it. I think 148 translations are missing or incorrect
+(fuzzy filled) in the german file.
+* Modified: [UNIX] Now the editor loads ~/.file first that ~/file for any
+configuration file. I did it because when saving the editor choose ~/.file
+first.
+
+Revision 1.383 2001/09/09 00:26:11 set
+* Fixed: When I changed from absolute to relative projects the memory of
+settings for project items got broken. It was long time ago but I didn't
+realize it because it worked for projects where all files are in the same
+directory and the closed windows also have memory. Now is fixed.
+
+Revision 1.382 2001/09/08 23:29:25 set
+* Added: Block invert case and alternate case. I reused the code of block
+toupper/lower and created those new funny functions.
+* Fixed: [UNIX] One of the new messages printed at exit didn't check if we
+effectively redirected stderr trying to print a null pointer.
+* Modified: Now File Open dialogs not only remmembers paths+masks but also
+file names (full qualified).
+* Fixed: When adding items to a project the only way to exit is by pressing
+ESC, but then the editor didn't remmember the path we used and when
+inserting again we must get it from the history. Now remmembers it.
+* Added: The number of lines of the saved text (not only size).
+
+Revision 1.381 2001/09/08 21:40:39 set
+* Added: Code page remap for a block of text (no the whole file). It have
+undo and I reused code from toupper/lower block.
+
+Revision 1.380 2001/09/08 17:56:38 set
+* Fixed: The "backspace unindents" could get confused with lines containing
+only spaces.
+* Fixed: The my_popen code used in stackdbg.c and the derivated used in
+symify to close the right file handle and in the right order in the child
+process. I noticed it looking how libc's popen is implemented.
+* Fixed: I completly rewrote the my_pclose function used in the above
+mentioned sources because it created zombie process. I also made it more
+robust. I must do some adjusts yet, but now works OK (is just slow).
+* Fixed: If argv[0] was just a file name (no relative path and no absolute
+path) the code failed to detect if it had debug symbols.
+* Added: Credits to Bjorn and Grzegorz in the about dialog.
+* Added: A note about djgpp's implementation of putenv.
+* Fixed: Now child processes created by run a program are put in a
+separated session and I kill the group. It is more effective when the child
+creates other processes and one of them hangs. Killing the first child is
+not enough, so now I kill the group. Note: it have an interesting side
+effect that will introduce some changes soon, but is better.
+
+Revision 1.379 2001/09/08 00:16:36 set
+* Modified: [UNIX] Now when expanding compressed info files the temporal
+file is removed just after opening it. Making it we don't let those
+temporals when the editor crashes or we debug it. Is only enabled for UNIX.
+
+Revision 1.378 2001/09/07 23:48:53 set
+* Added: [Linux] Now the editor also dumps a stack trace when crashes. I
+also added a message informing the user where the unsaved buffers and crash
+information can be found.
+* Added: [Linux] Two new behaviors in case of a crash. One calls gdb to
+get a detailed stack trace and information about local variables the other
+not only does it but also gives the control to gdb so we can get more
+information. If we are in a X a separated xterm is created for gdb, that's
+really cool! I based it in code by Bjorn Reese <breese@mail1.stofanet.dk>
+that Grzegorz sent me.
+* Added: A command line switch to select the behavior of the editor in case
+of a crash. It supersedes the --no-signal option. Also sorted the command
+line options. The name is --stack-dbg (d).
+* Added: An environment variable to set the default behavior of -d option.
+* Updated: man page to reflect the new command line. Also added two
+environment variables (the new one and other) and sorted the options
+alphabetically.
+* Added: [Linux] A tool equivalent to djgpp's symify to process stack
+traces. (tools/symify.cc).
+* Fixed: After adding some routines to edspecs.cc InfView gave undefined
+references, so I added a dummy to avoid it.
+* Updated: Spanish messages.
+* Fixed: I was damaging argv[0]. It was easy to see when running ps, the
+editor name had a space after the last slash.
+* Added: A small script to install the editor without stripping debug
+information. It will allow me to start gdb each time the editor crashes on
+my system. I also added the needed code to the makefile and installation
+scripts.
+* Modified: Now I call TEventQueue::suspend() from the signal handler
+instead of suspend_keyboard(). I know that's more dangerous but uses a
+standard mechanism.
+* Added: Now the editor also prints the signal number in the error file.
+
+Revision 1.377 2001/09/05 19:19:08 set
+* Modified: More details in the routines that closes undesired editors.
+Damn is really tricky.
+
+Revision 1.376 2001/09/05 17:45:27 set
+* Added: A new option to the Run program options dialog. When enabled and
+we get errors from the child process the editor jumps to the first line
+with errors (like in RHIDE).
+
+Revision 1.375 2001/09/05 17:19:43 set
+* Fixed: When enabling the column cursor in a window that wasn't restored
+from disk it sometimes was shorter than what we expect. It was due to a
+wrong initialization of CrossCursorCol member, the same could happend with
+the row cursor.
+
+Revision 1.374 2001/09/05 16:55:48 set
+* Modified: Now I extended the option to forget the cursor position to also
+forget about other settings remmembered for closed and project files.
+
+Revision 1.373 2001/09/05 16:45:59 set
+* Added: Now the "Open only specified files" option is divided in various
+options to give more control about what is stored in the desktop file. Now
+the windows are divided in three types: Editor, Non editors and Closed
+Editors. For each group is possible to set if we want to: remmember it,
+remmember it but if the command line contains file names forget or just
+don't remmember. These nine options replaces the old one. I added it
+because some users didn't like the current behavior and wanted a
+differerent behavior to the one that Ivan sugested when I added it. In
+particular Tatu || Vantte Kilappa <elfire@kymp.net> wanted a middle ground
+behavior.
+* Modified: Version to 0.4.47. So we can adapt the old setting and select
+three of the new ones that are equivalent.
+* Added: An option to not remmember the cursor position while loading the
+desktop.
+* Modified: The edpecs.cc calls. Now it have a separated header and some
+functions that are commonly used. It makes the code more compact and
+readable.
+
+Revision 1.372 2001/09/05 01:43:28 set
+* Fixed: The option to open only the editor indicated in command line was
+broken.
+
+Revision 1.371 2001/09/04 19:54:40 set
+* Added: Syntax highlight for "Cascading Style Sheets v2" contributed by
+S. M. Halloran <mitch@duzen.com.tr>.
+* Added: Syntax highlight for "JavaScript" contributed by S. M. Halloran
+<mitch@duzen.com.tr>.
+* Added: Syntax highlight for "PostScript" contributed by S. M. Halloran
+<mitch@duzen.com.tr>.
+* Added: More tags to the HTML syntax highlight contributed by S. M.
+Halloran <mitch@duzen.com.tr>.
+
+Revision 1.370 2001/09/04 19:27:19 set
+* Fixed: [Win32+BC++] Inserted call to EmptyClipboard in the function that
+sets data in the windows clipboard. Without this call data set by editor
+was not seen by other application. It happened because we did not set
+editor as the clipboard owner. Call to EmptyClipboard does this. It only
+applies to Win32 target, patch from Anatoli Soltan <anatoli@iname.com>.
+* Modified: The behavior of Paste from Win Clipboard to be consistent with
+what a regular windows user would expect. Now it just does not copy the
+previous selection to the clipboard and selects the pasted text only if
+persistent blocks are enabled. Patch from Anatoli Soltan
+<anatoli@iname.com>.
+
+Revision 1.369 2001/09/04 18:04:04 set
+* Modified: Now the default color for reserved words is light blue over
+blue and not green over blue.
+* Fixed: It was impossible to use CFLAGS options that contained
+option=value because it confused patchenv.pl failing to configure the
+makefiles. Reported by Norberto Alfredo Bensa <nbensa@hotmail.com>
+
+Revision 1.368 2001/09/04 03:49:23 set
+* Added: The TColorSelector::mark to the codepage remapper. It wasn't
+available before.
+
+Revision 1.367 2001/09/04 00:16:18 set
+* Added: A new color in the palette for the disabled clusters. Also added
+to the load process that if the palette we are loading doesn't have this
+color it is initialized to a default. So:
+* Modified: Version to 0.4.46.
+* Added: Now we can specify that one of the error parsers defined in the
+errors.cle file is the internal one. It should be used to use the internal
+GNU parser instead of the defined in the file. Why? is much more faster and
+supports internationalization.
+* Modified: Syntax Highlight file to reflect it.
+* Modified: Copyright dates in readme files and about dialogs.
+* Added: A button to the file open/save/etc dialog to configure the sorting
+options.
+* Added: The new options to hide .*/*~/*.bkp and sort .* to the end to the
+dialog to configure the file open dialog.
+* Fixed: The above mentioned dialog was broken when I created the 32 bits
+clusters and generated SIGSEGVs.
+* Fixed: The patch I did to avoid crashes when no CLE files were available
+disabled the other parsers.
+* Fixed: The generic error parsers some times added an extra / generating
+file names with to consecutive / (invalid for UNIX).
+
+Revision 1.366 2001/09/03 17:44:10 set
+* Added: Documentation for the new Run Program options.
+* Modified: Now words in italic are represented enclosed by `' in the text
+and info outputs.
+
+Revision 1.365 2001/09/02 00:33:59 set
+* Fixed: If no default options file was defined the default mask used to
+reset modes was just 16 bits and not 32 clearing "Use indent size",
+"Don't purge spaces" and "Backspace unindents". So they failed to be
+transfered from global to local options.
+
+Revision 1.364 2001/09/02 00:07:08 set
+* Fixed: [Linux] A bug in the use of putenv, it made the editor fail to
+detect the /tmp dir. As a result the editor created temporal files in the
+current directory.
+
+Revision 1.363 2001/09/01 23:25:36 set
+* Added: A warning message if when the user tries to exit the child still
+running or we still parsing the errors. If the user wants to exit anyways
+the editor first stops it.
+
+Revision 1.362 2001/09/01 23:03:55 set
+* Added: Status line shortcuts for the Message Window (in the 3 menu files
+and in editmenu.cc).
+* Fixed: Now Prev/Next message are enabled only if the Message Window
+really have lines to jump to.
+* Added: [Linux] The run external program option now can run the program
+in background. It can optionally disabled by the user.
+* Added: The background process can be stopped just selecting the Message
+Window and pressing Ctrl+C. The status line indicates if that's available
+or not (the process is running or we still parsing their output).
+* Added: Now the messages/errors from the external program can be parsed
+in background. Is slower but you can continue working. That's the default
+when the command runs in parallel, but can be enabled even if the process
+will block the editor.
+* Added: Options to configure how often the Message Window is updated when
+the messages are parsed in parallel with the child program (the parameter
+is how many lines are processed before releasing the CPU to poll input
+devices). Also to configure if the window is forced to scroll or not.
+* Updated: The spanish translation.
+* Fixed: The new bufun.cc option to browse the functions didn't update the
+special lines arrays.
+* Modified: The interface to show messages in the Message Window to add all
+of this gadgets. I wrote an equivalent in rhideint.cc I hope it won't break
+RHIDE.
+* Fixed: Now the Message Window only scrolls to the first line only if we
+collected lines to jump. It was the original idea but was wrongly
+implemented.
+* Added: Dialogs to avoid the user running a second child process in:
+Run External Program, SDG and Grep. Sure I missed something ;-)
+* Fixed: Internationalized some messages I forgot while coding.
+* Modified: Now is possible to enter comands upto 256 characters long in
+the run external program dialog (was 80).
+* Fixed: When running `make' as the external program the editor keeps track
+of the various directory changes that makes does (nested makefiles). That's
+needed for programs that reports errors giving relative names. The problem
+was that when using spanish messages the editor got confused. Now the
+editor tries with english and if it fails tries translating it. Currently
+only english and spanish are supported but that's done with the .mo file
+so any language can be supported without recompiling.
+* Fixed: The GNU errors parsed was fulled by some gcc messages like it:
+In file included by .....:line:\n
+Now those lines are discarded.
+
+Revision 1.361 2001/08/31 19:32:09 set
+* Modified: Now if the terminal have a fixed code page that we know and
+can't be changed then the editor disables the recoding mechanism. That's
+true for terminals like xterm (enhanced VT100).
+
+Revision 1.360 2001/08/31 19:30:01 set
+* Added: Perl function parser to the bufun.cc mechanism. Also added more
+information to the bufun.h file.
+
+Revision 1.359 2001/08/29 23:41:50 set
+* Added: A shell option to the Linux version. I ever thinked it wasn't a
+good idea but a user asked for it. Sugested by David Xu
+<davidx@viasoft.com.cn>.
+
+Revision 1.358 2001/08/29 20:31:25 set
+* Modified: Now when a file that was stored in the desktop file no longer
+exists the editor doesn't open an empty window. Sugested by Martijn
+Versteegh <m.versteegh@hccnet.nl>
+
+Revision 1.357 2001/08/29 16:39:42 set
+* Added: Now is possible to specify the Turbo Vision library and includes
+path as parameters for the configuration script. That's useful for systems
+with prefixes like /opt. Sugested by Joel Soete <joel.soete@freebel.net>.
+
+Revision 1.356 2001/08/29 00:40:50 set
+* Fixed: When jumping to another manpage double clicking the name of the
+new one the window didn't update their title.
+* Fixed: A bug introduce in the last changes to the manpage viewer. I was
+releasing twice the name of the temporary stderr file (because librhtv
+deletes it internally).
+
+Revision 1.355 2001/08/28 18:37:24 set
+* Added: Sources of gettext 0.10.39 configured to avoid libiconv. They are
+intended for DOS users that doesn't have gettext installed or want to get a
+much smaller executable (like me). I decided it after a discussion in the
+djgpp-workers list, even the DOS porter of gettext Juan Manuel Guerrero
+<st001906@hrz1.hrz.tu-darmstadt.de> sugested it for the editor's case.
+.
+Revision 1.354 2001/08/28 14:32:16 set
+* Added: Support for gettext 0.10.37 and newer that needs libiconv. I tested
+it with 0.10.39 and 1.7. Even when that's supported the result is quite bad,
+for the DOS target the binary grows 829 Kb and when compressed 614 Kb. That's
+unacceptable. The size of the compressed editor is currently about 480 Kb and
+grows to 1094 Kb.
+
+Revision 1.353 2001/08/27 20:37:06 set
+* Modified: Removed the bufun.h inclusion in ced_exte.h to reduce
+dependencies.
+* Fixed: If the errors.cle file wasn't there the editor crashed when you run
+external programs. Reported by Grzegorz.
+.
+Revision 1.352 2001/08/27 19:37:44 set
+* Modified: I moved all the bufun.cc definitions to an independent header
+called bufun.h. Also renamed the buffers and exported them so other parsers
+can reuse it.
+* Added: Now the Clipper parser detects the last line of functions and also
+adds information to the name indicating if the function is a procedure and
+if the static qualifier was used.
+.
+Revision 1.351 2001/08/26 00:36:52 set
+* Added: Now the jump to function mechanism (bufun.cc) can support languages
+other than C/C++. I added Clipper support and Grzegorz is working on a LaTex
+parser.
+.
+Revision 1.350 2001/08/16 01:28:18 set
+* Added: A patch to avoid problems when including ced_clas.h twice. From
+Robert.
+* Fixed: A problem in the libset library used by RHIDE. Now rhideint.cc
+must provide EdJumpToMessage(), currently is just a dummy.
+
+Revision 1.349 2001/08/14 22:56:21 set
+* Added: A comment about buggy GeForce BIOSes in the Win/DOS FAQ. They seems
+to have similar bugs to Matrox BIOSes. Thanks to Andy <Bitland@aol.com>.
+* Added: A button to the function list called "Browse". It sends the list of
+functions to the message window sorted alphabetically or by line number and
+then you can browse the source code jumping from function to function.
+Sugested by Grzegorz Adam Hankiewicz <gradha@iname.com>.
+It added a new parameter to SelectFunctionToJump.
+* Added: Now when the user have one central desktop file the editor makes a
+back-up of it before writing a new one. This is quite useful for Windows
+systems that likes to crash and corrupt files. Sugested by S. M. Halloran
+<mitch@duzen.com.tr>.
+.
+Revision 1.348 2001/08/14 17:51:12 set
+* Fixed: InfView's search dialog was broken due to aligment in the
+TFindInfDialogRec structure. Now is marked with pack(1) to avoid it, I guess
+that's something new with gcc 2.95.x.
+.
+Revision 1.347 2001/08/14 00:56:24 set
+* Fixed: [Linux] When a manpage didn't exist Linux's man outputs to stderr
+a message. In the past the editor missed it giving no help to the user and
+also letting an error file in the home directory. Now stderr is also
+redirected and if stdout is empty stderr is shown. Reported by
+"GiBa" <giba@lacasilla.com.ar>.
+* Fixed: utod.pl again.
+* Modified: The makefile so makes/linux/compress.pl doesn't need to be
+executable (CVS likes to forget it because my CVS in a fat32 partition).
+
+Revision 1.346 2001/08/13 23:16:50 set
+* Fixed: A bug in "Intelligent C indent". A parenthesis after a / was not
+counted leading to wrong indentation. I hope the new code really fixed it
+without breaking other detail.
+.
+Revision 1.345 2001/08/13 22:38:37 set
+* Modified: To make recode happy now the CP850 files are ever converted to
+DOS format (not only in Linux). I made utod.pl more reliable too.
+* Added: SHL for .po files.
+* Added: German translations, thanks to Oliver Schieche
+<oliver.schieche@d2mail.de>. Also added it to the Linux and DOS distribution
+and to the installer (was tricky).
+* Added: All the Turbo Vision messages to the translations, so I updated the
+spanish translation.
+* Fixed: The message window scrolled horizontally only 255 columns and lines
+are allowed to be 1000 columns (then are wrapped). So now you can fully
+scroll upto 1000 columns.
+.
+Revision 1.344 2001/08/13 18:13:21 set
+* Added: Preload to C/C++, Perl and Makefile SHLs.
+* Added: Objetive C and PDP 11 assembler SHLs contributed by Beni Cherniavsky
+<cben@crosswinds.net>.
+* Added: Preload keyword to the .shl SHL.
+* Added: The Emacs mode for .frt files as "sdg", also added to a couple of
+.frt files because they generate files with "texinfo" markers confusing the
+editor.
+* Added: link and mailto commands to the html.frt as sugested by Florian
+Xaver.
+.
+Revision 1.343 2001/08/13 17:30:24 set
+* Modified: Now the keywords of the syntax highlights aren't loaded at
+start-up, intead they are loaded on demand. The keywords and the search
+tables are the most memory consuming parts of the syntax highlight structure.
+* Added: A Preload keyword to force the most commonly used SHL keywords to be
+loaded at start-up.
+* Fixed: Added to the distribution a file I forgot in the upload of the last
+beta.
+.
+Revision 1.342 2001/08/12 17:50:39 set
+* Compiled with BC++ 5.5:
+* Added: A comment in BC++ 5.5 port making explicit where should be TV
+located.
+* Fixed: A use of variable size array in ceditor.cc (AllocLocalStr now)
+(Win32).
+* Fixed: Use of strcasecmp without Uses_string (Win32).
+.
+Revision 1.341 2001/08/12 16:07:46 set
+* Merged patches from Andris addressing compiling issues when using gcc 2.97
+and newer releases:
+1) #endif at the end of files must have a new line character at the end.
+2) strlen and other internal functions now needs #include <string.h>
+3) The need for ## concatenation in macros is no longer needed when symbols
+are around the variable and now is deprecated. I left the old code (disabled)
+just in case it breaks very old gcc releases so we can just make it
+conditional.
+4) Is no longer valid to cast a pointer to a smaller integer, so now two
+consecutive casts are needed, one to convert the pointer into an integer and
+another to cut down the integer. This is used in the keyboard routines where
+collections uses void * to store 16 bits unsigned values.
+* Added: Support for ".inf.gz" extension (from Andris patch)
+.
+Revision 1.340 2001/08/11 01:40:17 set
+* Added: CommentIndent command, it indents a block with the EOLCom1
+definition. Sugested by Thiago.
+* Added: CommentUnIndent, it unindents a block using the length of EOLCom1 as
+reference. Sugested by Thiago.
+* Fixed: UnIndentBlock failed to update the syntax highlight, it was clear
+after removing the comments in the block.
+* Fixed: The undo of the arbitrary indent used the starting selection instead
+of the final one generating problems for long blocks.
+
+Revision 1.339 2001/08/10 02:50:36 set
+* Added: sLisp commands:
+ OpenFile: opens a file as a new window. (Asked by "Thiago F.G. Albuquerque"
+ <tfga@zaz.com.br>)
+ length: returns the length of a string.
+ strcasecmp/strcmp: compares strings.
+ Operator -: for integers.
+* Added: these new commands to the syntax highlight and documentation (also
+strstr).
+.
+Revision 1.338 2001/08/05 23:35:46 set
+* Modified: The way the PREFIX is passed to the compress scripts to allow
+the main makefile to generate the distribution. It should be reworked.
+.
+Revision 1.337 2001/08/04 23:41:01 set
+* Added: New configuration option to avoid using FHS structure and set it
+for my configuration.
+* Added: Distribution targets to the main makefile they pass the FHS
+options to the makes/Makefile.
+* Modified: The way the es_iso.po file is created to avoid stupid problems
+from recode. The recode and gettext are generating problems all the time.
+
+Revision 1.336 2000/12/09 21:32:42 set
+* Merged changes from Anatoli for the BC++ configuration process. Also makes
+pmacros files support DOS format in UNIX.
+* Added: Comments in the FAQ about Cirrus boards that have problems under W9x
+* Updated: the WinNT/readme.txt file to reflect the actual process.
+* Fixed: The 'D' shortcut was used twice in the redmond.smn for the File
+menu. Reported by Jeremy W. Murphy <jwm@amc.com.au>.
+* Added: A dialog asking if a compressed file saved with "save as" should be
+also saved compressed. Reported by Gregorio.
+* Added: A TODO file.
+* Fixed: More conflicts between gettext and conio.
+* Fixed: Now when closing a project the window title (of the application)
+reverts to "No project loaded". Reported by Jeremy W. Murphy <jwm@amc.com.au>.
+* Fixed: Compilation problems when PCRE wasn't available.
+.
+Revision 1.335 2000/08/09 23:30:23 set
+* Fixed: The editor didn't preserve the UID/GID of files when creating
+back-ups.
+* Fixed: When loading some old desktop files with black palettes (created by
+some really old versions of the editor) you got a black screen. Now the editor
+checks for such a silly situation and reverts to the default palette.
+.
+Revision 1.334 2000/06/27 02:37:03 set
+* Modified: Now using gettext 0.10.35.
+* Modified: Now using RHIDE 1.4.7.6.
+.
+Revision 1.333 2000/06/27 01:16:08 set
+* Fixed: Some pmacros needed "back space unindents" *NHP*.
+* Modified: Now using bzip2 v1.0, it is supposed to be more bullet-proof when
+uncompressing garbage. Thanks god I included it directly because the
+function names changed from 0.x to 1.0 (added BZ2_ prefix).
+.
+Revision 1.332 2000/06/13 23:36:49 set
+* Added: Warning about Creative PCI boards not supported by Allegro.
+* Modified: TMixDiag constructor to avoid calling gettext inlined because
+gcc 2.95.2 doesn't like it. I suspect that's a bug in gcc because 2.7.x and
+2.8.x doesn't reject it.
+* Added: A desktop lock while parsing the errors output from external
+programs to reduce the redraw. Linux's frame buffer is poorly implemented and
+have a really bad performance producing amazingly huge delays. Reported by
+Grzegorz.
+.
+Revision 1.331 2000/06/06 00:49:03 set
+* Added: A check and warning for/by makeinfo during configuration.
+
+Revision 1.330 2000/06/06 00:41:40 set
+* Added: A check for xgettext in the configuration script and a warning if
+recode isn't installed.
+
+Revision 1.329 2000/06/06 00:19:36 set
+* Fixed: Now the configure tells if recode wasn't found.
+* Fixed: Warning in menuload.cc with gcc 2.7.2.3.
+* Ignored doc/Makefile in the CVS.
+
+Revision 1.328 2000/06/04 18:37:36 set
+* Added: Now all modes are supported in the Mode setence used by the pmacros.
+* Added: Now the $if command supports and/or operators for menu files.
+* Added: The MP3 list can be loaded/saved as a WinAmp M3U list.
+.
+Revision 1.327 2000/05/25 19:12:56 set
+* Added: An option to configure the BC++ port to generate a dynamic/static
+executable.
+* Fixed: Now when passing a list of files to grep the filenames are quoted to
+avoid problems with file names containing spaces. Reported by Grzegorz.
+* Modified: The check to see if grep is installed. It now checks for GNU grep
+to avoid problems with other implementations. In particular Inprise version
+that is quite far from POSIX.
+* Warning: I discovered that BC++ and MingW libraries have a really buggy
+system function, it can just crash Windows 95 misserably when passing long
+command lines, lets say 3.5 Kb. It can affect the editor stability.
+.
+Revision 1.326 2000/05/25 15:21:33 set
+* Added: Now the configure mechanism generates the BC++ makefiles. With it
+all the targets now uses the information found in the .gpr files to compile.
+It means I just need to keep updated the list of files to include in the
+distribution, all the other makefiles are generated from RHIDE's projects
+(djgpp/Linux/Win32 directly and BC++ indirectly).
+.
+Revision 1.325 2000/05/22 23:49:30 set
+* New: Now the MingW port uses the same makefiles than the DOS and Linux
+targets. It means this port will be quite updated without taking special
+care.
+* Modified: Now the configure script doesn't overwrite the configed.h file if
+it wasn't changed. That's good to avoid a masive recompile when it isn't in
+fact needed.
+* Updated: The configuration library with changes in the TV version of it.
+* Added: A mechanism to change more variables in RHIDE makefiles from the
+configure script.
+* Fixed: EasyDiag's TSTextScroller size.
+* Modified: Now the about box have a TSTextScroller because I added thanks to
+Vadim and Anatoli.
+.
+Revision 1.324 2000/05/20 13:19:03 set
+* New: Now thanks to changes from Anatoli Soltan merged in TV the exe
+generated with BC++ runs under Win95 and NT.
+* Added: Configuration mechanism to support the new syntax of recode 3.5. It
+also allows to make the editor in machines without recode.
+* Added: Code to the configuration library to generate makefiles from
+templates of makefiles doing some search & replace.
+* Merged small changes from Anantoli Soltan to the BC++ makefiles. They allow
+creating the help file (makeinfo for Win32 is shipped) and installing the
+compiled files.
+* Added: A couple of new pmacros to Clipper.
+* Fixed: The BC++ errors parsing definition (errors.cle).
+* Fixed: A table in the manual (strftime options).
+* Fixed: Now sdh.c uses getcwd (no getwd) because (a) getwd is deprecated (I
+saw it in Linux and Oswald Buddenhagen <ob6@inf.tu-dresden.de> asked to fix
+it) and (b) getwd doesn't exist for BC++ so Anatoli sent patches to replace
+it. Now the compatlayer is used for it.
+* Fixed: The generation of .html files from the .txt ones. Now < and > are
+replaced. Reported by Neil Parks <nparks@torah.org>.
+* Fixed: When following a list of errors/hits with Alt+F8 in some cases the
+previous hit wasn't cleared.
+.
+Revision 1.323 2000/05/17 23:09:36 set
+* Modified: Some details in EasyDiag: OK+Cancel buttons to work in growable
+dialogs and xTSRight,xTSLeft and xTSLeftOf calculations (hope nothing got
+screwed).
+* Modified: Now the list of functions lists members like this "member
+(class)" instead of C++ syntax "class::member". It makes the incremental
+search much more simple.
+* Modified: The list of functions and list of windows now have horizontal
+scroll bar. Also: they are EasyDiag dialogs now.
+.
+Revision 1.322 2000/05/16 02:10:23 set
+* Fixed: A crash when deleting all the items (and one more ;-) in the MP3
+list. Only happend if you did it very quickly.
+* Added: An horizontal scroll bar to the MP3 list dialog.
+* Added: Now easydiag list boxes can have two scroll bars. I modified TV a
+little bit to make it easier.
+.
+Revision 1.321 2000/05/16 00:17:29 set
+* Fixed: The error pattern description for Borland C compilers. Now it works
+for BC++ 5.5. Grzegorz reported problems and I fixed it.
+* Added: clear keyword to the HTML syntax. Suggested by Grzegorz.
+* Fixed: The syntax hl for shell scripts needed EscapeAnywhere=1. Reported by
+Grzegorz.
+* Added: SQL syntax. Contributed by Jeremy W. Murphy <jwm@amc.com.au>.
+* Fixed: The editor added read-only copies to the list of closed windows when
+closing one of them. It produced a crash when opening the file from the
+closed list. Reported by Volker Kiefel"<volker.kiefel@med.uni-rostock.de>.
+.
+Revision 1.320 2000/05/15 01:00:28 root (set)
+* Added: Palette support to the Linux version. Also changed the palette
+values to be 0-255 instead of 0-63 to be more generic. Lamentably it looks
+like Linux people forgot to add a get palette sequence, is that correct? if
+all half done?
+
+Revision 1.319 2000/05/13 19:58:38 set
+* Added: A new option that forces the editor to do the match pair 'on the
+fly' without waiting for idle. Suggested by Oswald Buddenhagen
+<ob6@inf.tu-dresden.de>.
+* Modified: Now backspace behavior is not tied to the Real Tabs option. It
+have your own option. It was suggested by others in the past but Oswald
+finally made me do it ;-)
+* Updated: The documentation to reflect all the new modes.
+* Modified: accehtml.cc line 31 to workaround a bug in egcs (doesn't like
+calls to static members specifying an object!).
+* Fixed: Now if you have two functions with the same name SDG will list both
+in the index. Reported by Gregorio.
+* Modified: Version to 0.4.45.
+.
+Revision 1.318 2000/05/12 23:16:40 root (set)
+* Fixed: The configure script was looking for the dinamic TV when static was
+specified.
+* Fixed: infbase.cc request of filelength.
+
+Revision 1.317 2000/05/12 02:19:46 set
+* Incorporated the Win9x and WinNT versions. The WinNT version was introduced
+thanks to Anatoli Soltan <anatoli@iname.com> and is for BC++ 5.5 compiler.
+* Moved some stuff to a new library (part of TV now) and will move even more
+things. The idea is to avoid an excess of conditionals. This introduced
+changes in almost all sources.
+* Adapted to compile with MingW32 for Win32.
+.
+Revision 1.316 2000/04/29 17:55:05 root (set)
+* Modified: Gave 2 more rows for the mixer sliders.
+* Modified: Added more description to the mixer name.
+
+Revision 1.315 2000/04/29 17:04:55 set
+* Added: Board level sound mixer. As this is something I want and not all the
+people seems to agree that this is desirable I added options to: (a) disable
+it at compilation time (HAVE_MIXER and --without-mixer) and (b) a run time
+option (command line --no-mixer). Under DOS only SB Pro and SB 16 compatible
+mixers are supported. Under Linux OSS mixer is supported. The values can be
+optionally stored in the desktop file.
+* Changed: I synchronized the configuration library with the one used by TV.
+* Added: A new EasyDiag object called TSSlider. Is used for the volume
+settings in the mixer's dialog.
+* Fixed: A GPF when the editor was stopped during a list play operation and
+it was restored in another run.
+* Fixed: A small detail in mpegsound from 0.8.3 new version.
+.
+Revision 1.314 2000/04/20 19:16:19 set
+* Added: </li keyword to HTML syntax. Suggested by Grzegorz.
+* Added: A new option: Don't purge spaces. When enabled the spaces at the end
+of lines aren't automafically deleted by the editor. Suggested by Martijn
+Versteegh <versteegh@kvi.nl>, wasn't the first user.
+* Added: Warning about bugs in xgettext in the makefile.
+* Updated: The spanish traslation.
+.
+Revision 1.313 2000/04/16 20:17:03 root (set)
+* Added: MP3 support to the Linux version.
+
+Revision 1.312 2000/04/16 18:23:34 set
+* Added: A new library for MP3 files. That's the library used by Linux's
+splay. I added support for MP3s inside wavs, damaged MP3 files, VBR encoded
+files and more to this code. Users should consider it under test.
+* Added: The mpegsound library to the configuration process. I keep libamp
+and is possible to choose between the two engines.
+* Fixed: The use of 2 sets of flags in the .mak files (one from the
+RHIDE_OS_FLAGS and the other from CFLAGS).
+* Added: A set of C/C++ flags for parts of the project that needs strong
+optimization, like the MP3 engines.
+* Fixed: Some problems with the version of the information stored for closed
+files. It wasn't present in releases, just in WIP versions.
+* Fixed: Bug in relative paths interpretation of the code that parses
+messages from external programs.
+
+Revision 1.311 2000/04/13 00:37:46 root (set)
+* Updated: .gpr file and sources for the new TV dependencies (tv/...).
+* Updated: version.txt file.
+
+Revision 1.310 2000/02/27 20:14:19 set
+* Added: Now tab size, indent size and wrap column are stored for closed
+files and project items.
+* Fixed: InfView now doesn't hang if the node can't be found.
+* Added: InfView now looks in all the file if the node isn't found in the
+first try. It helps for handedited/damaged info files I saw it in files that
+David Cabanillas Barbacil <davidc@ibernet.com> sent me (GPC help files).
+.
+Revision 1.309 2000/02/27 18:52:13 set
+* Added: Yet another tab option: Now is possible to indent using spaces but
+also using an indentation ammount different than the tab size. The new option
+is called "Use indent size" and you can also configure the value of "indent
+size". In this way is possible to code like Allegro's guidelines say:
+"Basic Allegro style: K&R, with 3 space indentation. On disk, though, tab
+stops are 8 spaces, so if for example a line was indented by 12 spaces, this
+would be saved out as either 12 space characters or 1 tab and 4 spaces, not
+as 4 tabs.". It was proposed by Martijn Versteegh <versteegh@kvi.nl>.
+* Modified: As a result of these new settings now we have 17 global flags, it
+overflowed the traditional TV limit of 16 bits. To overcome it I added a 32
+bits version of radio buttons and check boxes to TV. It isn't the final
+solution because I think these dialogs really need a new layout. Anyways, as
+I think 32 bits is more suitable for gcc now the editor uses 32 bits options
+in all places. To achieve it I was forced to modify a lot of structures and
+dialogs. Tested most of them, I hope no bugs were introduced.
+* Modified: As a result of this I did a cleaning job in the editor dialogs. I
+added some EasyDiag goodies: a new TSViewCol constructor that creates a
+default dialog (that's the most common case), a variation of doIt that sets
+the dialog as centered and configures the help context (doItCentered), a new
+positioning option yTSUpSep it puts the object on top of the dialog but
+letting some space between the frame and the object and multicolumn radio
+buttons and check boxes. Now EasyDiag also defaults to 32 bits options, it
+can be disabled defining Dont_Use_32Bits_Clusters. I also added a callback to
+TV buttons and modified TSButton to reflect it. yTSUp was fixed.
+* Modified: Version to 0.4.43.
+.
+Revision 1.308 2000/02/24 23:10:40 set
+* Fixed: Applied some patches from Alex Lozano for EasyDiag. They fix
+problems with xTSLeft and yTSOver (I don't usually use them). I applied one
+of the patches with a small variant.
+.
+Revision 1.307 2000/02/23 00:31:22 set
+* Added: A new option in Search & Replace, it shows the name of the function
+where the match was found (only for C/C++ and if the match is inside).
+Suggested by Jeremy W. Murphy <jwm@amc.com.au>.
+* Modified: Version to 0.4.42 (change in S&R flags).
+.
+Revision 1.306 2000/02/22 01:25:57 set
+* Added: A new command called cmcWhichFunctionIs. It determines the name of
+the function where the cursor is positioned. It isn't the fastest thing in
+the world because it collects the list of all functions, but as bufun.cc is
+really fast I think that's ok. It isn't associated to a key. I also commented
+how the magic heuristic of bufun.cc works. This addition is the first step
+to create a mechanism suggested by Jeremy W. Murphy.
+.
+Revision 1.305 2000/02/22 00:12:46 set
+* Fixed: When using the match pair on the fly the editor always forced a line
+flush even if the cursor weren't in a potential match. Now that's done only
+if the cursor is over {, }, (, ), [ or ]. A side effect of this behavior was
+reported as a bug by Martijn Versteegh <versteegh@kvi.nl>.
+.
+Revision 1.304 2000/02/21 23:57:39 set
+* Fixed: When loading .dst files older than 0.4.32 the memorized flags for
+closed files were converted in the wrong way. Some times enabling the cross
+cursor.
+.
+Revision 1.303 2000/02/21 23:21:49 set
+* Fixed: Small typos in new documentation.
+* Fixed: Uninitialized data in the cross cursor stuff that could generate
+GPFs.
+.
+Revision 1.302 2000/02/13 21:48:02 set
+* Added: a new command (LineOrScrEnd), that's 100% equivalent to VI's g-end.
+The previously added (LastColInScreen) isn't 100% equal. The new one doesn't
+go to the last column of the screen if the end of line is first. Information
+provided by Leon <Leon@caresystems.com.au>.
+.
+Revision 1.301 2000/02/13 21:26:57 set
+* Added: Now the calculator supports commas like in C code. Patch from
+Burton. I also documented more details of the new calculator.
+* Fixed: The >= of the calculator had a typo that prevented it to work.
+.
+Revision 1.300 2000/02/13 20:55:18 set
+* Added: shtml files to the html syntax. Suggested by Gregorio.
+* Added: Real support for Texinfo 4.0's Ref: references. They jump to the
+correct node and positions the cursor at the right line.
+* Added: Now is possible to have two files with the same file name in
+projects if they are different files (from different directories). After some
+talk with Gregorio.
+.
+Revision 1.299 2000/02/13 14:01:11 set
+* Added: Now the list of functions takes the word under cursor including
+colons. That's needed for C++. Suggested by Alex.
+* Added: Now the list of functions is more cleaver and looks for C++ members
+with the name of the word under cursor if no function with this name was
+found.
+* Fixed: Some potential GPF and fails to update the new entries in the user
+words.
+* Fixed: GPFs produced by the column and row cursors when the cursor was
+outside the visible area.
+.
+Revision 1.298 2000/02/05 21:44:25 set
+* Fixed: Some spelling errors (remmember, allready and latter). Reported by
+Bernd Becker <munin@munin.inka.de> and Philip (FireEgl) <FireEgl@EMail.com>.
+* Added: Now double clicking in Alt+0 window is the same as pressing the Go
+button. Suggested by Philip (FireEgl) <FireEgl@EMail.com>.
+* Fixed: ESC doesn't reset the palette to defaults in the palette dialog.
+Reported by Philip (FireEgl) <FireEgl@EMail.com>.
+* Modified: Now the FileOpen dialog used in the project and MP3 list says
+"Done" instead of "Cancel". Suggested by Waldemar Schultz
+<schultz@ma.tum.de>.
+.
+Revision 1.297 2000/02/03 01:19:08 set
+* Modified: The version of some tools I use in the README.
+* Added: [Linux] Explanation to one posible source of "can't open terminal"
+error in the FAQ.
+* Fixed: [InfView] Now "Open InfView" works even if no InfView window is
+opened. Reported by Ivan.
+* Modified: All the needed places to support the new location of TV headers.
+It changed the dependencies.
+.
+Revision 1.295 2000/01/26 00:41:53 set
+* Added: Now InfView also looks for .info.bz2 and .bz2 files. So entering
+(editor) InfView will try to load editor.bz2 and editor.info.bz2. Only when
+bzip2 support is compiled.
+.
+Revision 1.294 2000/01/26 00:25:10 set
+* Fixed: A small error in the MSVC errors parsing. Pointed out by Grzegorz.
+* Added: Now the editor alters the W9x window title adding information about
+the version and loaded project. That's what "Jeremy W. Murphy"
+<jwm@amc.com.au> originally suggested. I do it in a way that it isn't
+permanent, even if the program crashes.
+.
+Revision 1.293 2000/01/22 17:57:49 set
+* Added: A new calculator parser from Burton Radons. It adds conditionals,
+variables definitions and function definitions. The old parser and a small
+version of this new one can be selected during configuration.
+.
+Revision 1.292 2000/01/20 00:55:20 set
+* Updated: Copyrights for year 2000.
+* Added: Copyright of bzip2 and knowledgement in the about box. Also for
+Zlib.
+* Added: Jump to last column, it could need some adjusts. Is supposed to be
+the equivalent of g-end in VI. Suggested by Leon <Leon@caresystems.com.au>.
+.
+Revision 1.291 2000/01/18 00:01:42 set
+* Added: Configurable status line. So now is possible to configure all the
+keys used by the editor, specially Copy/Paste in input lines. Dean Limbaugh
+<edl@ns1.co.alachua.fl.us> and Bernd Becker <munin@munin.inka.de> were two of
+the users that asked for it, I just don't remember the rest.
+* Added: Transparent support for bzip2 compressed files. It works for regular
+files and info files. The info file should have the same extension used by
+gz. I know Mandrake uses bzip2 compressed info files but don't know the exact
+name so I guess it will need some adjusts. It also means the executable is
+larger. And the memory requirements for saving bzip2 files are big. I added
+it after a report from Salazar <jsalaz3@almez.pntic.mec.es> talking about
+problems with Mandrake 6.0.
+
+------------------------------------------------------------------------------
+v0.4.41 14th public release.
+
+Revision 1.290 2000/01/02 19:31:56 set
+*Fixed: Problems with project files. Reported by Ryan Owen <ryan@eyring.com>.
+.
+Revision 1.289 2000/01/02 16:40:06 set
+* Adjustemnts to release v0.4.41.
+.
+Revision 1.288 1999/12/31 16:41:06 set
+* Modified: more details to workaround bugs in makeinfo 4.0 related to the
+Table Of Contents.
+.
+Revision 1.287 1999/12/31 15:16:22 set
+* Added: A new menu option to save the project manually. Suggested by
+"Jeremy W. Murphy" <jwm@amc.com.au>
+.
+Revision 1.286 1999/12/29 23:46:37 root (set)
+* Fixed: Abort when pressing ENTER in the message window without items.
+
+Revision 1.285 1999/12/29 23:25:27 root (set)
+* Fixed: [Linux] A bug introduced in 1.209/10 revisions when saving files
+in DOS format. Reported by Gregorio.
+
+Revision 1.284 1999/12/29 00:56:53 set
+* Added: Now the project window also says the name of the project file.
+Suggested by "Jeremy W. Murphy" <jwm@amc.com.au>.
+* Applied: Changes to the Debian packaging files. Now the infview can be
+generated as another package. From Ivan.
+
+Revision 1.283 1999/12/21 23:49:11 root (set)
+* Fixed: A bug in sLisp when handling strings with escape sequences
+(\n, \t, etc.). Probably introduced in 1.187. Reported by Uwe Steinmann
+<steinm@majestix.fernuni-hagen.de>.
+
+Revision 1.282 1999/12/19 21:48:31 root (set)
+* Added: Now you can pass extra command line options using an environment
+variable called SET_CMDLINE.
+
+Revision 1.281 1999/12/19 19:57:20 root (set)
+* Added: Support for .info files created with texinfo 4.0 that includes Ref:
+tags in the indirect table. I didn't investigate how they work but the files
+can be used.
+* Added: Support for makeinfo from texinfo 4.0 to generate the documentation.
+I needed to fool makeinfo adding an extra @contents at the top of the txt
+file, don't know why. Reported by Ivan who is using Potato (Debian 2.2).
+* Added: New command line option +[line number], like in VI. Suggested by
+Ivan, looks like some tools uses it, in this way we can just replace VI by
+SETEdit when using these tools.
+
+Revision 1.280 1999/12/05 16:16:42 root (set)
+* Added: Now when calling the man page viewer the editor offers the word
+under cursor as man page.
+
+Revision 1.279 1999/12/05 15:34:18 root (set)
+* Modified: Version to 0.4.41.
+* Fixed: [Linux] When switching from hidden to normal desktop files the
+editor left the hidden version of the desktop file generating potential
+confusions. Now the hidden file is removed. That's i just another annoyiance
+of the silly hidden files mechanism.
+* Modified: [DOS] Now the editor also looks for HOME and HOMEDIR when loading
+configuration files. Also: the directory where the exe is located is the one
+looked at last.
+.
+Revision 1.278 1999/11/30 00:25:25 set
+* Fixed: The ~K~eep short-cut in the SDG options was used for O~K~. Reported
+by Gregorio.
+* Modified: Now the message window shows ^M if the line contains /r.
+.
+Revision 1.277 1999/11/29 23:33:31 set
+* Fixed: GPF/SIGSEGV when using BackSpace in the functions list to delete the
+first letter in the incremental search. Reported by Gregorio.
+.
+Revision 1.276 1999/11/21 21:25:58 set
+* Added: Configurable mechanism to parse the errors collected from an
+external application. It uses Perl RegEx to do the job. Suggested by
+Gregorio.
+.
+Revision 1.275 1999/11/21 14:37:44 set
+* Added: A new shl flag "EscapeAnywhere" this switch makes the editor parse
+the escape character outside strings.
+.
+Revision 1.274 1999/11/21 12:49:57 set
+* Changed: The way the INFOPATH is guessed under DOS. A djgpp user installed
+the editor outside the djgpp tree and then the editor used INFOPATH but
+failed to find the setedit.inf file. Now the editor also adds your tree even
+if INFOPATH is defined. Reported by Sylvia <smlew@ifocus.com.sg>.
+.
+Revision 1.273 1999/11/20 15:28:44 set
+* Fixed: When inserting items to the project the editor used the *.epr mask
+instead of the one used to open regular files. Reported by Gregorio.
+.
+Revision 1.272 1999/11/20 14:41:23 set
+* Added: Syntax highlight for PLM/51 contributed by Jari Korhonen
+<jari.korhonen@ponsse.fi>. (Intel's long-gone not-so-highlevel language for
+8051 CPUs).
+.
+Revision 1.271 1999/11/05 00:28:59 set
+* Fixed: [DOS] Compilation problems with gcc 2.95 in the plasma stuff.
+* Added: [Linux] ISO-8859-1 spanish messages.
+.
+Revision 1.270 1999/10/30 20:50:55 root (set)
+* Added: Spanish messages to Linux distribution, that's the first try and
+needs more work.
+
+Revision 1.269 1999/10/30 15:30:38 root (set)
+* Added: A command line switch to specify files to load from an external list
+of files where each line is a file. Suggested by SpaZe.
+
+Revision 1.268 1999/10/30 14:51:41 root (set)
+* Added: New command line switches to the --help help and the man page.
+
+Revision 1.267 1999/10/30 14:40:57 root (set)
+* Modified: Now if you use "load only specified files" the editor doesn't
+really load the files to then close'm like before. Now the TCEditor class
+have a special flag to simulate the load without actually loading the file
+content. Only the InfView windows are actually loaded. It makes things
+faster.
+* Added: Three command line switches: --tile-vert, --tile-horiz and --cascade
+to make these operations after loading the files from the desktop file or
+named in the command line. Suggested by Spaze.
+
+Revision 1.266 1999/10/30 13:34:38 root (set)
+* Modified: Now the new option to search the word when you press ^F1 inside
+the node takes the visible name you choose from the list and not the word
+under cursor. Suggested by Gregorio.
+
+Revision 1.265 1999/10/29 01:48:14 root (set)
+* Added: [Linux] call to dch to update the Debian version during the package
+creation. Suggested by Ivan.
+* Added: [Linux] InfView man page. Pointed out by Ivan,
+
+Revision 1.264 1999/10/29 00:54:28 set
+* Added: The reverse operation for "HTML accents". Suggested by Gregorio.
+.
+Revision 1.263 1999/10/26 00:04:43 set
+* Added: [Linux] Now the convert HTML accents feature also works in Linux,
+was just matter of enabling it.
+* Added: Now the file open dialog is resizeble. Suggested by Gregorio.
+* Modified: [Linux] Now the editor disables the Xon/Xoff mode of the terminal
+so ^Q/^S aren't used for it. It enables the use of ^Q and ^S when running in
+an Xterm, Eterm, etc.
+.
+Revision 1.262 1999/10/23 19:50:08 set
+* Added: Yet another tab mode. "Tab indents", it is by default enabled
+because that's what the editor ever did. Disabling it the editor will behave
+like when using tabs but will insert spaces instead of tabs.
+.
+Revision 1.261 1999/10/23 18:51:04 set
+* Fixed: Crashes when starting the editor and it was playing an MP3 file that
+don't exists anymore.
+.
+------------------------------------------------------------------------------
+v0.4.39 13th public release.
+
+Revision 1.260 1999/10/17 15:01:18 set
+* Added: The spanish messages to the distribution.
+* Added: The installer uses spanish messages when the system is configured
+for it.
+* Prepared for a new release.
+
+Revision 1.259 1999/10/17 00:36:49 set
+* Added: Now the Alt+F2 functions serach can search C++ operators too. I hope
+it didn't break other thing ;-). Asked by Andris.
+.
+Revision 1.258 1999/10/16 01:13:04 set
+* Added: An option to make InfView search the word under cursor when you did
+a syntax search, but inside the selected topic. Hmmm... how to explain it,
+just use ^F1 and see. Suggested by Grzegorz Adam Hankiewicz <gradha@iname.com>
+* Added: Now you can use double click to select an item in the ^F1 list of
+hints. Suggested by Jeremy W. Murphy <jwm@amc.com.au>
+* Added: [Linux] The no/overwrite status is showed in the indicator (at the
+right of the modified star). Suggested by Dean Limbaugh
+<edl@ns1.co.alachua.fl.us>.
+.
+Revision 1.257 1999/10/15 01:56:05 set
+* Added: A new command to decode "quoted printable" text. I need it to
+demangle spanish mails in MIME format.
+* Added: A new indentation command that allows to indent with any arbitrary
+text. I need it to quote parts of mails (usually using "> ").
+* Added: These commands to the menu, documentation, context sensitive help
+and spanish translation. Also added the other indentation commands to the
+menu.
+.
+Revision 1.256 1999/10/14 01:17:33 root
+* Removed the libamp from the Linux distribution, it isn't needed and the
+copyright could produce some confusion.
+* Fixed: I forgot to add infview.mak to the list of makefiles to patch.
+* Fixed: A multiline crossreference in the documentation.
+.
+Revision 1.255 1999/10/14 00:12:25 set
+* Changed: kextend license to Public Domain so Debian purist can't complain.
+* Added: Now the linux.faq is also installed in the docs directory as
+faq.txt.
+.
+Revision 1.254 1999/10/13 23:47:39 set
+* Fixed: When using a central tcedit.dst file was possible to get the cursor
+unsynchronized with the no/overwrite mode. Reported by Grzegorz Adam
+Hankiewicz <gradha@iname.com>.
+.
+Revision 1.253 1999/10/13 00:49:19 set
+* Added: Redraw command to the editor (in menu and documented).
+* Updated: Debian files (from Ivan).
+* Documented: sLisp AskString.
+* Modified: Now the printer setup is saved/restored using i/opstream instead
+of fpstream to allow RHIDE save it. Patch from Robert.
+* Updated: Spanish messages.
+.
+Revision 1.252 1999/10/10 22:41:12 set
+* Added: sLisp command AskString, it pop-up a dialog asking for user input.
+* Added: Some documentation about the mouse under Linux. Suggested by Ivan.
+* Changed: The example of macro from menu is now more useful, it pop-ups a
+dialog and you can enter a command, the output of this command is inserted at
+the cursor position. Ivan asked for such an option from the menu.
+* Added: Now the sLisp InsertText function doesn't allow the insertion of
+text with \n and not \r\n under DOS (not well tested).
+
+Revision 1.251 1999/10/10 21:43:08 set
+* Fixed: Target all must be the first in the makefile.
+* Fixed: Target infview needs to be PHONY because doesn't have dependencies.
+* Added: Now plasmas are also in the makefile.
+* Fixed: Typo in windoldap.cc
+* Added: Now when jumping to a line with errors the editor ever highlights it
+and also shows the error in the status line.
+* Fixed: libamp can't be compiled with -Wall -Werro so pathenv.pl avoids it.
+* Added: When an external program returns errors the editor jumps to the
+first line in the message window. Also, the editor adds a message to know the
+control is back again in the editor.
+.
+Revision 1.250 1999/10/10 14:47:54 set
+* Added: DOS Greek keyboard support (code page 737). Requested by Pavlos to
+make accelerators work in both, english and greek, modes.
+* Updated: The list of available characters in the editor's fonts.
+* Added: Defaults for newer characters in the fonts.
+* Added: [DOS] The keyboard mode is saved => v0.4.38.
+* Fixed: One bug in the code page/fonts handling. Deleting a font twice.
+* Added: Support for the following code pages:
+ Latin: DOS 775, 857, 861; UNIX 8859-3, 8859-4, 8859-9, 8859-14, 8859-15;
+ Windows 1250, 1252, 1254, 1257
+ Cyrillic: KOI-8 CRL, ISO-IR-111/153/146/147, Mac CP10007 (and Ukraininan
+ variant), U-Code R, KOI-7, Osnovnoj Variant Russian,
+ Alternativnyj Variant RU.
+ Greek: DOS 737, 869; Windows 1253 and UNIX 8859-7
+ A total of 27 code pages!
+ Pavlos and Alexander Bokovoy provided information for greek and cyrillic
+ code pages.
+
+Revision 1.249 1999/10/02 21:48:12 set
+* Added: Basic TeX syntax highlight, contributed by Alexander Bokovoy.
+* Added: TCL syntax highlight, contributed by FireEgl <FireEgl@EMail.com>.
+* Added: Wrapper example for collecting Turbo Pascal 7.0 errors. Contributed
+by Andreas Leidner <leidner@gmx.net>.
+* Added: --libset option to the configure script, it creates targets in the
+makefile for libset.a (needed for RHIDE). Requested by Robert.
+* Added: InfView to the configure mechanism and --no-infview to avoid
+compiling it.
+* Modified: now the Makefile generated by configure script is more modular so
+you can do "make editor", "make infview", "make install-editor", etc.
+.
+Revision 1.248 1999/10/02 18:51:19 set
+* Added: New sLisp command ShortFileName. Needed to pass SFNs to external
+programs. Requested by Andreas Leidner <leidner@gmx.net> to pass files to
+Turbo Pascal 7.0.
+.
+Revision 1.247 1999/10/02 14:50:40 set
+* Fixed: A lot of warnings from gcc 2.95, don't know if all (const missing
+type, char * not const, assembler clobber lists, etc.).
+* Added: Now the code page remapping routines converts symbols not found in
+the destination code page to similar ones. Example: accented letter to same
+letter not accented. It works for latin symbols, now I'm waiting for
+Alexander's tables for cyrilic symbols.
+.
+Revision 1.246 1999/09/30 02:58:16 set
+* Added: Code page remaping. It should work for all the supported code pages.
+Documented, added to menues, translated to spanish, etc. I was thinking about
+adding it because I write some mails in DOS and then Alexander Bokovoy asked
+for it (for russian code pages, they are a mess). The last settings are
+stored in the desktop file so new version 0.4.37.
+.
+Revision 1.245 1999/09/29 00:39:39 set
+* Added: A new editor command called cmcCutClipWin to cut text to Windows
+clipboard. Suggested by Spaze. I also mention it in the documentation and
+give an example in redmond.smn about how to use the Windows clipboard instead
+of the internal one.
+.
+Revision 1.244 1999/09/29 00:08:02 set
+* Added: The emu387.dxe emulator so the editor can be installed in systems
+without coprocessor. Suggested and tested by "Eathan Clark"
+<eathan@cableone.net>.
+.
+Revision 1.243 1999/09/28 23:20:29 root (set)
+* Fixed: Now if the message window is outside the screen that's fixed at load
+time. I don't really know the reason for it but Gregorio and me experimented
+it. Is something related with running the editor with different screen
+resolutions. Reported by Gregorio.
+
+Revision 1.242 1999/09/28 23:06:39 root (set)
+* Fixed: [Linux] Paste in input likes failed. Reported by Ivan.
+* Fixed: When pasting in input lines not all the text was selected and the
+cursor wasn't well positioned.
+* Fixed: The new special character shl feature wasn't parsed by the
+multilines parser, only for the painting parser. Reported by "FireEgl
+(Philip)" <FireEgl@EMail.com>.
+* Added: Now if you double click over name(section) construction in a man
+page window the editor jumps to this manpage. Suggested by Ivan.
+
+Revision 1.241 1999/09/28 03:32:55 root (set)
+* Fixed: configure mechanism wasn't setting the static/dynamic exe correctly.
+* Removed debian/rhide.env from CVS and makes/lista.
+
+Revision 1.240 1999/09/28 03:03:07 root (set)
+* Applied patches for the Debian package from Ivan.
+* Fixed: The editor was creating a tcedit.dst file in /usr/share/setedit if
+you selected to save only one centralized file. That isn't correct, this
+directory could be read-only. If you want default options to be global for all
+the users you can copy tcedit.dst to /usr/share/setedit, but the editor won't
+save there; the HOME directory will be used instead. Reported by Ivan.
+* Fixed: debian/doc-base was missing in the distribution.
+* Fixed: Compilation problems with glibc 2.1.2 because the use of __USE_GNU
+instead of _GNU_SOURCE. Patch from Ivan.
+
+Revision 1.239 1999/09/26 20:30:43 set
+* Added: Jump to prototype command. That's very similar to jump to function.
+Suggested by Pavlos.
+.
+Revision 1.238 1999/09/26 16:34:58 set
+* Added: MP3's ID3 genre field to the MP3 dialog. "Pavlos" <gtoub@otenet.gr>
+provided the first 100 names and I added another 42 from WinAmp 1.90.
+.
+Revision 1.237 1999/09/26 15:15:35 set
+* Documented: The new match directives for SHL.
+* Added: A rudimentary SHL for Makefiles.
+.
+Revision 1.236 1999/09/26 14:35:08 set
+* Added: Conditional compilation for PCRE>=2.0 and <=2.05 from the configure
+script (was present manually).
+* Added: Now is possible to associate a SHL with a file name using regular
+expressions (PCREs). You can give regex to match the file name or the whole
+path+name. It is needed for things like makefiles and was asked by Ivan and
+Gregorio. (NameMatch and FullNameMatch).
+* Modified: Now the configure script for Linux can take any amount of
+parameters. Patch by Ivan.
+.
+Revision 1.235 1999/09/25 20:46:16 set
+* Fixed: An error in the configure script, it wasn't saving the version of
+the detected zlib (the code tested instead ;-))
+* Fixed: When adding new user words they wasn't visible until the next
+redraw, that's forced now.
+* Fixed: It was posible to save a block with the name of an opened file. Even
+when the editor issued a warning about overwriting a file it could have bad
+side effects.
+.
+Revision 1.234 1999/09/25 19:30:07 set
+* Added: Now is possible to indicate that EOLComment1 must be in the first
+column and EOLComment2 don't.
+* Added: Now is also possible to tell to the editor that an EOLComment is
+valid if it's located in the first non-blank character. Seems to be needed
+for TCL. Suggested by "FireEgl (Philip)" <FireEgl@EMail.com>.
+.
+Revision 1.233 1999/09/25 18:01:51 set
+* Fixed: [DOS] A bug in djgpp v2.02 libc system() function that left child
+exes opened leaking file handles and preventing external compilers to
+overwrite the file. It only happened for non-djgpp programs. "Andreas
+Leidner" <leidner@gmx.net>.
+.
+Revision 1.232 1999/09/25 16:52:49 set
+* Fixed: One define in windoldap.h file. Reported by Pavlos.
+* Fixed: An egcs warning (egcs bug) reported by Ilker Aksen
+<Ilker.Aksen@astrazeneca.com>.
+* Fixed: [DOS] Wrong manifest file name for InfView. Reported by SpaZe/ST
+<stealth.tech@seznam.cz>.
+* Fixed: Two typos (asigNment). Reported by Spaze.
+* Fixed: The "Test" button in screen savers dialog only worked if the screen
+saver was ON before entering in the dialog. Reported by Spaze.
+* Fixed: Wrong width of the dialog to choose a command. Reported by Spaze.
+.
+Revision 1.231 1999/09/25 16:34:57 root
+* Fixed: [Linux] The editor was creating userwords.txt and default settings
+in /usr/share/setedit instead of user's home. Reported by Ilker Aksen
+<Ilker.Aksen@astrazeneca.com>.
+* Fixed: [Linux] SIGSEGVs when using hidden desktop files. Reported by Ilker
+Aksen <Ilker.Aksen@astrazeneca.com>.
+
+Revision 1.230 1999/09/25 14:31:02 set
+* Fixed: When Match Pair and Wrap Columns were enabled and the match happened
+in the wrap column the editor did really stupid things.
+.
+Revision 1.229 1999/09/25 02:01:26 root (set)
+* Fixed: A crash when a file failed to load [only seen in Linux]. Reported by
+Steve Wagor <stevew@uis.net>.
+* Fixed: If the file had less than 2 bytes it was reported as a read error
+[only under Linux and when using glibc 2.1]. Reported by Steve Wagor
+<stevew@uis.net>.
+
+Revision 1.228 1999/09/25 01:00:13 set
+* Fixed: various typos in the web page, thanks to Steve Wagor <stevew@uis.net>
+.
+Revision 1.227 1999/09/25 00:27:34 set
+* Added: Now the editor pass to external screen savers a file handle for a
+file that contains the screen contents. It allows external screen savers
+based on the current screen contents. Suggested by Gregorio.
+.
+Revision 1.226 1999/09/24 02:55:09 set
+* Fixed: The Info and Help buttons of the Screen Savers setup window were
+ever enabled and generated SIGSEGVs if used for internal screen savers.
+Reported by Gregorio. Also by Ilker Aksen <Ilker.Aksen@astrazeneca.com>.
+.
+Revision 1.225 1999/09/24 00:20:33 set
+* Modified name to ForceUpdate because that's better and was the name I used
+in the list.
+
+Revision 1.224 1999/09/24 00:17:27 set
+* Added: New sLisp command: ForceRedraw asked by Endlisnis.
+.
+Revision 1.223 1999/09/21 00:39:43 set
+* Fixed: When Alt+F2 didn't find any function it said No instead of Ok in the
+dialog. Reported by Jeremy.
+* Added: sLisp constants for WhichEditor to avoid "magic numbers",
+documented.
+* Added: GetSyntaxAtCursor sLisp command to know if the cursor is inside a
+comment, a preprocessor line or a string. Suggested by Endlisnis.
+.
+Revision 1.222 1999/09/19 20:53:44 set
+* Added: Full list of Spanish messages. Also fixed some menu and dialog
+messages while testing the Spanish messages (cosmetic stuff).
+.
+Revision 1.221 1999/09/19 14:33:28 set
+* Modified: Now the InfView desktop file is called infview.dkt.
+* Fixed: InfView wasn't inserting the new infview windows as tileable so Tile
+didn't work. (Both also for the LDD).
+.
+Revision 1.220 1999/09/19 14:23:12 set
+* Fixed: InfView didn't paint the first match in a search across a file that
+forced a node switch, other matchs in the same node were painted.
+* Fixed: InfView left the match selection on after a node switch and was
+visible until the cursor was moved.
+* Fixed: InfView v0.2.4 said v0.2.5.
+* Fixed: InfView command line example said `info' instead of `infview'
+(imagine why ;-))
+* Fixed: InfView was giving the same priority to partial matchs and perfect
+matchs when the partial appears first. (in search best match member).
+* Fixed: The cmcForceMatchPairHL command was recorded when recording macros
+from keyboard so the length of the macro was enlarged without gaining any
+functionallity, now is filtered.
+<< All these bugs were detected by me while preparing a conference for the
+<< Linux Demo Day here in Buenos Aires ;-)
+.
+Revision 1.219 1999/09/17 03:43:42 root (set)
+* Added: Support for FHS in the configure script and the Linux compress
+script.
+* Fixed: Some details in the configure mechanism for Linux.
+
+Revision 1.218 1999/09/16 02:25:38 set
+* Added: Now the file dialog stores the path in the history even if you
+abort. It also remmembers the last mask used. Suggested by Pavlos.
+.
+Revision 1.217 1999/09/15 23:50:51 set
+* Fixed: The calendar object was pretending to be an ASCII table so when its
+window was closed it didn't remove yourself from the list making Alt+0 to
+crash. Reported by "Jeremy W. Murphy" <jwm@amc.com.au> and "Pavlos"
+<gtoub@otenet.gr>.
+.
+Revision 1.216 1999/09/15 23:18:18 set
+* Documented new commands and linked to the contex sensitive help.
+* Fixed: The editor was trying a partial match for a reserved word before to
+check for a full match with a user reserved word. It could be experimented
+only with the Texinfo shl; I noticed it while updating the docs.
+.
+Revision 1.215 1999/09/15 22:50:30 set
+* Added: cmcPushCursorPos and cmcPopCursorPos. They use a 12 levels (11
+usable) circular stack (to avoid memory leaks). Added to the Edit menu.
+* Added: cmcToggleCharCase "This is vi's '~' command -- it toggles the
+case of the char under the cursor". Added to menu, also added block to
+upper/lower. Both additions were suggested by Thiago F.G. Albuquerque
+<thiagofga@ambr.com.br>.
+.
+Revision 1.214 1999/09/12 19:43:01 set
+* Added: A lot of stuff for the configure mechanism, now it have the minimal
+functionallity needed and works OK. I also added comments to the README,
+added checks for consistency between the version.txt file and headers, fixed
+various problems with the libamp compilation, etc.
+.
+Revision 1.213 1999/09/12 00:18:22 set
+* Fixed: [Linux] the editor didn't read the right keybind.dat file. So
+defining/undefining keys under Linux was quite hard. The file is created as
+.keybind.dat and the editor was looking for keybind.dat. I don't remmember
+when this problem was introduced.
+* Fixed: Preprocessor lines that included a comment were drawn with an ASCII
+0 at the end of the line. That's usually invisible, but not when using
+ISO-LAT1U fonts (mainly Linux).
+.
+Revision 1.212 1999/09/12 00:09:35 set
+* Fixed: A couple of bugs in the "delete file from disk" feature of the
+windows list: a) Using a freed pointer and b) Asking for save a file that
+will be erased anyways.
+.
+Revision 1.211 1999/09/08 00:13:22 root (set)
+* Added: A check to see if the current directory is valid. Using bash you can
+easilly delete the current directory and be "in the land of nowhere". If you
+run the editor from such a place it gets really confused and does really
+stupid things so is better to just abort and ask the user to be serious.
+
+Revision 1.210 1999/09/07 23:54:30 root (set)
+* Fixed: Save files as DOS (under Linux) could fail. It was mostly related to
+the previous bug, but I added some code to make it independient.
+
+Revision 1.209 1999/09/07 23:44:18 root (set)
+* Fixed: Linux version wasn't converting DOS files to UNIX format. The result
+was mixed style files! Don't know why I never saw this error.
+
+Revision 1.208 1999/09/07 23:00:27 set
+* Fixed: Now ^C and ^/ are disabled in Linux.
+.
+Revision 1.207 1999/09/04 20:53:44 set
+* Added: Now the pseudo macros can be selected from the menu. It helps
+people to learn what pmacros are available. To allow it now each pmacros have
+a descriptive name. This addition is to allow more powerful pmacros in the
+future. Documented.
+* Added: Documentation for the Export as HTML feature.
+* Added: An option to export the text as HTML but without using colors.
+.
+------------------------------------------------------------------------------
+v0.4.35 12th public release.
+
+Revision 1.206 1999/09/03 23:34:41 set
+* Changed version to 0.4.35 to make a release.
+
+Revision 1.205 1999/09/03 01:06:26 set
+* Added: PMacros for HTML, they are very simple but could save some typing.
+.
+Revision 1.204 1999/09/03 00:24:48 root (set)
+* Fixed: Problems when using more than 128 columns. Now the limit is 255x255.
+* Fixed: Redraw needed when loading a desktop that was used with a big
+resolution in one smaller [under Linux]. Is funny to see how the editor
+reacts if you change from 80x25 to 132x60 using SVGATextMode in other console
+while the editor is running.
+.
+Revision 1.203 1999/09/02 00:17:50 set
+* Added: Now the amount of closed windows remmembered in the Alt+0 list is
+configurable from Tool&Ops|Options|Editor General. Suggested by Jeremy W.
+Murphy <jwm@amc.com.au>.
+
+Revision 1.202 1999/09/01 23:48:24 set
+* Modified: Now sLisp commands (and ...) and (or ...) are logical operators.
+* Added: New sLisp operators (& ...) and (| ...) bitwise counterparts.
+Suggested by Endlisnis.
+* Fixed: Windows that had a "remmembered" mode with column cursor on produced
+SIGSEGVs because of some unitialized variable.
+.
+Revision 1.201 1999/09/01 02:14:24 set
+* Fixed: The editor was asking for save when switching to other window and
+the current was modified.
+* Added: Export as HTML option. Suggested by Pavlos.
+.
+Revision 1.200 1999/08/30 22:26:17 set
+* Fixed: I forgot to include the extrscsv.txt file in the 0.4.34 distribution
+so external screen savers aren't accessable from the menu :-(. So only some
+users will be able to try'em.
+
+------------------------------------------------------------------------------
+v0.4.34 11th public release. Released as beta because of problems.
+
+Revision 1.199 1999/08/29 18:34:49 root (set)
+* Added: Version of PCRE needed in the README.
+* Fixed: a constant without type in manview.h.
+* Added: Workaround for a bug in gcc 2.95 in runprog.cc.
+
+Revision 1.198 1999/08/29 15:00:18 root (set)
+* Fixed: SIGSEGV (under Linux and pure DOS) when trying to modify an empty
+list of user reserved words.
+
+Revision 1.197 1999/08/29 14:46:08 set
+* Added: Comments about the new switch for buggy BIOSes in the DOS/Windows
+FAQ.
+* Fixed: uppercase user reserved words not working for C files. Reported by
+Pavlos.
+* Fixed: OK button grayed when editing user reserved words and none was
+entered. Reported by Pavlos.
+.
+Revision 1.196 1999/08/26 01:57:20 set
+* Cosmetic change in install.cc to avoid Allegro's color depths and joystick
+drivers to be included (I already ensure it in another way). Suggested by
+Pavlos.
+* Fixed: An outdated command in the mp3 playing files about Allegro's low
+quality sound. Pointed out by Pavlos.
+.
+Revision 1.195 1999/08/26 01:39:31 set
+* Fixed: A bug in the MP3 player PAUSE. Reported by Pavlos <gtoub@otenet.gr>
+.
+Revision 1.194 1999/08/25 02:52:45 root (set)
+* Added: The man page to the Linux package and installation process.
+
+Revision 1.193 1999/08/25 01:18:44 root (set)
+* Modified: The sleep time when idle under Linux. I reduced it to just 10
+microseconds because if I let 1 ms the keyboard repeat rate becomes erratic.
+Don't know exactly what's wrong. Doing it the editor doesn't eat CPU and works
+ok.
+.
+Revision 1.192 1999/08/25 00:04:43 set
+* Fixed: Now the sLisp ComplChoose doesn't wait for keystrokes if no
+expression is provided or just one is provided. Pointed out by Endlisnis.
+* Documented: The existence and use of the sLisp command "if". I exist since
+the starting days but never was documented.
+* Added: New sLisp commands: and or not
+.
+Revision 1.191 1999/08/22 23:25:31 set
+* Upgrade to PCRE 2.07.
+* Fixed: various warnings from gcc 2.96.
+* Fixed: Transparent blocks bug that was experimented when using white as
+selection color. I saw it while Agata was using the editor ... this girl will
+blow my brains in one or another way.
+.
+Revision 1.190 1999/08/22 21:03:24 set
+* Added: Some FAQs to the DOS FAQs file about the mouse.
+.
+Revision 1.189 1999/08/22 20:44:28 set
+* Modified: Some small details in the readme files to make them easier for
+Linux people. Looks like some of them are too much structured and fails to
+find things if they have a small difference. Suggested by Taura
+<learfox@deltanet.com>.
+.
+Revision 1.188 1999/08/22 20:29:04 set
+* Fixed: Problems when pressing ^/ under W9x. This key triggers SIGQUIT in
+djgpp's library but for some reason this mechanism fails and finally makes
+W9x get upset. Reported by Jeremy W. Murphy <jwm@amc.com.au>
+.
+Revision 1.187 1999/08/22 20:01:08 set
+* Modified: Now sLisp strings supports escape sequences similar to the ones
+used for C. There are a small difference: /n is expanded as /r/n for DOS and
+to get just /n you must use /l (stands for Line feed). Previous behavior was
+expand the escape sequences only when inserting text to an editor buffer. I
+did it to fix some problems in an example provided by Endlisnis.
+.
+Revision 1.186 1999/08/21 02:32:33 set
+* New!: Man page viewer incorporated to the editor.
+* Fixed: One keywords line in the PICs shl.
+* Modified: Easydiag input line to accomodate to the new feature in TV that
+fixed the need of an extra character for small input lines.
+* Fixed: The "resume" information for project and closed windows now changed
+the version because in 0.4.31 the layout of the flags changed. *NHP*
+* Added all the man page files to the source distribution.
+* Added: A command line option to use the low level VGA routines to
+save/restore the video modes. It seems to help for some buggy Matrox drivers.
+* Fixed: Streamable constructors of TDskWin classes didn't initialize the
+CanBeDeletedFromDisk flag. *NHP*.
+* Added: Warning in the snap shot html page about the need of getting the
+last version available of TV to compile the editor (snap shot version).
+
+Revision 1.185 1999/08/13 01:16:36 set
+* Added: Optional flag to sLisp's RunProgram to restore the screen after
+running the program.
+* Added: New sLisp command called strxlt to replace characters in strings.
+Both to solve inconvenients running some DOS programs like mpasm (Grzegorz
+pointed out the problems).
+* Fixed: Problems when loading desktop files that makes references to syntax
+highlight modes not found in the syntahl.shl file.
+
+Revision 1.184 1999/08/12 23:23:04 set
+* Added: Some extra checks to the flush undo info (used by expand/compact
+tabs options) it could be the reason of some misterious crashes that Grzegorz
+reported.
+.
+Revision 1.183 1999/08/07 22:11:51 set
+* Fixed: The editor was creating read-only desktop files so they weren't
+easy to update ;-). That's the default for open (I used it for a test).
+.
+Revision 1.182 1999/08/07 21:27:51 set
+* Updated the license of Robert Hoehne.
+.
+Revision 1.181 1999/08/07 19:49:18 set
+* Added: man pages for the editor and infview.
+.
+Revision 1.180 1999/08/07 15:09:03 set
+* Added: External screen savers. Now you can write your own screen saver and
+plug it in the editor. Requested by Grzegorz Adam Hankiewicz <gah@iname.com>.
+* Modified: Now the screen savers configuration have your own dialog because
+now there are more things to configure. Documented. Linked with the help.
+* Added: Four plasma screen savers (external ones). The sources are also
+available (uses my plasma library). Added as optional in the DOS installer.
+* Added: MakeHzGroup to easydiag.
+* Added: Command line options for the external screen saver is stored in the
+desktop file so the version changed: v0.4.34.
+* Changed: the default sorting for File Open dialog.
+.
+Revision 1.179 1999/08/03 02:56:10 set
+* Added: Now the sorting criteria of the files and directories in the
+FileOpen dialogs can be customized. I added it to TV and now I added the
+needed dialogs to the editor, the options are stored in the desktop file,
+there are help available and the editor also gives some advices about the use
+of SHIFT key. I did it as a result of a thread in djgpp list started by
+Thiago <thiagofga@ambr.com.br>, supported by Clemens Valens
+<c.valens@mindless.com> and discussed by Rolf Campbell
+<cp1v45@nortelnetworks.com> and Eli Zaretskii <eliz@is.elta.co.il>.
+.
+Revision 1.178 1999/08/01 21:01:45 root (set)
+* Fixed: The screen saver weren't working under Linux. Reported by Grzegorz.
+* Modified: Now the text mode screen savers are adjusted to the size of the
+screen. Suggested by Grzegorz.
+
+Revision 1.177 1999/08/01 19:43:55 set
+* Fixed: In the overwrite warning the editor was checking if the user
+answered No, but then if the user pressed ESC the action was performed, which
+is really no intuitive.
+.
+Revision 1.176 1999/08/01 19:33:46 set
+* Added: new sLisp command getenv, is just like the C version but also gives
+access to the internal environment variables. Documented. Suggested by Thiago
+<thiagofga@ambr.com.br>.
+* Added: examples of getenv and the completion chooser to the examples.slp
+file.
+* Added: comments about x:/dev under DOS to the FAQ.
+.
+Revision 1.175 1999/08/01 17:56:49 set
+* Added: ASCII Chart and Calendar windows. First suggested by Jeremy W.
+Murphy <jwm@amc.com.au>, second just because I don't know in what day I live
+;-)). The code comes from the Robert's port of TVDemo with some small
+changes.
+* Modified: The mechanism to remove windows from the Alt+0 list. I added a
+new broadcast to the library sent any time a window is closed. So now the
+main application class of SETEdit receives this broadcast and removes the
+window from the list. I hope I didn't break anything, the mechanism is really
+complex, even when it simplified things a lot.
+.
+Revision 1.174 1999/08/01 13:38:18 set
+* Added: Now you can set the editor to tile windows first vertically (instead
+of horizontally). Is in the general options. Suggested by Grzegorz Adam
+Hankiewicz <gah@iname.com>. New version forced by stored value v0.4.33.
+* Added: Warning about running windowed in Diamond Stealth 2000 Turbo boards.
+Diamond drivers are really buggy, specially stealth ones, I have a couple at
+work and they are really buggy.
+
+Revision 1.173 1999/07/27 02:04:54 root (set)
+* Added: (strstr target_string search_string [start_offset]) -> position or
+-1 sLisp command. Suggested by Endlisnis.
+* Fixed: [Linux] Now when the editor is started with a resolution different
+than the last used the windows are resized to fit in the new desktop size.
+Reported by Grzegorz.
+
+Revision 1.172 1999/07/26 23:43:53 set
+* Added: A couple of Q/A to the linux faq from problems experimented by
+Grzegorz.
+.
+Revision 1.171 1999/07/26 23:18:20 set
+* Added: Now is possible to delete a file from the Alt+0 list for good, I
+mean really unlink it in the filesystem (delete, erase, kill, etc.). That's
+pressing Ctrl+Del and of course previous user confirmation that (of course
+again ;-) can be disabled. Suggested by Grzegorz Adam Hankiewicz
+<gradha@iname.com>.
+.
+Revision 1.170 1999/07/25 17:04:22 set
+* Fixed: In jump to function, if the word under cursor was "greater" than the
+last function name (alphabetically) the dialog selected an invalid item.
+Reported by John Scott Kjellman <jkjellman@ameritech.net>.
+.
+Revision 1.169 1999/07/25 16:03:33 set
+* Fixed: SaveAs was setting the title of new files even if the save failed.
+Reported by Jeremy.
+.
+Revision 1.168 1999/07/25 15:48:09 set
+* Fixed: A typo in the Tip number 17. Reported by Enlisnis.
+.
+Revision 1.167 1999/07/25 15:09:00 set
+* Added: Now the right button of the mouse pop-ups a menu. The menu is fully
+customizable from the menubind.smn file. By default it contains: syntax help,
+jump to function, find, replace, copy, paste and cut. I had it in mind for a
+long time and a suggestion from Jeremy W. Murphy <jwm@amc.com.au> made me
+incorporate it.
+
+Revision 1.166 1999/07/25 00:28:43 set
+* Added: New sLisp command: ComplChoose, it pop-ups a list of options at the
+cursor position. The pressed keys are used for incremental search, any valid
+symbol for the current SHL select the focused item most of other keystrokes
+rejects the selection returning an empty string. Is fully oriented to word
+completion. Suggested by Endlisnis for Lemur.
+.
+Revision 1.165 1999/07/22 00:25:30 set
+* Fixed: Opened files failed to inherit the "See Tabs" and "No inside tabs"
+flags. Damn, I really forgot them in all the places. Reported by Jeremy W.
+Murphy <jwm@amc.com.au>.
+* Added: A new option to highlight the matching pairs on the fly. It is
+called 500 ms after you stop typing to avoid slow downs because an excess of
+computations that aren't really needed. Suggested by Ivan.
+The setting is stored in the desktop files so the version is 0.4.32 now.
+
+Revision 1.164 1999/07/21 01:11:46 set
+* Fixed: The Tool&Ops|Options|Default global edition dialogs asked if the
+user wanted to lose the changes with the reverse logic (when the user tried
+to not lose ;-))
+* Fixed: New file doesn't have syntax hl, but didn't inherit the default
+options for files without syntax hl.
+* Added: Now the snap-shot script generates valid files for DOS and UNIX no
+matters what OS is used to generate the files.
+
+Revision 1.163 1999/07/18 23:20:41 set
+* Added: a Perl script to generate diffs between the current WIP and any CVS
+tag. This will allow me to upload diffs and snap-shots.
+.
+Revision 1.162 1999/07/17 22:26:11 root (set)
+* Added needed scripts and modified small details to create and package
+InfView for Linux.
+.
+Revision 1.161 1999/07/17 21:41:05 set
+* New!: A new standalone program can be created from the sources, is called
+infview and is just an standalone info viewer. It have a command line very
+similar to the FSF's info program. Many users asked for it.
+.
+Revision 1.160 1999/07/17 01:11:05 set
+* Added: Search only in/outside comments options to the Find and Replace
+dialogs. It forced to rearrange the editorFlags so the version changed
+(v0.4.31). Suggested by Jeremy W. Murphy <jwm@amc.com.au>
+.
+Revision 1.159 1999/07/16 22:53:37 set
+* Fixed: Cursor moved outside the screen when using non-persistent blocks and
+replacing a selection by a typed character. Reported by Endlisnis.
+.
+Revision 1.158 1999/07/16 01:45:16 set
+* Added: Now is possible to delete entries in the message box. I also added
+the possibility to save the messages to a text file or copy to the clipboard.
+All started with some suggestions from SpaZe.
+.
+Revision 1.157 1999/07/15 03:07:24 set
+* Fixed: Now the editor commands are disabled during initialization, not only
+when an editor loses the focus. In this way if you start with a clean desktop
+the commands are disabled.
+
+Revision 1.156 1999/07/15 03:05:01 set
+* Added: The screen saver is activated if you left the mouse in the upper
+right corner for a configurable period of time. Suggested by Spaze.
+Also added to the general configuration and desktop file => v0.4.30.
+
+----------------------------------------------------------------------
+v0.4.29 10th public release. Scheduled uploads to DJ's server, my three
+sites, mails to Ivan and DanX, etc.
+
+Revision 1.155 1999/07/14 23:31:16 set
+* Fixed: 3 warnings from gcc 2.96.
+* Fixed: I forgot dstfile.cc in the distribution.
+* Fixed: If no dflopts.txt existed the flags to set the SHL were 0 (all local
+options disabled!).
+* Fixed: The OK button was grayed when editing the default options. Also added
+a confirm before discarding potential changes.
+* Fixed: multiline strings wrongly propagated if the contained an empty line
+in the middle (only Linux).
+* Note: all of this just before releasing, it delayed the release.
+.
+Revision 1.154 1999/07/13 22:48:45 set
+* Fixed: BASIC shl needed AllowedInsideNames=$. Patch by Endlisnis
+<s257m@unb.ca>
+.
+Revision 1.153 1999/07/13 02:12:29 set
+* Fixed: Problems to redirect the output of childs when TMPDIR (or equivalent
+variable) was defined as something like "x:/". That's because djgpp tools
+gets upset if you use a file name like it: "c://file" (even when c://file is
+valid both in djgpp and Linux). Is a very bad idea to define the variable
+like this because other programs also have problems, I saw it in CVS while
+comminting the changes.
+* Note: Robert should do the same in RHIDE, in fact debugging it was slooowww
+because RHIDE was failing to create some temporals and for some reason mktemp
+becomes ultra-slow in this case.
+
+Revision 1.152 1999/07/13 00:46:17 root (set)
+* Added: Eterm theme, terminal description and full explanation.
+* Added: Some hints about it in the readme.src and readme.1st.
+* Added: All the changes and additions to the readme.1st.
+
+Revision 1.151 1999/07/12 00:04:37 set
+* New! "Default global edition" menu option. It was something I needed for
+months and didn't have time to add. It's a complement for the "Global
+Options" but sensitive to the syntax highlight for the current file. When the
+editor selects the shl also enables/disables some local options related to
+this shl. All of this is stored in an easy-to-edit text file, but also you
+can edit it with nice dialogs ;-). Is documented and pressing F1 explains
+how it works.
+
+Revision 1.150 1999/07/11 14:16:08 set
+* New! now you can define your own reserved words (user words) using dialogs
+or just editing a text file.
+* Added: Documentation, F1 hook and tip for the user words.
+* Modified: Some important internal structures were modified. The main
+important change is that I no longer use a SOSStack for the syntax highlight
+strings, now all are separated strings. So the call to
+LoadSyntaxHighLightFile changed a little bit.
+* Note: This is all very new and not very well tested, don't expect 100%
+reliable behavior and report any strange thing.
+
+Revision 1.149 1999/07/09 19:31:27 set
+* Fixed: The documentation of RunProgram* to say @var{program_name} instead
+of @var{program name} to avoid confusion. Reported by Endlisnis.
+* Added: Now (+ "Hello" 1) sLisp code returns "Hello1". Endlisnis reported
+a problem in one of the examples and instead of limiting the example I
+extended the language ;-)
+* Fixed: Now when asigning a macro to a key the editor doesn't draw the
+intermediate steps, it avoid cleaning the status line. Reported by Endlisnis.
+* Fixed: The RunProgramRedir was returning a non ASCIIZ string. Reported by
+Endlisnis.
+* Fixed: The name of the sLisp command WhichEditor (was WichEditor).
+* Added: A new optional parameter to sLisp command WordUnderCursor. (see docs)
+* Added: A new editor's command: cmcGoEndOfWord. (see docs).
+* Note: These modifications are to give better support to the Lemur v0.1a
+prototype completion macro+program created by Endlisnis.
+
+Revision 1.148 1999/07/09 15:22:29 set
+* Fixed: G was used twice as short-cut in the Find Dialog. Reported by
+Jeremy W. Murphy <jwm@amc.com.au>.
+* Added: short-cut for the "RegEx Ops" button (O).
+
+Revision 1.147 1999/07/07 23:59:42 set
+* Added: Help for the "Open Read-only copy" option (documentation and F1).
+
+Revision 1.146 1999/07/07 23:50:48 set
+* Added: An option to open a read only copy of the current file we are
+editing from disk.
+* Fixed: Disabled some commands when no editor is selected: Print, RO copy,
+etc.
+* Fixed: Now the editor windows disables all the commands when they are
+unselected. You'll get a lot of gray options if you select a non-editor now.
+* Fixed: Now InfView windows enables/disables your commands.
+* Note: I changed some internal stuff: (a) Added a new member to TCommandSet
+class to enable/disable groups of commands (b) Added a parameter to
+updateCommands, it says if the update is a full one or the class needs to
+update just some commands and (c) the rectangular selection commands are
+enabled/disableb only after one command related to it is processed, not all
+the time.
+
+Revision 1.145 1999/07/04 15:44:40 set
+* Added: A progress bar when loading a file greater than 1Mb. The bar is
+displayed during the parse process (much slower than the load). I tested it
+with the disassebled code of the editor (15Mb ;-).
+
+Revision 1.144 1999/07/04 15:21:29 set
+* Added: A command to paste de Emacs mode associated with the current syntax
+highlight and the tabsize as a comment at the start of the file. Documented.
+Suggested by Ivan.
+
+Revision 1.143 1999/07/04 13:58:01 set
+* Added: Added EmacsModes and ShellScript shl commands. Looks like people was
+confused about the fact that Files was used for the three so now they are
+separated commands.
+.
+Revision 1.142 1999/07/03 19:16:19 set
+* Added: A blanker to the screen savers. Suggested by SpaZe/ST
+<stealth.tech@seznam.cz>.
+* Fixed: Now the mouse is hided when the screen saver is on. Reported by
+SpaZe.
+* Added: A test button to make a preview of the screen savers. Suggested by
+SpaZe.
+* Fixed: The name of the "global editor options", now is "general editor
+options" Reported by SpaZe.
+* Added: F3 label in the File|Open menu. Suggested by SpaZe.
+* Added: Now InfView copies all the #include directives with Alt+I, not just
+the first. Suggested by SpaZe.
+.
+Revision 1.141 1999/07/03 17:06:51 set
+* Fixed: When redirecting the output of external files if the last line
+emitted by the external program didn't have /n it was discarded. Reported by
+Endlisnis <s257m@unb.ca>.
+.
+-- Sent the change.log to the editor's mailing list (recently created) --
+Revision 1.140 1999/07/02 02:39:37 set
+* Fixed: Now project items are stored as relative names, not absolute. So you
+can move projects from one disk to another.
+* Fixed: The example.zip (for SDG) used absoulte paths so was hard to use.
+* Added: A warning when adding files that can't be expresed as relative in
+the project.
+* Fixed: The command to go to the end of file didn't compute tabs so if the
+last line in the file had tabs the position wasn't the EOL. Reported by
+SpaZe / ST <stealth.tech@seznam.cz>.
+* Fixed: When unindenting a block and the cursor was in the previous line of
+the first line of the block the editor included it in the selection.
+* Added: Pseudo-macros for Clipper.
+* Added: A simple mechanism for "Advice" dialogs (they explain something to
+the user and gives the option to not be displayed in the future). So they
+will start to appear in many places. I think they are very good to learn. I
+really liked it when I tried the VMware beta.
+.
+Revision 1.139 1999/06/30 02:39:34 set
+* Added: Documentation for the #! stuff in shl files and warnings about the
+fact that the editor remmember the shl of files.
+* Added: @comment as secondary comment for Texinfo files.
+.
+Revision 1.138 1999/06/30 02:16:04 set
+* Added: --no-compress option to the compress scripts. It avoids the call to
+upx even when upx is installed in the system. Suggested by Ivan.
+.
+Revision 1.137 1999/06/30 02:08:13 set
+* Added: A new command cmeDeleteBkps to delete all the backup files memorized
+by the editor so you don't need to exit with quit to do it. That's very
+useful when used in combination with "Remmember bkps to delete". I put it in
+the Tool&Ops menu.
+* Added: Documentation for it and some entries in the concept index related to
+backups.
+
+Revision 1.136 1999/06/30 00:52:00 set
+* Fixed: If a comment works only when in first column and is found in other
+place the editor now pass it for the other checks (symbol, etc.).
+* Modified: Small enhancements to the batch files hl. Now more things are
+symbol.
+.
+Revision 1.135 1999/06/30 00:34:49 set
+* Added: New syntax hl. option: "RelaxNumbersCheck", when enabled words that
+start with a number aren't indicated as wrong. That's useful for batch files.
+* Fixed: The '.' can be used inside names in assembler files.
+.
+Revision 1.134 1999/06/30 00:10:42 set
+* Added: "Remmember bkps to delete" option. Useful for users of Alt+Q. It
+helps to keep delete the backup files which are useful but annoying.
+As that's stored in the desktop file that's a new version: v0.4.29.
+.
+Revision 1.133 1999/06/29 02:26:26 set
+* Added: Syntax highlight for PICs assembler (16C7x syntax) contributed by
+Diego Brengi <brengi@inti.gov.ar>.
+* Modified: My idea to save a directory read for the open dialog failed for
+save as where the setData doesn't pass a wildcard, so now in this case I read
+the directory first *NHP*
+* Added: More checks in the installer for NT.
+.
+Revision 1.132 1999/06/27 20:17:13 set
+* Updated the documentation for Tool&Ops|Options|Editor General, it was
+outdated. Added information for five undocumented options.
+.
+Revision 1.131 1999/06/27 20:07:13 set
+* Added: An option to the editor's general options. It works this way: when
+enabled and if the user specifies at least one file name in the command line
+all the windows already opened are closed. In this way only the files
+specified in the commnad line are opened. Suggested by Ivan.
+.
+Revision 1.130 1999/06/27 19:37:58 set
+* Modified: Now is possible to save the current file as UNIX/DOS. That's only
+possible for this special case, not saving as other opened file.
+Suggested by "Jeremy W. Murphy" <jwm@amc.com.au>.
+.
+Revision 1.129 1999/06/27 18:58:23 set
+* Added: Documentation for the rectangular upper/lower commands.
+* Fixed: The same bug that affected the rectangle paste was in block upper/
+lower.
+* Modified: Now the message that a rectangle can't be pasted outside the text
+is reported by editorDialog.
+* Fixed: When pasting rectangles outside the text using the move operation
+you could lose the original text, specially because the undo state was
+broken. Now the editor checks before deleting the text and also does it
+before starting to fill the undo structure. Reported by
+SpaZe/ST <stealth.tech@seznam.cz>.
+.
+Revision 1.128 1999/06/27 17:52:30 set
+* Added: cmcSelRectToUpper and cmcSelRectToLower, they convert a rectangular
+selection to upper/lower case. They have a side effect: tabs inside and
+crossing the boundaries of the selection are converted into spaces. That's
+because I first cut the rectangle process the block and then paste it again.
+Any other solution will need much more code and make it more complex.
+Suggested by SpaZe/ST <stealth.tech@seznam.cz>.
+* Fixed: A very old bug while using undo for rectangular selection operations.
+I don't know if anothers remains but it was clear: the paste wasn't
+initializing the member that indicates how many operations are grouped.
+Reported by Alex Lozano and recently by SpaZe/ST <stealth.tech@seznam.cz>.
+.
+Revision 1.127 1999/06/27 16:04:21 set
+* Moved all the code for loading/storing desktop files from editmain.cc to
+a new file called dstfile.cc.
+* Added: <noscript> and </noscript> to the html syntax hl. file. Suggested
+by SpaZe/ST <stealth.tech@seznam.cz>.
+.
+Revision 1.126 1999/06/27 14:50:39 set
+* Fixed: Now the "See Tabs" and "No inside tabs" options are stored in the
+desktop file. As the desktop file changed that's: v0.4.28.
+* Added: The "Wrap words" option can be set for all the windows from the
+global options dialog. Suggested by SpaZe/ST <stealth.tech@seznam.cz>
+.
+Revision 1.125 1999/06/26 00:54:35 set
+* Fixed: A bug when putting the PATH command in the autoexec.bat when the
+installer couldn't find the PATH definition. Reported by Ivan.
+* Fixed: Now the installer is can detect more cases of the PATH definition.
+Reported by Ivan.
+.
+Revision 1.124 1999/06/24 23:25:08 set
+* Added: Now I'm forcing some redraws when "See tabs" is enabled and I kill
+spaces at the end of a line. In this way the user can see how they disapear.
+Suggested by Ivan.
+.
+Revision 1.123 1999/06/24 22:06:32 set
+* Added: a "pocket calculator", that's a simple calculator. From TV.
+.
+Revision 1.122 1999/06/23 23:11:16 set
+* Modified: The OK button in the dialog to select MP3 files now says "Select".
+* Fixed: Now double clicking adds the file to the MP3 list. (Reported by Ivan)
+* Added: New button to the file open dialogs, it brings the change dir dialog.
+Added after some questions from Ivan.
+* Fixed: An extra directory read when opening a File Dialog.
+.
+Revision 1.121 1999/06/22 22:34:35 set
+* Added: SpecialSymbol and SpecialSymbolCont to the shl syntax. It allows to
+define special symbols constructed by two symbols that combined have a
+special meaning. That's very useful for $# in Perl and Bash scripts and @@
+for Texinfo files.
+* Added: PartialKeywords to the shl file. That's used when keywords can be
+embedded in other words and still valid, like this @AA is a keyword and
+@AAxxxx is @AA keyword plus some text. In this mode the keywords search is
+considerably slower. I added it after some mail exchange with Burton Radons
+<loth@pacificcoast.net>.
+.
+Revision 1.120 1999/06/18 01:12:06 set
+* Modified: Now the editor uses 32 bits flags for the syntax highlight stuff.
+It consumes more memory but allows me to add better shl.
+* Added: String3 definition to the syntaxhl.shl files, that's propagated to
+the rest of the lines.
+* Modified: String2 is now propagated too, the old behavior is obtained with
+a new command: ShortString.
+* Fixed: This addition allowed me to fix an annoying problem in the Perl and
+Bash syntax highlight. These script languages supports three types of strings
+and the three are propagated across lines. Now it works OK.
+**Warning** I was careful with the changes and tested that no part is cutting
+the attributes to the old size (16 bits), but I can't be sure so this version
+is actually qualified as less stable than 0.4.26.
+.
+Revision 1.119 1999/06/17 02:04:28 set
+* Added: Syntax Highlight for Texinfo files. Contributed by Burton Radons
+<loth@pacificcoast.net>.
+* Fixed: if two shl keywords were different just in the caseness(?) only
+the first defined was taked. Example: @aa @AA. I was using a no case
+sensitive collection to colect the keywords. Reported by Burton.
+* Modified (Fixed): Now the editor stores the name of the syntax highlight
+instead of the number. Before it if you inserted a definition in the middle
+of the shl file you surely created a mess. So desktop files changed and
+hence the version: v0.4.27.
+* Added: Explanation where you must specify the Case keyword in the shl file
+in the docs. That's important and wasn't mentioned. Reported by Burton.
+.
+Revision 1.118 1999/06/16 01:35:29 root (set)
+* Added: Now the editor can detect the syntax of a file looking for
+#!path/name. This line must be the first in the file. Suggested by Ivan.
+* Added: Detection for Perl scripts without .pl extension.
+* Added: Some very primitive syntax highlight for shell scripts. At least
+bash supports three strings and the editor just one so the support is weak.
+
+Revision 1.117 1999/06/15 23:18:41 root (set)
+* Added: ncurses, gpm and RegDOS credits in the copyrigh file.
+* Fixed: A problem in the INSTALL.MAK that made it fail if the user already
+had the "e" symlink (it was included in the release of v0.4.26, just forgot
+to commit).
+
+Revision 1.116 1999/06/15 23:11:30 set
+* Fixed: The Global editor options was failing to disable the "See Tabs" and
+"Don't move inside tabs" options (I did a cut/paste and forgot to fix it ;-).
+Reported by Diego Brengi <brengi@inti.gov.ar> (If I can say it was a report)
+* Fixed: Now the editor looks for ~/tcedit.dst and ~/.tcedit.dst, not only
+the last.
+.
+Revision 1.115 1999/06/15 22:55:49 set
+* Fixed: Not restoring the attributes after saving a file. I forgot it in:
+Revision 1.94 1999/05/23 19:28:22. Reported by Dean Limbaugh
+<edl@ns1.co.alachua.fl.us>.
+.
+Revision 1.114 1999/06/11 00:15:46 set
+* Modified: Now if the installer didn't change the autoexec.bat won't suggest
+rebooting ;-)
+* Modified: Now the about box is coherent with the new slogan for the editor:
+"A friendly text editor". I changed as a result of some suggestions from
+Jose Lacal.
+* Fixed and Added: a lot of details in the readme.1st file. When I release
+the editor I install it in many places so I read it ;-)
+* Added: information about cwsdpmi, pmodedj and libwin in the copyright file.
+* Fixed: some out-dated information in the copyright file.
+* Updated: some information in infview documentation, now the name isn't
+uppercase.
+* Fixed: typos in the windows/dos FAQ.
+.
+----------------------------------------------------------------------
+v0.4.26 9th public release. Uploaded to DJ's server (Simtelnet) and my home
+page.
+
+Revision 1.113 1999/06/10 01:39:19 set
+* Added: Forced LFN=y in installer or it will fail to update menu and desktop
+files.
+* Added: Now the code modifies the .pif files to setup the working directory.
+It avoids the creation of tcedit.dst files in the desktop.
+
+Revision 1.112 1999/06/08 23:53:01 set
+* Modified: Now I use libwin for the installer, that's faster and not
+affected by the WinCrap bug I faced before.
+* Added: Some (small) instructions about the installer in the readme.src.
+* Fixed: Some versions and CPU model in readme.src.
+.
+Revision 1.111 1999/06/08 03:03:33 set
+* Added: Finally I added the installer to the CVS tree. Currently is v1.02
+beta, but seems to work acceptable. I added a directory, the sources
+(including a patched version of datfile.c from Allegro to save 60Kb in the
+final distribution, around 140 in the .exe), changes in the makefiles, added
+to the list of files, project and a Perl script to generate the installer.
+.
+Revision 1.110 1999/06/06 16:50:53 set
+* Modified: The readme and announce files for the new release.
+* Added: More information about Alt+Mouse in the Linux FAQ.
+* Fixed: Copyright year in the docs, last update, version, new description
+for the dir.info, the description isn't in small caps in the .info (pointed
+out by Ivan), fixed a chapter name containing ' (TeX gets confused), generated
+the documentation in .dvi, .ps and .html formats and more.
+.
+Revision 1.109 1999/06/05 23:24:14 set
+* Fixed: 3 warnings reported by egcs 1.1.2 from potato (other snapshots
+didn't report it, all related to objects without specified type defaulting
+to int). Also added initialization to 2 variables that egcs reports (wrongly)
+that can be used unitialized. Warnings provided by Ivan.
+.
+Revision 1.108 1999/06/05 22:50:21 root (set)
+* Applied: Patches to the Debian package files from Ivan. Not tested because
+I need the potato debhelpers.
+
+Revision 1.107 1999/06/05 21:40:34 set
+* Fixed: Typos in the tips file.
+* Added: Simple menu, tips and desktop files in the distribution for people
+that want to use the editor but doesn't know about all of these strange
+options included.
+* Added: EasyDiag features: Multiline support for TSStaticText and wrapping
+column. They are used by the WIP installer.
+* Changed: Version number because desktop files changed. (v0.4.26)
+* Added: Support for tabs in the printing. Now tabs looks the same as in the
+screen. Suggested by Richard Sanders <richard@stardate.bc.ca>.
+* Changed: Prototype of the PrintSource routine to accept the tabs' size.
+.
+Revision 1.106 1999/05/29 03:01:21 root (set)
+* Added: Now patchenv.pl also fixes the TV dependencies.
+
+Revision 1.105 1999/05/29 01:35:11 root (set)
+* Applied diffs for the Debian package files from Ivan.
+
+Revision 1.104 1999/05/29 00:36:24 set
+* Compiled with the NT additions in TV. Now the editor works in NT Server
+4.0 in a machine I have access, don't know others.
+* Fixed: A syntax highlight bug in the generic engine:
+" molw/t0x00/t/t/t;Comment" in a .asm is an example.
+.
+Revision 1.103 1999/05/27 22:05:38 root (set)
+* Added: The print configuration dialog is now an EasyDiag(tm) dialog and
+allows to choose between writing to a file or thru a program using a pipe.
+* Added: A couple of functions to EasyDiag that makes easy to transfer the
+with of the widder object to the rest (Used in the print setup).
+
+Revision 1.102 1999/05/27 00:41:13 root (set)
+* Fixed: A nasty bug. When the editor retreives the settings of a closed file
+(you open a file that was previously opened and closed, then the editor
+uses the same position, settings, etc.) the closed object was released and
+the openFile function was accessing an already released block. Of course the
+effect was random and produced two possible things: a) The column cursor
+magically appears enabled b) SIGSEGV because (a) with ridiculous values.
+* Fixed: Memory leak in the new backup list when creating more than one
+backup of the same file *NHP*
+
+Revision 1.101 1999/05/26 00:31:36 set
+* Modified: Now I include the "new" header instead of using hardcoded
+definitions (editmain.cc). Patch by Robert.
+.
+Revision 1.100 1999/05/26 00:25:35 set
+* Wow! revision 100
+* Modified: Went back to -gstabs+, now -gstabs+3. Suggested by Robert (I
+disabled it in the past to save memory while debugging).
+.
+Revision 1.99 1999/05/26 00:08:54 set
+* Fixed: references to str[n]*icmp. Pointed out by Robert.
+.
+Revision 1.98 1999/05/24 00:35:08 root (set)
+* Added: A warning when switching to the user screen for Linux, that's
+because currently the user must press ENTER which is not very intuitive and
+the user could think the editor hanged.
+* Added: Support fot multiline TStatiText in EasyDiag.
+
+Revision 1.97 1999/05/23 23:45:59 root (set)
+* Added: More information in the profile editor option. It now gives more
+interesting information. I also fixed a problem in the Linux version which
+didn't meassured the time consumed by the OS which, in some cases, is very
+important. As an example: the editor can do 18560 lines/sec using VCSA and
+using all the CPU, but only 1318 using xterm where 80% of the time is spend
+by the OS to draw the text. VCSAs are about 5 times faster than using a
+ttypN locally and 14 times faster than xterm.
+
+Revision 1.96 1999/05/23 21:33:35 set
+* Added: Number of selected lines in the ^Q-L command.
+.
+Revision 1.95 1999/05/23 20:35:30 set
+* Fixed: Now the editor will delete backups of files in other directories
+different than the working one, for that the editor keeps a list of created
+backups. It also helps to delete files with the new backup options (hidden and
+UNIX style).
+.
+Revision 1.94 1999/05/23 19:28:22 set
+* Added: Hidden backups option.
+* Modified: Now when a backup is created the editor will use a rename if the
+file isn't a symbolic link and a copy only if the file is s.l. That's faster,
+specially for large files.
+.
+Revision 1.93 1999/05/23 18:35:01 set
+* Added: my old memmove again, that's twice faster the djgpp's libc version
+in my system.
+.
+Revision 1.92 1999/05/23 17:26:33 set
+* Added: A .pif file for the editor. It have some settings I think are the
+best for the editor.
+.
+Revision 1.91 1999/05/21 14:06:00 root (set)
+* Fixed: IsADirectory for Linux *NHP*
+* Fixed: Now librhutils won't crash if we couldn't create the temporal file
+*NHP*
+
+Revision 1.90 1999/05/21 03:42:35 set
+* Added: UNIX style bakup file names (name~).
+.
+Revision 1.89 1999/05/21 02:42:34 set
+* Fixed: Now ".files" are backed-up as ".files.bkp" and not as ".bkp".
+.
+Revision 1.88 1999/05/21 02:32:09 set
+* Added: Save DOS files as DOS for UNIX.
+* Added: Save desktop files as hidden files.
+.
+Revision 1.87 1999/05/21 00:09:52 root (set)
+* Added: Some mouse information in linux.faq (gpm and xterm issues).
+
+Revision 1.86 1999/05/20 02:14:30 root (set)
+* Fixed: The resize attributes of the clock where wrong. I saw it when
+resized an xterm from 80x24 to 95x33, the clock just disapear but left a
+hole in your place.
+
+Revision 1.85 1999/05/20 01:48:31 root (set)
+* Fixed: Some strange bug in Linux when generating the documentation using
+SDG, looks like I can't trust feof when fopening with "wt+". I don't
+understand it very well, but it filled my disk at work ;-).
+
+Revision 1.84 1999/05/19 23:02:01 set
+* Added: Some QBasic keywords to the BASIC shl. Contributed by Endlisnis
+<s257m@unb.ca>.
+.
+Revision 1.83 1999/05/19 22:57:06 set
+* Fixed: Now the editor doesn't hang if you load a file with lines multiple
+of 0x10000. The editor now refuses to load such a files. Reported by
+Endlisnis <s257m@unb.ca>.
+* Added: A message when the editor is interrupted with Ctrl+Alt+Break.
+.
+Revision 1.82 1999/05/16 22:27:36 root (set)
+* Added: another .env file for Linux, it have more interesting settings
+(dynamic executable, no debug information, no warnings, linking with
+installed libPCRE and libZ, etc.). But I keep the other because is more
+bulletproof.
+* Modified: the linux.faq because now Alt+8 doesn't generate 8 if the window
+8 isn't there.
+* I did a lot of enhacements to the Linux screen, keyboard and mouse stuff.
+For details consult the Turbo Vision change.log.
+
+Revision 1.81 1999/05/13 00:41:52 root (set)
+* Modified: As Linux lacks access(name,D_OK) (bad, bad) I added a function
+called IsADirectory in pathtool. It checks: (1) name exists, (2) name is
+type directory and (3) user have execute access (it means user can use this
+directory).
+
+Revision 1.80 1999/05/12 23:57:30 set
+* Fixed: In the errors parser absolute paths starting with / where
+missinterpreted.
+.
+Revision 1.79 1999/05/12 00:03:15 set
+* Fixed: Removing a secondary InfView from the list of windows produced a
+SIGSEGV or SIGILL because the same object was released twice.
+* Fixed: When a secondary InfView was released it released the BookMark so:
+a) The rest of the InfViewer lost it. Most probably what Brett Porter
+<blp01@uow.edu.au> experimented and that I tried to avoid in revision 1.78.
+b) At exit when the main InfViewer was destroyed the BookMark was destroyed
+again producing a SIGSEGV.
+.
+Revision 1.78 1999/05/11 23:08:22 set
+* Fixed: Looks like even when I taked all the precautions to avoid having an
+unitialized BookMark in InfView there is some way to achieve it so I added
+yet another check.
+.
+Revision 1.77 1999/05/11 22:49:51 set
+* Added: Now people switching from djgpp v2.01 to v2.02 won't get "Can't open
+libc.inf" for projects where the libc.inf file was opened. Basically now
+InfView will try to find libc.info if libc.inf isn't there (same for any .inf
+file). Brett Porter <blp01@uow.edu.au> experimented such a problem.
+.
+Revision 1.76 1999/05/06 03:51:56 set
+* Fixed: Now the clock reduces the size of the menuBar instead of just
+overlapping it. It didn't have any sense before, but now I added some code
+to the menuBar that enlarge the space between items if there are enough
+space so reducing the menuBar size could change the situation, in fact does
+it when using spanish menues.
+.
+Revision 1.75 1999/05/06 00:34:41 set
+* Fixed: Some stuff in gettext library. When I added a free() call to the
+library to avoid leaks reports I didn't realized that when LANGUAGE and
+other environment variables aren't defined gettext uses static strings that
+makes free crash under plain DOS (Not W9x).
+.
+Revision 1.74 1999/05/04 03:03:47 set
+*> I added some stuff related to a macro Endlisnis <s257m@unb.ca> was trying
+to do I also implemented some stuff I discussed with MDaniel
+<mdaniel@balug.org.ar> some time ago.
+* Added: RunProgramRedir sLisp command, it runs an external program and
+redirects stderr and stdout to a file, the file is then returned as a string
+variable. That's ultra powerful (and dangerous ;-).
+* Added: WordUnderCursor sLisp command, it returns the word under the cursor.
+Useful for external help and things like that.
+* Added: ShowInSatusLine sLisp command, it shows an string in the status
+line. Useful to show results to the user.
+*> Now from the internal side:
+* Modified: The RunExternalProgram function to get some flags that controls
+the redirection. I added it to the rhideint.cc file, but the functionallity
+is not implemented in RHIDE.
+* Added: RunExternalProgramGetFile to get the redirected file. I also added
+a dummy to rhideint.cc so it won't break the compilation, but is a dummy.
+.
+Revision 1.73 1999/05/01 16:02:07 set
+* Added: Quotation of <rogerh40@aa.net> in the windos.faq about problems with
+VShield.
+* Fixed: Short cut for "Regula expressions" was the same used for "Global" in
+the "Replace" dialog. Reported by Endlisnis <s257m@unb.ca>.
+.
+Revision 1.72 1999/05/01 14:39:24 set
+* Fixed: When pressing end in a line that contained only tabs the editor was
+positioning the cursor at the end of the tabs but the visible cursor was
+positioned in the first column producing a confusing effect.
+.
+Revision 1.71 1999/05/01 01:01:32 set
+* Added: Code to detect if SET_FILES point to an invalid point and in this
+case try to guess the right value and if it fails inform it and stop.
+* Fixed: Now if the syntax highlight file can't be loaded the editor doesn't
+derreference a NULL pointer (SHLArray).
+.
+Revision 1.70 1999/05/01 00:00:26 set
+* Fixed: Now if TMPDIR isn't defined or is wrongly defined the stderr/stdout
+redirection doesn't fail so easilly. Now I try with %TEMP%, %TMP%, /tmp, c:/
+or .
+.
+Revision 1.69 1999/04/30 23:06:38 set
+* Added: Greek fonts. I'm in the middle of a big change in the code page
+stuff that will take some weeks.
+* Fixed: "Home" button when no tcedit.dst was loaded (it used uninitialized
+data).
+.
+----------------------------------------------------------------------
+v0.4.25 8th public release. Uploaded to DJ's server (Simtelnet), my home
+page, BALUG home page, LUGAr, sent to Ivan, announced in Freshmeat and
+Linuxberg.
+
+Revision 1.68 1999/04/21 23:07:13 set
+* Fixed: Was not possible to load files with []=+, or ; from the open dialog
+even when LFNs where available. The problem was in TV. Reported by
+Endlisnis <s257m@unb.ca>.
+* Fixed: The check for files modified after running an external program was
+wrong, I don't know why I was checking the creation time instead of the
+modification time. It also affected the Save with same time. I discovered it
+while processing some code pages with Perl scripts from inside the editor
+(using the run external program feature).
+.
+Revision 1.67 1999/04/18 23:33:44 set
+* Changed: Now I use PCRE v2.04 for the Perl Regular Expressions. I was using
+v1.07 of feb 1998, the new one is dated feb 1999.
+.
+Revision 1.66 1999/04/18 22:14:55 root (set)
+* Applied changes to the Debian files from Ivan.
+
+Revision 1.65 1999/04/18 22:08:46 root (set)
+* Changed: Now the Linux version is also compressed with UPX.
+
+Revision 1.64 1999/04/18 21:57:29 root (set)
+* Updated: The Linux installation script, now the text will tell the real
+default prefix (is stuffed by the Perl script), the text of the VCSA.SH
+script and the FAQ to reflect the current condition.
+.
+Revision 1.63 1999/04/18 21:50:16 set
+* Fixed: Now if a syntax highlight indicates that the "escape" character is
+also a symbol it isn't displayed in red. That's the case of Perl where the
+\ can be used outside strings.
+.
+Revision 1.62 1999/04/18 21:40:40 set
+* Changed: to UPX 0.70 and -9 compression. Tried --best but is too slow and
+doesn't help the editor.
+.
+Revision 1.61 1999/04/18 21:32:16 set
+* Added: A workaround for a bug in the Windows 95 clipboard handling. Looks
+like the Windows 95 clipboard can't receive an arbitrary number of bytes for
+the clipboard (int 0x2F service 0x1703), instead you must (a) enlarge the
+number to be a multiple of 32 and (b) ensure the string is padded with 0s. If
+you pass a 32*n bytes string without doing it you kill the application that
+pastes the text. How said W95 is idiot? nah.... I found it after crashing
+Pegasus various times.
+.
+Revision 1.60 1999/04/16 02:28:31 root (set)
+* Updated the linux.faq it had hints about things that no longer apply.
+* Added: a file called version.txt to hold the number of the last release.
+* Updated the INSTALL.LINUX because it had wrong information about the
+default prefix.
+* Updated the readme.1st to reflect the last changes and explain some Linux
+specific stuff.
+* Added: -f to the rm calls in Makefile to avoid error in the clean target.
+* Modified: the compress scripts to use the version.txt.
+* Removed the ../mp3/libamp.mak <-> rhide.env dependency from the makefile.
+* Fixed: some wrong wording abour the default prefix in the makes/readme.txt.
+Reported by Ivan.
+.
+Revision 1.59 1999/04/13 01:09:25 set
+* Added: Syntax highlight for Phyton. Contributed by David
+<david.stegbauer@cz.opel.com>.
+* Added: A micro FAQ to the DOS version.
+.
+Revision 1.58 1999/04/13 01:06:47 set
+* This file is to add common question that applies only to windows and DOS.
+
+Revision 1.57 1999/04/11 00:31:56 set
+> The bugs and leaks will remmember this battle for years ;-))
+ I was hunting memory problems (malloc/free, out-of bounds and leaks) with
+YAMD by Nate Eldredge <nate@cartsys.com>. Was just to make sure the editor
+was clean. I was working in it five days, as a result:
+* Various destructors of TVision were modified to release the allocated
+memory.
+* I patched gettext library to release the allocated memory.
+* Modified djgpp libc to release the atexit linked list. The patch was
+incorporated to the 2.03 WIP.
+* Heavilly modified YAMD 0.23 to ignore allocations from putenv, __alloc_file
+and _invent_inode.
+* Added code in many places to release the allocated memory at exit, some of
+these places are: a destructor for TCommToMacroCol and TMLIBase, a new class
+called TLispConstString to replace a static TLispString, hook in fstrcmp and
+many UnLoad... calls to routines that releases memory.
+ With these things I managed to get a 0 leaks report from YAMD and using it
+I found:
+* An out-of bounds read in the copy of the fonts data to the transfer buffer.
+It could become dangerous in the future.
+* A leak in the EasyDiag destructors.
+* A leak in the calculator dialog (use of delete instead of destroy).
+* A leak in the functions list when no functions were found or you exited
+with ESC.
+* Powered Grep didn't delete the passed "word under cursor".
+* A potentially important leak in the undo of the TCEditor class. The editor
+wasn't deleting it in the destructor.
+* A leak in flushUndo (not killing the already used by undo cells).
+* A leak in the rectangular blocks, propietary clipboard not deleted in the
+destructor.
+* A leak when clearing a rectangular selection.
+* A leak when copying to the rectangular selection clipboard and using undo
+plus redo.
+* A leak in the "Screen Options" dialog (list of fonts not released).
+* A leak in the project window (items not released when closing the project.
+Use of delete and not destroy).
+* Another leak when deleting items from the project.
+* A leak in the "Tip of the day" dialog (destroy).
+* A leak in the syntax help search (not releasing the word under cursor).
+ Also and thanks to the heavy use of the memory when using YAMD I found:
+* Fixed: Bug in insertBuffer failed when the buffer reallocation moved the
+base of the buffer and then we tried to undo this action.
+ In the middle time:
+* Fixed: When a file had 0 bytes it was reported as read error.
+* Fixed: When the editor failed to load a file it wasn't inserted in the
+desktop but was inserted in the ALT+0 list producing a GPF/SIGSEGV when
+asking for the list of windows. Reported by "Dean Limbaugh"
+<edl@ns1.co.alachua.fl.us> (a Linux user).
+
+Revision 1.56 1999/04/02 18:49:51 set
+* Fixed: Character 0xD0 in "IBM PC 850" code page.
+* Fixed: Character 0xD8 in "IBM PC 852" code page.
+* Changed: Some names of the code pages to be more clear.
+* Added: Full documentation for the layout of my fonts with Unicode
+equivalence. I used tables that Fojtik Jaroslav <FOJTIK@vision.felk.cvut.cz>
+sent me to do the job.
+.
+Revision 1.55 1999/04/02 15:16:00 root (set)
+Many things related only to the Linux version:
+* Now the executable is called setedit and the installer creates a symlink
+called e. That's more similar to DOS where I use e.bat.
+* Changed: Now the docs are compressed with -9. (Ivan).
+* Changed: The installation is to /usr by default now. (Ivan).
+* Added: Search for files in /usr and not only /usr/local tree. (Ivan).
+* Fixed: The message about wrong installation now displays ok. (Ivan).
+* Fixed: ALT+F5 now waits for ENTER.
+
+Revision 1.54 1999/04/01 23:24:50 set
+* Changed: Now Optimal Fill doesn't use a tab when only one space can be used.
+.
+Revision 1.53 1999/04/01 22:56:19 set
+* Added: A new target to the makefile called clean-docs to remove all the
+generated docs. Suggested by Ivan Baldo.
+.
+Revision 1.52 1999/04/01 22:46:26 set
+* Added: A key to stop the DOS version, that's Right Shift+Control+Delete.
+That's just a test, don't know if that's definitive.
+.
+Revision 1.51 1999/04/01 22:16:15 set
+* Applied the -2 and -3 diffs for the Debian package files from Ivan.
+.
+Revision 1.50 1999/04/01 21:48:00 set
+* Added: History to the "Goto line" dialog. Suggested by Fojtik Jaroslav
+<FOJTIK@vision.felk.cvut.cz>.
+.
+Revision 1.49 1999/04/01 20:02:09 set
+* Changed: The name of the editor's help. As the editor is officially called
+setedit is sensible to call the help file setedit.info and the language file
+setedit.mo (I changed it too). It was suggested by Ivan Baldo to avoid
+potential problems with the Debian alternatives which could create a symlink
+editor.info -> default_editor_name.info. It wasn't a simple change because
+just changing it all the old users will get "Can't find 'editor' help" when
+loading old desktop files. So I added an obscure feature: if the editor loads
+an old desktop file and it makes reference to a editor.info that's changed
+to setedit automagically. I know it could be bad, but will help in 99,99% of
+the cases.
+.
+Revision 1.48 1999/04/01 18:56:36 set
+* After fixing my monitor (was a problem in the PCB, very silly, hard to
+find) I starting with the todo list of the day ;-) [the monitor was
+manufactured in march of 1991 ... and then I must read posts in the list
+about trashing three years old equipment ...] Added: a configuration variable
+to the .env files to setup the directory for the support headers. In this
+way you can use installed libraries instead of the provided ones. Requested
+by Ivan Baldo for the Debian package.
+.
+Revision 1.47 1999/04/01 01:25:57 set
+* Added: Now you can enter a VESA mode in the "Screen Options" to use
+something like 132x60 (mode 0x10C). The fonts doesn't work (at least in my
+board). I added it because Grzegorz Adam Hankiewicz <gah@iname.com> asked about
+it.
+
+Revision 1.46 1999/04/01 00:06:03 set
+* Fixed: Now if you save the undo behaves taking in count that the
+"unmodified" copy is now the one on disk. Reported by Thiago F.G.
+Albuquerque <thiagofga@ambr.com.br>.
+.
+Revision 1.45 1999/03/31 23:31:27 set
+* Added the libset.mak and other two .mak files to the source distribution
+because now Robert integrated the new version of the editor to RHIDE and
+people that needs to compile RHIDE without having RHIDE needs this .mak.
+.
+Revision 1.44 1999/03/31 23:15:49 set
+* Added: The "Set Global Options" is now available even if no editors are
+opened. Is funny that I already designed all to support it (static class
+members) but never implemented it until a couple of users pointed it as a
+bug.
+* Fixed: Now if no editor windows are opened the "Set Local Options" command
+is disabled. This and previous were reported/suggested by: Robin Y. Millette
+<millette@bigfoot.com> and Endlisnis <s257m@unb.ca>.
+.
+Revision 1.43 1999/03/31 22:47:44 set
+* Added: a key mapping for cmcSmartUnIndent, I lost it when I did the new
+keyboard handling. Additionally I fixed some wrong explanations about this
+command found in the docs. Reported by Endlisnis <s257m@unb.ca>.
+.
+Revision 1.42 1999/03/31 22:26:02 set
+* Fixed: a problem with the manifest file, it contained distrib/ as prefix
+for all the files and made impossible the uninstall making "rm @manifest/..."
+Reported by Endlisnis <s257m@unb.ca>.
+.
+Revision 1.41 1999/03/31 22:07:08 set
+* Bug killed: GetDefaultScreenSaver() was returning a pointer to a static
+string and then in the Tool&Ops|Options|Editor General I was deleting this
+string. This bug was reported by different persons under different
+situations: Joerg Jungermann <Joerg_Jungermann@accident.cpp.de>, Ivan Baldo
+and Adam Schrotenboer <ajschrotenboer@lycosmail.com>.
+
+Revision 1.40 1999/03/25 00:29:11 set
+* Added the first Debian files from Ivan.
+.
+Revision 1.39 1999/03/23 00:45:10 set
+* Changed: all the references to libtv.a to librhtv.a in the gprs because I
+changed the name of the library.
+* Changed: Now the rhide.env file defines TVISION_INC as the directory where
+the Turbo Vision headers are located. That's needed for the Debian package.
+Before I was defining TVISION pointing to the place where the sources are
+located, but in Debian the sources doesn't need to be installed, just the
+binary package.
+.
+Revision 1.38 1999/03/22 23:45:40 set
+* Fixed: a bug that prevented the use of Linux desktop files under DOS. It
+was very silly but is in all the older versions. The editor was saving a
+random palette and when used in DOS the result was unpredictable (normally a
+black palette). Now the Linux version saves the BIOS default palette.
+.
+Revision 1.37 1999/03/22 23:07:52 set
+* Killed a bug in Tool&Ops|HTML Accents, I forgot to reload the base pointer
+of the buffer and it can be changed while inserting text. I found this bug
+while writing HTML pages about my vacations (the reason of no changes in
+weeks ;-)
+.
+----------------------------------------------------------------------
+v0.4.24 7th public release. Bug fix release.
+
+Revision 1.36 1999/02/22 01:58:45 set
+* Changed version number and updated readme.src.
+
+Revision 1.35 1999/02/22 00:06:07 set
+* Fixed a bug that made the editor crash while loading desktop files older
+than v0.4.20. Introduced by the 1999/02/07 12:55:02 change. From reports of
+Robin Y. Millette <millette@bigfoot.com>, Luis Pistoia <lu5gpl@arnet.com.ar>
+and Martijn Versteegh <VERSTEEGH@KVI.nl>
+* Enhanced the syntax highlight support for .BTM files. Additions by Robin
+Y. Millette <millette@bigfoot.com>.
+* Applied a patch by Andris to librhutil, just to be syncronized because this
+function isn't used from this library.
+
+Revision 1.34 1999/02/18 02:38:33 set
+* Compiled with djgpp v2.02 and gcc 2.8.1. Removed the files needed to patch
+djgpp 2.01.
+
+----------------------------------------------------------------------
+v0.4.23 6th public release, sources and binaries uploaded to DJ's server,
+announced in the djgpp mailing list, binaries and sources uploaded to my
+home page and sources and binaries of the Linux version uploaded to my
+home page. (edi0423s.zip is around 1Mb).
+
+Revision 1.33 1999/02/16 22:04:41 set
+* Changed make by $(MAKE), the first fails in DOS.
+* Added "hurry" chapter to readme.src.
+.
+Revision 1.32 1999/02/15 23:09:07 set
+* Added more information in readme.src, mostly details.
+
+Revision 1.31 1999/02/15 22:54:19 set
+* Added a #error stop point in the libamp sources to warn the user if is
+trying to use Allegro 3.0.
+* Added more instruction to compile the editor without MP3 support.
+* Added a check in the DOS' compress.pl to see if the make of the docs
+was successful.
+
+Revision 1.30 1999/02/15 22:33:11 set
+* Fixed fromunix.pl and added a cp call to copy the djgppenv.env file as
+rhide.env. Similar change in the fromdos.pl.
+* Some clarifications in the readme.src (Perl needed for installation).
+* Added an 'editor' target to the make file (make -f editor.mak), made it the
+default target, made distrib and install depend on the 'editor' target.
+* Added a -f to the rm calls in REMOVE_UNNEEDED to avoid a lot of messages
+from rm, added deletion for /usr and /usr/local locations.
+* Added a check for gzip, makeinfo and successfully docs creation in the
+Linux's compress.pl. Added change.log.gz.
+* Added quick instructions to compile the editor in the readme.txt.
+* Updated the distribution readme.1st and announce (distrib1.txt and
+distrib2.txt) to reflect the last changes.
+* Fixed: a strong bug in the editor, it was possible to select text outside
+the buffer if the last line didn't contain an end of line marker. Even when
+it looks harmless if you tried to delete a block with this 'feature' the
+editor generated a SIGSEGV.
+
+*------- Tagged this point as ivan0423 and sent a copy to Ivan Baldo -------*
+
+Revision 1.29 1999/02/15 00:20:45 set
+* Modified: Now when the editor loads a default desktop file (not from the
+current directory or a project) the default load, save, etc. points are
+ignored. That's important for people that uses only one centralized desktop,
+if I don't do it the editor will remmember the last point where s/he saved
+the file and this is very confusing.
+
+Revision 1.28 1999/02/14 23:52:34 set
+* Added code to setup the tabs colors to a default for all desktop files
+where the value is 0.
+* Added a default for the tabs in the mochrome palette.
+
+Revision 1.27 1999/02/14 23:06:46 set
+* Added the make install target to Linux.
+* Added 'prefix' and 'install' parameters to the Linux compress.pl file.
+* Changed: Now InfView by default searchs the info files in /usr/local/info
+and then in /usr/info.
+* Modified the INSTALL.MAK file to handle the 'prefix' much better.
+* Changed: Now the usage is printed to the stderr.
+
+Revision 1.26 1999/02/14 20:48:35 set
+* Added 'prefix' facility to the DOS compress.pl, using --prefix PREFIX, or
+the environment variables PREFIX and prefix.
+* Added 'install' facility to the DOS compress.pl.
+* Added install target to the makefile.
+* Changed the contrib/setedit directory by contrib/setedit.bin in the binary
+distribution.
+* Updated the year in the about box.
+* Added explanation about the new targets in the readme.txt.
+
+Revision 1.25 1999/02/14 15:23:32 set
+* Updated the copyright year (1999).
+* Updated my telephone number, ugh! now is huge.
+
+Revision 1.24 1999/02/14 14:11:38 set
+* Added help for the new edition modes, the file open dialog and other things.
+* Fixed some typos in the help and menues.
+* Changed all the cmbXXXX references in the help by cmcXXXX.
+* Added context sensitive help to more menu entries, fixed for others.
+* Added context sensitive help to most of the dialogs.
+* Enabled SDG (was accidentally disabled in the 0.4.22/23 snapshots).
+
+Revision 1.23 1999/02/13 15:17:16 set
+* Added an example of menu configuration called redmond.smn, WinCrap users
+should like to try it. Triggered by a suggestion of Thomas Knudsen
+<tk@gfy.ku.dk> to use Ctrl+Tab for next window.
+* Fixed: a problem in my v2.01 libc copy (no in the original) that messed
+some things when ^C was pressed. I don't know if it affected a public release
+of the editor.
+
+Revision 1.22 1999/02/12 22:52:45 set
+* Incorporated the last version of librhutil from Robert and applied the
+patches I did and forgot to tell Robert.
+
+Revision 1.21 1999/02/12 22:28:19 set
+* Changed SETFindFile to FindFiles again and did it available only when using
+STANDALONE, in this way Robert can overwrite it with your own version.
+
+Revision 1.20 1999/02/12 22:16:41 set
+* Fixed: When using Alt+F5 (Show user screen) the editor was polling the
+keyboard without calling idle() and hence eating CPU. Reported for RHIDE by
+Gili <sl@psycode.com>.
+
+Revision 1.19 1999/02/11 00:38:50 set
+* Version 0.4.23 reported by the editor. I already released snapshots of the
+editor with the number inside so is time to reflect it in about and in .dsts.
+
+Revision 1.18 1999/02/11 00:32:08 set
+* Fixed: Sometimes when opening a closed window the cursor position even when
+restored OK was showed in the wrong position giving a surprise when typing.
+* Hey! what a night I killed more bugs today than all the bugs killed in
+december and january *;-)
+
+Revision 1.17 1999/02/11 00:21:08 set
+* Fixed: Tips of the day was using gmtime instead of localtime. It triggered
+the tips at 9:00 pm in my case ;-)
+* Fixed: The printing routines used gmtime instead of localtime. I fixed it
+because I made a global search for gmtime ;-))
+
+Revision 1.16 1999/02/11 00:14:35 set
+* Added support for Windows clipboard in the InfView windows. Suggested by
+Ivan Baldo <lubaldo@adinet.com.uy>.
+* Added a Makefile target called 'distrib' to call the distribution scripts.
+
+Revision 1.15 1999/02/10 23:38:04 set
+* Added: Now the command line is more POSIX compliant, well at least supports
+short and long commands. I used the GPL'd getopts_long function in DOS
+because djgpp lacks this functionallity.
+
+Revision 1.14 1999/02/10 22:23:58 set
+* Added: now when "Scroll lock centers" is on the searchs are centered too.
+Suggested by SpaZe / ST <stealth.tech@usa.net>.
+
+Revision 1.13 1999/02/10 01:06:25 set
+* Fixed the "Compact text" option. Now it doesn't replaces tabs by spaces
+when only one space will be replaced. Reported by Andy <andygoth@juno.com>.
+
+Revision 1.12 1999/02/10 00:35:59 set
+* Fixed a typo in the tips dialog. Reported by Stuart Hall
+<Stuart.Hall@aetna.com>.
+
+Revision 1.11 1999/02/10 00:15:58 set
+* Added a command line switch to enable the Red Hat 5.2 keyboard mapping
+style. Not tested yet (you can see it was under DOS). I found the keyboard
+differences with the help of Tom Aschenbrenner <tom@aschen.com>.
+* Fixed the parsing routines to support strings inside preprocessor lines. An
+interesting thing is that a string opened inside a #define extends the
+#define. I hope it will work ok. Bug reported by SpaZe/ST
+<stealth.tech@usa.net>.
+
+Revision 1.10 1999/02/09 23:10:28 set
+* Some fixes in the documentation:
+ * Fixed some typos.
+ * Added better information about pmacros, was outdated. Suggested by Stuart
+ Hall <fprintf@iname.com>.
+ * Renamed a chapter that have the same name as other and was hided
+ (Miscellaneous).
+ * Added better information about the current license (GPL).
+* Added the copying.* and copyrigh files to the binary distribution.
+
+Revision 1.9 1999/02/09 00:29:46 set
+* Added a new mode to the editor called "Don't move inside tabs". When this
+mode is on is very hard to put the cursor in the middle of a tab (I hope
+quite impossible ;-). When you try to do it the cursor is automagically moved
+to the start of the tab character so when you type you don't get surprises.
+A lot of people asked about it, here is a small list: "a.meyer"
+<hexx3000@schaltzentrale.mvnet.de>, MDaniel <mdaniel@balug.org.ar>, Sinan,
+Andy M Goth <andygoth@juno.com>, etc. With this second addition tabs users
+will get a big boost ;-)
+
+Revision 1.8 1999/02/07 16:48:30 set
+* Added code to support the new "Try" button in the Color Dialog that I added
+to TVision (see the TV package for more information).
+* Added a new mode to the editor called "See Tabs". It paints the tabs, even
+when they are selected. Any similitude to the methode used in killtabs by
+Grzegorz Adam Hankiewicz <gah@iname.com> or the Midnight Commander editor is
+only coincidence ;-)). Additionally: I hope MDaniel will stop complaining
+about what hard is to locate tabs (the same for Andy <andygoth@juno.com>).
+
+Revision 1.7 1999/02/07 12:55:02 set
+* Minor fixes to make the code more RHIDE friendly: RSIndicator link request,
+Expand...() only in standalone (RHIDE uses your own replacement) and renamed
+FindFile to SETFindFile. All from suggestions of Robert after testing the
+first snapshot of 0.4.23 with the new directory structure.
+
+Revision 1.6 1999/01/31 15:37:21 set
+* Included the LibAmp sources in the package to avoid distributing the
+binaries.
+* Linked with Allegro 3.1 and checked the 16 bits sound and additions to
+avoid linking the whole library were incorporated by Shawn (all OK).
+
+Revision 1.5 1999/01/29 01:41:44 set
+* Created the compress.pl Perl script to create the Linux distribution files.
+
+Revision 1.4 1999/01/26 00:16:52 set
+* Various small adjusts to compile under Linux.
+
+Revision 1.3 1999/01/25 23:08:07 set
+* Modified the name files to use the new Uses_n request for the n() macro.
+
+Revision 1.2 1999/01/19 23:47:24 set
+* Passed the files to a CVS repository.
+
+
diff --git a/setedit/change0.log b/setedit/change0.log
new file mode 100644
index 0000000..06752a6
--- /dev/null
+++ b/setedit/change0.log
@@ -0,0 +1,1705 @@
+Revision 0.424 1998/11/19 set
+* Fixed: The message box wasn't updated when the first message was displayed.
+
+Revision 0.423 1998/11/12 set
+* Added: Copy and Paste buttons in the calculator dialog to make it more
+evident.
+
+Revision 0.422 1998/11/12 set
+* Added: Now InfView shows some progress signs while searching. I added it
+because with large info files you could think the editor is hanged.
+
+Revision 0.421 1998/11/12 set
+* Fixed: "Powered Grep" handled wrong links to directories because (1) They
+can be recursive and (2) We can't return to the previous directory with cd ..
+An example is the /usr/linux of my machine where /usr/linux/ncurses points to
+/usr/linux.
+
+Revision 0.420 1998/11/11 set
+* Fixed: Four errors in editor.tx documentation source that stopped makeinfo
+1.68 compiling the HTML docs. Reported by Andris. (Texinfo v3.12).
+
+Revision 0.419 1998/11/11 set
+* Fixed: Some stuff in INSTALL.LINUX and other scripts. Suggested by Ivan
+Baldo.
+
+Revision 0.418 1998/11/11 set
+* Fixed: The Linux version didn't respond to the code page broadcast because
+the code was under a #ifdef __DJGPP__. Reported by Ivan Baldo. *NHP*
+
+Revision 0.417 1998/11/11 set
+* Version 0.4.22 because a new option is saved and I released a couple of
+0.4.21 versions (Ivan Baldo and www.linux.org.ar have these copies).
+
+Revision 0.416 1998/11/11 set
+* Fixed: A bug in InfView when using local messages larger than the english
+version. Patch by Robert.
+
+Revision 0.415 1998/11/06 set
+* Added: An option to run external programs switching the screen because if
+the external program destroys the screen content the editor won't repaint.
+
+Revision 0.414 1998/11/06 set
+* Added: transparent support for gzip compressed files. Currently it only
+works OK if the editor is linked with zlib. The compressed files are
+decompressed to a temporal because the editor then analize the \r\n or \n
+mode. When saving the editor just writes the compressed file using zlib.
+(5-6)
+
+Revision 0.413 1998/11/05 set
+* Added: support for -\*-mode:C;tab-width:8-\*- (note I escaped * ;-)
+settings. In this case the editor will use C syntax highlight and set the
+tabSize to 8. So now users can even use it as a feature of the editor.
+
+Revision 0.412 1998/11/05 set
+* Fixed: If the file had a fake Emacs like mode signaled with "mode:name", for
+example the loadshl.cc itself, the file ends without highlight. Now in this
+case the editor tries with the extension.
+
+Revision 0.411 1998/11/04 set
+* Added: That's a potential source of bugs but I think is a needed feature:
+Now the editor reads the attributes of the file before editing it and after a
+save the attributes are restored to this value. In this way hidden DOS files
+and executable UNIX files are preserved. The DOS attribute called Archive is
+set to 1 *ever* because it means the file changed since the last backup. The
+default attributes for Linux are 644, that's the same I got before modifying
+the routines so I guess is OK, but it could be an option. Now under DOS
+hidden and system files doesn't report a wrong message telling they are
+"read-only", that's a feature(?) of djgpp's libc to prevent users writing
+system sensitive files but is silly from my point of view. A new member
+"mode_t ModeOfFile;" was created to hold this information.
+
+Revision 0.410 1998/11/03 set
+* Added: Linux: when Alt or AltGr is pressed the control of the mouse is let
+to gpm so the user can use it to copy/paste. Was suggested by various Linux
+users because that's what mc does.
+
+Revision 0.409 1998/11/03 set
+* Fixed: when selecting "Open Info" button from the InfView control dialog
+produced a SIGSEGV under Linux because the editor was trying to write in a
+constant string (allocated in code segment).
+
+Revision 0.408 1998/11/03 set
+* Fixed: a bug in the match pair repainting that painted wrong text after a
+whole redraw was done. Reported by Endlisnis <s257m@unb.ca>.
+
+Revision 0.407 1998/11/03 set
+* Fixed: updateflags wasn't initialized. I think it was the reason of a blank
+character drawed in new files drawed randomly from time to time.
+
+Revision 0.406 1998/11/02 set
+* Added: Support for internationalization under Linux using glibc2's gettext.
+
+Revision 0.405 1998/11/02 set
+* Fixed: Now the change directory and palette customization menu options
+doesn't appear under Linux because they aren't ported. Reported by Ivan
+Baldo.
+
+Revision 0.404 1998/11/02 set
+* Fixed: The Syntax Help (Ctrl+F1) failed with info files where the node name
+is different of the name of the function. That's the case of glibc. Reported
+by Ivan Baldo. *NHP*
+
+Revision 0.403 1998/11/02 set
+* Fixed: The screen savers weren't triggered under Linux in the 0.4.21 alpha.
+Reported by Ivan Baldo. *NHP*
+
+Revision 0.402 1998/11/02 set
+* Modified: The Linux distribution is in .tar.gz format now. Already planned
+and Ivan claimed for it ;-))
+
+Revision 0.401 1998/11/01 set
+* Fixed: In the InfView when incrementally typing a name of a node if the
+currently selected link was 0 (none) the editor was accessing to the -1
+element of an array. I saw the crash in Linux and I guess Daniel reported it
+before but wasn't able to explain how to reproduce.
+
+Revision 0.400 1998/11/01 set
+* Fixed: In Linux when pressing Ctrl+RightArrow and editing a DOS file the
+editor stopped in the last character of the line (no move to the next).
+Reported by Andris Pavenis <pavenis@lanet.lv>.
+
+Revision 0.399 1998/11/01 set
+* Fixed: A bug when parsing macros.slp: if a function was commented it failed.
+(The editor reports the error but RHIDE crashes ?!)
+
+Revision 0.398 1998/11/01 set
+* Fixed: Now after running SDG the editor checks if any of the files under
+edition was modified and asks for reload. Normal case if you are taking a
+look to the output file ;-)
+
+Revision 0.397 1998/11/01 set
+* Fixed: The 9Xx34 video modes. The vertical display end was 480 instead of
+476 (14*34). Reported by Ivan Baldo <lubaldo@adinet.com.uy>.
+
+Revision 0.396 1998/11/01 set
+* Added: Syntax highlight support for 8x51 assembler. Contributed by Alex.
+
+Revision 0.395 1998/11/01 set
+* Fixed: The tip of the day didn't advance when it was displayed in the
+message window. Reported by Alex.
+
+Revision 0.394 1998/11/01 set
+* Fixed: a bug in setv sLisp command when an error ocurred in one of the
+parameters (crash). Similar to the one killed yesterday.
+
+Revision 0.393 1998/11/01 set
+* Added: Documentation for some old sLisp commands that I almost forgot. They
+are: left, right, substr, sstr, gstr and setv. And some commands not well
+documented: SendCommands, InsertText, defmacro, eval and Operator +.
+
+Revision 0.392 1998/10/31 set
+* Fixed: A bug in the sLisp interpreter when the code have errors inside a
+eval command that have more than one parameter. The interpreter didn't stop
+at the error and followed parsing with the error condition producing a crash.
+
+Revision 0.391 1998/10/31 set
+* Added: Documentation for WhichEditor and GetSelection.
+
+Revision 0.390 1998/10/31 set
+* Added: A new sLisp command called GetSelection it return the currently
+selected text. A user proposed it to get context help from an external
+program. Suggested by Martijn Versteegh <versteegh@kvi.nl>.
+
+Revision 0.389 1998/10/31 set
+* Fixed: A bug in TestForPropagation accessing 1 line outside the lineLen
+array. I put conditionals in other places that makes access to this array
+checking the index. It produced a random SIGSEGV in Linux when opening a
+string (double quote). Robert detected it and sent a patch but I fixed it in
+a different way.
+
+Revision 0.388 1998/10/31 set
+* Added (or fixed?): Now the recorded macros can record find, replace and find
+again actions. Reported by Burton Radons <loth@gec.net> (CA).
+
+Revision 0.387 1998/10/31 set
+* Fixed: A bug in recorded macros introduced by the new keyboard handling
+(well, new is just an expression it have 1 year ;-), the command associated
+to key strokes recorded wasn't initialized and hence had a random value
+producing random fails.
+
+Revision 0.386 1998/10/31 set
+* Added: Four new values for the sLisp WhicEditor command (2 path, 3 drive, 4
+extention and 5 name without extention). Suggested by Tomas Kouba
+<kouba@fzu.cz>
+
+Revision 0.385 1998/10/21 set
+* Fixed: A bug in SDG, it failed if one of the project files was opened.
+
+Revision 0.384 1998/10/04 set
+* Added: A command line switch to avoid hooking the mouse. It helps to run the
+editor under NT.
+
+Revision 0.383 1998/10/01 set
+* Fixed: The keypad 4 key wasn't mapped to left arrow in my gkey.cc. Reported
+by Gili <sl@psycode.com>.
+
+Revision 0.382 1998/09/30 set
+* Fixed(?): A couple of bugs in the undo related to the fact that the editor
+purges the extra spaces in the lines. The undo still broken but I think I
+won't fix all in 0.4.x but in 0.5.x. There are potential problems when using
+tabs. To see the bugs in older versions just open a new C file, type /*,
+expand it, undo and see how it crash. The other: open a new file, type a
+letter, then a space, enter and try to undo. (Reported by Alex).
+
+Revision 0.381 1998/09/24 set
+* Modified: Now the parser that looks for "errors" reported by external
+programs is more strict about the line number, it must be :nnnn: or will be
+rejected. I did it because "ls -la drive:/file" generates a fake error
+pattern.
+
+Revision 0.380 1998/09/24 set
+* Modified: Some internal stuff about TMLIEditor to simplify the things. Now I
+don't use a callback instead I use static members.
+
+Revision 0.379 1998/09/24 set
+* Added: A new sLisp command (WichEditor [n]). It just returns the name of the
+current editor. The parameter is currently limited to 0 or 1, 0 returns the
+name as-is and 1 without extention. Suggested by Tomas Kouba <kouba@fzu.cz>.
+
+Revision 0.378 1998/09/16 set
+* Added: A new command cmcMouseToggle, that's specially designed for Linux, it
+just enable/disable the mouse (TMouse::suspend/resume), making that the user
+can switch between TVision behavior and default gpm behavior. So disabling
+the mouse and pressing the right button you can paste text from gpm or copy
+text from the screen to the gpm buffer; then pressing the same key sequence
+the mouse is controled by TVision again. Lamentably I didn't found any
+clipboard like routine in the gpm.info documentation.
+
+Revision 0.377 1998/09/15 set
+* Incorporated v0.4.17 to RHIDE 1.4.5.1 experimentally, for that I made some
+adjusts in the editor's code and a couple of patches in RHIDE. Diffs sent to
+Robert.
+
+Revision 0.376 1998/09/14 set
+* Added: An 'R' to the read-only editors in the Windows List.
+
+Revision 0.375 1998/09/14 set
+* Fixed: Paste didn't update the the limit.x value. I think it was the reason
+that triggered the bug killed on 13.08.1998.
+
+Revision 0.374 1998/09/14 set
+* Modified: Now the main project doesn't use small libraries, instead I'm
+using the new RHIDE feature of collecting the .o files living the Project
+Name in blank. It saves disk space and helps to integrate the editor with
+RHIDE.
+
+Revision 0.373 1998/09/12 set
+* Modified: The tool to make the diffs is now a Perl script instead a C++
+program the script is a little bit better and smaller but is slow and uses
+the file utils too much. Conclution: More flexible, faster to code but
+clearly inferior. makediff.cc and makediff.gpr removed from the source tree.
+
+Revision 0.372 1998/09/11 set
+* Added: Support for macros from the menu so you can add menu items for
+different type of compilations. Suggested by Tomas Kouba <kouba@fzu.cz>.
+
+Revision 0.371 1998/09/11 set
+* Added: --help command line option to show the available options.
+
+Revision 0.370 1998/09/11 set
+* Added: --project command line option to load an specific project file.
+Suggested by Brett Porter <blp01@uow.edu.au>.
+
+Revision 0.369 1998/09/09 set
+* Modified: The internal way the editor calls the TCEditor::editorDialog
+member ***** IMPORTANT ***** The member points to the same type of function
+but the default dialogs provided in doedidia.cc are called with a different
+set of parameters. It must be take in count for RHIDE. More about it in the
+doEditDialogLocal function comment in editmain.cc. Was needed to hook the
+file overwrite warning to check if the new name belongs to an already opened
+file.
+
+Revision 0.368 1998/09/09 set
+* Fixed: Under the same situation if you choosing as new name the name of the
+file already opened was posible, it created two copies of the same memory and
+unsynchronized. Now isn't allowed. The same bug exist in RHIDE.
+
+Revision 0.367 1998/09/09 set
+* Fixed: When saving a new file (untitled) if the new name already existed and
+you answered NO to overwrite the name was set anyways. So exiting and
+entering again you get 2 copies of the same file. I saw it while patching
+other stuff.
+
+Revision 0.366 1998/09/09 set
+* Fixed: A silly question like that: "The disk copy of is newer, reload it?"
+triggered because the file didn't exist on disk (new file). RHIDE have the
+same stupid bug.
+
+Revision 0.365 1998/09/09 set
+* Sent the patchs of 08.09 to Robert. I think I sent some patches repeated.
+
+Revision 0.364 1998/09/09 set
+* Fixed: a bug in the HTML accents (10.08.1998). The editor didn't jump to the
+start of the text it could unsinchronize the offset to the first line
+displayed in the screen messing the drawing. *NHP*.
+
+Revision 0.363 1998/09/08 set
+* Fixed: 1) tfiledia.cc to create an input line (TFileInputLine) of PATH_MAX
+characters instead of just 79. 2) tfileinp.cc (TFileInputLine) to copy only
+maxLen+1 bytes instead of anything. Bug reported and studied by Andris
+Pavenis <pavenis@lanet.lv>.
+
+Revision 0.362 1998/09/06 set
+* All TVision patches (10 and 19.08 and 05.09) sent to Robert.
+
+Revision 0.361 1998/09/05 set
+* Fixed: A bug in TFileInfoPane that was writing out of the TDrawBuffer::data
+member when the path was >= 132 characters. Reported by: Daniel Horchner
+<dbjhorchner@hotmail.com>, Patch suggested by: Andris Pavenis
+<pavenis@lanet.lv>. As a result the TDrawBuffer module was rewrited.
+
+Revision 0.360 1998/09/04 set
+* Added: The editor windows that are read-only have and 'R' in the place where
+the modified editors have a star.
+***** IMPORTANT ***** I did an internal change, now the editor class doesn't
+use a TIndicator, instead uses a TSIndicator. TSIndicators are derivated from
+TIndicator but have a pointer to the editor's owner and uses the data
+directly. It simplifies the things and gives more power to the indicator. So
+I did yet another change in the desktop files. Was hard to support the older
+ones because the old indicators are inserted in the Windows and I must remove
+and replace the indicator.
+Version 0.4.21.
+
+Revision 0.359 1998/09/04 set
+* Fixed: a bug in the v0.4.18 desktop files (thanks god this version wasn't
+distributed). In these files the last character of the syntax help data was
+saved as an integer and then the read routine reads a character. I discovered
+it when TSetEditorApp::maxOpenEditorsSame wasn't restored correctly. *NHP*
+(it means Never Hit People, that's because the bug was in a non-released
+version).
+
+Revision 0.358 1998/09/04 set
+* Added: A mechanism to open more than one editor for the same file. The first
+opened is read/write the rest are read-only and shows an snapshot of the file
+at the time you opened it. Read-only editors can't be modified (at least I
+did my best to avoid it ;-) and can't be saved. The number of copies is 1 by
+default to emulate the old behavior, but can be modified from the general
+options menu. This value (TSetEditorApp::maxOpenEditorsSame) is saved in the
+desktop file so the version changed:
+Version 0.4.20. (3-4).
+
+Revision 0.357 1998/09/03 set
+* Version 0.4.19. Triggered by a new value saved (isReadOnly).
+
+Revision 0.356 1998/09/03 set
+* Fixed: I was writing in const chars when remapping the characters of the
+stars screen saver. In DOS that's OK, but Linux doesn't allow it because the
+strings are located in the CS.
+
+Revision 0.355 1998/09/03 set
+* Enabled the code page remaping stuff under Linux. Now is possible to see the
+ISO-8859-1 fonts in the screen without messing the frames. That's the final
+step of the things done in 18-19.08. (30-31.08).
+
+Revision 0.354 1998/08/28 set
+* Added: Inferno 1 and Smoker 1 screen savers for DOS.
+
+Revision 0.353 1998/08/19 set
+* Added: Two variants to the ISO-1 code page to match the lat1-16.psf and
+lat1u-16.psf Linux fonts. That's the first step toward the support of accents
+under Linux. (18-19).
+
+Revision 0.352 1998/08/19 set
+* Enhanced the code page support to provide "similars" for codes under 32.
+That's needed for fonts like lat1-16.psf provided with Debian Linux. BTW: I
+think they are broken by design.
+
+Revision 0.351 1998/08/19 set
+* Modified: Three TVision classes (TMenuBox, TIndicator and TRadioButtons) to
+support code pages.
+
+Revision 0.350 1998/08/18 set
+* Added: 22 new symbols to the fonts to support the things described in the
+next lines.
+
+Revision 0.349 1998/08/16 set
+* Fixed: Another bug in the keyboard assigment routines. Yes another one not
+catched under DOS! Was in the CompactTable routine, a call to memcpy used
+"size" as size instead of "aux".
+
+Revision 0.348 1998/08/16 set
+* Fixed: The editor was saving the keybind.dat in the share directory instead
+of the home directory [Linux specific].
+
+Revision 0.347 1998/08/16 set
+* Fixed: a problem in the keyboard assigment routines. The bug was related to
+one variable (base) not updated after a realloc and hence becoming an invalid
+pointer. It was detected under Linux because in DOS the block wasn't reused
+and the content still valid.
+
+Revision 0.346 1998/08/16 set
+* Fixed: Now the Linux version generates and uses the same desktop files that
+the DOS. I forgot to save/restore the palette information in the Linux
+version. It produced a SIGSEGV while loading DOS desktop files. Now v0.4.18
+desktop files are compatible (DOS <-> Linux). The Linux version can load
+desktop files created with previous Linux versions but not with previous DOS
+versions.
+
+Revision 0.345 1998/08/16 set
+* Fixed: a problem in the conditional menues (8/8/98). I was adding constant
+strings to a collection :-P, Linux free was upset.
+
+Revision 0.344 1998/08/13 set
+* Fixed: A problem in Save As UNIX. It used the maximun line width to allocate
+a temporal buffer in the stack but this value (limit.x) could be
+unsynchronized (is used only for the scroll bars) and in this case the stack
+was corrupted. Now I allocate it in the heap and check if the len is enough
+for each line, if not I realloc the buffer and adjust limit.x. Reported by
+Brett Porter <blp01@uow.edu.au>.
+Interesting Notes: was an interesting analisis of the trace back collected by
+the editor. Additionally Brett didn't lost the changes because the editor
+saved the buffer correctly in the error file.
+
+Revision 0.343 1998/08/13 set
+* Fixed: The routine that meassure the size of the nodes in InfView. I never
+saw a side effect but it had a potential flaw.
+
+Revision 0.342 1998/08/13 set
+* Fixed: InfView didn't take in count the last entry of the dir files created
+by Debian Linux, these files aren't true info files and hence needs some
+special treatment. Reported by Daniel Mizyrycki (mdaniel@balug.org.ar).
+
+Revision 0.341 1998/08/12 set
+* Fixed: All the declarations of consts without specifying the type (default
+int) that's reported as a warning by egcs (not reported by gcc 2.7.x or
+2.8.x). Reported by Andris Pavenis <pavenis@lanet.lv>. Some interesting
+things: to do it I did a masive search for 'const' using the grep tool of the
+editor I got 910 lines in the message window and I opened 180 files using
+ALT+F8 Wow!
+
+Revision 0.340 1998/08/12 set
+* Fixed: Now using localtime instead of gmtime for the editor's clock.
+(Reported by Laszlo Molnar <molnarl@cdata.tvnet.hu>).
+
+Revision 0.339 1998/08/12 set
+* Fixed: The way the editor copy text to the Windows clipboard. Now the
+clipboard is first erased and then the text is passed as OEM text instead of
+just text. Reported by Endlisnis <s257m@unb.ca>, ideas for solutions by:
+Michael Mauch <michael.mauch@gmx.de> and Eli Zaretskii <eliz@is.elta.co.il>.
+
+Revision 0.338 1998/08/12 set
+* Fixed: Autoindent didn't take in count the first line of the file. (Reported
+by Brett Porter <blp01@uow.edu.au>).
+
+Revision 0.337 1998/08/12 set
+* Applied a patch from Robert to initialize Extention in SHLSelect of
+loadshl.cc.
+
+Revision 0.336 1998/08/12 set
+* Fixed: An annoying 'flash' when selecting in a line under edition and the
+old selection was hided. This was annoying me since I made the selection work
+with messages to avoid reading the shift state.
+
+Revision 0.335 1998/08/11 set
+* Modified: Now the default screen saver for DOS>=7.00 (Winshit) is a text
+mode screen saver because a user reported problems when the editor switchs to
+graphics mode and is windowed. It works 100% ok in most of the machines but
+I'm using a safe default. I hate winblows. Problem reported by Brett Porter
+<blp01@uow.edu.au> and I saw an strange behavior (just ones) in the Alex's
+computer.
+
+Revision 0.334 1998/08/11 set
+* Fixed: The progress bar now is "code page" friendly.
+
+Revision 0.333 1998/08/11 set
+* Adjusted: Some things in the syntax search. Enlarged the window to choose
+the match, now doesn't say that no matchs were found if you cancel and
+reduced the length for the info file name.
+
+Revision 0.332 1998/08/10 set
+* Fixed: The project window now supports code page remapping.
+
+Revision 0.331 1998/08/10 set
+* Fixed: The TListViewer TVision's class to support code page remaping of the
+column separator character. Needed for the project window.
+
+Revision 0.330 1998/08/10 set
+* Added a tool to convert accented characters to HTML tags. The editor used
+the HTML entities like Oacute. The tool takes in count the selected code page
+so it will work ala WYSIWYG. For example: The oacute of PC437 is the cents
+symbol in ISO-1 so if you call the tool while 437 is selected you'll get
+&oacute; but if you do it while ISO-1 is selected you'll get &cent;. I need
+it for my pages in spanish ;-) (9-10).
+
+Revision 0.329 1998/08/09 set
+* Fixed a bug in the ISO-1 fonts. The editor was using &reg; for both &reg;
+and &copy; (HTML notation).
+
+Revision 0.328 1998/08/08 set
+* Added "Save As DOS" for Linux isn't very well tested, just tried and seems
+to work.
+
+Revision 0.327 1998/08/08 set
+* Added shortcuts for Grep and jump to function in the menu. Added various
+menu entries just to show the key to make the action and help new users.
+Added labels with the keys assigned to various commands specially in
+"Rectangle". Various changes in the menues. Jump to Function suggested by
+Brett Porter <blp01@uow.edu.au>. Local/Global edition options repeated in
+Options suggested by Ivan Baldo <lubaldo@adinet.com.uy>
+
+Revision 0.326 1998/08/08 set
+* Added a primitive conditional support in the menu files to define menu
+options dependent of the OS.
+
+Revision 0.325 1998/08/02 set
+* Added support for HP laser printers. Now the initialization string created
+by the HP button works with: LaserJet 4L, 5M, DeskJet 500+, 560C, 670 and I
+guess most of the Laser/DeskJet modern models. Problem reported by "Roger H."
+<rogerh40@aa.net>, solutions by: Roger, Mariano Alvarez Fernandez
+<malfer@teleline.es> and me.
+
+Revision 0.324 1998/08/01 set
+* Added syntax highlight for Perl submited by Daniel Mizyrycki
+(mdaniel@balug.org.ar).
+
+Revision 0.323 1998/08/01 set
+* Added a progress bar in InfView, displayed when InfView loads a large index
+(20 seconds for rbint).
+
+Revision 0.322 1998/07/30 set
+* Added syntax help to the editor. (27-30). Similar to the RHIDE but with many
+improvements: Sort by score, a dialog to set up the list of nodes to search,
+information about the number of nodes from each file, etc.
+
+Revision 0.321 1998/07/30 set
+* Killed a bug in InfView introduced by the modifications made 17.06.1998. In
+seekToNode(const char *Name).
+
+Revision 0.320 1998/07/26 set
+* Applied parser v0.66 from Laszlo. It now supports expression,x to convert
+the expression into hexadecimal notation (o=octal, d=decimal and b=binary).
+
+----------------------------------------------------------------------
+Revision 0.319 1998/07/21 set
+* Version 0.4.17. 5th public release. Diffs sent to Robert. Linux release
+available in the web.
+
+Revision 0.318 1998/07/19 set
+* Fixed: The powered grep under Linux because it uses response files (not
+supported by bash). Now the editor writes an script and runs the script ;-)
+
+Revision 0.317 1998/07/19 set
+* Now the editor restores the ALT+Fn console keys when it dies under Linux. I
+added a call to suspend_keyboard() in the routine that handles the hard
+signal.
+
+Revision 0.316 1998/07/19 set
+* More adjustments in the places where the files are stored when running under
+Linux. Now the editor's enviroment variables are stored in ~/.setenvir.dat.
+The readme.1st file is loaded from SET_FILES.
+
+Revision 0.315 1998/07/19 set
+* The @0 marker in pmacros now can be placed in a position where there is no
+text (for example because the editor will purge the spaces at the end of
+line). It was the cause of a bug in Linux: after expanding a pmacro like "#d"
+the cursor was moved to the next line and another bug in DOS: the cursor was
+positioned in the \r. I don't know how dangerous was the DOS bug because I
+never saw the side effect but looks like a bad one. (Now the @0 is stored as
+an X,Y coordinate).
+
+Revision 0.314 1998/07/18 set
+* Killed a bug in the "Match pair highligth" option. When typing three
+consecutive symbols one weren't correctly un-highligthed.
+
+Revision 0.313 1998/07/18 set
+* Added a new sLisp command to call external programs. The syntax is:
+(RunProgram "prg1;prg2;..."). It calls the program/s specified, captures the
+stderr and show the errors in the message window. With that the user can
+assign any program to any key. It was added because a comment of Tomas Kouba
+<kouba@fzu.cz> about the need of running different makefiles from the same
+project. To avoid conflicts with RHIDE the function that calls the external
+program is part of the editor and a dummy is provided in rhideint.cc. Robert:
+you should fill the body of this dummy with a call to a function that makes
+this work inside RHIDE. Note: The editor currently capture stderr AND stdout,
+so all is callected. As an example I did a vey simple macro that shows the
+contents of the current directory using "ls -la".
+
+Revision 0.312 1998/07/18 set
+* Added support for Emacs style syntax highlight selection. Added because a
+request of Gili <sl@psycode.com> about the fact that new C++ standards (dead
+brain ones) specify headers without extentions. For this reason now Boolean
+TCEditor::loadFile() takes a parameter, Boolean setSHL, when true the
+function sets the syntax highlight searching for -*- SHL name -*- in the
+first Kb and the last 3Kb of the file as Eli suggested (Emacs behavior), if
+that isn't found the extention is used. The only place where loadFile is
+called in this way is in the constructor. By default the parameter is False
+making the function call compatible with previous versions. The other place
+where the SHL is set automatically is in the SaveAs member. Additionally I
+added support for some strange files (from SGI and HP found in GNU C++
+libraries) that uses a "mode:C++" keyword. The editor uses the list of
+extentions as valid modes so I added "C++" as an extention (see syntaxhl.shl
+file).
+
+Revision 0.311 1998/06/17 set
+* Various modifications in the paths used to load/store the configuration
+files under Linux. Mainly: now the user saves in your home hidden files and
+the editor looks first for these files and then in the share directory. Not
+tested.
+
+Revision 0.310 1998/06/17 set
+* Modified the Linux version to open the redirected stderr file in the home
+directory instead of the share. (Suggested by Laszlo).
+
+Revision 0.309 1998/06/17 set
+* Fixed a bug in InfView. It was jumping to nodes of similar names in DOS
+files (fade_interpolate v.s. fade_in in Allegro 3.0 info). It was because
+both pass a test with strncmp(s1,s2,strlen(s2)). (Reported by Gili).
+
+Revision 0.308 1998/06/16 set
+* Replaced the libc __dpmi_yield by the new version provided by Eli.
+
+Revision 0.307 1998/06/15 set
+* Added a dialog to configur the Num-Lock behavior. Suggested by Eli.
+
+Revision 0.306 1998/06/14 set
+* Patched Allegro to mix the sound in 16 bits instead of 8 bits. Patches sent
+to Shawn. (13-14).
+
+Revision 0.305 1998/05/25 set
+* Fixed some things in the MP3 stuff, patched Allegro to save 150Kb in the exe
+file. Patches sent to Shawn.
+
+Revision 0.304 1998/05/24 set
+* Added: MP3 songs player! I think the exe will explode ;-)
+
+Revision 0.303 1998/05/24 set
+* Fixed: In the key bindings, when selecting a command, now the commands list
+have the focuse at start and not "Cancel".
+
+Revision 0.302 1998/05/24 set
+* Added: Insert shortcut in the list of windows dialogs.
+
+Revision 0.301 1998/05/24 set
+* Added: Insert & Delete shortcuts in the key binding dialogs.
+
+Revision 0.300 1998/05/23 set
+* Added: Built-in support for gziped .info files (no more calls to gzip).
+
+Revision 0.299 1998/05/23 set
+* Rearranged some directories for PCRE and ZLib.
+
+Revision 0.298 1998/05/22 set
+* Added: When jumping to a function now the editor searchs the closest name to
+the word under cursor and selects it in the list (Suggested by Alex).
+
+Revision 0.297 1998/05/22 set
+* Updated this change.log file. (21-22).
+
+Revision 0.296 1998/05/20 set
+* Moved various dialogs to new files to allow Robert to use my dialogs.
+
+Revision 0.295 1998/05/20 set
+* Applied the patchs I did in Linux to the mainversion.
+
+Revision 0.294 1998/05/19 set
+* Added: Now file open stores the path+mask in the history.
+
+Revision 0.293 1998/05/17 set
+* Fixed: A double call to free in the dskwin that handles InfView. It produced
+a SIGSEGV in Linux during the exit.
+
+Revision 0.292 1998/05/17 set
+* Ported to Linux. It was the first time I did it. Sent copies to Dim (RU) and
+Laszlo (HU) for testing.
+
+Revision 0.291 1998/05/15 set
+* Fixed: A typo (ligth en lugar de light). (Reported by a Linux user).
+
+Revision 0.290 1998/05/15 set
+* Fixed: Applied various small patchs from Robert mainly related to Linux.
+
+Revision 0.289 1998/05/15 set
+* Added: Mapped Shift+BackSpace to BackSpace by default. Mapped Shift+Enter to
+Enter. (Suggested by Peter Palotas <blizzar@hem1.passagen.se>).
+
+Revision 0.288 1998/05/15 set
+* Fixed: GKey: Num-Lock OFF, Shift+Gray Number is reported by BIOS like a
+number instead an arrow key. (Reported by Gili <sl@psycode.com>).
+
+Revision 0.287 1998/05/14 set
+* Fixed: Compact text doesn't have undo so using undo produced problems.
+(Reported by Peter Palotas <blizzar@hem1.passagen.se>).
+
+Revision 0.286 1998/05/13 set
+* Version 0.4.16.
+
+Revision 0.285 1998/05/13 set
+* Added: New search & replace system, includes tags in the replace and
+Perl-Compatible Regular Expressions. (9-13). (Suggested by Laszlo).
+
+Revision 0.284 1998/04/08 set
+* Version 0.4.15.
+
+Revision 0.283 1998/05/08 set
+* Added: The search & replace options are stored in disk. (Suggested by Elias
+Pschernig <f.x.gruber-museum-arnsdorf@ magnet.at>).
+
+Revision 0.282 1998/05/08 set
+* Added: Now the file open dialog memorize the points where the files are
+stored/loaded and have a Home button to go back to the point where the editor
+was loaded.
+
+Revision 0.281 1998/05/07 set
+* Added: Now the editor warns if gzip or grep aren't installed and they are
+needed. Only under DOS.
+
+Revision 0.280 1998/05/07 set
+* Added: About window.
+
+Revision 0.279 1998/05/07 set
+* Finished: Tips in the message window.
+
+Revision 0.278 1998/05/06 set
+* Added: Now if the user doesn't define SET_FILES and/or INFOPATH the editor
+tries to guess and only complains if fails in the guess.
+
+Revision 0.277 1998/05/06 set
+* Fixed: Now the readme.1st is loaded just once even is the user doesn't
+disable the mini-about dialog.
+
+Revision 0.276 1998/05/06 set
+* Fixed: Now instead of using _truename+_fixpath (see 14.12.1997) I use the
+device number and starting i-node to know if the file is already opened. The
+first methode fails under DOS+NETX (Novell). (Reported by Alex, Suggested by
+Eli,IL).
+
+Revision 0.275 1998/05/06 set
+* Fixed: Now to know if a file is read only I use stat and not fstat because
+it fails in DOS+NETX (Novell). (Reported by Alex).
+
+Revision 0.274 1998/05/06 set
+* Added: All in the window that asks for replace. (Suggested by a user).
+
+Revision 0.273 1998/05/06 set
+* Added: Dialogs with my easydiag library.
+
+Revision 0.272 1998/05/06 set
+* Added: Tip of the day.
+
+Revision 0.271 1998/05/06 set
+* The following wasn't made in this day but in the last two weeks.
+
+Revision 0.270 1998/04/22 set
+* Fixed: InfView failed to handle splitted .info files when the file weren't
+located in the INFOPATH directories.
+
+Revision 0.269 1998/03/26 set
+* Added: Help for the pull down menues. (25 and 26).
+
+Revision 0.268 1998/03/18 set
+* Added: Enabled Ctrl+Shift+9 and Ctrl+Shift+0 to match parentheses. But for
+this you'll need to load my TSR that expands the BIOS functionallity because
+BIOS doesn't report some keyboard combinations.
+
+Revision 0.267 1998/03/18 set
+* Added: Now the command to search the complementary pair (parentheses, etc.)
+is mapped to Ctrl+Q-ESC like in BC. (Wasn't asigned in v0.4.x).
+
+Revision 0.266 1998/03/18 set
+* Fixed: A silly limitation of 99 columns in the wrap column setting (Reported
+by Brett Porter,AU).
+
+Revision 0.265 1998/03/03 set
+* Added: After selecting a project item with an incremental search the search
+is restored to 0 length allowing another search.
+
+Revision 0.264 1998/03/02 set
+* Bug Killed: The .dst files weren't closed avoiding the deletion of these
+files by ALT+Q. (Only under W95).
+
+-----------------------------------------------------------------------------
+Revision 0.263 1998/02/28 set
+* Version: 0.4.14. Sent to Robert and included in RHIDE 1.4.5 (?)
+
+Revision 0.262 1998/02/28 set
+* Added: When searching and the match is at the right of the screen now all
+the word is showed and no just the first character. (Suggested by Ivan
+Baldo,UY).
+
+Revision 0.261 1998/02/28 set
+* Added: A warning in files with ASCII 0 (Suggested by Laszlo).
+
+Revision 0.260 1998/01/27 set
+* Bug Killed: Problems to change the read-only mode in plain DOS because the
+file was opened (it works in W95).
+
+Revision 0.259 1998/01/21 set
+* Bug Killed: When using a generic SHL in lines with many spaces at the end of
+the visible line the painting buffer overflowed generating a GPF.
+
+Revision 0.258 1998/01/18 set
+* Fixed: 0x SHL failed when Case=0.
+
+Revision 0.257 1998/01/18 set
+* Added: A new command to the SHL language.
+
+Revision 0.256 1998/01/18 set
+* Added: SHL for NASM files (Ivan,IT).
+
+Revision 0.255 1998/01/03 set
+* Version 0.4.13 released to the public (4th).
+
+Revision 0.254 1998/01/03 set
+* Bug Killed: A huge bug in truename producing a rename of the directory
+instead of the back up file under W95. (Reported by Ilya,RU).
+
+Revision 0.253 1997/12/27 set
+* Bug Killed: Another bug in autoindent.
+
+Revision 0.252 1997/12/27 set
+* Added: A warning when opening read-only files and a try to revert the flag.
+
+Revision 0.251 1997/12/27 set
+* Bug Killed: A GPF if the open file failed. (Reported by Ilya,RU).
+
+Revision 0.250 1997/12/27 set
+* Bug Killed: When running the editor by first time or with a .dst older than
+v0.3.0 the selected code page were -1 selecting ISO Latin 1. (Reported by Ed
+<Myknees@aol.com>).
+
+Revision 0.249 1997/12/27 set
+* Fixed: Some russian and normal chars in 3 fonts. (Reported by Alexander
+Bokovoy,BY).
+
+Revision 0.248 1997/12/14 set
+* Release v0.4.12 to the public (3rd).
+
+Revision 0.247 1997/12/14 set
+* Bug Killed: The grep interface showed a double slash for root directories.
+(Reported by Laszlo).
+
+Revision 0.246 1997/12/14 set
+* Added: ESC now is mapped to un/hide the selection instead of an ASCII 27.
+(Suggested by Laszlo).
+
+Revision 0.245 1997/12/14 set
+* Added: F5 to zoom the keyboard dialogs. (Suggested by Laszlo).
+
+Revision 0.244 1997/12/14 set
+* Bug Killed: The editor allowed to save files with long names in no LFN
+systems it allowed the user to open the same file twice, now the editor calls
+truename to solve it.
+
+Revision 0.243 1997/12/14 set
+* Bug Killed: Save As didn't ask for overwrite.
+
+Revision 0.242 1997/12/14 set
+* Modified: Hidded the mouse in the screen savers and made the text mode
+screen savers more multitasker friendly. (Suggested by Gili
+<sl@psycode.com>).
+
+Revision 0.241 1997/11/29 set
+* Version 0.4.12. Beta testing version sent to Hungary, Byelorrussia and USA.
+
+Revision 0.240 1997/11/29 set
+* Bug Killed: Some options in Ctrl+Q-A where in reverse order.
+
+Revision 0.239 1997/11/23 set
+* Added: Support for code pages that remaps graphic characters under the ASCII
+128.
+
+Revision 0.238 1997/11/23 set
+* Bug Killed: A memory corruption in the scroll bars when changing the code
+page.
+
+Revision 0.237 1997/11/22 set
+* Hey man a record, 15 things in a day ;-)
+
+Revision 0.236 1997/11/22 set
+* Bug Killed: When shelling to DOS the editor didn't turn off the stderr
+redirection.
+
+Revision 0.235 1997/11/22 set
+* Modified: Now the EXE makes the stderr redirection and not the batch so now
+is possible to run two copies of the editor under a multitasker without
+problems.
+
+Revision 0.234 1997/11/22 set
+* Added: A mode where the editor creates only one .dst file and not one by
+directory. (Suggested by Marek Habersack & Martijn Versteegh).
+
+Revision 0.233 1997/11/22 set
+* Added: When making a search and the string to search is composed only by
+letters and regex is enabled the editor makes a normal search (that's 10
+times faster) (Suggested by Laszlo).
+
+Revision 0.232 1997/11/22 set
+* Modified: File|Open now uses * instead of *.* (Suggested by Laszlo)
+
+Revision 0.231 1997/11/22 set
+* Added: A different color for non-reserved words. (Patch by Robert).
+
+Revision 0.230 1997/11/22 set
+* Modified: Now under DOS when calling grep I force command.com as the shell
+because bash fails. (Reported by Laszlo).
+
+Revision 0.229 1997/11/22 set
+* Modified: The name of the message window in the ALT+0 list (box to window).
+(Reported by Laszlo).
+
+Revision 0.228 1997/11/22 set
+* Bug Killed: A complex thing in the video mode setting solved some time ago
+but not enabled.
+
+Revision 0.227 1997/11/22 set
+* Added: Dialogs with re-size in the keyboard setting (Suggested by Laszlo).
+
+Revision 0.226 1997/11/22 set
+* Added: Zoom with F5 key in the "Jump to function" dialog. (Suggested by
+Laszlo).
+
+Revision 0.225 1997/11/22 set
+* Bug Killed: Problems with Ctrl+F5 (and then Shift+Arrow) because of the new
+keyboard system. (Reported by Laszlo).
+
+Revision 0.224 1997/11/22 set
+* Modified: A problem in strftime producing ":00" in the clock at 24 hs.
+(Patch from Laszlo).
+
+Revision 0.223 1997/11/22 set
+* Added: Code page support for InfView and message windows.
+
+Revision 0.222 1997/11/22 set
+* Bug Killed: The code page change broadcast message were stoped in the first
+editor window because a clearEvent. (Reported by Laszlo).
+
+Revision 0.221 1997/11/21 set
+* Added: __dpmi_yield to cooperate with multitaskers (Suggested by Gili
+<sl@psycode.com>, an OS/2 user).
+
+Revision 0.220 1997/11/21 set
+* Bug Killed: The options in the "windows" menu now are dis/enabled in the
+idle loop.
+
+Revision 0.219 1997/11/21 set
+* Bug Killed: A GPF when selecting the previous windows and the desktop was
+empty. (Reported by Laszlo).
+
+Revision 0.218 1997/11/21 set
+* Added: Support for russian code pages: CP866, Win1251, KOI-8 and ISO-5.
+(With information from Alexander Bokovoy).
+
+Revision 0.217 1997/11/13 set
+* Bug Killed: Fails in the position of the clock after changing the video
+mode.
+
+Revision 0.216 1997/11/13 set
+* Bug Killed: The starts screen saver weren't remaped when using code pages.
+
+Revision 0.215 1997/11/13 set
+* Bug Killed: Problems with underscores when using incremental searchs in
+InfView. (Reported by Laszlo).
+
+Revision 0.214 1997/11/05 set
+* Bug Killed: Wrap were affected by the Intelligent C indent mode, now it
+inserts a pure CR/LF.
+
+Revision 0.213 1997/11/03 set
+* Bug Killed: When parsing absolute paths reported by grep it failed. I fixed
+it with an heuristic, I don't know if that's the definitive solution.
+
+Revision 0.212 1997/11/03 set
+* Bug Fixed: The grep interface didn't work for files opened or in the
+project. (Reported by Laszlo).
+
+Revision 0.211 1997/11/03 set
+* Added: The video mode can be set using an external program. (Suggested by
+Laszlo).
+
+Revision 0.210 1997/11/02 set
+* Version 0.4.10.
+
+Revision 0.209 1997/11/02 set
+* Added: The screen saver settings are stored in the desktop file.
+
+Revision 0.208 1997/11/02 set
+* Added: Dialog for the screen saver parameters.
+
+Revision 0.207 1997/11/02 set
+* Added: Text mode screen savers for UNIX.
+
+Revision 0.206 1997/10/31 set
+* Added: Plasma screen saver.
+
+Revision 0.205 1997/10/31 set
+* Version 0.4.9.
+
+Revision 0.204 1997/10/31 set
+* Added: Clock, dialog and save of the setting. (Requested by Laszlo).
+
+Revision 0.203 1997/10/31 set
+* Modified: The Aacute and Agrave in the ROM font.
+
+Revision 0.202 1997/10/31 set
+* Added: Now you can use keys to customize the palette (rRgGbB). (Requested by
+Laszlo).
+
+Revision 0.201 1997/10/30 set
+* Added: Now the menues are configured with symbols and you don't need to
+compile the file. The file have .smn (Set MeNu) extention.
+
+Revision 0.200 1997/10/29 set
+* Added: ISO Latin 2 code page.
+
+Revision 0.199 1997/10/29 set
+* Version 0.4.8 released. Second public release.
+
+Revision 0.198 1997/10/29 set
+* Added: More help (sLisp and Keyboard).
+
+Revision 0.197 1997/10/29 set
+* Added: After running a DOS command the editor checks if some file were
+altered and asks to reload.
+
+Revision 0.196 1997/10/29 set
+* Added: When a file is opened the window is zoomed but pressing F5 you can
+reduce the size enough to see the message window.
+
+Revision 0.195 1997/10/28 set
+* Added: More help (Modes and SHL).
+
+Revision 0.194 1997/10/28 set
+* Modified: The message window now is ever hidded when the editor starts
+because is even empty.
+
+Revision 0.193 1997/10/28 set
+* Added: The editor reports the version during a GPF to allow me run symify
+with the right .EXE.
+
+Revision 0.192 1997/10/28 set
+* Version 0.4.8.
+
+Revision 0.191 1997/10/28 set
+* Now the grep options are stored in the desktop file.
+
+Revision 0.190 1997/10/28 set
+* Bug Fixed: The special lines were shifted by one.
+
+Revision 0.189 1997/10/28 set
+* Bug Fixed: In the grep interface, not using the dirs. when the recursive
+mode were off.
+
+Revision 0.188 1997/10/28 set
+* Bug Fixed: More problems in autoindent.
+
+Revision 0.187 1997/10/28 set
+* Bug Fixed: A wrong order of the options in the Search & replace dilaog.
+
+Revision 0.186 1997/10/28 set
+* Added: Now the editor saves all the modified buffers when makes a call to
+DOS.
+
+Revision 0.185 1997/10/28 set
+* Bug Killed: Introduced in the changes for autoindent.
+
+Revision 0.184 1997/10/28 set
+* Modified: The readme.1st for the v0.4.7.
+
+Revision 0.183 1997/10/27 set
+* Modified: Now Autoindent looks in the text BEFORE inserting the CR and not
+AFTER. Looks that's the right way.
+
+Revision 0.182 1997/10/27 set
+* Added: The editor loads automagically the readme.1st each time you install a
+new version.
+
+Revision 0.181 1997/10/26 set
+* Hey man I added it on my birthday!
+
+Revision 0.180 1997/10/26 set
+* Added: Support for the way that make uses to report when it enters and
+leaves a directory.
+
+Revision 0.179 1997/10/26 set
+* Bug Killed: Grep were called recursively all the time.
+
+Revision 0.178 1997/10/25 set
+* Added: Code to enable the "special lines" feature of the editor so if you
+add lines to the code the line numbers of the errors are adjusted.
+
+Revision 0.177 1997/10/25 set
+* Added: Errors parsing for GNU tools so you can jump to the offending line.
+
+Revision 0.176 1997/10/24 set
+* Added: Pressing a key starts a configurable system command (make as
+default).
+
+Revision 0.175 1997/10/24 set
+* Added: A mode where Scroll Lock centers the screen.
+
+Revision 0.174 1997/10/24 set
+* Added: Regular expressions in search & replace. There are some limitations
+like: the match at the start & end of a line commands fails (Suggested by
+Erwin Waterlander <waterlan@xs4all.nl>).
+
+Revision 0.173 1997/10/23 set
+* Version 0.4.2.
+
+Revision 0.172 1997/10/23 set
+* Added: A dialog to turn on the save UNIX as UNIX and the creation of .BKP
+files. Stored this information in the desktop file.
+
+Revision 0.171 1997/10/23 set
+* Added: A flag to store the UNIX files in UNIX format under DOS. (Suggested
+by Laszlo).
+
+Revision 0.170 1997/10/23 set
+* Bug Killed: Ctrl+BackSpace wrongly mapped to Ctrl+BackSlash. (Reported by
+Laszlo).
+
+Revision 0.169 1997/10/23 set
+* Bug Killed: When the editor were used without a syntax.shl and using the
+local options produced a GPF. (Reported by Laszlo).
+
+Revision 0.168 1997/10/23 set
+* Added: A binary file for enviroment variables to store persistent and global
+settings.
+
+Revision 0.167 1997/10/23 set
+* Added: "Don't ask again" in TVision for the QUIT dialog.
+
+Revision 0.166 1997/10/23 set
+* Modified: Now if SET_FILES isn't declared the editor doesn't run.
+
+Revision 0.165 1997/10/23 set
+* Bug Killed: Now ESC in the Quit dialog doesn't mean OK (Alex).
+
+Revision 0.164 1997/10/23 set
+* Modified: The message showed but Quit to be more specific (asked by
+Myknees@aol.com).
+
+Revision 0.163 1997/10/23 set
+* Bug Fixed: When pasting and selecting.
+
+Revision 0.162 1997/10/23 set
+* Added: 82x25 mode (8x16 fonts).
+
+Revision 0.161 1997/10/22 set
+* Added: Palette customization.
+
+Revision 0.160 1997/10/21 set
+* Various things added these days: Fonts, dual fonts and code pages for fonts.
+Grep interface.
+
+Revision 0.159 1997/10/07 set
+* Version 0.4.1. First public release of the standalone editor.
+
+Revision 0.158 1997/10/07 set
+* Modified: In "#define xxxx\n" now the color is used only upto the \n and not
+in the rest of the line (StarLost request).
+
+Revision 0.157 1997/10/07 set
+* Bug Killed: "#define .... /* ....\n.....*/ \\\n more" then "more" were
+outside the preprossesor (wrong) (rep. by Robert).
+
+Revision 0.156 1997/10/07 set
+* Added: Use of pipes under Linux to print.
+
+Revision 0.155 1997/10/07 set
+* Added: Commands to print in an HP deskjet.
+
+Revision 0.154 1997/10/07 set
+* Modified: The options to configure the ALT keys.
+
+Revision 0.153 1997/10/06 set
+* Added: Save without altering the date and time.
+
+Revision 0.152 1997/10/06 set
+* Bug Fixed: In the selection.
+
+Revision 0.151 1997/10/05 set
+* Modified: Now cmcDelCharClear is the default for DEL because the M$ products
+use it and the people is too used to it. (Suggested by Peter Palotas
+<blizzar@hem1.passagen.se>).
+
+Revision 0.150 1997/10/05 set
+* Bug Killed: Sequence: "\n\nfoo The up and ^T ^T and finally Undo Undo" =>
+the f dissapears. It was a complex bug in the Undo logic, the fix wasn't so
+clean and clear.
+
+Revision 0.149 1997/10/05 set
+* Added: Support for 105 keys keyboards.
+
+Revision 0.148 1997/10/05 set
+* Added: Support in TVision to configure wich of the two ALT keys are used for
+the menu (can be both).
+
+Revision 0.147 1997/10/05 set
+* Modified: Redesigned the keyboard configuration dialogs.
+
+Revision 0.146 1997/10/03 set
+* Compacted all the symbol tables used for SHL (C, Pascal and Clipper) in one.
+Now the routine to determine if a character is or not part of a word doesn't
+use isalpha() (broken in djgpp because doesn't understand values over 128).
+Now it uses the same table used for symbols.
+
+Revision 0.145 1997/10/02 set
+* Version 0.4.0. As you can see it was a revolution ;-)
+
+Revision 0.144 1997/10/02 set
+* Splitted handleEvent in sub-routines to make it easier to understand.
+
+Revision 0.143 1997/10/02 set
+* Now the recorded macros are stored in a different way so the sLisp generated
+code is different.
+
+Revision 0.142 1997/10/02 set
+* Modified the selection system now it uses only messages it have as a side
+effect that now behaves like the BC one (I don't like it).
+
+Revision 0.141 1997/10/02 set
+* Modified the TVision library and the editor for the new keyboard routines.
+It produced various internal changes. (1 and 2).
+
+Revision 0.140 1997/09/30 set
+* Bug Killed: Ctrl+T weren't moved when the cursor were positioned over a tab.
+
+Revision 0.139 1997/09/30 set
+* Bug Killed: Optimal Fill weren't included when applying global options "To
+All".
+
+Revision 0.138 1997/09/30 set
+* Modified: Ctrl+T now is 99,99% like the BC (I can be sure is 100% equal ;-)
+asked by Michael (a Linux user).
+
+Revision 0.137 1997/09/30 set
+* Bug Killed: When the Optimal fill were on the editor failed to calculate
+some coordinates producing at least two important bugs. It mostly produced
+strange cusrsor jumps. Reported by Blizzar.
+
+Revision 0.136 1997/09/29 set
+* Redesigned the TVision's keyboard system (27, 28 and 29).
+
+Revision 0.135 1997/09/26 set
+* Added: Printing routings. (15 and 26).
+
+Revision 0.134 1997/09/24 set
+* Bug Killed: In the sLisp interface: the text insert didn't flush the editors
+line cache.
+
+Revision 0.133 1997/09/22 set
+* Bug Killed: The sLisp "floating" variables were deleted twice.
+
+Revision 0.132 1997/09/22 set
+* Bug Killed: In the sLisp's variable stack, it was growing all the time
+without reuse of the memory.
+
+Revision 0.131 1997/09/22 set
+* Bug Killed: Two bugs in the sLisp strings concatenation (+).
+
+Revision 0.130 1997/09/19 set
+* Added: Keyboard configuration with dialogs. (16,17,18 and 19).
+
+Revision 0.129 1997/09/15 set
+* Modified: Now all the editors share the same recorded macro and the size is
+dynamically adjusted.
+
+Revision 0.128 1997/09/14 set
+* Added: Convertion from recorded macros to sLisp sources. (SendCommSel) (12
+and 14).
+
+Revision 0.127 1997/09/11 set
+* Bug Killed: Sometimes when trying to expand a pmacro in a new file it
+failed.
+
+Revision 0.126 1997/09/11 set
+* Added: sLisp macros. (10 and 11).
+
+Revision 0.125 1997/09/08 set
+* Bug Killed: Enabled the key pad handling of TVision.
+
+Revision 0.124 1997/09/08 set
+* Version 0.3.9.
+
+Revision 0.123 1997/09/08 set
+* Bug Killed: Some static variables of the class (global settings) weren't
+stored in the desktop file.
+
+Revision 0.122 1997/09/08 set
+* Added: Customizable menu. Now the editor loads it from a file. It was
+developed in 6, 7 and 8.
+
+Revision 0.121 1997/09/05 set
+* Added: Exit deleting the extra files created in the current directory.
+
+Revision 0.120 1997/09/05 set
+* Version 0.3.8.
+
+Revision 0.119 1997/09/05 set
+* Added: Now all the histories are stored in the desktop file.
+
+Revision 0.118 1997/09/05 set
+* Bug Killed: The InfView's search used findRec producing a mess with the
+strings.
+
+Revision 0.117 1997/09/05 set
+* Bug Killed: Now each part of the editor uses your own history.
+
+Revision 0.116 1997/09/05 set
+* Version 0.3.7.
+
+Revision 0.115 1997/09/05 set
+* Added: Support for color customization.
+
+Revision 0.114 1997/09/04 set
+* Added: Now the window number 1 is reserved for the project so ALT+1 ever
+selects the project.
+
+Revision 0.113 1997/09/04 set
+* Added: Now the windows doesn't use all the screen if the editor window is
+opened.
+
+Revision 0.112 1997/09/04 set
+* Bug Killed: When applying "To all" the global options it selected C/C++
+generic SHL for all the windows with generic SHL.
+
+Revision 0.111 1997/09/04 set
+* Added: A mask to load compressed files in the file open dialog of InfView.
+
+Revision 0.110 1997/09/02 set
+* Added: Enhanced the control dialog of InfView and added an option to load
+.info files with a file open dialog.
+
+Revision 0.109 1997/08/26 set
+* Bug Killed: SDG failed to calculate the line number of the function
+producing some fails in the selected prototipe.
+
+Revision 0.108 1997/08/26 set
+* Bug Killed: In the SDG interface the message window didn't set the range to
+0 after a clean producing an abort.
+
+Revision 0.107 1997/08/26 set
+* Bug Killed: ASCII 255 were interpreted as EOF in bufun.cc. Reported by
+Laszlo.
+
+Revision 0.106 1997/08/25 set
+* Added: An easier way to select the items for the project.
+
+Revision 0.105 1997/08/25 set
+* Bug Killed: Se poda agregar ms de una vez el mismo al proyecto.
+
+Revision 0.104 1997/08/24 set
+* Added a cmbDelCharClear command to create a del with clear instead of cut.
+
+Revision 0.103 1997/08/24 set
+* Added a check to avoid selecting outside the buffer (that was the problem:
+selStart>bufLen).
+
+Revision 0.102 1997/08/24 set
+* Killed a garbage bug in new files.
+
+Revision 0.101 1997/08/24 set
+* Updated keybind.h with the Copy/Paste for Windows.
+
+Revision 0.100 1997/08/24 set
+* Added a command to toggle the C intelligent indent, is Ctrl+P by default.
+
+Revision 0.99 1997/08/24 set
+* Applied two small patchs from Robert (in inf.cc and winoldap.cc).
+
+-----------------------------------------------------------------------------
+Revision 0.98 1997/08/17 set
+* v0.3.6 sent to Robert. That's the version included in RHIDE 1.4.
+
+Revision 0.97 1997/08/17 set
+* Added: Now the position and size of the message dialog is stored in the
+desktop file.
+
+Revision 0.96 1997/08/12 set
+* Added: SHL for the pmacros files (.pmc) and the SHL file (.shl).
+
+Revision 0.95 1997/08/12 set
+* Added: Now the PMacros can be defined for a particular SHL.
+
+Revision 0.94 1997/08/12 set
+* Added: EOLCInFirstCol and NoCheckNumbers to the SHL configuration language,
+specially to highlight the configuration files.
+
+Revision 0.93 1997/08/10 set
+* Added: Support for Winblows clipboard.
+
+Revision 0.92 1997/08/08 set
+* Fixed: Now asks for saving modified buffers.
+
+Revision 0.91 1997/08/08 set
+* Added: A help context for the calculator.
+
+Revision 0.90 1997/08/08 set
+* Modified: The strategy of TInputLinePiped so now is messages oriented and
+not function oriented.
+
+Revision 0.89 1997/08/07 set
+* Added: Copy & Paste in TInputLinePiped class. Used in the calculator so you
+can paste the result in the code.
+
+Revision 0.88 1997/08/07 set
+* Version 0.3.6
+
+Revision 0.87 1997/08/07 set
+* Now the project stores the most relevant information about the windows, so
+if the file were opened and is no longer listed in the closed list the editor
+will retreive information from the project.
+
+Revision 0.86 1997/08/06 set
+* Added: full support for SDG, a configuration dialog for it and a message
+window to log the errors.
+
+Revision 0.85 1997/07/29 set
+* Bug Killed: Some fails in the match pair highlighting.
+
+Revision 0.84 1997/07/29 set
+* Modified: The status line now is showed in the first line if the cursor is
+over the last one.
+
+Revision 0.83 1997/07/29 set
+* Modified: Now you can save a buffer only if it was modified.
+
+Revision 0.82 1997/07/29 set
+* Created a new file (nonansi.c) to store the routines not present in Linux's
+libc.
+
+Revision 0.81 1997/07/29 set
+* Applied patchs from Robert.
+
+Revision 0.80 1997/07/29 set
+* In the last month I created the SET's Documentation Generator and SET's
+Documentation helper. They are incorporated in the editor now. For that I
+added support for projects.
+
+Revision 0.79 1997/06/23 set
+* Bug Killed: The first key recorded in a macro sometimes failed because the
+shift state weren't correctly stored.
+
+Revision 0.78 1997/06/19 set
+* Bug Killed: The symbol tables of the generic SHL were using chars instead of
+unsigned chars as index.
+
+Revision 0.77 1997/06/19 set
+* Bug Killed: The start of comment were case sensitive in the generic SHL, it
+created problems with REM in BASIC sources.
+
+Revision 0.76 1997/06/19 set
+* Modified: the routines that choose the right SHL according to the extention.
+
+Revision 0.75 1997/06/16 set
+* Bug Killed: If for some the reason the user were able to put the cursor over
+a \n character (hard to make) the editor behavior were unpredictable.
+
+Revision 0.74 1997/06/15 set
+* Various bugs related to the new LF handle were fixed in the last two weeks.
+
+Revision 0.73 1997/06/01 set
+* Version 0.3.3.
+
+Revision 0.72 1997/06/01 set
+* Various corrections in the internationalization file.
+
+Revision 0.71 1997/06/01 set
+* Bug Killed: Ctr+K-C and Ctrl+K-V moved the cursor regardless the selected
+mode.
+
+Revision 0.70 1997/06/01 set
+* Bug Killed: Ctrl+Shift+Insert failed when the editor where in the mode that
+doesn't move the cursor after a paste.
+
+Revision 0.69 1997/06/01 set
+* Bug Killed: When inserting at the end of the buffer.
+
+Revision 0.68 1997/06/01 set
+* Robert added support for lines with only LF under Linux. It introduced a big
+number of bugs.
+
+Revision 0.67 1997/05/21 set
+* Bug Killed: Ctrl+K-V used the clipboard.
+
+Revision 0.66 1997/05/20 set
+* Bug Killed: 08e1 is a flot for gcc and not an invalid octal like the editor
+were reporting.
+
+Revision 0.65 1997/04/24 set
+* Bug Killed: In the SHL of floats. For example: in 10e2; the last ; were
+highlighted as part of the float.
+
+Revision 0.64 1997/04/08 set
+* Added: Now you can select which extentions are highlighted defining
+enviroment variables like SET_SHL.pas=Pascal.
+
+Revision 0.63 1997/04/08 set
+* Added an enviroment variable to indicate where the configuration files are
+stores (SET_FILES).
+
+Revision 0.62 1997/04/08 set
+* Added Ctrl+Q-ESC to jump to the pair matching {,},(,),[ or ].
+
+Revision 0.61 1997/03/17 set
+* Changed the realloc strategy for the editor buffer. Now it allocs less than
+a page to avoid problems related to the djgpp 2^n strategy.
+
+Revision 0.60 1997/03/14 set
+* Version 0.3.2 Robert still having v0.2.18b.
+
+Revision 0.59 1997/03/14 set
+* Eliminated no longer used members: charPos, charPtr, nextChar, prevChar,
+lineEnd, lineStart, nextLine, prevLine and setCurPtr. They were only for
+compatibility with the old TEditor class.
+
+Revision 0.58 1997/03/14 set
+* TCFileEditor class joined to TCEditor class.
+
+Revision 0.57 1997/03/11 set
+* Source directory structure reorganized.
+
+Revision 0.56 1997/03/11 set
+* Bug Killed: In the restore of the previous color of a match-pair.
+
+Revision 0.55 1997/03/11 set
+* Bug Killed: When deleting a block ending in a column where there is no text.
+
+Revision 0.54 1997/03/11 set
+* Bug Killed: In the Intelligent C indent when parsing comments.
+
+Revision 0.53 1997/02/12 set
+* Bug Killed: When deleting blocks including "text" outside of the line.
+
+Revision 0.52 1997/02/04 set
+* Added: Replace all, by Laszlo.
+
+----------------------------------------------------------------------
+Revision 0.51 1997/02/04 set
+* Version 0.2.18 sent to Robert.
+
+Revision 0.50 1997/02/02 set
+* Modified: Now the "Jump to function" dialog supports Zoom.
+
+Revision 0.49 1997/02/01 set
+* Fixes in the update of the selected area.
+
+Revision 0.48 1997/01/29 set
+* Bug Killed: In the draw of the last line when Transparent block is on and
+the line is preprocessor + comments.
+
+Revision 0.47 1997/01/26 set
+* Fixes in the update of the selected area.
+
+Revision 0.46 1997/01/25 set
+* Added: Now the replace input in the S&R dialog is piped to the text as the
+search was (Laszlo's idea).
+
+Revision 0.45 1997/01/25 set
+* Modified: Now ^KL moves the cursor to the start of the line (Laszlo's idea).
+
+Revision 0.44 1997/01/24 set
+* Bug Fixed: When pasting in the last line of the text.
+
+----------------------------------------------------------------------
+Revision 0.43 1997/01/12 set
+* Version 0.2.17 sent to Robert.
+
+Revision 0.42 1997/01/12 set
+* Bug Fixed: when selecting a preprosessor line that is the end of a multiline
+comment.
+
+Revision 0.41 1997/01/12 set
+* Bug Fixed: when typing in the last column a character that produces a change
+in the highlight.
+
+Revision 0.40 1997/01/10 set
+* Added: In InfView: A dialog to choose any node of the file.
+
+Revision 0.39 1997/01/10 set
+* Bug Fixed: Now the items in the first line below the Menu entry is taked in
+count.
+
+Revision 0.38 1997/01/10 set
+* Added: In InfView: Ported to Linux (no shift arrows, double click emulated).
+
+Revision 0.37 1997/01/10 set
+* Added: In InfView: Better support for Tabs.
+
+Revision 0.36 1997/01/09 set
+* Added: In InfView: Support for files without Tag Table (just plain text
+files with delimiters 0x1F).
+
+Revision 0.35 1997/01/09 set
+* Added: Support for hexa-numbers like that: 0x0000012345678 that previously
+were taked as wrong values (reported by Robert).
+
+Revision 0.34 1997/01/09 set
+* Bug Fixed: Pascal doesn't support u,U,l and L modifiers. (by Robert).
+
+Revision 0.33 1997/01/08 set
+* Bug Fixed: In the paint of preprocessor lines, this bug generated an
+asertion when editing the limits.h file line 30.
+
+Revision 0.32 1997/01/08 set
+* Modified: Now the colors are cached to speed up the draw (Robert's idea).
+
+Revision 0.31 1997/01/04 set
+* Added: In InfView: Mouse selection.
+
+Revision 0.30 1997/01/04 set
+* Added: In InfView: Selection with End,Home,Page Up and Page Down.
+
+Revision 0.29 1997/01/04 set
+* Modidied: In InfView: The behaviour of End.
+
+Revision 0.28 1997/01/04 set
+* Added: In InfView: Selection in reverse direction.
+
+Revision 0.27 1997/01/04 set
+* Added: In InfView: now the selection disapears when we change of topic.
+
+Revision 0.26 1996/12/29 set
+* Bug Fixed: In the Search dialog in the input line pressing the left arrow
+the dialog ever got a char from the editor.
+
+Revision 0.25 1996/12/29 set
+* Bug Fixed: In the update of the selected area when backspace deleted across
+an end of the selected area.
+
+Revision 0.24 1996/12/29 set
+* Bugs Fixed: With \ inside of chars and reserved words. (fixed by Robert).
+
+Revision 0.23 1996/12/29 set
+* Modified: Now InfView doesn't add extra entries in the history when
+searching across files. (reported by Artur).
+
+Revision 0.22 1996/12/29 set
+* Modified: Now when resizing the window the cursor still visible. (reported
+by Artur).
+
+Revision 0.21 1996/12/29 set
+* Bug fixed: When typing outside the visible window. (reported by Artur).
+
+Revision 0.20 1996/12/18 set
+* ^KC now doesn't touch the clipboard. (Reported by Laszlo)
+
+----------------------------------------------------------------------
+Revision 0.19 1996/12/11 set
+* Diffs sent to Robert.
+
+Revision 0.18 1996/12/10 set
+* Bug fixed: When using find the undo doesn't work.
+
+Revision 0.17 1996/12/10 set
+* Bug fixed: In the undo due to a report of Artur.
+
+----------------------------------------------------------------------
+Revision 0.16 1996/12/09 set
+* Version 0.2.16 sent to Robert.
+
+Revision 0.15 1996/12/09 set
+* Bug fixed: When deleting the fisrt tab in a line.
+
+Revision 0.14 1996/12/08 set
+* Modified: The Jump to Function list now isn't case sensitive.
+
+Revision 0.13 1996/12/08 set
+* Added: Now the Compact Buffer doesn't affect the strings and comments (NIK's
+idea).
+
+Revision 0.12 1996/12/07 set
+* Added: Support for ull,lul,llu,ll,lu,etc modifiers.
+
+Revision 0.11 1996/12/07 set
+* Added: An string opened in one line must be closed some where or the whole
+code is an string, GCC suppose that.
+
+Revision 0.10 1996/12/07 set
+* Added: New mode called Optimal Fill to use tabs instead of spaces to fill
+holes (Reported by Leon and NIK).
+
+Revision 0.9 1996/12/07 set
+* Modified: Now the undo restore tabs in the undo of insert.
+
+Revision 0.8 1996/12/07 set
+* Bug fixed: When pasting text that had tabs.
+
+Revision 0.7 1996/12/05 set
+* Bug fixed: When typing characters the editor didn't update the X limit
+(Reported by NIK).
+
+Revision 0.6 1996/12/05 set
+* Bug fixed: When using the scroll bar the editor failed to update the screen
+:-P (Reported by NIK).
+
+Revision 0.5 1996/12/04 set
+* Modified: Now in non-persistent mode the pasted text isn't selected to allow
+multiple pastes (Yamaha's idea).
+
+Revision 0.4 1996/12/03 set
+* Modified: When the mouse selection starts in a tab the tab is included
+(NIK's idea).
+
+Revision 0.3 1996/12/03 set
+* Added: Now the editor supports lines with \n, \r, \r\r\n, etc as end of
+line.
+
+Revision 0.2 1996/12/03 set
+* Bug fixed: In the update of the selected area when the selection started at
+the begining of the edited line.
+
+Revision 0.1 1996/12/03 set
+* Bug fixed: In the undo due to a report of Artur Zaroda.
+
diff --git a/setedit/config.pl b/setedit/config.pl
new file mode 100644
index 0000000..fb03bd0
--- /dev/null
+++ b/setedit/config.pl
@@ -0,0 +1,2009 @@
+#!/usr/bin/perl
+# Copyright (C) 1999-2005 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+require "miscperl.pl";
+require "conflib.pl";
+
+$conf{'infview'}='yes';
+#$conf{'HAVE_BZIP2'}='yes';
+$conf{'parser'}='parserbr.c';
+$conf{'mp3lib'}='mpegsnd';
+$conf{'mp3'}='yes';
+$conf{'HAVE_MIXER'}='yes';
+$conf{'HAVE_CALCULATOR'}='yes';
+$conf{'HAVE_CALENDAR'}='yes';
+$conf{'intlShipped'}='no';
+$conf{'ToolsInstaller'}='no';
+$conf{'ToolsDistrib'}='no';
+$conf{'compressExe'}='undef';
+$TVCommandLine=0;
+
+# If the script is newer discard the cache.
+#GetCache() unless (-M 'config.pl' < -M 'configure.cache');
+GetVersion('');
+
+$TVVersionNeeded='2.0.4';
+$ZLibVersionNeeded='1.1.2';
+$BZ2LibVersionNeeded='0.9.5d';
+$DJGPPVersionNeeded='2.0.2';
+$LibMIVersionNeeded='0.8.6';
+# Allegro 3.1==3.0.1 3.11==3.0.11 3.12==3.0.12
+$AllegroVersionNeeded='3.0.1';
+# 5.0 will change the API, or maybe 6.0 but an API change is discussed
+$AllegroNotNeeded='5.0.0';
+# I never tested with an older version, you can try reducing it.
+$GPMVersionNeeded='1.10';
+# Workarounded 4.4+ missfeatures, so now I put here a fantasy value
+$BrokenMakeinfo='99.99';
+unlink $ErrorLog;
+
+SeeCommandLine();
+
+if ($JustSpec)
+ {
+ UpdateSpec();
+ exit 0;
+ }
+
+print "Configuring SETEdit v$Version\n\n";
+# Determine the OS
+$OS=DetectOS();
+
+if (($OS ne 'DOS') && (@conf{'mp3'} eq 'yes') && (@conf{'mp3lib'} ne 'mpegsnd'))
+ {
+ die "Only libmpegsnd is available for UNIX\n"
+ }
+# MP3 code works only for DOS, Linux and Solaris
+if (($OS ne 'DOS') && ($OSf ne 'Linux') && ($OSf ne 'Solaris'))
+ {
+ $conf{'mp3'}='no';
+ $conf{'HAVE_MIXER'}='no';
+ $conf{'mp3lib'}='';
+ }
+if (($OS ne 'UNIX') && ($conf{'HAVE_AA'} eq 'yes'))
+ {
+ print "Currently AA-lib is usable only for UNIX version, please tell me if you think it should be changed.\n";
+ $conf{'HAVE_AA'}='no';
+ }
+
+LookForBasicTools();
+$supportDir='makes/'.$supportDir;
+
+# TV goes first to find the configuration program.
+# But we can't check TV functionality yet.
+# Where is the TV library?
+# $TVInclude and $TVLib
+LookForTV();
+LookForTVConfig();
+
+# Determine C flags
+$CFLAGS=FindCFLAGS();
+FindXCFLAGS();
+# Determine C++ flags
+$CXXFLAGS=FindCXXFLAGS();
+FindXCXXFLAGS();
+# Extra lib directories
+$LDExtraDirs=FindLDExtraDirs();
+# Test for a working gcc
+$GCC=CheckGCC();
+# Which architecture are we using?
+DetectCPU();
+# Some platforms aren't easy to detect until we can compile.
+DetectOS2();
+# The prefix can be better determined if we know all the rest
+# about the environment
+LookForPrefix();
+# Only gnu make have the command line and commands we use.
+LookForGNUMake();
+# Same for ar, it could be `gar'
+$GAR=LookForGNUar();
+# Similar for install tool.
+LookForGNUinstall();
+# Check if gcc can compile C++
+$GXX=CheckGXX();
+
+# Is the right djgpp?
+if ($OS eq 'DOS')
+ {
+ LookForDJGPP($DJGPPVersionNeeded);
+ LookForAllegro($AllegroVersionNeeded,$AllegroNotNeeded);
+ }
+
+# Is TV the right version?
+TestTVVersion($TVVersionNeeded);
+# Find the major version
+if ($conf{'tv'}=~/(\d+)\.(\d+)\.(\d+)/)
+ {
+ $tvMajor=$1;
+ $tvMiddle=$2;
+ $tvMinor=$3;
+ }
+
+# Have libc international support? what about libintl or libiconv?
+LookForIntlSupport();
+# Is PCRE available?
+LookForPCRE();
+# Is ZLib available?
+LookForZLib($ZLibVersionNeeded);
+# Is BZip2 library available?
+LookForBZ2Lib($BZ2LibVersionNeeded);
+# Look for xgettext
+LookForGettextTools();
+LookForMakeinfo();
+# Is a usable gpm there?
+#LookForGPM($GPMVersionNeeded) if ($OS eq 'UNIX');
+# Should we try X?
+#LookForXlib() if (($OS eq 'UNIX') && ($tvMajor>=2));
+# Needed by X libraries in some systems
+LookForDL() if ($OS eq 'UNIX');
+# An option to display screen savers ;-)
+LookForAA() if ($OS eq 'UNIX');
+# GDB/MI interface
+LookForMI($LibMIVersionNeeded) if (($OS eq 'UNIX') || ($Compf eq 'Cygwin'));
+# Check if we can offer the distrib targets.
+LookForToolsDistrib();
+# The installer needs tons of things, put it in makefile only if the user
+# have some chance to succeed.
+LookForToolsInstaller() if ($OS eq 'DOS');
+LookForMaintainerTools() if $conf{'MAINTAINER_MODE'} eq 'yes';
+
+print "\n";
+#
+# Create a list of RHIDE variables to configure the projects
+#
+$TVLib='../'.$TVLib if (substr($TVLib,0,2) eq '..');
+$TVInclude='../'.$TVInclude if (substr($TVInclude,0,2) eq '..');
+if ($OS eq 'DOS')
+ {
+ $MakeDefsRHIDE[0]='RHIDE_STDINC=$(DJDIR)/include $(DJDIR)/lang/cxx $(DJDIR)/lib/gcc-lib';
+ # DJGPP's gcc includes djgpp.ver from the same directory where specs
+ $a=`redir -eo $GCC -v`;
+ if ($a=~/(\w:)(.*)\/specs/i)
+ {
+ $here=RunRedirect('pwd',$ErrorLog);
+ $here=~s/[\r\n]//g;
+ chdir("$1$2");
+ $a=RunRedirect('pwd',$ErrorLog);
+ $a=~s/[\r\n]//g;
+ chdir($here);
+ $MakeDefsRHIDE[0].=" $a"
+ }
+ $MakeDefsRHIDE[1]='RHIDE_OS_LIBS=-lrhtv ';
+ $MakeDefsRHIDE[1].='-l'.substr($stdcxx,2).' ';
+ $MakeDefsRHIDE[1].='-lintl ' unless (@conf{'intl'} eq 'no');
+ $MakeDefsRHIDE[1].='-liconv ' if (@conf{'iconv'} eq 'yes');
+ if ((@conf{'mp3'} eq 'yes') && (@conf{'HAVE_ALLEGRO'} eq 'yes'))
+ {
+ $MakeDefsRHIDE[1].='-l'.@conf{'mp3lib'}.' -lalleg ';
+ }
+ $MakeDefsRHIDE[1].='-lbz2 ' if (@conf{'HAVE_BZIP2'} eq 'yes');
+ }
+elsif ($OS eq 'UNIX')
+ {
+ $MakeDefsRHIDE[0]='RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib';
+ if (@conf{'static'} eq 'yes')
+ { $libs=TVConfigOption('slibs'); }
+ else
+ { $libs=TVConfigOption('dlibs'); }
+ $libs=~s/[\r\n]//g;
+ $MakeDefsRHIDE[1]='RHIDE_OS_LIBS='.$libs.' ';
+ #
+ # The following are TV dependencies
+ #
+ ## RHIDE doesn't know about anything different than DJGPP and Linux so -lstdc++ must
+ ## be added for things like FreeBSD or SunOS.
+ #$MakeDefsRHIDE[1].=substr($stdcxx,2).' '; # unless ($OSf eq 'Linux');
+ #$MakeDefsRHIDE[1].='ncurses m ';
+ ## No for UNIX!! $MakeDefsRHIDE[1].='intl ' unless (@conf{'intl'} eq 'no');
+ #$MakeDefsRHIDE[1].='gpm ' if @conf{'HAVE_GPM'} eq 'yes';
+ #$MakeDefsRHIDE[1].=$conf{'X11Lib'}.' ' if ($conf{'HAVE_X11'} eq 'yes');
+ if ($conf{'dl'} eq 'yes')
+ {
+ $MakeDefsRHIDE[1].=($OSf eq 'QNXRtP') ? '' : '-ldl ';
+ }
+ $MakeDefsRHIDE[1].='-lbz2 ' if @conf{'HAVE_BZIP2'} eq 'yes';
+ $MakeDefsRHIDE[1].='-l'.@conf{'mp3lib'}.' ' if (@conf{'mp3'} eq 'yes');
+ $MakeDefsRHIDE[1].='-lintl ' if ((($OSf eq 'FreeBSD') || ($OSf eq 'QNXRtP')) && ($conf{'intl'} eq 'yes'));
+ $MakeDefsRHIDE[1].='-laa ' if ($conf{'HAVE_AA'} eq 'yes');
+ }
+else # Win32
+ {
+ $MakeDefsRHIDE[0]='RHIDE_STDINC=';
+ $libs=TVConfigOption('slibs');
+ $libs=~s/[\r\n]//g;
+ $MakeDefsRHIDE[1]='RHIDE_OS_LIBS= '.$libs.' ';
+ #$MakeDefsRHIDE[1]='RHIDE_OS_LIBS=rhtv stdc++ gdi32 ';
+ #$MakeDefsRHIDE[1].='intl ' unless (@conf{'intl'} eq 'no');
+ $MakeDefsRHIDE[1].='-lbz2 ' if (@conf{'HAVE_BZIP2'} eq 'yes');
+ $MakeDefsRHIDE[1].='-l'.@conf{'mp3lib'}.' ' if (@conf{'mp3'} eq 'yes');
+ }
+$MakeDefsRHIDE[1].='-lz ';
+$MakeDefsRHIDE[1].='-lpcre ' if @conf{'HAVE_PCRE_LIB'} eq 'yes';
+$MakeDefsRHIDE[1].='-lmigdb ' if @conf{'HAVE_GDB_MI'} eq 'yes';
+$MakeDefsRHIDE[1].='-lmss ' if @conf{'mss'} eq 'yes';
+$MakeDefsRHIDE[1].='-lefence ' if @conf{'efence'} eq 'yes';
+$MakeDefsRHIDE[1].='-ltvfintl ' if @conf{'tvfintl'} eq 'yes';
+
+$MakeDefsRHIDE[2]="RHIDE_OS_LIBS_PATH=";
+# Before the system one
+$MakeDefsRHIDE[2].=' -L../gettext ' if (@conf{'intlShipped'} eq 'yes');
+# QNX Workaround
+$MakeDefsRHIDE[2].='-L/lib ' if ($OSf eq 'QNXRtP');
+# Libraries for TV
+$libs=TVConfigOption('dir-libs');
+$libs=~s/[\r\n]//g;
+$MakeDefsRHIDE[2].=$libs;
+# Extra libraries path
+$libs=$LDExtraDirs;
+$libs=~s/(\S+)/-L$1/g;
+$MakeDefsRHIDE[2].=' '.$libs;
+# Shipped replacements
+$MakeDefsRHIDE[2].=' -L../libz' if (@conf{'zlibShipped'} eq 'yes');
+$MakeDefsRHIDE[2].=' -L../libbzip2' if (@conf{'bz2libShipped'} eq 'yes');
+$MakeDefsRHIDE[2].=' -L../libpcre' if (@conf{'PCREShipped'} eq 'yes');
+$MakeDefsRHIDE[2].=' -L../libmigdb/src' if (@conf{'migdbShipped'} eq 'yes');
+# Subprojects generates libraries in the makes directory
+$MakeDefsRHIDE[2].=' -L.';
+
+$MakeDefsRHIDE[3]="TVISION_INC=$TVInclude";
+
+$test='';
+$test.=' ../libz' if (@conf{'zlibShipped'} eq 'yes');
+$test.=' ../libbzip2' if (@conf{'bz2libShipped'} eq 'yes');
+$test.=' ../libpcre' if (@conf{'PCREShipped'} eq 'yes');
+$test.=' ../gettext' if (@conf{'intlShipped'} eq 'yes');
+$test.=' '.$conf{'X11IncludePath'} if (@conf{'HAVE_X11'} eq 'yes');
+$test.=' ../libmigdb/src' if (@conf{'migdbShipped'} eq 'yes');
+$test.=$conf{'EXTRA_INCLUDE_DIRS'};
+$MakeDefsRHIDE[4]='SUPPORT_INC='.$test;
+
+# The support libraries shouldn't generate dependencies
+$MakeDefsRHIDE[0].=$test;
+# Nor compatlayer headers
+$MakeDefsRHIDE[0].=' $(TVISION_INC)/cl';
+if (@conf{'static'} eq 'yes')
+ {
+ $MakeDefsRHIDE[5]='RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) -static $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)';
+ }
+else
+ {
+ $MakeDefsRHIDE[5]='RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)';
+ }
+#$MakeDefsRHIDE[5].=' -lrhtv '.@conf{'prefix'}.'/lib/libmss.a' if (@conf{'mss'} eq 'yes');
+#if (@conf{'mss'} eq 'yes')
+# {
+# $test=@conf{'prefix'}.'/lib/libmss.a $(LIBRARIES)';
+# $MakeDefsRHIDE[5]=~s/\$\(LIBRARIES\)/$test/;
+# }
+# Take out the CFLAGS and CPPFLAGS variables
+$MakeDefsRHIDE[6]='RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)';
+$MakeDefsRHIDE[7]='RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)';
+$MakeDefsRHIDE[8]='STDCPP_LIB='.$stdcxx;
+$MakeDefsRHIDE[9]='RHIDE_LIBS=$(LIBS) $(RHIDE_OS_LIBS)';
+$MakeDefsRHIDE[10]='RHIDE_LIBDIRS=$(LIB_DIRS)';
+if ($Compf eq 'MinGW')
+ {
+ $MakeDefsRHIDE[11]='SPECIAL_LDFLAGS=-mconsole';
+ }
+CreateRHIDEenvs('makes/rhide.env','+mp3/libamp/rhide.env',
+ '+mp3/mpegsound/rhide.env');
+#
+# Translate some options into variables suitable for defines and also
+# compute some interdependencies.
+#
+if ($OS eq 'DOS')
+ {
+ $conf{'WITH_MP3'}=((@conf{'mp3'} eq 'yes') &&
+ (@conf{'HAVE_ALLEGRO'} eq 'yes')) ? 'yes' : 'no';
+ }
+else
+ {
+ $conf{'WITH_MP3'}=((@conf{'mp3'} eq 'yes') &&
+ (@conf{'mp3lib'} eq 'mpegsnd')) ? 'yes' : 'no';
+ }
+$conf{'HAVE_AMP'}=((@conf{'WITH_MP3'} eq 'yes') && (@conf{'mp3lib'} eq 'amp'))
+ ? 'yes' : 'no';
+$conf{'HAVE_MPEGSOUND'}=((@conf{'WITH_MP3'} eq 'yes') && (@conf{'mp3lib'} eq 'mpegsnd'))
+ ? 'yes' : 'no';
+CreateConfigH();
+GenerateMakefile();
+UpdateSpec();
+$ReplaceTags{'TVInclude'}=$TVInclude;
+$ReplaceTags{'datadir'}=$conf{'prefix'}.'/share';
+$ReplaceTags{'libdir'}=$conf{'prefix'}.'/lib';
+$ReplaceTags{'CC'}=$GCC;
+$ReplaceTags{'CXX'}=$GXX;
+$ReplaceTags{'AR'}=$conf{'GNU_AR'};
+$ReplaceTags{'CFLAGS'}=$conf{'CFLAGS'};
+$ReplaceTags{'XCFLAGS'}=$conf{'XCFLAGS'};
+$ReplaceTags{'CXXFLAGS'}=$conf{'CXXFLAGS'};
+$ReplaceTags{'dyndir'}=$conf{'prefix'}.'/lib/setedit';
+$ReplaceTags{'PREFIX'}=$conf{'prefix'};
+$ReplaceTags{'MakeInfoNumbers'}=CompareVersion(@conf{'makeinfo'},'4.7') ? '-N' : '';
+# Makefiles
+ReplaceText('gettext/Makefile.in','gettext/Makefile');
+ReplaceText('holidays/Makefile.in','holidays/Makefile');
+ReplaceText('doc/gnumake.in','doc/Makefile');
+ReplaceText('internac/gnumake.in','internac/Makefile');
+ReplaceText('libbzip2/gnumake.in','libbzip2/Makefile');
+ReplaceText('libpcre/gnumake.in','libpcre/Makefile');
+ReplaceText('libz/gnumake.in','libz/Makefile');
+`cp gettext/djgpp.h gettext/config.h`; # Currently only DOS config is available if $OS eq 'DOS';
+
+#
+# Generate BC++ and MSVC makefiles
+#
+`perl confignt.pl` if @conf{'MAINTAINER_MODE'} eq 'yes';
+
+#
+# Select the desired parser for the calculator
+#
+system('cp -p calcu/'.@conf{'parser'}.' calcu/parser.c');
+
+print "\nSuccessful configuration!\n\n";
+
+GiveAdvice();
+# Avoid caching it
+$conf{'force-intlShipped'}='no';
+CreateCache();
+unlink $ErrorLog;
+
+sub UpdateSpec
+{
+ $ReplaceTags{'version'}=$Version;
+ ReplaceText('redhat/setedit.spec.in','redhat/setedit-'.$Version.'.spec');
+}
+
+sub SeeCommandLine
+{
+ my $i;
+
+ $conf{'HAVE_AA_from_user'}='no';
+ foreach $i (@ARGV)
+ {
+ if ($i eq '--help')
+ {
+ ShowHelp();
+ die "\n";
+ }
+ elsif ($i=~'--prefix=(.*)')
+ {
+ $conf{'prefix'}=$1;
+ }
+ elsif ($i eq '--no-prefix-h')
+ {
+ $conf{'no-prefix-h'}=1;
+ }
+ elsif ($i eq '--no-intl')
+ {
+ $conf{'no-intl'}='yes';
+ $conf{'xgettext'}='no';
+ }
+ elsif ($i eq '--static')
+ {
+ $conf{'static'}='yes';
+ }
+ elsif ($i eq '--dynamic')
+ {
+ $conf{'static'}='no';
+ }
+ elsif ($i eq '--fhs')
+ {
+ $conf{'fhs'}='yes';
+ }
+ elsif ($i eq '--no-fhs')
+ {
+ $conf{'fhs'}='no';
+ }
+ elsif ($i eq '--libset')
+ {
+ $conf{'libset'}='yes';
+ }
+ elsif ($i eq '--no-libset')
+ {
+ $conf{'libset'}='no';
+ }
+ elsif ($i eq '--infview')
+ {
+ $conf{'infview'}='yes';
+ }
+ elsif ($i eq '--no-infview')
+ {
+ $conf{'infview'}='no';
+ }
+ elsif ($i eq '--no-bzip2')
+ {
+ $conf{'HAVE_BZIP2'}='no';
+ $conf{'bz2libShipped'}='no';
+ $conf{'bz2lib'}='no';
+ }
+ elsif ($i eq '--bzip2')
+ {
+ $conf{'HAVE_BZIP2'}='yes';
+ }
+ elsif ($i eq '--parser-adv')
+ {
+ $conf{'parser'}='parserbr.c';
+ }
+ elsif ($i eq '--parser-brs')
+ {
+ $conf{'parser'}='small.c';
+ }
+ elsif ($i eq '--parser-ml')
+ {
+ $conf{'parser'}='parserml.c';
+ }
+ elsif ($i eq '--with-amp')
+ {
+ $conf{'mp3lib'}='amp';
+ $conf{'mp3'}='yes';
+ }
+ elsif ($i eq '--with-mpegsnd')
+ {
+ $conf{'mp3lib'}='mpegsnd';
+ $conf{'mp3'}='yes';
+ }
+ elsif ($i eq '--without-mp3')
+ {
+ $conf{'mp3'}='no';
+ }
+ elsif ($i=~'--Xcflags=(.*)')
+ {
+ $conf{'XCFLAGS'}=$1;
+ }
+ elsif ($i=~'--Xcppflags=(.*)')
+ {
+ $conf{'XCXXFLAGS'}=$1;
+ }
+ elsif ($i=~'--cflags=(.*)')
+ {
+ $conf{'CFLAGS'}=$1;
+ }
+ elsif ($i=~'--cxxflags=(.*)' ||
+ $i=~'--cppflags=(.*)')
+ {
+ $conf{'CXXFLAGS'}=$1;
+ }
+ elsif ($i eq '--debug')
+ {
+ $conf{'XCFLAGS'}=
+ $conf{'XCXXFLAGS'}='-O3 -fomit-frame-pointer -ffast-math -gstabs+3';
+ $conf{'CFLAGS'}=
+ $conf{'CXXFLAGS'}='-O2 -Wall -Werror -gstabs+3';
+ }
+ elsif ($i eq '--with-mixer')
+ {
+ $conf{'HAVE_MIXER'}='yes';
+ }
+ elsif ($i eq '--without-mixer')
+ {
+ $conf{'HAVE_MIXER'}='no';
+ }
+ elsif ($i eq '--shipped-intl')
+ {
+ $conf{'force-intlShipped'}='yes';
+ }
+ elsif ($i=~'--tv-include=(.*)')
+ {
+ $conf{'TV_INCLUDE'}=$1;
+ $TVCommandLine=1;
+ }
+ elsif ($i=~'--tv-lib=(.*)')
+ {
+ $conf{'TV_LIB'}=$1;
+ $TVCommandLine=1;
+ }
+ elsif ($i eq '--comp-exe')
+ {
+ $conf{'compressExe'}='yes';
+ }
+ elsif ($i eq '--no-comp-exe')
+ {
+ $conf{'compressExe'}='no';
+ }
+ elsif ($i eq '--with-mss')
+ {
+ $conf{'mss'}='yes';
+ }
+ elsif ($i eq '--without-mss')
+ {
+ $conf{'mss'}='no';
+ }
+ elsif ($i eq '--with-efence')
+ {
+ $conf{'efence'}='yes';
+ }
+ elsif ($i eq '--without-efence')
+ {
+ $conf{'efence'}='no';
+ }
+ elsif ($i=~'--x-include=(.*)')
+ {
+ $conf{'X11IncludePath'}=$1;
+ }
+ elsif ($i=~'--x-lib=(.*)')
+ {
+ $conf{'X11LibPath'}=$1;
+ }
+ elsif ($i eq '--with-aa')
+ {
+ $conf{'HAVE_AA'}='yes';
+ }
+ elsif ($i eq '--without-aa')
+ {
+ $conf{'HAVE_AA'}='no';
+ $conf{'HAVE_AA_from_user'}='yes';
+ }
+ elsif ($i eq '--enable-maintainer-mode')
+ {
+ $conf{'MAINTAINER_MODE'}='yes';
+ }
+ elsif ($i eq '--source-bzip2')
+ {
+ $conf{'source-bzip2'}='yes';
+ }
+ elsif ($i eq '--just-spec')
+ {
+ $JustSpec=1;
+ }
+ elsif ($i eq '--with-calc')
+ {
+ $conf{'HAVE_CALCULATOR'}='yes';
+ }
+ elsif ($i eq '--without-calc')
+ {
+ $conf{'HAVE_CALCULATOR'}='no';
+ }
+ elsif ($i eq '--with-calend')
+ {
+ $conf{'HAVE_CALENDAR'}='yes';
+ }
+ elsif ($i eq '--without-calend')
+ {
+ $conf{'HAVE_CALENDAR'}='no';
+ }
+ elsif ($i eq '--without-migdb')
+ {
+ $conf{'HAVE_GDB_MI'}='no_cline';
+ }
+ elsif ($i eq '--with-migdb')
+ {
+ #$conf{'HAVE_GDB_MI'}='';
+ }
+ elsif ($i=~'--include=(.*)')
+ {
+ $conf{'EXTRA_INCLUDE_DIRS'}.=" $1";
+ }
+ else
+ {
+ ShowHelp();
+ die "Unknown option: $i\n";
+ }
+ }
+}
+
+sub ShowHelp
+{
+ print "Available options:\n";
+ # Targets
+ print "\nOptional targets:\n";
+ print "--infview : also compile InfView [default].\n";
+ print "--no-infview : don't compile InfView, just the editor.\n";
+ print "--libset : create libset, needed to compile RHIDE.\n";
+ print "--no-libset : don't create libset [default].\n";
+ # Paths
+ print "\nPaths:\n";
+ print "--prefix=path : defines the base directory for installation.\n";
+ print "--no-prefix-h : don't define the prefix in the configuration header\n";
+ print "--fhs : force the FHS layout under UNIX.\n";
+ print "--no-fhs : force to not use the FHS layout under UNIX.\n";
+ print "--tv-include=pat: path for Turbo Vision includes\n";
+ print " Note: if you use --tv-include you should also use --tv-lib\n";
+ print "--tv-lib=path : path for Turbo Vision libraries\n";
+ print "--include=path : Add this path for includes. Repeat for each dir.\n";
+ # Libs
+ print "\nLibraries and optional support:\n";
+ print "--no-intl : don't use international support.\n";
+ print "--shipped-intl : force to use the shipped gettext library [DOS only]\n";
+ print "--bzip2 : include support for bzip2.\n";
+ print "--no-bzip2 : don't include support for bzip2 files.\n";
+ print "--with-aa : support for AA-lib [used for UNIX].\n";
+ print "--without-aa : without AA-lib support.\n";
+ print "--parser-adv : use the advanced parser for calc. [default]\n";
+ print "--parser-brs : use the small Burton's parser for calculator\n";
+ print "--parser-ml : use the small ML's parser for calculator\n";
+ print "--without-mp3 : disable MP3 support\n";
+ print "--with-amp : use libamp for MP3 support [DOS only]\n";
+ print "--with-mpegsnd : use libmpegsnd for MP3 support [default]\n";
+ print "--with-mixer : include code to control the mixer [default]\n";
+ print "--without-mixer : don't include code to control the mixer\n";
+ print "--with-mss : compiles with MSS memory debugger.\n";
+ print "--without-mss : compiles without MSS [default].\n";
+ print "--with-efence : compiles with Electric Fence memory debugger.\n";
+ print "--without-efence: compiles without Electric Fence [default].\n";
+ print "--with-calc : compiles the internal calculator [default].\n";
+ print "--without-calc : no internal calculator.\n";
+ print "--with-calend : compiles the internal calendar [default].\n";
+ print "--without-calend: no internal calendar.\n";
+ print "--with-migdb : include debug support [default].\n";
+ print "--without-migdb : no debug support.\n";
+ # Compilation
+ print "\nCompilation options:\n";
+ print "--enable-maintainer-mode:\n";
+ print " : enables header dependencies and other stuff needed\n";
+ print " for developement, not just use the editor.\n";
+ print "--static : force to create an statically linked executable.\n";
+ print " Currently it only affect TV lib.\n";
+ print "--dynamic : generated a dynamically linked executable [default].\n";
+ print "--cflags=val : normal C flags [default is env. CFLAGS]\n";
+ print "--cppflags=val : normal C++ flags [default is env. CXXFLAGS]\n";
+ print "--Xcflags=val : special C flags used for MP3 libraries\n";
+ print "--Xcppflags=val : special C++ flags used for MP3 libraries\n";
+ print "--debug : selects C/C++ switches for debugging\n";
+ print "--comp-exe : compress all executables with UPX\n";
+ print "--no-comp-exe : don't compress any executables with UPX\n";
+ # Others
+ print "\nOthers:\n";
+ print "--source-bzip2 : use bzip2 for tarballs\n";
+ print "--just-spec : update RPMs spec file and exit.\n";
+
+ print "\n";
+ print "--help : displays this text.\n";
+
+ #print "--x-include=path: X11 include path [/usr/X11R6/lib].\n";
+ #print "--x-lib=path : X11 library path [/usr/X11R6/include].\n";
+}
+
+sub GiveAdvice
+{
+ if (@conf{'HAVE_PCRE_LIB'} eq 'no')
+ {
+ print "\n";
+ print "* The Perl Compatible Regular Expressions support was disabled install PCRE\n";
+ print " library v2.0 or newer and reconfigure to get support.\n";
+ }
+ if (($OS eq 'DOS') && (@conf{'HAVE_ALLEGRO'} eq 'no') &&
+ (@conf{'mp3'} eq 'yes'))
+ {
+ print "* The MPEG-3 files support was disabled, install Allegro library v$AllegroVersionNeeded\n";
+ print " or newer (not a WIP!) and reconfigure to get support.\n";
+ }
+ if (@conf{'xgettext'} eq 'no')
+ {
+ print "* The 'xgettext' tools aren't installed internat. files can't be created.\n";
+ }
+ if (@conf{'makeinfo'} eq 'no')
+ {
+ print "* The 'makeinfo' tool isn't installed documentation can't be created.\n";
+ }
+ if (@conf{'makeinfo'} eq 'broken')
+ {
+ print "* The 'makeinfo' tool is an unsupported version (broken?).\n";
+ print " Do you want to help solving it? contact me.\n";
+ }
+ if (@conf{'GNU_Make'} ne 'make')
+ {
+ print "* Please use $conf{'GNU_Make'} instead of make command.\n";
+ }
+ if (($OS eq 'DOS') && (@conf{'ToolsInstaller'} eq 'no'))
+ {
+ print "* Some tools to create the installer aren't installed or are installed in a\n";
+ print " directory that I couldn't find. The installer target was disabled.\n";
+ }
+ if (@conf{'ToolsDistrib'} eq 'no')
+ {
+ print "* Some tools to create the distribution aren't installed. The distrib target\n";
+ print " was disabled.\n";
+ }
+ if ((@conf{'PCREShipped'} eq 'yes') && ($OS eq 'UNIX'))
+ {
+ print "* Using shipped PCRE lib, to avoid wasting system resources you should install\n";
+ print " the library and also the development package (i.e. libpcre3 and libpcre3-dev)\n";
+ }
+ if ((@conf{'zlibShipped'} eq 'yes') && ($OS eq 'UNIX'))
+ {
+ print "* Using shipped zlib, to avoid wasting system resources you should install\n";
+ print " the library and also the development package (i.e. libz-dev)\n";
+ }
+ if ((@conf{'bz2libShipped'} eq 'yes') && ($OS eq 'UNIX'))
+ {
+ print "* Using shipped bzip2 lib, to avoid wasting system resources you should install\n";
+ print " the library and also the development package (i.e. libbz2 and libbz2-dev)\n";
+ }
+ if ((@conf{'HAVE_AA'} eq 'no') && ($OS eq 'UNIX'))
+ {
+ print "* AA lib is not installed (or isn't functional) so you won't get a nice console\n";
+ print " screen saver (package example: aalib1-dev)\n";
+ }
+ if ((@conf{'HAVE_GDB_MI'} eq 'no') && ($OS eq 'UNIX'))
+ {
+ print "* NO DEBUG SUPPORT! The migdb library isn't available, debug features disabled.\n";
+ print " You can download it from: http://sourceforge.net/projects/libmigdb\n";
+ }
+}
+
+sub LookForGettextTools
+{
+ my $test;
+
+ print 'Looking for xgettext: ';
+ if (@conf{'xgettext'})
+ {
+ print @conf{'xgettext'}." (cached)\n";
+ return;
+ }
+ $test=RunRedirect('xgettext --version',$ErrorLog);
+ if ($test=~/(\d+\.\d+(\.\d+)?)/)
+ {
+ print "$1\n";
+ $conf{'xgettext'}=$1;
+ }
+ else
+ {
+ print "no\n";
+ $conf{'xgettext'}='no';
+ }
+}
+
+sub LookForMakeinfo
+{
+ my ($test,$ver);
+
+ print 'Looking for makeinfo: ';
+ if (@conf{'makeinfo'} && (@conf{'makeinfo'} ne 'no') && (@conf{'makeinfo'} ne 'broken'))
+ {
+ print @conf{'makeinfo'}." (cached)\n";
+ return;
+ }
+ $test=RunRedirect('makeinfo --version',$ErrorLog);
+ if ($test=~/(\d+\.\d+(\.\d+)?)(.*)(\d+\.\d+(\.\d+)?)/)
+ {
+ $ver=$4;
+ }
+ elsif ($test=~/(\d+\.\d+(\.\d+)?)/)
+ {
+ $ver=$1;
+ }
+ else
+ {
+ print "no\n";
+ $conf{'makeinfo'}='no';
+ return;
+ }
+ print "$ver";
+ if (CompareVersion($ver,$BrokenMakeinfo))
+ {
+ $conf{'makeinfo'}='broken';
+ print " Broken!\n";
+ }
+ else
+ {
+ $conf{'makeinfo'}=$ver;
+ print " OK\n";
+ }
+}
+
+sub LookForTV
+{
+ my @dirsI,@dirsL,$parent;
+
+ print 'Looking for installed Turbo Vision: ';
+ if (@conf{'TV_INCLUDE'} && @conf{'TV_LIB'} && !$TVCommandLine)
+ {
+ $TVInclude=@conf{'TV_INCLUDE'};
+ $TVLib=@conf{'TV_LIB'};
+ print "\n\tInclude dir: $TVInclude (cached)\n";
+ print "\tLibrary dir: $TVLib (cached)\n";
+ return;
+ }
+ #$parent=ParentDir();
+ $parent='..';
+ if ($OS eq 'DOS')
+ {
+ @dirsI=("$parent/tvision/include",$ENV{'DJDIR'}.'/include/tvision');
+ @dirsL=("$parent/tvision/makes",$ENV{'DJDIR'}.'/lib');
+ }
+ elsif ($OS eq 'UNIX')
+ {
+ @dirsI=("$parent/tvision/include",'/usr/include/rhtvision','/usr/local/include/rhtvision');
+ @dirsL=("$parent/tvision/makes",'/usr/lib','/usr/local/lib');
+ }
+ elsif ($OS eq 'Win32')
+ {
+ @dirsI=("$parent/tvision/include",@conf{'prefix'}.'/include/tvision');
+ @dirsL=("$parent/tvision/makes",@conf{'prefix'}.'/lib');
+ }
+ @dirsI=($conf{'TV_INCLUDE'},@dirsI) if $conf{'TV_INCLUDE'};
+ $TVInclude=LookForFile('tv.h',@dirsI);
+ if (!length($TVInclude))
+ {
+ print "\n\nError: Can't find an installed version, please install Turbo Vision first.\n";
+ print "The headers should be installed in one of the following directories:\n@dirsI\n";
+ CreateCache();
+ die "Missing library\n";
+ }
+ print "\n\tInclude dir: $TVInclude\n";
+ @dirsL=($conf{'TV_LIB'},@dirsL) if $conf{'TV_LIB'};
+ $TVLib=LookForFile('librhtv.[as]*',@dirsL);
+ $TVLib=LookForFile('librhtv*dylib',@dirsL) if (!length($TVLib));
+ if (!length($TVLib))
+ {
+ print "\nError: Can't find a compiled version, please compile Turbo Vision first.\n";
+ print "The library should be installed in one of the following directories:\n@dirsL\n";
+ CreateCache();
+ die "Missing library\n";
+ }
+ print "\tLibrary dir: $TVLib\n";
+ $conf{'TV_INCLUDE'}=$TVInclude;
+ $conf{'TV_LIB'}=$TVLib;
+}
+
+sub LookForTVConfig
+{
+ my $test;
+
+ print 'Looking for Turbo Vision config program: ';
+ $test=RunRedirect('rhtv-config --version',$ErrorLog);
+ if ($test=~/Turbo Vision/)
+ {
+ print "installed, OK\n";
+ $tvConfig='rhtv-config';
+ }
+ else
+ {
+ $tvConfig=$TVInclude.'/../rhtv-config';
+ $test=RunRedirect($tvConfig.' --version',$ErrorLog);
+ if ($test=~/Turbo Vision/)
+ {
+ print "$tvConfig, OK\n";
+ }
+ else
+ {
+ print "\nError: Can't find the Turbo Vision configuration program.\n";
+ print "Please try updating TV, then reconfigure TV and compile.\n";
+ CreateCache();
+ die "Missing tool\n";
+ }
+ }
+}
+
+sub TVConfigOption
+{
+ return `$tvConfig --$_[0]`;
+}
+
+sub LookForPCRE
+{
+ my ($test205,$test206,$t2,$test,$dir,$subpcre);
+
+ print 'Looking for PCRE library: ';
+ $test=@conf{'HAVE_PCRE_LIB'};
+ if ($test)
+ {
+ print "$test (cached)\n";
+ return;
+ }
+ $test205='
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef SUBPCRE
+ #include <pcre/pcre.h>
+#else
+ #include <pcre.h>
+#endif
+int main(void)
+{
+ pcre *compiled;
+ int flags=PCRE_MULTILINE | PCRE_CASELESS;
+ const char *error;
+ int errorOffset,hits,max,*matchs;
+ compiled=pcre_compile("test",flags,&error,&errorOffset,0);
+ if (!compiled) return 1;
+ max=(pcre_info(compiled,0,0)+1)*3;
+ matchs=(int *)malloc(max*sizeof(int));
+ hits=pcre_exec(compiled,0,"This is just a test 123",23,';
+ $t2='0,matchs,max);
+ if (hits!=1) return 1;
+ printf("OK\n");
+ return 0;
+}
+';
+ $test206=$test205.'0,'.$t2;
+ $test205.=$t2;
+
+ # See if 2.0.6+ is installed
+ $subpcre=0;
+ $test=RunGCCTest($GCC,'c',$test206,"-lpcre");
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ $test=RunGCCTest($GCC,'c',$test206,"-lpcre -DSUBPCRE");
+ $subpcre=1;
+ }
+ if ($test eq "OK")
+ {
+ print "v2.0.6 or better OK\n";
+ $conf{'HAVE_PCRE_LIB'}='yes';
+ $conf{'HAVE_PCRE206'}='yes';
+ $conf{'PCREShipped'}='no';
+ $conf{'PCRE_HEADER'}=$subpcre ? '<pcre/pcre.h>' : '<pcre.h>';
+ return;
+ }
+ print 'no 2.0.6+, ';
+ # See if 2.0+ is installed
+ $subpcre=0;
+ $test=RunGCCTest($GCC,'c',$test205,"-lpcre");
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ $test=RunGCCTest($GCC,'c',$test205,"-lpcre -DSUBPCRE");
+ $subpcre=1;
+ }
+ if ($test eq "OK")
+ {
+ print "v2.0 or better OK\n";
+ $conf{'HAVE_PCRE_LIB'}='yes';
+ $conf{'HAVE_PCRE206'}='no';
+ $conf{'PCREShipped'}='no';
+ $conf{'PCRE_HEADER'}=$subpcre ? '<pcre/pcre.h>' : '<pcre.h>';
+ return;
+ }
+ print 'no 2.0+, ';
+ # See if the one shipped works here
+ #$test=RunGCCTest($GCC,'c',$test206,"-L$supportDir -lpcre -Isupport");
+ #$test=~s/\W//g;
+ #if ($test ne "OK")
+ # {
+ # print "no shipped, disabling PCRE\n";
+ # $conf{'HAVE_PCRE_LIB'}='no';
+ # $conf{'HAVE_PCRE206'}='no';
+ # $conf{'PCREShipped'}='no';
+ # return;
+ # }
+
+ $conf{'HAVE_PCRE_LIB'}='yes';
+ $conf{'HAVE_PCRE206'}='yes';
+ $conf{'PCREShipped'}='yes';
+ $conf{'PCRE_HEADER'}='<pcre.h>';
+ print "using shipped one.\n";
+}
+
+sub TestTVVersion
+{
+ my $vNeed=$_[0];
+ my $test;
+
+ print 'Checking TV version: ';
+ $test=@conf{'tv'};
+ if ($test)
+ {
+ print "$test (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <tv.h>
+int main(void)
+{
+ printf("%d.%d.%d",TV_MAJOR_VERSION,TV_MIDDLE_VERSION,TV_MINOR_VERSION);
+ return 0;
+}
+';
+ $test=RunGCCTest($GXX,'cc',$test,"$stdcxx -I$TVInclude");
+ if (!CompareVersion($test,$vNeed))
+ {
+ print "\nWrong TV version, please use $vNeed or newer\n";
+ print "Look in $ErrorLog for potential compile errors of the test\n";
+ CreateCache();
+ die "Wrong version\n";
+ }
+ print "$test OK\n";
+ $conf{'tv'}=$test;
+}
+
+
+sub LookForAllegro
+{
+ my $vNeed=$_[0],$vMaxV=$_[1];
+ my $test;
+
+ print 'Looking for Allegro library: ';
+
+ $test=@conf{'HAVE_ALLEGRO'};
+ if ($test)
+ {
+ print "$test (cached)\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <allegro.h>
+int main(void)
+{
+ allegro_init();
+ // Defined by 3.9.x
+ #ifdef ALLEGRO_WIP_VERSION
+ printf("%d.%d.%d",ALLEGRO_VERSION,ALLEGRO_SUB_VERSION,ALLEGRO_WIP_VERSION);
+ #else
+ printf("%d.0.%d",ALLEGRO_VERSION,ALLEGRO_SUB_VERSION);
+ #endif
+ return 0;
+}
+';
+ $MP3Support=0;
+ $test=RunGCCTest($GCC,'c',$test,"-lalleg");
+ if (!length($test))
+ {
+ print "not installed, disabling MP3 support.\n";
+ $conf{'HAVE_ALLEGRO'}='no';
+ return;
+ }
+ if (!CompareVersion($test,$vNeed))
+ {
+ print "$test -> No, disabling MP3 support.\n";
+ print "\nWrong Allegro version, please use $vNeed or newer, but not greater or equal\n";
+ print "to $vMaxV.\n\n";
+ $conf{'HAVE_ALLEGRO'}='no';
+ return;
+ }
+ if (CompareVersion($test,$vMaxV))
+ {
+ print "$test -> No, disabling MP3 support.\n";
+ print "\nSorry, not compatible with this Allegro version\n\n";
+ $conf{'HAVE_ALLEGRO'}='no';
+ return;
+ }
+ $MP3Support=1;
+ $conf{'HAVE_ALLEGRO'}='yes';
+ print "$test OK\n";
+}
+
+
+sub LookForZLib
+{
+ my $vNeed=$_[0];
+ my ($test,$ver);
+
+ print 'Looking for zlib: ';
+ $test=@conf{'zlib'};
+ if ($test)
+ {
+ print "$test (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <zlib.h>
+int main(void)
+{
+ gzFile f;
+ f=gzopen("","rb");
+ printf("%s",ZLIB_VERSION);
+ return 0;
+}
+';
+ $ver=RunGCCTest($GCC,'c',$test,'-lz');
+ if (length($ver))
+ {
+ if (CompareVersion($ver,$vNeed))
+ {
+ print "$ver OK\n";
+ $conf{'zlibShipped'}='no';
+ $conf{'zlib'}=$ver;
+ return;
+ }
+ print "no $vNeed+, ";
+ }
+ else
+ {
+ print 'not installed, ';
+ }
+ #$test=RunGCCTest($GCC,'c',$test,"-lz -Isupport -L$supportDir");
+ #if (!CompareVersion($test,$vNeed))
+ # {
+ # print "no shipped\n";
+ # print "\n\nError: Can't find an installed version, please install zlib 1.1.2 or better first.\n";
+ # CreateCache();
+ # die "Missing library\n";
+ # }
+ print "using shipped one\n";
+ $conf{'zlibShipped'}='yes';
+ $conf{'zlib'}='shipped'; #$test
+}
+
+sub LookForBZ2Lib
+{
+ my $vNeed=$_[0];
+ my $test,$ver;
+
+ print 'Looking for BZip2 library: ';
+ $test=@conf{'bz2lib'};
+ if ($test)
+ {
+ print "$test (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <bzlib.h>
+int main(void)
+{
+ printf("%s",bzlibVersion());
+ return 0;
+}';
+ # I saw version 1.0.1 on Solaris with a header having BZ2_* but accepting the
+ # old names!? C++ won't let it happend.
+ $ver=RunGCCTest($GXX,'cc',$test,'-lbz2');
+ if (length($ver))
+ {
+ if (CompareVersion($ver,$vNeed))
+ {
+ print "$ver OK\n";
+ $conf{'bz2libShipped'}='no';
+ $conf{'bz2lib'}=$ver;
+ $conf{'bz2libPre1'}='yes';
+ $conf{'HAVE_BZIP2'}='yes';
+ $conf{'HAVE_BZIP2PRE1'}='yes';
+ return;
+ }
+ }
+ else
+ {
+ $test='
+#include <stdio.h>
+#include <bzlib.h>
+int main(void)
+{
+ printf("%s",BZ2_bzlibVersion());
+ return 0;
+}';
+ $ver=RunGCCTest($GXX,'cc',$test,'-lbz2');
+ if (length($ver))
+ {
+ if (CompareVersion($ver,$vNeed))
+ {
+ print "$ver OK\n";
+ $conf{'bz2libShipped'}='no';
+ $conf{'bz2lib'}=$ver;
+ $conf{'bz2libPre1'}='no';
+ $conf{'HAVE_BZIP2'}='yes';
+ return;
+ }
+ print "no $vNeed+, ";
+ }
+ else
+ {
+ print 'not installed, ';
+ }
+ }
+ #$test=RunGCCTest($GCC,'c',$test,"-lz -Isupport -L$supportDir");
+ #if (!CompareVersion($test,$vNeed))
+ # {
+ # print "no shipped\n";
+ # print "\n\nError: Can't find an installed version, please install zlib 1.1.2 or better first.\n";
+ # CreateCache();
+ # die "Missing library\n";
+ # }
+ print "using shipped one\n";
+ $conf{'bz2libShipped'}='yes';
+ $conf{'bz2lib'}='shipped'; #$test
+ $conf{'bz2libPre1'}='no';
+ $conf{'HAVE_BZIP2'}='yes';
+}
+
+sub LookForDL
+{
+ my ($test,$ver,$header,$lib);
+
+ print 'Looking for dl library: ';
+ $test=@conf{'dl'};
+ if ($test)
+ {
+ print "$test (cached) OK\n";
+ return;
+ }
+ if ($OSf eq 'QNXRtP')
+ {
+ $lib='ltdl';
+ $header='dlfcn';
+ }
+ else
+ {
+ $lib='dl';
+ $header='link';
+ }
+ $test='
+ #include <stdio.h>
+ #include <'.$header.'.h>
+ void test()
+ {
+ dlopen("test.o",0);
+ }
+
+ int main(void)
+ {
+ printf("OK");
+ return 0;
+ }';
+ $ver=RunGCCTest($GCC,'c',$test,'-l'.$lib);
+
+ if ($ver eq 'OK')
+ {
+ $conf{'dl'}='yes';
+ $conf{'dl_header'}=$header;
+ }
+ else
+ {
+ $conf{'dl'}='no';
+ }
+ print "$conf{'dl'}\n";
+}
+
+
+sub LookForIntlSupport
+{
+ my $vNeed=$_[0];
+ my ($test,$a,$djdir,$intllib,$intltest,$libdir);
+
+ print 'Checking for international support: ';
+ $conf{'intlShipped'}='no';
+ $conf{'tvfintl'}='no';
+ if ((@conf{'force-intlShipped'} eq 'yes') && ($OS eq 'DOS'))
+ {
+ print "using shipped one by user request.\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='no';
+ $conf{'intlShipped'}='yes';
+ return;
+ }
+ if (@conf{'no-intl'} eq 'yes')
+ {
+ print "disabled by user request.\n";
+ $conf{'intl'}='no';
+ $conf{'iconv'}='no';
+ #`cp include/tv/nointl.h include/tv/intl.h`;
+ return;
+ }
+ if (@conf{'intl'} eq 'yes')
+ {
+ print "yes (cached)\n";
+ return;
+ }
+ if (@conf{'intl'} eq 'no')
+ {
+ print "no (cached)\n";
+ return;
+ }
+ if ($OS eq 'DOS')
+ { # gettext 0.10.32 port have a bug in the headers, correct it
+ $djdir=@ENV{'DJDIR'};
+ $a=cat("$djdir/include/libintl.h");
+ if (length($a) && $a=~/\@INCLUDE_LOCALE_H@/)
+ {
+ $a=~s/\@INCLUDE_LOCALE_H\@//;
+ replace("$djdir/include/libintl.h",$a);
+ }
+ }
+ $intltest='
+#include <stdio.h>
+#define FORCE_INTL_SUPPORT
+#include <tv/intl.h>
+int main(void)
+{
+ printf("%s\n",_("OK"));
+ return 0;
+}
+';
+ $intllib=(($OS eq 'DOS') || ($OS eq 'Win32') || ($OSf eq 'FreeBSD') || ($OSf eq 'QNXRtP')) ? '-lintl' : '';
+ $libdir=$LDExtraDirs;
+ $libdir=~s/(\S+)/-L$1/g;
+ $test=RunGCCTest($GCC,'c',$intltest,"-I$TVInclude ".$libdir.' '.$intllib);
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ print "no, additional check required.\n";
+ print "Checking for extra libs for international support: ";
+ $test=RunGCCTest($GCC,'c',$intltest,"-I$TVInclude ".$intllib.' -liconv');
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ if ($OS eq 'DOS')
+ {
+ print "none found, using shipped one\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='no';
+ $conf{'intlShipped'}='yes';
+ }
+ else
+ {
+ $test=RunGCCTest($GCC,'c',$intltest,"-I$TVInclude -L$TVLib -ltvfintl");
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ print "not found\n";
+ $conf{'intl'}='no';
+ $conf{'iconv'}='no';
+ }
+ else
+ {
+ print "not found, using fake dummy version\n";
+ $conf{'intl'}='no';
+ $conf{'iconv'}='no';
+ $conf{'tvfintl'}='yes';
+ }
+ }
+ }
+ else
+ {
+ print "-liconv, OK\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='yes';
+ }
+ }
+ else
+ {
+ print "yes OK\n";
+ $conf{'intl'}='yes';
+ $conf{'iconv'}='no';
+ }
+}
+
+sub CreateConfigH
+{
+ my ($a,$old);
+ my $text="/* Generated automatically by the configure script */";
+
+ print "Generating configuration header: ";
+
+ $conf{'FORCE_INTL_SUPPORT'}=$conf{'intlShipped'};
+ $conf{'HAVE_DL_LIB'}=$conf{'dl'};
+ $text.=ConfigIncDefYes('HAVE_ALLEGRO','Allegro library is available');
+ $text.=ConfigIncDefYes('WITH_MP3','Enable MP3 support');
+ $text.=ConfigIncDefYes('HAVE_AMP','MP3 support from libamp');
+ $text.=ConfigIncDefYes('HAVE_MPEGSOUND','MP3 support from libmpegsound');
+ $text.=ConfigIncDefYes('HAVE_PCRE_LIB','Perl Compatible Regular Expressions support');
+ $text.=ConfigIncDefYes('HAVE_PCRE206','PCRE version 2.0.6 or newer');
+ $text.=ConfigIncDefYes('HAVE_BZIP2','bzip2 compression support');
+ $text.=ConfigIncDefYes('HAVE_BZIP2PRE1','old bzip2 version before 1.0') if(@conf{'HAVE_BZIP2'} eq 'yes');
+ $text.=ConfigIncDefYes('HAVE_MIXER','Sound mixer support');
+ $text.=ConfigIncDefYes('FORCE_INTL_SUPPORT','Gettext included with editor');
+ #$text.=ConfigIncDefYes('HAVE_X11','X11 library and headers');
+ $text.=ConfigIncDefYes('HAVE_AA','AA lib');
+ $text.=ConfigIncDefYes('HAVE_GDB_MI','GDB/MI interface');
+ $text.=ConfigIncDefYes('HAVE_CALCULATOR','Calculator');
+ $text.=ConfigIncDefYes('HAVE_CALENDAR','Calendar');
+ $text.=ConfigIncDefYes('HAVE_DL_LIB','Support for runtime dynamic libs');
+ $text.="\n#define DL_HEADER_NAME <".$conf{'dl_header'}.".h>\n";
+ $text.="#define PCRE_HEADER_NAME ".$conf{'PCRE_HEADER'}."\n";
+
+ $text.="\n\n#define CONFIG_PREFIX \"";
+ $a=$conf{'prefix'};
+ $a=~s/\\/\\\\/g;
+ $text.=$a unless $conf{'no-prefix-h'};
+ $text.="\"\n";
+
+ $text.="\n\n";
+ $text.="#define SEOS_$OS\n";
+ $text.="#define SEOS_STR \"$OS\"\n";
+ $text.="#define SEOSf_$OSf\n";
+ $text.="#define SEOSf_STR \"$OSf\"\n" if $OSf;
+ $text.="#define SECPU_$CPU\n";
+ $text.="#define SECPU_STR \"$CPU\"\n";
+ $text.="#define SEComp_$Comp\n";
+ $text.="#define SEComp_STR \"$Comp\"\n";
+ $text.="#define SECompf_$Compf\n";
+ $text.="#define SECompf_STR \"$Compf\"\n" if $Compf;
+ $text.="\n#define MSS\n#include <mss.h>\n" if @conf{'mss'} eq 'yes';
+
+ $old=cat('include/configed.h');
+ if ($text eq $old)
+ {
+ print "no changes\n";
+ }
+ else
+ {
+ print "created new header\n";
+ replace('include/configed.h',$text);
+ }
+}
+
+sub GenerateMakefile
+{
+ my $text="# Generated automatically by the configure script";
+ my ($libamp,$libset,$infview,$libbzip2,$libmpegsnd,$libz,$libpcre,$libintl);
+ my ($installer,$distrib,$compExeEditor,$compExeInfview,$holidays,$mantmode);
+ my ($aux,$extraIns,$extraInsVar,$libmigdb);
+
+ print "Generating Makefile\n";
+
+ # Give more priority to "prefix" than hardcoded value
+ $mantmode=@conf{'MAINTAINER_MODE'} eq 'yes';
+ $text.="\n\nifneq (\$(strip \$(prefix)),)\n";
+ $text.=" MPREFIX=\$(prefix)\n";
+ $text.="else\n";
+ $text.=" MPREFIX=$conf{'prefix'}\n";
+ $text.="endif\n";
+ $text.="ifeq (\$(INSTALL),)\n";
+ $text.=" INSTALL=@conf{'GNU_INSTALL'}\n";
+ $text.="endif";
+ $text.="\nlibdir=\$(MPREFIX)/lib";
+ $text.="\nCFLAGS=$conf{'CFLAGS'}";
+ $text.="\nCXXFLAGS=$conf{'CXXFLAGS'}";
+ $text.="\nSET_USE_FHS=$conf{'fhs'}" if ($OS eq 'UNIX');
+ $text.="\nMAINTAINER_MODE=1" if $mantmode;
+ $text.="\nexport";
+
+ #### Targets ####
+ $libset=@conf{'libset'} eq 'yes';
+ $libamp=@conf{'HAVE_AMP'} eq 'yes';
+ $libmpegsnd=@conf{'HAVE_MPEGSOUND'} eq 'yes';
+ $infview=@conf{'infview'} eq 'yes';
+ $libbzip2=@conf{'bz2libShipped'} eq 'yes';
+ $libz=@conf{'zlibShipped'} eq 'yes';
+ $libpcre=@conf{'PCREShipped'} eq 'yes';
+ $libintl=@conf{'intlShipped'} eq 'yes';
+ $plasmas=$OS eq 'DOS';
+ $installer=@conf{'ToolsInstaller'} eq 'yes';
+ $distrib=@conf{'ToolsDistrib'} eq 'yes';
+ $internac=@conf{'xgettext'} ne 'no';
+ $docbasic=(@conf{'makeinfo'} ne 'no') && (@conf{'makeinfo'} ne 'broken');
+ # TODO: I need to replace -soname by -h conditionaly like in TV.
+ $holidays=(@conf{'dl'} eq 'yes') && ($OSf ne 'Solaris');
+ $libmigdb=@conf{'migdbShipped'} eq 'yes';
+
+ if (@conf{'compressExe'} eq 'undef')
+ {# Default is to compress InfView and the editor only for non-UNIX targets
+ $compExeEditor=$OS ne 'UNIX';
+ $compExeInfview=1;
+ }
+ else
+ {# The user specified an option
+ $compExeEditor=@conf{'compressExe'} eq 'yes';
+ $compExeInfview=@conf{'compressExe'} eq 'yes';
+ }
+
+ $text.="\n\n.PHONY: needed";
+ $text.=" infview" if ($infview);
+ $text.=" plasmas" if ($plasmas);
+ $text.=" libbzip2" if ($libbzip2);
+ $text.=" libz" if ($libz);
+ $text.=" libmpegsnd" if ($libmpegsnd);
+ $text.=" libpcre" if ($libpcre);
+ $text.=" libamp" if ($libamp);
+ $text.=" libintl" if ($libintl);
+ $text.=" installer" if ($installer);
+ $text.=" internac" if ($internac);
+ $text.=" doc-basic" if ($docbasic);
+ $text.=" holidays" if ($holidays);
+ $text.=" libmigdb" if ($libmigdb);
+ # all targets
+ $text.="\n\nall: Makefile editor";
+ $text.=" libset" if ($libset);
+ $text.=" infview" if ($infview);
+ $text.=" plasmas" if ($plasmas);
+ $text.=" installer" if ($installer);
+ $text.="\n";
+
+ $text.="\n\nMakefile: config.pl conflib.pl\n";
+ $text.="\t\$(error Please reconfigure the package! Alternative: \"touch Makefile\")";
+
+ # libamp
+ if ($libamp)
+ {
+ $text.="\n\nlibamp:\n";
+ $text.="\t\$(MAKE) -C mp3/libamp -f libamp.mkf";
+ }
+ # libmpegsnd
+ if ($libmpegsnd)
+ {
+ $text.="\n\nlibmpegsnd:\n";
+ $text.="\t\$(MAKE) -C mp3/mpegsound -f mpegsnd.mkf";
+ }
+ # libbzip2
+ if ($libbzip2)
+ {
+ $text.="\n\nlibbzip2:\n";
+ $text.="\t\$(MAKE) -C libbzip2 libbz2.a";
+ }
+ # libz
+ if ($libz)
+ {
+ $text.="\n\nlibz:\n";
+ $text.="\t\$(MAKE) -C libz libz.a";
+ }
+ # libpcre
+ if ($libpcre)
+ {
+ $text.="\n\nlibpcre:\n";
+ $text.="\t\$(MAKE) -C libpcre libpcre.a";
+ }
+ # libintl
+ if ($libintl)
+ {
+ $text.="\n\nlibintl:\n";
+ $text.="\t\$(MAKE) -C gettext";
+ }
+ # libmigdb
+ if ($libmigdb)
+ {
+ $text.="\n\nlibmigdb:\n";
+ $text.="\t\$(MAKE) -C libmigdb";
+ }
+ # i8n
+ if ($internac)
+ {
+ $text.="\n\ninternac:\n";
+ $text.="\t\$(MAKE) -C internac";
+ }
+ if ($docbasic)
+ {
+ $text.="\n\ndoc-basic:\n";
+ $text.="\t\$(MAKE) -C doc txt info";
+ }
+ # needed (by editor)
+ $text.="\n\n# Libraries not created by RHIDE projects\nneeded:";
+ $text.=" libamp" if ($libamp);
+ $text.=" libmpegsnd" if ($libmpegsnd);
+ $text.=" libbzip2" if ($libbzip2);
+ $text.=" libz" if ($libz);
+ $text.=" libpcre" if ($libpcre);
+ $text.=" libintl" if ($libintl);
+ $text.=" holidays" if ($holidays);
+ $text.=" libmigdb" if ($libmigdb);
+ $text.=" include/vername.h" if ($mantmode);
+ #
+ # MinGW tools I tested are broken and can't generate these targets
+ #
+ $text.=" internac" if ($internac) && ($Compf ne 'MinGW');
+ $text.=" doc-basic" if ($docbasic) && ($Compf ne 'MinGW');
+ # editor
+ $text.="\n\neditor: needed";
+ $text.="\n\t\$(MAKE) -C makes";
+ # libset
+ if ($libset)
+ {
+ $text.="\n\nlibset:\n";
+ $text.="\t\$(MAKE) -C makes libset";
+ }
+ # infview
+ if ($infview)
+ {
+ $text.="\n\ninfview:\n";
+ $text.="\t\$(MAKE) -C makes infview";
+ }
+ # plasmas
+ if ($plasmas)
+ {
+ $text.="\n\nplasmas:\n";
+ $text.="\tcd scrnsave; \$(MAKE); cd ..";
+ }
+ # installer
+ if ($installer)
+ {
+ $text.="\n\ninstaller: editor\n";
+ $text.="\t\$(MAKE) -C makes installer";
+ }
+ # holidays plug-ins
+ if ($holidays)
+ {
+ $text.="\n\nholidays:\n";
+ $text.="\t\$(MAKE) -C holidays";
+ }
+ # version name and revision header
+ if ($mantmode)
+ {
+ $text.="\n\ninclude/vername.h: change.log\n";
+ $text.="\tperl updaterev.pl";
+ }
+
+ $extraIns='';
+ # Don't compress executables
+ $extraIns.='--no-compress ' unless ($compExeEditor);
+ # Sources tarball compressed with bzip2
+ $extraIns.='--use-bzip2 ' if $conf{'source-bzip2'} eq 'yes';
+ # .exe extension:
+ # DOS uses a special script where the extension remains.
+ # POSIX systems don't, but Cygwin uses the POSIX script.
+ $extraIns.='--keep-extension ' if ($OS eq 'Win32');
+ $extraInsVar='';
+ $extraInsVar=" \"EXTRA_INS_OPS=$extraIns\"" if $extraIns;
+ #### Installations ####
+ # editor
+ $text.="\n\ninstall-editor: editor\n";
+ $text.="\t\$(MAKE) -C makes install";
+ $text.=$extraInsVar;
+ # libset
+ if ($libset)
+ {
+ $text.="\n\ninstall-libset: libset\n";
+ $text.="\t".GenInstallDir('0755','$(libdir)');
+ $text.="\t".GenInstallFiles('0644','makes/libset.a','$(libdir)');
+ }
+ # infview
+ if ($infview)
+ {
+ $text.="\n\ninstall-infview: infview\n";
+ $text.="\t\$(MAKE) -C makes install-infview";
+ $text.=$extraInsVar;
+ }
+ # all targets
+ $text.="\n\ninstall: install-editor";
+ $text.=" install-libset" if ($libset);
+ $text.=" install-infview" if ($infview);
+ $text.="\n";
+
+ if ($distrib)
+ {
+ #### Distribution ####
+ # editor
+ $text.="\n\ndistrib-editor: needed\n";
+ $text.="\t\$(MAKE) -C makes distrib $extraInsVar";
+ # just sources
+ $text.="\n\ndistrib-source:\n";
+ $text.="\t\$(MAKE) -C makes distrib-source $extraInsVar";
+ # infview
+ if ($infview)
+ {
+ $text.="\n\ndistrib-infview: needed\n";
+ $text.="\t\$(MAKE) -C makes distrib-infview $extraInsVar";
+ }
+ # all targets
+ $text.="\n\ndistrib: distrib-editor";
+ $text.=" distrib-infview" if ($infview);
+ $text.="\n";
+ }
+
+ $text.="\nclean:\n";
+ $text.="\tcd makes; \$(MAKE) clean-o; \$(MAKE) clean-docs; cd ..\n";
+ $text.="\trm -f configure.cache\n";
+ $text.="\trm -f Makefile\n";
+ $text.="\trm -f errormsg.txt\n";
+ $text.="\trm -f doc/sdh.exe\n";
+ $text.="\trm -f include/configed.h\n";
+ $text.="\trm -rf makes/linux/result makes/linux/resultInf makes/linux/setedit-* makes/linux/infview-*\n" if ($OS eq 'UNIX');
+ $text.="\trm -rf makes/djgpp/distinf makes/djgpp/distrib makes/djgpp/result makes/djgpp/resulinf\n" if ($OS eq 'DOS');
+ $text.="\trm -f makes/*.a makes/*.exe makes/*.gdt\n";
+ $text.="\trm -f mp3/libamp/*.a mp3/libamp/obj/*.o\n";
+ $text.="\trm -f mp3/mpegsound/*.a mp3/mpegsound/obj/*.o\n";
+ $text.="\tcd scrnsave; \$(MAKE) clean-o; cd ..\n" if ($plasmas);
+ $text.="\t\$(MAKE) -C libbzip2 clean\n" if ($libbzip2);
+ $text.="\t\$(MAKE) -C libz clean\n" if ($libz);
+ $text.="\t\$(MAKE) -C libpcre clean\n" if ($libpcre);
+ $text.="\t\$(MAKE) -C holidays clean\n" if ($holidays);
+ $text.="\t\$(MAKE) -C libmigdb clean\n" if ($libmigdb);
+
+ replace('Makefile',$text);
+}
+
+sub LookForGPM
+{
+ my $vNeed=$_[0],$test;
+
+ print 'Looking for gpm library: ';
+ if (@conf{'gpm'})
+ {
+ print "@conf{'gpm'} (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <gpm.h>
+int main(void)
+{
+ int version;
+ printf("%s",Gpm_GetLibVersion(&version));
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'-lgpm');
+ if (!length($test))
+ {
+ #print "\nError: gpm library not found, please install gpm $vNeed or newer\n";
+ #print "Look in $ErrorLog for potential compile errors of the test\n";
+ #CreateCache();
+ #die "Missing library\n";
+ $conf{'HAVE_GPM'}='no';
+ print " no, disabling mouse support\n";
+ return;
+ }
+ if (!CompareVersion($test,$vNeed))
+ {
+ #print "$test, too old\n";
+ #print "Please upgrade your gpm library to version $vNeed or newer.\n";
+ #print "You can try with $test forcing the configure scripts.\n";
+ #CreateCache();
+ #die "Old library\n";
+ $conf{'HAVE_GPM'}='no';
+ print " too old, disabling mouse support\n";
+ return;
+ }
+ $conf{'gpm'}=$test;
+ $conf{'HAVE_GPM'}='yes';
+ print "$test OK\n";
+}
+
+sub LookForToolsInstaller
+{
+ my ($list,$i,$test);
+
+ print 'Tools for Installer:';
+ if ($conf{'ToolsInstaller'} eq 'yes')
+ {
+ print " yes (cached)\n";
+ return;
+ }
+ # Allegro, already tested
+ if ($conf{'HAVE_ALLEGRO'} ne 'yes')
+ {
+ print " no Allegro library\n";
+ return;
+ }
+ # PCRE, already tested
+ if ($conf{'HAVE_PCRE_LIB'} ne 'yes')
+ {
+ print " no PCRE library\n";
+ return;
+ }
+ # Various programs
+ @list=('cwsdpmi.exe','cwsdpmi.doc','emu387.dxe',
+ 'pmodstub.exe','exedat.exe','dat.exe','groff.exe');
+ foreach $i (@list)
+ {
+ print " $i";
+ if (!(-e $ENV{'DJDIR'}.'/bin/'.$i))
+ {
+ print " no\n";
+ return;
+ }
+ }
+ # zip
+ print ' zip';
+ $test=RunRedirect('zip -h');
+ if (!($test=~/zip/))
+ {
+ print " no\n";
+ return;
+ }
+ # upx
+ print ' upx';
+ $test=RunRedirect('upx -V');
+ if (!($test=~/upx/))
+ {
+ print " no\n";
+ return;
+ }
+ # Libwin
+ print ' libwin';
+ $test='
+#include <stdio.h>
+#include <libwin.h>
+void dummy(void) {
+long hKey;
+w95_reg_openkey(HKEY_LOCAL_MACHINE,"SOFTWARE",&hKey); }
+int main(void)
+{
+ printf("Ok\n");
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'-lwin');
+ $test=~s/[\r\n]//g;
+ if ($test ne 'Ok')
+ {
+ print " no\n";
+ return;
+ }
+ print " OK!\n";
+ $conf{'ToolsInstaller'}='yes';
+}
+
+sub LookForToolsDistrib
+{
+ my ($test);
+
+ print 'Tools for Distrib:';
+ if ($conf{'ToolsDistrib'} eq 'yes')
+ {
+ print " yes (cached)\n";
+ return;
+ }
+ if ($OS eq 'UNIX')
+ {# Should I test with other switches?
+ # And the compressor? check for gzip?
+ # tar
+ print ' tar';
+ `tar --help > test.txt 2>&1`;
+ $test=cat('test.txt');
+ unlink 'test.txt';
+ if (!($test=~/tar/))
+ {
+ print " no\n";
+ return;
+ }
+ print ' gzip';
+ `gzip --help > test.txt 2>&1`;
+ $test=cat('test.txt');
+ unlink 'test.txt';
+ if (!($test=~/gzip/))
+ {
+ print " no\n";
+ return;
+ }
+ }
+ else
+ {
+ # zip
+ print ' zip';
+ $test=RunRedirect('zip -h');
+ if (!($test=~/zip/))
+ {
+ print " no\n";
+ return;
+ }
+ }
+ print " OK\n";
+ $conf{'ToolsDistrib'}='yes';
+}
+
+sub LookForBasicTools
+{
+ my $test;
+ if (($OS eq 'DOS') || ($OS eq 'Win32'))
+ {
+ #$test=RunRedirect('rm --version');
+ $test=RunRedirect('cp --version');
+ if (!($test=~/fileutils/))
+ {
+ print "Please install the fileutils package. The name is usually something like it:\n";
+ print "filXXXb.zip where XXX is the version.\n";
+ die "\n";
+ }
+ }
+}
+
+sub LookForXlib()
+{
+ my ($test,$o,$libs);
+
+ print 'Looking for X11 libs: ';
+ if (@conf{'HAVE_X11'})
+ {
+ print "@conf{'HAVE_X11'} (cached)\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+Display *Test()
+{ return XOpenDisplay(""); }
+int main(void)
+{
+ printf("OK, %d.%d\n",X_PROTOCOL,X_PROTOCOL_REVISION);
+ return 0;
+}
+';
+ $conf{'X11LibPath'}='/usr/X11R6/lib' unless $conf{'X11LibPath'};
+ $conf{'X11Lib'}='X11 Xmu' unless $conf{'X11Lib'};
+ $libs=$conf{'X11Lib'};
+ $libs=~s/(\S+)/-l$1/g;
+ $o='';
+ $o.='-I'.$conf{'X11IncludePath'} if $conf{'X11IncludePath'};
+ $o.=" -L$conf{'X11LibPath'} $libs";
+ $test=RunGCCTest($GCC,'c',$test,$o);
+ if ($test=~/OK, (\d+)\.(\d+)/)
+ {
+ $conf{'HAVE_X11'}='yes';
+ print "yes OK (X$1 rev $2)\n";
+ }
+ else
+ {
+ if (!$conf{'X11IncludePath'})
+ {
+ $conf{'X11IncludePath'}='/usr/X11R6/include';
+ $o.="-I$conf{'X11IncludePath'} -L$conf{'X11LibPath'} $libs";
+ if ($test=~/OK, (\d+)\.(\d+)/)
+ {
+ $conf{'HAVE_X11'}='yes';
+ print "yes OK (X$1 rev $2)\n";
+ return;
+ }
+ }
+ $conf{'HAVE_X11'}='no';
+ print "no, disabling X11 version\n";
+ }
+}
+
+sub LookForAA
+{
+ my ($test);
+
+ print 'Looking for AA library: ';
+ $test=$conf{'HAVE_AA'};
+ if (($test eq 'yes') || ($conf{'HAVE_AA_from_user'} eq 'yes'))
+ {
+ print "$test ";
+ print (($conf{'HAVE_AA_from_user'} eq 'yes') ? "(user)" : "(cached)");
+ print " OK\n";
+ return;
+ }
+ $test='
+ #include <stdio.h>
+ #include <aalib.h>
+ int main(void)
+ {
+ if (aa_autoinit(&aa_defparams))
+ printf("OK\n");
+ return 0;
+ }';
+ # AA lib v1.2 SuSE SLES 8 doesn't work for C++ (wrong typedef for struct)
+ $test=RunGCCTest($GXX,'cc',$test,'-laa');
+ $conf{'HAVE_AA'}=($test=~/OK$/) ? 'yes' : 'no';
+
+ print "$conf{'HAVE_AA'}\n";
+}
+
+sub LookForMI()
+{
+ my $vNeed=$_[0];
+ my ($ver,$test);
+
+ print 'Looking for GDB/MI library: ';
+ $ver=$conf{'HAVE_GDB_MI'};
+ if ($ver)
+ {
+ print "$ver (cached) OK\n";
+ return;
+ }
+ $conf{'migdbShipped'}='no';
+ $test='
+ #include <stdio.h>
+ #include <mi_gdb.h>
+ int main(void)
+ {
+ mi_set_gdb_exe("none");
+ printf("%s\n",MI_VERSION_STR);
+ return 0;
+ }';
+ $ver=RunGCCTest($GCC,'c',$test,'-lmigdb');
+ $ver=~s/[\r\n]//g;
+ if (length($ver))
+ {
+ if (CompareVersion($ver,$vNeed))
+ {
+ print "$ver OK\n";
+ $conf{'HAVE_GDB_MI'}='yes';
+ return;
+ }
+ print "no $vNeed+";
+ }
+ else
+ {
+ print "not installed";
+ }
+ if (-d 'libmigdb')
+ {
+ print ", using shipped one\n";
+ $conf{'migdbShipped'}='yes';
+ $conf{'HAVE_GDB_MI'}='yes';
+ return;
+ }
+ print "\n";
+ $conf{'HAVE_GDB_MI'}='no';
+}
+
+sub LookForMaintainerTools
+{
+ my $file;
+
+ $file=LookForFileInPath('gpr2mak*');
+ if (!length($file))
+ {
+ die "\nRHIDE tools aren't installed. They are needed only for maintainer mode.\n".
+ "Install RHIDE or disable the maintaner mode.\n\n";
+ }
+}
+
diff --git a/setedit/confignt.pl b/setedit/confignt.pl
new file mode 100644
index 0000000..d808058
--- /dev/null
+++ b/setedit/confignt.pl
@@ -0,0 +1,99 @@
+#!/usr/bin/perl
+# Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+require "miscperl.pl";
+require "conflib.pl";
+
+SeeCommandLine();
+
+$col=14;
+$a=ExtractItemsImk('makes/editor.imk',$col);
+$a.=' '.ExtractItemsImk('makes/easydiag.imk',$col);
+$a.=' '.ExtractItemsImk('makes/settv.imk',$col);
+$a.=' '.ExtractItemsImk('makes/librhuti.imk',$col);
+$a=~s/mixersb\.o//;
+$a=~s/mixoss\.o//;
+$a=~s/djmdr\.o//;
+$a=~s/memmove\.o//;
+$b=$a;
+$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+
+$ReplaceTags{'EDITOR_OBJS'}=$a;
+
+$b=~s/(\w+)\.(\w+)/\$\(OBJDIR\)\/$1\.o/g;
+$ReplaceTags{'EDITOR_OBJS_MS'}=$b;
+$b=0;
+
+$col=14;
+$a=ExtractItemsImk('makes/easydiag.imk',$col);
+$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+$ReplaceTags{'EASYDIAG_OBJS'}=$a;
+
+$col=14;
+$a=ExtractItemsImk('makes/librhuti.imk',$col);
+$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+$ReplaceTags{'LIBRHUTI_OBJS'}=$a;
+
+$col=14;
+$a=ExtractItemsImk('makes/libset.imk',$col);
+$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+$ReplaceTags{'LIBSET_OBJS'}=$a;
+
+$col=14;
+$a=ExtractItemsImk('makes/settv.imk',$col);
+$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+$ReplaceTags{'SETTVUTI_OBJS'}=$a;
+
+$ReplaceTags{'DEST_BIN_DIR'} = $conf{'bindir'};
+$ReplaceTags{'DEST_SET_DIR'} = $conf{'setdir'};
+
+$ReplaceTags{'DYNRTL'} = $conf{'dynrtl'} ? "DYNRTL = 1" : "";
+
+ReplaceText('WinNT/bccmake.in','WinNT/Makefile');
+ReplaceText('WinNT/msvcmake.in','WinNT/Makefile.nmk');
+$a='';
+
+sub SeeCommandLine
+{
+ my $i;
+
+ foreach $i (@ARGV)
+ {
+ if ($i eq '--help')
+ {
+ ShowHelp();
+ die "\n";
+ }
+ elsif ($i=~'--bindir=(.*)')
+ {
+ $conf{'bindir'}=$1;
+ }
+ elsif ($i=~'--setdir=(.*)')
+ {
+ $conf{'setdir'}=$1;
+ }
+ elsif ($i eq '--with-dynrtl')
+ {
+ $conf{'dynrtl'} = 1;
+ }
+ else
+ {
+ ShowHelp();
+ die "Unknown option: $i\n";
+ }
+ }
+ $conf{'bindir'} = 'c:\setedit' if $conf{'bindir'} eq '';
+ $conf{'setdir'} = 'c:\setedit' if $conf{'setdir'} eq '';
+}
+
+sub ShowHelp
+{
+ print "Available options:\n\n";
+ print "--help : displays this text.\n";
+ print "--bindir=path : defines the directory where *.exe files will be installed.\n";
+ print "--setdir=path : defines the directory where documentation andsupport files\n" .
+ " will be installed.\n";
+ print "--with-dynrtl : compile with DLL runtime.\n";
+}
diff --git a/setedit/configset b/setedit/configset
new file mode 100755
index 0000000..7540f82
--- /dev/null
+++ b/setedit/configset
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Copyright (C) 1999-2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+echo
+echo This batch file configures the packages using the settings that the
+echo *maintainer* uses for your own needs.
+echo These settings doesn\'t have to be the same you want.
+echo The most common defaults are obtained by just running configure.bat.
+echo If you want to reconfigure the package first delete configure.cache
+echo
+echo Press the 'ENTER' key to continue.
+read
+rm -f configure.cache
+rm -f Makefile
+# gcc 2.95.4 compiles much faster (3.2x average)
+#export CC="gcc-2.95"
+#export CXX="g++-2.95"
+# gcc 3.3.5 generates faster code (+20% aprox. for K7)
+#export CC="gcc-3.3"
+#export CXX="g++-3.3"
+# Using -march=athlon-xp -mfpmath=sse you get a sligthly faster (2%) and smaller binary
+perl config.pl --no-prefix-h --no-fhs --Xcppflags=-O3\ -fomit-frame-pointer\ -ffast-math --cflags=-O2\ -Wall\ -Werror\ -gstabs+3\ -pipe --cxxflags=-O2\ -Wall\ -Werror\ -gstabs+3\ -pipe --libset --enable-maintainer-mode $1 $2
+
diff --git a/setedit/configset.bat b/setedit/configset.bat
new file mode 100644
index 0000000..2563054
--- /dev/null
+++ b/setedit/configset.bat
@@ -0,0 +1,22 @@
+:@Rem Copyright (C) 1999-2003 by Salvador E. Tropea (SET),
+:@Rem see copyrigh file for details
+@
+@echo .
+@echo This batch file configures the packages using the settings that the
+@echo *maintainer* uses for your own needs.
+@echo These settings doesn't have to be the same you want.
+@echo The most common defaults are obtained by just running configure.bat.
+@echo If you want to reconfigure the package first delete configure.cache
+@echo .
+@pause
+@echo off
+@del configure.cache
+@del Makefile
+@set CFLAGS=-O2 -Wall -Werror -gstabs+3
+@set CXXFLAGS=-O2 -Wall -Werror -gstabs+3 -fno-exceptions -fno-rtti
+@echo "--Xcppflags=-O3 -fomit-frame-pointer -ffast-math -fno-exceptions -fno-rtti" --shipped-intl > perl.parm
+@echo --enable-maintainer-mode --libset >> perl.parm
+@echo --no-prefix-h %1 %2 %3 %4 %5 %6 %7 %8 %9 >> perl.parm
+@perl config.pl @perl.parm
+@del perl.parm
+
diff --git a/setedit/configure b/setedit/configure
new file mode 100755
index 0000000..4d4f59f
--- /dev/null
+++ b/setedit/configure
@@ -0,0 +1,2 @@
+#!/bin/sh
+perl config.pl "$@"
diff --git a/setedit/configure.bat b/setedit/configure.bat
new file mode 100644
index 0000000..180c40b
--- /dev/null
+++ b/setedit/configure.bat
@@ -0,0 +1,6 @@
+:@Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+:@Rem see copyrigh file for details
+@
+@Echo off
+@rm -f Makefile
+@perl config.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/setedit/conflib.pl b/setedit/conflib.pl
new file mode 100644
index 0000000..9c9888e
--- /dev/null
+++ b/setedit/conflib.pl
@@ -0,0 +1,1558 @@
+#!/usr/bin/perl
+# Copyright (C) 1999-2004 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Common configuration routines.
+#
+
+$ErrorLog='errormsg.txt';
+$MakeDefsRHIDE={};
+$ExtraModifyMakefiles={};
+# DOS, UNIX, Win32
+$OS='';
+# Linux, FreeBSD, NetBSD, Solaris, QNXRtP, OpenBSD, Darwin
+$OSf='';
+# x86, Alpha, SPARC64, SPARC, PPC, HPPA, MIPS, Itanium, Unknown
+$CPU='';
+# GCC, BCPP, MSC
+$Comp='';
+# djgpp, MinGW, Cygwin
+$Compf='';
+# TV configuration program
+$tvConfig='';
+# gcc's -pipe option
+$UsePipe=0;
+
+sub GetCache
+{
+ my $val;
+
+ if (open(FIL,'<configure.cache'))
+ {
+ while ($val=<FIL>)
+ {
+ if ($val=~/(.*) => (.*)\n/)
+ {
+ @conf{$1}=$2;
+ #print "$1 => $2\n";
+ }
+ else
+ {
+ #print "No toma: ($val)";
+ }
+ }
+ close(FIL);
+ }
+}
+
+
+sub CreateCache
+{
+ my ($i,$ff);
+
+ $ff=1;
+ if (open(FIL,'>configure.cache'))
+ {
+ foreach $i (%conf)
+ {
+ if ($ff)
+ {
+ print FIL ("$i => @conf{$i}\n");
+ $ff=0;
+ }
+ else
+ {
+ $ff=1;
+ }
+ }
+ close(FIL);
+ }
+}
+
+
+sub CompareVersion
+{
+ my ($actual,$needed)=@_;
+ my ($vact,$vneed);
+
+ $actual=~/(\d+)\.(\d+)(\.(\d+))?/;
+ $vact=$1*1000000+$2*1000+$4;
+ $needed=~/(\d+)\.(\d+)(\.(\d+))?/;
+ $vneed=$1*1000000+$2*1000+$4;
+ #print "$vact v.s. $vneed\n";
+ $vact>=$vneed;
+}
+
+
+sub LookForFile
+{
+ my ($file,@path)=@_;
+ my ($i,@a,$f);
+
+ foreach $i (@path)
+ {
+ #print "Testing for ".$i.'/'.$file."\n";
+ @a=glob($i.'/'.$file);
+ foreach $f (@a)
+ {
+ if (-e $f)
+ {
+ return $i;
+ }
+ }
+ }
+ '';
+}
+
+sub LookForFileInPath
+{
+ my ($file)=@_;
+ my @list;
+
+ @list=(($OS eq 'UNIX') || ($Compf eq 'Cygwin')) ? split(/:/,@ENV{'PATH'}) : split(/;/,@ENV{'PATH'});
+ return LookForFile($file,@list);
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: RunRedirect($command,$ErrorLog)
+# Description:
+# Executes the desired command sending the stderr to $ErrorLog file
+# (appending) and returning the stdout.
+#
+# Return: The value returned from the program (from stdout).
+#
+####################################################################[txi]###
+
+sub RunRedirect
+{
+ my ($command)=@_;
+ my $ret;
+
+ if ($OS eq 'DOS')
+ {
+ $ret=`redir -ea $ErrorLog $command`;
+ }
+ elsif ($OS eq 'Win32')
+ {
+ $ret=`sh -c "$command 2>> $ErrorLog"`;
+ }
+ else
+ {
+ $ret=`$command 2>> $ErrorLog`;
+ }
+ $ret;
+}
+
+sub AddIncludes
+{
+ my (@dirs)=split(' ',$conf{'EXTRA_INCLUDE_DIRS'});
+ my ($res)='';
+ for (@dirs)
+ {
+ $res.=" -I$_";
+ }
+ return $res;
+}
+
+###[txh]####################################################################
+#
+# Prototype: RunGCCTest($gcc,$extension,$prog,$flags)
+# Description:
+# Compiles a test program with gcc and runs it callecting the output.@*
+# You must pass the name of the compiler as argument, also the extension of
+# the file (.c, .cc, etc.), the code to compile and any etra switch options
+# needed to compile.@*
+# Additionally the following global variables are used: $CFLAGS: standard
+# flags for the C compiler (used when extension=='c'), $CXXFLAGS: standard
+# flags for the C++ compiler (used when extension=='cc'), $ErrorLog: file
+# to log the actions and errors and the $OS guess.@*
+#
+# Return: The value returned from the program (from stdout).
+#
+####################################################################[txi]###
+
+sub RunGCCTest
+{
+ my ($cc,$ext,$test,$switchs)=@_;
+ my ($command,$label);
+ my ($file,$flags)=('test.'.$ext,'');
+
+ unlink 'test.exe';
+ replace($file,$test."\n");
+ $flags=$CFLAGS if ($ext eq 'c');
+ $flags=$CXXFLAGS if ($ext eq 'cc');
+ $flags.=AddIncludes();
+ $command="$cc -o test.exe $flags $file $switchs";
+ #print "\nRunning: $command\n";
+ $label=$command.":\n";
+ `echo $label >> $ErrorLog`;
+
+ RunRedirect($command);
+ $test=-e 'test.exe' ? `./test.exe` : '';
+ unlink('test.o',$file,'test.exe');
+ $test;
+}
+
+###[txh]####################################################################
+#
+# Prototype: LookForPrefix()
+# Description:
+# Tries to find the right installation prefix. The following mechanisms
+# are used:@*
+# 1) Look for cached prefix key.@*
+# 2) Look for prefix environment variable.@*
+# 3) Look for PREFIX environment variable.@*
+# UNIX:@*
+# 4) Find where make is installed and guess from it.@*
+# 5) If not found default to /usr@*
+# DOS:@*
+# 6) Use the DJDIR environment variable.@*
+# The result is stored in the prefix configuration key.
+#
+####################################################################[txi]###
+
+sub LookForPrefix
+{
+ my ($test,$prefix,@lista,$i,$found);
+
+ print 'Looking for prefix: ';
+ $prefix=@conf{'prefix'};
+ if ($prefix)
+ {
+ print "$prefix (cached/specified)\n";
+ LookIfFHS();
+ return;
+ }
+ $prefix=@ENV{'prefix'};
+ if (!$prefix)
+ {
+ $prefix=@ENV{'PREFIX'};
+ }
+ if ($prefix)
+ {
+ print "$prefix (environment)\n";
+ @conf{'prefix'}=$prefix;
+ LookIfFHS();
+ return;
+ }
+ if (($OS eq 'UNIX') || ($Compf eq 'Cygwin'))
+ {
+ if (`which make`=~/(.*)\/bin\/make/)
+ {
+ $prefix=$1;
+ }
+ else
+ {
+ if ($OSf eq 'FreeBSD')
+ { $prefix='/usr/local'; }
+ else
+ { $prefix='/usr'; }
+ }
+ }
+ elsif ($OS eq 'DOS')
+ {
+ $prefix=@ENV{'DJDIR'};
+ }
+ else
+ {
+ if ($Compf eq 'MinGW')
+ {
+ @lista=(split(/;/,@ENV{'PATH'}),split(/:/,@ENV{'PATH'}));
+ $found=0;
+ foreach $i (@lista)
+ {
+ #print "Buscando ".$i."\\make.exe\n";
+ if (!$found && (-e $i."\\make.exe") &&
+ ($i=~/(.*)[\\\/][bB][iI][nN]/))
+ {
+ $prefix=$1;
+ $found=1;
+ }
+ }
+ }
+ if (!$found)
+ {
+ if (!$test)
+ {
+ die "Some critical tools aren't installed please read the reame files";
+ }
+ else
+ {
+ print "Unable to determine installation prefix, please use --prefix option.\n";
+ print "You'll most probably need to quote the --prefix option (\"--prefix=path\").\n" if @ENV{'OS'} eq 'Windows_NT';
+ die;
+ }
+ }
+ }
+ @conf{'prefix'}=$prefix;
+ print "$prefix\n";
+ LookIfFHS();
+}
+
+sub LookIfFHS
+{
+ if ($OS eq 'UNIX')
+ {
+ print 'Checking if this system follows the FHS: ';
+ if ($conf{'fhs'})
+ {
+ print "$conf{'fhs'} (cached/specified)\n";
+ return;
+ }
+ # FreeBSD uses share/doc but not shared/info and shared/man
+ if ((-d $prefix.'/share/doc') && (-d $prefix.'/share/info') && (-d $prefix.'/share/man'))
+ {
+ $conf{'fhs'}='yes';
+ }
+ else
+ {
+ $conf{'fhs'}='no';
+ }
+ print "$conf{'fhs'}\n";
+ }
+}
+
+###[txh]####################################################################
+#
+# Prototype: CheckGCC()
+# Description:
+# Tries to find a working C compiler. The following tests are done:@*
+# 1) Look for cached GCC key.@*
+# 2) Look for CC environment variable.@*
+# 3) Default to gcc.@*
+# Then a small test program is compiled. If it fails the program dies.@*
+# The result is stored in the GCC configuration key.
+#
+# Return: The name of the working compiler.
+#
+####################################################################[txi]###
+
+sub CheckGCC
+{
+ my ($cc,$test);
+
+ print 'Looking for a working gcc: ';
+ $cc=@conf{'GCC'};
+ if ($cc)
+ {
+ print "$cc (cached) OK\n";
+ return $cc;
+ }
+ $cc=$ENV{'CC'};
+ if (!length($cc))
+ {
+ $cc='gcc';
+ }
+ print "$cc ";
+ $test='#include <stdio.h>
+int main(void)
+{
+ printf("OK\n");
+ return 0;
+}
+';
+ $test=RunGCCTest($cc,'c',$test,'');
+ $test=~s/\W//g;
+ if ($test ne "OK")
+ {
+ CreateCache();
+ die 'Not working gcc found';
+ }
+ print "OK\n";
+ $conf{'GCC'}=$cc;
+ $cc;
+}
+
+###[txh]####################################################################
+#
+# Prototype: CheckGCCcanXX($gcc)
+# Description:
+# Checks if the C compiler can be used to compile C++ code.
+#
+# Return: 'yes' or 'no' according to a compilation test.
+#
+####################################################################[txi]###
+
+sub CheckGCCcanXX
+{
+ my $cc=$_[0];
+ my ($ret,$test);
+
+ print "$cc can compile C++ code: ";
+ $test='
+#if __GNUC__>=3
+ #include <iostream>
+ #define STD(a) std::a
+#else
+ #include <iostream.h>
+ #define STD(a) a
+#endif
+int main(void)
+{
+ STD(cout) << "OK" << STD(endl);
+ return 0;
+}';
+ $test=RunGCCTest($cc,'cc',$test,$stdcxx);
+ $test=~s/\W//g;
+ if ($test eq "OK")
+ {
+ print "yes\n";
+ $ret=1;
+ }
+ else
+ {
+ print "no\n";
+ $ret=0;
+ }
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: CheckGXX()
+# Description:
+# Finds the C++ compiler. Mechanism:@*
+# 1) Cached GXX key.@*
+# 2) Compiler declared in global $GCC variable.@*
+# 3) Return value from CheckGXXReal().@*
+# The result is stored in the GXX configuration key and the $GXX global
+# variable.
+#
+# Return: The $GXX value.
+#
+####################################################################[txi]###
+
+sub CheckGXX
+{
+ if (@conf{'GXX'})
+ {
+ print "C++ compiler: @conf{'GXX'} (cached) OK\n";
+ return @conf{'GXX'};
+ }
+ # Test for a working g++
+ $GXX=CheckGXXReal();
+
+ $conf{'GXX'}=$GXX;
+}
+
+###[txh]####################################################################
+#
+# Prototype: CheckGXXReal()
+# Description:
+# Tries to find if $defaultCXX can compile C++. This global variable is
+# determined during the OS detection. If it fails the program dies.
+#
+# Return: The name of the compiler.
+#
+####################################################################[txi]###
+
+sub CheckGXXReal
+{
+ my ($test,$res,@list,$i,$cxx);
+
+ print 'Looking for the C++ compiler: ';
+ $test='
+#if __GNUC__>=3
+ #include <iostream>
+ #define STD(a) std::a
+#else
+ #include <iostream.h>
+ #define STD(a) a
+#endif
+int main(void)
+{
+ STD(cout) << "OK" << STD(endl);
+ return 0;
+}';
+ @list=split(/:/,$defaultCXX);
+ $cxx=$ENV{'CXX'};
+ if (length($cxx))
+ {
+ unshift @list,$cxx;
+ }
+ foreach $i (@list)
+ {
+ $res=RunGCCTest($i,'cc',$test,$stdcxx);
+ $res=~s/\W//g;
+ if ($res eq "OK")
+ {
+ print "$i\n";
+ return $i;
+ }
+ }
+ return $GCC if (CheckGCCcanXX($GCC));
+ CreateCache();
+ die('can not find it');
+}
+
+###[txh]####################################################################
+#
+# Prototype: LookForDJGPP($versionNeeded)
+# Description:
+# Finds if the installed djgpp version is the needed. Note that the
+# version should be provided in the following way: djgpp v2.01 => 2.0.1.
+# I did it to accomodate to the version comparisson test. Mechanism:@*
+# 1) Cached djgpp key.@*
+# 2) Compilation of a small program printing DJGPP.0.DJGPP_MINOR.@*
+# If the version is incorrect the program dies.@*
+# The result is stored in the 'djgpp' configuration key.
+#
+####################################################################[txi]###
+
+sub LookForDJGPP
+{
+ my $vNeed=$_[0];
+ my $test;
+
+ print 'Checking DJGPP version: ';
+ $test=@conf{'djgpp'};
+ if ($test)
+ {
+ print "$test (cached) OK\n";
+ return;
+ }
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ printf("%d.0.%d",DJGPP,DJGPP_MINOR);
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ if (!CompareVersion($test,$vNeed))
+ {
+ print "\nWrong DJGPP version, please use $vNeed or newer\n";
+ print "Look in $ErrorLog for potential compile errors of the test\n";
+ CreateCache();
+ die "Wrong version\n";
+ }
+ print "$test OK\n";
+ $conf{'djgpp'}=$test;
+}
+
+###[txh]####################################################################
+#
+# Prototype: FindCFLAGS()
+# Description:
+# Determines the flags to be used for compilation. Mechanism:@*
+# 1) Cached CFLAGS key.@*
+# 2) Environment variable CFLAGS.@*
+# 3) -O2 -gstabs+3 (-pipe if UNIX).@*
+# The result is stored in the 'CFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindCFLAGS
+{
+ my ($ret,$ver);
+
+ print 'C flags: ';
+ $ret=@conf{'CFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached)\n";
+ return $ret;
+ }
+ $ret=@ENV{'CFLAGS'};
+ if (!$ret)
+ {
+ $ret=TVConfigOption('cflags');
+ if ($ret)
+ {
+ $ret=~s/[\r\n]//g;
+ }
+ else
+ {
+ $ret='-O2'; # -gstabs+3
+ # In UNIX pipes are in memory and allows multithreading so they are
+ # usually faster. In Linux that's faster.
+ $ret.=' -pipe' if $UsePipe;
+ # Looks like that's common and some sysadmins doesn't configure gcc to
+ # look there:
+ $conf{'EXTRA_INCLUDE_DIRS'}.=' /usr/local/include' if ($OSf eq 'FreeBSD');
+ # gcc 4.x enables -Wpacked this by default.
+ $ver=RunRedirect("$GCC -dumpversion");
+ $ret.=' -Wno-packed' if $ver>=4;
+ }
+ }
+ print "$ret\n";
+ $conf{'CFLAGS'}=$ret;
+ $ret;
+}
+
+###[txh]####################################################################
+#
+# Prototype: FindLDExtraDirs()
+# Description:
+# Simple hook to get the extra dirs.
+#
+# Return:
+# Space separated list of directories.
+#
+####################################################################[txi]###
+
+sub FindLDExtraDirs()
+{
+ my $ret;
+
+ $ret=@conf{'LDExtraDirs'};
+ if ($ret)
+ {
+ return $ret;
+ }
+ $ret='';
+ $ret.='/usr/local/lib' if ($OSf eq 'FreeBSD');
+ $conf{'LDExtraDirs'}=$ret;
+ $ret;
+}
+
+###[txh]####################################################################
+#
+# Prototype: FindCXXFLAGS()
+# Description:
+# Determines the flags to be used for C++ compilation. Mechanism:@*
+# 1) Cached CXXFLAGS key.@*
+# 2) Environment variable CXXFLAGS.@*
+# 3) Cached CFLAGS key.@*
+# 4) Environment variable CFLAGS.@*
+# 5) -O2 -gstabs+3 (-pipe if UNIX).@*
+# The result is stored in the 'CXXFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindCXXFLAGS
+{
+ my $ret;
+
+ print 'C++ flags: ';
+ $ret=@conf{'CXXFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached)\n";
+ return $ret;
+ }
+ $ret=@ENV{'CXXFLAGS'};
+ if (!$ret)
+ {
+ $ret=TVConfigOption('cppflags');
+ $ret=~s/[\r\n]//g;
+ $ret=@conf{'CFLAGS'} unless $ret;
+ $ret=@ENV{'CFLAGS'} unless $ret;
+ if (!$ret)
+ {
+ $ret='-O2'; # -gstabs+3';
+ $ret.=' -pipe' if $UsePipe;
+ $ret.=' -L/usr/local/include' if ($OSf eq 'FreeBSD');
+ $conf{'EXTRA_INCLUDE_DIRS'}.=' /usr/local/include' if ($OSf eq 'FreeBSD');
+ }
+ }
+ print "$ret\n";
+ $conf{'CXXFLAGS'}=$ret;
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: FindXCFLAGS()
+# Description:
+# Determines the flags to be used for special compilation. Mechanism:@*
+# 1) Cached XCFLAGS key.@*
+# 2) -O3 -fomit-frame-pointer -ffast-math (-pipe if not DOS).@*
+# The result is stored in the 'XCFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindXCFLAGS
+{
+ my $ret;
+
+ print 'Special C flags: ';
+ $ret=@conf{'XCFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached/cmdline)\n";
+ return $ret;
+ }
+ if (!$ret)
+ {
+ $ret='-O3 -fomit-frame-pointer -ffast-math';
+ $ret.=' -pipe' if $UsePipe;
+ }
+ print "$ret\n";
+ $conf{'XCFLAGS'}=$ret;
+ $ret;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: FindXCXXFLAGS()
+# Description:
+# Determines the flags to be used for C++ compilation. Mechanism:@*
+# 1) Cached XCXXFLAGS key.@*
+# 2) -O3 -fomit-frame-pointer -ffast-math (-pipe if not DOS).@*
+# The result is stored in the 'XCXXFLAGS' configuration key.
+#
+# Return: The value determined.
+#
+####################################################################[txi]###
+
+sub FindXCXXFLAGS
+{
+ my $ret;
+
+ print 'Special C++ flags: ';
+ $ret=@conf{'XCXXFLAGS'};
+ if ($ret)
+ {
+ print "$ret (cached/cmdline)\n";
+ return $ret;
+ }
+ if (!$ret)
+ {
+ $ret='-O3 -fomit-frame-pointer -ffast-math';
+ $ret.=' -pipe' if $UsePipe;
+ }
+ print "$ret\n";
+ $conf{'XCXXFLAGS'}=$ret;
+ $ret;
+}
+
+sub Pwd
+{
+ my $pwd;
+ $pwd=`pwd`;
+ $pwd=`sh pwd` unless $pwd;
+ $pwd=~s/[\r\n]//g;
+ return $pwd;
+}
+
+###[txh]####################################################################
+#
+# Prototype: DetectOS()
+# Description:
+# Determines the OS using the uname command. If it returns MS-DOS then dos
+# is assumed, if Linux or linux is returned the linux is assumed. If none
+# of these is returned the program dies. The following global variables are
+# filled according to the OS:@*
+# $OS: DOS, UNIX, Win32.@*
+# $OSf: OS flavor i.e. Linux.@*
+# $Comp: Compiler i.e. GCC.@*
+# $Compf: Compiler flavor i.e. djgpp.@*
+# $stdcxx: C++ library (stdcxx or stdc++).@*
+# $defaultCXX: C++ compiler (gxx or g++).@*
+# $supportDir: Directory to look for OS specific support (djgpp or linux).@*
+#
+# Return: The determined OS.
+#
+####################################################################[txi]###
+
+sub DetectOS
+{
+ my ($os,$OS,$pwd);
+ $pwd=Pwd();
+ $os=`uname`;
+ if (!$os || !$pwd)
+ {
+ print "\n";
+ print "* -------------------------------------------- *\n";
+ print " Please install the `uname' and `pwd' commands.\n";
+ print " DJGPP users: That's part of shell utils.\n";
+ print "* -------------------------------------------- *\n\n";
+ die;
+ }
+ print 'Determining OS: ';
+
+ $OSpr=0;
+ # Currently the configuration is oriented for GNU systems
+ # other systems should have a special configuration header
+ # created by hand.
+ $Comp='GCC';
+ $ExeExt='';
+ if ($os=~/MS\-DOS/)
+ {
+ $OS='DOS';
+ $OSf='';
+ $Compf='djgpp';
+ $stdcxx='-lstdcxx';
+ $defaultCXX='gpp:gxx';
+ $supportDir='djgpp';
+ $ExeExt='.exe';
+ }
+ elsif ($os=~/[Ll]inux/)
+ {
+ $OS='UNIX';
+ $OSf='Linux';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/FreeBSD/)
+ {
+ $OS='UNIX';
+ $OSf='FreeBSD';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/CYGWIN/)
+ {
+ $OS='Win32';
+ $OSf='';
+ $Compf='Cygwin/MinGW';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='win32';
+ $ExeExt='.exe';
+ }
+ elsif ($os=~/MINGW/)
+ {
+ $OS='Win32';
+ $OSf='';
+ $Compf='MinGW';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='win32';
+ $ExeExt='.exe';
+ }
+ elsif ($os=~/SunOS/)
+ {
+ $OS='UNIX';
+ $OSf='Solaris';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/QNX/)
+ {
+ $release=`uname -r`;
+ if ($release =~ /^6/)
+ {
+ $OS='UNIX';
+ $OSf='QNXRtP';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='qcc -Y_gpp';
+ $supportDir='linux';
+ }
+ else
+ {
+ $OS='UNIX';
+ $OSf='QNX4';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ }
+ elsif ($os=~/HP-UX/)
+ {
+ $OS='UNIX';
+ $OSf='HP-UX';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/Darwin/)
+ {
+ $OS='UNIX';
+ $OSf='Darwin';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='c++';
+ $supportDir='linux';
+ $conf{'GCC'}='cc';
+ }
+ elsif ($os=~/NetBSD/)
+ {
+ $OS='UNIX';
+ $OSf='NetBSD';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ elsif ($os=~/OpenBSD/)
+ {
+ $OS='UNIX';
+ $OSf='OpenBSD';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+# Old code, now using code from TV
+# elsif ($os=~/Darwin/)
+# {
+# $OS='UNIX';
+# $OSf='Darwin';
+# $Compf='';
+# $stdcxx='-lstdc++';
+# $defaultCXX='g++';
+# $supportDir='linux';
+# }
+ elsif ($os=~/OSF1/)
+ {
+ $OS='UNIX';
+ $OSf='Tru64';
+ $Compf='';
+ $stdcxx='-lstdc++';
+ $defaultCXX='g++';
+ $supportDir='linux';
+ }
+ else
+ {
+ die('Unknown OS, you must do things by yourself');
+ }
+ # The gcc I found in an HP DS20E machine comes in a package called TWWfsw and
+ # doesn't support -pipe. (Dual EV67 667 MHz machine running OSF1 v5.1).
+ $UsePipe=($OS eq 'UNIX') && ($OSf ne 'Tru64');
+ print "$OS";
+ print " [$OSf]" if $OSf;
+ print " [$Compf]" if $Compf;
+ print "\n";
+ $OS;
+}
+
+sub DetectOS2
+{
+ my $test;
+ # Most MinGW users have Cygwin tools
+ if ($Compf eq 'Cygwin/MinGW')
+ {
+ print 'Detecting compiler env. better: ';
+ if ($conf{'Cygwin/MinGW'})
+ {
+ $Compf=$conf{'Cygwin/MinGW'};
+ print "$Compf (cached)\n";
+ }
+ else
+ {
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ #ifdef __CYGWIN__
+ printf("Cygwin\n");
+ #else
+ printf("MinGW\n");
+ #endif
+ return 0;
+}
+';
+ $Compf=RunGCCTest($GCC,'c',$test,'');
+ $Compf=~s/[\r\n]//g;
+ $conf{'Cygwin/MinGW'}=$Compf;
+ print "$Compf\n";
+ }
+ }
+}
+
+###[txh]####################################################################
+#
+# Prototype: ModifyMakefiles(@list)
+# Description:
+# Patches the listed RHIDE makefiles to use the detected C compiler, C++
+# compiler and compilation flags.@*
+#
+####################################################################[txi]###
+
+sub ModifyMakefiles
+{
+ my ($a,$text,$rep,$repv,$line);
+
+ print 'Configuring makefiles: ';
+ foreach $a (@_)
+ {
+ print "$a ";
+ $text=cat($a);
+ if ($text)
+ {
+ $text=~s/RHIDE_GCC=(.*)\n/RHIDE_GCC=$GCC\n/g;
+ $text=~s/RHIDE_GXX=(.*)\n/RHIDE_GXX=$GXX\n/g;
+ $text=~s/RHIDE_LD=(.*)\n/RHIDE_LD=$GXX\n/g;
+ $text=~s/RHIDE_OS_CFLAGS=(.*)\n/RHIDE_OS_CFLAGS=$CFLAGS\n/g;
+ $text=~s/RHIDE_OS_CXXFLAGS=(.*)\n/RHIDE_OS_CXXFLAGS=$CXXFLAGS\n/g;
+ $text=~s/RHIDE_AR=(.*)\n/RHIDE_AR=$GAR\n/g if ($GAR);
+ foreach $rep (%ExtraModifyMakefiles)
+ {
+ $repv="$rep=@ExtraModifyMakefiles{$rep}\n";
+ $text=~s/$rep=(.*)\n/$repv/;
+ }
+ foreach $line (@MakeDefsRHIDE)
+ {
+ if ($line=~/([\w_]*)(\s*)=(\s*)(.*)/)
+ {
+ $name=$1;
+ $value=$4;
+ #print "$name=$value\n";
+ $rep="^$name"."=((.+\\\\\\n)+(.+))";
+ if ($text=~/$rep/m)
+ { # Ok multiline
+ $text=~s/$rep/$name=$value/mg;
+ }
+ else
+ { # Single line
+ $rep="^$name"."=(.*)";
+ if ($text=~/$rep/m)
+ {
+ $text=~s/$rep/$name=$value/mg;
+ }
+ }
+ }
+ }
+ replace($a,$text);
+ }
+ }
+ print "\n";
+}
+
+###[txh]####################################################################
+#
+# Prototype: ModifySimpleMakefiles(@list)
+# Description:
+# Patches the listed makefiles to use the detected C compiler, C++
+# compiler and compilation flags.@*
+#
+####################################################################[txi]###
+
+sub ModifySimpleMakefiles
+{
+ my ($a,$text,$rep);
+
+ print 'Configuring simple makefiles: ';
+ foreach $a (@_)
+ {
+ print "$a ";
+ $text=cat($a);
+ if ($text)
+ {
+ $text=~s/GCC=(.*)\n/GCC=$GCC\n/;
+ $text=~s/GXX=(.*)\n/GXX=$GXX\n/;
+ $text=~s/LD=(.*)\n/LD=$GXX\n/;
+ $text=~s/CFLAGS=(.*)\n/CFLAGS=$CFLAGS\n/;
+ $text=~s/CXXFLAGS=(.*)\n/CXXFLAGS=$CXXFLAGS\n/;
+ replace($a,$text);
+ }
+ }
+ print "\n";
+}
+
+###[txh]####################################################################
+#
+# Prototype: CreateRHIDEenvs(@list)
+# Description:
+# Generates all the needed rhide.env files to configure RHIDE with the
+# detected C compiler, C++ compiler and compilation flags.@*
+# That's needed to use RHIDE after configuring.
+# Projects that needs faster C/C++ options are indicated with a +.
+#
+####################################################################[txi]###
+
+sub CreateRHIDEenvs
+{
+ my ($a,$text,$rep,$useXtreme,$b,$old);
+
+ print 'Configuring RHIDE: ';
+ foreach $a (@_)
+ {
+ if (substr($a,0,1) eq "+")
+ {
+ $b=substr($a,1);
+ $useXtreme=1;
+ }
+ else
+ {
+ $b=$a;
+ $useXtreme=0;
+ }
+ print "$b ";
+ $text ="#\n# Automatically generated by configure script\n#\n\n";
+ $text.="RHIDE_GCC=$GCC\n";
+ $text.="RHIDE_GXX=$GXX\n";
+ $text.="RHIDE_LD=$GXX\n";
+ $text.="RHIDE_AR=$GAR\n" if ($GAR);
+ if ($useXtreme)
+ {
+ $text.="RHIDE_OS_CFLAGS=@conf{'XCFLAGS'}\n";
+ $text.="RHIDE_OS_CXXFLAGS=@conf{'XCXXFLAGS'}\n";
+ }
+ else
+ {
+ $text.="RHIDE_OS_CFLAGS=$CFLAGS\n";
+ $text.="RHIDE_OS_CXXFLAGS=$CXXFLAGS\n";
+ }
+ foreach $rep (@MakeDefsRHIDE)
+ {
+ $text.="$rep\n";
+ }
+
+ $old=cat($b);
+ if ($text ne $old)
+ {
+ if ($text)
+ {
+ replace($b,$text);
+ }
+ else
+ {
+ unlink $b;
+ }
+ }
+ }
+ print "\n";
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: ConfigIncDef($defVar,$defComment)
+# Description:
+# That's used to generate the config.h file and generates a line with
+# /* $defComment */\n#define $defVar or not according to the existence of
+# the $defVar configure key.
+#
+# Return: The string generated.
+#
+####################################################################[txi]###
+
+sub ConfigIncDef
+{
+ my $text;
+
+ $text ="\n\n/* $_[1] */\n";
+ $text.='/*' unless (@conf{$_[0]});
+ $text.="#define $_[0] 1";
+ $text.='*/' unless (@conf{$_[0]});
+ $text;
+}
+
+###[txh]####################################################################
+#
+# Prototype: ConfigIncDefYes($defVar,$defComment)
+# Description:
+# That's similar to ConfigIncDef, but here the key must be 'yes'.
+#
+# Return: The string generated.
+#
+####################################################################[txi]###
+
+sub ConfigIncDefYes
+{
+ my $text;
+
+ $text ="\n\n/* $_[1] */\n";
+ $text.='/*' unless (@conf{$_[0]} eq 'yes');
+ $text.="#define $_[0] 1";
+ $text.='*/' unless (@conf{$_[0]} eq 'yes');
+ $text;
+}
+
+sub ParentDir
+{
+ my ($cur,$parent);
+ $cur=Pwd();
+ chdir('..');
+ $parent=Pwd();
+ chdir($cur);
+ $parent;
+}
+
+sub ReplaceText
+{
+ my ($Text,$Dest,$i,$se,$re,$ff);
+
+ $Dest=$_[1];
+ print "Processing $_[0] => $_[1]\n";
+ $Text=cat($_[0]);
+ $ff=0;
+ foreach $i (%ReplaceTags)
+ {
+ $ff=!$ff;
+ if ($ff)
+ {
+ $se='@'.$i.'@';
+ $re=$ReplaceTags{$i};
+ $Text =~ s/$se/$re/g;
+ }
+ }
+ replace($Dest,$Text);
+}
+
+###[txh]####################################################################
+#
+# Prototype: ExtractItemsMak($makefile,\$column)
+# Description:
+# Extracts the list of project items from a .mak. Is recursive.
+#
+# Return: The list of items.
+#
+####################################################################[txi]###
+
+sub ExtractItemsMak
+{
+ my ($makefile,$col,$skipLib)=($_[0],\$_[1],$_[2]);
+ my ($mak,@items,$file,$result,$path,$isLib);
+
+ $result='';
+ $makefile=~/((.+)\/+)/;
+ $path=$1;
+ print "Extracting from $makefile: ";
+ $mak=cat($makefile);
+ $isLib= ($mak=~/MAIN_TARGET=(\w+)\.a\n/) && $skipLib;
+ # I know the next can be achieved with /PROJECT_ITEMS=(((.+)\\?\n)+(.+)\n)/
+ # but if I use it perl crashes violating the VMM code of W95, and sometimes
+ # just reseting the computer. DJGPP perl v5.004_02 and v5.005_02.
+ if ($mak=~ /PROJECT_ITEMS=(((.+)\\\r?\n)+(.+)\r?\n)/ ||
+ $mak=~ /PROJECT_ITEMS=((.+)\r?\n)/)
+ {
+ if ($isLib)
+ {
+ print "skipping library\n";
+ }
+ else
+ {
+ print "processing\n";
+ @items=split(/[\\\s]+/,$1);
+ foreach $file (@items)
+ {
+ if ($file=~/\.gpr/)
+ {
+ $file=~s/\.gpr/\.mak/;
+ $result.=ExtractItemsMak($path.$file,$$col,$skipLib);
+ #print "**** Back ($path)\n";
+ }
+ else
+ {
+ #print "$file\n";
+ if ($$col!=0)
+ {
+ if ($$col+length($file)>76)
+ {
+ $result.="\\\n\t";
+ $$col=8;
+ }
+ else
+ {
+ $result.=' ';
+ $$col++;
+ }
+ }
+ $$col+=length($file);
+ $result.="$file";
+ }
+ }
+ }
+ }
+ else
+ {
+ print "nothing found!\n";
+ }
+ $result;
+}
+
+
+###[txh]####################################################################
+#
+# Prototype: ExtractItemsImk($makefile,\$column)
+# Description:
+# Extracts the list of project items from a .imk.
+#
+# Return: The list of items.
+#
+####################################################################[txi]###
+
+sub ExtractItemsImk
+{
+ my ($makefile,$col)=($_[0],\$_[1]);
+ my ($mak,@items,$file,$result,$path);
+
+ $result='';
+ $makefile=~/((.+)\/+)/;
+ $path=$1;
+ print "Extracting from $makefile: ";
+ $mak=cat($makefile);
+ if ($mak=~ /(.*)::(((.+)\\\n)+(.+)\n)/ ||
+ $mak=~ /(.*):: ((.+)\n)/)
+ {
+ print "processing\n";
+ @items=split(/[\\\s]+/,$2);
+ foreach $file (@items)
+ {
+ if ($file=~/\$\(ExOBJ\)/)
+ {
+ $file=~/((.+)\/+)(.*)/;
+ $file=$3;
+ $file=~s/\$\(ExOBJ\)/\.o/;
+ #print "$file\n";
+ if ($$col!=0)
+ {
+ if ($$col+length($file)>76)
+ {
+ $result.="\\\n\t";
+ $$col=8;
+ }
+ else
+ {
+ $result.=' ';
+ $$col++;
+ }
+ }
+ $$col+=length($file);
+ $result.="$file";
+ }
+ }
+ }
+ else
+ {
+ print "nothing found!\n";
+ }
+ $result;
+}
+
+
+sub ToBCCObjs
+{
+ my $a=\$_[0];
+
+ $$a=~s/(\w+)\.(\w+)/\+$1\.obj/g;
+ $$a=~s/\t//g;
+}
+
+sub DetectCPU
+{
+ my $test;
+
+ print 'Checking Architecture: ';
+
+ if ($conf{'TV_CPU'})
+ {
+ print "$conf{'TV_CPU'} (cached)\n";
+ $CPU=$conf{'TV_CPU'};
+ return;
+ }
+ $test='
+#include <stdio.h>
+int main(void)
+{
+ #ifdef __i386__
+ printf("x86\n");
+ #elif defined(__alpha__) || defined(__alpha)
+ printf("Alpha\n");
+ #elif defined(__sparc_v9__) || defined(__sparcv9)
+ printf("SPARC64\n");
+ #elif defined(__sparc__) || defined(sparc)
+ printf("SPARC\n");
+ #elif defined(__PPC__) || defined(PPC) || defined(__ppc__)
+ printf("PPC\n");
+ #elif defined(__hppa__)
+ printf("HPPA\n");
+ #elif defined(__mips__)
+ printf("MIPS\n");
+ #elif defined(__ia64__)
+ printf("Itanium\n");
+ #elif defined(__amd64__)
+ printf("AMD64\n");
+ #else
+ printf("Unknown\n");
+ #endif
+ return 0;
+}
+';
+ $test=RunGCCTest($GCC,'c',$test,'');
+ $test=~s/\W//g;
+ $CPU=$conf{'TV_CPU'}=$test;
+ print "$test\n";
+}
+
+sub LookForGNUMake
+{
+ my $test;
+ print 'Looking for GNU make: ';
+
+ if ($conf{'GNU_Make'})
+ {
+ print "$conf{'GNU_Make'} (cached)\n";
+ return;
+ }
+ `echo make: >> $ErrorLog`;
+ $test=RunRedirect('make --version');
+ if ($test=~/GNU Make/)
+ {
+ $conf{'GNU_Make'}='make';
+ print "make\n";
+ return;
+ }
+ $test=RunRedirect('gmake --version');
+ if ($test=~/GNU Make/)
+ {
+ $conf{'GNU_Make'}='gmake';
+ print "gmake\n";
+ return;
+ }
+ print "Unable to find GNU Make on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `make' or `gmake' name for the binary.\n";
+ die;
+}
+
+sub LookForGNUar
+{
+ my $test;
+ print 'Looking for GNU ar: ';
+
+ if ($conf{'GNU_AR'})
+ {
+ print "$conf{'GNU_AR'} (cached)\n";
+ return $conf{'GNU_AR'};
+ }
+ $conf{'UseRanLib'}=0;
+ $test=RunRedirect('ar --version',$ErrorLog);
+ if ($test=~/GNU ar/)
+ {
+ $conf{'GNU_AR'}='ar';
+ print "ar\n";
+ return 'ar';
+ }
+ $test=RunRedirect('gar --version',$ErrorLog);
+ if ($test=~/GNU ar/)
+ {
+ $conf{'GNU_AR'}='gar';
+ print "gar\n";
+ return 'gar';
+ }
+ if (!LookForFileInPath('ar'))
+ {
+ print "Unable to find GNU ar on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `ar' or `gar' name for the binary.\n";
+ die;
+ }
+ if (($OSf eq 'Darwin') || ($OSf eq 'HP-UX') || ($OSf eq 'Tru64') ||
+ ($OSf eq 'Solaris'))
+ {
+ $conf{'GNU_AR'}='ar';
+ $conf{'UseRanLib'}=1;
+ print "ar (not GNU but usable!)\n";
+ return 'ar';
+ }
+ if ($OSf eq 'QNX4')
+ {
+ $conf{'GNU_AR'}='ar';
+ $conf{'UseRanLib'}=1;
+ print "ar (WATCOM)\n";
+ return 'ar';
+ }
+ print "Unable to find GNU ar on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `ar' or `gar' name for the binary.\n";
+ die;
+}
+
+
+sub TVConfigOption
+{
+ return `$tvConfig --$_[0]`;
+}
+
+
+sub LookForGNUinstall
+{
+ my ($test,$test2,$res);
+
+ print 'Looking for install tool: ';
+
+ if ($conf{'GNU_INSTALL'})
+ {
+ print "$conf{'GNU_INSTALL'} (cached)\n";
+ return $conf{'GNU_INSTALL'};
+ }
+ $conf{'SOLARIS_INSTALL'}=0;
+ $test=RunRedirect('install --version',$ErrorLog);
+ if ($test=~/Free Software Foundation/)
+ {
+ $conf{'GNU_INSTALL'}='install';
+ print "install\n";
+ return 'install';
+ }
+ $test2=RunRedirect('ginstall --version',$ErrorLog);
+ if ($test2=~/Free Software Foundation/)
+ {
+ $conf{'GNU_INSTALL'}='ginstall';
+ print "ginstall\n";
+ return 'ginstall';
+ }
+ if (!LookForFileInPath('install'.$ExeExt))
+ {
+ print "Unable to find 'install' on this system.\n";
+ print "Please install it and be sure it's in your path.\n";
+ print "Also use `install' or `ginstall' name for the binary.\n";
+ die;
+ }
+ $res='install';
+ # Solaris install is bizarre.
+ if ($OSf eq 'Solaris')
+ {
+ $conf{'SOLARIS_INSTALL'}=1;
+ }
+ # NetBSD install moves by default!!
+ elsif ($OSf eq 'NetBSD')
+ {
+ $res='install -c';
+ }
+ $conf{'GNU_INSTALL'}=$res;
+ print "$res\n";
+ return $res;
+}
+
+sub GenInstallDir()
+{
+ my ($mode,$dir)=@_;
+
+ return "\$(INSTALL) -d -m $mode $dir\n";
+}
+
+sub GenInstallFiles()
+{
+ my ($mode,$files,$dir)=@_;
+ my (@f,$fl,$ret,$first);
+
+ if ($conf{'SOLARIS_INSTALL'})
+ {# Silly, crappy one ;-)
+ @f=glob($files);
+ return "\$(INSTALL) -m $mode -f $dir $files\n" if scalar(@f)==1;
+ $ret='';
+ $first=1;
+ foreach $fl (@f)
+ {
+ if ($first)
+ {
+ $first=0;
+ }
+ else
+ {
+ $ret.="\t";
+ }
+ $ret.="\$(INSTALL) -m $mode -f $dir $fl\n";
+ }
+ return $ret;
+ }
+ return "\$(INSTALL) -m $mode $files $dir\n";
+}
+
+1;
diff --git a/setedit/copying.dj b/setedit/copying.dj
new file mode 100644
index 0000000..370a0bb
--- /dev/null
+++ b/setedit/copying.dj
@@ -0,0 +1,41 @@
+This is the file "copying.dj". It does not apply to any sources or
+binaries copyrighted by UCB Berkeley or the Free Software Foundation.
+
+ Copyright Information for sources and executables that are marked
+ Copyright (C) DJ Delorie
+ 24 Kirsten Ave
+ Rochester NH 03867-2954
+
+This document is Copyright (C) DJ Delorie and may be distributed
+verbatim, but changing it is not allowed.
+
+Source code copyright DJ Delorie is distributed under the terms of the
+GNU General Public Licence, with the following exceptions:
+
+* Any existing copyright or authorship information in any given source
+file must remain intact. If you modify a source file, a notice to that
+effect must be added to the authorship information in the source file.
+
+* binaries provided in djgpp may be distributed without sources ONLY if
+the recipient is given sufficient information to obtain a copy of djgpp
+themselves. This primarily applies to go32.exe, emu387, stub.exe, and
+the graphics drivers.
+
+* modified versions of the binaries provided in djgpp must be
+distributed under the terms of the GPL.
+
+* objects and libraries linked into an application may be distributed
+without sources.
+
+-----
+
+Changes to source code copyright BSD or FSF by DJ Delorie fall under
+the terms of the original copyright.
+
+A copy of the file "COPYING" is included with this document. If you did not
+receive a copy of "COPYING", you may obtain one from whence this document
+was obtained, or by writing:
+ Free Software Foundation
+ 675 Mass Ave
+ Cambridge, MA 02139
+ USA
diff --git a/setedit/copying.gpl b/setedit/copying.gpl
new file mode 100644
index 0000000..a43ea21
--- /dev/null
+++ b/setedit/copying.gpl
@@ -0,0 +1,339 @@
+ 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
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/setedit/copying.lgp b/setedit/copying.lgp
new file mode 100644
index 0000000..3b7b5cc
--- /dev/null
+++ b/setedit/copying.lgp
@@ -0,0 +1,501 @@
+GNU LIBRARY GENERAL PUBLIC LICENSE
+**********************************
+
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ [This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+Preamble
+========
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, 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 library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, 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 companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License, which was designed for utility
+programs. This license, the GNU Library General Public License,
+applies to certain designated libraries. This license is quite
+different from the ordinary one; be sure to read it in full, and don't
+assume that anything in it is the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is
+that they blur the distinction we usually make between modifying or
+adding to a program and simply using it. Linking a program with a
+library, without changing the library, is in some sense simply using
+the library, and is analogous to running a utility program or
+application program. However, in a textual and legal sense, the linked
+executable is a combined work, a derivative of the original library,
+and the ordinary General Public License treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended
+to permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to
+achieve this as regards changes in header files, but we have achieved
+it as regards changes in the actual functions of the Library.) The
+hope is that this will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+ contains a notice placed by the copyright holder or other
+ authorized party saying it may be distributed under the terms of
+ this Library General Public License (also called "this License").
+ Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+ prepared so as to be conveniently linked with application programs
+ (which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+ which has been distributed under these terms. A "work based on the
+ Library" means either the Library or any derivative work under
+ copyright law: that is to say, a work containing the Library or a
+ portion of it, either verbatim or with modifications and/or
+ translated straightforwardly into another language. (Hereinafter,
+ translation is included without limitation in the term
+ "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+ making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are
+ not covered by this License; they are outside its scope. The act
+ of running a program using the Library is not restricted, and
+ output from such a program is covered only if its contents
+ constitute a work based on the Library (independent of the use of
+ the Library in a tool for writing it). Whether that is true
+ depends on what the Library does and what the program that uses
+ the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+ complete 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 distribute a copy of this License
+ along with the Library.
+
+ 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 Library or any portion
+ of it, thus forming a work based on the Library, 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. The modified work must itself be a software library.
+
+ b. You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c. You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d. If a facility in the modified Library refers to a function or
+ a table of data to be supplied by an application program that
+ uses the facility, other than as an argument passed when the
+ facility is invoked, then you must make a good faith effort
+ to ensure that, in the event an application does not supply
+ such function or table, the facility still operates, and
+ performs whatever part of its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots
+ has a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function
+ must be optional: if the application does not supply it, the
+ square root function must still compute square roots.)
+
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the
+ Library, 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 Library, 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 Library.
+
+ In addition, mere aggregation of another work not based on the
+ Library with the Library (or with a work based on the Library) on
+ a volume of a storage or distribution medium does not bring the
+ other work under the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+ License instead of this License to a given copy of the Library.
+ To do this, you must alter all the notices that refer to this
+ License, so that they refer to the ordinary GNU General Public
+ License, version 2, instead of to this License. (If a newer
+ version than version 2 of the ordinary GNU General Public License
+ has appeared, then you can specify that version instead if you
+ wish.) Do not make any other change in these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+ that copy, so the ordinary GNU General Public License applies to
+ all subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+ the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+ derivative of it, under Section 2) in object code or executable
+ form under the terms of Sections 1 and 2 above provided that you
+ 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.
+
+ If distribution of 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 satisfies the requirement to
+ distribute the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+ Library, but is designed to work with the Library by being
+ compiled or linked with it, is called a "work that uses the
+ Library". Such a work, in isolation, is not a derivative work of
+ the Library, and therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+ creates an executable that is a derivative of the Library (because
+ it contains portions of the Library), rather than a "work that
+ uses the library". The executable is therefore covered by this
+ License. Section 6 states terms for distribution of such
+ executables.
+
+ When a "work that uses the Library" uses material from a header
+ file that is part of the Library, the object code for the work may
+ be a derivative work of the Library even though the source code is
+ not. Whether this is true is especially significant if the work
+ can be linked without the Library, or if the work is itself a
+ library. The threshold for this to be true is not precisely
+ defined by law.
+
+ If such an object file uses only numerical parameters, data
+ structure layouts and accessors, and small macros and small inline
+ functions (ten lines or less in length), then the use of the object
+ file is unrestricted, regardless of whether it is legally a
+ derivative work. (Executables containing this object code plus
+ portions of the Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+ distribute the object code for the work under the terms of Section
+ 6. Any executables containing that work also fall under Section 6,
+ whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+ link a "work that uses the Library" with the Library to produce a
+ work containing portions of the Library, and distribute that work
+ under terms of your choice, provided that the terms permit
+ modification of the work for the customer's own use and reverse
+ engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+ Library is used in it and that the Library and its use are covered
+ by this License. You must supply a copy of this License. If the
+ work during execution displays copyright notices, you must include
+ the copyright notice for the Library among them, as well as a
+ reference directing the user to the copy of this License. Also,
+ you must do one of these things:
+
+ a. Accompany the work with the complete corresponding
+ machine-readable source code for the Library including
+ whatever changes were used in the work (which must be
+ distributed under Sections 1 and 2 above); and, if the work
+ is an executable linked with the Library, with the complete
+ machine-readable "work that uses the Library", as object code
+ and/or source code, so that the user can modify the Library
+ and then relink to produce a modified executable containing
+ the modified Library. (It is understood that the user who
+ changes the contents of definitions files in the Library will
+ not necessarily be able to recompile the application to use
+ the modified definitions.)
+
+ b. Accompany the work with a written offer, valid for at least
+ three years, to give the same user the materials specified in
+ Subsection 6a, above, for a charge no more than the cost of
+ performing this distribution.
+
+ c. If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the
+ above specified materials from the same place.
+
+ d. Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+ Library" must include any data and utility programs needed for
+ reproducing the executable from it. 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.
+
+ It may happen that this requirement contradicts the license
+ restrictions of other proprietary libraries that do not normally
+ accompany the operating system. Such a contradiction means you
+ cannot use both them and the Library together in an executable
+ that you distribute.
+
+ 7. You may place library facilities that are a work based on the
+ Library side-by-side in a single library together with other
+ library facilities not covered by this License, and distribute
+ such a combined library, provided that the separate distribution
+ of the work based on the Library and of the other library
+ facilities is otherwise permitted, and provided that you do these
+ two things:
+
+ a. Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b. Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same
+ work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute the
+ Library except as expressly provided under this License. Any
+ attempt otherwise to copy, modify, sublicense, link with, or
+ distribute the Library 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.
+
+ 9. 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 Library or its derivative works. These actions
+ are prohibited by law if you do not accept this License.
+ Therefore, by modifying or distributing the Library (or any work
+ based on the Library), you indicate your acceptance of this
+ License to do so, and all its terms and conditions for copying,
+ distributing or modifying the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+ Library), the recipient automatically receives a license from the
+ original licensor to copy, distribute, link with or modify the
+ Library 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.
+
+ 11. 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
+ Library at all. For example, if a patent license would not permit
+ royalty-free redistribution of the Library 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 Library.
+
+ 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.
+
+ 12. If the distribution and/or use of the Library is restricted in
+ certain countries either by patents or by copyrighted interfaces,
+ the original copyright holder who places the Library 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.
+
+ 13. The Free Software Foundation may publish revised and/or new
+ versions of the Library 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
+ Library 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 Library
+ does not specify a license version number, you may choose any
+ version ever published by the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+ programs whose distribution conditions are incompatible with these,
+ 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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+ WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
+ LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE
+ LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
+ SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY
+ OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Libraries
+==============================================
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of
+the ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should have
+at least the "copyright" line and a pointer to where the full notice is
+found.
+
+ ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES.
+ Copyright (C) YEAR NAME OF AUTHOR
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
+ MA 02139, USA.
+
+ Also add information on how to contact you by electronic and paper
+mail.
+
+ You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in
+ the library `Frob' (a library for tweaking knobs) written
+ by James Random Hacker.
+
+ SIGNATURE OF TY COON, 1 April 1990
+ Ty Coon, President of Vice
+
+ That's all there is to it!
diff --git a/setedit/copying.rh b/setedit/copying.rh
new file mode 100644
index 0000000..54d0d07
--- /dev/null
+++ b/setedit/copying.rh
@@ -0,0 +1,46 @@
+RHIDE is copyright (C) 1996-1999 by Robert Hhne. It is distributed under
+the terms of the GPL which is written in the file COPYING.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+Additional permission:
+
+ As a special additional permission, the library librhuti which is
+ in the source tree of the RHIDE sources in the librhuti/
+ subdirectory can be distributed alone freely without any
+ restrictions. It is not limited to use under the terms of the GPL
+ or LGPL. For more information see the file COPYING.RHU in that
+ subdirectory.
+
+
+Non-binding request
+===================
+
+If you distribute RHIDE together with other products it would be nice,
+if you could give me a note about it so I'll be informed. Of course
+you can send me a copy of the distribution medium but this is not
+required.
+
+
+For contacting the author send electronic mail to
+
+robert.hoehne@gmx.net
+
+or paper mail to
+
+Robert Hoehne
+Am Berg 3
+D - 09573 Dittmannsdorf
+Germany
diff --git a/setedit/copyrigh b/setedit/copyrigh
new file mode 100644
index 0000000..f95aba2
--- /dev/null
+++ b/setedit/copyrigh
@@ -0,0 +1,476 @@
+This program is copyrighted by Salvador Eduardo Tropea.
+Copyright (c) 1996,1997,1998,1999,2000,2001,2002,2003
+For contact information see at the bottom of the file.
+
+ SET's editor is a very complex program. It currently have more than 1.45Mb
+of source code and uses various libraries. It makes the copyright and terms
+of distribution very complex.
+ Here is a description of the copyrights of each part:
+ [Each of these parts are independent so have independent copyrights]
+ [For a summary read the end of the file]
+
+----------- Editor classes --------------------------------------------------
+ The editor itself can be distributed under the terms of the GNU GPL
+license:
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ For more details please read the copying.gpl file.
+ If you want to use these sources for an application that can't be
+distributed under these terms contact me.
+ It covers the InfView classes too and other files not covered by the next
+sections.
+
+----------- LibRHUtil -------------------------------------------------------
+ This library is copyrighted by Robert Hhne.
+ Copyright (C) 1996,1997
+
+ Is freely distributable.
+ For more information read copying.rh.
+ It covers all the files in the librhuti directory.
+ Note: I introduced various modifications to this code.
+
+----------- SETTVUtil -------------------------------------------------------
+ This library is copyrighted by Salvador Eduardo Tropea.
+ Copyright (C) 1997-2003
+
+ This library is distributed under the terms of the GNU LGPL license.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
+ MA 02139, USA.
+
+ It covers all the files in the settvuti directory.
+ For other uses contact me.
+
+----------- EasyDiag -------------------------------------------------------
+ This library is copyrighted by Salvador Eduardo Tropea.
+ Copyright (C) 1998-2003
+
+ This library is distributed under the same terms as SETTVUtil.
+
+---------- Calculator ------------------------------------------------------
+ Author: Laszlo Molnar
+ Copying: parser.c is free software, you can use it anywhere you want.
+ Warranty: as usual: none
+
+---------- Files in extra directory ----------------------------------------
+ Some files in the extra directory are copyrigthed by DJ Delorie.
+ Read copying.dj for more information. Basically these files are under the
+GNU GPL license, DJ puts some extra conditions that I think are already
+covered by the GPL license.
+
+---------- PCRE ------------------------------------------------------------
+ Copyright (c) 1997-1999 University of Cambridge
+
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+---------- ZLib -------------------------------------------------------------
+ (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+---------- LibBZIP2 ---------------------------------------------------------
+I included the sources to avoid problems, they aren't so big.
+
+This program, "bzip2" and associated library "libbzip2", are
+copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, Cambridge, UK.
+jseward@acm.org
+bzip2/libbzip2 version 1.0 of 21 March 2000
+
+---------- libmpegsound -----------------------------------------------------
+It provides the default MP3 engine. I took it from the splay Debian package
+and it says:
+
+This package was debianized by Zed Pobre <zed@debian.org> on
+Sat, 11 Apr 1998 10:28:15 -0500.
+
+It was downloaded from
+http://adam.kaist.ac.kr/~jwj95/splay-0.8.2.tar.gz
+
+Copyright:
+
+Copyright for splay and xsplay: GNU GPL 2.
+Copyright for bbitstream and sound libraries: GNU LGPL 2.
+
+---------- LibAMP -----------------------------------------------------------
+The original library:
+
+ (C) Tomislav Uzelac 1996,1997
+
+This software can be used freely for any purpose. It can be distributed
+freely, as long as it is not sold commercially without permission from
+Tomislav Uzelac <tuzelac@rasip.fer.hr>. However, including this software
+on CD_ROMs containing other free software is explicitly permitted even
+when a modest distribution fee is charged for the CD, as long as this
+software is not a primary selling argument for the CD.
+
+Building derived versions of this software is permitted, as long as they
+are not sold commercially without permission from Tomislav Uzelac
+<tuzelac@rasip.fer.hr>. Any derived versions must be clearly marked as
+such, and must be called by a name other than amp. Any derived versions
+must retain this copyright notice.
+
+/* This license is itself copied from Tatu Ylonen's ssh package. It does
+ * not mention being copyrighted itself :)
+ */
+
+THERE IS NO WARRANTY FOR THIS PROGRAM - whatsoever. You use it entirely
+at your risk, and neither Tomislav Uzelac, nor FER will be liable for
+any damages that might occur to your computer, software, etc. in
+consequence of you using this freeware program.
+
+LibAMP itself:
+LibAmp 0.2
+Ported to DJGPP/Allegro and turned into library form by Ove Kaaven
+ <ovek@arcticnet.no>
+Note: This library is not the default MP3 engine.
+
+---------- CWSDPMI ----------------------------------------------------------
+CWSDPMI is Copyright (C) 1995-1997 Charles W Sandmann (sandmann@clio.rice.edu)
+ 1206 Braelinn, Sugar Land, TX 77479
+
+This is release 4. The files in this binary distribution may be redistributed
+under the GPL (with source) or without the source code provided:
+
+* CWSDPMI.EXE or CWSDPR0.EXE are not modified in any way except via CWSPARAM
+
+* Notice to users that they have the right to receive the source code and/or
+ binary updates for CWSDPMI. Distributors should indicate a site for the
+ source in their documentation.
+
+Note: I'm including cwsdpmi.exe and cwsdpmi.doc in the installer version.
+---------- PMODEDJ ----------------------------------------------------------
+PMODE 3.07 is Copyright (c) 1994, by Tran (a.k.a. Thomas Pytel).
+PMODE/DJ modifications are Copyright (c) 1996, by Matthias Grimrath.
+PMSTUB.ASM is Copyright (c) 1995, by DJ Delorie, distributed with permission.
+
+License Information
+-------------------
+
+PMODE/DJ is free software. It may be used or distributed in any manner you
+wish, as long as you do not try to sell an extender based on PMODE. You
+may use this software in for profit productions. If you use this software
+in any package, you MUST give credit to Thomas Pytel and Matthias Grimrath.
+
+PMODE/DJ comes with ABSOLUTELY NO WARRANTY; excluding any and all implied
+warranties, including warranties of merchantability and fitness for a
+particular purpose. There is no warranty or representation, either express
+or implied, with respect to this code, its quality, performance,
+merchantability, or fitness for a particular purpose. The entire risk
+of using this program is with you. There will be no liability for special,
+incidental, or consequential damages arising out of or resulting from the use
+or modification of this code.
+
+Note: I use the pmodedj stub for the installer.
+-----------------------------------------------------------------------------
+Not included in this package but needed to create the editor:
+-----------------------------------------------------------------------------
+
+---------- TurboVision v2.0 -------------------------------------------------
+
+ Copyright (c) 1994 by Borland International
+ All Rights Reserved.
+ It was then released in the Borland's web site. According to Borland's FAQ
+this is Public Domain.
+
+ This library is freely available from (original):
+ ftp://ftp.borland.com/pub/borlandcpp/devsupport/archive/turbovision/tv.zip
+
+ The port was done by Robert Hhne and currently I'm the maintainer, you
+can get the port (under the GPL license)
+ http://tvision.sourceforge.net/
+
+
+---------- GetText ----------------------------------------------------------
+
+ When you compile the patched TurboVision with international support (you
+can avoid it) you must link with this library covered by the LGPL license.
+
+
+---------- Allegro ----------------------------------------------------------
+
+ Copyright (c) by Shawn Hargreaves, 1994-2001
+
+ Allegro is gift-ware. It was created by a number of people working in
+ cooperation, and is given to you freely as a gift. You may use, modify,
+ redistribute, and generally hack it about in any way you like, and you do
+ not have to give us anything in return. However, if you like this product
+ you are encouraged to thank us by making a return gift to the Allegro
+ community. This could be by writing an add-on package, providing a useful
+ bug report, making an improvement to the library, or perhaps just
+ releasing the sources of your program so that other people can learn from
+ them. If you redistribute parts of this code or make a game using it, it
+ would be nice if you mentioned Allegro somewhere in the credits, but you
+ are not required to do this. We trust you not to abuse our generosity.
+
+Note: Shawn knows I did my part ;-), from the authors file of Allegro:
+ Salvador Eduardo Tropea (salvador@inti.edu.ar).
+ Improved the keyboard routines (better handling of extended scancodes,
+ keyboard LED support, capslock and numlock, and alt+numpad input),
+ contributed the 320x100 VGA graphics mode, added support for proper 16
+ bit sample mixing, and made numerous other useful suggestions,
+ contributions and bugfixes.
+
+---------- LibIOStream and LibStdCxx ----------------------------------------
+
+Licensing terms for `libio'
+===========================
+
+ Since the `iostream' classes are so fundamental to standard C++, the
+Free Software Foundation has agreed to a special exception to its
+standard license, when you link programs with `libio.a':
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU
+ General Public License. This exception does not however
+ invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License.
+
+ The code is under the GNU General Public License (version 2) for all
+other purposes than linking with this library; that means that you can
+modify and redistribute the code as usual, but remember that if you do,
+your modifications, and anything you link with the modified code, must
+be available to others on the same terms.
+
+ These functions are also available as part of the `libg++' library;
+if you link with that library instead of `libio', the GNU Library
+General Public License applies.
+
+
+---------- ncurses ---------------------------------------------------------
+library and terminfo utilities. ncurses/terminfo was written by Pavel
+Curtis and Zeyd M. Ben-Halim <zmbenhal@netcom.com>. Ncurses is
+copyright (C) 1992, 1993, 1994, 1995 by Zeyd M. Ben-Halim.
+
+Pavel Curtis released his original copyright on this software to the
+public domain, but Zeyd M. Ben-Halim has retained the copyright on his
+version of this software.
+
+ Permission is hereby granted to reproduce and distribute ncurses
+ by any means and for any fee, whether alone or as part of a
+ larger distribution, in source or in binary form, PROVIDED
+ this notice is included with any such distribution, not removed
+ from header files, and is reproduced in any documentation
+ accompanying it or the applications linked with it.
+
+ ncurses comes AS IS with no warranty, implied or expressed.
+
+Note: Only used for Linux version.
+---------- gpm ---------------------------------------------------------
+gpm - General Purpose Mouse Interface is copyrighted:
+
+Copyright 1993 ajh@gec-mrc.co.uk (Andrew Haylett)
+Copyright 1994-1997 alessandro.rubini@linux.it (Alessandro Rubini)
+ rubini@pop.systemy.it (faster e-mail)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 dated June, 1991.
+
+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.
+
+Note: Only used for Linux version.
+---------- libwin ----------------------------------------------------------
+libwin Copyright 1997-1999 by Richard Dawe
+Portions Copyright (C) 1997-1998 by the RegDos Group
+
+License Details
+===============
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ The registry access code is from The RegDos Group's Regdos library.
+Alfons Hoogervorst <alfons@hoogervorst.demon.nl> is the maintainer of
+this. I think RegDos can be obtained from http://www.hoogervorst.demon.nl.
+
+Note: Also used in the installer.
+---------- Terminus Font ----------------------------------------------------
+The terminus font is Copyright (C) 2002 Dimitar Zhekov
+
+The font is distributed using a GPL program. I took the shapes from the
+Debian package generated using the X (pcf) fonts.
+I also changed some shapes of this font.
+---------- X Font -----------------------------------------------------------
+The XFont.sft file was created using the XFree86 misc fonts.
+
+They say: Public domain font. Share and enjoy.
+So the SFT files for X Fonts are also Public Domain.
+---------- Rest of the fonts ------------------------------------------------
+The rest of the fonts come from raw files floating around the net without
+any copyright in them.
+As they are shapes I don't think anybody can really claim rights over them.
+I found references in internet that follows the following rationale: The
+shapes itself can be freely used, otherwise the owner could ask for royalties
+over the printed/displayed output produced by the shapes. Just imagine
+somebody trying to ask news papers to pay for each character printed or
+similar silly things. That's why what companies protect are names or specific
+formats, but not the shapes itself.
+I don't know how accurate is this, for this reason I put clear the origin of
+each font.
+-----------------------------------------------------------------------------
+
+*****************************************************************************
+*****************************************************************************
+ Summary
+*****************************************************************************
+*****************************************************************************
+
+ As you can see the stuff is very complex. As I'm using LGPL libraries
+(gettext and some of my own libraries) the resulting editor is covered by
+the GNU GPL license.
+ But it doesn't go in the reverse, I mean: it doesn't force me to distribute
+copyrighted libraries like Turbo Vision.
+ Additionally even when I release my work I reserve my rights to use it in a
+commercial project and don't distribute this particular version. It doesn't
+imposse any special restriction to the currently available version that is
+covered by the GPL license.
+ Here is a summary of what the GPL implies:
+
+* You can use the source.
+* You can modify the source.
+* You can distribute the source.
+* You can make a commercial program and charge for it.
+* You must make the derivative work available for all the people, you can
+only charge the costs to distribute it.
+* You can not delete the original copyright.
+* If you modify a source you must put it clear.
+
+ Read the license carefully, the above is just an inaccurate summary.
+ Note that even when you can use the code for a commercial application you
+must make the sources available so the things becomes a little bit complex
+for you.
+
+ Even when isn't strictly needed I ask the following:
+
+* If you include it in a CD ROM please let me know. If you are a big company
+you could send me a copy.
+* If you use it for any purpose let me know so I'll be able to include this
+information in my curriculum.
+* If you really like the editor and/or the SET's Documentation Generator
+included on it you can send me anything as feedback.
+ If you want to send money I'll be happy, but if you don't have it and
+want to show your gratitude you can send me a postal card from your city
+or some of the things I collect (train tickets, cigarette envelopes and
+boxes, stamps, old money and coins).
+
+-----------------------------------------------------------------------------
+
+Contact information:
+
+ E-Mail: salvador@inti.gov.ar or set@ieee.org or set@computer.org
+
+ Telephone: (+5411) 4759-0013
+
+ Postal Address:
+ Salvador E. Tropea
+ Curapalige 2124
+ (1678) Caseros - 3 de Febrero
+ Prov: Buenos Aires
+ Argentina
+
+ Web:
+ http://setedit.sourceforge.net/
+ http://www.geocities.com/SiliconValley/Vista/6552/setedit.html
+
diff --git a/setedit/debian/README b/setedit/debian/README
new file mode 100644
index 0000000..7bf8f57
--- /dev/null
+++ b/setedit/debian/README
@@ -0,0 +1,36 @@
+ This directory contains scripts and helpers used to create DEB packages.
+ The name "debian" is because Debian created the DEB format. That's the
+same reason why the directory to create the .rpm files is called "redhat"
+even when a lot of distros based on RPMs are available.
+
+ These scripts are maintained by Ivan Baldo <ibaldo@adinet.com.uy> so you
+should ask Debian specific details to Ivan with Cc to me.
+
+ Using the .deb files instead of just using "make install" you'll get a much
+better integration of the editor with your system.
+
+ In order to create the .deb files you need to install:
+
+A) Some packages used to create .deb files. I don't have a complete list at
+the moment but in my system I have: debianutils, debhelper, debconf-utils,
+dpkg-dev and devscripts.
+
+B) Some development packages. They are listed in the "Build-Depends" section
+of the debian/control file. If any of them is missing the Debian scripts will
+inform it.
+
+C) The fakeroot package if you want to create the .deb files running as a
+regular user (recommended).
+
+ To create the .deb files just run:
+
+$ debian/buildpackage
+
+ Note: you must create and install Turbo Vision packages first.
+ The resulting DEB files should be located in ../ (../setedit*.deb and
+../infview*.deb).
+ To remove the temporal files created by Debian scripts run:
+
+$ debian/rules clean-debian
+
+$Id: README,v 1.2 2003/06/17 14:36:38 set Exp $
diff --git a/setedit/debian/README.debian b/setedit/debian/README.debian
new file mode 100644
index 0000000..22ed708
--- /dev/null
+++ b/setedit/debian/README.debian
@@ -0,0 +1,83 @@
+SET's Editor for DEBIAN
+-----------------------
+ To run the editor just execute the binary "setedit".
+ When first run, it will present you with the readme file and some tips.
+Thats a good time to start to configure it.
+ When you upgrade to a new version, the configuration is automatically
+converted to the new configuration format. The bad thing about that is that
+you will loose the configuration of the editor if you install an older
+version... but I think this is not a problem.
+ More documentation is in info format, called setedit.info. You can view
+this documentation from inside the editor (just press F1), using the
+standalone GNU info viewer (executing "info setedit") or using the standalone
+SET's InfoViewer if you instaled it executing "infview setedit".
+ Email me if you have suggestions/comments or bugs against the
+debianization of this package. If the bug is in the original package (and not
+related to Debian) please email the upstream author (for email look in the
+copyright file located in this same directory), anyway you can email me and
+I will forward the bug to the upstream maintainer (if you have problems
+contacting the upstream author, contact me and I will contact him).
+ Remember: THIS IS AN UNOFFICIAL DEBIAN PACKAGE AND IS NOT PART OF THE
+DEBIAN DISTRIBUTION. Please, do NOT send bug reports to the DEBIAN BUG
+TRACKING SYSTEM!!!
+
+
+APT repository
+--------------
+ There is an APT repository on http://setedit.sourceforge.net/debian/,
+ofcourse you can manually download packages for installing with dpkg if you
+are not using APT.
+ If using APT, add the following line to your /etc/apt/sources.list:
+ deb http://setedit.sourceforge.net/debian woody main
+ You can substitute woody with the name of your distribution, for example
+potato, sarge or sid. The use of aliases like stable, testing or unstable is
+discouraged.
+
+
+Debian specific FAQ
+-------------------
+Q.: Why is the editor and the info viewer suid root?
+A.: Because by default in Debian the /dev/vcsa or /dev/vcc/a* device nodes are
+accessible by root only. If RHTVision based programs (SETEdit and INFView use
+the RHTVision library for their user interfase) have access to this device
+files, they run faster and better. This programs are designed to be used this
+way and they drop root privileges as soon as possible, so it shouldn't be a
+security risk.
+
+Q.: Why is INFView Debian version numbering scheme so ugly?
+A.: Well, I will try to explain: currently the versioning scheme is like this:
+infview_0.2.7-0.4.51-1_i386.deb, that means that the package is called
+"infview", that the version number of INFView is 0.2.7, that the version
+number of the editor that contains it is 0.4.51, that the Debian revision is 1
+and that it is compiled for the i386 architecture. The source package from
+where the INFView package is generated is SETEdit, so everytime I generate the
+SETEdit package, I generate also the INFView package. So given the following
+example:
+version: SETEdit INFView
+ 0.4.50 0.2.7
+ 0.4.51 0.2.7
+Notice that the Debian revision for the packages generated is -1 since it
+starts from 1 wherever the SETEdit package changes its version number and that
+the packages generated are these: setedit_0.4.50-1_i386.deb,
+setedit_0.4.51-1_i386.deb and in both cases infview_0.2.7-1_i386.deb.
+Now suppose that I have fixed a grave packaging bug in the 0.4.51 version of
+SETEdit with Debian revision 1, for dpkg, APT, DSelect and other tools, the
+INFView package didn't change, so your system will not be updated and also you
+won't notice that indeed there is a new version of INFView! There could be
+other problems as well like library incompatibilities and your sistem won't
+upgrade since it wouldn't realize that the version of INFView is different.
+
+Q.: Why the editor and the info viewer aren't available on the official Debian
+distribution?
+A.: Because the RHTVision package they depend on can't be at the moment
+on the Debian distribution. See RHTVision's package documentation to know why.
+
+
+Things to do for the package
+----------------------------
+- should use newer features of Debhelpers.
+- should upgrade to po-debconf.
+- should register more documents with doc-base (faq, tags tutorial, etc.).
+
+Ivan Baldo <ibaldo@adinet.com.uy>, Sun, 10 Aug 2003 20:47:31 -0300
+
diff --git a/setedit/debian/buildpackage b/setedit/debian/buildpackage
new file mode 100755
index 0000000..a4d0494
--- /dev/null
+++ b/setedit/debian/buildpackage
@@ -0,0 +1,5 @@
+#!/bin/sh
+dh_testdir || exit $?
+chmod +x debian/rules
+dpkg-buildpackage -rfakeroot
+
diff --git a/setedit/debian/changelog b/setedit/debian/changelog
new file mode 100644
index 0000000..1ea9ca6
--- /dev/null
+++ b/setedit/debian/changelog
@@ -0,0 +1,571 @@
+setedit (0.5.5-5etch) unstable; urgency=low
+
+ * Added: Copy and Save for the debug dialog contents (gdb dialog).
+
+ -- Salvador E. Tropea <salvador@inti.gov.ar> Mon, 23 Apr 2007 11:57:50 -0300
+
+setedit (0.5.5-4etch) unstable; urgency=low
+
+ * Modified to compile with etch.
+
+ -- Salvador E. Tropea <salvador@inti.gov.ar> Wed, 18 Apr 2007 17:04:18 -0300
+
+setedit (0.5.5-3) unstable; urgency=low
+
+ * Build-depend either on aalib1-dev or libaa1-dev.
+
+ -- Baurzhan Ismagulov <ibr@radix50.net> Sat, 10 Mar 2007 23:19:51 +0100
+
+setedit (0.5.5-2) unstable; urgency=low
+
+ * CVS 20061116 r1236 pre-release.
+
+ -- Salvador E. Tropea <salvador@inti.gov.ar> Thu, 16 Nov 2006 14:17:03 -0300
+
+setedit (0.5.5-1) unstable; urgency=low
+
+ * The "I got ADSL 256kbits for 30 hours per month!" release; you may laugh
+ at that but I live in the 3rd world, previously I was using a 56Kbits
+ telephone modem.
+ * Salvador didn't told in this changelog but we are build-depending on
+ RHTVision 2.0.4 now, but I changed it to that version or 2.1.0 since it
+ seems that it works with both of them.
+ * Don't build-depend on xlibs-dev|xlib6g-dev and libncurses-dev, since
+ rhtvision-dev depends on them and they are really rhtvision's dependencies
+ and not of setedit proper.
+ * Standards compliance with Policy version 3.6.2.0.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sat, 20 Aug 2005 18:53:21 -0300
+
+setedit (0.5.5-0.1) unstable; urgency=low
+
+ * New version automatically modified by version update scripts
+
+ -- Salvador E. Tropea (SET) <salvador@inti.gov.ar> Wed, 1 Dec 2004 14:22:21 -0300
+
+setedit (0.5.4-3) unstable; urgency=low
+
+ * Salvador says this is it!, this is the version that will be officially
+ released! CVS release 1.637 2004/11/02 20:19:01.
+ Greetings to all my fans!!! (do I have one?) Anyway, I dedicate this
+ release to Enyunari!!!
+ * I have installed libmigdb so this editor comes with debugging support
+ built-in.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 21 Nov 2004 18:02:18 -0200
+
+setedit (0.5.4-2) unstable; urgency=low
+
+ * A new version of Lintian detected that we are build depending on essential
+ packages so I have removed them: tar and gzip.
+ * The new lintian also detected that we are suggesting grep which it is an
+ essential package too, so removed from the Suggests.
+ * Lintian also detected that this changelog is not UTF-8, to fix it I will
+ not use international characters instead of using UTF-8 for simplicity.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 10 Oct 2004 19:02:40 -0200
+
+setedit (0.5.4-1) unstable; urgency=low
+
+ * New upstream version!!!
+ * Based on CVS version 1.617 2004/09/24 18:59:51.
+ * Baurjan Ismagulov didn't updated this changelog to mention that he added a
+ libset-dev package, so I mention it here; it is useful to build RHIDE.
+ Thanks Baurjan for your work!
+ Note: this package must be improved, I think that the aproach should be
+ the same as rhtvision having the version in the package name and
+ conflicting with a virtual package, and I think that the upstream has a
+ configure option to build it so we must investigate and maybe improve it
+ to suit our needs, also the generated libs are huge so maybe there is
+ something that we are doing wrong; for this reasons I will not upload
+ this package yet.
+ * Standards compliance with Policy version 3.6.1.0, no changes.
+ * The new version of the editor has support for debugging programs with GDB
+ using a library done by Salvador called libmigdb, though it doesn't come
+ in the same CVS module as the editor, Salvador says it will come in the
+ tarball and the editor will use it. I didn't test it for this version but
+ I will and then I will upload packages with debugging support included.
+ * Don't Build-Depend on the rhtvision-dev virtual package, instead depend
+ on the required version since thats the reality.
+ * Remove on clean: gettext/Makefile, libbzip2/Makefile, libpcre/Makefile,
+ libz/Makefile, makes/rhide.env, mp3/libamp/rhide.env,
+ mp3/mpegsound/rhide.env.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Mon, 27 Sep 2004 22:57:35 -0200
+
+setedit (0.5.4-0.1) unstable; urgency=low
+
+ * New version automatically modified by version update scripts
+
+ -- Salvador E. Tropea (SET) <salvador@inti.gov.ar> Thu, 23 Sep 2004 17:21:41 -0300
+
+setedit (0.5.3-0.2) unstable; urgency=low
+
+ * Add an include file required by rhide.
+
+ -- Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> Sat, 17 Jul 2004 22:09:30 +0200
+
+setedit (0.5.3-0.1) unstable; urgency=low
+
+ * New version automatically modified by version update scripts
+
+ -- Salvador E. Tropea (SET) <salvador@inti.gov.ar> Wed, 22 Oct 2003 16:17:50 -0300
+
+setedit (0.5.2-1) unstable; urgency=low
+
+ * New stable upstream version! Sorry for the lateness, I got a job and I am
+ busy now, though I don't regret!!!
+ * Based on CVS version 1.435 2003/07/23 19:37:56.
+ * Acknowledge upstream changes to Debian packaging:
+ - No more build dependency on Recode.
+ - No more backup of .mak files (not used anymore on the new build
+ system).
+ - New debian/README file with instructions regarding compilation of the
+ package, it is similar to the maintainer.notes file.
+ - Now if the tar fails when doing the backup or the restore, it doesn't
+ stop the compiling or cleaning process since usually it is not critical.
+ * Support for DEB_BUILD_OPTIONS as Policy mandates in section 11.1.
+ * Suggests exuberant-ctags | ctags, woohoo!, cool class browser and symbol
+ completion engine!
+ * Lintian suggested adding a reference to /usr/share/common-licenses/GPL in
+ the copyright file and striping the (s) in Upstream Author(s), and I
+ fully agree :-).
+ * Standards compliance with Policy version 3.5.8.0.
+ * Note: I will not make the migration to po-debconf (new DebConf template
+ translation system) yet, I will wait some more, maybe for the next
+ upstream release. I don't know if that would work on Woody and I would
+ like to release this version for Potato too, since I have not removed it
+ from one of my computers yet and didn't made other changes that prevent
+ building for Potato.
+ * Remove on clean: holidays/Makefile, redhat/setedit-*.*.spec and
+ internac/getcolors.exe.
+ * Backup and restore: internac/getcolors.exe.
+ * Better README.Debian, with a dedicated APT section, a Things to do for
+ the package section and mentioning SET's InfoViewer.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Sun, 10 Aug 2003 18:39:53 -0300
+
+setedit (0.5.0-1) unstable; urgency=low
+
+ * New stable upstream version! Yes!
+ * Note: I think this will be the last version for Potato.
+ * Stop the war on Iraq, if you are in favour of the war then be aware that
+ you are against the opinion of most of the world and against the United
+ Nations, that means that you are being selfish and not considering the
+ opinion of the majority of the people on this planet.
+ * I have a new bicycle!
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Mon, 31 Mar 2003 18:51:02 -0300
+
+setedit (0.5.0-0.4) unstable; urgency=low
+
+ * Just testing a new alpha version from CVS dated 2 Oct 2002.
+ * Someone stole my bicycle!!!
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Thu, 3 Oct 2002 20:43:35 -0300
+
+setedit (0.5.0-0.3) unstable; urgency=low
+
+ * New upstream alpha version from CVS dated 11 Sep 2002 (big changes, could
+ be unstable).
+ * debian/maintainer.notes: it was very outdated, now contains accurate and
+ more useful information.
+ * Added information about APT repository in README.Debian.
+ * infview package didn't had upstream changelog and README.Debian.
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Wed, 11 Sep 2002 19:53:31 -0300
+
+setedit (0.5.0-0.2) unstable; urgency=low
+
+ * Added build dependency on aalib1-dev, so the AALib-Plasma screensaver
+ gets built.
+ * Added a translation to Spanish of the DebConf template file (new file
+ debian/setedit.templates.es, added to makes/lista).
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Fri, 6 Sep 2002 13:14:05 -0300
+
+setedit (0.5.0-0.1) unstable; urgency=low
+
+ * New upstream alpha version from CVS dated 5 Sep 2002.
+ * Policy now prohibits the use of the add-log-mailing-address Emacs tag so
+ removed it from the changelog (anyway you guessed it right: I don't use
+ Emacs! :-))) ).
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Thu, 5 Sep 2002 19:19:06 -0300
+
+setedit (0.4.57-0.4) unstable; urgency=low
+
+ * New upstream alpha version from CVS dated 25 jul 2002 (that's my
+ birthday!!!).
+ * Changed my email from lubaldo to ibaldo, so updated that everywhere.
+ * Added more comments to the debian/rules file, it seems that Salvador was
+ confused one time :).
+
+ -- Ivan Baldo <ibaldo@adinet.com.uy> Mon, 29 Jul 2002 19:30:54 -0300
+
+setedit (0.4.57-0.3) unstable; urgency=low
+
+ * DebConf support for generating the /usr/share/setedit/install.log
+ file containing options used when the editor cannot load a desktop
+ file. I think I have done it The Right Way, reading existing values
+ from the install.log file, adding new ones and modifying the existing
+ ones.
+ * Build-Depends on a newer debhelper (>=2.0.54) because of the
+ debconfisation and also Depends on debconf (I don't know if I have to
+ specify a version though).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Mon, 17 Jun 2002 01:57:43 -0300
+
+setedit (0.4.57-0.2) unstable; urgency=low
+
+ * New unstable alpha version from CVS dated 5 Jun 2002.
+ * build-depend on xlibs-dev after confirming that it's needed and
+ also added libncurses-dev and tar to the list, and removed make
+ since it is included on build-essential.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Thu, 6 Jun 2002 16:46:11 -0300
+
+setedit (0.4.57-0.1) unstable; urgency=low
+
+ * New unstable upstream release, now with native X11 support!
+ * Changed menu items to have 2 entries, one for virtual consoles and
+ another for X11 (maybe I will report a wishlist bug on the menu
+ package because of this).
+ * No more changes needed!!?? This is boring!!! ;-)))
+ * We don't build-depend on xlibs-dev yet, because I am not so sure if
+ that's needed (I will talk with upstream about this).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 19 May 2002 15:18:06 -0300
+
+setedit (0.4.54-1) unstable; urgency=low
+
+ * The "Brothers of Argentina have problems, I hope they can get
+ through it soon!" release, which it is dedicated to my argentine
+ neighbors.
+ * New release, with small changes and fixes, this one is supposed to
+ be the One, I mean, the new Stable one, so rejoice!!!
+ * Upstream says that it modified debian/rules to not delete
+ doc/Makefile and internac/Makefile, but it seems it did not.
+ I decided to stick with removing that files, because that's what
+ I think should be done (to leave the source directory identical to
+ the upstream released one, after the clean). I will talk with
+ Salvador about that, not big problem though so don't worry.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 29 Jan 2002 00:10:56 -0300
+
+setedit (0.4.53-1) unstable; urgency=low
+
+ * The "Ivan hates computers after having good vacations" release.
+ Well, I was on Punta del Este, good beachs, good womans, some fun
+ at night, and no computers :). My hate for computers is temporary
+ and it happens everytime I have good vacations, so don't worry.
+ * New prerelease version, it fixes some memory leaks, improves
+ compilation, some other tiny things, etc.
+ * Remove internac/fix.exe on debian/rules clean.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 8 Jan 2002 15:12:38 -0300
+
+setedit (0.4.52-2) unstable; urgency=low
+
+ * Well, in the period of last testing of the stable release, some
+ small issues where discovered and fixed. Note that the release was
+ not announced, it was only announced on the setedit-users mailing
+ list and as a prerelease. Lets hope that this becomes the real
+ release.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 4 Dec 2001 02:10:43 -0300
+
+setedit (0.4.52-1) unstable; urgency=low
+
+ * The "Arriba Uruguay noma!!!" release, Uruguay goes to the Fifa
+ World Soccer Championship Korea-Japan 2002, it was hard but our
+ team made it!
+ * Yes!!! New stable version of the editor!!!
+ * Modified generated info files because Debian's install-info doesn't
+ remove info files that specify "something.info" as their node, it
+ needs "something" specified instead, and also, infview.info was
+ being registered as infeng.info, which prevented it from being
+ accessed from the main info file (the "dir" info file).
+ * The infobrowser alternative (from infview) was being unregistered
+ incorrectly.
+ * Well, that's a lot of bugs I have found just before the stable
+ release! I think two things:
+ 1 - I should do a more thorough testing while testing the unstable
+ versions, to avoid surprises like these ones just before a stable
+ release!
+ 2 - I don't have good testers of the packages or the people just
+ doesn't bother to report the bugs.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Mon, 26 Nov 2001 19:36:39 -0300
+
+setedit (0.4.51-4) unstable; urgency=low
+
+ * No changes, just a newer upstream source from CVS and I will upload
+ this version to the repository together with a little newer stable
+ RHTVision, so people can test this release of the editor which is
+ near to be the official stable one.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 11 Nov 2001 18:00:02 -0300
+
+setedit (0.4.51-3) unstable; urgency=low
+
+ * The package was registering /usr/share/doc/setedit/editor.txt.gz as
+ text documentation to doc-base, but it seems to have changed to
+ setedit.txt.gz sometime and I forgot to modify it on the doc-base
+ control file. I have noticed it when browsing with dpkg-www,
+ lintian and doc-base didn't tell anything about it!
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Fri, 2 Nov 2001 17:30:49 -0300
+
+setedit (0.4.51-2) unstable; urgency=low
+
+ * Updated upstream sources from CVS, it has small bugfixes and tweaks
+ here and there.
+ * Now that I have installed UPX on my system, I realized that the
+ infview binary is allways packed with UPX if it is available, and
+ unfortunately upstream didn't provide an easy way of avoiding this,
+ so I just modified upstream building system to be able to specify
+ a new "--no-comp-exe" option to the configure script and we use
+ that on debian/rules.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 28 Oct 2001 15:59:16 -0300
+
+setedit (0.4.51-1) unstable; urgency=low
+
+ * New upstream version (still a development release).
+ * Changed Infview Debian package version numbering, yes, again. Now
+ it is of the form "infview_0.2.7-0.4.51-1_i386.deb" and yes, is
+ ugly, but is needed.
+ * Added a Debian specific FAQ to the README.Debian file, explaining
+ why the binaries are SUID root, why the infview package version
+ numbering is like it is, and why the packages are not in Debian.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 21 Oct 2001 22:05:26 -0300
+
+setedit (0.4.50-1) unstable; urgency=low
+
+ * The "Let's see if I can release while I am sleeping" release.
+ That's because I am tired, I need some sleep and my eyelashes are
+ closing some times, against my will. THIS RELEASE COMES WITHOUT
+ WARRANTY.
+ * Nice new upstream release, long live Salvador!
+ * Upstream added a "buildpackage" script, I don't see the point of
+ it but if it is of some use to Salvador or others, I will keep it.
+ * Modified the new debian/buildpackage script to check before trying
+ to do anything that it is being run from the right directory.
+ * Added clean-debian to PHONY list.
+ * Simplified the backup system by using a TAR archive instead of
+ copying and moving files around. Good idea from Salvador. At the
+ same time now timestamps are preserved so CVS checkins are faster.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Thu, 11 Oct 2001 23:07:58 -0300
+
+setedit (0.4.49-1) unstable; urgency=low
+
+ * New upstream version.
+ * Added missing Conflicts: suidmanager (<< 0.50) to INFView package.
+ * Don't delete mp3/libamp/rhide.env on clean and added it to the
+ backup system.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 7 Oct 2001 19:54:51 -0300
+
+setedit (0.4.47-2) unstable; urgency=low
+
+ * Create infview package with its own version and not setedit one,
+ beware that I have not used an epoch, so the packaging tools will
+ think that you are downgrading and that this version of infview is
+ older.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sat, 29 Sep 2001 23:41:40 -0300
+
+setedit (0.4.47-1) unstable; urgency=low
+
+ * New upstream version.
+ * Now clean target uses clean-debian target for the Debian cleaning.
+ * Now it backups and restores original upstream files that are
+ modified during the building process.
+ * No more empty infview directories in the setedit package! I don't
+ know why dh_movefiles doesn't remove the directory. I also
+ discovered something funny: I allways check what the packages have
+ inside using Midnight Commander, but it doesn't show empty
+ directories so I didn't know of the problem until Salvador told me!
+ Extracting with dpkg-deb that directories appear.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sat, 29 Sep 2001 12:16:59 -0300
+
+setedit (0.4.45-1) unstable; urgency=low
+
+ * New upstream version!
+ * Standards version 3.5.2.0.
+ * Long time ago, the RHTVision package had to be removed from the
+ Debian distribution because of yet unresolved legal problems with
+ Inprise, this package depends on that library and so couldn't be
+ distributed, so, this package is now unofficial.
+ * Updated build-depends.
+ * Updated description, README.Debian, etc. to reflect that this is
+ not an official Debian package.
+ * Use versioned build dependency on DebHelper instead of using
+ deprecated dh_testversion.
+ * Convert from suidregister to statoverride.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Sun, 12 Aug 2001 22:05:56 -0300
+
+setedit (0.4.39-4) unstable; urgency=low
+
+ * Applied patch from upstream author that allows the documentation to
+ be created on systems with a new incompatible version of makeinfo.
+ I have made further modifications to the file doc/set.txt because
+ it was creating the table of contents twice.
+ Also I have commented out the line saying @contents in the files
+ doc/editor.tx and doc/sdg.tx because it was doing weird things to
+ the table of contents.
+ Closes: #53277.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Thu, 30 Dec 1999 04:25:08 -0300
+
+setedit (0.4.39-3) unstable; urgency=low
+
+ * Now builds the standalone InfoViewer and puts it in a different
+ package called infview.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 21 Dec 1999 16:11:56 -0300
+
+setedit (0.4.39-2) unstable; urgency=low
+
+ * Standards version 3.1.0.
+ * Added Build-Depends.
+ * Architecture set to "any" instead of "i386" as requested by
+ Roman Hodek. This program isn't tested on other architectures other
+ than i386, so, testing is needed and reports of success or failures
+ will be apreciated.
+ Closes: #50319.
+ * Instead of suggesting tetex-bin and tetex-base, now suggests
+ texinfo, since the makeinfo program moved from tetex-bin to the
+ package texinfo.
+ * Call dh_clean without the -k flag in the install target.
+ * Don't use install-stamp (in rules file) anymore, to avoid possible
+ duplicate strings in maintainer script fragment files (see
+ debhelper changelog of version 2.0.56).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 1 Dec 1999 13:12:30 -0300
+
+setedit (0.4.39-1) unstable; urgency=low
+
+ * New upstream version:
+ - Code page remaping.
+ - Man page viewer follows links to other manpages.
+ - New Tex and TCL syntax highlights.
+ - new 27 code pages supported!
+ - Various bugfixes and other enhancements.
+ * Now uses new upstream makefile clean target for cleaning.
+ * We prevent building of infoviewer to prevent problems by now.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 26 Oct 1999 15:07:28 -0300
+
+setedit (0.4.36-2) unstable; urgency=low
+
+ * Better descriptions for the editor (thanks Salvador!).
+ * Now Recommends: man.
+ * Now has manpage for the "e" symlink (lintian complained).
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 29 Sep 1999 20:35:49 -0300
+
+setedit (0.4.36-1) unstable; urgency=low
+
+ * New upstream version:
+ - Various bugfixes and enhancements.
+ - New building system!
+ * Modified building system for upstream new building system and FHS
+ move.
+ * Now requires DEBHelpers 2.0.40.
+ * DOC-Base support was not working, now works and also registers INFO
+ files.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 22 Sep 1999 15:05:37 -0300
+
+setedit (0.4.25-2) unstable; urgency=low
+
+ * Applied patch from upstream author to correct the patchenv.pl perl
+ script that was preventing correct compilation.
+ * Initial support for docbase (just plain text documentation, more
+ will follow), untested.
+ * Worked around bug related to the set_new_handler() function that
+ was preventing linkage.
+ * Now in the rhide.env file, we define SUPPORT_INC to none, to avoid
+ linkage of support libraries provided by upstream author and use
+ the Debian ones. Removed a little hack on the rules makefile
+ because of this.
+ * Better maintainer.notes file.
+ * Better README.Debian file.
+ * Added upstream download information in the copyright file.
+ * Added Suggests: grep, doc-base, tetex-bin, tetex-base.
+ * Added dh_testversion 1.2.9, because I use dh_links now.
+ * The /usr/bin/e symlink was set incorrectly.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 1 Jun 1999 15:27:33 -0300
+
+setedit (0.4.25-1) unstable; urgency=low
+
+ * New upstream version:
+ - Various bugfixes (a lot due to memory problems reported by the
+ YAMD tool).
+ - Uses the new version 2 of the PCRE library.
+ - Now incorporates the Debian building files.
+ - The binary executables are compressed with UPX now (not in Debian
+ tough).
+ - Updated documentation.
+ - Enhanced and killed bugs in the building scripts (partly because
+ of the Debian packaging).
+ - Added syntax highlight for Python.
+ - Now the executable in Linux is called "setedit" instead of "e"
+ and "e" is now a symlink to "setedit".
+ - Renamed the editor info file from "editor.info" to
+ "setedit.info".
+ - Renamed the language file from "editor.mo" to "setedit.mo".
+ - Now the editor searches for its files in the /usr hierarchy
+ instead of only in /usr/local (so, the setting of an environment
+ variable is not necessary now).
+ - Other minor enhancements.
+ * Changed the Debian build scripts to acomodate upstream changes.
+ * Now the executable is suid root because this makes significant
+ improvements on speed and upstream author says it is safe.
+ * Now the Debian build scripts doesn't do a copy and restore of all
+ the "makes" directory, instead it just copies and restores after
+ compilation the files that change only, so, it builds faster now.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Thu, 27 May 1999 20:15:24 -0300
+
+setedit (0.4.24-3) unstable; urgency=low
+
+ * Now -pipe option to gcc passed (faster compilation).
+ * Dummy gpr2mak script not required anymore.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 30 Mar 1999 14:55:13 -0300
+
+setedit (0.4.24-2) unstable; urgency=low
+
+ * Now the executable of the editor is SUID root registered (much more
+ faster!).
+ * The mp3/libamp/libamp.mak file was not restored to the original on
+ the clean-debian target.
+ * Now the editor info file is registered in the dir main menu
+ info page (I was trying to register it using the debian/info file
+ but it doesn't work that way, I am doing it manually but keep the
+ debian/info file I was trying to use as debian/info.ex in case
+ someone else wants to look in it to see what is wrong with it).
+ * The upstream changelog was called change.log.gz, now it is renamed
+ to changelog.gz to suit Debian policy (Lintian complained).
+ * Now the clean target doesn't depend on clean-debian anymore.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Wed, 24 Mar 1999 18:23:54 -0300
+
+setedit (0.4.24-1) unstable; urgency=low
+
+ * Initial Release.
+ * First early alpha packaging sent to upstream author.
+
+ -- Ivan Baldo <lubaldo@adinet.com.uy> Tue, 16 Mar 1999 17:18:48 -0300
+
+Local variables:
+mode: debian-changelog
+End:
diff --git a/setedit/debian/control b/setedit/debian/control
new file mode 100644
index 0000000..f4f6f82
--- /dev/null
+++ b/setedit/debian/control
@@ -0,0 +1,55 @@
+Source: setedit
+Section: editors
+Priority: optional
+Maintainer: Ivan Baldo <ibaldo@adinet.com.uy>
+Build-Depends: perl | perl5, rhtvision2.1.0-dev | rhtvision2.0.4-dev, debhelper (>=2.0.54), libpcre3-dev | libpcre2-dev, libz-dev, libbz2-dev, texinfo, gettext, aalib1-dev | libaa1-dev
+Standards-Version: 3.6.2.0
+
+Package: setedit
+Section: editors
+Architecture: any
+Depends: ${shlibs:Depends}, debconf
+Recommends: man
+Suggests: doc-base, texinfo, exuberant-ctags | ctags
+Conflicts: suidmanager (<< 0.50)
+Description: SET's Editor - An editor for programmers
+ SET's Editor is a friendly text editor; it was designed to be used
+ by programmers; the main target of the editor is C and C++ code but
+ it can be used for other tasks and supports syntax highlight for
+ more than 47 languages. It has a user interface very easy to
+ understand for people that used non-UNIX programs (real windows,
+ dialogs, buttons, pull-down menues, mouse, etc.).
+ .
+ Note from Debian packager: if you aren't a programmer take a look
+ at this editor anyway, it is really user friendly, easy to use yet
+ powerful. Also, it has syntax highlight for a lot of files, macros,
+ pseudo macros, and a lot more features.
+ .
+ THIS IS NOT A DEBIAN OFFICIAL PACKAGE AND IS NOT PART OF THE OFFICIAL
+ DEBIAN DISTRIBUTION.
+
+Package: infview
+Section: doc
+Architecture: any
+Depends: ${shlibs:Depends}
+Recommends: man
+Suggests: doc-base
+Conflicts: suidmanager (<< 0.50)
+Description: SET's InfoViewer - An info documentation browser
+ SET's InfoViewer is a friendly text-console-mode GNU Info documentation
+ browser. This is the SET's Editor info browser but standalone.
+ .
+ THIS IS NOT A DEBIAN OFFICIAL PACKAGE AND IS NOT PART OF THE OFFICIAL
+ DEBIAN DISTRIBUTION.
+
+Package: libset-dev
+Section: libdevel
+Architecture: any
+Description: SET's libset - An editor library
+ SET's libset is a library providing the SET's Editor functionality, it is
+ used to build RHIDE but maybe in the future can be used by other projects.
+ At the moment, only static version is shipped, because upstream doesn't care
+ about sonames and versions as to be able to ship a shared version.
+ .
+ THIS IS NOT A DEBIAN OFFICIAL PACKAGE AND IS NOT PART OF THE OFFICIAL
+ DEBIAN DISTRIBUTION.
diff --git a/setedit/debian/copyright b/setedit/debian/copyright
new file mode 100644
index 0000000..0939cc9
--- /dev/null
+++ b/setedit/debian/copyright
@@ -0,0 +1,12 @@
+This package was debianized by Ivan Baldo ibaldo@adinet.com.uy on
+Tue, 16 Mar 1999 17:18:48 -0300.
+
+It was downloaded from
+http://setedit.sourceforge.net/.
+
+Upstream Author: Salvador Eduardo Tropea (SET) <salvador@inti.gov.ar>
+
+Copyright:
+GPL, on Debian systems, the complete text of the GNU General Public License
+can be found in `/usr/share/common-licenses/GPL'.
+
diff --git a/setedit/debian/files_to_backup b/setedit/debian/files_to_backup
new file mode 100644
index 0000000..7263797
--- /dev/null
+++ b/setedit/debian/files_to_backup
@@ -0,0 +1,11 @@
+doc/Makefile
+gettext/config.h
+gettext/Makefile
+holidays/Makefile
+include/configed.h
+internac/de.po
+internac/es.po
+internac/Makefile
+makes/rhide.env
+mp3/libamp/rhide.env
+mp3/mpegsound/rhide.env
diff --git a/setedit/debian/info.ex b/setedit/debian/info.ex
new file mode 100644
index 0000000..1b3be30
--- /dev/null
+++ b/setedit/debian/info.ex
@@ -0,0 +1,20 @@
+# Unfortunately this seems to not work and I don't know why... so done it
+# manually, but if someone knows why this method doesn't work, then tell me
+# please.
+
+# This is a configuration files for installing a .info menu
+# The Description to be placed into the directory
+DESCR="This is a user friendly text editor for programmers."
+
+# The section this info file should be placed in (Regexp) followed by
+# the new section name to be created if the Regexp does not match
+# (Optional. If not given the .info will be appended to the directory)
+SECTION_MATCH="Text Editors"
+SECTION_NAME="Text Editors"
+
+# The file referred to from the Info directory
+# FIXME: I think this info file name could collide with possibly one provided by update-alternatives for editors! But I am not sure since update-alternatives doesn't have good documentation and I don't understand the purpose of the -slave flag!
+FILE=setedit.info
+
+# Optional. The files to be copied to /usr/info
+#FILES=*.info
diff --git a/setedit/debian/infview.doc-base b/setedit/debian/infview.doc-base
new file mode 100644
index 0000000..4001c79
--- /dev/null
+++ b/setedit/debian/infview.doc-base
@@ -0,0 +1,13 @@
+Document: infview
+Title: SET's InfoViewer documentation
+Author: Salvador Eduardo Tropea
+Abstract: This is the documentation for SET's InfoViewer, a friendly GNU Info documentation viewer.
+Section: Help
+
+Format: text
+Files: /usr/share/doc/infview/infview.txt.gz
+
+Format: info
+Index: /usr/share/info/infview.info.gz
+Files: /usr/share/info/infview.*
+
diff --git a/setedit/debian/infview.menu b/setedit/debian/infview.menu
new file mode 100644
index 0000000..a9515dd
--- /dev/null
+++ b/setedit/debian/infview.menu
@@ -0,0 +1,5 @@
+?package(infview):needs="vc" section="Help"\
+ title="SET's InfoViewer" command="/usr/bin/infview"
+?package(infview):needs="x11" section="Help"\
+ title="SET's InfoViewer" command="/usr/bin/infview"
+
diff --git a/setedit/debian/infview.postinst b/setedit/debian/infview.postinst
new file mode 100644
index 0000000..b2573bb
--- /dev/null
+++ b/setedit/debian/infview.postinst
@@ -0,0 +1,14 @@
+#!/bin/sh
+# When upgrading the following doesn't need to be done...
+if [ $1 != "upgrade" ] ; then
+ # Install alternative. The priority is the same as the pinfo package.
+ update-alternatives --install /usr/bin/infobrowser infobrowser /usr/bin/infview 50 \
+ --slave /usr/share/man/man1/infobrowser.1.gz infobrowser.1.gz /usr/share/man/man1/infview.1.gz
+
+ # Doing this manually because the debian/info file doesn't seem to work, take a
+ # look in debian/info.ex and tell me what is wrong with it!
+ # We don't need to provide a description, it is provided in the info file itself.
+ install-info --quiet --section "Documentation" "Documentation" /usr/share/info/infview.info.gz
+fi
+
+#DEBHELPER#
diff --git a/setedit/debian/infview.postrm b/setedit/debian/infview.postrm
new file mode 100644
index 0000000..47b0c2f
--- /dev/null
+++ b/setedit/debian/infview.postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ remove = "$1" ]; then
+ dpkg-divert --package infview --remove --rename \
+ --divert /usr/share/info/infview-setedit.info.gz /usr/share/info/infview.info.gz
+fi
+
+#DEBHELPER#
+
diff --git a/setedit/debian/infview.preinst b/setedit/debian/infview.preinst
new file mode 100644
index 0000000..4408198
--- /dev/null
+++ b/setedit/debian/infview.preinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+if [ install = "$1" ]; then
+ dpkg-divert --package infview --add --rename \
+ --divert /usr/share/info/infview-setedit.info.gz /usr/share/info/infview.info.gz
+fi
+
+#DEBHELPER#
+
diff --git a/setedit/debian/infview.prerm b/setedit/debian/infview.prerm
new file mode 100644
index 0000000..a369081
--- /dev/null
+++ b/setedit/debian/infview.prerm
@@ -0,0 +1,8 @@
+#!/bin/sh
+# The following isn't necessary for an upgrade...
+if [ $1 != "upgrade" ] ; then
+ update-alternatives --remove infobrowser /usr/bin/infview
+ install-info --quiet --remove infview
+fi
+
+#DEBHELPER#
diff --git a/setedit/debian/maintainer.notes b/setedit/debian/maintainer.notes
new file mode 100644
index 0000000..2ed3b6a
--- /dev/null
+++ b/setedit/debian/maintainer.notes
@@ -0,0 +1,30 @@
+How to unpack and prepare the files:
+ Make sure that the debian/rules file is executable
+(chmod 755 debian/rules).
+ In the root directory where you unpacked there's a file called
+version.txt. This file tells the version of the editor. See in the file
+debian/changelog if it has an entry with the current version number of the
+editor. If it doesn't, then add an entry with the command
+dch -v 0.4.36-0.1 "Personal use unofficial version." (replacing 0.4.36 with
+the current version number as shown in version.txt).
+
+How to make the .deb, .tar.gz, .dsc and .changes files:
+ cd setedit-directory
+ dpkg-buildpackage -rfakeroot
+
+To check the package (binary and source):
+ cd ..
+ lintian -i *.deb *.dsc
+
+To clean everything after building:
+ cd setedit-directory
+ fakeroot debian/rules clean
+
+Other notes:
+ - There is a clean-debian target on the debian/rules file, it only cleans
+ Debian specific files and not upstream build files. It is useful when
+ you just want for example to rebuild the package without recompiling
+ the sources (use debian/rules clean-debian).
+ - To rebuild the packages without recompiling the sources, use the binary
+ target on the debian/rules file (debian/rules binary).
+
diff --git a/setedit/debian/rules b/setedit/debian/rules
new file mode 100755
index 0000000..134b2b3
--- /dev/null
+++ b/setedit/debian/rules
@@ -0,0 +1,161 @@
+#!/usr/bin/make -f
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Cristoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=1
+
+# Set CFLAGS according to the Debian Policy:
+CFLAGS = -g -Wall
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+CXXFLAGS = $(CFLAGS)
+
+
+# Compile the beast!:
+build: build-stamp
+build-stamp: debianbackup.tar
+ dh_testdir
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure \
+ --prefix=$(shell pwd)/debian/tmp/usr --fhs --no-comp-exe
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE)
+ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) -C makes libset
+ touch build-stamp
+
+
+# Clean everything as if nothing happened :) :
+clean: clean-debian debianbackup.tar
+# Heh, for cleaning we need to run the configure script in order to create
+# the makefile that cleans! :-)))
+ ./configure
+ $(MAKE) clean
+# Restore upstream provided regenerated files:
+ test -e debianbackup.tar && tar -xf debianbackup.tar
+ rm -f debianbackup.tar
+# FIXME: ask upstream about adding the next files to his clean target:
+ rm -f internac/fix.exe internac/gr.po internac/po_list \
+ internac/getcolors.exe internac/potfiles.po internac/de.mo \
+ internac/es.mo holidays/Makefile redhat/setedit-*.*.spec \
+ gettext/Makefile libbzip2/Makefile libpcre/Makefile libz/Makefile \
+ makes/rhide.env mp3/libamp/rhide.env mp3/mpegsound/rhide.env
+# Don't delete this files (they are on the tarball but not on CVS):
+# doc/Makefile internac/Makefile
+
+# Use the following target when you just want for example to rebuild the
+# package without recompiling the sources:
+clean-debian:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+ dh_clean
+
+
+# Let's backup modified files to restore them later!:
+debianbackup.tar:
+ dh_testdir
+# Backup upstream provided regenerated files:
+ -tar -cf debianbackup.tar --files-from=debian/files_to_backup
+
+
+# Copy needed files to the temporary directories for the packages:
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean
+# dh_installdirs
+# Add here commands to install the package into debian/tmp.
+ $(MAKE) install
+# We need to move files for other packages than the first one in the control file:
+ dh_movefiles -p infview usr/bin/infview usr/share/doc/infview/ usr/share/infview/ usr/share/man/man1/infview.1.gz
+# I don't know why dh_movefiles doesn't remove the directories I requested for moving to the infview package, so I move them by hand (anyway I don't know why that command exists in the first place!):
+ rm -rf debian/tmp/usr/share/doc/infview/ debian/tmp/usr/share/infview/
+ mv debian/tmp/usr/share/doc/setedit/change.log.gz \
+ debian/tmp/usr/share/doc/setedit/changelog.gz
+ cp debian/tmp/usr/share/doc/setedit/changelog.gz \
+ debian/infview/usr/share/doc/infview/
+ dh_link usr/share/man/man1/setedit.1.gz usr/share/man/man1/e.1.gz
+ mkdir debian/infview/usr/share/info
+ cp debian/tmp/usr/share/info/infview.info.gz debian/infview/usr/share/info/infview.info.gz
+ cp debian/README.debian \
+ debian/infview/usr/share/doc/infview/README.Debian
+# Install libset files:
+ mkdir -p debian/libset-dev/usr/include/setedit \
+ debian/libset-dev/usr/lib
+ tar c \
+ calcu/calcu.h \
+ include/ceditor.h \
+ include/sindicat.h \
+ include/tvsetuti.h \
+ include/pmcoll.h \
+ include/ced_exte.h \
+ include/ced_clas.h \
+ include/ced_inte.h \
+ include/ced_coma.h \
+ include/ced_pcre.h \
+ include/loadkbin.h \
+ include/slpinter.h \
+ include/loadshl.h \
+ infview/include/inf.h \
+ infview/include/infbase.h \
+ setedit/include/editcoma.h \
+ setedit/include/edprint.h \
+ settvuti/include/settvuti.h \
+ settvuti/include/tstringa.h \
+ settvuti/include/sarray.h \
+ settvuti/include/setstack.h \
+ settvuti/include/tnocastc.h \
+ settvuti/include/viewplus.h \
+ settvuti/include/tinppipe.h \
+ settvuti/include/edhists.h \
+ |tar xC debian/libset-dev/usr/include/setedit
+ cp makes/libset.a makes/libeasyd.a makes/libsettv.a \
+ debian/libset-dev/usr/lib
+
+
+# Build the packages for a specific architecture:
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdebconf
+ dh_installdocs
+# dh_installexamples
+ dh_installmenu
+# dh_installemacsen
+# dh_installinit
+# dh_installcron
+# dh_installmanpages
+# dh_undocumented e.1 setedit.1
+ dh_installchangelogs
+ dh_strip -Xlibset.a -Xlibeasyd.a -Xlibsettv.a
+ dh_compress
+ dh_fixperms
+ chmod 4755 debian/tmp/usr/bin/setedit
+ chmod 4755 debian/infview/usr/bin/infview
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol -p setedit
+ dh_gencontrol -p infview -- -v$$(cat infview/version.txt)-$$(cat version.txt)-$$(head -n1 debian/changelog | sed 's/.* (.*-//' | sed 's/) .*//')
+ dh_gencontrol -p libset-dev
+# dh_makeshlibs This is for libraries.
+ dh_md5sums
+ dh_builddeb
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+#This package doesn't have architecture-independent files for the moment...
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+# Build all the packages:
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary clean-debian
diff --git a/setedit/debian/setedit.config b/setedit/debian/setedit.config
new file mode 100755
index 0000000..e4dc276
--- /dev/null
+++ b/setedit/debian/setedit.config
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. /usr/share/debconf/confmodule
+
+# DebConf is not a registry, so we try to get the values from the real
+# source...
+cfgfile="/usr/share/setedit/install.log"
+if grep 'CentralDesktopFile=0' $cfgfile >/dev/null 2>&1 ; then
+ db_set setedit/central_desktop_file 'Create a desktop file in each directory'
+fi
+if grep 'CentralDesktopFile=1' $cfgfile >/dev/null 2>&1 ; then
+ db_set setedit/central_desktop_file 'Use a central desktop file'
+fi
+if grep 'TabsForIndent=0' $cfgfile >/dev/null 2>&1 ; then
+ db_set setedit/tabs_for_indent 'Spaces'
+fi
+if grep 'TabsForIndent=1' $cfgfile >/dev/null 2>&1 ; then
+ db_set setedit/tabs_for_indent 'Tabs'
+fi
+if grep 'CreateBackUps=0' $cfgfile >/dev/null 2>&1 ; then
+ db_set setedit/create_backups 'No'
+fi
+if grep 'CreateBackUps=1' $cfgfile >/dev/null 2>&1 ; then
+ db_set setedit/create_backups 'Yes'
+fi
+
+# Ask the questions now...
+db_beginblock
+db_input low setedit/central_desktop_file
+db_input low setedit/tabs_for_indent
+db_input low setedit/create_backups
+db_endblock
+db_go
+
+
diff --git a/setedit/debian/setedit.doc-base b/setedit/debian/setedit.doc-base
new file mode 100644
index 0000000..705ed27
--- /dev/null
+++ b/setedit/debian/setedit.doc-base
@@ -0,0 +1,13 @@
+Document: setedit
+Title: SET's Editor documentation
+Author: Salvador Eduardo Tropea
+Abstract: This is the documentation for SET's Editor, a friendly text editor.
+Section: Apps/Editors
+
+Format: text
+Files: /usr/share/doc/setedit/setedit.txt.gz
+
+Format: info
+Index: /usr/share/info/setedit.info.gz
+Files: /usr/share/info/setedit.*
+
diff --git a/setedit/debian/setedit.menu b/setedit/debian/setedit.menu
new file mode 100644
index 0000000..dd81160
--- /dev/null
+++ b/setedit/debian/setedit.menu
@@ -0,0 +1,5 @@
+?package(setedit):needs="vc" section="Apps/Editors"\
+ title="SET's Editor" command="/usr/bin/setedit"
+?package(setedit):needs="x11" section="Apps/Editors"\
+ title="SET's Editor" command="/usr/bin/setedit"
+
diff --git a/setedit/debian/setedit.postinst b/setedit/debian/setedit.postinst
new file mode 100644
index 0000000..12d0a1b
--- /dev/null
+++ b/setedit/debian/setedit.postinst
@@ -0,0 +1,65 @@
+#!/bin/sh
+# When upgrading the following doesn't need to be done...
+if [ $1 != "upgrade" ] ; then
+ # FIXME: The priority is 90 and it was taken from the FTE postinst, I don't know what value to put there...
+ update-alternatives --install /usr/bin/editor editor /usr/bin/setedit 90 \
+ --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/setedit.1.gz
+
+ # Doing this manually because the debian/info file doesn't seem to work, take a
+ # look in debian/info.ex and tell me what is wrong with it!
+ # We don't need to provide a description, it is provided in the info file itself.
+ install-info --quiet --section "Text Editors" "Text Editors" /usr/share/info/setedit.info.gz
+fi
+
+# DebConf support:
+. /usr/share/debconf/confmodule
+cfgfile="/usr/share/setedit/install.log"
+# Create configuration file if it doesn't exist:
+if [ ! -e $cfgfile ] ; then
+ echo "#
+# Default Installation Options file, created on installation with DebConf.
+# These options will be used when no desktop file can be loaded.
+# You can modify these options editing this file and/or using
+# dpkg-reconfigure.
+#
+[Install]" > $cfgfile
+fi
+# Add possibly new options:
+if ! grep 'CentralDesktopFile=' $cfgfile >/dev/null 2>&1 ; then
+ echo "CentralDesktopFile=0" >> $cfgfile
+fi
+if ! grep 'TabsForIndent=' $cfgfile >/dev/null 2>&1 ; then
+ echo "TabsForIndent=0" >> $cfgfile
+fi
+if ! grep 'CreateBackUps=' $cfgfile >/dev/null 2>&1 ; then
+ echo "CreateBackUps=1" >> $cfgfile
+fi
+# Get the options (is better to check for non default option, so in case of
+# problems the default will be set):
+db_get setedit/central_desktop_file
+if [ "$RET" = "Use a central desktop file" ] ; then
+ CentralDesktopFile=1
+else
+ CentralDesktopFile=0
+fi
+db_get setedit/tabs_for_indent
+if [ "$RET" = "Tabs" ] ; then
+ TabsForIndent=1
+else
+ TabsForIndent=0
+fi
+db_get setedit/create_backups
+if [ "$RET" = "No" ] ; then
+ CreateBackUps=0
+else
+ CreateBackUps=1
+fi
+cat $cfgfile | \
+ sed "s/CentralDesktopFile=./CentralDesktopFile=$CentralDesktopFile/" | \
+ sed "s/TabsForIndent=./TabsForIndent=$TabsForIndent/" | \
+ sed "s/CreateBackUps=./CreateBackUps=$CreateBackUps/" \
+ > $cfgfile.new
+mv $cfgfile.new $cfgfile
+
+
+#DEBHELPER#
diff --git a/setedit/debian/setedit.prerm b/setedit/debian/setedit.prerm
new file mode 100644
index 0000000..f66e802
--- /dev/null
+++ b/setedit/debian/setedit.prerm
@@ -0,0 +1,14 @@
+#!/bin/sh
+# The following isn't necessary for an upgrade...
+if [ $1 != "upgrade" ] ; then
+ update-alternatives --remove editor /usr/bin/setedit
+ install-info --quiet --remove setedit
+fi
+
+# We have to remove the installation configuration file in case of a purge:
+cfgfile="/usr/share/setedit/install.log"
+if [ "$1" = "purge" -a -e $cfgfile ]; then
+ rm -f $cfgfile
+fi
+
+#DEBHELPER#
diff --git a/setedit/debian/setedit.templates b/setedit/debian/setedit.templates
new file mode 100644
index 0000000..0a2abde
--- /dev/null
+++ b/setedit/debian/setedit.templates
@@ -0,0 +1,29 @@
+Template: setedit/central_desktop_file
+Type: select
+Description: Desktop file policy selection?
+ The editor stores configuration options in files called desktop files. These
+ files also store information about what files are opened and the size,
+ position, etc. of the windows.
+ .
+ You can have only one global file for this or one in each directory you use
+ the editor.
+Choices: Create a desktop file in each directory, Use a central desktop file
+Default: Create a desktop file in each directory
+
+Template: setedit/tabs_for_indent
+Type: select
+Description: Indent by spaces or tabs?
+ The editor is set by default to indent text using spaces. To configure the
+ editor to use tabs more than one option (in the editor, not here) must be
+ selected (which if you answer to use tabs here that will be done for you).
+Choices: Spaces, Tabs
+Default: Spaces
+
+Template: setedit/create_backups
+Type: select
+Description: Do you want to create backups of modified files?
+ Each time the editor stores a modified file to disk a backup file can be
+ created in case you want to revert the changes. This is specially useful
+ when you already exited the editor and hence undo option isn't available.
+Choices: Yes, No
+Default: Yes
diff --git a/setedit/debian/setedit.templates.es b/setedit/debian/setedit.templates.es
new file mode 100644
index 0000000..e1fe9d1
--- /dev/null
+++ b/setedit/debian/setedit.templates.es
@@ -0,0 +1,51 @@
+Template: setedit/central_desktop_file
+Type: select
+Choices: Create a desktop file in each directory, Use a central desktop file
+Choices-es: Crear archivos de escritorio en cada directorio, Usar un nico archivo de escritorio global
+Default: Create a desktop file in each directory
+Description: Desktop file policy selection?
+ The editor stores configuration options in files called desktop files.
+ These files also store information about what files are opened and the
+ size, position, etc. of the windows.
+ .
+ You can have only one global file for this or one in each directory you
+ use the editor.
+Description-es: Comportamiento de archivos de escritorio predeterminado?
+ El editor guarda las opciones de configuracin en archivos llamados
+ "archivos de escritorio".
+ stos archivos tambin guardan informacin acerca de cuales archivos estn
+ abiertos y el tamao, posicin, etc. de las ventanas.
+ .
+ Se puede tener un solo archivo global para sto o un archivo por cada
+ directorio donde se utilice el editor.
+
+Template: setedit/tabs_for_indent
+Type: select
+Choices: Spaces, Tabs
+Choices-es: Espacios, Tabuladores
+Default: Spaces
+Description: Indent by spaces or tabs?
+ The editor is set by default to indent text using spaces. To configure the
+ editor to use tabs more than one option (in the editor, not here) must be
+ selected (which if you answer to use tabs here that will be done for you).
+Description-es: Indentar por espacios o tabuladores?
+ El editor predeterminadamente viene seteado para indentar texto utilizando
+ espacios. Para configurar al editor para que use tabuladores, mas de una
+ opcin (en el editor, no aqu) tiene que setearse (que en el caso de que Ud.
+ responda que desea utilizar tabuladores aqu, ese seteo ser realizado para
+ Ud.).
+
+Template: setedit/create_backups
+Type: select
+Choices: Yes, No
+Choices-es: Si, No
+Default: Yes
+Description: Do you want to create backups of modified files?
+ Each time the editor stores a modified file to disk a backup file can be
+ created in case you want to revert the changes. This is specially useful
+ when you already exited the editor and hence undo option isn't available.
+Description-es: Desea que se creen respaldos de los archivos modificados?
+ Cada vez que el editor grabe un archivo modificado al disco, un archivo de
+ respaldo puede ser creado en caso de que se quiera revertir los cambios.
+ sto es especialmente til cuando Ud. sali del editor y entonces no tiene
+ posibilidad de activar la opcin de deshacer los cambios.
diff --git a/setedit/debian/watch.ex b/setedit/debian/watch.ex
new file mode 100644
index 0000000..491ef77
--- /dev/null
+++ b/setedit/debian/watch.ex
@@ -0,0 +1,5 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site Directory Pattern Version Script
+sunsite.unc.edu /pub/Linux/Incomingu setedit-*.tar.gz debian uupdate
diff --git a/setedit/distrib/INSTALL.LINUX b/setedit/distrib/INSTALL.LINUX
new file mode 100755
index 0000000..37582bd
--- /dev/null
+++ b/setedit/distrib/INSTALL.LINUX
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# This script should be used, to install the binaries from
+# the SETEdit binary distribution on your system.
+#
+# DO NOT USE IT TO INSTALL SETEdit AFTER A REBUILD FROM THE
+# SOURCES. FOR THIS RUN 'make install' INSTEAD, WITH AN
+# OPTIONALLY 'prefix=YOUR_WANTED_PREFIX' ARGUMENT, WHICH
+# DEFAULTS TO '@@pref@@'.
+#
+#
+# This script will install SETEdit on your system using
+# a prefix as the root for the installed programs. This
+# prefix is as default '@@pref@@' but you can change
+# it by giving this script on commandline your
+# wanted prefix. If you want for instance to install
+# SETEdit in '@@pref_alt@@' and not in '@@pref@@' run this script
+# like
+#
+# INSTALL prefix=@@pref_alt@@
+#
+# As already written in the docs, SETEdit will run and
+# look the best, if it is installed as a root setuid
+# program. (It will give up the root rights after opening
+# the connections to the screen and the keyboard).
+# The programs which need this is 'setedit'.
+#
+# For security reasons by default we DON'T
+# use the setuid permissions when installing SETEdit.
+# But you can tell this script to use it with the
+# option 'setuid=USER_ID' which installs the executable
+# as setuid program of user 'USER_ID'.
+#
+# If you have executed the script VCSA.SH, you can use
+# also the setgid=GROUP_ID' option, which installs
+# the executables as a setgid program of group 'GROUP_ID'.
+#
+# After installing SETEdit you will find all the files,
+# which are in the subdirectories of this directory
+# (where this script is) relative to the directory
+# wich is pointed to by the prefix.
+#
+# Note: I taked this script from RHIDE because I think is
+# good for the editor too. So say thanks to Robert for the
+# script and make file ;-).
+#
+
+. ./REMOVE_UNNEEDED
+
+# Because I'm not so familar with shell scripts, I use
+# a makefile, which I know how to write.
+
+@@make@@ -f INSTALL.MAK install $*
+
diff --git a/setedit/distrib/INSTALL.MAK b/setedit/distrib/INSTALL.MAK
new file mode 100644
index 0000000..33b2fa3
--- /dev/null
+++ b/setedit/distrib/INSTALL.MAK
@@ -0,0 +1,58 @@
+# Copyright (C) 1998-2002 by Salvador E. Tropea
+# Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details
+# This file is part of RHIDE.
+
+.SUFFIXES:
+
+setgid=
+setuid=
+SETGID=
+SETUID=
+SETMODE=0
+
+ifneq ($(setgid),)
+SETGID=-g $(setgid)
+SETMODE=2
+endif
+
+ifneq ($(setuid),)
+SETUID=-o $(setuid)
+SETMODE=4
+endif
+
+EXEC_MODE=-m $(SETMODE)755
+DATA_MODE=-m 0644
+
+
+INSTALL_BIN=install $(EXEC_MODE) $(SETUID) $(SETGID)
+INSTALL_DATA=install $(DATA_MODE)
+INSTALL_DIR=install -d -m 0755
+
+prefix=@@pref@@
+bin_dir=bin
+data_dir=share
+info_dir=info
+doc_dir=doc
+man_dir=man
+lib_dir=lib
+
+files:=$(shell find $(bin_dir) $(data_dir) $(info_dir) $(doc_dir) $(man_dir) $(lib_dir)\
+ ! -type d -print)
+ALL_FILES=$(addprefix $(prefix)/,$(files))
+
+$(prefix)/$(bin_dir)/%: $(bin_dir)/%
+ $(INSTALL_DIR) $(dir $@)
+ @@install_bin@@
+
+$(prefix)/$(bin_dir)/e:
+ # IVAN: Create a RELATIVE symlink:
+ cd $(prefix)/bin; ln -s setedit e
+
+$(prefix)/share/setedit/install.log:
+ export PREFIX=$(prefix); ./ask_config.sh
+
+$(prefix)/%: %
+ $(INSTALL_DIR) $(dir $@)
+ @@install_data@@
+
+all install: $(ALL_FILES) $(prefix)/$(bin_dir)/e
diff --git a/setedit/distrib/REMOVE_UNNEEDED b/setedit/distrib/REMOVE_UNNEEDED
new file mode 100755
index 0000000..d859478
--- /dev/null
+++ b/setedit/distrib/REMOVE_UNNEEDED
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# It removes files from previous versions not needed anymore
+#
+rm -f /usr/info/editor.inf
+rm -f /usr/info/infview.inf
+rm -f /usr/info/sdg.inf
+rm -f /usr/info/editor.info
+rm -f /usr/info/infview.info
+rm -f /usr/info/sdg.info
+rm -f /usr/info/editor.info.gz
+rm -f /usr/local/info/editor.inf
+rm -f /usr/local/info/infview.inf
+rm -f /usr/local/info/sdg.inf
+rm -f /usr/local/info/editor.info
+rm -f /usr/local/info/infview.info
+rm -f /usr/local/info/sdg.info
+rm -f /usr/local/info/editor.info.gz
+rm -f /usr/doc/setedit/*.txt
+rm -f /usr/local/doc/setedit/*.txt
+
+
diff --git a/setedit/distrib/VCSA.SH b/setedit/distrib/VCSA.SH
new file mode 100755
index 0000000..3ce0e72
--- /dev/null
+++ b/setedit/distrib/VCSA.SH
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# This script can be used to create a new group
+# called 'vcsa' and change the goup owner of the
+# vcsa devices to 'vcsa' and setting rw permission
+# to that devices for the group vcsa.
+#
+# You can use this, if you don't want to have RHIDE or setedit
+# and it's related programs to be a root setuid program.
+# In that case you can make them a vcsa setgid program.
+
+# create the new group
+groupadd vcsa
+
+for i in /dev/vcsa[1-9] /dev/vcsa[1-9][0-9]
+do
+ echo "chgrp vcsa $i; chmod 660 $i"
+ chgrp vcsa $i; chmod 660 $i
+done \ No newline at end of file
diff --git a/setedit/distrib/arranca.bat b/setedit/distrib/arranca.bat
new file mode 100644
index 0000000..d2da6bd
--- /dev/null
+++ b/setedit/distrib/arranca.bat
@@ -0,0 +1,15 @@
+@Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+@Rem see copyrigh file for details
+@
+@Echo Off
+setedit %1 %2 %3 %4 %5 %6 %7 %8 %9
+if not errorlevel 255 goto end
+@Echo Error!, please look in the file %SET_FILES%/erXXXXXX,
+@Echo you can recover unsaved data from this file. Please send the file
+@Echo to salvador@inti.gov.ar
+@Echo Additionally try to explain me what actions triggered this error.
+@Echo .
+@Echo Note: The files aren't deleted and XXXXXX are letters to create a
+@Echo unique file.
+pause
+:end
diff --git a/setedit/distrib/ask_config.sh b/setedit/distrib/ask_config.sh
new file mode 100755
index 0000000..813686b
--- /dev/null
+++ b/setedit/distrib/ask_config.sh
@@ -0,0 +1,135 @@
+#!/bin/sh
+# Copyright (c) 2002 by Ivn Baldo
+#
+# This script should be used to install the binaries from
+# the SETEdit binary distribution on your system if you
+# want to select default global options for the editor.
+#
+# FIXME: it uses my (Ivn) indentation style to code it faster, but if this
+# file is accepted and Salvador want's to change the indentation, I will
+# do the work to reindent it upon request.
+
+# Default options:
+CentralDesktopFile=1
+TabsForIndent=1
+CreateBackUps=2
+
+# Configuration file:
+cfgFile=$PREFIX/share/setedit/install.log
+
+echo "SETEdit UNIX installation script"
+echo "================================"
+echo
+
+# $1 is the question description.
+# $2 is the number of options.
+# $3 is the default option.
+# Returns the option number selected in the variable pointed by the $4 parameter.
+function ask()
+{
+ local desc=$1
+ local numopt=$2
+ local defopt=$3
+ while true; do
+ echo "$desc"
+ echo
+ read -p "Choose an option [$defopt]: " selopt
+ if [ -z "$selopt" ]; then
+ echo "Using default: $defopt."
+ selopt=$defopt
+ fi
+ if ((selopt < 1)) || ((selopt > numopt)); then
+ echo "Please enter a value between 1 and $numopt inclusive."
+ else
+ eval $4=$selopt
+ return
+ fi
+ done
+}
+
+qsep="
+
+--------------------------------------------------------------------------------"
+
+function do_questions()
+{
+ ask "
+The editor stores configuration options in files called desktop files. These
+files also store information about what files are opened and the size,
+position, etc. of the windows. You can have only one global file for this or
+one in each directory you use the editor. Which option do you prefer?
+1) A desktop file in each directory.
+2) One central desktop file." 2 $CentralDesktopFile CentralDesktopFile
+ echo "$qsep"
+ ask "
+The editor is set by default to indent text using spaces. To configure the
+editor to use tabs more than one option must be selected. What do you want to
+use for indentation?
+1) Spaces.
+2) Tabs." 2 $TabsForIndent TabsForIndent
+ echo "$qsep"
+ ask "
+Each time the editor stores a modified file to disk a backup file can be
+created in case you want to revert the changes. This is specially useful when
+you alredy exited the editor and hence undo option isn't available. Do you
+want to create backup files?
+1) No.
+2) Yes, create backup files." 2 $CreateBackUps CreateBackUps
+}
+
+# Returns true if confirmed, false if we should ask again.
+function confirm_questions()
+{
+ local str="
+You selected:
+
+"
+ [ "$CentralDesktopFile" = "1" ] && str="${str}A] Save one desktop file in each directory.
+"
+ [ "$CentralDesktopFile" = "2" ] && str="${str}A] Save only one central desktop file.
+"
+
+ [ "$TabsForIndent" = "1" ] && str="${str}B] Use spaces for indentation.
+"
+ [ "$TabsForIndent" = "2" ] && str="${str}B] Use tabs for indentation.
+"
+
+ [ "$CreateBackUps" = "1" ] && str="${str}C] Do not create backup files.
+"
+ [ "$CreateBackUps" = "2" ] && str="${str}C] Create backup files.
+"
+ str="${str}
+1) This is correct go on and install.
+2) I changed my mind, let me change the options."
+ ask "$str" 2 1 ready
+
+ return $((ready - 1))
+}
+
+while true; do
+ do_questions
+ echo "$qsep"
+ if confirm_questions; then
+ break
+ else
+ echo "$qsep"
+ fi
+done
+
+# Save the configuration file, first of all, decrease by one the values of the options, since
+# thats the internal format used:
+CentralDesktopFile=$((CentralDesktopFile - 1))
+TabsForIndent=$((TabsForIndent - 1))
+CreateBackUps=$((CreateBackUps - 1))
+
+echo "#
+# Default Installation Options file, created during installation.
+# These options will be used when no desktop file can be loaded.
+#
+[Install]
+CentralDesktopFile=$CentralDesktopFile
+TabsForIndent=$TabsForIndent
+CreateBackUps=$CreateBackUps
+" > $cfgFile
+
+
diff --git a/setedit/distrib/calltpc7.zip b/setedit/distrib/calltpc7.zip
new file mode 100644
index 0000000..9eb14ef
--- /dev/null
+++ b/setedit/distrib/calltpc7.zip
Binary files differ
diff --git a/setedit/distrib/default.map b/setedit/distrib/default.map
new file mode 100644
index 0000000..e1e34ab
--- /dev/null
+++ b/setedit/distrib/default.map
@@ -0,0 +1,213 @@
+# us.map
+keymaps 0-2,4-6,8-9,12
+alt_is_meta
+keycode 1 = Escape Escape
+keycode 2 = one exclam
+keycode 3 = two at at nul nul
+keycode 4 = three numbersign
+ control keycode 4 = Escape
+keycode 5 = four dollar dollar Control_backslash
+keycode 6 = five percent
+ control keycode 6 = Control_bracketright
+keycode 7 = six asciicircum
+ control keycode 7 = Control_asciicircum
+keycode 8 = seven ampersand braceleft Control_underscore
+keycode 9 = eight asterisk bracketleft Delete
+keycode 10 = nine parenleft bracketright
+keycode 11 = zero parenright braceright
+keycode 12 = minus underscore backslash Control_underscore Control_underscore
+keycode 13 = equal plus
+keycode 14 = Delete Delete
+ control keycode 14 = Delete
+keycode 15 = Tab Tab
+keycode 16 = q
+keycode 17 = w
+keycode 18 = e
+keycode 19 = r
+keycode 20 = t
+keycode 21 = y
+keycode 22 = u
+keycode 23 = i
+keycode 24 = o
+keycode 25 = p
+keycode 26 = bracketleft braceleft
+ control keycode 26 = Escape
+keycode 27 = bracketright braceright asciitilde Control_bracketright
+keycode 28 = Return
+ alt keycode 28 = Meta_Control_m
+keycode 29 = Control
+keycode 30 = a
+keycode 31 = s
+keycode 32 = d
+keycode 33 = f
+keycode 34 = g
+keycode 35 = h
+keycode 36 = j
+keycode 37 = k
+keycode 38 = l
+keycode 39 = semicolon colon
+keycode 40 = apostrophe quotedbl
+ control keycode 40 = Control_g
+keycode 41 = grave asciitilde
+ control keycode 41 = nul
+keycode 42 = Shift
+keycode 43 = backslash bar
+ control keycode 43 = Control_backslash
+keycode 44 = z
+keycode 45 = x
+keycode 46 = c
+keycode 47 = v
+keycode 48 = b
+keycode 49 = n
+keycode 50 = m
+keycode 51 = comma less
+keycode 52 = period greater
+keycode 53 = slash question
+ control keycode 53 = Delete
+keycode 54 = Shift
+keycode 55 = KP_Multiply
+keycode 56 = Alt
+keycode 57 = space space
+ control keycode 57 = space
+keycode 58 = Caps_Lock
+keycode 59 = F1 F11 Console_13 F1
+ alt keycode 59 = Console_1
+ control alt keycode 59 = Console_1
+keycode 60 = F2 F12 Console_14 F2
+ alt keycode 60 = Console_2
+ control alt keycode 60 = Console_2
+keycode 61 = F3 F13 Console_15 F3
+ alt keycode 61 = Console_3
+ control alt keycode 61 = Console_3
+keycode 62 = F4 F14 Console_16 F4
+ alt keycode 62 = Console_4
+ control alt keycode 62 = Console_4
+keycode 63 = F5 F15 Console_17 F5
+ alt keycode 63 = Console_5
+ control alt keycode 63 = Console_5
+keycode 64 = F6 F16 Console_18 F6
+ alt keycode 64 = Console_6
+ control alt keycode 64 = Console_6
+keycode 65 = F7 F17 Console_19 F7
+ alt keycode 65 = Console_7
+ control alt keycode 65 = Console_7
+keycode 66 = F8 F18 Console_20 F8
+ alt keycode 66 = Console_8
+ control alt keycode 66 = Console_8
+keycode 67 = F9 F19 Console_21 F9
+ alt keycode 67 = Console_9
+ control alt keycode 67 = Console_9
+keycode 68 = F10 F20 Console_22 F10
+ alt keycode 68 = Console_10
+ control alt keycode 68 = Console_10
+keycode 69 = Num_Lock
+keycode 70 = Scroll_Lock Show_Memory Show_Registers Show_State
+ alt keycode 70 = Scroll_Lock
+keycode 71 = KP_7
+ alt keycode 71 = Ascii_7
+keycode 72 = KP_8
+ alt keycode 72 = Ascii_8
+keycode 73 = KP_9
+ alt keycode 73 = Ascii_9
+keycode 74 = KP_Subtract
+keycode 75 = KP_4
+ alt keycode 75 = Ascii_4
+keycode 76 = KP_5
+ alt keycode 76 = Ascii_5
+keycode 77 = KP_6
+ alt keycode 77 = Ascii_6
+keycode 78 = KP_Add
+keycode 79 = KP_1
+ alt keycode 79 = Ascii_1
+keycode 80 = KP_2
+ alt keycode 80 = Ascii_2
+keycode 81 = KP_3
+ alt keycode 81 = Ascii_3
+keycode 82 = KP_0
+ alt keycode 82 = Ascii_0
+keycode 83 = KP_Period
+ altgr control keycode 83 = Boot
+ control alt keycode 83 = Boot
+keycode 84 = Last_Console
+keycode 85 =
+keycode 86 = less greater bar
+keycode 87 = F11 F11 Console_23 F11
+ alt keycode 87 = Console_11
+ control alt keycode 87 = Console_11
+keycode 88 = F12 F12 Console_24 F12
+ alt keycode 88 = Console_12
+ control alt keycode 88 = Console_12
+keycode 89 =
+keycode 90 =
+keycode 91 =
+keycode 92 =
+keycode 93 =
+keycode 94 =
+keycode 95 =
+keycode 96 = KP_Enter
+keycode 97 = Control
+keycode 98 = KP_Divide
+keycode 99 = Control_backslash
+ control keycode 99 = Control_backslash
+keycode 100 = AltGr
+keycode 101 = Break
+keycode 102 = Find
+keycode 103 = Up
+keycode 104 = Prior
+ shift keycode 104 = Prior
+ alt shift keycode 104 = Scroll_Backward
+keycode 105 = Left
+ alt keycode 105 = Decr_Console
+keycode 106 = Right
+ alt keycode 106 = Incr_Console
+keycode 107 = Select
+keycode 108 = Down
+keycode 109 = Next
+ shift keycode 109 = Next
+ alt shift keycode 109 = Scroll_Forward
+keycode 110 = Insert
+keycode 111 = Remove
+ altgr control keycode 111 = Boot
+ control alt keycode 111 = Boot
+keycode 112 =
+keycode 113 =
+keycode 114 =
+keycode 115 =
+keycode 116 =
+keycode 117 =
+keycode 118 =
+keycode 119 =
+keycode 120 =
+keycode 121 =
+keycode 122 =
+keycode 123 =
+keycode 124 =
+keycode 125 =
+keycode 126 =
+keycode 127 =
+string F1 = "\033[[A"
+string F2 = "\033[[B"
+string F3 = "\033[[C"
+string F4 = "\033[[D"
+string F5 = "\033[[E"
+string F6 = "\033[17~"
+string F7 = "\033[18~"
+string F8 = "\033[19~"
+string F9 = "\033[20~"
+string F10 = "\033[21~"
+string F11 = "\033[23~"
+string F12 = "\033[24~"
+string F13 = "\033[25~"
+string F14 = "\033[26~"
+string F15 = "\033[28~"
+string F16 = "\033[29~"
+string F17 = "\033[31~"
+string F18 = "\033[32~"
+string F19 = "\033[33~"
+string F20 = "\033[34~"
+string Find = "\033[1~"
+string Insert = "\033[2~"
+string Remove = "\033[3~"
+string Select = "\033[4~"
+string Prior = "\033[5~"
+string Next = "\033[6~"
diff --git a/setedit/distrib/distrib1.txt b/setedit/distrib/distrib1.txt
new file mode 100644
index 0000000..5dd5f2b
--- /dev/null
+++ b/setedit/distrib/distrib1.txt
@@ -0,0 +1,577 @@
+
+
+ SET's editor "@@relname@@" release
+ v@@v@@ rev. @@rev@@
+ by SET
+
+ That's the official distribution of SET's editor v@@v@@
+ The editor is Copyrighted by Salvador Eduardo Tropea <set@users.sf.net>.
+(c) 1996-2004 and distributed under the GPL license.
+ It's free and you don't need to pay for it. Any kind of donations are
+accepted ;-).
+
+INDEX:
+
+0. IMPORTANT (modifications and fixes in this release and the previous)
+1. REQUIREMENTS
+2. INSTALL
+3. MORE INFO
+4. MP3 player
+5. EXAMPLES (SDG, and others)
+6. LEGAL ISSUE
+7. KEYBOARD PREFERENCES
+8. KEYBOARD EXTENDER [DOS version only]
+9. KEYBOARD FEATURES UNDER X [Linux version only]
+10. DOWNLOAD
+11. MAILING LIST
+12. DONATIONS
+13. THANKS TO
+
+
+
+0. IMPORTANT:
+
+ Starting with "Glaciar Perito Moreno I" release the editor can be used as
+a frontend for GDB on Linux systems. It means you can use SETEdit as
+debugger.
+ Starting with "Iguazu II" release the editor changed the mechanism used to
+select a window. In previous versions the Alt+window_number was hardcoded in
+Turbo Vision library. Now this is no longer handled by TV. It have some
+advantages: you can change the key assignment and you can bind keys to select
+as many windows as you want. But it also means you have to have some binding
+in your menu files, if you have a custom menu file please consult the one
+shipped with the editor and copy the new entries in the Window menu.
+ Changes in v@@v@@ (for more details read the change.log file):
+[taking last stable release (0.5.2) as reference]
+[66 new things and 40 fixes]
+
+New [66 things]:
+
++ Debug [12] --> NEW Functionality for *Linux* <--
+
+* Dialogs to configure the debug mode (local, remote and running process), the
+command line options for the program, gdb binary, xterm binary, messages
+displayed, etc.
+* Breakpoints, simple ones and advanced options including conditional
+breakpoints, breakpoints at functions, ignore count, etc.
+* Watchpoints, they are data breakpoints.
+* Options to run, continue, step over, trace into, run upto return, etc.
+* Options to stop and kill the program.
+* Thread selection.
+* Evaluate and modify data.
+* Data Window and Satck to browse the memory (very complete and with its own
+menu).
+* Data Watches, like then ones in RHIDE and also with scope.
+* Data Inspectors, used to analyze complex data structures.
+* Disassembler Window, including syntax highlight and allowing to modify the
+registers.
+* Calling stack, with functionality to browse the call chain.
+
++ Various [15]
+
+* Alternative project sorting mode.
+* Commands to select any window, now Alt+Key is no longer hardcoded.
+* Sections in the docs to help finding what you need.
+* When asking for word completion if the word at the left looks like Class::
+then the editor looks for the class and offers the members.
+* Enhacements to the "Paste Emacs Mode" and the code to search Emacs
+variables.
+* Now if you don't specify any path to "search files under cursor" the editor
+tries to automagically fills this list using the output of cpp.
+* If the editor fails to find the file under cursor now it also looks for it
+in the project and the current directory.
+* Some rudimentary $(VARIABLE) expansion to the "File under cursor" files
+list.
+* A button to recompute window numbers in the list of windows.
+* "File open" dialogs remmembers its size and position.
+* Non interactive versions of the cmcExpandAllTabs and cmcCompactBuffer
+commands to be used from sLisp.
+* Two new commands: cmeGPushCursorPos and cmeGPopCursorPos. They are "global
+push/pop cursor pos". So they also remmember the file.
+* Options to zoom the editor windows when inserted in the desktop.
+* An option to regenerate the central tags file. Used to workaround ctags bug.
+* Modified behavior of the paste operation in input lines: Now the text is
+pasted without destroying the previous value (unless it is selected).
+
++ Menu files [4]
+
+* Context sensitive menues. Also extended the .smn file language to create
+such a thing. Currently used only for the data window and the help.
+* The conditionals in menu files can use the TV driver, CPU, OS, etc. for
+conditions.
+* More variables to check: MP3, PCRE, BZIP2, MIXER and UNIX.
+* $define and $undef and its expansion.
+
++ Compilation [2]
+
+* The posibility to override the "install" command in makefiles.
+* Unified compilation mechanism for BC++.
+
++ sLisp [9]
+
+* FindString, FindAgain, ReplaceString and ReplaceAgain for searches.
+* SelectWindowNumber used to change the focused window.
+* GetCurWindowNumber and GetMaxWindowNumber.
+* You can bind small portions of sLisp code to keys and menu entries.
+* KeyBindings and BindKey commands. With them you can change key bindings
+from sLisp.
+* prex to perform Perl regular expressions searches.
+* GetSystemInfo to know the current OS, TV driver, CPU, etc.
+* More macros examples.
+* Now you can send cme* commands.
+
++ Syntax highlight and pmacros [8]
+
+* Flat Assembler syntax.
+* Ruby syntax.
+* SPARC assembler syntax.
+* WML syntax and pmacros.
+* Errors parser for Perl.
+* C,H and CPP as valid C extensions as valid for C/C++.
+* HTML extensions as valid for HTML.
+* vbe and vst as VHDL extensions.
+
++ Cosmetic [16]
+
+* Project windows are "closed" (hided) when pressing ESC.
+* Windows are opened "zoomed" when the project window isn't visible.
+* When automatically opening a project item now its opened using the relative
+path.
+* Select the closest word when using double click and not the next.
+* History to the "arbitrary indent" and "run command" input lines.
+* To lock the screen while doing a search & replace operation to avoid
+"flashing" when doing a lot of S&R operations.
+* Modified: "Do not purge spaces" option to be "Keep trailing whitespace"
+that's more descriptive.
+* A new color scheme called "Classic Borland"
+* A new color scheme called "Midnight Commander"
+* If the Ctrl+Enter fails to find the file under cursor now that's informed
+in the "status line" of the current editor.
+* Most lists (like functions list) now centers the focused item when a match
+is selected.
+* OS/OS flavor,CPU,Compiler/Compiler flavor and Driver to the about box.
+* Configuration options to disable the calculator and calendar.
+* Now the meassure command reports the result in the status line.
+* A beep when "Run a program" finishes. Option to disable.
+* Busy indicator while we load the tags from disk.
+
+
+Fixed [40 things]:
+
++ Fatal [4]
+
+* The "Jump" button in the main window of the class browser.
+* Undo count for the first undo wasn't initialized. Unknown consequence.
+* Corrupted MP3 files could produce a crash.
+* Abort when doing word completion and the starting word was "bigger" than
+the last tag in the list.
+
++ Not fatal [17]
+
+* HTML export: missing body tag.
+* Errors in the conditionals parser for menu files.
+* Undo error when a character replaced a tab (overwrite enabled) and the
+cursor was inside the tab (not at the beggining).
+* Wrong match pair when the cursor was in the middle of a tab and the next
+character matched a pair (highlight in the middle of the tab).
+* No match pair after deleting some text and the cursor goes to a symbol.
+* When searching outside comments and the match was found in the first column
+of a line after a comment it was ignored.
+* When starting a project using a different window size the project window
+could get wrong size and even become outside the screen.
+* When aborting an overwrite (in save as) the name of the window was changed.
+* When pasting using the OS clipboard and the cursor was moved to the end of
+the selection it could go out of screen which is quite annoying.
+* When copying something from the calculator and the paste wasn't enabled
+before entering the calculator then you needed to at least move the cursor
+before you could paste.
+* Use of unitialized undo counter in some rectangular selection operations.
+* The heuristic C/C++ parser to support list of exceptions (function
+throw(...) {body}).
+* Some details in the heuristic C++ functions searcher. They address problems
+with the const and throw() attributes.
+* Various memory leaks.
+* "New" buffers shouldn't be added to the list of closed windows when closed.
+It generated a read out of bounds and a write of unitialized data to disk.
+* The menu files uses nested preprocessor directives but it wasn't supported.
+* cmcCutClipWin command not dis/enabled when selecting text.
+
++ Compilation [13]
+
+* Cygwin: Collision between strndup and calculator parser.
+* Some gcc versions needs explicit use of libstdc++ to link C++ and
+internac/getcolors didn't have it.
+* Removed two comments containing non-ASCII chars.
+* Various gcc 3.x compilation issues (including gcc 3.4.1 support).
+* Problems with newer versions of makeinfo.
+* The memcpy usage to be more portable. It worked for all supported targets,
+but now should also work for unsupported targets. Same for malloc/new/new[]
+v.s. free/delete/delete[] calls.
+* Missing va_end and abuse of va_list type. It gave problems for Linux PPC
+targets.
+* Use of "g++" in favor of "gcc -lstdc++".
+* strstr and strchr are declared different in C++ standard (compared to C
+standard). Needed to avoid BC++ compilation problems.
+* Various MSVC compilation issues.
+* --cxx-flags flag was reported as --cpp-flags in the help. Now both are
+valid.
+* Cygwin can execute the "make install" target, but it installed binaries
+without .exe extension.
+* Detection of pcre header for systems where the header is in pcre/pcre.h.
+Red Hat is an example.
+
++ Linux [3]
+
+* Code page problems when mixing console use and remote XTerm use.
+* RPM prereq for /sbin/install-info.
+* Problems to create the rpms using Fedora Core 2.
+
++ Cosmetic [3]
+
+* Some drawing variables not initialized. Could make the row/col cursor
+appear until a new redraw.
+* Now the cmc*Win (Copy,Cut,Paste) commands are called cmc*OS to reflect
+their real use. The old names remains as aliases.
+* The list for word completion had a wrong vertical size when we had repeated
+tags in the list to choose. Only one was visible but the size was computed
+counting the repetitions.
+
+
+ For information about older releases and more read the change.log file.
+
+Note for DOS users:
+ %DJDIR% == The content of the enviroment variable %DJDIR%, that's the
+ place where you installed djgpp. You don't need to set this variable,
+ setting DJGPP is enough.
+
+
+
+1. REQUIREMENTS:
+
+* PC 386 compatible or superior computer.
+* 2 Mb of memory or more.
+* 2.4 Mb of free disk during installation and about 1.5 Mb once installed.
+* DOS version 5.0 or posterior or any compatible OS (Win '9x, Win 3.1, OS/2,
+MS-DOS, etc.).
+Note: A native windows version is available but is just for testing.
+or
+* Linux with ELF support.
+or
+* FreeBSD, QNX and Solaris are supported but you'll need to compile from
+sources.
+* A VGA card.
+* DJGPP users normally have it.
+
+
+
+2. INSTALL:
+
+ *Important* To use the powered grep you need the grep program installed in
+your system. To use the man page viewer you need the man program installed in
+your system. Both are found in all Linux systems but not in all DOS systems.
+ Starting with v0.4.26 the DOS version of the editor is distributed with an
+installer, if you have it just run install.exe and follow the instructions.
+If you only have a .zip or .tar.gz file that contains a lot of files continue
+reading this chapter.
+ The following cases are explained:
+
+A) Installing in DOS for djgpp users.
+B) Installing in DOS for non-djgpp users.
+C) Installing in Linux.
+
+A) Installing in DOS for djgpp users:
+1) Uncompress the file over your djgpp installation in the same way you did
+ with the rest of packages.
+2) If you installed the editor preserving the directory structure you
+ won't need to do it so the following is usually optional:
+ Add the following to your autoexec.bat:
+
+ SET SET_FILES=c:/djgpp/share/setedit
+
+ Replacing c:/djgpp with the place where you installed djgpp.
+ IMPORTANT!! Windows NT (4.0, 2k, XP, etc.) is case sensitive for
+ environment variables, avoid defining things like Set_Files.
+
+B) Installing in DOS for non-djgpp users:
+ Attention: If you don't use the installer you must have some basic DOS
+ knowledge, including: how to set an environment variable, modify your
+ PATH and what is autoexec.bat. If you don't know it use the installer or
+ ask a friend.
+1) Uncompress the file in any directory you like preserving the directory
+ structure. Examples:
+
+ unzip edi0426b.zip
+ or
+ pkunzip -d edi0426b.zip
+ or
+ using WinZip (be careful to preserve the directories)
+
+ For the other sections I'll give examples assuming you uncompressed the
+ files in c:/setedit.
+2) If you installed the editor preserving the directory structure you
+ won't need to do it so the following is usually optional:
+ Add the following to your autoexec.bat:
+
+ SET SET_FILES=c:/setedit/share/setedit
+
+ IMPORTANT!! Windows NT (4.0, 2k, XP, etc.) is case sensitive for
+ environment variables, avoid defining things like Set_Files.
+
+ Replacing c:/setedit by the place where you uncompressed the editor.
+3) Add the c:\setedit\bin (don't forget to replace c:/setedit by the name
+ you used in 1) to the PATH in autoexec.bat.
+ Example:
+
+ PATH=.... <= Line already existent in your autoexec.bat
+ SET PATH=c:\setedit\bin;%PATH%
+
+C) Installing in Linux:
+1) Uncompress the files in /tmp and run ./INSTALL_LINUX. If you want to setup
+ the destination directory read the INSTALL_LINUX script. You'll need the
+ make tool to run it, that's usually installed.
+ Also: the script contains useful information about access rights needed
+ to run the editor.
+2) If you installed the editor in /usr or /usr/local the following is
+ optional:
+
+ Define the following environment variable (bash syntax):
+
+ export SET_FILES="/usr/share/setedit"
+
+ Replacing /usr by the prefix you used, example: prefix /opt then the
+ editor is in /opt/bin and you must define:
+
+ export SET_FILES="/opt/share/setedit"
+3) Be sure the directory where setedit binary file is located is included in
+ your PATH environment variable.
+
+Note for bash users: the file where (2) and (3) should be defined is normally
+called .bash_profile or .bashrc in your home directory.
+
+
+
+3. MORE INFO:
+
+ From v0.4.0 the editor doesn't need external files to configure the
+keyboard so forget about the old xxx.txt files used in RHIDE 1.4.
+ You will need to customize the colors from Various|Options|Colors, the ones
+used by default aren't pretty.
+ To save the default colors and settings go to the %SET_FILES% (examples:
+c:/setedit/share/setedit, c:/djgpp/share/setedir, /usr/share/setedit)
+directory, start the editor and set all the options (colors and settings
+with Alt-G). Just exit and the editor will save a file called tcedit.dst.
+Each time you start the editor in a directory where there isn't any *.dst
+file the editor will load this default. Linux users that doesn't have write
+access to the /usr tree can create a default in their home directory. In
+this case the file should be created in ~/.setedit directory.
+ Users that want to have only one tcedit.dst file, and not one in each
+directory, must configure it in Tool&Ops|Options|Editor General.
+ If you are annoyed with the back-up files and .dst files created by the
+editor in all the places just exit with Alt+Q and the editor will delete
+these files. Also see the options available in Tool&Ops|Options|Editor
+General.
+
+
+
+4. MP3: [Only in the DOS, Linux and Solaris versions]
+
+ Linux users doesn't need to configure any special thing.
+ DOS users:
+ The editor supports the Allegro mixing routines with 16 bits of resolution
+(I contributed it to the Allegro project because I needed it for the editor).
+ If you want to enable it create a file called allegro.cfg with the following
+contents:
+
+-------- cut here --------
+[sound]
+sb_freq = 45454
+quality = 1
+-------- cut here --------
+
+ Put the file in the same directory where the editor is located.
+ It will enable the 16 bits routines and mix with the maximun mixing
+frequency.
+ Enable it only if you are a fanatic because it will eat your CPU ;-).
+
+
+
+5. EXAMPLES:
+
+ SDG Example:
+
+ To test the SDG tool you can uncompress the example.zip file in an empty
+directory. Then call the editor with e and follow these steps:
+
+1) Select the menu Project|Open and type test and enter. You'll get a new
+project.
+2) Press Insert and select the three .cc files pressing enter in each one,
+the press ESC. Now you have the project filled.
+3) Select Various|Options|SDG Options, and take a look to the selected
+options, if you have SET_FILES right all must be Ok, so just press ENTER.
+4) Press F9. The message window will appear with some messages.
+5) Open the file out.html, it was generated when you pressed F9 (look the
+syntax highlight).
+
+ Load the file with any web browser and look the results. If you like it
+for your code read the sdg.inf file (from the editor, if you don't know how
+press F1 and then Ctrl-H to learn more about the help system).
+
+ sLisp macros examples:
+
+ In addition to the macros included in macros.slp (you can access these
+macros from the Macros|Choose menu option) I included another, more simple,
+examples in a file called examples.slp. It is located in the same directory
+as the rest of the configuration files (/usr/share/setedit,
+c:/djgpp/share/setedit, etc.).
+
+ Turbo Pascal 7, also for other non-gnu compilers:
+
+ Andreas Leidner <leidner@gmx.net> contributed some wrapper to call TPC7
+from the editor and convert the errors into the FSF format so you can jump to
+the function that originated the error from inside of the editor. This
+examples is included in the directory where other .zip files are located
+(contrib/setedit.bin or texts) and is called calltpc7.zip.
+
+
+
+6. LEGAL ISSUE:
+
+ The editor is free software. It may be used or distributed in any manner
+you wish, as long as you do not violate the GPL license. You can't remove
+any copyrigth included in the editor and you can't distribute it without any
+of the original files. You will also distribute the sources if you distribute
+the binaries. The GPL license is included in the package so read it before
+distributing the editor.
+
+ The editor comes with ABSOLUTELY NO WARRANTY; excluding any and all implied
+warranties, including warranties of merchantability and fitness for a
+particular purpose. There is no warranty or representation, either express
+or implied, with respect to this program, its quality, performance,
+merchantability, or fitness for a particular purpose. The entire risk
+of using this program is with you. There will be no liability for special,
+incidental, or consequential damages arising out of or resulting from the use
+or modification of this program.
+
+
+
+7. KEYBOARD PREFERENCES
+
+ The keyboard is fully configurable from the Tool&Ops|Options|Keyboard|Key
+assignment menu option. But this configures the keys used only by the editor
+windows. The menu keys are defined in a text file with the .smn extension.
+The file loaded by the editor for this purpose is called menubind.smn. An
+example of how you can alter it to change some stuff is provided and called
+redmond.smn, I think you can guess what's the effect of this menu
+configuration ;-).
+ If you used the installer one of the options offered was about changing
+redmond.smn by menubind.smn.
+
+
+
+8. KEYBOARD EXTENDER [DOS version only]
+
+ In the contrib/setedit directory you'll find a small program called kextend
+that's a very simple TSR (only needs 432 bytes of memory in my system) to
+extend the BIOS functionallity.
+
+
+
+9. KEYBOARD FEATURES UNDER X [Linux/UNIX version only]
+
+ Currently the editor runs as a native X11 application. It means the
+keyboard is fully supported, even the most bizarre key combinations works.
+ Note that some Window Managers reserves some key combinations that are used
+by the editor. I recommend Enlightenment as W.M. it uses complex keyboard
+combinations and is also configurable so you can change them to avoid
+interference.
+ The support for XTerm and Eterm is also very good. I recommend using XTerm
+from XFree86 4.x project. So I recommend using it for remote conections,
+you'll get much better results making telnet to a remote machine using XTerm
+than using the Linux console. If you want to get the best results download
+the Turbo Vision sources (http://tvision.sf.net) and look the examples found
+in the examples directory, they show how to configure XTerm and Eterm to get
+even better results.
+
+
+
+10. DOWNLOAD:
+
+ All the OSs:
+ Stable and beta releases, mailing list, cvs, etc.:
+ http://setedit.sourceforge.net/
+
+ DOS: (only stable releases)
+ Any Simtelnet mirror, example:
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/edi*.zip
+
+ Linux:
+ The Linux tarballs can be found in Source Forge.
+
+ Debian GNU/Linux: (only stable releases)
+ A repository is maintained by Ivan in Source Forge.
+ To access the repository, just add the following line to your
+/etc/apt/sources.list:
+
+deb http://setedit.sourceforge.net/debian woody main
+
+ That's for the Woody version of Debian, you should substitute "woody" by the
+name of your distribution or by the synonym "stable".
+
+ Note that Ivan will upload stable editor releases. For betas look in the
+Source Forge pages.
+
+
+
+11. MAILING LIST
+
+ To subscribe visit:
+ http://lists.sourceforge.net/mailman/listinfo/setedit-users
+ I moved the old list at topica to Source Forge.
+
+
+
+12. DONATIONS:
+
+ If you really like the editor and/or the SET's Documentation Generator
+included on it you can send me anything as feedback.
+ If you want to send money I'll be happy, but if you don't have it and
+want to show your gratitude you can send me a postal card from your city
+or some of the things I collect (train tickets, cigarette envelopes and
+boxes, stamps, old money and coins).
+ For more information about how to contact me press F1 in the editor, select
+"Introduction" and then select "About the author".
+
+
+
+13. THANKS TO (random order):
+
+ Ivan Baldo: My Debian packager and friend.
+ Molnar Laszlo: He reported a lot of the fixed bugs and sugested a lot of
+things that I added in the first releases of the 0.4.x serie.
+ Grzegorz Adam Hankiewicz: Another tester and source of bug reports and
+good ideas to add to the editor.
+ Jos Angel Sanchez Caso: For contributing a lot of code to make TV
+working in other UNIX platforms, not just Linux. I didn't yet incorporated
+all the things he sent me.
+ Vadim Belodorov: For contributing the first port of TV to Win32.
+ Anatoli Soltan: For porting to Win32 using BC++.
+ Alexander Bokovoy: For the information on the russian code pages.
+ Marek Habersack & Martijn Versteegh: For sugestions about the mode that
+doesn't create .dst files in all the dirs.
+ Robert Hoehne: For starting RHIDE project and porting TV to djgpp, it
+made me start this project.
+ The FSF and GNU people for such a good tools.
+ DJ Delorie and colaborators for porting it to DOS.
+ Shawn Hargreaves: For Allegro, the best gaming library. I use the sound
+engine from Allegro.
+ Tomislav Uzelac: For AMP the MP3 engine.
+ Ove Kaaven: For LibAmp, an adaptation of AMP to Allegro.
+ Julian R. Seward: For the bzip2 library.
+ Jean-loup Gailly and Mark Adler: For the zlib.
+ Bjorn Reese: For a lot of ideas about the stack debugger for UNIX.
+ The University of Cambridge: For the Perl Regular expressions package.
+ The University of California, Berkeley and its contributors: after all I
+used your malloc upto v0.4.23, and perhaps I still using some libc function
+from Berkeley.
+
+SET
diff --git a/setedit/distrib/distrib2.txt b/setedit/distrib/distrib2.txt
new file mode 100644
index 0000000..977a1cc
--- /dev/null
+++ b/setedit/distrib/distrib2.txt
@@ -0,0 +1,265 @@
+That's the announcement that I released the SET's editor @@relname@@ release
+(v@@v@@):
+
+What's SET's editor?
+
+ SETEdit or setedit or SET's editor is a text mode oriented text editor
+with the look & feel of the old Borland's IDE. It have windows that can be
+overlapped, common widgets (buttons, menues, check and radio buttons,
+etc.), mouse support and old the funny things you usually find in a GUI
+editor (even when all is in text mode).
+ The editor is mainly oriented for programmers because it have tons of
+tools that helps writing programs, specially C/C++, but suitable to edit
+any kind of text file. In fact the code page and fonts handling options
+make it very suitable to edit text in different encodings and convert it
+back and forth from one encoding to another. Some nice widgets like
+graphical screen savers and MP3 player also makes the editor a funny
+environment.
+ For those who know about RHIDE: setedit is the same editor you can find
+inside RHIDE but without the IDE itself, as it's the last version have more
+features (and bugs?, I hope it have less ;-), seriously, I killed a huge
+number of bugs most small but some very annoying).
+ Is also true that some features takes a lot of time to be incorporated to
+RHIDE or just won't be incorporated to RHIDE at all. The standalone editor
+is also very suitable to be used for the parts of your project that are
+handled with makefiles.
+
+Main features:
+* Easy to use for DOS users because have a lot of CUA and Wordstar commands
+used in the editors of other compilers.
+* Full configurable keyboard.
+* Full configurable menu (OS dependent features and macros in menues).
+* Advanced features: Rectangular blocks, intelligent indent, configurable
+syntax highlight and more.
+* Simple macro language, will be expanded only if the people is interested
+and helps a bit (which is starting to happend).
+* PMacros for fast writing.
+* Real macros.
+* Debugger interface (only for Linux).
+* Documentation tool for libraries or large projects.
+* Fonts, code pages, screen modes and palette customization.
+* You can run make or grep from the editor collecting the errors/hints.
+* Clock and screen saver.
+* Linux and Win32 versions (FreeBSD, QNX and Solaris also supported).
+
+Why I could want to download it if RHIDE exists?
+
+ The editor is the newest version v@@v@@ and have a lot of differences with
+the one included in RHIDE 1.4 (v0.3.6). Attention! Robert released a new
+beta of RHIDE (1.4.9) containing one of the newest editors.
+ Here are some of the reasons you could have:
+
+1) You like the editor and want to use it without needing to start the whole
+IDE. The editor have a half of the size of RHIDE mainly because GDB isn't
+inside of the editor. I use my editor to edit all the files I create ;-).
+2) You are a RHIDE fanatic and want to test the new features or check if
+some bug was killed.
+3) You are a djgpp fanatic and want to collect anything made with djgpp (I'm
+one of these crazy mans ;-).
+4) You don't like RHIDE at all, you think it sucks, but you think you can
+help to make it a really good thing.
+
+...
+
+Ok, where can I get it?
+
+ http://setedit.sourceforge.net/
+
+(DOS/Linux/Win32 sources/binaries/cvs are available from this page
+ QNX/FreeBSD/Solaris versions must be compiled from sources).
+
+---------------------------------------------------------------------------
+[66 new things and 40 fixes]
+
+New [66 things]:
+
++ Debug [12] --> NEW Functionality for *Linux* <--
+
+* Dialogs to configure the debug mode (local, remote and running process), the
+command line options for the program, gdb binary, xterm binary, messages
+displayed, etc.
+* Breakpoints, simple ones and advanced options including conditional
+breakpoints, breakpoints at functions, ignore count, etc.
+* Watchpoints, they are data breakpoints.
+* Options to run, continue, step over, trace into, run upto return, etc.
+* Options to stop and kill the program.
+* Thread selection.
+* Evaluate and modify data.
+* Data Window and Satck to browse the memory (very complete and with its own
+menu).
+* Data Watches, like then ones in RHIDE and also with scope.
+* Data Inspectors, used to analyze complex data structures.
+* Disassembler Window, including syntax highlight and allowing to modify the
+registers.
+* Calling stack, with functionality to browse the call chain.
+
++ Various [15]
+
+* Alternative project sorting mode.
+* Commands to select any window, now Alt+Key is no longer hardcoded.
+* Sections in the docs to help finding what you need.
+* When asking for word completion if the word at the left looks like Class::
+then the editor looks for the class and offers the members.
+* Enhacements to the "Paste Emacs Mode" and the code to search Emacs
+variables.
+* Now if you don't specify any path to "search files under cursor" the editor
+tries to automagically fills this list using the output of cpp.
+* If the editor fails to find the file under cursor now it also looks for it
+in the project and the current directory.
+* Some rudimentary $(VARIABLE) expansion to the "File under cursor" files
+list.
+* A button to recompute window numbers in the list of windows.
+* "File open" dialogs remmembers its size and position.
+* Non interactive versions of the cmcExpandAllTabs and cmcCompactBuffer
+commands to be used from sLisp.
+* Two new commands: cmeGPushCursorPos and cmeGPopCursorPos. They are "global
+push/pop cursor pos". So they also remmember the file.
+* Options to zoom the editor windows when inserted in the desktop.
+* An option to regenerate the central tags file. Used to workaround ctags bug.
+* Modified behavior of the paste operation in input lines: Now the text is
+pasted without destroying the previous value (unless it is selected).
+
++ Menu files [4]
+
+* Context sensitive menues. Also extended the .smn file language to create
+such a thing. Currently used only for the data window and the help.
+* The conditionals in menu files can use the TV driver, CPU, OS, etc. for
+conditions.
+* More variables to check: MP3, PCRE, BZIP2, MIXER and UNIX.
+* $define and $undef and its expansion.
+
++ Compilation [2]
+
+* The posibility to override the "install" command in makefiles.
+* Unified compilation mechanism for BC++.
+
++ sLisp [9]
+
+* FindString, FindAgain, ReplaceString and ReplaceAgain for searches.
+* SelectWindowNumber used to change the focused window.
+* GetCurWindowNumber and GetMaxWindowNumber.
+* You can bind small portions of sLisp code to keys and menu entries.
+* KeyBindings and BindKey commands. With them you can change key bindings
+from sLisp.
+* prex to perform Perl regular expressions searches.
+* GetSystemInfo to know the current OS, TV driver, CPU, etc.
+* More macros examples.
+* Now you can send cme* commands.
+
++ Syntax highlight and pmacros [8]
+
+* Flat Assembler syntax.
+* Ruby syntax.
+* SPARC assembler syntax.
+* WML syntax and pmacros.
+* Errors parser for Perl.
+* C,H and CPP as valid C extensions as valid for C/C++.
+* HTML extensions as valid for HTML.
+* vbe and vst as VHDL extensions.
+
++ Cosmetic [16]
+
+* Project windows are "closed" (hided) when pressing ESC.
+* Windows are opened "zoomed" when the project window isn't visible.
+* When automatically opening a project item now its opened using the relative
+path.
+* Select the closest word when using double click and not the next.
+* History to the "arbitrary indent" and "run command" input lines.
+* To lock the screen while doing a search & replace operation to avoid
+"flashing" when doing a lot of S&R operations.
+* Modified: "Do not purge spaces" option to be "Keep trailing whitespace"
+that's more descriptive.
+* A new color scheme called "Classic Borland"
+* A new color scheme called "Midnight Commander"
+* If the Ctrl+Enter fails to find the file under cursor now that's informed
+in the "status line" of the current editor.
+* Most lists (like functions list) now centers the focused item when a match
+is selected.
+* OS/OS flavor,CPU,Compiler/Compiler flavor and Driver to the about box.
+* Configuration options to disable the calculator and calendar.
+* Now the meassure command reports the result in the status line.
+* A beep when "Run a program" finishes. Option to disable.
+* Busy indicator while we load the tags from disk.
+
+
+Fixed [40 things]:
+
++ Fatal [4]
+
+* The "Jump" button in the main window of the class browser.
+* Undo count for the first undo wasn't initialized. Unknown consequence.
+* Corrupted MP3 files could produce a crash.
+* Abort when doing word completion and the starting word was "bigger" than
+the last tag in the list.
+
++ Not fatal [17]
+
+* HTML export: missing body tag.
+* Errors in the conditionals parser for menu files.
+* Undo error when a character replaced a tab (overwrite enabled) and the
+cursor was inside the tab (not at the beggining).
+* Wrong match pair when the cursor was in the middle of a tab and the next
+character matched a pair (highlight in the middle of the tab).
+* No match pair after deleting some text and the cursor goes to a symbol.
+* When searching outside comments and the match was found in the first column
+of a line after a comment it was ignored.
+* When starting a project using a different window size the project window
+could get wrong size and even become outside the screen.
+* When aborting an overwrite (in save as) the name of the window was changed.
+* When pasting using the OS clipboard and the cursor was moved to the end of
+the selection it could go out of screen which is quite annoying.
+* When copying something from the calculator and the paste wasn't enabled
+before entering the calculator then you needed to at least move the cursor
+before you could paste.
+* Use of unitialized undo counter in some rectangular selection operations.
+* The heuristic C/C++ parser to support list of exceptions (function
+throw(...) {body}).
+* Some details in the heuristic C++ functions searcher. They address problems
+with the const and throw() attributes.
+* Various memory leaks.
+* "New" buffers shouldn't be added to the list of closed windows when closed.
+It generated a read out of bounds and a write of unitialized data to disk.
+* The menu files uses nested preprocessor directives but it wasn't supported.
+* cmcCutClipWin command not dis/enabled when selecting text.
+
++ Compilation [13]
+
+* Cygwin: Collision between strndup and calculator parser.
+* Some gcc versions needs explicit use of libstdc++ to link C++ and
+internac/getcolors didn't have it.
+* Removed two comments containing non-ASCII chars.
+* Various gcc 3.x compilation issues (including gcc 3.4.1 support).
+* Problems with newer versions of makeinfo.
+* The memcpy usage to be more portable. It worked for all supported targets,
+but now should also work for unsupported targets. Same for malloc/new/new[]
+v.s. free/delete/delete[] calls.
+* Missing va_end and abuse of va_list type. It gave problems for Linux PPC
+targets.
+* Use of "g++" in favor of "gcc -lstdc++".
+* strstr and strchr are declared different in C++ standard (compared to C
+standard). Needed to avoid BC++ compilation problems.
+* Various MSVC compilation issues.
+* --cxx-flags flag was reported as --cpp-flags in the help. Now both are
+valid.
+* Cygwin can execute the "make install" target, but it installed binaries
+without .exe extension.
+* Detection of pcre header for systems where the header is in pcre/pcre.h.
+Red Hat is an example.
+
++ Linux [3]
+
+* Code page problems when mixing console use and remote XTerm use.
+* RPM prereq for /sbin/install-info.
+* Problems to create the rpms using Fedora Core 2.
+
++ Cosmetic [3]
+
+* Some drawing variables not initialized. Could make the row/col cursor
+appear until a new redraw.
+* Now the cmc*Win (Copy,Cut,Paste) commands are called cmc*OS to reflect
+their real use. The old names remains as aliases.
+* The list for word completion had a wrong vertical size when we had repeated
+tags in the list to choose. Only one was visible but the size was computed
+counting the repetitions.
+
+
diff --git a/setedit/distrib/distrib3.txt b/setedit/distrib/distrib3.txt
new file mode 100644
index 0000000..3bc7923
--- /dev/null
+++ b/setedit/distrib/distrib3.txt
@@ -0,0 +1,192 @@
+
+
+ InfView v@@v@@
+ by SET
+
+ That's the official distribution of InfView v@@v@@
+ The info viewer is Copyrighted by Salvador Eduardo Tropea. (c) 1996-2003
+and distributed under the GPL license.
+ The info viewer is free and you don't need to pay for it. Any kind of
+donations are accepted ;-).
+
+INDEX:
+
+1. INTRODUCTION
+2. IMPORTANT (modifications and fixes in this release and the previous)
+3. REQUIREMENTS
+4. INSTALL
+5. LEGAL ISSUE
+7. DOWNLOAD
+8. MAILING LIST
+9. DONATIONS
+
+
+
+1. INTRODUCTION
+
+ InfView is a good replacement for the info-stantalone program. The main
+objetive of InfView is to give to the user a friendly and easy to learn tool
+to browse the documentation found in info format. This format is used by the
+FSF for all the major tools and of course is used by djgpp.
+ The old info program was designed as a flexible UNIX tool so it have some
+features you won't find in InfView, as an example: InfView doesn't have
+options to write a documentation chapter to the standard output so you can
+capture it and display in other program. InfView was designed as an
+interactive tool instead.
+ InfView uses overlapping windows (real windows, not "screens"), fully
+supports mouse, have pull-down menues and pop-up windows, etc. As the name
+says the emphasis is in the visual component.
+ Unless graphical implementations the program is relative small and quite
+fast (263Kb installation for the first release, I know about one Win32
+implementation that needs over 5Mb and eats more than 5Mb of memory thanks to
+the run time of some visual script language from Redmond that I won't name
+here).
+ The main features of InfView are:
+
+ * Free cursor movement with the keyboard arrows, page-up, etc.
+ * Mouse support.
+ * Highlighted cross references.
+ * Hide of the `*Note' and other confusing things of the info format.
+ * Previous, Next and Up node support.
+ * History support.
+ * Incremental search just typing the first letters of the cross
+ reference.
+ * The same for the whole nodes list.
+ * Support for compressed info files.
+ * Search in the current node, the whole file or all the files.
+ * Bookmarks.
+ * History of the last 40 nodes visited.
+ * Dialog to browse the files on disk.
+ * and more
+
+
+
+2. IMPORTANT:
+
+ If you are a user of SETEdit you'll find this distribution very familiar
+and in fact follows the same gidelines used in the editor's distribution.
+ Changes since 0.2.6 release:
+
+Additions:
+ The last important addition was the man pages viewer.
+ Now is possible to use File|Open Infview if no window is already opened.
+ Added a configuration dialog to set the code page used by the OS screen.
+ Internationalization, currently only spanish is fully soported.
+
+Fixes:
+ Now all options not available when no window is opened are grayed.
+ The "Shell" menu option wasn't functional.
+
+
+3. REQUIREMENTS:
+
+* PC 386 compatible or superior computer.
+* 2 Mb of memory or more.
+* 2.4 Mb of free disk during installation and about 1.5 Mb once installed.
+* DOS version 5.0 or posterior or any compatible OS (Win '95, Win 3.1, OS/2,
+MS-DOS, etc.). The NT platform isn't fully supported, I don't have NT, if you
+need support for NT send me a licensed copy of NT ;-). I did my best to
+support it, but as I don't have one at home I can't do more.
+* Linux with ELF support for the Linux version. For console use you need gpm
+1.13, newer versions are incompatible.
+* A VGA card.
+* DJGPP users normally have it.
+
+
+
+4. INSTALL:
+
+A) Installing in DOS for djgpp users:
+ Uncompress the file over your djgpp installation in the same way you did
+ with the rest of packages.
+
+C) Installing in Linux:
+1) Uncompress the files in /tmp and run ./INSTALL_LINUX. If you want to setup
+ the destination directory read the INSTALL_LINUX script.
+ Also: the script contains useful information about access rights needed
+ to run infview.
+2) Be sure the directory where infview's binary file is located is included
+ in your PATH environment variable.
+
+
+
+5. LEGAL ISSUE:
+
+ InfView is free software. It may be used or distributed in any manner
+you wish, as long as you do not violate the GPL license. You can't remove
+any copyrigth included in the files and you can't distribute it without any
+of the original files. You will also distribute the sources if you distribute
+the binaries. The GPL license is included in the package so read it before
+distributing infview.
+
+ InfView comes with ABSOLUTELY NO WARRANTY; excluding any and all implied
+warranties, including warranties of merchantability and fitness for a
+particular purpose. There is no warranty or representation, either express
+or implied, with respect to this program, its quality, performance,
+merchantability, or fitness for a particular purpose. The entire risk
+of using this program is with you. There will be no liability for special,
+incidental, or consequential damages arising out of or resulting from the use
+or modification of this program.
+
+
+
+6. WHERE ARE THE SOURCES?
+
+ Even when I'm distributing the standalone InfView I don't the time,
+bandwidth, motivation, etc. to distribute yet another huge package of
+sources. For this reason the sources are only available in the editor's
+package (SETEdit). So download the editor's source. 90% of the code is shared
+with the editor.
+
+
+
+7. DOWNLOAD:
+
+ All the OSs:
+ Stable and beta releases, mailing list, cvs, etc.:
+ http://setedit.sourceforge.net/
+
+ DOS: (only stable releases)
+ Any Simtelnet mirror, example:
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/inf*.zip
+
+ Linux:
+ The Linux tarballs can be found in Source Forge.
+
+ Debian GNU/Linux: (only stable releases)
+ A repository is maintained by Ivan in Source Forge.
+ To access the repository, just add the following line to your
+/etc/apt/sources.list:
+
+deb http://setedit.sourceforge.net/debian woody main
+
+ That's for the Woody version of Debian, you should substitute "woody" by the
+name of your distribution or by the synonym "stable".
+
+ Note that Ivan will upload stable editor releases. For betas look in the
+Source Forge pages.
+
+
+
+8. MAILING LIST
+
+ The editor's list is more than suitable to discuse things related to the
+InfView program because it is part of the editor:
+ To subscribe visit:
+ http://lists.sourceforge.net/mailman/listinfo/setedit-users
+ I moved the old list at topica to Source Forge.
+
+
+
+9. DONATIONS:
+
+ If you really like the info viewer you can send me anything as feedback.
+ If you want to send money I'll be happy, but if you don't have it and
+want to show your gratitude you can send me a postal card from your city
+or some of the things I collect (train tickets, cigarette envelopes and
+boxes, stamps, old money and coins).
+ For more information about how to contact me see the select "Introduction"
+chapter and then select "About the author" in the help on help.
+
+
+SET
diff --git a/setedit/distrib/example.zip b/setedit/distrib/example.zip
new file mode 100644
index 0000000..1fd4fda
--- /dev/null
+++ b/setedit/distrib/example.zip
Binary files differ
diff --git a/setedit/distrib/examples/examp1.dst b/setedit/distrib/examples/examp1.dst
new file mode 100644
index 0000000..fd4e2fe
--- /dev/null
+++ b/setedit/distrib/examples/examp1.dst
Binary files differ
diff --git a/setedit/distrib/examples/examp1.epr b/setedit/distrib/examples/examp1.epr
new file mode 100644
index 0000000..8db0bc7
--- /dev/null
+++ b/setedit/distrib/examples/examp1.epr
Binary files differ
diff --git a/setedit/distrib/examples/test1.cc b/setedit/distrib/examples/test1.cc
new file mode 100644
index 0000000..fa55461
--- /dev/null
+++ b/setedit/distrib/examples/test1.cc
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+// A comment () OCR Font encoded in CP 866 (Russian)
+int main(int argc, char *argv[])
+{
+ printf("Hello! that's ROM BIOS font encoded in CP737 (Greek)\n");
+ int a=1+0.20+0x10;
+ return 0;
+}
diff --git a/setedit/distrib/examples/tvrc b/setedit/distrib/examples/tvrc
new file mode 100644
index 0000000..a508158
--- /dev/null
+++ b/setedit/distrib/examples/tvrc
@@ -0,0 +1,7 @@
+[TV]
+{
+ [Linux]
+ {
+ UseSecondaryFont=1
+ }
+}
diff --git a/setedit/distrib/infINSTALL.MAK b/setedit/distrib/infINSTALL.MAK
new file mode 100644
index 0000000..c45d2f6
--- /dev/null
+++ b/setedit/distrib/infINSTALL.MAK
@@ -0,0 +1,50 @@
+# Copyright (C) 1998,1999,2000 by Salvador E. Tropea
+# Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details
+# This file is part of RHIDE.
+
+.SUFFIXES:
+
+setgid=
+setuid=
+SETGID=
+SETUID=
+SETMODE=0
+
+ifneq ($(setgid),)
+SETGID=-g $(setgid)
+SETMODE=2
+endif
+
+ifneq ($(setuid),)
+SETUID=-o $(setuid)
+SETMODE=4
+endif
+
+EXEC_MODE=-m $(SETMODE)755
+DATA_MODE=-m 0644
+
+
+INSTALL_BIN=install $(EXEC_MODE) $(SETUID) $(SETGID)
+INSTALL_DATA=install $(DATA_MODE)
+INSTALL_DIR=install -d -m 0755
+
+prefix=@@pref@@
+bin_dir=bin
+data_dir=share
+info_dir=info
+doc_dir=doc
+man_dir=man
+
+files:=$(shell find $(bin_dir) $(data_dir) $(info_dir) $(doc_dir) $(man_dir)\
+ ! -type d -print)
+ALL_FILES=$(addprefix $(prefix)/,$(files))
+
+$(prefix)/$(bin_dir)/%: $(bin_dir)/%
+ $(INSTALL_DIR) $(dir $@)
+ @@install_bin@@
+
+$(prefix)/%: %
+ $(INSTALL_DIR) $(dir $@)
+ @@install_data@@
+
+all install: $(ALL_FILES)
diff --git a/setedit/distrib/infREMOVE_UNNEEDED b/setedit/distrib/infREMOVE_UNNEEDED
new file mode 100755
index 0000000..797c879
--- /dev/null
+++ b/setedit/distrib/infREMOVE_UNNEEDED
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# It removes files from previous versions not needed anymore
+#
+rm -f /usr/info/infview.inf
+rm -f /usr/info/infview.info
+rm -f /usr/local/info/infview.inf
+rm -f /usr/local/info/infview.info
+
+
diff --git a/setedit/distrib/kextend.zip b/setedit/distrib/kextend.zip
new file mode 100644
index 0000000..7731b27
--- /dev/null
+++ b/setedit/distrib/kextend.zip
Binary files differ
diff --git a/setedit/distrib/linux.faq b/setedit/distrib/linux.faq
new file mode 100644
index 0000000..0b4e5a4
--- /dev/null
+++ b/setedit/distrib/linux.faq
@@ -0,0 +1,374 @@
+SET's Editor under Linux FAQ:
+
+0) Installation problems
+0.1) Q: I type e in the shell and the editor doesn't start, why?
+0.2) Q: The editor complains about something related to SET_FILES not defined
+0.3) Q: I get "wrong command name at line NN of menubind.smn", what's up?
+0.4) Q: Can I install in my home dir? how can I tell the editor where to look
+for configuration files?
+
+1) Keyboard problems
+1.1) Q: Why the right Alt key doesn't work for menues?
+1.2) Q: If I start the editor from midnight commander the keyboard doesn't
+work very well, why?
+
+2) Mouse problems
+2.1) Q: Why mouse doesn't work?
+2.2) Q: How can I copy/paste using gpm?
+
+3) Video problems
+3.1) Q: Can I make screen output faster?
+3.1) Q: SETEdit can't open /dev/ptyX device, why?
+3.2) Q: Why my lat1 fonts doesn't fix the problems and looks exactly like
+lat1u fonts?
+
+4) sLisp macro language
+4.1) Q: How can I extend it?
+
+5) Edition modes
+5.1) Q: What options should I use to get real tabs (ascii 9)?
+
+=============================================================================
+0) Installation problems
+
+0.1) Q: I type e in the shell and the editor doesn't start, why?
+
+A: After installing the editor by default it is located in /usr/bin so
+if your path doesn't contain this directory you must add it.
+ If you are using bash you must edit the .bash_profile file and include this
+directory in the definition of the PATH variable. Here is how it looks in my
+system:
+
+PATH=".:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
+
+-----------------------------------------------------------------------------
+0.2) Q: The editor complains about something related to SET_FILES not defined
+
+*** Currently it only happens if you don't install in /usr/bin or ***
+*** /usr/local/bin *** ***
+A: You must read the readme.1st. By default the file is located on the
+/usr/doc/setedit directory.
+ Basically you must add the definition of the variable:
+
+SET_FILES="/usr/share/setedit"
+
+ And export it with the export command, here is an example:
+
+export PATH PS1 RHIDESRC SET_FILES ESCDELAY
+
+Note: This syntax is for bash, I don't use other shell in UNIX.
+
+-----------------------------------------------------------------------------
+0.3) Q: I get "wrong command name at line NN of menubind.smn", what's up?
+
+ Be sure you don't have another version of the editor installed in your
+system. I changed the default installation directory from /usr/local/bin to
+/usr/bin so perhaps you have the old copy and it is *first* in your path so
+you are loading the new menu files with the old version of the binary.
+
+-----------------------------------------------------------------------------
+0.4) Q: Can I install in my home dir? how can I tell the editor where to look
+for configuration files?
+
+ You can indicate to the editor where to look special files, here is how:
+A) Configuration files: Define the SET_FILES environment variable to point
+to the directory where configuration files are located.
+B) Help files: Define or modify the INFOPATH environment variable. That's a
+path so you can put as a first directory one located at your home and the
+rest separated with :
+C) Man pages: Define or modify MANPATH, read man manpage for more info.
+D) Internationalization files: Define SET_LOCALEDIR pointing to the directory
+where i18n files for the editor are installed.
+
+=============================================================================
+1) Keyboard problems
+
+1.1) Q: Why the right Alt key doesn't work for menues?
+
+A:In v0.4.26 I taked the desition to make Alt keys different by default. You
+can change it from "Tool&Ops|Options|Keyboard|Setup Alt keys".
+ I did it so you can paste using gpm. For it you can use the right alt+mouse
+middle button. If both alt keys are interpreted as the same key the pasted
+text will be interpreted as Alt+keys and won't be correctly pasted.
+ If you don't use the paste feature of gpm you can setup thealt keys to be
+the same key.
+ You can't reverse it, I mean, you can't use left alt for gpm and right alt
+for menues. That's currently a limitation.
+
+
+-----------------------------------------------------------------------------
+1.2) Q: If I start the editor from midnight commander the keyboard doesn't
+work, why?
+
+A: Is a fault in mc, this program runs your childs in a ttypN console (like
+when you telnet) so the childs doesn't have full access to some IOCTLs and
+devices. Just avoid using the editor from inside programs that doesn't
+cooperate with the OS to work in a multitasking environment. Run the editor
+in other virtual console.
+
+
+=============================================================================
+2) Mouse problems
+
+2.1) Q: Why mouse doesn't work?
+
+A: If you are not running in a ttyN device the mouse won't work (xterm is an
+exception). To know it type tty at the command prompt, if it looks like
+/dev/tty3 it keep reading.
+ The editor needs gpm loaded, most Linux distributions installs it. To be
+sure run "ps wax | grep gpm", you should get two lines, one of gpm itself and
+the other containing "grep gpm", if you only get the last then gpm is not
+running in your system.
+ The editor is compiled statically in the .tar.gz distribution, that's
+needed because a lot of people is using libc 5. I couldn't find any way to
+link libgpm dynamically and the rest statically so the editor uses gpm 1.13,
+lamentably gpm >= 1.14 is incompatible with previous versions.
+ If you can't install gpm 1.13 in your system just compile the editor from
+sources.
+
+
+-----------------------------------------------------------------------------
+2.2) Q: How can I copy/paste using gpm?
+
+A: Hold down the right Alt key and do the selection or copy or paste as you
+normally do with gpm.
+ When the right alt key is pressed the control of the mouse is left to
+gpm.
+ Note that gpm doesn't work in X terminals.
+
+
+=============================================================================
+3) Video problems
+
+3.1) Q: Can I make screen output faster?
+
+A: The editor is much faster is you have access to the /dev/vcsa* devices.
+These devices maps the console video buffer.
+ In order to give access to regular users (not just root) to these devices I
+recommend:
+
+1) Create a group for people that will have access to it.
+
+# addgroup vcs
+
+2) Change the /dev/vcs* owner so they belong to this group.
+
+# chown root.vcs /dev/vcs*
+
+3) Change the /dev/vcs* rights so the group can read and write to them.
+
+# chmod 0660 /dev/vcs*
+
+4) Add the user/s you want to grant access to this group.
+
+# adduser NAME vcs
+
+-----------------------------------------------------------------------------
+3.2) Q: SETEdit can't open /dev/ptyX device, why?
+
+A: I know it isn't for a FAQ but the case of Attila is quite interesting:
+
+"I found the fault. I opend the ssh connection as root an then made a su to
+my normal user account. But setedit couldn't open the pty device since it
+was owned by root.
+
+Attila Kinali"
+
+-----------------------------------------------------------------------------
+3.3) Q: Why my lat1 fonts doesn't fix the problems and looks exactly like
+lat1u fonts?
+
+A: Some Linux distros included wrong fonts. An example is Debian GNU/Linux
+Potato. The package console-data (dated in 1999.08.29) have wrong lat1 fonts,
+they are in fact lat1u fonts, you can verify it using diff.
+Fixed fonts can be downloaded from:
+
+http://www.balug.org.ar/ConfTips/Fonts/index.html
+
+Look at the bottom of the page.
+
+=============================================================================
+4) sLisp macro language
+
+4.1) How can I extend it?
+
+A: You must have C++ skills. The important source files are located in the
+sdg directory and are prefixed with "mli". The header files are located in
+sdg/include. Here is a small text I wrote for a user (Thiago) that
+contributed an sLisp command. It helped Thiago so it could help you too:
+
+<---------------------
+> I've been reading the code of the sLisp interpreter, because I am
+> trying to implement 'cond'. But I am having a hard time trying to
+> understand it. Can you help me?
+
+Of course but be patient I don't have long amounts of time.
+
+> Can you give an overview of how is works?
+> How is the sLisp code stored in memory after it is read?
+
+There is a variable type for code, is basically some kind of string
+variable that holds a function.
+
+> I noticed that there is a "main" function in mli.cc. Is it possible
+> to make a stand-alone version of the interpreter? How?
+
+I think it was created for the first tests and trying to compile it
+now could be a challenge.
+
+> What is the difference between TLispCode and TLispCommand?
+
+When you define a macro you are creating some kind of function. This
+is stored in a code variable.
+A code variable is like a string that contains a sLisp function.
+When the parser tries to reduce a one statement like it (command ....)
+uses a Command variable. That's just like an integer that indicates
+which command must be applied to the arguments list.
+
+I think the most important thing you must know to achieve your
+objetive is how to extend the language.
+sLisp have a group of core functions, they are defined in mli.cc look
+for TMLIBase::cNames[MLIBaseCommands] and Command
+TMLIBase::cComms[MLIBaseCommands]. The MLIBaseCommands value is
+defined in mlibase.h, to add a new command or operator you must first
+increment the counter and then add the name and function that
+implements it to the arrays (char *TMLIBase::sNames[MLIBaseSymbols]
+and Command TMLIBase::sComms[MLIBaseSymbols] for operators).
+The core functionallity is extended by derived classes. One
+specializes sLisp for SDG and the other for the editor. Commands that
+only works for an edition buffer are defined in mliedito.cc (see char
+*TMLIEditor::cNames[MLIEditorCommands]) The number of defined commands
+is in mliedito.h.
+To reduce the ammount of typing sLisp commands implementations relies
+on some cleaver macros.
+One important detail is that Lisp language is evaluated just like a
+stack, things are ever nested. For this reason you'll see every
+function will release your arguments from this stack at exit.
+[Note: It applies to local copies of the arguments, the real arguments
+are automatically released].
+Let me show you a simple function:
+
+DecFun(MLIBaseLeft)
+{
+ int l;
+ LocVarStr(string);
+ LocVarInt(left);
+
+ CheckNumParams(cant!=2);
+ GetString(0,string);
+ GetInteger(1,left);
+
+ l=left->val;
+ if (l>string->len)
+ l=string->len;
+
+ MLIRetStrLen(string->str,l);
+
+ CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(left);
+}
+
+DecFun macro declares the C arguments list for this function, all
+sLisp commands have the same so this macro abstracts it.
+LocVarStr(string); declares a sLisp variable of type String called
+string. That's just a pointer to object declaration.
+In a similar way LocVarInt(left); declares an integer variable called
+left.
+Those are just pointers and doesn't have any value, in fact they are
+null pointers.
+To check we got the right number of arguments we use:
+CheckNumParams(cant!=2); here if the number of arguments is !=2 a
+parser error is generated. Some arguments could be optional and is
+possible to implement functiona that takes a arbitrary number of
+arguments. The cant variable says how many arguments we got.
+To retrieve the arguments we use: GetString(0,string) and
+GetInteger(1,left) the first takes a string that is the first argument
+in the list (index 0) and the second takes an integer. They assign
+their value to the variables we defined at the beginning of the
+function. If the argument tipe doesn't match the code generates a
+syntax error (or something like that). You can retreive just a
+variable without speciying the type and act according the type.
+The next 3 lines implements the function core.
+To return a new string we use MLIRetStrLen(string->str,l).
+And finally comes a clean up. This is a label because the above
+mentioned macros jumps here in case of error.
+Here you must release any variable used.
+Take a look at mlibase.h to know about the available macros.
+As you can see the code is simple and clean thanks to the macros.
+
+Here is an interesting example: eval
+
+DecFun(MLIBaseEval)
+{
+ int i;
+ LocVar(Variable);
+
+ for (i=0; i<cant; i++)
+ {
+ GetVar(i,Variable);
+ if (i+1==cant)
+ MLIRetObj(Variable);
+ else
+ destroyFloatVar(Variable);
+ }
+ CleanUp:
+ return;
+}
+
+Looks quite simple and could be even confusing. The first interesting
+thing here is that we use LocVar and GetVar, they takes just a
+variable. It doesn't matter what type. When you take a variable it
+could be just a variable (string, integer, etc.) or it could be a Code
+variable. The GetVar applied to a Code variable evaluates it to reduce
+the Code into a simple variable. So here just getting each variable is
+enough to evaluate all the statements. The number of arguments is
+arbitrary and we just use a for. The code returns the last object we
+evaluated, not a copy, and that's why we destroy all but the last.
+And here is the if example. I don't remmember why but it is
+implemented without all the macros:
+
+void MLIBaseIf(TMLIBase *o,int start ,int cant)
+{
+ if (cant<2 || cant>3)
+ {
+ o->Error=MLINumParam;
+ MLIRetNULL();
+ return;
+ }
+ TLispVar *p=o->Solve(start);
+ int boolval=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ if (boolval)
+ MLIRetObj(o->Solve(start+1));
+ else
+ if (cant==3)
+ MLIRetObj(o->Solve(start+2));
+ else
+ MLIRetInt(0);
+}
+
+Here you can see what's inside the usual macros like GetxxxVar, the
+->Solve is needed to evaluate an argument.
+<---------------------
+
+If you need more information just e-mail me.
+
+=============================================================================
+5) Edition modes
+
+5.1) What options should I use to get real tabs (ascii 9)?
+
+A: Most users that indents code using tabs uses the following options (Alt+G
+or Alt+L):
+
+Autoindent: ON
+Use Tabs: ON
+Intelligent C indent: OFF
+Optimal Fill: ON
+Don't move inside tabs: ON
+Tab smart indents: OFF
+Use indent size: OFF
+Backspace unindents: OFF
+
+
diff --git a/setedit/distrib/setedit.pif b/setedit/distrib/setedit.pif
new file mode 100644
index 0000000..95220f1
--- /dev/null
+++ b/setedit/distrib/setedit.pif
Binary files differ
diff --git a/setedit/doc/.cvsignore b/setedit/doc/.cvsignore
new file mode 100644
index 0000000..fd476bf
--- /dev/null
+++ b/setedit/doc/.cvsignore
@@ -0,0 +1,21 @@
+editor.inf
+editor.htm
+editor.html
+editor.num
+editor.txt
+infeng.inf
+infeng.htm
+infeng.html
+infeng.num
+infeng.txt
+sdg.txt
+sdg.num
+sdg.htm
+sdg.html
+sdg.inf
+setedit.1
+infview.1
+Makefile
+*.ps
+*.dvi
+*.log
diff --git a/setedit/doc/Makefile b/setedit/doc/Makefile
new file mode 100644
index 0000000..2814deb
--- /dev/null
+++ b/setedit/doc/Makefile
@@ -0,0 +1,90 @@
+#
+# Copyright (c) 1997,1998,1999,2000 by Salvador Eduardo Tropea
+#
+# Make file to generate the documentation for SET's editor
+# and the needed utilties
+#
+# This file was adapted by Robert Hhne to integrate it
+# easilly with RHIDE.
+#
+
+CC=gcc
+# Compat Layer headers location
+clheaders=/usr/include/rhtvision
+# set srcdir to the directory where the sources are
+srcdir=.
+# set this to the directory, where to search for @include
+incdir=.
+#extraincdir=$(RHIDESRC)/doc Now I included the files in the distribution
+VPATH=$(srcdir)
+
+# define here the wanted doc's
+targets=editor sdg infeng
+man_targets=setedit infview
+
+# define here for each target the index commandline for
+# sdh which is then used in $(sdh_ops) with $(index_$*)
+# by replacing $* with the actual target
+index_editor=-n "Index of key commands" kindex.idx kindex.tdx
+index_sdg=-n "Index of variables and commands" vindex.idx vindex.tdx
+
+# set the commandline options for sdh
+sdh_ops=-c -n Index cindex.idx cindex.tdx $(index_$*) \
+ -I $(srcdir) -I $(incdir) -N
+
+all: all_docs
+
+# I'm using .exe to avoid the sdg. under DOS.
+# I think Linux people can live with sdg.exe.
+sdh.exe: sdh.c
+ $(CC) -s -o $@ -O2 -I $(clheaders) $<
+
+%.inf: %.tx
+ ./sdh.exe -oi $(sdh_ops) -i $*
+
+%.txt: %.tx
+ ./sdh.exe -ot $(sdh_ops) -i $*
+
+%.html: %.tx
+ ./sdh.exe -oh $(sdh_ops) -i $*
+
+%.dvi: %.tx
+ ./sdh.exe -od $(sdh_ops) -i $*
+
+%.ps: %.tx
+ ./sdh.exe -op $(sdh_ops) -i $*
+
+# this is only a theoretical suffix only used to produce
+# .info .txt and .html with one rule
+%.doc: %.tx
+ ./sdh.exe -othi $(sdh_ops) -i $*
+
+# this is only a theoretical suffix only used to produce
+# all the available formats with one rule
+%.all: %.tx
+ ./sdh.exe -ohti $(sdh_ops) -i $*
+
+%.1: %.man
+ groff -man -Tascii $< > $@
+
+info: $(addsuffix .inf,$(targets))
+txt: $(addsuffix .txt,$(targets))
+html: $(addsuffix .html,$(targets))
+dvi: $(addsuffix .dvi,$(targets))
+ps: $(addsuffix .ps,$(targets))
+man: $(addsuffix .1,$(man_targets))
+
+all_suffixes=all doc inf txt html dvi ps
+
+$(foreach suffix,$(all_suffixes),$(addsuffix .$(suffix),$(targets))): sdh.exe
+
+text: txt
+
+all_docs: $(addsuffix .all,$(targets)) man
+
+doc: $(addsuffix .doc,$(targets))
+
+clean-docs:
+ rm -f $(addsuffix .inf,$(targets)) $(addsuffix .txt,$(targets)) \
+ $(addsuffix .html,$(targets)) $(addsuffix .dvi,$(targets)) \
+ $(addsuffix .ps,$(targets))
diff --git a/setedit/doc/Makefile.bcc b/setedit/doc/Makefile.bcc
new file mode 100644
index 0000000..5a75c84
--- /dev/null
+++ b/setedit/doc/Makefile.bcc
@@ -0,0 +1,85 @@
+# Makefile for building SETEDIT's documentation
+# Created by Anatoli Soltan
+# Adapted from Makefile by SET
+
+CC=bcc32
+# The following could work for MSVC, never tested.
+#CC=cl
+
+PATH = $(PATH);..\WinNT\makeinfo
+
+# define here the wanted doc's
+targets=editor+ sdg+ infeng+
+targets_inf = $(targets:+=.inf)
+targets_html = $(targets:+=.html)
+targets_txt = $(targets:+=.txt)
+all_targets = $(targets_inf) $(targets_html) $(targets_txt)
+
+# define here for each target the index commandline for
+# sdh which is then used in $(sdh_ops) with $(index_$*)
+# by replacing $* with the actual target
+index_editor=-n "Index of key commands" kindex.idx kindex.tdx
+index_sdg=-n "Index of variables and commands" vindex.idx vindex.tdx
+
+srcdir = .
+incdir = ..\..\tvision\include
+
+# set the commandline options for sdh
+sdh_ops=-c -n Index cindex.idx cindex.tdx \
+ -I $(srcdir) -I $(incdir)
+
+all: sdh.exe $(all_targets)
+
+sdh.exe: sdh.c
+ $(CC) -I$(incdir) sdh.c
+
+
+editor.inf: editor.tx
+ sdh.exe -oi $(sdh_ops) $(index_editor) -i $*
+
+editor.txt: editor.tx
+ sdh.exe -ot $(sdh_ops) $(index_editor) -i $*
+
+editor.html: editor.tx
+ sdh.exe -oh $(sdh_ops) $(index_editor) -i $*
+
+sdg.inf: sdg.tx
+ sdh.exe -oi $(sdh_ops) $(index_sdg) -i $*
+
+sdg.txt: sdg.tx
+ sdh.exe -ot $(sdh_ops) $(index_sdg) -i $*
+
+sdg.html: sdg.tx
+ sdh.exe -oh $(sdh_ops) $(index_sdg) -i $*
+
+infeng.inf: infeng.tx
+ sdh.exe -oi $(sdh_ops) -i $*
+
+infeng.txt: infeng.tx
+ sdh.exe -ot $(sdh_ops) -i $*
+
+infeng.html: infeng.tx
+ sdh.exe -oh $(sdh_ops) -i $*
+
+install:
+ -mkdir $(DEST_SET_DIR)\info
+ copy editor.inf $(DEST_SET_DIR)\info\setedit.inf
+ copy infeng.inf $(DEST_SET_DIR)\info\infview.inf
+ copy sdg.inf $(DEST_SET_DIR)\info\sdg.inf
+
+clean:
+ -del editor.txt
+ -del sdg.txt
+ -del infeng.txt
+ -del editor.html
+ -del sdg.html
+ -del infeng.html
+ -del editor.inf
+ -del sdg.inf
+ -del infeng.inf
+ -del *.num
+ -del *.tx1
+ -del *.exe
+ -del *.obj
+ -del *.tds
+
diff --git a/setedit/doc/editor.tx b/setedit/doc/editor.tx
new file mode 100644
index 0000000..cb7634b
--- /dev/null
+++ b/setedit/doc/editor.tx
@@ -0,0 +1,9550 @@
+\input texinfo @c -*-texinfo-*-
+@c Copyright (C) 1996-2005 by Salvador Eduardo Tropea.
+@c The first 75 lines configures all, the rest is the real doc.
+
+@comment %**start of header
+
+@setfilename setedit.info
+@set version 0.5.5
+@set update-date 12 Sep 2005
+@set update-month Sep 2005
+@set name-author Salvador Eduardo Tropea
+
+@set rh Robert H@value{ouml}hne
+@macro RH{}
+@value{rh}
+@end macro
+
+@settitle SET's editor v @value{version}
+@footnotestyle separate
+@paragraphindent asis
+@iftex
+@afourpaper
+@end iftex
+
+@comment %**end of header
+
+@c ---- Includes according to the output format
+@ifset html
+@include set.htm
+@clear text
+@end ifset
+
+@ifset text
+@include set.txt
+@clear html
+@end ifset
+
+@ifclear html
+@ifclear text
+@include set.txi
+@end ifclear
+@end ifclear
+
+@macro SSET{}
+@mail{@value{name-author},salvador@@inti.gov.ar}
+@end macro
+@set title-printed SET's Editor
+@set minidesc-printed A friendly text editor
+@set year-copyr 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+@set info-file setedit
+
+@macro ikey{KEY,DESC}
+@key{\KEY\}
+@kindex \DESC\ | @key{\KEY\} |
+@end macro
+
+@c --------------------------------------------------------------
+@c Now we have 3 different headers:
+@c 1) For the printed manual, is called titlepage
+@c 2) For Info files
+@c 3) For HTML files
+@c I tried to automate it.
+@c --------------------------------------------------------------
+
+@set text-pre1 @ @ @ This document describes the use of the SET's editor; this editor was designed for programmers and to be used alone or inside of the RHIDE.
+
+@set text-pre2 @ @ @ This documentation may be freely distributed with the editor or the RHIDE package or any part thereof, provided this copyright notice is left intact on all copies.
+
+@set text-pre3 @ @ @ Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
+
+@macro lista1
+@itemize @bullet
+ @item @sc{Andris Pavenis} <pavenis@@lanet.lv>@*
+ (with a lot of patches and reports)
+
+ @item @sc{Bernd Becker} <munin@@munin.inka.de>@*
+ (with a lot of corrections to this text)
+
+ @item @sc{Burton Radons} <loth@@pacificcoast.net>@*
+ (with the new calculator, bug reports and ideas)
+
+ @item @sc{Frank Donahoe} <fdonahoe@@wilkes1.wilkes.edu>@*
+ (with a lot of corrections to this text)
+
+ @item @sc{Grzegorz Adam Hankiewicz} <gradha@@users.sourceforge.net>@*
+ (with tests and a lot of ideas)
+
+ @item @sc{Ivan Baldo} <ibaldo@@adinet.com.uy>@*
+ (Debian packages, tests and a lot of ideas)
+
+ @item @sc{Marek Habersack} <grendel@@ananke.amu.edu.pl>@*
+ (with tests and a lot of ideas)
+
+ @item @sc{Molnar Laszlo} <molnarl@@cdata.tvnet.hu>@*
+ (with the old calculator, tests and a lot of ideas)
+
+ @item @sc{@value{rh}} <robert.hoehne@@gmx.net>@*
+ (with some base routines, a lot of patches and reports)
+@end itemize
+@end macro
+
+@macro titem4{NOM,COM,KEY,ALT}
+@titemR{\NOM\,\COM\,\KEY\,\ALT\}
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+@macro titem3{NOM,COM,KEY}
+@titemR{\NOM\,\COM\,\KEY\}
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+@macro refMenu{command,key}
+Name of the command: \command\.@*
+Assigned key: @kbd{\key\}
+@paragraph{}
+@kindex \command\ @key{\key\}
+@end macro
+
+@macro refMenu1{command}
+Name of the command: \command\.
+@paragraph{}
+@kindex \command\ @key{From menu}
+@end macro
+
+@HeaderPage1{}
+@ifinfo
+@ifset html
+@include editor.ctx
+@end ifset
+@top EDITOR
+@end ifinfo
+@HeaderPage2{}
+
+@ifclear text
+@ifclear html
+@ifclear tex
+Pressing F1 when selecting any item of the menu you'll get help about it.
+@paragraph{}
+@end ifclear
+@end ifclear
+@end ifclear
+
+@chapter Introduction
+
+@value{text-pre1}
+@paragraph{}
+
+@value{text-pre2}
+@paragraph{}
+
+@value{text-pre3}
+@paragraph{}
+
+ People who helped me develop the editor (alphabetically sorted):
+@paragraph{}
+
+@lista1{}
+
+ The editor is distributed under the GPL license. Please read the files
+included in the source distribution for more information.
+@paragraph{}
+
+ This editor is included in the @RH{}'s RHIDE as a replacement for the
+original Turbo Vision's editor class.
+@paragraph{}
+
+@section Copying
+
+ The editor is distributed under the GPL license:
+@paragraph{}
+
+@format
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+@end format
+
+ A copy of the license should be in the package, if not please tell me.
+@paragraph{}
+
+@c when using something like What's, TeX is confused by the '
+@section What is SETs Editor?
+
+ SET's editor is an editor designed to be used by programmers; the main
+target of the editor is C and C++ code but Pascal and Clipper are supported
+too. Currently I'm trying to make it more general so it's useful not only
+for programming
+@paragraph{}
+
+ The editor was designed to be very similar to the DOS standard editors for
+C, especially to Borland's IDE editor. The editor supports a lot of
+WordStar style commands plus some CUA commands, so if you have used any
+editor that uses these kinds of commands you'll find my editor very
+familiar. On the other hand if you have never used a DOS editor,
+especially if you use VI on UNIX machines you'll feel lost. In this case
+you may want to configure the keyboard.
+
+@x{How to configure the keyboard}.
+@paragraph{}
+
+@section About the Author
+
+@my-flag{}
+
+The editor was created by @value{name-author} with some code contributed by
+@RH{}
+
+@display
+E-Mail: @SSET{}
+
+Telephone: (+5411) 4759-0013
+Postal Address:
+Salvador E. Tropea
+Curapalig@value{uuml}e 2124
+(1678) Caseros - 3 de Febrero
+Prov: Buenos Aires
+Argentina
+@end display
+@paragraph{}
+
+@my-flag{}
+
+@chapter Documentation guide
+
+ This document is very extensive and was created while developing the editor
+starting in 1996. For this reason sometimes is complex to find what you want
+or to even know that something is possible. This chapter was created to try
+to alleviate this problem. If you have any suggestions about what to include
+here don't hesitate and contact me.
+@p{}
+
+@section What can be configured to make easier the operation
+
+ Here is a list of what can be configured to customize the editor input.
+@p{}
+
+@itemize @bullet
+@item The keyboard can be configured @x{Keyboard configuration}.
+@item The keyboard can be also configured using sLisp command.
+@x{sLisp macros}.
+@item The menues be also configured. @x{Menues configuration}.
+@item The shortcuts displayed at the bottom of the screen are called
+@il{status bar} and can be configured in the same way menues are configured.
+@x{Menues configuration}.
+@item The small menu that pops up when you right click on editor windows is
+also configurable using the menu configuration. @x{Menues configuration}.
+@item You can define some abbreviations that can then expanded using
+@kbd{^Space}. They are language sensitive and they are called pseudo-macros
+or pmacros. @x{Pseudo Macros}.
+@item You can ask the editor to record a group of operations and then
+reproduce them. This is what this documentation calls a macro. The operations
+to record and play macros can be found in the @il{Macro} menu (@xp{Macro}). You
+can also generate the sLisp code for a macro and store it in the
+@file{macros.slp} file to use it from the menues or just bind it to a key.
+@item If you want to automate more complex operations you can use sLisp
+macros. They use a very simple language that is quite similar to Lisp or
+Scheme languages. @x{sLisp macros}. sLisp macros can be called using the
+@il{Macro|Choose...} or @il{Macro|Repeat} menu options. You can also add menu
+entries that start certain sLisp macro or bind a sLisp macro to a key.
+Additionally you can bind a small piece of sLisp code to a key or menu entry.
+@end itemize
+
+@section What can be configured to change the look of the editor
+
+ Here are some things you can change to ajust how the editor looks.
+@p{}
+
+@itemize @bullet
+@item The colors used for different elements of the editor can be customized
+using the @il{Tool&Ops | Options | Colors | Customize...} menu option.
+@x{Customize Colors}.
+@item Some predefined color schemes are available in the
+@il{Tool&Ops | Options | Colors | Theme...} menu option. You can contribute
+your own color scheme sending me you desktop file (desktop files have .dst as
+extension). @x{Color Theme}.
+@item The color palette can be customized using the
+@il{Tool&Ops | Options | Colors | Palette...} menu. This is available for
+most OSs and terminals, but not for all. @x{Color Palette}.
+@item The character encodings used by the editor can be also configured. This
+is in the @il{Tool&Ops | Options | Encodings...} menu. @x{Encodings}.
+@item Some terminals supports changing the screen or window size. This is in
+the @il{Tool&Ops | Options | Screen Options...} menu. @x{Screen Options}.
+@item Some terminals supports changing the font and/or the font size. The
+editor includes various fonts suitable for it. This is in the
+@il{Tool&Ops | Options | Fonts...} menu. @x{Fonts}.
+@end itemize
+
+@section What can be configured to change the syntax highlighting
+
+ The editor highlights different elements in the code using different colors
+here are things you can do to modify it.
+@p{}
+
+@itemize @bullet
+@item The colors used for it can be configured.
+@x{What can be configured to change the look of the editor}.
+@item The syntax highlighting can be configured and/or extended editing the
+@file{syntaxhl.shl} file. @x{Syntax Highlighting File}.
+@item You can define some words as special words. An example of use is to
+highlight your own data types. They are called @il{user words} and you can
+define them for each supported syntax highlighting. @x{User Words}.
+@end itemize
+
+@section Things to get help or find some definition
+
+ When coding you usually need to access to help files describing the
+language reference or you need to search in your files. This is a list of the
+most important tools for it.
+@p{}
+
+@itemize @bullet
+@item If the language and/or library you are using have documentation in the
+@il{info} format (the format used by the GNU project for on-line
+documentation) you can configure the editor to search the syntax of a command
+when pressing @kbd{^F1}. @x{Syntax help}.
+@item You can browse info files using the InfView info browser. The editor
+also have a man page viewer. Both can be accessed from the @il{Help} menu.
+@x{Help}.
+@item The editor have a search and replace dialog that supports regular
+expressions and also supports replacement using @il{templates}. The @il{Search
+| Find} (@xp{Find}) and @il{Search | Replace} (@xp{Replace}) menu entries are
+used for it.
+@item You can search for text using regular expressions. The @il{Powered Grep}
+dialog allows searching in project items and directories, also recursivelly.
+@x{Grep}.
+@item Using @il{tag files} the editor can search for definitions, do word
+completion and browse classes. @x{TAGS files}.
+@item For some languages the editor can parse your code and extract the
+function definitions. @x{Jump to function}.
+@end itemize
+
+@section Running external programs (compilers/filters/others)
+
+ You can run external programs to compile, apply filters or any other thing.
+Here are some related options.
+@p{}
+
+@itemize @bullet
+@item You run a external program using @il{Tool&Ops | Run program}
+menu option (@xp{Run program}). To configure it you can use the
+@il{Tool&Ops | Options | Run program (which one)} menu option
+(@xp{Run program (which one)}).
+@item The editor collects the messages from the external program and displays
+them in the @il{message window}. @x{Message Window}.
+@item The editor parses the messages from the external program looking for
+errors. The parser can be selected using the @il{Tool&Ops | Options |
+Run program (which one)} menu option. You can add your own parsers editing
+the @file{errors.cle} file. @x{Error messages from an external application}.
+@item You can call external programs binding a sLisp macro to a key or menu
+entry. @x{sLisp macros}, @x{Keyboard configuration}, @x{Menues configuration}.
+@item You can also call external filters using sLisp macros.
+@x{Writing macros that use text filters}.
+@end itemize
+
+@section Configuration files
+@cindex configuration files, list
+
+ Here is a list of the most important configuration files.
+@p{}
+
+@itemize @bullet
+@item The editor can read configuration files from various directories.
+@x{Configuration files location}.
+@item @file{syntaxhl.shl} configures the syntax highlghting.
+@x{Syntax Highlighting File}.
+@item @file{pmacros.pmc} and other @il{.pmc} files are used to configure the
+pmacros (pseudo-macros). @x{Pseudo Macros}.
+@item @file{errors.cle} configures the error parsers. They are used to
+collect error messages from external programs.
+@x{Error messages from an external application}.
+@item @file{macros.slp} defines the available sLisp macros. @x{sLisp macros}.
+@item @file{userword.txt} defines the user reserved words for syntax
+highlighting. @x{User Words}.
+@item @file{deflopts.txt} configures the default edition options for each
+syntax highlighting style. @x{Default global edition}.
+@item @file{nobkp.txt} configures for which files the editor won't create
+back-ups. @x{Do not create backups for}.
+@item @file{tcedit.dst} and other @il{.dst} files. They are desktop files and
+contains information about opened windows and configuration options. They can
+be local (one per directory) or global (one for all the system). Projects
+also have its own desktop file. The format is binary.
+@item @il{.epr} files. They are project files. The format is binary.
+@item @file{keybind.dat} contains keyboard binding information. The format is
+binary.
+@item @file{setenvir.dat} contains some global settings in binary form.
+@end itemize
+
+@chapter Available commands and keys assignments
+
+ In this section I will explain the features of the editor and the default
+configuration for the keyboard. If you want to change an assignment of a
+key consult "configure the keyboard". @x{How to configure the keyboard}.
+@paragraph{}
+
+ Read the conventions topic first to understand my way of indicating
+keystrokes.
+@paragraph{}
+
+ In the description of each command I'll include the internal name used by
+the editor because this name is needed to configure the keyboard.
+@paragraph{}
+
+@section Conventions
+
+ I'll use some conventions when talking about the keystrokes needed to
+trigger some command. So here is what I use:
+@paragraph{}
+
+ The key named @key{Ctrl} or Control is represented as @samp{^}; this key doesn't have any
+effect used alone inside of the editor so the @samp{^} symbol will be used only
+in conjunction with the name of a key indicating that you must press the
+two keys at the same time. For example, @kbd{^A} is @key{Ctrl} and @key{A} at the same time.
+When I say "at the same time" that means: press @kbd{@key{Ctrl}}, hold it, and press
+the other key; that's the reason to put @key{A} after @key{Ctrl}.
+@paragraph{}
+
+ To indicate a sequence of keystrokes I'll use a dash to separate the keys. For
+example, @kbd{^K-B} is @key{Ctrl} and @key{K} at the same time, and then press @key{B}, of course
+release @kbd{^K} first.
+@paragraph{}
+
+ To indicate keys pressed at the same time other than @kbd{^x} I'll use a plus.
+For example, @kbd{Shift+^Insert} is the three keys at the same time!
+@paragraph{}
+
+ I don't think that you are stupid; the editor is written for programmers,
+but I wanted to make that clear to avoid problems ;-).
+@paragraph{}
+
+@section Cursor movement
+@cindex Movement
+
+@table4{Action,Command,Key,Alternate}
+@titem4{Character left,cmcCharLeft,Left arrow,^S}
+@titem4{Character right,cmcCharRight,Right arrow,^D}
+@titem4{Word left,cmcWordLeft,^Left arrow,^A}
+@titem4{Word right,cmcWordRight,^Right arrow,^F}
+@titem4{End of the word,cmcGoEndOfWord,,}
+@titem4{Line up,cmcLineUp,Up arrow,^E}
+@titem4{Line down,cmcLineDown,Down arrow,^X}
+@titem3{Scroll the screen one line up,cmcScrollUp,^W}
+@titem3{Scroll the screen one line down,cmcScrollDown,^Z}
+@titem4{Page up,cmcPageUp,PgUp,^R}
+@titem4{Page down,cmcPageDown,PgDn,^C}
+@titem4{Beginning of line,cmcLineStart,Home,^Q-S}
+@titem4{End of line,cmcLineEnd,End,^Q-D}
+@titem4{Top of window,cmcFirstLineInScreen,^Q-E,^Home}
+@titem4{Bottom of window,cmcLastLineInScreen,^Q-X,^End}
+@titem4{Top of file,cmcTextStart,^Q-R,^PgUp}
+@titem4{Bottom of file,cmcTextEnd,^Q-C,^PgDn}
+@endtable-{}
+
+@section Insert and Delete
+@cindex Insert and Delete
+
+@table4{Action,Command,Key,Alternate}
+@titem4{Delete the character under cursor,cmcDelChar,Del,^G}
+@titem4{Delete character to left,cmcBackSpace,Backspace,^H}
+@titem3{Delete line,cmcDelLine,^Y}
+@titem4{Delete to end of line,cmcDelEnd,^Q-Y,Shift+^Y}
+@titem3{Delete to start of line,cmcDelStart,^Q-H}
+@titem3{Delete word at right,cmcDelWord,^T}
+@titem3{Delete word at left,cmcDelPrevWord,^Backspace}
+@titem4{Insert line,cmcNewLine,Enter,^N}
+@titem4{Smart tab,cmcSmartTab,Tab,^I}
+@titem4{Insert mode on/off,cmcInsMode,Ins,^V}
+@endtable-{}
+
+ When you are in insert mode all the typed characters are inserted in the
+text, but when the insert mode is off the typed characters replace the old
+text. The editor starts with insert mode on. You can quickly know the mode
+by the cursor shape. When the insert mode is on, the cursor is only a
+line, but when it is off, the cursor is block shaped.
+@paragraph{}
+
+@section Blocks
+@cindex Blocks
+
+ A block is a selected portion of the text. You can copy, delete, @il{etc.@:} blocks
+of text. The associated commands are:
+@paragraph{}
+
+@table4{Action,Command,Key,Alternate}
+@titem3{Move to beginning of block,cmcGoBeginBlock,^Q-B}
+@titem3{Move to end of block,cmcGoEndBlock,^Q-K}
+@titem3{Set beginning of block,cmcStartSelect,^K-B}
+@titem3{Set end of block,cmcEndSelect,^K-K}
+@titem3{Hide/Show block,cmcHideSelect,^K-H}
+@titem3{Mark line,cmcMarkLine,^K-L}
+@titem3{Mark word,cmcMarkWord,^K-T}
+@titem4{Delete block and copy it to the Clipboard,cmcCut,^K-Y,Shift+Del}
+@titem3{Copy the selected block,cmcCopyBlock,^K-C}
+@titem3{Move block,cmcMoveBlock,^K+V}
+@titem3{Copy to Clipboard,cmcCopy,^Ins}
+@titem3{Delete block,cmcClear,^Del}
+@titem3{Paste from Clipboard,cmcPaste,Shift+Ins}
+@titem4{Read block from disk,cmcReadBlock,^K-R,Shift+^R}
+@titem4{Write block to disk,cmcWriteBlock,^K-W,Shift+^W}
+@titem3{Replace the block by the Clipboard block,cmcReplaceSelect,Shift+^Ins}
+@titem3{Convert to Uppercase,cmcToUpper,^K-M}
+@titem3{Convert to Lowercase,cmcToLower,^K-O}
+@titem3{Invert case,cmcInvertCase,none}
+@titem3{Alternate case,cmcAltCase,none}
+@titem3{Report the length of the block,cmcSelLength,^Q-L}
+@endtable-{}
+
+@subsection Block modes
+@cindex Persistent Blocks
+
+ There are two block modes. One is the mode that the old editor of RHIDE
+used. This mode is used in CUA programs. The other is called Persistent
+Blocks.
+@paragraph{}
+
+ In the normal mode each time you select a block and then insert anything
+in it (with @code{cmcPaste} or by typing anything) the selected block is deleted
+and is replaced by the new text.
+@paragraph{}
+
+ In persistent blocks the selection is not replaced and is not lost when
+you move the cursor. From this comes the name "Persistent." In this mode
+you can use @code{cmcMoveBlock} and @code{cmcCopyBlock} without using the Clipboard. In
+addition you can apply indentations to the block (@xp{Indentation}),
+search only inside it, @il{etc.} That's what makes this mode much more powerful than
+the former. If you really like to replace the selected text by the selection
+of the Clipboard, that's the default behaviour of the first mode. You can use
+the @code{cmcReplaceSelect} command to achieve the same in the Persistent Blocks
+mode.
+@paragraph{}
+
+@subsection Selecting with the mouse or Shift
+
+ The described commands for selecting a block, @code{cmcStartSelect} and @code{cmcEndSelect},
+are good but not so quick. There are other ways to do this.
+@paragraph{}
+
+@subsubsection Using the mouse
+
+ Using the mouse you need only point to the start place, and while pressing the
+left button moving the mouse to the end point of your block.
+@paragraph{}
+
+ To select a word with the mouse just double click on it.
+@paragraph{}
+
+@subsubsection Using the Shift key
+
+ Using the @key{Shift} key you only need to move the cursor to the start point,
+keep @kbd{@key{Shift}} pressed and move the cursor to the end point with any of the
+available cursor commands. @x{Cursor movement}.
+@paragraph{}
+
+@subsection Indentation
+@cindex Indentation
+
+ You can indent or unindent a block of text using various commands, but you
+must keep in mind that for now the editor is limited in the following way:
+If you are using tabs to indent your text, don't mix tabs with spaces and, if
+you are using spaces to indent, don't mix them with real tabs. @x{Real Tabs}.
+@paragraph{}
+
+@table4{Action,Command,Key,Alternate}
+@titem4{Indent block one position adding a space,cmcIndentBlkOne,^K-I,Shift+^I}
+@titem4{Unindent block one character - not an x position,cmcUnIndentBlkOne,^K-U,Shift+^U}
+@titem3{Indent block,cmcIndentBlk,^K-Tab}
+@titem3{Unindent block,cmcUnIndentBlk,^K-Shift+Tab}
+@endtable-{}
+
+@code{cmcUnIndentBlkOne} unindents deleting one char at the start of the line so,
+if the line is indented with tabs, the line will retract one tab.
+@paragraph{}
+
+@code{cmcIndentBlk} acts according to the mode. If you are using tabs,
+the editor will put one tab at the beginning of each line. If you aren't
+using tabs the editor will operate the Tab command on the first line and
+then will use this amount of indentation on the entire block. @x{Real Tabs}.
+@paragraph{}
+
+@code{cmcUnIndentBlk} acts according to the mode too. @x{Real Tabs}.
+Just like @code{cmcUnIndentBlkOne} it deletes one tab but if you don't use
+tabs the editor uses Backspace on the first used column of the first
+line of the block and unindents by the resulting amount the rest of the
+block.
+@paragraph{}
+
+The following commands aren't applied to the whole block, they apply only to
+the line where the cursor is positioned.
+@paragraph{}
+
+@table3{Action,Command,Key}
+@titem3{Smart Indent block,cmcSmartIndent,^Tab}
+@titem3{Smart Unindent block,cmcSmartUnIndent,Shift+^Tab}
+@endtable-{}
+
+@code{cmcSmartIndent} and @code{cmcSmartUnIndent} indents take as reference the @{ @} pair
+where the cursor is, for example:
+@paragraph{}
+
+@example
+ @{
+line1
+ line2
+ line3
+ @}
+@end example
+
+After indenting line1 with @code{cmcSmartIndent} and line2 with @code{cmcSmartUnIndent}
+you get:
+@paragraph{}
+
+@example
+ @{
+ line1
+ line2
+ line3
+ @}
+@end example
+
+The indentation is made with spaces and you must put the cursor on the first
+letter of the line, the l in this example.
+@paragraph{}
+
+@subsection Rectangular Blocks
+@cindex Blocks - Rectangular
+
+ The editor includes a mode where you can select a rectangular portion of
+the text and copy, cut, clear, paste, move, @il{etc.@:} this region.
+This tool is very useful for modifications on columns.
+@paragraph{}
+
+ Attention! The selected area is based on the X,Y coordinates. For this
+reason if you insert lines before the bottom of the rectangle the area won't
+be moved. I don't plan to move the area by now because that takes some CPU
+and I think that this selection is made just before using it. So don't
+report that like a bug. That is the way it works!
+@paragraph{}
+
+@table3{Action,Command,Key}
+@titem3{Set beginning of block,cmcSelRectStart,^K-Shift+B}
+@titem3{Set end of block,cmcSelRectEnd,^K-Shift+K}
+@titem3{Hide/Show block,cmcSelRectHide,^K-Shift+H}
+@titem3{Delete block and copy it to an special Clipboard,cmcSelRectCut,^K-ShiftT}
+@titem3{Move block,cmcSelRectMove,^K+Shift+V}
+@titem3{Copy to special Clipboard,cmcSelRectCopy,^K-Shift+C}
+@titem3{Delete block,cmcSelRectDel,^K-Shift+L}
+@titem3{Paste from special Clipboard,cmcSelRectPaste,^K-Shift+P}
+@titem3{Convert to uppercase,cmcSelRectToUpper,}
+@titem3{Convert to lowercase,cmcSelRectToLower,}
+@endtable-{}
+
+@section Miscellaneous keyboard commands
+
+@table3{Action,Command,Key}
+@titem3{Autoindent mode on/off,cmcIndentMode,^O}
+@titem3{Find place marker,cmcGotoMarkn,^Q n*}
+@titem3{Set marker,cmcPutMarkn,^K n*}
+@titem3{Search for open curly bracket from where the cursor is,cmcSearchStart,^[}
+@titem3{Search for close curly bracket from where the cursor is,cmcSearchEnd,^]}
+@titem3{Search for ( from where the cursor is,cmcSearchOpPar,Shift+^9}
+@titem3{Search for ) from where the cursor is,cmcSearchClPar,Shift+^0}
+@titem3{Search for [ from where the cursor is,cmcSearchOpCor,Shift+^[}
+@titem3{Search for ] from where the cursor is,cmcSearchClCor,Shift+^]}
+@titem3{Search for the complementary pair,cmcSearchComplement,^Q ESC}
+@titem3{Undo,cmcUndo,Alt+Backspace}
+@titem3{PMacro's Trigger,cmcExpandCode,^Space}
+@titem3{Goto Line,cmcGotoEditorLine,^J}
+@titem3{Set the options for the current window (Not in RHIDE),cmcSetLocalOptions,Alt+L}
+@titem3{Set the default options (Not in RHIDE),cmcSetGlobalOptions,Alt+G}
+@titem3{Convert all tabs to spaces,cmcExpandAllTabs,From menu}
+@titem3{Compact the text using tabs,cmcCompactBuffer,From menu}
+@titem3{Start recording a macro,cmcRecordMacro,Shift+F10}
+@titem3{Stop recording a macro,cmcStopMacro,Alt+F10}
+@titem3{Play a macro,cmcPlayMacro,^F10}
+@endtable-{}
+
+@chapter Keyboard configuration
+
+ The editor can be configured to trigger one or more commands pressing one key or an
+arbitrary sequence of keys. Unlike old versions, now the sequence of keys isn't limited.
+Additionally you no longer need to configure the editor for non-US keyboards.
+@p{}
+
+ You can also assing sLisp defined macros to keys or even small portions of
+sLisp code to keys. In addition you can change the key assignments using
+sLisp macros.
+@p{}
+
+ If you are looking for information about the names used for the keys in the
+editor consult: @x{Key names}.
+@p{}
+
+@section How to configure the keyboard
+
+ These options are located under the menu option called Tool&Ops, submenu
+Options, submenu Keyboard, submenu Key assignment; yes is a little deep in the menu.
+@paragraph{}
+
+ After selecting this option you'll get a window with the keyboard assignments. This
+window shows entries of the type @code{Key sequence -> Command sequence}. You can
+delete an assignment by selecting it and choosing the @code{Delete} button.
+@paragraph{}
+
+ The list is sorted by a internal criteria. The keys with @key{Shift} have an @code{S}
+in front, for @key{Ctrl} you'll see a @code{C} and for @key{Alt} an @code{A}. The editor
+can distinguish the left and right @key{Alt} keys; if you enable it the right @key{Alt}
+will be represented by an @code{a}. @x{Alt key configuration}.
+@paragraph{}
+
+ To add a new assignment press the @code{Add} button. A window called @il{Sequence of
+keys} will appear. This window is used to choose the sequence of keys that will trigger
+an action in the editor. The sequence can be as large as you want, so if you want to
+assign a sequence like this: @kbd{^A-Shift+^Insert-Alt+Z} you can, but I doubt you
+really want to use such a complex combination even if the editor is flexible enough
+to allow it.
+@paragraph{}
+
+ To add a new key to the sequence use the @code{Add} button, to delete a key use the
+@code{Delete} button. The @code{Add} button always adds a key to the end of the list; to
+insert a key in the sequence use the @code{Insert} button, it will insert the
+key before the selected key. Finally you can choose if you want to assign a
+sequence of commands or a sLisp macro to this key sequence. @x{sLisp macros}.
+@paragraph{}
+
+@subsection Assigning a sequence of commands
+
+ A window called @il{Commands} will appear. The mechanism to add, insert and delete
+commands is the same as used for a keyboard sequence. This time when you add or insert
+a new command to the sequence a window with all the available commands will pop-up.
+The meaning of each command can be found in the indices of this help.
+@paragraph{}
+
+ To make a selection with the commands, like when holding @key{Shift}, you must use
+the @code{SelectOn} and @code{SelectOff} commands. For an example you can take a
+look at the assignments for the @kbd{Shift+Left} or @kbd{Shift+Right} keys.
+@paragraph{}
+
+@subsection Assigning a sLisp macro
+@cindex macros.slp
+
+ A window called @il{Macros} will appear. This window shows all the macros defined in
+the @file{macros.slp} file. @x{sLisp macros}.
+@paragraph{}
+
+ The main advantage of using macros instead of command sequence is that macros can
+insert text in your code.
+@paragraph{}
+
+@subsection Assigning sLisp code
+@cindex slisp code to a key
+
+ A window called @il{sLisp code} will appear. This window shows allows
+entering a small portion of sLisp code. For long code use define a macro.
+@x{sLisp macros}.
+@p{}
+
+ The sLisp code must start with @code{(} and end with @code{)} or you'll get
+parser errors.
+@p{}
+
+@section Alt key configuration
+
+ The editor can distinguish the left and right @key{Alt} keys. As old versions didn't
+allowed that and as different users use different @key{Alt} keys the editor doesn't
+make any difference between them anymore by default.
+@paragraph{}
+
+ The @il{Setup Alt keys} menu option (under Tool&Ops | Options | Keyboard) allows to
+enable it. Three options are offered:
+@paragraph{}
+
+@table2{Option,Meaning}
+@titemR{Left Alt,The menues are tiggered by the left Alt and you can use the right Alt
+for commands}
+@titemR{Right Alt,The reverse as for Left Alt - right Alt activates menues\, left Alt commands}
+@titemR{Both Alt,Both keys can be used for menues}
+@endtable-{}
+
+@section Restoring the default keyboard assignments
+
+ If you need to restore the original keyboard assignment because you did something very
+wrong you can use this option for that. The option is located under Tool&Ops | Options
+| Keyboard.
+
+@section Consulting scan codes
+
+ If you need to know the scan code of a key for your program you don't need to use a
+table or another program. The editor has a tool built in that shows scancodes for
+keypresses under Tool&Ops | Options | Keyboard.
+
+@c --------------------------------------------------------------------------
+@c --------------------------------------------------------------------------
+@chapter Pull-down menues
+
+The menues are configurable; for this reason the following structure is just
+one of many possible arrangements.
+@paragraph{}
+
+If you need or want to configure the shortcuts activating the menues or
+menue options look at the @file{menubind.smn} file. The format is self explanatory
+and the editor supports syntax highlighting for these files.
+@x{Menues configuration}.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@section File
+
+This menu contains the file operations (save, load, print, @il{etc.@:}) and
+the program exit functions.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Open
+
+This option brings the file open dialog (@xp{File Open}). From this dialog you can select
+a file to load and edit.
+@paragraph{}
+
+Choose the Open button or select a file with @kbd{@key{Enter}} to open the
+file. Use @kbd{@key{Esc}} to abort.
+@paragraph{}
+
+If the file is read-only a dialog will ask you if you want to make the file
+writable, in this case the editor will try to change the file attributes. Not
+always is it possible to change these attributes, as for example, the CDs are
+read-only and obviously you can't change files on them.
+@paragraph{}
+
+@refMenu{cmeOpen,F3}
+
+@c --------------------------------------------------------------------------
+@subsection New
+
+Use this option to create a new and empty editor window. The window's name will
+be @il{Untitled}.
+@paragraph{}
+
+An alternative way to do it is just using the @il{Open} option and give a new name
+instead of selecting an existing file. @x{Open}. The advantage of this
+method is that the new window already has a meaningful name, instead of
+having to save the file first.
+@paragraph{}
+
+@refMenu1{cmeNew}
+
+@c --------------------------------------------------------------------------
+@subsection Open Read-only copy
+
+Use this option to open a copy of the file you are editing in another window.
+@paragraph{}
+
+Be careful, the new copy is loaded from disk so it may be unsychronized. The
+copy will automatically become read-only so you won't be able to modify it
+and accidentally overwrite the first copy.
+@paragraph{}
+
+For more information: @x{Editor General}.
+@paragraph{}
+
+@refMenu1{cmeOpenROCopy}
+
+@c --------------------------------------------------------------------------
+@subsection Save
+
+This option saves the contents of the current window. Only the contents of
+this window are saved; not anything else. Additionally it only saves if the window
+was modified.
+@paragraph{}
+
+If the window is named @il{Untitled} this command acts like @x{Save as}.
+@paragraph{}
+
+@refMenu{cmcSave,F2}
+
+@c --------------------------------------------------------------------------
+@subsection Save as
+
+This option allows to save the contents of the current window specifying a
+new name for the file. For this purpose the file open dialog is used
+(@xp{File Open}).
+@paragraph{}
+
+If the file already exists a dialog will pop-up asking for confirmation
+to overwrite the existing file.
+@paragraph{}
+
+The title of the window is changed to reflect the new file name.
+@paragraph{}
+
+@refMenu1{cmcSaveAs}
+
+@c --------------------------------------------------------------------------
+@subsection Save as UNIX or DOS
+
+This menu entry says @il{Save as UNIX} for DOS or Win32 systems and
+@il{Save as DOS} for UNIX systems.
+@p{}
+
+This option is very similar to the @il{Save as} option (@xp{Save as}). The
+only difference is that the editor will change the end of line character.
+@p{}
+
+Additionally there is an option to save UNIX files as UNIX files without
+converting it to DOS style. @x{Editor General,Tool&Ops|Options|Editor General}.
+@p{}
+
+@refMenu1{cmcSaveAsConvertEOL}
+
+@c --------------------------------------------------------------------------
+@subsection Save as DOS or UNIX
+
+This menu entry says @il{Save as DOS} for DOS or Win32 systems and
+@il{Save as UNIX} for UNIX systems.
+@p{}
+
+This option is useful when the editor is configured to save files without
+converting the end of line character and you want to force a convertion.
+@p{}
+
+@refMenu1{cmcSaveAsNoConvertEOL}
+
+@c --------------------------------------------------------------------------
+@subsection Save with same time
+
+This option is very similar to the @il{Save} option (@xp{Save}). The only
+difference is that the editor won't modify the creation time. This
+option is very useful to modify header files avoiding the recompilation
+of the whole project. A common case is when you only add constants to a
+header that is included by various files but only one will use the new
+constants.
+@paragraph{}
+
+@refMenu1{cmcSaveSameTime}
+
+@c --------------------------------------------------------------------------
+@subsection Save all
+
+All modified editing windows will be saved.
+@paragraph{}
+
+@refMenu1{cmcSaveAll}
+
+@c --------------------------------------------------------------------------
+@subsection Print
+
+This option prints the current editor window. Don't use this option without
+configuring the printer module. @x{Print Setup}.
+@paragraph{}
+
+This option was designed to print source files, to print plain text files
+or avoid all the formating features. Select the portion of text to be
+printed and save the block (@kbd{^K-W}) to a file with the name of the device
+to which your printer is connected. As an example to print to the DOS LPT 1
+device just write the block to the @file{lpt1} file.
+@paragraph{}
+
+The editor will report the number of lines processed and printed in the
+message window.
+@paragraph{}
+
+To learn more about the message window @x{Message Window}.
+@paragraph{}
+
+@refMenu1{cmePrintEditor}
+
+@c --------------------------------------------------------------------------
+@subsection Print Setup
+
+This option brings up a dialog to configure the printing module. After
+configuring it you can print using the @il{Print} option. @x{Print}.
+If you want to print a plain text (without formating) consult the @il{Print}
+option too.
+@paragraph{}
+
+The dialog asks for the following parameters:
+@paragraph{}
+
+@itemize @bullet
+ @item Total lines per page: The total number of lines that fits on one page
+including the footer and header lines.
+ @item Columns w/o margin: The number of colums that fits on the page
+excluding the desired margin.
+ @item Left margin: The number of columns left blank at the left side of the
+page.
+ @item Print line numbers: Select this option to get the line numbers printed
+ @item Time format: The time format specified in the C style. @x{Time and date modifiers formats}.
+ @item Date format: The date format specified in the C style. @x{Time and date modifiers formats}.
+ @item Title: only used in the header.
+ @item Author: only used in the header.
+ @item Output file: Specify the printer device here. For example: the DOS
+LPT 1 is the lpt1 file.
+ @item Printer initialization: The sequence of character used to initialize
+the printer. Normally it includes a reset and a font selection.
+Specify the values separated by commas.
+ @item Before heading: Commands to send before the header.
+ @item After heading: Commands to send after the header.
+ @item Before footer: Commands to send before the footer.
+ @item After footer: Commands to send after the footer.
+@end itemize
+
+Use the @il{Ok} button to confirm or the @il{Cancel} button to reject.
+@paragraph{}
+
+The @il{Epson} button fills the values with the default settings for Epson
+printers (ESCP2 language). The @il{HP} button fills the values with the
+default settings for Hewlett Packard ink-jet printers.
+@paragraph{}
+
+The printer module was designed by me some years ago when I needed to present
+a program at my University (Universidad Tecnologica Nacional) and I wanted
+to add to the source code listing a header, footer, lines number, page number,
+date/time of the printing, project and author. So that's what the routines
+does. I know they are limited but they generate a very good listing, much
+better than just printing the text without any formating.
+@paragraph{}
+
+@refMenu1{cmeSetUpPrinter}
+
+@c --------------------------------------------------------------------------
+@c @subsection Change directory
+
+@c [DOS]
+@c @paragraph{}
+
+@c By default the editor saves new files and loads files from the directory
+@c where you started the editor. If you need to save or load various files
+@c from a different directory select the directory here just once. For more
+@c information about it, see @xref{File Open}.
+@c @paragraph{}
+
+@c @refMenu1{cmeChangeDrct}
+
+@c --------------------------------------------------------------------------
+@subsection Shell
+
+Calls the default command interpreter indicated by the @il{COMSPEC}
+enviroment variable. I guess you know that by typing exit you'll get back to the
+editor.
+@paragraph{}
+
+@refMenu1{cmeDosShell}
+
+@c --------------------------------------------------------------------------
+@subsection Quit
+@cindex backups, delete at exit
+
+This option exits the editor deleting all the back-up, desktop and project
+files located in the current directory. That's useful if you want to keep the
+directory clean.
+@paragraph{}
+
+When you use this option a dialog will appear asking for confirmation, you
+can avoid this dialog in the future by checking the "don't show again"
+option.
+@paragraph{}
+
+@refMenu{cmeQuitDelete,Alt+Q}
+
+@c --------------------------------------------------------------------------
+@subsection Exit
+
+This option just exits the program. The editor asks for each modified editor
+window if you want to save the changes. All the settings are stored
+in the desktop file automatically.
+@paragraph{}
+
+@refMenu{cmeQuit,Alt+X}
+
+@c --------------------------------------------------------------------------
+@section Edit
+
+This menu contains all the editing operations that have a menu shortcut.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Undo
+
+This option reverts the last edit operation. Upto 32 operations can be
+reverted.
+@paragraph{}
+
+@refMenu{cmcUndo,Alt+BackSpace}
+
+@c --------------------------------------------------------------------------
+@subsection Redo
+
+This option takes back the last @il{Undo}. @x{Undo}.
+@paragraph{}
+
+@refMenu1{cmcRedo}
+
+@c --------------------------------------------------------------------------
+@subsection Cut
+
+The selected text is copied to the clipboard and deleted from the text.
+@x{Clipboard}.
+@paragraph{}
+
+@refMenu{cmcCut,Shift+Del}
+
+@c --------------------------------------------------------------------------
+@subsection Copy
+
+The selected text is copied to the clipboard. @x{Clipboard}.
+@paragraph{}
+
+@refMenu{cmcCopy,^Ins}
+
+@c --------------------------------------------------------------------------
+@subsection Paste
+
+The text that's currently selected in the clipboard is inserted at the cursor
+position. @x{Clipboard}.
+@paragraph{}
+
+@refMenu{cmcPaste,Shift+Ins}
+
+@c --------------------------------------------------------------------------
+@subsection Show clipboard
+
+This option shows the clipboard window. @x{Clipboard}.
+@paragraph{}
+
+@refMenu1{cmeShowClip}
+
+@c --------------------------------------------------------------------------
+@subsection Clear
+
+Deletes the selected text. It isn't copied to the clipboard.
+@paragraph{}
+
+@refMenu{cmcClear,^Del}
+
+@c --------------------------------------------------------------------------
+@subsection Set Local
+
+This option pops up the local configuration dialog. The values in this
+dialog are valid only for the current editor window.
+@paragraph{}
+
+The first group of options are related to the editing modes.
+@x{Editing Modes}.
+@paragraph{}
+
+The syntax highlight group of options allows to choose the type of highlight.
+@x{Syntax Highlighting}.
+@paragraph{}
+
+Additionally the window allows to indicate the tab size and the column where
+the wrap cuts the lines.
+@paragraph{}
+
+@refMenu{cmcSetLocalOptions,Alt+L}
+
+@c --------------------------------------------------------------------------
+@subsection Set Global
+
+This option pops up the global configuration dialog. The values in this
+dialog are used as default values. If you exit the dialog using the
+@il{Ok} button these values @b{aren't} applied to any of the editor windows,
+they just act as default values for newly opened and created
+files. If you exit the dialog using the @il{To all} button these values
+are applied to @b{all} the editor windows. To set the options for just one
+window @x{Set Local}.
+@paragraph{}
+
+The options are related to the editing modes. @x{Editing Modes}.
+@paragraph{}
+
+Additionally the window allows to indicate the tab size and the column where
+the wrap cuts the lines.
+@paragraph{}
+
+@refMenu{cmcSetGlobalOptions,Alt+G}
+
+@c --------------------------------------------------------------------------
+@subsection Expand all tabs
+
+This option converts all the tabs to spaces. @x{Real Tabs}.
+@paragraph{}
+
+The tabs are expanded to the current tab size, check this value before using
+this option.
+@paragraph{}
+
+@refMenu1{cmcExpandAllTabs}
+
+@c --------------------------------------------------------------------------
+@subsection Compact text
+
+This option converts spaces to tabs where possible. @x{Real Tabs}.
+@paragraph{}
+
+Be careful, if the tab size is too small the editor will generate tons of
+tabs, even in places where you may not want a tab.
+@paragraph{}
+
+@refMenu1{cmcCompactBuffer}
+
+@c --------------------------------------------------------------------------
+@subsection Copy to Windows Clipboard
+
+Copies the selected text to Windows' clipboard. Of course you must be
+running Windows to be able to use this ;-)). Don't expect this feature to
+work always though, as Windows has bugs in the WinOldAp module; which is used
+to provide this function.
+@paragraph{}
+
+There is a command called @code{cmcCutClipWin} you can use to cut a portion
+of text copying it to Windows' clipboard.
+@paragraph{}
+
+@refMenu1{cmcCopyClipWin}
+@refMenu1{cmcCutClipWin}
+
+@c --------------------------------------------------------------------------
+@subsection Paste from Windows Clipboard
+
+Pastes the Windows' clipboard content at the cursor's position. Of course
+you must be running Windows and have some text in the clipboard.
+Don't expect this feature to work always though, as Windows has bugs in
+the WinOldAp module; which is used to provide this function.@paragraph{}
+
+@refMenu1{cmcPasteClipWin}
+
+@c --------------------------------------------------------------------------
+@subsection Copy to file Clipboard
+
+Copies the selected text to a special file used as clipboard. This option is
+usually available on UNIX as a replacement for the Windows clipboard
+functions. The file is created in a user specific directory, for this reason
+the information is only available to one user.
+@paragraph{}
+
+@refMenu1{cmcCopyClipFile}
+
+@c --------------------------------------------------------------------------
+@subsection Paste from file Clipboard
+
+Pastes text from a special file used as clipboard. This option is
+usually available on UNIX as a replacement for the Windows clipboard
+functions. The file is created in a user specific directory, for this reason
+the information is only available to one user.
+@paragraph{}
+
+@refMenu1{cmcPasteClipFile}
+
+@c --------------------------------------------------------------------------
+@subsection Push cursor position
+
+It stores the cursor position (x,y) in a stack. You can restore it later
+using @x{Pop cursor position}. The stack can hold up to eleven nested
+positions; if you try to push a 12th value the oldest is discarded.
+@paragraph{}
+
+@refMenu1{cmcPushCursorPos}
+
+@c --------------------------------------------------------------------------
+@subsection Pop cursor position
+
+It restores the cursor position (x,y) from a stack. You can store the
+position using @x{Push cursor position}. The stack can hold up to eleven
+nested positions; if you try to push a 12th value the oldest is discarded.
+@paragraph{}
+
+@refMenu1{cmcPopCursorPos}
+
+@c --------------------------------------------------------------------------
+@subsection Case (Menu)
+
+This submenu contains operations to convert blocks or single characters to
+uppercase or lowercase and similar operations
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsubsection Block to upper
+
+Converts all the selected characters to uppercase.
+@paragraph{}
+
+@refMenu1{cmcToUpper}
+
+@c --------------------------------------------------------------------------
+@subsubsection Block to lower
+
+Converts all the selected characters to lowercase.
+@paragraph{}
+
+@refMenu1{cmcToLower}
+
+@c --------------------------------------------------------------------------
+@subsubsection Character toggle
+
+Converts the character under the cursor to lowercase if it was uppercase and
+@il{vice versa}.
+@paragraph{}
+
+@refMenu1{cmcToggleCharCase}
+
+@c --------------------------------------------------------------------------
+@subsubsection Block invert
+
+Converts all the selected uppercase characters to lowercase and vice versa.
+@paragraph{}
+
+@refMenu1{cmcInvertCase}
+
+@c --------------------------------------------------------------------------
+@subsubsection Block alternate
+
+It will convert the first character to uppercase, the second to lowercase and
+so on. If you want the reverse you can use the command to invert a block.
+@x{Block invert}.
+@paragraph{}
+
+@refMenu1{cmcAltCase}
+
+@c --------------------------------------------------------------------------
+@subsection Insert new line (do not move)
+
+It inserts a new line character at cursor position but without modifying the
+cursor position. Note it doesn't apply indentation or other special things to
+the inserted line.
+@p{}
+
+@refMenu{cmcInsertNewLine,Ctrl+N}
+
+@c --------------------------------------------------------------------------
+@section Search
+
+This menu contains the search and replace commands of the editor. The search
+function also includes advanced tools specifically designed for programmers,
+like the options to jump to a function definition or a symbol.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Find
+
+This command searches a string in the current editor. The dialog contains the
+following fields:
+@paragraph{}
+
+@itemize @bullet
+ @item Text to find: The text you want to find.
+ @item Case sensitive: Use this option if the case of the text to search
+is important.
+ @item Whole words only: When this option is set the editor searches for whole
+words. If not the text to search can be only part of a word.
+ @item Regular expressions: Use this option if the text to search is a
+regular expression. A description of the syntax used by regular
+expressions can be found in the libc. @x{Regular Expressions}. Three
+types of regular expression are supported. @x{Regular Expressions Options}.
+ @item Only inside comments: Matches will be returned only if the first
+character is inside a comment. Every type of comment supported by the syntax
+highlighting is supported. It doesn't have any sense for plain text.
+ @item Only outside comments: Matches will be returned only if the first
+character is outside a comment. If the previous option is also enabled this
+option takes precedence.
+ @item Scope - Global: The search will ignore the selected text.
+ @item Scope - Selected text: The search will be done only inside the
+selected text.
+ @item Origin - From cursor: The search will start from the position of the cursor.
+ @item Origin - Entire scope: The search will start from the beginning of the text.
+ @item Direction - Forward: The search is performed advancing in the text.
+ @item Direction - Backward: The search is performed going backwards in the
+text. This process is slower than a forward search. Additionally some regular
+expression searchs could fail when doing it, in particular when the
+expression searchs at the beggining or the end of the line.
+@end itemize
+
+The regular expressions search is slow and this can be noticed in large
+files. Don't use it if the search can be done without it. The editor will
+automatically disable the regular expressions search if the
+@il{Text to find} contains only alphanumeric characters. This can be disabled
+@x{Regular Expressions Options}.
+@paragraph{}
+
+To repeat the search use the @il{Search again} command. @x{Search again}.
+@paragraph{}
+
+@refMenu{cmcFind,^Q-F}
+
+@c --------------------------------------------------------------------------
+@subsubsection Regular Expressions Options
+
+This dialog is accessed from the @code{RegEx Ops} button in the Find or
+Replace dialogs. Here you can indicate some important options about the
+regular expressions:
+@paragraph{}
+
+RegEx style:
+@paragraph{}
+@itemize @bullet
+ @item Basic POSIX: old style POSIX regular expressions.
+ @item Extended POSIX: new style POSIX regular expressions.
+ @item Perl Compatible: Perl like regex, using the PCRE library.
+@end itemize
+
+Replace text:
+@paragraph{}
+@itemize @bullet
+ @item Normal text: the match is replaced by the text in the replace text area.
+ @item Dollar tags: the text to replace is parsed searching for @code{$n} tags.
+These markers are replaced by the correspondent subexpression. If you
+know Perl that's just like using the $0, $1, @il{etc.@:} after a search.
+If you never used Perl and don't know what a subexpression is, just play a
+little and you'll get the idea; use $n where n is the desired subexpression.
+@end itemize
+
+Optimize:
+@paragraph{}
+@itemize @bullet
+ @item Try to use normal search: if the editor detects that the search string
+contains plain text will use a simple search even when regular expressions
+are enabled. That's about ten times faster.
+ @item Ever use RegEx: the editor doesn't try to be smart and always uses what
+you selected.
+@end itemize
+
+For more information about regular expressions @x{Regular Expressions}.
+
+@c --------------------------------------------------------------------------
+@subsection Replace
+
+This command searches portions of text and replaces it with another text.
+The options for the search are the same as in the @il{Find} command.
+@x{Find}. The additional replace options are:
+@paragraph{}
+
+@itemize @bullet
+ @item New text: The text used to replace the matching text.
+ @item Prompt on replace: When this option is enabled the editor asks for
+confirmation before doing the replace.
+ @item Replace all: Use it to replace all the possible ocurrences.
+@end itemize
+
+To repeat the search use the @il{Search again} command. @x{Search again}.
+@paragraph{}
+
+@refMenu{cmcReplace,^Q-A}
+
+@c --------------------------------------------------------------------------
+@subsection Search again
+
+This option repeats the last search.
+@paragraph{}
+
+@refMenu{cmcSearchAgain,^L}
+
+@c --------------------------------------------------------------------------
+@subsection Name current function
+
+It shows the name of the function at the position of the cursor in the status
+line of the window. It has the same limitations of the @il{Jump to function}
+option. @x{Jump to function}.
+
+@refMenu{cmcWhichFunctionIs}
+
+@c --------------------------------------------------------------------------
+@subsection Jump to function
+@cindex functions, heuristic jump to
+
+his option opens a dialog with the list of functions in your source
+file you can choose to jump to. The functions are searched
+in the source file so you don't need to compile it. As the parser uses
+heuristics it may fail. For an option that uses a more reliable but also
+slower and complicated search see the @il{Jump to symbol} option.
+@x{Jump to symbol}.
+@p{}
+
+The @code{Browse} button sends the list of functions to the message window
+so you can browse the list and visit each function. @x{Message Window}.
+@p{}
+
+Currently only a few languages are supported, they are:
+@p{}
+
+@itemize @bullet
+@item C/C++
+@item Clipper 5.x
+@item Perl
+@item Syntax Highlight Files
+@item Texinfo sources (chapters, sections, @il{etc.})
+@item Assembler files (labels)
+@item PHP
+@item Python
+@item VHDL
+@item PMacros file
+@end itemize
+
+In C sources fails are common if your code has an unbalanced number of
+curly brackets. Here is a piece of code that made the heuristic get
+lost:
+@paragraph{}
+
+@example
+#ifndef MSI_USE_GETDELIM
+ if (readPipe(textMsgPipe, id, buf, maxLen))
+ @{
+ *buflen = strlen(buf);
+#else
+ if ((bytes = readPipe(textMsgPipe, id, buf)) > 0)
+ @{
+ *buflen = bytes - 2;
+#endif
+ ....
+ @}
+@end example
+
+Here the editor saw two open curly brackets but only one close bracket.
+To avoid this you should add:
+@paragraph{}
+
+@example
+ ....
+#ifndef MSI_USE_GETDELIM
+ @}
+#else
+ @}
+#endif
+@end example
+
+Currently the parser tries to be smart and only check half of the sequence,
+just like if all @code{#if} conditions were true. It means the parser won't
+get lost with this specific problem, but very complex situations may break
+it nonetheless.
+
+@refMenu{cmcJumpToFunction,Alt+F2}
+
+@c --------------------------------------------------------------------------
+@subsection Jump to prototype
+
+This option pops up a dialog with the list of C function prototypes in your
+source file. You can then choose one to jump to. The prototypes are
+searched in the source file so you don't need to compile it. As the parser
+uses an heuristic approach it may fail, especially if your code has an
+odd number of curly brackets.
+@paragraph{}
+
+@refMenu1{cmcJumpToPrototype}
+
+@c --------------------------------------------------------------------------
+@subsection Jump to symbol
+@cindex tags, jump to tag
+@cindex functions, jump to
+@cindex symbols, jump to
+@cindex variables, jump to
+
+This option uses @file{TAGS} files to search for symbols. In order to make it
+work you should read about @file{TAGS} files first. The editor will try to
+help you to generate the @file{TAGS} file if you don't have one.
+@x{TAGS files}.
+@p{}
+
+The word to the left of the cursor will be used to start a search in the list
+of available symbols. You can make incremental searches in the list and
+pressing @key{Enter} the editor will jump to the symbol.
+@p{}
+
+More about tags? @x{TAGS files}.
+
+@refMenu{cmeSearchTag,Ctrl+F2}
+
+@c --------------------------------------------------------------------------
+@subsection Go to line
+
+Allows you to indicate to which line you want to jump to.
+@paragraph{}
+
+@refMenu{cmcGotoEditorLine,^J}
+
+@c --------------------------------------------------------------------------
+@subsection Class browser
+@cindex browsing classes
+
+This option uses @file{TAGS} files to search for symbols. In order to make it
+work you should read about @file{TAGS} files first. The editor will try to
+help you to generate the @file{TAGS} file if you don't have one.
+@x{TAGS files}.^
+@p{}
+
+First the editor will create an index of available classes from the
+@file{TAGS} files and then will do a search using the word to the left of the
+cursor. If an exact match was found the editor will go directly to browse
+this class, otherwise you'll get a list of available classes to choose one.
+You can make incremental searches in this list typing the first letters of
+the class name.
+@p{}
+
+The main browser dialog contains three buttons offering different information
+about the selected class. They are:
+@p{}
+
+@itemize @bullet
+@item This class: shows a list of the members for this class. You can select
+any of them to jump to the member code or go back to the main dialog.
+@item This and parents: shows a list of the members for this class and all
+the parent classes. The members for this class are first, then come the
+members of the parents, then the members of the grandparents and so on.
+The information is more compact and you'll only see the name of the class where
+the member was found and the level (one for the parent, two for grandparents,
+@il{etc.}).
+@item Sorted: This option is the same as the previous but the list is
+alphabetically sorted.
+@end itemize
+
+In addition to these buttons you'll see a list of parent and child classes.
+Selecting a class from those lists and pressing the corresponding button you
+can browse the selected class.
+@p{}
+
+More about tags? @x{TAGS files}.
+
+@refMenu1{cmeClassBrowser}
+
+@c --------------------------------------------------------------------------
+@subsection Word completion
+@cindex completion, words
+@cindex automatic word completion
+
+This option uses @file{TAGS} files to search for symbols. In order to make it
+work you should read about @file{TAGS} files first. The editor will try to
+help you to generate the @file{TAGS} file if you don't have one.
+@x{TAGS files}.
+@p{}
+
+The word to the left of the cursor is used to perform a search in the list of
+available symbols. If a partial match is found a list of available symbols
+will pop-up. To select the symbol you want you can use the arrow cursors or
+continue typing until you reach the desired symbol. When you type
+@key{Enter}, @key{Space} or any symbol the select word will be inserted
+completing the word. Pressing @key{Esc} or @key{Tab} will abort the process.
+@p{}
+
+More about tags? @x{TAGS files}.
+
+@refMenu{cmeWordCompletion,Alt+Right}
+
+@c --------------------------------------------------------------------------
+@subsection Jump to last cursor position
+@cindex last cursor position
+
+This command moves the cursor to the position it was before the last
+movement. You can use it to go back after a search.
+@p{}
+
+@refMenu{cmcJumpLastCursorPos,Ctrl+Q-P}
+
+@c --------------------------------------------------------------------------
+@subsection Jump to last undo position
+@cindex last cursor position, alternative
+
+This command moves the cursor to the position it was before the last
+movement sequence. This is equivalent to undo the last group of movements.
+@p{}
+
+@refMenu1{cmcLastPosCur}
+
+@c --------------------------------------------------------------------------
+@section Macro
+
+This submenu has the options to record and replay macros.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Record (Macro)
+
+Starts recording all the operations you do in the current editor
+window.
+@paragraph{}
+
+@refMenu{cmcRecordMacro,Shift+F10}
+
+@c --------------------------------------------------------------------------
+@subsection Stop (Macro)
+
+Stops the macro recording.
+@paragraph{}
+
+@refMenu{cmcStopMacro,Alt+F10}
+
+@c --------------------------------------------------------------------------
+@subsection Play (Macro)
+
+Replays the saved macro. A macro saved in one window can be used in another.
+@paragraph{}
+
+@refMenu{cmcPlayMacro,^F10}
+
+@c --------------------------------------------------------------------------
+@subsection Choose (Macro)
+
+This option lists all the available @il{sLisp macros} so you can choose one
+to execute.
+@paragraph{}
+
+To learn more about these macros: @x{sLisp macros}.
+@paragraph{}
+
+@refMenu1{cmcChooseMacro}
+
+@c --------------------------------------------------------------------------
+@subsection Repeat (Macro)
+
+It re-runs the last selected macro. @x{Choose (Macro)}. That's useful
+if the macro isn't assigned to a key and you need to use it several times.
+@paragraph{}
+
+To learn more about these macros: @x{sLisp macros}.
+@paragraph{}
+
+@refMenu{cmcRepeatMacro,Shift+F3}
+
+@c --------------------------------------------------------------------------
+@subsection Generate Code
+
+This option translates the recorded macro into an @il{sLisp macro}. The
+generated code is inserted at the cursor's position.
+@paragraph{}
+
+To learn how to record a macro: @x{Record (Macro)}.
+@paragraph{}
+
+To learn more about these macros: @x{sLisp macros}.
+@paragraph{}
+
+@refMenu1{cmcGenCodeForMacro}
+
+@c --------------------------------------------------------------------------
+@subsection Run selected code
+
+It interpretes the selected text as an sLisp macro.
+@p{}
+
+@refMenu1{cmcRunSel_sLisp}
+
+@c --------------------------------------------------------------------------
+@subsection Enter code to run
+
+It asks for a text and interpretes it as an sLisp macro. The maximum length is
+one kilobyte.
+@p{}
+
+@refMenu1{cmcRunEnter_sLisp}
+
+@c --------------------------------------------------------------------------
+@subsection Pseudo Macro (menu)
+
+It shows a list of all the pseudo macros available for the current syntax
+highlighting mode. The purpose of this option is just to show you what's
+available; of course you can choose any from the list but that's much slower
+than using them directly.
+@paragraph{}
+
+The letters enclosed in brackets are the triggers for the pseudo macro. To
+learn more about pseudo macros: @x{Pseudo Macros}.
+@paragraph{}
+
+@refMenu1{cmcChoosePMacrosList}
+
+@c --------------------------------------------------------------------------
+@section Rectangle
+
+This menu contains the rectangular block operations. As they are a bit
+hard to code and these functions are normally ignored by the users, I put
+them in a very visible menu.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Start (Rectangle)
+
+Selects the top-left corner of the rectangular area.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectStart,^K-Shift+B}
+
+@c --------------------------------------------------------------------------
+@subsection End (Rectangle)
+
+Selects the bottom-right corner of the rectangular area.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectEnd,^K-Shift+K}
+
+@c --------------------------------------------------------------------------
+@subsection Hide (Rectangle)
+
+Hides the rectangular selection.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectHide,^K-Shift+H}
+
+@c --------------------------------------------------------------------------
+@subsection Copy (Rectangle)
+
+Copies the rectangular selection into the clipboard. This clipboard isn't
+the same clipboard used by the normal selections and is overwritten each
+time you copy to it.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectCopy,^K-Shift+C}
+
+@c --------------------------------------------------------------------------
+@subsection Paste (Rectangle)
+
+Inserts the contents of the rectangular clipboard at the cursor position.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectPaste,^K-Shift+P}
+
+@c --------------------------------------------------------------------------
+@subsection Cut (Rectangle)
+
+Copies the rectangular selection into the clipboard and then deletes the
+selected text.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectCut,^K-Shift+T}
+
+@c --------------------------------------------------------------------------
+@subsection Clear (Rectangle)
+
+Deletes the selected text.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectDel,^K-Shift+L}
+
+@c --------------------------------------------------------------------------
+@subsection Move (Rectangle)
+
+Moves the selected text to the cursor's position.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu{cmcSelRectMove,^K-Shift+M}
+
+@c --------------------------------------------------------------------------
+@subsection To upper (Rectangle)
+
+Converts all the characters inside the rectangle to uppercase. This
+operation basically does a cut of the block, then processes all the
+characters and finally makes a paste of the modified block. As a side
+effect of this operation tabs inside or crossing the rectangle boundaries
+are converted to spaces.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu1{cmcSelRectToUpper}
+
+@c --------------------------------------------------------------------------
+@subsection To lower (Rectangle)
+
+Converts all the characters inside the rectangle to lowercase. This
+operation basically does a cut of the block, then processes all the
+characters and finally makes a paste of the modified block. As a side
+effect of this operation tabs inside or crossing the rectangle boundaries
+are converted to spaces.
+@paragraph{}
+
+To learn more about rectangular blocks: @x{Rectangular Blocks}.
+@paragraph{}
+
+@refMenu1{cmcSelRectToLower}
+
+@c --------------------------------------------------------------------------
+@section Windows
+
+This menu contains the options to handle the windows in the editor.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Size/move
+
+You can resize the windows by dragging the bottom right corner of the window.
+You can move the windows by dragging the title line of the window.
+@paragraph{}
+
+Additionally this command allows the same operations to be done without the
+mouse. Once you entered in this mode the border of the window changes it's
+color and you can move the window using the arrow keys. To resize the window
+use the arrow keys holding the @key{Shift}. Furthermore @key{Home},
+@key{End}, @key{PgUp} and @key{PgDown} can be used to move the window to one
+end of the desktop. When you're done you can end this mode by pressing
+@key{ESC} or @key{ENTER}.
+@paragraph{}
+
+@refMenu{cmeResize,^F5}
+
+@c --------------------------------------------------------------------------
+@subsection Zoom
+
+Changes the size of the window to be as large as the whole desktop. The
+second time you use this command the window is resized to it's previous size.
+It's the equivalent of the maximize and restore options of other editors.
+@paragraph{}
+
+@refMenu{cmeZoom,F5}
+
+@c --------------------------------------------------------------------------
+@subsection Tile
+
+Arranges all the windows in a way that you can see all at the same time.
+@paragraph{}
+
+@refMenu1{cmeTile}
+
+@c --------------------------------------------------------------------------
+@subsection Cascade
+
+Arranges all the windows in such a way that they overlap.
+@paragraph{}
+
+@refMenu1{cmeCascade}
+
+@c --------------------------------------------------------------------------
+@subsection Next (Window)
+
+Selects the next window. The windows are linked in a circular list, this
+command selects the next window in the list. To change the order of the
+windows you can directly select a window with the mouse or @key{ALT} plus
+a number. That window will become the current one, and the
+other will be the @il{previous} window.
+@paragraph{}
+
+Use it to select the most recently used windows.
+@paragraph{}
+
+@refMenu{cmeNext,F6}
+
+@c --------------------------------------------------------------------------
+@subsection Previous (Window)
+
+Selects the previous window. The windows are linked in a circular list, this
+command selects the previous window in the list. To change the order of the
+windows you can directly select a window with the mouse or @key{ALT} plus
+a number. That window will become the current one, and the
+other will be the @il{previous} window.
+@paragraph{}
+
+Use it to select the most recently used windows.
+@paragraph{}
+
+@refMenu{cmePrev,Shift+F6}
+
+@c --------------------------------------------------------------------------
+@subsection Close
+
+Closes the current window. If the content wasn't saved the editor will ask
+if you want to.
+@paragraph{}
+
+@refMenu{cmeClose,Alt+F3}
+
+@c --------------------------------------------------------------------------
+@subsection List
+
+Pops up the List of Windows dialog. This dialog contains the list of all the
+editor windows, the special windows and the closed windows.
+@p{}
+
+The editor windows are numbered starting from two and the list is sorted by
+number. If a window isn't saved an asterisk is placed between the number and
+the name.
+@p{}
+
+The special windows are: the message window (the number of lines is
+indicated), the project window, the clipboard window (the bytes used by it
+is indicated) and the InfView windows.
+@p{}
+
+The closed windows list is sorted alphabetically and holds the last closed
+windows. The editor stores important information about these windows so if
+you close and re-open one of them the size of the window and other values
+are restored.
+@p{}
+
+You can jump to any of the windows by selecting it with the mouse, with
+the arrow keys and @key{ENTER}, double clicking, or by using the
+@il{Go} button.
+@p{}
+
+A press of @key{Delete} or using the @il{Delete} button will delete the
+closed windows or close any open editor window.
+@p{}
+
+Using the @il{ReEnumerate} button you can force to compute the window numbers
+so all become continuous.
+@p{}
+
+@refMenu{cmeListWin,Alt+0}
+
+@c --------------------------------------------------------------------------
+@subsection User Screen
+
+Shows the DOS screen. Press any key to go back to the editor.
+@paragraph{}
+
+@refMenu{cmeUserScreen,Alt+F5}
+
+@c --------------------------------------------------------------------------
+@section Tool&Ops
+
+This menu contains all the configuration submenues and some useful tools.
+@paragraph{}
+
+@c --------------------------------------------------------------------------
+@subsection Options
+
+This submenu contains the configuration submenues. You can find the local and
+global edition options in the Edit menu. @x{Edit}.
+@p{}
+Some of the deeper submenues are explained here because the documentation
+tools limit how deep subsections can be nested.
+@p{}
+
+@c --------------------------------------------------------------------------
+@subsubsection Customize Colors
+
+This command allows to customize the colors used by the editor. Almost all
+the colors are configurable.
+@paragraph{}
+
+The first list, called @il{Group}, is the list of things used by the editor.
+Each entry in the group list has one or more colors in the @il{Item} list.
+First select the group you want to customize and then press @key{Tab} to
+move the cursor to the items list. To customize a color just select it in the
+list of items; the dialog will show a text example in the bottom right corner
+and the @il{Foreground} and @il{Background} colors will be indicated. Using the
+mouse or moving with @key{Tab} and using the arrow keys you can select any
+of the available colors; the sample text area will show the resulting combination.
+@paragraph{}
+
+Exiting the dialog with @key{ENTER} or with the @il{Ok} button the new colors
+will be applied. The colors are stored in the desktop file. If you are using
+one centralized desktop file these colors will be used each time you run
+the editor, if not the colors will be used only when you run the editor in
+that very same directory.
+@paragraph{}
+
+To learn more about the scope of the desktop files and how to indicate
+default values: @x{Desktop Files}.
+@paragraph{}
+
+If you want to use other colors not listed in this dialog you must
+customize the palette. @x{Color Palette}.
+@paragraph{}
+
+@refMenu1{cmeSetColors}
+
+@c --------------------------------------------------------------------------
+@subsubsection Color Palette
+
+This option allows to configure the palette of colors used by the editor. I
+think you know about palettes but I wrote a little explanation, just
+in case. @x{Text mode attributes}.
+@paragraph{}
+
+The @il{Color} radio buttons are used to select the index you want to
+customize. The @il{Red}, @il{Green} and @il{Blue} scroll bars can be used to
+customize the color. To modify one of the components use the mouse or use
+the @key{R}, @key{G} and @key{B} to increase the values and @key{Shift}+@key{R},
+@key{Shift}+@key{G} and @key{Shift}+@key{B} to decrease the values.
+@paragraph{}
+
+Exiting the dialog with @key{ESC} restores the values you had before selecting
+this option. Choosing the @il{Default} button the colors are set to the
+default values of VGA cards.
+@paragraph{}
+
+These settings are stored in the desktop file. @x{Desktop Files}.
+@paragraph{}
+
+@refMenu1{cmeEditPalette}
+
+@c --------------------------------------------------------------------------
+@subsubsection Color Theme
+
+With this option you can choose from a list of predefined groups of colors.
+@p{}
+
+Currently only a couple of color themes are available, users are encouraged to
+contribute their own themes.
+@p{}
+
+@refMenu1{cmeColorTheme}
+
+@c --------------------------------------------------------------------------
+@subsubsection Editor General
+@cindex backups, enable/disable
+@cindex backups, style
+@cindex backups, memorize
+@cindex desktop files, do not create
+@cindex tcedit.dst, do not create
+@cindex desktop files, style
+@cindex tcedit.dst, style
+@cindex closed windows, number
+@cindex message window, options
+@cindex project window, vertical
+
+This will open the general configuration dialog containing several
+options.
+@paragraph{}
+
+The @il{Save options} groups control various settings about which and how
+files are created by the editor.
+@paragraph{}
+
+@itemize @bullet
+@item Make backups: When enabled the editor keeps a backup of your files
+using the @file{.bkp} extension. It saved me many times.
+@item UNIX style backups: When enabled the backups are created appending a
+tilde symbol to the file extension. This is recommended only for systems that
+support long file names, not pure DOS.
+@item Hidden backups: The backups are created as hidden files, it can be used
+to keep backups, but at the same time make them less annoying.
+@item Remember bkps to delete: When you exit with @code{Quit} the editor
+deletes backup files. To do it the editor deletes files ending with
+@code{bkp}, but if you use UNIX style backups or just edit files in a
+directory other than the current it's hard to know where these files
+are located. For this reason the editor keeps a list of created backup files.
+If you exit normally this list is lost, so the next time you use the editor
+and exit with @code{Quit} only the backups created during this session will
+be deleted. This behavior can be modified choosing this option, when enabled
+the editor will store the list in the desktop file and retrieves it the next
+time you start the editor. By default this option is disabled because users
+that don't know about this mechanism and use a centralized desktop file
+could end up with a very long list of backup files, wasting memory and
+disk space.
+@item Don't create desktop files: When enabled the editor creates only one
+desktop file and not one per directory. @x{Desktop Files}.
+@item Save desktop files hidden: Just what the name says. That's useful if
+you want to create desktop files in each directory but don't want to
+see them in directory listings.
+@item Tile windows vertically first: It affects the @il{Windows|Tile} option.
+Normally this option starts splitting the screen by dividing the height of
+windows. When this option is selected the width is divided first.
+@item Save UNIX files as UNIX: When enabled the editor saves to disk UNIX
+files in UNIX format. That means that the conversion is done only
+internally and the format of the file on disk isn't altered when you
+save.
+@item Do not remember cursor position: If you enable it the editor won't
+remember the last cursor position of each editor window.
+@item Do not warn about read-only files: It disables the dialog that warns
+about opening read-only files. Disabling it you won't be asked about
+reverting the read-only attribute until you try to save the file.
+@item Open read-only files as R.O. buffers: When enabled the editor won't
+allow you to edit files with the read-only attribute. Note:
+it doesn't disable the warning, use the above mentioned option for
+this.
+@c @item Open only specified files: When enabled and you specify one or more
+@c file names in the command line the editor will close all the files already
+@c opened before opening the files specified by you. It helps to keep the
+@c desktop clean if you use only one global desktop file.
+@end itemize
+
+In the open, save, @il{etc.@:} dialogs you can sort backup files in a special
+way so they don't interfere with the rest of the files.
+@x{File open dialog}.@*
+You can also configure the editor to avoid creating backup files for some
+particular filenames or directories. @x{Do not create backups for}.
+@p{}
+
+The @il{Clock} group allows to turn on/off the clock and to choose 24 hs
+or AM/PM style. The clock is displayed in the top right corner of the screen.
+@paragraph{}
+
+The @il{Max. editor copies} controls how many copies of the same file can be
+opened at the same time. By default the value is one, so when you try to open
+a file twice the editor will just show you the first copy. Specifying a value
+different than one will allow you to open more copies of the same file. Only
+the first copy can be modified and the rest are read-only snap-shots of the
+file. Note it only affects the number of read-only copies automatically
+created by the editor, you can open as many as you want using the @il{File |
+Open Read-only copy} menu option. For more information: @x{Open Read-only copy}.
+@paragraph{}
+
+The @il{Max. closed to remember} value specifies how many closed files are
+remembered in the list of windows. This value can't be less than three and
+can't be greater than two hundred. If you reduce this value and there are
+already more files remembered the editor won't reduce the number
+immediately, instead you must choose which files to remove by hand.
+@paragraph{}
+
+The @code{+ Desktop} button opens a second dialog containing options about
+what is stored in the desktop files. Each section selects if the
+option will be remembered always (ever), only when no files are specified in
+the command line or never.
+@p{}
+
+@itemize @bullet
+@item Remember editor windows: it affects the opened files.
+@item Remember other windows: it affects other windows, like the help
+windows.
+@item Remember closed windows: it affects the list of closed files.
+@end itemize
+
+The second dialog contains a button to return to the first dialog.
+@p{}
+
+The @code{+ Others} button opens a third dialog containing options to
+configure the behavior of the message window when the last or first error in
+the list is reached.
+@p{}
+
+@itemize @bullet
+@item Just stop: nothing particular is done, the editor just stops.
+@item Indicate with a message: a message indicating you reached the first
+or last pops up.
+@item Wrap (circular list): the list becomes a circular list. So when you
+reach the last message the editor jumps to the first and @il{vice versa}.
+@item Make a beep: a sound is generated.
+@end itemize
+
+Additionally you can choose if you want project and message
+windows to be vertically or horizontally oriented in this dialog.
+@p{}
+
+@itemize @bullet
+@item Use the vertical direction: message and project windows are vertically
+oriented. By default they are positioned at the left side. When this option
+is selected the project window has only one column.
+@item Use the right side: use the right side of the screen instead of the
+left side. That's used only when the direction is vertical.
+@end itemize
+
+One important detail is that this options affects the size of newly opened
+files. If you already opened windows in this project the editor will have
+them memorized. So you should set up this options before creating a project.
+@p{}
+
+To control the size of the windows when you open a new file you have two
+options.
+@p{}
+
+@itemize @bullet
+@item Use reserved width or 7 (hz dir): In this case the editor will make
+windows smaller than the desktop by substracting the value entered in
+reserved width, for vertical direction projects, or a fixed ammount of seven
+for horizontal direction projects.
+@item Avoid message and project windows: When selected the editor will try to
+avoid using the desktop surface used by the message and project windows. The
+size computed is the size of these windows without zooming. If the resulting
+size is too small the window will overlap.
+@end itemize
+
+This dialog also has a button to go back to the main dialog.
+@p{}
+
+These settings are stored in the desktop file. @x{Desktop Files}.
+@paragraph{}
+
+@refMenu1{cmeEdGralOptions}
+
+@c --------------------------------------------------------------------------
+@subsubsection Check for modified files
+@cindex newer, files on disk
+@cindex reloading newer files
+@cindex checking if file changed
+
+When you edit a file the editor uses a copy of this file stored on memory.
+The copy on disk can be changed by another user or by a program. If it
+happends you can be working on a different file and you'll destroy those
+changes when saving. For this reason the editor must check if the
+modification time of the file changed. The editor does this check when:
+@p{}
+
+@enumerate
+@item You run an external program. This program could generate some output
+file and it could be one of the opened files.
+@item You select an editor window. This is done in the @code{idle loop}, so
+this check could be delayed a fraction of a second.
+@item Periodically for the focused file.
+@end enumerate
+
+The configuration dialog can be used to disable or fine tune these checks.
+The @code{Seconds between checks} option refers to the periodical checks.
+The other options are:
+@p{}
+
+@itemize @bullet
+@item Don't check after executing an external program. It disables the
+checks done after running an external program.
+@item Don't check while idle. It disables the the checks done periodically
+and also the checks done when you select a an editor window. That's because
+both are done when the editor have some free time.
+@end itemize
+
+When the editor detects a file on disk is newer than the file on memory a
+dialog asking if you want to load the new file pops up. This question will be
+done only once and no matters what you answer the editor will asume the
+problem is solved. This is to avoid an endless storm of questions.
+@p{}
+
+If you choose to load the file from disk the editor will check if the memory
+copy is also modified. In this case a collision between your changes and the
+external changes can lose data. For this reason the editor offers four
+options:
+@p{}
+
+@enumerate
+@item Load file from disk (discard changes): This is the default action, use
+it if you want to get a fresh copy discarding any changes done in memory.
+@item Abort operation: The editor does nothing and you must solve the problem
+manually.
+@item Load and show differences: This is like the first option, but the
+editor will invoke @code{diff} and load it's output. You can analize the
+differences between your changes and the external changes to solve the
+problem.
+@item Don't load and show differences: This is like the second option, but
+the editor invokes @code{diff} like in the third.
+@end enumerate
+
+The last two options are offered only if GNU diff is installed in your
+system. You can get GNU diff from the GNU site (http://www.gnu.org/).
+@p{}
+
+Note that when the editor offers a diff output this is loaded from a temporal
+file that is discarded as soon as loaded. For this reason the editor marks
+this window as read only. If you want to use this file to as input for
+@code{patch} just use the @code{Save As} option.
+@p{}
+
+@refMenu1{cmeSetModiCkOps}
+
+@c --------------------------------------------------------------------------
+@subsubsection Screen Saver
+@cindex screen saver
+
+This dialog customizes the screen saver. Note the question mark at the end of
+the term "screen saver" I did it because the plasma screen saver isn't too
+good to be used as a real saver for your screen.
+You can enable or disable, choose the time the editor will wait before
+starting the screen saver and the screen saver style. The @b{Test} button can
+be used to see how the screen saver looks like.
+@paragraph{}
+
+If you leave the mouse pointer in the upper right corner of the screen for
+a few seconds the screen saver is activated. This time is three seconds by
+default and can be configured entering the amount of seconds in the second
+box labeled @il{Time}.
+@paragraph{}
+
+Two types of screen savers are supported: internal and external. Internal
+screen savers are hardcoded in the editor. External screen savers are
+external programs started by the editor. If you select an external screen
+saver from the list the @b{Info} and @b{Help} buttons are enabled. Pressing
+these buttons you can get more information about the screen saver. You can
+pass additional parameters to the external screen saver filling the
+@il{External Saver} box.
+@paragraph{}
+
+If you want to write your own screen saver please download the sources of the
+editor and read the explanations found in the @il{scrnsave} directory. An
+external screen saver is basically a simple program that supports some
+special command line options and returns some specified return values.
+@paragraph{}
+
+@refMenu1{cmeScreenSaverOpts}
+
+@c --------------------------------------------------------------------------
+@subsubsection SDG Options
+
+These options customize the SDG module (SET's Documentation Generator).
+@mxref{Top,SDG Documentation,,SDG,SDG}.
+@paragraph{}
+
+@itemize @bullet
+@item Format file: Indicates the name of the format file used to generate
+the documentation.
+@item Intermediate file: The name of the temporal file used in the process.
+@item Base output: The base name of the output file. Doesn't include the
+extension.
+@item Directory of formats: The place where the editor will search for the
+format file.
+@item Keep intermediate: When enabled the temporal file isn't deleted, so
+you can see possible errors in it.
+@end itemize
+
+The SDG module uses the files listed in the project to collect the
+documentation from the comments. @x{Project}.
+@paragraph{}
+
+These settings are stored in the desktop file. @x{Desktop Files}.
+@paragraph{}
+
+@refMenu1{cmeSDGDialog}
+
+@c --------------------------------------------------------------------------
+@subsubsection Run program (which one)
+
+The editor can run an external program and collect the errors reported by it
+if you press the shortcut (@kbd{^F9}). A good example is the make program. Here
+you can select the name of the program. If you need to run more than one
+command separate it with @code{;}.
+@paragraph{}
+
+The editor will redirect the stderr (standard error output) and stdout
+(standard output) of the program and then will analize it looking for errors.
+The dialog includes a list of parsing algorithms to analize the errors from
+the external program. To learn how to configure the editor for other formats
+or just fine tune any of them @x{Error messages from an external application}.
+@paragraph{}
+
+The other options found in this dialog are a little bit complex. Here I'll
+try to explain each of these options but I recommend to just try them to see
+how they work.
+@paragraph{}
+
+Option @il{Use OS screen to run the program}: The editor will try to restore
+the contents of the screen. So it will look like as it was before running the
+editor. Meaning the program will be executed and the editor will redraw
+all the contents of the desktop and windows afterwards. This mechanism is
+useful when the program you want to run is interactive or doesn't use the
+standard output. Is important to understand that on some platforms and
+terminals the editor can't restore the contents of the screen and will just
+clean it to the grey over black color. It's also important to understand that
+when this option is enabled the program can't be executed in multitasking
+mode; it means the option @il{Don't try to run in background} will be
+implicitly selected.
+@paragraph{}
+
+Option @il{Don't try to run in background}: On some platforms (currently only
+Linux) the editor can execute the external program as a child process. It
+means the program will execute in parallel with the editor (in background).
+When the editor does this you'll see the message window indicate the
+program is running but won't say when you are back in the editor. Instead the
+output of the external program will start to fill the message window. You can
+select any other window and continue working while the external program runs.
+When the external program ends the editor will also collect the rest of the
+messages and errors in the background. While the editor is running the external
+program and/or parsing the remaining messages the status bar will show an
+option @code{Ctrl+C Stop}; clicking on it or pressing the indicated key the
+editor will stop the background process and will also stop collecting
+messages. The purpose of this option: When this
+option is enabled the editor won't try to run the external program in
+parallel even if the platform supports it. That's faster, but if the
+external program is slow you'll be forced to wait until it finishes and you
+won't be able to stop the program from the editor.
+@paragraph{}
+
+Option @il{Always parse in background}: If enabled the editor will collect the
+messages and errors in the background even if the platform doesn't support the
+execution of the external program in the background. On platforms that don't
+support the execution of the external program as a thread the editor will
+block until the external program ends and then will parse the messages and
+errors in the background. This is useful when the amount of messages and errors
+is big and the parsing will take a long time. In this way you can continue
+working while the editor does this job. You must understand that's even
+slower but you can at least use the time for reading or editing text.
+@paragraph{}
+
+Option @il{Jump to the first error}: If enabled the editor jumps to the
+file and line of the first error reported by the external program.
+@p{}
+
+Option @il{Don't redirect stdout}: Complements the
+@code{Use OS screen to run the program} option. When enabled the editor
+collects errors only from the standard error and not from the standard
+output. This is useful for interactive applications that sends its output to
+the standard output.
+@p{}
+
+The @il{Message window scroll} group of options are mutually exclusive and
+give some control over the behavior of the message window. When you start
+executing the external program the message window will automatically get the
+focus. As messages and errors are added to this window the window scrolls
+and shows the last message. When the external program finishes and the editor
+parses all the messages and errors the message window will get the focus
+again. Finally, if the editor found errors, the message window will scroll to
+the first line. This is the default behavior and you'll be able to see each
+of this steps only if the editor is running the external program in the
+background and/or parsing the messages and errors in the background. This
+behavior corresponds to the @il{Ever} (always) option. If you select the
+@il{Never} option the editor won't scroll the message window. In this case you can
+browse the messages even while the editor is collecting them. Finally you can
+choose @il{Only if not focused}. In this case you'll be able to browse the
+messages when the message window is selected, but if you select an other window
+the editor will start to scroll the message window. The fastest option is
+@il{Never} but then you won't see if the external program finished executing,
+unless you have the message window selected all the time.
+@paragraph{}
+
+The @il{Lines per pass} option is associated with the speed of parsing. This
+option takes effect only when the messages and errors are parsed in the
+background. What this option indicates is how many lines of messages and
+errors will be parsed before releasing the CPU. A bigger value will make the
+parsing faster but will make the editor slower and you'll start having
+problems to select windows and write text. You must experiment with this
+parameter. On my machine a value of 20 is acceptable.
+@paragraph{}
+
+All of these settings are stored in the desktop file. @x{Desktop Files}.
+@paragraph{}
+
+For more information about the behavior of the message window
+@x{Message Window}.
+@paragraph{}
+
+@refMenu1{cmeConfRunCommand}
+
+@c --------------------------------------------------------------------------
+@subsubsection Keyboard
+
+This is a submenu but due to limitations in the documentation tools I was
+forced to put it with the rest of the options listed in the @il{Options}
+submenu.
+@paragraph{}
+
+It contains all the options to customize the keyboard.
+
+@c --------------------------------------------------------------------------
+@subsubsection Key assignment
+
+With this command you can fully customize the keys used by the editor windows.
+It doesn't include the menues, for that you must edit the @file{menubind.smn}
+file.
+@paragraph{}
+
+To learn how to use this command consult: @x{How to configure the keyboard}.
+@paragraph{}
+
+@refMenu1{cmeEditKeyBind}
+
+@c --------------------------------------------------------------------------
+@subsubsection Setup Alt keys
+
+It allows you to select how the editor interpretes the left and right alt
+keys. For more information: @x{Alt key configuration}.
+@paragraph{}
+
+@refMenu1{cmeSetUpAltKeys}
+
+@c --------------------------------------------------------------------------
+@subsubsection Key pad behavior
+
+[DOS]
+@paragraph{}
+
+Here you can choose how the keypad is interpreted by the editor. Two options
+are provided. One is the BIOS default, in this mode the @key{NumLock} changes
+between arrows and numbers. In the other mode the behavior is similar, but
+holding shift and pressing a number will behave like an arrow key shifted,
+that's very common in DOS applications so that's the default.
+@paragraph{}
+
+@refMenu1{cmeKeyPadBehavior}
+
+@c --------------------------------------------------------------------------
+@subsubsection Back to defaults
+
+This option restores the default key assignments of the editor. Use it if you
+messed up the keyboard configuration and you want to get back
+the original values.
+@paragraph{}
+
+@refMenu1{cmeKbBackDefault}
+
+@c --------------------------------------------------------------------------
+@subsubsection Consult scan codes
+
+Used to consult the keyboard scan codes: @x{Consulting scan codes}.
+This dialog must be closed using the mouse to press the @code{OK} button
+because it displays the scan codes for the keys, even for @key{ESC} and
+@key{ENTER}.
+@p{}
+
+@refMenu1{cmeSeeScanCodes}
+
+@c --------------------------------------------------------------------------
+@subsubsection Screen Options
+
+This command opens the screen options configuration dialog. Here you can
+customize the video mode or window size. This dialog is available only when
+you are running in a terminal that can control the screen size. If you are
+looking for the screen saver: @x{Screen Saver}.
+@p{}
+
+Not all hardware drivers support it and not all the options are usable for
+all the drivers. With some you can't control the screen size, like in
+@b{Linux}, in other cases you have total control, like when you run the
+editor in @b{X11}, and in others you have limited control, like in @b{DOS}.
+@p{}
+
+The first group of options defines how the editor will try to set the video
+mode. The available options are:
+@p{}
+
+@itemize @bullet
+ @item Don't force: The editor won't try to change the screen size.
+ @item Same as last run: The editor will remember the last size used and
+will try to restore the closest possible size.
+ @item External program: It currently makes only sense in @b{DOS}. It can be
+used when you have an external program that can set the video mode for you.
+In this case you must also indicate the command line for it in the
+@b{External program} box.
+ @item Closest to specified size: The editor will try to select a screen
+size that's as close to the values indicated in @b{Width}, @b{Height},
+@b{Chars width} and @b{Chars height} boxes as possible. Note that some drivers
+support only a small set of fixed values and others have silly limitations
+imposed by the operating system.
+ @item Specified mode number: This is mainly for @b{DOS}. Use it if you know
+about a video mode supported by your video card that isn't known by the
+editor. In this case you must indicate the video mode number in the
+@b{Mode number} box.
+@end itemize
+
+Even when the video mode mechanism is for @b{DOS} you can use one of the video
+modes known by the editor even when running on @b{X11} or other terminals
+where the screen size can be changed at will. The following is a list of
+known video modes:
+@p{}
+
+@table3{Mode,Width x Height,Char Cell}
+@titem3{0x0003, 80 x 25,9 x 16}
+@titem3{0x0103, 80 x 28,9 x 14}
+@titem3{0x0703, 80 x 30,9 x 16}
+@titem3{0x0803, 80 x 34,9 x 14}
+@titem3{0x0203, 80 x 35,9 x 10}
+@titem3{0x0303, 80 x 40,9 x 10}
+@titem3{0x0403, 80 x 43,9 x 8}
+@titem3{0x0503, 80 x 50,9 x 8}
+@titem3{0x0108, 80 x 60,9 x 8}
+@titem3{0x0D03, 82 x 25,8 x 16}
+@titem3{0x0903, 90 x 30,9 x 16}
+@titem3{0x0A03, 90 x 34,9 x 14}
+@titem3{0x0B03, 94 x 30,9 x 16}
+@titem3{0x0C03, 94 x 34,9 x 14}
+@titem3{0x0109,132 x 25,9 x 14}
+@titem3{0x010A,132 x 43,9 x 11}
+@titem3{0x010B,132 x 50,9 x 10}
+@titem3{0x010C,132 x 60,9 x 8}
+@endtable-{}
+
+@refMenu1{cmeSetScreenOps}
+
+@c --------------------------------------------------------------------------
+@subsubsection Encodings
+
+This dialog is used to select the encodings used by the editor. This is a
+complex topic and you'll have to play a little bit with these options before
+you can get all the funtionality. Usually you won't need to use it unless you
+deal with more than one encoding.
+@p{}
+
+Currently the editor can only use files where one letter corresponds to just
+one character. It limits the editor to 256 different symbols. This is the
+common case for most operating systems and environments. Which symbols are
+represented by these 256 values is called an encoding.
+@p{}
+
+The encodings are also known as code pages. An example of a code page is the
+@b{DOS} code page 437 used by PC VGA boards or the ISO 8859-1 encoding used
+by most POSIX systems as a default encoding. Currently more than 47 encodings
+are supported. These encodings cover the latin, cyrillic and greek alphabets.
+If your alphabet or favorite encoding isn't supported please consider
+contributing.
+@p{}
+
+In most cases the editor will detect the encoding currently used by the
+operating system without problems. A special case is the @b{GNU/Linux} OS
+where the concept of code page doesn't really exist and you can find all kinds
+of errors in the fonts and unicode maps.
+@p{}
+
+This dialog can have two, three or four encodings to select, they are:
+@p{}
+
+@itemize @bullet
+ @item Application: which encoding the application uses, ie. used in your
+documents.
+ @item Input: how the data from the keyboard is encoded. It is usually the
+same encoding used by the screen. If the application and input code pages
+don't match the editor will translate the data from the keyboard to the
+application encoding.
+ @item Screen: the encoding if the screen. Not all hardware drivers support
+it because some of them work with a fixed code page and this value is known.
+Here you indicate how the font used by your hardware or OS is encoded. If
+this value doesn't match the application code page the editor will translate
+the data before sending it to the screen.
+ @item Second font: how the secondary font is encoded. This is available
+only when the driver supports more than one font at the same time.
+@end itemize
+
+If any of these settings doesn't have the @b{Force encoding} option selected
+then the editor will use what was detected.
+@p{}
+
+If you force the screen encoding the selected value must match the OS
+encoding. The exception is when you select a font in the @b{Fonts} dialog. In
+this case the editor will recode the selected font to match the encoding.
+Don't forget this interaction with the @b{Fonts} dialog. @x{Fonts}.
+@p{}
+
+Note that you can easily edit documents encoded in a code page different
+than the one used by the OS without doing any specific recoding. Example: if
+you are using @b{X11} and the ISO 8859-1 encoding but you want to edit a DOS
+file encoded using the 850 code page you just need to select the application
+encoding as @b{PC 850} and force it. Your keyboard will generate ISO 8859-1
+values, they will be translated into 850 encoding and put in your document.
+At the same time the text encoded using 850 code page will be translated to
+ISO 8859-1 before displaying it.
+@p{}
+
+@refMenu1{cmeEncodings}
+
+@c --------------------------------------------------------------------------
+@subsubsection Fonts
+
+This dialog is used to select the fonts used by the editor. Not all hardware
+drivers support custom fonts and some only support only one font. The
+editor can handle up to two fonts at the same time. However, the use of two
+fonts is complex.
+@p{}
+
+Only the fonts marked with @b{Load font} are used, don't forget to enable it
+before leaving this dialog.
+@p{}
+
+The size of the fonts must be the same, that's why even on systems that
+supports two fonts only one size can be selected.
+@p{}
+
+The offered fonts are the ones provided by the editor and not the OS. This is
+because some systems doesn't provide fonts and the systems that provide
+fonts usually provides only a few fixed width fonts. The font format used
+is documented in the Turbo Vision library.
+@p{}
+
+The fonts marked with @il{limited} don't cover all the encodings supported
+by the editor. @x{Encodings}.
+@p{}
+
+When you load a font the encoding for this font will be the value indicated
+by the screen encoding option selected in the @b{Encodings} dialog. If you
+change this encoding the editor will automatically change the encoding of the
+font.
+@p{}
+
+@refMenu1{cmeFonts}
+
+@c --------------------------------------------------------------------------
+@subsubsection User Words
+@cindex syntax highlight, defining user words
+
+This option is used to define reserved words defined by the user. A very
+common use is to define @code{typedef}s you normally use in your programs.
+The user words are language dependant. They are highlighted with a special
+color different than the color used for reserved words.
+@paragraph{}
+
+The first dialog is used to select the language, the names are the ones
+defined in the syntax highlighting file (@xp{Syntax Highlighting}). Selecting one of
+the names and pressing @key{ENTER} pops up the second dialog.
+@paragraph{}
+
+The next dialog is used to add or remove words to the list. Pressing
+@key{ENTER} you confirm the changes and they are saved to disk. If you exit
+with @key{ESC} the old list is preserved.
+@paragraph{}
+
+The user words are stored in a file called @file{userword.txt}, in the same
+directory all other configuration files are stored. Such a file isn't
+included in the distribution because those words must be defined by the
+user. You can edit the file by hand if you want, the format is
+very simple. The start of a list is marked with @code{.} followed by the name
+of the language. The items of the list are marked with @code{+}. Any line
+starting with a different character will be ignored during the parsing.
+@paragraph{}
+
+Note: The menu option is "Tool&Ops|Options|User Words".
+@paragraph{}
+
+@refMenu1{cmeEditUserWords}
+
+@c --------------------------------------------------------------------------
+@subsubsection Default global edition
+
+To understand how this menu option works you must know some details about the
+global options of the editor. @x{Set Global}.
+@paragraph{}
+
+The global options are good, but sometimes you want to make some small
+differences depending on the kind of file you are editing. For example: I
+want the @il{Intelligent indent} mode enabled for C, but not for most of the
+files, I also want to wrap lines for Texinfo files and files without syntax
+highlighting. That's impossible to achieve just using the global options,
+that's when this option comes into play.
+@paragraph{}
+
+The mechanism is like this: each time you open a new file the editor will
+copy the default global options to it and select the syntax highlighting
+according to various things, mainly the extension. Once the editor
+selects the syntax highlighting the next step is to transfer some options that
+apply only to the selected syntax highlighting. By default the list of options
+to apply is empty but you can add some using this menu option.
+@paragraph{}
+
+The list of options indicates which settings will be enabled, or disabled,
+in addition to the global options. That's something very important to keep
+in mind, the list does not replace the global options, it modifies them. So
+the list will say things like "also enable the intelligent indent",
+"disable the wrap lines", @il{etc.}
+@paragraph{}
+
+The first dialog shows the list of syntax highlighting defined in the
+@file{syntaxhl.shl} and has three buttons. The @code{Edit} button is the
+default button, so pressing @key{ENTER} you'll edit the settings for the
+selected syntax highlighting. The @code{No SHL} button is used to edit the
+options that will be applied for files with no syntax highlighting
+associated to.
+@paragraph{}
+
+Once you selected a syntax highlighting a dialog with the list of the settings
+for it will appear. The first time it will be empty because those are defined
+by the user, and therefore no defaults are provided. In this list
+the settings that will be enabled in addition to the global options are
+marked with a @code{+} before the name of the option. The options that will
+be disabled are marked with a @code{-}. The options are the same described
+in the editing modes section. @x{Editing Modes}.
+@paragraph{}
+
+The dialog contains an @code{Add} and a @code{Delete} button like other
+dialogs. You can also use the @key{Insert} and @key{Delete} keys. When adding
+a new setting to the list a dialog containing the list of available settings
+is displayed. Note that this list contains all the settings that are available,
+once you add one of them to the previous dialog it is removed from this list.
+@paragraph{}
+
+After selecting one setting to add a new dialog will be displayed. This
+dialog will ask information related to this setting. Most settings are flags
+that can be @il{added} or @il{removed} from the global options, but some of
+them are just values that will overwrite the global options. Examples of the
+last type are the tab size and the wrap column; in this case the dialog will
+ask for the value.
+@paragraph{}
+
+The values are stored in a very simple format in the @file{deflopts.txt}
+file. You can edit this file by hand, but in this case you'll need to know
+the names of the settings. The format is very simple, a line starting with
+@code{.} starts a section, the full stop is followed by the name of the
+highlighting affected. Flags that will be added (enabled or ored) are marked
+with a @code{+} as in the dialog, flags that will be substracted (disabled
+or anded) are marked with a @code{-} again like in the dialog, in fact the
+dialog shows the same string as those in the file. If the setting is numeric
+it will ever start with @code{+} and after the name a @code{=} and the
+asigned value will follow. Just play a little bit and see the resulting file.
+@paragraph{}
+
+@refMenu1{cmeEditDeflOpts}
+
+@c --------------------------------------------------------------------------
+@subsubsection File open dialog
+
+This command is used to configure some details of the file open dialog.
+@x{File Open}.
+
+@refMenu1{cmeFileOpenOptions}
+
+@c --------------------------------------------------------------------------
+@subsubsection Do not create backups for
+@cindex backups, selective
+
+Sometimes you don't want to create backups for some particular files. In my
+case I use a tool called @il{cvs}. It generates some temporal files and calls
+the editor so I can write some information. Those files are short and
+temporal, creating backups for them doesn't make any sense.
+@p{}
+
+This command shows a configuration dialog where you can enter a list of
+regular expressions. If any of these regular expressions match with the file
+name of the file you are about to save then the editor won't create a backup
+file for it. The regular expressions are Perl style because I think they are
+much more intuitive than POSIX regex.
+@p{}
+
+The list shown in this dialog is stored in a file called @file{nobkp.txt}.
+The exact place of the file depends on your system like other files created
+by the editor.
+@p{}
+
+Note that files listed here aren't remembered in the list of closed editors.
+That's because the editor assumes those files are temporal and you won't need
+to use them again.
+@p{}
+
+@refMenu1{cmeEditNoBkp}
+
+@c --------------------------------------------------------------------------
+@subsubsection Search files under cursor in
+@cindex files, search
+
+When you press @kbd{Ctrl+Enter} the editor tries to load the file that's in
+the text at the cursor position. If the cursor is in an include line the
+editor will extract the name of the header. In any other case the editor will
+try to find where the name starts and ends.
+@p{}
+
+If the file isn't located in the current directory the editor will try to
+find the file in the list of directories indicated by this option.
+@p{}
+
+You can use environment variables for this list. Here is an example that
+shows how to use the content of the @code{ALLEGRO} environment variable:
+@p{}
+
+@example
+$(ALLEGRO)/include
+@end example
+
+If the editor failed to find the file and a project is loaded a search in the
+project is performed. If this also fails the editor looks for the file in the
+same directory of the file you are editing.
+@p{}
+
+This list is stored in the desktop file.
+@p{}
+
+@refMenu1{cmeIncludeList}
+
+@c --------------------------------------------------------------------------
+@subsubsection List of tag files
+@cindex tags, list of files
+
+This dialog controls which tag files are loaded to search for symbols. To
+learn more about tags please read the corresponding chapter. @x{TAGS files}.
+@p{}
+
+When you add a file the editor tries to load it and shows how many symbols it
+contains.
+@p{}
+
+After selecting a new tag file a dialog will ask if you want to add it
+using a relative path. This is a very important question. If you are using
+one centralized desktop file and you have just a few projects you can add a
+list of tag files in this desktop file, but the list must contain absolute
+entries. If you are entering a list of tag files for a project or a local
+desktop file I recommend using relative paths, but it depends on your needs.
+@p{}
+
+@refMenu1{cmeTagFiles}
+
+@c --------------------------------------------------------------------------
+@subsubsection Tag files options
+
+To maintain the tag files you should use a makefile. This
+makefile will update the tag files when any of your sources changes.
+@p{}
+
+To make things easier the editor provides an option to automatically keep
+the tag files updated. This option can be enabled from this dialog and only
+works if you are using a project.
+@p{}
+
+When this option is enabled and you perform a search that involves tags the
+editor will automatically check if any of the files included in your project
+is newer than the tag files. If newer files were found the editor will
+invoke ctags to update the tags. If you delete the tag files the editor will
+create a new one.
+@p{}
+
+This option works with a tags file called @file{tags} located in the same
+directory as the project. This file will be listed in the list of tag files
+to search but marked with @code{automatic}. You won't be able to remove this
+entry from the list manually.
+@p{}
+
+When new items are added to the project they are marked in a way that their
+symbols will be added to the tags file, but when you remove items symbols
+from this file aren't removed. If this is annoying just remove the
+@file{tags} file and let the editor create a new one.
+@p{}
+
+@refMenu1{cmeTagsOps}
+
+@c --------------------------------------------------------------------------
+@subsubsection Regenerate central file
+
+The central file is maintained using the incremental features of ctags. Some
+times ctags fails to remove obsolete entries in the tags file. This bug can
+become really annoying. In this case you can use this command to regenerate
+the file from scratch.
+@p{}
+
+@refMenu1{cmeTagsAutoRegen}
+
+@c --------------------------------------------------------------------------
+@subsubsection Calendar options
+
+The editor can mark holidays in the calendar using a different color. As
+holidays depends on the country this feature needs to know:
+@p{}
+
+@enumerate
+@item What's your country
+@item About the holidays celebrated in your country.
+@end enumerate
+
+The first is achieved using the contents of the @var{LANG} environment
+variable and a file called @file{holidays.conf}. This dialog can be used to
+force the country when the @var{LANG} isn't enough or you don't want to set
+this variable.
+@p{}
+
+The second is achieved using plug-ins. Currently the editor supports it only
+for systems that implements the @code{dlopen} family of functions. If you
+can't find a plug-in for your country and you know how to write small C
+programs consider wrtiting a plug-in for your country. The information about
+how to do it is contained in the sources distribution. Look for a directory
+called @file{holidays}, it contains a @file{README} file. If you need
+assistance contact the author. Please consider contributing the plug-in so
+other people from your country can share the benefits.
+@p{}
+
+@refMenu1{cmeHolidaysConf}
+
+@c --------------------------------------------------------------------------
+@subsubsection Advice dialogs
+
+In some situations the editor offers some advice to guide new users. These
+are called @il{advice dialogs}. They can be disabled using a check box in the
+dialog.
+@p{}
+
+This option is used to enable or disable any of the advice dialogs. Texts
+marked with an @code{X} indicates the corresponding dialog is enabled. Use
+the @key{space} key to change the desired dialog.
+@p{}
+
+@refMenu1{cmeAdviceDiagConf}
+
+@c --------------------------------------------------------------------------
+@subsection Calculator (command/menu)
+
+This command shows the calculator: @x{Calculator}.
+@paragraph{}
+
+@refMenu{cmeCalculator,Alt+F4}
+
+@c --------------------------------------------------------------------------
+@subsection SDG
+
+Runs the documentation module: @mxref{Top,SDG Documentation,,SDG,SDG}.
+@paragraph{}
+
+To configure the SDG module: @x{SDG Options}.
+
+@refMenu{cmeSDG,F9}
+
+@c --------------------------------------------------------------------------
+@subsection Run program
+
+Runs the desired program. To customize which program to run:
+@x{Run program (which one)}.
+@paragraph{}
+
+@refMenu{cmeRunCommand,Ctrl+F9}
+
+@c --------------------------------------------------------------------------
+@subsection Grep
+
+This command pops up the @il{Powered Grep} dialog. Grep is a very powerful
+tool to search text in files. To be able to use it you @b{must} have the
+grep tool installed and in the path. It isn't shipped with the editor.
+@paragraph{}
+
+@itemize @bullet
+@item Pattern Box: The text you want to search for. You can use regular
+expressions here. @x{Regular Expressions}.
+@item Files to search: The mask used to select the files grep will
+search through. Wildcards and some limited basic regular expressions
+are supported here.
+@item Directories to search: The list of directories where the search will
+be performed.
+@end itemize
+
+The @il{Source of pattern} options are used to define the text that will be
+searched for:
+@paragraph{}
+
+@itemize @bullet
+@item Pattern box is the pattern: grep will search the text indicated in the
+pattern box.
+@item Pattern box is a file name: to search words contained in a text file.
+@item Use clipboard selection: use the clipboard selection instead
+of the pattern box text. @x{Clipboard}.
+@end itemize
+
+The @il{Type of pattern} option selects how the pattern is interpreted. The
+options are directly related to the grep switches @code{-G}, @code{-E} and
+@code{-F}. You can select basic regular expressions, extended regular
+expressions or just a list of matching values separated by carriage returns.
+@x{Regular Expressions}.
+@paragraph{}
+
+The @il{Place to search} group is used to select which files are examined in
+the search:
+@paragraph{}
+
+@itemize @bullet
+@item Use files to search: The files to search content is the mask.
+@item Search in opened windows: The search is performed in all the opened
+text files.
+@item Search in project: The search is performed in all the project files.
+@x{Project}.
+@item Recurse in subdirs: When enabled the editor will run grep not only
+in the indicated directories but in any subdirectory contained therein
+as well. That's the main reason because I call it @b{Powered} Grep.
+@end itemize
+
+The @il{Options} group contains various options that are self-explanatory.
+They include: case sensitive search, whole word and whole line matching and
+inverse matching. The last reports the lines that don't match, so be careful.
+@paragraph{}
+
+After the search the matched lines are displayed in the message window and
+by pressing @kbd{Alt+F7} and @kbd{Alt+F8} you can examine them.
+@paragraph{}
+
+To learn more about the message window @x{Message Window}.
+@paragraph{}
+
+@refMenu1{cmeGrepDialog}
+
+@c --------------------------------------------------------------------------
+@subsection HTML Accents
+
+The following options are useful for people using ISO Latin 1 accents in your
+HTML code. Even when the current code page is different than ISO Latin 1.
+
+@subsubsection Convert accents to tags
+
+It converts all the accents in the text to ISO-Latin-1 HTML tags. That's
+useful when editing html files because you can type accents naturally and
+can simply use this option to generate the right tags. It works
+for any code page selected.
+@paragraph{}
+
+@refMenu1{cmeHTMLAccents}
+
+@subsubsection Convert tags to accents
+
+It converts all the ISO-Latin-1 HTML tags into accents. That's useful when
+reading html files because you can convert the tags to symbols. It works
+for any code page selected.
+@paragraph{}
+
+@refMenu1{cmeHTMLTag2Accent}
+
+@c --------------------------------------------------------------------------
+@subsection Export as HTML
+
+This option is used to export the current text file as HTML. The default
+options generates a very good WYSIWYG result. This option works for any
+syntax highlighting mode and for any color configuration you want.
+@paragraph{}
+
+Under DOS you can customize the editor's palette, this feature will export
+the customized colors too.
+@paragraph{}
+
+Note that due to limitations in the HTML language the editor can change the
+background color on a word-by-word basis only.
+@paragraph{}
+
+The available options are:
+@paragraph{}
+
+@itemize @bullet
+@item File name as title: uses the full path and name of the file as the
+title for the generated HTML.
+@item Same background color as the editor: defines the background of the HTML
+file to be equal to the background of the editor's window.
+@item Monospaced font: sets the font for the HTML to @il{Courier New}.
+@item Bold attribute: sets the font for the HTML to @il{bold}.
+@end itemize
+
+You can also choose between colorized or simple output. Using colors the size
+of the file is increased a lot but the result is very nice.
+@paragraph{}
+
+@refMenu1{cmeExportAsHTML}
+
+@c --------------------------------------------------------------------------
+@subsection Insert key name
+@cindex keys, names
+
+This command brings up a dialog asking you to press a key. When you press a key
+the dialog is closed and the name of the key is inserted at the cursor
+position. You can use it to configure the menues (@file{menubind.smn}).
+@x{How to configure the keyboard}.
+
+@refMenu1{cmcInsertKeyName}
+
+@c --------------------------------------------------------------------------
+@subsection Remap code page
+
+With this command you can change the code page encoding of the current
+document. This operation will translate all the characters from the current
+encoding to a new one. Characters that don't have an equivalent in the new
+code page are converted to spaces.
+@paragraph{}
+
+The dialog asks for the original code page ('from' list) and the new code page
+('to' list). Additionally you can allow the editor to also translate the first
+32 values. Translating the first 32 values can be dangerous; for this
+reason the editor won't translate carriage return, line feed and tabs even if
+you choose to remap the first values.
+@paragraph{}
+
+This operation affects the buffer globally so you can't use undo. Therefore
+you should keep a copy of the file and don't save it if the results aren't
+what you expected.
+@paragraph{}
+
+This option is very useful to exchange texts between different operating
+systems.
+@paragraph{}
+
+@refMenu1{cmeRemapCodePage}
+
+@c --------------------------------------------------------------------------
+@subsection Profile Editor
+
+This option is used to measure the speed of the editor. Use large files
+and to make results comparable always use the same one.
+@paragraph{}
+
+@refMenu1{cmcProfileEditor}
+
+@c --------------------------------------------------------------------------
+@subsection Redraw screen
+@cindex screen, redraw
+@cindex redrawing the screen
+
+This command forces a redraw of the screen. It might be needed if some
+application running in the background messed up your console.
+@paragraph{}
+
+@refMenu1{cmeReDraw}
+
+@c --------------------------------------------------------------------------
+@subsection Paste Emacs mode
+@cindex syntax highlight, paste mode
+
+Pastes a comment at the start of the file indicating the Emacs mode and the
+tab size used for this file. That's very useful if the file doesn't have
+an extension or the extension is ambiguous. It is also a good idea to do it if
+you'll send the file to another person and want to indicate which tab size
+you used.
+@paragraph{}
+The editor understands this comment and sets the syntax highlighting and tab
+size to the value indicated.
+@paragraph{}
+
+@refMenu1{cmcPasteEmacsMode}
+
+@c --------------------------------------------------------------------------
+@subsection Block quoted printable decode
+@cindex quoted printable
+@cindex MIME quoted printable
+
+This option decodes the selected text assuming it is encoded with the quoted
+printable MIME spec. That's useful if you have an e-mail with non-ASCII
+characters and it was encoded with this method. That's very useful for
+spanish accents.
+@paragraph{}
+
+@refMenu1{cmcQuotedPrintDecode}
+
+@c --------------------------------------------------------------------------
+@subsection Un/Indent block
+
+This submenu contains the block indentation operations.
+
+@c --------------------------------------------------------------------------
+@subsubsection Indent one space
+
+Indents a block one space. For more information @x{Indentation}.
+
+@refMenu1{cmcIndentBlkOne}
+
+@c --------------------------------------------------------------------------
+@subsubsection Unindent one character
+
+Unindents a block one character. For more information @x{Indentation}.
+
+@refMenu1{cmcUnIndentBlkOne}
+
+@c --------------------------------------------------------------------------
+@subsubsection Indent one tab or gap
+
+Indents a block as if you used the @key{Tab} key in each line.
+For more information @x{Indentation}.
+
+@refMenu1{cmcIndentBlk}
+
+@c --------------------------------------------------------------------------
+@subsubsection Unindent one tab or gap
+
+Unindents a block as if you used the @key{Backspace} key in all of the
+lines. For more information @x{Indentation}.
+
+@refMenu1{cmcUnIndentBlk}
+
+@c --------------------------------------------------------------------------
+@subsubsection Comment indent
+
+This command inserts a comment at the start of each line of the selected
+block. The comment used is the one defined in the syntax highlighting file as
+@code{EOLComment1}; if none is defined or the file doesn't have any syntax
+highlighting this command does nothing. @x{EOLComment1}.
+@p{}
+
+If no text is selected this command first selects the current line and then
+applies the indentation.
+@p{}
+
+@refMenu1{cmcCommentIndent}
+
+@c --------------------------------------------------------------------------
+@subsubsection Comment unindent
+
+This command removes as many chars from each selected line as the length of
+a comment sequence. The comment used is the one defined in the syntax
+highlighting file as @code{EOLComment1}; if none is defined or the file doesn't
+have any syntax highlighting this command does nothing.
+@x{EOLComment1}.
+@p{}
+
+This command doesn't check if each line you selected starts with the defined
+comment, so be careful.
+@p{}
+
+If no text is selected this command first selects the current line and then
+applies the indentation.
+@p{}
+
+@refMenu1{cmcCommentUnIndent}
+
+@c --------------------------------------------------------------------------
+@subsubsection Arbitrary indent
+
+This command pops up a dialog asking for a text to be used as indentation.
+The text will be inserted at the start of each line of the selected block.
+
+@refMenu1{cmcArbitraryIndent}
+
+@c --------------------------------------------------------------------------
+@subsection Delete memorized backups
+@cindex backups, delete
+
+Deletes all the memorized backups. This includes all the backups created while
+the current project/desktop file was opened. If you want to also delete
+backup files created during previous sessions you must enable a special
+option that makes the editor keep a list across sessions.
+@x{Editor General}.
+@paragraph{}
+
+@refMenu1{cmeDeleteBkps}
+
+@c --------------------------------------------------------------------------
+@section Project
+
+The project files are used to indicate groups of files. Each project has
+its own desktop file so you can have different settings for different
+groups of files. @x{Desktop Files}.
+@paragraph{}
+
+There are several reasons to use projects:
+@paragraph{}
+
+@itemize @bullet
+@item If you want to work on a group of files and you will be editing these
+files for a long time use a project. Then you will be able to select which
+file to edit from the project window, as this window is sorted alphabetically
+it's easy to make incremental searches (typing the first letters) to find the
+file. Additionally the editor saves the window position and other stuff for
+all the files listed in the project, even if they aren't listed in the closed
+windows list. I use it for my web site files; they are more than 44 and the
+list of windows (@kbd{Alt+0}) doesn't help.
+
+@item If you are using the SDG module to collect the comments of the
+files you need to use a project to specify them.
+
+@item You can use a project to list a set of files to search with grep.
+Each time you want to search in these files you just open this project and
+perform the search.
+@end itemize
+
+By default the project window is located at the bottom of the desktop, but
+you can change this. @x{Editor General}.
+@p{}
+
+This window shows only the names of the files and the relative path only when
+names are repeated. You can change it to display the relative path for all
+files pressing @kbd{Alt+V} when the project window is selected.
+@p{}
+
+@c --------------------------------------------------------------------------
+@subsection Open (Project)
+
+Opens a project file. To create a new file just enter a new name in the
+dialog.
+@paragraph{}
+
+@refMenu1{cmeOpenPrj}
+
+@c --------------------------------------------------------------------------
+@subsection Close (Project)
+
+Close the project file.
+@paragraph{}
+
+@refMenu1{cmeClosePrj}
+
+@c --------------------------------------------------------------------------
+@subsection Save (Project)
+
+Saves the current project. It's a good idea to save the project after adding or
+removing a lot of files.
+@p{}
+
+@refMenu1{cmeSavePrj}
+
+@c --------------------------------------------------------------------------
+@subsection Save desktop here
+
+Saves a desktop file in the working directory. A desktop file is created even
+if the editor is configured to use only one central desktop file. This is
+useful to locally store settings without creating a project.
+@p{}
+
+@refMenu1{cmeSaveDesktop}
+
+@c --------------------------------------------------------------------------
+@subsection Export project
+
+Creates a text file containing the names of the project items. The file
+contains one file per line.
+@p{}
+
+@refMenu1{cmeExportPrj}
+
+@c --------------------------------------------------------------------------
+@subsection Import project items
+
+Imports the names given in the file as project items. The file with the file
+names to import must contain one file per line. Relative paths are
+recommended. The editor will check if the file exists and if that's a
+regular file, if not the item will be rejected.
+@p{}
+
+At the end of the import process the editor informs how many items were
+added, how many were already in the project and how many file names didn't
+correspond to existing files.
+@p{}
+
+@refMenu1{cmeImportPrj}
+
+@c --------------------------------------------------------------------------
+@section Help
+
+@c --------------------------------------------------------------------------
+@subsection InfView
+
+Well, I think you figured it out, that's the help.
+@paragraph{}
+
+@refMenu{cmeInfView,F1}
+
+@c --------------------------------------------------------------------------
+@subsection Another InfView
+
+It opens another InfView window. The editor @b{always} opens one window that's
+used by the help system. When you close this window the editor just hides it
+and when you press @key{F1} the window is un-hided and the help is displayed.
+That allows the existence of the @il{Previous help} command. But some times
+you could want to brise one or more help files without losing the help
+window, in this case you need more than one InfView opened.
+@paragraph{}
+
+@refMenu1{cmeAnotherInfView}
+
+@c --------------------------------------------------------------------------
+@subsection Tip of the day
+
+Once a day the editor shows a usage tip when you start it. Each tip talks about one
+interesting feature that most of the people overlook. Reading them
+you'll discover a lot of interesting things about the editor.
+@paragraph{}
+
+Each tip has one or more buttons at the right, which represent a link to a
+help topic related to this tip. If you want to learn more about the tip's
+topic you can browse the help using the buttons.
+@paragraph{}
+
+There are three options at the bottom of the window, they are self
+explanatory. The first disables the annoying tips ;-), the second shows the
+tips in a dialog box once a day and the third shows the same text in the
+message window (once a day of course). The third option is less annoying than
+the second but you lose the link buttons.
+@paragraph{}
+
+The text displayed by the tips can be found in the @file{editor.tip} file. You can
+edit it to show anything but be careful because the parser isn't very
+tolerant to typos.
+@paragraph{}
+
+To learn more about the message window @x{Message Window}.
+@paragraph{}
+
+@refMenu1{cmeTipOfTheDay}
+
+@c --------------------------------------------------------------------------
+@subsection Syntax help
+
+When programming in a language like C you probably can't remember the exact
+name of all the library functions; the djgpp libc help contains around 650
+nodes and the Allegro help around 400. Placing the cursor over the name of a
+library function and pressing @key{^F1} you'll get help about this function.
+If the name isn't exactly typed you'll get a list of the closest matches. The
+following topics explain how to configure it.
+
+@c --------------------------------------------------------------------------
+@subsubsection Options (Syntax help)
+
+This dialog box allows the configuration of the syntax help.
+@xref{Syntax help}.
+@paragraph{}
+
+The search method used can be:
+@paragraph{}
+@itemize @bullet
+
+@item Exact: Only exact matches are reported.
+@item Substring: Partial matches are reported.
+@item Fuzzy: It uses a special algorithm that reports words similar to the
+one you are searching.
+@end itemize
+
+The available options are:
+@paragraph{}
+@itemize @bullet
+
+@item Case sensitive: The search interpretes lower case characters as different
+than uppercase characters.
+@item Sort by score: The matches are sorted by score when reported. When
+disabled the sorting criteria is alphabetical. A greater score means the
+match is more similar to the word you are searching. A score of 1000
+means exact match.
+@item Fuzzy value: That's used only when the selected mode is the fuzzy mode.
+It indicates the minimal score a word must have to be displayed as
+a possible match. Experiment with different values and see the scores
+reported.
+@end itemize
+
+@refMenu1{cmeSyntaxHelpOps}
+
+@c --------------------------------------------------------------------------
+@subsubsection Files to search (Syntax help)
+
+Here you can indicate in which info files the editor will search the name of
+the function; the default is OS dependent. @x{Syntax help}.
+@paragraph{}
+
+You can specify an info node or just the name of the file. In the first case
+the editor will read all the cross references found in this node, in the
+second the editor will use all the nodes of the file. Normally the node that
+contains all the relevant references is called Index, but there are
+exceptions; one interesting case is libc.
+@paragraph{}
+
+In the dialog the editor shows which nodes are searched in. If the name
+has a question mark to the left it means the editor didn't read the file
+yet, pressing @key{^F1} over any word the editor will search it and hence
+will read the help files. If the name has an asterisk it means some error
+was encoutered when trying to read this file. Finally if no mark is indicated
+it means the editor successfully read the file, additionally the number of
+nodes found is indicated to the right. You can add or remove nodes from the
+list.
+@paragraph{}
+
+@refMenu1{cmeSyntaxHelpFiles}
+
+@c --------------------------------------------------------------------------
+@subsubsection Search (Syntax help)
+
+It makes the syntax search and report the matches found. If only one match
+was found the editor jumps to this node. @x{Syntax help}.
+@paragraph{}
+
+@refMenu{cmeSyntaxHelp,^F1}
+
+@c --------------------------------------------------------------------------
+@chapter Menues configuration
+
+ If you need or want to configure the shortcuts activating the menues or
+menue options look at the @file{menubind.smn} file. The format is self explanatory
+and the editor supports syntax highlighting for these files.
+@p{}
+
+ This file also configures the @il{status bar}, that's the line at the bottom
+of the screen. This line is context sensitive and also contains shortcuts.
+Some of the shortcuts can be invisible.
+@p{}
+
+ Finally you can also configure the menu displayed when you click over an
+editor window using the right mouse button.
+@p{}
+
+ The menues and status bar can be used to complement the keyboard
+assignments. You can assing editor commands, sLisp macros or small portions of
+sLisp code to them.
+@p{}
+
+ This chapter is a small reference about the commands you can use in the
+@file{menubind.smn} file.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section SubMenu and EndSubMenu
+
+ The @code{SubMenu} command starts a menu definition. It can be nested. When
+used at top level defines a new entry in the menu bar. When used inside
+another @code{SubMenu} section defines a child menu.
+@p{}
+
+ The @code{EndSubMenu} marks the end of a menu section.
+@p{}
+
+ The syntax for @code{SubMenu} is:
+@p{}
+
+@example
+ SubMenu: "Visible name", key
+ ...
+ EndSubMenu
+@end example
+
+ The visible name is what you'll see in the menu bar or the entry in the
+parent menu. Usually you assign a key to submenues so they can be easily
+selected. That's what you put in the @il{key} field. To highlight the key you
+can use the @code{~} character. This character indicates the beggining and
+the end of a highlighted text. The following example shows a submenu called
+File that's triggered when @kbd{Alt+F} is pressed and that marks the @il{F}
+with a different color:
+@p{}
+
+@example
+ SubMenu: "~F~ile", kbAlF
+@end example
+
+@c --------------------------------------------------------------------------
+@section Key names
+
+ When defining a menu entry you must indicate the name of the key or key
+combination. The editor have a command specially designed to help you with
+it, look in the @il{Tool&Ops} menu (@xp{Insert key name}). Here is a small
+explanation about how those names are created.
+@p{}
+
+ In menues all key combinations start with the @code{kb} preffix. Then
+follows the key modifiers. They can be:
+@p{}
+
+@table2{name,key}
+@titemR{Sh,Shift}
+@titemR{Ct,Control}
+@titemR{al,Right Alt}
+@titemR{Al,Left Alt}
+@endtable-{}
+
+ Avoid using the right alt definitions unless you know very well the side
+effects. You can specify more than one modifier but they must be in the order
+shown in the table. Suppose you want to indicate a complex key combination
+where shift, control and the left alt key must be pressed together the
+result is @code{kbShCtAl}. Note that is not valid if you change the order. As
+an example @code{kbShAlCt} is invalid.
+@p{}
+
+ After the modifier comes the key name. The key name is usually the
+character you obtain by pressing the key or the name of the character you
+obtain. For the alphabet characters is quite simple, @code{kbA} is just the
+key that generates the @code{a}. The same is for numbers. Function keys are
+also easy, they are named F and the number of the function key.
+@p{}
+
+ Things becomes more complex and even confusing for other characters. At
+first you must know the name I gave to each symbol and then you must
+understand a small complexity created by the fact that some shifted keys
+generates non-related symbols. Here is an example: @code{kbSh1} is valid but
+you won't get this combination because when you press @key{1} plus shift what
+you obtain is @code{!}. The editor will interpret it as @code{kbAdmid}.
+@p{}
+
+ Here is a list of the names, but the best is to use the @il{Insert key name}
+option: OpenBrace, BackSlash, CloseBrace, Pause, Esc, BackSpace, Tab, Enter,
+Colon, Quote, Grave, Comma, Stop, Slash, Asterisk, Space, Minus, Plus, PrnScr,
+Equal, Home, Up, PgUp, Left, Right, End, Down, PgDn, Insert, Delete, Caret,
+Admid, DobleQuote, Numeral, Dolar, Percent, Amper, OpenPar, ClosePar, DoubleDot,
+LessThan, GreaterThan, Question, A_Roba, Or, UnderLine, OpenCurly, CloseCurly,
+Tilde, Macro, WinLeft, WinRight and WinSel.
+@p{}
+
+ When you have to indicate that no key the @code{kbUnknown} name can be
+used.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section MenuItem entries
+
+ To add a menu entry you can use the @code{MenuItem} command. The syntax is:
+@p{}
+
+@example
+MenuItem: "Name", Command[, Key [, Context [,"KeyName"]]]
+@end example
+
+ The name is the visible entry in the menu. The command is the command
+assigned to this menu entry. If this menu entry have a shortcut it must be
+indicated in the key field. The context field is used to indicate a help
+context. The keyname field is just an string that is displayed at the right
+of the name of the menu entry to show the shortcut. This syntax is not very
+common because you usually don't want to specify a particular help context.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section Commands in menu items
+
+ You can use any of the editor commands in the commands field. They are
+listed in the commands index (@xp{Index of key commands}). Additionally you
+can specify the name of a sLisp macro or a small piece of sLisp code.
+@p{}
+
+ To indicate the name of a sLisp macro just use the following syntax:
+@code{cm(NAME)}. To enter a small portion of sLisp code use it:
+@code{cm((CODE))}. Here is an example that just prints a message in the
+message window: @code{cm((ShowInMessageWindow 'Hi! ;-)'))}.
+@p{}
+
+@section MenuItemC entries
+
+ This is the most common way to add a menu entry. The syntax is:
+@p{}
+
+@example
+MenuItemC: "Name", Command[, Key [,"KeyName"]]
+@end example
+
+ The only difference with @code{MenuItem} (@xp{MenuItem entries}) is that you
+don't have to specify a help context. Help contexts are numbers that
+associates a context in the editor with some text in the on-line help.
+Usually the number is the same used for the command. The @code{MenuItemC}
+assumes the help context is the same as the command number.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section MenuSeparator
+
+ It adds a division line to the menu. Use it to visually group related menu
+entries.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section The special submenu used for the right click
+
+ To define the menu associated with the right mouse button you must define a
+top-level submenu called @il{Editor Right Click}. This submenu will pop up when
+you right click over an edition window and is just like any other submenu.
+
+@c --------------------------------------------------------------------------
+@section Status bar ranges
+
+ The content of the status bar is context sensitive. For this reason the
+content of the status bar is defined for a help context or for a range of
+help context values. The ranges can overlap and the first match is used. For
+this reason the order is important.
+@p{}
+
+ Ranges are started using the @code{StatusRange} command and closed using
+the @code{EndStatusRange} command. The syntax for the first is:
+@p{}
+
+@example
+ StatusRange: first_context, number_of_contexts
+@end example
+
+@c --------------------------------------------------------------------------
+@section Visible status bar entries
+
+ The syntax for visible entries is:
+@p{}
+
+@example
+ StatusEntry: Label, Command, Key
+@end example
+
+ The label is the visible text and the rest of the values are just like the
+ones used by the @code{MenuItem} entries. @x{MenuItem entries}.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section Invisible status bar entries
+
+ The syntax is almost the same used by the visible ones, the most important
+difference is that they doesn't need a label. @x{Visible status bar entries}.
+@p{}
+
+@example
+ StatusHiddenEntry: Command, Key
+@end example
+
+@c --------------------------------------------------------------------------
+@section Conditional menu entries
+
+ The @file{menubind.smn} files support some conditional statements. They are
+quite similar to the preprocessor conditionals used in C language and can be
+used to exclude or include some menu entries according to the operating
+system and other configuration details.
+@p{}
+
+ The most important structure is:
+@p{}
+
+@example
+ $if CONDITION
+ ...
+ $else
+ ...
+ $endif
+@end example
+
+ The @code{else} section is optional. In this case if the @il{CONDITION} is
+true the entries in the first section are used, otherwise the entries in the
+@code{else} section are used.
+@p{}
+
+ Contitions can use and, or and not boolean operations. The @code{and} and
+@code{or} operators are used for the first two and the @code{!} operator for
+not. Currently you can use parentheses in conditionals but this is not fully
+tested.
+@p{}
+
+ The available variables to evaluate are:
+@p{}
+
+@table2{Variable,Meaning}
+@titemR{Alpha,The binary was compiled for Alpha (DEC) CPUs}
+@titemR{BCPP,The binary was compiled using Borland C++}
+@titemR{BZIP2,Support for bzip2 compressed files included}
+@titemR{CALCULATOR,Built-in calculator is available}
+@titemR{CALENDAR,Built-in calendar is available}
+@titemR{Cygwin,The binary was compiled using Cygwin}
+@titemR{djgpp,The binary was compiled using djgpp}
+@titemR{DOS,The binary was compiled for DOS}
+@titemR{DrvDOS,The editor using the DOS TV driver}
+@titemR{DrvQNX,The editor using the QNX RtP TV driver}
+@titemR{DrvQNX4,The editor using the QNX 4 TV driver}
+@titemR{DrvUNIX,The editor using the generic UNIX TV driver}
+@titemR{DrvWin32,The editor using the Win32 TV driver}
+@titemR{DrvWinGr,The editor using the WinGr TV driver}
+@titemR{DrvWinNT,The editor using the WinNT TV driver}
+@titemR{DrvX11,The editor using the X11 TV driver}
+@titemR{DrvXTerm,The editor using the XTerm TV driver}
+@titemR{FreeBSD,The binary was compiled for FreeBSD}
+@titemR{GCC,The binary was compiled using gcc}
+@titemR{HPPA,The binary was compiled for HP-PA Risc CPUs}
+@titemR{Itanium,The binary was compiled for IA64 CPUs}
+@titemR{Linux,The binary was compiled for Linux}
+@titemR{MinGW,The binary was compiled using MinGW}
+@titemR{MIPS,The binary was compiled for MIPS CPUs}
+@titemR{MIXER,Support for the audio mixer included}
+@titemR{MP3,Support to play MP3 included}
+@titemR{MSC,The binary was compiled using Microsoft C}
+@titemR{PCRE,Support for Perl RegEx included}
+@titemR{PPC,The binary was compiled for Power PC CPUs}
+@titemR{QNXRtP,The binary was compiled for QNX}
+@titemR{Solaris,The binary was compiled for Solaris}
+@titemR{SPARC,The binary was compiled for 32 bits SPARC CPUs}
+@titemR{SPARC64,The binary was compiled for 64 bits SPARC CPUs}
+@titemR{UNIX,The binary was compiled for a UNIX style OS (Linux included)}
+@titemR{Unknown,The binary was compiled for an unknown CPUs}
+@titemR{Win32,The binary was compiled for Windows}
+@titemR{x86,The binary was compiled for IA32 CPUs}
+@endtable-{}
+
+ In addition to the above mentioned methode you can also define small macros
+using the @code{$define} directive. You can also undefine them using
+@code{$undef} directive. These directives doesn't support multiline
+definitions, or worst, they do but this won't work as you should spect.
+@p{}
+
+@c --------------------------------------------------------------------------
+@section Comments in menu files
+
+ You can add comments to menu files, they must start with the @code{#}
+character and it must be in the first column. Lines starting with @code{#} are
+ignored when parsing menu files.
+@p{}
+
+@c --------------------------------------------------------------------------
+@chapter Editing Modes
+
+ The editor has various settings that control the function and aspect of
+the editor.
+@paragraph{}
+
+ The settings are:
+@paragraph{}
+
+@section Overwrite
+@cindex Overwrite
+
+ This setting controls if the typed characters are inserted in the buffer or
+replace the original ones. For a detailed explanation @x{Insert and Delete}.
+
+@section Autoindent
+@cindex Autoindent
+
+ This setting controls what happens when you press @key{ENTER}. If this setting
+is off the cursor goes to the column 1 of a new line. If the
+mode is on the editor will try to mimic the indentation of the code by
+inserting spaces or tabs. @x{Optimal Fill}.
+
+@section Real Tabs
+@cindex Real Tabs
+@cindex Use Real Tabs
+@cindex TABs
+
+ This setting controls what happens when you press @kbd{@key{TAB}}. If this
+setting is on the editor will insert an ASCII 9 at this position.
+@paragraph{}
+
+ An ASCII 9 is a TAB, that means that the width of this char is enough to
+move the cursor to the next tabulator column. In the editor the tabulator
+columns are equidistant and the positions are controled by the Tab Size value.
+@paragraph{}
+
+ If this setting is off the editor won't put any ASCII 9 in your text.
+The behavior is configured by the @il{Tab smart indents} option. Read the section
+about it for more information. @x{Tab smart indents}.
+@paragraph{}
+
+ You can also indent using spaces when this option is disabled. For more
+information consult the @il{Use indent size} option.
+@x{Use indent size}.
+@paragraph{}
+
+ In the past (versions older than 0.4.44) another thing controlled by this
+setting was the behaviour of the @key{Backspace} key, but now that's
+controlled by the @il{Backspace unindents} option. @x{Backspace unindents}.
+@paragraph{}
+
+ The editor is much more coherent when you choose to use TABs or not use
+TABs. If you mix the two modes you'll get some unexpected results, especially
+in the indentation of the blocks.
+@paragraph{}
+
+ If you never use tabs, it's better you work with this setting off.
+Then you'll get much from the editor.
+@paragraph{}
+
+ Now you can say: @il{But I really need tabs because I'm editing a make file!} or
+@il{because I will send the file using an ultra slow link} @il{and I want the compression
+granted by the tabs.} In these cases you can first expand all tabs, then
+work without real tabs and at the finish of your work compact all possible
+spaces and generate a file with tabs. @x{Miscellaneous}.
+@paragraph{}
+
+ Most tabs users also like to enable the @il{Optimal Fill} option. @x{Optimal Fill}.@*
+I also suggest using the following options to complement the indentation when
+using tabs: @il{Autoindent} @b{ON}, @il{Intelligent indent} @b{OFF}, @il{Optimal
+Fill} @b{ON}, @il{Do not move inside tabs} @b{ON}, @il{Tab smart indents}
+@b{OFF}, @il{Use indent size} @b{OFF} and @il{Backspace unindents} @b{OFF}.
+@paragraph{}
+
+@section Persistent Blocks
+
+ This setting controls the behaviour of the selected area.
+@paragraph{}
+ The "Block modes" chapter for a detailed explanation. @x{Block modes}.
+@paragraph{}
+
+@section Intelligent indent
+@cindex Intelligent indent
+
+ This mode was designed to be used jointly with the Pseudo Macros
+(@xp{Pseudo Macros}) and the Real Tabs mode off to achieve an
+easy way to indent the code that does a better job than the Autoindent mode.
+@paragraph{}
+
+ In this mode the spaces inserted after pressing @key{ENTER} depend on
+the first word in the last line. For example, if you have:
+@paragraph{}
+
+@smallexample
+if (a==b)_
+@end smallexample
+
+ With the cursor in the '_' position and press @key{ENTER} you'll get:
+@paragraph{}
+
+@smallexample
+if (a==b)
+ _
+@end smallexample
+
+ Now you can do either of two things, 1) press space and write the code that will
+be executed by the if, or 2) if this a multiline code press @{ and @key{ENTER}.
+In the last case you'll get:
+
+@smallexample
+if (a==b)
+ @{
+ _
+@end smallexample
+
+ Now type your first line of code. Press @key{ENTER}. Write your next line.
+Press @key{ENTER} again and then @key{Backspace}:
+
+@smallexample
+if (a==b)
+ @{
+ 1st line;
+ 2nd line;
+ _
+@end smallexample
+
+ Now type @} and press @key{ENTER} one more time:
+
+@smallexample
+if (a==b)
+ @{
+ 1st line;
+ 2nd line;
+ @}
+_
+@end smallexample
+
+ As you can see the code is perfectly aligned without a significant work
+on your part.
+@paragraph{}
+
+ I tried to make this mode as smart as possible, but it still needs more
+work. If you have suggestions contact me.
+@paragraph{}
+
+ Another important thing is that this indentation has a personal style,
+my style ;-), so it may be you don't like it. If that's the case you can
+do the following things:
+@paragraph{}
+
+@itemize @bullet
+ @item Configure it using the @file{syntaxhl.shl} file. Note that the
+configuration is very limited. @x{Syntax Highlighting File}.
+ @item Use another way of indentation offered by the editor. For example,
+turn on the Real Tabs mode and indent with tabs.
+ @item Customize the @file{cpmacros.pmc} file (@xp{Pseudo Macros}), actually this
+file is coherent with this mode.
+@end itemize
+
+@subsection Can you explain more about the behavior of this mode?
+
+ I'll try to describe the behaviour of the mode:
+@paragraph{}
+ Each time you press @key{ENTER} the editor inserts a @samp{\r\n} string in your
+text, after that the editor searches one line located above the new line that
+has at least one character on it. This line is taken as reference. The
+editor analyzes this line searching for:
+@paragraph{}
+
+@itemize @bullet
+ @item The first non-blank character on this line.
+ @item The first word on this line.
+ @item The first parenthesis.
+ @item The balance of parentheses on the line.
+ @item The last non-blank and non-comment character in the line.
+@end itemize
+
+ Now, if the line contains @{ at the beginning the editor goes to the first
+column after the @{.
+@paragraph{}
+ If the line contains @} at the start the editor will go to the same column
+of the @} and then will perform a @key{Backspace}. If the Real Tabs
+mode is off, that's an unindent. @x{Real Tabs}.
+@paragraph{}
+ If the line starts with a C++ comment the effect is the same as in
+Autoindent. @x{Autoindent}.
+@paragraph{}
+ If the line starts with a C comment the editor will try to skip the
+comment and analyze the rest of the line, but if the comment doesn't end
+on this line the editor will go to the column where the @samp{/} is.
+@paragraph{}
+ If the line starts with @samp{/} the editor goes to this column.
+@paragraph{}
+ If the line has more @samp{(} than @samp{)} the editor will go to the column of the
+first non-blank after the first @samp{(}.
+@paragraph{}
+ If the line has more @samp{)} than @samp{(} the editor will search the line where the
+number of parentheses is balanced, then will analyze this line. If the whole
+line still generates an unbalanced situation the editor will go to the
+first used column in the line that was found the first time. But if this
+line will leave all brackets balanced the editor will take the first word on the
+line and will use it as reference.
+@paragraph{}
+ At last, and according to the word found, the editor will use this
+word as reference. The editor recognises the following keywords:
+@paragraph{}
+
+@table2-auto{Keyword,Action}
+@clear table-set-center
+@titemR{@samp{do},+2 but not if @dots{} ;}
+@titemR{@samp{if},+2 but not if @dots{} ;}
+@titemR{@samp{for},+3 but not if @dots{} ;}
+@titemR{@samp{else},+2}
+@titemR{@samp{case},+5}
+@titemR{@samp{while},+2 but not if @dots{} ;}
+@titemR{@samp{switch},+2}
+@titemR{@samp{break},unindent}
+@titemR{@samp{return},unindent}
+@titemR{@samp{default},+5}
+@endtable-{}
+
+ The numbers represent how many spaces are added with reference to the first letter
+of the word. 'not if @dots{} ;' means that, if the line ends with
+a semicolon, the editor will do the same as for Autoindent. @x{Autoindent}. The
+unindent is performed with @key{Backspace}.
+@paragraph{}
+
+ Seasick? @x{Do you have more examples?}.
+@paragraph{}
+
+ Note: Some of these features were added in v0.2.14 of the editor based on a
+suggestion of @email{Bradford L.@: Spencer, stud73@@nortel.ca} about the
+behaviour of the mode on a line like this @samp{printf("Num: %d",} with the
+rest of the parameters on the next line.
+@paragraph{}
+
+@subsection Do you have more examples?
+
+ Well here are some other examples. I used a strange convention, like this:
+if I say type `a[ENTER]@{', type the letter @kbd{a}, then press @kbd{@key{ENTER}} and
+finally press the `@{' key.
+@paragraph{}
+
+Example 1: (similar to one explained before but is to show the
+convention)
+@paragraph{}
+
+@smallexample
+Type:
+if (a==1)[ENTER]@{[ENTER]a=2;[ENTER]b=3;[ENTER][BACKSPACE]@}[ENTER]
+
+You'll get:
+
+if (a==1)
+ @{
+ a=2;
+ b=3;
+ @}
+[<--- cursor here]
+@end smallexample
+
+
+Example 2: A switch/case example
+@paragraph{}
+
+@smallexample
+Type:
+switch(a)[ENTER]@{[ENTER]case 1:[ENTER]a=2;[ENTER]b=3;[ENTER]break;
+[ENTER]case 2:[ENTER]b=5;[ENTER]break;[ENTER][BACKSPACE]@}[ENTER]
+
+You'll get:
+
+switch(a)
+ @{
+ case 1:
+ a=2;
+ b=3;
+ break;
+ case 2:
+ b=5;
+ break;
+ @}
+[<--- cursor here]
+@end smallexample
+
+
+Example 3: A call to a function that takes a lot of parameters
+@paragraph{}
+
+@smallexample
+Type:
+printf([SPACE]"Num: %d",[ENTER]a[SPACE]);[ENTER]
+
+You'll get:
+
+printf( "Num: %d",
+ a );
+[<--- cursor here]
+@end smallexample
+
+
+Example 4: A lot of parentheses
+@paragraph{}
+
+@smallexample
+Type:
+if[SPACE]([SPACE](a==1)[SPACE]||[ENTER](b==2)[SPACE]||[ENTER]
+c[SPACE])[ENTER]
+
+You'll get:
+
+if ( (a==1) ||
+ (b==2) ||
+ c )
+ [<--- cursor here]
+@end smallexample
+
+
+Example 5: Comment trying to interfere part 1
+@paragraph{}
+
+@smallexample
+Type:
+/*-a-*/for[SPACE](x=1;x;--x)[ENTER]
+
+You'll get:
+
+/*-a-*/for (x=1;x;--x)
+ [<--- cursor here]
+@end smallexample
+
+
+Example 6: Comment trying to interfere part 2
+@paragraph{}
+
+@smallexample
+Type:
+for[SPACE](x=1;x;--x);[SPACE]//-b[ENTER]
+
+You'll get:
+
+for (x=1;x;--x); //-b
+[<--- cursor here]
+@end smallexample
+
+
+ Note: Of course you can fool the editor but as you can see it is relatively
+smart ;-).
+@paragraph{}
+
+@section Column cursor
+@cindex Column cursor
+
+ This setting enables a strange feature of the editor. When on the column
+where the cursor is is highlighted. This feature is very good
+to check if parts of your code are aligned correctly.
+@paragraph{}
+
+ If you like this mode but think it's very uncomfortable to use all the time
+contact me and if I get enough feedback I'll create a hotkey for it to be
+turned on/off quickly.
+@paragraph{}
+
+@section Row cursor
+@cindex Row cursor
+
+ This setting is similar to the column cursor but acts on the row
+where the cursor is. If you enable the two modes you'll get a cross on the
+screen showing where the cursor is.
+@paragraph{}
+
+@section Match pair highlight
+@cindex Match pair highlight
+
+ This mode acts showing the pairs of (/), [/] and @{/@} on the fly. Each
+time you type one of these symbols the editor will search the matching
+pair, if the editor finds it and the match is on the screen both will be
+highlighted, if the match is outside the screen the editor will inform the
+position on the status line, and if there is no match the editor will
+inform the situation in the status line too.
+@paragraph{}
+
+ That's very useful when you are typing complex parenthetical expressions or
+a very nested code. You can use it together with the @il{cmcSearchStart},
+@il{cmcSearchEnd}, @il{cmcSearchOpPar}, @il{cmcSearchClPar}, @il{cmcSearchOpCor} and
+@il{cmcSearchClCor} commands. @x{Miscellaneous}.
+@paragraph{}
+
+ If you want to get highlight not only after typing but also when moving the
+cursors you'll need to enable the @il{Match pair on the fly} option.
+@x{Match pair on the fly}.
+@paragraph{}
+
+@section Match pair on the fly
+@cindex Match pair highlight all the time
+
+ This mode is very similar to the @il{Match pair highlight} mode. If you
+don't know how it works please read the @il{Match pair highlight} section
+first. @x{Match pair highlight}.
+@paragraph{}
+
+ The main difference is that this mode highlights the pair when the cursor
+is @b{over} the character to search.
+@paragraph{}
+
+ The highlight is done half a second after you stop typing to avoid interfering
+with your typing. But if you have a fast machine, not just a 386, you can
+configure the editor to do the search without waiting.
+@x{Do not wait to search the pair}.
+@paragraph{}
+
+@section Do not wait to search the pair
+
+ This option works only when @il{Match pair on the fly} is enabled. When
+enabled the editor doesn't wait to do the search of the complementary pair.
+I think this could impact the performance of scrolling on very slow machines
+and that's why it's optional. @x{Match pair on the fly}.
+@paragraph{}
+
+@section Transparent Blocks
+@cindex Blocks, transparent
+
+ When this mode is on you can see the syntax highlighting of selected blocks. Normally
+the selection affects the background and foreground colors, but when using transparent
+blocks only the background is affected.
+
+@section Optimal Fill
+@cindex TABs, indenting with
+@cindex Real Tabs when indenting
+
+ This mode was added for the people that use ASCII 9 tabulators in their code
+(@xp{Real Tabs}). Normally the editor uses spaces to indent the code or, in general,
+to fill any gap in the text. When you enable this mode the editor will use as many
+tabs as possible to fill these gaps. That's what the tab users normally expect.
+
+@section Wrap Words
+@cindex wrapping
+
+ Even when the editor is mainly intended for programmers it became apparent that some other
+user groups want to use it too.
+@paragraph{}
+ The word wrap added to the editor is a very simple one, it just inserts a new line
+if you type a word beyond the wrap column, that's all. You won't get automatic reformat
+functions like in text editors intended for love letters (like the one from the Bill
+Gates company).
+@paragraph{}
+ The wrap column box is used to enter the column that triggers the wrap.
+
+@section Do not move the cursor on Paste
+@cindex Paste, do not move the cursor
+
+ That's a global setting. When it's on the cursor isn't moved after pasting. Normally
+the cursor is moved to the end of the pasted block, but sometimes it's better if the
+cursor isn't moved.
+
+@section Scroll Lock centers
+@cindex centering the screen while typing
+
+ When this mode is on the Scroll Lock key has a special meaning. If the Scroll Lock
+LED of your keyboard is on then the editor centers the current line in the window. The
+effect is very strange but the advantage is that you don't need to follow the movement
+of the line with your eyes because it's always in the same place.
+
+@section See Tabs
+@cindex TABs, highlight/see
+
+ In this mode the tabs are highlighted, two colors are used for this purpose,
+one for even and the other for odd numbered tabs. In this way you can clearly
+see where a tab is located and the size of the tab. The colors can be
+customized from the Colors menu option. @x{Customize Colors}.
+@paragraph{}
+
+ This mode was introduced in v0.4.23 and is globally enabled by default.
+
+@section Do not move inside tabs
+@cindex TABs, skipping/through
+@cindex cursor through tabs
+
+ In this mode the cursor can't be placed inside a tab character. This
+definition is fuzzy and confusing so here I'll try to explain it better. One
+tab character can be expanded to one or more characters when displayed on the
+screen. Normally you can place the cursor in any of the spaces that belong to
+a tab character. I think this behavior is the best because you are free to
+move the cursor to any place you want, but tab users get confused when they
+type and discover they had the cursor in the middle of a tab. It produces a
+cursor jump. To avoid this kind of surprise a lot of editors don't allow
+to position the cursor in these spaces, only in the first space.
+@paragraph{}
+
+ This mode was introduced in v0.4.23 and is globally enabled by default.
+
+@section Tab smart indents
+@cindex No real tabs
+@cindex Tab as spaces
+
+ When @il{Use real tabs} option is disabled the editor will insert enough
+spaces to move the cursor to the next tab-stop or indent position. But if
+this option is enabled the editor will insert enough spaces to move the
+cursor to the beggining of the next word in the previous line.
+Confused? Sorry for my English, an example will clarify that:
+@paragraph{}
+
+This is a line above the line you are
+@paragraph{}
+
+That's the line where the cursor is, at column one.
+@paragraph{}
+
+ After pressing TAB you'll get:
+@paragraph{}
+
+This is a line above the line you are
+@paragraph{}
+
+ That's the line where the cursor is, at column one.
+@paragraph{}
+
+ Now you'll ask, Why this? Is that useful? The answer is that's very useful
+to keep your code indented. Experiment using that under a line with if, for,
+@il{etc.}
+@paragraph{}
+
+ Another option is to indent like the Tab key but using a size different
+than the tab size. This can be done disabling this option and enabling
+@il{Use indent size}. @x{Use indent size}.
+@paragraph{}
+
+@section Use indent size
+@cindex Indent amount
+@cindex TABs as spaces
+
+ When the @il{Real Tabs} and @il{Tab smart indents} options are disabled you can
+indent with the tab key but using spaces. Sometimes people want to use tabs
+of eight spaces because this is the most common value for consoles and
+printers but, at the same time, they want to indent by a different amount of
+spaces pressing tab. In this situation you must enable this option and
+configure the indentation amount in the @il{Indent size} box.
+@paragraph{}
+
+@section Keep trailing whitespace
+@cindex Spaces, purging at the end of line
+@cindex Spaces, removing trailing
+
+ Normally the editor purges any space after the last visible character in a
+line. That's very useful to save disk space and to avoid problems with end of
+line continuation sequences, like in C language. But sometimes you may want
+to avoid it for some reason. Enabling this option the editor won't
+try to remove extra spaces at the end of lines.
+@paragraph{}
+
+@section Backspace unindents
+@cindex Backspace behavior
+@cindex Unindenting with backspace
+
+ When this option is enabled the @key{Backspace} deletes as many spaces as
+necessary to move the cursor to the first used column of the previous line.
+Basically it keeps the indentation. However, this is true only when all the
+characters located to the left of the cursor are spaces or tabs.
+@paragraph{}
+
+ In versions older than 0.4.44 this option was implicitly enabled when the
+@il{Real Tabs} option was disabled. When loading old desktop files the editor
+enables/disables this option based in the @il{Real Tabs} option.
+@paragraph{}
+
+@section Column Markers
+@cindex columns, marking
+
+ Column markers highlight a column of text. This option is useful for
+programming languages where the column is important or when you just need to
+have some column positions as references.
+@p{}
+
+ You can set various column markers at the same time, just enable this
+option and enter a list of columns in the associated text box. The columns
+should be separated by spaces and sorted incrementally. The editor will
+format the list in this way.
+@p{}
+
+@section Syntax Highlighting
+@cindex syntax highlighting extensions
+
+ The editor can highlight the syntax of your code. The available modes
+are:
+@paragraph{}
+
+@itemize @bullet
+ @item No highlighting, all the code is with the same color.
+ @item C/C++ Highlighting.
+ @item Pascal Highlighting.
+ @item Clipper Highlighting.
+ @item User defined. Including already defined for:
+ @itemize @bullet
+ @item 4DOS batch files
+ @item 80x86 assembler (AT&T syntax)
+ @item 80x86 assembler (Intel syntax)
+ @item 8x51 assembler
+ @item Ada
+ @item BASIC
+ @item C/C++
+ @item Cascading Style Sheets version 2
+ @item Clipper 5.x
+ @item Command Line Errors File
+ @item Environment files
+ @item Flat assembler
+ @item Fortran
+ @item HTML
+ @item Internationalization files (.po)
+ @item Java
+ @item Java Script
+ @item Lua
+ @item Makefiles
+ @item Menu files
+ @item Modula 2
+ @item Netwide Assembler (NASM)
+ @item Objetive C
+ @item Pascal
+ @item PDP11 assembler
+ @item Perl
+ @item PHP
+ @item PIC assembler (Microchip)
+ @item PLM/51
+ @item PMacros files
+ @item PostScript
+ @item POV-ray
+ @item Python
+ @item Ruby
+ @item SDG format files
+ @item sLisp macros
+ @item SQL
+ @item The syntax highlight file itself
+ @item TCL/Tk
+ @item TeX
+ @item Texinfo
+ @item Turbo Vision configuration files
+ @item UNIX shell scripts
+ @item VHDL
+ @item XML
+ @item WML
+@c Currently SDH doesn't support it in other column that 1, sorry.
+@end itemize
+@end itemize
+
+ The kind of highlighting is chosen automatically using the extension of the
+file. Additionally the editor supports Emacs-like mode selection. Emacs
+searches the name of the editing mode in the first kilobyte and last three
+kilobytes of text. The editing mode is delimited by @code{-*-} and the
+editor will use it instead of the file extension to select the highlighting mode.
+That's very useful for files without extensions like the new C++ headers.
+To add even more flexibility I'm supporting another technique used by some
+C++ headers from Silicon Graphics and Hewlett Packard, in these headers the
+mode is located in the last lines using some special keywords.
+@paragraph{}
+
+ The editor also supports the convention used for UNIX script files. If a
+file starts with @code{#!} this line indicates the program that must be
+executed to interpret the script. The editor reads this line and extracts the
+name of this program and searches it in the @code{ShellScript} definition.
+@paragraph{}
+
+ The C/C++ highlighting was designed for the GNU C compiler.
+@paragraph{}
+ The Pascal highlighting was designed for the GNU Pascal compiler.
+@paragraph{}
+ The Clipper highlighting was designed for the CA-Clipper 5 compiler.
+@paragraph{}
+
+ The highlighting can be customized, @x{Syntax Highlighting File}.
+
+@chapter Syntax Highlighting File
+
+ The highlighting can be customized editing the @file{syntaxhl.shl} file. You can add
+syntax highlighting to almost any kind of files, a good example is the fact that the files
+used to configure the editor have their own syntax highlighting.
+@x{Configuration files location}.
+@p{}
+
+ The file declares the settings for each kind of files. Each declaration ends with an
+@code{End} marker. The @code{#} acts as a start of comment if it appears in the first
+column.
+@paragraph{}
+
+ Important things you have to know to add a new syntax highlighting:
+@paragraph{}
+@itemize @bullet
+ @item In previous versions when adding a new highlight mode it ought to have
+been added at the end of the file, now this isn't mandatory.
+ @item The editor remembers various settings of loaded files even after
+closing the file. This includes the syntax highlighting, so if you add
+a new one or added a new extension to the list and you open a file
+that you already opened the editor will remember the last settings
+and doesn't use the new setting. In this case you must force it by
+hand.
+ @item If you feel that this new highlight mode can be used by other users send
+it to me and I'll include it in the next release. Many of the
+currently included syntax highlightings were contributed by users.
+@end itemize
+@paragraph{}
+
+ If you want to add some keywords to a language for personal use don't do it
+in the @code{Keywords} section because you will need to edit this file each
+time you install a new release of the editor. The editor provides another
+file for it and also a nice user interface to add and delete words defined by
+the user. @x{User Words}.
+@paragraph{}
+
+ This file also configures the pseudo macros used for each language and the
+behavior of the "Intelligent Indent" mode. @x{Pseudo Macros}.
+@x{Intelligent indent}. @x{PMacros}. @x{NLIndent}.
+@p{}
+
+ The next sections covers the supported settings.
+@paragraph{}
+
+@section AllowedInsideNames
+
+ Some languages include symbols inside names, you can list these symbols here.
+Normally the editor allows letters, digits and underscore. These characters are allowed
+inside the names and not at the start of the name. @x{CanStartAName}.
+
+@section CanStartAName
+
+ Some languages includes symbols at the start of names, you can list these symbols
+here. Normally the editor allows letters and underscore. These characters are allowed
+at the start of the name and not inside. @x{AllowedInsideNames}.
+
+@section Case
+
+ When this setting is 1 all the keywords become case sensitive. If the keywords aren't
+case sensitive don't use it.
+@paragraph{}
+ This should be declared as one of the first settings because it affects how
+other definitions are loaded in memory. I suggest using it before @code{Name} and
+@code{Files} and after the others.
+
+@section CloseComment1
+
+ Used to indicate the end of a multiline comment. The lenght is limited to four
+characters. If the file format has two different terminations use
+@code{CloseComment2} for the second.
+@paragraph{}
+ For more information @x{Format of short syntax highlighting definitions}.
+
+@section EmacsModes
+@cindex syntax highlighting, Emacs modes
+
+ It indicates which Emacs modes will use this highlighting. The modes must be
+separated by commas. The modes are't case sensitive.
+@paragraph{}
+ As in Emacs the editor looks at the first kilobyte of text and at the last
+three kilobytes for the mode delimited by @code{-*-}.
+@paragraph{}
+ The priority is as follows: @code{EmacsModes}, @code{ShellScript} and
+finally the extension (@code{Files}). @x{ShellScript}. @x{Files}.
+
+@section EOLCInFirstCol
+
+ When this setting is on the one line comments starts only if the sequence of
+characters is present in the first column.
+
+@section EOLCInFirstCol1
+
+ That's like EOLCInFirstCol but affects only the EOLComment1 and not both.
+@x{EOLCInFirstCol}.
+
+@section EOLCInFirstCol2
+
+ That's like EOLCInFirstCol but affects only the EOLComment2 and not both.
+@x{EOLCInFirstCol}.
+
+@section EOLCInFirstUse1
+
+ That's like EOLCInFirstCol1 but the starting sequence may be the first
+non-blank character and does not need to be located in the first column.
+@x{EOLCInFirstCol1}.
+
+@section EOLCInFirstUse2
+
+ That's like EOLCInFirstCol2 but the starting sequence may be the first
+non-blank character and does not need to be located in the first column.
+@x{EOLCInFirstCol2}.
+
+@section EOLComment1
+
+ Used to indicate the start of a comment that ends at the end of the line. The lenght
+is limited to four characters. If the file format has two different terminations use
+@code{EOLComment2} for the second.
+@paragraph{}
+ For more information @x{Format of short syntax highlighting definitions}.
+
+@section Escape
+
+ Indicates which character acts as escape character inside strings or to concatenate
+lines.
+
+@section EscapeAnywhere
+
+ Indicates that escape characters can be found anywhere, not just inside
+strings or at the end of lines like in C.
+
+@section Files
+@cindex syntax highlighting, extensions
+
+ It indicates which extensions will use this highlighting mode. The extensions must be
+separated by commas. The extensions are case sensitive, be careful.
+@paragraph{}
+ The editor can also choose the highlighting using the Emacs mode or the
+program used to execute the file if that's an UNIX script.
+@paragraph{}
+ The priority is as follows: @code{EmacsModes}, @code{ShellScript},
+@code{FullNameMatch}, @code{NameMatch} and finally the extension
+(@code{Files}). @x{ShellScript}. @x{EmacsModes}. @x{FullNameMatch}.
+@x{NameMatch}.
+
+@section FullNameMatch
+@cindex syntax highlighting, matching a path
+
+ It can be used to indicate a regular expression to match the full path and
+name of the file. If the expression matches the editor will use this syntax
+highlighting.
+@paragraph{}
+ The regular expression must be in Perl format. You can read about it in
+any book about Perl.
+
+@section HexMarker
+
+ This setting indicates what prefix is used for hexadecimal numbers. No postfix
+is supported yet. The lenght is limited to four characters.
+@paragraph{}
+ For more information @x{Format of short syntax highlighting definitions}.
+
+@section Keywords
+
+ It can be used as many times as needed and is used to indicate the reserved keywords
+of the language. The separator is the comma.
+
+@section Name
+
+ It sets the name of the syntax highlighting. This name is used in the local settings
+dialog (cmcSetLocalOptions).
+
+@section NameMatch
+@cindex syntax highlighting, matching a name
+
+ It can be used to indicate a regular expression to match the name of the
+file. If the expression matches the editor will use this syntax highlighting mode.
+@paragraph{}
+ The regular expression must be in Perl format. You can read about it in
+any book about Perl.
+
+@section NLIndent
+@cindex intelligent indent configuration
+
+ Defines a rule for the intelligent mode. The rule will apply only to files
+with this highlighting. Rules are evaluated when the user inserts a new line.
+@p{}
+
+ Rules are evaluated in reverse order, last rule first. Each rule contains
+two conditions followed by one action. When both conditions are true the
+action is applied and no more rules are evaluated.
+@p{}
+
+ All arguments are separated by commas. Each condition is composed by two
+arguments. The first is the name of the condition and the second is its
+parameter. Currently available conditions and actions are:
+@p
+
+@subsection AutoIndent (action)
+
+ That's the default action and is equivalent to the "Autoindent" mode.
+@x{Autoindent}. The main difference is that here the editor tries to skip
+comments found at the beggining of the previous line.
+@p{}
+
+ If you provide a numeric argument this value will be used as an offset.
+@p{}
+
+@subsection FirstWord (condition)
+
+ This condition needs one parameter indicating the word or symbol we want to
+check. It's true when the first word or symbol in the previous line matches
+with the parameter.
+@p{}
+
+ Note that the editor skips blank characters and comments to determine the
+first character in the previous line. Also note the editor tries to be smart
+when the previous line have closing parentheses and tries to find the line
+where the parentheses started.
+@p{}
+
+@subsection MoveAfterPar (action)
+
+ This action is usually associated with @code{ParBalancePos}. It moves the
+cursor to the column of the first operand after the first parenthesis in the
+previous line.
+@p{}
+
+@smallexample
+ if ( a && (c>0)
+ _
+@end smallexample
+
+@subsection NoLastChar (condition)
+
+ This condition needs one parameter indicating the character we want to
+avoid. It's true when the last symbol in the previous line doesn't match
+the parameter.
+@p{}
+
+@subsection ParBalanceNeg (condition)
+
+ This condition is true when the previous lines contains less parentheses
+opened than closed.
+@p{}
+
+@smallexample
+ a && (c>0))
+@end smallexample
+
+@subsection ParBalancePos (condition)
+
+ This condition is true when the previous lines contains more parentheses
+opened than closed.
+@p{}
+
+@smallexample
+if (a && (c>0)
+@end smallexample
+
+@subsection Unindent (action)
+
+ This action reduces the indentation level. The efect is similar to what you
+get using @key{Backspace} when the "Backspace unindents" mode is enabled.
+@x{Backspace unindents}.
+
+@section NoCheckNumbers
+
+ When this setting is on the numbers aren't highlighted.
+
+@section OpenComment1
+
+ Used to indicate the start of a multiline comment. The lenght is limited to four
+characters. If the file format has two different starts use @code{OpenComment2} for
+the second.
+@paragraph{}
+ The maximum length is four characters, for more information about the format:
+@x{Format of short syntax highlighting definitions}.
+
+@subsection Format of short syntax highlighting definitions
+
+ All the characters after the equal sign are taken as part of the field. Blank spaces
+after the equal sign are ignored, so @samp{Field= //} is equivalent to @samp{Field=//}.
+@paragraph{}
+ As the field may start with spaces and spaces at the end of line are invisible
+you can quote the text using the double quote letter. If you do it the first character
+after the equal sign must be the double quote, if you left an space like this:
+@samp{Field= "} the double quote will be interpreted as part of the field.
+@paragraph{}
+ When quoting text the back slash is the escape character, so this: @samp{Filed="\""}
+will be interpreted as asigning @samp{"} to @code{Field}.
+
+@section PartialKeywords
+
+ When this setting is enabled the list of the editor will highlight partial matches of
+the keywords. For example, suppose a keyword is defined as @samp{key} and you type
+@samp{keytable}, in this case the editor will highlight the @samp{key} part of the
+word. This feature is experimental and makes the highlighting quite slower.
+
+@section PMacros
+
+ Indicates the name of the pseudo macros file used for this kind of files. Using
+different files for different formats you can assign common triggers to different
+actions. For example, you can use i( to trigger an if() @{@} else @{@} in C and
+an if then else in BASIC. @x{Pseudo Macros}.
+
+@section Preprocessor
+
+ Indicates which symbol starts a preprocessor line.
+
+@section RelaxNumberCheck
+
+ This is used when a number can start a name and that isn't a error.
+Normally the editor takes it as a wrong number but when this
+option is enabled the check for numbers is relaxed and they aren't highlighted as
+wrong values.
+
+@section ShellScript
+@cindex syntax highlighting, shell scripts
+
+ It indicates which scripts will be highlighted. You must indicate the names
+of the programs associated with this script. The names are case sensitive.
+@paragraph{}
+ The editor looks for the @code{#!} characters at the start of the file, if
+found the name of the program is extracted and searched in this list.
+@paragraph{}
+ The priority is as follows: @code{EmacsModes}, @code{ShellScript} and
+finally the extension (@code{Files}). @x{EmacsModes}. @x{Files}.
+
+@section ShortString
+
+ Used to indicate the start and end of strings, used for small strings or characters.
+The string ends at the end of line if not explicitly closed.
+
+@section SpecialSymbol
+
+ That's used to mark pairs of characters that form a particular symbol that will
+generate problems if the editor sees them as separated symbols. It was created to
+avoid problems with @samp{$#} in Perl and bash scripts and with @samp{@@@@} in Texinfo
+files. You can define more than one character here.
+@paragraph{}
+ The characters that can be combined with it are specified using the
+@code{SpecialSymbolCont} definition.
+
+@section String1
+
+ Used to indicate the start and end of strings, used for long strings. You can specify
+more than one character, in this case any of them can open or close the string.
+@paragraph{}
+ The editor supports up to three diferent strings declared as @code{String1},
+@code{String2} and @code{String3}.
+
+@section Symbols1
+
+ Used to indicate which characters are allowed to be symbols, normally used for boolean and
+arithmetic symbols.
+
+@section Symbols2
+
+ Used to indicate what characters are allowed to be symbols, normally used for flow control
+and subindex symbols.
+
+@section UseInternal
+
+ That's optional. When a highlighting mode has this setting the editor will use the internal
+routines and will ignore almost all the settings. Only the extensions (@xp{Files}) and
+pseudo macros (@xp{PMacros}) settings are used.
+@paragraph{}
+ The value assigned can be: 1 for GNU C highlighting, 2 for standard Pascal and 3 for
+Clipper.
+
+@section UserKeywords
+@cindex syntax highlight, default user words
+
+ Used to define default user keywords. These keywords are discarded if the user
+specifies its own keywords. @x{User Words}.
+@p{}
+
+ The syntax is the same used for @x{Keywords}.
+
+@section VHDLNumbers
+
+ This option is used to enable the parser for VHDL abstract literals and
+VHDL bit string literals. Abstract literals are just numbers and bit string
+literals are bit vectors. The editor highlights bit string literals as integers.
+@x{VHDLStr1}.
+@p{}
+
+@section VHDLStr1
+
+ This option is used to enable the parser for VHDL string literals for the
+@code{String1} delimiter. VHDL strings are a little bit different than C/C++
+ones. @x{VHDLStr2}. @x{VHDLNumbers}.
+@p{}
+
+@section VHDLStr2
+
+ This option is used to enable the parser for VHDL string literals for the
+@code{String2} delimiter. VHDL strings are a little bit different than C/C++
+ones. @x{VHDLStr1}. @x{VHDLNumbers}.
+@p{}
+
+@chapter Pseudo Macros
+@cindex Pseudo Macros
+@cindex cpmacros.pmc
+
+ This feature is very useful to save some keystrokes. With this feature you
+can create a lot of shortcuts to make your life easier.
+@paragraph{}
+
+@section Please enlighten me - what is that?
+
+ So now, What's a Pseudo Macro? It's like a macro but it's triggered by two
+things: one the text before the cursor, and two the @kbd{^Space} combination.
+@paragraph{}
+
+ And what's the result? The result is customizable, but by default there are
+some predefined behaviours. For example, in a C source window type the following
+two characters: @kbd{#i} and then press @kbd{^Space} @dots{} (to create an empty
+file with .c extension go to File|Open and type a new name, foo.c for example).
+@paragraph{}
+
+ Surprised? I bet! You got: #include <.h> and the cursor just at the right
+place to write the name of the header.
+@paragraph{}
+Now write the famous stdio word, press @kbd{@key{End}}, then @kbd{@key{Enter}} twice and now write
+the following two letters: @kbd{ma} and then @kbd{^Space} @dots{}
+@paragraph{}
+
+ I bet this time you had an inkling of what will happen so you aren't that
+surprised ;-). Anyways, Surprise! Now type @kbd{pr} and the magic keys and @dots{}
+@code{printf("");} appears. To end the happy history now type "Hello world!" That's
+all. You wrote the hello world program at a very good speed.
+@paragraph{}
+
+ Now you know what I mean when I say pseudo-macros.
+@paragraph{}
+
+@section How can I customize that?
+
+@subsection General customization
+
+ It's very easy. Each syntax highlighting has its own pseudo macros file. Which
+file belongs to which syntax highlighting is indicated in the @file{syntaxhl.shl}
+file. @x{Syntax Highlighting File}. In the case of C/C++ the file is called
+@file{cpmacros.pmc} and is located in the same directory where the rest of the
+configuration files are installed. This file contains the definitions for each
+pseudo macro that can be triggered in C/C++ files. You can define as many
+pseudo macros as you want. @x{Configuration files location}.
+@paragraph{}
+
+ Important: If you are using RHIDE consult the RHIDE documentation to know
+where the @file{cpmacros.pmc} file is stored.
+@paragraph{}
+
+ The @file{cpmacros.pmc} file is a very good example and is self-explanatory but
+I'll include one example here.
+@paragraph{}
+
+@format
+Trigger: "i("
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: if plus else
+ "if (@@0)\n"
+ " @{@@1\n"
+ "@}\n"
+ "\belse\n"
+ " @{@@2\n"
+ "@}"
+@end format
+
+ The Trigger keyword defines the two letters before the cursor that will
+trigger the pseudo macro.
+@paragraph{}
+ The Mode keyword indicates the mode that the editor will use when inserting
+the text. The modes are:
+@paragraph{}
+
+@itemize @bullet
+ @item Overwrite @x{Overwrite}.
+ @item Autoindent @x{Autoindent}.
+ @item Use Tabs @x{Real Tabs}.
+ @item Persistent blocks @x{Block modes}.
+ @item Intelligent indent @x{Intelligent indent}.
+ @item Vertical cursor @x{Column cursor}.
+ @item Horizontal cursor
+ @item Match pair highlight @x{Match pair highlight}.
+ @item Match pair on the fly
+ @item Don't wait to search for the pair
+ @item Transparent Blocks @x{Transparent Blocks}.
+ @item Optimal Fill @x{Optimal Fill}.
+ @item Wrap words @x{Wrap Words}.
+ @item See tabs @x{See Tabs}.
+ @item Don't move inside tabs @x{Do not move inside tabs}.
+ @item Tab smart indents @x{Tab smart indents}.
+ @item Use indent size @x{Use indent size}.
+ @item Keep trailing whitespace @x{Keep trailing whitespace}.
+ @item Backspace unindents @x{Backspace unindents}.
+ @item Column markers @x{Column Markers}.
+@end itemize
+
+ Each mode can be 0 or 1. The editor will return to the original mode after
+expanding the pseudo macro. In this case the macro is expanded like this: No
+overwrite, autoindent, don't use tabs, the blocks are persistent
+and don't be smart when indenting.
+@paragraph{}
+
+ The rest is the code to insert enclosed by ". You can use \b to indicate
+backspace, \n for newline and \\ to indicate a simple \. If you want to
+insert a @@ you have to type it twice @@@@, because this character
+has a special meaning (see below).
+@paragraph{}
+
+ After the insertion the cursor is positioned in the place marked with @@0.
+Don't forget to signal this point or the cursor will be positioned at the
+beginning of the file. The places marked with @@1, @@2 and @@3 are saved in
+the markers 7, 8 and 9.
+@paragraph{}
+
+ Currently we defined pseudo macros only for x51 assembler, Clipper, C/C++,
+HTML, Perl, VHDL and WML. We did it in a way that you can use the same pseudo
+macro for all languages. For example: @code{#i} is expanded to
+@code{#include <.h>} for C/C++ files and to @code{request "";} for Perl files.
+If you write similar pseudo macros for other languages please send me the file
+and I'll add it to the next release.
+@paragraph{}
+
+@subsection Asking for user defined values
+@cindex pmacros, user interaction
+
+ Pseudo macros can ask the user to enter values. This can be done using the
+@@@{Name@} syntax. We will call it a variable. A macro can have as many
+variables as you want. But in practice you should avoid using more than 17
+variables because the dialog created to ask for them could become useless.
+@p{}
+
+ When a macro containing one or more variables is expanded the editor pops
+up a dialog containing the variables. After the user enters them the macro is
+expanded and the variables are replaced by the user defined values.
+@p{}
+
+ If you need to expand a variable more than once you can reference the
+variable using @code{@@vN} where N is the number of the variable. Variables
+are numbered starting from zero. Here is an example showing a macro for the
+VHDL entity construction:
+@p{}
+
+@example
+Trigger: "en"
+Mode: 0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1
+Name: Entity
+ "entity @@@{Entity@} is\n"
+ " generic(@@0\n"
+ " );\n"
+ "\bport(@@1\n"
+ " );\n"
+ "\b\bend entity @@v0;"
+@end example
+
+ In this example if you enter @code{Counter} for the @code{Entity} variable
+you'll get:
+@p{}
+
+@example
+entity Counter is
+ generic(
+ );
+ port(
+ );
+end entity Counter;
+@end example
+
+ If you want to provide a default value use the following syntax:
+@@@{Name;Value@}.
+@p{}
+
+@subsection Executing sLisp code from a pmacro
+@cindex pmacros, executing sLisp
+
+ You can execute sLisp code from a pseudo macro using the following syntax:
+@code{@@@{(code)@}}. The code will be executed every time you expand the
+macro. For more information about sLisp @x{sLisp macros}.
+@p{}
+
+ You can insert text using @code{InsertText} sLisp command. You can even
+insert the output of an external program using the @code{RunProgramRedir}
+command. @x{InsertText}. @x{RunProgramRedir}.
+@p{}
+
+ To make the macro more readable you can split the code in multiple lines.
+Here is an example:
+@p{}
+
+@example
+ "---- Copyright (c) @@@{"
+; sLisp code to get the year using the date command. Side effect: saves the file to disk
+ "(eval"
+ "(setv 'year' (RunProgramRedir 'date +%Y'))"
+ "(InsertText (left year (- (length year) 1)))"
+ ")"
+ "@} @@v2 <@@v3>\n"
+@end example
+
+@chapter sLisp macros
+@cindex macros from menu
+@cindex menues and macros
+
+ The editor uses a lisp like language to store macros. The macros are stored in a file
+called @file{macros.slp}. @x{Configuration files location}.
+@paragraph{}
+
+ The macros can be assigned to keys (@xp{How to configure the keyboard}), selected
+from the @il{Macro} menu or from the menu. From the @il{Macro} menu you can choose a
+macro from the list. If you want to repeat it you can do so with one keystroke.
+@p{}
+
+ To add a new macro to the list you must edit the @file{macros.slp} file. You can
+write the new macro by hand or you can use the @il{Macro} menu to record a macro and
+then generate the sLisp code for this macro.
+@p{}
+
+ To assign a macro to a menu entry you must edit the @file{menubind.smn}. The macros
+are called using @code{cm(name)} where @il{name} is the name of the macro you want to
+trigger.
+@p{}
+
+ To assign a piece of sLisp code to a menu entry you must use
+@code{cm((code))}. Here is an example:
+@p{}
+
+@example
+ MenuItemC: "Test macro from menu", cm((ShowInMessageWindow "Hi! ;-)"))
+@end example
+
+ Don't insert spaces between the starting and ending parentheses pairs.
+@p{}
+
+ You can also assing a piece of sLisp code to a key.
+@x{How to configure the keyboard}.
+@p{}
+
+@section How to write a sLisp macro
+
+ I'll show you an example and then I'll explain each part of the example:
+@paragraph{}
+
+@example
+(defmacro 'Testing 1 2 3 ;-)'
+ (eval
+ (SendCommands cmcLineEnd)
+ (InsertText (+ 'Hi!' CR 'How are you?'))
+ (SendCommands cmcLineUp cmcLineEnd)
+ )
+)
+@end example
+
+ That defines a macro called "Testing 1 2 3 ;-)" that will be expanded to all the code
+inside of the @code{eval} sentence. The @code{SendCommands} command sends one or more
+commands to the editor. The @code{InsertText} command inserts one string in the code.
+To concatenate strings use the @code{+} operator. Currently you can use the @code{\n}
+escape sequence inside a string to indicate a carriage return, but in the example above
+@code{CR} - a constant - is used to concatenate strings.
+@paragraph{}
+
+@section How strings are parsed
+
+ sLisp strings can be delimited by single or double quotes (@code{'} or
+@code{"}). Currently both produce the same result but in the future it could
+change to be similar to Perl.
+@paragraph{}
+
+ A few C escape sequences are supported inside strings. This means the
+@code{\ } character has a special meaning. Here are the values supported:
+
+@table2{Character,Interpreted as}
+@titemR{n,an OS dependant carriage return (\r\n for DOS and \n for UNIX)}
+@titemR{l,simple line feed (ASCII 10 for DOS and UNIX)}
+@titemR{r,simple carriage return (ASCII 13 for DOS and UNIX)}
+@titemR{t,tab (ASCII 9 for DOS and UNIX)}
+@endtable-{}
+
+ In strings that will be inserted in the text you should use the @code{\\n}
+escape sequence to maintain compatibility across different OSs. You can also
+use the built-in constant called @code{CR}.
+
+@section Running programs with a macro
+
+ There is a sLisp command called @code{RunProgram}. It takes a string as
+parameter which can contain one or more programs separated by @code{;} or the
+commands separator used by your command shell.
+@paragraph{}
+
+ The standard output and error are redirected and the results are sent to
+the Message Window. If the program is a GNU tool and reported errors the
+editor will parse these errors and will allow you to directly jump to the file
+and line where the error was reported.
+@paragraph{}
+
+To learn more about the message window @x{Message Window}.
+@paragraph{}
+
+@c ************************************************************************************
+@section General sLisp commands
+
+ This section describes general sLisp commands that can be used from the editor and
+the SDG configuration files.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection and
+
+ (and @var{exp1} @var{exp2} ...)
+@paragraph{}
+
+ Returns the logical and of the provided expressions. The values are
+evaluated from left to right. If at any point the result is zero then zero is
+returned and the rest isn't evaluated.
+@paragraph{}
+
+ Each value is evaluated as one or zero.
+@paragraph{}
+
+ (and 20 "hello" 4)@*
+ Returns 1.
+@paragraph{}
+
+ (and 20 4 2)@*
+ Returns 1.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection Operator = (assign)
+
+ (= @var{variable} @var{value})
+@p{}
+
+ This is a shortcut for the @code{setv} command. @x{setv}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection Operator & (bitwise and)
+
+ (& @var{exp1} @var{exp2} ...)
+@paragraph{}
+
+ Returns the bitwise and of the provided expressions. The values are
+evaluated from left to right. If at any point the result is zero then zero is
+returned and the rest isn't evaluated.
+@paragraph{}
+
+ (& 20 4 2)@*
+ Returns 0.
+@paragraph{}
+
+ (& 20 4)@*
+ Returns 4.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection cond
+
+ (cond @var{condition} @var{exp} [@var{condition2} @var{exp2} ...])
+@paragraph{}
+
+ Evaluates the conditions until one is true and returns the associated
+expression. If all conditions are false it returns 0.
+@paragraph{}
+
+ (cond 0 1 2 3)@*
+ Returns 3.
+@paragraph{}
+
+ (cond 1 "Hi!" 0 "Bye")@*
+ Returns "Hi!".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection Operator -- (decrement)
+
+ (-- @var{expression})
+@p{}
+
+ Returns the integer expression decremented by one. Currently only
+integer values are supported.
+@p{}
+
+ If the @var{expression} is an string and it corresponds to the name of a
+defined integer variable the variable is decremented and the resulting value
+is returned.
+@p{}
+
+ (-- 8)@*
+ Returns 7.
+@p{}
+
+ (setv "a_var" 4)
+ (++ "a_var")@*
+ Returns 3.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection Operator != (different)
+
+ (!= @var{exp1} @var{exp2})
+@p{}
+
+ Returns zero if both expressions represent the same value. Currently
+both expressions must be of the same type.
+@p{}
+
+ (== 1 2)@*
+ Returns 1
+@p{}
+
+ (== 2 (+ 1 1))@*
+ Returns 0
+@p{}
+
+ (== "Hello" "Hello")@*
+ Returns 0
+@p{}
+
+@c --------------------------------------------------------------
+@subsection Operator == (equal)
+
+ (== @var{exp1} @var{exp2})
+@p{}
+
+ Returns an integer different than zero if both expressions represent the
+same value. Currently both expressions must be of the same type.
+@p{}
+
+ (== 1 2)@*
+ Returns 0
+@p{}
+
+ (== 2 (+ 1 1))@*
+ Returns 1
+@p{}
+
+ (== "Hello" "Hello")@*
+ Returns 1
+@p{}
+
+@c --------------------------------------------------------------
+@subsection eval
+
+ (eval @var{expression} ...)
+@paragraph{}
+
+ This command is used to specify more than one action where just one is expected.
+Additionally you could write sLisp code in a string and then evaluate it. The
+expressions are evaluated from left to right, the last evaluated result is returned.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection exitloop
+
+ (exitloop )
+@p{}
+
+ Exits from a loop. @x{loop}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection gstr
+
+ (gstr @var{string} @var{position})
+@paragraph{}
+
+ Returns the @var{position}th character of the @var{string}. The first character is in
+the 0 position.
+@paragraph{}
+
+ (gstr "hello" 4)@*
+ Returns "o".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection if
+
+ (if @var{condition} @var{statement_1} [@var{statement_2}])
+@paragraph{}
+
+ It evaluates @var{condition}, if the boolean value of it is true then
+@var{statement_1} is evaluated. If the value is false and you provided a
+second statement then @var{statement_2} is evaluated. If the value is false
+and the second statement is missing nothing is evaluated and the resulting
+value is 0.
+@paragraph{}
+
+ (if "hello" 4)@*
+ Returns 4.
+@paragraph{}
+
+ (if "" 4 3)@*
+ Returns 3.
+@paragraph{}
+
+ (if 0 4)@*
+ Returns 0.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection Operator ++ (increment)
+
+ (++ @var{expression})
+@p{}
+
+ Returns the integer expression incremented by one. Currently only
+integer values are supported.
+@p{}
+
+ If the @var{expression} is an string and it corresponds to the name of a
+defined integer variable the variable is incremented and the resulting value
+is returned.
+@p{}
+
+ (++ 8)@*
+ Returns 9.
+@p{}
+
+ (setv "a_var" 4)
+ (++ "a_var")@*
+ Returns 5.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection left
+
+ (left @var{string} @var{number})
+@paragraph{}
+
+ Returns the first @var{number} characters of the @var{string}.
+@paragraph{}
+
+ (left "hello" 4)@*
+ Returns "hell".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection length
+
+ (length @var{string})
+@paragraph{}
+
+ This function returns the number of characters in @var{string}.
+@paragraph{}
+
+ (length "hello")@*
+ Returns 5.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection loop
+
+ (loop @var{expression} ...)
+@p{}
+
+ Evaluates the expressions until an @code{exitloop} command is found.
+@p{}
+
+ (= "i" 0)@*
+ (loop@*
+ (InsertText (tostr i))@*
+ (if (== i 5) (exitloop))@*
+ (++ "i")@*
+ )@*
+ Inserts "012345" text.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection Operator ~ (negated)
+
+ (~ @var{value})
+@paragraph{}
+
+ Returns the @var{value} negated (at bit level).
+@paragraph{}
+
+ (~ "hello")@*
+ Returns 0.
+@paragraph{}
+
+ (~ "")@*
+ Returns 0xFFFFFFFF.
+@paragraph{}
+
+ (~ 1)@*
+ Returns -2.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection not
+
+ (not @var{value})
+@paragraph{}
+
+ Returns the @var{value} negated.
+@paragraph{}
+
+ (not "hello")@*
+ Returns 0.
+@paragraph{}
+
+ (not "")@*
+ Returns 1.
+@paragraph{}
+
+ (not 1)@*
+ Returns 0.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection or
+
+ (or @var{exp1} @var{exp2} ...)
+@paragraph{}
+
+ Returns the logical or of the provided expressions. The values are
+evaluated from left to right. If any of them is non-zero the result is
+non-zero and the rest isn't evaluated.
+@paragraph{}
+
+ (or 20 4 2)@*
+ Returns 20.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection Operator | (bitwise or)
+
+ (| @var{exp1} @var{exp2} ...)
+@paragraph{}
+
+ Returns the bitwise or of the provided expressions. The values are
+evaluated from left to right. If at any point all bits are one the rest of
+the values isn't evaluated.
+@paragraph{}
+
+ (| 20 4 2)@*
+ Returns 22.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection Operator + (plus)
+
+ (+ @var{value1} @var{value2} ...)
+@paragraph{}
+
+ Returns the result of adding all the parameters. The type of the result is determined
+by the first parameter. Currently you can't mix strings and integers but if you bug me
+enough I'll add it. Adding strings means concatenation.
+@paragraph{}
+
+ (+ "hel" "lo")@*
+ Returns "hello".
+@paragraph{}
+
+ (+ 3 5)@*
+ Returns 8.
+@paragraph{}
+
+ (+ "hello" 1)@*
+ Syntax error.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection prex
+
+ (prex @var{text} @var{regex})
+@p{}
+
+ Performes a search using the @var{regex} Perl regular expression in the
+specified @var{text}.
+@p{}
+
+ Returns the number of matchs. This value is 0 if the search failed and at
+least one if succeed. To retreive the results of the matches you can use
+internal variables called @code{_X}, where X is the number of the match. The
+match number 0 is the main result, the others correspond to the
+subexpressions contained in @var{regex}. Note that variables with numbers
+above the bigest subexpression number are undefined or could contain the
+result of a previous search.
+@p{}
+
+ A very important detail is that back slash characters are escape characters
+in sLisp string. It means that @code{"\\d"} is equivalent to @code{\d}.
+@p{}
+
+ The following example shows @code{123} in the status line of the current
+edition window:
+@p{}
+
+ (eval
+ (prex "Hi 123 bye 456 nope" "i (\\d*) b")
+ (ShowInStatusLine _1)
+ )
+@p{}
+
+@c --------------------------------------------------------------
+@subsection repeat
+
+ (repeat @var{times} @var{expression} ...)
+@p{}
+
+ Evaluates the expressions until an @code{exitloop} command is found or the
+@var{times} number of iterations is reached.
+@p{}
+
+ (= "i" 0)@*
+ (repeat 6@*
+ (InsertText (tostr i))@*
+ (++ "i")@*
+ )@*
+ Inserts "012345" text.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection right
+
+ (right @var{string} @var{number})
+@paragraph{}
+
+ Returns the last @var{number} characters of the @var{string}.
+@paragraph{}
+
+ (right "hello" 3)@*
+ Returns "llo".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection setv
+
+ (setv @var{variable} @var{value})
+@p{}
+
+ Assigns @var{value} to the @var{variable}. If the @var{variable} wasn't yet defined
+the variable is created. The @var{variable} parameter must be a string representing
+the name of the variable, it may also be an expression. This command have a
+shortcut. @x{Operator = (assign)}.
+@p{}
+
+ Variable names can contain underscores, but the names starting with
+underscores are reserver for internal use.
+@p{}
+
+ (setv "counter" 1)@*
+ Assigns 1 to the @var{counter} variable, if @var{counter} doesn't exist counter is created.
+@p{}
+
+ (setv (+ "counter" "1") 1)@*
+ Assigns 1 to the @var{counter1} variable, if @var{counter1} doesn't exist counter1 is
+created.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection ShortFileName
+
+ (ShortFileName @var{file_name})
+@paragraph{}
+
+ Returns the short name for @var{file_name}. That's useful only for Windows
+and if long file names are supported. It can be used to pass a file name to
+an external program that doesn't support long file names.
+
+@c --------------------------------------------------------------
+@subsection sstr
+
+ (sstr @var{string} @var{position} @var{value})
+@paragraph{}
+
+ Changes the @var{position}th character of @var{string} to the first character of
+@var{value}. The first character is at 0.
+@paragraph{}
+
+ (sstr "hello" 1 "a")@*
+ Returns "hallo".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection strcasecmp
+
+ (strcasecmp @var{s1} @var{s2})
+@paragraph{}
+
+ This function is the same as @code{strcmp} but this version isn't case
+sensitive. @x{strcmp}.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection strcmp
+
+ (strcmp @var{s1} @var{s2})
+@paragraph{}
+
+ This function compares @var{s1} and @var{s2}. The returned value is zero
+if the strings are equal, a positive number if @var{s1} comes after @var{s2}
+in the ASCII table, else a negative number.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection strstr
+
+ (strstr @var{string} @var{search} [@var{start_pos}])
+@paragraph{}
+
+ Searches the string @var{search} in the string @var{string} starting at
+@var{start_pos} position. If @var{start_pos} is not provided the search is
+done from the beginning of @var{string}. The returned value is the offset of
+@var{search} in @var{string} or -1 if the value wasn't found.
+@paragraph{}
+
+ (strstr "hello" "el")@*
+ Returns 1.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection strxlt
+
+ (strxlt @var{string} @var{search} @var{replace})
+@paragraph{}
+
+ Searches for the character listed in @var{search} in the passed @var{string}
+replacing each ocurrence by the correponding value found in @var{replace}.
+@paragraph{}
+
+ (strxlt "hello" "eo" "12")@*
+ Returns "h1ll2".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection substr
+
+ (substr @var{string} @var{position} [@var{len}])
+@paragraph{}
+
+ Returns @var{len} characters of @var{string} starting at the indicated @var{position}.
+If @var{len} is omitted all the characters in the string starting at @var{position} are
+returned. The first character is at 0.
+@paragraph{}
+
+ (substr "hello" 1 3)@*
+ Returns "ell".
+@paragraph{}
+
+ (substr "hello" 2)@*
+ Returns "llo".
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection Operator - (substraction)
+
+ (- @var{value1} @var{value2})
+@paragraph{}
+
+ Returns the result of substracting @var{value2} from @var{value1}. Both
+variables must be integer.
+@paragraph{}
+
+ (- 20 3)@*
+ Returns 17.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection tostr
+
+ (tostr @var{value})
+@p{}
+
+ Returns @var{value} converted into a string.
+@p{}
+
+ (tostr 2)@*
+ Returns "2".
+@paragraph{}
+
+@c ************************************************************************************
+@section Editor specific commands
+
+ This section describes commands related to files being edited.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection AskString
+
+ (AskString @var{title} @var{message})
+@paragraph{}
+
+ Pops up a dialog asking for user input. The text is returned as an sLisp
+string variable. If the user canceled the input, the string has zero length.
+
+@c --------------------------------------------------------------
+@subsection BindKey
+
+ (BindKey @var{key_seq} @var{macro})@*
+ (BindKey @var{key_seq} @var{command} ...)
+@p{}
+
+ This command creates a key binding data type. It doesn't change anything
+alone and must be used with the @code{KeyBindings} command.
+@p{}
+
+ You can assign a defined sLisp macro or a piece of sLisp code using the
+first syntax. When assigning a sLisp code it must begin with @code{(} and end
+with @code{)}.
+@p{}
+
+ You can also assign a one command or a sequence of commands using the
+second syntax. The commands are specified using the same constants used for
+@code{SendCommands}. @x{SendCommands}.
+@p{}
+
+ The @var{key_seq} argument must be a string containing the key sequence
+used to trigger this definition.
+@p{}
+
+ The following example defines two keyboard sequences. The first is
+triggered when @key{Ctrl} and @key{K} are pressed together, then released and
+then @key{Z} is pressed (all in lower case mode). This sequence moves the
+cursor one line up and then one character to the left. The second sequence
+(@kbd{^K-X}) triggers a small sLisp sentence that prints a message in the
+message window.
+@p{}
+
+@example
+(KeyBindings
+ (BindKey "CtK,Z" cmcLineUp cmcCharLeft)
+ (BindKey "CtK,X" "(ShowInMessageWindow 'Hi! ;-)')")
+)
+@end example
+
+ When writing a key sequence you can use the @il{Insert key name} menu option
+if you don't know the name of a key combination. @x{Insert key name}.
+@p{}
+
+ An important detail is that this command can replace already defined keys
+and can even replace a group of assignments by the new definition. You can
+assign a command to @code{CtK} removing all the @kbd{^K} assigments during
+this operation.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection CloseWindowNumber
+
+ (CloseWindowNumber @var{number})
+@p{}
+
+ Closes the indicated window. The number is interpreted as in
+SelectWindowNumber. @x{SelectWindowNumber}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection ComplChoose
+
+ (ComplChoose @var{options} @var{delimiter} [@var{flags}])
+@paragraph{}
+
+ Brings up a floating drop-down list with the options. The
+@var{options} parameter is a delimited string, the delimiter is
+specified by the @var{delimiter} parameter.
+@paragraph{}
+
+ The function returns the option selected by the user or an empty string if
+the user aborted.
+@paragraph{}
+
+ The list is sorted alphabetically, the user can choose the item using the
+cursors or doing an incremental search. Only characters allowed for reserved
+words are accepted, any symbol will choose the currently selected item, other
+characters will abort.
+@paragraph{}
+
+ The @var{flags} parameter fine tunes the behavior of the routine. Currently
+only one thing can be changed. By default the string returned contains the
+character that produced the selection appended at the end of the string.
+Passing 1 for @var{flags} the character isn't concatenated.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection defmacro
+
+ (defmacro @var{name} @var{expression})
+@paragraph{}
+
+ Defines a new editor macro called @var{name}. When this macro is called the
+@var{expression} is evaluated. @x{How to write a sLisp macro}.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection EvalString
+
+ (EvalString @var{string})
+@p{}
+
+ Executes the sLisp code contained in the @var{string} variable.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection FindAgain
+
+ (FindAgain)
+@p{}
+
+ Repeats the last search. It should be used when you didn't gave control to
+the user since the last search because the user could perform a different
+search changing the compiled search. Returns the text found or an empty string
+if no match could be found. @x{FindString}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection FindString
+
+ (FindString @var{string} [@var{options_flags}])
+@p{}
+
+ Performs a search for the provided @var{string}. Returns the text found or
+an empty string if no match could be found. This operation moves the cursor
+position as in an interactive search. The match becomes temporally
+highlighted in the text.
+@p{}
+
+ Even when the @var{options_flags} argument is optional it is strongly
+recommended to provide it. If nothing is provided the user options will be
+used instead. The options are provided as flags combined with the @code{|}
+operand. Some of the flags doesn't have any sense when combined with others,
+you should avoid doing it. The available flags are:
+@p{}
+
+Search style:
+@p{}
+
+@itemize @bullet
+ @item edfCaseSensitive: perform a case sensitive search.
+ @item edfWholeWordsOnly: don't match partial words.
+ @item edfRegularEx: the string is a regular expression. Note this flag must
+be indicated in adition to the type of regular expressions used.
+@end itemize
+
+Scope:
+@p{}
+
+@itemize @bullet
+ @item edfSearchInComm: search only inside comments.
+ @item edfSearchOutComm: search only outside comments.
+ @item edfOnlySelection: search only inside the selected text.
+ @item edfFromCursor: start searching from the cursor position. That's the
+default action.
+ @item edfFromBeggining: start searching from the beggining of the selected
+scope.
+@end itemize
+
+Regular expressions options:
+@p{}
+
+@itemize @bullet
+ @item edfBasicRegEx: use basic POSIX regular expressions. Used in
+combination with edfRegularEx.
+ @item edfExtendedRegEx: use extended POSIX regular expressions. Used in
+combination with edfRegularEx.
+ @item edfPerlRegEx: use Perl regular expressions. Used in combination with
+edfRegularEx.
+ @item edfOptimizeRegEx: if the string to search doesn't contain special
+characters and regular expressions are enabled perform a normal search. This
+makes the search much more faster. This is the default action so you don't
+really need to specify this flag.
+ @item edfNoOptimizeRegEx: it is the opposite of edfOptimizeRegEx flag. It
+disables the optimization. Use it when you are sure the string is a regular
+expression even when it doesn't look like a regular expression. This option
+was created just in case the optimization fails to detect a real regular
+expression.
+@end itemize
+
+Others:
+@p{}
+
+@itemize @bullet
+ @item edfShowFuncName: display the name of the function where the match was
+found in the status line.
+@end itemize
+
+ A very important detail about regular expressions: In sLisp the @code{\}
+character is the escape character. It means that you have to use @code{\\} to
+get @code{\}.
+@p{}
+
+ The following example searchs for the @code{Hello} word followed by a digit
+using Perl regular expressions. Then prints the result of the search in the
+message window and after it repeats the search.
+@p{}
+
+@example
+(eval
+ (= "str" (FindString "Hello\\d" (| edfRegularEx edfPerlRegEx)))
+ (if str
+ (ShowInMessageWindow (+ "Found: " str))
+ (ShowInMessageWindow "Not found.")
+ )
+ (= "str" (FindAgain))
+ (if str
+ (ShowInMessageWindow (+ "Found: " str))
+ (ShowInMessageWindow "Not found.")
+ )
+)
+@end example
+
+ To learn more about the search options consult the find command (@xp{Find})
+and the regular expression options (@xp{Regular Expressions Options}). You
+could be also interested in learning more about POSIX regular expressions
+(@xp{Regular Expressions}), for Perl regular expressions consult some Perl
+reference. This command is complemented by @code{FindAgain} (@xp{FindAgain}),
+@code{ReplaceString} (@xp{ReplaceString}) and @code{ReplaceAgain}
+(@xp{ReplaceAgain}) commands.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection ForceUpdate
+
+ (ForceUpdate)
+@paragraph{}
+
+ It forces an update at this point of the macro. That's useful if you want
+to stop to ask the user something or the macro will take some time to complete
+and don't want to give the impression the editor hangs.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection GetCursorX
+
+ (GetCursorX)
+@p{}
+
+ Returns the X cursor coordinate. Note the coordinates are computed from
+zero.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetCursorY
+
+ (GetCursorY)
+@p{}
+
+ Returns the Y cursor coordinate. Note the coordinates are computed from
+zero.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetCurWindowNumber
+
+ (GetCurWindowNumber)
+@p{}
+
+ Returns the window number for the currently selected edition window.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetMaxWindowNumber
+
+ (GetMaxWindowNumber)
+@p{}
+
+ Returns the window number for the edition window with the biggest window
+number. The lowest number is two.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetMaxProjectItem
+
+ (GetMaxProjectItem)
+@p{}
+
+ Returns the number of items in the current project. If no project is opened
+it returns zero. You can retreive the project items using
+@code{GetProjectItem}. @x{GetProjectItem}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetProjectItem
+
+ (GetProjectItem @var{number})
+@p{}
+
+ Returns the name of the nth item in the current project. If no project is
+opened or the number is invalid the function returns an empty string.
+You can know how many items have the current project using
+@code{GetMaxProjectItem}. @x{GetMaxProjectItem}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetSystemInfo
+
+ (GetSystemInfo @var{which})
+@p{}
+
+ Returns information about the system and similar stuff. The @var{which}
+argument selects which kind of information is returned. Available values are:
+@p{}
+
+@itemize @bullet
+ @item edfInfTVDriver: The short name of the Turbo Vision driver in use.
+Some of the possible drivers are: DOS, Linux, QNX, QNX4, UNIX, Win32, WinGr,
+WinNT, X11 and XTerm.
+ @item edfInfOS: The name of the operating system. Some of the possible
+names are: DOS, UNIX and Win32.
+ @item edfInfOSFlavor: Some of the possible flavors are: Linux, FreeBSD,
+Solaris and QNXRtP.
+ @item edfInfCPU: The CPU family used to compile the editor. Some of the
+possible names are: x86, Alpha, SPARC64, SPARC, PPC, HPPA, MIPS, Itanium
+and Unknown.
+ @item edfInfCompiler: The compiler used to compile the editor. Some of the
+possible compilers are: GCC, BCPP and MSVC.
+ @item edfInfCompilerFlavor: Some of the possible flavors are: djgpp,
+MinGW and Cygwin.
+@end itemize
+
+
+@c --------------------------------------------------------------
+@subsection getenv
+
+ (getenv @var{name})
+@paragraph{}
+
+ This command returns the content of the environment variable called
+@var{name}. Internal variables of the editor are also accessable. If the
+variable doesn't exist an empty string is returned.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection GetSelection
+
+ (GetSelection)
+@paragraph{}
+
+ This command returns the selected text in the editor as a sLisp string.
+@x{How to write a sLisp macro}.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection GetSyntaxAtCursor
+
+ (GetSyntaxAtCursor)
+@paragraph{}
+
+ This command returns the syntax highlighting flags for the cursor position.
+That's very specific and can be used to find out if the cursor is inside a
+comment, string or preprocessor code.
+@paragraph{}
+
+ To understand how it works use the following macro and trigger it in many
+places to see what you get:
+@paragraph{}
+
+@example
+(defmacro 'Test edfWE'
+ (eval
+ (ShowInStatusLine (+ "" (GetSyntaxAtCursor)))
+ )
+)
+@end example
+
+ The following table explains the flags returned:
+@paragraph{}
+
+@table2{Flag,Meaning}
+@titemR{edfComInside,Inside an end-of-line comment}
+@titemR{edfEndCom,This line ends a multiline comment}
+@titemR{edfEndCom2,This line ends a multiline comment type 2}
+@titemR{edfExtCom,This line extends a multiline comment}
+@titemR{edfExtCom2,This line extends a multiline comment type 2}
+@titemR{edfExtOneLineCom,The end-of-line comment is extended to the next line}
+@titemR{edfExtPrepro,The preprocessor line follows in the next}
+@titemR{edfExtString,Inside a string}
+@titemR{edfExtString2,Inside a string type 2}
+@titemR{edfExtString3,Inside a string type 3}
+@titemR{edfInsideCom,Inside a multiline comment}
+@titemR{edfInsideCom2,Inside a multiline comment type 2}
+@titemR{edfPrepro,Inside preprocessor code}
+@titemR{edfStartCom,This line starts a multiline comment}
+@titemR{edfStartCom2,This line starts a multiline comment type 2}
+@titemR{edfStartInCom,This line is commented out by the previous}
+@titemR{edfStartInCom2,This line is commented out by the previous (type 2)}
+@titemR{edfStartString,This line startes inside a string}
+@titemR{edfStartString2,This line startes inside a string type 2}
+@titemR{edfStartString3,This line startes inside a string type 3}
+@endtable-{}
+
+ Something very important is that the editor will only analyze the line up
+to the cursor's position. So if the cursor is inside a string the editor
+will think this line extends a string.
+
+@c --------------------------------------------------------------
+@subsection GetSyntaxLang
+
+ (GetSyntaxLang)
+@p{}
+
+ Returns the language used for syntax highlight in the current editor. If
+none syntax highlight is in use it returns an empty string.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetWrapCol
+
+ (GetWrapCol [window_number])
+@p{}
+
+ Returns the @b{wrap column} setting for the specified window. If you don't
+specify a window number then the current window number is used. If the
+specified value is invalid this function returns 0.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetWindowCols
+
+ (GetWindowCols [window_number])
+@p{}
+
+ Returns the number of visible columns in the specified window. If you don't
+specify a window number then the current window number is used. If the
+specified value is invalid this function returns 0.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection GetWindowRows
+
+ (GetWindowRows [window_number])
+@p{}
+
+ Returns the number of visible columns in the specified window. If you don't
+specify a window number then the current window number is used. If the
+specified value is invalid this function returns 0.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection InsertText
+
+ (InsertText @var{string} [@var{selected} [@var{move}]])
+@paragraph{}
+
+ Inserts the @var{string} at the cursor's position. By default the cursor is moved
+behind the insertion and the inserted text isn't selected. If @var{selected} is 1
+the text is selected. If the @var{move} parameter is 0 the cursor isn't moved and if
+the parameter is 1 the action depends on the current editor's setup.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection KeyBindings
+
+ (KeyBindings @var{key_binding} ...)
+@p{}
+
+ Adds the @var{key_binding} to the keyboard definitions. As the operation to
+insert a key in the keyboard definitions is slow this command is used to
+group all the operations in just one operation. Currently the only command
+that returns a key binding is @code{BindKey}. @x{BindKey}.
+@p{}
+
+ It returns zero if the operation failed and one if the operation succeed.
+If any of the specified key bindings fails the keyboard configuration isn't
+altered.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection MessageBox
+
+ (MessageBox @var{message} [@var{options}])
+@p{}
+
+ Pops up a small dialog showing the @var{message} to the user. The
+@var{options} can take the following values (use 'or' to combine them):
+@p{}
+
+@itemize @bullet
+@item edfMBCancelButton: has a @code{Cancel} button.
+@item edfMBNoButton: has a @code{No} button.
+@item edfMBOKButton: has an @code{Ok} button.
+@item edfMBOKCancel: has an @code{Ok} and a @code{Cancel} button.
+@item edfMBYesButton: has a @code{Yes} button.
+@item edfMBYesNoCancel: has a @code{Yes}, a @code{No} and a @code{Cancel} button.
+@item edfMBConfirmation: use @b{Confirmation} as caption.
+@item edfMBError: use @b{Error} as caption.
+@item edfMBInformation: use @b{Information} as caption.
+@item edfMBWarning: use @b{Warning} as caption.
+@end itemize
+
+@c --------------------------------------------------------------
+@subsection OpenFile
+
+ (OpenFile @var{string})
+@p{}
+
+ Opens the file @var{string} in a window and makes it the current one. If the
+file doesn't exist it does nothing. If the file fails to be loaded returns 0.
+If the file was already opened returns 2 and if the file was opened 1.
+@p{}
+
+
+@c --------------------------------------------------------------
+@subsection ReplaceAgain
+
+ (ReplaceAgain)
+@p{}
+
+ Repeats the last search and replace operation. It should be used when you
+didn't gave control to the user since the last search because the user could
+perform a different search changing the compiled search. Returns a boolean
+value indicating the status of the last search. @x{ReplaceString}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection ReplaceString
+
+ (ReplaceString @var{string} @var{replacement} [@var{options_flags}])
+@p{}
+
+ Performs a search and replace operation. Returns a boolean value indicating
+the status of the last search. Consult the @code{Find} command
+(@xp{FindString}) and the replace options of the editor
+(@xp{Replace}) for more information.
+@p{}
+
+ In addition to the @code{Find} options you have the following options:
+@p{}
+
+@itemize @bullet
+ @item edfPromptOnReplace: ask confirmation to the user.
+ @item edfReplaceAll: repeat the search and replace operation until no match
+can be found in the current scope.
+ @item edfNormalText: used to indicate that the @var{replacement} string is
+a simple text and not a replacement template. This is the default behavior.
+ @item edfTagsText: used to indicate that the @var{replacement} string
+contains @code{$n} tags. For more information consult the section for the
+regular expressions dialog of the editor (@xp{Regular Expressions Options}).
+@end itemize
+
+ The following example searchs for the @code{Hello} word followed by a digit
+using Perl regular expressions and replaces the text by the digit followed by
+an space and the @code{Bye} word. Then prints the result of the operation in the
+message window.
+@p{}
+
+@example
+(eval
+ (if (ReplaceString "Hello(\\d)" "$1 Bye"
+ (| edfRegularEx edfPerlRegEx edfTagsText))
+ (ShowInMessageWindow "Replaced.")
+ (ShowInMessageWindow "Not replaced.")
+ )
+)
+@end example
+
+@c --------------------------------------------------------------
+@subsection RunProgram
+
+ (RunProgram @var{program_name} [[@var{flags}] @var{parser}])
+@p{}
+
+ Calls the desired program. You can pass more than one using the @code{;}
+separator or any separator supported by your shell. Under DOS @code{;} is ok
+even when command.com doesn't support it. The stderr and stdout are
+redirected and captured by the message window of the editor.
+@p{}
+
+ Use the operator @code{+} to concatenate strings and pass arguments.
+@p{}
+
+ Using @code{edfRunUserScreen} for the @var{flags} argument the editor will
+use the user screen when running the external program. Using
+@code{edfRunNoRedirect} the editor won't redirect the standard output. For
+interactive applications that uses standard input and output you should both
+flags combined using the or operator. @x{Operator | (bitwise or)}.
+@p{}
+
+ Another option you can use is @code{edfRunStopDebug}. This option will stop
+any active debug session. That's a very delicated option and can be used when
+the macro is calling a compiler to rebuild an executable. In some OSs you
+must stop the debugger in order to be able to overwrite the executable.
+Additionaly gdb have some bugs that needs it as workaround.
+@p{}
+
+ The @var{parser} parameter tells the editor which error parser will be used
+to parse the output of the external program. By default the GNU one is used.
+@p{}
+
+ To learn more about the message window @x{Message Window}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection RunProgramRedir
+
+ (RunProgramRedir @var{program_name} [@var{input_text}])
+@paragraph{}
+
+ This function is similar to RunProgram, but the result isn't dumped to
+the message window, instead the output of the program is returned as a
+string.
+@paragraph{}
+
+ Additionally you can specify a text to send to the standard input of the
+program you are calling. You can easily call external filters with it. I provide
+an example of how to replace a selected text with the output of an external
+filter in the @file{macros.slp} file. @x{Configuration files location}.
+@p{}
+
+ Be careful, that's a very powerful command, but very dangerous too.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection SelectionExists
+
+ (SelectionExists)
+@p{}
+
+ Returns 1 if some text is selected and the selection is visible.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection SelectWindowNumber
+
+ (SelectWindowNumber @var{number})
+@p{}
+
+ Selects the indicated window. Positive numbers are reserved for edition
+windows, except window number one that's the project window. Negative numbers
+are used for special windows. The function returns a boolean value indicating
+if the desired window was selected.
+@p{}
+
+ When you select an edition window it becomes the target of all sLisp
+operations.
+@p{}
+
+ The available constants for special windows are:
+@p{}
+
+@itemize @bullet
+ @item edfWinASCII
+ @item edfWinCalendar
+ @item edfWinClipboard
+ @item edfWinHelp
+ @item edfWinMP3
+ @item edfWinMan
+ @item edfWinMessage
+ @item edfWinPrj
+@end itemize
+
+@c --------------------------------------------------------------
+@subsection SendCommands
+
+ (SendCommands @var{command} ...)
+@paragraph{}
+
+ Sends all the listed commands to the editor. The editor commands are sLisp constants
+that start with @code{cmc}. These commands are the same explained in the keyboard
+section as @code{cmcXXXXX}.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection SetCursorXY
+
+ (SetCursorXY @var{x} [@var{y}])
+@p{}
+
+ Sets the cursor coordinates. Note the coordinates starts from zero. If the
+@var{y} argument is omitted only the X coordinate is changed. This function
+returns the current Y coordinate, it doesn't have to be the same value you
+indicated in the @var{y} argument because the editor limits this value to the
+last line in the current buffer.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection ShowInMessageWindow
+
+ (ShowInMessageWindow @var{string} [@var{clear}])
+@p{}
+
+ Prints the desired string in the message window. That's a very good way to
+show a result to the user.
+@p{}
+
+ If the message window isn't selected or visible it gets the focus and
+becomes visible. The optional parameter allows you to clean the contents of
+the window. @x{Message Window}.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection ShowInStatusLine
+
+ (ShowInStatusLine @var{string})
+@paragraph{}
+
+ Prints the passed string in the status line of the current editor. Tabs
+are converted to one space and the message stops at the first carriage
+return or line feed. That's a very good way to show a result to the user.
+@paragraph{}
+
+@c --------------------------------------------------------------
+@subsection WhichEditor
+
+ (WhichEditor [@var{option}])
+@paragraph{}
+
+ This command takes one optional parameter and returns the file name of the current
+file under edition.
+@paragraph{}
+
+ The optional parameter can be:
+@paragraph{}
+
+@table3{Parameter,Meaning,Example}
+@titemR{edfWEFull (0),Full name and path,\@samp\{c:/temp/test.txt\}}
+@titemR{edfWEFullNoExt (1),Same as 0 but without extension,\@samp\{c:/temp/test\}}
+@titemR{edfWEPath (2),Path for the file,\@samp\{c:/temp/\}}
+@titemR{edfWEDisk (3),Disk drive,\@samp\{c:\}}
+@titemR{edfWEExtension (4),File extension,\@samp\{.txt\}}
+@titemR{edfWENameNoExt (5),Name without extension,\@samp\{test\}}
+@endtable-{}
+
+
+@c --------------------------------------------------------------
+@subsection WordUnderCursor
+
+ (WordUnderCursor [@var{max_length} [@var{options}]])
+@paragraph{}
+
+ This command takes one optional parameter and returns the word that's
+located under the cursor. That's very useful for things like searching
+help about the function the user is typing or things like that.
+@paragraph{}
+
+ The maximum length is optional and if you don't specify it 256 is used.
+Values under 4 or over 32768 are adjusted to fit this range for security
+issues.
+@paragraph{}
+
+ The @var{options} parameter is 0 by default. Passing 1 the editor will
+return the word located to the left of the cursor, if the cursor is located
+at the first character after this word.
+@paragraph{}
+
+
+@c ************************************************************************************
+@section Writing macros that use text filters
+
+ The sLisp language provides the commands needed to take a selected text,
+pass it to an external program, and collect their output. You can finally
+replace the original text by the new text. This kind of programs are usually
+called filters. Some applications of this are complex recoding using GNU
+recode, text formating, code indentation using GNU indent, @il{etc.}
+@p{}
+
+ The following sections were contributed by Grzegorz Adam Hankiewicz and
+explains how to use this feature.
+@p{}
+
+@c --------------------------------------------------------------
+@subsection How to use Setedit for something it was not meant to
+
+SET has always said that setedit is not a word processing
+program. He's right, it's best at doing things like programming. But
+once you get used to it the road to building another emacs is clear:
+you start wanting to use it even to cook your breakfast. This
+document, however, centers on how to control text format easily
+under setedit, which is not that ambitious :)
+@p{}
+
+As you will notice, in some version SET added the "word wrap"
+option. IMHO it should be removed, if you try to use it, it
+will behave quite differently from what you expect (ie: if you
+are writting tabbed lines, the editor will ignore them and puts
+your cursor right away in the first column ignoring any possible
+autoindentation options and tab uses you might have set for the
+document). Also, it's setedit's choice of characters which will be
+used to split the line. Bleah... it really sucks.
+@p{}
+
+But setedit is customizable. You can write macros in a lisp
+like language. The language still doesn't allow you to control
+tightly things like text formatting, but there's one cool option:
+you can pipe a block selection to another external program and
+the editor will substitute it with the output of this external
+program. Certainly not the most optimized way of doing things, but
+flexible enough to write a custom extension which treats your text.
+@p{}
+
+And here we go... the purpose will be to create a macro, which
+feeds a text block to an external program which we will write. Simple
+as that, all the power you wanted at your finger tips.
+@p{}
+
+@c --------------------------------------------------------------
+@subsubsection Step 1 - Building your macro
+
+Macros are written in sLisp, and stored somewhere in a @file{macros.slp}
+file. This file can be a global read-only file or it can be located at
+@file{~/.setedit/macros.slp}. It's pure text, and somewhere (ie: at the
+end of the file) you will insert the following chunk of code:
+@p{}
+
+@example
+;*******************************************************************
+;
+; MACRO: Block reformat
+;
+; DESCRIPTION: This script gets the current selection and feeds it to
+; an external program. If no selection is present a message box will
+; be printed.
+;
+;*******************************************************************/
+
+(defmacro 'Block reformat'
+ (eval
+ (setv "input" (GetSelection))
+ (if (length input)
+ ; Call the filter
+ (eval
+ (setv "output"
+ (RunProgramRedir
+ ; filter line here
+ "~/project/email-fmt.py/email-fmt.py "
+ input
+ )
+ )
+ (SendCommands cmcCut)
+ (InsertText output 1)
+ )
+ ; Ask the user to select something first
+ (MessageBox "Please select a text first")
+ )
+ )
+)
+@end example
+
+Ok, don't worry about the syntax of the macro or how it's written,
+if you are curious you can take a look at setedit's documentation
+to find out what all that mess means. The important line is the
+one which follows the comment @code{; filter line here}. That line
+is actually the path to the external program we will be using,
+which can be stored anywhere on your computer, it only needs to
+have execution permission. I am the only user of my machine, so I
+don't need to put things under /local/bin to feel comfortable :)
+Please change that to point at your filter script.
+@p{}
+
+@c --------------------------------------------------------------
+@subsubsection Step 2 - The filter program
+
+The filter program has to be simple: receives text lines as input
+and prints the result to stdout. You can say: @il{Hey! that calls some
+weird Python script which I don't have... why don't
+I call GNU's fmt command instead?}. Good point. Do it. If you are
+meaning to write simple texts that's ok. In fact, after the command
+you can specify parameters to fmt like the width of the lines, and
+there you go, you have a text formatting macro in Setedit. But if
+you are meaning to answer emails (ie: setedit is your default
+editor and mail programs like mutt call it to write messages) or
+do something more sophisticated, you better use something like this
+(big chunk of code follows):
+@p{}
+
+@example
+#!/usr/bin/env python
+
+import sys, popen2, tempfile, os
+
+class LINE:
+ pass
+
+indentation = " \t>:;#"
+
+def detect_indentation_characters(line):
+ """Returns number of indentation chars minus trailing whitespace."""
+ count = 0
+ for f in line:
+ if f in indentation: count = count + 1
+ else: break
+
+ return len(line[:count].rstrip()), count
+
+def initial_scan(line):
+ """Add attributes to the lines."""
+ l = LINE()
+ l.line = line
+ l.total_length = len(line)
+ l.ident, l.soft_ident = detect_indentation_characters(line)
+ l.length = l.total_length - l.soft_ident
+ return l
+
+def same_indentation_lines(lines):
+ """Returns number of lines with same indentation level."""
+ f = 1
+ while f < len(lines):
+ if lines[f].ident != lines[0].ident:
+ break
+ else:
+ f = f + 1
+
+ return f
+
+def reformat_lines(lines, temp_filename):
+ """Dumps lines in list to file, the reads fmt's output."""
+ assert lines
+ ident = lines[0].ident
+ length = max (70 - ident, 20)
+
+ # create temporary file with content to ident
+ file = open(temp_filename, "wt")
+ num = 0
+ while num < len(lines):
+ string = lines[num].line[ident:]
+ stripped = string.lstrip()
+ if stripped: file.write(stripped)
+ else: file.write(string)
+ num += 1
+ file.close()
+
+ # call external tool and read it's stdout
+ stdout, stdin = popen2.popen2 (["fmt", "-w", "%d" % length,
+ "-u", temp_filename])
+ stdin.close()
+ if ident: padding = "%s " % lines[0].line[:ident]
+ else: padding = ""
+ new_lines = stdout.readlines()
+ stdout.close()
+ os.unlink(temp_filename)
+
+ # output lines, taking care of last line's trailing '\n'
+ for f in range(len(new_lines)-1):
+ sys.stdout.write("%s%s" % (padding, new_lines[f]))
+ if lines[num-1].line.find("\n") >= 0:
+ sys.stdout.write("%s%s" % (padding, new_lines[-1:][0]))
+ else:
+ sys.stdout.write("%s%s" % (padding, new_lines[-1:][0][:-1]))
+
+def main():
+ lines = map(initial_scan, sys.stdin.readlines())
+ temp_filename = tempfile.mktemp(".email-fmt.tmp")
+
+ f = 0
+ while f < len(lines):
+ look = same_indentation_lines(lines[f:])
+ reformat_lines(lines[f:f+look], temp_filename)
+ f = f + look
+
+if __name__ == "__main__":
+ main()
+# end of python code
+@end example
+
+Woah, that's more than the previous script. True, but this 86
+line Python script is a cool wrapper: fmt doesn't
+know exactly how you want to format your text. If you are replying
+somebody's email, some text will have quotes. Wouldn't it be nice if
+fmt could detect them? Yes, but it doesn't. Remember that the unix
+style is doing one simple thing, but doing it extremely well.
+@p{}
+
+So we solve this with the Python script. It isn't really
+long (try removing blank lines and comments), and it's pretty clear
+(to any experienced functional programmer) what it does. It scans
+the sent block of text for existant quote characters like those defined
+in the indentation variable, which are used frequently by most email
+programs. These lines will be kept together, and the script will
+call fmt with them, but removing the quote characters and reducing
+the line width. To the result, the script will add the apropiate
+quote indentation level.
+@p{}
+
+This means that you can select say 20 lines of text which contain
+three different quote indentation levels. If these use the defined
+indentation characters the script will split them, format them
+separately and join them before returning them to setedit. The result
+is obvious: a cool formatting feature which is cumbersome to build
+into setedit, and which can be customized any way you want. You
+can write your script in Python, ruby, perl, C, etc,
+etc... you put the limit, not the program.
+@p{}
+
+@c --------------------------------------------------------------
+@subsubsection Step 3 - Binding your script to a keystroke
+
+Nice, we have the macro, we have the script, but how do we run
+it? In a horrible world you would have to reproduce these steps to
+format a text block:
+@p{}
+
+@itemize @bullet
+@item Select text block
+@item Open macro menu
+@item Select @code{Select...}
+@item Choose the macro
+@end itemize
+
+If you did it once, you can repeat the macro with @kbd{Shift+F3}, but
+this is not nice, it prevents you from running other macros and
+you aren't saved from the punishment of doing all that once each
+time you run setedit, and since we want this for email replies,
+the editor will be run independently for each answer. Ugh!
+@p{}
+
+Luckily you can bind a macro to a key (@xp{Assigning a sLisp macro}).
+The option is located under the menu option
+called Tool&Ops, submenu Options, submenu Keyboard, submenu Key
+assignment. Once you reach that, you can see all the key bindings for
+the editor. Notice that none seem to use Alt for keystrokes, which
+is nice because you can assume they are free for customizing. So you
+just have to type a nice combo. I use @kbd{Alt+F} for "Formatting". Once
+you have the combo you assign the macro "Block reformat" to it.
+@p{}
+
+Say ok to all menus and try it yourself: write a few lines with only
+a word in each of them. Select those lines and press @kbd{Alt+F}. If
+you did it right you will see all those words formatted in a
+single paragraph. Now try that with email indentation. Think of all
+the possibilities of using this trick along with the "rectangle
+selection" feature of the editor.
+@p{}
+
+@c --------------------------------------------------------------
+@subsubsection Examples
+
+I prepared some examples so you could see the good things of all
+this work. All the examples are the result of selecting all lines
+and using the macro. You can easily reproduce them yourself.
+@p{}
+
+Written in setedit:
+@p{}
+
+@example
+ So I am just a lazy boy typing this
+ which I know will be
+ formatted correctly with that cool
+ python script written by a
+ guy with funny name.
+@end example
+
+After the @kbd{Alt+F} combo:
+@p{}
+
+@example
+So I am just a lazy boy typing this which I know will be formatted
+correctly with that cool python script written by a guy with
+funny name.
+@end example
+
+Written in setedit:
+@p{}
+
+@example
+On 9 Jan 01 at 14:25, Grzegorz Adam Hankiewicz wrote:
+> On Sun, 7 Jan 2001, Petr Vandrovec wrote:
+> > (2) you can specify only xres 'x' yres '-' bpp '@@' fv, you cannot
+> > specify for example horizontal/vertical sync polarity, sync-on-green
+> > mode, or even shift picture left-right (modify
+> > left/right/upper/lower/hslen/vslen fields of var_screeninfo)
+> >
+> > First problem is probably unresolvable without linking modedb to each
+> > fbdev separately, as if you removing __init, others will come to you
+> > with big staff.
+> >
+> > Second problem is probably only 'invent how to write it' problem... You
+> > can look at matroxfb picture size/refresh related parameters - all of
+> > them should be parsed by modedb for benefit of all drivers...
+>
+> Aha.. do you mean I have to add new options and switches to modedb, taking
+> out the parsing code from the matroxfb module? For example, adding new
+> modedb functions which have more parameters, to remain backwards
+> compatible with the existant code?
+
+In my opinion it should still take one char* and...
+@end example
+
+After the Alt+F combo:
+@p{}
+
+@example
+On 9 Jan 01 at 14:25, Grzegorz Adam Hankiewicz wrote:
+> On Sun, 7 Jan 2001, Petr Vandrovec wrote:
+> > (2) you can specify only xres 'x' yres '-' bpp '@@' fv, you
+> > cannot specify for example horizontal/vertical sync polarity,
+> > sync-on-green mode, or even shift picture left-right (modify
+> > left/right/upper/lower/hslen/vslen fields of var_screeninfo)
+> >
+> > First problem is probably unresolvable without linking modedb
+> > to each fbdev separately, as if you removing __init, others will
+> > come to you with big staff.
+> >
+> > Second problem is probably only 'invent how to write it'
+> > problem... You can look at matroxfb picture size/refresh related
+> > parameters - all of them should be parsed by modedb for benefit
+> > of all drivers...
+>
+> Aha.. do you mean I have to add new options and switches to modedb,
+> taking out the parsing code from the matroxfb module? For example,
+> adding new modedb functions which have more parameters, to remain
+> backwards compatible with the existant code?
+
+In my opinion it should still take one char* and...
+@end example
+
+@c ************************************************************************************
+@c ************************************************************************************
+@chapter Calculator
+
+ The calculator inside the editor was originally made by Laszlo Molnar.
+Laszlo is a friend of mine from Hungary and is the author of the great DJP
+progam (a djgpp exe compressor and now UPX, the best EXE compressor in all
+the categories). Currently the editor is compiled with a new calculator with
+some advanced features. This new calculator have the same features plus some
+interesting additions and was developed by Burton Radons.
+@paragraph{}
+ The sources of the calculator are in the @file{parser.c} file. They are
+free and you can use it for any purpose. There are three sources.
+@paragraph{}
+ Here is the documentation of the calculator written by Laszlo:
+@paragraph{}
+
+ The purpose of this program is to provide a simple but powerful
+'calculator' for programmers, to help with coding and debugging, where GDB's
+expression evaluator is not enough.
+@paragraph{}
+
+ You may say "Hey, I can write a better one with @il{flex} and @il{bison}", and you
+may be right. I can make a better one too. But it'll be 4-5 times longer!
+This calculator is only 10 kbytes of C code. What I think? It's not that bad.
+@paragraph{}
+
+ The parser algorithm I use is called 'Operator Precedence Parsing'
+(I translated this from Hungarian, so I may be wrong ;-). It
+works with 'operator precedence grammars' (a subset of LR(1) grammars),
+which means that there can't be two non-terminating tokens next to each other
+on the right side of your grammar rules. It's ideal for expression
+evaluation.
+@paragraph{}
+
+ With this parser you can use numbers, operators, parentheses and functions
+like in C.
+@paragraph{}
+
+Here are the operators in decreasing precedence:
+@paragraph{}
+
+@enumerate
+@item
+@code{~} unary not
+@code{-} unary minus
+@item
+@code{**} power
+@item
+@code{*} multiplication
+@code{/} division
+@code{%} modulo
+@item
+@code{+} plus
+@code{-} binary minus
+@item
+@code{@lt{}@lt{}} shift left
+@code{@gt{}@gt{}} shift right
+@item
+@code{@lt{}} less than *
+@code{@lt{}=} less or equal than *
+@code{@gt{}} greater than *
+@code{@gt{}=} greater or equal than *
+@item
+@code{==} equal to *
+@code{!=} different than *
+@item
+@code{&} bitwise and
+@item
+@code{^} bitwise xor
+@item
+@code{|} bitwise or
+@item
+@code{&&} logical and *
+@item
+@code{||} logical or *
+@item
+@code{?:} conditional *
+@end enumerate
+@paragraph{}
+
+ The operators marked with asterisk are available only in Burton's version.
+@paragraph{}
+
+ The calculator includes the following functions:
+@il{sin\, cos\, tan\, sinh\, cosh\, tanh\, asin\, acos\, atan\, log\, log10\, exp\, abs\,
+sqrt\, ceil} and @il{floor}. They work as you expect. Additionally the
+calculator provides some radix conversion routines: @il{bin\, oct\, dec} and @il{hex}.
+@paragraph{}
+
+ The calculator uses doubles, but you can use numbers in the usual integer
+formats also: 0x@dots{} for base 16, 0b@dots{} for base 2 and 0@dots{} for
+base 8. The result of the calculation is displayed as a double for base 10,
+and converted to long long format for the other radixes.
+@paragraph{}
+
+ In addition the new calculator has the following features:
+@paragraph{}
+
+ You can define variables just by assigning a value to them. So if you enter
+@il{x=5} you can use @il{x} in other calculation like this @il{x**2}. You can
+also use the C/C++ assign plus operation. Post and pre increment and
+decrement are also available.
+@paragraph{}
+
+ You can define functions like this @il{f(x)=x**2+2} so then entering
+@il{f(5)} will give as result @il{27}.
+@paragraph{}
+
+ The C/C++ conditionals are available, so the following:
+@il{f(5)>=27 ? 6 : 2} will give @il{6} assuming you defined @il{f(x)} as in the
+above example.
+@paragraph{}
+
+ You can separate operations with commas as in C. The result of the last
+operation is the result of the compound.
+@paragraph{}
+
+@chapter How to contact me
+@cindex How to contact me
+
+ If you have any suggestions or a bug report contact me at the address shown
+in the author section. @x{About the Author}.
+@paragraph{}
+
+@section Bugs
+@cindex Bugs
+
+ If you find a bug please contact me, the Undo thing is the most complex
+one and I know that needs some work on it.
+@paragraph{}
+
+ When reporting a bug please don't tell me: Some times some strange thing
+happens @dots{} Try to find a pattern to the problem. What situation triggers
+the problem? @dots{} with which file(s)? Then send me the file and the description.
+@paragraph{}
+
+ When sending me a file UUEncode it to avoid problems related with e-mail.
+@paragraph{}
+
+@chapter TAGS files
+
+This chapter describes some details about @file{TAGS} files. They are
+referreded as tags in the rest of the sections.
+@p{}
+
+I wrote a small ilustrated tutorial showing how to quickly use this. The
+tutorial is available in the editor home page:
+http://setedit.sf.net/tags.html. It is also included in some of the
+distributions of the editor.
+@p{}
+
+I strongly recommend reading the documentation of the program to generate the
+tag files.
+@p{}
+
+@section What are tags?
+@cindex tags, what are?
+
+TAGS files are plain text files containing a list of symbols from your source
+code. For each symbol the file indicates in which file it's located and how to
+find the symbol inside the file. Modern programs also include very important
+information like which type of symbol is defined and if this symbol is part of
+a bigger construct like a class.
+@p{}
+
+This information is very useful to do searches. The editor implements
+facilities to jump to any defined symbol, browse classes and do word
+completion using information from tag files.
+@p{}
+
+@section Which program is used to generate TAGS files?
+@cindex tags, program to generate
+
+A lot of programs generate tag files but the editor uses special features
+only found in the @il{Exuberant Ctags} program. For this reason I recommend
+using this program to generate the tag files. You can find this program at
+Source Forge (http://ctags.sourceforge.net).
+@p{}
+
+@section How should I generate the tags?
+@cindex tags, how to generate
+
+It depends on your project and how you compile the project. It also
+depends on how fast your system is. I currently use a tags file for the
+editor and another for the Turbo Vision library. The best is to refresh the
+tags file using the same makefile you use to compile your project. If your
+system isn't very fast or your project is too big you could try using one
+tags file for each directory in your project. The editor can be configured to
+collect symbols from various tag files.
+@p{}
+
+The command line options I recommend to use with @file{ctags} are:
+@p{}
+
+@itemize @bullet
+ @item -R recursive, to search in all subdirectories.
+ @item ---fields=+i+l+m+z Inheritance information, language of source file
+that contains the tag, implementation information and type of tag.
+@end itemize
+
+Without the @code{+i} and @code{+z} option you won't be able to use the class
+browser.
+@p{}
+
+@section Can these files be created and updated by the editor?
+@cindex tags, how to maintain
+
+I recommend using makefiles to maintain tag files because you have all
+the control over when and how they are updated. But if you are using a fast
+machine and want to simplify the process you can let the editor create and
+maintain a tags file for your project. You'll find options for it in the
+Tool&Ops | Options | Tag files menu option. @x{Tag files options}.
+
+@section What is the easiest way to use tags?
+@cindex tags, easy way
+
+Here is an explanation about how to quickly use tag files:
+@p{}
+
+@enumerate
+@item Install @il{Exuberant Ctags} (http://ctags.sourceforge.net).
+@item Create a project (Project | Open). @x{Open (Project)}.
+@item Add all the files you want to include to the project. You can import
+the list of files from a text file. @x{Import project items}.
+@item Enable automatic tag generation using a central file (Tool&Ops |
+Options | Tag files | Options). @x{Tag files options}.
+@item Perform a search, the tags file will be generated during this process
+so be patient if your system is slow or your project is huge.
+@end enumerate
+
+@section What can I do with tags?
+
+With the tag files you can:
+@p{}
+
+@enumerate
+@item Jump to any defined symbol. @x{Jump to symbol}.
+@item Browse C++ class hierarchy. @x{Class browser}.
+@item Ask the editor to complete a partially typed symbol. @x{Word completion}.
+@end enumerate
+
+@section Technical details about tags
+
+The editor loads the tags to memory to allow fast searches. For this reason
+you must be aware that they consume lots of memory. In some tests I did using
+GNU/Linux I found the amount needed to load a tags file is close to the size
+of the file on disk. For this reason I recommend to avoid generating symbols
+for files you don't need.
+@p{}
+
+The time to parse and load tag files can be annoying on slow systems. For
+this reason the editor never loads the tag files until they are really
+needed. That's why you'll notice a delay for the first search, because the
+files are loaded at this time and not when the editor is started.
+@p{}
+
+Tag files don't catch all definitions, they aren't perfect, so please read
+the man pages. They also lack some important information, like what type
+a variable (int, float, @il{etc.}) is.
+@p{}
+
+@chapter Debugging
+
+Important! 2004/08/17 version 0.5.4: Currently this chapter is incomplete and
+the debugging features of the editor are considered unstable.
+@p{}
+
+Only C and C++ programs can be debugged. If you use another language supported
+by gdb and want to help supporting it please contact me. Languages not
+supported by gdb needs more work to get supported, even if the debugger used
+for them is similar to gdb.
+@p{}
+
+@section Supported platforms for debugging
+@cindex debugging, platforms supported
+
+Currently only Linux for IA32 (x86) CPUs is fully supported. Support for
+other OSs where gdb (The GNU debuger) is available and that provides a
+complete POSIX interface should be easy to obtain. If you want to help
+adding support for your platform please contact the author.
+@x{How to contact me}.
+@p{}
+
+Architectures other than IA32 are partially supported. If that's your case
+you can help testing and providing information about it. The two most
+important things you can help to fix are: the stack window and the syntax
+highlight of the disassembler window. You just need to know a little bit
+about the native assembler.
+@p{}
+
+DOS and any other target where the fork/exec mechanism and pipes
+communication isn't implemented aren't supported. To support them I need a
+lot of help. In particular I need to make some code to handle the gdb/MI
+protocol using libgdb.a. If you think you can help with it contact me.
+@p{}
+
+The support for Linux is for X and for the real console. You can't debug
+programs if you don't have access to the real console of the local machine.
+@p{}
+
+Only programs that can be debugged by gdb can be debugged using the editor.
+@p{}
+
+@section Mechanism used to debug
+@cindex debugging, mechanism used
+
+The editor doesn't include a built-in debugger like RHIDE does. Instead you
+have to install the GNU Debuger (gdb). Only versions of gdb that implements
+the MI protocol are usable. The version 5 implements MI version 1 and the
+version 6 implements MI version 2.
+@p{}
+
+To debug the editor starts gdb and communicates with the debugger using a
+POSIX mechanism called pipe. It means the editor can just send commands
+to gdb like you could do manually. The consequence is that you all the
+power of gdb, but also all the problems and bugs found in gdb. During the
+development of the debug features I found more than two bugs in gdb each
+week.
+@p{}
+
+The editor uses a special mode of gdb called MI. MI stands for Machine
+Interface. In this mode the gdb responses are specially designed to be parsed
+by another program instead of read by a human bean. This makes the
+communication much more robust but this mode is less tested than the usual
+mode (CLI Command Line Interface).
+@p{}
+
+The MI mode allows to send CLI commands to gdb. So you can send your own
+commands to gdb. This should be used only if the editor doesn't provide any
+way to achieve the same result. If you need to do it very often please
+consider commenting it in the editor's mailing list. We could add the proper
+user interface for what you need. @x{Debug Messages Window}.
+@p{}
+
+@section Quick start to debugging
+@cindex debugging, quick start
+
+The following is a very short explanation of how to start debugging your
+program. It assumes you already know what's a debugger and you are
+familiarized with the user interface. The user interface is quite similar to
+the RHIDE's user interface and that's almost the same used by Borland
+debuggers.
+@p{}
+
+@enumerate
+@item Create a new project. All the debugging options will be stored in the
+project file. @x{Open (Project)}.
+@item Add your source files to the project. You can do it pressing the
+@kbd{Insert} key when the project window is selected or importing a list of
+files. @x{Import project items}.
+@item Compile your program with debug information. For @code{gcc} you should
+use the @code{-g} command line option and avoid using the @code{-s} option.
+You'll get better integration if you compile your program using the internal
+features of the editor to run external programs. @x{Run program (which one)}.
+@item Select the @il{Debug|Step over} menu option. If you didn't set the
+debug options the editor will ask to do it. The most important option is the
+name of the program you want to debug.
+@item If the editor can't find the source file you'll be asked to indicate
+its location.
+@item If all goes as spected you'll see your source file and the first line
+of the main function highlighted. You are debugging your program. Now you'll
+want to consult the sections about breakpoints, stepping in your code and
+displaying data.
+@end enumerate
+
+@section Supported debug targets
+@cindex debugging, supported targets
+
+Currently you can especify the following targets:
+@p{}
+
+@itemize @bullet
+@item Local executables. That's the most common case where you debug a
+program you compiled locally.
+@item Remote debugging. In this case you debug a program that runs on another
+machine connected through a serial communication or network.
+@item Already running processes. You can also debug a process that's
+currently running in your local machine.
+@end itemize
+
+Other gdb targets aren't supported.
+@p{}
+
+In all the cases you should have a local copy of the program with debug
+information. When you debug a remote program the remote copy doesn't have to
+include debug information.
+@p{}
+
+@section Available debug options
+
+You can configure the following debug options. Remmember that most of them
+are stored in project files.
+@p{}
+
+@subsection Debug options
+
+This dialog is obtained using the @il{Debug|Options|Program and mode...} menu
+entry.
+@p{}
+
+Here you setup the most relevant debug options. These options are stored in
+project files. For this reason you should use a project if you want to avoid
+setting these options again. The available options are:
+@p{}
+
+@itemize @bullet
+@item Program to debug: Indicates the local copy of the program to debug.
+This copy must be compiled with debug information and the debug information
+must be preserved during the linking stage. Using the @il{Browse} button you
+can choose a file using a dialog to navigate your filesystem.
+@item Mode: It selects the kind of target you will debug.
+@x{Supported debug targets}.
+@item Program arguments: The command line options for the program you want to
+debug. This option is used only for local targets.
+@item Forced terminal: When the editor debugs your program the input and
+output of the program are redirected to a different terminal. This mechanism
+avoids interferences between the editor and the program you want to debug.
+The terminal is selected or created automatically. If you need to force a
+particular terminal fill this option. Otherwise leave it blank.
+@item Remote protocol type: This option is used for remote targets. Here you
+must specify one of the protocols supported by gdb. The most common protocol
+is @il{extended-remote}.
+@item Remote location: Also used for remote debugging. Here you indicate the
+location of the remote machine or the serial device. For TCP/IP you must
+specify the host and the port number using @il{host:port}. For serial links
+you must specify the serial device. Consult gdb documentation for details.
+@end itemize
+
+@refMenu1{cmeDebugOptions}
+
+@subsection Path for sources
+@cindex debugging, path for sources
+
+This dialog is obtained using the @il{Debug|Options|Path for sources...} menu
+entry.
+@p{}
+
+The most common way to compile your program is by indicating the relative
+path for the source file. When you debug your program you can do it from any
+directory. For this reason gdb can have problems to find the source files.
+The editor will analyze your project and extract paths from it. Additionally
+the editor will use the path for the executable as reference. The resulting
+list is passed to gdb. But sometimes it isn't enough and you must indicate
+the location for the files manually.
+@p{}
+
+The easiest way to add a directory is using the @il{Browse} button. It will
+bring a tree view of your filesystem. This dialog supports incremental
+search.
+@p{}
+
+When gdb reports a source file the editor uses this list to find the exact
+location of the file. If the file couldn't be found the editor will ask you
+to select the file using a dialog like the one used to open files. For this
+reason you usually don't need to add the directories manually. The exception
+is when you need to set a breakpoint and you get an error from gdb indicating
+the file couldn't be found. In this case the best recommendation is to add
+the file to the project, but you can add the directory here.
+@p{}
+
+@refMenu1{cmeSourceList}
+
+@subsection Messages displayed
+@cindex debugging, messages from gdb
+
+This dialog is obtained using the @il{Debug|Options|Messages displayed...}
+menu entry.
+@p{}
+
+This dialog controls which messages will be displayed in the Debugger Window.
+@x{Debug Messages Window}. You can filter the following kind of messages:
+@p{}
+
+@itemize @bullet
+@item GDB console (CLI): Messages sent to the console. Usually they are human
+readable messages generated by gdb in response to console commands.
+@item Target: The output of the target. This kind of messages are specified
+by gdb documentation but never generated. They are supposed to contain the
+tunneled output of your program.
+@item Log: Messages sent to the gdb log. Usually they contain technical
+information about gdb details.
+@item GDB/MI commands sent to gdb: Machine Interface commands sent by the
+editor to gdb.
+@item GDB/MI responses from gdb: Machine Interface responses from gdb.
+@end itemize
+
+Usually you'll be interested only in the console and log messages. The target
+messages aren't really implemented in gdb and the MI messages are only useful
+to control if the editor is sending the proper information and gdb replying
+to it.
+@p{}
+
+@refMenu1{cmeDbgOptsMsgs}
+
+@subsection Advanced debug options
+@cindex debugger, advanced options
+@cindex debugger, selecting it
+
+This dialog is obtained using the @il{Debug|Options|Advanced...} menu
+entry.
+@p{}
+
+The options contained in this dialog are used to fine tune the debug session.
+Some of these options are dangerous and can produce problems if you don't set
+them properly.
+@p{}
+
+@itemize @bullet
+@item GDB executable: The binary executed as debugger. Use the browse button
+to select it. If you leave it blank the editor will choose the first binary
+called gdb found in your path.
+@item X terminal executable: The binary used to create a terminal for the
+program to debug when the editor is connected to an X server.
+@item Main function: The name of the first function executed in your program.
+For C and C++ programs that's usually @code{main}. Sometimes the name is
+different. One example is the Allegro library where @code{main} is replaced by
+@code{__mangled_main}.
+@item GDB Time out [s]: The ammount of seconds to wait for a gdb response.
+After this time the editor will ask if you want to wait more time or assume
+the response will never arrive. You can't indicate less than two seconds.
+@item Max. lines in Debug window: Maximum lines to hold in the Debugger
+Window. When this value is reached the older lines are discarded. You can't
+indicate less than 100 lines.
+@item No gdb banner after connecting: Suppress the gdb banner printed in the
+Debugger Window when we start gdb. @x{Debug Messages Window}.
+@item Enable MI v2 features: Enable a few features only available in gdb MI
+version 2. Currently the editor can't determine the exact version implemented
+in gdb so you must indicate it. Versions newer than 6.0 seems to implement MI
+version 2. But cvs snapshots of gdb doesn't report a useful version.
+@item No symbols bug workaround: Actually the editor implements a workaround
+for a bug in gdb when searching for file names in the table of debug symbols.
+This workaround produces a slower start-up. This bug seems to affect versions
+from 5.3 to 6.2 (inclusive).
+@item No source code in disasm. window: Disables the use of mixed source code
+and assembler in the disassembler window. This is faster.
+@end itemize
+
+All the above options are stored globally and affects all projects. The only
+exception is the name of the main function which is stored in the project
+file.
+@p{}
+
+@refMenu1{cmeDbgOptionsAdv}
+
+@section Debugging states
+@cindex state, debug
+
+Not all operations can be performed at any time. GDB must be running in order
+to run the program and the program running in order to stop it. For this
+reason the editor keeps track of gdb state. The current state is displayed in
+the Debugger Window. @x{Debug Messages Window}.The following states are defined:
+@p{}
+
+@itemize @bullet
+@item Disconnected: gdb isn't running.
+@item Connected: gdb is running but no target was selected.
+@item Ready to Run: gdb is running and we selected a target.
+@item Running: owr program is running. Note that currently gdb doesn't
+implement full asynchronous operation. It means that you can't send commands
+to gdb while the state is @il{running}. GDB won't be able to reply commands
+in this state.
+@item Stopped: the program was stopped and can resume its execution.
+@end itemize
+
+Some menu options can be used to force a particular state. So you can
+directly jump to @il{connected} or @il{ready to run} states from the
+@il{disconnected} state. This is useful if you want to send commands to gdb
+that only works in these states. @x{Debug Messages Window}.
+@p{}
+
+When you specify an action that is invalid for the current state the editor
+will try to reach the proper state. As an example, if you use the @il{Step
+over} option when you are in @il{disconnected} state the editor will first
+try to start gdb and go to @il{connected}, then will try to specify the
+target and go to @il{ready to run} and finally will emulate the step action
+by using a temporal breakpoint on the main function.
+@p{}
+
+The menu entry called @il{Debug|Debug session|Close} is used to go to the
+@il{disconnected} state from any of the other states.
+@p{}
+
+The menu entry called @il{Debug|Stop} is used to go to the @il{stopped} state
+from the @il{running} state. And the @il{Debug|Kill} option is used to go to
+the @il{ready to run} state from the @il{stopped} or @il{running} states.
+@p{}
+
+@subsection Going to the connected debug state
+
+This operation is obtained using the @il{Debug|Go to state|Connected} menu
+entry.
+@p{}
+
+With this function the editor will try to reach the @il{Connected} debugging
+state. @x{Debugging states}.
+@p{}
+
+It can be used when the debugger isn't running and you want to start it
+without specifying the target to debug. In this way you can send commands to
+gdb that are useful only before you specify the target.
+@p{}
+
+@refMenu1{cmeDbgGoConnected}
+
+@subsection Going to the ready to run debug state
+
+This operation is obtained using the @il{Debug|Go to state|Ready to run} menu
+entry.
+@p{}
+
+With this function the editor will try to reach the @il{Ready to run} debugging
+state. @x{Debugging states}.
+@p{}
+
+This operation will try to reach the @il{Connected} state first.
+@x{Going to the connected debug state}. If this is achieved then the editor
+will indicate to gdb which target do you want to debug. For local debugging
+the program won't be started so you can send to gdb commands that apply only
+before starting the program to debug.
+@p{}
+
+@refMenu1{cmeDbgGoReadyToRun}
+
+@section Running the program to debug
+@cindex debug, run
+
+This operation is obtained using the @il{Debug|Run/Continue/Atach} menu entry.
+@p{}
+
+You must first configure the name of the program you want to debug. If you
+don't do it the editor will ask if you want to do it. @x{Debug options}.
+@p{}
+
+Once your program is running you can stop it using the @il{Debug|Stop}
+option. But usually is better to use breakpoints and watchpoints instead.
+@p{}
+
+While the program is running you can't consult the value of variables.
+That's because gdb gets blocked until your program is stopped.
+@x{Debugging states}.
+@p{}
+
+This command have other uses. If your program is already stopped it resumes
+its execution. @x{Continue execution}. If you are debugging a program that is
+already running this command will atach to the running process and stop the
+execution.
+@p{}
+
+@refMenu{cmeDbgRunContinue,Shift+F9}
+
+@section Stopping the program you are debugging
+@cindex debug, stop
+
+Once your program is running you can stop it using the @il{Debug|Stop}
+option. But usually is better to use breakpoints and watchpoints instead.
+@p{}
+
+Using breakpoints you can stop the execution at a desired point of your
+program. Using watchpoints you can stop the execution when some data value
+changes or is accessed. Note that gdb watchpoints aren't fully reliable.
+@p{}
+
+@refMenu1{cmeDbgStop}
+
+@subsection Breakpoints
+@cindex debug, breakpoints
+
+Breakpoints are stop points in your program. The easiest way to create a
+breakpoint is by using the @il{Debug|Breakpoint} menu option. This will
+create a breakpoint at the current file and line. To remove it just use the
+same menu option. Breakpoint lines are highlighted. The default color is red.
+@x{Customize Colors}.
+@p{}
+
+Note that gdb accepts breakpoints even for source lines that didn't generate
+code. In this case gdb will stop the execution when the nearest source line
+is reached.
+@p{}
+
+When you edit your program breakpoints are automatically moved. If you use
+the editor options to call an external program in order to recompile your
+program the editor will inform gdb the new place for the breakpoints.
+@p{}
+
+To create more complex breakpoints you have to use the
+@il{Debug|Edit breakpoints...} menu option. @x{Advanced breakpoint options}.
+@p{}
+
+@refMenu{cmeBreakpoint,Ctrl+F8}
+
+@subsection Advanced breakpoint options
+@cindex debug, breakpoints advanced
+@cindex Edit breakpoints
+
+This dialog is obtained using the @il{Debug|Edit breakpoints...} menu entry.
+Using this dialog you can:
+@p{}
+
+@itemize @bullet
+@item Modify existing breakpoints. Modify button.
+@item Add new breakpoints. New button.
+@item Remove breakpoints. Delete button.
+@item Enable or disable a breakpoint. Enable and Disable buttons. Note that
+currently this is not the same concept implemented in gdb. I.e. we remove the
+breakpoint from gdb but not from the editor list.
+@item Jump to the source file where the breakpoint is located. Show button.
+@end itemize
+
+The list of breakpoints contains the following information:
+@p{}
+
+@itemize @bullet
+@item E: an asterisk if enabled.
+@item Where: breakpoint location.
+@item Condition: the additional condition for conditional breakpoints.
+@item Count: the number of times this breakpoint will be ignored when
+enabled.
+@item Thre.: the thread affected by this breakpoint. All threads are
+affected by default.
+@end itemize
+
+When you add or modify a breakpoint a dialog offering the following options
+is used:
+@p{}
+
+@itemize @bullet
+@item Type: This is the kind of specification for the breakpoint location.
+GDB supports four ways to specify a breakpoint combining the source file
+name, the line, function and code address.
+@item Condition: If this field contains a condition the breakpoint will stop
+the program execution when the location is reached and the condition is
+satisfied.
+@item Count: When this value is specified the breakpoint will be ignored this
+ammount of times. Note that gdb keeps a counter that is reset every time you
+set the breakpoint. When the program is started the editor will force a
+refresh on this value. That isn't the normal gdb behavior. It means that a
+count of five will make the breakpoint to be ignored the first five times it
+was reached after starting your program.
+@item Thread: You can specify a thread id here.
+@item Enabled: Indicates if the breakpoint is enabled.
+@item Hardware assisted: When you are debugging code that is located in a
+read only memory space you have to use hardware assisted breakpoints. Read
+the gdb documentation for more information.
+@end itemize
+
+When a breakpoint fails to apply the editor will disable it to avoid farther
+gdb errors.
+@p{}
+
+@refMenu1{cmeDbgEditBreakPts}
+
+@subsection Watchpoints
+@cindex debug, watchpoints
+@cindex data breakpoints
+
+This dialog is obtained using the @il{Debug|Edit watchpoints...} menu entry.
+@p{}
+
+Unlike breakpoints the watchpoints are data related. Some people calls them
+@il{data breakpoints}. Watchpoints can stop the execution when a data value
+is:
+@p{}
+
+@itemize @bullet
+@item Written
+@item Read
+@item Accessed (Written or Read)
+@end itemize
+
+Note that in order to get usable results this needs hardware assistance. It
+means that not all platforms supports it. Additionally the number of
+watchpoints is limited and gdb imposes more restrictions to what can be used
+as a watchpoint. In some cases gdb tries to emulate it using software and the
+result can be really bad. During development I found a case where gdb did it
+and as a result it eated all the CPU time and was really hard to stop.
+@p{}
+
+Using this dialog you can:
+@p{}
+
+@itemize @bullet
+@item Modify existing watchpoints. Modify button.
+@item Add new watchpoints. New button.
+@item Remove watchpoints. Delete button.
+@item Enable or disable a watchpoint. Enable and Disable buttons.
+@end itemize
+
+The list of watchpoints contains the following information:
+@p{}
+
+@itemize @bullet
+@item E: an asterisk if enabled.
+@item R/W: type of watchpoint (Read, Write or Read+Write)
+@item Expression: The expression to monitor.
+@end itemize
+
+When you add or modify a watchpoint a dialog offering the following options
+is used:
+@p{}
+
+@itemize @bullet
+@item Expression: the expression that will be monitored.
+@item Type: the action that will stop the execution.
+@item Enabled: indicates if the watchpoint is enabled.
+@end itemize
+
+@refMenu1{cmeDbgEditWatchPts}
+
+@section Examining data
+@cindex debug, examining data
+
+There are many tools to examine data values of the program you are debugging.
+You can:
+@p{}
+
+@itemize @bullet
+@item Evaluate an expression to know the resulting value.
+@x{Evaluate or Modify expression}.
+@item Monitor a simple value as the program flows. @x{Watch an expression}.
+@item Monitor an expression with scope. @x{Watch an expression with scope}.
+@item Monitor a complex data structure. @x{Inspectors}.
+@item Examine the memory space. @x{Data Window}.
+@item Examine the stack. @x{Stack window}.
+@end itemize
+
+@subsection Evaluate or Modify expression
+@cindex debug, evaluate expression
+@cindex debug, modify expression
+
+This dialog is obtained using the @il{Debug|Evaluate/Modify...} menu entry.
+@p{}
+
+The first input line is used to enter the expression you want to evaluate.
+The result is obtained using the @il{Evaluate} button. That's the default
+button so you can just press @kbd{Enter}. The resulting value is displayed in
+the @il{Result} input line.
+@p{}
+
+To assign a different value to the expression you must use the @il{New value}
+input line and press the @il{Change} button. Note that the value used in
+@il{Expression} must be expressed in a way that can be used for an
+assignment (@il{Expression} = @il{New Value}).
+@p{}
+
+The @il{Copy} button will copy the @il{Result} value to the editor's
+clipboard. The @il{Paste} value will paste from the editor's clipboard to the
+@il{Expression} input line.
+@p{}
+
+Using the @il{Inspect} button you can create an Inspector Window based on the
+@il{Expression}. @x{Inspectors}.
+@p{}
+
+This dialog is modal and is used to evaluate a value just once. To see how a
+value changes as yourt program flows use watches or inspectors.
+@p{}
+
+@refMenu{cmeDbgEvalModify,Ctrl+F4}
+
+@subsection Watch an expression
+@cindex watches
+@cindex debug, monitor expression
+
+This functionality is obtained using the @il{Debug|Watch an expression|Normal
+watch} menu entry.
+@p{}
+
+Using this option you can add an expression to the Watches Window. This
+expression will be evaluated every time the program stops and the result will
+be updated in the Watches Window.
+@p{}
+
+Adding too much watches could slow down the debug process. Also note that the
+expression will be evaluated in the current scope. If you need to monitor an
+expression in a fixed scope use a watch with scope.
+@x{Watch an expression with scope}. For complex data structures you'll get
+better results using Inspectors. @x{Inspectors}.
+@p{}
+
+@refMenu{cmeDbgWatchExpNorm,Ctrl+F7}
+
+@subsection Watch an expression with scope
+@cindex watches w/scope
+
+This functionality is obtained using the @il{Debug|Watch an expression|With
+scope} menu entry.
+@p{}
+
+Using this option you can add an expression to the Watches Window. This
+expression will be evaluated every time the program stops and the result will
+be updated in the Watches Window.
+@p{}
+
+Adding too much watches could slow down the debug process. These watches are
+implemented using a gdb mechanism that is faster when only a few expressions
+changes in each execution.
+@p{}
+
+Unlike normal watches the scope of the expression is fixed. It means you'll
+be monitoring the same value all the time and not different variables. Also
+note that when their scope is finished they are deleted from the list.
+@p{}
+
+For complex data structures you'll get better results using Inspectors.
+@x{Inspectors}.
+@p{}
+
+@refMenu1{cmeDbgWatchExpScp}
+
+@subsection Inspectors
+@cindex debug, inspectors
+@cindex debug, structures
+
+This functionality is obtained using the @il{Debug|Watch an expression|Using
+the Inspector} menu entry.
+@p{}
+
+Inspectors are used to monitor complex data structures as the program flows
+or just navigate them to verify them. I.e. you can navigate a linked list using
+an inspector.
+@p{}
+
+Unlike watches each expression you evaluate have its own window. You can have
+as many inspector windows as you like. The windows are resizable and have
+scroll bars.
+@p{}
+
+The representation of the data inside an inspector is a tree. You can expand
+or collapse the branches using the @kbd{E} and @kbd{C} keys. On most systems
+you can also use the @kbd{+} and @kbd{-} keys. If a line begins with a @il{+}
+it means that you can expand the tree from this point. If it starts with a
+@il{-} you can collapse it. After the name of the data member you'll find its
+data type enclosed in brackets. At the end of the line the value of the data
+member is displayed.
+@p{}
+
+Some lines will look a like this: @il{varXX.public}. That's just the way gdb
+indicates the accesibility of the members. The @il{varXX} part is the name
+of the internal gdb value. You don't have to worry about this name.
+@p{}
+
+When you select a line containing some data type that looks like a pointer
+the @il{Inspect} option of the status bar will be enabled. Using it you'll
+get a new inspector for the data pointed by the selected pointer. The
+@kbd{Enter} key can be used for this.
+@p{}
+
+When the line contains a data value that can be modified the @il{Modify}
+option of the status bar will be enabled. The @kbd{Ctrl}+@kbd{M} key can
+be used to modify the selected value.
+@p{}
+
+You can also use the @il{Format} option (key @kbd{Ctrl}+@kbd{F}) to change
+the format used to represent the selected member.
+@p{}
+
+Inspectors are evaluated in the scope they were created. When its scope is
+finished they stop working. If you enter to the same scope, or another where
+the expression is valid, you can use the @il{Recycle} option. The keyboard
+shortcut for it is @kbd{Ctrl}+@kbd{R}.
+@p{}
+
+@refMenu{cmeDbgInspector,Ctrl+F6}
+
+@subsection Data Window
+
+This functionality is obtained using the @il{Debug|Watch an expression|Data
+window} menu entry.
+@p{}
+
+The Data Window can be used to examine and/or modify the memory. Its
+functionality can be compared with an hexadecimal editor. The number of
+operations and options related to the Data Window are really big. For this
+reason the Data Window have its own menu. When you select a Data Window the
+menu will change to show the Data Window commands.
+@p{}
+
+The original code for the Data Window was contributed by Molnar Laszlo. He
+designed it for RHIDE, but RHIDE doesn't document all the available
+functionality of the Data Window.
+@p{}
+
+When you modify the memory in the Data Window the changes aren't reflected to
+the real memory space. In order to reflect the changes you must use the
+@kbd{Enter} key or the @il{Various|Update memory} menu option. Every time the
+program stops the content of the Data Window is updated and the changes
+highlighted. You can force the editor to recompute the original expression
+used to get the memory address used in the Data Window in each update. To
+achieve it use the @il{Mode|Toggle auto follow} menu option.
+@p{}
+
+The following is a description of the special menu used for the Data Window.
+Only the commands related to the Data Window are explained.
+@p{}
+
+@refMenu1{cmeDbgDataWindow}
+
+@subsubsection File - Read block (DW)
+
+Used to read data from a file and store it in the memory space of the program
+you are debugging. You have to choose a file and then indicate the
+destination address and the maximum ammounts of bytes to read from the file.
+@p{}
+
+Some general limits and functionality common to the Data Window operations
+applies. @x{Data Window Limitations and Details}.
+@p{}
+
+@refMenu{cmDWRead,Ctrl+R}
+
+@subsubsection File - Write block (DW)
+
+Used to write data from the memory space of the program you are debugging to
+a file. You have to indicate the source address and the how much data to
+write and then choose a file name.
+@p{}
+
+Some general limits and functionality common to the Data Window operations
+applies. @x{Data Window Limitations and Details}.
+@p{}
+
+@refMenu{cmDWWrite,Ctrl+W}
+
+@subsubsection Move - Up (DW)
+
+Moves the cursor position one row up. If the cursor is at the top row the
+starting address will be decremented by the bytes contained in a row and the
+whole block will be fetched.
+@p{}
+
+Changes not tranferred to the target will be lost if a new block of data is
+fetched.
+@p{}
+
+@refMenu{cmDWUp,Cursor up}
+
+@subsubsection Move - Down (DW)
+
+Moves the cursor position one row down. If the cursor is at the bottom row the
+starting address will be incremented by the bytes contained in a row and the
+whole block will be fetched.
+@p{}
+
+Changes not tranferred to the target will be lost if a new block of data is
+fetched.
+@p{}
+
+@refMenu{cmDWDown,Cursor down}
+
+@subsubsection Move - Right (DW)
+
+Moves the cursor to the right. If the cursor is in the rightmost column it
+will remain there.
+@p{}
+
+@refMenu{cmDWRight,->}
+
+@subsubsection Move - Left (DW)
+
+Moves the cursor to the left. If the cursor is in the leftmost column it
+will remain there.
+@p{}
+
+@refMenu{cmDWLeft,<-}
+
+@subsubsection Move - Page down (DW)
+
+Increments the starting memory address by the number of bytes contained in a
+row multiplied by the number of rows.
+@p{}
+
+Changes not tranferred to the target will be lost.
+@p{}
+
+@refMenu{cmDWPgDn,Page Down}
+
+@subsubsection Move - Page up (DW)
+
+Decrements the starting memory address by the number of bytes contained in a
+row multiplied by the number of rows.
+@p{}
+
+Changes not tranferred to the target will be lost.
+@p{}
+
+@refMenu{cmDWPgUp,Page Up}
+
+@subsubsection Move - First column (DW)
+
+Moves the cursor to the leftmost column.
+@p{}
+
+@refMenu{cmDWFirstColumn,Home}
+
+@subsubsection Move - Last column (DW)
+
+Moves the cursor to the rightmost column.
+@p{}
+
+@refMenu{cmDWLastColumn,End}
+
+@subsubsection Move - First row (DW)
+
+Moves the cursor to the first row in the same column.
+@p{}
+
+@refMenu{cmDWFirstRow,Ctrl+Home}
+
+@subsubsection Move - Last row (DW)
+
+Moves the cursor to the last row in the same column.
+@p{}
+
+@refMenu{cmDWLastRow,Ctrl+End}
+
+@subsubsection Move - First addr increment (DW)
+
+Increments the starting memory address by one.
+@p{}
+
+Changes not tranferred to the target will be lost.
+@p{}
+
+@refMenu{cmDWBaseIncrement,Ctrl+->}
+
+@subsubsection Move - First addr decrement (DW)
+
+Decrements the starting memory address by one.
+@p{}
+
+Changes not tranferred to the target will be lost.
+@p{}
+
+@refMenu{cmDWBaseDecrement,Ctrl+<-}
+
+@subsubsection Address - Change base address (DW)
+
+When you open a new Data Window the addresses displayed are the same used by
+the program you are debugging. If you need to convert them into relative you
+can change the base address. When you specify a new base address it is used
+as reference.
+@p{}
+
+@refMenu{cmDWBaseAddress,Ctrl+B}
+
+@subsubsection Address - Go to new address (DW)
+
+Used to change the expression used to determine the starting address of the
+Data Window. The address corresponding to this expression is always
+highlighted used a different color.
+@p{}
+
+@refMenu{cmDWGotoAddress,Ctrl+G}
+
+@subsubsection Address - Follow pointer (DW)
+
+Interprets the memory at the cursor position as a pointer to another block of
+memory. This pointer is used as the new expression for the Data Window.
+@p{}
+
+@refMenu{cmDWFollowPointer,Ctrl+F}
+
+@subsubsection Address - Follow pointer in new window (DW)
+
+Interprets the memory at the cursor position as a pointer to another block of
+memory. This pointer is used as the expression for a new Data Window. The
+extra asterisk is to cancel an @code{&} added by the editor.
+@p{}
+
+@refMenu{cmDWFollowPtnNew,Ctrl+O}
+
+@subsubsection Address - Recompute address (DW)
+
+Evaluates the original expression to determine the new starting address. You
+can do it automatically every time the program stops using the auto follow
+mode. @x{Mode - Toggle auto follow (DW)}.
+@p{}
+
+@refMenu{cmDWRecompute,Ctrl+H}
+
+@subsubsection Mode - Toggle auto follow (DW)
+
+Toggles the auto follow mode. When the auto follow mode is enabled the
+expression supplied to determine the memory displayed by the Data Window is
+automatically recomputed every time the program stops.
+@p{}
+
+The auto follow mode is indicated with an @il{A} in the indicator widget
+located at the bottom right of the Data Window.
+@p{}
+
+@refMenu{cmDWTogAutoF,Ctrl+A}
+
+@subsubsection Mode - Change display mode (DW)
+
+Changes the display mode to the next in the list of available modes. The
+available modes are:
+@p{}
+
+@itemize @bullet
+@item Bytes: each cell represents one byte in memory. The right side of the
+window contains its ASCII representations. Note that ASCII representation is
+suppressed when you select decimal radix.
+@item Word: each cell represents two bytes.
+@item Double Word: each cell represents four bytes.
+@item ASCII: Only the ASCII representation is displayed. In this mode you can
+simply type characters to change the memory.
+@end itemize
+
+@refMenu{cmDWDispMode,Ctrl+D}
+
+@subsubsection Mode - Toggle endian mode (DW)
+
+Toggles the endian mode. When a new Data Window is created the data is
+displayed using the endian type of the program you are debugging. You can
+change the endian mode at any time.
+@p{}
+
+Little endian mode is indicated in the indicator widget located at the
+bottom right of the Data Window using an @il{e} and big endian using @il{E}.
+@p{}
+
+@refMenu{cmDWTogEndian,Ctrl+E}
+
+@subsubsection Mode - Change radix (DW)
+
+Changes the radix of the represented numbers. The available radices are
+hexadecimal and decimal.
+@p{}
+
+Hexadecimal radix is indicated in the indicator widget located at the
+bottom right of the Data Window using an @il{X} and decimal using @il{D}.
+@p{}
+
+@refMenu{cmDWRadix,Ctrl+X}
+
+@subsubsection Block - Fill (DW)
+
+Fills a memory block with an indicated data value. You have to indicate the
+destination address, how many bytes will be filled and the value used to fill
+the block.
+@p{}
+
+Some general limits and functionality common to the Data Window operations
+applies. @x{Data Window Limitations and Details}.
+@p{}
+
+@refMenu{cmDWFill,Ctrl+I}
+
+@subsubsection Block - Clear (DW)
+
+Fills a memory block with zeroes. You have to indicate the destination
+address and how many bytes will be filled.
+@p{}
+
+Some general limits and functionality common to the Data Window operations
+applies. @x{Data Window Limitations and Details}.
+@p{}
+
+@refMenu{cmDWClear,Ctrl+L}
+
+@subsubsection Block - Move (DW)
+
+Copies a block of memory to another memory location. You have to indicate the
+source address, the destination address and how many data will be copied.
+@p{}
+
+Some general limits and functionality common to the Data Window operations
+applies. @x{Data Window Limitations and Details}.
+@p{}
+
+@refMenu{cmDWMove,Ctrl+M}
+
+@subsubsection Various - Less bytes per line (DW)
+
+Decrements the ammount of data cells displayed in each row.
+@p{}
+
+Changes not tranferred to the target will be lost.
+@p{}
+
+@refMenu{cmDWLessLines,-}
+
+@subsubsection Various - More bytes per line (DW)
+
+Increments the ammount of data cells displayed in each row.
+@p{}
+
+Changes not tranferred to the target will be lost.
+@p{}
+
+@refMenu{cmDWMoreLines,+}
+
+@subsubsection Various - Update memory (DW)
+
+Transfers changes to the memory space of the program you are debugging.
+@p{}
+
+@refMenu{cmDWUpdateMemory,Enter}
+
+@subsubsection Data Window Limitations and Details
+
+Most Data Window operations uses a common dialog that adapts its fields to
+the operation you want to perform. For this reason the operations shares the
+same functionality and limitations.
+@p{}
+
+All the fields (New Value, From, To, Expression, Length and Value) accepts
+any kind of expression supported by gdb. You can include arithmetic
+operations, variables, @il{etc.}
+@p{}
+
+The Length and Value fields are evaluated as an unsigned value. The other
+values are evaluated as addresses. In the last case the editor tries to
+determine if you typed an address (something starting with a digit), an
+explicit reference (@code{&} C/C++ operator) or a CPU register (they start
+with @code{$} in gdb). If the editor thinks you didn't specify an address the
+@code{&} operator will be automatically added. If you have a local variable
+called @il{var} and you specify it then the editor will use @il{&var}.
+@p{}
+
+In most cases the transferring big memory blocks between the target program
+and the editor is an slow process. For this reason the editor will show a
+warning if the size of the block is bigger than 128 KB and will refuse to
+operate with more than 1 MB. This is also a security meassurement. If you
+think this is a wrong idea please tell me.
+@p{}
+
+@subsection Stack window
+
+The stack window is a specialized version of the Data Window. It starts using
+the @code{esp} register as starting address, one cell in each line, four
+bytes cells and auto follow mode enabled. @x{Data Window}.
+@p{}
+
+Currently this is implemented only for the IA32 architecture. If you know the
+name of the stack pointer register for your architecture please contact me so
+I can add support for it. Also note that this window uses the @code{esp}
+register and not the stack frame register (@code{ebp}). I don't know if users
+will be interested on having a similar window for the stack frame.
+@p{}
+
+@refMenu1{cmeDbgStackWindow}
+
+@section Resuming the execution of the program
+
+Once you stopped the execution of your program and you examined its data
+you'll most probably want to resume its execution. This section describes
+various operations to do it controlling how much code will be executed.
+@p{}
+
+You can resume execution until a breakpoint, watchpoint or the end of program
+is reached. @x{Continue execution}.
+@p{}
+
+You can execute until the next line of code is reached. You can achieve it
+using two different commands. The first won't stop inside a function called
+during by the execution (@xp{Step over}) and the second will do it
+(@xp{Trace into}).
+@p{}
+
+You can also execute until a line of code is reached.
+@x{Executing until cursor position is reached}.
+@p{}
+
+Another option is to run the code until the current function is finished.
+@x{Executing until return}. It's also possible to return immediatly without
+executing the rest of the function. @x{Returning immediatly}.
+@p{}
+
+@subsection Continue execution
+
+When the program is stopped the menu entry named
+@il{Debug|Run/Continue/Atach} can be used to resume the execution.
+@p{}
+
+If the program isn't started this command is used to start the execution
+(Run) or atach to an already running process (Atach).
+@p{}
+
+@refMenu{cmeDbgRunContinue,Shift+F9}
+
+@subsection Step over
+
+This functionality is obtained using the @il{Debug|Step over} menu entry.
+@p{}
+
+This command resumes the execution of a stopped program until the next line
+of code is reached. Function calls that appear within the line of code are
+executed without stopping.
+@p{}
+
+When applied to the Assembler Window it works at instruction level.
+@p{}
+
+@refMenu{cmeDbgStepOver,F8}
+
+@subsection Trace into
+
+This functionality is obtained using the @il{Debug|Trace into} menu entry.
+@p{}
+
+Continue running your program until control reaches a different source line,
+then stops it. If a function call is found this command will enter the
+function unless it doesn't have debug information.
+@p{}
+
+When applied to the Assembler Window it works at instruction level and no
+debug information is needed to enter functio calls.
+@p{}
+
+@refMenu{cmeDbgTraceInto,F7}
+
+@subsection Executing until cursor position is reached
+
+This functionality is obtained using the @il{Debug|Go to cursor} menu entry.
+@p{}
+
+Runs your program until control reaches the source line where the cursor is
+located.
+@p{}
+
+@refMenu{cmeDbgGoToCursor,F4}
+
+@subsection Executing until return
+
+This functionality is obtained using the @il{Debug|Until return} menu entry.
+@p{}
+
+Resumes the execution until the current function is finished. This command
+can't be used in the main function. If you want to return from the current
+function without executing the remaining code use the @il{Return now} option.
+@x{Returning immediatly}.
+@p{}
+
+@refMenu1{cmeDbgFinishFun}
+
+@subsection Returning immediatly
+
+This functionality is obtained using the @il{Debug|Return now} menu entry.
+@p{}
+
+This command doesn't realy resume the execution. Instead it simulates a
+function return and the control is passed to the calling function. If you
+want to execute the rest of the code use the @il{Until return} option.
+@x{Executing until return}.
+@p{}
+
+@refMenu1{cmeDbgReturnNow}
+
+@section Finishing and restarting a debug session
+
+Sometimes you'll want to finish the process you are currently debugging
+without farther execution or even finish the whole debug session. This
+section describes the available options related to it.
+@p{}
+
+If you want to finish the current process without wainting until it finishes
+you can @il{kill} it. @x{Killing the program you are debugging}. This
+operation is also called restart.
+@p{}
+
+You can @il{kill} the process and finish the debug session. In this case the
+debugger will also finish execution. @x{Closing the debug session}.
+@p{}
+
+Finally you can @il{kill} the process, @il{kill} the debugger and instruct
+the editor to forget about breakpoints, watchpoints, @il{etc.} That's a
+dangerous operation used only when no other operation helps.
+@x{Destroying the debug session}.
+@p{}
+
+@subsection Killing the program you are debugging
+@cindex debug, kill
+
+This functionality is obtained using the @il{Debug|Restart (Kill)} menu entry.
+@p{}
+
+This operation will finish the execution of the program you are debugging and
+go to the @il{Ready to Run} state. @x{Debugging states}.
+@p{}
+
+After it you can start executing your program from the beginning.
+@p{}
+
+@refMenu1{cmeDbgKill}
+
+@subsection Closing the debug session
+@cindex debug, close
+
+This functionality is obtained using the @il{Debug|Debug session|Close} menu
+entry.
+@p{}
+
+This operation will finish the execution of the program you are debugging and
+then will finish the debugger. After it the state will be @il{Disconnected}.
+@x{Debugging states}.
+@p{}
+
+After it you can start a new debug session.
+@p{}
+
+@refMenu1{cmeDbgCloseSession}
+
+@subsection Destroying the debug session
+
+This functionality is obtained using the @il{Debug|Debug session|Destroy} menu
+entry.
+@p{}
+
+This operation isn't recommended for normal use. In addition to kill the
+program you are debugging and finishing the debugger it also makes the editor
+to forget about breakpoints, watchpoints and other settings related to the
+debug session.
+@p{}
+
+After it you can start a new debug session.
+@p{}
+
+@refMenu1{cmeDbgEndSession}
+
+@section Examining the calling stack
+@cindex debug, frames
+@cindex debug, call stack
+
+This functionality is obtained using the @il{Debug|Calling stack} menu
+entry.
+@p{}
+
+When your program stopped you may want to know which functions were called in
+order to reach the current source line. Using this command the editor will
+send the list of functions to the Message Window. @x{Message Window}.
+@p{}
+
+After sending the list of functions to the Message Window the editor will
+jump to the first one. Using @kbd{Alt}+@kbd{F7} and @kbd{Alt}+@kbd{F8} you
+can navigate this list.
+@p{}
+
+In addition to the source file, function name, line of code and memory
+address you'll also find the arguments of the function.
+@p{}
+
+@refMenu{cmeDbgCallStack,Ctrl+F3}
+
+@section Cleaning the debug session
+@cindex debug, forget
+@cindex debug, clean
+
+This dialog is obtained using the @il{Debug|Debug session|Clear debug elements}
+menu entry.
+@p{}
+
+Usually you'll want the editor to remmeber the breakpoints, watchpoints,
+watches, @il{etc.@:} used in your last debug session. For this reason this
+data is stored in the project file. But sometimes you could want to clean all
+and do a fresh start. This command allows you to delete all of this or just a
+portion. You erase items of the following types:
+@p{}
+
+@itemize @bullet
+@item Breakpoints. @x{Advanced breakpoint options}.
+@item Watchpoints. @x{Watchpoints}.
+@item Watches. @x{Watch an expression}.
+@item Inspectors. @x{Inspectors}.
+@item Data windows. @x{Data Window}.
+@end itemize
+
+@refMenu1{cmeDbgCleanElem}
+
+@section Selecting the thread to debug
+
+This dialog is obtained using the @il{Debug|Select thread} menu entry.
+@p{}
+
+GDB can debug multithread programs that uses POSIX threads. The starting
+thread is the one you'll stop, step, trace, @il{etc.} If you want to select
+another thread to debug you can use this option. Note that gdb uses its own
+thread ids. The editor will offer a list of known threads and indicate which
+one is the current thread. GDB doesn't have any MI command to know which one
+is the current thread, for this reason the editor assumes that's the last
+thread id informed during a stop.
+@p{}
+
+Debugging multithread programs is complicated and I don't have good test
+examples. If you need to enhance the current options and want to cooperate
+with me please contact me.
+@p{}
+
+@refMenu1{cmeDbgThreadSel}
+
+@section Disassembler Window
+
+This functionality is obtained using the @il{Debug|Disassembler Window} menu
+entry.
+@p{}
+
+If you need to debug your program at the instruction level or debug some code
+that lacks debug information that's the tool you need.
+@p{}
+
+The Disassembler Window is divided in two sections. The left side contains
+the assembler code and the right side the CPU registers. The code side
+displays the assembler using a read-only edition window. If the code have
+debug information you'll see the source code mixed as comments.
+@p{}
+
+The @il{Step over}, @il{Trace into} and @il{Go to cursor} operations works at
+instruction level when applied to this window.
+@p{}
+
+You can manually open this window. Additionlly the editor will open this
+window every time the execution stops in a function without debug
+information. When the editor can determine the function name and the source
+file that contains it the whole function will be disassembled. If only the
+function name can be determined the editor will disassemble from the
+beginning of the function upto 500 bytes after the current location. If
+nothing can be determined the editor will disassemble 500 bytes from the
+current location.
+@p{}
+
+Sometimes gdb informs bogus function locations. What's worst is that
+disassembling from the informed place upto the current location can be too
+slow and even make gdb to SIGSEGV. To avoid it the editor won't disassemble
+from the beginning of the function if the distance is bigger than 20000
+bytes.
+@p{}
+
+When this window is opened the code section is selected. You can switch to
+the registers section using the @kbd{Tab} key. Selecting a register and using
+the @kbd{Enter} key you can modify its value.
+@p{}
+
+If you get an error from gdb stating @il{bad register number} when you open
+this window please try upgrading gdb. That's a bug in the MI code. I
+submitted a patch to fix this problem to the proper list. It seems to affect
+gdb 6.1 and 6.2.
+@p{}
+
+@refMenu1{cmeDbgDisAsmWin}
+
+@section Debugging already running processes
+@cindex debug, pid
+@cindex debug, already running
+
+You can debug a process that's already running in memory. This is really
+useful when your program exposes an uncommon bug that's hard to reproduce.
+@p{}
+
+The steps to do it are almost the same used for regular programs. Only a few
+details changes:
+@p{}
+
+@itemize @bullet
+@item As the program is already running you have to stop it instead of run
+it.
+@item When you finish debugging you could want to let it run without farther
+intrusion.
+@end itemize
+
+The first action is called @il{atach} and the second @il{detach}.
+@p{}
+
+To start debugging an already running process you must select this option in
+the @il{Debug Options} dialog. @x{Debug options}. Then you must know the
+process id for the process you want to debug. This can be found using the
+@code{ps} POSIX command.
+@p{}
+
+To atach gdb to the running process you must use the
+@il{Debug|Run/Continue/Atach} menu option. It will ask you the process id
+(pid).
+@p{}
+
+Once gdb is atached to the running process it is stopped and the state is
+changed to @il{Stopped}. @x{Debugging states}.
+@p{}
+
+When you no longer need to debug the process you can detach from it using the
+@il{Debug|Debug session|Detach} menu option. The process will resume its
+normal execution.
+@p{}
+
+@refMenu1{cmeDbgDetach}
+
+@section Debug Messages Window
+@cindex debug, state window
+@cindex debug, gdb messages
+
+This window is used to:
+@p{}
+
+@itemize @bullet
+@item Show gdb messages. @x{Messages displayed}.
+@item Show the current debugging state. @x{Debugging states}.
+@item Show extra information about the current state. It includes errors from
+gdb or in the communication with gdb.
+@item Send commands to gdb.
+@end itemize
+
+When you start a new debug session this window becomes visible. When the
+session is closed the window is hided. When the window is hided you can
+access it using the list of windows dialog. @x{List}.
+@p{}
+
+The maximum ammount of messages displayed in this window is limited to avoid
+wasting memory. You can configure this value using the advanced options
+dialog. @x{Advanced debug options}.
+@p{}
+
+To send commands to gdb use the @kbd{Insert} key.
+@p{}
+
+@section Editing a debug expression
+@cindex debug, edit expression
+
+When a dialog asks for an expression to watch, modify, @il{etc.@:} you can
+enter any expression that gdb can analize. This includes arithmetic
+operations and function calls.
+@p{}
+
+@section Debugging in the Linux console
+@cindex debug, console
+
+When you debug in a Linux console the editor uses a separated virtual
+terminal for the program you want to debug. The terminal is automatically
+selected but you can specify it using the debug options dialog.
+@x{Debug options}.
+@p{}
+
+One reason to specify a fixed terminal is when you have more than one video
+card. In this case you can allocate some virtual terminals in the secondary
+video board and use them to run the program to debug.
+@p{}
+
+When using only one video card the debug window should be in some visible part
+of the editor's desktop. This window indicates the current status and hence
+you can know if your program is stopped or running. @x{Debug Messages Window}.
+@p{}
+
+Remmember that when the editor is running in a Linux console you must use the
+@kbd{Ctrl} + @kbd{Alt} + @kbd{Fn} key combination to switch to another
+virtual terminal.
+@p{}
+
+@chapter Miscellaneous
+
+@section Configuration files location
+@cindex configuration files, location
+
+ The configuration files are read from various directories allowing to use
+system wide defaults and also user defined settings. The mechanism used to
+determine which file to load depends on the OS. For DOS and Windows the
+editor doesn't know much about users and uses an approach that's different
+to the one used for POSIX systems (Linux, FreeBSD, QNX, Solaris, @il{etc.}).
+The Cygwin version of the editor is considered as a POSIX version even when
+that's a Windows binary.
+@p{}
+
+
+@subsection Configuration directories for DOS and Windows
+
+ Here is the list of directories where the editor looks for a configuration
+file. Note that Cygwin binaries are an exception and they behave as binaries
+compiled for POSIX systems. @x{Configuration directories for POSIX systems}.
+@p{}
+
+ One concept used during the search is the @il{home directory}. It is
+determined using the @code{HOME} environment variable. If this variable isn't
+defined the editor tries with @code{HOMEDIR}. We represent it using @code{~}.
+@p{}
+
+ To represent the content of an environment variable the examples use
+@code{%VARIABLE%}. In the examples we will represent the configuration file
+naming it @il{FILE}.
+@p{}
+
+@enumerate
+@item @file{~/FILE}
+@item @file{%SET_FILES%/FILE}
+@item The directory where you started the editor.
+@end enumerate
+
+ The @code{SET_FILES} environment variable should point to the directory
+where system wide configuration files are stored. Note that if the
+@code{SET_FILES} environment variable isn't defined the editor tries to
+figure out it using the following sequence:
+@p{}
+
+@enumerate
+@item The installation directory detected or specified at compilation time
+adding the @file{share/setedit} directory.
+@item The directory where the binary is located eliminating the @file{bin}
+part and adding @file{share/setedit} directory.
+@end enumerate
+
+@subsection Configuration directories for POSIX systems
+
+ Here is the list of directories where the editor looks for a configuration
+file. Note it includes Cygwin binaries.
+@p{}
+
+ One concept used during the search is the @il{home directory}. It is
+determined using the @code{HOME} environment variable. If this variable isn't
+defined the editor tries with @code{HOMEDIR}. We represent it using @code{~}.
+@p{}
+
+ To represent the content of an environment variable the examples use
+@code{$VARIABLE}. In the examples we will represent the configuration file
+naming it @il{FILE}. In POSIX systems a hidden file is created using a dot a
+preffix.
+@p{}
+
+@enumerate
+@item @file{~/.setedit/FILE} (Note: this directory is created if it doesn't
+exist).
+@item @file{~/.setedit/.FILE}
+@item @file{~/FILE}
+@item @file{~/.FILE}
+@item @file{$SET_FILES/FILE}
+@end enumerate
+
+ The @code{SET_FILES} environment variable should point to the directory
+where system wide configuration files are stored. Note that if the
+@code{SET_FILES} environment variable isn't defined the editor tries to
+figure out it using the following sequence:
+@p{}
+
+@enumerate
+@item The installation directory detected or specified at compilation time
+adding the @file{share/setedit} directory.
+@item @file{/usr/share/setedit}
+@item @file{/usr/local/share/setedit}
+@end enumerate
+
+@section Clipboard
+
+The clipboard is just another editor window, which holds the text you used the
+@code{Cut} and @code{Copy} commands on, and retrieve it with the @code{Paste}
+command.
+@paragraph{}
+
+Unlike the windows clipboard the one provided with the editor doesn't lose
+the old contents when you copy to it. This approach has the important
+advantage that you can copy text from various parts to the clipboard and then
+paste all the text in one place with just one operation. To do it select
+the clipboard window, select the text to paste and the editor pastes the
+text selected in the clipboard window.
+@paragraph{}
+
+The disadvantage is that all the text copied to the clipboard remains there
+and if you are running on a machine with low memory and handling huge files
+you can fill all the memory quickly. To avoid this check the clipboard size (with
+@kbd{Alt+0}) and exit the program if it gets too big. That normally isn't needed
+on machines with enough free disk space that can be used as swap.
+@paragraph{}
+
+@section Time and date modifiers formats
+
+This values are the same used by the @code{strftime} function of the standard
+@file{libc}. The editor uses it in the printing module. @x{Print Setup}.
+@paragraph{}
+
+@table2{Value,Meaning}
+@titemR{@code{%A},The full weekday name (@code{Friday})}
+@titemR{@code{%a},The abbreviated weekday name (@code{Fri})}
+@titemR{@code{%B},The full month name (@code{October})}
+@titemR{@code{%b\, %h},The abbreviated month name (@code{Oct})}
+@titemR{@code{%C},Short for @code{%a %b %e %H:%M:%S %Y}
+(@code{Fri Oct 1 15:30:34 1993})}
+@titemR{@code{%c},Short for @code{%m/%d/%y %H:%M:%S} (@code{10/01/93
+15:30:34})}
+@titemR{@code{%e},The day of the month, blank padded to two characters
+(@code{ 2})}
+@titemR{@code{%D},Short for @code{%m/%d/%y} (@code{10/01/93})}
+@titemR{@code{%d},The day of the month, zero padded to two characters
+(@code{02})}
+@titemR{@code{%H},The hour (0-24), zero padded to two characters (@code{15})}
+@titemR{@code{%I},The hour (1-12), zero padded to two characters (@code{03})}
+@titemR{@code{%j},The Julian day, zero padded to three characters
+(@code{275})}
+@titemR{@code{%k},The hour (0-24), space padded to two characters
+(@code{15})}
+@titemR{@code{%l},The hour (1-12), space padded to two characters(@code{ 3})}
+@titemR{@code{%M},The minutes, zero padded to two characters (@code{30})}
+@titemR{@code{%m},The month (1-12), zero padded to two characters
+(@code{10})}
+@titemR{@code{%n},A newline (@code{\n})}
+@titemR{@code{%p},AM or PM (@code{PM})}
+@titemR{@code{%R},Short for @code{%H:%M} (@code{15:30})}
+@titemR{@code{%r},Short for @code{%I:%M:%S %p} (@code{03:30:35 PM})}
+@titemR{@code{%S},The seconds, zero padded to two characters (@code{35})}
+@titemR{@code{%T\, %X},Short for @code{%H:%M:%S} (@code{15:30:35})}
+@titemR{@code{%t},A tab (@code{\t})}
+@titemR{@code{%U},The week of the year, with the first week defined by the
+first Sunday of the year, zero padded to two characters (@code{39})}
+@titemR{@code{%W},The week of the year, with the first week defined by the
+first Monday of the year, zero padded to two characters (@code{39})}
+@titemR{@code{%w},The day of the week (0-6) (@code{5})}
+@titemR{@code{%x},Short for @code{%m/%d/%y} (@code{10/01/93})}
+@titemR{@code{%y},The year (00-99) of the century (@code{93})}
+@titemR{@code{%Y},The year, zero padded to four digits (@code{1993})}
+@titemR{@code{%Z},The timezone abbreviation (@code{EDT})}
+@titemR{@code{%%},A percent symbol (@code{%})}
+@endtable-{}
+
+@section Regular Expressions
+
+The editor supports regular expressions in the search and replace commands,
+here is a description of the syntax.
+@paragraph{}
+
+Regular expressions (@dfn{RE}s), as defined in POSIX 1003.2, come in two
+forms: modern REs (roughly those of @code{egrep}; 1003.2 calls these
+@emph{extended} REs) and obsolete REs (roughly those of @code{ed};
+1003.2 @emph{basic} REs). Obsolete REs mostly exist for backward
+compatibility in some old programs; they will be discussed at the end.
+1003.2 leaves some aspects of RE syntax and semantics open; `(*)' marks
+decisions on these aspects that may not be fully portable to other
+1003.2 implementations.
+@paragraph{}
+
+A (modern) RE is one(*) or more non-empty(*) @emph{branches}, separated
+by @samp{|}. It matches anything that matches one of the branches.
+@paragraph{}
+
+A branch is one(*) or more @emph{pieces}, concatenated. It will try to find
+a match for the first, then for the second, etc.
+@paragraph{}
+
+A piece is an @emph{atom} possibly followed by a single(*) `*', `+',
+`?', or @emph{bound}.
+An atom followed by `*' matches a sequence of 0 or more occurences of the atom.
+An atom followed by `+' matches a sequence of 1 or more occurences of the atom.
+An atom followed by `?' matches a sequence of 0 or 1 occurences of the atom.
+@paragraph{}
+
+A @emph{bound} is a `@{' followed by an unsigned decimal integer, possibly
+followed by `,' possibly followed by another unsigned decimal integer,
+always followed by `@}'. The integers must lie between 0 and
+@code{RE_DUP_MAX} (255(*)) inclusive, and if there are two of them, the
+first may not exceed the second. An atom followed by a bound containing
+one integer @samp{i} and no comma matches a sequence of exactly @samp{i}
+occurences of the atom. An atom followed by a bound containing one integer
+@samp{i} and a comma matches a sequence of @samp{i} or more occurences of
+the atom. An atom followed by a bound containing two integers @samp{i}
+and @samp{j} matches a sequence of @samp{i} through @samp{j} (inclusive)
+occurences of the atom.
+@paragraph{}
+
+An atom is a regular expression enclosed in `()' (one occurence for the
+regular expression), an empty set of `()' (matches the null string(*)),
+a @emph{bracket expression} (see below), `.' (matching any single
+character), `^' (matching the null string at the beginning of a line),
+`$' (matching the null string at the end of a line), a `\\' followed by
+one of the characters `^.[$()|*+?@{\\' (matches that character taken as
+an ordinary character), a `\\' followed by any other character(*)
+(matches that character taken as an ordinary character, as if the `\\'
+had not been present(*)), or a single character with no other
+significance (matching that character). A `@{' followed by a character
+other than a digit is an ordinary character, not the beginning of a
+bound(*). It is illegal to end an RE with `\\'.
+@paragraph{}
+
+A @emph{bracket expression} is a list of characters enclosed in `[]'.
+It normally matches any single character from the list (but see below).
+If the list begins with `^', it matches any single character (but see
+below) @emph{not} from the rest of the list. If two characters in the
+list are separated by `-', this is shorthand for the full @emph{range}
+of characters between those two (inclusive) in the used character set,
+e.g. `[0-9]' matches any decimal digit in ASCII. It is illegal(*) for
+two ranges to share an endpoint, e.g. `a-c-e'. Ranges are very
+character set-dependent, and portable programs should avoid relying
+on them.
+@paragraph{}
+
+To include a literal `]' in the list, make it the first character
+(following a possible `^'). To include a literal `-', make it the
+first or last character, or the second endpoint of a range. To use a
+literal `-' as the first endpoint of a range, enclose it in `[.' and
+`.]' to make it a collating element (see below). With the exception of
+these and some combinations using `[' (see next paragraphs), all other
+special characters, including `\\', lose their special significance
+within a bracket expression.
+@paragraph{}
+
+Within a bracket expression, a collating element (a character, a
+multi-character sequence that collates as if it were a single character,
+or a collating-sequence name for either) enclosed in `[.' and `.]'
+stands for the sequence of characters of that collating element. The
+sequence is a single element of the bracket expression's list. A
+bracket expression containing a multi-character collating element can
+thus match more than one character, e.g. if the collating sequence
+includes a `ch' collating element, then the RE @samp{[[.ch.]]*c} matches
+the first five characters of ``chchcc''.
+@paragraph{}
+
+Within a bracket expression, a collating element enclosed in `[=' and
+`=]' is an equivalence class, standing for the sequences of characters
+of all collating elements equivalent to that one, including itself.
+(If there are no other equivalent collating elements, the treatment is
+as if the enclosing delimiters were `[.' and `.]'.) For example, if o
+and \o'o^' are the members of an equivalence class, then `[[=o=]]',
+`[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous. An equivalence
+class may not be an endpoint of a range.
+@paragraph{}
+
+Within a bracket expression, the name of a @emph{character class}
+enclosed in `[:' and `:]' stands for the list of all characters
+belonging to that class.
+Standard character class names are:
+@paragraph{}
+
+@example
+alnum digit punct
+alpha graph space
+blank lower upper
+cntrl print xdigit
+@end example
+
+These stand for the character classes defined by @code{isalnum},
+@code{isdigit}, @code{ispunct}, @code{isalpha}, @code{isgraph}
+, @code{isspace} (@code{blank} is the same as @code{space}),
+@code{islower}, @code{isupper}, @code{iscntrl}, @code{isprint},
+and @code{isxdigit}, respectively. A locale may provide others.
+A character class may not be used as an endpoint of a range.
+@paragraph{}
+
+There are two special cases(*) of bracket expressions: the bracket
+expressions `[[:<:]]' and `[[:>:]]' match the null string at the
+beginning and end of a word respectively. A word is defined as a
+sequence of word characters which is neither preceded nor followed by
+word characters. A word character is an @code{alnum} character (as
+defined by the @code{isalnum} library function) or an underscore. This is
+an extension, compatible with but not specified by POSIX 1003.2, and
+should be used with caution in software intended to be portable to other
+systems.
+@paragraph{}
+
+In the event that an RE would match more than one substring of a given
+string, the RE matches the one starting earliest in the string. If the
+RE could match more than one substring starting at that point, it
+matches the longest. Subexpressions also match the longest possible
+substrings, subject to the constraint that the whole match be as long as
+possible, with subexpressions starting earlier in the RE taking priority
+over ones starting later. Note that higher-level subexpressions thus
+take priority over their lower-level component subexpressions.
+@paragraph{}
+
+Match lengths are measured in characters, not collating elements. A
+null string is considered longer than no match at all. For example,
+@samp{bb*} matches the three middle characters of @samp{abbbc},
+@samp{(wee|week)(knights|nights)} matches all ten characters of
+@samp{weeknights}, when @samp{(.*).*} is matched against @samp{abc} the
+parenthesized subexpression matches all three characters, and when
+@samp{(a*)*} is matched against `bc' both the whole RE and the
+parenthesized subexpression match the null string.
+@paragraph{}
+
+If case-independent matching is specified, the effect is much as if all
+case distinctions had vanished from the alphabet. When a letter
+that exists in multiple cases appears as an ordinary character outside a
+bracket expression, it is effectively transformed into a bracket
+expression containing both cases, e.g. `x' becomes `[xX]'. When it
+appears inside a bracket expression, all case counterparts of it are
+added to the bracket expression, so that (e.g.) `[x]' becomes `[xX]' and
+`[^x]' becomes `[^xX]'.
+@paragraph{}
+
+No particular limit is imposed on the length of REs(*). Programs
+intended to be portable should not employ REs longer than 256 bytes,
+as an implementation can refuse to accept such REs and remain
+POSIX-compliant.
+@paragraph{}
+
+Obsolete (@emph{basic}) regular expressions differ in several respects.
+`|', `+', and `?' are ordinary characters and there is no equivalent
+for their functionality. The delimiters for bounds are `\\@{' and
+`\\@}', with `@{' and `@}' themselves being ordinary characters. The
+parentheses for nested subexpressions are `\(' and `\)', with `(' and
+`)' themselves being ordinary characters. `^' is an ordinary character
+except at the beginning of the RE or(*) the beginning of a parenthesized
+subexpression, `$' is an ordinary character except at the end of the RE
+or(*) the end of a parenthesized subexpression, and `*' is an ordinary
+character if it appears at the beginning of the RE or the beginning of a
+parenthesized subexpression (after a possible leading `^').
+Finally, there is one new type of atom, a @emph{back reference}:
+`\\' followed by a non-zero decimal digit @emph{d} matches the same
+sequence of characters matched by the @emph{d}th parenthesized
+subexpression (numbering subexpressions by the positions of their
+opening parentheses, left to right), so that (e.g.) @samp{\\([bc]\\)\\1}
+matches `bb' or `cc' but not `bc'.
+@paragraph{}
+
+@section Desktop Files
+
+Each time you run the editor it searches for a desktop file in the current
+directory, if the editor can't find any desktop file it searches in the
+directory indicated by the enviroment variable @code{SET_FILES}. If no
+desktop files are found the editor uses internal default values. By
+creating a desktop file in the @code{%SET_FILES%} directory you'll
+indicate default values. To create a desktop file in this directory just
+run the editor in the directory, customize it and leave the editor. This
+feature is very useful to customize things like: Colors, Palette, Global
+editor options, @il{etc.}
+@paragraph{}
+
+When you exit from the editor it saves all the settings, windows positions,
+@il{etc.@:} to a desktop file stored in the current directory. Some people
+don't like this and therefore a special mode in which the editor
+stores just one desktop file in the @code{%SET_FILES%} directory and not
+in each directory exists. This approach has the advantage of saving disk
+space, but you won't have local settings. If you use this approarch and want
+to keep a local configuration in a directory use a project. @x{Project}. To
+store only one centralized desktop file: @x{Editor General}.
+@paragraph{}
+
+The desktop files have @file{.dst} as extension.
+@paragraph{}
+
+@section Text mode attributes
+
+Text modes uses up to 16 colors for forground and 16 colors for background,
+that's because the attributes of each character are stored in a 1 byte
+allowing just 256 combinations. So four bits are dedicated to the background
+color giving 16 combinations and the other four bits for the foreground.
+@paragraph{}
+
+As we have only 16 colors there is a big chance that our preferred colors
+aren't included. For this reason the VGA chip uses a palette of colors. That
+means that these 16 colors aren't fixed and you can indicate what colors to
+use. The values are just index values and you can assign to it any color.
+@paragraph{}
+
+The VGA chip supports 18(6:6:6) bits per color giving 262,144 combinations. The
+colors are created using the RGB (Red Green and Blue) method. That's simply
+because the CRT (Cathode Rays Tube) of the monitor uses this method to
+create the colors. You have 6 bits per component giving 64 different levels.
+@paragraph{}
+
+There is a little more of complexity added to the VGA card. The most
+significant bit of the background is used to create blinking text. The editor
+avoids this mode because it restricts the background combinations to 8 and
+the editor doesn't need blinking text. The other funny thing of the attribute
+is the most significant bit of the foreground color. It has a special
+meaning but even when using it, it doesn't reduce the number of combinations.
+That means that this bit can select two things at the same time. By now you'll be
+asking: What? This bit can be used to select a second font, in this way you
+can have upto 512 different characters on the screen. The editor can exploit
+it but you must understand that this bit is used for the foreground color
+too. You can customize the palette to reduce the number of foreground
+combinations to 8 and defining the 9th color with the same value as the
+0th color and so on. Then you can assign different colors and different fonts
+to the things in the editor. You can for example use a font for the menues
+and other for the text, or a font for the code and other for the comments.
+The editor goes even further allowing different code page encodings for each
+font. I really never saw it in any editor. You can use it for example to
+write your code using a font with the ISO Latin 1 encoding (used by Linux
+and Windows in the USA and part of Europe) and have your comments in russian
+(using cyrillic characters).
+@paragraph{}
+
+To learn how to customize the palette: @x{Color Palette}.@*
+To learn how to assign colors to the things used in the editor: @x{Customize Colors}.@*
+To learn how to select a font and an encoding: @x{Screen Options}.@*
+
+@section File Open
+
+This dialog is used to select a file in various places. Even when it has
+different names and purposes the dialog is always the same.
+@paragraph{}
+
+The dialog is similar to the one used by most of the T/GUI programs so I'll
+focus on special details and particularities.
+@paragraph{}
+
+All the files and directories are shown together, the directories have a
+slash at the end. The current directory and selected file information is
+shown at the bottom of the dialog.
+@paragraph{}
+
+To select a different disk, at least in DOS, you can simply type the drive
+letter followed by a colon in the text input area and press @key{Enter}. You
+can specify a mask in the text area too. Even though under DOS a single asterisk
+matches any filename, the *.* mask won't match with a filename that lacks
+extension. You can use some asterisks and question marks in the mask, they
+work like in most of the shells (DOS command.com included). Additionally the
+mask can contain brackets, if your shell doesn't use it and you never used
+it here is an example: @code{*.[ch]*} will match with test.c, test.h,
+test.cc, test.cpp, @il{etc.@:} the brackets indicates the possible characters
+that will match, in this case the first character after the point should be c
+or h.@*
+Pressing the down arrow while you are in the text input area you'll get a
+list of the paths in which you selected files in the past. That's very useful
+when you load files from two or more very different directories.
+@paragraph{}
+
+The @code{Home} changes the directory to the one from where you started the
+editor, that's very useful when you navigate a lot and you want to quickly
+return to the directory from where you started.
+@paragraph{}
+
+The @code{Options} button brings a dialog to configure the sorting options
+and which files to exclude. These options are described in the following
+subsections.
+@p{}
+
+The editor remembers the last place where you selected a file the last time
+you used it. This information is stored in the desktop file. This information
+is unique for the following selections: open a file to edit, save a file,
+open a help file, save a block of text, open/save a project, open an MP3 file
+and save an MP3 file. In this way you can be opening files from a directory
+and saving newly created files to another at the same time without
+indicating the directory each time you open/save a file.
+@paragraph{}
+
+@subsection Sorting of the files and directories in the dialog
+@cindex backups, listing at the end
+
+By default the sorting criteria is the following:
+@paragraph{}
+
+@itemize @bullet
+ @item Names sorting is case insensitive.
+ @item Directories are listed after files.
+ @item The parent directory (@code{..}) is the last entry.
+ @item Files starting with a dot are alphabetically listed.
+@end itemize
+
+But this can be customized with the @il{File open dialog} menu option or the
+@code{Options} button of the dialog. It brings a dialog with the following
+options:
+@paragraph{}
+
+@itemize @bullet
+ @item Sort type: controls how the names are sorted.
+ @itemize @bullet
+ @item Alphabetical: both, directories and file names, are mixed.
+ @item Directories first: the directories are listed first.
+ @item Files first: file names are listed first.
+@end itemize
+ @item Case style: controls if the dialog differentiates between capital and
+lower case ones.
+ @itemize @bullet
+ @item Capital letters goes first: the names are sorted according to the
+ASCII table
+ @item Case insensitive: the names are sorted lexicographically.
+@end itemize
+ @item Parent directory: this option controls the location of the parent
+directory link (@code{..}). It doesn't affect the @il{Alphabetical} sorting.
+ @itemize @bullet
+ @item First in the list: the parent is the first entry in the list.
+ @item At the end of the list: the parent is the last entry in the list.
+@end itemize
+ @item Files starting with a dot: it controls how names starting with a dot
+are handled.
+ @itemize @bullet
+ @item Normally sorted: they will be sorted alphabetically. As the
+@code{ASCII} code of a dot is less than the code of any letter they will be
+first in the list. That's quite annoying when you use UNIX style backups and
+they are also hidden files.
+ @item After the rest: they will be put at the end of the list.
+@end itemize
+@end itemize
+
+The other options you'll find in this configuration dialog are described in
+another subsection. @x{Files and directories excluded in the dialog}.
+@p{}
+
+Something very important that you must know is how the @key{Shift} key is
+interpreted.
+@paragraph{}
+
+When the sorting is @il{Alphabetical} and the list is case
+sensitive (@il{Capital letters are first}) the shift key affects the case of
+the typed letters so you must be careful; check the state of @key{Caps Lock}
+now and then as well.
+@paragraph{}
+
+When the sorting isn't @il{Alphabetical} the @key{Shift} has a special
+meaning. If you press shift while typing the first letter of the name then
+the search will be done in the list of directories instead of the list of
+file names. Once you are in one of the lists the rest of the search is done
+in this list. If the list is case sensitive it creates an interesting
+conflict because you could need to press shift for some file name and then
+the search will be done in the directories list. Don't forget this.
+@paragraph{}
+
+@subsection Files and directories excluded in the dialog
+@cindex backups, not listing
+
+By default all names found are listed but this can be customized with the
+@il{File open dialog} menu option or the @code{Options} button of the
+dialog. The related options are:
+@paragraph{}
+
+@itemize @bullet
+@item Exclude files: controls which names are excluded.
+ @itemize @bullet
+ @item Ending with tilde: names ending with a tilde are excluded. They
+usually belong to UNIX-style backups. The editor generates these files when you
+configure it to generate UNIX style backups.
+ @item Ending with .bkp: names with the bkp extension are excluded. By
+default the editor generates backup files with this extension.
+ @item Starting with dot: names starting with a dot are excluded. In UNIX
+they are hidden files. The editor can be configured to create backup files as
+hidden files.
+@end itemize
+@end itemize
+
+Personally I only exclude files with the bkp extension and sort files
+starting with a dot so they appear at the end of the list.
+@p{}
+
+@section Message Window
+@cindex message window
+@cindex windows, message
+
+This window is used to show important information that you may want to have
+at hand. Some examples are: the results of a printing operation, the errors
+collected from an external program, the hits of the powered grep, the tip of
+the day, the output of an external program, etc.
+@paragraph{}
+
+The message window doesn't have a number but can be accessed from the list of
+windows (default @kbd{Alt+0}) or from the @il{Windows | Message Window} menu
+option.
+@paragraph{}
+
+If the messages are errors or hits from grep you can use @kbd{Alt+F7} and
+@kbd{Alt+F8} to quickly jump to the next/previous line. You can also just
+select any of the error/hits. The errors are parsed by the editor according
+to the user selection. Many formats are supported by the editor and the
+mechanism is configurable. See the next section for more information.
+@paragraph{}
+
+When the last or first error in the list is reached the editor indicates it.
+This behavior can be configured. @x{Editor General}.
+@p{}
+
+You can also delete entries in the message window pressing @key{Delete}. To
+add more flexibility the content of the message window can be stored in a
+file or copied to the clipboard, to do this just use the menu.
+@paragraph{}
+
+For more information about the behavior of the message window when you run
+external programs @x{Run program (which one)}.
+@p{}
+
+@section Error messages from an external application
+@cindex parse, errors
+@cindex errors from external program
+
+Originally the editor only supported the GNU style. After many users
+asked for support of other error formats Grzegorz Adam Hankiewicz suggested
+doing it in a configurable way. So starting with v0.4.41 the editor can be
+configured to parse the errors from an external application.
+@paragraph{}
+
+The configuration is stored in a file called @file{errors.cle}. The syntax is
+very similar to the one used in the @file{syntaxhl.shl} file. All definitions
+start with a @code{Name} declaration that indicates the name of the parsing
+options and ends with an @code{End} marker. @x{Configuration files location}.
+@paragraph{}
+
+The @code{Pattern} entry tells the editor how to parse a line containing an
+error from the external program. The pattern is actually a Perl regular
+expression. I used it because they are much more easy to learn than POSIX
+regular expressions and they are a lot more logical to me.
+@paragraph{}
+
+The @code{File}, @code{Line}, @code{Severity} and @code{Description} entries
+indicate - with subexpressions - the file name, line number, degree
+of severity and description of the error. Note that actually only the first
+two are used. If you don't know what a subexpression is here is a hint: look
+at the parentheses.
+@paragraph{}
+
+The @code{EnterDirPat} is another Perl regex to indicate how make informs
+about a directory change. @code{EnterDirDir} is the related subexpression.
+That's needed for GNU make, I guess other make tools have a similar
+mechanism. @code{LeaveDir} is the pattern generated by make to indicate a
+change to the parent directory.
+@paragraph{}
+
+@section Mouse under Linux
+
+When you are running in a console the mouse is captured by the editor and you
+can't use it to copy/paste between consoles. If you want to do it you must
+hold down the right @key{Alt} key and use the mouse as usually. Note this can
+be altered if you changed the alt keys configuration.
+@x{Alt key configuration}. Additionally note that when you paste the keys
+are interpreted as @key{Alt} plus the key you pressed so the carriage returns
+aren't interpreted very well.
+@paragraph{}
+
+If you are using an X terminal the mouse isn't interactive because X
+terminals only report when the button is pressed and released but not when
+it's moved. You can do all the normal operations but you won't get the usual
+feedback.
+@paragraph{}
+
+@section Passing extra command line options
+
+You can pass extra command line options defining an environment variable.
+It's called @var{SET_CMDLINE}. The editor will parse this variable and add it to
+the options passed in the command line. These options will be interpreted
+before the options passed in the command line.
+@paragraph{}
+
+Any space (including tabs) are interpreted as separators. If you need to pass
+a file name containing spaces you must enclose the name with double quotes.
+If you need to pass a name containing a double quote you must escape it using
+a back slash. Here are some examples:
+@paragraph{}
+
+@table2{You type,The editor interpretes}
+@titemR{ops 1,two options "ops" and "1"}
+@titemR{"ops 1",one option "ops 1"}
+@titemR{ops\"1,one option containing a double quote inside}
+@endtable-{}
+
+This mechanism can be used to set default options and avoid typing them all
+the time. Another use is when you need to pass options to the editor and you
+are using Eterm; which can't pass command line options, so you
+must use this mechanism.
+
+@section How to run setedit remotely without root installation (UNIX)
+
+This text was contributed by Grzegorz Adam Hankiewicz:
+@p{}
+
+I'm a lucky guy and I've been hired by eFaber (http://www.efaber.net)
+to do some open source hacking. The first day I started I was given
+a computer and received strong orders: @il{Install Suse Linux 8.1 and
+customize your environment}. Obviously I chose to install setedit,
+and it worked great. However, from time to time I have to go to
+another workstation or login remotely. We export @file{/home} through
+NFS, so apparently we have the same configuration everywhere. But
+setedit doesn't work that way.
+@p{}
+
+First of all, setedit depends on the TVision library, and only my PC
+has it installed. setedit also needs a global directory where shared
+files reside, usually @file{/usr/share/setedit}, or something else
+pointed by @code{SET_FILES}. One solution would be to install setedit
+everywhere, but this is not scalable, and it's error prone. If I
+wanted to upgrade setedit or TVision I would spend much time copying
+and installing on every machine. Besides, even if my coworkers let me
+use root, or told me the password, I would never be given access
+to the main server, and it's the only one with email I/O. What's
+the solution?
+@p{}
+
+The solution is to put the files needed by setedit on the exported
+directory, in other words, @code{$HOME}. After you compile setedit, put
+the binary in @file{~/bin}. Find where your TVision is (librhtv*) and copy
+the library to @file{~/lib}. If you run @code{ldd} on @file{~/bin/setedit} you will see
+that the librhtv dependency is resolved to your local file system. If
+you logged now to another computer, the library wouldn't be found.
+@p{}
+
+To avoid this, add something similar to this to your .bashrc:
+@p{}
+
+@example
+ export PATH=$PATH:~/bin
+ export LD_LIBRARY_PATH=~/lib
+@end example
+
+After you log in again, try to use ldd on the binary, and now you
+should see the linker resolve it to your @file{~/lib} everywhere.
+First step complete. The second step is to move the shared files.
+I created the directory in @file{~/bin/setedit_shared_files}, and
+made @file{/usr/share/setedit} on my local machine a symlink to it,
+so newer installs of setedit overwrite the correct shared files.
+Now make @code{SET_FILES} point to it:
+@p{}
+
+@example
+ export SET_FILES=~/bin/setedit_shared_files
+@end example
+
+Nice. Now, if you run setedit it will be able to load,
+but you will still find two annoying facts: setedit always
+looks for the @file{setedit.info} file (which is usually found in
+@file{/usr/info/setedit.info.gz}), and the language translations won't
+be found because GNU's gettext doesn't know anything about our
+exportation trick.
+@p{}
+
+To solve the info file warning, copy setedit.info.gz to
+@file{~/bin/setedit_shared_files} and add that directory to the appropriate
+environment variable:
+@p{}
+
+@example
+ export INFOPATH=$INFOPATH:$SET_FILES
+@end example
+
+Finally, to correct the gettext problem, first make @code{SET_LOCELEDIR}
+point to @code{SET_FILES}:
+@p{}
+
+@example
+ export SET_LOCALEDIR=$SET_FILES
+@end example
+
+And now, in the @code{SET_FILES} directory create the @file{xxxx/LC_MESSAGES/}
+directory structure, where `xxxx' is a two letter code representing a language.
+I would then create @file{~/bin/setedit_shared_files/es/LC_MESSAGES}, and put
+inside the file @file{setedit.mo} I found typing @code{locate setedit.mo} on
+my workstation. After copying the file there, GNU's gettext will
+find the translation file always, from any directory, and you will
+be able to hack from every computer as if you were at home.
+@p{}
+
+Again, what you have to add to your @file{.bashrc} file is:
+@p{}
+
+@example
+ export PATH=$PATH:~/bin
+ export LD_LIBRARY_PATH=~/lib
+ export SET_FILES=~/bin/setedit_shared_files
+ export INFOPATH=$INFOPATH:$SET_FILES
+ export SET_LOCALEDIR=$SET_FILES
+@end example
+
+Happy hacking!
+
+@chapter Index
+
+@conindex{cindex.idx,cindex.tdx}
+
+@chapter Index of key commands
+
+@keyindex{kindex.idx,kindex.tdx}
+
+@EOFTOC
+
+@bye
+
diff --git a/setedit/doc/gnumake.in b/setedit/doc/gnumake.in
new file mode 100644
index 0000000..1dec1bd
--- /dev/null
+++ b/setedit/doc/gnumake.in
@@ -0,0 +1,90 @@
+#
+# Copyright (c) 1997,1998,1999,2000 by Salvador Eduardo Tropea
+#
+# Make file to generate the documentation for SET's editor
+# and the needed utilties
+#
+# This file was adapted by Robert Hhne to integrate it
+# easilly with RHIDE.
+#
+
+CC=@CC@
+# Compat Layer headers location
+clheaders=@TVInclude@
+# set srcdir to the directory where the sources are
+srcdir=.
+# set this to the directory, where to search for @include
+incdir=.
+#extraincdir=$(RHIDESRC)/doc Now I included the files in the distribution
+VPATH=$(srcdir)
+
+# define here the wanted doc's
+targets=editor sdg infeng
+man_targets=setedit infview
+
+# define here for each target the index commandline for
+# sdh which is then used in $(sdh_ops) with $(index_$*)
+# by replacing $* with the actual target
+index_editor=-n "Index of key commands" kindex.idx kindex.tdx
+index_sdg=-n "Index of variables and commands" vindex.idx vindex.tdx
+
+# set the commandline options for sdh
+sdh_ops=-c -n Index cindex.idx cindex.tdx $(index_$*) \
+ -I $(srcdir) -I $(incdir) @MakeInfoNumbers@
+
+all: all_docs
+
+# I'm using .exe to avoid the sdg. under DOS.
+# I think Linux people can live with sdg.exe.
+sdh.exe: sdh.c
+ $(CC) -s -o $@ -O2 -I $(clheaders) $<
+
+%.inf: %.tx
+ ./sdh.exe -oi $(sdh_ops) -i $*
+
+%.txt: %.tx
+ ./sdh.exe -ot $(sdh_ops) -i $*
+
+%.html: %.tx
+ ./sdh.exe -oh $(sdh_ops) -i $*
+
+%.dvi: %.tx
+ ./sdh.exe -od $(sdh_ops) -i $*
+
+%.ps: %.tx
+ ./sdh.exe -op $(sdh_ops) -i $*
+
+# this is only a theoretical suffix only used to produce
+# .info .txt and .html with one rule
+%.doc: %.tx
+ ./sdh.exe -othi $(sdh_ops) -i $*
+
+# this is only a theoretical suffix only used to produce
+# all the available formats with one rule
+%.all: %.tx
+ ./sdh.exe -ohti $(sdh_ops) -i $*
+
+%.1: %.man
+ groff -man -Tascii $< > $@
+
+info: $(addsuffix .inf,$(targets))
+txt: $(addsuffix .txt,$(targets))
+html: $(addsuffix .html,$(targets))
+dvi: $(addsuffix .dvi,$(targets))
+ps: $(addsuffix .ps,$(targets))
+man: $(addsuffix .1,$(man_targets))
+
+all_suffixes=all doc inf txt html dvi ps
+
+$(foreach suffix,$(all_suffixes),$(addsuffix .$(suffix),$(targets))): sdh.exe
+
+text: txt
+
+all_docs: $(addsuffix .all,$(targets)) man
+
+doc: $(addsuffix .doc,$(targets))
+
+clean-docs:
+ rm -f $(addsuffix .inf,$(targets)) $(addsuffix .txt,$(targets)) \
+ $(addsuffix .html,$(targets)) $(addsuffix .dvi,$(targets)) \
+ $(addsuffix .ps,$(targets))
diff --git a/setedit/doc/infeng.tx b/setedit/doc/infeng.tx
new file mode 100644
index 0000000..5c686dc
--- /dev/null
+++ b/setedit/doc/infeng.tx
@@ -0,0 +1,307 @@
+\input texinfo @c -*-texinfo-*-
+@c Copyright (C) 1996-2001 by Salvador Eduardo Tropea.
+@c The first 75 lines configures all, the rest is the real doc.
+
+@comment %**start of header
+
+@setfilename infeng.info
+@set version 0.2.7
+@set update-date 22 September 2001
+@set update-month September 2001
+@set name-author Salvador Eduardo Tropea
+
+@set rh Robert H@value{ouml}hne
+@macro RH{}
+@value{rh}
+@end macro
+
+@settitle InfView v @value{version}
+@footnotestyle separate
+@paragraphindent asis
+@iftex
+@afourpaper
+@end iftex
+
+@comment %**end of header
+
+@c ---- Includes according to the output format
+@ifset html
+@include set.htm
+@clear text
+@end ifset
+
+@ifset text
+@include set.txt
+@clear html
+@end ifset
+
+@ifclear html
+@ifclear text
+@include set.txi
+@end ifclear
+@end ifclear
+
+@macro SSET{}
+@mail{@value{name-author},salvador@@inti.gov.ar}
+@end macro
+@set title-printed InfView
+@set minidesc-printed An info viewer
+@set year-copyr 1996, 1997, 1998, 1999, 2000, 2001
+@set info-file infview
+
+@c --------------------------------------------------------------
+@c Now we have 3 different headers:
+@c 1) For the printed manual, is called titlepage
+@c 2) For Info files
+@c 3) For HTML files
+@c I tried to automate it.
+@c --------------------------------------------------------------
+
+@set text-pre1 @ @ @ This document describes the use of InfView; this is a documentation browser designed to navigate info style docs.
+
+@set text-pre2 @ @ @ This documentation may be freely distributed with the InfView or the RHIDE package or any part thereof, provided this copyright notice is left intact on all copies.
+
+@set text-pre3 @ @ @ Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
+
+@HeaderPage1{}
+@ifinfo
+@ifset html
+@include infeng.ctx
+@end ifset
+@top INFVIEW
+@end ifinfo
+Use the cursor arrows to move the cursor over the link (yellow words) that
+you want and press @key{ENTER}.
+@paragraph{}
+Press @key{F5} to use all the available screen.
+@paragraph{}
+@HeaderPage2{}
+
+@chapter Features and motivation
+
+First time I used the info viewer from GNU I really hated it. I don't doubt
+that info is a powerful browser, but isn't so easy to use. The interface is
+unclear and isn't intuitive at all.
+@paragraph{}
+My first solution was to create a converter to translate the info files to the
+Norton Guides format. The program can be found in SimTelnet, but the problem
+is that this format have some limitations and you need a browser for it.
+Even when there are shareware browsers that's a problem.
+@paragraph{}
+So my next attempt was to make a browser like the one used by the Turbo Vision
+library. And the result was InfView. InfView provides a very easy to use
+interface without loosing power.
+@paragraph{}
+The main features of InfView are:
+@paragraph{}
+
+@itemize @bullet
+@item Free cursor movement with the keyboard arrows, page-up, etc.
+@item Mouse support.
+@item Highlighted cross references.
+@item Hide of the @code{*Note} and other confusing things of the info format.
+@item Previous, Next and Up node support.
+@item History support.
+@item Incremental search just typing the first letters of the cross reference.
+@item The same for the whole nodes list.
+@item Support for compressed info files. See @x{Compressed files,compressed files}.
+@item Search in the current node, the whole file or all the files.
+@item Bookmarks.
+@item History of the last 40 nodes visited.
+@item Dialog to browse the files on disk.
+@item and more
+@end itemize
+
+@chapter How to use InfView
+
+Available Keys:
+@paragraph{}
+
+@table2{Key,Action}
+@titemR{Arrows,Moves the cursor. Holding shift selects the text.}
+@titemR{Page Up,Previous page of the topic. Holding shift selects the text.}
+@titemR{Page Down,Next page of the topic. Holding shift selects the text.}
+@titemR{Home,Move cursor to the first column. Holding shift selects the text.}
+@titemR{End,Move cursor to the last character in the line. Holding shift selects the text.}
+@titemR{Ctrl+Right arrow,Next word. Holding shift selects the text.}
+@titemR{Ctrl+Left arrow,Previous word. Holding shift selects the text.}
+@titemR{Tab,Move to the next link (from the cursor position).}
+@titemR{Shift+Tab,Move to the previous link (from the cursor position).}
+@titemR{Alt+F1,Go to the last viewed topic.}
+@titemR{Ctrl+s,\@x\{Searching\,Search\}.}
+@titemR{Ctrl+l,Repeat the last search.}
+@titemR{Alt+F10,InfView \@x\{Control dialog\,control\}. dialog window.}
+@titemR{Ctrl+p,Go to the "previous" link.}
+@titemR{Ctrl+n,Go to the "next" link.}
+@titemR{Ctrl+u,Go to the "up" link.}
+@titemR{Ctrl+t,Go to the "top" link.}
+@titemR{Ctrl+d,Go to the directory.}
+@titemR{Ctrl+h,This help.}
+@titemR{Ctrl+g,\@x\{Jumping to any file or node\,GoTo\}.}
+@titemR{Ctrl+o,\@x\{Jumping to any node in the current file\,Jump to node\}.}
+@titemR{Alt+b,Goes to the \@x\{Bookmarks dialog\,Bookmarks\}. dialog.}
+@titemR{Ctrl+f,Goes to the \@x\{Configuration dialog\,Configuration\}. dialog.}
+@titemR{Alt+i,Copies the include name to the clipboard (for the libc help).}
+@titemR{1-9,Take the link 1 to 9.}
+@titemR{0,Take the last link available in that topic.}
+@titemR{a-z A-Z,Select the next link that starts with this letter. The editor uses
+an incremental search so you can type various letters until you reach the
+desired item}
+@endtable-{}
+
+@section Jumping to any file or node
+
+Go To Window:
+@paragraph{}
+
+You must enter the exact name of the topic that you want in the following
+format:
+@paragraph{}
+
+@example
+(file)node
+@end example
+
+For example: @code{(libc)printf} will go to the printf help.
+
+@section Jumping to any node in the current file
+
+This option will show you a window with all the nodes available in the
+current help file. You'll be able to select any of them and pressing @key{ENTER}
+you'll jump to that node.
+@paragraph{}
+The names are alphabetically sorted and pressing the first letters of the
+name of the node you'll be guided to the desired node.
+@paragraph{}
+
+@section Control dialog
+
+This dialog controls the navigation in InfView. The dialog contains the
+following buttons:
+@paragraph{}
+
+@table2{Button,Action}
+@titemR{Next,Moves to the next node in the help}
+@titemR{Previous,Moves to the previous node in the help}
+@titemR{Up,Moves one node up in the help's hierarchy}
+@titemR{Prev. Hist.,Goes to the previously visited node}
+@titemR{Nodes List,Shows a list of all the nodes to choose one}
+@titemR{Bookmarks,Goes to the \@x\{Bookmarks dialog\,Bookmarks\}. dialog}
+@titemR{Configuration,Goes to the \@x\{Configuration dialog\,Configuration\}. dialog}
+@titemR{Open Info,Opens a dialog to browse the disk and choose any file to load}
+@titemR{Hide,Hides the control dialog}
+@endtable-{}
+
+Additionally the dialog contains a list with the last 40 nodes visited, you
+can choose any of them with the mouse of the cursors.
+@paragraph{}
+
+@section Bookmarks dialog
+
+This dialog allows to save the names of the nodes that you use frequently. You
+can save as many node positions as you want and they will be restored next
+time you run the editor. The marks can be deleted from this window too.
+
+@section Configuration dialog
+
+This dialog configures how InfView shows the text in screen.
+@paragraph{}
+Currently there are two settings:
+@paragraph{}
+@enumerate
+@item
+Hide '*Note' word: It hides the note tag used make makeinfo to indicate a
+cross reference.
+@item
+Hide real link name: It makes visible only the comment about the node and no
+the real name of the node.
+@end enumerate
+
+By default both are enabled and gives a cleaner text.
+
+@section Searching
+
+InfView have various search options, these options are grouped in two
+sections. The first indicates how the search will be make:
+@paragraph{}
+
+@itemize @bullet
+@item Case sensitive: Makes the search sensitive to the upper/lower case characters.
+@item Whole words only: Force to match only if the whole word matchs.
+@end itemize
+
+The second indicates where to search:
+@paragraph{}
+
+@itemize @bullet
+@item In current topic: Only in the text of the current node.
+@item In the file: In all the nodes of the current help file.
+@item In all files: In all the files located in the INFO directory.
+@end itemize
+
+@chapter Compressed files
+
+InfView supports compressed info files. For that they must have one of the
+following extentions @code{igz}, @code{gz}, @code{info.gz} or @code{inz}.
+Additionally they must be compressed with GNU's gzip and gzip must be
+installed in your system and in your search path.
+@paragraph{}
+Compressing the files under Linux or Windows 95 (with LFN=Y) is relative easy
+because you only need to compress the files and they will have the @code{gz}
+extention added. Under plain DOS is a little harder because a file called
+@code{file.i10} will become @code{file.i1z} and will have the same name as
+a compressed file that had the following name @code{file.i1}. To fix that you
+must first rename the files to have the following format: @code{file.nn}.
+Then you must edit the first file to fix the @code{Indirect} table to reflect
+the changes.
+@paragraph{}
+
+@chapter About the Author
+
+@my-flag{}
+
+InfView was made by Salvador Eduardo Tropea (SET), with the help of Robert
+H@value{ouml}hne.
+@paragraph{}
+
+@display
+E-Mail: @SSET{}
+
+Telephone: (+5411) 4759-0013
+Postal Address:
+Salvador E. Tropea
+Curapalig@value{uuml}e 2124
+(1678) Caseros - 3 de Febrero
+Prov: Buenos Aires
+Argentina
+@end display
+@paragraph{}
+
+@my-flag{}
+
+@chapter Greetings
+@itemize @bullet
+@item
+To all the people who have contributed with DJGPP and GNU projects.
+@item
+Specially to:
+@itemize @bullet
+@item
+DJ Delorie (DJGPP's motor).
+@item
+Robert H@value{ouml}hne (RHIDE).
+@item
+Eli Zaretskii (FAQ's maintainer and djgpp patchman).
+@item
+Charles Sandsman (CWSDPMI's author).
+@item
+Laszlo Molnar (UPX's author sorry ML for the reverse order ;-).
+@item
+Marek Habersack (don't worry the position was random).
+@end itemize
+@item
+To all the people of DJGPP's list.
+@end itemize
+
+@bye
+
diff --git a/setedit/doc/infview.man b/setedit/doc/infview.man
new file mode 100644
index 0000000..d0712a2
--- /dev/null
+++ b/setedit/doc/infview.man
@@ -0,0 +1,98 @@
+.\" Process this file with
+.\" groff -man -Tascii infview.man
+.\"
+.TH INFVIEW 1 "SEPTEMBER 2001" "v0.2.7"
+.SH NAME
+infview \- an info files viewer
+.SH SYNOPSIS
+.B "infview ["
+.I options
+.B "]... ["
+.I info_file
+.B [
+.I menu_item
+.B "...] ]"
+.SH DESCRIPTION
+.B InfView
+is a good replacement for the info-stantalone program. The main
+objetive of InfView is to give to the user a friendly and easy to learn tool
+to browse the documentation found in info format. This format is used by the
+FSF for all the major tools and of course is used by djgpp.
+.PP
+This man page just describes the command line options for
+.B InfView
+for more details consult the on\-line help.
+.PP
+The command line options are intentionally similar to the ones provided by
+.BR info(1).
+The first argument, if present, is the name of the Info file to read.
+Any remaining arguments are treated as the names of menu items in the
+initial node visited. Also note that info files are searched in the
+.B INFOPATH
+directories. To load a file stored in the current directory add ./ at the
+beginning of the name.
+.PP
+.B InfView
+saves the position of the windows, which info files are open, the history of
+visited nodes, bookmarks, etc. in a desktop file. If you invoke the program
+again without specifying any info file in the command line the desktop file
+is loaded recreating the last session. If you specify an info file the
+desktop file won't be loaded. In any case the current situation is stored at
+exit.
+.SH OPTIONS
+.IP "-d, --directory DIR"
+Adds a directory to the list of directories to search. In other words adds
+DIR to INFOPATH.
+.IP "-f, --file FILENAME"
+Load FILENAME info file. When you provide a file name in the command line
+only this file is loaded, otherwise the program remmembers what file/s were
+opened and opens these files again.
+.IP "-k, --use-rh-52-keys"
+.B "[Only for Linux]"
+Enables the Red Hat 5.2 style keyboard mapping. That's needed if you are
+experimenting some strange function keys behavior. Some keyboard mapping
+files redefines the function key numbers in a good way but really
+incompatible with the old way. I first found it in Red Hat 5.2.
+.IP "-l, --force-no-lfn"
+.B "[Only for DOS]"
+Avoids the use of long file names under W9x. Even if the
+.B LFN
+environment variable says the reverse.
+.IP "-L, --force-lfn"
+.B "[Only for DOS]"
+Forces the use of long file names under W9x. Even if the
+.B LFN
+environment variable says the reverse.
+.IP "-n, --node NODE"
+Automatically jumps to this node.
+.IP "-r, --read-dkt FILENAME"
+If no info file is specified use this desktop file. In this way you can
+retreive the exact configuration you were using before. It includes: opened
+files, history of visited nodes, bookmarks, etc.
+.IP "-s, --save-dkt FILENAME"
+Saves the configuration at exit to the specified file. You can use the
+.I \-r
+option to load it next time.
+.IP "-h, --help"
+Displays the command line options of the editor.
+.SH EXAMPLES
+.SB Linux
+.IP "info libc 'function index' printf"
+Moves to the node `Function Index' and then to `printf' in the info file
+called `libc'.
+.PP
+.SB DOS
+.IP "info libc alpha printf"
+Moves to the node `Alphabetical list' and then to `printf' in the info file
+called `libc'.
+.SH FILES
+.I "./.desktop.dkt ~/.desktop.dkt ./desktop.dkt /usr/share/infview"
+.I %DJDIR%/share/infview
+.RS
+Default desktop file.
+.SH ENVIRONMENT
+.IP INFOPATH
+Indicates where help files in info format are located. If not defined the
+program will guess the location.
+.SH AUTHOR
+Salvador Eduardo Tropea <salvador@inti.gov.ar>
diff --git a/setedit/doc/install/bcc.txt b/setedit/doc/install/bcc.txt
new file mode 100644
index 0000000..bd7b327
--- /dev/null
+++ b/setedit/doc/install/bcc.txt
@@ -0,0 +1,64 @@
+ This file describes how to compile the editor for Win32 systems using
+Borland C++ 5.5 free command line tools. Optionally you can use the BorlandC
+Builder 6 for it, that's compiler version 5.6. But I can do periodical tests
+only with the former. If you want to volunteer to periodically test the code
+with other versions please let me know.
+
+$Id: bcc.txt,v 1.2 2004/06/09 15:08:34 set Exp $
+
+1. INTRODUCTION
+2. HOW TO COMPILE
+
+
+
+1. INTRODUCTION
+
+ The tools can be downloaded from internet without charge. Note: BorlandC
+Builder 6 also have a trial I used to fix some issues, but it have a limited
+time usage.
+ This target is periodically tested for compilation but not much tested for
+functionality.
+ You can compile the editor to run under Win32 platforms using various
+compilers, for this reason I explain the dis/advantages of using BC++ 5.5 for
+it.
+
+Advantages:
+
+* Unlike djgpp it generates a Win32 executable, so it integrates better with
+Windows NT incarnations (NT, 2000, XP, etc.).
+* The resulting binary doesn't need special DLLs.
+* BC++ 5.5 compiles really fast.
+* You don't need a lot of GNU tools, just the BC++ package distributed by
+Borland.
+* The environment is very well controlled. If you have BC++ 5.5 free command
+line tools it should compile without any problems.
+
+Disadvantages:
+
+* I don't use the resulting binary too much so it is more probable to find
+bugs not found in the same version compiled with other compilers.
+* BC++ 5.5 is quite inferior when compared with gcc in terms of code
+optimization.
+* This target can't run the configure script so you can't fine tune the
+process.
+* The installation isn't automated.
+
+
+
+2. HOW TO COMPILE
+
+ Currently I'm in a middle of a transition between an old mechanism and a
+new one (may 2003) so I'll give information about both mechanism.
+ Note: The new one seems to work OK (june 2004).
+
+A) The new mechanism:
+
+ Run "make -f Makefile.bcc" this should create two executables in the makes
+directory. They are called editor.exe and infview.exe.
+
+B) The old mechanism:
+
+ Instructions about it are contained in the WinNT directory. WinNT/README
+
+
+
diff --git a/setedit/doc/install/cygwin.txt b/setedit/doc/install/cygwin.txt
new file mode 100644
index 0000000..6f6d0ac
--- /dev/null
+++ b/setedit/doc/install/cygwin.txt
@@ -0,0 +1,54 @@
+ This file describes how to compile the editor for Win32 systems using
+GNU tools as provided by Cygnus' Cygwin package (Cygnus is currently part of
+Red Hat).
+
+$Id: cygwin.txt,v 1.1 2003/06/17 13:09:25 set Exp $
+
+1. INTRODUCTION
+2. COMPILING
+
+
+1. INTRODUCTION
+
+ Cygwin provides a POSIX environment for Win32 systems based on GNU tools.
+It makes quite easy to compile programs adapted for GNU tools. In order to
+compile this package you have to install the tools listed in
+doc/install/tools.txt
+ A short list of the needed tools is:
+ bash, binutils, fileutils, gcc, gpp, gettext, make, perl, shellutils,
+texinfo and textutils.
+ I experimented some bizarre problems while using Perl from Cygwin
+distribution so I switched to the version distributed by djgpp package. You
+can find information about djgpp in: http://www.delorie.com/djgpp/
+ I hope this problems are fixed in a newer version of Cygwin tools but
+lamentably I don't have time to test it. Volunteers will be welcome.
+ Some users reported success using the UNIX tarball instead of the .zip
+file. But I think it depends on the way you configured Cygwin.
+ You can compile the editor to run under Win32 platforms using various
+compilers, for this reason I explain the dis/advantages of using Cygwin for
+it.
+
+Advantages:
+
+* Unlike djgpp it generates a Win32 executable, so it integrates better with
+Windows NT incarnations (NT, 2000, XP, etc.).
+* GCC is very good optimizing code.
+* You can use the configure script to fine tune the compilation process.
+* The installation is automated.
+
+Disadvantages:
+
+* The resulting binary needs a special DLLs provided by Cygwin.
+* The available compiler and the whole tools are really slow. GCC 3.x is too
+slow to compile C++ and the Win32 port is even worst.
+* I don't use the resulting binary too much so it is more probable to find
+bugs not found in the same version compiled with other compilers.
+
+
+2. COMPILING
+
+ Once you installed all the needed tools your system will become some kind
+of GNU/Win32 system. For this reason you can just follow the instructions found
+in doc/install/unix.txt
+ I tested this process using Cygwin 1.3.3-2.
+
diff --git a/setedit/doc/install/djgpp.txt b/setedit/doc/install/djgpp.txt
new file mode 100644
index 0000000..b596930
--- /dev/null
+++ b/setedit/doc/install/djgpp.txt
@@ -0,0 +1,133 @@
+ This file describes how to compile the editor for DOS (djgpp) systems using
+GNU tools. You have to install a quite complete djgpp environment, you can
+download it from: http://www.delorie.com/djgpp/
+
+$Id: djgpp.txt,v 1.2 2003/06/17 13:09:25 set Exp $
+
+1. INTRODUCTION
+2. COMPILING
+3. DJGPP 2.02 OPTIONAL PATCH
+
+
+1. INTRODUCTION
+
+ DJGPP provides a quite POSIX compliant environment for DOS systems. It is
+based on GNU tools. In order to compile this package you have to install the
+tools listed in doc/install/tools.txt
+ A short list of the needed tools is:
+ binutils, fileutils, gcc, gpp, gettext, make, perl, shellutils, texinfo and
+textutils.
+ If you want to create the .zip files containing the distribution of the
+package you'll need more tools:
+ cwsdpmi, gzip, libwin, un/zip and upx.
+ More detailed information can be found in the above mentioned text.
+
+ We compiled the editor using DJGPP 2.01, 2.02 and 2.03. Older versions
+won't work. The 2.01 version have some bugs that affect this package so I
+suggest a newer version.
+
+2. COMPILING
+
+ Once you installed all the needed tools your system will become some kind
+of GNU/DOS system. For this reason you can just follow the instructions found
+in doc/install/unix.txt The only difference is that you'll have to invoke the
+configure.bat file instead of configure script, but as you don't have to type
+the extension it looks almost the same as in UNIX:
+
+c:\djgpp\contrib\tvision>configure
+
+3. DJGPP 2.02 OPTIONAL PATCH
+
+ DJGPP v2.02 have a bug in the system/spawn family of functions. They leak a
+file handle and, which is worst, they left the file you execute open if
+that's a regular .exe (not another djgpp program). It could be very annoying
+for people using the editor as some kind of IDE for a compiler that generates
+executables and you run them from the editor. I discovered this bug when a
+user ("Andreas Leidner" <leidner@gmx.net>) used the editor as IDE for Turbo
+Pascal 7.
+ Here is a patch to fix this problem, you must patch the libc:
+
+--------------------- start of patch
+--- chkv2prg.c~ Thu Oct 9 22:40:02 1997
++++ chkv2prg.c Sat Sep 25 14:34:38 1999
+@@ -30,7 +30,10 @@
+
+ lseek(pf, 0, SEEK_SET);
+ if (read(pf, header, sizeof(header)) != sizeof(header))
++ {
++ close(pf);
+ return &type;
++ }
+ if (header[0] == 0x010b || header[0] == 0x014c)
+ {
+ unsigned char firstbytes[1];
+@@ -64,9 +67,15 @@
+ coff_start += (long)header[1] - 512L;
+ exe_start = (unsigned long)header[4]*16L;
+ if (lseek(pf, exe_start, SEEK_SET) != exe_start)
++ {
++ close(pf);
+ return &type;
++ }
+ if (read(pf, go32stub, 8) != 8)
++ {
++ close(pf);
+ return &type;
++ }
+ go32stub[8] = 0;
+ if (strcmp(go32stub, "go32stub") == 0)
+ {
+@@ -82,30 +91,51 @@
+ unsigned short coff_id;
+ type.version.v.major = 1;
+ if (lseek(pf, coff_start - 4, SEEK_SET) != coff_start-4)
++ {
++ close(pf);
+ return &type;
++ }
+ if (read(pf, &stub_offset, 4) != 4)
++ {
++ close(pf);
+ return &type;
++ }
+ if (read(pf, &coff_id, 2) != 2)
++ {
++ close(pf);
+ return &type;
++ }
+ if (coff_id == 0x010b || coff_id == 0x014c)
+ {
+ type.object_format = _V2_OBJECT_FORMAT_COFF;
+ type.exec_format = _V2_EXEC_FORMAT_STUBCOFF;
+ }
+ if (lseek(pf, stub_offset, 0) != stub_offset)
++ {
++ close(pf);
+ return &type;
++ }
+ if (read(pf, magic, 16) != 16)
++ {
++ close(pf);
+ return &type;
++ }
+ if (memcmp(STUB_INFO_MAGIC, magic, 16) == 0)
+ {
+ if (read(pf, &struct_length, 4) != 4)
++ {
++ close(pf);
+ return &type;
++ }
+ type.stubinfo = (_v1_stubinfo *)malloc(struct_length);
+ memcpy(type.stubinfo->magic, magic, 16);
+ type.stubinfo->struct_length = struct_length;
+ if (read(pf, type.stubinfo->go32, struct_length - 20)
+ != struct_length - 20)
++ {
++ close(pf);
+ return &type;
++ }
+ type.has_stubinfo = 1;
+ }
+ }
+--------------------- end of patch
+
diff --git a/setedit/doc/install/linux.txt b/setedit/doc/install/linux.txt
new file mode 100644
index 0000000..cbf32fe
--- /dev/null
+++ b/setedit/doc/install/linux.txt
@@ -0,0 +1,47 @@
+ This file describes how to compile the editor for Linux systems using
+GNU tools. So you need a GNU/Linux environment, this is provided by all Linux
+distributions I know even when their name doesn't clearly denote they are
+GNU/Linux distros.
+
+$Id: linux.txt,v 1.2 2006/03/15 17:19:56 set Exp $
+
+1. INTRODUCTION
+2. MANUAL MECHANISM
+3. SYSTEMS BASED ON .DEB FILES (DEBIAN GNU/LINUX)
+4. SYSTEMS BASED ON .RPM FILES (REDHAT, SUSE, MANDRAKE)
+5. DEBUG SUPPORT
+
+
+1. INTRODUCTION
+
+ Most Linux distributions have some package system, is much better if you
+create the packages first and then install them. This is because then you can
+uninstall the files or install the binaries in another machine that runs the
+same distribution.
+ Currently the editor have scripts to generate packages for distributions
+based on .deb and .rpm packages. For other distributions you should follow
+the "manual" mechanism.
+ For a list of tools and libraries you should have in your system please read
+the doc/install/tools.txt file.
+
+2. MANUAL MECHANISM
+
+ Follow the instructions found in the doc/install/unix.txt file.
+
+3. SYSTEMS BASED ON .DEB FILES (DEBIAN GNU/LINUX)
+
+ Follow the instructions found in the debian/README file.
+
+4. SYSTEMS BASED ON .RPM FILES (REDHAT, SUSE, MANDRAKE)
+
+ Follow the instructions found in the redhat/README file.
+ Note: As the script to generate the RPM files doesn't check for errors I
+recommend trying to follow the "manual" mechanism but skip the installation
+procedure. Once you are sure all compiles perfectly for your system then try
+this procedure.
+
+5. DEBUG SUPPORT
+
+ Linux is the only platform where debug support was tested. To enable debug
+support download libmigdb from http://sourceforge.net/projects/libmigdb/
+
diff --git a/setedit/doc/install/mingwin.txt b/setedit/doc/install/mingwin.txt
new file mode 100644
index 0000000..4a5d505
--- /dev/null
+++ b/setedit/doc/install/mingwin.txt
@@ -0,0 +1,51 @@
+ This file describes how to compile the editor for Win32 systems using
+GNU tools as provided by MinGW package (aka MingWin, MinGW32, etc.).
+
+$Id: mingwin.txt,v 1.1 2003/06/17 13:09:25 set Exp $
+
+1. INTRODUCTION
+2. COMPILING
+
+
+1. INTRODUCTION
+
+ MinGW needs the help of MSys and a Perl interpreter to compile this
+package. I tested it using MinGW 2.0.0, MSys 1.0.8 and the Siemens Perl port
+(SiePerl). This provides a good environment for compilation. You must ensure
+that MSys' make is used because MinGW 1.1 ships a make command that fails. I
+think newer versions doesn't have this problem.
+ IMPORTANT! the resulting application can't be run from the MSys console,
+use a DOS console or just start it as any Windows application.
+ You have to ensure that /bin/sh exists or at least create a symlink to bash
+there. If it isn't there you won't be able to run the shell scripts.
+ You can compile the editor to run under Win32 platforms using various
+compilers, for this reason I explain the dis/advantages of using Cygwin for
+it.
+
+Advantages:
+
+* Unlike djgpp it generates a Win32 executable, so it integrates better with
+Windows NT incarnations (NT, 2000, XP, etc.).
+* GCC is very good optimizing code.
+* You can use the configure script to fine tune the compilation process.
+* The installation is automated, but only if you intend to use the editor in
+a UNIX fashion.
+* The resulting binary doesn't need special DLLs.
+* All the needed tools are concentrated in a few packages you have to
+download.
+
+Disadvantages:
+
+* The available compiler and the whole tools are really slow. GCC 3.x is too
+slow to compile C++ and the Win32 port is even worst.
+* I don't use the resulting binary too much so it is more probable to find
+bugs not found in the same version compiled with other compilers.
+
+
+2. COMPILING
+
+ Once you installed all the needed tools your system will become some kind
+of GNU/Win32 system. For this reason you can just follow the instructions found
+in doc/install/unix.txt
+ I recommed configuring the package with --no-intl.
+
diff --git a/setedit/doc/install/msvc.txt b/setedit/doc/install/msvc.txt
new file mode 100644
index 0000000..a48405c
--- /dev/null
+++ b/setedit/doc/install/msvc.txt
@@ -0,0 +1,30 @@
+ This file describes how to compile the editor for Win32 systems using
+Microsoft Visual C compiler. Note that I don't have it and Microsoft doesn't
+offer reduced versions for free like Borland does. For this reason this
+target ever lags behind. I need volunteer to test this target periodically.
+
+$Id: msvc.txt,v 1.1 2003/06/17 13:09:25 set Exp $
+
+1. INTRODUCTION
+2. HOW TO COMPILE
+
+
+
+1. INTRODUCTION
+
+ This target is supported because users helped to make it possible. If you
+find any problem just do the same the other users did: help to fix them.
+ You can also create Win32 versions of this package using BorlandC Builder,
+Cygwin or MinGW.
+ Versions 5.0, 6.0 and 7.0 compiled the code.
+
+2. HOW TO COMPILE
+
+ I'm trying to unify the compilation process but I need volunteers to help
+testing the new MSVC makefiles. For this reason you should use the old
+mechanism explained in WinNT/README
+ The WinNT/Makefile.nmk file contains the information needed to create the
+executable just use it with nmake.
+ If you want to help with the unified mechanism try using the Makefile.nmk
+file located in the main directory and inform me where it fails.
+
diff --git a/setedit/doc/install/tools.txt b/setedit/doc/install/tools.txt
new file mode 100644
index 0000000..df6ced2
--- /dev/null
+++ b/setedit/doc/install/tools.txt
@@ -0,0 +1,233 @@
+ This file gives a list of tools and libraries you used by the editor. The
+list isn't complete so please report any missing stuff.
+ The list is oriented to systems using the GNU tools, not for Borland and
+Miscrosoft environments.
+ IMPORTANT! most Linux systems have the needed libraries installed but
+rarely have the headers installed. They are provided in separated packages
+intended for development (XXXX-dev).
+
+TOOLS
+=====
+
+Binutils:
+---------
+
+ They include the linker and assembler. They must be the GNU versions.
+
+Compiler:
+---------
+
+ The code was compiled with GCC 2.7.x, 2.8.x, 2.95.x, egcs 1.x, 3.x and may
+be other versions. As I can't have systems with all of them I can't be sure
+all of them can be currently used.
+ I suggest gcc 2.8.1 or newer because 2.7.2 had some bugs in the C++ library
+and its workaround could go away soon.
+ I don't recommend gcc 2.9.6 nor egcs 1.x because these compilers have too
+much bugs. Workarounds for these problems were created but as I don't have
+these compilers new code could break. I recommend using a more stable
+compiler.
+ The gcc 2.95.x compilers gave me very good results.
+ The code cleanly compiled with gcc 3.0, 3.1.x, 3.2.x and 3.3 but each
+release of gcc 3.x likes to break something in the C++ stuff so be patient
+and report any problems. One particular detail is that gcc 3.x is much more
+slower than gcc 2.95.x when compiling C++ code. This is because the standard
+C++ library now follows the ISO 1998 standard much more closely and hence
+does a heavy use of templates, it looks like gcc 3.x performance to compile
+such a code is really bad.
+ At the moment of this writing (june 2003) my recommendation is gcc 2.95.4.
+
+bzip2:
+------
+
+ Optionally (configuration option) used to create the tarball distributions.
+
+cwsdpmi:
+--------
+
+ Optional. Only needed to create the optional DOS installer.
+ The cwsdpmi (DPMI Host for DOS) can be downloaded from:
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/
+
+fileutils:
+----------
+
+ They are rm, cp, mv, etc. and all UNIX systems have them. DJGPP users must
+install them.
+
+gettext:
+--------
+
+ Needed for internationalization. They aren't mandatory. Note: this is one
+of those packages that likes to break its API.
+ Note: Solaris provides its own implementation but it isn't supported.
+
+gzip:
+-----
+
+ Used only to create the tarball distributions.
+
+make:
+-----
+
+ Obviously mandatory. You must install GNU make, other make tools aren't
+enough. The executable can be called gmake to avoid collisions with the
+native make tool.
+
+Perl:
+-----
+
+ The configuration script and others are Perl scripts, you'll need Perl
+5.x. I strongly recommend using it even when the tarball and zip files
+usually contains preconfigured sources that will compile out-of-the-box in
+many systems.
+
+PMODE/DJ:
+---------
+
+ This is optional and only used to create the optional DOS installer. Even
+in this case the package is not used by default.
+ The pmodstub (PMODE/DJ stub) can be downloaded from:
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/
+
+RHIDE:
+------
+
+ RHIDE users can configure the package and the compile it using the RHIDE
+projects. But you'll need a really new RHIDE, some times even from CVS. So I
+no longer recommend using RHIDE unless you are going to debug or modify the
+code.
+ At the moment of this writing (june 2003) I use RHIDE 1.5 from CVS.
+
+shellutils:
+-----------
+
+ They are pwd, uname, etc. and all UNIX systems have them. DJGPP users must
+install them.
+
+tar:
+----
+
+ Used only to create the tarball distributions.
+ Note: not all tar implementations are usable, get GNU tar if you have
+problems with it.
+
+Texinfo:
+--------
+
+ This is needed to create the on-line documentation. I tested versions newer
+than 3.9. Lamentably that's a tools that likes to change the API introducing
+very bad incompatibilities so please report any problems.
+ At the moment of this writing (june 2003) the last version known to work is
+4.5.
+ Note for Debian GNU/Linux Potato: I found that makeinfo (the program needed
+to create the docs) is located in a very strange package in Debian
+distributions, I think is inside the Tetex package, as that's huge I just
+extracted the needed file.
+
+TeX:
+----
+
+ Only needed if you want to create the documentation in postscript format.
+ This isn't used by the regular make procedure.
+
+textutils:
+----------
+
+ They are cat, split, etc. and all UNIX systems have them. DJGPP users must
+install them.
+
+UPX:
+----
+
+ This is optional. You'll need it if you want to create a compressed
+executable or create the optional DOS installer.
+ It can be downloaded from http://upx.sf.net/
+
+
+LIBRARIES
+=========
+
+Allegro:
+--------
+
+ Currently useful only for DOS. Versions 3.1 and newer are ok.
+ This library is used for sound support. Without it you won't get MP3
+support.
+ It's also used to create the optional DOS installer. In this case you must
+be sure that the dat and exedat Allegro tools are in the path.
+
+bzlib:
+------
+
+ This library provides support for bzip2 compressed text and help files. The
+source tree includes a version of bzlib known to work with the editor. You
+don't need to install zlib but UNIX systems will take advantage of dynamic
+libraries if you have it installed in your system. I tested versions 0.9.5d
+and newers.
+
+gpm:
+----
+
+ It provides mouse functionality for the Linux console. I tested versions
+1.13, 1.14, 1.17.x and 1.19.x.
+ Note: binaries compiled with a version usually fails to work if you change
+the gpm daemon version.
+
+libwin:
+-------
+
+ Optional. Needed only to create the optional DOS installer.
+ libwin 0.1.2 by Richard Dawe and RegDos Group:
+ http://www.bigfoot.com/~richdawe/
+
+ncurses:
+--------
+
+ This is mandatory for UNIX systems where the X11 isn't available. But is
+recommended for all UNIX systems because it is used when the terminal isn't
+known. Versions 3.4 and newer were used. I remmember also testing with 4.2,
+5.0, 5.2 and 5.3.
+ Note: none of the listed versions compiles ok using gcc 3.3 and -Wall
+because the headers contains chars as array indexes.
+
+PCRE:
+-----
+
+ This is the Perl Compatible Regular Expressions library. It isn't mandatory
+and the source tree provides a version of the library known to work with the
+editor. It adds support for Perl regular expressions and user configurable
+error parsers. Versions newer than 2.0.7 were tested.
+ UNIX systems: I recommend installing it at system level to take advantage
+of dynamic libraries.
+
+Turbo Vision:
+-------------
+
+ You have to get a version that was released around the date of release of
+this package. If you are compiling SETEdit from CVS get TV also from CVS.
+ The configuration script checks if TV is ok, but the test will only reject
+versions older than the needed. A newer version could be incompatible with
+the editor.
+ If you experiment problems get the version listed in config.pl, example:
+
+$TVVersionNeeded='2.0.2';
+
+X libraries:
+------------
+
+ They are needed to create a UNIX application that can connect to an X
+server and provide a good text emulation. It works even better than the
+ncurses driver. That's a must for UNIX systems with X11 installed.
+ CygWin also provides X11 under Win32 systems. This is just a curiosity and
+the editor supports it. When I tested it the performance was really poor but
+the editor was functional.
+
+ZLib:
+-----
+
+ This library provides support for gzip compressed text and help files. The
+source tree includes a version of zlib known to work with the editor. You
+don't need to install zlib but UNIX systems will take advantage of dynamic
+libraries if you have it installed in your system. I tested versions 1.1.2
+and newers.
+
diff --git a/setedit/doc/install/unix.txt b/setedit/doc/install/unix.txt
new file mode 100644
index 0000000..a4954e4
--- /dev/null
+++ b/setedit/doc/install/unix.txt
@@ -0,0 +1,123 @@
+ This file describes how to compile the editor for UNIX systems using
+GNU tools. I personaly use "Debian GNU/Linux" but the code successfuly
+compiled for Darwin, FreeBSD, NetBSD, OpenBSD, QNX and Solaris.
+Instructions specific for Linux systems can be found in the
+doc/install/linux.txt but this instructions are also valid for Linux and
+in fact the Linux file refers to this one for the "manual" installation
+mechanism.
+
+$Id: unix.txt,v 1.2 2004/10/08 14:51:32 set Exp $
+
+1. INTRODUCTION
+2. IMPORTANT NOTE
+3. CONFIGURING
+4. COMPILING
+5. INSTALLING
+
+
+1. INTRODUCTION
+
+ FreeBSD systems seems to have all the needed GNU tools (GNU/FreeBSD ;-).
+FreeBSD details were contributed by Andrew 'Onyx' Shevtsov (miniEleph)
+<nyxo@dnuc.polyn.kiae.su>.
+ NetBSD and OpenBSD machines that I tested at Source Forge Compile Farm
+also have GNU tools available.
+ Darwin is the core of MacOS X 10.x, it have some bizarre GNU tools modified
+by Apple. So even when Darwin is an *BSD system it is a little bit
+complicated. The code included in the 2.0.3 release compiled ok.
+ QNX systems are a little bit more problematic but they also contain the
+needed tools. QNX details were contributed by Mike Gorchak <mike@malva.ua>.
+ Solaris doesn't have all the needed GNU tools so you must get them from
+internet. You should get at least make, gcc/g++ and perl, I'm not sure what
+else is needed. I have a Solaris 2.7 (Ultra 60 machine) at work with the
+needed tools installed. I also succeed using Solaris 9 at Source Forge.
+ I failed to compile using Tru64 (OSF1) v5.1b. The installed GNU
+tools (from a package identified as TWWfsw with gcc 3.3r) have some major
+limitations: 1) The native assembler (as) is wrongly called by gcc and it
+gets the code without preprocessing. 2) Complex tree structures as declared
+in keyval.cc generates invalid assembler. 3) Pure C++ code that doesn't
+include the Standard C++ library headers doesn't compile, libmigdb is an
+example. 4) unistd and stdio defines a macro in different way. That's invalid
+for C++ code (cusedid or something like this). If these "limitations" are
+fixed you'll be able to compile ;-)
+ If you are dealing with other UNIX box the first step will be to get the
+most common GNU tools used for development and then start trying. Contact me
+if you need help or want to contribute changes needed to compile for your
+UNIX box.
+ For a list of tools and libraries you should have in your system please read
+the doc/install/tools.txt file.
+
+2. IMPORTANT NOTE
+
+ I noticed that a lot of UNIX machines that have GNU tools installed are
+wrongly configured. Here are some details you must check:
+
+A) The PATH must include the directory where GNU tools are installed. Some
+times the tools aren't installed in the same directory. So you have to
+double check that all the tools can be started without specifying its full
+path. Example (bash):
+$ export PATH=$PATH:/usr/local/bin
+
+B) All the support libraries must be in the linker path. This can be
+configured at system level or just using the LD_LIBRARY_PATH environment
+variable. I saw too much systems where you can't even create a simple C++
+program because the libraries aren't in the linker path. Example (bash):
+$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/TWWfsw/gcc33r/lib
+
+3. CONFIGURING
+
+ The first step is the configuration, this is a Perl script so you must have
+Perl in your system:
+
+$ ./configure
+
+ This script will inform you what was found in your system and what wasn't.
+If the missing component is vital the script will stop. Read the output of
+the script carefuly. Unlike the traditional configure scripts created by GNU
+autoconf this script doesn't print useless information (like if your system
+have 20 of the string functions needed), so the output is not too big.
+ If your system and/or CPU can't be detected please take a look at the
+conflib.pl file. The DetectOS function determines the OS using the output of
+uname command. The DetectCPU function determines the CPU by actually
+compiling a small program with conditionals for all the architectures I
+currently tested. If you need to add something there just contact me.
+ If the script fails install the missing component and run it again. If
+optional components are missing the script will suggest installing them.
+ Once you successfuly configured the package you can go to the next step.
+ If you want to change any of the default compilation options run:
+
+$ ./configure --help
+
+ It will inform all the available options. The --prefix=... is something you
+could want to use.
+ If you want to make changes to the code and contribute to the project I
+recommend configuring the editor using the same options I use:
+
+$ ./configset
+
+ This enables some maintainance stuff that you'll need for development. The
+most important detail are header dependencies.
+
+4. COMPILING
+
+ Just use the make command. If your system must use gmake the configureation
+will inform it.
+ The makefile have various targets so you can compile the editor, infview
+and libset individually. It also contains targets to create the distribution
+(distrib) and cleaning (clean).
+
+5. INSTALLING
+
+ Use the install target, you'll most probably need to switch to "root" to
+run this step:
+
+# make install
+
+ You can change the destination prefix using:
+
+# make prefix=/path_you_want install
+
+ But I recommend doing it during the configuration step because in this way
+the code will search for configuration files in the desired destination and
+you won't need to define the SET_FILES environment variable.
+
diff --git a/setedit/doc/line.par b/setedit/doc/line.par
new file mode 100644
index 0000000..0af2697
--- /dev/null
+++ b/setedit/doc/line.par
@@ -0,0 +1 @@
+-ot -i sdg -c -n Index cindex.idx cindex.tdx -n "Index of variables and commands" vindex.idx vindex.tdx -I .
diff --git a/setedit/doc/readme.1st b/setedit/doc/readme.1st
new file mode 100644
index 0000000..3513210
--- /dev/null
+++ b/setedit/doc/readme.1st
@@ -0,0 +1,31 @@
+That's a generic readme for all the people that will receive the package:
+
+ That's the documentation for the SET's editor and the SET's Documentation
+Generator.
+ The files are generated with a program called sdh copyrighted by me, but
+now it is GPLed so you can use it freelly.
+ In addition you'll need the GNU's makeinfo from txi390b.zip or similar and
+the make program (you can make all without it but is harder).
+ To generate DVI files you need the TeX package.
+ To generate PS files you need dvips (Part of the TeX distribution).
+
+ To create the documentation in any of the formats use:
+
+ make [info] [html] [txt] [dvi] [ps] [all] [doc]
+
+ Using `all' you'll get all the formats.
+ Using `doc' you'll get all info, html and txt formats.
+
+ SDH is called with -c by the makefiles, that means that SDH deletes the
+temporal files. Only one file isn't deleted and is the log file generated by
+TeX.
+ If some error occurs SDH will let the temporal files so you can see where
+the error is.
+
+ I need to add some features to SDH and perhaps it can be another utility,
+but by now is only to make these docs. Tell me if you think releasing SDH is
+or not a good idea.
+ SDH is helped by some files copyrighted by: Robert Hhne, Eli Zaretskii and
+Brian J. Fox.
+
+SET
diff --git a/setedit/doc/rhidemac.htm b/setedit/doc/rhidemac.htm
new file mode 100644
index 0000000..38726d3
--- /dev/null
+++ b/setedit/doc/rhidemac.htm
@@ -0,0 +1,475 @@
+@c rhidemac.htm: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making RHIDE documentation in HTML format.
+@c
+@c Author: Robert Hhne (robert.hoehne@gmx.net)
+@c November 1996.
+@c
+@c Derived from 'faqmacros.txi', which is part of DJGPP FAQ written
+@c by Eli Eli Zaretskii (eliz@is.elta.co.il)
+@c
+@c Many ideas taken from files `multifmt.texi' and html.texi'
+@c written by Brian J. Fox and distributed with GNU Texinfo archive:
+@c
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@c
+@c -------------------------------------------------------------------------
+
+@c
+@c This creates a standard HTML prolog.
+@c
+@macro htmlstart
+<html>
+
+<pre>
+
+<!--- This HTML file has been created by Texinfo from ---------
+------- rhide.txi, using a special set of macros from ---------
+---- `rhidemac.txi' on @today{}.
+
+---- Please don't look at it but through your Web browser: ---
+---- it looks ugly and ain't supposed to be read by humans. ---
+---- You HAVE been warned! --->
+
+</pre>
+@end macro
+
+@c
+@c TITLEs for HTML
+@c
+@macro htmltitle{line}
+<head>@*
+@w{<TITLE> \line\ </TITLE>}@*
+</head>@*
+<body>@*
+@w{<H1> \line\ </H1>}@*
+@end macro
+@macro htmlsubtitle{line}
+@w{<h2> \line\ </h2>}@*
+@end macro
+@macro htmlauthor{line}
+@w{<ADDRESS> \line\ </ADDRESS>}@*
+@end macro
+
+@c
+@c When making HTML output, @bye does some cleanup.
+@c
+@macro bye
+</body>@*
+</html>@*
+@bye
+@end macro
+
+@c
+@c @anchor{Brian Fox, http://www.ua.com/users/bfox/}
+@c
+@macro anchor-{text, link}
+@w{<a href="\link\">\text\</a>}
+@end macro
+
+@macro TeX-
+<i>T</i>e<i>X</i>
+@end macro
+
+@macro paragraph{}
+<p>
+@end macro
+
+@c
+@c @mail{Eli Zaretskii, eliz@@is.elta.co.il}
+@c
+@macro mail{name, address}
+@w{<a href="mailto:\address\">\name\</a>}
+@end macro
+
+@c
+@c @ftp{SimTel, ftp.coast.net/SimTel/vendors/djgpp/}
+@c
+@macro ftp{desc, path}
+@w{<a href="ftp://\path\">\desc\</a>}
+@end macro
+
+@c
+@c @ftpdir{ftp.coast.net, /SimTel/vendors/djgpp}
+@c
+@macro ftpdir{host, dir}
+@w{<a href="ftp://\host\\dir\/">\host\</a>}
+@end macro
+
+@c
+@c ftpusr{riceng.rice.edu, login: ezgcc, passwd: ezgcc}
+@c
+@macro ftpusr{desc, host, login, passwd}
+@w{<a href="ftp://\login\:\passwd\@@\host\/">\desc\</a>}
+@end macro
+
+@c
+@c @www{DJGPP server, www.delorie.com/djgpp/}
+@c
+@macro www{desc, path}
+@w{<a href="http://\path\">\desc\</a>.}
+@end macro
+
+@c
+@c @gopher{SimTel, ftp.coast.net/SimTel/vendors/djgpp/}
+@c
+@macro gopher{desc, path}
+@w{<a href="gopher://\path\">\desc\</a>}
+@end macro
+
+@c
+@c @news{comp.os.msdos.djgpp}
+@c
+@macro news{name}
+@w{<a href="news:\name\">\name\</a>}
+@end macro
+
+@c
+@c Redefine the TeXinfo commands which have direct HTML counterparts.
+@c
+
+@macro html-define-0arg{command, html-insertion}
+@macro \command\
+@w{\html-insertion\}
+@end macro
+@end macro
+
+@macro html-define-1arg{command, html-insertion}
+@macro \command\{arg}
+@quote-arg
+@w{\html-insertion\}
+@end macro
+@end macro
+
+@macro html-define-line{command, html-insertion}
+@macro \command\{line}
+@w{\html-insertion\}
+@end macro
+@end macro
+
+@macro asis{arg}
+\arg\
+@end macro
+
+@c
+@c Various lists (@table, @itemize, @enumerate)
+@c
+
+@ignore
+@macro table{flavor}
+
+<dl>@*
+@end macro
+@macro end-table
+@*
+</dl>@*
+@end macro
+
+@macro titem{line}
+@*
+<dt> \line\@*
+<dd>
+@end macro
+@macro titemx{line}
+<dt> \line\@*
+@end macro
+@macro titeml{line}
+<dt> \line\@*
+<dd>
+@end macro
+@end ignore
+
+@c I'm using now the table environment of HTML
+@c Do not nest the table environment
+
+@macro table{table_format}
+@macro _table_format{arg}
+\table_format\{\arg\}
+@end macro
+<table border>
+@end macro
+@macro titem{line}
+<tr><td>@_table_format{\line\}<td>
+@end macro
+@macro titemx{line}
+@titem \line\
+@end macro
+@macro end-table
+<tr></table>
+@unmacro _table_format
+@end macro
+
+@macro itemize{style}
+@*
+<ul>@*
+@end macro
+@macro item{line}
+@*
+<li>\line\
+@end macro
+@macro end-itemize
+@*
+</ul>@*
+@end macro
+@macro enumerate{style}
+@*
+<ol>@*
+@end macro
+@macro end-enumerate
+@*
+</ol>@*
+@end macro
+
+@c .
+@c Preformatted stuff (@example, @display, @smallexample, @quotation)
+@c Expanded by SDH because they contain the command itself.
+
+@c @macro format-
+@c @exdent <pre>@*
+@c @format
+@c @end macro
+@c @macro end-format
+@c @end format
+@c @exdent </pre>@*
+@c @*
+@c @end macro
+
+@c @macro display-
+@c @exdent <pre>@*
+@c @display
+@c @end macro
+@c @macro example-
+@c @exdent <pre>@*
+@c @example
+@c @end macro
+@c @macro smallexample-
+@c @exdent <pre>@*
+@c @smallexample
+@c @end macro
+@c @macro quotation-
+@c @exdent <blockquote>@*
+@c @quotation
+@c @end macro
+@c @macro end-example
+@c @end example
+@c @exdent </pre>@*
+@c @*
+@c @end macro
+@c @macro end-smallexample
+@c @end smallexample
+@c @exdent </pre>@*
+@c @*
+@c @end macro
+@c @macro end-display
+@c @end display
+@c @exdent </pre>@*
+@c @*
+@c @end macro
+@c @macro end-quotation
+@c @end quotation
+@c @exdent </blockquote>@*
+@c @*
+@c @end macro
+
+@c .
+@c Nodes, chapters, sections and menus
+@c .
+
+@macro menu-
+<p>@*
+<MENU>@*
+
+@end macro
+@macro mitem{node, rest}
+<LI>@w{<A HREF="#\node\"> \node\---\rest\ </A>}@*
+@end macro
+@macro end-menu
+
+</MENU>@*
+
+@end macro
+
+@macro node{this, next, prev, up}
+<A NAME="\this\">
+@end macro
+
+@macro top{line}
+<CENTER>@*
+<H1> \line\ </H1></A><P>@*
+</CENTER>@*
+@end macro
+
+@macro chapter{line}
+<CENTER>@*
+<H2> \line\ </H2></A><P>@*
+</CENTER>@*
+@end macro
+
+@macro section{line}
+@*
+<H3> \line\ </H3></A><P>@*
+@end macro
+
+@macro subsection{line}
+@*
+<H4> \line\ </H4></A><P>@*
+@end macro
+
+@macro subsubsection{line}
+@*
+<H4> \line\ </H4></A><P>@*
+@end macro
+
+@macro unnumbered{line}
+@chapter{\line\}
+@end macro
+
+@macro unnumberedsec{line}
+@section{\line\}
+@end macro
+
+@macro subsubheading{line}
+@subsubsection{\line\}
+@end macro
+
+@macro appendix{line}
+ \line\ </A></H3><P>
+
+@end macro
+
+@macro appendixsec{line}
+ \line\</A></H3><P>
+
+@end macro
+
+@c
+@c Footnotes
+@
+
+@macro footnote{stuff}
+@quote-arg
+
+<P><i><b> Note: </b>\stuff\ </i><P>
+
+@end macro
+
+@macro quest{stuff}
+@quote-arg
+@*
+<em><strong>Question</strong>: \stuff\ </em>
+<p>@*
+@end macro
+
+@macro ans
+@*
+@exdent <hr>
+<strong>Answer</strong>:
+@end macro
+
+@c
+@c Cross-references
+@c
+
+@c NOTE: The internal cross-references only support 2-argument
+@c varieties of the Texinfo commands, and the external
+@c cross-reference only support 4-argument form!
+
+@macro ref{node, desc, title, file, doc}
+@set desc_seen
+@set doc_seen
+@ifeq{"\doc\", "", @clear doc_seen }
+@ifeq{"\desc\", "", @clear desc_seen }
+@ifset doc_seen
+@ifset desc_seen
+<B>Section \desc\ in \doc\</B>
+@end ifset
+@ifclear desc_seen
+<B>Section \node\ in \doc\</B>
+@end ifclear
+@end ifset
+@ifclear doc_seen
+@w{<A HREF="#\node\">}
+@ifset desc_seen
+\desc\
+@end ifset
+@ifclear desc_seen
+\node\
+@end ifclear
+</A>
+@end ifclear
+@end macro
+
+@macro xref{node, desc, title, file, doc}
+See @ref{\node\,\desc\,\title\,\file\,\doc\}
+@end macro
+
+@macro mxref{node, desc, title, file, doc}
+see @ref{\node\,\desc\,\title\,\file\,documentation for \doc\}
+@end macro
+
+@macro pxref{node, desc, title, file, doc}
+see @ref{\node\,\desc\,\title\,\file\,\doc\}
+@end macro
+
+@c @macro extref{node, desc, file, title, url}
+@c See @w{<A HREF="http://\url\">}the ``\node\'' section of the ``\title\''</A>
+@c @end macro
+
+@macro extref{node, desc, file, title, url}
+See @w{<A HREF="\url\#\node\">}the ``\node\'' section of the ``\title\''</A>
+@end macro
+
+@c
+@c ---------------- Common part ------------------------------------
+@c
+
+@macro b{arg}
+<b>\arg\</b>
+@end macro
+@macro code{arg}
+<code>\arg\</code>
+@end macro
+@macro file{arg}
+<code>\arg\</code>
+@end macro
+@macro emph{arg}
+<em>\arg\</em>
+@end macro
+@macro strong{arg}
+<strong>\arg\</strong>
+@end macro
+@macro kbd{arg}
+<kbd>\arg\</kbd>
+@end macro
+
+@macro key{arg}
+<kbd>\arg\</kbd>
+@end macro
+
+@c @macro key{arg}
+@c <table border><tr><td><kbd>\arg\</kbd><tr></table>
+@c @end macro
+
+@macro samp{arg}
+<samp>\arg\</samp>
+@end macro
+@macro var{arg}
+<var>\arg\</var>
+@end macro
+@macro dfn{arg}
+<dfn>\arg\</dfn>
+@end macro
+@macro il{arg}
+<i>\arg\</i>
+@end macro
+@macro t{arg}
+<tt>\arg\</tt>
+@end macro
+@macro sc{arg}
+<b><tt>\arg\</tt></b>
+@end macro
+@macro copyright{}
+&#169;
+@end macro
diff --git a/setedit/doc/rhidemac.txi b/setedit/doc/rhidemac.txi
new file mode 100644
index 0000000..9c12437
--- /dev/null
+++ b/setedit/doc/rhidemac.txi
@@ -0,0 +1,116 @@
+@c rhidemac.txi: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c .
+@c Macros for making RHIDE documentation in TeX and INFO format.
+@c .
+@iftex
+@immediate@write17{-------------------------------------------------------------------}
+@immediate@write17{---------IGNORE THE FOLLOWING ERROR ABOUT THE INVALID CHARACTER----}
+@immediate@write17{-------------------------BY SIMPLY PRESSING ENTER------------------}
+@immediate@write17{-------------------------------------------------------------------}
+@end iftex
+@c Author: Robert Hhne (robert.hoehne@gmx.net)
+@c November 1996.
+@c .
+@c Derived from 'faqmacros.txi', which is part of DJGPP FAQ written
+@c by Eli Eli Zaretskii (eliz@is.elta.co.il)
+@c .
+@c Many ideas taken from files `multifmt.texi' and html.texi'
+@c written by Brian J. Fox and distributed with GNU Texinfo archive:
+@c .
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@c .
+@c -------------------------------------------------------------------------
+
+
+@macro htmlstart
+@end macro
+
+@macro htmltitle{line}
+@end macro
+
+@macro htmlsubtitle{line}
+@end macro
+
+@macro htmlauthor{line}
+@end macro
+
+@macro anchor-{text, link}
+\text\, \link\
+@end macro
+
+@macro TeX-
+@TeX{}
+@end macro
+
+@macro paragraph{}
+@c @sp 1
+@end macro
+
+@macro mail{name, address}
+@sc{\name\}
+@c @iftex
+@c @par
+@c @end iftex
+@t{<\address\>}
+@end macro
+
+@macro ftp{desc, path}
+\desc\, e.g. ftp://\path\
+@end macro
+
+@macro ftpdir{host, dir}
+\host\, directory \dir\
+@end macro
+
+@macro ftpusr{desc, host, login, passwd}
+\desc\ (FTP to \host\, login as \login\, give \passwd\ as password)
+@end macro
+
+@macro www{desc, path}
+\desc\, at this URL:
+@sp 1
+@display
+http://\path\
+@end display
+@sp 1
+@end macro
+
+@macro gopher{desc, path}
+\desc\, gopher://\path\
+@end macro
+
+@macro news{name}
+\name\ Newsgroup
+@end macro
+
+@macro titem{line}
+@item \line\
+
+@end macro
+@macro titemx{line}
+@itemx \line\
+
+@end macro
+@macro titeml{line}
+@itemx \line\
+@end macro
+
+@macro quest{stuff}
+@quote-arg
+@emph{@strong{Question}: \stuff\}
+@end macro
+
+@macro ans
+@strong{Answer}:
+@end macro
+
+@macro mxref{node, desc, title, file, doc}
+see @ref{\node\,\desc\,\title\,\file\,documentation for \doc\}
+@end macro
+
+@macro extref{node, desc, file, title, url}
+see @ref{\node\,\desc\,,\file\,\title\},
+@end macro
+
diff --git a/setedit/doc/rhidemac.txt b/setedit/doc/rhidemac.txt
new file mode 100644
index 0000000..c001497
--- /dev/null
+++ b/setedit/doc/rhidemac.txt
@@ -0,0 +1,118 @@
+@c rhidemac.txt: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making RHIDE documentation in text format.
+@c
+@c Author: Robert Hhne (robert.hoehne@gmx.net)
+@c November 1996.
+@c
+@c Derived from 'faqmacros.txi', which is part of DJGPP FAQ written
+@c by Eli Eli Zaretskii (eliz@is.elta.co.il)
+@c
+@c Many ideas taken from files `multifmt.texi' and html.texi'
+@c written by Brian J. Fox and distributed with GNU Texinfo archive:
+@c
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@c
+@c -------------------------------------------------------------------------
+
+
+@macro htmlstart
+@end macro
+
+@macro htmltitle{line}
+@end macro
+
+@macro htmlsubtitle{line}
+@end macro
+
+@macro htmlauthor{line}
+@end macro
+
+@macro bye
+@end macro
+
+@macro anchor{text, link}
+\text\, \link\
+@end macro
+
+@macro TeX
+@TeX{}
+@end macro
+
+@macro paragraph{}
+@sp 1
+@end macro
+
+@macro mail{name, address}
+\name\ <\address\>
+@end macro
+
+@macro ftp{desc, path}
+\desc\, e.g. ftp://\path\
+@end macro
+
+@macro ftpdir{host, dir}
+\host\, directory \dir\
+@end macro
+
+@macro ftpusr{desc, host, login, passwd}
+\desc\ (FTP to \host\, login as \login\, give \passwd\ as password)
+@end macro
+
+@macro www{desc, path}
+\desc\, at this URL:
+@sp 1
+@display
+http://\path\
+@end display
+@sp 1
+@end macro
+
+@macro gopher{desc, path}
+\desc\, gopher://\path\
+@end macro
+
+@macro news{name}
+\name\ Newsgroup
+@end macro
+
+@macro titem{line}
+@item \line\
+@end macro
+@macro titemx{line}
+@itemx \line\
+@end macro
+@macro titeml{line}
+@itemx \line\
+@end macro
+
+@macro quest{stuff}
+@quote-arg
+@emph{@strong{Question}: \stuff\}
+@end macro
+
+@macro ans
+@strong{Answer}:
+@end macro
+
+@c
+
+@macro mxref{node, desc, title, file, doc}
+See Section '\node\' in documentation for '\doc\'
+@end macro
+
+@macro xref{node}
+See \node\
+@end macro
+
+@macro extref{node, desc, file, title, url}
+See \desc\ in ``\title\'', or point your Web browser to http://\url\
+@end macro
+
+@macro footnote{stuff}
+@quote-arg
+(\stuff\)
+@end macro
+
diff --git a/setedit/doc/sdg.tx b/setedit/doc/sdg.tx
new file mode 100644
index 0000000..795de11
--- /dev/null
+++ b/setedit/doc/sdg.tx
@@ -0,0 +1,1024 @@
+\input texinfo @c -*-texinfo-*-
+@c Copyright (C) 1997,1998,1999,2000 by Salvador Eduardo Tropea.
+@c The first 75 lines configures all, the rest is the real doc.
+
+@comment %**start of header
+
+@setfilename sdg.info
+@set version 0.0.1
+@set update-date 5 July 1999
+@set update-month July 1999
+@set name-author Salvador Eduardo Tropea
+
+@settitle SET's Documentation Generator (SDG) v @value{version}
+
+@footnotestyle separate
+@paragraphindent asis
+@iftex
+@afourpaper
+@end iftex
+
+@comment %**end of header
+
+@c ---- Includes according to the output format
+@ifset html
+@include set.htm
+@clear text
+@end ifset
+
+@ifset text
+@include set.txt
+@clear html
+@end ifset
+
+@ifclear html
+@ifclear text
+@include set.txi
+@end ifclear
+@end ifclear
+
+@macro SSET{}
+@mail{@value{name-author},salvador@@inti.gov.ar}
+@end macro
+@set title-printed SET's Documentation Generator
+@set minidesc-printed A C/C++ documentation generator
+@set year-copyr 1997,1998,1999,2000
+@set info-file sdg
+
+@c --------------------------------------------------------------
+@c Now we have 3 different headers:
+@c 1) For the printed manual, is called titlepage
+@c 2) For Info files
+@c 3) For HTML files
+@c I tried to automate it.
+@c --------------------------------------------------------------
+
+@c --- pre1 is the name of the program and the purpose
+@set text-pre1 This document describes the use of the @value{title-printed}; this program can be used to generate good documentation from some special comments in your source code.
+
+@c --- pre2 and 3 are copyrights for copies
+@set text-pre2 Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
+
+@set text-pre3 Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
+
+@HeaderPage1{}
+@ifinfo
+@ifset html
+@include sdg.ctx
+@end ifset
+@top SDG
+@end ifinfo
+@HeaderPage2{}
+
+@chapter Introduction
+
+That's the documentation for the SET's Documentation Generator (SDG) program.
+@paragraph{}
+The objetive of the program is generate documentation of your source code using
+some special comments in your code. The program simplifies the task a lot because
+you don't need to type things like the prototype of your functions, file where the
+functions are located, class, etc.
+
+@section About the Author
+
+@my-flag{}
+
+SDG was made by Salvador Eduardo Tropea (SET).
+
+@display
+E-Mail: @SSET{}
+
+Telephone: (+5411) 4759-0013
+Postal Address:
+Salvador E. Tropea
+Curapalig@value{uuml}e 2124
+(1678) Caseros - 3 de Febrero
+Prov: Buenos Aires
+Argentina
+@end display
+@paragraph{}
+
+@my-flag{}
+
+@chapter How to use it quickly
+@cindex How to use
+@cindex Starting
+@cindex Quick start
+
+Even when SDG is a complex tool you can use it without a deep knowledge of the program.
+This chapter explains the basic steps to use SDG, you'll consult the advanced
+reference for an in deep explanation.
+
+@section What I must add to my sources?
+@cindex Special comments
+@cindex Comments in the sources
+@cindex Source comments
+@cindex What you need in your sources
+@vindex Function
+@vindex Class
+@vindex Include
+@vindex Module
+@vindex Prototype
+@vindex Description
+@vindex Return
+@vindex Example
+@vindex Comments
+
+You must add some special comments in your code. To make the task easier I created
+some pseudo-macros for my editor; they are @code{/t} and @code{/d} and are expanded
+to:
+@paragraph{}
+@example
+/**[txh]**********************************************************************
+
+ Function:
+ Class:
+ Include:
+ Module:
+ Prototype:
+ Description:
+
+ Return:
+ Example:
+
+*****************************************************************************/
+@end example
+
+@example
+/**[txh]**********************************************************************
+
+ Description:
+
+ Return:
+ Example:
+
+*****************************************************************************/
+@end example
+
+You must fill one or more of these fields. Some of them are filled automatically.
+The following table shows how these fields work.
+@paragraph{}
+
+@table3{Variable,Meaning,Behavior}
+@c ----- makeinfo is too weak! and TeX is totally idiot, I can put a cross
+@c reference in a parameter.
+ @titemR{@code{Function},Is the name of the function,Automatic (type 5)}
+ @titemR{@code{Class},Used for member functions,Automatic (type 4)}
+ @titemR{@code{Include},Is the file that contains the prototype,Semiautomatic (type 2)}
+ @titemR{@code{Module},The module@comma{} library or category of the function,Semiautomatic (type 2)}
+ @titemR{@code{Prototype},The prototype of the function,Automatic (type 3)}
+ @titemR{@code{Description},How the function works,Manual (type 1)}
+ @titemR{@code{Return},Value returned; type and meaning,Manual (type 1)}
+ @titemR{@code{Example},How to use it,Manual (type 1)}
+@endtable-{}
+
+As you can see most of the fields are filled automatically. The @code{/t} macro is
+normally used for the first function in your file; it sets the @code{Include} and
+@code{Module} fields for the rest of the functions. As @code{Function}, @code{Class}
+and @code{Prototype} are filled automatically most of the time you'll need to use
+the @code{/d} macro.
+@paragraph{}
+
+Additionally you'll need to add very complet comments for inline members because their
+prototypes are declared in the class and hence the program can't fill the fields
+automatocally.
+@paragraph{}
+
+If you want to get a better result you can add another comments to your sources.
+These comments looks like this:
+@paragraph{}
+
+@example
+/**[txh]**********************************************************************
+
+ XXXXX:
+ Comments:
+
+*****************************************************************************/
+@end example
+
+The field @code{XXXXX} can be one of the following: @code{Class} or @code{Module}.
+This special comment can be used ones per class or module and is the description
+of this class or module. Comments is a @x{Variables type 6}.
+@paragraph{}
+
+@section What can I assign to the fields?
+
+SDG have some macro and formating facilties. SDG defines some macros and you can define
+your own macros in the format file. Because SDG must recognize the macros some
+characters have an special meaning and you aren't totally free to use them.
+@paragraph{}
+
+As this section is a little hard I'll provide a little subsection explaining the
+basic concepts. If you are in a hurry or read only this first section.
+@paragraph{}
+
+@subsection The basics syntax
+@cindex Syntax
+@cindex Basic syntax
+@cindex @@
+@vindex @@
+@cindex End of paragraph
+@cindex paragraph
+@cindex Harcoded macros
+@cindex Default macros
+@cindex Line break
+@cindex Breaking a line
+@vindex @@p
+@vindex @@*
+@cindex Cross references (basic)
+@cindex Referencing
+@vindex @@x@{@}
+@cindex Macros, hardcoded
+@cindex Macros, default
+@cindex Subtitles
+@cindex How to add examples
+@cindex Examples
+@c *******
+@c IMPORTANT! I MUST use < and > here because makeinfo gets mad if I use
+@c the lt and gt macros. It works for HTML because my htmlidx program
+@c traslates it to &lt; and &gt;
+@c *******
+@vindex @@<pre>
+@vindex @@</pre>
+@vindex @@<subtitle>@{@}
+
+The macros starts with @code{@@} so you can put a single @code{@@} in your comments.
+If you need to put a @code{@@} use two, like this @code{@@@@}.
+@paragraph{}
+
+SDG have some special macros hardcoded they are @code{@@p}, @code{@@*} and @code{@@x}.
+Use @code{@@p} to indicate an end of paragraph and @code{@@*} to break a line inside
+of a paragraph.
+@paragraph{}
+
+The syntax for cross references is more complex so I'll show you it with some
+examples.
+@paragraph{}
+
+@itemize @bullet
+@item To indicate a function use @@x@{Name@}.
+@item To indicate another member of the same class @@x@{::Name@}.
+@item To indicate a member of another class @@x@{Class::Name@}.
+@end itemize
+
+Additionally you can use some macros that I defined in the format files, they are:
+@paragraph{}
+
+@itemize @bullet
+@item @@@lt{}subtitle@gt{}@{Name@} generates a title.
+@item @@@lt{}pre@gt{} starts a preformated text. Is used for examples.
+@item @@@lt{}/pre@gt{} ends a preformated text.
+@end itemize
+
+As you can see the @{ and @} characters are used too. You can use these characters
+freely but avoid using it in a cross reference or in a title because if you make
+the following:
+@paragraph{}
+
+@example
+@@@lt{}subtitle@gt{}@{That's a subtitle with a @}@}
+@end example
+
+SDG can be confused by the @} and end the title in the wrong place. To avoid it use
+@@@{ and @@@}.
+@paragraph{}
+
+@subsection More about cross references
+@cindex Cross references (in deep)
+@cindex Referencing (in deep)
+@vindex @@x@{@} (in deep)
+
+As you saw in the previous chapter is hard to explain what's the syntax for it so here
+is a detailed explanation on how it works.
+@paragraph{}
+
+To understand it better you must know more about what's generated by a cross reference,
+for it consult the @x{Commands,Commands section}.
+@paragraph{}
+
+Basically a cross reference have two parts; the visible name and the name of the node
+pointed by it. In the following explanations I'll call 0 to the visible name and 1 to
+the node. The available cases are:
+@paragraph{}
+
+@enumerate
+@item @code2{@@x@ocb{}A@comma{}B@ccb{}} here 0 is A and 1 is B.
+@item @code2{@@x@{A@}} here 0 and 1 contains A.
+@item @code2{@@x@{::A@}} here 0 is A and 1 is A (class name).
+@item @code2{@@x@{A::B@}} here 0 is B and 1 is B (A).
+@end enumerate
+
+To generalize three I must say that the reference generated is A (Distinguish). Here
+Distinguish is the variable indicated in the @x{Variables,Variables section}.
+@paragraph{}
+
+SDG first fills the values of the variables 0 and 1 and then expands the code defined
+for the cross reference.
+@paragraph{}
+
+@subsection More about macros
+@cindex Defined macros
+@cindex Macros, in deep
+@vindex @@<macro>@{@}
+@vindex @@@{
+@vindex @@@}
+
+The general syntax for the macros is:
+@paragraph{}
+
+@example
+@@@lt{}Macro Name@gt{}@{List of parameters@}
+@end example
+
+The parameters are separated by @code2{@comma{}}. You can't use @code2{@ccb{}} and @code2{@ocb{}} inside
+the parameters. Use @@@{ and @@@} instead. For similar reasons you can't use @gt{} in the
+name of the macro; use @@@gt{} instead.@*
+You can use @@@{ and @@@} in any place safetly but is necesary only in the case named
+above.
+@paragraph{}
+
+You can define your own macros, for that look the
+@x{DefinedCommands,DefinedCommands section}.
+@paragraph{}
+
+The parameters of the macros are passed by the macro expander so you can use macros
+here too. For example:
+@paragraph{}
+@example
+@@@lt{}xx@@@gt{}@gt{}@{That's @@@lt{}xx2@gt{}@{too@} complex @@@} thing@}
+@end example
+
+That will call to the macro xx@gt{} passing to it:
+@paragraph{}
+
+@example
+That's @@@lt{}xx2@gt{}@{too@} complex @@@} thing
+@end example
+
+As the parameter 0, then it will evaluate the parameter calling to the macro xx2
+passing the word @code{too} as parameter 0.
+@paragraph{}
+
+As you can see you can make complex things with it but SDG wasn't designed to be a
+complex interpreter so be carreful and be aware that you'll find some limitations.
+@paragraph{}
+
+The number of parameters passed to a macro can be range from zero to ten. You can use
+the following syntax for zero parameters:
+@paragraph{}
+
+@example
+@@@lt{}Macro Name@gt{}
+@end example
+
+If the name of the macro doesn't match with any defined macro you won't get a warning,
+instead SDG will output the name of the macro as-is. As an example you can generate
+an HTML tag making the following:
+@paragraph{}
+
+@example
+@@@lt{}@lt{}any tag@@@gt{}@gt{}
+@end example
+
+That's no recomended because you are limiting the output format to HTML but you can
+do it.
+@paragraph{}
+
+@section What I will get after adding it?
+@cindex What SDG generates
+@cindex Generated documentation
+@cindex Documentation generated
+@cindex Alphabetical lists
+
+SDG will generate a documentation with:
+@paragraph{}
+
+@enumerate
+@item
+An alphabetical list of the functions.
+@item
+An alphabetical list of the classes and the member functions of each one.
+@item
+An alphabetical list of the modules and the member functions of each one.
+@item
+An alphabetical list of the files and the member functions of each one.
+@end enumerate
+
+For each function you'll get a references filled with the fields previouslly mentioned.
+Additionally SDG will include the file where the function is and the line of the
+prototype.
+@paragraph{}
+
+@section What other thing are needed to be tunned?
+@cindex What you must configure
+@cindex How to configure, basic
+@cindex Title, author, etc
+@cindex Section Replace
+@cindex Replace section
+@vindex Replace
+
+SDG uses a @file{.fmt} file to generate the documentation. You'll need to tune some
+constants of the section @code{[Replace]} of this file.
+@paragraph{}
+
+These constants controls the name of the documentation and other similar things. They
+are dependent of the format generated so I can make a general description of these
+constants.
+@paragraph{}
+
+@chapter How to control the generated documentation
+@cindex How to configure, deep
+@cindex Format files
+@cindex fmt files
+@cindex Changing the output
+@cindex Tuning the output
+@cindex Comments in fmt files
+@cindex Sections in fmt files
+@vindex #
+@vindex [section]
+
+This chapter explains how to configure SDG. SDG is very versatile and can be
+configured to behave very different to the original configuration.
+@paragraph{}
+
+SDG uses a format file (@file{.fmt}) to generate the documentation. Actually I have
+two format files; one for @file{.info}, @file{.html} and @file{.txt} files and
+other for @file{.html} files. The former is called @file{multi.fmt} and the
+last is called @file{html.fmt}.If you are wondering why I have a separated file for
+@file{.html} when the other works for HTML the answer is easy; @file{html.fmt}
+generated much better @file{.html} files and doesn't need the help of @file{makeinfo}.
+@paragraph{}
+
+The syntax used in format files is tricky but is easy for easy tasks.
+@paragraph{}
+
+@section Format files syntax
+
+Format files are divided in sections. Each section is started by a label with the
+following format: @samp{[Section name]}. The rules are the following:
+@paragraph{}
+
+@enumerate
+@item
+The starting @code{[} must be in the first column.
+@item
+Any character is allowed inside the section name.
+@item
+A @code{]} delimites the name and the rest of the characters are ignored.
+@item
+The name is case sensitive.
+@end enumerate
+
+Any line starting with @code{#} or a blanck character is ignored. There are exceptions
+for it. In the @code{Replace} section the variables defined are strings, these strings
+can use more than one line; inside of these strings you can't use comments. In the
+@code{Gen*} sections the @code{#} are allowed but the blank lines aren't skipped.
+Even when these rules can look a little stupid now you'll see they are logic.
+@paragraph{}
+
+The lines are limited to 200 characters, if they are longer will be cutted.
+@paragraph{}
+
+Here is a list of the sections of the format file.
+@paragraph{}
+
+@subsection Configuration
+@cindex Section Configuration
+@cindex Configuration section
+@vindex Configuration
+@cindex Program called to generate the output
+@cindex Post procesing
+
+This section indicates what programs are used to generate the documentation and what
+formats are generated with this format file. An example is:
+@paragraph{}
+
+@example
+CommandLine=makeinfo --no-validate --fill-column 78 -o ~1.info ~0
+Name=Info (.info) file format
+CommandLine=makeinfo --no-validate --fill-column 78 -Dhtml -o ~1.html ~0
+Name=HTML file format
+CommandLine=makeinfo --no-validate --fill-column 78 -Dtext -o ~1.txt ~0
+Name=Text (.txt) file format
+@end example
+
+That indicates that three formats are generated. @code{CommandLine} must be used before
+@code{Name} and you @strong{must} provide pairs.
+@paragraph{}
+
+@subsubsection CommandLine
+@vindex CommandLine
+
+This variable indicates what program is called. The ~0 mark is replaced by the name of
+the temporary file created by SDG. ~1 is replaced by the name of the outuput file,
+you must provide the extention.
+@paragraph{}
+If you need a long command line or various commands use a batch or script file.
+@paragraph{}
+
+@subsubsection Name
+@vindex Name
+
+This variable indicates the name of the format generated, make it descriptive but
+avoid making it too long.
+@paragraph{}
+
+@subsection Delimiters
+@cindex Delimiters for the special comments
+@cindex Where start a special comment
+@cindex Special comments, start and end
+@cindex Delimiters section
+@cindex Section Delimiters
+@vindex Delimiters
+
+This section defines the delimiters used to detect the special comments. SDG will
+search for these delimiters in the source files. For example:
+@paragraph{}
+
+@example
+SectionStart=/**[txh]**
+SectionEnd=*********/
+@end example
+
+@subsubsection SectionStart
+@vindex SectionStart
+
+This variable defines the start of the comments. The variable is limited to 11
+characters. A line containing it will be taked as the start of the comment and the
+rest of the line will be discarded.
+@paragraph{}
+
+@subsubsection SectionEnd
+@vindex SectionEnd
+
+This variable defines the end of the special comments. The variable is limited to 11
+characters. A line containing it will be taked as the end of the special comment and
+the rest of the line will be discarded.
+@paragraph{}
+
+@subsection Variables
+@cindex Fields used in the comments
+@cindex How to indicate a field
+@cindex Variables
+@cindex Variables section
+@cindex Section Variables
+@vindex Variables
+@vindex file name
+@vindex line number
+@vindex AddDefinition
+@vindex Distinguish
+@cindex Distinguish
+@cindex Differencing two functions with the same name
+@cindex Functions with the same name
+
+This is a very important section; it defines the fields recognized inside of the
+special comments.
+@paragraph{}
+
+You can define up to 16 variables. Each variable have a number; the first defined is
+the variable 0, the next 1, etc. The variable 0 is special and normally is used for
+the name of the functions because this variable is used for the main index and the
+associations.
+@paragraph{}
+
+Additionally there are some special variables created internally:
+@paragraph{}
+
+@table2{Number,Meaning}
+@clear table-set-center
+ @titemR{@code{90},Name of the file}
+ @titemR{@code{91},Line number of the end of the comment}
+ @titemR{@code{92},Name of the var 0 in the format: ~0 ~~Distinguish@ocb{}(~Distinguish)~@ccb{} (node name)}
+@endtable-{}
+@paragraph{}
+
+To define a variable you'll use the following syntax:
+@paragraph{}
+@example
+AddDefinition=Name of Variable,Type
+@end example
+
+One problem that appears here is the fact that two functions can have the same name.
+To avoid problems you must avoid the automatic function name detection and put the
+name of the function by hand adding to the name some thing to distinguish it from
+the other.
+@paragraph{}
+
+A very special case is the one of the classes, is very common to find members with
+the same name in two classes. In this case is very hard to add some distinguish code
+by hand so SDG can do it automatically. For this you must say what other variable
+is the one used to make the difference. The syntax is:
+@paragraph{}
+
+@example
+Distinguish=Number of the variable
+@end example
+
+With that SDG will add the name of this variable to the name of the variable 0. If the
+variable doesn't exist for that function SDG will skip it. The distingish variable
+appears between parentheses. For more information see the section
+@x{More about cross references}.
+@paragraph{}
+
+The allowed types for variables are:
+@paragraph{}
+
+@subsubsection Variables type 1
+@cindex Variables type 1
+@cindex Normal variables
+@vindex Type 1
+
+These are normal variables they put your content if exist.
+@paragraph{}
+
+@subsubsection Variables type 2
+@cindex Variables type 2
+@cindex Repeat variables
+@vindex Type 2
+
+They are "Repeat" variables. If one of them appears in one comment the default for
+this variable is set with this value. If the variable doesn't exist in one comment
+SDG will use the default.
+@paragraph{}
+
+A good example is the @code{Include} variable. Normally all the functions of one
+source have your prototypes in one header so indicating that in the first comment
+SDG will assume that all the functions are in the same include.
+@paragraph{}
+
+SDG provides two special values that you can use in the comments to stop the use of
+the default value. If you use @code{~no} SDG will not use the default for this
+function. If you use @code{~clear} SDG will delete the default value.
+@paragraph{}
+
+@subsubsection Variables type 3
+@cindex Variables type 3
+@cindex Function prototype variable
+@vindex Type 3
+
+If this variable isn't in the comment SDG will try to replace it with the function
+prototype. It uses an heuristic so isn't perfect.
+@paragraph{}
+
+@subsubsection Variables type 4
+@cindex Variables type 4
+@cindex Class name variable
+@vindex Type 4
+
+If this variable isn't in the comment SDG will try to replace it with the class of
+the function. It uses an heuristic so isn't perfect.
+@paragraph{}
+
+@subsubsection Variables type 5
+@cindex Variables type 5
+@cindex Function name variable
+@vindex Type 5
+
+If this variable isn't in the comment SDG will try to replace it with the name of
+the function. It uses an heuristic so isn't perfect.
+@paragraph{}
+
+@subsubsection Variables type 6
+@cindex Variables type 6
+@cindex Comments for classes and modules
+@vindex Type 6
+
+That's a very special kind of variables. They disable the node generation for this
+comment. The variable is stored in the first variable that have associations and is
+in the comment. Is used to create comments for modules and classes.
+@paragraph{}
+
+@subsection Associations
+@cindex Associations section
+@cindex Alphabetical lists, how to configure
+@cindex Groups of functions
+@cindex Section Associations
+@vindex Associations
+@vindex AddAssoc
+
+The associations are used to make groups of functions with a particular relation.
+You can define up to 8 associations. Each association associates the 0 variable and
+another variable.
+@paragraph{}
+
+That's used to create for example a list of classes and your members.
+@paragraph{}
+
+The syntax is the following:
+@paragraph{}
+
+@example
+AddAssoc=Title of the menu for it,Name of the node,Variable,Distinguish
+@end example
+
+SDG will create a chapter (node) for this list called @code{Name of the node} that
+will be available from the main menu with the name @code{Title of the menu for it}.
+Additionally to distinguish this chapter from the name of a function SDG will add
+the @code{Distinguish} string, that's optional.
+@paragraph{}
+
+A good example for @code{Distinguish} are classes where the constructor could make a
+collition with the class name.
+@paragraph{}
+
+Here is an example:
+@paragraph{}
+
+@example
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+@end example
+
+@subsection Replace
+@cindex Constants
+@cindex Section Replace
+@cindex Replace Section
+@vindex Replace
+@vindex Constant
+
+This section is used to define constants that can be called latter in the Gen* section.
+@paragraph{}
+
+Each constant have the following syntax:
+@paragraph{}
+
+@example
+Constant="Value"
+@end example
+
+Value can be extended various lines and is ended with the second @code{"}.
+@paragraph{}
+
+You can use @x{More about macros,macros}, inside the constants. An example is:
+@paragraph{}
+
+@example
+Constant="This document describes the functions of my library
+@@p
+This document applies to version 0.0.1
+of the program named A Real World
+@@p"
+@end example
+
+@subsection Commands
+@cindex End of paragraph, configuring
+@cindex paragraph, configuring
+@cindex Harcoded macros, configuring
+@cindex Line break, configuring
+@cindex Breaking a line, configuring
+@vindex @@p, configuring
+@vindex @@*, configuring
+@cindex Macros, hardcoded (configuring)
+@vindex EndOfPar
+@vindex BreakLine
+@vindex CrossRef
+@vindex Double@@
+@vindex Commands
+@cindex Commands section
+@cindex Section Commands
+
+This section controls the the hardcoded macros of SDG.
+@paragraph{}
+
+There are three hardcoded macros they are:
+@paragraph{}
+@itemize @bullet
+@item
+End of paragraph, is represented as @code{@@p} and you can define the code
+generated by it setting the variable @code{EndOfPar}.
+@item
+Line break, is represented as @code{@@*} and you can control it with the
+@code{BreakLine} variable.
+@item
+Cross references, they are represented as @code{@@x@{parameters@}}. The generated code
+is controled by @code{CrossRef}. This macro takes two parameters and you can indicate
+where to put these values with the ~0 and ~1 markers.
+@end itemize
+
+In this section you can control what is generated when SDG finds a @@@@ sequence. As
+@file{makeinfo} uses @@ in a similar way that SDG you'll need to indicate that this
+sequence must be passed as-is to @file{makeinfo}. For this you can use the
+@code{Double@@} variable.
+@paragraph{}
+
+The following is an example of these variables for the HTML format:
+@paragraph{}
+
+@example
+EndOfPar=@lt{}p@gt{}
+BreakLine=@lt{}br@gt{}
+CrossRef=@lt{}a href="#~1"@gt{}~0@lt{}/a@gt{}
+Double@@=@
+@end example
+
+For more information see the section @x{More about cross references}.
+@paragraph{}
+
+@subsection DefinedCommands
+@vindex DefinedCommands
+@cindex DefinedCommands section
+@cindex Section DefinedCommands
+@cindex Macros, creating
+@cindex How to add macros
+@cindex Configuting macros
+@vindex @@<pre>, configuring
+@vindex @@</pre>, configuring
+@vindex @@<subtitle>@{@}, configuring
+@cindex Macros, default (configuring)
+@cindex Default macros, configuring
+
+This section defines the user macros. The syntax is the following:
+@paragraph{}
+
+@example
+Name of macro=Code generated
+@end example
+
+You can recall the values of the parameters in the @code{Code generated} part using
+the @code{~n} markers. For more information about how @code{~n} works look the
+@x{GenNode,GenNode section}.
+@paragraph{}
+
+An example is:
+@paragraph{}
+
+@example
+subtitle=@lt{}Font Size=+1@gt{}@lt{}u@gt{}~0@lt{}/u@gt{}@lt{}/Font@gt{}@lt{}p@gt{}
+@end example
+
+With this definition the following code
+@paragraph{}
+
+@example
+@@@lt{}subtitle@gt{}@{Hello@}
+@end example
+
+Will generate:
+@paragraph{}
+
+@example
+@lt{}Font Size=+1@gt{}@lt{}u@gt{}Hello@lt{}/u@gt{}@lt{}/Font@gt{}@lt{}p@gt{}
+@end example
+
+
+Read the "More about macros" section for more information about it.
+@x{More about macros}.
+@paragraph{}
+
+@subsection ASCIIConvert
+@vindex ASCIIConvert
+@cindex ASCIIConvert section
+@cindex Section ASCIIConvert
+@cindex Accents
+@cindex Foreing characters
+@cindex ASCII specials
+
+This section is used to indicate how to handle special characters. A good example are
+the accents. The syntax is the following:
+@paragraph{}
+
+@example
+ASCII=code
+@end example
+
+Code will be passed directly to the output without expanding macros or escaping
+characters.
+@paragraph{}
+
+@subsection GenNode
+@vindex GenNode
+@cindex GenNode section
+@cindex Section GenNode
+@cindex Text generated for each function
+@cindex Documentation for functions
+@cindex Functions, generated information
+
+This section is used to indicate what code is generated for each function. The
+text included in this function is processed in the following way:
+@paragraph{}
+
+@enumerate
+@item The macros aren't expanded.
+@item The ASCII characters aren't translated.
+@item ~n is interpreted as a variable and is expanded with the value of the
+corresponding variable. The content of the variable is passed by the macro expander.
+@item ~~n is a conditional, the code affected is delimited with @{ and ~@}. This
+code will be passed to the output only if the variable ~~n have a value.
+@end enumerate
+
+In the @code{GenNode} section the variables are the variables from the
+@x{Variables, @code{Variables} section}. So 0 to 15 are the fields of the comment
+and 90 to 92 are the values mentioned in that section.
+@paragraph{}
+
+@subsection GenMenu
+@vindex GenMenu
+@cindex GenMenu section
+@cindex Section GenMenu
+@cindex Menus, configuring
+@vindex Start
+@vindex End
+@vindex Entry
+
+This section is used to indicate how to create a menu in the output file.
+@paragraph{}
+
+You must define three variables:
+@paragraph{}
+@enumerate
+@item @code{Start} defines how to start a menu.
+@item @code{Entry} defines how to create an entry in the menu. It takes two parameters,
+the parameter @code{1} is the name of the menu item and the parameter @code{2} is the
+cross reference to it.
+@item @code{End} defines how to end a menu.
+@end enumerate
+
+The values assigned to these variables are processed in the same way explained in
+@x{GenNode,GenNode section}.
+@paragraph{}
+
+Here is the HTML code example:
+@paragraph{}
+
+@example
+Start=@lt{}Menu@gt{}
+Entry=@lt{}li@gt{}@lt{}a href="#~2"@gt{}~1@lt{}/a@gt{}
+End=@lt{}/Menu@gt{}
+@end example
+
+@subsection GenAssoMain
+@vindex GenAssoMain
+@cindex GenAssoMain section
+@cindex Section GenAssoMain
+@cindex Associations, generated text
+@cindex Alphabetical lists, how to configure
+@cindex Groups of functions
+@cindex Section Associations
+
+This section is used to indicate how to create the first node for an association. The
+text included in this function is processed in the way explained in the
+@x{GenNode,GenNode section}.
+@paragraph{}
+
+The variables available are @code{~1} the name of the association and @code{~2} the
+menu for it generated with the information in the @x{GenMenu,GenMenu section}.
+@paragraph{}
+
+See the @x{GenAssoRest,GenAssoRest}, for more information.
+@paragraph{}
+
+@subsection GenAssoRest
+@vindex GenAssoRest
+@cindex GenAssoRest section
+@cindex Section GenAssoRest
+
+This section is used to indicate how to create the rest of the nodes for an association.
+The text included in this function is processed in the way explained in the
+@x{GenNode,GenNode section}.
+@paragraph{}
+
+The variables available are @code{~1} the name of the association, @code{~2} is the
+same name but without the distingish, @code{~3} is the comment collected for it
+using a @x{Variables type 6,variable type 6}. and @code{~4} the menu for this
+association generated with the information in the @x{GenMenu,GenMenu section}.
+@paragraph{}
+
+@subsection GenMain
+@vindex GenMain
+@cindex GenMain section
+@cindex Section GenMain
+@cindex Generated text, configuring
+@cindex Order of the things in the output file
+
+This section is used to indicate how to create the output file. The text included in
+this function is processed in the way explained in the @x{GenNode,GenNode section}.
+@paragraph{}
+
+The variables available are @code{~1} the main menu, @code{~2} the name of the function
+list node, @code{~3} the menu for all the functions, @code{~4} the code for all the
+associations generated according to the information in the
+@x{GenAssoMain}. and @x{GenAssoRest}. sections and @code{~5} all the function
+nodes.@*
+The menus are generated with the information in the @x{GenMenu,GenMenu section}.
+@paragraph{}
+
+Additionally all the constants defined in the @x{Replace,Replace section}, can be
+recalled adding 50 to it. For example the @code{~50} recalls the constant number 0,
+that's the first defined.
+@paragraph{}
+
+@chapter Index
+
+@conindex{cindex.idx,cindex.tdx}
+
+@chapter Index of variables and commands
+
+@varindex{vindex.idx,vindex.tdx}
+
+@c @summarycontents
+@EOFTOC
+
+@bye
+
diff --git a/setedit/doc/sdh.c b/setedit/doc/sdh.c
new file mode 100644
index 0000000..37f5ca8
--- /dev/null
+++ b/setedit/doc/sdh.c
@@ -0,0 +1,1497 @@
+/*****************************************************************************
+
+ SET's Documentation Helper (SDH) Copyright(c) 1997-2004
+ by Salvador Eduardo Tropea
+
+ This program is used to automate the creation of .info, .txt, .html, .dvi
+and .ps files from one source file (.tx).
+
+ See copyrigh file for details. Normally located in the root of the
+distribution. This file can be distributed under the terms of the GPL
+license.
+
+*****************************************************************************/
+
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_string
+#define Uses_ctype
+#define Uses_limits
+#define Uses_unistd
+#define Uses_getcwd
+#include <compatlayer.h>
+
+/*
+ returns:
+ 1 => bad command line.
+ 2 => Can't open input file.
+ 3 => Hierarchy error.
+ 4 => Can't create output
+ 5 => Error when spawning
+ 6 => Cross reference error
+*/
+//char *outf=NULL;
+char *inf=NULL;
+FILE *fi,*fo,*fo2,*fo3;
+#define MAX_BL 200
+char bl[MAX_BL];
+char b2[MAX_BL];
+int TopFound=0;
+int CurLevel=0;
+int KindOfLevel;
+int PutPoint=0;
+#define MAX_IND 4
+char *IndexNames[MAX_IND];
+char *FilesIndex[MAX_IND];
+char *FilesIndexTXT[MAX_IND];
+int IndexFound[MAX_IND];
+int cantIndices=0;
+int makeClean=0;
+char *OutPathOrig=NULL;
+char OutPath[PATH_MAX];
+#define MAX_SEARCH 10
+char *SeachPaths[MAX_SEARCH];
+int CantSearchs=0;
+char Include[PATH_MAX];
+int NoNumberInInf=0;
+
+//#define DEBUG
+
+// Kind of numbers
+// The top isn't numbered and is special
+#define K_TOP 0
+// Numbered chapters, sections, subsections and subsubsections
+#define K_NORMAL 1
+// Unnumbered sections
+#define K_UNNUM 2
+// Appendices with roman numbers?, I'll implement letters first
+#define K_ROMAN 3
+
+#define F_INFO 1
+#define F_TXT 2
+#define F_HTML 4
+#define F_DVI 8
+#define F_PS 16
+#define F_ALL 31
+int outFormats=0;
+
+typedef struct
+{
+ int Level;
+ int Type;
+ char *name;
+ char *Number;
+} aNode;
+
+#define Inic_Nodes 100
+#define Delta_Nodes 20
+aNode *Nodes=NULL;
+int cantNodes=0;
+int cantAllocNodes=0;
+
+char *SearchNode(char *name);
+
+void PutCopy(void)
+{
+ printf("SET's Documentation Helper (SDH)\n"
+ "Copyright (c) 1997-2004 by Salvador Eduardo Tropea\n\n");
+}
+
+void PutHelp(int ret)
+{
+ PutCopy();
+ printf("sdh -i input_file [-p] [-n \"name\" file file_txt] [-c] [-oihtdpa] [-I path]\n"
+ " [-O path]\n\n"
+ "in_file is the BASE name of the documentation (.tx)\n"
+ "-p: Put X. instead of X in chapter numbers\n"
+ "-n \"name\" file file_txt: for indices\n"
+ "-N: don't put numbers in .info file, let makeinfo do it\n"
+ "-c: clean, deletes intermediate files\n"
+ "-oX: output format, i=.info h=.html t=.txt d=.dvi p=.ps a=ALL\n"
+ "-I path: adds the path to the search paths\n"
+ "-O path: output path\n"
+ "\n");
+ if (ret)
+ exit(ret);
+}
+
+void PutPathIn(char *name,char *path)
+{
+ char *v;
+
+ if (path)
+ {
+ strcpy(name,path);
+ v=name+strlen(name)-1;
+ if (*v!='/' && *v!='\\')
+ {
+ *(v+1)='/';
+ *(v+2)=0;
+ }
+ }
+ else
+ *name=0;
+}
+
+void ParseCommandLine(int argc, char *argv[])
+{
+ int i,OneMore,ThreeMore,j;
+
+ if (argc<2)
+ PutHelp(1);
+ for (i=1; i<argc; i++)
+ {
+ OneMore=i<(argc-1);
+ ThreeMore=i<(argc-3);
+ if (*argv[i]=='-')
+ {
+ switch (argv[i][1])
+ {
+ case 'o':
+ for (j=2; argv[i][j]; j++)
+ {
+ switch (argv[i][j])
+ {
+ case 'i':
+ outFormats|=F_INFO;
+ break;
+ case 't':
+ outFormats|=F_TXT;
+ break;
+ case 'h':
+ outFormats|=F_HTML;
+ break;
+ case 'd':
+ outFormats|=F_DVI;
+ break;
+ case 'p':
+ outFormats|=F_PS;
+ break;
+ case 'a':
+ outFormats|=F_ALL;
+ break;
+ default:
+ printf("Invalid output format\n");
+ exit(1);
+ }
+ }
+ break;
+ case 'i':
+ if (OneMore)
+ {
+ inf=argv[i+1];
+ i++;
+ }
+ else
+ PutHelp(1);
+ break;
+ case 'n':
+ if (ThreeMore)
+ {
+ if (cantIndices==MAX_IND)
+ {
+ printf("Only %d indices are supported, please recompile\n",MAX_IND);
+ exit(3);
+ }
+ IndexNames[cantIndices]=argv[i+1];
+ FilesIndex[cantIndices]=argv[i+2];
+ FilesIndexTXT[cantIndices]=argv[i+3];
+ cantIndices++;
+ i+=3;
+ }
+ else
+ PutHelp(1);
+ break;
+ case 'N':
+ NoNumberInInf=1;
+ break;
+ case 'p':
+ PutPoint=1;
+ break;
+ case 'c':
+ makeClean=1;
+ break;
+ case 'O':
+ if (OneMore)
+ OutPathOrig=argv[++i];
+ else
+ PutHelp(1);
+ break;
+ case 'I':
+ if (OneMore)
+ {
+ if (CantSearchs==MAX_SEARCH)
+ {
+ printf("Only 10 -I paths supported, recompile\n");
+ exit(1);
+ }
+ SeachPaths[CantSearchs++]=argv[++i];
+ }
+ else
+ PutHelp(1);
+ break;
+ }
+ }
+ else
+ PutHelp(1);
+ }
+ if (!inf)
+ {
+ printf("No input file\n");
+ PutHelp(1);
+ }
+ if (!outFormats)
+ {
+ PutHelp(0);
+ printf("No output format defined use -oX\n");
+ exit(1);
+ }
+ PutPathIn(OutPath,OutPathOrig);
+}
+
+FILE *TryOpenFile(char *path,char *name,char *ext)
+{
+ char n[PATH_MAX];
+ PutPathIn(n,path);
+ strcat(n,name);
+ strcat(n,ext);
+ return fopen(n,"rt");
+}
+
+#define TryWith(path) { f=TryOpenFile(path,inf,ext); if(f) return f; }
+
+FILE *OpenInFile(char *ext)
+{
+ FILE *f=NULL;
+ int i;
+
+ TryWith(NULL);
+ TryWith(OutPathOrig);
+ for (i=0; i<CantSearchs; i++)
+ TryWith(SeachPaths[i]);
+ printf("Can't open %s%s\n",inf,ext);
+ exit(2);
+ return f;
+}
+
+
+void CreateFile(char *ext)
+{
+ char name[PATH_MAX];
+ PutPathIn(name,OutPathOrig);
+ strcat(name,inf);
+ strcat(name,ext);
+ fo=fopen(name,"wt");
+ if (!fo)
+ {
+ printf("Can't create %s\n",name);
+ exit(4);
+ }
+}
+
+FILE *CreateAuxFile(char *nombre)
+{
+ FILE *f;
+ char name[PATH_MAX];
+ PutPathIn(name,OutPathOrig);
+ strcat(name,nombre);
+ f=fopen(name,"wt");
+ if (!f)
+ {
+ printf("Can't create %s\n",name);
+ exit(4);
+ }
+ return f;
+}
+
+int GetLevel(void)
+{
+#define s(x,l,k) if (strncmp(bl,"@"#x,sizeof(#x)) == 0) {KindOfLevel=k; return l;}
+ s(chapter,1,K_NORMAL);
+ s(section,2,K_NORMAL);
+ s(subsection,3,K_NORMAL);
+ s(subsubsection,4,K_NORMAL);
+ s(top,0,K_TOP);
+ s(unnumbered,1,K_UNNUM);
+ s(unnumberedsec,2,K_UNNUM);
+ s(unnumberedsubsec,3,K_UNNUM);
+ s(unnumberedsubsubsec,4,K_UNNUM);
+ s(appendix,1,K_ROMAN);
+ s(appendixsec,2,K_ROMAN);
+ s(appendixsubsec,3,K_ROMAN);
+ s(appendixsubsubsec,4,K_ROMAN);
+#undef s
+ return -1;
+}
+
+void AddNode(int Level)
+{
+ char *s=bl,*p;
+
+ if (!TopFound)
+ {
+ if (Level!=0)
+ {
+ printf("Use @top as the first entry.\n");
+ if (Level==-1)
+ printf("Don't use @node Top.\n");
+ exit(3);
+ }
+ TopFound=1;
+ }
+
+ if (cantNodes==0)
+ {
+ Nodes=(aNode *)malloc(Inic_Nodes*sizeof(aNode));
+ cantAllocNodes=Inic_Nodes;
+ }
+ else
+ if (cantNodes==cantAllocNodes)
+ {
+ cantAllocNodes+=Delta_Nodes;
+ Nodes=(aNode *)realloc(Nodes,cantAllocNodes*sizeof(aNode));
+ }
+ if (Level==-1)
+ {
+ Level=CurLevel;
+ KindOfLevel=K_NORMAL; // What can I do?
+ }
+ Nodes[cantNodes].Level=Level;
+ for (;*s && !ucisspace(*s); s++);
+ for (;*s && ucisspace(*s); s++);
+ for (p=s;*p && *p!='\n'; p++);
+ if (!*s)
+ {
+ printf("Empty sectioning command:\n%s\n",bl);
+ exit(3);
+ }
+ *p=0;
+ Nodes[cantNodes].name=strdup(s);
+ Nodes[cantNodes].Type=KindOfLevel;
+ cantNodes++;
+ if (Level>CurLevel && (Level-CurLevel)>1)
+ {
+ printf("You are jumping from level %d to level %d!",CurLevel,Level);
+ exit(3);
+ }
+ CurLevel=Level;
+}
+
+void ProcessLine(void)
+{
+ int Level=GetLevel();
+
+ if (strncmp(bl,"@node",5)==0)
+ {
+ printf("Don't use @node, use @unnumbered instead\n");
+ exit(3);
+ //AddNode(-1);
+ }
+ if (Level>=0)
+ {
+ AddNode(Level);
+ return;
+ }
+}
+
+void ReadLine(void)
+{
+ fgets(bl,MAX_BL,fi);
+}
+
+void Rewind(void)
+{
+ rewind(fi);
+}
+
+void ScanFile(void)
+{
+ do
+ {
+ ReadLine();
+ ProcessLine();
+ }
+ while (!feof(fi));
+ Rewind();
+}
+
+#ifdef DEBUG
+void DumpNodes(void)
+{
+ int i,j;
+ for (i=0; i<cantNodes; i++)
+ {
+ j=Nodes[i].Level;
+ if (j==-1)
+ printf("-----> ");
+ else
+ for (;j>=0;--j)
+ printf(" ");
+ printf("%s Name: %s (%d)\n",Nodes[i].Number,Nodes[i].name,Nodes[i].Type);
+ }
+}
+#else
+#define DumpNodes()
+#endif
+
+char *emptyStr=" ";
+
+char *ProxNodeOf(int i)
+{
+ if ((i+1)<cantNodes)
+ {
+ int lev=Nodes[i].Level,nlev;
+ for (i++; i<cantNodes; i++)
+ {
+ nlev=Nodes[i].Level;
+ if (lev==nlev)
+ return Nodes[i].name;
+ if (nlev<lev)
+ break;
+ }
+ }
+ return emptyStr;
+}
+
+void GenMenu(int i, FILE *f, int use_sp_end)
+{
+ int lev=Nodes[i].Level;
+ fputs("@menu\n",f);
+ for (;i<cantNodes; i++)
+ {
+ if (Nodes[i].Level==lev)
+ fprintf(f,"@mitem{%s}\n",Nodes[i].name);
+ else
+ if (Nodes[i].Level<lev)
+ break;
+ }
+ if (use_sp_end)
+ fputs("@end-menu\n\n",f);
+ else
+ fputs("@end menu\n\n",f);
+}
+
+void InsertNumber(char *s,char *n,FILE *f)
+{
+ for (;*s && !ucisspace(*s); s++) fputc(*s,f);
+ for (;*s && ucisspace(*s); s++) fputc(*s,f);
+ fputs(n,f);
+ fputs(s,f);
+}
+
+int HTMLInMenu;
+
+void HTMLPrep(char *s,FILE *f)
+{
+ char *p,*s1;
+ #define c(x) (strncmp(s,"@"x,sizeof(x))==0)
+ #define r(x) if (strncmp(s,"@end "#x,sizeof(#x)+4)==0) fputs("@end-"#x"\n",f); else
+ if (c("menu"))
+ {
+ HTMLInMenu=1;
+ //fputs("@menu-\n",f);
+ fputs(s,f);
+ }
+ else
+ if (HTMLInMenu && s[0]=='*')
+ {
+ int found;
+ for (s++; *s && ucisspace(*s); s++);
+ for (p=s; *p && !(*p==':' && *(p+1)==':'); p++);
+ found=*p==':';
+ *p=0;
+ s1=s;
+ if (found)
+ {
+ for (s=p+2; *s && ucisspace(*s); s++);
+ if (*s)
+ {
+ for (p=s; *p && *p!='\n'; p++);
+ *p=0;
+ }
+ }
+ else
+ s=emptyStr;
+ if (s[0])
+ fprintf(f,"@mitem2{%s,%s}\n",s1,s);
+ else
+ fprintf(f,"@mitem{%s}\n",s1);
+ }
+ else
+ if (c("end-menu") || c("end menu"))
+ {
+ HTMLInMenu=0;
+ fputs("@end-menu\n",f);
+ }
+ else
+ r(format)
+ r(table)
+ r(itemize)
+ r(enumerate)
+ r(example)
+ r(smallexample)
+ r(display)
+ r(quotation)
+ r(menu)
+ fputs(s,f);
+ #undef r
+ #undef s
+ #undef c
+}
+
+void ReplaceEndTable(char *b, FILE *f)
+{
+ if (strncmp(b,"@endtable-{}",12)==0)
+ fputs("@end itemize\n@p{}\n",f);
+ else
+ fputs(b,f);
+ if (strncmp(b,"@table",6)==0)
+ fputs("@itemize @bullet\n",f);
+}
+
+char *dirStr="(dir)";
+
+void GenerateTXI_NUM(void)
+{
+ int i,nlev,levant=0,lev;
+ char *prev=dirStr;
+ char *up[6],*name,*aprev[5];
+ HTMLInMenu=0;
+
+ CreateFile(".txi");
+ fo2=fo;
+ // Special hack! a .txi but with numbers, for .info using makeinfo 4.7 or newer
+ // where we can't use @end xxx inside a macro.
+ CreateFile(".nut");
+ fo3=fo;
+ CreateFile(".num");
+ up[0]=dirStr;
+ aprev[0]=dirStr;
+ i=0;
+ do
+ {
+ ReadLine();
+ lev=GetLevel();
+ if (lev>=0)
+ {
+ nlev=Nodes[i].Level;
+ name=nlev ? Nodes[i].name : "Top";
+ if (nlev>levant)
+ {
+ aprev[nlev]=prev;
+ GenMenu(i,fo,1);
+ GenMenu(i,fo2,0);
+ GenMenu(i,fo3,0);
+ }
+ fprintf(fo2,"@node %s, %s, %s, %s\n",name,ProxNodeOf(i),aprev[nlev],up[nlev]);
+ fprintf(fo3,"@node %s, %s, %s, %s\n",name,ProxNodeOf(i),aprev[nlev],up[nlev]);
+ fprintf(fo,"@node-{%s, %s, %s, %s}\n",name,ProxNodeOf(i),aprev[nlev],up[nlev]);
+ prev=name;
+ aprev[nlev]=prev;
+ up[nlev+1]=name;
+ levant=nlev;
+ i++;
+ }
+ ReplaceEndTable(bl,fo2);
+ if (lev<0)
+ {
+ HTMLPrep(bl,fo);
+ ReplaceEndTable(bl,fo3);
+ }
+ else
+ {
+ InsertNumber(bl,Nodes[i-1].Number,fo);
+ if (NoNumberInInf)
+ fputs(bl,fo3);
+ else
+ InsertNumber(bl,Nodes[i-1].Number,fo3);
+ }
+ if (lev>=0 && strcmp(name,"Top"))
+ {
+ fprintf(fo2,"@cindex %s\n",name);
+ fprintf(fo3,"@cindex %s\n",name);
+ fprintf(fo,"@cindex %s\n",name);
+ }
+ }
+ while (!feof(fi));
+ fclose(fo);
+ fclose(fo2);
+ fclose(fo3);
+ Rewind();
+}
+
+char *emptyStr2="";
+
+void Numerate(void)
+{
+ int num[2][6];
+ int i,lev,levant=0,type,sub,j;
+ char b[80],b1[20];
+
+ memset(num,0,6*2*sizeof(int));
+ for (i=0; i<cantNodes; i++)
+ {
+ type=Nodes[i].Type;
+ if (type==K_UNNUM || type==K_TOP)
+ {
+ Nodes[i].Number=emptyStr2;
+ continue;
+ }
+ sub=type==K_ROMAN ? 1 : 0;
+ lev=Nodes[i].Level;
+ if (lev<levant)
+ do
+ {
+ num[sub][levant--]=0;
+ }
+ while(levant>lev);
+ num[sub][lev]++;
+ if (sub)
+ sprintf(b,"%c",'A'+num[sub][1]-1);
+ else
+ sprintf(b,"%d",num[sub][1]);
+ for (j=2; num[sub][j]; j++)
+ {
+ sprintf(b1,".%d",num[sub][j]);
+ strcat(b,b1);
+ }
+ if (PutPoint && num[sub][2]==0)
+ strcat(b,". ");
+ else
+ strcat(b,emptyStr);
+ Nodes[i].Number=strdup(b);
+ levant=lev;
+ }
+}
+
+void GenerateCTX(void)
+{
+ int i,nlev,curlev=0;
+
+ CreateFile(".ctx");
+ for (i=1; i<cantNodes; i++)
+ {
+ nlev=Nodes[i].Level;
+ if (nlev>curlev)
+ fputs("<MENU>\n",fo);
+ else
+ if (nlev<curlev)
+ do
+ {
+ fputs("</MENU>\n",fo);
+ }
+ while(--curlev>nlev);
+ fprintf(fo,"@w{<LI> <A HREF=\"#%s\">%s%s</A>}\n",Nodes[i].name,Nodes[i].Number,Nodes[i].name);
+ curlev=nlev;
+ }
+ if (curlev)
+ do
+ {
+ fputs("</MENU>\n",fo);
+ }
+ while(--curlev);
+ fclose(fo);
+}
+
+void GenerateINFO(void)
+{
+ int error;
+ char s[6*PATH_MAX];
+ // No validate because makeinfo can't see through mitem{} (another weak point)
+ sprintf(s,"makeinfo %s --no-split --fill-column 75 --no-validate -o %s%s.inf %s%s.nut",Include,OutPath,inf,OutPath,inf);
+ //sprintf(s,"makertf %s --no-split --fill-column 75 --no-validate -o %s%s.inf %s%s.num",Include,OutPath,inf,OutPath,inf);
+ error=system(s);
+ if (error)
+ {
+ printf("Failed executing:\n%s\n",s);
+ exit(5);
+ }
+}
+
+char *Conv[256]={
+NULL, // 0
+NULL, // 1
+NULL, // 2
+NULL, // 3
+NULL, // 4
+NULL, // 5
+NULL, // 6
+NULL, // 7
+NULL, // 8
+NULL, // 9
+NULL, // 10
+NULL, // 11
+NULL, // 12
+NULL, // 13
+NULL, // 14
+NULL, // 15
+NULL, // 16
+NULL, // 17
+NULL, // 18
+NULL, // 19
+NULL, // 20
+NULL, // 21
+NULL, // 22
+NULL, // 23
+NULL, // 24
+NULL, // 25
+NULL, // 26
+NULL, // 27
+NULL, // 28
+NULL, // 29
+NULL, // 30
+NULL, // 31
+NULL, // 32
+NULL, // 33
+NULL, // 34
+NULL, // 35
+NULL, // 36
+NULL, // 37
+NULL, // 38
+NULL, // 39
+NULL, // 40
+NULL, // 41
+NULL, // 42
+NULL, // 43
+NULL, // 44
+NULL, // 45
+NULL, // 46
+NULL, // 47
+NULL, // 48
+NULL, // 49
+NULL, // 50
+NULL, // 51
+NULL, // 52
+NULL, // 53
+NULL, // 54
+NULL, // 55
+NULL, // 56
+NULL, // 57
+NULL, // 58
+NULL, // 59
+"@lt{}", // 60
+NULL, // 61
+"@gt{}", // 62
+NULL, // 63
+"@@", // 64
+NULL, // 65
+NULL, // 66
+NULL, // 67
+NULL, // 68
+NULL, // 69
+NULL, // 70
+NULL, // 71
+NULL, // 72
+NULL, // 73
+NULL, // 74
+NULL, // 75
+NULL, // 76
+NULL, // 77
+NULL, // 78
+NULL, // 79
+NULL, // 80
+NULL, // 81
+NULL, // 82
+NULL, // 83
+NULL, // 84
+NULL, // 85
+NULL, // 86
+NULL, // 87
+NULL, // 88
+NULL, // 89
+NULL, // 90
+NULL, // 91
+NULL, // 92
+NULL, // 93
+NULL, // 94
+NULL, // 95
+NULL, // 96
+NULL, // 97
+NULL, // 98
+NULL, // 99
+NULL, // 100
+NULL, // 101
+NULL, // 102
+NULL, // 103
+NULL, // 104
+NULL, // 105
+NULL, // 106
+NULL, // 107
+NULL, // 108
+NULL, // 109
+NULL, // 110
+NULL, // 111
+NULL, // 112
+NULL, // 113
+NULL, // 114
+NULL, // 115
+NULL, // 116
+NULL, // 117
+NULL, // 118
+NULL, // 119
+NULL, // 120
+NULL, // 121
+NULL, // 122
+"@{", // 123
+NULL, // 124
+"@}", // 125
+NULL, // 126
+NULL, // 127
+NULL, // 128
+"@value{uuml}", // 129
+"@value{eacute}", // 130
+NULL, // 131
+"@value{auml}", // 132
+"@value{agrave}", // 133
+NULL, // 134
+NULL, // 135
+NULL, // 136
+"@value{euml}", // 137
+"@value{egrave}", // 138
+"@value{iuml}", // 139
+NULL, // 140
+"@value{igrave}", // 141
+NULL, // 142
+NULL, // 143
+NULL, // 144
+NULL, // 145
+NULL, // 146
+NULL, // 147
+"@value{ouml}", // 148
+"@value{ograve}", // 149
+NULL, // 150
+"@value{ugrave}", // 151
+NULL, // 152
+NULL, // 153
+"@value{Uuml}", // 154
+NULL, // 155
+NULL, // 156
+NULL, // 157
+NULL, // 158
+NULL, // 159
+"@value{aacute}", // 160
+"@value{iacute}", // 161
+"@value{oacute}", // 162
+"@value{uacute}", // 163
+"@value{ntilde}", // 164
+"@value{Ntilde}", // 165
+NULL, // 166
+NULL, // 167
+"@questiondown{}", // 168
+NULL, // 169
+NULL, // 170
+NULL, // 171
+NULL, // 172
+"@exclamdown{}", // 173
+NULL, // 174
+NULL, // 175
+NULL, // 176
+NULL, // 177
+NULL, // 178
+NULL, // 179
+NULL, // 180
+NULL, // 181
+NULL, // 182
+NULL, // 183
+NULL, // 184
+NULL, // 185
+NULL, // 186
+NULL, // 187
+NULL, // 188
+NULL, // 189
+NULL, // 190
+NULL, // 191
+NULL, // 192
+NULL, // 193
+NULL, // 194
+NULL, // 195
+NULL, // 196
+NULL, // 197
+NULL, // 198
+NULL, // 199
+NULL, // 200
+NULL, // 201
+NULL, // 202
+NULL, // 203
+NULL, // 204
+NULL, // 205
+NULL, // 206
+NULL, // 207
+NULL, // 208
+NULL, // 209
+NULL, // 210
+NULL, // 211
+NULL, // 212
+NULL, // 213
+NULL, // 214
+NULL, // 215
+NULL, // 216
+NULL, // 217
+NULL, // 218
+NULL, // 219
+NULL, // 220
+NULL, // 221
+NULL, // 222
+NULL, // 223
+NULL, // 224
+NULL, // 225
+NULL, // 226
+NULL, // 227
+NULL, // 228
+NULL, // 229
+NULL, // 230
+NULL, // 231
+NULL, // 232
+NULL, // 233
+NULL, // 234
+NULL, // 235
+NULL, // 236
+NULL, // 237
+NULL, // 238
+NULL, // 239
+NULL, // 240
+NULL, // 241
+NULL, // 242
+NULL, // 243
+NULL, // 244
+NULL, // 245
+NULL, // 246
+NULL, // 247
+NULL, // 248
+NULL, // 249
+NULL, // 250
+NULL, // 251
+NULL, // 252
+NULL, // 253
+NULL, // 254
+NULL // 255
+};
+
+static void ConvASCII(unsigned char *s, unsigned char *e, FILE *f)
+{
+ for (;s<e; s++)
+ if (Conv[*s])
+ fputs(Conv[*s],f);
+ else
+ fputc(*s,f);
+}
+
+static void ConvertToHTML(char *s,FILE *f)
+{
+ char *start1,*end1;
+ char *start2,*end2;
+
+// f=stdout;
+ if (*s!='*')
+ return;
+ for (end1=start1=s+2; *end1 && *end1!=':'; end1++);
+ if (*end1!=':')
+ return;
+ for (start2=end1+1; *start2 && ucisspace(*start2); start2++);
+ if (!*start2)
+ return;
+ for (end2=start2; *end2 && *end2!='.'; end2++);
+ if (*end2!='.')
+ return;
+ fprintf(f,"<li><A HREF=\"#@w{");
+ ConvASCII(start2,end2,f);
+ fputs("}\"> @w{",f);
+ ConvASCII(start1,end1,f);
+ fputs("} </A>@*\n",f);
+}
+
+static void ConvertToTXT(char *s,FILE *f)
+{
+ char *p;
+
+ for (p=s; *p && *p!=':'; p++);
+ if (!*p)
+ return;
+ #if 0
+ if (/*p[-1]=='>' || p[-1]=='<' || */*p=='/')
+ return;
+ else
+ printf("%s",p);
+ #endif
+ for (p++; *p && ucisspace(*p); p++);
+ if (!*p)
+ return;
+ ConvASCII(s,p,f);
+ s=p;
+ for (;*p && *p!='.'; p++);
+ *p=0;
+ fputs(SearchNode(s),f);
+ fputs("\n",f);
+}
+
+int NextNode(FILE *f)
+{
+ char *pos,*s;
+ while (*bl!=31 && !feof(f))
+ {
+ fgets(bl,MAX_BL,f);
+ }
+ if (feof(f))
+ return 0;
+ do
+ {
+ fgets(bl,MAX_BL,f);
+ }
+ while (ucisspace(*bl) && !feof(f));
+ pos=strstr(bl,"Node:");
+ if (!pos)
+ return 0;
+ for (pos+=6; *pos && ucisspace(*pos); pos++);
+ for (s=bl; *pos!=','; pos++,s++) *s=*pos;
+ *s=0;
+ return 1;
+}
+
+void GenerateIDX(int ForTXT)
+{
+ char name[PATH_MAX],*n;
+ FILE *f,*o;
+ int i;
+ void (*Convert)(char *s,FILE *f);
+
+ Convert=ForTXT ? ConvertToTXT : ConvertToHTML;
+ if (!cantIndices)
+ return;
+ memset(IndexFound,0,MAX_IND*sizeof(int));
+ f=OpenInFile(".inf");
+ if (!f)
+ {
+ printf("Can't open %s\n",name);
+ exit(2);
+ }
+ *bl=0;
+ do
+ {
+ if (NextNode(f))
+ {
+ for (i=0; i<cantIndices; i++)
+ {
+ if (!IndexFound[i] && strcmp(bl,IndexNames[i])==0)
+ {
+ n=ForTXT ? FilesIndexTXT[i]: FilesIndex[i];
+ o=CreateAuxFile(n);
+ if (!o)
+ {
+ printf("Can't create %s\n",n);
+ exit(4);
+ }
+ do
+ {
+ fgets(bl,MAX_BL,f);
+ if (*bl=='*' && *(bl+1)!='*' && strncmp(bl,"* Menu:",7)!=0)
+ break;
+ }
+ while (!feof(f));
+ do
+ {
+ Convert(bl,o);
+ fgets(bl,MAX_BL,f);
+ if (*bl!='*')
+ break;
+ }
+ while(!feof(f));
+ fclose(o);
+ IndexFound[i]=1;
+ break;
+ }
+ }
+ }
+ }
+ while(!feof(f));
+ fclose(f);
+}
+
+void GenerateHTML(void)
+{
+ int error;
+ char s[6*PATH_MAX];
+ sprintf(s,"makeinfo %s --no-split --fill-column 200 --no-headers --no-split --no-validate -Dhtml -o %s%s.html %s%s.tx3",Include,OutPath,inf,OutPath,inf);
+ error=system(s);
+ if (error)
+ {
+ printf("Failed executing:\n%s\n",s);
+ exit(5);
+ }
+}
+
+void GenerateC_IDX(void)
+{
+ int i,j;
+ char *name="contents.idx";
+ FILE *f;
+
+ f=CreateAuxFile(name);
+ if (!f)
+ {
+ printf("Can't create %s\n",name);
+ exit(4);
+ }
+
+ for (i=0; i<cantNodes; i++)
+ {
+ j=Nodes[i].Level;
+ if (!j)
+ continue;
+ if (j!=1)
+ fprintf(f," ");
+ fprintf(f,"%s%s\n",Nodes[i].Number,Nodes[i].name);
+ }
+ fclose(f);
+}
+
+char *NameLevel[5] =
+{
+ "Top!",
+ "Chapter",
+ "Section",
+ "Section",
+ "Section"
+};
+
+
+char *SearchNode(char *name)
+{
+ int i;
+ for (i=0; i<cantNodes; i++)
+ {
+ if (strcmp(name,Nodes[i].name)==0)
+ {
+ i=sprintf(b2,"%s %s",NameLevel[Nodes[i].Level],Nodes[i].Number);
+ b2[i-1]=0;
+ return b2;
+ }
+ }
+ printf("Cross reference to %s doesn't exists\n",name);
+ exit(6);
+}
+
+void GenerateTX1(void)
+{
+ char *pos,*end,*s,v;
+ int i=0;
+
+ CreateFile(".tx1");
+ do
+ {
+ ReadLine();
+ if (feof(fi))
+ break;
+ // Here we need real nodes again, sorry
+ if (strncmp(bl,"@node-{",7)==0)
+ {
+ fprintf(fo,"@node %s\n",Nodes[i++].name);
+ continue;
+ }
+ s=bl;
+ do
+ {
+ char *refSt="@x{";
+ pos=strstr(s,refSt);
+ if (!pos)
+ {
+ refSt="@xp{";
+ pos=strstr(s,refSt);
+ }
+ if (pos)
+ {
+ *pos=0;
+ fputs(s,fo);
+ fputs(refSt,fo);
+ for (pos+=strlen(refSt); *pos && ucisspace(*pos); pos++);
+ for (end=pos; *end && *end!=',' && *end!='}'; end++)
+ if (*end=='@')
+ {
+ if (*(end+1)=='@')
+ end+=2;
+ else
+ end++;
+ }
+ if (!*end)
+ {
+ printf("Error, please don't cut a line containing a cross reference\n");
+ exit(6);
+ }
+ v=*end;
+ *end=0;
+ fputc('"',fo);
+ fputs(pos,fo);
+ fputs("\" ",fo);
+ fputs(SearchNode(pos),fo);
+ fputc(v,fo);
+ s=end+1;
+ }
+ else
+ fputs(s,fo);
+ }
+ while(pos);
+ }
+ while(!feof(fi));
+ fclose(fo);
+}
+
+void GenerateTX3(void)
+{
+ char *pos,*end,*s,v;
+ int i=0;
+
+ CreateFile(".tx3");
+ do
+ {
+ ReadLine();
+ if (feof(fi))
+ break;
+ s=bl;
+ #define t(x) if (strncmp(s,"@"#x,sizeof(#x))==0) fputs("@"#x"-\n",fo); else
+ #define c(x) if (strncmp(s,x,sizeof(x)-1)==0)
+ c("@format")
+ fputs("@exdent <pre>@*\n@format\n",fo);
+ else c("@end-format")
+ fputs("@end format\n@exdent </pre>@*\n@*\n",fo);
+ else c("@display")
+ fputs("@exdent <pre>@*\n@display\n",fo);
+ else c("@end-display")
+ fputs("@end display\n@exdent </pre>@*\n@*\n",fo);
+ else c("@example")
+ fputs("@exdent <pre>@*\n@example\n",fo);
+ else c("@end-example")
+ fputs("@end example\n@exdent </pre>@*\n@*\n",fo);
+ else c("@smallexample")
+ fputs("@exdent <pre>@*\n@smallexample\n",fo);
+ else c("@end-smallexample")
+ fputs("@end smallexample\n@exdent </pre>@*\n@*\n",fo);
+ else c("@quotation")
+ fputs("@exdent <blockquote>@*\n@quotation\n",fo);
+ else c("@end-quotation")
+ fputs("@end quotation\n@exdent </blockquote>@*\n@*\n",fo);
+ else t(menu)
+ fputs(s,fo);
+ #undef t
+ #undef c
+ }
+ while(!feof(fi));
+ fclose(fo);
+}
+
+/*void GenerateTXT(void)
+{
+ int i,j;
+ if (!cantIndices)
+ {
+ strcpy(bl,inf);
+ strcat(bl,".tx2");
+ strcpy(b2,inf);
+ strcat(b2,".txt");
+ fclose(fi);
+ rename(bl,b2);
+ return;
+ }
+ // Now we can't search for the indices by node
+ for (i=0; i<cantIndices; i++)
+ {
+ for (j=0; j<cantNodes; j++)
+ if (strcmp(IndexNames[i],Nodes[j].name)==0)
+ break;
+ if (j==cantNodes)
+ {
+ printf("Unresolved index: %s\n",IndexNames[i]);
+ exit(7);
+ }
+ sprintf(bl,"%s%s",Nodes[j].Number,Nodes[j].name);
+ IndexNames[i]=strdup(bl);
+ }
+ memset(IndexFound,0,MAX_IND*sizeof(int));
+ CreateFile(".txt");
+ do
+ {
+ ReadLine();
+ if (feof(fi))
+ break;
+ if (strcmp
+ }
+ while(!feof(fi));
+ fclose(fo);
+} */
+
+
+void GenerateTXT(void)
+{
+ int error;
+ char s[6*PATH_MAX];
+ sprintf(s,"makeinfo %s --no-split --fill-column 78 --no-headers --no-split --no-validate -Dtext -o %s%s.txt %s%s.tx1",Include,OutPath,inf,OutPath,inf);
+ error=system(s);
+ if (error)
+ {
+ printf("Failed executing:\n%s\n",s);
+ exit(5);
+ }
+}
+
+void DeleteFile(char *ext)
+{
+ char name[PATH_MAX];
+ PutPathIn(name,OutPathOrig);
+ strcat(name,inf);
+ strcat(name,ext);
+ unlink(name);
+}
+
+void DeleteFileName(char *n)
+{
+ char name[PATH_MAX];
+ PutPathIn(name,OutPathOrig);
+ strcat(name,n);
+ unlink(name);
+}
+
+void GenerateTeX(void)
+{
+ int error;
+ char s[8*PATH_MAX];
+ char path[PATH_MAX];
+
+ sprintf(s,"makeinfo %s --no-split --no-validate --no-split -E %s%s -Ddvi -o %s%s.tx2 %s%s.txi",Include,OutPath,inf,OutPath,inf,OutPath,inf);
+ error=system(s);
+ if (error)
+ {
+ printf("Failed executing:\n%s\n",s);
+ exit(5);
+ }
+ if (OutPathOrig)
+ {
+ getcwd(path,PATH_MAX);
+ chdir(OutPathOrig);
+ }
+ sprintf(s,"tex %s",inf);
+ puts(s);
+ system(s);
+ puts(s);
+ sprintf(s,"texindex %s.??",inf);
+ system(s);
+ puts(s);
+ sprintf(s,"tex %s",inf);
+ system(s);
+ if (OutPathOrig)
+ chdir(path);
+}
+
+void GeneratePS(void)
+{
+ int error;
+ char s[PATH_MAX];
+ sprintf(s,"dvips -o %s.ps %s.dvi",inf,inf);
+ error=system(s);
+ if (error)
+ {
+ printf("Failed executing:\n%s\n",s);
+ exit(5);
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ ParseCommandLine(argc,argv);
+ Include[0]=0;
+ for (i=0; i<CantSearchs; i++)
+ {
+ strcat(Include," -I ");
+ strcat(Include,SeachPaths[i]);
+ }
+ if (OutPathOrig)
+ {
+ strcat(Include," -I ");
+ strcat(Include,OutPathOrig);
+ }
+ fi=OpenInFile(".tx");
+ // Collect the names of the chapters, sections, etc.
+ ScanFile();
+ // Create the numeration for each one
+ Numerate();
+ DumpNodes();
+ // Generate a .TXI, it simply add the @node with the right prev, up,
+ // down plus the insertion of menus.
+ // Generate a .NUM, that's a .TXI but with numbers in the titles and ready
+ // for conversion to HTML (it replaces things like @end format by @end-format)
+ // These formats are ever generated
+ GenerateTXI_NUM();
+ if ((outFormats & F_INFO) || (outFormats & F_TXT) || (outFormats & F_HTML))
+ {
+ // Make the .inf from the .num using makeinfo
+ GenerateINFO();
+ }
+ if (outFormats & F_HTML)
+ {
+ // Create the table of contents for the HTML
+ GenerateCTX();
+ // Create the indices requested
+ GenerateIDX(0);
+ // Makeinfo 4.7 crazyness
+ fclose(fi);
+ fi=OpenInFile(".num");
+ GenerateTX3();
+ // Make the .html from the .num using makeinfo
+ GenerateHTML();
+ }
+ if (outFormats & F_TXT)
+ {
+ GenerateC_IDX();
+ // Create a file with the xref as Section x
+ fclose(fi);
+ fi=OpenInFile(".nut");
+ GenerateTX1();
+ // Create the indices requested, this time in text format
+ GenerateIDX(1);
+ // Create the .txt
+ GenerateTXT();
+ }
+ if (outFormats & (F_DVI | F_PS))
+ {
+ GenerateTeX();
+ if (outFormats & F_PS)
+ GeneratePS();
+ }
+ fclose(fi);
+
+ if (makeClean)
+ {
+ int i;
+ DeleteFile(".num");
+ DeleteFile(".nut");
+ DeleteFile(".ctx");
+ DeleteFile(".txi");
+ DeleteFile(".tx1");
+ DeleteFile(".tx2");
+ DeleteFile(".tx3");
+ DeleteFile("");
+ DeleteFileName("contents.idx");
+ // TeX standard index files
+ DeleteFile(".cp");
+ DeleteFile(".cps");
+ DeleteFile(".fn");
+ DeleteFile(".fns");
+ DeleteFile(".pg");
+ DeleteFile(".pgs");
+ DeleteFile(".ky");
+ DeleteFile(".kys");
+ DeleteFile(".vr");
+ DeleteFile(".vrs");
+ DeleteFile(".tp");
+ DeleteFile(".tps");
+ DeleteFile(".toc");
+ DeleteFile(".aux");
+ //DeleteFile(".log"); Let the log is very important
+ for (i=0; i<cantIndices; i++)
+ {
+ DeleteFileName(FilesIndex[i]);
+ DeleteFileName(FilesIndexTXT[i]);
+ }
+ }
+
+ return 0;
+}
diff --git a/setedit/doc/sdh.gpr b/setedit/doc/sdh.gpr
new file mode 100644
index 0000000..fd5b72d
--- /dev/null
+++ b/setedit/doc/sdh.gpr
Binary files differ
diff --git a/setedit/doc/set.htm b/setedit/doc/set.htm
new file mode 100644
index 0000000..a398574
--- /dev/null
+++ b/setedit/doc/set.htm
@@ -0,0 +1,250 @@
+@c set.htm: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making SET's documentation in HTML format.
+@c
+@c Author: Salvador Eduardo Tropea (salvador@inti.gov.ar)
+@c July 1997.
+@c
+@c It includes the rhidemac.txi file from Robert Hhne, Eli Zaretskii and
+@c Brian J. Fox.
+@c
+@c -------------------------------------------------------------------------
+
+@include rhidemac.htm
+
+@macro table4{title1,title2,title3,title4}
+@set table-title2 \title2\
+@set table-title3 \title3\
+@set table-title4 \title4\
+@set table-set-center
+<center><table border cellpadding=5 width=80%>@*
+<tr><th>\title1\</th><th>\title2\</th><th>\title3\</th><th>\title4\</th></tr>@*
+@end macro
+
+@macro table3{title1,title2,title3}
+@set table-title2 \title2\
+@set table-title3 \title3\
+@clear table-title4
+@set table-set-center
+<center><table border cellpadding=5 width=80%>@*
+<tr><th>\title1\</th><th>\title2\</th><th>\title3\</th></tr>@*
+@end macro
+
+@macro table2{title1,title2}
+@set table-title2 \title2\
+@clear table-title3
+@clear table-title4
+@set table-set-center
+<center><table border cellpadding=5 width=80%>@*
+<tr><th>\title1\</th><th>\title2\</th></tr>@*
+@end macro
+
+@macro table2-auto{title1,title2}
+@set table-title2 \title2\
+@clear table-title3
+@clear table-title4
+@set table-set-center
+<center><table border cellpadding=5>@*
+<tr><th>\title1\</th><th>\title2\</th></tr>@*
+@end macro
+
+@macro titemR{c1,c2,c3,c4}
+@ifset table-set-center
+<tr align=center>
+@end ifset
+@ifclear table-set-center
+<tr>
+@end ifclear
+<td>\c1\</td><td>\c2\</td>
+@ifset table-title3
+<td>\c3\</td>
+@ifset table-title4
+<td>\c4\</td>
+@end ifset
+@end ifset
+</tr>@*
+@end macro
+
+@macro endtable-{}
+</table></center><p></p>@*
+@end macro
+
+@unmacro copyright
+@macro copyright{}
+&copy;
+@end macro
+
+@set aacute &aacute;
+@set eacute &eacute;
+@set iacute &iacute;
+@set oacute &oacute;
+@set uacute &uacute;
+@set ntilde &ntilde;
+@set Ntilde &Ntilde;
+@macro exclamdown
+&iexcl;
+@end macro
+@macro questiondown
+&iquest;
+@end macro
+@set auml &auml;
+@set euml &euml;
+@set iuml &iuml;
+@set ouml &ouml;
+@set uuml &uuml;
+@set Uuml &Uuml;
+@set agrave &agrave;
+@set egrave &egrave;
+@set igrave &igrave;
+@set ograve &ograve;
+@set ugrave &ugrave;
+
+@macro lt
+&lt;
+@end macro
+@macro gt
+&gt;
+@end macro
+
+@c --- Local crossrefences are @x
+@c Does anybody knows how to do it more clean?
+@macro x{node,name}
+@set name_provided__
+@ifeq{"\name\","", @clear name_provided__}
+@ifset name_provided__
+@w{<A HREF="#\node\">\name\</A>}
+@end ifset
+@ifclear name_provided__
+@w{<A HREF="#\node\">\node\</A>}
+@end ifclear
+@end macro
+
+@c --- Parenthetical reference @xp
+@macro xp{node,name}
+@set name_provided__
+@ifeq{"\name\","", @clear name_provided__}
+@ifset name_provided__
+@w{<A HREF="#\node\">\name\</A>}
+@end ifset
+@ifclear name_provided__
+@w{<A HREF="#\node\">\node\</A>}
+@end ifclear
+@end macro
+
+@c --- Entries for menues
+@unmacro mitem
+@macro mitem2{node,name}
+<LI>@w{<A HREF="#\node\">\name\</A>}@*
+@end macro
+@macro mitem{node}
+<LI>@w{<A HREF="#\node\">\node\</A>}@*
+@end macro
+
+@macro node-{this, next, prev, up}
+<A NAME="\this\">
+@end macro
+
+@c --- Workaround for a bug
+@set open-curly @{
+@set close-curly @}
+@macro ocb
+@value{open-curly}
+@end macro
+@macro ccb
+@value{close-curly}
+@end macro
+
+@c --- to put a comma in a parameter
+@set comma-val ,
+@macro comma
+@value{comma-val}
+@end macro
+
+@c --- Header of the text
+@macro HeaderPage1
+@finalout
+@setchapternewpage odd
+
+<html>
+
+<head>@*
+<title>@value{title-printed} documentation for Version @value{version}</title>@*
+</head>@*
+<H1>@value{title-printed} documentation for Version @value{version}</H1>@*
+<H2>@value{update-month}</H2>@*
+<ADDRESS>by @value{name-author}</ADDRESS>@*
+@paragraph{}
+This is the documentation for @value{title-printed}.
+@paragraph{}
+
+Copyright @copyright{} @value{year-copyr} @value{name-author}
+@paragraph{}
+
+@paragraph{}
+
+This documentation may be freely distributed, provided this copyright notice
+is left intact on all copies.
+
+@end macro
+
+@macro HeaderPage2
+ The following master menu lists the major topics in this documentation,
+including all the indices.
+@end macro
+
+@macro EOFTOC
+@end macro
+
+@c --- Make the code fixed width + strong
+@unmacro code
+@macro code{val}
+<code><b>\val\</b></code>
+@end macro
+
+@c That looks great on Netscape 3
+@macro my-flag
+<p>@*
+<table BGCOLOR="#A0D0FF" width="100%" border=0 cellspacing=0 cellpading=0><tr><td>&nbsp;</td></tr></table>@*
+<table BGCOLOR="#FFFFFF" width="100%" border=0 cellspacing=0 cellpading=0><tr><td>&nbsp;</td></tr></table>@*
+<table BGCOLOR="#A0D0FF" width="100%" border=0 cellspacing=0 cellpading=0><tr><td>&nbsp;</td></tr></table>@*
+</p>@*
+@end macro
+
+@macro crossparam{a,b}
+@set temporal @x{Variables type 5,Automatic}.
+@end macro
+
+@macro code2{a}
+@code{\a\}
+@end macro
+
+@macro varindex{h,t}
+<p>@*
+<ul>@*
+@include \h\
+@*
+</ul>@*
+@end macro
+
+@macro conindex{h,t}
+<p>@*
+<ul>@*
+@include \h\
+@*
+</ul>@*
+@end macro
+
+@macro keyindex{h,t}
+<p>@*
+<ul>@*
+@include \h\
+@*
+</ul>@*
+@end macro
+
+@macro p{}
+<p>
+@end macro
+
diff --git a/setedit/doc/set.txi b/setedit/doc/set.txi
new file mode 100644
index 0000000..c5aeb61
--- /dev/null
+++ b/setedit/doc/set.txi
@@ -0,0 +1,292 @@
+@c set.txi: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making SET's documentation in TeX and INFO format.
+@c
+@c Author: Salvador Eduardo Tropea (salvador@inti.gov.ar)
+@c July 1997.
+@c
+@c It includes the rhidemac.txi file from Robert Hhne, Eli Zaretskii and
+@c Brian J. Fox.
+@c
+@c -------------------------------------------------------------------------
+
+@include rhidemac.txi
+
+@macro table4{title1,title2,title3,title4}
+@set table-title2 \title2\
+@set table-title3 \title3\
+@set table-title4 \title4\
+@end macro
+
+@macro table3{title1,title2,title3}
+@set table-title2 \title2\
+@set table-title3 \title3\
+@clear table-title4
+@end macro
+
+@macro table2{title1,title2}
+@set table-title2 \title2\
+@clear table-title3
+@clear table-title4
+@end macro
+
+@macro table2-auto{title1,title2}
+@table2{\title1\,\title2\}
+@end macro
+
+@ifclear dvi
+@macro titemR{col1,col2,col3,col4}
+@item \col1\
+@*- @value{table-title2}: \col2\
+@ifset table-title3
+@*@ @ @ - @value{table-title3}: \col3\
+@end ifset
+@ifset table-title4
+@*@ @ @ - @value{table-title4}: \col4\
+@end ifset
+@end macro
+@end ifclear
+
+@ifset dvi
+@macro titemR{col1,col2,col3,col4}
+@item \col1\
+@itemize @minus
+@item @value{table-title2}: \col2\
+@ifset table-title3
+@item @value{table-title3}: \col3\
+@end ifset
+@ifset table-title4
+@item @value{table-title4}: \col4\
+@end ifset
+@end itemize
+@end macro
+@end ifset
+
+@iftex
+@set tex
+@set aacute @'a
+@set eacute @'e
+@set iacute @'i
+@set oacute @'o
+@set uacute @'u
+@set ntilde @~n
+@set Ntilde @~N
+@set auml @"a
+@set euml @"e
+@set iuml @"i
+@set ouml @"o
+@set uuml @"u
+@set Uuml @"U
+@set agrave @`a
+@set egrave @`e
+@set igrave @`i
+@set ograve @`o
+@set ugrave @`u
+@end iftex
+
+@ifclear tex
+@set aacute
+@set eacute
+@set iacute
+@set oacute
+@set uacute
+@set ntilde
+@set Ntilde
+@macro exclamdown
+
+@end macro
+@macro questiondown
+
+@end macro
+@set auml
+@set euml
+@set iuml
+@set ouml
+@set uuml
+@set Uuml
+@set agrave
+@set egrave
+@set igrave
+@set ograve
+@set ugrave
+@end ifclear
+
+@macro lt
+<
+@end macro
+@macro gt
+>
+@end macro
+
+@c --- Local crossrefences are @x
+@macro x{node,name}
+@xref{\node\,\name\}
+@end macro
+
+@c --- Parenthetical reference @xp
+@macro xp{node,name}
+@pxref{\node\,\name\}
+@end macro
+
+@c --- Entries for menues
+@c @unmacro mitem
+@macro mitem2{node,name}
+* \node\:: \name\.
+@end macro
+@macro mitem{node}
+* \node\::
+@end macro
+
+@c --- Workaround for a bug
+@set open-curly @{
+@set close-curly @}
+@macro ocb
+@value{open-curly}
+@end macro
+@macro ccb
+@value{close-curly}
+@end macro
+
+@c --- to put a comma in a parameter
+@set comma-val ,
+@macro comma
+@value{comma-val}
+@end macro
+
+@macro node-{name,prox,prev,up}
+@node \name\, \prox\, \prev\, \up\
+@end macro
+
+@c --- Header of the text
+@macro HeaderPage1
+
+@c Smaller amounts of whitespace between chapters
+@c and sections.
+@iftex
+@global@chapheadingskip = 15pt plus 4pt minus 2pt
+@global@secheadingskip = 12pt plus 3pt minus 2pt
+@global@subsecheadingskip = 9pt plus 2pt minus 2pt
+@end iftex
+
+@c Smaller amounts of whitespace between paragraphs
+@iftex
+@global@parskip 6pt plus 2pt minus 2pt
+@end iftex
+
+@c @@finalout
+@setchapternewpage odd
+
+@c --- The title page is for printed manuals and is ignored in the on-line
+@c --- formats (text, html and info).
+@titlepage
+@title @value{title-printed}
+@subtitle @sc{@value{minidesc-printed}}
+@subtitle Version @value{version}
+@subtitle @value{update-month}
+
+@author by @value{name-author}
+@author @ii{last updated @value{update-date}}
+
+@page
+
+@value{text-pre1}
+
+@value{text-pre2}
+
+@value{text-pre3}
+
+@tex
+@vskip 0pt plus 1filll
+@end tex
+Copyright @copyright{} @value{year-copyr} by @value{name-author}
+
+@end titlepage
+
+@ifinfo
+@direntry
+* @value{title-printed}: (@value{info-file}). @value{minidesc-printed}.
+@end direntry
+
+This is the documentation for @value{title-printed}.
+@paragraph{}
+
+Copyright @copyright{} @value{year-copyr} @value{name-author}
+@paragraph{}
+
+This documentation may be freely distributed, provided this copyright notice
+is left intact on all copies.
+@end ifinfo
+@end macro
+
+@macro HeaderPage2
+@ifinfo
+This is the documentation for @value{title-printed}.
+@paragraph{}
+
+Copyright @copyright{} @value{year-copyr} @value{name-author}
+@paragraph{}
+
+This documentation may be freely distributed, provided this copyright notice
+is left intact on all copies.
+@paragraph{}
+
+@ifclear text
+ The following master menu lists the major topics in this documentation,
+including all the indices.
+@end ifclear
+@end ifinfo
+@end macro
+
+@macro EOFTOC
+@contents
+@end macro
+
+@c --- That generates a very good effect in InfView, Info? who cares about
+@c --- it? ;-)
+@macro my-flag
+@ifinfo
+@*
+0B@*
+0F@*
+0B
+@end ifinfo
+@end macro
+
+
+@c --- TeX is really idiot handling complex things like expanding a { inside
+@c --- a parameter so some code are conditional
+@macro code2{a}
+'\a\'
+@end macro
+
+@macro varindex{h,t}
+@printindex vr
+@end macro
+
+@macro conindex{h,t}
+@printindex cp
+@end macro
+
+@macro keyindex{h,t}
+@printindex ky
+@end macro
+
+@ifclear dvi
+@macro il{valor}
+`\valor\'
+@end macro
+@end ifclear
+
+@ifset dvi
+@macro il{valor}
+@i{\valor\}
+@end macro
+@end ifset
+
+
+@macro p{}
+@c @sp 1
+@end macro
+
diff --git a/setedit/doc/set.txt b/setedit/doc/set.txt
new file mode 100644
index 0000000..2cfccf3
--- /dev/null
+++ b/setedit/doc/set.txt
@@ -0,0 +1,205 @@
+@c set.txt: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making SET's documentation in txt format.
+@c
+@c Author: Salvador Eduardo Tropea (salvador@inti.gov.ar)
+@c July 1997.
+@c
+@c It includes the rhidemac.txi file from Robert Hhne, Eli Zaretskii and
+@c Brian J. Fox.
+@c
+@c -------------------------------------------------------------------------
+
+@include rhidemac.txt
+
+@macro table4{title1,title2,title3,title4}
+@set table-title2 \title2\
+@set table-title3 \title3\
+@set table-title4 \title4\
+@end macro
+
+@macro table3{title1,title2,title3}
+@set table-title2 \title2\
+@set table-title3 \title3\
+@clear table-title4
+@end macro
+
+@macro table2{title1,title2}
+@set table-title2 \title2\
+@clear table-title3
+@clear table-title4
+@end macro
+
+@macro table2-auto{title1,title2}
+@table2{\title1\,\title2\}
+@end macro
+
+@macro titemR{col1,col2,col3,col4}
+@item \col1\@*
+- @value{table-title2}: \col2\
+@ifset table-title3
+@*- @value{table-title3}: \col3\
+@end ifset
+@ifset table-title4
+@*- @value{table-title4}: \col4\
+@end ifset
+@sp 1
+@end macro
+
+@c @macro endtable-{}
+@c @end itemize
+@c @sp 2
+@c @end macro
+
+@c --- Entries for menues
+@c @unmacro mitem
+@macro mitem2{node,name}
+* \node\:: \name\.
+@end macro
+@macro mitem{node}
+* \node\::
+@end macro
+
+@macro node-{name,prox,prev,up}
+@node \name\
+@end macro
+
+@set aacute
+@set eacute
+@set iacute
+@set oacute
+@set uacute
+@set ntilde
+@set Ntilde
+@macro exclamdown
+
+@end macro
+@macro questiondown
+
+@end macro
+@set auml
+@set euml
+@set iuml
+@set ouml
+@set uuml
+@set Uuml
+@set agrave
+@set egrave
+@set igrave
+@set ograve
+@set ugrave
+
+@macro lt
+<
+@end macro
+@macro gt
+>
+@end macro
+
+@c --- Local crossrefences are @x
+@c @set name_provided__
+@c @ifeq{"\name\","", @clear name_provided__}
+@c @ifset name_provided__
+@macro x{node,name}
+\name\ (\node\)
+@end macro
+@c @end ifset
+@c @ifclear name_provided__
+@c @w{\node\}
+@c @end ifclear
+
+@c --- Parenthetical reference @xp
+@macro xp{node,name}
+\name\ \node\
+@end macro
+
+@c --- Workaround for a bug
+@set open-curly @{
+@set close-curly @}
+@macro ocb
+@value{open-curly}
+@end macro
+@macro ccb
+@value{close-curly}
+@end macro
+
+@c --- to put a comma in a parameter
+@set comma-val ,
+@macro comma
+@value{comma-val}
+@end macro
+
+
+@c --- Header of the text
+@macro HeaderPage1
+
+@finalout
+@setchapternewpage odd
+
+This is the documentation for @value{title-printed}.
+@paragraph{}
+
+Copyright @copyright{} @value{year-copyr} @value{name-author}
+@paragraph{}
+
+This documentation may be freely distributed, provided this copyright notice
+is left intact on all copies.
+@end macro
+
+@macro HeaderPage2
+
+@format
+@ @ Table of Contents
+@ @ *****************
+
+@include contents.idx
+@end format
+@*
+
+@end macro
+
+@macro EOFTOC
+@end macro
+
+@macro my-flag
+@end macro
+
+@macro crossparam{a,b}
+@set temporal @x{Variables type 5,Automatic}.
+@end macro
+
+@macro code2{a}
+@code{\a\}
+@end macro
+
+@macro varindex{h,t}
+@format
+@include \t\
+@end format
+@sp 2
+@end macro
+
+@macro conindex{h,t}
+@format
+@include \t\
+@end format
+@sp 2
+@end macro
+
+@macro keyindex{h,t}
+@format
+@include \t\
+@end format
+@sp 2
+@end macro
+
+@macro il{valor}
+`\valor\'
+@end macro
+
+@macro p{}
+@sp 1
+@end macro
+
diff --git a/setedit/doc/setedit.man b/setedit/doc/setedit.man
new file mode 100644
index 0000000..614ab19
--- /dev/null
+++ b/setedit/doc/setedit.man
@@ -0,0 +1,203 @@
+.\" Process this file with
+.\" groff -man -Tascii setedit.man
+.\"
+.TH SETEDIT 1 "JANUARY 2002" "v0.4.54"
+.SH NAME
+setedit \- a friendly text editor
+.SH SYNOPSIS
+.B setedit [
+.I options
+.B ] [
+.I file_name
+.B ...]
+.SH DESCRIPTION
+.B setedit
+is a friendly console text editor with the look and feel of the Borland
+editors for DOS. This man page only describes the command line options of
+the editor. You can get full help about the editor using the help of the
+editor.
+.PP
+Any number of file names can be specified after the options and they will be
+automatically loaded by the editor in the same order you listed them.
+.PP
+You can pass extra command line options using the SET_CMDLINE environment
+variable. Read the documentation for more information about this feature.
+.SH OPTIONS
+.IP "+[line number]"
+Makes the editor jump to the specified line. This option only affects the
+next file in the list. It should be used after any option starting
+with minus and before the file name you want affect. If the line number is
+omitted the editor jumps to the end of the text. Example: +6 p.txt it loads
+the file called p.txt and jumps to the line number 6. That's very similar to
+the VI behavior.
+.IP "-b, --bios-keyb"
+.B "[Only for DOS]"
+Use the BIOS routines for keyboard handling. They are slow but reliable.
+That's enabled by default.
+.IP "-B, --no-bios-keyb"
+.B "[Only for DOS]"
+Don't use the BIOS routines for keyboard handling. They are faster but in
+some particular machines fails you can just experiment.
+.IP "-c, --cascade"
+After opening all the files the windows are arranged using cascade style.
+Only editor windows are affected.
+.IP "-d, --stack-dbg=n"
+It indicates which methode will be used in the event of an editor crash.
+The default methode is 0 but you can override it using the SET_STACKDBG
+environment variable. The available methodes are:
+0: dump unsaved buffers and stack calls.
+1: do nothings (conservative). You should use it if the editor is
+experimenting very catastrphic crashes.
+2:
+.B "[Only for Linux]"
+dump unsaved buffers and call debugger to get information. Finally die.
+3:
+.B "[Only for Linux]"
+like 2 but stay in the debugger.
+The 0 option disables the hook of signals to save the modified buffers
+during a crash. Could be needed if the editor hangs in an extraordinary
+way. Usually the editor dumps to
+.B stderr
+all the files you didn't save, as the
+.B stderr
+is redirected by the editor to a temporal file you can recover unsaved data.
+This temporal file is stored in your home directory for
+.SM Linux
+and in
+.I %DJDIR%/share/setedit
+for
+.SM DOS.
+To use the options 2 and 3 you must have a binary with debug information
+and also the
+.B nm
+and
+.B gdb
+tools installed in your system. If you use the option 3, the editor is
+running in X and
+.B xterm
+is installed then the debugger will be started in a separated window.
+.IP "-f, --file-list file_name"
+Loads the files listed in the specified file. The file must contain one name
+by line. You can specify more than one list.
+.IP "-h, --help"
+Displays the command line options of the editor.
+.IP "-k, --use-rh-52-keys"
+.B "[Only for Linux]"
+Enables the Red Hat 5.2 style keyboard mapping. That's needed if you are
+experimenting some strange function keys behavior. Some keyboard mapping
+files redefines the function key numbers in a good way but really
+incompatible with the old way. I first found it in Red Hat 5.2.
+.IP "-K, --keybind file_name"
+Uses the specified name as keybinding file. The file should be full
+qualified, the editor will use this name for reading and writing keyboard
+configuration.
+.IP "-l, --force-no-lfn"
+.B "[Only for DOS]"
+Avoids the use of long file names under W9x. Even if the
+.B LFN
+environment variable says the reverse.
+.IP "-L, --force-lfn"
+.B "[Only for DOS]"
+Forces the use of long file names under W9x. Even if the
+.B LFN
+environment variable says the reverse.
+.IP "-m, --no-mouse-hook"
+.B "[Only for DOS]"
+Don't hook the mouse interrupt. Currently this is done automagically if
+.I "Windows NT"
+is detected but it could help if you are having serious problems with the
+mouse.
+.IP "-M, --no-mixer"
+If the editor was compiled with board level sound mixer support this option
+completly disables it. That's here to prevent any interference with other
+programs using the mixer or potential missbehavior due to the use of I/O
+ports during the detection process under DOS.
+.IP "-p, --project file_name"
+Loads the indicated project, if the file doesn't exist the editor creates
+a new one.
+.IP "-r, --no-redirect"
+Disables the stderr redirection. Only used during debugging process, if you
+don't do it while debugging you won't be able to collect debugging
+information sent to the
+.B stderr
+output.
+.IP "-t, --tile-vert"
+After opening all the files the windows are arranged using vertical tile
+style. Only editor windows are affected.
+.IP "-T, --tile-horiz"
+After opening all the files the windows are arranged using horizontal tile
+style. Only editor windows are affected.
+.SH FILES
+.I "/usr/share/setedit/*.pmc %DJDIR%/share/setedit/*.pmc"
+.RS
+Pseudo macro files.
+.RE
+.I "%DJDIR%/share/setedit/*.sft"
+.RS
+Editor fonts.
+.RE
+.I "~/.setedit/.deflopts.txt %DJDIR%/share/setedit/deflopts.txt"
+.RS
+Default edition options for each syntax highlight mode.
+.RE
+.I "/usr/share/setedit/editor.tip %DJDIR%/share/setedit/editor.tip"
+.RS
+Tip of the day file.
+.RE
+.I "%DJDIR%/share/setedit/extrscsv.txt"
+.RS
+External screen savers list.
+.RE
+.I "/usr/share/setedit/*.frt %DJDIR%/share/setedit/*.frt"
+.RS
+Format files for the documentation generator module.
+.RE
+.I "%DJDIR%/share/setedit/install.log"
+.RS
+Log file created by the installer.
+.RE
+.I "~/.setedit/.keybind.dat %DJDIR%/share/setedit/keybind.dat"
+.RS
+Keyboard bindings configured by the user.
+.RE
+.I "/usr/share/setedit/macros.slp %DJDIR%/share/setedit/macros.slp"
+.RS
+sLisp macros file.
+.RE
+.I "/usr/share/setedit/menubind.smn %DJDIR%/share/setedit/menubind.smn"
+.RS
+Menu bindings.
+.RE
+.I "~/.setedit/.setenvir.dat %DJDIR%/share/setedit/setenvir.dat"
+.RS
+Environment variables visible only while inside the editor.
+.RE
+.I "/usr/share/setedit/syntaxhl.shl %DJDIR%/share/setedit/syntaxhl.shl"
+.RS
+Syntax highlight configuration file.
+.RE
+.I "~/.setedit/.userword.txt %DJDIR%/share/setedit/userword.txt"
+.RS
+User words for each syntax highlight.
+.SH ENVIRONMENT
+.IP SET_CMDLINE
+Indicates default command line options. Please read the "Passing extra
+command line options" section of the "Miscellaneous" chapter of the
+manual to understand how it works.
+.IP SET_FILES
+Indicates where the configuration files are located. If not defined the
+editor will guess the location.
+.IP SET_LOCALEDIR
+Indicates where the internationalization files for the editor are located.
+.IP SET_STACKDBG
+Indicates the default value for the
+.B --stack-dbg
+command line option.
+.IP INFOPATH
+Indicates where help files in info format are located. If not defined the
+editor will guess the location.
+.IP MANPATH
+The editor uses man command to parse manpages. For this reason MANPATH also
+affects setedit.
+.SH AUTHOR
+Salvador Eduardo Tropea <salvador@inti.gov.ar>
diff --git a/setedit/easydiag/easydia1.h b/setedit/easydiag/easydia1.h
new file mode 100644
index 0000000..7808ae0
--- /dev/null
+++ b/setedit/easydiag/easydia1.h
@@ -0,0 +1,171 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+#ifndef Dont_Use_32Bits_Clusters
+#define Clusters32Bits
+#endif
+
+#ifdef Uses_TSSlider
+#define INCL_TSSlider
+#define Uses_TScrollBar
+#define Uses_TStaticText
+#define Uses_TSView
+#endif
+
+#ifdef Uses_TSLabelCheck
+#define INCL_TSLabelCheck
+#define Uses_TSLabel
+#endif
+
+#ifdef Uses_TSLabelRadio
+#define INCL_TSLabelRadio
+#define Uses_TSLabel
+#endif
+
+#ifdef Uses_TSCheckBoxesArray
+#define Uses_TSView
+#define Uses_TCheckBoxesArray
+#define INCL_TSCHKARR
+#endif
+
+#ifdef Uses_TCheckBoxesArray
+#define Uses_TClusterArray
+#define INCL_TCheckBoxesArray
+#endif
+
+#ifdef Uses_TClusterArray
+#define Uses_TView
+#define INCL_TClusterArray
+#endif
+
+#ifdef Uses_TSTextScroller
+#define Uses_TTextScroller
+#define Uses_TSViewCol
+#define INCL_TSTextScroller
+#endif
+
+#ifdef Uses_TTextScroller
+#define Uses_TNSCollection
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TPalette
+#define Uses_TEvent
+#define INCL_TTextScroller
+#endif
+
+#ifdef Uses_TSHzLabel
+#define Uses_TSLabel
+#endif
+
+#ifdef Uses_TSHzGroup
+#define INCL_TSHzGroup
+#define Uses_TSViewCol
+#endif
+
+#ifdef Uses_TSVeGroup
+#define INCL_TSVeGroup
+#define Uses_TSViewCol
+#endif
+
+#ifdef Uses_TSLabel
+#define INCL_TSLabel
+#define Uses_TSViewCol
+#define Uses_TLabel
+#endif
+
+#ifdef Uses_TSCheckBoxes
+#define INCL_TSCheckBoxes
+#define Uses_TSViewCol
+#define Uses_TCheckBoxes
+#define Uses_TSItem
+#endif
+
+#ifdef Uses_TSRadioButtons
+#define INCL_TSRadioButtons
+#define Uses_TSViewCol
+#define Uses_TRadioButtons
+#define Uses_TSItem
+#endif
+
+#ifdef Uses_TSInputLine
+#define INCL_TSInputLine
+#define Uses_TSViewCol
+#define Uses_TInputLine
+#define Uses_THistory
+#endif
+
+#ifdef Uses_TSInputLinePiped
+#define INCL_TSInputLinePiped
+#define Uses_TSViewCol
+#define Uses_TInputLinePiped
+#define Uses_THistory
+#endif
+
+#ifdef Uses_TSButton
+#define INCL_TSButton
+#define Uses_TSViewCol
+#define Uses_TButton
+#endif
+
+
+#ifdef Uses_TSStaticText
+#define INCL_TSStaticText
+#define Uses_TSViewCol
+#define Uses_TStaticText
+#endif
+
+#ifdef Uses_TSSortedListBox
+#define INCL_TSSortedListBox
+#define Uses_TSListBox
+#define Uses_TSortedListBox
+#endif
+
+#ifdef Uses_TSStringableListBox
+#define INCL_TSStringableListBox
+#define Uses_TSListBox
+#define Uses_TStringableListBox
+#endif
+
+#ifdef Uses_TSSOSSortedListBox
+#define INCL_TSSOSSortedListBox
+#define Uses_TSListBox
+#define Uses_TSOSSortedListBox
+#endif
+
+#ifdef Uses_TSListBox
+#define INCL_TSListBox
+#define Uses_TSSortedListBox_Var
+#define Uses_TSViewCol
+#define Uses_TListBox
+#define Uses_TScrollBar
+#endif
+
+#ifdef Uses_TSSortedListBox_Var
+#define INCL_TSSortedListBox_Var
+#endif
+
+#ifdef Uses_TSNoStaticText
+#define INCL_SNOSTATE
+#define Uses_TSViewCol
+#define Uses_TNoStaticText
+#endif
+
+#ifdef Uses_TSHScrollBar
+#define INCL_TSHSCROL
+#define Uses_TSViewCol
+#define Uses_TScrollBar
+#endif
+
+#ifdef Uses_TSViewCol
+#define INCL_TSViewCol
+#define Uses_TNSCollection
+#define Uses_TSView
+#define Uses_TDeskTop
+#endif
+
+#ifdef Uses_TSView
+#define INCL_TSView
+#define Uses_TDialog
+#endif
+
+
diff --git a/setedit/easydiag/easydiag.h b/setedit/easydiag/easydiag.h
new file mode 100644
index 0000000..be236bd
--- /dev/null
+++ b/setedit/easydiag/easydiag.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef INCL_TClusterArray
+#include <tmiclust.h>
+#endif
+
+#ifdef INCL_TCheckBoxesArray
+#include <tcheck2.h>
+#endif
+
+#ifdef INCL_TSView
+#include <tsview.h>
+#endif
+
+#ifdef INCL_TSViewCol
+#include <tsviewco.h>
+#endif
+
+#ifdef INCL_SNOSTATE
+#include <snostate.h>
+#endif
+
+#ifdef INCL_TSHSCROL
+#include <tshscrol.h>
+#endif
+
+#ifdef INCL_TTextScroller
+#include <ttextscr.h>
+#endif
+
+#ifdef INCL_TSTextScroller
+#include <tstextsc.h>
+#endif
+
+#ifdef INCL_TSSortedListBox_Var
+#include <tssortva.h>
+#endif
+
+// It before the rest of the List Boxes because it's the base
+#ifdef INCL_TSListBox
+#include <tslistbo.h>
+#endif
+
+#ifdef INCL_TSStringableListBox
+#include <tstsorlb.h>
+#endif
+
+#ifdef INCL_TSSortedListBox
+#include <tssortlb.h>
+#endif
+
+#ifdef INCL_TSSOSSortedListBox
+#include <tssosslb.h>
+#endif
+
+#ifdef INCL_TSStaticText
+#include <tstatext.h>
+#endif
+
+#ifdef INCL_TSButton
+#include <tsbutton.h>
+#endif
+
+#ifdef INCL_TSCHKARR
+#include <tschkarr.h>
+#endif
+
+#ifdef INCL_TSHzGroup
+#include <tshzgrp.h>
+#endif
+
+#ifdef INCL_TSVeGroup
+#include <tsvegrp.h>
+#endif
+
+#ifdef INCL_TSInputLine
+#include <tsinplin.h>
+#endif
+
+#ifdef INCL_TSInputLinePiped
+#include <tsinplpi.h>
+#endif
+
+#ifdef INCL_TSLabel
+#include <tslabel.h>
+#endif
+
+#ifdef INCL_TSCheckBoxes
+#include <tschkbox.h>
+#endif
+
+#ifdef INCL_TSRadioButtons
+#include <tsradbot.h>
+#endif
+
+#ifdef INCL_TSSlider
+#include <tslider.h>
+#endif
+
+#ifdef INCL_TSLabelCheck
+TSLabel *TSLabelCheck(const char *name, ...);
+TSLabel *TSLabelCheck(int columns, const char *name, ...);
+#endif
+
+#ifdef INCL_TSLabelRadio
+TSLabel *TSLabelRadio(const char *name, ...);
+TSLabel *TSLabelRadio(int columns, const char *name, ...);
+#endif
+
diff --git a/setedit/easydiag/lablchek.cc b/setedit/easydiag/lablchek.cc
new file mode 100644
index 0000000..54966c8
--- /dev/null
+++ b/setedit/easydiag/lablchek.cc
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSLabelCheck
+#define Uses_TSCheckBoxes
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+#include <stdarg.h>
+
+TSLabel *TSLabelCheck(const char *name, ...)
+{
+ const char *s;
+ va_list arg;
+ va_start(arg,name);
+
+ TSItem *first=0,*last=0,*aux;
+ while ((s=va_arg(arg,const char *))!=0)
+ {
+ aux=new TSItem(s,0);
+ if (!first)
+ first=aux;
+ if (last)
+ last->next=aux;
+ last=aux;
+ }
+ va_end(arg);
+ return new TSLabel(name,new TSCheckBoxes(first));
+}
+
+TSLabel *TSLabelCheck(int columns, const char *name, ...)
+{
+ const char *s;
+ va_list arg;
+ va_start(arg,name);
+
+ TSItem *first=0,*last=0,*aux;
+ while ((s=va_arg(arg,const char *))!=0)
+ {
+ aux=new TSItem(s,0);
+ if (!first)
+ first=aux;
+ if (last)
+ last->next=aux;
+ last=aux;
+ }
+ va_end(arg);
+ return new TSLabel(name,new TSCheckBoxes(first,-1,columns));
+}
diff --git a/setedit/easydiag/lablradi.cc b/setedit/easydiag/lablradi.cc
new file mode 100644
index 0000000..f65157e
--- /dev/null
+++ b/setedit/easydiag/lablradi.cc
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSLabelRadio
+#define Uses_TSRadioButtons
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+#include <stdarg.h>
+
+TSLabel *TSLabelRadio(const char *name, ...)
+{
+ const char *s;
+ va_list arg;
+ va_start(arg,name);
+
+ TSItem *first=0,*last=0,*aux;
+ while ((s=va_arg(arg,const char *))!=0)
+ {
+ aux=new TSItem(s,0);
+ if (!first)
+ first=aux;
+ if (last)
+ last->next=aux;
+ last=aux;
+ }
+ va_end(arg);
+ return new TSLabel(name,new TSRadioButtons(first));
+}
+
+TSLabel *TSLabelRadio(int columns, const char *name, ...)
+{
+ const char *s;
+ va_list arg;
+ va_start(arg,name);
+
+ TSItem *first=0,*last=0,*aux;
+ while ((s=va_arg(arg,const char *))!=0)
+ {
+ aux=new TSItem(s,0);
+ if (!first)
+ first=aux;
+ if (last)
+ last->next=aux;
+ last=aux;
+ }
+ va_end(arg);
+ return new TSLabel(name,new TSRadioButtons(first,-1,columns));
+}
+
diff --git a/setedit/easydiag/snostate.cc b/setedit/easydiag/snostate.cc
new file mode 100644
index 0000000..053f490
--- /dev/null
+++ b/setedit/easydiag/snostate.cc
@@ -0,0 +1,46 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSNoStaticText
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ SView wrapper for the no static text object just pass the string.
+
+***************************************************************************/
+
+TSNoStaticText::TSNoStaticText(const char *aText) :
+ TSView()
+{
+ int lines=1;
+ int max_w=0,cur_w=0;
+ stTVIntl *cache=NULL;
+ const char *s=TVIntl::getText(aText,cache);
+
+ while (*s)
+ {
+ if (*s==3)
+ {
+ s++;
+ continue;
+ }
+ if (*s=='\n')
+ {
+ lines++;
+ cur_w=0;
+ s++;
+ continue;
+ }
+ cur_w++;
+ if (cur_w>max_w)
+ max_w=cur_w;
+ s++;
+ }
+ w=max_w;
+ h=lines;
+ view=new TNoStaticText(TRect(0,0,w,h),aText,cache);
+}
+
diff --git a/setedit/easydiag/snostate.h b/setedit/easydiag/snostate.h
new file mode 100644
index 0000000..d654e49
--- /dev/null
+++ b/setedit/easydiag/snostate.h
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSNoStaticText) && !defined(__TSNoStaticText_Defined__)
+#define __TSNoStaticText_Defined__
+
+class TSNoStaticText : public TSView
+{
+public:
+ TSNoStaticText(const char *aText);
+};
+
+#endif
diff --git a/setedit/easydiag/tcheck2.cc b/setedit/easydiag/tcheck2.cc
new file mode 100644
index 0000000..2027f35
--- /dev/null
+++ b/setedit/easydiag/tcheck2.cc
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCheckBoxesArray
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+const char *TCheckBoxesArray::button=" [ ] ";
+
+void TCheckBoxesArray::draw()
+{
+ drawBox( button, 'X' );
+}
+
+Boolean TCheckBoxesArray::mark(int item)
+{
+ return Boolean( (value & (uint64(1)<<item)) != 0 );
+}
+
+void TCheckBoxesArray::press(int item)
+{
+ if (!pressCallBack || (pressCallBack && pressCallBack(item)))
+ value=value^(uint64(1)<<item);
+}
+
+#define NO_STREAM
+#if !defined( NO_STREAM )
+
+TStreamable *TCheckBoxesArray::build()
+{
+ return new TCheckBoxesArray( streamableInit );
+}
+
+TCheckBoxesArray::TCheckBoxesArray( StreamableInit ) : TCluster( streamableInit )
+{
+}
+
+#endif // NO_STREAM
diff --git a/setedit/easydiag/tcheck2.h b/setedit/easydiag/tcheck2.h
new file mode 100644
index 0000000..2bacc41
--- /dev/null
+++ b/setedit/easydiag/tcheck2.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+/* ---------------------------------------------------------------------- */
+/* TCheckBoxesArray */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* 3 = Normal shortcut */
+/* 4 = Selected shortcut */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TCheckBoxesArray ) && !defined( __TCheckBoxesArray )
+#define __TCheckBoxesArray
+
+class TRect;
+class TSItem;
+
+#define SET_NO_STREAM
+
+class TCheckBoxesArray : public TClusterArray
+{
+
+public:
+
+ TCheckBoxesArray( const TRect& bounds, int number);
+
+ virtual void draw();
+
+ virtual Boolean mark( int item );
+ virtual void press( int item );
+
+ int (*pressCallBack)(int);
+
+private:
+
+ static const char * button;
+#if !defined( SET_NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TCheckBoxesArray( StreamableInit );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( SET_NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TCheckBoxesArray& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TCheckBoxesArray*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TCheckBoxesArray& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TCheckBoxesArray* cl )
+ { return os << (TStreamable *)cl; }
+#endif // SET_NO_STREAM
+
+inline TCheckBoxesArray::TCheckBoxesArray( const TRect& bounds, int number) :
+ TClusterArray( bounds, number ),
+ pressCallBack(0)
+{
+}
+
+#endif // Uses_TCheckBoxesArray
+
diff --git a/setedit/easydiag/test.cc b/setedit/easydiag/test.cc
new file mode 100644
index 0000000..0883f5c
--- /dev/null
+++ b/setedit/easydiag/test.cc
@@ -0,0 +1,395 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*
+Ver:
+TSViewCol: El destructor debe romper los objetos o ya lo hace TNSCollection?
+19/3/98 2h escib.
+19/3/98 1h de pensar en el viaje
+19/3/98 2h en casa.
+20/3/98 2h en casa. Organizacin en headers, etc.
+22/3/98 1h 40' Suficiente avance como para modelar el ^QA perfecto!
+*/
+#define Uses_string
+#include <stdio.h>
+#include <assert.h>
+#define Uses_TApplication
+
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSInputLine
+#define Uses_TSInputLinePiped
+#define Uses_TSHzGroup
+#define Uses_TSVeGroup
+#define Uses_TSLabel
+#define Uses_TSCheckBoxes
+#define Uses_TSRadioButtons
+#define Uses_TSSortedListBox
+//#define Uses_TSSOSSortedListBox
+#define Uses_TSTextScroller
+#define Uses_TSSlider
+#define Uses_TSNoStaticText
+
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+class TMiApp : public TApplication
+{
+public:
+ TMiApp() :
+ TProgInit( TMiApp::initStatusLine,
+ TMiApp::initMenuBar,
+ TMiApp::initDeskTop
+ ),
+ TApplication()
+ { insertDialog(); }
+ virtual void setState(ushort,Boolean) {};
+ void insertDialog();
+};
+
+/*** Test 1 a very easy dialog
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),"Test"));
+
+ // First we create the object without specifying the position
+ TSStaticText *text=new TSStaticText("Hello, how are you?");
+ TSButton *but=new TSButton("Press it");
+ // Center X and start at y=2
+ col->insert(xTSCenter,2,text);
+ // Center X and put it under the text
+ col->insert(xTSCenter,yTSUnder,but,0,text);
+ // That's all now let the wizard do the job ;-)
+ col->doIt(deskTop);
+ delete col;
+}
+**************/
+
+/******** Test 2 same but it tests the TSHzGroup
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),"Test"));
+
+ // First we create the object without specifying the position
+ TSStaticText *text=new TSStaticText("Hello, how are you?");
+ // That's a little tricky: I simply create groups of 2 SViews and as I
+ // need more than 2 I just put a group as second element
+ TSHzGroup *but123=new TSHzGroup(new TSButton("Button 1"),
+ new TSHzGroup(new TSButton("Button 2"),
+ new TSButton("Button 3")));
+ // Center X and start at y=2
+ col->insert(xTSCenter,2,text);
+ // Center X and put it under the text
+ col->insert(xTSCenter,yTSUnder,but123,0,text);
+ // That's all now let the wizard do the job ;-)
+ col->doIt(deskTop);
+ delete col;
+}
+************/
+
+/******** Test 3 Labels and input lines
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),"Test"));
+
+ // First we create the object without specifying the position
+ TSInputLine *text=new TSInputLine(20,(ushort)100);
+ TSLabel *label=new TSLabel("Enter a text",text);
+
+ // As the label contains the text we just need to insert the label
+ // Center X and start at y=2
+ col->insert(xTSCenter,2,label);
+ // That's all now let the wizard do the job ;-)
+ col->doIt(deskTop);
+ delete col;
+}
+**********/
+
+
+/******** Test 4 CheckBoxes and RadioButtons
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),"Test"));
+
+ // First we create the object without specifying the position
+ TSCheckBoxes *options = new TSCheckBoxes(
+ new TSItem(__("~C~ase sensitive"),
+ new TSItem(__("~W~hole words only"),
+ new TSItem(__("Re~g~ular expressions"),
+ new TSItem(__("E~x~tended regex"),
+ new TSItem(__("~P~rompt on replace"),
+ new TSItem(__("~R~eplace all"), 0 )))))));
+ TSLabel *label=new TSLabel("Some options",options);
+
+ TSRadioButtons *scope = new TSRadioButtons(
+ new TSItem( __("~F~rom cursor"),
+ new TSItem( __("~E~ntire scope"), 0 )));
+ TSLabel *label2=new TSLabel("Origin", scope);
+
+ // As the label contains the text we just need to insert the label
+ col->insert(xTSCenter,1,label);
+ col->insert(xTSCenter,yTSUnder,label2,0,label);
+ // That's all now let the wizard do the job ;-)
+ col->doIt(deskTop);
+ delete col;
+}
+***********/
+
+/********
+void TMiApp::insertDialog()
+{
+ //TDialog *d = new TDialog( TRect( 0, 0, 76, 18 ), __("Replace") );
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),"Replace"));
+
+ //TInputLinePiped *control=new TInputLinePiped(TRect(3,3,34,4),80);
+ //d->insert( control );
+ //d->insert(
+ // new TLabel( TRect( 2, 2, 33, 3 ), __("~T~ext to find"), control ) );
+ //d->insert( new THistory( TRect( 34, 3, 37, 4 ), control, hID_TextSearchEditor ) );
+ #define FixWTest 30
+
+ TSInputLine *textF=new TSInputLine(80,1,(ushort)100,FixWTest);
+ TSLabel *TextToFind=new TSLabel("~T~ext to find",textF);
+
+ //TInputLinePiped *control2=new TInputLinePiped(TRect(39,3,70,4),80);
+ //d->insert( control2 );
+ //d->insert( new TLabel( TRect( 38, 2, 69, 3 ), __("~N~ew text"), control2 ) );
+ //d->insert( new THistory( TRect( 70, 3, 73, 4 ), control2, hID_TextReplaceEditor ) );
+ TSInputLine *textN=new TSInputLine(80,1,(ushort)101,FixWTest);
+ TSLabel *newText=new TSLabel("~N~ew text",textN);
+
+ //TCheckBoxes *options = new TCheckBoxes( TRect( 3, 6, 37, 12 ),
+ // new TSItem(__("~C~ase sensitive"),
+ // new TSItem(__("~W~hole words only"),
+ // new TSItem(__("Re~g~ular expressions"),
+ // new TSItem(__("E~x~tended regex"),
+ // new TSItem(__("~P~rompt on replace"),
+ // new TSItem(__("~R~eplace all"), 0 )))))));
+ //d->insert( options );
+ //d->insert(
+ // new TLabel( TRect( 2, 5, 35, 6 ), __("Options"), options ) );
+ TSCheckBoxes *options = new TSCheckBoxes(
+ new TSItem(__("~C~ase sensitive"),
+ new TSItem(__("~W~hole words only"),
+ new TSItem(__("Re~g~ular expressions"),
+ new TSItem(__("E~x~tended regex"),
+ new TSItem(__("~P~rompt on replace"),
+ new TSItem(__("~R~eplace all"), 0 )))))));//,FixWTest);
+ TSLabel *Options=new TSLabel("Options",options);
+
+ //TRadioButtons *origin = new TRadioButtons( TRect( 39, 6, 73, 8 ),
+ // new TSItem( __("~G~lobal"),
+ // new TSItem( __("~S~elected text"), 0 )));
+ //d->insert( origin );
+ //d->insert(
+ // new TLabel( TRect( 38, 5, 71, 6 ), __("Scope"), origin ) );
+ TSRadioButtons *origin = new TSRadioButtons(
+ new TSItem( __("~G~lobal"),
+ new TSItem( __("~S~elected text"), 0 )));//,FixWTest);
+ TSLabel *Origin=new TSLabel("Scope",origin);
+
+ //TRadioButtons *scope = new TRadioButtons( TRect( 39, 10, 73, 12 ),
+ // new TSItem( __("~F~rom cursor"),
+ // new TSItem( __("~E~ntire scope"), 0 )));
+ //d->insert( scope );
+ //d->insert(
+ // new TLabel( TRect( 38, 9, 71, 10 ), __("Origin"), scope ) );
+ TSRadioButtons *scope =new TSRadioButtons(
+ new TSItem( __("~F~rom cursor"),
+ new TSItem( __("~E~ntire scope"), 0 )));//,FixWTest);
+ TSLabel *Scope=new TSLabel("Origin",scope);
+
+ //d->insert(
+ // new TButton( TRect( 29, 15, 39, 17 ), __("O~K~"), cmOK, bfDefault ) );
+ //d->insert(
+ // new TButton( TRect( 41, 15, 59, 17 ), __("Replace ~A~ll"), cmYes, bfNormal) );
+ //d->insert(
+ // new TButton( TRect( 61, 15, 74, 17 ),__("Cancel"), cmCancel, bfNormal ) );
+ //TSHzGroup *but123=new TSHzGroup(new TSButton("O~K~",cmOK,bfDefault),
+ // new TSHzGroup(new TSButton("Replace ~A~ll",cmYes),
+ // new TSButton("Cancel",cmCancel)));
+
+ col->insert(2,2,TextToFind);
+ col->insert(xTSRightOf,2,newText,TextToFind);
+ col->insert(2,yTSUnder,Options,0,TextToFind);
+ col->insert(xTSRightOf,yTSUnder,Origin,TextToFind,newText);
+ col->insert(xTSRightOf,yTSUnder,Scope,TextToFind,Origin);
+ EasyInsertOKCancel(col,2);
+ //col->insert(xTSCenter,yTSDown,but123);
+
+ //d->options|=ofCentered;
+ //d->selectNext( False );
+ //return d;
+ col->doIt(deskTop);
+ delete col;
+}
+**********/
+
+/****
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),"Replace"));
+
+ TSStaticText *text=new TSStaticText("Replace this ocurrence?");
+ TSHzGroup *buttons=new TSHzGroup(new TSButton("Yes",cmYes,bfDefault),
+ new TSHzGroup(new TSButton("No",cmNo),
+ new TSHzGroup(new TSButton("All",cmOK),
+ new TSButton("Cancel",cmCancel))));
+
+ col->insert(xTSCenter,2,text);
+ col->insert(xTSCenter,yTSUnder,buttons,0,text);
+ col->doIt(deskTop);
+ delete col;
+}
+****/
+
+/***
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Goto Line")));
+
+ TSInputLine *lineInp=new TSInputLine(10);
+ TSHzLabel *lineLabel=new TSHzLabel(__("~T~ext to find"),lineInp);
+
+ col->insert(2,2,lineLabel);
+ EasyInsertOKCancel(col);
+
+ col->doIt(deskTop);
+ delete col;
+}
+****/
+
+/************
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Goto Line")));
+
+ TSSortedListBox *list=new TSSortedListBox(20,5,tsslbHorizontal);
+ TSLabel *label=new TSLabel("~S~ome o~p~tions 567890123",list);
+
+ col->insert(2,2,label);
+ EasyInsertOKCancel(col);
+
+ col->doIt(deskTop);
+ delete col;
+}
+************/
+
+
+/************
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Goto Line")));
+
+ TNSCollection *list=new TNSCollection(14,3);
+ list->insert("1234567890abcdefghijklmnopqrstuvwxyz");
+ list->insert("2");
+ list->insert("3");
+ list->insert("4");
+ list->insert("5");
+ list->insert("6");
+ list->insert("7");
+ list->insert("8");
+ list->insert("9");
+ list->insert("10");
+ list->insert("11");
+ list->insert("12");
+ list->insert("13");
+ list->insert("14");
+ TSTextScroller *pp=new TSTextScroller(30,10,list,1,1);
+
+ col->insert(2,2,pp);
+
+ col->doIt(deskTop);
+ delete col;
+}
+************/
+
+/************/
+static TNoStaticText *LeftVal;
+static TNoStaticText *RightVal;
+static int Join=1;
+
+static
+void CallBack(int value, TScrollBarCB *, void *data)
+{
+ int which=(int)data;
+ char buffer[4];
+ sprintf(buffer,"%d",value);
+ if (which)
+ RightVal->setText(buffer);
+ else
+ LeftVal->setText(buffer);
+}
+
+void TMiApp::insertDialog()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Sliders")));
+
+ TSNoStaticText *lval=new TSNoStaticText(" 0");
+ LeftVal=(TNoStaticText *)lval->view;
+ TSNoStaticText *rval=new TSNoStaticText(" 0");
+ RightVal=(TNoStaticText *)rval->view;
+ TSSlider *sl=new TSSlider(12,True," Vol ",CallBack,(void *)0,CallBack,(void *)1,&Join);
+ sl->Set(50,50);
+
+ col->insert(2,2,sl);
+ col->insert(2,yTSUnder,lval,0,sl);
+ col->insert(xTSRightOf,yTSUnder,rval,lval,sl);
+ col->doIt(deskTop);
+ delete col;
+}
+/************/
+
+
+/************
+#define TCEDITOR_VERSION 0x414
+void TMiApp::insertDialog()
+{
+ char b[54];
+ TSStaticText *ant,*cur;
+
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("About")));
+
+ TSView::yDefSep=0;
+ sprintf(b,_("SET's Editor v%X.%X.%X, (c) 1996-1998"),TCEDITOR_VERSION>>16,
+ (TCEDITOR_VERSION>>8) & 0xFF,TCEDITOR_VERSION & 0xFF);
+ ant=new TSStaticText(b);
+ col->insert(xTSCenter,2,ant);
+
+ #define i(a) cur=new TSStaticText(a); \
+ col->insert(xTSCenter,yTSUnder,cur,0,ant); \
+ ant=cur
+ i(__("by Salvador Eduardo Tropea"));
+ i(__("A text editor especially designed for programmers."));
+
+ TSView::yDefSep=1;
+ i(__("Made in Argentina"));
+ #undef i
+ #define i(a) cur=new TSStaticText(a); \
+ col->insert(2,yTSUnder,cur,0,ant); \
+ ant=cur
+ i(__("Thanks to:"));
+ TSView::yDefSep=0;
+ i(__("The FSF and GNU people for such good tools"));
+ i(__("DJ Delorie and collaborators for porting it to DOS"));
+ i(__("Robert Hhne for porting TVision and creating RHIDE"));
+ i(__("The University of California, Berkeley and its contributors"));
+ i(__("All my friends that support my project (Laszlo, Marek, etc)"));
+ #undef i
+
+ TSView::yDefSep=1;
+ col->insert(xTSCenter,yTSUnder,new TSButton("O~K~",cmOK,bfDefault),0,ant);
+
+ col->doIt(deskTop);
+ delete col;
+}
+************/
+
+int main(void)
+{
+ TMiApp *app=new TMiApp();
+ app->run();
+ delete app;
+ return 0;
+}
diff --git a/setedit/easydiag/tmiclust.cc b/setedit/easydiag/tmiclust.cc
new file mode 100644
index 0000000..cae8c5e
--- /dev/null
+++ b/setedit/easydiag/tmiclust.cc
@@ -0,0 +1,304 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+
+#define Uses_TKeys
+#define Uses_TMiCluster
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TPoint
+#define Uses_TSItem
+#define Uses_TStringCollection
+#define Uses_TGroup
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TPalette
+
+#define Uses_TClusterArray
+
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+#include <ctype.h>
+
+#define cpCluster "\x10\x11\x12\x12"
+
+TClusterArray::TClusterArray( const TRect& bounds, int number ) :
+ TView(bounds),
+ value( 0 ),
+ sel( 0 )
+{
+ options |= ofSelectable | ofFirstClick | ofPreProcess | ofPostProcess;
+
+ numItems=number;
+
+ setCursor( 2, 0 );
+ showCursor();
+}
+
+TClusterArray::~TClusterArray()
+{
+}
+
+uint32 TClusterArray::dataSize()
+{
+ return sizeof(uint64);
+}
+
+void TClusterArray::drawBox( const char *icon, char marker)
+{
+ TDrawBuffer b;
+ ushort color;
+
+ ushort cNorm = getColor( 0x0301 );
+ ushort cSel = getColor( 0x0402 );
+ for( int i = 0; i <= size.y; i++ )
+ {
+ for( int j = 0; j <= (numItems-1)/size.y + 1; j++ )
+ {
+ int cur = j * size.y + i;
+ if( cur < numItems )
+ {
+ int col = column( cur );
+ if( (cur == sel) && (state & sfSelected) != 0 )
+ color = cSel;
+ else
+ color = cNorm;
+ b.moveChar( col, ' ', color, size.x - col );
+ b.moveCStr( col, icon, color );
+ if( mark(cur) )
+ b.putChar( col+2, marker );
+ if( showMarkers && (state & sfSelected) != 0 && cur == sel )
+ {
+ b.putChar( col, specialChars[0] );
+ b.putChar( column(cur+size.y)-1, specialChars[1] );
+ }
+ }
+ }
+ writeBuf( 0, i, size.x, 1, b );
+ }
+ setCursor( column(sel)+2, row(sel) );
+}
+
+void TClusterArray::getData(void * rec)
+{
+ memcpy(rec,&value,dataSize());
+#if 0 // Why this
+ drawView();
+#endif
+}
+
+ushort TClusterArray::getHelpCtx()
+{
+ if( helpCtx == hcNoContext )
+ return hcNoContext;
+ else
+ return helpCtx + sel;
+}
+
+TPalette& TClusterArray::getPalette() const
+{
+ static TPalette palette( cpCluster, sizeof( cpCluster )-1 );
+ return palette;
+}
+
+void TClusterArray::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+ if( event.what == evMouseDown )
+ {
+ TPoint mouse = makeLocal( event.mouse.where );
+ int i = findSel(mouse);
+ if( i != -1 )
+ sel = i;
+ drawView();
+ do {
+ mouse = makeLocal( event.mouse.where );
+ if( findSel(mouse) == sel )
+ showCursor();
+ else
+ hideCursor();
+ } while( mouseEvent(event,evMouseMove) );
+ showCursor();
+ mouse = makeLocal( event.mouse.where );
+ if( findSel(mouse) == sel )
+ {
+ press(sel);
+ drawView();
+ }
+ clearEvent(event);
+ }
+ else if( event.what == evKeyDown )
+ switch (ctrlToArrow(event.keyDown.keyCode))
+ {
+ case kbUp:
+ if( (state & sfFocused) != 0 )
+ {
+ if( --sel < 0 )
+ sel = numItems-1;
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+
+ case kbDown:
+ if( (state & sfFocused) != 0 )
+ {
+ if( ++sel >= numItems )
+ sel = 0;
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+ case kbRight:
+ if( (state & sfFocused) != 0 )
+ {
+ sel += size.y;
+ if( sel >= numItems )
+ {
+ sel = (sel + 1) % size.y;
+ if( sel >= numItems )
+ sel = 0;
+ }
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+ case kbLeft:
+ if( (state & sfFocused) != 0 )
+ {
+ if( sel > 0 )
+ {
+ sel -= size.y;
+ if( sel < 0 )
+ {
+ sel = ((numItems+size.y-1) /size.y)*size.y + sel - 1;
+ if( sel >= numItems )
+ sel = numItems-1;
+ }
+ }
+ else
+ sel = numItems-1;
+ movedTo(sel);
+ drawView();
+ clearEvent(event);
+ }
+ break;
+ default:
+ if( event.keyDown.charScan.charCode == ' ' &&
+ (state & sfFocused) != 0
+ )
+ {
+ press(sel);
+ drawView();
+ clearEvent(event);
+ }
+ }
+}
+
+void TClusterArray::setData(void * rec)
+{
+ memcpy(&value,rec,dataSize());
+ drawView();
+}
+
+void TClusterArray::setState( ushort aState, Boolean enable )
+{
+ TView::setState( aState, enable );
+ if( aState == sfSelected )
+ drawView();
+}
+
+Boolean TClusterArray::mark( int )
+{
+ return False;
+}
+
+void TClusterArray::movedTo( int )
+{
+}
+
+void TClusterArray::press( int )
+{
+}
+
+int TClusterArray::column( int item )
+{
+ if( item < size.y )
+ return 0;
+ else
+ {
+ int width = 0;
+ int col = -4;
+ int l = 0;
+ for( int i = 0; i <= item; i++ )
+ {
+ if( i % size.y == 0 )
+ {
+ col += width + 4;
+ width = 0;
+ }
+
+ if( i < numItems )
+ l = 0;
+ if( l > width )
+ width = l;
+ }
+ return col;
+ }
+}
+
+int TClusterArray::findSel( TPoint p )
+{
+ TRect r = getExtent();
+ if( !r.contains(p) )
+ return -1;
+ else
+ {
+ int i = 0;
+ while( p.x >= column( i + size.y ) )
+ i += size.y;
+ int s = i + p.y;
+ if( s >= numItems )
+ return -1;
+ else
+ return s;
+ }
+}
+
+int TClusterArray::row( int item )
+{
+ return item % size.y;
+}
+
+#define NO_STREAM
+#if !defined( NO_STREAM )
+void TClusterArray::write( opstream& os )
+{
+ TView::write( os );
+ os << value << sel << numItems;
+}
+
+void *TClusterArray::read( ipstream& is )
+{
+ TView::read( is );
+ is >> value >> sel >> numItems;
+ setCursor( 2, 0 );
+ showCursor();
+ return this;
+}
+
+TStreamable *TClusterArray::build()
+{
+ return new TClusterArray( streamableInit );
+}
+
+TClusterArray::TClusterArray( StreamableInit ) : TView( streamableInit )
+{
+}
+#endif // NO_STREAM
+
diff --git a/setedit/easydiag/tmiclust.h b/setedit/easydiag/tmiclust.h
new file mode 100644
index 0000000..2e37af9
--- /dev/null
+++ b/setedit/easydiag/tmiclust.h
@@ -0,0 +1,86 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+/* ---------------------------------------------------------------------- */
+/* class TClusterArray */
+/* */
+/* Palette layout */
+/* 1 = Normal text */
+/* 2 = Selected text */
+/* 3 = Normal shortcut */
+/* 4 = Selected shortcut */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TClusterArray ) && !defined( __TClusterArray )
+#define __TClusterArray
+
+#define SET_NO_STREAM
+
+class TRect;
+class TSItem;
+class TEvent;
+class TPoint;
+class TStringCollection;
+
+class TClusterArray : public TView
+{
+
+public:
+
+ TClusterArray( const TRect& bounds, int number );
+ ~TClusterArray();
+
+ virtual uint32 dataSize();
+ void drawBox( const char *icon, char marker );
+ virtual void getData( void *rec );
+ ushort getHelpCtx();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual Boolean mark( int item );
+ virtual void press( int item );
+ virtual void movedTo( int item );
+ virtual void setData( void *rec );
+ virtual void setState( ushort aState, Boolean enable );
+
+protected:
+
+ uint64 value;
+ int sel;
+ int numItems;
+
+private:
+
+ int column( int item );
+ int findSel( TPoint p );
+ int row( int item );
+#if !defined( SET_NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TClusterArray( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif
+};
+
+#if !defined( SET_NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TClusterArray& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TClusterArray*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TClusterArray& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TClusterArray* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TClusterArray
+
diff --git a/setedit/easydiag/tsbutton.cc b/setedit/easydiag/tsbutton.cc
new file mode 100644
index 0000000..e0850c0
--- /dev/null
+++ b/setedit/easydiag/tsbutton.cc
@@ -0,0 +1,105 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSButton
+#define Uses_TSViewCol
+#define Uses_TSHzGroup
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+const int tpTButton=0, tpTButtonRef=1;
+
+TSButton::TSButton(const char *aTitle, ushort aCommand, ushort aFlags, int wForced)
+{
+ fill(tpTButton,aTitle,aCommand,aFlags,wForced,0,NULL);
+}
+
+TSButton::TSButton(const char *aTitle, ushort aCommand, ushort aFlags)
+{
+ fill(tpTButton,aTitle,aCommand,aFlags,-1,0,NULL);
+}
+
+TSButton::TSButton(const char *aTitle, ushort aCommand, ushort aFlags,
+ int wForced, TButtonCallBack cb, void *cbData)
+{
+ fill(tpTButton,aTitle,aCommand,aFlags,wForced,cb,cbData);
+}
+
+TSButton::TSButton(const char *aTitle, ushort aCommand, ushort aFlags,
+ TButtonCallBack cb, void *cbData)
+{
+ fill(tpTButton,aTitle,aCommand,aFlags,-1,cb,cbData);
+}
+
+TSButtonRef::TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags, int wForced)
+{
+ fill(tpTButtonRef,aTitle,aCommand,aFlags,wForced,0,NULL);
+}
+
+TSButtonRef::TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags)
+{
+ fill(tpTButtonRef,aTitle,aCommand,aFlags,-1,0,NULL);
+}
+
+TSButtonRef::TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags,
+ int wForced, TButtonCallBack cb, void *cbData)
+{
+ fill(tpTButtonRef,aTitle,aCommand,aFlags,wForced,cb,cbData);
+}
+
+TSButtonRef::TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags,
+ TButtonCallBack cb, void *cbData)
+{
+ fill(tpTButtonRef,aTitle,aCommand,aFlags,-1,cb,cbData);
+}
+
+void TSButtonBase::fill(int type, const char *aTitle, ushort aCommand, ushort aFlags,
+ int wForced, TButtonCallBack cb, void *cbData)
+{
+ if (wForced>=0)
+ w=wForced;
+ else
+ {
+ stTVIntl *cache=NULL;
+ const char *t=TVIntl::getText(aTitle,cache);
+ w=cstrlen(t)+3;
+ TVIntl::freeSt(cache);
+ }
+ h=2;
+ TButton *b=NULL;
+ if (type==tpTButton)
+ b=new TButton(TRect(0,0,w+1,h),aTitle,aCommand,aFlags);
+ else if (type==tpTButtonRef)
+ b=new TButtonRef(TRect(0,0,w+1,h),aTitle,aCommand,aFlags);
+ if (cb!=0)
+ b->setCallBack(cb,cbData);
+ view=b;
+ // That's the more common ... I guess
+ b->growMode=gfGrowAll;
+}
+
+void TSButtonBase::insert(TDialog *d)
+{
+ // Why in the hell buttons are inserted in x+1?
+ TRect r(x-1,y,x+w,y+h);
+ view->locate(r);
+ d->insert(view);
+}
+
+void EasyInsertOKCancelSp(TSViewCol *col, int sep)
+{
+ TSHzGroup *but12=new TSHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),sep);
+ col->insert(xTSCenter,yTSDown,but12);
+ but12->Flags=wSpan;
+}
+
+void EasyInsertOKCancel(TSViewCol *col, int sep)
+{
+ TSButton *ok=new TSButton(__("O~K~"),cmOK,bfDefault);
+ //ok->view->growMode=gfGrowAll;
+ TSButton *cancel=new TSButton(__("Cancel"),cmCancel);
+ //cancel->view->growMode=gfGrowAll;
+ TSHzGroup *but12=new TSHzGroup(ok,cancel,sep);
+ col->insert(xTSCenter,yTSDown,but12);
+}
diff --git a/setedit/easydiag/tsbutton.h b/setedit/easydiag/tsbutton.h
new file mode 100644
index 0000000..f2c35df
--- /dev/null
+++ b/setedit/easydiag/tsbutton.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSButton) && !defined(__TSButton_Defined__)
+#define __TSButton_Defined__
+
+class TSButtonBase : public TSView
+{
+public:
+ void fill(int type, const char *aTitle, ushort aCommand, ushort aFlags,
+ int wForced, TButtonCallBack cb, void *cbData);
+ virtual void insert(TDialog *d);
+};
+
+class TSButton : public TSButtonBase
+{
+public:
+ TSButton(const char *aTitle, ushort aCommand=cmOK, ushort aFlags=bfNormal);
+ TSButton(const char *aTitle, ushort aCommand, ushort aFlags, int wForced);
+ TSButton(const char *aTitle, ushort aCommand, ushort aFlags,
+ TButtonCallBack cb, void *cbData=NULL);
+ TSButton(const char *aTitle, ushort aCommand, ushort aFlags, int wForced,
+ TButtonCallBack cb, void *cbData=NULL);
+};
+
+class TSButtonRef : public TSButtonBase
+{
+public:
+ TSButtonRef(const char *aTitle, ushort aCommand=cmOK, ushort aFlags=bfNormal);
+ TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags, int wForced);
+ TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags,
+ TButtonCallBack cb, void *cbData=NULL);
+ TSButtonRef(const char *aTitle, ushort aCommand, ushort aFlags, int wForced,
+ TButtonCallBack cb, void *cbData=NULL);
+};
+
+class TSViewCol;
+void EasyInsertOKCancel(TSViewCol *col, int sep=1);
+void EasyInsertOKCancelSp(TSViewCol *col, int sep=1);
+#endif
diff --git a/setedit/easydiag/tschkarr.cc b/setedit/easydiag/tschkarr.cc
new file mode 100644
index 0000000..def4fe5
--- /dev/null
+++ b/setedit/easydiag/tschkarr.cc
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSCheckBoxesArray
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSCheckBoxesArray::TSCheckBoxesArray(int xNum, int yNum)
+{
+ fill(xNum,yNum);
+}
+
+TSCheckBoxesArray::TSCheckBoxesArray(int xNum, int yNum, int (*pressCB)(int))
+{
+ TCheckBoxesArray *p=fill(xNum,yNum);
+ p->pressCallBack=pressCB;
+}
+
+TCheckBoxesArray *TSCheckBoxesArray::fill(int xNum, int yNum)
+{
+ w=xNum*4+1;
+ h=yNum;
+ TCheckBoxesArray *p=new TCheckBoxesArray(TRect(0,0,w,h),xNum*yNum);
+ view=p;
+ return p;
+}
+
+
diff --git a/setedit/easydiag/tschkarr.h b/setedit/easydiag/tschkarr.h
new file mode 100644
index 0000000..0cf006d
--- /dev/null
+++ b/setedit/easydiag/tschkarr.h
@@ -0,0 +1,14 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSCheckBoxesArray) && !defined(__TSCheckBoxesArray_Defined__)
+#define __TSCheckBoxesArray_Defined__
+
+class TSCheckBoxesArray : public TSView
+{
+public:
+ TSCheckBoxesArray(int xNum, int yNum);
+ TSCheckBoxesArray(int xNum, int yNum, int (*pressCB)(int));
+ TCheckBoxesArray *fill(int xNum, int yNum);
+};
+
+#endif
diff --git a/setedit/easydiag/tschkbox.cc b/setedit/easydiag/tschkbox.cc
new file mode 100644
index 0000000..22aeedd
--- /dev/null
+++ b/setedit/easydiag/tschkbox.cc
@@ -0,0 +1,52 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSCheckBoxes
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSCheckBoxes::TSCheckBoxes(TSItem *aStrings, int wForced, int Columns)
+{
+ TSItem *itemAux=aStrings;
+ int items=0;
+
+ while (itemAux)
+ {
+ items++;
+ itemAux=itemAux->next;
+ }
+ h=items/Columns;
+ if (items%Columns) h++;
+
+ #ifdef Clusters32Bits
+ TCheckBoxes *cb=new TCheckBoxes32(TRect(0,0,w,h),aStrings);
+ #else
+ TCheckBoxes *cb=new TCheckBoxes(TRect(0,0,w,h),aStrings);
+ #endif
+ view=cb;
+ if (wForced>=0)
+ {
+ w=wForced;
+ }
+ else
+ {
+ int wMax=0,l,item,itY;
+
+ w=0;
+ for (item=itY=0; item<items; item++)
+ {
+ l=cstrlen(cb->getItemText(item))+6;
+ if (l>wMax) wMax=l;
+ itY++;
+ if (itY==h)
+ {
+ itY=0;
+ w+=wMax;
+ wMax=0;
+ }
+ }
+ if (wMax) w+=wMax;
+ }
+}
+
+
diff --git a/setedit/easydiag/tschkbox.h b/setedit/easydiag/tschkbox.h
new file mode 100644
index 0000000..2d15b71
--- /dev/null
+++ b/setedit/easydiag/tschkbox.h
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSCheckBoxes) && !defined(__TSCheckBoxes_Defined__)
+#define __TSCheckBoxes_Defined__
+
+class TSCheckBoxes : public TSView
+{
+public:
+ TSCheckBoxes(TSItem *aStrings, int wForced=-1, int Columns=1);
+};
+
+#endif
diff --git a/setedit/easydiag/tshscrol.cc b/setedit/easydiag/tshscrol.cc
new file mode 100644
index 0000000..a3b0e53
--- /dev/null
+++ b/setedit/easydiag/tshscrol.cc
@@ -0,0 +1,21 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSHScrollBar
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSHScrollBar::TSHScrollBar(int width, int max) :
+ TSView()
+{
+ w=width+2;
+ h=1;
+ sb=new TScrollBar(TRect(0,0,w,1));
+ view=sb;
+ setMax(max);
+}
+
+void TSHScrollBar::setMax(int max)
+{
+ sb->setParams(0,0,max,(int)(max/(double)(w-2)+0.5),1);
+}
diff --git a/setedit/easydiag/tshscrol.h b/setedit/easydiag/tshscrol.h
new file mode 100644
index 0000000..0514b22
--- /dev/null
+++ b/setedit/easydiag/tshscrol.h
@@ -0,0 +1,16 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSHScrollBar) && !defined(__TSHScrollBar_Defined__)
+#define __TSHScrollBar_Defined__
+
+class TSHScrollBar : public TSView
+{
+public:
+ TSHScrollBar(int width, int max=100);
+ void setValue(int value) { sb->setValue(value); };
+ void setMax(int max);
+
+ TScrollBar *sb;
+};
+
+#endif
diff --git a/setedit/easydiag/tshzgrp.cc b/setedit/easydiag/tshzgrp.cc
new file mode 100644
index 0000000..fc83b3e
--- /dev/null
+++ b/setedit/easydiag/tshzgrp.cc
@@ -0,0 +1,90 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSHzGroup
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+#include <stdarg.h>
+
+
+TSHzGroup::~TSHzGroup()
+{
+ delete Este;
+ delete Ant;
+};
+
+TSHzGroup::TSHzGroup(TSView *este, TSView *ant, int sep)
+{
+ sepa=sep;
+ w=este->w+ant->w+sep;
+ h=max(este->h,ant->h);
+ Este=este;
+ Ant=ant;
+ view=Este->view; // Just in case somebody tries it.
+}
+
+void TSHzGroup::insert(TDialog *d)
+{
+ Este->x=x;
+ Este->y=y;
+ Este->insert(d);
+ Ant->x=x+Este->w+sepa;
+ Ant->y=y;
+ Ant->insert(d);
+}
+
+void TSHzGroup::setWidth(int aW)
+{
+ int cant=howManyHz();
+ int extra=aW-w;
+ if (extra<=0)
+ return;
+ w=aW;
+ int forFirst=(int)(((double)extra/cant)*Este->howManyHz()+0.5);
+ Este->setWidth(Este->w+forFirst);
+ Ant->setWidth(Ant->w+extra-forFirst);
+}
+
+int TSHzGroup::howManyHz()
+{
+ return Este->howManyHz()+Ant->howManyHz();
+}
+
+void TSHzGroup::setGrowMode(unsigned val)
+{
+ Este->setGrowMode(val);
+ Ant->setGrowMode(val);
+}
+
+
+TSHzGroup *MakeHzGroup(TSView *este, TSView *ant, ...)
+{
+ TSHzGroup *ret;
+ TSView *cur;
+ va_list arg;
+ va_start(arg,ant);
+
+ ret=new TSHzGroup(este,ant);
+ while ((cur=va_arg(arg,TSView *))!=0)
+ {
+ ret=new TSHzGroup(ret,cur);
+ }
+ va_end(arg);
+ return ret;
+}
+
+TSHzGroup *MakeHzGroup(int sepa, TSView *este, TSView *ant, ...)
+{
+ TSHzGroup *ret;
+ TSView *cur;
+ va_list arg;
+ va_start(arg,ant);
+
+ ret=new TSHzGroup(este,ant,sepa);
+ while ((cur=va_arg(arg,TSView *))!=0)
+ {
+ ret=new TSHzGroup(ret,cur,sepa);
+ }
+ va_end(arg);
+ return ret;
+}
diff --git a/setedit/easydiag/tshzgrp.h b/setedit/easydiag/tshzgrp.h
new file mode 100644
index 0000000..963f364
--- /dev/null
+++ b/setedit/easydiag/tshzgrp.h
@@ -0,0 +1,21 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSHzGroup) && !defined(__TSHzGroup_Defined__)
+#define __TSHzGroup_Defined__
+
+class TSHzGroup : public TSView
+{
+public:
+ TSHzGroup(TSView *este, TSView *ant,int sep=1);
+ virtual ~TSHzGroup();
+ virtual void insert(TDialog *);
+ virtual void setWidth(int aW);
+ virtual int howManyHz();
+ virtual void setGrowMode(unsigned val);
+ int sepa;
+ TSView *Este,*Ant;
+};
+
+TSHzGroup *MakeHzGroup(TSView *este, TSView *ant, ...);
+TSHzGroup *MakeHzGroup(int sepa, TSView *este, TSView *ant, ...);
+#endif
diff --git a/setedit/easydiag/tsinplin.cc b/setedit/easydiag/tsinplin.cc
new file mode 100644
index 0000000..9614626
--- /dev/null
+++ b/setedit/easydiag/tsinplin.cc
@@ -0,0 +1,62 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSInputLine
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSInputLine::TSInputLine(int MaxLen)
+{
+ fill(MaxLen,0,0,-1,TSInputLineMake);
+}
+
+TSInputLine::TSInputLine(int MaxLen, ushort ID)
+{
+ fill(MaxLen,1,ID,-1,TSInputLineMake);
+}
+
+TSInputLine::TSInputLine(int MaxLen, int wForce)
+{
+ fill(MaxLen,0,0,wForce,TSInputLineMake);
+}
+
+void TSInputLine::fill(int MaxLen, int haveID, ushort ID, int wForce,
+ tMakeInputLine makeIt)
+{
+ if (wForce>=0)
+ {
+ w=wForce;
+ if (haveID)
+ w-=3;
+ }
+ else
+ {
+ // We need 2 extra chars to feet MaxLen-1 chars + 0
+ w=MaxLen+1;
+ }
+ h=1;
+ vAsIL=makeIt(TRect(0,0,w,h),MaxLen);
+ view=vAsIL;
+ if (haveID)
+ {
+ w+=3;
+ hist=new THistory(TRect(0,0,3,1),vAsIL,ID);
+ }
+ else
+ hist=0;
+}
+
+void TSInputLine::insert(TDialog *d)
+{
+ TRect r(x,y,x+w-(hist ? 3 : 0),y+h);
+ view->locate(r);
+ d->insert(view);
+ if (hist)
+ {
+ hist->moveTo(x+w-3,y);
+ d->insert(hist);
+ }
+}
+
+InputLineImplement(InputLine);
+
diff --git a/setedit/easydiag/tsinplin.h b/setedit/easydiag/tsinplin.h
new file mode 100644
index 0000000..cad57de
--- /dev/null
+++ b/setedit/easydiag/tsinplin.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSInputLine) && !defined(__TSInputLine_Defined__)
+#define __TSInputLine_Defined__
+
+typedef TInputLine *(* tMakeInputLine)(const TRect& bounds, int aMaxLen);
+TInputLine *TSInputLineMake(const TRect& bounds, int aMaxLen);
+
+class TSInputLine : public TSView
+{
+public:
+ TSInputLine(int MaxLen, int haveID, ushort ID, int wForce,
+ tMakeInputLine makeIt=TSInputLineMake)
+ {fill(MaxLen,haveID,ID,wForce,makeIt); };
+ TSInputLine(int MaxLen, int wForce);
+ TSInputLine(int MaxLen, ushort ID);
+ TSInputLine(int MaxLen);
+ void fill(int MaxLen, int haveID, ushort ID, int wForce,
+ tMakeInputLine makeIt);
+ virtual void insert(TDialog *d);
+ void setHide(Boolean state) { vAsIL->hideContent=state; }
+
+ THistory *hist;
+
+protected:
+ TInputLine *vAsIL;
+};
+
+// The class must be called TSxxxx, implementing a Txxxx input line with a
+// TSxxxxMake plug-in
+
+#define InputLineSpecialize(className) \
+TInputLine *TS##className##Make(const TRect& bounds, int aMaxLen);\
+class TS##className : public TSInputLine \
+{ \
+public: \
+ TS##className(int MaxLen, int haveID, ushort ID, int wForce) : \
+ TSInputLine(MaxLen,haveID,ID,wForce,TS##className##Make) {}; \
+ TS##className(int MaxLen, int wForce) : \
+ TSInputLine(MaxLen,0,0,wForce,TS##className##Make) {}; \
+ TS##className(int MaxLen, ushort ID) : \
+ TSInputLine(MaxLen,1,ID,-1,TS##className##Make) {}; \
+ TS##className(int MaxLen) : \
+ TSInputLine(MaxLen,0,0,-1,TS##className##Make) {}; \
+};
+
+#define InputLineImplement(className) \
+TInputLine *TS##className##Make(const TRect& bounds, int aMaxLen)\
+{ \
+ return new T##className(bounds,aMaxLen);\
+}
+
+#endif
+
diff --git a/setedit/easydiag/tsinplpi.cc b/setedit/easydiag/tsinplpi.cc
new file mode 100644
index 0000000..c4b248f
--- /dev/null
+++ b/setedit/easydiag/tsinplpi.cc
@@ -0,0 +1,60 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSInputLinePiped
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+TSInputLinePiped::TSInputLinePiped(int MaxLen, unsigned flags)
+{
+ fill(MaxLen,0,0,-1,flags);
+}
+
+TSInputLinePiped::TSInputLinePiped(int MaxLen, ushort ID, unsigned flags)
+{
+ fill(MaxLen,1,ID,-1,flags);
+}
+
+TSInputLinePiped::TSInputLinePiped(int MaxLen, int wForce, unsigned flags)
+{
+ fill(MaxLen,0,0,wForce,flags);
+}
+
+void TSInputLinePiped::fill(int MaxLen, int haveID, ushort ID, int wForce, unsigned flags)
+{
+ if (wForce>=0)
+ {
+ w=wForce;
+ if (haveID)
+ w-=3;
+ }
+ else
+ {
+ // We need 2 extra chars to feet MaxLen-1 chars + 0
+ w=MaxLen+2;
+ }
+ h=1;
+ TInputLine *p;
+ p=new TInputLinePiped(TRect(0,0,w,h),MaxLen,flags);
+ view=p;
+ if (haveID)
+ {
+ w+=3;
+ hist=new THistory(TRect(0,0,3,1),p,ID);
+ }
+ else
+ hist=0;
+}
+
+void TSInputLinePiped::insert(TDialog *d)
+{
+ TRect r(x,y,x+w-(hist ? 3 : 0),y+h);
+ view->locate(r);
+ d->insert(view);
+ if (hist)
+ {
+ hist->moveTo(x+w-3,y);
+ d->insert(hist);
+ }
+}
+
diff --git a/setedit/easydiag/tsinplpi.h b/setedit/easydiag/tsinplpi.h
new file mode 100644
index 0000000..42490ec
--- /dev/null
+++ b/setedit/easydiag/tsinplpi.h
@@ -0,0 +1,20 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSInputLinePiped) && !defined(__TSInputLinePiped_Defined__)
+#define __TSInputLinePiped_Defined__
+
+class TSInputLinePiped : public TSView
+{
+public:
+ TSInputLinePiped(int MaxLen, int haveID, ushort ID, int wForce, unsigned flags=0)
+ {fill(MaxLen,haveID,ID,wForce,flags); };
+ TSInputLinePiped(int MaxLen, int wForce, unsigned flags=0);
+ TSInputLinePiped(int MaxLen, ushort ID, unsigned flags=0);
+ TSInputLinePiped(int MaxLen, unsigned flags=0);
+ void fill(int MaxLen, int haveID, ushort ID, int wForce, unsigned flags);
+ virtual void insert(TDialog *d);
+
+ THistory *hist;
+};
+
+#endif
diff --git a/setedit/easydiag/tslabel.cc b/setedit/easydiag/tslabel.cc
new file mode 100644
index 0000000..2664547
--- /dev/null
+++ b/setedit/easydiag/tslabel.cc
@@ -0,0 +1,77 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSLabel
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSLabel::TSLabel(const char *aText, TSView *link) :
+ TSView()
+{
+ stTVIntl *cache=NULL;
+ const char *str=TVIntl::getText(aText,cache);
+ w=max(cstrlen(str)+1,link->w);
+ h=1+link->h;
+ view=new TLabel(TRect(0,0,w,1),aText,link->view,cache);
+ linked=link;
+}
+
+void TSLabel::insert(TDialog *d)
+{
+ // Why in the hell labels are inserted in x+1?
+ TRect r(x-1,y,x-1+w,y+1);
+ view->locate(r);
+ d->insert(view);
+ linked->x=x;
+ linked->y=y+1;
+ linked->insert(d);
+}
+
+void TSLabel::setWidth(int aW)
+{
+ w=aW;
+ linked->setWidth(aW);
+}
+
+void TSLabel::setGrowMode(unsigned val)
+{
+ view->growMode=val;
+ linked->setGrowMode(val);
+}
+
+void TSHzLabel::init(const char *aText, TSView *link, stTVIntl *cache,
+ int separation)
+{
+ int lenStr=cstrlen(TVIntl::getText(aText,cache));
+
+ xSecond=lenStr+separation;
+ w=xSecond+link->w;
+ h=1;
+ view=new TLabel(TRect(0,0,lenStr+1,1),aText,link->view,cache);
+ linked=link;
+}
+
+void TSHzLabel::insert(TDialog *d)
+{
+ // Why in the hell labels are inserted in x+1?
+ TRect r(x-1,y,x-1+xSecond,y+1);
+ view->locate(r);
+ view->moveTo(x-1,y);
+ d->insert(view);
+ linked->x=x+xSecond;
+ linked->y=y;
+ linked->insert(d);
+}
+
+void TSHzLabel::setWidth(int aW)
+{
+ w=aW;
+ linked->setWidth(aW-xSecond);
+}
+
+void TSHzLabel::setGrowMode(unsigned val)
+{
+ view->growMode=val;
+ linked->setGrowMode(val);
+}
+
diff --git a/setedit/easydiag/tslabel.h b/setedit/easydiag/tslabel.h
new file mode 100644
index 0000000..07b3aab
--- /dev/null
+++ b/setedit/easydiag/tslabel.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSLabel) && !defined(__TSLabel_Defined__)
+#define __TSLabel_Defined__
+
+class TSLabel : public TSView
+{
+public:
+ TSLabel(const char *aText, TSView *link);
+ virtual ~TSLabel() { delete linked; };
+ virtual void insert(TDialog *);
+ virtual void setWidth(int aW);
+ virtual void setGrowMode(unsigned val);
+ TSView *linked;
+};
+
+class TSHzLabel : public TSView
+{
+public:
+ TSHzLabel(const char *aText, TSView *link, int separation=1)
+ { init(aText,link,NULL,separation); }
+ TSHzLabel(const char *aText, TSView *link, stTVIntl *cache, int separation=1)
+ { init(aText,link,cache,separation); }
+ virtual ~TSHzLabel() { delete linked; };
+ virtual void insert(TDialog *);
+ virtual void setWidth(int aW);
+ virtual void setGrowMode(unsigned val);
+ TSView *linked;
+ int xSecond;
+
+protected:
+ void init(const char *aText, TSView *link, stTVIntl *cache, int separation);
+};
+
+#endif
diff --git a/setedit/easydiag/tslider.cc b/setedit/easydiag/tslider.cc
new file mode 100644
index 0000000..e2351fe
--- /dev/null
+++ b/setedit/easydiag/tslider.cc
@@ -0,0 +1,95 @@
+/* Copyright (C) 2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSSlider
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+
+/**[txh]********************************************************************
+
+ Description:
+ This callback is quite tricky. The idea is to move both scrollbars at the
+same time when some value (pointed by join) is != 0. The methode is tricky
+and I don't know if I was cleaver or a completly waco *;-)
+
+***************************************************************************/
+
+static
+void CallBack(int value, TScrollBarCB *obj, void *data)
+{
+ stTSSliderInfo *st=(stTSSliderInfo *)data;
+ TSSlider *sl=st->obj;
+ if (st->side) // Right side
+ { // Call right callback
+ if (sl->rcb) sl->rcb(value,obj,sl->rdata);
+ // And copy the value to the other
+ if (sl->join && *(sl->join) && sl->left) sl->left->setValue(value);
+ }
+ else // Left side
+ { // Call left callback
+ if (sl->lcb) sl->lcb(value,obj,sl->ldata);
+ // And copy the value to the other
+ if (sl->join && *(sl->join) && sl->right) sl->right->setValue(value);
+ }
+}
+
+TSSlider::TSSlider(int height, Boolean stereo, const char *aLabel, TScrollBarCBfunc aLcb,
+ void *aLdata, TScrollBarCBfunc aRcb, void *aRdata, int *Join,
+ int aMax) :
+ TSView()
+{
+ h=height--;
+ w=5;
+ stLeft.side=0; stLeft.obj=this;
+ stRight.side=1; stRight.obj=this;
+ join=Join;
+ if (stereo)
+ {
+ left =new TScrollBarCB(TRect(1,0,2,height),CallBack,&stLeft);
+ right=new TScrollBarCB(TRect(3,0,4,height),CallBack,&stRight);
+ }
+ else
+ {
+ left =new TScrollBarCB(TRect(2,0,3,height),CallBack,&stLeft);
+ right=0;
+ }
+ label=aLabel ? new TStaticText(TRect(0,height,5,height+1),aLabel) : 0;
+ view=label;
+ max=aMax;
+ ldata=aLdata; rdata=aRdata;
+ lcb=aLcb; rcb=aRcb;
+}
+
+void TSSlider::Set(int valueLeft, int valueRight)
+{
+ left->setParams(valueLeft,0,max,max,max/10);
+ if (right)
+ right->setParams(valueRight,0,max,max,max/10);
+}
+
+void TSSlider::insert(TDialog *d)
+{
+ TRect r=left->getBounds();
+ left->moveTo(x+r.a.x,y+r.a.y);
+ d->insert(left);
+ if (right)
+ {
+ r=right->getBounds();
+ right->moveTo(x+r.a.x,y+r.a.y);
+ d->insert(right);
+ }
+ if (label)
+ {
+ r=label->getBounds();
+ label->moveTo(x+r.a.x,y+r.a.y);
+ d->insert(label);
+ }
+}
+
+void TScrollBarCB::scrollDraw()
+{
+ TScrollBar::scrollDraw();
+ if (callBack)
+ callBack(value,this,data);
+}
diff --git a/setedit/easydiag/tslider.h b/setedit/easydiag/tslider.h
new file mode 100644
index 0000000..d27ade2
--- /dev/null
+++ b/setedit/easydiag/tslider.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSSlider) && !defined(TSSlider_Defined)
+#define TSSlider_Defined
+
+class TScrollBarCB;
+
+typedef void (*TScrollBarCBfunc)(int value, TScrollBarCB *obj, void *data);
+
+class TScrollBarCB : public TScrollBar
+{
+public:
+ TScrollBarCB(const TRect &rect, TScrollBarCBfunc cb, void *aData) :
+ TScrollBar(rect), callBack(cb), data(aData) {};
+
+ virtual void scrollDraw();
+ TScrollBarCBfunc callBack;
+ void *data;
+};
+
+class TSSlider;
+
+typedef struct
+{
+ int side; // 0=left, 1=right
+ TSSlider *obj;
+} stTSSliderInfo;
+
+class TSSlider : public TSView
+{
+public:
+ TSSlider(int height, Boolean stereo, const char *label, TScrollBarCBfunc aLcb=0,
+ void *aLdata=0, TScrollBarCBfunc aRcb=0, void *aRdata=0,
+ int *Join=0, int max=100);
+ void Set(int valueLeft, int valueRight=0);
+ virtual void insert(TDialog *d);
+
+ TScrollBarCB *left,*right;
+ TStaticText *label;
+ void *ldata,*rdata;
+ TScrollBarCBfunc lcb,rcb;
+ stTSSliderInfo stLeft,stRight;
+ int *join;
+ int max;
+};
+
+#endif
diff --git a/setedit/easydiag/tslistbo.cc b/setedit/easydiag/tslistbo.cc
new file mode 100644
index 0000000..4f5a75d
--- /dev/null
+++ b/setedit/easydiag/tslistbo.cc
@@ -0,0 +1,62 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSListBox
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSListBox::TSListBox(int width, int height, int scrolls, int cols, int aHSRange,
+ tMakeListBox MakeListBox) :
+ TSView()
+{
+ w=width;
+ h=height;
+ scrollType=scrolls;
+
+ vScrollBar=hScrollBar=0;
+ int hScrl=(scrolls & tsslbHorizontal) ? 1 : 0;
+ int vScrl=(scrolls & tsslbVertical) ? 1 : 0;
+ if (vScrl)
+ vScrollBar=new TScrollBar(TRect(0,0,1,height-hScrl));
+ if (hScrl)
+ {
+ hScrollBar=new TScrollBar(TRect(0,0,width-vScrl,1));
+ if (aHSRange>0)
+ hScrollBar->setRange(0,aHSRange);
+ }
+ view=MakeListBox(TRect(0,0,width-vScrl,height-hScrl),cols,hScrollBar,vScrollBar);
+}
+
+
+void TSListBox::insert(TDialog *d)
+{
+ if (scrollType==tsslbNo)
+ {
+ TSView::insert(d);
+ return;
+ }
+ int hScrl=(scrollType & tsslbHorizontal) ? 1 : 0;
+ int vScrl=(scrollType & tsslbVertical) ? 1 : 0;
+
+ TRect r(x,y,x+w-vScrl,y+h-hScrl);
+ view->locate(r);
+ d->insert(view);
+ if (vScrollBar)
+ {
+ vScrollBar->moveTo(x+w-1,y);
+ d->insert(vScrollBar);
+ }
+ if (hScrollBar)
+ {
+ TRect r2(x,y+h-1,x+w-vScrl,y+h);
+ hScrollBar->locate(r2);
+ d->insert(hScrollBar);
+ }
+}
+
+// Just a TListBox object
+TView *TSListBoxMakeListBox(const TRect& bounds, unsigned aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar)
+{
+ return new TListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,True);
+}
diff --git a/setedit/easydiag/tslistbo.h b/setedit/easydiag/tslistbo.h
new file mode 100644
index 0000000..85eac61
--- /dev/null
+++ b/setedit/easydiag/tslistbo.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSListBox) && !defined(__TSListBox_Defined__)
+#define __TSListBox_Defined__
+
+typedef TView *(* tMakeListBox)(const TRect& bounds, unsigned aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar);
+TView *TSListBoxMakeListBox(const TRect& bounds, unsigned aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar);
+
+/*****************************************************************************
+
+ Important note: The last parameter helps to specialize this class. In this
+ way creating a variant of TSListBox is a 2 lines job. That's what
+ TSSortedListBox, TSSOSSortedListBox and TSStringableListBox does in fact.
+ The solution is really *nasty*. I don't like it at all, but after trying
+ to do it using virtual members I gave up. Looks like that's impossible
+ because I need to override the behavior of part of the constructor and
+ inside the constructor we can't call virtual members of a child class, the
+ this variable points to our virtual table and not the child's one.
+
+*****************************************************************************/
+
+class TSListBox : public TSView
+{
+public:
+ TSListBox(int width, int height, int scrolls=tsslbNo, int cols=1, int aHSRange=0,
+ tMakeListBox MakeListBox=TSListBoxMakeListBox);
+ virtual void insert(TDialog *);
+
+ int scrollType;
+ TScrollBar *vScrollBar;
+ TScrollBar *hScrollBar;
+};
+
+#endif
diff --git a/setedit/easydiag/tsradbot.cc b/setedit/easydiag/tsradbot.cc
new file mode 100644
index 0000000..489499d
--- /dev/null
+++ b/setedit/easydiag/tsradbot.cc
@@ -0,0 +1,60 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSRadioButtons
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSRadioButtons::TSRadioButtons(TSItem *aStrings, int wForced, int Columns)
+{
+ TSItem *itemAux=aStrings;
+ int items=0;
+
+ while (itemAux)
+ {
+ items++;
+ itemAux=itemAux->next;
+ }
+ h=items/Columns;
+ if (items%Columns) h++;
+
+ #ifdef Clusters32Bits
+ TRadioButtons *rb=new TRadioButtons32(TRect(0,0,w,h),aStrings);
+ #else
+ TRadioButtons *rb=new TRadioButtons(TRect(0,0,w,h),aStrings);
+ #endif
+ view=rb;
+ if (wForced>=0)
+ {
+ w=wForced;
+ }
+ else
+ {
+ int wMax=0,l,item,itY;
+
+ w=0;
+ for (item=itY=0; item<items; item++)
+ {
+ l=cstrlen(rb->getItemText(item))+6;
+ if (l>wMax) wMax=l;
+ itY++;
+ if (itY==h)
+ {
+ itY=0;
+ w+=wMax;
+ wMax=0;
+ }
+ }
+ if (wMax) w+=wMax;
+ }
+}
+
+void TSRadioButtons::setEnableMask(uint32 *masks, TSView **views, int cViews)
+{
+ int i;
+ TView **p=(TView **)views;
+ for (i=0; i<cViews; i++)
+ p[i]=views[i]->view;
+ ((TRadioButtons *)view)->setEnableMask(masks,p,cViews);
+}
+
diff --git a/setedit/easydiag/tsradbot.h b/setedit/easydiag/tsradbot.h
new file mode 100644
index 0000000..f23eb54
--- /dev/null
+++ b/setedit/easydiag/tsradbot.h
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSRadioButtons) && !defined(__TSRadioButtons_Defined__)
+#define __TSRadioButtons_Defined__
+
+class TSRadioButtons : public TSView
+{
+public:
+ TSRadioButtons(TSItem *aStrings, int wForced=-1, int Columns=1);
+ void setEnableMask(uint32 *masks, TSView **views, int cViews);
+};
+
+#endif
diff --git a/setedit/easydiag/tssortlb.cc b/setedit/easydiag/tssortlb.cc
new file mode 100644
index 0000000..ad61a59
--- /dev/null
+++ b/setedit/easydiag/tssortlb.cc
@@ -0,0 +1,9 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSSortedListBox
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+ListBoxImplement(SortedListBox);
+
diff --git a/setedit/easydiag/tssortlb.h b/setedit/easydiag/tssortlb.h
new file mode 100644
index 0000000..275c135
--- /dev/null
+++ b/setedit/easydiag/tssortlb.h
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSSortedListBox) && !defined(__TSSortedListBox_Defined__)
+#define __TSSortedListBox_Defined__
+
+ListBoxSpecialize(TSSortedListBox);
+
+#endif
diff --git a/setedit/easydiag/tssortva.h b/setedit/easydiag/tssortva.h
new file mode 100644
index 0000000..e179de5
--- /dev/null
+++ b/setedit/easydiag/tssortva.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSSortedListBox_Var) && !defined(__TSSortedListBox_Var_Defined__)
+#define __TSSortedListBox_Var_Defined__
+
+const int tsslbNo=0,tsslbVertical=1,tsslbHorizontal=2;
+
+#define ListBoxSpecialize(newClass) \
+TView *newClass##Make(const TRect& bounds, unsigned aNumCols, \
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar); \
+class newClass : public TSListBox \
+{ \
+public: \
+ newClass(int width, int height, int scrolls=tsslbNo, int cols=1, int aHSRange=0) : \
+ TSListBox(width,height,scrolls,cols,aHSRange,newClass##Make) {}; \
+}
+
+#define ListBoxImplement(className) \
+TView *TS##className##Make(const TRect& bounds, unsigned aNumCols,\
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar)\
+{\
+ return new T##className(bounds,aNumCols,aHScrollBar,aVScrollBar,True);\
+}
+
+#endif
diff --git a/setedit/easydiag/tssosslb.cc b/setedit/easydiag/tssosslb.cc
new file mode 100644
index 0000000..ffb647f
--- /dev/null
+++ b/setedit/easydiag/tssosslb.cc
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSSOSSortedListBox
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+ListBoxImplement(SOSSortedListBox);
diff --git a/setedit/easydiag/tssosslb.h b/setedit/easydiag/tssosslb.h
new file mode 100644
index 0000000..e2afbde
--- /dev/null
+++ b/setedit/easydiag/tssosslb.h
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSSOSSortedListBox) && !defined(__TSSOSSortedListBox_Defined__)
+#define __TSSOSSortedListBox_Defined__
+
+ListBoxSpecialize(TSSOSSortedListBox);
+
+#endif
diff --git a/setedit/easydiag/tstatext.cc b/setedit/easydiag/tstatext.cc
new file mode 100644
index 0000000..6c50e06
--- /dev/null
+++ b/setedit/easydiag/tstatext.cc
@@ -0,0 +1,91 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSStaticText
+#include <string.h>
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ SView wrapper for the static text object just pass the string.
+
+***************************************************************************/
+
+TSStaticText::TSStaticText(const char *aText) :
+ TSView()
+{
+ int lines=1;
+ int max_w=0,cur_w=0;
+ stTVIntl *cache=NULL;
+ const char *s=TVIntl::getText(aText,cache);
+
+ while (*s)
+ {
+ if (*s==3)
+ {
+ s++;
+ continue;
+ }
+ if (*s=='\n')
+ {
+ lines++;
+ cur_w=0;
+ s++;
+ continue;
+ }
+ cur_w++;
+ if (cur_w>max_w)
+ max_w=cur_w;
+ s++;
+ }
+ w=max_w;
+ h=lines;
+ view=new TStaticText(TRect(0,0,w,h),aText,cache);
+}
+
+TSStaticText::TSStaticText(const char *aText, int wrapCol) :
+ TSView()
+{
+ int l,p,y,i,j;
+ stTVIntl *cache=NULL;
+ const char *s=TVIntl::getText(aText,cache);
+ w=wrapCol;
+
+ // That's the code used by TStaticText to wrap the words, here is used to meassure
+ // the height.
+ l=strlen(s);
+ p=0;
+ y=0;
+ while (p<l)
+ {
+ if (s[p]==3) ++p;
+ i=p;
+ do
+ {
+ j=p;
+ while ((p<l) && (s[p]==' ')) ++p;
+ while ((p<l) && (s[p]!=' ') && (s[p] != '\n')) ++p;
+ }
+ while ((p<l) && (p<i+wrapCol) && (s[p]!='\n'));
+ if (p>i+wrapCol)
+ {
+ if (j>i)
+ p=j;
+ else
+ p=i+wrapCol;
+ }
+ while ((p<l) && (s[p]==' ')) p++;
+ if ((p<l) && (s[p]=='\n'))
+ {
+ p++;
+ if ((p<l) && (s[p]=='\n'))
+ p++;
+ }
+ y++;
+ }
+ h=y;
+ view=new TStaticText(TRect(0,0,w,h),aText,cache);
+}
+
diff --git a/setedit/easydiag/tstatext.h b/setedit/easydiag/tstatext.h
new file mode 100644
index 0000000..8cb951e
--- /dev/null
+++ b/setedit/easydiag/tstatext.h
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSStaticText) && !defined(__TSStaticText_Defined__)
+#define __TSStaticText_Defined__
+
+class TSStaticText : public TSView
+{
+public:
+ TSStaticText(const char *aText);
+ TSStaticText(const char *aText, int wrapCol);
+};
+
+#endif
diff --git a/setedit/easydiag/tstextsc.cc b/setedit/easydiag/tstextsc.cc
new file mode 100644
index 0000000..42e72ea
--- /dev/null
+++ b/setedit/easydiag/tstextsc.cc
@@ -0,0 +1,63 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSTextScroller
+#include <string.h>
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSTextScroller::TSTextScroller(int width, int height, TNSCollection *str,
+ int haveHoriz, int haveVert, int XLimit) :
+ TSView()
+{
+ w=width;
+ h=height;
+ horiz=haveHoriz ? 1 : 0;
+ vert=haveVert ? 1 : 0;
+
+ if (horiz)
+ hS=new TScrollBar(TRect(0,0,width-vert,1));
+ else
+ hS=0;
+ if (vert)
+ vS=new TScrollBar(TRect(0,0,1,height-horiz));
+ else
+ vS=0;
+
+ if (XLimit<0)
+ {
+ int c=str->getCount(),i,max=0,l;
+ for (i=0; i<c; i++)
+ {
+ l=strlen((char *)str->at(i));
+ if (l>max)
+ max=l;
+ }
+ XLimit=max;
+ }
+
+ TTextScroller *scroller=new TTextScroller(TRect(0,0,width-vert,height-horiz),hS,vS,str);
+ view=scroller;
+ scroller->setLimit(XLimit,str->getCount());
+}
+
+void TSTextScroller::insert(TDialog *d)
+{
+ TRect r(x,y,x+w-vert,y+h-horiz);
+ view->locate(r);
+ d->insert(view);
+
+ if (horiz)
+ {
+ TRect r(x,y+h-1,x+w-vert,y+h);
+ hS->locate(r);
+ d->insert(hS);
+ }
+ if (vert)
+ {
+ TRect r(x+w-1,y,x+w,y+h-horiz);
+ vS->locate(r);
+ d->insert(vS);
+ }
+}
+
diff --git a/setedit/easydiag/tstextsc.h b/setedit/easydiag/tstextsc.h
new file mode 100644
index 0000000..f350889
--- /dev/null
+++ b/setedit/easydiag/tstextsc.h
@@ -0,0 +1,17 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSTextScroller) && !defined(__TSTextScroller_Defined__)
+#define __TSTextScroller_Defined__
+
+class TSTextScroller : public TSView
+{
+public:
+ TSTextScroller(int width, int height, TNSCollection *str,
+ int haveHoriz=0, int haveVert=0, int XLimit=-1);
+ virtual void insert(TDialog *);
+
+ int horiz,vert;
+ TScrollBar *hS,*vS;
+};
+
+#endif
diff --git a/setedit/easydiag/tstsorlb.cc b/setedit/easydiag/tstsorlb.cc
new file mode 100644
index 0000000..5794710
--- /dev/null
+++ b/setedit/easydiag/tstsorlb.cc
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSStringableListBox
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+ListBoxImplement(StringableListBox);
diff --git a/setedit/easydiag/tstsorlb.h b/setedit/easydiag/tstsorlb.h
new file mode 100644
index 0000000..51708e9
--- /dev/null
+++ b/setedit/easydiag/tstsorlb.h
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSStringableListBox) && !defined(__TSStringableListBox_Defined__)
+#define __TSStringableListBox_Defined__
+
+ListBoxSpecialize(TSStringableListBox);
+
+#endif
diff --git a/setedit/easydiag/tsvegrp.cc b/setedit/easydiag/tsvegrp.cc
new file mode 100644
index 0000000..ee2500b
--- /dev/null
+++ b/setedit/easydiag/tsvegrp.cc
@@ -0,0 +1,82 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSVeGroup
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+#include <stdarg.h>
+
+TSVeGroup::~TSVeGroup()
+{
+ delete Este;
+ delete Ant;
+};
+
+TSVeGroup::TSVeGroup(TSView *este, TSView *ant, int sep)
+{
+ sepa=sep;
+ h=este->h+ant->h+sep;
+ w=max(este->w,ant->w);
+ Este=este;
+ Ant=ant;
+}
+
+void TSVeGroup::insert(TDialog *d)
+{
+ Este->x=x;
+ Este->y=y;
+ Este->insert(d);
+ Ant->y=y+Este->h+sepa;
+ Ant->x=x;
+ Ant->insert(d);
+}
+
+void TSVeGroup::setWidth(int aW)
+{
+ w=aW;
+ Este->setWidth(aW);
+ Ant->setWidth(aW);
+}
+
+void TSVeGroup::setGrowMode(unsigned val)
+{
+ Este->setGrowMode(val);
+ Ant->setGrowMode(val);
+}
+
+TSVeGroup *MakeVeGroup(TSView *este, TSView *ant, ...)
+{
+ TSVeGroup *ret;
+ TSView *cur;
+ va_list arg;
+ va_start(arg,ant);
+
+ ret=new TSVeGroup(este,ant);
+ while ((cur=va_arg(arg,TSView *))!=0)
+ {
+ ret=new TSVeGroup(ret,cur);
+ }
+ va_end(arg);
+ return ret;
+}
+
+TSVeGroup *MakeVeGroup(int sepa, TSView *este, TSView *ant, ...)
+{
+ TSVeGroup *ret;
+ TSView *cur;
+ va_list arg;
+ va_start(arg,ant);
+
+ int sep=sepa & (~tsveMakeSameW);
+ ret=new TSVeGroup(este,ant,sep);
+ while ((cur=va_arg(arg,TSView *))!=0)
+ {
+ ret=new TSVeGroup(ret,cur,sep);
+ }
+ va_end(arg);
+ if (sepa & tsveMakeSameW)
+ ret->makeSameW();
+ return ret;
+}
+
+
diff --git a/setedit/easydiag/tsvegrp.h b/setedit/easydiag/tsvegrp.h
new file mode 100644
index 0000000..1d50ac2
--- /dev/null
+++ b/setedit/easydiag/tsvegrp.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSVeGroup) && !defined(__TSVeGroup_Defined__)
+#define __TSVeGroup_Defined__
+
+class TSVeGroup : public TSView
+{
+public:
+ TSVeGroup(TSView *este, TSView *ant,int sep=1);
+ virtual ~TSVeGroup();
+ virtual void insert(TDialog *);
+ virtual void setWidth(int aW);
+ void makeSameW() { setWidth(w); };
+ virtual void setGrowMode(unsigned val);
+ int sepa;
+ TSView *Este,*Ant;
+};
+
+const int tsveMakeSameW=0x8000;
+TSVeGroup *MakeVeGroup(TSView *este, TSView *ant, ...);
+TSVeGroup *MakeVeGroup(int sepa, TSView *este, TSView *ant, ...);
+#endif
diff --git a/setedit/easydiag/tsview.cc b/setedit/easydiag/tsview.cc
new file mode 100644
index 0000000..f26a21f
--- /dev/null
+++ b/setedit/easydiag/tsview.cc
@@ -0,0 +1,43 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSView
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the default insert routine for TSView objects. It inserts the
+object in the provided TDialog moving the object to the x,y coordinates
+solved by the collection and then inserts the object.
+
+***************************************************************************/
+
+void TSView::insert(TDialog *d)
+{
+ TRect r(x,y,x+w,y+h);
+ view->locate(r);
+ d->insert(view);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ When 2 objects doesn't belong to the same vertical group but they are in
+column (special cases of the flow inside the dialog) you make then of the
+same width using it.
+
+***************************************************************************/
+
+void TSView::makeSameW(TSView *o1, TSView *o2)
+{
+ if (o1->w>o2->w)
+ o2->setWidth(o1->w);
+ else if (o1->w<o2->w)
+ o1->setWidth(o2->w);
+}
+
+int TSView::xDefSep=1;
+int TSView::yDefSep=1;
+
diff --git a/setedit/easydiag/tsview.h b/setedit/easydiag/tsview.h
new file mode 100644
index 0000000..f356f9c
--- /dev/null
+++ b/setedit/easydiag/tsview.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSView) && !defined(__TSView_Defined__)
+#define __TSView_Defined__
+
+const int xTSCenter=-1,xTSLeft=-2,xTSRight=-3,xTSLeftOf=-4,xTSRightOf=-5;
+const int yTSCenter=-1,yTSUp=-2,yTSDown=-3,yTSOver=-4,yTSUnder=-5,yTSUpSep=-6;
+const int wSpan=1;
+
+
+class TSView
+{
+public:
+ TSView() { xSep=xDefSep; ySep=yDefSep; Flags=0; };
+ virtual ~TSView() {};
+ int w,h,x,y;
+ int xSep,ySep;
+ unsigned Flags;
+ TView *view;
+ virtual void insert(TDialog *);
+ virtual void setWidth(int aW) { w=aW; };
+ virtual int howManyHz() { return 1; };
+ virtual void setGrowMode(unsigned val) { view->growMode=val; };
+ // Used to make two objects of the same width when they aren't part of a
+ // vertical group.
+ static void makeSameW(TSView *o1, TSView *o2);
+ static int xDefSep,yDefSep;
+};
+
+
+int EDMaxWidth(TSView *first, ...);
+void EDForceSameWidth(TSView *first, ...);
+#endif
diff --git a/setedit/easydiag/tsviewco.cc b/setedit/easydiag/tsviewco.cc
new file mode 100644
index 0000000..3ec943f
--- /dev/null
+++ b/setedit/easydiag/tsviewco.cc
@@ -0,0 +1,292 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define NDEBUG
+#include <assert.h>
+#include <stdarg.h>
+#include <string.h>
+#define Uses_TSViewCol
+#define Uses_TApplication
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TSViewCol::TSViewCol(const char *name) :
+ TNSCollection(5,5)
+{
+ d=new TDialog(TRect(1,1,1,1),name);
+}
+
+void TSViewCol::insert(int x, int y, TSView *view, TSView *refX, TSView *refY)
+{
+ SViewNode *node=new SViewNode;
+ node->view=view;
+ node->refX=refX;
+ node->refY=refY;
+ view->x=x;
+ view->y=y;
+ TNSCollection::insert(node);
+}
+
+void TSViewCol::freeItem(void *item)
+{
+ SViewNode *node=(SViewNode *)item;
+ delete node->view;
+ delete node;
+}
+
+const int xTSMargin=2,yTSMargin=1;
+
+
+TDialog *TSViewCol::doIt(TDeskTop *dkt)
+{
+ // First step: figure out the size of the dialog
+ int w,h,wNeed=0,hNeed=0,wThis,xThis,xTemp;
+ // hThis=0, egcs is crazy and thinks it could be used uninitialized!
+ int hThis=0,yThis,yTemp;
+ TSView *This;
+ TRect r=d->getBounds();
+ w=max(r.b.x-r.a.x,2*xTSMargin);
+ w=max(w,(int)strlen(d->getTitle(0))+14);
+ h=max(r.b.y-r.a.y,2*yTSMargin);
+ int i;
+ SViewNode *node;
+
+ for (i=0; i<count; i++)
+ {
+ node=(SViewNode *)at(i);
+ This=node->view;
+
+ // Solve needed width and x in the following cases:
+ // xTSLeft Left of the dialog
+ // xTSLeftOf Left of an object
+ // xTSRightOf Right of an object
+ wThis=This->w;
+ xThis=This->x;
+ if (xThis>=0)
+ { // Ok, the position is fixed
+ wNeed=xThis+wThis;
+ }
+ else
+ {
+ switch (xThis)
+ {
+ case xTSRight:
+ //wNeed=w-xTSMargin+wThis+This->xSep;
+ wNeed=xTSMargin+wThis;
+ break;
+ case xTSCenter:
+ wNeed=xTSMargin+wThis;
+ break;
+ case xTSLeft:
+ This->x=xTSMargin;
+ wNeed=xTSMargin+wThis;//+This->xSep;
+ break;
+ case xTSLeftOf:
+ wNeed=0;
+ assert(node->refX);
+ xTemp=node->refX->x;//+node->refX->w;
+ assert(xTemp>=0);
+ This->x=max(0,xTemp-This->xSep-wThis);
+ break;
+ case xTSRightOf:
+ assert(node->refX);
+ xTemp=node->refX->x+node->refX->w;
+ assert(xTemp>=0);
+ This->x=xTemp+This->xSep;
+ wNeed=This->x+wThis;
+ break;
+ default:
+ assert(0);
+ }
+ }
+ wNeed+=xTSMargin;
+ if (wNeed>w)
+ w=wNeed;
+
+ // Solve needed height and y in the following cases:
+ hThis=This->h;
+ yThis=This->y;
+ if (yThis>=0)
+ { // Ok, the position is fixed
+ hNeed=yThis+hThis;
+ }
+ else
+ {
+ switch (yThis)
+ {
+ case yTSDown:
+ hNeed=h-yTSMargin+hThis+This->ySep;
+ break;
+ case yTSCenter:
+ hNeed=yTSMargin+hThis;
+ break;
+ case yTSUp:
+ This->y=yTSMargin;
+ hNeed=yTSMargin+hThis;
+ break;
+ case yTSUpSep:
+ This->y=yTSMargin+1;
+ hNeed=yTSMargin+1+hThis;
+ break;
+ case yTSOver:
+ hNeed=0;
+ assert(node->refY);
+ yTemp=node->refY->y;
+ assert(yTemp>=0);
+ This->y=max(0,yTemp-This->ySep-hThis);
+ break;
+ case yTSUnder:
+ assert(node->refY);
+ yTemp=node->refY->y+node->refY->h;
+ assert(yTemp>=0);
+ This->y=yTemp+This->ySep;
+ hNeed=This->y+hThis;
+ break;
+ default:
+ assert(0);
+ }
+ }
+ hNeed+=yTSMargin;
+ if (hNeed>h)
+ h=hNeed;
+ }
+ // Hopefully here we have the w/h of the dialog, some x/y remains unsolved
+ d->growTo(w,h);
+ // Now is safe to insert the views because there is enough room in the buffer
+
+ /**** Second step: Is time to insert the views ****/
+ for (i=0; i<count; i++)
+ {
+ node=(SViewNode *)at(i);
+ This=node->view;
+
+ if (This->Flags & wSpan)
+ {
+ int wAux=w-xTSMargin;
+ if (This->x<0)
+ wAux-=xTSMargin;
+ else
+ wAux-=This->x;
+ This->setWidth(wAux);
+ }
+ // Solve X if needed
+ xThis=This->x;
+ wThis=This->w;
+ if (xThis<0)
+ {
+ switch (xThis)
+ {
+ case xTSRight:
+ xThis=This->x=max(0,w-xTSMargin-wThis);
+ break;
+ case xTSCenter:
+ assert(wThis<w);
+ xThis=This->x=(w-wThis)/2;
+ break;
+ default:
+ assert(0);
+ }
+ }
+ // Solve Y if needed
+ yThis=This->y;
+ hThis=This->h;
+ if (yThis<0)
+ {
+ switch (yThis)
+ {
+ case yTSDown:
+ yThis=This->y=max(0,h-yTSMargin-hThis);
+ break;
+ case yTSCenter:
+ assert(hThis<h);
+ yThis=This->y=(h-hThis)/2;
+ break;
+ default:
+ assert(0);
+ }
+ }
+ // So now we can resize it
+ /*r.a.x=xThis;
+ r.a.y=yThis;
+ r.b.x=xThis+wThis;
+ r.b.y=yThis+hThis;
+ This->view->locate(r);
+ d->insert(This->view);*/
+ This->insert(d);
+ //d->insert(This);
+ }
+ d->selectNext(False);
+ if (dkt)
+ dkt->insert(d);
+ return d;
+}
+
+TDialog *TSViewCol::doItCenter(int context)
+{
+ TDialog *d=doIt();
+ d->options|=ofCentered;
+ d->helpCtx=context;
+ return d;
+}
+
+ushort TSViewCol::exec(void *data, int center)
+{
+ TDialog *d=doIt();
+ if (center)
+ d->options|=ofCentered;
+
+ TView *p=TProgram::application->validView(d);
+ if (p==0)
+ return cmCancel;
+ else
+ {
+ if (data!=0)
+ p->setData(data);
+ ushort result=TProgram::deskTop->execView(p);
+ if (result!=cmCancel && data!=0)
+ p->getData(data);
+ TObject::CLY_destroy(p);
+ return result;
+ }
+}
+
+int EDMaxWidth(TSView *first, ...)
+{
+ va_list arg;
+ va_start(arg,first);
+
+ TSView *s;
+ int max=first->w;
+
+ while ((s=va_arg(arg,TSView *))!=0)
+ {
+ if (s->w>max)
+ max=s->w;
+ }
+ va_end(arg);
+
+ return max;
+}
+
+void EDForceSameWidth(TSView *first, ...)
+{
+ va_list arg;
+ va_start(arg,first);
+
+ TSView *s;
+ int max=first->w;
+
+ while ((s=va_arg(arg,TSView *))!=0)
+ {
+ if (s->w>max)
+ max=s->w;
+ }
+ va_end(arg);
+
+ va_start(arg,first);
+ first->setWidth(max);
+ while ((s=va_arg(arg,TSView *))!=0)
+ s->setWidth(max);
+ va_end(arg);
+}
+
diff --git a/setedit/easydiag/tsviewco.h b/setedit/easydiag/tsviewco.h
new file mode 100644
index 0000000..2650303
--- /dev/null
+++ b/setedit/easydiag/tsviewco.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSViewCol) && !defined(__TSViewCol_Defined__)
+#define __TSViewCol_Defined__
+
+typedef struct
+{
+ TSView *view;
+ TSView *refX;
+ TSView *refY;
+} SViewNode;
+
+
+class TSViewCol : public TNSCollection
+{
+public:
+ TSViewCol(TDialog *aDialog) : TNSCollection(5,5), d(aDialog) {};
+ TSViewCol(const char *name);
+ ~TSViewCol() { freeAll(); };
+ void insert(int x, int y, TSView *view, TSView *refX=0, TSView *refY=0);
+ TDialog *doIt(TDeskTop *dkt=0);
+ TDialog *doItCenter(int context=0);
+ ushort exec(void *data, int center=1);
+ virtual void freeItem(void *item);
+
+ TDialog *d;
+};
+
+#endif
diff --git a/setedit/easydiag/ttextscr.cc b/setedit/easydiag/ttextscr.cc
new file mode 100644
index 0000000..b558f8b
--- /dev/null
+++ b/setedit/easydiag/ttextscr.cc
@@ -0,0 +1,58 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TTextScroller
+#include <easydia1.h>
+#include <tv.h>
+#include <easydiag.h>
+
+TTextScroller::TTextScroller(const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar, TNSCollection *str) :
+ TScroller(bounds,aHScrollBar,aVScrollBar)
+{
+ text=str;
+}
+
+void TTextScroller::draw()
+{
+ char *p;
+
+ ushort c=getColor(1);
+ for (int i=0; i<size.y; i++)
+ {
+ TDrawBuffer b;
+ b.moveChar(0,' ',c,size.x);
+
+ if (delta.y+i<text->getCount())
+ {
+ AllocLocalStr(s,size.x+1);
+ p=(char *)text->at(delta.y+i);
+ if (!p || strlen(p)<(unsigned)delta.x)
+ s[0] = EOS;
+ else
+ {
+ strncpy(s,p+delta.x,size.x);
+ s[size.x]=EOS;
+ }
+ b.moveStr( 0, s, c );
+ }
+ writeBuf( 0, i, size.x, 1, b );
+ }
+}
+
+TPalette& TTextScroller::getPalette() const
+{
+ static TPalette palette("\x10",1);
+ return palette;
+}
+
+void TTextScroller::handleEvent(TEvent& event)
+{
+ TScroller::handleEvent(event);
+ // As I have the focus they don't get the events
+ if (event.what==evKeyDown && hScrollBar)
+ hScrollBar->handleEvent(event);
+ if (event.what==evKeyDown && vScrollBar)
+ vScrollBar->handleEvent(event);
+}
diff --git a/setedit/easydiag/ttextscr.h b/setedit/easydiag/ttextscr.h
new file mode 100644
index 0000000..3cee17e
--- /dev/null
+++ b/setedit/easydiag/ttextscr.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TTextScroller) && !defined(__TTextScroller_Defined__)
+#define __TTextScroller_Defined__
+
+class TTextScroller : public TScroller
+{
+public:
+ TTextScroller(const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar, TNSCollection *str);
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent(TEvent& event);
+
+private:
+ TNSCollection *text;
+};
+
+#endif
diff --git a/setedit/extra/djmdr.s b/setedit/extra/djmdr.s
new file mode 100644
index 0000000..6803ea3
--- /dev/null
+++ b/setedit/extra/djmdr.s
@@ -0,0 +1,59 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+/* Modified by SET to copy in reverse order */
+#ifdef __DJGPP__
+# This routine moves %ecx bytes from %ds:%esi to %es:%edi. It clobbers
+# %eax, %ecx, %esi, %edi, and eflags.
+
+ .file "djmdr.s"
+ .text
+ .align 4
+ .globl ___dj_movedata_rev
+___dj_movedata_rev:
+ std
+ # Add the counter to the index
+ addl %ecx,%edi
+ addl %ecx,%esi
+ decl %esi
+ decl %edi
+
+ cmpl $15,%ecx
+ jle small_move
+ jmp mod_4_check
+
+ # Transfer bytes until either %esi or %edi is aligned % 3
+align_mod_4:
+ movsb
+ decl %ecx
+mod_4_check:
+ movl %esi,%eax
+ andl $3,%eax
+ cmpl $3,%eax
+ jz big_move
+ movl %edi,%eax
+ andl $3,%eax
+ cmpl $3,%eax
+ jnz align_mod_4
+
+big_move:
+ movb %cl,%al # We will store leftover count in %al
+ shrl $2,%ecx
+ andb $3,%al
+ # Now retrocess the index 3 positions
+ subl $3,%edi
+ subl $3,%esi
+ rep
+ movsl
+
+ # %ecx known to be zero here, so insert the leftover count in %al
+ movb %al,%cl
+
+ # advance the index by 3
+ addl $3,%edi
+ addl $3,%esi
+
+small_move:
+ rep
+ movsb
+ ret
+#endif
+
diff --git a/setedit/extra/dyncat.cc b/setedit/extra/dyncat.cc
new file mode 100644
index 0000000..b81d3e0
--- /dev/null
+++ b/setedit/extra/dyncat.cc
@@ -0,0 +1,121 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <configed.h>
+#include <string.h>
+#include <dyncat.h>
+#include <stdlib.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ This function is used to concatenate strings that we don't know the final
+size. To make it faster the routine uses an structure to hold the end of
+the string, in this way the routine doesn't need to scan the string all the
+time.@p
+ Struct is a pointer to a local DynStrCatStruct, str is the string and len
+is the len of the string to concatenate. The len is provided by the calling
+routine, if the parameter is skipped the routine calls to strlen to find it.@p
+ For a simple init call it like this:@*
+DynStrCatInit(&stru,0,0);
+
+***************************************************************************/
+
+void DynStrCatInit(DynStrCatStruct *Struct, const char *str, int len)
+{
+ if (len<0)
+ len=str ? strlen(str) : 0;
+ Struct->str=(char *)malloc(len+1);
+ if (str)
+ strncpy(Struct->str,str,len);
+ Struct->str[len]=0;
+ Struct->len=len;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's called after DynStrCatInit to add new strings. @x{DynStrCatInit}.
+
+***************************************************************************/
+
+void DynStrCat(DynStrCatStruct *Struct, const char *str, int len)
+{
+ int oldLen=Struct->len;
+
+ if (len<0)
+ len=strlen(str);
+ Struct->len+=len;
+ Struct->str=(char *)realloc(Struct->str,Struct->len+1);
+ memcpy(Struct->str+oldLen,str,len);
+ Struct->str[Struct->len]=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a new copy of @var{start}. Only @var{len} chars are copied. The
+copy is created using the new[] operator and the string is NULL terminated.
+If @var{len} is less than 0 then 0 is used. If len is 0 one byte is
+allocated. The @var{start} argument can't be NULL.
+
+ Return: a new[]ly allocated string.
+
+***************************************************************************/
+
+char *newStrL(const char *start, int len)
+{
+ if (len<0)
+ len=0;
+ char *ret=new char[len+1];
+ memcpy(ret,start,len);
+ ret[len]=0;
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Splits @var{str} using @var{delimiters}. If @var{copy} is !=0 then the
+string is first copied to a temporal. For each element found the @var{adder}
+function is called passing the new element and the @var{data} value.@p
+ Note that at least one element will be found if @var{str} isn't NULL.
+
+ Return: The number of elements found.
+
+***************************************************************************/
+
+int SplitStr(char *str, int copy, const char *delimiters,
+ void (*adder)(const char *, void *), void *data)
+{
+ if (!str)
+ return 0;
+ char *nstr=str;
+ if (copy)
+ nstr=newStrL(str,strlen(str));
+
+ char *s=nstr, *sant=s;
+ int found=1;
+ while (*s)
+ {
+ for (const char *test=delimiters; *test; test++)
+ {
+ if (*s==*test)
+ {
+ found++;
+ *s=0;
+ adder(sant,data);
+ sant=s+1;
+ break;
+ }
+ }
+ s++;
+ }
+ adder(sant,data);
+
+ if (copy)
+ delete[] nstr;
+ return found;
+}
+
+
+
diff --git a/setedit/extra/dyncat.h b/setedit/extra/dyncat.h
new file mode 100644
index 0000000..3f17257
--- /dev/null
+++ b/setedit/extra/dyncat.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef __DYNCAT_H__
+#define __DYNCAT_H__
+typedef struct
+{
+ int len;
+ char *str;
+} DynStrCatStruct;
+
+void DynStrCatInit(DynStrCatStruct *Struct, const char *str=NULL, int len=-1);
+void DynStrCat(DynStrCatStruct *Struct, const char *str, int len=-1);
+
+// Another useful stuff
+char *newStrL(const char *start, int len);
+int SplitStr(char *str, int copy, const char *delimiters,
+ void (*adder)(const char *, void *), void *data);
+#endif
diff --git a/setedit/extra/memmove.s b/setedit/extra/memmove.s
new file mode 100644
index 0000000..373b280
--- /dev/null
+++ b/setedit/extra/memmove.s
@@ -0,0 +1,30 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#ifdef __DJGPP__
+ .file "memmove.s"
+ .globl _memmove
+_memmove:
+ pushl %ebp
+ movl %esp,%ebp
+ pushl %esi
+ pushl %edi
+ movl 8(%ebp),%edi
+ movl 12(%ebp),%esi
+ movl 16(%ebp),%ecx
+ jecxz L2
+
+ cmpl %esi,%edi
+ jb L3
+
+ call ___dj_movedata_rev
+ jmp L2
+L3:
+ call ___dj_movedata
+
+L2:
+ cld
+ popl %edi
+ popl %esi
+ movl 8(%ebp),%eax
+ leave
+ ret
+#endif
diff --git a/setedit/extra/mixer.c b/setedit/extra/mixer.c
new file mode 100644
index 0000000..c187a04
--- /dev/null
+++ b/setedit/extra/mixer.c
@@ -0,0 +1,140 @@
+#include <configed.h>
+#include "mixer.h"
+
+#ifdef HAVE_MIXER
+
+#define drvNone -1
+#define drvFailed -2
+
+static int Driver=drvNone,DriverOld=drvNone;
+
+const char sMxVol[] =" Vol ";
+const char sMxBass[] ="Bass ";
+const char sMxTrebl[]="Trebl";
+const char sMxSynth[]="Synth";
+const char sMxWave[] ="Wave ";
+const char sMxSpkr[] ="Spkr ";
+const char sMxLine[] ="Line ";
+const char sMxMic[] =" Mic ";
+const char sMxCD[] =" CD ";
+const char sMxMix[] =" Mix ";
+const char sMxWave2[]="Wave2";
+const char sMxRec[] =" Rec ";
+const char sMxIGain[]="IGain";
+const char sMxOGain[]="OGain";
+const char sMxLine1[]="Line1";
+const char sMxLine2[]="Line2";
+const char sMxLine3[]="Line3";
+
+const char lMxVol[] ="master vol";
+const char lMxBass[] ="bass";
+const char lMxTrebl[]="treble";
+const char lMxSynth[]="synthetized";
+const char lMxWave[] ="wave";
+const char lMxSpkr[] ="speaker";
+const char lMxLine[] ="line";
+const char lMxMic[] ="mic";
+const char lMxCD[] ="cd";
+const char lMxMix[] ="mixer";
+const char lMxWave2[]="wave 2";
+const char lMxRec[] ="record";
+const char lMxIGain[]="input gain";
+const char lMxOGain[]="output gain";
+const char lMxLine1[]="line 1";
+const char lMxLine2[]="line 2";
+const char lMxLine3[]="line 3";
+
+typedef struct
+{
+ int (*Init)();
+ void (*DeInit)();
+ int (*Set)(int id, int left, int right);
+ int (*Read)(int id, int *left, int *right);
+ const BOARD_MIXER *(*GetElements)(int *cant);
+ void (*GetName)(char *buffer, int size);
+} stDriver;
+
+#define MaxNameLen 80
+static char DrvName[MaxNameLen];
+
+stDriver Drivers[]=
+{
+#ifdef SECompf_djgpp
+ { SBMixerInit, SBMixerDeInit, SBSetMixerValue,
+ SBReadMixerValue, SBGetElements, SBGetName }
+#endif
+
+#ifdef SEOSf_Linux
+ { LinuxMixerInit, LinuxMixerDeInit, LinuxSetMixerValue,
+ LinuxReadMixerValue, LinuxGetElements, LinuxMixerGetName }
+#endif
+};
+
+#define NumDrivers (sizeof(Drivers)/sizeof(stDriver))
+
+int MixerInit()
+{
+ int i;
+ if (Driver>=0) return 1;
+ if (Driver!=drvFailed && DriverOld>=0)
+ {
+ if (Drivers[DriverOld].Init())
+ {
+ Driver=DriverOld;
+ return 1;
+ }
+ DriverOld=drvFailed;
+ }
+ for (i=0; i<NumDrivers; i++)
+ if (Drivers[i].Init())
+ {
+ Driver=i;
+ return 1;
+ }
+ Driver=drvFailed;
+ return 0;
+}
+
+void MixerDeInit()
+{
+ if (Driver<0) return;
+ Drivers[Driver].DeInit();
+ DriverOld=Driver;
+ Driver=drvNone;
+}
+
+int SetMixerValue(int id, int left, int right)
+{
+ if (Driver<0) return 0;
+ return Drivers[Driver].Set(id,left,right);
+}
+
+int ReadMixerValue(int id, int *left, int *right)
+{
+ if (Driver<0) return 0;
+ return Drivers[Driver].Read(id,left,right);
+}
+
+const BOARD_MIXER *GetElements(int *cant)
+{
+ if (Driver<0) return 0;
+ return Drivers[Driver].GetElements(cant);
+}
+
+const char *GetMixerName()
+{
+ if (Driver<0) return 0;
+ Drivers[Driver].GetName(DrvName,MaxNameLen);
+ return DrvName;
+}
+#else // HAVE_MIXER
+int MixerInit() { return 0; }
+int SetMixerValue(int id, int left, int right)
+{ if (id | left | right) id=0; return 0; }
+void MixerDeInit() {}
+const BOARD_MIXER *GetElements(int *cant)
+{
+ *cant=0;
+ return 0;
+}
+#endif // HAVE_MIXER
diff --git a/setedit/extra/mixer.h b/setedit/extra/mixer.h
new file mode 100644
index 0000000..7e1b84a
--- /dev/null
+++ b/setedit/extra/mixer.h
@@ -0,0 +1,100 @@
+/**[txh]********************************************************************
+
+ Description:
+ Mixer definitions shared by all modules.
+ Copyright (c) 2000-2001 by Salvador E. Tropea.
+ This code is under the GPL license.
+
+***************************************************************************/
+
+#ifndef MIXER_BOARD_INCLUDED
+#define MIXER_BOARD_INCLUDED
+
+// Flags
+#define BOARD_MIXER_ELEM_STEREO 1
+#define BOARD_MIXER_ELEM_MONO 0
+#define IS_BOARD_MIXER_ELEM_STEREO(a) (a.flags & BOARD_MIXER_ELEM_STEREO)
+
+//
+// Commonly found ids, is not a coincidence they are the same used by Linux kernel ;-)
+// Any value greater than 0x80000000 is board specific.
+//
+#define BOARD_MIXER_ID_MIXER_VOLUME 0
+#define BOARD_MIXER_ID_MIXER_BASS 1
+#define BOARD_MIXER_ID_MIXER_TREBLE 2
+#define BOARD_MIXER_ID_MIXER_SYNTH 3 /* FM */
+#define BOARD_MIXER_ID_MIXER_PCM 4 /* Wav */
+#define BOARD_MIXER_ID_MIXER_SPEAKER 5
+#define BOARD_MIXER_ID_MIXER_LINE 6
+#define BOARD_MIXER_ID_MIXER_MIC 7
+#define BOARD_MIXER_ID_MIXER_CD 8
+#define BOARD_MIXER_ID_MIXER_IMIX 9 /* Recording monitor */
+#define BOARD_MIXER_ID_MIXER_ALTPCM 10
+#define BOARD_MIXER_ID_MIXER_RECLEV 11 /* Recording level */
+#define BOARD_MIXER_ID_MIXER_IGAIN 12 /* Input gain */
+#define BOARD_MIXER_ID_MIXER_OGAIN 13 /* Output gain */
+#define BOARD_MIXER_ID_MIXER_LINE1 14 /* Input source 1 (aux1) */
+#define BOARD_MIXER_ID_MIXER_LINE2 15 /* Input source 2 (aux2) */
+#define BOARD_MIXER_ID_MIXER_LINE3 16 /* Input source 3 (line) */
+
+extern const char sMxVol[],sMxBass[],sMxTrebl[],sMxSynth[],sMxWave[],sMxSpkr[],
+ sMxLine[],sMxMic[],sMxCD[],sMxMix[],sMxWave2[],sMxRec[],sMxIGain[],sMxOGain[],
+ sMxLine1[],sMxLine2[],sMxLine3[],lMxVol[],lMxBass[],lMxTrebl[],lMxSynth[],lMxWave[],
+ lMxSpkr[],lMxLine[],lMxMic[],lMxCD[],lMxMix[],lMxWave2[],lMxRec[],lMxIGain[],
+ lMxOGain[],lMxLine1[],lMxLine2[],lMxLine3[];
+
+typedef struct BOARD_MIXER
+{
+ unsigned id;
+ const char *name;
+ const char *s_name;
+ unsigned flags;
+ int right; // 0-100
+ int left; // 0-100
+} BOARD_MIXER;
+
+#define MaxMixerVol 100
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef SECompf_djgpp
+int SBMixerInit();
+void SBMixerDeInit();
+int SBSetMixerValue(int id, int left, int right);
+int SBReadMixerValue(int id, int *left, int *right);
+const BOARD_MIXER *SBGetElements(int *cant);
+void SBGetName(char *buffer, int size);
+#endif
+
+#ifdef SEOSf_Linux
+int LinuxMixerInit();
+void LinuxMixerDeInit();
+int LinuxSetMixerValue(int id, int left, int right);
+int LinuxReadMixerValue(int id, int *left, int *right);
+const BOARD_MIXER *LinuxGetElements(int *cant);
+void LinuxMixerGetName(char *buffer, int size);
+#endif
+
+int MixerInit();
+void MixerDeInit();
+int SetMixerValue(int id, int left, int right);
+int ReadMixerValue(int id, int *left, int *right);
+const BOARD_MIXER *GetElements(int *cant);
+const char *GetMixerName();
+
+#ifdef __cplusplus
+}
+
+class fpstream;
+
+extern void BoardMixerDialog();
+extern void BoardMixerInit();
+extern void BoardMixerDisable();
+extern void BoardMixerSave(fpstream& s);
+extern void BoardMixerLoad(fpstream& s);
+
+#endif
+
+#endif // MIXER_BOARD_INCLUDED
diff --git a/setedit/extra/mixersb.c b/setedit/extra/mixersb.c
new file mode 100644
index 0000000..01166d3
--- /dev/null
+++ b/setedit/extra/mixersb.c
@@ -0,0 +1,532 @@
+/**[txh]********************************************************************
+
+ Description:
+ Mixer rutines for Sound Blaster Pro and 16.
+ Copyright (c) 2000 by Salvador E. Tropea.
+ Part of this code (board initialization) were taked from Allegro.
+ This code is under the GPL license except Allegro part.
+
+***************************************************************************/
+
+#include <configed.h>
+
+#if defined(SECompf_djgpp) && defined(HAVE_MIXER)
+#include <stdlib.h>
+#include <string.h>
+#include <pc.h>
+#include "mixer.h"
+
+/*****************************************************************************
+
+ As I don't know if this code will be integrated to Allego I'm taking the
+needed routines and putting them in this module.
+
+*****************************************************************************/
+
+static int sb_dsp_ver = -1; /* SB DSP version */
+static int _sb_port = -1;
+static int sb_hw_dsp_ver = -1; /* as reported by autodetect */
+
+/* sb_write_dsp:
+ * Writes a byte to the SB DSP chip. Returns -1 if it times out.
+ */
+static inline volatile int sb_write_dsp(unsigned char byte)
+{
+ int x;
+
+ for (x=0; x<0xffff; x++) {
+ if (!(inportb(0x0C+_sb_port) & 0x80)) {
+ outportb(0x0C+_sb_port, byte);
+ return 0;
+ }
+ }
+ return -1;
+}
+
+/* sb_read_dsp:
+ * Reads a byte from the SB DSP chip. Returns -1 if it times out.
+ */
+static inline volatile int sb_read_dsp()
+{
+ int x;
+
+ for (x=0; x<0xffff; x++)
+ if (inportb(0x0E + _sb_port) & 0x80)
+ return inportb(0x0A+_sb_port);
+
+ return -1;
+}
+
+
+/* _sb_reset_dsp:
+ * Resets the SB DSP chip, returning -1 on error.
+ */
+static
+int _sb_reset_dsp(int data)
+{
+ int x;
+
+ outportb(0x06+_sb_port, data);
+
+ for (x=0; x<8; x++)
+ inportb(0x06+_sb_port);
+
+ outportb(0x06+_sb_port, 0);
+
+ if (sb_read_dsp() != 0xAA)
+ return -1;
+
+ return 0;
+}
+
+/* _sb_read_dsp_version:
+ * Reads the version number of the SB DSP chip, returning -1 on error.
+ */
+static
+int _sb_read_dsp_version()
+{
+ int x, y;
+
+ if (sb_hw_dsp_ver > 0)
+ return sb_hw_dsp_ver;
+
+ if (_sb_port <= 0)
+ _sb_port = 0x220;
+
+ if (_sb_reset_dsp(1) != 0) {
+ sb_hw_dsp_ver = -1;
+ }
+ else {
+ sb_write_dsp(0xE1);
+ x = sb_read_dsp();
+ y = sb_read_dsp();
+ sb_hw_dsp_ver = ((x << 8) | y);
+ }
+
+ return sb_hw_dsp_ver;
+}
+
+
+/* sb_detect:
+ * SB detection routine. Uses the BLASTER environment variable,
+ * or 'sensible' guesses if that doesn't exist.
+ */
+static int sb_detect(void)
+{
+ char *blaster = getenv("BLASTER");
+
+ /* parse BLASTER env */
+ if (blaster) {
+ while (*blaster) {
+ while ((*blaster == ' ') || (*blaster == '\t'))
+ blaster++;
+
+ if (*blaster) {
+ switch (*blaster) {
+
+ case 'a': case 'A':
+ if (_sb_port < 0)
+ _sb_port = strtol(blaster+1, NULL, 16);
+ break;
+
+ case 'i': case 'I':
+ case 'd': case 'D':
+ case 'h': case 'H':
+ strtol(blaster+1, NULL, 10);
+ break;
+ }
+
+ while ((*blaster) && (*blaster != ' ') && (*blaster != '\t'))
+ blaster++;
+ }
+ }
+ }
+
+ if (_sb_port < 0)
+ _sb_port = 0x220;
+
+ /* make sure we got a good port address */
+ if (_sb_reset_dsp(1) != 0) {
+ static int bases[] = { 0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0 };
+ int i;
+
+ for (i=0; bases[i]; i++) {
+ _sb_port = bases[i];
+ if (_sb_reset_dsp(1) == 0)
+ break;
+ }
+ }
+
+ /* check if the card really exists */
+ _sb_read_dsp_version();
+ if (sb_hw_dsp_ver < 0) {
+ return 1;
+ }
+ sb_dsp_ver = sb_hw_dsp_ver;
+
+ /* what breed of SB? */
+ // sb_dsp_ver >= 0x400) "SB 16"
+ // sb_dsp_ver >= 0x300) "SB Pro"
+ // sb_dsp_ver >= 0x201) "SB 2.0"
+ // sb_dsp_ver >= 0x200) "SB 1.5"
+ // else "SB 1.0";
+ return 0;
+}
+
+
+/*****************************************************************************
+
+ End of Allegro code.
+
+*****************************************************************************/
+
+// 0-255 to 0-100
+#define SB16ValToMixer(a) (((a|7)*100+100)/255)
+#define SBProLeftToMixer(a) ((a & 0xF)*100/15)
+#define SBProRightToMixer(a) ((a>>4)*100/15)
+#define SBProMicToMixer(a) (((a & 7)>>1)*100/3)
+#define MixerToSB16Val(a) (a*255/100)
+#define MixerToSBPro(l,r) (((l*15/100) & 0xF) | ((r*15/100) << 4))
+#define MixerToSBProMic(a) ((a*3/100)<<1)
+
+static BOARD_MIXER *elements=0;
+static int isSB16;
+static int lastElement=0;
+
+static void SBReadRealMixerValue(int id, int pos);
+
+#include <stdio.h>
+
+static inline
+void WriteMixer(int index, unsigned char value)
+{
+ outportb(_sb_port+4,index);
+ outportb(_sb_port+5,value);
+}
+
+static inline
+unsigned char ReadMixer(int index)
+{
+ outportb(_sb_port+4,index);
+ return inportb(_sb_port+5);
+}
+
+static BOARD_MIXER SBProMixer[]=
+{
+ {
+ BOARD_MIXER_ID_MIXER_VOLUME,
+ lMxVol,sMxVol,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 02h (Only SBPro) and 22h
+ {
+ BOARD_MIXER_ID_MIXER_SYNTH,
+ lMxSynth,sMxSynth,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 26h
+ {
+ BOARD_MIXER_ID_MIXER_PCM,
+ lMxWave,sMxWave,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 04h
+ {
+ BOARD_MIXER_ID_MIXER_LINE,
+ lMxLine,sMxLine,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 2Eh
+ {
+ BOARD_MIXER_ID_MIXER_MIC,
+ lMxMic,sMxMic,
+ BOARD_MIXER_ELEM_MONO,-1,-1
+ }, // reg 0Ah
+ {
+ BOARD_MIXER_ID_MIXER_CD,
+ lMxCD,sMxCD,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ } // reg 28h
+};
+
+static unsigned char SBProMixerReg[]=
+{
+ 0x22,0x26,0x04,0x2E,0x0A,0x28
+};
+
+static BOARD_MIXER SB16Mixer[]=
+{
+ {
+ BOARD_MIXER_ID_MIXER_VOLUME,
+ lMxVol,sMxVol,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 30/1h
+ {
+ BOARD_MIXER_ID_MIXER_BASS,
+ lMxBass,sMxBass,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 46/7h
+ {
+ BOARD_MIXER_ID_MIXER_TREBLE,
+ lMxTrebl,sMxTrebl,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 44/5h
+ {
+ BOARD_MIXER_ID_MIXER_SYNTH,
+ lMxSynth,sMxSynth,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 34/5h
+ {
+ BOARD_MIXER_ID_MIXER_PCM,
+ lMxWave,sMxWave,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 32/3h
+ {
+ BOARD_MIXER_ID_MIXER_SPEAKER,
+ lMxSpkr,sMxSpkr,
+ BOARD_MIXER_ELEM_MONO,-1,-1
+ }, // reg 3Bh
+ {
+ BOARD_MIXER_ID_MIXER_LINE,
+ lMxLine,sMxLine,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 38/9h
+ {
+ BOARD_MIXER_ID_MIXER_MIC,
+ lMxMic,sMxMic,
+ BOARD_MIXER_ELEM_MONO,-1,-1
+ }, // reg 3Ah
+ {
+ BOARD_MIXER_ID_MIXER_CD,
+ lMxCD,sMxCD,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 36/7h
+ {
+ BOARD_MIXER_ID_MIXER_IGAIN,
+ lMxIGain,sMxIGain,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ }, // reg 3F/40h
+ {
+ BOARD_MIXER_ID_MIXER_OGAIN,
+ lMxOGain,sMxOGain,
+ BOARD_MIXER_ELEM_STEREO,-1,-1
+ } // reg 41/2h
+};
+
+static unsigned char SB16MixerReg[]=
+{
+ 0x30,0x46,0x44,0x34,0x32,0x3B,0x38,0x3A,0x36,0x3F,0x41
+};
+
+int SBMixerInit()
+{
+ int i;
+
+ if (sb_dsp_ver!=-1) return 1;
+ if (sb_detect() || // !SB found or
+ sb_dsp_ver<0x300) // too old, only SB Pro and newers have mixer
+ return 0;
+ if (sb_dsp_ver>=0x400)
+ {
+ elements=SB16Mixer;
+ isSB16=1;
+ lastElement=sizeof(SB16Mixer)/sizeof(BOARD_MIXER);
+ }
+ else
+ {
+ elements=SBProMixer;
+ isSB16=0;
+ lastElement=sizeof(SBProMixer)/sizeof(BOARD_MIXER);
+ }
+ // Read current values
+ for (i=0; i<lastElement; i++)
+ SBReadRealMixerValue(elements[i].id,i);
+ return 1;
+}
+
+static
+int FindElement(int id)
+{
+ int i;
+ if (!elements) return -1;
+ for (i=0; i<lastElement; i++)
+ if (elements[i].id==id) break;
+ return i<lastElement ? i : -1;
+}
+
+static inline
+void ReadSB16MixerStereo(int pos)
+{
+ elements[pos].left =SB16ValToMixer(ReadMixer(SB16MixerReg[pos]));
+ elements[pos].right=SB16ValToMixer(ReadMixer(SB16MixerReg[pos]+1));
+}
+
+static inline
+void ReadSB16MixerMono(int pos)
+{
+ elements[pos].right=
+ elements[pos].left =SB16ValToMixer(ReadMixer(SB16MixerReg[pos]));
+}
+
+static inline
+void ReadSBProMixerStereo(int pos)
+{
+ int vol=ReadMixer(SBProMixerReg[pos]);
+ elements[pos].left =SBProLeftToMixer(vol);
+ elements[pos].right=SBProRightToMixer(vol);
+}
+
+static inline
+void ReadSBProMixerMono(int pos)
+{
+ elements[pos].right=
+ elements[pos].left =SBProMicToMixer(ReadMixer(SBProMixerReg[pos]));
+}
+
+static
+void SBReadRealMixerValue(int id, int pos)
+{
+ if (!elements) return;
+ if (pos<0) pos=FindElement(id);
+ if (pos<0) return;
+
+ if (isSB16)
+ {
+ if (IS_BOARD_MIXER_ELEM_STEREO(elements[pos]))
+ ReadSB16MixerStereo(pos);
+ else
+ ReadSB16MixerMono(pos);
+ }
+ else
+ {
+ if (IS_BOARD_MIXER_ELEM_STEREO(elements[pos]))
+ ReadSBProMixerStereo(pos);
+ else
+ ReadSBProMixerMono(pos);
+ }
+}
+
+void SBMixerDeInit()
+{
+}
+
+const BOARD_MIXER *SBGetElements(int *cant)
+{
+ *cant=lastElement;
+ return elements;
+}
+
+static inline
+void WriteSB16MixerStereo(int pos, int left, int right)
+{
+ WriteMixer(SB16MixerReg[pos],MixerToSB16Val(left));
+ WriteMixer(SB16MixerReg[pos]+1,MixerToSB16Val(right));
+}
+
+static inline
+void WriteSB16MixerMono(int pos, int vol)
+{
+ WriteMixer(SB16MixerReg[pos],MixerToSB16Val(vol));
+}
+
+static inline
+void WriteSBProMixerStereo(int pos, int left, int right)
+{
+ WriteMixer(SBProMixerReg[pos],MixerToSBPro(left,right));
+}
+
+static inline
+void WriteSBProMixerMono(int pos, int vol)
+{
+ WriteMixer(SBProMixerReg[pos],MixerToSBProMic(vol));
+}
+
+int SBSetMixerValue(int id, int left, int right)
+{
+ int pos;
+
+ if (!elements) return 0;
+ pos=FindElement(id);
+ if (isSB16)
+ {
+ if (IS_BOARD_MIXER_ELEM_STEREO(elements[pos]))
+ WriteSB16MixerStereo(pos,left,right);
+ else
+ WriteSB16MixerMono(pos,left);
+ }
+ else
+ {
+ if (IS_BOARD_MIXER_ELEM_STEREO(elements[pos]))
+ WriteSBProMixerStereo(pos,left,right);
+ else
+ WriteSBProMixerMono(pos,left);
+ }
+ SBReadRealMixerValue(id,pos);
+ return 1;
+}
+
+int SBReadMixerValue(int id, int *left, int *right)
+{
+ int elem;
+
+ if (!elements) return 0;
+ elem=FindElement(id);
+ if (elem<0) return 0;
+ *left=elements[elem].left;
+ *right=elements[elem].right;
+ return 1;
+}
+
+void SBGetName(char *buffer, int size)
+{
+ if (isSB16)
+ strncpy(buffer,"Sound Blaster 16",size);
+ else
+ strncpy(buffer,"Sound Blaster Pro",size);
+ buffer[size-1]=0;
+}
+
+//#define TEST
+#ifdef TEST
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ int left,right,cant,i;
+ const BOARD_MIXER *e;
+
+ if (!SBMixerInit())
+ {
+ printf("Can't initialize mixer\n");
+ return 1;
+ }
+
+ if (!(e=SBGetElements(&cant)))
+ {
+ printf("Can't get list of elements\n");
+ return 4;
+ }
+ printf("%d of supported elements:\n",cant);
+ for (i=0; i<cant; i++)
+ {
+ if (IS_BOARD_MIXER_ELEM_STEREO(e[i]))
+ printf("%s (%s) [%d,%d]\n",e[i].name,e[i].s_name,e[i].left,e[i].right);
+ else
+ printf("%s (%s) [%d]\n",e[i].name,e[i].s_name,e[i].left);
+ }
+
+ if (!SBReadMixerValue(BOARD_MIXER_ID_MIXER_VOLUME,&left,&right))
+ {
+ printf("Can't read master volume\n");
+ return 2;
+ }
+ printf("Master: %d,%d\n",left,right);
+
+ if (!SBSetMixerValue(BOARD_MIXER_ID_MIXER_VOLUME,50,50))
+ {
+ printf("Can't set master volume\n");
+ return 3;
+ }
+
+ SBMixerDeInit();
+ return 0;
+}
+#endif
+
+#endif // djgpp && HAVE_MIXER
diff --git a/setedit/extra/mixoss.c b/setedit/extra/mixoss.c
new file mode 100644
index 0000000..fc5f518
--- /dev/null
+++ b/setedit/extra/mixoss.c
@@ -0,0 +1,200 @@
+/**[txh]********************************************************************
+
+ Description:
+ Mixer rutines for Linux OSS.
+ Copyright (c) 2000 by Salvador E. Tropea.
+ This code is under the GPL license.
+
+***************************************************************************/
+
+#include <configed.h>
+
+#if defined(SEOSf_Linux) && defined(HAVE_MIXER)
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/soundcard.h>
+#include <sys/ioctl.h>
+#include "mixer.h"
+
+#define COMPOSE_VOLUME(left,right) ((right<<8)|left)
+#define DECOMPOSE_VOLUME(vol,dev) dev.right=(vol>>8)&0xFF; dev.left=vol&0xFF
+
+static int fdMixer=-1;
+static BOARD_MIXER elements[SOUND_MIXER_NRDEVICES];
+static int lastElement;
+static const char *longNames[SOUND_MIXER_NRDEVICES]=
+{
+ lMxVol,lMxBass,lMxTrebl,lMxSynth,lMxWave,lMxSpkr,lMxLine,
+ lMxMic,lMxCD,lMxMix,lMxWave2,lMxRec,lMxIGain,lMxOGain,
+ lMxLine1,lMxLine2,lMxLine3
+};
+static const char *shortNames[SOUND_MIXER_NRDEVICES]=
+{
+ sMxVol,sMxBass,sMxTrebl,sMxSynth,sMxWave,sMxSpkr,sMxLine,
+ sMxMic,sMxCD,sMxMix,sMxWave2,sMxRec,sMxIGain,sMxOGain,
+ sMxLine1,sMxLine2,sMxLine3
+};
+
+int LinuxMixerInit()
+{
+ // Already initialized
+ if (fdMixer!=-1) return 1;
+ fdMixer=open("/dev/mixer",O_RDWR);
+ if (fdMixer!=-1)
+ {// Initialize the array
+ unsigned devices,stereo,mask,val;
+ int i;
+ if (ioctl(fdMixer,SOUND_MIXER_READ_DEVMASK,&devices)==-1 ||
+ ioctl(fdMixer,SOUND_MIXER_READ_STEREODEVS,&stereo)==-1) return 0;
+ lastElement=0;
+ memset(elements,0,sizeof(elements));
+ for (i=0,mask=1; i<SOUND_MIXER_NRDEVICES; mask<<=1,i++)
+ {
+ if (devices & mask)
+ {
+ elements[lastElement].id=i;
+ elements[lastElement].name=longNames[i];
+ elements[lastElement].s_name=shortNames[i];
+ elements[lastElement].flags=stereo & mask ?
+ BOARD_MIXER_ELEM_STEREO : BOARD_MIXER_ELEM_MONO;
+ ioctl(fdMixer,MIXER_READ(i),&val);
+ DECOMPOSE_VOLUME(val,elements[lastElement]);
+ lastElement++;
+ }
+ }
+ }
+ return fdMixer!=-1;
+}
+
+void LinuxMixerDeInit()
+{
+ if (fdMixer==-1) return;
+ close(fdMixer);
+ fdMixer=-1;
+}
+
+const BOARD_MIXER *LinuxGetElements(int *cant)
+{
+ if (fdMixer==-1)
+ {
+ *cant=0;
+ return NULL;
+ }
+ *cant=lastElement;
+ return elements;
+}
+
+static
+int FindElement(int id)
+{
+ int i;
+ for (i=0; i<lastElement; i++)
+ if (elements[i].id==id) break;
+ return i<lastElement ? i : -1;
+}
+
+static
+int LinuxUpdateMixerValue(int id, unsigned vol)
+{
+ int elem;
+
+ elem=FindElement(id);
+ if (elem<0) return 0;
+ //if (ioctl(fdMixer,MIXER_READ(id),&vol)==-1) return 0;
+ DECOMPOSE_VOLUME(vol,elements[elem]);
+ return 1;
+}
+
+int LinuxSetMixerValue(int id, int left, int right)
+{// ID is mapped one to one
+ unsigned vol;
+
+ // Avoid reading outside the bounds
+ if (fdMixer==-1 || id<0 || id>=SOUND_MIXER_NRDEVICES) return 0;
+ vol=COMPOSE_VOLUME(left,right);
+ if (ioctl(fdMixer,MIXER_WRITE(id),&vol)==-1) return 0;
+ // The ioctl updates the value!
+ LinuxUpdateMixerValue(id,vol);
+ return 1;
+}
+
+int LinuxReadMixerValue(int id, int *left, int *right)
+{
+ int elem;
+
+ if (fdMixer==-1) return 0;
+ elem=FindElement(id);
+ if (elem<0) return 0;
+ *left=elements[elem].left;
+ *right=elements[elem].right;
+ return 1;
+}
+
+void LinuxMixerGetName(char *buffer, int size)
+{
+ struct mixer_info mi;
+ int available;
+
+ *buffer=0;
+ if (fdMixer==-1) return;
+ strncpy(buffer,"Open Sound System",size);
+ buffer[size-1]=0;
+ available=size-1-strlen(buffer)-3;
+ if (available>0 && ioctl(fdMixer,SOUND_MIXER_INFO,&mi)!=-1)
+ {
+ strcat(buffer," (");
+ strncat(buffer,mi.name,available);
+ strcat(buffer,")");
+ }
+}
+
+//#define TEST
+#ifdef TEST
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ int left,right,cant,i;
+ const BOARD_MIXER *e;
+
+ if (!LinuxMixerInit())
+ {
+ printf("Can't initialize mixer\n");
+ return 1;
+ }
+
+ if (!(e=LinuxGetElements(&cant)))
+ {
+ printf("Can't get list of elements\n");
+ return 4;
+ }
+ printf("%d of supported elements:\n",cant);
+ for (i=0; i<cant; i++)
+ {
+ if (IS_BOARD_MIXER_ELEM_STEREO(e[i]))
+ printf("%s (%s) [%d,%d]\n",e[i].name,e[i].s_name,e[i].left,e[i].right);
+ else
+ printf("%s (%s) [%d]\n",e[i].name,e[i].s_name,e[i].left);
+ }
+
+ if (!LinuxReadMixerValue(BOARD_MIXER_ID_MIXER_VOLUME,&left,&right))
+ {
+ printf("Can't read master volume\n");
+ return 2;
+ }
+ printf("Master: %d,%d\n",left,right);
+
+ if (!LinuxSetMixerValue(BOARD_MIXER_ID_MIXER_VOLUME,90,90))
+ {
+ printf("Can't set master volume\n");
+ return 3;
+ }
+
+ LinuxMixerDeInit();
+ return 0;
+}
+#endif
+
+#endif // SEOSf_Linux && HAVE_MIXER
diff --git a/setedit/extra/stackdbg.c b/setedit/extra/stackdbg.c
new file mode 100644
index 0000000..9a11272
--- /dev/null
+++ b/setedit/extra/stackdbg.c
@@ -0,0 +1,774 @@
+/*************************************************************************
+ *
+ * Copyright (c) 1999 by Bjorn Reese <breese@mail1.stofanet.dk>
+ * Copyright (c) 2001 by Salvador E. Tropea (SET) <set@ieee.org>
+ *
+ * itoa: Copyright (C) 1995 DJ Delorie.
+ *
+ * License: GPL
+ * Original license:
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
+
+ Some technicals details: (by SET)
+ I modified the code to work from a signal handler with Linux+glibc
+2.1.3+gdb 19990928. I hope it works for other combinations. The main
+problems in the original code were:
+1) Used two different programs to achive it (one to attach and another
+to trace).
+2) The point of the real crash was impossible to determine with the
+stacktrace version. It looks like gdb needs the debugie stopped to
+determine the point where the signal was triggered.
+
+*************************************************************************/
+#include "stackdbg.h"
+#include <configed.h>
+
+/*****************************************************************************
+ ============================================================================
+ UNIX target, Linux right now to be honest.
+ ============================================================================
+*****************************************************************************/
+#ifdef SEOS_UNIX
+#define CLY_DoNotDefineUTypes
+#define Uses_itoa
+#define Uses_alloca
+#include <compatlayer.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h> // SET: getenv
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <sys/stat.h>
+
+/*************************************************************************
+ * Defines
+ */
+#define MAX_INT_PR_SIZE 32
+#define DEBUGER "gdb"
+#define XTERMINAL "xterm"
+#define NM "nm"
+#define SYS_ERROR -1
+
+/*************************************************************************
+ * Globals
+ */
+/* The name of the executable is needed by the debugger */
+static const char *global_processname=NULL;
+static char gdbPresent=0, xtermPresent=0, nmPresent=0, weHaveSymbols=0;
+/* By default do nothing */
+static char strategy=DBGST_DO_NOTHING;
+/* This variable will be modified by gdb */
+/* SET: This variable must be global if we want to use gcc -O2 */
+/* A compiler won't respect volatile if the variable is local! */
+static volatile int DebugStack_attached=0;
+
+void StackDBG_JustDumpStack(const char *redirect);
+
+/*****************************************************************************
+ Helper functions for process handling.
+*****************************************************************************/
+
+/**[txh]********************************************************************
+
+ Description:
+ This works like system() except the parent process is forced to wait
+until the debugger which is launched in the child process has been
+attached to the parent process. This functions should only be used by
+DebugStack().
+ By breese.
+
+ Returns: 0 on success, 1 if fork fails
+
+***************************************************************************/
+
+int StackDBG_SpecialSystem(const char *command)
+{
+ int rc=0;
+ pid_t pid;
+
+ pid=fork();
+ switch (pid)
+ {
+ case -1: /* fork() failed */
+ rc = 1;
+ break;
+
+ case 0: /* Child */
+ /*
+ * The system() call assumes that /bin/sh is
+ * always available, and so will we.
+ */
+ execl("/bin/sh","/bin/sh","-c",command,NULL);
+ _exit(1);
+ break;
+
+ default: /* Parent */
+ /* Wait until the debugger is attached */
+ /* It would be nicer to sleep() here, but it doesn't
+ * appear to work on all platforms */
+ while (!DebugStack_attached);
+ break;
+ } /* switch */
+ return rc;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Runs the command as a child process redirecting the output (out and error
+to a us.
+ Note: I changed what handle closes the child.
+ By breese.
+
+ Return:
+ The file handle of a pipe connected to the child.
+
+***************************************************************************/
+static
+int my_popen(const char *command, pid_t *pid)
+{
+ int rc;
+ int pipefd[2];
+
+ rc=pipe(pipefd);
+ if (rc!=SYS_ERROR)
+ {
+ *pid=fork();
+ switch (*pid)
+ {
+ case SYS_ERROR:
+ rc = SYS_ERROR;
+ close(pipefd[0]);
+ close(pipefd[1]);
+ break;
+
+ case 0: /* Child */
+ close(pipefd[0]);
+ dup2(pipefd[1], STDOUT_FILENO);
+ dup2(pipefd[1], STDERR_FILENO);
+ close(pipefd[1]);
+ /*
+ * The System() call assumes that /bin/sh is
+ * always available, and so will we.
+ */
+ execl("/bin/sh", "/bin/sh", "-c", command, NULL);
+ _exit(EXIT_FAILURE);
+ break;
+
+ default: /* Parent */
+ close(pipefd[1]);
+ rc = pipefd[0];
+ break;
+ } /* switch */
+ }
+ return rc;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a line of text from the child.
+ By breese.
+
+ Return:
+ The ammount of bytes read.
+
+***************************************************************************/
+static
+int my_getline(int fd, char *buffer, int max)
+{
+ char c;
+ int i=0;
+
+ do
+ {
+ if (read(fd,&c,1)<1)
+ return 0;
+ if (i<max)
+ buffer[i++]=c;
+ }
+ while (c!='\n');
+ buffer[i]=(char)0;
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the pipe and ensures the child dies.
+ By SET.
+
+***************************************************************************/
+static
+void my_pclose(int fd, int pid)
+{
+ int wstatus,ret;
+ /* Close the pipe, it should kill the child with SIGPIPE */
+ close(fd);
+ /* Is already dead? */
+ ret=waitpid(pid,&wstatus,WNOHANG);
+ if (ret==0)
+ {/* Nope, wait a little bit */
+ /* I choose to sleep and no hang, perhaps setting an alarm
+ could be better */
+ usleep(100000);
+ /* Is dead? */
+ ret=waitpid(pid,&wstatus,WNOHANG);
+ if (ret==0)
+ {/* Nope, a diehard, or just too slow. */
+ /* Make sure the the child process has terminated */
+ kill(pid,SIGKILL);
+ /* The child can't block it so we can wait */
+ waitpid(pid,&wstatus,0);
+ }
+ }
+}
+
+/*****************************************************************************
+ Helper functions for output.
+*****************************************************************************/
+static
+void Write(int fd, const char *s)
+{
+ write(fd,s,strlen(s));
+}
+
+static
+void WriteNL(int fd)
+{
+ Write(fd,"\n");
+}
+
+#ifdef TVCPU_x86
+static
+void WriteSpace(int fd)
+{
+ Write(fd," ");
+}
+
+static
+void WriteHex(int fd, unsigned long value)
+{
+ char bNumAux[MAX_INT_PR_SIZE+1];
+ itoa(value,bNumAux,16);
+ Write(fd,bNumAux);
+}
+#endif
+
+/*****************************************************************************
+ Core routines.
+*****************************************************************************/
+
+#if defined(TVCPU_x86) && defined(TVComp_GCC)
+/**[txh]********************************************************************
+
+ Description:
+ This works for gcc+Intel, I don't know if any other platform uses the
+stack like this. That's just based in the C calling convention. The address
+of the first variable incremented gives the frame pointer and then the
+return address follows. We can walk until the frame pointer is 0.
+ It doesn't work if you compile with -fomit-frame-pointer.
+ The use of __builtin_return_address(nn) isn't pratical because you don't
+know how bigger can nn be and you'll most probably SIGSEGV with some
+number. The code generated by __builtin_return_address(nn) becomes big
+quite easily also.
+ Note: I also added Intel specific code that works even with heave
+optimizations enabled.
+
+***************************************************************************/
+
+void StackDBG_GCCDumpStack(int fd)
+{
+ #if 1
+ /* The following works even for -O3 */
+ /* No local variables */
+ static unsigned long *a;
+ static int i;
+ /* a=stack frame */
+ asm("movl %%ebp,%k0" : "=r" (a));
+ #else
+ /* Works upto -O2 for gcc 2.95.2 */
+ /* One local variable */
+ unsigned long *a=(unsigned long *)&a;
+ static int i;
+ /* skip it and get the stack frame */
+ a++;
+ #endif
+
+ for (i=0; a; i++)
+ {
+ WriteHex(fd,a[1]);
+ WriteSpace(fd);
+ WriteHex(fd,(unsigned long)a);
+ WriteSpace(fd);
+ WriteHex(fd,a[0]);
+ switch (i)
+ {
+ case 0:
+ Write(fd," StackDBG_JustDumpStack ");
+ /* The following is a trick to prevent gcc from making these
+ functions inline. */
+ WriteHex(fd,(unsigned long)StackDBG_JustDumpStack);
+ Write(fd," ");
+ WriteHex(fd,(unsigned long)StackDBG_GCCDumpStack);
+ Write(fd," ");
+ WriteHex(fd,(unsigned long)StackDBG_SpecialSystem);
+ Write(fd," ");
+ WriteNL(fd);
+ break;
+ case 1:
+ Write(fd," DebugStack\n");
+ break;
+ case 2:
+ Write(fd," Signal handler (?)\n");
+ break;
+ case 3:
+ Write(fd," libc signal routines\n");
+ break;
+ default:
+ WriteNL(fd);
+ }
+ a=(unsigned long *)a[0];
+ }
+}
+#else
+void StackDBG_GCCDumpStack(int fd)
+{
+}
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ Wrapper for the function that dumps the stack.
+
+***************************************************************************/
+
+void StackDBG_JustDumpStack(const char *redirect)
+{
+ int closeIt=0,fd;
+
+ if (redirect)
+ {
+ fd=open(redirect,O_WRONLY | O_CREAT | O_APPEND,0700);
+ if (fd==-1)
+ fd=STDERR_FILENO;
+ else
+ closeIt=1;
+ }
+ else
+ fd=STDERR_FILENO;
+
+ if (global_processname)
+ {
+ Write(fd,"\n\nCalling stack from ");
+ Write(fd,global_processname);
+ }
+ WriteNL(fd);
+ WriteNL(fd);
+ StackDBG_GCCDumpStack(fd);
+ WriteNL(fd);
+ WriteNL(fd);
+
+ if (closeIt)
+ close(fd);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Helper function to know if we can launch gdb in another xterm.
+
+ Return:
+ !=0 if a separated xterm can be used.
+
+***************************************************************************/
+static
+int XtermAvailable()
+{
+ char *terminal=getenv("TERM");
+ return terminal && strncasecmp(terminal,"xterm",5)==0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Helper function to know if we will launch gdb in another xterm. Exported
+to help the program behave according to it.
+
+ Return:
+ !=0 if a separated xterm will be used for gdb.
+
+***************************************************************************/
+
+int DebugStackSeparateTerminalWillBeUsed()
+{
+ return strategy==DBGST_DEBUG && XtermAvailable();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Acts according to the selected strategy.
+ If the strategy is DBGST_INFORMATIVE creates the commands for gdb and
+calls it using the special system routine. Then the information from gdb
+is callected. If a file is indicated with redirect parameter messages
+from gdb are concatenated and the stderr is suppresed. If NULL is specified
+the output of gdb is redirected to stderr.
+ If the strategy is DBGST_DEBUG creates the commands for gdb and calls it
+using the special system routine. Then the control is passed to gdb so you
+can use it for "post mortem" debuging. If the terminal is xterm* another
+xterm will be used so the contents of the screen are retained.
+ Note by breese: Do only use async-safe functions because DebugStack is
+called from a signal handler.
+ Note by SET: I rewrote it completly, of course using breese ideas.
+
+***************************************************************************/
+
+void DebugStack(const char *redirect)
+{
+ char cpid[MAX_INT_PR_SIZE+1];
+ char filename[13+MAX_INT_PR_SIZE+1];
+ char *buffer;
+ int fd,l1,l2,h_outbak=-1;
+ /* These commands assume gdb */
+ char *normalCommands=
+ "set height 0\n"
+ "set DebugStack_attached = 1\n" /* Tell the process it can go on */
+ "echo <-------- Ignore\\n\n"
+ "finish\n" /* while (!attached); */
+ "finish\n" /* StackDBG_SpecialSystem() */
+ "finish\n" /* DebugStack() */
+ "echo <-------- Crash\\n\n"
+ "finish\n"
+ "echo <-------- Backtrace\\n\n"
+ "backtrace full\n"
+ "echo \\nEnter `quit' and answer yes to exit\\n\n";
+ char *quitCommands="quit\ny\n"; /* quit, yes (detach) */
+
+ if (strategy==DBGST_DO_NOTHING)
+ return;
+ if (strategy==DBGST_DUMP_STACK)
+ {
+ StackDBG_JustDumpStack(redirect);
+ return;
+ }
+
+ /* Convert the pid to a string */
+ itoa((int)getpid(),cpid,10);
+
+ /* Write the initial debugging commands to a temporary file */
+ strcpy(filename,"/tmp/_attach_");
+ strcat(filename,cpid);
+ fd=open(filename,O_WRONLY | O_CREAT,0700);
+ if (fd==-1)
+ return; // :-(
+
+ /* Compute the size of the buffer, it could be huge if global_processname
+ and/or redirect are deeply nested */
+ l1=64+ /* Terminal, debuger, separators, etc. I count 36 aprox. */
+ strlen(filename)+strlen(global_processname)+strlen(cpid)+
+ (redirect ? strlen(redirect) : 0);
+ l2=strlen(normalCommands)+strlen(quitCommands)+1;
+ buffer=(char *)alloca(l1>l2 ? l1 : l2);
+
+ strcpy(buffer,normalCommands);
+ /* This is if we want to end */
+ if (strategy==DBGST_INFORMATIVE)
+ strcat(buffer,quitCommands);
+ write(fd,buffer,l2-1);
+ close(fd);
+
+ /* Arrange the command line */
+ buffer[0]=0;
+ /* Use xterm only if we are in another Xterminal */
+ if (strategy==DBGST_DEBUG && XtermAvailable())
+ strcat(buffer,XTERMINAL " -e ");
+ strcat(buffer,DEBUGER " -x ");
+ strcat(buffer,filename);
+ strcat(buffer," ");
+ strcat(buffer,global_processname);
+ strcat(buffer," ");
+ strcat(buffer,cpid);
+ if (strategy==DBGST_INFORMATIVE)
+ {
+ if (redirect)
+ { /* Concatenate the errors */
+ strcat(buffer," >> ");
+ strcat(buffer,redirect);
+ /* Avoid confusing messages from gdb */
+ strcat(buffer," 2> /dev/null");
+ }
+ else
+ { /* Redirect stdout to stderr */
+ h_outbak=dup(STDOUT_FILENO);
+ dup2(STDERR_FILENO,STDOUT_FILENO);
+ }
+ }
+
+ /* Launch the debugger */
+ StackDBG_SpecialSystem(buffer);
+
+ /* Remove the temporary file */
+ unlink(filename);
+
+ if (h_outbak!=-1)
+ { /* Restore stdout */
+ dup2(h_outbak,STDOUT_FILENO);
+ close(h_outbak);
+ }
+}
+
+/*****************************************************************************
+ Initialization routines.
+*****************************************************************************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Checks if the global_processname have symbols.
+
+ Return: !=0 if we have symbols
+
+***************************************************************************/
+static
+char TestForSymbols()
+{
+ char *buffer;
+ int fd;
+ pid_t pid;
+
+ int l=8+strlen(global_processname);
+ if (l<256) l=256;
+ buffer=(char *)alloca(l);
+
+ strcpy(buffer,NM);
+ strcat(buffer," ");
+ strcat(buffer,global_processname);
+
+ fd=my_popen(buffer,&pid);
+ if (fd!=SYS_ERROR)
+ {
+ my_getline(fd,buffer,l);
+ my_pclose(fd,pid);
+ return strstr(buffer,"no symbols")==0;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Routine used to initialize the system. The aStrategy parameter indicates
+which strategy is desired.
+ The process name should be the content of argv[0] or a binary copy with
+debug information.
+
+ Returns:
+ The available strategy. If some conditions for the desired strategy
+aren't met the routine choose the closest.
+
+***************************************************************************/
+
+char DebugStackInstall(char aStrategy, const char *processname)
+{
+ struct stat st;
+ char *path,*pathEnv,*test,*s;
+ int l,lookForProc;
+
+ global_processname=processname;
+ /* These doesn't need any special thing */
+ if (aStrategy==DBGST_DO_NOTHING || aStrategy==DBGST_DUMP_STACK)
+ {
+ strategy=aStrategy;
+ return strategy;
+ }
+ /* If we don't know the process name that's the best we can do */
+ if (!processname)
+ {
+ strategy=DBGST_DUMP_STACK;
+ return strategy;
+ }
+ /* For the rest we must be sure the programs are there or we will hang */
+ gdbPresent=0; xtermPresent=0; nmPresent=0; weHaveSymbols=0;
+ /* Check is the processname is full qualified */
+ lookForProc=strchr(processname,'/')==0;
+ /* assume we will fail */
+ strategy=DBGST_DUMP_STACK;
+ pathEnv=getenv("PATH");
+ if (pathEnv)
+ {/* Work in a copy to avoid damaging the path */
+ l=strlen(pathEnv)+1;
+ path=(char *)alloca(l);
+ test=(char *)alloca(l+8);
+ strcpy(path,pathEnv);
+ s=strtok(path,":");
+ while (s && (!gdbPresent || !xtermPresent || !nmPresent || lookForProc))
+ {
+ if (!gdbPresent)
+ {
+ strcpy(test,s); strcat(test,"/"); strcat(test,DEBUGER);
+ if (stat(test,&st)==0) gdbPresent=1;
+ }
+ if (!xtermPresent)
+ {
+ strcpy(test,s); strcat(test,"/"); strcat(test,XTERMINAL);
+ if (stat(test,&st)==0) xtermPresent=1;
+ }
+ if (!nmPresent)
+ {
+ strcpy(test,s); strcat(test,"/"); strcat(test,NM);
+ if (stat(test,&st)==0) nmPresent=1;
+ }
+ if (lookForProc)
+ {
+ strcpy(test,s); strcat(test,"/"); strcat(test,processname);
+ if (stat(test,&st)==0)
+ {
+ char *s=(char *)malloc(strlen(test)+1);
+ strcpy(s,test);
+ global_processname=s;
+ lookForProc=0;
+ }
+ }
+ s=strtok(NULL,":");
+ }
+ }
+ /* We need nm to know if the file have symbols.
+ If the file doesn't symbols and we call gdb we won't be
+ able to set the DebugStack_attached variable.
+ We can't afford it. */
+ if (nmPresent && gdbPresent && !lookForProc)
+ {
+ weHaveSymbols=TestForSymbols();
+ if (weHaveSymbols)
+ strategy=aStrategy;
+ }
+ return strategy;
+}
+#endif // SEOS_UNIX
+
+/*****************************************************************************
+ ============================================================================
+ DOS target, djgpp right now to be honest.
+ ============================================================================
+*****************************************************************************/
+#ifdef SEOS_DOS
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+/* In djgpp we can't attach the debugger son only DBGST_DUMP_STACK
+ is available. As that's provided by libc we don't need much code */
+
+char DebugStackInstall(char aStrategy, const char *processname)
+{
+ processname=0;
+ return DBGST_DUMP_STACK;
+}
+
+void DebugStack(const char *redirect)
+{
+ int h_err,h_errbak;
+ if (redirect)
+ {
+ h_err=open(redirect,O_WRONLY | O_BINARY | O_CREAT | O_APPEND,
+ S_IREAD | S_IWRITE);
+ if (h_err)
+ {
+ h_errbak=dup(STDERR_FILENO);
+ dup2(h_err,STDERR_FILENO);
+ }
+ }
+}
+
+int DebugStackSeparateTerminalWillBeUsed()
+{
+ return 0;
+}
+#endif // SEOS_DOS
+
+/*****************************************************************************
+ ============================================================================
+ Win32 target, just dummies right now to be honest.
+ ============================================================================
+*****************************************************************************/
+#ifdef SEOS_Win32
+/* Right now I know nothing here, but I'm sure we can start Dr Watson,
+ Turbo Debugger, gdb win32, etc. */
+static const char *global_processname=0;
+
+char DebugStackInstall(char aStrategy, const char *processname)
+{// Just use the parameters
+ global_processname=processname;
+ if (aStrategy!=DBGST_DO_NOTHING)
+ aStrategy=DBGST_DO_NOTHING;
+ return aStrategy;
+}
+
+void DebugStack(const char *redirect)
+{
+ if (redirect) redirect=0;
+}
+
+int DebugStackSeparateTerminalWillBeUsed()
+{
+ return 0;
+}
+#endif // SEOS_Win32
+
+
+
+
+#if defined(STANDALONE)
+/*****************************************************************************
+Standalone test:
+
+ It just hooks SIGSEGV and does some functions calls to finally generate a
+SIGSEGV.
+*****************************************************************************/
+
+void SignalHandler(int signum)
+{
+ signal(signum,SIG_IGN);
+ DebugStack("pp");
+ signal(signum,SIG_DFL);
+ raise(signum);
+}
+
+/* Create some functions to get something in the stack */
+void HacerDos()
+{
+ char *s=0;
+ int i=45; /* A local var to see */
+ s[1]=0;
+}
+
+void HacerUna()
+{
+ HacerDos();
+}
+
+int main(int argc, char *argv[])
+{
+ DebugStackInstall(DBGST_DUMP_STACK,argv[0]);
+ signal(SIGSEGV,SignalHandler);
+
+ HacerUna();
+ return 0;
+}
+#endif
diff --git a/setedit/extra/stackdbg.h b/setedit/extra/stackdbg.h
new file mode 100644
index 0000000..6bb3bd4
--- /dev/null
+++ b/setedit/extra/stackdbg.h
@@ -0,0 +1,26 @@
+#ifndef STACKDBG_H_INCLUDED
+#define STACKDBG_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Strategies */
+/* Dump the stack, no symbol translations */
+#define DBGST_DUMP_STACK 0
+/* No action */
+#define DBGST_DO_NOTHING 1
+/* Try to get as many information as possible */
+#define DBGST_INFORMATIVE 2
+/* Start the debuger to get information about the crash */
+#define DBGST_DEBUG 3
+
+extern char DebugStackInstall(char aStrategy, const char *processname);
+extern void DebugStack(const char *redirect);
+extern int DebugStackSeparateTerminalWillBeUsed();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // STACKDBG_H_INCLUDED
diff --git a/setedit/extra/strncpyz.cc b/setedit/extra/strncpyz.cc
new file mode 100644
index 0000000..96aa778
--- /dev/null
+++ b/setedit/extra/strncpyz.cc
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+char *strncpyZ(char *dest, const char *orig, int size)
+{
+ if (size)
+ size--;
+ for (;*orig && size; size--,dest++,orig++)
+ *dest=*orig;
+ *dest=0;
+ return dest;
+}
+
diff --git a/setedit/extra/strndup.cc b/setedit/extra/strndup.cc
new file mode 100644
index 0000000..127c940
--- /dev/null
+++ b/setedit/extra/strndup.cc
@@ -0,0 +1,19 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <string.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a copy of an string copying at most len characters. The allocated
+string have len+1 bytes and is ever ASCIIZ.
+
+***************************************************************************/
+
+char *strndup(char *source, int len)
+{
+ char *s=new char[len+1];
+ strncpy(s,source,len);
+ s[len]=0;
+ return s;
+}
diff --git a/setedit/fonts/.cvsignore b/setedit/fonts/.cvsignore
new file mode 100644
index 0000000..8bd2a78
--- /dev/null
+++ b/setedit/fonts/.cvsignore
@@ -0,0 +1 @@
+raw2sft
diff --git a/setedit/fonts/BTerminus.sft b/setedit/fonts/BTerminus.sft
new file mode 100644
index 0000000..747c3ef
--- /dev/null
+++ b/setedit/fonts/BTerminus.sft
Binary files differ
diff --git a/setedit/fonts/Makefile b/setedit/fonts/Makefile
new file mode 100644
index 0000000..a2598d4
--- /dev/null
+++ b/setedit/fonts/Makefile
@@ -0,0 +1,9 @@
+font_names=boxround cntdown ocr rombios thin
+
+%.exe: %.cc common1.h common2.h
+ gcc -o $@ $<
+
+fonts: $(addsuffix .exe,$(font_names))
+
+all: fonts
+
diff --git a/setedit/fonts/Terminus.sft b/setedit/fonts/Terminus.sft
new file mode 100644
index 0000000..f236cba
--- /dev/null
+++ b/setedit/fonts/Terminus.sft
Binary files differ
diff --git a/setedit/fonts/XFont.sft b/setedit/fonts/XFont.sft
new file mode 100644
index 0000000..9e0191b
--- /dev/null
+++ b/setedit/fonts/XFont.sft
Binary files differ
diff --git a/setedit/fonts/antique.016 b/setedit/fonts/antique.016
new file mode 100644
index 0000000..54f8484
--- /dev/null
+++ b/setedit/fonts/antique.016
Binary files differ
diff --git a/setedit/fonts/antique.sft b/setedit/fonts/antique.sft
new file mode 100644
index 0000000..9fc316d
--- /dev/null
+++ b/setedit/fonts/antique.sft
Binary files differ
diff --git a/setedit/fonts/boxroun0.000 b/setedit/fonts/boxroun0.000
new file mode 100644
index 0000000..f012083
--- /dev/null
+++ b/setedit/fonts/boxroun0.000
@@ -0,0 +1,1272 @@
+unsigned char BR16[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x66,0xFF,0xFF,0xFF,0xFF,0x7E,0x7E,0x3C,0x3C,0x18,0x18,0x00,0x00,0x00, // 
+0x00,0x18,0x18,0x3C,0x3C,0x7E,0x7E,0xFF,0x7E,0x7E,0x3C,0x3C,0x18,0x18,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x3C,0x18,0x66,0xFF,0xFF,0x66,0x18,0x3C,0x7E,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x18,0x3C,0x3C,0x7E,0xFF,0xFF,0xFF,0x7E,0x18,0x3C,0x7E,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // \n
+0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x3F,0x33,0x33,0x3F,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00,0x00, // \r
+0x00,0x7F,0x63,0x63,0x7F,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00,0x00, // 
+0x00,0x18,0x18,0xDB,0x3C,0xE7,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x80,0xC0,0xE0,0xF8,0xFE,0xFE,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x02,0x06,0x0E,0x3E,0xFE,0xFE,0x3E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,0x00, // 
+0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18, // 
+0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00, // 
+0x00,0x7F,0xDB,0xDB,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00, // 
+0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00, // 
+0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00, // 
+0x18,0x3C,0x7E,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x7E,0x3C,0x18, // 
+0x00,0x00,0x00,0x00,0x08,0x0C,0x0E,0xFF,0x0E,0x0C,0x08,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x10,0x30,0x70,0xFF,0x70,0x30,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x10,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x3C,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00, // !
+0x00,0x63,0x63,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x6C,0x6C,0x6C,0xFE,0xFE,0x6C,0x6C,0x6C,0xFE,0xFE,0x6C,0x6C,0x6C,0x00,0x00,0x00, // #
+0x18,0x18,0x7E,0xDB,0xDB,0xD8,0xD8,0x7E,0x1B,0x1B,0xDB,0xDB,0x7E,0x18,0x18,0x00, // $
+0x00,0xE6,0xA6,0xEC,0x0C,0x18,0x18,0x30,0x30,0x60,0x6E,0xCA,0xCE,0x00,0x00,0x00, // %
+0x00,0x38,0x6C,0x6C,0x6C,0x38,0x76,0xDC,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // &
+0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x0C,0x18,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x18,0x0C,0x00,0x00, // (
+0x30,0x18,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x18,0x30,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x3C,0xFF,0xFF,0x3C,0x66,0x66,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00, // .
+0x00,0x06,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x60,0xC0,0xC0,0x00,0x00,0x00, // /
+0x00,0x7C,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 0
+0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00, // 1
+0x00,0x3C,0x66,0xC3,0xC3,0x03,0x06,0x0C,0x18,0x30,0x60,0xC3,0xFF,0x00,0x00,0x00, // 2
+0x00,0xFE,0xC6,0x0C,0x18,0x3C,0x06,0x03,0x03,0x03,0xC3,0x66,0x3C,0x00,0x00,0x00, // 3
+0x00,0x1C,0x1C,0x3C,0x3C,0x6C,0x6C,0xCC,0xCD,0xFF,0x0D,0x0C,0x1E,0x00,0x00,0x00, // 4
+0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0xE6,0xC3,0x03,0x03,0xC3,0x66,0x3C,0x00,0x00,0x00, // 5
+0x00,0x3C,0x66,0xC6,0xC0,0xFC,0xE6,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 6
+0x00,0xFE,0xC6,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00, // 7
+0x00,0x3C,0x66,0xC3,0xC3,0x66,0x3C,0x66,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 8
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0x67,0x3F,0x03,0x63,0x66,0x3C,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00, // ;
+0x00,0x00,0x03,0x06,0x0C,0x18,0x30,0x70,0x30,0x18,0x0C,0x06,0x03,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x7E,0x7E,0x00,0x7E,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00, // >
+0x00,0x3C,0x66,0xC3,0xC3,0x03,0x06,0x0C,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00, // ?
+0x00,0x00,0x00,0x7E,0xC3,0xC3,0xDF,0xDB,0xDB,0xDE,0xC0,0xC0,0x7C,0x00,0x00,0x00, // @
+0x00,0x10,0x38,0x7C,0xEE,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // A
+0x00,0xFE,0x63,0x63,0x63,0x63,0x7E,0x63,0x63,0x63,0x63,0x63,0xFE,0x00,0x00,0x00, // B
+0x00,0x3C,0x66,0xC3,0xC3,0xC0,0xC0,0xC0,0xC0,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // C
+0x00,0xFC,0x66,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x66,0xFC,0x00,0x00,0x00, // D
+0x00,0xFF,0x63,0x61,0x60,0x64,0x7C,0x64,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // E
+0x00,0xFF,0x63,0x61,0x60,0x64,0x7C,0x64,0x60,0x60,0x60,0x60,0xF8,0x00,0x00,0x00, // F
+0x00,0x3C,0x66,0xC3,0xC3,0xC0,0xC0,0xCF,0xC3,0xC3,0xC3,0x67,0x3D,0x00,0x00,0x00, // G
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // H
+0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // I
+0x00,0x0F,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // J
+0x00,0xE3,0x63,0x66,0x66,0x6C,0x7C,0x6C,0x66,0x66,0x63,0x63,0xE3,0x00,0x00,0x00, // K
+0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // L
+0x00,0xC3,0xE7,0xFF,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00, // M
+0x00,0xC6,0xC6,0xE6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00,0x00, // N
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // O
+0x00,0xFE,0x63,0x63,0x63,0x63,0x63,0x7E,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // P
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xCB,0xCF,0x7E,0x3C,0x06,0x07,0x00, // Q
+0x00,0xFE,0x63,0x63,0x63,0x63,0x63,0x7E,0x6C,0x66,0x66,0x66,0xF7,0x00,0x00,0x00, // R
+0x00,0x7E,0xC3,0xC3,0xC0,0xC0,0x7E,0x03,0x03,0x03,0xC3,0xC3,0x7E,0x00,0x00,0x00, // S
+0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // T
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // U
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x38,0x10,0x00,0x00,0x00, // V
+0x00,0xC3,0xC3,0xC3,0xC3,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x66,0x66,0x00,0x00,0x00, // W
+0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00, // X
+0x00,0xC3,0xC3,0xC3,0xC3,0xE7,0x7E,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // Y
+0x00,0xFE,0xC6,0x8C,0x0C,0x18,0x18,0x30,0x30,0x60,0x62,0xC6,0xFE,0x00,0x00,0x00, // Z
+0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00, // [
+0x00,0xC0,0xC0,0x60,0x60,0x30,0x30,0x18,0x18,0x0C,0x0C,0x06,0x06,0x00,0x00,0x00, // \.
+0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00, // ]
+0x00,0x18,0x3C,0x66,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00, // _
+0x00,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00, // a
+0x00,0xE0,0x60,0x60,0x60,0x7E,0x63,0x63,0x63,0x63,0x63,0x63,0xDE,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // c
+0x00,0x0E,0x06,0x06,0x06,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // e
+0x00,0x3C,0x66,0x66,0x60,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x7B,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // g
+0x00,0xE0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00, // h
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // i
+0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // j
+0x00,0xE0,0x60,0x60,0x60,0x66,0x66,0x6C,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00, // k
+0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0xE6,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3,0xC3,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0xDE,0x63,0x63,0x63,0x63,0x63,0x63,0x7E,0x60,0x60,0xF0, // p
+0x00,0x00,0x00,0x00,0x00,0x7B,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x0F, // q
+0x00,0x00,0x00,0x00,0x00,0xDE,0x73,0x63,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x00,0x00,0x00, // s
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xEE,0x7C,0x38,0x10,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xDB,0xDB,0xDB,0xDB,0xFF,0x66,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0x7C,0x38,0x38,0x7C,0xEE,0xC6,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x0C,0x18,0x70, // y
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00, // z
+0x00,0x0E,0x18,0x18,0x18,0x18,0x70,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00, // {
+0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // |
+0x00,0x70,0x18,0x18,0x18,0x18,0x1E,0x1E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00, // }
+0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x3C,0x66,0xC3,0xC3,0xC0,0xC0,0xC0,0xC0,0xC3,0xC3,0x66,0x3C,0x06,0x06,0x7C, //
+0x00,0x00,0xCC,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x30,0x78,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0xCC,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x0C,0x06,0x3C, //
+0x00,0x30,0x78,0xCC,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0xCC,0xCC,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0xC6,0xC6,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, //
+0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, //
+0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xCC,0x76,0x36,0x7E,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00, //
+0x00,0x3E,0x6C,0xCC,0xCC,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x0C,0x18,0x70, //
+0xC6,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x18,0x7E,0xDB,0xD8,0xD8,0xD8,0xD8,0xDB,0x7E,0x18,0x18,0x18, //
+0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0x60,0xFA,0xCE,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x66,0x3C,0x18,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0xF0,0xCC,0xCC,0xCC,0xCC,0xF0,0xC4,0xCC,0xDE,0xCC,0xCC,0xC6,0x00,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0x70, //
+0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x76,0xDC,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00, //
+0x76,0xDC,0x00,0xC6,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00, //
+0x00,0x3C,0x6C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x18,0x00,0x18,0x18,0x30,0x60,0xC0,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00, //
+0xC0,0xC0,0xC2,0xC6,0xCC,0xD8,0x30,0x60,0xDC,0x86,0x0C,0x18,0x30,0x7E,0x00,0x00, //
+0xC0,0xC0,0xC2,0xC6,0xCC,0xD8,0x30,0x66,0xCE,0x96,0x26,0x7E,0x06,0x06,0x00,0x00, //
+0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11, //
+0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55, //
+0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x38,0x70,0xE0,0x70,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x76,0xE6,0x06,0xE6,0x76,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0xF8,0x0C,0xE6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0xE6,0x0C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x0C,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x3C,0x66,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x1C,0x0E,0x07,0x0E,0x1C,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x33,0x18,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x0F,0x18,0x33,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x77,0xE3,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFF,0x00,0xE3,0x77,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x37,0x33,0x30,0x33,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x77,0xE3,0x00,0xE3,0x77,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x06,0x0C,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFC,0xC6,0xC6,0xC6,0xC6,0xFC,0xC0,0xC0,0x40, //
+0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00, //
+0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0, //
+0x00,0x00,0x00,0x77,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, //
+0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xFF,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, //
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x66,0x24,0xA5,0xE7,0x00,0x00,0x00, //
+0x00,0x3C,0x60,0x30,0x18,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x02,0x06,0x7C,0xCE,0xCE,0xD6,0xD6,0xE6,0xE6,0x7C,0xC0,0x80,0x00, //
+0x00,0x1C,0x30,0x60,0x60,0x60,0x7C,0x60,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00, //
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x7E,0x18,0x18,0x00,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x0C,0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x0C,0x00,0x7C,0x00,0x00,0x00, //
+0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xF8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7E,0x7E,0x00,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00,0x00, //
+0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x70,0xC8,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 256
+0x06,0x0C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 257
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00, // 258
+0x00,0x0C,0x18,0x30,0x00,0xDE,0x73,0x63,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 259
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x00,0x00,0x00, // 260
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x0C,0x18,0x70, // 261
+0x00,0x0C,0x18,0x30,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00, // 262
+0x0C,0x18,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 263
+0x0C,0x18,0x30,0x00,0x3C,0x66,0xC3,0xC0,0xC0,0xC0,0xC3,0x66,0x3C,0x00,0x00,0x00, // 264
+0x0C,0x18,0x30,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 265
+0x18,0x30,0x60,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 266
+0x0C,0x18,0x30,0x00,0xC6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0x00,0x00,0x00, // 267
+0x0C,0x18,0x30,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 268
+0x0C,0x18,0x30,0x00,0xFE,0x63,0x63,0x63,0x7E,0x6C,0x66,0x66,0xF7,0x00,0x00,0x00, // 269
+0x0C,0x18,0x30,0x00,0x7E,0xC3,0xC0,0x7E,0x03,0x03,0xC3,0xC3,0x7E,0x00,0x00,0x00, // 270
+0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 271
+0x0C,0x18,0x30,0x00,0xC3,0xC3,0xE7,0x7E,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 272
+0x0C,0x18,0x30,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00, // 273
+0x33,0x66,0xCC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 274
+0x60,0x30,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 275
+0x60,0x30,0x18,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00,0x00, // 276
+0x60,0x30,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 277
+0x60,0x30,0x18,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 278
+0x60,0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 279
+0x00,0x66,0x66,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00,0x00, // 280
+0x00,0x66,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 281
+0x00,0x38,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00,0x00, // 282
+0x38,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 283
+0x00,0x00,0x76,0xDC,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00, // 284
+0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 285
+0x00,0x33,0x66,0xCC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00,0x00, // 286
+0x00,0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 287
+0x00,0x76,0xDC,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 288
+0x10,0x38,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 289
+0x18,0x3C,0x66,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00,0x00, // 290
+0x18,0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 291
+0x18,0x3C,0x66,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 292
+0x10,0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 293
+0x00,0x6C,0x38,0x10,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 294
+0x00,0x6C,0x38,0x10,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00, // 295
+0x00,0x6C,0x38,0x10,0x00,0xDE,0x73,0x63,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 296
+0x00,0x6C,0x38,0x10,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x00,0x00,0x00, // 297
+0x00,0x6C,0x38,0x10,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00, // 298
+0x66,0x3C,0x18,0x00,0x3C,0x66,0xC3,0xC0,0xC0,0xC0,0xC3,0x66,0x3C,0x00,0x00,0x00, // 299
+0x66,0x3C,0x18,0x00,0xFC,0x66,0x63,0x63,0x63,0x63,0x63,0x66,0xFC,0x00,0x00,0x00, // 300
+0x66,0x3C,0x18,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00,0x00, // 301
+0x66,0x3C,0x18,0x00,0xC6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0x00,0x00,0x00, // 302
+0x66,0x3C,0x18,0x00,0xFE,0x63,0x63,0x63,0x7E,0x6C,0x66,0x66,0xF7,0x00,0x00,0x00, // 303
+0x66,0x3C,0x18,0x00,0x7E,0xC3,0xC0,0x7E,0x03,0x03,0xC3,0xC3,0x7E,0x00,0x00,0x00, // 304
+0x66,0x3C,0x18,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 305
+0x66,0x3C,0x18,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x0C,0x06,0x3C, // 307
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x0C,0x06,0x3C, // 308
+0x00,0x7E,0xC3,0xC3,0xC0,0xC0,0x7E,0x03,0x03,0x03,0xC3,0xC3,0x7E,0x0C,0x06,0x3C, // 309
+0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x0C,0x06,0x3C, // 310
+0x00,0x00,0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x30,0x60,0x3C, // 311
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x30,0x60,0x3C, // 312
+0x00,0x10,0x38,0x7C,0xEE,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0x66,0x30,0x60,0x3C, // 313
+0x00,0xFF,0x63,0x61,0x60,0x64,0x7C,0x64,0x60,0x60,0x61,0x63,0xFF,0x30,0x60,0x3C, // 314
+0x00,0x00,0x30,0x30,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00, // 315
+0x00,0x30,0x30,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00, // 316
+0x00,0x38,0x18,0x18,0x1B,0x1E,0x1C,0x18,0x38,0x78,0xD8,0x18,0x3C,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x7C,0xCE,0xDE,0xD6,0xD6,0xF6,0xE6,0x7C,0x00,0x00,0x00, // 318
+0x00,0xF0,0x60,0x60,0x66,0x6C,0x78,0x70,0x60,0xE0,0x61,0x63,0xFF,0x00,0x00,0x00, // 319
+0x00,0x00,0x00,0x00,0x3D,0x66,0xC7,0xCB,0xDB,0xD3,0xE3,0x66,0xBC,0x00,0x00,0x00, // 320
+0x0E,0x06,0x1F,0x06,0x06,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00,0x00, // 321
+0xCC,0x78,0x30,0x78,0xD8,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00, // 322
+0x00,0xFC,0x66,0x63,0x63,0xFB,0x63,0x63,0x63,0x63,0x63,0x66,0xFC,0x00,0x00,0x00, // 323
+0x03,0x1F,0x0D,0x0D,0x0D,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 324
+0x03,0x3B,0x19,0x19,0x19,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 325
+0x03,0x03,0x11,0x31,0x31,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00, // 326
+0x03,0xF3,0x61,0x61,0x61,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 327
+0x00,0xC3,0x66,0x3C,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00, // 328
+0x00,0xC3,0x66,0x3C,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 329
+0xC3,0x66,0x3C,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 330
+0x00,0x00,0xC3,0x66,0x3C,0x66,0xC3,0xC3,0xC3,0x66,0x3C,0x66,0xC3,0x00,0x00,0x00, // 331
+0x00,0xF0,0x60,0x60,0x7C,0x66,0x63,0x63,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00,0x00, // 332
+0x00,0x00,0x00,0x70,0x30,0x3E,0x33,0x31,0x33,0x3E,0x30,0x30,0x78,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3,0x00,0x00,0x00,0x00, // 334
+0x00,0x3C,0x66,0xC3,0xB9,0xA5,0xA5,0xB9,0xA5,0xA5,0xC3,0x66,0x3C,0x00,0x00,0x00, // 335
+0x00,0x3C,0x66,0xC3,0x99,0xA5,0xA1,0xA1,0xA5,0x99,0xC3,0x66,0x3C,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 337
+0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 338
+0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0xF0,0x18,0x70,0x1B,0x1E,0xFC,0x18,0x36,0x6E,0xD6,0x26,0x7E,0x06,0x06,0x00,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x06,0x3C, // 344
+0x00,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x60,0xE0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0xF0,0x18,0x18,0x70,0x18,0x18,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x60,0x3C, // 349
+0x66,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0xC3,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x33,0x66,0xCC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 353
+0x33,0x66,0xCC,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 354
+0x66,0x3C,0x18,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 355
+0xCC,0x78,0x30,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 356
+0xCC,0x78,0x30,0x10,0x30,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00, // 357
+0x00,0x6C,0x38,0x10,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 358
+0x1B,0x0E,0x04,0x06,0x06,0x06,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00,0x00, // 359
+0x00,0x1E,0x36,0x66,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 360
+0x00,0xFE,0x62,0x62,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 361
+0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 362
+0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xFF,0xC3,0x81,0x00, // 363
+0x00,0xD6,0xD6,0x54,0x54,0x54,0x38,0x38,0x38,0x54,0xD6,0xD6,0xD6,0x00,0x00,0x00, // 364
+0x00,0xC6,0xC6,0xC6,0xCE,0xCE,0xD6,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 365
+0x6C,0x10,0xD6,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 366
+0x00,0xFF,0x36,0x36,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0xE6,0xE7,0x00,0x00,0x00, // 367
+0x00,0xFF,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00, // 368
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00, // 369
+0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00,0x00, // 370
+0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x06,0x00, // 371
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00, // 372
+0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x00,0x00,0x00, // 373
+0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x03,0x03,0x00, // 374
+0x00,0xF8,0xB0,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x7C,0x00,0x00,0x00, // 375
+0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xF3,0xDB,0xDB,0xDB,0xDB,0xDB,0xF3,0x00,0x00,0x00, // 376
+0x00,0xF0,0x60,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 377
+0x00,0x7C,0xC6,0x06,0x06,0x26,0x3E,0x26,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00, // 378
+0x00,0xCE,0xDB,0xDB,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xDB,0xDB,0xCE,0x00,0x00,0x00, // 379
+0x00,0x3F,0x66,0x66,0x66,0x66,0x3E,0x3E,0x66,0x66,0x66,0x66,0xE7,0x00,0x00,0x00, // 380
+0x00,0x02,0x06,0x3C,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x7E,0x32,0x32,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x36,0x66,0x66,0x66,0x66,0xFF,0xC3,0xC3,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x54,0x54,0xD6,0xD6,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x06,0x06,0x66,0x3C,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 387
+0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x66,0x66,0xE6,0xE7,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xD6,0xC6,0xC6,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFF,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C, // 395
+0x00,0x00,0x00,0x00,0x3C,0x18,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x18,0x3C, // 396
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x06,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x03,0x03,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF8,0xB0,0x30,0x3E,0x33,0x33,0x33,0x7E,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDE,0xDE,0xDE,0xF6,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x1E,0x06,0x06,0x66,0x3C,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xCE,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xCE,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0xFC,0x6C,0x6C,0xCC,0xCE,0x00,0x00,0x00, // 406
+0x00,0x3E,0x63,0x60,0x60,0x64,0x7C,0x64,0x60,0x60,0x60,0x63,0x3E,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x78,0x60,0x60,0x66,0x3C,0x00,0x00,0x00, // 408
+0x00,0x7C,0xC6,0x06,0x06,0x06,0x3C,0x06,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00, // 409
+0x00,0x00,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C, // 410
+0x00,0xCF,0xCD,0xEF,0xEC,0xEC,0xFF,0xDC,0xDC,0xDC,0xCC,0xCC,0xCC,0x00,0x00,0x00, // 411
+0x00,0xFC,0x30,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x36,0x06,0x1C,0x00, // 412
+0x00,0x00,0x00,0x00,0x00,0x30,0xFC,0x30,0x30,0x3C,0x36,0x36,0x36,0x06,0x1C,0x00, // 413
+0x18,0x30,0xFE,0x62,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 414
+0x00,0x00,0x18,0x30,0x00,0x7E,0x32,0x32,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, // 415
+0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 416
+0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00,0x00, // 418
+0x00,0xD8,0xD8,0xD8,0xD8,0xD8,0xFC,0xDE,0xDA,0xDA,0xDA,0xDA,0xDE,0x00,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00,0x00, // 420
+0x00,0xFE,0x30,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x00,0x00,0x00, // 422
+0x0C,0x0C,0x18,0xC6,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 423
+0x00,0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0x00,0x00,0x00, // 424
+0x6C,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00, // 425
+0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C,0x00, // 426
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10,0x00, // 427
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10,0x00, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00,0x00, // 430
+0x00,0x00,0x00,0x18,0x18,0x7E,0x7E,0x18,0x18,0x3C,0x3C,0x18,0x18,0x00,0x00,0x00, // 431
+0x00,0x00,0x00,0x18,0x18,0x7E,0x7E,0x18,0x3C,0x18,0x7E,0x7E,0x18,0x00,0x00,0x00, // 432
+0x00,0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00,0x00, // 433
+0x00,0x00,0xCC,0xEE,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x00,0x33,0x77,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 437
+0x00,0x00,0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 438
+0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 439
+0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 443
+0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00, // 461
+0x00,0xDC,0xFE,0xE6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xDC,0x00,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0x00,0xDC,0xFE,0xE6,0xC6,0xC6,0xC6,0xC6,0xC6,0x06,0x1C,0x00, // 463
+0x18,0x3C,0x66,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00, // 464
+0x00,0x18,0x3C,0x66,0xC3,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 465
+0x18,0x3C,0x66,0x00,0x7C,0xC6,0xC6,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 466
+0x00,0x18,0x3C,0x66,0xC3,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x00, // 467
+0x38,0x7C,0xC6,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 468
+0x30,0x78,0xCC,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00, // 469
+0x18,0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00, // 470
+0x00,0x18,0x3C,0x66,0xC3,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00, // 471
+0x18,0x3C,0x66,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 472
+0x00,0x18,0x3C,0x66,0xC3,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // 473
+0x38,0x7C,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 474
+0x00,0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 475
+0x18,0x3C,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 476
+0x00,0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0,0x00, // 477
+0x30,0x30,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 478
+0x60,0x60,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 479
+0x18,0x18,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00, // 480
+0x00,0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 481
+0x30,0x30,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00, // 482
+0x0C,0x0C,0x00,0x0C,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0x7E,0x00,0x00,0x00, // 483
+0x30,0x30,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 484
+0x18,0x18,0x00,0x1C,0x36,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, // 485
+0x00,0x00,0x10,0x38,0x10,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x00, // 486
+0x18,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 487
+0x10,0x38,0x10,0xC6,0xC6,0xEE,0xEE,0xFE,0xD6,0xD6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 488
+0x00,0x00,0x10,0x38,0x10,0x00,0xEC,0xFE,0xD6,0xD6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 489
+0x30,0x30,0x00,0xFC,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 490
+0x00,0x00,0x10,0x38,0x10,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00, // 491
+0x30,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0x70,0x1C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 492
+0x00,0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // 493
+0x18,0x18,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 494
+0x30,0x30,0x00,0x30,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00, // 495
+0x00,0xFE,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0x66,0xFE,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 497
+0x00,0x7E,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x00,0x7E,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 499
+0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 501
+0x00,0xFE,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x00,0xFC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 503
+0x66,0x3C,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 504
+0x00,0x00,0xC3,0x66,0x3C,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x00, // 505
+0x66,0x3C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 506
+0x00,0x00,0x00,0xC6,0x7C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 507
+0x00,0xC6,0x7C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 508
+0x00,0x00,0x00,0xC6,0x7C,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 509
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x0C,0x06,0x3C, // 510
+0x00,0x00,0x00,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x0C,0x06,0x3C, // 511
+0x00,0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xF0,0xD8,0xCC,0xC6,0xC6,0x0C,0x06,0x3C, // 512
+0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x0C,0x06,0x3C, // 513
+0x00,0x00,0x00,0xC6,0xC6,0xE6,0xE6,0xF6,0xDE,0xCE,0xCE,0xC6,0xC6,0x0C,0x06,0x3C, // 514
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x0C,0x06,0x3C, // 515
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x78,0x6C,0x66,0x66,0xE6,0x0C,0x06,0x3C, // 516
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x60,0x60,0x60,0x60,0xF0,0x0C,0x06,0x3C, // 517
+0x00,0x76,0xDC,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 518
+0x00,0x00,0x00,0x76,0xDC,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 519
+0x00,0x76,0xDC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 520
+0x00,0x00,0x00,0x76,0xDC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 521
+0x00,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x30,0x60,0x3C, // 522
+0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x30,0x60,0x3C, // 523
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x30,0x60,0x3C, // 524
+0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x30,0x60,0x3C, // 525
+0x60,0x30,0x18,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 526
+0x00,0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 527
+0x60,0x30,0x18,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 528
+0x00,0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0,0x00, // 529
+0x06,0x0C,0x18,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 530
+0x00,0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 531
+0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 532
+0x00,0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 533
+0x00,0x00,0x00,0x66,0x67,0x67,0x6E,0x7E,0x76,0xE6,0xE6,0x66,0x66,0x00,0x00,0x00, // 534
+0x00,0x06,0x06,0xEC,0x6C,0x78,0x7C,0x76,0x76,0x66,0x66,0xE6,0xE6,0x00,0x00,0x00, // 535
+0x00,0x00,0x00,0xFF,0xDB,0x99,0x1E,0x1C,0x38,0x78,0x58,0x18,0x3C,0x00,0x00,0x00, // 536
+0x00,0x00,0x00,0x30,0x36,0x3E,0xFC,0x38,0x30,0x70,0xF0,0xB6,0x1C,0x00,0x00,0x00, // 537
+0x30,0x18,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 538
+0x00,0x00,0x30,0x18,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 539
+0x30,0x18,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 540
+0x00,0x00,0x60,0x30,0x30,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 541
+0x18,0x18,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 542
+0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 543
+0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x0C,0x06,0x7C, // 544
+0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x18,0x0C,0xF8, // 545
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0x7C,0x00, // 546
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0xC0,0xC0,0xC0,0xC0,0x7C,0x06,0x06,0x3C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x02,0x00, // 548
+0x00,0x78,0xCC,0x0C,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00, // 550
+0x00,0x7C,0xC6,0x06,0x06,0x06,0x3E,0x66,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00, // 552
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0x60,0x3C,0x60,0xC0,0x7C,0x06,0x06,0x3C,0x00, // 553
+0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0x7C,0x06,0x7C,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x82,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x82,0x00,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10,0x10, // 558
+0x00,0x00,0x00,0x00,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0xD6,0xD6,0x6C,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0x82,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 562
+0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10,0x10,0x7C,0x00,0x00,0x00, // 563
+0x0C,0x18,0x00,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x0C,0x18,0x30,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00, // 565
+0x0C,0x18,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00, // 566
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x06,0x02, // 567
+0x00,0x06,0x0C,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00, // 568
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 569
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 570
+0x00,0x0C,0x18,0x30,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0xD6,0xD6,0x6C,0x00,0x00,0x00, // 571
+0x30,0x68,0xDC,0x3E,0x77,0x63,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x00,0x00,0x00, // 572
+0x30,0x6F,0xC3,0x21,0x60,0x64,0x7C,0x64,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 573
+0x30,0x63,0xC3,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x63,0x63,0x63,0x00,0x00,0x00, // 574
+0x30,0x6E,0xCC,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00, // 575
+0x30,0x6C,0xC6,0x83,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 576
+0x0C,0xDB,0xF3,0xC3,0xC3,0xE7,0x7E,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 577
+0x30,0x6C,0xC6,0x03,0xC3,0xC3,0xC3,0xC3,0x66,0x66,0x24,0xA5,0xE7,0x00,0x00,0x00, // 578
+0x00,0x00,0x00,0x66,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 580
+0x06,0x0C,0x08,0x66,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00, // 581
+0x04,0x0C,0x18,0xD6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 582
+0x00,0x10,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x7E,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00, // 584
+0x00,0x00,0xFE,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 585
+0x10,0x38,0x10,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 586
+0x00,0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00,0x00, // 587
+0x00,0xFE,0x63,0x63,0x63,0x63,0x7E,0x63,0x63,0x63,0x63,0x63,0xFE,0x00,0x00,0x00, // 588
+0x00,0xFF,0x63,0x61,0x60,0x64,0x7C,0x64,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 589
+0x00,0xE3,0x63,0x66,0x66,0x6C,0x7C,0x6C,0x66,0x66,0x63,0x63,0xE3,0x00,0x00,0x00, // 590
+0x00,0xC3,0xE7,0xFF,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00, // 591
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 592
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 593
+0x00,0xFE,0x63,0x63,0x63,0x63,0x63,0x7E,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 594
+0x00,0x3C,0x66,0xC3,0xC3,0xC0,0xC0,0xC0,0xC0,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 595
+0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 596
+0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0xDE,0x63,0x63,0x63,0x63,0x63,0x63,0x7E,0x60,0x60,0xF0, // 601
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0x7C,0x38,0x38,0x7C,0xEE,0xC6,0x00,0x00,0x00, // 603
+0x00,0x00,0xCC,0xCC,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 604
+0x00,0x66,0x66,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x00,0x00,0x00, // 606
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 607
+0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 608
+0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // 609
+0x00,0x66,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 610
+0x00,0x0F,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 611
+0x00,0x7E,0xC3,0xC3,0xC0,0xC0,0x7E,0x03,0x03,0x03,0xC3,0xC3,0x7E,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFC,0xC6,0xC6,0xC6,0xC6,0xFC,0xC0,0xC0,0x40, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0, // 615
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 616
+0x00,0x10,0x38,0x7C,0xEE,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 617
+0x00,0xFE,0x63,0x63,0x63,0x63,0x7E,0x63,0x63,0x63,0x63,0x63,0xFE,0x00,0x00,0x00, // 618
+0x00,0xFF,0x63,0x61,0x60,0x64,0x7C,0x64,0x60,0x60,0x61,0x63,0xFF,0x00,0x00,0x00, // 619
+0x00,0xFE,0xC6,0x8C,0x0C,0x18,0x18,0x30,0x30,0x60,0x62,0xC6,0xFE,0x00,0x00,0x00, // 620
+0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 621
+0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 622
+0x00,0xE3,0x63,0x66,0x66,0x6C,0x7C,0x6C,0x66,0x66,0x63,0x63,0xE3,0x00,0x00,0x00, // 623
+0x00,0xC3,0xE7,0xFF,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00,0x00, // 624
+0x00,0xC6,0xC6,0xE6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00,0x00, // 625
+0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00, // 626
+0x00,0xFE,0x63,0x63,0x63,0x63,0x63,0x7E,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 627
+0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 628
+0x00,0xC3,0xC3,0xC3,0xC3,0xE7,0x7E,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 629
+0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00, // 630
+0x00,0x66,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 631
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 632
+};
+
+unsigned char BR14[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7C,0x82,0xAA,0x82,0x82,0xBA,0x92,0x82,0x82,0x7C,0x00,0x00, // 
+0x00,0x00,0x7C,0xFE,0xD6,0xFE,0xFE,0xC6,0xEE,0xFE,0xFE,0x7C,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x38,0x38,0x38,0xEE,0xEE,0xEE,0x38,0x38,0x7C,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0xFE,0x38,0x38,0x38,0x7C,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF, // \n
+0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00, //
+0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00, //
+0x00,0x30,0x38,0x3C,0x36,0x32,0x30,0x30,0x70,0xF0,0xF0,0xE0,0x00,0x00, // \r
+0x70,0x78,0x6C,0x66,0x76,0x7E,0x6E,0x66,0x66,0xE6,0xE6,0xCE,0x0E,0x0C, // 
+0x00,0x00,0x00,0x38,0x38,0xFE,0x7C,0xEE,0x6C,0xFE,0x38,0x38,0x00,0x00, // 
+0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00, // 
+0x00,0x02,0x06,0x0E,0x1E,0x3E,0x7E,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00, // 
+0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00, // 
+0x00,0x00,0x7E,0xF6,0xB6,0xF6,0x76,0x36,0x36,0x36,0x36,0x36,0x00,0x00, // 
+0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 
+0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00, // !
+0x00,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00, // #
+0x18,0x18,0x18,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x18,0x18,0x00, // $
+0x00,0x00,0x00,0x71,0xDB,0x76,0x0C,0x18,0x30,0x6E,0xDB,0x8E,0x00,0x00, // %
+0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // &
+0x30,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00, // (
+0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x00,0x6C,0x38,0xFE,0x38,0x6C,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00, // .
+0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00, // /
+0x00,0x00,0x7C,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0x7C,0x00,0x00, // 0
+0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00, // 1
+0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC0,0xFE,0x00,0x00, // 2
+0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00, // 3
+0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x0C,0x00,0x00, // 4
+0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00, // 5
+0x00,0x00,0x3C,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 6
+0x00,0x00,0xFE,0x06,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00, // 7
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 8
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00, // ;
+0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00, // >
+0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00, // ?
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00, // @
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // A
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xC6,0xC6,0xC6,0xC6,0xFC,0x00,0x00, // B
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // C
+0x00,0x00,0xF8,0xCC,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xCC,0xF8,0x00,0x00, // D
+0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xF8,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00, // E
+0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xF8,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // F
+0x00,0x00,0x3C,0x66,0xC0,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3C,0x00,0x00, // G
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // H
+0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // I
+0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00, // J
+0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xD8,0xCC,0xC6,0xC6,0xC6,0x00,0x00, // K
+0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00, // L
+0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // M
+0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // N
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // O
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // P
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xDE,0x7C,0x06,0x00, // Q
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xD8,0xCC,0xC6,0xC6,0xC6,0x00,0x00, // R
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00, // S
+0x00,0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // T
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // U
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00, // V
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xFE,0xFE,0xEE,0xC6,0x00,0x00, // W
+0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // X
+0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // Y
+0x00,0x00,0xFE,0x06,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC0,0xFE,0x00,0x00, // Z
+0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00, // [
+0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00, // \.
+0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00, // ]
+0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, // _
+0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // a
+0x00,0x00,0xC0,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0xE6,0xDC,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // c
+0x00,0x00,0x06,0x06,0x06,0x7E,0xC6,0xC6,0xC6,0xC6,0xCE,0x76,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // e
+0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0x60,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x7E,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xC6,0x7C, // g
+0x00,0x00,0xC0,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // h
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // i
+0x00,0x06,0x06,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // j
+0x00,0x00,0xC0,0xC0,0xC0,0xC6,0xCC,0xD8,0xF0,0xD8,0xCC,0xC6,0x00,0x00, // k
+0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x6C,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0xDC,0xE6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xC6,0xE6,0xDC,0xC0,0xC0, // p
+0x00,0x00,0x00,0x00,0x00,0x7E,0xC6,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0x06, // q
+0x00,0x00,0x00,0x00,0x00,0xDC,0xE6,0xC6,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00, // s
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xD6,0xFE,0xEE,0xC6,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // y
+0x00,0x00,0x00,0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0xC0,0xFE,0x00,0x00, // z
+0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00, // {
+0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // |
+0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00, // }
+0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC2,0x66,0x3E,0x0C,0x06,0x7C,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x0C,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, //
+0x10,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0xCC,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0xC6,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, //
+0x00,0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0xFE,0xC0,0xC0,0xFC,0xC0,0xC0,0xFE,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x36,0x7C,0xD8,0xDC,0x76,0x00,0x00, //
+0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0x06,0xFC, //
+0x00,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x18,0x18,0x00,0x00, //
+0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00, //
+0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00, //
+0x00,0xFC,0xC6,0xC6,0xFC,0xC0,0xCC,0xDE,0xCC,0xCC,0xCC,0xCC,0x00,0x00, //
+0x1C,0x36,0x30,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0xB0,0xE0,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00, //
+0x00,0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0x00,0x00, //
+0x3C,0x6C,0x6C,0x36,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00, //
+0x00,0xC0,0xC0,0xC6,0xCC,0xD8,0x30,0x60,0xDC,0x86,0x0C,0x18,0x3E,0x00, //
+0x00,0xC0,0xC0,0xC6,0xCC,0xD8,0x30,0x66,0xCE,0x9E,0x3E,0x06,0x06,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00, //
+0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11, //
+0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55, //
+0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x38,0x70,0xE0,0x70,0x38,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x76,0xE6,0x06,0xE6,0x76,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0xF8,0x0C,0xE6,0x76,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0xE6,0x0C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x0C,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x3C,0x66,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x1C,0x0E,0x07,0x0E,0x1C,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x33,0x18,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x0F,0x18,0x33,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x77,0xE3,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFF,0x00,0xE3,0x77,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x37,0x33,0x30,0x33,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x77,0xE3,0x00,0xE3,0x77,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x06,0x0C,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xDC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFC,0xC6,0xC6,0xFC,0xC0,0xC0,0x40, //
+0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00, //
+0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00, //
+0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x6C,0x38,0x00,0x00, //
+0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0xEE,0x00,0x00, //
+0x00,0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x30,0x1C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0xFF,0x00,0x00, //
+0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7E,0x00,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00, //
+0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x70,0xD8,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 256
+0x0C,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 257
+0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 258
+0x0C,0x18,0x30,0x00,0xDE,0x73,0x63,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 259
+0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x00,0x00, // 260
+0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8, // 261
+0x0C,0x18,0x30,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, // 262
+0x18,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 263
+0x18,0x30,0x00,0x3C,0x66,0xC3,0xC0,0xC0,0xC0,0xC3,0x66,0x3C,0x00,0x00, // 264
+0x18,0x30,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 265
+0x30,0x60,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00, // 266
+0x18,0x30,0x00,0xC6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0x00,0x00, // 267
+0x18,0x30,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00, // 268
+0x18,0x30,0x00,0xFE,0x63,0x63,0x63,0x7E,0x6C,0x66,0x66,0xF7,0x00,0x00, // 269
+0x18,0x30,0x00,0x7E,0xC3,0xC0,0x7E,0x03,0x03,0xC3,0xC3,0x7E,0x00,0x00, // 270
+0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 271
+0x18,0x30,0x00,0xC3,0xC3,0xE7,0x7E,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 272
+0x18,0x30,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00, // 273
+0x66,0xCC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 274
+0x30,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 275
+0x30,0x18,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00, // 276
+0x30,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 277
+0x30,0x18,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00, // 278
+0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 279
+0x66,0x66,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00, // 280
+0x66,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 281
+0x38,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00, // 282
+0x6C,0x38,0x10,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 283
+0x00,0x76,0xDC,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00, // 284
+0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 285
+0x33,0x66,0xCC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00, // 286
+0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 287
+0x76,0xDC,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00, // 288
+0x38,0x6C,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 289
+0x3C,0x66,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00, // 290
+0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 291
+0x3C,0x66,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00, // 292
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 293
+0x6C,0x38,0x10,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 294
+0x6C,0x38,0x10,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 295
+0x6C,0x38,0x10,0x00,0xDE,0x73,0x63,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 296
+0x6C,0x38,0x10,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x00,0x00, // 297
+0x6C,0x38,0x10,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, // 298
+0x66,0x3C,0x18,0x3C,0x66,0xC3,0xC0,0xC0,0xC0,0xC3,0x66,0x3C,0x00,0x00, // 299
+0x66,0x3C,0x18,0xFC,0x66,0x63,0x63,0x63,0x63,0x63,0x66,0xFC,0x00,0x00, // 300
+0x66,0x3C,0x18,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00, // 301
+0x66,0x3C,0x18,0xC6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0x00,0x00, // 302
+0x66,0x3C,0x18,0xFE,0x63,0x63,0x63,0x7E,0x6C,0x66,0x66,0xF7,0x00,0x00, // 303
+0x66,0x3C,0x18,0x7E,0xC3,0xC0,0x7E,0x03,0x03,0xC3,0xC3,0x7E,0x00,0x00, // 304
+0x66,0x3C,0x18,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 305
+0x66,0x3C,0x18,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00, // 306
+0x00,0x00,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0xC6,0x7C,0x0C,0x06,0x7C, // 307
+0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x0C,0x06,0x7C, // 308
+0x7E,0xC3,0xC3,0xC0,0xC0,0x7E,0x03,0x03,0xC3,0xC3,0x7E,0x0C,0x06,0x7C, // 309
+0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x0C,0x06,0x7C, // 310
+0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x30,0x60,0x3E, // 311
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x30,0x60,0x3E, // 312
+0x10,0x38,0x7C,0xEE,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0x66,0x30,0x60,0x3E, // 313
+0xFF,0x63,0x61,0x60,0x64,0x7C,0x64,0x60,0x61,0x63,0xFF,0x30,0x60,0x3E, // 314
+0x00,0x30,0x30,0x00,0xFE,0xC6,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, // 315
+0x30,0x30,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00, // 316
+0x38,0x18,0x18,0x1B,0x1E,0x1C,0x18,0x38,0x78,0xD8,0x18,0x3C,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x7C,0xCE,0xDE,0xD6,0xD6,0xF6,0xE6,0x7C,0x00,0x00, // 318
+0xF0,0x60,0x60,0x66,0x6C,0x78,0x70,0x60,0xE0,0x61,0x63,0xFF,0x00,0x00, // 319
+0x00,0x00,0x00,0x3D,0x66,0xC7,0xCB,0xDB,0xD3,0xE3,0x66,0xBC,0x00,0x00, // 320
+0x06,0x1F,0x06,0x06,0x7E,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00, // 321
+0x78,0x30,0x78,0xD8,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00, // 322
+0xFC,0x66,0x63,0x63,0xFB,0x63,0x63,0x63,0x63,0x63,0x66,0xFC,0x00,0x00, // 323
+0x1F,0x0F,0x0D,0x0D,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 324
+0x3B,0x1B,0x19,0x19,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 325
+0x03,0x11,0x31,0x31,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 326
+0xF3,0x63,0x61,0x61,0x61,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00, // 327
+0xC3,0x66,0x3C,0x00,0x3C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3B,0x00,0x00, // 328
+0xC3,0x66,0x3C,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 329
+0x66,0x3C,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 330
+0x00,0xC3,0x66,0x3C,0x66,0xC3,0xC3,0xC3,0x66,0x3C,0x66,0xC3,0x00,0x00, // 331
+0xF0,0x60,0x60,0x7C,0x66,0x63,0x63,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00, // 332
+0x00,0x00,0x70,0x30,0x3E,0x33,0x31,0x33,0x3E,0x30,0x30,0x78,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3,0x00,0x00,0x00, // 334
+0x3C,0x66,0xC3,0xB9,0xA5,0xA5,0xB9,0xA5,0xA5,0xC3,0x66,0x3C,0x00,0x00, // 335
+0x3C,0x66,0xC3,0x99,0xA5,0xA1,0xA1,0xA5,0x99,0xC3,0x66,0x3C,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 337
+0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 338
+0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0xF8,0x18,0x7B,0x1E,0xFC,0x18,0x36,0x6E,0xD6,0x26,0x7E,0x06,0x06,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x06,0x7C, // 344
+0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0xE0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0xF8,0x18,0x70,0x18,0x18,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x60,0x3E, // 349
+0x66,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x33,0x66,0xCC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 353
+0x33,0x66,0x00,0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x00,0x00, // 354
+0x6C,0x38,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 355
+0xD8,0x70,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x61,0x63,0xFF,0x00,0x00, // 356
+0x6C,0x38,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 357
+0x6C,0x38,0x10,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 358
+0x1B,0x0E,0x04,0x06,0x06,0x06,0x7E,0xC6,0xC6,0xC6,0xC6,0x7B,0x00,0x00, // 359
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 360
+0x00,0x00,0xFE,0x62,0x62,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 361
+0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 362
+0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xFF,0xC3,0x81, // 363
+0x00,0x00,0xD6,0xD6,0x54,0x54,0x7C,0x7C,0x54,0xD6,0xD6,0xD6,0x00,0x00, // 364
+0x00,0x00,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00, // 365
+0x38,0x38,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00, // 366
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 367
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 368
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 369
+0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00, // 370
+0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x00, // 371
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x00,0x00, // 372
+0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x00,0x00, // 373
+0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x03,0x00, // 374
+0x00,0x00,0xF8,0xB0,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x7C,0x00,0x00, // 375
+0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xF3,0xDB,0xDB,0xDB,0xDB,0xF3,0x00,0x00, // 376
+0x00,0x00,0xF0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 377
+0x00,0x00,0x7C,0xC6,0x06,0x26,0x3E,0x26,0x06,0x06,0xC6,0x7C,0x00,0x00, // 378
+0x00,0x00,0xCE,0xDB,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xDB,0xCE,0x00,0x00, // 379
+0x00,0x00,0x3F,0x66,0x66,0x66,0x3E,0x3E,0x66,0x66,0x66,0xE7,0x00,0x00, // 380
+0x00,0x02,0x06,0x3C,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x7E,0x32,0x32,0x30,0x30,0x30,0x78,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x36,0x66,0x66,0x66,0xFF,0xC3,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x54,0xD6,0xD6,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x06,0x66,0x3C,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00, // 387
+0x00,0x00,0x00,0x38,0x38,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xD6,0xC6,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C,0x00, // 395
+0x00,0x00,0x00,0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x03,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF8,0xB0,0x30,0x3E,0x33,0x33,0x7E,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x1E,0x06,0x66,0x3C,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xCE,0xDB,0xDB,0xFB,0xDB,0xDB,0xCE,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0xFC,0x6C,0xCC,0xCE,0x00,0x00, // 406
+0x00,0x00,0x3E,0x63,0x60,0x64,0x7C,0x64,0x60,0x60,0x63,0x3E,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x78,0x60,0x66,0x3C,0x00,0x00, // 408
+0x00,0x00,0x7C,0xC6,0x06,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00, // 409
+0x00,0x00,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C,0x00, // 410
+0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xDC,0xCC,0xCC,0x00,0x00, // 411
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x06,0x0C, // 412
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x0C, // 413
+0x18,0x30,0xFE,0x62,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 414
+0x00,0x00,0x0C,0x18,0x00,0x7E,0x32,0x32,0x30,0x30,0x30,0x78,0x00,0x00, // 415
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 416
+0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00, // 418
+0x00,0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDA,0xDA,0xDA,0xDE,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00, // 420
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x00,0x00, // 422
+0x00,0x0C,0x18,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xCC,0xC6,0xC6,0x00,0x00, // 423
+0x00,0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xF8,0xCC,0xC6,0xC6,0x00,0x00, // 424
+0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 425
+0x00,0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // 426
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10, // 427
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00, // 430
+0x00,0x00,0x18,0x18,0x7E,0x7E,0x18,0x18,0x3C,0x3C,0x18,0x18,0x00,0x00, // 431
+0x00,0x00,0x18,0x18,0x7E,0x7E,0x18,0x3C,0x18,0x7E,0x7E,0x18,0x18,0x00, // 432
+0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00, // 433
+0x00,0xCC,0xEE,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x33,0x77,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 437
+0x00,0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 438
+0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00, // 439
+0x00,0x6E,0xD8,0xD8,0xD8,0xD8,0xDE,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 443
+0x00,0x78,0x80,0x80,0x80,0x78,0x00,0x3C,0x22,0x3E,0x24,0x22,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x38,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x06,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00, // 461
+0x00,0x00,0xDC,0xFE,0xF6,0xE6,0xC6,0xC6,0xC6,0xC6,0xC6,0xDC,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0xDC,0xFE,0xF6,0xE6,0xC6,0xC6,0x06,0x1C,0x00,0x00, // 463
+0x38,0x6C,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 464
+0x10,0x38,0x6C,0xC6,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 465
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC0,0xCE,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 466
+0x10,0x38,0x6C,0xC6,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // 467
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xFE,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 468
+0x38,0x6C,0x00,0xE0,0x60,0x7C,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00, // 469
+0x38,0x6C,0x00,0x7C,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00, // 470
+0x10,0x38,0x6C,0xC6,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78, // 471
+0x38,0x6C,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0x06,0xC6,0x7C,0x00,0x00, // 472
+0x10,0x38,0x6C,0xC6,0x00,0x7C,0xC6,0xC0,0x7C,0x06,0xC6,0x7C,0x00,0x00, // 473
+0x38,0x6C,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 474
+0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 475
+0x3C,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 476
+0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0, // 477
+0x30,0x30,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00, // 478
+0x30,0x30,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 479
+0x18,0x18,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 480
+0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 481
+0x30,0x30,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00, // 482
+0x0C,0x0C,0x00,0x0C,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x7E,0x00,0x00, // 483
+0x30,0x30,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // 484
+0x30,0x30,0x00,0x3C,0x36,0x30,0xFC,0x30,0x30,0x30,0x30,0x78,0x00,0x00, // 485
+0x00,0x10,0x38,0x10,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // 486
+0x18,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 487
+0x10,0x38,0x10,0xC6,0xC6,0xEE,0xEE,0xFE,0xD6,0xC6,0xC6,0xC6,0x00,0x00, // 488
+0x00,0x10,0x38,0x10,0x00,0xEC,0xFE,0xD6,0xD6,0xC6,0xC6,0xC6,0x00,0x00, // 489
+0x30,0x30,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // 490
+0x00,0x10,0x38,0x10,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0, // 491
+0x18,0x18,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0x06,0xC6,0x7C,0x00,0x00, // 492
+0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0xC0,0x7C,0x06,0xC6,0x7C,0x00,0x00, // 493
+0x18,0x18,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 494
+0x30,0x30,0x00,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 495
+0xFE,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0x66,0xFE,0x00,0x00, // 496
+0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 497
+0x7E,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 498
+0x00,0x00,0x00,0x7E,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 499
+0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 500
+0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 501
+0xFE,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 502
+0x00,0x00,0x00,0xFC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 503
+0x66,0x3C,0x00,0x7C,0xC6,0xC6,0xC0,0xCE,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 504
+0x00,0x00,0x66,0x3C,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // 505
+0x66,0x3C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 506
+0x00,0x00,0x66,0x3C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 507
+0x66,0x3C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 508
+0x00,0x00,0xCC,0x78,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 509
+0x00,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xC6,0xC6,0xC6,0x7C,0x06,0x7C, // 510
+0x00,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x7E,0x06,0xFC,0x18,0x0C,0x78, // 511
+0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xF0,0xD8,0xCC,0xC6,0xC6,0x03,0x3E, // 512
+0x00,0x00,0xE0,0x60,0x60,0x66,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x03,0x3E, // 513
+0x00,0x00,0xC6,0xC6,0xE6,0xE6,0xF6,0xDE,0xCE,0xCE,0xC6,0xC6,0x03,0x3E, // 514
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x03,0x3E, // 515
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x78,0x6C,0x66,0x66,0xE6,0x03,0x3E, // 516
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x60,0x60,0x60,0x60,0xFC,0x06,0x7C, // 517
+0x76,0xDC,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 518
+0x00,0x00,0x76,0xDC,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 519
+0x76,0xDC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 520
+0x00,0x00,0x76,0xDC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 521
+0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x60,0x3E, // 522
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x60,0x3E, // 523
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x60,0x3E, // 524
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x60,0x3E, // 525
+0x30,0x18,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 526
+0x00,0x00,0x30,0x18,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 527
+0x30,0x18,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 528
+0x00,0x00,0x30,0x18,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0, // 529
+0x0C,0x18,0x30,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 530
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 531
+0xC6,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 532
+0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 533
+0x00,0x00,0x66,0x67,0x67,0x6E,0x7E,0x7E,0x76,0xE6,0xE6,0x66,0x00,0x00, // 534
+0x00,0x00,0xE0,0x61,0x63,0x7E,0x6E,0x7E,0x76,0x66,0xE6,0xE6,0x00,0x00, // 535
+0x00,0x00,0xFF,0xDB,0x99,0x1E,0x1C,0x18,0x38,0x78,0x18,0x3C,0x00,0x00, // 536
+0x00,0x00,0x30,0x30,0x32,0xFE,0x3C,0x38,0x30,0x70,0xF6,0x1C,0x00,0x00, // 537
+0x30,0x18,0x18,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 538
+0x00,0x30,0x18,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 539
+0x30,0x18,0x18,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 540
+0x00,0x60,0x30,0x30,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 541
+0x38,0x38,0x00,0xFE,0xC6,0xC2,0xC0,0xF8,0xC0,0xC2,0xC6,0xFE,0x00,0x00, // 542
+0x00,0x00,0x38,0x38,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 543
+0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFC,0x0C,0x06,0x7C, // 544
+0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0C,0x06,0x7C, // 545
+0x00,0x00,0x00,0x00,0xC2,0x66,0x3C,0x18,0x38,0x6C,0x6C,0x6C,0x38,0x00, // 546
+0x00,0x00,0x7E,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x1C,0x06,0x06,0x0C, // 547
+0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x06,0x02, // 548
+0x00,0x00,0x3C,0x66,0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 550
+0x00,0x00,0x3C,0x66,0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x82,0x82,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00, // 552
+0x00,0x00,0x7E,0x06,0x0C,0x18,0x0E,0x18,0x30,0x30,0x1E,0x06,0x06,0x0C, // 553
+0x00,0x00,0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xCC,0xCC,0xF8,0xC0,0xC0, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC0,0xC0,0xC0,0x7C,0x0C,0xF8,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x82,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x82,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0x92,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10, // 558
+0x00,0x00,0x00,0x00,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0xD6,0x6C,0x00,0x00, // 559
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x00,0x00, // 560
+0x00,0x00,0xFE,0xC6,0x82,0x00,0x00,0x7C,0x00,0x82,0xC6,0xFE,0x00,0x00, // 561
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 562
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10,0x38,0x00,0x00, // 563
+0x06,0x0C,0x18,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x00,0x18,0x30,0x00,0x76,0xDC,0xD8,0xD8,0xDC,0x76,0x00,0x00, // 565
+0x0C,0x18,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x30,0x1C,0x00,0x00, // 566
+0x00,0x0C,0x18,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x06,0x02, // 567
+0x00,0x00,0x18,0x30,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 568
+0x00,0x00,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 569
+0x00,0x00,0x0C,0x18,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 570
+0x00,0x00,0x18,0x30,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0xD6,0x6C,0x00,0x00, // 571
+0x30,0x60,0xD0,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 572
+0x30,0x60,0xDE,0x80,0xC0,0xC0,0xF8,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00, // 573
+0x30,0x60,0xC3,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x63,0x63,0x00,0x00, // 574
+0x30,0x60,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 575
+0x30,0x60,0xDE,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00, // 576
+0x30,0x60,0xD3,0x33,0x33,0x33,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00, // 577
+0x00,0x30,0x60,0xDC,0x36,0x63,0x63,0x63,0x36,0x36,0x36,0x77,0x00,0x00, // 578
+0x00,0x00,0x00,0xCC,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 579
+0x00,0x00,0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 580
+0x0C,0x18,0x10,0xCC,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 581
+0x06,0x0C,0x08,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 582
+0x00,0x00,0x10,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 583
+0x00,0x00,0x00,0xFC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 584
+0x00,0xFE,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 585
+0x10,0x38,0x10,0x7C,0xC6,0xC6,0xC0,0xCE,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 586
+0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00, // 587
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xC6,0xC6,0xC6,0xC6,0xFC,0x00,0x00, // 588
+0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xF8,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00, // 589
+0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xD8,0xCC,0xC6,0xC6,0xC6,0x00,0x00, // 590
+0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 591
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 592
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 593
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // 594
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 595
+0x00,0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 596
+0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xC6,0xE6,0xDC,0xC0,0xC0, // 601
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0x00,0x00, // 603
+0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 604
+0x66,0x66,0x00,0xFF,0x63,0x61,0x64,0x7C,0x64,0x61,0x63,0xFF,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00, // 606
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 607
+0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 608
+0x00,0x06,0x06,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // 609
+0x66,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 610
+0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00, // 611
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFC,0xC6,0xC6,0xFC,0xC0,0xC0,0x40, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 616
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 617
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xC6,0xC6,0xC6,0xC6,0xFC,0x00,0x00, // 618
+0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xF8,0xC0,0xC0,0xC0,0xC0,0xFE,0x00,0x00, // 619
+0x00,0x00,0xFE,0x06,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC0,0xFE,0x00,0x00, // 620
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 621
+0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 622
+0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xD8,0xCC,0xC6,0xC6,0xC6,0x00,0x00, // 623
+0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 624
+0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 625
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 626
+0x00,0x00,0xFC,0xC6,0xC6,0xC6,0xFC,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // 627
+0x00,0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 628
+0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 629
+0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 630
+0x66,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 631
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 632
+};
+
diff --git a/setedit/fonts/boxround.cc b/setedit/fonts/boxround.cc
new file mode 100644
index 0000000..510ce11
--- /dev/null
+++ b/setedit/fonts/boxround.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include "common1.h"
+#include "boxroun0.000"
+
+Font BoxRound16={0,NUM_FONTS,16,BR16};
+Font BoxRound14={0,NUM_FONTS,14,BR14};
+
+char *Name="Box Rounded";
+
+#define PREFIX BR
+#define PREFIXS "BR"
+#define NAME_FONT "boxround.sft"
+#define ARRAY1 BoxRound16
+#define ARRAY2 BoxRound14
+#define NAME_PART "boxroun%d.%03d"
+
+#include "common2.h"
diff --git a/setedit/fonts/boxround.sft b/setedit/fonts/boxround.sft
new file mode 100644
index 0000000..ade0ca9
--- /dev/null
+++ b/setedit/fonts/boxround.sft
Binary files differ
diff --git a/setedit/fonts/cntdown.cc b/setedit/fonts/cntdown.cc
new file mode 100644
index 0000000..7742ea9
--- /dev/null
+++ b/setedit/fonts/cntdown.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include "common1.h"
+#include "cntdown0.000"
+
+Font BoxRound16={0,NUM_FONTS,16,BR16};
+Font BoxRound14={0,NUM_FONTS,14,BR14};
+
+char *Name="Count Down";
+
+#define PREFIX BR
+#define PREFIXS "BR"
+#define NAME_FONT "cntdown.sft"
+#define ARRAY1 BoxRound16
+#define ARRAY2 BoxRound14
+#define NAME_PART "cntdown%d.%03d"
+
+#include "common2.h"
diff --git a/setedit/fonts/cntdown.sft b/setedit/fonts/cntdown.sft
new file mode 100644
index 0000000..5248c61
--- /dev/null
+++ b/setedit/fonts/cntdown.sft
Binary files differ
diff --git a/setedit/fonts/cntdown0.000 b/setedit/fonts/cntdown0.000
new file mode 100644
index 0000000..c6c5406
--- /dev/null
+++ b/setedit/fonts/cntdown0.000
@@ -0,0 +1,1272 @@
+unsigned char BR16[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x66,0xFF,0xFF,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x3C,0x5A,0xFF,0xFF,0x66,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0xFF,0x5A,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00, // \t
+0x00,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0x00, // \n
+0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, // \r
+0x00,0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x7E,0xA5,0x99,0xFF,0x99,0xA5,0x7E,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x40,0x60,0x70,0x7C,0x7F,0x7C,0x70,0x60,0x40,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3E,0x63,0x30,0x1C,0x36,0x63,0x63,0x36,0x1C,0x06,0x63,0x3E,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x08,0x1C,0x3A,0x79,0x08,0x08,0x08,0x08,0x4F,0x2E,0x1C,0x08,0x7F, // 
+0x00,0x00,0x00,0x08,0x1C,0x3A,0x79,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x4F,0x2E,0x1C,0x08,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x0C,0x0E,0xFF,0x02,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x00,0x30,0x40,0xFF,0x70,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1F,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x18,0x18,0x3C,0x2C,0x4E,0x46,0x87,0xFF,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xFF,0xE1,0x62,0x72,0x34,0x3C,0x18,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00,0x00, // !
+0x00,0x00,0x00,0xE7,0xE7,0x84,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x00,0x64,0x64,0x64,0xFF,0x64,0xFF,0x64,0x64,0x64,0x00,0x00,0x00,0x00, // #
+0x00,0x00,0x00,0x14,0x3E,0x75,0x74,0x74,0x3E,0x17,0x17,0x57,0x3E,0x14,0x00,0x00, // $
+0x00,0x00,0x00,0xE1,0xE3,0x06,0x0C,0x18,0x30,0x60,0xC7,0x87,0x00,0x00,0x00,0x00, // %
+0x00,0x00,0x00,0x7C,0x86,0x80,0x80,0x7F,0xE2,0xE2,0xE2,0x7C,0x00,0x00,0x00,0x00, // &
+0x00,0x00,0x00,0x1C,0x1C,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x00,0x0C,0x18,0x38,0x38,0x38,0x38,0x38,0x18,0x0C,0x00,0x00,0x00,0x00, // (
+0x00,0x00,0x00,0x18,0x0C,0x0E,0x0E,0x0E,0x0E,0x0E,0x0C,0x18,0x00,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x18,0xDB,0x7E,0x3C,0x7E,0xDB,0x18,0x00,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x0C,0x18,0x00,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x00,0x01,0x03,0x06,0x0C,0x18,0x30,0x60,0x40,0x00,0x00,0x00,0x00, // /
+0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x00,0x3C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 1
+0x00,0x00,0x00,0x3E,0x71,0x71,0x02,0x1C,0x20,0x47,0x47,0x7F,0x00,0x00,0x00,0x00, // 2
+0x00,0x00,0x00,0x3E,0x47,0x47,0x07,0x1E,0x07,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 3
+0x00,0x00,0x00,0x1E,0x2E,0x4E,0x4E,0x4E,0x7F,0x0E,0x0E,0x0E,0x00,0x00,0x00,0x00, // 4
+0x00,0x00,0x00,0x7F,0x47,0x40,0x7E,0x07,0x07,0x07,0x47,0x3E,0x00,0x00,0x00,0x00, // 5
+0x00,0x00,0x00,0x3E,0x47,0x40,0x7E,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 6
+0x00,0x00,0x00,0x7F,0x47,0x07,0x0E,0x0E,0x1C,0x1C,0x38,0x38,0x00,0x00,0x00,0x00, // 7
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x3E,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 8
+0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3F,0x01,0x71,0x3E,0x00,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x0C,0x18,0x00,0x00, // ;
+0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x38,0x1C,0x0E,0x07,0x03,0x01,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x20,0x30,0x38,0x1C,0x0E,0x07,0x02,0x04,0x08,0x10,0x20,0x00,0x00,0x00, // >
+0x00,0x00,0x00,0x3E,0x71,0x71,0x01,0x01,0x7E,0x70,0x00,0x70,0x70,0x00,0x00,0x00, // ?
+0x00,0x00,0x00,0x3E,0x71,0x73,0x75,0x75,0x77,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // @
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // A
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00,0x00, // B
+0x00,0x00,0x00,0x3E,0x47,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // C
+0x00,0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x7E,0x00,0x00,0x00,0x00, // D
+0x00,0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00,0x00, // E
+0x00,0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // F
+0x00,0x00,0x00,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // G
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // H
+0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // I
+0x00,0x00,0x00,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00,0x00, // J
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // K
+0x00,0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x00,0x00,0x00,0x00, // L
+0x00,0x00,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00,0x00, // M
+0x00,0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // N
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // O
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // P
+0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x71,0x75,0x72,0x3D,0x00,0x00,0x00,0x00, // Q
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // R
+0x00,0x00,0x00,0x3E,0x71,0x70,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00,0x00, // S
+0x00,0x00,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // T
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // U
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x3A,0x3A,0x1C,0x08,0x00,0x00,0x00,0x00, // V
+0x00,0x00,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00,0x00, // W
+0x00,0x00,0x00,0x71,0x71,0x71,0x32,0x1C,0x26,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // X
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // Y
+0x00,0x00,0x00,0x7F,0x71,0x71,0x02,0x1C,0x20,0x47,0x47,0x7F,0x00,0x00,0x00,0x00, // Z
+0x00,0x00,0x00,0x3C,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3C,0x00,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x00,0x40,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00, // \.
+0x00,0x00,0x00,0x3C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x3C,0x00,0x00,0x00,0x00, // ]
+0x18,0x3C,0x72,0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00, // _
+0x00,0x38,0x38,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, // a
+0x00,0x00,0x00,0x70,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x7E,0x00,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // c
+0x00,0x00,0x00,0x07,0x07,0x07,0x3F,0x47,0x47,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // e
+0x00,0x00,0x00,0x0F,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // g
+0x00,0x00,0x00,0x70,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // h
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // i
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00, // j
+0x00,0x00,0x00,0x70,0x70,0x70,0x71,0x72,0x74,0x7C,0x72,0x71,0x00,0x00,0x00,0x00, // k
+0x00,0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x1E,0x00,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x7E,0x70,0x70,0x00,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x78,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00,0x00, // s
+0x00,0x00,0x00,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x0F,0x00,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x00,0x71,0x71,0x71,0x39,0x3A,0x1C,0x00,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x1C,0x1C,0x1C,0x1C,0x77,0x00,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x0E,0x1C,0x38,0x70,0x7F,0x00,0x00,0x00,0x00, // z
+0x00,0x00,0x00,0x0F,0x1C,0x1C,0x1C,0x30,0x1C,0x1C,0x1C,0x0F,0x00,0x00,0x00,0x00, // {
+0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00, // |
+0x00,0x00,0x00,0x3C,0x0E,0x0E,0x0E,0x03,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00,0x00, // }
+0x70,0x8F,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x00,0x08,0x1C,0x36,0x63,0x63,0x7F,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0x71,0x71,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x18,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x67,0x67,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x63,0x63,0x00,0x3E,0x47,0x47,0x7F,0x47,0x47,0x47,0x00,0x00,0x00,0x00, //
+0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, //
+0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x71,0x71,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00, //
+0x00,0x00,0x63,0x63,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x71,0x71,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x0C,0x3F,0x4C,0x4C,0x4C,0x4C,0x3F,0x0C,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC3,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00, //
+0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x18,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3B,0x6E,0x00,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, //
+0x3B,0x6E,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, //
+0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x60,0xCE,0x93,0x06,0x0C,0x1F,0x00,0x00, //
+0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x0F,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x22,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11, //
+0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55, //
+0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7B,0xE6,0xE4,0xE6,0x7B,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00,0x00, //
+0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x80,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x39,0x39,0x39,0x39,0x3E,0x30,0x30,0x60,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3F,0x04,0x1E,0x39,0x39,0x39,0x39,0x1E,0x04,0x04,0x3F,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x62,0xE1,0xFF,0xE1,0x62,0x3C,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x62,0xE1,0xE1,0xE1,0x62,0x22,0xE3,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x03,0x06,0x7E,0xCF,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x70,0x7C,0x70,0x3E,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x18,0xFF,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x10,0x18,0x1C,0x0E,0x04,0x08,0x10,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x04,0x0C,0x1C,0x38,0x10,0x08,0x04,0x00,0x3F,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0xFF,0x00,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1C,0x26,0x26,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x70,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 256
+0x0C,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 257
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 258
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 259
+0x00,0x00,0x0C,0x18,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // 260
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // 261
+0x00,0x0C,0x18,0x30,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // 262
+0x0C,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 263
+0x0C,0x18,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // 264
+0x0C,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 265
+0x30,0x60,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 266
+0x0C,0x18,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 267
+0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 268
+0x18,0x30,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xF6,0x00,0x00,0x00,0x00, // 269
+0x18,0x30,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 270
+0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 271
+0x0C,0x18,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 272
+0x18,0x30,0x00,0xFE,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 273
+0x36,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 274
+0x60,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 275
+0x30,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 276
+0x30,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 277
+0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 278
+0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 279
+0x00,0xC6,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 280
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 281
+0x00,0x78,0xCC,0x78,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 282
+0x38,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 283
+0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 284
+0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 285
+0x00,0x00,0x36,0x6C,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 286
+0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 287
+0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 288
+0x7C,0xC6,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 289
+0x38,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 290
+0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 291
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 292
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 293
+0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 294
+0x00,0x00,0x6C,0x38,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 295
+0x00,0x00,0x6C,0x38,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 296
+0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // 297
+0x00,0x00,0x6C,0x38,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // 298
+0x66,0x3C,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // 299
+0x6C,0x38,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // 300
+0x6C,0x38,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 301
+0x6C,0x38,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 302
+0x6C,0x38,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xF6,0x00,0x00,0x00,0x00, // 303
+0x6C,0x38,0x00,0x7C,0xC6,0xC0,0x60,0x38,0x0C,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 304
+0x66,0x3C,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 305
+0x6C,0x38,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x18,0x0C,0x78,0x00, // 307
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x18,0x0C,0x78,0x00, // 308
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x18,0x0C,0x78,0x00, // 309
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x18,0x0C,0x78,0x00, // 310
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x18,0x30,0x1E,0x00, // 311
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x30,0x60,0x3C,0x00, // 312
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x18,0x30,0x1E,0x00, // 313
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x18,0x30,0x1E,0x00, // 314
+0x00,0x00,0x18,0x18,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // 315
+0x18,0x18,0x00,0xFE,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 316
+0x00,0x00,0x38,0x1A,0x1E,0x1C,0x18,0x38,0x78,0x58,0x18,0x3C,0x00,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x7C,0xCE,0xDE,0xF6,0xE6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 318
+0x00,0x00,0xF0,0x64,0x6C,0x78,0x70,0xE0,0xE0,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 319
+0x00,0x04,0x7C,0xCE,0xCE,0xD6,0xD6,0xD6,0xD6,0xE6,0xE6,0x7C,0x40,0x00,0x00,0x00, // 320
+0x00,0x00,0x0C,0x0C,0x7E,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 321
+0x00,0x00,0x34,0x18,0x2C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, // 322
+0x00,0x00,0xF8,0x6C,0x66,0x66,0xF6,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // 323
+0x00,0x00,0x1D,0x0D,0x0D,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 324
+0x00,0x00,0xEC,0x64,0x68,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 325
+0x00,0x06,0x12,0x34,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // 326
+0x00,0x00,0xF6,0x62,0x64,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 327
+0x00,0x00,0xC6,0x7C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 328
+0x00,0x00,0x66,0x3C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 329
+0xC6,0x7C,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 330
+0x00,0x00,0x00,0x00,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0xC6,0x00,0x00,0x00,0x00, // 331
+0x00,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // 332
+0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00, // 334
+0x00,0x00,0x7C,0x82,0xB2,0xAA,0xB2,0xAA,0xAA,0x82,0x7C,0x00,0x00,0x00,0x00,0x00, // 335
+0x00,0x00,0x7C,0x82,0x9A,0xA2,0xA2,0xA2,0x9A,0x82,0x7C,0x00,0x00,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 337
+0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 338
+0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00, // 342
+0x00,0xE0,0x30,0x62,0x36,0xEC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x78,0x00,0x00, // 344
+0x00,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x00,0x18,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0x00,0x7C,0x06,0x3C,0x06,0x06,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x60,0x3C,0x00, // 349
+0x00,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x00,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x00,0x36,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 353
+0x36,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 354
+0x6C,0x38,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 355
+0xD8,0x70,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 356
+0xD8,0x70,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // 357
+0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 358
+0x36,0x1C,0x00,0x0C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 359
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 360
+0x00,0x00,0xFE,0x62,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 361
+0x00,0x00,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 362
+0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xFF,0xC3,0x81,0x00,0x00, // 363
+0x00,0x00,0xDB,0xDB,0x5A,0x5A,0x7E,0x7E,0x5A,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00, // 364
+0x00,0x00,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 365
+0x6C,0x38,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 366
+0x00,0x00,0x1F,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xCF,0x00,0x00,0x00,0x00, // 367
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 368
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 369
+0x00,0x00,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00,0x00,0x00, // 370
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFF,0x03,0x03,0x00,0x00, // 371
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00, // 372
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00,0x00, // 373
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFF,0x03,0x03,0x00,0x00, // 374
+0x00,0x00,0xF8,0xF0,0xB0,0x30,0x3E,0x33,0x33,0x33,0x33,0x7E,0x00,0x00,0x00,0x00, // 375
+0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xF3,0xDB,0xDB,0xDB,0xDB,0xF3,0x00,0x00,0x00,0x00, // 376
+0x00,0x00,0xF0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 377
+0x00,0x00,0x7C,0xC6,0x06,0x26,0x3E,0x26,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 378
+0x00,0x00,0xCE,0xDB,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xDB,0xCE,0x00,0x00,0x00,0x00, // 379
+0x00,0x00,0x3F,0x66,0x66,0x66,0x3E,0x3E,0x66,0x66,0x66,0xE7,0x00,0x00,0x00,0x00, // 380
+0x00,0x02,0x06,0x7C,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0xFF,0xC3,0xC3,0x00,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x54,0xD6,0xD6,0x00,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x3C,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 387
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00, // 395
+0x00,0x00,0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x18,0x3C,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFF,0x03,0x03,0x00,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x03,0x03,0x00,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF8,0xB0,0xB0,0x3E,0x33,0x33,0x7E,0x00,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x3E,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xCE,0xDB,0xDB,0xFB,0xDB,0xDB,0xCE,0x00,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7F,0xC6,0xC6,0x7E,0x36,0x66,0xE7,0x00,0x00,0x00,0x00, // 406
+0x00,0x00,0x7C,0xC6,0xC0,0xC8,0xF8,0xC8,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xF8,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 408
+0x00,0x00,0x00,0x3E,0x47,0x47,0x07,0x1E,0x07,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 409
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00, // 410
+0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xCC,0xCC,0xCC,0x00,0x00,0x00,0x00, // 411
+0x00,0x00,0xFC,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x06,0x1C,0x00,0x00, // 412
+0x00,0x00,0x00,0x00,0x00,0x30,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x1C,0x00,0x00, // 413
+0x18,0x30,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 414
+0x00,0x00,0x18,0x30,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 415
+0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 416
+0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00,0x00,0x00, // 418
+0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDE,0xDA,0xDA,0xDA,0xDE,0x00,0x00,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00,0x00,0x00, // 420
+0x00,0x00,0xFE,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // 422
+0x0C,0x18,0xC6,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 423
+0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0x00,0x00,0x00,0x00, // 424
+0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 425
+0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C,0x00, // 426
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10,0x00,0x00, // 427
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10,0x00,0x00, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00,0x00, // 430
+0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x18,0x3C,0x18,0x18,0x00,0x00,0x00,0x00, // 431
+0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x3C,0x18,0x18,0x7E,0x18,0x00,0x00,0x00, // 432
+0x00,0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00,0x00, // 433
+0x00,0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 437
+0x00,0x00,0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 438
+0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 439
+0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 443
+0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x00,0xE2,0xE4,0xE8,0xF8,0xE4,0xE2,0xE2,0x00,0x00,0x00, // 461
+0x00,0x00,0x00,0xFC,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xEC,0x00,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0x00,0xFC,0xE2,0xE2,0xE2,0xE2,0xE2,0x02,0x1C,0x00,0x00,0x00, // 463
+0x3C,0x72,0x00,0x3E,0x47,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 464
+0x00,0x18,0x3C,0x72,0xE1,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // 465
+0x3C,0x72,0x00,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 466
+0x00,0x18,0x3C,0x72,0xE1,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // 467
+0x3C,0x72,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // 468
+0x3C,0x72,0x00,0x70,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // 469
+0x3C,0x72,0x00,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00,0x00, // 470
+0x18,0x3C,0x72,0xE1,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x18,0x78,0x00, // 471
+0x3C,0x72,0x00,0x3E,0x71,0x70,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00,0x00, // 472
+0x00,0x18,0x3C,0x72,0xE1,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00,0x00, // 473
+0x3C,0x72,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00,0x00, // 474
+0x00,0x18,0x3C,0x72,0xE1,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 475
+0x3C,0x72,0x00,0x71,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 476
+0x00,0x18,0x3C,0x72,0xE1,0x00,0x47,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // 477
+0x38,0x38,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00,0x00, // 478
+0x70,0x70,0x00,0x70,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x7E,0x00,0x00,0x00,0x00, // 479
+0x1C,0x1C,0x00,0x3E,0x47,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 480
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // 481
+0x38,0x38,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x7E,0x00,0x00,0x00,0x00, // 482
+0x07,0x07,0x00,0x07,0x07,0x07,0x3F,0x47,0x47,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, // 483
+0x1C,0x1C,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // 484
+0x0E,0x0E,0x00,0x0F,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 485
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // 486
+0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 487
+0x1C,0x1C,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00,0x00, // 488
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x76,0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x00,0x00, // 489
+0x1C,0x1C,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // 490
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x7E,0x71,0x71,0x71,0x71,0x7E,0x70,0x70,0x00,0x00, // 491
+0x1C,0x1C,0x00,0x3E,0x71,0x70,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00,0x00, // 492
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00,0x00, // 493
+0x1C,0x1C,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 494
+0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x0F,0x00,0x00,0x00,0x00, // 495
+0x00,0x7F,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x00,0x7F,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // 497
+0x00,0x3E,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x00,0x3E,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 499
+0x00,0x7F,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x00,0x7F,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 501
+0x00,0x7F,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x00,0x7F,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 503
+0x63,0x3E,0x00,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 504
+0x00,0x00,0x00,0x63,0x3E,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // 505
+0x63,0x3E,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 506
+0x00,0x00,0x00,0x63,0x3E,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 507
+0x63,0x3E,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 508
+0x00,0x00,0x00,0x63,0x3E,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 509
+0x00,0x00,0x00,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x08,0x0C,0x78,0x00, // 510
+0x00,0x00,0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x7E,0x0C,0x06,0x7C, // 511
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x06,0x03,0x3E,0x00, // 512
+0x00,0x00,0x00,0x70,0x70,0x70,0x71,0x72,0x74,0x7C,0x72,0x79,0x0C,0x06,0x7C,0x00, // 513
+0x00,0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x06,0x03,0x7E,0x00, // 514
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x79,0x02,0x03,0x3E,0x00, // 515
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x06,0x03,0x7E,0x00, // 516
+0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x78,0x70,0x70,0x70,0x78,0x0C,0x06,0x7C,0x00, // 517
+0x71,0x8E,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 518
+0x00,0x00,0x70,0x8F,0x06,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 519
+0x70,0x8F,0x06,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 520
+0x00,0x00,0x70,0x8F,0x06,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 521
+0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x30,0x60,0x3C,0x00, // 522
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x30,0x60,0x3C,0x00, // 523
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x30,0x60,0x3C,0x00, // 524
+0x00,0x00,0x00,0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x30,0x60,0x3C,0x00, // 525
+0x70,0x78,0x38,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00,0x00, // 526
+0x00,0x38,0x38,0x1C,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 527
+0x38,0x3C,0x1C,0x71,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 528
+0x00,0x38,0x38,0x1C,0x1C,0x00,0x47,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00,0x00, // 529
+0x0E,0x1E,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00,0x00, // 530
+0x00,0x00,0x0E,0x1E,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 531
+0x61,0x61,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00,0x00, // 532
+0x00,0x00,0x00,0x61,0x61,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 533
+0x00,0x00,0x00,0x72,0x72,0x73,0x77,0x7E,0x7A,0xF2,0xF2,0x72,0x00,0x00,0x00,0x00, // 534
+0x00,0x00,0x00,0x70,0x71,0x73,0x7E,0x7D,0x79,0xF1,0xF1,0x71,0x00,0x00,0x00,0x00, // 535
+0x00,0x00,0x00,0x7F,0x1C,0x1F,0x1E,0x1C,0x1C,0x3C,0x7C,0x1C,0x00,0x00,0x00,0x00, // 536
+0x00,0x00,0x00,0x1C,0x1D,0x1F,0x7F,0x1C,0x1C,0x3C,0x6C,0x0F,0x00,0x00,0x00,0x00, // 537
+0x78,0x1C,0x1C,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 538
+0x00,0x00,0x78,0x1C,0x1C,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 539
+0x78,0x1C,0x1C,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 540
+0x00,0x00,0x78,0x1C,0x1C,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 541
+0x1C,0x1C,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00,0x00, // 542
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // 543
+0x00,0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x0C,0x06,0x7C,0x00, // 544
+0x00,0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x1E,0x0C,0x06,0x7C,0x00, // 545
+0x00,0x00,0x00,0x00,0x00,0xE2,0xE2,0xE2,0xE2,0x64,0x38,0x64,0xE2,0xE2,0x7C,0x00, // 546
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0xE0,0xE0,0xE0,0xE0,0x7C,0x02,0x02,0x3C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0x7C,0x72,0x72,0x72,0x72,0x72,0x72,0x02,0x02,0x02,0x00, // 548
+0x00,0x00,0x78,0x84,0x04,0x04,0x7C,0xE4,0xE4,0xE4,0xE4,0x78,0x00,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 550
+0x00,0x00,0x7C,0x82,0x02,0x02,0x7E,0xE2,0xE2,0xE2,0xE2,0xE2,0x00,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x00,0xE1,0xE1,0x72,0x72,0x72,0x3C,0x18,0x00,0x00,0x00,0x00, // 552
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x70,0x70,0x3C,0x70,0xF0,0x7C,0x02,0x02,0x3C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x3C,0x72,0x72,0x72,0x72,0x72,0x7C,0x70,0x70,0x70,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xE2,0xE0,0xE0,0x7C,0x02,0x7C,0x00,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xFC,0x00,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0xC1,0xE2,0x74,0x38,0x38,0x74,0xE2,0xC1,0x00,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0xEA,0xEA,0xEA,0xEA,0xEA,0xEA,0x7C,0x08,0x08,0x08,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x64,0xE2,0xEA,0xEA,0xEA,0xEA,0x74,0x00,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x38,0x64,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xFE,0x00,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0x82,0x00,0x00,0x7C,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0x00,0x00,0x00,0x00, // 562
+0x00,0x00,0xEA,0xEA,0xEA,0xEA,0xEA,0xEA,0x7C,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 563
+0x06,0x0C,0x18,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x18,0x38,0x30,0x00,0x7B,0xE6,0xE4,0xE6,0x7B,0x00,0x00,0x00,0x00,0x00, // 565
+0x00,0x00,0x0C,0x1C,0x18,0x00,0x3E,0x70,0x7C,0x70,0x3E,0x00,0x00,0x00,0x00,0x00, // 566
+0x00,0x18,0x38,0x30,0x00,0x7C,0x72,0x72,0x72,0x72,0x72,0x72,0x02,0x02,0x02,0x00, // 567
+0x00,0x0C,0x1C,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 568
+0x00,0x00,0x0C,0x1C,0x18,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 569
+0x00,0x0C,0x1C,0x18,0x00,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xFC,0x00,0x00,0x00,0x00, // 570
+0x00,0x0C,0x1C,0x18,0x00,0x64,0xE2,0xEA,0xEA,0xEA,0xEA,0x74,0x00,0x00,0x00,0x00, // 571
+0x00,0x60,0xE0,0xDE,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 572
+0x00,0x60,0xE0,0xDF,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00,0x00, // 573
+0x00,0x60,0xE0,0xD1,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // 574
+0x00,0x60,0xE0,0xDC,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 575
+0x00,0x60,0xE0,0xDE,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 576
+0x00,0x60,0xE0,0xD1,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 577
+0x00,0x00,0x60,0xE0,0xDC,0x62,0xE1,0xE1,0xE1,0x62,0x22,0xE3,0x00,0x00,0x00,0x00, // 578
+0x00,0x00,0x66,0x66,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0xE2,0x00,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xFC,0x00,0x00,0x00,0x00, // 580
+0x0C,0x1C,0xDB,0xC3,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 581
+0x1C,0x18,0xD6,0xC6,0x00,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xFC,0x00,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x38,0x64,0x64,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0x00,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x00,0x7F,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, // 584
+0x00,0x7F,0x00,0x3E,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 585
+0x08,0x1C,0x08,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 586
+0x00,0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00,0x00, // 587
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00,0x00, // 588
+0x00,0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00,0x00, // 589
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 590
+0x00,0x00,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00,0x00, // 591
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // 592
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 593
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // 594
+0x00,0x00,0x00,0x3E,0x47,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 595
+0x00,0x00,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 596
+0x00,0x00,0x00,0x71,0x71,0x71,0x32,0x1C,0x26,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x7E,0x70,0x70,0x00,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x1C,0x1C,0x1C,0x1C,0x77,0x00,0x00,0x00,0x00, // 603
+0x00,0x00,0xC6,0xC6,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 604
+0x00,0xC6,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00,0x00, // 606
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 607
+0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 608
+0x00,0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00, // 609
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 610
+0x00,0x00,0x00,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00,0x00, // 611
+0x00,0x00,0x00,0x3E,0x71,0x70,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x39,0x39,0x39,0x39,0x3E,0x30,0x30,0x60,0x00,0x00,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00,0x00, // 616
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 617
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00,0x00, // 618
+0x00,0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00,0x00, // 619
+0x00,0x00,0x00,0x7F,0x71,0x71,0x02,0x1C,0x20,0x47,0x47,0x7F,0x00,0x00,0x00,0x00, // 620
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // 621
+0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 622
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 623
+0x00,0x00,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00,0x00, // 624
+0x00,0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 625
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00,0x00, // 626
+0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00,0x00, // 627
+0x00,0x00,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 628
+0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00, // 629
+0x00,0x00,0x00,0x71,0x71,0x71,0x32,0x1C,0x26,0x47,0x47,0x47,0x00,0x00,0x00,0x00, // 630
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 631
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 632
+};
+
+unsigned char BR14[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x7E,0x00,0x00,0x00, // 
+0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0x7E,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x66,0xFF,0xFF,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x3C,0x5A,0xFF,0xFF,0x66,0x18,0x3C,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0xFF,0x5A,0x18,0x3C,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF, // \n
+0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00, // \r
+0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00, // 
+0x00,0x00,0x00,0x7E,0xA5,0x99,0xFF,0x99,0xA5,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x40,0x60,0x70,0x7C,0x7F,0x7C,0x70,0x60,0x40,0x00,0x00,0x00, // 
+0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00, // 
+0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00, // 
+0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00, // 
+0x00,0x3E,0x63,0x30,0x1C,0x36,0x63,0x63,0x36,0x1C,0x06,0x63,0x3E,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0x00,0x00,0x00, // 
+0x00,0x00,0x08,0x1C,0x2E,0x08,0x08,0x08,0x3A,0x1C,0x08,0x3E,0x00,0x00, // 
+0x00,0x00,0x08,0x1C,0x3A,0x79,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00, // 
+0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x4F,0x2E,0x1C,0x08,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x0C,0x0E,0xFF,0x02,0x0C,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x30,0x40,0xFF,0x70,0x30,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1F,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x18,0x3C,0x2C,0x4E,0x46,0x87,0xFF,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0xFF,0xE1,0x62,0x72,0x34,0x3C,0x18,0x18,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00, // !
+0x00,0x00,0xE7,0xE7,0x84,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x64,0x64,0x64,0xFF,0x64,0xFF,0x64,0x64,0x64,0x00,0x00,0x00, // #
+0x00,0x00,0x14,0x3E,0x75,0x74,0x74,0x3E,0x17,0x17,0x57,0x3E,0x14,0x00, // $
+0x00,0x00,0xE1,0xE3,0x06,0x0C,0x18,0x30,0x60,0xC7,0x87,0x00,0x00,0x00, // %
+0x00,0x00,0x7C,0x86,0x80,0x80,0x7F,0xE2,0xE2,0xE2,0x7C,0x00,0x00,0x00, // &
+0x00,0x00,0x1C,0x1C,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x0C,0x18,0x38,0x38,0x38,0x38,0x38,0x18,0x0C,0x00,0x00,0x00, // (
+0x00,0x00,0x18,0x0C,0x0E,0x0E,0x0E,0x0E,0x0E,0x0C,0x18,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x18,0xDB,0x7E,0x3C,0x7E,0xDB,0x18,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x0C,0x18,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x01,0x03,0x06,0x0C,0x18,0x30,0x60,0x40,0x00,0x00,0x00, // /
+0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 0
+0x00,0x00,0x3C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 1
+0x00,0x00,0x3E,0x71,0x71,0x02,0x1C,0x20,0x47,0x47,0x7F,0x00,0x00,0x00, // 2
+0x00,0x00,0x3E,0x47,0x47,0x07,0x1E,0x07,0x47,0x47,0x3E,0x00,0x00,0x00, // 3
+0x00,0x00,0x1E,0x2E,0x4E,0x4E,0x4E,0x7F,0x0E,0x0E,0x0E,0x00,0x00,0x00, // 4
+0x00,0x00,0x7F,0x47,0x40,0x7E,0x07,0x07,0x07,0x47,0x3E,0x00,0x00,0x00, // 5
+0x00,0x00,0x3E,0x47,0x40,0x7E,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // 6
+0x00,0x00,0x7F,0x47,0x07,0x0E,0x0E,0x1C,0x1C,0x38,0x38,0x00,0x00,0x00, // 7
+0x00,0x00,0x3E,0x47,0x47,0x47,0x3E,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 8
+0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3F,0x01,0x71,0x3E,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x0C,0x18,0x00, // ;
+0x00,0x01,0x02,0x04,0x08,0x10,0x38,0x1C,0x0E,0x07,0x03,0x01,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00,0x00, // =
+0x00,0x20,0x30,0x38,0x1C,0x0E,0x07,0x02,0x04,0x08,0x10,0x20,0x00,0x00, // >
+0x00,0x00,0x3E,0x71,0x71,0x01,0x01,0x7E,0x70,0x00,0x70,0x70,0x00,0x00, // ?
+0x00,0x00,0x3E,0x71,0x73,0x75,0x75,0x77,0x70,0x70,0x3F,0x00,0x00,0x00, // @
+0x00,0x00,0x3E,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // A
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00, // B
+0x00,0x00,0x3E,0x47,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00, // C
+0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x7E,0x00,0x00,0x00, // D
+0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00, // E
+0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // F
+0x00,0x00,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00, // G
+0x00,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // H
+0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // I
+0x00,0x00,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00, // J
+0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // K
+0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x00,0x00,0x00, // L
+0x00,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00, // M
+0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // N
+0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // O
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // P
+0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x71,0x75,0x72,0x3D,0x00,0x00,0x00, // Q
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // R
+0x00,0x00,0x3E,0x71,0x70,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00, // S
+0x00,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // T
+0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // U
+0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x3A,0x3A,0x1C,0x08,0x00,0x00,0x00, // V
+0x00,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00, // W
+0x00,0x00,0x71,0x71,0x71,0x32,0x1C,0x26,0x47,0x47,0x47,0x00,0x00,0x00, // X
+0x00,0x00,0x71,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // Y
+0x00,0x00,0x7F,0x71,0x71,0x02,0x1C,0x20,0x47,0x47,0x7F,0x00,0x00,0x00, // Z
+0x00,0x00,0x3C,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3C,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x40,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x00,0x00,0x00, // \.
+0x00,0x00,0x3C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x3C,0x00,0x00,0x00, // ]
+0x18,0x3C,0x72,0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00, // _
+0x00,0x38,0x38,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00, // a
+0x00,0x00,0x70,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x7E,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00, // c
+0x00,0x00,0x07,0x07,0x07,0x3F,0x47,0x47,0x47,0x47,0x3F,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00, // e
+0x00,0x00,0x0F,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // g
+0x00,0x00,0x70,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // h
+0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // i
+0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00, // j
+0x00,0x00,0x70,0x70,0x70,0x71,0x72,0x74,0x7C,0x72,0x71,0x00,0x00,0x00, // k
+0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x1E,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x76,0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x7E,0x70,0x70,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x3F,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0x77,0x78,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00, // s
+0x00,0x00,0x1C,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x0F,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x71,0x71,0x71,0x39,0x3A,0x1C,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x77,0x1C,0x1C,0x1C,0x1C,0x77,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x47,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0x7F,0x0E,0x1C,0x38,0x70,0x7F,0x00,0x00,0x00, // z
+0x00,0x00,0x0F,0x1C,0x1C,0x1C,0x30,0x1C,0x1C,0x1C,0x0F,0x00,0x00,0x00, // {
+0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00, // |
+0x00,0x00,0x3C,0x0E,0x0E,0x0E,0x03,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00, // }
+0x70,0x8F,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x08,0x1C,0x36,0x63,0x63,0x7F,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00, //
+0x00,0x00,0x71,0x71,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x0C,0x18,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0x67,0x67,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0xCC,0xCC,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, //
+0x00,0x63,0x63,0x00,0x3E,0x47,0x47,0x7F,0x47,0x47,0x47,0x00,0x00,0x00, //
+0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x00,0x00,0x00, //
+0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x66,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xCC,0x76,0x36,0x7E,0xD8,0xD8,0x6E,0x00,0x00,0x00, //
+0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x71,0x71,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00, //
+0x00,0x63,0x63,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, //
+0x00,0x71,0x71,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x0C,0x3F,0x4C,0x4C,0x4C,0x4C,0x3F,0x0C,0x00,0x00, //
+0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x00,0x00,0x00, //
+0x00,0xF8,0xCC,0xCC,0xF8,0xC4,0xCC,0xDE,0xCC,0xCC,0xC6,0x00,0x00,0x00, //
+0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0xD8,0x70,0x00, //
+0x00,0x00,0x0C,0x18,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x3B,0x6E,0x00,0x7E,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00, //
+0x3B,0x6E,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x00,0x00,0x00, //
+0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC6,0xC6,0x7C,0x00,0x00,0x00, //
+0x00,0x1F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7F,0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00, //
+0x00,0xC0,0xC0,0xC6,0xCC,0xD8,0x30,0x60,0xCE,0x93,0x06,0x0C,0x1F,0x00, //
+0x00,0xC0,0xC0,0xC6,0xCC,0xD8,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x0F,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00, //
+0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, //
+0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, //
+0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7B,0xE6,0xE4,0xE6,0x7B,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00, //
+0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00, //
+0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x39,0x39,0x39,0x39,0x3E,0x30,0x30,0x60,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x3F,0x04,0x1E,0x39,0x39,0x39,0x39,0x1E,0x04,0x04,0x3F,0x00,0x00, //
+0x00,0x00,0x00,0x3C,0x62,0xE1,0xFF,0xE1,0x62,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3C,0x62,0xE1,0xE1,0xE1,0x62,0x22,0x22,0xE3,0x00,0x00, //
+0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x03,0x06,0x7E,0xCF,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3E,0x70,0x7C,0x70,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x71,0x71,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x7F,0x7F,0x00,0x7F,0x7F,0x00,0x7F,0x7F,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00, //
+0x00,0x00,0x10,0x18,0x1C,0x0E,0x04,0x08,0x10,0x00,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x04,0x0C,0x1C,0x38,0x10,0x08,0x04,0x00,0x3F,0x00,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0xFF,0x00,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1C,0x26,0x26,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00,0x00, //
+0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x70,0x98,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 256
+0x18,0x30,0x60,0x40,0xE0,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 257
+0x00,0x00,0x00,0x18,0x30,0x20,0xDC,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 258
+0x00,0x00,0x0C,0x18,0x30,0x00,0xDC,0x76,0x66,0x60,0x60,0xF0,0x00,0x00, // 259
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x00,0x00, // 260
+0x00,0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8, // 261
+0x00,0x00,0x0C,0x18,0x30,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // 262
+0x18,0x30,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 263
+0x0C,0x18,0x10,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 264
+0x0C,0x18,0x10,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 265
+0x30,0x60,0x40,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // 266
+0x18,0x30,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00, // 267
+0x18,0x30,0x20,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 268
+0x0C,0x18,0x30,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xE6,0x00,0x00, // 269
+0x0C,0x18,0x10,0x7C,0xC6,0xC6,0x70,0x1C,0x06,0xC6,0xC6,0x7C,0x00,0x00, // 270
+0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 271
+0x0C,0x18,0x10,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 272
+0x0C,0x18,0x10,0xFE,0xC6,0x8C,0x18,0x30,0x30,0x62,0xC6,0xFE,0x00,0x00, // 273
+0x36,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 274
+0x30,0x18,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 275
+0x30,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 276
+0x30,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 277
+0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 278
+0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 279
+0x00,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 280
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 281
+0x00,0x00,0x38,0x6C,0x38,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 282
+0x38,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 283
+0x00,0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // 284
+0x00,0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 285
+0x00,0x00,0x36,0x6C,0xD8,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 286
+0x76,0xDC,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 287
+0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 288
+0x38,0x6C,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 289
+0x38,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 290
+0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 291
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 292
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 293
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 294
+0x00,0x00,0x00,0x6C,0x38,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 295
+0x00,0x00,0x00,0x6C,0x38,0x00,0xDC,0x76,0x66,0x60,0x60,0xF0,0x00,0x00, // 296
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x00,0x00, // 297
+0x00,0x00,0x00,0x6C,0x38,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // 298
+0x6C,0x38,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 299
+0xCC,0x78,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00, // 300
+0x6C,0x38,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 301
+0x6C,0x38,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00, // 302
+0x6C,0x38,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xE6,0x00,0x00, // 303
+0x6C,0x38,0x00,0x7C,0xC6,0xC6,0x70,0x1C,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 304
+0x66,0x3C,0x18,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 305
+0x6C,0x38,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x62,0xC6,0xC6,0xFE,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x10,0x18,0x70, // 307
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x08,0x0C,0x38, // 308
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0xC6,0xC6,0x7C,0x10,0x18,0x70, // 309
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x08,0x0C,0x38, // 310
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x04,0x0C,0x07, // 311
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x10,0x30,0x1C, // 312
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x04,0x0C,0x07, // 313
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x08,0x18,0x0E, // 314
+0x00,0x00,0x00,0x18,0x18,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // 315
+0x00,0x18,0x18,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x62,0xC6,0xFE,0x00,0x00, // 316
+0x00,0x00,0x00,0x38,0x1A,0x1E,0x1C,0x18,0x38,0x78,0x18,0x3C,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x01,0x7E,0xCE,0xD6,0xD6,0xE6,0x7C,0x80,0x00, // 318
+0x00,0x00,0x78,0x30,0x30,0x36,0x3C,0x38,0x70,0xF2,0x36,0x7E,0x00,0x00, // 319
+0x00,0x00,0x04,0x7C,0xCE,0xCE,0xD6,0xD6,0xD6,0xE6,0xE6,0x7C,0x40,0x00, // 320
+0x00,0x00,0x00,0x0C,0x7E,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 321
+0x00,0x00,0x00,0x34,0x18,0x2C,0x06,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00, // 322
+0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0xF6,0x66,0x66,0x6C,0xF8,0x00,0x00, // 323
+0x00,0x00,0x00,0x1D,0x0D,0x0D,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 324
+0x00,0x00,0x00,0xEC,0x64,0x68,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 325
+0x00,0x00,0x06,0x12,0x34,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 326
+0x00,0x00,0xF6,0x62,0x64,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // 327
+0x00,0x00,0x00,0xCC,0x78,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // 328
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 329
+0xC6,0x7C,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 330
+0x00,0x00,0x00,0x00,0xC6,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0x00,0x00,0x00, // 331
+0x00,0x00,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0, // 332
+0x00,0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00, // 334
+0x00,0x00,0x00,0x38,0x44,0xBA,0xAA,0xB2,0xAA,0xAA,0x44,0x38,0x00,0x00, // 335
+0x00,0x00,0x00,0x38,0x44,0x9A,0xA2,0xA2,0xA2,0x9A,0x44,0x38,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 337
+0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x00, // 338
+0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0x00,0xE0,0x30,0x63,0x36,0xEC,0x18,0x36,0x6E,0xDA,0x3F,0x06,0x06,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x78, // 344
+0x00,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x00,0x18,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0x00,0x78,0x0C,0x38,0x0C,0x0C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x00,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x30,0x1C, // 349
+0x00,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x00,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x00,0x33,0x66,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 353
+0x36,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 354
+0xD8,0x70,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00, // 355
+0xD8,0x70,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // 356
+0x00,0x6C,0x38,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 357
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 358
+0x36,0x1C,0x00,0x0C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 359
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 360
+0x00,0x00,0xFE,0x62,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 361
+0x00,0x00,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 362
+0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xFE,0xC6,0x82,0x00, // 363
+0x00,0x00,0xD6,0xD6,0x54,0x7C,0x7C,0x54,0xD6,0xD6,0xD6,0x00,0x00,0x00, // 364
+0x00,0x00,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0x00,0x00,0x00, // 365
+0x6C,0x38,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0x00,0x00,0x00, // 366
+0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0xC6,0x00,0x00,0x00, // 367
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 368
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00, // 369
+0x00,0x00,0x7C,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x38,0x00,0x00,0x00, // 370
+0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x0C,0x00, // 371
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x00,0x00,0x00, // 372
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00, // 373
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFF,0x03,0x06,0x00, // 374
+0x00,0x00,0xF0,0xF0,0xB0,0xBC,0x36,0x36,0x36,0x36,0x7C,0x00,0x00,0x00, // 375
+0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDA,0xDA,0xDA,0xDA,0xF6,0x00,0x00,0x00, // 376
+0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 377
+0x00,0x00,0x7C,0xC6,0x06,0x06,0x3E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00, // 378
+0x00,0x00,0xDC,0xD6,0xD6,0xF6,0xF6,0xD6,0xD6,0xD6,0xDC,0x00,0x00,0x00, // 379
+0x00,0x00,0x7E,0xC6,0xC6,0xC6,0x7E,0x3E,0x66,0xC6,0xC6,0x00,0x00,0x00, // 380
+0x00,0x00,0x06,0x7C,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0xF0,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0xFE,0xC6,0xC6,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x7C,0x7C,0xD6,0xD6,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x1C,0x06,0xC6,0x7C,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0x00,0x00,0x00, // 387
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0xE6,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xD6,0xD6,0xC6,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xFC,0x00, // 395
+0x00,0x00,0x00,0x38,0x10,0x7C,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x38,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x0C,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xFF,0x03,0x06,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF0,0xB0,0xBC,0x36,0x36,0x7C,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x3E,0x06,0xC6,0x7C,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xDC,0xD6,0xF6,0xF6,0xD6,0xDC,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0x7C,0x6C,0xCE,0x00,0x00,0x00, // 406
+0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xF8,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xF0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 408
+0x00,0x00,0x3E,0x47,0x47,0x07,0x1E,0x07,0x47,0x47,0x3E,0x00,0x00,0x00, // 409
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // 410
+0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xCC,0xCC,0x00,0x00,0x00, // 411
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x06,0x0C, // 412
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x0C, // 413
+0x18,0x30,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 414
+0x00,0x00,0x18,0x30,0x00,0xFE,0x62,0x62,0x60,0x60,0xF0,0x00,0x00,0x00, // 415
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 416
+0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00, // 418
+0x00,0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDA,0xDA,0xDA,0xDE,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00, // 420
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x00,0x00, // 422
+0x00,0x0C,0x18,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xCC,0xC6,0xC6,0x00,0x00, // 423
+0x00,0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xF8,0xCC,0xC6,0xC6,0x00,0x00, // 424
+0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 425
+0x00,0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // 426
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10, // 427
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00, // 430
+0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x18,0x3C,0x18,0x18,0x00,0x00,0x00, // 431
+0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x3C,0x18,0x18,0x7E,0x18,0x00,0x00, // 432
+0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00, // 433
+0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 437
+0x00,0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 438
+0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00, // 439
+0x00,0x6E,0xD8,0xD8,0xD8,0xD8,0xDE,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 443
+0x00,0x78,0x80,0x80,0x80,0x78,0x00,0x3C,0x22,0x3E,0x24,0x22,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x38,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x06,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0xE2,0xE4,0xE8,0xF8,0xE4,0xE2,0xE2,0x00,0x00, // 461
+0x00,0x00,0xFC,0xE6,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xEC,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0xFC,0xE2,0xE2,0xE2,0xE2,0xE2,0x02,0x1C,0x00,0x00, // 463
+0x3C,0x66,0x00,0x3E,0x67,0x47,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00, // 464
+0x18,0x3C,0x72,0xE1,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00, // 465
+0x3C,0x72,0x00,0x3E,0x67,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00, // 466
+0x18,0x3C,0x72,0xE1,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // 467
+0x3C,0x72,0x01,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // 468
+0x3C,0x72,0x00,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x00,0x00,0x00,0x00, // 469
+0x3C,0x72,0xE1,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00, // 470
+0x18,0x3C,0x72,0xE1,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x70, // 471
+0x3C,0x72,0x00,0x3E,0x71,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00, // 472
+0x18,0x3C,0x72,0xE1,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00, // 473
+0x3C,0x72,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00, // 474
+0x18,0x3C,0x72,0xE1,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 475
+0x3C,0x72,0x00,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 476
+0x18,0x3C,0x72,0xE1,0x00,0x47,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // 477
+0x18,0x18,0x00,0x7E,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00, // 478
+0x70,0x70,0x00,0x70,0x70,0x7E,0x71,0x71,0x71,0x71,0x7E,0x00,0x00,0x00, // 479
+0x1C,0x1C,0x00,0x3E,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00, // 480
+0x00,0x00,0x1C,0x1C,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00, // 481
+0x1C,0x1C,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x7E,0x00,0x00,0x00, // 482
+0x07,0x07,0x00,0x07,0x07,0x3F,0x47,0x47,0x47,0x47,0x3F,0x00,0x00,0x00, // 483
+0x1C,0x1C,0x00,0x7F,0x70,0x70,0x7F,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // 484
+0x1C,0x1C,0x00,0x1F,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 485
+0x00,0x00,0x1C,0x1C,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // 486
+0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 487
+0x1C,0x1C,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00, // 488
+0x00,0x00,0x1C,0x1C,0x00,0x76,0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x00, // 489
+0x1C,0x1C,0x00,0x7E,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // 490
+0x00,0x00,0x1C,0x1C,0x00,0x7E,0x71,0x71,0x71,0x71,0x7E,0x70,0x70,0x00, // 491
+0x1C,0x1C,0x00,0x3E,0x71,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00, // 492
+0x00,0x00,0x1C,0x1C,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00, // 493
+0x1C,0x1C,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 494
+0x1C,0x1C,0x00,0x1C,0x1C,0x7F,0x1C,0x1C,0x1C,0x1C,0x0F,0x00,0x00,0x00, // 495
+0x7F,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x7F,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00, // 497
+0x7F,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x7F,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 499
+0x7F,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x7F,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 501
+0x7F,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x7F,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 503
+0x66,0x3C,0x00,0x3E,0x47,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00, // 504
+0x00,0x63,0x3E,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // 505
+0x63,0x3E,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 506
+0x00,0xC6,0x7C,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x00,0x00,0x00, // 507
+0x63,0x3E,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 508
+0x00,0x00,0x63,0x3E,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 509
+0x00,0x00,0x3E,0x47,0x40,0x40,0x40,0x5F,0x47,0x47,0x3E,0x18,0x0C,0x78, // 510
+0x00,0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x3F,0x1F,0x07,0x07,0x06,0x7C, // 511
+0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x18,0x0C,0x78, // 512
+0x00,0x00,0x70,0x70,0x70,0x71,0x72,0x74,0x7C,0x72,0x71,0x18,0x0C,0x78, // 513
+0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x18,0x0C,0x78, // 514
+0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x71,0x18,0x0C,0x78, // 515
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x18,0x0C,0x78, // 516
+0x00,0x00,0x00,0x00,0x00,0x77,0x78,0x70,0x70,0x70,0x70,0x18,0x0C,0x78, // 517
+0x70,0x8F,0x06,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 518
+0x00,0x70,0x8F,0x06,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 519
+0x70,0x8F,0x06,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 520
+0x00,0x70,0x8F,0x06,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 521
+0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x10,0x30,0x1C, // 522
+0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x10,0x30,0x1C, // 523
+0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x10,0x30,0x1C, // 524
+0x00,0x00,0x00,0x00,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x10,0x30,0x1C, // 525
+0x38,0x3C,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00, // 526
+0x00,0x38,0x3C,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 527
+0x1C,0x1E,0x0E,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 528
+0x00,0x38,0x3C,0x1C,0x00,0x47,0x47,0x47,0x47,0x47,0x3F,0x07,0x07,0x00, // 529
+0x0E,0x1E,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00, // 530
+0x00,0x0E,0x1E,0x1C,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 531
+0x61,0x61,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x7E,0x00,0x00,0x00, // 532
+0x00,0x00,0x61,0x61,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 533
+0x00,0x00,0x72,0x73,0x73,0x77,0x7E,0x7A,0xF2,0xF2,0x72,0x00,0x00,0x00, // 534
+0x00,0x00,0x70,0x71,0x73,0x7E,0x7D,0x79,0xF1,0xF1,0x71,0x00,0x00,0x00, // 535
+0x00,0x00,0x7F,0x1C,0x1F,0x1E,0x1C,0x1C,0x3C,0x7C,0x1C,0x00,0x00,0x00, // 536
+0x00,0x00,0x1C,0x1D,0x1F,0x7F,0x1C,0x1C,0x3C,0x7C,0x4F,0x00,0x00,0x00, // 537
+0x38,0x1C,0x1C,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // 538
+0x00,0x78,0x1C,0x1C,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 539
+0x78,0x1C,0x1C,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 540
+0x00,0x78,0x1C,0x1C,0x00,0x71,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 541
+0x1C,0x1C,0x00,0x7F,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00, // 542
+0x00,0x00,0x1C,0x1C,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00, // 543
+0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x0C,0x06,0x7C, // 544
+0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x1E,0x0C,0x06,0x7C, // 545
+0x00,0x00,0x00,0x00,0x00,0xE2,0x72,0x3C,0x18,0x38,0x74,0x74,0x38,0x00, // 546
+0x00,0x00,0x7E,0x06,0x0C,0x18,0x38,0x38,0x38,0x1C,0x02,0x02,0x0C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0x7C,0x72,0x72,0x72,0x72,0x72,0x02,0x02,0x02, // 548
+0x00,0x00,0x3C,0x42,0x02,0x02,0x3E,0x72,0x72,0x72,0x3C,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 550
+0x00,0x00,0x3C,0x42,0x02,0x02,0x3E,0x72,0x72,0x72,0x72,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0xC2,0xC2,0xE2,0xE2,0x64,0x38,0x10,0x00,0x00,0x00, // 552
+0x00,0x00,0x7E,0x06,0x0C,0x1C,0x0E,0x18,0x38,0x1E,0x02,0x02,0x0C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x78,0xE4,0xE4,0xE4,0xE4,0xF8,0xC0,0xC0,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xE0,0xE0,0x78,0x04,0xF8,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x72,0x72,0x72,0x72,0x72,0x7C,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0xC2,0xE2,0x7C,0x38,0x7C,0xE2,0xC2,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0xEA,0xEA,0xEA,0xEA,0xEA,0xFC,0x08,0x08,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x64,0xE2,0xEA,0xEA,0xEA,0x74,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x38,0x64,0xE2,0xE2,0xE2,0xE2,0xE2,0xFE,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0xC6,0x82,0x00,0x7C,0x00,0x82,0xC6,0xFE,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0xE2,0x00,0x00,0x00, // 562
+0x00,0x00,0xEA,0xEA,0xEA,0xEA,0xEA,0xFC,0x08,0x08,0x1C,0x00,0x00,0x00, // 563
+0x0C,0x18,0x00,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x00,0x18,0x30,0x00,0x7B,0xE6,0xE4,0xE6,0x7B,0x00,0x00,0x00, // 565
+0x00,0x00,0x00,0x0C,0x18,0x00,0x3E,0x70,0x7C,0x70,0x3E,0x00,0x00,0x00, // 566
+0x00,0x00,0x18,0x30,0x00,0x7C,0x72,0x72,0x72,0x72,0x72,0x02,0x02,0x02, // 567
+0x00,0x00,0x18,0x30,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 568
+0x00,0x00,0x0C,0x18,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 569
+0x00,0x00,0x0C,0x18,0x00,0x72,0x72,0x72,0x72,0x72,0x7C,0x00,0x00,0x00, // 570
+0x00,0x00,0x18,0x30,0x00,0x64,0xE2,0xEA,0xEA,0xEA,0x74,0x00,0x00,0x00, // 571
+0x60,0xE0,0xBE,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // 572
+0x30,0x60,0xDF,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00, // 573
+0x30,0x60,0xD1,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // 574
+0x30,0x60,0xDC,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 575
+0x30,0x60,0xDE,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // 576
+0x30,0x60,0xD1,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 577
+0x00,0x30,0x60,0xDC,0x62,0xE1,0xE1,0xE1,0x62,0x22,0x22,0xE3,0x00,0x00, // 578
+0x00,0x00,0x00,0xCC,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0x72,0x00,0x72,0x72,0x72,0x72,0x72,0x7C,0x00,0x00,0x00, // 580
+0x0C,0x18,0x10,0xCC,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 581
+0x06,0x0C,0x08,0x72,0x00,0x72,0x72,0x72,0x72,0x72,0x7C,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x38,0x64,0x64,0xE2,0xE2,0xE2,0xE2,0xE2,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x7F,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00, // 584
+0x7F,0x00,0x3E,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // 585
+0x08,0x1C,0x08,0x3E,0x47,0x40,0x40,0x5F,0x47,0x47,0x3E,0x00,0x00,0x00, // 586
+0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00, // 587
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00, // 588
+0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00, // 589
+0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // 590
+0x00,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00, // 591
+0x00,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // 592
+0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // 593
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // 594
+0x00,0x00,0x3E,0x47,0x47,0x40,0x40,0x40,0x47,0x47,0x3E,0x00,0x00,0x00, // 595
+0x00,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 596
+0x00,0x00,0x71,0x71,0x71,0x32,0x1C,0x26,0x47,0x47,0x47,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x3E,0x07,0x3F,0x47,0x47,0x3F,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x7F,0x70,0x70,0x3F,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x7E,0x71,0x71,0x71,0x71,0x7E,0x70,0x70,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x70,0x70,0x70,0x3F,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x77,0x1C,0x1C,0x1C,0x1C,0x77,0x00,0x00,0x00, // 603
+0x00,0x00,0xCC,0xCC,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 604
+0x00,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x3F,0x70,0x3E,0x07,0x07,0x7E,0x00,0x00,0x00, // 606
+0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 607
+0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 608
+0x00,0x00,0x1C,0x1C,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00, // 609
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 610
+0x00,0x00,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x3C,0x00,0x00,0x00, // 611
+0x00,0x00,0x3E,0x71,0x70,0x70,0x3E,0x07,0x07,0x47,0x3E,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x39,0x39,0x39,0x39,0x3E,0x30,0x30,0x60,0x00,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x3E,0x71,0x71,0x71,0x71,0x3E,0x00,0x00,0x00, // 616
+0x00,0x00,0x3E,0x47,0x47,0x47,0x7F,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // 617
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x71,0x71,0x71,0x7E,0x00,0x00,0x00, // 618
+0x00,0x00,0x7F,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x7F,0x00,0x00,0x00, // 619
+0x00,0x00,0x7F,0x71,0x71,0x02,0x1C,0x20,0x47,0x47,0x7F,0x00,0x00,0x00, // 620
+0x00,0x00,0x71,0x71,0x71,0x71,0x7F,0x71,0x71,0x71,0x71,0x00,0x00,0x00, // 621
+0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 622
+0x00,0x00,0x71,0x71,0x71,0x71,0x7E,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // 623
+0x00,0x00,0x7E,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x00,0x00,0x00, // 624
+0x00,0x00,0x7E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x00,0x00,0x00, // 625
+0x00,0x00,0x3E,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x3E,0x00,0x00,0x00, // 626
+0x00,0x00,0x7E,0x71,0x71,0x71,0x7E,0x70,0x70,0x70,0x70,0x00,0x00,0x00, // 627
+0x00,0x00,0x7F,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 628
+0x00,0x00,0x71,0x71,0x71,0x71,0x3A,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00, // 629
+0x00,0x00,0x71,0x71,0x71,0x32,0x1C,0x26,0x47,0x47,0x47,0x00,0x00,0x00, // 630
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 631
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 632
+};
+
diff --git a/setedit/fonts/common1.h b/setedit/fonts/common1.h
new file mode 100644
index 0000000..e6644cc
--- /dev/null
+++ b/setedit/fonts/common1.h
@@ -0,0 +1,17 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+//#include <conio.h>
+
+// 0 - NUM_FONTS!
+#define NUM_FONTS 632
+typedef struct
+{
+ int first, last, lines;
+ unsigned char *font;
+} Font;
+
+char *Signature="SET's editor font\x1A";
+
diff --git a/setedit/fonts/common2.h b/setedit/fonts/common2.h
new file mode 100644
index 0000000..893688b
--- /dev/null
+++ b/setedit/fonts/common2.h
@@ -0,0 +1,250 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void SaveSFT(Font &fnt,FILE *f)
+{
+ fwrite(&fnt,12,1,f);
+ fwrite(fnt.font,(fnt.last-fnt.first+1)*fnt.lines,1,f);
+}
+
+void SaveFont(Font &fnt)
+{
+ int i=0,part=1;
+ char name[PATH_MAX];
+ char bTMP[256*fnt.lines];
+
+ while (i<fnt.last)
+ {
+ sprintf(name,NAME_PART,part,fnt.lines);
+ FILE *f=fopen(name,"wb");
+ if (f!=NULL)
+ {
+ int cant=fnt.last-i+1;
+ if (cant>256)
+ cant=256;
+ memset(bTMP,0,256*fnt.lines);
+ memcpy(bTMP,fnt.font+i*fnt.lines,fnt.lines*cant);
+ fwrite(bTMP,256*fnt.lines,1,f);
+ fclose(f);
+ }
+ i+=256;
+ part++;
+ }
+}
+
+void SaveFontFull(Font &fnt)
+{
+ int i=0;
+ char name[PATH_MAX];
+
+ sprintf(name,NAME_PART,0,fnt.lines);
+ FILE *f=fopen(name,"wb");
+ if (f!=NULL)
+ {
+ fwrite(fnt.font,NUM_FONTS*fnt.lines,1,f);
+ fclose(f);
+ }
+}
+
+void GenSFT(void)
+{
+ FILE *f=fopen(NAME_FONT,"wb");
+ fwrite(Signature,strlen(Signature),1,f);
+ int version=1;
+ fwrite(&version,4,1,f);
+ int cant=2;
+ fwrite(&cant,4,1,f);
+ short len=strlen(Name)+1;
+ fwrite(&len,2,1,f);
+ fputs(Name,f);
+ SaveSFT(ARRAY1,f);
+ SaveSFT(ARRAY2,f);
+ fclose(f);
+}
+
+void Dump1(int lines, char *buffer,FILE *d)
+{
+ int i,j;
+ unsigned char *s=(unsigned char *)buffer;
+ for (i=0; i<256; i++)
+ {
+ for (j=0; j<lines; j++,s++)
+ fprintf(d,"0x%02X,",*s);
+ switch (i)
+ {
+ case 0:
+ fprintf(d," // 0\n");
+ break;
+ case 9:
+ fprintf(d," // \\t\n");
+ break;
+ case 10:
+ fprintf(d," // \\n\n");
+ break;
+ case 13:
+ fprintf(d," // \\r\n");
+ break;
+ case 26:
+ fprintf(d," // \\x1A\n");
+ break;
+ case '\\':
+ fprintf(d," // \\.\n");
+ break;
+ case 255:
+ fprintf(d," // 255\n");
+ break;
+ default:
+ fprintf(d," // %c\n",i);
+ }
+ }
+}
+
+void Dump2(int lines, char *buffer, int cant, int base,FILE *d)
+{
+ int i,j;
+ unsigned char *s=(unsigned char *)buffer;
+ for (i=0; i<cant; i++)
+ {
+ for (j=0; j<lines; j++,s++)
+ fprintf(d,"0x%02X,",*s);
+ fprintf(d," // %d\n",i+base);
+ }
+}
+
+void GenH1(Font &fnt, FILE *d)
+{
+ int i=0,part=1;
+ char name[PATH_MAX];
+ char bTMP[256*fnt.lines];
+
+ fprintf(d,"unsigned char %s%d[]={\n",PREFIXS,fnt.lines);
+ while (i<fnt.last)
+ {
+ sprintf(name,NAME_PART,part,fnt.lines);
+ FILE *f=fopen(name,"rb");
+ if (f!=NULL)
+ {
+ int cant=fnt.last-i+1;
+ if (cant>256)
+ cant=256;
+ fread(bTMP,cant*fnt.lines,1,f);
+ fclose(f);
+ if (i==0)
+ Dump1(fnt.lines,bTMP,d);
+ else
+ Dump2(fnt.lines,bTMP,cant,i,d);
+ }
+ i+=256;
+ part++;
+ }
+ fprintf(d,"};\n\n");
+}
+
+void GenH(void)
+{
+ char name[PATH_MAX];
+ sprintf(name,NAME_PART,0,0);
+ FILE *f=fopen(name,"wt");
+ if (f)
+ {
+ GenH1(ARRAY1,f);
+ GenH1(ARRAY2,f);
+ }
+ fclose(f);
+}
+
+#if 0
+unsigned Added[]=
+{'B','E','K','M','H','O','P','C','T','X','a','e','o','p','c','x',
+ 137,280,'s','i',139,'j',281,'J','S',0};
+ // 611 => U+0408 (74==J)
+ // 612 => U+0405 (83==S)
+
+void CPatch(Font *f)
+{
+ unsigned lines=f->lines;
+ unsigned char *nfont=new unsigned char [lines*(NUM_FONTS+1)];
+ memcpy(nfont,f->font,lines*588);
+ int i=0;
+ while (Added[i])
+ {
+ memcpy(nfont+lines*(588+i),nfont+lines*Added[i],lines);
+ i++;
+ }
+ f->font=nfont;
+ printf("Copied upto: %d\n",588+i-1);
+}
+
+void CyrillicPatch()
+{
+ CPatch(&ARRAY1);
+ CPatch(&ARRAY2);
+}
+#else
+ #define CyrillicPatch()
+#endif
+
+#if 1
+unsigned Added[]=
+{0xE1,0x185,0xE6,'o','A','B','E','Z','H','I','K','M','N','O','P','T','Y','X',
+ 0x119,0x1C2,0};
+
+void CPatch(Font *f)
+{
+ unsigned lines=f->lines;
+ unsigned char *nfont=new unsigned char [lines*(NUM_FONTS+1)];
+ memcpy(nfont,f->font,lines*613);
+ int i=0;
+ while (Added[i])
+ {
+ memcpy(nfont+lines*(613+i),nfont+lines*Added[i],lines);
+ i++;
+ }
+ f->font=nfont;
+ printf("Copied upto: %d\n",613+i-1);
+}
+
+void GreekPatch()
+{
+ CPatch(&ARRAY1);
+ CPatch(&ARRAY2);
+}
+#else
+ #define GreekPatch()
+#endif
+
+int main(void)
+{
+ CyrillicPatch();
+ GreekPatch();
+ printf("
+Choose an action:
+
+1 - Generate .sft from data in the .EXE file (for editor)
+2 - Generate .0xx files from data in the .EXE file (for font editor)
+3 - Generate .h file to recompile the .EXE
+4 - Generate .0xx file with all the fonts in the .EXE file (for tools)
+
+");
+ int c=getchar()-'0';
+
+ switch (c)
+ {
+ case 1:
+ GenSFT();
+ break;
+ case 2:
+ SaveFont(ARRAY1);
+ SaveFont(ARRAY2);
+ break;
+ case 3:
+ GenH();
+ break;
+ case 4:
+ SaveFontFull(ARRAY1);
+ SaveFontFull(ARRAY2);
+ break;
+ default:
+ printf("wrong option!\n");
+ }
+ return 0;
+}
diff --git a/setedit/fonts/convpcf1.cc b/setedit/fonts/convpcf1.cc
new file mode 100644
index 0000000..77b4383
--- /dev/null
+++ b/setedit/fonts/convpcf1.cc
@@ -0,0 +1,937 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador E. Tropea
+ Covered by the GPL License
+
+ Description:
+ This program was used to generate .sft files from .pcf font files (XFree86
+uses this format).@*
+ The code is a hack, I don't even bothered looking for the PCF format, I
+just figured out where is located what I need. It works for the fonts I have
+and isn't really generic. In fact I solve some missing symbols using
+knowledge about the fonts it converts.@*
+ If you successfully convert another fonts to the SFT format please
+consider contributing them to the Turbo Vision and SETEdit projects.@*
+ This code compiles and runs under Linux and most probably is ok for other
+POSIX systems. I used gcc specific extensions. The code assumes gzip is
+available and uses it to uncompress .gz files, at least in Debian all X
+fonts are compressed using gzip.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+// Linux stdlib defines LITTLE_ENDIAN
+#define MY_LITTLE_ENDIAN
+//#define MY_BIG_ENDIAN
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned u32;
+
+#include "intcode.h"
+
+void SaveChar(int v, FILE *d);
+void DrawChar(int v);
+
+const u32 PCF1Magic=0x70636601,typeShapes=8,typeUnicodes=0x20,typeInfo=1;
+static FILE *f;
+u32 offShapes=0,offUnicode=0,numUnicodes,numShapes,fontW=0,fontH=0,fontWb=0;
+u16 *unicodeTable;
+int verboseLevel=1,buggyHalfs=0,useForUnknown=-1;
+unsigned sizeChar;
+typedef struct
+{
+ int first, last, lines;
+ int width;
+} Font;
+
+char *Signature="SET's editor font\x1A";
+char Name[512];
+
+#ifdef MY_BIG_ENDIAN
+inline
+void Swap(u32 *val)
+{
+ u8 *p=(u8 *)val;
+ unsigned aux;
+ aux=p[3];
+ p[3]=p[0];
+ p[0]=aux;
+ aux=p[2];
+ p[2]=p[1];
+ p[1]=aux;
+}
+#else
+inline
+void Swap(u32 *)
+{
+}
+#endif
+
+u32 ReadU32()
+{
+ u32 val;
+ fread(&val,4,1,f);
+ //printf("0x%08X\n",val);
+ Swap(&val);
+ return val;
+}
+
+void GetName(char *dest, u32 offset)
+{
+ fseek(f,offset,SEEK_SET);
+ int i=0;
+ while (i<255)
+ {
+ dest[i]=fgetc(f);
+ if (dest[i]==0) return;
+ i++;
+ }
+ dest[i]=0;
+}
+
+void WriteBlank(int l, FILE *d)
+{
+ int i,c=l*fontWb;
+ for (i=0; i<c; i++)
+ fputc(0,d);
+}
+
+void WriteFull(FILE *d)
+{
+ int c=fontW;
+ while (c>8)
+ {
+ fputc(0xFF,d);
+ c-=8;
+ }
+ unsigned mask=0x80,acc=0;
+ while (c)
+ {
+ acc|=mask;
+ mask>>=1;
+ c--;
+ }
+ fputc(acc,d);
+}
+
+void CopyLines(unsigned h, FILE *d)
+{
+ unsigned i,j,mask,mask2,val,vres;
+ u8 c[4];
+
+ for (j=0; j<h; j++)
+ {
+ fread(c,4,1,f);
+ for (i=0; i<fontWb; i++)
+ {
+ val=c[i];
+ vres=0;
+ for (mask=1,mask2=0x80; mask2; mask<<=1, mask2>>=1)
+ if (val & mask)
+ vres|=mask2;
+ fputc(vres,d);
+ }
+ }
+}
+
+void CopyLinesLeft(unsigned h, unsigned cut, FILE *d)
+{
+ unsigned i,j,mask,mask2,vres,k,val;
+ u8 c[4];
+ //printf("CopyLinesLeft(h=%d,cut=%d)\n",h,cut);
+
+ for (j=0; j<h; j++)
+ {
+ fread(c,4,1,f);
+ if (!c[0])
+ {
+ fwrite(c,fontWb,1,d);
+ //fputc(j,d);
+ //fputc(j,d);
+ //printf("%d) Writing %d %d fontWb=%d",j,c[0],c[1],fontWb);
+ }
+ else
+ for (k=0, i=0; i<fontWb; i++)
+ {
+ val=c[i];
+ vres=0;
+ for (mask=1,mask2=0x80; mask2; k++, mask<<=1, mask2>>=1)
+ if (k<cut && (val & mask))
+ vres|=mask2;
+ fputc(vres,d);
+ //printf("%d) Wrinting 0x%02X ",j,vres);
+ }
+ //printf("\n");
+ }
+}
+
+void CopyLinesRight(unsigned h, unsigned cut, FILE *d)
+{
+ unsigned i,j,mask,mask2,vres,k,val;
+ u8 c[4];
+
+ for (j=0; j<h; j++)
+ {
+ fread(c,4,1,f);
+ if (!c[0])
+ fwrite(c,fontWb,1,d);
+ else
+ for (k=0, i=0; i<fontWb; i++)
+ {
+ val=c[i];
+ vres=0;
+ for (mask=1,mask2=0x80; mask2; k++, mask<<=1, mask2>>=1)
+ if (k>=cut && (val & mask))
+ vres|=mask2;
+ fputc(vres,d);
+ }
+ }
+}
+
+u32 VerifyAvailable(int uni, int replace, FILE *d)
+{
+ if (uni>=numUnicodes)
+ {
+ printf("Missing U%04X 1\n",replace);
+ SaveChar(0,d);
+ return 0;
+ }
+ u32 val=unicodeTable[uni];
+ if (val==0xFFFF)
+ {
+ printf("Missing U%04X 2\n",replace);
+ SaveChar(0,d);
+ return 0;
+ }
+ return val;
+}
+
+void SeekChar(unsigned val)
+{
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+}
+
+void GenerateF801(FILE *d)
+{
+ unsigned val;
+ if (!(val=VerifyAvailable(0x2500,0xF801,d))) return;
+ int prev=fontH/4,rest=fontH-prev;
+ fseek(f,offShapes+val*sizeChar+prev*4,SEEK_SET);
+ printf("Generating a replacement for UF801\n");
+ CopyLines(rest,d);
+ u8 c[4];
+ memset(c,0,4);
+ int i;
+ for (i=0; i<prev; i++)
+ fwrite(c,fontWb,1,d);
+}
+
+void GenerateF803(FILE *d)
+{
+ unsigned val;
+ if (!(val=VerifyAvailable(0x2500,0xF803,d))) return;
+ int prev=fontH/4,rest=fontH-prev;
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+ printf("Generating a replacement for UF803\n");
+ int i;
+ u8 c[4];
+ memset(c,0,4);
+ for (i=0; i<prev; i++)
+ fwrite(c,fontWb,1,d);
+ CopyLines(rest,d);
+}
+
+// BOX DRAWINGS LIGHT LEFT
+void Generate2574(FILE *d)
+{
+ unsigned val;
+ if (!(val=VerifyAvailable(0x2500,0x2574,d))) return;
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+ printf("Generating a replacement for U2574\n");
+ CopyLinesLeft(fontH,fontW/2,d);
+}
+
+// BOX DRAWINGS LIGHT RIGHT
+void Generate2576(FILE *d)
+{
+ unsigned val;
+ if (!(val=VerifyAvailable(0x2500,0x2576,d))) return;
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+ printf("Generating a replacement for U2576\n");
+ CopyLinesRight(fontH,fontW/2,d);
+}
+
+// BOX DRAWINGS LIGHT UP
+void Generate2575(FILE *d)
+{
+ unsigned val;
+ if (!(val=VerifyAvailable(0x2502,0x2575,d))) return;
+ int prev=fontH/2,rest=fontH-prev;
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+ printf("Generating a replacement for U2575\n");
+ CopyLines(prev,d);
+ int i;
+ u8 c[4];
+ memset(c,0,4);
+ for (i=0; i<rest; i++)
+ fwrite(c,fontWb,1,d);
+}
+
+// BOX DRAWINGS LIGHT DOWN
+void Generate2577(FILE *d)
+{
+ unsigned val;
+ if (!(val=VerifyAvailable(0x2502,0x2577,d))) return;
+ int prev=fontH/2,rest=fontH-prev;
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+ printf("Generating a replacement for U2577\n");
+ int i;
+ u8 c[4];
+ memset(c,0,4);
+ for (i=0; i<rest; i++)
+ fwrite(c,fontWb,1,d);
+ CopyLines(prev,d);
+}
+
+int MeassureVert(unsigned val)
+{
+ SeekChar(val);
+ u8 c[4];
+ fread(c,4,1,f);
+ unsigned i,j=0,mask,mask2;
+ int start=-1,end=-1;
+ for (i=0; i<fontWb; i++)
+ {
+ val=c[i];
+ for (mask=1,mask2=0x80; mask2; j++, mask<<=1, mask2>>=1)
+ if (val & mask)
+ {
+ if (start==-1) start=j;
+ }
+ else
+ {
+ if (start!=-1 && end==-1) end=j;
+ }
+ }
+ return end-start;
+}
+
+// [s,e)
+void MeassureHoriz2(unsigned val, int &s, int &e)
+{
+ fseek(f,offShapes+val*sizeChar,SEEK_SET);
+ u8 c[4];
+ s=0;
+ fread(c,4,1,f);
+ while (!c[0])
+ {
+ s++;
+ fread(c,4,1,f);
+ }
+ while (c[0])
+ {
+ s++;
+ fread(c,4,1,f);
+ }
+ e=s;
+ while (!c[0])
+ {
+ e++;
+ fread(c,4,1,f);
+ }
+}
+
+// [start;end)
+void CreateV(u8 *c, int start, int end)
+{
+ unsigned i,mask2,vres,k;
+ memset(c,0,4);
+
+ for (k=0, i=0; i<fontWb; i++)
+ {
+ vres=0;
+ for (mask2=0x80; mask2; k++, mask2>>=1)
+ if (k>=start && k<end)
+ vres|=mask2;
+ c[i]=vres;
+ }
+}
+
+// BOX DRAWINGS HEAVY LEFT, but Linux uses *DOUBLE*
+void GenerateFake2578(FILE *d)
+{
+ unsigned valV,valH2;
+ if (!(valH2=VerifyAvailable(0x2550,0x2578,d))) return;
+ if (!(valV=VerifyAvailable(0x2502,0x2578,d))) return;
+ int w=MeassureVert(valV);
+ int s,e;
+ MeassureHoriz2(valH2,s,e);
+ printf("Generating a replacement for U2578 Width: %d [%d;%d)\n",w,s,e);
+ SeekChar(valH2);
+ u8 c[4];
+ u32 half=fontW/2,i;
+ CreateV(c,half-w,half);
+ CopyLinesLeft(s,half,d);
+ for (i=s; i<e; i++)
+ {
+ //printf("%d) Writing %d %d fontWb=%d\n",i,c[0],c[1],fontWb);
+ fwrite(c,fontWb,1,d);
+ }
+ fseek(f,(e-s)*4,SEEK_CUR);
+ CopyLinesLeft(fontH-e,half,d);
+}
+
+// BOX DRAWINGS HEAVY RIGHT, but Linux uses *DOUBLE*
+void GenerateFake257A(FILE *d)
+{
+ unsigned valV,valH2;
+ if (!(valH2=VerifyAvailable(0x2550,0x257A,d))) return;
+ if (!(valV=VerifyAvailable(0x2502,0x257A,d))) return;
+ int w=MeassureVert(valV);
+ int s,e;
+ MeassureHoriz2(valH2,s,e);
+ printf("Generating a replacement for U257A Width: %d [%d;%d)\n",w,s,e);
+ SeekChar(valH2);
+ u8 c[4];
+ u32 half=fontW/2,i;
+ CreateV(c,half,half+w);
+ CopyLinesRight(s,half,d);
+ for (i=s; i<e; i++)
+ fwrite(c,fontWb,1,d);
+ fseek(f,(e-s)*4,SEEK_CUR);
+ CopyLinesRight(fontH-e,half,d);
+}
+
+int MeassureHoriz(unsigned val, FILE *d)
+{
+ SeekChar(val);
+ u8 c[4];
+ fread(c,4,1,f);
+ while (!c[0]) fread(c,4,1,f);
+ int h=0;
+ while (c[0])
+ {
+ h++;
+ fread(c,4,1,f);
+ }
+ return h;
+}
+
+void MeassureVert2(unsigned val, int &s, int &e)
+{
+ SeekChar(val);
+ u8 c[4];
+ fread(c,4,1,f);
+
+ unsigned i,mask2,k,v,end=0;
+ s=e=-1;
+ for (k=0, i=0; i<fontWb; i++)
+ {
+ v=c[i];
+ for (mask2=1; mask2; k++, mask2<<=1)
+ if (mask2 & v)
+ {
+ if (s==-1) s=k;
+ if (e!=-1) end=e=k;
+ }
+ else
+ {
+ if (s!=-1 && e==-1) e=k;
+ if (end)
+ {
+ e=k;
+ return;
+ }
+ }
+ }
+}
+
+// BOX DRAWINGS HEAVY UP, but Linux uses *DOUBLE*
+void GenerateFake2579(FILE *d)
+{
+ unsigned valV2,valH;
+ if (!(valV2=VerifyAvailable(0x2551,0x2579,d))) return;
+ if (!(valH=VerifyAvailable(0x2500,0x2579,d))) return;
+ int h=MeassureHoriz(valH,d);
+ int s,e;
+ MeassureVert2(valV2,s,e);
+ printf("Generating a replacement for U2579 Height: %d [%d;%d)\n",h,s,e);
+ SeekChar(valV2);
+ u8 c[4];
+ u32 half=fontH/2,rest=fontH-half,i;
+ CreateV(c,s,e);
+ CopyLines(half-h,d);
+ for (i=0; i<h; i++)
+ fwrite(c,fontWb,1,d);
+ memset(c,0,4);
+ for (i=0; i<rest; i++)
+ fwrite(c,fontWb,1,d);
+}
+
+// BOX DRAWINGS HEAVY DOWN, but Linux uses *DOUBLE*
+void GenerateFake257B(FILE *d)
+{
+ unsigned valV2,valH;
+ if (!(valV2=VerifyAvailable(0x2551,0x257B,d))) return;
+ if (!(valH=VerifyAvailable(0x2500,0x257B,d))) return;
+ int h=MeassureHoriz(valH,d);
+ int s,e;
+ MeassureVert2(valV2,s,e);
+ printf("Generating a replacement for U257B Height: %d [%d;%d)\n",h,s,e);
+ SeekChar(valV2);
+ u8 c[4];
+ u32 half=fontH/2,rest=fontH-half-h,i;
+ memset(c,0,4);
+ for (i=0; i<half; i++)
+ fwrite(c,fontWb,1,d);
+ CreateV(c,s,e);
+ for (i=0; i<h; i++)
+ fwrite(c,fontWb,1,d);
+ CopyLines(rest,d);
+}
+
+u8 *LoadChar(int v)
+{
+ SeekChar(v);
+ u8 *ch=new u8[fontH*fontW];
+ u8 c[4],*d;
+ unsigned i,j,mask,mask2,val,vres,k;
+
+ for (d=ch, j=0; j<fontH; j++)
+ {
+ fread(c,4,1,f);
+ for (k=0, i=0; i<4 && k<fontW; i++)
+ {
+ val=c[i];
+ for (mask=1; mask<0x100 && k<fontW; d++, k++, mask<<=1)
+ {
+ if (val & mask)
+ *d=1;
+ else
+ *d=0;
+ }
+ }
+ }
+ return ch;
+}
+
+void FillRect(unsigned x1, unsigned y1, unsigned x2, unsigned y2, u8 val, u8 *dest)
+{
+ unsigned x,y;
+ u8 *d=dest+y1*fontW;
+ for (y=y1; y<=y2; d+=fontW, y++)
+ for (x=x1; x<=x2; x++)
+ d[x]=val;
+}
+
+void SaveChar(u8 *c, FILE *d)
+{
+ unsigned h,w,mask,vres,x;
+
+ for (h=0; h<fontH; c+=fontW, h++)
+ for (x=0, w=0; w<fontWb; w++)
+ {
+ for (vres=0, mask=0x80; mask && x<fontW; x++, mask>>=1)
+ if (c[x]) vres|=mask;
+ fputc(vres,d);
+ }
+}
+
+void Generate21B5(FILE *df)
+{
+ unsigned val,valV;
+ if (!(val=VerifyAvailable(0x2190,0x21B5,df))) return;
+ if (!(valV=VerifyAvailable(0x2502,0x21B5,df))) return;
+ int w=MeassureVert(valV);
+ unsigned halfW=fontW*3/4-1,qH=fontH/4;
+ u8 *c=LoadChar(val);
+ int h;
+ u8 *d=c;
+ for (h=0; h<fontH; d+=fontW, h++)
+ if (d[halfW]) break;
+ for (; h<fontH; d+=fontW, h++)
+ if (!d[halfW]) break;
+ printf("Generating a replacement for U21B5 Width: %d [%d;%d)\n",w,qH,h);
+
+ FillRect(halfW,0,fontW-1,fontH-1,0,c);
+ FillRect(halfW,qH,halfW+w-1,h-1,1,c);
+ SaveChar(c,df);
+}
+
+void SaveChar(int v, FILE *d)
+{
+ if (v==0xF801)
+ {
+ GenerateF801(d);
+ return;
+ }
+ if (v==0xF803)
+ {
+ GenerateF803(d);
+ return;
+ }
+ // Terminus have wrong 0x2574-0x2577, BTW: it also have wrong 0x2578-0x257B
+ // they aren't the Unicode shapes nor the Linux ones.
+ if (buggyHalfs && v==unicodeTable[0x2574])
+ {
+ Generate2574(d);
+ return;
+ }
+ if (buggyHalfs && v==unicodeTable[0x2575])
+ {
+ Generate2575(d);
+ return;
+ }
+ if (buggyHalfs && v==unicodeTable[0x2576])
+ {
+ Generate2576(d);
+ return;
+ }
+ if (buggyHalfs && v==unicodeTable[0x2577])
+ {
+ Generate2577(d);
+ return;
+ }
+ // What we call 0x2578-0x257B isn't really unicode, just a crazy idea used
+ // in Linux console fonts.
+ if (v && v==unicodeTable[0x2578])
+ {
+ GenerateFake2578(d);
+ return;
+ }
+ if (v && v==unicodeTable[0x2579])
+ {
+ GenerateFake2579(d);
+ return;
+ }
+ if (v && v==unicodeTable[0x257A])
+ {
+ GenerateFake257A(d);
+ return;
+ }
+ if (v && v==unicodeTable[0x257B])
+ {
+ GenerateFake257B(d);
+ return;
+ }
+
+ fseek(f,offShapes+v*sizeChar,SEEK_SET);
+ CopyLines(fontH,d);
+}
+
+void GenSFT(const char *name, bool append)
+{
+ FILE *d;
+ if (append)
+ {
+ d=fopen(name,"r+b");
+ if (!d)
+ {
+ printf("Unable to open %s\n",name);
+ return;
+ }
+ fseek(d,strlen(Signature)+4,SEEK_SET);
+ u32 cant=1;
+ fread(&cant,4,1,d);
+ cant++;
+ fseek(d,strlen(Signature)+4,SEEK_SET);
+ fwrite(&cant,4,1,d);
+ fseek(d,0,SEEK_END);
+ }
+ else
+ {
+ d=fopen(name,"wb");
+ if (!d)
+ {
+ printf("Unable to create %s\n",name);
+ return;
+ }
+ fwrite(Signature,strlen(Signature),1,d);
+ u32 version=2;
+ fwrite(&version,4,1,d);
+ u32 cant=1;
+ fwrite(&cant,4,1,d);
+ u16 len=strlen(Name)+1;
+ fwrite(&len,2,1,d);
+ fputs(Name,d);
+ }
+
+ Font fnt={0,InternalMap[providedUnicodes-1].code,fontH,fontW};
+ fwrite(&fnt,sizeof(fnt),1,d);
+
+ int ant=-1,uni,code,i,tryNext=0;
+ for (i=0; i<providedUnicodes; i++)
+ {
+ code=InternalMap[i].code;
+ if (code==ant && !tryNext) continue;
+ if (code!=ant+1 && !tryNext) printf("%d\n",code);
+ tryNext=0;
+ ant=code;
+ uni=InternalMap[i].unicode;
+ if (uni>=numUnicodes)
+ {
+ if (uni==0xF801 || uni==0xF803)
+ SaveChar(uni,d);
+ else
+ {
+ if (useForUnknown==-1)
+ SaveChar(0,d);
+ else
+ SaveChar(useForUnknown,d);
+ printf("Missing U%04X\n",uni);
+ }
+ }
+ else
+ {
+ int val=unicodeTable[uni];
+ if (val==0xFFFF)
+ {
+ if (code==InternalMap[i+1].code)
+ tryNext=1;
+ else
+ {
+ if (uni==0xF801 || uni==0xF803)
+ SaveChar(uni,d);
+ else if (uni==0x21B5)
+ {
+ Generate21B5(d);
+ }
+ else
+ {
+ SaveChar(0,d);
+ printf("Missing U%04X\n",uni);
+ }
+ }
+ }
+ else
+ SaveChar(val,d);
+ }
+ }
+ fclose(d);
+ #if 0
+ // Terminus font bug
+ printf("U2502 %d\n",unicodeTable[0x2502]);
+ DrawChar(unicodeTable[0x2502]);
+ printf("U2574 %d\n",unicodeTable[0x2574]);
+ DrawChar(unicodeTable[0x2574]);
+ printf("U2575 %d\n",unicodeTable[0x2575]);
+ DrawChar(unicodeTable[0x2575]);
+ printf("U2576 %d\n",unicodeTable[0x2576]);
+ DrawChar(unicodeTable[0x2576]);
+ printf("U2577 %d\n",unicodeTable[0x2577]);
+ DrawChar(unicodeTable[0x2577]);
+ #endif
+}
+
+void DrawChar(int v)
+{
+ SeekChar(v);
+ u8 c[4];
+ unsigned i,j,mask,mask2,val,vres,k;
+
+ for (j=0; j<fontH; j++)
+ {
+ fread(c,4,1,f);
+ for (k=0, i=0; i<4; i++)
+ {
+ val=c[i];
+ for (mask=1; mask<0x100; k++, mask<<=1)
+ {
+ if (val & mask)
+ printf("X");
+ else
+ if (k<fontW)
+ printf(".");
+ }
+ }
+ printf("\n");
+ }
+}
+
+
+const char *tempName="/tmp/.pcf1tempo.pcf";
+
+int ReadPCF(const char *s, const char *sft, bool append)
+{
+ if (strstr(s,".pcf.gz"))
+ {
+ char b[64+strlen(s)];
+ sprintf(b,"gzip -dc %s > %s",s,tempName);
+ system(b);
+ s=tempName;
+ }
+ f=fopen(s,"rb");
+ if (!f)
+ {
+ printf("Error opening %d\n",s);
+ return -1;
+ }
+ u32 magic=ReadU32();
+ if (magic!=PCF1Magic)
+ {
+ printf("Not a PCF1 file (0x%08X)\n",magic);
+ return 2;
+ }
+ u32 sections=ReadU32();
+ if (verboseLevel>1)
+ printf("Contains %d sections\n");
+ u32 i,type,flags,size,offset;
+ u32 offInfo;
+ for (i=0; i<sections; i++)
+ {
+ type=ReadU32();
+ flags=ReadU32();
+ size=ReadU32();
+ offset=ReadU32();
+ if (verboseLevel>1)
+ printf("%d) type 0x%08X flags 0x%08X size 0x%08X offset 0x%08X\n",i,type,flags,size,offset);
+ if (type==typeShapes)
+ offShapes=offset;
+ if (type==typeUnicodes)
+ {
+ offUnicode=offset;
+ numUnicodes=size/2;
+ }
+ if (type==typeInfo)
+ offInfo=offset;
+ }
+ // Information about the font
+ fseek(f,offInfo,SEEK_SET);
+ flags=ReadU32();
+ u32 numDefs=ReadU32();
+ // Each definition is 9 bytes, 4 for the flags, 4 for the number of defs and
+ // 4 for the lenght of the strings. Then pad it to be in a 32 bits pos.
+ u32 offNames=(offInfo+numDefs*9+4+8+3)&(~3);
+ if (verboseLevel>1)
+ printf("%u Attributes (0x%08X)\n",numDefs,offNames);
+ char buf[256];
+ Name[0]=0;
+ int copy,name;
+ for (i=0; i<numDefs; i++)
+ {
+ u32 offName,Val,pos;
+ u8 Type;
+
+ offName=ReadU32();
+ Type=fgetc(f);
+ Val=ReadU32();
+ pos=ftell(f);
+
+ GetName(buf,offNames+offName);
+ //printf("0x%08X\n",offNames+offName);
+ if (verboseLevel>1) printf("%s: ",buf);
+ if (Type)
+ {// Is another string
+ copy=!strcmp(buf,"COPYRIGHT");
+ name=!strncmp(buf,"FAMILY",6) || !strcmp(buf,"WEIGHT_NAME");
+ GetName(buf,offNames+Val);
+ if (verboseLevel>1)
+ printf("%s\n",buf);
+ else
+ if (copy && verboseLevel)
+ printf("Copyright: %s\n",buf);
+ if (name)
+ {
+ if (*Name)
+ {
+ strcat(Name," ");
+ strcat(Name,buf);
+ }
+ else
+ strcpy(Name,buf);
+ }
+ }
+ else
+ {// Is an integer
+ if (verboseLevel>1) printf("%d\n",Val);
+ if (!strcmp(buf,"PIXEL_SIZE")) fontH=Val;
+ if (!strcmp(buf,"QUAD_WIDTH"))
+ {
+ fontW=Val;
+ fontWb=(fontW+7)/8;
+ }
+ }
+ fseek(f,pos,SEEK_SET);
+ //printf("%d) %d %u(%x) %u(%x)\n",i+1,v,v1,v1,v2,v2);
+ }
+ if (!fontH || !fontW)
+ {
+ printf("Unable to find font size\n");
+ return 6;
+ }
+ if (verboseLevel)
+ printf("Font size %ux%u\n",fontW,fontH);
+ sizeChar=4*fontH;
+ // Find the number of shapes:
+ if (!offShapes)
+ {
+ printf("Unable to find the shapes\n");
+ return 3;
+ }
+ fseek(f,offShapes,SEEK_SET);
+ flags=ReadU32();
+ numShapes=ReadU32();
+ offShapes+=8+numShapes*4+16;
+ if (verboseLevel)
+ printf("Found %u shapes\n",numShapes);
+ // Load the unicode table
+ if (!offUnicode)
+ {
+ printf("Unable to find unicode table\n");
+ return 4;
+ }
+ unicodeTable=new u16[numUnicodes];
+ fseek(f,offUnicode+4+10,SEEK_SET);
+ if (fread(unicodeTable,2,numUnicodes,f)!=numUnicodes)
+ {
+ printf("Error reading unicode table\n");
+ return 5;
+ }
+ if (verboseLevel)
+ printf("Loaded unicode table with %u values\n",numUnicodes);
+ // Print them
+ if (verboseLevel>1)
+ {
+ DrawChar(unicodeTable['a']);
+ DrawChar(unicodeTable['A']);
+ }
+ GenSFT(sft,append);
+ fclose(f);
+ delete[] unicodeTable;
+ unlink(tempName);
+}
+
+
+int main(int argc, char *argv[])
+{
+ #if 1
+ useForUnknown=4251;
+ buggyHalfs=0;
+ ReadPCF("10x20.pcf.gz","XFont.sft",false);
+ ReadPCF("9x18.pcf.gz","XFont.sft",true);
+ ReadPCF("9x15.pcf.gz","XFont.sft",true);
+ ReadPCF("7x13.pcf.gz","XFont.sft",true);
+ ReadPCF("6x13.pcf.gz","XFont.sft",true);
+ ReadPCF("6x10.pcf.gz","XFont.sft",true);
+ ReadPCF("5x8.pcf.gz","XFont.sft",true);
+ ReadPCF("5x7.pcf.gz","XFont.sft",true);
+ #endif
+
+ #if 1
+ // Terminus Bold
+ useForUnknown=-1;
+ buggyHalfs=1;
+ ReadPCF("ter-u14b.pcf.gz","BTerminus.sft",false);
+ ReadPCF("ter-u16b.pcf.gz","BTerminus.sft",true);
+ ReadPCF("ter-u20b.pcf.gz","BTerminus.sft",true);
+ // Terminus Regular
+ ReadPCF("ter-u14n.pcf.gz","Terminus.sft",false);
+ ReadPCF("ter-u16n.pcf.gz","Terminus.sft",true);
+ ReadPCF("ter-u20n.pcf.gz","Terminus.sft",true);
+ #endif
+ return 0;
+}
diff --git a/setedit/fonts/intcode.h b/setedit/fonts/intcode.h
new file mode 100644
index 0000000..3271ccf
--- /dev/null
+++ b/setedit/fonts/intcode.h
@@ -0,0 +1,706 @@
+struct stIntCodePairs
+{
+ u16 code,unicode;
+};
+
+stIntCodePairs InternalMap[]=
+{
+ { 0, 0 },
+ { 1, 0x263a },
+ { 2, 0x263b },
+ { 3, 0x2665 },
+ { 3, 0x2764 },
+ { 4, 0x25c6 },
+ { 4, 0x2666 },
+ { 5, 0x2663 },
+ { 6, 0x2660 },
+ { 7, 0x2022 },
+ { 7, 0x2024 },
+ { 7, 0x22c5 },
+ { 8, 0x25d8 },
+ { 8, 0x25e6 },
+ { 9, 0x25cb },
+ { 10, 0x25d9 },
+ { 11, 0x2642 },
+ { 12, 0x2640 },
+ { 13, 0x266a },
+ { 14, 0x266b },
+ { 15, 0x2609 },
+ { 15, 0x263c },
+ { 16, 0x25b6 },
+ { 17, 0x25c0 },
+ { 18, 0x2195 },
+ { 19, 0x203c },
+ { 20, 0x00b6 },
+ { 21, 0x00a7 },
+ { 22, 0x25ac },
+ { 23, 0x21a8 },
+ { 24, 0x2191 },
+ { 25, 0x2193 },
+ { 26, 0x2192 },
+ { 27, 0x2190 },
+ { 28, 0x221f },
+ { 29, 0x2194 },
+ { 30, 0x25b2 },
+ { 31, 0x25bc },
+ { 32, 0x0020 },
+ { 32, 0x2423 },
+ { 33, 0x0021 },
+ { 34, 0x0022 },
+ { 35, 0x0023 },
+ { 36, 0x0024 },
+ { 37, 0x0025 },
+ { 38, 0x0026 },
+ { 39, 0x0027 },
+ { 40, 0x0028 },
+ { 41, 0x0029 },
+ { 42, 0x002a },
+ { 43, 0x002b },
+ { 44, 0x002c },
+ { 45, 0x002d },
+ { 46, 0x002e },
+ { 47, 0x002f },
+ { 48, 0x0030 },
+ { 49, 0x0031 },
+ { 50, 0x0032 },
+ { 51, 0x0033 },
+ { 52, 0x0034 },
+ { 53, 0x0035 },
+ { 54, 0x0036 },
+ { 55, 0x0037 },
+ { 56, 0x0038 },
+ { 57, 0x0039 },
+ { 58, 0x003a },
+ { 59, 0x003b },
+ { 60, 0x003c },
+ { 61, 0x003d },
+ { 62, 0x003e },
+ { 63, 0x003f },
+ { 64, 0x0040 },
+ { 65, 0x0041 },
+ { 65, 0x0391 },
+ { 66, 0x0042 },
+ { 66, 0x0392 },
+ { 66, 0x0412 },
+ { 67, 0x0043 },
+ { 67, 0x0421 },
+ { 68, 0x0044 },
+ { 69, 0x0045 },
+ { 69, 0x0395 },
+ { 69, 0x0415 },
+ { 70, 0x0046 },
+ { 71, 0x0047 },
+ { 72, 0x0048 },
+ { 72, 0x0397 },
+ { 72, 0x041d },
+ { 73, 0x0049 },
+ { 73, 0x0399 },
+ { 74, 0x004a },
+ { 75, 0x004b },
+ { 75, 0x039a },
+ { 75, 0x041a },
+ { 76, 0x004c },
+ { 77, 0x004d },
+ { 77, 0x039c },
+ { 77, 0x041c },
+ { 78, 0x004e },
+ { 78, 0x039d },
+ { 79, 0x004f },
+ { 79, 0x039f },
+ { 79, 0x041e },
+ { 80, 0x0050 },
+ { 80, 0x03a1 },
+ { 80, 0x0420 },
+ { 81, 0x0051 },
+ { 82, 0x0052 },
+ { 83, 0x0053 },
+ { 84, 0x0054 },
+ { 84, 0x03a4 },
+ { 84, 0x0422 },
+ { 85, 0x0055 },
+ { 86, 0x0056 },
+ { 87, 0x0057 },
+ { 88, 0x0058 },
+ { 88, 0x03a7 },
+ { 88, 0x0425 },
+ { 89, 0x0059 },
+ { 89, 0x03a5 },
+ { 90, 0x005a },
+ { 90, 0x0396 },
+ { 91, 0x005b },
+ { 92, 0x005c },
+ { 93, 0x005d },
+ { 94, 0x005e },
+ { 95, 0x005f },
+ { 96, 0x0060 },
+ { 97, 0x0061 },
+ { 97, 0x0430 },
+ { 98, 0x0062 },
+ { 99, 0x0063 },
+ { 99, 0x0441 },
+ { 100, 0x0064 },
+ { 101, 0x0065 },
+ { 101, 0x0435 },
+ { 102, 0x0066 },
+ { 103, 0x0067 },
+ { 104, 0x0068 },
+ { 105, 0x0069 },
+ { 105, 0x0456 },
+ { 106, 0x006a },
+ { 106, 0x0458 },
+ { 107, 0x006b },
+ { 108, 0x006c },
+ { 109, 0x006d },
+ { 110, 0x006e },
+ { 111, 0x006f },
+ { 111, 0x03bf },
+ { 111, 0x043e },
+ { 112, 0x0070 },
+ { 112, 0x0440 },
+ { 113, 0x0071 },
+ { 114, 0x0072 },
+ { 115, 0x0073 },
+ { 115, 0x0455 },
+ { 116, 0x0074 },
+ { 117, 0x0075 },
+ { 118, 0x0076 },
+ { 119, 0x0077 },
+ { 120, 0x0078 },
+ { 120, 0x0445 },
+ { 121, 0x0079 },
+ { 122, 0x007a },
+ { 123, 0x007b },
+ { 124, 0x007c },
+ { 125, 0x007d },
+ { 126, 0x007e },
+ { 127, 0x2302 },
+ { 128, 0x00c7 },
+ { 129, 0x00fc },
+ { 130, 0x00e9 },
+ { 131, 0x00e2 },
+ { 132, 0x00e4 },
+ { 133, 0x00e0 },
+ { 134, 0x00e5 },
+ { 135, 0x00e7 },
+ { 136, 0x00ea },
+ { 137, 0x00eb },
+ { 137, 0x0451 },
+ { 138, 0x00e8 },
+ { 139, 0x00ef },
+ { 139, 0x0457 },
+ { 140, 0x00ee },
+ { 141, 0x00ec },
+ { 142, 0x00c4 },
+ { 143, 0x00c5 },
+ { 144, 0x00c9 },
+ { 145, 0x00e6 },
+ { 146, 0x00c6 },
+ { 147, 0x00f4 },
+ { 148, 0x00f6 },
+ { 149, 0x00f2 },
+ { 150, 0x00fb },
+ { 151, 0x00f9 },
+ { 152, 0x00ff },
+ { 153, 0x00d6 },
+ { 154, 0x00dc },
+ { 155, 0x00a2 },
+ { 156, 0x00a3 },
+ { 157, 0x00a5 },
+ { 158, 0x20a7 },
+ { 159, 0x0192 },
+ { 160, 0x00e1 },
+ { 161, 0x00ed },
+ { 162, 0x00f3 },
+ { 163, 0x00fa },
+ { 164, 0x00f1 },
+ { 165, 0x00d1 },
+ { 166, 0x00aa },
+ { 167, 0x00ba },
+ { 168, 0x00bf },
+ { 169, 0x2310 },
+ { 170, 0x00ac },
+ { 171, 0x00bd },
+ { 172, 0x00bc },
+ { 173, 0x00a1 },
+ { 174, 0x00ab },
+ { 175, 0x00bb },
+ { 176, 0x2591 },
+ { 177, 0x2592 },
+ { 178, 0x2593 },
+ { 179, 0x2502 },
+ { 180, 0x2524 },
+ { 181, 0x2561 },
+ { 182, 0x2562 },
+ { 183, 0x2556 },
+ { 184, 0x2555 },
+ { 185, 0x2563 },
+ { 185, 0x252b },
+ { 186, 0x2551 },
+ { 186, 0x2503 },
+ { 187, 0x2557 },
+ { 187, 0x2513 },
+ { 188, 0x255d },
+ { 188, 0x251b },
+ { 189, 0x255c },
+ { 190, 0x255b },
+ { 191, 0x2510 },
+ { 192, 0x2514 },
+ { 193, 0x2534 },
+ { 194, 0x252c },
+ { 195, 0x251c },
+ { 196, 0x2500 },
+ { 197, 0x253c },
+ { 198, 0x255e },
+ { 199, 0x255f },
+ { 200, 0x255a },
+ { 200, 0x2517 },
+ { 201, 0x2554 },
+ { 201, 0x250f },
+ { 202, 0x2569 },
+ { 202, 0x253b },
+ { 203, 0x2566 },
+ { 203, 0x2533 },
+ { 204, 0x2560 },
+ { 204, 0x2523 },
+ { 205, 0x2550 },
+ { 205, 0x2501 },
+ { 206, 0x256c },
+ { 206, 0x254b },
+ { 207, 0x2567 },
+ { 208, 0x2568 },
+ { 209, 0x2564 },
+ { 210, 0x2565 },
+ { 211, 0x2559 },
+ { 212, 0x2558 },
+ { 213, 0x2552 },
+ { 214, 0x2553 },
+ { 215, 0x256b },
+ { 216, 0x256a },
+ { 217, 0x2518 },
+ { 218, 0x250c },
+ { 219, 0x2588 },
+ { 220, 0x2584 },
+ { 221, 0x258c },
+ { 222, 0x2590 },
+ { 223, 0x2580 },
+ { 224, 0x03b1 },
+ { 225, 0x00df },
+ { 225, 0x03b2 },
+ { 226, 0x0393 },
+ { 227, 0x03c0 },
+ { 228, 0x03a3 },
+ { 229, 0x03c3 },
+ { 230, 0x00b5 },
+ { 230, 0x03bc },
+ { 231, 0x03c4 },
+ { 232, 0x03a6 },
+ { 233, 0x0398 },
+ { 234, 0x03a9 },
+ { 235, 0x03b4 },
+ { 236, 0x221e },
+ { 237, 0x03c6 },
+ { 238, 0x03b5 },
+ { 239, 0x2229 },
+ { 240, 0x2261 },
+ { 241, 0x00b1 },
+ { 242, 0x2265 },
+ { 243, 0x2264 },
+ { 244, 0x2320 },
+ { 245, 0x2321 },
+ { 246, 0x00f7 },
+ { 247, 0x2248 },
+ { 248, 0x00b0 },
+ { 249, 0x2219 },
+ { 250, 0x00b7 },
+ { 251, 0x221a },
+ { 252, 0x207f },
+ { 253, 0x00b2 },
+ { 254, 0x25a0 },
+ { 255, 0x00a0 },
+ { 256, 0x0107 },
+ { 257, 0x013a },
+ { 258, 0x0144 },
+ { 259, 0x0155 },
+ { 260, 0x015b },
+ { 261, 0x00fd },
+ { 262, 0x017a },
+ { 263, 0x00c1 },
+ { 264, 0x0106 },
+ { 265, 0x00cd },
+ { 266, 0x0139 },
+ { 267, 0x0143 },
+ { 268, 0x00d3 },
+ { 269, 0x0154 },
+ { 270, 0x015a },
+ { 271, 0x00da },
+ { 272, 0x00dd },
+ { 273, 0x0179 },
+ { 274, 0x0170 },
+ { 275, 0x00c0 },
+ { 276, 0x00c8 },
+ { 277, 0x00cc },
+ { 278, 0x00d2 },
+ { 279, 0x00d9 },
+ { 280, 0x00cb },
+ { 280, 0x0401 },
+ { 281, 0x00cf },
+ { 281, 0x03aa },
+ { 281, 0x0406 },
+ { 282, 0x016e },
+ { 283, 0x016f },
+ { 284, 0x00e3 },
+ { 285, 0x00f5 },
+ { 286, 0x0171 },
+ { 287, 0x00c3 },
+ { 288, 0x00d5 },
+ { 289, 0x00c2 },
+ { 290, 0x00ca },
+ { 291, 0x00ce },
+ { 292, 0x00d4 },
+ { 293, 0x00db },
+ { 294, 0x010d },
+ { 295, 0x0148 },
+ { 296, 0x0159 },
+ { 297, 0x0161 },
+ { 298, 0x017e },
+ { 299, 0x010c },
+ { 300, 0x010e },
+ { 301, 0x011a },
+ { 302, 0x0147 },
+ { 303, 0x0158 },
+ { 304, 0x0160 },
+ { 305, 0x0164 },
+ { 306, 0x017d },
+ { 307, 0x015f },
+ { 308, 0x0163 },
+ { 309, 0x015e },
+ { 310, 0x0162 },
+ { 311, 0x0105 },
+ { 312, 0x0119 },
+ { 313, 0x0104 },
+ { 314, 0x0118 },
+ { 315, 0x017c },
+ { 316, 0x017b },
+ { 317, 0x0142 },
+ { 318, 0x00f8 },
+ { 319, 0x0141 },
+ { 320, 0x00d8 },
+ { 321, 0x0111 },
+ { 322, 0x00f0 },
+ { 323, 0x00d0 },
+ { 323, 0x0110 },
+ { 324, 0x010f },
+ { 325, 0x013e },
+ { 326, 0x0165 },
+ { 327, 0x013d },
+ { 328, 0x0103 },
+ { 329, 0x0115 },
+ { 330, 0x0102 },
+ { 331, 0x00a4 },
+ { 332, 0x00fe },
+ { 333, 0x00de },
+ { 334, 0x00d7 },
+ { 335, 0x00ae },
+ { 336, 0x00a9 },
+ { 337, 0x0131 },
+ { 338, 0x00a6 },
+ { 339, 0x00af },
+ { 340, 0x00b4 },
+ { 341, 0x00ad },
+ { 342, 0x2017 },
+ { 343, 0x00be },
+ { 344, 0x00b8 },
+ { 345, 0x00a8 },
+ { 346, 0x00b9 },
+ { 347, 0x00b3 },
+ { 348, 0x02dd },
+ { 349, 0x02db },
+ { 350, 0x02c7 },
+ { 351, 0x02d8 },
+ { 352, 0x02d9 },
+ { 353, 0x0151 },
+ { 354, 0x0150 },
+ { 355, 0x013e },
+ { 356, 0x013d },
+ { 357, 0x0165 },
+ { 358, 0x011b },
+ { 359, 0x010f },
+ { 360, 0x0410 },
+ { 361, 0x0411 },
+ { 362, 0x0413 },
+ { 363, 0x0414 },
+ { 364, 0x0416 },
+ { 365, 0x0418 },
+ { 366, 0x0419 },
+ { 367, 0x041b },
+ { 368, 0x041f },
+ { 369, 0x0423 },
+ { 370, 0x0424 },
+ { 371, 0x0426 },
+ { 372, 0x0427 },
+ { 373, 0x0428 },
+ { 374, 0x0429 },
+ { 375, 0x042a },
+ { 376, 0x042b },
+ { 377, 0x042c },
+ { 378, 0x042d },
+ { 379, 0x042e },
+ { 380, 0x042f },
+ { 381, 0x0431 },
+ { 382, 0x0432 },
+ { 383, 0x0433 },
+ { 384, 0x0434 },
+ { 385, 0x0436 },
+ { 386, 0x0437 },
+ { 387, 0x0438 },
+ { 388, 0x0439 },
+ { 389, 0x03ba },
+ { 389, 0x043a },
+ { 390, 0x043b },
+ { 391, 0x043c },
+ { 392, 0x043d },
+ { 393, 0x043f },
+ { 394, 0x0442 },
+ { 395, 0x0443 },
+ { 396, 0x0444 },
+ { 397, 0x0446 },
+ { 398, 0x0447 },
+ { 399, 0x0448 },
+ { 400, 0x0449 },
+ { 401, 0x044a },
+ { 402, 0x044b },
+ { 403, 0x044c },
+ { 404, 0x044d },
+ { 405, 0x044e },
+ { 406, 0x044f },
+ { 407, 0x0404 },
+ { 408, 0x0454 },
+ { 409, 0x0417 },
+ { 410, 0x045e },
+ { 411, 0x2116 },
+ { 412, 0x0402 },
+ { 413, 0x0452 },
+ { 414, 0x0403 },
+ { 415, 0x0453 },
+ { 416, 0x0407 },
+ { 417, 0x0409 },
+ { 418, 0x0459 },
+ { 419, 0x040a },
+ { 420, 0x045a },
+ { 421, 0x040b },
+ { 422, 0x045b },
+ { 423, 0x040c },
+ { 424, 0x045c },
+ { 425, 0x040e },
+ { 426, 0x045e },
+ { 427, 0x040f },
+ { 428, 0x045f },
+ { 429, 0x201e },
+ { 430, 0x2026 },
+ { 431, 0x2020 },
+ { 432, 0x2021 },
+ { 433, 0x2030 },
+ { 434, 0x201c },
+ { 435, 0x201d },
+ { 436, 0x2122 },
+ { 437, 0x0490 },
+ { 438, 0x0491 },
+ { 439, 0xfffd },
+ { 440, 0x0152 },
+ { 441, 0x0153 },
+ { 442, 0x2409 },
+ { 443, 0x240c },
+ { 444, 0x240d },
+ { 445, 0x240a },
+ { 446, 0x2424 },
+ { 447, 0x240b },
+ { 448, 0x2260 },
+ { 449, 0x21b5 },
+ { 450, 0x0178 },
+ { 450, 0x03ab },
+ { 451, 0xf801 },
+ { 452, 0x2575 },
+ { 453, 0x2576 },
+ { 454, 0x2577 },
+ { 455, 0x2574 },
+ { 456, 0xf803 },
+ { 457, 0x2579 },
+ { 458, 0x257a },
+ { 459, 0x257b },
+ { 460, 0x2578 },
+ { 461, 0x0138 },
+ { 462, 0x014a },
+ { 463, 0x014b },
+ { 464, 0x0108 },
+ { 465, 0x0109 },
+ { 466, 0x011c },
+ { 467, 0x011d },
+ { 468, 0x0124 },
+ { 469, 0x0125 },
+ { 470, 0x0134 },
+ { 471, 0x0135 },
+ { 472, 0x015c },
+ { 473, 0x015d },
+ { 474, 0x0174 },
+ { 475, 0x0175 },
+ { 476, 0x0176 },
+ { 477, 0x0177 },
+ { 478, 0x1e02 },
+ { 479, 0x1e03 },
+ { 480, 0x010a },
+ { 481, 0x010b },
+ { 482, 0x1e0a },
+ { 483, 0x1e0b },
+ { 484, 0x1e1e },
+ { 485, 0x1e1f },
+ { 486, 0x0121 },
+ { 487, 0x0130 },
+ { 488, 0x1e40 },
+ { 489, 0x1e41 },
+ { 490, 0x1e56 },
+ { 491, 0x1e57 },
+ { 492, 0x1e60 },
+ { 493, 0x1e61 },
+ { 494, 0x1e6a },
+ { 495, 0x1e6b },
+ { 496, 0x0112 },
+ { 497, 0x0113 },
+ { 498, 0x012a },
+ { 499, 0x012b },
+ { 500, 0x014c },
+ { 501, 0x014d },
+ { 502, 0x016a },
+ { 503, 0x016b },
+ { 504, 0x011e },
+ { 505, 0x011f },
+ { 506, 0x012c },
+ { 507, 0x012d },
+ { 508, 0x016c },
+ { 509, 0x016d },
+ { 510, 0x0122 },
+ { 511, 0x0123 },
+ { 512, 0x0136 },
+ { 513, 0x0137 },
+ { 514, 0x0145 },
+ { 515, 0x0146 },
+ { 516, 0x0156 },
+ { 517, 0x0157 },
+ { 518, 0x0128 },
+ { 519, 0x0129 },
+ { 520, 0x0168 },
+ { 521, 0x0169 },
+ { 522, 0x012e },
+ { 523, 0x012f },
+ { 524, 0x0172 },
+ { 525, 0x0173 },
+ { 526, 0x1e80 },
+ { 527, 0x1e81 },
+ { 528, 0x1ef2 },
+ { 529, 0x1ef3 },
+ { 530, 0x1e82 },
+ { 531, 0x1e83 },
+ { 532, 0x1e84 },
+ { 533, 0x1e85 },
+ { 534, 0x0126 },
+ { 535, 0x0127 },
+ { 536, 0x0166 },
+ { 537, 0x0167 },
+ { 538, 0x01a0 },
+ { 539, 0x01a1 },
+ { 540, 0x01af },
+ { 541, 0x01b0 },
+ { 542, 0x0116 },
+ { 543, 0x0117 },
+ { 544, 0x013b },
+ { 545, 0x013c },
+ { 546, 0x03b3 },
+ { 547, 0x03b6 },
+ { 548, 0x03b7 },
+ { 549, 0x03b8 },
+ { 550, 0x03b9 },
+ { 551, 0x03bb },
+ { 552, 0x03bd },
+ { 553, 0x03be },
+ { 554, 0x03c1 },
+ { 555, 0x03c2 },
+ { 556, 0x03c5 },
+ { 557, 0x03c7 },
+ { 558, 0x03c8 },
+ { 559, 0x03c9 },
+ { 560, 0x0394 },
+ { 561, 0x039e },
+ { 562, 0x03a0 },
+ { 563, 0x03a8 },
+ { 564, 0x0385 },
+ { 565, 0x03ac },
+ { 566, 0x03ad },
+ { 567, 0x03ae },
+ { 568, 0x03af },
+ { 569, 0x03cc },
+ { 570, 0x03cd },
+ { 571, 0x03ce },
+ { 572, 0x0386 },
+ { 573, 0x0388 },
+ { 574, 0x0389 },
+ { 575, 0x038a },
+ { 576, 0x038c },
+ { 577, 0x038e },
+ { 578, 0x038f },
+ { 579, 0x03ca },
+ { 580, 0x03cb },
+ { 581, 0x0390 },
+ { 582, 0x03b0 },
+ { 583, 0x039b },
+ { 584, 0x0101 },
+ { 585, 0x0100 },
+ { 586, 0x0120 },
+ { 587, 0x20ac },
+ { 588, 0x0412 },
+ { 589, 0x0415 },
+ { 590, 0x041A },
+ { 591, 0x041C },
+ { 592, 0x041D },
+ { 593, 0x041E },
+ { 594, 0x0420 },
+ { 595, 0x0421 },
+ { 596, 0x0422 },
+ { 597, 0x0425 },
+ { 598, 0x0430 },
+ { 599, 0x0435 },
+ { 600, 0x043E },
+ { 601, 0x0440 },
+ { 602, 0x0441 },
+ { 603, 0x0445 },
+ { 604, 0x0451 },
+ { 605, 0x0401 },
+ { 606, 0x0455 },
+ { 607, 0x0456 },
+ { 608, 0x0457 },
+ { 609, 0x0458 },
+ { 610, 0x0406 },
+ { 611, 0x0408 },
+ { 612, 0x0405 },
+ { 613, 0x03B2 },
+ { 614, 0x03BA },
+ { 615, 0x03BC },
+ { 616, 0x03BF },
+ { 617, 0x0391 },
+ { 618, 0x0392 },
+ { 619, 0x0395 },
+ { 620, 0x0396 },
+ { 621, 0x0397 },
+ { 622, 0x0399 },
+ { 623, 0x039A },
+ { 624, 0x039C },
+ { 625, 0x039D },
+ { 626, 0x039F },
+ { 627, 0x03A1 },
+ { 628, 0x03A4 },
+ { 629, 0x03A5 },
+ { 630, 0x03A7 },
+ { 631, 0x03AA },
+ { 632, 0x03AB }
+};
+
+const int providedUnicodes=sizeof(InternalMap)/sizeof(stIntCodePairs);
+
diff --git a/setedit/fonts/let.txt b/setedit/fonts/let.txt
new file mode 100644
index 0000000..56e96db
--- /dev/null
+++ b/setedit/fonts/let.txt
@@ -0,0 +1,668 @@
+ 00 <U0000> Free
+ 01 <U263a>  WHITE SMILING FACE = have a nice day!
+ 02 <U263b>  BLACK SMILING FACE
+ 03 <U2665>  BLACK HEART SUIT = valentine [Rel: 2764 HEAVY BLACK HEART]
+ 04 <U2666>  BLACK DIAMOND SUIT [Rel: 25C6 BLACK DIAMOND]
+ 05 <U2663>  BLACK CLUB SUIT = shamrock
+ 06 <U2660>  BLACK SPADE SUIT
+ 07 <U2022>  BULLET [Rel: middle dot - 00B7, one dot leader - 2024, bullet operator - 2219, dot operator - 22C5]
+ 08 <U25d8>  INVERSE BULLET [Rel: white bullet - 25E6]
+ 09 <U25cb> WHITE CIRCLE
+ 0a <U25d9> INVERSE WHITE CIRCLE
+ 0b <U2642> MALE SIGN = Mars
+ 0c <U2640> FEMALE SIGN = Venus
+ 0d <U266a> EIGHTH NOTE
+ 0e <U266b>  BEAMED EIGHTH NOTES
+ 0f <U263c>  WHITE SUN WITH RAYS = compass [Rel: sun - 2609]
+ 10 <U25b6>  BLACK RIGHT-POINTING TRIANGLE
+ 11 <U25c0>  BLACK LEFT-POINTING TRIANGLE
+ 12 <U2195>  UP DOWN ARROW
+ 13 <U203c>  DOUBLE EXCLAMATION MARK
+ 14 <U00b6>  PILCROW SIGN = PARAGRAPH SIGN * section sign in some European usage
+ 15 <U00a7>  SECTION SIGN * paragraph sign in some European usage
+ 16 <U25ac>  BLACK RECTANGLE
+ 17 <U21a8>  UP DOWN ARROW WITH BASE
+ 18 <U2191>  UPWARDS ARROW
+ 19 <U2193>  DOWNWARDS ARROW
+ 1a <U2192> RIGHTWARDS ARROW
+ 1b <U2190>  LEFTWARDS ARROW
+ 1c <U221f>  RIGHT ANGLE
+ 1d <U2194>  LEFT RIGHT ARROW
+ 1e <U25b2>  BLACK UP-POINTING TRIANGLE
+ 1f <U25bc>  BLACK DOWN-POINTING TRIANGLE
+<SP> 20 <U0020> SPACE
+<!> 21 <U0021> EXCLAMATION MARK
+<"> 22 <U0022> QUOTATION MARK
+<Nb> 23 <U0023> NUMBER SIGN
+<DO> 24 <U0024> DOLLAR SIGN
+<%> 25 <U0025> PERCENT SIGN
+<&> 26 <U0026> AMPERSAND
+<'> 27 <U0027> APOSTROPHE
+<(> 28 <U0028> LEFT PARENTHESIS
+<)> 29 <U0029> RIGHT PARENTHESIS
+<*> 2A <U002A> ASTERISK
+<+> 2B <U002B> PLUS SIGN
+<,> 2C <U002C> COMMA
+<-> 2D <U002D> HYPHEN-MINUS
+<.> 2E <U002E> FULL STOP
+<//> 2F <U002F> SOLIDUS
+<0> 30 <U0030> DIGIT ZERO
+<1> 31 <U0031> DIGIT ONE
+<2> 32 <U0032> DIGIT TWO
+<3> 33 <U0033> DIGIT THREE
+<4> 34 <U0034> DIGIT FOUR
+<5> 35 <U0035> DIGIT FIVE
+<6> 36 <U0036> DIGIT SIX
+<7> 37 <U0037> DIGIT SEVEN
+<8> 38 <U0038> DIGIT EIGHT
+<9> 39 <U0039> DIGIT NINE
+<:> 3A <U003A> COLON
+<;> 3B <U003B> SEMICOLON
+<<> 3C <U003C> LESS-THAN SIGN
+<=> 3D <U003D> EQUALS SIGN
+</>> 3E <U003E> GREATER-THAN SIGN
+<?> 3F <U003F> QUESTION MARK
+<At> 40 <U0040> COMMERCIAL AT
+<A> 41 <U0041> LATIN CAPITAL LETTER A
+<B> 42 <U0042> LATIN CAPITAL LETTER B
+<C> 43 <U0043> LATIN CAPITAL LETTER C
+<D> 44 <U0044> LATIN CAPITAL LETTER D
+<E> 45 <U0045> LATIN CAPITAL LETTER E
+<F> 46 <U0046> LATIN CAPITAL LETTER F
+<G> 47 <U0047> LATIN CAPITAL LETTER G
+<H> 48 <U0048> LATIN CAPITAL LETTER H
+<I> 49 <U0049> LATIN CAPITAL LETTER I
+<J> 4A <U004A> LATIN CAPITAL LETTER J
+<K> 4B <U004B> LATIN CAPITAL LETTER K
+<L> 4C <U004C> LATIN CAPITAL LETTER L
+<M> 4D <U004D> LATIN CAPITAL LETTER M
+<N> 4E <U004E> LATIN CAPITAL LETTER N
+<O> 4F <U004F> LATIN CAPITAL LETTER O
+<P> 50 <U0050> LATIN CAPITAL LETTER P
+<Q> 51 <U0051> LATIN CAPITAL LETTER Q
+<R> 52 <U0052> LATIN CAPITAL LETTER R
+<S> 53 <U0053> LATIN CAPITAL LETTER S
+<T> 54 <U0054> LATIN CAPITAL LETTER T
+<U> 55 <U0055> LATIN CAPITAL LETTER U
+<V> 56 <U0056> LATIN CAPITAL LETTER V
+<W> 57 <U0057> LATIN CAPITAL LETTER W
+<X> 58 <U0058> LATIN CAPITAL LETTER X
+<Y> 59 <U0059> LATIN CAPITAL LETTER Y
+<Z> 5A <U005A> LATIN CAPITAL LETTER Z
+<<(> 5B <U005B> LEFT SQUARE BRACKET
+<////> 5C <U005C> REVERSE SOLIDUS
+<)/>> 5D <U005D> RIGHT SQUARE BRACKET
+<'/>> 5E <U005E> CIRCUMFLEX ACCENT
+<_> 5F <U005F> LOW LINE
+<'!> 60 <U0060> GRAVE ACCENT
+<a> 61 <U0061> LATIN SMALL LETTER A
+<b> 62 <U0062> LATIN SMALL LETTER B
+<c> 63 <U0063> LATIN SMALL LETTER C
+<d> 64 <U0064> LATIN SMALL LETTER D
+<e> 65 <U0065> LATIN SMALL LETTER E
+<f> 66 <U0066> LATIN SMALL LETTER F
+<g> 67 <U0067> LATIN SMALL LETTER G
+<h> 68 <U0068> LATIN SMALL LETTER H
+<i> 69 <U0069> LATIN SMALL LETTER I
+<j> 6A <U006A> LATIN SMALL LETTER J
+<k> 6B <U006B> LATIN SMALL LETTER K
+<l> 6C <U006C> LATIN SMALL LETTER L
+<m> 6D <U006D> LATIN SMALL LETTER M
+<n> 6E <U006E> LATIN SMALL LETTER N
+<o> 6F <U006F> LATIN SMALL LETTER O
+<p> 70 <U0070> LATIN SMALL LETTER P
+<q> 71 <U0071> LATIN SMALL LETTER Q
+<r> 72 <U0072> LATIN SMALL LETTER R
+<s> 73 <U0073> LATIN SMALL LETTER S
+<t> 74 <U0074> LATIN SMALL LETTER T
+<u> 75 <U0075> LATIN SMALL LETTER U
+<v> 76 <U0076> LATIN SMALL LETTER V
+<w> 77 <U0077> LATIN SMALL LETTER W
+<x> 78 <U0078> LATIN SMALL LETTER X
+<y> 79 <U0079> LATIN SMALL LETTER Y
+<z> 7A <U007A> LATIN SMALL LETTER Z
+<(!> 7B <U007B> LEFT CURLY BRACKET
+<!!> 7C <U007C> VERTICAL LINE
+<!)> 7D <U007D> RIGHT CURLY BRACKET
+<'?> 7E <U007E> TILDE
+<DT> 7F <U2302>  HOUSE
+<C,> 80 <U00C7> LATIN CAPITAL LETTER C WITH CEDILLA
+<u:> 81 <U00FC> LATIN SMALL LETTER U WITH DIAERESIS
+<e'> 82 <U00E9> LATIN SMALL LETTER E WITH ACUTE
+<a/>> 83 <U00E2> LATIN SMALL LETTER A WITH CIRCUMFLEX
+<a:> 84 <U00E4> LATIN SMALL LETTER A WITH DIAERESIS
+<a!> 85 <U00E0> LATIN SMALL LETTER A WITH GRAVE
+<aa> 86 <U00E5> LATIN SMALL LETTER A WITH RING ABOVE
+<c,> 87 <U00E7> LATIN SMALL LETTER C WITH CEDILLA
+<e/>> 88 <U00EA> LATIN SMALL LETTER E WITH CIRCUMFLEX
+<e:> 89 <U00EB> LATIN SMALL LETTER E WITH DIAERESIS
+<e!> 8A <U00E8> LATIN SMALL LETTER E WITH GRAVE
+<i:> 8B <U00EF> LATIN SMALL LETTER I WITH DIAERESIS
+<i/>> 8C <U00EE> LATIN SMALL LETTER I WITH CIRCUMFLEX
+<i!> 8D <U00EC> LATIN SMALL LETTER I WITH GRAVE
+<A:> 8E <U00C4> LATIN CAPITAL LETTER A WITH DIAERESIS
+<AA> 8F <U00C5> LATIN CAPITAL LETTER A WITH RING ABOVE
+<E'> 90 <U00C9> LATIN CAPITAL LETTER E WITH ACUTE
+<ae> 91 <U00E6> LATIN SMALL LETTER AE
+<AE> 92 <U00C6> LATIN CAPITAL LETTER AE
+<o/>> 93 <U00F4> LATIN SMALL LETTER O WITH CIRCUMFLEX
+<o:> 94 <U00F6> LATIN SMALL LETTER O WITH DIAERESIS
+<o!> 95 <U00F2> LATIN SMALL LETTER O WITH GRAVE
+<u/>> 96 <U00FB> LATIN SMALL LETTER U WITH CIRCUMFLEX
+<u!> 97 <U00F9> LATIN SMALL LETTER U WITH GRAVE
+<y:> 98 <U00FF> LATIN SMALL LETTER Y WITH DIAERESIS
+<O:> 99 <U00D6> LATIN CAPITAL LETTER O WITH DIAERESIS
+<U:> 9A <U00DC> LATIN CAPITAL LETTER U WITH DIAERESIS
+<Ct> 9B <U00A2> CENT SIGN
+<Pd> 9C <U00A3> POUND SIGN
+<Ye> 9D <U00A5> YEN SIGN
+<Pt> 9E <U20A7> PESETA SIGN
+<f2> 9F <U0192> LATIN SMALL LETTER F WITH HOOK
+<a'> A0 <U00E1> LATIN SMALL LETTER A WITH ACUTE
+<i'> A1 <U00ED> LATIN SMALL LETTER I WITH ACUTE
+<o'> A2 <U00F3> LATIN SMALL LETTER O WITH ACUTE
+<u'> A3 <U00FA> LATIN SMALL LETTER U WITH ACUTE
+<n?> A4 <U00F1> LATIN SMALL LETTER N WITH TILDE
+<N?> A5 <U00D1> LATIN CAPITAL LETTER N WITH TILDE
+<-a> A6 <U00AA> FEMININE ORDINAL INDICATOR
+<-o> A7 <U00BA> MASCULINE ORDINAL INDICATOR
+<?I> A8 <U00BF> INVERTED QUESTION MARK
+<NI> A9 <U2310> REVERSED NOT SIGN = = beginning of line
+<NO> AA <U00AC> NOT SIGN
+<12> AB <U00BD> VULGAR FRACTION ONE HALF
+<14> AC <U00BC> VULGAR FRACTION ONE QUARTER
+<!I> AD <U00A1> INVERTED EXCLAMATION MARK
+<<<> AE <U00AB> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+</>/>> AF <U00BB> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+<.S> B0 <U2591> LIGHT SHADE
+<:S> B1 <U2592> MEDIUM SHADE
+<?S> B2 <U2593> DARK SHADE
+<vv> B3 <U2502> BOX DRAWINGS LIGHT VERTICAL
+<vl> B4 <U2524> BOX DRAWINGS LIGHT VERTICAL AND LEFT
+<vL> B5 <U2561> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+<Vl> B6 <U2562> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+<Dl> B7 <U2556> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+<dL> B8 <U2555> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+<VL> B9 <U2563> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+<VV> BA <U2551> BOX DRAWINGS DOUBLE VERTICAL
+<LD> BB <U2557> BOX DRAWINGS DOUBLE DOWN AND LEFT
+<UL> BC <U255D> BOX DRAWINGS DOUBLE UP AND LEFT
+<Ul> BD <U255C> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+<uL> BE <U255B> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+<dl> BF <U2510> BOX DRAWINGS LIGHT DOWN AND LEFT
+<ur> C0 <U2514> BOX DRAWINGS LIGHT UP AND RIGHT
+<uh> C1 <U2534> BOX DRAWINGS LIGHT UP AND HORIZONTAL
+<dh> C2 <U252C> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+<vr> C3 <U251C> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+<hh> C4 <U2500> BOX DRAWINGS LIGHT HORIZONTAL
+<vh> C5 <U253C> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+<vR> C6 <U255E> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+<Vr> C7 <U255F> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+<UR> C8 <U255A> BOX DRAWINGS DOUBLE UP AND RIGHT
+<DR> C9 <U2554> BOX DRAWINGS DOUBLE DOWN AND RIGHT
+<UH> CA <U2569> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+<DH> CB <U2566> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+<VR> CC <U2560> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+<HH> CD <U2550> BOX DRAWINGS DOUBLE HORIZONTAL
+<VH> CE <U256C> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+<uH> CF <U2567> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+<Uh> D0 <U2568> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+<dH> D1 <U2564> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+<Dh> D2 <U2565> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+<Ur> D3 <U2559> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+<uR> D4 <U2558> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+<dR> D5 <U2552> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+<Dr> D6 <U2553> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+<Vh> D7 <U256B> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+<vH> D8 <U256A> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+<ul> D9 <U2518> BOX DRAWINGS LIGHT UP AND LEFT
+<dr> DA <U250C> BOX DRAWINGS LIGHT DOWN AND RIGHT
+<FB> DB <U2588> FULL BLOCK
+<LB> DC <U2584> LOWER HALF BLOCK
+<lB> DD <U258C> LEFT HALF BLOCK
+<RB> DE <U2590> RIGHT HALF BLOCK
+<TB> DF <U2580> UPPER HALF BLOCK
+<a*> E0 <U03B1> GREEK SMALL LETTER ALPHA
+<ss> E1 <U00DF> LATIN SMALL LETTER SHARP S (German) [Rel: 03B2 Small greek beta]
+<G*> E2 <U0393> GREEK CAPITAL LETTER GAMMA
+<p*> E3 <U03C0> GREEK SMALL LETTER PI
+<S*> E4 <U03A3> GREEK CAPITAL LETTER SIGMA
+<s*> E5 <U03C3> GREEK SMALL LETTER SIGMA
+<My> E6 <U00B5> MICRO SIGN
+<t*> E7 <U03C4> GREEK SMALL LETTER TAU
+<F*> E8 <U03A6> GREEK CAPITAL LETTER PHI
+<H*> E9 <U0398> GREEK CAPITAL LETTER THETA
+<W*> EA <U03A9> GREEK CAPITAL LETTER OMEGA
+<d*> EB <U03B4> GREEK SMALL LETTER DELTA
+<00> EC <U221E> INFINITY
+<f*> ED <U03C6> GREEK SMALL LETTER PHI
+<e*> EE <U03B5> GREEK SMALL LETTER EPSILON
+<(U> EF <U2229> INTERSECTION
+<=3> F0 <U2261> IDENTICAL TO
+<+-> F1 <U00B1> PLUS-MINUS SIGN
+</>=> F2 <U2265> GREATER-THAN OR EQUAL TO
+<=<> F3 <U2264> LESS-THAN OR EQUAL TO
+<Iu> F4 <U2320> TOP HALF INTEGRAL
+<Il> F5 <U2321> BOTTOM HALF INTEGRAL
+<-:> F6 <U00F7> DIVISION SIGN
+<?2> F7 <U2248> ALMOST EQUAL TO
+<DG> F8 <U00B0> DEGREE SIGN
+<.M> F9 <U2219> BULLET
+<sb> FA <U00B7> MIDDLE DOT [Rel: 2219 = BULLET OPERATOR]
+<RT> FB <U221A> SQUARE ROOT
+<nS> FC <U207F> SUPERSCRIPT LATIN SMALL LETTER N
+<2S> FD <U00B2> SUPERSCRIPT TWO
+<fS> FE <U25A0> BLACK SQUARE
+<NS> FF <U00A0> NO-BREAK SPACE
+<c'> 100 <U0107> LATIN SMALL LETTER C WITH ACUTE
+<l'> 101 <U013A> LATIN SMALL LETTER L WITH ACUTE
+<n'> 102 <U0144> LATIN SMALL LETTER N WITH ACUTE
+<r'> 103 <U0155> LATIN SMALL LETTER R WITH ACUTE
+<s'> 104 <U015B> LATIN SMALL LETTER S WITH ACUTE
+<y'> 105 <U00FD> LATIN SMALL LETTER Y WITH ACUTE
+<z'> 106 <U017A> LATIN SMALL LETTER Z WITH ACUTE
+<A'> 107 <U00C1> LATIN CAPITAL LETTER A WITH ACUTE
+<C'> 108 <U0106> LATIN CAPITAL LETTER C WITH ACUTE
+<I'> 109 <U00CD> LATIN CAPITAL LETTER I WITH ACUTE
+<L'> 10A <U0139> LATIN CAPITAL LETTER L WITH ACUTE
+<N'> 10B <U0143> LATIN CAPITAL LETTER N WITH ACUTE
+<O'> 10C <U00D3> LATIN CAPITAL LETTER O WITH ACUTE
+<R'> 10D <U0154> LATIN CAPITAL LETTER R WITH ACUTE
+<S'> 10E <U015A> LATIN CAPITAL LETTER S WITH ACUTE
+<U'> 10F <U00DA> LATIN CAPITAL LETTER U WITH ACUTE
+<Y'> 110 <U00DD> LATIN CAPITAL LETTER Y WITH ACUTE
+<Z'> 111 <U0179> LATIN CAPITAL LETTER Z WITH ACUTE
+<U"> 112 <U0170> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+<A!> 113 <U00C0> LATIN CAPITAL LETTER A WITH GRAVE
+<E!> 114 <U00C8> LATIN CAPITAL LETTER E WITH GRAVE
+<I!> 115 <U00CC> LATIN CAPITAL LETTER I WITH GRAVE
+<O!> 116 <U00D2> LATIN CAPITAL LETTER O WITH GRAVE
+<U!> 117 <U00D9> LATIN CAPITAL LETTER U WITH GRAVE
+<E:> 118 <U00CB> LATIN CAPITAL LETTER E WITH DIAERESIS (UMLAUT)
+<I:> 119 <U00CF> LATIN CAPITAL LETTER I WITH DIAERESIS
+<U0> 11A <U016E> LATIN CAPITAL LETTER U WITH RING ABOVE
+<u0> 11B <U016F> LATIN SMALL LETTER U WITH RING ABOVE
+<a?> 11C <U00E3> LATIN SMALL LETTER A WITH TILDE (~)
+<o?> 11D <U00F5> LATIN SMALL LETTER O WITH TILDE
+<u"> 11E <U0171> LATIN SMALL LETTER U WITH DOUBLE ACUTE
+<A?> 11F <U00C3> LATIN CAPITAL LETTER A WITH TILDE
+<O?> 120 <U00D5> LATIN CAPITAL LETTER O WITH TILDE
+<A/>> 121 <U00C2> LATIN CAPITAL LETTER A WITH CIRCUMFLEX (^)
+<E/>> 122 <U00CA> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+<I/>> 123 <U00CE> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+<O/>> 124 <U00D4> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+<U/>> 125 <U00DB> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+<c<> 126 <U010D> LATIN SMALL LETTER C WITH CARON (A v over the letter)
+<n<> 127 <U0148> LATIN SMALL LETTER N WITH CARON
+<r<> 128 <U0159> LATIN SMALL LETTER R WITH CARON
+<s<> 129 <U0161> LATIN SMALL LETTER S WITH CARON
+<z<> 12A <U017E> LATIN SMALL LETTER Z WITH CARON
+<C<> 12B <U010C> LATIN CAPITAL LETTER C WITH CARON
+<D<> 12C <U010E> LATIN CAPITAL LETTER D WITH CARON
+<E<> 12D <U011A> LATIN CAPITAL LETTER E WITH CARON
+<N<> 12E <U0147> LATIN CAPITAL LETTER N WITH CARON
+<R<> 12F <U0158> LATIN CAPITAL LETTER R WITH CARON
+<S<> 130 <U0160> LATIN CAPITAL LETTER S WITH CARON
+<T<> 131 <U0164> LATIN CAPITAL LETTER T WITH CARON
+<Z<> 132 <U017D> LATIN CAPITAL LETTER Z WITH CARON
+<s,> 133 <U015F> LATIN SMALL LETTER S WITH CEDILLA
+<t,> 134 <U0163> LATIN SMALL LETTER T WITH CEDILLA
+<S,> 135 <U015E> LATIN CAPITAL LETTER S WITH CEDILLA
+<T,> 136 <U0162> LATIN CAPITAL LETTER T WITH CEDILLA
+<a;> 137 <U0105> LATIN SMALL LETTER A WITH OGONEK (inverted cedilla)
+<e;> 138 <U0119> LATIN SMALL LETTER E WITH OGONEK
+<A;> 139 <U0104> LATIN CAPITAL LETTER A WITH OGONEK
+<E;> 13A <U0118> LATIN CAPITAL LETTER E WITH OGONEK
+<z.> 13B <U017C> LATIN SMALL LETTER Z WITH DOT ABOVE
+<Z.> 13C <U017B> LATIN CAPITAL LETTER Z WITH DOT ABOVE
+<l//> 13D <U0142> LATIN SMALL LETTER L WITH STROKE (/)
+<o//> 13E <U00F8> LATIN SMALL LETTER O WITH STROKE
+<L//> 13F <U0141> LATIN CAPITAL LETTER L WITH STROKE
+<O//> 140 <U00D8> LATIN CAPITAL LETTER O WITH STROKE
+<d//> 141 <U0111> LATIN SMALL D WITH STROKE (d horizontal stroke)
+<d*> 142 <U00F0> LATIN SMALL LETTER ETH
+<D//> 143 <U00D0> LATIN CAPITAL LETTER ETH also: <U0110> LATIN CAPITAL D WITH STROKE (D horizontal stroke)
+<d<> 144 <U010F> LATIN SMALL LETTER D WITH CARON (The caron looks like an apostrophe some times)
+<l<> 145 <U013E> LATIN SMALL LETTER L WITH CARON (The caron looks like an apostrophe some times)
+<t<> 146 <U0165> LATIN SMALL LETTER T WITH CARON (The caron looks like an apostrophe some times)
+<L<> 147 <U013D> LATIN CAPITAL LETTER L WITH CARON (The caron looks like an apostrophe some times)
+<a(> 148 <U0103> LATIN SMALL LETTER A WITH BREVE (u over the letter)
+<e(> 149 <U0115> LATIN SMALL LETTER E WITH BREVE
+<A(> 14A <U0102> LATIN CAPITAL LETTER A WITH BREVE
+<Cu> 14B <U00A4> CURRENCY SIGN (o four feets)
+<th> 14C <U00FE> LATIN SMALL LETTER THORN (Icelandic) (Thorn high)
+<TH> 14D <U00DE> LATIN CAPITAL LETTER THORN (Icelandic) (Thorn low)
+<*X> 14E <U00D7> MULTIPLICATION SIGN
+<Rg> 14F <U00AE> REGISTERED SIGN (R)
+<Co> 150 <U00A9> COPYRIGHT SIGN (c)
+<i.> 151 <U0131> LATIN SMALL LETTER DOTLESS I
+<BB> 152 <U00A6> BROKEN BAR (|)
+<'m> 153 <U00AF> MACRON (_ but high)
+<''> 154 <U00B4> ACUTE ACCENT
+<--> 155 <U00AD> SOFT HYPHEN (- long)
+<=2> 156 <U2017> DOUBLE LOW LINE (_ double)
+<34> 157 <U00BE> VULGAR FRACTION THREE QUARTERS
+<',> 158 <U00B8> CEDILLA
+<':> 159 <U00A8> DIAERESIS (diresis, umlaut)
+<1S> 15A <U00B9> SUPERSCRIPT ONE
+<3S> 15B <U00B3> SUPERSCRIPT THREE
+<'"> 15C <U02DD> DOUBLE ACUTE ACCENT
+<';> 15D <U02DB> OGONEK (cedilla inv.)
+<'<> 15E <U02C7> CARON (Mandarin Chinese third tone)
+<'(> 15F <U02D8> BREVE
+<'.> 160 <U02D9> DOT ABOVE (Mandarin Chinese light tone)
+<o"> 161 <U0151> LATIN SMALL LETTER O WITH DOUBLE ACUTE
+<O"> 162 <U0150> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+<l<> 163 <U013E> LATIN SMALL LETTER L WITH CARON (that's the other way to draw tcaron, like a v, not ')
+<L<> 164 <U013D> LATIN CAPITAL LETTER L WITH CARON (that's the other way to draw tcaron, like a v, not ')
+<t<> 165 <U0165> LATIN SMALL LETTER T WITH CARON (that's the other way to draw tcaron, like a v, not ')
+<e<> 166 <U011B> LATIN SMALL LETTER E WITH CARON
+<d<> 167 <U010F> LATIN SMALL LETTER D WITH CARON (that's the other way to draw tcaron, like a v, not ')
+<A=> 168 <U0410> CYRILLIC CAPITAL LETTER A () [Examples in ISO-5]
+<B=> 169 <U0411> CYRILLIC CAPITAL LETTER BE ()
+<G=> 16A <U0413> CYRILLIC CAPITAL LETTER GHE ()
+<D=> 16B <U0414> CYRILLIC CAPITAL LETTER DE ()
+<Z%> 16C <U0416> CYRILLIC CAPITAL LETTER ZHE ()
+<I=> 16D <U0418> CYRILLIC CAPITAL LETTER I ()
+<J=> 16E <U0419> CYRILLIC CAPITAL LETTER SHORT I ()
+<L=> 16F <U041B> CYRILLIC CAPITAL LETTER EL ()
+<P=> 170 <U041F> CYRILLIC CAPITAL LETTER PE ()
+<U=> 171 <U0423> CYRILLIC CAPITAL LETTER U ()
+<F=> 172 <U0424> CYRILLIC CAPITAL LETTER EF ()
+<C=> 173 <U0426> CYRILLIC CAPITAL LETTER TSE ()
+<C%> 174 <U0427> CYRILLIC CAPITAL LETTER CHE ()
+<S%> 175 <U0428> CYRILLIC CAPITAL LETTER SHA ()
+<Sc> 176 <U0429> CYRILLIC CAPITAL LETTER SHCHA ()
+<="> 177 <U042A> CYRILLIC CAPITAL LETTER HARD SIGN ()
+<Y=> 178 <U042B> CYRILLIC CAPITAL LETTER YERU ()
+<%"> 179 <U042C> CYRILLIC CAPITAL LETTER SOFT SIGN ()
+<JE> 17A <U042D> CYRILLIC CAPITAL LETTER E ()
+<JU> 17B <U042E> CYRILLIC CAPITAL LETTER YU ()
+<JA> 17C <U042F> CYRILLIC CAPITAL LETTER YA ()
+<b=> 17D <U0431> CYRILLIC SMALL LETTER BE ()
+<v=> 17E <U0432> CYRILLIC SMALL LETTER VE ()
+<g=> 17F <U0433> CYRILLIC SMALL LETTER GHE ()
+<d=> 180 <U0434> CYRILLIC SMALL LETTER DE ()
+<z%> 181 <U0436> CYRILLIC SMALL LETTER ZHE ()
+<z=> 182 <U0437> CYRILLIC SMALL LETTER ZE ()
+<i=> 183 <U0438> CYRILLIC SMALL LETTER I ()
+<j=> 184 <U0439> CYRILLIC SMALL LETTER SHORT I ()
+<k=> 185 <U043A> CYRILLIC SMALL LETTER KA ()
+<l=> 186 <U043B> CYRILLIC SMALL LETTER EL ()
+<m=> 187 <U043C> CYRILLIC SMALL LETTER EM ()
+<n=> 188 <U043D> CYRILLIC SMALL LETTER EN ()
+<p=> 189 <U043F> CYRILLIC SMALL LETTER PE ()
+<t=> 18A <U0442> CYRILLIC SMALL LETTER TE ()
+<u=> 18B <U0443> CYRILLIC SMALL LETTER U ()
+<f=> 18C <U0444> CYRILLIC SMALL LETTER EF ()
+<c=> 18D <U0446> CYRILLIC SMALL LETTER TSE ()
+<c%> 18E <U0447> CYRILLIC SMALL LETTER CHE ()
+<s%> 18F <U0448> CYRILLIC SMALL LETTER SHA ()
+<sc> 190 <U0449> CYRILLIC SMALL LETTER SHCHA ()
+<='> 191 <U044A> CYRILLIC SMALL LETTER HARD SIGN ()
+<y=> 192 <U044B> CYRILLIC SMALL LETTER YERU ()
+<%'> 193 <U044C> CYRILLIC SMALL LETTER SOFT SIGN ()
+<je> 194 <U044D> CYRILLIC SMALL LETTER E ()
+<ju> 195 <U044E> CYRILLIC SMALL LETTER YU ()
+<ja> 196 <U044F> CYRILLIC SMALL LETTER YA ()
+<IE> 197 <U0404> CYRILLIC CAPITAL LETTER UKRAINIAN IE ()-5
+<ie> 198 <U0454> CYRILLIC SMALL LETTER UKRAINIAN IE ()-5
+<Z=> 199 <U0417> CYRILLIC CAPITAL LETTER ZE ()
+<v%> 19A <U045E> Free
+<N0> 19B <U2116> NUMERO SIGN () Esto es nmero!
+<D%> 19C <U0402> CYRILLIC CAPITAL LETTER DJE (Serbocroatian) ()-5
+<d%> 19D <U0452> CYRILLIC SMALL LETTER DJE (Serbocroatian) ()-5
+<G%> 19E <U0403> CYRILLIC CAPITAL LETTER GJE ()-5
+<g%> 19F <U0453> CYRILLIC SMALL LETTER GJE ()-5
+<YI> 1A0 <U0407> CYRILLIC CAPITAL LETTER YI (Ukrainian) ()-5
+<LJ> 1A1 <U0409> CYRILLIC CAPITAL LETTER LJE ()-5
+<lj> 1A2 <U0459> CYRILLIC SMALL LETTER LJE ()-5
+<NJ> 1A3 <U040A> CYRILLIC CAPITAL LETTER NJE ()-5
+<nj> 1A4 <U045A> CYRILLIC SMALL LETTER NJE ()-5
+<Ts> 1A5 <U040B> CYRILLIC CAPITAL LETTER TSHE (Serbocroatian) ()-5
+<ts> 1A6 <U045B> CYRILLIC SMALL LETTER TSHE (Serbocroatian) ()-5
+<KJ> 1A7 <U040C> CYRILLIC CAPITAL LETTER KJE ()-5
+<kj> 1A8 <U045C> CYRILLIC SMALL LETTER KJE ()-5
+<V%> 1A9 <U040E> CYRILLIC CAPITAL LETTER SHORT U (Byelorussian) ()-5
+<v%> 1AA <U045E> CYRILLIC SMALL LETTER SHORT U (Byelorussian) ()-5
+<DZ> 1AB <U040F> CYRILLIC CAPITAL LETTER DZHE ()-5
+<dz> 1AC <U045F> CYRILLIC SMALL LETTER DZHE ()-5
+<:9> 1AD <U201E> DOUBLE LOW-9 QUOTATION MARK ()-cp1251
+<.3> 1AE <U2026> HORIZONTAL ELLIPSIS ()-cp1251
+<//-> 1AF <U2020> DAGGER ()-cp1251
+<//=> 1B0 <U2021> DOUBLE DAGGER ()-cp1251
+<%0> 1B1 <U2030> PER MILLE SIGN ()-cp1251
+<"6> 1B2 <U201C> LEFT DOUBLE QUOTATION MARK ()-cp1251
+<"9> 1B3 <U201D> RIGHT DOUBLE QUOTATION MARK ()-cp1251
+<TM> 1B4 <U2122> TRADE MARK SIGN ()-cp1251
+<G3> 1B5 <U0490> CYRILLIC CAPITAL LETTER GHE WITH UPTURN ()-cp1251
+<g3> 1B6 <U0491> CYRILLIC SMALL LETTER GHE WITH UPTURN ()-cp1251
+ 1B7 <UFFFD> That's a ? inside a circle, it means the character is unknown
+<OE> 1B8 <U0152> LATIN CAPITAL LIGATURE OE
+<oe> 1B9 <U0153> LATIN SMALL LIGATURE OE
+ 1BA <U2409> SYMBOL FOR HORIZONTAL TABULATION
+ 1BB <U240C> SYMBOL FOR FORM FEED
+ 1BC <U240D> SYMBOL FOR CARRIAGE RETURN
+ 1BD <U240A> SYMBOL FOR LINE FEED
+ 1BE <U2424> SYMBOL FOR NEWLINE
+ 1BF <U240B> SYMBOL FOR VERTICAL TABULATION
+<!=> 1C0 <U2260> NOT EQUAL TO
+ 1C1 <U21B5> DOWNWARDS ARROW WITH CORNER LEFTWARDS
+<Y:> 1C2 <U0178> LATIN CAPITAL LETTER Y WITH DIAERESIS
+ 1C3 <Uf801> - but half way up
+ 1C4 <U2575> BOX DRAWINGS LIGHT UP ()-1 Linux
+ 1C5 <U2576> BOX DRAWINGS LIGHT RIGHT ()-1 Linux
+ 1C6 <U2577> BOX DRAWINGS LIGHT DOWN ()-1 Linux
+ 1C7 <U2574> BOX DRAWINGS LIGHT LEFT ()-1 Linux
+ 1C8 <Uf803> - but half way down
+ 1C9 <U2579> BOX DRAWINGS HEAVY UP ()-1 Linux ATTENTION, This is a Linux error, the real unicode doesn't exist, the same is for the next three
+ 1CA <U257A> BOX DRAWINGS HEAVY RIGHT ()-1 Linux
+ 1CB <U257B> BOX DRAWINGS HEAVY DOWN ()-1 Linux
+ 1CC <U2578> BOX DRAWINGS HEAVY LEFT ()-1 Linux
+ 1CD 0x0138 LATIN SMALL LETTER KRA
+ 1CE 0x014A LATIN CAPITAL LETTER ENG
+ 1CF 0x014B LATIN SMALL LETTER ENG
+ 1D0 0x0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+ 1D1 0x0109 c
+ 1D2 0x011C G
+ 1D3 0x011D g
+ 1D4 0x0124 H
+ 1D5 0x0125 h
+ 1D6 0x0134 J
+ 1D7 0x0135 j
+ 1D8 0x015C S
+ 1D9 0x015D s
+ 1DA 0x0174 W
+ 1DB 0x0175 w
+ 1DC 0x0176 Y
+ 1DD 0x0177 y
+ 1DE 0x1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE
+ 1DF 0x1E03 b
+ 1E0 0x010A C
+ 1E1 0x010B c
+ 1E2 0x1E0A D
+ 1E3 0x1E0B d
+ 1E4 0x1E1E F
+ 1E5 0x1E1F f
+ 1E6 0x0121 g
+ 1E7 0x0130 I
+ 1E8 0x1E40 M
+ 1E9 0x1E41 m
+ 1EA 0x1E56 P
+ 1EB 0x1E57 p
+ 1EC 0x1E60 S
+ 1ED 0x1E61 s
+ 1EE 0x1E6A T
+ 1EF 0x1E6B t
+ 1F0 0x0112 LATIN CAPITAL LETTER E WITH MACRON
+ 1F1 0x0113 e
+ 1F2 0x012A I
+ 1F3 0x012B i
+ 1F4 0x014C O
+ 1F5 0x014D o
+ 1F6 0x016A U
+ 1F7 0x016B u
+ 1F8 0x011E LATIN CAPITAL LETTER G WITH BREVE
+ 1F9 0x011F g
+ 1FA 0x012C I
+ 1FB 0x012D i
+ 1FC 0x016C U
+ 1FD 0x016D u
+ 1FE 0x0122 LATIN CAPITAL LETTER G WITH CEDILLA
+ 1FF 0x0123 g
+ 200 0x0136 K
+ 201 0x0137 k
+ 202 0x0145 N
+ 203 0x0146 n
+ 204 0x0156 R
+ 205 0x0157 r
+ 206 0x0128 LATIN CAPITAL LETTER I WITH TILDE
+ 207 0x0129 i
+ 208 0x0168 U
+ 209 0x0169 u
+ 20A 0x012E LATIN CAPITAL LETTER I WITH OGONEK
+ 20B 0x012F i
+ 20C 0x0172 U
+ 20D 0x0173 u
+ 20E 0x1E80 W
+ 20F 0x1E81 w
+ 210 0x1EF2 LATIN CAPITAL LETTER Y WITH GRAVE
+ 211 0x1EF3 LATIN SMALL LETTER Y WITH GRAVE
+ 212 0x1E82 LATIN CAPITAL LETTER W WITH ACUTE
+ 213 0x1E83 LATIN SMALL LETTER W WITH ACUTE
+ 214 0x1E84 LATIN CAPITAL LETTER W WITH DIAERESIS
+ 215 0x1E85 LATIN SMALL LETTER W WITH DIAERESIS
+ 216 0x0126 LATIN CAPITAL LETTER H WITH STROKE
+ 217 0x0127 LATIN SMALL LETTER H WITH STROKE
+ 218 0x0166 LATIN CAPITAL LETTER T WITH STROKE
+ 219 0x0167 LATIN SMALL LETTER T WITH STROKE
+ 21A 0x01A0 LATIN CAPITAL LETTER O WITH HORN
+ 21B 0x01A1 LATIN SMALL LETTER O WITH HORN
+ 21C 0x01AF LATIN CAPITAL LETTER U WITH HORN
+ 21D 0x01B0 LATIN SMALL LETTER U WITH HORN
+ 21E 0x0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
+ 21F 0x0117 LATIN SMALL LETTER E WITH DOT ABOVE
+ 220 0x013B LATIN CAPITAL LETTER L WITH CEDILLA
+ 221 0x013C LATIN SMALL LETTER L WITH CEDILLA
+# 03B1 GREEK SMALL LETTER ALPHA => is 0xE0 152
+# 03B2 GREEK SMALL LETTER BETA => is 0xE1 153
+ 222 0x03B3 GREEK SMALL LETTER GAMMA => 737 (154)
+# 03B4 GREEK SMALL LETTER DELTA => is 0xEB 155
+# 03B5 GREEK SMALL LETTER EPSILON => is 0xEE 156
+ 223 0x03B6 GREEK SMALL LETTER ZETA => 737 (157)
+ 224 0x03B7 GREEK SMALL LETTER ETA => 158
+ 225 0x03B8 GREEK SMALL LETTER THETA => 159
+ 226 0x03B9 GREEK SMALL LETTER IOTA => 160
+# 03BA GREEK SMALL LETTER KAPPA => is 0x185
+ 227 0x03BB GREEK SMALL LETTER LAMDA => 737 (162)
+# 03BC GREEK SMALL LETTER MU => is 0xE6 163
+ 228 0x03BD GREEK SMALL LETTER NU => 737 (164)
+ 229 0x03BE GREEK SMALL LETTER XI => 737 (165)
+# 03BF GREEK SMALL LETTER OMICRON => o () 166
+# 03C0 GREEK SMALL LETTER PI => is 0xE3 167
+ 22A 0x03C1 GREEK SMALL LETTER RHO => 737 (168)
+# 03C3 GREEK SMALL LETTER SIGMA => is 0xE5 169
+ 22B 0x03C2 GREEK SMALL LETTER FINAL SIGMA => 737 (169)
+# 03C4 GREEK SMALL LETTER TAU => is 0xE7 171
+ 22C 0x03C5 GREEK SMALL LETTER UPSILON => 737 (172)
+# 03C6 GREEK SMALL LETTER PHI is 0xED 173
+ 22D 0x03C7 GREEK SMALL LETTER CHI => x () 174
+ 22E 0x03C8 GREEK SMALL LETTER PSI => 737 (175)
+ 22F 0x03C9 GREEK SMALL LETTER OMEGA => 737 (224)
+# 0391 Greek capital letter Alpha => A () 128
+# 0392 GREEK CAPITAL LETTER BETA => B () 129
+# 0393 GREEK CAPITAL LETTER GAMMA => is 0xE2 130
+ 230 0x0394 GREEK CAPITAL LETTER DELTA
+# 0395 GREEK CAPITAL LETTER EPSILON => E () 132
+# 0396 GREEK CAPITAL LETTER ZETA => () 133
+# 0397 GREEK CAPITAL LETTER ETA => () 134
+# 0398 GREEK CAPITAL LETTER THETA => is 0xE9 135
+# 0399 GREEK CAPITAL LETTER IOTA => I () 136
+# 039A GREEK CAPITAL LETTER KAPPA => K () 137
+# 039C GREEK CAPITAL LETTER MU => M () 139
+# 039D GREEK CAPITAL LETTER NU => N () 140
+ 231 0x039E GREEK CAPITAL LETTER XI => 737 (141)
+# 039F GREEK CAPITAL LETTER OMICRON => O () 142
+ 232 0x03A0 GREEK CAPITAL LETTER PI => 737 (143)
+# 03A1 GREEK CAPITAL LETTER RHO => P () 144
+# 03A3 GREEK CAPITAL LETTER SIGMA => 737 145 is 0xE4
+# 03A4 GREEK CAPITAL LETTER TAU => T () 146
+# 03A5 GREEK CAPITAL LETTER UPSILON => Y () 147
+# 03A6 GREEK CAPITAL LETTER PHI is 0xE8 148
+# 03A7 GREEK CAPITAL LETTER CHI => X () 149
+ 233 0x03A8 GREEK CAPITAL LETTER PSI 737 (150)
+# 03A9 GREEK CAPITAL LETTER OMEGA is 0xEA 151
+ 234 0x0385 GREEK DIALYTIKA TONOS
+ 235 0x03AC GREEK SMALL LETTER ALPHA WITH TONOS
+ 236 0x03AD GREEK SMALL LETTER EPSILON WITH TONOS
+ 237 0x03AE GREEK SMALL LETTER ETA WITH TONOS
+ 238 0x03AF GREEK SMALL LETTER IOTA WITH TONOS 229
+ 239 0x03CC GREEK SMALL LETTER OMICRON WITH TONOS
+ 23A 0x03CD GREEK SMALL LETTER UPSILON WITH TONOS
+ 23B 0x03CE GREEK SMALL LETTER OMEGA WITH TONOS
+ 23C 0x0386 GREEK CAPITAL LETTER ALPHA WITH TONOS
+ 23D 0x0388 GREEK CAPITAL LETTER EPSILON WITH TONOS
+ 23E 0x0389 GREEK CAPITAL LETTER ETA WITH TONOS
+ 23F 0x038A GREEK CAPITAL LETTER IOTA WITH TONOS
+ 240 0x038C GREEK CAPITAL LETTER OMICRON WITH TONOS
+ 241 0x038E GREEK CAPITAL LETTER UPSILON WITH TONOS
+ 242 0x038F GREEK CAPITAL LETTER OMEGA WITH TONOS
+ 243 0x03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA
+ 244 0x03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+ 245 0x0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+ 246 0x03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+# 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA => 0x119 LATIN CAPITAL LETTER I WITH DIAERESIS
+# 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA => 0x1C2 LATIN CAPITAL LETTER Y WITH DIAERESIS
+ 247 <U039B> GREEK CAPITAL LETTER LAMDA => 737 (138)
+ 248 <U0101> LATIN SMALL LETTER A WITH MACRON
+ 249 <U0100> LATIN CAPITAL LETTER A WITH MACRON CP 1257, 775 (Baltic Rim) y latin 4
+ 24A <U0120> LATIN CAPITAL LETTER G WITH DOT ABOVE latin 3 y 14
+ 24B <U20AC> EURO SIGN
+# Cyrillic letters with shapes already defined (can share the same shape) 588 to 612
+<V=> 24C <U0412> CYRILLIC CAPITAL LETTER VE == B
+<E=> 24D <U0415> CYRILLIC CAPITAL LETTER IE == E
+<K=> 24E <U041A> CYRILLIC CAPITAL LETTER KA == K
+<M=> 24F <U041C> CYRILLIC CAPITAL LETTER EM == M
+<N=> 250 <U041D> CYRILLIC CAPITAL LETTER EN == H
+<O=> 251 <U041E> CYRILLIC CAPITAL LETTER O == O
+<R=> 252 <U0420> CYRILLIC CAPITAL LETTER ER == P
+<S=> 253 <U0421> CYRILLIC CAPITAL LETTER ES == C
+<T=> 254 <U0422> CYRILLIC CAPITAL LETTER TE == T
+<H=> 255 <U0425> CYRILLIC CAPITAL LETTER HA == X
+<a=> 256 <U0430> CYRILLIC SMALL LETTER A == a
+<e=> 257 <U0435> CYRILLIC SMALL LETTER IE == e
+<o=> 258 <U043E> CYRILLIC SMALL LETTER O == o
+<r=> 259 <U0440> CYRILLIC SMALL LETTER ER == p
+<s=> 25A <U0441> CYRILLIC SMALL LETTER ES == c
+<h=> 25B <U0445> CYRILLIC SMALL LETTER HA == x
+<io> 25C <U0451> CYRILLIC SMALL LETTER IO == euml
+<IO> 25D <U0401> CYRILLIC CAPITAL LETTER IO == Euml
+<ds> 25E <U0455> CYRILLIC SMALL LETTER DZE == s
+<ii> 25F <U0456> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I == i
+<yi> 260 <U0457> CYRILLIC SMALL LETTER YI (Ukrainian) == iuml
+<j%> 261 <U0458> CYRILLIC SMALL LETTER JE == j
+<II> 262 <U0406> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I == Iuml
+ 263 <U0408> CYRILLIC CAPITAL LETTER JE == J
+ 264 <U0405> CYRILLIC CAPITAL LETTER DZE == S
+# Greek letters with shapes already defined: 613 to 632
+ 265 <U03B2> GREEK SMALL LETTER BETA => like 0xE1 153 U00DF
+ 266 <U03BA> GREEK SMALL LETTER KAPPA => like 0x185 U043A (cyr. ka)
+ 267 <U03BC> GREEK SMALL LETTER MU => like 0xE6 163 U00B5 (micro symbol)
+ 268 <U03BF> GREEK SMALL LETTER OMICRON => o
+ 269 <U0391> GREEK CAPITAL LETTER Alpha => A
+ 26A <U0392> GREEK CAPITAL LETTER BETA => B
+ 26B <U0395> GREEK CAPITAL LETTER EPSILON => E
+ 26C <U0396> GREEK CAPITAL LETTER ZETA => Z
+ 26D <U0397> GREEK CAPITAL LETTER ETA => H
+ 26E <U0399> GREEK CAPITAL LETTER IOTA => I
+ 26F <U039A> GREEK CAPITAL LETTER KAPPA => K
+ 270 <U039C> GREEK CAPITAL LETTER MU => M
+ 271 <U039D> GREEK CAPITAL LETTER NU => N
+ 272 <U039F> GREEK CAPITAL LETTER OMICRON => O
+ 273 <U03A1> GREEK CAPITAL LETTER RHO => P
+ 274 <U03A4> GREEK CAPITAL LETTER TAU => T
+ 275 <U03A5> GREEK CAPITAL LETTER UPSILON => Y
+ 276 <U03A7> GREEK CAPITAL LETTER CHI => X
+ 277 <U03AA> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA => 0x119 LATIN CAPITAL LETTER I WITH DIAERESIS
+ 278 <U03AB> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA => 0x1C2 LATIN CAPITAL LETTER Y WITH DIAERESIS
+
diff --git a/setedit/fonts/medieval.016 b/setedit/fonts/medieval.016
new file mode 100644
index 0000000..ab02bd6
--- /dev/null
+++ b/setedit/fonts/medieval.016
Binary files differ
diff --git a/setedit/fonts/medieval.sft b/setedit/fonts/medieval.sft
new file mode 100644
index 0000000..bf435b9
--- /dev/null
+++ b/setedit/fonts/medieval.sft
Binary files differ
diff --git a/setedit/fonts/ocr.cc b/setedit/fonts/ocr.cc
new file mode 100644
index 0000000..38b01eb
--- /dev/null
+++ b/setedit/fonts/ocr.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include "common1.h"
+#include "ocr0.000"
+
+Font BoxRound16={0,NUM_FONTS,16,BR16};
+Font BoxRound14={0,NUM_FONTS,14,BR14};
+
+char *Name="OCR style";
+
+#define PREFIX BR
+#define PREFIXS "BR"
+#define NAME_FONT "ocr.sft"
+#define ARRAY1 BoxRound16
+#define ARRAY2 BoxRound14
+#define NAME_PART "ocr%d.%03d"
+
+#include "common2.h"
diff --git a/setedit/fonts/ocr.sft b/setedit/fonts/ocr.sft
new file mode 100644
index 0000000..5a8b08f
--- /dev/null
+++ b/setedit/fonts/ocr.sft
Binary files differ
diff --git a/setedit/fonts/ocr0.000 b/setedit/fonts/ocr0.000
new file mode 100644
index 0000000..5572691
--- /dev/null
+++ b/setedit/fonts/ocr0.000
@@ -0,0 +1,1272 @@
+unsigned char BR16[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x3C,0x5A,0xFF,0xFF,0x66,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x5A,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00,0x00, // \t
+0x00,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0x00, // \n
+0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1F,0x11,0x1F,0x10,0x10,0x10,0x30,0x70,0x60,0x00,0x00,0x00,0x00, // \r
+0x00,0x00,0x00,0x3F,0x21,0x3F,0x21,0x21,0x21,0x23,0x67,0xE6,0x40,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x1C,0x2A,0x4B,0x7D,0x75,0x22,0x1C,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x40,0x60,0x70,0x7C,0x7F,0x7C,0x70,0x60,0x40,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xC3,0xC3,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x3F,0x49,0x49,0x49,0x39,0x09,0x09,0x09,0x09,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3C,0x42,0x20,0x18,0x24,0x42,0x42,0x24,0x18,0x04,0x42,0x3C,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x10,0x18,0x08,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x08,0x1C,0x3E,0x08,0x08,0x08,0x08,0x0C,0x0C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x18,0x08,0x08,0x08,0x08,0x3E,0x1C,0x08,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x04,0x66,0x7F,0x06,0x04,0x00,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x00,0x10,0x30,0x7F,0x33,0x10,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x0C,0x0C,0x16,0x16,0x22,0x22,0x41,0x7F,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x7F,0x41,0x22,0x22,0x34,0x3C,0x18,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x00,0x00,0x00, // !
+0x00,0x00,0x00,0x33,0x33,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x00,0x24,0x24,0xFF,0x24,0x64,0xFF,0x64,0x64,0x00,0x00,0x00,0x00,0x00, // #
+0x00,0x00,0x00,0x0C,0x0C,0x3F,0x4C,0x4C,0x3E,0x0B,0x0B,0x7E,0x08,0x08,0x00,0x00, // $
+0x00,0x00,0x00,0x08,0xC8,0xC8,0x08,0x18,0x18,0x1B,0x1B,0x18,0x00,0x00,0x00,0x00, // %
+0x00,0x00,0x00,0x1C,0x22,0x20,0x20,0x78,0x67,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // &
+0x00,0x00,0x00,0x18,0x18,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x00,0x18,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x18,0x00,0x00,0x00,0x00, // (
+0x00,0x00,0x00,0x0C,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x0C,0x00,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x00,0x4B,0x4B,0x3C,0x6A,0x6A,0x6A,0x00,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x10,0x20,0x00,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x30,0x60,0xC0,0x00,0x00,0x00,0x00, // /
+0x00,0x00,0x00,0x3E,0x41,0x41,0x41,0x43,0x43,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 1
+0x00,0x00,0x00,0x3E,0x41,0x01,0x01,0x3E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 2
+0x00,0x00,0x00,0x3C,0x42,0x02,0x3E,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 3
+0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x42,0x42,0x7F,0x06,0x06,0x00,0x00,0x00,0x00, // 4
+0x00,0x00,0x00,0x7F,0x40,0x40,0x7E,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 5
+0x00,0x00,0x00,0x3E,0x41,0x40,0x7E,0x43,0x43,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 6
+0x00,0x00,0x00,0x7E,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00, // 7
+0x00,0x00,0x00,0x1C,0x22,0x22,0x22,0x3F,0x43,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 8
+0x00,0x00,0x00,0x3E,0x41,0x41,0x41,0x41,0x3F,0x03,0x03,0x03,0x00,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x10,0x20,0x00,0x00, // ;
+0x00,0x00,0x00,0x04,0x08,0x10,0x30,0x70,0x30,0x10,0x08,0x04,0x00,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x7E,0x7E,0x00,0x00,0x7E,0x7E,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x00,0x10,0x08,0x04,0x06,0x07,0x06,0x04,0x08,0x10,0x00,0x00,0x00,0x00, // >
+0x00,0x00,0x00,0x7E,0x41,0x01,0x01,0x7E,0x60,0x00,0x60,0x60,0x00,0x00,0x00,0x00, // ?
+0x00,0x00,0x00,0x3E,0x41,0x9D,0x83,0x9F,0xB3,0xB3,0x9C,0xC0,0x7C,0x00,0x00,0x00, // @
+0x00,0x00,0x00,0x3E,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // A
+0x00,0x00,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // B
+0x00,0x00,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // C
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // D
+0x00,0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // E
+0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // F
+0x00,0x00,0x00,0x3E,0x41,0x40,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // G
+0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // H
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // I
+0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // J
+0x00,0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // K
+0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // L
+0x00,0x00,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00,0x00, // M
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // N
+0x00,0x00,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // O
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // P
+0x00,0x00,0x00,0x3E,0x41,0x41,0x41,0x41,0x41,0x41,0x47,0x3F,0x00,0x00,0x00,0x00, // Q
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // R
+0x00,0x00,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00,0x00, // S
+0x00,0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // T
+0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // U
+0x00,0x00,0x00,0x61,0x61,0x61,0x61,0x62,0x22,0x22,0x22,0x1C,0x00,0x00,0x00,0x00, // V
+0x00,0x00,0x00,0x49,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00,0x00, // W
+0x00,0x00,0x00,0x41,0x41,0x41,0x22,0x1C,0x22,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // X
+0x00,0x00,0x00,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // Y
+0x00,0x00,0x00,0x7F,0x41,0x01,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00,0x00, // Z
+0x00,0x00,0x00,0x1E,0x10,0x10,0x10,0x18,0x18,0x18,0x18,0x1E,0x00,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x0C,0x06,0x03,0x00,0x00,0x00,0x00, // \.
+0x00,0x00,0x00,0x3C,0x0C,0x0C,0x04,0x04,0x04,0x04,0x04,0x3C,0x00,0x00,0x00,0x00, // ]
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x14,0x32,0x61,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x7F,0x00,0x00, // _
+0x00,0x00,0x00,0x10,0x08,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // a
+0x00,0x00,0x00,0x20,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x3E,0x00,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // c
+0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x21,0x31,0x31,0x31,0x1F,0x00,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // e
+0x00,0x00,0x00,0x06,0x08,0x08,0x1E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00,0x00, // g
+0x00,0x00,0x00,0x20,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // h
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // i
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x04,0x00,0x00, // j
+0x00,0x00,0x00,0x20,0x20,0x20,0x21,0x22,0x3E,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // k
+0x00,0x00,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x49,0x49,0x6D,0x6D,0x6D,0x00,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x3E,0x20,0x20,0x00,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x01,0x00,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00,0x00, // s
+0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x31,0x31,0x12,0x12,0x0C,0x00,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x1E,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00,0x00, // z
+0x00,0x00,0x00,0x06,0x08,0x08,0x08,0x10,0x0C,0x0C,0x0C,0x06,0x00,0x00,0x00,0x00, // {
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00, // |
+0x00,0x00,0x00,0x30,0x18,0x18,0x08,0x04,0x08,0x08,0x08,0x30,0x00,0x00,0x00,0x00, // }
+0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x49,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x00,0x08,0x1C,0x36,0x63,0x63,0x7F,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x04,0x02,0x7C,0x00, //
+0x00,0x00,0x00,0x21,0x21,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x1C,0x36,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x31,0x31,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x18,0x0C,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x36,0x1C,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x04,0x02,0x7C,0x00, //
+0x00,0x00,0x08,0x1C,0x36,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x33,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x18,0x0C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x1C,0x36,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x18,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x61,0x61,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x00,0x00,0x00,0x00, //
+0x1C,0x36,0x1C,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, //
+0x0C,0x18,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xF6,0x09,0x7F,0xC8,0xC8,0x77,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3F,0x48,0x48,0x48,0xFE,0xCC,0xCC,0xCC,0xCC,0xCF,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x1C,0x36,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x31,0x31,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x18,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x0C,0x1E,0x33,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x18,0x0C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x31,0x00,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00,0x00, //
+0x00,0x00,0x63,0x63,0x00,0x3E,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x41,0x41,0x00,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x04,0x04,0x1E,0x21,0x30,0x30,0x31,0x1E,0x04,0x04,0x00,0x00, //
+0x00,0x38,0x44,0x44,0x40,0xF0,0x60,0x60,0x60,0x60,0x62,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x46,0x46,0x46,0x3C,0x10,0x7E,0x10,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0xF8,0x84,0x84,0xF8,0xC8,0xC8,0xDE,0xC8,0xCC,0xCC,0xCC,0x00,0x00,0x00,0x00, //
+0x00,0x0E,0x11,0x10,0x10,0x10,0x7E,0x18,0x18,0x18,0x98,0xF0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x18,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x06,0x0C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x19,0x36,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00,0x00, //
+0x3B,0x6C,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x4C,0x4C,0x3C,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x44,0x44,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x30,0xC0,0xC2,0xC2,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x20,0x20,0x62,0x66,0x6C,0x18,0x30,0x60,0xDC,0x82,0x1C,0x20,0x3E,0x00,0x00, //
+0x00,0x20,0x20,0x62,0x66,0x6C,0x18,0x30,0x6E,0xD2,0x92,0x12,0x1F,0x06,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11, //
+0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55, //
+0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3A,0x44,0x64,0x64,0x3B,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00,0x00, //
+0x00,0x00,0xFE,0x86,0x86,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x64,0x64,0x64,0x64,0x64,0x64,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xFE,0x82,0x40,0x20,0x10,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xC8,0xC8,0xC8,0xC8,0xC8,0x70,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x62,0x62,0x62,0x66,0x66,0x66,0x7C,0x40,0x40,0x80,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x10,0x10,0x10,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3E,0x08,0x1C,0x2A,0x49,0x69,0x69,0x2A,0x1C,0x08,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1C,0x22,0x41,0x7F,0x61,0x22,0x1C,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1C,0x22,0x41,0x61,0x61,0x22,0x22,0x63,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x62,0x62,0x62,0x62,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xD9,0xD9,0xD9,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x03,0x06,0x7E,0xD9,0xD9,0xF1,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1E,0x20,0x3C,0x30,0x1E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1C,0x22,0x22,0x22,0x32,0x32,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x10,0x10,0x7E,0x18,0x18,0x00,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x20,0x10,0x08,0x0C,0x08,0x10,0x20,0x00,0x60,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x04,0x08,0x10,0x30,0x10,0x08,0x04,0x00,0x60,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x0E,0x13,0x13,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x18,0x18,0x00,0x60,0x7E,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x18,0x24,0x34,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x08,0x08,0x08,0x08,0x08,0xCC,0x4C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x6C,0x32,0x32,0x32,0x32,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x3C,0x42,0x02,0x3C,0x40,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x00,0x06,0x0C,0x18,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 256
+0x06,0x0C,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 257
+0x00,0x00,0x0C,0x18,0x30,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // 258
+0x00,0x00,0x06,0x0C,0x18,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 259
+0x00,0x00,0x06,0x0C,0x18,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00,0x00, // 260
+0x00,0x00,0x03,0x06,0x0C,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00,0x00, // 261
+0x00,0x00,0x06,0x0C,0x18,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00,0x00, // 262
+0x06,0x0C,0x18,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 263
+0x06,0x0C,0x18,0x00,0x3E,0x41,0x41,0x40,0x60,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 264
+0x06,0x0C,0x18,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 265
+0x18,0x30,0x60,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 266
+0x0C,0x18,0x30,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 267
+0x0C,0x18,0x30,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 268
+0x0C,0x18,0x30,0x00,0x7C,0x42,0x42,0x42,0x7E,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 269
+0x06,0x0C,0x18,0x00,0x3E,0x41,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00,0x00, // 270
+0x06,0x0C,0x18,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 271
+0x0C,0x18,0x30,0x00,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 272
+0x0C,0x18,0x30,0x00,0x7F,0x41,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00,0x00, // 273
+0x33,0x66,0xCC,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 274
+0x30,0x18,0x0C,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 275
+0x30,0x18,0x0C,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 276
+0x60,0x30,0x18,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 277
+0x30,0x18,0x0C,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 278
+0x30,0x18,0x0C,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 279
+0x00,0x00,0x63,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 280
+0x00,0x00,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 281
+0x00,0x00,0x1C,0x36,0x1C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 282
+0x1C,0x36,0x1C,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 283
+0x00,0x00,0x00,0x3B,0x6E,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 284
+0x00,0x00,0x00,0x3B,0x6E,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 285
+0x00,0x00,0x00,0x1B,0x36,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 286
+0x00,0x3B,0x6E,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 287
+0x00,0x3B,0x6E,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 288
+0x08,0x1C,0x36,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 289
+0x1C,0x36,0x63,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 290
+0x08,0x1C,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 291
+0x08,0x1C,0x36,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 292
+0x08,0x1C,0x36,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 293
+0x00,0x00,0x31,0x1A,0x0C,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 294
+0x00,0x00,0x31,0x1A,0x0C,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // 295
+0x00,0x00,0x31,0x1A,0x0C,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 296
+0x00,0x00,0x31,0x1A,0x0C,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00,0x00, // 297
+0x00,0x00,0x31,0x1A,0x0C,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00,0x00, // 298
+0x63,0x36,0x1C,0x00,0x3E,0x41,0x41,0x40,0x60,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 299
+0x63,0x36,0x1C,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // 300
+0x63,0x36,0x1C,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 301
+0x63,0x36,0x1C,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 302
+0x63,0x36,0x1C,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 303
+0x63,0x36,0x1C,0x00,0x3E,0x41,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00,0x00, // 304
+0x63,0x36,0x1C,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 305
+0x63,0x36,0x1C,0x00,0x7F,0x41,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x04,0x62,0x7C,0x00, // 307
+0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x62,0x7C,0x00, // 308
+0x00,0x00,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x04,0xC2,0xFC,0x00, // 309
+0x00,0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x04,0xC2,0xFC,0x00, // 310
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x20,0x43,0x3F,0x00, // 311
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x20,0x43,0x3F,0x00, // 312
+0x00,0x00,0x00,0x3E,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x20,0x43,0x3F,0x00, // 313
+0x00,0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x20,0x43,0x3F,0x00, // 314
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00,0x00, // 315
+0x00,0x18,0x18,0x00,0x7F,0x41,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00,0x00, // 316
+0x00,0x00,0x00,0x08,0x08,0x09,0x0E,0x0C,0x0C,0x1C,0x2C,0x0C,0x00,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x01,0x3E,0x46,0x6A,0x72,0x62,0x7C,0x80,0x00,0x00,0x00, // 318
+0x00,0x00,0x00,0x20,0x21,0x22,0x24,0x38,0x30,0x70,0xB0,0x3F,0x00,0x00,0x00,0x00, // 319
+0x00,0x00,0x00,0x3F,0x43,0x47,0x49,0x49,0x51,0x51,0x61,0x7E,0x80,0x00,0x00,0x00, // 320
+0x00,0x00,0x04,0x04,0x0F,0x04,0x7C,0x84,0xC4,0xC4,0xC4,0x7C,0x00,0x00,0x00,0x00, // 321
+0x24,0x18,0x18,0x24,0x02,0x01,0x1F,0x21,0x31,0x31,0x31,0x1F,0x00,0x00,0x00,0x00, // 322
+0x00,0x00,0x00,0x7E,0x41,0xF9,0x41,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // 323
+0x03,0x03,0x01,0x05,0x05,0x05,0x7D,0x84,0xC4,0xC4,0xC4,0x7C,0x00,0x00,0x00,0x00, // 324
+0x06,0x06,0x02,0x12,0x12,0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 325
+0x06,0x06,0x02,0x0A,0x0A,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 326
+0x18,0x18,0x08,0x48,0x48,0x40,0x40,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 327
+0x00,0x00,0x81,0x42,0x3C,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 328
+0x00,0x00,0x81,0x42,0x3C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 329
+0x81,0x42,0x3C,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 330
+0x00,0x00,0x00,0x81,0x42,0x3C,0x42,0x62,0x62,0x62,0x3C,0x42,0x81,0x00,0x00,0x00, // 331
+0x00,0xF0,0x40,0x40,0x40,0x7C,0x62,0x62,0x62,0x7C,0x60,0x60,0xF0,0x00,0x00,0x00, // 332
+0x00,0x00,0x00,0xE0,0x40,0x40,0x78,0x64,0x64,0x78,0x60,0xF0,0x00,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00,0x00,0x00, // 334
+0x00,0x00,0x7E,0x81,0xB9,0xA9,0xBD,0xB5,0xB5,0xB5,0x81,0x7E,0x00,0x00,0x00,0x00, // 335
+0x00,0x00,0x7E,0x81,0x9D,0xA1,0xA1,0xB1,0xB1,0x9D,0x81,0x7E,0x00,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 337
+0x00,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 338
+0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0xE1,0x12,0x72,0x34,0xE4,0x08,0x08,0x10,0x10,0x26,0x2A,0x4A,0x4F,0x82,0x02,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x62,0x7C,0x00, // 344
+0x00,0x00,0x00,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x40,0x40,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0xE0,0x10,0x70,0x30,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x00,0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x43,0x3F,0x00, // 349
+0x00,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x81,0x42,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x00,0x33,0x66,0xCC,0x00,0x3C,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00,0x00, // 353
+0x33,0x66,0xCC,0x00,0x7C,0x86,0x86,0x82,0x82,0x82,0x82,0x7C,0x00,0x00,0x00,0x00, // 354
+0x36,0x1C,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 355
+0xCC,0x78,0x30,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 356
+0x36,0x1C,0x08,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 357
+0x00,0x00,0x62,0x34,0x18,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 358
+0x31,0x1A,0x0C,0x04,0x04,0x04,0x7C,0x84,0xC4,0xC4,0xC4,0x7C,0x00,0x00,0x00,0x00, // 359
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 360
+0x00,0x00,0xFE,0x62,0x62,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 361
+0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 362
+0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xFF,0xC3,0x81,0x00,0x00, // 363
+0x00,0x00,0xD6,0xD6,0x54,0x54,0x7C,0x7C,0x54,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00, // 364
+0x00,0x00,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 365
+0x6C,0x10,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 366
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 367
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 368
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 369
+0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00,0x00,0x00, // 370
+0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x06,0x00,0x00, // 371
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00, // 372
+0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x00,0x00,0x00,0x00, // 373
+0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x03,0x03,0x00,0x00, // 374
+0x00,0x00,0xF8,0xB0,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x7C,0x00,0x00,0x00,0x00, // 375
+0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xF3,0xDB,0xDB,0xDB,0xDB,0xF3,0x00,0x00,0x00,0x00, // 376
+0x00,0x00,0xF0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 377
+0x00,0x00,0x7C,0xC6,0x06,0x26,0x3E,0x26,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 378
+0x00,0x00,0xCE,0xDB,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xDB,0xCE,0x00,0x00,0x00,0x00, // 379
+0x00,0x00,0x3F,0x66,0x66,0x66,0x3E,0x3E,0x66,0x66,0x66,0xE7,0x00,0x00,0x00,0x00, // 380
+0x00,0x02,0x06,0x3C,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x7E,0x32,0x32,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x36,0x66,0x66,0x66,0xFF,0xC3,0xC3,0x00,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x54,0xD6,0xD6,0x00,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x06,0x66,0x3C,0x00,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 387
+0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00, // 395
+0x00,0x00,0x00,0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x18,0x3C,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x06,0x00,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x03,0x03,0x00,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF8,0xB0,0x30,0x3E,0x33,0x33,0x7E,0x00,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x1E,0x06,0x66,0x3C,0x00,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xCE,0xDB,0xDB,0xFB,0xDB,0xDB,0xCE,0x00,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0xFC,0x6C,0xCC,0xCE,0x00,0x00,0x00,0x00, // 406
+0x00,0x00,0x7C,0xC6,0xC0,0xC8,0xF8,0xC8,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xF8,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 408
+0x00,0x00,0x00,0x3C,0x42,0x02,0x3E,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 409
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00, // 410
+0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xCC,0xCC,0xCC,0x00,0x00,0x00,0x00, // 411
+0x00,0x00,0xFC,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x06,0x1C,0x00,0x00, // 412
+0x00,0x00,0x00,0x00,0x00,0x30,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x1C,0x00,0x00, // 413
+0x0C,0x18,0xFE,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, // 414
+0x00,0x00,0x0C,0x18,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, // 415
+0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 416
+0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00,0x00,0x00, // 418
+0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDE,0xDA,0xDA,0xDA,0xDE,0x00,0x00,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00,0x00,0x00, // 420
+0x00,0x00,0xFE,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // 422
+0x0C,0x18,0xC6,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 423
+0x00,0x00,0x8C,0x98,0x80,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0x00,0x00,0x00,0x00, // 424
+0x6C,0x10,0x82,0x82,0xC2,0xC2,0x7E,0x02,0x02,0x02,0xC2,0x7C,0x00,0x00,0x00,0x00, // 425
+0x00,0x00,0x00,0x6C,0x10,0x82,0x82,0x82,0xC2,0xC2,0xC2,0x7E,0x06,0xC6,0x7C,0x00, // 426
+0x00,0x00,0x82,0x82,0x82,0x82,0xC2,0xC2,0xC2,0xC2,0xC2,0xFE,0x10,0x10,0x00,0x00, // 427
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0xC2,0xC2,0xC2,0xFE,0x10,0x10,0x00,0x00, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00,0x00, // 430
+0x00,0x00,0x00,0x10,0x10,0x70,0x7E,0x10,0x18,0x38,0x3C,0x18,0x18,0x00,0x00,0x00, // 431
+0x00,0x00,0x00,0x10,0x10,0x70,0x7E,0x10,0x3C,0x18,0x78,0x7E,0x18,0x00,0x00,0x00, // 432
+0x00,0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00,0x00, // 433
+0x00,0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x00,0x02,0x06,0x7E,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 437
+0x00,0x00,0x00,0x02,0x06,0x7E,0x40,0x40,0x40,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 438
+0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 439
+0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 443
+0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x84,0x88,0xF8,0xCC,0xC6,0xC6,0x00,0x00,0x00, // 461
+0x00,0x00,0x00,0xFC,0x86,0x86,0x86,0x86,0xC6,0xC6,0xC6,0xC6,0xDC,0x00,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0x00,0xFC,0x86,0x86,0xC6,0xC6,0xC6,0x06,0x1C,0x00,0x00,0x00, // 463
+0x1C,0x32,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 464
+0x00,0x08,0x14,0x32,0x61,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 465
+0x1C,0x32,0x00,0x3E,0x41,0x40,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 466
+0x00,0x08,0x14,0x32,0x61,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00,0x00, // 467
+0x1C,0x32,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 468
+0x08,0x14,0x32,0x00,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // 469
+0x08,0x14,0x32,0x61,0x02,0x02,0x02,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 470
+0x00,0x08,0x14,0x32,0x61,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x04,0x00,0x00, // 471
+0x1C,0x32,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00,0x00, // 472
+0x00,0x08,0x14,0x32,0x61,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00,0x00, // 473
+0x1C,0x32,0x00,0x49,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00,0x00, // 474
+0x00,0x08,0x14,0x32,0x61,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 475
+0x1C,0x32,0x00,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 476
+0x00,0x08,0x14,0x32,0x61,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00,0x00, // 477
+0x18,0x18,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // 478
+0x20,0x30,0x00,0x20,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x3E,0x00,0x00,0x00,0x00, // 479
+0x18,0x18,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 480
+0x00,0x00,0x08,0x1C,0x08,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 481
+0x18,0x18,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // 482
+0x01,0x03,0x03,0x00,0x01,0x01,0x1F,0x21,0x31,0x31,0x31,0x1F,0x00,0x00,0x00,0x00, // 483
+0x08,0x1C,0x08,0x7F,0x40,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 484
+0x0C,0x0C,0x00,0x0E,0x08,0x08,0x1E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 485
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00,0x00, // 486
+0x00,0x0C,0x0C,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 487
+0x18,0x18,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00,0x00, // 488
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x3E,0x49,0x49,0x6D,0x6D,0x6D,0x00,0x00,0x00,0x00, // 489
+0x18,0x18,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 490
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x3E,0x21,0x31,0x31,0x31,0x3E,0x20,0x20,0x00,0x00, // 491
+0x18,0x18,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00,0x00, // 492
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00,0x00, // 493
+0x0C,0x0C,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 494
+0x00,0x18,0x18,0x00,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 495
+0x00,0x7F,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x00,0x7F,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 497
+0x00,0x7F,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x00,0x3E,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 499
+0x00,0x7F,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x00,0x7F,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 501
+0x00,0x7F,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x00,0x3F,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 503
+0x81,0x42,0x3C,0x00,0x3E,0x41,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 504
+0x00,0x00,0x81,0x42,0x3C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00,0x00, // 505
+0x81,0x42,0x3C,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 506
+0x00,0x00,0x81,0x42,0x3C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 507
+0x81,0x42,0x3C,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 508
+0x00,0x00,0x81,0x42,0x3C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 509
+0x00,0x00,0x00,0x3E,0x41,0x40,0x40,0x67,0x61,0x61,0x61,0x3E,0x04,0x62,0x7C,0x00, // 510
+0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x02,0x3E,0x0C,0x66,0x7C, // 511
+0x00,0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x02,0x31,0x3E,0x00, // 512
+0x00,0x00,0x00,0x20,0x20,0x20,0x21,0x22,0x3E,0x31,0x31,0x31,0x02,0x31,0x3E,0x00, // 513
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x02,0x31,0x3E,0x00, // 514
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x02,0x31,0x3E,0x00, // 515
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x02,0x61,0x7E,0x00, // 516
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x08,0xC4,0xF8,0x00, // 517
+0x30,0x49,0x06,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 518
+0x00,0x00,0x30,0x49,0x06,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 519
+0x30,0x49,0x06,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 520
+0x00,0x00,0x30,0x49,0x06,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 521
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x10,0x23,0x1F,0x00, // 522
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x10,0x23,0x1F,0x00, // 523
+0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x20,0x43,0x3F,0x00, // 524
+0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x20,0x43,0x3F,0x00, // 525
+0x60,0x30,0x18,0x00,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00,0x00, // 526
+0x00,0x00,0x30,0x18,0x0C,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 527
+0x30,0x18,0x0C,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 528
+0x00,0x00,0x30,0x18,0x0C,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00,0x00, // 529
+0x06,0x0C,0x18,0x00,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00,0x00, // 530
+0x00,0x00,0x0C,0x18,0x30,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 531
+0x41,0x41,0x00,0x49,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00,0x00, // 532
+0x00,0x00,0x00,0x00,0x63,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00,0x00, // 533
+0x00,0x00,0x00,0x22,0x23,0x23,0x26,0x3E,0x32,0x72,0x62,0xA2,0x00,0x00,0x00,0x00, // 534
+0x00,0x00,0x00,0x20,0x21,0x22,0x3E,0x29,0x31,0x31,0x71,0xB1,0x00,0x00,0x00,0x00, // 535
+0x00,0x00,0x00,0x7F,0x09,0x0B,0x0E,0x0C,0x1C,0x3C,0x6C,0x0C,0x00,0x00,0x00,0x00, // 536
+0x00,0x00,0x00,0x08,0x09,0x0A,0x3E,0x08,0x1C,0x3C,0x6C,0xCC,0x00,0x00,0x00,0x00, // 537
+0x30,0x18,0x18,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 538
+0x00,0x00,0x18,0x0C,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 539
+0x00,0x18,0x0C,0x4D,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 540
+0x00,0x00,0x18,0x0C,0x0C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 541
+0x18,0x18,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 542
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 543
+0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x60,0x7F,0x0C,0x66,0x7C,0x00, // 544
+0x00,0x00,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x66,0x7C,0x00, // 545
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0xC2,0xC2,0x64,0x38,0x64,0xC2,0xC2,0x7C,0x00, // 546
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0x80,0xC0,0xC0,0xC0,0x7C,0x06,0x06,0x3C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x62,0x62,0x62,0x02,0x02,0x02,0x00, // 548
+0x00,0x00,0x78,0x84,0x04,0x04,0x7C,0xC4,0xC4,0xC4,0xC4,0x78,0x00,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 550
+0x00,0x00,0x7C,0x82,0x02,0x02,0x7E,0x82,0x86,0x86,0x86,0x86,0x00,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x00,0x81,0xC1,0x42,0x62,0x62,0x3C,0x18,0x00,0x00,0x00,0x00, // 552
+0x00,0x00,0xFE,0x0C,0x30,0x40,0x40,0x40,0x3C,0xC0,0x80,0x7C,0x02,0x02,0x3C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x62,0x62,0x7C,0x60,0x60,0x60,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x82,0xC0,0xC0,0x7C,0x02,0x7C,0x00,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0xC2,0xC2,0xC2,0x7C,0x00,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x44,0x38,0x38,0x64,0xC2,0x82,0x00,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0xD2,0xD2,0xD2,0x7C,0x10,0x10,0x10,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x64,0x82,0x92,0x92,0xD2,0xD2,0x6C,0x00,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x28,0x44,0x82,0x82,0xC2,0xC2,0xC2,0xC2,0xFE,0x00,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0x82,0x00,0x00,0x7C,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0xC2,0xC2,0xC2,0xC2,0xC2,0x00,0x00,0x00,0x00, // 562
+0x00,0x00,0x92,0x92,0x92,0xD2,0xD2,0xD2,0x7C,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 563
+0x06,0x0C,0x08,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x00,0x00,0x18,0x30,0x00,0x3A,0x44,0x64,0x64,0x3B,0x00,0x00,0x00,0x00, // 565
+0x00,0x00,0x00,0x00,0x0C,0x18,0x00,0x1E,0x20,0x3C,0x30,0x1E,0x00,0x00,0x00,0x00, // 566
+0x00,0x00,0x00,0x18,0x30,0x00,0x7C,0x42,0x42,0x62,0x62,0x62,0x02,0x02,0x02,0x00, // 567
+0x00,0x00,0x0C,0x18,0x00,0x10,0x10,0x10,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 568
+0x00,0x00,0x00,0x0C,0x18,0x00,0x3C,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00,0x00, // 569
+0x00,0x00,0x00,0x0C,0x18,0x00,0x82,0x82,0xC2,0xC2,0xC2,0x7C,0x00,0x00,0x00,0x00, // 570
+0x00,0x00,0x0C,0x18,0x00,0x64,0x82,0x92,0x92,0xD2,0xD2,0x6C,0x00,0x00,0x00,0x00, // 571
+0x00,0x30,0x60,0xDE,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 572
+0x00,0x30,0x60,0xDF,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 573
+0x00,0x30,0x60,0xC1,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 574
+0x00,0x18,0x30,0x68,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 575
+0x00,0x30,0x60,0xDE,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 576
+0x00,0x30,0x60,0xC3,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 577
+0x00,0x00,0x30,0x60,0xDC,0x22,0x41,0x61,0x61,0x22,0x22,0x63,0x00,0x00,0x00,0x00, // 578
+0x00,0x00,0x00,0x00,0xC6,0x10,0x10,0x10,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0x00,0xC6,0x00,0x82,0x82,0xC2,0xC2,0xC2,0x7C,0x00,0x00,0x00,0x00, // 580
+0x00,0x0C,0x18,0xD6,0x00,0x10,0x10,0x10,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 581
+0x00,0x00,0x0C,0x18,0xD6,0x00,0x82,0x82,0xC2,0xC2,0xC2,0x7C,0x00,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x28,0x44,0x44,0x82,0x82,0xC2,0xC2,0xC2,0xC2,0x00,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x00,0x3F,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 584
+0x00,0x00,0x7F,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 585
+0x08,0x1C,0x08,0x00,0x3E,0x41,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 586
+0x00,0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00,0x00, // 587
+0x00,0x00,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // 588
+0x00,0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 589
+0x00,0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 590
+0x00,0x00,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00,0x00, // 591
+0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 592
+0x00,0x00,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 593
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 594
+0x00,0x00,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00,0x00, // 595
+0x00,0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 596
+0x00,0x00,0x00,0x41,0x41,0x41,0x22,0x1C,0x22,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x3E,0x20,0x20,0x00,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x1E,0x31,0x31,0x31,0x00,0x00,0x00,0x00, // 603
+0x00,0x00,0x00,0x00,0x33,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00,0x00, // 604
+0x00,0x00,0x63,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00,0x00, // 606
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 607
+0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 608
+0x00,0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x04,0x00,0x00, // 609
+0x00,0x00,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 610
+0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00,0x00, // 611
+0x00,0x00,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x62,0x62,0x62,0x66,0x66,0x66,0x7C,0x40,0x40,0x80,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00,0x00, // 616
+0x00,0x00,0x00,0x3E,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 617
+0x00,0x00,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00,0x00, // 618
+0x00,0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00, // 619
+0x00,0x00,0x00,0x7F,0x41,0x01,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00,0x00, // 620
+0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 621
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 622
+0x00,0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 623
+0x00,0x00,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00,0x00, // 624
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 625
+0x00,0x00,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00,0x00, // 626
+0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 627
+0x00,0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 628
+0x00,0x00,0x00,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 629
+0x00,0x00,0x00,0x41,0x41,0x41,0x22,0x1C,0x22,0x61,0x61,0x61,0x00,0x00,0x00,0x00, // 630
+0x00,0x00,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00, // 631
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 632
+};
+
+unsigned char BR14[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x7E,0x00,0x00, // 
+0x00,0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0x7E,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x3C,0x5A,0xFF,0xFF,0x66,0x18,0x3C,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x5A,0x18,0x3C,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF, // \n
+0x00,0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0x78,0x00,0x00, //
+0x00,0x00,0x1C,0x22,0x22,0x22,0x1C,0x08,0x3E,0x08,0x08,0x00,0x00,0x00, //
+0x00,0x00,0x1F,0x11,0x1F,0x10,0x10,0x10,0x30,0x70,0x60,0x00,0x00,0x00, // \r
+0x00,0x00,0x3F,0x21,0x3F,0x21,0x21,0x21,0x23,0x67,0xE6,0x40,0x00,0x00, // 
+0x00,0x00,0x00,0x1C,0x2A,0x4B,0x7D,0x75,0x22,0x1C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x40,0x60,0x70,0x7C,0x7F,0x7C,0x70,0x60,0x40,0x00,0x00,0x00, // 
+0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0xC3,0xC3,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x66,0x66,0x00,0x66,0x66,0x00,0x00, // 
+0x00,0x00,0x3F,0x49,0x49,0x49,0x39,0x09,0x09,0x09,0x09,0x00,0x00,0x00, // 
+0x00,0x3C,0x42,0x20,0x18,0x24,0x42,0x42,0x24,0x18,0x04,0x42,0x3C,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0x10,0x18,0x08,0x7E,0x3C,0x18,0x7E,0x00, // 
+0x00,0x00,0x08,0x1C,0x3E,0x08,0x08,0x08,0x08,0x0C,0x0C,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x18,0x08,0x08,0x08,0x08,0x3E,0x1C,0x08,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x04,0x66,0x7F,0x06,0x04,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x10,0x30,0x7F,0x33,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x0C,0x0C,0x16,0x16,0x22,0x22,0x41,0x7F,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x7F,0x41,0x22,0x22,0x34,0x3C,0x18,0x18,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x00,0x00, // !
+0x00,0x00,0x33,0x33,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x24,0x24,0xFF,0x24,0x64,0xFF,0x64,0x64,0x00,0x00,0x00,0x00, // #
+0x00,0x00,0x0C,0x0C,0x3F,0x4C,0x4C,0x3E,0x0B,0x0B,0x7E,0x08,0x08,0x00, // $
+0x00,0x00,0x08,0xC8,0xC8,0x08,0x18,0x18,0x1B,0x1B,0x18,0x00,0x00,0x00, // %
+0x00,0x00,0x1C,0x22,0x20,0x20,0x78,0x67,0x61,0x61,0x3E,0x00,0x00,0x00, // &
+0x00,0x00,0x18,0x18,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x18,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x18,0x00,0x00,0x00, // (
+0x00,0x00,0x0C,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x0C,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x4B,0x4B,0x3C,0x6A,0x6A,0x6A,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x10,0x20,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x30,0x60,0xC0,0x00,0x00,0x00, // /
+0x00,0x00,0x3E,0x41,0x41,0x41,0x43,0x43,0x43,0x43,0x3E,0x00,0x00,0x00, // 0
+0x00,0x00,0x08,0x08,0x08,0x08,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 1
+0x00,0x00,0x3E,0x41,0x01,0x01,0x3E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 2
+0x00,0x00,0x3C,0x42,0x02,0x3E,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00, // 3
+0x00,0x00,0x3E,0x42,0x42,0x42,0x42,0x42,0x7F,0x06,0x06,0x00,0x00,0x00, // 4
+0x00,0x00,0x7F,0x40,0x40,0x7E,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00, // 5
+0x00,0x00,0x3E,0x41,0x40,0x7E,0x43,0x43,0x43,0x43,0x3E,0x00,0x00,0x00, // 6
+0x00,0x00,0x7E,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00, // 7
+0x00,0x00,0x1C,0x22,0x22,0x22,0x3F,0x43,0x43,0x43,0x3E,0x00,0x00,0x00, // 8
+0x00,0x00,0x3E,0x41,0x41,0x41,0x41,0x3F,0x03,0x03,0x03,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x10,0x20,0x00, // ;
+0x00,0x00,0x04,0x08,0x10,0x30,0x70,0x30,0x10,0x08,0x04,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x7E,0x7E,0x00,0x00,0x7E,0x7E,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x10,0x08,0x04,0x06,0x07,0x06,0x04,0x08,0x10,0x00,0x00,0x00, // >
+0x00,0x00,0x7E,0x41,0x01,0x01,0x7E,0x60,0x00,0x60,0x60,0x00,0x00,0x00, // ?
+0x00,0x00,0x3E,0x41,0x9D,0x83,0x9F,0xB3,0xB3,0x9C,0xC0,0x7C,0x00,0x00, // @
+0x00,0x00,0x3E,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // A
+0x00,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // B
+0x00,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00, // C
+0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // D
+0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // E
+0x00,0x00,0x7F,0x40,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // F
+0x00,0x00,0x3E,0x41,0x40,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // G
+0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // H
+0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // I
+0x00,0x00,0x02,0x02,0x02,0x02,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00, // J
+0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // K
+0x00,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // L
+0x00,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00, // M
+0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // N
+0x00,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // O
+0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // P
+0x00,0x00,0x3E,0x41,0x41,0x41,0x41,0x41,0x41,0x47,0x3F,0x00,0x00,0x00, // Q
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // R
+0x00,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00, // S
+0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // T
+0x00,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // U
+0x00,0x00,0x61,0x61,0x61,0x61,0x62,0x22,0x22,0x22,0x1C,0x00,0x00,0x00, // V
+0x00,0x00,0x49,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00, // W
+0x00,0x00,0x41,0x41,0x41,0x22,0x1C,0x22,0x61,0x61,0x61,0x00,0x00,0x00, // X
+0x00,0x00,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // Y
+0x00,0x00,0x7F,0x41,0x01,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00, // Z
+0x00,0x00,0x1E,0x10,0x10,0x10,0x18,0x18,0x18,0x18,0x1E,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x0C,0x06,0x03,0x00,0x00,0x00, // \.
+0x00,0x00,0x3C,0x0C,0x0C,0x04,0x04,0x04,0x04,0x04,0x3C,0x00,0x00,0x00, // ]
+0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x14,0x32,0x61,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x7F,0x00, // _
+0x00,0x00,0x10,0x08,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, // a
+0x00,0x00,0x20,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x3E,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00, // c
+0x00,0x00,0x01,0x01,0x01,0x1F,0x21,0x31,0x31,0x31,0x1F,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // e
+0x00,0x00,0x06,0x08,0x08,0x1E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00, // g
+0x00,0x00,0x20,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00, // h
+0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // i
+0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x04,0x00, // j
+0x00,0x00,0x20,0x20,0x20,0x21,0x22,0x3E,0x31,0x31,0x31,0x00,0x00,0x00, // k
+0x00,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x3E,0x49,0x49,0x6D,0x6D,0x6D,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x3E,0x20,0x20,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x01,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00, // s
+0x00,0x00,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x31,0x31,0x31,0x12,0x12,0x0C,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x1E,0x31,0x31,0x31,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00, // z
+0x00,0x00,0x06,0x08,0x08,0x08,0x10,0x0C,0x0C,0x0C,0x06,0x00,0x00,0x00, // {
+0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00, // |
+0x00,0x00,0x30,0x18,0x18,0x08,0x04,0x08,0x08,0x08,0x30,0x00,0x00,0x00, // }
+0x00,0x00,0x00,0x00,0x00,0x30,0x49,0x06,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x08,0x1C,0x36,0x63,0x63,0x7F,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x04,0x02,0x7C, //
+0x00,0x00,0x21,0x21,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x08,0x1C,0x36,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x31,0x31,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x30,0x18,0x0C,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x1C,0x36,0x1C,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x04,0x02,0x3C, //
+0x00,0x08,0x1C,0x36,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x33,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x30,0x18,0x0C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x36,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, //
+0x00,0x08,0x1C,0x36,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, //
+0x00,0x30,0x18,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, //
+0x00,0x61,0x61,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x00,0x00,0x00, //
+0x1C,0x36,0x1C,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, //
+0x0C,0x18,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xF6,0x09,0x7F,0xC8,0xC8,0x77,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3F,0x48,0x48,0x48,0xFE,0xCC,0xCC,0xCF,0x00,0x00,0x00, //
+0x00,0x08,0x1C,0x36,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x31,0x31,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x30,0x18,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x08,0x1C,0x36,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x30,0x18,0x0C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x31,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00, //
+0x00,0x63,0x63,0x00,0x3E,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, //
+0x00,0x41,0x41,0x00,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x04,0x04,0x1E,0x21,0x30,0x30,0x31,0x1E,0x04,0x04,0x00, //
+0x00,0x00,0x38,0x44,0x44,0x40,0xF0,0x60,0x60,0x60,0xE2,0xFE,0x00,0x00, //
+0x00,0x00,0x46,0x46,0x46,0x3C,0x10,0x7E,0x10,0x7E,0x18,0x18,0x00,0x00, //
+0x00,0x00,0x7C,0x42,0x42,0x7C,0x64,0x64,0x6F,0x66,0x66,0x66,0x00,0x00, //
+0x00,0x00,0x0E,0x11,0x10,0x10,0x10,0x7E,0x18,0x18,0x18,0x98,0xF0,0x00, //
+0x00,0x00,0x0C,0x18,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x06,0x0C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, //
+0x00,0x00,0x1D,0x36,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00, //
+0x3B,0x6E,0x00,0x7E,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x64,0x64,0x3C,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x44,0x44,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x30,0x30,0x00,0x20,0x20,0xE0,0xC2,0xC2,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x20,0x63,0x66,0x6C,0x18,0x30,0x6E,0xC1,0x0E,0x10,0x1F, //
+0x00,0x00,0x20,0x20,0x63,0x66,0x6C,0x1A,0x36,0x6A,0xD2,0x3F,0x06,0x06, //
+0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x10,0x10,0x10,0x10,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00, //
+0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, //
+0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, //
+0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3A,0x44,0x64,0x64,0x3B,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00, //
+0x00,0x00,0x00,0xFE,0x86,0x86,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x64,0x64,0x64,0x64,0x64,0x00,0x00, //
+0x00,0x00,0x00,0xFE,0x82,0x40,0x20,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xC8,0xC8,0xC8,0xC8,0x70,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x62,0x62,0x7C,0x60,0xC0, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x10,0x10,0x18,0x18,0x18,0x00,0x00, //
+0x00,0x3E,0x08,0x1C,0x2A,0x49,0x69,0x69,0x2A,0x1C,0x08,0x3E,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x22,0x41,0x7F,0x61,0x22,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x22,0x41,0x61,0x61,0x22,0x22,0x63,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x62,0x62,0x62,0x3C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xD9,0xD9,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x03,0x06,0x7E,0xD9,0xD9,0xF1,0x7E,0x60,0xC0,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x1E,0x20,0x3C,0x30,0x1E,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x22,0x22,0x22,0x32,0x32,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x10,0x10,0x7E,0x18,0x18,0x00,0x60,0x7E,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x0C,0x08,0x10,0x20,0x00,0x60,0x7C,0x00,0x00, //
+0x00,0x00,0x04,0x08,0x10,0x30,0x10,0x08,0x04,0x00,0x60,0x7E,0x00,0x00, //
+0x00,0x00,0x0E,0x11,0x11,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x60,0x7E,0x00,0x00,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x24,0x34,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x08,0x08,0x08,0x08,0x08,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00, //
+0x00,0x3C,0x22,0x32,0x32,0x32,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x3C,0x42,0x02,0x7C,0x40,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x06,0x0C,0x18,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00, // 256
+0x06,0x0C,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 257
+0x00,0x0C,0x18,0x30,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00, // 258
+0x00,0x06,0x0C,0x18,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x00,0x00,0x00, // 259
+0x00,0x06,0x0C,0x18,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00, // 260
+0x00,0x03,0x06,0x0C,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00, // 261
+0x00,0x06,0x0C,0x18,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00, // 262
+0x0C,0x18,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 263
+0x0C,0x18,0x00,0x3E,0x41,0x41,0x40,0x60,0x61,0x61,0x3E,0x00,0x00,0x00, // 264
+0x0C,0x18,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 265
+0x30,0x60,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 266
+0x18,0x30,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 267
+0x18,0x30,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 268
+0x18,0x30,0x00,0x7C,0x42,0x42,0x42,0x7E,0x61,0x61,0x61,0x00,0x00,0x00, // 269
+0x0C,0x18,0x00,0x3E,0x41,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00, // 270
+0x0C,0x18,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 271
+0x18,0x30,0x00,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 272
+0x18,0x30,0x00,0x7F,0x41,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00, // 273
+0x66,0xCC,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 274
+0x18,0x0C,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 275
+0x18,0x0C,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 276
+0x30,0x18,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 277
+0x18,0x0C,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 278
+0x18,0x0C,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 279
+0x00,0x63,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 280
+0x00,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 281
+0x00,0x1C,0x36,0x1C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 282
+0x1C,0x36,0x1C,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 283
+0x00,0x00,0x3B,0x6E,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, // 284
+0x00,0x00,0x3B,0x6E,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 285
+0x00,0x00,0x1B,0x36,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 286
+0x3B,0x6E,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 287
+0x3B,0x6E,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 288
+0x1C,0x36,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 289
+0x3E,0x63,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 290
+0x1C,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 291
+0x1C,0x36,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 292
+0x1C,0x36,0x00,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 293
+0x00,0x31,0x1A,0x0C,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00, // 294
+0x00,0x31,0x1A,0x0C,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00, // 295
+0x00,0x31,0x1A,0x0C,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x00,0x00,0x00, // 296
+0x00,0x31,0x1A,0x0C,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00, // 297
+0x00,0x31,0x1A,0x0C,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00, // 298
+0x36,0x1C,0x08,0x3E,0x41,0x41,0x40,0x60,0x61,0x61,0x3E,0x00,0x00,0x00, // 299
+0x36,0x1C,0x08,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // 300
+0x36,0x1C,0x08,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 301
+0x36,0x1C,0x08,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 302
+0x36,0x1C,0x08,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 303
+0x36,0x1C,0x08,0x3E,0x41,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00, // 304
+0x36,0x1C,0x08,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 305
+0x36,0x1C,0x08,0x7F,0x41,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x04,0x62,0x7C, // 307
+0x00,0x00,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x62,0x7C, // 308
+0x00,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x04,0xC2,0xFC, // 309
+0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x04,0xC2,0xFC, // 310
+0x00,0x00,0x00,0x00,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x20,0x43,0x3F, // 311
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x20,0x43,0x3F, // 312
+0x00,0x00,0x3E,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x20,0x43,0x3F, // 313
+0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x20,0x43,0x3F, // 314
+0x00,0x00,0x0C,0x0C,0x00,0x3F,0x21,0x06,0x18,0x31,0x3F,0x00,0x00,0x00, // 315
+0x18,0x18,0x00,0x7F,0x41,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00, // 316
+0x00,0x00,0x08,0x08,0x09,0x0E,0x0C,0x0C,0x1C,0x2C,0x0C,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x01,0x3E,0x46,0x6A,0x72,0x62,0x7C,0x80,0x00,0x00, // 318
+0x00,0x00,0x20,0x21,0x22,0x24,0x38,0x30,0x70,0xB0,0x3F,0x00,0x00,0x00, // 319
+0x00,0x00,0x3F,0x43,0x47,0x49,0x49,0x51,0x51,0x61,0x7E,0x80,0x00,0x00, // 320
+0x00,0x04,0x04,0x0F,0x04,0x7C,0x84,0xC4,0xC4,0xC4,0x7C,0x00,0x00,0x00, // 321
+0x12,0x0C,0x0C,0x12,0x01,0x1F,0x21,0x31,0x31,0x31,0x1F,0x00,0x00,0x00, // 322
+0x00,0x00,0x7E,0x41,0xF9,0x41,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // 323
+0x03,0x03,0x05,0x05,0x05,0x7D,0x84,0xC4,0xC4,0xC4,0x7C,0x00,0x00,0x00, // 324
+0x06,0x06,0x12,0x12,0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 325
+0x06,0x06,0x0A,0x0A,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 326
+0x18,0x18,0x48,0x48,0x40,0x40,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 327
+0x00,0x81,0x42,0x3C,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, // 328
+0x00,0x81,0x42,0x3C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // 329
+0x42,0x3C,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 330
+0x00,0x00,0x81,0x42,0x3C,0x42,0x62,0x62,0x62,0x3C,0x42,0x81,0x00,0x00, // 331
+0xF0,0x40,0x40,0x40,0x7C,0x62,0x62,0x62,0x7C,0x60,0x60,0xF0,0x00,0x00, // 332
+0x00,0x00,0xE0,0x40,0x40,0x78,0x64,0x64,0x78,0x60,0xF0,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00,0x00, // 334
+0x00,0x7E,0x81,0xB9,0xA9,0xBD,0xB5,0xB5,0xB5,0x81,0x7E,0x00,0x00,0x00, // 335
+0x00,0x7E,0x81,0x9D,0xA1,0xA1,0xB1,0xB1,0x9D,0x81,0x7E,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 337
+0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x18,0x18,0x18,0x18,0x18,0x00, // 338
+0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0xFF, // 342
+0xE1,0x12,0x72,0x34,0xE4,0x08,0x08,0x10,0x10,0x26,0x2A,0x4A,0x4F,0x82, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x62,0x7C, // 344
+0x00,0x00,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x40,0x40,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0xE0,0x10,0x70,0x30,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x33,0x66,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x43,0x3F, // 349
+0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x42,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x33,0x66,0xCC,0x00,0x3C,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00, // 353
+0x66,0xCC,0x00,0x7C,0x86,0x86,0x82,0x82,0x82,0x82,0x7C,0x00,0x00,0x00, // 354
+0x36,0x1C,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 355
+0xD8,0x70,0x20,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 356
+0x36,0x1C,0x08,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 357
+0x00,0x36,0x1C,0x08,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // 358
+0x1B,0x0E,0x04,0x04,0x04,0x04,0x7C,0x84,0xC4,0xC4,0x7C,0x00,0x00,0x00, // 359
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 360
+0x00,0x00,0xFE,0x62,0x62,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 361
+0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 362
+0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xFF,0xC3,0x81, // 363
+0x00,0x00,0xD6,0xD6,0x54,0x54,0x7C,0x7C,0x54,0xD6,0xD6,0xD6,0x00,0x00, // 364
+0x00,0x00,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00, // 365
+0x6C,0x10,0xC6,0xC6,0xCE,0xCE,0xD6,0xE6,0xE6,0xC6,0xC6,0xC6,0x00,0x00, // 366
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 367
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 368
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 369
+0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00, // 370
+0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x00, // 371
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x00,0x00, // 372
+0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x00,0x00, // 373
+0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xFF,0x03,0x00, // 374
+0x00,0x00,0xF8,0xB0,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x7C,0x00,0x00, // 375
+0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xF3,0xDB,0xDB,0xDB,0xDB,0xF3,0x00,0x00, // 376
+0x00,0x00,0xF0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 377
+0x00,0x00,0x7C,0xC6,0x06,0x26,0x3E,0x26,0x06,0x06,0xC6,0x7C,0x00,0x00, // 378
+0x00,0x00,0xCE,0xDB,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xDB,0xCE,0x00,0x00, // 379
+0x00,0x00,0x3F,0x66,0x66,0x66,0x3E,0x3E,0x66,0x66,0x66,0xE7,0x00,0x00, // 380
+0x00,0x02,0x06,0x3C,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x7E,0x32,0x32,0x30,0x30,0x30,0x78,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x36,0x66,0x66,0x66,0xFF,0xC3,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x54,0xD6,0xD6,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x06,0x66,0x3C,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00, // 387
+0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xD6,0xC6,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C,0x00, // 395
+0x00,0x00,0x00,0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x03,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF8,0xB0,0x30,0x3E,0x33,0x33,0x7E,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x06,0x1E,0x06,0x66,0x3C,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xCE,0xDB,0xDB,0xFB,0xDB,0xDB,0xCE,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0xFC,0x6C,0xCC,0xCE,0x00,0x00, // 406
+0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xF8,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xF0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 408
+0x00,0x00,0x3C,0x42,0x02,0x3E,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00, // 409
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // 410
+0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xCC,0xCC,0x00,0x00,0x00, // 411
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x06,0x0C, // 412
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x0C, // 413
+0x0C,0x18,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // 414
+0x00,0x00,0x00,0x0C,0x18,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, // 415
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 416
+0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00, // 418
+0x00,0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDA,0xDA,0xDA,0xDE,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00, // 420
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x00,0x00, // 422
+0x00,0x0C,0x18,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xCC,0xC6,0xC6,0x00,0x00, // 423
+0x00,0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xF8,0xCC,0xC6,0xC6,0x00,0x00, // 424
+0x00,0x6C,0x10,0x82,0x82,0xC2,0xC2,0x7E,0x02,0x02,0xC2,0x7C,0x00,0x00, // 425
+0x00,0x00,0x00,0x00,0x6C,0x10,0x82,0x82,0xC2,0xC2,0x7E,0x02,0xC2,0x7C, // 426
+0x00,0x00,0x00,0x82,0x82,0x82,0x82,0xC2,0xC2,0xC2,0xC2,0xFE,0x10,0x10, // 427
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0xC2,0xC2,0xFE,0x10,0x10, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00, // 430
+0x00,0x00,0x10,0x10,0x70,0x7E,0x10,0x18,0x38,0x3C,0x18,0x18,0x00,0x00, // 431
+0x00,0x00,0x10,0x10,0x70,0x7E,0x10,0x3C,0x18,0x78,0x7E,0x18,0x00,0x00, // 432
+0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00, // 433
+0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x02,0x06,0x7E,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 437
+0x00,0x00,0x02,0x06,0x7E,0x40,0x40,0x40,0x60,0x60,0x60,0x00,0x00,0x00, // 438
+0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00, // 439
+0x00,0x6E,0xD8,0xD8,0xD8,0xD8,0xDE,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 443
+0x00,0x78,0x80,0x80,0x80,0x78,0x00,0x3C,0x22,0x3E,0x24,0x22,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x38,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x06,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x82,0x84,0x88,0xF8,0xCC,0xC6,0xC6,0x00,0x00, // 461
+0x00,0x00,0xFC,0x86,0x86,0x86,0x86,0x86,0xC6,0xC6,0xC6,0xDC,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0xFC,0x86,0x86,0xC6,0xC6,0xC6,0x06,0x1C,0x00,0x00, // 463
+0x08,0x14,0x00,0x3E,0x61,0x41,0x40,0x60,0x61,0x61,0x3E,0x00,0x00,0x00, // 464
+0x08,0x14,0x32,0x61,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00, // 465
+0x08,0x14,0x00,0x3E,0x61,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 466
+0x08,0x14,0x32,0x61,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00, // 467
+0x08,0x14,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 468
+0x08,0x14,0x32,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x31,0x00,0x00,0x00, // 469
+0x08,0x14,0x32,0x63,0x02,0x02,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00, // 470
+0x08,0x14,0x32,0x61,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x04,0x00, // 471
+0x08,0x14,0x00,0x3E,0x61,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00, // 472
+0x08,0x14,0x32,0x61,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00, // 473
+0x08,0x14,0x41,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00, // 474
+0x08,0x14,0x32,0x61,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 475
+0x08,0x14,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 476
+0x08,0x14,0x32,0x61,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00, // 477
+0x18,0x18,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // 478
+0x30,0x30,0x00,0x20,0x20,0x3E,0x21,0x31,0x31,0x31,0x3E,0x00,0x00,0x00, // 479
+0x18,0x18,0x00,0x3E,0x41,0x41,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00, // 480
+0x00,0x00,0x0C,0x0C,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00, // 481
+0x18,0x18,0x00,0x7E,0x41,0x41,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // 482
+0x03,0x03,0x00,0x01,0x01,0x1F,0x21,0x31,0x31,0x31,0x1F,0x00,0x00,0x00, // 483
+0x18,0x18,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 484
+0x0C,0x0C,0x00,0x0E,0x08,0x1E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 485
+0x00,0x00,0x0C,0x0C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00, // 486
+0x18,0x18,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 487
+0x18,0x18,0x00,0x3E,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00, // 488
+0x00,0x00,0x18,0x18,0x00,0x3E,0x49,0x49,0x6D,0x6D,0x6D,0x00,0x00,0x00, // 489
+0x18,0x18,0x00,0x7E,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 490
+0x00,0x00,0x0C,0x0C,0x00,0x3E,0x21,0x31,0x31,0x31,0x3E,0x20,0x20,0x00, // 491
+0x18,0x18,0x00,0x3E,0x41,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00, // 492
+0x00,0x00,0x0C,0x0C,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00, // 493
+0x0C,0x0C,0x00,0x7F,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 494
+0x18,0x18,0x00,0x08,0x08,0x3E,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 495
+0x7F,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x7F,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // 497
+0x3E,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x3E,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 499
+0x7F,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x7F,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 501
+0x7F,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x3F,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 503
+0x42,0x3C,0x00,0x3E,0x41,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 504
+0x00,0x00,0x42,0x3C,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x1E,0x00, // 505
+0x42,0x3C,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 506
+0x00,0x00,0x42,0x3C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 507
+0x42,0x3C,0x01,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 508
+0x00,0x00,0x42,0x3C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 509
+0x00,0x00,0x3E,0x41,0x40,0x40,0x67,0x61,0x61,0x61,0x3E,0x04,0x62,0x7C, // 510
+0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1F,0x01,0x0E,0x61,0x7E, // 511
+0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x02,0x31,0x3E, // 512
+0x00,0x00,0x20,0x20,0x20,0x21,0x22,0x3E,0x31,0x31,0x31,0x02,0x31,0x3E, // 513
+0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x02,0x31,0x3E, // 514
+0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x31,0x02,0x31,0x3E, // 515
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x02,0x61,0x7E, // 516
+0x00,0x00,0x00,0x00,0x00,0x3E,0x20,0x30,0x30,0x30,0x30,0x08,0x64,0x78, // 517
+0x30,0x49,0x06,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 518
+0x00,0x30,0x49,0x06,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 519
+0x30,0x49,0x06,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 520
+0x00,0x30,0x49,0x06,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 521
+0x00,0x00,0x10,0x10,0x10,0x10,0x18,0x18,0x18,0x18,0x18,0x20,0x43,0x3F, // 522
+0x00,0x00,0x18,0x18,0x00,0x10,0x10,0x18,0x18,0x18,0x18,0x20,0x43,0x3F, // 523
+0x00,0x00,0x41,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x20,0x43,0x3F, // 524
+0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x20,0x43,0x3F, // 525
+0x30,0x18,0x00,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00, // 526
+0x00,0x00,0x18,0x0C,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 527
+0x30,0x18,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 528
+0x00,0x00,0x18,0x0C,0x00,0x31,0x31,0x31,0x31,0x21,0x1F,0x01,0x01,0x00, // 529
+0x0C,0x18,0x41,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00, // 530
+0x00,0x00,0x0C,0x18,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 531
+0x00,0x63,0x08,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x3E,0x00,0x00,0x00, // 532
+0x00,0x00,0x00,0x63,0x00,0x49,0x49,0x6D,0x6D,0x6D,0x3E,0x00,0x00,0x00, // 533
+0x00,0x00,0x42,0x43,0x42,0x46,0x7E,0x72,0x62,0x62,0xE2,0x00,0x00,0x00, // 534
+0x00,0x00,0x20,0x21,0x22,0x3E,0x29,0x31,0x31,0x71,0xF1,0x00,0x00,0x00, // 535
+0x00,0x00,0x7F,0x09,0x0A,0x0C,0x0C,0x1C,0x3C,0x6C,0x0C,0x00,0x00,0x00, // 536
+0x00,0x00,0x08,0x09,0x0A,0x3E,0x08,0x1C,0x3C,0x6C,0xCC,0x00,0x00,0x00, // 537
+0x30,0x18,0x18,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 538
+0x00,0x30,0x18,0x18,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 539
+0x18,0x0C,0x4D,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 540
+0x00,0x18,0x0C,0x0C,0x00,0x21,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 541
+0x18,0x18,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 542
+0x00,0x00,0x0C,0x0C,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // 543
+0x00,0x00,0x40,0x40,0x40,0x40,0x60,0x60,0x60,0x60,0x7F,0x0C,0x06,0x7C, // 544
+0x00,0x00,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x06,0x7C, // 545
+0x00,0x00,0x00,0x00,0x00,0x82,0x42,0x24,0x18,0x28,0x44,0x64,0x38,0x00, // 546
+0x00,0x00,0x7E,0x02,0x04,0x18,0x20,0x30,0x30,0x1C,0x02,0x02,0x0C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x62,0x62,0x62,0x02,0x02,0x02, // 548
+0x00,0x00,0x3C,0x42,0x02,0x02,0x3E,0x42,0x62,0x62,0x3C,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 550
+0x00,0x00,0x3C,0x42,0x02,0x02,0x3E,0x42,0x42,0x62,0x62,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x82,0x82,0x82,0xC2,0x64,0x38,0x10,0x00,0x00,0x00, // 552
+0x00,0x00,0x7E,0x04,0x08,0x10,0x0E,0x10,0x20,0x1E,0x02,0x02,0x0C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x78,0x84,0x84,0xC4,0xC4,0xF8,0xC0,0xC0,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x80,0x80,0x78,0x04,0xF8,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x44,0x38,0x6C,0xC2,0x80,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0x92,0x92,0xD2,0xD2,0xD2,0x7C,0x10,0x10,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x64,0x82,0x92,0xD2,0xD2,0x6C,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x28,0x44,0x82,0x82,0xC2,0xC2,0xC2,0xFE,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0xC6,0x82,0x00,0x7C,0x00,0x82,0xC6,0xFE,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0x82,0x82,0x82,0xC2,0xC2,0xC2,0xC2,0xC2,0x00,0x00,0x00, // 562
+0x00,0x00,0x92,0x92,0xD2,0xD2,0xD2,0x7C,0x10,0x10,0x10,0x00,0x00,0x00, // 563
+0x06,0x0C,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x00,0x0C,0x18,0x00,0x3A,0x44,0x64,0x64,0x3B,0x00,0x00,0x00, // 565
+0x00,0x00,0x00,0x0C,0x18,0x00,0x1E,0x20,0x3C,0x30,0x1E,0x00,0x00,0x00, // 566
+0x00,0x00,0x18,0x30,0x00,0x7C,0x42,0x42,0x62,0x62,0x62,0x02,0x02,0x02, // 567
+0x00,0x00,0x18,0x30,0x00,0x20,0x20,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 568
+0x00,0x00,0x0C,0x18,0x00,0x3C,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00, // 569
+0x00,0x00,0x0C,0x18,0x00,0x42,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00, // 570
+0x00,0x00,0x0C,0x18,0x00,0x64,0x82,0x92,0xD2,0xD2,0x6C,0x00,0x00,0x00, // 571
+0x30,0x60,0xDE,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 572
+0x30,0x60,0xDF,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 573
+0x30,0x60,0xC1,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 574
+0x18,0x30,0x68,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 575
+0x30,0x60,0xDE,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 576
+0x30,0x60,0xC3,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 577
+0x00,0x30,0x60,0xDC,0x22,0x41,0x61,0x61,0x22,0x22,0x63,0x00,0x00,0x00, // 578
+0x00,0x00,0x00,0xD8,0x00,0x20,0x20,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0x66,0x00,0x42,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00, // 580
+0x0C,0x18,0x20,0xCC,0x00,0x20,0x20,0x30,0x30,0x30,0x1C,0x00,0x00,0x00, // 581
+0x0C,0x18,0x10,0x66,0x00,0x42,0x42,0x62,0x62,0x62,0x3C,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x28,0x44,0x44,0x82,0x82,0xC2,0xC2,0xC2,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x3F,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, // 584
+0x00,0x7F,0x00,0x3E,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 585
+0x08,0x1C,0x08,0x3E,0x41,0x40,0x67,0x61,0x61,0x61,0x3E,0x00,0x00,0x00, // 586
+0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00, // 587
+0x00,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // 588
+0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 589
+0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 590
+0x00,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00, // 591
+0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 592
+0x00,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 593
+0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 594
+0x00,0x00,0x3E,0x41,0x41,0x40,0x60,0x60,0x61,0x61,0x3E,0x00,0x00,0x00, // 595
+0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 596
+0x00,0x00,0x41,0x41,0x41,0x22,0x1C,0x22,0x61,0x61,0x61,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x3E,0x01,0x1F,0x31,0x31,0x1E,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x3E,0x21,0x31,0x31,0x31,0x3E,0x20,0x20,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x30,0x30,0x31,0x1E,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x21,0x21,0x1E,0x31,0x31,0x31,0x00,0x00,0x00, // 603
+0x00,0x00,0x00,0x33,0x00,0x1E,0x21,0x3F,0x30,0x31,0x1E,0x00,0x00,0x00, // 604
+0x00,0x63,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x1E,0x03,0x23,0x1E,0x00,0x00,0x00, // 606
+0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 607
+0x00,0x00,0x00,0x36,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 608
+0x00,0x00,0x0C,0x0C,0x00,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x04,0x04,0x00, // 609
+0x00,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 610
+0x00,0x00,0x02,0x02,0x02,0x02,0x03,0x03,0x43,0x43,0x3E,0x00,0x00,0x00, // 611
+0x00,0x00,0x3E,0x41,0x40,0x40,0x3E,0x03,0x03,0x43,0x3E,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x78,0xCC,0xD8,0xFC,0xC6,0xE6,0xDC,0xC0,0xC0,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x62,0x62,0x7C,0x60,0xC0, // 615
+0x00,0x00,0x00,0x00,0x00,0x1E,0x21,0x31,0x31,0x31,0x1E,0x00,0x00,0x00, // 616
+0x00,0x00,0x3E,0x22,0x22,0x22,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 617
+0x00,0x00,0x7C,0x42,0x42,0x7E,0x61,0x61,0x61,0x61,0x7E,0x00,0x00,0x00, // 618
+0x00,0x00,0x7F,0x40,0x40,0x7E,0x60,0x60,0x60,0x60,0x7F,0x00,0x00,0x00, // 619
+0x00,0x00,0x7F,0x41,0x01,0x02,0x0C,0x30,0x60,0x61,0x7F,0x00,0x00,0x00, // 620
+0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 621
+0x00,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 622
+0x00,0x00,0x42,0x42,0x42,0x44,0x7E,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 623
+0x00,0x00,0x3E,0x49,0x49,0x49,0x69,0x69,0x69,0x69,0x69,0x00,0x00,0x00, // 624
+0x00,0x00,0x7E,0x41,0x41,0x41,0x61,0x61,0x61,0x61,0x61,0x00,0x00,0x00, // 625
+0x00,0x00,0x3E,0x43,0x43,0x41,0x41,0x41,0x41,0x41,0x3E,0x00,0x00,0x00, // 626
+0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x60,0x60,0x60,0x60,0x00,0x00,0x00, // 627
+0x00,0x00,0x7F,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 628
+0x00,0x00,0x43,0x43,0x43,0x43,0x3E,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 629
+0x00,0x00,0x41,0x41,0x41,0x22,0x1C,0x22,0x61,0x61,0x61,0x00,0x00,0x00, // 630
+0x00,0x36,0x00,0x08,0x08,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00, // 631
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 632
+};
+
diff --git a/setedit/fonts/raw2sft.cc b/setedit/fonts/raw2sft.cc
new file mode 100644
index 0000000..d86664e
--- /dev/null
+++ b/setedit/fonts/raw2sft.cc
@@ -0,0 +1,61 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Salvador Eduardo Tropea
+ Covered by the GPL license.
+
+ Description:
+ This is a very simple and limited converter that creates an SFT file from
+a raw font. The raw font *must* be 8 pixels wide and *must* be encoded in
+code page CP 437. It also *must* contain 256 symbols.
+ Only for little endian!!
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+ if (argc!=4)
+ {
+ printf("Usage: %s raw_font new_sft_file fantasy_name\n",argv[0]);
+ return 1;
+ }
+ FILE *f=fopen(argv[1],"rb");
+ if (!f)
+ {
+ printf("Can't open %s\n",argv[1]);
+ return 2;
+ }
+ FILE *d=fopen(argv[2],"wb");
+ if (!d)
+ {
+ printf("Can't create %s\n",argv[2]);
+ return 3;
+ }
+ fprintf(d,"SET's editor font%c",26);
+
+ fseek(f,0,SEEK_END);
+ int length=ftell(f);
+ fseek(f,0,SEEK_SET);
+
+ int aux=1;
+ fwrite(&aux,4,1,d);
+ aux=1;
+ fwrite(&aux,4,1,d);
+ aux=strlen(argv[3])+1;
+ fwrite(&aux,2,1,d);
+ fwrite(argv[3],aux-1,1,d);
+ aux=0;
+ fwrite(&aux,4,1,d);
+ aux=255;
+ fwrite(&aux,4,1,d);
+ aux=length/256;
+ fwrite(&aux,4,1,d);
+
+ char b[length];
+ fread(b,length,1,f);
+ fwrite(b,length,1,d);
+
+ return 0;
+}
diff --git a/setedit/fonts/roman.016 b/setedit/fonts/roman.016
new file mode 100644
index 0000000..a96eee8
--- /dev/null
+++ b/setedit/fonts/roman.016
Binary files differ
diff --git a/setedit/fonts/roman.sft b/setedit/fonts/roman.sft
new file mode 100644
index 0000000..2d033e7
--- /dev/null
+++ b/setedit/fonts/roman.sft
Binary files differ
diff --git a/setedit/fonts/rombios.cc b/setedit/fonts/rombios.cc
new file mode 100644
index 0000000..53d782e
--- /dev/null
+++ b/setedit/fonts/rombios.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include "common1.h"
+#include "rombios0.000"
+
+Font RomBIOS16={0,NUM_FONTS,16,BR16};
+Font RomBIOS14={0,NUM_FONTS,14,BR14};
+
+char *Name="ROM BIOS";
+
+#define PREFIX BR
+#define PREFIXS "BR"
+#define NAME_FONT "rombios.sft"
+#define ARRAY1 RomBIOS16
+#define ARRAY2 RomBIOS14
+#define NAME_PART "rombios%d.%03d"
+
+#include "common2.h"
diff --git a/setedit/fonts/rombios.sft b/setedit/fonts/rombios.sft
new file mode 100644
index 0000000..addabe3
--- /dev/null
+++ b/setedit/fonts/rombios.sft
Binary files differ
diff --git a/setedit/fonts/rombios0.000 b/setedit/fonts/rombios0.000
new file mode 100644
index 0000000..6d5382f
--- /dev/null
+++ b/setedit/fonts/rombios0.000
@@ -0,0 +1,1272 @@
+unsigned char BR16[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF, // \n
+0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, // \r
+0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00, // 
+0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00, // 
+0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // !
+0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, // #
+0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00, // $
+0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, // %
+0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // &
+0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, // (
+0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00, // /
+0x00,0x00,0x38,0x6C,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, // 1
+0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, // 2
+0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 3
+0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, // 4
+0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 5
+0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 6
+0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 7
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 8
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, // ;
+0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, // >
+0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // ?
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, // @
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // A
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // B
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // C
+0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // D
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // E
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // F
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, // G
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // H
+0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // I
+0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, // J
+0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // K
+0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // L
+0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // M
+0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // N
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // O
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // P
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, // Q
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // R
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // S
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // T
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // U
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, // V
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00, // W
+0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, // X
+0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // Y
+0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // Z
+0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, // \.
+0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00, // ]
+0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00, // _
+0x00,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // a
+0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // c
+0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // e
+0x00,0x00,0x1C,0x36,0x32,0x30,0x78,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, // g
+0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // h
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // i
+0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, // j
+0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // k
+0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // s
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // z
+0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // {
+0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // |
+0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, // }
+0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x18,0x70,0x00,0x00, //
+0x00,0x00,0xCC,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xCC,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x70,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0xC6,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, //
+0x38,0x6C,0x38,0x10,0x38,0x6C,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, //
+0x0C,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xEC,0x36,0x36,0x7E,0xD8,0xD8,0x6E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00, //
+0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00, //
+0x00,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x18,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0xF8,0xCC,0xCC,0xF8,0xC4,0xCC,0xDE,0xCC,0xCC,0xCC,0xC6,0x00,0x00,0x00,0x00, //
+0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, //
+0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x60,0xE0,0x62,0x66,0x6C,0x18,0x30,0x60,0xDC,0x86,0x0C,0x18,0x3E,0x00,0x00, //
+0x00,0x60,0xE0,0x62,0x66,0x6C,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, //
+0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, //
+0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x78,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xC6,0xCC,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x6C,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x3C,0x66,0x0C,0x18,0x32,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 256
+0x0C,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 257
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 258
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 259
+0x00,0x00,0x0C,0x18,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // 260
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, // 261
+0x00,0x0C,0x18,0x30,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // 262
+0x0C,0x18,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 263
+0x0C,0x18,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // 264
+0x0C,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 265
+0x30,0x60,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 266
+0x0C,0x18,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 267
+0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 268
+0x18,0x30,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xF6,0x00,0x00,0x00,0x00, // 269
+0x18,0x30,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 270
+0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 271
+0x0C,0x18,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 272
+0x18,0x30,0x00,0xFE,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 273
+0x36,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 274
+0x60,0x30,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 275
+0x30,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 276
+0x30,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 277
+0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 278
+0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 279
+0x00,0xC6,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 280
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 281
+0x00,0x78,0xCC,0x78,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 282
+0x38,0x6C,0x38,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 283
+0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 284
+0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 285
+0x00,0x00,0x36,0x6C,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 286
+0x76,0xDC,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 287
+0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 288
+0x7C,0xC6,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 289
+0x38,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 290
+0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 291
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 292
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 293
+0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 294
+0x00,0x00,0x6C,0x38,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 295
+0x00,0x00,0x6C,0x38,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 296
+0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // 297
+0x00,0x00,0x6C,0x38,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // 298
+0x66,0x3C,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // 299
+0x6C,0x38,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // 300
+0x6C,0x38,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 301
+0x6C,0x38,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 302
+0x6C,0x38,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xF6,0x00,0x00,0x00,0x00, // 303
+0x6C,0x38,0x00,0x7C,0xC6,0xC0,0x60,0x38,0x0C,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 304
+0x66,0x3C,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 305
+0x6C,0x38,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x18,0x0C,0x78,0x00, // 307
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x18,0x0C,0x78,0x00, // 308
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x18,0x0C,0x78,0x00, // 309
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x18,0x0C,0x78,0x00, // 310
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x18,0x30,0x1E,0x00, // 311
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x30,0x60,0x3C,0x00, // 312
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x18,0x30,0x1E,0x00, // 313
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x18,0x30,0x1E,0x00, // 314
+0x00,0x00,0x18,0x18,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, // 315
+0x18,0x18,0x00,0xFE,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 316
+0x00,0x00,0x38,0x1A,0x1E,0x1C,0x18,0x38,0x78,0x58,0x18,0x3C,0x00,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x7C,0xCE,0xDE,0xF6,0xE6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 318
+0x00,0x00,0xF0,0x64,0x6C,0x78,0x70,0xE0,0xE0,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 319
+0x00,0x04,0x7C,0xCE,0xCE,0xD6,0xD6,0xD6,0xD6,0xE6,0xE6,0x7C,0x40,0x00,0x00,0x00, // 320
+0x00,0x00,0x0C,0x0C,0x7E,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 321
+0x00,0x00,0x34,0x18,0x2C,0x06,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00, // 322
+0x00,0x00,0xF8,0x6C,0x66,0x66,0xF6,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, // 323
+0x00,0x00,0x1D,0x0D,0x0D,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 324
+0x00,0x00,0xEC,0x64,0x68,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 325
+0x00,0x06,0x12,0x34,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // 326
+0x00,0x00,0xF6,0x62,0x64,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 327
+0x00,0x00,0xC6,0x7C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 328
+0x00,0x00,0x66,0x3C,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 329
+0xC6,0x7C,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 330
+0x00,0x00,0x00,0x00,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0xC6,0x00,0x00,0x00,0x00, // 331
+0x00,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // 332
+0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00, // 334
+0x00,0x00,0x7C,0x82,0xB2,0xAA,0xB2,0xAA,0xAA,0x82,0x7C,0x00,0x00,0x00,0x00,0x00, // 335
+0x00,0x00,0x7C,0x82,0x9A,0xA2,0xA2,0xA2,0x9A,0x82,0x7C,0x00,0x00,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 337
+0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, // 338
+0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00, // 342
+0x00,0xE0,0x30,0x62,0x36,0xEC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x78,0x00,0x00, // 344
+0x00,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x00,0x18,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0x00,0x7C,0x06,0x3C,0x06,0x06,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x60,0x3C,0x00, // 349
+0x00,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x00,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x00,0x36,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 353
+0x36,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 354
+0x6C,0x38,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 355
+0xD8,0x70,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 356
+0xD8,0x70,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, // 357
+0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 358
+0x36,0x1C,0x00,0x0C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 359
+0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 360
+0x00,0x00,0xFE,0x62,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 361
+0x00,0x00,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 362
+0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xFF,0xC3,0x81,0x00,0x00, // 363
+0x00,0x00,0xDB,0xDB,0x5A,0x5A,0x7E,0x7E,0x5A,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00, // 364
+0x00,0x00,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 365
+0x6C,0x38,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 366
+0x00,0x00,0x1F,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xCF,0x00,0x00,0x00,0x00, // 367
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 368
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 369
+0x00,0x00,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x3C,0x00,0x00,0x00,0x00, // 370
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFF,0x03,0x03,0x00,0x00, // 371
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00, // 372
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00,0x00, // 373
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFF,0x03,0x03,0x00,0x00, // 374
+0x00,0x00,0xF8,0xF0,0xB0,0x30,0x3E,0x33,0x33,0x33,0x33,0x7E,0x00,0x00,0x00,0x00, // 375
+0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xF3,0xDB,0xDB,0xDB,0xDB,0xF3,0x00,0x00,0x00,0x00, // 376
+0x00,0x00,0xF0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 377
+0x00,0x00,0x7C,0xC6,0x06,0x26,0x3E,0x26,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 378
+0x00,0x00,0xCE,0xDB,0xDB,0xDB,0xFB,0xDB,0xDB,0xDB,0xDB,0xCE,0x00,0x00,0x00,0x00, // 379
+0x00,0x00,0x3F,0x66,0x66,0x66,0x3E,0x3E,0x66,0x66,0x66,0xE7,0x00,0x00,0x00,0x00, // 380
+0x00,0x02,0x06,0x7C,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0xFF,0xC3,0xC3,0x00,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x54,0xD6,0xD6,0x00,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x3C,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 387
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xD6,0xC6,0x00,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00, // 395
+0x00,0x00,0x00,0x3C,0x18,0x7E,0xDB,0xDB,0xDB,0xDB,0xDB,0x7E,0x18,0x18,0x3C,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFF,0x03,0x03,0x00,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x03,0x03,0x00,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xF8,0xB0,0xB0,0x3E,0x33,0x33,0x7E,0x00,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x3E,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0xCE,0xDB,0xDB,0xFB,0xDB,0xDB,0xCE,0x00,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7F,0xC6,0xC6,0x7E,0x36,0x66,0xE7,0x00,0x00,0x00,0x00, // 406
+0x00,0x00,0x7C,0xC6,0xC0,0xC8,0xF8,0xC8,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xF8,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 408
+0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 409
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00, // 410
+0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xCC,0xCC,0xCC,0x00,0x00,0x00,0x00, // 411
+0x00,0x00,0xFC,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x06,0x1C,0x00,0x00, // 412
+0x00,0x00,0x00,0x00,0x00,0x30,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x1C,0x00,0x00, // 413
+0x18,0x30,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 414
+0x00,0x00,0x18,0x30,0x00,0xFE,0x62,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 415
+0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 416
+0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00,0x00,0x00, // 418
+0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDE,0xDA,0xDA,0xDA,0xDE,0x00,0x00,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00,0x00,0x00, // 420
+0x00,0x00,0xFE,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, // 422
+0x0C,0x18,0xC6,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 423
+0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xD8,0xF8,0xCC,0xC6,0xC6,0x00,0x00,0x00,0x00, // 424
+0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, // 425
+0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C,0x00, // 426
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10,0x00,0x00, // 427
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10,0x00,0x00, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00,0x00, // 430
+0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x18,0x3C,0x18,0x18,0x00,0x00,0x00,0x00, // 431
+0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x3C,0x18,0x18,0x7E,0x18,0x00,0x00,0x00, // 432
+0x00,0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00,0x00, // 433
+0x00,0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 437
+0x00,0x00,0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00, // 438
+0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 439
+0x00,0x00,0x6E,0xF8,0xD8,0xD8,0xDC,0xD8,0xD8,0xD8,0xF8,0x6E,0x00,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 443
+0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x18,0x30,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x00,0x00,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00, // 461
+0x00,0x00,0x00,0xDC,0xFE,0xE6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xDC,0x00,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0x00,0xDC,0xFE,0xE6,0xC6,0xC6,0xC6,0x06,0x1C,0x00,0x00,0x00, // 463
+0x38,0x6C,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00, // 464
+0x00,0x10,0x38,0x6C,0xC6,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 465
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 466
+0x00,0x10,0x38,0x6C,0xC6,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x00, // 467
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 468
+0x38,0x6C,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00, // 469
+0x38,0x6C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00, // 470
+0x00,0x08,0x1C,0x36,0x63,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00, // 471
+0x38,0x6C,0x00,0x7C,0xC6,0xC0,0xC0,0x70,0x1C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 472
+0x00,0x10,0x38,0x6C,0xC6,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // 473
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 474
+0x00,0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 475
+0x3C,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 476
+0x00,0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0,0x00, // 477
+0x18,0x18,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 478
+0x18,0x18,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00, // 479
+0x18,0x18,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00, // 480
+0x00,0x00,0x00,0x18,0x18,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 481
+0x18,0x18,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00, // 482
+0x18,0x18,0x00,0x1C,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0xCC,0x7E,0x00,0x00,0x00, // 483
+0x18,0x18,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 484
+0x18,0x18,0x00,0x1C,0x36,0x30,0xFC,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00, // 485
+0x00,0x00,0x00,0x18,0x18,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x00, // 486
+0x18,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 487
+0x18,0x18,0x00,0xC6,0xC6,0xEE,0xEE,0xFE,0xD6,0xD6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 488
+0x00,0x00,0x00,0x18,0x18,0x00,0xEC,0xFE,0xD6,0xD6,0xC6,0xC6,0xC6,0x00,0x00,0x00, // 489
+0x18,0x18,0x00,0xFC,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00,0x00, // 490
+0x00,0x00,0x00,0x18,0x18,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00, // 491
+0x18,0x18,0x00,0x7C,0xC6,0xC0,0xC0,0x70,0x1C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 492
+0x00,0x00,0x00,0x18,0x18,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00, // 493
+0x18,0x18,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 494
+0x18,0x18,0x00,0x30,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00, // 495
+0x00,0xFE,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0x66,0xFE,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00, // 497
+0x00,0x7E,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x00,0x3C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 499
+0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 501
+0x00,0xFE,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x00,0xFC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 503
+0xC6,0x7C,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 504
+0x00,0x00,0x00,0xC6,0x7C,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC,0x00, // 505
+0xC6,0x7C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 506
+0x00,0x00,0x00,0xC6,0x7C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 507
+0xC6,0x7C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 508
+0x00,0x00,0x00,0xC6,0x7C,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 509
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0xC6,0x7C,0x18,0x0C,0x78, // 510
+0x00,0x00,0x00,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xFC,0x18,0x0C,0x78, // 511
+0x00,0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xF0,0xD8,0xCC,0xC6,0xC6,0x18,0x0C,0x78, // 512
+0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x06,0x03,0x3E, // 513
+0x00,0x00,0x00,0xC6,0xC6,0xE6,0xE6,0xF6,0xDE,0xCE,0xCE,0xC6,0xC6,0x06,0x03,0x3E, // 514
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x03,0x3E, // 515
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x78,0x6C,0x66,0x66,0xE6,0x06,0x03,0x3E, // 516
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x60,0x60,0x60,0x60,0xF0,0x18,0x0C,0x78, // 517
+0x76,0xDC,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 518
+0x00,0x00,0x00,0x76,0xDC,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 519
+0x76,0xDC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 520
+0x00,0x00,0x00,0x76,0xDC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 521
+0x00,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x30,0x60,0x3C, // 522
+0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x30,0x60,0x3C, // 523
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x30,0x60,0x3C, // 524
+0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x30,0x60,0x3C, // 525
+0x30,0x18,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 526
+0x00,0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 527
+0x30,0x18,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00, // 528
+0x00,0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0,0x00, // 529
+0x0C,0x18,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 530
+0x00,0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 531
+0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00,0x00, // 532
+0x00,0x00,0x00,0x00,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00, // 533
+0x00,0x00,0x00,0x66,0x67,0x67,0x6E,0x7E,0x7E,0x76,0xE6,0xE6,0x66,0x00,0x00,0x00, // 534
+0x00,0x00,0x00,0xE0,0x66,0x66,0x7C,0x7E,0x7E,0x76,0xE6,0xE6,0x66,0x00,0x00,0x00, // 535
+0x00,0x00,0x00,0xFF,0xDB,0x99,0x1E,0x1C,0x38,0x78,0x18,0x18,0x3C,0x00,0x00,0x00, // 536
+0x00,0x00,0x00,0x30,0x32,0x36,0xFC,0x38,0x30,0x70,0xF0,0xB6,0x1C,0x00,0x00,0x00, // 537
+0x30,0x18,0x18,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 538
+0x00,0x00,0x60,0x30,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 539
+0x30,0x18,0x18,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 540
+0x00,0x00,0x60,0x30,0x30,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00, // 541
+0x18,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 542
+0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 543
+0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x0C,0x06,0x7C,0x00, // 544
+0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x18,0x0C,0xF8,0x00, // 545
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x6C,0xC6,0xC6,0x7C,0x00, // 546
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0xC0,0xC0,0xC0,0xC0,0x7C,0x06,0x06,0x3C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x06,0x02,0x00, // 548
+0x00,0x00,0x78,0xCC,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 550
+0x00,0x00,0x7C,0xC6,0x06,0x06,0x3E,0x66,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, // 552
+0x00,0x00,0xFE,0x0C,0x18,0x30,0x60,0x60,0x3C,0x60,0xC0,0x7C,0x06,0x06,0x3C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0x7C,0x06,0x7C,0x00,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x82,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x82,0x00,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10,0x10,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0xD6,0x6C,0x00,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0x82,0x00,0x00,0x7C,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 562
+0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10,0x7C,0x00,0x00,0x00,0x00, // 563
+0x0C,0x18,0x10,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x06,0x0C,0x18,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00,0x00, // 565
+0x0C,0x18,0x00,0x3C,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00, // 566
+0x00,0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x06,0x06,0x02,0x00, // 567
+0x00,0x06,0x0C,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 568
+0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 569
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 570
+0x00,0x0C,0x18,0x30,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0xD6,0x6C,0x00,0x00,0x00,0x00, // 571
+0x60,0xC0,0x90,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 572
+0x30,0x60,0xDF,0xB3,0x31,0x34,0x3C,0x34,0x30,0x31,0x33,0x7F,0x00,0x00,0x00,0x00, // 573
+0x60,0xC0,0xA3,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x63,0x63,0x00,0x00,0x00,0x00, // 574
+0x30,0x60,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 575
+0x30,0x60,0xDE,0x23,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00, // 576
+0x30,0x60,0xD3,0x33,0x33,0x33,0x1E,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, // 577
+0x30,0x60,0xDC,0x36,0x63,0x63,0x63,0x36,0x36,0x36,0x36,0x77,0x00,0x00,0x00,0x00, // 578
+0x00,0x00,0x00,0x66,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 580
+0x0C,0x18,0x10,0xC6,0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00,0x00,0x00, // 581
+0x0C,0x18,0x10,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x38,0x6C,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0xFC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 584
+0x00,0xFE,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 585
+0x10,0x38,0x10,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xCE,0xC6,0x7C,0x00,0x00,0x00,0x00, // 586
+0x00,0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00,0x00, // 587
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 588
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 589
+0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // 590
+0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 591
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 592
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 593
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 594
+0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, // 595
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 596
+0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, // 603
+0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, // 604
+0x00,0xC6,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, // 606
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 607
+0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 608
+0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, // 609
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 610
+0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, // 611
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 612
+0x00,0x00,0x78,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xC6,0xCC,0x00,0x00,0x00,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 616
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 617
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, // 618
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, // 619
+0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, // 620
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 621
+0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 622
+0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, // 623
+0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 624
+0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, // 625
+0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, // 626
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, // 627
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 628
+0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 629
+0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, // 630
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 631
+0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 632
+};
+
+unsigned char BR14[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x7E,0x00,0x00, // 
+0x00,0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0x7E,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF, // \n
+0x00,0x00,0x00,0x1E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0x78,0x00,0x00, //
+0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00, //
+0x00,0x00,0x00,0x3F,0x33,0x3F,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00, // \r
+0x00,0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00, // 
+0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00, // 
+0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xFE,0xF8,0xE0,0xC0,0x80,0x00,0x00, // 
+0x00,0x00,0x00,0x02,0x06,0x0E,0x3E,0xFE,0x3E,0x0E,0x06,0x02,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00, // 
+0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00, // 
+0x00,0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x00,0x00, // 
+0x00,0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x00,0x18,0x18,0x00,0x00, // !
+0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00, // #
+0x00,0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18, // $
+0x00,0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x66,0xC6,0x00,0x00, // %
+0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0x76,0x00,0x00, // &
+0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00, // (
+0x00,0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00, // .
+0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00, // /
+0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xD6,0xC6,0xC6,0x6C,0x38,0x00,0x00, // 0
+0x00,0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00, // 1
+0x00,0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, // 2
+0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0xC6,0x7C,0x00,0x00, // 3
+0x00,0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x1E,0x00,0x00, // 4
+0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0xC6,0x7C,0x00,0x00, // 5
+0x00,0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 6
+0x00,0x00,0x00,0xFE,0xC6,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00, // 7
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 8
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x0C,0x78,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00, // ;
+0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x0C,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00, // >
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x00,0x18,0x18,0x00,0x00, // ?
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00, // @
+0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // A
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00, // B
+0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // C
+0x00,0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00, // D
+0x00,0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // E
+0x00,0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0xF0,0x00,0x00, // F
+0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0x66,0x3A,0x00,0x00, // G
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // H
+0x00,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // I
+0x00,0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00, // J
+0x00,0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x6C,0x6C,0x66,0xE6,0x00,0x00, // K
+0x00,0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // L
+0x00,0x00,0x00,0xC6,0xEE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // M
+0x00,0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00, // N
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // O
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // P
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0E,0x00, // Q
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xE6,0x00,0x00, // R
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0xC6,0xC6,0x7C,0x00,0x00, // S
+0x00,0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // T
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // U
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00, // V
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x6C,0x00,0x00, // W
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0x7C,0x38,0x7C,0xC6,0xC6,0xC6,0x00,0x00, // X
+0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // Y
+0x00,0x00,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00, // Z
+0x00,0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00, // [
+0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00, // \.
+0x00,0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00, // ]
+0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, // _
+0x00,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // a
+0x00,0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x7C,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // c
+0x00,0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // e
+0x00,0x00,0x00,0x1C,0x36,0x32,0x30,0x7C,0x30,0x30,0x30,0x78,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78, // g
+0x00,0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0xE6,0x00,0x00, // h
+0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // i
+0x00,0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // j
+0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00, // k
+0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0, // p
+0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E, // q
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60,0xF0,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x00,0x00, // s
+0x00,0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78, // y
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // z
+0x00,0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x0E,0x00,0x00, // {
+0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // |
+0x00,0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x70,0x00,0x00, // }
+0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x78, //
+0x00,0x00,0x00,0xCC,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0xC6,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x0C,0x78, //
+0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, //
+0x00,0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, //
+0x00,0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, //
+0x00,0xC6,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, //
+0x38,0x6C,0x38,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, //
+0x0C,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x36,0x76,0xDC,0xD8,0x6E,0x00,0x00, //
+0x00,0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCE,0x00,0x00, //
+0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78, //
+0x00,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x18,0x18,0x00,0x00, //
+0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00, //
+0x00,0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x00,0x00, //
+0x00,0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0xF3,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0xD8,0x70,0x00, //
+0x00,0x00,0x0C,0x18,0x30,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, //
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x0C,0x18,0x30,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x00,0x00, //
+0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00, //
+0x00,0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC6,0xC6,0x7C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x00,0x00,0x00, //
+0x00,0x00,0x60,0xE0,0x63,0x66,0x6C,0x18,0x30,0x6E,0xC3,0x06,0x0C,0x1F, //
+0x00,0x00,0x60,0xE0,0x63,0x66,0x6C,0x1A,0x36,0x6E,0xDA,0x3F,0x06,0x06, //
+0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00, //
+0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, //
+0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, //
+0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, //
+0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xDC,0x76,0x00,0x00, //
+0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xCC,0x00,0x00, //
+0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00, //
+0x00,0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xC0, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x00,0x00, //
+0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00, //
+0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x6C,0x38,0x00,0x00, //
+0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0xEE,0x00,0x00, //
+0x00,0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00, //
+0x00,0x00,0x00,0x1E,0x30,0x60,0x60,0x7E,0x60,0x60,0x30,0x1E,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x7E,0x00,0x00, //
+0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00, //
+0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, //
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00, //
+0x00,0x6C,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x3C,0x66,0x0C,0x18,0x32,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 256
+0x18,0x30,0x60,0x40,0xE0,0x60,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 257
+0x00,0x00,0x00,0x18,0x30,0x20,0xDC,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 258
+0x00,0x00,0x0C,0x18,0x30,0x00,0xDC,0x76,0x66,0x60,0x60,0xF0,0x00,0x00, // 259
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x00,0x00, // 260
+0x00,0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8, // 261
+0x00,0x00,0x0C,0x18,0x30,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // 262
+0x18,0x30,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 263
+0x0C,0x18,0x10,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 264
+0x0C,0x18,0x10,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 265
+0x30,0x60,0x40,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // 266
+0x18,0x30,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00, // 267
+0x18,0x30,0x20,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 268
+0x0C,0x18,0x30,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xE6,0x00,0x00, // 269
+0x0C,0x18,0x10,0x7C,0xC6,0xC6,0x70,0x1C,0x06,0xC6,0xC6,0x7C,0x00,0x00, // 270
+0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 271
+0x0C,0x18,0x10,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 272
+0x0C,0x18,0x10,0xFE,0xC6,0x8C,0x18,0x30,0x30,0x62,0xC6,0xFE,0x00,0x00, // 273
+0x36,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 274
+0x30,0x18,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 275
+0x30,0x18,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 276
+0x30,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 277
+0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 278
+0x30,0x18,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 279
+0x00,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 280
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 281
+0x00,0x00,0x38,0x6C,0x38,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 282
+0x38,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 283
+0x00,0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // 284
+0x00,0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 285
+0x00,0x00,0x36,0x6C,0xD8,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 286
+0x76,0xDC,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 287
+0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 288
+0x38,0x6C,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 289
+0x38,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 290
+0x3C,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 291
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 292
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 293
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 294
+0x00,0x00,0x00,0x6C,0x38,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x00,0x00, // 295
+0x00,0x00,0x00,0x6C,0x38,0x00,0xDC,0x76,0x66,0x60,0x60,0xF0,0x00,0x00, // 296
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x00,0x00, // 297
+0x00,0x00,0x00,0x6C,0x38,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // 298
+0x6C,0x38,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 299
+0xCC,0x78,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00, // 300
+0x6C,0x38,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 301
+0x6C,0x38,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00, // 302
+0x6C,0x38,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0xE6,0x00,0x00, // 303
+0x6C,0x38,0x00,0x7C,0xC6,0xC6,0x70,0x1C,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 304
+0x66,0x3C,0x18,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 305
+0x6C,0x38,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x62,0xC6,0xC6,0xFE,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x10,0x18,0x70, // 307
+0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x08,0x0C,0x38, // 308
+0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0xC6,0xC6,0x7C,0x10,0x18,0x70, // 309
+0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x08,0x0C,0x38, // 310
+0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x04,0x0C,0x07, // 311
+0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x10,0x30,0x1C, // 312
+0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x04,0x0C,0x07, // 313
+0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x08,0x18,0x0E, // 314
+0x00,0x00,0x00,0x18,0x18,0x00,0xFE,0xCC,0x18,0x30,0x66,0xFE,0x00,0x00, // 315
+0x00,0x18,0x18,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x62,0xC6,0xFE,0x00,0x00, // 316
+0x00,0x00,0x00,0x38,0x1A,0x1E,0x1C,0x18,0x38,0x78,0x18,0x3C,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x01,0x7E,0xCE,0xD6,0xD6,0xE6,0x7C,0x80,0x00, // 318
+0x00,0x00,0x78,0x30,0x30,0x36,0x3C,0x38,0x70,0xF2,0x36,0x7E,0x00,0x00, // 319
+0x00,0x00,0x04,0x7C,0xCE,0xCE,0xD6,0xD6,0xD6,0xE6,0xE6,0x7C,0x40,0x00, // 320
+0x00,0x00,0x00,0x0C,0x7E,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 321
+0x00,0x00,0x00,0x34,0x18,0x2C,0x06,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00, // 322
+0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0xF6,0x66,0x66,0x6C,0xF8,0x00,0x00, // 323
+0x00,0x00,0x00,0x1D,0x0D,0x0D,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 324
+0x00,0x00,0x00,0xEC,0x64,0x68,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 325
+0x00,0x00,0x06,0x12,0x34,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 326
+0x00,0x00,0xF6,0x62,0x64,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // 327
+0x00,0x00,0x00,0xCC,0x78,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // 328
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 329
+0xC6,0x7C,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 330
+0x00,0x00,0x00,0x00,0xC6,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0x00,0x00,0x00, // 331
+0x00,0x00,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0, // 332
+0x00,0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00, // 334
+0x00,0x00,0x00,0x38,0x44,0xBA,0xAA,0xB2,0xAA,0xAA,0x44,0x38,0x00,0x00, // 335
+0x00,0x00,0x00,0x38,0x44,0x9A,0xA2,0xA2,0xA2,0x9A,0x44,0x38,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 337
+0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x00, // 338
+0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0x00,0xE0,0x30,0x63,0x36,0xEC,0x18,0x36,0x6E,0xDA,0x3F,0x06,0x06,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x78, // 344
+0x00,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x00,0x18,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0x00,0x78,0x0C,0x38,0x0C,0x0C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x00,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x30,0x1C, // 349
+0x00,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x00,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x00,0x33,0x66,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 353
+0x36,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00, // 354
+0xD8,0x70,0x00,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00, // 355
+0xD8,0x70,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00, // 356
+0x00,0x6C,0x38,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 357
+0x00,0x00,0x00,0x6C,0x38,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 358
+0x36,0x1C,0x00,0x0C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 359
+0x00,0x00,0x00,0x1E,0x36,0x66,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 360
+0x00,0x00,0x00,0xFE,0x62,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 361
+0x00,0x00,0x00,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 362
+0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0xFE,0xC6,0x82, // 363
+0x00,0x00,0x00,0xD6,0xD6,0x54,0x7C,0x7C,0x54,0xD6,0xD6,0xD6,0x00,0x00, // 364
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0x00,0x00, // 365
+0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xCE,0xDE,0xF6,0xE6,0xC6,0xC6,0x00,0x00, // 366
+0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0xC6,0x00,0x00, // 367
+0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 368
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 369
+0x00,0x00,0x00,0x7C,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x38,0x00,0x00, // 370
+0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x0C, // 371
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x00,0x00, // 372
+0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00, // 373
+0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6,0xFF,0x03,0x06, // 374
+0x00,0x00,0x00,0xF0,0xF0,0xB0,0xBC,0x36,0x36,0x36,0x36,0x7C,0x00,0x00, // 375
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xF6,0xDA,0xDA,0xDA,0xDA,0xF6,0x00,0x00, // 376
+0x00,0x00,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 377
+0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x3E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 378
+0x00,0x00,0x00,0xDC,0xD6,0xD6,0xF6,0xF6,0xD6,0xD6,0xD6,0xDC,0x00,0x00, // 379
+0x00,0x00,0x00,0x7E,0xC6,0xC6,0xC6,0x7E,0x3E,0x66,0xC6,0xC6,0x00,0x00, // 380
+0x00,0x00,0x00,0x06,0x7C,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x62,0x62,0x60,0x60,0xF0,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6C,0xFE,0xC6,0xC6, // 384
+0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0x7C,0x7C,0xD6,0xD6,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x1C,0x06,0xC6,0x7C,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0x00,0x00, // 387
+0x00,0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xCE,0xD6,0xE6,0xC6,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x36,0x66,0x66,0x66,0xE6,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xEE,0xFE,0xD6,0xD6,0xC6,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x5A,0x18,0x18,0x18,0x3C,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xFC, // 395
+0x00,0x00,0x00,0x00,0x38,0x10,0x7C,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x38, // 396
+0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xFE,0x06,0x0C, // 397
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xFE,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0xFF,0x03,0x06, // 400
+0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xB0,0xBC,0x36,0x36,0x7C,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xF6,0xDE,0xDE,0xF6,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x60,0x7C,0x66,0x66,0xFC,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x3E,0x06,0xC6,0x7C,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0xD6,0xF6,0xF6,0xD6,0xDC,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0x7C,0x6C,0xCE,0x00,0x00, // 406
+0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xF8,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xF0,0xC0,0xC6,0x7C,0x00,0x00, // 408
+0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0xC6,0x7C,0x00,0x00, // 409
+0x00,0x00,0x00,0x6C,0x38,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // 410
+0x00,0x00,0x00,0xCF,0xCD,0xEF,0xEC,0xFF,0xDC,0xDC,0xCC,0xCC,0x00,0x00, // 411
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x06,0x0C, // 412
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x06,0x0C, // 413
+0x18,0x18,0x30,0xFE,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00, // 414
+0x00,0x00,0x00,0x18,0x30,0x00,0xFE,0x62,0x62,0x60,0x60,0xF0,0x00,0x00, // 415
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, // 416
+0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x6E,0x6A,0x6A,0xEA,0xCE,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6E,0x6A,0xEA,0xCE,0x00,0x00, // 418
+0x00,0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xFC,0xDA,0xDA,0xDA,0xDE,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0xDC,0xFE,0xDA,0xDA,0xDE,0x00,0x00, // 420
+0x00,0x00,0x00,0xFC,0x30,0x30,0x38,0x3C,0x36,0x36,0x36,0x36,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x30,0x3C,0x36,0x36,0x36,0x00,0x00, // 422
+0x00,0x0C,0x18,0xC6,0xC6,0xCC,0xD8,0xF8,0xCC,0xCC,0xC6,0xC6,0x00,0x00, // 423
+0x00,0x00,0x00,0xCC,0xD8,0xC0,0xC6,0xCC,0xF8,0xCC,0xC6,0xC6,0x00,0x00, // 424
+0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0xC6,0x7C,0x00,0x00, // 425
+0x00,0x00,0x00,0x00,0x6C,0x10,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xC6,0x7C, // 426
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10, // 427
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x10,0x10, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x77,0x33,0x66,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0x00,0x00,0x00, // 430
+0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x18,0x3C,0x18,0x18,0x00,0x00,0x00, // 431
+0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x3C,0x18,0x18,0x7E,0x18,0x00,0x00, // 432
+0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00, // 433
+0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x02,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, // 437
+0x00,0x00,0x00,0x02,0x06,0x7E,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00, // 438
+0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00, // 439
+0x00,0x6E,0xD8,0xD8,0xD8,0xD8,0xDE,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 443
+0x00,0x78,0x80,0x80,0x80,0x78,0x00,0x3C,0x22,0x3E,0x24,0x22,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x38,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x06,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, // 456
+0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x7C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C, // 459
+0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00, // 461
+0x00,0x00,0xDC,0xFE,0xF6,0xE6,0xC6,0xC6,0xC6,0xC6,0xC6,0xDC,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0xDC,0xFE,0xF6,0xE6,0xC6,0xC6,0x06,0x1C,0x00,0x00, // 463
+0x38,0x6C,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 464
+0x10,0x38,0x6C,0xC6,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 465
+0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xC6,0xC6,0x7C,0x00,0x00, // 466
+0x10,0x38,0x6C,0xC6,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // 467
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 468
+0x38,0x6C,0x00,0xE0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xE6,0x00,0x00, // 469
+0x38,0x6C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00, // 470
+0x10,0x38,0x6C,0xC6,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78, // 471
+0x38,0x6C,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0x06,0xC6,0x7C,0x00,0x00, // 472
+0x10,0x38,0x6C,0xC6,0x00,0x7C,0xC6,0xC0,0x7C,0x06,0xC6,0x7C,0x00,0x00, // 473
+0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 474
+0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 475
+0x3C,0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 476
+0x10,0x38,0x6C,0xC6,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0, // 477
+0x18,0x18,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00, // 478
+0x60,0x60,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00, // 479
+0x18,0x18,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 480
+0x00,0x00,0x18,0x18,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 481
+0x18,0x18,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00, // 482
+0x0C,0x0C,0x00,0x0C,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0xCC,0x7E,0x00,0x00, // 483
+0x18,0x18,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // 484
+0x18,0x18,0x00,0x1C,0x36,0x30,0x30,0xFC,0x30,0x30,0x30,0x78,0x00,0x00, // 485
+0x00,0x00,0x18,0x18,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // 486
+0x18,0x18,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 487
+0x18,0x18,0x00,0xC6,0xC6,0xEE,0xEE,0xFE,0xD6,0xD6,0xC6,0xC6,0x00,0x00, // 488
+0x00,0x00,0x18,0x18,0x00,0xEC,0xFE,0xD6,0xD6,0xC6,0xC6,0xC6,0x00,0x00, // 489
+0x18,0x18,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // 490
+0x00,0x00,0x18,0x18,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0, // 491
+0x18,0x18,0x00,0x7C,0xC6,0xC0,0x70,0x1C,0x06,0x06,0xC6,0x7C,0x00,0x00, // 492
+0x00,0x00,0x18,0x18,0x00,0x7C,0xC6,0xC0,0x7C,0x06,0xC6,0x7C,0x00,0x00, // 493
+0x18,0x18,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 494
+0x30,0x30,0x00,0x30,0x30,0x30,0xFC,0x30,0x30,0x30,0x36,0x1C,0x00,0x00, // 495
+0xFE,0x00,0xFE,0x66,0x60,0x60,0x7C,0x60,0x60,0x60,0x66,0xFE,0x00,0x00, // 496
+0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 497
+0x7E,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 498
+0x00,0x00,0x00,0x7E,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 499
+0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 500
+0x00,0x00,0x00,0xFE,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 501
+0xFE,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 502
+0x00,0x00,0x00,0xFC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 503
+0xC6,0x7C,0x00,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xC6,0xC6,0x7C,0x00,0x00, // 504
+0x00,0x00,0xC6,0x7C,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xCE,0x76,0x06,0xFC, // 505
+0xC6,0x7C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 506
+0x00,0x00,0xC6,0x7C,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 507
+0xC6,0x7C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 508
+0x00,0x00,0xC6,0x7C,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 509
+0x00,0x00,0x7C,0xC6,0xC6,0xC0,0xCE,0xC6,0xC6,0xC6,0x7C,0x18,0x0C,0x78, // 510
+0x00,0x00,0x76,0xCE,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0xFC,0x18,0x0C,0x78, // 511
+0x00,0x00,0xC6,0xC6,0xCC,0xD8,0xF0,0xF0,0xD8,0xCC,0xCC,0xCC,0x06,0x3C, // 512
+0x00,0x00,0xE0,0x60,0x60,0x66,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x03,0x1E, // 513
+0x00,0x00,0xC6,0xC6,0xE6,0xE6,0xF6,0xDE,0xCE,0xCE,0xC6,0xC6,0x03,0x1E, // 514
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x03,0x1E, // 515
+0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x78,0x6C,0x66,0x66,0xE6,0x03,0x1E, // 516
+0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x60,0x60,0x60,0x60,0xF8,0x0C,0x78, // 517
+0x76,0xDC,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 518
+0x00,0x00,0x76,0xDC,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 519
+0x76,0xDC,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 520
+0x00,0x00,0x76,0xDC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 521
+0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x18,0x30,0x1C, // 522
+0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x30,0x1C, // 523
+0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x30,0x1C, // 524
+0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xDC,0x76,0x30,0x1C, // 525
+0x30,0x18,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 526
+0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 527
+0x30,0x18,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 528
+0x00,0x60,0x30,0x18,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x30,0x30,0x60,0xC0, // 529
+0x0C,0x18,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 530
+0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 531
+0x00,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0xC6,0xC6,0x00,0x00, // 532
+0x00,0x00,0xC6,0xC6,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00, // 533
+0x00,0x00,0x6D,0x6F,0x6E,0x6C,0x7C,0x7C,0xEC,0xEC,0x6C,0x6C,0x00,0x00, // 534
+0x00,0x00,0xE0,0x62,0x66,0x7C,0x7E,0x76,0x66,0xE6,0xE6,0x66,0x00,0x00, // 535
+0x00,0x00,0xFF,0xDB,0x99,0x1E,0x1C,0x38,0x78,0x18,0x18,0x3C,0x00,0x00, // 536
+0x00,0x00,0x30,0x32,0x36,0xFC,0x38,0x30,0x70,0xF0,0xB6,0x1C,0x00,0x00, // 537
+0x60,0x30,0x30,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 538
+0x00,0x60,0x30,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 539
+0x30,0x18,0x18,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 540
+0x00,0x60,0x30,0x30,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00, // 541
+0x30,0x30,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 542
+0x00,0x00,0x10,0x38,0x10,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 543
+0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x0C,0x06,0x7C, // 544
+0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x06,0x7C, // 545
+0x00,0x00,0x00,0x00,0x00,0xC2,0x66,0x3C,0x18,0x38,0x6C,0x6C,0x38,0x00, // 546
+0x00,0x00,0x00,0x7E,0x06,0x0C,0x18,0x30,0x30,0x30,0x1C,0x06,0x06,0x0C, // 547
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x06,0x02, // 548
+0x00,0x00,0x00,0x3C,0x66,0x06,0x06,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 550
+0x00,0x00,0x00,0x3C,0x66,0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00, // 552
+0x00,0x00,0x00,0x7E,0x06,0x0C,0x18,0x0E,0x18,0x30,0x1E,0x06,0x06,0x0C, // 553
+0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xCC,0xF8,0xC0,0xC0, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC0,0xC0,0x78,0x0C,0xF8,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xC6,0x6C,0x38,0x6C,0xC6,0x82,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0x00,0x92,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10, // 558
+0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0x6C,0x00,0x00, // 559
+0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0x00,0x00, // 560
+0x00,0x00,0x00,0xFE,0xC6,0x82,0x00,0x7C,0x00,0x82,0xC6,0xFE,0x00,0x00, // 561
+0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 562
+0x00,0x00,0x00,0xD6,0xD6,0xD6,0xD6,0xD6,0x7C,0x10,0x10,0x38,0x00,0x00, // 563
+0x00,0x0C,0x18,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x0C,0x18,0x30,0x00,0x76,0xDC,0xD8,0xD8,0xDC,0x76,0x00,0x00, // 565
+0x0C,0x18,0x00,0x1E,0x30,0x60,0x60,0x7E,0x60,0x60,0x30,0x1E,0x00,0x00, // 566
+0x00,0x00,0x0C,0x18,0x30,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x06,0x02, // 567
+0x00,0x00,0x0C,0x18,0x30,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 568
+0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 569
+0x00,0x00,0x06,0x0C,0x18,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 570
+0x00,0x00,0x0C,0x18,0x30,0x00,0x6C,0xC6,0xD6,0xD6,0xD6,0x6C,0x00,0x00, // 571
+0x00,0x30,0x60,0xD0,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 572
+0x00,0x30,0x60,0xDE,0x26,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 573
+0x00,0x30,0x60,0xE3,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x63,0x00,0x00, // 574
+0x00,0x30,0x60,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 575
+0x00,0x30,0x60,0xDE,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00, // 576
+0x00,0x30,0x60,0xD3,0x33,0x33,0x33,0x1E,0x0C,0x0C,0x0C,0x1E,0x00,0x00, // 577
+0x00,0x30,0x60,0xDC,0x36,0x63,0x63,0x63,0x36,0x36,0x36,0x77,0x00,0x00, // 578
+0x00,0x00,0x00,0x00,0xCC,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 579
+0x00,0x00,0x00,0x00,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 580
+0x00,0x0C,0x18,0x10,0xCC,0x00,0x30,0x30,0x30,0x30,0x30,0x1C,0x00,0x00, // 581
+0x00,0x04,0x0C,0x08,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00, // 582
+0x00,0x00,0x00,0x10,0x38,0x6C,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 583
+0x00,0x00,0x00,0x00,0xFC,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // 584
+0x00,0xFE,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 585
+0x10,0x38,0x10,0x7C,0xC6,0xC6,0xC0,0xC0,0xCE,0xC6,0xC6,0x7C,0x00,0x00, // 586
+0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00, // 587
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00, // 588
+0x00,0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 589
+0x00,0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x6C,0x6C,0x66,0xE6,0x00,0x00, // 590
+0x00,0x00,0x00,0xC6,0xEE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 591
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 592
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 593
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // 594
+0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00, // 595
+0x00,0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 596
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0x7C,0x38,0x7C,0xC6,0xC6,0xC6,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0, // 601
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC6,0x7C,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0x00, // 603
+0x00,0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00, // 604
+0x00,0x6C,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x70,0x1C,0xC6,0x7C,0x00,0x00, // 606
+0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 607
+0x00,0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 608
+0x00,0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // 609
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 610
+0x00,0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00, // 611
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0xC6,0xC6,0x7C,0x00,0x00, // 612
+0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xCC,0x00,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xC0, // 615
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 616
+0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00, // 617
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0xFC,0x00,0x00, // 618
+0x00,0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x62,0x66,0xFE,0x00,0x00, // 619
+0x00,0x00,0x00,0xFE,0xC6,0x8C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00, // 620
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 621
+0x00,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 622
+0x00,0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x6C,0x6C,0x66,0xE6,0x00,0x00, // 623
+0x00,0x00,0x00,0xC6,0xEE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00, // 624
+0x00,0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00, // 625
+0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, // 626
+0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0xF0,0x00,0x00, // 627
+0x00,0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 628
+0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x3C,0x00,0x00, // 629
+0x00,0x00,0x00,0xC6,0xC6,0xC6,0x7C,0x38,0x7C,0xC6,0xC6,0xC6,0x00,0x00, // 630
+0x00,0x66,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, // 631
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 632
+};
+
diff --git a/setedit/fonts/thin.cc b/setedit/fonts/thin.cc
new file mode 100644
index 0000000..1210aea
--- /dev/null
+++ b/setedit/fonts/thin.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include "common1.h"
+#include "thin0.000"
+
+Font BoxRound16={0,NUM_FONTS,16,BR16};
+Font BoxRound14={0,NUM_FONTS,14,BR14};
+
+char *Name="Thin letters";
+
+#define PREFIX BR
+#define PREFIXS "BR"
+#define NAME_FONT "thin.sft"
+#define ARRAY1 BoxRound16
+#define ARRAY2 BoxRound14
+#define NAME_PART "thin%d.%03d"
+
+#include "common2.h"
diff --git a/setedit/fonts/thin.sft b/setedit/fonts/thin.sft
new file mode 100644
index 0000000..00c233e
--- /dev/null
+++ b/setedit/fonts/thin.sft
Binary files differ
diff --git a/setedit/fonts/thin0.000 b/setedit/fonts/thin0.000
new file mode 100644
index 0000000..b97badc
--- /dev/null
+++ b/setedit/fonts/thin0.000
@@ -0,0 +1,1272 @@
+unsigned char BR16[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0x7E,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0xFE,0x7C,0x10,0x10,0x38,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00, // \t
+0x00,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0x00, // \n
+0x00,0x00,0x00,0x0E,0x06,0x0A,0x10,0x3C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1F,0x11,0x1F,0x10,0x10,0x10,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, // \r
+0x00,0x00,0x00,0x3F,0x21,0x3F,0x21,0x21,0x21,0x27,0xE7,0xE6,0xC0,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0xEE,0x38,0xD6,0x10,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xFE,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x7C,0x10,0x10,0x10,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x7F,0x89,0x89,0x89,0x79,0x09,0x09,0x09,0x09,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x7C,0x82,0x40,0x38,0x44,0x82,0x82,0x44,0x38,0x04,0x82,0x7C,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x7C,0x10,0x10,0x10,0x7C,0x38,0x10,0x7C,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x08,0x0C,0x0E,0xFF,0x0E,0x0C,0x08,0x00,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x00,0x10,0x30,0x70,0xFF,0x70,0x30,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // !
+0x00,0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x00,0x44,0x44,0xFE,0x44,0x44,0x44,0xFE,0x44,0x44,0x00,0x00,0x00,0x00, // #
+0x00,0x10,0x10,0x7C,0x92,0x90,0x90,0x7C,0x12,0x12,0x92,0x7C,0x10,0x10,0x00,0x00, // $
+0x00,0x00,0x00,0x00,0x00,0x62,0x94,0x68,0x10,0x2C,0x52,0x8C,0x00,0x00,0x00,0x00, // %
+0x00,0x00,0x00,0x38,0x44,0x44,0x38,0x56,0x8C,0x88,0x8C,0x76,0x00,0x00,0x00,0x00, // &
+0x00,0x00,0x10,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x10,0x08,0x04,0x00,0x00,0x00,0x00, // (
+0x00,0x00,0x00,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x20,0x00,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x00,0x44,0x28,0xFE,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x00,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x10,0x20,0x00,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x00,0x00, // /
+0x00,0x00,0x00,0x3C,0x42,0x42,0x46,0x4A,0x52,0x62,0x42,0x3C,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x00,0x08,0x18,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 1
+0x00,0x00,0x00,0x3C,0x42,0x02,0x04,0x18,0x20,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 2
+0x00,0x00,0x00,0x3C,0x42,0x02,0x02,0x1C,0x02,0x02,0x42,0x3C,0x00,0x00,0x00,0x00, // 3
+0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x44,0x7E,0x04,0x04,0x04,0x00,0x00,0x00,0x00, // 4
+0x00,0x00,0x00,0x7E,0x40,0x40,0x7C,0x02,0x02,0x02,0x42,0x3C,0x00,0x00,0x00,0x00, // 5
+0x00,0x00,0x00,0x1C,0x20,0x40,0x40,0x7C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 6
+0x00,0x00,0x00,0x7E,0x42,0x02,0x04,0x08,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 7
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x3C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 8
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x3E,0x02,0x02,0x04,0x38,0x00,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x10,0x20,0x00,0x00,0x00, // ;
+0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x00,0x00, // >
+0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x08,0x08,0x00,0x08,0x08,0x00,0x00,0x00,0x00, // ?
+0x00,0x00,0x00,0x3C,0x42,0x42,0x4E,0x52,0x52,0x4E,0x40,0x3C,0x00,0x00,0x00,0x00, // @
+0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // A
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // B
+0x00,0x00,0x00,0x3C,0x42,0x42,0x40,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // C
+0x00,0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00,0x00, // D
+0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // E
+0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // F
+0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // G
+0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // H
+0x00,0x00,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // I
+0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // J
+0x00,0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x00,0x00,0x00,0x00, // K
+0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // L
+0x00,0x00,0x00,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // M
+0x00,0x00,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x42,0x00,0x00,0x00,0x00, // N
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // O
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // P
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x4A,0x4A,0x3C,0x04,0x06,0x00,0x00, // Q
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // R
+0x00,0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // S
+0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // T
+0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // U
+0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,0x00,0x00, // V
+0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // W
+0x00,0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // X
+0x00,0x00,0x00,0x82,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // Y
+0x00,0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // Z
+0x00,0x00,0x00,0x3C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3C,0x00,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,0x00,0x00,0x00, // \.
+0x00,0x00,0x00,0x3C,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x3C,0x00,0x00,0x00,0x00, // ]
+0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00, // _
+0x00,0x00,0x10,0x10,0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // a
+0x00,0x00,0x00,0x40,0x40,0x40,0x7C,0x42,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // c
+0x00,0x00,0x00,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // e
+0x00,0x00,0x00,0x1C,0x22,0x22,0x20,0x78,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00,0x00, // g
+0x00,0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // h
+0x00,0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // i
+0x00,0x00,0x00,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x22,0x1C,0x00,0x00, // j
+0x00,0x00,0x00,0x40,0x40,0x40,0x42,0x44,0x78,0x44,0x42,0x42,0x00,0x00,0x00,0x00, // k
+0x00,0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xEE,0x92,0x92,0x92,0x82,0x00,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x02,0x03,0x00,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00,0x00, // s
+0x00,0x00,0x00,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x00,0x22,0x22,0x22,0x22,0x14,0x08,0x00,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00,0x00, // z
+0x00,0x00,0x00,0x06,0x08,0x08,0x08,0x30,0x08,0x08,0x08,0x06,0x00,0x00,0x00,0x00, // {
+0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // |
+0x00,0x00,0x00,0x60,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x60,0x00,0x00,0x00,0x00, // }
+0x00,0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x00,0x10,0x28,0x44,0x82,0x82,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x40,0x42,0x3C,0x04,0x02,0x3C,0x00,0x00, //
+0x00,0x00,0x00,0x42,0x42,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x08,0x10,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x14,0x22,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x42,0x42,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x22,0x1C,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x42,0x3C,0x04,0x02,0x1C,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x14,0x22,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x22,0x22,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x14,0x22,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x00,0x00,0x00,0x00, //
+0x00,0x18,0x24,0x18,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x00,0x00,0x00,0x00, //
+0x00,0x04,0x08,0x10,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x8C,0x52,0x22,0x7C,0x88,0x88,0x74,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3E,0x48,0x88,0x88,0xFE,0x88,0x88,0x88,0x8E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x08,0x14,0x22,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x10,0x28,0x44,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x42,0x42,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x38,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x10,0x10,0x7C,0x92,0x90,0x90,0x92,0x7C,0x10,0x10,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x22,0x22,0x20,0x78,0x20,0x20,0x20,0x62,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x42,0x42,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xF8,0x84,0x84,0xF8,0x84,0x84,0x8E,0x84,0x84,0x82,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x0C,0x12,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x90,0x60,0x00,0x00, //
+0x00,0x00,0x04,0x08,0x10,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x02,0x04,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x04,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x76,0xDC,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, //
+0x00,0x76,0xDC,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x48,0x48,0x3C,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x44,0x44,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x10,0x10,0x00,0x10,0x10,0x20,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0xC0,0x42,0x44,0x48,0x50,0x20,0x5C,0x82,0x1C,0x20,0x3E,0x00,0x00, //
+0x00,0x00,0x00,0xC0,0x42,0x44,0x48,0x50,0x24,0x4C,0x94,0x3E,0x04,0x04,0x00,0x00, //
+0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x12,0x24,0x48,0x24,0x12,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x48,0x24,0x12,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11, //
+0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55, //
+0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xE4,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x24,0x24,0x24,0x24,0x24,0x24,0xE4,0x04,0xE4,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0xE4,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0xE4,0x04,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x10,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x27,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x27,0x20,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x20,0x27,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0xE7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xE7,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x27,0x20,0x27,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x24,0x24,0x24,0x24,0x24,0x24,0xE7,0x00,0xE7,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x10,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x88,0x88,0x88,0x88,0x76,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7C,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00, //
+0x00,0x00,0x00,0x7E,0x42,0x42,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0x24,0x24,0x24,0x24,0x24,0x24,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x7E,0x42,0x20,0x10,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x88,0x88,0x88,0x88,0x70,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x22,0x22,0x22,0x22,0x3C,0x20,0x20,0x60,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x7C,0x10,0x38,0x44,0x44,0x44,0x38,0x10,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x24,0x18,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0xEE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x20,0x10,0x08,0x3C,0x44,0x44,0x44,0x38,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x92,0x92,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x02,0x04,0x7C,0x92,0x92,0xA2,0x7C,0x40,0x80,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x1C,0x20,0x40,0x40,0x7C,0x40,0x40,0x20,0x1C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00,0x7E,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x0C,0x12,0x12,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, //
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x90,0x60,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x7C,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x44,0x44,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x0F,0x08,0x08,0x08,0x08,0x08,0xE8,0x28,0x18,0x08,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x5C,0x22,0x22,0x22,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x30,0x48,0x10,0x20,0x40,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 256
+0x02,0x04,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 257
+0x00,0x00,0x04,0x08,0x10,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 258
+0x00,0x00,0x04,0x08,0x10,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 259
+0x00,0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00,0x00, // 260
+0x00,0x00,0x04,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00,0x00, // 261
+0x00,0x00,0x04,0x08,0x10,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00,0x00, // 262
+0x04,0x08,0x10,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 263
+0x04,0x08,0x10,0x00,0x3C,0x42,0x42,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 264
+0x02,0x04,0x08,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 265
+0x10,0x20,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 266
+0x04,0x08,0x10,0x00,0x42,0x62,0x52,0x52,0x4A,0x46,0x42,0x42,0x00,0x00,0x00,0x00, // 267
+0x04,0x08,0x10,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 268
+0x04,0x08,0x10,0x00,0x7C,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 269
+0x04,0x08,0x10,0x00,0x3C,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 270
+0x04,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 271
+0x04,0x08,0x10,0x00,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 272
+0x04,0x08,0x10,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00,0x00, // 273
+0x09,0x12,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 274
+0x20,0x10,0x08,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 275
+0x20,0x10,0x08,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 276
+0x20,0x10,0x08,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 277
+0x20,0x10,0x08,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 278
+0x20,0x10,0x08,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 279
+0x00,0x44,0x44,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 280
+0x00,0x22,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 281
+0x00,0x00,0x18,0x24,0x18,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 282
+0x18,0x24,0x18,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 283
+0x00,0x00,0x00,0x32,0x4C,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 284
+0x00,0x00,0x00,0x32,0x4C,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 285
+0x00,0x00,0x11,0x22,0x44,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 286
+0x00,0x32,0x4C,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 287
+0x00,0x32,0x4C,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 288
+0x00,0x18,0x24,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 289
+0x18,0x24,0x42,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 290
+0x08,0x14,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 291
+0x18,0x24,0x42,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 292
+0x18,0x24,0x42,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 293
+0x00,0x00,0x42,0x24,0x18,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 294
+0x00,0x00,0x42,0x24,0x18,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 295
+0x00,0x00,0x42,0x24,0x18,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 296
+0x00,0x00,0x42,0x24,0x18,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00,0x00, // 297
+0x00,0x00,0x42,0x24,0x18,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00,0x00, // 298
+0x42,0x24,0x18,0x00,0x3C,0x42,0x42,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 299
+0x42,0x24,0x18,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00,0x00, // 300
+0x42,0x24,0x18,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 301
+0x42,0x24,0x18,0x00,0x42,0x62,0x52,0x52,0x4A,0x46,0x42,0x42,0x00,0x00,0x00,0x00, // 302
+0x42,0x24,0x18,0x00,0x7C,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 303
+0x42,0x24,0x18,0x00,0x3C,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 304
+0x44,0x28,0x10,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 305
+0x42,0x24,0x18,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x08,0x04,0x78,0x00, // 307
+0x00,0x00,0x00,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x08,0x04,0x78,0x00, // 308
+0x00,0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x08,0x04,0x78,0x00, // 309
+0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0xF0,0x00, // 310
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x10,0x20,0x1E,0x00, // 311
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x20,0x40,0x3E,0x00, // 312
+0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x20,0x40,0x3E,0x00, // 313
+0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x20,0x40,0x3E,0x00, // 314
+0x00,0x00,0x00,0x18,0x18,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00,0x00, // 315
+0x00,0x18,0x18,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00,0x00, // 316
+0x00,0x00,0x00,0x18,0x09,0x0A,0x0C,0x18,0x28,0x48,0x08,0x1C,0x00,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x00,0x01,0x3E,0x46,0x4A,0x52,0x62,0x7C,0x80,0x00,0x00,0x00, // 318
+0x00,0x00,0x00,0x20,0x21,0x22,0x24,0x28,0x30,0x60,0xA0,0x3F,0x00,0x00,0x00,0x00, // 319
+0x00,0x00,0x01,0x3E,0x46,0x4A,0x4A,0x52,0x52,0x52,0x62,0x7C,0x80,0x00,0x00,0x00, // 320
+0x00,0x00,0x02,0x02,0x0F,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 321
+0x14,0x08,0x14,0x22,0x42,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 322
+0x00,0x00,0x00,0x78,0x44,0x42,0xFA,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00,0x00, // 323
+0x03,0x03,0x01,0x05,0x05,0x05,0x7C,0x84,0x84,0x84,0x84,0x7C,0x00,0x00,0x00,0x00, // 324
+0x06,0x06,0x02,0x1A,0x0A,0x0A,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 325
+0x0C,0x0C,0x04,0x14,0x14,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00,0x00, // 326
+0x30,0x30,0x10,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 327
+0x00,0x00,0x81,0x42,0x3C,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 328
+0x00,0x00,0x81,0x42,0x3C,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 329
+0x81,0x42,0x3C,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 330
+0x00,0x00,0x81,0x42,0x3C,0x42,0x42,0x42,0x42,0x3C,0x42,0x81,0x00,0x00,0x00,0x00, // 331
+0x00,0x00,0xF0,0x40,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0xF0,0x00,0x00,0x00,0x00, // 332
+0x00,0x00,0x00,0x00,0x00,0xF0,0x40,0x70,0x48,0x70,0x40,0xF0,0x00,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00,0x00,0x00, // 334
+0x00,0x00,0x7E,0x81,0xB9,0xA5,0xA5,0xB9,0xA5,0xA5,0x81,0x7E,0x00,0x00,0x00,0x00, // 335
+0x00,0x00,0x7E,0x81,0x9D,0xA1,0xA1,0xA1,0xA1,0x9D,0x81,0x7E,0x00,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 337
+0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x00,0x00, // 338
+0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x04,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0xE0,0x12,0x64,0x14,0xE8,0x08,0x10,0x19,0x29,0x2F,0x41,0x41,0x80,0x00,0x00,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40,0x3E,0x00, // 344
+0x00,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x40,0xC0,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0xE0,0x10,0x60,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x12,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x02,0x7C,0x00, // 349
+0x42,0x24,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x81,0x42,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x00,0x11,0x22,0x44,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 353
+0x09,0x12,0x24,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 354
+0x22,0x14,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 355
+0x88,0x50,0x20,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 356
+0x44,0x28,0x10,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00,0x00, // 357
+0x00,0x00,0x44,0x28,0x10,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 358
+0x11,0x0A,0x04,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 359
+0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 360
+0x00,0x00,0x00,0xFC,0x80,0x80,0xF8,0x84,0x82,0x82,0x84,0xF8,0x00,0x00,0x00,0x00, // 361
+0x00,0x00,0x00,0xFE,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00, // 362
+0x00,0x00,0x3C,0x24,0x24,0x24,0x24,0x44,0x44,0x44,0x84,0xFE,0x82,0x82,0x00,0x00, // 363
+0x00,0x00,0x00,0x92,0x54,0x54,0x54,0x38,0x54,0x92,0x92,0x92,0x00,0x00,0x00,0x00, // 364
+0x00,0x00,0x00,0x82,0x82,0x86,0x8A,0x92,0xA2,0xC2,0x82,0x82,0x00,0x00,0x00,0x00, // 365
+0x44,0x38,0x00,0x82,0x82,0x86,0x8A,0x92,0xA2,0xC2,0x82,0x82,0x00,0x00,0x00,0x00, // 366
+0x00,0x00,0x00,0x3E,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0xC2,0x00,0x00,0x00,0x00, // 367
+0x00,0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 368
+0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x46,0x3A,0x02,0x82,0x7C,0x00,0x00,0x00,0x00, // 369
+0x00,0x00,0x10,0x7C,0x92,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x00,0x00,0x00,0x00, // 370
+0x00,0x00,0x00,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0xFE,0x02,0x02,0x00,0x00, // 371
+0x00,0x00,0x00,0x82,0x82,0x82,0x86,0x7A,0x02,0x02,0x02,0x02,0x00,0x00,0x00,0x00, // 372
+0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00,0x00, // 373
+0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x02,0x02,0x00,0x00, // 374
+0x00,0x00,0xE0,0xA0,0x20,0x20,0x2C,0x32,0x22,0x22,0x22,0x3C,0x00,0x00,0x00,0x00, // 375
+0x00,0x00,0x82,0x82,0x82,0x82,0xB2,0xCA,0x8A,0x8A,0x8A,0xF2,0x00,0x00,0x00,0x00, // 376
+0x00,0x00,0x40,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 377
+0x00,0x00,0x00,0xB8,0xC4,0x82,0x02,0x1E,0x02,0x02,0xC4,0x78,0x00,0x00,0x00,0x00, // 378
+0x00,0x00,0x00,0x8C,0x92,0x92,0x92,0xF2,0x92,0x92,0x92,0x8C,0x00,0x00,0x00,0x00, // 379
+0x00,0x00,0x00,0x7E,0x82,0x82,0x82,0x7E,0x22,0x42,0x82,0x82,0x00,0x00,0x00,0x00, // 380
+0x00,0x00,0x00,0x04,0x78,0x80,0xB8,0xC4,0x82,0x82,0x44,0x38,0x00,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x7C,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x44,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x00,0x3C,0x24,0x24,0x24,0x24,0x44,0xFE,0x82,0x82,0x00,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0x54,0x38,0x54,0x92,0x92,0x00,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x1C,0x02,0x42,0x7C,0x00,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x46,0x4A,0x52,0x62,0x42,0x00,0x00,0x00,0x00, // 387
+0x00,0x00,0x00,0x44,0x38,0x00,0x42,0x46,0x4A,0x52,0x62,0x42,0x00,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x48,0x70,0x48,0x44,0x42,0x00,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x22,0x22,0x22,0x22,0xC2,0x00,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x66,0x5A,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x44,0x44,0x28,0x28,0x10,0x10,0x20,0x40,0x00, // 395
+0x00,0x00,0x10,0x10,0x10,0x7C,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x10,0x10,0x00, // 396
+0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x84,0x84,0x84,0xFE,0x02,0x02,0x00,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x8C,0x74,0x04,0x04,0x00,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0xFE,0x02,0x02,0x00,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xE0,0xA0,0x2C,0x32,0x22,0x22,0x3C,0x00,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0xB2,0xCA,0x8A,0x8A,0xF2,0x00,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x5C,0x62,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x1E,0x02,0x42,0x7C,0x00,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0x92,0xF2,0x92,0x92,0x8C,0x00,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x84,0x84,0x7C,0x44,0x84,0x00,0x00,0x00,0x00, // 406
+0x00,0x00,0x00,0x3A,0x46,0x82,0x80,0xF0,0x80,0x80,0x46,0x38,0x00,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x38,0x40,0x42,0x3E,0x00,0x00,0x00,0x00, // 408
+0x00,0x00,0x00,0x3C,0x42,0x02,0x02,0x1C,0x02,0x02,0x42,0x3C,0x00,0x00,0x00,0x00, // 409
+0x00,0x00,0x00,0x44,0x38,0x00,0x82,0x44,0x44,0x28,0x28,0x10,0x10,0x20,0x40,0x00, // 410
+0x00,0x00,0x00,0x8A,0x8D,0xCD,0xAA,0x98,0x8B,0x88,0x88,0x88,0x00,0x00,0x00,0x00, // 411
+0x00,0x00,0x7C,0x10,0x10,0x10,0x1C,0x12,0x12,0x12,0x12,0x12,0x02,0x1C,0x00,0x00, // 412
+0x00,0x00,0x00,0x00,0x00,0x10,0x7C,0x10,0x1C,0x12,0x12,0x12,0x02,0x1C,0x00,0x00, // 413
+0x0C,0x18,0x7E,0x42,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 414
+0x00,0x00,0x00,0x0C,0x18,0x00,0x7E,0x42,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 415
+0x00,0x08,0x08,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 416
+0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x4E,0x4A,0x4A,0xCA,0xCE,0x00,0x00,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x44,0x4E,0xCA,0xCE,0x00,0x00,0x00,0x00, // 418
+0x00,0x00,0x00,0x88,0x88,0x88,0xFC,0x8E,0x8A,0x8A,0x8A,0x8E,0x00,0x00,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0xFE,0x8A,0x8A,0x8E,0x00,0x00,0x00,0x00, // 420
+0x00,0x00,0x7C,0x10,0x10,0x10,0x1C,0x12,0x12,0x12,0x12,0x12,0x00,0x00,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0x7C,0x10,0x1C,0x12,0x12,0x12,0x12,0x00,0x00,0x00,0x00, // 422
+0x0C,0x18,0x42,0x42,0x42,0x44,0x48,0x78,0x44,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 423
+0x00,0x00,0x4C,0x58,0x40,0x42,0x44,0x48,0x78,0x44,0x42,0x42,0x00,0x00,0x00,0x00, // 424
+0x6C,0x10,0x82,0x82,0x82,0x82,0x7E,0x02,0x02,0x02,0xC2,0x7C,0x00,0x00,0x00,0x00, // 425
+0x00,0x00,0x00,0x6C,0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x7E,0x02,0xC2,0x7C,0x00, // 426
+0x00,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x10,0x10,0x38,0x00, // 427
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x10,0x10,0x38,0x00, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x24,0x00,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0x00,0x00,0x00,0x00,0x00, // 430
+0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x38,0x10,0x10,0x10,0x00,0x00,0x00, // 431
+0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x38,0x10,0x10,0x7C,0x10,0x00,0x00,0x00, // 432
+0x00,0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00,0x00, // 433
+0x00,0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x00,0x00,0x02,0x06,0x3E,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00, // 437
+0x00,0x00,0x00,0x00,0x02,0x06,0x3E,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00, // 438
+0x00,0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00,0x00, // 439
+0x00,0x00,0x6E,0x98,0x98,0x98,0x9C,0x98,0x98,0x98,0x98,0x6E,0x00,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x00,0x6E,0x99,0x99,0x9F,0x98,0x99,0x6E,0x00,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 443
+0x00,0x70,0x88,0x80,0x88,0x70,0x00,0x3C,0x22,0x3C,0x24,0x22,0x00,0x00,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 447
+0x00,0x00,0x00,0x04,0x08,0xFE,0x10,0x20,0xFE,0x40,0x80,0x00,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x00,0x00,0x02,0x32,0x62,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x44,0x00,0x44,0x44,0x44,0x44,0x38,0x10,0x10,0x10,0x38,0x00,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00, // 456
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x40,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, // 459
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x78,0x44,0x42,0x42,0x00,0x00,0x00, // 461
+0x00,0x00,0x00,0x9C,0xA2,0xC2,0x82,0x82,0x82,0x82,0x82,0x82,0x9C,0x00,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0x00,0xBC,0xC2,0x82,0x82,0x82,0x82,0x02,0x1C,0x00,0x00,0x00, // 463
+0x10,0x28,0x44,0x3C,0x42,0x42,0x40,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 464
+0x00,0x00,0x10,0x28,0x44,0x82,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 465
+0x10,0x28,0x44,0x3C,0x42,0x40,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 466
+0x00,0x10,0x28,0x44,0x82,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00,0x00, // 467
+0x10,0x28,0x44,0x02,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 468
+0x10,0x28,0x44,0xC2,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 469
+0x10,0x28,0x44,0x82,0x02,0x02,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 470
+0x00,0x08,0x14,0x22,0x41,0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x22,0x1C,0x00,0x00, // 471
+0x10,0x28,0x44,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 472
+0x00,0x00,0x10,0x28,0x44,0x82,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00,0x00, // 473
+0x10,0x28,0x44,0x00,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 474
+0x00,0x10,0x28,0x44,0x82,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 475
+0x10,0x28,0x44,0x00,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 476
+0x00,0x10,0x28,0x44,0x82,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00,0x00, // 477
+0x18,0x18,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 478
+0x00,0x18,0x18,0x40,0x40,0x40,0x7C,0x42,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 479
+0x18,0x18,0x00,0x3C,0x42,0x42,0x40,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 480
+0x00,0x00,0x00,0x18,0x18,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 481
+0x18,0x18,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00,0x00, // 482
+0x0C,0x0C,0x00,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 483
+0x18,0x18,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 484
+0x18,0x18,0x00,0x1C,0x22,0x22,0x20,0x78,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00, // 485
+0x00,0x00,0x00,0x18,0x18,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00,0x00, // 486
+0x08,0x1C,0x08,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 487
+0x10,0x38,0x10,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 488
+0x00,0x00,0x00,0x18,0x18,0x00,0xC4,0xEE,0x92,0x92,0x92,0x82,0x00,0x00,0x00,0x00, // 489
+0x18,0x18,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 490
+0x00,0x00,0x00,0x18,0x18,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00, // 491
+0x18,0x18,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 492
+0x00,0x00,0x00,0x18,0x18,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00,0x00, // 493
+0x18,0x18,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 494
+0x18,0x18,0x00,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00,0x00, // 495
+0x00,0x7F,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x00,0x7E,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 497
+0x00,0x7F,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x00,0x7E,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 499
+0x00,0x7E,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x00,0x7E,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 501
+0x00,0x7E,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x00,0x7E,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 503
+0x81,0x42,0x3C,0x00,0x3C,0x42,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 504
+0x00,0x00,0x81,0x42,0x3C,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00,0x00, // 505
+0x81,0x42,0x3C,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 506
+0x00,0x00,0x81,0x42,0x3C,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 507
+0x81,0x42,0x3C,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 508
+0x00,0x00,0x81,0x42,0x3C,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 509
+0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x4E,0x42,0x46,0x3A,0x20,0x40,0x3E,0x00, // 510
+0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x62,0x7C,0x30,0x60,0x3E, // 511
+0x00,0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x20,0x40,0x3E,0x00, // 512
+0x00,0x00,0x00,0x40,0x40,0x40,0x42,0x44,0x78,0x44,0x42,0x42,0x20,0x40,0x3E,0x00, // 513
+0x00,0x00,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x42,0x20,0x40,0x3E,0x00, // 514
+0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x20,0x40,0x3E,0x00, // 515
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x20,0x40,0x3E,0x00, // 516
+0x00,0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x20,0x40,0x3E,0x00, // 517
+0x00,0x76,0xDC,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,0x00,0x00, // 518
+0x00,0x00,0x00,0x76,0xDC,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 519
+0x00,0x00,0x76,0xDC,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 520
+0x00,0x00,0x00,0x76,0xDC,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 521
+0x00,0x00,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x04,0x02,0x7C,0x00, // 522
+0x00,0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x04,0x02,0x7C,0x00, // 523
+0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x04,0x02,0x7C,0x00, // 524
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x04,0x02,0x7C,0x00, // 525
+0x20,0x10,0x08,0x82,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 526
+0x00,0x00,0x00,0x20,0x10,0x08,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 527
+0x40,0x20,0x10,0x82,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 528
+0x00,0x00,0x00,0x20,0x10,0x08,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00,0x00, // 529
+0x04,0x08,0x10,0x82,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 530
+0x00,0x00,0x04,0x08,0x10,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 531
+0x82,0x82,0x00,0x82,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 532
+0x00,0x00,0x00,0x82,0x82,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00,0x00, // 533
+0x00,0x00,0x00,0x43,0x42,0x46,0x4A,0x7E,0x62,0x42,0xC2,0x42,0x00,0x00,0x00,0x00, // 534
+0x00,0x00,0x00,0x40,0x42,0x44,0x5C,0x72,0x62,0x42,0xC2,0x42,0x00,0x00,0x00,0x00, // 535
+0x00,0x00,0x00,0xFE,0x12,0x14,0x18,0x10,0x30,0x50,0x90,0x10,0x00,0x00,0x00,0x00, // 536
+0x00,0x00,0x00,0x10,0x12,0x14,0x7C,0x10,0x30,0x50,0x90,0x0C,0x00,0x00,0x00,0x00, // 537
+0x30,0x18,0x18,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 538
+0x00,0x00,0x30,0x18,0x18,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 539
+0x30,0x18,0x18,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 540
+0x00,0x00,0x00,0x30,0x18,0x18,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 541
+0x18,0x18,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 542
+0x00,0x00,0x00,0x18,0x18,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 543
+0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x0C,0x06,0x7C,0x00, // 544
+0x00,0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x0C,0x06,0x7C,0x00, // 545
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x44,0x38,0x44,0x82,0x82,0x7C,0x00, // 546
+0x00,0x00,0xFE,0x08,0x10,0x20,0x40,0x80,0x80,0x80,0x80,0x7C,0x02,0x02,0x3C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0x42,0x02,0x02,0x02,0x00, // 548
+0x00,0x00,0x78,0x84,0x04,0x04,0x7C,0x84,0x84,0x84,0x84,0x78,0x00,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x0E,0x00,0x00,0x00,0x00, // 550
+0x00,0x00,0x7C,0x82,0x02,0x02,0x3E,0x42,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x00,0x81,0x81,0x42,0x42,0x42,0x24,0x18,0x00,0x00,0x00,0x00, // 552
+0x00,0x00,0xFE,0x08,0x10,0x20,0x40,0x40,0x3C,0x40,0x80,0x7C,0x02,0x02,0x3C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x82,0x80,0x80,0x7C,0x02,0x7C,0x00,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x7C,0x00,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x82,0x42,0x24,0x38,0x38,0x44,0x82,0x82,0x00,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x10,0x10,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x6C,0x82,0x92,0x92,0x92,0x92,0x6C,0x00,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x28,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0x82,0x00,0x00,0x7C,0x00,0x00,0x00,0x82,0xFE,0x00,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 562
+0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x10,0x38,0x00,0x00,0x00,0x00, // 563
+0x06,0x0C,0x08,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x00,0x08,0x10,0x20,0x00,0x76,0x88,0x88,0x88,0x88,0x76,0x00,0x00,0x00,0x00, // 565
+0x04,0x08,0x10,0x1C,0x20,0x40,0x40,0x7C,0x40,0x40,0x20,0x1C,0x00,0x00,0x00,0x00, // 566
+0x00,0x04,0x08,0x10,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0x42,0x02,0x02,0x02,0x00, // 567
+0x00,0x04,0x08,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x0E,0x00,0x00,0x00,0x00, // 568
+0x00,0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 569
+0x00,0x00,0x04,0x08,0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x7C,0x00,0x00,0x00,0x00, // 570
+0x00,0x04,0x08,0x10,0x00,0x6C,0x82,0x92,0x92,0x92,0x92,0x6C,0x00,0x00,0x00,0x00, // 571
+0x00,0x00,0x20,0x58,0xA4,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 572
+0x00,0x20,0x40,0xBE,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 573
+0x00,0x20,0x40,0xC2,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 574
+0x00,0x10,0x20,0x5C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 575
+0x00,0x20,0x40,0xBC,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 576
+0x00,0x20,0x40,0xC1,0x41,0x41,0x22,0x1C,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00, // 577
+0x00,0x00,0x20,0x5C,0xA2,0x22,0x22,0x22,0x14,0x14,0x14,0x77,0x00,0x00,0x00,0x00, // 578
+0x00,0x00,0x00,0x44,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x0E,0x00,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0x82,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x7C,0x00,0x00,0x00,0x00, // 580
+0x04,0x08,0x10,0x44,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x0E,0x00,0x00,0x00,0x00, // 581
+0x00,0x08,0x10,0xA2,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x7C,0x00,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x28,0x44,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x00,0x7E,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 584
+0x00,0x00,0x7E,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 585
+0x00,0x18,0x18,0x00,0x3C,0x42,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00,0x00, // 586
+0x00,0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00,0x00, // 587
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 588
+0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 589
+0x00,0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x00,0x00,0x00,0x00, // 590
+0x00,0x00,0x00,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 591
+0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 592
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 593
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 594
+0x00,0x00,0x00,0x3C,0x42,0x42,0x40,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 595
+0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 596
+0x00,0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00,0x00, // 603
+0x00,0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00,0x00, // 604
+0x00,0x44,0x44,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00,0x00, // 606
+0x00,0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 607
+0x00,0x00,0x00,0x22,0x22,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 608
+0x00,0x00,0x00,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x22,0x1C,0x00,0x00, // 609
+0x00,0x22,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 610
+0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 611
+0x00,0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7C,0x42,0x42,0x7C,0x40,0x40,0x40,0x00,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x48,0x70,0x48,0x44,0x42,0x00,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x00,0x22,0x22,0x22,0x22,0x3C,0x20,0x20,0x60,0x00,0x00,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 616
+0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 617
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00,0x00, // 618
+0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 619
+0x00,0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x40,0x7E,0x00,0x00,0x00,0x00, // 620
+0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 621
+0x00,0x00,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 622
+0x00,0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x00,0x00,0x00,0x00, // 623
+0x00,0x00,0x00,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00, // 624
+0x00,0x00,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x42,0x00,0x00,0x00,0x00, // 625
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00,0x00, // 626
+0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00, // 627
+0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 628
+0x00,0x00,0x00,0x82,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // 629
+0x00,0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00,0x00, // 630
+0x00,0x22,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00,0x00, // 631
+0x00,0x44,0x00,0x44,0x44,0x44,0x44,0x38,0x10,0x10,0x10,0x38,0x00,0x00,0x00,0x00, // 632
+};
+
+unsigned char BR14[]={
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0
+0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x7E,0x00,0x00,0x00, // 
+0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF,0x7E,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00,0x00, // 
+0x00,0x00,0x10,0x38,0x7C,0xFE,0xFE,0x7C,0x10,0x10,0x38,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00, // 
+0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF, // 
+0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00, // \t
+0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF, // \n
+0x00,0x00,0x0E,0x06,0x0A,0x10,0x3C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x3C,0x42,0x42,0x42,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x1F,0x11,0x1F,0x10,0x10,0x10,0x70,0xF0,0xE0,0x00,0x00,0x00, // \r
+0x00,0x00,0x3F,0x21,0x3F,0x21,0x21,0x21,0x27,0xE7,0xE6,0xC0,0x00,0x00, // 
+0x00,0x00,0x10,0x10,0xD6,0x38,0xEE,0x38,0xD6,0x10,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x80,0xC0,0xE0,0xF8,0xFE,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00, // 
+0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00, // 
+0x00,0x00,0x10,0x38,0x7C,0x10,0x10,0x10,0x7C,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00, // 
+0x00,0x00,0x7F,0x89,0x89,0x89,0x79,0x09,0x09,0x09,0x09,0x00,0x00,0x00, // 
+0x00,0x7C,0x82,0x40,0x38,0x44,0x82,0x82,0x44,0x38,0x04,0x82,0x7C,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0x00,0x00,0x00, // 
+0x00,0x00,0x10,0x38,0x7C,0x10,0x10,0x10,0x7C,0x38,0x10,0x7C,0x00,0x00, // 
+0x00,0x00,0x10,0x38,0x7C,0xFE,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x10,0x10,0x10,0x10,0x10,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x08,0x0C,0x0E,0xFF,0x0E,0x0C,0x08,0x00,0x00,0x00,0x00, // \x1A
+0x00,0x00,0x00,0x10,0x30,0x70,0xFF,0x70,0x30,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xFE,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00, // !
+0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // "
+0x00,0x00,0x44,0x44,0xFE,0x44,0x44,0x44,0xFE,0x44,0x44,0x00,0x00,0x00, // #
+0x10,0x10,0x7C,0x92,0x90,0x90,0x7C,0x12,0x12,0x92,0x7C,0x10,0x10,0x00, // $
+0x00,0x00,0x00,0x00,0x62,0x94,0x68,0x10,0x2C,0x52,0x8C,0x00,0x00,0x00, // %
+0x00,0x00,0x38,0x44,0x44,0x38,0x56,0x8C,0x88,0x8C,0x76,0x00,0x00,0x00, // &
+0x00,0x10,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // '
+0x00,0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x10,0x08,0x04,0x00,0x00,0x00, // (
+0x00,0x00,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x20,0x00,0x00,0x00, // )
+0x00,0x00,0x00,0x00,0x44,0x28,0xFE,0x28,0x44,0x00,0x00,0x00,0x00,0x00, // *
+0x00,0x00,0x00,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x00,0x00,0x00,0x00, // +
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x10,0x20,0x00, // ,
+0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // -
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00, // .
+0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x00, // /
+0x00,0x00,0x3C,0x42,0x42,0x46,0x4A,0x52,0x62,0x42,0x3C,0x00,0x00,0x00, // 0
+0x00,0x00,0x08,0x18,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00, // 1
+0x00,0x00,0x3C,0x42,0x02,0x04,0x18,0x20,0x40,0x40,0x7E,0x00,0x00,0x00, // 2
+0x00,0x00,0x3C,0x42,0x02,0x02,0x1C,0x02,0x02,0x42,0x3C,0x00,0x00,0x00, // 3
+0x00,0x00,0x04,0x0C,0x14,0x24,0x44,0x7E,0x04,0x04,0x04,0x00,0x00,0x00, // 4
+0x00,0x00,0x7E,0x40,0x40,0x7C,0x02,0x02,0x02,0x42,0x3C,0x00,0x00,0x00, // 5
+0x00,0x00,0x1C,0x20,0x40,0x40,0x7C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 6
+0x00,0x00,0x7E,0x42,0x02,0x04,0x08,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 7
+0x00,0x00,0x3C,0x42,0x42,0x42,0x3C,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 8
+0x00,0x00,0x3C,0x42,0x42,0x42,0x3E,0x02,0x02,0x04,0x38,0x00,0x00,0x00, // 9
+0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00, // :
+0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x10,0x20,0x00,0x00, // ;
+0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00,0x00, // <
+0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00, // =
+0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x00, // >
+0x00,0x00,0x3C,0x42,0x42,0x04,0x08,0x08,0x00,0x08,0x08,0x00,0x00,0x00, // ?
+0x00,0x00,0x3C,0x42,0x42,0x4E,0x52,0x52,0x4E,0x40,0x3C,0x00,0x00,0x00, // @
+0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // A
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // B
+0x00,0x00,0x3C,0x42,0x42,0x40,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00, // C
+0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00, // D
+0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // E
+0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // F
+0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00, // G
+0x00,0x00,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // H
+0x00,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // I
+0x00,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,0x00,0x00, // J
+0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x00,0x00,0x00, // K
+0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // L
+0x00,0x00,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // M
+0x00,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x42,0x00,0x00,0x00, // N
+0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // O
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // P
+0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x4A,0x4A,0x3C,0x04,0x06,0x00, // Q
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x00,0x00,0x00, // R
+0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00, // S
+0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // T
+0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // U
+0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,0x00, // V
+0x00,0x00,0x82,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // W
+0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00, // X
+0x00,0x00,0x82,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // Y
+0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x40,0x7E,0x00,0x00,0x00, // Z
+0x00,0x00,0x3C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3C,0x00,0x00,0x00, // [
+0x00,0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,0x00,0x00, // \.
+0x00,0x00,0x3C,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x3C,0x00,0x00,0x00, // ]
+0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ^
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00, // _
+0x00,0x10,0x10,0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // `
+0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, // a
+0x00,0x00,0x40,0x40,0x40,0x7C,0x42,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // b
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, // c
+0x00,0x00,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00, // d
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // e
+0x00,0x00,0x1C,0x22,0x22,0x20,0x78,0x20,0x20,0x20,0x20,0x00,0x00,0x00, // f
+0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00, // g
+0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // h
+0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // i
+0x00,0x00,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x22,0x1C,0x00, // j
+0x00,0x00,0x40,0x40,0x40,0x42,0x44,0x78,0x44,0x42,0x42,0x00,0x00,0x00, // k
+0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // l
+0x00,0x00,0x00,0x00,0x00,0xC4,0xEE,0x92,0x92,0x92,0x82,0x00,0x00,0x00, // m
+0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // n
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // o
+0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00, // p
+0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x02,0x03,0x00, // q
+0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // r
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00, // s
+0x00,0x00,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00, // t
+0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // u
+0x00,0x00,0x00,0x00,0x00,0x22,0x22,0x22,0x22,0x14,0x08,0x00,0x00,0x00, // v
+0x00,0x00,0x00,0x00,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // w
+0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00, // x
+0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00, // y
+0x00,0x00,0x00,0x00,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00, // z
+0x00,0x00,0x06,0x08,0x08,0x08,0x30,0x08,0x08,0x08,0x06,0x00,0x00,0x00, // {
+0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // |
+0x00,0x00,0x60,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x60,0x00,0x00,0x00, // }
+0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~
+0x00,0x00,0x00,0x00,0x10,0x28,0x44,0x82,0x82,0xFE,0x00,0x00,0x00,0x00, // 
+0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x40,0x42,0x3C,0x04,0x02,0x3C,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, //
+0x00,0x08,0x08,0x10,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x08,0x14,0x22,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, //
+0x00,0x20,0x10,0x08,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, //
+0x00,0x1C,0x22,0x1C,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x42,0x3C,0x04,0x02,0x1C,0x00,0x00, //
+0x00,0x08,0x14,0x22,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x20,0x10,0x08,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x22,0x22,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, //
+0x00,0x08,0x14,0x22,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, //
+0x00,0x20,0x10,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, //
+0x00,0x42,0x42,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x00,0x00,0x00, //
+0x18,0x24,0x18,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x00,0x00,0x00, //
+0x04,0x08,0x10,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x8C,0x52,0x22,0x7C,0x88,0x88,0x74,0x00,0x00,0x00, //
+0x00,0x00,0x3E,0x48,0x88,0x88,0xFE,0x88,0x88,0x88,0x8E,0x00,0x00,0x00, //
+0x00,0x08,0x14,0x22,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x20,0x10,0x08,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x10,0x28,0x44,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, //
+0x00,0x20,0x10,0x08,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x38,0x00, //
+0x00,0x42,0x42,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x42,0x42,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x10,0x10,0x7C,0x92,0x90,0x90,0x92,0x7C,0x10,0x10,0x00,0x00,0x00, //
+0x00,0x1C,0x22,0x22,0x20,0x78,0x20,0x20,0x20,0x62,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x42,0x42,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x00,0x00,0x00, //
+0x00,0xF8,0x84,0x84,0xF8,0x84,0x84,0x8E,0x84,0x84,0x82,0x00,0x00,0x00, //
+0x00,0x0C,0x12,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x90,0x60,0x00, //
+0x00,0x04,0x08,0x10,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, //
+0x00,0x02,0x04,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, //
+0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x04,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, //
+0x00,0x00,0x76,0xDC,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00, //
+0x76,0xDC,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x00,0x00,0x00, //
+0x00,0x38,0x48,0x48,0x3C,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x44,0x44,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x10,0x10,0x00,0x10,0x10,0x20,0x42,0x42,0x3C,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x80,0x80,0x80,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0x04,0x04,0x00,0x00,0x00,0x00, //
+0x00,0x00,0xC0,0x42,0x44,0x48,0x50,0x20,0x5C,0x82,0x1C,0x20,0x3E,0x00, //
+0x00,0x00,0xC0,0x42,0x44,0x48,0x50,0x24,0x4C,0x94,0x3E,0x04,0x04,0x00, //
+0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x12,0x24,0x48,0x24,0x12,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x48,0x24,0x12,0x24,0x48,0x00,0x00,0x00,0x00,0x00, //
+0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, //
+0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, //
+0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0xF0,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xE4,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0xF0,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x24,0x24,0x24,0x24,0x24,0xE4,0x04,0xE4,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0xE4,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0xE4,0x04,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x1F,0x10,0x1F,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x27,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x27,0x20,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x3F,0x20,0x27,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0xE7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xE7,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x27,0x20,0x27,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x24,0x24,0x24,0x24,0x24,0xE7,0x00,0xE7,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x10,0x10,0x10,0x10,0x10,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x10,0x10,0x10,0x10,0x10,0x1F,0x10,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x1F,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x24,0x24,0x24,0x24,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0x24,0x24,0x24, //
+0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //
+0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, //
+0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, //
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x76,0x88,0x88,0x88,0x88,0x76,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x3C,0x42,0x7C,0x42,0x42,0x7C,0x40,0x40,0x40,0x00, //
+0x00,0x00,0x7E,0x42,0x42,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7E,0x24,0x24,0x24,0x24,0x24,0x24,0x00,0x00,0x00, //
+0x00,0x00,0x7E,0x42,0x20,0x10,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7E,0x88,0x88,0x88,0x88,0x70,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x22,0x22,0x22,0x22,0x3C,0x20,0x20,0x60,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, //
+0x00,0x00,0x7C,0x10,0x38,0x44,0x44,0x44,0x38,0x10,0x7C,0x00,0x00,0x00, //
+0x00,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x24,0x18,0x00,0x00,0x00, //
+0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0xEE,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x20,0x10,0x08,0x3C,0x44,0x44,0x44,0x38,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x7C,0x92,0x92,0x7C,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x02,0x04,0x7C,0x92,0x92,0xA2,0x7C,0x40,0x80,0x00,0x00,0x00, //
+0x00,0x00,0x1C,0x20,0x40,0x40,0x7C,0x40,0x40,0x20,0x1C,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00, //
+0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0xFE,0x00,0x00,0x00, //
+0x00,0x00,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x00,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00,0x7E,0x00,0x00,0x00, //
+0x00,0x00,0x0C,0x12,0x12,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x90,0x60,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x10,0x10,0x00,0x7C,0x00,0x10,0x10,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x38,0x44,0x44,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x0F,0x08,0x08,0x08,0x08,0x08,0xE8,0x28,0x18,0x08,0x00,0x00,0x00, //
+0x00,0x5C,0x22,0x22,0x22,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x30,0x48,0x10,0x20,0x40,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00, //
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255
+0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, // 256
+0x04,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 257
+0x00,0x04,0x08,0x10,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 258
+0x00,0x04,0x08,0x10,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 259
+0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00, // 260
+0x00,0x04,0x08,0x10,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00, // 261
+0x00,0x04,0x08,0x10,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00, // 262
+0x08,0x10,0x20,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 263
+0x08,0x10,0x20,0x3C,0x42,0x42,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00, // 264
+0x04,0x08,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 265
+0x20,0x40,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 266
+0x08,0x10,0x20,0x42,0x62,0x52,0x52,0x4A,0x46,0x42,0x42,0x00,0x00,0x00, // 267
+0x08,0x10,0x20,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 268
+0x08,0x10,0x20,0x7C,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x00,0x00,0x00, // 269
+0x08,0x10,0x20,0x3C,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00, // 270
+0x08,0x10,0x20,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 271
+0x08,0x10,0x20,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 272
+0x08,0x10,0x20,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00, // 273
+0x12,0x24,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 274
+0x10,0x08,0x04,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 275
+0x10,0x08,0x04,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 276
+0x10,0x08,0x04,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 277
+0x10,0x08,0x04,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 278
+0x10,0x08,0x04,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 279
+0x44,0x44,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 280
+0x22,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 281
+0x00,0x18,0x24,0x18,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // 282
+0x18,0x24,0x18,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 283
+0x00,0x00,0x32,0x4C,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, // 284
+0x00,0x00,0x32,0x4C,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 285
+0x00,0x11,0x22,0x44,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // 286
+0x32,0x4C,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 287
+0x32,0x4C,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 288
+0x18,0x24,0x42,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 289
+0x18,0x24,0x42,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 290
+0x08,0x14,0x22,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 291
+0x18,0x24,0x42,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 292
+0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 293
+0x00,0x42,0x24,0x18,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, // 294
+0x00,0x42,0x24,0x18,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 295
+0x00,0x42,0x24,0x18,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 296
+0x00,0x42,0x24,0x18,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00, // 297
+0x00,0x42,0x24,0x18,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00, // 298
+0x24,0x18,0x00,0x3C,0x42,0x42,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00, // 299
+0x24,0x18,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00, // 300
+0x24,0x18,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 301
+0x24,0x18,0x00,0x42,0x62,0x52,0x52,0x4A,0x46,0x42,0x42,0x00,0x00,0x00, // 302
+0x24,0x18,0x00,0x7C,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x00,0x00,0x00, // 303
+0x24,0x18,0x00,0x3C,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00, // 304
+0x28,0x10,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 305
+0x24,0x18,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00, // 306
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x08,0x04,0x78, // 307
+0x00,0x00,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x08,0x04,0x78, // 308
+0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x08,0x04,0x78, // 309
+0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0xF0, // 310
+0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x10,0x20,0x1E, // 311
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x20,0x40,0x3E, // 312
+0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x20,0x40,0x3E, // 313
+0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x20,0x40,0x3E, // 314
+0x00,0x00,0x18,0x18,0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00,0x00, // 315
+0x18,0x18,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00, // 316
+0x00,0x00,0x18,0x09,0x0A,0x0C,0x18,0x28,0x48,0x08,0x1C,0x00,0x00,0x00, // 317
+0x00,0x00,0x00,0x00,0x01,0x3E,0x46,0x4A,0x52,0x62,0x7C,0x80,0x00,0x00, // 318
+0x00,0x00,0x20,0x21,0x22,0x24,0x28,0x30,0x60,0xA0,0x3F,0x00,0x00,0x00, // 319
+0x00,0x01,0x3E,0x46,0x4A,0x4A,0x52,0x52,0x52,0x62,0x7C,0x80,0x00,0x00, // 320
+0x00,0x02,0x02,0x0F,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00, // 321
+0x28,0x10,0x28,0x44,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00, // 322
+0x00,0x00,0x78,0x44,0x42,0xFA,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00, // 323
+0x03,0x01,0x05,0x05,0x05,0x7C,0x84,0x84,0x84,0x84,0x7C,0x00,0x00,0x00, // 324
+0x06,0x02,0x1A,0x0A,0x0A,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 325
+0x0C,0x04,0x14,0x14,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00, // 326
+0x30,0x10,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 327
+0x00,0x81,0x42,0x3C,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, // 328
+0x00,0x81,0x42,0x3C,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // 329
+0x42,0x3C,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 330
+0x00,0x81,0x42,0x3C,0x42,0x42,0x42,0x42,0x3C,0x42,0x81,0x00,0x00,0x00, // 331
+0x00,0xF0,0x40,0x78,0x44,0x44,0x44,0x78,0x40,0x40,0xF0,0x00,0x00,0x00, // 332
+0x00,0x00,0x00,0x00,0xF0,0x40,0x70,0x48,0x70,0x40,0xF0,0x00,0x00,0x00, // 333
+0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00,0x00, // 334
+0x00,0x7E,0x81,0xB9,0xA5,0xA5,0xB9,0xA5,0xA5,0x81,0x7E,0x00,0x00,0x00, // 335
+0x00,0x7E,0x81,0x9D,0xA1,0xA1,0xA1,0xA1,0x9D,0x81,0x7E,0x00,0x00,0x00, // 336
+0x00,0x00,0x00,0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 337
+0x00,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x00, // 338
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 339
+0x08,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 340
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 341
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF, // 342
+0xE2,0x12,0x64,0x14,0xE8,0x08,0x10,0x19,0x29,0x2F,0x41,0x41,0x80,0x00, // 343
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40,0x3E, // 344
+0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 345
+0x40,0xC0,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 346
+0xE0,0x10,0x60,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 347
+0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 348
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x02,0x7C, // 349
+0x24,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 350
+0x42,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 351
+0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 352
+0x00,0x11,0x22,0x44,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 353
+0x12,0x24,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 354
+0x24,0x18,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 355
+0x90,0x60,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 356
+0x24,0x18,0x10,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00, // 357
+0x00,0x44,0x28,0x10,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // 358
+0x09,0x06,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00, // 359
+0x00,0x00,0x38,0x44,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 360
+0x00,0x00,0xFC,0x80,0x80,0xF8,0x84,0x82,0x82,0x84,0xF8,0x00,0x00,0x00, // 361
+0x00,0x00,0xFE,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00, // 362
+0x00,0x3C,0x24,0x24,0x24,0x24,0x44,0x44,0x44,0x84,0xFE,0x82,0x82,0x00, // 363
+0x00,0x00,0x92,0x54,0x54,0x54,0x38,0x54,0x92,0x92,0x92,0x00,0x00,0x00, // 364
+0x00,0x00,0x82,0x82,0x86,0x8A,0x92,0xA2,0xC2,0x82,0x82,0x00,0x00,0x00, // 365
+0x28,0x10,0x00,0x82,0x82,0x86,0x8A,0x92,0xA2,0xC2,0x82,0x00,0x00,0x00, // 366
+0x00,0x00,0x3E,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0xC2,0x00,0x00,0x00, // 367
+0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 368
+0x00,0x00,0x82,0x82,0x82,0x82,0x46,0x3A,0x02,0x82,0x7C,0x00,0x00,0x00, // 369
+0x00,0x10,0x7C,0x92,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x00,0x00,0x00, // 370
+0x00,0x00,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0xFE,0x02,0x02,0x00, // 371
+0x00,0x00,0x82,0x82,0x82,0x86,0x7A,0x02,0x02,0x02,0x02,0x00,0x00,0x00, // 372
+0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00, // 373
+0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x02,0x02,0x00, // 374
+0x00,0xE0,0xA0,0x20,0x20,0x2C,0x32,0x22,0x22,0x22,0x3C,0x00,0x00,0x00, // 375
+0x00,0x82,0x82,0x82,0x82,0xB2,0xCA,0x8A,0x8A,0x8A,0xF2,0x00,0x00,0x00, // 376
+0x00,0x40,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // 377
+0x00,0x00,0xB8,0xC4,0x82,0x1E,0x02,0x02,0x02,0xC4,0x78,0x00,0x00,0x00, // 378
+0x00,0x00,0x8C,0x92,0x92,0x92,0xF2,0x92,0x92,0x92,0x8C,0x00,0x00,0x00, // 379
+0x00,0x00,0x7E,0x82,0x82,0x82,0x7E,0x22,0x42,0x82,0x82,0x00,0x00,0x00, // 380
+0x00,0x00,0x04,0x78,0x80,0xB8,0xC4,0x82,0x82,0x44,0x38,0x00,0x00,0x00, // 381
+0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x7C,0x42,0x42,0x7C,0x00,0x00,0x00, // 382
+0x00,0x00,0x00,0x00,0x00,0x7C,0x44,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 383
+0x00,0x00,0x00,0x00,0x3C,0x24,0x24,0x24,0x24,0x44,0xFE,0x82,0x82,0x00, // 384
+0x00,0x00,0x00,0x00,0x00,0xD6,0x54,0x38,0x54,0x92,0x92,0x00,0x00,0x00, // 385
+0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x1C,0x02,0x42,0x7C,0x00,0x00,0x00, // 386
+0x00,0x00,0x00,0x00,0x00,0x42,0x46,0x4A,0x52,0x62,0x42,0x00,0x00,0x00, // 387
+0x00,0x00,0x44,0x38,0x00,0x42,0x46,0x4A,0x52,0x62,0x42,0x00,0x00,0x00, // 388
+0x00,0x00,0x00,0x00,0x00,0x46,0x48,0x70,0x48,0x44,0x42,0x00,0x00,0x00, // 389
+0x00,0x00,0x00,0x00,0x00,0x3E,0x22,0x22,0x22,0x22,0xC2,0x00,0x00,0x00, // 390
+0x00,0x00,0x00,0x00,0x00,0x42,0x66,0x5A,0x42,0x42,0x42,0x00,0x00,0x00, // 391
+0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 392
+0x00,0x00,0x00,0x00,0x00,0x7E,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 393
+0x00,0x00,0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 394
+0x00,0x00,0x00,0x00,0x00,0x82,0x44,0x44,0x28,0x28,0x10,0x10,0x20,0x40, // 395
+0x00,0x10,0x10,0x10,0x7C,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x10,0x10, // 396
+0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x84,0x84,0x84,0xFE,0x02,0x02,0x00, // 397
+0x00,0x00,0x00,0x00,0x00,0x84,0x84,0x8C,0x74,0x04,0x04,0x00,0x00,0x00, // 398
+0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00, // 399
+0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0xFE,0x02,0x02,0x00, // 400
+0x00,0x00,0x00,0x00,0x00,0xE0,0xA0,0x2C,0x32,0x22,0x3C,0x00,0x00,0x00, // 401
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0xB2,0xCA,0x8A,0xF2,0x00,0x00,0x00, // 402
+0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x5C,0x62,0x42,0x7C,0x00,0x00,0x00, // 403
+0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x1E,0x02,0x42,0x7C,0x00,0x00,0x00, // 404
+0x00,0x00,0x00,0x00,0x00,0x8C,0x92,0xF2,0x92,0x92,0x8C,0x00,0x00,0x00, // 405
+0x00,0x00,0x00,0x00,0x00,0x7C,0x84,0x7C,0x24,0x44,0x84,0x00,0x00,0x00, // 406
+0x00,0x00,0x3A,0x46,0x82,0xF0,0x80,0x80,0x80,0x46,0x38,0x00,0x00,0x00, // 407
+0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x38,0x40,0x42,0x3E,0x00,0x00,0x00, // 408
+0x00,0x00,0x3C,0x42,0x02,0x02,0x1C,0x02,0x02,0x42,0x3C,0x00,0x00,0x00, // 409
+0x00,0x00,0x44,0x38,0x00,0x82,0x44,0x44,0x28,0x28,0x10,0x10,0x20,0x40, // 410
+0x00,0x00,0x8A,0x8D,0xCD,0xAA,0x98,0x8B,0x88,0x88,0x88,0x00,0x00,0x00, // 411
+0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x1C,0x12,0x12,0x12,0x12,0x02,0x0C, // 412
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x10,0x1C,0x12,0x12,0x12,0x02,0x0C, // 413
+0x0C,0x18,0x00,0x7E,0x42,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00, // 414
+0x00,0x00,0x00,0x0C,0x18,0x00,0x7E,0x42,0x40,0x40,0x40,0x40,0x00,0x00, // 415
+0x00,0x00,0x08,0x08,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00, // 416
+0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x4E,0x4A,0x4A,0xCA,0xCE,0x00,0x00, // 417
+0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x4E,0x4A,0xCA,0xCE,0x00,0x00, // 418
+0x00,0x00,0x00,0x88,0x88,0x88,0x88,0xFC,0x8A,0x8A,0x8A,0x8E,0x00,0x00, // 419
+0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x8C,0xFE,0x8A,0x8A,0x8E,0x00,0x00, // 420
+0x00,0x00,0x00,0x7C,0x10,0x10,0x18,0x14,0x12,0x12,0x12,0x12,0x00,0x00, // 421
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x10,0x1C,0x12,0x12,0x12,0x00,0x00, // 422
+0x00,0x0C,0x18,0x42,0x42,0x44,0x48,0x78,0x44,0x44,0x42,0x42,0x00,0x00, // 423
+0x00,0x00,0x00,0x4C,0x58,0x40,0x42,0x44,0x78,0x44,0x42,0x42,0x00,0x00, // 424
+0x00,0x6C,0x10,0x82,0x82,0x82,0x82,0x7E,0x02,0x02,0xC2,0x7C,0x00,0x00, // 425
+0x00,0x00,0x00,0x00,0x6C,0x10,0x82,0x82,0x82,0x82,0x7E,0x02,0xC2,0x7C, // 426
+0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x10,0x10, // 427
+0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x82,0x82,0x82,0xFE,0x10,0x10, // 428
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x24,0x24,0x48,0x00, // 429
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0x00,0x00,0x00,0x00, // 430
+0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x38,0x10,0x10,0x00,0x00, // 431
+0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x38,0x10,0x10,0x7C,0x10,0x00,0x00, // 432
+0x00,0x40,0xA0,0x42,0x06,0x0C,0x18,0x30,0x60,0xD2,0xAD,0x12,0x00,0x00, // 433
+0x00,0x48,0x6C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 434
+0x00,0x12,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 435
+0x00,0x00,0xFB,0x55,0x51,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 436
+0x02,0x06,0x3E,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00, // 437
+0x00,0x00,0x02,0x06,0x3E,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00, // 438
+0x00,0x7E,0xC3,0x99,0x99,0xF3,0xE7,0xE7,0xFF,0xE7,0xE7,0x7E,0x00,0x00, // 439
+0x00,0x6E,0xD8,0xD8,0xD8,0xD8,0xDE,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00, // 440
+0x00,0x00,0x00,0x00,0x6E,0xDB,0xDB,0xDF,0xD8,0xDB,0x6E,0x00,0x00,0x00, // 441
+0x00,0x88,0x88,0xF8,0x88,0x88,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 442
+0x00,0xF8,0x80,0xE0,0x80,0x80,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 443
+0x00,0x78,0x80,0x80,0x80,0x78,0x00,0x3C,0x22,0x3E,0x24,0x22,0x00,0x00, // 444
+0x00,0x80,0x80,0x80,0x80,0xF8,0x00,0x3E,0x20,0x38,0x20,0x20,0x00,0x00, // 445
+0x00,0x88,0xC8,0xA8,0x98,0x88,0x00,0x20,0x20,0x20,0x20,0x3E,0x00,0x00, // 446
+0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x3E,0x08,0x08,0x08,0x08,0x00,0x00, // 447
+0x00,0x00,0x00,0x06,0x0C,0xFE,0x38,0xFE,0x60,0xC0,0x00,0x00,0x00,0x00, // 448
+0x00,0x00,0x06,0x06,0x36,0x66,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00, // 449
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 450
+0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 451
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 452
+0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 453
+0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, // 454
+0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 455
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, // 456
+0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, // 457
+0x00,0x00,0x00,0x00,0x00,0x3F,0x20,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, // 458
+0x00,0x00,0x00,0x00,0x00,0x7C,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, // 459
+0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, // 460
+0x00,0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x78,0x44,0x42,0x42,0x00,0x00, // 461
+0x00,0x00,0x9C,0xA2,0xC2,0x82,0x82,0x82,0x82,0x82,0x82,0x9C,0x00,0x00, // 462
+0x00,0x00,0x00,0x00,0x9C,0xA2,0xC2,0x82,0x82,0x82,0x02,0x1C,0x00,0x00, // 463
+0x10,0x28,0x00,0x3C,0x42,0x42,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00, // 464
+0x00,0x10,0x28,0x44,0x82,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, // 465
+0x10,0x28,0x00,0x3C,0x42,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00, // 466
+0x10,0x28,0x44,0x82,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00, // 467
+0x10,0x28,0x44,0x02,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 468
+0x10,0x28,0x44,0x42,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 469
+0x10,0x28,0x44,0x82,0x02,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,0x00,0x00, // 470
+0x10,0x28,0x44,0x82,0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x22,0x1C,0x00, // 471
+0x10,0x28,0x00,0x3C,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00, // 472
+0x00,0x10,0x28,0x44,0x82,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00, // 473
+0x10,0x28,0x44,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 474
+0x10,0x28,0x44,0x82,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 475
+0x10,0x28,0x82,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 476
+0x10,0x28,0x44,0x82,0x00,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00, // 477
+0x18,0x18,0x00,0x7C,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // 478
+0x18,0x18,0x40,0x40,0x40,0x7C,0x42,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // 479
+0x18,0x18,0x00,0x3C,0x42,0x42,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00, // 480
+0x00,0x00,0x18,0x18,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, // 481
+0x18,0x18,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00, // 482
+0x18,0x18,0x02,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x3E,0x00,0x00,0x00, // 483
+0x18,0x18,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 484
+0x18,0x18,0x00,0x1C,0x22,0x20,0x78,0x20,0x20,0x20,0x20,0x00,0x00,0x00, // 485
+0x00,0x00,0x18,0x18,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00, // 486
+0x18,0x18,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 487
+0x18,0x18,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 488
+0x00,0x00,0x18,0x18,0x00,0xC4,0xEE,0x92,0x92,0x92,0x82,0x00,0x00,0x00, // 489
+0x18,0x18,0x00,0x7C,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 490
+0x00,0x00,0x18,0x18,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00, // 491
+0x18,0x18,0x00,0x3C,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00, // 492
+0x00,0x00,0x18,0x18,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00, // 493
+0x18,0x18,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 494
+0x18,0x18,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,0x00, // 495
+0x7E,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 496
+0x00,0x00,0x00,0x7E,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // 497
+0x3E,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 498
+0x00,0x00,0x00,0x3C,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 499
+0x7E,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 500
+0x00,0x00,0x00,0x7E,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 501
+0x7E,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 502
+0x00,0x00,0x00,0x7E,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // 503
+0x42,0x3C,0x00,0x3C,0x42,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00, // 504
+0x00,0x00,0x42,0x3C,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x42,0x3C,0x00, // 505
+0x42,0x3C,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 506
+0x00,0x00,0x42,0x3C,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 507
+0x42,0x3C,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 508
+0x00,0x00,0x42,0x3C,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // 509
+0x00,0x00,0x3C,0x42,0x40,0x40,0x40,0x4E,0x42,0x46,0x3A,0x20,0x40,0x3E, // 510
+0x00,0x00,0x00,0x3E,0x42,0x42,0x42,0x3E,0x02,0x02,0x7C,0x20,0x40,0x3C, // 511
+0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x20,0x40,0x3E, // 512
+0x00,0x00,0x40,0x40,0x40,0x42,0x44,0x78,0x44,0x42,0x42,0x20,0x40,0x3E, // 513
+0x00,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x42,0x20,0x40,0x3E, // 514
+0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x20,0x40,0x3E, // 515
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x44,0x42,0x42,0x42,0x20,0x40,0x3E, // 516
+0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x40,0x40,0x40,0x40,0x20,0x40,0x3E, // 517
+0x00,0x76,0xDC,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 518
+0x00,0x00,0x76,0xDC,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 519
+0x76,0xDC,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 520
+0x00,0x00,0x76,0xDC,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // 521
+0x00,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x04,0x02,0x7C, // 522
+0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x04,0x02,0x7C, // 523
+0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x04,0x02,0x7C, // 524
+0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x46,0x3A,0x04,0x02,0x7C, // 525
+0x20,0x10,0x8A,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 526
+0x00,0x00,0x20,0x10,0x08,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 527
+0x20,0x10,0x8A,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 528
+0x00,0x00,0x20,0x10,0x08,0x42,0x42,0x42,0x42,0x3E,0x02,0x04,0x78,0x00, // 529
+0x08,0x10,0xA2,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 530
+0x00,0x08,0x10,0x20,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 531
+0x82,0x82,0x00,0x82,0x82,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 532
+0x00,0x00,0x82,0x82,0x00,0x82,0x92,0x92,0xBA,0x6C,0x44,0x00,0x00,0x00, // 533
+0x00,0x00,0x42,0x43,0x46,0x4A,0x7E,0x62,0x42,0xC2,0x42,0x00,0x00,0x00, // 534
+0x00,0x00,0x40,0x42,0x44,0x5C,0x72,0x62,0x42,0xC2,0x42,0x00,0x00,0x00, // 535
+0x00,0x00,0xFE,0x12,0x14,0x18,0x10,0x30,0x50,0x90,0x10,0x00,0x00,0x00, // 536
+0x00,0x00,0x10,0x12,0x14,0x7C,0x10,0x30,0x50,0x90,0x0C,0x00,0x00,0x00, // 537
+0x30,0x18,0x18,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 538
+0x00,0x30,0x18,0x18,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 539
+0x30,0x18,0x5A,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 540
+0x00,0x00,0x30,0x18,0x18,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00, // 541
+0x18,0x18,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 542
+0x00,0x00,0x18,0x18,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // 543
+0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7E,0x0C,0x06,0x7C, // 544
+0x00,0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x0C,0x06,0x7C, // 545
+0x00,0x00,0x00,0x00,0x00,0x82,0x42,0x24,0x18,0x28,0x44,0x44,0x38,0x00, // 546
+0x00,0x00,0x7E,0x04,0x08,0x10,0x20,0x20,0x20,0x1C,0x02,0x02,0x0C,0x00, // 547
+0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0x02,0x02,0x02, // 548
+0x00,0x00,0x3C,0x42,0x02,0x02,0x3E,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 549
+0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x1C,0x00,0x00,0x00, // 550
+0x00,0x00,0x3C,0x42,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 551
+0x00,0x00,0x00,0x00,0x82,0x82,0x82,0x44,0x44,0x28,0x10,0x00,0x00,0x00, // 552
+0x00,0x00,0x7E,0x04,0x08,0x10,0x0E,0x10,0x20,0x1E,0x02,0x02,0x0C,0x00, // 553
+0x00,0x00,0x00,0x00,0x00,0x78,0x84,0x84,0x84,0x84,0xF8,0x80,0x80,0x00, // 554
+0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x80,0x80,0x78,0x04,0xF8,0x00,0x00, // 555
+0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 556
+0x00,0x00,0x00,0x00,0x00,0x82,0x82,0x44,0x38,0x44,0x82,0x82,0x00,0x00, // 557
+0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x10,0x00, // 558
+0x00,0x00,0x00,0x00,0x00,0x6C,0x82,0x92,0x92,0x92,0x6C,0x00,0x00,0x00, // 559
+0x00,0x00,0x10,0x28,0x44,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,0x00,0x00, // 560
+0x00,0x00,0xFE,0x82,0x82,0x00,0x7C,0x00,0x82,0x82,0xFE,0x00,0x00,0x00, // 561
+0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 562
+0x00,0x00,0x92,0x92,0x92,0x92,0x92,0x7C,0x10,0x10,0x10,0x00,0x00,0x00, // 563
+0x02,0x04,0x08,0x22,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 564
+0x00,0x08,0x10,0x20,0x00,0x76,0x88,0x88,0x88,0x88,0x76,0x00,0x00,0x00, // 565
+0x08,0x10,0x20,0x1C,0x20,0x40,0x7C,0x40,0x40,0x20,0x1C,0x00,0x00,0x00, // 566
+0x00,0x04,0x08,0x10,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0x02,0x02,0x02, // 567
+0x00,0x08,0x10,0x20,0x00,0x20,0x20,0x20,0x20,0x20,0x1C,0x00,0x00,0x00, // 568
+0x00,0x04,0x08,0x10,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 569
+0x00,0x00,0x04,0x08,0x10,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 570
+0x00,0x00,0x00,0x00,0x00,0x6C,0x82,0x92,0x92,0x92,0x6C,0x00,0x00,0x00, // 571
+0x00,0x20,0x58,0xA4,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 572
+0x00,0x20,0x5E,0x80,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 573
+0x20,0x40,0xA1,0x21,0x21,0x21,0x3F,0x21,0x21,0x21,0x21,0x00,0x00,0x00, // 574
+0x20,0x40,0x9C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 575
+0x20,0x40,0xBC,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 576
+0x20,0x40,0x81,0x41,0x41,0x22,0x1C,0x08,0x08,0x08,0x08,0x00,0x00,0x00, // 577
+0x00,0x20,0x5C,0xA2,0x22,0x22,0x22,0x14,0x14,0x14,0x77,0x00,0x00,0x00, // 578
+0x00,0x00,0x00,0x88,0x00,0x20,0x20,0x20,0x20,0x20,0x1C,0x00,0x00,0x00, // 579
+0x00,0x00,0x00,0x42,0x00,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 580
+0x08,0x10,0x20,0xA8,0x00,0x20,0x20,0x20,0x20,0x20,0x1C,0x00,0x00,0x00, // 581
+0x00,0x04,0x08,0x52,0x00,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 582
+0x00,0x00,0x10,0x28,0x44,0x44,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 583
+0x00,0x00,0x00,0x7E,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, // 584
+0x00,0x7E,0x00,0x18,0x24,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 585
+0x18,0x18,0x00,0x3C,0x42,0x40,0x40,0x4E,0x42,0x46,0x3A,0x00,0x00,0x00, // 586
+0x00,0x1E,0x31,0x60,0x60,0xFE,0x60,0xFE,0x60,0x60,0x31,0x1E,0x00,0x00, // 587
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // 588
+0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 589
+0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x00,0x00,0x00, // 590
+0x00,0x00,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 591
+0x00,0x00,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 592
+0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 593
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 594
+0x00,0x00,0x3C,0x42,0x42,0x40,0x40,0x40,0x42,0x42,0x3C,0x00,0x00,0x00, // 595
+0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 596
+0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00, // 597
+0x00,0x00,0x00,0x00,0x00,0x3C,0x02,0x3E,0x42,0x42,0x3E,0x00,0x00,0x00, // 598
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // 599
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 600
+0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x00, // 601
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,0x00,0x00, // 602
+0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x00, // 603
+0x00,0x00,0x42,0x42,0x00,0x3C,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00,0x00, // 604
+0x44,0x44,0x00,0x7E,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 605
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x38,0x04,0x42,0x3C,0x00,0x00,0x00, // 606
+0x00,0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 607
+0x00,0x00,0x22,0x22,0x00,0x18,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 608
+0x00,0x00,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x22,0x1C,0x00, // 609
+0x22,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 610
+0x00,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,0x00,0x00, // 611
+0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x04,0x42,0x42,0x3C,0x00,0x00,0x00, // 612
+0x00,0x00,0x00,0x00,0x3C,0x42,0x7C,0x42,0x42,0x7C,0x40,0x40,0x40,0x00, // 613
+0x00,0x00,0x00,0x00,0x00,0x46,0x48,0x70,0x48,0x44,0x42,0x00,0x00,0x00, // 614
+0x00,0x00,0x00,0x00,0x22,0x22,0x22,0x22,0x3C,0x20,0x20,0x60,0x00,0x00, // 615
+0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 616
+0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,0x00,0x00, // 617
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x7C,0x00,0x00,0x00, // 618
+0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7E,0x00,0x00,0x00, // 619
+0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x40,0x7E,0x00,0x00,0x00, // 620
+0x00,0x00,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // 621
+0x00,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 622
+0x00,0x00,0x42,0x42,0x44,0x48,0x70,0x48,0x44,0x42,0x42,0x00,0x00,0x00, // 623
+0x00,0x00,0x82,0xC6,0xAA,0x92,0x92,0x82,0x82,0x82,0x82,0x00,0x00,0x00, // 624
+0x00,0x00,0x42,0x62,0x52,0x52,0x4A,0x4A,0x46,0x42,0x42,0x00,0x00,0x00, // 625
+0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,0x00, // 626
+0x00,0x00,0x7C,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0x00,0x00,0x00, // 627
+0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 628
+0x00,0x00,0x82,0x82,0x82,0x44,0x38,0x10,0x10,0x10,0x10,0x00,0x00,0x00, // 629
+0x00,0x00,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x00,0x00,0x00, // 630
+0x22,0x22,0x00,0x1C,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,0x00, // 631
+0x00,0x66,0x66,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00,0x00,0x00, // 632
+};
+
diff --git a/setedit/fromdos.pl b/setedit/fromdos.pl
new file mode 100644
index 0000000..993a87d
--- /dev/null
+++ b/setedit/fromdos.pl
@@ -0,0 +1,62 @@
+#!/usr/bin/perl
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+open(FI,"makes/lista") || die "Can't open lista";
+
+while ($a=<FI>)
+ {
+ chop($a);
+
+ if (substr($a,0,1) eq "-")
+ {
+ $bin=1;
+ $exe=0;
+ $a=substr($a,1);
+ }
+ else
+ {
+ $bin=0;
+ if (substr($a,0,1) eq "+")
+ {
+ $exe=1;
+ $a=substr($a,1);
+ }
+ else
+ {
+ $exe=0;
+ if (substr($a,0,1) eq "*")
+ {
+ $a=substr($a,1);
+ }
+ }
+ }
+
+ if (!$bin and length($a))
+ {
+ &ToUNIX($a) || die "Failed to convert $a";
+ }
+ if ($exe)
+ {
+ system("chmod +x $a");
+ }
+ }
+system('cp makes/linux.env makes/rhide.env');
+
+sub ToUNIX
+{
+ local $/;
+ my $b;
+ my $a=$_[0];
+
+ print "Processing $a\n";
+ open(FIL,$a) || return 0;
+ $b=<FIL>;
+ $b =~ s/\r\n/\n/g;
+ close(FIL);
+
+ open(FIL,">$a") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
diff --git a/setedit/fromunix.pl b/setedit/fromunix.pl
new file mode 100644
index 0000000..205ab13
--- /dev/null
+++ b/setedit/fromunix.pl
@@ -0,0 +1,48 @@
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+open(FI,"makes/lista") || die "Can't open lista";
+
+while ($a=<FI>)
+ {
+ chop($a);
+
+ $b=substr($a,0,1);
+ if ($b eq "*")
+ {
+ $conv=1;
+ $a=substr($a,1);
+ }
+ else
+ {
+ $conv=0;
+ if (($b eq "-") or ($b eq "+"))
+ {
+ $a=substr($a,1);
+ }
+ }
+
+ if ($conv and length($a))
+ {
+ &ToDOS($a) || die "Failed to convert $a";
+ }
+ }
+system('cp makes/djgppenv.env makes/rhide.env');
+
+
+sub ToDOS
+{
+ local $/;
+ my $b;
+ my $a=$_[0];
+
+ print "Processing $a\n";
+ open(FIL,$a) || return 0;
+ $b=<FIL>;
+ $b =~ s/[!\r]\n/\r\n/g;
+ close(FIL);
+
+ open(FIL,">$a") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
diff --git a/setedit/gettext/.cvsignore b/setedit/gettext/.cvsignore
new file mode 100644
index 0000000..fc29fb3
--- /dev/null
+++ b/setedit/gettext/.cvsignore
@@ -0,0 +1,4 @@
+libintl.h
+config.h
+Makefile
+
diff --git a/setedit/gettext/Makefile b/setedit/gettext/Makefile
new file mode 100644
index 0000000..43cdfaa
--- /dev/null
+++ b/setedit/gettext/Makefile
@@ -0,0 +1,77 @@
+# Makefile for directory with message catalog handling in GNU NLS Utilities.
+# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+# Simplified by Salvador E. Tropea
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+SHELL = /bin/sh
+
+srcdir = .
+top_srcdir = .
+top_builddir = ..
+VPATH = .
+
+libdir = /usr/lib
+datadir = /usr/share
+localedir = $(datadir)/locale
+aliaspath = $(localedir)
+lo = o
+
+AR = ar
+CC = gcc
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
+-DLIBDIR=\"$(libdir)\" -DHAVE_CONFIG_H=1
+CPPFLAGS =
+CFLAGS = -march=i686 -mtune=generic -O2 -pipe
+LDFLAGS =
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+COMHDRS = gettext.h gettextP.h hash-string.h
+HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
+COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
+localcharset.c
+SOURCES = $(COMSRCS) intl-compat.c
+OBJECTS = bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
+plural.$lo localcharset.$lo intl-compat.$lo
+
+.SUFFIXES:
+.SUFFIXES: .c .y .o
+.c.o:
+ $(COMPILE) $<
+
+.y.c:
+ $(YACC) $(YFLAGS) --output $@ $<
+ rm -f $*.h
+
+INCLUDES = -I.. -I. -I$(top_srcdir)/intl
+
+all: libintl.a libintl.h
+
+libintl.a libgnuintl.a: $(OBJECTS)
+ rm -f $@
+ $(AR) cru $@ $(OBJECTS)
+
+libintl.h: libgnuintl.h
+ cp $(srcdir)/libgnuintl.h libintl.h
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/setedit/gettext/Makefile.in b/setedit/gettext/Makefile.in
new file mode 100644
index 0000000..0a56106
--- /dev/null
+++ b/setedit/gettext/Makefile.in
@@ -0,0 +1,77 @@
+# Makefile for directory with message catalog handling in GNU NLS Utilities.
+# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+# Simplified by Salvador E. Tropea
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+SHELL = /bin/sh
+
+srcdir = .
+top_srcdir = .
+top_builddir = ..
+VPATH = .
+
+libdir = @libdir@
+datadir = @datadir@
+localedir = $(datadir)/locale
+aliaspath = $(localedir)
+lo = o
+
+AR = @AR@
+CC = @CC@
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
+-DLIBDIR=\"$(libdir)\" -DHAVE_CONFIG_H=1
+CPPFLAGS =
+CFLAGS = @CFLAGS@
+LDFLAGS =
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+COMHDRS = gettext.h gettextP.h hash-string.h
+HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
+COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
+localcharset.c
+SOURCES = $(COMSRCS) intl-compat.c
+OBJECTS = bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
+plural.$lo localcharset.$lo intl-compat.$lo
+
+.SUFFIXES:
+.SUFFIXES: .c .y .o
+.c.o:
+ $(COMPILE) $<
+
+.y.c:
+ $(YACC) $(YFLAGS) --output $@ $<
+ rm -f $*.h
+
+INCLUDES = -I.. -I. -I$(top_srcdir)/intl
+
+all: libintl.a libintl.h
+
+libintl.a libgnuintl.a: $(OBJECTS)
+ rm -f $@
+ $(AR) cru $@ $(OBJECTS)
+
+libintl.h: libgnuintl.h
+ cp $(srcdir)/libgnuintl.h libintl.h
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/setedit/gettext/bindtextdom.c b/setedit/gettext/bindtextdom.c
new file mode 100644
index 0000000..7e5a74a
--- /dev/null
+++ b/setedit/gettext/bindtextdom.c
@@ -0,0 +1,368 @@
+/* Implementation of the bindtextdomain(3) function
+ Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "gettextP.h"
+
+#ifdef _LIBC
+/* We have to handle multi-threaded applications. */
+# include <bits/libc-lock.h>
+#else
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_dirname _nl_default_dirname__
+# define _nl_domain_bindings _nl_domain_bindings__
+#endif
+
+/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
+#ifndef offsetof
+# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Contains the default location of the message catalogs. */
+extern const char _nl_default_dirname[];
+
+/* List with bindings of specific domains. */
+extern struct binding *_nl_domain_bindings;
+
+/* Lock variable to protect the global data in the gettext implementation. */
+__libc_rwlock_define (extern, _nl_state_lock)
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define BINDTEXTDOMAIN __bindtextdomain
+# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
+# ifndef strdup
+# define strdup(str) __strdup (str)
+# endif
+#else
+# define BINDTEXTDOMAIN bindtextdomain__
+# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__
+#endif
+
+/* Prototypes for local functions. */
+static void set_binding_values PARAMS ((const char *domainname,
+ const char **dirnamep,
+ const char **codesetp));
+
+/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
+ to be used for the DOMAINNAME message catalog.
+ If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
+ modified, only the current value is returned.
+ If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
+ modified nor returned. */
+static void
+set_binding_values (domainname, dirnamep, codesetp)
+ const char *domainname;
+ const char **dirnamep;
+ const char **codesetp;
+{
+ struct binding *binding;
+ int modified;
+
+ /* Some sanity checks. */
+ if (domainname == NULL || domainname[0] == '\0')
+ {
+ if (dirnamep)
+ *dirnamep = NULL;
+ if (codesetp)
+ *codesetp = NULL;
+ return;
+ }
+
+ __libc_rwlock_wrlock (_nl_state_lock);
+
+ modified = 0;
+
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (binding != NULL)
+ {
+ if (dirnamep)
+ {
+ const char *dirname = *dirnamep;
+
+ if (dirname == NULL)
+ /* The current binding has be to returned. */
+ *dirnamep = binding->dirname;
+ else
+ {
+ /* The domain is already bound. If the new value and the old
+ one are equal we simply do nothing. Otherwise replace the
+ old binding. */
+ char *result = binding->dirname;
+ if (strcmp (dirname, result) != 0)
+ {
+ if (strcmp (dirname, _nl_default_dirname) == 0)
+ result = (char *) _nl_default_dirname;
+ else
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (dirname);
+#else
+ size_t len = strlen (dirname) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result != NULL, 1))
+ memcpy (result, dirname, len);
+#endif
+ }
+
+ if (__builtin_expect (result != NULL, 1))
+ {
+ if (binding->dirname != _nl_default_dirname)
+ free (binding->dirname);
+
+ binding->dirname = result;
+ modified = 1;
+ }
+ }
+ *dirnamep = result;
+ }
+ }
+
+ if (codesetp)
+ {
+ const char *codeset = *codesetp;
+
+ if (codeset == NULL)
+ /* The current binding has be to returned. */
+ *codesetp = binding->codeset;
+ else
+ {
+ /* The domain is already bound. If the new value and the old
+ one are equal we simply do nothing. Otherwise replace the
+ old binding. */
+ char *result = binding->codeset;
+ if (result == NULL || strcmp (codeset, result) != 0)
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (codeset);
+#else
+ size_t len = strlen (codeset) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result != NULL, 1))
+ memcpy (result, codeset, len);
+#endif
+
+ if (__builtin_expect (result != NULL, 1))
+ {
+ if (binding->codeset != NULL)
+ free (binding->codeset);
+
+ binding->codeset = result;
+ binding->codeset_cntr++;
+ modified = 1;
+ }
+ }
+ *codesetp = result;
+ }
+ }
+ }
+ else if ((dirnamep == NULL || *dirnamep == NULL)
+ && (codesetp == NULL || *codesetp == NULL))
+ {
+ /* Simply return the default values. */
+ if (dirnamep)
+ *dirnamep = _nl_default_dirname;
+ if (codesetp)
+ *codesetp = NULL;
+ }
+ else
+ {
+ /* We have to create a new binding. */
+ size_t len = strlen (domainname) + 1;
+ struct binding *new_binding =
+ (struct binding *) malloc (offsetof (struct binding, domainname) + len);
+
+ if (__builtin_expect (new_binding == NULL, 0))
+ goto failed;
+
+ memcpy (new_binding->domainname, domainname, len);
+
+ if (dirnamep)
+ {
+ const char *dirname = *dirnamep;
+
+ if (dirname == NULL)
+ /* The default value. */
+ dirname = _nl_default_dirname;
+ else
+ {
+ if (strcmp (dirname, _nl_default_dirname) == 0)
+ dirname = _nl_default_dirname;
+ else
+ {
+ char *result;
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (dirname);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_dirname;
+#else
+ size_t len = strlen (dirname) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_dirname;
+ memcpy (result, dirname, len);
+#endif
+ dirname = result;
+ }
+ }
+ *dirnamep = dirname;
+ new_binding->dirname = (char *) dirname;
+ }
+ else
+ /* The default value. */
+ new_binding->dirname = (char *) _nl_default_dirname;
+
+ new_binding->codeset_cntr = 0;
+
+ if (codesetp)
+ {
+ const char *codeset = *codesetp;
+
+ if (codeset != NULL)
+ {
+ char *result;
+
+#if defined _LIBC || defined HAVE_STRDUP
+ result = strdup (codeset);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_codeset;
+#else
+ size_t len = strlen (codeset) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_codeset;
+ memcpy (result, codeset, len);
+#endif
+ codeset = result;
+ new_binding->codeset_cntr++;
+ }
+ *codesetp = codeset;
+ new_binding->codeset = (char *) codeset;
+ }
+ else
+ new_binding->codeset = NULL;
+
+ /* Now enqueue it. */
+ if (_nl_domain_bindings == NULL
+ || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
+ {
+ new_binding->next = _nl_domain_bindings;
+ _nl_domain_bindings = new_binding;
+ }
+ else
+ {
+ binding = _nl_domain_bindings;
+ while (binding->next != NULL
+ && strcmp (domainname, binding->next->domainname) > 0)
+ binding = binding->next;
+
+ new_binding->next = binding->next;
+ binding->next = new_binding;
+ }
+
+ modified = 1;
+
+ /* Here we deal with memory allocation failures. */
+ if (0)
+ {
+ failed_codeset:
+ if (new_binding->dirname != _nl_default_dirname)
+ free (new_binding->dirname);
+ failed_dirname:
+ free (new_binding);
+ failed:
+ if (dirnamep)
+ *dirnamep = NULL;
+ if (codesetp)
+ *codesetp = NULL;
+ }
+ }
+
+ /* If we modified any binding, we flush the caches. */
+ if (modified)
+ ++_nl_msg_cat_cntr;
+
+ __libc_rwlock_unlock (_nl_state_lock);
+}
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+char *
+BINDTEXTDOMAIN (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ set_binding_values (domainname, &dirname, NULL);
+ return (char *) dirname;
+}
+
+/* Specify the character encoding in which the messages from the
+ DOMAINNAME message catalog will be returned. */
+char *
+BIND_TEXTDOMAIN_CODESET (domainname, codeset)
+ const char *domainname;
+ const char *codeset;
+{
+ set_binding_values (domainname, NULL, &codeset);
+ return (char *) codeset;
+}
+
+#ifdef _LIBC
+/* Aliases for function names in GNU C Library. */
+weak_alias (__bindtextdomain, bindtextdomain);
+weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
+#endif
diff --git a/setedit/gettext/config.h b/setedit/gettext/config.h
new file mode 100644
index 0000000..ce227e5
--- /dev/null
+++ b/setedit/gettext/config.h
@@ -0,0 +1,311 @@
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* Special definitions, processed by autoheader.
+ Copyright (C) 1995-1998, 2001 Free Software Foundation.
+ Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
+
+/* Default value for alignment of strings in .mo file. */
+#define DEFAULT_OUTPUT_ALIGNMENT 1
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+
+/* Define if using alloca.c. */
+/* #undef C_ALLOCA */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define if you have alloca, as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define if you don't have vprintf but do have _doprnt. */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have a working `mmap' system call. */
+/* #undef HAVE_MMAP */
+
+/* Define if you have the vprintf function. */
+#define HAVE_VPRINTF 1
+
+/* Define as __inline if that's what the C compiler calls it. */
+/* #undef inline */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef off_t */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+/* #undef STACK_DIRECTION */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you have the __argz_count function. */
+/* #undef HAVE___ARGZ_COUNT */
+
+/* Define if you have the __argz_next function. */
+/* #undef HAVE___ARGZ_NEXT */
+
+/* Define if you have the __argz_stringify function. */
+/* #undef HAVE___ARGZ_STRINGIFY */
+
+/* Define if you have the dcgettext function. */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define if you have the feof_unlocked function. */
+/* #undef HAVE_FEOF_UNLOCKED */
+
+/* Define if you have the fgets_unlocked function. */
+/* #undef HAVE_FGETS_UNLOCKED */
+
+/* Define if you have the getcwd function. */
+#define HAVE_GETCWD 1
+
+/* Define if you have the getdelim function. */
+/* #undef HAVE_GETDELIM */
+
+/* Define if you have the getegid function. */
+#define HAVE_GETEGID 1
+
+/* Define if you have the geteuid function. */
+#define HAVE_GETEUID 1
+
+/* Define if you have the getgid function. */
+#define HAVE_GETGID 1
+
+/* Define if you have the getpagesize function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if you have the getuid function. */
+#define HAVE_GETUID 1
+
+/* Define if you have the isascii function. */
+#define HAVE_ISASCII 1
+
+/* Define if you have the iswcntrl function. */
+/* #undef HAVE_ISWCNTRL */
+
+/* Define if you have the iswprint function. */
+/* #undef HAVE_ISWPRINT */
+
+/* Define if you have the mblen function. */
+#define HAVE_MBLEN 1
+
+/* Define if you have the mbsinit function. */
+/* #undef HAVE_MBSINIT */
+
+/* Define if you have the memcpy function. */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memmove function. */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the mempcpy function. */
+/* #undef HAVE_MEMPCPY */
+
+/* Define if you have the memset function. */
+#define HAVE_MEMSET 1
+
+/* Define if you have the munmap function. */
+/* #undef HAVE_MUNMAP */
+
+/* Define if you have the putenv function. */
+#define HAVE_PUTENV 1
+
+/* Define if you have the setenv function. */
+#define HAVE_SETENV 1
+
+/* Define if you have the setlocale function. */
+#define HAVE_SETLOCALE 1
+
+/* Define if you have the stpcpy function. */
+#define HAVE_STPCPY 1
+
+/* Define if you have the stpncpy function. */
+/* #undef HAVE_STPNCPY */
+
+/* Define if you have the strcasecmp function. */
+#define HAVE_STRCASECMP 1
+
+/* Define if you have the strchr function. */
+#define HAVE_STRCHR 1
+
+/* Define if you have the strcspn function. */
+#define HAVE_STRCSPN 1
+
+/* Define if you have the strdup function. */
+#define HAVE_STRDUP 1
+
+/* Define if you have the strerror function. */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strncasecmp function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define if you have the strstr function. */
+#define HAVE_STRSTR 1
+
+/* Define if you have the strtoul function. */
+#define HAVE_STRTOUL 1
+
+/* Define if you have the tsearch function. */
+/* #undef HAVE_TSEARCH */
+
+/* Define if you have the uname function. */
+#define HAVE_UNAME 1
+
+/* Define if you have the vasprintf function. */
+/* #undef HAVE_VASPRINTF */
+
+/* Define if you have the wcwidth function. */
+/* #undef HAVE_WCWIDTH */
+
+/* Define if you have the <argz.h> header file. */
+/* #undef HAVE_ARGZ_H */
+
+/* Define if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define if you have the <nl_types.h> header file. */
+/* #undef HAVE_NL_TYPES_H */
+
+/* Define if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the <values.h> header file. */
+#define HAVE_VALUES_H 1
+
+/* Define if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define if you have the <wctype.h> header file. */
+#define HAVE_WCTYPE_H 1
+
+/* Name of package */
+#define PACKAGE "gettext"
+
+/* Version number of package */
+#define VERSION "0.10.39"
+
+/* Make sure we see all GNU extensions. */
+#define _GNU_SOURCE 1
+
+/* Define to empty if the C compiler doesn't support this keyword. */
+/* #undef signed */
+
+/* Define if backslash-a works in C strings. */
+#define HAVE_C_BACKSLASH_A 1
+
+/* Define if you have the unsigned long long type. */
+#define HAVE_UNSIGNED_LONG_LONG 1
+
+/* Define if system has ptrdiff_t type */
+#define HAVE_PTRDIFF_T 1
+
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to unsigned long or unsigned long long
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long long
+
+/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
+/* #undef HAVE_MBRTOWC */
+
+/* Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise. */
+#define HAVE_DECL_WCWIDTH 0
+
+/* Define to a type if <wchar.h> does not define. */
+/* #undef mbstate_t */
+
+/* Define if you have the parse_printf_format() function. */
+/* #undef HAVE_PARSE_PRINTF_FORMAT */
+
+/* Define as const if the declaration of setlocale() needs const. */
+#define SETLOCALE_CONST const
+
+/* Define if you have the iconv() function. */
+/* #define HAVE_ICONV 1 */
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST const
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+/* #undef HAVE_LANGINFO_CODESET */
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to 1 if translation of program messages to the user's native language
+ is requested. */
+#define ENABLE_NLS 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+
+/* We don't test for the basename function but still want to use the
+ version in the libc when compiling for a system using glibc. */
+#ifdef __GNU_LIBRARY__
+# define HAVE_BASENAME 1
+#endif
+
+
+/* A file name cannot consist of any character possible. INVALID_PATH_CHAR
+ contains the characters not allowed. */
+#ifndef MSDOS
+# define INVALID_PATH_CHAR "\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 \177/"
+#else
+/* Something like this for MSDOG. */
+# define INVALID_PATH_CHAR "\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 \177\\:."
+#endif
+
+/* This is the page width for the message_print function. It should
+ not be set to more than 79 characters (Emacs users will appreciate
+ it). It is used to wrap the msgid and msgstr strings, and also to
+ wrap the file position (#:) comments. */
+#define PAGE_WIDTH 79
diff --git a/setedit/gettext/dcgettext.c b/setedit/gettext/dcgettext.c
new file mode 100644
index 0000000..469e78d
--- /dev/null
+++ b/setedit/gettext/dcgettext.c
@@ -0,0 +1,57 @@
+/* Implementation of the dcgettext(3) function.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCGETTEXT __dcgettext
+# define DCIGETTEXT __dcigettext
+#else
+# define DCGETTEXT dcgettext__
+# define DCIGETTEXT dcigettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCGETTEXT (domainname, msgid, category)
+ const char *domainname;
+ const char *msgid;
+ int category;
+{
+ return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dcgettext, dcgettext);
+#endif
diff --git a/setedit/gettext/dcigettext.c b/setedit/gettext/dcigettext.c
new file mode 100644
index 0000000..b7627bf
--- /dev/null
+++ b/setedit/gettext/dcigettext.c
@@ -0,0 +1,1258 @@
+/* Implementation of the internal dcigettext function.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include <string.h>
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include <locale.h>
+
+#if defined HAVE_SYS_PARAM_H || defined _LIBC
+# include <sys/param.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "hash-string.h"
+
+/* Thread safetyness. */
+#ifdef _LIBC
+# include <bits/libc-lock.h>
+#else
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_lock_define_initialized(CLASS, NAME)
+# define __libc_lock_lock(NAME)
+# define __libc_lock_unlock(NAME)
+# define __libc_rwlock_define_initialized(CLASS, NAME)
+# define __libc_rwlock_rdlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* Alignment of types. */
+#if defined __GNUC__ && __GNUC__ >= 2
+# define alignof(TYPE) __alignof__ (TYPE)
+#else
+# define alignof(TYPE) \
+ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_default_domain _nl_default_default_domain__
+# define _nl_current_default_domain _nl_current_default_domain__
+# define _nl_default_dirname _nl_default_dirname__
+# define _nl_domain_bindings _nl_domain_bindings__
+#endif
+
+/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
+#ifndef offsetof
+# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define getcwd __getcwd
+# ifndef stpcpy
+# define stpcpy __stpcpy
+# endif
+# define tfind __tfind
+#else
+# if !defined HAVE_GETCWD
+char *getwd ();
+# define getcwd(buf, max) getwd (buf)
+# else
+char *getcwd ();
+# endif
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+# ifndef HAVE_MEMPCPY
+static void *mempcpy PARAMS ((void *dest, const void *src, size_t n));
+# endif
+#endif
+
+/* Amount to increase buffer size by in each try. */
+#define PATH_INCR 32
+
+/* The following is from pathmax.h. */
+/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+ PATH_MAX but might cause redefinition warnings when sys/param.h is
+ later included (as on MORE/BSD 4.3). */
+#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__)
+# include <limits.h>
+#endif
+
+#ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 255
+#endif
+
+#if !defined PATH_MAX && defined _PC_PATH_MAX
+# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+#endif
+
+/* Don't include sys/param.h if it already has been. */
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
+ it may be concatenated to a directory pathname.
+ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+ && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+# define IS_PATH_WITH_DIR(P) \
+ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+#endif
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+ ``Directs `setlocale()' to query `category' and return the current
+ setting of `local'.''
+ However it does not specify the exact format. Neither do SUSV2 and
+ ISO C 99. So we can use this feature only on selected systems (e.g.
+ those using GNU C Library). */
+#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
+# define HAVE_LOCALE_NULL
+#endif
+
+/* This is the type used for the search tree where known translations
+ are stored. */
+struct known_translation_t
+{
+ /* Domain in which to search. */
+ char *domainname;
+
+ /* The category. */
+ int category;
+
+ /* State of the catalog counter at the point the string was found. */
+ int counter;
+
+ /* Catalog where the string was found. */
+ struct loaded_l10nfile *domain;
+
+ /* And finally the translation. */
+ const char *translation;
+ size_t translation_length;
+
+ /* Pointer to the string in question. */
+ char msgid[ZERO];
+};
+
+/* Root of the search tree with known translations. We can use this
+ only if the system provides the `tsearch' function family. */
+#if defined HAVE_TSEARCH || defined _LIBC
+# include <search.h>
+
+static void *root;
+
+# ifdef _LIBC
+# define tsearch __tsearch
+# endif
+
+/* Function to compare two entries in the table of known translations. */
+static int transcmp PARAMS ((const void *p1, const void *p2));
+static int
+transcmp (p1, p2)
+ const void *p1;
+ const void *p2;
+{
+ const struct known_translation_t *s1;
+ const struct known_translation_t *s2;
+ int result;
+
+ s1 = (const struct known_translation_t *) p1;
+ s2 = (const struct known_translation_t *) p2;
+
+ result = strcmp (s1->msgid, s2->msgid);
+ if (result == 0)
+ {
+ result = strcmp (s1->domainname, s2->domainname);
+ if (result == 0)
+ /* We compare the category last (though this is the cheapest
+ operation) since it is hopefully always the same (namely
+ LC_MESSAGES). */
+ result = s1->category - s2->category;
+ }
+
+ return result;
+}
+#endif
+
+/* Name of the default domain used for gettext(3) prior any call to
+ textdomain(3). The default value for this is "messages". */
+const char _nl_default_default_domain[] = "messages";
+
+/* Value used as the default domain for gettext(3). */
+const char *_nl_current_default_domain = _nl_default_default_domain;
+
+/* Contains the default location of the message catalogs. */
+const char _nl_default_dirname[] = LOCALEDIR;
+
+/* List with bindings of specific domains created by bindtextdomain()
+ calls. */
+struct binding *_nl_domain_bindings;
+
+/* Prototypes for local functions. */
+static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain,
+ unsigned long int n,
+ const char *translation,
+ size_t translation_len))
+ internal_function;
+static unsigned long int plural_eval PARAMS ((struct expression *pexp,
+ unsigned long int n))
+ internal_function;
+static const char *category_to_name PARAMS ((int category)) internal_function;
+static const char *guess_category_value PARAMS ((int category,
+ const char *categoryname))
+ internal_function;
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done. */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+ void *address;
+ struct block_list *next;
+};
+# define ADD_BLOCK(list, addr) \
+ do { \
+ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+ /* If we cannot get a free block we cannot add the new element to \
+ the list. */ \
+ if (newp != NULL) { \
+ newp->address = (addr); \
+ newp->next = (list); \
+ (list) = newp; \
+ } \
+ } while (0)
+# define FREE_BLOCKS(list) \
+ do { \
+ while (list != NULL) { \
+ struct block_list *old = list; \
+ list = list->next; \
+ free (old); \
+ } \
+ } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+#ifdef _LIBC
+/* List of blocks allocated for translations. */
+typedef struct transmem_list
+{
+ struct transmem_list *next;
+ char data[ZERO];
+} transmem_block_t;
+static struct transmem_list *transmem_list;
+#else
+typedef unsigned char transmem_block_t;
+#endif
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCIGETTEXT __dcigettext
+#else
+# define DCIGETTEXT dcigettext__
+#endif
+
+/* Lock variable to protect the global data in the gettext implementation. */
+#ifdef _LIBC
+__libc_rwlock_define_initialized (, _nl_state_lock)
+#endif
+
+/* Checking whether the binaries runs SUID must be done and glibc provides
+ easier methods therefore we make a difference here. */
+#ifdef _LIBC
+# define ENABLE_SECURE __libc_enable_secure
+# define DETERMINE_SECURE
+#else
+# ifndef HAVE_GETUID
+# define getuid() 0
+# endif
+# ifndef HAVE_GETGID
+# define getgid() 0
+# endif
+# ifndef HAVE_GETEUID
+# define geteuid() getuid()
+# endif
+# ifndef HAVE_GETEGID
+# define getegid() getgid()
+# endif
+static int enable_secure;
+# define ENABLE_SECURE (enable_secure == 1)
+# define DETERMINE_SECURE \
+ if (enable_secure == 0) \
+ { \
+ if (getuid () != geteuid () || getgid () != getegid ()) \
+ enable_secure = 1; \
+ else \
+ enable_secure = -1; \
+ }
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ CATEGORY locale and, if PLURAL is nonzero, search over string
+ depending on the plural form determined by N. */
+char *
+DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ int plural;
+ unsigned long int n;
+ int category;
+{
+#ifndef HAVE_ALLOCA
+ struct block_list *block_list = NULL;
+#endif
+ struct loaded_l10nfile *domain;
+ struct binding *binding;
+ const char *categoryname;
+ const char *categoryvalue;
+ char *dirname, *xdomainname;
+ char *single_locale;
+ char *retval;
+ size_t retlen;
+ int saved_errno;
+#if defined HAVE_TSEARCH || defined _LIBC
+ struct known_translation_t *search;
+ struct known_translation_t **foundp = NULL;
+ size_t msgid_len;
+#endif
+ size_t domainname_len;
+
+ /* If no real MSGID is given return NULL. */
+ if (msgid1 == NULL)
+ return NULL;
+
+ __libc_rwlock_rdlock (_nl_state_lock);
+
+ /* If DOMAINNAME is NULL, we are interested in the default domain. If
+ CATEGORY is not LC_MESSAGES this might not make much sense but the
+ definition left this undefined. */
+ if (domainname == NULL)
+ domainname = _nl_current_default_domain;
+
+#if defined HAVE_TSEARCH || defined _LIBC
+ msgid_len = strlen (msgid1) + 1;
+
+ /* Try to find the translation among those which we found at
+ some time. */
+ search = (struct known_translation_t *)
+ alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
+ memcpy (search->msgid, msgid1, msgid_len);
+ search->domainname = (char *) domainname;
+ search->category = category;
+
+ foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
+ if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
+ {
+ /* Now deal with plural. */
+ if (plural)
+ retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation,
+ (*foundp)->translation_length);
+ else
+ retval = (char *) (*foundp)->translation;
+
+ __libc_rwlock_unlock (_nl_state_lock);
+ return retval;
+ }
+#endif
+
+ /* Preserve the `errno' value. */
+ saved_errno = errno;
+
+ /* See whether this is a SUID binary or not. */
+ DETERMINE_SECURE;
+
+ /* First find matching binding. */
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (binding == NULL)
+ dirname = (char *) _nl_default_dirname;
+ else if (IS_ABSOLUTE_PATH (binding->dirname))
+ dirname = binding->dirname;
+ else
+ {
+ /* We have a relative path. Make it absolute now. */
+ size_t dirname_len = strlen (binding->dirname) + 1;
+ size_t path_max;
+ char *ret;
+
+ path_max = (unsigned int) PATH_MAX;
+ path_max += 2; /* The getcwd docs say to do this. */
+
+ for (;;)
+ {
+ dirname = (char *) alloca (path_max + dirname_len);
+ ADD_BLOCK (block_list, dirname);
+
+ __set_errno (0);
+ ret = getcwd (dirname, path_max);
+ if (ret != NULL || errno != ERANGE)
+ break;
+
+ path_max += path_max / 2;
+ path_max += PATH_INCR;
+ }
+
+ if (ret == NULL)
+ {
+ /* We cannot get the current working directory. Don't signal an
+ error but simply return the default string. */
+ FREE_BLOCKS (block_list);
+ __libc_rwlock_unlock (_nl_state_lock);
+ __set_errno (saved_errno);
+ return (plural == 0
+ ? (char *) msgid1
+ /* Use the Germanic plural rule. */
+ : n == 1 ? (char *) msgid1 : (char *) msgid2);
+ }
+
+ stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+ }
+
+ /* Now determine the symbolic name of CATEGORY and its value. */
+ categoryname = category_to_name (category);
+ categoryvalue = guess_category_value (category, categoryname);
+
+ domainname_len = strlen (domainname);
+ xdomainname = (char *) alloca (strlen (categoryname)
+ + domainname_len + 5);
+ ADD_BLOCK (block_list, xdomainname);
+
+ stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+ domainname, domainname_len),
+ ".mo");
+
+ /* Creating working area. */
+ single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+ ADD_BLOCK (block_list, single_locale);
+
+
+ /* Search for the given string. This is a loop because we perhaps
+ got an ordered list of languages to consider for the translation. */
+ while (1)
+ {
+ /* Make CATEGORYVALUE point to the next element of the list. */
+ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+ ++categoryvalue;
+ if (categoryvalue[0] == '\0')
+ {
+ /* The whole contents of CATEGORYVALUE has been searched but
+ no valid entry has been found. We solve this situation
+ by implicitly appending a "C" entry, i.e. no translation
+ will take place. */
+ single_locale[0] = 'C';
+ single_locale[1] = '\0';
+ }
+ else
+ {
+ char *cp = single_locale;
+ while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+ *cp++ = *categoryvalue++;
+ *cp = '\0';
+
+ /* When this is a SUID binary we must not allow accessing files
+ outside the dedicated directories. */
+ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale))
+ /* Ingore this entry. */
+ continue;
+ }
+
+ /* If the current locale value is C (or POSIX) we don't load a
+ domain. Return the MSGID. */
+ if (strcmp (single_locale, "C") == 0
+ || strcmp (single_locale, "POSIX") == 0)
+ {
+ FREE_BLOCKS (block_list);
+ __libc_rwlock_unlock (_nl_state_lock);
+ __set_errno (saved_errno);
+ return (plural == 0
+ ? (char *) msgid1
+ /* Use the Germanic plural rule. */
+ : n == 1 ? (char *) msgid1 : (char *) msgid2);
+ }
+
+
+ /* Find structure describing the message catalog matching the
+ DOMAINNAME and CATEGORY. */
+ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding);
+
+ if (domain != NULL)
+ {
+ retval = _nl_find_msg (domain, binding, msgid1, &retlen);
+
+ if (retval == NULL)
+ {
+ int cnt;
+
+ for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+ {
+ retval = _nl_find_msg (domain->successor[cnt], binding,
+ msgid1, &retlen);
+
+ if (retval != NULL)
+ {
+ domain = domain->successor[cnt];
+ break;
+ }
+ }
+ }
+
+ if (retval != NULL)
+ {
+ /* Found the translation of MSGID1 in domain DOMAIN:
+ starting at RETVAL, RETLEN bytes. */
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+#if defined HAVE_TSEARCH || defined _LIBC
+ if (foundp == NULL)
+ {
+ /* Create a new entry and add it to the search tree. */
+ struct known_translation_t *newp;
+
+ newp = (struct known_translation_t *)
+ malloc (offsetof (struct known_translation_t, msgid)
+ + msgid_len + domainname_len + 1);
+ if (newp != NULL)
+ {
+ newp->domainname =
+ mempcpy (newp->msgid, msgid1, msgid_len);
+ memcpy (newp->domainname, domainname, domainname_len + 1);
+ newp->category = category;
+ newp->counter = _nl_msg_cat_cntr;
+ newp->domain = domain;
+ newp->translation = retval;
+ newp->translation_length = retlen;
+
+ /* Insert the entry in the search tree. */
+ foundp = (struct known_translation_t **)
+ tsearch (newp, &root, transcmp);
+ if (foundp == NULL
+ || __builtin_expect (*foundp != newp, 0))
+ /* The insert failed. */
+ free (newp);
+ }
+ }
+ else
+ {
+ /* We can update the existing entry. */
+ (*foundp)->counter = _nl_msg_cat_cntr;
+ (*foundp)->domain = domain;
+ (*foundp)->translation = retval;
+ (*foundp)->translation_length = retlen;
+ }
+#endif
+ /* Now deal with plural. */
+ if (plural)
+ retval = plural_lookup (domain, n, retval, retlen);
+
+ __libc_rwlock_unlock (_nl_state_lock);
+ return retval;
+ }
+ }
+ }
+ /* NOTREACHED */
+}
+
+
+char *
+internal_function
+_nl_find_msg (domain_file, domainbinding, msgid, lengthp)
+ struct loaded_l10nfile *domain_file;
+ struct binding *domainbinding;
+ const char *msgid;
+ size_t *lengthp;
+{
+ struct loaded_domain *domain;
+ size_t act;
+ char *result;
+ size_t resultlen;
+
+ if (domain_file->decided == 0)
+ _nl_load_domain (domain_file, domainbinding);
+
+ if (domain_file->data == NULL)
+ return NULL;
+
+ domain = (struct loaded_domain *) domain_file->data;
+
+ /* Locate the MSGID and its translation. */
+ if (domain->hash_size > 2 && domain->hash_tab != NULL)
+ {
+ /* Use the hashing table. */
+ nls_uint32 len = strlen (msgid);
+ nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 idx = hash_val % domain->hash_size;
+ nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+
+ while (1)
+ {
+ nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+
+ if (nstr == 0)
+ /* Hash table entry is empty. */
+ return NULL;
+
+ /* Compare msgid with the original string at index nstr-1.
+ We compare the lengths with >=, not ==, because plural entries
+ are represented by strings with an embedded NUL. */
+ if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) >= len
+ && (strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr - 1].offset))
+ == 0))
+ {
+ act = nstr - 1;
+ goto found;
+ }
+
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+ }
+ /* NOTREACHED */
+ }
+ else
+ {
+ /* Try the default method: binary search in the sorted array of
+ messages. */
+ size_t top, bottom;
+
+ bottom = 0;
+ top = domain->nstrings;
+ while (bottom < top)
+ {
+ int cmp_val;
+
+ act = (bottom + top) / 2;
+ cmp_val = strcmp (msgid, (domain->data
+ + W (domain->must_swap,
+ domain->orig_tab[act].offset)));
+ if (cmp_val < 0)
+ top = act;
+ else if (cmp_val > 0)
+ bottom = act + 1;
+ else
+ goto found;
+ }
+ /* No translation was found. */
+ return NULL;
+ }
+
+ found:
+ /* The translation was found at index ACT. If we have to convert the
+ string to use a different character set, this is the time. */
+ result = ((char *) domain->data
+ + W (domain->must_swap, domain->trans_tab[act].offset));
+ resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
+
+#if defined _LIBC || HAVE_ICONV
+ if (domain->codeset_cntr
+ != (domainbinding != NULL ? domainbinding->codeset_cntr : 0))
+ {
+ /* The domain's codeset has changed through bind_textdomain_codeset()
+ since the message catalog was initialized or last accessed. We
+ have to reinitialize the converter. */
+ _nl_free_domain_conv (domain);
+ _nl_init_domain_conv (domain_file, domain, domainbinding);
+ }
+
+ if (
+# ifdef _LIBC
+ domain->conv != (__gconv_t) -1
+# else
+# if HAVE_ICONV
+ domain->conv != (iconv_t) -1
+# endif
+# endif
+ )
+ {
+ /* We are supposed to do a conversion. First allocate an
+ appropriate table with the same structure as the table
+ of translations in the file, where we can put the pointers
+ to the converted strings in.
+ There is a slight complication with plural entries. They
+ are represented by consecutive NUL terminated strings. We
+ handle this case by converting RESULTLEN bytes, including
+ NULs. */
+
+ if (domain->conv_tab == NULL
+ && ((domain->conv_tab = (char **) calloc (domain->nstrings,
+ sizeof (char *)))
+ == NULL))
+ /* Mark that we didn't succeed allocating a table. */
+ domain->conv_tab = (char **) -1;
+
+ if (__builtin_expect (domain->conv_tab == (char **) -1, 0))
+ /* Nothing we can do, no more memory. */
+ goto converted;
+
+ if (domain->conv_tab[act] == NULL)
+ {
+ /* We haven't used this string so far, so it is not
+ translated yet. Do this now. */
+ /* We use a bit more efficient memory handling.
+ We allocate always larger blocks which get used over
+ time. This is faster than many small allocations. */
+ __libc_lock_define_initialized (static, lock)
+# define INITIAL_BLOCK_SIZE 4080
+ static unsigned char *freemem;
+ static size_t freemem_size;
+
+ const unsigned char *inbuf;
+ unsigned char *outbuf;
+ int malloc_count;
+# ifndef _LIBC
+ transmem_block_t *transmem_list = NULL;
+# endif
+
+ __libc_lock_lock (lock);
+
+ inbuf = (const unsigned char *) result;
+ outbuf = freemem + sizeof (size_t);
+
+ malloc_count = 0;
+ while (1)
+ {
+ transmem_block_t *newmem;
+# ifdef _LIBC
+ size_t non_reversible;
+ int res;
+
+ if (freemem_size < sizeof (size_t))
+ goto resize_freemem;
+
+ res = __gconv (domain->conv,
+ &inbuf, inbuf + resultlen,
+ &outbuf,
+ outbuf + freemem_size - sizeof (size_t),
+ &non_reversible);
+
+ if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT)
+ break;
+
+ if (res != __GCONV_FULL_OUTPUT)
+ {
+ __libc_lock_unlock (lock);
+ goto converted;
+ }
+
+ inbuf = result;
+# else
+# if HAVE_ICONV
+ const char *inptr = (const char *) inbuf;
+ size_t inleft = resultlen;
+ char *outptr = (char *) outbuf;
+ size_t outleft;
+
+ if (freemem_size < sizeof (size_t))
+ goto resize_freemem;
+
+ outleft = freemem_size - sizeof (size_t);
+ if (iconv (domain->conv,
+ (ICONV_CONST char **) &inptr, &inleft,
+ &outptr, &outleft)
+ != (size_t) (-1))
+ {
+ outbuf = (unsigned char *) outptr;
+ break;
+ }
+ if (errno != E2BIG)
+ {
+ __libc_lock_unlock (lock);
+ goto converted;
+ }
+# endif
+# endif
+
+ resize_freemem:
+ /* We must allocate a new buffer or resize the old one. */
+ if (malloc_count > 0)
+ {
+ ++malloc_count;
+ freemem_size = malloc_count * INITIAL_BLOCK_SIZE;
+ newmem = (transmem_block_t *) realloc (transmem_list,
+ freemem_size);
+# ifdef _LIBC
+ if (newmem != NULL)
+ transmem_list = transmem_list->next;
+ else
+ {
+ struct transmem_list *old = transmem_list;
+
+ transmem_list = transmem_list->next;
+ free (old);
+ }
+# endif
+ }
+ else
+ {
+ malloc_count = 1;
+ freemem_size = INITIAL_BLOCK_SIZE;
+ newmem = (transmem_block_t *) malloc (freemem_size);
+ }
+ if (__builtin_expect (newmem == NULL, 0))
+ {
+ freemem = NULL;
+ freemem_size = 0;
+ __libc_lock_unlock (lock);
+ goto converted;
+ }
+
+# ifdef _LIBC
+ /* Add the block to the list of blocks we have to free
+ at some point. */
+ newmem->next = transmem_list;
+ transmem_list = newmem;
+
+ freemem = newmem->data;
+ freemem_size -= offsetof (struct transmem_list, data);
+# else
+ transmem_list = newmem;
+ freemem = newmem;
+# endif
+
+ outbuf = freemem + sizeof (size_t);
+ }
+
+ /* We have now in our buffer a converted string. Put this
+ into the table of conversions. */
+ *(size_t *) freemem = outbuf - freemem - sizeof (size_t);
+ domain->conv_tab[act] = (char *) freemem;
+ /* Shrink freemem, but keep it aligned. */
+ freemem_size -= outbuf - freemem;
+ freemem = outbuf;
+ freemem += freemem_size & (alignof (size_t) - 1);
+ freemem_size = freemem_size & ~ (alignof (size_t) - 1);
+
+ __libc_lock_unlock (lock);
+ }
+
+ /* Now domain->conv_tab[act] contains the translation of all
+ the plural variants. */
+ result = domain->conv_tab[act] + sizeof (size_t);
+ resultlen = *(size_t *) domain->conv_tab[act];
+ }
+
+ converted:
+ /* The result string is converted. */
+
+#endif /* _LIBC || HAVE_ICONV */
+
+ *lengthp = resultlen;
+ return result;
+}
+
+
+/* Look up a plural variant. */
+static char *
+internal_function
+plural_lookup (domain, n, translation, translation_len)
+ struct loaded_l10nfile *domain;
+ unsigned long int n;
+ const char *translation;
+ size_t translation_len;
+{
+ struct loaded_domain *domaindata = (struct loaded_domain *) domain->data;
+ unsigned long int index;
+ const char *p;
+
+ index = plural_eval (domaindata->plural, n);
+ if (index >= domaindata->nplurals)
+ /* This should never happen. It means the plural expression and the
+ given maximum value do not match. */
+ index = 0;
+
+ /* Skip INDEX strings at TRANSLATION. */
+ p = translation;
+ while (index-- > 0)
+ {
+#ifdef _LIBC
+ p = __rawmemchr (p, '\0');
+#else
+ p = strchr (p, '\0');
+#endif
+ /* And skip over the NUL byte. */
+ p++;
+
+ if (p >= translation + translation_len)
+ /* This should never happen. It means the plural expression
+ evaluated to a value larger than the number of variants
+ available for MSGID1. */
+ return (char *) translation;
+ }
+ return (char *) p;
+}
+
+
+/* Function to evaluate the plural expression and return an index value. */
+static unsigned long int
+internal_function
+plural_eval (pexp, n)
+ struct expression *pexp;
+ unsigned long int n;
+{
+ switch (pexp->nargs)
+ {
+ case 0:
+ switch (pexp->operation)
+ {
+ case var:
+ return n;
+ case num:
+ return pexp->val.num;
+ default:
+ break;
+ }
+ /* NOTREACHED */
+ break;
+ case 1:
+ {
+ /* pexp->operation must be lnot. */
+ unsigned long int arg = plural_eval (pexp->val.args[0], n);
+ return ! arg;
+ }
+ case 2:
+ {
+ unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
+ if (pexp->operation == lor)
+ return leftarg || plural_eval (pexp->val.args[1], n);
+ else if (pexp->operation == land)
+ return leftarg && plural_eval (pexp->val.args[1], n);
+ else
+ {
+ unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
+
+ switch (pexp->operation)
+ {
+ case mult:
+ return leftarg * rightarg;
+ case divide:
+ return leftarg / rightarg;
+ case module:
+ return leftarg % rightarg;
+ case plus:
+ return leftarg + rightarg;
+ case minus:
+ return leftarg - rightarg;
+ case less_than:
+ return leftarg < rightarg;
+ case greater_than:
+ return leftarg > rightarg;
+ case less_or_equal:
+ return leftarg <= rightarg;
+ case greater_or_equal:
+ return leftarg >= rightarg;
+ case equal:
+ return leftarg == rightarg;
+ case not_equal:
+ return leftarg != rightarg;
+ default:
+ break;
+ }
+ }
+ /* NOTREACHED */
+ break;
+ }
+ case 3:
+ {
+ /* pexp->operation must be qmop. */
+ unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
+ return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
+ }
+ }
+ /* NOTREACHED */
+ return 0;
+}
+
+
+/* Return string representation of locale CATEGORY. */
+static const char *
+internal_function
+category_to_name (category)
+ int category;
+{
+ const char *retval;
+
+ switch (category)
+ {
+#ifdef LC_COLLATE
+ case LC_COLLATE:
+ retval = "LC_COLLATE";
+ break;
+#endif
+#ifdef LC_CTYPE
+ case LC_CTYPE:
+ retval = "LC_CTYPE";
+ break;
+#endif
+#ifdef LC_MONETARY
+ case LC_MONETARY:
+ retval = "LC_MONETARY";
+ break;
+#endif
+#ifdef LC_NUMERIC
+ case LC_NUMERIC:
+ retval = "LC_NUMERIC";
+ break;
+#endif
+#ifdef LC_TIME
+ case LC_TIME:
+ retval = "LC_TIME";
+ break;
+#endif
+#ifdef LC_MESSAGES
+ case LC_MESSAGES:
+ retval = "LC_MESSAGES";
+ break;
+#endif
+#ifdef LC_RESPONSE
+ case LC_RESPONSE:
+ retval = "LC_RESPONSE";
+ break;
+#endif
+#ifdef LC_ALL
+ case LC_ALL:
+ /* This might not make sense but is perhaps better than any other
+ value. */
+ retval = "LC_ALL";
+ break;
+#endif
+ default:
+ /* If you have a better idea for a default value let me know. */
+ retval = "LC_XXX";
+ }
+
+ return retval;
+}
+
+/* Guess value of current locale from value of the environment variables. */
+static const char *
+internal_function
+guess_category_value (category, categoryname)
+ int category;
+ const char *categoryname;
+{
+ const char *language;
+ const char *retval;
+
+ /* The highest priority value is the `LANGUAGE' environment
+ variable. But we don't use the value if the currently selected
+ locale is the C locale. This is a GNU extension. */
+ language = getenv ("LANGUAGE");
+ if (language != NULL && language[0] == '\0')
+ language = NULL;
+
+ /* We have to proceed with the POSIX methods of looking to `LC_ALL',
+ `LC_xxx', and `LANG'. On some systems this can be done by the
+ `setlocale' function itself. */
+#if defined _LIBC || (defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL)
+ retval = setlocale (category, NULL);
+#else
+ /* Setting of LC_ALL overwrites all other. */
+ retval = getenv ("LC_ALL");
+ if (retval == NULL || retval[0] == '\0')
+ {
+ /* Next comes the name of the desired category. */
+ retval = getenv (categoryname);
+ if (retval == NULL || retval[0] == '\0')
+ {
+ /* Last possibility is the LANG environment variable. */
+ retval = getenv ("LANG");
+ if (retval == NULL || retval[0] == '\0')
+ /* We use C as the default domain. POSIX says this is
+ implementation defined. */
+ return "C";
+ }
+ }
+#endif
+
+ return language != NULL && strcmp (retval, "C") != 0 ? language : retval;
+}
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
+
+#if !_LIBC && !HAVE_MEMPCPY
+static void *
+mempcpy (dest, src, n)
+ void *dest;
+ const void *src;
+ size_t n;
+{
+ return (void *) ((char *) memcpy (dest, src, n) + n);
+}
+#endif
+
+
+#ifdef _LIBC
+/* If we want to free all resources we have to do some work at
+ program's end. */
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ void *old;
+
+ while (_nl_domain_bindings != NULL)
+ {
+ struct binding *oldp = _nl_domain_bindings;
+ _nl_domain_bindings = _nl_domain_bindings->next;
+ if (oldp->dirname != _nl_default_dirname)
+ /* Yes, this is a pointer comparison. */
+ free (oldp->dirname);
+ free (oldp->codeset);
+ free (oldp);
+ }
+
+ if (_nl_current_default_domain != _nl_default_default_domain)
+ /* Yes, again a pointer comparison. */
+ free ((char *) _nl_current_default_domain);
+
+ /* Remove the search tree with the known translations. */
+ __tdestroy (root, free);
+ root = NULL;
+
+ while (transmem_list != NULL)
+ {
+ old = transmem_list;
+ transmem_list = transmem_list->next;
+ free (old);
+ }
+}
+
+text_set_element (__libc_subfreeres, free_mem);
+#endif
diff --git a/setedit/gettext/dcngettext.c b/setedit/gettext/dcngettext.c
new file mode 100644
index 0000000..e5da257
--- /dev/null
+++ b/setedit/gettext/dcngettext.c
@@ -0,0 +1,59 @@
+/* Implementation of the dcngettext(3) function.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCNGETTEXT __dcngettext
+# define DCIGETTEXT __dcigettext
+#else
+# define DCNGETTEXT dcngettext__
+# define DCIGETTEXT dcigettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCNGETTEXT (domainname, msgid1, msgid2, n, category)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+ int category;
+{
+ return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dcngettext, dcngettext);
+#endif
diff --git a/setedit/gettext/dgettext.c b/setedit/gettext/dgettext.c
new file mode 100644
index 0000000..c513041
--- /dev/null
+++ b/setedit/gettext/dgettext.c
@@ -0,0 +1,58 @@
+/* Implementation of the dgettext(3) function.
+ Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <locale.h>
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DGETTEXT __dgettext
+# define DCGETTEXT __dcgettext
+#else
+# define DGETTEXT dgettext__
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale. */
+char *
+DGETTEXT (domainname, msgid)
+ const char *domainname;
+ const char *msgid;
+{
+ return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dgettext, dgettext);
+#endif
diff --git a/setedit/gettext/djgpp.h b/setedit/gettext/djgpp.h
new file mode 100644
index 0000000..ce227e5
--- /dev/null
+++ b/setedit/gettext/djgpp.h
@@ -0,0 +1,311 @@
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* Special definitions, processed by autoheader.
+ Copyright (C) 1995-1998, 2001 Free Software Foundation.
+ Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
+
+/* Default value for alignment of strings in .mo file. */
+#define DEFAULT_OUTPUT_ALIGNMENT 1
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+
+/* Define if using alloca.c. */
+/* #undef C_ALLOCA */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define if you have alloca, as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define if you don't have vprintf but do have _doprnt. */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have a working `mmap' system call. */
+/* #undef HAVE_MMAP */
+
+/* Define if you have the vprintf function. */
+#define HAVE_VPRINTF 1
+
+/* Define as __inline if that's what the C compiler calls it. */
+/* #undef inline */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef off_t */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+/* #undef STACK_DIRECTION */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you have the __argz_count function. */
+/* #undef HAVE___ARGZ_COUNT */
+
+/* Define if you have the __argz_next function. */
+/* #undef HAVE___ARGZ_NEXT */
+
+/* Define if you have the __argz_stringify function. */
+/* #undef HAVE___ARGZ_STRINGIFY */
+
+/* Define if you have the dcgettext function. */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define if you have the feof_unlocked function. */
+/* #undef HAVE_FEOF_UNLOCKED */
+
+/* Define if you have the fgets_unlocked function. */
+/* #undef HAVE_FGETS_UNLOCKED */
+
+/* Define if you have the getcwd function. */
+#define HAVE_GETCWD 1
+
+/* Define if you have the getdelim function. */
+/* #undef HAVE_GETDELIM */
+
+/* Define if you have the getegid function. */
+#define HAVE_GETEGID 1
+
+/* Define if you have the geteuid function. */
+#define HAVE_GETEUID 1
+
+/* Define if you have the getgid function. */
+#define HAVE_GETGID 1
+
+/* Define if you have the getpagesize function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if you have the getuid function. */
+#define HAVE_GETUID 1
+
+/* Define if you have the isascii function. */
+#define HAVE_ISASCII 1
+
+/* Define if you have the iswcntrl function. */
+/* #undef HAVE_ISWCNTRL */
+
+/* Define if you have the iswprint function. */
+/* #undef HAVE_ISWPRINT */
+
+/* Define if you have the mblen function. */
+#define HAVE_MBLEN 1
+
+/* Define if you have the mbsinit function. */
+/* #undef HAVE_MBSINIT */
+
+/* Define if you have the memcpy function. */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memmove function. */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the mempcpy function. */
+/* #undef HAVE_MEMPCPY */
+
+/* Define if you have the memset function. */
+#define HAVE_MEMSET 1
+
+/* Define if you have the munmap function. */
+/* #undef HAVE_MUNMAP */
+
+/* Define if you have the putenv function. */
+#define HAVE_PUTENV 1
+
+/* Define if you have the setenv function. */
+#define HAVE_SETENV 1
+
+/* Define if you have the setlocale function. */
+#define HAVE_SETLOCALE 1
+
+/* Define if you have the stpcpy function. */
+#define HAVE_STPCPY 1
+
+/* Define if you have the stpncpy function. */
+/* #undef HAVE_STPNCPY */
+
+/* Define if you have the strcasecmp function. */
+#define HAVE_STRCASECMP 1
+
+/* Define if you have the strchr function. */
+#define HAVE_STRCHR 1
+
+/* Define if you have the strcspn function. */
+#define HAVE_STRCSPN 1
+
+/* Define if you have the strdup function. */
+#define HAVE_STRDUP 1
+
+/* Define if you have the strerror function. */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strncasecmp function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define if you have the strstr function. */
+#define HAVE_STRSTR 1
+
+/* Define if you have the strtoul function. */
+#define HAVE_STRTOUL 1
+
+/* Define if you have the tsearch function. */
+/* #undef HAVE_TSEARCH */
+
+/* Define if you have the uname function. */
+#define HAVE_UNAME 1
+
+/* Define if you have the vasprintf function. */
+/* #undef HAVE_VASPRINTF */
+
+/* Define if you have the wcwidth function. */
+/* #undef HAVE_WCWIDTH */
+
+/* Define if you have the <argz.h> header file. */
+/* #undef HAVE_ARGZ_H */
+
+/* Define if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define if you have the <nl_types.h> header file. */
+/* #undef HAVE_NL_TYPES_H */
+
+/* Define if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the <values.h> header file. */
+#define HAVE_VALUES_H 1
+
+/* Define if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define if you have the <wctype.h> header file. */
+#define HAVE_WCTYPE_H 1
+
+/* Name of package */
+#define PACKAGE "gettext"
+
+/* Version number of package */
+#define VERSION "0.10.39"
+
+/* Make sure we see all GNU extensions. */
+#define _GNU_SOURCE 1
+
+/* Define to empty if the C compiler doesn't support this keyword. */
+/* #undef signed */
+
+/* Define if backslash-a works in C strings. */
+#define HAVE_C_BACKSLASH_A 1
+
+/* Define if you have the unsigned long long type. */
+#define HAVE_UNSIGNED_LONG_LONG 1
+
+/* Define if system has ptrdiff_t type */
+#define HAVE_PTRDIFF_T 1
+
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to unsigned long or unsigned long long
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long long
+
+/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
+/* #undef HAVE_MBRTOWC */
+
+/* Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise. */
+#define HAVE_DECL_WCWIDTH 0
+
+/* Define to a type if <wchar.h> does not define. */
+/* #undef mbstate_t */
+
+/* Define if you have the parse_printf_format() function. */
+/* #undef HAVE_PARSE_PRINTF_FORMAT */
+
+/* Define as const if the declaration of setlocale() needs const. */
+#define SETLOCALE_CONST const
+
+/* Define if you have the iconv() function. */
+/* #define HAVE_ICONV 1 */
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST const
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+/* #undef HAVE_LANGINFO_CODESET */
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to 1 if translation of program messages to the user's native language
+ is requested. */
+#define ENABLE_NLS 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+
+/* We don't test for the basename function but still want to use the
+ version in the libc when compiling for a system using glibc. */
+#ifdef __GNU_LIBRARY__
+# define HAVE_BASENAME 1
+#endif
+
+
+/* A file name cannot consist of any character possible. INVALID_PATH_CHAR
+ contains the characters not allowed. */
+#ifndef MSDOS
+# define INVALID_PATH_CHAR "\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 \177/"
+#else
+/* Something like this for MSDOG. */
+# define INVALID_PATH_CHAR "\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 \177\\:."
+#endif
+
+/* This is the page width for the message_print function. It should
+ not be set to more than 79 characters (Emacs users will appreciate
+ it). It is used to wrap the msgid and msgstr strings, and also to
+ wrap the file position (#:) comments. */
+#define PAGE_WIDTH 79
diff --git a/setedit/gettext/dngettext.c b/setedit/gettext/dngettext.c
new file mode 100644
index 0000000..79aaa9a
--- /dev/null
+++ b/setedit/gettext/dngettext.c
@@ -0,0 +1,60 @@
+/* Implementation of the dngettext(3) function.
+ Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <locale.h>
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DNGETTEXT __dngettext
+# define DCNGETTEXT __dcngettext
+#else
+# define DNGETTEXT dngettext__
+# define DCNGETTEXT dcngettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale and skip message according to the plural form. */
+char *
+DNGETTEXT (domainname, msgid1, msgid2, n)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+{
+ return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dngettext, dngettext);
+#endif
diff --git a/setedit/gettext/explodename.c b/setedit/gettext/explodename.c
new file mode 100644
index 0000000..c4ddcc4
--- /dev/null
+++ b/setedit/gettext/explodename.c
@@ -0,0 +1,191 @@
+/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+char *
+_nl_find_language (name)
+ const char *name;
+{
+ while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
+ && name[0] != '+' && name[0] != ',')
+ ++name;
+
+ return (char *) name;
+}
+
+
+int
+_nl_explode_name (name, language, modifier, territory, codeset,
+ normalized_codeset, special, sponsor, revision)
+ char *name;
+ const char **language;
+ const char **modifier;
+ const char **territory;
+ const char **codeset;
+ const char **normalized_codeset;
+ const char **special;
+ const char **sponsor;
+ const char **revision;
+{
+ enum { undecided, xpg, cen } syntax;
+ char *cp;
+ int mask;
+
+ *modifier = NULL;
+ *territory = NULL;
+ *codeset = NULL;
+ *normalized_codeset = NULL;
+ *special = NULL;
+ *sponsor = NULL;
+ *revision = NULL;
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = 0;
+ syntax = undecided;
+ *language = cp = name;
+ cp = _nl_find_language (*language);
+
+ if (*language == cp)
+ /* This does not make sense: language has to be specified. Use
+ this entry as it is without exploding. Perhaps it is an alias. */
+ cp = strchr (*language, '\0');
+ else if (cp[0] == '_')
+ {
+ /* Next is the territory. */
+ cp[0] = '\0';
+ *territory = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
+ && cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= TERRITORY;
+
+ if (cp[0] == '.')
+ {
+ /* Next is the codeset. */
+ syntax = xpg;
+ cp[0] = '\0';
+ *codeset = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '@')
+ ++cp;
+
+ mask |= XPG_CODESET;
+
+ if (*codeset != cp && (*codeset)[0] != '\0')
+ {
+ *normalized_codeset = _nl_normalize_codeset (*codeset,
+ cp - *codeset);
+ if (strcmp (*codeset, *normalized_codeset) == 0)
+ free ((char *) *normalized_codeset);
+ else
+ mask |= XPG_NORM_CODESET;
+ }
+ }
+ }
+
+ if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
+ {
+ /* Next is the modifier. */
+ syntax = cp[0] == '@' ? xpg : cen;
+ cp[0] = '\0';
+ *modifier = ++cp;
+
+ while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
+ && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= XPG_MODIFIER | CEN_AUDIENCE;
+ }
+
+ if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
+ {
+ syntax = cen;
+
+ if (cp[0] == '+')
+ {
+ /* Next is special application (CEN syntax). */
+ cp[0] = '\0';
+ *special = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPECIAL;
+ }
+
+ if (cp[0] == ',')
+ {
+ /* Next is sponsor (CEN syntax). */
+ cp[0] = '\0';
+ *sponsor = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPONSOR;
+ }
+
+ if (cp[0] == '_')
+ {
+ /* Next is revision (CEN syntax). */
+ cp[0] = '\0';
+ *revision = ++cp;
+
+ mask |= CEN_REVISION;
+ }
+ }
+
+ /* For CEN syntax values it might be important to have the
+ separator character in the file name, not for XPG syntax. */
+ if (syntax == xpg)
+ {
+ if (*territory != NULL && (*territory)[0] == '\0')
+ mask &= ~TERRITORY;
+
+ if (*codeset != NULL && (*codeset)[0] == '\0')
+ mask &= ~XPG_CODESET;
+
+ if (*modifier != NULL && (*modifier)[0] == '\0')
+ mask &= ~XPG_MODIFIER;
+ }
+
+ return mask;
+}
diff --git a/setedit/gettext/finddomain.c b/setedit/gettext/finddomain.c
new file mode 100644
index 0000000..4882554
--- /dev/null
+++ b/setedit/gettext/finddomain.c
@@ -0,0 +1,197 @@
+/* Handle list of needed message catalogs
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.org>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+/* List of already loaded domains. */
+static struct loaded_l10nfile *_nl_loaded_domains;
+
+
+/* Return a data structure describing the message catalog described by
+ the DOMAINNAME and CATEGORY parameters with respect to the currently
+ established bindings. */
+struct loaded_l10nfile *
+internal_function
+_nl_find_domain (dirname, locale, domainname, domainbinding)
+ const char *dirname;
+ char *locale;
+ const char *domainname;
+ struct binding *domainbinding;
+{
+ struct loaded_l10nfile *retval;
+ const char *language;
+ const char *modifier;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *alias_value;
+ int mask;
+
+ /* LOCALE can consist of up to four recognized parts for the XPG syntax:
+
+ language[_territory[.codeset]][@modifier]
+
+ and six parts for the CEN syntax:
+
+ language[_territory][+audience][+special][,[sponsor][_revision]]
+
+ Beside the first part all of them are allowed to be missing. If
+ the full specified locale is not found, the less specific one are
+ looked for. The various parts will be stripped off according to
+ the following order:
+ (1) revision
+ (2) sponsor
+ (3) special
+ (4) codeset
+ (5) normalized codeset
+ (6) territory
+ (7) audience/modifier
+ */
+
+ /* If we have already tested for this locale entry there has to
+ be one data set in the list of loaded domains. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, 0, locale, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, domainname, 0);
+ if (retval != NULL)
+ {
+ /* We know something about this locale. */
+ int cnt;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval, domainbinding);
+
+ if (retval->data != NULL)
+ return retval;
+
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt], domainbinding);
+
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ return cnt >= 0 ? retval : NULL;
+ /* NOTREACHED */
+ }
+
+ /* See whether the locale value is an alias. If yes its value
+ *overwrites* the alias name. No test for the original value is
+ done. */
+ alias_value = _nl_expand_alias (locale);
+ if (alias_value != NULL)
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ locale = strdup (alias_value);
+ if (locale == NULL)
+ return NULL;
+#else
+ size_t len = strlen (alias_value) + 1;
+ locale = (char *) malloc (len);
+ if (locale == NULL)
+ return NULL;
+
+ memcpy (locale, alias_value, len);
+#endif
+ }
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = _nl_explode_name (locale, &language, &modifier, &territory,
+ &codeset, &normalized_codeset, &special,
+ &sponsor, &revision);
+
+ /* Create all possible locale entries which might be interested in
+ generalization. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, mask, language, territory,
+ codeset, normalized_codeset, modifier, special,
+ sponsor, revision, domainname, 1);
+ if (retval == NULL)
+ /* This means we are out of core. */
+ return NULL;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval, domainbinding);
+ if (retval->data == NULL)
+ {
+ int cnt;
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt], domainbinding);
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ }
+
+ /* The room for an alias was dynamically allocated. Free it now. */
+ if (alias_value != NULL)
+ free (locale);
+
+ /* The space for normalized_codeset is dynamically allocated. Free it. */
+ if (mask & XPG_NORM_CODESET)
+ free ((void *) normalized_codeset);
+
+ return retval;
+}
+
+
+#ifdef _LIBC
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ struct loaded_l10nfile *runp = _nl_loaded_domains;
+
+ while (runp != NULL)
+ {
+ struct loaded_l10nfile *here = runp;
+ if (runp->data != NULL)
+ _nl_unload_domain ((struct loaded_domain *) runp->data);
+ runp = runp->next;
+ free ((char *) here->filename);
+ free (here);
+ }
+}
+
+text_set_element (__libc_subfreeres, free_mem);
+#endif
diff --git a/setedit/gettext/gettext.c b/setedit/gettext/gettext.c
new file mode 100644
index 0000000..a640205
--- /dev/null
+++ b/setedit/gettext/gettext.c
@@ -0,0 +1,63 @@
+/* Implementation of gettext(3) function.
+ Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <stdlib.h> /* Just for NULL. */
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define GETTEXT __gettext
+# define DCGETTEXT __dcgettext
+#else
+# define GETTEXT gettext__
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+char *
+GETTEXT (msgid)
+ const char *msgid;
+{
+ return DCGETTEXT (NULL, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__gettext, gettext);
+#endif
diff --git a/setedit/gettext/gettext.h b/setedit/gettext/gettext.h
new file mode 100644
index 0000000..eb58890
--- /dev/null
+++ b/setedit/gettext/gettext.h
@@ -0,0 +1,101 @@
+/* Description of GNU message catalog format: general file layout.
+ Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _GETTEXT_H
+#define _GETTEXT_H 1
+
+#if HAVE_LIMITS_H || _LIBC
+# include <limits.h>
+#endif
+
+/* @@ end of prolog @@ */
+
+/* The magic number of the GNU message catalog format. */
+#define _MAGIC 0x950412de
+#define _MAGIC_SWAPPED 0xde120495
+
+/* Revision number of the currently used .mo (binary) file format. */
+#define MO_REVISION_NUMBER 0
+
+/* The following contortions are an attempt to use the C preprocessor
+ to determine an unsigned integral type that is 32 bits wide. An
+ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+ as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
+ when cross-compiling. */
+
+#if __STDC__
+# define UINT_MAX_32_BITS 4294967295U
+#else
+# define UINT_MAX_32_BITS 0xFFFFFFFF
+#endif
+
+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+ This should be valid for all systems GNU cares about because
+ that doesn't include 16-bit systems, and only modern systems
+ (that certainly have <limits.h>) have 64+-bit integral types. */
+
+#ifndef UINT_MAX
+# define UINT_MAX UINT_MAX_32_BITS
+#endif
+
+#if UINT_MAX == UINT_MAX_32_BITS
+typedef unsigned nls_uint32;
+#else
+# if USHRT_MAX == UINT_MAX_32_BITS
+typedef unsigned short nls_uint32;
+# else
+# if ULONG_MAX == UINT_MAX_32_BITS
+typedef unsigned long nls_uint32;
+# else
+ /* The following line is intended to throw an error. Using #error is
+ not portable enough. */
+ "Cannot determine unsigned 32-bit data type."
+# endif
+# endif
+#endif
+
+
+/* Header for binary .mo file format. */
+struct mo_file_header
+{
+ /* The magic number. */
+ nls_uint32 magic;
+ /* The revision number of the file format. */
+ nls_uint32 revision;
+ /* The number of strings pairs. */
+ nls_uint32 nstrings;
+ /* Offset of table with start offsets of original strings. */
+ nls_uint32 orig_tab_offset;
+ /* Offset of table with start offsets of translation strings. */
+ nls_uint32 trans_tab_offset;
+ /* Size of hashing table. */
+ nls_uint32 hash_tab_size;
+ /* Offset of first hashing entry. */
+ nls_uint32 hash_tab_offset;
+};
+
+struct string_desc
+{
+ /* Length of addressed string. */
+ nls_uint32 length;
+ /* Offset of string in file. */
+ nls_uint32 offset;
+};
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettext.h */
diff --git a/setedit/gettext/gettextP.h b/setedit/gettext/gettextP.h
new file mode 100644
index 0000000..ee8ca48
--- /dev/null
+++ b/setedit/gettext/gettextP.h
@@ -0,0 +1,251 @@
+/* Header describing internals of libintl library.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _GETTEXTP_H
+#define _GETTEXTP_H
+
+#include <stddef.h> /* Get size_t. */
+
+#ifdef _LIBC
+# include "../iconv/gconv_int.h"
+#else
+# if HAVE_ICONV
+# include <iconv.h>
+# endif
+#endif
+
+#include "loadinfo.h"
+
+#include "gettext.h" /* Get nls_uint32. */
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+/* Tell the compiler when a conditional or integer expression is
+ almost always true or almost always false. */
+#ifndef HAVE_BUILTIN_EXPECT
+# define __builtin_expect(expr, val) (expr)
+#endif
+
+#ifndef W
+# define W(flag, data) ((flag) ? SWAP (data) : (data))
+#endif
+
+
+#ifdef _LIBC
+# include <byteswap.h>
+# define SWAP(i) bswap_32 (i)
+#else
+static inline nls_uint32
+SWAP (i)
+ nls_uint32 i;
+{
+ return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+#endif
+
+
+/* This is the representation of the expressions to determine the
+ plural form. */
+struct expression
+{
+ int nargs; /* Number of arguments. */
+ enum operator
+ {
+ /* Without arguments: */
+ var, /* The variable "n". */
+ num, /* Decimal number. */
+ /* Unary operators: */
+ lnot, /* Logical NOT. */
+ /* Binary operators: */
+ mult, /* Multiplication. */
+ divide, /* Division. */
+ module, /* Module operation. */
+ plus, /* Addition. */
+ minus, /* Subtraction. */
+ less_than, /* Comparison. */
+ greater_than, /* Comparison. */
+ less_or_equal, /* Comparison. */
+ greater_or_equal, /* Comparison. */
+ equal, /* Comparision for equality. */
+ not_equal, /* Comparision for inequality. */
+ land, /* Logical AND. */
+ lor, /* Logical OR. */
+ /* Ternary operators: */
+ qmop /* Question mark operator. */
+ } operation;
+ union
+ {
+ unsigned long int num; /* Number value for `num'. */
+ struct expression *args[3]; /* Up to three arguments. */
+ } val;
+};
+
+/* This is the data structure to pass information to the parser and get
+ the result in a thread-safe way. */
+struct parse_args
+{
+ const char *cp;
+ struct expression *res;
+};
+
+
+/* The representation of an opened message catalog. */
+struct loaded_domain
+{
+ const char *data;
+ int use_mmap;
+ size_t mmap_size;
+ int must_swap;
+ nls_uint32 nstrings;
+ struct string_desc *orig_tab;
+ struct string_desc *trans_tab;
+ nls_uint32 hash_size;
+ nls_uint32 *hash_tab;
+ int codeset_cntr;
+#ifdef _LIBC
+ __gconv_t conv;
+#else
+# if HAVE_ICONV
+ iconv_t conv;
+# endif
+#endif
+ char **conv_tab;
+
+ struct expression *plural;
+ unsigned long int nplurals;
+};
+
+/* We want to allocate a string at the end of the struct. But ISO C
+ doesn't allow zero sized arrays. */
+#ifdef __GNUC__
+# define ZERO 0
+#else
+# define ZERO 1
+#endif
+
+/* A set of settings bound to a message domain. Used to store settings
+ from bindtextdomain() and bind_textdomain_codeset(). */
+struct binding
+{
+ struct binding *next;
+ char *dirname;
+ int codeset_cntr; /* Incremented each time codeset changes. */
+ char *codeset;
+ char domainname[ZERO];
+};
+
+/* A counter which is incremented each time some previous translations
+ become invalid.
+ This variable is part of the external ABI of the GNU libintl. */
+extern int _nl_msg_cat_cntr;
+
+struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+ char *__locale,
+ const char *__domainname,
+ struct binding *__domainbinding))
+ internal_function;
+void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
+ struct binding *__domainbinding))
+ internal_function;
+void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
+ internal_function;
+const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
+ struct loaded_domain *__domain,
+ struct binding *__domainbinding))
+ internal_function;
+void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
+ internal_function;
+
+char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+ struct binding *domainbinding,
+ const char *msgid, size_t *lengthp))
+ internal_function;
+
+#ifdef _LIBC
+extern char *__gettext PARAMS ((const char *__msgid));
+extern char *__dgettext PARAMS ((const char *__domainname,
+ const char *__msgid));
+extern char *__dcgettext PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+extern char *__dngettext PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int n));
+extern char *__dcngettext PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category));
+extern char *__dcigettext PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category));
+extern char *__textdomain PARAMS ((const char *__domainname));
+extern char *__bindtextdomain PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
+ const char *__codeset));
+#else
+extern char *gettext__ PARAMS ((const char *__msgid));
+extern char *dgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid));
+extern char *dcgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+extern char *dngettext__ PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+extern char *dcngettext__ PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category));
+extern char *dcigettext__ PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category));
+extern char *textdomain__ PARAMS ((const char *__domainname));
+extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
+ const char *__codeset));
+#endif
+
+#ifdef _LIBC
+extern void __gettext_free_exp PARAMS ((struct expression *exp))
+ internal_function;
+extern int __gettextparse PARAMS ((void *arg));
+#else
+extern void gettext_free_exp__ PARAMS ((struct expression *exp))
+ internal_function;
+extern int gettextparse__ PARAMS ((void *arg));
+#endif
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettextP.h */
diff --git a/setedit/gettext/hash-string.h b/setedit/gettext/hash-string.h
new file mode 100644
index 0000000..37d4ce1
--- /dev/null
+++ b/setedit/gettext/hash-string.h
@@ -0,0 +1,58 @@
+/* Description of GNU message catalog format: string hashing function.
+ Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(Args) Args
+# else
+# define PARAMS(Args) ()
+# endif
+#endif
+
+/* We assume to have `unsigned long int' value with at least 32 bits. */
+#define HASHWORDBITS 32
+
+
+/* Defines the so called `hashpjw' function by P.J. Weinberger
+ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+ 1986, 1987 Bell Telephone Laboratories, Inc.] */
+static unsigned long int hash_string PARAMS ((const char *__str_param));
+
+static inline unsigned long int
+hash_string (str_param)
+ const char *str_param;
+{
+ unsigned long int hval, g;
+ const char *str = str_param;
+
+ /* Compute the hash value for the given string. */
+ hval = 0;
+ while (*str != '\0')
+ {
+ hval <<= 4;
+ hval += (unsigned long int) *str++;
+ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+ hval ^= g;
+ }
+ }
+ return hval;
+}
diff --git a/setedit/gettext/intl-compat.c b/setedit/gettext/intl-compat.c
new file mode 100644
index 0000000..50c5ef4
--- /dev/null
+++ b/setedit/gettext/intl-compat.c
@@ -0,0 +1,165 @@
+/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+ Library.
+ Copyright (C) 1995, 2000, 2001 Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "libgnuintl.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+/* This file redirects the gettext functions (without prefix or suffix) to
+ those defined in the included GNU gettext library (with "__" suffix).
+ It is compiled into libintl when the included GNU gettext library is
+ configured --with-included-gettext.
+
+ This redirection works also in the case that the system C library or
+ the system libintl library contain gettext/textdomain/... functions.
+ If it didn't, we would need to add preprocessor level redirections to
+ libgnuintl.h of the following form:
+
+# define gettext gettext__
+# define dgettext dgettext__
+# define dcgettext dcgettext__
+# define ngettext ngettext__
+# define dngettext dngettext__
+# define dcngettext dcngettext__
+# define textdomain textdomain__
+# define bindtextdomain bindtextdomain__
+# define bind_textdomain_codeset bind_textdomain_codeset__
+
+ How does this redirection work? There are two cases.
+ A. When libintl.a is linked into an executable, it works because
+ functions defined in the executable always override functions in
+ the shared libraries.
+ B. When libintl.so is used, it works because
+ 1. those systems defining gettext/textdomain/... in the C library
+ (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are
+ ELF systems and define these symbols as weak, thus explicitly
+ letting other shared libraries override it.
+ 2. those systems defining gettext/textdomain/... in a standalone
+ libintl.so library (namely, Solaris 2.3 and newer) have this
+ shared library in /usr/lib, and the linker will search /usr/lib
+ *after* the directory where the GNU gettext library is installed.
+
+ A third case, namely when libintl.a is linked into a shared library
+ whose name is not libintl.so, is not supported. In this case, on
+ Solaris, when -lintl precedes the linker option for the shared library
+ containing GNU gettext, the system's gettext would indeed override
+ the GNU gettext. Anyone doing this kind of stuff must be clever enough
+ to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker
+ command line. */
+
+
+#undef gettext
+#undef dgettext
+#undef dcgettext
+#undef ngettext
+#undef dngettext
+#undef dcngettext
+#undef textdomain
+#undef bindtextdomain
+#undef bind_textdomain_codeset
+
+
+/*char *
+gettext (msgid)
+ const char *msgid;
+{
+ return gettext__ (msgid);
+}*/
+
+
+char *
+dgettext (domainname, msgid)
+ const char *domainname;
+ const char *msgid;
+{
+ return dgettext__ (domainname, msgid);
+}
+
+
+char *
+dcgettext (domainname, msgid, category)
+ const char *domainname;
+ const char *msgid;
+ int category;
+{
+ return dcgettext__ (domainname, msgid, category);
+}
+
+
+char *
+ngettext (msgid1, msgid2, n)
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+{
+ return ngettext__ (msgid1, msgid2, n);
+}
+
+
+char *
+dngettext (domainname, msgid1, msgid2, n)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+{
+ return dngettext__ (domainname, msgid1, msgid2, n);
+}
+
+
+char *
+dcngettext (domainname, msgid1, msgid2, n, category)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+ int category;
+{
+ return dcngettext__ (domainname, msgid1, msgid2, n, category);
+}
+
+
+char *
+textdomain (domainname)
+ const char *domainname;
+{
+ return textdomain__ (domainname);
+}
+
+
+char *
+bindtextdomain (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ return bindtextdomain__ (domainname, dirname);
+}
+
+
+char *
+bind_textdomain_codeset (domainname, codeset)
+ const char *domainname;
+ const char *codeset;
+{
+ return bind_textdomain_codeset__ (domainname, codeset);
+}
diff --git a/setedit/gettext/l10nflist.c b/setedit/gettext/l10nflist.c
new file mode 100644
index 0000000..557253e
--- /dev/null
+++ b/setedit/gettext/l10nflist.c
@@ -0,0 +1,404 @@
+/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for stpcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined _LIBC || defined HAVE_ARGZ_H
+# include <argz.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# ifndef stpcpy
+# define stpcpy(dest, src) __stpcpy(dest, src)
+# endif
+#else
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Define function which are usually not available. */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+/* Returns the number of strings in ARGZ. */
+static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+
+static size_t
+argz_count__ (argz, len)
+ const char *argz;
+ size_t len;
+{
+ size_t count = 0;
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len + 1;
+ len -= part_len + 1;
+ count++;
+ }
+ return count;
+}
+# undef __argz_count
+# define __argz_count(argz, len) argz_count__ (argz, len)
+#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+
+static void
+argz_stringify__ (argz, len, sep)
+ char *argz;
+ size_t len;
+ int sep;
+{
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len;
+ len -= part_len + 1;
+ if (len > 0)
+ *argz++ = sep;
+ }
+}
+# undef __argz_stringify
+# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
+#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
+ const char *entry));
+
+static char *
+argz_next__ (argz, argz_len, entry)
+ char *argz;
+ size_t argz_len;
+ const char *entry;
+{
+ if (entry)
+ {
+ if (entry < argz + argz_len)
+ entry = strchr (entry, '\0') + 1;
+
+ return entry >= argz + argz_len ? NULL : (char *) entry;
+ }
+ else
+ if (argz_len > 0)
+ return argz;
+ else
+ return 0;
+}
+# undef __argz_next
+# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
+#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
+
+
+/* Return number of bits set in X. */
+static int pop PARAMS ((int x));
+
+static inline int
+pop (x)
+ int x;
+{
+ /* We assume that no more than 16 bits are used. */
+ x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+ x = ((x & ~0x3333) >> 2) + (x & 0x3333);
+ x = ((x >> 4) + x) & 0x0f0f;
+ x = ((x >> 8) + x) & 0xff;
+
+ return x;
+}
+
+
+struct loaded_l10nfile *
+_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+ territory, codeset, normalized_codeset, modifier, special,
+ sponsor, revision, filename, do_allocate)
+ struct loaded_l10nfile **l10nfile_list;
+ const char *dirlist;
+ size_t dirlist_len;
+ int mask;
+ const char *language;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *modifier;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *filename;
+ int do_allocate;
+{
+ char *abs_filename;
+ struct loaded_l10nfile *last = NULL;
+ struct loaded_l10nfile *retval;
+ char *cp;
+ size_t entries;
+ int cnt;
+
+ /* Allocate room for the full file name. */
+ abs_filename = (char *) malloc (dirlist_len
+ + strlen (language)
+ + ((mask & TERRITORY) != 0
+ ? strlen (territory) + 1 : 0)
+ + ((mask & XPG_CODESET) != 0
+ ? strlen (codeset) + 1 : 0)
+ + ((mask & XPG_NORM_CODESET) != 0
+ ? strlen (normalized_codeset) + 1 : 0)
+ + (((mask & XPG_MODIFIER) != 0
+ || (mask & CEN_AUDIENCE) != 0)
+ ? strlen (modifier) + 1 : 0)
+ + ((mask & CEN_SPECIAL) != 0
+ ? strlen (special) + 1 : 0)
+ + (((mask & CEN_SPONSOR) != 0
+ || (mask & CEN_REVISION) != 0)
+ ? (1 + ((mask & CEN_SPONSOR) != 0
+ ? strlen (sponsor) + 1 : 0)
+ + ((mask & CEN_REVISION) != 0
+ ? strlen (revision) + 1 : 0)) : 0)
+ + 1 + strlen (filename) + 1);
+
+ if (abs_filename == NULL)
+ return NULL;
+
+ retval = NULL;
+ last = NULL;
+
+ /* Construct file name. */
+ memcpy (abs_filename, dirlist, dirlist_len);
+ __argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
+ cp = abs_filename + (dirlist_len - 1);
+ *cp++ = '/';
+ cp = stpcpy (cp, language);
+
+ if ((mask & TERRITORY) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, territory);
+ }
+ if ((mask & XPG_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, codeset);
+ }
+ if ((mask & XPG_NORM_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, normalized_codeset);
+ }
+ if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
+ {
+ /* This component can be part of both syntaces but has different
+ leading characters. For CEN we use `+', else `@'. */
+ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
+ cp = stpcpy (cp, modifier);
+ }
+ if ((mask & CEN_SPECIAL) != 0)
+ {
+ *cp++ = '+';
+ cp = stpcpy (cp, special);
+ }
+ if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
+ {
+ *cp++ = ',';
+ if ((mask & CEN_SPONSOR) != 0)
+ cp = stpcpy (cp, sponsor);
+ if ((mask & CEN_REVISION) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, revision);
+ }
+ }
+
+ *cp++ = '/';
+ stpcpy (cp, filename);
+
+ /* Look in list of already loaded domains whether it is already
+ available. */
+ last = NULL;
+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+ if (retval->filename != NULL)
+ {
+ int compare = strcmp (retval->filename, abs_filename);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It's not in the list. */
+ retval = NULL;
+ break;
+ }
+
+ last = retval;
+ }
+
+ if (retval != NULL || do_allocate == 0)
+ {
+ free (abs_filename);
+ return retval;
+ }
+
+ retval = (struct loaded_l10nfile *)
+ malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
+ * (1 << pop (mask))
+ * sizeof (struct loaded_l10nfile *)));
+ if (retval == NULL)
+ return NULL;
+
+ retval->filename = abs_filename;
+ retval->decided = (__argz_count (dirlist, dirlist_len) != 1
+ || ((mask & XPG_CODESET) != 0
+ && (mask & XPG_NORM_CODESET) != 0));
+ retval->data = NULL;
+
+ if (last == NULL)
+ {
+ retval->next = *l10nfile_list;
+ *l10nfile_list = retval;
+ }
+ else
+ {
+ retval->next = last->next;
+ last->next = retval;
+ }
+
+ entries = 0;
+ /* If the DIRLIST is a real list the RETVAL entry corresponds not to
+ a real file. So we have to use the DIRLIST separation mechanism
+ of the inner loop. */
+ cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
+ for (; cnt >= 0; --cnt)
+ if ((cnt & ~mask) == 0
+ && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+ {
+ /* Iterate over all elements of the DIRLIST. */
+ char *dir = NULL;
+
+ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+ != NULL)
+ retval->successor[entries++]
+ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
+ language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+ retval->successor[entries] = NULL;
+
+ return retval;
+}
+
+/* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+ names. The return value is dynamically allocated and has to be
+ freed by the caller. */
+const char *
+_nl_normalize_codeset (codeset, name_len)
+ const char *codeset;
+ size_t name_len;
+{
+ int len = 0;
+ int only_digit = 1;
+ char *retval;
+ char *wp;
+ size_t cnt;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalnum (codeset[cnt]))
+ {
+ ++len;
+
+ if (isalpha (codeset[cnt]))
+ only_digit = 0;
+ }
+
+ retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
+
+ if (retval != NULL)
+ {
+ if (only_digit)
+ wp = stpcpy (retval, "iso");
+ else
+ wp = retval;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalpha (codeset[cnt]))
+ *wp++ = tolower (codeset[cnt]);
+ else if (isdigit (codeset[cnt]))
+ *wp++ = codeset[cnt];
+
+ *wp = '\0';
+ }
+
+ return (const char *) retval;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
diff --git a/setedit/gettext/libgettext.h b/setedit/gettext/libgettext.h
new file mode 100644
index 0000000..553382c
--- /dev/null
+++ b/setedit/gettext/libgettext.h
@@ -0,0 +1,48 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+#else
+
+# define gettext(Msgid) (Msgid)
+# define dgettext(Domainname, Msgid) (Msgid)
+# define dcgettext(Domainname, Msgid, Category) (Msgid)
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
+# define textdomain(Domainname) ((char *) (Domainname))
+# define bindtextdomain(Domainname, Dirname) ((char *) (Dirname))
+# define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset))
+
+#endif
+
+/* For automatical extraction of messages sometimes no real
+ translation is needed. Instead the string itself is the result. */
+#define gettext_noop(Str) (Str)
+
+#endif /* _LIBGETTEXT_H */
diff --git a/setedit/gettext/libgnuintl.h b/setedit/gettext/libgnuintl.h
new file mode 100644
index 0000000..ee476e4
--- /dev/null
+++ b/setedit/gettext/libgnuintl.h
@@ -0,0 +1,127 @@
+/* Message catalogs for internationalization.
+ Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H 1
+
+#include <locale.h>
+
+/* The LC_MESSAGES locale category is the category used by the functions
+ gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
+ On systems that don't define it, use an arbitrary value instead.
+ On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
+ this file!) and then only defines LC_MESSAGES. To avoid a redefinition
+ warning, don't define LC_MESSAGES in this case. */
+#if !defined LC_MESSAGES && !defined __LOCALE_H
+# define LC_MESSAGES 1729
+#endif
+
+/* We define an additional symbol to signal that we use the GNU
+ implementation of gettext. */
+#define __USE_GNU_GETTEXT 1
+
+/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
+ precedence over _conio_gettext. */
+#ifdef __DJGPP__
+/*# undef gettext*/
+/*# define gettext gettext*/
+#endif
+
+#ifndef PARAMS
+# if __STDC__ || defined __cplusplus
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text).
+extern char *gettext PARAMS ((const char *__msgid)); */
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ LC_MESSAGES locale. */
+extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+ int __category));
+
+
+/* Similar to `gettext' but select the plural form corresponding to the
+ number N. */
+extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+
+/* Similar to `dgettext' but select the plural form corresponding to the
+ number N. */
+extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
+ const char *__msgid2, unsigned long int __n));
+
+/* Similar to `dcgettext' but select the plural form corresponding to the
+ number N. */
+extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
+ const char *__msgid2, unsigned long int __n,
+ int __category));
+
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+extern char *textdomain PARAMS ((const char *__domainname));
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+extern char *bindtextdomain PARAMS ((const char *__domainname,
+ const char *__dirname));
+
+/* Specify the character encoding in which the messages from the
+ DOMAINNAME message catalog will be returned. */
+extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
+ const char *__codeset));
+
+
+/* Optimized version of the functions above. */
+#if defined __OPTIMIZED
+/* These are macros, but could also be inline functions. */
+
+# define gettext(msgid) \
+ dgettext (NULL, msgid)
+
+# define dgettext(domainname, msgid) \
+ dcgettext (domainname, msgid, LC_MESSAGES)
+
+# define ngettext(msgid1, msgid2, n) \
+ dngettext (NULL, msgid1, msgid2, n)
+
+# define dngettext(domainname, msgid1, msgid2, n) \
+ dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
+
+#endif /* Optimizing. */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libintl.h */
diff --git a/setedit/gettext/loadinfo.h b/setedit/gettext/loadinfo.h
new file mode 100644
index 0000000..5171a8f
--- /dev/null
+++ b/setedit/gettext/loadinfo.h
@@ -0,0 +1,108 @@
+/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _LOADINFO_H
+#define _LOADINFO_H 1
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+/* Tell the compiler when a conditional or integer expression is
+ almost always true or almost always false. */
+#ifndef HAVE_BUILTIN_EXPECT
+# define __builtin_expect(expr, val) (expr)
+#endif
+
+/* Separator in PATH like lists of pathnames. */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define PATH_SEPARATOR ';'
+#else
+ /* Unix */
+# define PATH_SEPARATOR ':'
+#endif
+
+/* Encoding of locale name parts. */
+#define CEN_REVISION 1
+#define CEN_SPONSOR 2
+#define CEN_SPECIAL 4
+#define XPG_NORM_CODESET 8
+#define XPG_CODESET 16
+#define TERRITORY 32
+#define CEN_AUDIENCE 64
+#define XPG_MODIFIER 128
+
+#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
+#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
+
+
+struct loaded_l10nfile
+{
+ const char *filename;
+ int decided;
+
+ const void *data;
+
+ struct loaded_l10nfile *next;
+ struct loaded_l10nfile *successor[1];
+};
+
+
+/* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+ names. The return value is dynamically allocated and has to be
+ freed by the caller. */
+extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
+ size_t name_len));
+
+extern struct loaded_l10nfile *
+_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+ const char *dirlist, size_t dirlist_len, int mask,
+ const char *language, const char *territory,
+ const char *codeset,
+ const char *normalized_codeset,
+ const char *modifier, const char *special,
+ const char *sponsor, const char *revision,
+ const char *filename, int do_allocate));
+
+
+extern const char *_nl_expand_alias PARAMS ((const char *name));
+
+/* normalized_codeset is dynamically allocated and has to be freed by
+ the caller. */
+extern int _nl_explode_name PARAMS ((char *name, const char **language,
+ const char **modifier,
+ const char **territory,
+ const char **codeset,
+ const char **normalized_codeset,
+ const char **special,
+ const char **sponsor,
+ const char **revision));
+
+extern char *_nl_find_language PARAMS ((const char *name));
+
+#endif /* loadinfo.h */
diff --git a/setedit/gettext/loadmsgcat.c b/setedit/gettext/loadmsgcat.c
new file mode 100644
index 0000000..d589243
--- /dev/null
+++ b/setedit/gettext/loadmsgcat.c
@@ -0,0 +1,566 @@
+/* Load needed message catalogs.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#ifdef _LIBC
+# include <langinfo.h>
+# include <locale.h>
+#endif
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || (defined _LIBC && defined _POSIX_MAPPED_FILES)
+# include <sys/mman.h>
+# undef HAVE_MMAP
+# define HAVE_MMAP 1
+#else
+# undef HAVE_MMAP
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+#ifdef _LIBC
+# include "../locale/localeinfo.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ISO C functions. This is required by the standard
+ because some ISO C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define open __open
+# define close __close
+# define read __read
+# define mmap __mmap
+# define munmap __munmap
+#endif
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define PLURAL_PARSE __gettextparse
+#else
+# define PLURAL_PARSE gettextparse__
+#endif
+
+/* For those losing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+# define freea(p) /* nothing */
+#else
+# define alloca(n) malloc (n)
+# define freea(p) free (p)
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in <fcntl.h>. */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+#ifdef __BEOS__
+ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+/* On reasonable systems, binary I/O is the default. */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+/* We need a sign, whether a new catalog was loaded, which can be associated
+ with all translations. This is important if the translations are
+ cached by one of GCC's features. */
+int _nl_msg_cat_cntr;
+
+#if (defined __GNUC__ && !defined __APPLE_CC__) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+
+/* These structs are the constant expression for the germanic plural
+ form determination. It represents the expression "n != 1". */
+static const struct expression plvar =
+{
+ .nargs = 0,
+ .operation = var,
+};
+static const struct expression plone =
+{
+ .nargs = 0,
+ .operation = num,
+ .val =
+ {
+ .num = 1
+ }
+};
+static struct expression germanic_plural =
+{
+ .nargs = 2,
+ .operation = not_equal,
+ .val =
+ {
+ .args =
+ {
+ [0] = (struct expression *) &plvar,
+ [1] = (struct expression *) &plone
+ }
+ }
+};
+
+# define INIT_GERMANIC_PLURAL()
+
+#else
+
+/* For compilers without support for ISO C 99 struct/union initializers:
+ Initialization at run-time. */
+
+static struct expression plvar;
+static struct expression plone;
+static struct expression germanic_plural;
+
+static void
+init_germanic_plural ()
+{
+ if (plone.val.num == 0)
+ {
+ plvar.nargs = 0;
+ plvar.operation = var;
+
+ plone.nargs = 0;
+ plone.operation = num;
+ plone.val.num = 1;
+
+ germanic_plural.nargs = 2;
+ germanic_plural.operation = not_equal;
+ germanic_plural.val.args[0] = &plvar;
+ germanic_plural.val.args[1] = &plone;
+ }
+}
+
+# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
+
+#endif
+
+
+/* Initialize the codeset dependent parts of an opened message catalog.
+ Return the header entry. */
+const char *
+internal_function
+_nl_init_domain_conv (domain_file, domain, domainbinding)
+ struct loaded_l10nfile *domain_file;
+ struct loaded_domain *domain;
+ struct binding *domainbinding;
+{
+ /* Find out about the character set the file is encoded with.
+ This can be found (in textual form) in the entry "". If this
+ entry does not exist or if this does not contain the `charset='
+ information, we will assume the charset matches the one the
+ current locale and we don't have to perform any conversion. */
+ char *nullentry;
+ size_t nullentrylen;
+
+ /* Preinitialize fields, to avoid recursion during _nl_find_msg. */
+ domain->codeset_cntr =
+ (domainbinding != NULL ? domainbinding->codeset_cntr : 0);
+#ifdef _LIBC
+ domain->conv = (__gconv_t) -1;
+#else
+# if HAVE_ICONV
+ domain->conv = (iconv_t) -1;
+# endif
+#endif
+ domain->conv_tab = NULL;
+
+ /* Get the header entry. */
+ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
+
+ if (nullentry != NULL)
+ {
+#if defined _LIBC || HAVE_ICONV
+ const char *charsetstr;
+
+ charsetstr = strstr (nullentry, "charset=");
+ if (charsetstr != NULL)
+ {
+ size_t len;
+ char *charset;
+ const char *outcharset;
+
+ charsetstr += strlen ("charset=");
+ len = strcspn (charsetstr, " \t\n");
+
+ charset = (char *) alloca (len + 1);
+# if defined _LIBC || HAVE_MEMPCPY
+ *((char *) mempcpy (charset, charsetstr, len)) = '\0';
+# else
+ memcpy (charset, charsetstr, len);
+ charset[len] = '\0';
+# endif
+
+ /* The output charset should normally be determined by the
+ locale. But sometimes the locale is not used or not correctly
+ set up, so we provide a possibility for the user to override
+ this. Moreover, the value specified through
+ bind_textdomain_codeset overrides both. */
+ if (domainbinding != NULL && domainbinding->codeset != NULL)
+ outcharset = domainbinding->codeset;
+ else
+ {
+ outcharset = getenv ("OUTPUT_CHARSET");
+ if (outcharset == NULL || outcharset[0] == '\0')
+ {
+# ifdef _LIBC
+ outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
+# else
+# if HAVE_ICONV
+ extern const char *locale_charset (void);
+ outcharset = locale_charset ();
+# endif
+# endif
+ }
+ }
+
+# ifdef _LIBC
+ /* We always want to use transliteration. */
+ outcharset = norm_add_slashes (outcharset, "TRANSLIT");
+ charset = norm_add_slashes (charset, NULL);
+ if (__gconv_open (outcharset, charset, &domain->conv,
+ GCONV_AVOID_NOCONV)
+ != __GCONV_OK)
+ domain->conv = (__gconv_t) -1;
+# else
+# if HAVE_ICONV
+ /* When using GNU libiconv, we want to use transliteration. */
+# if _LIBICONV_VERSION >= 0x0105
+ len = strlen (outcharset);
+ {
+ char *tmp = (char *) alloca (len + 10 + 1);
+ memcpy (tmp, outcharset, len);
+ memcpy (tmp + len, "//TRANSLIT", 10 + 1);
+ outcharset = tmp;
+ }
+# endif
+ domain->conv = iconv_open (outcharset, charset);
+# if _LIBICONV_VERSION >= 0x0105
+ freea (outcharset);
+# endif
+# endif
+# endif
+
+ freea (charset);
+ }
+#endif /* _LIBC || HAVE_ICONV */
+ }
+
+ return nullentry;
+}
+
+/* Frees the codeset dependent parts of an opened message catalog. */
+void
+internal_function
+_nl_free_domain_conv (domain)
+ struct loaded_domain *domain;
+{
+ if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
+ free (domain->conv_tab);
+
+#ifdef _LIBC
+ if (domain->conv != (__gconv_t) -1)
+ __gconv_close (domain->conv);
+#else
+# if HAVE_ICONV
+ if (domain->conv != (iconv_t) -1)
+ iconv_close (domain->conv);
+# endif
+#endif
+}
+
+/* Load the message catalogs specified by FILENAME. If it is no valid
+ message catalog do nothing. */
+void
+internal_function
+_nl_load_domain (domain_file, domainbinding)
+ struct loaded_l10nfile *domain_file;
+ struct binding *domainbinding;
+{
+ int fd;
+ size_t size;
+#ifdef _LIBC
+ struct stat64 st;
+#else
+ struct stat st;
+#endif
+ struct mo_file_header *data = (struct mo_file_header *) -1;
+ int use_mmap = 0;
+ struct loaded_domain *domain;
+ const char *nullentry;
+
+ domain_file->decided = 1;
+ domain_file->data = NULL;
+
+ /* Note that it would be useless to store domainbinding in domain_file
+ because domainbinding might be == NULL now but != NULL later (after
+ a call to bind_textdomain_codeset). */
+
+ /* If the record does not represent a valid locale the FILENAME
+ might be NULL. This can happen when according to the given
+ specification the locale file name is different for XPG and CEN
+ syntax. */
+ if (domain_file->filename == NULL)
+ return;
+
+ /* Try to open the addressed file. */
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+ if (fd == -1)
+ return;
+
+ /* We must know about the size of the file. */
+ if (
+#ifdef _LIBC
+ __builtin_expect (fstat64 (fd, &st) != 0, 0)
+#else
+ __builtin_expect (fstat (fd, &st) != 0, 0)
+#endif
+ || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
+ || __builtin_expect (size < sizeof (struct mo_file_header), 0))
+ {
+ /* Something went wrong. */
+ close (fd);
+ return;
+ }
+
+#ifdef HAVE_MMAP
+ /* Now we are ready to load the file. If mmap() is available we try
+ this first. If not available or it failed we try to load it. */
+ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
+ MAP_PRIVATE, fd, 0);
+
+ if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
+ {
+ /* mmap() call was successful. */
+ close (fd);
+ use_mmap = 1;
+ }
+#endif
+
+ /* If the data is not yet available (i.e. mmap'ed) we try to load
+ it manually. */
+ if (data == (struct mo_file_header *) -1)
+ {
+ size_t to_read;
+ char *read_ptr;
+
+ data = (struct mo_file_header *) malloc (size);
+ if (data == NULL)
+ return;
+
+ to_read = size;
+ read_ptr = (char *) data;
+ do
+ {
+ long int nb = (long int) read (fd, read_ptr, to_read);
+ if (nb <= 0)
+ {
+#ifdef EINTR
+ if (nb == -1 && errno == EINTR)
+ continue;
+#endif
+ close (fd);
+ return;
+ }
+ read_ptr += nb;
+ to_read -= nb;
+ }
+ while (to_read > 0);
+
+ close (fd);
+ }
+
+ /* Using the magic number we can test whether it really is a message
+ catalog file. */
+ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
+ 0))
+ {
+ /* The magic number is wrong: not a message catalog file. */
+#ifdef HAVE_MMAP
+ if (use_mmap)
+ munmap ((caddr_t) data, size);
+ else
+#endif
+ free (data);
+ return;
+ }
+
+ domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+ if (domain == NULL)
+ return;
+ domain_file->data = domain;
+
+ domain->data = (char *) data;
+ domain->use_mmap = use_mmap;
+ domain->mmap_size = size;
+ domain->must_swap = data->magic != _MAGIC;
+
+ /* Fill in the information about the available tables. */
+ switch (W (domain->must_swap, data->revision))
+ {
+ case 0:
+ domain->nstrings = W (domain->must_swap, data->nstrings);
+ domain->orig_tab = (struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->orig_tab_offset));
+ domain->trans_tab = (struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->trans_tab_offset));
+ domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+ domain->hash_tab = (nls_uint32 *)
+ ((char *) data + W (domain->must_swap, data->hash_tab_offset));
+ break;
+ default:
+ /* This is an invalid revision. */
+#ifdef HAVE_MMAP
+ if (use_mmap)
+ munmap ((caddr_t) data, size);
+ else
+#endif
+ free (data);
+ free (domain);
+ domain_file->data = NULL;
+ return;
+ }
+
+ /* Now initialize the character set converter from the character set
+ the file is encoded with (found in the header entry) to the domain's
+ specified character set or the locale's character set. */
+ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
+
+ /* Also look for a plural specification. */
+ if (nullentry != NULL)
+ {
+ const char *plural;
+ const char *nplurals;
+
+ plural = strstr (nullentry, "plural=");
+ nplurals = strstr (nullentry, "nplurals=");
+ if (plural == NULL || nplurals == NULL)
+ goto no_plural;
+ else
+ {
+ /* First get the number. */
+ char *endp;
+ unsigned long int n;
+ struct parse_args args;
+
+ nplurals += 9;
+ while (*nplurals != '\0' && isspace (*nplurals))
+ ++nplurals;
+#if defined HAVE_STRTOUL || defined _LIBC
+ n = strtoul (nplurals, &endp, 10);
+#else
+ for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
+ n = n * 10 + (*endp - '0');
+#endif
+ domain->nplurals = n;
+ if (nplurals == endp)
+ goto no_plural;
+
+ /* Due to the restrictions bison imposes onto the interface of the
+ scanner function we have to put the input string and the result
+ passed up from the parser into the same structure which address
+ is passed down to the parser. */
+ plural += 7;
+ args.cp = plural;
+ if (PLURAL_PARSE (&args) != 0)
+ goto no_plural;
+ domain->plural = args.res;
+ }
+ }
+ else
+ {
+ /* By default we are using the Germanic form: singular form only
+ for `one', the plural form otherwise. Yes, this is also what
+ English is using since English is a Germanic language. */
+ no_plural:
+ INIT_GERMANIC_PLURAL ();
+ domain->plural = &germanic_plural;
+ domain->nplurals = 2;
+ }
+}
+
+
+#ifdef _LIBC
+void
+internal_function
+_nl_unload_domain (domain)
+ struct loaded_domain *domain;
+{
+ if (domain->plural != &germanic_plural)
+ __gettext_free_exp (domain->plural);
+
+ _nl_free_domain_conv (domain);
+
+# ifdef _POSIX_MAPPED_FILES
+ if (domain->use_mmap)
+ munmap ((caddr_t) domain->data, domain->mmap_size);
+ else
+# endif /* _POSIX_MAPPED_FILES */
+ free ((void *) domain->data);
+
+ free (domain);
+}
+#endif
diff --git a/setedit/gettext/localcharset.c b/setedit/gettext/localcharset.c
new file mode 100644
index 0000000..61f8f3e
--- /dev/null
+++ b/setedit/gettext/localcharset.c
@@ -0,0 +1,271 @@
+/* Determine a canonical name for the current locale's character encoding.
+
+ Copyright (C) 2000-2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* Written by Bruno Haible <haible@clisp.cons.org>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if HAVE_STDDEF_H
+# include <stddef.h>
+#endif
+
+#include <stdio.h>
+#if HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# undef WIN32 /* avoid warning on mingw32 */
+# define WIN32
+#endif
+
+#ifndef WIN32
+# if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+# else
+# if HAVE_SETLOCALE
+# include <locale.h>
+# endif
+# endif
+#else /* WIN32 */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
+#endif
+
+/* The following static variable is declared 'volatile' to avoid a
+ possible multithread problem in the function get_charset_aliases. If we
+ are running in a threaded environment, and if two threads initialize
+ 'charset_aliases' simultaneously, both will produce the same value,
+ and everything will be ok if the two assignments to 'charset_aliases'
+ are atomic. But I don't know what will happen if the two assignments mix. */
+#if __STDC__ != 1
+# define volatile /* empty */
+#endif
+/* Pointer to the contents of the charset.alias file, if it has already been
+ read, else NULL. Its format is:
+ ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
+static const char * volatile charset_aliases;
+
+/* Return a pointer to the contents of the charset.alias file. */
+static const char *
+get_charset_aliases ()
+{
+ const char *cp;
+
+ cp = charset_aliases;
+ if (cp == NULL)
+ {
+#ifndef WIN32
+ FILE *fp;
+ const char *dir = LIBDIR;
+ const char *base = "charset.alias";
+ char *file_name;
+
+ /* Concatenate dir and base into freshly allocated file_name. */
+ {
+ size_t dir_len = strlen (dir);
+ size_t base_len = strlen (base);
+ int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+ file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+ if (file_name != NULL)
+ {
+ memcpy (file_name, dir, dir_len);
+ if (add_slash)
+ file_name[dir_len] = DIRECTORY_SEPARATOR;
+ memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+ }
+ }
+
+ if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
+ /* Out of memory or file not found, treat it as empty. */
+ cp = "";
+ else
+ {
+ /* Parse the file's contents. */
+ int c;
+ char buf1[50+1];
+ char buf2[50+1];
+ char *res_ptr = NULL;
+ size_t res_size = 0;
+ size_t l1, l2;
+
+ for (;;)
+ {
+ c = getc (fp);
+ if (c == EOF)
+ break;
+ if (c == '\n' || c == ' ' || c == '\t')
+ continue;
+ if (c == '#')
+ {
+ /* Skip comment, to end of line. */
+ do
+ c = getc (fp);
+ while (!(c == EOF || c == '\n'));
+ if (c == EOF)
+ break;
+ continue;
+ }
+ ungetc (c, fp);
+ if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
+ break;
+ l1 = strlen (buf1);
+ l2 = strlen (buf2);
+ if (res_size == 0)
+ {
+ res_size = l1 + 1 + l2 + 1;
+ res_ptr = malloc (res_size + 1);
+ }
+ else
+ {
+ res_size += l1 + 1 + l2 + 1;
+ res_ptr = realloc (res_ptr, res_size + 1);
+ }
+ if (res_ptr == NULL)
+ {
+ /* Out of memory. */
+ res_size = 0;
+ break;
+ }
+ strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+ strcpy (res_ptr + res_size - (l2 + 1), buf2);
+ }
+ fclose (fp);
+ if (res_size == 0)
+ cp = "";
+ else
+ {
+ *(res_ptr + res_size) = '\0';
+ cp = res_ptr;
+ }
+ }
+
+ if (file_name != NULL)
+ free (file_name);
+
+#else /* WIN32 */
+
+ /* To avoid the troubles of installing a separate file in the same
+ directory as the DLL and of retrieving the DLL's directory at
+ runtime, simply inline the aliases here. */
+
+ cp = "CP936" "\0" "GBK" "\0"
+ "CP1361" "\0" "JOHAB" "\0";
+#endif
+
+ charset_aliases = cp;
+ }
+
+ return cp;
+}
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed in config.charset.
+ The result must not be freed; it is statically allocated.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+
+#ifdef STATIC
+STATIC
+#endif
+const char *
+locale_charset ()
+{
+ const char *codeset;
+ const char *aliases;
+
+#ifndef WIN32
+
+# if HAVE_LANGINFO_CODESET
+
+ /* Most systems support nl_langinfo (CODESET) nowadays. */
+ codeset = nl_langinfo (CODESET);
+
+# else
+
+ /* On old systems which lack it, use setlocale or getenv. */
+ const char *locale = NULL;
+
+ /* But most old systems don't have a complete set of locales. Some
+ (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
+ use setlocale here; it would return "C" when it doesn't support the
+ locale name the user has set. */
+# if HAVE_SETLOCALE && 0
+ locale = setlocale (LC_CTYPE, NULL);
+# endif
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ }
+
+ /* On some old systems, one used to set locale = "iso8859_1". On others,
+ you set it to "language_COUNTRY.charset". In any case, we resolve it
+ through the charset.alias file. */
+ codeset = locale;
+
+# endif
+
+#else /* WIN32 */
+
+ static char buf[2 + 10 + 1];
+
+ /* Win32 has a function returning the locale's codepage as a number. */
+ sprintf (buf, "CP%u", GetACP ());
+ codeset = buf;
+
+#endif
+
+ if (codeset == NULL)
+ /* The canonical name cannot be determined. */
+ codeset = "";
+
+ /* Resolve alias. */
+ for (aliases = get_charset_aliases ();
+ *aliases != '\0';
+ aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
+ if (strcmp (codeset, aliases) == 0
+ || (aliases[0] == '*' && aliases[1] == '\0'))
+ {
+ codeset = aliases + strlen (aliases) + 1;
+ break;
+ }
+
+ return codeset;
+}
diff --git a/setedit/gettext/localealias.c b/setedit/gettext/localealias.c
new file mode 100644
index 0000000..76f19a9
--- /dev/null
+++ b/setedit/gettext/localealias.c
@@ -0,0 +1,403 @@
+/* Handle aliases for locale names.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#include <stdlib.h>
+
+#include <string.h>
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define strcasecmp __strcasecmp
+
+# ifndef mempcpy
+# define mempcpy __mempcpy
+# endif
+# define HAVE_MEMPCPY 1
+
+/* We need locking here since we can be called from different places. */
+# include <bits/libc-lock.h>
+
+__libc_lock_define_initialized (static, lock);
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+/* For those losing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+# define freea(p) /* nothing */
+#else
+# define alloca(n) malloc (n)
+# define freea(p) free (p)
+#endif
+
+#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED
+# undef fgets
+# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
+#endif
+#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED
+# undef feof
+# define feof(s) feof_unlocked (s)
+#endif
+
+
+struct alias_map
+{
+ const char *alias;
+ const char *value;
+};
+
+
+static char *string_space;
+static size_t string_space_act;
+static size_t string_space_max;
+static struct alias_map *map;
+static size_t nmap;
+static size_t maxmap;
+
+
+/* Prototypes for local functions. */
+static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
+ internal_function;
+static int extend_alias_table PARAMS ((void));
+static int alias_compare PARAMS ((const struct alias_map *map1,
+ const struct alias_map *map2));
+
+
+const char *
+_nl_expand_alias (name)
+ const char *name;
+{
+ static const char *locale_alias_path = LOCALE_ALIAS_PATH;
+ struct alias_map *retval;
+ const char *result = NULL;
+ size_t added;
+
+#ifdef _LIBC
+ __libc_lock_lock (lock);
+#endif
+
+ do
+ {
+ struct alias_map item;
+
+ item.alias = name;
+
+ if (nmap > 0)
+ retval = (struct alias_map *) bsearch (&item, map, nmap,
+ sizeof (struct alias_map),
+ (int (*) PARAMS ((const void *,
+ const void *))
+ ) alias_compare);
+ else
+ retval = NULL;
+
+ /* We really found an alias. Return the value. */
+ if (retval != NULL)
+ {
+ result = retval->value;
+ break;
+ }
+
+ /* Perhaps we can find another alias file. */
+ added = 0;
+ while (added == 0 && locale_alias_path[0] != '\0')
+ {
+ const char *start;
+
+ while (locale_alias_path[0] == PATH_SEPARATOR)
+ ++locale_alias_path;
+ start = locale_alias_path;
+
+ while (locale_alias_path[0] != '\0'
+ && locale_alias_path[0] != PATH_SEPARATOR)
+ ++locale_alias_path;
+
+ if (start < locale_alias_path)
+ added = read_alias_file (start, locale_alias_path - start);
+ }
+ }
+ while (added != 0);
+
+#ifdef _LIBC
+ __libc_lock_unlock (lock);
+#endif
+
+ return result;
+}
+
+
+static size_t
+internal_function
+read_alias_file (fname, fname_len)
+ const char *fname;
+ int fname_len;
+{
+ FILE *fp;
+ char *full_fname;
+ size_t added;
+ static const char aliasfile[] = "/locale.alias";
+
+ full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+#ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (full_fname, fname, fname_len),
+ aliasfile, sizeof aliasfile);
+#else
+ memcpy (full_fname, fname, fname_len);
+ memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
+#endif
+
+ fp = fopen (full_fname, "r");
+ freea (full_fname);
+ if (fp == NULL)
+ return 0;
+
+ added = 0;
+ while (!feof (fp))
+ {
+ /* It is a reasonable approach to use a fix buffer here because
+ a) we are only interested in the first two fields
+ b) these fields must be usable as file names and so must not
+ be that long
+ */
+ char buf[BUFSIZ];
+ char *alias;
+ char *value;
+ char *cp;
+
+ if (fgets (buf, sizeof buf, fp) == NULL)
+ /* EOF reached. */
+ break;
+
+ /* Possibly not the whole line fits into the buffer. Ignore
+ the rest of the line. */
+ if (strchr (buf, '\n') == NULL)
+ {
+ char altbuf[BUFSIZ];
+ do
+ if (fgets (altbuf, sizeof altbuf, fp) == NULL)
+ /* Make sure the inner loop will be left. The outer loop
+ will exit at the `feof' test. */
+ break;
+ while (strchr (altbuf, '\n') == NULL);
+ }
+
+ cp = buf;
+ /* Ignore leading white space. */
+ while (isspace (cp[0]))
+ ++cp;
+
+ /* A leading '#' signals a comment line. */
+ if (cp[0] != '\0' && cp[0] != '#')
+ {
+ alias = cp++;
+ while (cp[0] != '\0' && !isspace (cp[0]))
+ ++cp;
+ /* Terminate alias name. */
+ if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ /* Now look for the beginning of the value. */
+ while (isspace (cp[0]))
+ ++cp;
+
+ if (cp[0] != '\0')
+ {
+ size_t alias_len;
+ size_t value_len;
+
+ value = cp++;
+ while (cp[0] != '\0' && !isspace (cp[0]))
+ ++cp;
+ /* Terminate value. */
+ if (cp[0] == '\n')
+ {
+ /* This has to be done to make the following test
+ for the end of line possible. We are looking for
+ the terminating '\n' which do not overwrite here. */
+ *cp++ = '\0';
+ *cp = '\n';
+ }
+ else if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ if (nmap >= maxmap)
+ if (__builtin_expect (extend_alias_table (), 0))
+ return added;
+
+ alias_len = strlen (alias) + 1;
+ value_len = strlen (value) + 1;
+
+ if (string_space_act + alias_len + value_len > string_space_max)
+ {
+ /* Increase size of memory pool. */
+ size_t new_size = (string_space_max
+ + (alias_len + value_len > 1024
+ ? alias_len + value_len : 1024));
+ char *new_pool = (char *) realloc (string_space, new_size);
+ if (new_pool == NULL)
+ return added;
+
+ if (__builtin_expect (string_space != new_pool, 0))
+ {
+ size_t i;
+
+ for (i = 0; i < nmap; i++)
+ {
+ map[i].alias += new_pool - string_space;
+ map[i].value += new_pool - string_space;
+ }
+ }
+
+ string_space = new_pool;
+ string_space_max = new_size;
+ }
+
+ map[nmap].alias = memcpy (&string_space[string_space_act],
+ alias, alias_len);
+ string_space_act += alias_len;
+
+ map[nmap].value = memcpy (&string_space[string_space_act],
+ value, value_len);
+ string_space_act += value_len;
+
+ ++nmap;
+ ++added;
+ }
+ }
+ }
+
+ /* Should we test for ferror()? I think we have to silently ignore
+ errors. --drepper */
+ fclose (fp);
+
+ if (added > 0)
+ qsort (map, nmap, sizeof (struct alias_map),
+ (int (*) PARAMS ((const void *, const void *))) alias_compare);
+
+ return added;
+}
+
+
+static int
+extend_alias_table ()
+{
+ size_t new_size;
+ struct alias_map *new_map;
+
+ new_size = maxmap == 0 ? 100 : 2 * maxmap;
+ new_map = (struct alias_map *) realloc (map, (new_size
+ * sizeof (struct alias_map)));
+ if (new_map == NULL)
+ /* Simply don't extend: we don't have any more core. */
+ return -1;
+
+ map = new_map;
+ maxmap = new_size;
+ return 0;
+}
+
+
+#ifdef _LIBC
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ if (string_space != NULL)
+ free (string_space);
+ if (map != NULL)
+ free (map);
+}
+text_set_element (__libc_subfreeres, free_mem);
+#endif
+
+
+static int
+alias_compare (map1, map2)
+ const struct alias_map *map1;
+ const struct alias_map *map2;
+{
+#if defined _LIBC || defined HAVE_STRCASECMP
+ return strcasecmp (map1->alias, map2->alias);
+#else
+ const unsigned char *p1 = (const unsigned char *) map1->alias;
+ const unsigned char *p2 = (const unsigned char *) map2->alias;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ /* I know this seems to be odd but the tolower() function in
+ some systems libc cannot handle nonalpha characters. */
+ c1 = isupper (*p1) ? tolower (*p1) : *p1;
+ c2 = isupper (*p2) ? tolower (*p2) : *p2;
+ if (c1 == '\0')
+ break;
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ return c1 - c2;
+#endif
+}
diff --git a/setedit/gettext/ngettext.c b/setedit/gettext/ngettext.c
new file mode 100644
index 0000000..8b1fa02
--- /dev/null
+++ b/setedit/gettext/ngettext.c
@@ -0,0 +1,67 @@
+/* Implementation of ngettext(3) function.
+ Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <stdlib.h> /* Just for NULL. */
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+#include <locale.h>
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define NGETTEXT __ngettext
+# define DCNGETTEXT __dcngettext
+#else
+# define NGETTEXT ngettext__
+# define DCNGETTEXT dcngettext__
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+char *
+NGETTEXT (msgid1, msgid2, n)
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+{
+ return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__ngettext, ngettext);
+#endif
diff --git a/setedit/gettext/plural.c b/setedit/gettext/plural.c
new file mode 100644
index 0000000..8191335
--- /dev/null
+++ b/setedit/gettext/plural.c
@@ -0,0 +1,1325 @@
+
+/* A Bison parser, made from plural.y
+ by GNU Bison version 1.28 */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define yyparse __gettextparse
+#define yylex __gettextlex
+#define yyerror __gettexterror
+#define yylval __gettextlval
+#define yychar __gettextchar
+#define yydebug __gettextdebug
+#define yynerrs __gettextnerrs
+#define EQUOP2 257
+#define CMPOP2 258
+#define ADDOP2 259
+#define MULOP2 260
+#define NUMBER 261
+
+#line 1 "plural.y"
+
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* The bison generated parser uses alloca. AIX 3 forces us to put this
+ declaration at the beginning of the file. The declaration in bison's
+ skeleton file comes too late. This must come before <config.h>
+ because <config.h> may include arbitrary system headers. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include "gettextP.h"
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define FREE_EXPRESSION __gettext_free_exp
+#else
+# define FREE_EXPRESSION gettext_free_exp__
+# define __gettextparse gettextparse__
+#endif
+
+#define YYLEX_PARAM &((struct parse_args *) arg)->cp
+#define YYPARSE_PARAM arg
+
+#line 52 "plural.y"
+typedef union {
+ unsigned long int num;
+ enum operator op;
+ struct expression *exp;
+} YYSTYPE;
+#line 58 "plural.y"
+
+/* Prototypes for local functions. */
+static struct expression *new_exp PARAMS ((int nargs, enum operator op,
+ struct expression * const *args));
+static inline struct expression *new_exp_0 PARAMS ((enum operator op));
+static inline struct expression *new_exp_1 PARAMS ((enum operator op,
+ struct expression *right));
+static struct expression *new_exp_2 PARAMS ((enum operator op,
+ struct expression *left,
+ struct expression *right));
+static inline struct expression *new_exp_3 PARAMS ((enum operator op,
+ struct expression *bexp,
+ struct expression *tbranch,
+ struct expression *fbranch));
+static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
+static void yyerror PARAMS ((const char *str));
+
+/* Allocation of expressions. */
+
+static struct expression *
+new_exp (nargs, op, args)
+ int nargs;
+ enum operator op;
+ struct expression * const *args;
+{
+ int i;
+ struct expression *newp;
+
+ /* If any of the argument could not be malloc'ed, just return NULL. */
+ for (i = nargs - 1; i >= 0; i--)
+ if (args[i] == NULL)
+ goto fail;
+
+ /* Allocate a new expression. */
+ newp = (struct expression *) malloc (sizeof (*newp));
+ if (newp != NULL)
+ {
+ newp->nargs = nargs;
+ newp->operation = op;
+ for (i = nargs - 1; i >= 0; i--)
+ newp->val.args[i] = args[i];
+ return newp;
+ }
+
+ fail:
+ for (i = nargs - 1; i >= 0; i--)
+ FREE_EXPRESSION (args[i]);
+
+ return NULL;
+}
+
+static inline struct expression *
+new_exp_0 (op)
+ enum operator op;
+{
+ return new_exp (0, op, NULL);
+}
+
+static inline struct expression *
+new_exp_1 (op, right)
+ enum operator op;
+ struct expression *right;
+{
+ struct expression *args[1];
+
+ args[0] = right;
+ return new_exp (1, op, args);
+}
+
+static struct expression *
+new_exp_2 (op, left, right)
+ enum operator op;
+ struct expression *left;
+ struct expression *right;
+{
+ struct expression *args[2];
+
+ args[0] = left;
+ args[1] = right;
+ return new_exp (2, op, args);
+}
+
+static inline struct expression *
+new_exp_3 (op, bexp, tbranch, fbranch)
+ enum operator op;
+ struct expression *bexp;
+ struct expression *tbranch;
+ struct expression *fbranch;
+{
+ struct expression *args[3];
+
+ args[0] = bexp;
+ args[1] = tbranch;
+ args[2] = fbranch;
+ return new_exp (3, op, args);
+}
+
+#include <stdio.h>
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define YYFINAL 27
+#define YYFLAG -32768
+#define YYNTBASE 16
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
+
+static const char yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 10, 2, 2, 2, 2, 5, 2, 14,
+ 15, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 12, 2, 2,
+ 2, 2, 3, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 13,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 4, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 6, 7, 8, 9,
+ 11
+};
+
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 8, 12, 16, 20, 24, 28, 32, 35,
+ 37, 39
+};
+
+static const short yyrhs[] = { 17,
+ 0, 17, 3, 17, 12, 17, 0, 17, 4, 17,
+ 0, 17, 5, 17, 0, 17, 6, 17, 0, 17,
+ 7, 17, 0, 17, 8, 17, 0, 17, 9, 17,
+ 0, 10, 17, 0, 13, 0, 11, 0, 14, 17,
+ 15, 0
+};
+
+#endif
+
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 177, 185, 189, 193, 197, 201, 205, 209, 213, 217,
+ 221, 226
+};
+#endif
+
+
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","'?'","'|'",
+"'&'","EQUOP2","CMPOP2","ADDOP2","MULOP2","'!'","NUMBER","':'","'n'","'('","')'",
+"start","exp", NULL
+};
+#endif
+
+static const short yyr1[] = { 0,
+ 16, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17
+};
+
+static const short yyr2[] = { 0,
+ 1, 5, 3, 3, 3, 3, 3, 3, 2, 1,
+ 1, 3
+};
+
+static const short yydefact[] = { 0,
+ 0, 11, 10, 0, 1, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 12, 0, 3, 4, 5, 6,
+ 7, 8, 0, 2, 0, 0, 0
+};
+
+static const short yydefgoto[] = { 25,
+ 5
+};
+
+static const short yypact[] = { -9,
+ -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9,
+ -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26,
+ -3,-32768, -9, 34, 21, 53,-32768
+};
+
+static const short yypgoto[] = {-32768,
+ -1
+};
+
+
+#define YYLAST 53
+
+
+static const short yytable[] = { 6,
+ 1, 2, 7, 3, 4, 14, 16, 17, 18, 19,
+ 20, 21, 22, 8, 9, 10, 11, 12, 13, 14,
+ 26, 24, 12, 13, 14, 15, 8, 9, 10, 11,
+ 12, 13, 14, 13, 14, 23, 8, 9, 10, 11,
+ 12, 13, 14, 10, 11, 12, 13, 14, 11, 12,
+ 13, 14, 27
+};
+
+static const short yycheck[] = { 1,
+ 10, 11, 4, 13, 14, 9, 8, 9, 10, 11,
+ 12, 13, 14, 3, 4, 5, 6, 7, 8, 9,
+ 0, 23, 7, 8, 9, 15, 3, 4, 5, 6,
+ 7, 8, 9, 8, 9, 12, 3, 4, 5, 6,
+ 7, 8, 9, 5, 6, 7, 8, 9, 6, 7,
+ 8, 9, 0
+};
+#define YYPURE 1
+
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"
+/* This file comes from bison-1.28. */
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
+#include <alloca.h>
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include <malloc.h>
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval, &yylloc)
+#endif
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
+#endif
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, unsigned int count)
+{
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+#line 217 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
+int yyparse (void);
+#endif
+#endif
+
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 1:
+#line 178 "plural.y"
+{
+ if (yyvsp[0].exp == NULL)
+ YYABORT;
+ ((struct parse_args *) arg)->res = yyvsp[0].exp;
+ ;
+ break;}
+case 2:
+#line 186 "plural.y"
+{
+ yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 3:
+#line 190 "plural.y"
+{
+ yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 4:
+#line 194 "plural.y"
+{
+ yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 5:
+#line 198 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 6:
+#line 202 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 7:
+#line 206 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 8:
+#line 210 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 9:
+#line 214 "plural.y"
+{
+ yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
+ ;
+ break;}
+case 10:
+#line 218 "plural.y"
+{
+ yyval.exp = new_exp_0 (var);
+ ;
+ break;}
+case 11:
+#line 222 "plural.y"
+{
+ if ((yyval.exp = new_exp_0 (num)) != NULL)
+ yyval.exp->val.num = yyvsp[0].num;
+ ;
+ break;}
+case 12:
+#line 227 "plural.y"
+{
+ yyval.exp = yyvsp[-1].exp;
+ ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 543 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 1;
+}
+#line 232 "plural.y"
+
+
+void
+internal_function
+FREE_EXPRESSION (exp)
+ struct expression *exp;
+{
+ if (exp == NULL)
+ return;
+
+ /* Handle the recursive case. */
+ switch (exp->nargs)
+ {
+ case 3:
+ FREE_EXPRESSION (exp->val.args[2]);
+ /* FALLTHROUGH */
+ case 2:
+ FREE_EXPRESSION (exp->val.args[1]);
+ /* FALLTHROUGH */
+ case 1:
+ FREE_EXPRESSION (exp->val.args[0]);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+
+ free (exp);
+}
+
+
+static int
+yylex (lval, pexp)
+ YYSTYPE *lval;
+ const char **pexp;
+{
+ const char *exp = *pexp;
+ int result;
+
+ while (1)
+ {
+ if (exp[0] == '\0')
+ {
+ *pexp = exp;
+ return YYEOF;
+ }
+
+ if (exp[0] != ' ' && exp[0] != '\t')
+ break;
+
+ ++exp;
+ }
+
+ result = *exp++;
+ switch (result)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ unsigned long int n = result - '0';
+ while (exp[0] >= '0' && exp[0] <= '9')
+ {
+ n *= 10;
+ n += exp[0] - '0';
+ ++exp;
+ }
+ lval->num = n;
+ result = NUMBER;
+ }
+ break;
+
+ case '=':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = equal;
+ result = EQUOP2;
+ }
+ else
+ result = YYERRCODE;
+ break;
+
+ case '!':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = not_equal;
+ result = EQUOP2;
+ }
+ break;
+
+ case '&':
+ case '|':
+ if (exp[0] == result)
+ ++exp;
+ else
+ result = YYERRCODE;
+ break;
+
+ case '<':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = less_or_equal;
+ }
+ else
+ lval->op = less_than;
+ result = CMPOP2;
+ break;
+
+ case '>':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = greater_or_equal;
+ }
+ else
+ lval->op = greater_than;
+ result = CMPOP2;
+ break;
+
+ case '*':
+ lval->op = mult;
+ result = MULOP2;
+ break;
+
+ case '/':
+ lval->op = divide;
+ result = MULOP2;
+ break;
+
+ case '%':
+ lval->op = module;
+ result = MULOP2;
+ break;
+
+ case '+':
+ lval->op = plus;
+ result = ADDOP2;
+ break;
+
+ case '-':
+ lval->op = minus;
+ result = ADDOP2;
+ break;
+
+ case 'n':
+ case '?':
+ case ':':
+ case '(':
+ case ')':
+ /* Nothing, just return the character. */
+ break;
+
+ case ';':
+ case '\n':
+ case '\0':
+ /* Be safe and let the user call this function again. */
+ --exp;
+ result = YYEOF;
+ break;
+
+ default:
+ result = YYERRCODE;
+#if YYDEBUG != 0
+ --exp;
+#endif
+ break;
+ }
+
+ *pexp = exp;
+
+ return result;
+}
+
+
+static void
+yyerror (str)
+ const char *str;
+{
+ /* Do nothing. We don't print error messages here. */
+}
diff --git a/setedit/gettext/plural.y b/setedit/gettext/plural.y
new file mode 100644
index 0000000..42ffa0e
--- /dev/null
+++ b/setedit/gettext/plural.y
@@ -0,0 +1,412 @@
+%{
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* The bison generated parser uses alloca. AIX 3 forces us to put this
+ declaration at the beginning of the file. The declaration in bison's
+ skeleton file comes too late. This must come before <config.h>
+ because <config.h> may include arbitrary system headers. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include "gettextP.h"
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define FREE_EXPRESSION __gettext_free_exp
+#else
+# define FREE_EXPRESSION gettext_free_exp__
+# define __gettextparse gettextparse__
+#endif
+
+#define YYLEX_PARAM &((struct parse_args *) arg)->cp
+#define YYPARSE_PARAM arg
+%}
+%pure_parser
+%expect 10
+
+%union {
+ unsigned long int num;
+ enum operator op;
+ struct expression *exp;
+}
+
+%{
+/* Prototypes for local functions. */
+static struct expression *new_exp PARAMS ((int nargs, enum operator op,
+ struct expression * const *args));
+static inline struct expression *new_exp_0 PARAMS ((enum operator op));
+static inline struct expression *new_exp_1 PARAMS ((enum operator op,
+ struct expression *right));
+static struct expression *new_exp_2 PARAMS ((enum operator op,
+ struct expression *left,
+ struct expression *right));
+static inline struct expression *new_exp_3 PARAMS ((enum operator op,
+ struct expression *bexp,
+ struct expression *tbranch,
+ struct expression *fbranch));
+static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
+static void yyerror PARAMS ((const char *str));
+
+/* Allocation of expressions. */
+
+static struct expression *
+new_exp (nargs, op, args)
+ int nargs;
+ enum operator op;
+ struct expression * const *args;
+{
+ int i;
+ struct expression *newp;
+
+ /* If any of the argument could not be malloc'ed, just return NULL. */
+ for (i = nargs - 1; i >= 0; i--)
+ if (args[i] == NULL)
+ goto fail;
+
+ /* Allocate a new expression. */
+ newp = (struct expression *) malloc (sizeof (*newp));
+ if (newp != NULL)
+ {
+ newp->nargs = nargs;
+ newp->operation = op;
+ for (i = nargs - 1; i >= 0; i--)
+ newp->val.args[i] = args[i];
+ return newp;
+ }
+
+ fail:
+ for (i = nargs - 1; i >= 0; i--)
+ FREE_EXPRESSION (args[i]);
+
+ return NULL;
+}
+
+static inline struct expression *
+new_exp_0 (op)
+ enum operator op;
+{
+ return new_exp (0, op, NULL);
+}
+
+static inline struct expression *
+new_exp_1 (op, right)
+ enum operator op;
+ struct expression *right;
+{
+ struct expression *args[1];
+
+ args[0] = right;
+ return new_exp (1, op, args);
+}
+
+static struct expression *
+new_exp_2 (op, left, right)
+ enum operator op;
+ struct expression *left;
+ struct expression *right;
+{
+ struct expression *args[2];
+
+ args[0] = left;
+ args[1] = right;
+ return new_exp (2, op, args);
+}
+
+static inline struct expression *
+new_exp_3 (op, bexp, tbranch, fbranch)
+ enum operator op;
+ struct expression *bexp;
+ struct expression *tbranch;
+ struct expression *fbranch;
+{
+ struct expression *args[3];
+
+ args[0] = bexp;
+ args[1] = tbranch;
+ args[2] = fbranch;
+ return new_exp (3, op, args);
+}
+
+%}
+
+/* This declares that all operators have the same associativity and the
+ precedence order as in C. See [Harbison, Steele: C, A Reference Manual].
+ There is no unary minus and no bitwise operators.
+ Operators with the same syntactic behaviour have been merged into a single
+ token, to save space in the array generated by bison. */
+%right '?' /* ? */
+%left '|' /* || */
+%left '&' /* && */
+%left EQUOP2 /* == != */
+%left CMPOP2 /* < > <= >= */
+%left ADDOP2 /* + - */
+%left MULOP2 /* * / % */
+%right '!' /* ! */
+
+%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
+%token <num> NUMBER
+%type <exp> exp
+
+%%
+
+start: exp
+ {
+ if ($1 == NULL)
+ YYABORT;
+ ((struct parse_args *) arg)->res = $1;
+ }
+ ;
+
+exp: exp '?' exp ':' exp
+ {
+ $$ = new_exp_3 (qmop, $1, $3, $5);
+ }
+ | exp '|' exp
+ {
+ $$ = new_exp_2 (lor, $1, $3);
+ }
+ | exp '&' exp
+ {
+ $$ = new_exp_2 (land, $1, $3);
+ }
+ | exp EQUOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp CMPOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp ADDOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp MULOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | '!' exp
+ {
+ $$ = new_exp_1 (lnot, $2);
+ }
+ | 'n'
+ {
+ $$ = new_exp_0 (var);
+ }
+ | NUMBER
+ {
+ if (($$ = new_exp_0 (num)) != NULL)
+ $$->val.num = $1;
+ }
+ | '(' exp ')'
+ {
+ $$ = $2;
+ }
+ ;
+
+%%
+
+void
+internal_function
+FREE_EXPRESSION (exp)
+ struct expression *exp;
+{
+ if (exp == NULL)
+ return;
+
+ /* Handle the recursive case. */
+ switch (exp->nargs)
+ {
+ case 3:
+ FREE_EXPRESSION (exp->val.args[2]);
+ /* FALLTHROUGH */
+ case 2:
+ FREE_EXPRESSION (exp->val.args[1]);
+ /* FALLTHROUGH */
+ case 1:
+ FREE_EXPRESSION (exp->val.args[0]);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+
+ free (exp);
+}
+
+
+static int
+yylex (lval, pexp)
+ YYSTYPE *lval;
+ const char **pexp;
+{
+ const char *exp = *pexp;
+ int result;
+
+ while (1)
+ {
+ if (exp[0] == '\0')
+ {
+ *pexp = exp;
+ return YYEOF;
+ }
+
+ if (exp[0] != ' ' && exp[0] != '\t')
+ break;
+
+ ++exp;
+ }
+
+ result = *exp++;
+ switch (result)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ unsigned long int n = result - '0';
+ while (exp[0] >= '0' && exp[0] <= '9')
+ {
+ n *= 10;
+ n += exp[0] - '0';
+ ++exp;
+ }
+ lval->num = n;
+ result = NUMBER;
+ }
+ break;
+
+ case '=':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = equal;
+ result = EQUOP2;
+ }
+ else
+ result = YYERRCODE;
+ break;
+
+ case '!':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = not_equal;
+ result = EQUOP2;
+ }
+ break;
+
+ case '&':
+ case '|':
+ if (exp[0] == result)
+ ++exp;
+ else
+ result = YYERRCODE;
+ break;
+
+ case '<':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = less_or_equal;
+ }
+ else
+ lval->op = less_than;
+ result = CMPOP2;
+ break;
+
+ case '>':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = greater_or_equal;
+ }
+ else
+ lval->op = greater_than;
+ result = CMPOP2;
+ break;
+
+ case '*':
+ lval->op = mult;
+ result = MULOP2;
+ break;
+
+ case '/':
+ lval->op = divide;
+ result = MULOP2;
+ break;
+
+ case '%':
+ lval->op = module;
+ result = MULOP2;
+ break;
+
+ case '+':
+ lval->op = plus;
+ result = ADDOP2;
+ break;
+
+ case '-':
+ lval->op = minus;
+ result = ADDOP2;
+ break;
+
+ case 'n':
+ case '?':
+ case ':':
+ case '(':
+ case ')':
+ /* Nothing, just return the character. */
+ break;
+
+ case ';':
+ case '\n':
+ case '\0':
+ /* Be safe and let the user call this function again. */
+ --exp;
+ result = YYEOF;
+ break;
+
+ default:
+ result = YYERRCODE;
+#if YYDEBUG != 0
+ --exp;
+#endif
+ break;
+ }
+
+ *pexp = exp;
+
+ return result;
+}
+
+
+static void
+yyerror (str)
+ const char *str;
+{
+ /* Do nothing. We don't print error messages here. */
+}
diff --git a/setedit/gettext/textdomain.c b/setedit/gettext/textdomain.c
new file mode 100644
index 0000000..05c2fd7
--- /dev/null
+++ b/setedit/gettext/textdomain.c
@@ -0,0 +1,141 @@
+/* Implementation of the textdomain(3) function.
+ Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "gettextP.h"
+
+#ifdef _LIBC
+/* We have to handle multi-threaded applications. */
+# include <bits/libc-lock.h>
+#else
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_default_domain _nl_default_default_domain__
+# define _nl_current_default_domain _nl_current_default_domain__
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Name of the default text domain. */
+extern const char _nl_default_default_domain[];
+
+/* Default text domain in which entries for gettext(3) are to be found. */
+extern const char *_nl_current_default_domain;
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define TEXTDOMAIN __textdomain
+# ifndef strdup
+# define strdup(str) __strdup (str)
+# endif
+#else
+# define TEXTDOMAIN textdomain__
+#endif
+
+/* Lock variable to protect the global data in the gettext implementation. */
+__libc_rwlock_define (extern, _nl_state_lock)
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+char *
+TEXTDOMAIN (domainname)
+ const char *domainname;
+{
+ char *new_domain;
+ char *old_domain;
+
+ /* A NULL pointer requests the current setting. */
+ if (domainname == NULL)
+ return (char *) _nl_current_default_domain;
+
+ __libc_rwlock_wrlock (_nl_state_lock);
+
+ old_domain = (char *) _nl_current_default_domain;
+
+ /* If domain name is the null string set to default domain "messages". */
+ if (domainname[0] == '\0'
+ || strcmp (domainname, _nl_default_default_domain) == 0)
+ {
+ _nl_current_default_domain = _nl_default_default_domain;
+ new_domain = (char *) _nl_current_default_domain;
+ }
+ else if (strcmp (domainname, old_domain) == 0)
+ /* This can happen and people will use it to signal that some
+ environment variable changed. */
+ new_domain = old_domain;
+ else
+ {
+ /* If the following malloc fails `_nl_current_default_domain'
+ will be NULL. This value will be returned and so signals we
+ are out of core. */
+#if defined _LIBC || defined HAVE_STRDUP
+ new_domain = strdup (domainname);
+#else
+ size_t len = strlen (domainname) + 1;
+ new_domain = (char *) malloc (len);
+ if (new_domain != NULL)
+ memcpy (new_domain, domainname, len);
+#endif
+
+ if (new_domain != NULL)
+ _nl_current_default_domain = new_domain;
+ }
+
+ /* We use this possibility to signal a change of the loaded catalogs
+ since this is most likely the case and there is no other easy we
+ to do it. Do it only when the call was successful. */
+ if (new_domain != NULL)
+ {
+ ++_nl_msg_cat_cntr;
+
+ if (old_domain != new_domain && old_domain != _nl_default_default_domain)
+ free (old_domain);
+ }
+
+ __libc_rwlock_unlock (_nl_state_lock);
+
+ return new_domain;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__textdomain, textdomain);
+#endif
diff --git a/setedit/holidays/.cvsignore b/setedit/holidays/.cvsignore
new file mode 100644
index 0000000..550bd25
--- /dev/null
+++ b/setedit/holidays/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+
diff --git a/setedit/holidays/Makefile b/setedit/holidays/Makefile
new file mode 100644
index 0000000..62de07a
--- /dev/null
+++ b/setedit/holidays/Makefile
@@ -0,0 +1,26 @@
+CC=gcc
+CFLAGS=-march=i686 -mtune=generic -O2 -pipe
+dyndir=/usr/lib/setedit
+dynversion=.1.0.0
+
+LIBS=argentina datetools defholidays
+
+all: $(addsuffix .so,$(LIBS))
+
+libs: $(addsuffix .so,$(LIBS))
+
+%.o: %.c
+ $(CC) -c -fPIC $(CFLAGS) $<
+
+%.so: %.o
+ $(CC) -o $@ $< -shared -Wl,-soname,$(basename $@).so$(dynversion)
+
+%.ins: %.so
+ install -d $(dyndir)
+ -install $< $(dyndir)/$@
+
+install: libs $(addsuffix .ins,$(LIBS))
+
+clean:
+ rm -f *.o *.so
+
diff --git a/setedit/holidays/Makefile.in b/setedit/holidays/Makefile.in
new file mode 100644
index 0000000..c592d1a
--- /dev/null
+++ b/setedit/holidays/Makefile.in
@@ -0,0 +1,26 @@
+CC=@CC@
+CFLAGS=@CFLAGS@
+dyndir=@dyndir@
+dynversion=.1.0.0
+
+LIBS=argentina datetools defholidays
+
+all: $(addsuffix .so,$(LIBS))
+
+libs: $(addsuffix .so,$(LIBS))
+
+%.o: %.c
+ $(CC) -c -fPIC $(CFLAGS) $<
+
+%.so: %.o
+ $(CC) -o $@ $< -shared -Wl,-soname,$(basename $@).so$(dynversion)
+
+%.ins: %.so
+ install -d $(dyndir)
+ -install $< $(dyndir)/$@
+
+install: libs $(addsuffix .ins,$(LIBS))
+
+clean:
+ rm -f *.o *.so
+
diff --git a/setedit/holidays/README b/setedit/holidays/README
new file mode 100644
index 0000000..91154ac
--- /dev/null
+++ b/setedit/holidays/README
@@ -0,0 +1,124 @@
+This document explains how to write a "holiday plug-in".
+
+1. Introduction
+2. The holidays.conf file
+3. Writing the plug-in
+4. Available functions
+5. The complex easter
+6. Adding the plug-in to the make process
+7. Adding the plug-in to the install process
+
+
+1. Introduction
+
+ The purpose of the plug-ins is just highlight certain dates in the
+calendar. I think the best is to indicate which days are holidays, but it
+can be used for other important dates.
+ As the dates depends on the country this is implemented using external
+modules. At least in my country, Argentina, we have some complex rules to
+move some holidays so a simple table isn't enough. For this reason the
+plug-ins are binaries and not simple text files.
+ To determine which plug-in will be used the editor scans the
+`holidays.conf' file using the content of the LANG environment variable.
+This variable usually holds the language plus the local variant. In my case
+this variable have the following value: es_AR
+ It means my language is ES (ISO code for Spain => spanish) and the
+variant is AR (ISO code for Argentina).
+
+
+2. The holidays.conf file
+
+ This file contains entries like it:
+
+LANG "Country name" plug-in
+
+ The first field should match the LANG environment variable, the last
+entry in the list should use `*' and is considered the default. The rest
+are self-explanatory.
+ So the first thing you must do is add an entry here. In my case is:
+
+es_AR "Argentina" argentina.so
+
+ If you are in the USA it could be:
+
+en_US "United States of America" usa.so
+
+
+3. Writing the plug-in
+
+ The plug-in must be coded in C, if you use C++ you must export the
+GetListOfHolidays as a C function (extern "C" ...).
+ An example of a very simple plug-in is defholidays.c, it is used to
+highlight the most common holidays for the christian world and should be
+the deafult entry in the holidays.conf.
+ The plug-in is just a dynamic library and it must export a function
+called GetListOfHolidays with the following protype:
+
+struct dayMonth *GetListOfHolidays(int year, int *cant);
+
+ This function receives the year you must use to compute the holidays and
+a pointer to an integer to return the number of holidays.
+ The funtion must return a newly allocated block of memory (using malloc)
+containing an array of dayMonth structs. It must contain at least `cant'
+elements.
+ The fields in the dayMonth struct are:
+
+int day: The day of the holiday. That's the day of the month and you
+ usually see in the calendar.
+int month: The number of month (1=january ... 12=december).
+const char *description: A pointer to a string containing a brief
+ description of the holiday. The string should be a
+ constant (won't be freed).
+
+
+4. Available functions
+
+ You can use any standard C routine additionally you have access to the
+functions defined in datetools.h and implemented in datetools.c
+(datetools.so). The most important are:
+
+int Day2Number(int d, int m, int y);
+Converts a day into an abstract number suitable to additions and
+substractions.
+
+void Number2Day(int nNumber, int *day, int *month, int *year);
+Converts the abstract number back into a date.
+
+int WeekDay(int d, int m, int y);
+Finds which day of the week corresponds to certain date.
+
+ You can find more information in datetools.c.
+
+
+5. The complex easter
+
+ Easter sunday isn't easy to compute for this reason I provide a function:
+
+void Easter(int nY, int *nThursday, int *nFriday);
+
+ It computes the number of day for the thurday and friday before easter
+sunday. Use Number2Day to convert the numbers into dates. See the
+defholidays.c for an example.
+
+
+6. Adding the plug-in to the make process
+
+ You have to modify the files Makefile and Makefile.in (or just
+Makefile.in and then run the configure script). You just need to add the
+name of the plug-in (without extension) to the line that says LIBS=
+
+
+7. Adding the plug-in to the install process
+
+ You have to add the plug-in source file name to the file ../makes/lista
+This file is alphabetically sorted.
+ You also have to add a line to ../makes/linux/compress.pl. Search for a
+line containing:
+
+CopyIf('../../holidays/holidays.conf',$libdir.'/holidays.conf');
+
+ And then add a line like it:
+
+CopyIf('../../holidays/plug-in_name',$libdir.'/plug-in_name');
+
+
diff --git a/setedit/holidays/argentina.c b/setedit/holidays/argentina.c
new file mode 100644
index 0000000..8a342e3
--- /dev/null
+++ b/setedit/holidays/argentina.c
@@ -0,0 +1,106 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 1992-2003 by Salvador E. Tropea
+ Covered by the GPL license, see the see copyrigh file for details.
+
+ Description:
+ Module to find the holidays for Argentina.@*
+ Note that some holidays are moved to make "long weekends", this is a
+little bit tricky.@*
+ Supports the changes introduced in 1996 and 2002.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include "datetools.h"
+
+/************************** Feriados *********************************/
+// Domingo,Sbado y Lunes no se corren, Martes y Mircoles pasan al Lunes de
+// esa semana y Jueves y Viernes al Lunes de la siguiente
+#define nFeriados 11
+static int Corrimientos[]={0,0,-1,-2,+4,+3,0};
+static char Feriados[nFeriados][2]=
+ {{1,1},{2,4},{1,5},{25,5},{10,6},{20,6},{9,7},{17,8},{12,10},{8,12},{25,12}};
+static char SeCorre[nFeriados]=
+ { 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0};
+static char ADonde[nFeriados]=
+ { 0, 1, 0, 0, 1, 2, 0, 2, 1, 0, 0};
+static const char *Descripciones[nFeriados]=
+{
+ "Primer da del ao",
+ "Da de las Malvinas",
+ "Da del trabajador",
+ "Revolucin de Mayo",
+ "Da de la Soberana",
+ "Da de la bandera",
+ "Da de la Independencia",
+ "Aniversario de San Martn",
+ "Da de la Raza",
+ "Da de la Virgen",
+ "Navidad"
+};
+
+static
+int CalculaFeriado(int nFeriado, int nAno, int *nDiaNum, int *nDiaSem,
+ const char **desc)
+{
+ int nDiaSem1ro,nDia,nMes;
+
+ nDia=Feriados[nFeriado][0];
+ nMes=Feriados[nFeriado][1];
+ // El 10/6 se movi al 2/4, parece que fue a partir del 2002.
+ if (nDia==10 && nMes==6 && nAno>=2002)
+ return 0;
+ if (nDia==2 && nMes==4 && nAno<2002)
+ return 0;
+ *nDiaNum=Day2Number(nDia,nMes,nAno);
+ *nDiaSem=WeekDay(nDia,nMes,nAno);
+
+ if (SeCorre[nFeriado])
+ {
+ if (nAno<1996 || ADonde[nFeriado]==1)
+ {
+ *nDiaNum+=Corrimientos[*nDiaSem-1];
+ // Si se lo corri se lo hizo a lunes
+ if (Corrimientos[*nDiaSem-1]!=0)
+ *nDiaSem=2;
+ }
+ else
+ {// A partir de 1996 y para feriados tipo 2
+ // Buscar el primer da del mes con el nombre indicado
+ nDiaSem1ro=2-WeekDay(1,nMes,nAno);
+ if (nDiaSem1ro<0)
+ nDiaSem1ro+=7;
+ // Buscar el nmero de da
+ *nDiaNum=Day2Number(1,nMes,nAno)+nDiaSem1ro+14;
+ // Si o si a lunes
+ *nDiaSem=2;
+ }
+ }
+ *desc=Descripciones[nFeriado];
+ return 1;
+}
+
+struct dayMonth *GetListOfHolidays(int anio, int *feriados)
+{
+ int a,nD,nS,j,v;
+ struct dayMonth *ret=(struct dayMonth *)malloc(sizeof(struct dayMonth)*(nFeriados+2));
+ int i,k;
+
+ for (i=0,k=0; i<nFeriados; i++)
+ {
+ if (CalculaFeriado(i,anio,&nD,&nS,&ret[k].description))
+ {
+ Number2Day(nD,&ret[k].day,&ret[k].month,&a);
+ k++;
+ }
+ }
+
+ Easter(anio,&j,&v);
+ Number2Day(j,&ret[k].day,&ret[k].month,&a); ret[k++].description="Jueves Santo";
+ Number2Day(v,&ret[k].day,&ret[k].month,&a); ret[k++].description="Viernes Santo";
+
+ *feriados=k;
+ return ret;
+}
+
diff --git a/setedit/holidays/datetools.c b/setedit/holidays/datetools.c
new file mode 100644
index 0000000..cd9a8d6
--- /dev/null
+++ b/setedit/holidays/datetools.c
@@ -0,0 +1,259 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 1992-2003 by Salvador E. Tropea
+ Covered by the GPL license, see the see copyrigh file for details.
+
+ Module: Date Tools
+ Description:
+ This module contains functions used to compute dates. They can convert a
+date into a unique number and the reverse, find which day of the week
+corresponds to a date expressed as a number and find the easter dates for
+any year.@*
+ All of them are designed to support the discontinuity introduced in
+october 1582 when the rules to compute leap years changed. But I don't know
+if it works ok.@*
+ I designed some portions of this code for Commodore 128 Basic, then
+recoded for Clipper 5 and now for C.@*
+ Most comments are in spanish, I just translated the descriptions and the
+names of the most relevant arguments. If you need more information and
+can't translate the spanish text just ask me.@*
+ The easter computation is something really interesting, is based in the
+moon and equinoxes, I'm using the original methode used by priest to
+compute these dates and that's why the code refers to archaic terms as
+"Aureo nmero" (golden day). But it works perfectly.@*
+ Also note this code doesn't use any library function.@p
+
+***************************************************************************/
+
+static
+int DaysTo[2][13]=
+{
+ {0,31,59,90,120,151,181,212,243,273,304,334,365},
+ {0,31,60,91,121,152,182,213,244,274,305,335,366}
+};
+
+static
+int IsLeap(int a)
+{
+ return ((a%4==0) && (a%100!=0)) || (a%400==0);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts a date (day, month, year) to a number. Note this number takes
+care about the discontinuity introduced in october 1582.
+
+ Return: A number representing the date, suitable for additions and
+substractions.
+
+***************************************************************************/
+
+int Day2Number(int d, int m, int a)
+{
+ int nDay,nAux;
+
+ // Ver si es anterior al 5/10/1582
+ if (a<1582 || (a==1582 && (m<10 || (m==10 && d<5))))
+ {// Anterior al 5/10/1582 => Juliano
+ nDay=(int)(a*365.25+0.99)+DaysTo[a%4==0 ? 1 : 0][m-1]+d;
+ }
+ else
+ {// Posterior => Gregoriano
+ nDay=(int)((a-1580)*365.25+0.99)+DaysTo[a%4==0 ? 1 : 0][m-1]+d-1462;
+ // Cuantas centurias, para restar el hecho de que los terminados en 00
+ // no son bisiestos
+ nAux=(nDay-5903)/36525;
+ // Pero ojo que los mltiplo de 400 si
+ nDay-=nAux-nAux/4;
+ nDay+=578557;
+ }
+ return nDay;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the number of day of the week corresponding for a specified date
+(day, month, year). Supports the discontinuity introduced in october 1582.
+
+ Return: The number of day in the week, 1 is sunday and 7 is satursday.
+
+***************************************************************************/
+
+int WeekDay(int d, int m, int a)
+{
+ int nDay,nAux;
+
+ // Ver si es anterior al 5/10/1582
+ if (a<1582 || (a==1582 && (m<10 || (m==10 && d<5))))
+ // Anterior al 5/10/1582 => Juliano
+ nDay=(int)(a*365.25+0.99)+DaysTo[a%4==0 ? 1 : 0][m-1]+d+3;
+ else
+ {
+ // Posterior => Gregoriano
+ nDay=(int)((a-1580)*365.25+0.99)+DaysTo[a%4==0 ? 1 : 0][m-1]+d-1462;
+ // Cuantas centurias, para restar el hecho de que los terminados en 00
+ // no son bisiestos
+ nAux=(nDay-5903)/36525;
+ // Pero ojo que los mltiplo de 400 si
+ nDay-=nAux-nAux/4;
+ }
+
+ return (nDay%7)+1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds which day (day, month and year) corresponds to a specified number.
+This number is the one you get from @x{Day2Number}. Supports the
+discontinuity introduced in october 1582.
+
+ Return: Nothing, the values are returned through the pointers.
+
+***************************************************************************/
+
+void Number2Day(int nNumber, int *day, int *month, int *year)
+{
+ int nRest,nBis,nAux1,nAux2,nYear,nMonth,nDay;
+
+ if (nNumber>578103)
+ {// Desajustar la fecha gregoriana para que sea de la forma de la juliana,
+ // es decir sumar los aos 1700,1800,1900,... que no son bisiestos, como
+ // si lo fueran
+ nNumber-=578557;
+ nAux1=(nNumber-5903)/36525; // Centurias despus de 1600
+ nAux2=nAux1-nAux1/4; // Menos las que si son bisiestas
+ nNumber+=731+nAux2; // Reajustar con referencia de ao 0 = 1582
+ nYear=nNumber/365.25;
+ // Cuantos das sobran redondeando hacia arriba
+ nRest=nNumber-(int)(nYear*365.25+0.3);
+ // Reajustar el ao
+ nYear+=1582;
+ nBis=IsLeap(nYear) ? 1 : 0;
+ }
+ else
+ {
+ nYear=nNumber/365.25;
+ nBis=nYear%4==0 ? 1 : 0;
+ // Cuantos das sobran redondeando hacia arriba
+ nRest=nNumber-(int)(nYear*365.25+0.9);
+ }
+ // A cual mes corresponde
+ nMonth=2;
+ while (DaysTo[nBis][nMonth-1]<nRest)
+ nMonth++;
+ // Cuantos das sobran
+ nMonth--;
+ nDay=nRest-DaysTo[nBis][nMonth-1];
+ *day=nDay;
+ *month=nMonth;
+ *year=nYear;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the number of the days corresponding to the Thursday and Friday
+before the Easter Sunday for a desired year.
+
+ Return: Nothing, the values are returned through the pointers.
+
+***************************************************************************/
+
+void Easter(int nY, int *nThursday, int *nFriday)
+{// Verified for 1995, 1998, 1999 and 2002.
+ int nAureo,nSiglos,nCantBis,nLetraDom,nEpactaJ,nCorrSolar,nCorrLunar;
+ int nEpacta,nDireccion,nDiaNum,nDia,nMes;
+
+ // Areo Nmero:
+ // Para conocer las lunaciones se descubri que cada 19 aos julianos estas
+ // se repetan, a esto se lo llam perodo de Metn. Este perodo abarca 4
+ // o 5 bisiestos. El areo nmero es la posicin del ao dentro de este ciclo
+ // La referencia es el ao -1 donde el novilunio fue el 1 de Enero.
+ nAureo=(nY+1)%19;
+ if (nAureo==0)
+ nAureo=19;
+
+ // Letra Dominical: Si a los 7 primeros das del ao los nombro A,B,...,G
+ // la letra dominical es la letra del primer domingo del ao.
+ // Segn el calendario gregoriano el ao anterior al 1 empez en domingo (A)
+ // cada ao se corre un da ya que un ao de 365 das tiene 52 semanas+1 da
+ // pero los bisiestos adelantan 2, la idea es saber cuan corrido est el
+ // ao en cuestin es decir cual es la letra dominical de ese ao
+ // El 7-x viene del hecho de que las letras retroceden al avanzar los
+ // defasajes. La letra dominical es que nmero de da del ao le corresponde
+ // al primer domingo del ao, en los aos bisiestos hay 2: una hasta el
+ // 29/2 y otra para el resto, este clculo busca la que sirve para el resto
+ // del ao por lo que en los aos bisiestos no coincide con el nro. del 1er
+ // domingo, pero sirve para clculos suponiendo que no es un bisiesto.
+ nSiglos=nY/100;
+ nCantBis=nY/4-nSiglos+nY/400;
+ nLetraDom=7-(nY+nCantBis-1)%7;
+
+ // Epacta: Es el nmero de das que excede el ao solar al lunar.
+ // el solar son 365, el lunar 29,5*12 = 354 => cada ao la epacta se corre
+ // 11 das, las epactas van hasta el 30, por lo que es un resto.
+ // Se sabe que la epacta de 1582 era 26 => el resto de (26+11(Ao-1582))/30
+ // Nota: No el ao, sino el corrimiento lunar (Areo Nmero)
+ // es la epacta de dicho ao, con esto obtengo la del Juliano (nEpactaJ).
+ // Si se tiene en cuenta que el areo nmero de ese ao es 6 puedo poner
+ // resto de (26+11(nAureo-6))/30
+ nEpactaJ=(26+11*(nAureo-6))%30;
+ // Luego las correcciones: hay que restar los no bisiestos de 1700,1800,1900
+ // etc a partir de 1582 esto es: (Siglos-16)/4-(Siglos-16)
+ nCorrSolar=(nSiglos-16)/4-(nSiglos-16);
+ // Ahora la correccin Lunar: Es un corrimiento en el Lunar que equivale a
+ // 8 das cada 25 siglos:
+ nCorrLunar=(nSiglos-15-((nSiglos-17)/25))/3;
+ nEpacta=nEpactaJ+nCorrSolar+nCorrLunar;
+ if (nEpacta<1)
+ nEpacta+=30;
+
+ /* Pascuas: Lilius autor de la reforma Gregoriana estableci en el concilio
+ de Nicea que la fecha de Pascuas de Resurreccin debe cumplir:
+ 1 - Ser Domingo
+ 2 - Debe ser el que sigue al 14avo da de la luna pascual. Si el 14avo fuera
+ Domingo entonces es el que sigue.
+ 3 - Luna pascual es aquella cuyo 14avo da tiene lugar en o inmediatamente
+ despus del equinoccio vernal.
+ 4 - El equinoccio vernal tiene lugar el 21 de Marzo.
+ Nota mia: El 14avo da es la luna llena, el 1ro es el novilunio (nueva luna)
+ No se refieren a datos astronmicos reales, sino a datos eclesisticos, ya
+ que el equinoccio puede no ser el 21 (20 o 19) lo mismo con la luna, se
+ refieren a perodos preestablecidos al crear el calendario gregoriano.
+
+ nDiasH15: Es la cantidad de das entre el 21/3 y el 15avo da del ciclo lunar.
+ nLetraDom: Letra Dominical (da de la semana del 1/1)
+ nDireccion: Nmero de das entre el 21/3 y pascuas.
+ nDia15: Es el nmero de da de la semana que cae el 15avo lunar.
+ Es:
+ nDireccion = nDiasH15 + nLetraDom - nDia15
+ Luego: La edad de la luna el 1/3 es la misma que el 1/1 que sale de la nEpacta
+ y se cumple que nDiasH15 = 24 - nEpacta
+ nDia15 = 27 - nEpacta
+ como nDiasH15 debe ser mayor que 0 si nEpacta>23 se le suma 30 (un perodo
+ lunar)
+ */
+ // Averiguar que da despues del 21 tiene 14 das la luna:
+ // Primero cuanto despus del 1/3 queda
+ if (nEpacta<24)
+ nDireccion=44-nEpacta;
+ else
+ nDireccion=73-nEpacta;
+ // Ahora cual da es
+ nDiaNum=Day2Number(1,3,nY)+nDireccion;
+ // Que da de la semana es
+ Number2Day(nDiaNum,&nDia,&nMes,&nY);
+ nDireccion=WeekDay(nDia,nMes,nY);
+ // Ahora cuantos das faltan para el domingo
+ nDireccion=8-nDireccion;
+ if (nDireccion==7)
+ nDireccion=0;
+ // Nmero de da del Domingo de Pascua
+ nDiaNum+=nDireccion;
+ *nThursday=nDiaNum-3;
+ *nFriday=nDiaNum-2;
+}
+
diff --git a/setedit/holidays/datetools.h b/setedit/holidays/datetools.h
new file mode 100644
index 0000000..e1b2044
--- /dev/null
+++ b/setedit/holidays/datetools.h
@@ -0,0 +1,25 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int Day2Number(int d, int m, int y);
+extern int WeekDay(int d, int m, int y);
+extern void Number2Day(int nNumber, int *day, int *month, int *year);
+extern void Easter(int nY, int *nThursday, int *nFriday);
+
+struct dayMonth
+{
+ int day,month;
+ const char *description;
+};
+
+#ifdef __cplusplus
+};
+
+// This is exported to SETEdit, not available for the plug-ins
+extern struct dayMonth *GetHolidays(int year, int &cant);
+extern char *HolidaysGetLastError();
+extern void ConfigureHolidays();
+extern void CleanUpHolidays();
+#endif
+
diff --git a/setedit/holidays/defholidays.c b/setedit/holidays/defholidays.c
new file mode 100644
index 0000000..d51a130
--- /dev/null
+++ b/setedit/holidays/defholidays.c
@@ -0,0 +1,55 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea
+ Covered by the GPL license, see the see copyrigh file for details.
+
+ Description:
+ Module with the default holidays.@*
+ That's to show how to write a holidays plug-in. It returns a list of
+dates that are more or less important worldwide.@*
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include "datetools.h"
+
+/**[txh]********************************************************************
+
+ Description:
+ The implementation of this function is mandatory.
+
+ Return: A pointer to a newly malloced block of memory containing the list
+of holidays (struct dayMonth). The number of entries is returned thru the
+@var{cant} argument.
+
+***************************************************************************/
+
+struct dayMonth *GetListOfHolidays(int year, int *cant)
+{
+ // We have four holidays
+ struct dayMonth *ret=(struct dayMonth *)malloc(sizeof(struct dayMonth)*4);
+ int t,f,aux;
+
+ // january 1st, may 1st and december 25th are fixed:
+ ret[0].day=1;
+ ret[0].month=1;
+ ret[0].description="First day of the year";
+ ret[1].day=1;
+ ret[1].month=5;
+ ret[1].description="Worker's day";
+ ret[2].day=25;
+ ret[2].month=12;
+ ret[2].description="Christmas";
+
+ // Easter sunday must be calculated, but this is provided by the datetools.so
+ // module.
+ Easter(year,&t,&f);
+ // What we get is the thursday and friday, we will just indicate the sunday
+ f+=2; // Sunday=Friday+2
+ Number2Day(f,&ret[3].day,&ret[3].month,&aux);
+ ret[3].description="Easter sunday";
+
+ *cant=3;
+ return ret;
+}
+
diff --git a/setedit/holidays/holidays.conf b/setedit/holidays/holidays.conf
new file mode 100644
index 0000000..97db5f2
--- /dev/null
+++ b/setedit/holidays/holidays.conf
@@ -0,0 +1,4 @@
+2
+es_AR "Argentina" argentina.so
+* "Default" defholidays.so
+
diff --git a/setedit/include/.cvsignore b/setedit/include/.cvsignore
new file mode 100644
index 0000000..701a1fc
--- /dev/null
+++ b/setedit/include/.cvsignore
@@ -0,0 +1 @@
+configed.h
diff --git a/setedit/include/bufun.h b/setedit/include/bufun.h
new file mode 100644
index 0000000..c5d00a7
--- /dev/null
+++ b/setedit/include/bufun.h
@@ -0,0 +1,60 @@
+/* Copyright (C) 2000-2007 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ bufun.cc definitions.
+ They are needed for the parsers for languages other than C and the
+ editor class.
+
+***************************************************************************/
+
+#ifndef BUFUN_H_INCLUDED
+#define BUFUN_H_INCLUDED
+
+typedef void (*tAddFunc)(char *name, int len, int lineStart, int lineEnd);
+const int MaxLenWith0=256,MaxLen=255,MaxLen_1=254;
+
+// Generic use buffers of MaxLenWith0 bytes, can be used by all parsers
+extern char bfBuffer[];
+extern char bfNomFun[];
+extern char bfTempNomFun[];
+
+// This structure holds the parsers we have.
+// Each parser must export a `func' function.
+// Prefferred names are SearchLanguageFuncs
+typedef struct
+{
+ const char *shl;
+ int (*func)(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+} stFuncsSHL;
+
+class SOStack;
+class TNoCaseSOSStringCollection;
+
+const int modeBFPrototypes=0, modeBFFunctions=1, modeBFClassSep=2;
+extern int SelectFunctionToJump(char *b, unsigned l, char *word, int mode,
+ char *fileName, const char *shl);
+extern void DestroyFunctionList();
+extern int CreateFunctionList(char *b, unsigned l, const char *fileName,
+ unsigned ID, const char *shl);
+extern int CreateFunctionList(char *b, unsigned l, SOStack &stk,
+ TNoCaseSOSStringCollection *FunList, unsigned ops,
+ const char *shl);
+extern int SearchFunctionByLine(int line, int &start, int &end, char *&name);
+
+// Other parsers:
+extern int SearchClipperFuncs(char *b, unsigned l, int mode, tAddFunc AddFunc);
+extern int SearchPerlFuncs(char *b, unsigned l, int mode, tAddFunc AddFunc);
+extern int SearchSHLDefs(char *b, unsigned l, int mode, tAddFunc AddFunc);
+extern int SearchTxiSecs(char *b, unsigned l, int mode, tAddFunc AddFunc);
+extern int SearchAsmLabels(char *b, unsigned l, int mode, tAddFunc AddFunc);
+extern int SearchPHPFuncs(char *srcBuffer, unsigned len, int mode, tAddFunc addFunc);
+extern int SearchPythonSymbols(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+extern int SearchVHDLStuff(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+extern int SearchPMDefs(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+extern int SearchKICADLib(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+extern int SearchMakeLabels(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+extern int SearchHTMLAnchors(char *buffer, unsigned len, int mode, tAddFunc AddFunc);
+
+#endif // BUFUN_H_INCLUDED
diff --git a/setedit/include/ced_clas.h b/setedit/include/ced_clas.h
new file mode 100644
index 0000000..0e84d53
--- /dev/null
+++ b/setedit/include/ced_clas.h
@@ -0,0 +1,774 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined( Uses_TCEditor_Class )
+
+#if !defined ( __TCEditor_Class_Constants__ )
+#define __TCEditor_Class_Constants__
+const unsigned maxFindStrLenEd=80,
+ maxReplaceStrLenEd=maxFindStrLenEd;
+#endif
+
+#if defined( Uses_TFindCDialogRec ) && !defined( __TFindCDialogRec__ )
+#define __TFindCDialogRec__
+
+struct TFindCDialogRec
+{
+ TFindCDialogRec(const char *str, unsigned flgs, unsigned insel,
+ unsigned from_where)
+ {
+ strcpy(find,str);
+ options=flgs;
+ in_sel=insel;
+ from=from_where;
+ direction=(flgs & efSearchBack) ? 1 : 0;
+ }
+ char find[maxFindStrLenEd];
+ uint32 options;
+ uint32 in_sel;
+ uint32 from;
+ uint32 direction;
+};
+
+#endif // Uses_TFindCDialogRec
+
+
+#if defined( Uses_TReplaceCDialogRec ) && !defined( __TReplaceCDialogRec__ )
+#define __TReplaceCDialogRec__
+
+struct TReplaceCDialogRec
+{
+ TReplaceCDialogRec(const char *str, const char *rep, unsigned flgs,
+ unsigned insel, unsigned from_where)
+ {
+ strcpy(find,str);
+ strcpy(replace,rep);
+ options=flgs;
+ in_sel=insel;
+ from=from_where;
+ direction=(flgs & efSearchBack) ? 1 : 0;
+ }
+ char find[maxFindStrLenEd];
+ char replace[maxReplaceStrLenEd];
+ uint32 options;
+ uint32 in_sel;
+ uint32 from;
+ uint32 direction;
+};
+
+#endif // Uses_TReplaceCDialogRec
+
+
+
+#if defined( Uses_LineLengthArray ) && !defined( __LineLengthArray__ )
+#define __LineLengthArray__
+
+class LineLengthArray
+{
+public:
+ LineLengthArray();
+ ~LineLengthArray();
+ uint16 operator [](unsigned pos) { return elArray[pos]; };
+ uint16 safeLen(unsigned pos) { return pos>=Length ? 0 : elArray[pos]; };
+ void set(unsigned pos, uint16 val);
+ void insert(unsigned pos, uint16 val);
+ void del(unsigned pos);
+ void deleteRange(unsigned from,unsigned to);
+ uint32 getAttr(unsigned line) { return elArrayAttr[line]; };
+ void setAttr(unsigned line, uint32 val);
+ void setAll(unsigned line, uint16 length, uint32 attr);
+ unsigned Length;
+ uint16 *elArray;
+ uint32 *elArrayAttr;
+
+protected:
+ void Resize(unsigned size);
+ unsigned MaxPos;
+};
+
+#endif // Uses_LineLengthArray
+
+
+#if defined( Uses_TCEditor ) && !defined( __TCEditor__ )
+#define __TCEditor__
+
+class TRect;
+class TScrollBar;
+class TSIndicator;
+class TIndicator;
+class TEvent;
+class TSubMenu;
+class TSpCollection;
+struct stEditorId;
+
+const int MaxRecMacroLen=250;
+const int MaxXYRingStack=12;
+
+class XYRingStack
+{
+public:
+ XYRingStack();
+ void push(uint32 x, uint32 y);
+ int pop(uint32 &x, uint32 &y);
+
+protected:
+ uint32 Xarray[MaxXYRingStack];
+ uint32 Yarray[MaxXYRingStack];
+ int pushPos,basePos;
+};
+
+const unsigned lastColMarker=(unsigned)-1;
+
+class TCEditor : public TViewPlus
+{
+public:
+
+ TCEditor( const TRect&, TScrollBar *, TScrollBar *, TSIndicator *, const char *,
+ Boolean openRO=False );
+
+ virtual ~TCEditor();
+ virtual void shutDown();
+ char bufChar( unsigned Pos ) { return buffer[Pos]; };
+ unsigned bufPtr( unsigned Pos ) { return Pos; };
+ virtual void changeBounds( const TRect& );
+ virtual void convertEvent( TEvent& );
+ Boolean cursorVisible();
+ void deleteSelect();
+ virtual void doneBuffer();
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+
+ // Handle event is divided in sub handle
+ virtual void handleEvent( TEvent& );
+ void handleMouse(TEvent &event);
+ void handleKey(TEvent &event);
+ int handleCommand(ushort command);
+
+ virtual void initBuffer();
+ Boolean insertBuffer( char *, unsigned, unsigned, Boolean, Boolean, Boolean moveToEnd=True );
+ virtual Boolean insertFrom( TCEditor * );
+ Boolean insertText( const void *, unsigned, Boolean );
+ unsigned CopySelToBuffer(char *b, unsigned l);
+ void scrollTo( int, int );
+ Boolean search( const char *, unsigned );
+ virtual Boolean setBufSize( unsigned );
+ void setCmdState( uint16 command, Boolean enable );
+ void setSelect( unsigned, unsigned, Boolean);
+ virtual void setState( uint16 aState, Boolean enable );
+ void trackCursor( Boolean );
+ void undo();
+ void BlockUndoInfoStartFill(UndoCell &un, UndoState type, char *start, char *end);
+ void BlockUndoInfoEndFill(UndoCell &un);
+ virtual void updateCommands(int full=0);
+ virtual void updateRectCommands();
+
+ Boolean clipCopy();
+ Boolean clipWinCopy(int id);
+ Boolean clipFileCopy();
+ void clipCut();
+ void clipPaste();
+ void clipWinPaste(int id);
+ void clipFilePaste();
+ void deleteRange( unsigned , unsigned, Boolean );
+ void doUpdate();
+ Boolean doSearchReplace();
+ void drawLines( int, int, unsigned );
+ void find();
+ Boolean hasSelection() { return Boolean(selStart<selEnd); };
+ Boolean hasVisibleSelection() { return Boolean(!selHided && selStart<selEnd); };
+//{ return Boolean(IslineInEdition ? selLineStart<selLineEnd : selStart<selEnd); };
+ void hideSelect();
+ Boolean isClipboard() { return Boolean(clipboard == this); };
+ void lock() { lockCount++; };
+ void newLine();
+ //int AnalizeLineForIndent(char *s, int x, Boolean &mu, int l, int avail);
+ int AnalizeLineForIndent(char *s, int x, Boolean &mu, int l, char *lineStart,
+ char *prevLine, int prevLineNum);
+ int SkipComment1(char *&sp, int &avail, int &col);
+ int SkipComment2(char *&sp, int &avail, int &col);
+ void FindFirstChar(char *s, int x, int l, char *&fch, int &fcol, int &laf);
+ static int Comment1Here(char *s, int l);
+ static int Comment2Here(char *s, int l);
+ static int EOLCommentHere(char *s, int l);
+ unsigned nextWordC( unsigned );
+ int goEndWord();
+ char *WordUnderCursor(uint32 maxLength=256, unsigned options=0);
+ char *sLispUnderCursor(uint32 maxLength);
+ void RunSLispAsk();
+ Boolean StringUnderCursor(uint32 &word_start, uint32 &word_end);
+ void replace();
+ void setBufLen( unsigned );
+ void startSelect();
+ void toggleInsMode( Boolean allowUndo );
+ void unlock();
+ void update( uchar );
+ void checkScrollBar( const TEvent&, TScrollBar *, int& );
+ unsigned LenWithoutCRLF(unsigned yInFile,char *lineStart);
+ void ExpandAllTabs(Boolean interactive);
+ void CompactBuffer(Boolean interactive);
+ void SourceToHTML(FILE *f, unsigned *pal, unsigned flags);
+ void SourceToHTML_Old(FILE *f, unsigned *pal, unsigned flags);
+ void SourceToHTML_CSS(FILE *f, unsigned *pal, unsigned flags);
+ uint32 CompactFlags(void);
+ void ExpandFlags(uint32 t,Boolean allowUndo=True);
+ Boolean selRectCopy(Boolean allowUndo=True);
+ Boolean selRectPaste(struct selRecSt *st, int X, int Y, Boolean allowUndo=True);
+ Boolean selRectDelete(int X1, int Y1, int X2, int Y2, Boolean allowUndo=True);
+ void selRectToUpper();
+ void selRectToLower();
+ void UndoRectangularPasteClear(UndoCell &un);
+ Boolean FillUndoForRectangularPasteClear(int Height,struct UndoCell &un,UndoState st);
+ Boolean FillUndoForRectangularStartEnd(UndoState st);
+ void undoOneAction();
+ void RevertModifFlagInUndo();
+ void RemapCodePageBuffer(int sourID, int destID, unsigned ops, Boolean allowUndo=True);
+ // Global options managment, global to allow setting while there isn't any editor
+ // opened.
+ static void SetGlobalOptions(void);
+ static void ExpandGlobalOptions(GlobalOptionsRect *temp);
+ static void CompactGlobalOptions(GlobalOptionsRect *temp);
+ void ExpandGlobalOptionsLocally(GlobalOptionsRect *temp);
+
+ TScrollBar *hScrollBar;
+ TScrollBar *vScrollBar;
+ TSIndicator *indicator;
+ TIndicator *OldIndicator;
+ char *buffer;
+ unsigned bufSize;
+ unsigned bufLen;
+ unsigned gapLen;
+ unsigned selStart;
+ unsigned selEnd;
+ unsigned curPtr;
+ TPoint delta;
+ TPoint limit;
+ unsigned drawPtr;
+ unsigned delCount;
+ unsigned insCount;
+ Boolean isValid;
+ Boolean canUndo;
+ Boolean modified;
+ unsigned modifiedCounter; // Changes each time the file is modified
+ void MarkAsModified() { modified=True; modifiedCounter++; updateFlags&=~ufHLChar; };
+ Boolean selecting;
+ Boolean overwrite;
+ Boolean isReadOnly;
+
+ Boolean autoIndent; // Indent when ENTER is pressed
+ static Boolean staticAutoIndent; // the static version
+ Boolean intelIndent; // try to be smart in the autoindent
+ static Boolean staticIntelIndent; // the static version
+ unsigned tabSize; // The size of the tabulator
+ static unsigned staticTabSize; // the static version
+ Boolean UseTabs; // True if when we press Tab an ascii 9 is inserted
+ static Boolean staticUseTabs; // the static version
+ Boolean PersistentBlocks; // True if the blocks isn't deleted after a move
+ static Boolean staticPersistentBlocks; // the static version
+ Boolean ShowMatchPair; // True if the editor highlights the match pair
+ static Boolean staticShowMatchPair; // the static version
+ Boolean ShowMatchPairFly;
+ static Boolean staticShowMatchPairFly;
+ static TCEditor *showMatchPairFlyCache;
+ Boolean ShowMatchPairNow;
+ static Boolean staticShowMatchPairNow;
+ static Boolean staticNoMoveToEndPaste; // True if the cursor is moved to the end of
+ // the pasted area.
+ Boolean TransparentSel; // True if you can see through the slelection
+ static Boolean staticTransparentSel; // the static version
+ Boolean OptimalFill; // When True the editor tries to fill all the gaps
+ // with tabs instead of spaces
+ static Boolean staticOptimalFill;// the static version
+ Boolean WrapLine; // If True wraps the line after WrapCol columns
+ static Boolean staticWrapLine; // static version
+ int WrapCol; // Column to wrap
+ static int staticWrapCol; // Default column
+ Boolean DontPurgeSpaces; // Don't purge spaces at the end of lines
+ static Boolean staticDontPurgeSpaces; // the static version
+ Boolean SeeTabs; // If true the tabs are painted to be visible
+ static Boolean staticSeeTabs; // the static version
+ static char oTabChar; // When selected the tabs are drawed as a character
+ // that's the PC437 code for it.
+ static char TabChar; // That's the value for the current codepage
+ Boolean NoInsideTabs; // When True the cursor can't be inside a tab
+ static Boolean staticNoInsideTabs; // the static version
+ Boolean TabIndents; // Tab indents and doesn't move to the next tabulator
+ static Boolean staticTabIndents;// the static version
+ Boolean BackSpUnindents; // Backspace unindents looking for a hole in prev. line
+ static Boolean staticBackSpUnindents;// the static version
+ Boolean UseIndentSize; // Use the indent size instead of the tab size
+ static Boolean staticUseIndentSize; // the static version
+ unsigned indentSize; // The ammount to indent when the above is true
+ static unsigned staticIndentSize; // the static version
+ Boolean ColumnMarkers; // Are column markers enabled?
+ static Boolean staticColumnMarkers; // the static version
+
+ // Column markers
+ uint32 *colMarkers; // Columns to be highlighted, an array terminated by (unsigned)-1
+ static uint32 *staticColMarkers; // the static version
+ // Helper functions
+ static int LenColMarkers(uint32 *markers);
+ static uint32 *CopyColMarkers(uint32 *markers);
+ static uint32 *LoadColMarkers(ipstream& is);
+ static void SaveColMarkers(opstream& os, uint32 *markers);
+ static void ColMarkers2Str(uint32 *markers, char *str, unsigned maxLen);
+ static uint32 *Str2ColMarkers(char *str);
+
+ Boolean NoNativeEOL; // True if we are in DOS an the file was UNIX
+ int IsaCompressedFile; // !=0 if we loaded a .gz or .bz2 file and hence we must
+ // save a compressed file.
+ Boolean FailedToLoad; // Used to indicate when we couldn't load the file and
+ // instead created an empty editor.
+
+ static TEditorDialog editorDialog;
+ static unsigned editorFlags;
+ static unsigned fromFlags;
+ static unsigned whereFlags;
+ static char findStr[maxFindStrLenEd];
+ static char replaceStr[maxReplaceStrLenEd];
+ static TCEditor *clipboard;
+ static TCommandSet cmdsAux; // This is used to quickly enable/disable all the
+ // editor commands when it get/releases the focus
+ uchar lockCount;
+ uchar updateFlags;
+ uchar isDisassemblerEditor;
+ int keyState;
+ unsigned WantedCol;
+ void formatLine(void *, unsigned, int, unsigned short, unsigned, uint32,unsigned,uint32 *);
+ void formatLineHighLight(void *, unsigned, int, unsigned short, unsigned, uint32,unsigned,uint32 *);
+ void formatLineHighLightPascal(void *,unsigned,int,unsigned short,unsigned,uint32,unsigned,uint32 *);
+ void formatLineHighLightClipper(void *,unsigned,int,unsigned short,unsigned,uint32,unsigned,uint32 *);
+ void formatLineHighLightGeneric( void *,unsigned,int,unsigned short,unsigned,uint32,unsigned,uint32 *);
+ unsigned lineMove( unsigned p, int count );
+ void TurnOffHighLight(void) { formatLinePtr=&TCEditor::formatLine; SyntaxHL=shlNoSyntax; SHLValueSelected=-1; };
+ void TurnOnCHighLight(void);
+ void TurnOnPascalHighLight(void);
+ void TurnOnClipperHighLight(void);
+ void TurnOnGenericHighLight(void);
+ void SetHighlightTo(shlState sHL, int subSHL=0);
+ void CacheSyntaxHLData(int id);
+ uint32 SyntaxHighlightForOffset(unsigned offset);
+ uint32 SyntaxHighlightExtraFor(char *lineStart, char *posTarget, int line);
+ void *SearchPMTrigger(char *trg);
+ void ChoosePMacroFromList(void);
+ void RecalculateLineAttributes(void);
+ void ProfileEditor(void);
+ void CacheColors(void);
+ void ColorsCacheToIDs(void);
+
+ void InsertCharInLine(char cVal, Boolean allowUndo=True);
+ void SmartTab();
+ void MakeEfectiveLineInEdition(Boolean allowUndo=True);
+ char *ColToPointer();
+ char *ColToPointer(int &Dif);
+ char *ColToPointerPost();
+ int PosLeftChar();
+ int FixPosCharLeft();
+ int nextWord();
+ int prevWord(Boolean moveCursor=True);
+ void MoveCursor(char *ori,char *dest);
+ void EditLine(Boolean allowUndo=True);
+ int ComputeXLineInEdition(Boolean alsoRestChars=False);
+ void deleteRange(char *from,char *to,Boolean allowUndo=True);
+ void deleteRangeLineInEdition(char *from,char *to,int x);
+ int LineWidth();
+ int LineWidth(char *s, char *d);
+ void insertSpaces( unsigned length, int X, Boolean canUseTabs=True );
+ void MoveLinesUp(int i);
+ void MoveLinesDown(int i);
+ void ScrollLinesUp(int lines);
+ void ScrollLinesDown(int lines);
+ void SetStartOfSelecting(unsigned startOffSet);
+ void UpdateSelecting(void);
+ void MoveToMouse( TPoint m, uchar selMode );
+ void MoveCursorTo(unsigned x, unsigned y, Boolean undo=False);
+ void GoAndSelectLine(int line, int column=1, Boolean selectLine=True);
+ int IsFirstCharInLine(void);
+ void GotoOffSet(unsigned o);
+ void JumpEndOfText();
+ void ResetCursorPosition(void);
+ void IndentBlock(char *Fill, Boolean allowUndo=True);
+ void UnIndentBlock(unsigned Amount, Boolean allowUndo=True);
+ void ArbitraryIndent();
+ void CommentIndent();
+ void CommentUnIndent();
+ void BackSpace(Boolean allowUndo=True);
+ void ExpandMacro(void);
+ void ExpandPMacro(void *pm, char *s=NULL, char *trg=NULL);
+ strSHL *LoadPMForCurSHL();
+ void MacroGenerateCode(void);
+ int TestPropagation(uint32 OldAttr,uint32 NewAttr,char *proxLine, uint32 proxLineNum);
+ int SearchCloseSymbol(char open, char close);
+ int SearchCloseSymbol(char open, char close, char *s, char *lastl, int y, int dif);
+ int SearchCloseSymbolXY(char open, char close, int &X, int &Y, char *pos=0);
+ int SearchOpenSymbol(char open, char close);
+ int SearchOpenSymbol(char open, char close, char *s, char *&start, int &y);
+ int SearchOpenSymbolXY(char open, char close, int &X, int &Y, char *pos=0);
+ Boolean SearchMatchOnTheFly();
+ Boolean clipReplace(void);
+ int GoFirstCharInLine(void);
+ void SelWordUnderCursor(void);
+ int nextCWord();
+ void addToUndo(UndoState st, void *p=NULL);
+ void freeUndoCell(int Index);
+ void flushUndoInfo();
+ void redo(void);
+ void UndoSaveFinalState(UndoCell &un);
+ void UndoSaveStartState(UndoCell &un);
+ void BlockToUpper(Boolean allowUndo=True);
+ void BlockToLower(Boolean allowUndo=True);
+ void BlockInvertCase(Boolean allowUndo=True);
+ void BlockAltCase(Boolean allowUndo=True);
+ void BlockCaseChange(UndoState action, Boolean allowUndo=True);
+ void SetCharCase(int option);
+ int AdjustBufEditFor(int lar);
+ void Beep(void);
+ void AdjustLineSel(uint32 pos,int dif,Boolean IncludeStart=False,Boolean toLeft=True);
+ void AdjustDrawPtr(void);
+ void updateCrossCur(void);
+ void setStatusLine(char *s);
+ void RecalculateXofLineInEdit(void);
+ Boolean hasRectSel(void) { return Boolean(!selRectHided && Xr1<Xr2 && Yr1<=Yr2); };
+ unsigned GetOffSetOffLine(int y);
+ unsigned GetOffsetGeneric(int y, int yRef, unsigned lOff);
+ int FindLineForOffSet(unsigned offset, unsigned &rest);
+ int EnsureXDontTab(char *s,int x,int w,char **stop);
+ void lockUndo(void) { undoLockCount++; };
+ void unlockUndo(void);
+ void SetSpecialLines(TSpCollection *aSpCol);
+ void PasteEmacsMode();
+ void QuotedPrintDecode();
+ void InsertKeyName();
+ void ShowWhichFunInStatus();
+ unsigned JumpLineStartSelection();
+ void UpdateSyntaxHLBlock(unsigned firstLine, char *firstTouchedP, unsigned lastLine);
+ // File handle members
+ Boolean loadFile(Boolean setSHL=False);
+ Boolean reLoadFile();
+ Boolean save();
+ Boolean saveAs(Boolean ConvertEOL=False, Boolean AvoidAutoConvert=False);
+ Boolean saveAsConvertEOL() { return saveAs(True); };
+ Boolean saveAsNoConvertEOL() { return saveAs(False,True); };
+ Boolean saveSameTime();
+ Boolean saveFile(Boolean ConvertEOL=False, Boolean AvoidAutoConvert=False,
+ Boolean noChangeTime=False);
+ char *saveToTemp();
+ Boolean checkDiskCopyChanged(Boolean force=False);
+ virtual Boolean valid( ushort );
+ char fileName[PATH_MAX];
+
+ LineLengthArray lenLines; // pseudo-Array with all the line-lengths
+ uint32 totalLines; // Total number of lines
+ uint32 drawLine; // first displayed line
+ uint32 lineInEdition; // Line number in edition process
+ char *curLinePtr; // Pointer to the start of the line where the
+ // cursor is.
+ char *bufEdit; // Buffer to edit a line
+ uint16 bufEditLen; // Allocated memory for bufEdit
+ char *inEditPtr; // Pointer to the cursor inside the line edition
+ // buffer
+ Boolean IslineInEdition; // There is a line under edition?
+ static int DontLoadFile; // If !=0 the read member doesn't really load the text
+ // in memory, but reads all the rest of stuff.
+ TPoint curPos; // Position of cursor inside the file
+ TPoint lastCurPos; // Last position before a move, used for ^Q-P
+ int restCharsInLine; // Number of chars between inEditPtr and the end
+ // of the buffer.
+ unsigned selLineStart; // selStart in a line
+ unsigned selLineEnd; // selEnd in a line
+ unsigned selNewStart; // The value of selXXX when the line in edition
+ unsigned selNewEnd; // will be put in the buffer
+ Boolean selHided; // True if the selection is invisible
+ uint32 selStartOffSet; // The start of a selecting operation
+ void MarkLine(Boolean moveCursor); // Select current line and move cursor to the beggining
+ void SetMarker(unsigned marker);
+ unsigned Markers[10]; // 0=does't exist != It's a marker
+ int MarkersInLine[10]; // -1 Isn't in this line other offset in the line
+
+ XYRingStack CurPosStack; // Cursor position stack, works as a ring
+ void PushCursorPosition();
+ int PopCursorPosition();
+
+ uint32 attrInEdit; // Attributes for the line in edition
+ Boolean NotExpandingMacro; // False if we are expanding a pseudo macro to
+ // avoid an alteration of the selected area
+ //uchar ForceSelection; // Force to set this selecting mode instead
+ // of use the shifts in handleEvent
+ //uchar ForcingSelection; // Enables the other
+
+ UndoCell UndoArray[MAX_UNDO]; // Array with the undo info
+ UndoState UndoSt; // Actual State
+ int UndoBase,UndoActual,UndoTop; // Index in the array
+
+ // a pointer to the function to format the line to be displayed.
+ void (TCEditor::*formatLinePtr)(void *, unsigned, int, unsigned short, unsigned, uint32, unsigned, uint32 *);
+ // a pointer to the function to format calculate the s. hl. attributes
+ unsigned (*LineMeassure)(char *, char *, uint32 &, uint32 *extra);
+ shlState SyntaxHL; // Says the type of syntax highlight used
+ int GenericSHL; // What sub-type if the type is generic
+ int SHLValueSelected; // That's the position in the array of the detected SHL
+ static unsigned char SHLTableUse[4]; // A conversion table to know what generic shl uses an internal SHL
+ static strSHL *SHLArray; // Array of configurable SHLs
+ static strSHL strC; // Cached Syntax HL values
+ static int strCid; // What element is cached
+ static shlState strCtype; // What type is cached (all or just user words)
+ static void InvalidateSHLCache() { strCid=-2; };
+ static int SHLCant; // Number of SHLs defined
+ static const char *shlNames[]; // Compact names for the colors
+ static TStringCollection *SHLGenList; // Names of the SHLs tp choose one
+ static dflOptions dflOps; // Default options settings for SHL=none
+
+ static Boolean Recording;
+ static TSArray<unsigned int> MacroArray;
+ static int MacroCount;
+
+ static unsigned LoadingVersion; // That's the version of the desktop file opened
+ // Is here to comunicate the value between the
+ // ::read functions
+ // CrossCursor
+ Boolean CrossCursorInCol,CrossCursorInRow;
+ static Boolean staticCrossCursorInCol;
+ static Boolean staticCrossCursorInRow;
+ int CrossCursorCol,CrossCursorRow;
+ char CrossCursorBuf[setMaxScreenY];
+ char CrossCursorBufR[setMaxScreenX];
+ int CrossCursorY2,CrossCursorX2;
+ Boolean CrossCurInCacheC,CrossCurInCacheR;
+
+ // Status Line
+ Boolean IsStatusLineOn;
+ int StatusLinePos; // 1 means is at the end 0 at top
+ static char StatusLine[setMaxScreenX*2];
+
+ // New search options
+ static ushort SearchInSel;
+ static ushort FromWhere;
+ static ushort RegExStyle;
+ static ushort ReplaceStyle;
+ static ushort CanOptimizeRegEx;
+ unsigned StartOfSearch;
+ unsigned selStartF,selEndF;
+ Boolean IsFoundOn;
+ // Variables for the "selection" search
+ static TCEditor *haveCurSelection;
+
+ static int CompileSearch(char *searchStr, char *replaceStr=0);
+ static uint32 MakeASearch(char *text, uint32 len, int &matchLen);
+ static uint32 MakeASearchBack(char *text, uint32 len, int &matchLen);
+ static char *GetTheReplace(int &mustDelete, uint32 &len);
+ static int CompileReplace(char *replaceStr);
+ static char *GetNormalReplace(int &mustDelete, uint32 &len);
+ static char *GetSpecialReplace(int &mustDelete, uint32 &len,char *(*GetHit)(int numHit, int &lenHit));
+ static int CompileRegEx(char *searchStr);
+ static int CompileNormal(char *searchStr);
+ static uint32 MakeANormalSearch(char *block, uint32 size, int &matchLen);
+ static uint32 MakeARegExSearch(char *block, uint32 size, int &matchLen);
+ static int CompilePCRE(char *searchStr);
+ static uint32 MakeAPCRESearch(char *block, uint32 size, int &matchLen);
+ static void FreeRegExMemory(void);
+ Boolean SearchAndJump(char *search, unsigned flags);
+ Boolean SearchSelForB(Boolean back);
+ Boolean SearchSelForward();
+ Boolean SearchSelBackward();
+ void SetSelectionBuffer();
+ void UnsetSelectionBuffer();
+ Boolean CopySelToFindStr(char *destination, unsigned max, Boolean &isWholeWord);
+
+ // Highligth of one char
+ int XHLCO,YHLCO,XHLCC,YHLCC,XHLCo,YHLCo,XHLCc,YHLCc;
+ Boolean IsHLCOn;
+ char OldHLAttr,OldHLAttro;
+
+ // Rectangular selection
+ int Xr1,Yr1,Xr2,Yr2; // Start and end point of the rect. sel
+ Boolean selRectHided; // To hide the sel
+ struct selRecSt *selRectClip;
+
+ // Groups of undo
+ int undoLockCount;
+ int undoGroupCount;
+
+ // To keep track of the position of some lines
+ TSpCollection *SpecialLines;
+
+ // The modification time of the disk copy of the file
+ // 0 if the file isn't in disk
+ time_t DiskTime;
+ // Last time we checked if the file on disk is newer.
+ time_t lastTimeCheck;
+ // Force a check in the next call (don't compute lastTimeCheck).
+ Boolean forceNextTimeCheck;
+ // Number of seconds to wait between checks
+ static uint32 minDifModCheck;
+ // device and starting inode of the file. 0 on new files.
+ stEditorId EditorId;
+ // attributes of the file from stat under Linux or _chmod in DOS
+ CLY_mode_t ModeOfFile;
+
+ // If 1 the colors are already cached
+ static int colorsCached;
+ // Colors cache
+ static uchar cachedColors[];
+
+ // For the pseudo macros by now only one
+ static TPMCollection *PMColl;
+
+ static const char *backupExt;
+ static int (*MakeBkpForIt)(const char *name);
+ // Menu that will be displayed when the right button of the mouse is pressed
+ // It should be set by the TApplication, by default is 0 and the behavior is
+ // the same used for the left button.
+ static TSubMenu *RightClickMenu;
+
+ void ShowLength();
+
+ SetDefStreamMembersCommon(TCEditor,TViewPlus)
+};
+
+SetDefStreamOperators(TCEditor)
+
+// A class to get lines from a TCEditor
+class LineHandler
+{
+public:
+ LineHandler() { ed=NULL; }
+ void setEditor(TCEditor *anEd) { ed=anEd; offset=0; line=0; }
+ int isReady() { return ed!=NULL; }
+ char *getLine(int y, unsigned &len);
+
+protected:
+ unsigned offset;
+ int line;
+ TCEditor *ed;
+};
+
+#endif // Uses_TCEditor
+
+
+#if (defined(Uses_TFindCDialogRec) || defined(Uses_TReplaceCDialogRec)) && \
+ !defined(__TRegexDialogRec__) && defined(Uses_TCEditor)
+#define __TRegexDialogRec__
+struct TRegexDialogRec
+{
+ uint32 regStyle;
+ uint32 repStyle;
+ uint32 optimize;
+};
+
+inline
+void regexRecCreate(TRegexDialogRec &r)
+{
+ r.regStyle=TCEditor::RegExStyle;
+ r.repStyle=TCEditor::ReplaceStyle;
+ r.optimize=TCEditor::CanOptimizeRegEx;
+}
+
+inline
+void regexRecUpdate(TRegexDialogRec &r)
+{
+ TCEditor::RegExStyle=r.regStyle;
+ TCEditor::ReplaceStyle=r.repStyle;
+ TCEditor::CanOptimizeRegEx=r.optimize;
+}
+#endif
+
+
+
+#if defined( Uses_TCEditWindow ) && !defined( __TCEditWindow__ )
+#define __TCEditWindow__
+
+// That's a structure to hold the most important information of an
+// editor window.
+// The coordinates are short because a 32768 screen is big enough ;-)
+struct EditorResumeV2
+{
+ uchar version,dummy;
+ uchar shl,subshl;
+ short origin_x,origin_y;
+ short size_x,size_y;
+ short cursor_x,cursor_y;
+ short zorigin_x,zorigin_y;
+ short zsize_x,zsize_y;
+ uint16 ed_flags,prj_flags;
+};
+
+struct EditorResumeV3
+{
+ uchar version,dummy;
+ uchar shl,subshl;
+ short origin_x,origin_y;
+ short size_x,size_y;
+ short cursor_x,cursor_y;
+ short zorigin_x,zorigin_y;
+ short zsize_x,zsize_y;
+ uint32 ed_flags,prj_flags;
+};
+
+struct EditorResumeV5
+{
+ uchar version,dummy;
+ uchar shl,subshl;
+ short origin_x,origin_y;
+ short size_x,size_y;
+ short cursor_x,cursor_y;
+ short zorigin_x,zorigin_y;
+ short zsize_x,zsize_y;
+ uint32 ed_flags,prj_flags;
+ unsigned tabSize,indentSize,wrapCol;
+};
+
+struct EditorResume
+{
+ uchar version,dummy;
+ uchar shl,subshl;
+ short origin_x,origin_y;
+ short size_x,size_y;
+ short cursor_x,cursor_y;
+ short zorigin_x,zorigin_y;
+ short zsize_x,zsize_y;
+ uint32 ed_flags,prj_flags;
+ unsigned tabSize,indentSize,wrapCol;
+ uint32 extraSize;
+ time_t dateResume;
+};
+
+#define CopyEditorResume(dst,sou) memcpy(dst,sou,sizeof(EditorResume))
+
+class TCEditWindow : public TWindow
+{
+public:
+ TCEditWindow( const TRect&, const char *, int, Boolean openRO=False );
+ ~TCEditWindow();
+ virtual void close();
+ virtual const char *getTitle( short );
+ virtual void handleEvent( TEvent& );
+ virtual void sizeLimits( TPoint& min, TPoint& max );
+ virtual TPalette& getPalette() const;
+
+ void FillResume(EditorResume &r);
+ void ApplyResume(EditorResume &r);
+ static void ReadResume(EditorResume &r, ipstream& is);
+ static void SaveResume(EditorResume &r, opstream& os);
+ static void FillResumeWith(EditorResume &r,TPoint &origin,TPoint &size,TPoint &cursor);
+
+ TCEditor *editor;
+
+protected:
+ static const char *clipboardTitle;
+ static stTVIntl *iClipboardTitle;
+ static const char *untitled;
+ static stTVIntl *iUntitled;
+
+ static void EnlargeSizesResume(EditorResume &r);
+ static void EnlargeSizeResume(short &x, short &y, int wS, int hS);
+ static void ReduceSizesResume(EditorResume &r);
+ static void ReduceSizeResume(short &x, short &y, int wS, int hS);
+
+ static const int ResumeVersion;
+
+ SetDefStreamMembersNoConst(TCEditWindow)
+};
+
+SetDefStreamOperators(TCEditWindow)
+
+#endif // Uses_TCEditWindow
+
+#endif
diff --git a/setedit/include/ced_coma.h b/setedit/include/ced_coma.h
new file mode 100644
index 0000000..93b4ea1
--- /dev/null
+++ b/setedit/include/ced_coma.h
@@ -0,0 +1,355 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined( Uses_TCEditor_Commands ) && !defined( __TCEditor_Commands__ )
+#define __TCEditor_Commands__
+
+const int
+/* Robert's TV library supports enable/disable commands for commands up to
+ 1023. A safe value for RHIDE is from 600. */
+ cmbBaseNumber = 600,
+ cmbCtrlK = 254,
+ cmbCtrlQ = 255,
+ cmbToLower = 1,
+ cmbSelLength = 2,
+ cmbFirstLineInScreen = 3,
+ cmbLastLineInScreen = 4,
+ cmbIndentBlkOne = 5,
+ cmbUnIndentBlkOne = 6,
+ cmbIndentBlk = 7,
+ cmbUnIndentBlk = 8,
+ cmbSearchStart = 9,
+ cmbSearchEnd = 10,
+ cmbExpandCode = 11,
+ cmbDelPrevWord = 12,
+ cmbEndSelect = 13,
+ cmbSmartUnIndent = 14,
+ cmbSmartIndent = 15,
+ cmbReplaceSelect = 16,
+ cmbGotoEditorLine = 17,
+ cmbGoBeginBlock = 18,
+ cmbGoEndBlock = 19,
+ cmbMarkLine = 20,
+ cmbMarkWord = 21,
+ cmbMoveBlock = 22,
+ cmbScrollDown = 23,
+ cmbScrollUp = 24,
+ cmbPutMark0 = 25,
+ cmbPutMark1 = 26,
+ cmbPutMark2 = 27,
+ cmbPutMark3 = 28,
+ cmbPutMark4 = 29,
+ cmbPutMark5 = 30,
+ cmbPutMark6 = 31,
+ cmbPutMark7 = 32,
+ cmbPutMark8 = 33,
+ cmbPutMark9 = 34,
+ cmbGotoMark0 = 35,
+ cmbGotoMark1 = 36,
+ cmbGotoMark2 = 37,
+ cmbGotoMark3 = 38,
+ cmbGotoMark4 = 39,
+ cmbGotoMark5 = 40,
+ cmbGotoMark6 = 41,
+ cmbGotoMark7 = 42,
+ cmbGotoMark8 = 43,
+ cmbGotoMark9 = 44,
+ cmbInsertText = 45,
+ cmbReadBlock = 46,
+ cmbWriteBlock = 47,
+ cmbNewLine = 48,
+ cmbBackSpace = 49,
+ cmbCharLeft = 50,
+ cmbCharRight = 51,
+ cmbWordLeft = 52,
+ cmbWordRight = 53,
+ cmbLineStart = 54,
+ cmbLineEnd = 55,
+ cmbLineUp = 56,
+ cmbLineDown = 57,
+ cmbPageUp = 58,
+ cmbPageDown = 59,
+ cmbTextStart = 60,
+ cmbTextEnd = 61,
+ cmbDelChar = 62,
+ cmbDelWord = 63,
+ cmbDelStart = 64,
+ cmbDelEnd = 65,
+ cmbDelLine = 66,
+ cmbInsMode = 67,
+ cmbStartSelect = 68,
+ cmbHideSelect = 69,
+ cmbIndentMode = 70,
+ cmbUpdateTitle = 71,
+ cmbCut = 72,
+ cmbCopy = 73,
+ cmbPaste = 74,
+ cmbUndo = 75,
+ cmbSearchAgain = 76,
+ cmbClear = 77,
+ cmbReplace = 78,
+ cmbFind = 79,
+ cmbSearchOpPar = 80,
+ cmbSearchClPar = 81,
+ cmbSearchOpCor = 82,
+ cmbSearchClCor = 83,
+ cmbToUpper = 84,
+ cmbRedo = 85,
+ cmbSetLocalOptions = 86,
+ cmbExpandAllTabs = 87,
+ cmbCompactBuffer = 88,
+ cmbRecordMacro = 89,
+ cmbStopMacro = 90,
+ cmbPlayMacro = 91,
+ cmbSetGlobalOptions = 92,
+ cmbSaveAsConvertEOL = 93,
+ cmbCopyBlock = 94,
+ cmbSelRectStart = 95,
+ cmbSelRectEnd = 96,
+ cmbSelRectCopy = 97,
+ cmbSelRectPaste = 98,
+ cmbSelRectDel = 99,
+ cmbSelRectCut = 100,
+ cmbSelRectMove = 101,
+ cmbSelRectHide = 102,
+ cmbLastPosCur = 103,
+ cmbToggleMoveOnPaste = 104,
+ cmbJumpToFunction = 105,
+ cmbProfileEditor = 106,
+ cmbColorsChanged = 107,
+ cmbLoadFileUnderCur = 108,
+ cmbSearchComplement = 109,
+ cmbCopyClipWin = 110, // Old name, deprecated
+ cmbCopyOSClip = 110,
+ cmbPasteClipWin = 111, // Old name, deprecated
+ cmbPasteOSClip = 111,
+ cmbIntelIndentMode = 112,
+ cmbDelCharClear = 113,
+ cmbSave = 114,
+ cmbSaveAs = 115,
+ cmbChooseMacro = 116,
+ cmbRepeatMacro = 117,
+ cmbGenCodeForMacro = 118,
+ cmbSelectOn = 119,
+ cmbSelectOff = 120,
+ cmbSaveSameTime = 121,
+ cmbWrapOn = 122,
+ cmbWrapOff = 123,
+ cmbWrapToggle = 124,
+ cmbUpdateCodePage = 125,
+ cmbMouseToggle = 126,
+ cmbSelRectToUpper = 127,
+ cmbSelRectToLower = 128,
+ cmbPasteEmacsMode = 129,
+ cmbGoEndOfWord = 130,
+ cmbForceMatchPairHL = 131,
+ cmbChoosePMacrosList = 132,
+ cmbPushCursorPos = 133,
+ cmbPopCursorPos = 134,
+ cmbToggleCharCase = 135,
+ cmbJumpToPrototype = 136,
+ cmbCutClipWin = 137,
+ cmbCutOSClip = 137,
+ cmbQuotedPrintDecode = 138,
+ cmbArbitraryIndent = 139,
+ cmbLastColInScreen = 140,
+ cmbLineOrScrEnd = 141,
+ cmbWhichFunctionIs = 142,
+ cmbCommentIndent = 143,
+ cmbCommentUnIndent = 144,
+ cmbInvertCase = 145,
+ cmbAltCase = 146,
+ cmbInsertKeyName = 147,
+ cmbRunSel_sLisp = 148,
+ cmbRunEnter_sLisp = 149,
+ cmbCopyClipFile = 150,
+ cmbPasteClipFile = 151,
+ cmbEditorGotFocus = 152,
+ cmbJumpLastCursorPos = 153,
+ cmbInsertNewLine = 154,
+ cmbSaveAsNoConvertEOL= 155,
+ cmbExpandAllTabsNi = 156,
+ cmbCompactBufferNi = 157,
+ cmbSearchSelForward = 158,
+ cmbSearchSelBackward = 159,
+ cmbSmartTab = 160,
+
+ cmbLastCommand = 161;
+
+
+const int
+ cmcCtrlK = cmbCtrlK+cmbBaseNumber,
+ cmcCtrlQ = cmbCtrlQ+cmbBaseNumber,
+ cmcToUpper = cmbToUpper+cmbBaseNumber,
+ cmcToLower = cmbToLower+cmbBaseNumber,
+ cmcSelLength = cmbSelLength+cmbBaseNumber,
+ cmcFirstLineInScreen = cmbFirstLineInScreen+cmbBaseNumber,
+ cmcLastLineInScreen = cmbLastLineInScreen+cmbBaseNumber,
+ cmcIndentBlkOne = cmbIndentBlkOne+cmbBaseNumber,
+ cmcUnIndentBlkOne = cmbUnIndentBlkOne+cmbBaseNumber,
+ cmcIndentBlk = cmbIndentBlk+cmbBaseNumber,
+ cmcUnIndentBlk = cmbUnIndentBlk+cmbBaseNumber,
+ cmcSearchStart = cmbSearchStart+cmbBaseNumber,
+ cmcSearchEnd = cmbSearchEnd+cmbBaseNumber,
+ cmcExpandCode = cmbExpandCode+cmbBaseNumber,
+ cmcDelPrevWord = cmbDelPrevWord+cmbBaseNumber,
+ cmcEndSelect = cmbEndSelect+cmbBaseNumber,
+ cmcSmartUnIndent = cmbSmartUnIndent+cmbBaseNumber,
+ cmcSmartIndent = cmbSmartIndent+cmbBaseNumber,
+ cmcReplaceSelect = cmbReplaceSelect+cmbBaseNumber,
+ cmcGotoEditorLine = cmbGotoEditorLine+cmbBaseNumber,
+ cmcGoBeginBlock = cmbGoBeginBlock+cmbBaseNumber,
+ cmcGoEndBlock = cmbGoEndBlock+cmbBaseNumber,
+ cmcMarkLine = cmbMarkLine+cmbBaseNumber,
+ cmcMarkWord = cmbMarkWord+cmbBaseNumber,
+ cmcMoveBlock = cmbMoveBlock+cmbBaseNumber,
+ cmcScrollDown = cmbScrollDown+cmbBaseNumber,
+ cmcScrollUp = cmbScrollUp+cmbBaseNumber,
+ cmcPutMark0 = cmbPutMark0+cmbBaseNumber,
+ cmcPutMark1 = cmbPutMark1+cmbBaseNumber,
+ cmcPutMark2 = cmbPutMark2+cmbBaseNumber,
+ cmcPutMark3 = cmbPutMark3+cmbBaseNumber,
+ cmcPutMark4 = cmbPutMark4+cmbBaseNumber,
+ cmcPutMark5 = cmbPutMark5+cmbBaseNumber,
+ cmcPutMark6 = cmbPutMark6+cmbBaseNumber,
+ cmcPutMark7 = cmbPutMark7+cmbBaseNumber,
+ cmcPutMark8 = cmbPutMark8+cmbBaseNumber,
+ cmcPutMark9 = cmbPutMark9+cmbBaseNumber,
+ cmcGotoMark0 = cmbGotoMark0+cmbBaseNumber,
+ cmcGotoMark1 = cmbGotoMark1+cmbBaseNumber,
+ cmcGotoMark2 = cmbGotoMark2+cmbBaseNumber,
+ cmcGotoMark3 = cmbGotoMark3+cmbBaseNumber,
+ cmcGotoMark4 = cmbGotoMark4+cmbBaseNumber,
+ cmcGotoMark5 = cmbGotoMark5+cmbBaseNumber,
+ cmcGotoMark6 = cmbGotoMark6+cmbBaseNumber,
+ cmcGotoMark7 = cmbGotoMark7+cmbBaseNumber,
+ cmcGotoMark8 = cmbGotoMark8+cmbBaseNumber,
+ cmcGotoMark9 = cmbGotoMark9+cmbBaseNumber,
+ cmcInsertText = cmbInsertText+cmbBaseNumber,
+ cmcReadBlock = cmbReadBlock+cmbBaseNumber,
+ cmcWriteBlock = cmbWriteBlock+cmbBaseNumber,
+ cmcNewLine = cmbNewLine+cmbBaseNumber,
+ cmcBackSpace = cmbBackSpace+cmbBaseNumber,
+ cmcCharLeft = cmbCharLeft+cmbBaseNumber,
+ cmcCharRight = cmbCharRight+cmbBaseNumber,
+ cmcWordLeft = cmbWordLeft+cmbBaseNumber,
+ cmcWordRight = cmbWordRight+cmbBaseNumber,
+ cmcLineStart = cmbLineStart+cmbBaseNumber,
+ cmcLineEnd = cmbLineEnd+cmbBaseNumber,
+ cmcLineUp = cmbLineUp+cmbBaseNumber,
+ cmcLineDown = cmbLineDown+cmbBaseNumber,
+ cmcPageUp = cmbPageUp+cmbBaseNumber,
+ cmcPageDown = cmbPageDown+cmbBaseNumber,
+ cmcTextStart = cmbTextStart+cmbBaseNumber,
+ cmcTextEnd = cmbTextEnd+cmbBaseNumber,
+ cmcDelChar = cmbDelChar+cmbBaseNumber,
+ cmcDelWord = cmbDelWord+cmbBaseNumber,
+ cmcDelStart = cmbDelStart+cmbBaseNumber,
+ cmcDelEnd = cmbDelEnd+cmbBaseNumber,
+ cmcDelLine = cmbDelLine+cmbBaseNumber,
+ cmcInsMode = cmbInsMode+cmbBaseNumber,
+ cmcStartSelect = cmbStartSelect+cmbBaseNumber,
+ cmcHideSelect = cmbHideSelect+cmbBaseNumber,
+ cmcIndentMode = cmbIndentMode+cmbBaseNumber,
+ cmcUpdateTitle = cmbUpdateTitle+cmbBaseNumber,
+ cmcCut = cmbCut+cmbBaseNumber,
+ cmcCopy = cmbCopy+cmbBaseNumber,
+ cmcPaste = cmbPaste+cmbBaseNumber,
+ cmcUndo = cmbUndo+cmbBaseNumber,
+ cmcSearchAgain = cmbSearchAgain+cmbBaseNumber,
+ cmcClear = cmbClear+cmbBaseNumber,
+ cmcReplace = cmbReplace+cmbBaseNumber,
+ cmcFind = cmbFind+cmbBaseNumber,
+ cmcSearchOpPar = cmbSearchOpPar+cmbBaseNumber,
+ cmcSearchClPar = cmbSearchClPar+cmbBaseNumber,
+ cmcSearchOpCor = cmbSearchOpCor+cmbBaseNumber,
+ cmcSearchClCor = cmbSearchClCor+cmbBaseNumber,
+ cmcRedo = cmbRedo+cmbBaseNumber,
+ cmcSetLocalOptions = cmbSetLocalOptions+cmbBaseNumber,
+ cmcExpandAllTabs = cmbExpandAllTabs+cmbBaseNumber,
+ cmcCompactBuffer = cmbCompactBuffer+cmbBaseNumber,
+ cmcRecordMacro = cmbRecordMacro+cmbBaseNumber,
+ cmcStopMacro = cmbStopMacro+cmbBaseNumber,
+ cmcPlayMacro = cmbPlayMacro+cmbBaseNumber,
+ cmcSetGlobalOptions = cmbSetGlobalOptions+cmbBaseNumber,
+ cmcSaveAsConvertEOL = cmbSaveAsConvertEOL+cmbBaseNumber,
+ cmcCopyBlock = cmbCopyBlock+cmbBaseNumber,
+ cmcSelRectStart = cmbSelRectStart+cmbBaseNumber,
+ cmcSelRectEnd = cmbSelRectEnd+cmbBaseNumber,
+ cmcSelRectCopy = cmbSelRectCopy+cmbBaseNumber,
+ cmcSelRectPaste = cmbSelRectPaste+cmbBaseNumber,
+ cmcSelRectDel = cmbSelRectDel+cmbBaseNumber,
+ cmcSelRectCut = cmbSelRectCut+cmbBaseNumber,
+ cmcSelRectMove = cmbSelRectMove+cmbBaseNumber,
+ cmcSelRectHide = cmbSelRectHide+cmbBaseNumber,
+ cmcLastPosCur = cmbLastPosCur+cmbBaseNumber,
+ cmcToggleMoveOnPaste = cmbToggleMoveOnPaste+cmbBaseNumber,
+ cmcJumpToFunction = cmbJumpToFunction+cmbBaseNumber,
+ cmcProfileEditor = cmbProfileEditor+cmbBaseNumber,
+ cmcColorsChanged = cmbColorsChanged+cmbBaseNumber,
+ cmcLoadFileUnderCur = cmbLoadFileUnderCur+cmbBaseNumber,
+ cmcSearchComplement = cmbSearchComplement+cmbBaseNumber,
+ cmcCopyClipWin = cmbCopyClipWin+cmbBaseNumber,
+ cmcPasteClipWin = cmbPasteClipWin+cmbBaseNumber,
+ cmcIntelIndentMode = cmbIntelIndentMode+cmbBaseNumber,
+ cmcDelCharClear = cmbDelCharClear+cmbBaseNumber,
+ cmcSave = cmbSave+cmbBaseNumber,
+ cmcSaveAs = cmbSaveAs+cmbBaseNumber,
+ cmcChooseMacro = cmbChooseMacro+cmbBaseNumber,
+ cmcRepeatMacro = cmbRepeatMacro+cmbBaseNumber,
+ cmcGenCodeForMacro = cmbGenCodeForMacro+cmbBaseNumber,
+ cmcSelectOn = cmbSelectOn+cmbBaseNumber,
+ cmcSelectOff = cmbSelectOff+cmbBaseNumber,
+ cmcSaveSameTime = cmbSaveSameTime+cmbBaseNumber,
+ cmcWrapOn = cmbWrapOn+cmbBaseNumber,
+ cmcWrapOff = cmbWrapOff+cmbBaseNumber,
+ cmcWrapToggle = cmbWrapToggle+cmbBaseNumber,
+ // No longer used:
+ //cmcUpdateCodePage = cmbUpdateCodePage+cmbBaseNumber,
+ cmcMouseToggle = cmbMouseToggle+cmbBaseNumber,
+ cmcSelRectToUpper = cmbSelRectToUpper+cmbBaseNumber,
+ cmcSelRectToLower = cmbSelRectToLower+cmbBaseNumber,
+ cmcPasteEmacsMode = cmbPasteEmacsMode+cmbBaseNumber,
+ cmcGoEndOfWord = cmbGoEndOfWord+cmbBaseNumber,
+ cmcForceMatchPairHL = cmbForceMatchPairHL+cmbBaseNumber,
+ cmcChoosePMacrosList = cmbChoosePMacrosList+cmbBaseNumber,
+ cmcPushCursorPos = cmbPushCursorPos+cmbBaseNumber,
+ cmcPopCursorPos = cmbPopCursorPos+cmbBaseNumber,
+ cmcToggleCharCase = cmbToggleCharCase+cmbBaseNumber,
+ cmcJumpToPrototype = cmbJumpToPrototype+cmbBaseNumber,
+ cmcCutClipWin = cmbCutClipWin+cmbBaseNumber,
+ cmcQuotedPrintDecode = cmbQuotedPrintDecode+cmbBaseNumber,
+ cmcArbitraryIndent = cmbArbitraryIndent+cmbBaseNumber,
+ cmcLastColInScreen = cmbLastColInScreen+cmbBaseNumber,
+ cmcLineOrScrEnd = cmbLineOrScrEnd+cmbBaseNumber,
+ cmcWhichFunctionIs = cmbWhichFunctionIs+cmbBaseNumber,
+ cmcCommentIndent = cmbCommentIndent+cmbBaseNumber,
+ cmcCommentUnIndent = cmbCommentUnIndent+cmbBaseNumber,
+ cmcInvertCase = cmbInvertCase+cmbBaseNumber,
+ cmcAltCase = cmbAltCase+cmbBaseNumber,
+ cmcInsertKeyName = cmbInsertKeyName+cmbBaseNumber,
+ cmcRunSel_sLisp = cmbRunSel_sLisp+cmbBaseNumber,
+ cmcRunEnter_sLisp = cmbRunEnter_sLisp+cmbBaseNumber,
+ cmcCopyClipFile = cmbCopyClipFile+cmbBaseNumber,
+ cmcPasteClipFile = cmbPasteClipFile+cmbBaseNumber,
+ cmcEditorGotFocus = cmbEditorGotFocus+cmbBaseNumber,
+ cmcJumpLastCursorPos = cmbJumpLastCursorPos+cmbBaseNumber,
+ cmcInsertNewLine = cmbInsertNewLine+cmbBaseNumber,
+ cmcSaveAsNoConvertEOL= cmbSaveAsNoConvertEOL+cmbBaseNumber,
+ cmcExpandAllTabsNi = cmbExpandAllTabsNi+cmbBaseNumber,
+ cmcCompactBufferNi = cmbCompactBufferNi+cmbBaseNumber,
+ cmcSearchSelForward = cmbSearchSelForward+cmbBaseNumber,
+ cmcSearchSelBackward = cmbSearchSelBackward+cmbBaseNumber,
+ cmcSmartTab = cmbSmartTab+cmbBaseNumber;
+
+const int cmcFirstMacro=0x2800,
+ cmcLastMacro =0x2FFF;
+
+extern int SearchEdCommand(char *name);
+extern int SearchEditCommand(char *name);
+extern int SearchEditFlag(char *name, unsigned &val);
+extern int SearchSimpleCommand(char *name);
+extern int SearchHelpCtxCommand(char *name);
+extern char *TranslateEdCommand(unsigned cmc_Com);
+class TNoCaseNoOwnerStringCollection;
+extern TNoCaseNoOwnerStringCollection *CreateEdCommandCol(void);
+#endif
diff --git a/setedit/include/ced_exte.h b/setedit/include/ced_exte.h
new file mode 100644
index 0000000..95fed09
--- /dev/null
+++ b/setedit/include/ced_exte.h
@@ -0,0 +1,417 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TCEditor_External) && !defined(TCEditor_External_Included)
+#define TCEditor_External_Included
+
+// ************* General definitions
+
+// ************* Redraw commands
+const int
+ ufUpdate=0x01,
+ ufLine =0x02,
+ ufView =0x04,
+ ufStatus=0x08,
+ ufFound =0x10,
+ ufHLChar=0x20,
+ ufClHLCh=0x40;
+
+// ************* States of the selection
+const int
+ smExtend =0x01,
+ smDouble =0x02,
+ smEndSel =0x04,
+ smStartSel=0x08,
+ smDontSel =0x80;
+
+// ************* Editor dialogs
+const int
+ edOutOfMemory = 0,
+ edReadError = 1,
+ edWriteError = 2,
+ edCreateError = 3,
+ edSaveModify = 4,
+ edSaveUntitled = 5,
+ edSaveAs = 6,
+ edFind = 7,
+ edSearchFailed = 8,
+ edReplace = 9,
+ edReplacePrompt = 10,
+ edLineLenght = 11,
+ edGotoLine = 12,
+ edSetLocalOptions = 13,
+ edLineOverflow = 14,
+ edSetGlobalOptions= 15,
+ edJumpToFunction = 16,
+ edNotFromDisk = 17,
+ edIsReadOnly = 18,
+ edStillReadOnly = 19,
+ edSaveBlock = 20,
+ edReadBlock = 21,
+ edActionWOUndo = 22,
+ edFileExists = 23,
+ edFileNoFile = 24,
+ edCantBkp = 25,
+ edLineTooLong = 26,
+ edRectOutside = 27,
+ edExportHTMLOps = 28,
+ edNoPMacrosAvail = 29,
+ edChoosePMacro = 30,
+ edJumpToPrototype = 31,
+ edArbitraryIndent = 32,
+ edFileCompMant = 33,
+ edCreateTMPError = 34,
+ edSearchAndNoSel = 35,
+ edNothingSelected = 36,
+ edSelTooBig = 37,
+ edSelHaveEOL = 38;
+
+// ************* Various flags
+const int
+ efCaseSensitive = 0x00000001,
+ efWholeWordsOnly = 0x00000002,
+ efRegularEx = 0x00000004,
+ efSearchInComm = 0x00000008,
+ efSearchOutComm = 0x00000010,
+ efShowFuncName = 0x00000020,
+ efPromptOnReplace = 0x00000040,
+ efReplaceAll = 0x00000080,
+
+ efOptimizedRegex = 0x00000200,
+ efDoReplace = 0x00000400,
+ efSearchBack = 0x00000800,
+
+ efBackupFiles = 0x00001000,
+ efSaveEOLasis = 0x00002000,
+ efScrollLock = 0x00004000,
+ efUNIXBkpStyle = 0x00008000,
+ efHiddenBkps = 0x00010000,
+ efDoNotWarnRO = 0x00020000,
+ efROasRO = 0x00040000;
+
+ // The following constants are used by sLisp
+const unsigned
+ efBasicRegExSL = 0x00000000,
+ efExtendedRegExSL = 0x40000000,
+ efPerlRegExSL = 0x80000000,
+ efRexExStyleMask = 0xC0000000,
+ efNormalTextSL = 0x00000000,
+ efTagsTextSL = 0x20000000,
+ efOptimizeRegExSL = 0x00000000,
+ efNoOptimizeRegExSL= 0x10000000,
+ efFromCursorSL = 0x00000000,
+ efFromBegginingSL = 0x08000000,
+ efOnlySelectionSL = 0x04000000,
+ efFindMaskSL = 0x03FFFFFF,
+ efNoFindFailMsg = 0x02000000;
+
+const int
+ efBasicRegEx = 0,
+ efExtendedRegEx = 1,
+ efPerlRegEx = 2;
+
+const int
+ efNormalText = 0,
+ efTagsText = 1;
+
+const int
+ efOptimizeRegEx = 0,
+ efNoOptimizeRegEx = 1;
+
+// Maximun values allowed
+const int
+ setMaxScreenX = 200,
+ setMaxScreenY = 100;
+
+// WordUnderCursor
+const unsigned
+ wucTakeOneLeft = 1,
+ wucIncludeColon = 2,
+ wucCanStartColon= 4;
+
+const unsigned
+ xhtmlTitle = 1,
+ xhtmlBackground = 2,
+ xhtmlMonoFont = 4,
+ xhtmlBoldFont = 8,
+ xhtmlUseCSS =16,
+ xhtmlUseColors = 0x10000;
+
+const int maxArbitraryStrLen=250;
+
+const int opfFail=0, opfOpened=1, opfAlreadyThere=2;
+
+enum shlState { shlNoSyntax=0,shlCSyntax=1,shlPascalSyntax=2,
+ shlClipperSyntax=3,shlGenericSyntax=4 };
+
+// ************* Search structure for keywords
+struct strSETSE
+{
+ char *firstLetters;
+ int *lenTable;
+ int *firstWithLength;
+ char **mainTable;
+ int *equalCharsInNext;
+ int maxLen;
+};
+
+// ************* Generic Syntax Highligth structure
+class TPMCollection;
+
+typedef struct
+{// Default local options
+ uint32 setOpts; // Or mask
+ uint32 resetOpts; // And mask
+ uint16 tabSize; // 0 means none
+ uint16 indentSize;
+ uint16 wrapCol; // 0 means none
+ uint32 *colMarkers;
+} dflOptions;
+
+#include <ced_pcre.h>
+
+class TNLIndentCol;
+class TStringCollection;
+
+struct strSHL
+{
+ char *Name;
+ char OpenCom1[4];
+ int lOpenCom1;
+ char CloseCom1[4];
+ int lCloseCom1;
+ char OpenCom2[4];
+ int lOpenCom2;
+ char CloseCom2[4];
+ int lCloseCom2;
+ char EOLCom1[4];
+ int lEOLCom1;
+ char EOLCom2[4];
+ int lEOLCom2;
+ char HexStart[4];
+ int lHexStart;
+ char Escape;
+ char Preprocessor;
+ char Flags1;
+ char Flags2;
+ char Preprocessor2;
+ char UseInternal;
+ char *Extensions;
+ char *EmacsModes;
+ char *ShellScript;
+ char *PMacros;
+ TPMCollection *PM;
+ ushort SymbolT[256];
+ TStringCollection *Keywords;
+ strSETSE Search;
+ TStringCollection *UserWords;
+ strSETSE SearchUserWords;
+ dflOptions df;
+ // RegEx to match a file/full path for this SHL
+ pcre *NameMatch;
+ pcre *PathMatch;
+ // NewLine Indent rules
+ TNLIndentCol *nlIndent;
+};
+
+#define FG1_CaseSensitive 0x01
+#define FG1_NoNumbers 0x02
+#define FG1_EOLCInFirstCol1 0x04
+#define FG1_PartialKeyword 0x08
+#define FG1_RelaxNumbers 0x10
+#define FG1_UserWordsTried 0x20
+#define FG1_EOLCInFirstCol2 0x40
+#define FG1_EOLCInFirstUse1 0x80
+#define FG2_EOLCInFirstUse2 0x01
+#define FG2_EscapeAnywhere 0x02
+#define FG2_VHDLNumbers 0x04
+#define FG2_VHDLStr1 0x08
+#define FG2_VHDLStr2 0x10
+#define FG2_VHDLShortStr 0x20
+
+/********************************* UNDO types and constants *****************/
+#define MAX_UNDO 256
+#define UNDO_CHARS_SIZE 100
+
+enum UndoState { undoNoUndo, undoInMov, undoPutChar, undoDelChar, undoInsert,
+ undoDelete, undoPreDelete, undoPreInsert, undoDestroyLine,
+ undoDelCharDel, undoCutInMov, undoIndBlockSp,undoIndBlockTab,
+ undoIndBlock, undoPre1IndBlock, undoPre2IndBlock, undoUnIndBlock,
+ undoToUpper, undoToLower, undoOvrPutChar, undoPreInsertSp,
+ undoRectPaste, undoRectDel, undoRectCopy, undoRectStart,
+ undoRectEnd, undoRectHide, undoDeleteBuf, undoPostCopyInfo,
+ undoPreCopyInfo, undoRecodeBlock, undoInvertCase, undoAltCase };
+
+enum UndoDestroy { destBack };
+
+struct BufPlusLen
+{
+ unsigned len;
+ char s[0];
+};
+
+struct RecodeInfo
+{
+ int sourID;
+ int destID;
+ unsigned ops;
+};
+
+struct UndoCell
+{
+ int X,Y;
+ int Xf,Yf;
+ char *s;
+ union
+ {
+ char *s;
+ int l;
+ unsigned OffSet;
+ BufPlusLen *BufL;
+ RecodeInfo *Recode;
+ } s2;
+ UndoState Type;
+ int Length;
+ uint32 selStart,selEnd;
+ uint32 selStartf,selEndf;
+ char Flags;
+ int Count;
+};
+
+struct stUndoInsert
+{
+ char *s;
+ BufPlusLen *Eated;
+ int l;
+};
+
+const int
+ undoSelHided =0x001,
+ undoModified =0x002,
+ undoSelHidedF =0x004,
+ undoModifiedF =0x008,
+ undoOverWriteF =0x010,
+ undoOverWrite =0x020,
+ undoLineInEd =0x040,
+ undoSelRecHided =0x080,
+ undoSelRecHidedF=0x100;
+/************************* End of UNDO types and constants *****************/
+
+// ***************** Various Structures
+const int colMarkersStrLen=256;
+#define LocalOptionsRect GlobalOptionsRect
+struct GlobalOptionsRect
+{
+ uint32 t1;
+ char tab[3];
+ char ind[3];
+ char wcol[4];
+ char colMarkers[colMarkersStrLen];
+};
+const uint32
+ goAutoIndent =0x000001,
+ goUseTabs =0x000002,
+ goPersistentBlocks =0x000004,
+ goIntelIndent =0x000008,
+ goCrossCursorInCol =0x000010,
+ goCrossCursorInRow =0x000020,
+ goShowMatchPair =0x000040,
+ goShowMatchPairFly =0x000080,
+ goShowMatchPairNow =0x000100,
+ goNoMoveToEndPaste =0x000200,
+ goTransparentSel =0x000400,
+ goOptimalFill =0x000800,
+ goWrapLine =0x001000,
+ goScrollLock =0x002000,
+ goSeeTabs =0x004000,
+ goNoInsideTabs =0x008000,
+ goTabIndents =0x010000,
+ goUseIndentSize =0x020000,
+ goDontPurgeSpaces =0x040000,
+ goBackSpUnindents =0x080000,
+ goColumnMarkers =0x100000;
+
+const uint32
+ loOverwrite =0x00001,
+ loAutoIndent =0x00002,
+ loUseTabs =0x00004,
+ loPersistentBlocks =0x00008,
+ loIntelIndent =0x00010,
+ loCrossCursorInCol =0x00020,
+ loCrossCursorInRow =0x00040,
+ loShowMatchPair =0x00080,
+ loShowMatchPairFly =0x00100,
+ loShowMatchPairNow =0x00200,
+ loTransparentSel =0x00400,
+ loOptimalFill =0x00800,
+ loWrapLine =0x01000,
+ loSeeTabs =0x02000,
+ loNoInsideTabs =0x04000,
+ loTabIndents =0x08000,
+ loUseIndentSize =0x10000,
+ loDontPurgeSpaces =0x20000,
+ loBackSpUnindents =0x40000,
+ loColumnMarkers =0x80000;
+
+
+typedef unsigned (*TEditorDialog)( int, ... );
+extern unsigned defEditorDialog( int dialog, ... );
+extern int InitTCEditor(char *s,Boolean force);
+extern char *LoadKeyForTCEditorError(void);
+extern int LoadKeysForTCEditor(char *file);
+extern void LoadKeysForTCEditorFreeMemory();
+extern int PipeTCEditor(unsigned);
+// From loadusew.cc:
+extern void LoadUserWords(strSHL *s, int id);
+extern void TCEditUserWords(char *destinationFile, unsigned contextHelp);
+extern const char *GetNameOfUserWordsFile();
+// From loaddefl.cc:
+extern void LoadDefaultOpts(strSHL *s, int cant);
+extern void TCEditDefaultOpts(char *destinationFile, unsigned ctxHelp);
+extern const char *GetNameOfDefaultOptsFile();
+
+class TDialog;
+// It must be located in the application to customize anything
+ushort execDialog(TDialog *d,void *data);
+
+// Default dialog functions from doedidia.cc
+class TCollection;
+class TPoint;
+class TNSCollection;
+
+typedef struct
+{
+ uint32 t2;
+ TCollection *items;
+ ccIndex selection;
+} ShlDiagBox;
+TDialog *createSetLocalOptions(ShlDiagBox *shlBox);
+TDialog *createGotoLineDialog();
+TDialog *createSetGlobalOptions();
+TDialog *createYesNoAllCancel(TPoint *size, TPoint *cursor);
+TDialog *createFindDialog(void *regexBox);
+TDialog *createReplaceDialog(void *regexBox);
+TDialog *createHTMLExportOps();
+TDialog *createPMChoose();
+TDialog *createArbitraryIndent(int len);
+TDialog *createSolveModifCollision(Boolean haveDiff);
+unsigned LimitedFileNameDialog(unsigned flags, const char *format, const char *file);
+void ShowSavePoint(const char *file);
+Boolean AskForPMVars(char *&varsVals, TNSCollection *vars, unsigned &nVars,
+ unsigned mLenVar, const char *name, TNSCollection *defs);
+
+
+#endif
+
+#if defined(Uses_EditorId) && !defined(EditorId_Defined)
+#define EditorId_Defined
+// Identifies a file stored on disk
+struct stEditorId
+{
+ dev_t dev;
+ ino_t inode;
+};
+
+extern int FillEditorId(stEditorId *id, const char *name=0, struct stat *st=0);
+extern int CompareEditorId(stEditorId *id1, stEditorId *id2);
+extern int IsEmptyEditorId(stEditorId *id);
+#endif
diff --git a/setedit/include/ced_inte.h b/setedit/include/ced_inte.h
new file mode 100644
index 0000000..8724c68
--- /dev/null
+++ b/setedit/include/ced_inte.h
@@ -0,0 +1,313 @@
+/* Copyright (C) 1996-2006 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define TCEDITOR_VERSION 0x000505UL
+#define TCEDITOR_VERSION_STR "v0.5.5"
+#define TCEDITOR_C_YEAR "1996-2006"
+
+#if defined( Uses_TCEditor_Internal ) && !defined( TCEditor_Internal_H )
+#define TCEditor_Internal_H
+
+// *************** Maximun line length supported
+const int
+ DeltaLineLen = 200, // Increment when the actual limit is reached
+ MaxLineLen = 30000, // Maximun maximorum
+ MinLineLen = 80; // Minimun
+
+const uint32
+ sfSearchFailed = UINT_MAX;
+
+const int
+ splEndOfList = -1000;
+
+// *************** Syntax Highlight constants
+#define ComInside 0x00001 // C++ comment in this line
+#define InsideCom 0x00002 // All commented
+#define Prepro 0x00004 // Starts with #
+#define ExtPrepro 0x00008 // Prepro+ends with \ <= be careful
+#define StartCom 0x00010 // /*
+#define EndCom 0x00020 // */
+#define ExtCom 0x00040 // more /* than */
+#define StartInCom 0x00080 // The first char is commented
+#define InsideCom2 0x00100 // All commented with { }
+#define StartCom2 0x00200 // {
+#define EndCom2 0x00400 // }
+#define ExtCom2 0x00800 // more { than }
+#define StartInCom2 0x01000 // The first char is commented
+#define ExtString 0x02000 // a String ends with a \ and is continued on the next line
+#define StartString 0x04000 // the line starts within a string (see ExtString)
+#define ExtOneLineCom 0x08000
+#define StartString2 0x10000
+#define ExtString2 0x20000
+#define StartString3 0x40000
+#define ExtString3 0x80000
+// Extra flags not useful for a line start
+#define InString 0x00001
+#define InString2 0x00002
+#define InString3 0x00004
+#define InComment 0x00008
+#define InPrepro 0x00010
+
+#define Not_ComInside (~ComInside)
+#define Not_InsideCom (~InsideCom)
+#define Not_Prepro (~Prepro)
+#define Not_ExtPrepro (~ExtPrepro)
+#define Not_StartCom (~StartCom)
+#define Not_EndCom (~EndCom)
+#define Not_ExtCom (~ExtCom)
+#define Not_StartInCom (~StartInCom)
+#define Not_InsideCom2 (~InsideCom2)
+#define Not_StartCom2 (~StartCom2)
+#define Not_EndCom2 (~EndCom2)
+#define Not_ExtCom2 (~ExtCom2)
+#define Not_StartInCom2 (~StartInCom2)
+#define Not_ExtString (~ExtString)
+#define Not_StartString (~StartString)
+#define Not_ExtOneLineCom (~ExtOneLineCom)
+#define Not_ExtString2 (~ExtString2)
+#define Not_StartString2 (~StartString2)
+#define Not_ExtString3 (~ExtString3)
+#define Not_StartString3 (~StartString3)
+#define Not_InString (~InString)
+#define Not_InString2 (~InString2)
+#define Not_InString3 (~InString3)
+#define FilterHere (Not_ComInside & Not_StartCom & Not_EndCom & \
+ Not_ExtPrepro & Not_StartCom2 & Not_EndCom2 & \
+ Not_ExtString & Not_StartString & Not_ExtString2 & \
+ Not_StartString2 & Not_ExtString3 & Not_StartString3)
+#define FilterProp (ExtCom | ExtPrepro | ExtCom2 | ExtString | ExtString2 \
+ | ExtString3 | ExtOneLineCom)
+#define PartialCom (StartCom | ComInside | EndCom | StartCom2 | EndCom2)
+#define InsidePascalCom (InsideCom | InsideCom2)
+#define InsideGenericCom (InsideCom | InsideCom2)
+#define StartInPascalCom (StartInCom | StartInCom2)
+#define StartInGenericCom (StartInCom | StartInCom2)
+#define IsInsideCom (ComInside | InsideCom | ExtCom | InsideCom2 | ExtCom2)
+#define IsInsideStr (InString | InString2 | InString3)
+
+// *************** Keyboard binding tables declared in kbfun.h included by
+// kbfun.cc and used in the editor class.
+extern unsigned short kbFunNormal[128];
+extern unsigned short kbFunShift[128];
+extern unsigned short kbFunCtrl[128];
+extern unsigned short kbFunShiftCtrl[128];
+extern unsigned short kbFunCtrlQNorm[128];
+extern unsigned short kbFunCtrlKNorm[128];
+extern unsigned short kbFunCtrlKShift[128];
+
+// **************** Color codes originally defined by Robert
+#define cNormal 1
+#define cMarked 2
+#define cComment 3
+#define cReserved 4
+#define cIdent 5
+#define cSymbol 6
+#define cString 7
+#define cInteger 8
+#define cFloat 9
+#define cOctal 10
+#define cHex 11
+#define cChar 12
+#define cPre 13
+#define cIllegal 14
+#define cUser 15
+#define cCPU 16
+#define cBreak 17
+#define cSymbol2 18
+#define cCrossCur 19
+#define cStatusLi 20
+#define cMPHighL 21
+#define cRectSel 22
+#define cOddTab 23
+#define cEvenTab 24
+#define cColMark 25
+
+#define cNumColors 26
+
+
+/************************* Rectangular Selection defs *****************/
+// Notes:
+// The Xr1 col is included, but not the Xr2, so the width is: Xr2-Xr1
+// The Yr1 row is included AND the Yr2 row too, so the heigth is: Yr2-Yr1+1
+
+struct selRecSt {
+ int Xr1,Yr1; // Top left corner of the original sel.
+ int Xr2,Yr2; // Botton right of the original sel.
+ Boolean selHide; // Only used in the undo blocks
+ int Ycur; // Where the cursor is
+ char s[0]; // Here is where the data start
+};
+/*********************** End of Rectangular Selection defs *****************/
+
+// ******************* String Collections for reserved words
+// The editor can use a non-sorted string collection
+#ifdef USE_TSTRCOL
+class TStrCol : public TStringCollection
+{
+ public:
+ TStrCol(short aLimit, short aDelta) : TStringCollection(aLimit,aDelta) {};
+ int getCount(void) { return count; };
+};
+
+extern TStrCol *ReservedWords;
+extern TStrCol *UserWords;
+extern TStrCol *PascalRWords;
+extern TStrCol *ClipperRWords;
+#else
+class TStringCollection;
+extern TStringCollection *ReservedWords;
+extern TStringCollection *UserWords;
+extern TStringCollection *PascalRWords;
+extern TStringCollection *ClipperRWords;
+#define TStrCol TStringCollection
+#endif
+
+// ****************** Functions
+class TPMCollection;
+extern Boolean LoadPseudoMacroFile(char *name, TPMCollection &coll);
+const unsigned MaxVarValLen=80;
+extern Boolean CreateSHShortCutTables(void);
+extern void DestroySHShortCutTables(void);
+extern Boolean LoadFileUnderCursor(char *lineStart,char *cursor,unsigned l,
+ void (*Message)(const char *msg, void *data),
+ void *data, const char *reference);
+extern char *ExpandFileNameToThePointWhereTheProgramWasLoaded(const char *s);
+extern int CheckForSequence(char *s, int len, int available, char *d);
+extern int CheckForSequenceNotFirst(char *s, int len, int available, char *d);
+extern ccIndex SHLConvValToPos(int a);
+extern int SHLConvPosToVal(ccIndex a);
+class TSOSStringCollection;
+struct strSETSE;
+extern Boolean SETSECreateTables(strSETSE &st, int CaseSens, TStringCollection *TSC);
+extern void SETSEDeleteTables(strSETSE &st);
+
+// isalnum() + _ + all the accents
+const unsigned char ttedIsWordChar=1;
+// () [] {} ,;.
+const unsigned char ttedIsCsymb1 =2;
+// !%&*+-/:<=>?^|~
+const unsigned char ttedIsCsymb2 =4;
+const unsigned char ttedIsCsymb =6;
+// () [] {} ,;.
+const unsigned char ttedIsPasSymb1=8;
+// !#%&*+-/:<=>?@^|
+const unsigned char ttedIsPasSymb2=16;
+const unsigned char ttedIsPasSymb =24;
+// !#%&$*+-/:<=>?@^|() [] {} ,;.
+const unsigned char ttedIsClipSymb=32;
+
+extern unsigned char TableTypesEditor[256];
+
+inline int isWordChar(unsigned char ch)
+{
+ return TableTypesEditor[ch] & ttedIsWordChar ? 1 : 0;
+}
+
+inline int isWordCharColon(unsigned char ch)
+{
+ return (TableTypesEditor[ch] & ttedIsWordChar) || ch==':';
+}
+
+#ifdef DEBUG
+# define MyAssert(p) ((p) ? (void)0 : (void) printf( \
+ "Assertion failed: %s, file %s, line %d\n", \
+ #p, __FILE__, __LINE__ ),getch(),abort() )
+#else
+# define MyAssert(p) ((void)0)
+#endif
+
+
+#define CutIfNotPersistent() if (!PersistentBlocks && hasSelection()) \
+ clipCut()
+#define ClearSelIfNonPers() { if (!PersistentBlocks && hasSelection()) \
+ { \
+ selEnd=selStart=0; \
+ update(ufView); \
+ } \
+ }
+
+/*#define CheckForShiftSelection() { \
+ if (selectMode==smStartSel && NotExpandingMacro && \
+ event.message.command!=cmcExpandCode) \
+ { \
+ if (IslineInEdition) \
+ MakeEfectiveLineInEdition(); \
+ SetStartOfSelecting((uint32)(ColToPointerPost()-buffer)); \
+ selectMode = smExtend; \
+ } }
+*/
+#define CheckForShiftSelection()
+
+// New Palette based on Robert's palette
+#define cpEditor "\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10"\
+ "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E"
+/* colors for the editor
+ 1 : normal text
+ 2 : marked text
+ 3 : comment
+ 4 : reserved word
+ 5 : identifier
+ 6 : symbol
+ 7 : string
+ 8 : integer
+ 9 : float
+ 10 : octal
+ 11 : hex
+ 12 : character
+ 13 : preprocessor
+ 14 : illegal char
+ 15 : user defined word
+ 16 : CPU line ( in RHIDE )
+ 17 : Breakpoint ( in RHIDE )
+ 18 : binary operators
+ 19 : cross cursor
+ 20 : status line
+ 21 : match-pair highlight
+ 22 : rectangular selection
+ 23 : odd tabs
+ 24 : even tabs
+ 25 : column markers
+*/
+
+// ************ Generic Syntax Highlight flags
+#define shl_SYM1 1
+#define shl_SYM2 2
+#define shl_STR1 4
+#define shl_CHAR 8
+#define shl_EOL 16
+#define shl_OPC1 32
+#define shl_OPC2 64
+#define shl_CLOSE1 128
+#define shl_CLOSE2 256
+#define shl_INSNAME 512
+#define shl_BEGNAME 1024
+#define shl_STR2 2048
+#define shl_STR3 4096
+#define shl_SP 8192
+#define shl_SPC 16384
+
+#define SHLFile "syntaxhl.shl"
+
+#define isSymbol1(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_SYM1)
+#define isSymbol2(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_SYM2)
+#define isSymbol(a) (TCEditor::strC.SymbolT[(uchar)a] & (shl_SYM1 | shl_SYM2))
+#define isString(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_STR1)
+#define isString2(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_STR2)
+#define isString3(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_STR3)
+#define isCharacter(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_CHAR)
+#define isEOLComment(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_EOL)
+#define isComment1(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_OPC1)
+#define isComment2(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_OPC2)
+#define isCloseComm1(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_CLOSE1)
+#define isCloseComm2(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_CLOSE2)
+#define isWordCharIn(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_INSNAME)
+#define isWordCharBe(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_BEGNAME)
+#define isSpecialSymb(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_SP)
+#define isSpecialSCon(a) (TCEditor::strC.SymbolT[(uchar)a] & shl_SPC)
+
+extern char CheckSeqCase;
+
+unsigned TCEditor_scan(const void *block, unsigned size, const char *str);
+unsigned TCEditor_iScan(const void *block, unsigned size, const char *str);
+extern int isVHDLBitStringLiteral(const char *s, uint32 &dispo);
+extern int isVHDLAbstractLiteral(const char *s, uint32 &dispo);
+#endif
diff --git a/setedit/include/ced_pcre.h b/setedit/include/ced_pcre.h
new file mode 100644
index 0000000..3a679ad
--- /dev/null
+++ b/setedit/include/ced_pcre.h
@@ -0,0 +1,24 @@
+/* Copyright (C) 2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+// PCRE support
+#ifndef SUP_PCRE
+ #if defined(HAVE_PCRE_LIB)
+ #define SUP_PCRE 1
+ #else
+ #define SUP_PCRE 0
+ #endif
+#endif
+
+#if !SUP_PCRE
+ // Just to avoid errors
+ typedef void pcre;
+ extern void *(*pcre_malloc)(size_t a);
+ extern void (*pcre_free)(void *p);
+#else
+ #define STATIC
+ #include PCRE_HEADER_NAME
+ #undef STATIC
+#endif
+
+
diff --git a/setedit/include/ceditint.h b/setedit/include/ceditint.h
new file mode 100644
index 0000000..2305228
--- /dev/null
+++ b/setedit/include/ceditint.h
@@ -0,0 +1,137 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef CEDITINT_H_SET
+#define CEDITINT_H_SET
+
+// Editor configuration (can modify the next test), must be first.
+#include <configed.h>
+
+// International support from TV
+#ifdef FORCE_INTL_SUPPORT
+ #define HAVE_INTL_SUPPORT 1
+#else
+ #include <tv/configtv.h>
+#endif
+
+#ifndef HAVE_INTL_SUPPORT
+ #define NO_INTL_SUP
+#endif
+
+// Configuration for the Editor:
+// Note: Starting with 0.4.23 I'm changing the mechanism.
+// There are two main configurations, one is for the standalone editor and
+// is the default. The other is used for RHIDE to create libset.a to enable
+// it you must define FOR_LIBSET *externally*. So the libset.gpr/mak have
+// this define and only includes other projects not affected by ceditint.h.
+// Projects like easydiag, settvuti and extra shouldn't include ceditint.h
+// or at least don't rely in features that are related to the FOR_LIBSET
+// definition.
+
+// ** Shared options
+// Gzip support is inside the editor using libz. The support for external
+// gzip is broken and I don't think is a good idea to fix it.
+#define SUP_GZ
+
+#ifndef FOR_LIBSET
+ #define STANDALONE
+ #define SUP_SDG
+#endif
+
+// Starting with 0.4.36 I have a small configure script to determine the
+// following:
+// MP3 support only for standalone
+#if defined(WITH_MP3) && defined(STANDALONE)
+ #define SUP_MP3
+#endif
+
+// PCRE support
+#ifndef SUP_PCRE
+ #if defined(HAVE_PCRE_LIB)
+ #define SUP_PCRE 1
+ #else
+ #define SUP_PCRE 0
+ #endif
+#endif
+
+#ifdef HAVE_PCRE206
+ #define PCRE206 0,
+#else
+ #define PCRE206
+#endif
+
+// Tabs setings
+
+#ifdef Tabs8
+ #define AdvanceWithTab(a,b) if (a==9) b|=7; b++
+ #define NextTabPos(x) (((x/8)+1)*8)
+ #define MoveWithTab(b) b|=7; b++
+ #define IsATabPos(a) (a%8)==0
+#else
+ #define AdvanceWithTab(a,b) if (a==9) b+=tabSize-(b%tabSize); else b++
+ #define NextTabPos(x) (((x/tabSize)+1)*tabSize)
+ #define MoveWithTab(b) b+=tabSize-(b%tabSize)
+ #define IsATabPos(a) (a%tabSize)==0
+#endif
+#define NextIndentPos(x) (((x/indentSize)+1)*indentSize)
+
+// Non standard libc stuff
+
+#if defined(SECompf_djgpp) || defined(SEOS_Win32)
+ #define IDLE_SLEEP 0
+#else
+ #define IDLE_SLEEP 1000
+#endif
+
+//
+// Debug printf. Defining DEBUG the program prints to stderr.
+//
+#ifdef SEComp_GCC
+ #ifndef DEBUG
+ #define dbprintf(a...)
+ #else // DEBUG
+ #ifndef TO_STDOUT
+ #define dbprintf(a...) fprintf(stderr,a)
+ #else
+ #define dbprintf(a...) printf(a)
+ #endif // else TO_STDOUT
+ #endif // else DEBUG
+#else // GCC
+ inline void dbprintf(...) {};
+#endif // else GCC
+
+#ifdef TVComp_BCPP
+ #define popen(command, mode) _popen(command, mode)
+ #define pclose(stream) _pclose(stream)
+#endif
+
+#ifdef Uses_BestWrite
+ #if defined(SECompf_djgpp)
+ #define BestWrite(a,b) _write(STDERR_FILENO,a,b)
+ #define Uses_io
+ #elif defined(SEOS_UNIX)
+ #define BestWrite(a,b) write(STDERR_FILENO,a,b)
+ #define Uses_stdio
+ #elif defined(SEOS_Win32)
+ #define BestWrite(a,b) write(2,a,b)
+ #define Uses_io
+ #endif
+#endif
+
+#ifdef SEOS_Win32
+ // 0 padded
+ #define CLK24_FORMAT "%H:%M "
+ #define CLKAMPM_FORMAT "%I:%M%p "
+#else
+ // DJGPP and Linux have a space padded option
+ #define CLK24_FORMAT "%k:%M "
+ #define CLKAMPM_FORMAT "%l:%M%p "
+#endif
+
+#if defined(SEOS_DOS) || (defined(SEOS_Win32) && !defined(SECompf_Cygwin))
+ // This definition controls how the editor behaves when dealing with
+ // file locations. In DOS/Win32 you don't log as an user with a home
+ // directory.
+ #define NoHomeOrientedOS
+#endif
+
+#endif // CEDITINT_H_SET
diff --git a/setedit/include/ceditor.h b/setedit/include/ceditor.h
new file mode 100644
index 0000000..ef2a9ed
--- /dev/null
+++ b/setedit/include/ceditor.h
@@ -0,0 +1,155 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef Uses_TCEditWindow
+#define _INCL_CED_CLAS_
+#define Uses_TCEditor
+#define Uses_TWindow
+#define Uses_stdio
+#endif
+
+#if defined(Uses_TCEditor) || defined(Uses_TCFileEditor)
+#define _INCL_CED_CLAS_
+#define _INCL_TVSETUTI
+#define Uses_TRect
+#define Uses_TScrollBar
+#define Uses_TSIndicator
+#define Uses_TEvent
+#define Uses_TCEditor_External
+#define Uses_EditorId
+#define Uses_LineLengthArray
+#define Uses_SOStack
+#define Uses_TViewPlus
+#define Uses_TPMCollection
+#define Uses_TSArray_Def
+#define _INCL_TIME_H_
+#define Uses_limits
+#define Uses_CLYFileAttrs
+#define Uses_stdio
+#endif
+
+#ifdef Uses_TSIndicator
+#define Uses_TIndicator
+#define _INCL_SINDICAT_H_
+#endif
+
+#ifdef Uses_LineLengthArray
+#define _INCL_CED_CLAS_
+#endif
+
+#ifdef Uses_TFindCDialogRec
+#define _INCL_CED_CLAS_
+#define Uses_string
+#endif
+
+#ifdef Uses_TReplaceCDialogRec
+#define _INCL_CED_CLAS_
+#define Uses_string
+#endif
+
+#ifdef Uses_TCEditor_Internal
+#define _INCL_CED_INTE
+#define _INCL_CTYPE
+#define Uses_TStringCollection
+#define Uses_TSOSStringCollection
+#define Uses_SOStack
+#endif
+
+#ifdef Uses_TCEditor_External
+#define _INCL_CED_EXTE
+#define Uses_TSOSStringCollection
+#endif
+
+#ifdef Uses_TCEditor_Commands
+#define _INCL_CED_COMA
+#endif
+
+#ifdef Uses_TPMCollection
+#define Uses_TStringCollection
+#define Uses_TStringable
+#define _INCL_PMCOLL
+#endif
+
+// That's to avoid a loop with the current TV
+#ifdef Uses_TCEditor
+#undef Uses_TCEditor
+#define _Uses_TCEditor
+#endif
+#ifdef Uses_TCFileEditor
+#undef Uses_TCFileEditor
+#define _Uses_TCFileEditor
+#endif
+#ifdef Uses_TCEditWindow
+#undef Uses_TCEditWindow
+#define _Uses_TCEditWindow
+#endif
+
+#ifdef _INCL_STRING
+#define Uses_string
+#endif
+
+#ifdef _INCL_DIR
+#define Uses_dir
+#endif
+
+#ifdef _INCL_CTYPE
+#define Uses_ctype
+#endif
+
+#ifdef _INCL_TIME_H_
+#define Uses_time
+#endif
+
+#include <settvuti.h>
+
+#ifdef _Uses_TCEditor
+#undef _Uses_TCEditor
+#define Uses_TCEditor
+#endif
+#ifdef _Uses_TCFileEditor
+#undef _Uses_TCFileEditor
+#define Uses_TCFileEditor
+#endif
+#ifdef _Uses_TCEditWindow
+#undef _Uses_TCEditWindow
+#define Uses_TCEditWindow
+#endif
+
+#ifdef _INCL_SINDICAT_H_
+#include <sindicat.h>
+#endif
+
+#ifdef _INCL_TVSETUTI
+#include <tvsetuti.h>
+#endif
+
+#ifdef _INCL_PMCOLL
+#include <pmcoll.h>
+#endif
+
+#ifdef _INCL_CED_INTE
+#include <ced_inte.h>
+#endif
+
+#ifdef _INCL_CED_EXTE
+#include <ced_exte.h>
+#endif
+
+#ifdef _INCL_CED_COMA
+#include <ced_coma.h>
+#endif
+
+#ifdef _INCL_CED_CLAS_
+#define Uses_TCEditor_Class
+#include <ced_clas.h>
+#endif
+
+#ifdef Uses_TCEditor
+#undef Uses_TCEditor
+#endif
+#ifdef Uses_TCFileEditor
+#undef Uses_TCFileEditor
+#endif
+#ifdef Uses_TCEditWindow
+#undef Uses_TCEditWindow
+#endif
+
diff --git a/setedit/include/completi.h b/setedit/include/completi.h
new file mode 100644
index 0000000..aba2690
--- /dev/null
+++ b/setedit/include/completi.h
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+char *CompletionChoose(char *options, const char *delimiter, int x, int y, unsigned ops);
+char *CompletionChooseFromList(TStringCollection *list, int cant, int len,
+ int xC, int yC, unsigned ops, int lPartial=0,
+ Boolean aNewStr=True);
+
+const unsigned cmplDontAddEndChar=1;
diff --git a/setedit/include/configed.h b/setedit/include/configed.h
new file mode 100644
index 0000000..0545390
--- /dev/null
+++ b/setedit/include/configed.h
@@ -0,0 +1,62 @@
+/* Generated automatically by the configure script */
+
+/* Allegro library is available */
+/*#define HAVE_ALLEGRO 1*/
+
+/* Enable MP3 support */
+#define WITH_MP3 1
+
+/* MP3 support from libamp */
+/*#define HAVE_AMP 1*/
+
+/* MP3 support from libmpegsound */
+#define HAVE_MPEGSOUND 1
+
+/* Perl Compatible Regular Expressions support */
+#define HAVE_PCRE_LIB 1
+
+/* PCRE version 2.0.6 or newer */
+#define HAVE_PCRE206 1
+
+/* bzip2 compression support */
+#define HAVE_BZIP2 1
+
+/* old bzip2 version before 1.0 */
+/*#define HAVE_BZIP2PRE1 1*/
+
+/* Sound mixer support */
+#define HAVE_MIXER 1
+
+/* Gettext included with editor */
+/*#define FORCE_INTL_SUPPORT 1*/
+
+/* AA lib */
+#define HAVE_AA 1
+
+/* GDB/MI interface */
+#define HAVE_GDB_MI 1
+
+/* Calculator */
+#define HAVE_CALCULATOR 1
+
+/* Calendar */
+#define HAVE_CALENDAR 1
+
+/* Support for runtime dynamic libs */
+#define HAVE_DL_LIB 1
+#define DL_HEADER_NAME <link.h>
+#define PCRE_HEADER_NAME <pcre.h>
+
+
+#define CONFIG_PREFIX "/usr"
+
+
+#define SEOS_UNIX
+#define SEOS_STR "UNIX"
+#define SEOSf_Linux
+#define SEOSf_STR "Linux"
+#define SECPU_x86
+#define SECPU_STR "x86"
+#define SEComp_GCC
+#define SEComp_STR "GCC"
+#define SECompf_
diff --git a/setedit/include/edmsg.h b/setedit/include/edmsg.h
new file mode 100644
index 0000000..161c7d5
--- /dev/null
+++ b/setedit/include/edmsg.h
@@ -0,0 +1,98 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+class TRect;
+
+typedef struct
+{
+ int Line;
+ int Column;
+ int offset,len;
+ unsigned type;
+} FileInfo;
+
+const unsigned fitNone=0, fitInfo=1, fitWarning=2, fitError=4, fitCont=0x8000;
+
+#ifdef STANDALONE
+// This file is used by the standalone editor to declare more things
+class TSOSListBox;
+class TSOSListBoxMsg;
+
+#ifdef Uses_TSOSListBoxMsg
+
+const unsigned lbmNothing=0, lbmReachedMsg=1, lbmWrap=2;
+
+class TSOSListBoxMsg : public TSOSListBox
+{
+public:
+ TSOSListBoxMsg(const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar)
+ : TSOSListBox(bounds,aNumCols,aScrollBar) { }
+
+ virtual void focusItem(ccIndex item);
+ virtual void selectItem(ccIndex item);
+ virtual void handleEvent(TEvent& event);
+ virtual void setState(uint16 aState, Boolean enable);
+ virtual void draw();
+ virtual TPalette &getPalette() const;
+ void selectNext(int offset=1);
+ void selectPrev(int offset=1);
+ int getLineOf(int pos);
+ unsigned getTypeOf(int pos);
+ void updateCommands(int enable);
+ void saveAs();
+ void save(char *name);
+ void copyClipboard(Boolean osClipboard);
+
+ int selectOK;
+ int haveJumpLines;
+ static unsigned opsEnd;
+ static unsigned opsBeep;
+};
+#endif
+
+class TEdMsgDialog : public TDialog
+{
+public:
+ TEdMsgDialog(const TRect &r,const char *t);
+ virtual void changeBounds(const TRect &);
+ virtual void close(void);
+ virtual void handleEvent(TEvent& event);
+ virtual TPalette &getPalette() const;
+ TSOSListBoxMsg *MsgList;
+ ~TEdMsgDialog();
+};
+
+extern TEdMsgDialog *EdMessageWindowInit(int Insert=1);
+extern int EdMessageCantMessages(void);
+extern void EdMessageSelectNext(void);
+extern void EdMessageSelectPrev(void);
+extern void EdJumpToFirstError(void);
+
+#endif
+
+int DumpFileToMessage(char *file, const char *from, uint32 SMOps,
+ char *(*ParseFun)(char *buf,FileInfo &fI,char *&fileName)=0,
+ int kill=1);
+// Incremental version of the DumpFileToMessage
+void DumpFileToMessageInit(char *file, const char *from, uint32 SMOps,
+ char *(*ParseFun)(char *buf,FileInfo &fI,char *&fileName)=0);
+int DumpFileToMessageParseMore(int Lines, int *goBack);
+void DumpFileToMessageEnd();
+
+// This is provided by edmsg.cc in the editor or by rhideint.cc in libset
+const uint32 edsmUpdateSpLines=1,edsmRemoveOld=2,edsmDontSelect=4,
+ edsmDontUpdate=8,edsmNoHzReset=16;
+// Mutually exclusive options for the scroll behavior
+const uint32 edsmScrollMask=0xC0000000,edsmEverScroll=0,edsmNeverScroll=0x40000000,
+ edsmScrollIfNoFocus=0x80000000,edsmScrollShifter=0x40000000;
+extern void EdShowMessageS(const char *msg);
+extern void EdShowMessage(const char *msg,Boolean remove_old=False,Boolean resetHz=True);
+extern void EdShowMessageI(const char *msg,Boolean remove_old=False,Boolean resetHz=True);
+extern void EdShowMessage(const char *msg, unsigned Options);
+extern void EdShowMessageI(const char *msg, unsigned Options);
+extern void EdShowMessageFile(const char *msg, FileInfo &fInfo, char *fileName,
+ unsigned Options=0);
+extern void EdShowMessageUpdate(unsigned Options);
+extern void EdJumpToMessage(ccIndex item);
+extern Boolean EdMessageGetSize(TRect &r);
+
diff --git a/setedit/include/edspecs.h b/setedit/include/edspecs.h
new file mode 100644
index 0000000..c75f82a
--- /dev/null
+++ b/setedit/include/edspecs.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 2001-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef EDSPECS_H_INCLUDED
+#define EDSPECS_H_INCLUDED
+
+extern void InsertEnvironmentVar(const char *variable, const char *contents);
+extern void InitEnvirVariables(void);
+extern void DeInitEnvirVariables(void);
+extern const char *GetVariable(const char *variable, const char *def=NULL);
+extern int EnvirVariablesIsOldVersion();
+extern unsigned EnvirGetIntVar(const char *name, unsigned aDefault=0);
+extern void EnvirSetIntVar(const char *name, unsigned Value);
+extern unsigned EnvirSetBits(const char *name, unsigned Value);
+extern unsigned EnvirResetBits(const char *name, unsigned Value);
+extern unsigned EnvirGetBits(const char *name, unsigned Value, unsigned aDefault=0);
+
+// Values for SET_VARIOUS1
+const unsigned svr1DontShowAbout=1;
+// Values for SET_CREATE_DST
+// Options for the .dst creation. Configured in edprefs.cc
+extern unsigned GetDSTOptions();
+const unsigned dstCreate=1,dstHide=2,dstNoCursorPos=4,dstRemmeberFK=8;
+// Are editors restored?
+const unsigned dstEdEver=0,dstEdOnlyIfNoCL=0x10,dstEdNever=0x20,dstEdMask=0x30;
+// Are other windows restored?
+const unsigned dstOwEver=0,dstOwOnlyIfNoCL=0x40,dstOwNever=0x80,dstOwMask=0xC0;
+// Are closed files restored?
+const unsigned dstCfEver=0,dstCfOnlyIfNoCL=0x100,dstCfNever=0x200,dstCfMask=0x300;
+
+#endif // EDSPECS_H_INCLUDED
+
diff --git a/setedit/include/gzfiles.h b/setedit/include/gzfiles.h
new file mode 100644
index 0000000..ce1f7dd
--- /dev/null
+++ b/setedit/include/gzfiles.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+int GZFiles_CheckForGZIP(void);
+int GZFiles_IsGZ(FILE *f);
+int GZFiles_Expand(char *dest, char *orig);
+int GZFiles_ExpandHL(FILE *dest, char *orig);
+int GZFiles_DecryptGPG(FILE *dest, char *orig);
+int GZFiles_CreateGPG(const char *file, int &hi, int &ho, int &he, pid_t &child);
+int GZFiles_CloseGPG(int hi, int ho, int he, pid_t child);
+void GZFiles_ResetError();
+const char *GZFiles_GetError();
+void GZFiles_SetError(const char *error);
+typedef void (*GZFiles_CB)(const char *);
+void GZFiles_SetMessageCallback(GZFiles_CB cb);
+
+#ifndef SUP_GZ
+#define gzFile FILE *
+#define gzopen fopen
+#define gzwrite(s,b,l) fwrite(b,l,1,s)
+#define gzclose(f) fclose(f)
+#else
+#include <zlib.h>
+#endif
+
+#ifndef HAVE_BZIP2
+ #define BZFILE void
+#else
+ #if defined(Uses_GZInterfaceOnly) && (defined(TVComp_BCPP) || defined(TVComp_MSC))
+ // Don't ask me why but BC++ dies if bzlib.h includes windows.h again.
+ // Collisions appears if we include windows.h in MSVC from ceditor.cc.
+ #define BZFILE void
+ #else
+ #include <bzlib.h>
+ #endif
+#endif
+
+#define HAVE_GPG
+const int gzNoCompressed=0, gzGZIP=1, gzBZIP2=2, gzGPG=3,
+ gzGZIPMagic=0x8B1F;
+
+class TGZFileWrite
+{
+public:
+ TGZFileWrite(char *fileName, int compressed=gzNoCompressed);
+ ~TGZFileWrite();
+ size_t write(void *buffer, size_t len);
+ void close();
+ int ok;
+
+private:
+ int compressed;
+ FILE *f;
+ gzFile fc;
+ BZFILE *fc2;
+ int hi, ho, he;
+ pid_t child;
+};
+
+
diff --git a/setedit/include/keytrans.h b/setedit/include/keytrans.h
new file mode 100644
index 0000000..3899430
--- /dev/null
+++ b/setedit/include/keytrans.h
@@ -0,0 +1,155 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <dyncat.h>
+
+#if defined(Uses_TKeyTranslate) && !defined(__TKeyTranslate__)
+#define __TKeyTranslate__
+const int kbtIsComm=0, kbtIsSComm=1, kbtIsMacro=2, kbtIsSeq=3, kbtDelOp=0x8000;
+const int kbtStatic=0, kbtDynamic=1, kbtExpanded=2;
+
+typedef struct
+{
+ unsigned short cant;
+ unsigned short commands[0];
+} KeyTSeq;
+
+typedef struct
+{
+ unsigned short key;
+ unsigned short flags;
+ union
+ {
+ int offset;
+ void *data;
+ // This value *must* be of the same size as "int".
+ // That's because when I fill the structure in keytrans.cc the compiler
+ // promotes the ushort to int (and assume is filling offset). This works
+ // for little endians, but for big endians makes command==0 (wrong 16
+ // bits used ;-)
+ unsigned command;
+ char *macro;
+ KeyTSeq *sequence;
+ } d;
+} KeyTNode;
+
+struct KeyTTable
+{
+ unsigned cant; // Number of entries in this table
+ unsigned total; // Number of keys in this table and all the associated
+ KeyTNode nodes[0];
+};
+
+class TKeySeqCol;
+
+// This class is a good exercise for the "data structures" topic.
+// Is a crazy tree.
+class TKeyTranslate : public TStringable
+{
+public:
+ TKeyTranslate(KeyTTable *aBase, int aType=kbtStatic);
+ ~TKeyTranslate();
+ int get(unsigned key,KeyTNode *ret);
+ KeyTNode *search(unsigned key);
+ KeyTTable *expand(int &canBeDeleted);
+ void compact(void);
+ unsigned getLen(void);
+ void deleteKey(unsigned which);
+ int addKey(TKeySeqCol *sKeys, void *data, int Type, int *keyDef=NULL,
+ Boolean simulate=False);
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ int Save(char *name);
+ int Load(char *name);
+ void ChangeTable(KeyTTable *aBase, int aType=kbtStatic);
+ int getType() { return type; };
+
+protected:
+ // Inline methodes to symplify the indirections
+ // When the table is compacted (relative pointers)
+ KeyTSeq *GetTSeqC(KeyTNode *node) { return (KeyTSeq *)(long(base)+node->d.offset); };
+ KeyTTable *GetTableC(KeyTNode *node) { return (KeyTTable *)(long(base)+node->d.offset); };
+ char *GetMNameC(KeyTNode *node) { return (char *)(long(base)+node->d.offset); };
+ // When the table is expanded
+ KeyTSeq *GetTSeqE(KeyTNode *node) { return (KeyTSeq *)(node->d.data); };
+ KeyTTable *GetTableE(KeyTNode *node) { return (KeyTTable *)(node->d.data); };
+ char *GetMNameE(KeyTNode *node) { return (char *)(node->d.data); };
+ // Any time
+ KeyTSeq *GetTSeq(KeyTNode *node)
+ { if (type==kbtExpanded)
+ return (KeyTSeq *)(node->d.data);
+ return (KeyTSeq *)(long(base)+node->d.offset);
+ };
+ KeyTTable *GetTable(KeyTNode *node)
+ { if (type==kbtExpanded)
+ return (KeyTTable *)(node->d.data);
+ return (KeyTTable *)(long(base)+node->d.offset);
+ };
+ char *GetMName(KeyTNode *node)
+ { if (type==kbtExpanded)
+ return (char *)(node->d.data);
+ return (char *)(long(base)+node->d.offset);
+ };
+
+ KeyTNode *InsertKey(unsigned key);
+ KeyTTable *ExpandTable(KeyTTable *t);
+ unsigned MeassureTree(KeyTTable *t);
+ void CompactTable(KeyTTable *t);
+ void DeleteTree(KeyTTable *t);
+ void deleteTree(void);
+ unsigned CountKeys(KeyTTable *t);
+ void CatFullNameKey(KeyTNode *node, DynStrCatStruct *cat);
+ void DeleteKey(KeyTTable *t, unsigned c, unsigned which);
+ KeyTNode *move(unsigned key, int add=0);
+ void rewind() { state=0; curTable=base; };
+
+ KeyTTable *base;
+ KeyTTable *curTable;
+ KeyTNode *lastTableInSearch;
+ int type;
+ int state;
+ int cSize;
+ unsigned OffSet;
+ char *newBase;
+ unsigned numKey;
+};
+
+extern TKeyTranslate KeyTrans;
+#endif
+
+#if defined(Uses_TKeySeqCol) && !defined(__TKeySeqCol__)
+#define __TKeySeqCol__
+class TKeySeqCol : public TNSCollection, public TStringable
+{
+public:
+ TKeySeqCol(ccIndex aLimit, ccIndex aDelta) :
+ TNSCollection(aLimit,aDelta),
+ TStringable() { shouldDelete=False; Count=0; };
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ void insert(unsigned short key) { TNSCollection::insert((void *)(unsigned long)key); };
+ void insert(int key) { TNSCollection::insert((void *)(long)key); };
+};
+#endif
+
+#if defined(Uses_TComSeqCol) && !defined(__TComSeqCol__)
+#define __TComSeqCol__
+class TComSeqCol : public TNSCollection, public TStringable
+{
+public:
+ TComSeqCol(ccIndex aLimit, ccIndex aDelta) :
+ TNSCollection(aLimit,aDelta),
+ TStringable() { shouldDelete=False; Count=0; };
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ void insert(unsigned short key) { TNSCollection::insert((void *)(unsigned long)key); };
+ void insert(int key) { TNSCollection::insert((void *)(long)key); };
+};
+#endif
+
+const int tktMaxKeyName=40;
+
+extern int InterpretKeyName(char *s, ushort &code);
+extern void TCEditor_MakeKeyName(char *s, unsigned short key);
+// edkeys.cc
+extern unsigned short TCEditor_SelectAKey(void);
diff --git a/setedit/include/loadkbin.h b/setedit/include/loadkbin.h
new file mode 100644
index 0000000..90d7a6c
--- /dev/null
+++ b/setedit/include/loadkbin.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This header is shared by keytrans.cc and edkeys.cc.
+ The name comes from the old loadkbin.cc no longer used.
+
+***************************************************************************/
+
+int KeyBindEdit(void);
+int SaveKeyBind(char *name);
+void ShowKeyBindError(void);
+int KeyBackToDefault(Boolean ask=True);
+void SeeScanCodes(void);
+int AltKeysSetUp(void);
+int KeyPadSetUp(void);
+
diff --git a/setedit/include/loadshl.h b/setedit/include/loadshl.h
new file mode 100644
index 0000000..ef81f5a
--- /dev/null
+++ b/setedit/include/loadshl.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 2001-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef LOADSHL_H_INCLUDED
+#define LOADSHL_H_INCLUDED
+
+#include <ced_pcre.h>
+
+typedef struct
+{
+ int PCREMaxMatchs;
+ int *PCREMatchs;
+ int PCREHits;
+} PCREData;
+
+void PCREInitCompiler(PCREData &p);
+void PCREStopCompiler(PCREData &p);
+pcre *PCRECompileRegEx(char *text, PCREData &p);
+int PCREDoSearch(char *search, int len, pcre *CompiledPCRE, PCREData &p);
+#define PCREDataDestroy(p) PCREInitCompiler(p)
+void PCREGetMatch(int match, int &offset, int &len, PCREData &p);
+
+#define MaxExtension 80
+
+struct strSHL;
+class TStringCollection;
+extern int LoadSyntaxHighLightFile(char *name, strSHL *&hl, TStringCollection *list,
+ int &cant);
+extern int LoadSyntaxHighLightKeywords(strSHL &hl);
+extern void UnLoadSyntaxHighLightFile(strSHL *&hl, TStringCollection *list,int &Cant);
+extern char *SHLNameOf(unsigned number);
+extern int SHLNumberOf(char *name);
+class TCEditor;
+extern char *SHLConstructEmacsModeComment(TCEditor &e, int &sizeSt, int &sizeEnd);
+extern int SHLSelect(TCEditor &e, char *buffer, int lenBuf);
+extern void SHLTransferDefaultsNewFile(TCEditor &e);
+extern int TakeCommentEmacs(char *buffer, int lenBuf, char *ext, int *tab_width,
+ int *startCom=NULL, int *endCom=NULL);
+extern void ShowSHLLoadErrors();
+
+#if defined(Uses_TNLIndentCol)
+class NLIndent
+{
+public:
+ NLIndent() { cArgStr[0]=cArgStr[1]=NULL; };
+ ~NLIndent() { delete[] cArgStr[0]; delete[] cArgStr[1]; };
+ uchar cond[2], action;
+ unsigned cArgInt[2], acArgInt;
+ char *cArgStr[2];
+};
+
+class TNLIndentCol : public TNSCollection
+{
+public:
+ TNLIndentCol() : TNSCollection(18,8) {};
+ virtual void freeItem(void *item);
+ NLIndent *At(ccIndex i) { return (NLIndent *)at(i); };
+};
+
+// Conditions
+const uchar nliAlways=0, // Default: "True"
+ nliParBalancePos=1, // More ( than )
+ nliParBalanceNeg=2, // More ) than (
+ nliFirstWord=3, // A word to match, ArgInt is the length
+ nliNoLastChar=4; // Last char in line must be different than ArgInt
+// Actions
+const uchar nliAutoIndent=0, // Default, ArgInt is an offset to add
+ nliUnindent=1, // Unindent
+ nliMoveAfterPar=2; // Move to the col of the arg after a (
+#endif // Uses_TNLIndentCol
+
+#if defined(Uses_TSHLErros)
+class SHLError
+{
+public:
+ SHLError(const char *s, int l) { str=s; line=l; };
+
+ const char *str;
+ int line;
+};
+
+class TSHLErrors : public TNSCollection
+{
+public:
+ TSHLErrors() : TNSCollection(2,2) {};
+ virtual void freeItem(void *item);
+};
+
+void SHLAddLoadError(const char *error, int line);
+#endif // Uses_TSHLErros
+
+#endif // LOADSHL_H_INCLUDED
diff --git a/setedit/include/pathtool.h b/setedit/include/pathtool.h
new file mode 100644
index 0000000..f54430f
--- /dev/null
+++ b/setedit/include/pathtool.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef PATHTOOL_H_INCLUDED
+#define PATHTOOL_H_INCLUDED
+class TStringCollectionW;
+
+struct stat;
+int edTestForFile(const char *name);
+int edTestForFile(const char *name, struct stat &st);
+char *ExpandFileNameToThePointWhereTheProgramWasLoaded(const char *s);
+int FindFile(const char * name,char * & fullName, const char *reference);
+char *ReplaceExtension(char *name, const char *ext, const char *old);
+char *ReplaceExtension(char *name, const char *ext);
+char *AddToNameOfFile(char *fname, char *add);
+int DeleteWildcard(char *mask);
+char *GetPathRelativeToRunPoint(char *dest, const char *binReplace, char *file);
+void SetReferencePath(char *orig);
+char *RedirectStdErrToATemp(int &StdErrOri,int &StdErrNew);
+int FileCopy(const char *orig, const char *dest);
+void CheckForValidTMPDIR();
+int IsADirectory(const char *name);
+int IsASoftLink(const char *name);
+int MakeFileHidden(char *file);
+int RemoveFileHidden(char *file);
+void AddToFilesToKill(char *name);
+void KillFilesToKill();
+void ReleaseFilesToKill();
+TStringCollectionW *GetFilesToKill();
+void SetFilesToKill(TStringCollectionW *files);
+int CompareFileNames(char *origFile, char *destFile);
+void CheckIfCurDirValid(void);
+char *GetShortNameOf(char *longName, char *shortName);
+int CheckIfPathAbsolute(const char *s);
+char *MakeItHiddenName(char *);
+
+const int maxSFNSize=68;
+
+inline
+char *ExpandHome(const char *s)
+{
+ return ExpandFileNameToThePointWhereTheProgramWasLoaded(s);
+}
+char *ExpandHomeSave(const char *s);
+#endif
diff --git a/setedit/include/pmcoll.h b/setedit/include/pmcoll.h
new file mode 100644
index 0000000..095352e
--- /dev/null
+++ b/setedit/include/pmcoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TPMCollection) && !defined(__TPMCollection__)
+#define __TPMCollection__
+typedef struct
+{
+ char trigger[4];
+ uint32 flags;
+ char *str;
+ char *name;
+ TNSCollection *vars;
+ TNSCollection *defaults;
+ unsigned mLenVar;
+} PMacroStr;
+
+class TPMCollection : public TStringCollection, public TStringable
+{
+public:
+ TPMCollection(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) {};
+ virtual void *keyOf(void *);
+ virtual void freeItem(void *);
+ virtual ccIndex insert(void *item);
+ PMacroStr *searchByNamePointer(void *name);
+ // TStringable:
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+};
+#endif
diff --git a/setedit/include/runprog.h b/setedit/include/runprog.h
new file mode 100644
index 0000000..7264102
--- /dev/null
+++ b/setedit/include/runprog.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// Include for runprog.cc
+const unsigned repDontShowDialog=1,repDontShowAsMessage=2,repRestoreScreen=4,
+ repDontFork=8,repRedirIn=16,repNoRedirOut=32,
+ repFlagsFromOps=64,repStopDebug=128;
+
+char *RunExternalProgramGetFile(int &len);
+void RunExternalProgram(char *Program=0, unsigned flags=repFlagsFromOps,
+ char *compiler=0);
+void RunExternalProgramKillFile(void);
+pid_t RunExternalProgramGetChildPid();
+Boolean RunExternalProgramRunning();
+void RunExternalProgramIncParse();
+Boolean RunExternalProgramNotRunning();
+void RunExternalProgramStopChild();
+void RunExternalProgramSetInRedir(const char *buffer, unsigned len);
+void RunExternalProgramRemoveInRedir();
+void RunExternalProgramFreeMemory();
diff --git a/setedit/include/sdginter.h b/setedit/include/sdginter.h
new file mode 100644
index 0000000..e766c18
--- /dev/null
+++ b/setedit/include/sdginter.h
@@ -0,0 +1,7 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void SDGInterfaceRun(void);
+void SDGInterfaceDialog(void);
+void SDGInterfaceSaveData(fpstream *f);
+void SDGInterfaceReadData(fpstream *f);
+
diff --git a/setedit/include/setconst.h b/setedit/include/setconst.h
new file mode 100644
index 0000000..9fb2ac1
--- /dev/null
+++ b/setedit/include/setconst.h
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+/*
+ InfView: cmInfHelp=0x2100 to cmInfTop=0x2109;
+ TSetEditorApp: Base=0x2500
+ TCEditor: Base=0x258 (600)
+ MP3: cmaUpdateTime=0x22A0 (+15)
+ More in editcoma.h
+*/
+const int
+ cmApplyAll = cmYes;
+
diff --git a/setedit/include/sindicat.h b/setedit/include/sindicat.h
new file mode 100644
index 0000000..333a2d2
--- /dev/null
+++ b/setedit/include/sindicat.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined( Uses_TSIndicator ) && !defined( __TSIndicator )
+#define __TSIndicator
+
+class TRect;
+class TPoint;
+class TCEditor;
+
+class TSIndicator : public TIndicator
+{
+public:
+ TSIndicator(const TRect &bounds) :
+ TIndicator(bounds) {};
+
+ virtual void draw();
+ TCEditor *editor;
+
+private:
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+ TSIndicator( StreamableInit );
+
+public:
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TSIndicator& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TSIndicator*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TSIndicator& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TSIndicator* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif // Uses_TSIndicator
+
+
diff --git a/setedit/include/slpinter.h b/setedit/include/slpinter.h
new file mode 100644
index 0000000..c230342
--- /dev/null
+++ b/setedit/include/slpinter.h
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+extern void SLPInterfaceRun(TCEditor *ed);
+extern void SLPInterfaceInit(char *file);
+extern void SLPInterfaceReRun(TCEditor *ed);
+extern int SLPSearchMacro(TCEditor *ed, char *name, Boolean verbose);
+extern void SLPInterfaceRunSelection(TCEditor *ed);
+extern void SLPInterfaceRunAsk(TCEditor *ed, char *code=0);
+extern int SLPInterfaceRunString(TCEditor *ed, char *code, Boolean verbose);
+
+const int maxRunAskCode=1024;
+
diff --git a/setedit/include/splinman.h b/setedit/include/splinman.h
new file mode 100644
index 0000000..798b3f7
--- /dev/null
+++ b/setedit/include/splinman.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+struct stSpLine
+{
+ int oline, nline;
+ int id;
+};
+
+class TNSSortedCollection;
+
+class TSpCollection : public TNSSortedCollection
+{
+public:
+ TSpCollection(ccIndex aLimit) :
+ TNSSortedCollection(aLimit,8) { duplicates=True; };
+ void insert(int line, int id);
+ TSpCollection &operator=(const TSpCollection &pl);
+ stSpLine *At(ccIndex i) { return (stSpLine *)at(i); };
+
+ virtual void *keyOf(void *item);
+ virtual int compare(void *s1, void *s2);
+ virtual void freeItem(void *s);
+};
+
+// The following function must be provided by the main part of the editor.
+// Your objetive is transfer the array spLines to the editor associated to fileName
+extern void ApplySpLines(char *fileName, TSpCollection *spLines);
+
+typedef void (*spLineApplyF)(const char *file, stSpLine *spline, void *data);
+
+void SpLinesAdd(char *fileName, int line, int idSource, Boolean TransferNow=True);
+void SpLinesUpdate(void);
+TSpCollection *SpLinesGetFor(char *fName);
+void SpLinesDeleteForId(int id, const char *file=NULL, Boolean aLine=False, int oLine=0);
+int SpLineGetNewValueOf(int line, char *fileName, Boolean *found=NULL);
+int SpLineGetOldValueOf(int line, char *fName, int type, Boolean *found);
+void SpLinesCleanUp();
+void SpLinesForEach(int id, spLineApplyF apply, void *data=NULL);
+
+const int idsplAny=0,
+ idsplError=1,
+ idsplBreak=2,
+ idsplRunLine=3;
diff --git a/setedit/include/ssyntax.h b/setedit/include/ssyntax.h
new file mode 100644
index 0000000..e306719
--- /dev/null
+++ b/setedit/include/ssyntax.h
@@ -0,0 +1,11 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+int SyntaxSearch_Search(char *word, char *&FileName, char *&NodeName,
+ char *&VisibleName);
+int SyntaxSearch_Load(fpstream &s);
+int SyntaxSearch_Save(fpstream &s);
+int SyntaxSearch_InitWithDefaults(void);
+void SyntaxSearch_EditFilesList(void);
+void SyntaxSearch_EditSettings(void);
+void SyntaxSearch_ShutDown(void);
+int SyntaxSearch_GetJumpOption(void);
diff --git a/setedit/include/tags.h b/setedit/include/tags.h
new file mode 100644
index 0000000..e9d4d33
--- /dev/null
+++ b/setedit/include/tags.h
@@ -0,0 +1,235 @@
+/* Copyright (C) 2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+// They must be defined even for Uses_TagsOnlyFuncs
+// For the flags field
+const uchar stfAutoGenerated=1;
+// For the dialogs
+const uchar stfAutoCentral=1,stfAutoDistributed=2;
+
+#ifndef Uses_TagsOnlyFuncs
+typedef unsigned char uchar;
+class TSpTagCollection;
+class TStringCollection;
+class TTagClassCol;
+
+// Flags for a tag
+const uchar
+ sttFgLine=1, // != regex
+ sttFgLocal=2, // != global
+
+ sttFgClass =0x04, // 3 bits
+ sttFgEnum =0x08,
+ sttFgUnion =0x0C,
+ sttFgInherits=0x10,
+ sttFgStruct =0x14,
+ sttFgEntity =0x18,
+ sttFgPMask =0x1C,
+
+ sttFgVirtual =0x20,
+ sttFgPureVirtual=0x40,
+ sttFgAbstract =0x60,
+ sttFgRegister =0x80; // Optimized to a register
+
+struct stTagFile;
+class TTagInfo;
+
+// A tag
+struct stTag
+{
+ const char *id;
+ const char *source;
+ union
+ {
+ const char *regex;
+ unsigned line;
+ };
+ const char *partof;
+ stTagFile *tagFile;
+ uchar lang;
+ uchar kind;
+ uchar flags;
+ const char *type; // Generated by objdump
+};
+
+// To hold one of the description variables found at the beggining of
+// the tag files.
+struct stTagInfo
+{
+ const char *var;
+ const char *value;
+ const char *comment;
+};
+
+// Information about one tag files
+struct stTagFile
+{
+ const char *file;
+ const char *base;
+ time_t modtime;
+ int entries;
+ TTagInfo *info;
+ uchar flags;
+};
+
+// Structures to convert the single letter "kind" field to a descriptive text
+struct stTagKind
+{
+ uchar kind;
+ const char *name;
+};
+
+struct stTagKinds
+{
+ unsigned count;
+ stTagKind *kinds;
+};
+
+struct stClassTagInfo
+{
+ stTag *cl;
+ TStringCollection *parents;
+ TStringCollection *childs;
+ TSpTagCollection *members;
+};
+
+// Class to handle the variables for the tag file
+class TTagInfo : public TStringCollection, public TStringable
+{
+public:
+ TTagInfo() : TStringCollection(6,2) {};
+ int addValue(char *s);
+ virtual void freeItem(void *item);
+ virtual void *keyOf(void *item);
+ void print() { forEach(print1,NULL); };
+ static void print1(void *item, void *arg);
+ stTagInfo *atPos(ccIndex pos) { return (stTagInfo *)at(pos); };
+ // TStringable things:
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+};
+
+// Class for the tag files
+class TTagFiles : public TStringCollection, public TStringable
+{
+public:
+ TTagFiles();
+ virtual void freeItem(void *item);
+ virtual void *keyOf(void *item);
+ void print() { forEach(print1,NULL); };
+ static void print1(void *item, void *arg);
+ stTagFile *atPos(ccIndex pos) { return (stTagFile *)at(pos); };
+ // TStringable things:
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ void removeAutoGenerated();
+ static void clearFlag(void *item, void *arg);
+ void unmarkAutoGenerated()
+ { unsigned aux=stfAutoGenerated;
+ forEach(clearFlag,(void *)&aux); };
+
+ //SetDefStreamMembers(TTagFiles,TStringCollection);
+};
+
+//SetDefStreamOperators(TTagFiles);
+
+// Class to hold the tags
+class TSpTagCollection : public TStringCollection, public TStringable
+{
+public:
+ TSpTagCollection(unsigned size);
+ ~TSpTagCollection();
+ int addValue(char *s, stTagFile *tf);
+ virtual void freeItem(void *item);
+ virtual void *keyOf(void *item);
+ virtual int compare(void *key1, void *key2);
+
+ // TStringable things:
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+
+ stTag *atPos(ccIndex pos) { return (stTag *)at(pos); };
+ static const char *getKind(stTag *p);
+ static const char *getLanguage(stTag *p);
+ static void getText(char *buf, void *item, int maxLen);
+ static void getTextType(char *buf, void *item, int maxLen);
+
+protected:
+ TStringCollection *files;
+ static const char *Languages[];
+ static stTagKinds Kinds[];
+};
+
+class TTagMembersCol : public TSpTagCollection
+{
+public:
+ TTagMembersCol();
+ ~TTagMembersCol();
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ void insert(stTag *tg, int level);
+ void insertSorted(stTag *tg, int level);
+ void collect(stClassTagInfo *p, TTagClassCol *clist,
+ int level=0, Boolean sort=False);
+
+protected:
+ TNSCollection *levels;
+ void collectFromOne(TSpTagCollection *c, int level, Boolean sort);
+};
+
+class TTagCollection : public TSpTagCollection
+{
+public:
+ TTagCollection();
+ ~TTagCollection();
+ int addFile(const char *file, int defer=0, uchar specialFlags=0);
+
+ int refresh(Boolean advice=True);
+ void print() { forEach(print1,NULL); };
+ static void print1(void *item, void *arg);
+ TStringCollection *getTagFilesList();
+ void deleteTagsFor(stTagFile *p);
+ int save(fpstream& s);
+ int load(fpstream& s);
+
+ TTagFiles *tagFiles;
+
+protected:
+ int loadTagsFromFile(stTagFile *p);
+ int abortInit;
+};
+
+class TTagClassCol : public TNoCaseStringCollection //TStringCollection
+{
+public:
+ TTagClassCol(TSpTagCollection *from);
+
+ stClassTagInfo *atPos(ccIndex pos) { return (stClassTagInfo *)at(pos); };
+ virtual void freeItem(void *item);
+ virtual void *keyOf(void *item);
+ Boolean searchId(const char *id, ccIndex &pos) { return search((void *)id,pos); };
+
+ void addClass(stTag *p);
+ void addMember(stTag *p);
+ void addChildTo(const char *parent, const char *child);
+ stTag *newFake(const char *id);
+ void deleteFake(stTag *p);
+ stClassTagInfo *newClass();
+ stClassTagInfo *getClassOrFake(const char *id);
+};
+#endif
+
+int TagsSave(fpstream& s);
+int TagsLoad(fpstream& s);
+void TagsFreeMemory();
+void EditTagFiles();
+int SearchTag(char *word);
+void TagsClassBrowser(char *word);
+char *TagsWordCompletion(int x, int y, char *word);
+char *TagsWordCompletionClass(int x, int y, char *word);
+void SetTagFilesGenerationOptions();
+void RemoveAutoGenerated();
+void InsertAutoGenerated(const char *name);
+uint32 GetAutoGenMode();
+void TagsAutoRegen();
+
+
diff --git a/setedit/include/tvsetuti.h b/setedit/include/tvsetuti.h
new file mode 100644
index 0000000..736a36f
--- /dev/null
+++ b/setedit/include/tvsetuti.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if !defined( __SET_UTIL_H )
+#define __SET_UTIL_H
+
+#define SetDefStreamOperators(a) \
+inline ipstream& operator >> ( ipstream& is, a& cl ) \
+ { return is >> (TStreamable&)cl; } \
+inline ipstream& operator >> ( ipstream& is, a*& cl ) \
+ { return is >> (void *&)cl; } \
+ \
+inline opstream& operator << ( opstream& os, a& cl ) \
+ { return os << (TStreamable&)cl; } \
+inline opstream& operator << ( opstream& os, a* cl ) \
+ { return os << (TStreamable *)cl; }
+
+#define SetDefStreamMembers(a,b) \
+private: \
+ virtual const char *streamableName() const \
+ { return name; } \
+ virtual void *readItem( ipstream& is ); \
+ virtual void writeItem( void *obj, opstream& os ); \
+protected: \
+ a( StreamableInit ) : b( streamableInit ) {}; \
+public: \
+ static const char * const name; \
+ static TStreamable *build() {return new a( streamableInit );};
+
+#define SetDefStreamMembersCommon(a,b) \
+private: \
+ virtual const char *streamableName() const \
+ { return name; } \
+protected: \
+ a( StreamableInit ) : b( streamableInit ) {}; \
+ virtual void write( opstream& ); \
+ virtual void *read( ipstream& ); \
+public: \
+ static const char * const name; \
+ static TStreamable *build() {return new a( streamableInit );};
+
+
+#define SetDefStreamMembersNoConst(a) \
+private: \
+ virtual const char *streamableName() const \
+ { return name; } \
+protected: \
+ a( StreamableInit ); \
+ virtual void write( opstream& ); \
+ virtual void *read( ipstream& ); \
+public: \
+ static const char * const name; \
+ static TStreamable *build() {return new a( streamableInit );};
+
+/* The following macro is a little hack to decrease the compile time
+ for the TV lib when compiling all the n*.cc files */
+
+#define n2(CLASS,NAME) \
+class CLASS \
+{ \
+public: \
+ static const char * const name; \
+}; \
+ \
+const char * const CLASS::name = #NAME;
+
+#define s(TYPE)\
+ TStreamableClass R##TYPE( T##TYPE::name, T##TYPE::build, __DELTA(T##TYPE));
+
+#endif // __SET_UTIL_H
diff --git a/setedit/include/ucdefs.h b/setedit/include/ucdefs.h
new file mode 100644
index 0000000..0a2eeea
--- /dev/null
+++ b/setedit/include/ucdefs.h
@@ -0,0 +1,20 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* The following macros are defined to avoid passing negative values to
+ the ctype functions in the common case: isxxxx(char).
+ They are suitable for x86 DOS and Linux, perhaps not for others */
+#define ucisalnum(a) isalnum((unsigned char)a)
+#define ucisalpha(a) isalpha((unsigned char)a)
+#define ucisascii(a) isascii((unsigned char)a)
+#define uciscntrl(a) iscntrl((unsigned char)a)
+#define ucisdigit(a) isdigit((unsigned char)a)
+#define ucisgraph(a) isgraph((unsigned char)a)
+#define ucislower(a) islower((unsigned char)a)
+#define ucisprint(a) isprint((unsigned char)a)
+#define ucispunct(a) ispunct((unsigned char)a)
+#define ucisspace(a) isspace((unsigned char)a)
+#define ucisupper(a) isupper((unsigned char)a)
+#define ucisxdigit(a) isxdigit((unsigned char)a)
+#define uctoascii(a) toascii((unsigned char)a)
+#define uctolower(a) tolower((unsigned char)a)
+#define uctoupper(a) toupper((unsigned char)a)
diff --git a/setedit/include/vername.h b/setedit/include/vername.h
new file mode 100644
index 0000000..6541daa
--- /dev/null
+++ b/setedit/include/vername.h
@@ -0,0 +1,3 @@
+#define VERSION_NAME "Glaciar P.Moreno II"
+#define VERSION_REV 1245
+
diff --git a/setedit/infview/change.log b/setedit/infview/change.log
new file mode 100644
index 0000000..562a657
--- /dev/null
+++ b/setedit/infview/change.log
@@ -0,0 +1,22 @@
+$Log: change.log,v $
+Revision 1.2 2001/11/26 14:37:17 set
+* Synchronized.
+
+Revision 1.3 2001/10/01 23:28:42 root
+* Merged with SourceForge (patches from Ivan and last minute adjustements).
+
+Revision 1.1.1.1 2001/09/11 13:58:46 set
+Imported sources
+
+Revision 1.2 1999/07/18 19:30:43 root
+* Fixed: The main class wasn't destroyed at exit so the temporal files of
+InfView weren't deleted.
+
+Revision 1.1 1999/07/18 16:09:11 set
+* Modified: Now a lot of actions can be triggered by commands.
+* Added: All the commands to the menu so the user can see them.
+* Added: About.
+* Added: Now the search of cross references is done first with the visible
+names and if it fails with the node names (when searching command line
+specified stuff).
+.
diff --git a/setedit/infview/include/inf.h b/setedit/infview/include/inf.h
new file mode 100644
index 0000000..decce6a
--- /dev/null
+++ b/setedit/infview/include/inf.h
@@ -0,0 +1,367 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/***************************************************************
+
+ Filename - inf.h
+
+ Functions
+ Member functions of following classes
+ THisCollection
+ TStrListBox
+ THelpControlDialog
+ TInfViewer
+ TInfWindow
+ TFindInfDialogRec
+
+***************************************************************/
+
+#if !defined( __Inf_H )
+#define __Inf_H
+
+#include <infbase.h>
+
+#define MAX_HIST_DEEP 40
+#define MAX_NODE_NAME 90
+
+const int
+ hcInfView = 0x2100,
+ hcInfSearch = 0x2101,
+ hcInfControl= 0x2102,
+ hcInfGoto = 0x2103,
+ hcInfChoose = 0x2104,
+ hcInfConfig = 0x2105,
+ hcInfBookMark = 0x2106;
+const int
+ cmInfHelp = 0x2100,
+ cmInfControl = 0x2101,
+ cmInfBack = 0x2102,
+ cmInfPasteIn = 0x2103,
+ cmInfBookM = 0x2104,
+ cmInfNodes = 0x2105,
+ cmInfGoto = 0x2106,
+ cmInfOpen = 0x2107,
+ cmInfDir = 0x2108,
+ cmInfTop = 0x2109,
+ cmInfLastLink= 0x210A,
+ cmInfLink1 = 0x2140,
+ cmInfLink2 = 0x2141,
+ cmInfLink3 = 0x2142,
+ cmInfLink4 = 0x2143,
+ cmInfLink5 = 0x2144,
+ cmInfLink6 = 0x2145,
+ cmInfLink7 = 0x2146,
+ cmInfLink8 = 0x2147,
+ cmInfLink9 = 0x2148;
+const int // first 16 bits are for selBestMatch
+ jmpXRSubStr = 0x10000;
+
+typedef struct
+{
+ char Name[MAX_NODE_NAME];
+ TPoint HisPos;
+ int HisSel;
+} stHisto;
+
+
+/***************************************************************
+
+ class THisCollection
+
+ Una TCollection de stHisto.
+ It's a TCollection of stHisto.
+
+***************************************************************/
+
+class THisCollection : public TCollection
+{
+
+public:
+
+ THisCollection( short aLimit, short aDelta ) :
+ TCollection(aLimit, aDelta) {};
+
+private:
+
+ virtual void freeItem( void *item )
+ { delete (stHisto *)item; }
+ virtual const char *streamableName() const
+ { return name; }
+ virtual void *readItem( ipstream& is );
+ virtual void writeItem( void *obj, opstream& os );
+
+protected:
+
+ THisCollection( StreamableInit ) : TCollection ( streamableInit ) {};
+
+public:
+
+ static const char * const name;
+ static TStreamable *build() {return new THisCollection( streamableInit );};
+
+};
+
+inline ipstream& operator >> ( ipstream& is, THisCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, THisCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, THisCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, THisCollection* cl )
+ { return os << (TStreamable *)cl; }
+
+
+// TStrListBox
+
+class TStrListBox : public TListBox
+{
+ public:
+ TStrListBox(const TRect& r,ushort l,TScrollBar *a) : TListBox(r,l,a) {};
+ void handleEvent(TEvent& event);
+};
+
+const int cmStrChoose=0x2110;
+
+
+
+// THelpControlDialog
+
+const int
+ cmhNext=0x2111,
+ cmhPrev=0x2112,
+ cmhUp=0x2113,
+ cmhPrevH=0x2114,
+ cmhHide=0x2115,
+ cmhNodeList=0x2116,
+ cmhBookMarks=0x2117,
+ cmhConfigDia=0x2118,
+ cmhOpenInfo=0x2119,
+ cmhHistSel=0x2130;
+
+class THelpControlDialog : public TDialog
+{
+ public:
+ THelpControlDialog(THisCollection *oCol);
+ void handleEvent(TEvent& event);
+ void getData(void *rec) { *(int *)rec=Comando; };
+ void setData(void *rec) { Comando=*(int *)rec; };
+
+ private:
+ int Comando;
+};
+
+// TBookMarkDialog
+
+const int
+ cmbmAddToBookMark=0x2118,
+ cmbmDeleteFromBookMark=0x2117,
+ cmbmGoTo=0x2119;
+
+class TBookMarkDialog : public TDialog
+{
+ public:
+ TBookMarkDialog(TNoCaseStringCollection *oCol);
+ void handleEvent(TEvent& event);
+};
+
+class TCommandSet;
+
+// TInfViewer
+
+class TInfViewer : public TScroller
+{
+public:
+
+ TInfViewer( const TRect&, TScrollBar*, TScrollBar*, TInfFile*, char *,
+ char *match );
+ ~TInfViewer();
+
+ virtual void changeBounds( const TRect& );
+ virtual void draw();
+ virtual void scrollDraw();
+ virtual void resetCursor();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& );
+ virtual void setState(uint16 aState, Boolean enable);
+ void setCmdState(uint16 command, Boolean enable);
+ void updateCommands(int full=0);
+ void makeSelectVisible();
+ void makeVisible(TPoint&,int largo);
+ void GoEndOfLine(void);
+ void UpdateSelection(int X, int Y);
+ void MoveToMouse( TPoint m, uchar selMode );
+ void lock() { lockCount++; };
+ void unlock();
+ void ChooseNode();
+ void ConfigDialog();
+ void OpenInfo();
+ void NextWord(int selectMode, int x, int y);
+ void PrevWord(int selectMode, int x, int y);
+
+ void gotoInteractive();
+ void switchToTopic( char *, TPoint );
+ void switchToTopic( char * );
+ void switchToTopic( stHisto *h );
+ int jumpXRefPartial(char *name, unsigned opts=0);
+
+ TInfFile *hFile;
+ TInfTopic *topic;
+ int selected;
+
+ // Search stuff
+ void find();
+ void findInTopic(char *s);
+ void makeSearch(int beVerbose=1);
+ int searchInCurrentTopic(int Linea,int Col,int largo);
+ int searchInCurrentFile(int Linea,int Col,int largo);
+ int LineStartSelect;
+ int LineEndSelect;
+ int ColStartSelect;
+ int ColEndSelect;
+ char *lastSearch;
+ char findStr[MAX_NODE_NAME];
+ ushort findType;
+ ushort findWhere;
+ int TopicInSearch;
+ int FileInSearch;
+ Boolean TextSelected;
+ stHisto OriginalPlace;
+ int OpenVerbose; // 1 normally, 0 if no warning on open (search)
+ int SearchArmed;
+
+ int selRowStart,selRowEnd,selRowStartPoint;
+ int selColStart,selColEnd,selColStartPoint;
+ Boolean selecting;
+ static void (*InsertRoutine)(char *b, long l);
+ //static void (*InsertRoutineSecondary)(char *b, long l); // i.e. GUI clipboard
+ static void OSInsertRoutine0(char *b, long l);
+ static void OSInsertRoutine1(char *b, long l);
+ static void OSInsertRoutine(int clip, char *b, long l);
+ void PasteToClipboard(void (*ir)(char *b, long l));
+ void PasteInclude(void);
+ int modeFlags;
+
+ static TNoCaseStringCollection *BookMark;
+ void BookMarksDialog(void);
+
+ static void DisableAllCommands();
+ static void InitCommandSet();
+ static TCommandSet *ts;
+ static int version;
+
+protected:
+ static int TranslateName;
+
+private:
+ THisCollection *History;
+ int HistPoint;
+ void AddToHistory(char *);
+ char *TakeFromHistory(TPoint& Pos);
+ void SetTitle(char *File, char *Node);
+ char QuickSearch[MAX_NODE_NAME];
+ int QuickLen;
+ int QuickVisPos;
+ int lockCount;
+ Boolean mustBeRedrawed;
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TInfViewer( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+
+ friend class TInfWindow;
+};
+
+inline ipstream& operator >> ( ipstream& is, TInfViewer& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TInfViewer*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TInfViewer& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TInfViewer* cl )
+ { return os << (TStreamable *)cl; }
+
+
+const int fitWWord=2, fitCaseSens=1;
+const int fitInTopic=0, fitInFile=1, fitInDir=2;
+const int fitNotInTopic=-1;
+
+
+// TInfWindow
+
+class TInfWindow : public TWindow
+{
+public:
+
+ TInfWindow( TInfFile*, char *context, char *match=0,
+ void (*ir)(char *b, long l)=NULL, Boolean IsTheOne=False );
+
+ virtual TPalette& getPalette() const;
+ virtual void close();
+ virtual ~TInfWindow();
+ TInfViewer *viewer;
+ Boolean isTheOne;
+ static void SetMagicEditorInfoTranslation() { TInfViewer::TranslateName=1; };
+ static void ResetMagicEditorInfoTranslation() { TInfViewer::TranslateName=0; };
+
+private:
+
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TInfWindow( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TInfWindow& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TInfWindow*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TInfWindow& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TInfWindow* cl )
+ { return os << (TStreamable *)cl; }
+
+
+// Structure to hold the info returned by the dialog
+#pragma pack(1)
+struct TFindInfDialogRec
+{
+ TFindInfDialogRec(char *findStr, ushort flags1, ushort flags2)
+ {
+ strcpy(find,findStr);
+ options=flags1;
+ ops2=flags2;
+ }
+ char find[MAX_NODE_NAME]; // for TInputLine of MAX_NODE_NAME
+ uint32 options; // for TCheckBoxes32 Type
+ uint32 ops2; // for TRadioButtons32 Where
+};
+#pragma pack()
+
+TDialog *createGoToDialog();
+
+void LoadInfoEnviroment(void);
+
+#endif // __Inf_H
diff --git a/setedit/infview/include/infalone.h b/setedit/infview/include/infalone.h
new file mode 100644
index 0000000..1ae37cd
--- /dev/null
+++ b/setedit/infview/include/infalone.h
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Turbo Vision TVEDIT header file */
+/*----------------------------------------------------------*/
+
+class TMenuBar;
+class TStatusLine;
+class TEditWindow;
+class TDialog;
+
+const int
+ //cmCalculator = 104,
+ //cmDosShell = 105,
+ cmInfView = 106,
+ cmGrep = 107,
+ cmSyntax = 108,
+ cmSyntaxOps = 109,
+ cmSyntaxList = 110,
+ cmAbout = 111,
+ cmManPage = 112,
+ cmScreenConf = 113,
+ cmInfMainOpen= 114;
+
+class fpstream;
+
+struct stScreenOptions
+{
+ // Encoding options
+ // !=0 if the encoding is forced. App=Application, Scr=Screen, Inp=Input.
+ uchar enForceApp, enForceScr, enForceInp;
+ // Which encoding is used, -1 means default one.
+ int enApp, enScr, enInp;
+};
+
+class TEditorMiApp : public TApplication
+{
+public:
+ TEditorMiApp();
+
+ virtual void handleEvent( TEvent& event );
+ static TMenuBar *initMenuBar( TRect );
+ static TStatusLine *initStatusLine( TRect );
+ virtual void outOfMemory();
+ virtual TPalette& getPalette() const;
+ void saveDesktop(const char *fName);
+ void storeDesktop(fpstream &s);
+ void retrieveDesktop(const char *name, int loadWindows);
+ void loadDesktop(fpstream &s, int loadWindows);
+
+protected:
+ void dosShell();
+ void tile();
+ void cascade();
+ //void grepWindow();
+ void ManPageView();
+ void SetScreenOps(void);
+ void SetCodePage(int cp);
+ static void createDefaultSO();
+ static char *createTitle(const char *title);
+
+ static stScreenOptions *so;
+};
+
+extern void SyntaxSearch(void);
+
+ushort execDialog( TDialog *d, void *data );
+TDialog *createFindDialog();
+TDialog *createReplaceDialog();
+ushort doEditDialog( int dialog, ... );
+
diff --git a/setedit/infview/include/infbase.h b/setedit/infview/include/infbase.h
new file mode 100644
index 0000000..8b6a7ec
--- /dev/null
+++ b/setedit/infview/include/infbase.h
@@ -0,0 +1,239 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/***************************************************************
+
+ Filename - infbase.h
+
+ Functions
+ Member functions of following classes
+ TInfTopic
+ TInfIndex
+ TInfFile
+ TInfIndexCollection
+
+***************************************************************/
+
+#ifndef __InfBase_H
+#define __InfBase_H
+
+#define cInfColor "\x37\x3F\x3A\x13\x13\x30\x3E\x1E\x4E\x2E"
+#define cInfBlackWhite "\x07\x0F\x07\x70\x70\x07\x0F\x70\x0F\x70"
+#define cInfMonochrome "\x07\x0F\x07\x70\x70\x07\x0F\x70\x0F\x70"
+#define cInfViewer "\x06\x07\x08\x09"
+#ifdef FOR_EDITOR
+#define cInfWindow "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89"
+#else
+#define cInfWindow "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49"
+#endif
+
+/*#ifndef __STDIO_H
+#if defined(TVCompf_djgpp) && defined(NULL)
+#undef NULL
+#endif
+
+#include <stdio.h>
+
+#if defined(TVCompf_djgpp) && !defined(NULL)
+#define NULL 0
+#endif
+#endif //__STDIO_H
+
+#define Uses_TNoCaseSOSStringCollection
+#include <settvuti.h>*/
+
+// 90 because the Ralf Brown list can make that
+#define MAX_NODE_NAME 90
+#define BUF_SIZE (MAX_NODE_NAME*4+MAX_NODE_NAME/2)
+
+// structure CrossRef
+
+struct CrossRef
+{
+ char Name[MAX_NODE_NAME];
+ char Name2[MAX_NODE_NAME];
+ int offset;
+ int line;
+ int linebreak;
+ uchar length;
+};
+
+
+// structure IndirectIndex
+
+typedef struct
+{
+ long lPos;
+ char Name[MAX_NODE_NAME];
+} IndirectIndex;
+
+const int bestMVisibleName=1;
+
+// TInfTopic
+
+class TInfFile;
+
+class TInfTopic
+{
+
+public:
+
+ TInfTopic( int mode );
+ virtual ~TInfTopic();
+
+ void getCrossRef( int i, TPoint& loc, uchar& length, char *& ref, int &pl );
+ char *getCrossRef( int i ) { return crossRefs[i].Name; };
+ int getLine( int line, char *buffer );
+ int getNumCrossRefs() { return numRefs; };
+ int numLines() { return iLines; };
+ int maxWidth() { return maxLineWidth; };
+ void setWidth( int aWidth ) { width = aWidth; };
+
+ int selBestMatch(char *match, int &PerfectMatch, unsigned opts=0);
+
+ int numRefs;
+ CrossRef *crossRefs;
+
+ Boolean Status;
+ int modeFlags;
+
+ void *Read(TInfFile& File, int offset, int &y);
+
+ // Lo que contiene
+ char *Text;
+ int iLines;
+ int maxLineWidth;
+ long lSize;
+
+ char Node[MAX_NODE_NAME];
+ char Next[MAX_NODE_NAME];
+ char Prev[MAX_NODE_NAME];
+ char Up[MAX_NODE_NAME];
+
+ int SearchNextWith(char *str,int len,int &selected,int &vislen);
+
+ int ReadNodeInfo(TInfFile &File);
+
+private:
+
+ void ReadText(TInfFile &File, int offset, int &y);
+ void ReadCrossRefs( void );
+ int width;
+
+ // Usadas por getLine
+ int lastOffset;
+ int lastLine;
+
+};
+
+// Valores para modeFlag
+const int moinCutNodeWord = 1,
+ moinHideNodeLink = 2;
+
+const unsigned tiicReference=1;
+
+struct TIIC
+{
+ long pos;
+ stkHandler node;
+ char name[0];
+};
+
+// TInfIndexCollection
+// That's a No case sensitive, No owner and SOStack collection, the data in each
+// cell is an TIIC structure.
+
+class TInfIndexCollection : public TNoCaseSOSStringCollection
+{
+public:
+ TInfIndexCollection(ccIndex aLimit, ccIndex aDelta, SOStack *stk) :
+ TNoCaseSOSStringCollection(aLimit,aDelta,stk) {};
+ stkHandler insert(long pos, stkHandler node, char *s, int len);
+ virtual char *GetString( void *h );
+};
+
+// TInfIndex
+
+typedef char NameOfNode[MAX_NODE_NAME];
+
+class TInfIndex
+{
+public:
+
+ TInfIndex( TInfFile& o, int Indirect );
+ TInfIndex( TInfFile& o ); // Para archivos sin Tag Table
+ ~TInfIndex();
+
+ long position(int, char *&, int &);
+ char *nameOf(int i);
+ int WhatIndex(char *Nom);
+
+ int size;
+ IndirectIndex *IndOffsets;
+ int indirects;
+ Boolean Status;
+
+ SOStack *stk;
+ TInfIndexCollection *coll;
+
+ int SearchFirstWith(int Key,int &selected);
+};
+
+#define InfV_UseBinaryFile
+// TInfFile
+
+class TInfFile
+{
+
+public:
+
+ TInfFile( char *s, int Verbose=1 ) { DoAll(s,Verbose); };
+ virtual ~TInfFile();
+ void DoAll(char *s, int Verbose=0 );
+
+ int seekToNode(const char *Name, int fromStart=0);
+ TInfTopic *getTopic(char *, int Verbose, int modeForTopic, int &suggY);
+ TInfTopic *invalidTopic();
+
+ FILE *stream;
+ Boolean Status;
+ Boolean IsCompressed;
+ Boolean DontRemoveCompressed;
+
+ TInfIndex *index;
+ long indexPos;
+ int iFile;
+
+ char Buffer[BUF_SIZE];
+ #ifndef InfV_UseBinaryFile
+ void GetLine(void) { fgets(Buffer,SizeOfReadBuf,stream); };
+ #else
+ void GetLine(void);
+ #endif
+ void SkipNode(void);
+
+ // Special I/O for multi-file
+ int fSeek(long Pos);
+ FILE *fOpen(char *Nombre);
+ int fClose(FILE *f);
+ long fTell(void);
+
+ char NameOfFile[MAX_NODE_NAME];
+
+ int ConvertIt(long Pos);
+ static int SizeOfReadBuf;
+
+ char NameOfTemporal[FILENAME_MAX];
+
+ long fileLength;
+
+private:
+ int ExpandName(char *Buf, char *Nombre, int iExt);
+
+};
+
+extern char *InfViewGetInfoDir(void);
+extern void InfViewAddInfoDir(char *dir);
+
+#endif // __InfBase_H
+
+
diff --git a/setedit/infview/include/infbaser.h b/setedit/infview/include/infbaser.h
new file mode 100644
index 0000000..5e76a9d
--- /dev/null
+++ b/setedit/infview/include/infbaser.h
@@ -0,0 +1,4 @@
+/* Copyright (C) 2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_TNoCaseSOSStringCollection
diff --git a/setedit/infview/include/infr.h b/setedit/infview/include/infr.h
new file mode 100644
index 0000000..7e6b771
--- /dev/null
+++ b/setedit/infview/include/infr.h
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+#define Uses_TStreamable
+#define Uses_TObject
+#define Uses_TPoint
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TWindow
+#define Uses_TCollection
+#define Uses_TListBox
+#define Uses_TDialog
+#define Uses_TNoCaseStringCollection
+#include <infbaser.h>
diff --git a/setedit/infview/include/manview.h b/setedit/infview/include/manview.h
new file mode 100644
index 0000000..e0081ae
--- /dev/null
+++ b/setedit/infview/include/manview.h
@@ -0,0 +1,163 @@
+/* Copyright (C) 1999-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TEnhancedText) && !defined(__TEnhancedText__)
+#define __TEnhancedText__
+
+typedef struct
+{
+ unsigned len;
+ ushort text[0];
+} LineOfEText;
+
+class TNSCollection;
+
+class TEnhancedText : public TNSCollection
+{
+public:
+ TEnhancedText(const char *aFileName, const char *aCommandLine);
+ ~TEnhancedText();
+ void copyLine(int y, int w, ushort *line, char *colors);
+ void copyLineText(int y, int xs, int xe, char *dest);
+ Boolean hasSelection();
+ char *getSelection(unsigned &len);
+
+ const char *fileName;
+ const char *commandLine;
+ char isOK;
+ static int maxWidth;
+ int rows, cols;
+
+ int xSelStart,ySelStart;
+ int xSelEnd,ySelEnd;
+};
+
+#endif // __TEnhancedText__
+
+
+#if defined(Uses_TManPageView) && !defined(__TManPageView__)
+#define __TManPageView__
+
+class TScroller;
+class TRect;
+class TScrollBar;
+class TPalette;
+class TEnhancedText;
+
+class TManPageView : public TScroller
+{
+public:
+ TManPageView(const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar);
+ ~TManPageView();
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual void setState(uint16 aState, Boolean enable);
+ void setCmdState(uint16 command, Boolean enable);
+ void InsertText(TEnhancedText *aText);
+ void getScrollBars(TScrollBar *&hScr, TScrollBar *&vScr);
+ Boolean clipWinCopy(int id);
+ void clipCopy();
+ void lock() { lockCount++; };
+ void unlock();
+ void updateCommands();
+
+ static void (*InsertRoutine)(char *b, long l);
+
+protected:
+ TEnhancedText *text;
+ int lockCount;
+ Boolean mustBeRedrawed;
+
+private:
+ virtual const char *streamableName() const { return name; }
+protected:
+ TManPageView(StreamableInit) : TScroller(streamableInit) { text=0; };
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+public:
+ static const char * const name;
+ static TStreamable *build() {return new TManPageView(streamableInit);};
+};
+
+inline ipstream& operator >> ( ipstream& is, TManPageView& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TManPageView*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TManPageView& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TManPageView* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif // __TManPageView__
+
+#if defined(Uses_TManWindow) && !defined(__TManWindow__)
+#define __TManWindow__
+
+class TWindow;
+class TManPageView;
+class TPalette;
+class TScrollBar;
+
+class TManWindow : public TWindow
+{
+public:
+ TManWindow(const char *fileName, const char *name, char *aCommandLine,
+ void (*ir)(char *b, long l));
+ virtual void handleEvent( TEvent& event );
+ virtual TPalette& getPalette() const;
+ const char *getFileName() { return title; };
+
+protected:
+ TManPageView *page;
+ TScrollBar *hScrollBar;
+ TScrollBar *vScrollBar;
+
+private:
+ virtual const char *streamableName() const { return name; }
+protected:
+ TManWindow(StreamableInit);
+ // These members are needed to initialize page propperly
+ #if 1
+ virtual void write(opstream&);
+ virtual void *read(ipstream&);
+ #endif
+public:
+ static const char * const name;
+ static TStreamable *build() {return new TManWindow(streamableInit);};
+};
+
+inline ipstream& operator >> ( ipstream& is, TManWindow& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TManWindow*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TManWindow& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TManWindow* cl )
+ { return os << (TStreamable *)cl; }
+
+const int hcManPage=0x2120,
+ cmMPUpdateTitle=0x2120;
+
+extern TManWindow *CreateManWindow(const char *file, const char *sections,
+ const char *extraOps,
+ void (*ir)(char *b, long l));
+
+#endif // __TManWindow__
+
+const int prgLen=80,sectLen=20,extraLen=80,visibleLen=60;
+
+#pragma pack(1)
+typedef struct
+{
+ char program[prgLen]; // CLY_Packed;
+ char section[sectLen]; // CLY_Packed;
+ char options[extraLen];// CLY_Packed;
+} ManPageOptions;
+#pragma pack()
+
+class TDialog;
+extern int CheckForMan(void);
+extern TDialog *ManPageViewSelect(const char *name, ManPageOptions **mpo);
diff --git a/setedit/infview/inf.cc b/setedit/infview/inf.cc
new file mode 100644
index 0000000..a560899
--- /dev/null
+++ b/setedit/infview/inf.cc
@@ -0,0 +1,2514 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Filename - inf.cc
+
+ Functions:
+ Member functions of following classes
+ TInfViewer
+ TInfWindow
+ THelpControlDialog
+ TStrListBox
+
+History: (for Inf.Cpp and InfBase.Cpp)
+5/5/96 v0.0.7
+Added: BestMatch.
+ Robert modifications for cursor visibility and use.
+ Local help in ^H.
+ Support for a StatusLine.
+Modifyed: ALT-F10 and ALT-F1 now are commands.
+ Double line links with speed optimization.
+7/5/96
+Modified: getLine of TInfTopic from char *getLine(int) to void getLine(int,
+ char *) for 2 reasons: 1) It's more safe 2) supress an extra
+ strcpy in TInfViewer::draw().
+
+12/6/96
+Modified: selWord=0 in draw() to avoid warnings. (Robert)
+Added: drawView(); switchToTopic because some times the window isn't
+ updated (when there is no cursor movement between topics). (Robert)
+Modified: TInfIndicator was replaced by a change of title. (Robert)
+Modified: An error in MakeVisible (-1).
+
+??/10/96
+Added: Support for compressed files.
+Added: International support.
+
+04/11/96 v0.0.8
+Modified: Parser of menus and * aaaa: aaa.XXXXXX.
+
+12/11/96 v0.0.9
+Modified: to hide the *Note string.
+
+13/11/96
+Modified: the methode to hide *Notes.
+Added: A little selection and paste to the clipboard feature.
+
+1/12/96
+Added: isTheOne to manage the info from the standalone editor.
+Modified: Now getTopic is safer when the file doesn't exist.
+
+9/12/96
+Added: Match of topic while writing the initials. (requested by NIK).
+
+10/12/96
+Bug Killed: '0' didn't check if the number of refs. was 0. (reported by Artur).
+Added: A help context to each dialog. (requested by Artur).
+
+4/1/97
+Added: Now the selection disapears when we change of topic.
+Added: Selection in reverse direction.
+Added: New behaviour of End.
+Added: Selection with End,Home,Page Up and Page Down.
+Added: Mouse selection.
+
+9/1/97
+Added: Support for files without Tag Table (just plain text files with delimiters).
+
+10/1/97
+Added: Better support for Tabs.
+Added: Ported to Linux (no shift arrows, double click emulated).
+Fixed: Now the items in the first line below the Menu entry is taked in count.
+Added: A dialog to choose any node of the file.
+v0.1.0
+
+14/1/97
+Added: Code to show only the true link and not the node, is much better.
+Added: Better support for links like "TInfView::read".
+Modified: In ^O now I'm using a non-owner collection because that can produce a disaster.
+ Now I'm creating the collection with the final size to speed-up.
+Added: Two modes to control the Node-cut and the link hiding.
+Added: A dialog box to control the modes.
+
+15/1/97
+Added: Now the TInfViewer and TInfWindow are stremable, saves:
+ 1) The TWindow data.
+ 2) The TScroller data.
+ 3) The search options.
+ 4) Node & topic position.
+ 5) The configuration flags.
+ 6) The history.
+Modified: The history is now a THisCollection (new).
+
+21/1/97
+Modified: Some things in the parser.
+v0.1.1
+
+26/1/97
+Modified: Now TInfIndex uses a collection for the nodes and the collection
+uses a SOStack for the names of the nodes:
+Advantages: The nodes and positions are parsed and stored in 1 pass. (not 2).
+ The wasted memory is less.
+ The search in the node list is faster.
+ The ^O doesn't need to create a temporal collection.
+Disadvantages: The SOStack can need some realloc calls forcing copies depending on
+ how fragmented is the heap.
+ Some simple tasks (but used only a few times) are slower because
+ needs to call some virtual members. (atStr for example to get the name
+ of the node).
+
+1/2/97
+Added: A command to paste the #include of the topic in the clipboard.
+v0.2.0
+
+2/1/97
+Added: Now when we type first letters and the real name of the link is hided the
+ program makes match with the text that we see on the screen not the real
+ name of the link.
+v0.2.1
+
+8/4/97
+Added: Now ExpandName checks for the name of the file first so if the name is
+ full path qualified or exists in the current directory is opened.
+
+23/6/97
+Modified: Now the Bookmark is static
+v0.2.2
+
+2/9/97
+Added: Open Info dialog, buttons in the Control dialog to call the rest of the
+ dialogs.
+v0.2.3
+
+13/11/97
+Fixed: Underscore was ignored in incremental searchs.
+
+21/04/98
+Fixed: Now when we load a file splitted in the current dir it doesn't fail.
+v0.2.4
+
+16/06/98
+Fixed: Node names in seek where tested using strncmp, that's ok, but if both
+names start with the same letters they match even when the node isn't the
+desired one.
+
+ToDo:
+ When pressing the initials accumulate the keystrokes, works but needs some
+adjustments, for example I didn't take care about names crossing lines.
+ Enhance the selection.
+
+*****************************************************************************/
+
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+
+#define Uses_TStreamableClass
+#define Uses_TPoint
+#define Uses_TStreamable
+#define Uses_TRect
+#define Uses_TScrollBar
+#define Uses_TScroller
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TWindow
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TPalette
+#define Uses_TButton
+#define Uses_TListBox
+#define Uses_TLabel
+#define Uses_TDialog
+#define Uses_MsgBox
+#define Uses_TFindDialogRec
+#define Uses_TInputLine
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_THistory
+#define Uses_TSItem
+#define Uses_TStatusLine
+#define Uses_TFrame
+#define Uses_TStringCollection
+#define Uses_TSortedListBox
+#define Uses_TFileDialog
+#define Uses_TCommandSet
+#define Uses_TVOSClipboard
+#define Uses_TVCodePage
+
+#define Uses_TCEditor_External
+#define Uses_TCEditor_Commands
+#define Uses_FileOpenAid
+#define Uses_Progress
+#define Uses_string
+#define Uses_ctype
+
+// InfView stuff
+#define Uses_TGrowDialog
+#define Uses_TSOSSortedListBox
+#include <infr.h>
+
+#include <ceditor.h>
+#include <diaghelp.h>
+#include <dyncat.h>
+#include <inf.h>
+
+#ifdef TVOS_UNIX
+# include <stdlib.h>
+# define _USE_LFN 1
+#else
+# include <io.h>
+# include <fcntl.h>
+#endif
+
+
+//#define DEBUG
+#ifdef DEBUG
+# ifndef FOR_EDITOR
+# include <nointl.h>
+# endif
+#endif
+
+extern char *strncpyZ(char *dest, const char *orig, int size);
+extern ushort execDialog( TDialog *d, void *data );
+TDialog *createNodeChooseDialog();
+TDialog *createConfigDialog();
+
+#define getshiftstate() event.keyDown.shiftState
+
+
+#define kbFlagsShift (kbRightShift | kbLeftShift)
+#define kbCtrlFlg kbCtrlShift
+#define kbAltFlg kbAltShift
+#define kbShiftFlg kbFlagsShift
+
+#ifdef STANDALONE
+void RemoveFromEditorsHelper(TInfWindow *p);
+#endif
+
+/***************************************************************
+ class TInfViewer
+***************************************************************/
+
+TInfViewer::TInfViewer( const TRect& bounds, TScrollBar* aHScrollBar,
+ TScrollBar* aVScrollBar, TInfFile *aInfFile, char *context,
+ char *match )
+ : TScroller( bounds, aHScrollBar, aVScrollBar )
+{
+ char NameCopy[MAX_NODE_NAME];
+
+ InitCommandSet();
+ modeFlags=moinCutNodeWord | moinHideNodeLink;
+ // pumm!!! bug killed, fucking strings in code by GCC, i need a buffer not
+ // a simple string (my fault).
+ strcpy(NameCopy,context);
+
+ lockCount=0;
+ mustBeRedrawed=False;
+
+ options |= ofSelectable;
+ growMode = gfGrowHiX | gfGrowHiY;
+ hFile = aInfFile;
+ int suggY=0;
+ topic = aInfFile->getTopic(NameCopy,1,modeFlags,suggY);
+ topic->setWidth(size.x);
+ setLimit(topic->maxWidth() + size.x, topic->numLines() + size.y);
+ QuickLen=0;
+
+ int LaPego;
+ if ((selected=topic->selBestMatch(match,LaPego))!=0)
+// selected = 1;
+// else
+ {
+ cursor.x=topic->crossRefs[selected-1].offset;
+ int y=topic->crossRefs[selected-1].line-1;
+ if (y>(size.y>>1))
+ {
+ delta.y=y-(size.y>>1);
+ cursor.y=size.y>>1;
+ }
+ else
+ {
+ delta.y=y;
+ cursor.y=1;
+ }
+ delta.x=0;
+ scrollTo(cursor.x,y);
+ }
+ else
+ if (suggY)
+ {
+ cursor.y=suggY;
+ scrollTo(cursor.x,suggY);
+ }
+
+ TextSelected = False;
+ findStr[0]=0;
+ findType=0;
+ findWhere=fitInTopic;
+ SearchArmed=0;
+ lastSearch=0;
+ OpenVerbose=1;
+
+ // History
+ HistPoint=0;
+ History= new THisCollection(10,10);
+ stHisto *h = new stHisto;
+ strcpy(h->Name,"(");
+ strcat(h->Name,hFile->NameOfFile);
+ strcat(h->Name,")");
+ strcat(h->Name,context);
+ h->HisPos=cursor+delta;
+ h->HisSel=selected;
+ History->insert((void *)h);
+
+ state |= sfCursorVis;
+
+ if (LaPego)
+ {
+ switchToTopic(topic->crossRefs[selected-1].Name);
+ cursor.x=delta.x=cursor.y=delta.y=0;
+ }
+
+ SetTitle( hFile->NameOfFile, topic->Node );
+
+ selRowStart=selRowEnd=selColStart=selColEnd=0;
+ selecting=False;
+
+ // BookMark
+ if (!BookMark)
+ BookMark=new TNoCaseStringCollection(10,10);
+}
+
+
+TInfViewer::~TInfViewer()
+{
+ delete hFile;
+ delete topic;
+ CLY_destroy(History);
+}
+
+static int PointInCrossRef(TPoint point,TInfTopic *topic,int & i)
+{
+ if (!topic)
+ return -1;
+ int crossCount = topic->numRefs;
+ i = 0;
+ if (crossCount == 0) return -1;
+ point.y++;
+ for (i=0;i<crossCount;i++)
+ {
+ CrossRef & ref = topic->crossRefs[i];
+ if (ref.line > point.y) return -1;
+ // Support for crossRefs that cross lines, slow
+ if (ref.line == (point.y-1))
+ {
+ if (ref.linebreak && point.x<=ref.linebreak)
+ return i;
+ continue;
+ }
+ if (ref.line < point.y) continue;
+ if (ref.offset > point.x) return -1;
+ if (ref.offset+ref.length <= point.x) continue;
+ return i;
+ }
+ i = crossCount;
+ return -1;
+}
+
+void TInfViewer::resetCursor()
+{
+ int before;
+ TScroller::resetCursor();
+ selected = PointInCrossRef(cursor+delta,topic,before)+1;
+}
+
+void TInfViewer::scrollDraw()
+{
+ TPoint d;
+
+ if( hScrollBar != 0 )
+ d.x = hScrollBar->value;
+ else
+ d.x = 0;
+
+ if( vScrollBar != 0 )
+ d.y = vScrollBar->value;
+ else
+ d.y = 0;
+
+ if ( (d.x - delta.x) != cursor.x || (d.y - delta.y) != cursor.y)
+ {
+ if (d.x - delta.x >= size.x)
+ {
+ delta.x = d.x - size.x + 1;
+ }
+ else if (d.x - delta.x < 0)
+ {
+ delta.x = d.x;
+ }
+ if (d.y - delta.y >= size.y)
+ {
+ delta.y = d.y - size.y + 1;
+ }
+ else if (d.y - delta.y < 0)
+ {
+ delta.y = d.y;
+ }
+ setCursor(d.x-delta.x,d.y-delta.y);
+ if( drawLock != 0 )
+ drawFlag = True;
+ else
+ drawView();
+ }
+}
+
+void TInfViewer::changeBounds( const TRect& bounds )
+{
+ TScroller::changeBounds(bounds);
+ topic->setWidth(size.x);
+ setLimit(topic->maxWidth() + size.x, topic->numLines() + size.y);
+}
+
+static void moveChar(int indent, char c, char attr, int count, ushort *b)
+{
+ ushort val;
+ uchar *p=(uchar *)&val;
+ p[0]=c; p[1]=attr;
+
+ for (b+=indent; count; count--, b++)
+ *b=val;
+}
+
+static void moveStr(int indent, char *buffer, char attr, ushort *b)
+{
+ char *s=(char *)(b+indent);
+
+ while (*buffer)
+ {
+ *s=*buffer;
+ *(s+1)=attr;
+ s+=2;
+ buffer++;
+ }
+}
+
+void TInfViewer::setState(uint16 aState, Boolean enable)
+{
+ TScroller::setState(aState,enable);
+ if (aState==sfActive)
+ updateCommands(1);
+}
+
+void TInfViewer::setCmdState(uint16 command, Boolean enable)
+{
+ if (enable && (state & sfActive))
+ enableCommand(command);
+ else
+ disableCommand(command);
+}
+
+void TInfViewer::InitCommandSet()
+{
+ if (ts)
+ return;
+ ts=new TCommandSet();
+
+ ts->enableCmd(cmcFind);
+ ts->enableCmd(cmcCopyClipWin);
+ ts->enableCmd(cmcCopy);
+ ts->enableCmd(cmcSearchAgain);
+
+ ts->enableCmd(cmInfHelp);
+ ts->enableCmd(cmInfControl);
+ ts->enableCmd(cmInfBack);
+ ts->enableCmd(cmInfPasteIn);
+ ts->enableCmd(cmInfBookM);
+ ts->enableCmd(cmInfNodes);
+ ts->enableCmd(cmInfGoto);
+ ts->enableCmd(cmInfOpen);
+ ts->enableCmd(cmInfDir);
+ ts->enableCmd(cmInfTop);
+
+ ts->enableCmd(cmhNext);
+ ts->enableCmd(cmhPrev);
+ ts->enableCmd(cmhUp);
+ ts->enableCmd(cmhPrevH);
+ ts->enableCmd(cmhHide);
+ ts->enableCmd(cmhNodeList);
+ ts->enableCmd(cmhBookMarks);
+ ts->enableCmd(cmhConfigDia);
+ ts->enableCmd(cmhOpenInfo);
+ ts->enableCmd(cmhHistSel);
+}
+
+void TInfViewer::DisableAllCommands()
+{
+ if (!ts)
+ InitCommandSet();
+ if (ts)
+ disableCommands(*ts);
+}
+
+void TInfViewer::updateCommands(int full)
+{
+ if (!(state & sfActive))
+ { // We lost the focus, disable all
+ DisableAllCommands();
+ return;
+ }
+
+ // Enable in block then go for the particular ones
+ if (full && ts)
+ enableCommands(*ts);
+
+ int deltaY=selRowEnd-selRowStart+1;
+ int haveSel=deltaY>1 || (deltaY==1 && selColEnd>selColStart);
+ setCmdState(cmcCopyClipWin,(TVOSClipboard::isAvailable() && haveSel) ? True : False);
+ setCmdState(cmcCopy,(InsertRoutine && haveSel) ? True : False);
+ setCmdState(cmInfPasteIn,InsertRoutine ? True : False);
+ setCmdState(cmcSearchAgain,Boolean(SearchArmed));
+}
+
+
+void TInfViewer::draw()
+{
+ if (lockCount)
+ {
+ mustBeRedrawed=True;
+ return;
+ }
+ mustBeRedrawed=False;
+
+ ushort b[256];
+ char linea[256],*line;
+ char buffer[256];
+ char *bufPtr;
+ unsigned char aux;
+ int i, j, l, k;
+ int keyCount;
+ ushort normal, keyword, selKeyword, c,selWord=0,colSelArea;
+ TPoint keyPoint;
+ uchar keyLength;
+ char *keyRef;
+ int NumCrossRefs=topic->getNumCrossRefs();
+ int LineaReal;
+ int Exceso;
+ char *bf=(char *)b;
+
+ normal = getColor(1);
+ keyword = getColor(2);
+ selKeyword = getColor(3);
+ if (TextSelected)
+ selWord = getColor(4);
+ colSelArea=0x70;
+ keyCount = 0;
+ keyPoint.x = 0;
+ keyPoint.y = 0;
+ topic->setWidth(size.x);
+
+ // Saltear las crossrefs que estn antes en la pantalla
+ if (NumCrossRefs > 0)
+ {
+ do
+ {
+ topic->getCrossRef(keyCount++, keyPoint, keyLength, keyRef, Exceso);
+ }
+ while ( (keyCount < NumCrossRefs) && (keyPoint.y <= delta.y));
+ }
+
+ for (i = 1, LineaReal=delta.y+1; i <= size.y; ++i,LineaReal++)
+ {
+ topic->getLine(LineaReal,linea);
+ if (linea[0]==30)
+ {
+ aux=(unsigned char)linea[1];
+ if (aux<='9')
+ c=(aux-'0')<<4;
+ else
+ c=(aux-(unsigned char)'A'+10)<<4;
+ aux=(unsigned char)linea[2];
+ if (aux<='9')
+ c+=aux-'0';
+ else
+ c+=aux-(unsigned char)'A'+10;
+ line=linea+3;
+ }
+ else
+ {
+ c=normal;
+ line=linea;
+ }
+ moveChar(0, ' ', c, size.x, b); // Attr pedido
+
+ if ((int)strlen(line) > delta.x)
+ {
+ bufPtr = line + delta.x;
+ strncpy(buffer, bufPtr, size.x);
+ buffer[size.x] = 0;
+ moveStr(0, buffer, c, b);
+ }
+ else
+ moveStr(0, "", c, b);
+
+
+ while (LineaReal == keyPoint.y)
+ {
+ if (Exceso>0)
+ l = keyLength-Exceso;
+ else
+ l = keyLength;
+ if (keyPoint.x < delta.x )
+ {
+ l -= (delta.x - keyPoint.x);
+ keyPoint.x = delta.x;
+ }
+ if (keyCount == selected)
+ c = selKeyword;
+ else
+ c = keyword;
+ for (j = 0; j < l; ++j)
+ bf[(keyPoint.x - delta.x + j)*2+1]=c;
+ if (Exceso>0)
+ {
+ keyPoint.x=0;
+ keyPoint.y++;
+ keyLength=Exceso+1;
+ Exceso=0;
+ }
+ else
+ {
+ ++keyCount;
+ if (keyCount <= NumCrossRefs)
+ topic->getCrossRef(keyCount-1, keyPoint, keyLength, keyRef, Exceso);
+ else
+ keyPoint.y = 0;
+ }
+ }
+
+ // Paint the selection
+ if (LineaReal>=selRowStart && LineaReal<=selRowEnd)
+ {
+ int start;
+ if (selRowStart==selRowEnd)
+ {
+ l=selColEnd-selColStart;
+ if ( selColStart<delta.x )
+ {
+ l -= (delta.x - selColEnd);
+ start = 0;
+ }
+ else
+ start = selColStart - delta.x;
+ }
+ else
+ {
+ if (LineaReal==selRowStart)
+ {
+ start=selColStart-delta.x;
+ l=size.x-start;
+ }
+ else
+ if (LineaReal==selRowEnd)
+ {
+ start=0;
+ l=selColEnd-delta.x;
+ }
+ else
+ {
+ start=0;
+ l=size.x;
+ }
+ }
+ for(j = 0, k=start*2+1; j < l; ++j, k+=2)
+ bf[k] = (bf[k] & 0x0F) | colSelArea;
+ }
+
+ // Paint the founded word
+ if (TextSelected && (LineaReal>=LineStartSelect && LineaReal<=LineEndSelect))
+ {
+ int start;
+ l = ColEndSelect-ColStartSelect;
+ if ( ColStartSelect<delta.x )
+ {
+ l -= (delta.x - ColStartSelect);
+ start = 0;
+ }
+ else
+ start = ColStartSelect - delta.x;
+ for(j = 0, k=start*2+1; j < l; ++j, k+=2)
+ bf[k]=selWord;
+ }
+ writeLine(0, i-1, size.x, 1, b);
+ }
+ if (state & sfActive)
+ updateCommands();
+}
+
+void TInfViewer::SetTitle(char *File, char *Node)
+{
+ if (owner) /* is a window ? */
+ {
+ char *intlFmt=TVIntl::getTextNew(__("InfView - File: %s - Node: %s"));
+ char *newTitle=new char[strlen(intlFmt)+strlen(File)+strlen(Node)-3];
+
+ sprintf(newTitle,intlFmt,File,Node);
+ DeleteArray(intlFmt);
+
+ delete (char *)((TWindow *)owner)->title;
+ ((TWindow *)owner)->title = (const char *)newTitle;
+ ((TWindow *)owner)->frame->drawView();
+ }
+}
+
+
+TPalette& TInfViewer::getPalette() const
+{
+ static TPalette palette(cInfViewer, sizeof( cInfViewer)-1);
+ return palette;
+}
+
+void TInfViewer::makeSelectVisible()
+{
+ int ProxLine;
+ TPoint keyPoint;
+ uchar keyLength;
+ char *keyRef;
+
+ topic->getCrossRef(selected-1, keyPoint, keyLength, keyRef, ProxLine);
+ if (QuickLen)
+ keyPoint.x+=QuickVisPos-1;
+ makeVisible(keyPoint,keyLength);
+}
+
+
+void TInfViewer::makeVisible( TPoint& keyPoint, int largo )
+{
+ if ((keyPoint.x+largo)>(delta.x+size.x) && (size.x>=largo))
+ scrollTo(keyPoint.x+largo-1,keyPoint.y-1);
+ else
+ scrollTo(keyPoint.x,keyPoint.y-1);
+}
+
+void TInfViewer::switchToTopic( char *keyRef, TPoint Pos )
+{
+ char NameCopy[MAX_NODE_NAME];
+
+ // Kill the selection
+ selRowStart=selRowEnd=selColStart=selColEnd=0;
+ selecting=False;
+
+ // Because i can destroy the original bellow, keyRef is from topic and i go
+ // to detroy it.
+ strcpy(NameCopy,keyRef);
+
+ if (topic != 0)
+ {
+ delete topic;
+ topic=NULL;
+ }
+ int suggY;
+ topic=hFile->getTopic(NameCopy,OpenVerbose,modeFlags,suggY);
+ if (Pos.y<0) Pos.y=suggY;
+
+ SetTitle(hFile->NameOfFile,topic->Node);
+
+ topic->setWidth(size.x);
+ setLimit(topic->maxWidth() + size.x, topic->numLines() + size.y);
+ scrollTo(Pos.x,Pos.y);
+ // No search
+ TextSelected=False;
+ lastSearch=topic->Text;
+ drawView();
+}
+
+void TInfViewer::switchToTopic(char *keyRef)
+{
+ TPoint Pos;
+
+ AddToHistory(keyRef);
+ Pos.x=0; Pos.y=-1;
+ selected=0;
+ switchToTopic( keyRef,Pos );
+}
+
+void TInfViewer::switchToTopic(stHisto *h)
+{
+ AddToHistory(h->Name);
+ selected=h->HisSel;
+ switchToTopic(h->Name,h->HisPos);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Jumps to an indicated cross reference. The name can match partially.
+Passing jmpXRSubStr in opts jumps only if the name is a substring, normally
+jumps just to the name that have more coincident letters at the start (can
+be just one). The search isn't case sensitive. Passing the bestMVisibleName
+flag the search is done using the visible names of the cross references, no
+the node names.
+
+ Return:
+ !=0 if a jump was done
+
+***************************************************************************/
+
+int TInfViewer::jumpXRefPartial(char *name, unsigned opts)
+{
+ int LaPego,cual;
+ cual=topic->selBestMatch(name,LaPego,opts);
+ if (cual)
+ {
+ cual--;
+ if (opts & jmpXRSubStr)
+ {
+ char *node=opts & bestMVisibleName ?
+ topic->crossRefs[cual].Name2 :
+ topic->crossRefs[cual].Name;
+ if (strncasecmp(name,node,strlen(name)))
+ return 0;
+ }
+ switchToTopic(topic->crossRefs[cual].Name);
+ return 1;
+ }
+ return 0;
+}
+
+static void AddFileToNode(char *dest, char *source, char *file)
+{
+ if (source[0]=='(')
+ strncpy(dest,source,MAX_NODE_NAME-1);
+ else
+ {
+ dest[0]='(';dest[1]=0;
+ strncat(dest,file,MAX_NODE_NAME-4);
+ strcat(dest,")");
+ if (strlen(source)+strlen(dest)+1<MAX_NODE_NAME)
+ strcat(dest,source);
+ }
+}
+
+void TInfViewer::AddToHistory(char *context)
+{
+ stHisto *h = (stHisto *)History->at(HistPoint);
+
+ h->HisPos = cursor + delta;
+ h->HisSel=selected;
+
+ h = new stHisto;
+
+ AddFileToNode(h->Name,context,hFile->NameOfFile);
+
+ History->insert(h);
+ HistPoint++;
+
+ if (HistPoint>=MAX_HIST_DEEP)
+ {
+ History->atRemove(0);
+ HistPoint--;
+ }
+}
+
+char *TInfViewer::TakeFromHistory(TPoint& Pos)
+{
+ stHisto *h;
+ if (HistPoint>0)
+ {
+ History->atRemove(HistPoint--);
+ h=(stHisto *)History->at(HistPoint);
+ }
+ else
+ h=(stHisto *)History->at(0);
+
+ selected=h->HisSel;
+ Pos = h->HisPos;
+ return h->Name;
+}
+
+void TInfViewer::OSInsertRoutine(int clip, char *b, long l)
+{
+ if (!TVOSClipboard::copy(clip,b,l))
+ {
+ messageBox(mfError | mfOKButton,__("Error copying to clipboard: %s"),
+ TVOSClipboard::getError());
+ return;
+ }
+}
+
+void TInfViewer::OSInsertRoutine0(char *b, long l)
+{
+ OSInsertRoutine(0,b,l);
+}
+
+void TInfViewer::OSInsertRoutine1(char *b, long l)
+{
+ OSInsertRoutine(1,b,l);
+}
+
+void TInfViewer::PasteToClipboard(void (*ir)(char *b, long l))
+{
+ char b[256];
+ int deltaY=selRowEnd-selRowStart;
+
+ if (deltaY<0 || (deltaY==0 && selColEnd<=selColStart))
+ return;
+
+ char *d=new char[(deltaY+1)*256];
+ char *s=d;
+
+ if (d==NULL)
+ return;
+
+ int i;
+ int l=0,lTotal=0,lLine;
+ int Xs=selColStart,Xe=selColEnd;
+ for (i=selRowStart; i<=selRowEnd; i++)
+ {
+ if (i==selRowStart || i==selRowEnd)
+ {
+ lLine=topic->getLine(i,b);
+ if (selRowStart==selRowEnd)
+ {
+ if (Xs>lLine) return;
+ if (Xe>lLine) Xe=lLine;
+ lTotal=Xe-Xs;
+ memcpy(s,b+Xs,lTotal);
+ }
+ else
+ if (i==selRowStart)
+ {
+ if (Xs<lLine)
+ {
+ lTotal=lLine-Xs;
+ memcpy(s,b+Xs,lTotal);
+ s+=lTotal;
+ const char *p=CLY_crlf;
+ for (int i=0; i<CLY_LenEOL; i++)
+ {
+ s[0]=p[i];
+ s++;
+ lTotal++;
+ }
+ }
+ }
+ else
+ if (i==selRowEnd)
+ {
+ if (Xe>lLine)
+ Xe=lLine;
+ l=Xe;
+ memcpy(s,b,l);
+ lTotal+=l;
+ }
+ }
+ else
+ {
+ lLine=topic->getLine(i,s);
+ s+=lLine;
+ const char *p=CLY_crlf;
+ for (int i=0; i<CLY_LenEOL; i++)
+ {
+ s[0]=p[i];
+ s++;
+ lTotal++;
+ }
+ lTotal+=lLine;
+ }
+ }
+
+ if (lTotal)
+ ir(d,lTotal);
+
+ delete d;
+}
+
+
+void TInfViewer::PasteInclude(void)
+{
+ char *s,*f;
+ int lines=topic->iLines,line=0,l,inserted=0;
+ char b[256];
+ DynStrCatStruct cat;
+
+ DynStrCatInit(&cat,"",0);
+ do
+ {
+ topic->getLine(line+1,b);
+ s=strstr(b,"#include");
+ if (s)
+ {
+ for (f=s, l=1; *f && *f!='>'; f++,l++);
+ if (inserted)
+ {
+ DynStrCat(&cat,(char *)CLY_crlf,CLY_LenEOL);
+ DynStrCat(&cat,s,l);
+ }
+ else
+ DynStrCatInit(&cat,s,l);
+ inserted++;
+ }
+ line++;
+ }
+ while (line<lines);
+ if (inserted)
+ {
+ InsertRoutine(cat.str,cat.len);
+ ::free(cat.str);
+ }
+}
+
+void TInfViewer::GoEndOfLine(void)
+{
+ char linea[256];
+ int Xp=0,x=0;
+
+ topic->getLine(delta.y+cursor.y+1,linea);
+ while (linea[x])
+ {
+ if (!ucisspace(linea[x])) Xp=x;
+ x++;
+ }
+ Xp++;
+ scrollTo(Xp,delta.y+cursor.y);
+}
+
+void TInfViewer::UpdateSelection(int X, int Y)
+{
+ if (Y>selRowStartPoint || (Y==selRowStartPoint && X>=selColStartPoint))
+ {
+ selRowEnd=Y;
+ selColEnd=X;
+ selRowStart=selRowStartPoint;
+ selColStart=selColStartPoint;
+ }
+ else
+ {
+ selRowStart=Y;
+ selColStart=X;
+ selRowEnd=selRowStartPoint;
+ selColEnd=selColStartPoint;
+ }
+}
+
+void TInfViewer::MoveToMouse(TPoint m, uchar selMode)
+{
+ TPoint mouse = makeLocal(m);
+
+ scrollTo(mouse.x+delta.x,mouse.y+delta.y);
+ if (selMode & smExtend)
+ { // Extends the selection
+ UpdateSelection(cursor.x+delta.x,cursor.y+delta.y+1);
+ }
+ else
+ { // Starts a selection
+ if (selMode & smDouble)
+ { // Jump to the topic
+ if (selected > 0)
+ switchToTopic(topic->getCrossRef(selected-1));
+ }
+ else
+ {
+ selRowStartPoint=cursor.y+delta.y+1;
+ selColStartPoint=cursor.x+delta.x;
+ }
+ }
+}
+
+void TInfViewer::unlock()
+{
+ if (lockCount>0)
+ {
+ lockCount--;
+ if (lockCount==0 && mustBeRedrawed)
+ drawView();
+ }
+}
+
+void TInfViewer::gotoInteractive()
+{
+ char gotoStr[MAX_NODE_NAME];
+
+ gotoStr[0]=0;
+ if (execDialog(createGoToDialog(),gotoStr)!=cmCancel)
+ switchToTopic(gotoStr);
+}
+
+void TInfViewer::NextWord(int selectMode, int x, int y)
+{
+ char b[256],*s;
+ int ox=x, oy=y;
+ topic->getLine(y+1,b);
+ s=b+x;
+ if (!*s)
+ {
+ if (y>=limit.y) return;
+ y++; x=0;
+ topic->getLine(y+1,b);
+ s=b;
+ vScrollBar->setValue(y);
+ }
+ if (TVCodePage::isAlpha(*s))
+ for (; *s && TVCodePage::isAlpha(*s); s++, x++);
+ for (; *s && !TVCodePage::isAlpha(*s); s++, x++);
+ hScrollBar->setValue(x);
+ if (selectMode && (ox!=x || oy!=y))
+ {
+ UpdateSelection(x,y+1);
+ drawView();
+ }
+}
+
+void TInfViewer::PrevWord(int selectMode, int x, int y)
+{
+ char b[256],*s;
+ if (x==0)
+ {
+ if (y==0) return;
+ y--;
+ x=topic->getLine(y+1,b);
+ scrollTo(x,y);
+ if (selectMode)
+ {
+ UpdateSelection(x,y+1);
+ drawView();
+ }
+ return;
+ }
+ topic->getLine(y+1,b);
+ s=b+x;
+ s--; x--;
+ if (!TVCodePage::isAlpha(*s))
+ for (; s!=b && !TVCodePage::isAlpha(*s); s--, x--);
+ for (; s!=b && TVCodePage::isAlpha(*s); s--, x--);
+ if (s!=b)
+ {
+ s++;
+ x++;
+ }
+ hScrollBar->setValue(x);
+ if (selectMode)
+ {
+ UpdateSelection(x,y+1);
+ drawView();
+ }
+}
+
+void TInfViewer::handleEvent( TEvent& event )
+{
+ uchar selectMode = 0;
+ int S;
+ int key;
+ int X,Y;
+
+ if (event.what==evKeyDown)
+ {
+ switch (event.keyDown.keyCode)
+ {
+ #define C(a) case kbSh##a: event.keyDown.keyCode=kb##a; break;
+ C(Down)
+ C(Up)
+ C(Left)
+ C(Right)
+ C(End)
+ C(Home)
+ C(PgUp)
+ C(PgDn)
+ C(CtLeft)
+ C(CtRight)
+ #undef C
+ }
+ }
+
+ TScroller::handleEvent(event);
+ switch (event.what)
+ {
+ case evCommand:
+ switch (event.message.command)
+ {
+ case cmInfHelp:
+ switchToTopic("(infview)");
+ break;
+
+ case cmcFind:
+ find();
+ break;
+
+ case cmcSearchAgain:
+ makeSearch();
+ break;
+
+ case cmcCopy:
+ if (InsertRoutine)
+ PasteToClipboard(InsertRoutine);
+ break;
+
+ case cmcCopyClipWin:
+ if (TVOSClipboard::isAvailable())
+ PasteToClipboard(OSInsertRoutine0);
+ break;
+
+ case cmInfPasteIn:
+ if (InsertRoutine)
+ PasteInclude();
+ break;
+
+ case cmInfBookM:
+ BookMarksDialog();
+ break;
+
+ case cmInfNodes:
+ ChooseNode();
+ break;
+
+ case cmInfGoto:
+ gotoInteractive();
+ break;
+
+ case cmInfOpen:
+ OpenInfo();
+ break;
+
+ case cmhNext:
+ switchToTopic(topic->Next);
+ break;
+
+ case cmhPrev:
+ switchToTopic(topic->Prev);
+ break;
+
+ case cmhUp:
+ switchToTopic(topic->Up);
+ break;
+
+ case cmhConfigDia:
+ ConfigDialog();
+ break;
+
+ case cmInfDir:
+ switchToTopic("(dir)");
+ break;
+
+ case cmInfTop:
+ switchToTopic("Top");
+ break;
+
+ case cmInfControl:
+ {
+ int Comando =
+ execDialog( new THelpControlDialog(History), NULL );
+ if (Comando>=cmhHistSel)
+ {
+ switchToTopic((stHisto *)History->at(Comando-cmhHistSel));
+ }
+ else
+ switch (Comando)
+ {
+ case cmhNext:
+ switchToTopic(topic->Next);
+ break;
+ case cmhPrev:
+ switchToTopic(topic->Prev);
+ break;
+ case cmhUp:
+ switchToTopic(topic->Up);
+ break;
+ case cmhPrevH:
+ {
+ TPoint Pos;
+ char *contexto=TakeFromHistory(Pos);
+ switchToTopic(contexto,Pos);
+ }
+ break;
+ case cmhNodeList:
+ ChooseNode();
+ break;
+ case cmhBookMarks:
+ BookMarksDialog();
+ break;
+ case cmhConfigDia:
+ ConfigDialog();
+ break;
+ case cmhOpenInfo:
+ OpenInfo();
+ break;
+ }
+ }
+ break;
+
+ case cmInfBack:
+ {
+ TPoint Pos;
+ char *contexto=TakeFromHistory(Pos);
+ switchToTopic(contexto,Pos);
+ }
+ break;
+
+ case cmInfLastLink:
+ if (topic->numRefs)
+ switchToTopic(topic->crossRefs[topic->numRefs-1].Name);
+ break;
+
+ case cmInfLink1:
+ case cmInfLink2:
+ case cmInfLink3:
+ case cmInfLink4:
+ case cmInfLink5:
+ case cmInfLink6:
+ case cmInfLink7:
+ case cmInfLink8:
+ case cmInfLink9:
+ key=event.message.command-cmInfLink1;
+ if (key<topic->numRefs)
+ {
+ switchToTopic(topic->crossRefs[key].Name);
+ QuickLen=0;
+ }
+ break;
+
+ case cmClose:
+ case cmCancel:
+ // When the help is called from a modal window we use a modal
+ // help. In this case we must release the focus with endModal.
+ if (owner->state & sfModal)
+ endModal(event.message.command);
+ else
+ // For the rest the default is applied, it means close() is called.
+ return;
+ break;
+
+ default:
+ return;
+ }
+ clearEvent(event);
+ break;
+
+ case evKeyDown:
+ S=event.keyDown.shiftState;
+
+ if (selecting)
+ {
+ if ((S & kbFlagsShift) != 0)
+ selectMode = smExtend;
+ else
+ {
+ selectMode = 0;
+ selecting = False;
+ }
+ }
+ else
+ {
+ if ((S & kbFlagsShift) != 0)
+ selectMode = smStartSel;
+ }
+
+ key=event.keyDown.keyCode;
+ X=delta.x+cursor.x;
+ Y=delta.y+cursor.y;
+ if (selectMode==smStartSel && (key==kbDown || key==kbUp ||
+ key==kbLeft || key==kbRight || key==kbEnd ||
+ key==kbHome || key==kbPgUp || key==kbPgDn ||
+ key==kbCtLeft || key==kbCtRight) )
+ {
+ selRowStartPoint=Y+1;
+ selColStartPoint=X;
+ selecting=True;
+ }
+
+ switch (key)
+ {
+ case kbTab:
+ if (PointInCrossRef(cursor+delta,topic,selected) >= 0)
+ selected++;
+ selected++;
+ if (selected > topic->getNumCrossRefs())
+ selected = 1;
+ if ( topic->getNumCrossRefs() != 0 )
+ makeSelectVisible();
+ QuickLen=0;
+ break;
+
+ case kbShTab:
+ PointInCrossRef(cursor+delta,topic,selected);
+ if (selected == 0)
+ selected = topic->getNumCrossRefs();
+ if ( topic->getNumCrossRefs() != 0 )
+ makeSelectVisible();
+ QuickLen=0;
+ break;
+
+ case kbEnter:
+ if (selected > 0)
+ if (selected <= topic->getNumCrossRefs())
+ switchToTopic(topic->getCrossRef(selected-1));
+ QuickLen=0;
+ break;
+
+ case kbEsc:
+ if (owner->state & sfModal)
+ endModal(cmCancel);
+ else
+ {
+ event.what=evCommand;
+ event.message.command=cmClose;
+ event.message.infoPtr=NULL;
+ putEvent(event);
+ }
+ QuickLen=0;
+ break;
+
+ case kbDown:
+ case kbShDown:
+ if (selecting)
+ {
+ UpdateSelection(X,Y+2);
+ drawView();
+ }
+ QuickLen=0;
+ return;
+
+ case kbUp:
+ case kbShUp:
+ if (selectMode)
+ {
+ UpdateSelection(X,Y);
+ drawView();
+ }
+ QuickLen=0;
+ return;
+
+ case kbLeft:
+ case kbShLeft:
+ if (selectMode)
+ {
+ UpdateSelection(X-1,Y+1);
+ drawView();
+ }
+ QuickLen=0;
+ return;
+
+ case kbRight:
+ case kbShRight:
+ if (selectMode)
+ {
+ UpdateSelection(X+1,Y+1);
+ drawView();
+ }
+ QuickLen=0;
+ return;
+
+ case kbCtInsert:
+ if (InsertRoutine)
+ PasteToClipboard(InsertRoutine);
+ break;
+
+ case kbEnd:
+ case kbShEnd:
+ GoEndOfLine();
+ X=delta.x+cursor.x;
+ if (selectMode)
+ UpdateSelection(X,Y+1);
+ hScrollBar->setValue(X);
+ QuickLen=0;
+ break;
+
+ case kbHome:
+ case kbShHome:
+ if (selectMode)
+ {
+ UpdateSelection(0,Y+1);
+ drawView();
+ }
+ QuickLen=0;
+ return;
+
+ case kbPgUp:
+ case kbShPgUp:
+ scrollTo(X,Y-(size.y-1));
+ Y=cursor.y+delta.y;
+ if (selectMode)
+ UpdateSelection(cursor.x+delta.x+1,Y+1);
+ vScrollBar->setValue(Y);
+ QuickLen=0;
+ break;
+
+ case kbPgDn:
+ case kbShPgDn:
+ scrollTo(X,Y+size.y-1);
+ Y=cursor.y+delta.y;
+ if (selectMode)
+ UpdateSelection(cursor.x+delta.x+1,Y+1);
+ vScrollBar->setValue(Y);
+ QuickLen=0;
+ break;
+
+
+ case kbShCtLeft:
+ case kbCtLeft:
+ PrevWord(selectMode,X,Y);
+ break;
+
+ case kbShCtRight:
+ case kbCtRight:
+ NextWord(selectMode,X,Y);
+ QuickLen=0;
+ break;
+
+ default:
+ int Key=TVCodePage::toUpper(event.keyDown.charScan.charCode);
+ if ((key>=kbA && key<=kbZ) || key==kbSpace || Key=='_')
+ {
+ if (QuickLen<MAX_NODE_NAME)
+ {
+ QuickSearch[QuickLen++]=Key;
+ if (topic->SearchNextWith(QuickSearch,QuickLen,selected,QuickVisPos))
+ makeSelectVisible();
+ else
+ QuickLen--;
+ }
+ }
+ else if (key>=kb1 && key<=kb9)
+ {
+ Key-='1';
+ if (Key<topic->numRefs)
+ {
+ switchToTopic(topic->crossRefs[Key].Name);
+ QuickLen=0;
+ }
+ else
+ return;
+ }
+ else
+ {
+ QuickLen=0;
+ switch (key)
+ {
+ case kbCtL:
+ makeSearch();
+ break;
+
+ case kbCtS:
+ find();
+ break;
+
+ case kbCtN:
+ switchToTopic(topic->Next);
+ break;
+
+ case kbCtP:
+ switchToTopic(topic->Prev);
+ break;
+
+ case kbCtU:
+ switchToTopic(topic->Up);
+ break;
+
+ case kbCtD:
+ switchToTopic("(dir)");
+ break;
+
+ case kbCtT:
+ switchToTopic("Top");
+ break;
+
+ case kb0:
+ if (topic->numRefs)
+ switchToTopic(topic->crossRefs[topic->numRefs-1].Name);
+ break;
+
+ case kbCtG:
+ gotoInteractive();
+ break;
+
+ case kbCtH:
+ switchToTopic("(infview)");
+ break;
+
+ case kbCtO:
+ ChooseNode();
+ break;
+
+ case kbCtF:
+ ConfigDialog();
+ break;
+
+ default:
+ return;
+ }
+ }
+ }
+ drawView();
+ clearEvent(event);
+ break;
+
+ case evMouseDown:
+ if (event.mouse.doubleClick)
+ selectMode|=smDouble;
+ do
+ {
+ lock();
+ MoveToMouse(event.mouse.where,selectMode);
+ selectMode|=smExtend;
+ unlock();
+ }
+ while (mouseEvent(event,evMouseMove+evMouseAuto));
+ if (TVOSClipboard::isAvailable()>1)
+ PasteToClipboard(OSInsertRoutine1);
+ break;
+ }
+}
+
+extern char *InfViewGetInfoDir(void);
+
+void TInfViewer::OpenInfo(void)
+{
+ char file[PATH_MAX];
+ int l;
+
+ AsoID *aso=GetFileIDDirBuffer(hID_OpenInfo);
+ char *path=0;
+ if (aso && aso->dir)
+ path=aso->dir;
+
+ if (path && path[0]==0)
+ { // If the directory isn't configured
+ strcpy(file,InfViewGetInfoDir());
+ char *start=file;
+ char *end=start;
+
+ while (*end && *end!=PATHSEPARATOR) end++;
+ *end = 0;
+ SetFileIDDirValue(hID_OpenInfo,start);
+ }
+
+ strcpy(file,"*.in[fz]*");
+
+ if (GenericFileDialog(__("Open Info"),file,0,hID_OpenInfo)!=cmCancel)
+ {
+ l=strlen(file);
+ memmove(file+1,file,l);
+ file[0]='(';
+ file[l+1]=')';
+ file[l+2]=0;
+ switchToTopic(file);
+ }
+}
+
+
+void TInfViewer::ConfigDialog(void)
+{
+ uint32 ops=modeFlags;
+ if (execDialog(createConfigDialog(),&ops)!=cmCancel)
+ topic->modeFlags=modeFlags=ops;
+}
+
+void TInfViewer::ChooseNode(void)
+{
+ int cant=hFile->index->size;
+
+ if (cant)
+ {
+ TListBoxRec br;
+
+ br.items=hFile->index->coll;
+ br.selection=0;
+
+ if ( execDialog( createNodeChooseDialog(), &br )!=cmCancel )
+ switchToTopic(((TInfIndexCollection *)br.items)->atStr(br.selection));
+ }
+}
+
+void TInfViewer::BookMarksDialog(void)
+{
+ char aux[256],*s;
+ TListBoxRec br;
+ br.items=BookMark;
+ br.selection=0;
+ int Comando;
+
+ // For some unknown reason we can reach this point without a valid BookMark
+ // so we must avoid a crash
+ if (!BookMark)
+ BookMark=new TNoCaseStringCollection(10,10);
+ do
+ {
+ Comando = execDialog( new TBookMarkDialog(BookMark), &br );
+ enableCommand(cmbmGoTo);
+ enableCommand(cmbmDeleteFromBookMark);
+
+ switch (Comando)
+ {
+ case cmbmAddToBookMark:
+ aux[0]='(';
+ aux[1]=0;
+ strcat(aux,hFile->NameOfFile);
+ strcat(aux,")");
+ strcat(aux,topic->Node);
+ s=strdup(aux);
+ BookMark->insert(s);
+ break;
+
+ case cmbmDeleteFromBookMark:
+ BookMark->atRemove(br.selection);
+ break;
+
+ case cmbmGoTo:
+ switchToTopic((char *)BookMark->at(br.selection));
+ break;
+ }
+ }
+ while(Comando==cmbmDeleteFromBookMark);
+}
+
+int StrNCmp(const char *s1, const char *s2, size_t n)
+{
+ if (n == 0) return 0;
+ do
+ {
+ if (TVCodePage::toUpper(*s1) != *s2++) return 1;
+ if (*s1++ == 0)
+ break;
+ }
+ while (--n != 0);
+ return 0;
+}
+
+
+char *ScanStr(char *s, char *find, int &Linea, int &Col)
+{
+ char c, sc;
+ size_t len;
+ char Buf[256];
+
+ strcpy(Buf,find);
+ strupr(Buf);
+ find=Buf;
+
+ if ((c = *find++) != 0)
+ {
+ len = strlen(find);
+ do
+ {
+ do
+ {
+ if ((sc = *s++) == 0) return 0;
+ if (sc=='\n')
+ {
+ Col=0;
+ Linea++;
+ }
+ else
+ Col++;
+ }
+ while (TVCodePage::toUpper(sc) != c);
+ }
+ while (StrNCmp(s, find, len) != 0);
+ s--;
+ }
+ Col--;
+ return s;
+}
+
+char *ScanStrCase(char *s, char *find, int &Linea, int &Col)
+{
+ char c, sc;
+ size_t len;
+
+ if ((c = *find++) != 0)
+ {
+ len = strlen(find);
+ do
+ {
+ do
+ {
+ if ((sc = *s++) == 0) return 0;
+ if (sc=='\n')
+ {
+ Col=0;
+ Linea++;
+ }
+ else
+ Col++;
+ }
+ while (sc != c);
+ }
+ while (strncmp(s, find, len) != 0);
+ s--;
+ }
+ Col--;
+ return s;
+}
+
+
+
+TDialog *createFindDialog();
+TDialog *createInfFindDialog();
+
+int TInfViewer::searchInCurrentTopic(int Linea,int Col,int largo)
+{
+ TPoint Punto;
+
+ do
+ {
+ lastSearch=findType & fitCaseSens ?
+ ScanStrCase(lastSearch,findStr,Linea,Col) :
+ ScanStr(lastSearch,findStr,Linea,Col);
+ if (lastSearch!=0) // hit and
+ {
+ if ( !(findType & fitWWord) || // (!Whole word or
+ // is a whole word)
+ (!TVCodePage::isAlpha(*(lastSearch-1)) && !TVCodePage::isAlpha(*(lastSearch+largo))) )
+ {
+ LineEndSelect=LineStartSelect=Linea+1;
+ ColStartSelect=Col;
+ ColEndSelect=Col+largo;
+ Punto.x=Col;
+ Punto.y=Linea+1;
+ TextSelected=True;
+ lastSearch+=largo;
+ makeVisible(Punto,largo);
+ return 1;
+ }
+ lastSearch+=largo;
+ Col+=largo;
+ }
+ }
+ while (lastSearch);
+
+ return 0;
+}
+
+
+int TInfViewer::searchInCurrentFile(int Linea,int Col,int largo)
+{
+ char Buf[256];
+ char findUp[256];
+ FILE *f;
+
+ // first in the current topic
+ if (TopicInSearch!=fitNotInTopic && searchInCurrentTopic(Linea,Col,largo))
+ return 1;
+ // now across topics
+ long PosTopic;
+ strcpy(findUp,findStr);
+ strupr(findUp);
+ char *s;
+ int LastTopic=TopicInSearch;
+ Progress_Init(__("Please wait"),__("Searching ..."));
+ char *newName=0; int diff;
+ while ((PosTopic=hFile->index->position(++TopicInSearch,newName,diff))!=-1)
+ {
+ Progress_UpDate();
+ // Skip anchor references (not really nodes)
+ if (newName) { newName=0; continue; }
+ hFile->fSeek(PosTopic);
+ topic->ReadNodeInfo(*hFile);
+ if (topic->Status)
+ {
+ switchToTopic("Top");
+ break;
+ }
+ f=hFile->stream;
+ do
+ {
+ if (fgets(Buf,256,f)==NULL) break;
+ strupr(Buf);
+ s=strstr(Buf,findUp);
+ }
+ while (s==NULL && Buf[0]!=31);
+
+ if (Buf[0]!=31 && !feof(f))
+ {
+ switchToTopic(hFile->index->coll->atStr(TopicInSearch));
+
+ lastSearch=topic->Text;
+ if (searchInCurrentTopic(0,0,largo))
+ {
+ Progress_DeInit();
+ return 1;
+ }
+ }
+ };
+ if (LastTopic!=fitNotInTopic)
+ switchToTopic(hFile->index->coll->atStr(LastTopic));
+ Progress_DeInit();
+ return 0;
+}
+
+void TInfViewer::makeSearch(int beVerbose)
+{
+ int Linea,Col;
+ int largo,Eureka=0;
+
+ if (!SearchArmed) return;
+
+ largo=strlen(findStr);
+ if (largo==0) return;
+
+ // Si finaliz una bsqueda antes y ahora presion Ctrl+L que vuelva al ppio.
+ if (lastSearch==NULL)
+ lastSearch=topic->Text;
+
+ if (lastSearch!=topic->Text)
+ {
+ Linea=LineEndSelect-1;
+ Col=ColEndSelect;
+ }
+ else
+ {
+ Linea=0;
+ Col=0;
+ }
+
+ OpenVerbose=0;
+ switch (findWhere)
+ {
+ case fitInTopic:
+ // Search in the current topic, is only in a large buffer
+ Eureka=searchInCurrentTopic(Linea,Col,largo);
+ break;
+
+ case fitInFile:
+ // It's complex; and calls searchInCurrentTopic
+ Eureka=searchInCurrentFile(Linea,Col,largo);
+ break;
+
+ case fitInDir:
+ // It's Waco, and infected (i kill thousands of bugs here).
+ if (FileInSearch==fitNotInTopic)
+ { // It's the first time
+ // Keep track were start
+ AddFileToNode(OriginalPlace.Name,topic->Node,hFile->NameOfFile);
+ OriginalPlace.HisPos = cursor + delta;
+ OriginalPlace.HisSel=selected;
+ }
+ else
+ { // Not the first time, continue in this file
+ if (searchInCurrentFile(Linea,Col,largo))
+ {
+ OpenVerbose=1;
+ return;
+ }
+ }
+ // now across files
+ // Go to Top of Top
+ switchToTopic("(dir)Top");
+ while ((++FileInSearch)<topic->numRefs)
+ {
+ switchToTopic(topic->crossRefs[FileInSearch].Name);
+ if (!hFile->Status)
+ {
+ TopicInSearch=fitNotInTopic;
+ if (searchInCurrentFile(Linea,Col,largo))
+ {
+ OpenVerbose=1;
+ return;
+ }
+ }
+ switchToTopic("(dir)Top");
+ }
+ switchToTopic(&OriginalPlace);
+ break;
+ }
+ if (!Eureka && beVerbose)
+ {
+ messageBox(__("Sorry can't find the string"),mfError | mfOKButton);
+ SearchArmed=0;
+ }
+ OpenVerbose=1;
+}
+
+
+void TInfViewer::find()
+{
+ TFindInfDialogRec findRec( findStr, findType, findWhere );
+ lastSearch=topic->Text;
+ FileInSearch=TopicInSearch=fitNotInTopic;
+ if ( execDialog( createInfFindDialog(), &findRec ) != cmCancel )
+ {
+ strcpy( findStr, findRec.find );
+ findType = findRec.options;
+ findWhere = findRec.ops2;
+ SearchArmed=1;
+ makeSearch();
+ }
+}
+
+void TInfViewer::findInTopic(char *s)
+{
+ strncpyZ(findStr,s,MAX_NODE_NAME);
+ findType=findWhere=0;
+ SearchArmed=1;
+ makeSearch(0);
+}
+
+/****** Stream functions for TInfViewer ******/
+
+void TInfViewer::write( opstream& os )
+{
+ TScroller::write( os );
+ os.writeString(hFile->NameOfFile);
+ os.writeString(topic->Node);
+ os << modeFlags;
+ // Find variables
+ os << findType << findWhere;
+ os.writeString(findStr);
+ // History
+ os << HistPoint << History;
+ // Selection, I'm just crazy, no?
+ os << selRowStart << selRowEnd << selColStart << -0x022 << selColEnd;
+}
+
+void *TInfViewer::read( ipstream& is )
+{
+ // Base class
+ TScroller::read( is );
+
+ // Read stuff for this class
+ char File[MAX_NODE_NAME];
+ char Node[MAX_NODE_NAME];
+
+ is.readString(File,MAX_NODE_NAME);
+ // As I changed the name for the editor's help here I provide a mechanism to
+ // convert the name at load time. It will save old users to get messages about
+ // 'editor' not found
+ if (TranslateName==1 && strncasecmp(File,"editor",6)==0)
+ strcpy(File,"setedit");
+
+ is.readString(Node,MAX_NODE_NAME);
+ is >> modeFlags;
+ // Find variables
+ is >> findType >> findWhere;
+ is.readString(findStr,MAX_NODE_NAME);
+ // History
+ is >> HistPoint >> History;
+ // Selection, I'm just crazy, no?
+ is >> selRowStart >> selRowEnd >> selColStart >> selColEnd;
+
+ if (selColEnd<0)
+ { // Sorry for this crap, I forgot to save the version
+ TNoCaseStringCollection *p;
+ version=-selColEnd;
+ is >> selColEnd;
+ if (version<0x022)
+ {
+ is >> p;
+ if (!BookMark)
+ BookMark=p;
+ else
+ destroy0(p);
+ }
+ }
+ else
+ {
+ version=0;
+ if (!BookMark)
+ BookMark=new TNoCaseStringCollection(10,10);
+ }
+
+ // Initialize all
+ lockCount=0;
+ mustBeRedrawed=False;
+ options |= ofSelectable;
+ growMode = gfGrowHiX | gfGrowHiY;
+ QuickLen=0;
+ TextSelected = False;
+ SearchArmed=0;
+ lastSearch=0;
+ OpenVerbose=1;
+ selecting=False;
+
+ hFile=new TInfFile(File);
+ int suggY;
+ topic=hFile->getTopic(Node,1,modeFlags,suggY);
+ topic->setWidth(size.x);
+ setLimit(topic->maxWidth() + size.x, topic->numLines() + size.y);
+
+ state |= sfCursorVis;
+ return this;
+}
+
+TNoCaseStringCollection *TInfViewer::BookMark=NULL;
+int TInfViewer::version=0x022;
+TCommandSet *TInfViewer::ts=0;
+int TInfViewer::TranslateName=0;
+
+TStreamable *TInfViewer::build()
+{
+ InitCommandSet();
+ return new TInfViewer( streamableInit );
+}
+
+TInfViewer::TInfViewer( StreamableInit ) : TScroller( streamableInit )
+{
+}
+
+void (*TInfViewer::InsertRoutine)(char *b, long l)=NULL;
+
+
+static TRect defaultSizeWindow;
+static
+TRect &getDefaultSizeWindow()
+{
+ defaultSizeWindow.a.x=0;
+ defaultSizeWindow.a.y=0;
+ defaultSizeWindow.b.x=GetDeskTopCols()-4;
+ defaultSizeWindow.b.y=GetDeskTopRows()-4;
+ return defaultSizeWindow;
+}
+
+/***************************************************************
+
+ class TInfWindow
+
+ Just like THelpWindow.
+
+***************************************************************/
+
+TInfWindow::TInfWindow(TInfFile *hFile, char *context, char *match,
+ void (*ir)(char *b, long l), Boolean IsTheOne) :
+ TWindowInit( &TInfWindow::initFrame),
+ TWindow( getDefaultSizeWindow(), "InfView", wnNoNumber )
+{
+ TRect r=getDefaultSizeWindow();
+ options = (options | ofCentered);
+ r.grow(-1,-1);
+
+ viewer=new TInfViewer (r,standardScrollBar(sbHorizontal | sbHandleKeyboard),
+ standardScrollBar(sbVertical | sbHandleKeyboard), hFile, context,
+ match);
+ viewer->InsertRoutine=ir;
+ insert(viewer);
+ helpCtx = hcInfView;
+ isTheOne=IsTheOne;
+}
+
+TInfWindow::~TInfWindow()
+{
+ // Only the main InfView can do it or the rest will lose the BookMark
+ if (isTheOne)
+ {
+ destroy0(TInfViewer::BookMark); // Avoid releasing it twice
+ if (TInfViewer::ts)
+ {
+ delete TInfViewer::ts;
+ TInfViewer::ts=0;
+ }
+ }
+}
+
+TPalette& TInfWindow::getPalette() const
+{
+ static TPalette palette(cInfWindow, sizeof( cInfWindow)-1);
+ return palette;
+}
+
+void TInfWindow::close()
+{
+ TInfViewer::DisableAllCommands();
+ if (isTheOne)
+ hide();
+ else
+ TWindow::close();
+}
+
+/****** Stream functions for TInfWindow ******/
+
+void TInfWindow::write( opstream& os )
+{
+ TWindow::write( os );
+ os << viewer << (int)isTheOne;
+ if (isTheOne)
+ os << viewer->BookMark;
+}
+
+void *TInfWindow::read( ipstream& is )
+{
+ int aux;
+
+ TWindow::read( is );
+
+ is >> viewer >> aux;
+ isTheOne=aux ? True : False;
+ if (isTheOne && viewer->version>=0x022)
+ {
+ destroy0(viewer->BookMark);
+ is >> viewer->BookMark;
+ }
+ options&=~(ofCenterX | ofCenterY);
+
+ return this;
+}
+
+TStreamable *TInfWindow::build()
+{
+ return new TInfWindow( streamableInit );
+}
+
+TInfWindow::TInfWindow( StreamableInit ) :
+ TWindowInit( NULL ),
+ TWindow( streamableInit )
+{
+}
+
+/***************************************************************
+
+ class TStrListBox
+
+ Una ListBox que responde a Enter y Doble click.
+ A List Box with Enter+Double click response.
+
+ La respuesta es un mensaje cmStrChoose y en infoPtr el ndice
+seleccionado.
+
+***************************************************************/
+
+void TStrListBox::handleEvent(TEvent& event)
+{
+ short a=focused;
+ if ((event.what==evKeyDown && event.keyDown.keyCode==kbEnter) ||
+ (event.what==evMouseDown && event.mouse.doubleClick))
+ {
+ message( owner, evBroadcast, cmStrChoose, (void *)&focused );
+ clearEvent(event);
+ return;
+ }
+ TListBox::handleEvent(event);
+ if (focused!=a)
+ draw();
+}
+
+/***************************************************************
+
+ class THistCollection members
+
+***************************************************************/
+
+void *THisCollection::readItem( ipstream& is )
+{
+ stHisto *h=new stHisto;
+ is.readBytes( h, sizeof(stHisto) );
+ return (void *)h;
+}
+
+void THisCollection::writeItem( void *obj, opstream& os )
+{
+ os.writeBytes( (const char *)obj, sizeof(stHisto) );
+}
+
+/***************************************************************
+
+ class THelpControlDialog
+
+ Una caja de dilogo para controlar el help.
+ A Dialog to control the help.
+
+***************************************************************/
+
+void THelpControlDialog::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if( event.what == evCommand || event.what == evBroadcast)
+ {
+ //ushort comm=event.message.command;
+ switch( event.message.command )
+ {
+ // a button
+ case cmhNext:
+ case cmhPrev:
+ case cmhUp:
+ case cmhPrevH:
+ case cmhHide:
+ case cmhNodeList:
+ case cmhBookMarks:
+ case cmhConfigDia:
+ case cmhOpenInfo:
+ {
+ endModal(event.message.command);
+ clearEvent(event);
+ }
+ break;
+
+ // from the list
+ case cmStrChoose:
+ {
+ endModal(cmhHistSel+*((ushort *)event.message.infoPtr));
+ clearEvent(event);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+THelpControlDialog::THelpControlDialog(THisCollection *oCol) :
+ TWindowInit( &THelpControlDialog::initFrame ),
+ TDialog( TRect( 1, 1, 56, 20 ), __("Help Control") )
+{
+ TRect r(1,2,18,4);
+ insert( new TButton(r,__("~N~ext"),cmhNext,bfDefault) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("~P~revious"),cmhPrev,bfNormal) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("~U~p"),cmhUp,bfNormal) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("Prev. ~H~ist."),cmhPrevH,bfNormal) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("Nodes ~L~ist"),cmhNodeList,bfNormal) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("~B~ookmarks"),cmhBookMarks,bfNormal) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("~C~onfiguration"),cmhConfigDia,bfNormal) );
+ r.a.y+=2;
+ r.b.y+=2;
+ insert( new TButton(r,__("~O~pen Info"),cmhOpenInfo,bfNormal) );
+ r.a.x+=19;
+ r.b.x+=19;
+ insert( new TButton(r,__("H~i~de"),cmhHide,bfNormal) );
+
+ TScrollBar *sb = new TScrollBar( TRect(52,3,53,15) );
+ insert(sb);
+ TStrListBox *ListaH = new TStrListBox( TRect(21,3,52,15),(ushort)1, sb );
+ insert(ListaH);
+ ListaH->newList(oCol);
+ insert (new TLabel(TRect(21,2,52,3),__("Hi~s~tory"), ListaH));
+
+ options|=ofTopSelect;
+ selectNext( False );
+ helpCtx=hcInfControl;
+}
+
+
+TDialog *createInfFindDialog()
+{
+ TDialog *d = new TDialog( TRect( 0, 0, 38, 15 ), __("Inf Find") );
+
+ d->options |= ofCentered;
+
+ TInputLine *control = new TInputLine( TRect( 3, 3, 32, 4 ), MAX_NODE_NAME );
+ d->insert( control );
+ d->insert(
+ new TLabel( TRect( 2, 2, 30, 3 ), __("~T~ext to find"), control ) );
+ d->insert(
+ new THistory( TRect( 32, 3, 35, 4 ), control, hID_TextSearchInf ) );
+
+ d->insert( new TCheckBoxes32( TRect( 3, 5, 35, 7 ),
+ new TSItem( __("~C~ase sensitive"),
+ new TSItem( __("~W~hole words only"), 0 ))));
+
+ d->insert( new TRadioButtons32( TRect( 3, 8, 35, 11 ),
+ new TSItem( __("In current ~t~opic"),
+ new TSItem( __("In the ~f~ile"),
+ new TSItem( __("In ~a~ll files"), 0 )))));
+
+ d->insert(
+ new TButton( TRect( 14, 12, 24, 14 ), __("~O~K"), cmOK, bfDefault ) );
+ d->insert(
+ new TButton( TRect( 26, 12, 36, 14 ), __("Cancel"), cmCancel, bfNormal ) );
+
+ d->selectNext( False );
+ d->helpCtx=hcInfSearch;
+ return d;
+}
+
+TDialog *createGoToDialog()
+{
+ TDialog *d = new TDialog( TRect( 0, 0, 38, 9 ), __("Go To") );
+
+ d->options |= ofCentered;
+
+ TInputLine *control = new TInputLine( TRect( 3, 3, 32, 4 ), MAX_NODE_NAME );
+ d->insert( control );
+ d->insert(
+ new TLabel( TRect( 2, 2, 30, 3 ), __("~N~ame of Node"), control ) );
+ d->insert(
+ new THistory( TRect( 32, 3, 35, 4 ), control, hID_GotoInf ) );
+
+ d->insert(
+ new TButton( TRect( 14, 6, 24, 8 ), __("~O~K"), cmOK, bfDefault ) );
+ d->insert(
+ new TButton( TRect( 26, 6, 36, 8 ), __("Cancel"), cmCancel, bfNormal ) );
+
+ d->selectNext( False );
+ d->helpCtx=hcInfGoto;
+ return d;
+}
+
+
+TDialog *createNodeChooseDialog()
+{
+ TRect r( 0, 0, 60, 20 );
+ // Make it growable
+ TGrowDialog *d = new TGrowDialog( r, __("Tag Table"), ofCentered );
+
+ TScrollBar *sb = new TScrollBar( TRect(r.b.x-3,2,r.b.x-2,r.b.y-4) );
+ d->insert(sb);
+ TSOSSortedListBox *ListaN = new TSOSSortedListBox( TRect(2,2,r.b.x-3,r.b.y-4),(ushort)1, sb );
+ ListaN->growMode = gfMoveBottomCorner;
+ d->insert(ListaN);
+ d->insert(new TLabel(TRect(2,1,r.b.x-3,2),__("~N~odes"), ListaN));
+
+ TButton *tb1=new TButton( TRect( 2, r.b.y-3, 16, r.b.y-1 ), __("~O~K"), cmOK, bfDefault );
+ tb1->growMode = gfMoveAccording;
+ d->insert(tb1);
+
+ TButton *tb2=new TButton( TRect( 20, r.b.y-3, 34, r.b.y-1 ), __("Cancel"), cmCancel, bfNormal );
+ tb2->growMode = gfMoveAccording;
+ d->insert(tb2);
+
+ d->selectNext( False );
+ d->helpCtx=hcInfChoose;
+
+ return d;
+}
+
+TDialog *createConfigDialog()
+{
+ TRect r( 0, 0, 36, 8);
+
+ TDialog *d = new TDialog( r, __("InfView Configuration") );
+
+ d->options |= ofCentered;
+
+ d->insert( new TCheckBoxes32( TRect( 3, 2, 33, 4 ),
+ new TSItem( __("Hide '*~N~ote' word"),
+ new TSItem( __("Hide real ~l~ink name"), 0 ))));
+ d->insert(
+ new TButton( TRect( 2, 5, 14, 7 ), __("~O~K"), cmOK, bfDefault ) );
+ d->insert(
+ new TButton( TRect( 16, 5, 28, 7 ), __("Cancel"), cmCancel, bfNormal ) );
+
+ d->selectNext( False );
+ d->helpCtx=hcInfConfig;
+
+ return d;
+}
+
+/***************************************************************
+
+ class TBookMarkDialog
+
+ Una caja de dilogo para controlar los book marks.
+ A Dialog to control the book marks.
+
+***************************************************************/
+
+void TBookMarkDialog::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if ( event.what == evCommand || event.what == evBroadcast)
+ {
+ switch ( event.message.command )
+ {
+ // a button
+ case cmbmAddToBookMark:
+ case cmbmDeleteFromBookMark:
+ case cmbmGoTo:
+ endModal(event.message.command);
+ clearEvent(event);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+TBookMarkDialog::TBookMarkDialog(TNoCaseStringCollection *oCol) :
+ TWindowInit( &TBookMarkDialog::initFrame ),
+ TDialog( TRect( 0, 0, 60, 15 ), __("InfView Bookmarks") )
+{
+ int Cant=oCol->getCount();
+
+ TRect r(0,0,60,15);
+ options|=ofCentered | ofTopSelect;
+
+ TRect bt(1,2,13,4);
+ TButton *tb=new TButton( bt, __("~A~dd"),cmbmAddToBookMark,bfNormal);
+ insert(tb);
+
+ bt.move(0,2);
+ tb=new TButton( bt, __("~D~elete"),cmbmDeleteFromBookMark,bfNormal);
+ insert(tb);
+
+ bt.move(0,2);
+ insert( new TButton( bt, __("Cancel"),cmCancel,bfNormal) );
+
+ bt.move(0,2);
+ tb=new TButton( bt, __("~G~o to"),cmbmGoTo,bfDefault);
+ insert(tb);
+ if (!Cant)
+ {
+ disableCommand(cmbmDeleteFromBookMark);
+ disableCommand(cmbmGoTo);
+ }
+
+ TScrollBar *sb = new TScrollBar( TRect(r.b.x-3,2,r.b.x-2,r.b.y-2) );
+ insert(sb);
+ TSortedListBox *Lista=new TSortedListBox( TRect(bt.b.x+1,2,r.b.x-3,r.b.y-2),(ushort)1, sb );
+ insert(Lista);
+ insert(new TLabel(TRect(bt.b.x+1,1,r.b.x-3,2),__("~M~arks"), Lista));
+ //Lista->newList(oCol);
+
+ selectNext( False );
+ helpCtx=hcInfBookMark;
+}
+
+
+
diff --git a/setedit/infview/infbase.cc b/setedit/infview/infbase.cc
new file mode 100644
index 0000000..6cd6cb5
--- /dev/null
+++ b/setedit/infview/infbase.cc
@@ -0,0 +1,1996 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/***************************************************************
+
+ Filename - infbase.cc
+
+ Functions
+ Member functions of following classes
+ TInfTopic
+ TInfIndex
+ TInfFile
+
+***************************************************************/
+
+// That's the first include because is used to configure the editor.
+#include <ceditint.h>
+
+#define CUT_NOTES
+
+#include <stdio.h>
+#define Uses_stdlib
+#define Uses_string
+#define Uses_unistd
+#define Uses_TStreamableClass
+#define Uses_TPoint
+#define Uses_TStreamable
+#define Uses_TRect
+#define Uses_MsgBox
+#define Uses_TStringCollection
+#define Uses_TSortedListBox
+#define Uses_sys_stat
+#define Uses_alloca
+#define Uses_ctype
+#define Uses_limits
+#define Uses_filelength
+#define Uses_TVCodePage
+// InfView requests
+#include <infbaser.h>
+#include <settvuti.h>
+
+#include <fcntl.h> // open
+#include <gzfiles.h>
+#include <dyncat.h>
+
+#ifdef TVCompf_djgpp
+#include <crt0.h>
+#endif
+#ifndef TVOS_UNIX
+# include <io.h>
+#endif
+
+#include <tprogdia.h>
+#include <infbase.h>
+#include <rhutils.h> // unique_name
+
+//#define DEBUG
+#ifdef DEBUG
+# ifndef FOR_EDITOR
+# include "nointl.h"
+# endif
+# ifndef Linux
+# include <conio.h>
+# define Clava(a) { printf(a); getch(); exit(1); }
+# else
+# define Clava(a) { fprintf(stderr,a); exit(1); }
+# endif
+#else
+#define Clava(a) exit(1)
+#endif
+
+#define CheckClassError(a) {if(a) { Status=True; return; }}
+
+const int TabSize=8;
+
+/*
+void *operator new(size_t size)
+{
+ void * p;
+
+ size = size ? size : 1;
+ p = malloc(size);
+ if (p==NULL)
+ {
+ printf(_("Error memory exhausted!!!\n"));
+ getch();
+ exit(1);
+ }
+ memset(p,1,size);
+
+ return p;
+}
+
+void operator delete(void *p)
+{
+ if (p==NULL)
+ {
+ printf(_("Error: pointer is NULL!!!\n"));
+ getch();
+ long pp=((long *)p)[0];
+ printf("%lX\n",pp);
+ }
+ else
+ free(p);
+}
+*/
+// TInfTopic
+
+void *TInfTopic::Read(TInfFile &File, int offset, int &y)
+{
+ int hadOffset=offset;
+ offset-=ReadNodeInfo(File);
+ if (!Status)
+ {
+ ReadText(File,hadOffset ? offset : 0,y);
+ ReadCrossRefs();
+ }
+ width = 0;
+ lastLine = INT_MAX;
+ return this;
+}
+
+
+static void CopiarDatosDe(char *Tipo,char *Dest,char *Ori,int maxlen)
+{
+ char *pos,*s;
+ int largo;
+
+ if ((pos=strstr(Ori,Tipo))!=NULL)
+ {
+ pos+=strlen(Tipo)+2;
+ if (pos-Ori>=maxlen)
+ {
+ *Dest=0;
+ return;
+ }
+ for (s=pos,largo=0; *s && *s!='\n' && *s!='\r' && *s!=',' && *s!='\t'; s++,largo++);
+ *s=0;
+ if (largo>MAX_NODE_NAME)
+ Dest[0]=0;
+ else
+ strcpy(Dest,pos);
+ *s=',';
+ }
+ else
+ Dest[0]=0;
+}
+
+static inline
+int isWord(int a)
+{
+ return TVCodePage::isAlNum(a) || a=='_';
+}
+
+#ifdef InfV_UseBinaryFile
+void TInfFile::GetLine(void)
+{
+ if (fgets(Buffer,SizeOfReadBuf,stream))
+ {
+ int l = strlen(Buffer);
+ if (l > 1 && Buffer[l-2] == '\r' && Buffer[l-1] == '\n')
+ {
+ Buffer[l-2] = '\n';
+ Buffer[l-1] = 0;
+ }
+ }
+}
+#endif
+
+/* Added by Robert to seek for a Node with brute-force */
+int TInfFile::seekToNode(const char *Name, int fromStart)
+{
+ long Pos;
+ int found = 0;
+ int lName = strlen(Name);
+
+ if (fromStart)
+ fseek(stream,0,SEEK_SET);
+
+ do
+ {
+ Pos = ftell(stream);
+ GetLine();
+ if (feof(stream))
+ return 0;
+ if (strncmp(Buffer,"File",4)==0)
+ {
+ char *node=strstr(Buffer,"Node:");
+ if (node)
+ {
+ if (strncmp(node+6,Name,lName)==0 && !isWord(node[6+lName])) // ispunct ?
+ found=1;
+ }
+ }
+ }
+ while (!found);
+ fseek(stream,Pos,SEEK_SET);
+ return 1;
+}
+
+int TInfTopic::ReadNodeInfo(TInfFile &File)
+{
+ char *Buf;
+ FILE *f=File.stream;
+ long Pos=ftell(f);
+ int isFile, isDOS=0, ret=0;
+
+ Buf=File.Buffer;
+ do
+ { File.GetLine(); }
+ while(!feof(f) && (Buf[0]==31 || ucisspace(Buf[0])));
+
+ // Make it a little robust
+ isFile= strncmp(Buf,"File",4)==0;
+ if (!isFile)
+ {
+ isDOS= Buf[strlen(Buf)-2]=='\r';
+ if (!isDOS)
+ {
+ // Try around the position
+ Pos-=100;
+ if (Pos<0) Pos=0;
+ fseek(f,Pos,SEEK_SET);
+ do
+ { File.GetLine(); }
+ while(Buf[0]!=31 && !feof(f));
+ if (Buf[0]==31)
+ {
+ do
+ { File.GetLine(); }
+ while(Buf[0]==31 || ucisspace(Buf[0]));
+ }
+ isFile= strncmp(Buf,"File",4)==0;
+ }
+ }
+
+ if (isFile)
+ {
+ ret=strlen(Buf);
+ CopiarDatosDe("Node",Node,Buf,File.SizeOfReadBuf);
+ CopiarDatosDe("Next",Next,Buf,File.SizeOfReadBuf);
+ CopiarDatosDe("Prev",Prev,Buf,File.SizeOfReadBuf);
+ CopiarDatosDe("Up",Up,Buf,File.SizeOfReadBuf);
+ }
+ else
+ {
+ if (isDOS)
+ {
+ if (File.IsCompressed)
+ {
+ //messageBox(__("Attention !! this file is in DOS format,"
+ // "and is compressed, uncompress the file,"
+ // " reopen it with the Help and then recompress it."),
+ // mfError | mfOKButton);
+ if (!File.ConvertIt(Pos))
+ {
+ Status=True;
+ return ret;
+ }
+ ReadNodeInfo(File);
+ return ret;
+ }
+ else
+ {
+ if (messageBox(__("Attention !! This file is in DOS format,"
+ " Do you want to convert it?,"
+ " But maybe make a backup first !!"), mfError | mfYesButton | mfNoButton)
+ ==cmYes)
+ {
+ if (!File.ConvertIt(Pos))
+ {
+ Status=True;
+ return ret;
+ }
+ ReadNodeInfo(File);
+ return ret;
+ }
+ }
+ Status=True;
+ return ret;
+ }
+ messageBox(__("Error: can't find the Node info"),mfError | mfOKButton);
+ Status=True;
+ return ret;
+ }
+
+ return ret;
+}
+
+TInfTopic::TInfTopic( int mode )
+{
+ numRefs = 0;
+ crossRefs = 0;
+ width = 0;
+ lastOffset = 0;
+ lastLine = INT_MAX;
+ Text = NULL;
+ Node[0]=Next[0]=Prev[0]=Up[0]=0;
+ Status=False; // OK
+ modeFlags=mode;
+};
+
+void TInfTopic::ReadText(TInfFile &File, int offset, int &y)
+{
+ char *s,*d;
+ int i,x,t,yFound=0;
+ int lWidth;
+ FILE *f=File.stream;
+ char *Buf=File.Buffer;
+
+ // Primera pasada: mide
+ long Pos=ftell(f);
+ lSize=0;
+ iLines=0;
+ File.GetLine();
+ maxLineWidth=0;
+ y=0;
+ do
+ {
+ for (lWidth=0, s=Buf; *s; s++)
+ {
+ if (*s=='\t')
+ lWidth+=TabSize;
+ else
+ lWidth++;
+ }
+ int len=s-Buf;
+ if (!yFound)
+ {
+ if (offset<len)
+ yFound=1;
+ else
+ {
+ offset-=len;
+ y++;
+ }
+ }
+ if (lWidth>maxLineWidth)
+ maxLineWidth=lWidth;
+ lSize+=lWidth;
+ iLines++;
+ File.GetLine();
+ }
+ while (Buf[0]!=31 && !feof(f));
+
+ // Arriba
+ fseek(f,Pos,SEEK_SET);
+ Text = new char[lSize+1];
+ for (i=iLines, d=Text; i; --i)
+ {
+ File.GetLine();
+ for (s=Buf,x=0;*s;s++)
+ if (*s=='\t')
+ {
+ t=TabSize-(x%TabSize);
+ x+=t;
+ for (int j=t;j;--j) *d++=' ';
+ }
+ else
+ {
+ x++;
+ if (*s!='\r')
+ *d++=*s;
+ }
+ }
+ *d=0;
+}
+
+
+static int IsDelimiterDeXX( int Val )
+{
+ return Val==' ' || Val=='\r' || Val=='\t' || Val=='\n' || Val=='.' ||
+ Val==0 || Val==',' || Val==';' || Val==')' || Val=='(' || Val<0;
+}
+
+
+// Esta es la versin ms conservadora, la mantengo para zafar en caso de que la
+// otra falle.
+static void TakeName(char *Buf,char *Nom,int &ini,int &largo,int &Linea, int &linebreak)
+{
+ char *s,*ori,*s_pos,*ori_pos;
+ int CruzaLin,OffEnProxLin=0,EnParentesis,warnpos=0,ini_pos;
+
+ ini+=1;
+ largo=0;
+ CruzaLin=0;
+ // Quitar espacios indeceables
+ for (ori=Buf+1; ucisspace(*ori) && *ori; ori++)
+ {
+ if (*ori=='\n')
+ {
+ // Opss se cay
+ Linea++;
+ ini=0;
+ }
+ else
+ ini++;
+ }
+ // El primer : puesto ac no cuenta
+ if (*ori==':')
+ {
+ ori++;
+ ini++;
+ }
+ s_pos=Nom;
+ ori_pos=ori;
+ ini_pos=ini;
+ for (s=Nom; *ori; s++,ori++)
+ {
+ if (*ori==':')
+ {
+ if ((!TVCodePage::isAlpha(ori[1]) && ori[1]!=':') || ( ori[1]==':' && IsDelimiterDeXX(ori[2]) ) )
+ break;
+ if (warnpos)
+ break;
+ warnpos=1;
+ *s++=*ori++;
+ largo++;
+ }
+ else
+ if (*ori=='.' || *ori==',' || *ori=='*')
+ { // Ups! the file isn't OK.
+ if (warnpos>0)
+ { // Perhaps the idiot forgot to put an space after ::
+ // un-roll all
+ largo=1;
+ CruzaLin=OffEnProxLin=0;
+ s=s_pos;
+ ori=ori_pos;
+ ini=ini_pos;
+ continue;
+ }
+ //break;
+ }
+ if (*ori=='\n')
+ {
+ *s=' ';
+ for (OffEnProxLin=0;*ori && ucisspace(*ori); ori++,OffEnProxLin++,largo++);
+ ori--;
+ CruzaLin=1;
+ //largo++;
+ }
+ else
+ {
+ if (CruzaLin)
+ OffEnProxLin++;
+ largo++;
+ *s=*ori;
+ }
+ }
+ *s=0;
+ ori++;
+ linebreak=OffEnProxLin;
+ if (*ori==':') return;
+ if (CruzaLin)
+ {
+ CruzaLin=0;
+ Linea++;
+ ini=++OffEnProxLin;
+ OffEnProxLin=0;
+ }
+ else
+ ini+=largo;
+ largo=0;
+ for (ini++;*ori && ucisspace(*ori); ori++,ini++)
+ {
+ if (*ori=='\n')
+ {
+ Linea++;
+ ini=-1;
+ }
+ }
+ EnParentesis=0;
+ for (s=Nom; *ori && *ori!=':' && (*ori!='.' || EnParentesis || !IsDelimiterDeXX(*(ori+1))) && *ori!=','; s++,ori++)
+ {
+ if (*ori=='\n')
+ {
+ *s++=' ';
+ ori++;
+ for (OffEnProxLin=0;*ori && ucisspace(*ori); ori++,OffEnProxLin++,largo++);
+ CruzaLin=1;
+ largo++;
+ }
+ else
+ {
+ if (CruzaLin)
+ OffEnProxLin++;
+ largo++;
+ if (*ori=='(')
+ EnParentesis=1;
+ else
+ if (EnParentesis && *ori==')')
+ EnParentesis=0;
+ }
+ *s=*ori;
+ }
+ *s=0;
+ linebreak=OffEnProxLin;
+}
+
+
+// Esta es un poco loca, pero el resultado es mucho mejor
+static void TakeName(char *Buf,char *Nom,char *Nom2,int &ini,int &largo,int &Linea,
+ int &linebreak,char *Origin, long &Size, char *&Fin)
+{
+ char *cutFrom;
+ char *s,*ori,*s_pos,*ori_pos;
+ int CruzaLin,OffEnProxLin=0,EnParentesis,warnpos=0,ini_pos,cutCross=0;
+
+
+ ini+=1;
+ largo=0;
+ CruzaLin=0;
+ // Quitar espacios indeseables
+ for (ori=Buf+1; ucisspace(*ori) && *ori; ori++)
+ {
+ if (*ori=='\n')
+ {
+ // Opss se cay
+ Linea++;
+ ini=0;
+ }
+ else
+ ini++;
+ }
+ // El primer : puesto ac no cuenta
+ if (*ori==':')
+ {
+ ori++;
+ ini++;
+ }
+ s_pos=Nom;
+ ori_pos=ori;
+ ini_pos=ini;
+ for (s=Nom; *ori; s++,ori++)
+ {
+ if (*ori==':')
+ {
+ if ((!TVCodePage::isAlpha(ori[1]) && ori[1]!=':') || ( ori[1]==':' && IsDelimiterDeXX(ori[2]) ) )
+ break;
+ if (warnpos)
+ break;
+ warnpos=1;
+ *s++=*ori++;
+ largo++;
+ }
+ else
+ if (*ori=='.' || *ori==',' || *ori=='*')
+ { // Ups! the file isn't OK.
+ if (warnpos>0)
+ { // Perhaps the idiot forgot to put an space after ::
+ // un-roll all
+ largo=1;
+ CruzaLin=OffEnProxLin=0;
+ s=s_pos;
+ ori=ori_pos;
+ ini=ini_pos;
+ continue;
+ }
+ //break;
+ }
+ if (*ori=='\n')
+ {
+ *s=' ';
+ for (OffEnProxLin=0;*ori && ucisspace(*ori); ori++,OffEnProxLin++,largo++);
+ ori--;
+ CruzaLin=1;
+ //largo++;
+ }
+ else
+ {
+ if (CruzaLin)
+ OffEnProxLin++;
+ largo++;
+ *s=*ori;
+ }
+ }
+ *s=0;
+ ori++;
+ linebreak=OffEnProxLin;
+ strncpy(Nom2,Nom,MAX_NODE_NAME-1);
+ if (*ori==':')
+ {
+ ori--;
+ memmove(ori,ori+2,size_t(Size-(ori-Origin)-2+1));
+ Size-=2;
+ Fin-=2;
+ return;
+ }
+ cutFrom=ori-1;
+ for (;*ori && ucisspace(*ori); ori++)
+ if (*ori=='\n')
+ cutCross++;
+ EnParentesis=0;
+ for (s=Nom; *ori && *ori!=':' && (*ori!='.' || EnParentesis || !IsDelimiterDeXX(*(ori+1))) && *ori!=','; s++,ori++)
+ {
+ if (*ori=='\n')
+ {
+ *s++=' ';
+ ori++;
+ for (;*ori && ucisspace(*ori); ori++);
+ cutCross++;
+ }
+ else
+ {
+ if (*ori=='(')
+ EnParentesis=1;
+ else
+ if (EnParentesis && *ori==')')
+ EnParentesis=0;
+ }
+ *s=*ori;
+ }
+ *s=0;
+ linebreak=OffEnProxLin;
+ ori++;
+ // Sanity check coz that's too complex.
+ // Solo le corto el nombre si estoy seguro de que no voy a reventar todo
+ if (!((ori-Origin)<1 || ori<=cutFrom || Size<=(ori-Origin)))
+ {
+ if (cutCross)
+ {
+ *cutFrom='\n';
+ cutFrom++;
+ }
+ memcpy(cutFrom,ori,size_t(Size-(ori-Origin)+1));
+ Size-=ori-cutFrom;
+ Fin-=ori-cutFrom;
+ }
+}
+
+/* First approach, hmmmm ... I think that this won't work with
+ 2 notes in the same line, one crossing the end
+void CutNoteStr(char *s)
+{
+ char *end;
+ for (end=s; *end!='\n'; end++);
+ int cant;
+ if (s[5]==' ')
+ cant=6;
+ else
+ cant=5;
+ memcpy(s,s+cant,end-s-cant);
+ s=end-cant;
+ int i;
+ for (i=cant; i; i--,s++)
+ *s=' ';
+}
+*/
+
+void CutNoteStr(char *s, char *ori, long &size, char *&fin)
+{
+ int cant;
+
+ if (s[5]==' ')
+ cant=6;
+ else
+ cant=5;
+ //char eos=*fin;
+ CLY_memcpy(s,s+cant,size_t(size-(s-ori)-cant+1));
+ size-=cant;
+ fin-=cant;
+ //if (!eos) *fin=0;
+}
+
+void TInfTopic::ReadCrossRefs( void )
+{
+ CrossRef *crossRefPtr;
+ char Buf[BUF_SIZE],BufLine[BUF_SIZE];
+ int Linea,LineaMenu=0,iMenues;
+ int OffInLine,Length,OffInThisLine,LineOfNote;
+ // Para los notes
+ char *cpPos,*cpFin,*cpMenu;
+ int iNotes,iNAdd=0,iRAdd,iMAdd;
+
+ // Barrer el texto buscando todos los *?ote y * Menu
+ iNotes=0;
+ cpMenu=cpFin=Text+(int)lSize;
+ cpPos=Text;
+ Linea=1;
+ while (cpPos<cpFin)
+ {
+ if (*cpPos=='*' && cpPos[2]=='o' && cpPos[3]=='t'
+ && cpPos[4]=='e' && ucisspace(cpPos[5]) )
+ {
+ iNotes++;
+ cpPos+=4;
+ }
+ else
+ if (!LineaMenu && *cpPos=='*' && cpPos[1]==' ' && cpPos[2]=='M'
+ && cpPos[3]=='e' && cpPos[4]=='n' && cpPos[5]=='u')
+ {
+ cpMenu=cpPos;
+ cpPos+=4;
+ LineaMenu=Linea;
+ }
+ else
+ if (*cpPos=='\n')
+ Linea++;
+ cpPos++;
+ }
+
+ // Medir el men
+ Linea=LineaMenu+1;
+ iMenues=0;
+ do
+ {
+ getLine(Linea++,BufLine);
+ if (*BufLine=='*' && BufLine[1]==' ')
+ iMenues++;
+ }
+ while(Linea<=iLines /*&& (*BufLine=='*' || ucisspace(*BufLine) || *BufLine==0)*/);
+
+ numRefs=iMenues+iNotes;
+
+ if (numRefs)
+ {
+ crossRefs = new CrossRef[numRefs];
+ // Agregar todas las Note antes del men
+ cpPos=Text;
+ Linea=1;
+ iRAdd=0;
+ OffInThisLine=0;
+ if (iNotes)
+ {
+ for (iNAdd=0; iNAdd<iNotes && cpPos<cpMenu; )
+ {
+ if (*cpPos=='*' && cpPos[2]=='o' && cpPos[3]=='t'
+ && cpPos[4]=='e' && ucisspace(cpPos[5]))
+ {
+ if (modeFlags & moinCutNodeWord)
+ {
+ CutNoteStr(cpPos,Text,lSize,cpMenu);
+ cpPos--;
+ OffInThisLine--;
+ }
+ else
+ {
+ cpPos+=4;
+ OffInThisLine+=4;
+ }
+ crossRefPtr = (CrossRef *)crossRefs + iRAdd;
+ LineOfNote=Linea;
+ OffInLine=OffInThisLine-1;
+ if (modeFlags & moinHideNodeLink)
+ TakeName(cpPos,crossRefPtr->Name,crossRefPtr->Name2,OffInLine,Length,LineOfNote,crossRefPtr->linebreak,Text,lSize,cpMenu);
+ else
+ {
+ TakeName(cpPos,Buf,OffInLine,Length,LineOfNote,crossRefPtr->linebreak);
+ strcpy(crossRefPtr->Name,Buf);
+ }
+ crossRefPtr->offset=OffInLine;
+ crossRefPtr->line=LineOfNote;
+ crossRefPtr->length=Length;
+ iNAdd++;
+ iRAdd++;
+ }
+ else
+ if (*cpPos=='\n')
+ {
+ Linea++;
+ OffInThisLine=0;
+ }
+ cpPos++;
+ OffInThisLine++;
+ }
+ }
+ cpFin=Text+(int)lSize-6;
+ if (iMenues)
+ {
+ Linea=LineaMenu+1;
+ int l=getLine(Linea,BufLine);
+ cpPos=Text+lastOffset-l-1;
+ iMAdd=0;
+ do
+ {
+ if (*cpPos=='*' && cpPos[1]==' ')
+ {
+ crossRefPtr = (CrossRef *)crossRefs + iRAdd;
+ LineOfNote=Linea;
+ OffInLine=0;
+ if (modeFlags & moinHideNodeLink)
+ {
+ //long olSize=lSize;
+ TakeName(cpPos,crossRefPtr->Name,crossRefPtr->Name2,OffInLine,Length,LineOfNote,crossRefPtr->linebreak,Text,lSize,cpFin);
+ //lastOffset+=lSize-olSize; // Porque al cortarlo cambi
+ }
+ else
+ {
+ TakeName(cpPos,Buf,OffInLine,Length,LineOfNote,crossRefPtr->linebreak);
+ strcpy(crossRefPtr->Name,Buf);
+ }
+ crossRefPtr->offset=OffInLine;
+ crossRefPtr->line=LineOfNote;
+ crossRefPtr->length=Length;
+ iMAdd++;
+ iRAdd++;
+ }
+ // Ahora ir a la prxima lnea
+ if (iMAdd<iMenues)
+ {
+ if (cpPos-Text>=lSize)
+ break;
+ for (; *cpPos && *cpPos!='\n'; cpPos++);
+ cpPos++;
+ }
+ Linea++;
+ }
+ while(iMAdd<iMenues);
+ }
+ // Agregar las que estn atrs del men
+ if (iNotes && iNAdd<iNotes)
+ {
+ cpPos=cpMenu;
+ Linea=LineaMenu;
+ OffInThisLine=0;
+ for (; iNAdd<iNotes && cpPos<cpFin; )
+ {
+ if (*cpPos=='*' && cpPos[2]=='o' && cpPos[3]=='t'
+ && cpPos[4]=='e' && ucisspace(cpPos[5]))
+ {
+ if (modeFlags & moinCutNodeWord)
+ {
+ CutNoteStr(cpPos,Text,lSize,cpFin);
+ cpPos--;
+ OffInThisLine--;
+ }
+ else
+ {
+ cpPos+=4;
+ OffInThisLine+=4;
+ }
+ crossRefPtr = (CrossRef *)crossRefs + iRAdd;
+ LineOfNote=Linea;
+ OffInLine=OffInThisLine-1;
+ if (modeFlags & moinHideNodeLink)
+ {
+ TakeName(cpPos,crossRefPtr->Name,crossRefPtr->Name2,OffInLine,Length,LineOfNote,crossRefPtr->linebreak,Text,lSize,cpFin);
+ }
+ else
+ {
+ TakeName(cpPos,Buf,OffInLine,Length,LineOfNote,crossRefPtr->linebreak);
+ strcpy(crossRefPtr->Name,Buf);
+ }
+ crossRefPtr->offset=OffInLine;
+ crossRefPtr->line=LineOfNote;
+ crossRefPtr->length=Length;
+ iNAdd++;
+ iRAdd++;
+ }
+ else
+ if (*cpPos=='\n')
+ {
+ Linea++;
+ OffInThisLine=0;
+ }
+ cpPos++;
+ OffInThisLine++;
+ }
+ }
+ }
+}
+
+TInfTopic::~TInfTopic()
+{
+ if (crossRefs != 0)
+ delete[] crossRefs;
+ if (Text!=NULL)
+ delete[] Text;
+}
+
+void TInfTopic::getCrossRef( int i, TPoint& loc, uchar& length, char *& ref,
+ int &pl )
+{
+ CrossRef *crossRefPtr;
+
+ crossRefPtr = crossRefs + i;
+ loc.x = crossRefPtr->offset;
+ loc.y = crossRefPtr->line;
+ length = crossRefPtr->length;
+ ref = crossRefPtr->Name;
+ pl = crossRefPtr->linebreak;
+}
+
+int TInfTopic::getLine( int line, char *buffer )
+{
+ int offset, i, l;
+ char *s;
+
+ if (lastLine < line)
+ {
+ i = line;
+ line -= lastLine;
+ lastLine = i;
+ offset = lastOffset;
+ }
+ else
+ {
+ offset = 0;
+ lastLine = line;
+ }
+ buffer[0] = 0;
+ while (offset < lSize)
+ {
+ --line;
+ if (line == 0)
+ {
+ char *dest=buffer;
+ // Barrer buscando el fin de lnea y copiando
+ for (s=Text+offset, l=0; *s && *s!='\n'; s++,offset++,dest++,l++) *dest=*s;
+ if (*s=='\n')
+ {
+ offset++;
+ *dest++=0;
+ }
+ lastOffset = offset;
+ return l;
+ }
+ else
+ {
+ // Barrer buscando el fin de lnea
+ for (s=Text+offset; *s && *s!='\n'; s++,offset++);
+ if (*s=='\n') offset++;
+ }
+ }
+ buffer[0] = 0;
+ return 0;
+}
+
+
+static int MatchCross(char *s,char *match,int l,int &vislen)
+{
+ for (vislen=l;*s && !TVCodePage::isAlpha(*s);s++,vislen++);
+ return strncasecmp(s,match,l)==0;
+}
+
+#define VisibleNameOf(i) \
+ modeFlags & moinHideNodeLink ? crossRefs[i].Name2 : crossRefs[i].Name
+
+int TInfTopic::SearchNextWith(char *str,int len,int &selected,int &vislen)
+{
+ int i,j;
+
+ if (selected<numRefs)
+ {
+ if (selected<1) // It was a bug and was there for ages
+ selected=1;
+ for (i=selected-1; i<numRefs; i++)
+ {
+ if (MatchCross(VisibleNameOf(i),str,len,vislen))
+ {
+ selected=i+1;
+ return 1;
+ }
+ }
+ }
+ if (numRefs)
+ {
+ for (j=selected-1,i=0; i<j; i++)
+ {
+ if (MatchCross(VisibleNameOf(i),str,len,vislen))
+ {
+ selected=i+1;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+
+int TInfTopic::selBestMatch(char *match, int &PerfectMatch, unsigned opts)
+{
+ PerfectMatch=0;
+ if (match==0 || numRefs==0) return 0;
+
+ int i,j,BestPoints=0,BestPos=-1;
+ char Buf[MAX_NODE_NAME];
+ char *s1,*s2;
+ strupr(match);
+ size_t lenMatch=strlen(match);
+ for (i=numRefs-1; i>=0; --i)
+ {
+ // Copy & struppr
+ s1=opts & bestMVisibleName ? crossRefs[i].Name2 : crossRefs[i].Name;
+ for (s2=Buf; *s1; s1++,s2++) *s2=TVCodePage::toUpper(*s1); *s2=0;
+ // Compare
+ for (s1=Buf, s2=match, j=0; *s1==*s2 && *s1; s1++,s2++,j++);
+ if (j>BestPoints ||
+ (j==BestPoints && j==(int)lenMatch)) // Give priority to the perfect over
+ // a partial match.
+ {
+ BestPoints=j;
+ BestPos=i;
+ }
+ }
+ PerfectMatch=(lenMatch==(size_t)BestPoints);
+ return BestPos+1;
+}
+
+
+// ******************** TInfIndexCollection ************************
+
+// Un insert adecuado.
+stkHandler TInfIndexCollection::insert(long pos, stkHandler node, char *s,
+ int len)
+{
+ struct TIIC *p;
+ stkHandler h=stkL->alloc(sizeof(pos)+sizeof(stkHandler)+1+len);
+ p=(struct TIIC *)stkL->GetPointerOf(h);
+ p->pos=pos;
+ p->node=node;
+ strncpy(p->name,s,len);
+ p->name[len]=0;
+ TNoCaseSOSStringCollection::insert(h);
+ return h;
+}
+
+// Devuelve el string salteando a la posicin
+char *TInfIndexCollection::GetString( void *h )
+{
+ return ((TIIC *)stkL->GetPointerOf((stkHandler)h))->name;
+}
+
+
+// ******************** TInfIndex ********************
+
+TInfIndex::~TInfIndex()
+{
+ if (stk!=NULL)
+ delete stk;
+ if (coll!=NULL)
+ delete coll;
+ if (IndOffsets!=NULL)
+ delete[] IndOffsets;
+ IndOffsets=NULL;
+}
+
+
+TInfIndex::TInfIndex( TInfFile& o, int Indirect )
+{
+ indirects=0;
+ IndOffsets=NULL;
+ stk=new SOStack;
+ coll=new TInfIndexCollection(100,100,stk);
+ coll->duplicates = True;
+
+ CheckClassError(!stk || !coll);
+
+ FILE *f=o.stream;
+ Status = False; // OK
+
+#ifdef DEBSTD
+ fprintf(stderr,"Loading the Index, indirect: %d\n",Indirect);
+#endif
+ // Indirecta => varios archivos
+ long PosStream = ftell(f);
+ if (Indirect)
+ {
+ // Medir
+ do
+ {
+ o.GetLine();
+ if (o.Buffer[0]==31) break;
+ indirects++;
+ }
+ while (!feof(f));
+ fseek(f,PosStream,SEEK_SET);
+#ifdef DEBSTD
+ fprintf(stderr,"Found %d indirects\n",indirects);
+#endif
+ // Cargar
+ IndOffsets=new IndirectIndex[indirects];
+ indirects=0;
+ do
+ {
+ char *s,*ori;
+
+ o.GetLine();
+ if (o.Buffer[0]==31) break;
+ s=IndOffsets[indirects].Name;
+ ori=o.Buffer;
+ for (;*ori && *ori!=':'; s++,ori++) *s=*ori;
+ *s=0;
+ ori++;
+ IndOffsets[indirects].lPos=atol(ori);
+ indirects++;
+ }
+ while (!feof(f));
+#ifdef DEBSTD
+ fprintf(stderr,"Loaded %d indirects\n",indirects);
+#endif
+
+ // Ir al ndice
+ do
+ {
+ o.GetLine();
+ if (strncmp(o.Buffer,"Tag Table",9)==0) break;
+ o.SkipNode();
+ }
+ while(!feof(f));
+ if (feof(f))
+ {
+ #ifdef DEBSTD
+ fprintf(stderr,"Tag table not found in indirect table\n");
+ #endif
+ Status=True;
+ return;
+ }
+ o.GetLine();
+ }
+
+ // Una pasada lee y almacena
+ char *start,*end;
+ // The table is ever at the end of the 1st file so that's valid:
+ long ltPos=o.fTell();
+ long lTable=o.fileLength-ltPos;
+ int enableProg=0;
+ int nodesRead=0;
+ if (lTable>40000)
+ {
+ enableProg=1;
+ char *ReadingMessage=TVIntl::getTextNew(__("Reading index table for: "));
+ char *s=new char[strlen(ReadingMessage)+strlen(o.NameOfFile)+1];
+ strcpy(s,ReadingMessage);
+ strcat(s,o.NameOfFile);
+ ProgBar_Init(__("InfView"),lTable,s);
+ DeleteArray(s);
+ DeleteArray(ReadingMessage);
+ }
+ stkHandler prevNode=0,curNode;
+ unsigned isReference=0;
+ do
+ {
+ o.GetLine();
+ if (enableProg)
+ {
+ if ((++nodesRead & 0x7)==0)
+ ProgBar_UpDate(o.fTell()-ltPos);
+ }
+ if (o.Buffer[0]==31)
+ break;
+ int skip=0;
+ if (strncmp(o.Buffer,"Node:",5)==0) { skip=6; isReference=0; }
+ // New thing introduced in texinfo 4.0
+ if (strncmp(o.Buffer,"Ref:" ,4)==0) { skip=5; isReference=1; }
+ if (!skip)
+ {
+ Status=True;
+ break;
+ }
+ for (start=o.Buffer+skip, end=start; *end && *end!=127 && *end!='\n'; end++);
+ if (*end!=127)
+ {
+ Status=True;
+ break;
+ }
+ if (isReference)
+ curNode=coll->insert(atol(end+1),prevNode,start,end-start);
+ else
+ {
+ curNode=coll->insert(atol(end+1),stkNULL,start,end-start);
+ prevNode=curNode;
+ }
+ }
+ while (!feof(f));
+ if (enableProg)
+ {
+ ProgBar_UpDate(o.fTell()-ltPos);
+ ProgBar_DeInit();
+ }
+ if (Status)
+ return;
+
+ size = coll->getCount();
+
+ CheckClassError(!size || !stk->Buffer);
+
+ #ifdef DEBSTD
+ fprintf(stderr,"Tag Table loaded\n");
+ #endif
+}
+
+
+// For files without Tag Table (not real .info, just texts with 0x1F as delimiter)
+TInfIndex::TInfIndex( TInfFile& o )
+{
+ long PosNode;
+ char *Pos;
+
+ indirects=0;
+ IndOffsets=NULL;
+ stk=new SOStack;
+ coll=new TInfIndexCollection(100,100,stk);
+ coll->duplicates = True;
+
+ CheckClassError(!stk || !coll);
+
+ FILE *f=o.stream;
+ Status = False; // OK
+
+ // Al ppio.
+ rewind(f);
+
+ // Asumo que lo primero es el ttulo y no un nodo.
+
+ // Una pasada lee y almacena
+ do
+ {
+ o.SkipNode();
+ while (!feof(f))
+ {
+ PosNode=ftell(f);
+ o.GetLine();
+ if (strncmp(o.Buffer,"File:",5)==0)
+ {
+ Pos=strstr(o.Buffer+5,"Node:");
+ CheckClassError(Pos==NULL);
+ Pos+=6;
+ char *s;
+ int largo;
+ for (s=Pos,largo=0; *s && *s!='\n' && *s!='\r' && *s!=',' && *s!='\t'; s++,largo++);
+ coll->insert(PosNode,stkNULL,Pos,largo);
+ break;
+ }
+ }
+ }
+ while (!feof(f));
+
+ size = coll->getCount();
+
+ CheckClassError(!size);
+}
+
+long TInfIndex::position(int i, char *&name, int &difference)
+{
+ if (i<size && !Status)
+ {
+ TIIC *p=(TIIC *)stk->GetPointerOf((stkHandler)coll->at(i));
+ if (p->node!=stkNULL)
+ {
+ long oldPos=p->pos;
+ p=(TIIC *)stk->GetPointerOf(p->node);
+ name=p->name;
+ difference=oldPos-p->pos;
+ }
+ return p->pos;
+ }
+ return -1;
+}
+
+int TInfIndex::WhatIndex(char *Nom)
+{
+ ccIndex index;
+
+ if (coll->SearchCase(Nom,index))
+ return index;
+ return size+1;
+}
+
+int TInfIndex::SearchFirstWith(int Key,int &selected)
+{
+ int i;
+
+ for (i=0; i<size; i++)
+ {
+ if (coll->atStr(i)[0]==Key)
+ {
+ selected=i+1;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+
+// TInfFile
+
+int TInfFile::SizeOfReadBuf=BUF_SIZE;
+
+void TInfFile::DoAll( char *Nombre, int Verbose )
+{
+ int Indirect=0;
+ index=NULL;
+ strcpy(NameOfFile,Nombre);
+ // Volarle la extensin
+// char *s;
+// if ((s=strrchr(NameOfFile,'.'))!=NULL) *s=0;
+ Status=False; // OK
+
+ stream=fOpen(Nombre);
+ if (stream==NULL)
+ {
+ if (Verbose)
+ messageBox(mfError|mfOKButton,__("Attention: can't open the help file '%s'."), Nombre);
+ Status=True;
+ return;
+ }
+
+ // Buscar el Index
+ do
+ {
+ GetLine();
+ if (strncmp(Buffer,"Tag Table",9)==0) break;
+ if (strncmp(Buffer,"Indirect:",9)==0) { Indirect=1; break; }
+ SkipNode();
+ }
+ while(!feof(stream));
+
+ // Si fall es que no posee Tag Table, antes yo pensaba que era imposible,
+ // pero el Debian crea el dir automaticamente y los idiotas en lugar de
+ // crear un verdadero dir.info crean un archivo de texto plano con un solo 0x1F
+ // para delimitar el ttulo del nico nodo.
+ if (feof(stream))
+ {
+ // Levantarlo a RAM, pero con un constructor !=
+ index=new TInfIndex(*this);
+ }
+ else
+ {
+ // Levantarlo a RAM
+ index=new TInfIndex(*this,Indirect);
+ }
+ Status=index->Status;
+
+ if (Indirect && !Status)
+ { // Abrir la primera
+ fClose(stream);
+ iFile=0;
+ stream=fOpen(index->IndOffsets[0].Name);
+ if (stream==NULL)
+ {
+ Status=True;
+ return;
+ }
+ }
+}
+
+/********************************************************************************
+
+ Function: int TestForFile(char *s)
+
+ Objetive: Test if some file exists and in this case if is a normal file.
+
+ Parameter:
+ char *s The name of the file
+
+ Returns:
+ -1 Fail
+ 0 OK
+
+********************************************************************************/
+
+int TestForFile(char *s)
+{
+ struct stat a;
+ if (stat(s,&a)!=0)
+ return -1;
+ return S_ISREG(a.st_mode) ? 0 : -1;
+}
+
+/********************************************************************************
+
+ Function: int TryWithName(char *s, int have_ext, int iExt, int &is_compressed)
+
+ Type: static.
+
+ Objetive: Try to find a file with the specified name but with variants in
+ the extention.
+
+ Parameter:
+ char *s: a pointer to the name of the file.
+ int have_ext: 1 if the original name already have an extention.
+ int iExt: 1 try to add an extention.
+ int &is_compressed: returns 1 if the name belongs to a compressed file.
+
+ Returns:
+ 1 if the file doesn't exists.
+ 0 if all OK, in this case the string holds the valid name.
+
+********************************************************************************/
+
+static int TryWithName(char *s, char *ext, int iExt, Boolean &is_compressed)
+{
+#define TestForFileRetZ(s) {if(TestForFile(s)==0) { is_compressed=True; return 0; }}
+#define TestForFileRet(s) {if(TestForFile(s)==0) { return 0; }}
+#define TestForFileRetAddZ(s,e) { \
+ strcat(s,e); \
+ if (TestForFile(s)==0) \
+ { is_compressed=True; return 0; } \
+ s[pos]=0; \
+ }
+#define TestForFileRetAdd(s,e) { \
+ strcat(s,e); \
+ if (TestForFile(s)==0) \
+ return 0; \
+ s[pos]=0; \
+ }
+
+ int pos;
+
+ pos=strlen(s);
+ is_compressed=(ext!=0 && strchr(ext,'z')!=0) ? True : False;
+ // Try the normal name
+ TestForFileRet(s);
+ if (iExt)
+ {
+ // If the normal fails try with .inf, etc
+ pos=strlen(s);
+ if (ext==0)
+ {
+ TestForFileRetAdd(s,".inf");
+ TestForFileRetAdd(s,".info");
+ TestForFileRetAddZ(s,".igz");
+ TestForFileRetAddZ(s,".gz");
+ TestForFileRetAddZ(s,".info.gz");
+ TestForFileRetAddZ(s,".inf.gz");
+ TestForFileRetAddZ(s,".inz");
+ #ifdef HAVE_BZIP2
+ TestForFileRetAddZ(s,".bz2");
+ TestForFileRetAddZ(s,".info.bz2");
+ #endif
+ }
+ else
+ {
+ TestForFileRetAddZ(s,".gz");
+ #ifdef HAVE_BZIP2
+ TestForFileRetAddZ(s,".bz2");
+ #endif
+ // Change the extention
+ char *dot=strrchr(s,'.')+1;
+ int ext_l=strlen(dot);
+ // People that used SFNs and then switchs to LFNs can experiment it.
+ if (ext_l==3 && strncmp(dot,"inf",3)==0)
+ {
+ dot[3]='o'; dot[4]=0;
+ if (TestForFile(s)==0)
+ return 0;
+ dot[3]=0;
+ }
+ is_compressed=True;
+ switch (ext_l)
+ {
+ case 1: dot[1]='z';
+ dot[2]=0;
+ TestForFileRet(s);
+ dot[1]='g';
+ dot[2]='z';
+ dot[3]=0;
+ TestForFileRet(s);
+ break;
+
+ case 2: dot[2]='z';
+ dot[3]=0;
+ TestForFileRet(s);
+ break;
+
+ case 3: dot[2]='z';
+ TestForFileRet(s);
+ break;
+ }
+ }
+ }
+
+ return 1;
+}
+
+#ifdef SECompf_djgpp
+void LoadInfoEnviroment(void)
+{
+ static int info_env_loaded = 0;
+ if (!info_env_loaded)
+ {
+ __crt0_load_environment_file("info");
+ info_env_loaded = 1;
+ }
+}
+
+static
+int IsADirectory(const char *name)
+{
+ return !access(name,D_OK);
+}
+
+static
+void GuessInfoPath(DynStrCatStruct *InfoPath)
+{
+ char *djgpp=getenv("DJDIR");
+ if (djgpp)
+ {
+ DynStrCatInit(InfoPath,djgpp);
+ DynStrCat(InfoPath,"/info",5);
+ return;
+ }
+ // Try using SET_FILES as reference
+ char *setfiles=getenv("SET_FILES");
+ if (setfiles)
+ {
+ char *s=strstr(setfiles,"share");
+ if (!s)
+ s=strstr(setfiles,"SHARE");
+ if (s)
+ {
+ DynStrCatInit(InfoPath,setfiles,s-setfiles-1);
+ DynStrCat(InfoPath,"/info",5);
+ if (IsADirectory(InfoPath->str))
+ return;
+ free(InfoPath->str);
+ }
+ }
+ DynStrCatInit(InfoPath,".",1);
+}
+#else
+inline
+void LoadInfoEnviroment(void)
+{
+}
+
+static inline
+void GuessInfoPath(DynStrCatStruct *InfoPath)
+{
+ DynStrCatInit(InfoPath,"/usr/local/info:/usr/info:/usr/share/info:/usr/local/share/info");
+ // Try using SET_FILES as reference
+ char *setfiles=getenv("SET_FILES");
+ if (setfiles)
+ {
+ char *s=strstr(setfiles,"share");
+ if (s)
+ {
+ DynStrCat(InfoPath,":",1);
+ DynStrCat(InfoPath,setfiles,s-setfiles-1);
+ DynStrCat(InfoPath,"/info",5);
+ //printf(">%s<\n",InfoPath->str);
+ }
+ }
+}
+#endif
+
+static DynStrCatStruct InfoPath={0,0};
+
+static
+void RemovePath(void)
+{
+ free(InfoPath.str);
+}
+
+char *InfViewGetInfoDir(void)
+{
+ if (InfoPath.str)
+ return InfoPath.str;
+
+ // Try at first the directories in $INFOPATH, if there are some
+ // DOS: Get the $INFOPATH like info.exe sees it
+ LoadInfoEnviroment();
+ char *infodir=getenv("INFOPATH");
+ // That's for all the lazy people, who don't set the INFOPATH
+ if (infodir)
+ DynStrCatInit(&InfoPath,infodir);
+ else
+ GuessInfoPath(&InfoPath);
+ atexit(RemovePath);
+
+ return InfoPath.str;
+}
+
+void InfViewAddInfoDir(char *dir)
+{
+ if (InfoPath.str)
+ {
+ char b[2]={PATHSEPARATOR,0};
+ DynStrCat(&InfoPath,b,1);
+ DynStrCat(&InfoPath,dir);
+ }
+ else
+ DynStrCatInit(&InfoPath,dir);
+}
+
+static
+char *strrpbrk(char *string, char *search)
+{
+ char *scanp,*str;
+ int c, sc;
+
+ for (str=string; *str; str++);
+ for (str--; str>=string; str--)
+ for (c=*str, scanp=search; (sc=*scanp++)!=0;)
+ if (sc==c)
+ return str;
+ return 0;
+}
+
+
+int TInfFile::ExpandName(char *Buf, char *Nombre, int iExt)
+{
+ int a;
+ int HavePath;
+ char *ext;
+
+ strcpy(Buf,Nombre);
+
+ // Check if it have a path (relative or absolute)
+ ext=strrpbrk(Buf,"/\\:");
+ if (ext)
+ HavePath=1;
+ else
+ {
+ HavePath=0;
+ ext=Buf;
+ }
+
+ // Check if it have extention, I assume the extention is the last one in LFN systems
+ ext=strrchr(ext,'.');
+
+ if (HavePath)
+ {
+ // Try with the name as supplied, that's without adding a path
+ a=TryWithName(Buf,ext,iExt,IsCompressed);
+ if (!a)
+ {
+ Status=False;
+ return 0;
+ }
+ }
+
+ char *infodir=InfViewGetInfoDir();
+ if (infodir)
+ {
+ char *idir=(char *)alloca(strlen(infodir) + 1);
+ char *end=idir,*start=idir;
+ strcpy(idir,infodir);
+ while (1)
+ {
+ char c;
+ while (*end && *end != PATHSEPARATOR) end++;
+ c = *end;
+ *end = 0;
+ strcpy(Buf,start);
+ strcat(Buf,"/");
+ strcat(Buf,Nombre);
+ a = TryWithName(Buf,ext,iExt,IsCompressed);
+ if (!a)
+ {
+ Status = False;
+ return 0;
+ }
+ if (!c) break;
+ start=end=end+1;
+ }
+ }
+
+ char *s=getenv("DJGPP");
+ if (s==NULL)
+ {
+ Status=True;
+ return 1;
+ }
+ strcpy(Buf,s);
+ strupr(Buf);
+ for (s=Buf; *s; s++) if (*s=='/') *s='\\';
+ s=strstr(Buf,"DJGPP.ENV");
+ if (s==NULL)
+ {
+ Status=True;
+ return 1;
+ }
+ s[0]='I';s[1]='N';s[2]='F';s[3]='O';s[4]='\\';
+ char *s2=Nombre;
+ for (s+=5; *s2; s++,s2++) *s=*s2; *s=0;
+ a = TryWithName(Buf,ext,iExt,IsCompressed);
+ if (a)
+ {
+ Status=True;
+ return 1;
+ }
+ return 0;
+}
+
+FILE *TInfFile::fOpen(char *Nombre)
+{
+ char Buf[PATH_MAX];
+ char *name=Buf;
+ int freeName=0;
+
+ if (ExpandName(Buf,Nombre,1))
+ {
+ // There are an special case: when the NameOfFile have a path and we are looking for
+ // the component files of an splitted .info then we must try in the directory where
+ // NameOfFile is located. The fix is relative slow but simple.
+ char *endOfPath=strrpbrk(NameOfFile,"/\\:");
+ if (endOfPath)
+ {
+ char BufNomb[PATH_MAX];
+ int l=endOfPath-NameOfFile+1;
+ strncpy(BufNomb,NameOfFile,l);
+ BufNomb[l]=0;
+ strcat(BufNomb,Nombre);
+ if (ExpandName(Buf,BufNomb,1))
+ return NULL;
+ }
+ else
+ return NULL;
+ }
+ if (IsCompressed)
+ {
+ name=unique_name("gz",NameOfTemporal);
+ if (!name)
+ name="__infc__";
+ else
+ freeName=1;
+ FILE *f=fopen(name,"wb");
+ if (!f)
+ {
+ unlink(name);
+ if (freeName) free(name);
+ return NULL;
+ }
+ if (GZFiles_ExpandHL(f,Buf))
+ {
+ fclose(f);
+ unlink(name);
+ if (freeName) free(name);
+ return NULL;
+ }
+ fclose(f);
+ }
+
+ #ifdef InfV_UseBinaryFile
+ FILE *ret=fopen(name,"rb");
+ #else
+ FILE *ret=fopen(name,"rt");
+ #endif
+
+ #ifdef SEOS_UNIX
+ if (IsCompressed)
+ {// In UNIX we can remove an open file and still using it
+ // That's better if we crash
+ unlink(name);
+ DontRemoveCompressed=True;
+ }
+ #else
+ DontRemoveCompressed=False;
+ #endif
+ fileLength=ret ? filelength(fileno(ret)) : 0;
+ if (freeName) free(name);
+ return ret;
+}
+
+long TInfFile::fTell(void)
+{
+ return ftell(stream);
+}
+
+int TInfFile::fClose(FILE *f)
+{
+ int ret=0;
+
+ if (f!=NULL)
+ {
+ ret=fclose(f);
+ if (IsCompressed)
+ {
+ if (!DontRemoveCompressed)
+ unlink(NameOfTemporal);
+ IsCompressed=False;
+ }
+ }
+ return ret;
+}
+
+TInfFile::~TInfFile(void)
+{
+ if (index!=NULL)
+ delete index;
+ fClose(stream);
+}
+
+void TInfFile::SkipNode(void)
+{
+ do
+ {
+ GetLine();
+ }
+ while(Buffer[0]!=31 && !feof(stream));
+}
+
+int TInfFile::fSeek(long Pos)
+{
+ #ifdef DEBSTD
+ fprintf(stderr,"Making a seek to %d\n",Pos);
+ #endif
+ if (index->indirects)
+ {
+ int i;
+ for (i=0; i<index->indirects && Pos>=index->IndOffsets[i].lPos; i++);
+ #ifdef DEBSTD
+ fprintf(stderr,"Using the indirect table, entry %d actual %d\n",i-1,iFile);
+ #endif
+ if (--i!=iFile)
+ {
+ if (i==-1) return 1;
+ iFile=i;
+ fClose(stream);
+ #ifdef DEBSTD
+ fprintf(stderr,"Opening %s\n",index->IndOffsets[i].Name);
+ #endif
+ stream=fOpen(index->IndOffsets[i].Name);
+ #ifdef DEBSTD
+ fprintf(stderr,"Result: %s\n",stream==NULL ? "fail" : "ok");
+ #endif
+ if (stream==NULL)
+ return 1;
+ }
+ Pos=Pos-index->IndOffsets[i].lPos+index->IndOffsets[0].lPos;
+ }
+ #ifdef DEBSTD
+ fprintf(stderr,"Seeking to %d\n",Pos);
+ #endif
+ return fseek(stream,Pos,SEEK_SET);
+}
+
+
+TInfTopic *TInfFile::getTopic(char *NameOri, int Verbose, int modeForTopic,
+ int &suggestedY)
+{
+ long pos;
+ char cFile[MAX_NODE_NAME];
+ char *Name;
+ int WatchDog=MAX_NODE_NAME-1;
+
+ Name=NameOri;
+ // Ver de que archivo es
+ if (Name[0]=='(')
+ {
+ char *s=Name+1,*s2=cFile;
+
+ for (;*s && *s!=')' && WatchDog;s++,s2++,WatchDog--) *s2=*s; *s2=0;
+ if (!WatchDog)
+ {
+ messageBox("Guau ... guau!!", mfInformation | mfOKButton);
+ }
+ Name=s+1;
+
+ if (strcmp(NameOfFile,cFile)!=0)
+ { // Se pudri
+ if (index!=NULL)
+ delete index;
+ fClose(stream);
+ DoAll(cFile,Verbose);
+ if (index==NULL)
+ return(invalidTopic());
+ }
+ }
+ if (Status)
+ return(invalidTopic());
+ if (Name[0]==0)
+ {
+ strcpy(NameOri,"(");
+ strcat(NameOri,NameOfFile);
+ strcat(NameOri,")Top");
+ Name=strchr(NameOri,')')+1;
+ }
+ int nodeNum=index->WhatIndex(Name);
+ int difference=0;
+ pos = index->position(nodeNum,Name,difference);
+ if (pos>0)
+ {
+ fSeek(pos);
+ TInfTopic *topic = new TInfTopic(modeForTopic);
+ if (!seekToNode(Name))
+ {// Try in all the file
+ if (!seekToNode(Name,1))
+ {
+ delete topic;
+ return(invalidTopic());
+ }
+ }
+ topic->Read(*this,difference,suggestedY);
+ if (topic->Status)
+ {
+ delete topic;
+ return(invalidTopic());
+ }
+ return topic;
+ }
+ else return(invalidTopic());
+}
+
+TInfTopic *TInfFile::invalidTopic()
+{
+ TInfTopic *topic;
+ char *invalidText=TVIntl::getTextNew(__("\n Sorry, I can't find this link (press ALT-F1).\n"));
+
+ topic = new TInfTopic(0);
+ topic->Text = invalidText;
+ topic->lSize = strlen(invalidText);
+ topic->iLines = 2;
+ topic->Status = True;
+
+ return topic;
+}
+
+static void Rename(char *oldname, char *newname)
+{
+ void *buf;
+ buf = malloc(16*1024); // Just the transfer buffer
+ int count;
+ FILE *f = fopen(oldname,"rb");
+ FILE *stream = fopen(newname,"w+b");
+ while ((count = fread(buf,1,16*1024,f)) > 0)
+ {
+ fwrite(buf,1,count,stream);
+ }
+ fclose(stream);
+ fclose(f);
+ remove(oldname);
+ free(buf);
+}
+
+int TInfFile::ConvertIt(long Pos)
+{
+ int ret=0,i;
+ char *s;
+ FILE *f;
+ char *Tempo,Ori[PATH_MAX];
+ Boolean wasCompressed;
+
+ wasCompressed=IsCompressed;
+ if (IsCompressed)
+ rewind(stream);
+ else
+ fClose(stream);
+ i=0;
+ do
+ {
+ if (IsCompressed)
+ {
+ //tmpnam(NameOfTemporal);
+ strcpy(Ori,NameOfTemporal);
+ }
+ else
+ {
+ if (i==index->indirects)
+ ExpandName(Ori,NameOfFile,1);
+ else
+ ExpandName(Ori,index->IndOffsets[i].Name,1);
+ stream=fopen(Ori,"rb");
+ }
+ Tempo=unique_name("iz");
+ f=fopen(Tempo,"wb");
+ if (stream==NULL || f==NULL) return ret;
+ do
+ {
+ GetLine();
+ if (!feof(stream))
+ {
+ for (s=Buffer; *s; s++);
+ if (*(s-2)=='\r')
+ {
+ *(s-2)='\n';
+ *(s-1)=0;
+ }
+ fputs(Buffer,f);
+ }
+ }
+ while (!feof(stream));
+ fclose(f);
+ fclose(stream);
+ Rename(Tempo,Ori);
+ string_free(Tempo);
+ i++;
+ }
+ while (i<=index->indirects && !wasCompressed);
+
+ // Test if convertion succesfull
+ if (wasCompressed)
+ {
+ stream=fopen(Ori,"rb");
+ IsCompressed=True;
+ #ifdef SEOS_UNIX
+ DontRemoveCompressed=True;
+ unlink(Ori);
+ #else
+ DontRemoveCompressed=False;
+ #endif
+ }
+ else
+ {
+ stream=fOpen(NameOfFile);
+ iFile++; // force reopen or we won't find the node
+ }
+ if (stream==NULL) return ret;
+ fSeek(Pos);
+ return 1;
+}
+
+
diff --git a/setedit/infview/infdummy.cc b/setedit/infview/infdummy.cc
new file mode 100644
index 0000000..5b50b28
--- /dev/null
+++ b/setedit/infview/infdummy.cc
@@ -0,0 +1,4 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+const char * GetVariable(const char *) { return 0;};
+void InsertEnvironmentVar(char *,char *) {};
diff --git a/setedit/infview/infmain.cc b/setedit/infview/infmain.cc
new file mode 100644
index 0000000..ae816a9
--- /dev/null
+++ b/setedit/infview/infmain.cc
@@ -0,0 +1,959 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#define Uses_string
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_TApplication
+#define Uses_TEditWindow
+#define Uses_TDeskTop
+#define Uses_TRect
+#define Uses_TEditor
+#define Uses_TFileEditor
+#define Uses_TFileDialog
+#define Uses_TChDirDialog
+#define Uses_TStatusLine
+#define Uses_TCommandSet
+#define Uses_TPalette
+#define Uses_fpstream
+#define Uses_MsgBox
+#define Uses_TScreen
+#define Uses_TGKey
+#define Uses_IOS_BIN
+#define Uses_fcntl
+#define Uses_sys_stat
+#define Uses_getopt
+#define Uses_TCEditor_Commands
+#define Uses_TNSSortedCollection
+#define Uses_TVCodePage
+
+#define Uses_TSSortedListBox
+#define Uses_TSLabel
+#define Uses_TSButton
+#define Uses_TSVeGroup
+#define Uses_TSHzGroup
+#define Uses_TSLabelCheck
+// InfView requests
+#include <infr.h>
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#include "infalone.h"
+
+#include <stdarg.h>
+#include <locale.h>
+#include "inf.h"
+#define Uses_TManWindow
+#include <manview.h>
+#include <codepage.h>
+
+#define INFVIEW_VERSION_STR "0.2.8"
+const char *EditorFile="setedit";
+
+TStatusLine *createStatusForInfView(TRect r);
+TEditWindow *clipMiWindow;
+
+static int views=0,infViews=0;
+
+class TInfViewList: public TNSSortedCollection
+{
+public:
+ TInfViewList() :
+ TNSSortedCollection(3,3) {}
+
+private:
+ virtual int compare(void *key1, void *key2);
+};
+
+int TInfViewList::compare(void *key1, void *key2)
+{
+ return (ulong)key1-(ulong)key2;
+}
+
+TInfViewList *List=0;
+
+static
+void SetPluralCommands(Boolean enable)
+{
+ if (enable)
+ {
+ TView::enableCommand(cmTile);
+ TView::enableCommand(cmCascade);
+ TView::enableCommand(cmNext);
+ TView::enableCommand(cmPrev);
+ }
+ else
+ {
+ TView::disableCommand(cmTile);
+ TView::disableCommand(cmCascade);
+ TView::disableCommand(cmNext);
+ TView::disableCommand(cmPrev);
+ }
+}
+
+static
+void IncrementViews()
+{
+ if (views)
+ SetPluralCommands(True);
+ views++;
+}
+
+static
+void DecrementViews()
+{
+ views--;
+ if (views==1)
+ SetPluralCommands(False);
+}
+
+static
+void IncrementInfViews(TView *p)
+{
+ infViews++;
+ IncrementViews();
+ List->insert(p);
+}
+
+static
+void DecrementGenericView(TView *p)
+{
+ ccIndex pos;
+ if (List->search(p,pos))
+ {
+ infViews--;
+ List->remove(p);
+ }
+ DecrementViews();
+}
+
+TEditorMiApp::TEditorMiApp() :
+ TProgInit( TEditorMiApp::initStatusLine,
+ TEditorMiApp::initMenuBar,
+ TEditorMiApp::initDeskTop
+ ),
+ TApplication()
+{// Disable all the commands that needs at least one view opened
+ TInfViewer::DisableAllCommands();
+ SetPluralCommands(False);
+ createDefaultSO();
+}
+
+void TEditorMiApp::dosShell()
+{
+ if (TScreen::noUserScreen())
+ return;
+ suspend();
+ TScreen::System(CLY_GetShellName());
+ resume();
+ Redraw();
+}
+
+void TEditorMiApp::tile()
+{
+ deskTop->tile(deskTop->getExtent());
+}
+
+void TEditorMiApp::cascade()
+{
+ deskTop->cascade(deskTop->getExtent());
+}
+
+
+void TEditorMiApp::ManPageView()
+{
+ ManPageOptions *op;
+ TDialog *d=ManPageViewSelect(0,&op);
+ if (execDialog(d,op)==cmOK)
+ {
+ TView *view=CreateManWindow(op->program,op->section,op->options,NULL);
+ if (validView(view))
+ {
+ view->options|=ofTileable;
+ deskTop->insert(view);
+ IncrementViews();
+ }
+ }
+}
+
+
+void TEditorMiApp::handleEvent( TEvent& event )
+{
+ TInfWindow *w;
+
+ TApplication::handleEvent( event );
+ if (event.what==evBroadcast)
+ {
+ if (event.message.command==cmClosingWindow)
+ DecrementGenericView((TView *)event.message.infoPtr);
+ else
+ return;
+ }
+ else
+ if (event.what!=evCommand)
+ return;
+ else
+ {
+ switch( event.message.command )
+ {
+ case cmInfMainOpen:
+ if (!infViews)
+ {
+ TInfFile *i=new TInfFile("dir");
+ w=new TInfWindow(i,"");
+ if (validView(w))
+ {
+ w->options|=ofTileable;
+ deskTop->insert(w);
+ IncrementInfViews(w);
+ }
+ else
+ return;
+ }
+ else
+ {
+ w=(TInfWindow *)List->at(0);
+ if (deskTop->current!=w)
+ w->select();
+ }
+ event.message.command=cmInfOpen;
+ w->handleEvent(event);
+ break;
+
+ case cmInfView:
+ {
+ TInfFile *i=new TInfFile("dir");
+ TInfWindow *w = new TInfWindow(i,"");
+ if (validView(w))
+ {
+ w->options|=ofTileable;
+ deskTop->insert(w);
+ IncrementInfViews(w);
+ }
+ }
+ break;
+
+ case cmAbout:
+ {
+ TInfFile *i=new TInfFile("infview");
+ TInfWindow *w = new TInfWindow(i,"About the Author");
+ if (validView(w))
+ {
+ w->options|=ofTileable;
+ IncrementInfViews(w);
+ deskTop->insert(w);
+ }
+ w->zoom();
+ }
+ break;
+
+ case cmManPage:
+ ManPageView();
+ break;
+
+ case cmTile:
+ tile();
+ break;
+
+ case cmCascade:
+ cascade();
+ break;
+
+ case cmScreenConf:
+ SetScreenOps();
+ break;
+
+ case cmCallShell:
+ dosShell();
+ break;
+
+ default:
+ return;
+ }
+ }
+ clearEvent(event);
+}
+
+
+// Palette from setedit, the only way to maintain it in sync
+#include <pal.h>
+
+char SEcpColor[] ={ SE_cpColor 0 };
+char SEcpBlackWhite[]={ SE_cpBlackWhite 0 };
+char SEcpMonochrome[]={ SE_cpMonochrome 0 };
+
+TPalette& TEditorMiApp::getPalette() const
+{
+ static TPalette color ( SEcpColor, sizeof( SEcpColor )-1 );
+ static TPalette blackwhite( SEcpBlackWhite, sizeof( SEcpBlackWhite )-1 );
+ static TPalette monochrome( SEcpMonochrome, sizeof( SEcpMonochrome )-1 );
+ static TPalette *palettes[] =
+ {
+ &color,
+ &blackwhite,
+ &monochrome
+ };
+ return *(palettes[appPalette]);
+}
+
+/************************* Code page options ***********************************/
+
+// This code is a cut&paste of the TSetEditorApp::EncodingOptions()
+// should be unified, but is complex.
+char *TEditorMiApp::createTitle(const char *title)
+{
+ char *t=TVIntl::getTextNew(title);
+ const char *d=TScreen::getDriverShortName();
+ char *res=new char[strlen(t)+3+strlen(d)+1];
+ strcpy(res,t);
+ strcat(res," - ");
+ strcat(res,d);
+ DeleteArray(t);
+ return res;
+}
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 appForce CLY_Packed;
+ TCollection *appList CLY_Packed;
+ ccIndex appCP CLY_Packed;
+ uint32 inpForce CLY_Packed;
+ TCollection *inpList CLY_Packed;
+ ccIndex inpCP CLY_Packed;
+ uint32 scrForce CLY_Packed;
+ TCollection *scrList CLY_Packed;
+ ccIndex scrCP CLY_Packed;
+} EncodingBox;
+#pragma pack()
+
+// Forced width of the encodings and fonts list boxes
+const int wForced=24;
+
+stScreenOptions *TEditorMiApp::so=NULL;
+
+void TEditorMiApp::SetScreenOps()
+{
+ if (!so) return; // Sanity check
+ // Compute the height of the list boxes to use most of the desktop
+ TRect dkt=TProgram::deskTop->getExtent();
+ int height=dkt.b.y-dkt.a.y-10;
+ if (TScreen::codePageVariable())
+ height=(height-2)/2;
+
+ TSVeGroup *appEncode=NULL,*scrEncode=NULL,*inpEncode=NULL;
+
+ appEncode=new TSVeGroup(
+ TSLabelCheck(__("~A~pplication"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ appEncode->makeSameW();
+
+ inpEncode=new TSVeGroup(
+ TSLabelCheck(__("~I~nput"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ inpEncode->makeSameW();
+
+ TSView *upperCPs=MakeHzGroup(appEncode,inpEncode,0);
+ TSView *lowerCPs=NULL;
+
+ if (TScreen::codePageVariable())
+ {// Only if the code page is variable
+ scrEncode=new TSVeGroup(
+ TSLabelCheck(__("~S~creen"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ scrEncode->makeSameW();
+ lowerCPs=scrEncode;
+ }
+
+
+ char *title=createTitle(__("Encodings"));
+ TSViewCol *col=new TSViewCol(title);
+ DeleteArray(title);
+ col->insert(xTSLeft,yTSUp,upperCPs);
+ if (lowerCPs)
+ col->insert(xTSCenter,yTSUnder,lowerCPs,0,upperCPs);
+ col->insert(xTSCenter,yTSDown,
+ MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("Set ~D~efaults"),cmYes),0));
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ //d->helpCtx=cmeEncodings;
+ EncodingBox box;
+
+ // Current TV settings
+ int idDefScr, idDefApp, idDefInp;
+ TVCodePage::GetDefaultCodePages(idDefScr,idDefApp,idDefInp);
+
+ // Currently selected values
+ int appCP, scrCP, inpCP;
+ appCP=TVCodePage::IDToIndex(so->enForceApp && so->enApp!=-1 ? so->enApp : idDefApp);
+ inpCP=TVCodePage::IDToIndex(so->enForceInp && so->enInp!=-1 ? so->enInp : idDefInp);
+ scrCP=TVCodePage::IDToIndex(so->enForceScr && so->enScr!=-1 ? so->enScr : idDefScr);
+
+ // Data box
+ box.appForce=so->enForceApp;
+ box.inpForce=so->enForceInp;
+ box.scrForce=so->enForceScr;
+ box.appCP=appCP;
+ box.inpCP=inpCP;
+ box.scrCP=scrCP;
+ box.appList=box.inpList=box.scrList=TVCodePage::GetList();
+
+ unsigned ret=execDialog(d,&box);
+ if (ret==cmYes)
+ {// Set defaults
+ so->enForceApp=so->enForceInp=so->enForceScr=0;
+ so->enApp=idDefApp;
+ so->enInp=idDefInp;
+ so->enScr=idDefScr;
+ TVCodePage::SetCodePage(so->enApp,so->enScr,so->enInp);
+ // This is a full redraw, not just a refresh from the buffers
+ TProgram::application->Redraw();
+ }
+ else if (ret==cmOK)
+ {
+ int appChanged=box.appForce!=so->enForceApp || (so->enForceApp && box.appCP!=appCP);
+ int inpChanged=box.inpForce!=so->enForceInp || (so->enForceInp && box.inpCP!=inpCP);
+ int priChanged=box.scrForce!=so->enForceScr || (so->enForceScr && box.scrCP!=scrCP);
+ if (appChanged || inpChanged || priChanged)
+ {// At least one changed
+ so->enForceApp=box.appForce;
+ so->enForceInp=box.inpForce;
+ so->enForceScr=box.scrForce;
+ // Transfer the settings or just revert to defaults
+ so->enApp=so->enForceApp ? TVCodePage::IndexToID(box.appCP) : idDefApp;
+ so->enInp=so->enForceInp ? TVCodePage::IndexToID(box.inpCP) : idDefInp;
+ so->enScr=so->enForceScr ? TVCodePage::IndexToID(box.scrCP) : idDefScr;
+ TVCodePage::SetCodePage(so->enApp,so->enScr,so->enInp);
+ // This is a full redraw, not just a refresh from the buffers
+ TProgram::application->Redraw();
+ }
+ }
+}
+
+
+/************************* READ/WRITE desktop files ***********************************/
+
+const char *Signature="InfView desktop file\x1A";
+
+void TEditorMiApp::saveDesktop(const char *fName)
+{
+ fpstream *f=new fpstream(fName,CLY_IOSOut | CLY_IOSBin);
+
+ if (f)
+ {
+ f->writeString(Signature);
+ storeDesktop(*f);
+ if (!f)
+ {
+ messageBox(mfOKButton | mfError,__("Could not create %s."),fName);
+ f->close();
+ ::remove(fName);
+ }
+ else
+ f->close();
+ }
+ delete f;
+}
+
+static
+void writeView(TView *p, void *strm)
+{
+ fpstream *s=(fpstream *)strm;
+ if (p!=TProgram::deskTop->last)
+ {
+ ccIndex pos;
+ uchar IsInfView=List->search(p,pos) ? 1 : 0;
+ *s << IsInfView << p;
+ }
+}
+
+void TEditorMiApp::storeDesktop(fpstream& s)
+{
+ s << 3; // Version
+ s << so->enForceApp << so->enForceScr << so->enForceInp
+ << so->enApp << so->enScr << so->enInp
+ << TInfViewer::BookMark;
+ deskTop->forEach(::writeView,&s);
+ s << 0;
+}
+
+void TEditorMiApp::retrieveDesktop(const char *name, int loadWindows)
+{
+ if (name)
+ {
+ #ifdef BROKEN_CPP_OPEN_STREAM
+ // In this way we avoid the destruction of the file
+ int h=open(name, O_RDONLY | O_BINARY);
+ if (h<0)
+ return;
+ fpstream *f=new fpstream(h);
+ #else
+ fpstream *f=new fpstream(name,CLY_IOSIn | CLY_IOSBin);
+ #endif
+
+ if (!f)
+ messageBox(__("Could not open desktop file"), mfOKButton | mfError);
+ else
+ {
+ char *s=f->readString();
+ if (s && strcmp(s,Signature)!=0)
+ messageBox(__("Wrong desktop file"), mfOKButton | mfError);
+ else
+ {
+ if (s)
+ loadDesktop(*f,loadWindows);
+ if (!s || !f)
+ messageBox(__("Error reading desktop file"), mfOKButton | mfError);
+ }
+ delete[] s;
+ f->close();
+ }
+ delete f;
+ }
+ TVCodePage::SetCodePage(so->enApp,so->enScr,so->enInp);
+}
+
+static
+void closeView(TView *p, void *p1)
+{
+ message(p, evCommand, cmClose, p1);
+}
+
+void TEditorMiApp::createDefaultSO()
+{
+ if (!so)
+ so=new stScreenOptions;
+ so->enForceApp=so->enForceScr=so->enForceInp=0;
+ so->enApp=so->enScr=so->enInp=-1;
+}
+
+void TEditorMiApp::loadDesktop(fpstream &s, int loadWindows)
+{
+ TView *p;
+ int version;
+
+ createDefaultSO();
+
+ if (deskTop->valid(cmClose))
+ {
+ if (loadWindows)
+ deskTop->forEach(::closeView,0); // Clear the desktop
+ s >> version;
+ if (version==2)
+ {
+ int curCodePage;
+ s >> curCodePage;
+ so->enForceScr=1;
+ so->enScr=curCodePage;
+ }
+ else if (version>2)
+ {
+ s >> so->enForceApp >> so->enForceScr >> so->enForceInp
+ >> so->enApp >> so->enScr >> so->enInp;
+ }
+ s >> TInfViewer::BookMark;
+ if (!loadWindows)
+ return;
+ if (version<2)
+ {
+ do
+ {
+ s >> p;
+ if (validView(p))
+ {
+ deskTop->insertBefore(p,deskTop->last);
+ IncrementInfViews(p);
+ }
+ }
+ while (p);
+ }
+ else
+ {
+ uchar IsInfView;
+ do
+ {
+ s >> IsInfView >> p;
+ if (validView(p))
+ {
+ deskTop->insertBefore(p,deskTop->last);
+ if (IsInfView)
+ IncrementInfViews(p);
+ else
+ IncrementViews();
+ }
+ }
+ while (p);
+ }
+ }
+}
+/******************** End of READ/WRITE desktop files *******************************/
+
+/******* Command line parsing *******/
+static char CommandLineParsed=0;
+// Red Hat 5.2 keyboard layout
+static char UseRH52=0;
+static char *FileToLoad=0,*JumpTo=0,*desktopIn=0,*desktopOut=0;
+
+static
+struct CLY_option longopts[] =
+{
+ { "directory", 1, 0, 'd' },
+ { "file", 1, 0, 'f' },
+ { "force-no-lfn", 0, 0, 'l' },
+ { "force-lfn", 0, 0, 'L' },
+ { "node", 1, 0, 'n' },
+ { "read-dkt", 1, 0, 'r' },
+ { "save-dkt", 1, 0, 's' },
+ { "use-rh-52-keys", 0, 0, 'k' },
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+static
+void ParseCommandLine(int argc, char *argv[])
+{
+ if (CommandLineParsed)
+ return;
+
+ int optc;
+
+ while ((optc=CLY_getopt_long(argc,argv,"d:f:lLn:kr:s:h",longopts,0))!=EOF)
+ {
+ switch (optc)
+ {
+ case 'l':
+ putenv("LFN=N");
+ break;
+ case 'L':
+ putenv("LFN=Y");
+ break;
+ case 'k':
+ UseRH52=1;
+ break;
+ case 'd':
+ InfViewAddInfoDir(CLY_optarg);
+ break;
+ case 'f':
+ FileToLoad=CLY_optarg;
+ break;
+ case 'n':
+ JumpTo=CLY_optarg;
+ break;
+ case 'r':
+ desktopIn=CLY_optarg;
+ break;
+ case 's':
+ desktopOut=CLY_optarg;
+ break;
+ case 'h':
+ default:
+ TScreen::suspend();
+ fprintf(stderr,_("InfView v"INFVIEW_VERSION_STR". Copyright (c) 1996-2002 by Salvador E. Tropea\n\n"));
+ fprintf(stderr,_("infview [option]... [info_file [menu_item...]]\n\n"));
+ fprintf(stderr,_("Valid options are:\n"));
+ fprintf(stderr,_("-d, --directory DIR adds a directory to the list of directories to search\n"
+ " (DIR to INFOPATH)\n"));
+ fprintf(stderr,_("-f, --file FILENAME load FILENAME info file.\n"));
+ #ifdef TVCompf_djgpp // Don't name it under Linux
+ fprintf(stderr,_("-l, --force-no-lfn avoids the use of long file names under W9x.\n"));
+ fprintf(stderr,_("-L, --force-lfn forces the use of long file names under W9x.\n"));
+ #else
+ fprintf(stderr,_("-k, --use-rh-52-keys enables the Red Hat 5.2 style keyboard mapping.\n"));
+ #endif
+ fprintf(stderr,_("-n, --node NODE jumps to this node.\n"));
+ fprintf(stderr,_("-r, --read-dkt FILENAME if no file is opened use this desktop file.\n"));
+ fprintf(stderr,_("-s, --save-dkt FILENAME save the desktop to this file at exit.\n"));
+ fprintf(stderr,_("-h, --help displays this text ;-).\n\n"));
+ fprintf(stderr,_("The first argument, if present, is the name of the Info file to read.\n"
+ "Any remaining arguments are treated as the names of menu items in the initial\n"));
+ #ifdef TVOSf_Linux
+ fprintf(stderr,_("node visited. For example, `infview libc \"function index\" printf' moves to the\n"
+ "node `Function Index' and then to `printf' in the info file `libc'.\n\n"));
+ #else
+ fprintf(stderr,_("node visited. For example, `infview libc alpha printf' moves to the node\n"
+ "`Alphabetical list' and then to `printf' in the info file `libc'.\n\n"));
+ #endif
+ fprintf(stderr,_("Also note that info files are searched in the INFOPATH directories. To load a\n"
+ "file stored in the current directory add ./ at the beginning of the name.\n"
+ "Email bug reports to salvador@inti.gov.ar or djgpp@delorie.com.\n"));
+ fflush(stderr);
+ exit(1);
+ break;
+ }
+ }
+ CommandLineParsed=1;
+}
+/******* End of Command line parsing *******/
+
+const char *cDktNameOld="desktop.dkt";
+const char *cDktName ="infview.dkt";
+TInfWindow *startInfo=0;
+
+char *TryFileName(const char *path, const char *file)
+{
+ char aux[PATH_MAX];
+ struct stat st;
+
+ strcpy(aux,path);
+ #ifdef TVOS_UNIX
+ strcat(aux,".");
+ #endif
+ strcat(aux,file);
+
+ if (stat(aux,&st)==0 && S_ISREG(st.st_mode))
+ return strdup(aux);
+ return 0;
+}
+
+char *StringCat(const char *s1, ...)
+{
+ va_list va;
+ char *s,*ret;
+ int len=strlen(s1)+1;
+
+ va_start(va,s1);
+ while ((s=va_arg(va,char *))!=0)
+ len+=strlen(s);
+ va_end(va);
+
+ ret=new char[len];
+ va_start(va,s1);
+ strcpy(ret,s1);
+ while ((s=va_arg(va,char *))!=0)
+ strcat(ret,s);
+ va_end(va);
+
+ return ret;
+}
+
+void CreateDesktopNames(char *file)
+{
+ if (desktopIn && desktopOut)
+ return; // Nothing to do the user specified both
+
+ char Share[PATH_MAX];
+ char *pos=strrchr(file,'/');
+ if (pos && pos-file>4 && strncmp(pos-3,"bin",3)==0)
+ {
+ strncpy(Share,file,pos-file-3);
+ Share[pos-file-3]=0;
+ }
+ #ifdef TVCompf_djgpp
+ else
+ if ((pos=getenv("DJDIR"))!=0)
+ {
+ strcpy(Share,pos);
+ strcat(Share,"/");
+ }
+ #endif
+ else
+ strcpy(Share,"./");
+ strcat(Share,"share/infview/");
+
+ #if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+ char Home[PATH_MAX];
+ pos=getenv("HOME");
+ if (!pos)
+ {
+ pos=getenv("HOMEDIR");
+ if (!pos)
+ pos=".";
+ }
+ strcpy(Home,pos);
+ strcat(Home,"/");
+ #endif
+
+ // Solve the read point
+ // Try with the new name
+ if (!desktopIn)
+ {// Here
+ desktopIn=TryFileName("./",cDktName);
+ #if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+ // User's home
+ if (!desktopIn)
+ desktopIn=TryFileName(Home,cDktName);
+ #endif
+ // Shared dir
+ if (!desktopIn)
+ desktopIn=TryFileName(Share,cDktName);
+ }
+ // Try with the old name
+ if (!desktopIn)
+ {// Here
+ desktopIn=TryFileName("./",cDktNameOld);
+ #if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+ // User's home
+ if (!desktopIn)
+ desktopIn=TryFileName(Home,cDktNameOld);
+ #endif
+ // Shared dir
+ if (!desktopIn)
+ desktopIn=TryFileName(Share,cDktNameOld);
+ }
+
+ // Solve the write point
+ if (!desktopOut)
+ {
+ #if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+ // Home
+ desktopOut=StringCat(Home,".",cDktName,0);
+ #else
+ // Share
+ desktopOut=StringCat(Share,cDktName,0);
+ #endif
+ }
+}
+
+void OpenInfView(TEditorMiApp *editorApp, char *name)
+{
+ TInfFile *i=new TInfFile(name);
+ startInfo=new TInfWindow(i,"");
+ if (editorApp->validView(startInfo))
+ {
+ editorApp->deskTop->insert(startInfo);
+ startInfo->options|=ofTileable;
+ IncrementInfViews(startInfo);
+ }
+}
+
+// Some dummies for the editor's specs
+void InsertEnvironmentVar(const char *,const char *)
+{
+}
+unsigned EnvirSetBits(const char *, unsigned )
+{
+ return 0;
+}
+unsigned EnvirGetBits(const char *, unsigned , unsigned aDefault)
+{
+ return aDefault;
+}
+
+const char *GetVariable(const char *variable, const char *def)
+{
+ const char *env=getenv(variable);
+ return env ? env : def;
+}
+
+static
+void InitInternacSup()
+{
+ //------ International support
+ #ifndef NO_INTL_SUP
+ char *locale_dir,localedir[PATH_MAX];
+ setlocale(LC_ALL,"");
+ // Use the LOCALEDIR var for the directory
+ locale_dir=getenv("LOCALEDIR");
+
+ if (!locale_dir)
+ {
+ #ifdef NoHomeOrientedOS
+ // if LOCALEDIR doesn't exists use %DJDIR%/share/locale
+ locale_dir=getenv("DJDIR");
+ if (locale_dir)
+ {
+ strcpy(localedir,locale_dir);
+ strcat(localedir,"/share/locale");
+ }
+ else
+ {
+ // if DJDIR doesn't exists use SET_FILES
+ locale_dir=(char *)getenv("SET_FILES");
+ if (locale_dir)
+ strcpy(localedir,locale_dir);
+ else
+ {
+ // if SET_FILES doesn't exists (imposible) use .
+ // That's only to avoid a GPF in the strcpy and add a little facility
+ localedir[0]='.';
+ localedir[1]=0;
+ }
+ }
+ #else
+ strcpy(localedir,"/usr/share/locale");
+ #endif
+ }
+ else
+ strcpy(localedir,locale_dir);
+
+ BINDTEXTDOMAIN(EditorFile,localedir);
+ TEXTDOMAIN(EditorFile);
+ #endif
+ //------ end of int. support
+}
+
+// Dummy for gzfiles.cc
+int GiveAdvice(int number)
+{
+ return number;
+}
+
+int main(int argc, char *argv[])
+{
+ TEditorMiApp *editorApp;
+ List=new TInfViewList();
+
+ // Initialize the INFOPATH stuff
+ InfViewGetInfoDir();
+ InitInternacSup();
+ ParseCommandLine(argc,argv);
+
+ editorApp=new TEditorMiApp();
+ TScreen::setWindowTitle("InfView");
+ if (FileToLoad)
+ {
+ OpenInfView(editorApp,FileToLoad);
+ if (JumpTo)
+ startInfo->viewer->switchToTopic(JumpTo);
+ }
+ while (CLY_optind<argc)
+ {
+ if (!FileToLoad)
+ {// First parameter is the info file if no --file option was provided
+ FileToLoad=argv[CLY_optind];
+ OpenInfView(editorApp,FileToLoad);
+ if (JumpTo)
+ startInfo->viewer->switchToTopic(JumpTo);
+ }
+ else
+ {// The rest are cross references
+ if (startInfo && startInfo->viewer)
+ {
+ if (!startInfo->viewer->jumpXRefPartial(argv[CLY_optind],jmpXRSubStr | bestMVisibleName) &&
+ // Try with the node name instead of the visible name:
+ !startInfo->viewer->jumpXRefPartial(argv[CLY_optind],jmpXRSubStr))
+ {
+ messageBox(mfOKButton | mfError,__("Could not find '%s'."),argv[CLY_optind]);
+ break;
+ }
+ }
+ }
+ CLY_optind++;
+ }
+ if (JumpTo && !FileToLoad && *JumpTo=='(')
+ {
+ OpenInfView(editorApp,"dir");
+ startInfo->viewer->switchToTopic(JumpTo);
+ }
+
+ CreateDesktopNames(argv[0]);
+ editorApp->retrieveDesktop(desktopIn,startInfo==0);
+ editorApp->run();
+ editorApp->saveDesktop(desktopOut);
+ CLY_destroy(editorApp);
+
+ return 0;
+}
+END_OF_MAIN();
+
diff --git a/setedit/infview/infmenu.cc b/setedit/infview/infmenu.cc
new file mode 100644
index 0000000..3effad3
--- /dev/null
+++ b/setedit/infview/infmenu.cc
@@ -0,0 +1,100 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+#define Uses_TApplication
+#define Uses_TMenuBar
+#define Uses_TRect
+#define Uses_TSubMenu
+#define Uses_TKeys
+#define Uses_TKeys
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TPoint
+#define Uses_TEditor
+#define Uses_MsgBox
+#define Uses_TFileDialog
+#define Uses_TDeskTop
+// InfView requests
+#include <infr.h>
+
+#define Uses_TCEditor_Commands
+#include <ceditor.h>
+
+#include <stdarg.h>
+#include "infalone.h"
+#include "inf.h"
+
+TMenuBar *TEditorMiApp::initMenuBar( TRect r )
+{
+ TSubMenu& sub1 = *new TSubMenu( __("~F~ile"), kbAltF ) +
+ *new TMenuItem( __("~N~ew InfView window"), cmInfView, kbNoKey ) +
+ *new TMenuItem( __("~O~pen info file"), cmInfMainOpen, kbF3, hcNoContext, "F3" ) +
+ *new TMenuItem( __("Open ~m~anpage"), cmManPage, kbF4, hcNoContext, "F4" ) +
+ #if defined(TVOS_DOS) || (defined(TVOS_Win32) && !defined(TVCompf_Cygwin))
+ *new TMenuItem( __("~D~OS shell"), cmCallShell, kbNoKey ) +
+ #else
+ *new TMenuItem( __("S~h~ell"), cmCallShell, kbNoKey ) +
+ #endif
+ *new TMenuItem( __("E~x~it"), cmQuit, kbAltX, hcNoContext, "Alt+X" );
+
+ TSubMenu& sub1_5 = *new TSubMenu( __("~E~dit"), kbAltE ) +
+ *new TMenuItem( __("~C~opy"), cmcCopyClipWin, kbCtrlIns, hcNoContext, "Ctrl+Ins");
+
+ TSubMenu& sub2 = *new TSubMenu( __("~G~oto"), kbAltG ) +
+ *new TMenuItem( __("Goto: (~F~ile)Node"), cmInfGoto, kbCtrlG, hcNoContext, "Ctrl+G" ) +
+ *new TMenuItem( __("~N~ode list"), cmInfNodes, kbCtrlO, hcNoContext, "Ctrl+O" ) +
+ *new TMenuItem( __("N~e~xt node"), cmhNext, kbCtrlN, hcNoContext, "Ctrl+N" ) +
+ *new TMenuItem( __("~P~revious node"), cmhPrev, kbCtrlP, hcNoContext, "Ctrl+P" ) +
+ *new TMenuItem( __("~U~pper node"), cmhUp, kbCtrlU, hcNoContext, "Ctrl+U" ) +
+ *new TMenuItem( __("~T~op node"), cmInfTop, kbCtrlT, hcNoContext, "Ctrl+T" ) +
+ *new TMenuItem( __("~D~irectory"), cmInfDir, kbCtrlD, hcNoContext, "Ctrl+D" );
+
+ TSubMenu& sub3 = *new TSubMenu( __("~S~earch"), kbAltS ) +
+ *new TMenuItem( __("~S~earch"), cmcFind, kbCtrlS, hcNoContext, "Ctrl+S" ) +
+ *new TMenuItem( __("Search ~a~gain"), cmcSearchAgain, kbCtrlL, hcNoContext, "Ctrl+L");
+
+ TSubMenu& sub4 = *new TSubMenu( __("~I~nfview"), kbAltI ) +
+ *new TMenuItem( __("~C~onfiguration"), cmhConfigDia, kbNoKey ) +
+ *new TMenuItem( __("~H~istory"), cmInfControl, kbAltF10, hcNoContext, "Alt+F10") +
+ *new TMenuItem( __("~B~ookmarks"), cmInfBookM, kbCtrlB, hcNoContext, "Ctrl+B") +
+ *new TMenuItem( __("~S~creen configuration"), cmScreenConf, kbNoKey ) +
+ *new TMenuItem( __("~A~bout"), cmAbout, kbNoKey);
+
+ TSubMenu& sub5 = *new TSubMenu( __("~W~indows"), kbAltW ) +
+ *new TMenuItem( __("~S~ize/move"),cmResize, kbCtrlF5, hcNoContext, "Ctrl+F5" ) +
+ *new TMenuItem( __("~Z~oom"), cmZoom, kbF5, hcNoContext, "F5" ) +
+ *new TMenuItem( __("~T~ile"), cmTile, kbNoKey ) +
+ *new TMenuItem( __("C~a~scade"), cmCascade, kbNoKey ) +
+ *new TMenuItem( __("~N~ext"), cmNext, kbF6, hcNoContext, "F6" ) +
+ *new TMenuItem( __("~P~revious"), cmPrev, kbShiftF6, hcNoContext, "Shift+F6" ) +
+ *new TMenuItem( __("~C~lose"), cmClose, kbAltF3, hcNoContext, "Alt+F3" );
+
+ r.b.y = r.a.y+1;
+ return new TMenuBar(r, sub1+sub1_5+sub2+sub3+sub4+sub5);
+}
+
+TStatusLine *TEditorMiApp::initStatusLine( TRect r )
+{
+ r.a.y = r.b.y-1;
+ return new TStatusLine( r,
+ *new TStatusDef( hcInfView, hcInfView ) +
+ *new TStatusItem(__("~Alt+F1~ Back"), kbAltF1, cmInfBack ) +
+ *new TStatusItem(__("~Alt+F10~ Control"), kbAltF10, cmInfControl ) +
+ *new TStatusItem(__("~F1~ Help"), kbF1, cmInfHelp ) +
+ *new TStatusItem(__("~Ctrl+O~ Index"), kbCtrlO, cmInfNodes ) +
+ *new TStatusItem( __("~F5~ Zoom"), kbF5, cmZoom ) +
+ *new TStatusDef( 0, 0xFFFF ) +
+ *new TStatusItem( __("~F5~ Zoom"), kbF5, cmZoom ) +
+ *new TStatusItem( __("~F6~ Next"), kbF6, cmNext ) +
+ *new TStatusItem( __("~F10~ Menu"), kbF10, cmMenu ) +
+ *new TStatusItem( 0, kbCtrlF5, cmResize )
+ );
+}
+
+void TEditorMiApp::outOfMemory()
+{
+ messageBox(__("Not enough memory for this operation."), mfError | mfOKButton );
+}
+
diff --git a/setedit/infview/manview.cc b/setedit/infview/manview.cc
new file mode 100644
index 0000000..189f375
--- /dev/null
+++ b/setedit/infview/manview.cc
@@ -0,0 +1,798 @@
+/* Copyright (C) 1999-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_string
+#define Uses_sys_stat
+#define Uses_AllocLocal
+#define Uses_TScroller
+#define Uses_TNSCollection
+#define Uses_TWindow
+#define Uses_TRect
+#define Uses_TPalette
+#define Uses_TEvent
+#define Uses_TFrame
+#define Uses_TScrollBar
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TVCodePage
+#define Uses_TScreen
+
+#define Uses_TSLabel
+#define Uses_TSVeGroup
+#define Uses_TSInputLine
+#define Uses_TSButton
+#define Uses_TVOSClipboard
+#define Uses_MsgBox
+
+#define Uses_TCEditor_Commands
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_TEnhancedText
+#define Uses_TManPageView
+#define Uses_TManWindow
+
+#include <manview.h>
+
+#include <dyncat.h>
+#include <diaghelp.h>
+#include <rhutils.h>
+#include <codepage.h>
+
+static const char *ExtraOps;
+
+// Maximun width of a line in a man page, 256 should be more than enough
+int TEnhancedText::maxWidth=255;
+
+static char *CreateTempManPage(char *str);
+static char *CreateCommandLine(const char *file, const char *sections);
+
+TEnhancedText::TEnhancedText(const char *aFileName, const char *aCommandLine) :
+ TNSCollection(25,25)
+{
+ fileName=newStr(aFileName);
+ commandLine=newStr(aCommandLine);
+ isOK=1;
+ rows=cols=0;
+ xSelStart=ySelStart=xSelEnd=ySelEnd=0;
+
+ FILE *f=fopen(aFileName,"rt");
+ if (!f)
+ isOK=0;
+ else
+ {
+ char *s;
+ int count;
+ AllocLocalStr(buf,maxWidth+1);
+ AllocLocalStr(line,maxWidth*2);
+
+ while (fgets(buf,maxWidth,f))
+ {// Parse it and create a character/attribute string
+ int x=0;
+ for (count=0, s=buf; *s!='\n' && *s!=0; s++)
+ {
+ if (s[0]==8)
+ {
+ if (count && s[1]) // Be sure we won't use -1, you never know
+ {
+ if (s[-1]=='_')
+ {
+ line[(count-1)*2+1]=2;
+ line[(count-1)*2]=s[1];
+ }
+ else
+ // Is that true?
+ line[(count-1)*2+1]=1;
+ s++;
+ }
+ }
+ else
+ {
+ if (*s!='\t')
+ {
+ line[count*2]=*s;
+ line[count*2+1]=0;
+ count++;
+ x++;
+ }
+ else
+ {
+ int size=8-x%8;
+ x+=size;
+ while (size--)
+ {
+ line[count*2]=' ';
+ line[count*2+1]=0;
+ count++;
+ }
+ }
+ }
+ }
+ LineOfEText *l=(LineOfEText *)new char[sizeof(LineOfEText)+count*2];
+ l->len=count;
+ memcpy(l->text,line,count*2);
+ insert(l);
+ rows++;
+ if (count>cols)
+ cols=count;
+ }
+ fclose(f);
+ }
+}
+
+void TEnhancedText::copyLine(int y, int w, ushort *line, char *colors)
+{
+ ushort space;
+ uchar *aux;
+ aux=(uchar *)&space;
+ aux[0]=' ';
+ aux[1]=colors[0];
+ aux=(uchar *)line;
+ int width=w;
+
+ int i;
+ if (y>=getCount())
+ for (i=0; i<w; i++) line[i]=space;
+ else
+ {
+ LineOfEText *l=(LineOfEText *)at(y);
+ if (l->len)
+ {
+ int len=min((int)l->len,w);
+ char *d=(char *)line;
+ char *s=(char *)l->text;
+ for (i=0; i<len/*w*/; i++)
+ {
+ d[i*2]=s[i*2];
+ d[i*2+1]=colors[s[i*2+1]];
+ }
+ w-=len;
+ line+=len;
+ }
+ if (w)
+ for (i=0; i<w; i++) line[i]=space;
+ }
+ // Selection post-processing
+ if (y>=ySelStart && y<=ySelEnd)
+ {
+ //fprintf(stderr,"%d in %d-%d: ",y,ySelStart,ySelEnd);
+ int xs=0, xe=width;
+ if (y==ySelStart) xs=xSelStart;
+ if (xs>width) xs=width;
+ if (y==ySelEnd) xe=xSelEnd;
+ if (xe>width) xe=width;
+ //fprintf(stderr,"%d a %d\n",xs,xe);
+ while (xs<xe)
+ {
+ aux[xs*2+1]=(aux[xs*2+1] & 0xF) | 0x70;
+ xs++;
+ }
+ }
+}
+
+Boolean TEnhancedText::hasSelection()
+{
+ if (ySelStart<ySelEnd ||
+ (ySelStart==ySelEnd && xSelStart<xSelEnd))
+ return True;
+ return False;
+}
+
+void TEnhancedText::copyLineText(int y, int xs, int xe, char *dest)
+{
+ int i=xs;
+ LineOfEText *l=(LineOfEText *)at(y);
+ if (xs<(int)l->len)
+ {
+ char *s=(char *)l->text;
+ int xm=min((int)l->len,xe);
+ for (; i<xm; dest++, i++)
+ *dest=s[i*2];
+ }
+ for (; i<xe; dest++, i++)
+ *dest=' ';
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns a newly allocated buffer (new[]) containing the selected text. The
+size of the buffer is returned in the referenced variable.
+
+ Return: The selection or NULL if nothing is selected.
+
+***************************************************************************/
+
+char *TEnhancedText::getSelection(unsigned &len)
+{
+ if (!hasSelection())
+ {
+ len=0;
+ return NULL;
+ }
+ if (ySelStart==ySelEnd)
+ {
+ len=xSelEnd-xSelStart;
+ char *res=new char[len];
+ copyLineText(ySelStart,xSelStart,xSelEnd,res);
+ return res;
+ }
+ LineOfEText *l;
+ int y;
+ len=ySelEnd-ySelStart;
+ // Bytes in the first line
+ l=(LineOfEText *)at(ySelStart);
+ len+=xSelStart<(int)l->len ? l->len-xSelStart : 0;
+ // In the middle lines
+ for (y=ySelStart+1; y<ySelEnd; y++)
+ {
+ l=(LineOfEText *)at(y);
+ len+=l->len;
+ }
+ // In last line
+ len+=xSelEnd;
+ // Allocate
+ char *dest=new char[len];
+ char *s=dest;
+ // Fill it
+ l=(LineOfEText *)at(ySelStart);
+ if (xSelStart<(int)l->len)
+ {
+ copyLineText(ySelStart,xSelStart,l->len,s);
+ s+=l->len-xSelStart;
+ }
+ *s='\n'; s++;
+ for (y=ySelStart+1; y<ySelEnd; y++)
+ {
+ l=(LineOfEText *)at(y);
+ copyLineText(y,0,l->len,s);
+ s+=l->len;
+ *s='\n'; s++;
+ }
+ copyLineText(y,0,xSelEnd,s);
+
+ return dest;
+}
+
+TEnhancedText::~TEnhancedText()
+{
+ DeleteArray(fileName);
+ DeleteArray(commandLine);
+}
+
+TManPageView::TManPageView(const TRect& bounds, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar)
+ : TScroller(bounds,aHScrollBar,aVScrollBar)
+{
+ text=0;
+ options |=ofSelectable;
+ growMode =gfGrowHiX | gfGrowHiY;
+ lockCount=0;
+ mustBeRedrawed=False;
+}
+
+#define cManPage "\x06\x08\x09"
+
+void (*TManPageView::InsertRoutine)(char *b, long l)=NULL;
+
+TPalette& TManPageView::getPalette() const
+{
+ static TPalette palette(cManPage,sizeof(cManPage)-1);
+ return palette;
+}
+
+void TManPageView::getScrollBars(TScrollBar *&hScr, TScrollBar *&vScr)
+{
+ hScr=hScrollBar;
+ vScr=vScrollBar;
+}
+
+Boolean TManPageView::clipWinCopy(int id)
+{
+ Boolean res=False;
+ if (text && text->hasSelection())
+ {
+ if (!TVOSClipboard::isAvailable())
+ {
+ messageBox(__("Sorry but no OS specific clipboard is available"),mfError | mfOKButton);
+ return False;
+ }
+ unsigned len;
+ char *buffer=text->getSelection(len);
+ res=TVOSClipboard::copy(id,buffer,len) ? True : False;
+ DeleteArray(buffer);
+ if (!res)
+ {
+ messageBox(mfError | mfOKButton,__("Error copying to clipboard: %s"),
+ TVOSClipboard::getError());
+ return False;
+ }
+ }
+ return res;
+}
+
+void TManPageView::clipCopy()
+{
+ if (text && text->hasSelection())
+ {
+ unsigned len;
+ char *buffer=text->getSelection(len);
+ InsertRoutine(buffer,len);
+ DeleteArray(buffer);
+ }
+}
+
+void TManPageView::handleEvent( TEvent& event )
+{
+ TScroller::handleEvent(event);
+ if (event.what==evMouseDown && event.mouse.doubleClick && text)
+ {
+ TPoint mouse=makeLocal(event.mouse.where);
+ mouse.x+=delta.x;
+ mouse.y+=delta.y;
+ if (mouse.y<text->getCount())
+ {
+ LineOfEText *line=(LineOfEText *)text->at(mouse.y);
+ int len=line->len,start=mouse.x;
+ if (start<len)
+ {
+ uchar *s=(uchar *)&line->text;
+ int end;
+ // Ok, we have a pointer to the character under the cursor
+ for (end=start; end<len && !ucisspace(s[end*2]) && s[end*2]!=')'; end++);
+ if (s[end*2]==')')
+ { // Only if we have something like ....)
+ for (;start && !ucisspace(s[start*2]); start--);
+ if (ucisspace(s[start*2])) start++;
+ // OK, that's "something)", now copy it to a buffer
+ char *aux;
+ AllocLocalStr(name,end-start+2);
+ for (aux=name; start<=end; start++,aux++) *aux=s[start*2];
+ *aux=0;
+ // Check we have only one () pair
+ aux=strchr(name,'(');
+ if (aux)
+ { // We have "something(...)"
+ char *section=aux+1;
+ *aux=0;
+ for (aux++; *aux && *aux!='(' && *aux!=')'; aux++);
+ if (*aux==')' && !aux[1])
+ {
+ *aux=0;
+ // Try it.
+ char *cmd=CreateCommandLine(name,section);
+ char *tmp=CreateTempManPage(cmd);
+
+ InsertText(new TEnhancedText(tmp,cmd));
+ message(owner,evBroadcast,cmMPUpdateTitle,name);
+ scrollTo(0,0);
+ unlink(tmp);
+ free(cmd);
+ free(tmp);
+ drawView();
+ //printf("Man page: %s seccin: %s\n",name,section);
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (text && event.what==evMouseDown && event.mouse.buttons==mbLeftButton)
+ {// Mouse selection mechanism.
+ TPoint mouse=makeLocal(event.mouse.where)+delta;
+ int xSt=text->xSelStart=text->xSelEnd=mouse.x;
+ int ySt=text->ySelStart=text->ySelEnd=mouse.y;
+ draw();
+ TPoint last=mouse;
+ do
+ {
+ lock();
+ if (event.what==evMouseAuto)
+ {
+ mouse=makeLocal(event.mouse.where);
+ TPoint d=delta;
+ if (mouse.x<0)
+ d.x--;
+ if (mouse.x>=size.x)
+ d.x++;
+ if (mouse.y<0)
+ d.y--;
+ if (mouse.y>=size.y)
+ d.y++;
+ scrollTo(d.x,d.y);
+ mouse+=delta;
+ if (mouse!=last)
+ {
+ if (mouse.y<ySt || (mouse.y==ySt && mouse.x<xSt))
+ {
+ text->xSelStart=mouse.x;
+ text->ySelStart=mouse.y;
+ text->xSelEnd=xSt;
+ text->ySelEnd=ySt;
+ }
+ else
+ {
+ text->xSelStart=xSt;
+ text->ySelStart=ySt;
+ text->xSelEnd=mouse.x;
+ text->ySelEnd=mouse.y;
+ }
+ last=mouse;
+ //fprintf(stderr,"%d,%d - %d,%d\n",text->xSelStart,text->ySelStart,text->xSelEnd,text->ySelEnd);
+ draw();
+ }
+ }
+ unlock();
+ }
+ while (mouseEvent(event,evMouseMove+evMouseAuto));
+ clearEvent(event);
+ if (TVOSClipboard::isAvailable()>1)
+ clipWinCopy(1);
+ }
+ else if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmcCopyClipWin:
+ if (TVOSClipboard::isAvailable())
+ clipWinCopy(0);
+ break;
+ case cmcCopy:
+ if (InsertRoutine)
+ clipCopy();
+ break;
+ }
+ }
+}
+
+void TManPageView::setCmdState(uint16 command, Boolean enable)
+{
+ if (enable && (state & sfActive))
+ enableCommand(command);
+ else
+ disableCommand(command);
+}
+
+void TManPageView::updateCommands()
+{
+ if (!(state & sfActive))
+ { // We lost the focus, disable all
+ setCmdState(cmcCopyClipWin,False);
+ setCmdState(cmcCopy,False);
+ return;
+ }
+ Boolean sel=(text && text->hasSelection()) ? True : False;
+ setCmdState(cmcCopyClipWin,(TVOSClipboard::isAvailable() && sel) ? True : False);
+ setCmdState(cmcCopy,(InsertRoutine && sel) ? True : False);
+}
+
+void TManPageView::InsertText(TEnhancedText *aText)
+{
+ if (!aText || !aText->isOK)
+ return;
+ if (text)
+ CLY_destroy(text);
+ text=aText;
+ setLimit(aText->cols,aText->rows);
+ //drawView();
+}
+
+void TManPageView::unlock()
+{
+ if (lockCount>0)
+ {
+ lockCount--;
+ if (lockCount==0 && mustBeRedrawed)
+ drawView();
+ }
+}
+
+void TManPageView::draw()
+{
+ if (lockCount)
+ {
+ mustBeRedrawed=True;
+ return;
+ }
+ mustBeRedrawed=False;
+
+ char colors[3];
+ colors[0]=getColor(1);
+ colors[1]=getColor(2);
+ colors[2]=getColor(3);
+
+ int w=size.x+delta.x,y;
+ AllocLocalUShort(line,w+1);
+ if (!text || !text->isOK)
+ { // Draw an empty window if something went wrong
+ ushort space=' ' | (colors[0]<<8);
+ y=w;
+ while (y--)
+ line[y]=space;
+ for (y=0; y<size.y; y++)
+ writeLine(0,y,size.x,1,line);
+ return;
+ }
+
+ for (y=0; y<size.y; y++)
+ {
+ text->copyLine(y+delta.y,w,line,colors);
+ writeLine(0,y,size.x,1,line+delta.x);
+ }
+ if (state & sfActive)
+ updateCommands();
+}
+
+void TManPageView::setState(uint16 aState, Boolean enable)
+{
+ TScroller::setState(aState,enable);
+ if (aState==sfActive)
+ updateCommands();
+}
+
+TManPageView::~TManPageView()
+{
+ CLY_destroy(text);
+}
+
+void TManPageView::write(opstream& os)
+{
+ TScroller::write(os);
+ os.writeString(text->commandLine);
+}
+
+void *TManPageView::read(ipstream& is)
+{
+ TScroller::read(is);
+ char *aCommandLine=is.readString();
+
+ char *tmp=CreateTempManPage(aCommandLine);
+ InsertText(new TEnhancedText(tmp,aCommandLine));
+ unlink(tmp);
+ free(tmp);
+ DeleteArray(aCommandLine);
+ lockCount=0;
+ return this;
+}
+
+// New color: Like a cyan window plus 2 colors for bold and underline
+#define cManWindow "\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93"
+
+TPalette& TManWindow::getPalette() const
+{
+ static TPalette palette(cManWindow,sizeof(cManWindow)-1);
+ return palette;
+}
+
+
+static TRect defaultSizeWindow;
+static
+TRect &getDefaultSizeWindow()
+{
+ defaultSizeWindow.a.x=0;
+ defaultSizeWindow.a.y=0;
+ defaultSizeWindow.b.x=GetDeskTopCols()-4;
+ defaultSizeWindow.b.y=GetDeskTopRows()-4;
+ return defaultSizeWindow;
+}
+
+TManWindow::TManWindow(const char *fileName, const char *name,
+ char *aCommandLine, void (*ir)(char *b, long l)) :
+ TWindowInit(&TManWindow::initFrame),
+ TWindow(getDefaultSizeWindow(),name,wnNoNumber)
+{
+ TRect r=getDefaultSizeWindow();
+ options|=ofCentered;
+ r.grow(-1,-1);
+
+ hScrollBar=standardScrollBar(sbHorizontal | sbHandleKeyboard);
+ vScrollBar=standardScrollBar(sbVertical | sbHandleKeyboard);
+ page=new TManPageView(r,hScrollBar,vScrollBar);
+ page->InsertText(new TEnhancedText(fileName,aCommandLine));
+ page->InsertRoutine=ir;
+ unlink(fileName);
+ insert(page);
+ helpCtx=hcManPage;
+}
+
+TManWindow::TManWindow(StreamableInit) :
+ TWindowInit(NULL),
+ TWindow(streamableInit)
+{
+ page=0;
+}
+
+void TManWindow::handleEvent(TEvent& event)
+{
+ TWindow::handleEvent(event);
+ if (event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmMPUpdateTitle:
+ DeleteArray((char *)title);
+ title=newStr((char *)event.message.infoPtr);
+ frame->draw();
+ break;
+ }
+ }
+ else if (event.what==evKeyDown && event.keyDown.keyCode==kbEsc)
+ close();
+}
+
+// These members are needed to initialize page propperly
+// Note that page is saved *once*, not twice (from group and explicit)
+void TManWindow::write(opstream &os)
+{
+ options&=~ofCentered;
+ TWindow::write(os);
+ os << page;
+}
+
+void *TManWindow::read(ipstream &is)
+{
+ TWindow::read(is);
+ is >> page;
+ page->getScrollBars(hScrollBar,vScrollBar);
+ return this;
+}
+
+
+static
+int isEmpty(const char *str)
+{
+ if (!str) return 1;
+ for (; *str; str++)
+ {
+ if (!isspace((unsigned char)*str));
+ return 0;
+ }
+ return 1;
+}
+
+static
+char *CreateTempManPage(char *str)
+{
+ DynStrCatStruct st;
+
+ char *tmp=unique_name("man");
+ char *tmpErr=open_stderr();
+ DynStrCatInit(&st,str);
+ DynStrCat(&st," > ");
+ DynStrCat(&st,tmp);
+ TScreen::System(st.str);
+ free(st.str);
+ close_stderr();
+
+ struct stat s;
+ if (::stat(tmp,&s)!=0 || s.st_size==0)
+ {// No stdout info
+ unlink(tmp);
+ free(tmp);
+ return strdup(tmpErr);
+ }
+ unlink(tmpErr);
+ //free(tmpErr); Nope, io.cc makes it
+ return tmp;
+}
+
+static
+char *CreateCommandLine(const char *file, const char *sections)
+{
+ DynStrCatStruct st;
+
+ DynStrCatInit(&st,"man");
+ if (ExtraOps && !isEmpty(ExtraOps))
+ {
+ DynStrCat(&st," ");
+ DynStrCat(&st,(char *)ExtraOps);
+ }
+ if (sections && !isEmpty(sections))
+ {
+ #ifdef TVCompf_djgpp
+ DynStrCat(&st," -s ");
+ #else
+ DynStrCat(&st," -S ");
+ #endif
+ DynStrCat(&st,(char *)sections);
+ }
+ DynStrCat(&st," ");
+ DynStrCat(&st,(char *)file);
+
+ return st.str;
+}
+
+TManWindow *CreateManWindow(const char *file, const char *sections,
+ const char *extraOps, void (*ir)(char *b, long l))
+{
+ ExtraOps=extraOps;
+ char *cmd=CreateCommandLine(file,sections);
+ char *tmp=CreateTempManPage(cmd);
+
+ TManWindow *ret=new TManWindow(tmp,file,cmd,ir);
+ free(cmd);
+ free(tmp);
+
+ return ret;
+}
+
+#if defined(SEOS_DOS) || defined(SEOS_Win32)
+/*
+ This routine checks if man is there. If we can't find it we must put a warning
+*/
+#ifdef TVComp_BCPP
+//$todo: Check it better (to SAA)
+#define RET_OK 0
+#else
+#define RET_OK 1
+#endif
+
+int CheckForMan(void)
+{
+ static int isManInstalled=0;
+
+ if (!isManInstalled)
+ {
+ char *err=open_stdout();
+ int ret=TScreen::System("man");
+ close_stdout();
+ unlink(err);
+
+ if (ret==1)
+ isManInstalled=RET_OK;
+ else
+ messageBox(__("You must install man to use it!"), mfError | mfOKButton);
+ }
+
+ return isManInstalled;
+}
+#else
+int CheckForMan(void)
+{
+ return 1;
+}
+#endif
+
+/*****************************************************************************
+
+ Dialog used to select the manpage
+
+*****************************************************************************/
+
+ManPageOptions op={"setedit","",""};
+extern char *strncpyZ(char *dest, const char *orig, int size);
+
+TDialog *ManPageViewSelect(const char *name, ManPageOptions **mpo)
+{
+ if (!CheckForMan())
+ return 0;
+
+ if (name)
+ strncpyZ(op.program,name,80);
+
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Man page to view")));
+
+ TSVeGroup *options=
+ MakeVeGroup(new TSLabel(__("~M~an page for ..."),new TSInputLine(prgLen,visibleLen)),
+ new TSLabel(__("~S~ection"),new TSInputLine(sectLen,visibleLen)),
+ new TSLabel(__("~E~xtra options"),new TSInputLine(extraLen,visibleLen)),
+ 0);
+
+ col->insert(2,2,options);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+
+ *mpo=&op;
+ return d;
+}
+
diff --git a/setedit/infview/names/nhiscoll.cc b/setedit/infview/names/nhiscoll.cc
new file mode 100644
index 0000000..85129c1
--- /dev/null
+++ b/setedit/infview/names/nhiscoll.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <settvuti.h>
+n(THisCollection);
diff --git a/setedit/infview/names/ninfview.cc b/setedit/infview/names/ninfview.cc
new file mode 100644
index 0000000..df12c78
--- /dev/null
+++ b/setedit/infview/names/ninfview.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <settvuti.h>
+n(TInfViewer);
diff --git a/setedit/infview/names/ninfwind.cc b/setedit/infview/names/ninfwind.cc
new file mode 100644
index 0000000..1015459
--- /dev/null
+++ b/setedit/infview/names/ninfwind.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <settvuti.h>
+n(TInfWindow);
diff --git a/setedit/infview/names/nmanwind.cc b/setedit/infview/names/nmanwind.cc
new file mode 100644
index 0000000..2201033
--- /dev/null
+++ b/setedit/infview/names/nmanwind.cc
@@ -0,0 +1,6 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <settvuti.h>
+n(TManWindow);
+n(TManPageView);
diff --git a/setedit/infview/streams/sinf.cc b/setedit/infview/streams/sinf.cc
new file mode 100644
index 0000000..9d37cbe
--- /dev/null
+++ b/setedit/infview/streams/sinf.cc
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*------------------------------------------------------------*/
+/* filename - sinf.cc */
+/* */
+/* Registration objects for the following classes: */
+/* TInfViewer */
+/* TInfWindow */
+/* THisCollection */
+/*------------------------------------------------------------*/
+
+/*------------------------------------------------------------*/
+/* */
+/* Needed to write the objects to a stream. */
+/* */
+/*------------------------------------------------------------*/
+
+#include <tvsetuti.h>
+#define Uses_TStreamableClass
+// InfView requests
+#include <infr.h>
+#include <settvuti.h>
+#include <inf.h>
+
+__link( RView )
+__link( RWindow )
+__link( RScrollBar )
+__link( RScroller )
+__link( RNoCaseStringCollection )
+
+s(InfViewer);
+s(InfWindow);
+s(HisCollection);
+
diff --git a/setedit/infview/streams/sman.cc b/setedit/infview/streams/sman.cc
new file mode 100644
index 0000000..30c3c0d
--- /dev/null
+++ b/setedit/infview/streams/sman.cc
@@ -0,0 +1,20 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <tvsetuti.h>
+#define Uses_TStreamableClass
+#define Uses_TWindow
+#define Uses_TScroller
+#define Uses_TNSCollection
+#include <tv.h>
+#define Uses_TManWindow
+#define Uses_TManPageView
+#define Uses_TEnhancedText
+#include <manview.h>
+
+__link( RView )
+__link( RWindow )
+__link( RScrollBar )
+__link( RScroller )
+
+s(ManWindow);
+s(ManPageView);
diff --git a/setedit/infview/version.txt b/setedit/infview/version.txt
new file mode 100644
index 0000000..a45be46
--- /dev/null
+++ b/setedit/infview/version.txt
@@ -0,0 +1 @@
+0.2.8
diff --git a/setedit/install/.cvsignore b/setedit/install/.cvsignore
new file mode 100644
index 0000000..773a6df
--- /dev/null
+++ b/setedit/install/.cvsignore
@@ -0,0 +1 @@
+*.dat
diff --git a/setedit/install/create.pl b/setedit/install/create.pl
new file mode 100644
index 0000000..8e2a885
--- /dev/null
+++ b/setedit/install/create.pl
@@ -0,0 +1,96 @@
+#!/usr/bin/perl
+# Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+# Configuration options:
+$usePMode=0;
+
+open(FIL,'../version.txt') || die;
+$version=<FIL>;
+chop($version);
+close(FIL);
+$version1=$version;
+$version1=~ s/\.//g;
+$dirResult='../makes/djgpp/result/';
+$dirDist='../makes/djgpp/distrib/';
+$dirManifest=$dirDist.'manifest';
+$djdir=$ENV{'DJDIR'};
+
+$bindist=$dirResult.'edi'.$version1.'b.zip';
+$instdist=$dirResult.'edi'.$version1.'i.zip';
+print "Creating the installation distribution ...\n";
+if (!(-e $instdist) || (-M $bindist < -M $instdist) || (-M 'install.exe' < -M $instdist))
+ { # Ok, we must redo it
+ # .dat file
+ $d='install.dat';
+ if (!(-e $d) || (-M $bindist < -M $d))
+ {
+ open(FIL,"$dirManifest/edi$version1"."b.mft");
+ @files=<FIL>;
+ close(FIL);
+ $list="";
+ foreach $i (@files)
+ {
+ # Internationalization files have all the same name, avoid it
+ if ($i=~/share\/locale\/(.*)\/LC_MESSAGES\/setedit.mo/)
+ {
+ system("cp $dirDist$i $1".'setedit.mo');
+ $list.=$1.'setedit.mo ';
+ }
+ else
+ {
+ $list.=$dirDist.$i.' ';
+ }
+ }
+ system("dat -a -s1 -c0 -k -t DATA $d $list $djdir/bin/cwsdpmi.exe $djdir/bin/cwsdpmi.doc $djdir/bin/emu387.dxe");
+ # Cleanup temporal files
+ foreach $i (@files)
+ {
+ if ($i=~/share\/locale\/(.*)\/LC_MESSAGES\/setedit.mo/)
+ {
+ system("rm $1".'setedit.mo');
+ }
+ }
+ die 'Error creating .dat file' unless (-e $d);
+ }
+ # simple test
+ $d='install.exe';
+ die 'The install.exe is missing?!' unless (-e $d);
+ system("upx $d");
+ if ($usePMode)
+ {
+ trySystem("exe2coff $d");
+ $stub="$djdir/bin/pmodstub.exe";
+ $stub =~ s/\//\\/g;
+ trySystem("copy /B $stub + install $d");
+ unlink('install');
+ $dpmi='';
+ }
+ else
+ {
+ trySystem("cp $djdir/bin/cwsdpmi.exe .");
+ $dpmi='cwsdpmi.exe';
+ }
+ trySystem("exedat $d install.dat");
+ trySystem("cp $djdir/bin/emu387.dxe .");
+ trySystem("zip -9 $instdist $d emu387.dxe $dpmi");
+ unlink('emu387.dxe');
+ trySystem("mkdir es");
+ trySystem("mkdir es\\LC_MESSAGES");
+ trySystem("cp ../internac/es.mo es/LC_MESSAGES/install.mo");
+ trySystem("mkdir de");
+ trySystem("mkdir de\\LC_MESSAGES");
+ trySystem("cp ../internac/de.mo de/LC_MESSAGES/install.mo");
+ trySystem("zip -9rm $instdist es de");
+ }
+else
+ {
+ print "Is uptodate\n";
+ }
+
+sub trySystem
+{
+ print "Running $_[0]\n";
+ system($_[0]) and die "Error running $_[0]\n";
+}
diff --git a/setedit/install/datafile.c b/setedit/install/datafile.c
new file mode 100644
index 0000000..ee08827
--- /dev/null
+++ b/setedit/install/datafile.c
@@ -0,0 +1,1059 @@
+/* ______ ___ ___
+ * /\ _ \ /\_ \ /\_ \
+ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
+ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
+ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
+ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
+ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
+ * /\____/
+ * \_/__/
+ * By Shawn Hargreaves
+ * shawn@talula.demon.co.uk
+ * http://www.talula.demon.co.uk/allegro/
+ *
+ * Datafile reading routines.
+ *
+ * See readme.txt for copyright information.
+ */
+
+ /* This file was modified to save around 140 Kb of code in the installer,
+ if you need to use another version of Allegro you can remove this file
+ from the project and use the version provided with the library */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#ifdef DJGPP
+#include <sys/segments.h>
+#endif
+
+//#include "internal.h"
+#include <allegro.h>
+
+#if ALLEGRO_VERSION<4 && !defined(ALLEGRO_WIP_VERSION)
+/* data file ID's for compatibility with the old datafile format */
+#define V1_DAT_MAGIC 0x616C6C2EL
+
+#define V1_DAT_DATA 0
+#define V1_DAT_FONT 1
+#define V1_DAT_BITMAP_16 2
+#define V1_DAT_BITMAP_256 3
+#define V1_DAT_SPRITE_16 4
+#define V1_DAT_SPRITE_256 5
+#define V1_DAT_PALLETE_16 6
+#define V1_DAT_PALLETE_256 7
+#define V1_DAT_FONT_8x8 8
+#define V1_DAT_FONT_PROP 9
+#define V1_DAT_BITMAP 10
+#define V1_DAT_PALLETE 11
+#define V1_DAT_SAMPLE 12
+#define V1_DAT_MIDI 13
+#define V1_DAT_RLE_SPRITE 14
+#define V1_DAT_FLI 15
+#define V1_DAT_C_SPRITE 16
+#define V1_DAT_XC_SPRITE 17
+
+#define OLD_FONT_SIZE 95
+
+/* information about a datafile object */
+typedef struct DATAFILE_TYPE
+{
+ int type;
+ void *(*load)(PACKFILE *f, long size);
+ void (*destroy)();
+} DATAFILE_TYPE;
+
+
+#define MAX_DATAFILE_TYPES 32
+extern DATAFILE_TYPE datafile_type[MAX_DATAFILE_TYPES];
+
+
+/* read_block:
+ * Reads a block of size bytes from a file, allocating memory to store it.
+ */
+static void *read_block(PACKFILE *f, int size, int alloc_size)
+{
+ void *p;
+
+ p = malloc(MAX(size, alloc_size));
+ if (!p) {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ pack_fread(p, size, f);
+
+ if (pack_ferror(f)) {
+ free(p);
+ return NULL;
+ }
+
+ return p;
+}
+
+/* read_old_datafile:
+ * Helper for reading old-format datafiles (only needed for backward
+ * compatibility).
+ */
+static DATAFILE *read_old_datafile(PACKFILE *f)
+{
+ DATAFILE *dat;
+ int size;
+ int type;
+ int c;
+
+ size = pack_mgetw(f);
+ if (errno) {
+ pack_fclose(f);
+ return NULL;
+ }
+
+ dat = malloc(sizeof(DATAFILE)*(size+1));
+ if (!dat) {
+ pack_fclose(f);
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ for (c=0; c<=size; c++) {
+ dat[c].type = DAT_END;
+ dat[c].dat = NULL;
+ dat[c].size = 0;
+ dat[c].prop = NULL;
+ }
+
+ for (c=0; c<size; c++) {
+
+ type = pack_mgetw(f);
+
+ switch (type) {
+
+ case V1_DAT_FONT:
+ case V1_DAT_FONT_8x8:
+ dat[c].type = DAT_FONT;
+ //dat[c].dat = read_font_fixed(f, 8, OLD_FONT_SIZE);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_FONT_PROP:
+ dat[c].type = DAT_FONT;
+ //dat[c].dat = read_font_prop(f, OLD_FONT_SIZE);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_BITMAP:
+ case V1_DAT_BITMAP_256:
+ dat[c].type = DAT_BITMAP;
+ //dat[c].dat = read_bitmap(f, 8, TRUE);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_BITMAP_16:
+ dat[c].type = DAT_BITMAP;
+ //dat[c].dat = read_bitmap(f, 4, FALSE);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_SPRITE_256:
+ dat[c].type = DAT_BITMAP;
+ pack_mgetw(f);
+ //dat[c].dat = read_bitmap(f, 8, TRUE);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_SPRITE_16:
+ dat[c].type = DAT_BITMAP;
+ pack_mgetw(f);
+ //dat[c].dat = read_bitmap(f, 4, FALSE);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_PALLETE:
+ case V1_DAT_PALLETE_256:
+ dat[c].type = DAT_PALLETE;
+ //dat[c].dat = read_pallete(f, PAL_SIZE);
+ dat[c].size = sizeof(PALLETE);
+ break;
+
+ case V1_DAT_PALLETE_16:
+ dat[c].type = DAT_PALLETE;
+ //dat[c].dat = read_pallete(f, 16);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_SAMPLE:
+ dat[c].type = DAT_SAMPLE;
+ //dat[c].dat = read_sample(f);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_MIDI:
+ dat[c].type = DAT_MIDI;
+ //dat[c].dat = read_midi(f);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_RLE_SPRITE:
+ dat[c].type = DAT_RLE_SPRITE;
+ //dat[c].dat = read_rle_sprite(f, 8);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_FLI:
+ dat[c].type = DAT_FLI;
+ dat[c].size = pack_mgetl(f);
+ dat[c].dat = read_block(f, dat[c].size, 0);
+ break;
+
+ case V1_DAT_C_SPRITE:
+ dat[c].type = DAT_C_SPRITE;
+ //dat[c].dat = read_compiled_sprite(f, FALSE, 8);
+ dat[c].size = 0;
+ break;
+
+ case V1_DAT_XC_SPRITE:
+ dat[c].type = DAT_XC_SPRITE;
+ //dat[c].dat = read_compiled_sprite(f, TRUE, 8);
+ dat[c].size = 0;
+ break;
+
+ default:
+ dat[c].type = DAT_DATA;
+ dat[c].size = pack_mgetl(f);
+ dat[c].dat = read_block(f, dat[c].size, 0);
+ break;
+ }
+
+ if (errno) {
+ if (!dat[c].dat)
+ dat[c].type = DAT_END;
+ unload_datafile(dat);
+ pack_fclose(f);
+ return NULL;
+ }
+ }
+
+ return dat;
+}
+
+
+
+/* load_data_object:
+ * Loads a binary data object from a datafile.
+ */
+void *load_data_object(PACKFILE *f, long size)
+{
+ return read_block(f, size, 0);
+}
+
+
+/* load_font_object:
+ * Loads a font object from a datafile.
+ */
+void *load_font_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* load_sample_object:
+ * Loads a sample object from a datafile.
+ */
+void *load_sample_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* load_midi_object:
+ * Loads a midifile object from a datafile.
+ */
+void *load_midi_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* load_bitmap_object:
+ * Loads a bitmap object from a datafile.
+ */
+void *load_bitmap_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* load_rle_sprite_object:
+ * Loads an RLE sprite object from a datafile.
+ */
+void *load_rle_sprite_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* load_compiled_sprite_object:
+ * Loads a compiled sprite object from a datafile.
+ */
+void *load_compiled_sprite_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* load_xcompiled_sprite_object:
+ * Loads a mode-X compiled object from a datafile.
+ */
+void *load_xcompiled_sprite_object(PACKFILE *f, long size)
+{
+ return 0;
+}
+
+/* unload_sample:
+ * Destroys a sample object.
+ */
+void unload_sample(SAMPLE *s)
+{
+}
+
+
+
+/* unload_midi:
+ * Destroys a MIDI object.
+ */
+void unload_midi(MIDI *m)
+{
+}
+
+
+/* load_object:
+ * Helper to load an object from a datafile.
+ */
+static void *load_object(PACKFILE *f, int type, long size)
+{
+ int i;
+
+ /* look for a load function */
+ for (i=0; i<MAX_DATAFILE_TYPES; i++)
+ if (datafile_type[i].type == type)
+ return datafile_type[i].load(f, size);
+
+ /* if not found, load binary data */
+ return load_data_object(f, size);
+}
+
+
+
+/* load_file_object:
+ * Loads a datafile object.
+ */
+void *load_file_object(PACKFILE *f, long size)
+{
+ #define MAX_PROPERTIES 64
+
+ DATAFILE_PROPERTY prop[MAX_PROPERTIES];
+ DATAFILE *dat;
+ int prop_count, count, type, c, d;
+
+ count = pack_mgetl(f);
+
+ dat = malloc(sizeof(DATAFILE)*(count+1));
+ if (!dat) {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ for (c=0; c<=count; c++) {
+ dat[c].type = DAT_END;
+ dat[c].dat = NULL;
+ dat[c].size = 0;
+ dat[c].prop = NULL;
+ }
+
+ for (c=0; c<MAX_PROPERTIES; c++)
+ prop[c].dat = NULL;
+
+ c = 0;
+ prop_count = 0;
+
+ while (c < count) {
+ type = pack_mgetl(f);
+
+ if (type == DAT_PROPERTY) {
+ /* load an object property */
+ type = pack_mgetl(f);
+ d = pack_mgetl(f);
+ if (prop_count < MAX_PROPERTIES) {
+ prop[prop_count].type = type;
+ prop[prop_count].dat = malloc(d+1);
+ if (prop[prop_count].dat != NULL) {
+ pack_fread(prop[prop_count].dat, d, f);
+ prop[prop_count].dat[d] = 0;
+ prop_count++;
+ d = 0;
+ }
+ }
+ while (d-- > 0)
+ pack_getc(f);
+ }
+ else {
+ /* load actual data */
+ f = pack_fopen_chunk(f, FALSE);
+ d = f->todo;
+
+ dat[c].dat = load_object(f, type, d);
+
+ if (dat[c].dat) {
+ dat[c].type = type;
+ dat[c].size = d;
+
+ if (prop_count > 0) {
+ dat[c].prop = malloc(sizeof(DATAFILE_PROPERTY)*(prop_count+1));
+ if (dat[c].prop != NULL) {
+ for (d=0; d<prop_count; d++) {
+ dat[c].prop[d].dat = prop[d].dat;
+ dat[c].prop[d].type = prop[d].type;
+ prop[d].dat = NULL;
+ }
+ dat[c].prop[d].dat = NULL;
+ dat[c].prop[d].type = DAT_END;
+ }
+ else {
+ for (d=0; d<prop_count; d++) {
+ free(prop[d].dat);
+ prop[d].dat = NULL;
+ }
+ }
+ prop_count = 0;
+ }
+ else
+ dat[c].prop = NULL;
+ }
+
+ f = pack_fclose_chunk(f);
+ c++;
+ }
+
+ if (errno) {
+ unload_datafile(dat);
+
+ for (c=0; c<MAX_PROPERTIES; c++)
+ if (prop[c].dat)
+ free(prop[c].dat);
+
+ return NULL;
+ }
+ }
+
+ for (c=0; c<MAX_PROPERTIES; c++)
+ if (prop[c].dat)
+ free(prop[c].dat);
+
+ return dat;
+}
+
+
+
+/* load_datafile:
+ * Loads an entire data file into memory, and returns a pointer to it.
+ * On error, sets errno and returns NULL.
+ */
+DATAFILE *load_datafile(char *filename)
+{
+ PACKFILE *f;
+ DATAFILE *dat;
+ int type;
+
+ f = pack_fopen(filename, F_READ_PACKED);
+ if (!f)
+ return NULL;
+
+ type = pack_mgetl(f);
+
+ if (type == V1_DAT_MAGIC) {
+ dat = read_old_datafile(f);
+ }
+ else {
+ if (type == DAT_MAGIC)
+ dat = load_file_object(f, 0);
+ else
+ dat = NULL;
+ }
+
+ pack_fclose(f);
+ return dat;
+}
+
+
+
+/* load_datafile_object:
+ * Loads a single object from a datafile.
+ */
+DATAFILE *load_datafile_object(char *filename, char *objectname)
+{
+ PACKFILE *f;
+ DATAFILE *dat = NULL;
+ void *object;
+ int type, size;
+ int use_next = FALSE;
+ char buf[256];
+
+ f = pack_fopen(filename, F_READ_PACKED);
+ if (!f)
+ return NULL;
+
+ type = pack_mgetl(f);
+
+ if (type != DAT_MAGIC)
+ goto getout;
+
+ pack_mgetl(f);
+
+ while (!pack_feof(f)) {
+ type = pack_mgetl(f);
+
+ if (type == DAT_PROPERTY) {
+ type = pack_mgetl(f);
+ size = pack_mgetl(f);
+ if (type == DAT_ID('N','A','M','E')) {
+ /* examine name property */
+ if (size > (int)(sizeof(buf)-1)) {
+ pack_fread(buf, sizeof(buf)-1, f);
+ buf[sizeof(buf)-1] = 0;
+ pack_fseek(f, size-(sizeof(buf)-1));
+ }
+ else {
+ pack_fread(buf, size, f);
+ buf[size] = 0;
+ }
+ if (stricmp(buf, objectname) == 0)
+ use_next = TRUE;
+ }
+ else {
+ /* skip property */
+ pack_fseek(f, size);
+ }
+ }
+ else {
+ if (use_next) {
+ /* load actual data */
+ f = pack_fopen_chunk(f, FALSE);
+ size = f->todo;
+ object = load_object(f, type, size);
+ f = pack_fclose_chunk(f);
+ if (object) {
+ dat = malloc(sizeof(DATAFILE));
+ if (dat != NULL) {
+ dat->dat = object;
+ dat->type = type;
+ dat->size = size;
+ dat->prop = NULL;
+ }
+ }
+ goto getout;
+ }
+ else {
+ /* skip unwanted object */
+ size = pack_mgetl(f);
+ pack_fseek(f, size+4);
+ }
+ }
+ }
+
+ getout:
+
+ pack_fclose(f);
+
+ return dat;
+}
+
+
+
+/* _unload_datafile_object:
+ * Helper to destroy a datafile object.
+ */
+void _unload_datafile_object(DATAFILE *dat)
+{
+ int i;
+
+ /* free the property list */
+ if (dat->prop) {
+ for (i=0; dat->prop[i].type != DAT_END; i++)
+ if (dat->prop[i].dat)
+ free(dat->prop[i].dat);
+
+ free(dat->prop);
+ }
+
+ /* look for a destructor function */
+ for (i=0; i<MAX_DATAFILE_TYPES; i++) {
+ if (datafile_type[i].type == dat->type) {
+ if (dat->dat) {
+ if (datafile_type[i].destroy)
+ datafile_type[i].destroy(dat->dat);
+ else
+ free(dat->dat);
+ }
+ return;
+ }
+ }
+
+ /* if not found, just free the data */
+ if (dat->dat)
+ free(dat->dat);
+}
+
+
+
+/* unload_datafile:
+ * Frees all the objects in a datafile.
+ */
+void unload_datafile(DATAFILE *dat)
+{
+ int i;
+
+ if (dat) {
+ for (i=0; dat[i].type != DAT_END; i++)
+ _unload_datafile_object(dat+i);
+
+ free(dat);
+ }
+}
+
+
+
+/* unload_datafile_object:
+ * Unloads a single datafile object, returned by load_datafile_object().
+ */
+void unload_datafile_object(DATAFILE *dat)
+{
+ if (dat) {
+ _unload_datafile_object(dat);
+ free(dat);
+ }
+}
+
+
+
+/* get_datafile_property:
+ * Returns the specified property string for the datafile object, or
+ * an empty string if the property does not exist.
+ */
+char *get_datafile_property(DATAFILE *dat, int type)
+{
+ DATAFILE_PROPERTY *prop = dat->prop;
+
+ if (prop) {
+ while (prop->type != DAT_END) {
+ if (prop->type == type)
+ return prop->dat;
+
+ prop++;
+ }
+ }
+
+ return "";
+}
+
+/* _construct_datafile:
+ * Helper used by the output from dat2s.exe, for fixing up parts of
+ * the data that can't be statically initialised, such as locking
+ * samples and MIDI files, and setting the segment selectors in the
+ * BITMAP structures.
+ */
+void _construct_datafile(DATAFILE *data)
+{
+ int c, c2;
+ SAMPLE *s;
+ MIDI *m;
+
+ for (c=0; data[c].type != DAT_END; c++) {
+
+ switch (data[c].type) {
+
+ case DAT_FILE:
+ _construct_datafile((DATAFILE *)data[c].dat);
+ break;
+
+ case DAT_BITMAP:
+ ((BITMAP *)data[c].dat)->seg = _my_ds();
+ break;
+
+ case DAT_FONT:
+ if (((FONT *)data[c].dat)->height < 0) {
+ for (c2=0; c2<FONT_SIZE; c2++)
+ ((FONT *)data[c].dat)->dat.dat_prop->dat[c2]->seg = _my_ds();
+ }
+ break;
+
+ case DAT_SAMPLE:
+ s = (SAMPLE *)data[c].dat;
+ LOCK_DATA(s, sizeof(SAMPLE));
+ LOCK_DATA(s->data, s->len * ((s->bits==8) ? 1 : sizeof(short)) * ((s->stereo) ? 2 : 1));
+ break;
+
+ case DAT_MIDI:
+ m = (MIDI *)data[c].dat;
+ LOCK_DATA(m, sizeof(MIDI));
+ for (c2=0; c2<MIDI_TRACKS; c2++)
+ if (m->track[c2].data)
+ LOCK_DATA(m->track[c2].data, m->track[c2].len);
+ break;
+ }
+ }
+}
+
+
+
+/* initialize_datafile_types:
+ * Register my loader functions with the code in dataregi.c.
+ */
+#ifdef __GNUC__
+/* alternatively called from allegro_init */
+static void initialize_datafile_types() __attribute__ ((constructor));
+static
+#endif
+void initialize_datafile_types()
+{
+ register_datafile_object(DAT_FILE, load_file_object, (void (*)(void *data))unload_datafile );
+}
+#else
+
+
+/*****************************************************************************
+
+ This is the same for Allegro 3.9.x
+
+*****************************************************************************/
+
+
+#if ALLEGRO_VERSION<4
+ #include "allegro/aintern.h"
+#else
+ #include "allegro/internal/aintern.h"
+ #define datafile_type _datafile_type
+#endif
+
+/* read_block:
+ * Reads a block of size bytes from a file, allocating memory to store it.
+ */
+static void *read_block(PACKFILE *f, int size, int alloc_size)
+{
+ void *p;
+
+ p = malloc(MAX(size, alloc_size));
+ if (!p) {
+ *allegro_errno = ENOMEM;
+ return NULL;
+ }
+
+ pack_fread(p, size, f);
+
+ if (pack_ferror(f)) {
+ free(p);
+ return NULL;
+ }
+
+ return p;
+}
+
+/* load_data_object:
+ * Loads a binary data object from a datafile.
+ */
+void *load_data_object(PACKFILE *f, long size)
+{
+ return read_block(f, size, 0);
+}
+
+/* load_object:
+ * Helper to load an object from a datafile.
+ */
+static void *load_object(PACKFILE *f, int type, long size)
+{
+ int i;
+
+ /* look for a load function */
+ for (i=0; i<MAX_DATAFILE_TYPES; i++)
+ if (datafile_type[i].type == type)
+ return datafile_type[i].load(f, size);
+
+ /* if not found, load binary data */
+ return load_data_object(f, size);
+}
+
+/* load_file_object:
+ * Loads a datafile object.
+ */
+void *load_file_object(PACKFILE *f, long size)
+{
+ #define MAX_PROPERTIES 64
+
+ DATAFILE_PROPERTY prop[MAX_PROPERTIES];
+ DATAFILE *dat;
+ PACKFILE *ff;
+ int prop_count, count, type, c, d;
+ char *p;
+
+ count = pack_mgetl(f);
+
+ dat = malloc(sizeof(DATAFILE)*(count+1));
+ if (!dat) {
+ *allegro_errno = ENOMEM;
+ return NULL;
+ }
+
+ for (c=0; c<=count; c++) {
+ dat[c].type = DAT_END;
+ dat[c].dat = NULL;
+ dat[c].size = 0;
+ dat[c].prop = NULL;
+ }
+
+ for (c=0; c<MAX_PROPERTIES; c++)
+ prop[c].dat = NULL;
+
+ c = 0;
+ prop_count = 0;
+
+ while (c < count) {
+ type = pack_mgetl(f);
+
+ if (type == DAT_PROPERTY) {
+ /* load an object property */
+ type = pack_mgetl(f);
+ d = pack_mgetl(f);
+ if (prop_count < MAX_PROPERTIES) {
+ prop[prop_count].type = type;
+ prop[prop_count].dat = malloc(d+1);
+ if (prop[prop_count].dat != NULL) {
+ pack_fread(prop[prop_count].dat, d, f);
+ prop[prop_count].dat[d] = 0;
+ if (need_uconvert(prop[prop_count].dat, U_UTF8, U_CURRENT)) {
+ p = malloc(uconvert_size(prop[prop_count].dat, U_UTF8, U_CURRENT));
+ if (p)
+ do_uconvert(prop[prop_count].dat, U_UTF8, p, U_CURRENT, -1);
+ free(prop[prop_count].dat);
+ prop[prop_count].dat = p;
+ }
+ prop_count++;
+ d = 0;
+ }
+ }
+ while (d-- > 0)
+ pack_getc(f);
+ }
+ else {
+ /* load actual data */
+ ff = pack_fopen_chunk(f, FALSE);
+
+ if (ff) {
+ d = ff->todo;
+
+ dat[c].dat = load_object(ff, type, d);
+
+ if (dat[c].dat) {
+ dat[c].type = type;
+ dat[c].size = d;
+
+ if (prop_count > 0) {
+ dat[c].prop = malloc(sizeof(DATAFILE_PROPERTY)*(prop_count+1));
+ if (dat[c].prop != NULL) {
+ for (d=0; d<prop_count; d++) {
+ dat[c].prop[d].dat = prop[d].dat;
+ dat[c].prop[d].type = prop[d].type;
+ prop[d].dat = NULL;
+ }
+ dat[c].prop[d].dat = NULL;
+ dat[c].prop[d].type = DAT_END;
+ }
+ else {
+ for (d=0; d<prop_count; d++) {
+ free(prop[d].dat);
+ prop[d].dat = NULL;
+ }
+ }
+ prop_count = 0;
+ }
+ else
+ dat[c].prop = NULL;
+ }
+
+ f = pack_fclose_chunk(ff);
+
+ c++;
+ }
+ }
+
+ if (*allegro_errno) {
+ unload_datafile(dat);
+
+ for (c=0; c<MAX_PROPERTIES; c++)
+ if (prop[c].dat)
+ free(prop[c].dat);
+
+ return NULL;
+ }
+ }
+
+ for (c=0; c<MAX_PROPERTIES; c++)
+ if (prop[c].dat)
+ free(prop[c].dat);
+
+ return dat;
+}
+
+/* load_datafile:
+ * Loads an entire data file into memory, and returns a pointer to it.
+ * On error, sets errno and returns NULL.
+ */
+DATAFILE *load_datafile(AL_CONST char *filename)
+{
+ return load_datafile_callback(filename, NULL);
+}
+
+/* load_datafile_callback:
+ * Loads an entire data file into memory, and returns a pointer to it.
+ * On error, sets errno and returns NULL.
+ */
+DATAFILE *load_datafile_callback(AL_CONST char *filename, void (*callback)(DATAFILE *))
+{
+ PACKFILE *f;
+ DATAFILE *dat;
+ int type;
+
+ f = pack_fopen(filename, F_READ_PACKED);
+ if (!f)
+ return NULL;
+
+ if ((f->flags & PACKFILE_FLAG_CHUNK) && (!(f->flags & PACKFILE_FLAG_EXEDAT)))
+ type = (_packfile_type == DAT_FILE) ? DAT_MAGIC : 0;
+ else
+ type = pack_mgetl(f);
+
+ if (type == DAT_MAGIC) {
+ dat = load_file_object(f, 0);
+ }
+ else
+ dat = NULL;
+
+ pack_fclose(f);
+ return dat;
+}
+
+/* load_datafile_object:
+ * Loads a single object from a datafile.
+ */
+DATAFILE *load_datafile_object(AL_CONST char *filename, AL_CONST char *objectname)
+{
+ PACKFILE *f;
+ DATAFILE *dat;
+ void *object;
+ char buf[512];
+ int size;
+
+ ustrzcpy(buf, sizeof(buf), filename);
+
+ if (ustrcmp(buf, uconvert_ascii("#", NULL)) != 0)
+ ustrzcat(buf, sizeof(buf), uconvert_ascii("#", NULL));
+
+ ustrzcat(buf, sizeof(buf), objectname);
+
+ f = pack_fopen(buf, F_READ_PACKED);
+ if (!f)
+ return NULL;
+
+ size = f->todo;
+
+ dat = malloc(sizeof(DATAFILE));
+ if (!dat) {
+ pack_fclose(f);
+ return NULL;
+ }
+
+ object = load_object(f, _packfile_type, size);
+
+ pack_fclose(f);
+
+ if (!object) {
+ free(dat);
+ return NULL;
+ }
+
+ dat->dat = object;
+ dat->type = _packfile_type;
+ dat->size = size;
+ dat->prop = NULL;
+
+ return dat;
+}
+
+/* _unload_datafile_object:
+ * Helper to destroy a datafile object.
+ */
+void _unload_datafile_object(DATAFILE *dat)
+{
+ int i;
+
+ /* free the property list */
+ if (dat->prop) {
+ for (i=0; dat->prop[i].type != DAT_END; i++)
+ if (dat->prop[i].dat)
+ free(dat->prop[i].dat);
+
+ free(dat->prop);
+ }
+
+ /* look for a destructor function */
+ for (i=0; i<MAX_DATAFILE_TYPES; i++) {
+ if (datafile_type[i].type == dat->type) {
+ if (dat->dat) {
+ if (datafile_type[i].destroy)
+ datafile_type[i].destroy(dat->dat);
+ else
+ free(dat->dat);
+ }
+ return;
+ }
+ }
+
+ /* if not found, just free the data */
+ if (dat->dat)
+ free(dat->dat);
+}
+
+/* unload_datafile:
+ * Frees all the objects in a datafile.
+ */
+void unload_datafile(DATAFILE *dat)
+{
+ int i;
+
+ if (dat) {
+ for (i=0; dat[i].type != DAT_END; i++)
+ _unload_datafile_object(dat+i);
+
+ free(dat);
+ }
+}
+
+/* unload_datafile_object:
+ * Unloads a single datafile object, returned by load_datafile_object().
+ */
+void unload_datafile_object(DATAFILE *dat)
+{
+ if (dat) {
+ _unload_datafile_object(dat);
+ free(dat);
+ }
+}
+
+/* _initialize_datafile_types:
+ * Register my loader functions with the code in dataregi.c.
+ */
+#ifdef CONSTRUCTOR_FUNCTION
+ CONSTRUCTOR_FUNCTION(void _initialize_datafile_types());
+#endif
+
+void _initialize_datafile_types()
+{
+ register_datafile_object(DAT_FILE, load_file_object, (void (*)(void *data))unload_datafile );
+}
+
+#endif
+
diff --git a/setedit/install/install.cc b/setedit/install/install.cc
new file mode 100644
index 0000000..e8050d8
--- /dev/null
+++ b/setedit/install/install.cc
@@ -0,0 +1,1665 @@
+/*****************************************************************************
+
+ Copyright (c) 1999-2003 by Salvador E. Tropea.
+ Covered by the GPL license.
+ Part of setedit source code.
+
+TODO: que parsee el path (strtok) y busque instalaciones anteriores, si
+encuentra el install.log que lo levante a memoria y que use esos seteos y
+que pregunte si la quiere liquidar => barro la lista, si un archivo no
+coincide en tiempo y tamao renombrarlo a un nombre nico (.001, .002, etc)
+al final avisarle cuantos.
+Un switch de uninstall y que pregunte si remueve los que modifico con si, no,
+todos y ninguno.
+
+Hints:
+From Laurynas:
+ 2) Selecting type of installation - I'd like (and think other users
+ would like) to know, how differ given three types of installation?
+If done must be done very careful to avoid confusing people, the differences
+are technical.
+
+ 4) About autoexec.bat update - IMHO the best way to do it is to
+ give for user limited editing capabilities, something I have saw
+ in Norton Utilities 8.0 installer - there is given text of
+ autoexec.bat which user is unable to change, added by installer code
+ is highlighted and all you can do is to move it with <up> and <down>.
+ (Maybe there was an option to refuse changes, I don't remember).
+It could be another option, but is complex because no TV class provides it.
+
+Map of v1.02 (text section):
+tvision: 120936
+libc: 105900
+libstdc++: 56748
+this code: 20664
+allegro: 19956 (139Kb saved using the modified datfile.c was in 1.0)
+Perl regex: 19144
+libgcc: 10304
+easydiag: 7892
+internationalization: 7372
+extra widgets (progress bar): 3176
+
+*****************************************************************************/
+
+#include <ceditint.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <glob.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <dos.h>
+#include <locale.h>
+#include <allegro.h>
+#include <pcre.h>
+#include <libwin.h>
+#define Uses_TApplication
+#define Uses_TStatusLine
+#define Uses_TStatusDef
+#define Uses_TStatusItem
+#define Uses_TKeys
+#define Uses_TDialog
+#define Uses_MsgBox
+#define Uses_TEditWindow
+
+#define Uses_ProgBar
+
+#define Uses_TSInputLine
+#define Uses_TSLabel
+#define Uses_TSLabelRadio
+#define Uses_TSRadioButtons
+#define Uses_TSButton
+#define Uses_TSHzGroup
+#define Uses_TSVeGroup
+#define Uses_TSStaticText
+#define Uses_TSNoStaticText
+#define Uses_TSCheckBoxes
+#define Uses_TSTextScroller
+
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+#if !SUP_PCRE
+#error Can not compile the installer without PCRE support
+#endif
+
+// The following are cosmetic because I ensured that
+// no graphic code is linked modifying datafile.c
+/*BEGIN_GFX_DRIVER_LIST
+END_GFX_DRIVER_LIST
+BEGIN_COLOR_DEPTH_LIST
+END_COLOR_DEPTH_LIST
+BEGIN_JOYSTICK_DRIVER_LIST
+END_JOYSTICK_DRIVER_LIST*/
+
+//#define DEBUG
+
+// Declared in tvedit3.cc
+extern ushort doEditDialogDefault(int dialog, va_list arg);
+// Declared in tvedit2.cc
+ushort execDialog(TDialog *d, void *data);
+
+#define DoAndDel(a,d) TDialog *d=a->doIt(); delete a; d->options|=ofCentered;
+#define CreateCol(a) TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),a))
+
+const int staExit=0x100,staSelType=1,staDestination=2,staMiscOps=3,
+ staDesktopOps=4,staTabOps=5,staBackUpOps=6,staConfirm=7,
+ staInstall=8;
+const int retNext=1,retPrev=-1,retExit=0,retStay=2,retExitUn=3;
+const int cmStart=0x2000,cmbPrev=0x2001,cmbNext=0x2002;
+const int instNormal=0,instProg=1,instDJGPP=2;
+
+int TypeInstallation=-1;
+char Destination[PATH_MAX]="";
+char AddToDesktop=1;
+char AddToMenu =1;
+char RedmondMenu =0;
+char ExtraScrSave=1;
+char DesktopOps =0;
+char TabOps =0;
+char BackUpOps =1;
+
+// Default Installation Options variables
+typedef struct
+{
+ const char *option;
+ int len;
+ char *var;
+} stOption;
+
+static stOption Options[]=
+{
+ {"CentralDesktopFile",18,&DesktopOps},
+ {"TabsForIndent",13,&TabOps},
+ {"CreateBackUps",13,&BackUpOps}
+};
+const int numOptions=sizeof(Options)/sizeof(stOption);
+
+char *Win95Programs=0;
+char *Win95Desktop=0;
+char *Win95MenuPrograms=0;
+char *OldInstallation=0;
+
+const char *cTypeOfInstall=__("Type of installation");
+const char *cDestinationDir=__("Destination directory");
+const char *cMiscOps=__("Miscellaneous options");
+const char *cAddToDesktop=__("Add a direct access to the desktop");
+const char *cAddToMenu=__("Add setedit to the Start\\Programs menu");
+const char *cRedmondMenu=__("Configure the editor's menu like in Win. programs (eg. ^C=copy)");
+const char *cExtraScrSave=__("Extra screen savers (around 160 Kb)");
+const char *cDesktopOpsTit=__("Desktop files");
+const char *cDesktopOps=__("The editor stores configuration options in files called desktop files. These "
+"files also store information about what files are opened and the size, "
+"position, etc. of the windows. You can have only one global file for this or "
+"one in each directory you use the editor in. Which option do you prefer?");
+const char *cDesktopOps0=__("A desktop file in each directory");
+const char *cDesktopOps1=__("One central desktop file.");
+const char *cTabOpsTit=__("Indent using...");
+const char *cTabOps=__("The editor is set by default to indent text using spaces. To configure the "
+"editor to use tabs more than one option must be selected. What do you want to "
+"use for indentation?");
+const char *cTabOps0=__("Spaces");
+const char *cTabOps1=__("Tabs");
+const char *cBackUpOpsTit=__("Backup files");
+const char *cBackUpOps=__("Each time the editor stores a modified file to disk a backup file can be "
+"created in case you want to revert the changes. This is especially useful when "
+"you already exited the editor and hence the undo option isn't available. Do you "
+"want to create backup files?");
+const char *cBackUpOps0=__("No");
+const char *cBackUpOps1=__("Yes, create backup files");
+
+// XXX.XXX.XXX
+char VersionDots[12];
+char Version[12];
+
+int editorIsAlive=0;
+int DebugMode=0;
+int AutoExecWasOK=0;
+
+typedef struct
+{
+ unsigned flags;
+ char *path;
+ char *file;
+ char *instName;
+ char *manifest;
+} FullFile;
+
+const unsigned fgNormal=1,fgProgram=2,fgDJGPP=4,fgPIFBinSet=8,fgExScSv=0x10;
+const unsigned fgAll=fgNormal | fgProgram | fgDJGPP;
+const unsigned fgPrg=fgProgram | fgDJGPP;
+const unsigned fgNoDJ=fgNormal | fgProgram;
+
+FullFile files[]={
+{fgAll ,"bin/","setedit.exe",0,0},
+{fgAll ,"bin/","e.bat",0,0},
+{fgAll | fgPIFBinSet,"bin/","setedit.pif",0,0},
+{fgNoDJ ,"bin/","cwsdpmi.exe",0,0},
+{fgNoDJ ,"bin/","cwsdpmi.doc",0,0},
+{fgNoDJ ,"bin/","emu387.dxe",0,0},
+{fgAll ,"share/setedit/","cpmacros.pmc",0,0},
+{fgAll ,"share/setedit/","clippmac.pmc",0,0},
+{fgAll ,"share/setedit/","perlmac.pmc",0,0},
+{fgAll ,"share/setedit/","pmacros.pmc",0,0},
+{fgAll ,"share/setedit/","htmlmac.pmc",0,0},
+{fgAll ,"share/setedit/","vhdl.pmc",0,0},
+{fgAll ,"share/setedit/","wmlmac.pmc",0,0},
+{fgAll ,"share/setedit/","syntaxhl.shl",0,0},
+{fgAll ,"share/setedit/","errors.cle",0,0},
+{fgPrg ,"share/setedit/","editor.tip",0,0},
+{fgNormal,"share/setedit/","editor.tip","for-prg.tip",0},
+{fgNormal,"share/setedit/","simple.tip","editor.tip",0},
+{fgAll ,"share/setedit/","boxround.sft",0,0},
+{fgAll ,"share/setedit/","cntdown.sft",0,0},
+{fgAll ,"share/setedit/","ocr.sft",0,0},
+{fgAll ,"share/setedit/","rombios.sft",0,0},
+{fgAll ,"share/setedit/","thin.sft",0,0},
+{fgAll ,"share/setedit/","txhgen-i.htm",0,0},
+{fgAll ,"share/setedit/","txhgen-i.txi",0,0},
+{fgAll ,"share/setedit/","txhgen-i.txt",0,0},
+{fgAll ,"share/setedit/","html.frt",0,0},
+{fgAll ,"share/setedit/","multi.frt",0,0},
+{fgAll ,"share/setedit/","tex.frt",0,0},
+{fgAll ,"share/setedit/","redmond.smn",0,0},
+{fgPrg ,"share/setedit/","menubind.smn",0,0},
+{fgPrg ,"share/setedit/","simple.smn",0,0},
+{fgNormal,"share/setedit/","simple.smn","menubind.smn",0},
+{fgNormal,"share/setedit/","menubind.smn","for-prg.smn",0},
+{fgAll ,"share/setedit/","macros.slp",0,0},
+{fgAll ,"share/setedit/","examples.slp",0,0},
+{fgPrg ,"share/setedit/","simple.dst",0,0},
+{fgNormal,"bin/","simple.dst","tcedit.dst",0},
+{fgAll ,"info/","setedit.inf",0,0},
+{fgAll ,"info/","sdg.inf",0,0},
+{fgAll ,"info/","infview.inf",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","setedit.txt",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","sdg.txt",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","infview.txt",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","readme.1st",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","kextend.zip",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","example.zip",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","calltpc7.zip",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","change.log",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","copyrigh",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","copying.dj",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","copying.gpl",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","copying.lgp",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","copying.rh",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","readme.faq",0,0},
+// Examples
+{fgDJGPP ,"contrib/setedit.bin/examples/","tvrc",0,0},
+{fgDJGPP ,"contrib/setedit.bin/examples/","examp1.epr",0,0},
+{fgDJGPP ,"contrib/setedit.bin/examples/","examp1.dst",0,0},
+{fgDJGPP ,"contrib/setedit.bin/examples/","test1.cc",0,0},
+// Tags tutorial
+{fgDJGPP ,"contrib/setedit.bin/","tags.html",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","my_file1.html",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","my_file2.html",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","my_file3.html",0,0},
+{fgDJGPP ,"contrib/setedit.bin/","examples.css",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","a_project.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","advice_tags.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","class_child1.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","class_list.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","generate_tags.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","jump_symbol.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","name_project.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","project_open.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","sorted.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","symbols_example.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","tag_options.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","d_tag_options.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","this_and_parents.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","this_class.png",0,0},
+{fgDJGPP ,"contrib/setedit.bin/tag_imgs/","w_completion.png",0,0},
+{fgNoDJ ,"texts/","setedit.txt",0,0},
+{fgNoDJ ,"texts/","sdg.txt",0,0},
+{fgNoDJ ,"texts/","infview.txt",0,0},
+{fgNoDJ ,"texts/","readme.1st",0,0},
+{fgNoDJ ,"texts/","kextend.zip",0,0},
+{fgNoDJ ,"texts/","example.zip",0,0},
+{fgNoDJ ,"texts/","calltpc7.zip",0,0},
+{fgNoDJ ,"texts/","change.log",0,0},
+{fgNoDJ ,"texts/","copyrigh",0,0},
+{fgNoDJ ,"texts/","copying.dj",0,0},
+{fgNoDJ ,"texts/","copying.gpl",0,0},
+{fgNoDJ ,"texts/","copying.lgp",0,0},
+{fgNoDJ ,"texts/","copying.rh",0,0},
+{fgNoDJ ,"texts/","readme.faq",0,0},
+// Examples
+{fgNoDJ ,"texts/examples/","tvrc",0,0},
+{fgNoDJ ,"texts/examples/","examp1.epr",0,0},
+{fgNoDJ ,"texts/examples/","examp1.dst",0,0},
+{fgNoDJ ,"texts/examples/","test1.cc",0,0},
+{fgAll ,"share/setedit/","version.txt",0,0},
+{fgExScSv,"share/setedit/","ps1.exe",0,0},
+{fgExScSv,"share/setedit/","ps2.exe",0,0},
+{fgExScSv,"share/setedit/","ps3.exe",0,0},
+{fgExScSv,"share/setedit/","ps4.exe",0,0},
+{fgExScSv,"share/setedit/","extrscsv.txt",0,0},
+{fgDJGPP ,"info/","setedit.1",0,0},
+{fgAll ,"share/locale/es/LC_MESSAGES/","essetedit.mo","setedit.mo",0},
+{fgAll ,"share/locale/de/LC_MESSAGES/","desetedit.mo","setedit.mo",0}
+//{fgAll ,"manifest/","edi0426b.ver",0,0},
+//{fgAll ,"manifest/","edi0426b.mft",0,0}
+};
+
+const int numFiles=sizeof(files)/sizeof(FullFile);
+void TryToLoadInstOpts(char *path);
+
+int CopyFile(const char *dest, void *ori, long size)
+{
+ char b[PATH_MAX],*d=b;
+ const char *s=dest;
+ struct stat st;
+ FILE *de;
+
+ do
+ {
+ for (;*s && *s!='/'; s++,d++) *d=*s;
+ if (*s=='/')
+ {
+ *d=0;
+ if (stat(b,&st))
+ { // No existe
+ if (mkdir(b,S_IWUSR))
+ {
+ messageBox(mfError | mfOKButton,__("Can't create the directory: %s"),b);
+ return 0;
+ }
+ }
+ else
+ if (!S_ISDIR(st.st_mode))
+ {
+ messageBox(mfError | mfOKButton,__("File name in path: %s"),b);
+ return 0;
+ }
+ *d='/';
+ d++;
+ s++;
+ }
+ }
+ while (*s);
+ de=fopen(dest,"wb");
+ if (!de)
+ return 0;
+ fwrite(ori,size,1,de);
+ fclose(de);
+ return 1;
+}
+
+const char *prefix="test/";
+
+class Installer : public TApplication
+{
+public:
+ Installer();
+ //static TMenuBar *initMenuBar(TRect r);
+ static TStatusLine *initStatusLine(TRect r);
+ void handleEvent( TEvent& event );
+
+private:
+ void Start();
+};
+
+Installer::Installer() :
+ TProgInit(&Installer::initStatusLine, &Installer::initMenuBar,
+ &Installer::initDeskTop)
+{
+}
+
+/*TMenuBar *Installer::initMenuBar(TRect r)
+{
+ r.b.y = r.a.y + 1;
+
+ TMenuItem& mI =*new TMenuItem( "~T~est", cmTest, kbNoKey, hcNoContext );
+ return new TMenuBar( r, new TMenu( mI ) );
+}*/
+
+TStatusLine *Installer::initStatusLine(TRect r)
+{
+ r.a.y=r.b.y-1;
+
+ TStatusLine *sL=new TStatusLine(r,
+ *new TStatusDef(0x1000,0x1001) +
+ *new TStatusItem(__("~Ctrl-F4~ Finish editing, or click on the button found in the top left corner"),kbCtrlF4,cmClose) +
+ *new TStatusDef(0,0xFFFF) +
+ *new TStatusItem(0,kbF10,cmMenu) +
+ *new TStatusItem(__("~ESC~ Aborts installation"),kbEsc,cmCancel));
+
+ return sL;
+}
+
+void Installer::handleEvent(TEvent &event)
+{
+ TApplication::handleEvent(event);
+
+ if (event.what == evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmStart:
+ Start();
+ break;
+ }
+ }
+}
+
+/*ushort execDialog( TDialog *d, void *data )
+{
+ TView *p=TProgram::application->validView( d );
+ if (p==0)
+ return cmCancel;
+ else
+ {
+ if (data!=0)
+ p->setData(data);
+ ushort result=TProgram::deskTop->execView(p);
+ if (result!=cmCancel && data!=0)
+ p->getData( data );
+ TObject::destroy( p );
+ return result;
+ }
+}*/
+
+
+int ConfirmExit()
+{
+ return messageBox(__("Are you sure you want to abort the installation?"),
+ mfYesButton | mfNoButton | mfWarning)==cmYes;
+}
+
+char *cSelectType=__("Select the type");
+const char *cNormal=__("Normal");
+const char *cForProgrammers=__("For programmers");
+const char *cForDJGPP=__("For djgpp programmers");
+
+int SelectTypeInstall(char *djdir)
+{
+ static int AlreadyAsked=0;
+
+ CreateCol(cTypeOfInstall);
+
+ TSLabel *l=TSLabelRadio(cSelectType,cNormal,cForProgrammers,cForDJGPP,0);
+ col->insert(xTSCenter,1,l);
+ EasyInsertOKCancel(col);
+ DoAndDel(col,d);
+
+ int ops=TypeInstallation;
+ if (ops==-1)
+ ops=djdir ? instDJGPP : instNormal;
+
+ if (execDialog(d,&ops)!=cmOK)
+ return retExit;
+ TypeInstallation=ops;
+ if (TypeInstallation==instDJGPP && !djdir)
+ { // Avoid asking more than once
+ if (AlreadyAsked)
+ return retNext;
+ AlreadyAsked=1;
+ return messageBox(__("Looks like djgpp isn't installed. DJGPP environment variable isn't defined or is wrong. Exit to fix it first?"),
+ mfError | mfYesButton | mfNoButton)==cmYes ?
+ retExitUn : retNext;
+ }
+ return retNext;
+}
+
+void InsertPrevNextCancel(TSViewCol *col)
+{
+ TSHzGroup *but12=new TSHzGroup(new TSButton(__("< ~P~rev"),cmYes),
+ new TSHzGroup(new TSButton(__("> ~N~ext"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel)));
+ col->insert(xTSCenter,yTSDown,but12);
+}
+
+void InsertYesNoCancel(TSViewCol *col)
+{
+ TSHzGroup *but12=new TSHzGroup(new TSButton(__("~Y~es"),cmYes,bfDefault),
+ new TSHzGroup(new TSButton(__("~N~o"),cmNo),
+ new TSButton(__("Cancel"),cmCancel)));
+ col->insert(xTSCenter,yTSDown,but12);
+}
+
+int Translate(int val)
+{
+ switch (val)
+ {
+ case cmOK:
+ return retNext;
+ case cmYes:
+ return retPrev;
+ }
+ return retExit;
+}
+
+int TestCreation()
+{
+ char eof=26;
+ char dest[PATH_MAX];
+
+ strcpy(dest,Destination);
+ strcat(dest,"/delete.me");
+ int ret=CopyFile(dest,&eof,1);
+ if (ret)
+ unlink(dest);
+ return ret;
+}
+
+int AskDestination(char *djdir)
+{
+ static int AlreadyAsked=0;
+
+ CreateCol(cDestinationDir);
+ TSLabel *label=new TSLabel(__("Where do you want to install the editor?"),
+ new TSInputLine(PATH_MAX,50));
+ col->insert(xTSCenter,2,label);
+ InsertPrevNextCancel(col);
+ DoAndDel(col,d);
+
+ if (!*Destination)
+ {
+ if (OldInstallation)
+ strcpy(Destination,OldInstallation);
+ else if (djdir && TypeInstallation==instDJGPP)
+ strcpy(Destination,djdir);
+ else
+ {
+ if (Win95Programs)
+ {
+ strcpy(Destination,Win95Programs);
+ strcat(Destination,"\\setedit");
+ }
+ else
+ strcpy(Destination,"c:/setedit");
+ }
+ }
+ int ret=Translate(execDialog(d,Destination));
+ if (ret==retNext)
+ {
+ fexpand(Destination);
+ if (Destination[1]==':' && !driveValid(Destination[0]))
+ {
+ messageBox(__("Invalid drive"),mfError | mfOKButton);
+ ret=retStay;
+ }
+ else
+ if (!TestCreation())
+ {
+ messageBox(__("Can't create files there"),mfError | mfOKButton);
+ ret=retStay;
+ }
+ if (!AlreadyAsked && OldInstallation &&
+ strcasecmp(OldInstallation,Destination)!=0)
+ {
+ int r=messageBox(__("You already installed the editor (or tried to), but in a different place. Do you want to continue?"),
+ mfWarning | mfYesButton | mfNoButton);
+ if (r==cmYes)
+ AlreadyAsked=1;
+ else
+ ret=retStay;
+ }
+ if (ret==retNext)
+ TryToLoadInstOpts(Destination);
+ }
+ return ret;
+}
+
+
+int GetRegistryKey(char *name, FILE *f, char *buffer)
+{
+ int l=strlen(name);
+ char *s,*d;
+
+ while (!feof(f))
+ {
+ fgets(buffer,PATH_MAX+40,f);
+ if (strncmp(buffer+1,name,l)==0)
+ {
+ s=d=buffer;
+ s+=l+4;
+ for (; *s && *s!='"'; s++)
+ {
+ if (*s=='\\')
+ s++;
+ *(d++)=*s;
+ }
+ *d=0;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ For some internationalization problem Wincrap uses one code page for a
+file name accessed by DOS and other for itself. So regedit reports the name
+in the W code page (ISO 8859 1 in my case), but if I must create a file
+I must provide the name in the DOS code page (CP 850 in my case). The result
+is that I can't trust in any value outside the 0-127 range, so I use glob
+to find the real value. It happends with the spanish word "Men".
+
+***************************************************************************/
+
+char *SolveFuckName(char *b)
+{
+ unsigned char *s=(unsigned char *)strdup(b),*ori;
+ int changed=0;
+ glob_t dirs;
+ char *ret=(char *)s;
+
+ for (ori=s; *s; s++)
+ if (*s>127)
+ {
+ *s='?';
+ changed++;
+ }
+ if (changed)
+ {
+ if (glob((char *)ori,0,0,&dirs)==0)
+ ret=strdup(dirs.gl_pathv[0]);
+ else
+ ret=0;
+ globfree(&dirs);
+ free(ori);
+ }
+
+ return ret;
+}
+
+#define DEBUG_WIN
+#ifdef DEBUG_WIN
+#define dbprint(a...) fprintf(stderr,a)
+#else
+#define dbprint(a...)
+#endif
+
+int GetWindowsInformation()
+{
+ int ret=0;
+ char command[PATH_MAX];
+
+ CreateCol(__("Searching Windows information"));
+
+ TSStaticText *l=new TSStaticText(__("Windows 9x or similar detected, wait while\nfinding information about your system"));
+ TSNoStaticText *m=new TSNoStaticText(__("Looking in registry "));
+ m->Flags=wSpan;
+ col->insert(2,1,l);
+ col->insert(2,yTSUnder,m,0,l);
+ DoAndDel(col,d);
+ TNoStaticText *message=(TNoStaticText *)m->view;
+
+ TProgram::deskTop->insert(d);
+ long hKey,bufType=REG_SZ,bufLen=sizeof(command);
+
+ if (!w95_reg_openkey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion",&hKey))
+ {
+ message->setText(__("Searching programs dir"));
+ if (!w95_reg_queryvalueex(hKey,"ProgramFilesDir",0,&bufType,command,&bufLen))
+ {
+ Win95Programs=SolveFuckName(command);
+ w95_reg_closekey(hKey);
+ message->setText(__("Looking in registry "));
+ if (!w95_reg_openkey(HKEY_USERS,".Default\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",&hKey))
+ {
+ message->setText(__("Searching desktop and menu"));
+ bufType=REG_SZ; bufLen=sizeof(command);
+ if (!w95_reg_queryvalueex(hKey,"Desktop",0,&bufType,command,&bufLen))
+ {
+ Win95Desktop=SolveFuckName(command);
+ bufType=REG_SZ; bufLen=sizeof(command);
+ if (!w95_reg_queryvalueex(hKey,"Programs",0,&bufType,command,&bufLen))
+ {
+ Win95MenuPrograms=SolveFuckName(command);
+ ret=1;
+ }
+ }
+ }
+ w95_reg_closekey(hKey);
+ }
+ else
+ w95_reg_closekey(hKey);
+ }
+ TProgram::deskTop->remove(d);
+
+ return ret;
+}
+
+void AddItem(TSItem **ops, const char *value)
+{
+ if (*ops==0)
+ { // First item
+ *ops=new TSItem(value,0);
+ }
+ else
+ {
+ TSItem *p=*ops;
+ while (p->next)
+ {
+ p=p->next;
+ }
+ p->next=new TSItem(value,0);
+ }
+}
+
+int AskMiscOps()
+{
+ int options=1,desktop=0,menu=0,menuRedmond=0,opsMask=0,menuESS;
+ TSItem *ops=0;
+
+ if (Win95Desktop)
+ {
+ AddItem(&ops,cAddToDesktop);
+ desktop=options;
+ options<<=1;
+ opsMask|=AddToDesktop ? desktop : 0;
+ }
+ if (Win95MenuPrograms)
+ {
+ AddItem(&ops,cAddToMenu);
+ menu=options;
+ options<<=1;
+ opsMask|=AddToMenu ? menu : 0;
+ }
+ if (TypeInstallation==instProg || TypeInstallation==instDJGPP)
+ {
+ AddItem(&ops,cRedmondMenu);
+ menuRedmond=options;
+ options<<=1;
+ opsMask|=RedmondMenu ? menuRedmond : 0;
+ }
+ // Extra screen savers (external ones)
+ AddItem(&ops,cExtraScrSave);
+ menuESS=options;
+ options<<=1;
+ opsMask|=ExtraScrSave ? menuESS : 0;
+ // None applies
+ if (options==1)
+ return retNext;
+
+ CreateCol(cMiscOps);
+ TSCheckBoxes *c=new TSCheckBoxes(ops);
+ col->insert(xTSCenter,1,c);
+ InsertPrevNextCancel(col);
+ DoAndDel(col,d);
+
+ int ret=Translate(execDialog(d,&opsMask));
+ if (ret==retNext)
+ {
+ if (Win95Desktop)
+ AddToDesktop=opsMask & desktop ? 1 : 0;
+ else
+ AddToDesktop=0;
+ if (Win95MenuPrograms)
+ AddToMenu=opsMask & menu ? 1 : 0;
+ else
+ AddToMenu=0;
+ if (TypeInstallation==instProg || TypeInstallation==instDJGPP)
+ RedmondMenu=opsMask & menuRedmond ? 1 : 0;
+ else
+ RedmondMenu=0; // Just in case that's a second pass with different options
+ ExtraScrSave=opsMask & menuESS ? 1 : 0;
+ }
+
+ return ret;
+}
+
+int AskGenericQuestion2Ops(const char *title, const char *desc,
+ const char *op1, const char *op2, char &var)
+{
+ CreateCol(title);
+ TSVeGroup *gr=MakeVeGroup(
+ new TSStaticText(desc,60),
+ new TSRadioButtons(new TSItem(op1,new TSItem(op2,0))),
+ 0);
+ gr->makeSameW();
+ col->insert(xTSCenter,1,gr);
+ InsertPrevNextCancel(col);
+ DoAndDel(col,d);
+
+ uint32 ops=var;
+ int ret=Translate(execDialog(d,&ops));
+ if (ret==retNext)
+ var=ops;
+
+ return ret;
+}
+
+int AskDesktopOps()
+{
+ if (TypeInstallation==instNormal)
+ {
+ DesktopOps=1;
+ return retNext;
+ }
+ return AskGenericQuestion2Ops(cDesktopOpsTit,cDesktopOps,cDesktopOps0,
+ cDesktopOps1,DesktopOps);
+}
+
+int AskTabOps()
+{
+ if (TypeInstallation==instNormal)
+ {
+ TabOps=0;
+ return retNext;
+ }
+ return AskGenericQuestion2Ops(cTabOpsTit,cTabOps,cTabOps0,cTabOps1,TabOps);
+}
+
+int AskBackUpOps()
+{
+ if (TypeInstallation==instNormal)
+ {
+ BackUpOps=1;
+ return retNext;
+ }
+ return AskGenericQuestion2Ops(cBackUpOpsTit,cBackUpOps,cBackUpOps0,
+ cBackUpOps1,BackUpOps);
+}
+
+const int LinesInList=12;
+
+char *AddOps2(char val, const char *title, const char *op0, const char *op1)
+{
+ char *a=TVIntl::getTextNew(title);
+ char *b=TVIntl::getTextNew(val ? op1 : op0);
+ char *s=new char[strlen(b)+2+strlen(a)+3];
+ strcpy(s," ");
+ strcat(s,a);
+ strcat(s,": ");
+ strcat(s,b);
+ DeleteArray(a);
+ DeleteArray(b);
+ return s;
+}
+
+int ConfirmValues()
+{
+ TNSCollection *strs=new TNSCollection(8,4);
+ int lines=0;
+ char *aux;
+
+ aux=TVIntl::getTextNew(cTypeOfInstall);
+ strs->insert((void *)aux);
+ switch (TypeInstallation)
+ {
+ case instNormal:
+ aux=TVIntl::getTextNew(__(" Normal"));
+ break;
+ case instProg:
+ aux=TVIntl::getTextNew(__(" For programmers"));
+ break;
+ default: // instDJGPP
+ aux=TVIntl::getTextNew(__(" For djgpp programmers"));
+ break;
+ }
+ strs->insert((void *)aux);
+ strs->insert((void *)newStr(""));
+ lines+=3;
+
+ aux=TVIntl::getTextNew(cDestinationDir);
+ strs->insert((void *)aux);
+ char *dp=(char *)alloca(strlen(Destination)+1+2);
+ strcpy(dp," ");
+ strcat(dp,Destination);
+ strs->insert((void *)newStr(dp));
+ strs->insert((void *)newStr(""));
+ lines+=2;
+
+ aux=TVIntl::getTextNew(cMiscOps);
+ strs->insert((void *)aux);
+ lines++;
+ #define I(ops) if(ops) { char *a=TVIntl::getTextNew(c##ops); \
+ char *s=(char *)alloca(strlen(a)+3); \
+ strcpy(s," "); strcat(s,a); strs->insert(newStr(s)); lines++; \
+ DeleteArray(a); }
+ I(AddToDesktop)
+ I(AddToMenu)
+ I(RedmondMenu)
+ I(ExtraScrSave)
+
+ #undef I
+ #define I(ops) s=AddOps2(ops,c##ops##Tit,c##ops##0,c##ops##1); \
+ strs->insert(s); lines++
+ if (TypeInstallation!=instNormal)
+ {
+ char *s;
+ I(DesktopOps);
+ I(TabOps);
+ I(BackUpOps);
+ }
+
+ CreateCol("Confirm options");
+ TSTextScroller *s=new TSTextScroller(70,LinesInList,strs,1,lines>LinesInList);
+ TSStaticText *q=new TSStaticText(__("Are these options correct?"));
+ col->insert(xTSCenter,1,s);
+ col->insert(xTSCenter,yTSUnder,q,0,s);
+ InsertYesNoCancel(col);
+ DoAndDel(col,d);
+
+ int ret=execDialog(d,0);
+ if (ret==cmYes)
+ return retNext;
+ if (ret==cmNo)
+ return retPrev;
+ CLY_destroy(strs);
+ return retExit;
+}
+
+void ReplaceBy(char *ori, char *New, char *bkp, char *b1, char *b2)
+{
+ // Reflect it in the list
+ sprintf(b1,"share/setedit/%s",bkp);
+ sprintf(b1,"share/setedit/%s",New);
+ int i;
+ for (i=0; i<numFiles; i++)
+ {
+ if (strcmp(files[i].manifest,New)==0)
+ {
+ free(files[i].manifest);
+ files[i].manifest=strdup(bkp);
+ break;
+ }
+ }
+
+ sprintf(b1,"%s/share/setedit/%s",Destination,bkp);
+ sprintf(b2,"%s/share/setedit/%s",Destination,ori);
+ rename(b2,b1);
+ sprintf(b1,"%s/share/setedit/%s",Destination,New);
+ rename(b1,b2);
+}
+
+// Estoy aca, hay que agregar el cwsdpmi a la distribucion y solo instalarlo
+// cuando sea necesario.
+#ifdef DEBUG
+#define DAT_FILENAME "../install/install.dat"
+#else
+#define DAT_FILENAME "#"
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ It sets the working directory of the pif. If anything goes wrong I give
+up inmediatly. As the path is limited to 64 bytes (ASCIIZ) I use the SFN
+name instead of the LFN.
+
+***************************************************************************/
+
+void ProcessPifFile(char *code, char *buffer, const char *dest,
+ const char *path)
+{
+ char curd[PATH_MAX];
+
+ strcpy(buffer,dest);
+ strcat(buffer,path);
+ if (!getcwd(curd,PATH_MAX))
+ return;
+ if (chdir(buffer))
+ return;
+ putenv("LFN=n");
+ int ret=!getcwd(buffer,PATH_MAX);
+ putenv("LFN=y");
+ if (ret || chdir(curd) || strlen(buffer)>=64)
+ return;
+ strcpy(code+0x65,buffer);
+}
+
+int DoInstall()
+{
+ int i,actions=2;
+ unsigned mask=0;
+ DATAFILE *p;
+ char fullName[PATH_MAX],auxName[PATH_MAX],*mft;
+
+ if (AddToDesktop) actions++;
+ if (AddToMenu) actions++;
+ if (RedmondMenu) actions++;
+ switch (TypeInstallation)
+ {
+ case instNormal:
+ mask=fgNormal;
+ break;
+ case instProg:
+ mask=fgProgram;
+ break;
+ case instDJGPP:
+ mask=fgDJGPP;
+ break;
+ }
+ if (ExtraScrSave) mask|=fgExScSv;
+ // Count how many belongs to this distribution
+ for (i=0; i<numFiles; i++)
+ if (files[i].flags & mask)
+ actions++;
+
+ // Put some message to left space for the file names
+ ProgBar_Init(__("Installing"),actions,__("Installing files for the editor"));
+ for (i=0; i<numFiles; i++)
+ {
+ if (!(files[i].flags & mask))
+ continue;
+ ProgBar_UpDate(i);
+ ProgBar_SetComments(files[i].file);
+ p=load_datafile_object(DAT_FILENAME,files[i].file);
+ if (!p)
+ {
+ messageBox(mfError | mfOKButton,__("Unable to uncompress %s, most probably this file is damaged"),files[i].file);
+ return 0;
+ }
+ strcpy(fullName,Destination);
+ strcat(fullName,"/");
+ mft=fullName+strlen(fullName);
+ strcat(fullName,files[i].path);
+ if (files[i].instName)
+ strcat(fullName,files[i].instName);
+ else
+ strcat(fullName,files[i].file);
+ CopyFile(fullName,p->dat,p->size);
+ files[i].manifest=strdup(mft);
+ if (strcmp(files[i].file,"version.txt")==0)
+ {
+ char *s=(char *)p->dat;
+ int i;
+ for (i=0; *s!='\r' && *s!='\n'; s++,i++) VersionDots[i]=*s;
+ VersionDots[i]=0;
+ for (s++; isspace(*s); s++);
+ for (i=0; *s!='\r' && *s!='\n'; s++,i++) Version[i]=*s;
+ Version[i]=0;
+ }
+ unload_datafile_object(p);
+ }
+
+ // It changes some names must be done before the manifest
+ if (RedmondMenu)
+ {
+ ProgBar_UpDate(i++);
+ ProgBar_SetComments(__("Replacing default menu"));
+ ReplaceBy("menubind.smn","redmond.smn","default.smn",fullName,auxName);
+ }
+
+ // ** Extra files:
+ // Version for djgpp, to avoid hardcoding the version in the installer
+ sprintf(auxName,"edi%sb.ver",Version);
+ ProgBar_UpDate(i++);
+ ProgBar_SetComments(auxName);
+ sprintf(fullName,"%s/manifest/edi%sb.ver",Destination,Version);
+ p=load_datafile_object(DAT_FILENAME,auxName);
+ if (!p)
+ {
+ messageBox(__("Unable to uncompress files, most probably this file is damaged"),mfError | mfOKButton);
+ return 0;
+ }
+ CopyFile(fullName,p->dat,p->size);
+ unload_datafile_object(p);
+ // Manifest, It is installation dependant
+ sprintf(fullName,"%s/manifest/edi%sb.mft",Destination,Version);
+ ProgBar_UpDate(i++);
+ ProgBar_SetComments("manifest");
+ FILE *f=fopen(fullName,"wt");
+ if (f)
+ {
+ for (i=0; i<numFiles; i++)
+ {
+ if (files[i].manifest)
+ fprintf(f,"%s\n",files[i].manifest);
+ }
+ fclose(f);
+ }
+ // Create a report of the installed stuff
+ sprintf(fullName,"%s/share/setedit/install.log",Destination);
+ f=fopen(fullName,"wt");
+ if (f)
+ {
+ struct stat st;
+ fprintf(f,"[Install]\nBase=%s\nVersion1=%s\nVersion2=%s\n",Destination,VersionDots,Version);
+ for (i=0; i<numFiles; i++)
+ {
+ if (files[i].manifest)
+ {
+ sprintf(fullName,"%s/%s",Destination,files[i].manifest);
+ if (stat(fullName,&st)==0)
+ fprintf(f,"File=%s,%d,%d\n",files[i].manifest,st.st_mtime,st.st_size);
+ }
+ }
+ fprintf(f,"AddToDesktop=%d\n",AddToDesktop);
+ fprintf(f,"AddToMenu=%d\n",AddToMenu);
+ fprintf(f,"RedmondMenu=%d\n",RedmondMenu);
+ fprintf(f,"TypeInstallation=%d\n",TypeInstallation);
+ for (i=0; i<numOptions; i++)
+ fprintf(f,"%s=%d\n",Options[i].option,*Options[i].var);
+ fclose(f);
+ }
+
+ // Now do the extra actions:
+ if (AddToDesktop)
+ {
+ ProgBar_UpDate(i++);
+ ProgBar_SetComments(__("Adding icon to desktop"));
+ p=load_datafile_object(DAT_FILENAME,"setedit.pif");
+ if (p)
+ {
+ ProcessPifFile((char *)p->dat,auxName,Destination,"/bin");
+ strcpy(fullName,Win95Desktop);
+ strcat(fullName,"/setedit.pif");
+ fexpand(fullName);
+ CopyFile(fullName,p->dat,p->size);
+ unload_datafile_object(p);
+ }
+ }
+ if (AddToMenu)
+ {
+ ProgBar_UpDate(i++);
+ ProgBar_SetComments(__("Adding icon to menu"));
+ p=load_datafile_object(DAT_FILENAME,"setedit.pif");
+ if (p)
+ {
+ ProcessPifFile((char *)p->dat,auxName,Destination,"/bin");
+ strcpy(fullName,Win95MenuPrograms);
+ strcat(fullName,"/SET Edit/setedit.pif");
+ fexpand(fullName);
+ CopyFile(fullName,p->dat,p->size);
+ unload_datafile_object(p);
+ }
+ }
+ #if 0 // Now is a trick in the flags of the array
+ if (TypeInstallation==instNormal)
+ {
+ ProgBar_UpDate(i++);
+ ProgBar_SetComments(__("Simplifying configuration"));
+ ReplaceBy("menubind.smn","simple.smn","default.smn",fullName,auxName);
+ ReplaceBy("editor.tip","simple.tip","default.tip",fullName,auxName);
+ ReplaceBy("tcedit.dst","simple.dst","default.dst",fullName,auxName);
+ }
+ #endif
+ ProgBar_DeInit();
+ return 1;
+}
+
+void TryToLoadInstOpts(char *path)
+{
+ char b[PATH_MAX],slash,*s;
+ int i;
+
+ strcpy(b,path);
+ slash=b[strlen(b)-1];
+ if (slash!='\\' && slash!='/')
+ strcat(b,"/");
+ strcat(b,"/share/setedit/install.log");
+
+ FILE *f=fopen(b,"rt");
+ if (!f)
+ return;
+ do
+ {
+ if (fgets(b,PATH_MAX,f) && *b!='#')
+ {
+ for (s=b; *s && isspace(*s); s++); // Eat spaces
+ for (i=0; i<numOptions; i++)
+ if (strncasecmp(s,Options[i].option,Options[i].len)==0)
+ break;
+ if (i!=numOptions)
+ {
+ s+=Options[i].len;
+ // Move after =
+ for (; *s && *s!='='; s++);
+ if (*s) s++;
+ for (; *s && isspace(*s); s++);
+ // Get the option
+ *(Options[i].var)=*s=='1';
+ }
+ }
+ }
+ while (!feof(f));
+ fclose(f);
+}
+
+void SearchOldSET_FILES()
+{
+ char *set_files=getenv("SET_FILES");
+ char b[PATH_MAX];
+
+ if (set_files)
+ {
+ strcpy(b,set_files);
+ strlwr(b);
+ char *start=strstr(b,"share/setedit");
+ if (!start)
+ {
+ messageBox(__("You defined SET_FILES environment variable in a way that isn't compatible with the installer, be careful"),mfWarning | mfOKButton);
+ }
+ else
+ {
+ strcpy(b,set_files);
+ *start=0;
+ fexpand(b);
+ OldInstallation=strdup(b);
+ }
+ }
+}
+
+pcre *CompiledPCRE;
+int PCREMaxMatchs;
+int *PCREMatchs;
+
+void CreateRegex(const char *match)
+{
+ const char *error;
+ int errorOffset;
+ CompiledPCRE=pcre_compile(match,PCRE_MULTILINE | PCRE_CASELESS,&error,&errorOffset,0);
+ PCREMaxMatchs=(pcre_info(CompiledPCRE,0,0)+1)*3;
+ PCREMatchs=new int[PCREMaxMatchs];
+}
+
+int DoRegexSearch(char *search, int len)
+{
+ return pcre_exec(CompiledPCRE,0,search,len,PCRE206 0,PCREMatchs,PCREMaxMatchs);
+}
+
+void ReleaseRegex()
+{
+ delete []PCREMatchs;
+ delete (char *)CompiledPCRE;
+}
+
+char *SearchPATH(char *text, long len)
+{
+ char *lastMatch=0;
+ int hits;
+ char *search=text;
+
+ CreateRegex("^ *(SET\\s+)*PATH((\\s*=)|(\\s))");
+ do
+ {
+ hits=DoRegexSearch(search,len);
+ if (hits>0)
+ {
+ lastMatch=text+PCREMatchs[0];
+ search+=PCREMatchs[1];
+ }
+ }
+ while (hits>0);
+ ReleaseRegex();
+
+ return lastMatch;
+}
+
+void RemovePATH(char *buffer, long &len)
+{ // Looks complex but is a silly regex
+ CreateRegex("^Rem \\*\\* By SET Edit Installer \\*\\*(.*)\n *(SET\\s+)*PATH\\s*=(.*)\n");
+ if (DoRegexSearch(buffer,len)>0)
+ {
+ int start=PCREMatchs[0];
+ int end=PCREMatchs[1];
+ int l=end-start;
+ memmove(buffer+start,buffer+start+l,len-end+1);
+ len-=l;
+ }
+ ReleaseRegex();
+}
+
+static
+ushort doSpecialEditDialog(int dialog, ...)
+{ // Here I change the save stuff
+ va_list arg;
+
+ switch (dialog)
+ {
+ case edSaveModify:
+ return messageBox(__("You modified the autoexec.bat. Do you want to save the changes?")
+ ,mfInformation | mfYesNoCancel);
+ }
+
+ va_start(arg, dialog);
+ ushort ret=doEditDialogDefault(dialog,arg);
+ va_end(arg);
+ return ret;
+}
+
+// Just to create a fake title
+class TEditWindow2 : public TEditWindow
+{
+public:
+ TEditWindow2::TEditWindow2( const TRect& bounds,
+ const char *fileName
+ ) :
+ TWindowInit( &TEditWindow2::initFrame ),
+ TEditWindow(bounds,fileName,1) {};
+ const char *getTitle(short);
+ void close();
+};
+
+const char *TEditWindow2::getTitle( short )
+{
+ return "c:\\autoexec.bat";
+}
+
+void TEditWindow2::close()
+{
+ TWindow::close();
+ editorIsAlive=0;
+}
+
+int EditAutoexec(const char *name, int modified, char *buf, unsigned l)
+{
+ CreateCol(__("Instructions for editing"));
+ TSStaticText *t1=new TSStaticText(__("Now I'll give you the opportunity to edit the autoexec.bat. To finish click in the small rectangle found in the top-left corner or press Ctrl+F4."),70);
+ col->insert(2,2,t1);
+ TSStaticText *last;
+ if (modified)
+ {
+ last=new TSStaticText(__("I added the needed command, it is marked with a comment. Please don't remove the comment it's used to know where the text was added by the installer."),70);
+ col->insert(2,yTSUnder,last,0,t1);
+ }
+ else
+ {
+ last=new TSStaticText(__("The text I suggest to add is currently in the clipboard."),70);
+ col->insert(2,yTSUnder,last,0,t1);
+ }
+ t1=new TSStaticText(__("You can move lines using:\nShift + arrows keys: Select text\nCtrl+Insert: Copy to the clipboard\nCtrl+Delete: Delete a block\nShift+Insert: Paste from the clipboard\nShift+Delete: Copy to clipboard and then delete the block\nCtrl+U: Undo (only one action)"),70);
+ col->insert(2,yTSUnder,t1,0,last);
+
+ col->insert(xTSCenter,yTSDown,new TSButton(__("~O~k"),cmOK,bfDefault));
+ DoAndDel(col,d);
+ execDialog(d,0);
+
+ TEditWindow2 *ed=new TEditWindow2(TRect(1,1,76,21),name);
+ ed->helpCtx=0x1000;
+
+ // Create a clipboard or the user won't be able to copy/paste
+ TView *p=TProgram::application->validView(new TEditWindow(TRect(1,1,76,21),0,2));
+ if (p)
+ {
+ p->hide();
+ TProgram::deskTop->insert(p);
+ TEditor::clipboard=((TEditWindow *)p)->editor;
+ TEditor::clipboard->canUndo=False;
+ TEditor::clipboard->insertText(buf,l,True);
+ }
+ // Function to handle the editor's dialogs
+ TEditor::editorDialog=doSpecialEditDialog;
+ TProgram::deskTop->insert(ed);
+
+ // Make the application work until the editor is killed
+ editorIsAlive=1;
+ do
+ {
+ TEvent e;
+ TProgram::application->getEvent(e);
+ TProgram::application->handleEvent(e);
+ }
+ while (editorIsAlive);
+
+ return 0;
+}
+
+char *ReadFile(FILE *f, long &l)
+{
+ fseek(f,0,SEEK_END);
+ long len=ftell(f);
+ rewind(f);
+ char *s=(char *)malloc(len+l+1);
+ fread(s,len,1,f);
+ s[len]=0;
+ fclose(f);
+ l=len;
+ return s;
+}
+
+int AlreadyInPath()
+{
+ char *path=getenv("PATH");
+ if (path)
+ {
+ strupr(path);
+ for (char *s=path; *s; s++) if (*s=='/') *s='\\';
+ char *dest=strdup(Destination);
+ strupr(dest);
+ int ret=strstr(path,dest)!=0;
+ free(dest);
+ return ret;
+ }
+ return 0;
+}
+
+const char *byHand =__("Edit autoexec.bat yourself later");
+const char *byHandNow=__("Do it yourself but now");
+const char *doItAndSh=__("Let me do it and show you the result");
+const char *doItAndNS=__("Let me do it and don't show you the result");
+char *cSelectHow=__("Select how to do it");
+const char pathComm[]="PATH=%PATH%;";
+const char pathBIN[] ="\\bin";
+const char *Autoexec ="c:/autoexec.bat";
+const char *AutoexecBKP="c:/autoexec.bak";
+const char RemWarning[]="Rem ** By SET Edit Installer ** don't edit\r\n";
+const char *cErrorCreate=__("Error creating autoexec.bat");
+
+int DefinePath()
+{
+ strcat(Destination,pathBIN);
+ for (char *s=Destination; *s; s++) if (*s=='/') *s='\\';
+ if (AlreadyInPath())
+ {
+ AutoExecWasOK=1;
+ return 1;
+ }
+
+ unsigned options=0;
+ int goOn=1,lenPATH;
+ char b[strlen(Destination)+sizeof(pathBIN)+sizeof(pathComm)+sizeof(RemWarning)+3];
+ do
+ {
+ CreateCol(__("Configuring the system"));
+
+ TSStaticText *x1=new TSStaticText(__("The editor was succesfully installed, now you must add the directory\nwhere the editor was installed to your PATH, like this:"));
+ strcpy(b,pathComm);
+ strcat(b,Destination);
+ TSStaticText *x2=new TSStaticText(b,70);
+ strcat(b,"\r\n");
+ lenPATH=strlen(b);
+ memmove(b+sizeof(RemWarning)-1,b,lenPATH+1);
+ memcpy(b,RemWarning,sizeof(RemWarning)-1);
+ lenPATH+=sizeof(RemWarning)-1;
+
+ TSLabel *la=TSLabelRadio(cSelectHow,byHand,byHandNow,doItAndSh,doItAndNS,0);
+ col->insert(2,2,x1);
+ col->insert(2,yTSUnder,x2,0,x1);
+ col->insert(2,yTSUnder,la,0,x2);
+ EasyInsertOKCancel(col);
+ DoAndDel(col,d);
+
+ if (execDialog(d,&options)==cmOK)
+ goOn=0;
+ else
+ if (ConfirmExit())
+ return 0;
+ }
+ while (goOn);
+
+ if (options)
+ {
+ FILE *f=fopen(Autoexec,"rb");
+ if (!f)
+ {
+ messageBox(__("Sorry, I can't find autoexec.bat"),mfError | mfOKButton);
+ options=0;
+ }
+ else
+ { // Ok, get the file
+ long l=lenPATH;
+ char *s=ReadFile(f,l);
+
+ // The user wants to let me try, poor boy ;-)
+ if (options>1)
+ {
+ // Make a backup of the autoexec.bat
+ if (!CopyFile(AutoexecBKP,s,l))
+ {
+ free(s);
+ messageBox(__("Can't backup autoexec.bat. You'll have to do it by yourself"),mfError|mfOKButton);
+ return 0;
+ }
+ // Remove any previous value we put there
+ RemovePATH(s,l);
+ // Insert the line
+ char *line=SearchPATH(s,l);
+ int offset;
+ if (!line)
+ {
+ offset=0; // At the beginning if not found
+ /* I don't think that's really needed
+ memmove(b+sizeof(RemWarning)+4,
+ b+sizeof(RemWarning)-1+sizeof(pathComm)-1,
+ lenPATH-sizeof(pathComm)+1);
+ lenPATH-=7;*/
+ }
+ else
+ {
+ // Look for EOL
+ for (; *line && *line!='\n'; line++);
+ offset=line-s;
+ if (*line)
+ offset++;
+ }
+ // Insert the line
+ memmove(s+offset+lenPATH,s+offset,l+1-offset);
+ memcpy(s+offset,b,lenPATH);
+ l+=lenPATH;
+ }
+ // Ok, the user trusted as (why? ;-)
+ if (options==3)
+ {
+ if (!CopyFile(Autoexec,s,l))
+ {
+ messageBox(cErrorCreate,mfError|mfOKButton);
+ return 0;
+ }
+ return 1;
+ }
+ // He wants to edit
+ char *tmp=tmpnam(0);
+ if (!CopyFile(tmp,s,l))
+ {
+ messageBox(__("Can't create temporal copy of autoexec.bat"),mfError|mfOKButton);
+ return 0;
+ }
+ EditAutoexec(tmp,options>1,b,lenPATH);
+ free(s);
+ f=fopen(tmp,"rb");
+ if (f)
+ {
+ l=0;
+ s=ReadFile(f,l);
+ unlink(tmp);
+ if (CopyFile(Autoexec,s,l))
+ {
+ messageBox(__("A copy of the original autoexec.bat was stored in autoexec.bak"),mfInformation|mfOKButton);
+ return 1;
+ }
+ }
+ unlink(tmp);
+ // Something went wrong, try to fix it
+ rename(AutoexecBKP,Autoexec);
+ messageBox(cErrorCreate,mfError|mfOKButton);
+ }
+ }
+
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Extra test, just in case because Allegro 3.11 detection is weak. Doesn't
+file in the NT server I tested, but a user reported strange things with a
+Workstation.
+
+***************************************************************************/
+
+static
+int IsWindowsNT()
+{
+ char *s=getenv("OS");
+ return s && strcasecmp(s,"Windows_NT")==0;
+}
+
+#define MoveNextS(prev,next) if (ret==retNext) state=next; \
+ else if (ret==retPrev) state=prev;
+#define MoveNext() if (ret==retNext) state++; \
+ else if (ret==retPrev) state--;
+
+void Installer::Start()
+{
+ char *djdir=getenv("DJDIR");
+ int state=staSelType,ret=0;
+
+ SearchOldSET_FILES();
+
+ //TEST
+ #if 0
+ strcpy(Destination,"g:/dj");
+ DefinePath();
+ return;
+ #endif
+ insert(new TStaticText(TRect(0,0,80,1),__("\x3SET Edit installer v1.10, copyright (c) 1999-2003 by Salvador E. Tropea")));
+
+ if (os_type==OSTYPE_WIN95 && !IsWindowsNT())
+ {
+ if (!GetWindowsInformation())
+ messageBox(__("Failed, disabling all or part of the Win9x specific stuff"),mfError | mfOKButton);
+ }
+ // State machine
+ while (state!=staExit && state!=staInstall)
+ {
+ switch (state)
+ {
+ case staSelType:
+ // Type of installation: djgpp, programmer or simple
+ //ret=SelectTypeInstall(0); // Test
+ ret=SelectTypeInstall(djdir);
+ if (ret==retNext)
+ state=staDestination;
+ break;
+ case staDestination:
+ // Ask the destination:
+ //ret=AskDestination(0);// Test
+ ret=AskDestination(djdir);
+ MoveNext();
+ break;
+ case staMiscOps:
+ ret=AskMiscOps();
+ MoveNext();
+ break;
+ case staDesktopOps:
+ ret=AskDesktopOps();
+ MoveNext();
+ break;
+ case staTabOps:
+ ret=AskTabOps();
+ MoveNext();
+ break;
+ case staBackUpOps:
+ ret=AskBackUpOps();
+ MoveNext();
+ break;
+ case staConfirm:
+ ret=ConfirmValues();
+ MoveNextS(staSelType,staInstall);
+ break;
+ }
+ if (ret==retExitUn || (ret==retExit && ConfirmExit()))
+ state=staExit;
+ }
+ if (state==staInstall && DoInstall())
+ { // Ok, all is installed
+ if (!DefinePath())
+ {
+ messageBox(__("Don't forget to update your autoexec.bat later!"),mfInformation | mfOKButton);
+ }
+ char *aux=TVIntl::getTextNew(__(", after rebooting your system you'll be able to use the editor"));
+ messageBox(mfInformation | mfOKButton,__("Editor installed successfully%s. Run it using e.bat"),
+ AutoExecWasOK ? "" : aux);
+ DeleteArray(aux);
+ }
+
+ message(TProgram::application,evCommand,cmQuit,0);
+}
+
+int main(int argc, char **argv)
+{
+ allegro_init();
+
+ if (argc==2 && strncmp(argv[1],"-d",2)==0)
+ {
+ DebugMode=atoi(argv[1]+2);
+ }
+
+ putenv("LFN=y");
+
+ //------ International support
+ #ifndef NO_INTL_SUP
+ char localedir[PATH_MAX];
+ setlocale(LC_ALL, "");
+ strcpy(localedir,".");
+ BINDTEXTDOMAIN("install",localedir);
+ TEXTDOMAIN("install");
+ #endif
+ //------ end of int. support
+
+ TEvent init;
+ init.what=evCommand;
+ init.message.command=cmStart;
+
+ Installer installer;
+ installer.putEvent(init);
+ installer.run();
+
+ return 0;
+}
diff --git a/setedit/install/readme.txt b/setedit/install/readme.txt
new file mode 100644
index 0000000..ad77d82
--- /dev/null
+++ b/setedit/install/readme.txt
@@ -0,0 +1,29 @@
+This directory contains the DOS installer program.
+
+ The file Copyright 1999-2001 by Salvador Eduardo Tropea and is part of the
+setedit so is distributed under the same terms.
+
+ The installer isn't very easy to create and isn't basically needed for
+people compiling from sources.
+
+ To compile it you'll need some extra tools:
+
+* upx: executable compressor.
+ http://cdata.tvnet.hu/~ml/upx.html
+* Allegro 3.1, if you use other version you could need to remove the
+datfile.c from the project and use gpr2mak to generate the makefile.
+ http://www.talula.demon.co.uk/allegro/
+* dat: dat files packager from Allegro.
+* exedat: to attach dat file to executables (also from Allegro).
+* pmodstub: PMODE/DJ stub.
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/
+* cwsdpmi: DPMI Host for DOS.
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/
+* Perl 5.x
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/
+* libwin 0.1.2 by Richard Dawe and RegDos Group:
+ http://www.bigfoot.com/~richdawe/
+
+ To generate the installer run "make installer" in the makes directory.
+
+
diff --git a/setedit/internac/.cvsignore b/setedit/internac/.cvsignore
new file mode 100644
index 0000000..0f4a6ff
--- /dev/null
+++ b/setedit/internac/.cvsignore
@@ -0,0 +1,6 @@
+*.mo
+po_list
+potfiles.po
+Makefile
+emptymsg
+getids \ No newline at end of file
diff --git a/setedit/internac/Makefile b/setedit/internac/Makefile
new file mode 100644
index 0000000..e1a6c27
--- /dev/null
+++ b/setedit/internac/Makefile
@@ -0,0 +1,124 @@
+# 'make languages' will build the language files
+# 'make install.languages' installs the language files at the correct place
+
+CXX=g++
+CXXFLAGS=-march=i686 -mtune=generic -O2 -pipe
+
+ifneq ($(strip $(DJDIR)),)
+export editor_OS:=DJGPP
+endif
+
+# If not DOS then just Linux, no other supported by now
+ifeq ($(strip $(editor_OS)),)
+export editor_OS:=Linux
+endif
+
+srcdir=.
+LANGUAGES=es de
+PACKAGE=setedit
+prefix=$(DJDIR)
+locale_dir=$(prefix)/share/locale
+
+po_list_l=$(shell cat po_list)
+
+ifeq ($(editor_OS),DJGPP)
+# To avoid problems with command line length limit
+po_list_cl=@po_list
+update_p=update
+else
+update_p=cp
+po_list_cl=$(po_list_l)
+endif
+
+po_subdirs=
+
+CFLAGS=-O
+
+ifdef MAINTAINER_MODE
+PO_DEPS=potfiles.po fix.exe $(addprefix h_,$(addsuffix .po,$(LANGUAGES)))
+POTFILES_DEPS=po_list $(po_list_l)
+else
+PO_DEPS=
+POTFILES_DEPS=
+endif
+
+all: $(addsuffix .mo,$(LANGUAGES))
+
+ifeq ($(xgettext),)
+xgettext=xgettext
+endif
+
+ifeq ($(msgmerge),)
+msgmerge=msgmerge
+endif
+
+ifeq ($(msgfmt),)
+msgfmt=msgfmt
+endif
+
+ifeq ($(libintl),)
+libintl=libintl.a
+endif
+
+getcolors.exe: getcolors.cc
+ $(CXX) -o getcolors.exe -s $(CXXFLAGS) -I../setedit/include getcolors.cc
+
+colors.cc: getcolors.exe ../setedit/include/pal.h
+ ./getcolors.exe > colors.cc
+
+po_list: colors.cc ../makes/lista
+ perl makelist.pl
+
+clean:
+ rm -f potfiles.po
+ rm -f $(addsuffix .mo,$(LANGUAGES))
+ rm -f $(addsuffix .po,$(LANGUAGES))
+ rm -f po_list
+
+potfiles.po: $(POTFILES_DEPS)
+#@echo "*** Ignore warnings about unterminated strings, is a bug in gettext."
+#@echo "*** Ulrich Drepper, the maintainer, refuses to fix it."
+ $(xgettext) --default-domain=dummy --add-comments --keyword=_ \
+ --keyword=__ --directory=$(srcdir) --omit-header \
+ --add-location $(po_list_cl)
+ touch dummy.po
+ $(update_p) dummy.po $@
+ rm dummy.po
+
+T=$(subst /,\,$@)
+
+fix.exe: fix.c
+ $(CXX) -o fix.exe -s $(CXXFLAGS) fix.c
+
+$(addsuffix .po,$(LANGUAGES)): $(PO_DEPS)
+#if not exist $(T) cp $^ $@
+ touch $@
+ ./fix.exe $(addprefix h_,$@) $< __.pot
+ -$(msgmerge) --force-po -o __.pon $@ __.pot
+ -$(update_p) __.pon $@
+ rm -f __.pon
+ rm -f __.pot
+ ./fix.exe $(addprefix h_,$@) $@ $@
+#$(addsuffix .mo,$(LANGUAGES)): $(msgfmt)
+
+%.mo: %.po
+ -$(msgfmt) -o $@ $<
+
+
+languages: $(addsuffix .mo,$(LANGUAGES))
+
+# This creates the .po files for each language from $(LANGUAGES)
+# See the sample translated file de.po, how to translate
+languages.src: $(addsuffix .po,$(LANGUAGES))
+
+#if you don't have the fileutils 3.13, you must copy the files manually
+%.ins: %.mo
+ ginstall -d $(locale_dir)/$*/LC_MESSAGES
+ -ginstall $< $(locale_dir)/$*/LC_MESSAGES/$(PACKAGE).mo
+
+install.languages.start:
+ rm -f languages.log
+
+install: languages install.languages.start \
+ $(addsuffix .ins,$(LANGUAGES))
+
diff --git a/setedit/internac/colors.cc b/setedit/internac/colors.cc
new file mode 100644
index 0000000..5cd9ef1
--- /dev/null
+++ b/setedit/internac/colors.cc
@@ -0,0 +1,202 @@
+__("Color")
+
+Group: __("Desktop")
+__("Normal")
+
+Group: __("Menus")
+__("Disabled")
+__("Shortcut")
+__("Selected")
+__("Selected disabled")
+__("Shortcut selected")
+__("Frame disabled")
+
+Group: __("Blue Windows")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Static text")
+__("Selected text")
+__("reserved")
+__("Frame disabled")
+
+Group: __("Cyan Windows")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Static text")
+__("Selected text")
+__("Reserved")
+__("Frame disabled")
+
+Group: __("Gray Windows")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Static text")
+__("Selected text")
+__("Reserved")
+__("Frame disabled")
+
+Group: __("Dialogs")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Static text")
+__("Label normal")
+__("Label selected")
+__("Label shortcut")
+__("Button normal")
+__("Button default")
+__("Button selected")
+__("Button disabled")
+__("Button shortcut")
+__("Button shadow")
+__("Cluster normal")
+__("Cluster selected")
+__("Cluster shortcut")
+__("Input normal")
+__("Input selected")
+__("Input arrow")
+__("History button")
+__("History sides")
+__("History bar page")
+__("History bar icons")
+__("List normal")
+__("List focused")
+__("List selected")
+__("List divider")
+__("Information pane")
+__("Cluster disabled")
+__("Reserved")
+__("Normal text")
+
+Group: __("Blue Editor")
+__("Marked text")
+__("Comment")
+__("Reserved word")
+__("Identifier")
+__("Symbol")
+__("String")
+__("Integer")
+__("Float")
+__("Octal")
+__("Hex")
+__("Character")
+__("Preprocessor")
+__("Illegal char")
+__("User defined words")
+__("CPU line")
+__("Breakpoint")
+__("Symbol2")
+__("Normal text")
+
+Group: __("Cyan Editor")
+__("Marked text")
+__("Comment")
+__("Reserved word")
+__("Identifier")
+__("Symbol")
+__("String")
+__("Integer")
+__("Float")
+__("Octal")
+__("Hex")
+__("Character")
+__("Preprocessor")
+__("Illegal char")
+__("User defined words")
+__("CPU line")
+__("Breakpoint")
+__("Symbol2")
+__("Normal text")
+
+Group: __("Gray Editor")
+__("Marked text")
+__("Comment")
+__("Reserved word")
+__("Identifier")
+__("Symbol")
+__("String")
+__("Integer")
+__("Float")
+__("Octal")
+__("Hex")
+__("Character")
+__("Preprocessor")
+__("Illegal char")
+__("User defined words")
+__("CPU line")
+__("Breakpoint")
+__("Symbol2")
+__("Cross cursor")
+
+Group: __("Specials for editors")
+__("Editor statusline")
+__("Parens matching")
+__("Rectangle block")
+__("Odd tab")
+__("Even tab")
+__("Column markers")
+__("Reserved")
+__("Reserved")
+__("Reserved")
+__("Frame disabled")
+
+Group: __("Info viewer")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Normal text")
+__("Keyword")
+__("Selected keyword")
+__("Marked keyword")
+__("Marked text")
+__("Frame disabled")
+
+Group: __("Man page viewer")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Static text")
+__("Selected text")
+__("Bold text")
+__("Underlined text")
+__("Reserved")
+__("Reserved")
+__("Reserved")
+__("Reserved")
+__("Frame disabled")
+
+Group: __("DataWindow")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Normal Text(active)")
+__("Normal Text(inactive)")
+__("Focused Text")
+__("Selected Text")
+__("Changed text")
+__("Reserved")
+__("Reserved")
+__("Reserved")
+__("Frame disabled")
+
+Group: __("Message Window")
+__("Frame")
+__("Frame icons")
+__("Scroll bar page")
+__("Scroll bar icons")
+__("Normal")
+__("Focused")
+__("Selected")
+__("Information")
+__("Warnings")
+__("Errors")
diff --git a/setedit/internac/de.po b/setedit/internac/de.po
new file mode 100644
index 0000000..c0c90cc
--- /dev/null
+++ b/setedit/internac/de.po
@@ -0,0 +1,7715 @@
+# German translation file for SETEdit.
+# Copyright (C) 2001 Salvador E. Tropea.
+# Robert Hhne <robert.hoehne@gmx.net>, 2001.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: setedit 0.5.5\n"
+"PO-Revision-Date: 2007-04-24 09:37-0300\n"
+"Last-Translator: Oliver Schieche <oliver.schieche@d2mail.de>\n"
+"Language-Team: German <set@ieee.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+# End of header
+#. EN: E
+#: ../calcu/calcu.cc:83 ../setedit/debug.cc:5846 ../setedit/debug.cc:7750
+msgid "~E~xpression"
+msgstr "~A~usdruck"
+
+#: ../calcu/calcu.cc:89 ../setedit/debug.cc:1597
+msgid "~R~esult"
+msgstr "~R~esultat"
+
+#: ../calcu/calcu.cc:93 ../setedit/debug.cc:1602
+msgid "E~v~al"
+msgstr "~A~uswerten"
+
+#. ok->view->growMode=gfGrowAll;
+#: ../calcu/calcu.cc:96 ../easydiag/tsbutton.cc:92 ../easydiag/tsbutton.cc:101
+#: ../infview/inf.cc:2364 ../infview/inf.cc:2387 ../infview/inf.cc:2412
+#: ../infview/inf.cc:2436 ../infview/inf.cc:2491 ../infview/infmain.cc:385
+#: ../install/install.cc:476 ../install/install.cc:484 ../mainsrc/bufun.cc:741
+#: ../mainsrc/deedidia.cc:135 ../mainsrc/deedidia.cc:180
+#: ../mainsrc/deedidia.cc:272 ../mainsrc/deedidia.cc:324
+#: ../mainsrc/deedidia.cc:343 ../mainsrc/sdginter.cc:193
+#: ../mainsrc/slpinter.cc:712 ../mainsrc/tags.cc:1523 ../mainsrc/tags.cc:1751
+#: ../setedit/debug.cc:1604 ../setedit/edprefs.cc:472
+#: ../setedit/edprefs.cc:617 ../setedit/edprefs.cc:684
+#: ../setedit/edprefs.cc:913 ../setedit/intgrep.cc:421
+#: ../setedit/winlistd.cc:143 ../settvuti/diaghelp.cc:41
+msgid "Cancel"
+msgstr "Abbruch"
+
+#: ../calcu/calcu.cc:99 ../infview/infmenu.cc:43 ../setedit/debug.cc:1605
+#: ../setedit/editmenu.cc:78 ../setedit/editmenu.cc:108
+msgid "~C~opy"
+msgstr "~K~opieren"
+
+#: ../calcu/calcu.cc:102 ../setedit/debug.cc:1606 ../setedit/editmenu.cc:79
+#: ../setedit/editmenu.cc:109
+msgid "~P~aste"
+msgstr "~E~infgen"
+
+#: ../calcu/calcu.cc:123
+#, c-format
+msgid "Error in expression (%d)"
+msgstr "Fehler in Ausdruck (%d)"
+
+#: ../calcu/calcu.cc:165
+msgid "Calculator"
+msgstr "Rechner"
+
+#: ../calcu/calcu.cc:176 ../setedit/editmain.cc:1516
+msgid "This functionality was disabled at compile time"
+msgstr ""
+
+#: ../easydiag/test.cc:327
+msgid "Sliders"
+msgstr "Deslizadores"
+
+#: ../easydiag/tsbutton.cc:91 ../easydiag/tsbutton.cc:99
+#: ../infview/infmain.cc:384 ../mainsrc/bufun.cc:740
+#: ../mainsrc/deedidia.cc:134 ../mainsrc/deedidia.cc:178
+#: ../mainsrc/deedidia.cc:271 ../mainsrc/deedidia.cc:323
+#: ../mainsrc/loaddefl.cc:713 ../mainsrc/loadusew.cc:393
+#: ../mainsrc/sdginter.cc:192 ../mainsrc/slpinter.cc:711
+#: ../mainsrc/tags.cc:1545 ../setedit/advice.cc:138 ../setedit/boardmix.cc:119
+#: ../setedit/edprefs.cc:239 ../setedit/edprefs.cc:471
+#: ../setedit/edprefs.cc:616 ../setedit/edprefs.cc:683
+#: ../setedit/edprefs.cc:912 ../setedit/intgrep.cc:420 ../setedit/tips.cc:213
+msgid "O~K~"
+msgstr "O~K"
+
+#: ../infview/inf.cc:701
+#, c-format
+msgid "InfView - File: %s - Node: %s"
+msgstr "InfView - Datei: %s - Knoten: %s"
+
+#: ../infview/inf.cc:882 ../infview/manview.cc:313 ../mainsrc/ceditor.cc:454
+#, c-format
+msgid "Error copying to clipboard: %s"
+msgstr ""
+
+#: ../infview/inf.cc:1635
+msgid "Open Info"
+msgstr "Info ffnen"
+
+#: ../infview/inf.cc:1846
+msgid "Please wait"
+msgstr "Bitte warten"
+
+#: ../infview/inf.cc:1846
+msgid "Searching ..."
+msgstr "Suche..."
+
+#: ../infview/inf.cc:1964
+msgid "Sorry can't find the string"
+msgstr "Sorry, kann den Text nicht finden"
+
+# unclear
+#: ../infview/inf.cc:2297
+msgid "Help Control"
+msgstr "Hilfe Kontrolle"
+
+#: ../infview/inf.cc:2300 ../infview/infmenu.cc:70 ../setedit/editmenu.cc:119
+msgid "~N~ext"
+msgstr "~N~chstes"
+
+#: ../infview/inf.cc:2303 ../infview/infmenu.cc:71 ../setedit/editmenu.cc:120
+msgid "~P~revious"
+msgstr "~V~orherige"
+
+#: ../infview/inf.cc:2306 ../setedit/editmenu.cc:396
+msgid "~U~p"
+msgstr "~H~och"
+
+#: ../infview/inf.cc:2309
+msgid "Prev. ~H~ist."
+msgstr "Vorh. ~V~erl."
+
+#: ../infview/inf.cc:2312
+msgid "Nodes ~L~ist"
+msgstr "Knoten~l~iste"
+
+#: ../infview/inf.cc:2315 ../infview/infmenu.cc:61
+msgid "~B~ookmarks"
+msgstr "~L~esezeichen"
+
+#: ../infview/inf.cc:2318 ../infview/infmenu.cc:59
+msgid "~C~onfiguration"
+msgstr "~K~onfiguration"
+
+#: ../infview/inf.cc:2321
+msgid "~O~pen Info"
+msgstr "~f~fne Info"
+
+#: ../infview/inf.cc:2324
+msgid "H~i~de"
+msgstr "~V~erbergen"
+
+#: ../infview/inf.cc:2331
+msgid "Hi~s~tory"
+msgstr "~V~erlauf"
+
+#: ../infview/inf.cc:2341
+msgid "Inf Find"
+msgstr "Inf Suche"
+
+#. All together
+#: ../infview/inf.cc:2348 ../mainsrc/deedidia.cc:119
+#: ../mainsrc/deedidia.cc:157
+msgid "~T~ext to find"
+msgstr "~S~uchtext"
+
+#: ../infview/inf.cc:2353 ../mainsrc/deedidia.cc:122
+#: ../mainsrc/deedidia.cc:164 ../mainsrc/ssyntax.cc:479
+msgid "~C~ase sensitive"
+msgstr "Gro/~K~lein beachten"
+
+#: ../infview/inf.cc:2354 ../mainsrc/deedidia.cc:123
+#: ../mainsrc/deedidia.cc:164
+msgid "~W~hole words only"
+msgstr "Nur ~g~anze Wrter"
+
+#: ../infview/inf.cc:2357
+msgid "In current ~t~opic"
+msgstr "Im aktuellen ~T~hema"
+
+#: ../infview/inf.cc:2358
+msgid "In the ~f~ile"
+msgstr "In der Datei"
+
+#: ../infview/inf.cc:2359
+msgid "In ~a~ll files"
+msgstr "In ~a~llen Dateien"
+
+#: ../infview/inf.cc:2362 ../infview/inf.cc:2385 ../infview/inf.cc:2408
+#: ../infview/inf.cc:2434 ../setedit/editdiag.cc:88 ../setedit/editdiag.cc:180
+#: ../setedit/editpale.cc:165 ../settvuti/diaghelp.cc:38
+msgid "~O~K"
+msgstr "~O~K"
+
+#: ../infview/inf.cc:2373
+msgid "Go To"
+msgstr "Gehe zu"
+
+#: ../infview/inf.cc:2380
+msgid "~N~ame of Node"
+msgstr "Knoten~n~ame"
+
+#. Make it growable
+#: ../infview/inf.cc:2399
+msgid "Tag Table"
+msgstr "Markierungsliste"
+
+#: ../infview/inf.cc:2406
+msgid "~N~odes"
+msgstr "~K~noten"
+
+#: ../infview/inf.cc:2426
+msgid "InfView Configuration"
+msgstr "InfView Konfiguration"
+
+#: ../infview/inf.cc:2431
+msgid "Hide '*~N~ote' word"
+msgstr "Verstecke `*~N~ode' Wort"
+
+#: ../infview/inf.cc:2432
+msgid "Hide real ~l~ink name"
+msgstr "Verstecke ~L~inknamen"
+
+#: ../infview/inf.cc:2475
+msgid "InfView Bookmarks"
+msgstr "InfView Lesezeichen"
+
+#: ../infview/inf.cc:2483 ../mp3/mp3list.cc:333 ../settvuti/tdiagaid.cc:168
+msgid "~A~dd"
+msgstr "~H~inzufgen"
+
+#: ../infview/inf.cc:2487 ../mp3/mp3list.cc:335 ../setedit/debug.cc:4308
+#: ../setedit/debug.cc:4915 ../setedit/winlistd.cc:140
+#: ../settvuti/tdiagaid.cc:170
+msgid "~D~elete"
+msgstr "~L~sche"
+
+#: ../infview/inf.cc:2494
+msgid "~G~o to"
+msgstr "~G~ehe zu"
+
+#: ../infview/inf.cc:2506
+msgid "~M~arks"
+msgstr "~M~arkierungen"
+
+#: ../infview/infbase.cc:264
+#, fuzzy
+msgid ""
+"Attention !! This file is in DOS format, Do you want to convert it?, But "
+"maybe make a backup first !!"
+msgstr ""
+"Achhtung !! Diese Datei ist im DOS Format. Wollen Sie sie umwandeln? "
+"(Erstellen Sie zuerst eine Kopie!)"
+
+#: ../infview/infbase.cc:281
+msgid "Error: can't find the Node info"
+msgstr "Fehler: Kann Knoten info nicht finden"
+
+#: ../infview/infbase.cc:1122
+msgid "Reading index table for: "
+msgstr "Lese Indextabelle fr: "
+
+#: ../infview/infbase.cc:1126
+msgid "InfView"
+msgstr "InfView"
+
+#: ../infview/infbase.cc:1295
+#, fuzzy, c-format
+msgid "Attention: can't open the help file '%s'."
+msgstr "Achtung! Kann Hilfedatei `%s' nicht ffnen!"
+
+#: ../infview/infbase.cc:1891
+#, fuzzy
+msgid ""
+"\n"
+" Sorry, I can't find this link (press ALT-F1).\n"
+msgstr ""
+"\n"
+" Sorry, kann diesen Link nicht finden (drcken Sie ALT-F1).\n"
+
+#: ../infview/infmain.cc:352 ../setedit/edprefs.cc:869
+#, fuzzy
+msgid "~A~pplication"
+msgstr "~O~ptionen"
+
+#: ../infview/infmain.cc:352 ../infview/infmain.cc:358
+#: ../infview/infmain.cc:369 ../setedit/edprefs.cc:869
+#: ../setedit/edprefs.cc:875 ../setedit/edprefs.cc:886
+#: ../setedit/edprefs.cc:894
+#, fuzzy
+msgid "Force encoding"
+msgstr "Sekundr encoding"
+
+#: ../infview/infmain.cc:358 ../setedit/edprefs.cc:875
+#, fuzzy
+msgid "~I~nput"
+msgstr "~E~infgen"
+
+#: ../infview/infmain.cc:369 ../setedit/edprefs.cc:886
+#, fuzzy
+msgid "~S~creen"
+msgstr "Bildschirm~m~odus"
+
+#: ../infview/infmain.cc:377 ../setedit/edprefs.cc:905
+msgid "Encodings"
+msgstr ""
+
+#: ../infview/infmain.cc:386 ../setedit/edprefs.cc:914
+#, fuzzy
+msgid "Set ~D~efaults"
+msgstr "~O~riginal"
+
+#: ../infview/infmain.cc:459 ../setedit/dstfile.cc:606
+#, c-format
+msgid "Could not create %s."
+msgstr "Konnte Projekt `%s' nicht erstellen."
+
+#: ../infview/infmain.cc:506 ../setedit/dstfile.cc:531
+msgid "Could not open desktop file"
+msgstr "Konnte Desktopdatei nicht finden."
+
+#: ../infview/infmain.cc:511
+msgid "Wrong desktop file"
+msgstr "Falsche Desktopdatei."
+
+#: ../infview/infmain.cc:517 ../setedit/dstfile.cc:542
+msgid "Error reading desktop file"
+msgstr "Fehler beim Lesen der Desktopdatei"
+
+#: ../infview/infmain.cc:662
+#, c-format
+msgid "InfView v"
+msgstr "InfView v"
+
+#: ../infview/infmain.cc:663
+#, c-format
+msgid ""
+"infview [option]... [info_file [menu_item...]]\n"
+"\n"
+msgstr ""
+"infview [option]... [info_datei [men_eintrag...]]\n"
+"\n"
+
+#: ../infview/infmain.cc:664 ../setedit/editmain.cc:2905
+#, c-format
+msgid "Valid options are:\n"
+msgstr "Gltige Optionen sind:\n"
+
+#: ../infview/infmain.cc:665
+#, c-format
+msgid ""
+"-d, --directory DIR adds a directory to the list of directories to "
+"search\n"
+" (DIR to INFOPATH)\n"
+msgstr ""
+"-d, --directorio DIR fgt der Verzeichnisliste ein weiteres hinzu\n"
+" (DIR zu INFOPATH)\n"
+
+#: ../infview/infmain.cc:667
+#, c-format
+msgid "-f, --file FILENAME load FILENAME info file.\n"
+msgstr "-f, --file DATEI_NAME lade DATEI_NAME info Datei.\n"
+
+#: ../infview/infmain.cc:669
+#, c-format
+msgid "-l, --force-no-lfn avoids the use of long file names under W9x.\n"
+msgstr ""
+"-l, --force-no-lfn verhindert die Benutzung von langen Dateinamen\n"
+" unter Win9x\n"
+
+#: ../infview/infmain.cc:670
+#, c-format
+msgid "-L, --force-lfn forces the use of long file names under W9x.\n"
+msgstr "-L, --force-lfn lange Dateinamen unter Win9x erzwingen.\n"
+
+#: ../infview/infmain.cc:672
+#, c-format
+msgid ""
+"-k, --use-rh-52-keys enables the Red Hat 5.2 style keyboard mapping.\n"
+msgstr ""
+"-k, --use-rh-52-keys schaltet das Red Hat 5.2 Tastatur mapping ein\n"
+
+#: ../infview/infmain.cc:674
+#, c-format
+msgid "-n, --node NODE jumps to this node.\n"
+msgstr "-n, --node KNOTEN zu Knoten KNOTEN springen.\n"
+
+#: ../infview/infmain.cc:675
+#, c-format
+msgid "-r, --read-dkt FILENAME if no file is opened use this desktop file.\n"
+msgstr ""
+"-r, --read-dkt DATEI Desktopdatei DATEI benutzen, wenn keine Datei\n"
+" geffnet wird.\n"
+
+#: ../infview/infmain.cc:676
+#, c-format
+msgid "-s, --save-dkt FILENAME save the desktop to this file at exit.\n"
+msgstr "-s, --save-dkt DATEI Desktop in DATEI beim Verlassen speichern\n"
+
+#: ../infview/infmain.cc:677
+#, c-format
+msgid ""
+"-h, --help displays this text ;-).\n"
+"\n"
+msgstr ""
+"-h, --help Zeigt diesen Text ;).\n"
+"\n"
+
+#: ../infview/infmain.cc:678
+#, c-format
+msgid ""
+"The first argument, if present, is the name of the Info file to read.\n"
+"Any remaining arguments are treated as the names of menu items in the "
+"initial\n"
+msgstr ""
+
+#: ../infview/infmain.cc:681
+#, c-format
+msgid ""
+"node visited. For example, `infview libc \"function index\" printf' moves "
+"to the\n"
+"node `Function Index' and then to `printf' in the info file `libc'.\n"
+"\n"
+msgstr ""
+
+#: ../infview/infmain.cc:684
+#, c-format
+msgid ""
+"node visited. For example, `infview libc alpha printf' moves to the node\n"
+"`Alphabetical list' and then to `printf' in the info file `libc'.\n"
+"\n"
+msgstr ""
+
+#: ../infview/infmain.cc:687
+#, c-format
+msgid ""
+"Also note that info files are searched in the INFOPATH directories. To load "
+"a\n"
+"file stored in the current directory add ./ at the beginning of the name.\n"
+"Email bug reports to salvador@inti.gov.ar or djgpp@delorie.com.\n"
+msgstr ""
+
+#: ../infview/infmain.cc:937
+#, c-format
+msgid "Could not find '%s'."
+msgstr "Konnte `%s' nicht finden."
+
+#. Spanish: ABCEHMPRV
+#. English: CEFHMPSVW
+#: ../infview/infmenu.cc:31 ../setedit/editmenu.cc:60
+msgid "~F~ile"
+msgstr "~D~atei"
+
+#: ../infview/infmenu.cc:32
+msgid "~N~ew InfView window"
+msgstr ""
+
+#: ../infview/infmenu.cc:33
+#, fuzzy
+msgid "~O~pen info file"
+msgstr "~f~fne Info"
+
+#: ../infview/infmenu.cc:34
+msgid "Open ~m~anpage"
+msgstr ""
+
+#: ../infview/infmenu.cc:36
+msgid "~D~OS shell"
+msgstr "~D~OS Shell"
+
+#: ../infview/infmenu.cc:38 ../setedit/editmenu.cc:69
+#: ../setedit/editmenu.cc:312
+#, fuzzy
+msgid "S~h~ell"
+msgstr "~A~lles"
+
+#: ../infview/infmenu.cc:40 ../mainsrc/tags.cc:1810 ../setedit/debug.cc:4305
+#: ../setedit/debug.cc:4912 ../setedit/editmenu.cc:70
+msgid "E~x~it"
+msgstr "~B~eenden"
+
+#: ../infview/infmenu.cc:42 ../mainsrc/loaddefl.cc:712
+#: ../mainsrc/loadusew.cc:392 ../setedit/editmenu.cc:73
+msgid "~E~dit"
+msgstr "~B~earbeiten"
+
+#: ../infview/infmenu.cc:45
+#, fuzzy
+msgid "~G~oto"
+msgstr "~G~ehe zu"
+
+#: ../infview/infmenu.cc:46
+msgid "Goto: (~F~ile)Node"
+msgstr ""
+
+#: ../infview/infmenu.cc:47
+#, fuzzy
+msgid "~N~ode list"
+msgstr "~K~noten"
+
+#: ../infview/infmenu.cc:48
+#, fuzzy
+msgid "N~e~xt node"
+msgstr "~Z~ur Codepage"
+
+#: ../infview/infmenu.cc:49
+#, fuzzy
+msgid "~P~revious node"
+msgstr "~V~orherige"
+
+#: ../infview/infmenu.cc:50
+#, fuzzy
+msgid "~U~pper node"
+msgstr "~f~fne Info"
+
+#: ../infview/infmenu.cc:51
+#, fuzzy
+msgid "~T~op node"
+msgstr "~Z~ur Codepage"
+
+#: ../infview/infmenu.cc:52
+#, fuzzy
+msgid "~D~irectory"
+msgstr "Kann Verzeichnis nicht erstellen:"
+
+#: ../infview/infmenu.cc:54 ../infview/infmenu.cc:55 ../setedit/editmenu.cc:93
+msgid "~S~earch"
+msgstr "~S~uche"
+
+#: ../infview/infmenu.cc:56
+#, fuzzy
+msgid "Search ~a~gain"
+msgstr "~W~iederhole Suche"
+
+#: ../infview/infmenu.cc:58
+#, fuzzy
+msgid "~I~nfview"
+msgstr "InfView"
+
+#: ../infview/infmenu.cc:60
+#, fuzzy
+msgid "~H~istory"
+msgstr "~V~erlauf"
+
+#: ../infview/infmenu.cc:62
+#, fuzzy
+msgid "~S~creen configuration"
+msgstr "~K~onfiguration"
+
+#: ../infview/infmenu.cc:63
+#, fuzzy
+msgid "~A~bout"
+msgstr "~b~er"
+
+#: ../infview/infmenu.cc:65 ../setedit/editmenu.cc:114
+msgid "~W~indows"
+msgstr "~F~enster"
+
+#: ../infview/infmenu.cc:66 ../setedit/editmenu.cc:115
+msgid "~S~ize/move"
+msgstr "~G~re ndern/Bewegen"
+
+#: ../infview/infmenu.cc:67 ../setedit/editmenu.cc:116
+msgid "~Z~oom"
+msgstr "~Z~oom"
+
+#: ../infview/infmenu.cc:68 ../setedit/editmenu.cc:117
+msgid "~T~ile"
+msgstr "~T~eilen"
+
+#: ../infview/infmenu.cc:69 ../setedit/editmenu.cc:118
+msgid "C~a~scade"
+msgstr "~b~erlappend"
+
+#: ../infview/infmenu.cc:72 ../setedit/editmenu.cc:121
+#: ../setedit/editmenu.cc:139
+msgid "~C~lose"
+msgstr "S~c~hlieen"
+
+#: ../infview/infmenu.cc:83 ../setedit/editmenu.cc:173
+msgid "~Alt+F1~ Back"
+msgstr "~Alt+F1~ Zurck"
+
+#: ../infview/infmenu.cc:84 ../setedit/editmenu.cc:174
+msgid "~Alt+F10~ Control"
+msgstr "~Alt+F10~ Steuerg"
+
+#: ../infview/infmenu.cc:85 ../setedit/editmenu.cc:183
+#: ../setedit/editmenu.cc:202 ../setedit/editmenu.cc:205
+msgid "~F1~ Help"
+msgstr "~F1~ Hilfe"
+
+#: ../infview/infmenu.cc:86
+#, fuzzy
+msgid "~Ctrl+O~ Index"
+msgstr "~Alt+I~ Include"
+
+#: ../infview/infmenu.cc:87 ../infview/infmenu.cc:89
+#: ../setedit/editmenu.cc:164 ../setedit/editmenu.cc:188
+#: ../setedit/editmenu.cc:206
+msgid "~F5~ Zoom"
+msgstr "~F5~ Zoom"
+
+#: ../infview/infmenu.cc:90 ../setedit/editmenu.cc:165
+msgid "~F6~ Next"
+msgstr "~F6~ Nchstes"
+
+#: ../infview/infmenu.cc:91 ../setedit/editmenu.cc:166
+msgid "~F10~ Menu"
+msgstr "~F10~ Men"
+
+#: ../infview/infmenu.cc:98 ../setedit/editmenu.cc:213
+msgid "Not enough memory for this operation."
+msgstr "Nicht genug Speicher fr diese Operation."
+
+#: ../infview/manview.cc:304 ../mainsrc/ceditor.cc:447
+#: ../mainsrc/ceditor.cc:521
+msgid "Sorry but no OS specific clipboard is available"
+msgstr ""
+
+#: ../infview/manview.cc:751
+msgid "You must install man to use it!"
+msgstr "Sie mssen man installieren, um dies zu benutzen!"
+
+#: ../infview/manview.cc:780
+msgid "Man page to view"
+msgstr "Man Seite zum Anzeigen"
+
+#: ../infview/manview.cc:783
+msgid "~M~an page for ..."
+msgstr "~M~an-Seite fr..."
+
+#: ../infview/manview.cc:784
+msgid "~S~ection"
+msgstr "~S~ektion"
+
+#: ../infview/manview.cc:785
+msgid "~E~xtra options"
+msgstr "~E~xtraeinstellungen"
+
+#: ../install/install.cc:148
+msgid "Type of installation"
+msgstr "Installationstyp"
+
+#: ../install/install.cc:149
+msgid "Destination directory"
+msgstr "Zielverzeichnis"
+
+#: ../install/install.cc:150
+msgid "Miscellaneous options"
+msgstr "Verschiedene Optionen"
+
+#: ../install/install.cc:151
+msgid "Add a direct access to the desktop"
+msgstr "Eine Verknpfung auf dem Desktop erstellen"
+
+#: ../install/install.cc:152
+msgid "Add setedit to the Start\\Programs menu"
+msgstr "setedit ins Men Start\\Programme aufnehmen"
+
+#: ../install/install.cc:153
+msgid "Configure the editor's menu like in Win. programs (eg. ^C=copy)"
+msgstr "Stelle Editor-Men wie in Win Programmen ein (d.h. ^C=Kopieren)"
+
+#: ../install/install.cc:154
+msgid "Extra screen savers (around 160 Kb)"
+msgstr "Zustzliche Bildschirmschoner (etwa 160 kB)"
+
+#: ../install/install.cc:155
+#, fuzzy
+msgid "Desktop files"
+msgstr "Falsche Desktopdatei."
+
+#: ../install/install.cc:156
+msgid ""
+"The editor stores configuration options in files called desktop files. These "
+"files also store information about what files are opened and the size, "
+"position, etc. of the windows. You can have only one global file for this or "
+"one in each directory you use the editor in. Which option do you prefer?"
+msgstr ""
+
+#: ../install/install.cc:160
+#, fuzzy
+msgid "A desktop file in each directory"
+msgstr "Zielverzeichnis"
+
+#: ../install/install.cc:161
+#, fuzzy
+msgid "One central desktop file."
+msgstr "Falsche Desktopdatei."
+
+#: ../install/install.cc:162
+#, fuzzy
+msgid "Indent using..."
+msgstr "Schiebe ein Leerzeichen ein"
+
+#: ../install/install.cc:163
+msgid ""
+"The editor is set by default to indent text using spaces. To configure the "
+"editor to use tabs more than one option must be selected. What do you want "
+"to use for indentation?"
+msgstr ""
+
+#: ../install/install.cc:166
+#, fuzzy
+msgid "Spaces"
+msgstr "Ersetzen"
+
+#: ../install/install.cc:167
+msgid "Tabs"
+msgstr ""
+
+#: ../install/install.cc:168
+msgid "Backup files"
+msgstr ""
+
+#: ../install/install.cc:169
+msgid ""
+"Each time the editor stores a modified file to disk a backup file can be "
+"created in case you want to revert the changes. This is especially useful "
+"when you already exited the editor and hence the undo option isn't "
+"available. Do you want to create backup files?"
+msgstr ""
+
+#: ../install/install.cc:173
+#, fuzzy
+msgid "No"
+msgstr "Nov"
+
+#: ../install/install.cc:174
+#, fuzzy
+msgid "Yes, create backup files"
+msgstr "~K~eine Desktopdateien erstellen"
+
+#: ../install/install.cc:332
+#, fuzzy, c-format
+msgid "Can't create the directory: %s"
+msgstr "Kann Verzeichnis nicht erstellen:"
+
+#: ../install/install.cc:339
+#, fuzzy, c-format
+msgid "File name in path: %s"
+msgstr "Dateiname im Pfad:"
+
+#: ../install/install.cc:390
+#, fuzzy
+msgid ""
+"~Ctrl-F4~ Finish editing, or click on the button found in the top left corner"
+msgstr ""
+"~Strg-F4~ Bearbeitung beenden, oder Knopf in der linken, oberen Ecke klicken"
+
+#: ../install/install.cc:393
+msgid "~ESC~ Aborts installation"
+msgstr "~ESC~ Bricht Installation ab"
+
+#: ../install/install.cc:433
+msgid "Are you sure you want to abort the installation?"
+msgstr "Sind Sie sich sicher, da Sie die Installation abbrechen wollen?"
+
+#: ../install/install.cc:437
+msgid "Select the type"
+msgstr "Typ auswhlen"
+
+#: ../install/install.cc:438 ../internac/colors.cc:4 ../internac/colors.cc:197
+msgid "Normal"
+msgstr "Normal"
+
+#: ../install/install.cc:439
+msgid "For programmers"
+msgstr "Fr Programmierer"
+
+#: ../install/install.cc:440
+msgid "For djgpp programmers"
+msgstr "Fr djgpp Programmierer"
+
+#: ../install/install.cc:465
+msgid ""
+"Looks like djgpp isn't installed. DJGPP environment variable isn't defined "
+"or is wrong. Exit to fix it first?"
+msgstr ""
+"Sieht so aus, als ob djgpp nicht installiert ist. DJGPP Umgebungsvariable "
+"ist nicht gesetzt bzw. falsch. Wollen Sie beenden, um es zu reparieren?"
+
+#: ../install/install.cc:474
+msgid "< ~P~rev"
+msgstr "< ~V~orherige"
+
+#: ../install/install.cc:475
+msgid "> ~N~ext"
+msgstr "> ~N~chste"
+
+#: ../install/install.cc:482 ../mainsrc/deedidia.cc:340
+#: ../setedit/advice.cc:127 ../setedit/advice.cc:134
+msgid "~Y~es"
+msgstr "~J~a"
+
+#: ../install/install.cc:483 ../mainsrc/deedidia.cc:341
+#: ../setedit/advice.cc:128 ../setedit/advice.cc:133
+msgid "~N~o"
+msgstr "~N~ein"
+
+#: ../install/install.cc:518
+msgid "Where do you want to install the editor?"
+msgstr "Wo wollen Sie den Editor installieren?"
+
+#: ../install/install.cc:547
+msgid "Invalid drive"
+msgstr "Ungltiges Laufwerk"
+
+#: ../install/install.cc:553
+msgid "Can't create files there"
+msgstr "Kann dort keine Dateien erstellen"
+
+#: ../install/install.cc:559
+#, fuzzy
+msgid ""
+"You already installed the editor (or tried to), but in a different place. Do "
+"you want to continue?"
+msgstr ""
+"Sie haben den Editor bereits installiert, jedoch in einem anderen "
+"Verzeichnis. Wollen Sie fortfahren?"
+
+#: ../install/install.cc:649
+msgid "Searching Windows information"
+msgstr "Suche Windows-Information"
+
+#: ../install/install.cc:651
+msgid ""
+"Windows 9x or similar detected, wait while\n"
+"finding information about your system"
+msgstr ""
+"Windows 9x oder hnliches entdeckt. Warten Sie eine\n"
+"Weile, whrend ich Informationen ber Ihr System sammle"
+
+#: ../install/install.cc:652 ../install/install.cc:669
+msgid "Looking in registry "
+msgstr "Lese die Registrierung "
+
+#: ../install/install.cc:664
+msgid "Searching programs dir"
+msgstr "Suche `Programme'-Verzeichnis"
+
+#: ../install/install.cc:672
+msgid "Searching desktop and menu"
+msgstr "Suche Desktop und Men"
+
+#: ../install/install.cc:854
+msgid " Normal"
+msgstr " Normal"
+
+#: ../install/install.cc:857
+msgid " For programmers"
+msgstr " Fr Programmierer"
+
+#. instDJGPP
+#: ../install/install.cc:860
+msgid " For djgpp programmers"
+msgstr " Fr djgpp-Programmierer"
+
+#: ../install/install.cc:901
+msgid "Are these options correct?"
+msgstr "Sind diese Einstellungen richtig?"
+
+#. Put some message to left space for the file names
+#: ../install/install.cc:1004
+msgid "Installing"
+msgstr "Installiere"
+
+#: ../install/install.cc:1004
+msgid "Installing files for the editor"
+msgstr "Installiere Dateien fr den Editor"
+
+#: ../install/install.cc:1014
+#, c-format
+msgid "Unable to uncompress %s, most probably this file is damaged"
+msgstr "Kann `%s' nicht entpacken. Die Datei ist mglicherweise beschdigt"
+
+#: ../install/install.cc:1044
+msgid "Replacing default menu"
+msgstr "Ersetze Standardmen"
+
+#: ../install/install.cc:1057
+msgid "Unable to uncompress files, most probably this file is damaged"
+msgstr "Kann Datei nicht entpacken. Sie ist hchstwahrscheinlich beschdigt"
+
+#: ../install/install.cc:1105
+msgid "Adding icon to desktop"
+msgstr "Fge dem Desktop Symbol hinzu"
+
+#: ../install/install.cc:1120
+msgid "Adding icon to menu"
+msgstr "Fge dem Men Symbol hinzu"
+
+#: ../install/install.cc:1136
+msgid "Simplifying configuration"
+msgstr "Vereinfache Konfiguration"
+
+#: ../install/install.cc:1196
+msgid ""
+"You defined SET_FILES environment variable in a way that isn't compatible "
+"with the installer, be careful"
+msgstr ""
+"Vorsicht! Die Umgebungsvariable `SET_FILES' wurde in einer Art definiert, "
+"mit der der Installer nicht kompatibel ist."
+
+#: ../install/install.cc:1276
+#, fuzzy
+msgid "You modified the autoexec.bat. Do you want to save the changes?"
+msgstr "Sie haben autoexec.bat gendert. nderungen speichern?"
+
+#: ../install/install.cc:1312
+#, fuzzy
+msgid "Instructions for editing"
+msgstr "Einweisungen fr Bearbeitung"
+
+#: ../install/install.cc:1313
+#, fuzzy
+msgid ""
+"Now I'll give you the opportunity to edit the autoexec.bat. To finish click "
+"in the small rectangle found in the top-left corner or press Ctrl+F4."
+msgstr ""
+"Sie haben jetzt die Mglichkeit, Ihre autoexec.bat zu ndern. Um zu beenden, "
+"klicken Sie auf das kleine Viereck in der linken oberen Ecke des Fensters, "
+"oder drcken Sie Strg+F4"
+
+# unclear (fuckin' english)
+#: ../install/install.cc:1318
+#, fuzzy
+msgid ""
+"I added the needed command, it is marked with a comment. Please don't remove "
+"the comment it's used to know where the text was added by the installer."
+msgstr ""
+"Ich habe den bentigten Befehl hinzugefgt; er ist mit einem Kommentar "
+"markiert. Bitte entfernen Sie den Kommentar nicht, er bentigt, um zu "
+"wissen, wo der Installer Text angefgt hat."
+
+#: ../install/install.cc:1323
+msgid "The text I suggest to add is currently in the clipboard."
+msgstr "Der Text, den ich hinzuzufgen vorschlage, ist in der Zwischenablage"
+
+#: ../install/install.cc:1326
+msgid ""
+"You can move lines using:\n"
+"Shift + arrows keys: Select text\n"
+"Ctrl+Insert: Copy to the clipboard\n"
+"Ctrl+Delete: Delete a block\n"
+"Shift+Insert: Paste from the clipboard\n"
+"Shift+Delete: Copy to clipboard and then delete the block\n"
+"Ctrl+U: Undo (only one action)"
+msgstr ""
+"Sie knne Zeilen mit folgenden Tasten umbewegen:\n"
+"Umsch+Pfeil: Text auswhlen\n"
+"Strg+Einfg: Auswahhl kopieren\n"
+"Strg+Lschen: Auswahl lschen\n"
+"Umsch+Einfg: aus der Zwischenablage einfgen\n"
+"Umsch+Lschen: Auswahl kopieren und dann lschen\n"
+"Strg+U: Rckgngig (nur eine Aktion)"
+
+#: ../install/install.cc:1329 ../mp3/mp3list.cc:338 ../setedit/edkeys.cc:581
+#: ../setedit/edprint.cc:706 ../settvuti/tdiagaid.cc:171
+msgid "~O~k"
+msgstr "~O~k"
+
+#: ../install/install.cc:1392
+msgid "Edit autoexec.bat yourself later"
+msgstr ""
+
+# msgstr "Sie ndern autoexec.bat selbst spter"
+#: ../install/install.cc:1393
+msgid "Do it yourself but now"
+msgstr "Sie machen es selber, aber jetzt."
+
+#: ../install/install.cc:1394
+msgid "Let me do it and show you the result"
+msgstr "Sie Lassen mich es tun und sehen Ergebnisse"
+
+#: ../install/install.cc:1395
+msgid "Let me do it and don't show you the result"
+msgstr "Sie Lassen mich es tun und sehen keine Ergebnisse"
+
+# # shitty
+#: ../install/install.cc:1396
+msgid "Select how to do it"
+msgstr "Whlen Sie, wie es zu tun ist"
+
+#: ../install/install.cc:1402
+msgid "Error creating autoexec.bat"
+msgstr "Fehler beim Erstellen von autoexec.bat"
+
+#: ../install/install.cc:1419
+msgid "Configuring the system"
+msgstr "Konfiguriere das System"
+
+#: ../install/install.cc:1421
+msgid ""
+"The editor was succesfully installed, now you must add the directory\n"
+"where the editor was installed to your PATH, like this:"
+msgstr ""
+"Der Editor wurde erfolgreich installiert. Sie mssen nun das Installations-\n"
+"verzeichnis wie folgt zu Ihrer PATH-Variablen hinzufgen:"
+
+#: ../install/install.cc:1451
+msgid "Sorry, I can't find autoexec.bat"
+msgstr "Kann autoexec.bat nicht finden"
+
+#: ../install/install.cc:1466
+#, fuzzy
+msgid "Can't backup autoexec.bat. You'll have to do it by yourself"
+msgstr ""
+"Konnte keine Kopie der autoexec.bat erstellen. Sorry, Sie mssen das wohl "
+"manuell erledigen..."
+
+#: ../install/install.cc:1510
+msgid "Can't create temporal copy of autoexec.bat"
+msgstr "Konnte keine temporre Kopie der autoexec.bat erstellen"
+
+#: ../install/install.cc:1523
+msgid "A copy of the original autoexec.bat was stored in autoexec.bak"
+msgstr ""
+"Eine Kopie von autoexec.bat wurde unter den Namen autoexec.bak gespeichert"
+
+#: ../install/install.cc:1571
+msgid "SET Edit installer v1.10, copyright (c) 1999-2003 by Salvador E. Tropea"
+msgstr ""
+
+#: ../install/install.cc:1576
+msgid "Failed, disabling all or part of the Win9x specific stuff"
+msgstr "Fehler! Stelle Teile oder alles der Win9x-Untersttzung aus"
+
+#: ../install/install.cc:1624
+#, fuzzy
+msgid "Don't forget to update your autoexec.bat later!"
+msgstr "Vergessen Sie nicht, Ihre autoexec.bat spter zu aktualisieren!"
+
+#: ../install/install.cc:1626
+msgid ", after rebooting your system you'll be able to use the editor"
+msgstr ", nach einem Neustart knnen Sie den Editor benutzen"
+
+#: ../install/install.cc:1627
+#, fuzzy, c-format
+msgid "Editor installed successfully%s. Run it using e.bat"
+msgstr "Editor erfolgreich installiert. Starten Sie ihn mit e.bat"
+
+#: ../internac/colors.cc:1 ../setedit/editpale.cc:155
+msgid "Color"
+msgstr "Farbe"
+
+#: ../internac/colors.cc:3
+#, fuzzy
+msgid "Desktop"
+msgstr "Falsche Desktopdatei."
+
+#: ../internac/colors.cc:6
+msgid "Menus"
+msgstr ""
+
+#: ../internac/colors.cc:7
+#, fuzzy
+msgid "Disabled"
+msgstr "~A~usschalten"
+
+#: ../internac/colors.cc:8
+msgid "Shortcut"
+msgstr ""
+
+#: ../internac/colors.cc:9 ../internac/colors.cc:199
+#, fuzzy
+msgid "Selected"
+msgstr "~L~sche"
+
+#: ../internac/colors.cc:10
+#, fuzzy
+msgid "Selected disabled"
+msgstr "Datei aussuchen"
+
+#: ../internac/colors.cc:11
+#, fuzzy
+msgid "Shortcut selected"
+msgstr "Anhal~t~en"
+
+#: ../internac/colors.cc:12 ../internac/colors.cc:22 ../internac/colors.cc:32
+#: ../internac/colors.cc:42 ../internac/colors.cc:148
+#: ../internac/colors.cc:160 ../internac/colors.cc:175
+#: ../internac/colors.cc:190
+msgid "Frame disabled"
+msgstr ""
+
+#: ../internac/colors.cc:14
+#, fuzzy
+msgid "Blue Windows"
+msgstr "~F~enster"
+
+#: ../internac/colors.cc:15 ../internac/colors.cc:25 ../internac/colors.cc:35
+#: ../internac/colors.cc:45 ../internac/colors.cc:151
+#: ../internac/colors.cc:163 ../internac/colors.cc:178
+#: ../internac/colors.cc:193
+msgid "Frame"
+msgstr ""
+
+#: ../internac/colors.cc:16 ../internac/colors.cc:26 ../internac/colors.cc:36
+#: ../internac/colors.cc:46 ../internac/colors.cc:152
+#: ../internac/colors.cc:164 ../internac/colors.cc:179
+#: ../internac/colors.cc:194
+msgid "Frame icons"
+msgstr ""
+
+#: ../internac/colors.cc:17 ../internac/colors.cc:27 ../internac/colors.cc:37
+#: ../internac/colors.cc:47 ../internac/colors.cc:153
+#: ../internac/colors.cc:165 ../internac/colors.cc:180
+#: ../internac/colors.cc:195
+msgid "Scroll bar page"
+msgstr ""
+
+#: ../internac/colors.cc:18 ../internac/colors.cc:28 ../internac/colors.cc:38
+#: ../internac/colors.cc:48 ../internac/colors.cc:154
+#: ../internac/colors.cc:166 ../internac/colors.cc:181
+#: ../internac/colors.cc:196
+msgid "Scroll bar icons"
+msgstr ""
+
+#: ../internac/colors.cc:19 ../internac/colors.cc:29 ../internac/colors.cc:39
+#: ../internac/colors.cc:49 ../internac/colors.cc:167
+#, fuzzy
+msgid "Static text"
+msgstr "Einschubtext"
+
+#: ../internac/colors.cc:20 ../internac/colors.cc:30 ../internac/colors.cc:40
+#: ../internac/colors.cc:168
+#, fuzzy
+msgid "Selected text"
+msgstr "Ausge~w~hlter Text"
+
+#: ../internac/colors.cc:21
+msgid "reserved"
+msgstr ""
+
+#: ../internac/colors.cc:24
+#, fuzzy
+msgid "Cyan Windows"
+msgstr "~F~enster"
+
+#: ../internac/colors.cc:31 ../internac/colors.cc:41 ../internac/colors.cc:75
+#: ../internac/colors.cc:145 ../internac/colors.cc:146
+#: ../internac/colors.cc:147 ../internac/colors.cc:171
+#: ../internac/colors.cc:172 ../internac/colors.cc:173
+#: ../internac/colors.cc:174 ../internac/colors.cc:187
+#: ../internac/colors.cc:188 ../internac/colors.cc:189
+#, fuzzy
+msgid "Reserved"
+msgstr "Benutzerwrter"
+
+#: ../internac/colors.cc:34
+#, fuzzy
+msgid "Gray Windows"
+msgstr "~F~enster"
+
+#: ../internac/colors.cc:44
+msgid "Dialogs"
+msgstr ""
+
+#: ../internac/colors.cc:50
+#, fuzzy
+msgid "Label normal"
+msgstr " Normal"
+
+#: ../internac/colors.cc:51
+#, fuzzy
+msgid "Label selected"
+msgstr "gewhltes a~b~spielen"
+
+#: ../internac/colors.cc:52
+msgid "Label shortcut"
+msgstr ""
+
+#: ../internac/colors.cc:53
+msgid "Button normal"
+msgstr ""
+
+#: ../internac/colors.cc:54
+#, fuzzy
+msgid "Button default"
+msgstr "~Z~urck zu Standard"
+
+#: ../internac/colors.cc:55
+#, fuzzy
+msgid "Button selected"
+msgstr "Anhal~t~en"
+
+#: ../internac/colors.cc:56
+msgid "Button disabled"
+msgstr ""
+
+#: ../internac/colors.cc:57
+msgid "Button shortcut"
+msgstr ""
+
+#: ../internac/colors.cc:58
+msgid "Button shadow"
+msgstr ""
+
+#: ../internac/colors.cc:59
+msgid "Cluster normal"
+msgstr ""
+
+#: ../internac/colors.cc:60
+#, fuzzy
+msgid "Cluster selected"
+msgstr "Zeichenkette erwartet"
+
+#: ../internac/colors.cc:61
+msgid "Cluster shortcut"
+msgstr ""
+
+#: ../internac/colors.cc:62
+#, fuzzy
+msgid "Input normal"
+msgstr " Normal"
+
+#: ../internac/colors.cc:63
+#, fuzzy
+msgid "Input selected"
+msgstr "Anhal~t~en"
+
+#: ../internac/colors.cc:64
+msgid "Input arrow"
+msgstr ""
+
+#: ../internac/colors.cc:65
+#, fuzzy
+msgid "History button"
+msgstr "~V~erlauf"
+
+#: ../internac/colors.cc:66
+#, fuzzy
+msgid "History sides"
+msgstr "~V~erlauf"
+
+#: ../internac/colors.cc:67
+msgid "History bar page"
+msgstr ""
+
+#: ../internac/colors.cc:68
+msgid "History bar icons"
+msgstr ""
+
+#: ../internac/colors.cc:69
+#, fuzzy
+msgid "List normal"
+msgstr " Normal"
+
+#: ../internac/colors.cc:70
+#, fuzzy
+msgid "List focused"
+msgstr "Wortliste"
+
+#: ../internac/colors.cc:71
+#, fuzzy
+msgid "List selected"
+msgstr "Anhal~t~en"
+
+#: ../internac/colors.cc:72
+msgid "List divider"
+msgstr ""
+
+#: ../internac/colors.cc:73
+#, fuzzy
+msgid "Information pane"
+msgstr "Information"
+
+#: ../internac/colors.cc:74
+msgid "Cluster disabled"
+msgstr ""
+
+#: ../internac/colors.cc:76 ../internac/colors.cc:96 ../internac/colors.cc:116
+#: ../internac/colors.cc:155
+#, fuzzy
+msgid "Normal text"
+msgstr "~n~ormaler Text"
+
+#: ../internac/colors.cc:78
+#, fuzzy
+msgid "Blue Editor"
+msgstr "Editor ~t~esten"
+
+#: ../internac/colors.cc:79 ../internac/colors.cc:99 ../internac/colors.cc:119
+#: ../internac/colors.cc:159
+#, fuzzy
+msgid "Marked text"
+msgstr "Text ersetzen"
+
+#: ../internac/colors.cc:80 ../internac/colors.cc:100
+#: ../internac/colors.cc:120
+#, fuzzy
+msgid "Comment"
+msgstr "Ein Befehl"
+
+#: ../internac/colors.cc:81 ../internac/colors.cc:101
+#: ../internac/colors.cc:121
+#, fuzzy
+msgid "Reserved word"
+msgstr "Benutzerwrter"
+
+#: ../internac/colors.cc:82 ../internac/colors.cc:102
+#: ../internac/colors.cc:122
+#, fuzzy
+msgid "Identifier"
+msgstr "Schiebe ein Leerzeichen ein"
+
+#: ../internac/colors.cc:83 ../internac/colors.cc:103
+#: ../internac/colors.cc:123
+msgid "Symbol"
+msgstr ""
+
+#: ../internac/colors.cc:84 ../internac/colors.cc:104
+#: ../internac/colors.cc:124
+#, fuzzy
+msgid "String"
+msgstr "~T~eiltext"
+
+#: ../internac/colors.cc:85 ../internac/colors.cc:105
+#: ../internac/colors.cc:125
+msgid "Integer"
+msgstr ""
+
+#: ../internac/colors.cc:86 ../internac/colors.cc:106
+#: ../internac/colors.cc:126
+msgid "Float"
+msgstr ""
+
+#: ../internac/colors.cc:87 ../internac/colors.cc:107
+#: ../internac/colors.cc:127
+#, fuzzy
+msgid "Octal"
+msgstr "Okt"
+
+#: ../internac/colors.cc:88 ../internac/colors.cc:108
+#: ../internac/colors.cc:128
+#, fuzzy
+msgid "Hex"
+msgstr " Hex: "
+
+#: ../internac/colors.cc:89 ../internac/colors.cc:109
+#: ../internac/colors.cc:129
+#, fuzzy
+msgid "Character"
+msgstr "~Z~eichenwechsel"
+
+#: ../internac/colors.cc:90 ../internac/colors.cc:110
+#: ../internac/colors.cc:130
+msgid "Preprocessor"
+msgstr ""
+
+#: ../internac/colors.cc:91 ../internac/colors.cc:111
+#: ../internac/colors.cc:131
+msgid "Illegal char"
+msgstr ""
+
+#: ../internac/colors.cc:92 ../internac/colors.cc:112
+#: ../internac/colors.cc:132
+#, fuzzy
+msgid "User defined words"
+msgstr "Benutzer~d~efiniert"
+
+#: ../internac/colors.cc:93 ../internac/colors.cc:113
+#: ../internac/colors.cc:133
+#, fuzzy
+msgid "CPU line"
+msgstr " Zeilen"
+
+#: ../internac/colors.cc:94 ../internac/colors.cc:114
+#: ../internac/colors.cc:134
+#, fuzzy
+msgid "Breakpoint"
+msgstr "~D~rucken"
+
+#: ../internac/colors.cc:95 ../internac/colors.cc:115
+#: ../internac/colors.cc:135
+msgid "Symbol2"
+msgstr ""
+
+#: ../internac/colors.cc:98
+msgid "Cyan Editor"
+msgstr ""
+
+#: ../internac/colors.cc:118
+msgid "Gray Editor"
+msgstr ""
+
+#: ../internac/colors.cc:136
+#, fuzzy
+msgid "Cross cursor"
+msgstr "~A~b Cursor"
+
+#: ../internac/colors.cc:138
+msgid "Specials for editors"
+msgstr ""
+
+#: ../internac/colors.cc:139
+#, fuzzy
+msgid "Editor statusline"
+msgstr "Leeres Untermen"
+
+#: ../internac/colors.cc:140
+msgid "Parens matching"
+msgstr ""
+
+#: ../internac/colors.cc:141
+#, fuzzy
+msgid "Rectangle block"
+msgstr "Re~c~hteck"
+
+#: ../internac/colors.cc:142
+msgid "Odd tab"
+msgstr ""
+
+#: ../internac/colors.cc:143
+#, fuzzy
+msgid "Even tab"
+msgstr "Tabs s~e~hen"
+
+#: ../internac/colors.cc:144 ../mainsrc/deedidia.cc:266
+#: ../mainsrc/deedidia.cc:318
+#, fuzzy
+msgid "Column markers"
+msgstr "Spalten~c~ursor"
+
+#: ../internac/colors.cc:150
+#, fuzzy
+msgid "Info viewer"
+msgstr "InfView"
+
+#: ../internac/colors.cc:156
+#, fuzzy
+msgid "Keyword"
+msgstr "~T~astatur"
+
+#: ../internac/colors.cc:157
+#, fuzzy
+msgid "Selected keyword"
+msgstr "Ausge~w~hlter Text"
+
+#: ../internac/colors.cc:158
+msgid "Marked keyword"
+msgstr ""
+
+#: ../internac/colors.cc:162
+#, fuzzy
+msgid "Man page viewer"
+msgstr "Man Seite zum Anzeigen"
+
+#: ../internac/colors.cc:169
+#, fuzzy
+msgid "Bold text"
+msgstr "~n~ormaler Text"
+
+#: ../internac/colors.cc:170
+#, fuzzy
+msgid "Underlined text"
+msgstr "Einschubtext"
+
+#: ../internac/colors.cc:177
+#, fuzzy
+msgid "DataWindow"
+msgstr "~F~enster"
+
+#: ../internac/colors.cc:182
+#, fuzzy
+msgid "Normal Text(active)"
+msgstr "~n~ormaler Text"
+
+#: ../internac/colors.cc:183
+#, fuzzy
+msgid "Normal Text(inactive)"
+msgstr "~n~ormaler Text"
+
+#: ../internac/colors.cc:184
+msgid "Focused Text"
+msgstr ""
+
+#: ../internac/colors.cc:185
+#, fuzzy
+msgid "Selected Text"
+msgstr "Ausge~w~hlter Text"
+
+#: ../internac/colors.cc:186
+#, fuzzy
+msgid "Changed text"
+msgstr "Text ersetzen"
+
+#: ../internac/colors.cc:192 ../setedit/edmsg.cc:609
+msgid "Message Window"
+msgstr "Nachrichtenfenster"
+
+#: ../internac/colors.cc:198
+#, fuzzy
+msgid "Focused"
+msgstr "Wortliste"
+
+#: ../internac/colors.cc:200 ../setedit/edprefs.cc:305
+msgid "Information"
+msgstr "Information"
+
+#: ../internac/colors.cc:201
+#, fuzzy
+msgid "Warnings"
+msgstr "Warnung"
+
+#: ../internac/colors.cc:202
+#, fuzzy
+msgid "Errors"
+msgstr "Fehler"
+
+#: ../mainsrc/accehtml.cc:53
+msgid "You must select the editor window first"
+msgstr "Sie mssen zuerst das Editorfenster anwhlen"
+
+#: ../mainsrc/bufun.cc:726
+msgid "Jump to function"
+msgstr "Gehe zu Funktion"
+
+#: ../mainsrc/bufun.cc:736
+msgid "List of functions"
+msgstr "Funktionenliste"
+
+#: ../mainsrc/bufun.cc:742 ../settvuti/tdiagaid.cc:174
+#, fuzzy
+msgid "~B~rowse"
+msgstr "S~c~hlieen"
+
+#: ../mainsrc/bufun.cc:771
+#, fuzzy
+msgid "Sort mode"
+msgstr "Bildschirm~m~odus"
+
+#: ../mainsrc/bufun.cc:773
+#, fuzzy
+msgid "Sort the functions"
+msgstr "Funktionenliste"
+
+#: ../mainsrc/bufun.cc:775
+#, fuzzy
+msgid "~A~lphabetically"
+msgstr "~A~lphabetisch"
+
+#: ../mainsrc/bufun.cc:776
+msgid "by ~L~ine"
+msgstr ""
+
+#: ../mainsrc/bufun.cc:811
+msgid "Hmmm ... I can't find any function, are you sure?"
+msgstr "Hmmm... Irgendwie kann ich hier keine Funktionen entdecken..."
+
+#: ../mainsrc/bufun.cc:839
+#, fuzzy
+msgid "Functions:"
+msgstr "Aktion"
+
+#: ../mainsrc/ceditor.cc:543
+#, c-format
+msgid "Error pasting from clipboard: %s"
+msgstr ""
+
+#: ../mainsrc/ceditor.cc:3807
+#, c-format
+msgid "Search wrapped, continued from %s."
+msgstr ""
+
+#: ../mainsrc/ceditor.cc:3808
+msgid "bottom"
+msgstr ""
+
+#: ../mainsrc/ceditor.cc:3808
+#, fuzzy
+msgid "top"
+msgstr "~S~top"
+
+#. Nope, is too risky to silently delete it.
+#. printf("Actual mode definition: %s\n",buffer+stComp);
+#: ../mainsrc/ceditor.cc:4258
+msgid "Emacs mode already pasted without this editor"
+msgstr ""
+
+#: ../mainsrc/ceditor.cc:4310
+#, fuzzy, c-format
+msgid "%d bytes selected"
+msgstr " Bytes ausgewhlt in "
+
+#: ../mainsrc/ceditor.cc:4312
+#, fuzzy
+msgid "One byte selected"
+msgstr "gewhltes a~b~spielen"
+
+#: ../mainsrc/ceditor.cc:4314
+#, fuzzy, c-format
+msgid " in %d lines"
+msgstr " [%d Knoten]"
+
+#: ../mainsrc/ceditor.cc:4316
+#, fuzzy
+msgid " in one line"
+msgstr "Unbekannt"
+
+#: ../mainsrc/ceditor.cc:4477
+msgid "Use a file with 1000 lines or more for that"
+msgstr "Benutzen Sie eine Datei mit mehr als 1000 Zeilen dafr"
+
+#: ../mainsrc/ceditor.cc:4496
+#, c-format
+msgid "Speed: %f lines/second"
+msgstr "Geschwindigkeit: %f Zeilen/Sekunde"
+
+#: ../mainsrc/ceditor.cc:4518
+#, c-format
+msgid ""
+"Time: %f seconds\n"
+"Speed: %f lines/second\n"
+"%f chars/sec"
+msgstr ""
+"Zeit: %f Sekunden\n"
+"Geschwindigkeit: %f Zeilen/Sekunde\n"
+"%f Zeichen/Sek"
+
+#: ../mainsrc/ceditor.cc:4552
+#, c-format
+msgid ""
+"Time: %f seconds\n"
+"Speed: %f lines/second\n"
+"%5.2f%% Editor\n"
+"%f chars/sec"
+msgstr ""
+"Zeit: %f Sekunden\n"
+"Geschwindigkeit: %f Zeilen/Sek\n"
+"%5.2f%% Editor\n"
+"%f Zeichen/Sek"
+
+#: ../mainsrc/ceditor.cc:6163
+msgid "No match found"
+msgstr "Keine bereinstimmung gefunden"
+
+#: ../mainsrc/ceditor.cc:6178
+#, c-format
+msgid "Match found at line %d column %d."
+msgstr "bereinstimmung in Zeile %d, Spalte %d."
+
+#: ../mainsrc/ceditor.cc:10762
+#, fuzzy
+msgid ""
+"This file contains ASCII 0 values, all the characters in this line after it "
+"become invisible. Be careful."
+msgstr ""
+"Die Datei beinhaltet ASCII 0 Werte, alle Zeichen danach werden unsichtbar in "
+"der Zeile. Seien Sie vorsichtig."
+
+#: ../mainsrc/ceditor.cc:10777
+msgid "Parsing file"
+msgstr "Analysiere Datei"
+
+#: ../mainsrc/ceditor.cc:11523
+#, fuzzy
+msgid "Unhandled syntax highlighting"
+msgstr "Unbehandelte Syntaxhervorhebung"
+
+#: ../mainsrc/ceditor.cc:12454
+msgid "Unhandled undo"
+msgstr "Unbehandeltes Undo!"
+
+#: ../mainsrc/ceditor.cc:12665
+msgid "Unhandled redo"
+msgstr "Unbehandeltes Redo!"
+
+#: ../mainsrc/ceditor.cc:13866
+#, fuzzy, c-format
+msgid "Saved: %s (%ld bytes %d lines)."
+msgstr "Gespeichert: %s (%ld bytes)."
+
+#: ../mainsrc/ceditor.cc:13876
+msgid "Stat failed."
+msgstr "`Stat' hhat versagt!"
+
+#: ../mainsrc/deedidia.cc:76
+#, fuzzy
+msgid "Regular Expression Options"
+msgstr "Einstellungen fr Regulre Ausdrcke"
+
+#. EN: ABDENPT
+#: ../mainsrc/deedidia.cc:79
+msgid "RegEx style"
+msgstr "RegEx Stil"
+
+#: ../mainsrc/deedidia.cc:79
+msgid "~B~asic POSIX"
+msgstr "~E~infach POSIX"
+
+#: ../mainsrc/deedidia.cc:80
+msgid "~E~xtended POSIX"
+msgstr "~E~rweitertes POSIX"
+
+#: ../mainsrc/deedidia.cc:81
+msgid "~P~erl Compatible"
+msgstr "~P~erl kompatibel"
+
+#: ../mainsrc/deedidia.cc:84
+msgid "Replace text"
+msgstr "Text ersetzen"
+
+#: ../mainsrc/deedidia.cc:84
+msgid "~N~ormal text"
+msgstr "~n~ormaler Text"
+
+#: ../mainsrc/deedidia.cc:85
+#, fuzzy
+msgid "~D~ollar tags"
+msgstr "~D~ollar-Markierungen"
+
+#: ../mainsrc/deedidia.cc:86
+msgid "Optimize"
+msgstr "Optimieren"
+
+#: ../mainsrc/deedidia.cc:86
+msgid "~T~ry to use normal search"
+msgstr "Versuche ~n~ormale Suche"
+
+#: ../mainsrc/deedidia.cc:87
+#, fuzzy
+msgid "~A~lways use RegEx"
+msgstr "Immer RegEx ~v~erwenden"
+
+#: ../mainsrc/deedidia.cc:115
+msgid "Find"
+msgstr "Suchen"
+
+#: ../mainsrc/deedidia.cc:122 ../mainsrc/deedidia.cc:164
+#: ../mainsrc/deedidia.cc:290 ../setedit/tips.cc:210
+msgid "Options"
+msgstr "Einstellungen"
+
+#: ../mainsrc/deedidia.cc:123 ../mainsrc/deedidia.cc:165
+msgid "Regular e~x~pressions"
+msgstr "Regulre Ausd~r~cke"
+
+#: ../mainsrc/deedidia.cc:124 ../mainsrc/deedidia.cc:165
+msgid "Only ~i~nside comments"
+msgstr "Nur innerhalb von Kommentaren"
+
+#: ../mainsrc/deedidia.cc:124 ../mainsrc/deedidia.cc:166
+msgid "Only o~u~tside comments"
+msgstr "Nur auerhalb von Kommentaren"
+
+#: ../mainsrc/deedidia.cc:125
+#, fuzzy
+msgid "S~h~ow function name"
+msgstr "~G~ehe zu Funktion"
+
+#. All together + same width
+#: ../mainsrc/deedidia.cc:126 ../mainsrc/deedidia.cc:172
+msgid "Scope"
+msgstr "Bereich"
+
+#: ../mainsrc/deedidia.cc:126 ../mainsrc/deedidia.cc:172
+msgid "~G~lobal"
+msgstr "~G~lobal"
+
+#: ../mainsrc/deedidia.cc:126 ../mainsrc/deedidia.cc:172
+msgid "~S~elected text"
+msgstr "Ausge~w~hlter Text"
+
+#: ../mainsrc/deedidia.cc:127
+msgid "Origin"
+msgstr "Ursprung"
+
+#: ../mainsrc/deedidia.cc:127 ../mainsrc/deedidia.cc:173
+msgid "~F~rom cursor"
+msgstr "~A~b Cursor"
+
+#: ../mainsrc/deedidia.cc:128 ../mainsrc/deedidia.cc:173
+msgid "~E~ntire scope"
+msgstr "~G~anzer Bereich"
+
+#: ../mainsrc/deedidia.cc:129 ../mainsrc/deedidia.cc:174
+#, fuzzy
+msgid "Direction"
+msgstr "Kann Verzeichnis nicht erstellen:"
+
+#: ../mainsrc/deedidia.cc:129 ../mainsrc/deedidia.cc:174
+msgid "Forwar~d~"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:130 ../mainsrc/deedidia.cc:174
+#, fuzzy
+msgid "~B~ackward"
+msgstr "~H~intergrund"
+
+#: ../mainsrc/deedidia.cc:136 ../mainsrc/deedidia.cc:181
+msgid "RegEx ~O~ps"
+msgstr "~O~ps ExpReg"
+
+#: ../mainsrc/deedidia.cc:154
+msgid "Replace"
+msgstr "Ersetzen"
+
+#: ../mainsrc/deedidia.cc:160
+msgid "~N~ew text"
+msgstr "~N~euer Text"
+
+#: ../mainsrc/deedidia.cc:166
+#, fuzzy
+msgid "S~h~ow function ~n~ame"
+msgstr "~G~ehe zu Funktion"
+
+#: ../mainsrc/deedidia.cc:167
+msgid "~P~rompt on replace"
+msgstr "Vorm Ersetzen ~n~achfragen"
+
+#: ../mainsrc/deedidia.cc:167
+msgid "~R~eplace all"
+msgstr "Alle e~r~setzen"
+
+#: ../mainsrc/deedidia.cc:173
+msgid "Or~i~gin"
+msgstr "Ursprun~g~"
+
+#: ../mainsrc/deedidia.cc:179
+msgid "Replace ~A~ll"
+msgstr "Alle ersetzen"
+
+#: ../mainsrc/deedidia.cc:199
+msgid "Goto Line"
+msgstr "Gehe zu Zeile"
+
+#: ../mainsrc/deedidia.cc:202
+msgid "Desired line"
+msgstr "Gewnschte Zeile"
+
+#: ../mainsrc/deedidia.cc:218
+#, fuzzy
+msgid "Syntax Highlighting"
+msgstr "Syntax~h~ervorhebung"
+
+#: ../mainsrc/deedidia.cc:223
+msgid "Off ~1~"
+msgstr "Aus ~1~"
+
+#: ../mainsrc/deedidia.cc:224
+msgid "C++ st~y~le"
+msgstr "C++ St~i~l"
+
+#: ../mainsrc/deedidia.cc:225
+msgid "Pa~s~cal style"
+msgstr "Pascal ~S~til"
+
+#: ../mainsrc/deedidia.cc:226
+msgid "C~l~ipper style"
+msgstr "C~l~ipper Stil"
+
+#: ../mainsrc/deedidia.cc:227
+msgid "User ~d~efined"
+msgstr "Benutzer~d~efiniert"
+
+#. English: ABCDEFGHIKLMNOPRSTUWYZ 1234
+#. BEGJQVXZ
+#: ../mainsrc/deedidia.cc:248
+msgid "Local Options"
+msgstr "Lokale Einstellungen"
+
+#: ../mainsrc/deedidia.cc:251
+msgid "Options ~3~"
+msgstr "Einstellungen ~3~"
+
+#: ../mainsrc/deedidia.cc:251
+msgid "~O~verwrite"
+msgstr "~b~erschreiben"
+
+#: ../mainsrc/deedidia.cc:251 ../mainsrc/deedidia.cc:291
+msgid "~A~utoindent"
+msgstr "~A~utoeinschub"
+
+#: ../mainsrc/deedidia.cc:252
+msgid "~U~se real tabs (ASCII 9)"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:252 ../mainsrc/deedidia.cc:293
+msgid "~P~ersistent blocks"
+msgstr "~B~estndige Blcke"
+
+#: ../mainsrc/deedidia.cc:252 ../mainsrc/deedidia.cc:294
+#, fuzzy
+msgid "~I~ntelligent indent"
+msgstr "~I~ntelligenter C-Einschub"
+
+#: ../mainsrc/deedidia.cc:253 ../mainsrc/deedidia.cc:295
+msgid "~C~olumn cursor"
+msgstr "Spalten~c~ursor"
+
+#: ../mainsrc/deedidia.cc:253 ../mainsrc/deedidia.cc:296
+msgid "~R~ow cursor"
+msgstr "~Z~eilencursor"
+
+#: ../mainsrc/deedidia.cc:253 ../mainsrc/deedidia.cc:297
+#, fuzzy
+msgid "~M~atched pair highlighting"
+msgstr "~K~lammernpaar hervorheben"
+
+#: ../mainsrc/deedidia.cc:254 ../mainsrc/deedidia.cc:298
+#, fuzzy
+msgid "Match pair on the fl~y~"
+msgstr "Klammernpaar beim berfliegen"
+
+#: ../mainsrc/deedidia.cc:254
+msgid "Don't wait to search for the pair ~1~"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:255 ../mainsrc/deedidia.cc:301
+msgid "Tra~n~sparent Blocks"
+msgstr "Tran~s~parente Blcke"
+
+#: ../mainsrc/deedidia.cc:255 ../mainsrc/deedidia.cc:302
+msgid "Optimal ~F~ill"
+msgstr "Optimale ~F~llung"
+
+#: ../mainsrc/deedidia.cc:255 ../mainsrc/deedidia.cc:303
+msgid "~W~rap words"
+msgstr "~W~ortumbruch"
+
+#: ../mainsrc/deedidia.cc:256 ../mainsrc/deedidia.cc:305
+msgid "S~e~e tabs"
+msgstr "Tabs s~e~hen"
+
+#: ../mainsrc/deedidia.cc:256 ../mainsrc/deedidia.cc:306
+msgid "Don't move inside ta~b~s"
+msgstr "Nicht innerhalb Ta~b~s bewegen"
+
+#: ../mainsrc/deedidia.cc:257
+msgid "Tab ~s~mart indents"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:257
+#, fuzzy
+msgid "Use in~d~ent size"
+msgstr "Benutzer~d~efiniert"
+
+#: ../mainsrc/deedidia.cc:258 ../mainsrc/deedidia.cc:309
+msgid "Keep trailin~g~ whitespace"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:258
+msgid "Backspace unindents ~2~"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:259
+#, fuzzy
+msgid "Column markers ~4~"
+msgstr "Spalten~c~ursor"
+
+#: ../mainsrc/deedidia.cc:262 ../mainsrc/deedidia.cc:314
+msgid "~T~ab size"
+msgstr "~T~abulatorgre"
+
+#: ../mainsrc/deedidia.cc:263 ../mainsrc/deedidia.cc:315
+#, fuzzy
+msgid "Indent si~z~e"
+msgstr "Schiebe ein Leerzeichen ein"
+
+#: ../mainsrc/deedidia.cc:264 ../mainsrc/deedidia.cc:316
+msgid "Wrap co~l~umn"
+msgstr "Spa~l~tenumbruch"
+
+#: ../mainsrc/deedidia.cc:273
+#, fuzzy
+msgid "Syntax ~H~L Options"
+msgstr "SDP ~O~ptionen"
+
+#: ../mainsrc/deedidia.cc:288
+msgid "Global Options"
+msgstr "Globale Einstellungen"
+
+#: ../mainsrc/deedidia.cc:292
+msgid "~U~se tabs"
+msgstr "Ben~u~tze Tabs"
+
+#: ../mainsrc/deedidia.cc:299
+msgid "Don't wait to searc~h~ for the pair"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:300
+msgid "~D~on't move the cursor on Paste"
+msgstr "~C~ursor beim Einfgen nicht bewegen"
+
+#: ../mainsrc/deedidia.cc:304
+msgid "~S~croll Lock centers"
+msgstr "~S~croll Lock zentriert"
+
+#: ../mainsrc/deedidia.cc:307
+msgid "Tab smart indents ~5~"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:308
+msgid "Use indent size ~6~"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:310
+msgid "Backspace unindents ~8~"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:311
+#, fuzzy
+msgid "Column markers ~9~"
+msgstr "Spalten~c~ursor"
+
+#: ../mainsrc/deedidia.cc:322
+msgid "T~o~ all"
+msgstr "Fr ~a~lle"
+
+#: ../mainsrc/deedidia.cc:337
+msgid "Search hit"
+msgstr "Suchtreffer"
+
+#: ../mainsrc/deedidia.cc:339
+msgid "Replace this occurence?"
+msgstr "Diese Vorkommen ersetzen?"
+
+#: ../mainsrc/deedidia.cc:342
+msgid "~A~ll"
+msgstr "~A~lles"
+
+#. BCDFLMO
+#: ../mainsrc/deedidia.cc:364
+msgid "Export Options"
+msgstr "Export Optionen"
+
+#: ../mainsrc/deedidia.cc:367 ../setedit/editmenu.cc:354
+#: ../setedit/intgrep.cc:418 ../setedit/runprog.cc:127
+msgid "~O~ptions"
+msgstr "~O~ptionen"
+
+#: ../mainsrc/deedidia.cc:368
+msgid "~F~ile name as title"
+msgstr "~D~ateiname als berschrift"
+
+#: ../mainsrc/deedidia.cc:369
+msgid "Same ~b~ackground color as the editor"
+msgstr "Gleiche Hintergrund wie im ~E~ditor"
+
+#: ../mainsrc/deedidia.cc:370
+#, fuzzy
+msgid "~M~onospaced font"
+msgstr "~M~onospaced Schrift"
+
+#: ../mainsrc/deedidia.cc:371
+msgid "Bo~l~d attribute"
+msgstr "~F~ettdruck"
+
+#: ../mainsrc/deedidia.cc:372
+msgid "~U~se CSS and HTML 4.01"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:373
+msgid "Colors"
+msgstr "Farben"
+
+#: ../mainsrc/deedidia.cc:373
+msgid "Use ~c~olors"
+msgstr "Benutze ~F~arben"
+
+#: ../mainsrc/deedidia.cc:374
+msgid "~D~on't use colors"
+msgstr "Keine Farben verwen~d~en"
+
+#. BFLMO
+#: ../mainsrc/deedidia.cc:389
+msgid "Pseudo Macros"
+msgstr "Pseudo Macros"
+
+#: ../mainsrc/deedidia.cc:401
+msgid "Arbitrary indent"
+msgstr "Eigener Einschub"
+
+#: ../mainsrc/deedidia.cc:403
+msgid "Indentation text"
+msgstr "Einschubtext"
+
+#: ../mainsrc/deedidia.cc:430
+#, fuzzy, c-format
+msgid "Data saved to file: %s"
+msgstr "Speicher Datei als"
+
+#: ../mainsrc/deedidia.cc:435
+msgid "Solve collision"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:439
+msgid ""
+"Problem:\n"
+"The copy in memory is also modified\n"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:440
+msgid "~L~oad file from disk (discard changes)"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:441
+#, fuzzy
+msgid "~A~bort operation"
+msgstr "~E~xtraeinstellungen"
+
+#: ../mainsrc/deedidia.cc:442
+msgid "Load and ~s~how differences"
+msgstr ""
+
+#: ../mainsrc/deedidia.cc:443
+msgid "~D~on't load and show differences"
+msgstr ""
+
+#: ../mainsrc/doedidia.cc:64
+msgid "Not enough memory for this operation"
+msgstr "Nicht genug Speicher fr diese Operation"
+
+#: ../mainsrc/doedidia.cc:72
+#, fuzzy, c-format
+msgid "Error reading file %s. %s"
+msgstr "Fehler beim Lesen der Datei "
+
+#: ../mainsrc/doedidia.cc:73
+#, fuzzy, c-format
+msgid "Error reading file %s. %s (%d)"
+msgstr "Fehler beim Lesen der Datei "
+
+#: ../mainsrc/doedidia.cc:82
+#, fuzzy, c-format
+msgid "Error writing file %s. %s"
+msgstr "Fehler beim Schreiben der Datei "
+
+#: ../mainsrc/doedidia.cc:83
+#, fuzzy, c-format
+msgid "Error writing file %s. %s (%d)"
+msgstr "Fehler beim Schreiben der Datei "
+
+#: ../mainsrc/doedidia.cc:90
+#, fuzzy, c-format
+msgid "Error creating file %s. %s (%d)"
+msgstr "Fehler beim Erstellen von "
+
+#: ../mainsrc/doedidia.cc:94
+#, fuzzy
+msgid "Error creating temporal file, operation aborted"
+msgstr "Fehler beim Lesen der Dateiliste"
+
+#: ../mainsrc/doedidia.cc:100
+#, fuzzy, c-format
+msgid "%s has been modified. Save?"
+msgstr " wurde verndert. Speichern?"
+
+#: ../mainsrc/doedidia.cc:103
+msgid "Save untitled file?"
+msgstr "Unbenannte Datei speichern?"
+
+#: ../mainsrc/doedidia.cc:106
+msgid "Save file as"
+msgstr "Speicher Datei als"
+
+#: ../mainsrc/doedidia.cc:114
+msgid "Write to file"
+msgstr "In Datei schreiben"
+
+#: ../mainsrc/doedidia.cc:117
+msgid "Read from file"
+msgstr "Lese aus Datei"
+
+#: ../mainsrc/doedidia.cc:128
+msgid "Search string not found."
+msgstr "Suchtext nicht gefunden."
+
+#: ../mainsrc/doedidia.cc:213
+msgid "Line too long, cut it?"
+msgstr "Zeile zu lang. Abschneiden?"
+
+#: ../mainsrc/doedidia.cc:217
+#, fuzzy
+msgid "Line extremely long. Can't handle it reliably, sorry"
+msgstr "Zeile ist extem lang. Kann Sie leider nicht zuverlssig handhaben."
+
+#: ../mainsrc/doedidia.cc:221
+#, fuzzy
+msgid "This file isn't on the disk!"
+msgstr "Diese Datei ist nicht auf Festplatte!"
+
+#: ../mainsrc/doedidia.cc:228
+#, fuzzy, c-format
+msgid "The file %s is read-only, try to revert it?"
+msgstr "Diese Datei ist Nur-Lesen. ndern?"
+
+#: ../mainsrc/doedidia.cc:231
+msgid ""
+"Failed to revert the read-only status, you won't be able to overwrite this "
+"file"
+msgstr ""
+"Konnte Nur-Lesen-Status nicht umkehren. Sie werden diese Datei nicht "
+"berschreiben knnen"
+
+#: ../mainsrc/doedidia.cc:235
+#, fuzzy
+msgid "This action can't be undone. Are you sure?"
+msgstr "Diese Operation hat kein `Rckgngig'. Sind Sie sich sicher?"
+
+#: ../mainsrc/doedidia.cc:242
+#, fuzzy, c-format
+msgid "%s already exists. Overwrite?"
+msgstr " existiert bereits. berschreiben?"
+
+#: ../mainsrc/doedidia.cc:248
+#, fuzzy, c-format
+msgid "%s isn't a file, probably a device, go ahead?"
+msgstr " ist keine Datei -mglicherweise ein Gert- fortsetzen?"
+
+#: ../mainsrc/doedidia.cc:251
+#, fuzzy
+msgid "Can't create a backup. Continue saving?"
+msgstr "Konnte keine Sicherheitskopie erstellen. Trotzdem speichern?"
+
+#: ../mainsrc/doedidia.cc:254
+msgid "You can't paste a rectangle crossing the end of the file"
+msgstr "Sie knnen kein Rechteck einfgen, das ber das Dateiende hinaus geht"
+
+#: ../mainsrc/doedidia.cc:265
+msgid "No pseudo macros available"
+msgstr "Keine pseudo macros verfgbar"
+
+#: ../mainsrc/doedidia.cc:282
+#, fuzzy
+msgid "The file is compressed. Do you want to save with compression?"
+msgstr "Sie haben autoexec.bat gendert. nderungen speichern?"
+
+#: ../mainsrc/doedidia.cc:285
+msgid "Searching inside a selection but nothing is selected"
+msgstr ""
+
+#: ../mainsrc/doedidia.cc:289
+#, fuzzy
+msgid "You must select some text for this operation"
+msgstr "Sie mssen ein Editorfenster fr diese Operation angeben"
+
+#: ../mainsrc/doedidia.cc:296
+#, fuzzy, c-format
+msgid "You must select less than %d characters"
+msgstr "Sie mssen zuerst das Editorfenster anwhlen"
+
+#: ../mainsrc/doedidia.cc:301
+msgid "The selection can't contain more than one line"
+msgstr ""
+
+#: ../mainsrc/editwind.cc:33
+msgid "Clipboard"
+msgstr "Zwischenablage"
+
+#: ../mainsrc/editwind.cc:34
+msgid "Untitled"
+msgstr "Unbenannt"
+
+#: ../mainsrc/gzfiles.cc:443
+#, fuzzy
+msgid "Validation"
+msgstr "~K~onfiguration"
+
+#: ../mainsrc/gzfiles.cc:447
+msgid "Passphrase"
+msgstr ""
+
+#: ../mainsrc/gzfiles.cc:602
+#, fuzzy
+msgid "No passphrase available"
+msgstr "Keine pseudo macros verfgbar"
+
+#: ../mainsrc/gzfiles.cc:611 ../setedit/debug.cc:8724
+#, fuzzy
+msgid "Out of memory"
+msgstr "Nicht genug Speicher fr diese Operation"
+
+#: ../mainsrc/gzfiles.cc:622 ../mainsrc/gzfiles.cc:694
+#, fuzzy
+msgid "Running:"
+msgstr "Fhre aus: %s"
+
+#: ../mainsrc/gzfiles.cc:630 ../mainsrc/gzfiles.cc:700
+msgid "Failed to invoke gpg"
+msgstr ""
+
+#: ../mainsrc/gzfiles.cc:670
+#, fuzzy
+msgid "Error while decrypting"
+msgstr "Fehler whrend des Lesens"
+
+#: ../mainsrc/gzfiles.cc:674
+#, fuzzy
+msgid "Failed to determine user ID"
+msgstr "Konnte die Listendatei nicht ffnen"
+
+#: ../mainsrc/gzfiles.cc:731
+msgid "Error from GPG"
+msgstr ""
+
+#: ../mainsrc/keytrans.cc:804
+msgid "Wrong file"
+msgstr "Falsche Datei."
+
+#: ../mainsrc/keytrans.cc:808
+msgid "Wrong version"
+msgstr "Falsche Version"
+
+#: ../mainsrc/keytrans.cc:825
+msgid "Error while reading"
+msgstr "Fehler whrend des Lesens"
+
+#: ../mainsrc/keytrans.cc:1144
+#, c-format
+msgid "%s, file \"%s\"\n"
+msgstr ""
+
+#: ../mainsrc/keytrans.cc:1153
+#, fuzzy, c-format
+msgid "Error while loading the keyboard binding: %s"
+msgstr "Fehler beim Lesen der Tastaturkonfiguration"
+
+#: ../mainsrc/keytrans.cc:1190
+msgid "You'll lose all the changes"
+msgstr "Sie werden alle nderungen verlieren"
+
+#: ../mainsrc/loaddefl.cc:248
+msgid "Available"
+msgstr "Verfgbar"
+
+#. Ask if is enable or disable.
+#: ../mainsrc/loaddefl.cc:263
+msgid "What to do"
+msgstr "Was zu tun"
+
+#: ../mainsrc/loaddefl.cc:264
+msgid "Action"
+msgstr "Aktion"
+
+#: ../mainsrc/loaddefl.cc:264
+msgid "~D~isable"
+msgstr "~A~usschalten"
+
+#: ../mainsrc/loaddefl.cc:264 ../setedit/debug.cc:4309
+#: ../setedit/debug.cc:4916
+msgid "~E~nable"
+msgstr "~E~inschalten"
+
+#. Ask the value
+#: ../mainsrc/loaddefl.cc:280
+msgid "Associated value"
+msgstr "Verbundener Wert"
+
+#: ../mainsrc/loaddefl.cc:281 ../mainsrc/loaddefl.cc:301
+msgid "Value:"
+msgstr "Wert:"
+
+#. Ask the value
+#: ../mainsrc/loaddefl.cc:300
+#, fuzzy
+msgid "Associated string"
+msgstr "Verbundener Wert"
+
+#: ../mainsrc/loaddefl.cc:550 ../mainsrc/tags.cc:1380
+#: ../setedit/loadnobkp.cc:209 ../setedit/pathlist.cc:395
+msgid "Do you want to discard the changes?"
+msgstr "Wollen Sie die nderungen verwerfen?"
+
+#: ../mainsrc/loaddefl.cc:557
+msgid "Settings"
+msgstr "Einstellungen"
+
+#: ../mainsrc/loaddefl.cc:662
+msgid "Default global options"
+msgstr "Standardeinstellungen (global)"
+
+#: ../mainsrc/loaddefl.cc:714
+msgid "~N~o SHL"
+msgstr "~K~ein SHL"
+
+#: ../mainsrc/loadfunc.cc:26
+msgid "No file name under cursor"
+msgstr ""
+
+#. Generate a message indicating we couldn't load it
+#: ../mainsrc/loadfunc.cc:137
+#, fuzzy, c-format
+msgid "Can't find \"%s\" file"
+msgstr "Zielverzeichnis"
+
+#: ../mainsrc/loadshl.cc:657
+msgid "Wrong action in NLIndent"
+msgstr ""
+
+#: ../mainsrc/loadshl.cc:660
+msgid "Wrong second condition in NLIndent"
+msgstr ""
+
+#: ../mainsrc/loadshl.cc:663
+msgid "Wrong first condition in NLIndent"
+msgstr ""
+
+#: ../mainsrc/loadshl.cc:666
+#, fuzzy
+msgid "Wrong number of arguments for NLIndent"
+msgstr "Falsche Anzahl der Parameter"
+
+#: ../mainsrc/loadshl.cc:1456
+#, fuzzy
+msgid "Errors while loading syntax highlight file"
+msgstr "Fehler beim Lesen der Tastaturkonfiguration"
+
+#: ../mainsrc/loadusew.cc:226
+msgid "New user word"
+msgstr "Neues Benutzerwort"
+
+#: ../mainsrc/loadusew.cc:228
+msgid "Word:"
+msgstr "Wort:"
+
+#: ../mainsrc/loadusew.cc:303
+msgid "List of words"
+msgstr "Wortliste"
+
+#: ../mainsrc/loadusew.cc:354
+msgid "User words"
+msgstr "Benutzerwrter"
+
+#: ../mainsrc/pathtool.cc:821
+#, c-format
+msgid ""
+"\n"
+"Error! please run the editor from a valid directory\n"
+"\n"
+msgstr ""
+"\n"
+"Fehler! Bitte starten Sie den Editor aus einem gltigen Verzeichnis heraus\n"
+"\n"
+
+#: ../mainsrc/pmacros.cc:98 ../setedit/debug.cc:8732 ../setedit/loadcle.cc:97
+msgid "Unknown"
+msgstr "Unbekannt"
+
+#: ../mainsrc/pmacros.cc:165
+#, fuzzy
+msgid "Macro definition doesn't start with Trigger"
+msgstr "Makro Definition fngt nicht mit Trigger an"
+
+#: ../mainsrc/pmacros.cc:173
+msgid "Missing Trigger sequence or too short"
+msgstr "Trigger Sequenz fehlt oder ist zu kurz"
+
+#: ../mainsrc/pmacros.cc:193
+msgid "Macro definition without mode keyword"
+msgstr "Makro Definition ohne mode Schlsselwort"
+
+#: ../mainsrc/pmacros.cc:204 ../mainsrc/pmacros.cc:214
+msgid "Wrong mode definition in pseudo macro."
+msgstr "Falsche Modusdefinition im Pseudo Makro."
+
+#: ../mainsrc/pmacros.cc:266
+msgid "Missing start in pseudo macro"
+msgstr "Anfang des pseudo macro fehlt"
+
+#: ../mainsrc/pmacros.cc:271
+msgid "Missing end in pseudo macro"
+msgstr "Ende im pseudo macro fehlt"
+
+#: ../mainsrc/pmacros.cc:280
+msgid "Empty pseudo macro"
+msgstr "Leeres Pseudo Macro"
+
+#. Use a default name is none is provided
+#: ../mainsrc/pmacros.cc:332 ../mainsrc/pmacros.cc:335
+#, fuzzy
+msgid "No name"
+msgstr "Nov"
+
+#. Init the Message Window
+#: ../mainsrc/sdginter.cc:101
+msgid "Starting SDG:"
+msgstr "Starte SDG:"
+
+# unclear
+#: ../mainsrc/sdginter.cc:108
+#, c-format
+msgid "Error while %s:"
+msgstr "Fehler whrend %s:"
+
+#: ../mainsrc/sdginter.cc:112
+#, c-format
+msgid "(%d) %s in line %d"
+msgstr "(%d) %s in Zeile %d"
+
+#: ../mainsrc/sdginter.cc:120
+#, c-format
+msgid "In section %s"
+msgstr "In Sektion %s"
+
+#: ../mainsrc/sdginter.cc:121 ../mainsrc/slpinter.cc:550
+#, fuzzy, c-format
+msgid "Type of error: %s"
+msgstr "Tastaturtyp"
+
+#: ../mainsrc/sdginter.cc:123 ../mainsrc/slpinter.cc:552
+#, c-format
+msgid "Code: ...%s..."
+msgstr "Code: ...%s..."
+
+#: ../mainsrc/sdginter.cc:127
+msgid "End of SDG"
+msgstr "Ende von SDG"
+
+#: ../mainsrc/sdginter.cc:168
+msgid "SDG Parameters"
+msgstr "SDG Parameter"
+
+#: ../mainsrc/sdginter.cc:175
+msgid "~F~ormat file (.frt)"
+msgstr "~F~ormatdatei (.frt)"
+
+#: ../mainsrc/sdginter.cc:179
+msgid "~I~ntermediate file"
+msgstr "~T~emporrdatei"
+
+#: ../mainsrc/sdginter.cc:183
+msgid "~B~ase output (no extentions)"
+msgstr "Ausgabe (ohne Dateierweiterung)"
+
+#: ../mainsrc/sdginter.cc:187
+msgid "~D~irectory of formats"
+msgstr "~F~ormatverzeichnisse"
+
+#: ../mainsrc/sdginter.cc:190
+#, fuzzy
+msgid "K~e~ep intermediate"
+msgstr "~T~emporrdatei behalten"
+
+#: ../mainsrc/search.cc:295 ../mainsrc/search.cc:404
+#, c-format
+msgid "Regular expression error: %s"
+msgstr "Fehler im regulren Ausdruck: %s"
+
+#: ../mainsrc/search.cc:490
+msgid "PCRE Exec error"
+msgstr "PCRE Exec Fehler"
+
+#: ../mainsrc/slpinter.cc:549
+msgid "Error in sLisp interpreter:"
+msgstr "Fehler im sLisp bersetzer:"
+
+#: ../mainsrc/slpinter.cc:553
+msgid "End of SLP"
+msgstr "Ende von SLP"
+
+#: ../mainsrc/slpinter.cc:627
+#, fuzzy
+msgid "Enter sLisp code to interpret"
+msgstr "Fehler im sLisp bersetzer:"
+
+#: ../mainsrc/slpinter.cc:656
+msgid "No macros defined"
+msgstr "Keine macros definiert"
+
+#: ../mainsrc/slpinter.cc:699
+msgid "sLisp macros"
+msgstr "sLisp Makros"
+
+#: ../mainsrc/slpinter.cc:709
+msgid "~M~acros"
+msgstr "~M~akros"
+
+#: ../mainsrc/ssyntax.cc:202
+#, c-format
+msgid " [%d nodes]"
+msgstr " [%d Knoten]"
+
+#: ../mainsrc/ssyntax.cc:371
+msgid "New node for search"
+msgstr "Neuer Knoten fr Suche"
+
+#: ../mainsrc/ssyntax.cc:374
+msgid "Name of the info file"
+msgstr "Name der info Datei"
+
+#: ../mainsrc/ssyntax.cc:376
+msgid "Name of the node (leave blank for all)"
+msgstr "Name des Knotens (leer lassen fr alle)"
+
+#: ../mainsrc/ssyntax.cc:435
+msgid "Nodes for syntax help"
+msgstr "Knoten fr Syntaxhilfe"
+
+#: ../mainsrc/ssyntax.cc:473
+msgid "Options for syntax help"
+msgstr "Einstellungen fr Syntaxhilfe"
+
+#. I think that's easiest way! The following 5 lines are equivalent to 20 lines
+#. of cryptic stuff if you don't use EasyDiag! (I can write it in 1 too ;-)
+#: ../mainsrc/ssyntax.cc:477
+msgid "Search ~m~ethod"
+msgstr "Such~m~ethode"
+
+#: ../mainsrc/ssyntax.cc:477
+msgid "E~x~act"
+msgstr "E~x~akt"
+
+#: ../mainsrc/ssyntax.cc:477
+msgid "~S~ubstring"
+msgstr "~T~eiltext"
+
+#: ../mainsrc/ssyntax.cc:478
+msgid "~F~uzzy"
+msgstr "~F~uzzy"
+
+#: ../mainsrc/ssyntax.cc:479
+msgid "Search O~p~tions"
+msgstr "Such~o~ptionen"
+
+#: ../mainsrc/ssyntax.cc:480
+msgid "So~r~t by score"
+msgstr "Nach Punkten so~r~tieren"
+
+#: ../mainsrc/ssyntax.cc:484
+msgid "Fu~z~zy value [1..1000]"
+msgstr "Fu~z~zy Wert [1..1000]"
+
+#: ../mainsrc/ssyntax.cc:486 ../setedit/edprefs.cc:657
+msgid "Other options"
+msgstr "Andere Optionen"
+
+#: ../mainsrc/ssyntax.cc:486
+msgid "Search word in the ~t~opic"
+msgstr "Wort im Thema suchen"
+
+#: ../mainsrc/ssyntax.cc:875
+msgid "Choose a node"
+msgstr "Whlen Sie einen Knoten"
+
+#: ../mainsrc/ssyntax.cc:927
+msgid "No INFO files for syntax help defined"
+msgstr "Keine INFO Dateien fr Syntaxsuche angegeben"
+
+#: ../mainsrc/tags.cc:816
+#, fuzzy
+msgid "Wrong format for tags file!"
+msgstr "Falsche Projektdatei."
+
+#. Ask to generate a new one
+#: ../mainsrc/tags.cc:1004
+msgid "I can try to generate a tag file, go ahead?"
+msgstr ""
+
+#. Not installed explain how to get it.
+#: ../mainsrc/tags.cc:1013
+msgid "Install Exuberant Ctags, download it from http://ctags.sourceforge.net"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1361
+msgid "This file is automatically maintained"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1390
+#, fuzzy
+msgid "Select tags file"
+msgstr "Datei aussuchen"
+
+#: ../mainsrc/tags.cc:1406
+msgid "Use relative path for the file?"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1427
+#, fuzzy
+msgid "Variables"
+msgstr "Verfgbar"
+
+#: ../mainsrc/tags.cc:1443
+#, fuzzy
+msgid "Tag files"
+msgstr "Speicher Datei als"
+
+#: ../mainsrc/tags.cc:1545
+#, fuzzy
+msgid "Jump to symbol"
+msgstr "Gehe zu Funktion"
+
+#: ../mainsrc/tags.cc:1545
+#, fuzzy
+msgid "List of symbols"
+msgstr "Wortliste"
+
+#: ../mainsrc/tags.cc:1546
+#, fuzzy
+msgid "~S~earch members"
+msgstr "~S~uche"
+
+#: ../mainsrc/tags.cc:1578
+#, fuzzy
+msgid "Unknown line"
+msgstr "Unbekannt"
+
+#: ../mainsrc/tags.cc:1623 ../mainsrc/tags.cc:1824 ../mainsrc/tags.cc:1840
+#, fuzzy
+msgid "Members"
+msgstr "Dezember"
+
+#: ../mainsrc/tags.cc:1623 ../mainsrc/tags.cc:1750 ../mainsrc/tags.cc:1824
+#: ../mainsrc/tags.cc:1840
+#, fuzzy
+msgid "~J~ump"
+msgstr "~G~ruppe"
+
+#: ../mainsrc/tags.cc:1632
+#, fuzzy
+msgid "Sorry, couldn't find any member"
+msgstr "Kann autoexec.bat nicht finden"
+
+#: ../mainsrc/tags.cc:1637
+#, fuzzy
+msgid "I don't know any members for this type"
+msgstr "Nicht genug Speicher fr diese Operation"
+
+#: ../mainsrc/tags.cc:1734
+#, fuzzy
+msgid "Class list"
+msgstr "Spiel~l~iste"
+
+#: ../mainsrc/tags.cc:1745
+#, fuzzy
+msgid "List of classes"
+msgstr "Dateiliste"
+
+#: ../mainsrc/tags.cc:1749
+#, fuzzy
+msgid "~V~iew"
+msgstr "~N~eu"
+
+#: ../mainsrc/tags.cc:1788
+#, fuzzy
+msgid "P~a~rents"
+msgstr "~D~rucken"
+
+#: ../mainsrc/tags.cc:1790
+msgid "Browse ~p~arent"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1795
+msgid "Chil~d~ren"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1797
+msgid "Browse ~c~hild"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1806
+#, fuzzy
+msgid "View"
+msgstr "InfView"
+
+#: ../mainsrc/tags.cc:1807
+msgid "~T~his class"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1808
+#, fuzzy
+msgid "This & Pa~r~ents"
+msgstr "~D~rucken"
+
+#: ../mainsrc/tags.cc:1809
+#, fuzzy
+msgid "~S~orted"
+msgstr "~S~ortierungsart"
+
+#: ../mainsrc/tags.cc:1841
+msgid "View ~C~lass"
+msgstr ""
+
+#: ../mainsrc/tags.cc:1941
+#, fuzzy
+msgid "Sorry, but I can't find any class."
+msgstr "Kann autoexec.bat nicht finden"
+
+#: ../mainsrc/tags.cc:2071
+msgid "This option is only available when using projects"
+msgstr ""
+
+#: ../mainsrc/tags.cc:2076
+#, fuzzy
+msgid "Tags options"
+msgstr "~E~xtraeinstellungen"
+
+#: ../mainsrc/tags.cc:2078
+msgid "Automatic generation"
+msgstr ""
+
+#: ../mainsrc/tags.cc:2078
+#, fuzzy
+msgid "~D~isabled"
+msgstr "~A~usschalten"
+
+#: ../mainsrc/tags.cc:2079
+#, fuzzy
+msgid "~U~sing central file"
+msgstr "Falsche Desktopdatei."
+
+#: ../mainsrc/tags.cc:2093
+msgid "Remove the tags files that I maintained from the list of files to use?"
+msgstr ""
+
+#: ../mp3/ampdiag.cc:83
+msgid "You are expanding a MP3 file, do you really want to quit?"
+msgstr "Sie entkomprimieren eine MP3 Datei. Wollen Sie wirklich beenden?"
+
+#: ../mp3/ampdiag.cc:100
+#, c-format
+msgid "Sample Rate: %5d Hz Bitrate: %4d Kbits/s"
+msgstr "Frequenz: %5d Hz Bitrate: %4d Kbits/s"
+
+#: ../mp3/ampdiag.cc:103
+#, c-format
+msgid "Mode: %6s File: MPEG %1d.0 layer %1d"
+msgstr "Mode: %6s Datei: MPEG %1d.0 layer %1d"
+
+#: ../mp3/ampdiag.cc:106
+#, c-format
+msgid "Total: %3d:%02d"
+msgstr "Total: %3d:%02d"
+
+#: ../mp3/ampdiag.cc:109
+#, c-format
+msgid "Title: %s"
+msgstr "Titel: %s"
+
+#: ../mp3/ampdiag.cc:111
+#, c-format
+msgid "Author: %s"
+msgstr "Author: %s"
+
+#: ../mp3/ampdiag.cc:113
+#, c-format
+msgid "Album: %s"
+msgstr "Album: %s"
+
+# unclear
+#: ../mp3/ampdiag.cc:115
+#, c-format
+msgid "Comme.: %s"
+msgstr "Komme.: %s"
+
+#: ../mp3/ampdiag.cc:117
+#, c-format
+msgid "Genre: %s"
+msgstr "Genre: %s"
+
+#: ../mp3/ampdiag.cc:130
+msgid "[ PAUSE ]"
+msgstr "[ PAUSE ]"
+
+#: ../mp3/ampdiag.cc:133 ../mp3/ampdiag.cc:273
+msgid "[ STOP ]"
+msgstr "[ STOP ]"
+
+#: ../mp3/ampdiag.cc:135
+msgid "[ PLAY ]"
+msgstr "[ SPIELEN]"
+
+#: ../mp3/ampdiag.cc:214
+#, c-format
+msgid "Time: %3d:%02d"
+msgstr "Zeit: %3d:%02d"
+
+#: ../mp3/ampdiag.cc:244
+msgid "Player status"
+msgstr "Spieler Status"
+
+#: ../mp3/ampdiag.cc:271
+msgid "Time: 000:00"
+msgstr "Zeit: 000:00"
+
+#: ../mp3/ampdiag.cc:275
+msgid "Total: 000:00"
+msgstr "Total: 000:00"
+
+#: ../mp3/ampdiag.cc:283
+msgid "Prev."
+msgstr "Vorh."
+
+#: ../mp3/ampdiag.cc:289
+msgid "Next"
+msgstr "Nchstes"
+
+#: ../mp3/ampdiag.cc:459
+msgid "MP3 Player"
+msgstr "MP3 Spieler"
+
+#: ../mp3/ampdiag.cc:460
+msgid "MP3 support not linked"
+msgstr "MP3 Untersttzung nicht eingebunden"
+
+#: ../mp3/intermp3.cc:55
+msgid "MP3 Open"
+msgstr "ffne MP3"
+
+#: ../mp3/intermp3.cc:70
+msgid "Output WAV file"
+msgstr ".wav-Datei erzeugen"
+
+#: ../mp3/intermp3.cc:77 ../mp3/intermp3.cc:93
+msgid "First select a file"
+msgstr "Whlen Sie zuerst eine Datei"
+
+#: ../mp3/intermp3.cc:258
+msgid "The MP3 routines aren't linked in the editor"
+msgstr "Die MP3-Routinen sind nicht in den Editor eingebunden"
+
+#: ../mp3/mp3list.cc:101
+msgid "Select a file"
+msgstr "Datei aussuchen"
+
+#: ../mp3/mp3list.cc:120
+#, fuzzy
+msgid "Save file list"
+msgstr "Dateiliste speichern"
+
+#: ../mp3/mp3list.cc:126
+msgid "Load list of files"
+msgstr "Dateiliste laden"
+
+#: ../mp3/mp3list.cc:193
+msgid "Could not create the list file."
+msgstr "Konnte Listendatei nicht erstellen."
+
+#: ../mp3/mp3list.cc:243
+msgid "Could not open the list file"
+msgstr "Konnte die Listendatei nicht ffnen"
+
+#: ../mp3/mp3list.cc:262
+msgid "Wrong file type."
+msgstr "Falscher Dateityp."
+
+#: ../mp3/mp3list.cc:270
+msgid "Error reading the file list"
+msgstr "Fehler beim Lesen der Dateiliste"
+
+#: ../mp3/mp3list.cc:326
+msgid "Play List"
+msgstr "Abspielliste"
+
+#: ../mp3/mp3list.cc:330
+msgid "List of files"
+msgstr "Dateiliste"
+
+#: ../mp3/mp3list.cc:334 ../settvuti/tdiagaid.cc:169
+msgid "~I~nsert"
+msgstr "~E~infgen"
+
+#: ../mp3/mp3list.cc:336 ../setedit/editmenu.cc:64
+msgid "~S~ave"
+msgstr "~S~peichern"
+
+#: ../mp3/mp3list.cc:337
+msgid "~L~oad"
+msgstr "~L~aden"
+
+#: ../sdg/mliediti.cc:76
+#, fuzzy
+msgid "Return value:"
+msgstr "Unbekannter Wert"
+
+#. Convert the frame into something "human readable"
+#: ../sdg/mli.cc:1618 ../setedit/debug.cc:1413 ../setedit/debug.cc:1786
+#: ../setedit/debug.cc:7396 ../setedit/debug.cc:8722
+msgid "unknown"
+msgstr "unbekannt"
+
+#: ../sdg/mli.cc:1623
+msgid "parser"
+msgstr "parser"
+
+#: ../sdg/mli.cc:1624
+msgid "syntax"
+msgstr "Syntax"
+
+#: ../sdg/mli.cc:1629
+#, fuzzy
+msgid "string not closed"
+msgstr "Zeichenkette nicht beendent"
+
+#: ../sdg/mli.cc:1630
+#, fuzzy
+msgid "no ) at end of code"
+msgstr "kein ) Befehlsende"
+
+#: ../sdg/mli.cc:1631
+msgid "no starting ("
+msgstr "keine beginnende ("
+
+#: ../sdg/mli.cc:1632
+msgid "wrong number"
+msgstr "Falsche Nummer"
+
+#: ../sdg/mli.cc:1633
+msgid "unknown value"
+msgstr "Unbekannter Wert"
+
+#: ../sdg/mli.cc:1634
+msgid "stack overflow"
+msgstr ""
+
+#: ../sdg/mli.cc:1639
+msgid "command where a parameter was expected"
+msgstr "Befehl, wo Parameter erwartet war"
+
+#: ../sdg/mli.cc:1640
+msgid "command expected"
+msgstr "Befehl erwartet"
+
+#: ../sdg/mli.cc:1641
+msgid "parameter after command"
+msgstr "Parameter nach Befehl"
+
+#: ../sdg/mli.cc:1642
+msgid "wrong number of parameters"
+msgstr "Falsche Anzahl der Parameter"
+
+#: ../sdg/mli.cc:1643
+msgid "wrong parameter type"
+msgstr "Falscher Parametertyp"
+
+#: ../sdg/mli.cc:1644
+msgid "undefined variable"
+msgstr "Undefinierte Variable"
+
+#: ../sdg/mli.cc:1645
+msgid "undefined symbol"
+msgstr "Undefiniertes Symbol"
+
+#: ../sdg/mli.cc:1646
+msgid "operation not defined"
+msgstr "Operation nicht definiert"
+
+#: ../sdg/mli.cc:1647
+#, fuzzy
+msgid "invalid character for a name"
+msgstr "Extra Zeichen in Zeile"
+
+#: ../sdg/mli.cc:1648
+msgid "invalid key sequence"
+msgstr ""
+
+#: ../sdg/mli.cc:1649
+msgid "PCRE not available"
+msgstr ""
+
+#: ../sdg/mli.cc:1650
+#, fuzzy
+msgid "PCRE compile error"
+msgstr "PCRE Exec Fehler"
+
+#: ../setedit/advice.cc:46
+#, fuzzy
+msgid ""
+"You are about to switch to the user screen\n"
+"Press ENTER to go back"
+msgstr ""
+"Sie werden gleich den Benutzerbildschirm sehen\n"
+"Drcken Sie ENTER, um zurckzukehren"
+
+#: ../setedit/advice.cc:48
+#, fuzzy
+msgid ""
+"Avoid using files that aren't in a directory that isn't relative to the "
+"working one. For example: on another drive. If you do it, you'll have "
+"problems if the directories are moved or transported to another machine."
+msgstr ""
+"Vermeiden Sie, Dateien zu benutzen, die nicht relativ zum Arbeitsverzeichnis "
+"sind (z.B. auf einem anderen Laufwerk). Sollten Sie es dennoch tun, knnten "
+"Probleme auftauchen, nachdem die Dateien umbewegt wurden."
+
+#: ../setedit/advice.cc:50
+msgid ""
+"Do you really want to delete\n"
+"this file from disk?"
+msgstr ""
+"Wollen Sie diese Datei wirklich\n"
+"von der Festplatte lschen?"
+
+#: ../setedit/advice.cc:52
+#, fuzzy
+msgid ""
+"Keep in mind that SHIFT and CAPS-LOCK will affect the case of the letters "
+"during incremental searches"
+msgstr ""
+"Mit diesen Einstellungen beeinflusst `Umschalt'/`CapsLock' die "
+"Inkrementsuche. Vergessen Sie das nicht."
+
+#: ../setedit/advice.cc:54
+#, fuzzy
+msgid ""
+"Keep in mind that incremental searches aren't very intuitive, especially "
+"when pressing SHIFT."
+msgstr ""
+"Mit diesen Einstellungen sind Inkrementsuchen nicht sehr intuitiv, "
+"besonders, wenn Sie `Shift' drcken. Vergessen Sie das nicht."
+
+#: ../setedit/advice.cc:56
+#, fuzzy
+msgid ""
+"Keep in mind that while holding SHIFT the incremental search is done for "
+"directory names, rather than files."
+msgstr ""
+"Beim Gedrckthalten von `Umschalt' wird nach Verzeichnissen gesucht. "
+"Ansonsten nur nach Dateien. Vergessen Sie das nicht."
+
+#: ../setedit/advice.cc:58
+msgid ""
+"When using real tabs the following options are usually desired: Autoindent "
+"ON, Intelligent C indent OFF, Optimal Fill ON, Don't move inside tabs ON, "
+"Tab smart indents OFF, Use indent size OFF and Backspace unindents OFF.\n"
+"I see not all of them are set this way."
+msgstr ""
+
+#: ../setedit/advice.cc:60
+#, fuzzy
+msgid ""
+"Tags file has incorrect format.\n"
+"Do you want to read more about it?"
+msgstr "Diese Taste ist bereits benutzt. Wollen Sie sie ersetzen?"
+
+#: ../setedit/advice.cc:62
+#, fuzzy
+msgid ""
+"This option needs a tags file.\n"
+"Do you want to read more about it?"
+msgstr "Diese Taste ist bereits benutzt. Wollen Sie sie ersetzen?"
+
+#: ../setedit/advice.cc:64
+msgid ""
+"GNU diff isn't installed.\n"
+"For this reason I can't offer some options."
+msgstr ""
+
+#: ../setedit/advice.cc:66
+msgid ""
+"Debug options are stored in project files.\n"
+"If you don't use a project you'll lose the options"
+msgstr ""
+
+#: ../setedit/advice.cc:68
+msgid ""
+"Please confirm you really want to finish the debug session. Breakpoints and "
+"other things will be lost."
+msgstr ""
+
+#: ../setedit/advice.cc:70
+msgid ""
+"A debug session is active.\n"
+"Do you want to stop it?"
+msgstr ""
+
+#: ../setedit/advice.cc:72
+msgid ""
+"It will kill the program you are debugging.\n"
+"Go ahead?"
+msgstr ""
+
+#: ../setedit/advice.cc:74
+msgid ""
+"The program will be started in another virtual terminal.\n"
+"Consult the Debug Window to know which one."
+msgstr ""
+
+#: ../setedit/advice.cc:76
+msgid ""
+"Encrypted file detected.\n"
+"Install GPG in /usr/bin/."
+msgstr ""
+
+#: ../setedit/advice.cc:104
+msgid "Advice"
+msgstr "Hinweis"
+
+#: ../setedit/advice.cc:119 ../setedit/editdiag.cc:87
+msgid "Don't show it next time"
+msgstr "Nicht beim nchsten Mal anzeigen"
+
+#: ../setedit/advice.cc:243
+#, fuzzy
+msgid "Advice dialogs"
+msgstr "Hinweis"
+
+#: ../setedit/advice.cc:249
+msgid "Select which advice dialogs are enabled"
+msgstr ""
+
+#: ../setedit/ascii.cc:152
+msgid " Char: "
+msgstr " Zeichen: "
+
+#: ../setedit/ascii.cc:153
+msgid " Decimal: "
+msgstr " Dezimal: "
+
+#: ../setedit/ascii.cc:154
+msgid " Hex: "
+msgstr " Hex: "
+
+#: ../setedit/ascii.cc:191
+msgid "ASCII Chart"
+msgstr "ASCII Tabelle"
+
+#: ../setedit/boardmix.cc:79
+#, fuzzy
+msgid "Disabled by configuration"
+msgstr "Vereinfache Konfiguration"
+
+#: ../setedit/boardmix.cc:87
+msgid "Failed to initialize mixer. Sorry"
+msgstr ""
+
+#. gcc 2.95.2 doesn't like the _() call in the inlined constructor, I wonder why
+#. because 2.7.2.3 and 2.8.1 allows it as spected.
+#: ../setedit/boardmix.cc:93
+msgid "Hardward Mixer Settings"
+msgstr ""
+
+#: ../setedit/boardmix.cc:95
+msgid "Mixer model:"
+msgstr ""
+
+#: ../setedit/boardmix.cc:117
+msgid "~L~ock channels"
+msgstr ""
+
+#: ../setedit/boardmix.cc:117
+#, fuzzy
+msgid "~S~ave to disk"
+msgstr "~S~peichere Desktopeinstellungen"
+
+#: ../setedit/boardmix.cc:151
+msgid "No mixer support linked in during configuration, sorry"
+msgstr ""
+
+#: ../setedit/calendar.cc:42
+msgid "January"
+msgstr "Januar"
+
+#: ../setedit/calendar.cc:42
+msgid "February"
+msgstr "Februar"
+
+#: ../setedit/calendar.cc:42
+msgid "March"
+msgstr "Mrz"
+
+#: ../setedit/calendar.cc:42
+msgid "April"
+msgstr "April"
+
+#: ../setedit/calendar.cc:42
+msgid "May"
+msgstr "Mai"
+
+#: ../setedit/calendar.cc:43
+msgid "June"
+msgstr "Juni"
+
+#: ../setedit/calendar.cc:43
+msgid "July"
+msgstr "Juli"
+
+#: ../setedit/calendar.cc:43
+msgid "August"
+msgstr "August"
+
+#: ../setedit/calendar.cc:43
+msgid "September"
+msgstr "September"
+
+#: ../setedit/calendar.cc:43
+msgid "October"
+msgstr "Oktober"
+
+#: ../setedit/calendar.cc:44
+msgid "November"
+msgstr "November"
+
+#: ../setedit/calendar.cc:44
+msgid "December"
+msgstr "Dezember"
+
+#: ../setedit/calendar.cc:193
+msgid "Su Mo Tu We Th Fr Sa"
+msgstr "So Mo Di Mi Do Fr Sa"
+
+#: ../setedit/calendar.cc:296
+msgid "Calendar"
+msgstr "Kalender"
+
+#: ../setedit/debug.cc:307 ../setedit/debug.cc:8723
+#, fuzzy
+msgid "Ok"
+msgstr "~O~k"
+
+#: ../setedit/debug.cc:308
+msgid "Can't update"
+msgstr ""
+
+#: ../setedit/debug.cc:309
+#, fuzzy
+msgid "Out of scope"
+msgstr "Nicht genug Speicher fr diese Operation"
+
+#: ../setedit/debug.cc:522
+#, fuzzy, c-format
+msgid "Do you want to provide the path for: '%s'."
+msgstr "Wollen Sie die nderungen verwerfen?"
+
+#. Bring a dialog to select it
+#: ../setedit/debug.cc:535
+#, fuzzy
+msgid "Source file"
+msgstr "Musterquelle"
+
+#. Failed to stat or not regular file
+#: ../setedit/debug.cc:540
+#, c-format
+msgid "Can't use: '%s'."
+msgstr ""
+
+#: ../setedit/debug.cc:550
+#, c-format
+msgid "Add path to list: '%s'?"
+msgstr ""
+
+#: ../setedit/debug.cc:701 ../setedit/debug.cc:741
+msgid "The program is running and GDB/MI doesn't support async commands"
+msgstr ""
+
+#: ../setedit/debug.cc:768
+msgid "Time out in gdb response. Continue waiting?"
+msgstr ""
+
+#: ../setedit/debug.cc:827
+msgid "PID (Process ID) of the running process"
+msgstr ""
+
+#. EN: P
+#: ../setedit/debug.cc:830
+msgid "~P~ID:"
+msgstr ""
+
+#: ../setedit/debug.cc:883
+#, fuzzy
+msgid "default"
+msgstr "~O~riginal"
+
+#. We don't even know what to debug ;-)
+#: ../setedit/debug.cc:903
+msgid "You must set the debug options first. Do you want to do it now?"
+msgstr ""
+
+#. Don't even try if the program doesn't exist
+#: ../setedit/debug.cc:918
+#, fuzzy, c-format
+msgid "The '%s' file doesn't exist"
+msgstr "Diese Datei ist nicht auf Festplatte!"
+
+#: ../setedit/debug.cc:947
+msgid "Hey! That's my PID!"
+msgstr ""
+
+#: ../setedit/debug.cc:955
+#, c-format
+msgid "Attached to PID %d"
+msgstr ""
+
+#. Don't even try if nothing to try ;-)
+#: ../setedit/debug.cc:964
+msgid ""
+"Please fill both 'Remote target options'. Try extended-remote for the type "
+"and IP:PORT for location."
+msgstr ""
+
+#: ../setedit/debug.cc:974
+#, c-format
+msgid "At the '%s' machine run: 'gdbserver :%s program args...'"
+msgstr ""
+
+#: ../setedit/debug.cc:980
+msgid "Run gdbserver at the remote machine"
+msgstr ""
+
+#: ../setedit/debug.cc:1414 ../setedit/debug.cc:1788
+#, c-format
+msgid "%d: %s:%s:%d addr %p"
+msgstr ""
+
+#: ../setedit/debug.cc:1501
+msgid "Evaluate and Modify"
+msgstr ""
+
+#. All together
+#. EN: AERTW
+#. ES: AELST
+#: ../setedit/debug.cc:1596 ../setedit/debug.cc:4644
+msgid "~E~xpression (escape \" characters: \\\")"
+msgstr ""
+
+#: ../setedit/debug.cc:1598
+#, fuzzy
+msgid "~N~ew value"
+msgstr "~b~erschreiben"
+
+#: ../setedit/debug.cc:1603
+#, fuzzy
+msgid "C~h~ange"
+msgstr "Re~c~hteck"
+
+#: ../setedit/debug.cc:1607
+#, fuzzy
+msgid "~I~nspect"
+msgstr "~E~infgen"
+
+#: ../setedit/debug.cc:1642
+msgid "Nothing to inspect, please provide an expression"
+msgstr ""
+
+#: ../setedit/debug.cc:1809
+msgid "No threads to select"
+msgstr ""
+
+#: ../setedit/debug.cc:1818
+msgid "Inconsistent info from gdb"
+msgstr ""
+
+#. Create a dialog to select them
+#: ../setedit/debug.cc:1829
+#, fuzzy
+msgid "Select Thread"
+msgstr "~L~sche"
+
+#: ../setedit/debug.cc:1837
+msgid "ID"
+msgstr ""
+
+#: ../setedit/debug.cc:1953
+#, fuzzy
+msgid "Code"
+msgstr "~B~ewegen"
+
+#: ../setedit/debug.cc:2008
+msgid "No address associated with this line"
+msgstr ""
+
+#: ../setedit/debug.cc:2311
+#, fuzzy
+msgid "Disassembler Window"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/debug.cc:2402
+#, fuzzy
+msgid "Modify register"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:2472
+#, fuzzy, c-format
+msgid " Disassembler [%p-%p]"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/debug.cc:2969
+#, fuzzy
+msgid "Modify variable"
+msgstr "Undefinierte Variable"
+
+#: ../setedit/debug.cc:3125 ../setedit/debug.cc:3129
+#, fuzzy
+msgid "Format"
+msgstr "Normal"
+
+#: ../setedit/debug.cc:3130
+msgid "~N~atural"
+msgstr ""
+
+#: ../setedit/debug.cc:3131
+#, fuzzy
+msgid "~B~inary"
+msgstr "Januar"
+
+#: ../setedit/debug.cc:3132
+#, fuzzy
+msgid "~D~ecimal"
+msgstr " Dezimal: "
+
+#: ../setedit/debug.cc:3133
+#, fuzzy
+msgid "~H~exadecimal"
+msgstr " Dezimal: "
+
+#: ../setedit/debug.cc:3134
+#, fuzzy
+msgid "~O~ctal"
+msgstr "Okt"
+
+#: ../setedit/debug.cc:3232 ../setedit/debug.cc:3269
+#, fuzzy
+msgid "Inspector"
+msgstr "In Sektion %s"
+
+#: ../setedit/debug.cc:3349
+#, fuzzy, c-format
+msgid " Inspector %s"
+msgstr "In Sektion %s"
+
+#: ../setedit/debug.cc:3430
+#, fuzzy
+msgid "Inspect variable"
+msgstr "Undefinierte Variable"
+
+#: ../setedit/debug.cc:3528
+#, fuzzy
+msgid "None"
+msgstr "Nov"
+
+#: ../setedit/debug.cc:3724
+#, c-format
+msgid "%d breakpoints failed to apply, they are disabled now."
+msgstr ""
+
+#. EN: CDEFHILNOSTUW
+#. ES: ABCDFHILORSUV
+#: ../setedit/debug.cc:3892
+msgid "Type"
+msgstr ""
+
+#: ../setedit/debug.cc:3893
+msgid "File/L~i~ne"
+msgstr ""
+
+#: ../setedit/debug.cc:3894
+#, fuzzy
+msgid "Fu~n~ction"
+msgstr "Aktion"
+
+#: ../setedit/debug.cc:3895
+#, fuzzy
+msgid "File/Functi~o~n"
+msgstr "Aktion"
+
+#: ../setedit/debug.cc:3896 ../setedit/editmenu.cc:408
+#, fuzzy
+msgid "~A~ddress"
+msgstr "~H~inzufgen"
+
+#. Same width
+#: ../setedit/debug.cc:3898
+#, fuzzy
+msgid " ~F~ilename"
+msgstr "~D~atei"
+
+#. Same width
+#: ../setedit/debug.cc:3901
+#, fuzzy
+msgid " F~u~nction"
+msgstr "Aktion"
+
+#. Same width
+#: ../setedit/debug.cc:3904
+msgid " ~L~ine"
+msgstr ""
+
+#. Same width
+#: ../setedit/debug.cc:3907
+msgid " Addre~s~s"
+msgstr ""
+
+#. Same width
+#: ../setedit/debug.cc:3910
+#, fuzzy
+msgid "Con~d~ition"
+msgstr "Besttige Optionen"
+
+#. Same width
+#: ../setedit/debug.cc:3913
+#, fuzzy
+msgid " Coun~t~"
+msgstr "Ein Befehl"
+
+#: ../setedit/debug.cc:3915
+msgid " T~h~read"
+msgstr ""
+
+#: ../setedit/debug.cc:3918 ../setedit/debug.cc:4650
+#, fuzzy
+msgid "~E~nabled"
+msgstr "~E~inschalten"
+
+#: ../setedit/debug.cc:3919
+msgid "Hard~w~are assisted"
+msgstr ""
+
+#: ../setedit/debug.cc:3945
+msgid "Sorry, you can't perform this operation right now"
+msgstr ""
+
+#: ../setedit/debug.cc:3953
+#, fuzzy, c-format
+msgid "Error: %s (%d) [%s]"
+msgstr "Fehler in Ausdruck (%d)"
+
+#: ../setedit/debug.cc:3955 ../setedit/debug.cc:7307
+#, fuzzy, c-format
+msgid "Error: %s (%d)"
+msgstr "Fehler in Ausdruck (%d)"
+
+#: ../setedit/debug.cc:4051
+#, fuzzy
+msgid "Modify breakpoint"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:4090
+#, fuzzy
+msgid "Add breakpoint"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:4260
+#, fuzzy
+msgid "Breakpoints"
+msgstr "~D~rucken"
+
+#. The following is quite annoying because we construct the format from its
+#. parts.
+#. Keep 1 char
+#: ../setedit/debug.cc:4282
+msgid "E"
+msgstr ""
+
+#: ../setedit/debug.cc:4283
+#, fuzzy
+msgid "Where"
+msgstr "andere"
+
+#: ../setedit/debug.cc:4284
+#, fuzzy
+msgid "Condition"
+msgstr "Besttige Optionen"
+
+#. Keep 5 chars
+#: ../setedit/debug.cc:4286
+#, fuzzy
+msgid "Count"
+msgstr "Ein Befehl"
+
+#. Keep 5 chars
+#: ../setedit/debug.cc:4288
+#, fuzzy
+msgid "Thre."
+msgstr "~B~aum"
+
+#: ../setedit/debug.cc:4306 ../setedit/debug.cc:4913
+#, fuzzy
+msgid "~M~odify"
+msgstr "~B~ewegen"
+
+#: ../setedit/debug.cc:4307 ../setedit/debug.cc:4914 ../setedit/editmenu.cc:63
+msgid "~N~ew"
+msgstr "~N~eu"
+
+#: ../setedit/debug.cc:4310 ../setedit/debug.cc:4917
+#, fuzzy
+msgid "D~i~sable"
+msgstr "~A~usschalten"
+
+#: ../setedit/debug.cc:4311
+#, fuzzy
+msgid "~S~how"
+msgstr "~S~top"
+
+#: ../setedit/debug.cc:4515
+#, c-format
+msgid "%d watchpoints failed to apply, they are disabled now."
+msgstr ""
+
+#: ../setedit/debug.cc:4646
+#, fuzzy
+msgid "~T~ype"
+msgstr "~V~ersuch"
+
+#: ../setedit/debug.cc:4647
+#, fuzzy
+msgid "~W~rite"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:4648
+#, fuzzy
+msgid "~R~ead"
+msgstr "~W~iederherstellen"
+
+#: ../setedit/debug.cc:4649
+msgid "~A~ccess (read or write)"
+msgstr ""
+
+#: ../setedit/debug.cc:4691
+#, fuzzy
+msgid "Modify watchpoint"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:4732
+#, fuzzy
+msgid "Add watchpoint"
+msgstr "In Datei schreiben"
+
+#: ../setedit/debug.cc:4890
+#, fuzzy
+msgid "Watchpoints"
+msgstr "In Datei schreiben"
+
+# End of header
+#: ../setedit/debug.cc:4906
+#, fuzzy
+msgid " E R/W Expression"
+msgstr "~A~usdruck"
+
+#: ../setedit/debug.cc:5100
+msgid "Unaccessable memory address specified"
+msgstr ""
+
+#: ../setedit/debug.cc:5139
+#, fuzzy
+msgid "Error in expression, an integer is needed"
+msgstr "Fehler in Ausdruck (%d)"
+
+#: ../setedit/debug.cc:5843
+#, fuzzy
+msgid "~N~ew Value"
+msgstr "~b~erschreiben"
+
+#: ../setedit/debug.cc:5844
+#, fuzzy
+msgid "~F~rom"
+msgstr "~F5~ Zoom"
+
+#: ../setedit/debug.cc:5845
+#, fuzzy
+msgid "~T~o"
+msgstr "~N~ein"
+
+#: ../setedit/debug.cc:5847
+#, fuzzy
+msgid "~L~ength"
+msgstr "~R~echte Alt"
+
+#: ../setedit/debug.cc:5848
+#, fuzzy
+msgid "~V~alue"
+msgstr "Wert:"
+
+#: ../setedit/debug.cc:5909
+msgid "Please fill all the requested values"
+msgstr ""
+
+#: ../setedit/debug.cc:5931
+#, c-format
+msgid "For security reasons the maximum length is limited to %lu bytes"
+msgstr ""
+
+#: ../setedit/debug.cc:5937
+msgid "This could be slow. Do you want to continue?"
+msgstr ""
+
+#: ../setedit/debug.cc:5961
+#, fuzzy
+msgid "Write block to file"
+msgstr "In Datei schreiben"
+
+#: ../setedit/debug.cc:5961
+#, fuzzy
+msgid "Read block from file"
+msgstr "Lese aus Datei"
+
+#: ../setedit/debug.cc:6181
+#, fuzzy
+msgid "Base Address"
+msgstr "~H~inzufgen"
+
+#. goto to a new address
+#: ../setedit/debug.cc:6208 ../setedit/debug.cc:6409
+#, fuzzy
+msgid "Data window"
+msgstr "~F~enster"
+
+#: ../setedit/debug.cc:6224
+msgid "Fill Block"
+msgstr ""
+
+#: ../setedit/debug.cc:6233
+msgid "Clear Block"
+msgstr ""
+
+#: ../setedit/debug.cc:6242
+msgid "Move Block"
+msgstr ""
+
+#: ../setedit/debug.cc:6260
+#, fuzzy
+msgid "Read Block"
+msgstr "Re~c~hteck"
+
+#: ../setedit/debug.cc:6264
+#, c-format
+msgid "%u bytes read."
+msgstr ""
+
+#: ../setedit/debug.cc:6274
+#, fuzzy
+msgid "Write Block"
+msgstr "~B~estndige Blcke"
+
+#: ../setedit/debug.cc:6282
+#, c-format
+msgid "%u bytes written."
+msgstr ""
+
+#: ../setedit/debug.cc:6442
+msgid "Not implemented for your platform, please help to implement it"
+msgstr ""
+
+#: ../setedit/debug.cc:6540
+#, fuzzy, c-format
+msgid " Data Window %s"
+msgstr "~F~enster"
+
+#: ../setedit/debug.cc:6874
+#, fuzzy, c-format
+msgid " Debugger Window [%s]"
+msgstr " Nachrichtenfenster (%d Zeilen)"
+
+#: ../setedit/debug.cc:6985
+#, fuzzy
+msgid "Send command to gdb"
+msgstr "auzufhrender Befehl"
+
+#. EN: C
+#: ../setedit/debug.cc:6988
+#, fuzzy
+msgid "~C~ommand, be careful!"
+msgstr "auzufhrender Befehl"
+
+#: ../setedit/debug.cc:7122
+#, fuzzy
+msgid "Debugger Window"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/debug.cc:7220
+msgid "Disconnected"
+msgstr ""
+
+#: ../setedit/debug.cc:7223
+msgid "Connected"
+msgstr ""
+
+#: ../setedit/debug.cc:7226
+#, fuzzy
+msgid "Ready to Run"
+msgstr "auzufhrender Befehl"
+
+#: ../setedit/debug.cc:7229
+#, fuzzy
+msgid "Running"
+msgstr "Fhre aus: %s"
+
+#: ../setedit/debug.cc:7232
+#, fuzzy
+msgid "Stopped"
+msgstr "Bereich"
+
+#: ../setedit/debug.cc:7237
+msgid "Not started"
+msgstr ""
+
+#: ../setedit/debug.cc:7333
+#, c-format
+msgid "Mode: %s (%s) [%s]"
+msgstr ""
+
+#: ../setedit/debug.cc:7339
+#, c-format
+msgid "Mode: Remote (%s) [%s]"
+msgstr ""
+
+#: ../setedit/debug.cc:7388
+#, c-format
+msgid "Reason stopped: %s"
+msgstr ""
+
+#: ../setedit/debug.cc:7392
+msgid "Returned immediatly"
+msgstr ""
+
+#: ../setedit/debug.cc:7538
+#, c-format
+msgid "%s: Not yet in debugger"
+msgstr ""
+
+#: ../setedit/debug.cc:7557
+msgid "Wait until the process is stopped to delete this watch"
+msgstr ""
+
+#: ../setedit/debug.cc:7579
+#, fuzzy
+msgid "Error deleting variable"
+msgstr "Fehler beim Erstellen von "
+
+#: ../setedit/debug.cc:7683
+#, fuzzy, c-format
+msgid " Watches Window (%d watches)"
+msgstr " Nachrichtenfenster (%d Zeilen)"
+
+#: ../setedit/debug.cc:7775
+msgid "Add to watch list"
+msgstr ""
+
+#: ../setedit/debug.cc:7809
+msgid "Change the expression to watch"
+msgstr ""
+
+#: ../setedit/debug.cc:7859
+#, fuzzy
+msgid "Watches"
+msgstr "Ersetzen"
+
+#: ../setedit/debug.cc:8056
+#, fuzzy
+msgid "Choose file"
+msgstr "Whlen Sie einen Knoten"
+
+#: ../setedit/debug.cc:8068
+#, fuzzy
+msgid "Browse"
+msgstr "S~c~hlieen"
+
+#: ../setedit/debug.cc:8109
+#, fuzzy
+msgid "Debug Options"
+msgstr "Einstellungen"
+
+#. All together
+#: ../setedit/debug.cc:8115
+msgid "~P~rogram to debug, with debug info"
+msgstr ""
+
+#: ../setedit/debug.cc:8117
+#, fuzzy
+msgid "~M~ode"
+msgstr "~B~ewegen"
+
+#: ../setedit/debug.cc:8118
+msgid "Local with ~e~xecutable"
+msgstr ""
+
+#: ../setedit/debug.cc:8119
+msgid "Local with r~u~nning process"
+msgstr ""
+
+#: ../setedit/debug.cc:8120
+msgid "Remote (g~d~bserver/stub)"
+msgstr ""
+
+#: ../setedit/debug.cc:8121
+#, fuzzy
+msgid "Local target options"
+msgstr "Lokale Einstellungen"
+
+#: ../setedit/debug.cc:8122
+msgid "Program ~a~rguments, not for remote mode"
+msgstr ""
+
+#: ../setedit/debug.cc:8124
+msgid "Forced ~t~erminal, leave blank for auto"
+msgstr ""
+
+#: ../setedit/debug.cc:8126
+#, fuzzy
+msgid "Remote target options"
+msgstr "Andere Optionen"
+
+#: ../setedit/debug.cc:8127
+#, fuzzy
+msgid "Remote p~r~otocol type"
+msgstr "Gehe zu ~P~rototyp"
+
+#: ../setedit/debug.cc:8129
+#, fuzzy
+msgid "Remote ~l~ocation"
+msgstr "Andere Optionen"
+
+#: ../setedit/debug.cc:8149
+msgid "Your program compiled with -g"
+msgstr ""
+
+#: ../setedit/debug.cc:8175
+#, fuzzy
+msgid "Advanced Debug Options"
+msgstr "Einstellungen"
+
+#. All together
+#: ../setedit/debug.cc:8181
+msgid "~G~DB executable"
+msgstr ""
+
+#: ../setedit/debug.cc:8182
+msgid "~X~ terminal executable"
+msgstr ""
+
+#: ../setedit/debug.cc:8183
+#, fuzzy
+msgid "~M~ain function"
+msgstr "~E~xtraeinstellungen"
+
+#: ../setedit/debug.cc:8186
+msgid "GDB ~T~ime out [s]"
+msgstr ""
+
+#: ../setedit/debug.cc:8187
+msgid "Max. ~l~ines in Debug window"
+msgstr ""
+
+#: ../setedit/debug.cc:8188
+#, fuzzy
+msgid "M~i~scellaneous"
+msgstr "Verschiedene Optionen"
+
+#: ../setedit/debug.cc:8189
+msgid "No gdb ~b~anner after connecting"
+msgstr ""
+
+#: ../setedit/debug.cc:8190
+msgid "Enable MI v2 ~f~eatures"
+msgstr ""
+
+#: ../setedit/debug.cc:8191
+msgid "No ~s~ymbols bug workaround"
+msgstr ""
+
+#: ../setedit/debug.cc:8192
+msgid "No source ~c~ode in disasm. window"
+msgstr ""
+
+#: ../setedit/debug.cc:8264
+#, fuzzy
+msgid "Messages"
+msgstr "Nachrichtenfenster"
+
+#. EN: ACDFLT
+#. ES: CDELRT
+#: ../setedit/debug.cc:8268
+msgid "~D~isplay messages related to"
+msgstr ""
+
+#: ../setedit/debug.cc:8269
+msgid "GDB ~c~onsole (CLI)"
+msgstr ""
+
+#: ../setedit/debug.cc:8270
+msgid "T~a~rget (not really implemented in gdb)"
+msgstr ""
+
+#: ../setedit/debug.cc:8271
+msgid "~L~og (gdb internal messages)"
+msgstr ""
+
+#: ../setedit/debug.cc:8272
+msgid "GDB/MI commands sent ~t~o gdb"
+msgstr ""
+
+#: ../setedit/debug.cc:8273
+msgid "GDB/MI responses ~f~rom gdb"
+msgstr ""
+
+#: ../setedit/debug.cc:8313
+msgid "Clean elements"
+msgstr ""
+
+#: ../setedit/debug.cc:8317
+msgid "Elements"
+msgstr ""
+
+#: ../setedit/debug.cc:8318
+#, fuzzy
+msgid "~B~reakpoints"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:8319
+#, fuzzy
+msgid "~W~atchpoints"
+msgstr "In Datei schreiben"
+
+#: ../setedit/debug.cc:8320
+#, fuzzy
+msgid "W~a~tches"
+msgstr "Ersetzen"
+
+#: ../setedit/debug.cc:8321
+#, fuzzy
+msgid "~I~nspectors"
+msgstr "In Sektion %s"
+
+#: ../setedit/debug.cc:8322
+#, fuzzy
+msgid "~D~ata windows"
+msgstr "~F~enster"
+
+#: ../setedit/debug.cc:8704
+#, fuzzy
+msgid "Hit a breakpoint"
+msgstr "~D~rucken"
+
+#: ../setedit/debug.cc:8705
+#, fuzzy
+msgid "Write watchpoint"
+msgstr "In Datei schreiben"
+
+#: ../setedit/debug.cc:8706
+msgid "Read watchpoint"
+msgstr ""
+
+#: ../setedit/debug.cc:8707
+msgid "Access watchpoint"
+msgstr ""
+
+#: ../setedit/debug.cc:8708
+msgid "Watchpoint out of scope"
+msgstr ""
+
+#: ../setedit/debug.cc:8709
+#, fuzzy
+msgid "Function finished"
+msgstr "Aktion"
+
+#: ../setedit/debug.cc:8710
+msgid "Location reached"
+msgstr ""
+
+#: ../setedit/debug.cc:8711
+msgid "End of stepping"
+msgstr ""
+
+#: ../setedit/debug.cc:8712
+msgid "Exited signalled"
+msgstr ""
+
+#: ../setedit/debug.cc:8713
+msgid "Exited with error"
+msgstr ""
+
+#: ../setedit/debug.cc:8714
+#, fuzzy
+msgid "Exited normally"
+msgstr " Normal"
+
+#: ../setedit/debug.cc:8715
+msgid "Signal received"
+msgstr ""
+
+#: ../setedit/debug.cc:8716
+msgid "Unknown (temp bkp?)"
+msgstr ""
+
+#: ../setedit/debug.cc:8717
+msgid "natural"
+msgstr ""
+
+#: ../setedit/debug.cc:8718
+#, fuzzy
+msgid "binary"
+msgstr "Januar"
+
+#: ../setedit/debug.cc:8719
+#, fuzzy
+msgid "decimal"
+msgstr " Dezimal: "
+
+#: ../setedit/debug.cc:8720
+msgid "hexadecimal"
+msgstr ""
+
+#: ../setedit/debug.cc:8721
+#, fuzzy
+msgid "octal"
+msgstr "Okt"
+
+#: ../setedit/debug.cc:8725
+msgid "Pipe creation"
+msgstr ""
+
+#: ../setedit/debug.cc:8726
+#, fuzzy
+msgid "Fork failed"
+msgstr "`Stat' hhat versagt!"
+
+#: ../setedit/debug.cc:8727
+msgid "GDB not running"
+msgstr ""
+
+#: ../setedit/debug.cc:8728
+#, fuzzy
+msgid "Parser failed"
+msgstr "Analysiere Datei"
+
+#: ../setedit/debug.cc:8729
+#, fuzzy
+msgid "Unknown asyn response"
+msgstr "Unbekannt"
+
+#: ../setedit/debug.cc:8730
+#, fuzzy
+msgid "Unknown result response"
+msgstr "Unbekannt"
+
+#: ../setedit/debug.cc:8731
+msgid "Error from gdb"
+msgstr ""
+
+#: ../setedit/debug.cc:8733
+msgid "Time out in gdb response"
+msgstr ""
+
+#: ../setedit/debug.cc:8734
+msgid "GDB suddenly died"
+msgstr ""
+
+#: ../setedit/debug.cc:8735
+msgid "Can't execute X terminal"
+msgstr ""
+
+#: ../setedit/debug.cc:8736
+#, fuzzy
+msgid "Failed to create temporal"
+msgstr "Konnte die Listendatei nicht ffnen"
+
+#: ../setedit/debug.cc:8737
+#, fuzzy
+msgid "Can't execute the debugger"
+msgstr "Kann Verzeichnis nicht erstellen:"
+
+#: ../setedit/dskascii.cc:39
+msgid " ASCII chart"
+msgstr " ASCII Tabelle"
+
+#: ../setedit/dskcalen.cc:43
+msgid " Calendar "
+msgstr " Kalender "
+
+#: ../setedit/dskclip.cc:67
+#, c-format
+msgid " Clipboard (%d bytes)"
+msgstr " Zwischenablage (%d bytes)"
+
+#: ../setedit/dskclose.cc:57
+msgid " Closed: "
+msgstr " Geschlossen: "
+
+#: ../setedit/dskhelp.cc:120
+#, fuzzy, c-format
+msgid " Main InfView (%s)%s"
+msgstr " Haupt-InfView "
+
+#: ../setedit/dskhelp.cc:123
+#, fuzzy, c-format
+msgid " InfView (%s)%s"
+msgstr " InfView "
+
+#: ../setedit/dskmessa.cc:86
+#, c-format
+msgid " Message Window (%d lines)"
+msgstr " Nachrichtenfenster (%d Zeilen)"
+
+#: ../setedit/dskman.cc:59
+#, fuzzy, c-format
+msgid " Man page: %s"
+msgstr " Man Seite: "
+
+#: ../setedit/dskmp3.cc:42
+msgid " MP3 Control panel"
+msgstr " MP3 Kontrollpult"
+
+#: ../setedit/dstfile.cc:876
+msgid "Wrong desktop file. May be owned by other user."
+msgstr ""
+
+#: ../setedit/dstfile.cc:882
+msgid "The desktop file is too old."
+msgstr "Die Desktopdatei ist zu alt."
+
+#: ../setedit/dstfile.cc:887
+msgid "You need a newer editor for this desktop file."
+msgstr "Sie bentigen einen neueren Editor fr diese Desktopdatei."
+
+#: ../setedit/edcolor.cc:180
+#, fuzzy
+msgid "Color Themes"
+msgstr "Farben"
+
+#: ../setedit/editdiag.cc:39
+#, fuzzy
+msgid " A friendly text editor."
+msgstr "Ein freundlicher Text-Editor."
+
+#: ../setedit/editdiag.cc:40
+#, c-format
+msgid "Version: %lX.%lX.%lX Revision: %d"
+msgstr ""
+
+#: ../setedit/editdiag.cc:41
+#, fuzzy, c-format
+msgid "That's SET's Editor \"%s\", (c) %s"
+msgstr "Das ist SET's Editor v%lX.%lX.%lX, (c) 1996-1999"
+
+#: ../setedit/editdiag.cc:42
+#, c-format
+msgid "Platform: %s Driver: %s"
+msgstr ""
+
+#: ../setedit/editdiag.cc:43
+#, fuzzy
+msgid " by Salvador Eduardo Tropea"
+msgstr "von Salvador Eduardo Tropea"
+
+#: ../setedit/editdiag.cc:69 ../setedit/editdiag.cc:124
+msgid "About"
+msgstr "ber"
+
+#: ../setedit/editdiag.cc:144
+#, fuzzy
+msgid "The FSF and GNU people for such good tools"
+msgstr "Die Leute von FSF und GNU fr solch groartige Tools"
+
+# About dialog
+#: ../setedit/editdiag.cc:145
+#, fuzzy
+msgid "DJ Delorie and collaborators for porting it to DOS"
+msgstr "DJ Delorie und Mitarbeiter, weil sie sie zu DOS geportet haben"
+
+#: ../setedit/editdiag.cc:146
+#, fuzzy
+msgid "Robert Hoehne for porting TVision and making RHIDE"
+msgstr "Robert Hhne fr das Porten von TV and fr RHIDE"
+
+#: ../setedit/editdiag.cc:147
+msgid "Vadim Belodorov for contributing the first port of TV to Win32"
+msgstr ""
+
+#: ../setedit/editdiag.cc:148
+msgid "Anatoli Soltan for porting to Win32 using BC++"
+msgstr ""
+
+#: ../setedit/editdiag.cc:149
+msgid "VA Linux and the people who maintain Source Forge"
+msgstr ""
+
+#: ../setedit/editdiag.cc:150
+msgid "The University of California, Berkeley and its contributors"
+msgstr "Die Universitt Kalifornien, Berkeley und deren Mitarbeiter"
+
+#: ../setedit/editdiag.cc:152
+msgid "The University of Cambridge for the PCRE package"
+msgstr "Der Unversitt Cambridge fr das PCRE Paket"
+
+#: ../setedit/editdiag.cc:155
+#, fuzzy
+msgid "Shawn Hargreaves for Allegro; used as the sound engine"
+msgstr "Shawn Hargreaves fr Allegro, als Sound-Engine benutzt"
+
+#: ../setedit/editdiag.cc:157
+#, fuzzy
+msgid ""
+"Tomislav Uzelac for AMP, MP3 engine and Ove Kaaven for adapting to Allegro"
+msgstr "Tomislav Uzelac fr AMP, the MP3-Engine"
+
+#: ../setedit/editdiag.cc:160
+msgid "Jean-loup Gailly and Mark Adler for the zlib"
+msgstr ""
+
+#: ../setedit/editdiag.cc:162
+msgid "Julian R. Seward for bzip2 routines included"
+msgstr ""
+
+#: ../setedit/editdiag.cc:164
+msgid "Bjorn Reese for a lot of ideas about the stack debugger of UNIX"
+msgstr ""
+
+#: ../setedit/editdiag.cc:165
+#, fuzzy
+msgid "All my friends that support my project (Laszlo, Marek, Ivan,"
+msgstr ""
+"Allen meinen Freunden, die diese Projekt untersttzen (Laszlo, Marek, Ivan, "
+"etc)"
+
+#: ../setedit/editdiag.cc:166
+msgid "Grzegorz, Andris, etc.)."
+msgstr ""
+
+#: ../setedit/editdiag.cc:172
+msgid "Thanks to:"
+msgstr "Danksagungen an:"
+
+#: ../setedit/editdiag.cc:178
+#, fuzzy
+msgid "Made in Argentina"
+msgstr "Hergstellt in Argentinien (bersetzt in Deutschland)"
+
+#: ../setedit/editmain.cc:135
+msgid "Do you want to delete all the .BKP, desktop and project files?"
+msgstr "Wollen Sie alle .bkp, Desktop- und Projektdateien lschen?"
+
+#: ../setedit/editmain.cc:462
+#, fuzzy
+msgid "No project loaded"
+msgstr "Falsche Projektdatei."
+
+#: ../setedit/editmain.cc:521
+#, fuzzy
+msgid "This file is already open, close it first."
+msgstr "Die Datei ist bereits geffnet. Schlieen Sie sie zuerst."
+
+#: ../setedit/editmain.cc:608
+#, fuzzy
+msgid "Open File"
+msgstr "~f~fne Info"
+
+#: ../setedit/editmain.cc:623
+msgid "You must select an editor window for this operation"
+msgstr "Sie mssen ein Editorfenster fr diese Operation angeben"
+
+#: ../setedit/editmain.cc:758
+msgid "Export file as"
+msgstr "Exportiere Datei als"
+
+#: ../setedit/editmain.cc:848
+#, fuzzy
+msgid "This window can't be printed. Select an editor window instead"
+msgstr "Diese Fenster kann nicht gedruckt werden, whlen Sie einen Editor"
+
+#: ../setedit/editmain.cc:1014
+msgid "Couldn't find any matching help"
+msgstr "Konnte keine passende Hilfe finden"
+
+#: ../setedit/editmain.cc:1197
+msgid "A background task is still running, exit anyway?"
+msgstr ""
+
+#: ../setedit/editmain.cc:1950
+msgid "This line no longer exists"
+msgstr "Die Zeile existiert nicht mehr"
+
+#: ../setedit/editmain.cc:2118
+#, fuzzy
+msgid "Error creating the difference, aborting"
+msgstr "Fehler beim Lesen der Dateiliste"
+
+#: ../setedit/editmain.cc:2194
+#, c-format
+msgid "The disk copy of %s is newer, reload it?"
+msgstr "Die Festplattenkopie von `%s' ist neuer. Neu laden?"
+
+#: ../setedit/editmain.cc:2468
+#, fuzzy
+msgid ""
+"I can't find the readme.1st file, please look for it in the .ZIP and read "
+"the file."
+msgstr ""
+"Ich kann die `readme.1st' Datei nicht finden. Suchen Sie in der .zip Datei "
+"danach und lesen Sie sie."
+
+#: ../setedit/editmain.cc:2603
+#, c-format
+msgid ""
+"\n"
+"Wrong installation! You must define the %s environment variable.\n"
+msgstr ""
+"\n"
+"Falsche Installation! Sie mssen die %s Umgebungsvariable definieren.\n"
+
+#: ../setedit/editmain.cc:2604
+#, fuzzy, c-format
+msgid ""
+"Read the readme.1st file included in the .zip distribution file.\n"
+"\n"
+msgstr ""
+"Lesen Sie zuerst die Datei `readme.1st', die in der .zip Datei enthalten "
+"ist.\n"
+
+#: ../setedit/editmain.cc:2608
+#, c-format
+msgid ""
+"I suggest that: SET %s=%s/%s\n"
+"\n"
+msgstr ""
+"Ich schlage vor: SET %s=%s/%s\n"
+"\n"
+
+#: ../setedit/editmain.cc:2610
+#, c-format
+msgid ""
+"I suggest that: SET %s=%s\n"
+"\n"
+msgstr ""
+"Ich schlage vor: SET %s=%s\n"
+"\n"
+
+#: ../setedit/editmain.cc:2615
+#, c-format
+msgid "press ENTER to continue\n"
+msgstr "Drcken Sie EINGABE, um fortzufahren\n"
+
+#: ../setedit/editmain.cc:2624
+msgid ""
+"\n"
+"You defined SET_FILES wrongly, it doesn't point to a directory.\n"
+"\n"
+msgstr ""
+"\n"
+"Sie haben SET_FILES falsch definiert; sie zeigt auf kein Verzeichnis.\n"
+"\n"
+
+#: ../setedit/editmain.cc:2653
+msgid "Memory is nearly full. Please exit, and restart."
+msgstr "Speicher ist fast voll. Bitte starten Sie SET' Editor neu."
+
+#: ../setedit/editmain.cc:2898
+msgid "Setedit "
+msgstr "Setedit "
+
+#: ../setedit/editmain.cc:2900
+msgid ". Copyright (c) "
+msgstr ""
+
+#: ../setedit/editmain.cc:2902
+#, fuzzy
+msgid ""
+" by Salvador E. Tropea\n"
+"\n"
+msgstr "von Salvador Eduardo Tropea"
+
+#: ../setedit/editmain.cc:2904
+msgid ""
+"setedit [options] [file_name ...]\n"
+"\n"
+msgstr ""
+"setedit [optionen] [datei_name ...]\n"
+"\n"
+
+#: ../setedit/editmain.cc:2906
+msgid ""
+"+[line number] jumps to the specified line. It only affects the "
+"next\n"
+" file in the list and should be specified after the\n"
+" options. If the line number is omitted you'll jump "
+"to\n"
+" the end of the text. Example: +6 file\n"
+msgstr ""
+
+#: ../setedit/editmain.cc:2910
+msgid "-c, --cascade: arranges the windows using cascade style.\n"
+msgstr "-c, --cascade: ordnet die Fenster berlappend an.\n"
+
+#: ../setedit/editmain.cc:2911
+msgid ""
+"-d, --stack-dbg=n: indicates which method will be used in the event of "
+"a\n"
+" crash. The default method is 0.\n"
+" 0: dump unsaved buffers and stack calls.\n"
+" 1: do nothing (conservative).\n"
+msgstr ""
+
+#: ../setedit/editmain.cc:2916
+msgid ""
+" 2: dump unsaved buffers and call debugger to get\n"
+" information. Then die.\n"
+" 3: like 2 but stay in the debugger.\n"
+msgstr ""
+
+#: ../setedit/editmain.cc:2920
+msgid ""
+"-f, --file-list file_n: loads the files listed in file_n, each line in "
+"this\n"
+" file must contain only one file name.\n"
+msgstr ""
+"-f, --file-list file_n: ldt die Dateien aus der Liste in file_n, in\n"
+" der pro Zeile NUR EINE Datei stehen darf.\n"
+
+#: ../setedit/editmain.cc:2922
+msgid ""
+"-h, --help: displays this text ;-).\n"
+"\n"
+msgstr ""
+"-h, --help: Zeigt diesen Text ;).\n"
+"\n"
+
+#: ../setedit/editmain.cc:2924
+msgid ""
+"-k, --use-rh-52-keys: enables the Red Hat 5.2 style keyboard mapping.\n"
+msgstr ""
+"-k, --use-rh-52-keys schaltet das Red Hat 5.2 Tastatur mapping ein\n"
+
+#: ../setedit/editmain.cc:2926
+msgid "-K, --keybind file_name: uses the specified name as keybinding file.\n"
+msgstr ""
+
+#: ../setedit/editmain.cc:2928
+msgid "-l, --force-no-lfn: avoids the use of long file names under W9x.\n"
+msgstr ""
+"-l, --force-no-lfn verhindert die Benutzung von langen Dateinamen\n"
+" unter Win9x\n"
+
+#: ../setedit/editmain.cc:2929
+msgid "-L, --force-lfn: forces the use of long file names under W9x.\n"
+msgstr "-L, --force-lfn: lange Dateinamen unter Win9x erzwingen.\n"
+
+#: ../setedit/editmain.cc:2930
+#, fuzzy
+msgid "-m, --no-mouse-hook: don't hook the mouse interrupt, poll it.\n"
+msgstr "-m, --no-mouse-hook: Schaltet Verwendung des Mausinterrupts aus.\n"
+
+#: ../setedit/editmain.cc:2933
+msgid "-M, --no-mixer: disable board level mixer.\n"
+msgstr ""
+
+#: ../setedit/editmain.cc:2935
+msgid ""
+"-p, --project file_name: loads the indicated project, if the file doesn't "
+"exist\n"
+" the editor creates a new one\n"
+msgstr ""
+"-p, --project <datei> ldt das angegebene Projekt. Erstellt ein neues,\n"
+" wenn die Datei nicht existiert.\n"
+
+#: ../setedit/editmain.cc:2937
+msgid ""
+"-r, --no-redirect: disables the stderr redirection. Only used during\n"
+" debugging.\n"
+msgstr ""
+"-r, --no-redirect: Schaltet stderr Umleitung aus. Wird nur whrend\n"
+" Debugging benutzt.\n"
+
+#: ../setedit/editmain.cc:2940
+msgid ""
+"-S, --low-vga-save: use low level functions to save/restore VGA state.\n"
+msgstr ""
+"-S, --low-vga-save: einfache Funktionen (low-level) zum Sichern/Laden\n"
+" der VGA Karte verwenden.\n"
+
+#: ../setedit/editmain.cc:2942
+#, fuzzy
+msgid "-t, --tile-vert: the windows are arranged vertically.\n"
+msgstr "-t, --tile-vert: ordnet die Fenster vertikal geteilt an.\n"
+
+#: ../setedit/editmain.cc:2943
+#, fuzzy
+msgid "-T, --tile-horiz: the windows are arranged horizontally.\n"
+msgstr "-T, --tile-horiz: ordnet die Fenster horizontal geteilt an.\n"
+
+#. E: ACHNOSUX
+#: ../setedit/editmenu.cc:62 ../setedit/editmenu.cc:138
+msgid "~O~pen..."
+msgstr "~f~fnen..."
+
+#: ../setedit/editmenu.cc:65
+msgid "S~a~ve as..."
+msgstr "Speichern ~a~ls..."
+
+#: ../setedit/editmenu.cc:66
+msgid "Save as ~U~NIX..."
+msgstr "Als UNI~X~ speichern..."
+
+#: ../setedit/editmenu.cc:68
+msgid "~C~hange dir..."
+msgstr "~W~echsle Verzeichnis..."
+
+#: ../setedit/editmenu.cc:71
+msgid "~Q~uit"
+msgstr "~V~erlassen"
+
+#: ../setedit/editmenu.cc:74
+msgid "~U~ndo"
+msgstr "~R~ckgngig"
+
+#: ../setedit/editmenu.cc:75
+msgid "~R~edo"
+msgstr "~W~iederherstellen"
+
+#: ../setedit/editmenu.cc:77 ../setedit/editmenu.cc:110
+msgid "Cu~t~"
+msgstr "~A~usschneiden"
+
+#: ../setedit/editmenu.cc:80
+msgid "~S~how clipboard"
+msgstr "~Z~wischenablage anzeigen"
+
+#: ../setedit/editmenu.cc:82
+msgid "~C~lear"
+msgstr "~L~sche"
+
+#: ../setedit/editmenu.cc:84
+msgid "S~e~t Local"
+msgstr "Lokal s~e~tzen"
+
+#: ../setedit/editmenu.cc:85
+msgid "Set ~G~lobal"
+msgstr "~G~lobal setzen"
+
+#: ../setedit/editmenu.cc:87
+msgid "E~x~pand all tabs"
+msgstr "Tabs e~x~pandieren"
+
+#: ../setedit/editmenu.cc:88
+msgid "C~o~mpact text"
+msgstr "~L~eerzeichen zu Tabs"
+
+#: ../setedit/editmenu.cc:90
+msgid "~J~ump to function"
+msgstr "~G~ehe zu Funktion"
+
+#: ../setedit/editmenu.cc:91
+msgid "~P~rofile Editor"
+msgstr "Editor ~t~esten"
+
+#: ../setedit/editmenu.cc:94
+msgid "~F~ind..."
+msgstr "~S~uche..."
+
+#: ../setedit/editmenu.cc:95
+msgid "~R~eplace..."
+msgstr "~E~rsetzen..."
+
+#: ../setedit/editmenu.cc:96
+msgid "~S~earch again"
+msgstr "~W~iederhole Suche"
+
+#: ../setedit/editmenu.cc:98 ../settvuti/tdiagaid.cc:216
+msgid "~M~acro"
+msgstr "~M~akro"
+
+#: ../setedit/editmenu.cc:99
+msgid "~R~ecord"
+msgstr "Auf~n~ehmen"
+
+#: ../setedit/editmenu.cc:100
+msgid "~S~top"
+msgstr "~S~top"
+
+#: ../setedit/editmenu.cc:101
+msgid "~P~lay"
+msgstr "Ab~s~pielen"
+
+#: ../setedit/editmenu.cc:103
+msgid "Re~c~tangle"
+msgstr "Re~c~hteck"
+
+#: ../setedit/editmenu.cc:104
+msgid "~S~tart"
+msgstr "~A~nfang"
+
+#: ../setedit/editmenu.cc:105
+msgid "~E~nd"
+msgstr "~E~nde"
+
+#: ../setedit/editmenu.cc:106
+msgid "~H~ide"
+msgstr "~V~erstecke"
+
+#: ../setedit/editmenu.cc:111
+msgid "C~l~ear"
+msgstr "~L~schen"
+
+#: ../setedit/editmenu.cc:112
+msgid "~M~ove"
+msgstr "~B~ewegen"
+
+#: ../setedit/editmenu.cc:122
+msgid "~L~ist"
+msgstr "~L~iste"
+
+#: ../setedit/editmenu.cc:123
+msgid "~U~ser Screen"
+msgstr "Ben~u~tzerbildschirm"
+
+#: ../setedit/editmenu.cc:125 ../setedit/edprefs.cc:361
+msgid "~H~elp"
+msgstr "~H~ilfe"
+
+#: ../setedit/editmenu.cc:126
+msgid "~I~NF View"
+msgstr "~I~NF Betrachter"
+
+#: ../setedit/editmenu.cc:127
+msgid "~A~nother InfView"
+msgstr "~A~nderes InfView"
+
+#: ../setedit/editmenu.cc:129 ../setedit/editmenu.cc:423
+msgid "~V~arious"
+msgstr "Va~r~iabel"
+
+#: ../setedit/editmenu.cc:130
+msgid "~C~alculator"
+msgstr "~R~echner"
+
+#: ../setedit/editmenu.cc:131
+msgid "~S~DG"
+msgstr "~S~DG"
+
+#: ../setedit/editmenu.cc:132
+msgid "SDG ~O~ptions"
+msgstr "SDP ~O~ptionen"
+
+#: ../setedit/editmenu.cc:133
+msgid "Copy to ~W~indows Clip."
+msgstr "Kopiere in ~W~in Zwischenablage"
+
+#: ../setedit/editmenu.cc:134
+msgid "Paste ~f~rom Wind. Clip."
+msgstr "Fge von Windows Zwischenablage ein"
+
+#: ../setedit/editmenu.cc:135
+msgid "Co~l~ors"
+msgstr "~F~arben"
+
+#: ../setedit/editmenu.cc:137
+msgid "~P~roject"
+msgstr "~P~rojekt"
+
+#: ../setedit/editmenu.cc:161
+msgid "~F2~ Save"
+msgstr "~F2~ Speichern"
+
+#: ../setedit/editmenu.cc:162
+msgid "~F3~ Open"
+msgstr "~F3~ ffnen"
+
+#: ../setedit/editmenu.cc:163
+msgid "~Alt+F3~ Close"
+msgstr "~Alt+F3~ Weg"
+
+#: ../setedit/editmenu.cc:175
+msgid "~^H~ Help"
+msgstr "~^H~ Hilfe"
+
+#: ../setedit/editmenu.cc:176
+msgid "~ESC~ Close"
+msgstr "~ESC~ Schlieen"
+
+#: ../setedit/editmenu.cc:177
+msgid "~Alt+I~ Include"
+msgstr "~Alt+I~ Include"
+
+#: ../setedit/editmenu.cc:178
+msgid "~Alt+B~ Bookmark"
+msgstr "~Alt+B~ Lesezeichen"
+
+#: ../setedit/editmenu.cc:181
+msgid "~Del~ Close"
+msgstr "~Del~ Schlieen"
+
+#: ../setedit/editmenu.cc:182
+msgid "~Ins~ Open"
+msgstr "~Einf~ ffnen"
+
+#: ../setedit/editmenu.cc:184
+msgid "~Ctrl+Del~ Delete File"
+msgstr "~Ctrl+Del~ Datei lschen"
+
+#: ../setedit/editmenu.cc:186
+msgid "~Ins~ Insert"
+msgstr "~Einf~ Einfgen"
+
+#: ../setedit/editmenu.cc:187
+msgid "~Del~ Delete"
+msgstr "~Del~ Lschen"
+
+#: ../setedit/editmenu.cc:191
+#, fuzzy
+msgid "~Alt+F7~ Previous"
+msgstr "~V~orherige"
+
+#: ../setedit/editmenu.cc:192
+#, fuzzy
+msgid "~Alt+F8~ Next"
+msgstr "~F6~ Nchstes"
+
+#: ../setedit/editmenu.cc:193
+#, fuzzy
+msgid "~Ctrl+C~ Stop"
+msgstr "~Strg+Einf~ Kopie"
+
+#: ../setedit/editmenu.cc:194
+#, fuzzy
+msgid "Save"
+msgstr "~S~peichern"
+
+#: ../setedit/editmenu.cc:195 ../setedit/editmenu.cc:200
+msgid "~Ctrl+Ins~ Copy"
+msgstr "~Strg+Einf~ Kopie"
+
+#: ../setedit/editmenu.cc:199
+msgid "~ENTER~ Evaluate"
+msgstr "~ENTER~ Auswerten"
+
+#: ../setedit/editmenu.cc:201
+msgid "~Shift+Ins~ Paste"
+msgstr "~Umsch+Einf~ Einfgen"
+
+#. The following are here just for internationalization purposes
+#: ../setedit/editmenu.cc:218
+msgid "Open Read-only ~c~opy"
+msgstr "Nur-Lesen-Kopie ffnen"
+
+#: ../setedit/editmenu.cc:219
+#, fuzzy
+msgid "Save w/ same ~t~ime..."
+msgstr "Mit gleicher Zei~t~ schreiben..."
+
+#: ../setedit/editmenu.cc:220
+msgid "Save a~l~l"
+msgstr ""
+
+#: ../setedit/editmenu.cc:221
+msgid "~P~rint"
+msgstr "~D~rucken"
+
+#: ../setedit/editmenu.cc:222
+msgid "Pr~i~nt Setup..."
+msgstr "Drucke~i~nstellungen..."
+
+#: ../setedit/editmenu.cc:223
+msgid "S~e~t Local options"
+msgstr "Lokale ~E~instellungen"
+
+#: ../setedit/editmenu.cc:224
+msgid "Set ~G~lobal options"
+msgstr "~G~lobale Einstellungen setzen"
+
+#: ../setedit/editmenu.cc:225
+msgid "Pus~h~ cursor position"
+msgstr "Cursorposition speichern"
+
+#: ../setedit/editmenu.cc:226
+msgid "Pop cursor pos~i~tion"
+msgstr "Cursorpos~i~tion laden"
+
+#: ../setedit/editmenu.cc:227
+msgid "C~a~se (upper/lower)"
+msgstr "~G~ro/Kleinschreibung"
+
+#: ../setedit/editmenu.cc:228
+msgid "Block to ~u~pper"
+msgstr "Block ~g~roschreiben"
+
+#: ../setedit/editmenu.cc:229
+msgid "Block to ~l~ower"
+msgstr "Block ~k~leinschreiben"
+
+#: ../setedit/editmenu.cc:230
+msgid "~C~haracter toggle"
+msgstr "~Z~eichenwechsel"
+
+#: ../setedit/editmenu.cc:231
+#, fuzzy
+msgid "Block ~i~nvert"
+msgstr "Block ~g~roschreiben"
+
+#: ../setedit/editmenu.cc:232
+#, fuzzy
+msgid "Block ~a~lternate"
+msgstr "Block ~g~roschreiben"
+
+#: ../setedit/editmenu.cc:233
+msgid "~G~o to line"
+msgstr "~G~ehe zu Zeile"
+
+#: ../setedit/editmenu.cc:234
+msgid "Jump to ~p~rototype"
+msgstr "Gehe zu ~P~rototyp"
+
+#: ../setedit/editmenu.cc:235
+#, fuzzy
+msgid "~N~ame current function"
+msgstr "~G~ehe zu Funktion"
+
+#: ../setedit/editmenu.cc:236
+#, fuzzy
+msgid "~C~hoose..."
+msgstr "~A~uswahl..."
+
+#: ../setedit/editmenu.cc:237
+msgid "R~e~peat"
+msgstr "Wiederholen"
+
+#: ../setedit/editmenu.cc:238
+msgid "~G~enerate Code"
+msgstr "Erzeuge ~C~ode"
+
+#: ../setedit/editmenu.cc:239
+#, fuzzy
+msgid "Ru~n~ selected code"
+msgstr "Ausge~w~hlter Text"
+
+#: ../setedit/editmenu.cc:240
+#, fuzzy
+msgid "Enter c~o~de to run"
+msgstr "Fehler im sLisp bersetzer:"
+
+#: ../setedit/editmenu.cc:241
+#, fuzzy
+msgid "Pse~u~do macros..."
+msgstr "Pse~u~do Macros ..."
+
+#: ../setedit/editmenu.cc:242
+msgid "To ~u~pper"
+msgstr "in ~G~robuchstaben"
+
+#: ../setedit/editmenu.cc:243
+msgid "To l~o~wer"
+msgstr "in ~K~leinbuchstaben"
+
+#: ../setedit/editmenu.cc:244
+msgid "Poc~k~et calculator"
+msgstr "~T~aschenrechner"
+
+#: ../setedit/editmenu.cc:245
+msgid "~R~un program"
+msgstr "Programm ~a~usfhren"
+
+#: ../setedit/editmenu.cc:246
+msgid "~A~SCII Chart"
+msgstr "~A~SCII Tabelle"
+
+#: ../setedit/editmenu.cc:247
+msgid "Ca~l~endar"
+msgstr "Ka~l~ender"
+
+#: ../setedit/editmenu.cc:248
+#, fuzzy
+msgid "MP~3~ songs"
+msgstr "~M~P3 Lieder"
+
+#: ../setedit/editmenu.cc:249
+msgid "~S~elect a song"
+msgstr "Whle einen ~S~ong aus"
+
+#: ../setedit/editmenu.cc:250
+msgid "~P~lay selected"
+msgstr "gewhltes a~b~spielen"
+
+#: ../setedit/editmenu.cc:251
+msgid "S~t~op selected"
+msgstr "Anhal~t~en"
+
+#: ../setedit/editmenu.cc:252
+msgid "~C~onvert to WAV"
+msgstr "in ~W~AV umwandeln"
+
+#: ../setedit/editmenu.cc:253
+msgid "~E~dit/Create list"
+msgstr "~B~earbeite/Erstelle Liste"
+
+#: ../setedit/editmenu.cc:254
+msgid "P~l~ay list"
+msgstr "Spiel~l~iste"
+
+#: ../setedit/editmenu.cc:255
+msgid "St~o~p list"
+msgstr "Liste st~o~ppen"
+
+#: ../setedit/editmenu.cc:256
+msgid "~H~TML Accents"
+msgstr "~H~TML Akzente"
+
+#: ../setedit/editmenu.cc:257
+msgid "Convert ~a~ccents to tags"
+msgstr "Wandle ~A~kzente in Markierungen um"
+
+#: ../setedit/editmenu.cc:258
+msgid "Convert ~t~ags to accents"
+msgstr "Wandle ~M~arkierungen in Akzente um"
+
+#: ../setedit/editmenu.cc:259
+#, fuzzy
+msgid "E~x~port as HTML..."
+msgstr "E~x~port als HTML..."
+
+#: ../setedit/editmenu.cc:260
+#, fuzzy
+msgid "Re~m~ap code page..."
+msgstr "Code~p~age ndern..."
+
+#: ../setedit/editmenu.cc:261
+msgid "~B~lock quoted printable decode"
+msgstr "~D~ekodiere `quoted printable' Auswahl"
+
+#: ../setedit/editmenu.cc:262
+msgid "Un/~I~ndent block"
+msgstr "Block~e~inschub"
+
+#: ../setedit/editmenu.cc:263
+msgid "Indent ~o~ne space"
+msgstr "Schiebe ein Leerzeichen ein"
+
+#: ../setedit/editmenu.cc:264
+msgid "Unindent o~n~e character"
+msgstr "Ein Zeiche~n~ zurckschieben"
+
+#: ../setedit/editmenu.cc:265
+msgid "Indent one ~t~ab/gap"
+msgstr "Schiebe ein ~T~ab/Lcke ein"
+
+#: ../setedit/editmenu.cc:266
+msgid "~U~nindent one tab/gap"
+msgstr "~E~inschub um ein Tab verkleinern"
+
+#: ../setedit/editmenu.cc:267
+#, fuzzy
+msgid "~C~omment indent"
+msgstr "~A~utoeinschub"
+
+#: ../setedit/editmenu.cc:268
+msgid "Comment unin~d~ent"
+msgstr ""
+
+#: ../setedit/editmenu.cc:269
+msgid "~A~rbitrary indent"
+msgstr "~E~igener Einschub"
+
+#: ../setedit/editmenu.cc:270
+msgid "Paste ~E~macs mode"
+msgstr "Fge im ~E~macs Modus ein"
+
+#: ../setedit/editmenu.cc:271
+msgid "Test of macro from menu"
+msgstr "Test des Makros des Mens"
+
+#: ../setedit/editmenu.cc:272
+msgid "~D~elete memorized backups"
+msgstr "Gemerkte Backu~p~s lschen"
+
+#: ../setedit/editmenu.cc:273
+msgid "Redra~w~ screen"
+msgstr "Bildschirm ne~u~zeichnen"
+
+#: ../setedit/editmenu.cc:274
+#, fuzzy
+msgid "~C~olors"
+msgstr "Farben"
+
+#: ../setedit/editmenu.cc:275
+#, fuzzy
+msgid "~C~ustomize..."
+msgstr "~A~uswahl..."
+
+#: ../setedit/editmenu.cc:276
+#, fuzzy
+msgid "~P~alette..."
+msgstr "Farb~p~alette..."
+
+#: ../setedit/editmenu.cc:277
+#, fuzzy
+msgid "~T~heme..."
+msgstr "~A~uswahl..."
+
+#: ../setedit/editmenu.cc:278
+#, fuzzy
+msgid "~L~ocal edition..."
+msgstr "~L~okale Bearbeitung..."
+
+#: ../setedit/editmenu.cc:279
+#, fuzzy
+msgid "Glo~b~al edition..."
+msgstr "Globale ~B~earbeitung..."
+
+#: ../setedit/editmenu.cc:280
+#, fuzzy
+msgid "Editor ~G~eneral..."
+msgstr "Editor ~g~enerell..."
+
+#: ../setedit/editmenu.cc:281
+#, fuzzy
+msgid "Scr~e~en saver..."
+msgstr "Bildschirm~s~choner..."
+
+#: ../setedit/editmenu.cc:282
+#, fuzzy
+msgid "S~D~G Options..."
+msgstr "S~D~G Optionen..."
+
+#: ../setedit/editmenu.cc:283
+#, fuzzy
+msgid "~R~un program (which one)..."
+msgstr "Programm ~a~usfhren (welches)..."
+
+#: ../setedit/editmenu.cc:284
+msgid "~K~eyboard"
+msgstr "~T~astatur"
+
+#: ../setedit/editmenu.cc:285
+msgid "~K~ey assignment"
+msgstr "~T~astenzuweisung"
+
+#: ../setedit/editmenu.cc:286
+msgid "~S~etup Alt keys"
+msgstr "~K~onfiguriere Alt-Tasten"
+
+#: ../setedit/editmenu.cc:287
+msgid "Key ~p~ad behavior"
+msgstr "Key~P~ad Verhalten"
+
+#: ../setedit/editmenu.cc:288
+msgid "~B~ack to defaults"
+msgstr "~Z~urck zu Standard"
+
+#: ../setedit/editmenu.cc:289
+msgid "Consult ~s~can codes"
+msgstr "~S~can codes ansehen"
+
+#: ../setedit/editmenu.cc:290
+#, fuzzy
+msgid "~S~creen Options..."
+msgstr "Bilschirm~o~ptionen..."
+
+#: ../setedit/editmenu.cc:291
+msgid "Encod~i~ngs..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:292
+#, fuzzy
+msgid "Fon~t~s..."
+msgstr "~A~uswahl..."
+
+#: ../setedit/editmenu.cc:293
+#, fuzzy
+msgid "~U~ser words..."
+msgstr "Ben~u~tzerwrter..."
+
+#: ../setedit/editmenu.cc:294
+#, fuzzy
+msgid "De~f~ault global edition..."
+msgstr "Standard ~g~lobale Bearbeitung..."
+
+#: ../setedit/editmenu.cc:295
+#, fuzzy
+msgid "~O~pen file dialog..."
+msgstr "`Datei ffnen' Dial~o~g..."
+
+#: ../setedit/editmenu.cc:296
+#, fuzzy
+msgid "Do~n~'t create backups for..."
+msgstr "~K~eine Desktopdateien erstellen"
+
+#: ../setedit/editmenu.cc:297
+msgid "~T~ip of the day"
+msgstr "~T~agestip"
+
+#: ../setedit/editmenu.cc:298
+msgid "~S~yntax help"
+msgstr "~S~yntaxhilfe"
+
+#: ../setedit/editmenu.cc:299
+msgid "~F~iles to search"
+msgstr "Zu durchsuchende Dateien"
+
+#: ../setedit/editmenu.cc:300
+msgid "~M~an page View"
+msgstr "~M~an-Seiten Ansicht"
+
+#: ../setedit/editmenu.cc:301
+msgid "A~b~out"
+msgstr "~b~er"
+
+#: ../setedit/editmenu.cc:302
+msgid "Searc~h~ files under cursor in..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:303
+#, fuzzy
+msgid "Insert key ~n~ame"
+msgstr "Falsche Schlsselname."
+
+#: ../setedit/editmenu.cc:304
+msgid "Sc~r~oll Up"
+msgstr ""
+
+#: ../setedit/editmenu.cc:305
+msgid "Scroll ~D~own"
+msgstr ""
+
+#: ../setedit/editmenu.cc:306
+#, fuzzy
+msgid "Cop~y~ to file Clipboard"
+msgstr "~Z~wischenablage anzeigen"
+
+#: ../setedit/editmenu.cc:307
+#, fuzzy
+msgid "Paste ~f~rom file Clipboard"
+msgstr "Fge von Windows Zwischenablage ein"
+
+#: ../setedit/editmenu.cc:308
+#, fuzzy
+msgid "Copy to OS Clipboar~d~"
+msgstr "~Z~wischenablage anzeigen"
+
+#: ../setedit/editmenu.cc:309
+#, fuzzy
+msgid "Paste from OS Clip~b~oard"
+msgstr "Fge von Windows Zwischenablage ein"
+
+#: ../setedit/editmenu.cc:310
+#, fuzzy
+msgid "Save ~d~esktop here"
+msgstr "Desktopdateien versteckt sc~h~reiben"
+
+#: ../setedit/editmenu.cc:311
+#, fuzzy
+msgid "Sa~v~e as DOS..."
+msgstr "Speichern ~a~ls..."
+
+#: ../setedit/editmenu.cc:313
+#, fuzzy
+msgid "T~a~g files"
+msgstr "Speicher Datei als"
+
+#: ../setedit/editmenu.cc:314
+#, fuzzy
+msgid "~L~ist of tag files..."
+msgstr "Dateiliste"
+
+#: ../setedit/editmenu.cc:315
+#, fuzzy
+msgid "~O~ptions..."
+msgstr "~O~ptionen"
+
+#: ../setedit/editmenu.cc:316
+msgid "Jump ~t~o symbol"
+msgstr ""
+
+#: ../setedit/editmenu.cc:317
+#, fuzzy
+msgid "~C~lass browser"
+msgstr "S~c~hlieen"
+
+#: ../setedit/editmenu.cc:318
+#, fuzzy
+msgid "~W~ord completion"
+msgstr "~E~xtraeinstellungen"
+
+#: ../setedit/editmenu.cc:319
+#, fuzzy
+msgid "E~x~port project"
+msgstr "~P~rojekt"
+
+#: ../setedit/editmenu.cc:320
+msgid "~I~mport project items"
+msgstr ""
+
+#: ../setedit/editmenu.cc:321
+#, fuzzy
+msgid "Save As"
+msgstr "Speicher Datei als"
+
+#: ../setedit/editmenu.cc:322
+msgid "Calendar (holida~y~s)..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:323
+msgid "Checking for ~m~odified files..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:324
+#, fuzzy
+msgid "Advice dialogs..."
+msgstr "Hinweis"
+
+#: ../setedit/editmenu.cc:325
+#, fuzzy
+msgid "Jump to ~l~ast cursor position"
+msgstr "Cursorposition speichern"
+
+#: ../setedit/editmenu.cc:326
+#, fuzzy
+msgid "Jump to last ~u~ndo position"
+msgstr "Gehe zu Funktion"
+
+#: ../setedit/editmenu.cc:327
+msgid "Insert ~n~ew line (don't move)"
+msgstr ""
+
+#: ../setedit/editmenu.cc:328
+#, fuzzy
+msgid "Pro~j~ect Window"
+msgstr "Projektfenster"
+
+#: ../setedit/editmenu.cc:329
+#, fuzzy
+msgid "~M~essage Window"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/editmenu.cc:330
+#, fuzzy
+msgid "~E~dition Windows"
+msgstr "~F~enster"
+
+#: ../setedit/editmenu.cc:331
+#, fuzzy
+msgid "Window ~2~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:332
+#, fuzzy
+msgid "Window ~3~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:333
+#, fuzzy
+msgid "Window ~4~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:334
+#, fuzzy
+msgid "Window ~5~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:335
+#, fuzzy
+msgid "Window ~6~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:336
+#, fuzzy
+msgid "Window ~7~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:337
+#, fuzzy
+msgid "Window ~8~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:338
+#, fuzzy
+msgid "Window ~9~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:339
+#, fuzzy
+msgid "Window 10"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:340
+#, fuzzy
+msgid "Window 11"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:341
+#, fuzzy
+msgid "Window 12"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:342
+#, fuzzy
+msgid "Window 13"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:343
+#, fuzzy
+msgid "Window 14"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:344
+#, fuzzy
+msgid "Window 15"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:345
+#, fuzzy
+msgid "Window 16"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:346
+#, fuzzy
+msgid "Window 17"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:347
+#, fuzzy
+msgid "Window 18"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:348
+#, fuzzy
+msgid "Window 19"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:349
+#, fuzzy
+msgid "Pus~h~ cursor position and window"
+msgstr "Cursorposition speichern"
+
+#: ../setedit/editmenu.cc:350
+#, fuzzy
+msgid "P~o~p cursor position and window (tag ret)"
+msgstr "Cursorpos~i~tion laden"
+
+#: ../setedit/editmenu.cc:351
+#, fuzzy
+msgid "Debu~g~ger Window"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/editmenu.cc:352
+#, fuzzy
+msgid "~W~atches Window"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/editmenu.cc:353
+#, fuzzy
+msgid "~D~ebug"
+msgstr "~O~riginal"
+
+#: ../setedit/editmenu.cc:355
+#, fuzzy
+msgid "~P~rogram and mode..."
+msgstr "~V~orherige"
+
+#: ../setedit/editmenu.cc:356
+msgid "Path for ~s~ources..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:357
+#, fuzzy
+msgid "~M~essages displayed..."
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/editmenu.cc:358
+#, fuzzy
+msgid "~A~dvanced..."
+msgstr "~W~echsle Verzeichnis..."
+
+#: ../setedit/editmenu.cc:359
+msgid "Go to 'Connected' ~1~"
+msgstr ""
+
+#: ../setedit/editmenu.cc:360
+msgid "Go to 'Ready to run' ~2~"
+msgstr ""
+
+#: ../setedit/editmenu.cc:361
+#, fuzzy
+msgid "~B~reakpoint"
+msgstr "~D~rucken"
+
+#: ../setedit/editmenu.cc:362
+msgid "~R~un/Continue/Atach"
+msgstr ""
+
+#: ../setedit/editmenu.cc:363
+#, fuzzy
+msgid "~S~tep over"
+msgstr "~b~erschreiben"
+
+#: ../setedit/editmenu.cc:364
+#, fuzzy
+msgid "~T~race into"
+msgstr "~D~rucken"
+
+#: ../setedit/editmenu.cc:365
+#, fuzzy
+msgid "~G~o to cursor"
+msgstr "~Z~eilencursor"
+
+#: ../setedit/editmenu.cc:366
+msgid "~U~ntil return"
+msgstr ""
+
+#: ../setedit/editmenu.cc:367
+msgid "Return ~n~ow"
+msgstr ""
+
+#: ../setedit/editmenu.cc:368
+#, fuzzy
+msgid "Sto~p~"
+msgstr "~S~top"
+
+#: ../setedit/editmenu.cc:369
+msgid "Restart (~K~ill)"
+msgstr ""
+
+#: ../setedit/editmenu.cc:370
+#, fuzzy
+msgid "~E~valuate/Modify..."
+msgstr "~ENTER~ Auswerten"
+
+# End of header
+#: ../setedit/editmenu.cc:371
+#, fuzzy
+msgid "~W~atch an expression"
+msgstr "~A~usdruck"
+
+#: ../setedit/editmenu.cc:372
+msgid "~C~alling stack"
+msgstr ""
+
+#: ../setedit/editmenu.cc:373
+#, fuzzy
+msgid "~D~ebug session"
+msgstr "Einstellungen"
+
+#: ../setedit/editmenu.cc:374
+#, fuzzy
+msgid "De~t~ach"
+msgstr "~S~uche"
+
+#: ../setedit/editmenu.cc:375
+#, fuzzy
+msgid "C~l~ose"
+msgstr "S~c~hlieen"
+
+#: ../setedit/editmenu.cc:376
+msgid "~D~estroy (DANGER!)"
+msgstr ""
+
+#: ../setedit/editmenu.cc:377
+msgid "~E/+~ Expand"
+msgstr ""
+
+#: ../setedit/editmenu.cc:378
+#, fuzzy
+msgid "~C/-~ Collapse"
+msgstr "~ESC~ Schlieen"
+
+#: ../setedit/editmenu.cc:379
+#, fuzzy
+msgid "~+~ Enable"
+msgstr "~E~inschalten"
+
+#: ../setedit/editmenu.cc:380
+#, fuzzy
+msgid "~-~ Disable"
+msgstr "~A~usschalten"
+
+#: ../setedit/editmenu.cc:381
+#, fuzzy
+msgid "~Ins~ Send command"
+msgstr "auzufhrender Befehl"
+
+#: ../setedit/editmenu.cc:382
+msgid "~Ctrl+A/+~ Add w/scope"
+msgstr ""
+
+#: ../setedit/editmenu.cc:383
+#, fuzzy
+msgid "~R~egenerate central file"
+msgstr "Falsche Desktopdatei."
+
+#: ../setedit/editmenu.cc:384
+#, fuzzy
+msgid "Ed~i~t breakpoints..."
+msgstr "~D~rucken"
+
+#: ../setedit/editmenu.cc:385
+#, fuzzy
+msgid "Edit watchpoints... ~3~"
+msgstr "In Datei schreiben"
+
+#: ../setedit/editmenu.cc:386
+#, fuzzy
+msgid "Se~l~ect thread..."
+msgstr "~L~sche"
+
+#: ../setedit/editmenu.cc:387
+#, fuzzy
+msgid "Disasse~m~bler Window..."
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/editmenu.cc:388
+#, fuzzy
+msgid "~N~ormal watch..."
+msgstr "~n~ormaler Text"
+
+#: ../setedit/editmenu.cc:389
+#, fuzzy
+msgid "~W~ith scope..."
+msgstr "~G~anzer Bereich"
+
+#: ../setedit/editmenu.cc:390
+msgid "~U~sing the Inspector..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:391
+#, fuzzy
+msgid "~D~ata window..."
+msgstr "~F~enster"
+
+#: ../setedit/editmenu.cc:392
+#, fuzzy
+msgid "~S~tack window"
+msgstr "~F~enster"
+
+#: ../setedit/editmenu.cc:393
+msgid "Clear deb~u~g elements..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:394
+#, fuzzy
+msgid "~R~ead block..."
+msgstr "Re~c~hteck"
+
+#: ../setedit/editmenu.cc:395
+#, fuzzy
+msgid "~W~rite block..."
+msgstr "~B~estndige Blcke"
+
+#: ../setedit/editmenu.cc:397
+#, fuzzy
+msgid "~D~own"
+msgstr "~S~top"
+
+#: ../setedit/editmenu.cc:398
+#, fuzzy
+msgid "~R~ight"
+msgstr "~R~echte Alt"
+
+#: ../setedit/editmenu.cc:399
+#, fuzzy
+msgid "~L~eft"
+msgstr "~L~inke Alt"
+
+#: ../setedit/editmenu.cc:400
+msgid "Page d~o~wn"
+msgstr ""
+
+#: ../setedit/editmenu.cc:401
+msgid "Page u~p~"
+msgstr ""
+
+#: ../setedit/editmenu.cc:402
+msgid "Fir~s~t column"
+msgstr ""
+
+#: ../setedit/editmenu.cc:403
+#, fuzzy
+msgid "L~a~st column"
+msgstr "Spa~l~tenumbruch"
+
+#: ../setedit/editmenu.cc:404
+msgid "First ro~w~"
+msgstr ""
+
+#: ../setedit/editmenu.cc:405
+msgid "Las~t~ row"
+msgstr ""
+
+#: ../setedit/editmenu.cc:406
+msgid "First addr. ~i~ncrement"
+msgstr ""
+
+#: ../setedit/editmenu.cc:407
+msgid "~F~irst addr. decrement"
+msgstr ""
+
+#: ../setedit/editmenu.cc:409
+#, fuzzy
+msgid "Change ~b~ase address..."
+msgstr "~W~echsle Verzeichnis..."
+
+#: ../setedit/editmenu.cc:410
+msgid "~G~o to new address..."
+msgstr ""
+
+#: ../setedit/editmenu.cc:411
+msgid "Follow ~p~ointer"
+msgstr ""
+
+#: ../setedit/editmenu.cc:412
+#, fuzzy
+msgid "Follow pointer in ~n~ew window"
+msgstr "I~m~ Nachrichtenfenster anzeigen"
+
+#: ../setedit/editmenu.cc:413
+msgid "~R~ecompute address"
+msgstr ""
+
+#: ../setedit/editmenu.cc:414
+#, fuzzy
+msgid "M~o~de"
+msgstr "~B~ewegen"
+
+#: ../setedit/editmenu.cc:415
+msgid "Toggle ~a~uto follow"
+msgstr ""
+
+#: ../setedit/editmenu.cc:416
+msgid "Change ~d~isplay mode"
+msgstr ""
+
+#: ../setedit/editmenu.cc:417
+msgid "Toggle ~e~ndian mode"
+msgstr ""
+
+#: ../setedit/editmenu.cc:418
+#, fuzzy
+msgid "Change ~r~adix"
+msgstr "~W~echsle Verzeichnis..."
+
+#: ../setedit/editmenu.cc:419
+#, fuzzy
+msgid "~B~lock"
+msgstr "~U~hr"
+
+#: ../setedit/editmenu.cc:420
+#, fuzzy
+msgid "~F~ill..."
+msgstr "~S~uche..."
+
+#: ../setedit/editmenu.cc:421
+#, fuzzy
+msgid "~C~lear..."
+msgstr "~L~sche"
+
+#: ../setedit/editmenu.cc:422
+#, fuzzy
+msgid "~M~ove..."
+msgstr "~B~ewegen"
+
+#: ../setedit/editmenu.cc:424
+msgid "~L~ess bytes per line"
+msgstr ""
+
+#: ../setedit/editmenu.cc:425
+#, fuzzy
+msgid "~M~ore bytes per line"
+msgstr "~G~ehe zu Zeile"
+
+#: ../setedit/editmenu.cc:426
+msgid "~U~pdate memory"
+msgstr ""
+
+#: ../setedit/editmenu.cc:427
+msgid "Go to st~a~te"
+msgstr ""
+
+#: ../setedit/editmenu.cc:428
+#, fuzzy
+msgid "~C~onnected"
+msgstr "~A~bbruch"
+
+#: ../setedit/editmenu.cc:429
+#, fuzzy
+msgid "~R~eady to run"
+msgstr "auzufhrender Befehl"
+
+#: ../setedit/editmenu.cc:430
+#, fuzzy
+msgid "~O~pen info file..."
+msgstr "~f~fne Info"
+
+#: ../setedit/editmenu.cc:431
+#, fuzzy
+msgid "Con~f~iguration dialog..."
+msgstr "~K~onfiguration"
+
+#: ../setedit/editmenu.cc:432
+#, fuzzy
+msgid "~B~ookmarks..."
+msgstr "~L~esezeichen"
+
+#: ../setedit/editmenu.cc:433
+#, fuzzy
+msgid "List of ~n~odes..."
+msgstr "Wortliste"
+
+#: ../setedit/editmenu.cc:434
+#, fuzzy
+msgid "~G~o to '(file)node'..."
+msgstr "~G~ehe zu Zeile"
+
+#: ../setedit/editmenu.cc:435
+#, fuzzy
+msgid "~N~avigation"
+msgstr "~K~onfiguration"
+
+#: ../setedit/editmenu.cc:436
+msgid "~L~ast visited topic"
+msgstr ""
+
+#: ../setedit/editmenu.cc:437
+#, fuzzy
+msgid "~N~ext topic"
+msgstr "~N~chster Tip"
+
+#: ../setedit/editmenu.cc:438
+#, fuzzy
+msgid "~P~revious topic"
+msgstr "~V~orherige"
+
+#: ../setedit/editmenu.cc:439
+msgid "Go ~u~p in herarchy"
+msgstr ""
+
+#: ../setedit/editmenu.cc:440
+#, fuzzy
+msgid "Main menu for ~t~his file"
+msgstr "Name der info Datei"
+
+#: ../setedit/editmenu.cc:441
+#, fuzzy
+msgid "Info ~d~irectory"
+msgstr "Kann Verzeichnis nicht erstellen:"
+
+#: ../setedit/editmenu.cc:442
+#, fuzzy
+msgid "~J~ump to last link"
+msgstr "~G~ehe zu Funktion"
+
+#: ../setedit/editmenu.cc:443
+#, fuzzy
+msgid "~G~o to link number"
+msgstr "~G~ehe zu Zeile"
+
+#: ../setedit/editmenu.cc:444
+msgid "Link ~1~"
+msgstr ""
+
+#: ../setedit/editmenu.cc:445
+#, fuzzy
+msgid "Link ~2~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:446
+#, fuzzy
+msgid "Link ~3~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:447
+#, fuzzy
+msgid "Link ~4~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:448
+#, fuzzy
+msgid "Link ~5~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:449
+#, fuzzy
+msgid "Link ~6~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:450
+#, fuzzy
+msgid "Link ~7~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:451
+#, fuzzy
+msgid "Link ~8~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:452
+#, fuzzy
+msgid "Link ~9~"
+msgstr "Fensterliste"
+
+#: ../setedit/editmenu.cc:453
+msgid "How to use the ~h~elp"
+msgstr ""
+
+#: ../setedit/editmenu.cc:454
+#, fuzzy
+msgid "Con~t~rol dialog..."
+msgstr "~K~onfiguration"
+
+#: ../setedit/editmenu.cc:455
+#, fuzzy
+msgid "S~e~arch selection forward"
+msgstr "Suchtext nicht gefunden."
+
+#: ../setedit/editmenu.cc:456
+msgid "Search selection ~b~ackward"
+msgstr ""
+
+#: ../setedit/editmenu.cc:457
+#, fuzzy
+msgid "Replace in ~a~ll opened..."
+msgstr "Alle ersetzen"
+
+#: ../setedit/editmenu.cc:458
+msgid "Replace in all project ~i~tems..."
+msgstr ""
+
+#: ../setedit/editpale.cc:110
+msgid "Palette editor"
+msgstr "Paletteneditor"
+
+#: ../setedit/editpale.cc:117
+msgid "Color RGB composition"
+msgstr "RGB Farbzusammenstellung"
+
+#: ../setedit/editpale.cc:123
+msgid "Red"
+msgstr "Rot"
+
+#: ../setedit/editpale.cc:129
+msgid "Green"
+msgstr "Grn"
+
+#: ../setedit/editpale.cc:135
+msgid "Blue"
+msgstr "Blau"
+
+#: ../setedit/editpale.cc:166
+msgid "~D~efault"
+msgstr "~O~riginal"
+
+#: ../setedit/editpale.cc:297
+msgid "The hardware doesn't support this."
+msgstr ""
+
+#: ../setedit/edkeys.cc:193
+msgid "Key assignment"
+msgstr "Tasten zuweisen"
+
+#: ../setedit/edkeys.cc:249
+msgid "Accepting that you'll change the SET's editor behavior"
+msgstr "Wollen Sie die nderungen in SET's Verhalten beibehalten?"
+
+#: ../setedit/edkeys.cc:265
+msgid "Do you really want to discard the changes?"
+msgstr "Wollen Sie die nderungen wirklich verwerfen?"
+
+#: ../setedit/edkeys.cc:278
+msgid "Sequence of keys"
+msgstr "Tastenfolge"
+
+#: ../setedit/edkeys.cc:301
+#, fuzzy
+msgid "sLisp code"
+msgstr "sLisp Makros"
+
+#: ../setedit/edkeys.cc:305
+msgid ""
+"Enter the sLisp code, it must start with (\n"
+"and end with )"
+msgstr ""
+
+#: ../setedit/edkeys.cc:368
+#, fuzzy
+msgid "This key is already in use, do you want to replace it?"
+msgstr "Diese Taste ist bereits benutzt. Wollen Sie sie ersetzen?"
+
+#: ../setedit/edkeys.cc:380
+msgid ""
+"This sequence is used for more than one key, delete these assignments first"
+msgstr ""
+"Diese Reihenfolge wird bereits fr mehr als eine Taste benutzt. Lschen Sie "
+"diese Zuweisungen vorher"
+
+#: ../setedit/edkeys.cc:400
+msgid "Key selector"
+msgstr "Bitte eine Tasten drcken"
+
+#: ../setedit/edkeys.cc:403
+msgid "Press a key"
+msgstr "Eine Taste drcken"
+
+#: ../setedit/edkeys.cc:419
+msgid "Part of a sequence"
+msgstr ""
+
+#: ../setedit/edkeys.cc:422
+msgid "Unassigned"
+msgstr ""
+
+#: ../setedit/edkeys.cc:480
+msgid "Macros"
+msgstr "Makros"
+
+#: ../setedit/edkeys.cc:496
+msgid "Commands"
+msgstr "Befehle"
+
+#: ../setedit/edkeys.cc:525
+msgid "A command"
+msgstr "Ein Befehl"
+
+#: ../setedit/edkeys.cc:575
+msgid "Scan Viewer"
+msgstr "Scan Betrachter"
+
+#: ../setedit/edkeys.cc:588
+msgid "Alt keys settings"
+msgstr "Alt Tasteneinstellungen"
+
+#: ../setedit/edkeys.cc:590
+msgid "~K~eys used by the menues, etc."
+msgstr "~T~asten von Mens, etc. benutzt"
+
+#: ../setedit/edkeys.cc:591
+msgid "~L~eft Alt"
+msgstr "~L~inke Alt"
+
+#: ../setedit/edkeys.cc:591
+msgid "~R~ight Alt"
+msgstr "~R~echte Alt"
+
+#: ../setedit/edkeys.cc:592
+msgid "~B~oth Alt"
+msgstr "~B~eide Alt"
+
+#: ../setedit/edkeys.cc:614
+msgid "Key Pad behavior"
+msgstr "KeyPad Verhalten"
+
+#: ../setedit/edkeys.cc:616
+msgid "Behavior"
+msgstr "Verhalten"
+
+#: ../setedit/edkeys.cc:616
+#, fuzzy
+msgid "Use the ~B~IOS default"
+msgstr "Behalte ~B~IOS Standard"
+
+#: ../setedit/edkeys.cc:617
+#, fuzzy
+msgid "Always interpret shift+arrow as ~m~ovement"
+msgstr "U~m~schalt+Pfeil immer als Bewegung"
+
+#: ../setedit/edmsg.cc:415
+#, fuzzy
+msgid "Last message in the list"
+msgstr "Erster in der ~L~iste"
+
+#: ../setedit/edmsg.cc:447
+#, fuzzy
+msgid "First message in the list"
+msgstr "Erster in der ~L~iste"
+
+#: ../setedit/edmsg.cc:558
+msgid "<empty>"
+msgstr ""
+
+#: ../setedit/edprefs.cc:95
+#, fuzzy
+msgid "Open File options"
+msgstr "Bildschirmeinstellungen"
+
+#. ACDEFGIKLNPRSW
+#: ../setedit/edprefs.cc:147
+msgid "~S~ort type"
+msgstr "~S~ortierungsart"
+
+#: ../setedit/edprefs.cc:147
+msgid "~A~lphabetical"
+msgstr "~A~lphabetisch"
+
+#: ../setedit/edprefs.cc:148
+msgid "~D~irectories first"
+msgstr "~V~erzeichnisse zuerst"
+
+#: ../setedit/edprefs.cc:148
+msgid "~F~iles first"
+msgstr "D~a~teien zuerst"
+
+#: ../setedit/edprefs.cc:150
+msgid "Case style"
+msgstr "Gro-/Kleinschreibung"
+
+#: ../setedit/edprefs.cc:150
+#, fuzzy
+msgid "~C~apital letters go first"
+msgstr "~G~robuchstaben zuerst"
+
+#: ../setedit/edprefs.cc:151
+msgid "Case ~i~nsensitive"
+msgstr "~N~icht wichtig"
+
+#: ../setedit/edprefs.cc:152
+msgid "Parent directory (..)"
+msgstr "bergeordnetes Verzeichnis (..)"
+
+#: ../setedit/edprefs.cc:152
+msgid "First in the ~l~ist"
+msgstr "Erster in der ~L~iste"
+
+#: ../setedit/edprefs.cc:153
+msgid "At the ~e~nd of the list"
+msgstr "Am ~E~nde der Liste"
+
+#: ../setedit/edprefs.cc:163
+msgid "Files starting with a dot"
+msgstr ""
+
+#: ../setedit/edprefs.cc:163
+#, fuzzy
+msgid "~N~ormally sorted"
+msgstr "~n~ormaler Text"
+
+#: ../setedit/edprefs.cc:164
+#, fuzzy
+msgid "After the ~r~est"
+msgstr "Nach ~F~unote"
+
+#: ../setedit/edprefs.cc:165
+msgid "Exclude files"
+msgstr ""
+
+#: ../setedit/edprefs.cc:165
+msgid "Ending ~w~ith tilde"
+msgstr ""
+
+#: ../setedit/edprefs.cc:166
+msgid "Ending with .bk~p~"
+msgstr ""
+
+#: ../setedit/edprefs.cc:166
+#, fuzzy
+msgid "Startin~g~ with ."
+msgstr "Starte SDG:"
+
+#: ../setedit/edprefs.cc:222
+msgid "Screen saver"
+msgstr "Bildschirmschoner"
+
+#: ../setedit/edprefs.cc:311
+msgid "Help for screen saver"
+msgstr "Hilfe zum Bildschirmschoner"
+
+#: ../setedit/edprefs.cc:343
+msgid "The screen saver can't be used on this terminal"
+msgstr ""
+
+#: ../setedit/edprefs.cc:355
+msgid "E~x~ternal options"
+msgstr "E~x~terne Einstellungen"
+
+#: ../setedit/edprefs.cc:357
+msgid "Sc~r~een saver (?)"
+msgstr "Bildschirm~s~choner (?)"
+
+#: ../setedit/edprefs.cc:357
+msgid "OF~F~"
+msgstr "~A~US"
+
+#: ../setedit/edprefs.cc:357
+msgid "O~N~"
+msgstr "Ein"
+
+#. First 3 joined
+#: ../setedit/edprefs.cc:359
+msgid "T~e~st"
+msgstr "~T~est"
+
+#: ../setedit/edprefs.cc:360
+msgid "~I~nfo"
+msgstr "~I~nfo"
+
+#: ../setedit/edprefs.cc:364
+msgid "~T~ime"
+msgstr "Zei~t~"
+
+#: ../setedit/edprefs.cc:365
+msgid "seconds"
+msgstr "Sekunden"
+
+#: ../setedit/edprefs.cc:369
+msgid "Ti~m~e"
+msgstr "Zeit"
+
+#: ../setedit/edprefs.cc:370
+msgid "mouse sec."
+msgstr "Maus Sek."
+
+#. ABCDEHIKLMOPRSTUVWY
+#: ../setedit/edprefs.cc:429
+msgid "General editor options"
+msgstr "Allgemeine Editoreinstellungen"
+
+#: ../setedit/edprefs.cc:431
+msgid "~S~ave/Desktop options"
+msgstr "~S~peichere Desktopeinstellungen"
+
+#: ../setedit/edprefs.cc:432
+msgid "Make ~b~ackups"
+msgstr "Erstelle ~B~ackups"
+
+#: ../setedit/edprefs.cc:434
+#, fuzzy
+msgid "~U~NIX-style backups"
+msgstr "Backups im ~U~NIX-Stil"
+
+#: ../setedit/edprefs.cc:436
+msgid "H~i~dden backups"
+msgstr "Versteckte S~i~cherheitskopie"
+
+#: ../setedit/edprefs.cc:438
+#, fuzzy
+msgid "R~e~member bkps to delete"
+msgstr "~E~rinnern, backups zu lschen"
+
+#: ../setedit/edprefs.cc:440
+msgid "~D~on't create desktop files"
+msgstr "~K~eine Desktopdateien erstellen"
+
+#: ../setedit/edprefs.cc:442
+msgid "Save desktop files ~h~idden"
+msgstr "Desktopdateien versteckt sc~h~reiben"
+
+#: ../setedit/edprefs.cc:444
+msgid "Tile windows ~v~ertically first"
+msgstr "Fenster erst ~v~ertikal teilen"
+
+#: ../setedit/edprefs.cc:447
+msgid "Save UNIX files ~a~s UNIX"
+msgstr "UNIX Dateien als UNIX speichern"
+
+#: ../setedit/edprefs.cc:449
+msgid "Save DOS files ~a~s DOS"
+msgstr "DOS Dateien ~a~ls DOS speichern"
+
+#: ../setedit/edprefs.cc:452
+#, fuzzy
+msgid "Don't remember cursor ~p~osition"
+msgstr "Cursorpos~i~tion laden"
+
+#: ../setedit/edprefs.cc:454
+#, fuzzy
+msgid "Don't ~w~arn about read-only files"
+msgstr "Nicht beim nchsten Mal anzeigen"
+
+#: ../setedit/edprefs.cc:456
+msgid "Open ~r~ead-only files as R.O. buffers"
+msgstr ""
+
+#: ../setedit/edprefs.cc:460
+msgid "~C~lock"
+msgstr "~U~hr"
+
+#: ../setedit/edprefs.cc:460
+msgid "OFF"
+msgstr "AUS"
+
+#: ../setedit/edprefs.cc:460
+msgid "ON"
+msgstr "EIN"
+
+#: ../setedit/edprefs.cc:461
+msgid "St~y~le"
+msgstr "St~i~l"
+
+#: ../setedit/edprefs.cc:461
+msgid "AM/PM"
+msgstr "AM/PM"
+
+#: ../setedit/edprefs.cc:461
+msgid "24 hs"
+msgstr "24 Std"
+
+#: ../setedit/edprefs.cc:463
+msgid "~M~ax. editor copies"
+msgstr "~M~ax. Editorkopien"
+
+#: ../setedit/edprefs.cc:464
+#, fuzzy
+msgid "Max. c~l~osed to remember"
+msgstr "Anzahl geschlossener Fenster"
+
+#: ../setedit/edprefs.cc:473
+msgid "+ Desk~t~op"
+msgstr ""
+
+#: ../setedit/edprefs.cc:474
+#, fuzzy
+msgid "+ Others"
+msgstr "andere"
+
+#. CEKLMNORVY
+#: ../setedit/edprefs.cc:605
+#, fuzzy
+msgid "More desktop options"
+msgstr "~S~peichere Desktopeinstellungen"
+
+#: ../setedit/edprefs.cc:607
+#, fuzzy
+msgid "Remember editor windows"
+msgstr "Allgemeine Editoreinstellungen"
+
+#: ../setedit/edprefs.cc:608
+#, fuzzy
+msgid "~A~lways"
+msgstr "Ab~s~pielen"
+
+#: ../setedit/edprefs.cc:608
+msgid "~O~nly if no file specified"
+msgstr ""
+
+#: ../setedit/edprefs.cc:608 ../setedit/runprog.cc:138
+#, fuzzy
+msgid "~N~ever"
+msgstr "~b~erschreiben"
+
+#: ../setedit/edprefs.cc:609
+#, fuzzy
+msgid "Remember other windows"
+msgstr "Allgemeine Editoreinstellungen"
+
+#: ../setedit/edprefs.cc:610 ../setedit/runprog.cc:138
+msgid "Al~w~ays"
+msgstr ""
+
+#: ../setedit/edprefs.cc:610
+msgid "On~l~y if no file specified"
+msgstr ""
+
+#: ../setedit/edprefs.cc:610
+#, fuzzy
+msgid "Neve~r~"
+msgstr "~b~erschreiben"
+
+#: ../setedit/edprefs.cc:611
+#, fuzzy
+msgid "Remember ~c~losed windows"
+msgstr "Allgemeine Editoreinstellungen"
+
+#: ../setedit/edprefs.cc:612
+msgid "Alway~s~"
+msgstr ""
+
+#: ../setedit/edprefs.cc:612
+msgid "Onl~y~ if no file specified"
+msgstr ""
+
+#: ../setedit/edprefs.cc:612
+#, fuzzy
+msgid "Ne~v~er"
+msgstr "~b~erschreiben"
+
+#: ../setedit/edprefs.cc:618 ../setedit/edprefs.cc:685
+#, fuzzy
+msgid "~M~ain options"
+msgstr "~E~xtraeinstellungen"
+
+#: ../setedit/edprefs.cc:662
+#, fuzzy
+msgid "At the end of error list in message window"
+msgstr "I~m~ Nachrichtenfenster anzeigen"
+
+#: ../setedit/edprefs.cc:663
+msgid "~J~ust stop"
+msgstr ""
+
+#: ../setedit/edprefs.cc:664
+msgid "~I~ndicate with a message"
+msgstr ""
+
+#: ../setedit/edprefs.cc:665
+msgid "Wrap (~c~ircular list)"
+msgstr ""
+
+#: ../setedit/edprefs.cc:666
+msgid "Make a beep"
+msgstr ""
+
+#: ../setedit/edprefs.cc:667
+msgid "When creating message and similar windows"
+msgstr ""
+
+#: ../setedit/edprefs.cc:668
+#, fuzzy
+msgid "Use the ~v~ertical direction"
+msgstr "Auswahl der Zwis~c~henablage benutzen"
+
+#: ../setedit/edprefs.cc:669
+msgid "Use the ~r~ight side"
+msgstr ""
+
+#: ../setedit/edprefs.cc:670
+#, fuzzy
+msgid "When opening files"
+msgstr "Es sind keine Dateien geffnet"
+
+#: ../setedit/edprefs.cc:671
+msgid "~U~se reserved width or 7 (hz dir)"
+msgstr ""
+
+#: ../setedit/edprefs.cc:672
+msgid "~A~void message and project windows"
+msgstr ""
+
+#: ../setedit/edprefs.cc:673
+msgid "Reserved ~w~idth"
+msgstr ""
+
+#: ../setedit/edprefs.cc:674
+msgid "Zoom windows when"
+msgstr ""
+
+#: ../setedit/edprefs.cc:675
+#, fuzzy
+msgid "No ~p~roject window"
+msgstr "Projektfenster"
+
+#: ../setedit/edprefs.cc:676
+msgid "No prj. wi~n~dow or it's zoomed"
+msgstr ""
+
+#: ../setedit/edprefs.cc:677
+#, fuzzy
+msgid "A~l~ways"
+msgstr "Ab~s~pielen"
+
+#: ../setedit/edprefs.cc:797
+msgid "~F~rom code page"
+msgstr "Von ~C~odepage"
+
+#: ../setedit/edprefs.cc:799
+msgid "~T~o code page"
+msgstr "~Z~ur Codepage"
+
+#: ../setedit/edprefs.cc:803
+#, fuzzy
+msgid "~D~on't remap codes below 32"
+msgstr "Co~d~es unter 32 nicht ~u~mwandeln"
+
+#: ../setedit/edprefs.cc:804
+#, fuzzy
+msgid "~O~nly selected text"
+msgstr "Ausge~w~hlter Text"
+
+#: ../setedit/edprefs.cc:807
+msgid "Code page remap"
+msgstr "Code page ndern"
+
+#: ../setedit/edprefs.cc:894
+#, fuzzy
+msgid "Second ~f~ont"
+msgstr "~S~ekundre Schrift"
+
+#: ../setedit/edprefs.cc:1075
+msgid "This terminal doesn't support changing fonts"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1081
+msgid "Can't determine fonts geometry"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1094
+msgid "No fonts available for current video mode"
+msgstr ""
+
+#. Primary font label, check box and list
+#: ../setedit/edprefs.cc:1139
+#, fuzzy
+msgid "~P~rimary"
+msgstr "Ab~s~pielen"
+
+#: ../setedit/edprefs.cc:1139
+#, fuzzy
+msgid "~L~oad font"
+msgstr "~L~aden"
+
+#: ../setedit/edprefs.cc:1146
+#, fuzzy
+msgid "S~i~ze"
+msgstr "~V~erbergen"
+
+#: ../setedit/edprefs.cc:1152
+#, fuzzy
+msgid "~S~econdary"
+msgstr "~S~ekundre Schrift"
+
+#: ../setedit/edprefs.cc:1152
+#, fuzzy
+msgid "Lo~a~d font"
+msgstr "Andere ~S~chrift"
+
+#: ../setedit/edprefs.cc:1158
+msgid "Fonts"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1196
+#, c-format
+msgid "The selected secondary font doesn't support the primary size (%dx%d)"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1235
+msgid "This terminal has a fixed size"
+msgstr ""
+
+#. CDEGHIMNSWX
+#: ../setedit/edprefs.cc:1256
+#, fuzzy
+msgid "Screen size options"
+msgstr "Bildschirmeinstellungen"
+
+#: ../setedit/edprefs.cc:1257
+#, fuzzy
+msgid "~D~on't force"
+msgstr "~N~icht benutzen"
+
+#: ../setedit/edprefs.cc:1258
+msgid "~S~ame as last run"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1259
+#, fuzzy
+msgid "~E~xternal program"
+msgstr "Externes Programm benutzen"
+
+#: ../setedit/edprefs.cc:1260
+#, fuzzy
+msgid "~C~losest to specified size"
+msgstr "Nur s~p~ezifizierte Dateien ffnen"
+
+#: ../setedit/edprefs.cc:1261
+msgid "Specified ~m~ode number"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1264
+msgid "~W~idth "
+msgstr ""
+
+#: ../setedit/edprefs.cc:1265
+#, fuzzy
+msgid "~H~eight"
+msgstr "~R~echte Alt"
+
+#: ../setedit/edprefs.cc:1266
+msgid "Chars w~i~dth "
+msgstr ""
+
+#: ../setedit/edprefs.cc:1267
+msgid "Chars hei~g~ht"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1270
+#, fuzzy
+msgid "E~x~ternal program"
+msgstr "Externes Programm benutzen"
+
+#: ../setedit/edprefs.cc:1273
+#, fuzzy
+msgid "Mode ~n~umber"
+msgstr "Falsche Nummer"
+
+#: ../setedit/edprefs.cc:1278
+#, fuzzy
+msgid "Screen size"
+msgstr "Bildschirmschoner"
+
+#: ../setedit/edprefs.cc:1297
+msgid "Please specify a screen size of at least 80x25 and no more than 250x250"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1302
+msgid "Please specify a character size of at least 5x7 and no more than 32x32"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1325
+msgid "Checking for modified files"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1329
+msgid "When a file on disk is newer than a file in edition:\n"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1330
+msgid "Seconds between checks"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1331
+#, fuzzy
+msgid "Related options"
+msgstr "Andere Optionen"
+
+#: ../setedit/edprefs.cc:1332
+msgid "~D~on't check after executing an external program"
+msgstr ""
+
+#: ../setedit/edprefs.cc:1333
+msgid "Don't check while ~i~dle"
+msgstr ""
+
+#: ../setedit/edprint.cc:72
+#, c-format
+msgid "Page: %d Lines: %d to %d Date: %s Time: %s%s"
+msgstr "Seite: %d Zeilen: %d bis %d Datum: %s Zeit: %s%s"
+
+#: ../setedit/edprint.cc:73
+#, c-format
+msgid ""
+"* Source: %s * Title: %s * Author: %s\n"
+"\n"
+msgstr ""
+"* Quelle: %s * Titel: %s * Author: %s\n"
+"\n"
+
+#: ../setedit/edprint.cc:458
+msgid "Starting printing module"
+msgstr "Starte Drucken-Modus"
+
+#: ../setedit/edprint.cc:470
+msgid "Can't open output file for printing"
+msgstr "Konnte Ausgabedatei nicht zum Drucken ffnen"
+
+#: ../setedit/edprint.cc:478
+msgid "The header is too large, reduce the title and/or author lengths"
+msgstr "Der Kopf ist zu gro, vermindern Sie die Titel-/Authorlnge"
+
+#: ../setedit/edprint.cc:481
+#, c-format
+msgid "Header length: %d Columns: %d"
+msgstr "Kopflnge: %d Spalten: %d"
+
+#: ../setedit/edprint.cc:529
+#, c-format
+msgid "Processed: %d lines, total printed: %d lines"
+msgstr "Verarbeitet: %d Zeilen, insgesamt gedruckt %d Zeilen"
+
+#: ../setedit/edprint.cc:682
+msgid "Printer Setup"
+msgstr "Druckereinstellungen"
+
+#: ../setedit/edprint.cc:685
+msgid "Total ~l~ines per page:"
+msgstr "Gesamte Zeilen pro Seite:"
+
+#: ../setedit/edprint.cc:687
+msgid "Columns ~w~/o margin:"
+msgstr "Spalten ~o~hne Rand:"
+
+#: ../setedit/edprint.cc:689
+msgid "Left ~m~argin:"
+msgstr "Linker ~R~and:"
+
+#: ../setedit/edprint.cc:690
+msgid "Print line numbers"
+msgstr "Zeilennummern drucken"
+
+#: ../setedit/edprint.cc:691
+msgid "~T~ime format:"
+msgstr "Zei~t~format:"
+
+#: ../setedit/edprint.cc:692
+msgid "~D~ate format:"
+msgstr "~D~atumformat:"
+
+#: ../setedit/edprint.cc:694
+msgid "T~i~tle"
+msgstr "T~i~tel"
+
+#: ../setedit/edprint.cc:695
+msgid "~A~uthor"
+msgstr "~A~uthor"
+
+#: ../setedit/edprint.cc:696
+msgid "Before ~h~eading"
+msgstr "Vor bersc~h~rift"
+
+#: ../setedit/edprint.cc:697
+msgid "A~f~ter heading"
+msgstr "Nach berschri~f~t"
+
+#: ../setedit/edprint.cc:698
+msgid "~B~efore footer"
+msgstr "~V~or Fu"
+
+#: ../setedit/edprint.cc:699
+msgid "After foote~r~"
+msgstr "Nach ~F~unote"
+
+#: ../setedit/edprint.cc:701
+msgid "~P~rinter initialization"
+msgstr "D~r~uckereinstellungen"
+
+#: ../setedit/edprint.cc:702
+msgid "O~u~tput file"
+msgstr "A~u~sgabedatei"
+
+#: ../setedit/edprint.cc:703
+msgid "Output is a de~v~ice/file"
+msgstr "Ausgabe ist ein Ger~~t/Datei"
+
+#: ../setedit/edprint.cc:704
+msgid "Output i~s~ a program"
+msgstr "Ausgabe ist ein Programm"
+
+#: ../setedit/edprint.cc:707 ../settvuti/tdiagaid.cc:172
+msgid "~C~ancel"
+msgstr "~A~bbruch"
+
+#: ../setedit/edprj.cc:424
+#, fuzzy
+msgid "File already in project"
+msgstr "Keine Dateien im Projekt"
+
+#: ../setedit/edprj.cc:529
+msgid "Add File"
+msgstr "Datei hinzufgen"
+
+#: ../setedit/edprj.cc:639 ../setedit/edprj.cc:680
+msgid "Project Window"
+msgstr "Projektfenster"
+
+#: ../setedit/edprj.cc:647
+msgid " 1 Project Window"
+msgstr " 1 Projektfenster"
+
+#: ../setedit/edprj.cc:721
+msgid "Could not open project file"
+msgstr "Konnte Projektdatei nicht ffnen"
+
+#: ../setedit/edprj.cc:728
+msgid "Wrong project file."
+msgstr "Falsche Projektdatei."
+
+#: ../setedit/edprj.cc:763
+msgid "Error reading project file"
+msgstr "Fehler beim Lesen der Projektdatei"
+
+#: ../setedit/edprj.cc:765 ../setedit/edprj.cc:945
+#, fuzzy
+msgid "Project: "
+msgstr "~P~rojekt"
+
+#: ../setedit/edprj.cc:801
+msgid "Could not save the project."
+msgstr "Konnte das Projekt nicht speichern."
+
+#: ../setedit/edprj.cc:890
+msgid "Open Project"
+msgstr "Projekt ffnen"
+
+#: ../setedit/edprj.cc:1045
+#, fuzzy, c-format
+msgid "Failed to open the file %s"
+msgstr "Konnte die Listendatei nicht ffnen"
+
+#: ../setedit/edprj.cc:1317
+#, fuzzy
+msgid "Export project items"
+msgstr "Export Optionen"
+
+#: ../setedit/edprj.cc:1354
+#, fuzzy
+msgid "Import project items"
+msgstr "Falsche Projektdatei."
+
+#: ../setedit/edprj.cc:1362
+#, fuzzy
+msgid "Unable to open file"
+msgstr "Konnte die Listendatei nicht ffnen"
+
+#: ../setedit/edprj.cc:1398
+#, c-format
+msgid "Results: added %d, already included: %d, rejected %d"
+msgstr ""
+
+#: ../setedit/holidays.cc:172
+#, fuzzy
+msgid "Can't find plug-ins directory"
+msgstr "Zielverzeichnis"
+
+#: ../setedit/holidays.cc:290
+msgid "Holidays plug-ins not supported. Sorry."
+msgstr ""
+
+#: ../setedit/holidays.cc:297
+msgid "Failed to load holidays.conf"
+msgstr ""
+
+#: ../setedit/holidays.cc:301
+msgid "Holidays country"
+msgstr ""
+
+#: ../setedit/holidays.cc:318
+msgid "Country"
+msgstr ""
+
+#: ../setedit/holidays.cc:318
+#, fuzzy
+msgid "Force country"
+msgstr "Sekundr encoding"
+
+#: ../setedit/intgrep.cc:114
+msgid "The clipboard is empty"
+msgstr "Die Zwischenablage ist leer"
+
+#: ../setedit/intgrep.cc:202
+#, fuzzy
+msgid "You must install GNU grep to use it!"
+msgstr "Sie mssen grep installieren, um dies zu benutzen!"
+
+#: ../setedit/intgrep.cc:222
+#, c-format
+msgid "Running grep in: %s"
+msgstr "Starte grep in: %s"
+
+#: ../setedit/intgrep.cc:254
+msgid "From stderr:"
+msgstr ""
+
+#: ../setedit/intgrep.cc:255
+msgid "From stdout:"
+msgstr ""
+
+#: ../setedit/intgrep.cc:335
+#, c-format
+msgid "chdir error: %s"
+msgstr "Fehler beim Wechsel in Verzeichnis: %s"
+
+# unclear
+#: ../setedit/intgrep.cc:379
+msgid "Powered Grep by SET"
+msgstr "Powered Grep by SET"
+
+#. ACDEFGIJKLNORPSTUWX
+#. Pattern section
+#: ../setedit/intgrep.cc:385
+msgid "~P~attern box"
+msgstr "~M~uster (Pattern-) box"
+
+#: ../setedit/intgrep.cc:386
+msgid "Files to ~s~earch"
+msgstr "Zu durchsuchende Dateien"
+
+#: ../setedit/intgrep.cc:387
+msgid "~D~irectories to search"
+msgstr "~V~erzeichnisse zum Durchsuchen"
+
+#: ../setedit/intgrep.cc:390
+msgid "`Pattern box' is the pa~t~tern"
+msgstr "`Pattern box' ist das ~M~uster"
+
+#: ../setedit/intgrep.cc:391
+msgid "`Pattern box' is a fi~l~e name"
+msgstr "`Pattern box' ist ein ~D~ateiname"
+
+#: ../setedit/intgrep.cc:392
+msgid "Use the ~c~lipboard selection"
+msgstr "Auswahl der Zwis~c~henablage benutzen"
+
+#: ../setedit/intgrep.cc:394
+msgid "Source of Pattern"
+msgstr "Musterquelle"
+
+#: ../setedit/intgrep.cc:397
+msgid "Basic regular expression (-~G~)"
+msgstr "Einfacher regulrer Ausdruck (-~G~)"
+
+#: ../setedit/intgrep.cc:398
+msgid "~E~xtended regular expression (-E)"
+msgstr "~E~rweiterte regulre Ausdrcke (-E)"
+
+#: ../setedit/intgrep.cc:399
+msgid "~F~ixed separated by CR (-F)"
+msgstr "~F~est durch CR getrennt (-F)"
+
+#: ../setedit/intgrep.cc:401
+msgid "Type of Pattern"
+msgstr "Mustertyp"
+
+#: ../setedit/intgrep.cc:404
+msgid "~U~se `Files to search'"
+msgstr "~B~enutze `zu suchende Dateien'"
+
+#: ../setedit/intgrep.cc:405
+msgid "Search in ope~n~ed windows"
+msgstr "Suche in geff~n~eten Fenstern"
+
+#: ../setedit/intgrep.cc:406
+msgid "Search in pro~j~ect"
+msgstr "Suche im Pro~j~ekt"
+
+#: ../setedit/intgrep.cc:408
+msgid "Pl~a~ces to search"
+msgstr "Such~p~ltze"
+
+#: ../setedit/intgrep.cc:410
+msgid "~R~ecurse in subdirs"
+msgstr "In Unterverz. ~e~intauchen"
+
+#: ../setedit/intgrep.cc:413
+msgid "~I~gnore case (-i)"
+msgstr "~G~rop/Klein nicht beachten (-i)"
+
+#: ../setedit/intgrep.cc:414
+msgid "~W~hole words only (-w)"
+msgstr "Nur ~g~anze Wrter (-w)"
+
+#: ../setedit/intgrep.cc:415
+msgid "Whole line (-~x~)"
+msgstr "Ganze Zeile (-~x~)"
+
+#: ../setedit/intgrep.cc:416
+msgid "In~v~erse matching (-v)"
+msgstr "umgekehrte bereinstimmung (-~v~)"
+
+#: ../setedit/intgrep.cc:439
+msgid "You must provide at least one directory to search"
+msgstr "Sie mssen mindestens ein Verzeichnis fr die Suche angeben"
+
+#: ../setedit/intgrep.cc:521
+#, fuzzy
+msgid "There aren't any files open"
+msgstr "Es sind keine Dateien geffnet"
+
+#: ../setedit/intgrep.cc:529
+msgid "No files in project"
+msgstr "Keine Dateien im Projekt"
+
+#: ../setedit/intgrep.cc:544
+msgid "Powered grep"
+msgstr "Besseres grep"
+
+#: ../setedit/intgrep.cc:549
+msgid "Recurse & dirs. ignored, using internal names"
+msgstr "Rekursive und Verzeichnisse ignoriert, benutze interne Namen"
+
+#: ../setedit/intgrep.cc:559
+msgid "Grep search aborted"
+msgstr ""
+
+#: ../setedit/intgrep.cc:561
+msgid "End of grep search"
+msgstr "Ende der grep Suche"
+
+#: ../setedit/loadnobkp.cc:45
+#, fuzzy
+msgid "Don't create backups for"
+msgstr "~K~eine Desktopdateien erstellen"
+
+#: ../setedit/loadnobkp.cc:176
+#, fuzzy
+msgid "Perl regular expression"
+msgstr "Regulre Ausd~r~cke"
+
+#: ../setedit/menuload.cc:72
+msgid "No error"
+msgstr "Kein Fehler"
+
+#: ../setedit/menuload.cc:73
+msgid "String expected"
+msgstr "Zeichenkette erwartet"
+
+#: ../setedit/menuload.cc:74
+#, fuzzy
+msgid "String not closed"
+msgstr "Zeichenkette nicht beendent"
+
+#: ../setedit/menuload.cc:75
+msgid "No key for SubMenu"
+msgstr "Keine Taste fr `SubMenu'"
+
+#: ../setedit/menuload.cc:76
+msgid "Wrong key name"
+msgstr "Falsche Schlsselname."
+
+#: ../setedit/menuload.cc:77
+msgid "Extra characters in line"
+msgstr "Extra Zeichen in Zeile"
+
+#: ../setedit/menuload.cc:78
+msgid "No number for a context"
+msgstr "Keine Nummer fr einen Kontext"
+
+#: ../setedit/menuload.cc:79
+msgid "Syntax error"
+msgstr "Syntaxfehler"
+
+#: ../setedit/menuload.cc:80
+msgid "Empty submenu"
+msgstr "Leeres Untermen"
+
+#: ../setedit/menuload.cc:81
+#, fuzzy
+msgid "SubMenu not closed "
+msgstr "Zeichenkette nicht beendent"
+
+#: ../setedit/menuload.cc:82
+#, fuzzy
+msgid "Missing command value"
+msgstr "Falscher Befehlname"
+
+#: ../setedit/menuload.cc:83
+msgid "Wrong command name"
+msgstr "Falscher Befehlname"
+
+#: ../setedit/menuload.cc:84
+msgid "No menu definition"
+msgstr "Keine Mendefinition"
+
+#: ../setedit/menuload.cc:85
+msgid "Wrong context name"
+msgstr "Falscher Kontextname"
+
+#: ../setedit/menuload.cc:86
+msgid "Unfinished macro name"
+msgstr "Nicht beendeter Makroname"
+
+#: ../setedit/menuload.cc:87
+msgid "Unable to register macro"
+msgstr "Kann Makro nicht registrieren"
+
+#: ../setedit/menuload.cc:88
+#, fuzzy
+msgid "No status line definition"
+msgstr "Keine Mendefinition"
+
+#: ../setedit/menuload.cc:89
+msgid "No `from' value in range"
+msgstr ""
+
+#: ../setedit/menuload.cc:90
+msgid "No `quantity' value in range"
+msgstr ""
+
+#: ../setedit/menuload.cc:91
+#, fuzzy
+msgid "Number expected"
+msgstr "Zeichenkette erwartet"
+
+#: ../setedit/menuload.cc:92
+#, fuzzy
+msgid "Invalid range"
+msgstr "Ungltiges Laufwerk"
+
+#: ../setedit/menuload.cc:93
+#, fuzzy
+msgid "StatusRange not closed"
+msgstr "Zeichenkette nicht beendent"
+
+#: ../setedit/menuload.cc:94
+#, fuzzy
+msgid "Empty status line"
+msgstr "Leeres Untermen"
+
+#: ../setedit/menuload.cc:95
+#, fuzzy
+msgid "Wrong help context name or number"
+msgstr "Falscher Kontextname"
+
+#: ../setedit/menuload.cc:96
+msgid "Too much conditionals nested"
+msgstr ""
+
+#: ../setedit/menuload.cc:97
+msgid "Unmatched $endif"
+msgstr ""
+
+#: ../setedit/menuload.cc:98
+msgid "Preprocessor value redefined"
+msgstr ""
+
+#: ../setedit/menuload.cc:1491
+#, c-format
+msgid "Error loading menu: (%d) %s in line %d of %s."
+msgstr "Fehler beim Laden von Men: (%d) %s in Zeile %d von %s."
+
+#: ../setedit/pathlist.cc:98
+msgid "Path to look for includes"
+msgstr ""
+
+#: ../setedit/pathlist.cc:99
+msgid "Path to look for sources"
+msgstr ""
+
+#: ../setedit/pathlist.cc:335
+#, fuzzy
+msgid "Directory"
+msgstr "Kann Verzeichnis nicht erstellen:"
+
+#: ../setedit/runprog.cc:83
+#, c-format
+msgid "Running %s"
+msgstr "Fhre aus: %s"
+
+#: ../setedit/runprog.cc:84
+msgid "Back in the editor"
+msgstr "Zurck im Editor"
+
+#: ../setedit/runprog.cc:85
+#, fuzzy
+msgid "From program:"
+msgstr "Fr Programmierer"
+
+#: ../setedit/runprog.cc:122
+msgid "Command to run"
+msgstr "auzufhrender Befehl"
+
+#. EN: ABCDEFGHIJKLMNOPRSTUW
+#. ES: ACDEFKHIJLMNOPRSTUVZ
+#: ../setedit/runprog.cc:125
+msgid "~E~nter the program name"
+msgstr "~P~rogrammname eingeben"
+
+#: ../setedit/runprog.cc:128
+msgid "~U~se OS screen to run the program"
+msgstr "~B~enutze OS Bildschirm, um Programm zu starten"
+
+#: ../setedit/runprog.cc:129
+msgid "~D~on't try to run in background"
+msgstr ""
+
+#: ../setedit/runprog.cc:130
+msgid "~A~lways parse in background"
+msgstr ""
+
+#: ../setedit/runprog.cc:131
+#, fuzzy
+msgid "~J~ump to the first error"
+msgstr "~G~ehe zu Funktion"
+
+#: ../setedit/runprog.cc:132
+msgid "Don't ~r~edirect stdout"
+msgstr ""
+
+#: ../setedit/runprog.cc:133
+msgid "Don't make a beep when f~i~nished"
+msgstr ""
+
+#: ../setedit/runprog.cc:134
+msgid "Don't finish debu~g~ session"
+msgstr ""
+
+#: ../setedit/runprog.cc:135
+#, fuzzy
+msgid "Don't move breakp~o~ints"
+msgstr "Nicht innerhalb Ta~b~s bewegen"
+
+#: ../setedit/runprog.cc:136
+msgid "~C~onfirm if stopping debug session"
+msgstr ""
+
+#: ../setedit/runprog.cc:137
+#, fuzzy
+msgid "Message window ~s~croll"
+msgstr "Nachrichtenfenster"
+
+#: ../setedit/runprog.cc:138
+msgid "Only if not ~f~ocused"
+msgstr ""
+
+#: ../setedit/runprog.cc:143
+msgid "~H~orizontal reset"
+msgstr ""
+
+#: ../setedit/runprog.cc:144
+msgid "At ~b~eggining"
+msgstr ""
+
+#: ../setedit/runprog.cc:145
+msgid "For each ~m~essage"
+msgstr ""
+
+#: ../setedit/runprog.cc:146
+msgid "At ~t~he end"
+msgstr ""
+
+#: ../setedit/runprog.cc:147
+#, fuzzy
+msgid "~L~ines per pass"
+msgstr "Gesamte Zeilen pro Seite:"
+
+#: ../setedit/runprog.cc:152
+#, fuzzy
+msgid "Error ~p~arser"
+msgstr "Fehler"
+
+#. Error message from a GNU tool (i.e. gcc)
+#: ../setedit/runprog.cc:197
+#, fuzzy
+msgid "error"
+msgstr "Fehler"
+
+#. Warning message from a GNU tool (i.e. gcc)
+#: ../setedit/runprog.cc:199
+#, fuzzy
+msgid "warning"
+msgstr "Warnung"
+
+#. GNU Make message: Entering directory (partial)
+#: ../setedit/runprog.cc:201
+msgid "ntering dir"
+msgstr ""
+
+#. GNU Make message: Leaving directory (partial)
+#: ../setedit/runprog.cc:203
+msgid "eaving dir"
+msgstr ""
+
+#: ../setedit/runprog.cc:553
+msgid "A child process is running. Please wait or stop it."
+msgstr ""
+
+#: ../setedit/runprog.cc:584
+#, fuzzy
+msgid "Waiting ..."
+msgstr "Suche..."
+
+#: ../setedit/runprog.cc:693
+msgid "Process interrupted"
+msgstr ""
+
+#: ../setedit/runprog.cc:772
+msgid "You must configure it first in the Options submenu"
+msgstr "Sie mssen das erst im Optionen-Untermen einstellen."
+
+#: ../setedit/scresave.cc:246
+#, fuzzy
+msgid "Screen saver. Press a key"
+msgstr "Bildschirmschoner, drcken Sie eine Taste"
+
+#. ************************* Text Stars saver ****************************
+#: ../setedit/scresave.cc:740
+msgid "Press a key to continue"
+msgstr "Eine Taste zum Fortfahren drcken"
+
+#. ************************* Safe saver ****************************
+#: ../setedit/scresave.cc:843
+#, fuzzy
+msgid ""
+"That's a 'safe' screen saver. The editor has a beautiful plasma screen saver "
+"but currently it isn't the default because some (really buggy) Winshit 9x "
+"video drivers do strange things when a windowed DOS program switches to "
+"video mode. I hate it ...."
+msgstr ""
+"Das ist ein `sicherer' Bildschirmschoner. Der Editor hatten einen "
+"wunderschnen Plasma-Bildschirmschoner, der aber wegen einigen (uerst "
+"fehlerhaften) Windoze 9x Videotreibern - die die seltsamsten Dinge tun, wenn "
+"ein DOS-Box-Programm in den Grafikmodus schaltet - nicht voreingestellt ist. "
+"Es ist zum Kotzen..."
+
+#: ../setedit/tips.cc:181 ../setedit/tips.cc:256
+msgid "Tip of the day"
+msgstr "Tip des Tages"
+
+#: ../setedit/tips.cc:185
+#, fuzzy, c-format
+msgid "~T~ip %d"
+msgstr "~T~ip"
+
+#: ../setedit/tips.cc:207
+msgid "Don't ~s~how it again"
+msgstr "Nicht nocheinmal zeigen"
+
+#: ../setedit/tips.cc:208
+msgid "Show it once a ~d~ay"
+msgstr "Einmal tglich ~z~eigen"
+
+#: ../setedit/tips.cc:209
+msgid "Show it in the ~m~essage window"
+msgstr "I~m~ Nachrichtenfenster anzeigen"
+
+#: ../setedit/tips.cc:214
+msgid "~N~ext tip"
+msgstr "~N~chster Tip"
+
+#: ../setedit/winlistd.cc:46
+msgid "Windows List"
+msgstr "Fensterliste"
+
+#: ../setedit/winlistd.cc:96
+#, fuzzy
+msgid "You can't delete this file"
+msgstr "Sie knnen es nicht von der Platte lschen"
+
+#: ../setedit/winlistd.cc:139
+msgid "~G~o"
+msgstr "~G~ehe"
+
+#: ../setedit/winlistd.cc:141
+msgid "~O~pen"
+msgstr "~f~fnen"
+
+#: ../setedit/winlistd.cc:142
+msgid "Re~E~numerate"
+msgstr ""
+
+#: ../settvuti/fileopen.cc:93
+msgid "Ho~m~e"
+msgstr "~S~tart"
+
+#: ../settvuti/fileopen.cc:94
+msgid "~T~ree"
+msgstr "~B~aum"
+
+#: ../settvuti/fileopen.cc:96
+#, fuzzy
+msgid "O~p~tions"
+msgstr "~O~ptionen"
+
+#: ../settvuti/fileopen.cc:304
+msgid "~N~ame"
+msgstr "~N~ame"
+
+#: ../settvuti/tdiagaid.cc:173
+#, fuzzy
+msgid "~I~nfo."
+msgstr "~I~nfo"
+
+#: ../settvuti/tdiagaid.cc:208
+#, fuzzy
+msgid "Assigned to:"
+msgstr "Zuweisun~g~"
+
+#: ../settvuti/tdiagaid.cc:216
+msgid "Assignmen~t~"
+msgstr "Zuweisun~g~"
+
+#: ../settvuti/tdiagaid.cc:216
+msgid "Command~s~"
+msgstr "Befehl~e~"
+
+#: ../settvuti/tdiagaid.cc:217
+#, fuzzy
+msgid "s~L~isp code"
+msgstr "sLisp Makros"
+
+#, fuzzy
+#~ msgid "Can't create temporal file"
+#~ msgstr "Konnte keine temporre Kopie der autoexec.bat erstellen"
+
+#~ msgid "You must install gzip to browse compressed files!"
+#~ msgstr "Sie mssen gzip installieren, um komprimierte Dateien einzusehen!"
+
+#, fuzzy
+#~ msgid "%d bytes selected, in %d"
+#~ msgstr " Bytes ausgewhlt in "
+
+#, fuzzy
+#~ msgid "Wrong desktop file (%s)."
+#~ msgstr "Falsche Desktopdatei."
+
+#, fuzzy
+#~ msgid "Could not open desktop file (%s)"
+#~ msgstr "Konnte Desktopdatei nicht finden."
+
+#, fuzzy
+#~ msgid "Don't pur~g~e spaces"
+#~ msgstr "Schiebe ein Leerzeichen ein"
+
+# c-format
+#, fuzzy
+#~ msgid "SET's Editor v%lX.%lX.%lX, (c) 1996-2003"
+#~ msgstr "SET's Editor v%lX.%lX.%lX, (c) 1996-2000"
+
+#~ msgid "Error of type: %s"
+#~ msgstr "Typfehler: %s"
+
+#~ msgid "File Open"
+#~ msgstr "Datei ffnen"
+
+#~ msgid "File Open options"
+#~ msgstr "Einstellungen von `Datei ffnen'"
+
+#, fuzzy
+#~ msgid "~E~ver"
+#~ msgstr "~A~uswerten"
+
+#, fuzzy
+#~ msgid "E~v~er"
+#~ msgstr "~A~uswerten"
+
+#, fuzzy
+#~ msgid "Ever"
+#~ msgstr "~A~uswerten"
+
+#~ msgid "Unclosed string"
+#~ msgstr "Nicht beendete Zeichenkette"
+
+#~ msgid "Unclosed SubMenu"
+#~ msgstr "Nicht abgeschlossenes `SubMenu'"
+
+#, fuzzy
+#~ msgid "Unclosed StatusRange"
+#~ msgstr "Nicht beendete Zeichenkette"
+
+#, fuzzy
+#~ msgid "T~a~g files ..."
+#~ msgstr "In ~a~llen Dateien"
+
+#~ msgid "~I~tem"
+#~ msgstr "~E~intrag"
+
+#~ msgid "~F~oreground"
+#~ msgstr "~V~ordergrund"
+
+#, fuzzy
+#~ msgid "Pocket Calculator"
+#~ msgstr "~T~aschenrechner"
+
+#, fuzzy
+#~ msgid "Comment inside section name"
+#~ msgstr "~A~utoeinschub"
+
+#, fuzzy
+#~ msgid "Unterminated section name"
+#~ msgstr "Nicht beendeter Makroname"
+
+#, fuzzy
+#~ msgid "Empty section name"
+#~ msgstr "Leeres Untermen"
+
+#, fuzzy
+#~ msgid "Missing open section {"
+#~ msgstr "Ende im pseudo macro fehlt"
+
+#, fuzzy
+#~ msgid "Unterminated string"
+#~ msgstr "Verbundener Wert"
+
+#, fuzzy
+#~ msgid "Windows not present"
+#~ msgstr "Fensterliste"
+
+#, fuzzy
+#~ msgid "Change Directory"
+#~ msgstr "Kann Verzeichnis nicht erstellen:"
+
+#, fuzzy
+#~ msgid "~C~hdir"
+#~ msgstr "~W~echsle Verzeichnis..."
+
+#, fuzzy
+#~ msgid "~R~evert"
+#~ msgstr "~b~erschreiben"
+
+#, fuzzy
+#~ msgid "Help"
+#~ msgstr "~H~ilfe"
+
+#, fuzzy
+#~ msgid "Invalid directory"
+#~ msgstr "Ungltiges Laufwerk"
+
+#, fuzzy
+#~ msgid "Text "
+#~ msgstr "Nchstes"
+
+#~ msgid "~F~iles"
+#~ msgstr "~D~ateien"
+
+#, fuzzy
+#~ msgid "~S~elect"
+#~ msgstr "~L~sche"
+
+#, fuzzy
+#~ msgid "~R~eplace"
+#~ msgstr "Ersetzen"
+
+#, fuzzy
+#~ msgid "Invalid drive or directory"
+#~ msgstr "Ungltiges Laufwerk"
+
+#, fuzzy
+#~ msgid "Invalid file name."
+#~ msgstr "Ungltiges Laufwerk"
+
+#~ msgid "Jan"
+#~ msgstr "Jan"
+
+#~ msgid "Feb"
+#~ msgstr "Feb"
+
+#~ msgid "Mar"
+#~ msgstr "Mr"
+
+#~ msgid "Apr"
+#~ msgstr "Apr"
+
+#~ msgid "Jun"
+#~ msgstr "Jun"
+
+#~ msgid "Jul"
+#~ msgstr "Jul"
+
+#~ msgid "Aug"
+#~ msgstr "Aug"
+
+#~ msgid "Sep"
+#~ msgstr "Sep"
+
+#~ msgid "Oct"
+#~ msgstr "Okt"
+
+#~ msgid "Nov"
+#~ msgstr "Nov"
+
+#~ msgid "Dec"
+#~ msgstr "Dez"
+
+#, fuzzy
+#~ msgid "Highlight"
+#~ msgstr "Syntax~h~ervorhebung"
+
+#, fuzzy
+#~ msgid "failed to open the output terminal"
+#~ msgstr "Konnte die Listendatei nicht ffnen"
+
+#, fuzzy
+#~ msgid "can't get output terminal information"
+#~ msgstr "Konnte Ausgabedatei nicht zum Drucken ffnen"
+
+#, fuzzy
+#~ msgid "X11 error"
+#~ msgstr "Kein Fehler"
+
+#, fuzzy
+#~ msgid "Could not open '%s' for reading"
+#~ msgstr "Konnte Desktopdatei nicht finden."
+
+#, fuzzy
+#~ msgid "Save to file"
+#~ msgstr "Speicher Datei als"
+
+#~ msgid "Confirm"
+#~ msgstr "Besttigung"
+
+#, fuzzy
+#~ msgid "Don't warn you next time"
+#~ msgstr "Nicht beim nchsten Mal anzeigen"
+
+#, fuzzy
+#~ msgid "normal text"
+#~ msgstr "~n~ormaler Text"
+
+#, fuzzy
+#~ msgid "column markers"
+#~ msgstr "Spalten~c~ursor"
+
+#, fuzzy
+#~ msgid "~Alt-X~ Exit"
+#~ msgstr "~F6~ Nchstes"
+
+#~ msgid " has been modified. Save?"
+#~ msgstr " wurde verndert. Speichern?"
+
+#~ msgid "Primary ~e~ncoding"
+#~ msgstr "Primres ~e~ncoding"
+
+#, fuzzy
+#~ msgid ""
+#~ "-b, --bios-keyb: use BIOS for the keyboard [safer, limited].\n"
+#~ msgstr ""
+#~ "-m, --no-mouse-hook: Schaltet Verwendung des Mausinterrupts aus.\n"
+
+#, fuzzy
+#~ msgid ""
+#~ "-B, --no-bios-keyb: don't use BIOS for the keyboard [faster, "
+#~ "default].\n"
+#~ msgstr ""
+#~ "-m, --no-mouse-hook: Schaltet Verwendung des Mausinterrupts aus.\n"
+
+#~ msgid "Keyboard setup"
+#~ msgstr "Tastatur Setup"
+
+#~ msgid "~U~S keyboard and most others"
+#~ msgstr "~U~S Tastatur und meiste andere"
+
+#~ msgid "~G~reek keyboard (CP 737)"
+#~ msgstr "~G~riechische Tastatur (CP 737)"
+
+#~ msgid "No fonts found"
+#~ msgstr "Keine Schriftarten gefunden"
+
+#~ msgid "~P~rimary font (intense)"
+#~ msgstr "~P~rimrschrift (intensiv)"
+
+#~ msgid "~R~OM BIOS fonts"
+#~ msgstr "~R~OM BIOS Schrift"
+
+#~ msgid "Other ~f~ont"
+#~ msgstr "Andere ~S~chrift"
+
+#~ msgid ""
+#~ "This video mode (0x%03x) is not supported by the Turbo Vision library"
+#~ msgstr ""
+#~ "Videomodus 0x%03x wird von der Turbo Vision Bibliothek nicht untersttzt"
+
+#~ msgid "~C~olors ..."
+#~ msgstr "~F~arben..."
+
+#~ msgid "Attention can't open the help file."
+#~ msgstr "Achtung! Kann Hilfedatei nicht ffnen!"
+
+#~ msgid ""
+#~ "-s, --no-signal: disables the hook of signals to save the "
+#~ "modified\n"
+#~ " buffers during a crash. Could be needed if the "
+#~ "editor\n"
+#~ " hangs in an extraordinary way.\n"
+#~ msgstr ""
+#~ "-s, --no-signal: Schaltet die `signal' Behandlung ab, um "
+#~ "genderte\n"
+#~ " Puffer whrend eines Absturzes zu speichern.\n"
+#~ " Sollte gebraucht werden, wenn SETEdit in "
+#~ "ungewhn-\n"
+#~ " licher Weise abstrzt.\n"
+
+#~ msgid "File allready in project (or another with the same name)"
+#~ msgstr "Datei ist bereits im Projekt (oder eine andere mit gleichem Namen)"
+
+#~ msgid "Match pair on the fly ~4~"
+#~ msgstr "Klammernpaar beim berfliegen"
+
+#~ msgid "No command for MenuItem"
+#~ msgstr "Kein Befehl fr `MenuItem'"
+
+#~ msgid "Ove Kaaven for LibAmp, the Allegro adaptation of AMP"
+#~ msgstr "Ove Kaaven fr LibAmp, die Allegro-Ergnzung zu AMP"
+
+#~ msgid "Wrap column ~2~"
+#~ msgstr "Spaltenumbruch ~2~"
diff --git a/setedit/internac/emptymsg.cc b/setedit/internac/emptymsg.cc
new file mode 100644
index 0000000..d59aea4
--- /dev/null
+++ b/setedit/internac/emptymsg.cc
@@ -0,0 +1,75 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001 by Salvador E. Tropea (SET) set@ieee.org
+ Covered by the GPL license, you should get a copy of it with this file.
+
+ Description:
+ This simple program searchs for empty or fuzzy entries in a .po file and
+generates a report in the same style used by GNU tools. Running it from
+setedit you'll be able to jump forward and backward in the report using
+Alt+F7/F8 keys.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+typedef unsigned char uchar;
+
+int main(int argc, char *argv[])
+{
+ if (argc<2)
+ {
+ printf("Empty message searcher. Copyright (c) 2001 by Salvador E. Tropea <set@ieee.org>\n");
+ printf("Covered by the GPL license, you should get a copy of it with this file.");
+ printf("\nUse: emptymsg files...\n");
+ return 1;
+ }
+ int i;
+ for (i=1; i<argc; i++)
+ {
+ FILE *f=fopen(argv[i],"rt");
+ if (!f)
+ {
+ fprintf(stderr,"Failed to open %s\n",argv[i]);
+ continue;
+ }
+
+ char b[200],*s,NextMsgStrFuzzy=0;
+ int line=0;
+ while (!feof(f))
+ {
+ if (fgets(b,199,f))
+ {
+ line++;
+ if (strncmp(b,"msgstr",6)==0)
+ {
+ if (NextMsgStrFuzzy)
+ {
+ printf("%s:%d: fuzzy\n",argv[i],line);
+ NextMsgStrFuzzy=0;
+ }
+ else
+ {
+ for (s=b+6; *s && isspace((uchar)*s); s++);
+ if (*s && *s=='"' && s[1]=='"')
+ {// Candidate
+ if (fgets(b,199,f))
+ {
+ if (b[0]!='"')
+ printf("%s:%d: empty\n",argv[i],line);
+ line++;
+ }
+ }
+ }
+ }
+ else
+ if (strncmp(b,"#, fuzzy",8)==0)
+ NextMsgStrFuzzy=1;
+ }
+ }
+ fclose(f);
+ }
+ return 0;
+}
diff --git a/setedit/internac/es.po b/setedit/internac/es.po
new file mode 100644
index 0000000..ab64761
--- /dev/null
+++ b/setedit/internac/es.po
@@ -0,0 +1,7413 @@
+# Este es el archivo de traduccin a espaol.
+# Copyright (C) 2001-2005 Salvador E. Tropea.
+# Salvador E. Tropea <set@ieee.org>, 2001-2005.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: setedit 0.5.5\n"
+"PO-Revision-Date: 2007-04-24 09:37-0300\n"
+"Last-Translator: Salvador E. Tropea <set@ieee.org>\n"
+"Language-Team: Spanish <set@ieee.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+# End of header
+#. EN: E
+#: ../calcu/calcu.cc:83 ../setedit/debug.cc:5846 ../setedit/debug.cc:7750
+msgid "~E~xpression"
+msgstr "~E~xpresin"
+
+#: ../calcu/calcu.cc:89 ../setedit/debug.cc:1597
+msgid "~R~esult"
+msgstr "~R~esultado"
+
+#: ../calcu/calcu.cc:93 ../setedit/debug.cc:1602
+msgid "E~v~al"
+msgstr "E~v~aluar"
+
+#. ok->view->growMode=gfGrowAll;
+#: ../calcu/calcu.cc:96 ../easydiag/tsbutton.cc:92 ../easydiag/tsbutton.cc:101
+#: ../infview/inf.cc:2364 ../infview/inf.cc:2387 ../infview/inf.cc:2412
+#: ../infview/inf.cc:2436 ../infview/inf.cc:2491 ../infview/infmain.cc:385
+#: ../install/install.cc:476 ../install/install.cc:484 ../mainsrc/bufun.cc:741
+#: ../mainsrc/deedidia.cc:135 ../mainsrc/deedidia.cc:180
+#: ../mainsrc/deedidia.cc:272 ../mainsrc/deedidia.cc:324
+#: ../mainsrc/deedidia.cc:343 ../mainsrc/sdginter.cc:193
+#: ../mainsrc/slpinter.cc:712 ../mainsrc/tags.cc:1523 ../mainsrc/tags.cc:1751
+#: ../setedit/debug.cc:1604 ../setedit/edprefs.cc:472
+#: ../setedit/edprefs.cc:617 ../setedit/edprefs.cc:684
+#: ../setedit/edprefs.cc:913 ../setedit/intgrep.cc:421
+#: ../setedit/winlistd.cc:143 ../settvuti/diaghelp.cc:41
+msgid "Cancel"
+msgstr "Cancela"
+
+#: ../calcu/calcu.cc:99 ../infview/infmenu.cc:43 ../setedit/debug.cc:1605
+#: ../setedit/editmenu.cc:78 ../setedit/editmenu.cc:108
+msgid "~C~opy"
+msgstr "~C~opiar"
+
+#: ../calcu/calcu.cc:102 ../setedit/debug.cc:1606 ../setedit/editmenu.cc:79
+#: ../setedit/editmenu.cc:109
+msgid "~P~aste"
+msgstr "~P~egar"
+
+#: ../calcu/calcu.cc:123
+#, c-format
+msgid "Error in expression (%d)"
+msgstr "Error en la expresin (%d)"
+
+#: ../calcu/calcu.cc:165
+msgid "Calculator"
+msgstr "Calculadora"
+
+#: ../calcu/calcu.cc:176 ../setedit/editmain.cc:1516
+msgid "This functionality was disabled at compile time"
+msgstr "Esta opcin fue deshabilitada al compilar"
+
+#: ../easydiag/test.cc:327
+msgid "Sliders"
+msgstr "Deslizadores"
+
+#: ../easydiag/tsbutton.cc:91 ../easydiag/tsbutton.cc:99
+#: ../infview/infmain.cc:384 ../mainsrc/bufun.cc:740
+#: ../mainsrc/deedidia.cc:134 ../mainsrc/deedidia.cc:178
+#: ../mainsrc/deedidia.cc:271 ../mainsrc/deedidia.cc:323
+#: ../mainsrc/loaddefl.cc:713 ../mainsrc/loadusew.cc:393
+#: ../mainsrc/sdginter.cc:192 ../mainsrc/slpinter.cc:711
+#: ../mainsrc/tags.cc:1545 ../setedit/advice.cc:138 ../setedit/boardmix.cc:119
+#: ../setedit/edprefs.cc:239 ../setedit/edprefs.cc:471
+#: ../setedit/edprefs.cc:616 ../setedit/edprefs.cc:683
+#: ../setedit/edprefs.cc:912 ../setedit/intgrep.cc:420 ../setedit/tips.cc:213
+msgid "O~K~"
+msgstr "O~k~"
+
+#: ../infview/inf.cc:701
+#, c-format
+msgid "InfView - File: %s - Node: %s"
+msgstr "InfView - Archivo: %s - Nodo: %s"
+
+#: ../infview/inf.cc:882 ../infview/manview.cc:313 ../mainsrc/ceditor.cc:454
+#, c-format
+msgid "Error copying to clipboard: %s"
+msgstr "Error al copiar al portapapeles: %s"
+
+#: ../infview/inf.cc:1635
+msgid "Open Info"
+msgstr "Abrir Info"
+
+#: ../infview/inf.cc:1846
+msgid "Please wait"
+msgstr "Por favor espere"
+
+#: ../infview/inf.cc:1846
+msgid "Searching ..."
+msgstr "Buscando ..."
+
+#: ../infview/inf.cc:1964
+msgid "Sorry can't find the string"
+msgstr "Lo lamento, no puedo hallar la cadena de caracteres"
+
+#: ../infview/inf.cc:2297
+msgid "Help Control"
+msgstr "Control de la ayuda"
+
+#: ../infview/inf.cc:2300 ../infview/infmenu.cc:70 ../setedit/editmenu.cc:119
+msgid "~N~ext"
+msgstr "P~r~xima"
+
+#: ../infview/inf.cc:2303 ../infview/infmenu.cc:71 ../setedit/editmenu.cc:120
+msgid "~P~revious"
+msgstr "~A~nterior"
+
+#: ../infview/inf.cc:2306 ../setedit/editmenu.cc:396
+msgid "~U~p"
+msgstr "~A~rriba"
+
+#: ../infview/inf.cc:2309
+msgid "Prev. ~H~ist."
+msgstr "Ant. en ~H~ist."
+
+#: ../infview/inf.cc:2312
+msgid "Nodes ~L~ist"
+msgstr "~L~ista de temas"
+
+#: ../infview/inf.cc:2315 ../infview/infmenu.cc:61
+msgid "~B~ookmarks"
+msgstr "~M~arcadores"
+
+#: ../infview/inf.cc:2318 ../infview/infmenu.cc:59
+msgid "~C~onfiguration"
+msgstr "~C~onfiguracin"
+
+#: ../infview/inf.cc:2321
+msgid "~O~pen Info"
+msgstr "~A~brir Info"
+
+#: ../infview/inf.cc:2324
+msgid "H~i~de"
+msgstr "Ocu~l~tar"
+
+#: ../infview/inf.cc:2331
+msgid "Hi~s~tory"
+msgstr "Hi~s~toria"
+
+#: ../infview/inf.cc:2341
+msgid "Inf Find"
+msgstr "Bsqueda en Infos"
+
+#. All together
+#: ../infview/inf.cc:2348 ../mainsrc/deedidia.cc:119
+#: ../mainsrc/deedidia.cc:157
+msgid "~T~ext to find"
+msgstr "Texto a ~b~uscar"
+
+#: ../infview/inf.cc:2353 ../mainsrc/deedidia.cc:122
+#: ../mainsrc/deedidia.cc:164 ../mainsrc/ssyntax.cc:479
+msgid "~C~ase sensitive"
+msgstr "Mays~c~ulas y min."
+
+#: ../infview/inf.cc:2354 ../mainsrc/deedidia.cc:123
+#: ../mainsrc/deedidia.cc:164
+msgid "~W~hole words only"
+msgstr "~P~alabras completas"
+
+#: ../infview/inf.cc:2357
+msgid "In current ~t~opic"
+msgstr "En el ~i~tem actual"
+
+#: ../infview/inf.cc:2358
+msgid "In the ~f~ile"
+msgstr "En todo el ~a~rchivo"
+
+#: ../infview/inf.cc:2359
+msgid "In ~a~ll files"
+msgstr "En ~t~odos los archivos"
+
+#: ../infview/inf.cc:2362 ../infview/inf.cc:2385 ../infview/inf.cc:2408
+#: ../infview/inf.cc:2434 ../setedit/editdiag.cc:88 ../setedit/editdiag.cc:180
+#: ../setedit/editpale.cc:165 ../settvuti/diaghelp.cc:38
+msgid "~O~K"
+msgstr "~O~k"
+
+#: ../infview/inf.cc:2373
+msgid "Go To"
+msgstr "Ir a"
+
+#: ../infview/inf.cc:2380
+msgid "~N~ame of Node"
+msgstr "~N~ombre del Nodo"
+
+#. Make it growable
+#: ../infview/inf.cc:2399
+msgid "Tag Table"
+msgstr "Lista de temas"
+
+#: ../infview/inf.cc:2406
+msgid "~N~odes"
+msgstr "~N~odos"
+
+#: ../infview/inf.cc:2426
+msgid "InfView Configuration"
+msgstr "Configuracin de InfView"
+
+#: ../infview/inf.cc:2431
+msgid "Hide '*~N~ote' word"
+msgstr "Ocultar la palabra '*~N~ode'"
+
+#: ../infview/inf.cc:2432
+msgid "Hide real ~l~ink name"
+msgstr "Ocultar los nombres de los ~l~inks"
+
+#: ../infview/inf.cc:2475
+msgid "InfView Bookmarks"
+msgstr "Marcas del InfView"
+
+#: ../infview/inf.cc:2483 ../mp3/mp3list.cc:333 ../settvuti/tdiagaid.cc:168
+msgid "~A~dd"
+msgstr "~A~gregar"
+
+#: ../infview/inf.cc:2487 ../mp3/mp3list.cc:335 ../setedit/debug.cc:4308
+#: ../setedit/debug.cc:4915 ../setedit/winlistd.cc:140
+#: ../settvuti/tdiagaid.cc:170
+msgid "~D~elete"
+msgstr "~B~orrar"
+
+#: ../infview/inf.cc:2494
+msgid "~G~o to"
+msgstr "I~r~ a"
+
+#: ../infview/inf.cc:2506
+msgid "~M~arks"
+msgstr "~M~arcas"
+
+#: ../infview/infbase.cc:264
+msgid ""
+"Attention !! This file is in DOS format, Do you want to convert it?, But "
+"maybe make a backup first !!"
+msgstr ""
+"Atencin! este archivo est en formato DOS, quiere convertirlo? Haga una "
+"copia primero"
+
+#: ../infview/infbase.cc:281
+msgid "Error: can't find the Node info"
+msgstr "Error: no puedo hallar el Nodo"
+
+#: ../infview/infbase.cc:1122
+msgid "Reading index table for: "
+msgstr "Leyendo el ndice de: "
+
+#: ../infview/infbase.cc:1126
+msgid "InfView"
+msgstr "InfView"
+
+#: ../infview/infbase.cc:1295
+#, c-format
+msgid "Attention: can't open the help file '%s'."
+msgstr "Atencin: no puedo abrir el archivo de ayuda '%s'."
+
+#: ../infview/infbase.cc:1891
+msgid ""
+"\n"
+" Sorry, I can't find this link (press ALT-F1).\n"
+msgstr ""
+"\n"
+" Lo lamento, no puedo encontrar este nodo (presione ALT-F1).\n"
+
+#: ../infview/infmain.cc:352 ../setedit/edprefs.cc:869
+msgid "~A~pplication"
+msgstr "~A~plicacin"
+
+#: ../infview/infmain.cc:352 ../infview/infmain.cc:358
+#: ../infview/infmain.cc:369 ../setedit/edprefs.cc:869
+#: ../setedit/edprefs.cc:875 ../setedit/edprefs.cc:886
+#: ../setedit/edprefs.cc:894
+msgid "Force encoding"
+msgstr "Forzar codificacin"
+
+#: ../infview/infmain.cc:358 ../setedit/edprefs.cc:875
+msgid "~I~nput"
+msgstr "~E~ntrada"
+
+#: ../infview/infmain.cc:369 ../setedit/edprefs.cc:886
+msgid "~S~creen"
+msgstr "~P~antalla"
+
+#: ../infview/infmain.cc:377 ../setedit/edprefs.cc:905
+msgid "Encodings"
+msgstr "Codificaciones"
+
+#: ../infview/infmain.cc:386 ../setedit/edprefs.cc:914
+msgid "Set ~D~efaults"
+msgstr "~O~riginal"
+
+#: ../infview/infmain.cc:459 ../setedit/dstfile.cc:606
+#, c-format
+msgid "Could not create %s."
+msgstr "No puedo crear %s."
+
+#: ../infview/infmain.cc:506 ../setedit/dstfile.cc:531
+msgid "Could not open desktop file"
+msgstr "No puedo abrir el archivo del escritorio"
+
+#: ../infview/infmain.cc:511
+msgid "Wrong desktop file"
+msgstr "Archivo de escritorio incorrecto."
+
+#: ../infview/infmain.cc:517 ../setedit/dstfile.cc:542
+msgid "Error reading desktop file"
+msgstr "Error al leer el archivo de escritorio"
+
+#: ../infview/infmain.cc:662
+#, c-format
+msgid "InfView v"
+msgstr "InfView v"
+
+#: ../infview/infmain.cc:663
+#, c-format
+msgid ""
+"infview [option]... [info_file [menu_item...]]\n"
+"\n"
+msgstr ""
+"infview [opcin]... [archivo_info [item_del_menu...]]\n"
+"\n"
+
+#: ../infview/infmain.cc:664 ../setedit/editmain.cc:2905
+#, c-format
+msgid "Valid options are:\n"
+msgstr "Las opciones disponibles son:\n"
+
+#: ../infview/infmain.cc:665
+#, c-format
+msgid ""
+"-d, --directory DIR adds a directory to the list of directories to "
+"search\n"
+" (DIR to INFOPATH)\n"
+msgstr ""
+"-d, --directorio DIR agrega el directorio especificado a la lista de\n"
+" directorios a buscar (DIR a INFOPATH)\n"
+
+#: ../infview/infmain.cc:667
+#, c-format
+msgid "-f, --file FILENAME load FILENAME info file.\n"
+msgstr "-f, --file NOMBRE_ARCH abre la ayuda NOMBRE_ARCH.\n"
+
+#: ../infview/infmain.cc:669
+#, c-format
+msgid "-l, --force-no-lfn avoids the use of long file names under W9x.\n"
+msgstr "-l, --force-no-lfn evita el uso de nombres largos en W9x.\n"
+
+#: ../infview/infmain.cc:670
+#, c-format
+msgid "-L, --force-lfn forces the use of long file names under W9x.\n"
+msgstr "-L, --force-lfn fuerza el uso de nombres largos en W9x.\n"
+
+#: ../infview/infmain.cc:672
+#, c-format
+msgid ""
+"-k, --use-rh-52-keys enables the Red Hat 5.2 style keyboard mapping.\n"
+msgstr ""
+"-k, --use-rh-52-keys habilita el mapeo de teclado usado en Red Hat 5.2.\n"
+
+#: ../infview/infmain.cc:674
+#, c-format
+msgid "-n, --node NODE jumps to this node.\n"
+msgstr "-n, --node NODO salta a este nodo.\n"
+
+#: ../infview/infmain.cc:675
+#, c-format
+msgid "-r, --read-dkt FILENAME if no file is opened use this desktop file.\n"
+msgstr ""
+"-r, --read-dkt NOMBREAR si no se especific abrir ninguna ayuda abrir el\n"
+" archivo de escritorio NOMBREAR\n"
+
+#: ../infview/infmain.cc:676
+#, c-format
+msgid "-s, --save-dkt FILENAME save the desktop to this file at exit.\n"
+msgstr ""
+"-s, --save-dkt NOMBREAR grabar el archivo de escritorio como NOMBREAR.\n"
+
+#: ../infview/infmain.cc:677
+#, c-format
+msgid ""
+"-h, --help displays this text ;-).\n"
+"\n"
+msgstr ""
+"-h, --help muestra este texto ;-).\n"
+"\n"
+
+#: ../infview/infmain.cc:678
+#, c-format
+msgid ""
+"The first argument, if present, is the name of the Info file to read.\n"
+"Any remaining arguments are treated as the names of menu items in the "
+"initial\n"
+msgstr ""
+"El primer parmetro, si fue indicado, es el nombre del .info a leer.\n"
+"Los parmetros siguientes indican el nombre de opciones del men de los\n"
+
+#: ../infview/infmain.cc:681
+#, c-format
+msgid ""
+"node visited. For example, `infview libc \"function index\" printf' moves "
+"to the\n"
+"node `Function Index' and then to `printf' in the info file `libc'.\n"
+"\n"
+msgstr ""
+"nodos visitados. Por ejemplo: `infview libc \"function index\" printf' salta "
+"a\n"
+"el nodo `Function Index' y luego a `printf' del .info `libc'.\n"
+"\n"
+
+#: ../infview/infmain.cc:684
+#, c-format
+msgid ""
+"node visited. For example, `infview libc alpha printf' moves to the node\n"
+"`Alphabetical list' and then to `printf' in the info file `libc'.\n"
+"\n"
+msgstr ""
+"nodos visitados. Por ejemplo: `infview libc alpha printf' salta al nodo\n"
+"`Alphabetical list' y luego al `printf' del .info `libc'.\n"
+"\n"
+
+#: ../infview/infmain.cc:687
+#, c-format
+msgid ""
+"Also note that info files are searched in the INFOPATH directories. To load "
+"a\n"
+"file stored in the current directory add ./ at the beginning of the name.\n"
+"Email bug reports to salvador@inti.gov.ar or djgpp@delorie.com.\n"
+msgstr ""
+"Note que los .info se buscan en los directorios indicados por INFOPATH.\n"
+"Para cargar uno del directorio actual agregue ./ al comienzo del nombre.\n"
+"Reporte errores a salvador@inti.gov.ar o djgpp@delorie.com.\n"
+
+#: ../infview/infmain.cc:937
+#, c-format
+msgid "Could not find '%s'."
+msgstr "No pude encontrar '%s'."
+
+#. Spanish: ABCEHMPRV
+#. English: CEFHMPSVW
+#: ../infview/infmenu.cc:31 ../setedit/editmenu.cc:60
+msgid "~F~ile"
+msgstr "~A~rchivo"
+
+#: ../infview/infmenu.cc:32
+msgid "~N~ew InfView window"
+msgstr "~N~ueva ventana de InfView"
+
+#: ../infview/infmenu.cc:33
+msgid "~O~pen info file"
+msgstr "~A~brir un .info"
+
+#: ../infview/infmenu.cc:34
+msgid "Open ~m~anpage"
+msgstr "Abrir una pgina del ~m~anual"
+
+#: ../infview/infmenu.cc:36
+msgid "~D~OS shell"
+msgstr "Ir a ~D~OS"
+
+#: ../infview/infmenu.cc:38 ../setedit/editmenu.cc:69
+#: ../setedit/editmenu.cc:312
+msgid "S~h~ell"
+msgstr "~L~nea de comandos"
+
+#: ../infview/infmenu.cc:40 ../mainsrc/tags.cc:1810 ../setedit/debug.cc:4305
+#: ../setedit/debug.cc:4912 ../setedit/editmenu.cc:70
+msgid "E~x~it"
+msgstr "~S~alir"
+
+#: ../infview/infmenu.cc:42 ../mainsrc/loaddefl.cc:712
+#: ../mainsrc/loadusew.cc:392 ../setedit/editmenu.cc:73
+msgid "~E~dit"
+msgstr "~E~ditar"
+
+#: ../infview/infmenu.cc:45
+msgid "~G~oto"
+msgstr "I~r~ a"
+
+#: ../infview/infmenu.cc:46
+msgid "Goto: (~F~ile)Node"
+msgstr "~I~r a: (Archivo)Nodo"
+
+#: ../infview/infmenu.cc:47
+msgid "~N~ode list"
+msgstr "~L~ista de nodos"
+
+#: ../infview/infmenu.cc:48
+msgid "N~e~xt node"
+msgstr "~P~rximo nodo"
+
+#: ../infview/infmenu.cc:49
+msgid "~P~revious node"
+msgstr "Nodo ~a~nterior"
+
+#: ../infview/infmenu.cc:50
+msgid "~U~pper node"
+msgstr "Nodo ~s~uperior"
+
+#: ../infview/infmenu.cc:51
+msgid "~T~op node"
+msgstr "~N~odo principal"
+
+#: ../infview/infmenu.cc:52
+msgid "~D~irectory"
+msgstr "~D~irectorio de ayudas"
+
+#: ../infview/infmenu.cc:54 ../infview/infmenu.cc:55 ../setedit/editmenu.cc:93
+msgid "~S~earch"
+msgstr "~B~uscar"
+
+#: ../infview/infmenu.cc:56
+msgid "Search ~a~gain"
+msgstr "~R~epetir bsqueda"
+
+#: ../infview/infmenu.cc:58
+msgid "~I~nfview"
+msgstr "~I~nfView"
+
+#: ../infview/infmenu.cc:60
+msgid "~H~istory"
+msgstr "Hi~s~toria"
+
+#: ../infview/infmenu.cc:62
+msgid "~S~creen configuration"
+msgstr "Configuracin de ~p~antalla"
+
+#: ../infview/infmenu.cc:63
+msgid "~A~bout"
+msgstr "~A~cerca de"
+
+#: ../infview/infmenu.cc:65 ../setedit/editmenu.cc:114
+msgid "~W~indows"
+msgstr "~V~entana"
+
+#: ../infview/infmenu.cc:66 ../setedit/editmenu.cc:115
+msgid "~S~ize/move"
+msgstr "Tamao/Po~s~icin"
+
+#: ../infview/infmenu.cc:67 ../setedit/editmenu.cc:116
+msgid "~Z~oom"
+msgstr "~Z~oom"
+
+#: ../infview/infmenu.cc:68 ../setedit/editmenu.cc:117
+msgid "~T~ile"
+msgstr "~M~osaico"
+
+#: ../infview/infmenu.cc:69 ../setedit/editmenu.cc:118
+msgid "C~a~scade"
+msgstr "~C~ascada"
+
+#: ../infview/infmenu.cc:72 ../setedit/editmenu.cc:121
+#: ../setedit/editmenu.cc:139
+msgid "~C~lose"
+msgstr "C~e~rrar"
+
+#: ../infview/infmenu.cc:83 ../setedit/editmenu.cc:173
+msgid "~Alt+F1~ Back"
+msgstr "~Alt+F1~ Atras"
+
+#: ../infview/infmenu.cc:84 ../setedit/editmenu.cc:174
+msgid "~Alt+F10~ Control"
+msgstr "~Alt+F10~ Control"
+
+#: ../infview/infmenu.cc:85 ../setedit/editmenu.cc:183
+#: ../setedit/editmenu.cc:202 ../setedit/editmenu.cc:205
+msgid "~F1~ Help"
+msgstr "~F1~ Ayuda"
+
+#: ../infview/infmenu.cc:86
+msgid "~Ctrl+O~ Index"
+msgstr "~Ctrl+O~ Indice"
+
+#: ../infview/infmenu.cc:87 ../infview/infmenu.cc:89
+#: ../setedit/editmenu.cc:164 ../setedit/editmenu.cc:188
+#: ../setedit/editmenu.cc:206
+msgid "~F5~ Zoom"
+msgstr "~F5~ Zoom"
+
+#: ../infview/infmenu.cc:90 ../setedit/editmenu.cc:165
+msgid "~F6~ Next"
+msgstr "~F6~ Prxima"
+
+#: ../infview/infmenu.cc:91 ../setedit/editmenu.cc:166
+msgid "~F10~ Menu"
+msgstr "~F10~ Men"
+
+#: ../infview/infmenu.cc:98 ../setedit/editmenu.cc:213
+msgid "Not enough memory for this operation."
+msgstr "No hay suficiente memoria para esta operacin."
+
+#: ../infview/manview.cc:304 ../mainsrc/ceditor.cc:447
+#: ../mainsrc/ceditor.cc:521
+msgid "Sorry but no OS specific clipboard is available"
+msgstr "Lo lamento pero no hay ningn portapapeles del sistema disponible"
+
+#: ../infview/manview.cc:751
+msgid "You must install man to use it!"
+msgstr "Debe instalar el programa man para usar esto!"
+
+#: ../infview/manview.cc:780
+msgid "Man page to view"
+msgstr "Visor de pginas del manual"
+
+#: ../infview/manview.cc:783
+msgid "~M~an page for ..."
+msgstr "~P~gina del manual para ..."
+
+#: ../infview/manview.cc:784
+msgid "~S~ection"
+msgstr "~S~eccin"
+
+#: ../infview/manview.cc:785
+msgid "~E~xtra options"
+msgstr "Opciones ~e~xtra"
+
+#: ../install/install.cc:148
+msgid "Type of installation"
+msgstr "Tipo de instalacin"
+
+#: ../install/install.cc:149
+msgid "Destination directory"
+msgstr "Directorio de destino"
+
+#: ../install/install.cc:150
+msgid "Miscellaneous options"
+msgstr "Opciones varias"
+
+#: ../install/install.cc:151
+msgid "Add a direct access to the desktop"
+msgstr "Agregar un acceso directo al escritorio"
+
+#: ../install/install.cc:152
+msgid "Add setedit to the Start\\Programs menu"
+msgstr "Agregar setedit al men Inicio\\Programas"
+
+#: ../install/install.cc:153
+msgid "Configure the editor's menu like in Win. programs (eg. ^C=copy)"
+msgstr "Configurar el men como en los programas Windows (ej.^C=copiar)"
+
+#: ../install/install.cc:154
+msgid "Extra screen savers (around 160 Kb)"
+msgstr "Salva pantallas extra (aprox. 160 Kb)"
+
+#: ../install/install.cc:155
+msgid "Desktop files"
+msgstr "Archivos de escritorio"
+
+#: ../install/install.cc:156
+msgid ""
+"The editor stores configuration options in files called desktop files. These "
+"files also store information about what files are opened and the size, "
+"position, etc. of the windows. You can have only one global file for this or "
+"one in each directory you use the editor in. Which option do you prefer?"
+msgstr ""
+"El editor guarda las opciones de configuracin en archivos llamados de "
+"escritorio. Estos archivos guardan informacin acerca de los archivos "
+"abiertos y el tamao, posicin, etc. de las ventanas. Ud. puede tener slo "
+"uno de estos archivos o bien uno en cada directorio donde use el editor. "
+"Qu prefiere?"
+
+#: ../install/install.cc:160
+msgid "A desktop file in each directory"
+msgstr "Uno en cada directorio"
+
+#: ../install/install.cc:161
+msgid "One central desktop file."
+msgstr "Uno nico centralizado."
+
+#: ../install/install.cc:162
+msgid "Indent using..."
+msgstr "Indentar usando..."
+
+#: ../install/install.cc:163
+msgid ""
+"The editor is set by default to indent text using spaces. To configure the "
+"editor to use tabs more than one option must be selected. What do you want "
+"to use for indentation?"
+msgstr ""
+"El editor viene configurado para indentar el texto usando espacios. Para "
+"configurarlo usando tabs ms de una opcin debe ser seleccionada. Qu desea "
+"usar para indentar?"
+
+#: ../install/install.cc:166
+msgid "Spaces"
+msgstr "Espacios"
+
+#: ../install/install.cc:167
+msgid "Tabs"
+msgstr "Tabs"
+
+#: ../install/install.cc:168
+msgid "Backup files"
+msgstr "Archivos de respaldo"
+
+#: ../install/install.cc:169
+msgid ""
+"Each time the editor stores a modified file to disk a backup file can be "
+"created in case you want to revert the changes. This is especially useful "
+"when you already exited the editor and hence the undo option isn't "
+"available. Do you want to create backup files?"
+msgstr ""
+"Cada vez que el editor guarda en disco un archivo modificado es posible "
+"crear un respaldo en caso de que desee revertir los cambios. Esto es "
+"especialmente til cuando ya salin del editor y por lo tanto no se puede "
+"usar la opcin deshacer. Desea crear archivos de respaldo?"
+
+#: ../install/install.cc:173
+msgid "No"
+msgstr "No"
+
+#: ../install/install.cc:174
+msgid "Yes, create backup files"
+msgstr "Si, crear archivos de respaldo"
+
+#: ../install/install.cc:332
+#, c-format
+msgid "Can't create the directory: %s"
+msgstr "No puedo crear el directorio: %s"
+
+#: ../install/install.cc:339
+#, c-format
+msgid "File name in path: %s"
+msgstr "Nombre de archivo en la ruta: %s"
+
+#: ../install/install.cc:390
+msgid ""
+"~Ctrl-F4~ Finish editing, or click on the button found in the top left corner"
+msgstr ""
+"~Ctrl-F4~ Terminar, o haga click en el botn del ngulo superior izquierdo"
+
+#: ../install/install.cc:393
+msgid "~ESC~ Aborts installation"
+msgstr "~ESC~ Aborta la instalacin"
+
+#: ../install/install.cc:433
+msgid "Are you sure you want to abort the installation?"
+msgstr "Esta seguro que desea abortar la instalacin?"
+
+#: ../install/install.cc:437
+msgid "Select the type"
+msgstr "Seleccione el tipo"
+
+#: ../install/install.cc:438 ../internac/colors.cc:4 ../internac/colors.cc:197
+msgid "Normal"
+msgstr "Normal"
+
+#: ../install/install.cc:439
+msgid "For programmers"
+msgstr "Para programadores"
+
+#: ../install/install.cc:440
+msgid "For djgpp programmers"
+msgstr "Para programadores con djgpp"
+
+#: ../install/install.cc:465
+msgid ""
+"Looks like djgpp isn't installed. DJGPP environment variable isn't defined "
+"or is wrong. Exit to fix it first?"
+msgstr ""
+"Parece que djgpp no est instalado. La variable de entorno DJGPP no est "
+"definida o est mal definida. Desea arreglar esto antes de instalar?"
+
+#: ../install/install.cc:474
+msgid "< ~P~rev"
+msgstr "< ~A~nterior"
+
+#: ../install/install.cc:475
+msgid "> ~N~ext"
+msgstr "> P~r~xima"
+
+#: ../install/install.cc:482 ../mainsrc/deedidia.cc:340
+#: ../setedit/advice.cc:127 ../setedit/advice.cc:134
+msgid "~Y~es"
+msgstr "~S~i"
+
+#: ../install/install.cc:483 ../mainsrc/deedidia.cc:341
+#: ../setedit/advice.cc:128 ../setedit/advice.cc:133
+msgid "~N~o"
+msgstr "~N~o"
+
+#: ../install/install.cc:518
+msgid "Where do you want to install the editor?"
+msgstr "Donde desea instalar el editor?"
+
+#: ../install/install.cc:547
+msgid "Invalid drive"
+msgstr "Disco invlido"
+
+#: ../install/install.cc:553
+msgid "Can't create files there"
+msgstr "No puedo crear archivos en ese lugar"
+
+#: ../install/install.cc:559
+msgid ""
+"You already installed the editor (or tried to), but in a different place. Do "
+"you want to continue?"
+msgstr ""
+"Ud. ya ha instalado el editor (o al menos intent), pero en un lugar "
+"diferente. Desea continuar?"
+
+#: ../install/install.cc:649
+msgid "Searching Windows information"
+msgstr "Buscando informacin de Windows"
+
+#: ../install/install.cc:651
+msgid ""
+"Windows 9x or similar detected, wait while\n"
+"finding information about your system"
+msgstr ""
+"Windows 9x o similar fue detectado, por favor\n"
+"espere mientras busco informacin sobre su sistema"
+
+#: ../install/install.cc:652 ../install/install.cc:669
+msgid "Looking in registry "
+msgstr "Buscando en el registro "
+
+#: ../install/install.cc:664
+msgid "Searching programs dir"
+msgstr "Buscando el directorio de programas"
+
+#: ../install/install.cc:672
+msgid "Searching desktop and menu"
+msgstr "Buscando el escritorio y el men "
+
+#: ../install/install.cc:854
+msgid " Normal"
+msgstr " Normal"
+
+#: ../install/install.cc:857
+msgid " For programmers"
+msgstr " Para programadores"
+
+#. instDJGPP
+#: ../install/install.cc:860
+msgid " For djgpp programmers"
+msgstr " Para programadores con djgpp"
+
+#: ../install/install.cc:901
+msgid "Are these options correct?"
+msgstr "Son correctas estas opciones?"
+
+#. Put some message to left space for the file names
+#: ../install/install.cc:1004
+msgid "Installing"
+msgstr "Instalando"
+
+#: ../install/install.cc:1004
+msgid "Installing files for the editor"
+msgstr "Instalando archivos del editor"
+
+#: ../install/install.cc:1014
+#, c-format
+msgid "Unable to uncompress %s, most probably this file is damaged"
+msgstr ""
+"No puedo descomprimir %s, lo ms probable es que el archivo este daado"
+
+#: ../install/install.cc:1044
+msgid "Replacing default menu"
+msgstr "Reemplazando el men original"
+
+#: ../install/install.cc:1057
+msgid "Unable to uncompress files, most probably this file is damaged"
+msgstr "No puedo descomprimir archivos, probablemente esten daados"
+
+#: ../install/install.cc:1105
+msgid "Adding icon to desktop"
+msgstr "Agregando un cono al escritorio"
+
+#: ../install/install.cc:1120
+msgid "Adding icon to menu"
+msgstr "Agregando un cono al men"
+
+#: ../install/install.cc:1136
+msgid "Simplifying configuration"
+msgstr "Simplificando la configuracin"
+
+#: ../install/install.cc:1196
+msgid ""
+"You defined SET_FILES environment variable in a way that isn't compatible "
+"with the installer, be careful"
+msgstr ""
+"Ud. defini la variable de entorno SET_FILES de una manera que es "
+"incompatible con el instalador, tenga cuidado!"
+
+#: ../install/install.cc:1276
+msgid "You modified the autoexec.bat. Do you want to save the changes?"
+msgstr "El autoexec.bat fue modificado. Desea guardar los cambios?"
+
+#: ../install/install.cc:1312
+msgid "Instructions for editing"
+msgstr "Instrucciones para editar"
+
+#: ../install/install.cc:1313
+msgid ""
+"Now I'll give you the opportunity to edit the autoexec.bat. To finish click "
+"in the small rectangle found in the top-left corner or press Ctrl+F4."
+msgstr ""
+"Ahora ud. podr editar el autoexec.bat. Para terminar haga click en el "
+"pequeo rectngulo hubicado en el el ngulo superior izquierdo o presione "
+"Ctrl+F4"
+
+#: ../install/install.cc:1318
+msgid ""
+"I added the needed command, it is marked with a comment. Please don't remove "
+"the comment it's used to know where the text was added by the installer."
+msgstr ""
+"El comando necesario fue agregado y est marcado con un comentario. Por "
+"favor no quite este comentario ya que es necesario para saber donde est "
+"hubicado."
+
+#: ../install/install.cc:1323
+msgid "The text I suggest to add is currently in the clipboard."
+msgstr "El texto que le sugiero agregar se encuentra en el porta papeles."
+
+#: ../install/install.cc:1326
+msgid ""
+"You can move lines using:\n"
+"Shift + arrows keys: Select text\n"
+"Ctrl+Insert: Copy to the clipboard\n"
+"Ctrl+Delete: Delete a block\n"
+"Shift+Insert: Paste from the clipboard\n"
+"Shift+Delete: Copy to clipboard and then delete the block\n"
+"Ctrl+U: Undo (only one action)"
+msgstr ""
+"Ud. puede mover lneas usando:\n"
+"Shift + flechas: Seleccionar texto\n"
+"Ctrl+Insertar: Copiar al porta papeles\n"
+"Ctrl+Suprimir: Borrar un bloque\n"
+"Shift+Insertar: Pegar desde el porta papeles\n"
+"Shift+Suprimir: Copia al porta papeles y borra el bloque\n"
+"Ctrl+U: Deshacer (solo una accin)"
+
+#: ../install/install.cc:1329 ../mp3/mp3list.cc:338 ../setedit/edkeys.cc:581
+#: ../setedit/edprint.cc:706 ../settvuti/tdiagaid.cc:171
+msgid "~O~k"
+msgstr "~O~k"
+
+#: ../install/install.cc:1392
+msgid "Edit autoexec.bat yourself later"
+msgstr "Hacerlo ud. editando el autoexec.bat luego"
+
+#: ../install/install.cc:1393
+msgid "Do it yourself but now"
+msgstr "Hacerlo ud. ahora"
+
+#: ../install/install.cc:1394
+msgid "Let me do it and show you the result"
+msgstr "Dejar que yo lo haga y le muestre el resultado"
+
+#: ../install/install.cc:1395
+msgid "Let me do it and don't show you the result"
+msgstr "Dejar que yo lo haga sin mostrarselo"
+
+#: ../install/install.cc:1396
+msgid "Select how to do it"
+msgstr "Seleccione como hacerlo"
+
+#: ../install/install.cc:1402
+msgid "Error creating autoexec.bat"
+msgstr "Error al crear el autoexec.bat"
+
+#: ../install/install.cc:1419
+msgid "Configuring the system"
+msgstr "Configurando el sistema"
+
+#: ../install/install.cc:1421
+msgid ""
+"The editor was succesfully installed, now you must add the directory\n"
+"where the editor was installed to your PATH, like this:"
+msgstr ""
+"El editor fue exitosamente instalado, ahora debe agregar el directorio\n"
+"donde el editor fue instalado a su PATH de esta manera:"
+
+#: ../install/install.cc:1451
+msgid "Sorry, I can't find autoexec.bat"
+msgstr "Lo lamento, no puedo hallar el autoexec.bat"
+
+#: ../install/install.cc:1466
+msgid "Can't backup autoexec.bat. You'll have to do it by yourself"
+msgstr ""
+"No puedo crear una copia de resplado del autoexec.bat, deber hacer los "
+"cambios manualmente"
+
+#: ../install/install.cc:1510
+msgid "Can't create temporal copy of autoexec.bat"
+msgstr "No puedo crear una copia temporal del autoexec.bat"
+
+#: ../install/install.cc:1523
+msgid "A copy of the original autoexec.bat was stored in autoexec.bak"
+msgstr "Una copia del autoexec.bat original fue guardada como autoexec.bak"
+
+#: ../install/install.cc:1571
+msgid "SET Edit installer v1.10, copyright (c) 1999-2003 by Salvador E. Tropea"
+msgstr ""
+"Instalador de SET Edit v1.10, copyright (c) 1999-2003 by Salvador E. Tropea"
+
+#: ../install/install.cc:1576
+msgid "Failed, disabling all or part of the Win9x specific stuff"
+msgstr "Error, deshabilitando todo o parte del soporte especfico para Win9x"
+
+#: ../install/install.cc:1624
+msgid "Don't forget to update your autoexec.bat later!"
+msgstr "No olvide actualizar su autoexec.bat ms tarde!"
+
+#: ../install/install.cc:1626
+msgid ", after rebooting your system you'll be able to use the editor"
+msgstr ", luego de reinicializar su sistem ud. podr usarlo"
+
+#: ../install/install.cc:1627
+#, c-format
+msgid "Editor installed successfully%s. Run it using e.bat"
+msgstr "Editor instalado con xito%s. Invquelo usando e.bat"
+
+#: ../internac/colors.cc:1 ../setedit/editpale.cc:155
+msgid "Color"
+msgstr "Color"
+
+#: ../internac/colors.cc:3
+msgid "Desktop"
+msgstr "Escritorio"
+
+#: ../internac/colors.cc:6
+msgid "Menus"
+msgstr "Menues"
+
+#: ../internac/colors.cc:7
+msgid "Disabled"
+msgstr "Deshabilitado"
+
+#: ../internac/colors.cc:8
+msgid "Shortcut"
+msgstr "Tecla aceleradora"
+
+#: ../internac/colors.cc:9 ../internac/colors.cc:199
+msgid "Selected"
+msgstr "Seleccionado"
+
+#: ../internac/colors.cc:10
+msgid "Selected disabled"
+msgstr "Seleccionado y deshab."
+
+#: ../internac/colors.cc:11
+msgid "Shortcut selected"
+msgstr "Tecla del seleccionado"
+
+#: ../internac/colors.cc:12 ../internac/colors.cc:22 ../internac/colors.cc:32
+#: ../internac/colors.cc:42 ../internac/colors.cc:148
+#: ../internac/colors.cc:160 ../internac/colors.cc:175
+#: ../internac/colors.cc:190
+msgid "Frame disabled"
+msgstr "Marco deshabilitado"
+
+#: ../internac/colors.cc:14
+msgid "Blue Windows"
+msgstr "Ventanas Azules"
+
+#: ../internac/colors.cc:15 ../internac/colors.cc:25 ../internac/colors.cc:35
+#: ../internac/colors.cc:45 ../internac/colors.cc:151
+#: ../internac/colors.cc:163 ../internac/colors.cc:178
+#: ../internac/colors.cc:193
+msgid "Frame"
+msgstr "Marco"
+
+#: ../internac/colors.cc:16 ../internac/colors.cc:26 ../internac/colors.cc:36
+#: ../internac/colors.cc:46 ../internac/colors.cc:152
+#: ../internac/colors.cc:164 ../internac/colors.cc:179
+#: ../internac/colors.cc:194
+msgid "Frame icons"
+msgstr "Iconos marcos"
+
+#: ../internac/colors.cc:17 ../internac/colors.cc:27 ../internac/colors.cc:37
+#: ../internac/colors.cc:47 ../internac/colors.cc:153
+#: ../internac/colors.cc:165 ../internac/colors.cc:180
+#: ../internac/colors.cc:195
+msgid "Scroll bar page"
+msgstr "Pg. barra desplazamiento"
+
+#: ../internac/colors.cc:18 ../internac/colors.cc:28 ../internac/colors.cc:38
+#: ../internac/colors.cc:48 ../internac/colors.cc:154
+#: ../internac/colors.cc:166 ../internac/colors.cc:181
+#: ../internac/colors.cc:196
+msgid "Scroll bar icons"
+msgstr "Iconos barra desplazamiento"
+
+#: ../internac/colors.cc:19 ../internac/colors.cc:29 ../internac/colors.cc:39
+#: ../internac/colors.cc:49 ../internac/colors.cc:167
+msgid "Static text"
+msgstr "Texto esttico"
+
+#: ../internac/colors.cc:20 ../internac/colors.cc:30 ../internac/colors.cc:40
+#: ../internac/colors.cc:168
+msgid "Selected text"
+msgstr "Texto seleccionado"
+
+#: ../internac/colors.cc:21
+msgid "reserved"
+msgstr "reservado"
+
+#: ../internac/colors.cc:24
+msgid "Cyan Windows"
+msgstr "Ventanas Cian"
+
+#: ../internac/colors.cc:31 ../internac/colors.cc:41 ../internac/colors.cc:75
+#: ../internac/colors.cc:145 ../internac/colors.cc:146
+#: ../internac/colors.cc:147 ../internac/colors.cc:171
+#: ../internac/colors.cc:172 ../internac/colors.cc:173
+#: ../internac/colors.cc:174 ../internac/colors.cc:187
+#: ../internac/colors.cc:188 ../internac/colors.cc:189
+msgid "Reserved"
+msgstr "Reservado"
+
+#: ../internac/colors.cc:34
+msgid "Gray Windows"
+msgstr "Ventanas Grises"
+
+#: ../internac/colors.cc:44
+msgid "Dialogs"
+msgstr "Dilogos"
+
+#: ../internac/colors.cc:50
+msgid "Label normal"
+msgstr "Etiqueta normal"
+
+#: ../internac/colors.cc:51
+msgid "Label selected"
+msgstr "Etiqueta seleccionada"
+
+#: ../internac/colors.cc:52
+msgid "Label shortcut"
+msgstr "Tecla de la etiqueta"
+
+#: ../internac/colors.cc:53
+msgid "Button normal"
+msgstr "Botn normal"
+
+#: ../internac/colors.cc:54
+msgid "Button default"
+msgstr "Botn por defecto"
+
+#: ../internac/colors.cc:55
+msgid "Button selected"
+msgstr "Botn seleccionado"
+
+#: ../internac/colors.cc:56
+msgid "Button disabled"
+msgstr "Botn deshabilitado"
+
+#: ../internac/colors.cc:57
+msgid "Button shortcut"
+msgstr "Tecla del botn"
+
+#: ../internac/colors.cc:58
+msgid "Button shadow"
+msgstr "Sombra del botn"
+
+#: ../internac/colors.cc:59
+msgid "Cluster normal"
+msgstr "Grupo normal"
+
+#: ../internac/colors.cc:60
+msgid "Cluster selected"
+msgstr "Grupo seleccionado"
+
+#: ../internac/colors.cc:61
+msgid "Cluster shortcut"
+msgstr "Tecla del grupo"
+
+#: ../internac/colors.cc:62
+msgid "Input normal"
+msgstr "Ingreso normal"
+
+#: ../internac/colors.cc:63
+msgid "Input selected"
+msgstr "Ingreso seleccionado"
+
+#: ../internac/colors.cc:64
+msgid "Input arrow"
+msgstr "Flecha del ingreso"
+
+#: ../internac/colors.cc:65
+msgid "History button"
+msgstr "Botn del histrico"
+
+#: ../internac/colors.cc:66
+msgid "History sides"
+msgstr "Lados del histrico"
+
+#: ../internac/colors.cc:67
+msgid "History bar page"
+msgstr "Pg. barra del histrico"
+
+#: ../internac/colors.cc:68
+msgid "History bar icons"
+msgstr "Iconos del histrico"
+
+#: ../internac/colors.cc:69
+msgid "List normal"
+msgstr "Lista normal"
+
+#: ../internac/colors.cc:70
+msgid "List focused"
+msgstr "Lista: foco"
+
+#: ../internac/colors.cc:71
+msgid "List selected"
+msgstr "Lista: seleccionado"
+
+#: ../internac/colors.cc:72
+msgid "List divider"
+msgstr "Lista: divisor"
+
+#: ../internac/colors.cc:73
+msgid "Information pane"
+msgstr "Panel de informacin"
+
+#: ../internac/colors.cc:74
+msgid "Cluster disabled"
+msgstr "Grupo deshabilitado"
+
+#: ../internac/colors.cc:76 ../internac/colors.cc:96 ../internac/colors.cc:116
+#: ../internac/colors.cc:155
+msgid "Normal text"
+msgstr "Texto normal"
+
+#: ../internac/colors.cc:78
+msgid "Blue Editor"
+msgstr "Editores Azules"
+
+#: ../internac/colors.cc:79 ../internac/colors.cc:99 ../internac/colors.cc:119
+#: ../internac/colors.cc:159
+msgid "Marked text"
+msgstr "Texto marcado"
+
+#: ../internac/colors.cc:80 ../internac/colors.cc:100
+#: ../internac/colors.cc:120
+msgid "Comment"
+msgstr "Comentarios"
+
+#: ../internac/colors.cc:81 ../internac/colors.cc:101
+#: ../internac/colors.cc:121
+msgid "Reserved word"
+msgstr "Palabras reservadas"
+
+#: ../internac/colors.cc:82 ../internac/colors.cc:102
+#: ../internac/colors.cc:122
+msgid "Identifier"
+msgstr "Identificador"
+
+#: ../internac/colors.cc:83 ../internac/colors.cc:103
+#: ../internac/colors.cc:123
+msgid "Symbol"
+msgstr "Smbolo"
+
+#: ../internac/colors.cc:84 ../internac/colors.cc:104
+#: ../internac/colors.cc:124
+msgid "String"
+msgstr "Cadenas de caracteres"
+
+#: ../internac/colors.cc:85 ../internac/colors.cc:105
+#: ../internac/colors.cc:125
+msgid "Integer"
+msgstr "Enteros"
+
+#: ../internac/colors.cc:86 ../internac/colors.cc:106
+#: ../internac/colors.cc:126
+msgid "Float"
+msgstr "Coma flotante"
+
+#: ../internac/colors.cc:87 ../internac/colors.cc:107
+#: ../internac/colors.cc:127
+msgid "Octal"
+msgstr "Octales"
+
+#: ../internac/colors.cc:88 ../internac/colors.cc:108
+#: ../internac/colors.cc:128
+msgid "Hex"
+msgstr "Hexadecimales"
+
+#: ../internac/colors.cc:89 ../internac/colors.cc:109
+#: ../internac/colors.cc:129
+msgid "Character"
+msgstr "Caracteres"
+
+#: ../internac/colors.cc:90 ../internac/colors.cc:110
+#: ../internac/colors.cc:130
+msgid "Preprocessor"
+msgstr "Preprocesador"
+
+#: ../internac/colors.cc:91 ../internac/colors.cc:111
+#: ../internac/colors.cc:131
+msgid "Illegal char"
+msgstr "Valores incorrectos"
+
+#: ../internac/colors.cc:92 ../internac/colors.cc:112
+#: ../internac/colors.cc:132
+msgid "User defined words"
+msgstr "Palabras definidas usuario"
+
+#: ../internac/colors.cc:93 ../internac/colors.cc:113
+#: ../internac/colors.cc:133
+msgid "CPU line"
+msgstr "Lnea de CPU"
+
+#: ../internac/colors.cc:94 ../internac/colors.cc:114
+#: ../internac/colors.cc:134
+msgid "Breakpoint"
+msgstr "Breakpoint"
+
+#: ../internac/colors.cc:95 ../internac/colors.cc:115
+#: ../internac/colors.cc:135
+msgid "Symbol2"
+msgstr "Smbolos 2"
+
+#: ../internac/colors.cc:98
+msgid "Cyan Editor"
+msgstr "Editores Cian"
+
+#: ../internac/colors.cc:118
+msgid "Gray Editor"
+msgstr "Editores Grises"
+
+#: ../internac/colors.cc:136
+msgid "Cross cursor"
+msgstr "Cursor en cruz"
+
+#: ../internac/colors.cc:138
+msgid "Specials for editors"
+msgstr "Especiales para editores"
+
+#: ../internac/colors.cc:139
+msgid "Editor statusline"
+msgstr "Lnea de estado editores"
+
+#: ../internac/colors.cc:140
+msgid "Parens matching"
+msgstr "Par complementario"
+
+#: ../internac/colors.cc:141
+msgid "Rectangle block"
+msgstr "Bloque rectangular"
+
+#: ../internac/colors.cc:142
+msgid "Odd tab"
+msgstr "Tab impar"
+
+#: ../internac/colors.cc:143
+msgid "Even tab"
+msgstr "Tab par"
+
+#: ../internac/colors.cc:144 ../mainsrc/deedidia.cc:266
+#: ../mainsrc/deedidia.cc:318
+msgid "Column markers"
+msgstr "Marcadores de columna"
+
+#: ../internac/colors.cc:150
+msgid "Info viewer"
+msgstr "Visor de ayudas (Info)"
+
+#: ../internac/colors.cc:156
+msgid "Keyword"
+msgstr "Enlace"
+
+#: ../internac/colors.cc:157
+msgid "Selected keyword"
+msgstr "Enlace seleccionado"
+
+#: ../internac/colors.cc:158
+msgid "Marked keyword"
+msgstr "Enlace marcado"
+
+#: ../internac/colors.cc:162
+msgid "Man page viewer"
+msgstr "Visor de pginas del manual"
+
+#: ../internac/colors.cc:169
+msgid "Bold text"
+msgstr "Texto negrita"
+
+#: ../internac/colors.cc:170
+msgid "Underlined text"
+msgstr "Texto subrayado"
+
+#: ../internac/colors.cc:177
+msgid "DataWindow"
+msgstr "Ventana de Datos"
+
+#: ../internac/colors.cc:182
+msgid "Normal Text(active)"
+msgstr "Texto normal(activo)"
+
+#: ../internac/colors.cc:183
+msgid "Normal Text(inactive)"
+msgstr "Texto normal(inactivo)"
+
+#: ../internac/colors.cc:184
+msgid "Focused Text"
+msgstr "Texto apuntado"
+
+#: ../internac/colors.cc:185
+msgid "Selected Text"
+msgstr "Texto seleccionado"
+
+#: ../internac/colors.cc:186
+msgid "Changed text"
+msgstr "Texto con cambios"
+
+#: ../internac/colors.cc:192 ../setedit/edmsg.cc:609
+msgid "Message Window"
+msgstr "Ventana de Mensajes"
+
+#: ../internac/colors.cc:198
+#, fuzzy
+msgid "Focused"
+msgstr "Texto apuntado"
+
+#: ../internac/colors.cc:200 ../setedit/edprefs.cc:305
+msgid "Information"
+msgstr "Informacin"
+
+#: ../internac/colors.cc:201
+#, fuzzy
+msgid "Warnings"
+msgstr "aviso"
+
+#: ../internac/colors.cc:202
+#, fuzzy
+msgid "Errors"
+msgstr "error"
+
+#: ../mainsrc/accehtml.cc:53
+msgid "You must select the editor window first"
+msgstr "Ud. debe seleccionar una ventana de editor primero"
+
+#: ../mainsrc/bufun.cc:726
+msgid "Jump to function"
+msgstr "Saltar a una funcin"
+
+#: ../mainsrc/bufun.cc:736
+msgid "List of functions"
+msgstr "Lista de funciones"
+
+#: ../mainsrc/bufun.cc:742 ../settvuti/tdiagaid.cc:174
+msgid "~B~rowse"
+msgstr "~R~ecorrer"
+
+#: ../mainsrc/bufun.cc:771
+msgid "Sort mode"
+msgstr "Ordenamiento"
+
+#: ../mainsrc/bufun.cc:773
+msgid "Sort the functions"
+msgstr "Ordenar las funciones"
+
+#: ../mainsrc/bufun.cc:775
+msgid "~A~lphabetically"
+msgstr "~A~lfabeticamente"
+
+#: ../mainsrc/bufun.cc:776
+msgid "by ~L~ine"
+msgstr "por ~L~nea"
+
+#: ../mainsrc/bufun.cc:811
+msgid "Hmmm ... I can't find any function, are you sure?"
+msgstr "Hmmm ... no puedo encontrar ninguna funcin est seguro?"
+
+#: ../mainsrc/bufun.cc:839
+msgid "Functions:"
+msgstr "Funciones:"
+
+#: ../mainsrc/ceditor.cc:543
+#, c-format
+msgid "Error pasting from clipboard: %s"
+msgstr "Error al pegar desde el portapapeles: %s"
+
+#: ../mainsrc/ceditor.cc:3807
+#, c-format
+msgid "Search wrapped, continued from %s."
+msgstr ""
+
+#: ../mainsrc/ceditor.cc:3808
+msgid "bottom"
+msgstr ""
+
+#: ../mainsrc/ceditor.cc:3808
+#, fuzzy
+msgid "top"
+msgstr "~P~arar"
+
+#. Nope, is too risky to silently delete it.
+#. printf("Actual mode definition: %s\n",buffer+stComp);
+#: ../mainsrc/ceditor.cc:4258
+msgid "Emacs mode already pasted without this editor"
+msgstr "El modo Emacs ya est y no parece haber sido insertado con este editor"
+
+# c-format
+#: ../mainsrc/ceditor.cc:4310
+#, c-format
+msgid "%d bytes selected"
+msgstr "%d caracteres seleccionados"
+
+#: ../mainsrc/ceditor.cc:4312
+msgid "One byte selected"
+msgstr "Un caracter seleccionado"
+
+# c-format
+#: ../mainsrc/ceditor.cc:4314
+#, c-format
+msgid " in %d lines"
+msgstr " en %d lneas"
+
+#: ../mainsrc/ceditor.cc:4316
+msgid " in one line"
+msgstr " en una lnea"
+
+#: ../mainsrc/ceditor.cc:4477
+msgid "Use a file with 1000 lines or more for that"
+msgstr "Utilice un archivo con al menos 1000 lneas"
+
+#: ../mainsrc/ceditor.cc:4496
+#, c-format
+msgid "Speed: %f lines/second"
+msgstr "Velocidad: %f lneas/segundo"
+
+#: ../mainsrc/ceditor.cc:4518
+#, c-format
+msgid ""
+"Time: %f seconds\n"
+"Speed: %f lines/second\n"
+"%f chars/sec"
+msgstr ""
+"Tiempo: %f segundos\n"
+"Velocidad: %f lneas/segundo\n"
+"%f caracteres/seg"
+
+#: ../mainsrc/ceditor.cc:4552
+#, c-format
+msgid ""
+"Time: %f seconds\n"
+"Speed: %f lines/second\n"
+"%5.2f%% Editor\n"
+"%f chars/sec"
+msgstr ""
+"Tiempo: %f segundos\n"
+"Velocidad: %f lneas/seg\n"
+"%5.2f%% Editor\n"
+"%f caracteres/seg"
+
+#: ../mainsrc/ceditor.cc:6163
+msgid "No match found"
+msgstr "No encontr el complemento"
+
+#: ../mainsrc/ceditor.cc:6178
+#, c-format
+msgid "Match found at line %d column %d."
+msgstr "Complemento hallado en la lnea %d columna %d."
+
+#: ../mainsrc/ceditor.cc:10762
+msgid ""
+"This file contains ASCII 0 values, all the characters in this line after it "
+"become invisible. Be careful."
+msgstr ""
+"Este archivo contiene caracteres con valor 0, todos los caracteres luego del "
+"0 no se podrn ver en esa lnea. Tenga cuidado"
+
+#: ../mainsrc/ceditor.cc:10777
+msgid "Parsing file"
+msgstr "Analizando el archivo"
+
+#: ../mainsrc/ceditor.cc:11523
+msgid "Unhandled syntax highlighting"
+msgstr "Resaltado de sintaxis no soportado!"
+
+#: ../mainsrc/ceditor.cc:12454
+msgid "Unhandled undo"
+msgstr "Undo no soportado!"
+
+#: ../mainsrc/ceditor.cc:12665
+msgid "Unhandled redo"
+msgstr "Redo no soportado!"
+
+# c-format
+#: ../mainsrc/ceditor.cc:13866
+#, c-format
+msgid "Saved: %s (%ld bytes %d lines)."
+msgstr "Grabado %s (%ld bytes de longitud %d lneas)."
+
+#: ../mainsrc/ceditor.cc:13876
+msgid "Stat failed."
+msgstr "Fallo al usar 'stat'!"
+
+#: ../mainsrc/deedidia.cc:76
+msgid "Regular Expression Options"
+msgstr "Opciones de Expresiones Regulares"
+
+#. EN: ABDENPT
+#: ../mainsrc/deedidia.cc:79
+msgid "RegEx style"
+msgstr "Tipo de ExpReg"
+
+#: ../mainsrc/deedidia.cc:79
+msgid "~B~asic POSIX"
+msgstr "POSIX ~B~sicas"
+
+#: ../mainsrc/deedidia.cc:80
+msgid "~E~xtended POSIX"
+msgstr "POSIX ~E~xtendidas"
+
+#: ../mainsrc/deedidia.cc:81
+msgid "~P~erl Compatible"
+msgstr "Compatibles con ~P~erl"
+
+#: ../mainsrc/deedidia.cc:84
+msgid "Replace text"
+msgstr "Texto a reemplazar"
+
+#: ../mainsrc/deedidia.cc:84
+msgid "~N~ormal text"
+msgstr "Es texto ~n~ormal"
+
+#: ../mainsrc/deedidia.cc:85
+msgid "~D~ollar tags"
+msgstr "Son ~s~ubexpresiones con $n"
+
+#: ../mainsrc/deedidia.cc:86
+msgid "Optimize"
+msgstr "Optimizar"
+
+#: ../mainsrc/deedidia.cc:86
+msgid "~T~ry to use normal search"
+msgstr "In~t~entar usar una bsqueda comn"
+
+#: ../mainsrc/deedidia.cc:87
+msgid "~A~lways use RegEx"
+msgstr "Siempre usar E~x~pReg"
+
+#: ../mainsrc/deedidia.cc:115
+msgid "Find"
+msgstr "Buscar"
+
+#: ../mainsrc/deedidia.cc:122 ../mainsrc/deedidia.cc:164
+#: ../mainsrc/deedidia.cc:290 ../setedit/tips.cc:210
+msgid "Options"
+msgstr "Opc~i~ones"
+
+#: ../mainsrc/deedidia.cc:123 ../mainsrc/deedidia.cc:165
+msgid "Regular e~x~pressions"
+msgstr "E~x~presiones regulares"
+
+#: ../mainsrc/deedidia.cc:124 ../mainsrc/deedidia.cc:165
+msgid "Only ~i~nside comments"
+msgstr "So~l~o dentro de comentarios"
+
+#: ../mainsrc/deedidia.cc:124 ../mainsrc/deedidia.cc:166
+msgid "Only o~u~tside comments"
+msgstr "Solo ~f~uera de comentarios"
+
+#: ../mainsrc/deedidia.cc:125
+msgid "S~h~ow function name"
+msgstr "~M~ostrar el nombre de la funcin"
+
+#. All together + same width
+#: ../mainsrc/deedidia.cc:126 ../mainsrc/deedidia.cc:172
+msgid "Scope"
+msgstr "Ambito"
+
+#: ../mainsrc/deedidia.cc:126 ../mainsrc/deedidia.cc:172
+msgid "~G~lobal"
+msgstr "~G~lobal"
+
+#: ../mainsrc/deedidia.cc:126 ../mainsrc/deedidia.cc:172
+msgid "~S~elected text"
+msgstr "Texto ~s~eleccionado"
+
+#: ../mainsrc/deedidia.cc:127
+msgid "Origin"
+msgstr "Origen"
+
+#: ../mainsrc/deedidia.cc:127 ../mainsrc/deedidia.cc:173
+msgid "~F~rom cursor"
+msgstr "~D~esde el cursor"
+
+#: ../mainsrc/deedidia.cc:128 ../mainsrc/deedidia.cc:173
+msgid "~E~ntire scope"
+msgstr "~T~odo"
+
+#: ../mainsrc/deedidia.cc:129 ../mainsrc/deedidia.cc:174
+msgid "Direction"
+msgstr "Sentido"
+
+#: ../mainsrc/deedidia.cc:129 ../mainsrc/deedidia.cc:174
+msgid "Forwar~d~"
+msgstr "Hacia ~a~delante"
+
+#: ../mainsrc/deedidia.cc:130 ../mainsrc/deedidia.cc:174
+msgid "~B~ackward"
+msgstr "~H~acia atrs"
+
+#: ../mainsrc/deedidia.cc:136 ../mainsrc/deedidia.cc:181
+msgid "RegEx ~O~ps"
+msgstr "~O~ps ExpReg"
+
+#: ../mainsrc/deedidia.cc:154
+msgid "Replace"
+msgstr "Reemplazar"
+
+#: ../mainsrc/deedidia.cc:160
+msgid "~N~ew text"
+msgstr "~N~uevo texto"
+
+#: ../mainsrc/deedidia.cc:166
+msgid "S~h~ow function ~n~ame"
+msgstr "Mostrar el nombre de la f~u~ncin"
+
+#: ../mainsrc/deedidia.cc:167
+msgid "~P~rompt on replace"
+msgstr "Pr~e~guntar"
+
+#: ../mainsrc/deedidia.cc:167
+msgid "~R~eplace all"
+msgstr "~R~eemplazar todo"
+
+#: ../mainsrc/deedidia.cc:173
+msgid "Or~i~gin"
+msgstr "Origen"
+
+#: ../mainsrc/deedidia.cc:179
+msgid "Replace ~A~ll"
+msgstr "Ree~m~plazar Todo"
+
+#: ../mainsrc/deedidia.cc:199
+msgid "Goto Line"
+msgstr "Ir a lnea"
+
+#: ../mainsrc/deedidia.cc:202
+msgid "Desired line"
+msgstr "Lnea deseada"
+
+#: ../mainsrc/deedidia.cc:218
+msgid "Syntax Highlighting"
+msgstr "Resaltado de Sintaxis"
+
+#: ../mainsrc/deedidia.cc:223
+msgid "Off ~1~"
+msgstr "Apa~g~ado"
+
+#: ../mainsrc/deedidia.cc:224
+msgid "C++ st~y~le"
+msgstr "Estilo C~+~+"
+
+#: ../mainsrc/deedidia.cc:225
+msgid "Pa~s~cal style"
+msgstr "Estilo Pascal ~1~"
+
+#: ../mainsrc/deedidia.cc:226
+msgid "C~l~ipper style"
+msgstr "Estilo Clipper ~5~"
+
+#: ../mainsrc/deedidia.cc:227
+msgid "User ~d~efined"
+msgstr "~D~efinido por el usuario"
+
+#. English: ABCDEFGHIKLMNOPRSTUWYZ 1234
+#. BEGJQVXZ
+#: ../mainsrc/deedidia.cc:248
+msgid "Local Options"
+msgstr "Opciones locales"
+
+#: ../mainsrc/deedidia.cc:251
+msgid "Options ~3~"
+msgstr "Opciones ~3~"
+
+#: ../mainsrc/deedidia.cc:251
+msgid "~O~verwrite"
+msgstr "S~o~breescritura"
+
+#: ../mainsrc/deedidia.cc:251 ../mainsrc/deedidia.cc:291
+msgid "~A~utoindent"
+msgstr "~A~utoindentar"
+
+#: ../mainsrc/deedidia.cc:252
+msgid "~U~se real tabs (ASCII 9)"
+msgstr "~U~sar tabs reales (ASCII 9)"
+
+#: ../mainsrc/deedidia.cc:252 ../mainsrc/deedidia.cc:293
+msgid "~P~ersistent blocks"
+msgstr "Bloques ~p~ersistentes"
+
+#: ../mainsrc/deedidia.cc:252 ../mainsrc/deedidia.cc:294
+msgid "~I~ntelligent indent"
+msgstr "~I~ndentado inteligente"
+
+#: ../mainsrc/deedidia.cc:253 ../mainsrc/deedidia.cc:295
+msgid "~C~olumn cursor"
+msgstr "Cursor de ~C~olumna"
+
+#: ../mainsrc/deedidia.cc:253 ../mainsrc/deedidia.cc:296
+msgid "~R~ow cursor"
+msgstr "Cursor de ~L~nea"
+
+#: ../mainsrc/deedidia.cc:253 ../mainsrc/deedidia.cc:297
+msgid "~M~atched pair highlighting"
+msgstr "~R~esaltar el par complementario"
+
+#: ../mainsrc/deedidia.cc:254 ../mainsrc/deedidia.cc:298
+msgid "Match pair on the fl~y~"
+msgstr "Resaltar el par `al vuelo' ~4~"
+
+#: ../mainsrc/deedidia.cc:254
+msgid "Don't wait to search for the pair ~1~"
+msgstr "No esperar para resaltar ~1~"
+
+#: ../mainsrc/deedidia.cc:255 ../mainsrc/deedidia.cc:301
+msgid "Tra~n~sparent Blocks"
+msgstr "Bloques Tran~s~parentes"
+
+#: ../mainsrc/deedidia.cc:255 ../mainsrc/deedidia.cc:302
+msgid "Optimal ~F~ill"
+msgstr "Rell~e~nado ptimo"
+
+#: ../mainsrc/deedidia.cc:255 ../mainsrc/deedidia.cc:303
+msgid "~W~rap words"
+msgstr "Cortar l~n~eas"
+
+#: ../mainsrc/deedidia.cc:256 ../mainsrc/deedidia.cc:305
+msgid "S~e~e tabs"
+msgstr "~V~er los tabuladores"
+
+#: ../mainsrc/deedidia.cc:256 ../mainsrc/deedidia.cc:306
+msgid "Don't move inside ta~b~s"
+msgstr "No moverse dentro de los ta~b~s"
+
+#: ../mainsrc/deedidia.cc:257
+msgid "Tab ~s~mart indents"
+msgstr "El tab indenta buscando ~h~uecos"
+
+#: ../mainsrc/deedidia.cc:257
+msgid "Use in~d~ent size"
+msgstr "Usar el valor de 'indentado' ~6~"
+
+#: ../mainsrc/deedidia.cc:258 ../mainsrc/deedidia.cc:309
+msgid "Keep trailin~g~ whitespace"
+msgstr "No borrar espacios al final ~3~"
+
+#: ../mainsrc/deedidia.cc:258
+msgid "Backspace unindents ~2~"
+msgstr "La tecla <- desindenta ~5~"
+
+#: ../mainsrc/deedidia.cc:259
+msgid "Column markers ~4~"
+msgstr "Marcadores de columna ~2~"
+
+#: ../mainsrc/deedidia.cc:262 ../mainsrc/deedidia.cc:314
+msgid "~T~ab size"
+msgstr "~T~amao del tab"
+
+#: ../mainsrc/deedidia.cc:263 ../mainsrc/deedidia.cc:315
+msgid "Indent si~z~e"
+msgstr "Indentad~o~"
+
+#: ../mainsrc/deedidia.cc:264 ../mainsrc/deedidia.cc:316
+msgid "Wrap co~l~umn"
+msgstr "Colu~m~na lmite"
+
+#: ../mainsrc/deedidia.cc:273
+msgid "Syntax ~H~L Options"
+msgstr "Ops. res. de sinta~x~is"
+
+#: ../mainsrc/deedidia.cc:288
+msgid "Global Options"
+msgstr "Opciones Globales"
+
+#: ../mainsrc/deedidia.cc:292
+msgid "~U~se tabs"
+msgstr "~U~sar tabs"
+
+#: ../mainsrc/deedidia.cc:299
+msgid "Don't wait to searc~h~ for the pair"
+msgstr "No esperar para resaltar ~1~"
+
+#: ../mainsrc/deedidia.cc:300
+msgid "~D~on't move the cursor on Paste"
+msgstr "No mover el cursor al pe~g~ar"
+
+#: ../mainsrc/deedidia.cc:304
+msgid "~S~croll Lock centers"
+msgstr "Blo~q~ Despl centra"
+
+#: ../mainsrc/deedidia.cc:307
+msgid "Tab smart indents ~5~"
+msgstr "El tab indenta buscando ~h~uecos"
+
+#: ../mainsrc/deedidia.cc:308
+msgid "Use indent size ~6~"
+msgstr "Usar el valor de 'indentado' ~6~"
+
+#: ../mainsrc/deedidia.cc:310
+msgid "Backspace unindents ~8~"
+msgstr "La tecla <- desindenta ~5~"
+
+#: ../mainsrc/deedidia.cc:311
+msgid "Column markers ~9~"
+msgstr "Marcadores de columna ~2~"
+
+#: ../mainsrc/deedidia.cc:322
+msgid "T~o~ all"
+msgstr "a To~d~os"
+
+#: ../mainsrc/deedidia.cc:337
+msgid "Search hit"
+msgstr "Valor encontrado"
+
+#: ../mainsrc/deedidia.cc:339
+msgid "Replace this occurence?"
+msgstr "Reemplazo aqu?"
+
+#: ../mainsrc/deedidia.cc:342
+msgid "~A~ll"
+msgstr "~T~odos"
+
+#. BCDFLMO
+#: ../mainsrc/deedidia.cc:364
+msgid "Export Options"
+msgstr "Opciones para exportar"
+
+#: ../mainsrc/deedidia.cc:367 ../setedit/editmenu.cc:354
+#: ../setedit/intgrep.cc:418 ../setedit/runprog.cc:127
+msgid "~O~ptions"
+msgstr "~O~pciones"
+
+#: ../mainsrc/deedidia.cc:368
+msgid "~F~ile name as title"
+msgstr "~N~ombre del archivo como ttulo"
+
+#: ../mainsrc/deedidia.cc:369
+msgid "Same ~b~ackground color as the editor"
+msgstr "Mismo color de ~f~ondo que en el editor"
+
+#: ../mainsrc/deedidia.cc:370
+msgid "~M~onospaced font"
+msgstr "Letras ~m~onoespaciadas"
+
+#: ../mainsrc/deedidia.cc:371
+msgid "Bo~l~d attribute"
+msgstr "Letras en n~e~grita"
+
+#: ../mainsrc/deedidia.cc:372
+msgid "~U~se CSS and HTML 4.01"
+msgstr "Usar CSS y ~H~TML 4.01"
+
+#: ../mainsrc/deedidia.cc:373
+msgid "Colors"
+msgstr "Colores"
+
+#: ../mainsrc/deedidia.cc:373
+msgid "Use ~c~olors"
+msgstr "Usar ~c~olores"
+
+#: ../mainsrc/deedidia.cc:374
+msgid "~D~on't use colors"
+msgstr "No ~u~sar colores"
+
+#. BFLMO
+#: ../mainsrc/deedidia.cc:389
+msgid "Pseudo Macros"
+msgstr "Pseudo Macros"
+
+#: ../mainsrc/deedidia.cc:401
+msgid "Arbitrary indent"
+msgstr "Indentado arbitrario"
+
+#: ../mainsrc/deedidia.cc:403
+msgid "Indentation text"
+msgstr "Texto a usar para indentar"
+
+#: ../mainsrc/deedidia.cc:430
+#, c-format
+msgid "Data saved to file: %s"
+msgstr "Datos guardados en: %s"
+
+#: ../mainsrc/deedidia.cc:435
+msgid "Solve collision"
+msgstr "Resolver colisin"
+
+#: ../mainsrc/deedidia.cc:439
+msgid ""
+"Problem:\n"
+"The copy in memory is also modified\n"
+msgstr ""
+"Problema:\n"
+"La copia en memoria tambin est modificada\n"
+
+#: ../mainsrc/deedidia.cc:440
+msgid "~L~oad file from disk (discard changes)"
+msgstr "~C~argar del disco (perder cambios)"
+
+#: ../mainsrc/deedidia.cc:441
+msgid "~A~bort operation"
+msgstr "~A~bortar la operacin"
+
+#: ../mainsrc/deedidia.cc:442
+msgid "Load and ~s~how differences"
+msgstr "Cargar y ~m~ostrar los cambios"
+
+#: ../mainsrc/deedidia.cc:443
+msgid "~D~on't load and show differences"
+msgstr "~N~o cargar y mostrar los cambios"
+
+#: ../mainsrc/doedidia.cc:64
+msgid "Not enough memory for this operation"
+msgstr "No hay suficiente memoria para esta operacin"
+
+#: ../mainsrc/doedidia.cc:72
+#, fuzzy, c-format
+msgid "Error reading file %s. %s"
+msgstr "Error al leer el archivo %s."
+
+#: ../mainsrc/doedidia.cc:73
+#, c-format
+msgid "Error reading file %s. %s (%d)"
+msgstr "Error al leer el archivo %s. %s (%d)"
+
+#: ../mainsrc/doedidia.cc:82
+#, fuzzy, c-format
+msgid "Error writing file %s. %s"
+msgstr "Error al escribir el archivo %s."
+
+#: ../mainsrc/doedidia.cc:83
+#, c-format
+msgid "Error writing file %s. %s (%d)"
+msgstr "Error al escribir el archivo %s. %s (%d)"
+
+#: ../mainsrc/doedidia.cc:90
+#, c-format
+msgid "Error creating file %s. %s (%d)"
+msgstr "Error al crear el archivo %s. %s (%d)"
+
+#: ../mainsrc/doedidia.cc:94
+msgid "Error creating temporal file, operation aborted"
+msgstr "Error al crear archivo temporario, operacin abortada"
+
+#: ../mainsrc/doedidia.cc:100
+#, c-format
+msgid "%s has been modified. Save?"
+msgstr "%s ha sido modificado. Grabo?"
+
+#: ../mainsrc/doedidia.cc:103
+msgid "Save untitled file?"
+msgstr "Grabo el archivo sin ttulo?"
+
+#: ../mainsrc/doedidia.cc:106
+msgid "Save file as"
+msgstr "Grabar como"
+
+#: ../mainsrc/doedidia.cc:114
+msgid "Write to file"
+msgstr "Guardar a un archivo"
+
+#: ../mainsrc/doedidia.cc:117
+msgid "Read from file"
+msgstr "Leer desde un archivo"
+
+#: ../mainsrc/doedidia.cc:128
+msgid "Search string not found."
+msgstr "No se pudo hallar el texto."
+
+#: ../mainsrc/doedidia.cc:213
+msgid "Line too long, cut it?"
+msgstr "Lnea demasiado larga, la corto?"
+
+#: ../mainsrc/doedidia.cc:217
+msgid "Line extremely long. Can't handle it reliably, sorry"
+msgstr ""
+"Lnea extremadamente larga, no puede ser manejado correctamente, lo lamento"
+
+#: ../mainsrc/doedidia.cc:221
+msgid "This file isn't on the disk!"
+msgstr "Este archivo no se encuentra en disco!"
+
+#: ../mainsrc/doedidia.cc:228
+#, c-format
+msgid "The file %s is read-only, try to revert it?"
+msgstr "El archivo %s es de solo lectura, revierto esto?"
+
+#: ../mainsrc/doedidia.cc:231
+msgid ""
+"Failed to revert the read-only status, you won't be able to overwrite this "
+"file"
+msgstr ""
+"No pude revertir el atributo de solo lectura, ud. no podr sobreescribir "
+"este archivo"
+
+#: ../mainsrc/doedidia.cc:235
+msgid "This action can't be undone. Are you sure?"
+msgstr "Esta accin no puede deshacerse. Est seguro?"
+
+#: ../mainsrc/doedidia.cc:242
+#, c-format
+msgid "%s already exists. Overwrite?"
+msgstr "%s ya existe. Lo sobreescribo?"
+
+#: ../mainsrc/doedidia.cc:248
+#, c-format
+msgid "%s isn't a file, probably a device, go ahead?"
+msgstr "%s no es un archivo, probablemente un dispositivo, continuo?"
+
+#: ../mainsrc/doedidia.cc:251
+msgid "Can't create a backup. Continue saving?"
+msgstr "No puedo crear un archivo de respaldo. Continuo?"
+
+#: ../mainsrc/doedidia.cc:254
+msgid "You can't paste a rectangle crossing the end of the file"
+msgstr "No se puede pegar un rectngulo que cruce el fin del archivo"
+
+#: ../mainsrc/doedidia.cc:265
+msgid "No pseudo macros available"
+msgstr "No hay pseudo macros disponibles"
+
+#: ../mainsrc/doedidia.cc:282
+msgid "The file is compressed. Do you want to save with compression?"
+msgstr "El archivo est comprimido. Desea guardarlo comprimido?"
+
+#: ../mainsrc/doedidia.cc:285
+msgid "Searching inside a selection but nothing is selected"
+msgstr "Bsqueda dentro de una seleccin pero no hay nada seleccionado"
+
+#: ../mainsrc/doedidia.cc:289
+msgid "You must select some text for this operation"
+msgstr "Debe seleccionar algn texto para esta operacin"
+
+#: ../mainsrc/doedidia.cc:296
+#, c-format
+msgid "You must select less than %d characters"
+msgstr "Debe seleccionar menos de %d caracteres"
+
+#: ../mainsrc/doedidia.cc:301
+msgid "The selection can't contain more than one line"
+msgstr "El texto seleccionado no puede contenet ms de una lnea"
+
+#: ../mainsrc/editwind.cc:33
+msgid "Clipboard"
+msgstr "Portapapeles"
+
+#: ../mainsrc/editwind.cc:34
+msgid "Untitled"
+msgstr "Sin Ttulo"
+
+#: ../mainsrc/gzfiles.cc:443
+#, fuzzy
+msgid "Validation"
+msgstr "~N~avegacin"
+
+#: ../mainsrc/gzfiles.cc:447
+msgid "Passphrase"
+msgstr ""
+
+#: ../mainsrc/gzfiles.cc:602
+#, fuzzy
+msgid "No passphrase available"
+msgstr "No hay pseudo macros disponibles"
+
+#: ../mainsrc/gzfiles.cc:611 ../setedit/debug.cc:8724
+msgid "Out of memory"
+msgstr "No hay memoria suficiente"
+
+#: ../mainsrc/gzfiles.cc:622 ../mainsrc/gzfiles.cc:694
+#, fuzzy
+msgid "Running:"
+msgstr "Ejecutando"
+
+#: ../mainsrc/gzfiles.cc:630 ../mainsrc/gzfiles.cc:700
+msgid "Failed to invoke gpg"
+msgstr ""
+
+#: ../mainsrc/gzfiles.cc:670
+#, fuzzy
+msgid "Error while decrypting"
+msgstr "Error al leer"
+
+#: ../mainsrc/gzfiles.cc:674
+#, fuzzy
+msgid "Failed to determine user ID"
+msgstr "No puedo abrir la lista de archivos %s"
+
+#: ../mainsrc/gzfiles.cc:731
+#, fuzzy
+msgid "Error from GPG"
+msgstr "Error desde el gdb"
+
+#: ../mainsrc/keytrans.cc:804
+msgid "Wrong file"
+msgstr "Archivo incorrecto"
+
+#: ../mainsrc/keytrans.cc:808
+msgid "Wrong version"
+msgstr "Versin incorrecta"
+
+#: ../mainsrc/keytrans.cc:825
+msgid "Error while reading"
+msgstr "Error al leer"
+
+#: ../mainsrc/keytrans.cc:1144
+#, c-format
+msgid "%s, file \"%s\"\n"
+msgstr "%s, archivo \"%s\"\n"
+
+#: ../mainsrc/keytrans.cc:1153
+#, c-format
+msgid "Error while loading the keyboard binding: %s"
+msgstr "Error al cargar la configuracin de teclado: %s"
+
+#: ../mainsrc/keytrans.cc:1190
+msgid "You'll lose all the changes"
+msgstr "Perder todos los cambios"
+
+#: ../mainsrc/loaddefl.cc:248
+msgid "Available"
+msgstr "Disponible"
+
+#. Ask if is enable or disable.
+#: ../mainsrc/loaddefl.cc:263
+msgid "What to do"
+msgstr "Que hacer"
+
+#: ../mainsrc/loaddefl.cc:264
+msgid "Action"
+msgstr "Accin"
+
+#: ../mainsrc/loaddefl.cc:264
+msgid "~D~isable"
+msgstr "~D~eshabilitar"
+
+#: ../mainsrc/loaddefl.cc:264 ../setedit/debug.cc:4309
+#: ../setedit/debug.cc:4916
+msgid "~E~nable"
+msgstr "~H~abilitar"
+
+#. Ask the value
+#: ../mainsrc/loaddefl.cc:280
+msgid "Associated value"
+msgstr "Valor asociado"
+
+#: ../mainsrc/loaddefl.cc:281 ../mainsrc/loaddefl.cc:301
+msgid "Value:"
+msgstr "Valor:"
+
+#. Ask the value
+#: ../mainsrc/loaddefl.cc:300
+msgid "Associated string"
+msgstr "String asociado"
+
+#: ../mainsrc/loaddefl.cc:550 ../mainsrc/tags.cc:1380
+#: ../setedit/loadnobkp.cc:209 ../setedit/pathlist.cc:395
+msgid "Do you want to discard the changes?"
+msgstr "Desea descartar los cambios?"
+
+#: ../mainsrc/loaddefl.cc:557
+msgid "Settings"
+msgstr "Seteos"
+
+#: ../mainsrc/loaddefl.cc:662
+msgid "Default global options"
+msgstr "Opciones globales por defecto"
+
+#: ../mainsrc/loaddefl.cc:714
+msgid "~N~o SHL"
+msgstr "~S~in SHL"
+
+#: ../mainsrc/loadfunc.cc:26
+msgid "No file name under cursor"
+msgstr "No hay un nombre bajo el cursor"
+
+#. Generate a message indicating we couldn't load it
+#: ../mainsrc/loadfunc.cc:137
+#, c-format
+msgid "Can't find \"%s\" file"
+msgstr "No puedo encontrar el archivo \"%s\""
+
+#: ../mainsrc/loadshl.cc:657
+msgid "Wrong action in NLIndent"
+msgstr "Accin incorrecta en una regla NLIndent"
+
+#: ../mainsrc/loadshl.cc:660
+msgid "Wrong second condition in NLIndent"
+msgstr "Segunda condicin incorrecta en una regla NLIndent"
+
+#: ../mainsrc/loadshl.cc:663
+msgid "Wrong first condition in NLIndent"
+msgstr "Primera condicin incorrecta en una regla NLIndent"
+
+#: ../mainsrc/loadshl.cc:666
+msgid "Wrong number of arguments for NLIndent"
+msgstr "Cantidad incorrecta de parmetros en una regla NLIndent"
+
+#: ../mainsrc/loadshl.cc:1456
+msgid "Errors while loading syntax highlight file"
+msgstr "Errores al cargar resaltado de sintaxis"
+
+#: ../mainsrc/loadusew.cc:226
+msgid "New user word"
+msgstr "Nueva palabra de usuario"
+
+#: ../mainsrc/loadusew.cc:228
+msgid "Word:"
+msgstr "Palabra:"
+
+#: ../mainsrc/loadusew.cc:303
+msgid "List of words"
+msgstr "Lista de palabras"
+
+#: ../mainsrc/loadusew.cc:354
+msgid "User words"
+msgstr "Palabras de usuario"
+
+#: ../mainsrc/pathtool.cc:821
+#, c-format
+msgid ""
+"\n"
+"Error! please run the editor from a valid directory\n"
+"\n"
+msgstr ""
+"\n"
+"Error! por favor ejecute el editor desde un directorio vlido\n"
+"\n"
+
+#: ../mainsrc/pmacros.cc:98 ../setedit/debug.cc:8732 ../setedit/loadcle.cc:97
+msgid "Unknown"
+msgstr "Desconocido"
+
+#: ../mainsrc/pmacros.cc:165
+msgid "Macro definition doesn't start with Trigger"
+msgstr "Definicin de macro que no comienza con Trigger"
+
+#: ../mainsrc/pmacros.cc:173
+msgid "Missing Trigger sequence or too short"
+msgstr "Secuencia de Trigger muy corta o no colocada"
+
+#: ../mainsrc/pmacros.cc:193
+msgid "Macro definition without mode keyword"
+msgstr "Definicin de macro que no contiene la palabra 'mode'"
+
+#: ../mainsrc/pmacros.cc:204 ../mainsrc/pmacros.cc:214
+msgid "Wrong mode definition in pseudo macro."
+msgstr "Definicin de 'mode' errnea en un pseudo macro."
+
+#: ../mainsrc/pmacros.cc:266
+msgid "Missing start in pseudo macro"
+msgstr "No puedo hallar el comienzo del pseudo macro"
+
+#: ../mainsrc/pmacros.cc:271
+msgid "Missing end in pseudo macro"
+msgstr "No puedo hallar el fin del pseudo macro"
+
+#: ../mainsrc/pmacros.cc:280
+msgid "Empty pseudo macro"
+msgstr "Pseudo macro vaco"
+
+#. Use a default name is none is provided
+#: ../mainsrc/pmacros.cc:332 ../mainsrc/pmacros.cc:335
+msgid "No name"
+msgstr "Sin nombre"
+
+#. Init the Message Window
+#: ../mainsrc/sdginter.cc:101
+msgid "Starting SDG:"
+msgstr "Comenzando SDG:"
+
+#: ../mainsrc/sdginter.cc:108
+#, c-format
+msgid "Error while %s:"
+msgstr "Error mientras %s:"
+
+#: ../mainsrc/sdginter.cc:112
+#, c-format
+msgid "(%d) %s in line %d"
+msgstr "(%d) %s en la lnea %d"
+
+#: ../mainsrc/sdginter.cc:120
+#, c-format
+msgid "In section %s"
+msgstr "En la seccin %s"
+
+#: ../mainsrc/sdginter.cc:121 ../mainsrc/slpinter.cc:550
+#, c-format
+msgid "Type of error: %s"
+msgstr "Tipo de error: %s"
+
+#: ../mainsrc/sdginter.cc:123 ../mainsrc/slpinter.cc:552
+#, c-format
+msgid "Code: ...%s..."
+msgstr "Cdigo: ...%s..."
+
+#: ../mainsrc/sdginter.cc:127
+msgid "End of SDG"
+msgstr "Fin de SDG"
+
+#: ../mainsrc/sdginter.cc:168
+msgid "SDG Parameters"
+msgstr "Parmetros de SDG"
+
+#: ../mainsrc/sdginter.cc:175
+msgid "~F~ormat file (.frt)"
+msgstr "Archivo de ~F~ormato (.frt)"
+
+#: ../mainsrc/sdginter.cc:179
+msgid "~I~ntermediate file"
+msgstr "Archivo ~i~ntermedio (temporal)"
+
+#: ../mainsrc/sdginter.cc:183
+msgid "~B~ase output (no extentions)"
+msgstr "Nombre ~b~ase de salida (sin exten.)"
+
+#: ../mainsrc/sdginter.cc:187
+msgid "~D~irectory of formats"
+msgstr "~D~irectorio de los formatos"
+
+#: ../mainsrc/sdginter.cc:190
+msgid "K~e~ep intermediate"
+msgstr "~N~o borrar el intermedio"
+
+#: ../mainsrc/search.cc:295 ../mainsrc/search.cc:404
+#, c-format
+msgid "Regular expression error: %s"
+msgstr "Error en la expresin regular: %s"
+
+#: ../mainsrc/search.cc:490
+msgid "PCRE Exec error"
+msgstr "Error de ejecucin del a ExpReg"
+
+#: ../mainsrc/slpinter.cc:549
+msgid "Error in sLisp interpreter:"
+msgstr "Error en el intrprete de sLisp:"
+
+#: ../mainsrc/slpinter.cc:553
+msgid "End of SLP"
+msgstr "Fin de SLP"
+
+#: ../mainsrc/slpinter.cc:627
+msgid "Enter sLisp code to interpret"
+msgstr "Ingrese cdigo sLisp a ser interpretado"
+
+#: ../mainsrc/slpinter.cc:656
+msgid "No macros defined"
+msgstr "No hay macros definidos"
+
+#: ../mainsrc/slpinter.cc:699
+msgid "sLisp macros"
+msgstr "Macros sLisp"
+
+#: ../mainsrc/slpinter.cc:709
+msgid "~M~acros"
+msgstr "~M~acros"
+
+#: ../mainsrc/ssyntax.cc:202
+#, c-format
+msgid " [%d nodes]"
+msgstr " [%d nodos]"
+
+#: ../mainsrc/ssyntax.cc:371
+msgid "New node for search"
+msgstr "Nuevo nodo a buscar"
+
+#: ../mainsrc/ssyntax.cc:374
+msgid "Name of the info file"
+msgstr "Nombre del archivo .info"
+
+#: ../mainsrc/ssyntax.cc:376
+msgid "Name of the node (leave blank for all)"
+msgstr "Nombre del nodo (dejar en blanco para usar todos)"
+
+#: ../mainsrc/ssyntax.cc:435
+msgid "Nodes for syntax help"
+msgstr "Nodos para ayuda de sintaxis"
+
+#: ../mainsrc/ssyntax.cc:473
+msgid "Options for syntax help"
+msgstr "Opciones para la ayuda de sintaxis"
+
+#. I think that's easiest way! The following 5 lines are equivalent to 20 lines
+#. of cryptic stuff if you don't use EasyDiag! (I can write it in 1 too ;-)
+#: ../mainsrc/ssyntax.cc:477
+msgid "Search ~m~ethod"
+msgstr "~M~todo de bsqueda"
+
+#: ../mainsrc/ssyntax.cc:477
+msgid "E~x~act"
+msgstr "E~x~acto"
+
+#: ../mainsrc/ssyntax.cc:477
+msgid "~S~ubstring"
+msgstr "~P~arcial"
+
+#: ../mainsrc/ssyntax.cc:478
+msgid "~F~uzzy"
+msgstr "~D~ifuso"
+
+#: ../mainsrc/ssyntax.cc:479
+msgid "Search O~p~tions"
+msgstr "~O~pciones de Bsqueda"
+
+#: ../mainsrc/ssyntax.cc:480
+msgid "So~r~t by score"
+msgstr "O~r~denar por puntaje"
+
+#: ../mainsrc/ssyntax.cc:484
+msgid "Fu~z~zy value [1..1000]"
+msgstr "Valor `dif~u~so' [1..1000]"
+
+#: ../mainsrc/ssyntax.cc:486 ../setedit/edprefs.cc:657
+msgid "Other options"
+msgstr "Otras opciones"
+
+#: ../mainsrc/ssyntax.cc:486
+msgid "Search word in the ~t~opic"
+msgstr "Buscar la palabra en ~n~odo"
+
+#: ../mainsrc/ssyntax.cc:875
+msgid "Choose a node"
+msgstr "Elegir un nodo"
+
+#: ../mainsrc/ssyntax.cc:927
+msgid "No INFO files for syntax help defined"
+msgstr "No se definieron archivos de ayuda para buscar sintaxis"
+
+#: ../mainsrc/tags.cc:816
+msgid "Wrong format for tags file!"
+msgstr "Formato incorrecto para el archivo de TAGs."
+
+#. Ask to generate a new one
+#: ../mainsrc/tags.cc:1004
+msgid "I can try to generate a tag file, go ahead?"
+msgstr "Puedo intentar generar un archivo de TAGS lo hago?"
+
+#. Not installed explain how to get it.
+#: ../mainsrc/tags.cc:1013
+msgid "Install Exuberant Ctags, download it from http://ctags.sourceforge.net"
+msgstr ""
+"Instale Exuberant Ctags, puede obtenerlo en http://ctags.sourceforge.net"
+
+#: ../mainsrc/tags.cc:1361
+msgid "This file is automatically maintained"
+msgstr "Este archivo es mantenido automaticamente"
+
+#: ../mainsrc/tags.cc:1390
+msgid "Select tags file"
+msgstr "Seleccione el archivo de TAGs"
+
+#: ../mainsrc/tags.cc:1406
+msgid "Use relative path for the file?"
+msgstr "Desea usar un camino (path) relativo?"
+
+#: ../mainsrc/tags.cc:1427
+msgid "Variables"
+msgstr "Variables"
+
+#: ../mainsrc/tags.cc:1443
+msgid "Tag files"
+msgstr "Archivos de TAGs"
+
+#: ../mainsrc/tags.cc:1545
+msgid "Jump to symbol"
+msgstr "Saltar a un smbolo"
+
+#: ../mainsrc/tags.cc:1545
+msgid "List of symbols"
+msgstr "Lista de smbolos"
+
+#: ../mainsrc/tags.cc:1546
+msgid "~S~earch members"
+msgstr "~B~uscar miembros"
+
+#: ../mainsrc/tags.cc:1578
+msgid "Unknown line"
+msgstr "Lnea desconocida"
+
+#: ../mainsrc/tags.cc:1623 ../mainsrc/tags.cc:1824 ../mainsrc/tags.cc:1840
+msgid "Members"
+msgstr "Miembros"
+
+#: ../mainsrc/tags.cc:1623 ../mainsrc/tags.cc:1750 ../mainsrc/tags.cc:1824
+#: ../mainsrc/tags.cc:1840
+msgid "~J~ump"
+msgstr "~S~altar"
+
+#: ../mainsrc/tags.cc:1632
+msgid "Sorry, couldn't find any member"
+msgstr "Lo lamento, no puedo hallar ningn miembro"
+
+#: ../mainsrc/tags.cc:1637
+msgid "I don't know any members for this type"
+msgstr "No se acerca de miembros para este tipo de datos"
+
+#: ../mainsrc/tags.cc:1734
+msgid "Class list"
+msgstr "Lista de clases"
+
+#: ../mainsrc/tags.cc:1745
+msgid "List of classes"
+msgstr "Clases encontradas"
+
+#: ../mainsrc/tags.cc:1749
+msgid "~V~iew"
+msgstr "~V~er"
+
+#: ../mainsrc/tags.cc:1788
+msgid "P~a~rents"
+msgstr "P~a~dres"
+
+#: ../mainsrc/tags.cc:1790
+msgid "Browse ~p~arent"
+msgstr "Ver ~p~adre"
+
+#: ../mainsrc/tags.cc:1795
+msgid "Chil~d~ren"
+msgstr "H~i~jos"
+
+#: ../mainsrc/tags.cc:1797
+msgid "Browse ~c~hild"
+msgstr "Ver ~h~ijo"
+
+#: ../mainsrc/tags.cc:1806
+msgid "View"
+msgstr "Ver"
+
+#: ../mainsrc/tags.cc:1807
+msgid "~T~his class"
+msgstr "~E~sta clase"
+
+#: ../mainsrc/tags.cc:1808
+msgid "This & Pa~r~ents"
+msgstr "Esta y sus pad~r~es"
+
+#: ../mainsrc/tags.cc:1809
+msgid "~S~orted"
+msgstr "I~d~em ordenado"
+
+#: ../mainsrc/tags.cc:1841
+msgid "View ~C~lass"
+msgstr "Ver ~C~lase"
+
+#: ../mainsrc/tags.cc:1941
+msgid "Sorry, but I can't find any class."
+msgstr "Lo lamento, no puedo hallar ninguna clase"
+
+#: ../mainsrc/tags.cc:2071
+msgid "This option is only available when using projects"
+msgstr "Esta opcin slo sirve cuando se usa un proyecto"
+
+#: ../mainsrc/tags.cc:2076
+msgid "Tags options"
+msgstr "Opciones de TAGs"
+
+#: ../mainsrc/tags.cc:2078
+msgid "Automatic generation"
+msgstr "Generacin automtica"
+
+#: ../mainsrc/tags.cc:2078
+msgid "~D~isabled"
+msgstr "~D~eshabilitada"
+
+#: ../mainsrc/tags.cc:2079
+msgid "~U~sing central file"
+msgstr "~U~sando un archivo central"
+
+#: ../mainsrc/tags.cc:2093
+msgid "Remove the tags files that I maintained from the list of files to use?"
+msgstr ""
+"Quito de la lista de archivos de TAGs los que mantena automaticamente?"
+
+#: ../mp3/ampdiag.cc:83
+msgid "You are expanding a MP3 file, do you really want to quit?"
+msgstr "Ud. est descomprimiendo un archivo MP3, realmente desea abortar?"
+
+#: ../mp3/ampdiag.cc:100
+#, c-format
+msgid "Sample Rate: %5d Hz Bitrate: %4d Kbits/s"
+msgstr "Frecuencia: %5d Hz Bitrate: %4d Kbits/s"
+
+#: ../mp3/ampdiag.cc:103
+#, c-format
+msgid "Mode: %6s File: MPEG %1d.0 layer %1d"
+msgstr "Modo: %6s Archivo: MPEG %1d.0 layer %1d"
+
+#: ../mp3/ampdiag.cc:106
+#, c-format
+msgid "Total: %3d:%02d"
+msgstr "Total: %3d:%02d"
+
+#: ../mp3/ampdiag.cc:109
+#, c-format
+msgid "Title: %s"
+msgstr "Ttulo: %s"
+
+#: ../mp3/ampdiag.cc:111
+#, c-format
+msgid "Author: %s"
+msgstr "Autor: %s"
+
+#: ../mp3/ampdiag.cc:113
+#, c-format
+msgid "Album: %s"
+msgstr "Album: %s"
+
+#: ../mp3/ampdiag.cc:115
+#, c-format
+msgid "Comme.: %s"
+msgstr "Comen.: %s"
+
+#: ../mp3/ampdiag.cc:117
+#, c-format
+msgid "Genre: %s"
+msgstr "Gnero: %s"
+
+#: ../mp3/ampdiag.cc:130
+msgid "[ PAUSE ]"
+msgstr "[ PAUSA ]"
+
+#: ../mp3/ampdiag.cc:133 ../mp3/ampdiag.cc:273
+msgid "[ STOP ]"
+msgstr "[DETENIDO]"
+
+#: ../mp3/ampdiag.cc:135
+msgid "[ PLAY ]"
+msgstr "[TOCANDO ]"
+
+#: ../mp3/ampdiag.cc:214
+#, c-format
+msgid "Time: %3d:%02d"
+msgstr "Tiempo: %3d:%02d"
+
+#: ../mp3/ampdiag.cc:244
+msgid "Player status"
+msgstr "Estado del reproductor"
+
+#: ../mp3/ampdiag.cc:271
+msgid "Time: 000:00"
+msgstr "Tiempo: 000:00"
+
+#: ../mp3/ampdiag.cc:275
+msgid "Total: 000:00"
+msgstr "Total: 000:00"
+
+#: ../mp3/ampdiag.cc:283
+msgid "Prev."
+msgstr "Prev."
+
+#: ../mp3/ampdiag.cc:289
+msgid "Next"
+msgstr "Prx."
+
+#: ../mp3/ampdiag.cc:459
+msgid "MP3 Player"
+msgstr "Reproductor de MP3s"
+
+#: ../mp3/ampdiag.cc:460
+msgid "MP3 support not linked"
+msgstr "Soporte para MP3s no incluido"
+
+#: ../mp3/intermp3.cc:55
+msgid "MP3 Open"
+msgstr "Abrir MP3"
+
+#: ../mp3/intermp3.cc:70
+msgid "Output WAV file"
+msgstr "Generar un .WAV"
+
+#: ../mp3/intermp3.cc:77 ../mp3/intermp3.cc:93
+msgid "First select a file"
+msgstr "Primero seleccione un archivo"
+
+#: ../mp3/intermp3.cc:258
+msgid "The MP3 routines aren't linked in the editor"
+msgstr "Las rutinas MP3 no fueron incluidas al compilar el editor"
+
+#: ../mp3/mp3list.cc:101
+msgid "Select a file"
+msgstr "Seleccione un archivo"
+
+#: ../mp3/mp3list.cc:120
+msgid "Save file list"
+msgstr "Grabar la lista de archivos"
+
+#: ../mp3/mp3list.cc:126
+msgid "Load list of files"
+msgstr "Cargar la lista de archivos"
+
+#: ../mp3/mp3list.cc:193
+msgid "Could not create the list file."
+msgstr "No puedo crear la lista de archivos."
+
+#: ../mp3/mp3list.cc:243
+msgid "Could not open the list file"
+msgstr "No puedo abrir la lista de archivos"
+
+#: ../mp3/mp3list.cc:262
+msgid "Wrong file type."
+msgstr "Tipo de archivo incorrecto."
+
+#: ../mp3/mp3list.cc:270
+msgid "Error reading the file list"
+msgstr "Error al leer la lista de archivos"
+
+#: ../mp3/mp3list.cc:326
+msgid "Play List"
+msgstr "Lista de MP3s"
+
+#: ../mp3/mp3list.cc:330
+msgid "List of files"
+msgstr "Lista de archivos"
+
+#: ../mp3/mp3list.cc:334 ../settvuti/tdiagaid.cc:169
+msgid "~I~nsert"
+msgstr "~I~nsertar"
+
+#: ../mp3/mp3list.cc:336 ../setedit/editmenu.cc:64
+msgid "~S~ave"
+msgstr "~G~uardar"
+
+#: ../mp3/mp3list.cc:337
+msgid "~L~oad"
+msgstr "~C~argar"
+
+#: ../sdg/mliediti.cc:76
+msgid "Return value:"
+msgstr "Valor retornado:"
+
+#. Convert the frame into something "human readable"
+#: ../sdg/mli.cc:1618 ../setedit/debug.cc:1413 ../setedit/debug.cc:1786
+#: ../setedit/debug.cc:7396 ../setedit/debug.cc:8722
+msgid "unknown"
+msgstr "desconocido"
+
+#: ../sdg/mli.cc:1623
+msgid "parser"
+msgstr "parseo"
+
+#: ../sdg/mli.cc:1624
+msgid "syntax"
+msgstr "sintaxis"
+
+#: ../sdg/mli.cc:1629
+msgid "string not closed"
+msgstr "cadena de caracteres no cerrada"
+
+#: ../sdg/mli.cc:1630
+msgid "no ) at end of code"
+msgstr ") no encontrado"
+
+#: ../sdg/mli.cc:1631
+msgid "no starting ("
+msgstr "( al ppio. no encontrado"
+
+# ../sdg/mli.cc 1151
+#: ../sdg/mli.cc:1632
+msgid "wrong number"
+msgstr "nmero errneo"
+
+#: ../sdg/mli.cc:1633
+msgid "unknown value"
+msgstr "valor desconocido"
+
+#: ../sdg/mli.cc:1634
+msgid "stack overflow"
+msgstr "desborde de pila (stack)"
+
+#: ../sdg/mli.cc:1639
+msgid "command where a parameter was expected"
+msgstr "comando donde se esperaba un parmetro"
+
+#: ../sdg/mli.cc:1640
+msgid "command expected"
+msgstr "se esperaba un comando"
+
+#: ../sdg/mli.cc:1641
+msgid "parameter after command"
+msgstr "parmetro luego de un comando"
+
+#: ../sdg/mli.cc:1642
+msgid "wrong number of parameters"
+msgstr "nmero equivocado de parmetros"
+
+#: ../sdg/mli.cc:1643
+msgid "wrong parameter type"
+msgstr "tipo de parmetro equivocado"
+
+#: ../sdg/mli.cc:1644
+msgid "undefined variable"
+msgstr "variable no definida"
+
+#: ../sdg/mli.cc:1645
+msgid "undefined symbol"
+msgstr "smbolo no definido"
+
+#: ../sdg/mli.cc:1646
+msgid "operation not defined"
+msgstr "operacin no definida"
+
+#: ../sdg/mli.cc:1647
+msgid "invalid character for a name"
+msgstr "caracter invlido para un nombre"
+
+#: ../sdg/mli.cc:1648
+msgid "invalid key sequence"
+msgstr "secuencia de teclas invlida"
+
+#: ../sdg/mli.cc:1649
+msgid "PCRE not available"
+msgstr "PCRE no disponible"
+
+#: ../sdg/mli.cc:1650
+msgid "PCRE compile error"
+msgstr "Error al compilar PCRE"
+
+#: ../setedit/advice.cc:46
+msgid ""
+"You are about to switch to the user screen\n"
+"Press ENTER to go back"
+msgstr ""
+"Ud. est por cambiar a la pantalla de usuario\n"
+"Presione INTRO para regresar"
+
+#: ../setedit/advice.cc:48
+msgid ""
+"Avoid using files that aren't in a directory that isn't relative to the "
+"working one. For example: on another drive. If you do it, you'll have "
+"problems if the directories are moved or transported to another machine."
+msgstr ""
+"Evita utilizar archivos que no se encuentran en un directorio que se pueda "
+"expresar en forma relativa al de trabajo. Por ejemplo: en otro disco. Si ud. "
+"hace esto puede tener problemas al mover el proyecto a otro directorio o "
+"computadora."
+
+#: ../setedit/advice.cc:50
+msgid ""
+"Do you really want to delete\n"
+"this file from disk?"
+msgstr ""
+"Est seguro que desea borrar\n"
+"el archivo del disco?"
+
+#: ../setedit/advice.cc:52
+msgid ""
+"Keep in mind that SHIFT and CAPS-LOCK will affect the case of the letters "
+"during incremental searches"
+msgstr ""
+"Con estas opciones la tecla SHIFT afectar a las letras (hacindolas "
+"maysculas o minsculas) durante las bsquedas incrementales, lo mismo "
+"suceder con CAPS-LOCK. No olvide este detalle."
+
+#: ../setedit/advice.cc:54
+msgid ""
+"Keep in mind that incremental searches aren't very intuitive, especially "
+"when pressing SHIFT."
+msgstr ""
+"Con estas opciones las bsquedas incrementales no sern muy intuituvas, "
+"especialmente al presionar SHIFT. No olvide este detalle."
+
+#: ../setedit/advice.cc:56
+msgid ""
+"Keep in mind that while holding SHIFT the incremental search is done for "
+"directory names, rather than files."
+msgstr ""
+"Manteniendo SHIFT apretada las bsquedas incrementales sern hechas con los "
+"nombres de los directorios, sino con los nombres de los archivos. No olvide "
+"este detalle."
+
+#: ../setedit/advice.cc:58
+msgid ""
+"When using real tabs the following options are usually desired: Autoindent "
+"ON, Intelligent C indent OFF, Optimal Fill ON, Don't move inside tabs ON, "
+"Tab smart indents OFF, Use indent size OFF and Backspace unindents OFF.\n"
+"I see not all of them are set this way."
+msgstr ""
+"Cuando se usan verdaderos tabs usualmente es deseable utilizar las "
+"siguientes opciones: Autoindentar SI, Indentado de C inteligente NO, "
+"Rellenado ptimo SI, El tab indenta buscando huecos NO, Usar el valor de "
+"'indentado' NO y La tecla <- desindenta NO. Veo que no todas estn "
+"seleccionadas de esta manera."
+
+#: ../setedit/advice.cc:60
+msgid ""
+"Tags file has incorrect format.\n"
+"Do you want to read more about it?"
+msgstr ""
+"Archivo de TAGs en formato incorrecto.\n"
+"Desea leer ms sobre esto?"
+
+#: ../setedit/advice.cc:62
+msgid ""
+"This option needs a tags file.\n"
+"Do you want to read more about it?"
+msgstr ""
+"Esta opcin necesita un archivo de TAGs.\n"
+"Desea leer ms sobre esto?"
+
+#: ../setedit/advice.cc:64
+msgid ""
+"GNU diff isn't installed.\n"
+"For this reason I can't offer some options."
+msgstr ""
+"El programa GNU diff no est instalado.\n"
+"Por esta razn no puedo ofrecer algunas opciones."
+
+#: ../setedit/advice.cc:66
+msgid ""
+"Debug options are stored in project files.\n"
+"If you don't use a project you'll lose the options"
+msgstr ""
+"Las opciones de depuracin se guardan en archivos de proyecto.\n"
+"Si no usa un proyecto las perder"
+
+#: ../setedit/advice.cc:68
+msgid ""
+"Please confirm you really want to finish the debug session. Breakpoints and "
+"other things will be lost."
+msgstr ""
+"Por favor confirme que realmente desea terminar la sesin. Los breakpoints y "
+"cosas similares se perdern."
+
+#: ../setedit/advice.cc:70
+msgid ""
+"A debug session is active.\n"
+"Do you want to stop it?"
+msgstr ""
+"Una sesin de depuracin sigue activa.\n"
+"Desea detenerla?"
+
+#: ../setedit/advice.cc:72
+msgid ""
+"It will kill the program you are debugging.\n"
+"Go ahead?"
+msgstr ""
+"Esto 'matar' el programa que est depurando.\n"
+"Lo hago?"
+
+#: ../setedit/advice.cc:74
+msgid ""
+"The program will be started in another virtual terminal.\n"
+"Consult the Debug Window to know which one."
+msgstr ""
+"El programa ser ejecutado en otra terminal virtual.\n"
+"Consulte la Ventada de Depuracin para saber cual."
+
+#: ../setedit/advice.cc:76
+msgid ""
+"Encrypted file detected.\n"
+"Install GPG in /usr/bin/."
+msgstr ""
+
+#: ../setedit/advice.cc:104
+msgid "Advice"
+msgstr "Consejo"
+
+#: ../setedit/advice.cc:119 ../setedit/editdiag.cc:87
+msgid "Don't show it next time"
+msgstr "No mostrar esto la prxima vez"
+
+#: ../setedit/advice.cc:243
+msgid "Advice dialogs"
+msgstr "Dilogos de consejo"
+
+#: ../setedit/advice.cc:249
+msgid "Select which advice dialogs are enabled"
+msgstr "Seleccione cuales dilogos estn habilitados"
+
+#: ../setedit/ascii.cc:152
+msgid " Char: "
+msgstr " Caracter: "
+
+#: ../setedit/ascii.cc:153
+msgid " Decimal: "
+msgstr " Dec: "
+
+#: ../setedit/ascii.cc:154
+msgid " Hex: "
+msgstr " Hex: "
+
+#: ../setedit/ascii.cc:191
+msgid "ASCII Chart"
+msgstr "Tabla ASCII"
+
+#: ../setedit/boardmix.cc:79
+msgid "Disabled by configuration"
+msgstr "Deshabilitado por configuracin"
+
+#: ../setedit/boardmix.cc:87
+msgid "Failed to initialize mixer. Sorry"
+msgstr "Falla al inicializar el mezclador. Lo lamento"
+
+#. gcc 2.95.2 doesn't like the _() call in the inlined constructor, I wonder why
+#. because 2.7.2.3 and 2.8.1 allows it as spected.
+#: ../setedit/boardmix.cc:93
+msgid "Hardward Mixer Settings"
+msgstr "Seteos del Mezclador de Sonidos"
+
+#: ../setedit/boardmix.cc:95
+msgid "Mixer model:"
+msgstr "Modelo:"
+
+#: ../setedit/boardmix.cc:117
+msgid "~L~ock channels"
+msgstr "~T~rabar canales"
+
+#: ../setedit/boardmix.cc:117
+msgid "~S~ave to disk"
+msgstr "~G~rabar a disco"
+
+#: ../setedit/boardmix.cc:151
+msgid "No mixer support linked in during configuration, sorry"
+msgstr "Lo lamento, no se incluy soporte para el mezclador al compilar"
+
+#: ../setedit/calendar.cc:42
+msgid "January"
+msgstr "Enero"
+
+#: ../setedit/calendar.cc:42
+msgid "February"
+msgstr "Febrero"
+
+#: ../setedit/calendar.cc:42
+msgid "March"
+msgstr "Marzo"
+
+#: ../setedit/calendar.cc:42
+msgid "April"
+msgstr "Abril"
+
+#: ../setedit/calendar.cc:42
+msgid "May"
+msgstr "May"
+
+#: ../setedit/calendar.cc:43
+msgid "June"
+msgstr "Junio"
+
+#: ../setedit/calendar.cc:43
+msgid "July"
+msgstr "Julio"
+
+#: ../setedit/calendar.cc:43
+msgid "August"
+msgstr "Agosto"
+
+#: ../setedit/calendar.cc:43
+msgid "September"
+msgstr "Septiembre"
+
+#: ../setedit/calendar.cc:43
+msgid "October"
+msgstr "Octubre"
+
+#: ../setedit/calendar.cc:44
+msgid "November"
+msgstr "Noviembre"
+
+#: ../setedit/calendar.cc:44
+msgid "December"
+msgstr "Diciembre"
+
+#: ../setedit/calendar.cc:193
+msgid "Su Mo Tu We Th Fr Sa"
+msgstr "Do Lu Ma Mi Ju Vi Sa"
+
+#: ../setedit/calendar.cc:296
+msgid "Calendar"
+msgstr "Calendario"
+
+#: ../setedit/debug.cc:307 ../setedit/debug.cc:8723
+msgid "Ok"
+msgstr "Todo bien"
+
+#: ../setedit/debug.cc:308
+msgid "Can't update"
+msgstr "No puede actualizarse"
+
+#: ../setedit/debug.cc:309
+msgid "Out of scope"
+msgstr "Fuera de mbito"
+
+#: ../setedit/debug.cc:522
+#, c-format
+msgid "Do you want to provide the path for: '%s'."
+msgstr "Desea indicar el directorio para: '%s'?"
+
+#. Bring a dialog to select it
+#: ../setedit/debug.cc:535
+msgid "Source file"
+msgstr "Fuente"
+
+#. Failed to stat or not regular file
+#: ../setedit/debug.cc:540
+#, c-format
+msgid "Can't use: '%s'."
+msgstr "No puedo usar: '%s'."
+
+#: ../setedit/debug.cc:550
+#, c-format
+msgid "Add path to list: '%s'?"
+msgstr "Lo agrego a la lista de directorios? (%s)"
+
+#: ../setedit/debug.cc:701 ../setedit/debug.cc:741
+msgid "The program is running and GDB/MI doesn't support async commands"
+msgstr ""
+"El programa se esta ejecutanfo y GDB/MI no soporta comandos asincrnicos"
+
+#: ../setedit/debug.cc:768
+msgid "Time out in gdb response. Continue waiting?"
+msgstr "El tiempo de respuesta de gdb es excesivo Sigo esperando?"
+
+#: ../setedit/debug.cc:827
+msgid "PID (Process ID) of the running process"
+msgstr "PID (ID de proceso) del proceso a depurar"
+
+#. EN: P
+#: ../setedit/debug.cc:830
+msgid "~P~ID:"
+msgstr "~P~ID:"
+
+#: ../setedit/debug.cc:883
+msgid "default"
+msgstr "por defecto"
+
+#. We don't even know what to debug ;-)
+#: ../setedit/debug.cc:903
+msgid "You must set the debug options first. Do you want to do it now?"
+msgstr "Debe indicar las opciones de depuracin. Desea hacerlo ahora?"
+
+#. Don't even try if the program doesn't exist
+#: ../setedit/debug.cc:918
+#, c-format
+msgid "The '%s' file doesn't exist"
+msgstr "El archivo '%s' no existe"
+
+#: ../setedit/debug.cc:947
+msgid "Hey! That's my PID!"
+msgstr "Epa! este es mi PID"
+
+#: ../setedit/debug.cc:955
+#, c-format
+msgid "Attached to PID %d"
+msgstr "Conectado con el PID %d"
+
+#. Don't even try if nothing to try ;-)
+#: ../setedit/debug.cc:964
+msgid ""
+"Please fill both 'Remote target options'. Try extended-remote for the type "
+"and IP:PORT for location."
+msgstr ""
+"Por favor rellene las dos 'Opciones del objetivo remoto'. Pruebe con "
+"extended-remote para el tipo y IP:PUERTO para el destino."
+
+#: ../setedit/debug.cc:974
+#, c-format
+msgid "At the '%s' machine run: 'gdbserver :%s program args...'"
+msgstr "En la mquina '%s' ejecute: 'gdbserver :%s programa params...'"
+
+#: ../setedit/debug.cc:980
+msgid "Run gdbserver at the remote machine"
+msgstr "Ejecute gdbserver en la mquina remota"
+
+#: ../setedit/debug.cc:1414 ../setedit/debug.cc:1788
+#, c-format
+msgid "%d: %s:%s:%d addr %p"
+msgstr "%d: %s:%s:%d dir. %p"
+
+#: ../setedit/debug.cc:1501
+msgid "Evaluate and Modify"
+msgstr "Evaluar y modificar"
+
+#. All together
+#. EN: AERTW
+#. ES: AELST
+#: ../setedit/debug.cc:1596 ../setedit/debug.cc:4644
+msgid "~E~xpression (escape \" characters: \\\")"
+msgstr "~E~xpresin (use \\\" para las \")"
+
+#: ../setedit/debug.cc:1598
+msgid "~N~ew value"
+msgstr "~N~uevo valor"
+
+#: ../setedit/debug.cc:1603
+msgid "C~h~ange"
+msgstr "C~a~mbiar"
+
+#: ../setedit/debug.cc:1607
+msgid "~I~nspect"
+msgstr "~I~nspeccionar"
+
+#: ../setedit/debug.cc:1642
+msgid "Nothing to inspect, please provide an expression"
+msgstr "Por favor indique una expresin a inspeccionar"
+
+#: ../setedit/debug.cc:1809
+msgid "No threads to select"
+msgstr "No hay hilos para seleccionar"
+
+#: ../setedit/debug.cc:1818
+msgid "Inconsistent info from gdb"
+msgstr "Informacin inconsistente desde gdb"
+
+#. Create a dialog to select them
+#: ../setedit/debug.cc:1829
+msgid "Select Thread"
+msgstr "Seleccionar Hilo"
+
+#: ../setedit/debug.cc:1837
+msgid "ID"
+msgstr "ID"
+
+#: ../setedit/debug.cc:1953
+msgid "Code"
+msgstr "Cdigo"
+
+#: ../setedit/debug.cc:2008
+msgid "No address associated with this line"
+msgstr "Esta lnea no tiene direccin asociada"
+
+#: ../setedit/debug.cc:2311
+msgid "Disassembler Window"
+msgstr "Ventana del Desensamblador"
+
+#: ../setedit/debug.cc:2402
+msgid "Modify register"
+msgstr "Modificar registro"
+
+#: ../setedit/debug.cc:2472
+#, c-format
+msgid " Disassembler [%p-%p]"
+msgstr " Desensamblador [%p-%p]"
+
+#: ../setedit/debug.cc:2969
+msgid "Modify variable"
+msgstr "Modificar variable"
+
+#: ../setedit/debug.cc:3125 ../setedit/debug.cc:3129
+msgid "Format"
+msgstr "Formato"
+
+#: ../setedit/debug.cc:3130
+msgid "~N~atural"
+msgstr "~N~atural"
+
+#: ../setedit/debug.cc:3131
+msgid "~B~inary"
+msgstr "~B~inario"
+
+#: ../setedit/debug.cc:3132
+msgid "~D~ecimal"
+msgstr "~D~ecimal"
+
+#: ../setedit/debug.cc:3133
+msgid "~H~exadecimal"
+msgstr "~H~exadecimal"
+
+#: ../setedit/debug.cc:3134
+msgid "~O~ctal"
+msgstr "~O~ctal"
+
+#: ../setedit/debug.cc:3232 ../setedit/debug.cc:3269
+msgid "Inspector"
+msgstr "Inspector"
+
+#: ../setedit/debug.cc:3349
+#, c-format
+msgid " Inspector %s"
+msgstr " Inspector %s"
+
+#: ../setedit/debug.cc:3430
+msgid "Inspect variable"
+msgstr "Inspeccionar variable"
+
+#: ../setedit/debug.cc:3528
+msgid "None"
+msgstr "Ninguna"
+
+#: ../setedit/debug.cc:3724
+#, c-format
+msgid "%d breakpoints failed to apply, they are disabled now."
+msgstr "No pudieron aplicarse %d breakpoints, fueron deshabilitados."
+
+#. EN: CDEFHILNOSTUW
+#. ES: ABCDFHILORSUV
+#: ../setedit/debug.cc:3892
+msgid "Type"
+msgstr "Tipo"
+
+#: ../setedit/debug.cc:3893
+msgid "File/L~i~ne"
+msgstr "~A~rchivo/Lnea"
+
+#: ../setedit/debug.cc:3894
+msgid "Fu~n~ction"
+msgstr "~F~uncin"
+
+#: ../setedit/debug.cc:3895
+msgid "File/Functi~o~n"
+msgstr "A~r~chivo/Funcin"
+
+#: ../setedit/debug.cc:3896 ../setedit/editmenu.cc:408
+msgid "~A~ddress"
+msgstr "~D~ireccin"
+
+#. Same width
+#: ../setedit/debug.cc:3898
+msgid " ~F~ilename"
+msgstr " Arc~h~ivo"
+
+#. Same width
+#: ../setedit/debug.cc:3901
+msgid " F~u~nction"
+msgstr " F~u~ncin"
+
+#. Same width
+#: ../setedit/debug.cc:3904
+msgid " ~L~ine"
+msgstr " ~L~nea"
+
+#. Same width
+#: ../setedit/debug.cc:3907
+msgid " Addre~s~s"
+msgstr "D~i~reccin"
+
+#. Same width
+#: ../setedit/debug.cc:3910
+msgid "Con~d~ition"
+msgstr "~C~ondicin"
+
+#. Same width
+#: ../setedit/debug.cc:3913
+msgid " Coun~t~"
+msgstr " ~V~eces"
+
+#: ../setedit/debug.cc:3915
+msgid " T~h~read"
+msgstr " Hil~o~"
+
+#: ../setedit/debug.cc:3918 ../setedit/debug.cc:4650
+msgid "~E~nabled"
+msgstr "Ha~b~ilitado"
+
+#: ../setedit/debug.cc:3919
+msgid "Hard~w~are assisted"
+msgstr "A~s~istido por hardware"
+
+#: ../setedit/debug.cc:3945
+msgid "Sorry, you can't perform this operation right now"
+msgstr "Lo lamento, no puede realizar esta operacin ahora"
+
+#: ../setedit/debug.cc:3953
+#, c-format
+msgid "Error: %s (%d) [%s]"
+msgstr "Error: %s (%d) [%s]"
+
+#: ../setedit/debug.cc:3955 ../setedit/debug.cc:7307
+#, c-format
+msgid "Error: %s (%d)"
+msgstr "Error: %s (%d)"
+
+#: ../setedit/debug.cc:4051
+msgid "Modify breakpoint"
+msgstr "Modificar breakpoint"
+
+#: ../setedit/debug.cc:4090
+msgid "Add breakpoint"
+msgstr "Agregar breakpoint"
+
+#: ../setedit/debug.cc:4260
+msgid "Breakpoints"
+msgstr "Breakpoints"
+
+#. The following is quite annoying because we construct the format from its
+#. parts.
+#. Keep 1 char
+#: ../setedit/debug.cc:4282
+msgid "E"
+msgstr "H"
+
+#: ../setedit/debug.cc:4283
+msgid "Where"
+msgstr "Donde"
+
+#: ../setedit/debug.cc:4284
+msgid "Condition"
+msgstr "Condicin"
+
+#. Keep 5 chars
+#: ../setedit/debug.cc:4286
+msgid "Count"
+msgstr "Veces"
+
+#. Keep 5 chars
+#: ../setedit/debug.cc:4288
+msgid "Thre."
+msgstr "Hilo"
+
+#: ../setedit/debug.cc:4306 ../setedit/debug.cc:4913
+msgid "~M~odify"
+msgstr "~M~odificar"
+
+#: ../setedit/debug.cc:4307 ../setedit/debug.cc:4914 ../setedit/editmenu.cc:63
+msgid "~N~ew"
+msgstr "~N~uevo"
+
+#: ../setedit/debug.cc:4310 ../setedit/debug.cc:4917
+msgid "D~i~sable"
+msgstr "~D~eshabilitar"
+
+#: ../setedit/debug.cc:4311
+msgid "~S~how"
+msgstr "~I~r a"
+
+#: ../setedit/debug.cc:4515
+#, c-format
+msgid "%d watchpoints failed to apply, they are disabled now."
+msgstr "No pudieron aplicarse %d watchpoints, fueron deshabilitados."
+
+#: ../setedit/debug.cc:4646
+msgid "~T~ype"
+msgstr "~T~ipo"
+
+#: ../setedit/debug.cc:4647
+msgid "~W~rite"
+msgstr "E~s~critura"
+
+#: ../setedit/debug.cc:4648
+msgid "~R~ead"
+msgstr "~L~ectura"
+
+#: ../setedit/debug.cc:4649
+msgid "~A~ccess (read or write)"
+msgstr "~A~cceso (lectura o escritura)"
+
+#: ../setedit/debug.cc:4691
+msgid "Modify watchpoint"
+msgstr "Modificar watchpoint"
+
+#: ../setedit/debug.cc:4732
+msgid "Add watchpoint"
+msgstr "Agregar watchpoint"
+
+#: ../setedit/debug.cc:4890
+msgid "Watchpoints"
+msgstr "Watchpoints"
+
+# End of header
+#: ../setedit/debug.cc:4906
+msgid " E R/W Expression"
+msgstr " H L/E Expresin"
+
+#: ../setedit/debug.cc:5100
+msgid "Unaccessable memory address specified"
+msgstr "Direccin de memoria inaccesible"
+
+#: ../setedit/debug.cc:5139
+msgid "Error in expression, an integer is needed"
+msgstr "Error en la expresin, debe ser un entero"
+
+#: ../setedit/debug.cc:5843
+msgid "~N~ew Value"
+msgstr "~N~uevo Valor"
+
+#: ../setedit/debug.cc:5844
+msgid "~F~rom"
+msgstr "~D~esde"
+
+#: ../setedit/debug.cc:5845
+msgid "~T~o"
+msgstr "~D~estino"
+
+#: ../setedit/debug.cc:5847
+msgid "~L~ength"
+msgstr "~L~argo"
+
+#: ../setedit/debug.cc:5848
+msgid "~V~alue"
+msgstr "~V~alor"
+
+#: ../setedit/debug.cc:5909
+msgid "Please fill all the requested values"
+msgstr "Por favor rellene todos los valores requeridos"
+
+#: ../setedit/debug.cc:5931
+#, c-format
+msgid "For security reasons the maximum length is limited to %lu bytes"
+msgstr "Por razones de seguridad el largo mximo esta limitado a %lu bytes"
+
+#: ../setedit/debug.cc:5937
+msgid "This could be slow. Do you want to continue?"
+msgstr "Esto podra ser lento. Desea continuar?"
+
+#: ../setedit/debug.cc:5961
+msgid "Write block to file"
+msgstr "Guardar bloque en un archivo"
+
+#: ../setedit/debug.cc:5961
+msgid "Read block from file"
+msgstr "Leer desde bloque desde un archivo"
+
+#: ../setedit/debug.cc:6181
+msgid "Base Address"
+msgstr "Direccin base"
+
+#. goto to a new address
+#: ../setedit/debug.cc:6208 ../setedit/debug.cc:6409
+msgid "Data window"
+msgstr "Ventana de Datos"
+
+#: ../setedit/debug.cc:6224
+msgid "Fill Block"
+msgstr "Rellenar Bloque"
+
+#: ../setedit/debug.cc:6233
+msgid "Clear Block"
+msgstr "Borrar Bloque"
+
+#: ../setedit/debug.cc:6242
+msgid "Move Block"
+msgstr "Mover Bloque"
+
+#: ../setedit/debug.cc:6260
+msgid "Read Block"
+msgstr "Leer Bloque"
+
+#: ../setedit/debug.cc:6264
+#, c-format
+msgid "%u bytes read."
+msgstr "%u bytes leidos."
+
+#: ../setedit/debug.cc:6274
+msgid "Write Block"
+msgstr "Escribir Bloque"
+
+#: ../setedit/debug.cc:6282
+#, c-format
+msgid "%u bytes written."
+msgstr "%u bytes escritos."
+
+#: ../setedit/debug.cc:6442
+msgid "Not implemented for your platform, please help to implement it"
+msgstr "No implementado para su plataforma. Por favor ayude a hacerlo."
+
+#: ../setedit/debug.cc:6540
+#, c-format
+msgid " Data Window %s"
+msgstr " Ventana de Datos %s"
+
+#: ../setedit/debug.cc:6874
+#, c-format
+msgid " Debugger Window [%s]"
+msgstr " Ventana del depurador [%s]"
+
+#: ../setedit/debug.cc:6985
+msgid "Send command to gdb"
+msgstr "Enviar un comando al gdb"
+
+#. EN: C
+#: ../setedit/debug.cc:6988
+msgid "~C~ommand, be careful!"
+msgstr "~C~omando a enviar Tenga cuidado!"
+
+#: ../setedit/debug.cc:7122
+msgid "Debugger Window"
+msgstr "Ventana del Depurador"
+
+#: ../setedit/debug.cc:7220
+msgid "Disconnected"
+msgstr "Desconectado"
+
+#: ../setedit/debug.cc:7223
+msgid "Connected"
+msgstr "Conectado"
+
+#: ../setedit/debug.cc:7226
+msgid "Ready to Run"
+msgstr "Listo para Ejecutar"
+
+#: ../setedit/debug.cc:7229
+msgid "Running"
+msgstr "Ejecutando"
+
+#: ../setedit/debug.cc:7232
+msgid "Stopped"
+msgstr "Detenido"
+
+#: ../setedit/debug.cc:7237
+msgid "Not started"
+msgstr "No inicializado"
+
+#: ../setedit/debug.cc:7333
+#, c-format
+msgid "Mode: %s (%s) [%s]"
+msgstr "Modo: %s (%s) [%s]"
+
+#: ../setedit/debug.cc:7339
+#, c-format
+msgid "Mode: Remote (%s) [%s]"
+msgstr "Modo: Remoto (%s) [%s]"
+
+#: ../setedit/debug.cc:7388
+#, c-format
+msgid "Reason stopped: %s"
+msgstr "Detenido por: %s"
+
+#: ../setedit/debug.cc:7392
+msgid "Returned immediatly"
+msgstr "Retorn inmediatamente"
+
+#: ../setedit/debug.cc:7538
+#, c-format
+msgid "%s: Not yet in debugger"
+msgstr "%s: An no pasado al depurador"
+
+#: ../setedit/debug.cc:7557
+msgid "Wait until the process is stopped to delete this watch"
+msgstr "Espere a que el proceso se detenga para eliminar este visor"
+
+#: ../setedit/debug.cc:7579
+msgid "Error deleting variable"
+msgstr "Error eliminando una variable."
+
+#: ../setedit/debug.cc:7683
+#, c-format
+msgid " Watches Window (%d watches)"
+msgstr " Ventana de Visores (%d visores)"
+
+#: ../setedit/debug.cc:7775
+msgid "Add to watch list"
+msgstr "Agregar a la lista de visores"
+
+#: ../setedit/debug.cc:7809
+msgid "Change the expression to watch"
+msgstr "Cambiar la expresin de un visor"
+
+#: ../setedit/debug.cc:7859
+msgid "Watches"
+msgstr "Visores"
+
+#: ../setedit/debug.cc:8056
+msgid "Choose file"
+msgstr "Elija un archivo"
+
+#: ../setedit/debug.cc:8068
+msgid "Browse"
+msgstr "Explorar"
+
+#: ../setedit/debug.cc:8109
+msgid "Debug Options"
+msgstr "Opciones de Depuracin"
+
+#. All together
+#: ../setedit/debug.cc:8115
+msgid "~P~rogram to debug, with debug info"
+msgstr "~P~rograma a depurar (con info. de depuracin)"
+
+#: ../setedit/debug.cc:8117
+msgid "~M~ode"
+msgstr "~M~odo"
+
+#: ../setedit/debug.cc:8118
+msgid "Local with ~e~xecutable"
+msgstr "Local con un ~e~jecutable"
+
+#: ../setedit/debug.cc:8119
+msgid "Local with r~u~nning process"
+msgstr "Local ~u~sando un proceso en ejecucin"
+
+#: ../setedit/debug.cc:8120
+msgid "Remote (g~d~bserver/stub)"
+msgstr "Remoto (g~d~bserver/stub)"
+
+#: ../setedit/debug.cc:8121
+msgid "Local target options"
+msgstr "Opciones del objetivo local"
+
+#: ../setedit/debug.cc:8122
+msgid "Program ~a~rguments, not for remote mode"
+msgstr "P~a~rmetros del programa, no para el modo remoto"
+
+#: ../setedit/debug.cc:8124
+msgid "Forced ~t~erminal, leave blank for auto"
+msgstr "Forzar la ~t~erminal, deje en blanco para no forzarla"
+
+#: ../setedit/debug.cc:8126
+msgid "Remote target options"
+msgstr "Opciones para el objetivo remoto"
+
+#: ../setedit/debug.cc:8127
+msgid "Remote p~r~otocol type"
+msgstr "Tipo de p~r~otocolo remoto"
+
+#: ../setedit/debug.cc:8129
+msgid "Remote ~l~ocation"
+msgstr "Dest~i~no remoto"
+
+#: ../setedit/debug.cc:8149
+msgid "Your program compiled with -g"
+msgstr "Su programa compilado con -g"
+
+#: ../setedit/debug.cc:8175
+msgid "Advanced Debug Options"
+msgstr "Opciones Avanzadas de Depuracin"
+
+#. All together
+#: ../setedit/debug.cc:8181
+msgid "~G~DB executable"
+msgstr "Ejecutable del ~g~db"
+
+#: ../setedit/debug.cc:8182
+msgid "~X~ terminal executable"
+msgstr "Ejecutable de la terminal ~X~"
+
+#: ../setedit/debug.cc:8183
+msgid "~M~ain function"
+msgstr "Funcin ~m~ain"
+
+#: ../setedit/debug.cc:8186
+msgid "GDB ~T~ime out [s]"
+msgstr "~T~ime out GDB [s]"
+
+#: ../setedit/debug.cc:8187
+msgid "Max. ~l~ines in Debug window"
+msgstr "Max. ~l~neas vent. de Dep."
+
+#: ../setedit/debug.cc:8188
+msgid "M~i~scellaneous"
+msgstr "Opciones var~i~as"
+
+#: ../setedit/debug.cc:8189
+msgid "No gdb ~b~anner after connecting"
+msgstr "No mostrar la versin de gd~b~ al inicio"
+
+#: ../setedit/debug.cc:8190
+msgid "Enable MI v2 ~f~eatures"
+msgstr "H~a~bilitar MI v2"
+
+#: ../setedit/debug.cc:8191
+msgid "No ~s~ymbols bug workaround"
+msgstr "No evitar el bug de carga de ~s~mbolos"
+
+#: ../setedit/debug.cc:8192
+msgid "No source ~c~ode in disasm. window"
+msgstr "No mostrar el ~f~uente en la vent. del des."
+
+#: ../setedit/debug.cc:8264
+msgid "Messages"
+msgstr "Mensajes"
+
+#. EN: ACDFLT
+#. ES: CDELRT
+#: ../setedit/debug.cc:8268
+msgid "~D~isplay messages related to"
+msgstr "Mostrar mensajes relaciona~d~os con"
+
+#: ../setedit/debug.cc:8269
+msgid "GDB ~c~onsole (CLI)"
+msgstr "La ~c~onsola de gdb (CLI)"
+
+#: ../setedit/debug.cc:8270
+msgid "T~a~rget (not really implemented in gdb)"
+msgstr "El obje~t~ivo (no implementado en gdb)"
+
+#: ../setedit/debug.cc:8271
+msgid "~L~og (gdb internal messages)"
+msgstr "~L~og (mensajes internos del gdb)"
+
+#: ../setedit/debug.cc:8272
+msgid "GDB/MI commands sent ~t~o gdb"
+msgstr "Comandos GDB/MI ~e~nviados a gdb"
+
+#: ../setedit/debug.cc:8273
+msgid "GDB/MI responses ~f~rom gdb"
+msgstr "Respuestas GDB/MI ~r~ecibidos desde gdb"
+
+#: ../setedit/debug.cc:8313
+msgid "Clean elements"
+msgstr "Borrar elementos"
+
+#: ../setedit/debug.cc:8317
+msgid "Elements"
+msgstr "Elementos"
+
+#: ../setedit/debug.cc:8318
+msgid "~B~reakpoints"
+msgstr "~B~reakpoints"
+
+#: ../setedit/debug.cc:8319
+msgid "~W~atchpoints"
+msgstr "~W~atchpoints"
+
+#: ../setedit/debug.cc:8320
+msgid "W~a~tches"
+msgstr "~V~isores"
+
+#: ../setedit/debug.cc:8321
+msgid "~I~nspectors"
+msgstr "~I~nspectores"
+
+#: ../setedit/debug.cc:8322
+msgid "~D~ata windows"
+msgstr "V~e~ntanas de Datos"
+
+#: ../setedit/debug.cc:8704
+msgid "Hit a breakpoint"
+msgstr "Breakpoint"
+
+#: ../setedit/debug.cc:8705
+msgid "Write watchpoint"
+msgstr "Escritura a un watchpoint"
+
+#: ../setedit/debug.cc:8706
+msgid "Read watchpoint"
+msgstr "Lectura de un watchpoint"
+
+#: ../setedit/debug.cc:8707
+msgid "Access watchpoint"
+msgstr "Acceso a un watchpoint"
+
+#: ../setedit/debug.cc:8708
+msgid "Watchpoint out of scope"
+msgstr "Watchpoint fuera de mbito"
+
+#: ../setedit/debug.cc:8709
+msgid "Function finished"
+msgstr "Fin de la funcin"
+
+#: ../setedit/debug.cc:8710
+msgid "Location reached"
+msgstr "Lleg al punto indicado"
+
+#: ../setedit/debug.cc:8711
+msgid "End of stepping"
+msgstr "Fin de avance paso a paso"
+
+#: ../setedit/debug.cc:8712
+msgid "Exited signalled"
+msgstr "Finaliz por una seal (signal)"
+
+#: ../setedit/debug.cc:8713
+msgid "Exited with error"
+msgstr "Finaliz con error"
+
+#: ../setedit/debug.cc:8714
+msgid "Exited normally"
+msgstr "Finaliz normalmente"
+
+#: ../setedit/debug.cc:8715
+msgid "Signal received"
+msgstr "Recibi una seal (signal)"
+
+#: ../setedit/debug.cc:8716
+msgid "Unknown (temp bkp?)"
+msgstr "Desconocida (bkp temporal?)"
+
+#: ../setedit/debug.cc:8717
+msgid "natural"
+msgstr "natural"
+
+#: ../setedit/debug.cc:8718
+msgid "binary"
+msgstr "binario"
+
+#: ../setedit/debug.cc:8719
+msgid "decimal"
+msgstr "decimal"
+
+#: ../setedit/debug.cc:8720
+msgid "hexadecimal"
+msgstr "hexadecimal"
+
+#: ../setedit/debug.cc:8721
+msgid "octal"
+msgstr "octal"
+
+#: ../setedit/debug.cc:8725
+msgid "Pipe creation"
+msgstr "Creacin de un pipe"
+
+#: ../setedit/debug.cc:8726
+msgid "Fork failed"
+msgstr "Fallo en fork"
+
+#: ../setedit/debug.cc:8727
+msgid "GDB not running"
+msgstr "GDB no activo"
+
+#: ../setedit/debug.cc:8728
+msgid "Parser failed"
+msgstr "Fallo en el parser"
+
+#: ../setedit/debug.cc:8729
+msgid "Unknown asyn response"
+msgstr "Respuesta asincrnica desconocida"
+
+#: ../setedit/debug.cc:8730
+msgid "Unknown result response"
+msgstr "Respuesta de resultado desconocida"
+
+#: ../setedit/debug.cc:8731
+msgid "Error from gdb"
+msgstr "Error desde el gdb"
+
+#: ../setedit/debug.cc:8733
+msgid "Time out in gdb response"
+msgstr "Tiempo de respuesta de gdb es excesivo"
+
+#: ../setedit/debug.cc:8734
+msgid "GDB suddenly died"
+msgstr "GDB muri sin razn"
+
+#: ../setedit/debug.cc:8735
+msgid "Can't execute X terminal"
+msgstr "No pude ejecutar una terminal X"
+
+#: ../setedit/debug.cc:8736
+msgid "Failed to create temporal"
+msgstr "Fallo al crear un temporal"
+
+#: ../setedit/debug.cc:8737
+msgid "Can't execute the debugger"
+msgstr "No pude ejecutar el depurador"
+
+#: ../setedit/dskascii.cc:39
+msgid " ASCII chart"
+msgstr " Tabla ASCII"
+
+#: ../setedit/dskcalen.cc:43
+msgid " Calendar "
+msgstr " Calendario "
+
+#: ../setedit/dskclip.cc:67
+#, c-format
+msgid " Clipboard (%d bytes)"
+msgstr " Portapapeles (%d bytes)"
+
+#: ../setedit/dskclose.cc:57
+msgid " Closed: "
+msgstr " Cerrado: "
+
+#: ../setedit/dskhelp.cc:120
+#, c-format
+msgid " Main InfView (%s)%s"
+msgstr " InfView principal (%s)%s"
+
+#: ../setedit/dskhelp.cc:123
+#, c-format
+msgid " InfView (%s)%s"
+msgstr " InfView (%s)%s"
+
+#: ../setedit/dskmessa.cc:86
+#, c-format
+msgid " Message Window (%d lines)"
+msgstr " Ventana de mensajes (%d lneas)"
+
+#: ../setedit/dskman.cc:59
+#, c-format
+msgid " Man page: %s"
+msgstr " Pgina del manual: %s"
+
+#: ../setedit/dskmp3.cc:42
+msgid " MP3 Control panel"
+msgstr " Panel de control MP3"
+
+#: ../setedit/dstfile.cc:876
+msgid "Wrong desktop file. May be owned by other user."
+msgstr "Archivo de escritorio incorrecto o perteneciente a otro usuario"
+
+#: ../setedit/dstfile.cc:882
+msgid "The desktop file is too old."
+msgstr "El archivo de escritorio es de una version muy vieja."
+
+#: ../setedit/dstfile.cc:887
+msgid "You need a newer editor for this desktop file."
+msgstr ""
+"Ud. necesita una nueva versin del editor para este archivo de escritorio."
+
+#: ../setedit/edcolor.cc:180
+msgid "Color Themes"
+msgstr "Esquemas de Colores"
+
+#: ../setedit/editdiag.cc:39
+msgid " A friendly text editor."
+msgstr " Un editor de texto amigable."
+
+#: ../setedit/editdiag.cc:40
+#, c-format
+msgid "Version: %lX.%lX.%lX Revision: %d"
+msgstr "Versin: %lX.%lX.%lX Revisin: %d"
+
+#: ../setedit/editdiag.cc:41
+#, c-format
+msgid "That's SET's Editor \"%s\", (c) %s"
+msgstr "Este es el editor de SET \"%s\", (c) %s"
+
+#: ../setedit/editdiag.cc:42
+#, c-format
+msgid "Platform: %s Driver: %s"
+msgstr "Plataforma: %s Driver: %s"
+
+#: ../setedit/editdiag.cc:43
+msgid " by Salvador Eduardo Tropea"
+msgstr " hecho por Salvador Eduardo Tropea"
+
+#: ../setedit/editdiag.cc:69 ../setedit/editdiag.cc:124
+msgid "About"
+msgstr "Acerca de"
+
+#: ../setedit/editdiag.cc:144
+msgid "The FSF and GNU people for such good tools"
+msgstr "La gente de la FSF y el proyecto GNU por tan buenas herramientas"
+
+#: ../setedit/editdiag.cc:145
+msgid "DJ Delorie and collaborators for porting it to DOS"
+msgstr "DJ Delorie y sus colaboradores por portarlas a DOS"
+
+#: ../setedit/editdiag.cc:146
+msgid "Robert Hoehne for porting TVision and making RHIDE"
+msgstr "Robert Hhne por portar TV y crear RHIDE"
+
+#: ../setedit/editdiag.cc:147
+msgid "Vadim Belodorov for contributing the first port of TV to Win32"
+msgstr "Vadim Belodorov por contribuir el primer port de TV a Win32"
+
+#: ../setedit/editdiag.cc:148
+msgid "Anatoli Soltan for porting to Win32 using BC++"
+msgstr "Anatoli Soltan por portar a Win32 usando BC++"
+
+#: ../setedit/editdiag.cc:149
+msgid "VA Linux and the people who maintain Source Forge"
+msgstr "El equipo de VA Linux que mantiene Source Forge"
+
+#: ../setedit/editdiag.cc:150
+msgid "The University of California, Berkeley and its contributors"
+msgstr "La Universidad de California, Berkeley y sus colaboradores"
+
+#: ../setedit/editdiag.cc:152
+msgid "The University of Cambridge for the PCRE package"
+msgstr "La University of Cambridge por la librera PCRE"
+
+#: ../setedit/editdiag.cc:155
+msgid "Shawn Hargreaves for Allegro; used as the sound engine"
+msgstr "Shawn Hargreaves por Allegro, usado como motor de sonido"
+
+#: ../setedit/editdiag.cc:157
+msgid ""
+"Tomislav Uzelac for AMP, MP3 engine and Ove Kaaven for adapting to Allegro"
+msgstr "Tomislav Uzelac por AMP, motor MP3 y Ove Kaaven por adapt. p/Allegro"
+
+#: ../setedit/editdiag.cc:160
+msgid "Jean-loup Gailly and Mark Adler for the zlib"
+msgstr "Jean-loup Gailly and Mark Adler por la biblioteca zlib"
+
+#: ../setedit/editdiag.cc:162
+msgid "Julian R. Seward for bzip2 routines included"
+msgstr "Julian R. Seward por las rutinas bzip2 usadas"
+
+#: ../setedit/editdiag.cc:164
+msgid "Bjorn Reese for a lot of ideas about the stack debugger of UNIX"
+msgstr "Bjorn Reese por varias ideas para el `stack debugger' para UNIX"
+
+#: ../setedit/editdiag.cc:165
+msgid "All my friends that support my project (Laszlo, Marek, Ivan,"
+msgstr "Todos mis amigos que soportaron mi proyecto (Laszlo, Marek,"
+
+#: ../setedit/editdiag.cc:166
+msgid "Grzegorz, Andris, etc.)."
+msgstr "Ivan, Grzegorz, Andris, etc.)."
+
+#: ../setedit/editdiag.cc:172
+msgid "Thanks to:"
+msgstr "Agradecimientos para:"
+
+#: ../setedit/editdiag.cc:178
+msgid "Made in Argentina"
+msgstr "Hecho en Argentina"
+
+#: ../setedit/editmain.cc:135
+msgid "Do you want to delete all the .BKP, desktop and project files?"
+msgstr "Desea borrar todos los archivos de respaldo y escritorio?"
+
+#: ../setedit/editmain.cc:462
+msgid "No project loaded"
+msgstr "No hay proyecto cargado"
+
+#: ../setedit/editmain.cc:521
+msgid "This file is already open, close it first."
+msgstr "Este archivo ya esta abierto, primero cirrelo."
+
+#: ../setedit/editmain.cc:608
+msgid "Open File"
+msgstr "Abrir Archivo"
+
+#: ../setedit/editmain.cc:623
+msgid "You must select an editor window for this operation"
+msgstr "Ud. debe seleccionar una ventana de esitor para esta operacin"
+
+#: ../setedit/editmain.cc:758
+msgid "Export file as"
+msgstr "Exportar archivo como"
+
+#: ../setedit/editmain.cc:848
+msgid "This window can't be printed. Select an editor window instead"
+msgstr "Esta ventana no puede imprimirse, seleccione un editor"
+
+#: ../setedit/editmain.cc:1014
+msgid "Couldn't find any matching help"
+msgstr "No pude encontrar ninguna ayuda"
+
+#: ../setedit/editmain.cc:1197
+msgid "A background task is still running, exit anyway?"
+msgstr ""
+"Estamos ejecutando una tarea en segundo plano. Salir de todas maneras?"
+
+#: ../setedit/editmain.cc:1950
+msgid "This line no longer exists"
+msgstr "Esta lnea ya no existe"
+
+#: ../setedit/editmain.cc:2118
+msgid "Error creating the difference, aborting"
+msgstr "Error al buscar los cambios, operacin abortada"
+
+#: ../setedit/editmain.cc:2194
+#, c-format
+msgid "The disk copy of %s is newer, reload it?"
+msgstr "La copia en disco de `%s' es ms nueva, la cargo?"
+
+#: ../setedit/editmain.cc:2468
+msgid ""
+"I can't find the readme.1st file, please look for it in the .ZIP and read "
+"the file."
+msgstr ""
+"No puedo encontrar el archivo readme.1st, bsquelo en el paquete que instal."
+
+#: ../setedit/editmain.cc:2603
+#, c-format
+msgid ""
+"\n"
+"Wrong installation! You must define the %s environment variable.\n"
+msgstr ""
+"\n"
+"Instalacin errnea! Debe definir la variable de entorno %s.\n"
+
+#: ../setedit/editmain.cc:2604
+#, c-format
+msgid ""
+"Read the readme.1st file included in the .zip distribution file.\n"
+"\n"
+msgstr ""
+"Lea el archivo readme.1st incluido en la distribucin.\n"
+"\n"
+
+#: ../setedit/editmain.cc:2608
+#, c-format
+msgid ""
+"I suggest that: SET %s=%s/%s\n"
+"\n"
+msgstr ""
+"Sugiero usar esto: SET %s=%s/%s\n"
+"\n"
+
+#: ../setedit/editmain.cc:2610
+#, c-format
+msgid ""
+"I suggest that: SET %s=%s\n"
+"\n"
+msgstr ""
+"Sugiero usar esto: SET %s=%s\n"
+"\n"
+
+#: ../setedit/editmain.cc:2615
+#, c-format
+msgid "press ENTER to continue\n"
+msgstr "presione INTRO para continuar\n"
+
+#: ../setedit/editmain.cc:2624
+msgid ""
+"\n"
+"You defined SET_FILES wrongly, it doesn't point to a directory.\n"
+"\n"
+msgstr ""
+"\n"
+"Ud. defini SET_FILES equivocadamente, no apunta a un directorio.\n"
+"\n"
+
+#: ../setedit/editmain.cc:2653
+msgid "Memory is nearly full. Please exit, and restart."
+msgstr "La memoria esta casi agotada. Por favor vuelva a iniciar el programa."
+
+#: ../setedit/editmain.cc:2898
+msgid "Setedit "
+msgstr "Setedit "
+
+#: ../setedit/editmain.cc:2900
+msgid ". Copyright (c) "
+msgstr ". Copyright (c) "
+
+#: ../setedit/editmain.cc:2902
+msgid ""
+" by Salvador E. Tropea\n"
+"\n"
+msgstr ""
+" por Salvador Eduardo Tropea\n"
+"\n"
+
+#: ../setedit/editmain.cc:2904
+msgid ""
+"setedit [options] [file_name ...]\n"
+"\n"
+msgstr ""
+"setedit [opciones] [nombre_archivo ...]\n"
+"\n"
+
+#: ../setedit/editmain.cc:2906
+msgid ""
+"+[line number] jumps to the specified line. It only affects the "
+"next\n"
+" file in the list and should be specified after the\n"
+" options. If the line number is omitted you'll jump "
+"to\n"
+" the end of the text. Example: +6 file\n"
+msgstr ""
+"+[nmero de lnea] salta a la lnea especificada. Slo afecta al "
+"prximo\n"
+" archivo en la lista y debera ser especificado "
+"luego\n"
+" de las opciones. Si el nmero de lnea es omitido "
+"se\n"
+" salta al final del texto. Ejemplo: +6 archivo\n"
+
+#: ../setedit/editmain.cc:2910
+msgid "-c, --cascade: arranges the windows using cascade style.\n"
+msgstr "-c, --cascade: ordena las ventanas estilo cascada.\n"
+
+#: ../setedit/editmain.cc:2911
+msgid ""
+"-d, --stack-dbg=n: indicates which method will be used in the event of "
+"a\n"
+" crash. The default method is 0.\n"
+" 0: dump unsaved buffers and stack calls.\n"
+" 1: do nothing (conservative).\n"
+msgstr ""
+"-d, --stack-dbg=n: indica el mtodo a usar en caso de un error fatal "
+"del\n"
+" programa. Si no se especifica se usar el 0.\n"
+" 0: grabar texto pendiente y pila de ejecucin.\n"
+" 1: no hacer nada (conservador).\n"
+
+#: ../setedit/editmain.cc:2916
+msgid ""
+" 2: dump unsaved buffers and call debugger to get\n"
+" information. Then die.\n"
+" 3: like 2 but stay in the debugger.\n"
+msgstr ""
+" 2: grabar texto pendiente y llamar al depurador "
+"para\n"
+" obtener informacin. Finalmente morir.\n"
+" 3: como 2 pero permanecer en el depurador "
+"(debugger).\n"
+
+#: ../setedit/editmain.cc:2920
+msgid ""
+"-f, --file-list file_n: loads the files listed in file_n, each line in "
+"this\n"
+" file must contain only one file name.\n"
+msgstr ""
+"-f, --file-list file_n: carga los archivos listados en file_n, cada lnea\n"
+" del archivo file_n es interpretada como un nombre.\n"
+
+#: ../setedit/editmain.cc:2922
+msgid ""
+"-h, --help: displays this text ;-).\n"
+"\n"
+msgstr ""
+"-h, --help: muestra este texto ;-).\n"
+"\n"
+
+#: ../setedit/editmain.cc:2924
+msgid ""
+"-k, --use-rh-52-keys: enables the Red Hat 5.2 style keyboard mapping.\n"
+msgstr "-k, --use-rh-52-keys: usar el mapeo de teclado de Red Hat 5.2.\n"
+
+#: ../setedit/editmain.cc:2926
+msgid "-K, --keybind file_name: uses the specified name as keybinding file.\n"
+msgstr ""
+"-K, --keybind nom_arch: utiliza el rachivo indicado para definir el "
+"teclado.\n"
+
+#: ../setedit/editmain.cc:2928
+msgid "-l, --force-no-lfn: avoids the use of long file names under W9x.\n"
+msgstr "-l, --force-no-lfn evita el uso de nombres largos en W9x.\n"
+
+#: ../setedit/editmain.cc:2929
+msgid "-L, --force-lfn: forces the use of long file names under W9x.\n"
+msgstr "-L, --force-lfn: fuerza el uso de nombres largos en W9x.\n"
+
+#: ../setedit/editmain.cc:2930
+msgid "-m, --no-mouse-hook: don't hook the mouse interrupt, poll it.\n"
+msgstr "-m, --no-mouse-hook: no utilizar la interrupcin del mouse.\n"
+
+#: ../setedit/editmain.cc:2933
+msgid "-M, --no-mixer: disable board level mixer.\n"
+msgstr "-M, --no-mixer: deshabilita el mezclador de sonido.\n"
+
+#: ../setedit/editmain.cc:2935
+msgid ""
+"-p, --project file_name: loads the indicated project, if the file doesn't "
+"exist\n"
+" the editor creates a new one\n"
+msgstr ""
+"-p, --project nombre_ar: carga el proyecto indicado, si no existe uno nuevo\n"
+" es creado\n"
+
+#: ../setedit/editmain.cc:2937
+msgid ""
+"-r, --no-redirect: disables the stderr redirection. Only used during\n"
+" debugging.\n"
+msgstr ""
+"-r, --no-redirect: desabilita el redireccionamiento de `stderr'. Solo\n"
+" usado durante la depuracin del programa.\n"
+
+#: ../setedit/editmain.cc:2940
+msgid ""
+"-S, --low-vga-save: use low level functions to save/restore VGA state.\n"
+msgstr ""
+"-S, --low-vga-save: usar rutinas de bajo nivel para grabar/restaurar "
+"el\n"
+" estado del chip VGA.\n"
+
+#: ../setedit/editmain.cc:2942
+msgid "-t, --tile-vert: the windows are arranged vertically.\n"
+msgstr ""
+"-t, --tile-vert: ordena las ventanas estilo mosaico vertical.\n"
+
+#: ../setedit/editmain.cc:2943
+msgid "-T, --tile-horiz: the windows are arranged horizontally.\n"
+msgstr ""
+"-T, --tile-horiz: ordena las ventanas estilo mosaico horizontal.\n"
+
+#. E: ACHNOSUX
+#: ../setedit/editmenu.cc:62 ../setedit/editmenu.cc:138
+msgid "~O~pen..."
+msgstr "~A~brir ..."
+
+#: ../setedit/editmenu.cc:65
+msgid "S~a~ve as..."
+msgstr "G~u~ardar como ..."
+
+#: ../setedit/editmenu.cc:66
+msgid "Save as ~U~NIX..."
+msgstr "Guardar como UNI~X~ ..."
+
+#: ../setedit/editmenu.cc:68
+msgid "~C~hange dir..."
+msgstr "~C~ambiar directorio ..."
+
+#: ../setedit/editmenu.cc:71
+msgid "~Q~uit"
+msgstr "A~b~andonar"
+
+#: ../setedit/editmenu.cc:74
+msgid "~U~ndo"
+msgstr "~D~eshacer"
+
+#: ../setedit/editmenu.cc:75
+msgid "~R~edo"
+msgstr "~R~ehacer"
+
+#: ../setedit/editmenu.cc:77 ../setedit/editmenu.cc:110
+msgid "Cu~t~"
+msgstr "Cor~t~ar"
+
+#: ../setedit/editmenu.cc:80
+msgid "~S~how clipboard"
+msgstr "~V~er portapapeles"
+
+#: ../setedit/editmenu.cc:82
+msgid "~C~lear"
+msgstr "~B~orrar"
+
+#: ../setedit/editmenu.cc:84
+msgid "S~e~t Local"
+msgstr "S~e~teos locales"
+
+#: ../setedit/editmenu.cc:85
+msgid "Set ~G~lobal"
+msgstr "Seteos ~g~lobales"
+
+#: ../setedit/editmenu.cc:87
+msgid "E~x~pand all tabs"
+msgstr "E~x~pandir todos los tabs"
+
+#: ../setedit/editmenu.cc:88
+msgid "C~o~mpact text"
+msgstr "C~o~mpactar el texto"
+
+#: ../setedit/editmenu.cc:90
+msgid "~J~ump to function"
+msgstr "~S~altar a la funcin"
+
+#: ../setedit/editmenu.cc:91
+msgid "~P~rofile Editor"
+msgstr "Medir la ~v~elocidad del editor"
+
+#: ../setedit/editmenu.cc:94
+msgid "~F~ind..."
+msgstr "~B~uscar ..."
+
+#: ../setedit/editmenu.cc:95
+msgid "~R~eplace..."
+msgstr "R~e~emplazar ..."
+
+#: ../setedit/editmenu.cc:96
+msgid "~S~earch again"
+msgstr "~R~epetir bsqueda"
+
+#: ../setedit/editmenu.cc:98 ../settvuti/tdiagaid.cc:216
+msgid "~M~acro"
+msgstr "~M~acro"
+
+#: ../setedit/editmenu.cc:99
+msgid "~R~ecord"
+msgstr "~G~rabar"
+
+#: ../setedit/editmenu.cc:100
+msgid "~S~top"
+msgstr "~P~arar"
+
+#: ../setedit/editmenu.cc:101
+msgid "~P~lay"
+msgstr "~R~eproducir"
+
+#: ../setedit/editmenu.cc:103
+msgid "Re~c~tangle"
+msgstr "Re~c~."
+
+#: ../setedit/editmenu.cc:104
+msgid "~S~tart"
+msgstr "~I~nicio"
+
+#: ../setedit/editmenu.cc:105
+msgid "~E~nd"
+msgstr "~F~in"
+
+#: ../setedit/editmenu.cc:106
+msgid "~H~ide"
+msgstr "Ocu~l~tar"
+
+#: ../setedit/editmenu.cc:111
+msgid "C~l~ear"
+msgstr "~B~orrar"
+
+#: ../setedit/editmenu.cc:112
+msgid "~M~ove"
+msgstr "~M~over"
+
+#: ../setedit/editmenu.cc:122
+msgid "~L~ist"
+msgstr "~L~ista"
+
+#: ../setedit/editmenu.cc:123
+msgid "~U~ser Screen"
+msgstr "Pantalla de ~U~suario"
+
+#: ../setedit/editmenu.cc:125 ../setedit/edprefs.cc:361
+msgid "~H~elp"
+msgstr "A~y~uda"
+
+#: ../setedit/editmenu.cc:126
+msgid "~I~NF View"
+msgstr "~I~NF View"
+
+#: ../setedit/editmenu.cc:127
+msgid "~A~nother InfView"
+msgstr "~O~tro InfView"
+
+#: ../setedit/editmenu.cc:129 ../setedit/editmenu.cc:423
+msgid "~V~arious"
+msgstr "Va~r~ios"
+
+#: ../setedit/editmenu.cc:130
+msgid "~C~alculator"
+msgstr "~C~alculadora"
+
+#: ../setedit/editmenu.cc:131
+msgid "~S~DG"
+msgstr "~S~DG"
+
+#: ../setedit/editmenu.cc:132
+msgid "SDG ~O~ptions"
+msgstr "~O~pciones del SDG"
+
+#: ../setedit/editmenu.cc:133
+msgid "Copy to ~W~indows Clip."
+msgstr "Copiar al Porta. de ~W~indows"
+
+#: ../setedit/editmenu.cc:134
+msgid "Paste ~f~rom Wind. Clip."
+msgstr "Pegar desde e~l~ Porta. de Windows"
+
+#: ../setedit/editmenu.cc:135
+msgid "Co~l~ors"
+msgstr "Co~l~ores"
+
+#: ../setedit/editmenu.cc:137
+msgid "~P~roject"
+msgstr "~P~royecto"
+
+#: ../setedit/editmenu.cc:161
+msgid "~F2~ Save"
+msgstr "~F2~ Grabar"
+
+#: ../setedit/editmenu.cc:162
+msgid "~F3~ Open"
+msgstr "~F3~ Abrir"
+
+#: ../setedit/editmenu.cc:163
+msgid "~Alt+F3~ Close"
+msgstr "~Alt+F3~ Cerrar"
+
+#: ../setedit/editmenu.cc:175
+msgid "~^H~ Help"
+msgstr "~^H~ Ayuda"
+
+#: ../setedit/editmenu.cc:176
+msgid "~ESC~ Close"
+msgstr "~ESC~ Cerrar"
+
+#: ../setedit/editmenu.cc:177
+msgid "~Alt+I~ Include"
+msgstr "~Alt+I~ Include"
+
+#: ../setedit/editmenu.cc:178
+msgid "~Alt+B~ Bookmark"
+msgstr "~Alt+B~ Bookmark"
+
+#: ../setedit/editmenu.cc:181
+msgid "~Del~ Close"
+msgstr "~Del~ Cierra"
+
+#: ../setedit/editmenu.cc:182
+msgid "~Ins~ Open"
+msgstr "~Ins~ Abrir"
+
+#: ../setedit/editmenu.cc:184
+msgid "~Ctrl+Del~ Delete File"
+msgstr "~Ctrl+Del~ Borrar Archivo"
+
+#: ../setedit/editmenu.cc:186
+msgid "~Ins~ Insert"
+msgstr "~Ins~ Insertar"
+
+#: ../setedit/editmenu.cc:187
+msgid "~Del~ Delete"
+msgstr "~Del~ Borrar"
+
+#: ../setedit/editmenu.cc:191
+msgid "~Alt+F7~ Previous"
+msgstr "~Alt+F7~ Anterior"
+
+#: ../setedit/editmenu.cc:192
+msgid "~Alt+F8~ Next"
+msgstr "~Alt+F8~ Prximo"
+
+#: ../setedit/editmenu.cc:193
+msgid "~Ctrl+C~ Stop"
+msgstr "~Ctrl+C~ Detener"
+
+#: ../setedit/editmenu.cc:194
+msgid "Save"
+msgstr "Guardar"
+
+#: ../setedit/editmenu.cc:195 ../setedit/editmenu.cc:200
+msgid "~Ctrl+Ins~ Copy"
+msgstr "~Ctrl+Ins~ Copiar"
+
+#: ../setedit/editmenu.cc:199
+msgid "~ENTER~ Evaluate"
+msgstr "~INTRO~ Evaluar"
+
+#: ../setedit/editmenu.cc:201
+msgid "~Shift+Ins~ Paste"
+msgstr "~Shift+Ins~ Pegar"
+
+#. The following are here just for internationalization purposes
+#: ../setedit/editmenu.cc:218
+msgid "Open Read-only ~c~opy"
+msgstr "Abrir una ~c~opia de solo lectura"
+
+#: ../setedit/editmenu.cc:219
+msgid "Save w/ same ~t~ime..."
+msgstr "Guardar c/igual ~h~ora ..."
+
+#: ../setedit/editmenu.cc:220
+msgid "Save a~l~l"
+msgstr "Guardar ~t~odo"
+
+#: ../setedit/editmenu.cc:221
+msgid "~P~rint"
+msgstr "~I~mprimir"
+
+#: ../setedit/editmenu.cc:222
+msgid "Pr~i~nt Setup..."
+msgstr "Opciones de im~p~resin ..."
+
+#: ../setedit/editmenu.cc:223
+msgid "S~e~t Local options"
+msgstr "Opcion~e~s Locales"
+
+#: ../setedit/editmenu.cc:224
+msgid "Set ~G~lobal options"
+msgstr "Opciones ~G~lobales"
+
+#: ../setedit/editmenu.cc:225
+msgid "Pus~h~ cursor position"
+msgstr "G~u~ardar la posicin del cursor"
+
+#: ../setedit/editmenu.cc:226
+msgid "Pop cursor pos~i~tion"
+msgstr "Recuperar la po~s~icin del cursor"
+
+#: ../setedit/editmenu.cc:227
+msgid "C~a~se (upper/lower)"
+msgstr "Ma~y~sculas/Minsculas"
+
+#: ../setedit/editmenu.cc:228
+msgid "Block to ~u~pper"
+msgstr "Bloque a maysc~u~las"
+
+#: ../setedit/editmenu.cc:229
+msgid "Block to ~l~ower"
+msgstr "Bloque a minscu~l~as"
+
+#: ../setedit/editmenu.cc:230
+msgid "~C~haracter toggle"
+msgstr "Invertir ~c~aracter"
+
+#: ../setedit/editmenu.cc:231
+msgid "Block ~i~nvert"
+msgstr "~I~nvertir el bloque"
+
+#: ../setedit/editmenu.cc:232
+msgid "Block ~a~lternate"
+msgstr "~A~lternar el bloque"
+
+#: ../setedit/editmenu.cc:233
+msgid "~G~o to line"
+msgstr "~I~r a lnea"
+
+#: ../setedit/editmenu.cc:234
+msgid "Jump to ~p~rototype"
+msgstr "Saltar al ~p~rototipo"
+
+#: ../setedit/editmenu.cc:235
+msgid "~N~ame current function"
+msgstr "~N~ombre de la funcin actual"
+
+#: ../setedit/editmenu.cc:236
+msgid "~C~hoose..."
+msgstr "~E~legir ..."
+
+#: ../setedit/editmenu.cc:237
+msgid "R~e~peat"
+msgstr "Repe~t~ir"
+
+#: ../setedit/editmenu.cc:238
+msgid "~G~enerate Code"
+msgstr "Generar ~c~digo"
+
+#: ../setedit/editmenu.cc:239
+msgid "Ru~n~ selected code"
+msgstr "E~j~ecutar cdigo seleccionado"
+
+#: ../setedit/editmenu.cc:240
+msgid "Enter c~o~de to run"
+msgstr "I~n~gresar cdigo a ejecutar"
+
+#: ../setedit/editmenu.cc:241
+msgid "Pse~u~do macros..."
+msgstr "Pse~u~do Macros ..."
+
+#: ../setedit/editmenu.cc:242
+msgid "To ~u~pper"
+msgstr "A ma~y~sculas"
+
+#: ../setedit/editmenu.cc:243
+msgid "To l~o~wer"
+msgstr "A minsc~u~las"
+
+#: ../setedit/editmenu.cc:244
+msgid "Poc~k~et calculator"
+msgstr "Calculadora de ~B~olsillo"
+
+#: ../setedit/editmenu.cc:245
+msgid "~R~un program"
+msgstr "E~j~ecutar programa"
+
+#: ../setedit/editmenu.cc:246
+msgid "~A~SCII Chart"
+msgstr "Tabla ~A~SCII"
+
+#: ../setedit/editmenu.cc:247
+msgid "Ca~l~endar"
+msgstr "Ca~l~endario"
+
+#: ../setedit/editmenu.cc:248
+msgid "MP~3~ songs"
+msgstr "Sonidos ~M~P3"
+
+#: ../setedit/editmenu.cc:249
+msgid "~S~elect a song"
+msgstr "~S~eleccionar una cancin"
+
+#: ../setedit/editmenu.cc:250
+msgid "~P~lay selected"
+msgstr "Re~p~roducir"
+
+#: ../setedit/editmenu.cc:251
+msgid "S~t~op selected"
+msgstr "De~t~ener"
+
+#: ../setedit/editmenu.cc:252
+msgid "~C~onvert to WAV"
+msgstr "~C~onvertir a WAV"
+
+#: ../setedit/editmenu.cc:253
+msgid "~E~dit/Create list"
+msgstr "~E~ditar/Crear lista"
+
+#: ../setedit/editmenu.cc:254
+msgid "P~l~ay list"
+msgstr "Reproducir ~L~ista"
+
+#: ../setedit/editmenu.cc:255
+msgid "St~o~p list"
+msgstr "Dete~n~er lista"
+
+#: ../setedit/editmenu.cc:256
+msgid "~H~TML Accents"
+msgstr "Acentos ~H~TML"
+
+#: ../setedit/editmenu.cc:257
+msgid "Convert ~a~ccents to tags"
+msgstr "Convertir ~a~centos en marcadores"
+
+#: ../setedit/editmenu.cc:258
+msgid "Convert ~t~ags to accents"
+msgstr "Convertir ~m~arcadores en acentos"
+
+#: ../setedit/editmenu.cc:259
+msgid "E~x~port as HTML..."
+msgstr "E~x~portar como HTML ..."
+
+#: ../setedit/editmenu.cc:260
+msgid "Re~m~ap code page..."
+msgstr "Camb~i~ar la codificacin ..."
+
+#: ../setedit/editmenu.cc:261
+msgid "~B~lock quoted printable decode"
+msgstr "~D~ecodificar bloque quoted printable"
+
+#: ../setedit/editmenu.cc:262
+msgid "Un/~I~ndent block"
+msgstr "Des/indentar blo~q~ue"
+
+#: ../setedit/editmenu.cc:263
+msgid "Indent ~o~ne space"
+msgstr "Indentar ~u~n espacio"
+
+#: ../setedit/editmenu.cc:264
+msgid "Unindent o~n~e character"
+msgstr "Desindentar u~n~ espacio"
+
+#: ../setedit/editmenu.cc:265
+msgid "Indent one ~t~ab/gap"
+msgstr "Indentar un ~t~ab o hueco"
+
+#: ../setedit/editmenu.cc:266
+msgid "~U~nindent one tab/gap"
+msgstr "~D~esindentar un tab o hueco"
+
+#: ../setedit/editmenu.cc:267
+msgid "~C~omment indent"
+msgstr "~I~ndentar comentando"
+
+#: ../setedit/editmenu.cc:268
+msgid "Comment unin~d~ent"
+msgstr "Indentar desco~m~entando"
+
+#: ../setedit/editmenu.cc:269
+msgid "~A~rbitrary indent"
+msgstr "Indentado ~a~rbitrario"
+
+#: ../setedit/editmenu.cc:270
+msgid "Paste ~E~macs mode"
+msgstr "Pegar el modo ~E~macs"
+
+#: ../setedit/editmenu.cc:271
+msgid "Test of macro from menu"
+msgstr "Prueba de macro desde el men"
+
+#: ../setedit/editmenu.cc:272
+msgid "~D~elete memorized backups"
+msgstr "Borrar arch. de respaldo memori~z~ados"
+
+#: ../setedit/editmenu.cc:273
+msgid "Redra~w~ screen"
+msgstr "~R~edibujar la pantalla"
+
+#: ../setedit/editmenu.cc:274
+msgid "~C~olors"
+msgstr "~C~olores"
+
+#: ../setedit/editmenu.cc:275
+msgid "~C~ustomize..."
+msgstr "~C~onfigurar ..."
+
+#: ../setedit/editmenu.cc:276
+msgid "~P~alette..."
+msgstr "~P~aleta de colores ..."
+
+#: ../setedit/editmenu.cc:277
+msgid "~T~heme..."
+msgstr "~E~squema ..."
+
+#: ../setedit/editmenu.cc:278
+msgid "~L~ocal edition..."
+msgstr "~L~ocales de edicin ..."
+
+#: ../setedit/editmenu.cc:279
+msgid "Glo~b~al edition..."
+msgstr "Glo~b~ales de edicin ..."
+
+#: ../setedit/editmenu.cc:280
+msgid "Editor ~G~eneral..."
+msgstr "~G~enerales del editor ..."
+
+#: ../setedit/editmenu.cc:281
+msgid "Scr~e~en saver..."
+msgstr "~S~alvapantallas ..."
+
+#: ../setedit/editmenu.cc:282
+msgid "S~D~G Options..."
+msgstr "Opciones del S~D~G ..."
+
+#: ../setedit/editmenu.cc:283
+msgid "~R~un program (which one)..."
+msgstr "P~r~ograma a ejecutar (cul) ..."
+
+#: ../setedit/editmenu.cc:284
+msgid "~K~eyboard"
+msgstr "~T~eclado"
+
+#: ../setedit/editmenu.cc:285
+msgid "~K~ey assignment"
+msgstr "~A~signacin de teclas"
+
+#: ../setedit/editmenu.cc:286
+msgid "~S~etup Alt keys"
+msgstr "~C~onfiguracin teclas Alt"
+
+#: ../setedit/editmenu.cc:287
+msgid "Key ~p~ad behavior"
+msgstr "Comportamiento del teclado ~n~umrico"
+
+#: ../setedit/editmenu.cc:288
+msgid "~B~ack to defaults"
+msgstr "~V~alores originales"
+
+#: ../setedit/editmenu.cc:289
+msgid "Consult ~s~can codes"
+msgstr "Consultar cdigos de ~t~eclas"
+
+#: ../setedit/editmenu.cc:290
+msgid "~S~creen Options..."
+msgstr "P~a~ntalla ..."
+
+#: ../setedit/editmenu.cc:291
+msgid "Encod~i~ngs..."
+msgstr "Cod~i~ficaciones ..."
+
+#: ../setedit/editmenu.cc:292
+msgid "Fon~t~s..."
+msgstr "Ti~p~ografas (fonts) ..."
+
+#: ../setedit/editmenu.cc:293
+msgid "~U~ser words..."
+msgstr "Palabras reservadas de ~u~suario ..."
+
+#: ../setedit/editmenu.cc:294
+msgid "De~f~ault global edition..."
+msgstr "Globales por de~f~ecto p/edicin ..."
+
+#: ../setedit/editmenu.cc:295
+msgid "~O~pen file dialog..."
+msgstr "D~e~l dilogo `Abrir Archivo'..."
+
+#: ../setedit/editmenu.cc:296
+msgid "Do~n~'t create backups for..."
+msgstr "~N~o crear respaldos para ..."
+
+#: ../setedit/editmenu.cc:297
+msgid "~T~ip of the day"
+msgstr "~C~onsejo del da"
+
+#: ../setedit/editmenu.cc:298
+msgid "~S~yntax help"
+msgstr "Ayuda de ~s~intaxis"
+
+#: ../setedit/editmenu.cc:299
+msgid "~F~iles to search"
+msgstr "Archivo~s~ a buscar"
+
+#: ../setedit/editmenu.cc:300
+msgid "~M~an page View"
+msgstr "Visor de pginas del ~m~anual"
+
+#: ../setedit/editmenu.cc:301
+msgid "A~b~out"
+msgstr "~A~cerca de"
+
+#: ../setedit/editmenu.cc:302
+msgid "Searc~h~ files under cursor in..."
+msgstr "Buscar arch. baj~o~ el cursor en ..."
+
+#: ../setedit/editmenu.cc:303
+msgid "Insert key ~n~ame"
+msgstr "I~n~sertar el nombre de una tecla"
+
+#: ../setedit/editmenu.cc:304
+msgid "Sc~r~oll Up"
+msgstr "~D~esplazar Arriba"
+
+#: ../setedit/editmenu.cc:305
+msgid "Scroll ~D~own"
+msgstr "Desplazar A~b~ajo"
+
+#: ../setedit/editmenu.cc:306
+msgid "Cop~y~ to file Clipboard"
+msgstr "Cop~i~ar al Porta. de archivo"
+
+#: ../setedit/editmenu.cc:307
+msgid "Paste ~f~rom file Clipboard"
+msgstr "Pegar desde el Porta. de arc~h~ivo"
+
+#: ../setedit/editmenu.cc:308
+msgid "Copy to OS Clipboar~d~"
+msgstr "Copi~a~r al Porta. del SO"
+
+#: ../setedit/editmenu.cc:309
+msgid "Paste from OS Clip~b~oard"
+msgstr "Pegar desde e~l~ Porta. del SO"
+
+#: ../setedit/editmenu.cc:310
+msgid "Save ~d~esktop here"
+msgstr "Grabar ~e~scritorio aqu"
+
+#: ../setedit/editmenu.cc:311
+msgid "Sa~v~e as DOS..."
+msgstr "Guardar en formato ~D~OS ..."
+
+#: ../setedit/editmenu.cc:313
+msgid "T~a~g files"
+msgstr "Arc~h~ivos de TAGs"
+
+#: ../setedit/editmenu.cc:314
+msgid "~L~ist of tag files..."
+msgstr "~L~ista de archivos de TAGs ..."
+
+#: ../setedit/editmenu.cc:315
+msgid "~O~ptions..."
+msgstr "~O~pciones ..."
+
+#: ../setedit/editmenu.cc:316
+msgid "Jump ~t~o symbol"
+msgstr "Sa~l~tar a un smbolo"
+
+#: ../setedit/editmenu.cc:317
+msgid "~C~lass browser"
+msgstr "Visor de ~c~lases"
+
+#: ../setedit/editmenu.cc:318
+msgid "~W~ord completion"
+msgstr "C~o~mpletar palabra"
+
+#: ../setedit/editmenu.cc:319
+msgid "E~x~port project"
+msgstr "E~x~portar proyecto"
+
+#: ../setedit/editmenu.cc:320
+msgid "~I~mport project items"
+msgstr "~I~mportar items al proyecto"
+
+#: ../setedit/editmenu.cc:321
+msgid "Save As"
+msgstr "Guardar Como"
+
+#: ../setedit/editmenu.cc:322
+msgid "Calendar (holida~y~s)..."
+msgstr "Calendario (feriados) ..."
+
+#: ../setedit/editmenu.cc:323
+msgid "Checking for ~m~odified files..."
+msgstr "~V~erificar archivos modificados ..."
+
+#: ../setedit/editmenu.cc:324
+msgid "Advice dialogs..."
+msgstr "Dilogos de consejo ..."
+
+#: ../setedit/editmenu.cc:325
+msgid "Jump to ~l~ast cursor position"
+msgstr "S~a~ltar a la ltima posicin del cursor"
+
+#: ../setedit/editmenu.cc:326
+msgid "Jump to last ~u~ndo position"
+msgstr "Saltar a la ltima posicin de ~d~eshacer"
+
+#: ../setedit/editmenu.cc:327
+msgid "Insert ~n~ew line (don't move)"
+msgstr "Insertar una ~n~ueva lnea (no mover)"
+
+#: ../setedit/editmenu.cc:328
+msgid "Pro~j~ect Window"
+msgstr "Ventana del ~P~royecto"
+
+#: ../setedit/editmenu.cc:329
+msgid "~M~essage Window"
+msgstr "Ventana de Me~n~sajes"
+
+#: ../setedit/editmenu.cc:330
+msgid "~E~dition Windows"
+msgstr "Ventanas de Ed~i~cin"
+
+#: ../setedit/editmenu.cc:331
+msgid "Window ~2~"
+msgstr "Ventana ~2~"
+
+#: ../setedit/editmenu.cc:332
+msgid "Window ~3~"
+msgstr "Ventana ~3~"
+
+#: ../setedit/editmenu.cc:333
+msgid "Window ~4~"
+msgstr "Ventana ~4~"
+
+#: ../setedit/editmenu.cc:334
+msgid "Window ~5~"
+msgstr "Ventana ~5~"
+
+#: ../setedit/editmenu.cc:335
+msgid "Window ~6~"
+msgstr "Ventana ~6~"
+
+#: ../setedit/editmenu.cc:336
+msgid "Window ~7~"
+msgstr "Ventana ~7~"
+
+#: ../setedit/editmenu.cc:337
+msgid "Window ~8~"
+msgstr "Ventana ~8~"
+
+#: ../setedit/editmenu.cc:338
+msgid "Window ~9~"
+msgstr "Ventana ~9~"
+
+#: ../setedit/editmenu.cc:339
+msgid "Window 10"
+msgstr "Ventana 10"
+
+#: ../setedit/editmenu.cc:340
+msgid "Window 11"
+msgstr "Ventana 11"
+
+#: ../setedit/editmenu.cc:341
+msgid "Window 12"
+msgstr "Ventana 12"
+
+#: ../setedit/editmenu.cc:342
+msgid "Window 13"
+msgstr "Ventana 13"
+
+#: ../setedit/editmenu.cc:343
+msgid "Window 14"
+msgstr "Ventana 14"
+
+#: ../setedit/editmenu.cc:344
+msgid "Window 15"
+msgstr "Ventana 15"
+
+#: ../setedit/editmenu.cc:345
+msgid "Window 16"
+msgstr "Ventana 16"
+
+#: ../setedit/editmenu.cc:346
+msgid "Window 17"
+msgstr "Ventana 17"
+
+#: ../setedit/editmenu.cc:347
+msgid "Window 18"
+msgstr "Ventana 18"
+
+#: ../setedit/editmenu.cc:348
+msgid "Window 19"
+msgstr "Ventana 19"
+
+#: ../setedit/editmenu.cc:349
+msgid "Pus~h~ cursor position and window"
+msgstr "G~u~ardar la posicin y ventana del cursor"
+
+#: ../setedit/editmenu.cc:350
+msgid "P~o~p cursor position and window (tag ret)"
+msgstr "Recuperar la pos. y ~v~entana del cursor (tags)"
+
+#: ../setedit/editmenu.cc:351
+msgid "Debu~g~ger Window"
+msgstr "Ventana del Depurad~o~r"
+
+#: ../setedit/editmenu.cc:352
+msgid "~W~atches Window"
+msgstr "Ventana de ~V~isores"
+
+#: ../setedit/editmenu.cc:353
+msgid "~D~ebug"
+msgstr "~D~epurar"
+
+#: ../setedit/editmenu.cc:355
+msgid "~P~rogram and mode..."
+msgstr "~P~rograma y modo ..."
+
+#: ../setedit/editmenu.cc:356
+msgid "Path for ~s~ources..."
+msgstr "Camino (path) para los fuente~s~ ..."
+
+#: ../setedit/editmenu.cc:357
+msgid "~M~essages displayed..."
+msgstr "~M~ensajes mostrados ..."
+
+#: ../setedit/editmenu.cc:358
+msgid "~A~dvanced..."
+msgstr "~A~vanzadas ..."
+
+#: ../setedit/editmenu.cc:359
+msgid "Go to 'Connected' ~1~"
+msgstr "Pasar a 'Conectado' ~1~"
+
+#: ../setedit/editmenu.cc:360
+msgid "Go to 'Ready to run' ~2~"
+msgstr "Pasar a 'Listo para ejecutar' ~2'"
+
+#: ../setedit/editmenu.cc:361
+msgid "~B~reakpoint"
+msgstr "~B~reakpoint (punto de frenado)"
+
+#: ../setedit/editmenu.cc:362
+msgid "~R~un/Continue/Atach"
+msgstr "Ejecuta~r~/Continuar/Conectar"
+
+#: ../setedit/editmenu.cc:363
+msgid "~S~tep over"
+msgstr "Paso (por ~f~uera)"
+
+#: ../setedit/editmenu.cc:364
+msgid "~T~race into"
+msgstr "Paso (en~t~rando)"
+
+#: ../setedit/editmenu.cc:365
+msgid "~G~o to cursor"
+msgstr "~I~r hasta el cursor"
+
+#: ../setedit/editmenu.cc:366
+msgid "~U~ntil return"
+msgstr "Ejec~u~tar hasta retornar"
+
+#: ../setedit/editmenu.cc:367
+msgid "Return ~n~ow"
+msgstr "Retor~n~ar ahora"
+
+#: ../setedit/editmenu.cc:368
+msgid "Sto~p~"
+msgstr "~P~arar"
+
+#: ../setedit/editmenu.cc:369
+msgid "Restart (~K~ill)"
+msgstr "Reinicializar (~M~atar)"
+
+#: ../setedit/editmenu.cc:370
+msgid "~E~valuate/Modify..."
+msgstr "~E~valuar/Modificar ..."
+
+# End of header
+#: ../setedit/editmenu.cc:371
+msgid "~W~atch an expression"
+msgstr "Ver una e~x~presin"
+
+#: ../setedit/editmenu.cc:372
+msgid "~C~alling stack"
+msgstr "Llamadas en la pila (sta~c~k)"
+
+#: ../setedit/editmenu.cc:373
+msgid "~D~ebug session"
+msgstr "Sesin de ~d~epuracin"
+
+#: ../setedit/editmenu.cc:374
+msgid "De~t~ach"
+msgstr "~D~esconectar"
+
+#: ../setedit/editmenu.cc:375
+msgid "C~l~ose"
+msgstr "C~e~rrar"
+
+#: ../setedit/editmenu.cc:376
+msgid "~D~estroy (DANGER!)"
+msgstr "De~s~truir (PELIGROSO!)"
+
+#: ../setedit/editmenu.cc:377
+msgid "~E/+~ Expand"
+msgstr "~E/+~ Expandir"
+
+#: ../setedit/editmenu.cc:378
+msgid "~C/-~ Collapse"
+msgstr "~C/-~ Colapsar"
+
+#: ../setedit/editmenu.cc:379
+msgid "~+~ Enable"
+msgstr "~+~ Habilitar"
+
+#: ../setedit/editmenu.cc:380
+msgid "~-~ Disable"
+msgstr "~-~ Deshabilitar"
+
+#: ../setedit/editmenu.cc:381
+msgid "~Ins~ Send command"
+msgstr "~Ins~ Enviar comando"
+
+#: ../setedit/editmenu.cc:382
+msgid "~Ctrl+A/+~ Add w/scope"
+msgstr "~Ctrl+A/+~ Agregar c/mbito"
+
+#: ../setedit/editmenu.cc:383
+msgid "~R~egenerate central file"
+msgstr "~R~egenerar archivo central"
+
+#: ../setedit/editmenu.cc:384
+msgid "Ed~i~t breakpoints..."
+msgstr "Editar bre~a~kpoints ..."
+
+#: ../setedit/editmenu.cc:385
+msgid "Edit watchpoints... ~3~"
+msgstr "Editar watchpoints ... ~3~"
+
+#: ../setedit/editmenu.cc:386
+msgid "Se~l~ect thread..."
+msgstr "Se~l~eccionar hilo ..."
+
+#: ../setedit/editmenu.cc:387
+msgid "Disasse~m~bler Window..."
+msgstr "~V~entana del Desensamblador ..."
+
+#: ../setedit/editmenu.cc:388
+msgid "~N~ormal watch..."
+msgstr "Visor ~n~ormal ..."
+
+#: ../setedit/editmenu.cc:389
+msgid "~W~ith scope..."
+msgstr "~C~on mbito ..."
+
+#: ../setedit/editmenu.cc:390
+msgid "~U~sing the Inspector..."
+msgstr "~U~sando un Inspector ..."
+
+#: ../setedit/editmenu.cc:391
+msgid "~D~ata window..."
+msgstr "V~e~ntana de Datos ..."
+
+#: ../setedit/editmenu.cc:392
+msgid "~S~tack window"
+msgstr "Ventana de la ~P~ila (stack)"
+
+#: ../setedit/editmenu.cc:393
+msgid "Clear deb~u~g elements..."
+msgstr "~B~orrar elementos ..."
+
+#: ../setedit/editmenu.cc:394
+msgid "~R~ead block..."
+msgstr "~L~eer bloque ..."
+
+#: ../setedit/editmenu.cc:395
+msgid "~W~rite block..."
+msgstr "~E~scribir bloque ..."
+
+#: ../setedit/editmenu.cc:397
+msgid "~D~own"
+msgstr "~B~ajar"
+
+#: ../setedit/editmenu.cc:398
+msgid "~R~ight"
+msgstr "~D~erecha"
+
+#: ../setedit/editmenu.cc:399
+msgid "~L~eft"
+msgstr "~I~zquierda"
+
+#: ../setedit/editmenu.cc:400
+msgid "Page d~o~wn"
+msgstr "~R~etroceso de pgina"
+
+#: ../setedit/editmenu.cc:401
+msgid "Page u~p~"
+msgstr "A~v~ance de pgina"
+
+#: ../setedit/editmenu.cc:402
+msgid "Fir~s~t column"
+msgstr "~P~rimer columna"
+
+#: ../setedit/editmenu.cc:403
+msgid "L~a~st column"
+msgstr "~l~tima columna"
+
+#: ../setedit/editmenu.cc:404
+msgid "First ro~w~"
+msgstr "Pri~m~er lnea"
+
+#: ../setedit/editmenu.cc:405
+msgid "Las~t~ row"
+msgstr "l~t~ima lnea"
+
+#: ../setedit/editmenu.cc:406
+msgid "First addr. ~i~ncrement"
+msgstr "I~n~crementar la primera dir."
+
+#: ../setedit/editmenu.cc:407
+msgid "~F~irst addr. decrement"
+msgstr "De~c~rementar la primera dir."
+
+#: ../setedit/editmenu.cc:409
+msgid "Change ~b~ase address..."
+msgstr "~C~ambiar direccin base ..."
+
+#: ../setedit/editmenu.cc:410
+msgid "~G~o to new address..."
+msgstr "~N~ueva direccin ..."
+
+#: ../setedit/editmenu.cc:411
+msgid "Follow ~p~ointer"
+msgstr "Seguir el ~p~untero"
+
+#: ../setedit/editmenu.cc:412
+msgid "Follow pointer in ~n~ew window"
+msgstr "Seguir el puntero en otra ~v~entana"
+
+#: ../setedit/editmenu.cc:413
+msgid "~R~ecompute address"
+msgstr "~R~ecalcular la direccin"
+
+#: ../setedit/editmenu.cc:414
+msgid "M~o~de"
+msgstr "M~o~do"
+
+#: ../setedit/editmenu.cc:415
+msgid "Toggle ~a~uto follow"
+msgstr "Invertir seguimiento ~a~utomtico"
+
+#: ../setedit/editmenu.cc:416
+msgid "Change ~d~isplay mode"
+msgstr "Cambiar el modo de ~r~epresentacin"
+
+#: ../setedit/editmenu.cc:417
+msgid "Toggle ~e~ndian mode"
+msgstr "Invertir el orden de los ~c~aracteres"
+
+#: ../setedit/editmenu.cc:418
+msgid "Change ~r~adix"
+msgstr "Cambiar de raz ~n~umrica"
+
+#: ../setedit/editmenu.cc:419
+msgid "~B~lock"
+msgstr "~B~loque"
+
+#: ../setedit/editmenu.cc:420
+msgid "~F~ill..."
+msgstr "~R~ellenar ..."
+
+#: ../setedit/editmenu.cc:421
+msgid "~C~lear..."
+msgstr "~B~orrar ..."
+
+#: ../setedit/editmenu.cc:422
+msgid "~M~ove..."
+msgstr "~M~over ..."
+
+#: ../setedit/editmenu.cc:424
+msgid "~L~ess bytes per line"
+msgstr "~M~enos caracteres por lnea"
+
+#: ../setedit/editmenu.cc:425
+msgid "~M~ore bytes per line"
+msgstr "Ms ~c~aracteres por lnea"
+
+#: ../setedit/editmenu.cc:426
+msgid "~U~pdate memory"
+msgstr "~A~ctualizar la memoria"
+
+#: ../setedit/editmenu.cc:427
+msgid "Go to st~a~te"
+msgstr "Ir al e~s~tado"
+
+#: ../setedit/editmenu.cc:428
+msgid "~C~onnected"
+msgstr "~C~onectado"
+
+#: ../setedit/editmenu.cc:429
+msgid "~R~eady to run"
+msgstr "~L~isto para ejecutar"
+
+#: ../setedit/editmenu.cc:430
+msgid "~O~pen info file..."
+msgstr "~A~brir un .info ..."
+
+#: ../setedit/editmenu.cc:431
+msgid "Con~f~iguration dialog..."
+msgstr "C~o~nfiguracin ..."
+
+#: ../setedit/editmenu.cc:432
+msgid "~B~ookmarks..."
+msgstr "~M~arcadores ..."
+
+#: ../setedit/editmenu.cc:433
+msgid "List of ~n~odes..."
+msgstr "Lista de ~n~odos ..."
+
+#: ../setedit/editmenu.cc:434
+msgid "~G~o to '(file)node'..."
+msgstr "~I~r a '(archivo)nodo'..."
+
+#: ../setedit/editmenu.cc:435
+msgid "~N~avigation"
+msgstr "~N~avegacin"
+
+#: ../setedit/editmenu.cc:436
+msgid "~L~ast visited topic"
+msgstr "~l~timo tema visitado"
+
+#: ../setedit/editmenu.cc:437
+msgid "~N~ext topic"
+msgstr "P~r~ximo tema"
+
+#: ../setedit/editmenu.cc:438
+msgid "~P~revious topic"
+msgstr "Tema ~a~nterior"
+
+#: ../setedit/editmenu.cc:439
+msgid "Go ~u~p in herarchy"
+msgstr "Ir arriba en la ~j~erarqua"
+
+#: ../setedit/editmenu.cc:440
+msgid "Main menu for ~t~his file"
+msgstr "~M~en principal local"
+
+#: ../setedit/editmenu.cc:441
+msgid "Info ~d~irectory"
+msgstr "~D~irectorio de ayudas"
+
+#: ../setedit/editmenu.cc:442
+msgid "~J~ump to last link"
+msgstr "~S~altar al ltimo enlace"
+
+#: ../setedit/editmenu.cc:443
+msgid "~G~o to link number"
+msgstr "~I~r al enlace nmero"
+
+#: ../setedit/editmenu.cc:444
+msgid "Link ~1~"
+msgstr "Enlace ~1~"
+
+#: ../setedit/editmenu.cc:445
+msgid "Link ~2~"
+msgstr "Enlace ~2~"
+
+#: ../setedit/editmenu.cc:446
+msgid "Link ~3~"
+msgstr "Enlace ~3~"
+
+#: ../setedit/editmenu.cc:447
+msgid "Link ~4~"
+msgstr "Enlace ~4~"
+
+#: ../setedit/editmenu.cc:448
+msgid "Link ~5~"
+msgstr "Enlace ~5~"
+
+#: ../setedit/editmenu.cc:449
+msgid "Link ~6~"
+msgstr "Enlace ~6~"
+
+#: ../setedit/editmenu.cc:450
+msgid "Link ~7~"
+msgstr "Enlace ~7~"
+
+#: ../setedit/editmenu.cc:451
+msgid "Link ~8~"
+msgstr "Enlace ~8~"
+
+#: ../setedit/editmenu.cc:452
+msgid "Link ~9~"
+msgstr "Enlace ~9~"
+
+#: ../setedit/editmenu.cc:453
+msgid "How to use the ~h~elp"
+msgstr "Como usar la ~a~yuda"
+
+#: ../setedit/editmenu.cc:454
+msgid "Con~t~rol dialog..."
+msgstr "Panel de con~t~rol ..."
+
+#: ../setedit/editmenu.cc:455
+msgid "S~e~arch selection forward"
+msgstr "Buscar la seleccin ~h~acia adelante"
+
+#: ../setedit/editmenu.cc:456
+msgid "Search selection ~b~ackward"
+msgstr "Buscar la seleccin hacia a~t~rs"
+
+#: ../setedit/editmenu.cc:457
+msgid "Replace in ~a~ll opened..."
+msgstr "Ree~m~plazar en todos los abiertos..."
+
+#: ../setedit/editmenu.cc:458
+msgid "Replace in all project ~i~tems..."
+msgstr "Reemplazar en todos los del pro~y~ecto..."
+
+#: ../setedit/editpale.cc:110
+msgid "Palette editor"
+msgstr "Paleta del editor"
+
+#: ../setedit/editpale.cc:117
+msgid "Color RGB composition"
+msgstr "Composicin de colores RVA"
+
+#: ../setedit/editpale.cc:123
+msgid "Red"
+msgstr "Rojo"
+
+#: ../setedit/editpale.cc:129
+msgid "Green"
+msgstr "Verde"
+
+#: ../setedit/editpale.cc:135
+msgid "Blue"
+msgstr "Azul"
+
+#: ../setedit/editpale.cc:166
+msgid "~D~efault"
+msgstr "~O~riginal"
+
+#: ../setedit/editpale.cc:297
+msgid "The hardware doesn't support this."
+msgstr "Este sistema no soporta esto."
+
+#: ../setedit/edkeys.cc:193
+msgid "Key assignment"
+msgstr "Asignacin de teclas"
+
+#: ../setedit/edkeys.cc:249
+msgid "Accepting that you'll change the SET's editor behavior"
+msgstr "Aceptando ud. modificar el comportamiento del editor"
+
+#: ../setedit/edkeys.cc:265
+msgid "Do you really want to discard the changes?"
+msgstr "Verdaderamente desea descartar los cambios?"
+
+#: ../setedit/edkeys.cc:278
+msgid "Sequence of keys"
+msgstr "Secuencia de teclas"
+
+#: ../setedit/edkeys.cc:301
+msgid "sLisp code"
+msgstr "Cdigo sLisp"
+
+#: ../setedit/edkeys.cc:305
+msgid ""
+"Enter the sLisp code, it must start with (\n"
+"and end with )"
+msgstr ""
+"Ingrese el cdigo sLisp, debe comenzar con (\n"
+"y terminar con )"
+
+#: ../setedit/edkeys.cc:368
+msgid "This key is already in use, do you want to replace it?"
+msgstr "Esta tecla ya est en uso, desea reemplazarla?"
+
+#: ../setedit/edkeys.cc:380
+msgid ""
+"This sequence is used for more than one key, delete these assignments first"
+msgstr ""
+"Esta secuencia es usada por ms de una tecla, primero elimine esas "
+"asignaciones"
+
+#: ../setedit/edkeys.cc:400
+msgid "Key selector"
+msgstr "Selector de teclas"
+
+#: ../setedit/edkeys.cc:403
+msgid "Press a key"
+msgstr "Presione una tecla"
+
+#: ../setedit/edkeys.cc:419
+msgid "Part of a sequence"
+msgstr "Parte de una secuencia"
+
+#: ../setedit/edkeys.cc:422
+msgid "Unassigned"
+msgstr "Sin asignar"
+
+#: ../setedit/edkeys.cc:480
+msgid "Macros"
+msgstr "Macros"
+
+#: ../setedit/edkeys.cc:496
+msgid "Commands"
+msgstr "Comandos"
+
+#: ../setedit/edkeys.cc:525
+msgid "A command"
+msgstr "Un comando"
+
+#: ../setedit/edkeys.cc:575
+msgid "Scan Viewer"
+msgstr "Visor de cdigos scan"
+
+#: ../setedit/edkeys.cc:588
+msgid "Alt keys settings"
+msgstr "Seteo de las teclas Alt"
+
+#: ../setedit/edkeys.cc:590
+msgid "~K~eys used by the menues, etc."
+msgstr "~T~eclas usadas por menes, etc."
+
+#: ../setedit/edkeys.cc:591
+msgid "~L~eft Alt"
+msgstr "Alt ~I~zquierdo"
+
+#: ../setedit/edkeys.cc:591
+msgid "~R~ight Alt"
+msgstr "Alt ~D~erecho"
+
+#: ../setedit/edkeys.cc:592
+msgid "~B~oth Alt"
+msgstr "Am~b~os Alt"
+
+#: ../setedit/edkeys.cc:614
+msgid "Key Pad behavior"
+msgstr "Comportamiento del teclado numrico"
+
+#: ../setedit/edkeys.cc:616
+msgid "Behavior"
+msgstr "Comportamiento"
+
+#: ../setedit/edkeys.cc:616
+msgid "Use the ~B~IOS default"
+msgstr "Mantener el valor del ~B~IOS"
+
+#: ../setedit/edkeys.cc:617
+msgid "Always interpret shift+arrow as ~m~ovement"
+msgstr "Siempre interpretar shift+flecha como ~m~ovimiento"
+
+#: ../setedit/edmsg.cc:415
+msgid "Last message in the list"
+msgstr "ltimo mensaje en la lista"
+
+#: ../setedit/edmsg.cc:447
+msgid "First message in the list"
+msgstr "Primer mensaje en la lista"
+
+#: ../setedit/edmsg.cc:558
+msgid "<empty>"
+msgstr "<vaco>"
+
+#: ../setedit/edprefs.cc:95
+msgid "Open File options"
+msgstr "Opciones de `Abrir Archivo'"
+
+#. ACDEFGIKLNPRSW
+#: ../setedit/edprefs.cc:147
+msgid "~S~ort type"
+msgstr "~T~ipo de ordenamiento"
+
+#: ../setedit/edprefs.cc:147
+msgid "~A~lphabetical"
+msgstr "~A~lfabtico"
+
+#: ../setedit/edprefs.cc:148
+msgid "~D~irectories first"
+msgstr "Los ~d~irectorios primero"
+
+#: ../setedit/edprefs.cc:148
+msgid "~F~iles first"
+msgstr "Los a~r~chivos primero"
+
+#: ../setedit/edprefs.cc:150
+msgid "Case style"
+msgstr "Maysculas/Minsculas"
+
+#: ../setedit/edprefs.cc:150
+msgid "~C~apital letters go first"
+msgstr "~M~aysculas primero"
+
+#: ../setedit/edprefs.cc:151
+msgid "Case ~i~nsensitive"
+msgstr "No ~i~mportan"
+
+#: ../setedit/edprefs.cc:152
+msgid "Parent directory (..)"
+msgstr "Directorio padre (..)"
+
+#: ../setedit/edprefs.cc:152
+msgid "First in the ~l~ist"
+msgstr "Es el primero en la ~l~ista"
+
+#: ../setedit/edprefs.cc:153
+msgid "At the ~e~nd of the list"
+msgstr "Es ~e~l ltimo en la lista"
+
+#: ../setedit/edprefs.cc:163
+msgid "Files starting with a dot"
+msgstr "Archivos que comienzan con punto"
+
+#: ../setedit/edprefs.cc:163
+msgid "~N~ormally sorted"
+msgstr "Ordenarlos ~n~ormalmente"
+
+#: ../setedit/edprefs.cc:164
+msgid "After the ~r~est"
+msgstr "Desp~u~s del resto"
+
+#: ../setedit/edprefs.cc:165
+msgid "Exclude files"
+msgstr "Excluir archivos que"
+
+#: ../setedit/edprefs.cc:165
+msgid "Ending ~w~ith tilde"
+msgstr "~T~erminan con uflo"
+
+#: ../setedit/edprefs.cc:166
+msgid "Ending with .bk~p~"
+msgstr "Terminan con .bk~p~"
+
+#: ../setedit/edprefs.cc:166
+msgid "Startin~g~ with ."
+msgstr "Comien~z~an con ."
+
+#: ../setedit/edprefs.cc:222
+msgid "Screen saver"
+msgstr "Salvapantallas"
+
+#: ../setedit/edprefs.cc:311
+msgid "Help for screen saver"
+msgstr "Ayuda del salvapantallas"
+
+#: ../setedit/edprefs.cc:343
+msgid "The screen saver can't be used on this terminal"
+msgstr "El salva pantallas no tiene sentido para esta terminal"
+
+#: ../setedit/edprefs.cc:355
+msgid "E~x~ternal options"
+msgstr "Opciones e~x~ternas"
+
+#: ../setedit/edprefs.cc:357
+msgid "Sc~r~een saver (?)"
+msgstr "~S~alvapantalla (?)"
+
+#: ../setedit/edprefs.cc:357
+msgid "OF~F~"
+msgstr "Apagado"
+
+#: ../setedit/edprefs.cc:357
+msgid "O~N~"
+msgstr "Encendido"
+
+#. First 3 joined
+#: ../setedit/edprefs.cc:359
+msgid "T~e~st"
+msgstr "~P~robar"
+
+#: ../setedit/edprefs.cc:360
+msgid "~I~nfo"
+msgstr "~I~nfo"
+
+#: ../setedit/edprefs.cc:364
+msgid "~T~ime"
+msgstr "~T~iempo"
+
+#: ../setedit/edprefs.cc:365
+msgid "seconds"
+msgstr "segundos"
+
+#: ../setedit/edprefs.cc:369
+msgid "Ti~m~e"
+msgstr "Tie~m~po"
+
+#: ../setedit/edprefs.cc:370
+msgid "mouse sec."
+msgstr "ratn seg."
+
+#. ABCDEHIKLMOPRSTUVWY
+#: ../setedit/edprefs.cc:429
+msgid "General editor options"
+msgstr "Opciones generales del editor"
+
+#: ../setedit/edprefs.cc:431
+msgid "~S~ave/Desktop options"
+msgstr "Opcione~s~ de grabado/escritorio"
+
+#: ../setedit/edprefs.cc:432
+msgid "Make ~b~ackups"
+msgstr "Crear ~a~rchivos de respaldo"
+
+#: ../setedit/edprefs.cc:434
+msgid "~U~NIX-style backups"
+msgstr "Archivos de respaldo estilo ~U~NIX"
+
+#: ../setedit/edprefs.cc:436
+msgid "H~i~dden backups"
+msgstr "Arch~i~vos de respaldo ocultos"
+
+#: ../setedit/edprefs.cc:438
+msgid "R~e~member bkps to delete"
+msgstr "Recordar los arch. de resp. para ~b~orrarlos"
+
+#: ../setedit/edprefs.cc:440
+msgid "~D~on't create desktop files"
+msgstr "No c~r~ear archivos de escritorio"
+
+#: ../setedit/edprefs.cc:442
+msgid "Save desktop files ~h~idden"
+msgstr "Archivos de ~e~scritorio ocultos"
+
+#: ../setedit/edprefs.cc:444
+msgid "Tile windows ~v~ertically first"
+msgstr "Mosaico de ventanas primero en sentido ~v~ertical"
+
+#: ../setedit/edprefs.cc:447
+msgid "Save UNIX files ~a~s UNIX"
+msgstr "Grabar archivos UNIX en ~f~ormato UNIX"
+
+#: ../setedit/edprefs.cc:449
+msgid "Save DOS files ~a~s DOS"
+msgstr "Grabar archivos DOS en ~f~ormato DOS"
+
+#: ../setedit/edprefs.cc:452
+msgid "Don't remember cursor ~p~osition"
+msgstr "No recordar la ~p~osicin del cursor"
+
+#: ../setedit/edprefs.cc:454
+msgid "Don't ~w~arn about read-only files"
+msgstr "~N~o avisar acerca de archivos de slo lectura"
+
+#: ../setedit/edprefs.cc:456
+msgid "Open ~r~ead-only files as R.O. buffers"
+msgstr "Abrir archivos ~s~lo lect. como slo lect."
+
+#: ../setedit/edprefs.cc:460
+msgid "~C~lock"
+msgstr "Relo~j~"
+
+#: ../setedit/edprefs.cc:460
+msgid "OFF"
+msgstr "Apagado"
+
+#: ../setedit/edprefs.cc:460
+msgid "ON"
+msgstr "Encendido"
+
+#: ../setedit/edprefs.cc:461
+msgid "St~y~le"
+msgstr "Es~t~ilo"
+
+#: ../setedit/edprefs.cc:461
+msgid "AM/PM"
+msgstr "AM/PM"
+
+#: ../setedit/edprefs.cc:461
+msgid "24 hs"
+msgstr "24 hs"
+
+#: ../setedit/edprefs.cc:463
+msgid "~M~ax. editor copies"
+msgstr "~M~ximo nmero de copias abiertas"
+
+#: ../setedit/edprefs.cc:464
+msgid "Max. c~l~osed to remember"
+msgstr "Max. de ventanas ~c~erradas a recordar"
+
+#: ../setedit/edprefs.cc:473
+msgid "+ Desk~t~op"
+msgstr "+ Escrit~o~rio"
+
+#: ../setedit/edprefs.cc:474
+msgid "+ Others"
+msgstr "+ Otros"
+
+#. CEKLMNORVY
+#: ../setedit/edprefs.cc:605
+msgid "More desktop options"
+msgstr "Ms opciones del escritorio"
+
+#: ../setedit/edprefs.cc:607
+msgid "Remember editor windows"
+msgstr "Recordar ventanas de edicin"
+
+#: ../setedit/edprefs.cc:608
+msgid "~A~lways"
+msgstr "S~i~empre"
+
+#: ../setedit/edprefs.cc:608
+msgid "~O~nly if no file specified"
+msgstr "S~l~o si no se indicaron archivos"
+
+#: ../setedit/edprefs.cc:608 ../setedit/runprog.cc:138
+msgid "~N~ever"
+msgstr "~N~unca"
+
+#: ../setedit/edprefs.cc:609
+msgid "Remember other windows"
+msgstr "Recordar otras ventanas"
+
+#: ../setedit/edprefs.cc:610 ../setedit/runprog.cc:138
+msgid "Al~w~ays"
+msgstr "~S~iempre"
+
+#: ../setedit/edprefs.cc:610
+msgid "On~l~y if no file specified"
+msgstr "Sl~o~ si no se indicaron archivos"
+
+#: ../setedit/edprefs.cc:610
+msgid "Neve~r~"
+msgstr "N~u~nca"
+
+#: ../setedit/edprefs.cc:611
+msgid "Remember ~c~losed windows"
+msgstr "Recordar ventanas cerradas"
+
+#: ../setedit/edprefs.cc:612
+msgid "Alway~s~"
+msgstr "Sie~m~pre"
+
+#: ../setedit/edprefs.cc:612
+msgid "Onl~y~ if no file specified"
+msgstr "Slo si no s~e~ indicaron archivos"
+
+#: ../setedit/edprefs.cc:612
+msgid "Ne~v~er"
+msgstr "Nun~c~a"
+
+#: ../setedit/edprefs.cc:618 ../setedit/edprefs.cc:685
+msgid "~M~ain options"
+msgstr "~P~rincipales"
+
+#: ../setedit/edprefs.cc:662
+msgid "At the end of error list in message window"
+msgstr "Al finalizar los errores de la ventana de mensajes"
+
+#: ../setedit/edprefs.cc:663
+msgid "~J~ust stop"
+msgstr "~S~lo detenerse"
+
+#: ../setedit/edprefs.cc:664
+msgid "~I~ndicate with a message"
+msgstr "~I~ndicar con un mensaje"
+
+#: ../setedit/edprefs.cc:665
+msgid "Wrap (~c~ircular list)"
+msgstr "Volver al p~r~incipio"
+
+#: ../setedit/edprefs.cc:666
+msgid "Make a beep"
+msgstr "Hacer un sonido"
+
+#: ../setedit/edprefs.cc:667
+msgid "When creating message and similar windows"
+msgstr "Cuando se crea la ventana de mensajes y similares"
+
+#: ../setedit/edprefs.cc:668
+msgid "Use the ~v~ertical direction"
+msgstr "Usar el sentido ~v~ertical"
+
+#: ../setedit/edprefs.cc:669
+msgid "Use the ~r~ight side"
+msgstr "Usar el lado ~d~erecho"
+
+#: ../setedit/edprefs.cc:670
+msgid "When opening files"
+msgstr "Cuando se abren archivos"
+
+#: ../setedit/edprefs.cc:671
+msgid "~U~se reserved width or 7 (hz dir)"
+msgstr "~U~sar el ancho reservado o 7 (sent. horiz)"
+
+#: ../setedit/edprefs.cc:672
+msgid "~A~void message and project windows"
+msgstr "~E~vitar las ventanas de mensajes y proyecto"
+
+#: ../setedit/edprefs.cc:673
+msgid "Reserved ~w~idth"
+msgstr "~A~ncho reservado"
+
+#: ../setedit/edprefs.cc:674
+msgid "Zoom windows when"
+msgstr "Maximizar las ventanas cuando"
+
+#: ../setedit/edprefs.cc:675
+msgid "No ~p~roject window"
+msgstr "No ha~y~ ventana de proyecto"
+
+#: ../setedit/edprefs.cc:676
+msgid "No prj. wi~n~dow or it's zoomed"
+msgstr "No hay ve~n~t. pro. o est maximizada"
+
+#: ../setedit/edprefs.cc:677
+msgid "A~l~ways"
+msgstr "Sie~m~pre"
+
+#: ../setedit/edprefs.cc:797
+msgid "~F~rom code page"
+msgstr "Codificacin ~o~riginal"
+
+#: ../setedit/edprefs.cc:799
+msgid "~T~o code page"
+msgstr "~N~ueva codificacin"
+
+#: ../setedit/edprefs.cc:803
+msgid "~D~on't remap codes below 32"
+msgstr "No ~a~lterar los cdigos menores que 32"
+
+#: ../setedit/edprefs.cc:804
+msgid "~O~nly selected text"
+msgstr "Slo el texto ~s~eleccionado"
+
+#: ../setedit/edprefs.cc:807
+msgid "Code page remap"
+msgstr "Cambio de codificacin"
+
+#: ../setedit/edprefs.cc:894
+msgid "Second ~f~ont"
+msgstr "Font ~s~ecundaria"
+
+#: ../setedit/edprefs.cc:1075
+msgid "This terminal doesn't support changing fonts"
+msgstr "Esta terminal no soporta cambios de tipografa"
+
+#: ../setedit/edprefs.cc:1081
+msgid "Can't determine fonts geometry"
+msgstr "No puedo determinar la geometra de la tipografa"
+
+#: ../setedit/edprefs.cc:1094
+msgid "No fonts available for current video mode"
+msgstr "No hay tipografas disponibles para este modo de video"
+
+#. Primary font label, check box and list
+#: ../setedit/edprefs.cc:1139
+msgid "~P~rimary"
+msgstr "~P~rimaria"
+
+#: ../setedit/edprefs.cc:1139
+msgid "~L~oad font"
+msgstr "~C~argar tipografa"
+
+#: ../setedit/edprefs.cc:1146
+msgid "S~i~ze"
+msgstr "~T~amao"
+
+#: ../setedit/edprefs.cc:1152
+msgid "~S~econdary"
+msgstr "~S~ecundaria"
+
+#: ../setedit/edprefs.cc:1152
+msgid "Lo~a~d font"
+msgstr "Ca~r~gar tipografa"
+
+#: ../setedit/edprefs.cc:1158
+msgid "Fonts"
+msgstr "Tipografas"
+
+#: ../setedit/edprefs.cc:1196
+#, c-format
+msgid "The selected secondary font doesn't support the primary size (%dx%d)"
+msgstr ""
+"La tipografa secundaria seleccionada no soporta el tamao de la secundaria "
+"(%d,%d)"
+
+#: ../setedit/edprefs.cc:1235
+msgid "This terminal has a fixed size"
+msgstr "Esta terminal tiene un tamao fijo"
+
+#. CDEGHIMNSWX
+#: ../setedit/edprefs.cc:1256
+msgid "Screen size options"
+msgstr "Opciones del tamao de la pantalla"
+
+#: ../setedit/edprefs.cc:1257
+msgid "~D~on't force"
+msgstr "~N~o forzarlo"
+
+#: ../setedit/edprefs.cc:1258
+msgid "~S~ame as last run"
+msgstr "~M~ismo que la ltima vez"
+
+#: ../setedit/edprefs.cc:1259
+msgid "~E~xternal program"
+msgstr "Usar un programa ~e~xterno"
+
+#: ../setedit/edprefs.cc:1260
+msgid "~C~losest to specified size"
+msgstr "~L~o ms cercano posible a lo indicado"
+
+#: ../setedit/edprefs.cc:1261
+msgid "Specified ~m~ode number"
+msgstr "Mo~d~o de video por nmero"
+
+#: ../setedit/edprefs.cc:1264
+msgid "~W~idth "
+msgstr "~A~ncho"
+
+#: ../setedit/edprefs.cc:1265
+msgid "~H~eight"
+msgstr "A~l~to "
+
+#: ../setedit/edprefs.cc:1266
+msgid "Chars w~i~dth "
+msgstr "Ancho ca~r~acteres"
+
+#: ../setedit/edprefs.cc:1267
+msgid "Chars hei~g~ht"
+msgstr "Al~t~o caracteres "
+
+#: ../setedit/edprefs.cc:1270
+msgid "E~x~ternal program"
+msgstr "Programa ~e~xterno"
+
+# ../sdg/mli.cc 1151
+#: ../setedit/edprefs.cc:1273
+msgid "Mode ~n~umber"
+msgstr "~N~mero de modo"
+
+#: ../setedit/edprefs.cc:1278
+msgid "Screen size"
+msgstr "Tamao de la pantalla"
+
+#: ../setedit/edprefs.cc:1297
+msgid "Please specify a screen size of at least 80x25 and no more than 250x250"
+msgstr ""
+"Por favor especifique un tamao de al menos 80x25 y de no ms de 250x250"
+
+#: ../setedit/edprefs.cc:1302
+msgid "Please specify a character size of at least 5x7 and no more than 32x32"
+msgstr ""
+"Por favor especifique un tamao de caracteres de al menos 5x7 y no ms de "
+"32x32"
+
+#: ../setedit/edprefs.cc:1325
+msgid "Checking for modified files"
+msgstr "Verificacin de archivos modificados"
+
+#: ../setedit/edprefs.cc:1329
+msgid "When a file on disk is newer than a file in edition:\n"
+msgstr ""
+"Cuando un archivo en disco es ms nuevo que la\n"
+"copia que se est editando:\n"
+
+#: ../setedit/edprefs.cc:1330
+msgid "Seconds between checks"
+msgstr "Segundos entre verif."
+
+#: ../setedit/edprefs.cc:1331
+msgid "Related options"
+msgstr "Opciones relacionadas"
+
+#: ../setedit/edprefs.cc:1332
+msgid "~D~on't check after executing an external program"
+msgstr "~N~o verificar luego de ejecutar un programa"
+
+#: ../setedit/edprefs.cc:1333
+msgid "Don't check while ~i~dle"
+msgstr "No verificar en los tiempos ~l~ibres"
+
+#: ../setedit/edprint.cc:72
+#, c-format
+msgid "Page: %d Lines: %d to %d Date: %s Time: %s%s"
+msgstr "Pgina: %d Lneas: %d a %d Da: %s Hora: %s%s"
+
+#: ../setedit/edprint.cc:73
+#, c-format
+msgid ""
+"* Source: %s * Title: %s * Author: %s\n"
+"\n"
+msgstr ""
+"* Fuente: %s * Ttulo: %s * Autor: %s\n"
+"\n"
+
+#: ../setedit/edprint.cc:458
+msgid "Starting printing module"
+msgstr "Inicializando el mdulo de impresin"
+
+#: ../setedit/edprint.cc:470
+msgid "Can't open output file for printing"
+msgstr "No pudo enviar informacin a la impresora"
+
+#: ../setedit/edprint.cc:478
+msgid "The header is too large, reduce the title and/or author lengths"
+msgstr "El encabezado es demasiado largo, reduzca el ttulo y/o autor"
+
+#: ../setedit/edprint.cc:481
+#, c-format
+msgid "Header length: %d Columns: %d"
+msgstr "Largo del encabezado: %d Columnas: %d"
+
+#: ../setedit/edprint.cc:529
+#, c-format
+msgid "Processed: %d lines, total printed: %d lines"
+msgstr "Procesadas: %d lneas, total impresas: %d lneas"
+
+#: ../setedit/edprint.cc:682
+msgid "Printer Setup"
+msgstr "Opciones de impresora"
+
+#: ../setedit/edprint.cc:685
+msgid "Total ~l~ines per page:"
+msgstr "Total de ~l~neas por pgina:"
+
+#: ../setedit/edprint.cc:687
+msgid "Columns ~w~/o margin:"
+msgstr "Columnas ~s~in margen:"
+
+#: ../setedit/edprint.cc:689
+msgid "Left ~m~argin:"
+msgstr "~M~argen izq.:"
+
+#: ../setedit/edprint.cc:690
+msgid "Print line numbers"
+msgstr "~I~mprimir nmeros de lnea"
+
+#: ../setedit/edprint.cc:691
+msgid "~T~ime format:"
+msgstr "Formato de la ~h~ora:"
+
+#: ../setedit/edprint.cc:692
+msgid "~D~ate format:"
+msgstr "~F~ormato de la fecha:"
+
+#: ../setedit/edprint.cc:694
+msgid "T~i~tle"
+msgstr "Tt~u~lo"
+
+#: ../setedit/edprint.cc:695
+msgid "~A~uthor"
+msgstr "~A~utor"
+
+#: ../setedit/edprint.cc:696
+msgid "Before ~h~eading"
+msgstr "Antes del encabe~z~ado"
+
+#: ../setedit/edprint.cc:697
+msgid "A~f~ter heading"
+msgstr "~D~espus del encabezado"
+
+#: ../setedit/edprint.cc:698
+msgid "~B~efore footer"
+msgstr "A~n~tes del pie de pgina"
+
+#: ../setedit/edprint.cc:699
+msgid "After foote~r~"
+msgstr "Despus del pie de p~g~ina"
+
+#: ../setedit/edprint.cc:701
+msgid "~P~rinter initialization"
+msgstr "Inicializacin de la im~p~resora"
+
+#: ../setedit/edprint.cc:702
+msgid "O~u~tput file"
+msgstr "A~r~chivo de salida"
+
+#: ../setedit/edprint.cc:703
+msgid "Output is a de~v~ice/file"
+msgstr "Salida es disposi~t~ivo/archivo"
+
+#: ../setedit/edprint.cc:704
+msgid "Output i~s~ a program"
+msgstr "Salida es un programa ~1~"
+
+#: ../setedit/edprint.cc:707 ../settvuti/tdiagaid.cc:172
+msgid "~C~ancel"
+msgstr "~C~ancela"
+
+#: ../setedit/edprj.cc:424
+msgid "File already in project"
+msgstr "El archivo ya est en el proyecto"
+
+#: ../setedit/edprj.cc:529
+msgid "Add File"
+msgstr "Agregar Archivo"
+
+#: ../setedit/edprj.cc:639 ../setedit/edprj.cc:680
+msgid "Project Window"
+msgstr "Ventana del Proyecto"
+
+#: ../setedit/edprj.cc:647
+msgid " 1 Project Window"
+msgstr " 1 Ventana del Proyecto"
+
+#: ../setedit/edprj.cc:721
+msgid "Could not open project file"
+msgstr "No puedo abrir el archivo de proyecto"
+
+#: ../setedit/edprj.cc:728
+msgid "Wrong project file."
+msgstr "Archivo de proyecto incorrecto."
+
+#: ../setedit/edprj.cc:763
+msgid "Error reading project file"
+msgstr "Error al leer el archivo de proyecto"
+
+#: ../setedit/edprj.cc:765 ../setedit/edprj.cc:945
+msgid "Project: "
+msgstr "Proyecto: "
+
+#: ../setedit/edprj.cc:801
+msgid "Could not save the project."
+msgstr "No puedo crear el archivo de proyecto."
+
+#: ../setedit/edprj.cc:890
+msgid "Open Project"
+msgstr "Abrir Proyecto"
+
+#: ../setedit/edprj.cc:1045
+#, c-format
+msgid "Failed to open the file %s"
+msgstr "No puedo abrir la lista de archivos %s"
+
+#: ../setedit/edprj.cc:1317
+msgid "Export project items"
+msgstr "Exportar los items del proyecto"
+
+#: ../setedit/edprj.cc:1354
+msgid "Import project items"
+msgstr "Importar items al proyecto"
+
+#: ../setedit/edprj.cc:1362
+msgid "Unable to open file"
+msgstr "No pude abrir el archivo"
+
+#: ../setedit/edprj.cc:1398
+#, c-format
+msgid "Results: added %d, already included: %d, rejected %d"
+msgstr "Resultados: agregados %d, ya estaban %d, rechazados %d"
+
+#: ../setedit/holidays.cc:172
+msgid "Can't find plug-ins directory"
+msgstr "No pude encontrar el directorio de plug-ins"
+
+#: ../setedit/holidays.cc:290
+msgid "Holidays plug-ins not supported. Sorry."
+msgstr "Lo lamento, no hay soporte para plug-ins de feriados."
+
+#: ../setedit/holidays.cc:297
+msgid "Failed to load holidays.conf"
+msgstr "Error al cargar holidays.conf"
+
+#: ../setedit/holidays.cc:301
+msgid "Holidays country"
+msgstr "Pas para los feriados"
+
+#: ../setedit/holidays.cc:318
+msgid "Country"
+msgstr "Pas"
+
+#: ../setedit/holidays.cc:318
+msgid "Force country"
+msgstr "Forzar el pas"
+
+#: ../setedit/intgrep.cc:114
+msgid "The clipboard is empty"
+msgstr "El portapapeles est vaco"
+
+#: ../setedit/intgrep.cc:202
+msgid "You must install GNU grep to use it!"
+msgstr "Debe instalar grep para usar esto!"
+
+#: ../setedit/intgrep.cc:222
+#, c-format
+msgid "Running grep in: %s"
+msgstr "Ejecutando grep en: %s"
+
+#: ../setedit/intgrep.cc:254
+msgid "From stderr:"
+msgstr "De stderr:"
+
+#: ../setedit/intgrep.cc:255
+msgid "From stdout:"
+msgstr "De stdout:"
+
+#: ../setedit/intgrep.cc:335
+#, c-format
+msgid "chdir error: %s"
+msgstr "error al entrar al directorio: %s"
+
+#: ../setedit/intgrep.cc:379
+msgid "Powered Grep by SET"
+msgstr "Grep Potenciado por SET"
+
+#. ACDEFGIJKLNORPSTUWX
+#. Pattern section
+#: ../setedit/intgrep.cc:385
+msgid "~P~attern box"
+msgstr "~P~atrn de bsqueda"
+
+#: ../setedit/intgrep.cc:386
+msgid "Files to ~s~earch"
+msgstr "Archivo~s~ a buscar"
+
+#: ../setedit/intgrep.cc:387
+msgid "~D~irectories to search"
+msgstr "~D~irectorio a buscar"
+
+#: ../setedit/intgrep.cc:390
+msgid "`Pattern box' is the pa~t~tern"
+msgstr "El `Pa~t~rn' es eso mismo"
+
+#: ../setedit/intgrep.cc:391
+msgid "`Pattern box' is a fi~l~e name"
+msgstr "El `Patrn' es un arc~h~ivo"
+
+#: ../setedit/intgrep.cc:392
+msgid "Use the ~c~lipboard selection"
+msgstr "Usar la sele~c~cin del portapapeles"
+
+#: ../setedit/intgrep.cc:394
+msgid "Source of Pattern"
+msgstr "Fuente del patrn a buscar"
+
+#: ../setedit/intgrep.cc:397
+msgid "Basic regular expression (-~G~)"
+msgstr "Expresiones regul. bsicas (-~G~)"
+
+#: ../setedit/intgrep.cc:398
+msgid "~E~xtended regular expression (-E)"
+msgstr "~E~xpresiones regulares extendidas (-E)"
+
+#: ../setedit/intgrep.cc:399
+msgid "~F~ixed separated by CR (-F)"
+msgstr "~F~ijos separados por CR (-F)"
+
+#: ../setedit/intgrep.cc:401
+msgid "Type of Pattern"
+msgstr "Tipo de patrn"
+
+#: ../setedit/intgrep.cc:404
+msgid "~U~se `Files to search'"
+msgstr "~U~sar `Archivos a buscar'"
+
+#: ../setedit/intgrep.cc:405
+msgid "Search in ope~n~ed windows"
+msgstr "Buscar e~n~ las ventanas abiertas"
+
+#: ../setedit/intgrep.cc:406
+msgid "Search in pro~j~ect"
+msgstr "Buscar en el pro~y~ecto"
+
+#: ../setedit/intgrep.cc:408
+msgid "Pl~a~ces to search"
+msgstr "Lug~a~res a buscar"
+
+#: ../setedit/intgrep.cc:410
+msgid "~R~ecurse in subdirs"
+msgstr "~R~ecursividad en subdirs"
+
+#: ../setedit/intgrep.cc:413
+msgid "~I~gnore case (-i)"
+msgstr "~I~gnorar may/min (-i)"
+
+#: ../setedit/intgrep.cc:414
+msgid "~W~hole words only (-w)"
+msgstr "Palabras co~m~pletas (-w)"
+
+#: ../setedit/intgrep.cc:415
+msgid "Whole line (-~x~)"
+msgstr "Lneas completas (-~x~)"
+
+#: ../setedit/intgrep.cc:416
+msgid "In~v~erse matching (-v)"
+msgstr "Bsqueda inversa (-~v~)"
+
+#: ../setedit/intgrep.cc:439
+msgid "You must provide at least one directory to search"
+msgstr "Debe especificar al menos un directorio donde buscar"
+
+#: ../setedit/intgrep.cc:521
+msgid "There aren't any files open"
+msgstr "No hay archivos abiertos"
+
+#: ../setedit/intgrep.cc:529
+msgid "No files in project"
+msgstr "No hay archivos en el proyecto"
+
+#: ../setedit/intgrep.cc:544
+msgid "Powered grep"
+msgstr "Grep potenciado"
+
+#: ../setedit/intgrep.cc:549
+msgid "Recurse & dirs. ignored, using internal names"
+msgstr ""
+"Recursividad y directorios ignorados ya que especific una bsqueda interna"
+
+#: ../setedit/intgrep.cc:559
+msgid "Grep search aborted"
+msgstr "Bsqueda con grep abortada"
+
+#: ../setedit/intgrep.cc:561
+msgid "End of grep search"
+msgstr "Fin de la bsqueda"
+
+#: ../setedit/loadnobkp.cc:45
+msgid "Don't create backups for"
+msgstr "No crear archivos de respaldo para"
+
+#: ../setedit/loadnobkp.cc:176
+msgid "Perl regular expression"
+msgstr "Expresin regular Perl"
+
+#: ../setedit/menuload.cc:72
+msgid "No error"
+msgstr "Sin errores"
+
+#: ../setedit/menuload.cc:73
+msgid "String expected"
+msgstr "Se esperaba una cadena de caracteres"
+
+#: ../setedit/menuload.cc:74
+msgid "String not closed"
+msgstr "Cadena de caracteres no cerrada"
+
+#: ../setedit/menuload.cc:75
+msgid "No key for SubMenu"
+msgstr "Falta la tecla a usar para el `SubMenu'"
+
+#: ../setedit/menuload.cc:76
+msgid "Wrong key name"
+msgstr "Nombre de tecla errneo"
+
+#: ../setedit/menuload.cc:77
+msgid "Extra characters in line"
+msgstr "Caracteres extra en la lnea"
+
+#: ../setedit/menuload.cc:78
+msgid "No number for a context"
+msgstr "Falta el nmero para el contexto"
+
+#: ../setedit/menuload.cc:79
+msgid "Syntax error"
+msgstr "Error de sintaxis"
+
+#: ../setedit/menuload.cc:80
+msgid "Empty submenu"
+msgstr "Submen vaco"
+
+#: ../setedit/menuload.cc:81
+msgid "SubMenu not closed "
+msgstr "Sub-men sin cerrar"
+
+#: ../setedit/menuload.cc:82
+msgid "Missing command value"
+msgstr "Falta el nombre del comando"
+
+#: ../setedit/menuload.cc:83
+msgid "Wrong command name"
+msgstr "Nombre de comando errneo"
+
+#: ../setedit/menuload.cc:84
+msgid "No menu definition"
+msgstr "No se defini el men"
+
+#: ../setedit/menuload.cc:85
+msgid "Wrong context name"
+msgstr "Nombre de contexto equivocado"
+
+#: ../setedit/menuload.cc:86
+msgid "Unfinished macro name"
+msgstr "Nombre de un macro no terminado"
+
+#: ../setedit/menuload.cc:87
+msgid "Unable to register macro"
+msgstr "No puedo resgistrar el macro"
+
+#: ../setedit/menuload.cc:88
+msgid "No status line definition"
+msgstr "No se defini la lnea de estado"
+
+#: ../setedit/menuload.cc:89
+msgid "No `from' value in range"
+msgstr "Falta el valor desde donde comienza el rango"
+
+#: ../setedit/menuload.cc:90
+msgid "No `quantity' value in range"
+msgstr "Falta indicar el tamao del rango"
+
+#: ../setedit/menuload.cc:91
+msgid "Number expected"
+msgstr "Se esperaba un nmero"
+
+#: ../setedit/menuload.cc:92
+msgid "Invalid range"
+msgstr "Rango invlido"
+
+#: ../setedit/menuload.cc:93
+msgid "StatusRange not closed"
+msgstr "No se ha cerrado el `StatusRange`"
+
+#: ../setedit/menuload.cc:94
+msgid "Empty status line"
+msgstr "Definicin de la lnea de estado vaca"
+
+#: ../setedit/menuload.cc:95
+msgid "Wrong help context name or number"
+msgstr "Nmero o nombre de contexto errneo"
+
+#: ../setedit/menuload.cc:96
+msgid "Too much conditionals nested"
+msgstr "Demasiados condicionales anidados"
+
+#: ../setedit/menuload.cc:97
+msgid "Unmatched $endif"
+msgstr "$endif suelto"
+
+#: ../setedit/menuload.cc:98
+msgid "Preprocessor value redefined"
+msgstr "Valor de preprocesador redefinido"
+
+#: ../setedit/menuload.cc:1491
+#, c-format
+msgid "Error loading menu: (%d) %s in line %d of %s."
+msgstr "Error cargando el men: (%d) %s en la lnea %d de %s."
+
+#: ../setedit/pathlist.cc:98
+msgid "Path to look for includes"
+msgstr "Directorios para buscar 'includes'"
+
+#: ../setedit/pathlist.cc:99
+msgid "Path to look for sources"
+msgstr "Directorios para buscar fuentes"
+
+#: ../setedit/pathlist.cc:335
+msgid "Directory"
+msgstr "Directorio"
+
+#: ../setedit/runprog.cc:83
+#, c-format
+msgid "Running %s"
+msgstr "Ejecutando %s"
+
+#: ../setedit/runprog.cc:84
+msgid "Back in the editor"
+msgstr "Nuevamente en el editor"
+
+#: ../setedit/runprog.cc:85
+msgid "From program:"
+msgstr "Desde el programa:"
+
+#: ../setedit/runprog.cc:122
+msgid "Command to run"
+msgstr "Comando a ejecutar"
+
+#. EN: ABCDEFGHIJKLMNOPRSTUW
+#. ES: ACDEFKHIJLMNOPRSTUVZ
+#: ../setedit/runprog.cc:125
+msgid "~E~nter the program name"
+msgstr "~I~ngrese el nombre del programa"
+
+#: ../setedit/runprog.cc:128
+msgid "~U~se OS screen to run the program"
+msgstr "~U~sar la pantalla del SO"
+
+#: ../setedit/runprog.cc:129
+msgid "~D~on't try to run in background"
+msgstr "No intentar correr en segundo ~p~lano"
+
+#: ../setedit/runprog.cc:130
+msgid "~A~lways parse in background"
+msgstr "Siempre en segundo pl~a~no"
+
+#: ../setedit/runprog.cc:131
+msgid "~J~ump to the first error"
+msgstr "Sal~t~ar al primer error"
+
+#: ../setedit/runprog.cc:132
+msgid "Don't ~r~edirect stdout"
+msgstr "N~o~ redireccionar stdout"
+
+#: ../setedit/runprog.cc:133
+msgid "Don't make a beep when f~i~nished"
+msgstr "No ~h~acer un sonido al terminar"
+
+#: ../setedit/runprog.cc:134
+msgid "Don't finish debu~g~ session"
+msgstr "No cerrar la sesin de ~d~epuracin"
+
+#: ../setedit/runprog.cc:135
+msgid "Don't move breakp~o~ints"
+msgstr "No mo~v~er los breakpoints"
+
+#: ../setedit/runprog.cc:136
+msgid "~C~onfirm if stopping debug session"
+msgstr "Confir~m~ar al cerrar la s. de depuracin"
+
+#: ../setedit/runprog.cc:137
+msgid "Message window ~s~croll"
+msgstr "Despla~z~amiento de la ventana de mensajes"
+
+#: ../setedit/runprog.cc:138
+msgid "Only if not ~f~ocused"
+msgstr "Slo si sele~c~cionada"
+
+#: ../setedit/runprog.cc:143
+msgid "~H~orizontal reset"
+msgstr "Posicin horizontal a cero"
+
+#: ../setedit/runprog.cc:144
+msgid "At ~b~eggining"
+msgstr "Al p~r~incipio"
+
+#: ../setedit/runprog.cc:145
+msgid "For each ~m~essage"
+msgstr "En cada mensa~j~e"
+
+#: ../setedit/runprog.cc:146
+msgid "At ~t~he end"
+msgstr "Al ~f~inal"
+
+#: ../setedit/runprog.cc:147
+msgid "~L~ines per pass"
+msgstr "~L~neas por pasada"
+
+#: ../setedit/runprog.cc:152
+msgid "Error ~p~arser"
+msgstr "Intrprete de ~e~rrores para"
+
+#. Error message from a GNU tool (i.e. gcc)
+#: ../setedit/runprog.cc:197
+msgid "error"
+msgstr "error"
+
+#. Warning message from a GNU tool (i.e. gcc)
+#: ../setedit/runprog.cc:199
+msgid "warning"
+msgstr "aviso"
+
+#. GNU Make message: Entering directory (partial)
+#: ../setedit/runprog.cc:201
+msgid "ntering dir"
+msgstr "e ingresa al dir"
+
+#. GNU Make message: Leaving directory (partial)
+#: ../setedit/runprog.cc:203
+msgid "eaving dir"
+msgstr "e sale del dir"
+
+#: ../setedit/runprog.cc:553
+msgid "A child process is running. Please wait or stop it."
+msgstr "Estamos corriendo un proceso hijo. Espere o detngalo."
+
+#: ../setedit/runprog.cc:584
+msgid "Waiting ..."
+msgstr "Esperando ..."
+
+#: ../setedit/runprog.cc:693
+msgid "Process interrupted"
+msgstr "Proceso interrumpido"
+
+#: ../setedit/runprog.cc:772
+msgid "You must configure it first in the Options submenu"
+msgstr "Debe configurar que programa ejecutar en el men de opciones"
+
+#: ../setedit/scresave.cc:246
+msgid "Screen saver. Press a key"
+msgstr "Salvapantallas. Presione una tecla"
+
+#. ************************* Text Stars saver ****************************
+#: ../setedit/scresave.cc:740
+msgid "Press a key to continue"
+msgstr "Presione una tecla para continuar"
+
+#. ************************* Safe saver ****************************
+#: ../setedit/scresave.cc:843
+msgid ""
+"That's a 'safe' screen saver. The editor has a beautiful plasma screen saver "
+"but currently it isn't the default because some (really buggy) Winshit 9x "
+"video drivers do strange things when a windowed DOS program switches to "
+"video mode. I hate it ...."
+msgstr ""
+"Este es un salvapantallas seguro. El editor tiene varios salvapantallas "
+"mucho mejores, pero actualmente no son usados por defecto porque algunos "
+"WinCaca 9x tienen serios problemas en los drivers de video y hacen cosas "
+"verdaderamente extraas cuando una aplicacin DOS que corre en una ventana "
+"entra a modo grfico. Odio esto ...."
+
+#: ../setedit/tips.cc:181 ../setedit/tips.cc:256
+msgid "Tip of the day"
+msgstr "Consejo del da"
+
+#: ../setedit/tips.cc:185
+#, c-format
+msgid "~T~ip %d"
+msgstr "~C~onsejo %d"
+
+#: ../setedit/tips.cc:207
+msgid "Don't ~s~how it again"
+msgstr "No ~m~ostrar esto nuevamente"
+
+#: ../setedit/tips.cc:208
+msgid "Show it once a ~d~ay"
+msgstr "Mostrarlo una vez por ~d~a"
+
+#: ../setedit/tips.cc:209
+msgid "Show it in the ~m~essage window"
+msgstr "Mostrarlo en la ~v~entana de mensajes"
+
+#: ../setedit/tips.cc:214
+msgid "~N~ext tip"
+msgstr "P~r~ximo"
+
+#: ../setedit/winlistd.cc:46
+msgid "Windows List"
+msgstr "Lista de Ventanas"
+
+#: ../setedit/winlistd.cc:96
+msgid "You can't delete this file"
+msgstr "No puede ser borrado del disco"
+
+#: ../setedit/winlistd.cc:139
+msgid "~G~o"
+msgstr "~I~r a"
+
+#: ../setedit/winlistd.cc:141
+msgid "~O~pen"
+msgstr "~A~brir"
+
+#: ../setedit/winlistd.cc:142
+msgid "Re~E~numerate"
+msgstr "Re~N~umerar"
+
+#: ../settvuti/fileopen.cc:93
+msgid "Ho~m~e"
+msgstr "~C~asa"
+
+#: ../settvuti/fileopen.cc:94
+msgid "~T~ree"
+msgstr "A~r~bol"
+
+#: ../settvuti/fileopen.cc:96
+msgid "O~p~tions"
+msgstr "O~p~ciones"
+
+#: ../settvuti/fileopen.cc:304
+msgid "~N~ame"
+msgstr "~N~ombre"
+
+#: ../settvuti/tdiagaid.cc:173
+msgid "~I~nfo."
+msgstr "~I~nfo."
+
+#: ../settvuti/tdiagaid.cc:208
+msgid "Assigned to:"
+msgstr "Asignado a:"
+
+#: ../settvuti/tdiagaid.cc:216
+msgid "Assignmen~t~"
+msgstr "Asi~g~nacin"
+
+#: ../settvuti/tdiagaid.cc:216
+msgid "Command~s~"
+msgstr "Comando~s~"
+
+#: ../settvuti/tdiagaid.cc:217
+msgid "s~L~isp code"
+msgstr "Cdigo s~L~isp"
+
+# msgid "~C~olors ..."
+# msgstr "~C~olores ..."
+# msgid "~C~olors ..."
+# msgstr "~C~olores ..."
+#~ msgid ""
+#~ ". Copyright (c) 1996-2002 by Salvador E. Tropea\n"
+#~ "\n"
+#~ msgstr ""
+#~ ". Copyright (c) 1996-2002 por Salvador E. Tropea\n"
+#~ "\n"
+
+#, fuzzy
+#~ msgid "Can't create temporal file"
+#~ msgstr "No puedo crear una copia temporal del autoexec.bat"
+
+#~ msgid "You must install gzip to browse compressed files!"
+#~ msgstr "Debe instalar gzip para leer archivos comprimidos!"
+
+#~ msgid "%d bytes selected, in %d"
+#~ msgstr "%d caracteres seleccionados en %d"
+
+#, fuzzy
+#~ msgid "Wrong desktop file (%s)."
+#~ msgstr "Archivo de escritorio incorrecto."
+
+#, fuzzy
+#~ msgid "Could not open desktop file (%s)"
+#~ msgstr "No puedo abrir el archivo del escritorio"
+
+#~ msgid "Watc~h~ an exp. (w/scope)"
+#~ msgstr "Ver una e~x~p. (c/mbito)"
+
+#~ msgid "%d: %s:%s:%d"
+#~ msgstr "%d: %s:%s:%d"
+
+#, fuzzy
+#~ msgid "Variable format"
+#~ msgstr "Variables"
+
+#, fuzzy
+#~ msgid "Error creating inspector"
+#~ msgstr "Error al crear el autoexec.bat"
+
+#~ msgid "SET's Editor v%lX.%lX.%lX, (c) 1996-2003"
+#~ msgstr "SET's Editor v%lX.%lX.%lX, (c) 1996-2003"
+
+#~ msgid "Error of type: %s"
+#~ msgstr "Error de tipo: %s"
+
+#~ msgid "File Open"
+#~ msgstr "Abrir archivo"
+
+#~ msgid "File Open options"
+#~ msgstr "Opciones de `Abrir Archivo'"
+
+#~ msgid "~E~ver"
+#~ msgstr "S~i~empre"
+
+#~ msgid "E~v~er"
+#~ msgstr "~S~iempre"
+
+#~ msgid "Ever"
+#~ msgstr "Sie~m~pre"
+
+#~ msgid "Unclosed string"
+#~ msgstr "Cadena de caracteres no cerrada"
+
+#~ msgid "Unclosed SubMenu"
+#~ msgstr "SubMenu no cerrado"
+
+#~ msgid "Unclosed StatusRange"
+#~ msgstr "No se ha cerrado el `StatusRange`"
+
+#~ msgid "T~a~g files ..."
+#~ msgstr "Archivos de ~T~AGs"
+
+#~ msgid "~I~tem"
+#~ msgstr "O~b~jeto"
+
+#~ msgid "~F~oreground"
+#~ msgstr "Prim. ~p~lano"
+
+#~ msgid "~T~ry"
+#~ msgstr "P~r~obar"
+
+#~ msgid "Pocket Calculator"
+#~ msgstr "Calculadora de Bolsillo"
+
+#~ msgid "Comment inside section name"
+#~ msgstr "Comentario dentro de una seccin"
+
+#~ msgid "Unterminated section name"
+#~ msgstr "Nombre de seccin sin terminar"
+
+#~ msgid "Empty section name"
+#~ msgstr "Nombre de seccin vacio"
+
+#~ msgid "Missing open section {"
+#~ msgstr "Falta el { que abre la seccin"
+
+#~ msgid "Missing close section }"
+#~ msgstr "Falta el } que cierra la seccin"
+
+#~ msgid "Missing equal sign"
+#~ msgstr "Falta un igual"
+
+#~ msgid "Missing value after equal"
+#~ msgstr "Falta un valor luego del igual"
+
+#~ msgid "Unterminated string"
+#~ msgstr "Cadena de caracteres no terminada"
+
+#~ msgid "Non branch in base"
+#~ msgstr "Variable en la base, slo secciones"
+
+#~ msgid "Trying to overwrite a value with a section"
+#~ msgstr "Intento de sobreescribir un valor con una seccin"
+
+#~ msgid "Trying to overwrite a section with a value"
+#~ msgstr "Intento de sobreescribir una seccin con un valor"
+
+#~ msgid "Windows not present"
+#~ msgstr "No est Windows o no se puede usar"
+
+#~ msgid "Clipboard in use by other application"
+#~ msgstr "El portapapeles est siendo usado por otra aplicacin"
+
+#~ msgid "Clipboard too big for the transfer buffer"
+#~ msgstr "El portapapeles es demasiado grande"
+
+#~ msgid "Windows reports error"
+#~ msgstr "Windows report un error"
+
+#~ msgid "type not registered: %s\n"
+#~ msgstr "tipo no registrado: %s\n"
+
+#~ msgid "Change Directory"
+#~ msgstr "Cambiar Directorio"
+
+#~ msgid "Directory ~n~ame"
+#~ msgstr "~N~ombre del directorio"
+
+#~ msgid "Directory ~t~ree"
+#~ msgstr "Arbol direc~t~orios"
+
+#~ msgid "~C~hdir"
+#~ msgstr "~C~ambiar"
+
+#~ msgid "~R~evert"
+#~ msgstr "~R~evertir"
+
+#~ msgid "Help"
+#~ msgstr "Ayuda"
+
+#~ msgid "Drives"
+#~ msgstr "Discos"
+
+#~ msgid "Invalid directory"
+#~ msgstr "Directorio invlido"
+
+#~ msgid "Text "
+#~ msgstr "Texto "
+
+#~ msgid "~F~iles"
+#~ msgstr "~A~rchivos"
+
+#~ msgid "~S~elect"
+#~ msgstr "~S~eleccionar"
+
+#~ msgid "~R~eplace"
+#~ msgstr "~R~eemplazar"
+
+#~ msgid "Invalid drive or directory"
+#~ msgstr "Disco o directorio invlido"
+
+#~ msgid "Invalid file name."
+#~ msgstr "Nombre de archivo invlido"
+
+#~ msgid "Jan"
+#~ msgstr "Ene"
+
+#~ msgid "Feb"
+#~ msgstr "Feb"
+
+#~ msgid "Mar"
+#~ msgstr "Mar"
+
+#~ msgid "Apr"
+#~ msgstr "Abr"
+
+#~ msgid "Jun"
+#~ msgstr "Jun"
+
+#~ msgid "Jul"
+#~ msgstr "Jul"
+
+#~ msgid "Aug"
+#~ msgstr "Ago"
+
+#~ msgid "Sep"
+#~ msgstr "Sep"
+
+#~ msgid "Oct"
+#~ msgstr "Oct"
+
+#~ msgid "Nov"
+#~ msgstr "Nov"
+
+#~ msgid "Dec"
+#~ msgstr "Dic"
+
+#~ msgid "Highlight"
+#~ msgstr "Resaltado"
+
+#~ msgid "Underline"
+#~ msgstr "Subrayado"
+
+#~ msgid "Inverse"
+#~ msgstr "Inverso"
+
+#~ msgid "Value not in the range %lu to %lu"
+#~ msgstr "Valor fuera del rango %lu a %lu"
+
+#~ msgid "Value not in the range %li to %li"
+#~ msgstr "Valor fuera del rango %li a %li"
+
+#~ msgid "that's an interactive application, don't redirect stdin"
+#~ msgstr ""
+#~ "esta es una aplicacin interactiva, no redireccione la entrada estandar"
+
+#~ msgid "failed to get the name of the current terminal used for input"
+#~ msgstr "fallo al obtener el nombre de la terminal usada como entrada"
+
+#~ msgid "can't get input terminal attributes"
+#~ msgstr "no pude obtener los atributos de la terminal de entrada"
+
+#~ msgid "can't set input terminal attributes"
+#~ msgstr "no pude modificar los atributos de la terminal de entrada"
+
+#~ msgid "ioctl VT_SETMODE failed"
+#~ msgstr "la ioctl VT_SETMODE fall"
+
+#~ msgid ""
+#~ "that's an interactive application, don't redirect stdout. If you want to "
+#~ "collect information redirect stderr like this: program 2> file"
+#~ msgstr ""
+#~ "esta es una aplicacin interactiva, no redireccione la salida. Si quiere "
+#~ "colectar informacin redireccione la salida de error as: programa 2> "
+#~ "archivo"
+
+#~ msgid "failed to get the name of the current terminal used for output"
+#~ msgstr "fallo al obtener el nombre de la terminal usada como salida"
+
+#~ msgid "failed to open the output terminal"
+#~ msgstr "fallo al abrir la terminal de salida"
+
+#~ msgid "can't get output terminal information"
+#~ msgstr "no pude obtener informacin de la terminal de salida"
+
+#~ msgid "No available selection"
+#~ msgstr "No hay nada seleccionado"
+
+#~ msgid "Unsupported data type"
+#~ msgstr "Tipo de datos no soportado"
+
+#~ msgid "No data"
+#~ msgstr "No hay datos"
+
+#~ msgid "X11 error"
+#~ msgstr "Error de X11"
+
+#~ msgid "Another application holds the clipboard"
+#~ msgstr "Otra aplicacin retiene el portapapeles"
+
+# c-format
+#~ msgid "Could not open '%s' for reading"
+#~ msgstr "No puede abrir '%s' para leerlo"
+
+#~ msgid "Save to file"
+#~ msgstr "Grabar"
+
+#~ msgid "Confirm"
+#~ msgstr "Confirmar"
+
+#~ msgid "Don't warn you next time"
+#~ msgstr "No avisar la prxima vez"
+
+#~ msgid "normal text"
+#~ msgstr "texto normal"
+
+#~ msgid "hex"
+#~ msgstr "hexadecimales"
+
+#~ msgid "column markers"
+#~ msgstr "marcadores de columna"
+
+#~ msgid "~Alt-X~ Exit"
+#~ msgstr "~Alt-X~ Salir"
+
+#~ msgid "Type EXIT to return..."
+#~ msgstr "Tipee EXIT para volver ..."
+
+#~ msgid " has been modified. Save?"
+#~ msgstr " ha sido modificado. Grabo?"
+
+#~ msgid "Screen Options"
+#~ msgstr "Opciones de Pantalla"
+
+#~ msgid "Primary ~e~ncoding"
+#~ msgstr "Co~d~ificacin primaria"
+
+#~ msgid "This terminal have a fixed code page"
+#~ msgstr "Esta terminal no soporta cambios de pgina de caracteres"
+
+# msgid "~C~olors ..."
+# msgstr "~C~olores ..."
+# msgid "~C~olors ..."
+# msgstr "~C~olores ..."
+#~ msgid ""
+#~ ". Copyright (c) 1996-2001 by Salvador E. Tropea\n"
+#~ "\n"
+#~ msgstr ""
+#~ ". Copyright (c) 1996-2001 por Salvador E. Tropea\n"
+#~ "\n"
+
+#~ msgid "Keyboard setup"
+#~ msgstr "Configuracin del teclado"
+
+#~ msgid "~U~S keyboard and most others"
+#~ msgstr "~T~eclados norteamericanos y otros"
+
+#~ msgid "~G~reek keyboard (CP 737)"
+#~ msgstr "Teclado ~g~riego (CP 737)"
+
+#~ msgid "No fonts found"
+#~ msgstr "No se encontraron fonts"
+
+#~ msgid "~S~creen mode"
+#~ msgstr "Modos de ~V~ideo"
+
+#~ msgid "~P~rimary font (intense)"
+#~ msgstr "Font ~p~rincipal (intenso)"
+
+#~ msgid "~R~OM BIOS fonts"
+#~ msgstr "Font de la ~R~OM BIOS"
+
+#~ msgid "O~t~her font"
+#~ msgstr "O~t~ra font"
+
+#~ msgid "~S~econdary font"
+#~ msgstr "Font ~S~ecundaria"
+
+#~ msgid "~D~on't use it"
+#~ msgstr "~N~o usar esto"
+
+#~ msgid "Other ~f~ont"
+#~ msgstr "Otra ~f~ont"
+
+#~ msgid "Secondary encoding"
+#~ msgstr "Codificacin sec~u~ndaria"
+
+#~ msgid "Use external program"
+#~ msgstr "Usar un programa ~e~xterno"
+
+#~ msgid ""
+#~ "This video mode (0x%03x) is not supported by the Turbo Vision library"
+#~ msgstr ""
+#~ "Este modo de video (0x%03x) no es soportado por la librera Turbo Vision"
+
+#~ msgid ""
+#~ "-b, --bios-keyb: use BIOS for the keyboard [safer, limited].\n"
+#~ msgstr ""
+#~ "-b, --bios-keyb: usar el BIOS para el teclado [ms seguro, "
+#~ "limitado].\n"
+
+#~ msgid ""
+#~ "-B, --no-bios-keyb: don't use BIOS for the keyboard [faster, "
+#~ "default].\n"
+#~ msgstr ""
+#~ "-B, --no-bios-keyb: no usar el BIOS para el teclado [rpido, p/"
+#~ "defecto].\n"
+
+#~ msgid "Attention can't open the help file."
+#~ msgstr "Atencin no puedo abrir el archivo de ayuda!"
+
+#~ msgid ""
+#~ "-s, --no-signal: disables the hook of signals to save the "
+#~ "modified\n"
+#~ " buffers during a crash. Could be needed if the "
+#~ "editor\n"
+#~ " hangs in an extraordinary way.\n"
+#~ msgstr ""
+#~ "-s, --no-signal: deshabilita el uso de `signals' para grabar "
+#~ "archivos\n"
+#~ " modificados en caso de errores severos.\n"
+
+#~ msgid "Wrap column ~2~"
+#~ msgstr "Columna lmite ~2~"
+
+#~ msgid "Match pair on the fly ~1~"
+#~ msgstr "Resaltar el par `al vuel~o~'"
+
+#~ msgid "File already in project (or another with the same name)"
+#~ msgstr "El archivo ya est en el proyecto (u otro con el mismo nombre)"
+
+#~ msgid "Ove Kaaven for LibAmp, the Allegro adaptation of AMP"
+#~ msgstr "Ove Kaaven por LibAmp, adaptacin de AMP a Allegro"
+
+#~ msgid "No command for MenuItem"
+#~ msgstr "Falta el comando para el `MenuItem'"
+
+#~ msgid "Not implemented in Linux"
+#~ msgstr "No implementado en Linux"
+
+#~ msgid "O~f~f"
+#~ msgstr "Apa~g~ado"
+
+#~ msgid "Attention !! this file is in DOS format,"
+#~ msgstr ""
+#~ "Atencin! este archivo est en formato DOS, quiere convertirlo?, Haga "
+#~ "una copia primero"
diff --git a/setedit/internac/fix.c b/setedit/internac/fix.c
new file mode 100644
index 0000000..ca276d3
--- /dev/null
+++ b/setedit/internac/fix.c
@@ -0,0 +1,121 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+char *ReadFile(const char *name, long *len)
+{
+ char *ret;
+ FILE *f=fopen(name,"rb");
+ if (!f)
+ {
+ printf("Error opening %s\n",name);
+ exit(2);
+ }
+ fseek(f,0,SEEK_END);
+ *len=ftell(f);
+ if (!*len)
+ {
+ printf("Empty file! (%s)\n",name);
+ exit(3);
+ }
+ rewind(f);
+ ret=(char *)malloc(*len+1);
+ fread(ret,*len,1,f);
+ ret[*len]=0;
+ fclose(f);
+
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ long lenHeader,lenInput,lenVer;
+ char *header,*input,*version,*s,*newHeader,*prox,*pos;
+ char date[80];
+ time_t t;
+ struct tm *stm;
+ FILE *f;
+
+ if (argc!=4)
+ {
+ printf("Use: fix header input output\n");
+ return 1;
+ }
+ header=ReadFile(argv[1],&lenHeader);
+ input=ReadFile(argv[2],&lenInput);
+ version=ReadFile("../version.txt",&lenVer);
+
+ for (s=version; *s; s++)
+ if (*s=='\n' || *s=='\r')
+ {
+ *s=0;
+ break;
+ }
+ t=time(0);
+ stm=localtime(&t);
+ strftime(date,80,"%Y-%m-%d %H:%M%z",stm);
+
+ newHeader=(char *)malloc(lenHeader+80);
+ pos=header;
+ newHeader[0]=0;
+ do
+ {
+ prox=strstr(pos,"@@");
+ if (!prox)
+ strcat(newHeader,pos);
+ else
+ {
+ *prox=0;
+ strcat(newHeader,pos);
+ prox+=2;
+ pos=strstr(prox,"@@");
+ if (!pos)
+ {
+ printf("Error: Unclosed tag\n");
+ return 4;
+ }
+ *pos=0;
+ printf("Tag: %s\n",prox);
+ if (strcmp(prox,"VERSION")==0)
+ {
+ strcat(newHeader,version);
+ }
+ else if (strcmp(prox,"DATE")==0)
+ {
+ strcat(newHeader,date);
+ }
+ else
+ {
+ printf("Unknown tag: %s\n",prox);
+ return 5;
+ }
+ pos+=2;
+ }
+ }
+ while (prox);
+
+ //printf("%s",newHeader);
+ f=fopen(argv[3],"wb");
+ if (!f)
+ {
+ printf("Error creating %s\n",argv[3]);
+ return 6;
+ }
+ // Write new header
+ fwrite(newHeader,strlen(newHeader),1,f);
+ // Skip the old header
+ pos=strstr(input,"# End of header");
+ if (pos)
+ {// Old header found
+ for (; *pos && *pos!='\n'; pos++);
+ if (*pos=='\n') pos++;
+ lenInput-=pos-input;
+ }
+ else
+ pos=input;
+ // Write the rest
+ fwrite(pos,lenInput,1,f);
+ fclose(f);
+ return 0;
+}
diff --git a/setedit/internac/fix.pl b/setedit/internac/fix.pl
new file mode 100644
index 0000000..c1b0ce4
--- /dev/null
+++ b/setedit/internac/fix.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+# Copyright (C) 2001 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This script adds a propper header to the .po files.
+#
+require "../miscperl.pl";
+
+$header=$ARGV[0];
+$input =$ARGV[1];
+$output=$ARGV[2];
+
+$h=cat($header);
+die "Empty header!\n" unless $h;
+$i=cat($input);
+die "Empty input file!\n" unless $i;
+
+# Remove all header
+$i=~s/(\#((.*)\n)+\# End of header\n)//;
+
+# Update header
+GetVersion('../');
+$h=~s/\@\@VERSION\@\@/$Version/;
+# Use GMT time because in Perl is hard to know the time zone! (modules needed)
+($seg,$min,$hora,$dmes,$mes,$ano,$dsem,$dano,$flg)=gmtime;
+$Now=sprintf "%d-%02d-%02d %02d:%02d-0000",$ano+1900,$mes+1,$dmes,$hora,$min;
+$h=~s/\@\@DATE\@\@/$Now/;
+
+$h.=$i;
+
+replace($output,$h);
+
+1;
diff --git a/setedit/internac/getcolors.cc b/setedit/internac/getcolors.cc
new file mode 100644
index 0000000..0c1aa5c
--- /dev/null
+++ b/setedit/internac/getcolors.cc
@@ -0,0 +1,28 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea
+ Part of setedit package.
+ Covered by the GPL license.
+
+ Description:
+ Generates a fake C source containing the names of the colors and groups
+of colors for gettext.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <pal.h>
+#undef S
+#undef SS
+#define S(index,foreground,background,name) \
+ puts("__(\"" #name "\")");
+#define SS(index,foreground,background,name,_group) \
+ puts("__(\"" #name "\")"); \
+ puts("\nGroup: __(\"" #_group "\")");
+
+int main()
+{
+ SE_cpColor
+ return 0;
+}
+
diff --git a/setedit/internac/getids.cc b/setedit/internac/getids.cc
new file mode 100644
index 0000000..b5e6232
--- /dev/null
+++ b/setedit/internac/getids.cc
@@ -0,0 +1,42 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea
+ Part of setedit package.
+ Covered by the GPL license.
+
+ Description:
+ Program to extract the msgids from a file.
+ Used to create tvision.cc.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+ FILE *f=fopen(argv[1],"rt");
+ char b[200],*s;
+ while (fgets(b,199,f))
+ {
+ if (strncmp(b,"msgid",5)==0)
+ {
+ for (s=b+6; *s!='\n' && *s!='\r'; s++); *s=0;
+ printf("__(%s",b+6);
+ while (fgets(b,199,f))
+ {
+ if (strncmp(b,"msgstr",6)==0)
+ {
+ printf(")\n");
+ break;
+ }
+ else
+ {
+ for (s=b+6; *s!='\n' && *s!='\r'; s++); *s=0;
+ printf("\n%s",b);
+ }
+ }
+ }
+ }
+ return 0;
+}
diff --git a/setedit/internac/gnumake.in b/setedit/internac/gnumake.in
new file mode 100644
index 0000000..46924f1
--- /dev/null
+++ b/setedit/internac/gnumake.in
@@ -0,0 +1,124 @@
+# 'make languages' will build the language files
+# 'make install.languages' installs the language files at the correct place
+
+CXX=@CXX@
+CXXFLAGS=@CXXFLAGS@
+
+ifneq ($(strip $(DJDIR)),)
+export editor_OS:=DJGPP
+endif
+
+# If not DOS then just Linux, no other supported by now
+ifeq ($(strip $(editor_OS)),)
+export editor_OS:=Linux
+endif
+
+srcdir=.
+LANGUAGES=es de
+PACKAGE=setedit
+prefix=$(DJDIR)
+locale_dir=$(prefix)/share/locale
+
+po_list_l=$(shell cat po_list)
+
+ifeq ($(editor_OS),DJGPP)
+# To avoid problems with command line length limit
+po_list_cl=@po_list
+update_p=update
+else
+update_p=cp
+po_list_cl=$(po_list_l)
+endif
+
+po_subdirs=
+
+CFLAGS=-O
+
+ifdef MAINTAINER_MODE
+PO_DEPS=potfiles.po fix.exe $(addprefix h_,$(addsuffix .po,$(LANGUAGES)))
+POTFILES_DEPS=po_list $(po_list_l)
+else
+PO_DEPS=
+POTFILES_DEPS=
+endif
+
+all: $(addsuffix .mo,$(LANGUAGES))
+
+ifeq ($(xgettext),)
+xgettext=xgettext
+endif
+
+ifeq ($(msgmerge),)
+msgmerge=msgmerge
+endif
+
+ifeq ($(msgfmt),)
+msgfmt=msgfmt
+endif
+
+ifeq ($(libintl),)
+libintl=libintl.a
+endif
+
+getcolors.exe: getcolors.cc
+ $(CXX) -o getcolors.exe -s $(CXXFLAGS) -I../setedit/include getcolors.cc
+
+colors.cc: getcolors.exe ../setedit/include/pal.h
+ ./getcolors.exe > colors.cc
+
+po_list: colors.cc ../makes/lista
+ perl makelist.pl
+
+clean:
+ rm -f potfiles.po
+ rm -f $(addsuffix .mo,$(LANGUAGES))
+ rm -f $(addsuffix .po,$(LANGUAGES))
+ rm -f po_list
+
+potfiles.po: $(POTFILES_DEPS)
+#@echo "*** Ignore warnings about unterminated strings, is a bug in gettext."
+#@echo "*** Ulrich Drepper, the maintainer, refuses to fix it."
+ $(xgettext) --default-domain=dummy --add-comments --keyword=_ \
+ --keyword=__ --directory=$(srcdir) --omit-header \
+ --add-location $(po_list_cl)
+ touch dummy.po
+ $(update_p) dummy.po $@
+ rm dummy.po
+
+T=$(subst /,\,$@)
+
+fix.exe: fix.c
+ $(CXX) -o fix.exe -s $(CXXFLAGS) fix.c
+
+$(addsuffix .po,$(LANGUAGES)): $(PO_DEPS)
+#if not exist $(T) cp $^ $@
+ touch $@
+ ./fix.exe $(addprefix h_,$@) $< __.pot
+ -$(msgmerge) --force-po -o __.pon $@ __.pot
+ -$(update_p) __.pon $@
+ rm -f __.pon
+ rm -f __.pot
+ ./fix.exe $(addprefix h_,$@) $@ $@
+#$(addsuffix .mo,$(LANGUAGES)): $(msgfmt)
+
+%.mo: %.po
+ -$(msgfmt) -o $@ $<
+
+
+languages: $(addsuffix .mo,$(LANGUAGES))
+
+# This creates the .po files for each language from $(LANGUAGES)
+# See the sample translated file de.po, how to translate
+languages.src: $(addsuffix .po,$(LANGUAGES))
+
+#if you don't have the fileutils 3.13, you must copy the files manually
+%.ins: %.mo
+ ginstall -d $(locale_dir)/$*/LC_MESSAGES
+ -ginstall $< $(locale_dir)/$*/LC_MESSAGES/$(PACKAGE).mo
+
+install.languages.start:
+ rm -f languages.log
+
+install: languages install.languages.start \
+ $(addsuffix .ins,$(LANGUAGES))
+
diff --git a/setedit/internac/h_de.po b/setedit/internac/h_de.po
new file mode 100644
index 0000000..e82c29e
--- /dev/null
+++ b/setedit/internac/h_de.po
@@ -0,0 +1,15 @@
+# German translation file for SETEdit.
+# Copyright (C) 2001 Salvador E. Tropea.
+# Robert Hhne <robert.hoehne@gmx.net>, 2001.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: setedit @@VERSION@@\n"
+"PO-Revision-Date: @@DATE@@\n"
+"Last-Translator: Oliver Schieche <oliver.schieche@d2mail.de>\n"
+"Language-Team: German <set@ieee.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+# End of header
diff --git a/setedit/internac/h_es.po b/setedit/internac/h_es.po
new file mode 100644
index 0000000..fcf3b9b
--- /dev/null
+++ b/setedit/internac/h_es.po
@@ -0,0 +1,15 @@
+# Este es el archivo de traduccin a espaol.
+# Copyright (C) 2001-2005 Salvador E. Tropea.
+# Salvador E. Tropea <set@ieee.org>, 2001-2005.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: setedit @@VERSION@@\n"
+"PO-Revision-Date: @@DATE@@\n"
+"Last-Translator: Salvador E. Tropea <set@ieee.org>\n"
+"Language-Team: Spanish <set@ieee.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+# End of header
diff --git a/setedit/internac/makelist.pl b/setedit/internac/makelist.pl
new file mode 100644
index 0000000..eb74ab2
--- /dev/null
+++ b/setedit/internac/makelist.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This script scans all the C++ files in the source tree looking for files
+# with internationalization strings and generates a list called po_list
+#
+require "../miscperl.pl";
+
+# Open the list of files
+open(FIL,'../makes/lista');
+@files=<FIL>;
+close(FIL);
+$po_list='';
+foreach $i (@files)
+ {
+ chop($i);
+ $a=substr($i,0,1);
+ if (($a eq '-') or ($a eq '+') or ($a eq '*'))
+ {
+ $i=substr($i,1);
+ }
+ $name='../'.$i;
+ if ($name=~/\.cc$/)
+ {
+ $r=cat($name);
+ if ($r=~/\W_{1,2}\(/)
+ {
+ $po_list.="$name\n";
+ }
+ }
+ }
+replace('po_list',$po_list);
diff --git a/setedit/internac/po_list b/setedit/internac/po_list
new file mode 100644
index 0000000..4820206
--- /dev/null
+++ b/setedit/internac/po_list
@@ -0,0 +1,74 @@
+../calcu/calcu.cc
+../easydiag/test.cc
+../easydiag/tsbutton.cc
+../infview/inf.cc
+../infview/infbase.cc
+../infview/infmain.cc
+../infview/infmenu.cc
+../infview/manview.cc
+../install/install.cc
+../internac/colors.cc
+../internac/getcolors.cc
+../internac/getids.cc
+../mainsrc/accehtml.cc
+../mainsrc/bufun.cc
+../mainsrc/ceditor.cc
+../mainsrc/deedidia.cc
+../mainsrc/doedidia.cc
+../mainsrc/editwind.cc
+../mainsrc/gzfiles.cc
+../mainsrc/keytrans.cc
+../mainsrc/loaddefl.cc
+../mainsrc/loadfunc.cc
+../mainsrc/loadshl.cc
+../mainsrc/loadusew.cc
+../mainsrc/pathtool.cc
+../mainsrc/pmacros.cc
+../mainsrc/sdginter.cc
+../mainsrc/search.cc
+../mainsrc/slpinter.cc
+../mainsrc/ssyntax.cc
+../mainsrc/tags.cc
+../mp3/ampdiag.cc
+../mp3/intermp3.cc
+../mp3/mp3list.cc
+../sdg/mliediti.cc
+../sdg/mli.cc
+../setedit/advice.cc
+../setedit/ascii.cc
+../setedit/boardmix.cc
+../setedit/calendar.cc
+../setedit/debug.cc
+../setedit/dskascii.cc
+../setedit/dskcalen.cc
+../setedit/dskclip.cc
+../setedit/dskclose.cc
+../setedit/dskhelp.cc
+../setedit/dskmessa.cc
+../setedit/dskman.cc
+../setedit/dskmp3.cc
+../setedit/dstfile.cc
+../setedit/edcolor.cc
+../setedit/editdiag.cc
+../setedit/editmain.cc
+../setedit/editmenu.cc
+../setedit/editpale.cc
+../setedit/edkeys.cc
+../setedit/edmsg.cc
+../setedit/edprefs.cc
+../setedit/edprint.cc
+../setedit/edprj.cc
+../setedit/holidays.cc
+../setedit/intgrep.cc
+../setedit/loadcle.cc
+../setedit/loadnobkp.cc
+../setedit/menuload.cc
+../setedit/pathlist.cc
+../setedit/runprog.cc
+../setedit/scresave.cc
+../setedit/tips.cc
+../setedit/winlistd.cc
+../settvuti/diaghelp.cc
+../settvuti/fileopen.cc
+../settvuti/tdiagaid.cc
+../settvuti/tprogrdi.cc
diff --git a/setedit/internac/utod.pl b/setedit/internac/utod.pl
new file mode 100644
index 0000000..a72f7c3
--- /dev/null
+++ b/setedit/internac/utod.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+# Copyright (C) 2001 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+require "../miscperl.pl";
+
+$a=cat($ARGV[0]);
+if ($a!~/\r\n/)
+ {
+ $a=~s/\n/\r\n/g;
+ $a=~s/charset\=CP850/charset\=ISO\-8859\-1/;
+ }
+replace($ARGV[1],$a);
+
diff --git a/setedit/libbzip2/.cvsignore b/setedit/libbzip2/.cvsignore
new file mode 100644
index 0000000..f3c7a7c
--- /dev/null
+++ b/setedit/libbzip2/.cvsignore
@@ -0,0 +1 @@
+Makefile
diff --git a/setedit/libbzip2/Makefile b/setedit/libbzip2/Makefile
new file mode 100644
index 0000000..e4fb0ae
--- /dev/null
+++ b/setedit/libbzip2/Makefile
@@ -0,0 +1,103 @@
+#!/usr/bin/make
+CC=gcc
+AR=ar
+CFLAGS=-O3 -fomit-frame-pointer -ffast-math -pipe
+
+OBJS= blocksort.o \
+ huffman.o \
+ crctable.o \
+ randtable.o \
+ compress.o \
+ decompress.o \
+ bzlib.o
+
+all: libbz2.a bzip2 bzip2recover test
+
+bzip2: libbz2.a bzip2.o
+ $(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
+
+bzip2recover: bzip2recover.o
+ $(CC) $(CFLAGS) -o bzip2recover bzip2recover.o
+
+libbz2.a: $(OBJS)
+ rm -f libbz2.a
+ $(AR) cq libbz2.a $(OBJS)
+ @if ( test -f /usr/bin/ranlib -o -f /bin/ranlib -o \
+ -f /usr/ccs/bin/ranlib ) ; then \
+ echo ranlib libbz2.a ; \
+ ranlib libbz2.a ; \
+ fi
+
+test: bzip2
+ @cat words1
+ ./bzip2 -1 < sample1.ref > sample1.rb2
+ ./bzip2 -2 < sample2.ref > sample2.rb2
+ ./bzip2 -3 < sample3.ref > sample3.rb2
+ ./bzip2 -d < sample1.bz2 > sample1.tst
+ ./bzip2 -d < sample2.bz2 > sample2.tst
+ ./bzip2 -ds < sample3.bz2 > sample3.tst
+ cmp sample1.bz2 sample1.rb2
+ cmp sample2.bz2 sample2.rb2
+ cmp sample3.bz2 sample3.rb2
+ cmp sample1.tst sample1.ref
+ cmp sample2.tst sample2.ref
+ cmp sample3.tst sample3.ref
+ @cat words3
+
+PREFIX=/usr
+
+install: bzip2 bzip2recover
+ if ( test ! -d $(PREFIX)/bin ) ; then mkdir $(PREFIX)/bin ; fi
+ if ( test ! -d $(PREFIX)/lib ) ; then mkdir $(PREFIX)/lib ; fi
+ if ( test ! -d $(PREFIX)/man ) ; then mkdir $(PREFIX)/man ; fi
+ if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir $(PREFIX)/man/man1 ; fi
+ if ( test ! -d $(PREFIX)/include ) ; then mkdir $(PREFIX)/include ; fi
+ cp -f bzip2 $(PREFIX)/bin/bzip2
+ cp -f bzip2 $(PREFIX)/bin/bunzip2
+ cp -f bzip2 $(PREFIX)/bin/bzcat
+ cp -f bzip2recover $(PREFIX)/bin/bzip2recover
+ chmod a+x $(PREFIX)/bin/bzip2
+ chmod a+x $(PREFIX)/bin/bunzip2
+ chmod a+x $(PREFIX)/bin/bzcat
+ chmod a+x $(PREFIX)/bin/bzip2recover
+ cp -f bzip2.1 $(PREFIX)/man/man1
+ chmod a+r $(PREFIX)/man/man1/bzip2.1
+ cp -f bzlib.h $(PREFIX)/include
+ chmod a+r $(PREFIX)/include/bzlib.h
+ cp -f libbz2.a $(PREFIX)/lib
+ chmod a+r $(PREFIX)/lib/libbz2.a
+
+clean:
+ rm -f *.o libbz2.a bzip2 bzip2recover \
+ sample1.rb2 sample2.rb2 sample3.rb2 \
+ sample1.tst sample2.tst sample3.tst
+
+blocksort.o: blocksort.c
+ $(CC) $(CFLAGS) -c blocksort.c
+huffman.o: huffman.c
+ $(CC) $(CFLAGS) -c huffman.c
+crctable.o: crctable.c
+ $(CC) $(CFLAGS) -c crctable.c
+randtable.o: randtable.c
+ $(CC) $(CFLAGS) -c randtable.c
+compress.o: compress.c
+ $(CC) $(CFLAGS) -c compress.c
+decompress.o: decompress.c
+ $(CC) $(CFLAGS) -c decompress.c
+bzlib.o: bzlib.c
+ $(CC) $(CFLAGS) -c bzlib.c
+bzip2.o: bzip2.c
+ $(CC) $(CFLAGS) -c bzip2.c
+bzip2recover.o: bzip2recover.c
+ $(CC) $(CFLAGS) -c bzip2recover.c
+
+tarfile:
+ tar cvf interim.tar blocksort.c huffman.c crctable.c \
+ randtable.c compress.c decompress.c bzlib.c bzip2.c \
+ bzip2recover.c bzlib.h bzlib_private.h Makefile manual.texi \
+ manual.ps LICENSE bzip2.1 bzip2.1.preformatted bzip2.txt \
+ words1 words2 words3 sample1.ref sample2.ref sample3.ref \
+ sample1.bz2 sample2.bz2 sample3.bz2 dlltest.c \
+ *.html README CHANGES libbz2.def libbz2.dsp \
+ dlltest.dsp makefile.msc Y2K_INFO
+
diff --git a/setedit/libbzip2/Makefile.bcc b/setedit/libbzip2/Makefile.bcc
new file mode 100644
index 0000000..025bc63
--- /dev/null
+++ b/setedit/libbzip2/Makefile.bcc
@@ -0,0 +1,68 @@
+# Makefile for zlib for compiling by Borland C++ 5.5
+
+!ifndef _SUBMAKE
+
+CC = bcc32
+LD = bcc32
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLFLAGS = -WR
+!endif
+
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLFLAGS) -WC -X -q $(CDEBUGFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+!endif
+
+# This clashes:
+#CFLAGS_L=$(CFLAGS) -D__inline__=inline
+CFLAGS_L=$(CFLAGS)
+
+O = .obj
+
+# variables
+OBJ = blocksort$(O) huffman$(O) crctable$(O) randtable$(O) compress$(O) \
+ decompress$(O) bzlib$(O)
+
+all: bzip2.lib
+
+blocksort.obj: blocksort.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+huffman.obj: huffman.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+crctable.obj: crctable.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+randtable.obj: randtable.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+compress.obj: compress.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+decompress.obj: decompress.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+bzlib.obj: bzlib.c
+ $(CC) -c $(CFLAGS_L) $*.c
+
+bzip2.lib: $(OBJ)
+ del $@
+ tlib /E $@ @&&!
++$(**: = &^
++)
+!
+
+clean:
+ del *.obj
+ del *.exe
+ del *.dll
+ del *.lib
+ del *.tds
diff --git a/setedit/libbzip2/Makefile.nmk b/setedit/libbzip2/Makefile.nmk
new file mode 100644
index 0000000..cdbfaff
--- /dev/null
+++ b/setedit/libbzip2/Makefile.nmk
@@ -0,0 +1,54 @@
+# Makefile for bzip2.lib for compiling by MSVC
+
+!ifndef _SUBMAKE
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+CC = cl /nologo
+CXX = $(CC) /TP
+LD = $(CXX)
+
+CFLAGS = -O2 $(INC) /GR- /GX-
+LDFLAGS =
+
+!endif
+
+O = .o
+
+# variables
+OBJ = blocksort$(O) huffman$(O) crctable$(O) randtable$(O) compress$(O) \
+ decompress$(O) bzlib$(O)
+
+all:: bzip2.lib
+
+blocksort.o: blocksort.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+huffman.o: huffman.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+crctable.o: crctable.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+randtable.o: randtable.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+compress.o: compress.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+decompress.o: decompress.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+bzlib.o: bzlib.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+bzip2.lib: $(OBJ)
+ -del bzip2.lib
+ lib /OUT:bzip2.lib $(OBJ)
+
+clean:
+ del *.o
+ del *.lib
diff --git a/setedit/libbzip2/blocksort.c b/setedit/libbzip2/blocksort.c
new file mode 100644
index 0000000..ec42672
--- /dev/null
+++ b/setedit/libbzip2/blocksort.c
@@ -0,0 +1,1134 @@
+
+/*-------------------------------------------------------------*/
+/*--- Block sorting machinery ---*/
+/*--- blocksort.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+
+ To get some idea how the block sorting algorithms in this file
+ work, read my paper
+ On the Performance of BWT Sorting Algorithms
+ in Proceedings of the IEEE Data Compression Conference 2000,
+ Snowbird, Utah, USA, 27-30 March 2000. The main sort in this
+ file implements the algorithm called cache in the paper.
+--*/
+
+
+#include "bzlib_private.h"
+
+/*---------------------------------------------*/
+/*--- Fallback O(N log(N)^2) sorting ---*/
+/*--- algorithm, for repetitive blocks ---*/
+/*---------------------------------------------*/
+
+/*---------------------------------------------*/
+static
+__inline__
+void fallbackSimpleSort ( UInt32* fmap,
+ UInt32* eclass,
+ Int32 lo,
+ Int32 hi )
+{
+ Int32 i, j, tmp;
+ UInt32 ec_tmp;
+
+ if (lo == hi) return;
+
+ if (hi - lo > 3) {
+ for ( i = hi-4; i >= lo; i-- ) {
+ tmp = fmap[i];
+ ec_tmp = eclass[tmp];
+ for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
+ fmap[j-4] = fmap[j];
+ fmap[j-4] = tmp;
+ }
+ }
+
+ for ( i = hi-1; i >= lo; i-- ) {
+ tmp = fmap[i];
+ ec_tmp = eclass[tmp];
+ for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
+ fmap[j-1] = fmap[j];
+ fmap[j-1] = tmp;
+ }
+}
+
+
+/*---------------------------------------------*/
+#define fswap(zz1, zz2) \
+ { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
+
+#define fvswap(zzp1, zzp2, zzn) \
+{ \
+ Int32 yyp1 = (zzp1); \
+ Int32 yyp2 = (zzp2); \
+ Int32 yyn = (zzn); \
+ while (yyn > 0) { \
+ fswap(fmap[yyp1], fmap[yyp2]); \
+ yyp1++; yyp2++; yyn--; \
+ } \
+}
+
+
+#define fmin(a,b) ((a) < (b)) ? (a) : (b)
+
+#define fpush(lz,hz) { stackLo[sp] = lz; \
+ stackHi[sp] = hz; \
+ sp++; }
+
+#define fpop(lz,hz) { sp--; \
+ lz = stackLo[sp]; \
+ hz = stackHi[sp]; }
+
+#define FALLBACK_QSORT_SMALL_THRESH 10
+#define FALLBACK_QSORT_STACK_SIZE 100
+
+
+static
+void fallbackQSort3 ( UInt32* fmap,
+ UInt32* eclass,
+ Int32 loSt,
+ Int32 hiSt )
+{
+ Int32 unLo, unHi, ltLo, gtHi, n, m;
+ Int32 sp, lo, hi;
+ UInt32 med, r, r3;
+ Int32 stackLo[FALLBACK_QSORT_STACK_SIZE];
+ Int32 stackHi[FALLBACK_QSORT_STACK_SIZE];
+
+ r = 0;
+
+ sp = 0;
+ fpush ( loSt, hiSt );
+
+ while (sp > 0) {
+
+ AssertH ( sp < FALLBACK_QSORT_STACK_SIZE, 1004 );
+
+ fpop ( lo, hi );
+ if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) {
+ fallbackSimpleSort ( fmap, eclass, lo, hi );
+ continue;
+ }
+
+ /* Random partitioning. Median of 3 sometimes fails to
+ avoid bad cases. Median of 9 seems to help but
+ looks rather expensive. This too seems to work but
+ is cheaper. Guidance for the magic constants
+ 7621 and 32768 is taken from Sedgewick's algorithms
+ book, chapter 35.
+ */
+ r = ((r * 7621) + 1) % 32768;
+ r3 = r % 3;
+ if (r3 == 0) med = eclass[fmap[lo]]; else
+ if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else
+ med = eclass[fmap[hi]];
+
+ unLo = ltLo = lo;
+ unHi = gtHi = hi;
+
+ while (1) {
+ while (1) {
+ if (unLo > unHi) break;
+ n = (Int32)eclass[fmap[unLo]] - (Int32)med;
+ if (n == 0) {
+ fswap(fmap[unLo], fmap[ltLo]);
+ ltLo++; unLo++;
+ continue;
+ };
+ if (n > 0) break;
+ unLo++;
+ }
+ while (1) {
+ if (unLo > unHi) break;
+ n = (Int32)eclass[fmap[unHi]] - (Int32)med;
+ if (n == 0) {
+ fswap(fmap[unHi], fmap[gtHi]);
+ gtHi--; unHi--;
+ continue;
+ };
+ if (n < 0) break;
+ unHi--;
+ }
+ if (unLo > unHi) break;
+ fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--;
+ }
+
+ AssertD ( unHi == unLo-1, "fallbackQSort3(2)" );
+
+ if (gtHi < ltLo) continue;
+
+ n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n);
+ m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m);
+
+ n = lo + unLo - ltLo - 1;
+ m = hi - (gtHi - unHi) + 1;
+
+ if (n - lo > hi - m) {
+ fpush ( lo, n );
+ fpush ( m, hi );
+ } else {
+ fpush ( m, hi );
+ fpush ( lo, n );
+ }
+ }
+}
+
+#undef fmin
+#undef fpush
+#undef fpop
+#undef fswap
+#undef fvswap
+#undef FALLBACK_QSORT_SMALL_THRESH
+#undef FALLBACK_QSORT_STACK_SIZE
+
+
+/*---------------------------------------------*/
+/* Pre:
+ nblock > 0
+ eclass exists for [0 .. nblock-1]
+ ((UChar*)eclass) [0 .. nblock-1] holds block
+ ptr exists for [0 .. nblock-1]
+
+ Post:
+ ((UChar*)eclass) [0 .. nblock-1] holds block
+ All other areas of eclass destroyed
+ fmap [0 .. nblock-1] holds sorted order
+ bhtab [ 0 .. 2+(nblock/32) ] destroyed
+*/
+
+#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
+#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
+#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
+#define WORD_BH(zz) bhtab[(zz) >> 5]
+#define UNALIGNED_BH(zz) ((zz) & 0x01f)
+
+static
+void fallbackSort ( UInt32* fmap,
+ UInt32* eclass,
+ UInt32* bhtab,
+ Int32 nblock,
+ Int32 verb )
+{
+ Int32 ftab[257];
+ Int32 ftabCopy[256];
+ Int32 H, i, j, k, l, r, cc, cc1;
+ Int32 nNotDone;
+ Int32 nBhtab;
+ UChar* eclass8 = (UChar*)eclass;
+
+ /*--
+ Initial 1-char radix sort to generate
+ initial fmap and initial BH bits.
+ --*/
+ if (verb >= 4)
+ VPrintf0 ( " bucket sorting ...\n" );
+ for (i = 0; i < 257; i++) ftab[i] = 0;
+ for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;
+ for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i];
+ for (i = 1; i < 257; i++) ftab[i] += ftab[i-1];
+
+ for (i = 0; i < nblock; i++) {
+ j = eclass8[i];
+ k = ftab[j] - 1;
+ ftab[j] = k;
+ fmap[k] = i;
+ }
+
+ nBhtab = 2 + (nblock / 32);
+ for (i = 0; i < nBhtab; i++) bhtab[i] = 0;
+ for (i = 0; i < 256; i++) SET_BH(ftab[i]);
+
+ /*--
+ Inductively refine the buckets. Kind-of an
+ "exponential radix sort" (!), inspired by the
+ Manber-Myers suffix array construction algorithm.
+ --*/
+
+ /*-- set sentinel bits for block-end detection --*/
+ for (i = 0; i < 32; i++) {
+ SET_BH(nblock + 2*i);
+ CLEAR_BH(nblock + 2*i + 1);
+ }
+
+ /*-- the log(N) loop --*/
+ H = 1;
+ while (1) {
+
+ if (verb >= 4)
+ VPrintf1 ( " depth %6d has ", H );
+
+ j = 0;
+ for (i = 0; i < nblock; i++) {
+ if (ISSET_BH(i)) j = i;
+ k = fmap[i] - H; if (k < 0) k += nblock;
+ eclass[k] = j;
+ }
+
+ nNotDone = 0;
+ r = -1;
+ while (1) {
+
+ /*-- find the next non-singleton bucket --*/
+ k = r + 1;
+ while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
+ if (ISSET_BH(k)) {
+ while (WORD_BH(k) == 0xffffffff) k += 32;
+ while (ISSET_BH(k)) k++;
+ }
+ l = k - 1;
+ if (l >= nblock) break;
+ while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
+ if (!ISSET_BH(k)) {
+ while (WORD_BH(k) == 0x00000000) k += 32;
+ while (!ISSET_BH(k)) k++;
+ }
+ r = k - 1;
+ if (r >= nblock) break;
+
+ /*-- now [l, r] bracket current bucket --*/
+ if (r > l) {
+ nNotDone += (r - l + 1);
+ fallbackQSort3 ( fmap, eclass, l, r );
+
+ /*-- scan bucket and generate header bits-- */
+ cc = -1;
+ for (i = l; i <= r; i++) {
+ cc1 = eclass[fmap[i]];
+ if (cc != cc1) { SET_BH(i); cc = cc1; };
+ }
+ }
+ }
+
+ if (verb >= 4)
+ VPrintf1 ( "%6d unresolved strings\n", nNotDone );
+
+ H *= 2;
+ if (H > nblock || nNotDone == 0) break;
+ }
+
+ /*--
+ Reconstruct the original block in
+ eclass8 [0 .. nblock-1], since the
+ previous phase destroyed it.
+ --*/
+ if (verb >= 4)
+ VPrintf0 ( " reconstructing block ...\n" );
+ j = 0;
+ for (i = 0; i < nblock; i++) {
+ while (ftabCopy[j] == 0) j++;
+ ftabCopy[j]--;
+ eclass8[fmap[i]] = (UChar)j;
+ }
+ AssertH ( j < 256, 1005 );
+}
+
+#undef SET_BH
+#undef CLEAR_BH
+#undef ISSET_BH
+#undef WORD_BH
+#undef UNALIGNED_BH
+
+
+/*---------------------------------------------*/
+/*--- The main, O(N^2 log(N)) sorting ---*/
+/*--- algorithm. Faster for "normal" ---*/
+/*--- non-repetitive blocks. ---*/
+/*---------------------------------------------*/
+
+/*---------------------------------------------*/
+static
+__inline__
+Bool mainGtU ( UInt32 i1,
+ UInt32 i2,
+ UChar* block,
+ UInt16* quadrant,
+ UInt32 nblock,
+ Int32* budget )
+{
+ Int32 k;
+ UChar c1, c2;
+ UInt16 s1, s2;
+
+ AssertD ( i1 != i2, "mainGtU" );
+ /* 1 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 2 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 3 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 4 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 5 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 6 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 7 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 8 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 9 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 10 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 11 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+ /* 12 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ i1++; i2++;
+
+ k = nblock + 8;
+
+ do {
+ /* 1 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 2 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 3 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 4 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 5 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 6 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 7 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+ /* 8 */
+ c1 = block[i1]; c2 = block[i2];
+ if (c1 != c2) return (c1 > c2);
+ s1 = quadrant[i1]; s2 = quadrant[i2];
+ if (s1 != s2) return (s1 > s2);
+ i1++; i2++;
+
+ if (i1 >= nblock) i1 -= nblock;
+ if (i2 >= nblock) i2 -= nblock;
+
+ k -= 8;
+ (*budget)--;
+ }
+ while (k >= 0);
+
+ return False;
+}
+
+
+/*---------------------------------------------*/
+/*--
+ Knuth's increments seem to work better
+ than Incerpi-Sedgewick here. Possibly
+ because the number of elems to sort is
+ usually small, typically <= 20.
+--*/
+static
+Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280,
+ 9841, 29524, 88573, 265720,
+ 797161, 2391484 };
+
+static
+void mainSimpleSort ( UInt32* ptr,
+ UChar* block,
+ UInt16* quadrant,
+ Int32 nblock,
+ Int32 lo,
+ Int32 hi,
+ Int32 d,
+ Int32* budget )
+{
+ Int32 i, j, h, bigN, hp;
+ UInt32 v;
+
+ bigN = hi - lo + 1;
+ if (bigN < 2) return;
+
+ hp = 0;
+ while (incs[hp] < bigN) hp++;
+ hp--;
+
+ for (; hp >= 0; hp--) {
+ h = incs[hp];
+
+ i = lo + h;
+ while (True) {
+
+ /*-- copy 1 --*/
+ if (i > hi) break;
+ v = ptr[i];
+ j = i;
+ while ( mainGtU (
+ ptr[j-h]+d, v+d, block, quadrant, nblock, budget
+ ) ) {
+ ptr[j] = ptr[j-h];
+ j = j - h;
+ if (j <= (lo + h - 1)) break;
+ }
+ ptr[j] = v;
+ i++;
+
+ /*-- copy 2 --*/
+ if (i > hi) break;
+ v = ptr[i];
+ j = i;
+ while ( mainGtU (
+ ptr[j-h]+d, v+d, block, quadrant, nblock, budget
+ ) ) {
+ ptr[j] = ptr[j-h];
+ j = j - h;
+ if (j <= (lo + h - 1)) break;
+ }
+ ptr[j] = v;
+ i++;
+
+ /*-- copy 3 --*/
+ if (i > hi) break;
+ v = ptr[i];
+ j = i;
+ while ( mainGtU (
+ ptr[j-h]+d, v+d, block, quadrant, nblock, budget
+ ) ) {
+ ptr[j] = ptr[j-h];
+ j = j - h;
+ if (j <= (lo + h - 1)) break;
+ }
+ ptr[j] = v;
+ i++;
+
+ if (*budget < 0) return;
+ }
+ }
+}
+
+
+/*---------------------------------------------*/
+/*--
+ The following is an implementation of
+ an elegant 3-way quicksort for strings,
+ described in a paper "Fast Algorithms for
+ Sorting and Searching Strings", by Robert
+ Sedgewick and Jon L. Bentley.
+--*/
+
+#define mswap(zz1, zz2) \
+ { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
+
+#define mvswap(zzp1, zzp2, zzn) \
+{ \
+ Int32 yyp1 = (zzp1); \
+ Int32 yyp2 = (zzp2); \
+ Int32 yyn = (zzn); \
+ while (yyn > 0) { \
+ mswap(ptr[yyp1], ptr[yyp2]); \
+ yyp1++; yyp2++; yyn--; \
+ } \
+}
+
+static
+__inline__
+UChar mmed3 ( UChar a, UChar b, UChar c )
+{
+ UChar t;
+ if (a > b) { t = a; a = b; b = t; };
+ if (b > c) {
+ b = c;
+ if (a > b) b = a;
+ }
+ return b;
+}
+
+#define mmin(a,b) ((a) < (b)) ? (a) : (b)
+
+#define mpush(lz,hz,dz) { stackLo[sp] = lz; \
+ stackHi[sp] = hz; \
+ stackD [sp] = dz; \
+ sp++; }
+
+#define mpop(lz,hz,dz) { sp--; \
+ lz = stackLo[sp]; \
+ hz = stackHi[sp]; \
+ dz = stackD [sp]; }
+
+
+#define mnextsize(az) (nextHi[az]-nextLo[az])
+
+#define mnextswap(az,bz) \
+ { Int32 tz; \
+ tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \
+ tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \
+ tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; }
+
+
+#define MAIN_QSORT_SMALL_THRESH 20
+#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT)
+#define MAIN_QSORT_STACK_SIZE 100
+
+static
+void mainQSort3 ( UInt32* ptr,
+ UChar* block,
+ UInt16* quadrant,
+ Int32 nblock,
+ Int32 loSt,
+ Int32 hiSt,
+ Int32 dSt,
+ Int32* budget )
+{
+ Int32 unLo, unHi, ltLo, gtHi, n, m, med;
+ Int32 sp, lo, hi, d;
+
+ Int32 stackLo[MAIN_QSORT_STACK_SIZE];
+ Int32 stackHi[MAIN_QSORT_STACK_SIZE];
+ Int32 stackD [MAIN_QSORT_STACK_SIZE];
+
+ Int32 nextLo[3];
+ Int32 nextHi[3];
+ Int32 nextD [3];
+
+ sp = 0;
+ mpush ( loSt, hiSt, dSt );
+
+ while (sp > 0) {
+
+ AssertH ( sp < MAIN_QSORT_STACK_SIZE, 1001 );
+
+ mpop ( lo, hi, d );
+ if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
+ d > MAIN_QSORT_DEPTH_THRESH) {
+ mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget );
+ if (*budget < 0) return;
+ continue;
+ }
+
+ med = (Int32)
+ mmed3 ( block[ptr[ lo ]+d],
+ block[ptr[ hi ]+d],
+ block[ptr[ (lo+hi)>>1 ]+d] );
+
+ unLo = ltLo = lo;
+ unHi = gtHi = hi;
+
+ while (True) {
+ while (True) {
+ if (unLo > unHi) break;
+ n = ((Int32)block[ptr[unLo]+d]) - med;
+ if (n == 0) {
+ mswap(ptr[unLo], ptr[ltLo]);
+ ltLo++; unLo++; continue;
+ };
+ if (n > 0) break;
+ unLo++;
+ }
+ while (True) {
+ if (unLo > unHi) break;
+ n = ((Int32)block[ptr[unHi]+d]) - med;
+ if (n == 0) {
+ mswap(ptr[unHi], ptr[gtHi]);
+ gtHi--; unHi--; continue;
+ };
+ if (n < 0) break;
+ unHi--;
+ }
+ if (unLo > unHi) break;
+ mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--;
+ }
+
+ AssertD ( unHi == unLo-1, "mainQSort3(2)" );
+
+ if (gtHi < ltLo) {
+ mpush(lo, hi, d+1 );
+ continue;
+ }
+
+ n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n);
+ m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m);
+
+ n = lo + unLo - ltLo - 1;
+ m = hi - (gtHi - unHi) + 1;
+
+ nextLo[0] = lo; nextHi[0] = n; nextD[0] = d;
+ nextLo[1] = m; nextHi[1] = hi; nextD[1] = d;
+ nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1;
+
+ if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
+ if (mnextsize(1) < mnextsize(2)) mnextswap(1,2);
+ if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
+
+ AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" );
+ AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" );
+
+ mpush (nextLo[0], nextHi[0], nextD[0]);
+ mpush (nextLo[1], nextHi[1], nextD[1]);
+ mpush (nextLo[2], nextHi[2], nextD[2]);
+ }
+}
+
+#undef mswap
+#undef mvswap
+#undef mpush
+#undef mpop
+#undef mmin
+#undef mnextsize
+#undef mnextswap
+#undef MAIN_QSORT_SMALL_THRESH
+#undef MAIN_QSORT_DEPTH_THRESH
+#undef MAIN_QSORT_STACK_SIZE
+
+
+/*---------------------------------------------*/
+/* Pre:
+ nblock > N_OVERSHOOT
+ block32 exists for [0 .. nblock-1 +N_OVERSHOOT]
+ ((UChar*)block32) [0 .. nblock-1] holds block
+ ptr exists for [0 .. nblock-1]
+
+ Post:
+ ((UChar*)block32) [0 .. nblock-1] holds block
+ All other areas of block32 destroyed
+ ftab [0 .. 65536 ] destroyed
+ ptr [0 .. nblock-1] holds sorted order
+ if (*budget < 0), sorting was abandoned
+*/
+
+#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8])
+#define SETMASK (1 << 21)
+#define CLEARMASK (~(SETMASK))
+
+static
+void mainSort ( UInt32* ptr,
+ UChar* block,
+ UInt16* quadrant,
+ UInt32* ftab,
+ Int32 nblock,
+ Int32 verb,
+ Int32* budget )
+{
+ Int32 i, j, k, ss, sb;
+ Int32 runningOrder[256];
+ Bool bigDone[256];
+ Int32 copyStart[256];
+ Int32 copyEnd [256];
+ UChar c1;
+ Int32 numQSorted;
+ UInt16 s;
+ if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" );
+
+ /*-- set up the 2-byte frequency table --*/
+ for (i = 65536; i >= 0; i--) ftab[i] = 0;
+
+ j = block[0] << 8;
+ i = nblock-1;
+ for (; i >= 3; i -= 4) {
+ quadrant[i] = 0;
+ j = (j >> 8) | ( ((UInt16)block[i]) << 8);
+ ftab[j]++;
+ quadrant[i-1] = 0;
+ j = (j >> 8) | ( ((UInt16)block[i-1]) << 8);
+ ftab[j]++;
+ quadrant[i-2] = 0;
+ j = (j >> 8) | ( ((UInt16)block[i-2]) << 8);
+ ftab[j]++;
+ quadrant[i-3] = 0;
+ j = (j >> 8) | ( ((UInt16)block[i-3]) << 8);
+ ftab[j]++;
+ }
+ for (; i >= 0; i--) {
+ quadrant[i] = 0;
+ j = (j >> 8) | ( ((UInt16)block[i]) << 8);
+ ftab[j]++;
+ }
+
+ /*-- (emphasises close relationship of block & quadrant) --*/
+ for (i = 0; i < BZ_N_OVERSHOOT; i++) {
+ block [nblock+i] = block[i];
+ quadrant[nblock+i] = 0;
+ }
+
+ if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" );
+
+ /*-- Complete the initial radix sort --*/
+ for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1];
+
+ s = block[0] << 8;
+ i = nblock-1;
+ for (; i >= 3; i -= 4) {
+ s = (s >> 8) | (block[i] << 8);
+ j = ftab[s] -1;
+ ftab[s] = j;
+ ptr[j] = i;
+ s = (s >> 8) | (block[i-1] << 8);
+ j = ftab[s] -1;
+ ftab[s] = j;
+ ptr[j] = i-1;
+ s = (s >> 8) | (block[i-2] << 8);
+ j = ftab[s] -1;
+ ftab[s] = j;
+ ptr[j] = i-2;
+ s = (s >> 8) | (block[i-3] << 8);
+ j = ftab[s] -1;
+ ftab[s] = j;
+ ptr[j] = i-3;
+ }
+ for (; i >= 0; i--) {
+ s = (s >> 8) | (block[i] << 8);
+ j = ftab[s] -1;
+ ftab[s] = j;
+ ptr[j] = i;
+ }
+
+ /*--
+ Now ftab contains the first loc of every small bucket.
+ Calculate the running order, from smallest to largest
+ big bucket.
+ --*/
+ for (i = 0; i <= 255; i++) {
+ bigDone [i] = False;
+ runningOrder[i] = i;
+ }
+
+ {
+ Int32 vv;
+ Int32 h = 1;
+ do h = 3 * h + 1; while (h <= 256);
+ do {
+ h = h / 3;
+ for (i = h; i <= 255; i++) {
+ vv = runningOrder[i];
+ j = i;
+ while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) {
+ runningOrder[j] = runningOrder[j-h];
+ j = j - h;
+ if (j <= (h - 1)) goto zero;
+ }
+ zero:
+ runningOrder[j] = vv;
+ }
+ } while (h != 1);
+ }
+
+ /*--
+ The main sorting loop.
+ --*/
+
+ numQSorted = 0;
+
+ for (i = 0; i <= 255; i++) {
+
+ /*--
+ Process big buckets, starting with the least full.
+ Basically this is a 3-step process in which we call
+ mainQSort3 to sort the small buckets [ss, j], but
+ also make a big effort to avoid the calls if we can.
+ --*/
+ ss = runningOrder[i];
+
+ /*--
+ Step 1:
+ Complete the big bucket [ss] by quicksorting
+ any unsorted small buckets [ss, j], for j != ss.
+ Hopefully previous pointer-scanning phases have already
+ completed many of the small buckets [ss, j], so
+ we don't have to sort them at all.
+ --*/
+ for (j = 0; j <= 255; j++) {
+ if (j != ss) {
+ sb = (ss << 8) + j;
+ if ( ! (ftab[sb] & SETMASK) ) {
+ Int32 lo = ftab[sb] & CLEARMASK;
+ Int32 hi = (ftab[sb+1] & CLEARMASK) - 1;
+ if (hi > lo) {
+ if (verb >= 4)
+ VPrintf4 ( " qsort [0x%x, 0x%x] "
+ "done %d this %d\n",
+ ss, j, numQSorted, hi - lo + 1 );
+ mainQSort3 (
+ ptr, block, quadrant, nblock,
+ lo, hi, BZ_N_RADIX, budget
+ );
+ numQSorted += (hi - lo + 1);
+ if (*budget < 0) return;
+ }
+ }
+ ftab[sb] |= SETMASK;
+ }
+ }
+
+ AssertH ( !bigDone[ss], 1006 );
+
+ /*--
+ Step 2:
+ Now scan this big bucket [ss] so as to synthesise the
+ sorted order for small buckets [t, ss] for all t,
+ including, magically, the bucket [ss,ss] too.
+ This will avoid doing Real Work in subsequent Step 1's.
+ --*/
+ {
+ for (j = 0; j <= 255; j++) {
+ copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK;
+ copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1;
+ }
+ for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) {
+ k = ptr[j]-1; if (k < 0) k += nblock;
+ c1 = block[k];
+ if (!bigDone[c1])
+ ptr[ copyStart[c1]++ ] = k;
+ }
+ for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
+ k = ptr[j]-1; if (k < 0) k += nblock;
+ c1 = block[k];
+ if (!bigDone[c1])
+ ptr[ copyEnd[c1]-- ] = k;
+ }
+ }
+
+ AssertH ( copyStart[ss]-1 == copyEnd[ss], 1007 );
+
+ for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK;
+
+ /*--
+ Step 3:
+ The [ss] big bucket is now done. Record this fact,
+ and update the quadrant descriptors. Remember to
+ update quadrants in the overshoot area too, if
+ necessary. The "if (i < 255)" test merely skips
+ this updating for the last bucket processed, since
+ updating for the last bucket is pointless.
+
+ The quadrant array provides a way to incrementally
+ cache sort orderings, as they appear, so as to
+ make subsequent comparisons in fullGtU() complete
+ faster. For repetitive blocks this makes a big
+ difference (but not big enough to be able to avoid
+ the fallback sorting mechanism, exponential radix sort).
+
+ The precise meaning is: at all times:
+
+ for 0 <= i < nblock and 0 <= j <= nblock
+
+ if block[i] != block[j],
+
+ then the relative values of quadrant[i] and
+ quadrant[j] are meaningless.
+
+ else {
+ if quadrant[i] < quadrant[j]
+ then the string starting at i lexicographically
+ precedes the string starting at j
+
+ else if quadrant[i] > quadrant[j]
+ then the string starting at j lexicographically
+ precedes the string starting at i
+
+ else
+ the relative ordering of the strings starting
+ at i and j has not yet been determined.
+ }
+ --*/
+ bigDone[ss] = True;
+
+ if (i < 255) {
+ Int32 bbStart = ftab[ss << 8] & CLEARMASK;
+ Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart;
+ Int32 shifts = 0;
+
+ while ((bbSize >> shifts) > 65534) shifts++;
+
+ for (j = bbSize-1; j >= 0; j--) {
+ Int32 a2update = ptr[bbStart + j];
+ UInt16 qVal = (UInt16)(j >> shifts);
+ quadrant[a2update] = qVal;
+ if (a2update < BZ_N_OVERSHOOT)
+ quadrant[a2update + nblock] = qVal;
+ }
+ AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 );
+ }
+
+ }
+
+ if (verb >= 4)
+ VPrintf3 ( " %d pointers, %d sorted, %d scanned\n",
+ nblock, numQSorted, nblock - numQSorted );
+}
+
+#undef BIGFREQ
+#undef SETMASK
+#undef CLEARMASK
+
+
+/*---------------------------------------------*/
+/* Pre:
+ nblock > 0
+ arr2 exists for [0 .. nblock-1 +N_OVERSHOOT]
+ ((UChar*)arr2) [0 .. nblock-1] holds block
+ arr1 exists for [0 .. nblock-1]
+
+ Post:
+ ((UChar*)arr2) [0 .. nblock-1] holds block
+ All other areas of block destroyed
+ ftab [ 0 .. 65536 ] destroyed
+ arr1 [0 .. nblock-1] holds sorted order
+*/
+void BZ2_blockSort ( EState* s )
+{
+ UInt32* ptr = s->ptr;
+ UChar* block = s->block;
+ UInt32* ftab = s->ftab;
+ Int32 nblock = s->nblock;
+ Int32 verb = s->verbosity;
+ Int32 wfact = s->workFactor;
+ UInt16* quadrant;
+ Int32 budget;
+ Int32 budgetInit;
+ Int32 i;
+
+ if (nblock < 10000) {
+ fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
+ } else {
+ /* Calculate the location for quadrant, remembering to get
+ the alignment right. Assumes that &(block[0]) is at least
+ 2-byte aligned -- this should be ok since block is really
+ the first section of arr2.
+ */
+ i = nblock+BZ_N_OVERSHOOT;
+ if (i & 1) i++;
+ quadrant = (UInt16*)(&(block[i]));
+
+ /* (wfact-1) / 3 puts the default-factor-30
+ transition point at very roughly the same place as
+ with v0.1 and v0.9.0.
+ Not that it particularly matters any more, since the
+ resulting compressed stream is now the same regardless
+ of whether or not we use the main sort or fallback sort.
+ */
+ if (wfact < 1 ) wfact = 1;
+ if (wfact > 100) wfact = 100;
+ budgetInit = nblock * ((wfact-1) / 3);
+ budget = budgetInit;
+
+ mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget );
+ if (verb >= 3)
+ VPrintf3 ( " %d work, %d block, ratio %5.2f\n",
+ budgetInit - budget,
+ nblock,
+ (float)(budgetInit - budget) /
+ (float)(nblock==0 ? 1 : nblock) );
+ if (budget < 0) {
+ if (verb >= 2)
+ VPrintf0 ( " too repetitive; using fallback"
+ " sorting algorithm\n" );
+ fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
+ }
+ }
+
+ s->origPtr = -1;
+ for (i = 0; i < s->nblock; i++)
+ if (ptr[i] == 0)
+ { s->origPtr = i; break; };
+
+ AssertH( s->origPtr != -1, 1003 );
+}
+
+
+/*-------------------------------------------------------------*/
+/*--- end blocksort.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/bzlib.c b/setedit/libbzip2/bzlib.c
new file mode 100644
index 0000000..4a06d9f
--- /dev/null
+++ b/setedit/libbzip2/bzlib.c
@@ -0,0 +1,1564 @@
+
+/*-------------------------------------------------------------*/
+/*--- Library top-level functions. ---*/
+/*--- bzlib.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+/*--
+ CHANGES
+ ~~~~~~~
+ 0.9.0 -- original version.
+
+ 0.9.0a/b -- no changes in this file.
+
+ 0.9.0c
+ * made zero-length BZ_FLUSH work correctly in bzCompress().
+ * fixed bzWrite/bzRead to ignore zero-length requests.
+ * fixed bzread to correctly handle read requests after EOF.
+ * wrong parameter order in call to bzDecompressInit in
+ bzBuffToBuffDecompress. Fixed.
+--*/
+
+#include "bzlib_private.h"
+
+
+/*---------------------------------------------------*/
+/*--- Compression stuff ---*/
+/*---------------------------------------------------*/
+
+
+/*---------------------------------------------------*/
+#ifndef BZ_NO_STDIO
+void BZ2_bz__AssertH__fail ( int errcode )
+{
+ fprintf(stderr,
+ "\n\nbzip2/libbzip2: internal error number %d.\n"
+ "This is a bug in bzip2/libbzip2, %s.\n"
+ "Please report it to me at: jseward@acm.org. If this happened\n"
+ "when you were using some program which uses libbzip2 as a\n"
+ "component, you should also report this bug to the author(s)\n"
+ "of that program. Please make an effort to report this bug;\n"
+ "timely and accurate bug reports eventually lead to higher\n"
+ "quality software. Thanks. Julian Seward, 21 March 2000.\n\n",
+ errcode,
+ BZ2_bzlibVersion()
+ );
+ exit(3);
+}
+#endif
+
+
+/*---------------------------------------------------*/
+static
+int bz_config_ok ( void )
+{
+ if (sizeof(int) != 4) return 0;
+ if (sizeof(short) != 2) return 0;
+ if (sizeof(char) != 1) return 0;
+ return 1;
+}
+
+
+/*---------------------------------------------------*/
+static
+void* default_bzalloc ( void* opaque, Int32 items, Int32 size )
+{
+ void* v = malloc ( items * size );
+ return v;
+}
+
+static
+void default_bzfree ( void* opaque, void* addr )
+{
+ if (addr != NULL) free ( addr );
+}
+
+
+/*---------------------------------------------------*/
+static
+void prepare_new_block ( EState* s )
+{
+ Int32 i;
+ s->nblock = 0;
+ s->numZ = 0;
+ s->state_out_pos = 0;
+ BZ_INITIALISE_CRC ( s->blockCRC );
+ for (i = 0; i < 256; i++) s->inUse[i] = False;
+ s->blockNo++;
+}
+
+
+/*---------------------------------------------------*/
+static
+void init_RL ( EState* s )
+{
+ s->state_in_ch = 256;
+ s->state_in_len = 0;
+}
+
+
+static
+Bool isempty_RL ( EState* s )
+{
+ if (s->state_in_ch < 256 && s->state_in_len > 0)
+ return False; else
+ return True;
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzCompressInit)
+ ( bz_stream* strm,
+ int blockSize100k,
+ int verbosity,
+ int workFactor )
+{
+ Int32 n;
+ EState* s;
+
+ if (!bz_config_ok()) return BZ_CONFIG_ERROR;
+
+ if (strm == NULL ||
+ blockSize100k < 1 || blockSize100k > 9 ||
+ workFactor < 0 || workFactor > 250)
+ return BZ_PARAM_ERROR;
+
+ if (workFactor == 0) workFactor = 30;
+ if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
+ if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
+
+ s = BZALLOC( sizeof(EState) );
+ if (s == NULL) return BZ_MEM_ERROR;
+ s->strm = strm;
+
+ s->arr1 = NULL;
+ s->arr2 = NULL;
+ s->ftab = NULL;
+
+ n = 100000 * blockSize100k;
+ s->arr1 = BZALLOC( n * sizeof(UInt32) );
+ s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
+ s->ftab = BZALLOC( 65537 * sizeof(UInt32) );
+
+ if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
+ if (s->arr1 != NULL) BZFREE(s->arr1);
+ if (s->arr2 != NULL) BZFREE(s->arr2);
+ if (s->ftab != NULL) BZFREE(s->ftab);
+ if (s != NULL) BZFREE(s);
+ return BZ_MEM_ERROR;
+ }
+
+ s->blockNo = 0;
+ s->state = BZ_S_INPUT;
+ s->mode = BZ_M_RUNNING;
+ s->combinedCRC = 0;
+ s->blockSize100k = blockSize100k;
+ s->nblockMAX = 100000 * blockSize100k - 19;
+ s->verbosity = verbosity;
+ s->workFactor = workFactor;
+
+ s->block = (UChar*)s->arr2;
+ s->mtfv = (UInt16*)s->arr1;
+ s->zbits = NULL;
+ s->ptr = (UInt32*)s->arr1;
+
+ strm->state = s;
+ strm->total_in_lo32 = 0;
+ strm->total_in_hi32 = 0;
+ strm->total_out_lo32 = 0;
+ strm->total_out_hi32 = 0;
+ init_RL ( s );
+ prepare_new_block ( s );
+ return BZ_OK;
+}
+
+
+/*---------------------------------------------------*/
+static
+void add_pair_to_block ( EState* s )
+{
+ Int32 i;
+ UChar ch = (UChar)(s->state_in_ch);
+ for (i = 0; i < s->state_in_len; i++) {
+ BZ_UPDATE_CRC( s->blockCRC, ch );
+ }
+ s->inUse[s->state_in_ch] = True;
+ switch (s->state_in_len) {
+ case 1:
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ break;
+ case 2:
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ break;
+ case 3:
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ break;
+ default:
+ s->inUse[s->state_in_len-4] = True;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = (UChar)ch; s->nblock++;
+ s->block[s->nblock] = ((UChar)(s->state_in_len-4));
+ s->nblock++;
+ break;
+ }
+}
+
+
+/*---------------------------------------------------*/
+static
+void flush_RL ( EState* s )
+{
+ if (s->state_in_ch < 256) add_pair_to_block ( s );
+ init_RL ( s );
+}
+
+
+/*---------------------------------------------------*/
+#define ADD_CHAR_TO_BLOCK(zs,zchh0) \
+{ \
+ UInt32 zchh = (UInt32)(zchh0); \
+ /*-- fast track the common case --*/ \
+ if (zchh != zs->state_in_ch && \
+ zs->state_in_len == 1) { \
+ UChar ch = (UChar)(zs->state_in_ch); \
+ BZ_UPDATE_CRC( zs->blockCRC, ch ); \
+ zs->inUse[zs->state_in_ch] = True; \
+ zs->block[zs->nblock] = (UChar)ch; \
+ zs->nblock++; \
+ zs->state_in_ch = zchh; \
+ } \
+ else \
+ /*-- general, uncommon cases --*/ \
+ if (zchh != zs->state_in_ch || \
+ zs->state_in_len == 255) { \
+ if (zs->state_in_ch < 256) \
+ add_pair_to_block ( zs ); \
+ zs->state_in_ch = zchh; \
+ zs->state_in_len = 1; \
+ } else { \
+ zs->state_in_len++; \
+ } \
+}
+
+
+/*---------------------------------------------------*/
+static
+Bool copy_input_until_stop ( EState* s )
+{
+ Bool progress_in = False;
+
+ if (s->mode == BZ_M_RUNNING) {
+
+ /*-- fast track the common case --*/
+ while (True) {
+ /*-- block full? --*/
+ if (s->nblock >= s->nblockMAX) break;
+ /*-- no input? --*/
+ if (s->strm->avail_in == 0) break;
+ progress_in = True;
+ ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
+ s->strm->next_in++;
+ s->strm->avail_in--;
+ s->strm->total_in_lo32++;
+ if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
+ }
+
+ } else {
+
+ /*-- general, uncommon case --*/
+ while (True) {
+ /*-- block full? --*/
+ if (s->nblock >= s->nblockMAX) break;
+ /*-- no input? --*/
+ if (s->strm->avail_in == 0) break;
+ /*-- flush/finish end? --*/
+ if (s->avail_in_expect == 0) break;
+ progress_in = True;
+ ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
+ s->strm->next_in++;
+ s->strm->avail_in--;
+ s->strm->total_in_lo32++;
+ if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
+ s->avail_in_expect--;
+ }
+ }
+ return progress_in;
+}
+
+
+/*---------------------------------------------------*/
+static
+Bool copy_output_until_stop ( EState* s )
+{
+ Bool progress_out = False;
+
+ while (True) {
+
+ /*-- no output space? --*/
+ if (s->strm->avail_out == 0) break;
+
+ /*-- block done? --*/
+ if (s->state_out_pos >= s->numZ) break;
+
+ progress_out = True;
+ *(s->strm->next_out) = s->zbits[s->state_out_pos];
+ s->state_out_pos++;
+ s->strm->avail_out--;
+ s->strm->next_out++;
+ s->strm->total_out_lo32++;
+ if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
+ }
+
+ return progress_out;
+}
+
+
+/*---------------------------------------------------*/
+static
+Bool handle_compress ( bz_stream* strm )
+{
+ Bool progress_in = False;
+ Bool progress_out = False;
+ EState* s = strm->state;
+
+ while (True) {
+
+ if (s->state == BZ_S_OUTPUT) {
+ progress_out |= copy_output_until_stop ( s );
+ if (s->state_out_pos < s->numZ) break;
+ if (s->mode == BZ_M_FINISHING &&
+ s->avail_in_expect == 0 &&
+ isempty_RL(s)) break;
+ prepare_new_block ( s );
+ s->state = BZ_S_INPUT;
+ if (s->mode == BZ_M_FLUSHING &&
+ s->avail_in_expect == 0 &&
+ isempty_RL(s)) break;
+ }
+
+ if (s->state == BZ_S_INPUT) {
+ progress_in |= copy_input_until_stop ( s );
+ if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {
+ flush_RL ( s );
+ BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );
+ s->state = BZ_S_OUTPUT;
+ }
+ else
+ if (s->nblock >= s->nblockMAX) {
+ BZ2_compressBlock ( s, False );
+ s->state = BZ_S_OUTPUT;
+ }
+ else
+ if (s->strm->avail_in == 0) {
+ break;
+ }
+ }
+
+ }
+
+ return progress_in || progress_out;
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
+{
+ Bool progress;
+ EState* s;
+ if (strm == NULL) return BZ_PARAM_ERROR;
+ s = strm->state;
+ if (s == NULL) return BZ_PARAM_ERROR;
+ if (s->strm != strm) return BZ_PARAM_ERROR;
+
+ preswitch:
+ switch (s->mode) {
+
+ case BZ_M_IDLE:
+ return BZ_SEQUENCE_ERROR;
+
+ case BZ_M_RUNNING:
+ if (action == BZ_RUN) {
+ progress = handle_compress ( strm );
+ return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
+ }
+ else
+ if (action == BZ_FLUSH) {
+ s->avail_in_expect = strm->avail_in;
+ s->mode = BZ_M_FLUSHING;
+ goto preswitch;
+ }
+ else
+ if (action == BZ_FINISH) {
+ s->avail_in_expect = strm->avail_in;
+ s->mode = BZ_M_FINISHING;
+ goto preswitch;
+ }
+ else
+ return BZ_PARAM_ERROR;
+
+ case BZ_M_FLUSHING:
+ if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
+ if (s->avail_in_expect != s->strm->avail_in)
+ return BZ_SEQUENCE_ERROR;
+ progress = handle_compress ( strm );
+ if (s->avail_in_expect > 0 || !isempty_RL(s) ||
+ s->state_out_pos < s->numZ) return BZ_FLUSH_OK;
+ s->mode = BZ_M_RUNNING;
+ return BZ_RUN_OK;
+
+ case BZ_M_FINISHING:
+ if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
+ if (s->avail_in_expect != s->strm->avail_in)
+ return BZ_SEQUENCE_ERROR;
+ progress = handle_compress ( strm );
+ if (!progress) return BZ_SEQUENCE_ERROR;
+ if (s->avail_in_expect > 0 || !isempty_RL(s) ||
+ s->state_out_pos < s->numZ) return BZ_FINISH_OK;
+ s->mode = BZ_M_IDLE;
+ return BZ_STREAM_END;
+ }
+ return BZ_OK; /*--not reached--*/
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
+{
+ EState* s;
+ if (strm == NULL) return BZ_PARAM_ERROR;
+ s = strm->state;
+ if (s == NULL) return BZ_PARAM_ERROR;
+ if (s->strm != strm) return BZ_PARAM_ERROR;
+
+ if (s->arr1 != NULL) BZFREE(s->arr1);
+ if (s->arr2 != NULL) BZFREE(s->arr2);
+ if (s->ftab != NULL) BZFREE(s->ftab);
+ BZFREE(strm->state);
+
+ strm->state = NULL;
+
+ return BZ_OK;
+}
+
+
+/*---------------------------------------------------*/
+/*--- Decompression stuff ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzDecompressInit)
+ ( bz_stream* strm,
+ int verbosity,
+ int small )
+{
+ DState* s;
+
+ if (!bz_config_ok()) return BZ_CONFIG_ERROR;
+
+ if (strm == NULL) return BZ_PARAM_ERROR;
+ if (small != 0 && small != 1) return BZ_PARAM_ERROR;
+ if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR;
+
+ if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
+ if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
+
+ s = BZALLOC( sizeof(DState) );
+ if (s == NULL) return BZ_MEM_ERROR;
+ s->strm = strm;
+ strm->state = s;
+ s->state = BZ_X_MAGIC_1;
+ s->bsLive = 0;
+ s->bsBuff = 0;
+ s->calculatedCombinedCRC = 0;
+ strm->total_in_lo32 = 0;
+ strm->total_in_hi32 = 0;
+ strm->total_out_lo32 = 0;
+ strm->total_out_hi32 = 0;
+ s->smallDecompress = (Bool)small;
+ s->ll4 = NULL;
+ s->ll16 = NULL;
+ s->tt = NULL;
+ s->currBlockNo = 0;
+ s->verbosity = verbosity;
+
+ return BZ_OK;
+}
+
+
+/*---------------------------------------------------*/
+static
+void unRLE_obuf_to_output_FAST ( DState* s )
+{
+ UChar k1;
+
+ if (s->blockRandomised) {
+
+ while (True) {
+ /* try to finish existing run */
+ while (True) {
+ if (s->strm->avail_out == 0) return;
+ if (s->state_out_len == 0) break;
+ *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
+ BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
+ s->state_out_len--;
+ s->strm->next_out++;
+ s->strm->avail_out--;
+ s->strm->total_out_lo32++;
+ if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
+ }
+
+ /* can a new run be started? */
+ if (s->nblock_used == s->save_nblock+1) return;
+
+
+ s->state_out_len = 1;
+ s->state_out_ch = s->k0;
+ BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ s->state_out_len = 2;
+ BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ s->state_out_len = 3;
+ BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ s->state_out_len = ((Int32)k1) + 4;
+ BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
+ s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
+ }
+
+ } else {
+
+ /* restore */
+ UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC;
+ UChar c_state_out_ch = s->state_out_ch;
+ Int32 c_state_out_len = s->state_out_len;
+ Int32 c_nblock_used = s->nblock_used;
+ Int32 c_k0 = s->k0;
+ UInt32* c_tt = s->tt;
+ UInt32 c_tPos = s->tPos;
+ char* cs_next_out = s->strm->next_out;
+ unsigned int cs_avail_out = s->strm->avail_out;
+ /* end restore */
+
+ UInt32 avail_out_INIT = cs_avail_out;
+ Int32 s_save_nblockPP = s->save_nblock+1;
+ unsigned int total_out_lo32_old;
+
+ while (True) {
+
+ /* try to finish existing run */
+ if (c_state_out_len > 0) {
+ while (True) {
+ if (cs_avail_out == 0) goto return_notr;
+ if (c_state_out_len == 1) break;
+ *( (UChar*)(cs_next_out) ) = c_state_out_ch;
+ BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
+ c_state_out_len--;
+ cs_next_out++;
+ cs_avail_out--;
+ }
+ s_state_out_len_eq_one:
+ {
+ if (cs_avail_out == 0) {
+ c_state_out_len = 1; goto return_notr;
+ };
+ *( (UChar*)(cs_next_out) ) = c_state_out_ch;
+ BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
+ cs_next_out++;
+ cs_avail_out--;
+ }
+ }
+ /* can a new run be started? */
+ if (c_nblock_used == s_save_nblockPP) {
+ c_state_out_len = 0; goto return_notr;
+ };
+ c_state_out_ch = c_k0;
+ BZ_GET_FAST_C(k1); c_nblock_used++;
+ if (k1 != c_k0) {
+ c_k0 = k1; goto s_state_out_len_eq_one;
+ };
+ if (c_nblock_used == s_save_nblockPP)
+ goto s_state_out_len_eq_one;
+
+ c_state_out_len = 2;
+ BZ_GET_FAST_C(k1); c_nblock_used++;
+ if (c_nblock_used == s_save_nblockPP) continue;
+ if (k1 != c_k0) { c_k0 = k1; continue; };
+
+ c_state_out_len = 3;
+ BZ_GET_FAST_C(k1); c_nblock_used++;
+ if (c_nblock_used == s_save_nblockPP) continue;
+ if (k1 != c_k0) { c_k0 = k1; continue; };
+
+ BZ_GET_FAST_C(k1); c_nblock_used++;
+ c_state_out_len = ((Int32)k1) + 4;
+ BZ_GET_FAST_C(c_k0); c_nblock_used++;
+ }
+
+ return_notr:
+ total_out_lo32_old = s->strm->total_out_lo32;
+ s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out);
+ if (s->strm->total_out_lo32 < total_out_lo32_old)
+ s->strm->total_out_hi32++;
+
+ /* save */
+ s->calculatedBlockCRC = c_calculatedBlockCRC;
+ s->state_out_ch = c_state_out_ch;
+ s->state_out_len = c_state_out_len;
+ s->nblock_used = c_nblock_used;
+ s->k0 = c_k0;
+ s->tt = c_tt;
+ s->tPos = c_tPos;
+ s->strm->next_out = cs_next_out;
+ s->strm->avail_out = cs_avail_out;
+ /* end save */
+ }
+}
+
+
+
+/*---------------------------------------------------*/
+__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
+{
+ Int32 nb, na, mid;
+ nb = 0;
+ na = 256;
+ do {
+ mid = (nb + na) >> 1;
+ if (indx >= cftab[mid]) nb = mid; else na = mid;
+ }
+ while (na - nb != 1);
+ return nb;
+}
+
+
+/*---------------------------------------------------*/
+static
+void unRLE_obuf_to_output_SMALL ( DState* s )
+{
+ UChar k1;
+
+ if (s->blockRandomised) {
+
+ while (True) {
+ /* try to finish existing run */
+ while (True) {
+ if (s->strm->avail_out == 0) return;
+ if (s->state_out_len == 0) break;
+ *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
+ BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
+ s->state_out_len--;
+ s->strm->next_out++;
+ s->strm->avail_out--;
+ s->strm->total_out_lo32++;
+ if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
+ }
+
+ /* can a new run be started? */
+ if (s->nblock_used == s->save_nblock+1) return;
+
+
+ s->state_out_len = 1;
+ s->state_out_ch = s->k0;
+ BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ s->state_out_len = 2;
+ BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ s->state_out_len = 3;
+ BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
+ k1 ^= BZ_RAND_MASK; s->nblock_used++;
+ s->state_out_len = ((Int32)k1) + 4;
+ BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
+ s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
+ }
+
+ } else {
+
+ while (True) {
+ /* try to finish existing run */
+ while (True) {
+ if (s->strm->avail_out == 0) return;
+ if (s->state_out_len == 0) break;
+ *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
+ BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
+ s->state_out_len--;
+ s->strm->next_out++;
+ s->strm->avail_out--;
+ s->strm->total_out_lo32++;
+ if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
+ }
+
+ /* can a new run be started? */
+ if (s->nblock_used == s->save_nblock+1) return;
+
+ s->state_out_len = 1;
+ s->state_out_ch = s->k0;
+ BZ_GET_SMALL(k1); s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ s->state_out_len = 2;
+ BZ_GET_SMALL(k1); s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ s->state_out_len = 3;
+ BZ_GET_SMALL(k1); s->nblock_used++;
+ if (s->nblock_used == s->save_nblock+1) continue;
+ if (k1 != s->k0) { s->k0 = k1; continue; };
+
+ BZ_GET_SMALL(k1); s->nblock_used++;
+ s->state_out_len = ((Int32)k1) + 4;
+ BZ_GET_SMALL(s->k0); s->nblock_used++;
+ }
+
+ }
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
+{
+ DState* s;
+ if (strm == NULL) return BZ_PARAM_ERROR;
+ s = strm->state;
+ if (s == NULL) return BZ_PARAM_ERROR;
+ if (s->strm != strm) return BZ_PARAM_ERROR;
+
+ while (True) {
+ if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
+ if (s->state == BZ_X_OUTPUT) {
+ if (s->smallDecompress)
+ unRLE_obuf_to_output_SMALL ( s ); else
+ unRLE_obuf_to_output_FAST ( s );
+ if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {
+ BZ_FINALISE_CRC ( s->calculatedBlockCRC );
+ if (s->verbosity >= 3)
+ VPrintf2 ( " {0x%x, 0x%x}", s->storedBlockCRC,
+ s->calculatedBlockCRC );
+ if (s->verbosity >= 2) VPrintf0 ( "]" );
+ if (s->calculatedBlockCRC != s->storedBlockCRC)
+ return BZ_DATA_ERROR;
+ s->calculatedCombinedCRC
+ = (s->calculatedCombinedCRC << 1) |
+ (s->calculatedCombinedCRC >> 31);
+ s->calculatedCombinedCRC ^= s->calculatedBlockCRC;
+ s->state = BZ_X_BLKHDR_1;
+ } else {
+ return BZ_OK;
+ }
+ }
+ if (s->state >= BZ_X_MAGIC_1) {
+ Int32 r = BZ2_decompress ( s );
+ if (r == BZ_STREAM_END) {
+ if (s->verbosity >= 3)
+ VPrintf2 ( "\n combined CRCs: stored = 0x%x, computed = 0x%x",
+ s->storedCombinedCRC, s->calculatedCombinedCRC );
+ if (s->calculatedCombinedCRC != s->storedCombinedCRC)
+ return BZ_DATA_ERROR;
+ return r;
+ }
+ if (s->state != BZ_X_OUTPUT) return r;
+ }
+ }
+
+ AssertH ( 0, 6001 );
+
+ return 0; /*NOTREACHED*/
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
+{
+ DState* s;
+ if (strm == NULL) return BZ_PARAM_ERROR;
+ s = strm->state;
+ if (s == NULL) return BZ_PARAM_ERROR;
+ if (s->strm != strm) return BZ_PARAM_ERROR;
+
+ if (s->tt != NULL) BZFREE(s->tt);
+ if (s->ll16 != NULL) BZFREE(s->ll16);
+ if (s->ll4 != NULL) BZFREE(s->ll4);
+
+ BZFREE(strm->state);
+ strm->state = NULL;
+
+ return BZ_OK;
+}
+
+
+#ifndef BZ_NO_STDIO
+/*---------------------------------------------------*/
+/*--- File I/O stuff ---*/
+/*---------------------------------------------------*/
+
+#define BZ_SETERR(eee) \
+{ \
+ if (bzerror != NULL) *bzerror = eee; \
+ if (bzf != NULL) bzf->lastErr = eee; \
+}
+
+typedef
+ struct {
+ FILE* handle;
+ Char buf[BZ_MAX_UNUSED];
+ Int32 bufN;
+ Bool writing;
+ bz_stream strm;
+ Int32 lastErr;
+ Bool initialisedOk;
+ }
+ bzFile;
+
+
+/*---------------------------------------------*/
+static Bool myfeof ( FILE* f )
+{
+ Int32 c = fgetc ( f );
+ if (c == EOF) return True;
+ ungetc ( c, f );
+ return False;
+}
+
+
+/*---------------------------------------------------*/
+BZFILE* BZ_API(BZ2_bzWriteOpen)
+ ( int* bzerror,
+ FILE* f,
+ int blockSize100k,
+ int verbosity,
+ int workFactor )
+{
+ Int32 ret;
+ bzFile* bzf = NULL;
+
+ BZ_SETERR(BZ_OK);
+
+ if (f == NULL ||
+ (blockSize100k < 1 || blockSize100k > 9) ||
+ (workFactor < 0 || workFactor > 250) ||
+ (verbosity < 0 || verbosity > 4))
+ { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
+
+ if (ferror(f))
+ { BZ_SETERR(BZ_IO_ERROR); return NULL; };
+
+ bzf = malloc ( sizeof(bzFile) );
+ if (bzf == NULL)
+ { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
+
+ BZ_SETERR(BZ_OK);
+ bzf->initialisedOk = False;
+ bzf->bufN = 0;
+ bzf->handle = f;
+ bzf->writing = True;
+ bzf->strm.bzalloc = NULL;
+ bzf->strm.bzfree = NULL;
+ bzf->strm.opaque = NULL;
+
+ if (workFactor == 0) workFactor = 30;
+ ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
+ verbosity, workFactor );
+ if (ret != BZ_OK)
+ { BZ_SETERR(ret); free(bzf); return NULL; };
+
+ bzf->strm.avail_in = 0;
+ bzf->initialisedOk = True;
+ return bzf;
+}
+
+
+
+/*---------------------------------------------------*/
+void BZ_API(BZ2_bzWrite)
+ ( int* bzerror,
+ BZFILE* b,
+ void* buf,
+ int len )
+{
+ Int32 n, n2, ret;
+ bzFile* bzf = (bzFile*)b;
+
+ BZ_SETERR(BZ_OK);
+ if (bzf == NULL || buf == NULL || len < 0)
+ { BZ_SETERR(BZ_PARAM_ERROR); return; };
+ if (!(bzf->writing))
+ { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
+ if (ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return; };
+
+ if (len == 0)
+ { BZ_SETERR(BZ_OK); return; };
+
+ bzf->strm.avail_in = len;
+ bzf->strm.next_in = buf;
+
+ while (True) {
+ bzf->strm.avail_out = BZ_MAX_UNUSED;
+ bzf->strm.next_out = bzf->buf;
+ ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );
+ if (ret != BZ_RUN_OK)
+ { BZ_SETERR(ret); return; };
+
+ if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
+ n = BZ_MAX_UNUSED - bzf->strm.avail_out;
+ n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
+ n, bzf->handle );
+ if (n != n2 || ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return; };
+ }
+
+ if (bzf->strm.avail_in == 0)
+ { BZ_SETERR(BZ_OK); return; };
+ }
+}
+
+
+/*---------------------------------------------------*/
+void BZ_API(BZ2_bzWriteClose)
+ ( int* bzerror,
+ BZFILE* b,
+ int abandon,
+ unsigned int* nbytes_in,
+ unsigned int* nbytes_out )
+{
+ BZ2_bzWriteClose64 ( bzerror, b, abandon,
+ nbytes_in, NULL, nbytes_out, NULL );
+}
+
+
+void BZ_API(BZ2_bzWriteClose64)
+ ( int* bzerror,
+ BZFILE* b,
+ int abandon,
+ unsigned int* nbytes_in_lo32,
+ unsigned int* nbytes_in_hi32,
+ unsigned int* nbytes_out_lo32,
+ unsigned int* nbytes_out_hi32 )
+{
+ Int32 n, n2, ret;
+ bzFile* bzf = (bzFile*)b;
+
+ if (bzf == NULL)
+ { BZ_SETERR(BZ_OK); return; };
+ if (!(bzf->writing))
+ { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
+ if (ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return; };
+
+ if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0;
+ if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0;
+ if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0;
+ if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0;
+
+ if ((!abandon) && bzf->lastErr == BZ_OK) {
+ while (True) {
+ bzf->strm.avail_out = BZ_MAX_UNUSED;
+ bzf->strm.next_out = bzf->buf;
+ ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );
+ if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END)
+ { BZ_SETERR(ret); return; };
+
+ if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
+ n = BZ_MAX_UNUSED - bzf->strm.avail_out;
+ n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
+ n, bzf->handle );
+ if (n != n2 || ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return; };
+ }
+
+ if (ret == BZ_STREAM_END) break;
+ }
+ }
+
+ if ( !abandon && !ferror ( bzf->handle ) ) {
+ fflush ( bzf->handle );
+ if (ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return; };
+ }
+
+ if (nbytes_in_lo32 != NULL)
+ *nbytes_in_lo32 = bzf->strm.total_in_lo32;
+ if (nbytes_in_hi32 != NULL)
+ *nbytes_in_hi32 = bzf->strm.total_in_hi32;
+ if (nbytes_out_lo32 != NULL)
+ *nbytes_out_lo32 = bzf->strm.total_out_lo32;
+ if (nbytes_out_hi32 != NULL)
+ *nbytes_out_hi32 = bzf->strm.total_out_hi32;
+
+ BZ_SETERR(BZ_OK);
+ BZ2_bzCompressEnd ( &(bzf->strm) );
+ free ( bzf );
+}
+
+
+/*---------------------------------------------------*/
+BZFILE* BZ_API(BZ2_bzReadOpen)
+ ( int* bzerror,
+ FILE* f,
+ int verbosity,
+ int small,
+ void* unused,
+ int nUnused )
+{
+ bzFile* bzf = NULL;
+ int ret;
+
+ BZ_SETERR(BZ_OK);
+
+ if (f == NULL ||
+ (small != 0 && small != 1) ||
+ (verbosity < 0 || verbosity > 4) ||
+ (unused == NULL && nUnused != 0) ||
+ (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED)))
+ { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
+
+ if (ferror(f))
+ { BZ_SETERR(BZ_IO_ERROR); return NULL; };
+
+ bzf = malloc ( sizeof(bzFile) );
+ if (bzf == NULL)
+ { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
+
+ BZ_SETERR(BZ_OK);
+
+ bzf->initialisedOk = False;
+ bzf->handle = f;
+ bzf->bufN = 0;
+ bzf->writing = False;
+ bzf->strm.bzalloc = NULL;
+ bzf->strm.bzfree = NULL;
+ bzf->strm.opaque = NULL;
+
+ while (nUnused > 0) {
+ bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
+ unused = ((void*)( 1 + ((UChar*)(unused)) ));
+ nUnused--;
+ }
+
+ ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
+ if (ret != BZ_OK)
+ { BZ_SETERR(ret); free(bzf); return NULL; };
+
+ bzf->strm.avail_in = bzf->bufN;
+ bzf->strm.next_in = bzf->buf;
+
+ bzf->initialisedOk = True;
+ return bzf;
+}
+
+
+/*---------------------------------------------------*/
+void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
+{
+ bzFile* bzf = (bzFile*)b;
+
+ BZ_SETERR(BZ_OK);
+ if (bzf == NULL)
+ { BZ_SETERR(BZ_OK); return; };
+
+ if (bzf->writing)
+ { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
+
+ if (bzf->initialisedOk)
+ (void)BZ2_bzDecompressEnd ( &(bzf->strm) );
+ free ( bzf );
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzRead)
+ ( int* bzerror,
+ BZFILE* b,
+ void* buf,
+ int len )
+{
+ Int32 n, ret;
+ bzFile* bzf = (bzFile*)b;
+
+ BZ_SETERR(BZ_OK);
+
+ if (bzf == NULL || buf == NULL || len < 0)
+ { BZ_SETERR(BZ_PARAM_ERROR); return 0; };
+
+ if (bzf->writing)
+ { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; };
+
+ if (len == 0)
+ { BZ_SETERR(BZ_OK); return 0; };
+
+ bzf->strm.avail_out = len;
+ bzf->strm.next_out = buf;
+
+ while (True) {
+
+ if (ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return 0; };
+
+ if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
+ n = fread ( bzf->buf, sizeof(UChar),
+ BZ_MAX_UNUSED, bzf->handle );
+ if (ferror(bzf->handle))
+ { BZ_SETERR(BZ_IO_ERROR); return 0; };
+ bzf->bufN = n;
+ bzf->strm.avail_in = bzf->bufN;
+ bzf->strm.next_in = bzf->buf;
+ }
+
+ ret = BZ2_bzDecompress ( &(bzf->strm) );
+
+ if (ret != BZ_OK && ret != BZ_STREAM_END)
+ { BZ_SETERR(ret); return 0; };
+
+ if (ret == BZ_OK && myfeof(bzf->handle) &&
+ bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
+ { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
+
+ if (ret == BZ_STREAM_END)
+ { BZ_SETERR(BZ_STREAM_END);
+ return len - bzf->strm.avail_out; };
+ if (bzf->strm.avail_out == 0)
+ { BZ_SETERR(BZ_OK); return len; };
+
+ }
+
+ return 0; /*not reached*/
+}
+
+
+/*---------------------------------------------------*/
+void BZ_API(BZ2_bzReadGetUnused)
+ ( int* bzerror,
+ BZFILE* b,
+ void** unused,
+ int* nUnused )
+{
+ bzFile* bzf = (bzFile*)b;
+ if (bzf == NULL)
+ { BZ_SETERR(BZ_PARAM_ERROR); return; };
+ if (bzf->lastErr != BZ_STREAM_END)
+ { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
+ if (unused == NULL || nUnused == NULL)
+ { BZ_SETERR(BZ_PARAM_ERROR); return; };
+
+ BZ_SETERR(BZ_OK);
+ *nUnused = bzf->strm.avail_in;
+ *unused = bzf->strm.next_in;
+}
+#endif
+
+
+/*---------------------------------------------------*/
+/*--- Misc convenience stuff ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzBuffToBuffCompress)
+ ( char* dest,
+ unsigned int* destLen,
+ char* source,
+ unsigned int sourceLen,
+ int blockSize100k,
+ int verbosity,
+ int workFactor )
+{
+ bz_stream strm;
+ int ret;
+
+ if (dest == NULL || destLen == NULL ||
+ source == NULL ||
+ blockSize100k < 1 || blockSize100k > 9 ||
+ verbosity < 0 || verbosity > 4 ||
+ workFactor < 0 || workFactor > 250)
+ return BZ_PARAM_ERROR;
+
+ if (workFactor == 0) workFactor = 30;
+ strm.bzalloc = NULL;
+ strm.bzfree = NULL;
+ strm.opaque = NULL;
+ ret = BZ2_bzCompressInit ( &strm, blockSize100k,
+ verbosity, workFactor );
+ if (ret != BZ_OK) return ret;
+
+ strm.next_in = source;
+ strm.next_out = dest;
+ strm.avail_in = sourceLen;
+ strm.avail_out = *destLen;
+
+ ret = BZ2_bzCompress ( &strm, BZ_FINISH );
+ if (ret == BZ_FINISH_OK) goto output_overflow;
+ if (ret != BZ_STREAM_END) goto errhandler;
+
+ /* normal termination */
+ *destLen -= strm.avail_out;
+ BZ2_bzCompressEnd ( &strm );
+ return BZ_OK;
+
+ output_overflow:
+ BZ2_bzCompressEnd ( &strm );
+ return BZ_OUTBUFF_FULL;
+
+ errhandler:
+ BZ2_bzCompressEnd ( &strm );
+ return ret;
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzBuffToBuffDecompress)
+ ( char* dest,
+ unsigned int* destLen,
+ char* source,
+ unsigned int sourceLen,
+ int small,
+ int verbosity )
+{
+ bz_stream strm;
+ int ret;
+
+ if (dest == NULL || destLen == NULL ||
+ source == NULL ||
+ (small != 0 && small != 1) ||
+ verbosity < 0 || verbosity > 4)
+ return BZ_PARAM_ERROR;
+
+ strm.bzalloc = NULL;
+ strm.bzfree = NULL;
+ strm.opaque = NULL;
+ ret = BZ2_bzDecompressInit ( &strm, verbosity, small );
+ if (ret != BZ_OK) return ret;
+
+ strm.next_in = source;
+ strm.next_out = dest;
+ strm.avail_in = sourceLen;
+ strm.avail_out = *destLen;
+
+ ret = BZ2_bzDecompress ( &strm );
+ if (ret == BZ_OK) goto output_overflow_or_eof;
+ if (ret != BZ_STREAM_END) goto errhandler;
+
+ /* normal termination */
+ *destLen -= strm.avail_out;
+ BZ2_bzDecompressEnd ( &strm );
+ return BZ_OK;
+
+ output_overflow_or_eof:
+ if (strm.avail_out > 0) {
+ BZ2_bzDecompressEnd ( &strm );
+ return BZ_UNEXPECTED_EOF;
+ } else {
+ BZ2_bzDecompressEnd ( &strm );
+ return BZ_OUTBUFF_FULL;
+ };
+
+ errhandler:
+ BZ2_bzDecompressEnd ( &strm );
+ return ret;
+}
+
+
+/*---------------------------------------------------*/
+/*--
+ Code contributed by Yoshioka Tsuneo
+ (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
+ to support better zlib compatibility.
+ This code is not _officially_ part of libbzip2 (yet);
+ I haven't tested it, documented it, or considered the
+ threading-safeness of it.
+ If this code breaks, please contact both Yoshioka and me.
+--*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------------*/
+/*--
+ return version like "0.9.0c".
+--*/
+const char * BZ_API(BZ2_bzlibVersion)(void)
+{
+ return BZ_VERSION;
+}
+
+
+#ifndef BZ_NO_STDIO
+/*---------------------------------------------------*/
+
+#if defined(_WIN32) || defined(OS2) || defined(MSDOS)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+static
+BZFILE * bzopen_or_bzdopen
+ ( const char *path, /* no use when bzdopen */
+ int fd, /* no use when bzdopen */
+ const char *mode,
+ int open_mode) /* bzopen: 0, bzdopen:1 */
+{
+ int bzerr;
+ char unused[BZ_MAX_UNUSED];
+ int blockSize100k = 9;
+ int writing = 0;
+ char mode2[10] = "";
+ FILE *fp = NULL;
+ BZFILE *bzfp = NULL;
+ int verbosity = 0;
+ int workFactor = 30;
+ int smallMode = 0;
+ int nUnused = 0;
+
+ if (mode == NULL) return NULL;
+ while (*mode) {
+ switch (*mode) {
+ case 'r':
+ writing = 0; break;
+ case 'w':
+ writing = 1; break;
+ case 's':
+ smallMode = 1; break;
+ default:
+ if (isdigit((int)(*mode))) {
+ blockSize100k = *mode-'0';
+ }
+ }
+ mode++;
+ }
+ strcat(mode2, writing ? "w" : "r" );
+ strcat(mode2,"b"); /* binary mode */
+
+ if (open_mode==0) {
+ if (path==NULL || strcmp(path,"")==0) {
+ fp = (writing ? stdout : stdin);
+ SET_BINARY_MODE(fp);
+ } else {
+ fp = fopen(path,mode2);
+ }
+ } else {
+#ifdef BZ_STRICT_ANSI
+ fp = NULL;
+#else
+ fp = fdopen(fd,mode2);
+#endif
+ }
+ if (fp == NULL) return NULL;
+
+ if (writing) {
+ /* Guard against total chaos and anarchy -- JRS */
+ if (blockSize100k < 1) blockSize100k = 1;
+ if (blockSize100k > 9) blockSize100k = 9;
+ bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,
+ verbosity,workFactor);
+ } else {
+ bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,
+ unused,nUnused);
+ }
+ if (bzfp == NULL) {
+ if (fp != stdin && fp != stdout) fclose(fp);
+ return NULL;
+ }
+ return bzfp;
+}
+
+
+/*---------------------------------------------------*/
+/*--
+ open file for read or write.
+ ex) bzopen("file","w9")
+ case path="" or NULL => use stdin or stdout.
+--*/
+BZFILE * BZ_API(BZ2_bzopen)
+ ( const char *path,
+ const char *mode )
+{
+ return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0);
+}
+
+
+/*---------------------------------------------------*/
+BZFILE * BZ_API(BZ2_bzdopen)
+ ( int fd,
+ const char *mode )
+{
+ return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1);
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len )
+{
+ int bzerr, nread;
+ if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0;
+ nread = BZ2_bzRead(&bzerr,b,buf,len);
+ if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) {
+ return nread;
+ } else {
+ return -1;
+ }
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len )
+{
+ int bzerr;
+
+ BZ2_bzWrite(&bzerr,b,buf,len);
+ if(bzerr == BZ_OK){
+ return len;
+ }else{
+ return -1;
+ }
+}
+
+
+/*---------------------------------------------------*/
+int BZ_API(BZ2_bzflush) (BZFILE *b)
+{
+ /* do nothing now... */
+ return 0;
+}
+
+
+/*---------------------------------------------------*/
+void BZ_API(BZ2_bzclose) (BZFILE* b)
+{
+ int bzerr;
+ FILE *fp = ((bzFile *)b)->handle;
+
+ if (b==NULL) {return;}
+ if(((bzFile*)b)->writing){
+ BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
+ if(bzerr != BZ_OK){
+ BZ2_bzWriteClose(NULL,b,1,NULL,NULL);
+ }
+ }else{
+ BZ2_bzReadClose(&bzerr,b);
+ }
+ if(fp!=stdin && fp!=stdout){
+ fclose(fp);
+ }
+}
+
+
+/*---------------------------------------------------*/
+/*--
+ return last error code
+--*/
+static char *bzerrorstrings[] = {
+ "OK"
+ ,"SEQUENCE_ERROR"
+ ,"PARAM_ERROR"
+ ,"MEM_ERROR"
+ ,"DATA_ERROR"
+ ,"DATA_ERROR_MAGIC"
+ ,"IO_ERROR"
+ ,"UNEXPECTED_EOF"
+ ,"OUTBUFF_FULL"
+ ,"CONFIG_ERROR"
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+};
+
+
+const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
+{
+ int err = ((bzFile *)b)->lastErr;
+
+ if(err>0) err = 0;
+ *errnum = err;
+ return bzerrorstrings[err*-1];
+}
+#endif
+
+
+/*-------------------------------------------------------------*/
+/*--- end bzlib.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/bzlib.h b/setedit/libbzip2/bzlib.h
new file mode 100644
index 0000000..c9447a2
--- /dev/null
+++ b/setedit/libbzip2/bzlib.h
@@ -0,0 +1,319 @@
+
+/*-------------------------------------------------------------*/
+/*--- Public header file for the library. ---*/
+/*--- bzlib.h ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#ifndef _BZLIB_H
+#define _BZLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define BZ_RUN 0
+#define BZ_FLUSH 1
+#define BZ_FINISH 2
+
+#define BZ_OK 0
+#define BZ_RUN_OK 1
+#define BZ_FLUSH_OK 2
+#define BZ_FINISH_OK 3
+#define BZ_STREAM_END 4
+#define BZ_SEQUENCE_ERROR (-1)
+#define BZ_PARAM_ERROR (-2)
+#define BZ_MEM_ERROR (-3)
+#define BZ_DATA_ERROR (-4)
+#define BZ_DATA_ERROR_MAGIC (-5)
+#define BZ_IO_ERROR (-6)
+#define BZ_UNEXPECTED_EOF (-7)
+#define BZ_OUTBUFF_FULL (-8)
+#define BZ_CONFIG_ERROR (-9)
+
+typedef
+ struct {
+ char *next_in;
+ unsigned int avail_in;
+ unsigned int total_in_lo32;
+ unsigned int total_in_hi32;
+
+ char *next_out;
+ unsigned int avail_out;
+ unsigned int total_out_lo32;
+ unsigned int total_out_hi32;
+
+ void *state;
+
+ void *(*bzalloc)(void *,int,int);
+ void (*bzfree)(void *,void *);
+ void *opaque;
+ }
+ bz_stream;
+
+
+#ifndef BZ_IMPORT
+#define BZ_EXPORT
+#endif
+
+#ifdef _WIN32
+# include <stdio.h>
+# include <windows.h>
+# ifdef small
+ /* windows.h define small to char */
+# undef small
+# endif
+# ifdef BZ_EXPORT
+# define BZ_API(func) WINAPI func
+# define BZ_EXTERN extern
+# else
+ /* import windows dll dynamically */
+# define BZ_API(func) (WINAPI * func)
+# define BZ_EXTERN
+# endif
+#else
+# define BZ_API(func) func
+# define BZ_EXTERN extern
+#endif
+
+
+/*-- Core (low-level) library functions --*/
+
+BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
+ bz_stream* strm,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzCompress) (
+ bz_stream* strm,
+ int action
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
+ bz_stream* strm
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
+ bz_stream *strm,
+ int verbosity,
+ int small
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
+ bz_stream* strm
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
+ bz_stream *strm
+ );
+
+
+
+/*-- High(er) level library functions --*/
+
+#ifndef BZ_NO_STDIO
+#define BZ_MAX_UNUSED 5000
+
+typedef void BZFILE;
+
+BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
+ int* bzerror,
+ FILE* f,
+ int verbosity,
+ int small,
+ void* unused,
+ int nUnused
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
+ int* bzerror,
+ BZFILE* b
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
+ int* bzerror,
+ BZFILE* b,
+ void** unused,
+ int* nUnused
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzRead) (
+ int* bzerror,
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
+ int* bzerror,
+ FILE* f,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzWrite) (
+ int* bzerror,
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
+ int* bzerror,
+ BZFILE* b,
+ int abandon,
+ unsigned int* nbytes_in,
+ unsigned int* nbytes_out
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
+ int* bzerror,
+ BZFILE* b,
+ int abandon,
+ unsigned int* nbytes_in_lo32,
+ unsigned int* nbytes_in_hi32,
+ unsigned int* nbytes_out_lo32,
+ unsigned int* nbytes_out_hi32
+ );
+#endif
+
+
+/*-- Utility functions --*/
+
+BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
+ char* dest,
+ unsigned int* destLen,
+ char* source,
+ unsigned int sourceLen,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
+ char* dest,
+ unsigned int* destLen,
+ char* source,
+ unsigned int sourceLen,
+ int small,
+ int verbosity
+ );
+
+
+/*--
+ Code contributed by Yoshioka Tsuneo
+ (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
+ to support better zlib compatibility.
+ This code is not _officially_ part of libbzip2 (yet);
+ I haven't tested it, documented it, or considered the
+ threading-safeness of it.
+ If this code breaks, please contact both Yoshioka and me.
+--*/
+
+BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
+ void
+ );
+
+#ifndef BZ_NO_STDIO
+BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
+ const char *path,
+ const char *mode
+ );
+
+BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
+ int fd,
+ const char *mode
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzread) (
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzwrite) (
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzflush) (
+ BZFILE* b
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzclose) (
+ BZFILE* b
+ );
+
+BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
+ BZFILE *b,
+ int *errnum
+ );
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/*-------------------------------------------------------------*/
+/*--- end bzlib.h ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/bzlib_private.h b/setedit/libbzip2/bzlib_private.h
new file mode 100644
index 0000000..8019b2d
--- /dev/null
+++ b/setedit/libbzip2/bzlib_private.h
@@ -0,0 +1,530 @@
+
+/*-------------------------------------------------------------*/
+/*--- Private header file for the library. ---*/
+/*--- bzlib_private.h ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#ifndef _BZLIB_PRIVATE_H
+#define _BZLIB_PRIVATE_H
+
+#include <stdlib.h>
+
+#ifndef BZ_NO_STDIO
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#endif
+
+#include "bzlib.h"
+
+
+
+/*-- General stuff. --*/
+
+#define BZ_VERSION "1.0.0, 16-May-2000"
+
+typedef char Char;
+typedef unsigned char Bool;
+typedef unsigned char UChar;
+typedef int Int32;
+typedef unsigned int UInt32;
+typedef short Int16;
+typedef unsigned short UInt16;
+
+#define True ((Bool)1)
+#define False ((Bool)0)
+
+#ifndef __GNUC__
+#define __inline__ /* */
+#endif
+
+#ifndef BZ_NO_STDIO
+extern void BZ2_bz__AssertH__fail ( int errcode );
+#define AssertH(cond,errcode) \
+ { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); }
+#if BZ_DEBUG
+#define AssertD(cond,msg) \
+ { if (!(cond)) { \
+ fprintf ( stderr, \
+ "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\
+ exit(1); \
+ }}
+#else
+#define AssertD(cond,msg) /* */
+#endif
+#define VPrintf0(zf) \
+ fprintf(stderr,zf)
+#define VPrintf1(zf,za1) \
+ fprintf(stderr,zf,za1)
+#define VPrintf2(zf,za1,za2) \
+ fprintf(stderr,zf,za1,za2)
+#define VPrintf3(zf,za1,za2,za3) \
+ fprintf(stderr,zf,za1,za2,za3)
+#define VPrintf4(zf,za1,za2,za3,za4) \
+ fprintf(stderr,zf,za1,za2,za3,za4)
+#define VPrintf5(zf,za1,za2,za3,za4,za5) \
+ fprintf(stderr,zf,za1,za2,za3,za4,za5)
+#else
+extern void bz_internal_error ( int errcode );
+#define AssertH(cond,errcode) \
+ { if (!(cond)) bz_internal_error ( errcode ); }
+#define AssertD(cond,msg) /* */
+#define VPrintf0(zf) /* */
+#define VPrintf1(zf,za1) /* */
+#define VPrintf2(zf,za1,za2) /* */
+#define VPrintf3(zf,za1,za2,za3) /* */
+#define VPrintf4(zf,za1,za2,za3,za4) /* */
+#define VPrintf5(zf,za1,za2,za3,za4,za5) /* */
+#endif
+
+
+#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1)
+#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp))
+
+
+/*-- Constants for the back end. --*/
+
+#define BZ_MAX_ALPHA_SIZE 258
+#define BZ_MAX_CODE_LEN 23
+
+#define BZ_RUNA 0
+#define BZ_RUNB 1
+
+#define BZ_N_GROUPS 6
+#define BZ_G_SIZE 50
+#define BZ_N_ITERS 4
+
+#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE))
+
+
+
+/*-- Stuff for randomising repetitive blocks. --*/
+
+extern Int32 BZ2_rNums[512];
+
+#define BZ_RAND_DECLS \
+ Int32 rNToGo; \
+ Int32 rTPos \
+
+#define BZ_RAND_INIT_MASK \
+ s->rNToGo = 0; \
+ s->rTPos = 0 \
+
+#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0)
+
+#define BZ_RAND_UPD_MASK \
+ if (s->rNToGo == 0) { \
+ s->rNToGo = BZ2_rNums[s->rTPos]; \
+ s->rTPos++; \
+ if (s->rTPos == 512) s->rTPos = 0; \
+ } \
+ s->rNToGo--;
+
+
+
+/*-- Stuff for doing CRCs. --*/
+
+extern UInt32 BZ2_crc32Table[256];
+
+#define BZ_INITIALISE_CRC(crcVar) \
+{ \
+ crcVar = 0xffffffffL; \
+}
+
+#define BZ_FINALISE_CRC(crcVar) \
+{ \
+ crcVar = ~(crcVar); \
+}
+
+#define BZ_UPDATE_CRC(crcVar,cha) \
+{ \
+ crcVar = (crcVar << 8) ^ \
+ BZ2_crc32Table[(crcVar >> 24) ^ \
+ ((UChar)cha)]; \
+}
+
+
+
+/*-- States and modes for compression. --*/
+
+#define BZ_M_IDLE 1
+#define BZ_M_RUNNING 2
+#define BZ_M_FLUSHING 3
+#define BZ_M_FINISHING 4
+
+#define BZ_S_OUTPUT 1
+#define BZ_S_INPUT 2
+
+#define BZ_N_RADIX 2
+#define BZ_N_QSORT 12
+#define BZ_N_SHELL 18
+#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2)
+
+
+
+
+/*-- Structure holding all the compression-side stuff. --*/
+
+typedef
+ struct {
+ /* pointer back to the struct bz_stream */
+ bz_stream* strm;
+
+ /* mode this stream is in, and whether inputting */
+ /* or outputting data */
+ Int32 mode;
+ Int32 state;
+
+ /* remembers avail_in when flush/finish requested */
+ UInt32 avail_in_expect;
+
+ /* for doing the block sorting */
+ UInt32* arr1;
+ UInt32* arr2;
+ UInt32* ftab;
+ Int32 origPtr;
+
+ /* aliases for arr1 and arr2 */
+ UInt32* ptr;
+ UChar* block;
+ UInt16* mtfv;
+ UChar* zbits;
+
+ /* for deciding when to use the fallback sorting algorithm */
+ Int32 workFactor;
+
+ /* run-length-encoding of the input */
+ UInt32 state_in_ch;
+ Int32 state_in_len;
+ BZ_RAND_DECLS;
+
+ /* input and output limits and current posns */
+ Int32 nblock;
+ Int32 nblockMAX;
+ Int32 numZ;
+ Int32 state_out_pos;
+
+ /* map of bytes used in block */
+ Int32 nInUse;
+ Bool inUse[256];
+ UChar unseqToSeq[256];
+
+ /* the buffer for bit stream creation */
+ UInt32 bsBuff;
+ Int32 bsLive;
+
+ /* block and combined CRCs */
+ UInt32 blockCRC;
+ UInt32 combinedCRC;
+
+ /* misc administratium */
+ Int32 verbosity;
+ Int32 blockNo;
+ Int32 blockSize100k;
+
+ /* stuff for coding the MTF values */
+ Int32 nMTF;
+ Int32 mtfFreq [BZ_MAX_ALPHA_SIZE];
+ UChar selector [BZ_MAX_SELECTORS];
+ UChar selectorMtf[BZ_MAX_SELECTORS];
+
+ UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ /* second dimension: only 3 needed; 4 makes index calculations faster */
+ UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4];
+
+ }
+ EState;
+
+
+
+/*-- externs for compression. --*/
+
+extern void
+BZ2_blockSort ( EState* );
+
+extern void
+BZ2_compressBlock ( EState*, Bool );
+
+extern void
+BZ2_bsInitWrite ( EState* );
+
+extern void
+BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
+
+extern void
+BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
+
+
+
+/*-- states for decompression. --*/
+
+#define BZ_X_IDLE 1
+#define BZ_X_OUTPUT 2
+
+#define BZ_X_MAGIC_1 10
+#define BZ_X_MAGIC_2 11
+#define BZ_X_MAGIC_3 12
+#define BZ_X_MAGIC_4 13
+#define BZ_X_BLKHDR_1 14
+#define BZ_X_BLKHDR_2 15
+#define BZ_X_BLKHDR_3 16
+#define BZ_X_BLKHDR_4 17
+#define BZ_X_BLKHDR_5 18
+#define BZ_X_BLKHDR_6 19
+#define BZ_X_BCRC_1 20
+#define BZ_X_BCRC_2 21
+#define BZ_X_BCRC_3 22
+#define BZ_X_BCRC_4 23
+#define BZ_X_RANDBIT 24
+#define BZ_X_ORIGPTR_1 25
+#define BZ_X_ORIGPTR_2 26
+#define BZ_X_ORIGPTR_3 27
+#define BZ_X_MAPPING_1 28
+#define BZ_X_MAPPING_2 29
+#define BZ_X_SELECTOR_1 30
+#define BZ_X_SELECTOR_2 31
+#define BZ_X_SELECTOR_3 32
+#define BZ_X_CODING_1 33
+#define BZ_X_CODING_2 34
+#define BZ_X_CODING_3 35
+#define BZ_X_MTF_1 36
+#define BZ_X_MTF_2 37
+#define BZ_X_MTF_3 38
+#define BZ_X_MTF_4 39
+#define BZ_X_MTF_5 40
+#define BZ_X_MTF_6 41
+#define BZ_X_ENDHDR_2 42
+#define BZ_X_ENDHDR_3 43
+#define BZ_X_ENDHDR_4 44
+#define BZ_X_ENDHDR_5 45
+#define BZ_X_ENDHDR_6 46
+#define BZ_X_CCRC_1 47
+#define BZ_X_CCRC_2 48
+#define BZ_X_CCRC_3 49
+#define BZ_X_CCRC_4 50
+
+
+
+/*-- Constants for the fast MTF decoder. --*/
+
+#define MTFA_SIZE 4096
+#define MTFL_SIZE 16
+
+
+
+/*-- Structure holding all the decompression-side stuff. --*/
+
+typedef
+ struct {
+ /* pointer back to the struct bz_stream */
+ bz_stream* strm;
+
+ /* state indicator for this stream */
+ Int32 state;
+
+ /* for doing the final run-length decoding */
+ UChar state_out_ch;
+ Int32 state_out_len;
+ Bool blockRandomised;
+ BZ_RAND_DECLS;
+
+ /* the buffer for bit stream reading */
+ UInt32 bsBuff;
+ Int32 bsLive;
+
+ /* misc administratium */
+ Int32 blockSize100k;
+ Bool smallDecompress;
+ Int32 currBlockNo;
+ Int32 verbosity;
+
+ /* for undoing the Burrows-Wheeler transform */
+ Int32 origPtr;
+ UInt32 tPos;
+ Int32 k0;
+ Int32 unzftab[256];
+ Int32 nblock_used;
+ Int32 cftab[257];
+ Int32 cftabCopy[257];
+
+ /* for undoing the Burrows-Wheeler transform (FAST) */
+ UInt32 *tt;
+
+ /* for undoing the Burrows-Wheeler transform (SMALL) */
+ UInt16 *ll16;
+ UChar *ll4;
+
+ /* stored and calculated CRCs */
+ UInt32 storedBlockCRC;
+ UInt32 storedCombinedCRC;
+ UInt32 calculatedBlockCRC;
+ UInt32 calculatedCombinedCRC;
+
+ /* map of bytes used in block */
+ Int32 nInUse;
+ Bool inUse[256];
+ Bool inUse16[16];
+ UChar seqToUnseq[256];
+
+ /* for decoding the MTF values */
+ UChar mtfa [MTFA_SIZE];
+ Int32 mtfbase[256 / MTFL_SIZE];
+ UChar selector [BZ_MAX_SELECTORS];
+ UChar selectorMtf[BZ_MAX_SELECTORS];
+ UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+
+ Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ Int32 minLens[BZ_N_GROUPS];
+
+ /* save area for scalars in the main decompress code */
+ Int32 save_i;
+ Int32 save_j;
+ Int32 save_t;
+ Int32 save_alphaSize;
+ Int32 save_nGroups;
+ Int32 save_nSelectors;
+ Int32 save_EOB;
+ Int32 save_groupNo;
+ Int32 save_groupPos;
+ Int32 save_nextSym;
+ Int32 save_nblockMAX;
+ Int32 save_nblock;
+ Int32 save_es;
+ Int32 save_N;
+ Int32 save_curr;
+ Int32 save_zt;
+ Int32 save_zn;
+ Int32 save_zvec;
+ Int32 save_zj;
+ Int32 save_gSel;
+ Int32 save_gMinlen;
+ Int32* save_gLimit;
+ Int32* save_gBase;
+ Int32* save_gPerm;
+
+ }
+ DState;
+
+
+
+/*-- Macros for decompression. --*/
+
+#define BZ_GET_FAST(cccc) \
+ s->tPos = s->tt[s->tPos]; \
+ cccc = (UChar)(s->tPos & 0xff); \
+ s->tPos >>= 8;
+
+#define BZ_GET_FAST_C(cccc) \
+ c_tPos = c_tt[c_tPos]; \
+ cccc = (UChar)(c_tPos & 0xff); \
+ c_tPos >>= 8;
+
+#define SET_LL4(i,n) \
+ { if (((i) & 0x1) == 0) \
+ s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \
+ s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \
+ }
+
+#define GET_LL4(i) \
+ ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF)
+
+#define SET_LL(i,n) \
+ { s->ll16[i] = (UInt16)(n & 0x0000ffff); \
+ SET_LL4(i, n >> 16); \
+ }
+
+#define GET_LL(i) \
+ (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))
+
+#define BZ_GET_SMALL(cccc) \
+ cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
+ s->tPos = GET_LL(s->tPos);
+
+
+/*-- externs for decompression. --*/
+
+extern Int32
+BZ2_indexIntoF ( Int32, Int32* );
+
+extern Int32
+BZ2_decompress ( DState* );
+
+extern void
+BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
+ Int32, Int32, Int32 );
+
+
+#endif
+
+
+/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
+
+#ifdef BZ_NO_STDIO
+#ifndef NULL
+#define NULL 0
+#endif
+#endif
+
+
+/*-------------------------------------------------------------*/
+/*--- end bzlib_private.h ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/compress.c b/setedit/libbzip2/compress.c
new file mode 100644
index 0000000..cc5e31d
--- /dev/null
+++ b/setedit/libbzip2/compress.c
@@ -0,0 +1,714 @@
+
+/*-------------------------------------------------------------*/
+/*--- Compression machinery (not incl block sorting) ---*/
+/*--- compress.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+/*--
+ CHANGES
+ ~~~~~~~
+ 0.9.0 -- original version.
+
+ 0.9.0a/b -- no changes in this file.
+
+ 0.9.0c
+ * changed setting of nGroups in sendMTFValues() so as to
+ do a bit better on small files
+--*/
+
+#include "bzlib_private.h"
+
+
+/*---------------------------------------------------*/
+/*--- Bit stream I/O ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------------*/
+void BZ2_bsInitWrite ( EState* s )
+{
+ s->bsLive = 0;
+ s->bsBuff = 0;
+}
+
+
+/*---------------------------------------------------*/
+static
+void bsFinishWrite ( EState* s )
+{
+ while (s->bsLive > 0) {
+ s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24);
+ s->numZ++;
+ s->bsBuff <<= 8;
+ s->bsLive -= 8;
+ }
+}
+
+
+/*---------------------------------------------------*/
+#define bsNEEDW(nz) \
+{ \
+ while (s->bsLive >= 8) { \
+ s->zbits[s->numZ] \
+ = (UChar)(s->bsBuff >> 24); \
+ s->numZ++; \
+ s->bsBuff <<= 8; \
+ s->bsLive -= 8; \
+ } \
+}
+
+
+/*---------------------------------------------------*/
+static
+__inline__
+void bsW ( EState* s, Int32 n, UInt32 v )
+{
+ bsNEEDW ( n );
+ s->bsBuff |= (v << (32 - s->bsLive - n));
+ s->bsLive += n;
+}
+
+
+/*---------------------------------------------------*/
+static
+void bsPutUInt32 ( EState* s, UInt32 u )
+{
+ bsW ( s, 8, (u >> 24) & 0xffL );
+ bsW ( s, 8, (u >> 16) & 0xffL );
+ bsW ( s, 8, (u >> 8) & 0xffL );
+ bsW ( s, 8, u & 0xffL );
+}
+
+
+/*---------------------------------------------------*/
+static
+void bsPutUChar ( EState* s, UChar c )
+{
+ bsW( s, 8, (UInt32)c );
+}
+
+
+/*---------------------------------------------------*/
+/*--- The back end proper ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------------*/
+static
+void makeMaps_e ( EState* s )
+{
+ Int32 i;
+ s->nInUse = 0;
+ for (i = 0; i < 256; i++)
+ if (s->inUse[i]) {
+ s->unseqToSeq[i] = s->nInUse;
+ s->nInUse++;
+ }
+}
+
+
+/*---------------------------------------------------*/
+static
+void generateMTFValues ( EState* s )
+{
+ UChar yy[256];
+ Int32 i, j;
+ Int32 zPend;
+ Int32 wr;
+ Int32 EOB;
+
+ /*
+ After sorting (eg, here),
+ s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,
+ and
+ ((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
+ holds the original block data.
+
+ The first thing to do is generate the MTF values,
+ and put them in
+ ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ].
+ Because there are strictly fewer or equal MTF values
+ than block values, ptr values in this area are overwritten
+ with MTF values only when they are no longer needed.
+
+ The final compressed bitstream is generated into the
+ area starting at
+ (UChar*) (&((UChar*)s->arr2)[s->nblock])
+
+ These storage aliases are set up in bzCompressInit(),
+ except for the last one, which is arranged in
+ compressBlock().
+ */
+ UInt32* ptr = s->ptr;
+ UChar* block = s->block;
+ UInt16* mtfv = s->mtfv;
+
+ makeMaps_e ( s );
+ EOB = s->nInUse+1;
+
+ for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0;
+
+ wr = 0;
+ zPend = 0;
+ for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i;
+
+ for (i = 0; i < s->nblock; i++) {
+ UChar ll_i;
+ AssertD ( wr <= i, "generateMTFValues(1)" );
+ j = ptr[i]-1; if (j < 0) j += s->nblock;
+ ll_i = s->unseqToSeq[block[j]];
+ AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" );
+
+ if (yy[0] == ll_i) {
+ zPend++;
+ } else {
+
+ if (zPend > 0) {
+ zPend--;
+ while (True) {
+ if (zPend & 1) {
+ mtfv[wr] = BZ_RUNB; wr++;
+ s->mtfFreq[BZ_RUNB]++;
+ } else {
+ mtfv[wr] = BZ_RUNA; wr++;
+ s->mtfFreq[BZ_RUNA]++;
+ }
+ if (zPend < 2) break;
+ zPend = (zPend - 2) / 2;
+ };
+ zPend = 0;
+ }
+ {
+ register UChar rtmp;
+ register UChar* ryy_j;
+ register UChar rll_i;
+ rtmp = yy[1];
+ yy[1] = yy[0];
+ ryy_j = &(yy[1]);
+ rll_i = ll_i;
+ while ( rll_i != rtmp ) {
+ register UChar rtmp2;
+ ryy_j++;
+ rtmp2 = rtmp;
+ rtmp = *ryy_j;
+ *ryy_j = rtmp2;
+ };
+ yy[0] = rtmp;
+ j = ryy_j - &(yy[0]);
+ mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++;
+ }
+
+ }
+ }
+
+ if (zPend > 0) {
+ zPend--;
+ while (True) {
+ if (zPend & 1) {
+ mtfv[wr] = BZ_RUNB; wr++;
+ s->mtfFreq[BZ_RUNB]++;
+ } else {
+ mtfv[wr] = BZ_RUNA; wr++;
+ s->mtfFreq[BZ_RUNA]++;
+ }
+ if (zPend < 2) break;
+ zPend = (zPend - 2) / 2;
+ };
+ zPend = 0;
+ }
+
+ mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++;
+
+ s->nMTF = wr;
+}
+
+
+/*---------------------------------------------------*/
+#define BZ_LESSER_ICOST 0
+#define BZ_GREATER_ICOST 15
+
+static
+void sendMTFValues ( EState* s )
+{
+ Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;
+ Int32 nSelectors, alphaSize, minLen, maxLen, selCtr;
+ Int32 nGroups, nBytes;
+
+ /*--
+ UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ is a global since the decoder also needs it.
+
+ Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
+ are also globals only used in this proc.
+ Made global to keep stack frame size small.
+ --*/
+
+
+ UInt16 cost[BZ_N_GROUPS];
+ Int32 fave[BZ_N_GROUPS];
+
+ UInt16* mtfv = s->mtfv;
+
+ if (s->verbosity >= 3)
+ VPrintf3( " %d in block, %d after MTF & 1-2 coding, "
+ "%d+2 syms in use\n",
+ s->nblock, s->nMTF, s->nInUse );
+
+ alphaSize = s->nInUse+2;
+ for (t = 0; t < BZ_N_GROUPS; t++)
+ for (v = 0; v < alphaSize; v++)
+ s->len[t][v] = BZ_GREATER_ICOST;
+
+ /*--- Decide how many coding tables to use ---*/
+ AssertH ( s->nMTF > 0, 3001 );
+ if (s->nMTF < 200) nGroups = 2; else
+ if (s->nMTF < 600) nGroups = 3; else
+ if (s->nMTF < 1200) nGroups = 4; else
+ if (s->nMTF < 2400) nGroups = 5; else
+ nGroups = 6;
+
+ /*--- Generate an initial set of coding tables ---*/
+ {
+ Int32 nPart, remF, tFreq, aFreq;
+
+ nPart = nGroups;
+ remF = s->nMTF;
+ gs = 0;
+ while (nPart > 0) {
+ tFreq = remF / nPart;
+ ge = gs-1;
+ aFreq = 0;
+ while (aFreq < tFreq && ge < alphaSize-1) {
+ ge++;
+ aFreq += s->mtfFreq[ge];
+ }
+
+ if (ge > gs
+ && nPart != nGroups && nPart != 1
+ && ((nGroups-nPart) % 2 == 1)) {
+ aFreq -= s->mtfFreq[ge];
+ ge--;
+ }
+
+ if (s->verbosity >= 3)
+ VPrintf5( " initial group %d, [%d .. %d], "
+ "has %d syms (%4.1f%%)\n",
+ nPart, gs, ge, aFreq,
+ (100.0 * (float)aFreq) / (float)(s->nMTF) );
+
+ for (v = 0; v < alphaSize; v++)
+ if (v >= gs && v <= ge)
+ s->len[nPart-1][v] = BZ_LESSER_ICOST; else
+ s->len[nPart-1][v] = BZ_GREATER_ICOST;
+
+ nPart--;
+ gs = ge+1;
+ remF -= aFreq;
+ }
+ }
+
+ /*---
+ Iterate up to BZ_N_ITERS times to improve the tables.
+ ---*/
+ for (iter = 0; iter < BZ_N_ITERS; iter++) {
+
+ for (t = 0; t < nGroups; t++) fave[t] = 0;
+
+ for (t = 0; t < nGroups; t++)
+ for (v = 0; v < alphaSize; v++)
+ s->rfreq[t][v] = 0;
+
+ /*---
+ Set up an auxiliary length table which is used to fast-track
+ the common case (nGroups == 6).
+ ---*/
+ if (nGroups == 6) {
+ for (v = 0; v < alphaSize; v++) {
+ s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v];
+ s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v];
+ s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v];
+ }
+ }
+
+ nSelectors = 0;
+ totc = 0;
+ gs = 0;
+ while (True) {
+
+ /*--- Set group start & end marks. --*/
+ if (gs >= s->nMTF) break;
+ ge = gs + BZ_G_SIZE - 1;
+ if (ge >= s->nMTF) ge = s->nMTF-1;
+
+ /*--
+ Calculate the cost of this group as coded
+ by each of the coding tables.
+ --*/
+ for (t = 0; t < nGroups; t++) cost[t] = 0;
+
+ if (nGroups == 6 && 50 == ge-gs+1) {
+ /*--- fast track the common case ---*/
+ register UInt32 cost01, cost23, cost45;
+ register UInt16 icv;
+ cost01 = cost23 = cost45 = 0;
+
+# define BZ_ITER(nn) \
+ icv = mtfv[gs+(nn)]; \
+ cost01 += s->len_pack[icv][0]; \
+ cost23 += s->len_pack[icv][1]; \
+ cost45 += s->len_pack[icv][2]; \
+
+ BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4);
+ BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9);
+ BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14);
+ BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19);
+ BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24);
+ BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29);
+ BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34);
+ BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39);
+ BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44);
+ BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49);
+
+# undef BZ_ITER
+
+ cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16;
+ cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16;
+ cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16;
+
+ } else {
+ /*--- slow version which correctly handles all situations ---*/
+ for (i = gs; i <= ge; i++) {
+ UInt16 icv = mtfv[i];
+ for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];
+ }
+ }
+
+ /*--
+ Find the coding table which is best for this group,
+ and record its identity in the selector table.
+ --*/
+ bc = 999999999; bt = -1;
+ for (t = 0; t < nGroups; t++)
+ if (cost[t] < bc) { bc = cost[t]; bt = t; };
+ totc += bc;
+ fave[bt]++;
+ s->selector[nSelectors] = bt;
+ nSelectors++;
+
+ /*--
+ Increment the symbol frequencies for the selected table.
+ --*/
+ if (nGroups == 6 && 50 == ge-gs+1) {
+ /*--- fast track the common case ---*/
+
+# define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++
+
+ BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4);
+ BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9);
+ BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14);
+ BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19);
+ BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24);
+ BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29);
+ BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34);
+ BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39);
+ BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44);
+ BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49);
+
+# undef BZ_ITUR
+
+ } else {
+ /*--- slow version which correctly handles all situations ---*/
+ for (i = gs; i <= ge; i++)
+ s->rfreq[bt][ mtfv[i] ]++;
+ }
+
+ gs = ge+1;
+ }
+ if (s->verbosity >= 3) {
+ VPrintf2 ( " pass %d: size is %d, grp uses are ",
+ iter+1, totc/8 );
+ for (t = 0; t < nGroups; t++)
+ VPrintf1 ( "%d ", fave[t] );
+ VPrintf0 ( "\n" );
+ }
+
+ /*--
+ Recompute the tables based on the accumulated frequencies.
+ --*/
+ for (t = 0; t < nGroups; t++)
+ BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
+ alphaSize, 20 );
+ }
+
+
+ AssertH( nGroups < 8, 3002 );
+ AssertH( nSelectors < 32768 &&
+ nSelectors <= (2 + (900000 / BZ_G_SIZE)),
+ 3003 );
+
+
+ /*--- Compute MTF values for the selectors. ---*/
+ {
+ UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp;
+ for (i = 0; i < nGroups; i++) pos[i] = i;
+ for (i = 0; i < nSelectors; i++) {
+ ll_i = s->selector[i];
+ j = 0;
+ tmp = pos[j];
+ while ( ll_i != tmp ) {
+ j++;
+ tmp2 = tmp;
+ tmp = pos[j];
+ pos[j] = tmp2;
+ };
+ pos[0] = tmp;
+ s->selectorMtf[i] = j;
+ }
+ };
+
+ /*--- Assign actual codes for the tables. --*/
+ for (t = 0; t < nGroups; t++) {
+ minLen = 32;
+ maxLen = 0;
+ for (i = 0; i < alphaSize; i++) {
+ if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
+ if (s->len[t][i] < minLen) minLen = s->len[t][i];
+ }
+ AssertH ( !(maxLen > 20), 3004 );
+ AssertH ( !(minLen < 1), 3005 );
+ BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
+ minLen, maxLen, alphaSize );
+ }
+
+ /*--- Transmit the mapping table. ---*/
+ {
+ Bool inUse16[16];
+ for (i = 0; i < 16; i++) {
+ inUse16[i] = False;
+ for (j = 0; j < 16; j++)
+ if (s->inUse[i * 16 + j]) inUse16[i] = True;
+ }
+
+ nBytes = s->numZ;
+ for (i = 0; i < 16; i++)
+ if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);
+
+ for (i = 0; i < 16; i++)
+ if (inUse16[i])
+ for (j = 0; j < 16; j++) {
+ if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);
+ }
+
+ if (s->verbosity >= 3)
+ VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes );
+ }
+
+ /*--- Now the selectors. ---*/
+ nBytes = s->numZ;
+ bsW ( s, 3, nGroups );
+ bsW ( s, 15, nSelectors );
+ for (i = 0; i < nSelectors; i++) {
+ for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);
+ bsW(s,1,0);
+ }
+ if (s->verbosity >= 3)
+ VPrintf1( "selectors %d, ", s->numZ-nBytes );
+
+ /*--- Now the coding tables. ---*/
+ nBytes = s->numZ;
+
+ for (t = 0; t < nGroups; t++) {
+ Int32 curr = s->len[t][0];
+ bsW ( s, 5, curr );
+ for (i = 0; i < alphaSize; i++) {
+ while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ };
+ while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ };
+ bsW ( s, 1, 0 );
+ }
+ }
+
+ if (s->verbosity >= 3)
+ VPrintf1 ( "code lengths %d, ", s->numZ-nBytes );
+
+ /*--- And finally, the block data proper ---*/
+ nBytes = s->numZ;
+ selCtr = 0;
+ gs = 0;
+ while (True) {
+ if (gs >= s->nMTF) break;
+ ge = gs + BZ_G_SIZE - 1;
+ if (ge >= s->nMTF) ge = s->nMTF-1;
+ AssertH ( s->selector[selCtr] < nGroups, 3006 );
+
+ if (nGroups == 6 && 50 == ge-gs+1) {
+ /*--- fast track the common case ---*/
+ UInt16 mtfv_i;
+ UChar* s_len_sel_selCtr
+ = &(s->len[s->selector[selCtr]][0]);
+ Int32* s_code_sel_selCtr
+ = &(s->code[s->selector[selCtr]][0]);
+
+# define BZ_ITAH(nn) \
+ mtfv_i = mtfv[gs+(nn)]; \
+ bsW ( s, \
+ s_len_sel_selCtr[mtfv_i], \
+ s_code_sel_selCtr[mtfv_i] )
+
+ BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4);
+ BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9);
+ BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14);
+ BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19);
+ BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24);
+ BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29);
+ BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34);
+ BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39);
+ BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44);
+ BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49);
+
+# undef BZ_ITAH
+
+ } else {
+ /*--- slow version which correctly handles all situations ---*/
+ for (i = gs; i <= ge; i++) {
+ bsW ( s,
+ s->len [s->selector[selCtr]] [mtfv[i]],
+ s->code [s->selector[selCtr]] [mtfv[i]] );
+ }
+ }
+
+
+ gs = ge+1;
+ selCtr++;
+ }
+ AssertH( selCtr == nSelectors, 3007 );
+
+ if (s->verbosity >= 3)
+ VPrintf1( "codes %d\n", s->numZ-nBytes );
+}
+
+
+/*---------------------------------------------------*/
+void BZ2_compressBlock ( EState* s, Bool is_last_block )
+{
+ if (s->nblock > 0) {
+
+ BZ_FINALISE_CRC ( s->blockCRC );
+ s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);
+ s->combinedCRC ^= s->blockCRC;
+ if (s->blockNo > 1) s->numZ = 0;
+
+ if (s->verbosity >= 2)
+ VPrintf4( " block %d: crc = 0x%8x, "
+ "combined CRC = 0x%8x, size = %d\n",
+ s->blockNo, s->blockCRC, s->combinedCRC, s->nblock );
+
+ BZ2_blockSort ( s );
+ }
+
+ s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]);
+
+ /*-- If this is the first block, create the stream header. --*/
+ if (s->blockNo == 1) {
+ BZ2_bsInitWrite ( s );
+ bsPutUChar ( s, 'B' );
+ bsPutUChar ( s, 'Z' );
+ bsPutUChar ( s, 'h' );
+ bsPutUChar ( s, (UChar)('0' + s->blockSize100k) );
+ }
+
+ if (s->nblock > 0) {
+
+ bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 );
+ bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 );
+ bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 );
+
+ /*-- Now the block's CRC, so it is in a known place. --*/
+ bsPutUInt32 ( s, s->blockCRC );
+
+ /*--
+ Now a single bit indicating (non-)randomisation.
+ As of version 0.9.5, we use a better sorting algorithm
+ which makes randomisation unnecessary. So always set
+ the randomised bit to 'no'. Of course, the decoder
+ still needs to be able to handle randomised blocks
+ so as to maintain backwards compatibility with
+ older versions of bzip2.
+ --*/
+ bsW(s,1,0);
+
+ bsW ( s, 24, s->origPtr );
+ generateMTFValues ( s );
+ sendMTFValues ( s );
+ }
+
+
+ /*-- If this is the last block, add the stream trailer. --*/
+ if (is_last_block) {
+
+ bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 );
+ bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 );
+ bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 );
+ bsPutUInt32 ( s, s->combinedCRC );
+ if (s->verbosity >= 2)
+ VPrintf1( " final combined CRC = 0x%x\n ", s->combinedCRC );
+ bsFinishWrite ( s );
+ }
+}
+
+
+/*-------------------------------------------------------------*/
+/*--- end compress.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/crctable.c b/setedit/libbzip2/crctable.c
new file mode 100644
index 0000000..61c040c
--- /dev/null
+++ b/setedit/libbzip2/crctable.c
@@ -0,0 +1,144 @@
+
+/*-------------------------------------------------------------*/
+/*--- Table for doing CRCs ---*/
+/*--- crctable.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#include "bzlib_private.h"
+
+/*--
+ I think this is an implementation of the AUTODIN-II,
+ Ethernet & FDDI 32-bit CRC standard. Vaguely derived
+ from code by Rob Warnock, in Section 51 of the
+ comp.compression FAQ.
+--*/
+
+UInt32 BZ2_crc32Table[256] = {
+
+ /*-- Ugly, innit? --*/
+
+ 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L,
+ 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L,
+ 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L,
+ 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL,
+ 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L,
+ 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L,
+ 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L,
+ 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL,
+ 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L,
+ 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L,
+ 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L,
+ 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL,
+ 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L,
+ 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L,
+ 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L,
+ 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL,
+ 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL,
+ 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L,
+ 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L,
+ 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL,
+ 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL,
+ 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L,
+ 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L,
+ 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL,
+ 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL,
+ 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L,
+ 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L,
+ 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL,
+ 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL,
+ 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L,
+ 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L,
+ 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL,
+ 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L,
+ 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL,
+ 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL,
+ 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L,
+ 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L,
+ 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL,
+ 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL,
+ 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L,
+ 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L,
+ 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL,
+ 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL,
+ 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L,
+ 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L,
+ 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL,
+ 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL,
+ 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L,
+ 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L,
+ 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL,
+ 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L,
+ 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L,
+ 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L,
+ 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL,
+ 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L,
+ 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L,
+ 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L,
+ 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL,
+ 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L,
+ 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L,
+ 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L,
+ 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL,
+ 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L,
+ 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L
+};
+
+
+/*-------------------------------------------------------------*/
+/*--- end crctable.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/decompress.c b/setedit/libbzip2/decompress.c
new file mode 100644
index 0000000..cdced18
--- /dev/null
+++ b/setedit/libbzip2/decompress.c
@@ -0,0 +1,660 @@
+
+/*-------------------------------------------------------------*/
+/*--- Decompression machinery ---*/
+/*--- decompress.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#include "bzlib_private.h"
+
+
+/*---------------------------------------------------*/
+static
+void makeMaps_d ( DState* s )
+{
+ Int32 i;
+ s->nInUse = 0;
+ for (i = 0; i < 256; i++)
+ if (s->inUse[i]) {
+ s->seqToUnseq[s->nInUse] = i;
+ s->nInUse++;
+ }
+}
+
+
+/*---------------------------------------------------*/
+#define RETURN(rrr) \
+ { retVal = rrr; goto save_state_and_return; };
+
+#define GET_BITS(lll,vvv,nnn) \
+ case lll: s->state = lll; \
+ while (True) { \
+ if (s->bsLive >= nnn) { \
+ UInt32 v; \
+ v = (s->bsBuff >> \
+ (s->bsLive-nnn)) & ((1 << nnn)-1); \
+ s->bsLive -= nnn; \
+ vvv = v; \
+ break; \
+ } \
+ if (s->strm->avail_in == 0) RETURN(BZ_OK); \
+ s->bsBuff \
+ = (s->bsBuff << 8) | \
+ ((UInt32) \
+ (*((UChar*)(s->strm->next_in)))); \
+ s->bsLive += 8; \
+ s->strm->next_in++; \
+ s->strm->avail_in--; \
+ s->strm->total_in_lo32++; \
+ if (s->strm->total_in_lo32 == 0) \
+ s->strm->total_in_hi32++; \
+ }
+
+#define GET_UCHAR(lll,uuu) \
+ GET_BITS(lll,uuu,8)
+
+#define GET_BIT(lll,uuu) \
+ GET_BITS(lll,uuu,1)
+
+/*---------------------------------------------------*/
+#define GET_MTF_VAL(label1,label2,lval) \
+{ \
+ if (groupPos == 0) { \
+ groupNo++; \
+ if (groupNo >= nSelectors) \
+ RETURN(BZ_DATA_ERROR); \
+ groupPos = BZ_G_SIZE; \
+ gSel = s->selector[groupNo]; \
+ gMinlen = s->minLens[gSel]; \
+ gLimit = &(s->limit[gSel][0]); \
+ gPerm = &(s->perm[gSel][0]); \
+ gBase = &(s->base[gSel][0]); \
+ } \
+ groupPos--; \
+ zn = gMinlen; \
+ GET_BITS(label1, zvec, zn); \
+ while (1) { \
+ if (zn > 20 /* the longest code */) \
+ RETURN(BZ_DATA_ERROR); \
+ if (zvec <= gLimit[zn]) break; \
+ zn++; \
+ GET_BIT(label2, zj); \
+ zvec = (zvec << 1) | zj; \
+ }; \
+ if (zvec - gBase[zn] < 0 \
+ || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \
+ RETURN(BZ_DATA_ERROR); \
+ lval = gPerm[zvec - gBase[zn]]; \
+}
+
+
+/*---------------------------------------------------*/
+Int32 BZ2_decompress ( DState* s )
+{
+ UChar uc;
+ Int32 retVal;
+ Int32 minLen, maxLen;
+ bz_stream* strm = s->strm;
+
+ /* stuff that needs to be saved/restored */
+ Int32 i;
+ Int32 j;
+ Int32 t;
+ Int32 alphaSize;
+ Int32 nGroups;
+ Int32 nSelectors;
+ Int32 EOB;
+ Int32 groupNo;
+ Int32 groupPos;
+ Int32 nextSym;
+ Int32 nblockMAX;
+ Int32 nblock;
+ Int32 es;
+ Int32 N;
+ Int32 curr;
+ Int32 zt;
+ Int32 zn;
+ Int32 zvec;
+ Int32 zj;
+ Int32 gSel;
+ Int32 gMinlen;
+ Int32* gLimit;
+ Int32* gBase;
+ Int32* gPerm;
+
+ if (s->state == BZ_X_MAGIC_1) {
+ /*initialise the save area*/
+ s->save_i = 0;
+ s->save_j = 0;
+ s->save_t = 0;
+ s->save_alphaSize = 0;
+ s->save_nGroups = 0;
+ s->save_nSelectors = 0;
+ s->save_EOB = 0;
+ s->save_groupNo = 0;
+ s->save_groupPos = 0;
+ s->save_nextSym = 0;
+ s->save_nblockMAX = 0;
+ s->save_nblock = 0;
+ s->save_es = 0;
+ s->save_N = 0;
+ s->save_curr = 0;
+ s->save_zt = 0;
+ s->save_zn = 0;
+ s->save_zvec = 0;
+ s->save_zj = 0;
+ s->save_gSel = 0;
+ s->save_gMinlen = 0;
+ s->save_gLimit = NULL;
+ s->save_gBase = NULL;
+ s->save_gPerm = NULL;
+ }
+
+ /*restore from the save area*/
+ i = s->save_i;
+ j = s->save_j;
+ t = s->save_t;
+ alphaSize = s->save_alphaSize;
+ nGroups = s->save_nGroups;
+ nSelectors = s->save_nSelectors;
+ EOB = s->save_EOB;
+ groupNo = s->save_groupNo;
+ groupPos = s->save_groupPos;
+ nextSym = s->save_nextSym;
+ nblockMAX = s->save_nblockMAX;
+ nblock = s->save_nblock;
+ es = s->save_es;
+ N = s->save_N;
+ curr = s->save_curr;
+ zt = s->save_zt;
+ zn = s->save_zn;
+ zvec = s->save_zvec;
+ zj = s->save_zj;
+ gSel = s->save_gSel;
+ gMinlen = s->save_gMinlen;
+ gLimit = s->save_gLimit;
+ gBase = s->save_gBase;
+ gPerm = s->save_gPerm;
+
+ retVal = BZ_OK;
+
+ switch (s->state) {
+
+ GET_UCHAR(BZ_X_MAGIC_1, uc);
+ if (uc != 'B') RETURN(BZ_DATA_ERROR_MAGIC);
+
+ GET_UCHAR(BZ_X_MAGIC_2, uc);
+ if (uc != 'Z') RETURN(BZ_DATA_ERROR_MAGIC);
+
+ GET_UCHAR(BZ_X_MAGIC_3, uc)
+ if (uc != 'h') RETURN(BZ_DATA_ERROR_MAGIC);
+
+ GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
+ if (s->blockSize100k < '1' ||
+ s->blockSize100k > '9') RETURN(BZ_DATA_ERROR_MAGIC);
+ s->blockSize100k -= '0';
+
+ if (s->smallDecompress) {
+ s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
+ s->ll4 = BZALLOC(
+ ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
+ );
+ if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
+ } else {
+ s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
+ if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
+ }
+
+ GET_UCHAR(BZ_X_BLKHDR_1, uc);
+
+ if (uc == 0x17) goto endhdr_2;
+ if (uc != 0x31) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_BLKHDR_2, uc);
+ if (uc != 0x41) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_BLKHDR_3, uc);
+ if (uc != 0x59) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_BLKHDR_4, uc);
+ if (uc != 0x26) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_BLKHDR_5, uc);
+ if (uc != 0x53) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_BLKHDR_6, uc);
+ if (uc != 0x59) RETURN(BZ_DATA_ERROR);
+
+ s->currBlockNo++;
+ if (s->verbosity >= 2)
+ VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo );
+
+ s->storedBlockCRC = 0;
+ GET_UCHAR(BZ_X_BCRC_1, uc);
+ s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
+ GET_UCHAR(BZ_X_BCRC_2, uc);
+ s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
+ GET_UCHAR(BZ_X_BCRC_3, uc);
+ s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
+ GET_UCHAR(BZ_X_BCRC_4, uc);
+ s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
+
+ GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1);
+
+ s->origPtr = 0;
+ GET_UCHAR(BZ_X_ORIGPTR_1, uc);
+ s->origPtr = (s->origPtr << 8) | ((Int32)uc);
+ GET_UCHAR(BZ_X_ORIGPTR_2, uc);
+ s->origPtr = (s->origPtr << 8) | ((Int32)uc);
+ GET_UCHAR(BZ_X_ORIGPTR_3, uc);
+ s->origPtr = (s->origPtr << 8) | ((Int32)uc);
+
+ if (s->origPtr < 0)
+ RETURN(BZ_DATA_ERROR);
+ if (s->origPtr > 10 + 100000*s->blockSize100k)
+ RETURN(BZ_DATA_ERROR);
+
+ /*--- Receive the mapping table ---*/
+ for (i = 0; i < 16; i++) {
+ GET_BIT(BZ_X_MAPPING_1, uc);
+ if (uc == 1)
+ s->inUse16[i] = True; else
+ s->inUse16[i] = False;
+ }
+
+ for (i = 0; i < 256; i++) s->inUse[i] = False;
+
+ for (i = 0; i < 16; i++)
+ if (s->inUse16[i])
+ for (j = 0; j < 16; j++) {
+ GET_BIT(BZ_X_MAPPING_2, uc);
+ if (uc == 1) s->inUse[i * 16 + j] = True;
+ }
+ makeMaps_d ( s );
+ if (s->nInUse == 0) RETURN(BZ_DATA_ERROR);
+ alphaSize = s->nInUse+2;
+
+ /*--- Now the selectors ---*/
+ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
+ if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
+ GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
+ if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
+ for (i = 0; i < nSelectors; i++) {
+ j = 0;
+ while (True) {
+ GET_BIT(BZ_X_SELECTOR_3, uc);
+ if (uc == 0) break;
+ j++;
+ if (j >= nGroups) RETURN(BZ_DATA_ERROR);
+ }
+ s->selectorMtf[i] = j;
+ }
+
+ /*--- Undo the MTF values for the selectors. ---*/
+ {
+ UChar pos[BZ_N_GROUPS], tmp, v;
+ for (v = 0; v < nGroups; v++) pos[v] = v;
+
+ for (i = 0; i < nSelectors; i++) {
+ v = s->selectorMtf[i];
+ tmp = pos[v];
+ while (v > 0) { pos[v] = pos[v-1]; v--; }
+ pos[0] = tmp;
+ s->selector[i] = tmp;
+ }
+ }
+
+ /*--- Now the coding tables ---*/
+ for (t = 0; t < nGroups; t++) {
+ GET_BITS(BZ_X_CODING_1, curr, 5);
+ for (i = 0; i < alphaSize; i++) {
+ while (True) {
+ if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR);
+ GET_BIT(BZ_X_CODING_2, uc);
+ if (uc == 0) break;
+ GET_BIT(BZ_X_CODING_3, uc);
+ if (uc == 0) curr++; else curr--;
+ }
+ s->len[t][i] = curr;
+ }
+ }
+
+ /*--- Create the Huffman decoding tables ---*/
+ for (t = 0; t < nGroups; t++) {
+ minLen = 32;
+ maxLen = 0;
+ for (i = 0; i < alphaSize; i++) {
+ if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
+ if (s->len[t][i] < minLen) minLen = s->len[t][i];
+ }
+ BZ2_hbCreateDecodeTables (
+ &(s->limit[t][0]),
+ &(s->base[t][0]),
+ &(s->perm[t][0]),
+ &(s->len[t][0]),
+ minLen, maxLen, alphaSize
+ );
+ s->minLens[t] = minLen;
+ }
+
+ /*--- Now the MTF values ---*/
+
+ EOB = s->nInUse+1;
+ nblockMAX = 100000 * s->blockSize100k;
+ groupNo = -1;
+ groupPos = 0;
+
+ for (i = 0; i <= 255; i++) s->unzftab[i] = 0;
+
+ /*-- MTF init --*/
+ {
+ Int32 ii, jj, kk;
+ kk = MTFA_SIZE-1;
+ for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) {
+ for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
+ s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj);
+ kk--;
+ }
+ s->mtfbase[ii] = kk + 1;
+ }
+ }
+ /*-- end MTF init --*/
+
+ nblock = 0;
+ GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);
+
+ while (True) {
+
+ if (nextSym == EOB) break;
+
+ if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) {
+
+ es = -1;
+ N = 1;
+ do {
+ if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
+ if (nextSym == BZ_RUNB) es = es + (1+1) * N;
+ N = N * 2;
+ GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);
+ }
+ while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);
+
+ es++;
+ uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ];
+ s->unzftab[uc] += es;
+
+ if (s->smallDecompress)
+ while (es > 0) {
+ if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
+ s->ll16[nblock] = (UInt16)uc;
+ nblock++;
+ es--;
+ }
+ else
+ while (es > 0) {
+ if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
+ s->tt[nblock] = (UInt32)uc;
+ nblock++;
+ es--;
+ };
+
+ continue;
+
+ } else {
+
+ if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
+
+ /*-- uc = MTF ( nextSym-1 ) --*/
+ {
+ Int32 ii, jj, kk, pp, lno, off;
+ UInt32 nn;
+ nn = (UInt32)(nextSym - 1);
+
+ if (nn < MTFL_SIZE) {
+ /* avoid general-case expense */
+ pp = s->mtfbase[0];
+ uc = s->mtfa[pp+nn];
+ while (nn > 3) {
+ Int32 z = pp+nn;
+ s->mtfa[(z) ] = s->mtfa[(z)-1];
+ s->mtfa[(z)-1] = s->mtfa[(z)-2];
+ s->mtfa[(z)-2] = s->mtfa[(z)-3];
+ s->mtfa[(z)-3] = s->mtfa[(z)-4];
+ nn -= 4;
+ }
+ while (nn > 0) {
+ s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
+ };
+ s->mtfa[pp] = uc;
+ } else {
+ /* general case */
+ lno = nn / MTFL_SIZE;
+ off = nn % MTFL_SIZE;
+ pp = s->mtfbase[lno] + off;
+ uc = s->mtfa[pp];
+ while (pp > s->mtfbase[lno]) {
+ s->mtfa[pp] = s->mtfa[pp-1]; pp--;
+ };
+ s->mtfbase[lno]++;
+ while (lno > 0) {
+ s->mtfbase[lno]--;
+ s->mtfa[s->mtfbase[lno]]
+ = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
+ lno--;
+ }
+ s->mtfbase[0]--;
+ s->mtfa[s->mtfbase[0]] = uc;
+ if (s->mtfbase[0] == 0) {
+ kk = MTFA_SIZE-1;
+ for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {
+ for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
+ s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];
+ kk--;
+ }
+ s->mtfbase[ii] = kk + 1;
+ }
+ }
+ }
+ }
+ /*-- end uc = MTF ( nextSym-1 ) --*/
+
+ s->unzftab[s->seqToUnseq[uc]]++;
+ if (s->smallDecompress)
+ s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else
+ s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]);
+ nblock++;
+
+ GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);
+ continue;
+ }
+ }
+
+ /* Now we know what nblock is, we can do a better sanity
+ check on s->origPtr.
+ */
+ if (s->origPtr < 0 || s->origPtr >= nblock)
+ RETURN(BZ_DATA_ERROR);
+
+ s->state_out_len = 0;
+ s->state_out_ch = 0;
+ BZ_INITIALISE_CRC ( s->calculatedBlockCRC );
+ s->state = BZ_X_OUTPUT;
+ if (s->verbosity >= 2) VPrintf0 ( "rt+rld" );
+
+ /*-- Set up cftab to facilitate generation of T^(-1) --*/
+ s->cftab[0] = 0;
+ for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
+ for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
+
+ if (s->smallDecompress) {
+
+ /*-- Make a copy of cftab, used in generation of T --*/
+ for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i];
+
+ /*-- compute the T vector --*/
+ for (i = 0; i < nblock; i++) {
+ uc = (UChar)(s->ll16[i]);
+ SET_LL(i, s->cftabCopy[uc]);
+ s->cftabCopy[uc]++;
+ }
+
+ /*-- Compute T^(-1) by pointer reversal on T --*/
+ i = s->origPtr;
+ j = GET_LL(i);
+ do {
+ Int32 tmp = GET_LL(j);
+ SET_LL(j, i);
+ i = j;
+ j = tmp;
+ }
+ while (i != s->origPtr);
+
+ s->tPos = s->origPtr;
+ s->nblock_used = 0;
+ if (s->blockRandomised) {
+ BZ_RAND_INIT_MASK;
+ BZ_GET_SMALL(s->k0); s->nblock_used++;
+ BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
+ } else {
+ BZ_GET_SMALL(s->k0); s->nblock_used++;
+ }
+
+ } else {
+
+ /*-- compute the T^(-1) vector --*/
+ for (i = 0; i < nblock; i++) {
+ uc = (UChar)(s->tt[i] & 0xff);
+ s->tt[s->cftab[uc]] |= (i << 8);
+ s->cftab[uc]++;
+ }
+
+ s->tPos = s->tt[s->origPtr] >> 8;
+ s->nblock_used = 0;
+ if (s->blockRandomised) {
+ BZ_RAND_INIT_MASK;
+ BZ_GET_FAST(s->k0); s->nblock_used++;
+ BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
+ } else {
+ BZ_GET_FAST(s->k0); s->nblock_used++;
+ }
+
+ }
+
+ RETURN(BZ_OK);
+
+
+
+ endhdr_2:
+
+ GET_UCHAR(BZ_X_ENDHDR_2, uc);
+ if (uc != 0x72) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_ENDHDR_3, uc);
+ if (uc != 0x45) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_ENDHDR_4, uc);
+ if (uc != 0x38) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_ENDHDR_5, uc);
+ if (uc != 0x50) RETURN(BZ_DATA_ERROR);
+ GET_UCHAR(BZ_X_ENDHDR_6, uc);
+ if (uc != 0x90) RETURN(BZ_DATA_ERROR);
+
+ s->storedCombinedCRC = 0;
+ GET_UCHAR(BZ_X_CCRC_1, uc);
+ s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
+ GET_UCHAR(BZ_X_CCRC_2, uc);
+ s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
+ GET_UCHAR(BZ_X_CCRC_3, uc);
+ s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
+ GET_UCHAR(BZ_X_CCRC_4, uc);
+ s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
+
+ s->state = BZ_X_IDLE;
+ RETURN(BZ_STREAM_END);
+
+ default: AssertH ( False, 4001 );
+ }
+
+ AssertH ( False, 4002 );
+
+ save_state_and_return:
+
+ s->save_i = i;
+ s->save_j = j;
+ s->save_t = t;
+ s->save_alphaSize = alphaSize;
+ s->save_nGroups = nGroups;
+ s->save_nSelectors = nSelectors;
+ s->save_EOB = EOB;
+ s->save_groupNo = groupNo;
+ s->save_groupPos = groupPos;
+ s->save_nextSym = nextSym;
+ s->save_nblockMAX = nblockMAX;
+ s->save_nblock = nblock;
+ s->save_es = es;
+ s->save_N = N;
+ s->save_curr = curr;
+ s->save_zt = zt;
+ s->save_zn = zn;
+ s->save_zvec = zvec;
+ s->save_zj = zj;
+ s->save_gSel = gSel;
+ s->save_gMinlen = gMinlen;
+ s->save_gLimit = gLimit;
+ s->save_gBase = gBase;
+ s->save_gPerm = gPerm;
+
+ return retVal;
+}
+
+
+/*-------------------------------------------------------------*/
+/*--- end decompress.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/gnumake.in b/setedit/libbzip2/gnumake.in
new file mode 100644
index 0000000..184efa4
--- /dev/null
+++ b/setedit/libbzip2/gnumake.in
@@ -0,0 +1,103 @@
+#!/usr/bin/make
+CC=@CC@
+AR=@AR@
+CFLAGS=@XCFLAGS@
+
+OBJS= blocksort.o \
+ huffman.o \
+ crctable.o \
+ randtable.o \
+ compress.o \
+ decompress.o \
+ bzlib.o
+
+all: libbz2.a bzip2 bzip2recover test
+
+bzip2: libbz2.a bzip2.o
+ $(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
+
+bzip2recover: bzip2recover.o
+ $(CC) $(CFLAGS) -o bzip2recover bzip2recover.o
+
+libbz2.a: $(OBJS)
+ rm -f libbz2.a
+ $(AR) cq libbz2.a $(OBJS)
+ @if ( test -f /usr/bin/ranlib -o -f /bin/ranlib -o \
+ -f /usr/ccs/bin/ranlib ) ; then \
+ echo ranlib libbz2.a ; \
+ ranlib libbz2.a ; \
+ fi
+
+test: bzip2
+ @cat words1
+ ./bzip2 -1 < sample1.ref > sample1.rb2
+ ./bzip2 -2 < sample2.ref > sample2.rb2
+ ./bzip2 -3 < sample3.ref > sample3.rb2
+ ./bzip2 -d < sample1.bz2 > sample1.tst
+ ./bzip2 -d < sample2.bz2 > sample2.tst
+ ./bzip2 -ds < sample3.bz2 > sample3.tst
+ cmp sample1.bz2 sample1.rb2
+ cmp sample2.bz2 sample2.rb2
+ cmp sample3.bz2 sample3.rb2
+ cmp sample1.tst sample1.ref
+ cmp sample2.tst sample2.ref
+ cmp sample3.tst sample3.ref
+ @cat words3
+
+PREFIX=/usr
+
+install: bzip2 bzip2recover
+ if ( test ! -d $(PREFIX)/bin ) ; then mkdir $(PREFIX)/bin ; fi
+ if ( test ! -d $(PREFIX)/lib ) ; then mkdir $(PREFIX)/lib ; fi
+ if ( test ! -d $(PREFIX)/man ) ; then mkdir $(PREFIX)/man ; fi
+ if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir $(PREFIX)/man/man1 ; fi
+ if ( test ! -d $(PREFIX)/include ) ; then mkdir $(PREFIX)/include ; fi
+ cp -f bzip2 $(PREFIX)/bin/bzip2
+ cp -f bzip2 $(PREFIX)/bin/bunzip2
+ cp -f bzip2 $(PREFIX)/bin/bzcat
+ cp -f bzip2recover $(PREFIX)/bin/bzip2recover
+ chmod a+x $(PREFIX)/bin/bzip2
+ chmod a+x $(PREFIX)/bin/bunzip2
+ chmod a+x $(PREFIX)/bin/bzcat
+ chmod a+x $(PREFIX)/bin/bzip2recover
+ cp -f bzip2.1 $(PREFIX)/man/man1
+ chmod a+r $(PREFIX)/man/man1/bzip2.1
+ cp -f bzlib.h $(PREFIX)/include
+ chmod a+r $(PREFIX)/include/bzlib.h
+ cp -f libbz2.a $(PREFIX)/lib
+ chmod a+r $(PREFIX)/lib/libbz2.a
+
+clean:
+ rm -f *.o libbz2.a bzip2 bzip2recover \
+ sample1.rb2 sample2.rb2 sample3.rb2 \
+ sample1.tst sample2.tst sample3.tst
+
+blocksort.o: blocksort.c
+ $(CC) $(CFLAGS) -c blocksort.c
+huffman.o: huffman.c
+ $(CC) $(CFLAGS) -c huffman.c
+crctable.o: crctable.c
+ $(CC) $(CFLAGS) -c crctable.c
+randtable.o: randtable.c
+ $(CC) $(CFLAGS) -c randtable.c
+compress.o: compress.c
+ $(CC) $(CFLAGS) -c compress.c
+decompress.o: decompress.c
+ $(CC) $(CFLAGS) -c decompress.c
+bzlib.o: bzlib.c
+ $(CC) $(CFLAGS) -c bzlib.c
+bzip2.o: bzip2.c
+ $(CC) $(CFLAGS) -c bzip2.c
+bzip2recover.o: bzip2recover.c
+ $(CC) $(CFLAGS) -c bzip2recover.c
+
+tarfile:
+ tar cvf interim.tar blocksort.c huffman.c crctable.c \
+ randtable.c compress.c decompress.c bzlib.c bzip2.c \
+ bzip2recover.c bzlib.h bzlib_private.h Makefile manual.texi \
+ manual.ps LICENSE bzip2.1 bzip2.1.preformatted bzip2.txt \
+ words1 words2 words3 sample1.ref sample2.ref sample3.ref \
+ sample1.bz2 sample2.bz2 sample3.bz2 dlltest.c \
+ *.html README CHANGES libbz2.def libbz2.dsp \
+ dlltest.dsp makefile.msc Y2K_INFO
+
diff --git a/setedit/libbzip2/huffman.c b/setedit/libbzip2/huffman.c
new file mode 100644
index 0000000..9b446c4
--- /dev/null
+++ b/setedit/libbzip2/huffman.c
@@ -0,0 +1,228 @@
+
+/*-------------------------------------------------------------*/
+/*--- Huffman coding low-level stuff ---*/
+/*--- huffman.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#include "bzlib_private.h"
+
+/*---------------------------------------------------*/
+#define WEIGHTOF(zz0) ((zz0) & 0xffffff00)
+#define DEPTHOF(zz1) ((zz1) & 0x000000ff)
+#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3))
+
+#define ADDWEIGHTS(zw1,zw2) \
+ (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \
+ (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2)))
+
+#define UPHEAP(z) \
+{ \
+ Int32 zz, tmp; \
+ zz = z; tmp = heap[zz]; \
+ while (weight[tmp] < weight[heap[zz >> 1]]) { \
+ heap[zz] = heap[zz >> 1]; \
+ zz >>= 1; \
+ } \
+ heap[zz] = tmp; \
+}
+
+#define DOWNHEAP(z) \
+{ \
+ Int32 zz, yy, tmp; \
+ zz = z; tmp = heap[zz]; \
+ while (True) { \
+ yy = zz << 1; \
+ if (yy > nHeap) break; \
+ if (yy < nHeap && \
+ weight[heap[yy+1]] < weight[heap[yy]]) \
+ yy++; \
+ if (weight[tmp] < weight[heap[yy]]) break; \
+ heap[zz] = heap[yy]; \
+ zz = yy; \
+ } \
+ heap[zz] = tmp; \
+}
+
+
+/*---------------------------------------------------*/
+void BZ2_hbMakeCodeLengths ( UChar *len,
+ Int32 *freq,
+ Int32 alphaSize,
+ Int32 maxLen )
+{
+ /*--
+ Nodes and heap entries run from 1. Entry 0
+ for both the heap and nodes is a sentinel.
+ --*/
+ Int32 nNodes, nHeap, n1, n2, i, j, k;
+ Bool tooLong;
+
+ Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ];
+ Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ];
+ Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ];
+
+ for (i = 0; i < alphaSize; i++)
+ weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
+
+ while (True) {
+
+ nNodes = alphaSize;
+ nHeap = 0;
+
+ heap[0] = 0;
+ weight[0] = 0;
+ parent[0] = -2;
+
+ for (i = 1; i <= alphaSize; i++) {
+ parent[i] = -1;
+ nHeap++;
+ heap[nHeap] = i;
+ UPHEAP(nHeap);
+ }
+
+ AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
+
+ while (nHeap > 1) {
+ n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
+ n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
+ nNodes++;
+ parent[n1] = parent[n2] = nNodes;
+ weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]);
+ parent[nNodes] = -1;
+ nHeap++;
+ heap[nHeap] = nNodes;
+ UPHEAP(nHeap);
+ }
+
+ AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 );
+
+ tooLong = False;
+ for (i = 1; i <= alphaSize; i++) {
+ j = 0;
+ k = i;
+ while (parent[k] >= 0) { k = parent[k]; j++; }
+ len[i-1] = j;
+ if (j > maxLen) tooLong = True;
+ }
+
+ if (! tooLong) break;
+
+ for (i = 1; i < alphaSize; i++) {
+ j = weight[i] >> 8;
+ j = 1 + (j / 2);
+ weight[i] = j << 8;
+ }
+ }
+}
+
+
+/*---------------------------------------------------*/
+void BZ2_hbAssignCodes ( Int32 *code,
+ UChar *length,
+ Int32 minLen,
+ Int32 maxLen,
+ Int32 alphaSize )
+{
+ Int32 n, vec, i;
+
+ vec = 0;
+ for (n = minLen; n <= maxLen; n++) {
+ for (i = 0; i < alphaSize; i++)
+ if (length[i] == n) { code[i] = vec; vec++; };
+ vec <<= 1;
+ }
+}
+
+
+/*---------------------------------------------------*/
+void BZ2_hbCreateDecodeTables ( Int32 *limit,
+ Int32 *base,
+ Int32 *perm,
+ UChar *length,
+ Int32 minLen,
+ Int32 maxLen,
+ Int32 alphaSize )
+{
+ Int32 pp, i, j, vec;
+
+ pp = 0;
+ for (i = minLen; i <= maxLen; i++)
+ for (j = 0; j < alphaSize; j++)
+ if (length[j] == i) { perm[pp] = j; pp++; };
+
+ for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0;
+ for (i = 0; i < alphaSize; i++) base[length[i]+1]++;
+
+ for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];
+
+ for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0;
+ vec = 0;
+
+ for (i = minLen; i <= maxLen; i++) {
+ vec += (base[i+1] - base[i]);
+ limit[i] = vec-1;
+ vec <<= 1;
+ }
+ for (i = minLen + 1; i <= maxLen; i++)
+ base[i] = ((limit[i-1] + 1) << 1) - base[i];
+}
+
+
+/*-------------------------------------------------------------*/
+/*--- end huffman.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/license b/setedit/libbzip2/license
new file mode 100644
index 0000000..88fa6d8
--- /dev/null
+++ b/setedit/libbzip2/license
@@ -0,0 +1,39 @@
+
+This program, "bzip2" and associated library "libbzip2", are
+copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, Cambridge, UK.
+jseward@acm.org
+bzip2/libbzip2 version 1.0 of 21 March 2000
+
diff --git a/setedit/libbzip2/randtable.c b/setedit/libbzip2/randtable.c
new file mode 100644
index 0000000..983089d
--- /dev/null
+++ b/setedit/libbzip2/randtable.c
@@ -0,0 +1,124 @@
+
+/*-------------------------------------------------------------*/
+/*--- Table for randomising repetitive blocks ---*/
+/*--- randtable.c ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#include "bzlib_private.h"
+
+
+/*---------------------------------------------*/
+Int32 BZ2_rNums[512] = {
+ 619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
+ 985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
+ 733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
+ 419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
+ 878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
+ 862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
+ 150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
+ 170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
+ 73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
+ 909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
+ 641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
+ 161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
+ 382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
+ 98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
+ 227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
+ 469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
+ 184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
+ 715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
+ 951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
+ 652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
+ 645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
+ 609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
+ 653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
+ 411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
+ 170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
+ 857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
+ 669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
+ 944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
+ 344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
+ 897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
+ 433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
+ 686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
+ 946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
+ 978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
+ 680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
+ 707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
+ 297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
+ 134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
+ 343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
+ 140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
+ 170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
+ 369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
+ 804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
+ 896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
+ 661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
+ 768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
+ 61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
+ 372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
+ 780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
+ 920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
+ 645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
+ 936, 638
+};
+
+
+/*-------------------------------------------------------------*/
+/*--- end randtable.c ---*/
+/*-------------------------------------------------------------*/
diff --git a/setedit/libbzip2/readme b/setedit/libbzip2/readme
new file mode 100644
index 0000000..22945a2
--- /dev/null
+++ b/setedit/libbzip2/readme
@@ -0,0 +1,166 @@
+
+This is the README for bzip2, a block-sorting file compressor, version
+1.0. This version is fully compatible with the previous public
+releases, bzip2-0.1pl2, bzip2-0.9.0 and bzip2-0.9.5.
+
+bzip2-1.0 is distributed under a BSD-style license. For details,
+see the file LICENSE.
+
+Complete documentation is available in Postscript form (manual.ps) or
+html (manual_toc.html). A plain-text version of the manual page is
+available as bzip2.txt. A statement about Y2K issues is now included
+in the file Y2K_INFO.
+
+
+HOW TO BUILD -- UNIX
+
+Type `make'. This builds the library libbz2.a and then the
+programs bzip2 and bzip2recover. Six self-tests are run.
+If the self-tests complete ok, carry on to installation:
+
+To install in /usr/bin, /usr/lib, /usr/man and /usr/include, type
+ make install
+To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
+ make install PREFIX=/xxx/yyy
+If you are (justifiably) paranoid and want to see what 'make install'
+is going to do, you can first do
+ make -n install or
+ make -n install PREFIX=/xxx/yyy respectively.
+The -n instructs make to show the commands it would execute, but
+not actually execute them.
+
+
+HOW TO BUILD -- UNIX, shared library libbz2.so.
+
+Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for
+Linux-ELF (RedHat 5.2 on an x86 box), with gcc. I make no claims
+that it works for any other platform, though I suspect it probably
+will work for most platforms employing both ELF and gcc.
+
+bzip2-shared, a client of the shared library, is also build, but
+not self-tested. So I suggest you also build using the normal
+Makefile, since that conducts a self-test.
+
+Important note for people upgrading .so's from 0.9.0/0.9.5 to
+version 1.0. All the functions in the library have been renamed,
+from (eg) bzCompress to BZ2_bzCompress, to avoid namespace pollution.
+Unfortunately this means that the libbz2.so created by
+Makefile-libbz2_so will not work with any program which used an
+older version of the library. Sorry. I do encourage library
+clients to make the effort to upgrade to use version 1.0, since
+it is both faster and more robust than previous versions.
+
+
+HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
+
+It's difficult for me to support compilation on all these platforms.
+My approach is to collect binaries for these platforms, and put them
+on the master web page (http://sourceware.cygnus.com/bzip2). Look
+there. However (FWIW), bzip2-1.0 is very standard ANSI C and should
+compile unmodified with MS Visual C. For Win32, there is one
+important caveat: in bzip2.c, you must set BZ_UNIX to 0 and
+BZ_LCCWIN32 to 1 before building. If you have difficulties building,
+you might want to read README.COMPILATION.PROBLEMS.
+
+
+VALIDATION
+
+Correct operation, in the sense that a compressed file can always be
+decompressed to reproduce the original, is obviously of paramount
+importance. To validate bzip2, I used a modified version of Mark
+Nelson's churn program. Churn is an automated test driver which
+recursively traverses a directory structure, using bzip2 to compress
+and then decompress each file it encounters, and checking that the
+decompressed data is the same as the original. There are more details
+in Section 4 of the user guide.
+
+
+
+Please read and be aware of the following:
+
+WARNING:
+
+ This program (attempts to) compress data by performing several
+ non-trivial transformations on it. Unless you are 100% familiar
+ with *all* the algorithms contained herein, and with the
+ consequences of modifying them, you should NOT meddle with the
+ compression or decompression machinery. Incorrect changes can and
+ very likely *will* lead to disastrous loss of data.
+
+
+DISCLAIMER:
+
+ I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
+ USE OF THIS PROGRAM, HOWSOEVER CAUSED.
+
+ Every compression of a file implies an assumption that the
+ compressed file can be decompressed to reproduce the original.
+ Great efforts in design, coding and testing have been made to
+ ensure that this program works correctly. However, the complexity
+ of the algorithms, and, in particular, the presence of various
+ special cases in the code which occur with very low but non-zero
+ probability make it impossible to rule out the possibility of bugs
+ remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS
+ PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
+ SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
+
+ That is not to say this program is inherently unreliable. Indeed,
+ I very much hope the opposite is true. bzip2 has been carefully
+ constructed and extensively tested.
+
+
+PATENTS:
+
+ To the best of my knowledge, bzip2 does not use any patented
+ algorithms. However, I do not have the resources available to
+ carry out a full patent search. Therefore I cannot give any
+ guarantee of the above statement.
+
+End of legalities.
+
+
+WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ?
+
+ * Approx 10% faster compression, 30% faster decompression
+ * -t (test mode) is a lot quicker
+ * Can decompress concatenated compressed files
+ * Programming interface, so programs can directly read/write .bz2 files
+ * Less restrictive (BSD-style) licensing
+ * Flag handling more compatible with GNU gzip
+ * Much more documentation, i.e., a proper user manual
+ * Hopefully, improved portability (at least of the library)
+
+WHAT'S NEW IN 0.9.5 ?
+
+ * Compression speed is much less sensitive to the input
+ data than in previous versions. Specifically, the very
+ slow performance caused by repetitive data is fixed.
+ * Many small improvements in file and flag handling.
+ * A Y2K statement.
+
+WHAT'S NEW IN 1.0
+
+ See the CHANGES file.
+
+I hope you find bzip2 useful. Feel free to contact me at
+ jseward@acm.org
+if you have any suggestions or queries. Many people mailed me with
+comments, suggestions and patches after the releases of bzip-0.15,
+bzip-0.21, bzip2-0.1pl2 and bzip2-0.9.0, and the changes in bzip2 are
+largely a result of this feedback. I thank you for your comments.
+
+At least for the time being, bzip2's "home" is (or can be reached via)
+http://www.muraroa.demon.co.uk.
+
+Julian Seward
+jseward@acm.org
+
+Cambridge, UK
+18 July 1996 (version 0.15)
+25 August 1996 (version 0.21)
+ 7 August 1997 (bzip2, version 0.1)
+29 August 1997 (bzip2, version 0.1pl2)
+23 August 1998 (bzip2, version 0.9.0)
+ 8 June 1999 (bzip2, version 0.9.5)
+ 4 Sept 1999 (bzip2, version 0.9.5d)
+ 5 May 2000 (bzip2, version 1.0pre8)
diff --git a/setedit/libmigdb/DJGPP.why b/setedit/libmigdb/DJGPP.why
new file mode 100644
index 0000000..4f3cbda
--- /dev/null
+++ b/setedit/libmigdb/DJGPP.why
@@ -0,0 +1,101 @@
+DJGPP Problems and why it isn't currently supported:
+
+ Traditionaly djgpp never used gdb frontends. The reason is not so obvious.
+The main problem is that DOS isn't a multitasking OS. So you can't open a
+pipe to a child a process and multitask. The pipe command exists but you are
+blocked until the child finishes.
+For this reason there is no gdb frontend for djgpp. Instead djgpp users use
+full debuggers with a frontend included. That's the case of RHIDE (in this
+particular case gdb is inside RHIDE).
+ But most people using djgpp uses a multitasking OS, at least for development.
+The most common setup is Windows. Additionally you could use two DOS boxes
+and get real-hardware-multitask ;-)
+ The two possible setups are:
+
+1) Windows (win32): The frontend communicates with gdb using some IPC
+mechanism. The frontend uses the "start" (or similar) command to call gdb and
+then sends/receives the commands/responses using the IPC mechanism.
+Here Windows does the multitasking.
+That's completly transparent in most cases because the frontend starts gdb
+indicating which file to debug and the same front end controls gdb (including
+the end of sesssion).
+
+2) Two DOS boxes: The user must run gdb in one of the boxes indicating to
+connect to the other using some networking protocol. On the other side the
+frontend is started and waits for a incoming connection.
+This is a little bit more complicated because:
+a) The user must setup a network.
+b) The user must start things manually.
+
+ But there are some problems that doesn't allow it:
+
+GDB side:
+
+ GDB remote debugging isn't like this. It was designed for remote debug
+using multitasking systems and not things like DOS. When you use the remote
+debugging you run "gdbserver" on the "target" end and "gdb" on the local side
+(host). But then you are again in the same situation, you can't control gdb
+using pipes or similar mechanisms.
+
+ The solution for this is to tell gdb "Hey! use IPC for your command loop".
+But the problem is that gdb is a mess. It have a very nice abstraction for
+I/O implemented like classes (see ui-file.c). So you have gdb_stdout and
+gdb_stdin structures. But not all the code uses it, in fact the "readline"
+part (gdb prompt and input) bypass it.
+
+ To solve this you have to redirect at low level. Something like:
+
+a) Open a socket.
+b) dup2 stdin/stdout
+
+ This is the easy part because you have to avoid this redirection in the
+child or the output of the debuggy will also go throu the IPC channel. But I
+think it isn't that hard because gdb switches the stdout/in attributes when
+running the child process, so I think it is possible to also dup2 to the old
+handles while the child is running.
+
+ In any case all of this means changes in gdb.
+
+
+
+DJGPP side:
+
+ The "open socket and dup2" above mentioned mechanism works for POSIX systems
+like Linux (I tested it and worked, I was able to control gdb using TCP/IP
+sockets). But djgpp isn't POSIX.
+
+ DJGPP have a nice mechanism to for "File System Extensions", but when I
+tried it I found that dup2 doesn't work for extensions. I'm not sure if it
+can be done with some hack or if the last version of djgpp version solves
+this problem.
+
+ It most probably means that djgpp have to be modified. May be I'm wrong.
+
+
+
+IPC what?
+
+ Inter-Process Communication is quite simple on POSIX systems but for djgpp
+... Well, you can use a networking protocol, but again isn't that simple.
+ For TCP/IP you have:
+
+a) libsocket, it looks like it doesn't work very well with VSOCK 2. I tried
+it on Windows 98 SE and it failed.
+b) Watt-32, it needs a special NDIS driver for Windows.
+
+ Another option could be using mslot library. It seems to work (at least for
+Windows). It uses the "Mail Slot" mechanism. One problem I found in this
+library is that it implements the "read" FSEXT in a "non-blocking" way and
+doesn't honor the O_NONBLOCKING flag. The changes to fix it are really
+simple. According to mslot docs they are available for plain DOS.
+
+
+Conclusion:
+
+ It looks like is possible to achieve the above mentioned setups. But changes
+have to be made to gdb, djgpp and existing IPC libraries.
+ The gdb part seems to be the most complex and harder to be introduced in
+main gdb.
+
+
+SET
diff --git a/setedit/libmigdb/GPL-license b/setedit/libmigdb/GPL-license
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/setedit/libmigdb/GPL-license
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 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
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/setedit/libmigdb/Makefile b/setedit/libmigdb/Makefile
new file mode 100644
index 0000000..f873b16
--- /dev/null
+++ b/setedit/libmigdb/Makefile
@@ -0,0 +1,15 @@
+#!/usr/bin/make
+
+.PHONY: libmigdb
+
+all: libmigdb
+
+libmigdb:
+ $(MAKE) -C src
+
+clean:
+ $(MAKE) -C src clean
+
+install:
+ $(MAKE) -C src install
+
diff --git a/setedit/libmigdb/README b/setedit/libmigdb/README
new file mode 100644
index 0000000..0f61c6f
--- /dev/null
+++ b/setedit/libmigdb/README
@@ -0,0 +1,124 @@
+Introduction:
+------------
+
+This library is an attempt to support the GDB/MI interface. MI stands for
+machine interface. In this mode gdb sends responses that are "machine
+readable" instead of "human readable"
+
+Objetive:
+--------
+
+To implement a C and C++ interface to talk with gdb using it.
+
+Advantages:
+----------
+
+* The responses should be i18n independent and with less problems to be parsed.
+* New versions shouldn't break the parser.
+
+Disadvantages:
+-------------
+
+* The responses are quite complex.
+* The responses can't be easily read by a human.
+
+Motivation:
+----------
+
+To add remote debugging to SETEdit. RHIDE lacks it.
+
+Currently supported platcforms:
+------------------------------
+
+Currently we support:
+
+* Linux console
+* Linux X11
+
+The code should be usable by other systems that provides POSIX API and where
+gdb is available.
+
+How to compile and install:
+--------------------------
+
+Change to the "src" directory and run "make". Change to root and run "make
+install".
+The "Makefile" could need changes. The PREFIX is /usr you most probably will
+want to change it to /usr/local.
+
+How to run examples:
+-------------------
+
+Switch to the "examples" directory and run "make". Read the comments at the
+beggining of the examples.
+They show how to use the library for different targets.
+
+* linux_test: Linux console. Shows how to set breakpoints and watchpoints.
+* remote_test: Remote debugging using TCP/IP connection. Shows breakpoints.
+* x11_cpp_test: Shows how to use the C++ wrapper. The examples is for X11.
+* x11_fr_test: Linux X11. Shows how to use "frames" and "variable objects".
+* x11_test: Linux X11. Shows how to set breakpoints and watchpoints.
+* x11_wp_test: Linux X11. Shows how to set watchpoints.
+
+Function reference and help:
+---------------------------
+
+An incomplete reference can be found in the "doc" directory. I suggest
+looking at the examples with the reference at hand.
+
+
+Author:
+------
+
+Salvador E. Tropea
+Email: user: set, server: users.sf.net
+
+ Telephone: (+5411) 4759-0013
+ Postal Address:
+ Salvador E. Tropea
+ Curapaligue 2124
+ (1678) Caseros - 3 de Febrero
+ Prov: Buenos Aires
+ Argentina
+
+-----------------------------------------------------------------------------
+
+Random notes:
+------------
+
+Debug strategies:
+
+1) Remote using TCP/IP: This methode is quite limited. One amazing thing I
+noticed is that you can't set watchpoints. Other important differences are
+that the remote target starts "running", it means you have to use continue
+instead of run and it also means that command line arguments must be provided
+at the remote end.
+The way that's implemented you need a full gdb on the local end. That's ok
+when you want to release the remote end from some of the heavy tasks (like
+loading all the debug info), but doesn't help if what you want is just
+control gdb from a remote machine sending the commands throu TCP/IP. The last
+could allow debugging DOS applications under Windows exploting the Windows
+multitasking.
+
+2) Local under X: We start an xterm child that runs:
+
+<--- /tmp/xxxxxx.sh
+tty > /tmp/yyyyyy
+sleep 100d
+<---
+
+That's "xterm -e /bin/sh /tmp/xxxxxx.sh &"
+Then we read /tmp/yyyyyy file to know the ttyname, delete both files and
+tell gdb to use this terminal.
+This is implemented by: gmi_start_xterm()
+
+3) Local for Linux console: We can open a new terminal (as X and Allegro
+does with tty8 and higher).
+This is implemented by: gmi_look_for_free_vt()
+
+4) Local for Linux console, same terminal: We tell gdb to use the current
+terminal, but before sending an async command we so Suspend and when we get
+an async response "stopped" we Resume. This is less functional and more
+complex.
+
+
diff --git a/setedit/libmigdb/change.log b/setedit/libmigdb/change.log
new file mode 100644
index 0000000..2e770d9
--- /dev/null
+++ b/setedit/libmigdb/change.log
@@ -0,0 +1,182 @@
+$Log: change.log,v $
+Revision 1.33 2005/09/26 18:38:35 set
+* Fixed: Apple seem to have changed the output type for stack frames to be
+a tuple of tuples rather than a list of tuples. Patch from Greg.
+.
+Revision 1.32 2005/06/03 13:03:19 set
+* Fixed: Breakpoint parser filled the "type" field instead of the "disp"
+field. Patch by Max Kovalenko (madmax/botik/ru).
+* Modified: Version to 0.8.10.
+
+Revision 1.31 2005/05/13 19:29:54 set
+* Fixed: pty_test.c to also exit when read returns 0 (Linux case). Patch
+from Greg.
+
+Revision 1.30 2005/05/12 20:23:02 set
+* Modified: Regenerated the docs to include the new documentation about
+ptys. Also changed the docs to name version 0.8.9.
+
+Revision 1.29 2005/05/12 20:18:56 set
+* Applied patches from Greg Watson (gwatson/lanl/gov):
+ * Removes apple code from src/get_free_vt.c
+ * Adds a new file src/get_free_pty.c This is a new functionality to
+ communicate with the debuggie using a pseudo terminal.
+ * Adds new mi_pty structure to src/mi_gdb.h
+ * Modifies src/Makefile to build get_free_pty.o
+ * Adds new file examples/pty_test.c
+ * Modifies examples/Makefile to build pty_test
+
+Revision 1.28 2005/04/29 20:11:13 set
+* Applied patches from Greg Watson (gwatson/lanl/gov):
+ * Add pty support for Darwin, including extending the mi_aux_term
+ structure to include a file descriptor for the master side of the pty.
+ This allows the code to prevent a race condition between checking for a
+ free pty and opening it.
+ * Rename mi_get_sttoped() to mi_get_stopped() and expose the interface
+ in mi_gdb.h.
+ * Added new gmi_exec_next_cnt() and gmi_exec_stop_cnt() commands.
+ * Add support for the broken Darwin version of gdb (tuples can contain
+ values as well as results).
+ * Fix the 'signal-name' and 'signal-meaning' variable names (were
+ 'signal_name' and 'signal_meaning').
+ * Allow a 'count' argument to be supplied to mi_exec_step() and
+ mi_exec_next().
+
+Revision 1.27 2004/12/06 15:51:04 set
+* Fixed: Compilations problems for SuSE 5.2. Reported by J.B. Lethbridge.
+
+Revision 1.26 2004/10/19 16:21:40 set
+* Fixed: FinishFun member must set the state to running if the command
+succeed.
+
+Revision 1.25 2004/10/18 19:39:17 set
+* Modified: Version to 0.8.7.
+
+Revision 1.24 2004/10/18 19:35:40 set
+* Fixed: Various examples to compile with current code.
+* Fixed: Some missing headers. Needed to compile on BSD systems.
+
+Revision 1.23 2004/10/15 23:50:37 set
+* Added: [Cygwin] Some minimal support. Now when the target is selected we
+tell gdb to use a new window. It seems to work but the new window have some
+serious problems.
+
+Revision 1.22 2004/09/16 23:18:26 set
+* Modified: To compile with Cygwin. It doesn't mean it works, just
+compiles.
+
+Revision 1.21 2004/09/10 19:10:20 set
+* Added: A top level makefile, is just a wrapper for the src/Makefile.
+* Modified: Version to 0.8.6.
+
+Revision 1.20 2004/09/08 18:09:46 set
+* Added: C++ member to find and cache the architecture. Currently supported
+architectures are IA32 (x86) and SPARC. They are the only archs I have at
+hand.
+
+Revision 1.19 2004/09/07 19:56:28 set
+* Fixed: Lack of error report when we failed to create the temporal files
+to spawn an X terminal.
+* Fixed: Now we test if the X terminal and gdb binary are there and report
+proper errors if they are missing.
+
+Revision 1.18 2004/09/06 17:13:11 set
+* Added: Functions to workaround another bug in gdb. I reported it and it
+was named "mi/1770". Affects gdb 6.x.
+
+Revision 1.17 2004/08/25 20:49:52 set
+* Modified: mi_error reset to MI_OK when connecting.
+* Modified: MIDebugger::TargetUnselect() to detach only if remote/pid is
+stopped.
+* Added: execute until address is reached (we had file:line only).
+
+Revision 1.16 2004/08/24 21:10:21 set
+* Modified: PID targets starts stopped.
+* Fixed: When debugging an attached process if gdb dies we failed to go to
+disconnected.
+
+Revision 1.15 2004/08/23 23:45:23 set
+* Added: Mechanism to disable psym workarounds. The mechanism allows to
+enable/disable workarounds in a simple and compatible way.
+* Added: Mechanism to force MI version.
+* Added: Enabled a couple of MI v2 things when the version is forced to 2+.
+* Added: BreakAfter(mi_bkpt *b) C++ wrapper.
+
+Revision 1.14 2004/08/17 20:40:11 set
+* Added: Disassembler functionality.
+
+Revision 1.13 2004/08/13 20:36:08 set
+* Modified: The mechanism to set gdb and xterm binaries. Now you can get
+the actual default (it searches in PATH) and set a new value that's copied.
+* Added: Functions to set the "main" function.
+* Added: Time out callback to catch time-outs in gdb response.
+* Added: Mechanism to detect gdb died and go to disconnected state. We
+already found an operation that makes gdb die.
+
+Revision 1.12 2004/08/12 21:21:43 set
+* Added: Command to get info about the threads. It uses a partially
+implemented gdb functionality.
+
+Revision 1.11 2004/08/09 12:58:23 set
+* Updated: version and reference to release 0.8.3.
+
+Revision 1.10 2004/08/08 23:07:00 set
+* Added: A function to know the endian of the target.
+* Added: A workaround to another bug in gdb: responses like the endian and
+architecture are sent to the console and not to the result record. So now
+the -gdb-show command traps the console (a copy) and if the RR have no info
+and we got something in the console that's returned.
+
+Revision 1.9 2004/08/06 20:59:44 set
+* Fixed: The gdb dialog was amazingly slow. It was just the fact that I
+trusted in the non-blocking flag and sleep, but this annoys the scheduler
+and the solution is to just use select, which is the Right Thing To Do (TM)
+;-)
+* Modified: MIDebugger::EvalExpression now takes a const char * and cleans
+the error number before executing.
+* Added: Some very restricted function to read memory content.
+
+Revision 1.8 2004/08/04 20:07:31 set
+* Modified: The mi_gvar structure to be able to hold a tree of variables.
+* Fixed: mi_error_from_gdb not released at exit.
+* Fixed: leak in Kill()
+* Fixed/Added: Various details of the GNU vars code.
+
+Revision 1.7 2004/08/01 00:16:13 set
+* Added: More fields to the mi_wp structure, useful for the frontend.
+* Fixed: Watchpoint expressions must be enclosed using "" to avoid
+problems.
+* Fixed: wp_mode name to mi_wp_mode.
+* Added: int MIDebugger::WatchDelete(mi_wp *w).
+* Fixed: sr_wp_scope doesn't report a full wp, just the number.
+
+Revision 1.6 2004/07/30 21:17:08 set
+* Added: More workarounds to gdb bugs. I fille the cli/1725, gdb/1726 and
+gdb/1727 bug reports. I hope they get fixed :-(
+
+Revision 1.5 2004/07/28 21:09:40 set
+* Fixed: Some mess in the bkpts structure. The "times" field is how many
+times we hit a breakpoint, just information. The real value is "ignore".
+* Fixed: Missing parse of the "cond" field for breakpoints.
+* Added: A C++ function to set a breakpoint from a mi_bkpt structure. It
+supports the four modes to specify a location.
+
+Revision 1.4 2004/07/25 22:58:07 set
+* Added: More fields to the mi_bkpt structure.
+
+Revision 1.3 2004/07/21 19:43:39 set
+* Added: A workaround to a bug in gdb: the two stages load of symtabs
+(using partial ones) is not reliable (fails to find the symtab in some
+cases). So now we force the load with "readnow".
+* Fixed: Lack of string.h in examples/target_frames.cc. Reported by Thiago.
+
+Revision 1.2 2004/07/20 23:42:56 set
+* Fixed: directory in compressed sources.
+
+Revision 1.1 2004/07/20 20:38:42 set
+* Added: C++ wrapper to attach to a running process. Also modified the low
+level function to return the current frame.
+* Modified: Now if we get an error while the state is running we assume the
+previous "running" was wrong and we are in fact stopped. Until now I saw
+two cases where gdb says we are running and then shows an error.
+
diff --git a/setedit/libmigdb/compress.sh b/setedit/libmigdb/compress.sh
new file mode 100755
index 0000000..d7bc8d1
--- /dev/null
+++ b/setedit/libmigdb/compress.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd ..
+tar jcvf libmigdb-0.8.10.tar.bz2 `cat libmigdb/files`
diff --git a/setedit/libmigdb/doc/html.frt b/setedit/libmigdb/doc/html.frt
new file mode 100644
index 0000000..92082d3
--- /dev/null
+++ b/setedit/libmigdb/doc/html.frt
@@ -0,0 +1,282 @@
+#
+# This file sets the behavior of the txh generator
+#
+# Lines starting with # or spaces are skiped except in strings or in [Generate]
+# Be carefull with [ it delimits sections!
+#
+
+[Configuration]
+#
+# No external program is needed!
+# @.html means: Copy the temporal file to xxxxx.html
+#
+CommandLine=@.html
+Name="Direct HTML 3.X format"
+
+[Delimiters]
+# Up to 11 characters
+SectionStart=/**[txh]**
+# Up to 11 characters
+SectionEnd=*********/
+
+[Variables]
+#
+# Up to 16 definitions
+#
+# Codes for the behavior of the definitions:
+# 1 Normal, put the content if found.
+# 2 Repeat, use the last value found in the file, ~no is an exeption, ~clear stops
+# 3 If not found replace by the prototype.
+# 4 If not found replace by the class.
+# 5 If not found replace by the name of the function
+# 6 It disables the node generation for this comment. The variable is
+# stored in the first variable that have associations and is in the comment.
+#
+# Additionally there are 2 special variables:
+# 90 Name of the file
+# 91 Line number of the end of the comment
+# 92 Name of the var 0 in the format: ~0 ~~Distinguish{(~Distinguish)~} (node name)
+#
+# 0 The first variable is the main index variable
+#
+AddDefinition=Function,5
+# 1
+AddDefinition=Class,4
+# 2
+AddDefinition=Include,2
+# 3
+AddDefinition=Module,2
+# 4
+AddDefinition=Prototype,3
+# 5
+AddDefinition=Description,1
+# 6
+AddDefinition=Return,1
+# 7
+AddDefinition=Example,1
+# 8
+AddDefinition=Comments,6
+# 9
+AddDefinition=Command,1
+#
+# It says what variable is added to distinguish between 2 vars 0 that are equal
+#
+Distinguish=1
+
+[Associations]
+#
+# Up to 8 associations
+#
+# The associations are between the 0 variable and another variable.
+#
+# Name in main menu, node, variable, optional to add to each node
+#
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+AddAssoc=List by GDB/MI command,Command,9
+
+[Replace]
+#
+# All must be delimited by ", they can be used in the GenMain section
+#
+# Title of the HTML
+Constant="GDB/MI library"
+
+# Description for the help
+Constant="This document describes the functions of libmigdb library
+@p
+This document applies to version 0.8.10 of the GDB/Machine interface
+library.
+@p
+Most of the C++ interface is fully documented. But not all the C
+interface is docummented.
+@p
+The name of the high level C functions are derived from the corresponding
+GDB/MI command. For this reason I recommend using the chapter 'GDB/MI' of
+gdb documentation as main reference. As an example: The gdb command
+'-thread-list-ids' is implemented in the gmi_thread_list_ids function. This
+function uses the lowlevel function mi_thread_list_ids.
+@p
+The mi_gdb.h header contains a lot of comments about what does each
+function. And the examples show how to them together.
+@p
+"
+
+[Commands]
+#
+# You can enclose these values between " to make more clear where
+# they start and end. Use \n,\r,\t and \" like in C. Use \ at the
+# end to concatenate like in C.
+#
+# @p = end of paragraph
+#
+EndOfPar="<p>"
+#
+# @* = break line
+#
+BreakLine="<br>"
+#
+# @{value} is the special cross ref.
+# ~0 Is the visible name of a reference
+# ~1 Is the real name of a reference
+#
+CrossRef="<a href=\"#~1\">~0</a>"
+#
+# What we must get from a @@ sequence
+#
+Double@="@"
+
+[DefinedCommands]
+#
+# The format is @<name>{parameters ...}
+#
+subtitle="<Font Size=+1><u>~0</u></Font><p>"
+pre=<pre>
+/pre=</pre>
+link="<a href=\"~0\">~1</a>"
+mailto="<a href=\"mailto:~0\">~1</a>"
+
+#
+# This section says how to translate ASCIIs
+#
+[ASCIIConvert]
+=&aacute;
+=&eacute;
+=&iacute;
+=&oacute;
+=&uacute;
+=&ntilde;
+=&Ntilde;
+=&iexcl;
+=&iquest;
+=&auml;
+=&euml;
+=&iuml;
+=&ouml;
+=&uuml;
+=&Uuml;
+=&agrave;
+=&egrave;
+=&igrave;
+=&ograve;
+=&ugrave;
+<=&lt;
+>=&gt;
+
+#
+# Use ~number to use one variable
+# Use ~~number{} for conditional, all the code inside {} will become
+# conditional
+# This section isn't passed for the macro expansion so here you are
+# free to use special commands for the formater.
+#
+[GenNode]
+<p><hr></p>
+<a name="~92"></a>
+<center><Font Size=+2>~0</Font> (~90 ~91)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+~~2{
+<pre>
+# This line is a comment, but the next is code
+ #include &lt;~2&gt;
+</pre>
+~}
+~~4{
+<pre>
+ ~4;
+</pre>
+~}
+~~1{
+<Font Size=+1><u>Member of the class:</u></Font>
+~1
+<p>
+~}
+
+~~5{
+<Font Size=+1><u>Description</u></Font><p>
+
+~5
+<p>
+~}
+~~6{
+<Font Size=+1><u>Return Value</u></Font><p>
+
+~6
+<p>
+~}
+~~7{
+<Font Size=+1><u>Example</u></Font><p>
+
+~7
+<p>
+~}
+
+[GenMenu]
+Start="<Menu>"
+#
+# ~1 is the visible name
+# ~2 is the name of the node
+#
+Entry="<li><a href=\"#~2\">~1</a>"
+End="</Menu>"
+
+#
+# ~1 is the name of the association
+# ~2 is the menu for it
+#
+[GenAssoMain]
+<p><hr></p>
+<a name="~1"></a>
+<H1>~1</H1>
+
+~2
+#
+# ~1 is the name of the association
+# ~2 is the name without the distinguish
+# ~3 is the comment for it
+# ~4 is the menu for it
+#
+[GenAssoRest]
+<p><hr></p>
+<a name="~1"></a>
+<H1>~2</H1>
+
+~3
+
+~4
+
+#
+# ~1 Main menu
+# ~2 Name of the function list node
+# ~3 Menu for all the functions
+# ~4 All the associations code
+# ~5 All the function nodes
+# ~50+ Values from section Replace
+#
+[GenMain]
+<html>
+<head>
+<title>~50</title>
+</head>
+<body>
+<H1>~50</H1>
+
+~51
+
+~1
+
+<p><hr></p>
+<a name="~2"></a>
+<H1>~2</H1>
+
+~3
+
+~4
+
+~5
+
+</body>
+</html>
diff --git a/setedit/libmigdb/doc/reference.html b/setedit/libmigdb/doc/reference.html
new file mode 100644
index 0000000..453f0ad
--- /dev/null
+++ b/setedit/libmigdb/doc/reference.html
@@ -0,0 +1,5072 @@
+<html>
+<head>
+<title>GDB/MI library</title>
+</head>
+<body>
+<H1>GDB/MI library</H1>
+
+This document describes the functions of libmigdb library
+
+<p>
+
+This document applies to version 0.8.10 of the GDB/Machine interface
+library.
+
+<p>
+
+Most of the C++ interface is fully documented. But not all the C
+interface is docummented.
+
+<p>
+
+The name of the high level C functions are derived from the corresponding
+GDB/MI command. For this reason I recommend using the chapter 'GDB/MI' of
+gdb documentation as main reference. As an example: The gdb command
+'-thread-list-ids' is implemented in the gmi_thread_list_ids function. This
+function uses the lowlevel function mi_thread_list_ids.
+
+<p>
+
+The mi_gdb.h header contains a lot of comments about what does each
+function. And the examples show how to them together.
+
+<p>
+
+
+
+<Menu>
+<li><a href="#Alphabetical List">Alphabetical list of functions</a>
+<li><a href="#Classes">List by classes</a>
+<li><a href="#Modules">List by modules</a>
+<li><a href="#Files">List by files</a>
+<li><a href="#Command">List by GDB/MI command</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Alphabetical List"></a>
+<H1>Alphabetical List</H1>
+
+<Menu>
+<li><a href="#BreakDelete (MIDebugger)">BreakDelete (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger)">Breakpoint (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger) <1>">Breakpoint (MIDebugger) <1></a>
+<li><a href="#BreakpointFull (MIDebugger)">BreakpointFull (MIDebugger)</a>
+<li><a href="#CallStack (MIDebugger)">CallStack (MIDebugger)</a>
+<li><a href="#Connect (MIDebugger)">Connect (MIDebugger)</a>
+<li><a href="#Continue (MIDebugger)">Continue (MIDebugger)</a>
+<li><a href="#Disconnect (MIDebugger)">Disconnect (MIDebugger)</a>
+<li><a href="#EvalExpression (MIDebugger)">EvalExpression (MIDebugger)</a>
+<li><a href="#FillTypeVal (MIDebugger)">FillTypeVal (MIDebugger)</a>
+<li><a href="#FinishFun (MIDebugger)">FinishFun (MIDebugger)</a>
+<li><a href="#gmi_break_delete">gmi_break_delete</a>
+<li><a href="#gmi_break_insert">gmi_break_insert</a>
+<li><a href="#gmi_break_insert_full">gmi_break_insert_full</a>
+<li><a href="#gmi_break_insert_full_fl">gmi_break_insert_full_fl</a>
+<li><a href="#gmi_break_set_condition">gmi_break_set_condition</a>
+<li><a href="#gmi_break_set_times">gmi_break_set_times</a>
+<li><a href="#gmi_break_state">gmi_break_state</a>
+<li><a href="#gmi_break_watch">gmi_break_watch</a>
+<li><a href="#gmi_data_evaluate_expression">gmi_data_evaluate_expression</a>
+<li><a href="#gmi_dir">gmi_dir</a>
+<li><a href="#gmi_end_aux_term">gmi_end_aux_term</a>
+<li><a href="#gmi_end_pty">gmi_end_pty</a>
+<li><a href="#gmi_exec_continue">gmi_exec_continue</a>
+<li><a href="#gmi_exec_finish">gmi_exec_finish</a>
+<li><a href="#gmi_exec_interrupt">gmi_exec_interrupt</a>
+<li><a href="#gmi_exec_kill">gmi_exec_kill</a>
+<li><a href="#gmi_exec_next">gmi_exec_next</a>
+<li><a href="#gmi_exec_next_cnt">gmi_exec_next_cnt</a>
+<li><a href="#gmi_exec_next_instruction">gmi_exec_next_instruction</a>
+<li><a href="#gmi_exec_return">gmi_exec_return</a>
+<li><a href="#gmi_exec_run">gmi_exec_run</a>
+<li><a href="#gmi_exec_step">gmi_exec_step</a>
+<li><a href="#gmi_exec_step_cnt">gmi_exec_step_cnt</a>
+<li><a href="#gmi_exec_step_instruction">gmi_exec_step_instruction</a>
+<li><a href="#gmi_exec_until">gmi_exec_until</a>
+<li><a href="#gmi_exec_until_addr">gmi_exec_until_addr</a>
+<li><a href="#gmi_file_symbol_file">gmi_file_symbol_file</a>
+<li><a href="#gmi_full_var_create">gmi_full_var_create</a>
+<li><a href="#gmi_gdb_exit">gmi_gdb_exit</a>
+<li><a href="#gmi_gdb_set">gmi_gdb_set</a>
+<li><a href="#gmi_gdb_show">gmi_gdb_show</a>
+<li><a href="#gmi_gdb_version">gmi_gdb_version</a>
+<li><a href="#gmi_look_for_free_pty">gmi_look_for_free_pty</a>
+<li><a href="#gmi_look_for_free_vt">gmi_look_for_free_vt</a>
+<li><a href="#gmi_set_exec">gmi_set_exec</a>
+<li><a href="#gmi_stack_info_depth">gmi_stack_info_depth</a>
+<li><a href="#gmi_stack_info_depth_get">gmi_stack_info_depth_get</a>
+<li><a href="#gmi_stack_info_frame">gmi_stack_info_frame</a>
+<li><a href="#gmi_stack_list_arguments">gmi_stack_list_arguments</a>
+<li><a href="#gmi_stack_list_arguments_r">gmi_stack_list_arguments_r</a>
+<li><a href="#gmi_stack_list_frames">gmi_stack_list_frames</a>
+<li><a href="#gmi_stack_list_frames_r">gmi_stack_list_frames_r</a>
+<li><a href="#gmi_stack_list_locals">gmi_stack_list_locals</a>
+<li><a href="#gmi_stack_select_frame">gmi_stack_select_frame</a>
+<li><a href="#gmi_start_xterm">gmi_start_xterm</a>
+<li><a href="#gmi_target_attach">gmi_target_attach</a>
+<li><a href="#gmi_target_detach">gmi_target_detach</a>
+<li><a href="#gmi_target_select">gmi_target_select</a>
+<li><a href="#gmi_target_terminal">gmi_target_terminal</a>
+<li><a href="#gmi_thread_list_all_threads">gmi_thread_list_all_threads</a>
+<li><a href="#gmi_thread_list_ids">gmi_thread_list_ids</a>
+<li><a href="#gmi_thread_select">gmi_thread_select</a>
+<li><a href="#gmi_var_assign">gmi_var_assign</a>
+<li><a href="#gmi_var_create">gmi_var_create</a>
+<li><a href="#gmi_var_create_nm">gmi_var_create_nm</a>
+<li><a href="#gmi_var_delete">gmi_var_delete</a>
+<li><a href="#gmi_var_evaluate_expression">gmi_var_evaluate_expression</a>
+<li><a href="#gmi_var_info_expression">gmi_var_info_expression</a>
+<li><a href="#gmi_var_info_num_children">gmi_var_info_num_children</a>
+<li><a href="#gmi_var_info_type">gmi_var_info_type</a>
+<li><a href="#gmi_var_list_children">gmi_var_list_children</a>
+<li><a href="#gmi_var_set_format">gmi_var_set_format</a>
+<li><a href="#gmi_var_show_attributes">gmi_var_show_attributes</a>
+<li><a href="#gmi_var_show_format">gmi_var_show_format</a>
+<li><a href="#gmi_var_update">gmi_var_update</a>
+<li><a href="#GoTo (MIDebugger)">GoTo (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger) <1>">GoTo (MIDebugger) <1></a>
+<li><a href="#Kill (MIDebugger)">Kill (MIDebugger)</a>
+<li><a href="#mi_connect_local">mi_connect_local</a>
+<li><a href="#mi_disconnect">mi_disconnect</a>
+<li><a href="#mi_force_version">mi_force_version</a>
+<li><a href="#mi_get_error_str">mi_get_error_str</a>
+<li><a href="#mi_get_workaround">mi_get_workaround</a>
+<li><a href="#mi_look_for_free_pty">mi_look_for_free_pty</a>
+<li><a href="#mi_look_for_free_vt">mi_look_for_free_vt</a>
+<li><a href="#mi_set_workaround">mi_set_workaround</a>
+<li><a href="#MIDebugger (MIDebugger)">MIDebugger (MIDebugger)</a>
+<li><a href="#ModifyExpression (MIDebugger)">ModifyExpression (MIDebugger)</a>
+<li><a href="#Poll (MIDebugger)">Poll (MIDebugger)</a>
+<li><a href="#ReturnNow (MIDebugger)">ReturnNow (MIDebugger)</a>
+<li><a href="#Run (MIDebugger)">Run (MIDebugger)</a>
+<li><a href="#RunOrContinue (MIDebugger)">RunOrContinue (MIDebugger)</a>
+<li><a href="#RunToMain (MIDebugger)">RunToMain (MIDebugger)</a>
+<li><a href="#SelectTargetLinux (MIDebugger)">SelectTargetLinux (MIDebugger)</a>
+<li><a href="#SelectTargetPID (MIDebugger)">SelectTargetPID (MIDebugger)</a>
+<li><a href="#SelectTargetRemote (MIDebugger)">SelectTargetRemote (MIDebugger)</a>
+<li><a href="#SelectTargetTTY (MIDebugger)">SelectTargetTTY (MIDebugger)</a>
+<li><a href="#SelectTargetX11 (MIDebugger)">SelectTargetX11 (MIDebugger)</a>
+<li><a href="#Send (MIDebugger)">Send (MIDebugger)</a>
+<li><a href="#StepOver (MIDebugger)">StepOver (MIDebugger)</a>
+<li><a href="#Stop (MIDebugger)">Stop (MIDebugger)</a>
+<li><a href="#TargetUnselect (MIDebugger)">TargetUnselect (MIDebugger)</a>
+<li><a href="#TraceInto (MIDebugger)">TraceInto (MIDebugger)</a>
+<li><a href="#WatchDelete (MIDebugger)">WatchDelete (MIDebugger)</a>
+<li><a href="#Watchpoint (MIDebugger)">Watchpoint (MIDebugger)</a>
+<li><a href="#~MIDebugger (MIDebugger)">~MIDebugger (MIDebugger)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Classes"></a>
+<H1>Classes</H1>
+
+<Menu>
+<li><a href="#MIDebugger (class)">MIDebugger</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="MIDebugger (class)"></a>
+<H1>MIDebugger</H1>
+
+
+
+<Menu>
+<li><a href="#BreakDelete (MIDebugger)">BreakDelete (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger)">Breakpoint (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger) <1>">Breakpoint (MIDebugger) <1></a>
+<li><a href="#BreakpointFull (MIDebugger)">BreakpointFull (MIDebugger)</a>
+<li><a href="#CallStack (MIDebugger)">CallStack (MIDebugger)</a>
+<li><a href="#Connect (MIDebugger)">Connect (MIDebugger)</a>
+<li><a href="#Continue (MIDebugger)">Continue (MIDebugger)</a>
+<li><a href="#Disconnect (MIDebugger)">Disconnect (MIDebugger)</a>
+<li><a href="#EvalExpression (MIDebugger)">EvalExpression (MIDebugger)</a>
+<li><a href="#FillTypeVal (MIDebugger)">FillTypeVal (MIDebugger)</a>
+<li><a href="#FinishFun (MIDebugger)">FinishFun (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger)">GoTo (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger) <1>">GoTo (MIDebugger) <1></a>
+<li><a href="#Kill (MIDebugger)">Kill (MIDebugger)</a>
+<li><a href="#MIDebugger (MIDebugger)">MIDebugger (MIDebugger)</a>
+<li><a href="#ModifyExpression (MIDebugger)">ModifyExpression (MIDebugger)</a>
+<li><a href="#Poll (MIDebugger)">Poll (MIDebugger)</a>
+<li><a href="#ReturnNow (MIDebugger)">ReturnNow (MIDebugger)</a>
+<li><a href="#Run (MIDebugger)">Run (MIDebugger)</a>
+<li><a href="#RunOrContinue (MIDebugger)">RunOrContinue (MIDebugger)</a>
+<li><a href="#RunToMain (MIDebugger)">RunToMain (MIDebugger)</a>
+<li><a href="#SelectTargetLinux (MIDebugger)">SelectTargetLinux (MIDebugger)</a>
+<li><a href="#SelectTargetPID (MIDebugger)">SelectTargetPID (MIDebugger)</a>
+<li><a href="#SelectTargetRemote (MIDebugger)">SelectTargetRemote (MIDebugger)</a>
+<li><a href="#SelectTargetTTY (MIDebugger)">SelectTargetTTY (MIDebugger)</a>
+<li><a href="#SelectTargetX11 (MIDebugger)">SelectTargetX11 (MIDebugger)</a>
+<li><a href="#Send (MIDebugger)">Send (MIDebugger)</a>
+<li><a href="#StepOver (MIDebugger)">StepOver (MIDebugger)</a>
+<li><a href="#Stop (MIDebugger)">Stop (MIDebugger)</a>
+<li><a href="#TargetUnselect (MIDebugger)">TargetUnselect (MIDebugger)</a>
+<li><a href="#TraceInto (MIDebugger)">TraceInto (MIDebugger)</a>
+<li><a href="#WatchDelete (MIDebugger)">WatchDelete (MIDebugger)</a>
+<li><a href="#Watchpoint (MIDebugger)">Watchpoint (MIDebugger)</a>
+<li><a href="#~MIDebugger (MIDebugger)">~MIDebugger (MIDebugger)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Modules"></a>
+<H1>Modules</H1>
+
+<Menu>
+<li><a href="#Allocator.">Allocator.</a>
+<li><a href="#Breakpoint table commands.">Breakpoint table commands.</a>
+<li><a href="#C++ Interface.">C++ Interface.</a>
+<li><a href="#Connect.">Connect.</a>
+<li><a href="#Data manipulation.">Data manipulation.</a>
+<li><a href="#Error.
+ Comment:
+ Translates error numbers into messages.">Error.
+ Comment:
+ Translates error numbers into messages.</a>
+<li><a href="#Linux VT.">Linux VT.</a>
+<li><a href="#Miscellaneous commands.">Miscellaneous commands.</a>
+<li><a href="#Parser.">Parser.</a>
+<li><a href="#Program control.">Program control.</a>
+<li><a href="#pseudo terminal">pseudo terminal</a>
+<li><a href="#Stack manipulation.">Stack manipulation.</a>
+<li><a href="#Symbol query.">Symbol query.</a>
+<li><a href="#Target manipulation.">Target manipulation.</a>
+<li><a href="#Thread commands.">Thread commands.</a>
+<li><a href="#Variable objects.">Variable objects.</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="Allocator."></a>
+<H1>Allocator.</H1>
+
+Most alloc/free routines are here. Free routines must accept NULL
+pointers. Alloc functions must set mi_error.
+<p>
+
+
+<Menu>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Breakpoint table commands."></a>
+<H1>Breakpoint table commands.</H1>
+
+GDB/MI commands for the "Breakpoint Table Commands" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+
+-break-after Yes
+-break-condition Yes
+-break-delete Yes
+-break-disable Yes
+-break-enable Yes
+-break-info N.A. (info break NUMBER) (*)
+-break-insert Yes
+-break-list No (*)
+-break-watch Yes
+</pre>
+
+(*) I think the program should keep track of the breakpoints, so it will
+be implemented when I have more time.
+<p>
+
+
+<Menu>
+<li><a href="#gmi_break_delete">gmi_break_delete</a>
+<li><a href="#gmi_break_insert">gmi_break_insert</a>
+<li><a href="#gmi_break_insert_full">gmi_break_insert_full</a>
+<li><a href="#gmi_break_insert_full_fl">gmi_break_insert_full_fl</a>
+<li><a href="#gmi_break_set_condition">gmi_break_set_condition</a>
+<li><a href="#gmi_break_set_times">gmi_break_set_times</a>
+<li><a href="#gmi_break_state">gmi_break_state</a>
+<li><a href="#gmi_break_watch">gmi_break_watch</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="C++ Interface."></a>
+<H1>C++ Interface.</H1>
+
+Implements a very simple (naive ;-) C++ wrapper.
+<p>
+
+
+<Menu>
+<li><a href="#BreakDelete (MIDebugger)">BreakDelete (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger)">Breakpoint (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger) <1>">Breakpoint (MIDebugger) <1></a>
+<li><a href="#BreakpointFull (MIDebugger)">BreakpointFull (MIDebugger)</a>
+<li><a href="#CallStack (MIDebugger)">CallStack (MIDebugger)</a>
+<li><a href="#Connect (MIDebugger)">Connect (MIDebugger)</a>
+<li><a href="#Continue (MIDebugger)">Continue (MIDebugger)</a>
+<li><a href="#Disconnect (MIDebugger)">Disconnect (MIDebugger)</a>
+<li><a href="#EvalExpression (MIDebugger)">EvalExpression (MIDebugger)</a>
+<li><a href="#FillTypeVal (MIDebugger)">FillTypeVal (MIDebugger)</a>
+<li><a href="#FinishFun (MIDebugger)">FinishFun (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger)">GoTo (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger) <1>">GoTo (MIDebugger) <1></a>
+<li><a href="#Kill (MIDebugger)">Kill (MIDebugger)</a>
+<li><a href="#MIDebugger (MIDebugger)">MIDebugger (MIDebugger)</a>
+<li><a href="#ModifyExpression (MIDebugger)">ModifyExpression (MIDebugger)</a>
+<li><a href="#Poll (MIDebugger)">Poll (MIDebugger)</a>
+<li><a href="#ReturnNow (MIDebugger)">ReturnNow (MIDebugger)</a>
+<li><a href="#Run (MIDebugger)">Run (MIDebugger)</a>
+<li><a href="#RunOrContinue (MIDebugger)">RunOrContinue (MIDebugger)</a>
+<li><a href="#RunToMain (MIDebugger)">RunToMain (MIDebugger)</a>
+<li><a href="#SelectTargetLinux (MIDebugger)">SelectTargetLinux (MIDebugger)</a>
+<li><a href="#SelectTargetPID (MIDebugger)">SelectTargetPID (MIDebugger)</a>
+<li><a href="#SelectTargetRemote (MIDebugger)">SelectTargetRemote (MIDebugger)</a>
+<li><a href="#SelectTargetTTY (MIDebugger)">SelectTargetTTY (MIDebugger)</a>
+<li><a href="#SelectTargetX11 (MIDebugger)">SelectTargetX11 (MIDebugger)</a>
+<li><a href="#Send (MIDebugger)">Send (MIDebugger)</a>
+<li><a href="#StepOver (MIDebugger)">StepOver (MIDebugger)</a>
+<li><a href="#Stop (MIDebugger)">Stop (MIDebugger)</a>
+<li><a href="#TargetUnselect (MIDebugger)">TargetUnselect (MIDebugger)</a>
+<li><a href="#TraceInto (MIDebugger)">TraceInto (MIDebugger)</a>
+<li><a href="#WatchDelete (MIDebugger)">WatchDelete (MIDebugger)</a>
+<li><a href="#Watchpoint (MIDebugger)">Watchpoint (MIDebugger)</a>
+<li><a href="#~MIDebugger (MIDebugger)">~MIDebugger (MIDebugger)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Connect."></a>
+<H1>Connect.</H1>
+
+This module handles the dialog with gdb, including starting and stopping
+gdb.
+<p>
+
+
+GDB Bug workaround for "file -readnow": I tried to workaround a bug using
+it but looks like this option also have bugs!!!! so I have to use the
+command line option --readnow.
+It also have a bug!!!! when the binary is changed and gdb must reload it
+this option is ignored. So it looks like we have no solution but 3 gdb bugs
+in a row.
+
+<Menu>
+<li><a href="#gmi_end_aux_term">gmi_end_aux_term</a>
+<li><a href="#gmi_start_xterm">gmi_start_xterm</a>
+<li><a href="#mi_connect_local">mi_connect_local</a>
+<li><a href="#mi_disconnect">mi_disconnect</a>
+<li><a href="#mi_force_version">mi_force_version</a>
+<li><a href="#mi_get_workaround">mi_get_workaround</a>
+<li><a href="#mi_set_workaround">mi_set_workaround</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Data manipulation."></a>
+<H1>Data manipulation.</H1>
+
+GDB/MI commands for the "Data manipulation" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+
+-data-disassemble Yes
+-data-evaluate-expression Yes
+-data-list-changed-registers No
+-data-list-register-names Yes
+-data-list-register-values No
+-data-read-memory No
+-display-delete N.A. (delete display)
+-display-disable N.A. (disable display)
+-display-enable N.A. (enable display)
+-display-insert N.A. (display)
+-display-list N.A. (info display)
+-environment-cd No
+-environment-directory Yes, MI v1 implementation
+-environment-path No
+</pre>
+
+Notes:
+<p>
+
+
+1) -display* aren't implemented. You can use CLI command display, but the
+results are sent to the console. So it looks like the best is to manually
+use -data-evaluate-expression to emulate it.
+<p>
+
+
+2) GDB bug mi/1770: Affects gdb&lt;=6.2, when you ask for the names of the
+registers you get it plus the name of the "pseudo-registers", but if you
+try to get the value of a pseudo-register you get an error saying the
+register number is invalid. I reported to gdb-patches@sources.redhat.com
+on 2004/08/25 and as I didn't get any answer I filled a bug report on
+2004/09/02. The patch to fix this annoying bug is:
+
+Index: gdb/mi/mi-main.c
+===================================================================
+RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
+retrieving revision 1.64
+diff -u -r1.64 mi-main.c
+--- gdb/mi/mi-main.c 3 Aug 2004 00:57:27 -0000 1.64
++++ gdb/mi/mi-main.c 25 Aug 2004 14:12:50 -0000
+@ -423,7 +423,7 @
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged.
+
+- numregs = NUM_REGS;
++ numregs = NUM_REGS + NUM_PSEUDO_REGS;
+
+ if (argc == 0)
+ {
+----
+
+Note I had to remove an end of comment in the patch to include it here.
+This bug forced me to create another set of functions. The only way is to
+first get the values and then the names.
+Fixed by Changelog entry:
+
+2004-09-12 Salvador E. Tropea &lt;set@users.sf.net&gt;
+ Andrew Cagney &lt;cagney@gnu.org&gt;
+
+ * mi/mi-main.c (mi_cmd_data_list_changed_registers)
+ (mi_cmd_data_list_register_values)
+ (mi_cmd_data_write_register_values): Include the PSEUDO_REGS in
+ the register number computation.
+
+<Menu>
+<li><a href="#gmi_data_evaluate_expression">gmi_data_evaluate_expression</a>
+<li><a href="#gmi_dir">gmi_dir</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Error.
+ Comment:
+ Translates error numbers into messages."></a>
+<H1>Error.
+ Comment:
+ Translates error numbers into messages.</H1>
+
+
+
+<Menu>
+<li><a href="#mi_get_error_str">mi_get_error_str</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Linux VT."></a>
+<H1>Linux VT.</H1>
+
+Helper to find a free VT. That's 100% Linux specific.
+<p>
+
+ The code comes from "lconsole.c" from Allegro project and was originally
+created by Marek Habersack and then modified by George Foot. I addapted it
+to my needs and changed license from giftware to GPL.
+<p>
+
+
+<Menu>
+<li><a href="#gmi_look_for_free_vt">gmi_look_for_free_vt</a>
+<li><a href="#mi_look_for_free_vt">mi_look_for_free_vt</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Miscellaneous commands."></a>
+<H1>Miscellaneous commands.</H1>
+
+GDB/MI commands for the "Miscellaneous Commands" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+
+-gdb-exit Yes
+-gdb-set Yes
+-gdb-show Yes
+-gdb-version Yes
+</pre>
+
+<Menu>
+<li><a href="#gmi_gdb_exit">gmi_gdb_exit</a>
+<li><a href="#gmi_gdb_set">gmi_gdb_set</a>
+<li><a href="#gmi_gdb_show">gmi_gdb_show</a>
+<li><a href="#gmi_gdb_version">gmi_gdb_version</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Parser."></a>
+<H1>Parser.</H1>
+
+Parses the output of gdb. It basically converts the text from gdb into a
+tree (could be a complex one) that we can easily interpret using C code.
+
+<Menu>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Program control."></a>
+<H1>Program control.</H1>
+
+GDB/MI commands for the "Program Control" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+
+-exec-abort N.A. (*) (kill, but with non-interactive options)
+-exec-arguments Yes
+-exec-continue Yes ASYNC
+-exec-finish Yes ASYNC
+-exec-interrupt Yes ASYNC
+-exec-next Yes ASYNC
+-exec-next-instruction Yes ASYNC
+-exec-return Yes
+-exec-run Yes ASYNC
+-exec-show-arguments N.A. (show args) see gmi_stack_info_frame
+-exec-step Yes ASYNC
+-exec-step-instruction Yes ASYNC
+-exec-until Yes ASYNC
+-file-exec-and-symbols Yes
+-file-exec-file No
+-file-list-exec-sections N.A. (info file)
+-file-list-exec-source-files N.A.
+-file-list-shared-libraries N.A.
+-file-list-symbol-files N.A.
+-file-symbol-file Yes
+</pre>
+
+(*) gmi_exec_kill implements it, but you should ensure that
+gmi_gdb_set("confirm","off") was called.
+<p>
+
+
+GDB Bug workaround for -file-exec-and-symbols and -file-symbol-file: This
+is complex, but a real bug. When you set a breakpoint you never know the
+name of the file as it appears in the debug info. So you can be specifying
+an absolute file name or a relative file name. The reference point could be
+different than the one used in the debug info. To solve all the combinations
+gdb does a search trying various combinations. GDB isn't very smart so you
+must at least specify the working directory and the directory where the
+binary is located to get a good chance (+ user options to solve the rest).
+Once you did it gdb can find the file by doing transformations to the
+"canonical" filename. This search works OK for already loaded symtabs
+(symbol tables), but it have a bug when the search is done for psymtabs
+(partial symtabs). The bug is in the use of source_full_path_of (source.c).
+This function calls openp indicating try_cwd_first. It makes the search file
+if the psymtab file name have at least one dirseparator. It means that
+psymtabs for files compiled with relative paths will fail. The search for
+symtabs uses symtab_to_filename, it calls open_source_file which finally
+calls openp without try_cwd_first.<br>
+To workaround this bug we must ensure gdb loads *all* the symtabs to memory.
+And here comes another problem -file-exec-and-symbols doesn't support it
+according to docs. In real life that's a wrapper for "file", but as nobody
+can say it won't change we must use the CLI command.
+
+<Menu>
+<li><a href="#gmi_exec_continue">gmi_exec_continue</a>
+<li><a href="#gmi_exec_finish">gmi_exec_finish</a>
+<li><a href="#gmi_exec_interrupt">gmi_exec_interrupt</a>
+<li><a href="#gmi_exec_kill">gmi_exec_kill</a>
+<li><a href="#gmi_exec_next">gmi_exec_next</a>
+<li><a href="#gmi_exec_next_cnt">gmi_exec_next_cnt</a>
+<li><a href="#gmi_exec_next_instruction">gmi_exec_next_instruction</a>
+<li><a href="#gmi_exec_return">gmi_exec_return</a>
+<li><a href="#gmi_exec_run">gmi_exec_run</a>
+<li><a href="#gmi_exec_step">gmi_exec_step</a>
+<li><a href="#gmi_exec_step_cnt">gmi_exec_step_cnt</a>
+<li><a href="#gmi_exec_step_instruction">gmi_exec_step_instruction</a>
+<li><a href="#gmi_exec_until">gmi_exec_until</a>
+<li><a href="#gmi_exec_until_addr">gmi_exec_until_addr</a>
+<li><a href="#gmi_file_symbol_file">gmi_file_symbol_file</a>
+<li><a href="#gmi_set_exec">gmi_set_exec</a>
+<li><a href="#gmi_target_terminal">gmi_target_terminal</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="pseudo terminal"></a>
+<H1>pseudo terminal</H1>
+
+Helper to find a free pseudo terminal. Use this if you need to manage
+ input *and* output to the target process. If you just need output then
+ define a handler for target output stream records (assuming that this
+ is working for your particular version of gdb).
+ Usage:
+
+ mi_pty *pty = gmi_look_for_free_pty();
+ if (pty) gmi_target_terminal(mih, pty-&gt;slave);
+ ...
+ * reading from pty-&gt;master will get stdout from target *
+ * writing to pty-&gt;master will send to target stdin *
+
+ Note: Contributed by Greg Watson (gwatson lanl gov)
+
+<Menu>
+<li><a href="#gmi_end_pty">gmi_end_pty</a>
+<li><a href="#gmi_look_for_free_pty">gmi_look_for_free_pty</a>
+<li><a href="#mi_look_for_free_pty">mi_look_for_free_pty</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Stack manipulation."></a>
+<H1>Stack manipulation.</H1>
+
+GDB/MI commands for the "Stack Manipulation" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+
+-stack-info-frame Yes, implemented as "frame"
+-stack-info-depth Yes
+-stack-list-arguments Yes
+-stack-list-frames Yes
+-stack-list-locals Yes
+-stack-select-frame Yes
+</pre>
+
+<Menu>
+<li><a href="#gmi_stack_info_depth">gmi_stack_info_depth</a>
+<li><a href="#gmi_stack_info_depth_get">gmi_stack_info_depth_get</a>
+<li><a href="#gmi_stack_info_frame">gmi_stack_info_frame</a>
+<li><a href="#gmi_stack_list_arguments">gmi_stack_list_arguments</a>
+<li><a href="#gmi_stack_list_arguments_r">gmi_stack_list_arguments_r</a>
+<li><a href="#gmi_stack_list_frames">gmi_stack_list_frames</a>
+<li><a href="#gmi_stack_list_frames_r">gmi_stack_list_frames_r</a>
+<li><a href="#gmi_stack_list_locals">gmi_stack_list_locals</a>
+<li><a href="#gmi_stack_select_frame">gmi_stack_select_frame</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Symbol query."></a>
+<H1>Symbol query.</H1>
+
+GDB/MI commands for the "Symbol Query" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+-symbol-info-address N.A. (info address, human readable)
+-symbol-info-file N.A.
+-symbol-info-function N.A.
+-symbol-info-line N.A. (info line, human readable)
+-symbol-info-symbol N.A. (info symbol, human readable)
+-symbol-list-functions N.A. (info functions, human readable)
+-symbol-list-types N.A. (info types, human readable)
+-symbol-list-variables N.A. (info variables, human readable)
+-symbol-list-lines No (gdb 6.x)
+-symbol-locate N.A.
+-symbol-type N.A. (ptype, human readable)
+</pre>
+
+Note:
+<p>
+
+
+Only one is implemented and not in gdb 5.x.
+<p>
+
+
+<Menu>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Target manipulation."></a>
+<H1>Target manipulation.</H1>
+
+GDB/MI commands for the "Target Manipulation" section.
+<p>
+
+
+<pre>
+-target-attach Yes (implemented using attach)
+-target-compare-sections N.A. (compare-sections)
+-target-detach Yes
+-target-download No
+-target-exec-status N.A.
+-target-list-available-targets N.A. (help target)
+-target-list-current-targets N.A. (info file among other things)
+-target-list-parameters N.A.
+-target-select Yes
+</pre>
+
+<Menu>
+<li><a href="#gmi_target_attach">gmi_target_attach</a>
+<li><a href="#gmi_target_detach">gmi_target_detach</a>
+<li><a href="#gmi_target_select">gmi_target_select</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Thread commands."></a>
+<H1>Thread commands.</H1>
+
+GDB/MI commands for the "Thread Commands" section.
+<p>
+
+
+<pre>
+gdb command: Implemented?
+-thread-info N.A.
+-thread-list-all-threads Yes, implemented as "info threads"
+-thread-list-ids Yes
+-thread-select Yes
+</pre>
+
+<Menu>
+<li><a href="#gmi_thread_list_all_threads">gmi_thread_list_all_threads</a>
+<li><a href="#gmi_thread_list_ids">gmi_thread_list_ids</a>
+<li><a href="#gmi_thread_select">gmi_thread_select</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Variable objects."></a>
+<H1>Variable objects.</H1>
+
+GDB/MI commands for the "Variable Objects" section.
+<p>
+
+
+<pre>
+gdb command: Imp? Description:
+-var-create Yes create a variable object
+-var-delete Yes delete the variable object and its children
+-var-set-format Yes set the display format of this variable
+-var-show-format Yes show the display format of this variable
+-var-info-num-children Yes tells how many children this object has
+-var-list-children Yes* return a list of the object's children
+-var-info-type Yes show the type of this variable object
+-var-info-expression Yes print what this variable object represents
+-var-show-attributes Yes is this variable editable?
+-var-evaluate-expression Yes get the value of this variable
+-var-assign Yes set the value of this variable
+-var-update Yes* update the variable and its children
+</pre>
+
+Notes:
+<p>
+
+1) I suggest letting gdb to choose the names for the variables.<br>
+2) -var-list-children supports an optional "show values" argument in MI v2.
+It isn't implemented.<br>
+
+<p>
+
+
+* MI v1 and v2 result formats supported.
+<p>
+
+
+<Menu>
+<li><a href="#gmi_full_var_create">gmi_full_var_create</a>
+<li><a href="#gmi_var_assign">gmi_var_assign</a>
+<li><a href="#gmi_var_create">gmi_var_create</a>
+<li><a href="#gmi_var_create_nm">gmi_var_create_nm</a>
+<li><a href="#gmi_var_delete">gmi_var_delete</a>
+<li><a href="#gmi_var_evaluate_expression">gmi_var_evaluate_expression</a>
+<li><a href="#gmi_var_info_expression">gmi_var_info_expression</a>
+<li><a href="#gmi_var_info_num_children">gmi_var_info_num_children</a>
+<li><a href="#gmi_var_info_type">gmi_var_info_type</a>
+<li><a href="#gmi_var_list_children">gmi_var_list_children</a>
+<li><a href="#gmi_var_set_format">gmi_var_set_format</a>
+<li><a href="#gmi_var_show_attributes">gmi_var_show_attributes</a>
+<li><a href="#gmi_var_show_format">gmi_var_show_format</a>
+<li><a href="#gmi_var_update">gmi_var_update</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Files"></a>
+<H1>Files</H1>
+
+<Menu>
+<li><a href="#breakpoint.c">breakpoint.c</a>
+<li><a href="#connect.c">connect.c</a>
+<li><a href="#cpp_int.cc">cpp_int.cc</a>
+<li><a href="#data_man.c">data_man.c</a>
+<li><a href="#error.c">error.c</a>
+<li><a href="#get_free_pty.c">get_free_pty.c</a>
+<li><a href="#get_free_vt.c">get_free_vt.c</a>
+<li><a href="#misc.c">misc.c</a>
+<li><a href="#prg_control.c">prg_control.c</a>
+<li><a href="#stack_man.c">stack_man.c</a>
+<li><a href="#target_man.c">target_man.c</a>
+<li><a href="#thread.c">thread.c</a>
+<li><a href="#var_obj.c">var_obj.c</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="breakpoint.c"></a>
+<H1>breakpoint.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_delete">gmi_break_delete</a>
+<li><a href="#gmi_break_insert">gmi_break_insert</a>
+<li><a href="#gmi_break_insert_full">gmi_break_insert_full</a>
+<li><a href="#gmi_break_insert_full_fl">gmi_break_insert_full_fl</a>
+<li><a href="#gmi_break_set_condition">gmi_break_set_condition</a>
+<li><a href="#gmi_break_set_times">gmi_break_set_times</a>
+<li><a href="#gmi_break_state">gmi_break_state</a>
+<li><a href="#gmi_break_watch">gmi_break_watch</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="connect.c"></a>
+<H1>connect.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_end_aux_term">gmi_end_aux_term</a>
+<li><a href="#gmi_start_xterm">gmi_start_xterm</a>
+<li><a href="#mi_connect_local">mi_connect_local</a>
+<li><a href="#mi_disconnect">mi_disconnect</a>
+<li><a href="#mi_force_version">mi_force_version</a>
+<li><a href="#mi_get_workaround">mi_get_workaround</a>
+<li><a href="#mi_set_workaround">mi_set_workaround</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="cpp_int.cc"></a>
+<H1>cpp_int.cc</H1>
+
+
+
+<Menu>
+<li><a href="#BreakDelete (MIDebugger)">BreakDelete (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger)">Breakpoint (MIDebugger)</a>
+<li><a href="#Breakpoint (MIDebugger) <1>">Breakpoint (MIDebugger) <1></a>
+<li><a href="#BreakpointFull (MIDebugger)">BreakpointFull (MIDebugger)</a>
+<li><a href="#CallStack (MIDebugger)">CallStack (MIDebugger)</a>
+<li><a href="#Connect (MIDebugger)">Connect (MIDebugger)</a>
+<li><a href="#Continue (MIDebugger)">Continue (MIDebugger)</a>
+<li><a href="#Disconnect (MIDebugger)">Disconnect (MIDebugger)</a>
+<li><a href="#EvalExpression (MIDebugger)">EvalExpression (MIDebugger)</a>
+<li><a href="#FillTypeVal (MIDebugger)">FillTypeVal (MIDebugger)</a>
+<li><a href="#FinishFun (MIDebugger)">FinishFun (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger)">GoTo (MIDebugger)</a>
+<li><a href="#GoTo (MIDebugger) <1>">GoTo (MIDebugger) <1></a>
+<li><a href="#Kill (MIDebugger)">Kill (MIDebugger)</a>
+<li><a href="#MIDebugger (MIDebugger)">MIDebugger (MIDebugger)</a>
+<li><a href="#ModifyExpression (MIDebugger)">ModifyExpression (MIDebugger)</a>
+<li><a href="#Poll (MIDebugger)">Poll (MIDebugger)</a>
+<li><a href="#ReturnNow (MIDebugger)">ReturnNow (MIDebugger)</a>
+<li><a href="#Run (MIDebugger)">Run (MIDebugger)</a>
+<li><a href="#RunOrContinue (MIDebugger)">RunOrContinue (MIDebugger)</a>
+<li><a href="#RunToMain (MIDebugger)">RunToMain (MIDebugger)</a>
+<li><a href="#SelectTargetLinux (MIDebugger)">SelectTargetLinux (MIDebugger)</a>
+<li><a href="#SelectTargetPID (MIDebugger)">SelectTargetPID (MIDebugger)</a>
+<li><a href="#SelectTargetRemote (MIDebugger)">SelectTargetRemote (MIDebugger)</a>
+<li><a href="#SelectTargetTTY (MIDebugger)">SelectTargetTTY (MIDebugger)</a>
+<li><a href="#SelectTargetX11 (MIDebugger)">SelectTargetX11 (MIDebugger)</a>
+<li><a href="#Send (MIDebugger)">Send (MIDebugger)</a>
+<li><a href="#StepOver (MIDebugger)">StepOver (MIDebugger)</a>
+<li><a href="#Stop (MIDebugger)">Stop (MIDebugger)</a>
+<li><a href="#TargetUnselect (MIDebugger)">TargetUnselect (MIDebugger)</a>
+<li><a href="#TraceInto (MIDebugger)">TraceInto (MIDebugger)</a>
+<li><a href="#WatchDelete (MIDebugger)">WatchDelete (MIDebugger)</a>
+<li><a href="#Watchpoint (MIDebugger)">Watchpoint (MIDebugger)</a>
+<li><a href="#~MIDebugger (MIDebugger)">~MIDebugger (MIDebugger)</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="data_man.c"></a>
+<H1>data_man.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_data_evaluate_expression">gmi_data_evaluate_expression</a>
+<li><a href="#gmi_dir">gmi_dir</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="error.c"></a>
+<H1>error.c</H1>
+
+
+
+<Menu>
+<li><a href="#mi_get_error_str">mi_get_error_str</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="get_free_pty.c"></a>
+<H1>get_free_pty.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_end_pty">gmi_end_pty</a>
+<li><a href="#gmi_look_for_free_pty">gmi_look_for_free_pty</a>
+<li><a href="#mi_look_for_free_pty">mi_look_for_free_pty</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="get_free_vt.c"></a>
+<H1>get_free_vt.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_look_for_free_vt">gmi_look_for_free_vt</a>
+<li><a href="#mi_look_for_free_vt">mi_look_for_free_vt</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="misc.c"></a>
+<H1>misc.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_gdb_exit">gmi_gdb_exit</a>
+<li><a href="#gmi_gdb_set">gmi_gdb_set</a>
+<li><a href="#gmi_gdb_show">gmi_gdb_show</a>
+<li><a href="#gmi_gdb_version">gmi_gdb_version</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="prg_control.c"></a>
+<H1>prg_control.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_continue">gmi_exec_continue</a>
+<li><a href="#gmi_exec_finish">gmi_exec_finish</a>
+<li><a href="#gmi_exec_interrupt">gmi_exec_interrupt</a>
+<li><a href="#gmi_exec_kill">gmi_exec_kill</a>
+<li><a href="#gmi_exec_next">gmi_exec_next</a>
+<li><a href="#gmi_exec_next_cnt">gmi_exec_next_cnt</a>
+<li><a href="#gmi_exec_next_instruction">gmi_exec_next_instruction</a>
+<li><a href="#gmi_exec_return">gmi_exec_return</a>
+<li><a href="#gmi_exec_run">gmi_exec_run</a>
+<li><a href="#gmi_exec_step">gmi_exec_step</a>
+<li><a href="#gmi_exec_step_cnt">gmi_exec_step_cnt</a>
+<li><a href="#gmi_exec_step_instruction">gmi_exec_step_instruction</a>
+<li><a href="#gmi_exec_until">gmi_exec_until</a>
+<li><a href="#gmi_exec_until_addr">gmi_exec_until_addr</a>
+<li><a href="#gmi_file_symbol_file">gmi_file_symbol_file</a>
+<li><a href="#gmi_set_exec">gmi_set_exec</a>
+<li><a href="#gmi_target_terminal">gmi_target_terminal</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="stack_man.c"></a>
+<H1>stack_man.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_info_depth">gmi_stack_info_depth</a>
+<li><a href="#gmi_stack_info_depth_get">gmi_stack_info_depth_get</a>
+<li><a href="#gmi_stack_info_frame">gmi_stack_info_frame</a>
+<li><a href="#gmi_stack_list_arguments">gmi_stack_list_arguments</a>
+<li><a href="#gmi_stack_list_arguments_r">gmi_stack_list_arguments_r</a>
+<li><a href="#gmi_stack_list_frames">gmi_stack_list_frames</a>
+<li><a href="#gmi_stack_list_frames_r">gmi_stack_list_frames_r</a>
+<li><a href="#gmi_stack_list_locals">gmi_stack_list_locals</a>
+<li><a href="#gmi_stack_select_frame">gmi_stack_select_frame</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="target_man.c"></a>
+<H1>target_man.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_target_attach">gmi_target_attach</a>
+<li><a href="#gmi_target_detach">gmi_target_detach</a>
+<li><a href="#gmi_target_select">gmi_target_select</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="thread.c"></a>
+<H1>thread.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_thread_list_all_threads">gmi_thread_list_all_threads</a>
+<li><a href="#gmi_thread_list_ids">gmi_thread_list_ids</a>
+<li><a href="#gmi_thread_select">gmi_thread_select</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="var_obj.c"></a>
+<H1>var_obj.c</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_full_var_create">gmi_full_var_create</a>
+<li><a href="#gmi_var_assign">gmi_var_assign</a>
+<li><a href="#gmi_var_create">gmi_var_create</a>
+<li><a href="#gmi_var_create_nm">gmi_var_create_nm</a>
+<li><a href="#gmi_var_delete">gmi_var_delete</a>
+<li><a href="#gmi_var_evaluate_expression">gmi_var_evaluate_expression</a>
+<li><a href="#gmi_var_info_expression">gmi_var_info_expression</a>
+<li><a href="#gmi_var_info_num_children">gmi_var_info_num_children</a>
+<li><a href="#gmi_var_info_type">gmi_var_info_type</a>
+<li><a href="#gmi_var_list_children">gmi_var_list_children</a>
+<li><a href="#gmi_var_set_format">gmi_var_set_format</a>
+<li><a href="#gmi_var_show_attributes">gmi_var_show_attributes</a>
+<li><a href="#gmi_var_show_format">gmi_var_show_format</a>
+<li><a href="#gmi_var_update">gmi_var_update</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="Command"></a>
+<H1>Command</H1>
+
+<Menu>
+<li><a href="#-break-after">-break-after</a>
+<li><a href="#-break-condition">-break-condition</a>
+<li><a href="#-break-delete">-break-delete</a>
+<li><a href="#-break-enable + -break-disable">-break-enable + -break-disable</a>
+<li><a href="#-break-insert">-break-insert</a>
+<li><a href="#-break-insert [ops] file:line">-break-insert [ops] file:line</a>
+<li><a href="#-break-insert file:line">-break-insert file:line</a>
+<li><a href="#-break-watch">-break-watch</a>
+<li><a href="#-data-evaluate-expression">-data-evaluate-expression</a>
+<li><a href="#-environment-directory">-environment-directory</a>
+<li><a href="#-exec-abort [using kill]">-exec-abort [using kill]</a>
+<li><a href="#-exec-continue">-exec-continue</a>
+<li><a href="#-exec-finish">-exec-finish</a>
+<li><a href="#-exec-interrupt [replacement]">-exec-interrupt [replacement]</a>
+<li><a href="#-exec-next">-exec-next</a>
+<li><a href="#-exec-next count">-exec-next count</a>
+<li><a href="#-exec-next-instruction">-exec-next-instruction</a>
+<li><a href="#-exec-return">-exec-return</a>
+<li><a href="#-exec-run">-exec-run</a>
+<li><a href="#-exec-step">-exec-step</a>
+<li><a href="#-exec-step count">-exec-step count</a>
+<li><a href="#-exec-step-instruction">-exec-step-instruction</a>
+<li><a href="#-exec-until">-exec-until</a>
+<li><a href="#-exec-until (using *address)">-exec-until (using *address)</a>
+<li><a href="#-file-exec-and-symbols + -exec-arguments">-file-exec-and-symbols + -exec-arguments</a>
+<li><a href="#-file-symbol-file">-file-symbol-file</a>
+<li><a href="#-gdb-exit">-gdb-exit</a>
+<li><a href="#-gdb-set">-gdb-set</a>
+<li><a href="#-gdb-show">-gdb-show</a>
+<li><a href="#-gdb-version">-gdb-version</a>
+<li><a href="#-stack-info-depth">-stack-info-depth</a>
+<li><a href="#-stack-info-depth [no args]">-stack-info-depth [no args]</a>
+<li><a href="#-stack-info-frame [using frame]">-stack-info-frame [using frame]</a>
+<li><a href="#-stack-list-arguments">-stack-list-arguments</a>
+<li><a href="#-stack-list-frames">-stack-list-frames</a>
+<li><a href="#-stack-list-locals">-stack-list-locals</a>
+<li><a href="#-stack-select-frame">-stack-select-frame</a>
+<li><a href="#-target-attach [using attach]">-target-attach [using attach]</a>
+<li><a href="#-target-detach">-target-detach</a>
+<li><a href="#-target-select">-target-select</a>
+<li><a href="#-thread-list-all-threads">-thread-list-all-threads</a>
+<li><a href="#-thread-list-ids">-thread-list-ids</a>
+<li><a href="#-thread-select">-thread-select</a>
+<li><a href="#-var-assign">-var-assign</a>
+<li><a href="#-var-create">-var-create</a>
+<li><a href="#-var-create + -var-info-expression + -var-show-attributes">-var-create + -var-info-expression + -var-show-attributes</a>
+<li><a href="#-var-create [auto name]">-var-create [auto name]</a>
+<li><a href="#-var-delete">-var-delete</a>
+<li><a href="#-var-evaluate-expression">-var-evaluate-expression</a>
+<li><a href="#-var-info-expression">-var-info-expression</a>
+<li><a href="#-var-info-num-children">-var-info-num-children</a>
+<li><a href="#-var-info-type">-var-info-type</a>
+<li><a href="#-var-list-children">-var-list-children</a>
+<li><a href="#-var-set-format">-var-set-format</a>
+<li><a href="#-var-show-attributes">-var-show-attributes</a>
+<li><a href="#-var-show-format">-var-show-format</a>
+<li><a href="#-var-update">-var-update</a>
+<li><a href="#tty">tty</a>
+</Menu>
+
+
+<p><hr></p>
+<a name="-break-after"></a>
+<H1>-break-after</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_set_times">gmi_break_set_times</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-condition"></a>
+<H1>-break-condition</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_set_condition">gmi_break_set_condition</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-delete"></a>
+<H1>-break-delete</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_delete">gmi_break_delete</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-enable + -break-disable"></a>
+<H1>-break-enable + -break-disable</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_state">gmi_break_state</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-insert"></a>
+<H1>-break-insert</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_insert_full">gmi_break_insert_full</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-insert [ops] file:line"></a>
+<H1>-break-insert [ops] file:line</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_insert_full_fl">gmi_break_insert_full_fl</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-insert file:line"></a>
+<H1>-break-insert file:line</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_insert">gmi_break_insert</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-break-watch"></a>
+<H1>-break-watch</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_break_watch">gmi_break_watch</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-data-evaluate-expression"></a>
+<H1>-data-evaluate-expression</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_data_evaluate_expression">gmi_data_evaluate_expression</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-environment-directory"></a>
+<H1>-environment-directory</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_dir">gmi_dir</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-abort [using kill]"></a>
+<H1>-exec-abort [using kill]</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_kill">gmi_exec_kill</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-continue"></a>
+<H1>-exec-continue</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_continue">gmi_exec_continue</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-finish"></a>
+<H1>-exec-finish</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_finish">gmi_exec_finish</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-interrupt [replacement]"></a>
+<H1>-exec-interrupt [replacement]</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_interrupt">gmi_exec_interrupt</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-next"></a>
+<H1>-exec-next</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_next">gmi_exec_next</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-next count"></a>
+<H1>-exec-next count</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_next_cnt">gmi_exec_next_cnt</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-next-instruction"></a>
+<H1>-exec-next-instruction</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_next_instruction">gmi_exec_next_instruction</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-return"></a>
+<H1>-exec-return</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_return">gmi_exec_return</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-run"></a>
+<H1>-exec-run</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_run">gmi_exec_run</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-step"></a>
+<H1>-exec-step</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_step">gmi_exec_step</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-step count"></a>
+<H1>-exec-step count</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_step_cnt">gmi_exec_step_cnt</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-step-instruction"></a>
+<H1>-exec-step-instruction</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_step_instruction">gmi_exec_step_instruction</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-until"></a>
+<H1>-exec-until</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_until">gmi_exec_until</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-exec-until (using *address)"></a>
+<H1>-exec-until (using *address)</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_exec_until_addr">gmi_exec_until_addr</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-file-exec-and-symbols + -exec-arguments"></a>
+<H1>-file-exec-and-symbols + -exec-arguments</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_set_exec">gmi_set_exec</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-file-symbol-file"></a>
+<H1>-file-symbol-file</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_file_symbol_file">gmi_file_symbol_file</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-gdb-exit"></a>
+<H1>-gdb-exit</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_gdb_exit">gmi_gdb_exit</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-gdb-set"></a>
+<H1>-gdb-set</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_gdb_set">gmi_gdb_set</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-gdb-show"></a>
+<H1>-gdb-show</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_gdb_show">gmi_gdb_show</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-gdb-version"></a>
+<H1>-gdb-version</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_gdb_version">gmi_gdb_version</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-info-depth"></a>
+<H1>-stack-info-depth</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_info_depth">gmi_stack_info_depth</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-info-depth [no args]"></a>
+<H1>-stack-info-depth [no args]</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_info_depth_get">gmi_stack_info_depth_get</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-info-frame [using frame]"></a>
+<H1>-stack-info-frame [using frame]</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_info_frame">gmi_stack_info_frame</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-list-arguments"></a>
+<H1>-stack-list-arguments</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_list_arguments">gmi_stack_list_arguments</a>
+<li><a href="#gmi_stack_list_arguments_r">gmi_stack_list_arguments_r</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-list-frames"></a>
+<H1>-stack-list-frames</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_list_frames">gmi_stack_list_frames</a>
+<li><a href="#gmi_stack_list_frames_r">gmi_stack_list_frames_r</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-list-locals"></a>
+<H1>-stack-list-locals</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_list_locals">gmi_stack_list_locals</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-stack-select-frame"></a>
+<H1>-stack-select-frame</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_stack_select_frame">gmi_stack_select_frame</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-target-attach [using attach]"></a>
+<H1>-target-attach [using attach]</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_target_attach">gmi_target_attach</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-target-detach"></a>
+<H1>-target-detach</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_target_detach">gmi_target_detach</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-target-select"></a>
+<H1>-target-select</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_target_select">gmi_target_select</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-thread-list-all-threads"></a>
+<H1>-thread-list-all-threads</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_thread_list_all_threads">gmi_thread_list_all_threads</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-thread-list-ids"></a>
+<H1>-thread-list-ids</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_thread_list_ids">gmi_thread_list_ids</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-thread-select"></a>
+<H1>-thread-select</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_thread_select">gmi_thread_select</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-assign"></a>
+<H1>-var-assign</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_assign">gmi_var_assign</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-create"></a>
+<H1>-var-create</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_create_nm">gmi_var_create_nm</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-create + -var-info-expression + -var-show-attributes"></a>
+<H1>-var-create + -var-info-expression + -var-show-attributes</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_full_var_create">gmi_full_var_create</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-create [auto name]"></a>
+<H1>-var-create [auto name]</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_create">gmi_var_create</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-delete"></a>
+<H1>-var-delete</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_delete">gmi_var_delete</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-evaluate-expression"></a>
+<H1>-var-evaluate-expression</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_evaluate_expression">gmi_var_evaluate_expression</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-info-expression"></a>
+<H1>-var-info-expression</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_info_expression">gmi_var_info_expression</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-info-num-children"></a>
+<H1>-var-info-num-children</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_info_num_children">gmi_var_info_num_children</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-info-type"></a>
+<H1>-var-info-type</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_info_type">gmi_var_info_type</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-list-children"></a>
+<H1>-var-list-children</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_list_children">gmi_var_list_children</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-set-format"></a>
+<H1>-var-set-format</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_set_format">gmi_var_set_format</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-show-attributes"></a>
+<H1>-var-show-attributes</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_show_attributes">gmi_var_show_attributes</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-show-format"></a>
+<H1>-var-show-format</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_show_format">gmi_var_show_format</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="-var-update"></a>
+<H1>-var-update</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_var_update">gmi_var_update</a>
+</Menu>
+
+
+
+<p><hr></p>
+<a name="tty"></a>
+<H1>tty</H1>
+
+
+
+<Menu>
+<li><a href="#gmi_target_terminal">gmi_target_terminal</a>
+</Menu>
+
+
+
+
+
+<p><hr></p>
+<a name="gmi_break_insert"></a>
+<center><Font Size=+2>gmi_break_insert</Font> (breakpoint.c 133)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_insert(mi_h *h, const char *file, int line);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Insert a breakpoint at file:line.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_bkpt structure with info about the breakpoint. NULL on
+error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_insert_full"></a>
+<center><Font Size=+2>gmi_break_insert_full</Font> (breakpoint.c 150)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_insert_full(mi_h *h, int temporary, int hard_assist, const char *cond, int count, int thread, const char *where);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Insert a breakpoint, all available options.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_bkpt structure with info about the breakpoint. NULL on
+error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_insert_full_fl"></a>
+<center><Font Size=+2>gmi_break_insert_full_fl</Font> (breakpoint.c 169)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_insert_full_fl(mi_h *h, const char *file, int line, int temporary, int hard_assist, const char *cond, int count, int thread);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Insert a breakpoint, all available options.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_bkpt structure with info about the breakpoint. NULL on
+error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_delete"></a>
+<center><Font Size=+2>gmi_break_delete</Font> (breakpoint.c 188)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_delete(mi_h *h, int number);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Remove a breakpoint.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK. Note that gdb always says OK, but errors can be sent to the
+console.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_set_times"></a>
+<center><Font Size=+2>gmi_break_set_times</Font> (breakpoint.c 205)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_set_times(mi_h *h, int number, int count);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Modify the "ignore" count for a breakpoint.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK. Note that gdb always says OK, but errors can be sent to the
+console.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_set_condition"></a>
+<center><Font Size=+2>gmi_break_set_condition</Font> (breakpoint.c 221)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_set_condition(mi_h *h, int number, const char *condition);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Associate a condition with the breakpoint.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_state"></a>
+<center><Font Size=+2>gmi_break_state</Font> (breakpoint.c 238)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_state(mi_h *h, int number, int enable);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Enable or disable a breakpoint.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK. Note that gdb always says OK, but errors can be sent to the
+console.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_break_watch"></a>
+<center><Font Size=+2>gmi_break_watch</Font> (breakpoint.c 258)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_break_watch(mi_h *h, enum mi_wp_mode mode, const char *exp);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Set a watchpoint. It doesn't work for remote targets!
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_wp structure with info about the watchpoint. NULL on
+error.
+<p>
+
+
+
+<p><hr></p>
+<a name="mi_connect_local"></a>
+<center><Font Size=+2>mi_connect_local</Font> (connect.c 330)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_connect_local();
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Connect to a local copy of gdb. Note that the mi_h structure is something
+similar to a "FILE *" for stdio.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_h structure or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="mi_disconnect"></a>
+<center><Font Size=+2>mi_disconnect</Font> (connect.c 410)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_disconnect(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Close connection. You should ask gdb to quit first <a href="#gmi_gdb_exit">gmi_gdb_exit</a>.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="gmi_start_xterm"></a>
+<center><Font Size=+2>gmi_start_xterm</Font> (connect.c 647)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_start_xterm();
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Opens a new xterm to be used by the child process to debug.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_aux_term structure, you can use <a href="#gmi_end_aux_term">gmi_end_aux_term</a> to
+release it.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_end_aux_term"></a>
+<center><Font Size=+2>gmi_end_aux_term</Font> (connect.c 764)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_end_aux_term(mi_aux_term *t);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Closes the auxiliar terminal and releases the allocated memory.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="mi_force_version"></a>
+<center><Font Size=+2>mi_force_version</Font> (connect.c 781)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_force_version(mi_h *h, unsigned vMajor, unsigned vMiddle, unsigned vMinor);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Forces the MI version. Currently the library can't detect it so you must
+force it manually. GDB 5.x implemented MI v1 and 6.x v2.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="mi_set_workaround"></a>
+<center><Font Size=+2>mi_set_workaround</Font> (connect.c 794)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_set_workaround(unsigned wa, int enable);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Dis/Enables the @var{wa} workaround for a bug in gdb.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="mi_get_workaround"></a>
+<center><Font Size=+2>mi_get_workaround</Font> (connect.c 813)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_get_workaround(unsigned wa);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finds if the @var{wa} workaround for a bug in gdb is enabled.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 if enabled.
+<p>
+
+
+
+<p><hr></p>
+<a name="MIDebugger (MIDebugger)"></a>
+<center><Font Size=+2>MIDebugger</Font> (cpp_int.cc 22)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::MIDebugger();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Initializes a debugger object. It starts in the "disconnected" state.
+Use <a href="#Connect (MIDebugger)">Connect</a> after it.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="~MIDebugger (MIDebugger)"></a>
+<center><Font Size=+2>~MIDebugger</Font> (cpp_int.cc 40)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::~MIDebugger();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+This is the destructor for the class. It tries to change the state to
+"disconnected" doing the needed actions.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="Connect (MIDebugger)"></a>
+<center><Font Size=+2>Connect</Font> (cpp_int.cc 79)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Connect(bool);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Connects to gdb. Currently only local connections are supported, that's
+a gdb limitation. Call it when in "unconnected" state, on success it will
+change to the "connected" state. After it you should call one of the
+SelectTarget members. <a href="#SelectTargetX11 (MIDebugger)">SelectTargetX11</a>, <a href="#SelectTargetLinux (MIDebugger)">SelectTargetLinux</a> or
+<a href="#SelectTargetRemote (MIDebugger)">SelectTargetRemote</a>. To finish the connection use <a href="#Disconnect (MIDebugger)">Disconnect</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="Disconnect (MIDebugger)"></a>
+<center><Font Size=+2>Disconnect</Font> (cpp_int.cc 105)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Disconnect();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Finishes the connection to gdb. Call when in "connected" state, on success
+it will change to "disconnected" state. This function first tries to exit
+from gdb and then close the connection. But if gdb fails to exit it will be
+killed.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="SelectTargetTTY (MIDebugger)"></a>
+<center><Font Size=+2>SelectTargetTTY</Font> (cpp_int.cc 127)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::SelectTargetTTY(const char *exec, const char *args, const char *auxtty, dMode m);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Protected member that implements <a href="#SelectTargetX11 (MIDebugger)">SelectTargetX11</a> and
+<a href="#SelectTargetLinux (MIDebugger)">SelectTargetLinux</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="SelectTargetX11 (MIDebugger)"></a>
+<center><Font Size=+2>SelectTargetX11</Font> (cpp_int.cc 180)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::SelectTargetX11(const char *exec, const char *args, const char *auxtty);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Starts a debug session for X11. It opens an xterm console for the program
+to debug and tells gdb which executable to debug and the command line
+options to pass. You can specify an already existing tty console to be used.
+Can be called when the state is "connected". On success will change to the
+"target_specified" state. After it you can use <a href="#Run (MIDebugger)">Run</a> or use the members
+to define breakpoints and similar stuff. To finish it use
+<a href="#TargetUnselect (MIDebugger)">TargetUnselect</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="SelectTargetLinux (MIDebugger)"></a>
+<center><Font Size=+2>SelectTargetLinux</Font> (cpp_int.cc 202)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::SelectTargetLinux(const char *exec, const char *args, const char *auxtty);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Starts a debug session for Linux console. It selects an empty VT for the
+program to debug and tells gdb which executable to debug and the command line
+options to pass. You can specify an already existing tty console to be used.
+Can be called when the state is "connected". On success will change to the
+"target_specified" state. After it you can use <a href="#Run (MIDebugger)">Run</a> or use the members
+to define breakpoints and similar stuff. To finish it use
+<a href="#TargetUnselect (MIDebugger)">TargetUnselect</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="SelectTargetRemote (MIDebugger)"></a>
+<center><Font Size=+2>SelectTargetRemote</Font> (cpp_int.cc 228)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::SelectTargetRemote(const char *exec, const char *rparams, const char *rtype);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Starts a remote session. The other end should be running gdbserver. You
+must specify a local copy of the program to debug with debug info. The remote
+copy can be stripped. The @var{rtype} and @var{rparams} selects the protocol
+and the remote machine. Read gdb docs to know more about the available
+options. If @var{rtype} is omitted "extended-remote" protocol is used.
+Can be called when the state is "connected". On success will change to the
+"target_specified" state. After it you can use <a href="#Run (MIDebugger)">Run</a> or use the members
+to define breakpoints and similar stuff. To finish it use
+<a href="#TargetUnselect (MIDebugger)">TargetUnselect</a>. Note that when gdb uses remote debugging the remote
+program starts running. The <a href="#Run (MIDebugger)">Run</a> member knows about it.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+o-&gt;SelectTargetRemote("./exec_file","192.168.1.65:5000");
+<p>
+
+
+<p><hr></p>
+<a name="SelectTargetPID (MIDebugger)"></a>
+<center><Font Size=+2>SelectTargetPID</Font> (cpp_int.cc 258)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::SelectTargetPID(const char *exec, int pid);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Starts a local session using an already running process.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="TargetUnselect (MIDebugger)"></a>
+<center><Font Size=+2>TargetUnselect</Font> (cpp_int.cc 295)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::TargetUnselect();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Used to unselect the current target. When X11 mode it closes the auxiliar
+terminal. For remote debugging it uses "detach". Can be called when in
+"target_specified" state. On success it changes to "connected" state.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="Run (MIDebugger)"></a>
+<center><Font Size=+2>Run</Font> (cpp_int.cc 335)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Run();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Starts running the program. You should set breakpoint before it. Can be
+called when state is "target_specified". On success will change to "running"
+state. After it you should poll for async responses using <a href="#Poll (MIDebugger)">Poll</a>. The
+program can stop for many reasons asynchronously and also exit. This
+information is known using Poll. You can stop the program using <a href="#Stop (MIDebugger)">Stop</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="Stop (MIDebugger)"></a>
+<center><Font Size=+2>Stop</Font> (cpp_int.cc 365)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Stop();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Stops the program execution. GDB sends an interrupt signal to the program.
+Can be called when the state is "running". It won't switch to "stopped"
+state automatically. Instead you must poll for async events and wait for a
+stopped notification. After it you can call <a href="#Continue (MIDebugger)">Continue</a> to resume
+execution.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+!=0 OK
+<p>
+
+
+<p><hr></p>
+<a name="Poll (MIDebugger)"></a>
+<center><Font Size=+2>Poll</Font> (cpp_int.cc 386)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Poll(mi_stop *&rs);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Polls gdb looking for async responses. Currently it just looks for
+"stopped" messages. You must call it when the state is "running". But the
+function will poll gdb even if the state isn't "running". When a stopped
+message is received the state changes to stopped or target_specified (the
+last is when we get some exit).
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 if we got a response. The @var{rs} pointer will point to an
+mi_stop structure if we got it or will be NULL if we didn't.
+<p>
+
+
+
+<p><hr></p>
+<a name="Continue (MIDebugger)"></a>
+<center><Font Size=+2>Continue</Font> (cpp_int.cc 432)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Continue();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Resumes execution after the program "stopped". Can be called when the state
+is stopped. On success will change to "running" state.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="RunOrContinue (MIDebugger)"></a>
+<center><Font Size=+2>RunOrContinue</Font> (cpp_int.cc 454)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::RunOrContinue();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Starts program execution or resumes it. When the state is target_specified
+it calls <a href="#Run (MIDebugger)">Run</a> otherwise it uses <a href="#Continue (MIDebugger)">Continue</a>. Can be called when the
+state is "target_specified" or "stopped". On success will change to
+"running" state.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="Kill (MIDebugger)"></a>
+<center><Font Size=+2>Kill</Font> (cpp_int.cc 473)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Kill();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Kills the program you are debugging. Can be called when the state is
+"stopped" or "running". On success changes the state to "target_specified".
+Note that if you want to restart the program you can just call <a href="#Run (MIDebugger)">Run</a> and
+if you want to just stop the program call <a href="#Stop (MIDebugger)">Stop</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="Breakpoint (MIDebugger)"></a>
+<center><Font Size=+2>Breakpoint</Font> (cpp_int.cc 520)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Breakpoint(const char *file, int line);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Inserts a breakpoint at @var{file} and @var{line}. Can be called when the
+state is "stopped" or "target_specified".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+An mi_bkpt structure or NULL if error.
+<p>
+
+
+
+<p><hr></p>
+<a name="Breakpoint (MIDebugger) <1>"></a>
+<center><Font Size=+2>Breakpoint</Font> (cpp_int.cc 537)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Breakpoint(const char *where, bool temporary, const char *cond, int count, int thread, bool hard_assist);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Inserts a breakpoint at @var{where}, all options available. Can be called
+when the state is "stopped" or "target_specified".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+An mi_bkpt structure or NULL if error.
+<p>
+
+
+
+<p><hr></p>
+<a name="BreakpointFull (MIDebugger)"></a>
+<center><Font Size=+2>BreakpointFull</Font> (cpp_int.cc 585)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::BreakpointFull(const char *file, int line, bool temporary, const char *cond, int count, int thread, bool hard_assist);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Inserts a breakpoint at @var{file} and @var{line} all options available.
+Can be called when the state is "stopped" or "target_specified".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+An mi_bkpt structure or NULL if error.
+<p>
+
+
+
+<p><hr></p>
+<a name="BreakDelete (MIDebugger)"></a>
+<center><Font Size=+2>BreakDelete</Font> (cpp_int.cc 605)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::BreakDelete(mi_bkpt *b);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Removes the specified breakpoint. It doesn't free the structure. Can be
+called when the state is "stopped" or "target_specified".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="Watchpoint (MIDebugger)"></a>
+<center><Font Size=+2>Watchpoint</Font> (cpp_int.cc 622)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Watchpoint(enum mi_wp_mode mode, const char *exp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Inserts a watchpoint for the specified expression. Can be called when the
+state is "stopped" or "target_specified".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+An mi_wp structure or NULL if error.
+<p>
+
+
+
+<p><hr></p>
+<a name="WatchDelete (MIDebugger)"></a>
+<center><Font Size=+2>WatchDelete</Font> (cpp_int.cc 639)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::WatchDelete(mi_wp *w);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Removes the specified watchpoint. It doesn't free the structure. Can be
+called when the state is "stopped" or "target_specified".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="RunToMain (MIDebugger)"></a>
+<center><Font Size=+2>RunToMain</Font> (cpp_int.cc 657)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::RunToMain();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Puts a temporal breakpoint in main function and starts running. Can be
+called when the state is "target_specified". If successful the state will
+change to "running".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="StepOver (MIDebugger)"></a>
+<center><Font Size=+2>StepOver</Font> (cpp_int.cc 681)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::StepOver(bool inst);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Executes upto the next line, doesn't follow function calls. The @var{inst}
+argument is for assembler. If the state is "target_specified" it will go to
+the first line in the main function. If the state is "stopped" will use the
+next command. If successfully the state will change to "running".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="GoTo (MIDebugger)"></a>
+<center><Font Size=+2>GoTo</Font> (cpp_int.cc 713)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::GoTo(const char *file, int line);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Executes until the specified point. If the state is "target_specified" it
+uses a temporal breakpoint. If the state is "stopped" it uses -exec-until.
+Fails for any other state.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="GoTo (MIDebugger) <1>"></a>
+<center><Font Size=+2>GoTo</Font> (cpp_int.cc 751)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::GoTo(void *addr);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Executes until the specified point. If the state is "target_specified" it
+uses a temporal breakpoint. If the state is "stopped" it uses -exec-until.
+Fails for any other state.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="FinishFun (MIDebugger)"></a>
+<center><Font Size=+2>FinishFun</Font> (cpp_int.cc 788)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::FinishFun();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Resumes execution until the end of the current funtion is reached. Only
+usable when we are in the "stopped" state.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="ReturnNow (MIDebugger)"></a>
+<center><Font Size=+2>ReturnNow</Font> (cpp_int.cc 808)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::ReturnNow();
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=NULL OK, the returned frame is the current location. That's a
+synchronous function.
+<p>
+
+
+
+<p><hr></p>
+<a name="CallStack (MIDebugger)"></a>
+<center><Font Size=+2>CallStack</Font> (cpp_int.cc 824)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::CallStack(bool args);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=NULL OK, the list of frames is returned.
+<p>
+
+
+
+<p><hr></p>
+<a name="TraceInto (MIDebugger)"></a>
+<center><Font Size=+2>TraceInto</Font> (cpp_int.cc 860)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::TraceInto(bool inst);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Executes upto the next line, it follows function calls. The @var{inst}
+argument is for assembler. If the state is "target_specified" it will go to
+the first line in the main function. If the state is "stopped" will use the
+next command. If successfully the state will change to "running".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="EvalExpression (MIDebugger)"></a>
+<center><Font Size=+2>EvalExpression</Font> (cpp_int.cc 892)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::EvalExpression(const char *exp);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Evaluates the provided expression. If we get an error the error
+description is returned instead. Can't be called if "disconnected" or
+"running".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The result of the expression (use free) or NULL.
+<p>
+
+
+
+<p><hr></p>
+<a name="ModifyExpression (MIDebugger)"></a>
+<center><Font Size=+2>ModifyExpression</Font> (cpp_int.cc 918)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::ModifyExpression(char *exp, char *newVal);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Modifies the provided expression. If we get an error the error
+description is returned instead. Can't be called if "disconnected" or
+"running".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The result of the expression (use free) or NULL.
+<p>
+
+
+
+<p><hr></p>
+<a name="Send (MIDebugger)"></a>
+<center><Font Size=+2>Send</Font> (cpp_int.cc 950)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::Send(const char *command);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Sends a command to gdb.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="FillTypeVal (MIDebugger)"></a>
+<center><Font Size=+2>FillTypeVal</Font> (cpp_int.cc 970)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ MIDebugger::FillTypeVal(mi_gvar *var);
+</pre>
+
+
+<Font Size=+1><u>Member of the class:</u></Font>
+MIDebugger
+<p>
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fills the type and value fields of the mi_gvar provided list.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_data_evaluate_expression"></a>
+<center><Font Size=+2>gmi_data_evaluate_expression</Font> (data_man.c 163)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_data_evaluate_expression(mi_h *h, const char *expression);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Evaluate an expression. Returns a parsed tree.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The resulting value (as plain text) or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_dir"></a>
+<center><Font Size=+2>gmi_dir</Font> (data_man.c 180)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_dir(mi_h *h, const char *path);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Path for sources. You must use it to indicate where are the sources for
+the program to debug. Only the MI v1 implementation is available.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="mi_get_error_str"></a>
+<center><Font Size=+2>mi_get_error_str</Font> (error.c 10)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_get_error_str();
+</pre>
+
+
+
+
+
+
+
+<p><hr></p>
+<a name="mi_look_for_free_pty"></a>
+<center><Font Size=+2>mi_look_for_free_pty</Font> (get_free_pty.c 41)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_look_for_free_pty(int *master, char **slave);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Look for a free and usable pseudo terminal. Low level, use
+<a href="#gmi_look_for_free_pty">gmi_look_for_free_pty</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A file descriptor connected to the master pty and the name of the slave device, or &lt;0 on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_look_for_free_pty"></a>
+<center><Font Size=+2>gmi_look_for_free_pty</Font> (get_free_pty.c 92)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_look_for_free_pty();
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Look for a free and usable pseudo terminal to be used by the child.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_pty structure, you can use <a href="#gmi_end_pty">gmi_end_pty</a> to
+release it.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_end_pty"></a>
+<center><Font Size=+2>gmi_end_pty</Font> (get_free_pty.c 124)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_end_pty(mi_pty *p);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Closes the pseudo termial master and releases the allocated memory.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="mi_look_for_free_vt"></a>
+<center><Font Size=+2>mi_look_for_free_vt</Font> (get_free_vt.c 51)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ mi_look_for_free_vt() 53;
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Look for a free and usable Linux VT. Low level, use
+<a href="#gmi_look_for_free_vt">gmi_look_for_free_vt</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The VT number or &lt;0 on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_look_for_free_vt"></a>
+<center><Font Size=+2>gmi_look_for_free_vt</Font> (get_free_vt.c 135)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_look_for_free_vt() 137;
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Look for a free and usable Linux VT to be used by the child.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_aux_term structure, you can use <a href="#gmi_end_aux_term">gmi_end_aux_term</a> to
+release it.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_gdb_exit"></a>
+<center><Font Size=+2>gmi_gdb_exit</Font> (misc.c 54)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_gdb_exit(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Exit gdb killing the child is it is running.
+<p>
+
+
+
+
+<p><hr></p>
+<a name="gmi_gdb_version"></a>
+<center><Font Size=+2>gmi_gdb_version</Font> (misc.c 70)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_gdb_version(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Send the version to the console.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_gdb_set"></a>
+<center><Font Size=+2>gmi_gdb_set</Font> (misc.c 86)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_gdb_set(mi_h *h, const char *var, const char *val);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Set a gdb variable.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_gdb_show"></a>
+<center><Font Size=+2>gmi_gdb_show</Font> (misc.c 102)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_gdb_show(mi_h *h, const char *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Get a gdb variable.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The current value of the variable or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_set_exec"></a>
+<center><Font Size=+2>gmi_set_exec</Font> (prg_control.c 172)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_set_exec(mi_h *h, const char *file, const char *args);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Specify the executable and arguments for local debug.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_run"></a>
+<center><Font Size=+2>gmi_exec_run</Font> (prg_control.c 193)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_run(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Start running the executable. Remote sessions starts running.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_continue"></a>
+<center><Font Size=+2>gmi_exec_continue</Font> (prg_control.c 209)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_continue(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Continue the execution after a "stop".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_target_terminal"></a>
+<center><Font Size=+2>gmi_target_terminal</Font> (prg_control.c 226)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_target_terminal(mi_h *h, const char *tty_name);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Indicate which terminal will use the target program. For local sessions.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+
+<p>
+
+
+<p><hr></p>
+<a name="gmi_file_symbol_file"></a>
+<center><Font Size=+2>gmi_file_symbol_file</Font> (prg_control.c 242)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_file_symbol_file(mi_h *h, const char *file);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Specify what's the local copy that have debug info. For remote sessions.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_finish"></a>
+<center><Font Size=+2>gmi_exec_finish</Font> (prg_control.c 259)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_finish(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Continue until function return, the return value is included in the async
+response.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_interrupt"></a>
+<center><Font Size=+2>gmi_exec_interrupt</Font> (prg_control.c 278)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_interrupt(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Stop the program using SIGINT. The corresponding command should be
+-exec-interrupt but not even gdb 6.1.1 can do it because the "async" mode
+isn't really working.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+Always 1
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+
+<p>
+
+
+<p><hr></p>
+<a name="gmi_exec_next"></a>
+<center><Font Size=+2>gmi_exec_next</Font> (prg_control.c 299)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_next(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Next line of code.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_next_cnt"></a>
+<center><Font Size=+2>gmi_exec_next_cnt</Font> (prg_control.c 315)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_next_cnt(mi_h *h, int count);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Skip count lines of code.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_next_instruction"></a>
+<center><Font Size=+2>gmi_exec_next_instruction</Font> (prg_control.c 331)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_next_instruction(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Next line of assembler code.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_step"></a>
+<center><Font Size=+2>gmi_exec_step</Font> (prg_control.c 347)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_step(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Next line of code. Get inside functions.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_step_cnt"></a>
+<center><Font Size=+2>gmi_exec_step_cnt</Font> (prg_control.c 363)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_step_cnt(mi_h *h, int count);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Next count lines of code. Get inside functions.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_step_instruction"></a>
+<center><Font Size=+2>gmi_exec_step_instruction</Font> (prg_control.c 379)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_step_instruction(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Next line of assembler code. Get inside calls.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_until"></a>
+<center><Font Size=+2>gmi_exec_until</Font> (prg_control.c 396)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_until(mi_h *h, const char *file, int line);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Execute until location is reached. If file is NULL then is until next
+line.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_until_addr"></a>
+<center><Font Size=+2>gmi_exec_until_addr</Font> (prg_control.c 412)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_until_addr(mi_h *h, void *addr);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Execute until location is reached.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_return"></a>
+<center><Font Size=+2>gmi_exec_return</Font> (prg_control.c 429)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_return(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A pointer to a new mi_frames structure indicating the current
+location. NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_exec_kill"></a>
+<center><Font Size=+2>gmi_exec_kill</Font> (prg_control.c 447)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_exec_kill(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Just kill the program. That's what -exec-abort should do, but it isn't
+implemented by gdb. This implementation only works if the interactive mode
+is disabled (gmi_gdb_set("confirm","off")).
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_list_frames"></a>
+<center><Font Size=+2>gmi_stack_list_frames</Font> (stack_man.c 76)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_list_frames(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List of frames. Arguments aren't filled.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new list of mi_frames or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_list_frames_r"></a>
+<center><Font Size=+2>gmi_stack_list_frames_r</Font> (stack_man.c 93)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_list_frames_r(mi_h *h, int from, int to);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List of frames. Arguments aren't filled. Only the frames in the @var{from}
+ - @var{to} range are returned.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new list of mi_frames or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_list_arguments"></a>
+<center><Font Size=+2>gmi_stack_list_arguments</Font> (stack_man.c 109)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_list_arguments(mi_h *h, int show);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List arguments. Only @var{level} and @var{args} filled.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new list of mi_frames or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_list_arguments_r"></a>
+<center><Font Size=+2>gmi_stack_list_arguments_r</Font> (stack_man.c 126)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_list_arguments_r(mi_h *h, int show, int from, int to);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List arguments. Only @var{level} and @var{args} filled. Only for the
+frames in the @var{from} - @var{to} range.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new list of mi_frames or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_info_frame"></a>
+<center><Font Size=+2>gmi_stack_info_frame</Font> (stack_man.c 142)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_info_frame(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Information about the current frame, including args.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_frames or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_info_depth"></a>
+<center><Font Size=+2>gmi_stack_info_depth</Font> (stack_man.c 158)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_info_depth(mi_h *h, int max_depth);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Stack info depth.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The depth or -1 on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_info_depth_get"></a>
+<center><Font Size=+2>gmi_stack_info_depth_get</Font> (stack_man.c 184)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_info_depth_get(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Set stack info depth.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The depth or -1 on error.
+<p>
+
+
+<Font Size=+1><u>Example</u></Font><p>
+
+
+<p>
+
+
+<p><hr></p>
+<a name="gmi_stack_select_frame"></a>
+<center><Font Size=+2>gmi_stack_select_frame</Font> (stack_man.c 199)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_select_frame(mi_h *h, int framenum);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Change current frame.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_stack_list_locals"></a>
+<center><Font Size=+2>gmi_stack_list_locals</Font> (stack_man.c 215)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_stack_list_locals(mi_h *h, int show);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List of local vars.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_results tree containing the variables or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_target_select"></a>
+<center><Font Size=+2>gmi_target_select</Font> (target_man.c 54)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_target_select(mi_h *h, const char *type, const char *params);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Connect to a remote gdbserver using the specified methode.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_target_attach"></a>
+<center><Font Size=+2>gmi_target_attach</Font> (target_man.c 70)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_target_attach(mi_h *h, pid_t pid);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Attach to an already running process.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+The frame of the current location, NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_target_detach"></a>
+<center><Font Size=+2>gmi_target_detach</Font> (target_man.c 87)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_target_detach(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Detach from an attached process.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_thread_list_ids"></a>
+<center><Font Size=+2>gmi_thread_list_ids</Font> (thread.c 49)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_thread_list_ids(mi_h *h, int **list);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List available thread ids.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_thread_select"></a>
+<center><Font Size=+2>gmi_thread_select</Font> (thread.c 65)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_thread_select(mi_h *h, int id);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Select a thread.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_frames or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_thread_list_all_threads"></a>
+<center><Font Size=+2>gmi_thread_list_all_threads</Font> (thread.c 82)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_thread_list_all_threads(mi_h *h);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Get a list of frames for each available thread. Implemented using "info
+thread".
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A kist of frames, NULL on error
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_create_nm"></a>
+<center><Font Size=+2>gmi_var_create_nm</Font> (var_obj.c 122)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_create_nm(mi_h *h, const char *name, int frame, const char *exp);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Create a variable object. I recommend using <a href="#gmi_var_create">gmi_var_create</a> and letting
+gdb choose the names.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_gvar strcture or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_create"></a>
+<center><Font Size=+2>gmi_var_create</Font> (var_obj.c 139)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_create(mi_h *h, int frame, const char *exp);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Create a variable object. The name is selected by gdb. Alternative:
+<a href="#gmi_full_var_create">gmi_full_var_create</a>.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_gvar strcture or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_delete"></a>
+<center><Font Size=+2>gmi_var_delete</Font> (var_obj.c 154)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_delete(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Delete a variable object. Doesn't free the mi_gvar data.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_set_format"></a>
+<center><Font Size=+2>gmi_var_set_format</Font> (var_obj.c 170)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_set_format(mi_h *h, mi_gvar *var, enum mi_gvar_fmt format);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Set the format used to represent the result.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_show_format"></a>
+<center><Font Size=+2>gmi_var_show_format</Font> (var_obj.c 191)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_show_format(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fill the format field with info from gdb.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_info_num_children"></a>
+<center><Font Size=+2>gmi_var_info_num_children</Font> (var_obj.c 207)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_info_num_children(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fill the numchild field with info from gdb.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_info_type"></a>
+<center><Font Size=+2>gmi_var_info_type</Font> (var_obj.c 223)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_info_type(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fill the type field with info from gdb.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_info_expression"></a>
+<center><Font Size=+2>gmi_var_info_expression</Font> (var_obj.c 240)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_info_expression(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fill the expression and lang fields with info from gdb. Note that lang
+isn't filled during creation.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_show_attributes"></a>
+<center><Font Size=+2>gmi_var_show_attributes</Font> (var_obj.c 258)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_show_attributes(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fill the attr field with info from gdb. Note that attr isn't filled
+during creation.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_full_var_create"></a>
+<center><Font Size=+2>gmi_full_var_create</Font> (var_obj.c 275)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_full_var_create(mi_h *h, int frame, const char *exp);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Create the variable and also fill the lang and attr fields. The name is
+selected by gdb.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+A new mi_gvar strcture or NULL on error.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_update"></a>
+<center><Font Size=+2>gmi_var_update</Font> (var_obj.c 297)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_update(mi_h *h, mi_gvar *var, mi_gvar_chg **changed);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Update variable. Use NULL for all. Note that *changed can be NULL if none
+updated.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK. The @var{changed} list contains the list of changed vars.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_assign"></a>
+<center><Font Size=+2>gmi_var_assign</Font> (var_obj.c 313)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_assign(mi_h *h, mi_gvar *var, const char *expression);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Change variable. The new value replaces the @var{value} field.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_evaluate_expression"></a>
+<center><Font Size=+2>gmi_var_evaluate_expression</Font> (var_obj.c 337)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_evaluate_expression(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+Fill the value field getting the current value for a variable.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK, value contains the result.
+<p>
+
+
+
+<p><hr></p>
+<a name="gmi_var_list_children"></a>
+<center><Font Size=+2>gmi_var_list_children</Font> (var_obj.c 362)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+
+
+<pre>
+ gmi_var_list_children(mi_h *h, mi_gvar *var);
+</pre>
+
+
+
+
+<Font Size=+1><u>Description</u></Font><p>
+
+List children. It ONLY returns the first level information. :-(<br>
+ On success the child field contains the list of children.
+<p>
+
+
+<Font Size=+1><u>Return Value</u></Font><p>
+
+!=0 OK
+<p>
+
+
+
+
+
+</body>
+</html>
diff --git a/setedit/libmigdb/examples/Makefile b/setedit/libmigdb/examples/Makefile
new file mode 100644
index 0000000..0e6060c
--- /dev/null
+++ b/setedit/libmigdb/examples/Makefile
@@ -0,0 +1,31 @@
+#!/usr/bin/make
+
+all: test_target x11_test remote_test linux_test target_frames x11_fr_test \
+ x11_wp_test x11_cpp_test pty_test
+
+CFLAGS=-O0 -Wall -gstabs+3 -I../src
+CXXFLAGS=-O0 -Wall -gstabs+3 -I../src
+LDLIBS=
+
+ticepic: ticepic.c ../src/libmigdb.a
+
+x11_test: x11_test.c ../src/libmigdb.a
+
+x11_cpp_test: x11_cpp_test.cc ../src/libmigdb.a
+
+x11_fr_test: x11_fr_test.c ../src/libmigdb.a
+
+x11_wp_test: x11_wp_test.c ../src/libmigdb.a
+
+remote_test: remote_test.c ../src/libmigdb.a
+
+linux_test: linux_test.c ../src/libmigdb.a
+
+pty_test: pty_test.c ../src/libmigdb.a
+
+clean:
+ -@rm *.o *.a test_target x11_test remote_test linux_test 2> /dev/null
+ -@rm x11_wp_test x11_cpp_test target_frames x11_fr_test 2> /dev/null
+ -@rm pty_test 2> /dev/null
+
+
diff --git a/setedit/libmigdb/examples/examples.epr.con_info b/setedit/libmigdb/examples/examples.epr.con_info
new file mode 100644
index 0000000..0211b4c
--- /dev/null
+++ b/setedit/libmigdb/examples/examples.epr.con_info
Binary files differ
diff --git a/setedit/libmigdb/examples/linux_test.c b/setedit/libmigdb/examples/linux_test.c
new file mode 100644
index 0000000..3c610dd
--- /dev/null
+++ b/setedit/libmigdb/examples/linux_test.c
@@ -0,0 +1,195 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ Linux console example/test of the libmigdb.
+ Run it from a Linux console.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+int wait_for_stop(mi_h *h)
+{
+ int res=1;
+ mi_stop *sr;
+
+ while (!mi_get_response(h))
+ usleep(1000);
+ /* The end of the async. */
+ sr=mi_res_stop(h);
+ if (sr)
+ {
+ printf("Stopped, reason: %s\n",mi_reason_enum_to_str(sr->reason));
+ mi_free_stop(sr);
+ }
+ else
+ {
+ printf("Error while waiting\n");
+ res=0;
+ }
+ return res;
+}
+
+int main(int argc, char *argv[])
+{
+ mi_aux_term *child_vt=NULL;
+ mi_bkpt *bk;
+ mi_wp *wp;
+ /* This is like a file-handle for fopen.
+ Here we have all the state of gdb "connection". */
+ mi_h *h;
+
+ /* You can use any gdb you want: */
+ /*mi_set_gdb_exe("/usr/src/gdb-6.1.1/gdb/gdb");*/
+ /* You can use a terminal different than xterm: */
+ /*mi_set_xterm_exe("/usr/bin/Eterm");*/
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Look for a free VT where we can run the child. */
+ child_vt=gmi_look_for_free_vt();
+ if (!child_vt)
+ printf("Error opening auxiliar terminal, we'll use current one.\n");
+ else
+ {
+ printf("Free VT @ %s\n",child_vt->tty);
+ printf("\n\n***************************************\n");
+ printf("Switch to the above mentioned terminal!\n");
+ printf("***************************************\n\n\n");
+ }
+
+ /* Tell gdb to attach the child to a terminal. */
+ if (!gmi_target_terminal(h,child_vt ? child_vt->tty : ttyname(STDIN_FILENO)))
+ {
+ printf("Error selecting target terminal\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./test_target","prb1 2 prb3"))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set a breakpoint. */
+ bk=gmi_break_insert(h,"test_target.cc",12);
+ if (!bk)
+ {
+ printf("Error setting breakpoint\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ printf("Breakpoint %d @ function: %s\n",bk->number,bk->func);
+
+ /* You can do things like:
+ gmi_break_delete(h,bk->number);
+ gmi_break_set_times(h,bk->number,2);
+ gmi_break_set_condition(h,bk->number,"1");
+ gmi_break_state(h,bk->number,0);*/
+ /* If we no longer need this data we can release it. */
+ mi_free_bkpt(bk);
+
+ /* Set a watchpoint, that's a data breakpoint. */
+ wp=gmi_break_watch(h,wm_write,"v");
+ if (!wp)
+ {
+ printf("Error al setting watchpoint\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ printf("Watchpoint %d for expression: %s\n",wp->number,wp->exp);
+ mi_free_wp(wp);
+
+ /* Run the program. */
+ if (!gmi_exec_run(h))
+ {
+ printf("Error in run!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be stopped at the breakpoint. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Continue execution. */
+ if (!gmi_exec_continue(h))
+ {
+ printf("Error in continue!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be terminated. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ gmi_end_aux_term(child_vt);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/pty_test.c b/setedit/libmigdb/examples/pty_test.c
new file mode 100644
index 0000000..070a3b5
--- /dev/null
+++ b/setedit/libmigdb/examples/pty_test.c
@@ -0,0 +1,141 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ Example/test of pseudo terminals.
+ Note: Contributed by Greg Watson (gwatson lanl gov)
+
+***************************************************************************/
+
+#include <stdio.h>
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+}
+
+int main(int argc, char *argv[])
+{
+ mi_pty *pty=NULL;
+ mi_h *h;
+ fd_set rfds;
+ char buf[BUFSIZ];
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Look for a free pseudo terminal. */
+ pty=gmi_look_for_free_pty();
+ if (!pty)
+ {
+ printf("Error opening pseudo terminal.\n");
+ return 1;
+ }
+
+ printf("Free pty slave = %s, master on %d\n",pty->slave,pty->master);
+
+ /* Tell gdb to attach the terminal. */
+ if (!gmi_target_terminal(h,pty->slave))
+ {
+ printf("Error selecting target terminal\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./test_target","prb1 2 prb3"))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Run the program. */
+ if (!gmi_exec_run(h))
+ {
+ printf("Error in run!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ for (;;)
+ {
+ FD_ZERO(&rfds);
+ FD_SET(pty->master,&rfds);
+ FD_SET(0,&rfds);
+
+ if (select(pty->master+1,&rfds,NULL,NULL,NULL)<0)
+ {
+ perror("select");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ if (FD_ISSET(pty->master,&rfds))
+ {
+ int n=read(pty->master,buf,BUFSIZ);
+ if (n<=0)
+ break;
+ write(1,buf,n);
+ }
+
+ if (FD_ISSET(0,&rfds))
+ {
+ int n=read(0,buf,BUFSIZ);
+ if (n<=0)
+ break;
+ write(pty->master,buf,n);
+ }
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ gmi_end_pty(pty);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/pty_test.c.orig b/setedit/libmigdb/examples/pty_test.c.orig
new file mode 100644
index 0000000..f46978c
--- /dev/null
+++ b/setedit/libmigdb/examples/pty_test.c.orig
@@ -0,0 +1,141 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ Example/test of pseudo terminals.
+ Note: Contributed by Greg Watson (gwatson lanl gov)
+
+***************************************************************************/
+
+#include <stdio.h>
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+}
+
+int main(int argc, char *argv[])
+{
+ mi_pty *pty=NULL;
+ mi_h *h;
+ fd_set rfds;
+ char buf[BUFSIZ];
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Look for a free pseudo terminal. */
+ pty=gmi_look_for_free_pty();
+ if (!pty)
+ {
+ printf("Error opening pseudo terminal.\n");
+ return 1;
+ }
+
+ printf("Free pty slave = %s, master on %d\n",pty->slave,pty->master);
+
+ /* Tell gdb to attach the terminal. */
+ if (!gmi_target_terminal(h,pty->slave))
+ {
+ printf("Error selecting target terminal\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./test_target","prb1 2 prb3"))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Run the program. */
+ if (!gmi_exec_run(h))
+ {
+ printf("Error in run!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ for (;;)
+ {
+ FD_ZERO(&rfds);
+ FD_SET(pty->master,&rfds);
+ FD_SET(0,&rfds);
+
+ if (select(pty->master+1,&rfds,NULL,NULL,NULL)<0)
+ {
+ perror("select");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ if (FD_ISSET(pty->master,&rfds))
+ {
+ int n=read(pty->master,buf,BUFSIZ);
+ if (n==0)
+ break;
+ write(1,buf,n);
+ }
+
+ if (FD_ISSET(0,&rfds))
+ {
+ int n=read(0,buf,BUFSIZ);
+ if (n==0)
+ break;
+ write(pty->master,buf,n);
+ }
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ gmi_end_pty(pty);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/remote_test.c b/setedit/libmigdb/examples/remote_test.c
new file mode 100644
index 0000000..9e76969
--- /dev/null
+++ b/setedit/libmigdb/examples/remote_test.c
@@ -0,0 +1,179 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ Remote example/test of the libmigdb.
+ To run it you must:
+
+1) Copy "test_target" to the "remote" host (it could be the same machine if
+you want).
+2) In the "remote" end run "gdbserver :6000 ./test_target 1 2 3"
+3) Run this example in the "local" end.
+
+You should edit the remote IP and port before compiling.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+// Example: "192.168.1.3:5500"
+#define REMOTE_MACHINE ":6000"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+int wait_for_stop(mi_h *h)
+{
+ mi_output *o;
+ int res=1;
+ char *aux;
+
+ while (!mi_get_response(h))
+ usleep(1000);
+ /* The end of the async. */
+ o=mi_retire_response(h);
+ if (mi_get_async_stop_reason(o,&aux))
+ printf("Stopped, reason: %s\n",aux);
+ else
+ {
+ printf("Error while waiting: %s\n",aux);
+ res=0;
+ }
+ mi_free_output(o);
+ return res;
+}
+
+int main(int argc, char *argv[])
+{
+ mi_bkpt *bk;
+ /* This is like a file-handle for fopen.
+ Here we have all the state of gdb "connection". */
+ mi_h *h;
+
+ /* You can use any gdb you want: */
+ /*mi_set_gdb_exe("/usr/src/gdb-6.1.1/gdb/gdb");*/
+ /* You can use a terminal different than xterm: */
+ /*mi_set_xterm_exe("/usr/bin/Eterm");*/
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Tell gdb to load symbols from the local copy. */
+ if (!gmi_file_symbol_file(h,"./test_target"))
+ {
+ printf("Error loading symbols\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Connect to remote machine using TCP/IP. */
+ if (!gmi_target_select(h,"extended-remote",REMOTE_MACHINE))
+ {
+ printf("Error connecting to gdb server\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set a breakpoint. */
+ bk=gmi_break_insert(h,"test_target.cc",12);
+ if (!bk)
+ {
+ printf("Error setting breakpoint\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ printf("Breakpoint %d @ function: %s\n",bk->number,bk->func);
+
+ /* You can do things like:
+ gmi_break_delete(h,bk->number);
+ gmi_break_set_times(h,bk->number,2);
+ gmi_break_set_condition(h,bk->number,"1");
+ gmi_break_state(h,bk->number,0);*/
+ /* If we no longer need this data we can release it. */
+ mi_free_bkpt(bk);
+
+ /* Run the program. */
+ /* Note that remote targets starts running and we must use continue! */
+ if (!gmi_exec_continue(h))
+ {
+ printf("Error in continue!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be stopped at the breakpoint. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Continue execution. */
+ if (!gmi_exec_continue(h))
+ {
+ printf("Error in continue!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be terminated. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/target_frames.cc b/setedit/libmigdb/examples/target_frames.cc
new file mode 100644
index 0000000..e58bbab
--- /dev/null
+++ b/setedit/libmigdb/examples/target_frames.cc
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <string.h>
+
+int v=2; struct { char *a; int q; } sup;
+
+int FuncLev2(char *str)
+{
+ v=5;
+ return strlen(str);
+}
+
+int FuncLev1(char *s, int i)
+{
+ i+=FuncLev2(s);
+ return i;
+}
+
+int main(int argc, char *argv[])
+{
+ FuncLev1("Hi!",2500);
+ printf("v=%d\n",v);
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/test.cc b/setedit/libmigdb/examples/test.cc
new file mode 100644
index 0000000..a1da0b0
--- /dev/null
+++ b/setedit/libmigdb/examples/test.cc
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ printf("%d\n",argc);
+ for (int i=0; i<=argc; i++)
+ {
+ printf("%d) %s\n",i,argv[i]);
+ }
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/test_bcd.cod b/setedit/libmigdb/examples/test_bcd.cod
new file mode 100644
index 0000000..b00c6ce
--- /dev/null
+++ b/setedit/libmigdb/examples/test_bcd.cod
Binary files differ
diff --git a/setedit/libmigdb/examples/test_target.cc b/setedit/libmigdb/examples/test_target.cc
new file mode 100644
index 0000000..83deeb6
--- /dev/null
+++ b/setedit/libmigdb/examples/test_target.cc
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+int v=3;
+
+void PrintHi(int val)
+{
+ int x=val*3;
+
+ printf("Hi! x=%d\n",x); v++;
+}
+
+int main(int argc, char *argv[])
+{
+ printf("arguments: %d\n",argc);
+ for (int i=0; i<argc; i++)
+ printf("%d: %s\n",i,argv[i]);
+ printf("*stopped,reason=\"You fool! that isn't gdb ;-)\"\n"); v=5;
+ printf("Press ENTER\n");
+ getchar();
+ PrintHi(argc);
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/ticepic.c b/setedit/libmigdb/examples/ticepic.c
new file mode 100644
index 0000000..fe5f950
--- /dev/null
+++ b/setedit/libmigdb/examples/ticepic.c
@@ -0,0 +1,196 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ X11 example/test of the libmigdb.
+ Run it from an X11 terminal (xterm, Eterm, etc.).
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+void print_frames(mi_frames *f, int free_f)
+{
+ mi_frames *ff=f;
+
+ if (!f)
+ {
+ printf("Error! empty frames info\n");
+ return;
+ }
+ while (f)
+ {
+ printf("Level %d, addr %p, func %s, where: %s:%d args? %c\n",f->level,f->addr,
+ f->func,f->file,f->line,f->args ? 'y' : 'n');
+ f=f->next;
+ }
+ if (free_f)
+ mi_free_frames(ff);
+}
+
+int wait_for_stop(mi_h *h)
+{
+ int res=1;
+ mi_stop *sr;
+
+ while (!mi_get_response(h))
+ usleep(1000);
+ /* The end of the async. */
+ sr=mi_res_stop(h);
+ if (sr)
+ {
+ printf("Stopped, reason: %s\n",mi_reason_enum_to_str(sr->reason));
+ print_frames(sr->frame,0);
+ mi_free_stop(sr);
+ }
+ else
+ {
+ printf("Error while waiting\n");
+ res=0;
+ }
+ return res;
+}
+
+void print_gvar(mi_gvar *v)
+{
+ if (!v)
+ {
+ printf("Error! failed to define variable\n");
+ return;
+ }
+ printf("Variable name: '%s', type: '%s', number of children: %d format: %s expression: %s lang: %s editable: %c\n",
+ v->name,v->type,v->numchild,mi_format_enum_to_str(v->format),
+ v->exp,mi_lang_enum_to_str(v->lang),v->attr & MI_ATTR_EDITABLE ? 'y' : 'n');
+}
+
+void print_update(mi_gvar_chg *changed)
+{
+ printf("List of changed variables:\n");
+ while (changed)
+ {
+ printf("Name: %s\nIn scope: %c\n",changed->name,changed->in_scope ? 'y' : 'n');
+ if (changed->in_scope && changed->new_type)
+ {
+ printf("New type: %s\nNew num children: %d\n",changed->new_type,changed->new_num_children);
+ }
+ changed=changed->next;
+ printf("\n");
+ }
+}
+
+void print_children(mi_gvar *ch)
+{
+ int i;
+ mi_gvar *s;
+
+ if (!ch->child)
+ {
+ printf("Error! getting children list\n");
+ return;
+ }
+ printf("\nChildren List (%d):\n",ch->numchild);
+ for (i=0, s=ch->child; i<ch->numchild; s++, i++)
+ {
+ printf("Name: %s Exp: %s Children: %d",s->name,s->exp,s->numchild);
+ if (s->type)
+ printf(" Type: %s",s->type);
+ if (s->value)
+ printf(" Value: %s",s->value);
+ printf("\n");
+ }
+ printf("\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+ mi_aux_term *xterm_tty=NULL;
+ mi_bkpt *bk;
+ mi_frames *fr;
+ /* This is like a file-handle for fopen.
+ Here we have all the state of gdb "connection". */
+ mi_h *h;
+ mi_gvar *gv, *gv2;
+ mi_gvar_chg *changed;
+ char *value;
+ int r_assign;
+
+ /* You can use any gdb you want: */
+ mi_set_gdb_exe("./icepic");
+ /* You can use a terminal different than xterm: */
+ /*mi_set_xterm_exe("/usr/bin/Eterm");*/
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./test_bcd.cod",""))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ /* Wait 5 seconds and close the auxiliar terminal. */
+ printf("Waiting 5 seconds\n");
+ sleep(5);
+ gmi_end_aux_term(xterm_tty);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/x11_cpp_test.cc b/setedit/libmigdb/examples/x11_cpp_test.cc
new file mode 100644
index 0000000..8ad493c
--- /dev/null
+++ b/setedit/libmigdb/examples/x11_cpp_test.cc
@@ -0,0 +1,164 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ X11 example/test of the libmigdb.
+ Run it from an X11 terminal (xterm, Eterm, etc.).
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+int wait_for_stop(MIDebugger &d)
+{
+ int res=1;
+ mi_stop *sr;
+
+ while (!d.Poll(sr))
+ usleep(1000);
+ /* The end of the async. */
+ if (sr)
+ {
+ printf("Stopped, reason: %s\n",mi_reason_enum_to_str(sr->reason));
+ mi_free_stop(sr);
+ }
+ else
+ {
+ printf("Error while waiting\n");
+ printf("mi_error: %d\nmi_error_from_gdb: %s\n",mi_error,mi_error_from_gdb);
+ res=0;
+ }
+ return res;
+}
+
+int DoTryRun(int res, MIDebugger &d)
+{
+ if (!res)
+ {
+ printf("Error in executing!\n");
+ return 0;
+ }
+ if (!wait_for_stop(d))
+ return 0;
+ return 1;
+}
+
+#define TryRun(a,b) if (!DoTryRun(a,b)) return 1
+
+int main(int argc, char *argv[])
+{
+ mi_bkpt *bk;
+ mi_wp *wp;
+
+ // Debugging object, used as an auto var.
+ MIDebugger d;
+
+ // You can use any gdb you want:
+ //MIDebugger::SetGDBExe("/usr/src/gdb-6.1.1/gdb/gdb");
+ // You can use a terminal different than xterm:
+ //MIDebugger::SetXTerm("/usr/bin/Eterm");
+
+ // Connect to gdb child.
+ if (!d.Connect())
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ d.SetConsoleCB(cb_console);
+ d.SetTargetCB(cb_target);
+ d.SetLogCB(cb_log);
+ d.SetAsyncCB(cb_async);
+ d.SetToGDBCB(cb_to);
+ d.SetFromGDBCB(cb_from);
+
+ // Set the name of the child and the command line aguments.
+ // It also opens the xterm.
+ if (!d.SelectTargetX11("./test_target","prb1 2 prb3"))
+ {
+ printf("Error setting exec y args\n");
+ return 1;
+ }
+
+ /* Set a breakpoint. */
+ bk=d.Breakpoint("test_target.cc",15);
+ if (!bk)
+ {
+ printf("Error setting breakpoint\n");
+ return 1;
+ }
+ printf("Breakpoint %d @ function: %s\n",bk->number,bk->func);
+
+ /* You can do things like:
+ gmi_break_delete(h,bk->number);
+ gmi_break_set_times(h,bk->number,2);
+ gmi_break_set_condition(h,bk->number,"1");
+ gmi_break_state(h,bk->number,0);*/
+ /* If we no longer need this data we can release it. */
+ mi_free_bkpt(bk);
+
+ /* Set a watchpoint, that's a data breakpoint. */
+ wp=d.Watchpoint(wm_write,"v");
+ if (!wp)
+ {
+ printf("Error al setting watchpoint\n");
+ return 1;
+ }
+ printf("Watchpoint %d for expression: %s\n",wp->number,wp->exp);
+ mi_free_wp(wp);
+
+ TryRun(d.StepOver(),d);
+ /* Run the program. */
+ TryRun(d.RunOrContinue(),d);
+ /* Here we should be stopped at the breakpoint. */
+
+ /* Continue execution. */
+ TryRun(d.RunOrContinue(),d);
+ /* Here we should be terminated. */
+
+ /* Wait 5 seconds and close the auxiliar terminal. */
+ printf("Waiting 5 seconds\n");
+ sleep(5);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/x11_fr_test.c b/setedit/libmigdb/examples/x11_fr_test.c
new file mode 100644
index 0000000..dd0f4f7
--- /dev/null
+++ b/setedit/libmigdb/examples/x11_fr_test.c
@@ -0,0 +1,329 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ X11 example/test of the libmigdb.
+ Run it from an X11 terminal (xterm, Eterm, etc.).
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+void print_frames(mi_frames *f, int free_f)
+{
+ mi_frames *ff=f;
+
+ if (!f)
+ {
+ printf("Error! empty frames info\n");
+ return;
+ }
+ while (f)
+ {
+ printf("Level %d, addr %p, func %s, where: %s:%d args? %c\n",f->level,f->addr,
+ f->func,f->file,f->line,f->args ? 'y' : 'n');
+ f=f->next;
+ }
+ if (free_f)
+ mi_free_frames(ff);
+}
+
+int wait_for_stop(mi_h *h)
+{
+ int res=1;
+ mi_stop *sr;
+
+ while (!mi_get_response(h))
+ usleep(1000);
+ /* The end of the async. */
+ sr=mi_res_stop(h);
+ if (sr)
+ {
+ printf("Stopped, reason: %s\n",mi_reason_enum_to_str(sr->reason));
+ print_frames(sr->frame,0);
+ mi_free_stop(sr);
+ }
+ else
+ {
+ printf("Error while waiting\n");
+ res=0;
+ }
+ return res;
+}
+
+void print_gvar(mi_gvar *v)
+{
+ if (!v)
+ {
+ printf("Error! failed to define variable\n");
+ return;
+ }
+ printf("Variable name: '%s', type: '%s', number of children: %d format: %s expression: %s lang: %s editable: %c\n",
+ v->name,v->type,v->numchild,mi_format_enum_to_str(v->format),
+ v->exp,mi_lang_enum_to_str(v->lang),v->attr & MI_ATTR_EDITABLE ? 'y' : 'n');
+}
+
+void print_update(mi_gvar_chg *changed)
+{
+ printf("List of changed variables:\n");
+ while (changed)
+ {
+ printf("Name: %s\nIn scope: %c\n",changed->name,changed->in_scope ? 'y' : 'n');
+ if (changed->in_scope && changed->new_type)
+ {
+ printf("New type: %s\nNew num children: %d\n",changed->new_type,changed->new_num_children);
+ }
+ changed=changed->next;
+ printf("\n");
+ }
+}
+
+void print_children(mi_gvar *ch)
+{
+ int i;
+ mi_gvar *s;
+
+ if (!ch->child)
+ {
+ printf("Error! getting children list\n");
+ return;
+ }
+ printf("\nChildren List (%d):\n",ch->numchild);
+ for (i=0, s=ch->child; i<ch->numchild; s++, i++)
+ {
+ printf("Name: %s Exp: %s Children: %d",s->name,s->exp,s->numchild);
+ if (s->type)
+ printf(" Type: %s",s->type);
+ if (s->value)
+ printf(" Value: %s",s->value);
+ printf("\n");
+ }
+ printf("\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+ mi_aux_term *xterm_tty=NULL;
+ mi_bkpt *bk;
+ mi_frames *fr;
+ /* This is like a file-handle for fopen.
+ Here we have all the state of gdb "connection". */
+ mi_h *h;
+ mi_gvar *gv, *gv2;
+ mi_gvar_chg *changed;
+ char *value;
+ int r_assign;
+
+ /* You can use any gdb you want: */
+ /*mi_set_gdb_exe("/usr/src/gdb-6.1.1/gdb/gdb");*/
+ /* You can use a terminal different than xterm: */
+ /*mi_set_xterm_exe("/usr/bin/Eterm");*/
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./target_frames",""))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Open an xterm to be used as terminal for the debuggy. */
+ xterm_tty=gmi_start_xterm();
+ if (!xterm_tty)
+ printf("Error opening auxiliar terminal, we'll use current one.\n");
+ else
+ printf("XTerm opened @ %s\n",xterm_tty->tty);
+
+ /* Tell gdb to attach the child to a terminal. */
+ if (!gmi_target_terminal(h,xterm_tty ? xterm_tty->tty : ttyname(STDIN_FILENO)))
+ {
+ printf("Error selecting target terminal\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set a breakpoint. */
+ bk=gmi_break_insert(h,"target_frames.cc",7);
+ if (!bk)
+ {
+ printf("Error setting breakpoint\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ printf("Breakpoint %d @ function: %s\n",bk->number,bk->func);
+
+ /* If we no longer need this data we can release it. */
+ mi_free_bkpt(bk);
+
+ /* Run the program. */
+ if (!gmi_exec_run(h))
+ {
+ printf("Error in run!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be stopped at the breakpoint. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Get information about the calling stack. */
+ fr=gmi_stack_list_frames(h);
+ printf("\nCalling stack:\n\n");
+ print_frames(fr,1);
+ printf("\n");
+ fr=gmi_stack_info_frame(h);
+ printf("\nCurrent frame:\n\n");
+ print_frames(fr,1);
+ printf("\n");
+ printf("Stack depth: %d\n",gmi_stack_info_depth_get(h));
+ gmi_stack_select_frame(h,1);
+ fr=gmi_stack_info_frame(h);
+ printf("\nFrame 1:\n\n");
+ print_frames(fr,1);
+ printf("\n");
+
+ if (0)
+ {
+ gv=gmi_var_create(h,-1,"v");
+ print_gvar(gv);
+ gmi_var_show_format(h,gv);
+ print_gvar(gv);
+ gmi_var_info_num_children(h,gv);
+ print_gvar(gv);
+ gmi_var_info_type(h,gv);
+ print_gvar(gv);
+ gmi_var_info_expression(h,gv);
+ print_gvar(gv);
+ gmi_var_show_attributes(h,gv);
+ print_gvar(gv);
+ }
+ else
+ {
+ gv=gmi_full_var_create(h,-1,"v");
+ print_gvar(gv);
+ }
+ gv2=gmi_full_var_create(h,-1,"sup");
+ print_gvar(gv2);
+ gmi_var_set_format(h,gv,fm_hexadecimal);
+ print_gvar(gv);
+
+ /* Continue execution. */
+ if (!gmi_exec_until(h,"target_frames.cc",21))
+ {
+ printf("Error in exec until!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ gmi_var_update(h,NULL,&changed);
+ print_update(changed);
+ mi_free_gvar_chg(changed);
+
+ r_assign=gmi_var_assign(h,gv,"i+5");
+ if (r_assign && gv->value)
+ printf("\nAssigned v=%s\n\n",gv->value);
+
+ gmi_var_list_children(h,gv2);
+ print_children(gv2);
+
+ gmi_var_evaluate_expression(h,gv2);
+ printf("\n%s = %s\n\n",gv2->exp,gv2->value);
+
+ value=gmi_data_evaluate_expression(h,gv2->exp);
+ printf("\n%s = %s\n\n",gv2->exp,value);
+ free(value);
+
+ gmi_var_delete(h,gv);
+ mi_free_gvar(gv);
+ gmi_var_delete(h,gv2);
+ mi_free_gvar(gv2);
+
+ /* Continue execution. */
+ if (!gmi_exec_continue(h))
+ {
+ printf("Error in continue!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be terminated. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ /* Wait 5 seconds and close the auxiliar terminal. */
+ printf("Waiting 5 seconds\n");
+ sleep(5);
+ gmi_end_aux_term(xterm_tty);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/x11_test.c b/setedit/libmigdb/examples/x11_test.c
new file mode 100644
index 0000000..4f2be25
--- /dev/null
+++ b/setedit/libmigdb/examples/x11_test.c
@@ -0,0 +1,192 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ X11 example/test of the libmigdb.
+ Run it from an X11 terminal (xterm, Eterm, etc.).
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+int wait_for_stop(mi_h *h)
+{
+ int res=1;
+ mi_stop *sr;
+
+ while (!mi_get_response(h))
+ usleep(1000);
+ /* The end of the async. */
+ sr=mi_res_stop(h);
+ if (sr)
+ {
+ printf("Stopped, reason: %s\n",mi_reason_enum_to_str(sr->reason));
+ mi_free_stop(sr);
+ }
+ else
+ {
+ printf("Error while waiting\n");
+ printf("mi_error: %d\nmi_error_from_gdb: %s\n",mi_error,mi_error_from_gdb);
+ res=0;
+ }
+ return res;
+}
+
+int main(int argc, char *argv[])
+{
+ mi_aux_term *xterm_tty=NULL;
+ mi_bkpt *bk;
+ mi_wp *wp;
+ /* This is like a file-handle for fopen.
+ Here we have all the state of gdb "connection". */
+ mi_h *h;
+
+ /* You can use any gdb you want: */
+ /*mi_set_gdb_exe("/usr/src/gdb-6.1.1/gdb/gdb");*/
+ /* You can use a terminal different than xterm: */
+ /*mi_set_xterm_exe("/usr/bin/Eterm");*/
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./test_target","prb1 2 prb3"))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Open an xterm to be used as terminal for the debuggy. */
+ xterm_tty=gmi_start_xterm();
+ if (!xterm_tty)
+ printf("Error opening auxiliar terminal, we'll use current one.\n");
+ else
+ printf("XTerm opened @ %s\n",xterm_tty->tty);
+
+ /* Tell gdb to attach the child to a terminal. */
+ if (!gmi_target_terminal(h,xterm_tty ? xterm_tty->tty : ttyname(STDIN_FILENO)))
+ {
+ printf("Error selecting target terminal\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set a breakpoint. */
+ bk=gmi_break_insert(h,"test_target.cc",12);
+ if (!bk)
+ {
+ printf("Error setting breakpoint\n");
+ return 1;
+ }
+ printf("Breakpoint %d @ function: %s\n",bk->number,bk->func);
+
+ /* You can do things like:
+ gmi_break_delete(h,bk->number);
+ gmi_break_set_times(h,bk->number,2);
+ gmi_break_set_condition(h,bk->number,"1");
+ gmi_break_state(h,bk->number,0);*/
+ /* If we no longer need this data we can release it. */
+ mi_free_bkpt(bk);
+
+ /* Set a watchpoint, that's a data breakpoint. */
+ wp=gmi_break_watch(h,wm_write,"v");
+ if (!wp)
+ {
+ printf("Error al setting watchpoint\n");
+ return 1;
+ }
+ printf("Watchpoint %d for expression: %s\n",wp->number,wp->exp);
+ mi_free_wp(wp);
+
+ /* Run the program. */
+ if (!gmi_exec_run(h))
+ {
+ printf("Error in run!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be stopped at the breakpoint. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Continue execution. */
+ if (!gmi_exec_continue(h))
+ {
+ printf("Error in continue!\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ /* Here we should be terminated. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ /* Wait 5 seconds and close the auxiliar terminal. */
+ printf("Waiting 5 seconds\n");
+ sleep(5);
+ gmi_end_aux_term(xterm_tty);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/examples/x11_wp_test.c b/setedit/libmigdb/examples/x11_wp_test.c
new file mode 100644
index 0000000..39bdebf
--- /dev/null
+++ b/setedit/libmigdb/examples/x11_wp_test.c
@@ -0,0 +1,292 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comment:
+ X11 example/test of the libmigdb.
+ Run it from an X11 terminal (xterm, Eterm, etc.).
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <unistd.h> //usleep
+#include "mi_gdb.h"
+
+void cb_console(const char *str, void *data)
+{
+ printf("CONSOLE> %s\n",str);
+}
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+void cb_target(const char *str, void *data)
+{
+ printf("TARGET> %s\n",str);
+}
+
+void cb_log(const char *str, void *data)
+{
+ printf("LOG> %s\n",str);
+}
+
+void cb_to(const char *str, void *data)
+{
+ printf(">> %s",str);
+}
+
+void cb_from(const char *str, void *data)
+{
+ printf("<< %s\n",str);
+}
+
+volatile int async_c=0;
+
+void cb_async(mi_output *o, void *data)
+{
+ printf("ASYNC\n");
+ async_c++;
+}
+
+void print_frames(mi_frames *f)
+{
+ if (!f)
+ {
+ printf("Error! empty frames info\n");
+ return;
+ }
+ while (f)
+ {
+ printf("Level %d, addr %p, func %s, where: %s:%d args? %c\n",f->level,f->addr,
+ f->func,f->file,f->line,f->args ? 'y' : 'n');
+ f=f->next;
+ }
+ mi_free_frames(f);
+}
+
+int wait_for_stop(mi_h *h)
+{
+ int res=1;
+ mi_stop *sr;
+
+ while (!mi_get_response(h))
+ usleep(1000);
+ /* The end of the async. */
+ sr=mi_res_stop(h);
+ if (sr)
+ {
+ printf("Stopped, reason: %s\n",mi_reason_enum_to_str(sr->reason));
+ print_frames(sr->frame);
+ mi_free_stop(sr);
+ }
+ else
+ {
+ printf("Error while waiting\n");
+ printf("mi_error: %s (%d)\nmi_error_from_gdb: %s\n",mi_get_error_str(),
+ mi_error,mi_error_from_gdb);
+ res=0;
+ }
+ return res;
+}
+
+
+void print_gvar(mi_gvar *v)
+{
+ if (!v)
+ {
+ printf("Error! failed to define variable\n");
+ return;
+ }
+ printf("Variable name: '%s', type: '%s', number of children: %d format: %s expression: %s lang: %s editable: %c\n",
+ v->name,v->type,v->numchild,mi_format_enum_to_str(v->format),
+ v->exp,mi_lang_enum_to_str(v->lang),v->attr & MI_ATTR_EDITABLE ? 'y' : 'n');
+}
+
+void print_update(mi_gvar_chg *changed)
+{
+ printf("List of changed variables:\n");
+ while (changed)
+ {
+ printf("Name: %s\nIn scope: %c\n",changed->name,changed->in_scope ? 'y' : 'n');
+ if (changed->in_scope && changed->new_type)
+ {
+ printf("New type: %s\nNew num children: %d\n",changed->new_type,changed->new_num_children);
+ }
+ changed=changed->next;
+ printf("\n");
+ }
+}
+
+void print_children(mi_gvar *ch)
+{
+ int i;
+ mi_gvar *s;
+
+ if (!ch->child)
+ {
+ printf("Error! getting children list\n");
+ return;
+ }
+ printf("\nChildren List (%d):\n",ch->numchild);
+ for (i=0, s=ch->child; i<ch->numchild; s++, i++)
+ {
+ printf("Name: %s Exp: %s Children: %d",s->name,s->exp,s->numchild);
+ if (s->type)
+ printf(" Type: %s",s->type);
+ if (s->value)
+ printf(" Value: %s",s->value);
+ printf("\n");
+ }
+ printf("\n");
+}
+
+enum cont_mode { cm_run, cm_continue, cm_finish, cm_step };
+
+void do_continue(mi_h *h, enum cont_mode mode)
+{
+ int res;
+ switch (mode)
+ {
+ case cm_run:
+ res=gmi_exec_run(h);
+ break;
+ case cm_continue:
+ res=gmi_exec_continue(h);
+ break;
+ case cm_finish:
+ res=gmi_exec_finish(h);
+ break;
+ case cm_step:
+ res=gmi_exec_step(h);
+ break;
+ }
+ /* Continue the program. */
+ if (!res)
+ {
+ printf("Error in run!\n");
+ mi_disconnect(h);
+ exit(1);
+ }
+ /* Here we should be stopped at the breakpoint. */
+ if (!wait_for_stop(h))
+ {
+ mi_disconnect(h);
+ exit(1);
+ }
+}
+
+
+int main(int argc, char *argv[])
+{
+ mi_aux_term *xterm_tty=NULL;
+ /* This is like a file-handle for fopen.
+ Here we have all the state of gdb "connection". */
+ mi_h *h;
+ mi_bkpt *bk;
+ mi_wp *wp, *wp2;
+
+ /* You can use any gdb you want: */
+ /*mi_set_gdb_exe("/usr/src/gdb-6.1.1/gdb/gdb");*/
+ /* You can use a terminal different than xterm: */
+ /*mi_set_xterm_exe("/usr/bin/Eterm");*/
+
+ /* Connect to gdb child. */
+ h=mi_connect_local();
+ if (!h)
+ {
+ printf("Connect failed\n");
+ return 1;
+ }
+ printf("Connected to gdb!\n");
+
+ /* Set all callbacks. */
+ mi_set_console_cb(h,cb_console,NULL);
+ mi_set_target_cb(h,cb_target,NULL);
+ mi_set_log_cb(h,cb_log,NULL);
+ mi_set_async_cb(h,cb_async,NULL);
+ mi_set_to_gdb_cb(h,cb_to,NULL);
+ mi_set_from_gdb_cb(h,cb_from,NULL);
+
+ /* Open an xterm to be used as terminal for the debuggy. */
+ xterm_tty=gmi_start_xterm();
+ if (!xterm_tty)
+ printf("Error opening auxiliar terminal, we'll use current one.\n");
+ else
+ printf("XTerm opened @ %s\n",xterm_tty->tty);
+
+ /* Tell gdb to attach the child to a terminal. */
+ if (!gmi_target_terminal(h,xterm_tty ? xterm_tty->tty : ttyname(STDIN_FILENO)))
+ {
+ printf("Error selecting target terminal\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Set the name of the child and the command line aguments. */
+ if (!gmi_set_exec(h,"./target_frames",""))
+ {
+ printf("Error setting exec y args\n");
+ mi_disconnect(h);
+ return 1;
+ }
+
+ /* Break on FuncLev1. */
+ bk=gmi_break_insert_full(h,1,0,NULL,-1,-1,"FuncLev1");
+ if (!bk)
+ {
+ printf("Error setting breakpoint\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ printf("Breakpoint %d @ function: %s\n",bk->number,bk->func);
+ mi_free_bkpt(bk);
+
+ /* Set a watchpoint, that's a data breakpoint. */
+ wp=gmi_break_watch(h,wm_write,"v");
+ if (!wp)
+ {
+ printf("Error al setting watchpoint\n");
+ mi_disconnect(h);
+ return 1;
+ }
+ printf("Watchpoint %d for expression: %s\n",wp->number,wp->exp);
+ mi_free_wp(wp);
+
+ /* Run the program. */
+ do_continue(h,cm_run);
+
+ wp2=gmi_break_watch(h,wm_write,"i");
+ mi_free_wp(wp2);
+
+ if (1)
+ {
+ do_continue(h,cm_finish);
+ do_continue(h,cm_finish);
+ do_continue(h,cm_finish);
+ do_continue(h,cm_continue);
+ do_continue(h,cm_continue);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ }
+ else
+ {
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ do_continue(h,cm_step);
+ }
+
+ /* Exit from gdb. */
+ gmi_gdb_exit(h);
+ /* Close the connection. */
+ mi_disconnect(h);
+ /* Wait 5 seconds and close the auxiliar terminal. */
+ printf("Waiting 5 seconds\n");
+ //sleep(5);
+ gmi_end_aux_term(xterm_tty);
+
+ return 0;
+}
diff --git a/setedit/libmigdb/files b/setedit/libmigdb/files
new file mode 100644
index 0000000..24eb2a8
--- /dev/null
+++ b/setedit/libmigdb/files
@@ -0,0 +1,14 @@
+libmigdb/doc/*.frt
+libmigdb/doc/*.html
+libmigdb/examples/Makefile
+libmigdb/examples/*.c*
+libmigdb/src/Makefile
+libmigdb/src/*.c*
+libmigdb/src/*.h
+libmigdb/files
+libmigdb/DJGPP.why
+libmigdb/GPL-license
+libmigdb/Makefile
+libmigdb/README
+libmigdb/compress.sh
+libmigdb/change.log
diff --git a/setedit/libmigdb/src/Makefile b/setedit/libmigdb/src/Makefile
new file mode 100644
index 0000000..b94d7de
--- /dev/null
+++ b/setedit/libmigdb/src/Makefile
@@ -0,0 +1,55 @@
+#!/usr/bin/make
+PREFIX=/usr
+
+all: libmigdb.a
+
+CFLAGS=-O2 -Wall -gstabs+3 -I.
+CXXFLAGS=-O2 -Wall -gstabs+3
+LDLIBS=
+
+connect.o: mi_gdb.h
+
+parse.o: mi_gdb.h
+
+cpp_int.o: mi_gdb.h
+
+prg_control.o: mi_gdb.h
+
+misc.o: mi_gdb.h
+
+breakpoint.o: mi_gdb.h
+
+target_man.o: mi_gdb.h
+
+get_free_vt.o: mi_gdb.h
+
+get_free_pty.o: mi_gdb.h
+
+data_man.o: mi_gdb.h
+
+stack_man.o: mi_gdb.h
+
+symbol_query.o: mi_gdb.h
+
+thread.o: mi_gdb.h
+
+var_obj.o: mi_gdb.h
+
+alloc.o: mi_gdb.h
+
+error.o: mi_gdb.h
+
+libmigdb.a: connect.o parse.o prg_control.o misc.o breakpoint.o target_man.o \
+ get_free_vt.o get_free_pty.o data_man.o stack_man.o symbol_query.o \
+ thread.o var_obj.o alloc.o error.o cpp_int.o
+ ar rcs $@ $^
+
+clean:
+ -@rm *.o *.a 2> /dev/null
+
+install:
+ install -d -m 755 $(PREFIX)/lib
+ install -m 644 libmigdb.a $(PREFIX)/lib
+ install -d -m 755 $(PREFIX)/include
+ install -m 644 mi_gdb.h $(PREFIX)/include
+
diff --git a/setedit/libmigdb/src/alloc.c b/setedit/libmigdb/src/alloc.c
new file mode 100644
index 0000000..e2e2aee
--- /dev/null
+++ b/setedit/libmigdb/src/alloc.c
@@ -0,0 +1,307 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Allocator.
+ Comments:
+ Most alloc/free routines are here. Free routines must accept NULL
+pointers. Alloc functions must set mi_error.@p
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+void *mi_calloc(size_t count, size_t sz)
+{
+ void *res=calloc(count,sz);
+ if (!res)
+ mi_error=MI_OUT_OF_MEMORY;
+ return res;
+}
+
+void *mi_calloc1(size_t sz)
+{
+ return mi_calloc(1,sz);
+}
+
+char *mi_malloc(size_t sz)
+{
+ char *res=malloc(sz);
+ if (!res)
+ mi_error=MI_OUT_OF_MEMORY;
+ return res;
+}
+
+mi_results *mi_alloc_results(void)
+{
+ return (mi_results *)mi_calloc1(sizeof(mi_results));
+}
+
+mi_output *mi_alloc_output(void)
+{
+ return (mi_output *)mi_calloc1(sizeof(mi_output));
+}
+
+mi_frames *mi_alloc_frames(void)
+{
+ return (mi_frames *)mi_calloc1(sizeof(mi_frames));
+}
+
+mi_gvar *mi_alloc_gvar(void)
+{
+ return (mi_gvar *)mi_calloc1(sizeof(mi_gvar));
+}
+
+mi_gvar_chg *mi_alloc_gvar_chg(void)
+{
+ return (mi_gvar_chg *)mi_calloc1(sizeof(mi_gvar_chg));
+}
+
+mi_bkpt *mi_alloc_bkpt(void)
+{
+ mi_bkpt *b=(mi_bkpt *)mi_calloc1(sizeof(mi_bkpt));
+ if (b)
+ {
+ b->thread=-1;
+ b->ignore=-1;
+ }
+ return b;
+}
+
+mi_wp *mi_alloc_wp(void)
+{
+ return (mi_wp *)mi_calloc1(sizeof(mi_wp));
+}
+
+mi_stop *mi_alloc_stop(void)
+{
+ return (mi_stop *)mi_calloc1(sizeof(mi_stop));
+}
+
+mi_asm_insns *mi_alloc_asm_insns(void)
+{
+ return (mi_asm_insns *)mi_calloc1(sizeof(mi_asm_insns));
+}
+
+mi_asm_insn *mi_alloc_asm_insn(void)
+{
+ return (mi_asm_insn *)mi_calloc1(sizeof(mi_asm_insn));
+}
+
+mi_chg_reg *mi_alloc_chg_reg(void)
+{
+ return (mi_chg_reg *)mi_calloc1(sizeof(mi_chg_reg));
+}
+
+/*****************************************************************************
+ Free functions
+*****************************************************************************/
+
+void mi_free_frames(mi_frames *f)
+{
+ mi_frames *aux;
+
+ while (f)
+ {
+ free(f->func);
+ free(f->file);
+ mi_free_results(f->args);
+ aux=f->next;
+ free(f);
+ f=aux;
+ }
+}
+
+void mi_free_bkpt(mi_bkpt *b)
+{
+ mi_bkpt *aux;
+
+ while (b)
+ {
+ free(b->func);
+ free(b->file);
+ free(b->file_abs);
+ free(b->cond);
+ aux=b->next;
+ free(b);
+ b=aux;
+ }
+}
+
+void mi_free_gvar(mi_gvar *v)
+{
+ mi_gvar *aux;
+
+ while (v)
+ {
+ free(v->name);
+ free(v->type);
+ free(v->exp);
+ free(v->value);
+ if (v->numchild && v->child)
+ mi_free_gvar(v->child);
+ aux=v->next;
+ free(v);
+ v=aux;
+ }
+}
+
+void mi_free_gvar_chg(mi_gvar_chg *p)
+{
+ mi_gvar_chg *aux;
+
+ while (p)
+ {
+ free(p->name);
+ free(p->new_type);
+ aux=p->next;
+ free(p);
+ p=aux;
+ }
+}
+
+void mi_free_results_but(mi_results *r, mi_results *no)
+{
+ mi_results *aux;
+
+ while (r)
+ {
+ if (r==no)
+ {
+ aux=r->next;
+ r->next=NULL;
+ r=aux;
+ }
+ else
+ {
+ free(r->var);
+ switch (r->type)
+ {
+ case t_const:
+ free(r->v.cstr);
+ break;
+ case t_tuple:
+ case t_list:
+ mi_free_results_but(r->v.rs,no);
+ break;
+ }
+ aux=r->next;
+ free(r);
+ r=aux;
+ }
+ }
+}
+
+void mi_free_results(mi_results *r)
+{
+ mi_free_results_but(r,NULL);
+}
+
+void mi_free_output_but(mi_output *r, mi_output *no, mi_results *no_r)
+{
+ mi_output *aux;
+
+ while (r)
+ {
+ if (r==no)
+ {
+ aux=r->next;
+ r->next=NULL;
+ r=aux;
+ }
+ else
+ {
+ if (r->c)
+ mi_free_results_but(r->c,no_r);
+ aux=r->next;
+ free(r);
+ r=aux;
+ }
+ }
+}
+
+void mi_free_output(mi_output *r)
+{
+ mi_free_output_but(r,NULL,NULL);
+}
+
+void mi_free_stop(mi_stop *s)
+{
+ if (!s)
+ return;
+ mi_free_frames(s->frame);
+ mi_free_wp(s->wp);
+ free(s->wp_old);
+ free(s->wp_val);
+ free(s->gdb_result_var);
+ free(s->return_value);
+ free(s->signal_name);
+ free(s->signal_meaning);
+ free(s);
+}
+
+void mi_free_wp(mi_wp *wp)
+{
+ mi_wp *aux;
+ while (wp)
+ {
+ free(wp->exp);
+ aux=wp->next;
+ free(wp);
+ wp=aux;
+ }
+}
+
+void mi_free_asm_insns(mi_asm_insns *i)
+{
+ mi_asm_insns *aux;
+
+ while (i)
+ {
+ free(i->file);
+ mi_free_asm_insn(i->ins);
+ aux=i->next;
+ free(i);
+ i=aux;
+ }
+}
+
+void mi_free_asm_insn(mi_asm_insn *i)
+{
+ mi_asm_insn *aux;
+
+ while (i)
+ {
+ free(i->func);
+ free(i->inst);
+ aux=i->next;
+ free(i);
+ i=aux;
+ }
+}
+
+/*void mi_free_charp_list(char **l)
+{
+ char **c=l;
+ while (c)
+ {
+ free(*c);
+ c++;
+ }
+ free(l);
+}*/
+
+void mi_free_chg_reg(mi_chg_reg *r)
+{
+ mi_chg_reg *aux;
+ while (r)
+ {
+ free(r->val);
+ free(r->name);
+ aux=r->next;
+ free(r);
+ r=aux;
+ }
+}
+
diff --git a/setedit/libmigdb/src/breakpoint.c b/setedit/libmigdb/src/breakpoint.c
new file mode 100644
index 0000000..645c274
--- /dev/null
+++ b/setedit/libmigdb/src/breakpoint.c
@@ -0,0 +1,265 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Breakpoint table commands.
+ Comments:
+ GDB/MI commands for the "Breakpoint Table Commands" section.@p
+
+@<pre>
+gdb command: Implemented?
+
+-break-after Yes
+-break-condition Yes
+-break-delete Yes
+-break-disable Yes
+-break-enable Yes
+-break-info N.A. (info break NUMBER) (*)
+-break-insert Yes
+-break-list No (*)
+-break-watch Yes
+@</pre>
+
+(*) I think the program should keep track of the breakpoints, so it will
+be implemented when I have more time.@p
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_break_insert_fl(mi_h *h, const char *file, int line)
+{
+ mi_send(h,"-break-insert %s:%d\n",file,line);
+}
+
+void mi_break_insert(mi_h *h, int temporary, int hard_assist,
+ const char *cond, int count, int thread,
+ const char *where)
+{
+ char s_count[32];
+ char s_thread[32];
+
+ if (count>=0)
+ snprintf(s_count,32,"%d",count);
+ if (thread>=0)
+ snprintf(s_thread,32,"%d",thread);
+ if (cond)
+ // Conditions may contain spaces, in fact, if they don't gdb will add
+ // them after parsing. Enclosing the expression with "" solves the
+ // problem.
+ mi_send(h,"-break-insert %s %s -c \"%s\" %s %s %s %s %s\n",
+ temporary ? "-t" : "",
+ hard_assist ? "-h" : "",
+ cond,
+ count>=0 ? "-i" : "", count>=0 ? s_count : "",
+ thread>=0 ? "-p" : "", thread>=0 ? s_thread : "",
+ where);
+ else
+ mi_send(h,"-break-insert %s %s %s %s %s %s %s\n",
+ temporary ? "-t" : "",
+ hard_assist ? "-h" : "",
+ count>=0 ? "-i" : "", count>=0 ? s_count : "",
+ thread>=0 ? "-p" : "", thread>=0 ? s_thread : "",
+ where);
+}
+
+void mi_break_insert_flf(mi_h *h, const char *file, int line, int temporary,
+ int hard_assist, const char *cond, int count,
+ int thread)
+{
+ char s_count[32];
+ char s_thread[32];
+
+ if (count>=0)
+ snprintf(s_count,32,"%d",count);
+ if (thread>=0)
+ snprintf(s_thread,32,"%d",thread);
+ mi_send(h,"-break-insert %s %s %s %s %s %s %s %s %s:%d\n",
+ temporary ? "-t" : "",
+ hard_assist ? "-h" : "",
+ cond ? "-c" : "", cond ? cond : "",
+ count>=0 ? "-i" : "", count>=0 ? s_count : "",
+ thread>=0 ? "-p" : "", thread>=0 ? s_thread : "",
+ file,line);
+}
+
+void mi_break_delete(mi_h *h, int number)
+{
+ mi_send(h,"-break-delete %d\n",number);
+}
+
+void mi_break_after(mi_h *h, int number, int count)
+{
+ mi_send(h,"-break-after %d %d\n",number,count);
+}
+
+void mi_break_condition(mi_h *h, int number, const char *condition)
+{
+ mi_send(h,"-break-condition %d %s\n",number,condition);
+}
+
+void mi_break_enable(mi_h *h, int number)
+{
+ mi_send(h,"-break-enable %d\n",number);
+}
+
+void mi_break_disable(mi_h *h, int number)
+{
+ mi_send(h,"-break-disable %d\n",number);
+}
+
+void mi_break_watch(mi_h *h, enum mi_wp_mode mode, const char *exp)
+{
+ if (mode==wm_write)
+ mi_send(h,"-break-watch \"%s\"\n",exp);
+ else
+ mi_send(h,"-break-watch -%c \"%s\"\n",mode==wm_rw ? 'a' : 'r',exp);
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ Insert a breakpoint at file:line.
+
+ Command: -break-insert file:line
+ Return: A new mi_bkpt structure with info about the breakpoint. NULL on
+error.
+
+***************************************************************************/
+
+mi_bkpt *gmi_break_insert(mi_h *h, const char *file, int line)
+{
+ mi_break_insert_fl(h,file,line);
+ return mi_res_bkpt(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Insert a breakpoint, all available options.
+
+ Command: -break-insert
+ Return: A new mi_bkpt structure with info about the breakpoint. NULL on
+error.
+
+***************************************************************************/
+
+mi_bkpt *gmi_break_insert_full(mi_h *h, int temporary, int hard_assist,
+ const char *cond, int count, int thread,
+ const char *where)
+{
+ mi_break_insert(h,temporary,hard_assist,cond,count,thread,where);
+ return mi_res_bkpt(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Insert a breakpoint, all available options.
+
+ Command: -break-insert [ops] file:line
+ Return: A new mi_bkpt structure with info about the breakpoint. NULL on
+error.
+
+***************************************************************************/
+
+mi_bkpt *gmi_break_insert_full_fl(mi_h *h, const char *file, int line,
+ int temporary, int hard_assist,
+ const char *cond, int count, int thread)
+{
+ mi_break_insert_flf(h,file,line,temporary,hard_assist,cond,count,thread);
+ return mi_res_bkpt(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Remove a breakpoint.
+
+ Command: -break-delete
+ Return: !=0 OK. Note that gdb always says OK, but errors can be sent to the
+console.
+
+***************************************************************************/
+
+int gmi_break_delete(mi_h *h, int number)
+{
+ mi_break_delete(h,number);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Modify the "ignore" count for a breakpoint.
+
+ Command: -break-after
+ Return: !=0 OK. Note that gdb always says OK, but errors can be sent to the
+console.
+
+***************************************************************************/
+
+int gmi_break_set_times(mi_h *h, int number, int count)
+{
+ mi_break_after(h,number,count);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Associate a condition with the breakpoint.
+
+ Command: -break-condition
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_break_set_condition(mi_h *h, int number, const char *condition)
+{
+ mi_break_condition(h,number,condition);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Enable or disable a breakpoint.
+
+ Command: -break-enable + -break-disable
+ Return: !=0 OK. Note that gdb always says OK, but errors can be sent to the
+console.
+
+***************************************************************************/
+
+int gmi_break_state(mi_h *h, int number, int enable)
+{
+ if (enable)
+ mi_break_enable(h,number);
+ else
+ mi_break_disable(h,number);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Set a watchpoint. It doesn't work for remote targets!
+
+ Command: -break-watch
+ Return: A new mi_wp structure with info about the watchpoint. NULL on
+error.
+
+***************************************************************************/
+
+mi_wp *gmi_break_watch(mi_h *h, enum mi_wp_mode mode, const char *exp)
+{
+ mi_break_watch(h,mode,exp);
+ return mi_res_wp(h);
+}
+
diff --git a/setedit/libmigdb/src/connect.c b/setedit/libmigdb/src/connect.c
new file mode 100644
index 0000000..b44fe96
--- /dev/null
+++ b/setedit/libmigdb/src/connect.c
@@ -0,0 +1,824 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Connect.
+ Comments:
+ This module handles the dialog with gdb, including starting and stopping
+gdb.@p
+
+GDB Bug workaround for "file -readnow": I tried to workaround a bug using
+it but looks like this option also have bugs!!!! so I have to use the
+command line option --readnow.
+It also have a bug!!!! when the binary is changed and gdb must reload it
+this option is ignored. So it looks like we have no solution but 3 gdb bugs
+in a row.
+
+***************************************************************************/
+
+#define _GNU_SOURCE
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include "mi_gdb.h"
+
+#ifndef TEMP_FAILURE_RETRY
+ #define TEMP_FAILURE_RETRY(a) (a)
+#endif
+
+int mi_error=MI_OK;
+char *mi_error_from_gdb=NULL;
+static char *gdb_exe=NULL;
+static char *xterm_exe=NULL;
+static char *main_func=NULL;
+static char disable_psym_search_workaround=0;
+
+mi_h *mi_alloc_h()
+{
+ mi_h *h=(mi_h *)calloc(1,sizeof(mi_h));
+ if (!h)
+ {
+ mi_error=MI_OUT_OF_MEMORY;
+ return NULL;
+ }
+ h->to_gdb[0]=h->to_gdb[1]=h->from_gdb[0]=h->from_gdb[1]=-1;
+ h->pid=-1;
+ return h;
+}
+
+int mi_check_running_pid(pid_t pid)
+{
+ int status;
+
+ if (pid<=0)
+ return 0;
+ /* If waitpid returns the number of our child means it communicated
+ to as a termination status. */
+ if (waitpid(pid,&status,WNOHANG)==pid)
+ {
+ pid=0;
+ return 0;
+ }
+ return 1;
+}
+
+int mi_check_running(mi_h *h)
+{
+ return !h->died && mi_check_running_pid(h->pid);
+}
+
+void mi_kill_child(pid_t pid)
+{
+ kill(pid,SIGTERM);
+ usleep(100000);
+ if (mi_check_running_pid(pid))
+ {
+ int status;
+ kill(pid,SIGKILL);
+ waitpid(pid,&status,0);
+ }
+}
+
+void mi_free_h(mi_h **handle)
+{
+ mi_h *h=*handle;
+ if (h->to_gdb[0]>=0)
+ close(h->to_gdb[0]);
+ if (h->to)
+ fclose(h->to);
+ else if (h->to_gdb[1]>=0)
+ close(h->to_gdb[1]);
+ if (h->from)
+ fclose(h->from);
+ else if (h->from_gdb[0]>=0)
+ close(h->from_gdb[0]);
+ if (h->from_gdb[1]>=0)
+ close(h->from_gdb[1]);
+ if (mi_check_running(h))
+ {/* GDB is running! */
+ mi_kill_child(h->pid);
+ }
+ if (h->line)
+ free(h->line);
+ mi_free_output(h->po);
+ free(h->catched_console);
+ free(h);
+ *handle=NULL;
+}
+
+void mi_set_nonblk(int h)
+{
+ int flf;
+ flf=fcntl(h,F_GETFL,0);
+ flf=flf | O_NONBLOCK;
+ fcntl(h,F_SETFL,flf);
+}
+
+int mi_getline(mi_h *h)
+{
+ char c;
+
+ while (read(h->from_gdb[0],&c,1)==1)
+ {
+ if (h->lread>=h->llen)
+ {
+ h->llen=h->lread+128;
+ h->line=(char *)realloc(h->line,h->llen);
+ if (!h->line)
+ {
+ h->llen=0;
+ h->lread=0;
+ return -1;
+ }
+ }
+ if (c=='\n')
+ {
+ int ret=h->lread;
+ h->line[ret]=0;
+ h->lread=0;
+ return ret;
+ }
+ h->line[h->lread]=c;
+ h->lread++;
+ }
+ return 0;
+}
+
+char *get_cstr(mi_output *o)
+{
+ if (!o->c || o->c->type!=t_const)
+ return NULL;
+ return o->c->v.cstr;
+}
+
+int mi_get_response(mi_h *h)
+{
+ int l=mi_getline(h);
+ if (!l)
+ return 0;
+
+ if (h->from_gdb_echo)
+ h->from_gdb_echo(h->line,h->from_gdb_echo_data);
+ if (strncmp(h->line,"(gdb)",5)==0)
+ {/* End of response. */
+ return 1;
+ }
+ else
+ {/* Add to the response. */
+ mi_output *o;
+ int add=1, is_exit=0;
+ o=mi_parse_gdb_output(h->line);
+
+ if (!o)
+ return 0;
+ /* Tunneled streams callbacks. */
+ if (o->type==MI_T_OUT_OF_BAND && o->stype==MI_ST_STREAM)
+ {
+ char *aux;
+ add=0;
+ switch (o->sstype)
+ {
+ case MI_SST_CONSOLE:
+ aux=get_cstr(o);
+ if (h->console)
+ h->console(aux,h->console_data);
+ if (h->catch_console && aux)
+ {
+ h->catch_console--;
+ if (!h->catch_console)
+ {
+ free(h->catched_console);
+ h->catched_console=strdup(aux);
+ }
+ }
+ break;
+ case MI_SST_TARGET:
+ /* This one seems to be useless. */
+ if (h->target)
+ h->target(get_cstr(o),h->target_data);
+ break;
+ case MI_SST_LOG:
+ if (h->log)
+ h->log(get_cstr(o),h->log_data);
+ break;
+ }
+ }
+ else if (o->type==MI_T_OUT_OF_BAND && o->stype==MI_ST_ASYNC)
+ {
+ if (h->async)
+ h->async(o,h->async_data);
+ }
+ else if (o->type==MI_T_RESULT_RECORD && o->tclass==MI_CL_ERROR)
+ {/* Error from gdb, record it. */
+ mi_error=MI_FROM_GDB;
+ free(mi_error_from_gdb);
+ mi_error_from_gdb=NULL;
+ if (o->c && strcmp(o->c->var,"msg")==0 && o->c->type==t_const)
+ mi_error_from_gdb=strdup(o->c->v.cstr);
+ }
+ is_exit=(o->type==MI_T_RESULT_RECORD && o->tclass==MI_CL_EXIT);
+ /* Add to the list of responses. */
+ if (add)
+ {
+ if (h->last)
+ h->last->next=o;
+ else
+ h->po=o;
+ h->last=o;
+ }
+ else
+ mi_free_output(o);
+ /* Exit RR means gdb exited, we won't get a new prompt ;-) */
+ if (is_exit)
+ return 1;
+ }
+
+ return 0;
+}
+
+mi_output *mi_retire_response(mi_h *h)
+{
+ mi_output *ret=h->po;
+ h->po=h->last=NULL;
+ return ret;
+}
+
+mi_output *mi_get_response_blk(mi_h *h)
+{
+ int r;
+ /* Sometimes gdb dies. */
+ if (!mi_check_running(h))
+ {
+ h->died=1;
+ mi_error=MI_GDB_DIED;
+ return NULL;
+ }
+ do
+ {
+ if (1)
+ {
+ /*
+ That's a must. If we just keep trying to read and failing things
+ become really sloooowwww. Instead we try and if it fails we wait
+ until something is available.
+ TODO: Implement something with the time out, a callback to ask the
+ application is we have to wait or not could be a good thing.
+ */
+ fd_set set;
+ struct timeval timeout;
+ int ret;
+
+ r=mi_get_response(h);
+ if (r)
+ return mi_retire_response(h);
+
+ FD_ZERO(&set);
+ FD_SET(h->from_gdb[0],&set);
+ timeout.tv_sec=h->time_out;
+ timeout.tv_usec=0;
+ ret=TEMP_FAILURE_RETRY(select(FD_SETSIZE,&set,NULL,NULL,&timeout));
+ if (!ret)
+ {
+ if (!mi_check_running(h))
+ {
+ h->died=1;
+ mi_error=MI_GDB_DIED;
+ return NULL;
+ }
+ if (h->time_out_cb)
+ ret=h->time_out_cb(h->time_out_cb_data);
+ if (!ret)
+ {
+ mi_error=MI_GDB_TIME_OUT;
+ return NULL;
+ }
+ }
+ }
+ else
+ {
+ r=mi_get_response(h);
+ if (r)
+ return mi_retire_response(h);
+ else
+ usleep(100);
+ }
+ }
+ while (!r);
+
+ return NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Connect to a local copy of gdb. Note that the mi_h structure is something
+similar to a "FILE *" for stdio.
+
+ Return: A new mi_h structure or NULL on error.
+
+***************************************************************************/
+
+mi_h *mi_connect_local()
+{
+ mi_h *h;
+ const char *gdb=mi_get_gdb_exe();
+
+ /* Start without error. */
+ mi_error=MI_OK;
+ /* Verify we have a GDB binary. */
+ if (access(gdb,X_OK))
+ {
+ mi_error=MI_MISSING_GDB;
+ return NULL;
+ }
+ /* Alloc the handle structure. */
+ h=mi_alloc_h();
+ if (!h)
+ return h;
+ h->time_out=MI_DEFAULT_TIME_OUT;
+ /* Create the pipes to connect with the child. */
+ if (pipe(h->to_gdb) || pipe(h->from_gdb))
+ {
+ mi_error=MI_PIPE_CREATE;
+ mi_free_h(&h);
+ return NULL;
+ }
+ mi_set_nonblk(h->to_gdb[1]);
+ mi_set_nonblk(h->from_gdb[0]);
+ /* Associate streams to the file handles. */
+ h->to=fdopen(h->to_gdb[1],"w");
+ h->from=fdopen(h->from_gdb[0],"r");
+ if (!h->to || !h->from)
+ {
+ mi_error=MI_PIPE_CREATE;
+ mi_free_h(&h);
+ return NULL;
+ }
+ /* Create the child. */
+ h->pid=fork();
+ if (h->pid==0)
+ {/* We are the child. */
+ char *argv[5];
+ /* Connect stdin/out to the pipes. */
+ dup2(h->to_gdb[0],STDIN_FILENO);
+ dup2(h->from_gdb[1],STDOUT_FILENO);
+ /* Pass the control to gdb. */
+ argv[0]=(char *)gdb; /* Is that OK? */
+ argv[1]="--interpreter=mi";
+ argv[2]="--quiet";
+ argv[3]=disable_psym_search_workaround ? 0 : "--readnow";
+ argv[4]=0;
+ execvp(argv[0],argv);
+ /* We get here only if exec failed. */
+ _exit(127);
+ }
+ /* We are the parent. */
+ if (h->pid==-1)
+ {/* Fork failed. */
+ mi_error=MI_FORK;
+ mi_free_h(&h);
+ return NULL;
+ }
+ if (!mi_check_running(h))
+ {
+ mi_error=MI_DEBUGGER_RUN;
+ mi_free_h(&h);
+ return NULL;
+ }
+ /* Wait for the prompt. */
+ mi_get_response_blk(h);
+
+ return h;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Close connection. You should ask gdb to quit first @x{gmi_gdb_exit}.
+
+***************************************************************************/
+
+void mi_disconnect(mi_h *h)
+{
+ mi_free_h(&h);
+ free(mi_error_from_gdb);
+ mi_error_from_gdb=NULL;
+}
+
+void mi_set_console_cb(mi_h *h, stream_cb cb, void *data)
+{
+ h->console=cb;
+ h->console_data=data;
+}
+
+void mi_set_target_cb(mi_h *h, stream_cb cb, void *data)
+{
+ h->target=cb;
+ h->target_data=data;
+}
+
+void mi_set_log_cb(mi_h *h, stream_cb cb, void *data)
+{
+ h->log=cb;
+ h->log_data=data;
+}
+
+stream_cb mi_get_console_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->console_data;
+ return h->console;
+}
+
+stream_cb mi_get_target_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->target_data;
+ return h->target;
+}
+
+stream_cb mi_get_log_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->log_data;
+ return h->log;
+}
+
+void mi_set_async_cb(mi_h *h, async_cb cb, void *data)
+{
+ h->async=cb;
+ h->async_data=data;
+}
+
+async_cb mi_get_async_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->async_data;
+ return h->async;
+}
+
+void mi_set_to_gdb_cb(mi_h *h, stream_cb cb, void *data)
+{
+ h->to_gdb_echo=cb;
+ h->to_gdb_echo_data=data;
+}
+
+void mi_set_from_gdb_cb(mi_h *h, stream_cb cb, void *data)
+{
+ h->from_gdb_echo=cb;
+ h->from_gdb_echo_data=data;
+}
+
+stream_cb mi_get_to_gdb_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->to_gdb_echo_data;
+ return h->to_gdb_echo;
+}
+
+stream_cb mi_get_from_gdb_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->from_gdb_echo_data;
+ return h->from_gdb_echo;
+}
+
+void mi_set_time_out_cb(mi_h *h, tm_cb cb, void *data)
+{
+ h->time_out_cb=cb;
+ h->time_out_cb_data=data;
+}
+
+tm_cb mi_get_time_out_cb(mi_h *h, void **data)
+{
+ if (data)
+ *data=h->time_out_cb_data;
+ return h->time_out_cb;
+}
+
+void mi_set_time_out(mi_h *h, int to)
+{
+ h->time_out=to;
+}
+
+int mi_get_time_out(mi_h *h)
+{
+ return h->time_out;
+}
+
+int mi_send(mi_h *h, const char *format, ...)
+{
+ int ret;
+ char *str;
+ va_list argptr;
+
+ if (h->died)
+ return 0;
+
+ va_start(argptr,format);
+ ret=vasprintf(&str,format,argptr);
+ va_end(argptr);
+ fputs(str,h->to);
+ fflush(h->to);
+ if (h->to_gdb_echo)
+ h->to_gdb_echo(str,h->to_gdb_echo_data);
+ free(str);
+
+ return ret;
+}
+
+void mi_clean_up_globals()
+{
+ free(gdb_exe);
+ gdb_exe=NULL;
+ free(xterm_exe);
+ xterm_exe=NULL;
+ free(main_func);
+ main_func=NULL;
+}
+
+void mi_register_exit()
+{
+ static int registered=0;
+ if (!registered)
+ {
+ registered=1;
+ atexit(mi_clean_up_globals);
+ }
+}
+
+void mi_set_gdb_exe(const char *name)
+{
+ free(gdb_exe);
+ gdb_exe=name ? strdup(name) : NULL;
+ mi_register_exit();
+}
+
+static
+char *mi_search_in_path(const char *file)
+{
+ char *path, *pt, *r;
+ char test[PATH_MAX];
+ struct stat st;
+
+ path=getenv("PATH");
+ if (!path)
+ return NULL;
+ pt=strdup(path);
+ r=strtok(pt,":");
+ while (r)
+ {
+ strcpy(test,r);
+ strcat(test,"/");
+ strcat(test,file);
+ if (stat(test,&st)==0 && S_ISREG(st.st_mode))
+ {
+ free(pt);
+ return strdup(test);
+ }
+ r=strtok(NULL,":");
+ }
+ free(pt);
+ return NULL;
+}
+
+const char *mi_get_gdb_exe()
+{
+ if (!gdb_exe)
+ {/* Look for gdb in path */
+ gdb_exe=mi_search_in_path("gdb");
+ if (!gdb_exe)
+ return "/usr/bin/gdb";
+ }
+ return gdb_exe;
+}
+
+void mi_set_xterm_exe(const char *name)
+{
+ free(xterm_exe);
+ xterm_exe=name ? strdup(name) : NULL;
+ mi_register_exit();
+}
+
+const char *mi_get_xterm_exe()
+{
+ if (!xterm_exe)
+ {/* Look for xterm in path */
+ xterm_exe=mi_search_in_path("xterm");
+ if (!xterm_exe)
+ return "/usr/bin/X11/xterm";
+ }
+ return xterm_exe;
+}
+
+void mi_set_main_func(const char *name)
+{
+ free(main_func);
+ main_func=name ? strdup(name) : NULL;
+ mi_register_exit();
+}
+
+const char *mi_get_main_func()
+{
+ if (main_func)
+ return main_func;
+ return "main";
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Opens a new xterm to be used by the child process to debug.
+
+ Return: A new mi_aux_term structure, you can use @x{gmi_end_aux_term} to
+release it.
+
+***************************************************************************/
+
+mi_aux_term *gmi_start_xterm()
+{
+ char nsh[14]="/tmp/shXXXXXX";
+ char ntt[14]="/tmp/ttXXXXXX";
+ const char *xterm;
+ struct stat st;
+ int hsh, htt=-1;
+ mi_aux_term *res=NULL;
+ FILE *f;
+ pid_t pid;
+ char buf[PATH_MAX];
+
+ /* Verify we have an X terminal. */
+ xterm=mi_get_xterm_exe();
+ if (access(xterm,X_OK))
+ {
+ mi_error=MI_MISSING_XTERM;
+ return NULL;
+ }
+
+ /* Create 2 temporals. */
+ hsh=mkstemp(nsh);
+ if (hsh==-1)
+ {
+ mi_error=MI_CREATE_TEMPORAL;
+ return NULL;
+ }
+ htt=mkstemp(ntt);
+ if (htt==-1)
+ {
+ close(hsh);
+ unlink(nsh);
+ mi_error=MI_CREATE_TEMPORAL;
+ return NULL;
+ }
+ close(htt);
+ /* Create the script. */
+ f=fdopen(hsh,"w");
+ if (!f)
+ {
+ close(hsh);
+ unlink(nsh);
+ unlink(ntt);
+ mi_error=MI_CREATE_TEMPORAL;
+ return NULL;
+ }
+ fprintf(f,"#!/bin/sh\n");
+ fprintf(f,"tty > %s\n",ntt);
+ fprintf(f,"rm %s\n",nsh);
+ fprintf(f,"sleep 365d\n");
+ fclose(f);
+ /* Spawn xterm. */
+ /* Create the child. */
+ pid=fork();
+ if (pid==0)
+ {/* We are the child. */
+ char *argv[5];
+ /* Pass the control to gdb. */
+ argv[0]=(char *)mi_get_xterm_exe(); /* Is that ok? */
+ argv[1]="-e";
+ argv[2]="/bin/sh";
+ argv[3]=nsh;
+ argv[4]=0;
+ execvp(argv[0],argv);
+ /* We get here only if exec failed. */
+ unlink(nsh);
+ unlink(ntt);
+ _exit(127);
+ }
+ /* We are the parent. */
+ if (pid==-1)
+ {/* Fork failed. */
+ unlink(nsh);
+ unlink(ntt);
+ mi_error=MI_FORK;
+ return NULL;
+ }
+ /* Wait until the shell is deleted. */
+ while (stat(nsh,&st)==0)
+ usleep(1000);
+ /* Try to read the tty name. */
+ f=fopen(ntt,"rt");
+ if (f)
+ {
+ if (fgets(buf,PATH_MAX,f))
+ {
+ char *s; /* Strip the \n. */
+ for (s=buf; *s && *s!='\n'; s++);
+ *s=0;
+ res=(mi_aux_term *)malloc(sizeof(mi_aux_term));
+ if (res)
+ {
+ res->pid=pid;
+ res->tty=strdup(buf);
+ }
+ }
+ fclose(f);
+ }
+ unlink(ntt);
+ return res;
+}
+
+void mi_free_aux_term(mi_aux_term *t)
+{
+ if (!t)
+ return;
+ free(t->tty);
+ free(t);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the auxiliar terminal and releases the allocated memory.
+
+***************************************************************************/
+
+void gmi_end_aux_term(mi_aux_term *t)
+{
+ if (!t)
+ return;
+ if (t->pid!=-1 && mi_check_running_pid(t->pid))
+ mi_kill_child(t->pid);
+ mi_free_aux_term(t);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Forces the MI version. Currently the library can't detect it so you must
+force it manually. GDB 5.x implemented MI v1 and 6.x v2.
+
+***************************************************************************/
+
+void mi_force_version(mi_h *h, unsigned vMajor, unsigned vMiddle,
+ unsigned vMinor)
+{
+ h->version=MI_VERSION2U(vMajor,vMiddle,vMinor);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Dis/Enables the @var{wa} workaround for a bug in gdb.
+
+***************************************************************************/
+
+void mi_set_workaround(unsigned wa, int enable)
+{
+ switch (wa)
+ {
+ case MI_PSYM_SEARCH:
+ disable_psym_search_workaround=enable ? 0 : 1;
+ break;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds if the @var{wa} workaround for a bug in gdb is enabled.
+
+ Return: !=0 if enabled.
+
+***************************************************************************/
+
+int mi_get_workaround(unsigned wa)
+{
+ switch (wa)
+ {
+ case MI_PSYM_SEARCH:
+ return disable_psym_search_workaround==0;
+ }
+ return 0;
+}
+
diff --git a/setedit/libmigdb/src/cpp_int.cc b/setedit/libmigdb/src/cpp_int.cc
new file mode 100644
index 0000000..1ac231f
--- /dev/null
+++ b/setedit/libmigdb/src/cpp_int.cc
@@ -0,0 +1,1109 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: C++ Interface.
+ Comments:
+ Implements a very simple (naive ;-) C++ wrapper.@p
+
+***************************************************************************/
+
+#include <string.h>
+#include <limits.h>
+#include "mi_gdb.h"
+
+/**[txh]********************************************************************
+
+ Description:
+ Initializes a debugger object. It starts in the "disconnected" state.
+Use @x{::Connect} after it.
+
+***************************************************************************/
+
+MIDebugger::MIDebugger()
+{
+ state=disconnected;
+ h=NULL;
+ aux_tty=NULL;
+ waitingTempBkpt=0;
+ targetEndian=enUnknown;
+ targetArch=arUnknown;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is the destructor for the class. It tries to change the state to
+"disconnected" doing the needed actions.
+
+***************************************************************************/
+
+MIDebugger::~MIDebugger()
+{
+ if (state==running)
+ {
+ Stop();
+ mi_stop *rs;
+ // TODO: Some kind of time-out
+ while (!Poll(rs));
+ mi_free_stop(rs);
+ state=stopped;
+ }
+ if (state==stopped)
+ {
+ Kill();
+ state=target_specified;
+ }
+ if (state==target_specified)
+ {
+ TargetUnselect();
+ state=connected;
+ }
+ if (state==connected)
+ Disconnect();
+ // Here state==disconnected
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Connects to gdb. Currently only local connections are supported, that's
+a gdb limitation. Call it when in "unconnected" state, on success it will
+change to the "connected" state. After it you should call one of the
+SelectTarget members. @x{::SelectTargetX11}, @x{::SelectTargetLinux} or
+@x{::SelectTargetRemote}. To finish the connection use @x{::Disconnect}.
+
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int MIDebugger::Connect(bool )
+{
+ if (state==disconnected)
+ {
+ h=mi_connect_local();
+ if (h!=NULL)
+ {
+ state=connected;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finishes the connection to gdb. Call when in "connected" state, on success
+it will change to "disconnected" state. This function first tries to exit
+from gdb and then close the connection. But if gdb fails to exit it will be
+killed.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::Disconnect()
+{
+ if (state==connected)
+ {
+ gmi_gdb_exit(h);
+ mi_disconnect(h);
+ state=disconnected;
+ return 1;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Protected member that implements @x{::SelectTargetX11} and
+@x{::SelectTargetLinux}.
+
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int MIDebugger::SelectTargetTTY(const char *exec, const char *args,
+ const char *auxtty, dMode m)
+{
+ if (state!=connected)
+ return 0;
+
+ targetEndian=enUnknown;
+ targetArch=arUnknown;
+ mode=m;
+ if (!gmi_set_exec(h,exec,args))
+ return 0;
+
+ const char *tty_name;
+ #ifndef __CYGWIN__
+ if (!auxtty)
+ {
+ aux_tty=m==dmLinux ? gmi_look_for_free_vt() : gmi_start_xterm();
+ if (!aux_tty)
+ return 0;
+ tty_name=aux_tty->tty;
+ }
+ else
+ {
+ tty_name=auxtty;
+ }
+ if (!gmi_target_terminal(h,tty_name))
+ return 0;
+ #else
+ tty_name=NULL;
+ if (!gmi_gdb_set(h,"new-console","on"))
+ return 0;
+ #endif
+
+ state=target_specified;
+ preRun=false;
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts a debug session for X11. It opens an xterm console for the program
+to debug and tells gdb which executable to debug and the command line
+options to pass. You can specify an already existing tty console to be used.
+Can be called when the state is "connected". On success will change to the
+"target_specified" state. After it you can use @x{::Run} or use the members
+to define breakpoints and similar stuff. To finish it use
+@x{::TargetUnselect}.
+
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int MIDebugger::SelectTargetX11(const char *exec, const char *args,
+ const char *auxtty)
+{
+ return SelectTargetTTY(exec,args,auxtty,dmX11);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts a debug session for Linux console. It selects an empty VT for the
+program to debug and tells gdb which executable to debug and the command line
+options to pass. You can specify an already existing tty console to be used.
+Can be called when the state is "connected". On success will change to the
+"target_specified" state. After it you can use @x{::Run} or use the members
+to define breakpoints and similar stuff. To finish it use
+@x{::TargetUnselect}.
+
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int MIDebugger::SelectTargetLinux(const char *exec, const char *args,
+ const char *auxtty)
+{
+ return SelectTargetTTY(exec,args,auxtty,dmLinux);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts a remote session. The other end should be running gdbserver. You
+must specify a local copy of the program to debug with debug info. The remote
+copy can be stripped. The @var{rtype} and @var{rparams} selects the protocol
+and the remote machine. Read gdb docs to know more about the available
+options. If @var{rtype} is omitted "extended-remote" protocol is used.
+Can be called when the state is "connected". On success will change to the
+"target_specified" state. After it you can use @x{::Run} or use the members
+to define breakpoints and similar stuff. To finish it use
+@x{::TargetUnselect}. Note that when gdb uses remote debugging the remote
+program starts running. The @x{::Run} member knows about it.
+
+ Return: !=0 OK.
+ Example:
+ o->SelectTargetRemote("./exec_file","192.168.1.65:5000");
+
+***************************************************************************/
+
+int MIDebugger::SelectTargetRemote(const char *exec, const char *rparams,
+ const char *rtype)
+{
+ if (state!=connected)
+ return 0;
+
+ mode=dmRemote;
+ preRun=true;
+ targetEndian=enUnknown;
+ targetArch=arUnknown;
+ if (rtype==NULL)
+ rtype="extended-remote";
+
+ /* Tell gdb to load symbols from the local copy. */
+ if (!gmi_file_symbol_file(h,exec) || !gmi_target_select(h,rtype,rparams))
+ return 0;
+
+ state=target_specified;
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts a local session using an already running process.
+
+ Return: !=0 OK.
+
+***************************************************************************/
+
+mi_frames *MIDebugger::SelectTargetPID(const char *exec, int pid)
+{
+ if (state!=connected)
+ return NULL;
+
+ mode=dmPID;
+ preRun=false;
+ targetEndian=enUnknown;
+ targetArch=arUnknown;
+
+ mi_frames *res=gmi_target_attach(h,pid);
+ if (res)
+ {
+ state=stopped;
+
+ /* Tell gdb to load symbols from the local copy. */
+ if (!gmi_file_symbol_file(h,exec))
+ {
+ mi_free_frames(res);
+ return NULL;
+ }
+ }
+
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to unselect the current target. When X11 mode it closes the auxiliar
+terminal. For remote debugging it uses "detach". Can be called when in
+"target_specified" state. On success it changes to "connected" state.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::TargetUnselect()
+{
+ switch (mode)
+ {
+ case dmX11:
+ case dmLinux:
+ if (state!=target_specified)
+ return 0;
+ if (aux_tty)
+ {
+ gmi_end_aux_term(aux_tty);
+ aux_tty=NULL;
+ }
+ break;
+ case dmPID:
+ case dmRemote:
+ if (state!=target_specified)
+ {
+ if (state!=stopped || !gmi_target_detach(h))
+ return 0;
+ }
+ break;
+ }
+ state=connected;
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts running the program. You should set breakpoint before it. Can be
+called when state is "target_specified". On success will change to "running"
+state. After it you should poll for async responses using @x{::Poll}. The
+program can stop for many reasons asynchronously and also exit. This
+information is known using Poll. You can stop the program using @x{::Stop}.
+
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int MIDebugger::Run()
+{
+ if (state!=target_specified)
+ return 0;
+
+ int res;
+ if (preRun)
+ res=gmi_exec_continue(h);
+ else
+ res=gmi_exec_run(h);
+ if (res)
+ state=running;
+
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stops the program execution. GDB sends an interrupt signal to the program.
+Can be called when the state is "running". It won't switch to "stopped"
+state automatically. Instead you must poll for async events and wait for a
+stopped notification. After it you can call @x{::Continue} to resume
+execution.
+
+ Return:
+ Example: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::Stop()
+{
+ if (state!=running)
+ return 0;
+ return gmi_exec_interrupt(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Polls gdb looking for async responses. Currently it just looks for
+"stopped" messages. You must call it when the state is "running". But the
+function will poll gdb even if the state isn't "running". When a stopped
+message is received the state changes to stopped or target_specified (the
+last is when we get some exit).
+
+ Return: !=0 if we got a response. The @var{rs} pointer will point to an
+mi_stop structure if we got it or will be NULL if we didn't.
+
+***************************************************************************/
+
+int MIDebugger::Poll(mi_stop *&rs)
+{
+ if (state==disconnected || !mi_get_response(h))
+ return 0;
+
+ mi_stop *res=mi_res_stop(h);
+ if (res)
+ {
+ if (res->reason==sr_exited_signalled ||
+ res->reason==sr_exited ||
+ res->reason==sr_exited_normally)
+ // When we use a PID the exit makes it invalid, so we don't have a
+ // valid target to re-run.
+ state=mode==dmPID ? connected : target_specified;
+ else
+ state=stopped;
+ if (res->reason==sr_unknown && waitingTempBkpt)
+ {
+ waitingTempBkpt=0;
+ res->reason=sr_bkpt_hit;
+ }
+ }
+ else
+ {// We got an error. It looks like most async commands returns running even
+ // before they are sure the process is running. Latter we get the real
+ // error. So I'm assuming the program is stopped.
+ // Lamentably -target-exec-status isn't implemented and even in this case
+ // if the program is really running as real async isn't implemented it
+ // will fail anyways.
+ if (state==running)
+ state=stopped;
+ }
+ rs=res;
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Resumes execution after the program "stopped". Can be called when the state
+is stopped. On success will change to "running" state.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::Continue()
+{
+ if (state!=stopped)
+ return 0;
+ int res=gmi_exec_continue(h);
+ if (res)
+ state=running;
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts program execution or resumes it. When the state is target_specified
+it calls @x{::Run} otherwise it uses @x{::Continue}. Can be called when the
+state is "target_specified" or "stopped". On success will change to
+"running" state.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::RunOrContinue()
+{
+ if (state==target_specified)
+ return Run();
+ return Continue();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Kills the program you are debugging. Can be called when the state is
+"stopped" or "running". On success changes the state to "target_specified".
+Note that if you want to restart the program you can just call @x{::Run} and
+if you want to just stop the program call @x{::Stop}.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::Kill()
+{
+ if (state!=stopped && state!=running)
+ return 0;
+ /* GDB/MI doesn't implement it (yet), so we use the regular kill. */
+ /* Ensure confirm is off. */
+ char *prev=gmi_gdb_show(h,"confirm");
+ if (!prev)
+ return 0;
+ if (strcmp(prev,"off"))
+ {
+ if (!gmi_gdb_set(h,"confirm","off"))
+ {
+ free(prev);
+ return 0;
+ }
+ }
+ else
+ {
+ free(prev);
+ prev=NULL;
+ }
+ /* Do the kill. */
+ int res=gmi_exec_kill(h);
+ /* Revert confirm option if needed. */
+ if (prev)
+ {
+ gmi_gdb_set(h,"confirm",prev);
+ free(prev);
+ }
+
+ if (res)
+ state=target_specified;
+
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts a breakpoint at @var{file} and @var{line}. Can be called when the
+state is "stopped" or "target_specified".
+
+ Return: An mi_bkpt structure or NULL if error.
+
+***************************************************************************/
+
+mi_bkpt *MIDebugger::Breakpoint(const char *file, int line)
+{
+ if (state!=stopped && state!=target_specified)
+ return NULL;
+ return gmi_break_insert(h,file,line);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts a breakpoint at @var{where}, all options available. Can be called
+when the state is "stopped" or "target_specified".
+
+ Return: An mi_bkpt structure or NULL if error.
+
+***************************************************************************/
+
+mi_bkpt *MIDebugger::Breakpoint(const char *where, bool temporary,
+ const char *cond, int count, int thread,
+ bool hard_assist)
+{
+ if (state!=stopped && state!=target_specified)
+ return NULL;
+ return gmi_break_insert_full(h,temporary,hard_assist,cond,count,thread,where);
+}
+
+
+const int maxWhere=PATH_MAX+256;
+
+mi_bkpt *MIDebugger::Breakpoint(mi_bkpt *b)
+{
+ if (state!=stopped && state!=target_specified)
+ return NULL;
+
+ char buf[maxWhere];
+ buf[0]=0;
+ switch (b->mode)
+ {
+ case m_file_line:
+ snprintf(buf,maxWhere,"%s:%d",b->file,b->line);
+ break;
+ case m_function:
+ snprintf(buf,maxWhere,"%s",b->func);
+ break;
+ case m_file_function:
+ snprintf(buf,maxWhere,"%s:%s",b->file,b->func);
+ break;
+ case m_address:
+ snprintf(buf,maxWhere,"*%p",b->addr);
+ break;
+ }
+ return Breakpoint(buf,b->disp==d_del,b->cond,b->ignore,b->thread,
+ b->type==t_hw);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts a breakpoint at @var{file} and @var{line} all options available.
+Can be called when the state is "stopped" or "target_specified".
+
+ Return: An mi_bkpt structure or NULL if error.
+
+***************************************************************************/
+
+mi_bkpt *MIDebugger::BreakpointFull(const char *file, int line,
+ bool temporary, const char *cond,
+ int count, int thread, bool hard_assist)
+{
+ if (state!=stopped && state!=target_specified)
+ return NULL;
+ return gmi_break_insert_full_fl(h,file,line,temporary,hard_assist,cond,
+ count,thread);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Removes the specified breakpoint. It doesn't free the structure. Can be
+called when the state is "stopped" or "target_specified".
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::BreakDelete(mi_bkpt *b)
+{
+ if ((state!=stopped && state!=target_specified) || !b)
+ return 0;
+ return gmi_break_delete(h,b->number);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts a watchpoint for the specified expression. Can be called when the
+state is "stopped" or "target_specified".
+
+ Return: An mi_wp structure or NULL if error.
+
+***************************************************************************/
+
+mi_wp *MIDebugger::Watchpoint(enum mi_wp_mode mode, const char *exp)
+{
+ if (state!=stopped && state!=target_specified)
+ return NULL;
+ return gmi_break_watch(h,mode,exp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Removes the specified watchpoint. It doesn't free the structure. Can be
+called when the state is "stopped" or "target_specified".
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::WatchDelete(mi_wp *w)
+{
+ if ((state!=stopped && state!=target_specified) || !w)
+ return 0;
+ return gmi_break_delete(h,w->number);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Puts a temporal breakpoint in main function and starts running. Can be
+called when the state is "target_specified". If successful the state will
+change to "running".
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::RunToMain()
+{
+ if (state!=target_specified)
+ return 0;
+ mi_bkpt *b=Breakpoint(mi_get_main_func(),true);
+ if (!b)
+ return 0;
+ mi_free_bkpt(b);
+ waitingTempBkpt=1;
+ return Run();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Executes upto the next line, doesn't follow function calls. The @var{inst}
+argument is for assembler. If the state is "target_specified" it will go to
+the first line in the main function. If the state is "stopped" will use the
+next command. If successfully the state will change to "running".
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::StepOver(bool inst)
+{
+ int res=0;
+
+ if (state==target_specified)
+ {// We aren't running
+ // Walk to main
+ return RunToMain();
+ }
+ if (state==stopped)
+ {
+ if (inst)
+ res=gmi_exec_next_instruction(h);
+ else
+ res=gmi_exec_next(h);
+ if (res)
+ state=running;
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Executes until the specified point. If the state is "target_specified" it
+uses a temporal breakpoint. If the state is "stopped" it uses -exec-until.
+Fails for any other state.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::GoTo(const char *file, int line)
+{
+ int res=0;
+
+ if (state==target_specified)
+ {// We aren't running
+ // Use a temporal breakpoint
+ int l=strlen(file)+32;
+ char buf[l];
+ snprintf(buf,l,"%s:%d",file,line);
+ mi_bkpt *b=Breakpoint(buf,true);
+ if (b)
+ {
+ mi_free_bkpt(b);
+ waitingTempBkpt=1;
+ res=Run();
+ }
+ }
+ else if (state==stopped)
+ {
+ res=gmi_exec_until(h,file,line);
+ if (res)
+ state=running;
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Executes until the specified point. If the state is "target_specified" it
+uses a temporal breakpoint. If the state is "stopped" it uses -exec-until.
+Fails for any other state.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::GoTo(void *addr)
+{
+ int res=0;
+
+ if (state==target_specified)
+ {// We aren't running
+ // Use a temporal breakpoint
+ char buf[32];
+ snprintf(buf,32,"*%p",addr);
+ mi_bkpt *b=Breakpoint(buf,true);
+ if (b)
+ {
+ mi_free_bkpt(b);
+ waitingTempBkpt=1;
+ res=Run();
+ }
+ }
+ else if (state==stopped)
+ {
+ res=gmi_exec_until_addr(h,addr);
+ if (res)
+ state=running;
+ }
+ return res;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Resumes execution until the end of the current funtion is reached. Only
+usable when we are in the "stopped" state.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::FinishFun()
+{
+ if (state!=stopped)
+ return 0;
+ int res=gmi_exec_finish(h);
+ if (res)
+ state=running;
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns immediately. Only usable when we are in the "stopped" state.
+
+ Return: !=NULL OK, the returned frame is the current location. That's a
+synchronous function.
+
+***************************************************************************/
+
+mi_frames *MIDebugger::ReturnNow()
+{
+ if (state!=stopped)
+ return 0;
+ return gmi_exec_return(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the current list of frames.
+
+ Return: !=NULL OK, the list of frames is returned.
+
+***************************************************************************/
+
+mi_frames *MIDebugger::CallStack(bool args)
+{
+ if (state!=stopped)
+ return 0;
+ mi_frames *fr1=gmi_stack_list_frames(h);
+ if (fr1 && args)
+ {// Get the function arguments
+ mi_frames *fr2=gmi_stack_list_arguments(h,1);
+ if (fr2)
+ {// Transfer them to the other list
+ mi_frames *p=fr1, *p2=fr2;
+ while (p2 && p)
+ {
+ p->args=p2->args;
+ p2->args=NULL;
+ p2=p2->next;
+ p=p->next;
+ }
+ mi_free_frames(fr2);
+ }
+ }
+ return fr1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Executes upto the next line, it follows function calls. The @var{inst}
+argument is for assembler. If the state is "target_specified" it will go to
+the first line in the main function. If the state is "stopped" will use the
+next command. If successfully the state will change to "running".
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::TraceInto(bool inst)
+{
+ int res=0;
+
+ if (state==target_specified)
+ {// We aren't running
+ // Walk to main
+ return RunToMain();
+ }
+ if (state==stopped)
+ {
+ if (inst)
+ res=gmi_exec_step_instruction(h);
+ else
+ res=gmi_exec_step(h);
+ if (res)
+ state=running;
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Evaluates the provided expression. If we get an error the error
+description is returned instead. Can't be called if "disconnected" or
+"running".
+
+ Return: The result of the expression (use free) or NULL.
+
+***************************************************************************/
+
+char *MIDebugger::EvalExpression(const char *exp)
+{
+ if (state==disconnected ||
+ state==running) // No async :-(
+ return NULL;
+ // Evaluate it
+ mi_error=MI_OK;
+ char *res=gmi_data_evaluate_expression(h,exp);
+ if (!res && mi_error_from_gdb)
+ {// Not valid, return the error
+ res=strdup(mi_error_from_gdb);
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Modifies the provided expression. If we get an error the error
+description is returned instead. Can't be called if "disconnected" or
+"running".
+
+ Return: The result of the expression (use free) or NULL.
+
+***************************************************************************/
+
+char *MIDebugger::ModifyExpression(char *exp, char *newVal)
+{
+ if (state==disconnected ||
+ state==running) // No async :-(
+ return NULL;
+ // Create an assignment
+ int l1=strlen(exp);
+ int l2=strlen(newVal);
+ char b[l1+l2+2], *s=b;
+ memcpy(s,exp,l1);
+ s+=l1;
+ *s='=';
+ memcpy(++s,newVal,l2);
+ s[l2]=0;
+ // Evaluate it
+ char *res=gmi_data_evaluate_expression(h,b);
+ if (!res && mi_error_from_gdb)
+ {// Not valid, return the error
+ res=strdup(mi_error_from_gdb);
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sends a command to gdb.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::Send(const char *command)
+{
+ if (state==disconnected ||
+ state==running) // No async :-(
+ return 0;
+ // TODO: detect and use -interpreter-exec?
+ mi_send(h,"%s\n",command);
+ return mi_res_simple_done(h);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills the type and value fields of the mi_gvar provided list.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int MIDebugger::FillTypeVal(mi_gvar *var)
+{
+ while (var)
+ {
+ if (!var->type && !gmi_var_info_type(h,var))
+ return 0;
+ if (!var->value && !gmi_var_evaluate_expression(h,var))
+ return 0;
+ var=var->next;
+ }
+ return 1;
+}
+
+int MIDebugger::FillOneTypeVal(mi_gvar *var)
+{
+ if (!var)
+ return 0;
+
+ int ok=1;
+ if (!var->type && !gmi_var_info_type(h,var))
+ {
+ var->type=strdup("");
+ ok=0;
+ }
+ if (!var->value && !gmi_var_evaluate_expression(h,var))
+ {
+ var->value=strdup("");
+ ok=0;
+ }
+ return ok;
+}
+
+int MIDebugger::AssigngVar(mi_gvar *var, const char *exp)
+{
+ if (state!=stopped)
+ return 0;
+ return gmi_var_assign(h,var,exp);
+}
+
+char *MIDebugger::Show(const char *var)
+{
+ if (state==running || state==disconnected)
+ return 0;
+ // GDB 5.x doesn't reply all in the response record, just to the console :-(
+ h->catch_console=1;
+ if (h->catched_console)
+ {
+ free(h->catched_console);
+ h->catched_console=NULL;
+ }
+ char *res=gmi_gdb_show(h,var);
+ h->catch_console=0;
+ if (!res && h->catched_console)
+ {
+ res=h->catched_console;
+ h->catched_console=NULL;
+ }
+ return res;
+}
+
+MIDebugger::endianType MIDebugger::GetTargetEndian()
+{
+ if (targetEndian!=enUnknown)
+ return targetEndian;
+ if (state!=stopped && state!=target_specified)
+ return enUnknown;
+
+ char *end=Show("endian");
+ if (end)
+ {
+ if (strstr(end,"big"))
+ targetEndian=enBig;
+ else if (strstr(end,"little"))
+ targetEndian=enLittle;
+ free(end);
+ }
+ return targetEndian;
+}
+
+MIDebugger::archType MIDebugger::GetTargetArchitecture()
+{
+ if (targetArch!=arUnknown)
+ return targetArch;
+ if (state!=stopped && state!=target_specified)
+ return arUnknown;
+
+ char *end=Show("architecture");
+ if (end)
+ {
+ if (strstr(end,"i386"))
+ targetArch=arIA32;
+ else if (strstr(end,"sparc"))
+ targetArch=arSPARC;
+ free(end);
+ }
+ return targetArch;
+}
+
+int MIDebugger::GetErrorNumberSt()
+{
+ if (mi_error==MI_GDB_DIED)
+ {
+ state=target_specified;
+ TargetUnselect();
+ state=connected;
+ Disconnect();
+ }
+ return mi_error;
+}
+
+int MIDebugger::UpdateRegisters(mi_chg_reg *regs)
+{
+ int updated=0;
+ mi_chg_reg *chg=GetChangedRegisters();
+ if (chg)
+ {
+ mi_chg_reg *r=regs, *c;
+ while (r)
+ {
+ c=chg;
+ while (c && c->reg!=r->reg)
+ c=c->next;
+ if (c)
+ {
+ r->updated=1;
+ free(r->val);
+ r->val=c->val;
+ c->val=NULL;
+ updated++;
+ }
+ else
+ r->updated=0;
+ r=r->next;
+ }
+ }
+ return updated;
+}
+
diff --git a/setedit/libmigdb/src/data_man.c b/setedit/libmigdb/src/data_man.c
new file mode 100644
index 0000000..a7e9f11
--- /dev/null
+++ b/setedit/libmigdb/src/data_man.c
@@ -0,0 +1,241 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Data manipulation.
+ Comments:
+ GDB/MI commands for the "Data manipulation" section.@p
+
+@<pre>
+gdb command: Implemented?
+
+-data-disassemble Yes
+-data-evaluate-expression Yes
+-data-list-changed-registers No
+-data-list-register-names Yes
+-data-list-register-values No
+-data-read-memory No
+-display-delete N.A. (delete display)
+-display-disable N.A. (disable display)
+-display-enable N.A. (enable display)
+-display-insert N.A. (display)
+-display-list N.A. (info display)
+-environment-cd No
+-environment-directory Yes, MI v1 implementation
+-environment-path No
+@</pre>
+
+Notes:@p
+
+1) -display* aren't implemented. You can use CLI command display, but the
+results are sent to the console. So it looks like the best is to manually
+use -data-evaluate-expression to emulate it.@p
+
+2) GDB bug mi/1770: Affects gdb<=6.2, when you ask for the names of the
+registers you get it plus the name of the "pseudo-registers", but if you
+try to get the value of a pseudo-register you get an error saying the
+register number is invalid. I reported to gdb-patches@sources.redhat.com
+on 2004/08/25 and as I didn't get any answer I filled a bug report on
+2004/09/02. The patch to fix this annoying bug is:
+
+Index: gdb/mi/mi-main.c
+===================================================================
+RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
+retrieving revision 1.64
+diff -u -r1.64 mi-main.c
+--- gdb/mi/mi-main.c 3 Aug 2004 00:57:27 -0000 1.64
++++ gdb/mi/mi-main.c 25 Aug 2004 14:12:50 -0000
+@@ -423,7 +423,7 @@
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged.
+
+- numregs = NUM_REGS;
++ numregs = NUM_REGS + NUM_PSEUDO_REGS;
+
+ if (argc == 0)
+ {
+----
+
+Note I had to remove an end of comment in the patch to include it here.
+This bug forced me to create another set of functions. The only way is to
+first get the values and then the names.
+Fixed by Changelog entry:
+
+2004-09-12 Salvador E. Tropea <set@users.sf.net>
+ Andrew Cagney <cagney@gnu.org>
+
+ * mi/mi-main.c (mi_cmd_data_list_changed_registers)
+ (mi_cmd_data_list_register_values)
+ (mi_cmd_data_write_register_values): Include the PSEUDO_REGS in
+ the register number computation.
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_data_evaluate_expression(mi_h *h, const char *expression)
+{
+ mi_send(h,"-data-evaluate-expression \"%s\"\n",expression);
+}
+
+void mi_dir(mi_h *h, const char *path)
+{
+ if (h->version>=MI_VERSION2U(2,0,0))
+ {// MI v2
+ if (path)
+ mi_send(h,"-environment-directory \"%s\"\n",path);
+ else
+ mi_send(h,"-environment-directory -r\n");
+ }
+ else
+ {
+ mi_send(h,"-environment-directory %s\n",path ? path : "");
+ }
+}
+
+void mi_data_read_memory_hx(mi_h *h, const char *exp, unsigned ws,
+ unsigned c, int convAddr)
+{
+ if (convAddr)
+ mi_send(h,"-data-read-memory \"&%s\" x %d 1 %d\n",exp,ws,c);
+ else
+ mi_send(h,"-data-read-memory \"%s\" x %d 1 %d\n",exp,ws,c);
+}
+
+void mi_data_disassemble_se(mi_h *h, const char *start, const char *end,
+ int mode)
+{
+ mi_send(h,"-data-disassemble -s \"%s\" -e \"%s\" -- %d\n",start,end,mode);
+}
+
+void mi_data_disassemble_fl(mi_h *h, const char *file, int line, int lines,
+ int mode)
+{
+ mi_send(h,"-data-disassemble -f \"%s\" -l %d -n %d -- %d\n",file,line,lines,
+ mode);
+}
+
+void mi_data_list_register_names(mi_h *h)
+{
+ mi_send(h,"-data-list-register-names\n");
+}
+
+void mi_data_list_register_names_l(mi_h *h, mi_chg_reg *l)
+{
+ mi_send(h,"-data-list-register-names ");
+ while (l)
+ {
+ mi_send(h,"%d ",l->reg);
+ l=l->next;
+ }
+ mi_send(h,"\n");
+}
+
+void mi_data_list_changed_registers(mi_h *h)
+{
+ mi_send(h,"-data-list-changed-registers\n");
+}
+
+void mi_data_list_register_values(mi_h *h, enum mi_gvar_fmt fmt, mi_chg_reg *l)
+{
+ mi_send(h,"-data-list-register-values %c ",mi_format_enum_to_char(fmt));
+ while (l)
+ {
+ mi_send(h,"%d ",l->reg);
+ l=l->next;
+ }
+ mi_send(h,"\n");
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ Evaluate an expression. Returns a parsed tree.
+
+ Command: -data-evaluate-expression
+ Return: The resulting value (as plain text) or NULL on error.
+
+***************************************************************************/
+
+char *gmi_data_evaluate_expression(mi_h *h, const char *expression)
+{
+ mi_data_evaluate_expression(h,expression);
+ return mi_res_value(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Path for sources. You must use it to indicate where are the sources for
+the program to debug. Only the MI v1 implementation is available.
+
+ Command: -environment-directory
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_dir(mi_h *h, const char *path)
+{
+ mi_dir(h,path);
+ return mi_res_simple_done(h);
+}
+
+int gmi_read_memory(mi_h *h, const char *exp, unsigned size,
+ unsigned char *dest, int *na, int convAddr,
+ unsigned long *addr)
+{
+ mi_data_read_memory_hx(h,exp,1,size,convAddr);
+ return mi_get_read_memory(h,dest,1,na,addr);
+}
+
+mi_asm_insns *gmi_data_disassemble_se(mi_h *h, const char *start,
+ const char *end, int mode)
+{
+ mi_data_disassemble_se(h,start,end,mode);
+ return mi_get_asm_insns(h);
+}
+
+mi_asm_insns *gmi_data_disassemble_fl(mi_h *h, const char *file, int line,
+ int lines, int mode)
+{
+ mi_data_disassemble_fl(h,file,line,lines,mode);
+ return mi_get_asm_insns(h);
+}
+
+// Affected by gdb bug mi/1770
+mi_chg_reg *gmi_data_list_register_names(mi_h *h, int *how_many)
+{
+ mi_data_list_register_names(h);
+ return mi_get_list_registers(h,how_many);
+}
+
+int gmi_data_list_register_names_l(mi_h *h, mi_chg_reg *l)
+{
+ mi_data_list_register_names_l(h,l);
+ return mi_get_list_registers_l(h,l);
+}
+
+mi_chg_reg *gmi_data_list_changed_registers(mi_h *h)
+{
+ mi_error=MI_OK;
+ mi_data_list_changed_registers(h);
+ return mi_get_list_changed_regs(h);
+}
+
+int gmi_data_list_register_values(mi_h *h, enum mi_gvar_fmt fmt, mi_chg_reg *l)
+{
+ mi_data_list_register_values(h,fmt,l);
+ return mi_get_reg_values(h,l);
+}
+
+mi_chg_reg *gmi_data_list_all_register_values(mi_h *h, enum mi_gvar_fmt fmt, int *how_many)
+{
+ mi_data_list_register_values(h,fmt,NULL);
+ return mi_get_reg_values_l(h,how_many);
+}
+
diff --git a/setedit/libmigdb/src/error.c b/setedit/libmigdb/src/error.c
new file mode 100644
index 0000000..adeb16c
--- /dev/null
+++ b/setedit/libmigdb/src/error.c
@@ -0,0 +1,38 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Error.
+ Comment:
+ Translates error numbers into messages.
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+static
+const char *error_strs[]=
+{
+ "Ok",
+ "Out of memory",
+ "Pipe creation",
+ "Fork failed",
+ "GDB not running",
+ "Parser failed",
+ "Unknown asyn response",
+ "Unknown result response",
+ "Error from gdb",
+ "Time out in gdb response",
+ "GDB suddenly died",
+ "Can't execute X terminal",
+ "Failed to create temporal",
+ "Can't execute the debugger"
+};
+
+const char *mi_get_error_str()
+{
+ if (mi_error<0 || mi_error>MI_LAST_ERROR)
+ return "Unknown";
+ return error_strs[mi_error];
+}
diff --git a/setedit/libmigdb/src/get_free_pty.c b/setedit/libmigdb/src/get_free_pty.c
new file mode 100644
index 0000000..8c145d0
--- /dev/null
+++ b/setedit/libmigdb/src/get_free_pty.c
@@ -0,0 +1,132 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: pseudo terminal
+ Comments:
+ Helper to find a free pseudo terminal. Use this if you need to manage
+ input *and* output to the target process. If you just need output then
+ define a handler for target output stream records (assuming that this
+ is working for your particular version of gdb).
+ Usage:
+
+ mi_pty *pty = gmi_look_for_free_pty();
+ if (pty) gmi_target_terminal(mih, pty->slave);
+ ...
+ * reading from pty->master will get stdout from target *
+ * writing to pty->master will send to target stdin *
+
+ Note: Contributed by Greg Watson (gwatson lanl gov)
+
+***************************************************************************/
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#include "mi_gdb.h"
+
+/**[txh]********************************************************************
+
+ Description:
+ Look for a free and usable pseudo terminal. Low level, use
+@x{gmi_look_for_free_pty}.
+
+ Return: A file descriptor connected to the master pty and the name of the slave device, or <0 on error.
+
+***************************************************************************/
+
+#ifdef __APPLE__
+
+#include <util.h>
+
+int mi_look_for_free_pty(int *master, char **slave)
+{
+ int fdmaster;
+ int fdslave;
+ static char name[BUFSIZ];
+
+ if (openpty(&fdmaster,&fdslave,name,NULL,NULL)<0)
+ return -1;
+
+ (void)close(fdslave); /* this will be reopened by gdb */
+ *master=fdmaster;
+ *slave =name;
+
+ return 0;
+}
+
+#elif defined(__linux__)
+
+int mi_look_for_free_pty(int *master, char **slave)
+{
+ if ((*master=open("/dev/ptmx",O_RDWR))<0)
+ return -1;
+ if (grantpt(*master)<0 || unlockpt(*master)<0)
+ return -1;
+ *slave = ptsname(*master);
+
+ return 0;
+}
+
+#else /* undefined o/s */
+
+int mi_look_for_free_pty(int *master, char **slave)
+{
+ return -1;
+}
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ Look for a free and usable pseudo terminal to be used by the child.
+
+ Return: A new mi_pty structure, you can use @x{gmi_end_pty} to
+release it.
+
+***************************************************************************/
+
+mi_pty *gmi_look_for_free_pty()
+{
+ int master;
+ char *slave;
+ int pty=mi_look_for_free_pty(&master,&slave);
+ mi_pty *res;
+
+ if (pty<0)
+ return NULL;
+ res=(mi_pty *)malloc(sizeof(mi_pty));
+ if (!res)
+ return NULL;
+ res->slave=strdup(slave);
+ res->master=master;
+ return res;
+}
+
+void mi_free_pty(mi_pty *p)
+{
+ if (!p)
+ return;
+ free(p->slave);
+ free(p);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the pseudo termial master and releases the allocated memory.
+
+***************************************************************************/
+
+void gmi_end_pty(mi_pty *p)
+{
+ if (!p)
+ return;
+ close(p->master);
+ mi_free_pty(p);
+}
diff --git a/setedit/libmigdb/src/get_free_vt.c b/setedit/libmigdb/src/get_free_vt.c
new file mode 100644
index 0000000..f5c9800
--- /dev/null
+++ b/setedit/libmigdb/src/get_free_vt.c
@@ -0,0 +1,153 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Linux VT.
+ Comments:
+ Helper to find a free VT. That's 100% Linux specific.@p
+ The code comes from "lconsole.c" from Allegro project and was originally
+created by Marek Habersack and then modified by George Foot. I addapted it
+to my needs and changed license from giftware to GPL.@p
+
+***************************************************************************/
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#ifdef __APPLE__
+#include <util.h>
+#endif /* __APPLE__ */
+
+#include "mi_gdb.h"
+
+#if !defined(__linux__)
+
+int mi_look_for_free_vt()
+{
+ return -1;
+}
+
+mi_aux_term *gmi_look_for_free_vt()
+{
+ return NULL;
+}
+
+#else
+
+#include <linux/vt.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ Look for a free and usable Linux VT. Low level, use
+@x{gmi_look_for_free_vt}.
+
+ Return: The VT number or <0 on error.
+
+***************************************************************************/
+
+int mi_look_for_free_vt()
+{/* Code from Allegro. */
+ int tty, console_fd, fd;
+ unsigned short mask;
+ char tty_name[16];
+ struct vt_stat vts;
+
+ /* Now we need to find a VT we can use. It must be readable and
+ * writable by us, if we're not setuid root. VT_OPENQRY itself
+ * isn't too useful because it'll only ever come up with one
+ * suggestion, with no guarrantee that we actually have access
+ * to it.
+ *
+ * At some stage I think this is a candidate for config
+ * file overriding, but for now we'll stat the first N consoles
+ * to see which ones we can write to (hopefully at least one!),
+ * so that we can use that one to do ioctls. We used to use
+ * /dev/console for that purpose but it looks like it's not
+ * always writable by enough people.
+ *
+ * Having found and opened a writable device, we query the state
+ * of the first sixteen (fifteen really) consoles, and try
+ * opening each unused one in turn.
+ */
+
+ console_fd=open("/dev/console",O_WRONLY);
+ if (console_fd<0)
+ {
+ int n;
+ /* Try some ttys instead... */
+ for (n=1; n<=24; n++)
+ {
+ snprintf(tty_name,sizeof(tty_name),"/dev/tty%d",n);
+ console_fd=open(tty_name,O_WRONLY);
+ if (console_fd>=0)
+ break;
+ }
+ if (n>24)
+ return -1;
+ }
+
+ /* Get the state of the console -- in particular, the free VT field */
+ if (ioctl(console_fd,VT_GETSTATE,&vts))
+ return -2;
+ close(console_fd);
+
+ /* We attempt to set our euid to 0; if we were run with euid 0 to
+ * start with, we'll be able to do this now. Otherwise, we'll just
+ * ignore the error returned since it might not be a problem if the
+ * ttys we look at are owned by the user running the program. */
+ seteuid(0);
+
+ /* tty0 is not really a console, so start counting at 2. */
+ fd=-1;
+ for (tty=1, mask=2; mask; tty++, mask<<=1)
+ if (!(vts.v_state & mask))
+ {
+ snprintf(tty_name,sizeof(tty_name),"/dev/tty%d",tty);
+ fd=open(tty_name,O_RDWR);
+ if (fd!=-1)
+ {
+ close(fd);
+ break;
+ }
+ }
+
+ seteuid(getuid());
+
+ if (!mask)
+ return -3;
+
+ return tty;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Look for a free and usable Linux VT to be used by the child.
+
+ Return: A new mi_aux_term structure, you can use @x{gmi_end_aux_term} to
+release it.
+
+***************************************************************************/
+
+mi_aux_term *gmi_look_for_free_vt()
+{
+ int vt=mi_look_for_free_vt();
+ mi_aux_term *res;
+
+ if (vt<0)
+ return NULL;
+ res=(mi_aux_term *)malloc(sizeof(mi_aux_term));
+ if (!res)
+ return NULL;
+ res->pid=-1;
+ asprintf(&res->tty,"/dev/tty%d",vt);
+ return res;
+}
+
+#endif
+
diff --git a/setedit/libmigdb/src/mi_gdb.h b/setedit/libmigdb/src/mi_gdb.h
new file mode 100644
index 0000000..e21619e
--- /dev/null
+++ b/setedit/libmigdb/src/mi_gdb.h
@@ -0,0 +1,958 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004-2005 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Comments:
+ Main header for libmigdb.
+
+***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h> /* pid_t */
+
+#define MI_OK 0
+#define MI_OUT_OF_MEMORY 1
+#define MI_PIPE_CREATE 2
+#define MI_FORK 3
+#define MI_DEBUGGER_RUN 4
+#define MI_PARSER 5
+#define MI_UNKNOWN_ASYNC 6
+#define MI_UNKNOWN_RESULT 7
+#define MI_FROM_GDB 8
+#define MI_GDB_TIME_OUT 9
+#define MI_GDB_DIED 10
+#define MI_MISSING_XTERM 11
+#define MI_CREATE_TEMPORAL 12
+#define MI_MISSING_GDB 13
+#define MI_LAST_ERROR 13
+
+#define MI_R_NONE 0 /* We are no waiting any response. */
+#define MI_R_SKIP 1 /* We want to discard it. */
+#define MI_R_FE_AND_S 2 /* Wait for done. */
+#define MI_R_E_ARGS 3
+
+enum mi_val_type { t_const, t_tuple, t_list };
+
+/* Types and subtypes. */
+/* Type. */
+#define MI_T_OUT_OF_BAND 0
+#define MI_T_RESULT_RECORD 1
+/* Out of band subtypes. */
+#define MI_ST_ASYNC 0
+#define MI_ST_STREAM 1
+/* Async sub-subtypes. */
+#define MI_SST_EXEC 0
+#define MI_SST_STATUS 1
+#define MI_SST_NOTIFY 2
+/* Stream sub-subtypes. */
+#define MI_SST_CONSOLE 3
+#define MI_SST_TARGET 4
+#define MI_SST_LOG 5
+/* Classes. */
+/* Async classes. */
+#define MI_CL_UNKNOWN 0
+#define MI_CL_STOPPED 1
+/* Result classes. */
+#define MI_CL_DONE 2
+#define MI_CL_RUNNING 3
+#define MI_CL_CONNECTED 4
+#define MI_CL_ERROR 5
+#define MI_CL_EXIT 6
+
+#define MI_DEFAULT_TIME_OUT 10
+
+#define MI_DIS_ASM 0
+#define MI_DIS_SRC_ASM 1
+
+/* Implemented workaround for gdb bugs that we can dis/enable. */
+/* At least gdb<=6.1.1 fails to find a source file with absolute path if the
+ name is for a psym instead of a sym. psym==partially loaded symbol table. */
+#define MI_PSYM_SEARCH 0
+
+#define MI_VERSION_STR "0.8.10"
+#define MI_VERSION_MAJOR 0
+#define MI_VERSION_MIDDLE 8
+#define MI_VERSION_MINOR 10
+
+struct mi_results_struct
+{
+ char *var; /* Result name or NULL if just a value. */
+ enum mi_val_type type;
+ union
+ {
+ char *cstr;
+ struct mi_results_struct *rs;
+ } v;
+ struct mi_results_struct *next;
+};
+typedef struct mi_results_struct mi_results;
+
+struct mi_output_struct
+{
+ /* Type of output. */
+ char type;
+ char stype;
+ char sstype;
+ char tclass;
+ /* Content. */
+ mi_results *c;
+ /* Always modeled as a list. */
+ struct mi_output_struct *next;
+};
+typedef struct mi_output_struct mi_output;
+
+typedef void (*stream_cb)(const char *, void *);
+typedef void (*async_cb)(mi_output *o, void *);
+typedef int (*tm_cb)(void *);
+
+/* Values of this structure shouldn't be manipulated by the user. */
+struct mi_h_struct
+{
+ /* Pipes connected to gdb. */
+ int to_gdb[2];
+ int from_gdb[2];
+ /* Streams for the pipes. */
+ FILE *to, *from;
+ /* PID of child gdb. */
+ pid_t pid;
+ char died;
+ /* Which rensponse we are waiting for. */
+ /*int response;*/
+ /* The line we are reading. */
+ char *line;
+ int llen, lread;
+ /* Parsed output. */
+ mi_output *po, *last;
+ /* Tunneled streams callbacks. */
+ stream_cb console;
+ void *console_data;
+ stream_cb target;
+ void *target_data;
+ stream_cb log;
+ void *log_data;
+ /* Async responses callback. */
+ async_cb async;
+ void *async_data;
+ /* Callbacks to get echo of gdb dialog. */
+ stream_cb to_gdb_echo;
+ void *to_gdb_echo_data;
+ stream_cb from_gdb_echo;
+ void *from_gdb_echo_data;
+ /* Time out */
+ tm_cb time_out_cb;
+ void *time_out_cb_data;
+ int time_out;
+ /* Ugly workaround for some of the show responses :-( */
+ int catch_console;
+ char *catched_console;
+ /* MI version, currently unknown but the user can force v2 */
+ unsigned version;
+};
+typedef struct mi_h_struct mi_h;
+
+#define MI_TO(a) ((a)->to_gdb[1])
+
+enum mi_bkp_type { t_unknown=0, t_breakpoint=1, t_hw=2 };
+enum mi_bkp_disp { d_unknown=0, d_keep=1, d_del=2 };
+enum mi_bkp_mode { m_file_line=0, m_function=1, m_file_function=2, m_address=3 };
+
+struct mi_bkpt_struct
+{
+ int number;
+ enum mi_bkp_type type;
+ enum mi_bkp_disp disp; /* keep or del if temporal */
+ char enabled;
+ void *addr;
+ char *func;
+ char *file;
+ int line;
+ int ignore;
+ int times;
+
+ /* For the user: */
+ char *cond;
+ char *file_abs;
+ int thread;
+ enum mi_bkp_mode mode;
+ struct mi_bkpt_struct *next;
+};
+typedef struct mi_bkpt_struct mi_bkpt;
+
+enum mi_wp_mode { wm_unknown=0, wm_write=1, wm_read=2, wm_rw=3 };
+
+struct mi_wp_struct
+{
+ int number;
+ char *exp;
+ enum mi_wp_mode mode;
+
+ /* For the user: */
+ struct mi_wp_struct *next;
+ char enabled;
+};
+typedef struct mi_wp_struct mi_wp;
+
+struct mi_frames_struct
+{
+ int level; /* The frame number, 0 being the topmost frame, i.e. the innermost
+ function. */
+ void *addr; /* The `$pc' value for that frame. */
+ char *func; /* Function name. */
+ char *file; /* File name of the source file where the function lives. */
+ int line; /* Line number corresponding to the `$pc'. */
+ /* When arguments are available: */
+ mi_results *args;
+ int thread_id;
+ /* When more than one is provided: */
+ struct mi_frames_struct *next;
+};
+typedef struct mi_frames_struct mi_frames;
+
+struct mi_aux_term_struct
+{
+ pid_t pid;
+ char *tty;
+};
+typedef struct mi_aux_term_struct mi_aux_term;
+
+struct mi_pty_struct
+{
+ char *slave;
+ int master;
+};
+typedef struct mi_pty_struct mi_pty;
+
+enum mi_gvar_fmt { fm_natural=0, fm_binary=1, fm_decimal=2, fm_hexadecimal=3,
+ fm_octal=4,
+ /* Only for registers format: */
+ fm_raw=5 };
+enum mi_gvar_lang { lg_unknown=0, lg_c, lg_cpp, lg_java };
+
+#define MI_ATTR_DONT_KNOW 0
+#define MI_ATTR_NONEDITABLE 1
+#define MI_ATTR_EDITABLE 2
+
+struct mi_gvar_struct
+{
+ char *name;
+ int numchild;
+ char *type;
+ enum mi_gvar_fmt format;
+ enum mi_gvar_lang lang;
+ char *exp;
+ int attr;
+
+ /* MI v2 fills it, not yet implemented here. */
+ /* Use gmi_var_evaluate_expression. */
+ char *value;
+
+ /* Pointer to the parent. NULL if none. */
+ struct mi_gvar_struct *parent;
+ /* List containing the children.
+ Filled by gmi_var_list_children.
+ NULL if numchild==0 or not yet filled. */
+ struct mi_gvar_struct *child;
+ /* Next var in the list. */
+ struct mi_gvar_struct *next;
+
+ /* For the user: */
+ char opened; /* We will show its children. 1 when we fill "child" */
+ char changed; /* Needs to be updated. 0 when created. */
+ int vischild; /* How many items visible. numchild when we fill "child" */
+ int depth; /* How deep is this var. */
+ char ispointer;
+};
+typedef struct mi_gvar_struct mi_gvar;
+
+struct mi_gvar_chg_struct
+{
+ char *name;
+ int in_scope; /* if true the other fields apply. */
+ char *new_type; /* NULL if type_changed==false */
+ int new_num_children; /* only when new_type!=NULL */
+
+ struct mi_gvar_chg_struct *next;
+};
+typedef struct mi_gvar_chg_struct mi_gvar_chg;
+
+
+/* A list of assembler instructions. */
+struct mi_asm_insn_struct
+{
+ void *addr;
+ char *func;
+ unsigned offset;
+ char *inst;
+
+ struct mi_asm_insn_struct *next;
+};
+typedef struct mi_asm_insn_struct mi_asm_insn;
+
+/* A list of source lines containing assembler instructions. */
+struct mi_asm_insns_struct
+{
+ char *file;
+ int line;
+ mi_asm_insn *ins;
+
+ struct mi_asm_insns_struct *next;
+};
+typedef struct mi_asm_insns_struct mi_asm_insns;
+
+/* Changed register. */
+struct mi_chg_reg_struct
+{
+ int reg;
+ char *val;
+ char *name;
+ char updated;
+
+ struct mi_chg_reg_struct *next;
+};
+typedef struct mi_chg_reg_struct mi_chg_reg;
+
+/*
+ Examining gdb sources and looking at docs I can see the following "stop"
+reasons:
+
+Breakpoints:
+a) breakpoint-hit (bkptno) + frame
+Also: without reason for temporal breakpoints.
+
+Watchpoints:
+b) watchpoint-trigger (wpt={number,exp};value={old,new}) + frame
+c) read-watchpoint-trigger (hw-rwpt{number,exp};value={value}) + frame
+d) access-watchpoint-trigger (hw-awpt{number,exp};value={[old,]new}) + frame
+e) watchpoint-scope (wpnum) + frame
+
+Movement:
+f) function-finished ([gdb-result-var,return-value]) + frame
+g) location-reached + frame
+h) end-stepping-range + frame
+
+Exit:
+i) exited-signalled (signal-name,signal-meaning)
+j) exited (exit-code)
+k) exited-normally
+
+Signal:
+l) signal-received (signal-name,signal-meaning) + frame
+
+Plus: thread-id
+*/
+enum mi_stop_reason
+{
+ sr_unknown=0,
+ sr_bkpt_hit,
+ sr_wp_trigger, sr_read_wp_trigger, sr_access_wp_trigger, sr_wp_scope,
+ sr_function_finished, sr_location_reached, sr_end_stepping_range,
+ sr_exited_signalled, sr_exited, sr_exited_normally,
+ sr_signal_received
+};
+
+struct mi_stop_struct
+{
+ enum mi_stop_reason reason; /* If more than one reason just the last. */
+ /* Flags indicating if non-pointer fields are filled. */
+ char have_thread_id;
+ char have_bkptno;
+ char have_exit_code;
+ char have_wpno;
+ /* Where stopped. Doesn't exist for sr_exited*. */
+ int thread_id;
+ mi_frames *frame;
+ /* sr_bkpt_hit */
+ int bkptno;
+ /* sr_*wp_* no scope */
+ mi_wp *wp;
+ char *wp_old;
+ char *wp_val;
+ /* sr_wp_scope */
+ int wpno;
+ /* sr_function_finished. Not for void func. */
+ char *gdb_result_var;
+ char *return_value;
+ /* sr_exited_signalled, sr_signal_received */
+ char *signal_name;
+ char *signal_meaning;
+ /* sr_exited */
+ int exit_code;
+};
+typedef struct mi_stop_struct mi_stop;
+
+/* Variable containing the last error. */
+extern int mi_error;
+extern char *mi_error_from_gdb;
+const char *mi_get_error_str();
+
+/* Indicate the name of gdb exe. Default is /usr/bin/gdb */
+void mi_set_gdb_exe(const char *name);
+const char *mi_get_gdb_exe();
+/* Connect to a local copy of gdb. */
+mi_h *mi_connect_local();
+/* Close connection. You should ask gdb to quit first. */
+void mi_disconnect(mi_h *h);
+/* Force MI version. */
+#define MI_VERSION2U(maj,mid,min) (maj*0x1000000+mid*0x10000+min)
+void mi_force_version(mi_h *h, unsigned vMajor, unsigned vMiddle,
+ unsigned vMinor);
+void mi_set_workaround(unsigned wa, int enable);
+int mi_get_workaround(unsigned wa);
+/* Parse gdb output. */
+mi_output *mi_parse_gdb_output(const char *str);
+/* Functions to set/get the tunneled streams callbacks. */
+void mi_set_console_cb(mi_h *h, stream_cb cb, void *data);
+void mi_set_target_cb(mi_h *h, stream_cb cb, void *data);
+void mi_set_log_cb(mi_h *h, stream_cb cb, void *data);
+stream_cb mi_get_console_cb(mi_h *h, void **data);
+stream_cb mi_get_target_cb(mi_h *h, void **data);
+stream_cb mi_get_log_cb(mi_h *h, void **data);
+/* The callback to deal with async events. */
+void mi_set_async_cb(mi_h *h, async_cb cb, void *data);
+async_cb mi_get_async_cb(mi_h *h, void **data);
+/* Time out in gdb responses. */
+void mi_set_time_out_cb(mi_h *h, tm_cb cb, void *data);
+tm_cb mi_get_time_out_cb(mi_h *h, void **data);
+void mi_set_time_out(mi_h *h, int to);
+int mi_get_time_out(mi_h *h);
+/* Callbacks to "see" the dialog with gdb. */
+void mi_set_to_gdb_cb(mi_h *h, stream_cb cb, void *data);
+void mi_set_from_gdb_cb(mi_h *h, stream_cb cb, void *data);
+stream_cb mi_get_to_gdb_cb(mi_h *h, void **data);
+stream_cb mi_get_from_gdb_cb(mi_h *h, void **data);
+/* Sends a message to gdb. */
+int mi_send(mi_h *h, const char *format, ...);
+/* Wait until gdb sends a response. */
+mi_output *mi_get_response_blk(mi_h *h);
+/* Check if gdb sent a complete response. Use with mi_retire_response. */
+int mi_get_response(mi_h *h);
+/* Get the last response. Use with mi_get_response. */
+mi_output *mi_retire_response(mi_h *h);
+/* Look for a result record in gdb output. */
+mi_output *mi_get_rrecord(mi_output *r);
+/* Look if the output contains an async stop.
+ If that's the case return the reason for the stop.
+ If the output contains an error the description is returned in reason. */
+int mi_get_async_stop_reason(mi_output *r, char **reason);
+mi_stop *mi_get_stopped(mi_results *r);
+mi_frames *mi_get_async_frame(mi_output *r);
+/* Wait until gdb sends a response.
+ Then check if the response is of the desired type. */
+int mi_res_simple_exit(mi_h *h);
+int mi_res_simple_done(mi_h *h);
+int mi_res_simple_running(mi_h *h);
+int mi_res_simple_connected(mi_h *h);
+/* It additionally extracts an specified variable. */
+mi_results *mi_res_done_var(mi_h *h, const char *var);
+/* Extract a frames list from the response. */
+mi_frames *mi_res_frames_array(mi_h *h, const char *var);
+mi_frames *mi_res_frames_list(mi_h *h);
+mi_frames *mi_parse_frame(mi_results *c);
+mi_frames *mi_res_frame(mi_h *h);
+/* Create an auxiliar terminal using xterm. */
+mi_aux_term *gmi_start_xterm();
+/* Indicate the name of xterm exe. Default is /usr/bin/X11/xterm */
+void mi_set_xterm_exe(const char *name);
+const char *mi_get_xterm_exe();
+/* Kill the auxiliar terminal and release the structure. */
+void gmi_end_aux_term(mi_aux_term *t);
+/* Look for a free Linux VT for the child. */
+mi_aux_term *gmi_look_for_free_vt();
+/* Look for a free and usable Linux VT. */
+int mi_look_for_free_vt();
+/* Close master and release the structure. */
+void gmi_end_pty(mi_pty *p);
+/* Look for a free pseudo terminal. */
+mi_pty *gmi_look_for_free_pty();
+/* Extract a list of thread IDs from response. */
+int mi_res_thread_ids(mi_h *h, int **list);
+int mi_get_thread_ids(mi_output *res, int **list);
+/* A variable response. */
+mi_gvar *mi_res_gvar(mi_h *h, mi_gvar *cur, const char *expression);
+enum mi_gvar_fmt mi_format_str_to_enum(const char *format);
+const char *mi_format_enum_to_str(enum mi_gvar_fmt format);
+char mi_format_enum_to_char(enum mi_gvar_fmt format);
+enum mi_gvar_lang mi_lang_str_to_enum(const char *lang);
+const char *mi_lang_enum_to_str(enum mi_gvar_lang lang);
+int mi_res_changelist(mi_h *h, mi_gvar_chg **changed);
+int mi_res_children(mi_h *h, mi_gvar *v);
+mi_bkpt *mi_res_bkpt(mi_h *h);
+mi_wp *mi_res_wp(mi_h *h);
+char *mi_res_value(mi_h *h);
+mi_stop *mi_res_stop(mi_h *h);
+enum mi_stop_reason mi_reason_str_to_enum(const char *s);
+const char *mi_reason_enum_to_str(enum mi_stop_reason r);
+int mi_get_read_memory(mi_h *h, unsigned char *dest, unsigned ws, int *na,
+ unsigned long *addr);
+mi_asm_insns *mi_get_asm_insns(mi_h *h);
+/* Starting point of the program. */
+void mi_set_main_func(const char *name);
+const char *mi_get_main_func();
+mi_chg_reg *mi_get_list_registers(mi_h *h, int *how_many);
+int mi_get_list_registers_l(mi_h *h, mi_chg_reg *l);
+mi_chg_reg *mi_get_list_changed_regs(mi_h *h);
+int mi_get_reg_values(mi_h *h, mi_chg_reg *l);
+mi_chg_reg *mi_get_reg_values_l(mi_h *h, int *how_many);
+
+/* Allocation functions: */
+void *mi_calloc(size_t count, size_t sz);
+void *mi_calloc1(size_t sz);
+char *mi_malloc(size_t sz);
+mi_results *mi_alloc_results(void);
+mi_output *mi_alloc_output(void);
+mi_frames *mi_alloc_frames(void);
+mi_gvar *mi_alloc_gvar(void);
+mi_gvar_chg *mi_alloc_gvar_chg(void);
+mi_bkpt *mi_alloc_bkpt(void);
+mi_wp *mi_alloc_wp(void);
+mi_stop *mi_alloc_stop(void);
+mi_asm_insns *mi_alloc_asm_insns(void);
+mi_asm_insn *mi_alloc_asm_insn(void);
+mi_chg_reg *mi_alloc_chg_reg(void);
+void mi_free_output(mi_output *r);
+void mi_free_output_but(mi_output *r, mi_output *no, mi_results *no_r);
+void mi_free_frames(mi_frames *f);
+void mi_free_aux_term(mi_aux_term *t);
+void mi_free_results(mi_results *r);
+void mi_free_results_but(mi_results *r, mi_results *no);
+void mi_free_gvar(mi_gvar *v);
+void mi_free_gvar_chg(mi_gvar_chg *p);
+void mi_free_wp(mi_wp *wp);
+void mi_free_stop(mi_stop *s);
+void mi_free_asm_insns(mi_asm_insns *i);
+void mi_free_asm_insn(mi_asm_insn *i);
+void mi_free_charp_list(char **l);
+void mi_free_chg_reg(mi_chg_reg *r);
+
+/* Porgram control: */
+/* Specify the executable and arguments for local debug. */
+int gmi_set_exec(mi_h *h, const char *file, const char *args);
+/* Start running the executable. Remote sessions starts running. */
+int gmi_exec_run(mi_h *h);
+/* Continue the execution after a "stop". */
+int gmi_exec_continue(mi_h *h);
+/* Indicate which terminal will use the target program. For local sessions. */
+int gmi_target_terminal(mi_h *h, const char *tty_name);
+/* Specify what's the local copy that have debug info. For remote sessions. */
+int gmi_file_symbol_file(mi_h *h, const char *file);
+/* Continue until function return, the return value is included in the async
+ response. */
+int gmi_exec_finish(mi_h *h);
+/* Stop the program using SIGINT. */
+int gmi_exec_interrupt(mi_h *h);
+/* Next line of code. */
+int gmi_exec_next(mi_h *h);
+/* Next count lines of code. */
+int gmi_exec_next_cnt(mi_h *h, int count);
+/* Next line of assembler code. */
+int gmi_exec_next_instruction(mi_h *h);
+/* Next line of code. Get inside functions. */
+int gmi_exec_step(mi_h *h);
+/* Next count lines of code. Get inside functions. */
+int gmi_exec_step_cnt(mi_h *h, int count);
+/* Next line of assembler code. Get inside calls. */
+int gmi_exec_step_instruction(mi_h *h);
+/* Execute until location is reached. If file is NULL then is until next line. */
+int gmi_exec_until(mi_h *h, const char *file, int line);
+int gmi_exec_until_addr(mi_h *h, void *addr);
+/* Return to previous frame inmediatly. */
+mi_frames *gmi_exec_return(mi_h *h);
+/* Just kill the program. Please read the notes in prg_control.c. */
+int gmi_exec_kill(mi_h *h);
+
+/* Target manipulation: */
+/* Connect to a remote gdbserver using the specified methode. */
+int gmi_target_select(mi_h *h, const char *type, const char *params);
+/* Attach to an already running process. */
+mi_frames *gmi_target_attach(mi_h *h, pid_t pid);
+/* Detach from an attached process. */
+int gmi_target_detach(mi_h *h);
+
+/* Miscellaneous commands: */
+/* Exit gdb killing the child is it is running. */
+void gmi_gdb_exit(mi_h *h);
+/* Send the version to the console. */
+int gmi_gdb_version(mi_h *h);
+/* Set a gdb variable. */
+int gmi_gdb_set(mi_h *h, const char *var, const char *val);
+/* Get a gdb variable. */
+char *gmi_gdb_show(mi_h *h, const char *var);
+
+/* Breakpoints manipulation: */
+/* Insert a breakpoint at file:line. */
+mi_bkpt *gmi_break_insert(mi_h *h, const char *file, int line);
+/* Insert a breakpoint, all available options. */
+mi_bkpt *gmi_break_insert_full(mi_h *h, int temporary, int hard_assist,
+ const char *cond, int count, int thread,
+ const char *where);
+mi_bkpt *gmi_break_insert_full_fl(mi_h *h, const char *file, int line,
+ int temporary, int hard_assist,
+ const char *cond, int count, int thread);
+/* Remove a breakpoint. */
+int gmi_break_delete(mi_h *h, int number);
+/* Free the memory used for a breakpoint description. */
+void mi_free_bkpt(mi_bkpt *b);
+/* Modify the "ignore" count for a breakpoint. */
+int gmi_break_set_times(mi_h *h, int number, int count);
+/* Associate a condition with the breakpoint. */
+int gmi_break_set_condition(mi_h *h, int number, const char *condition);
+/* Enable or disable a breakpoint. */
+int gmi_break_state(mi_h *h, int number, int enable);
+/* Set a watchpoint. It doesn't work for remote targets! */
+mi_wp *gmi_break_watch(mi_h *h, enum mi_wp_mode mode, const char *exp);
+
+/* Data Manipulation. */
+/* Evaluate an expression. Returns a parsed tree. */
+char *gmi_data_evaluate_expression(mi_h *h, const char *expression);
+/* Path for sources. */
+int gmi_dir(mi_h *h, const char *path);
+/* A very limited "data read memory" implementation. */
+int gmi_read_memory(mi_h *h, const char *exp, unsigned size,
+ unsigned char *dest, int *na, int convAddr,
+ unsigned long *addr);
+mi_asm_insns *gmi_data_disassemble_se(mi_h *h, const char *start,
+ const char *end, int mode);
+mi_asm_insns *gmi_data_disassemble_fl(mi_h *h, const char *file, int line,
+ int lines, int mode);
+mi_chg_reg *gmi_data_list_register_names(mi_h *h, int *how_many);
+int gmi_data_list_register_names_l(mi_h *h, mi_chg_reg *l);
+mi_chg_reg *gmi_data_list_changed_registers(mi_h *h);
+int gmi_data_list_register_values(mi_h *h, enum mi_gvar_fmt fmt, mi_chg_reg *l);
+mi_chg_reg *gmi_data_list_all_register_values(mi_h *h, enum mi_gvar_fmt fmt, int *how_many);
+
+/* Stack manipulation. */
+/* List of frames. Arguments aren't filled. */
+mi_frames *gmi_stack_list_frames(mi_h *h);
+/* List of frames. Indicating a range. */
+mi_frames *gmi_stack_list_frames_r(mi_h *h, int from, int to);
+/* List arguments. Only level and args filled. */
+mi_frames *gmi_stack_list_arguments(mi_h *h, int show);
+/* List arguments. Indicating a range. Only level and args filled. */
+mi_frames *gmi_stack_list_arguments_r(mi_h *h, int show, int from, int to);
+/* Information about the current frame, including args. */
+mi_frames *gmi_stack_info_frame(mi_h *h);
+/* Stack info depth. error => -1 */
+int gmi_stack_info_depth_get(mi_h *h);
+/* Set stack info depth. error => -1 */
+int gmi_stack_info_depth(mi_h *h, int max_depth);
+/* Change current frame. */
+int gmi_stack_select_frame(mi_h *h, int framenum);
+/* List of local vars. */
+mi_results *gmi_stack_list_locals(mi_h *h, int show);
+
+/* Thread. */
+/* List available thread ids. */
+int gmi_thread_list_ids(mi_h *h, int **list);
+/* Select a thread. */
+mi_frames *gmi_thread_select(mi_h *h, int id);
+/* List available threads. */
+mi_frames *gmi_thread_list_all_threads(mi_h *h);
+
+/* Variable objects. */
+/* Create a variable object. */
+mi_gvar *gmi_var_create_nm(mi_h *h, const char *name, int frame, const char *exp);
+mi_gvar *gmi_var_create(mi_h *h, int frame, const char *exp);
+/* Create the variable and also fill the lang and attr fields. */
+mi_gvar *gmi_full_var_create(mi_h *h, int frame, const char *exp);
+/* Delete a variable object. Doesn't free the mi_gvar data. */
+int gmi_var_delete(mi_h *h, mi_gvar *var);
+/* Set the format used to represent the result. */
+int gmi_var_set_format(mi_h *h, mi_gvar *var, enum mi_gvar_fmt format);
+/* Fill the format field with info from gdb. */
+int gmi_var_show_format(mi_h *h, mi_gvar *var);
+/* Fill the numchild field with info from gdb. */
+int gmi_var_info_num_children(mi_h *h, mi_gvar *var);
+/* Fill the type field with info from gdb. */
+int gmi_var_info_type(mi_h *h, mi_gvar *var);
+/* Fill the expression and lang fields with info from gdb.
+ Note that lang isn't filled during creation. */
+int gmi_var_info_expression(mi_h *h, mi_gvar *var);
+/* Fill the attr field with info from gdb.
+ Note that attr isn't filled during creation. */
+int gmi_var_show_attributes(mi_h *h, mi_gvar *var);
+/* Update variable. Use NULL for all.
+ Note that *changed can be NULL if none updated. */
+int gmi_var_update(mi_h *h, mi_gvar *var, mi_gvar_chg **changed);
+/* Change variable. Fills the value field. */
+int gmi_var_assign(mi_h *h, mi_gvar *var, const char *expression);
+/* Get current value for a variable. */
+int gmi_var_evaluate_expression(mi_h *h, mi_gvar *var);
+/* List children. It ONLY returns the first level information. :-( */
+int gmi_var_list_children(mi_h *h, mi_gvar *var);
+
+#ifdef __cplusplus
+};
+
+/* C++ interface */
+
+/*
+ State Can:
+ disconnected Connect
+ connected SelectTarget, Disconnect
+ target_specified TargetUnselect, Run, Set breakpoints/watchpoints, etc.
+ running Stop
+ stopped Kill, Restart?, Step, Trace, Continue, etc.
+ [auto exit]
+
+ Modes:
+ dmX11 Local debug for X11.
+ dmLinux Local debug for Linux console.
+ dmRemote Remote debug.
+*/
+class MIDebugger
+{
+public:
+ MIDebugger();
+ ~MIDebugger();
+
+ enum eState { disconnected, connected, target_specified, running, stopped };
+ enum dMode { dmX11, dmLinux, dmRemote, dmPID };
+ enum endianType { enUnknown, enLittle, enBig };
+ // Currently tested architectures
+ enum archType { arUnknown, arIA32, arSPARC, arUnsupported };
+
+ int Connect(bool remote=false); /* remote is currently ignored. */
+ int Disconnect();
+ /* SelectTarget* */
+ int SelectTargetX11(const char *exec, const char *args=NULL,
+ const char *auxtty=NULL);
+ int SelectTargetLinux(const char *exec, const char *args,
+ const char *auxtty=NULL);
+ int SelectTargetRemote(const char *exec, const char *rparams,
+ const char *rtype=NULL);
+ // TODO: Linux PIDs can be represented as intergers. What should I use?
+ // ato_pid_t doesn't exist ;-)
+ mi_frames *SelectTargetPID(const char *exec, int pid);
+ int TargetUnselect();
+ int Run();
+ int Stop();
+ int Poll(mi_stop *&rs);
+ int Continue();
+ int RunOrContinue();
+ int Kill();
+ mi_bkpt *Breakpoint(const char *file, int line);
+ mi_bkpt *Breakpoint(const char *where, bool temporary=false, const char *cond=NULL,
+ int count=-1, int thread=-1, bool hard_assist=false);
+ mi_bkpt *BreakpointFull(const char *file, int line, bool temporary=false,
+ const char *cond=NULL, int count=-1, int thread=-1,
+ bool hard_assist=false);
+ mi_bkpt *Breakpoint(mi_bkpt *b);
+ int BreakDelete(mi_bkpt *b);
+ int BreakAfter(mi_bkpt *b)
+ {
+ if (state!=target_specified && state!=stopped)
+ return 0;
+ return gmi_break_set_times(h,b->number,b->ignore);
+ }
+ mi_wp *Watchpoint(enum mi_wp_mode mode, const char *exp);
+ int WatchDelete(mi_wp *w);
+ int RunToMain();
+ int StepOver(bool inst=false);
+ int TraceInto(bool inst=false);
+ int GoTo(const char *file, int line);
+ int GoTo(void *addr);
+ int FinishFun();
+ mi_frames *ReturnNow();
+ mi_frames *CallStack(bool args);
+ char *EvalExpression(const char *exp);
+ char *ModifyExpression(char *exp, char *newVal);
+ mi_gvar *AddgVar(const char *exp, int frame=-1)
+ {
+ if (state!=stopped)
+ return NULL;
+ return gmi_full_var_create(h,frame,exp);
+ }
+ int DelgVar(mi_gvar *var)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_delete(h,var);
+ }
+ int EvalgVar(mi_gvar *var)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_evaluate_expression(h,var);
+ }
+ int GetChildgVar(mi_gvar *var)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_list_children(h,var);
+ }
+ int FillTypeVal(mi_gvar *var);
+ int FillOneTypeVal(mi_gvar *var);
+ int FillAttr(mi_gvar *var)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_show_attributes(h,var);
+ }
+ int FillFormat(mi_gvar *var)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_show_format(h,var);
+ }
+ int SetFormatgVar(mi_gvar *var, enum mi_gvar_fmt format)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_set_format(h,var,format);
+ }
+ int ListChangedgVar(mi_gvar_chg *&changed)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_var_update(h,NULL,&changed);
+ }
+ int AssigngVar(mi_gvar *var, const char *exp);
+ int Send(const char *command);
+ int Version()
+ {
+ if (state==running || state==disconnected)
+ return 0;
+ return gmi_gdb_version(h);
+ }
+ int PathSources(const char *path)
+ {
+ if (state==running || state==disconnected)
+ return 0;
+ return gmi_dir(h,path);
+ }
+ int ReadMemory(const char *exp, unsigned size, unsigned char *dest,
+ int &na, int convAddr, unsigned long *addr)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_read_memory(h,exp,size,dest,&na,convAddr,addr);
+ }
+ char *Show(const char *var);
+ int ThreadListIDs(int *&list)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_thread_list_ids(h,&list);
+ }
+ mi_frames *ThreadList()
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_thread_list_all_threads(h);
+ }
+ mi_frames *ThreadSelect(int id)
+ {
+ if (state!=stopped)
+ return NULL;
+ return gmi_thread_select(h,id);
+ }
+ mi_asm_insns *Disassemble(const char *start, const char *end, int mode)
+ {
+ if (state!=stopped)
+ return NULL;
+ return gmi_data_disassemble_se(h,start,end,mode);
+ }
+ mi_asm_insns *Disassemble(const char *file, int line, int lines, int mode)
+ {
+ if (state!=stopped)
+ return NULL;
+ return gmi_data_disassemble_fl(h,file,line,lines,mode);
+ }
+ mi_chg_reg *GetRegisterNames(int *how_many)
+ {
+ if (state!=target_specified && state!=stopped)
+ return NULL;
+ return gmi_data_list_register_names(h,how_many);
+ }
+ int GetRegisterNames(mi_chg_reg *chg)
+ {
+ if (state!=target_specified && state!=stopped)
+ return 0;
+ return gmi_data_list_register_names_l(h,chg);
+ }
+ int GetRegisterValues(mi_chg_reg *chg)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_data_list_register_values(h,fm_natural,chg);
+ }
+ mi_chg_reg *GetRegisterValues(int *how_many)
+ {
+ if (state!=stopped)
+ return 0;
+ return gmi_data_list_all_register_values(h,fm_natural,how_many);
+ }
+ mi_chg_reg *GetChangedRegisters()
+ {
+ if (state!=stopped)
+ return NULL;
+ mi_chg_reg *chg=gmi_data_list_changed_registers(h);
+ if (chg && !gmi_data_list_register_values(h,fm_natural,chg))
+ {
+ mi_free_chg_reg(chg);
+ chg=NULL;
+ }
+ return chg;
+ }
+ int UpdateRegisters(mi_chg_reg *regs);
+
+ endianType GetTargetEndian();
+ archType GetTargetArchitecture();
+ eState GetState() { return state; }
+
+ /* Some wrappers */
+ static void SetGDBExe(const char *name) { mi_set_gdb_exe(name); }
+ static const char *GetGDBExe() { return mi_get_gdb_exe(); }
+ static void SetXTermExe(const char *name) { mi_set_xterm_exe(name); }
+ static const char *GetXTermExe() { return mi_get_xterm_exe(); }
+ static void SetMainFunc(const char *name) { mi_set_main_func(name); }
+ static const char *GetMainFunc() { return mi_get_main_func(); }
+
+ static const char *GetErrorStr() { return mi_get_error_str(); }
+ static const char *GetGDBError() { return mi_error_from_gdb; }
+ static int GetErrorNumber() { return mi_error; }
+ int GetErrorNumberSt();
+ void SetConsoleCB(stream_cb cb, void *data=NULL)
+ { mi_set_console_cb(h,cb,data); }
+ void SetTargetCB(stream_cb cb, void *data=NULL)
+ { mi_set_target_cb(h,cb,data); }
+ void SetLogCB(stream_cb cb, void *data=NULL)
+ { mi_set_log_cb(h,cb,data); }
+ void SetAsyncCB(async_cb cb, void *data=NULL)
+ { mi_set_async_cb(h,cb,data); }
+ void SetToGDBCB(stream_cb cb, void *data=NULL)
+ { mi_set_to_gdb_cb(h,cb,data); }
+ void SetFromGDBCB(stream_cb cb, void *data=NULL)
+ { mi_set_from_gdb_cb(h,cb,data); }
+ void SetTimeOutCB(tm_cb cb, void *data)
+ { mi_set_time_out_cb(h,cb,data); }
+ void SetTimeOut(int to)
+ { mi_set_time_out(h,to); }
+ void ForceMIVersion(unsigned vMajor, unsigned vMiddle, unsigned vMinor)
+ { mi_force_version(h,vMajor,vMiddle,vMinor); }
+
+ const char *GetAuxTTY()
+ { return aux_tty ? aux_tty->tty : NULL; }
+
+protected:
+ eState state;
+ dMode mode;
+ endianType targetEndian;
+ archType targetArch;
+ bool preRun; // Remote targets starts running but outside main.
+ mi_h *h;
+ mi_aux_term *aux_tty;
+ int waitingTempBkpt;
+
+ int SelectTargetTTY(const char *exec, const char *args, const char *auxtty,
+ dMode m);
+};
+
+#endif
+
diff --git a/setedit/libmigdb/src/misc.c b/setedit/libmigdb/src/misc.c
new file mode 100644
index 0000000..bc9c462
--- /dev/null
+++ b/setedit/libmigdb/src/misc.c
@@ -0,0 +1,109 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Miscellaneous commands.
+ Comments:
+ GDB/MI commands for the "Miscellaneous Commands" section.@p
+
+@<pre>
+gdb command: Implemented?
+
+-gdb-exit Yes
+-gdb-set Yes
+-gdb-show Yes
+-gdb-version Yes
+@</pre>
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_gdb_exit(mi_h *h)
+{
+ mi_send(h,"-gdb-exit\n");
+}
+
+void mi_gdb_version(mi_h *h)
+{
+ mi_send(h,"-gdb-version\n");
+}
+
+void mi_gdb_set(mi_h *h, const char *var, const char *val)
+{
+ mi_send(h,"-gdb-set %s %s\n",var,val);
+}
+
+void mi_gdb_show(mi_h *h, const char *var)
+{
+ mi_send(h,"-gdb-show %s\n",var);
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ Exit gdb killing the child is it is running.
+
+ Command: -gdb-exit
+
+***************************************************************************/
+
+void gmi_gdb_exit(mi_h *h)
+{
+ mi_gdb_exit(h);
+ mi_res_simple_exit(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Send the version to the console.
+
+ Command: -gdb-version
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_gdb_version(mi_h *h)
+{
+ mi_gdb_version(h);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Set a gdb variable.
+
+ Command: -gdb-set
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_gdb_set(mi_h *h, const char *var, const char *val)
+{
+ mi_gdb_set(h,var,val);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Get a gdb variable.
+
+ Command: -gdb-show
+ Return: The current value of the variable or NULL on error.
+
+***************************************************************************/
+
+char *gmi_gdb_show(mi_h *h, const char *var)
+{
+ mi_gdb_show(h,var);
+ return mi_res_value(h);
+}
+
diff --git a/setedit/libmigdb/src/parse.c b/setedit/libmigdb/src/parse.c
new file mode 100644
index 0000000..ba0bcfa
--- /dev/null
+++ b/setedit/libmigdb/src/parse.c
@@ -0,0 +1,1912 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Parser.
+ Comments:
+ Parses the output of gdb. It basically converts the text from gdb into a
+tree (could be a complex one) that we can easily interpret using C code.
+
+***************************************************************************/
+
+#include <ctype.h>
+#include <string.h>
+#include <assert.h>
+#include "mi_gdb.h"
+
+mi_results *mi_get_result(const char *str, const char **end);
+int mi_get_value(mi_results *r, const char *str, const char **end);
+
+
+/* GDB BUG!!!! I got:
+^error,msg="Problem parsing arguments: data-evaluate-expression ""1+2"""
+Afects gdb 2002-04-01-cvs and 6.1.1 for sure.
+That's an heuristical workaround.
+*/
+static inline
+int EndOfStr(const char *s)
+{
+ if (*s=='"')
+ {
+ s++;
+ return !*s || *s==',' || *s==']' || *s=='}';
+ }
+ return 0;
+}
+
+int mi_get_cstring_r(mi_results *r, const char *str, const char **end)
+{
+ const char *s;
+ char *d;
+ int len;
+
+ if (*str!='"')
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ str++;
+ /* Meassure. */
+ for (s=str, len=0; *s && !EndOfStr(s); s++)
+ {
+ if (*s=='\\')
+ {
+ if (!*s)
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ s++;
+ }
+ len++;
+ }
+ /* Copy. */
+ r->type=t_const;
+ d=r->v.cstr=mi_malloc(len+1);
+ if (!r->v.cstr)
+ return 0;
+ for (s=str; *s && !EndOfStr(s); s++, d++)
+ {
+ if (*s=='\\')
+ {
+ s++;
+ switch (*s)
+ {
+ case 'n':
+ *d='\n';
+ break;
+ case 't':
+ *d='\t';
+ break;
+ default:
+ *d=*s;
+ }
+ }
+ else
+ *d=*s;
+ }
+ *d=0;
+ if (end)
+ *end=s+1;
+
+ return 1;
+}
+
+/* TODO: What's a valid variable name?
+ I'll assume a-zA-Z0-9_- */
+inline
+int mi_is_var_name_char(char c)
+{
+ return isalnum(c) || c=='-' || c=='_';
+}
+
+char *mi_get_var_name(const char *str, const char **end)
+{
+ const char *s;
+ char *r;
+ int l;
+ /* Meassure. */
+ for (s=str; *s && mi_is_var_name_char(*s); s++);
+ if (*s!='=')
+ {
+ mi_error=MI_PARSER;
+ return NULL;
+ }
+ /* Allocate. */
+ l=s-str;
+ r=mi_malloc(l+1);
+ /* Copy. */
+ memcpy(r,str,l);
+ r[l]=0;
+ if (end)
+ *end=s+1;
+ return r;
+}
+
+
+int mi_get_list_res(mi_results *r, const char *str, const char **end, char closeC)
+{
+ mi_results *last_r, *rs;
+
+ last_r=NULL;
+ do
+ {
+ rs=mi_get_result(str,&str);
+ if (last_r)
+ last_r->next=rs;
+ else
+ r->v.rs=rs;
+ last_r=rs;
+ if (*str==closeC)
+ {
+ *end=str+1;
+ return 1;
+ }
+ if (*str!=',')
+ break;
+ str++;
+ }
+ while (1);
+
+ mi_error=MI_PARSER;
+ return 0;
+}
+
+#ifdef __APPLE__
+int mi_get_tuple_val(mi_results *r, const char *str, const char **end)
+{
+ mi_results *last_r, *rs;
+
+ last_r=NULL;
+ do
+ {
+ rs=mi_alloc_results();
+ if (!rs || !mi_get_value(rs,str,&str))
+ {
+ mi_free_results(rs);
+ return 0;
+ }
+ /* Note that rs->var is NULL, that indicates that's just a value and not
+ a result. */
+ if (last_r)
+ last_r->next=rs;
+ else
+ r->v.rs=rs;
+ last_r=rs;
+ if (*str=='}')
+ {
+ *end=str+1;
+ return 1;
+ }
+ if (*str!=',')
+ break;
+ str++;
+ }
+ while (1);
+
+ mi_error=MI_PARSER;
+ return 0;
+}
+#endif /* __APPLE__ */
+
+int mi_get_tuple(mi_results *r, const char *str, const char **end)
+{
+ if (*str!='{')
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ r->type=t_tuple;
+ str++;
+ if (*str=='}')
+ {/* Special case: empty tuple */
+ *end=str+1;
+ return 1;
+ }
+ #ifdef __APPLE__
+ if (mi_is_var_name_char(*str))
+ return mi_get_list_res(r,str,end,'}');
+ return mi_get_tuple_val(r,str,end);
+ #else /* __APPLE__ */
+ return mi_get_list_res(r,str,end,'}');
+ #endif /* __APPLE__ */
+}
+
+int mi_get_list_val(mi_results *r, const char *str, const char **end)
+{
+ mi_results *last_r, *rs;
+
+ last_r=NULL;
+ do
+ {
+ rs=mi_alloc_results();
+ if (!rs || !mi_get_value(rs,str,&str))
+ {
+ mi_free_results(rs);
+ return 0;
+ }
+ /* Note that rs->var is NULL, that indicates that's just a value and not
+ a result. */
+ if (last_r)
+ last_r->next=rs;
+ else
+ r->v.rs=rs;
+ last_r=rs;
+ if (*str==']')
+ {
+ *end=str+1;
+ return 1;
+ }
+ if (*str!=',')
+ break;
+ str++;
+ }
+ while (1);
+
+ mi_error=MI_PARSER;
+ return 0;
+}
+
+int mi_get_list(mi_results *r, const char *str, const char **end)
+{
+ if (*str!='[')
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ r->type=t_list;
+ str++;
+ if (*str==']')
+ {/* Special case: empty list */
+ *end=str+1;
+ return 1;
+ }
+ /* Comment: I think they could choose () for values. Is confusing in this way. */
+ if (mi_is_var_name_char(*str))
+ return mi_get_list_res(r,str,end,']');
+ return mi_get_list_val(r,str,end);
+}
+
+int mi_get_value(mi_results *r, const char *str, const char **end)
+{
+ switch (str[0])
+ {
+ case '"':
+ return mi_get_cstring_r(r,str,end);
+ case '{':
+ return mi_get_tuple(r,str,end);
+ case '[':
+ return mi_get_list(r,str,end);
+ }
+ mi_error=MI_PARSER;
+ return 0;
+}
+
+mi_results *mi_get_result(const char *str, const char **end)
+{
+ char *var;
+ mi_results *r;
+
+ var=mi_get_var_name(str,&str);
+ if (!var)
+ return NULL;
+
+ r=mi_alloc_results();
+ if (!r)
+ {
+ free(var);
+ return NULL;
+ }
+ r->var=var;
+
+ if (!mi_get_value(r,str,end))
+ {
+ mi_free_results(r);
+ return NULL;
+ }
+
+ return r;
+}
+
+mi_output *mi_get_results_alone(mi_output *r,const char *str)
+{
+ mi_results *last_r, *rs;
+
+ /* * results */
+ last_r=NULL;
+ do
+ {
+ if (!*str)
+ return r;
+ if (*str!=',')
+ {
+ mi_error=MI_PARSER;
+ break;
+ }
+ str++;
+ rs=mi_get_result(str,&str);
+ if (!rs)
+ break;
+ if (!last_r)
+ r->c=rs;
+ else
+ last_r->next=rs;
+ last_r=rs;
+ }
+ while (1);
+ mi_free_output(r);
+ return NULL;
+}
+
+mi_output *mi_parse_result_record(mi_output *r,const char *str)
+{
+ r->type=MI_T_RESULT_RECORD;
+
+ /* Solve the result-class. */
+ if (strncmp(str,"done",4)==0)
+ {
+ str+=4;
+ r->tclass=MI_CL_DONE;
+ }
+ else if (strncmp(str,"running",7)==0)
+ {
+ str+=7;
+ r->tclass=MI_CL_RUNNING;
+ }
+ else if (strncmp(str,"connected",9)==0)
+ {
+ str+=9;
+ r->tclass=MI_CL_CONNECTED;
+ }
+ else if (strncmp(str,"error",5)==0)
+ {
+ str+=5;
+ r->tclass=MI_CL_ERROR;
+ }
+ else if (strncmp(str,"exit",4)==0)
+ {
+ str+=4;
+ r->tclass=MI_CL_EXIT;
+ }
+ else
+ {
+ mi_error=MI_UNKNOWN_RESULT;
+ return NULL;
+ }
+
+ return mi_get_results_alone(r,str);
+}
+
+mi_output *mi_parse_asyn(mi_output *r,const char *str)
+{
+ r->type=MI_T_OUT_OF_BAND;
+ r->stype=MI_ST_ASYNC;
+ /* async-class. */
+ if (strncmp(str,"stopped",7))
+ {
+ mi_error=MI_UNKNOWN_ASYNC;
+ mi_free_output(r);
+ return NULL;
+ }
+ r->tclass=MI_CL_STOPPED;
+ str+=7;
+ return mi_get_results_alone(r,str);
+}
+
+mi_output *mi_parse_exec_asyn(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_EXEC;
+ return mi_parse_asyn(r,str);
+}
+
+mi_output *mi_parse_status_asyn(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_STATUS;
+ return mi_parse_asyn(r,str);
+}
+
+mi_output *mi_parse_notify_asyn(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_NOTIFY;
+ return mi_parse_asyn(r,str);
+}
+
+mi_output *mi_console(mi_output *r,const char *str)
+{
+ r->type=MI_T_OUT_OF_BAND;
+ r->stype=MI_ST_STREAM;
+ r->c=mi_alloc_results();
+ if (!r->c || !mi_get_cstring_r(r->c,str,NULL))
+ {
+ mi_free_output(r);
+ return NULL;
+ }
+ return r;
+}
+
+mi_output *mi_console_stream(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_CONSOLE;
+ return mi_console(r,str);
+}
+
+mi_output *mi_target_stream(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_TARGET;
+ return mi_console(r,str);
+}
+
+mi_output *mi_log_stream(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_LOG;
+ return mi_console(r,str);
+}
+
+mi_output *mi_parse_gdb_output(const char *str)
+{
+ char type=str[0];
+
+ mi_output *r=mi_alloc_output();
+ if (!r)
+ {
+ mi_error=MI_OUT_OF_MEMORY;
+ return NULL;
+ }
+ str++;
+ switch (type)
+ {
+ case '^':
+ return mi_parse_result_record(r,str);
+ case '*':
+ return mi_parse_exec_asyn(r,str);
+ case '+':
+ return mi_parse_status_asyn(r,str);
+ case '=':
+ return mi_parse_notify_asyn(r,str);
+ case '~':
+ return mi_console_stream(r,str);
+ case '@':
+ return mi_target_stream(r,str);
+ case '&':
+ return mi_log_stream(r,str);
+ }
+ mi_error=MI_PARSER;
+ return NULL;
+}
+
+mi_output *mi_get_rrecord(mi_output *r)
+{
+ if (!r)
+ return NULL;
+ while (r)
+ {
+ if (r->type==MI_T_RESULT_RECORD)
+ return r;
+ r=r->next;
+ }
+ return r;
+}
+
+mi_results *mi_get_var_r(mi_results *r, const char *var)
+{
+ while (r)
+ {
+ if (strcmp(r->var,var)==0)
+ return r;
+ r=r->next;
+ }
+ return NULL;
+}
+
+mi_results *mi_get_var(mi_output *res, const char *var)
+{
+ if (!res)
+ return NULL;
+ return mi_get_var_r(res->c,var);
+}
+
+int mi_get_async_stop_reason(mi_output *r, char **reason)
+{
+ int found_stopped=0;
+
+ *reason=NULL;
+ while (r)
+ {
+ if (r->type==MI_T_RESULT_RECORD && r->tclass==MI_CL_ERROR)
+ {
+ if (r->c->type==t_const)
+ *reason=r->c->v.cstr;
+ return 0;
+ }
+ if (r->type==MI_T_OUT_OF_BAND && r->stype==MI_ST_ASYNC &&
+ r->sstype==MI_SST_EXEC && r->tclass==MI_CL_STOPPED)
+ {
+ mi_results *p=r->c;
+ found_stopped=1;
+ while (p)
+ {
+ if (strcmp(p->var,"reason")==0)
+ {
+ *reason=p->v.cstr;
+ return 1;
+ }
+ p=p->next;
+ }
+ }
+ r=r->next;
+ }
+ if (*reason==NULL && found_stopped)
+ {
+ *reason=strdup("unknown (temp bkpt?)");
+ return 1;
+ }
+ return 0;
+}
+
+mi_frames *mi_get_async_frame(mi_output *r)
+{
+ while (r)
+ {
+ if (r->type==MI_T_OUT_OF_BAND && r->stype==MI_ST_ASYNC &&
+ r->sstype==MI_SST_EXEC && r->tclass==MI_CL_STOPPED)
+ {
+ mi_results *p=r->c;
+ while (p)
+ {
+ if (strcmp(p->var,"frame")==0)
+ return mi_parse_frame(p->v.rs);
+ p=p->next;
+ }
+ }
+ r=r->next;
+ }
+ return NULL;
+}
+
+int mi_res_simple(mi_h *h, int tclass, int accert_ret)
+{
+ mi_output *r, *res;
+ int ret=0;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+
+ if (res)
+ ret=res->tclass==tclass;
+ mi_free_output(r);
+
+ return ret;
+}
+
+
+int mi_res_simple_done(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_DONE,0);
+}
+
+int mi_res_simple_exit(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_EXIT,1);
+}
+
+int mi_res_simple_running(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_RUNNING,0);
+}
+
+int mi_res_simple_connected(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_CONNECTED,0);
+}
+
+mi_results *mi_res_var(mi_h *h, const char *var, int tclass)
+{
+ mi_output *r, *res;
+ mi_results *the_var=NULL;
+
+ r=mi_get_response_blk(h);
+ /* All the code that follows is "NULL" tolerant. */
+ /* Look for the result-record. */
+ res=mi_get_rrecord(r);
+ /* Look for the desired var. */
+ if (res && res->tclass==tclass)
+ the_var=mi_get_var(res,var);
+ /* Release all but the one we want. */
+ mi_free_output_but(r,NULL,the_var);
+ return the_var;
+}
+
+mi_results *mi_res_done_var(mi_h *h, const char *var)
+{
+ return mi_res_var(h,var,MI_CL_DONE);
+}
+
+mi_frames *mi_parse_frame(mi_results *c)
+{
+ mi_frames *res=mi_alloc_frames();
+ char *end;
+
+ if (res)
+ {
+ while (c)
+ {
+ if (c->type==t_const)
+ {
+ if (strcmp(c->var,"level")==0)
+ res->level=atoi(c->v.cstr);
+ else if (strcmp(c->var,"addr")==0)
+ res->addr=(void *)strtol(c->v.cstr,&end,0);
+ else if (strcmp(c->var,"func")==0)
+ {
+ res->func=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ else if (strcmp(c->var,"file")==0)
+ {
+ res->file=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ else if (strcmp(c->var,"line")==0)
+ res->line=atoi(c->v.cstr);
+ }
+ else if (c->type==t_list && strcmp(c->var,"args")==0)
+ {
+ res->args=c->v.rs;
+ c->v.rs=NULL;
+ }
+ c=c->next;
+ }
+ }
+ return res;
+}
+
+mi_frames *mi_res_frame(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"frame");
+ mi_frames *f=NULL;
+
+ if (r && r->type==t_tuple)
+ f=mi_parse_frame(r->v.rs);
+ mi_free_results(r);
+ return f;
+}
+
+mi_frames *mi_res_frames_array(mi_h *h, const char *var)
+{
+ mi_results *r=mi_res_done_var(h,var), *c;
+ mi_frames *res=NULL, *nframe, *last=NULL;
+
+ if (!r)
+ return NULL;
+#ifdef __APPLE__
+ if (r->type!=t_list && r->type!=t_tuple)
+#else
+ if (r->type!=t_list)
+#endif
+ {
+ mi_free_results(r);
+ return NULL;
+ }
+ c=r->v.rs;
+ while (c)
+ {
+ if (strcmp(c->var,"frame")==0 && c->type==t_tuple)
+ {
+ nframe=mi_parse_frame(c->v.rs);
+ if (nframe)
+ {
+ if (!last)
+ res=nframe;
+ else
+ last->next=nframe;
+ last=nframe;
+ }
+ }
+ c=c->next;
+ }
+ mi_free_results(r);
+ return res;
+}
+
+mi_frames *mi_res_frames_list(mi_h *h)
+{
+ mi_output *r, *res;
+ mi_frames *ret=NULL, *nframe, *last=NULL;
+ mi_results *c;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ {
+ c=res->c;
+ while (c)
+ {
+ if (strcmp(c->var,"frame")==0 && c->type==t_tuple)
+ {
+ nframe=mi_parse_frame(c->v.rs);
+ if (nframe)
+ {
+ if (!last)
+ ret=nframe;
+ else
+ last->next=nframe;
+ last=nframe;
+ }
+ }
+ c=c->next;
+ }
+ }
+ mi_free_output(r);
+ return ret;
+}
+
+int mi_get_thread_ids(mi_output *res, int **list)
+{
+ mi_results *vids, *lids;
+ int ids=-1, i;
+
+ *list=NULL;
+ vids=mi_get_var(res,"number-of-threads");
+ lids=mi_get_var(res,"thread-ids");
+ if (vids && vids->type==t_const &&
+ lids && lids->type==t_tuple)
+ {
+ ids=atoi(vids->v.cstr);
+ if (ids)
+ {
+ int *lst;
+ lst=(int *)mi_calloc(ids,sizeof(int));
+ if (lst)
+ {
+ lids=lids->v.rs;
+ i=0;
+ while (lids)
+ {
+ if (strcmp(lids->var,"thread-id")==0 && lids->type==t_const)
+ lst[i++]=atoi(lids->v.cstr);
+ lids=lids->next;
+ }
+ *list=lst;
+ }
+ else
+ ids=-1;
+ }
+ }
+ return ids;
+}
+
+int mi_res_thread_ids(mi_h *h, int **list)
+{
+ mi_output *r, *res;
+ int ids=-1;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ ids=mi_get_thread_ids(res,list);
+ mi_free_output(r);
+ return ids;
+}
+
+enum mi_gvar_lang mi_lang_str_to_enum(const char *lang)
+{
+ enum mi_gvar_lang lg=lg_unknown;
+
+ if (strcmp(lang,"C")==0)
+ lg=lg_c;
+ else if (strcmp(lang,"C++")==0)
+ lg=lg_cpp;
+ else if (strcmp(lang,"Java")==0)
+ lg=lg_java;
+
+ return lg;
+}
+
+const char *mi_lang_enum_to_str(enum mi_gvar_lang lang)
+{
+ const char *lg;
+
+ switch (lang)
+ {
+ case lg_c:
+ lg="C";
+ break;
+ case lg_cpp:
+ lg="C++";
+ break;
+ case lg_java:
+ lg="Java";
+ break;
+ /*case lg_unknown:*/
+ default:
+ lg="unknown";
+ break;
+ }
+ return lg;
+}
+
+enum mi_gvar_fmt mi_format_str_to_enum(const char *format)
+{
+ enum mi_gvar_fmt fmt=fm_natural;
+
+ if (strcmp(format,"binary")==0)
+ fmt=fm_binary;
+ else if (strcmp(format,"decimal")==0)
+ fmt=fm_decimal;
+ else if (strcmp(format,"hexadecimal")==0)
+ fmt=fm_hexadecimal;
+ else if (strcmp(format,"octal")==0)
+ fmt=fm_octal;
+
+ return fmt;
+}
+
+const char *mi_format_enum_to_str(enum mi_gvar_fmt format)
+{
+ const char *fmt;
+
+ switch (format)
+ {
+ case fm_natural:
+ fmt="natural";
+ break;
+ case fm_binary:
+ fmt="binary";
+ break;
+ case fm_decimal:
+ fmt="decimal";
+ break;
+ case fm_hexadecimal:
+ fmt="hexadecimal";
+ break;
+ case fm_octal:
+ fmt="octal";
+ break;
+ case fm_raw:
+ fmt="raw";
+ break;
+ default:
+ fmt="unknown";
+ }
+ return fmt;
+}
+
+char mi_format_enum_to_char(enum mi_gvar_fmt format)
+{
+ char fmt;
+
+ switch (format)
+ {
+ case fm_natural:
+ fmt='N';
+ break;
+ case fm_binary:
+ fmt='t';
+ break;
+ case fm_decimal:
+ fmt='d';
+ break;
+ case fm_hexadecimal:
+ fmt='x';
+ break;
+ case fm_octal:
+ fmt='o';
+ break;
+ case fm_raw:
+ fmt='r';
+ break;
+ default:
+ fmt=' ';
+ }
+ return fmt;
+}
+
+mi_gvar *mi_get_gvar(mi_output *o, mi_gvar *cur, const char *expression)
+{
+ mi_results *r;
+ mi_gvar *res=cur ? cur : mi_alloc_gvar();
+ int l;
+
+ if (!res)
+ return res;
+ r=o->c;
+ if (expression)
+ res->exp=strdup(expression);
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"name")==0)
+ {
+ free(res->name);
+ res->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"numchild")==0)
+ {
+ res->numchild=atoi(r->v.cstr);
+ }
+ else if (strcmp(r->var,"type")==0)
+ {
+ free(res->type);
+ res->type=r->v.cstr;
+ r->v.cstr=NULL;
+ l=strlen(res->type);
+ if (l && res->type[l-1]=='*')
+ res->ispointer=1;
+ }
+ else if (strcmp(r->var,"lang")==0)
+ {
+ res->lang=mi_lang_str_to_enum(r->v.cstr);
+ }
+ else if (strcmp(r->var,"exp")==0)
+ {
+ free(res->exp);
+ res->exp=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"format")==0)
+ {
+ res->format=mi_format_str_to_enum(r->v.cstr);
+ }
+ else if (strcmp(r->var,"attr")==0)
+ { /* Note: gdb 6.1.1 have only this: */
+ if (strcmp(r->v.cstr,"editable")==0)
+ res->attr=MI_ATTR_EDITABLE;
+ else /* noneditable */
+ res->attr=MI_ATTR_NONEDITABLE;
+ }
+ }
+ r=r->next;
+ }
+ return res;
+}
+
+mi_gvar *mi_res_gvar(mi_h *h, mi_gvar *cur, const char *expression)
+{
+ mi_output *r, *res;
+ mi_gvar *gvar=NULL;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ gvar=mi_get_gvar(res,cur,expression);
+ mi_free_output(r);
+ return gvar;
+}
+
+mi_gvar_chg *mi_get_gvar_chg(mi_results *r)
+{
+ mi_gvar_chg *n;
+
+ if (r->type!=t_const)
+ return NULL;
+ n=mi_alloc_gvar_chg();
+ if (n)
+ {
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"name")==0)
+ {
+ n->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"in_scope")==0)
+ {
+ n->in_scope=strcmp(r->v.cstr,"true")==0;
+ }
+ else if (strcmp(r->var,"new_type")==0)
+ {
+ n->new_type=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"new_num_children")==0)
+ {
+ n->new_num_children=atoi(r->v.cstr);
+ }
+ // type_changed="false" is the default
+ }
+ r=r->next;
+ }
+ }
+ return n;
+}
+
+int mi_res_changelist(mi_h *h, mi_gvar_chg **changed)
+{
+ mi_gvar_chg *last, *n;
+ mi_results *res=mi_res_done_var(h,"changelist"), *r;
+ int count=0;
+
+ *changed=NULL;
+ if (!res)
+ return 0;
+ last=NULL;
+ count=1;
+ n=NULL;
+ r=res->v.rs;
+
+ if (res->type==t_list)
+ {// MI v2 a list of tuples
+ while (r)
+ {
+ if (r->type==t_tuple)
+ {
+ n=mi_get_gvar_chg(r->v.rs);
+ if (n)
+ {
+ if (last)
+ last->next=n;
+ else
+ *changed=n;
+ last=n;
+ count++;
+ }
+ }
+ r=r->next;
+ }
+ }
+ else if (res->type==t_tuple)
+ {// MI v1 a tuple with all together *8-P
+ while (r)
+ {
+ if (r->type==t_const) /* Just in case. */
+ {/* Get one var. */
+ if (strcmp(r->var,"name")==0)
+ {
+ if (n)
+ {/* Add to the list*/
+ if (last)
+ last->next=n;
+ else
+ *changed=n;
+ last=n;
+ count++;
+ }
+ n=mi_alloc_gvar_chg();
+ if (!n)
+ {
+ mi_free_gvar_chg(*changed);
+ return 0;
+ }
+ n->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"in_scope")==0)
+ {
+ n->in_scope=strcmp(r->v.cstr,"true")==0;
+ }
+ else if (strcmp(r->var,"new_type")==0)
+ {
+ n->new_type=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"new_num_children")==0)
+ {
+ n->new_num_children=atoi(r->v.cstr);
+ }
+ // type_changed="false" is the default
+ }
+ r=r->next;
+ }
+ if (n)
+ {/* Add to the list*/
+ if (last)
+ last->next=n;
+ else
+ *changed=n;
+ last=n;
+ count++;
+ }
+ }
+ mi_free_results(res);
+
+ return count;
+}
+
+int mi_get_children(mi_results *ch, mi_gvar *v)
+{
+ mi_gvar *cur=NULL, *aux;
+ int i=0, count=v->numchild, l;
+
+ while (ch)
+ {
+ if (strcmp(ch->var,"child")==0 && ch->type==t_tuple && i<count)
+ {
+ mi_results *r=ch->v.rs;
+ aux=mi_alloc_gvar();
+ if (!aux)
+ return 0;
+ if (!v->child)
+ v->child=aux;
+ else
+ cur->next=aux;
+ cur=aux;
+ cur->parent=v;
+ cur->depth=v->depth+1;
+
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"name")==0)
+ {
+ cur->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"exp")==0)
+ {
+ cur->exp=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"type")==0)
+ {
+ cur->type=r->v.cstr;
+ r->v.cstr=NULL;
+ l=strlen(cur->type);
+ if (l && cur->type[l-1]=='*')
+ cur->ispointer=1;
+ }
+ else if (strcmp(r->var,"value")==0)
+ {
+ cur->value=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"numchild")==0)
+ {
+ cur->numchild=atoi(r->v.cstr);
+ }
+ }
+ r=r->next;
+ }
+ i++;
+ }
+ ch=ch->next;
+ }
+ v->vischild=i;
+ v->opened=1;
+ return i==v->numchild;
+}
+
+int mi_res_children(mi_h *h, mi_gvar *v)
+{
+ mi_output *r, *res;
+ int ok=0;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ {
+ mi_results *num=mi_get_var(res,"numchild");
+ if (num && num->type==t_const)
+ {
+ v->numchild=atoi(num->v.cstr);
+ if (v->child)
+ {
+ mi_free_gvar(v->child);
+ v->child=NULL;
+ }
+ if (v->numchild)
+ {
+ mi_results *ch =mi_get_var(res,"children");
+ if (ch && ch->type!=t_const) /* MI v1 tuple, MI v2 list */
+ ok=mi_get_children(ch->v.rs,v);
+ }
+ else
+ ok=1;
+ }
+ }
+ mi_free_output(r);
+ return ok;
+}
+
+mi_bkpt *mi_get_bkpt(mi_results *p)
+{
+ mi_bkpt *res;
+ char *end;
+
+ res=mi_alloc_bkpt();
+ if (!res)
+ return NULL;
+ while (p)
+ {
+ if (p->type==t_const && p->var)
+ {
+ if (strcmp(p->var,"number")==0)
+ res->number=atoi(p->v.cstr);
+ else if (strcmp(p->var,"type")==0)
+ {
+ if (strcmp(p->v.cstr,"breakpoint")==0)
+ res->type=t_breakpoint;
+ else
+ res->type=t_unknown;
+ }
+ else if (strcmp(p->var,"disp")==0)
+ {
+ if (strcmp(p->v.cstr,"keep")==0)
+ res->disp=d_keep;
+ else if (strcmp(p->v.cstr,"del")==0)
+ res->disp=d_del;
+ else
+ res->disp=d_unknown;
+ }
+ else if (strcmp(p->var,"enabled")==0)
+ res->enabled=p->v.cstr[0]=='y';
+ else if (strcmp(p->var,"addr")==0)
+ res->addr=(void *)strtol(p->v.cstr,&end,0);
+ else if (strcmp(p->var,"func")==0)
+ {
+ res->func=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ else if (strcmp(p->var,"file")==0)
+ {
+ res->file=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ else if (strcmp(p->var,"line")==0)
+ res->line=atoi(p->v.cstr);
+ else if (strcmp(p->var,"times")==0)
+ res->times=atoi(p->v.cstr);
+ else if (strcmp(p->var,"ignore")==0)
+ res->ignore=atoi(p->v.cstr);
+ else if (strcmp(p->var,"cond")==0)
+ {
+ res->cond=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ }
+ p=p->next;
+ }
+ return res;
+}
+
+mi_bkpt *mi_res_bkpt(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"bkpt");
+ mi_bkpt *b=NULL;
+
+ if (r && r->type==t_tuple)
+ b=mi_get_bkpt(r->v.rs);
+ mi_free_results(r);
+ return b;
+}
+
+mi_wp *mi_get_wp(mi_results *p, enum mi_wp_mode m)
+{
+ mi_wp *res=mi_alloc_wp();
+
+ if (res)
+ {
+ res->mode=m;
+ while (p)
+ {
+ if (p->type==t_const && p->var)
+ {
+ if (strcmp(p->var,"number")==0)
+ {
+ res->number=atoi(p->v.cstr);
+ res->enabled=1;
+ }
+ else if (strcmp(p->var,"exp")==0)
+ {
+ res->exp=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ }
+ p=p->next;
+ }
+ }
+ return res;
+}
+
+mi_wp *mi_parse_wp_res(mi_output *r)
+{
+ mi_results *p;
+ enum mi_wp_mode m=wm_unknown;
+
+ /* The info is in a result wpt=... */
+ p=r->c;
+ while (p)
+ {
+ if (p->var)
+ {
+ if (strcmp(p->var,"wpt")==0)
+ m=wm_write;
+ else if (strcmp(p->var,"hw-rwpt")==0)
+ m=wm_read;
+ else if (strcmp(p->var,"hw-awpt")==0)
+ m=wm_rw;
+ if (m!=wm_unknown)
+ break;
+ }
+ p=p->next;
+ }
+ if (!p || p->type!=t_tuple)
+ return NULL;
+ /* Scan the values inside it. */
+ return mi_get_wp(p->v.rs,m);
+}
+
+mi_wp *mi_res_wp(mi_h *h)
+{
+ mi_output *r, *res;
+ mi_wp *ret=NULL;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+
+ if (res)
+ ret=mi_parse_wp_res(res);
+
+ mi_free_output(r);
+ return ret;
+}
+
+char *mi_res_value(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"value");
+ char *s=NULL;
+
+ if (r && r->type==t_const)
+ {
+ s=r->v.cstr;
+ r->v.rs=NULL;
+ }
+ mi_free_results(r);
+ return s;
+}
+
+mi_output *mi_get_stop_record(mi_output *r)
+{
+ while (r)
+ {
+ if (r->type==MI_T_OUT_OF_BAND && r->stype==MI_ST_ASYNC &&
+ r->sstype==MI_SST_EXEC && r->tclass==MI_CL_STOPPED)
+ return r;
+ r=r->next;
+ }
+ return r;
+}
+
+static
+char *reason_names[]=
+{
+ "breakpoint-hit",
+ "watchpoint-trigger",
+ "read-watchpoint-trigger",
+ "access-watchpoint-trigger",
+ "watchpoint-scope",
+ "function-finished",
+ "location-reached",
+ "end-stepping-range",
+ "exited-signalled",
+ "exited",
+ "exited-normally",
+ "signal-received"
+};
+
+static
+enum mi_stop_reason reason_values[]=
+{
+ sr_bkpt_hit,
+ sr_wp_trigger, sr_read_wp_trigger, sr_access_wp_trigger, sr_wp_scope,
+ sr_function_finished, sr_location_reached, sr_end_stepping_range,
+ sr_exited_signalled, sr_exited, sr_exited_normally,
+ sr_signal_received
+};
+
+static
+char *reason_expl[]=
+{
+ "Hit a breakpoint",
+ "Write watchpoint",
+ "Read watchpoint",
+ "Access watchpoint",
+ "Watchpoint out of scope",
+ "Function finished",
+ "Location reached",
+ "End of stepping",
+ "Exited signalled",
+ "Exited with error",
+ "Exited normally",
+ "Signal received"
+};
+
+enum mi_stop_reason mi_reason_str_to_enum(const char *s)
+{
+ int i;
+
+ for (i=0; i<sizeof(reason_names)/sizeof(char *); i++)
+ if (strcmp(reason_names[i],s)==0)
+ return reason_values[i];
+ return sr_unknown;
+}
+
+const char *mi_reason_enum_to_str(enum mi_stop_reason r)
+{
+ int i;
+
+ if (r==sr_unknown)
+ return "Unknown (temp bkp?)";
+ for (i=0; i<sizeof(reason_values)/sizeof(char *); i++)
+ if (reason_values[i]==r)
+ return reason_expl[i];
+ return NULL;
+}
+
+mi_stop *mi_get_stopped(mi_results *r)
+{
+ mi_stop *res=mi_alloc_stop();
+
+ if (res)
+ {
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"reason")==0)
+ res->reason=mi_reason_str_to_enum(r->v.cstr);
+ else if (!res->have_thread_id && strcmp(r->var,"thread-id")==0)
+ {
+ res->have_thread_id=1;
+ res->thread_id=atoi(r->v.cstr);
+ }
+ else if (!res->have_bkptno && strcmp(r->var,"bkptno")==0)
+ {
+ res->have_bkptno=1;
+ res->bkptno=atoi(r->v.cstr);
+ }
+ else if (!res->have_bkptno && strcmp(r->var,"wpnum")==0)
+ {
+ res->have_wpno=1;
+ res->wpno=atoi(r->v.cstr);
+ }
+ else if (strcmp(r->var,"gdb-result-var")==0)
+ {
+ res->gdb_result_var=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"return-value")==0)
+ {
+ res->return_value=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"signal-name")==0)
+ {
+ res->signal_name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"signal-meaning")==0)
+ {
+ res->signal_meaning=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (!res->have_exit_code && strcmp(r->var,"exit-code")==0)
+ {
+ res->have_exit_code=1;
+ res->exit_code=atoi(r->v.cstr);
+ }
+ }
+ else // tuple or list
+ {
+ if (strcmp(r->var,"frame")==0)
+ res->frame=mi_parse_frame(r->v.rs);
+ else if (!res->wp && strcmp(r->var,"wpt")==0)
+ res->wp=mi_get_wp(r->v.rs,wm_write);
+ else if (!res->wp && strcmp(r->var,"hw-rwpt")==0)
+ res->wp=mi_get_wp(r->v.rs,wm_read);
+ else if (!res->wp && strcmp(r->var,"hw-awpt")==0)
+ res->wp=mi_get_wp(r->v.rs,wm_rw);
+ else if (!(res->wp_old || res->wp_val) && strcmp(r->var,"value")==0)
+ {
+ mi_results *p=r->v.rs;
+ while (p)
+ {
+ if (strcmp(p->var,"value")==0 || strcmp(p->var,"new")==0)
+ {
+ res->wp_val=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ else if (strcmp(p->var,"old")==0)
+ {
+ res->wp_old=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ p=p->next;
+ }
+ }
+ }
+ r=r->next;
+ }
+ }
+ return res;
+}
+
+mi_stop *mi_res_stop(mi_h *h)
+{
+ mi_output *o=mi_retire_response(h);
+ mi_stop *stop=NULL;
+
+ if (o)
+ {
+ mi_output *sr=mi_get_stop_record(o);
+ if (sr)
+ stop=mi_get_stopped(sr->c);
+ }
+ mi_free_output(o);
+
+ return stop;
+}
+
+int mi_get_read_memory(mi_h *h, unsigned char *dest, unsigned ws, int *na,
+ unsigned long *addr)
+{
+ char *end;
+ mi_results *res=mi_res_done_var(h,"memory"), *r;
+ int ok=0;
+
+ *na=0;
+ r=res;
+ if (r && r->type==t_list && ws==1)
+ {
+ r=r->v.rs;
+ if (r->type!=t_tuple)
+ {
+ mi_free_results(res);
+ return 0;
+ }
+ r=r->v.rs;
+ while (r)
+ {
+ if (r->type==t_list && strcmp(r->var,"data")==0)
+ {
+ mi_results *data=r->v.rs;
+ ok++;
+ if (data && data->type==t_const &&
+ strcmp(data->v.cstr,"N/A")==0)
+ *na=1;
+ else
+ while (data)
+ {
+ if (data->type==t_const)
+ *(dest++)=strtol(data->v.cstr,&end,0);
+ data=data->next;
+ }
+ }
+ else if (r->type==t_const && strcmp(r->var,"addr")==0)
+ {
+ ok++;
+ if (addr)
+ *addr=strtoul(r->v.cstr,&end,0);
+ }
+ r=r->next;
+ }
+
+ }
+ mi_free_results(res);
+ return ok==2;
+}
+
+mi_asm_insn *mi_parse_insn(mi_results *c)
+{
+ mi_asm_insn *res=NULL, *cur=NULL;
+ mi_results *sub;
+ char *end;
+
+ while (c)
+ {
+ if (c->type==t_tuple)
+ {
+ if (!res)
+ res=cur=mi_alloc_asm_insn();
+ else
+ {
+ cur->next=mi_alloc_asm_insn();
+ cur=cur->next;
+ }
+ if (!cur)
+ {
+ mi_free_asm_insn(res);
+ return NULL;
+ }
+ sub=c->v.rs;
+ while (sub)
+ {
+ if (sub->type==t_const)
+ {
+ if (strcmp(sub->var,"address")==0)
+ cur->addr=(void *)strtol(sub->v.cstr,&end,0);
+ else if (strcmp(sub->var,"func-name")==0)
+ {
+ cur->func=sub->v.cstr;
+ sub->v.cstr=NULL;
+ }
+ else if (strcmp(sub->var,"offset")==0)
+ cur->offset=atoi(sub->v.cstr);
+ else if (strcmp(sub->var,"inst")==0)
+ {
+ cur->inst=sub->v.cstr;
+ sub->v.cstr=NULL;
+ }
+ }
+ sub=sub->next;
+ }
+ }
+ c=c->next;
+ }
+ return res;
+}
+
+mi_asm_insns *mi_parse_insns(mi_results *c)
+{
+ mi_asm_insns *res=NULL, *cur=NULL;
+ mi_results *sub;
+
+ while (c)
+ {
+ if (c->var)
+ {
+ if (strcmp(c->var,"src_and_asm_line")==0 && c->type==t_tuple)
+ {
+ if (!res)
+ res=cur=mi_alloc_asm_insns();
+ else
+ {
+ cur->next=mi_alloc_asm_insns();
+ cur=cur->next;
+ }
+ if (!cur)
+ {
+ mi_free_asm_insns(res);
+ return NULL;
+ }
+ sub=c->v.rs;
+ while (sub)
+ {
+ if (sub->var)
+ {
+ if (sub->type==t_const)
+ {
+ if (strcmp(sub->var,"line")==0)
+ cur->line=atoi(sub->v.cstr);
+ else if (strcmp(sub->var,"file")==0)
+ {
+ cur->file=sub->v.cstr;
+ sub->v.cstr=NULL;
+ }
+ }
+ else if (sub->type==t_list)
+ {
+ if (strcmp(sub->var,"line_asm_insn")==0)
+ cur->ins=mi_parse_insn(sub->v.rs);
+ }
+ }
+ sub=sub->next;
+ }
+ }
+ }
+ else
+ {/* No source line, just instructions */
+ res=mi_alloc_asm_insns();
+ res->ins=mi_parse_insn(c);
+ break;
+ }
+ c=c->next;
+ }
+ return res;
+}
+
+
+mi_asm_insns *mi_get_asm_insns(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"asm_insns");
+ mi_asm_insns *f=NULL;
+
+ if (r && r->type==t_list)
+ f=mi_parse_insns(r->v.rs);
+ mi_free_results(r);
+ return f;
+}
+
+mi_chg_reg *mi_parse_list_regs(mi_results *r, int *how_many)
+{
+ mi_results *c=r;
+ int cregs=0;
+ mi_chg_reg *first=NULL, *cur=NULL;
+
+ /* Create the list. */
+ while (c)
+ {
+ if (c->type==t_const && !c->var)
+ {
+ if (first)
+ cur=cur->next=mi_alloc_chg_reg();
+ else
+ first=cur=mi_alloc_chg_reg();
+ cur->name=c->v.cstr;
+ cur->reg=cregs++;
+ c->v.cstr=NULL;
+ }
+ c=c->next;
+ }
+ if (how_many)
+ *how_many=cregs;
+
+ return first;
+}
+
+mi_chg_reg *mi_get_list_registers(mi_h *h, int *how_many)
+{
+ mi_results *r=mi_res_done_var(h,"register-names");
+ mi_chg_reg *l=NULL;
+
+ if (r && r->type==t_list)
+ l=mi_parse_list_regs(r->v.rs,how_many);
+ mi_free_results(r);
+ return l;
+}
+
+mi_chg_reg *mi_parse_list_changed_regs(mi_results *r)
+{
+ mi_results *c=r;
+ mi_chg_reg *first=NULL, *cur=NULL;
+
+ /* Create the list. */
+ while (c)
+ {
+ if (c->type==t_const && !c->var)
+ {
+ if (first)
+ cur=cur->next=mi_alloc_chg_reg();
+ else
+ first=cur=mi_alloc_chg_reg();
+ cur->reg=atoi(c->v.cstr);
+ }
+ c=c->next;
+ }
+
+ return first;
+}
+
+mi_chg_reg *mi_get_list_changed_regs(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"changed-registers");
+ mi_chg_reg *changed=NULL;
+
+ if (r && r->type==t_list)
+ changed=mi_parse_list_changed_regs(r->v.rs);
+ mi_free_results(r);
+ return changed;
+}
+
+int mi_parse_reg_values(mi_results *r, mi_chg_reg *l)
+{
+ mi_results *c;
+
+ while (r && l)
+ {
+ if (r->type==t_tuple && !r->var)
+ {
+ c=r->v.rs;
+ while (c)
+ {
+ if (c->type==t_const && c->var)
+ {
+ if (strcmp(c->var,"number")==0)
+ {
+ if (atoi(c->v.cstr)!=l->reg)
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ }
+ else if (strcmp(c->var,"value")==0)
+ {
+ l->val=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ }
+ c=c->next;
+ }
+ }
+ r=r->next;
+ l=l->next;
+ }
+
+ return !l && !r;
+}
+
+int mi_get_reg_values(mi_h *h, mi_chg_reg *l)
+{
+ mi_results *r=mi_res_done_var(h,"register-values");
+ int ok=0;
+
+ if (r && r->type==t_list)
+ ok=mi_parse_reg_values(r->v.rs,l);
+ mi_free_results(r);
+ return ok;
+}
+
+int mi_parse_list_regs_l(mi_results *r, mi_chg_reg *l)
+{
+ while (r && l)
+ {
+ if (r->type==t_const && !r->var)
+ {
+ free(l->name);
+ l->name=r->v.cstr;
+ r->v.cstr=NULL;
+ l=l->next;
+ }
+ r=r->next;
+ }
+
+ return !l && !r;
+}
+
+int mi_get_list_registers_l(mi_h *h, mi_chg_reg *l)
+{
+ mi_results *r=mi_res_done_var(h,"register-names");
+ int ok=0;
+
+ if (r && r->type==t_list)
+ ok=mi_parse_list_regs_l(r->v.rs,l);
+ mi_free_results(r);
+ return ok;
+}
+
+mi_chg_reg *mi_parse_reg_values_l(mi_results *r, int *how_many)
+{
+ mi_results *c;
+ mi_chg_reg *first=NULL, *cur=NULL;
+ *how_many=0;
+
+ while (r)
+ {
+ if (r->type==t_tuple && !r->var)
+ {
+ c=r->v.rs;
+ if (first)
+ cur=cur->next=mi_alloc_chg_reg();
+ else
+ first=cur=mi_alloc_chg_reg();
+ while (c)
+ {
+ if (c->type==t_const && c->var)
+ {
+ if (strcmp(c->var,"number")==0)
+ {
+ cur->reg=atoi(c->v.cstr);
+ (*how_many)++;
+ }
+ else if (strcmp(c->var,"value")==0)
+ {
+ cur->val=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ }
+ c=c->next;
+ }
+ }
+ r=r->next;
+ }
+
+ return first;
+}
+
+mi_chg_reg *mi_get_reg_values_l(mi_h *h, int *how_many)
+{
+ mi_results *r=mi_res_done_var(h,"register-values");
+ mi_chg_reg *rgs=NULL;
+
+ if (r && r->type==t_list)
+ rgs=mi_parse_reg_values_l(r->v.rs,how_many);
+ mi_free_results(r);
+ return rgs;
+}
+
+
diff --git a/setedit/libmigdb/src/parse.c.orig b/setedit/libmigdb/src/parse.c.orig
new file mode 100644
index 0000000..9746458
--- /dev/null
+++ b/setedit/libmigdb/src/parse.c.orig
@@ -0,0 +1,1908 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Parser.
+ Comments:
+ Parses the output of gdb. It basically converts the text from gdb into a
+tree (could be a complex one) that we can easily interpret using C code.
+
+***************************************************************************/
+
+#include <ctype.h>
+#include <string.h>
+#include <assert.h>
+#include "mi_gdb.h"
+
+mi_results *mi_get_result(const char *str, const char **end);
+int mi_get_value(mi_results *r, const char *str, const char **end);
+
+
+/* GDB BUG!!!! I got:
+^error,msg="Problem parsing arguments: data-evaluate-expression ""1+2"""
+Afects gdb 2002-04-01-cvs and 6.1.1 for sure.
+That's an heuristical workaround.
+*/
+static inline
+int EndOfStr(const char *s)
+{
+ if (*s=='"')
+ {
+ s++;
+ return !*s || *s==',' || *s==']' || *s=='}';
+ }
+ return 0;
+}
+
+int mi_get_cstring_r(mi_results *r, const char *str, const char **end)
+{
+ const char *s;
+ char *d;
+ int len;
+
+ if (*str!='"')
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ str++;
+ /* Meassure. */
+ for (s=str, len=0; *s && !EndOfStr(s); s++)
+ {
+ if (*s=='\\')
+ {
+ if (!*s)
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ s++;
+ }
+ len++;
+ }
+ /* Copy. */
+ r->type=t_const;
+ d=r->v.cstr=mi_malloc(len+1);
+ if (!r->v.cstr)
+ return 0;
+ for (s=str; *s && !EndOfStr(s); s++, d++)
+ {
+ if (*s=='\\')
+ {
+ s++;
+ switch (*s)
+ {
+ case 'n':
+ *d='\n';
+ break;
+ case 't':
+ *d='\t';
+ break;
+ default:
+ *d=*s;
+ }
+ }
+ else
+ *d=*s;
+ }
+ *d=0;
+ if (end)
+ *end=s+1;
+
+ return 1;
+}
+
+/* TODO: What's a valid variable name?
+ I'll assume a-zA-Z0-9_- */
+inline
+int mi_is_var_name_char(char c)
+{
+ return isalnum(c) || c=='-' || c=='_';
+}
+
+char *mi_get_var_name(const char *str, const char **end)
+{
+ const char *s;
+ char *r;
+ int l;
+ /* Meassure. */
+ for (s=str; *s && mi_is_var_name_char(*s); s++);
+ if (*s!='=')
+ {
+ mi_error=MI_PARSER;
+ return NULL;
+ }
+ /* Allocate. */
+ l=s-str;
+ r=mi_malloc(l+1);
+ /* Copy. */
+ memcpy(r,str,l);
+ r[l]=0;
+ if (end)
+ *end=s+1;
+ return r;
+}
+
+
+int mi_get_list_res(mi_results *r, const char *str, const char **end, char closeC)
+{
+ mi_results *last_r, *rs;
+
+ last_r=NULL;
+ do
+ {
+ rs=mi_get_result(str,&str);
+ if (last_r)
+ last_r->next=rs;
+ else
+ r->v.rs=rs;
+ last_r=rs;
+ if (*str==closeC)
+ {
+ *end=str+1;
+ return 1;
+ }
+ if (*str!=',')
+ break;
+ str++;
+ }
+ while (1);
+
+ mi_error=MI_PARSER;
+ return 0;
+}
+
+#ifdef __APPLE__
+int mi_get_tuple_val(mi_results *r, const char *str, const char **end)
+{
+ mi_results *last_r, *rs;
+
+ last_r=NULL;
+ do
+ {
+ rs=mi_alloc_results();
+ if (!rs || !mi_get_value(rs,str,&str))
+ {
+ mi_free_results(rs);
+ return 0;
+ }
+ /* Note that rs->var is NULL, that indicates that's just a value and not
+ a result. */
+ if (last_r)
+ last_r->next=rs;
+ else
+ r->v.rs=rs;
+ last_r=rs;
+ if (*str=='}')
+ {
+ *end=str+1;
+ return 1;
+ }
+ if (*str!=',')
+ break;
+ str++;
+ }
+ while (1);
+
+ mi_error=MI_PARSER;
+ return 0;
+}
+#endif /* __APPLE__ */
+
+int mi_get_tuple(mi_results *r, const char *str, const char **end)
+{
+ if (*str!='{')
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ r->type=t_tuple;
+ str++;
+ if (*str=='}')
+ {/* Special case: empty tuple */
+ *end=str+1;
+ return 1;
+ }
+ #ifdef __APPLE__
+ if (mi_is_var_name_char(*str))
+ return mi_get_list_res(r,str,end,'}');
+ return mi_get_tuple_val(r,str,end);
+ #else /* __APPLE__ */
+ return mi_get_list_res(r,str,end,'}');
+ #endif /* __APPLE__ */
+}
+
+int mi_get_list_val(mi_results *r, const char *str, const char **end)
+{
+ mi_results *last_r, *rs;
+
+ last_r=NULL;
+ do
+ {
+ rs=mi_alloc_results();
+ if (!rs || !mi_get_value(rs,str,&str))
+ {
+ mi_free_results(rs);
+ return 0;
+ }
+ /* Note that rs->var is NULL, that indicates that's just a value and not
+ a result. */
+ if (last_r)
+ last_r->next=rs;
+ else
+ r->v.rs=rs;
+ last_r=rs;
+ if (*str==']')
+ {
+ *end=str+1;
+ return 1;
+ }
+ if (*str!=',')
+ break;
+ str++;
+ }
+ while (1);
+
+ mi_error=MI_PARSER;
+ return 0;
+}
+
+int mi_get_list(mi_results *r, const char *str, const char **end)
+{
+ if (*str!='[')
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ r->type=t_list;
+ str++;
+ if (*str==']')
+ {/* Special case: empty list */
+ *end=str+1;
+ return 1;
+ }
+ /* Comment: I think they could choose () for values. Is confusing in this way. */
+ if (mi_is_var_name_char(*str))
+ return mi_get_list_res(r,str,end,']');
+ return mi_get_list_val(r,str,end);
+}
+
+int mi_get_value(mi_results *r, const char *str, const char **end)
+{
+ switch (str[0])
+ {
+ case '"':
+ return mi_get_cstring_r(r,str,end);
+ case '{':
+ return mi_get_tuple(r,str,end);
+ case '[':
+ return mi_get_list(r,str,end);
+ }
+ mi_error=MI_PARSER;
+ return 0;
+}
+
+mi_results *mi_get_result(const char *str, const char **end)
+{
+ char *var;
+ mi_results *r;
+
+ var=mi_get_var_name(str,&str);
+ if (!var)
+ return NULL;
+
+ r=mi_alloc_results();
+ if (!r)
+ {
+ free(var);
+ return NULL;
+ }
+ r->var=var;
+
+ if (!mi_get_value(r,str,end))
+ {
+ mi_free_results(r);
+ return NULL;
+ }
+
+ return r;
+}
+
+mi_output *mi_get_results_alone(mi_output *r,const char *str)
+{
+ mi_results *last_r, *rs;
+
+ /* * results */
+ last_r=NULL;
+ do
+ {
+ if (!*str)
+ return r;
+ if (*str!=',')
+ {
+ mi_error=MI_PARSER;
+ break;
+ }
+ str++;
+ rs=mi_get_result(str,&str);
+ if (!rs)
+ break;
+ if (!last_r)
+ r->c=rs;
+ else
+ last_r->next=rs;
+ last_r=rs;
+ }
+ while (1);
+ mi_free_output(r);
+ return NULL;
+}
+
+mi_output *mi_parse_result_record(mi_output *r,const char *str)
+{
+ r->type=MI_T_RESULT_RECORD;
+
+ /* Solve the result-class. */
+ if (strncmp(str,"done",4)==0)
+ {
+ str+=4;
+ r->tclass=MI_CL_DONE;
+ }
+ else if (strncmp(str,"running",7)==0)
+ {
+ str+=7;
+ r->tclass=MI_CL_RUNNING;
+ }
+ else if (strncmp(str,"connected",9)==0)
+ {
+ str+=9;
+ r->tclass=MI_CL_CONNECTED;
+ }
+ else if (strncmp(str,"error",5)==0)
+ {
+ str+=5;
+ r->tclass=MI_CL_ERROR;
+ }
+ else if (strncmp(str,"exit",4)==0)
+ {
+ str+=4;
+ r->tclass=MI_CL_EXIT;
+ }
+ else
+ {
+ mi_error=MI_UNKNOWN_RESULT;
+ return NULL;
+ }
+
+ return mi_get_results_alone(r,str);
+}
+
+mi_output *mi_parse_asyn(mi_output *r,const char *str)
+{
+ r->type=MI_T_OUT_OF_BAND;
+ r->stype=MI_ST_ASYNC;
+ /* async-class. */
+ if (strncmp(str,"stopped",7))
+ {
+ mi_error=MI_UNKNOWN_ASYNC;
+ mi_free_output(r);
+ return NULL;
+ }
+ r->tclass=MI_CL_STOPPED;
+ str+=7;
+ return mi_get_results_alone(r,str);
+}
+
+mi_output *mi_parse_exec_asyn(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_EXEC;
+ return mi_parse_asyn(r,str);
+}
+
+mi_output *mi_parse_status_asyn(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_STATUS;
+ return mi_parse_asyn(r,str);
+}
+
+mi_output *mi_parse_notify_asyn(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_NOTIFY;
+ return mi_parse_asyn(r,str);
+}
+
+mi_output *mi_console(mi_output *r,const char *str)
+{
+ r->type=MI_T_OUT_OF_BAND;
+ r->stype=MI_ST_STREAM;
+ r->c=mi_alloc_results();
+ if (!r->c || !mi_get_cstring_r(r->c,str,NULL))
+ {
+ mi_free_output(r);
+ return NULL;
+ }
+ return r;
+}
+
+mi_output *mi_console_stream(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_CONSOLE;
+ return mi_console(r,str);
+}
+
+mi_output *mi_target_stream(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_TARGET;
+ return mi_console(r,str);
+}
+
+mi_output *mi_log_stream(mi_output *r,const char *str)
+{
+ r->sstype=MI_SST_LOG;
+ return mi_console(r,str);
+}
+
+mi_output *mi_parse_gdb_output(const char *str)
+{
+ char type=str[0];
+
+ mi_output *r=mi_alloc_output();
+ if (!r)
+ {
+ mi_error=MI_OUT_OF_MEMORY;
+ return NULL;
+ }
+ str++;
+ switch (type)
+ {
+ case '^':
+ return mi_parse_result_record(r,str);
+ case '*':
+ return mi_parse_exec_asyn(r,str);
+ case '+':
+ return mi_parse_status_asyn(r,str);
+ case '=':
+ return mi_parse_notify_asyn(r,str);
+ case '~':
+ return mi_console_stream(r,str);
+ case '@':
+ return mi_target_stream(r,str);
+ case '&':
+ return mi_log_stream(r,str);
+ }
+ mi_error=MI_PARSER;
+ return NULL;
+}
+
+mi_output *mi_get_rrecord(mi_output *r)
+{
+ if (!r)
+ return NULL;
+ while (r)
+ {
+ if (r->type==MI_T_RESULT_RECORD)
+ return r;
+ r=r->next;
+ }
+ return r;
+}
+
+mi_results *mi_get_var_r(mi_results *r, const char *var)
+{
+ while (r)
+ {
+ if (strcmp(r->var,var)==0)
+ return r;
+ r=r->next;
+ }
+ return NULL;
+}
+
+mi_results *mi_get_var(mi_output *res, const char *var)
+{
+ if (!res)
+ return NULL;
+ return mi_get_var_r(res->c,var);
+}
+
+int mi_get_async_stop_reason(mi_output *r, char **reason)
+{
+ int found_stopped=0;
+
+ *reason=NULL;
+ while (r)
+ {
+ if (r->type==MI_T_RESULT_RECORD && r->tclass==MI_CL_ERROR)
+ {
+ if (r->c->type==t_const)
+ *reason=r->c->v.cstr;
+ return 0;
+ }
+ if (r->type==MI_T_OUT_OF_BAND && r->stype==MI_ST_ASYNC &&
+ r->sstype==MI_SST_EXEC && r->tclass==MI_CL_STOPPED)
+ {
+ mi_results *p=r->c;
+ found_stopped=1;
+ while (p)
+ {
+ if (strcmp(p->var,"reason")==0)
+ {
+ *reason=p->v.cstr;
+ return 1;
+ }
+ p=p->next;
+ }
+ }
+ r=r->next;
+ }
+ if (*reason==NULL && found_stopped)
+ {
+ *reason=strdup("unknown (temp bkpt?)");
+ return 1;
+ }
+ return 0;
+}
+
+mi_frames *mi_get_async_frame(mi_output *r)
+{
+ while (r)
+ {
+ if (r->type==MI_T_OUT_OF_BAND && r->stype==MI_ST_ASYNC &&
+ r->sstype==MI_SST_EXEC && r->tclass==MI_CL_STOPPED)
+ {
+ mi_results *p=r->c;
+ while (p)
+ {
+ if (strcmp(p->var,"frame")==0)
+ return mi_parse_frame(p->v.rs);
+ p=p->next;
+ }
+ }
+ r=r->next;
+ }
+ return NULL;
+}
+
+int mi_res_simple(mi_h *h, int tclass, int accert_ret)
+{
+ mi_output *r, *res;
+ int ret=0;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+
+ if (res)
+ ret=res->tclass==tclass;
+ mi_free_output(r);
+
+ return ret;
+}
+
+
+int mi_res_simple_done(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_DONE,0);
+}
+
+int mi_res_simple_exit(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_EXIT,1);
+}
+
+int mi_res_simple_running(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_RUNNING,0);
+}
+
+int mi_res_simple_connected(mi_h *h)
+{
+ return mi_res_simple(h,MI_CL_CONNECTED,0);
+}
+
+mi_results *mi_res_var(mi_h *h, const char *var, int tclass)
+{
+ mi_output *r, *res;
+ mi_results *the_var=NULL;
+
+ r=mi_get_response_blk(h);
+ /* All the code that follows is "NULL" tolerant. */
+ /* Look for the result-record. */
+ res=mi_get_rrecord(r);
+ /* Look for the desired var. */
+ if (res && res->tclass==tclass)
+ the_var=mi_get_var(res,var);
+ /* Release all but the one we want. */
+ mi_free_output_but(r,NULL,the_var);
+ return the_var;
+}
+
+mi_results *mi_res_done_var(mi_h *h, const char *var)
+{
+ return mi_res_var(h,var,MI_CL_DONE);
+}
+
+mi_frames *mi_parse_frame(mi_results *c)
+{
+ mi_frames *res=mi_alloc_frames();
+ char *end;
+
+ if (res)
+ {
+ while (c)
+ {
+ if (c->type==t_const)
+ {
+ if (strcmp(c->var,"level")==0)
+ res->level=atoi(c->v.cstr);
+ else if (strcmp(c->var,"addr")==0)
+ res->addr=(void *)strtol(c->v.cstr,&end,0);
+ else if (strcmp(c->var,"func")==0)
+ {
+ res->func=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ else if (strcmp(c->var,"file")==0)
+ {
+ res->file=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ else if (strcmp(c->var,"line")==0)
+ res->line=atoi(c->v.cstr);
+ }
+ else if (c->type==t_list && strcmp(c->var,"args")==0)
+ {
+ res->args=c->v.rs;
+ c->v.rs=NULL;
+ }
+ c=c->next;
+ }
+ }
+ return res;
+}
+
+mi_frames *mi_res_frame(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"frame");
+ mi_frames *f=NULL;
+
+ if (r && r->type==t_tuple)
+ f=mi_parse_frame(r->v.rs);
+ mi_free_results(r);
+ return f;
+}
+
+mi_frames *mi_res_frames_array(mi_h *h, const char *var)
+{
+ mi_results *r=mi_res_done_var(h,var), *c;
+ mi_frames *res=NULL, *nframe, *last=NULL;
+
+ if (!r)
+ return NULL;
+ if (r->type!=t_list)
+ {
+ mi_free_results(r);
+ return NULL;
+ }
+ c=r->v.rs;
+ while (c)
+ {
+ if (strcmp(c->var,"frame")==0 && c->type==t_tuple)
+ {
+ nframe=mi_parse_frame(c->v.rs);
+ if (nframe)
+ {
+ if (!last)
+ res=nframe;
+ else
+ last->next=nframe;
+ last=nframe;
+ }
+ }
+ c=c->next;
+ }
+ mi_free_results(r);
+ return res;
+}
+
+mi_frames *mi_res_frames_list(mi_h *h)
+{
+ mi_output *r, *res;
+ mi_frames *ret=NULL, *nframe, *last=NULL;
+ mi_results *c;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ {
+ c=res->c;
+ while (c)
+ {
+ if (strcmp(c->var,"frame")==0 && c->type==t_tuple)
+ {
+ nframe=mi_parse_frame(c->v.rs);
+ if (nframe)
+ {
+ if (!last)
+ ret=nframe;
+ else
+ last->next=nframe;
+ last=nframe;
+ }
+ }
+ c=c->next;
+ }
+ }
+ mi_free_output(r);
+ return ret;
+}
+
+int mi_get_thread_ids(mi_output *res, int **list)
+{
+ mi_results *vids, *lids;
+ int ids=-1, i;
+
+ *list=NULL;
+ vids=mi_get_var(res,"number-of-threads");
+ lids=mi_get_var(res,"thread-ids");
+ if (vids && vids->type==t_const &&
+ lids && lids->type==t_tuple)
+ {
+ ids=atoi(vids->v.cstr);
+ if (ids)
+ {
+ int *lst;
+ lst=(int *)mi_calloc(ids,sizeof(int));
+ if (lst)
+ {
+ lids=lids->v.rs;
+ i=0;
+ while (lids)
+ {
+ if (strcmp(lids->var,"thread-id")==0 && lids->type==t_const)
+ lst[i++]=atoi(lids->v.cstr);
+ lids=lids->next;
+ }
+ *list=lst;
+ }
+ else
+ ids=-1;
+ }
+ }
+ return ids;
+}
+
+int mi_res_thread_ids(mi_h *h, int **list)
+{
+ mi_output *r, *res;
+ int ids=-1;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ ids=mi_get_thread_ids(res,list);
+ mi_free_output(r);
+ return ids;
+}
+
+enum mi_gvar_lang mi_lang_str_to_enum(const char *lang)
+{
+ enum mi_gvar_lang lg=lg_unknown;
+
+ if (strcmp(lang,"C")==0)
+ lg=lg_c;
+ else if (strcmp(lang,"C++")==0)
+ lg=lg_cpp;
+ else if (strcmp(lang,"Java")==0)
+ lg=lg_java;
+
+ return lg;
+}
+
+const char *mi_lang_enum_to_str(enum mi_gvar_lang lang)
+{
+ const char *lg;
+
+ switch (lang)
+ {
+ case lg_c:
+ lg="C";
+ break;
+ case lg_cpp:
+ lg="C++";
+ break;
+ case lg_java:
+ lg="Java";
+ break;
+ /*case lg_unknown:*/
+ default:
+ lg="unknown";
+ break;
+ }
+ return lg;
+}
+
+enum mi_gvar_fmt mi_format_str_to_enum(const char *format)
+{
+ enum mi_gvar_fmt fmt=fm_natural;
+
+ if (strcmp(format,"binary")==0)
+ fmt=fm_binary;
+ else if (strcmp(format,"decimal")==0)
+ fmt=fm_decimal;
+ else if (strcmp(format,"hexadecimal")==0)
+ fmt=fm_hexadecimal;
+ else if (strcmp(format,"octal")==0)
+ fmt=fm_octal;
+
+ return fmt;
+}
+
+const char *mi_format_enum_to_str(enum mi_gvar_fmt format)
+{
+ const char *fmt;
+
+ switch (format)
+ {
+ case fm_natural:
+ fmt="natural";
+ break;
+ case fm_binary:
+ fmt="binary";
+ break;
+ case fm_decimal:
+ fmt="decimal";
+ break;
+ case fm_hexadecimal:
+ fmt="hexadecimal";
+ break;
+ case fm_octal:
+ fmt="octal";
+ break;
+ case fm_raw:
+ fmt="raw";
+ break;
+ default:
+ fmt="unknown";
+ }
+ return fmt;
+}
+
+char mi_format_enum_to_char(enum mi_gvar_fmt format)
+{
+ char fmt;
+
+ switch (format)
+ {
+ case fm_natural:
+ fmt='N';
+ break;
+ case fm_binary:
+ fmt='t';
+ break;
+ case fm_decimal:
+ fmt='d';
+ break;
+ case fm_hexadecimal:
+ fmt='x';
+ break;
+ case fm_octal:
+ fmt='o';
+ break;
+ case fm_raw:
+ fmt='r';
+ break;
+ default:
+ fmt=' ';
+ }
+ return fmt;
+}
+
+mi_gvar *mi_get_gvar(mi_output *o, mi_gvar *cur, const char *expression)
+{
+ mi_results *r;
+ mi_gvar *res=cur ? cur : mi_alloc_gvar();
+ int l;
+
+ if (!res)
+ return res;
+ r=o->c;
+ if (expression)
+ res->exp=strdup(expression);
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"name")==0)
+ {
+ free(res->name);
+ res->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"numchild")==0)
+ {
+ res->numchild=atoi(r->v.cstr);
+ }
+ else if (strcmp(r->var,"type")==0)
+ {
+ free(res->type);
+ res->type=r->v.cstr;
+ r->v.cstr=NULL;
+ l=strlen(res->type);
+ if (l && res->type[l-1]=='*')
+ res->ispointer=1;
+ }
+ else if (strcmp(r->var,"lang")==0)
+ {
+ res->lang=mi_lang_str_to_enum(r->v.cstr);
+ }
+ else if (strcmp(r->var,"exp")==0)
+ {
+ free(res->exp);
+ res->exp=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"format")==0)
+ {
+ res->format=mi_format_str_to_enum(r->v.cstr);
+ }
+ else if (strcmp(r->var,"attr")==0)
+ { /* Note: gdb 6.1.1 have only this: */
+ if (strcmp(r->v.cstr,"editable")==0)
+ res->attr=MI_ATTR_EDITABLE;
+ else /* noneditable */
+ res->attr=MI_ATTR_NONEDITABLE;
+ }
+ }
+ r=r->next;
+ }
+ return res;
+}
+
+mi_gvar *mi_res_gvar(mi_h *h, mi_gvar *cur, const char *expression)
+{
+ mi_output *r, *res;
+ mi_gvar *gvar=NULL;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ gvar=mi_get_gvar(res,cur,expression);
+ mi_free_output(r);
+ return gvar;
+}
+
+mi_gvar_chg *mi_get_gvar_chg(mi_results *r)
+{
+ mi_gvar_chg *n;
+
+ if (r->type!=t_const)
+ return NULL;
+ n=mi_alloc_gvar_chg();
+ if (n)
+ {
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"name")==0)
+ {
+ n->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"in_scope")==0)
+ {
+ n->in_scope=strcmp(r->v.cstr,"true")==0;
+ }
+ else if (strcmp(r->var,"new_type")==0)
+ {
+ n->new_type=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"new_num_children")==0)
+ {
+ n->new_num_children=atoi(r->v.cstr);
+ }
+ // type_changed="false" is the default
+ }
+ r=r->next;
+ }
+ }
+ return n;
+}
+
+int mi_res_changelist(mi_h *h, mi_gvar_chg **changed)
+{
+ mi_gvar_chg *last, *n;
+ mi_results *res=mi_res_done_var(h,"changelist"), *r;
+ int count=0;
+
+ *changed=NULL;
+ if (!res)
+ return 0;
+ last=NULL;
+ count=1;
+ n=NULL;
+ r=res->v.rs;
+
+ if (res->type==t_list)
+ {// MI v2 a list of tuples
+ while (r)
+ {
+ if (r->type==t_tuple)
+ {
+ n=mi_get_gvar_chg(r->v.rs);
+ if (n)
+ {
+ if (last)
+ last->next=n;
+ else
+ *changed=n;
+ last=n;
+ count++;
+ }
+ }
+ r=r->next;
+ }
+ }
+ else if (res->type==t_tuple)
+ {// MI v1 a tuple with all together *8-P
+ while (r)
+ {
+ if (r->type==t_const) /* Just in case. */
+ {/* Get one var. */
+ if (strcmp(r->var,"name")==0)
+ {
+ if (n)
+ {/* Add to the list*/
+ if (last)
+ last->next=n;
+ else
+ *changed=n;
+ last=n;
+ count++;
+ }
+ n=mi_alloc_gvar_chg();
+ if (!n)
+ {
+ mi_free_gvar_chg(*changed);
+ return 0;
+ }
+ n->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"in_scope")==0)
+ {
+ n->in_scope=strcmp(r->v.cstr,"true")==0;
+ }
+ else if (strcmp(r->var,"new_type")==0)
+ {
+ n->new_type=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"new_num_children")==0)
+ {
+ n->new_num_children=atoi(r->v.cstr);
+ }
+ // type_changed="false" is the default
+ }
+ r=r->next;
+ }
+ if (n)
+ {/* Add to the list*/
+ if (last)
+ last->next=n;
+ else
+ *changed=n;
+ last=n;
+ count++;
+ }
+ }
+ mi_free_results(res);
+
+ return count;
+}
+
+int mi_get_children(mi_results *ch, mi_gvar *v)
+{
+ mi_gvar *cur=NULL, *aux;
+ int i=0, count=v->numchild, l;
+
+ while (ch)
+ {
+ if (strcmp(ch->var,"child")==0 && ch->type==t_tuple && i<count)
+ {
+ mi_results *r=ch->v.rs;
+ aux=mi_alloc_gvar();
+ if (!aux)
+ return 0;
+ if (!v->child)
+ v->child=aux;
+ else
+ cur->next=aux;
+ cur=aux;
+ cur->parent=v;
+ cur->depth=v->depth+1;
+
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"name")==0)
+ {
+ cur->name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"exp")==0)
+ {
+ cur->exp=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"type")==0)
+ {
+ cur->type=r->v.cstr;
+ r->v.cstr=NULL;
+ l=strlen(cur->type);
+ if (l && cur->type[l-1]=='*')
+ cur->ispointer=1;
+ }
+ else if (strcmp(r->var,"value")==0)
+ {
+ cur->value=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"numchild")==0)
+ {
+ cur->numchild=atoi(r->v.cstr);
+ }
+ }
+ r=r->next;
+ }
+ i++;
+ }
+ ch=ch->next;
+ }
+ v->vischild=i;
+ v->opened=1;
+ return i==v->numchild;
+}
+
+int mi_res_children(mi_h *h, mi_gvar *v)
+{
+ mi_output *r, *res;
+ int ok=0;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+ if (res && res->tclass==MI_CL_DONE)
+ {
+ mi_results *num=mi_get_var(res,"numchild");
+ if (num && num->type==t_const)
+ {
+ v->numchild=atoi(num->v.cstr);
+ if (v->child)
+ {
+ mi_free_gvar(v->child);
+ v->child=NULL;
+ }
+ if (v->numchild)
+ {
+ mi_results *ch =mi_get_var(res,"children");
+ if (ch && ch->type!=t_const) /* MI v1 tuple, MI v2 list */
+ ok=mi_get_children(ch->v.rs,v);
+ }
+ else
+ ok=1;
+ }
+ }
+ mi_free_output(r);
+ return ok;
+}
+
+mi_bkpt *mi_get_bkpt(mi_results *p)
+{
+ mi_bkpt *res;
+ char *end;
+
+ res=mi_alloc_bkpt();
+ if (!res)
+ return NULL;
+ while (p)
+ {
+ if (p->type==t_const && p->var)
+ {
+ if (strcmp(p->var,"number")==0)
+ res->number=atoi(p->v.cstr);
+ else if (strcmp(p->var,"type")==0)
+ {
+ if (strcmp(p->v.cstr,"breakpoint")==0)
+ res->type=t_breakpoint;
+ else
+ res->type=t_unknown;
+ }
+ else if (strcmp(p->var,"disp")==0)
+ {
+ if (strcmp(p->v.cstr,"keep")==0)
+ res->disp=d_keep;
+ else if (strcmp(p->v.cstr,"del")==0)
+ res->disp=d_del;
+ else
+ res->disp=d_unknown;
+ }
+ else if (strcmp(p->var,"enabled")==0)
+ res->enabled=p->v.cstr[0]=='y';
+ else if (strcmp(p->var,"addr")==0)
+ res->addr=(void *)strtol(p->v.cstr,&end,0);
+ else if (strcmp(p->var,"func")==0)
+ {
+ res->func=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ else if (strcmp(p->var,"file")==0)
+ {
+ res->file=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ else if (strcmp(p->var,"line")==0)
+ res->line=atoi(p->v.cstr);
+ else if (strcmp(p->var,"times")==0)
+ res->times=atoi(p->v.cstr);
+ else if (strcmp(p->var,"ignore")==0)
+ res->ignore=atoi(p->v.cstr);
+ else if (strcmp(p->var,"cond")==0)
+ {
+ res->cond=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ }
+ p=p->next;
+ }
+ return res;
+}
+
+mi_bkpt *mi_res_bkpt(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"bkpt");
+ mi_bkpt *b=NULL;
+
+ if (r && r->type==t_tuple)
+ b=mi_get_bkpt(r->v.rs);
+ mi_free_results(r);
+ return b;
+}
+
+mi_wp *mi_get_wp(mi_results *p, enum mi_wp_mode m)
+{
+ mi_wp *res=mi_alloc_wp();
+
+ if (res)
+ {
+ res->mode=m;
+ while (p)
+ {
+ if (p->type==t_const && p->var)
+ {
+ if (strcmp(p->var,"number")==0)
+ {
+ res->number=atoi(p->v.cstr);
+ res->enabled=1;
+ }
+ else if (strcmp(p->var,"exp")==0)
+ {
+ res->exp=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ }
+ p=p->next;
+ }
+ }
+ return res;
+}
+
+mi_wp *mi_parse_wp_res(mi_output *r)
+{
+ mi_results *p;
+ enum mi_wp_mode m=wm_unknown;
+
+ /* The info is in a result wpt=... */
+ p=r->c;
+ while (p)
+ {
+ if (p->var)
+ {
+ if (strcmp(p->var,"wpt")==0)
+ m=wm_write;
+ else if (strcmp(p->var,"hw-rwpt")==0)
+ m=wm_read;
+ else if (strcmp(p->var,"hw-awpt")==0)
+ m=wm_rw;
+ if (m!=wm_unknown)
+ break;
+ }
+ p=p->next;
+ }
+ if (!p || p->type!=t_tuple)
+ return NULL;
+ /* Scan the values inside it. */
+ return mi_get_wp(p->v.rs,m);
+}
+
+mi_wp *mi_res_wp(mi_h *h)
+{
+ mi_output *r, *res;
+ mi_wp *ret=NULL;
+
+ r=mi_get_response_blk(h);
+ res=mi_get_rrecord(r);
+
+ if (res)
+ ret=mi_parse_wp_res(res);
+
+ mi_free_output(r);
+ return ret;
+}
+
+char *mi_res_value(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"value");
+ char *s=NULL;
+
+ if (r && r->type==t_const)
+ {
+ s=r->v.cstr;
+ r->v.rs=NULL;
+ }
+ mi_free_results(r);
+ return s;
+}
+
+mi_output *mi_get_stop_record(mi_output *r)
+{
+ while (r)
+ {
+ if (r->type==MI_T_OUT_OF_BAND && r->stype==MI_ST_ASYNC &&
+ r->sstype==MI_SST_EXEC && r->tclass==MI_CL_STOPPED)
+ return r;
+ r=r->next;
+ }
+ return r;
+}
+
+static
+char *reason_names[]=
+{
+ "breakpoint-hit",
+ "watchpoint-trigger",
+ "read-watchpoint-trigger",
+ "access-watchpoint-trigger",
+ "watchpoint-scope",
+ "function-finished",
+ "location-reached",
+ "end-stepping-range",
+ "exited-signalled",
+ "exited",
+ "exited-normally",
+ "signal-received"
+};
+
+static
+enum mi_stop_reason reason_values[]=
+{
+ sr_bkpt_hit,
+ sr_wp_trigger, sr_read_wp_trigger, sr_access_wp_trigger, sr_wp_scope,
+ sr_function_finished, sr_location_reached, sr_end_stepping_range,
+ sr_exited_signalled, sr_exited, sr_exited_normally,
+ sr_signal_received
+};
+
+static
+char *reason_expl[]=
+{
+ "Hit a breakpoint",
+ "Write watchpoint",
+ "Read watchpoint",
+ "Access watchpoint",
+ "Watchpoint out of scope",
+ "Function finished",
+ "Location reached",
+ "End of stepping",
+ "Exited signalled",
+ "Exited with error",
+ "Exited normally",
+ "Signal received"
+};
+
+enum mi_stop_reason mi_reason_str_to_enum(const char *s)
+{
+ int i;
+
+ for (i=0; i<sizeof(reason_names)/sizeof(char *); i++)
+ if (strcmp(reason_names[i],s)==0)
+ return reason_values[i];
+ return sr_unknown;
+}
+
+const char *mi_reason_enum_to_str(enum mi_stop_reason r)
+{
+ int i;
+
+ if (r==sr_unknown)
+ return "Unknown (temp bkp?)";
+ for (i=0; i<sizeof(reason_values)/sizeof(char *); i++)
+ if (reason_values[i]==r)
+ return reason_expl[i];
+ return NULL;
+}
+
+mi_stop *mi_get_stopped(mi_results *r)
+{
+ mi_stop *res=mi_alloc_stop();
+
+ if (res)
+ {
+ while (r)
+ {
+ if (r->type==t_const)
+ {
+ if (strcmp(r->var,"reason")==0)
+ res->reason=mi_reason_str_to_enum(r->v.cstr);
+ else if (!res->have_thread_id && strcmp(r->var,"thread-id")==0)
+ {
+ res->have_thread_id=1;
+ res->thread_id=atoi(r->v.cstr);
+ }
+ else if (!res->have_bkptno && strcmp(r->var,"bkptno")==0)
+ {
+ res->have_bkptno=1;
+ res->bkptno=atoi(r->v.cstr);
+ }
+ else if (!res->have_bkptno && strcmp(r->var,"wpnum")==0)
+ {
+ res->have_wpno=1;
+ res->wpno=atoi(r->v.cstr);
+ }
+ else if (strcmp(r->var,"gdb-result-var")==0)
+ {
+ res->gdb_result_var=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"return-value")==0)
+ {
+ res->return_value=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"signal-name")==0)
+ {
+ res->signal_name=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (strcmp(r->var,"signal-meaning")==0)
+ {
+ res->signal_meaning=r->v.cstr;
+ r->v.cstr=NULL;
+ }
+ else if (!res->have_exit_code && strcmp(r->var,"exit-code")==0)
+ {
+ res->have_exit_code=1;
+ res->exit_code=atoi(r->v.cstr);
+ }
+ }
+ else // tuple or list
+ {
+ if (strcmp(r->var,"frame")==0)
+ res->frame=mi_parse_frame(r->v.rs);
+ else if (!res->wp && strcmp(r->var,"wpt")==0)
+ res->wp=mi_get_wp(r->v.rs,wm_write);
+ else if (!res->wp && strcmp(r->var,"hw-rwpt")==0)
+ res->wp=mi_get_wp(r->v.rs,wm_read);
+ else if (!res->wp && strcmp(r->var,"hw-awpt")==0)
+ res->wp=mi_get_wp(r->v.rs,wm_rw);
+ else if (!(res->wp_old || res->wp_val) && strcmp(r->var,"value")==0)
+ {
+ mi_results *p=r->v.rs;
+ while (p)
+ {
+ if (strcmp(p->var,"value")==0 || strcmp(p->var,"new")==0)
+ {
+ res->wp_val=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ else if (strcmp(p->var,"old")==0)
+ {
+ res->wp_old=p->v.cstr;
+ p->v.cstr=NULL;
+ }
+ p=p->next;
+ }
+ }
+ }
+ r=r->next;
+ }
+ }
+ return res;
+}
+
+mi_stop *mi_res_stop(mi_h *h)
+{
+ mi_output *o=mi_retire_response(h);
+ mi_stop *stop=NULL;
+
+ if (o)
+ {
+ mi_output *sr=mi_get_stop_record(o);
+ if (sr)
+ stop=mi_get_stopped(sr->c);
+ }
+ mi_free_output(o);
+
+ return stop;
+}
+
+int mi_get_read_memory(mi_h *h, unsigned char *dest, unsigned ws, int *na,
+ unsigned long *addr)
+{
+ char *end;
+ mi_results *res=mi_res_done_var(h,"memory"), *r;
+ int ok=0;
+
+ *na=0;
+ r=res;
+ if (r && r->type==t_list && ws==1)
+ {
+ r=r->v.rs;
+ if (r->type!=t_tuple)
+ {
+ mi_free_results(res);
+ return 0;
+ }
+ r=r->v.rs;
+ while (r)
+ {
+ if (r->type==t_list && strcmp(r->var,"data")==0)
+ {
+ mi_results *data=r->v.rs;
+ ok++;
+ if (data && data->type==t_const &&
+ strcmp(data->v.cstr,"N/A")==0)
+ *na=1;
+ else
+ while (data)
+ {
+ if (data->type==t_const)
+ *(dest++)=strtol(data->v.cstr,&end,0);
+ data=data->next;
+ }
+ }
+ else if (r->type==t_const && strcmp(r->var,"addr")==0)
+ {
+ ok++;
+ if (addr)
+ *addr=strtoul(r->v.cstr,&end,0);
+ }
+ r=r->next;
+ }
+
+ }
+ mi_free_results(res);
+ return ok==2;
+}
+
+mi_asm_insn *mi_parse_insn(mi_results *c)
+{
+ mi_asm_insn *res=NULL, *cur=NULL;
+ mi_results *sub;
+ char *end;
+
+ while (c)
+ {
+ if (c->type==t_tuple)
+ {
+ if (!res)
+ res=cur=mi_alloc_asm_insn();
+ else
+ {
+ cur->next=mi_alloc_asm_insn();
+ cur=cur->next;
+ }
+ if (!cur)
+ {
+ mi_free_asm_insn(res);
+ return NULL;
+ }
+ sub=c->v.rs;
+ while (sub)
+ {
+ if (sub->type==t_const)
+ {
+ if (strcmp(sub->var,"address")==0)
+ cur->addr=(void *)strtol(sub->v.cstr,&end,0);
+ else if (strcmp(sub->var,"func-name")==0)
+ {
+ cur->func=sub->v.cstr;
+ sub->v.cstr=NULL;
+ }
+ else if (strcmp(sub->var,"offset")==0)
+ cur->offset=atoi(sub->v.cstr);
+ else if (strcmp(sub->var,"inst")==0)
+ {
+ cur->inst=sub->v.cstr;
+ sub->v.cstr=NULL;
+ }
+ }
+ sub=sub->next;
+ }
+ }
+ c=c->next;
+ }
+ return res;
+}
+
+mi_asm_insns *mi_parse_insns(mi_results *c)
+{
+ mi_asm_insns *res=NULL, *cur=NULL;
+ mi_results *sub;
+
+ while (c)
+ {
+ if (c->var)
+ {
+ if (strcmp(c->var,"src_and_asm_line")==0 && c->type==t_tuple)
+ {
+ if (!res)
+ res=cur=mi_alloc_asm_insns();
+ else
+ {
+ cur->next=mi_alloc_asm_insns();
+ cur=cur->next;
+ }
+ if (!cur)
+ {
+ mi_free_asm_insns(res);
+ return NULL;
+ }
+ sub=c->v.rs;
+ while (sub)
+ {
+ if (sub->var)
+ {
+ if (sub->type==t_const)
+ {
+ if (strcmp(sub->var,"line")==0)
+ cur->line=atoi(sub->v.cstr);
+ else if (strcmp(sub->var,"file")==0)
+ {
+ cur->file=sub->v.cstr;
+ sub->v.cstr=NULL;
+ }
+ }
+ else if (sub->type==t_list)
+ {
+ if (strcmp(sub->var,"line_asm_insn")==0)
+ cur->ins=mi_parse_insn(sub->v.rs);
+ }
+ }
+ sub=sub->next;
+ }
+ }
+ }
+ else
+ {/* No source line, just instructions */
+ res=mi_alloc_asm_insns();
+ res->ins=mi_parse_insn(c);
+ break;
+ }
+ c=c->next;
+ }
+ return res;
+}
+
+
+mi_asm_insns *mi_get_asm_insns(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"asm_insns");
+ mi_asm_insns *f=NULL;
+
+ if (r && r->type==t_list)
+ f=mi_parse_insns(r->v.rs);
+ mi_free_results(r);
+ return f;
+}
+
+mi_chg_reg *mi_parse_list_regs(mi_results *r, int *how_many)
+{
+ mi_results *c=r;
+ int cregs=0;
+ mi_chg_reg *first=NULL, *cur=NULL;
+
+ /* Create the list. */
+ while (c)
+ {
+ if (c->type==t_const && !c->var)
+ {
+ if (first)
+ cur=cur->next=mi_alloc_chg_reg();
+ else
+ first=cur=mi_alloc_chg_reg();
+ cur->name=c->v.cstr;
+ cur->reg=cregs++;
+ c->v.cstr=NULL;
+ }
+ c=c->next;
+ }
+ if (how_many)
+ *how_many=cregs;
+
+ return first;
+}
+
+mi_chg_reg *mi_get_list_registers(mi_h *h, int *how_many)
+{
+ mi_results *r=mi_res_done_var(h,"register-names");
+ mi_chg_reg *l=NULL;
+
+ if (r && r->type==t_list)
+ l=mi_parse_list_regs(r->v.rs,how_many);
+ mi_free_results(r);
+ return l;
+}
+
+mi_chg_reg *mi_parse_list_changed_regs(mi_results *r)
+{
+ mi_results *c=r;
+ mi_chg_reg *first=NULL, *cur=NULL;
+
+ /* Create the list. */
+ while (c)
+ {
+ if (c->type==t_const && !c->var)
+ {
+ if (first)
+ cur=cur->next=mi_alloc_chg_reg();
+ else
+ first=cur=mi_alloc_chg_reg();
+ cur->reg=atoi(c->v.cstr);
+ }
+ c=c->next;
+ }
+
+ return first;
+}
+
+mi_chg_reg *mi_get_list_changed_regs(mi_h *h)
+{
+ mi_results *r=mi_res_done_var(h,"changed-registers");
+ mi_chg_reg *changed=NULL;
+
+ if (r && r->type==t_list)
+ changed=mi_parse_list_changed_regs(r->v.rs);
+ mi_free_results(r);
+ return changed;
+}
+
+int mi_parse_reg_values(mi_results *r, mi_chg_reg *l)
+{
+ mi_results *c;
+
+ while (r && l)
+ {
+ if (r->type==t_tuple && !r->var)
+ {
+ c=r->v.rs;
+ while (c)
+ {
+ if (c->type==t_const && c->var)
+ {
+ if (strcmp(c->var,"number")==0)
+ {
+ if (atoi(c->v.cstr)!=l->reg)
+ {
+ mi_error=MI_PARSER;
+ return 0;
+ }
+ }
+ else if (strcmp(c->var,"value")==0)
+ {
+ l->val=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ }
+ c=c->next;
+ }
+ }
+ r=r->next;
+ l=l->next;
+ }
+
+ return !l && !r;
+}
+
+int mi_get_reg_values(mi_h *h, mi_chg_reg *l)
+{
+ mi_results *r=mi_res_done_var(h,"register-values");
+ int ok=0;
+
+ if (r && r->type==t_list)
+ ok=mi_parse_reg_values(r->v.rs,l);
+ mi_free_results(r);
+ return ok;
+}
+
+int mi_parse_list_regs_l(mi_results *r, mi_chg_reg *l)
+{
+ while (r && l)
+ {
+ if (r->type==t_const && !r->var)
+ {
+ free(l->name);
+ l->name=r->v.cstr;
+ r->v.cstr=NULL;
+ l=l->next;
+ }
+ r=r->next;
+ }
+
+ return !l && !r;
+}
+
+int mi_get_list_registers_l(mi_h *h, mi_chg_reg *l)
+{
+ mi_results *r=mi_res_done_var(h,"register-names");
+ int ok=0;
+
+ if (r && r->type==t_list)
+ ok=mi_parse_list_regs_l(r->v.rs,l);
+ mi_free_results(r);
+ return ok;
+}
+
+mi_chg_reg *mi_parse_reg_values_l(mi_results *r, int *how_many)
+{
+ mi_results *c;
+ mi_chg_reg *first=NULL, *cur=NULL;
+ *how_many=0;
+
+ while (r)
+ {
+ if (r->type==t_tuple && !r->var)
+ {
+ c=r->v.rs;
+ if (first)
+ cur=cur->next=mi_alloc_chg_reg();
+ else
+ first=cur=mi_alloc_chg_reg();
+ while (c)
+ {
+ if (c->type==t_const && c->var)
+ {
+ if (strcmp(c->var,"number")==0)
+ {
+ cur->reg=atoi(c->v.cstr);
+ (*how_many)++;
+ }
+ else if (strcmp(c->var,"value")==0)
+ {
+ cur->val=c->v.cstr;
+ c->v.cstr=NULL;
+ }
+ }
+ c=c->next;
+ }
+ }
+ r=r->next;
+ }
+
+ return first;
+}
+
+mi_chg_reg *mi_get_reg_values_l(mi_h *h, int *how_many)
+{
+ mi_results *r=mi_res_done_var(h,"register-values");
+ mi_chg_reg *rgs=NULL;
+
+ if (r && r->type==t_list)
+ rgs=mi_parse_reg_values_l(r->v.rs,how_many);
+ mi_free_results(r);
+ return rgs;
+}
+
+
diff --git a/setedit/libmigdb/src/prg_control.c b/setedit/libmigdb/src/prg_control.c
new file mode 100644
index 0000000..671725f
--- /dev/null
+++ b/setedit/libmigdb/src/prg_control.c
@@ -0,0 +1,454 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Program control.
+ Comments:
+ GDB/MI commands for the "Program Control" section.@p
+
+@<pre>
+gdb command: Implemented?
+
+-exec-abort N.A. (*) (kill, but with non-interactive options)
+-exec-arguments Yes
+-exec-continue Yes ASYNC
+-exec-finish Yes ASYNC
+-exec-interrupt Yes ASYNC
+-exec-next Yes ASYNC
+-exec-next-instruction Yes ASYNC
+-exec-return Yes
+-exec-run Yes ASYNC
+-exec-show-arguments N.A. (show args) see gmi_stack_info_frame
+-exec-step Yes ASYNC
+-exec-step-instruction Yes ASYNC
+-exec-until Yes ASYNC
+-file-exec-and-symbols Yes
+-file-exec-file No
+-file-list-exec-sections N.A. (info file)
+-file-list-exec-source-files N.A.
+-file-list-shared-libraries N.A.
+-file-list-symbol-files N.A.
+-file-symbol-file Yes
+@</pre>
+
+(*) gmi_exec_kill implements it, but you should ensure that
+gmi_gdb_set("confirm","off") was called.@p
+
+GDB Bug workaround for -file-exec-and-symbols and -file-symbol-file: This
+is complex, but a real bug. When you set a breakpoint you never know the
+name of the file as it appears in the debug info. So you can be specifying
+an absolute file name or a relative file name. The reference point could be
+different than the one used in the debug info. To solve all the combinations
+gdb does a search trying various combinations. GDB isn't very smart so you
+must at least specify the working directory and the directory where the
+binary is located to get a good chance (+ user options to solve the rest).
+Once you did it gdb can find the file by doing transformations to the
+"canonical" filename. This search works OK for already loaded symtabs
+(symbol tables), but it have a bug when the search is done for psymtabs
+(partial symtabs). The bug is in the use of source_full_path_of (source.c).
+This function calls openp indicating try_cwd_first. It makes the search file
+if the psymtab file name have at least one dirseparator. It means that
+psymtabs for files compiled with relative paths will fail. The search for
+symtabs uses symtab_to_filename, it calls open_source_file which finally
+calls openp without try_cwd_first.@*
+To workaround this bug we must ensure gdb loads *all* the symtabs to memory.
+And here comes another problem -file-exec-and-symbols doesn't support it
+according to docs. In real life that's a wrapper for "file", but as nobody
+can say it won't change we must use the CLI command.
+
+***************************************************************************/
+
+#include <signal.h>
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_file_exec_and_symbols(mi_h *h, const char *file)
+{
+ if (mi_get_workaround(MI_PSYM_SEARCH))
+ mi_send(h,"file %s -readnow\n",file);
+ else
+ mi_send(h,"-file-exec-and-symbols %s\n",file);
+}
+
+void mi_exec_arguments(mi_h *h, const char *args)
+{
+ mi_send(h,"-exec-arguments %s\n",args);
+}
+
+void mi_exec_run(mi_h *h)
+{
+ mi_send(h,"-exec-run\n");
+}
+
+void mi_exec_continue(mi_h *h)
+{
+ mi_send(h,"-exec-continue\n");
+}
+
+void mi_target_terminal(mi_h *h, const char *tty_name)
+{
+ mi_send(h,"tty %s\n",tty_name);
+}
+
+void mi_file_symbol_file(mi_h *h, const char *file)
+{
+ if (mi_get_workaround(MI_PSYM_SEARCH))
+ mi_send(h,"symbol-file %s -readnow\n",file);
+ else
+ mi_send(h,"-file-symbol-file %s\n",file);
+}
+
+void mi_exec_finish(mi_h *h)
+{
+ mi_send(h,"-exec-finish\n");
+}
+
+void mi_exec_interrupt(mi_h *h)
+{
+ mi_send(h,"-exec-interrupt\n");
+}
+
+void mi_exec_next(mi_h *h, int count)
+{
+ if (count>1)
+ mi_send(h,"-exec-next %d\n",count);
+ else
+ mi_send(h,"-exec-next\n");
+}
+
+void mi_exec_next_instruction(mi_h *h)
+{
+ mi_send(h,"-exec-next-instruction\n");
+}
+
+void mi_exec_step(mi_h *h, int count)
+{
+ if (count>1)
+ mi_send(h,"-exec-step %d\n",count);
+ else
+ mi_send(h,"-exec-step\n");
+}
+
+void mi_exec_step_instruction(mi_h *h)
+{
+ mi_send(h,"-exec-step-instruction\n");
+}
+
+void mi_exec_until(mi_h *h, const char *file, int line)
+{
+ if (!file)
+ mi_send(h,"-exec-until\n");
+ else
+ mi_send(h,"-exec-until %s:%d\n",file,line);
+}
+
+void mi_exec_until_addr(mi_h *h, void *addr)
+{
+ mi_send(h,"-exec-until *%p\n",addr);
+}
+
+void mi_exec_return(mi_h *h)
+{
+ mi_send(h,"-exec-return\n");
+}
+
+void mi_exec_kill(mi_h *h)
+{
+ mi_send(h,"kill\n");
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ Specify the executable and arguments for local debug.
+
+ Command: -file-exec-and-symbols + -exec-arguments
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_set_exec(mi_h *h, const char *file, const char *args)
+{
+ mi_file_exec_and_symbols(h,file);
+ if (!mi_res_simple_done(h))
+ return 0;
+ if (!args)
+ return 1;
+ mi_exec_arguments(h,args);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Start running the executable. Remote sessions starts running.
+
+ Command: -exec-run
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_run(mi_h *h)
+{
+ mi_exec_run(h);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Continue the execution after a "stop".
+
+ Command: -exec-continue
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_continue(mi_h *h)
+{
+ mi_exec_continue(h);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Indicate which terminal will use the target program. For local sessions.
+
+ Command: tty
+ Return: !=0 OK
+ Example:
+
+***************************************************************************/
+
+int gmi_target_terminal(mi_h *h, const char *tty_name)
+{
+ mi_target_terminal(h,tty_name);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Specify what's the local copy that have debug info. For remote sessions.
+
+ Command: -file-symbol-file
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_file_symbol_file(mi_h *h, const char *file)
+{
+ mi_file_symbol_file(h,file);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Continue until function return, the return value is included in the async
+response.
+
+ Command: -exec-finish
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int gmi_exec_finish(mi_h *h)
+{
+ mi_exec_finish(h);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stop the program using SIGINT. The corresponding command should be
+-exec-interrupt but not even gdb 6.1.1 can do it because the "async" mode
+isn't really working.
+
+ Command: -exec-interrupt [replacement]
+ Return: Always 1
+ Example:
+
+***************************************************************************/
+
+int gmi_exec_interrupt(mi_h *h)
+{
+ // **** IMPORTANT!!! **** Not even gdb 6.1.1 can do it because the "async"
+ // mode isn't really working.
+ //mi_exec_interrupt(h);
+ //return mi_res_simple_running(h);
+
+ kill(h->pid,SIGINT);
+ return 1; // How can I know?
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Next line of code.
+
+ Command: -exec-next
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_next(mi_h *h)
+{
+ mi_exec_next(h,1);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Skip count lines of code.
+
+ Command: -exec-next count
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_next_cnt(mi_h *h, int count)
+{
+ mi_exec_next(h,count);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Next line of assembler code.
+
+ Command: -exec-next-instruction
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_next_instruction(mi_h *h)
+{
+ mi_exec_next_instruction(h);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Next line of code. Get inside functions.
+
+ Command: -exec-step
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_step(mi_h *h)
+{
+ mi_exec_step(h,1);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Next count lines of code. Get inside functions.
+
+ Command: -exec-step count
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_step_cnt(mi_h *h, int count)
+{
+ mi_exec_step(h,count);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Next line of assembler code. Get inside calls.
+
+ Command: -exec-step-instruction
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_step_instruction(mi_h *h)
+{
+ mi_exec_step_instruction(h);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Execute until location is reached. If file is NULL then is until next
+line.
+
+ Command: -exec-until
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_until(mi_h *h, const char *file, int line)
+{
+ mi_exec_until(h,file,line);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Execute until location is reached.
+
+ Command: -exec-until (using *address)
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_until_addr(mi_h *h, void *addr)
+{
+ mi_exec_until_addr(h,addr);
+ return mi_res_simple_running(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Return to previous frame inmediatly.
+
+ Command: -exec-return
+ Return: A pointer to a new mi_frames structure indicating the current
+location. NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_exec_return(mi_h *h)
+{
+ mi_exec_return(h);
+ return mi_res_frame(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Just kill the program. That's what -exec-abort should do, but it isn't
+implemented by gdb. This implementation only works if the interactive mode
+is disabled (gmi_gdb_set("confirm","off")).
+
+ Command: -exec-abort [using kill]
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_exec_kill(mi_h *h)
+{
+ mi_exec_kill(h);
+ return mi_res_simple_done(h);
+}
+
diff --git a/setedit/libmigdb/src/stack_man.c b/setedit/libmigdb/src/stack_man.c
new file mode 100644
index 0000000..8e8ed06
--- /dev/null
+++ b/setedit/libmigdb/src/stack_man.c
@@ -0,0 +1,222 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Stack manipulation.
+ Comments:
+ GDB/MI commands for the "Stack Manipulation" section.@p
+
+@<pre>
+gdb command: Implemented?
+
+-stack-info-frame Yes, implemented as "frame"
+-stack-info-depth Yes
+-stack-list-arguments Yes
+-stack-list-frames Yes
+-stack-list-locals Yes
+-stack-select-frame Yes
+@</pre>
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_stack_list_frames(mi_h *h, int from, int to)
+{
+ if (from<0)
+ mi_send(h,"-stack-list-frames\n");
+ else
+ mi_send(h,"-stack-list-frames %d %d\n",from,to);
+}
+
+void mi_stack_list_arguments(mi_h *h, int show, int from, int to)
+{
+ if (from<0)
+ mi_send(h,"-stack-list-arguments %d\n",show);
+ else
+ mi_send(h,"-stack-list-arguments %d %d %d\n",show,from,to);
+}
+
+void mi_stack_info_frame(mi_h *h)
+{
+ mi_send(h,"frame\n");
+}
+
+void mi_stack_info_depth(mi_h *h, int depth)
+{
+ if (depth<0)
+ mi_send(h,"-stack-info-depth\n");
+ else
+ mi_send(h,"-stack-info-depth %d\n",depth);
+}
+
+void mi_stack_select_frame(mi_h *h, int framenum)
+{
+ mi_send(h,"-stack-select-frame %d\n",framenum);
+}
+
+void mi_stack_list_locals(mi_h *h, int show)
+{
+ mi_send(h,"-stack-list-locals %d\n",show);
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ List of frames. Arguments aren't filled.
+
+ Command: -stack-list-frames
+ Return: A new list of mi_frames or NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_stack_list_frames(mi_h *h)
+{
+ mi_stack_list_frames(h,-1,-1);
+ return mi_res_frames_array(h,"stack");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ List of frames. Arguments aren't filled. Only the frames in the @var{from}
+ - @var{to} range are returned.
+
+ Command: -stack-list-frames
+ Return: A new list of mi_frames or NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_stack_list_frames_r(mi_h *h, int from, int to)
+{
+ mi_stack_list_frames(h,from,to);
+ return mi_res_frames_array(h,"stack");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ List arguments. Only @var{level} and @var{args} filled.
+
+ Command: -stack-list-arguments
+ Return: A new list of mi_frames or NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_stack_list_arguments(mi_h *h, int show)
+{
+ mi_stack_list_arguments(h,show,-1,-1);
+ return mi_res_frames_array(h,"stack-args");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ List arguments. Only @var{level} and @var{args} filled. Only for the
+frames in the @var{from} - @var{to} range.
+
+ Command: -stack-list-arguments
+ Return: A new list of mi_frames or NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_stack_list_arguments_r(mi_h *h, int show, int from, int to)
+{
+ mi_stack_list_arguments(h,show,from,to);
+ return mi_res_frames_array(h,"stack-args");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Information about the current frame, including args.
+
+ Command: -stack-info-frame [using frame]
+ Return: A new mi_frames or NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_stack_info_frame(mi_h *h)
+{
+ mi_stack_info_frame(h);
+ return mi_res_frame(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stack info depth.
+
+ Command: -stack-info-depth
+ Return: The depth or -1 on error.
+
+***************************************************************************/
+
+int gmi_stack_info_depth(mi_h *h, int max_depth)
+{
+ mi_results *r;
+ int ret=-1;
+
+ mi_stack_info_depth(h,max_depth);
+ r=mi_res_done_var(h,"depth");
+ if (r && r->type==t_const)
+ {
+ ret=atoi(r->v.cstr);
+ mi_free_results(r);
+ }
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Set stack info depth.
+
+ Command: -stack-info-depth [no args]
+ Return: The depth or -1 on error.
+ Example:
+
+***************************************************************************/
+
+int gmi_stack_info_depth_get(mi_h *h)
+{
+ return gmi_stack_info_depth(h,-1);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Change current frame.
+
+ Command: -stack-select-frame
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_stack_select_frame(mi_h *h, int framenum)
+{
+ mi_stack_select_frame(h,framenum);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ List of local vars.
+
+ Command: -stack-list-locals
+ Return: A new mi_results tree containing the variables or NULL on error.
+
+***************************************************************************/
+
+mi_results *gmi_stack_list_locals(mi_h *h, int show)
+{
+ mi_stack_list_locals(h,show);
+ return mi_res_done_var(h,"locals");
+}
+
diff --git a/setedit/libmigdb/src/symbol_query.c b/setedit/libmigdb/src/symbol_query.c
new file mode 100644
index 0000000..55e145f
--- /dev/null
+++ b/setedit/libmigdb/src/symbol_query.c
@@ -0,0 +1,32 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Symbol query.
+ Comments:
+ GDB/MI commands for the "Symbol Query" section.@p
+
+@<pre>
+gdb command: Implemented?
+-symbol-info-address N.A. (info address, human readable)
+-symbol-info-file N.A.
+-symbol-info-function N.A.
+-symbol-info-line N.A. (info line, human readable)
+-symbol-info-symbol N.A. (info symbol, human readable)
+-symbol-list-functions N.A. (info functions, human readable)
+-symbol-list-types N.A. (info types, human readable)
+-symbol-list-variables N.A. (info variables, human readable)
+-symbol-list-lines No (gdb 6.x)
+-symbol-locate N.A.
+-symbol-type N.A. (ptype, human readable)
+@</pre>
+
+Note:@p
+
+Only one is implemented and not in gdb 5.x.@p
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
diff --git a/setedit/libmigdb/src/target_man.c b/setedit/libmigdb/src/target_man.c
new file mode 100644
index 0000000..192acc1
--- /dev/null
+++ b/setedit/libmigdb/src/target_man.c
@@ -0,0 +1,95 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Target manipulation.
+ Comments:
+ GDB/MI commands for the "Target Manipulation" section.@p
+
+@<pre>
+-target-attach Yes (implemented using attach)
+-target-compare-sections N.A. (compare-sections)
+-target-detach Yes
+-target-download No
+-target-exec-status N.A.
+-target-list-available-targets N.A. (help target)
+-target-list-current-targets N.A. (info file among other things)
+-target-list-parameters N.A.
+-target-select Yes
+@</pre>
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_target_select(mi_h *h, const char *type, const char *params)
+{
+ mi_send(h,"-target-select %s %s\n",type,params);
+}
+
+/* Note: -target-attach isn't currently implemented :-( (gdb 6.1.1) */
+void mi_target_attach(mi_h *h, pid_t pid)
+{
+ mi_send(h,"attach %d\n",pid);
+}
+
+void mi_target_detach(mi_h *h)
+{
+ mi_send(h,"-target-detach\n");
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ Connect to a remote gdbserver using the specified methode.
+
+ Command: -target-select
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_target_select(mi_h *h, const char *type, const char *params)
+{
+ mi_target_select(h,type,params);
+ return mi_res_simple_connected(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Attach to an already running process.
+
+ Command: -target-attach [using attach]
+ Return: The frame of the current location, NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_target_attach(mi_h *h, pid_t pid)
+{
+ mi_target_attach(h,pid);
+ //return mi_res_simple_done(h);
+ return mi_res_frame(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Detach from an attached process.
+
+ Command: -target-detach
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_target_detach(mi_h *h)
+{
+ mi_target_detach(h);
+ return mi_res_simple_done(h);
+}
+
+
diff --git a/setedit/libmigdb/src/thread.c b/setedit/libmigdb/src/thread.c
new file mode 100644
index 0000000..51a333f
--- /dev/null
+++ b/setedit/libmigdb/src/thread.c
@@ -0,0 +1,89 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Thread commands.
+ Comments:
+ GDB/MI commands for the "Thread Commands" section.@p
+
+@<pre>
+gdb command: Implemented?
+-thread-info N.A.
+-thread-list-all-threads Yes, implemented as "info threads"
+-thread-list-ids Yes
+-thread-select Yes
+@</pre>
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_thread_list_ids(mi_h *h)
+{
+ mi_send(h,"-thread-list-ids\n");
+}
+
+void mi_thread_select(mi_h *h, int id)
+{
+ mi_send(h,"-thread-select %d\n",id);
+}
+
+void mi_thread_list_all_threads(mi_h *h)
+{
+ mi_send(h,"info threads\n");
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ List available thread ids.
+
+ Command: -thread-list-ids
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_thread_list_ids(mi_h *h, int **list)
+{
+ mi_thread_list_ids(h);
+ return mi_res_thread_ids(h,list);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Select a thread.
+
+ Command: -thread-select
+ Return: A new mi_frames or NULL on error.
+
+***************************************************************************/
+
+mi_frames *gmi_thread_select(mi_h *h, int id)
+{
+ mi_thread_select(h,id);
+ return mi_res_frame(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Get a list of frames for each available thread. Implemented using "info
+thread".
+
+ Command: -thread-list-all-threads
+ Return: A kist of frames, NULL on error
+
+***************************************************************************/
+
+mi_frames *gmi_thread_list_all_threads(mi_h *h)
+{
+ mi_thread_list_all_threads(h);
+ return mi_res_frames_list(h);
+}
+
diff --git a/setedit/libmigdb/src/var_obj.c b/setedit/libmigdb/src/var_obj.c
new file mode 100644
index 0000000..a027d67
--- /dev/null
+++ b/setedit/libmigdb/src/var_obj.c
@@ -0,0 +1,369 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Salvador E. Tropea.
+ Covered by the GPL license.
+
+ Module: Variable objects.
+ Comments:
+ GDB/MI commands for the "Variable Objects" section.@p
+
+@<pre>
+gdb command: Imp? Description:
+-var-create Yes create a variable object
+-var-delete Yes delete the variable object and its children
+-var-set-format Yes set the display format of this variable
+-var-show-format Yes show the display format of this variable
+-var-info-num-children Yes tells how many children this object has
+-var-list-children Yes* return a list of the object's children
+-var-info-type Yes show the type of this variable object
+-var-info-expression Yes print what this variable object represents
+-var-show-attributes Yes is this variable editable?
+-var-evaluate-expression Yes get the value of this variable
+-var-assign Yes set the value of this variable
+-var-update Yes* update the variable and its children
+@</pre>
+
+Notes:@p
+1) I suggest letting gdb to choose the names for the variables.@*
+2) -var-list-children supports an optional "show values" argument in MI v2.
+It isn't implemented.@*
+@p
+
+* MI v1 and v2 result formats supported.@p
+
+***************************************************************************/
+
+#include "mi_gdb.h"
+
+/* Low level versions. */
+
+void mi_var_create(mi_h *h, const char *name, int frame, const char *exp)
+{
+ const char *n=name ? name : "-";
+
+ if (frame<0)
+ mi_send(h,"-var-create %s * %s\n",n,exp);
+ else
+ mi_send(h,"-var-create %s %d %s\n",n,frame,exp);
+}
+
+void mi_var_delete(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-delete %s\n",name);
+}
+
+void mi_var_set_format(mi_h *h, const char *name, const char *format)
+{
+ mi_send(h,"-var-set-format \"%s\" %s\n",name,format);
+}
+
+void mi_var_show_format(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-show-format \"%s\"\n",name);
+}
+
+void mi_var_info_num_children(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-info-num-children \"%s\"\n",name);
+}
+
+void mi_var_info_type(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-info-type \"%s\"\n",name);
+}
+
+void mi_var_info_expression(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-info-expression \"%s\"\n",name);
+}
+
+void mi_var_show_attributes(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-show-attributes \"%s\"\n",name);
+}
+
+void mi_var_update(mi_h *h, const char *name)
+{
+ if (name)
+ mi_send(h,"-var-update %s\n",name);
+ else
+ mi_send(h,"-var-update *\n");
+}
+
+void mi_var_assign(mi_h *h, const char *name, const char *expression)
+{
+ mi_send(h,"-var-assign \"%s\" \"%s\"\n",name,expression);
+}
+
+void mi_var_evaluate_expression(mi_h *h, const char *name)
+{
+ mi_send(h,"-var-evaluate-expression \"%s\"\n",name);
+}
+
+void mi_var_list_children(mi_h *h, const char *name)
+{
+ if (h->version>=MI_VERSION2U(2,0,0))
+ mi_send(h,"-var-list-children --all-values \"%s\"\n",name);
+ else
+ mi_send(h,"-var-list-children \"%s\"\n",name);
+}
+
+/* High level versions. */
+
+/**[txh]********************************************************************
+
+ Description:
+ Create a variable object. I recommend using @x{gmi_var_create} and letting
+gdb choose the names.
+
+ Command: -var-create
+ Return: A new mi_gvar strcture or NULL on error.
+
+***************************************************************************/
+
+mi_gvar *gmi_var_create_nm(mi_h *h, const char *name, int frame, const char *exp)
+{
+ mi_var_create(h,name,frame,exp);
+ return mi_res_gvar(h,NULL,exp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Create a variable object. The name is selected by gdb. Alternative:
+@x{gmi_full_var_create}.
+
+ Command: -var-create [auto name]
+ Return: A new mi_gvar strcture or NULL on error.
+
+***************************************************************************/
+
+mi_gvar *gmi_var_create(mi_h *h, int frame, const char *exp)
+{
+ return gmi_var_create_nm(h,NULL,frame,exp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Delete a variable object. Doesn't free the mi_gvar data.
+
+ Command: -var-delete
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_delete(mi_h *h, mi_gvar *var)
+{
+ mi_var_delete(h,var->name);
+ return mi_res_simple_done(h);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Set the format used to represent the result.
+
+ Command: -var-set-format
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_set_format(mi_h *h, mi_gvar *var, enum mi_gvar_fmt format)
+{
+ int ret;
+
+ mi_var_set_format(h,var->name,mi_format_enum_to_str(format));
+ ret=mi_res_simple_done(h);
+ if (ret)
+ var->format=format;
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the format field with info from gdb.
+
+ Command: -var-show-format
+ Return: !=0 OK.
+
+***************************************************************************/
+
+int gmi_var_show_format(mi_h *h, mi_gvar *var)
+{
+ mi_var_show_format(h,var->name);
+ return mi_res_gvar(h,var,NULL)!=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the numchild field with info from gdb.
+
+ Command: -var-info-num-children
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_info_num_children(mi_h *h, mi_gvar *var)
+{
+ mi_var_info_num_children(h,var->name);
+ return mi_res_gvar(h,var,NULL)!=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the type field with info from gdb.
+
+ Command: -var-info-type
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_info_type(mi_h *h, mi_gvar *var)
+{
+ mi_var_info_type(h,var->name);
+ return mi_res_gvar(h,var,NULL)!=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the expression and lang fields with info from gdb. Note that lang
+isn't filled during creation.
+
+ Command: -var-info-expression
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_info_expression(mi_h *h, mi_gvar *var)
+{
+ mi_var_info_expression(h,var->name);
+ return mi_res_gvar(h,var,NULL)!=NULL;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the attr field with info from gdb. Note that attr isn't filled
+during creation.
+
+ Command: -var-show-attributes
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_show_attributes(mi_h *h, mi_gvar *var)
+{
+ mi_var_show_attributes(h,var->name);
+ return mi_res_gvar(h,var,NULL)!=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Create the variable and also fill the lang and attr fields. The name is
+selected by gdb.
+
+ Command: -var-create + -var-info-expression + -var-show-attributes
+ Return: A new mi_gvar strcture or NULL on error.
+
+***************************************************************************/
+
+mi_gvar *gmi_full_var_create(mi_h *h, int frame, const char *exp)
+{
+ mi_gvar *var=gmi_var_create_nm(h,NULL,frame,exp);
+ if (var)
+ {/* What if it fails? */
+ gmi_var_info_expression(h,var);
+ gmi_var_show_attributes(h,var);
+ }
+ return var;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Update variable. Use NULL for all. Note that *changed can be NULL if none
+updated.
+
+ Command: -var-update
+ Return: !=0 OK. The @var{changed} list contains the list of changed vars.
+
+***************************************************************************/
+
+int gmi_var_update(mi_h *h, mi_gvar *var, mi_gvar_chg **changed)
+{
+ mi_var_update(h,var ? var->name : NULL);
+ return mi_res_changelist(h,changed);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Change variable. The new value replaces the @var{value} field.
+
+ Command: -var-assign
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_assign(mi_h *h, mi_gvar *var, const char *expression)
+{
+ char *res;
+ mi_var_assign(h,var->name,expression);
+ res=mi_res_value(h);
+ if (res)
+ {
+ free(var->value);
+ var->value=res;
+ return 1;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the value field getting the current value for a variable.
+
+ Command: -var-evaluate-expression
+ Return: !=0 OK, value contains the result.
+
+***************************************************************************/
+
+int gmi_var_evaluate_expression(mi_h *h, mi_gvar *var)
+{
+ char *s;
+
+ mi_var_evaluate_expression(h,var->name);
+ s=mi_res_value(h);
+ if (s)
+ {
+ free(var->value);
+ var->value=s;
+ }
+ return s!=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ List children. It ONLY returns the first level information. :-(@*
+ On success the child field contains the list of children.
+
+ Command: -var-list-children
+ Return: !=0 OK
+
+***************************************************************************/
+
+int gmi_var_list_children(mi_h *h, mi_gvar *var)
+{
+ mi_var_list_children(h,var->name);
+ return mi_res_children(h,var);
+}
+
diff --git a/setedit/libpcre/.cvsignore b/setedit/libpcre/.cvsignore
new file mode 100644
index 0000000..db7f525
--- /dev/null
+++ b/setedit/libpcre/.cvsignore
@@ -0,0 +1,4 @@
+dftables
+chartables.c
+Makefile
+
diff --git a/setedit/libpcre/Makefile b/setedit/libpcre/Makefile
new file mode 100644
index 0000000..6d314e7
--- /dev/null
+++ b/setedit/libpcre/Makefile
@@ -0,0 +1,160 @@
+# Make file for PCRE (Perl-Compatible Regular Expression) library.
+
+# If you are using a Unix system, see below. I am a Unix person, so that is
+# the stuff I really know about. PCRE is developed on a Unix box.
+
+# To build mingw32 DLL uncomment the next two lines. This addition for mingw32
+# was contributed by Paul Sokolovsky <Paul.Sokolovsky@technologist.com>. I
+# (Philip Hazel) don't know anything about it! There are some additional
+# targets at the bottom of this Makefile.
+#
+# include dll.mk
+# DLL_LDFLAGS=-s
+
+
+######## NON-UNIX ############ NON-UNIX ############## NON-UNIX ##############
+# If you want to compile PCRE for a non-Unix system, note that it consists
+# entirely of code written in Standard C, and so should compile successfully
+# using normal compiling commands to do the following:
+#
+# (1) Compile dftables.c as a stand-alone program, and then run it with
+# output sent to chartables.c. This generates a set of standard character
+# tables.
+#
+# (2) Compile maketables.c, get.c, study.c and pcre.c and link them all
+# together. This is the pcre library (chartables.c gets included by means of
+# an #include directive).
+#
+# (3) Compile pcreposix.c and link it as the pcreposix library.
+#
+# (4) Compile the test program pcretest.c. This needs the functions in the
+# pcre and pcreposix libraries when linking.
+#
+# (5) Run pcretest on the testinput files, and check that the output matches
+# the corresponding testoutput files. You must use the -i option with
+# testinput2.
+
+
+######## UNIX ################## UNIX ################## UNIX ################
+# On a Unix system:
+#
+# Edit CC, CFLAGS, and RANLIB for your system.
+#
+# It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux,
+# MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.
+#
+# Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the
+# memmove() function, but has bcopy().
+#
+# Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that
+# lacks the strerror() function, but can provide the equivalent by indexing
+# into errlist.
+
+AR = ar cq
+CC = gcc -DSTATIC
+CFLAGS = -march=i686 -mtune=generic -O2 -pipe
+RANLIB = ranlib
+
+# If you are going to obey "make install", edit these settings for your
+# system. BINDIR is the directory in which the pgrep command is installed.
+# INCDIR is the directory in which the public header file pcre.h is installed.
+# LIBDIR is the directory in which the libraries are installed. MANDIR is the
+# directory in which the man pages are installed. The pcretest program, as it
+# is a test program, does not get installed anywhere.
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+INCDIR = $(PREFIX)/include
+LIBDIR = $(PREFIX)/lib
+MANDIR = $(PREFIX)/man
+
+
+##############################################################################
+
+
+OBJ = maketables.o get.o study.o pcre.o
+
+all: libpcre.a libpcreposix.a pcretest pgrep
+
+pgrep: libpcre.a pgrep.o
+ $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a
+
+pcretest: libpcre.a libpcreposix.a pcretest.o
+ $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
+
+libpcre.a: $(OBJ)
+ -rm -f libpcre.a
+ $(AR) libpcre.a $(OBJ)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+libpcreposix.a: pcreposix.o
+ -rm -f libpcreposix.a
+ $(AR) libpcreposix.a pcreposix.o
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+pcre.o: chartables.c pcre.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) pcre.c
+
+pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h Makefile
+ $(CC) -c $(CFLAGS) pcreposix.c
+
+maketables.o: maketables.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) maketables.c
+
+get.o: get.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) get.c
+
+study.o: study.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) study.c
+
+pcretest.o: pcretest.c pcre.h Makefile
+ $(CC) -c $(CFLAGS) pcretest.c
+
+pgrep.o: pgrep.c pcre.h Makefile
+ $(CC) -c $(CFLAGS) pgrep.c
+
+# An auxiliary program makes the default character table source
+
+chartables.c: dftables
+ ./dftables >chartables.c
+
+dftables: dftables.c maketables.c pcre.h internal.h Makefile
+ $(CC) -o dftables $(CFLAGS) dftables.c
+
+install: all
+ cp libpcre.a libpcreposix.a $(LIBDIR)
+ cp pcre.h $(INCDIR)
+ cp pgrep $(BINDIR)
+ cp pcre.3 pcreposix.3 $(MANDIR)/man3
+ cp pgrep.1 $(MANDIR)/man1
+
+# We deliberately omit dftables and chartables.c from 'make clean'; once made
+# chartables.c shouldn't change, and if people have edited the tables by hand,
+# you don't want to throw them away.
+
+clean:; -rm -f *.o *.a pcretest pgrep
+
+runtest: all
+ ./RunTest
+
+######## MINGW32 ############### MINGW32 ############### MINGW32 #############
+
+# This addition for mingw32 was contributed by Paul Sokolovsky
+# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it!
+
+dll: _dll libpcre.dll.a pgrep_d pcretest_d
+
+_dll:
+ $(MAKE) CFLAGS=-DSTATIC pcre.dll
+
+pcre.dll: $(OBJ) pcreposix.o pcre.def
+libpcre.dll.a: pcre.def
+
+pgrep_d: libpcre.dll.a pgrep.o
+ $(CC) $(CFLAGS) -L. -o pgrep pgrep.o -lpcre.dll
+
+pcretest_d: libpcre.dll.a pcretest.o
+ $(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll
+
+# End
+
diff --git a/setedit/libpcre/Makefile.bcc b/setedit/libpcre/Makefile.bcc
new file mode 100644
index 0000000..0b3da22
--- /dev/null
+++ b/setedit/libpcre/Makefile.bcc
@@ -0,0 +1,73 @@
+# Makefile for for compiling PCRE library by Borland C++ 5.5
+
+!ifndef _SUBMAKE
+
+CC = bcc32
+LD = bcc32
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLFLAGS = -WR
+!endif
+
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLFLAGS) -WC -X -q $(CDEBUGFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+!endif
+
+O = .obj
+
+OBJ = maketables$(O) pcre$(O) study$(O) get$(O)
+
+all: pcre.lib
+
+dftables.exe: dftables.c internal.h maketables.c
+ $(CC) $(CFLAGS) $*.c
+
+chartables.c: dftables.exe
+ dftables >chartables.c
+
+maketables.obj: maketables.c internal.h chartables.c
+ $(CC) -c $(CFLAGS) $*.c
+
+get.obj: get.c internal.h
+ $(CC) -c $(CFLAGS) $*.c
+
+study.obj: study.c internal.h
+ $(CC) -c $(CFLAGS) $*.c
+
+pcre.obj: pcre.c internal.h
+ $(CC) -c $(CFLAGS) $*.c
+
+pcre.lib: $(OBJ)
+ del $@
+ tlib /E $@ @&&!
++$(**: = &^
++)
+!
+
+pcreposix.lib: pcreposix.obj
+ del $@
+ tlib /E $@ @&&!
++$(**: = &^
++)
+!
+
+pcretest.obj: pcretest.c
+ $(CC) -c $(CFLAGS) $*.c
+
+pcretest.exe: pcretest.obj
+ $(LD) $(LDFLAGS) pcretest.obj pcre.lib pcreposix.lib
+
+clean:
+ -del chartables.c
+ -del *.obj
+ -del *.exe
+ -del *.dll
+ -del *.lib
+ -del *.tds
diff --git a/setedit/libpcre/Makefile.nmk b/setedit/libpcre/Makefile.nmk
new file mode 100644
index 0000000..40b4c0b
--- /dev/null
+++ b/setedit/libpcre/Makefile.nmk
@@ -0,0 +1,65 @@
+# Makefile for for compiling PCRE library by MSVC
+
+!ifndef _SUBMAKE
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+CC = cl /nologo
+CXX = $(CC) /TP
+LD = $(CXX)
+
+CFLAGS = -O2 $(INC) -D_WIN32 -DSTATIC /GR- /GX-
+LDFLAGS =
+
+!endif
+
+O = .o
+
+OBJ = maketables$(O) pcre$(O) study$(O) get$(O)
+
+all:: pcre.lib
+
+dftables.o: dftables.c internal.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+dftables.exe: dftables.c internal.h maketables.c
+ $(CC) $(CFLAGS) $*.c
+
+chartables.c: dftables.exe
+ dftables > chartables.c
+
+maketables.o: maketables.c internal.h chartables.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+get.o: get.c internal.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+study.o: study.c internal.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+pcre.o: pcre.c internal.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+pcre.lib: $(OBJ)
+ -del bzip2.lib
+ lib /OUT:pcre.lib $(OBJ)
+
+pcreposix.lib: pcreposix.o
+ -del pcreposix.lib
+ lib /OUT:pcreposix.lib pcreposix.o
+
+pcretest.o: pcretest.c
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+pcretest.exe: pcretest.o
+ $(LD) $(LDFLAGS) pcretest.o pcre.lib pcreposix.lib
+
+clean:
+ -del chartables.c
+ -del *.o
+ -del *.exe
+ -del *.lib
+
diff --git a/setedit/libpcre/README b/setedit/libpcre/README
new file mode 100644
index 0000000..c9696ba
--- /dev/null
+++ b/setedit/libpcre/README
@@ -0,0 +1,416 @@
+README file for PCRE (Perl-compatible regular expressions)
+----------------------------------------------------------
+
+*******************************************************************************
+* IMPORTANT FOR THOSE UPGRADING FROM VERSIONS BEFORE 2.00 *
+* *
+* Please note that there has been a change in the API such that a larger *
+* ovector is required at matching time, to provide some additional workspace. *
+* The new man page has details. This change was necessary in order to support *
+* some of the new functionality in Perl 5.005. *
+* *
+* IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.00 *
+* *
+* Another (I hope this is the last!) change has been made to the API for the *
+* pcre_compile() function. An additional argument has been added to make it *
+* possible to pass over a pointer to character tables built in the current *
+* locale by pcre_maketables(). To use the default tables, this new arguement *
+* should be passed as NULL. *
+* *
+* IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 *
+* *
+* Yet another (and again I hope this really is the last) change has been made *
+* to the API for the pcre_exec() function. An additional argument has been *
+* added to make it possible to start the match other than at the start of the *
+* subject string. This is important if there are lookbehinds. The new man *
+* page has the details, but you just want to convert existing programs, all *
+* you need to do is to stick in a new fifth argument to pcre_exec(), with a *
+* value of zero. For example, change *
+* *
+* pcre_exec(pattern, extra, subject, length, options, ovec, ovecsize) *
+* to *
+* pcre_exec(pattern, extra, subject, length, 0, options, ovec, ovecsize) *
+*******************************************************************************
+
+
+The distribution should contain the following files:
+
+ ChangeLog log of changes to the code
+ LICENCE conditions for the use of PCRE
+ Makefile for building PCRE in Unix systems
+ README this file
+ RunTest a Unix shell script for running tests
+ Tech.Notes notes on the encoding
+ pcre.3 man page source for the functions
+ pcre.3.txt plain text version
+ pcre.3.html HTML version
+ pcreposix.3 man page source for the POSIX wrapper API
+ pcreposix.3.txt plain text version
+ pcreposix.3.HTML HTML version
+ dftables.c auxiliary program for building chartables.c
+ get.c )
+ maketables.c )
+ study.c ) source of
+ pcre.c ) the functions
+ pcreposix.c )
+ pcre.h header for the external API
+ pcreposix.h header for the external POSIX wrapper API
+ internal.h header for internal use
+ pcretest.c test program
+ pgrep.1 man page source for pgrep
+ pgrep.1.txt plain text version
+ pgrep.1.HTML HTML version
+ pgrep.c source of a grep utility that uses PCRE
+ perltest Perl test program
+ testinput1 test data, compatible with Perl 5.004 and 5.005
+ testinput2 test data for error messages and non-Perl things
+ testinput3 test data, compatible with Perl 5.005
+ testinput4 test data for locale-specific tests
+ testoutput1 test results corresponding to testinput1
+ testoutput2 test results corresponding to testinput2
+ testoutput3 test results corresponding to testinput3
+ testoutput4 test results corresponding to testinput4
+ dll.mk for Win32 DLL
+ pcre.def ditto
+
+To build PCRE on a Unix system, first edit Makefile for your system. It is a
+fairly simple make file, and there are some comments near the top, after the
+text "On a Unix system". Then run "make". It builds two libraries called
+libpcre.a and libpcreposix.a, a test program called pcretest, and the pgrep
+command. You can use "make install" to copy these, and the public header file
+pcre.h, to appropriate live directories on your system. These installation
+directories are defined at the top of the Makefile, and you should edit them if
+necessary.
+
+For a non-Unix system, read the comments at the top of Makefile, which give
+some hints on what needs to be done. PCRE has been compiled on Windows systems
+and on Macintoshes, but I don't know the details as I don't use those systems.
+It should be straightforward to build PCRE on any system that has a Standard C
+compiler.
+
+Some help in building a Win32 DLL of PCRE in GnuWin32 environments was
+contributed by Paul.Sokolovsky@technologist.com. These environments are
+Mingw32 (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and
+CygWin (http://sourceware.cygnus.com/cygwin/). Paul comments:
+
+ For CygWin, set CFLAGS=-mno-cygwin, and do 'make dll'. You'll get
+ pcre.dll (containing pcreposix also), libpcre.dll.a, and dynamically
+ linked pgrep and pcretest. If you have /bin/sh, run RunTest (three
+ main test go ok, locale not supported).
+
+To test PCRE, run the RunTest script in the pcre directory. This can also be
+run by "make runtest". It runs the pcretest test program (which is documented
+below) on each of the testinput files in turn, and compares the output with the
+contents of the corresponding testoutput file. A file called testtry is used to
+hold the output from pcretest. To run pcretest on just one of the test files,
+give its number as an argument to RunTest, for example:
+
+ RunTest 3
+
+The first and third test files can also be fed directly into the perltest
+script to check that Perl gives the same results. The third file requires the
+additional features of release 5.005, which is why it is kept separate from the
+main test input, which needs only Perl 5.004. In the long run, when 5.005 is
+widespread, these two test files may get amalgamated.
+
+The second set of tests check pcre_info(), pcre_study(), pcre_copy_substring(),
+pcre_get_substring(), pcre_get_substring_list(), error detection and run-time
+flags that are specific to PCRE, as well as the POSIX wrapper API.
+
+The fourth set of tests checks pcre_maketables(), the facility for building a
+set of character tables for a specific locale and using them instead of the
+default tables. The tests make use of the "fr" (French) locale. Before running
+the test, the script checks for the presence of this locale by running the
+"locale" command. If that command fails, or if it doesn't include "fr" in the
+list of available locales, the fourth test cannot be run, and a comment is
+output to say why. If running this test produces instances of the error
+
+ ** Failed to set locale "fr"
+
+in the comparison output, it means that locale is not available on your system,
+despite being listed by "locale". This does not mean that PCRE is broken.
+
+PCRE has its own native API, but a set of "wrapper" functions that are based on
+the POSIX API are also supplied in the library libpcreposix.a. Note that this
+just provides a POSIX calling interface to PCRE: the regular expressions
+themselves still follow Perl syntax and semantics. The header file
+for the POSIX-style functions is called pcreposix.h. The official POSIX name is
+regex.h, but I didn't want to risk possible problems with existing files of
+that name by distributing it that way. To use it with an existing program that
+uses the POSIX API, it will have to be renamed or pointed at by a link.
+
+
+Character tables
+----------------
+
+PCRE uses four tables for manipulating and identifying characters. The final
+argument of the pcre_compile() function is a pointer to a block of memory
+containing the concatenated tables. A call to pcre_maketables() can be used to
+generate a set of tables in the current locale. If the final argument for
+pcre_compile() is passed as NULL, a set of default tables that is built into
+the binary is used.
+
+The source file called chartables.c contains the default set of tables. This is
+not supplied in the distribution, but is built by the program dftables
+(compiled from dftables.c), which uses the ANSI C character handling functions
+such as isalnum(), isalpha(), isupper(), islower(), etc. to build the table
+sources. This means that the default C locale which is set for your system will
+control the contents of these default tables. You can change the default tables
+by editing chartables.c and then re-building PCRE. If you do this, you should
+probably also edit Makefile to ensure that the file doesn't ever get
+re-generated.
+
+The first two 256-byte tables provide lower casing and case flipping functions,
+respectively. The next table consists of three 32-byte bit maps which identify
+digits, "word" characters, and white space, respectively. These are used when
+building 32-byte bit maps that represent character classes.
+
+The final 256-byte table has bits indicating various character types, as
+follows:
+
+ 1 white space character
+ 2 letter
+ 4 decimal digit
+ 8 hexadecimal digit
+ 16 alphanumeric or '_'
+ 128 regular expression metacharacter or binary zero
+
+You should not alter the set of characters that contain the 128 bit, as that
+will cause PCRE to malfunction.
+
+
+The pcretest program
+--------------------
+
+This program is intended for testing PCRE, but it can also be used for
+experimenting with regular expressions.
+
+If it is given two filename arguments, it reads from the first and writes to
+the second. If it is given only one filename argument, it reads from that file
+and writes to stdout. Otherwise, it reads from stdin and writes to stdout, and
+prompts for each line of input.
+
+The program handles any number of sets of input on a single input file. Each
+set starts with a regular expression, and continues with any number of data
+lines to be matched against the pattern. An empty line signals the end of the
+set. The regular expressions are given enclosed in any non-alphameric
+delimiters other than backslash, for example
+
+ /(a|bc)x+yz/
+
+White space before the initial delimiter is ignored. A regular expression may
+be continued over several input lines, in which case the newline characters are
+included within it. See the testinput files for many examples. It is possible
+to include the delimiter within the pattern by escaping it, for example
+
+ /abc\/def/
+
+If you do so, the escape and the delimiter form part of the pattern, but since
+delimiters are always non-alphameric, this does not affect its interpretation.
+If the terminating delimiter is immediately followed by a backslash, for
+example,
+
+ /abc/\
+
+then a backslash is added to the end of the pattern. This is done to provide a
+way of testing the error condition that arises if a pattern finishes with a
+backslash, because
+
+ /abc\/
+
+is interpreted as the first line of a pattern that starts with "abc/", causing
+pcretest to read the next line as a continuation of the regular expression.
+
+The pattern may be followed by i, m, s, or x to set the PCRE_CASELESS,
+PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively. For
+example:
+
+ /caseless/i
+
+These modifier letters have the same effect as they do in Perl. There are
+others which set PCRE options that do not correspond to anything in Perl: /A,
+/E, and /X set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, and PCRE_EXTRA respectively.
+
+Searching for all possible matches within each subject string can be requested
+by the /g or /G modifier. After finding a match, PCRE is called again to search
+the remainder of the subject string. The difference between /g and /G is that
+the former uses the startoffset argument to pcre_exec() to start searching at
+a new point within the entire string (which is in effect what Perl does),
+whereas the latter passes over a shortened substring. This makes a difference
+to the matching process if the pattern begins with a lookbehind assertion
+(including \b or \B).
+
+If any call to pcre_exec() in a /g or /G sequence matches an empty string, the
+next call is done with the PCRE_NOTEMPTY flag set so that it cannot match an
+empty string again. This imitates the way Perl handles such cases when using
+the /g modifier or the split() function.
+
+There are a number of other modifiers for controlling the way pcretest
+operates.
+
+The /+ modifier requests that as well as outputting the substring that matched
+the entire pattern, pcretest should in addition output the remainder of the
+subject string. This is useful for tests where the subject contains multiple
+copies of the same substring.
+
+The /L modifier must be followed directly by the name of a locale, for example,
+
+ /pattern/Lfr
+
+For this reason, it must be the last modifier letter. The given locale is set,
+pcre_maketables() is called to build a set of character tables for the locale,
+and this is then passed to pcre_compile() when compiling the regular
+expression. Without an /L modifier, NULL is passed as the tables pointer; that
+is, /L applies only to the expression on which it appears.
+
+The /I modifier requests that pcretest output information about the compiled
+expression (whether it is anchored, has a fixed first character, and so on). It
+does this by calling pcre_info() after compiling an expression, and outputting
+the information it gets back. If the pattern is studied, the results of that
+are also output.
+
+The /D modifier is a PCRE debugging feature, which also assumes /I. It causes
+the internal form of compiled regular expressions to be output after
+compilation.
+
+The /S modifier causes pcre_study() to be called after the expression has been
+compiled, and the results used when the expression is matched.
+
+The /M modifier causes the size of memory block used to hold the compiled
+pattern to be output.
+
+Finally, the /P modifier causes pcretest to call PCRE via the POSIX wrapper API
+rather than its native API. When this is done, all other modifiers except /i,
+/m, and /+ are ignored. REG_ICASE is set if /i is present, and REG_NEWLINE is
+set if /m is present. The wrapper functions force PCRE_DOLLAR_ENDONLY always,
+and PCRE_DOTALL unless REG_NEWLINE is set.
+
+Before each data line is passed to pcre_exec(), leading and trailing whitespace
+is removed, and it is then scanned for \ escapes. The following are recognized:
+
+ \a alarm (= BEL)
+ \b backspace
+ \e escape
+ \f formfeed
+ \n newline
+ \r carriage return
+ \t tab
+ \v vertical tab
+ \nnn octal character (up to 3 octal digits)
+ \xhh hexadecimal character (up to 2 hex digits)
+
+ \A pass the PCRE_ANCHORED option to pcre_exec()
+ \B pass the PCRE_NOTBOL option to pcre_exec()
+ \Cdd call pcre_copy_substring() for substring dd after a successful match
+ (any decimal number less than 32)
+ \Gdd call pcre_get_substring() for substring dd after a successful match
+ (any decimal number less than 32)
+ \L call pcre_get_substringlist() after a successful match
+ \N pass the PCRE_NOTEMPTY option to pcre_exec()
+ \Odd set the size of the output vector passed to pcre_exec() to dd
+ (any number of decimal digits)
+ \Z pass the PCRE_NOTEOL option to pcre_exec()
+
+A backslash followed by anything else just escapes the anything else. If the
+very last character is a backslash, it is ignored. This gives a way of passing
+an empty line as data, since a real empty line terminates the data input.
+
+If /P was present on the regex, causing the POSIX wrapper API to be used, only
+\B, and \Z have any effect, causing REG_NOTBOL and REG_NOTEOL to be passed to
+regexec() respectively.
+
+When a match succeeds, pcretest outputs the list of captured substrings that
+pcre_exec() returns, starting with number 0 for the string that matched the
+whole pattern. Here is an example of an interactive pcretest run.
+
+ $ pcretest
+ PCRE version 2.06 08-Jun-1999
+
+ re> /^abc(\d+)/
+ data> abc123
+ 0: abc123
+ 1: 123
+ data> xyz
+ No match
+
+If the strings contain any non-printing characters, they are output as \0x
+escapes. If the pattern has the /+ modifier, then the output for substring 0 is
+followed by the the rest of the subject string, identified by "0+" like this:
+
+ re> /cat/+
+ data> cataract
+ 0: cat
+ 0+ aract
+
+If the pattern has the /g or /G modifier, the results of successive matching
+attempts are output in sequence, like this:
+
+ re> /\Bi(\w\w)/g
+ data> Mississippi
+ 0: iss
+ 1: ss
+ 0: iss
+ 1: ss
+ 0: ipp
+ 1: pp
+
+"No match" is output only if the first match attempt fails.
+
+If any of \C, \G, or \L are present in a data line that is successfully
+matched, the substrings extracted by the convenience functions are output with
+C, G, or L after the string number instead of a colon. This is in addition to
+the normal full list. The string length (that is, the return from the
+extraction function) is given in parentheses after each string for \C and \G.
+
+Note that while patterns can be continued over several lines (a plain ">"
+prompt is used for continuations), data lines may not. However newlines can be
+included in data by means of the \n escape.
+
+If the -p option is given to pcretest, it is equivalent to adding /P to each
+regular expression: the POSIX wrapper API is used to call PCRE. None of the
+following flags has any effect in this case.
+
+If the option -d is given to pcretest, it is equivalent to adding /D to each
+regular expression: the internal form is output after compilation.
+
+If the option -i is given to pcretest, it is equivalent to adding /I to each
+regular expression: information about the compiled pattern is given after
+compilation.
+
+If the option -m is given to pcretest, it outputs the size of each compiled
+pattern after it has been compiled. It is equivalent to adding /M to each
+regular expression. For compatibility with earlier versions of pcretest, -s is
+a synonym for -m.
+
+If the -t option is given, each compile, study, and match is run 20000 times
+while being timed, and the resulting time per compile or match is output in
+milliseconds. Do not set -t with -s, because you will then get the size output
+20000 times and the timing will be distorted. If you want to change the number
+of repetitions used for timing, edit the definition of LOOPREPEAT at the top of
+pcretest.c
+
+
+
+The perltest program
+--------------------
+
+The perltest program tests Perl's regular expressions; it has the same
+specification as pcretest, and so can be given identical input, except that
+input patterns can be followed only by Perl's lower case modifiers. The
+contents of testinput1 and testinput3 meet this condition.
+
+The data lines are processed as Perl double-quoted strings, so if they contain
+" \ $ or @ characters, these have to be escaped. For this reason, all such
+characters in testinput1 and testinput3 are escaped so that they can be used
+for perltest as well as for pcretest, and the special upper case modifiers such
+as /A that pcretest recognizes are not used in these files. The output should
+be identical, apart from the initial identifying banner.
+
+The testinput2 and testinput4 files are not suitable for feeding to perltest,
+since they do make use of the special upper case modifiers and escapes that
+pcretest uses to test some features of PCRE. The first of these files also
+contains malformed regular expressions, in order to check that PCRE diagnoses
+them correctly.
+
+Philip Hazel <ph10@cam.ac.uk>
+July 1999
diff --git a/setedit/libpcre/dftables.c b/setedit/libpcre/dftables.c
new file mode 100644
index 0000000..7b336e6
--- /dev/null
+++ b/setedit/libpcre/dftables.c
@@ -0,0 +1,146 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/*
+PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+ Copyright (c) 1997-1999 University of Cambridge
+
+-----------------------------------------------------------------------------
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+-----------------------------------------------------------------------------
+
+See the file Tech.Notes for some information on the internals.
+*/
+
+
+/* This is a support program to generate the file chartables.c, containing
+character tables of various kinds. They are built according to the default C
+locale and used as the default tables by PCRE. Now that pcre_maketables is
+a function visible to the outside world, we make use of its code from here in
+order to be consistent. */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "internal.h"
+
+#define DFTABLES /* maketables.c notices this */
+#include "maketables.c"
+
+
+int main(void)
+{
+int i;
+unsigned const char *tables = pcre_maketables();
+
+printf(
+ "/*************************************************\n"
+ "* Perl-Compatible Regular Expressions *\n"
+ "*************************************************/\n\n"
+ "/* This file is automatically written by the dftables auxiliary \n"
+ "program. If you edit it by hand, you might like to edit the Makefile to \n"
+ "prevent its ever being regenerated.\n\n"
+ "This file is #included in the compilation of pcre.c to build the default\n"
+ "character tables which are used when no tables are passed to the compile\n"
+ "function. */\n\n"
+ "static unsigned char pcre_default_tables[] = {\n\n"
+ "/* This table is a lower casing table. */\n\n");
+
+printf(" ");
+for (i = 0; i < 256; i++)
+ {
+ if ((i & 7) == 0 && i != 0) printf("\n ");
+ printf("%3d", *tables++);
+ if (i != 255) printf(",");
+ }
+printf(",\n\n");
+
+printf("/* This table is a case flipping table. */\n\n");
+
+printf(" ");
+for (i = 0; i < 256; i++)
+ {
+ if ((i & 7) == 0 && i != 0) printf("\n ");
+ printf("%3d", *tables++);
+ if (i != 255) printf(",");
+ }
+printf(",\n\n");
+
+printf(
+ "/* This table contains bit maps for digits, 'word' chars, and white\n"
+ "space. Each map is 32 bytes long and the bits run from the least\n"
+ "significant end of each byte. */\n\n");
+
+printf(" ");
+for (i = 0; i < cbit_length; i++)
+ {
+ if ((i & 7) == 0 && i != 0)
+ {
+ if ((i & 31) == 0) printf("\n");
+ printf("\n ");
+ }
+ printf("0x%02x", *tables++);
+ if (i != cbit_length - 1) printf(",");
+ }
+printf(" ,\n\n");
+
+printf(
+ "/* This table identifies various classes of character by individual bits:\n"
+ " 0x%02x white space character\n"
+ " 0x%02x letter\n"
+ " 0x%02x decimal digit\n"
+ " 0x%02x hexadecimal digit\n"
+ " 0x%02x alphanumeric or '_'\n"
+ " 0x%02x regular expression metacharacter or binary zero\n*/\n\n",
+ ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word,
+ ctype_meta);
+
+printf(" ");
+for (i = 0; i < 256; i++)
+ {
+ if ((i & 7) == 0 && i != 0)
+ {
+ printf(" /* ");
+ if (isprint(i-8)) printf(" %c -", i-8);
+ else printf("%3d-", i-8);
+ if (isprint(i-1)) printf(" %c ", i-1);
+ else printf("%3d", i-1);
+ printf(" */\n ");
+ }
+ printf("0x%02x", *tables++);
+ if (i != 255) printf(",");
+ }
+
+printf("};/* ");
+if (isprint(i-8)) printf(" %c -", i-8);
+ else printf("%3d-", i-8);
+if (isprint(i-1)) printf(" %c ", i-1);
+ else printf("%3d", i-1);
+printf(" */\n\n/* End of chartables.c */\n");
+
+return 0;
+}
+
+/* End of dftables.c */
diff --git a/setedit/libpcre/get.c b/setedit/libpcre/get.c
new file mode 100644
index 0000000..035668e
--- /dev/null
+++ b/setedit/libpcre/get.c
@@ -0,0 +1,189 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/*
+This is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language. See
+the file Tech.Notes for some information on the internals.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+ Copyright (c) 1997-1999 University of Cambridge
+
+-----------------------------------------------------------------------------
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+-----------------------------------------------------------------------------
+*/
+
+/* This module contains some convenience functions for extracting substrings
+from the subject string after a regex match has succeeded. The original idea
+for these functions came from Scott Wimer <scottw@cgibuilder.com>. */
+
+
+/* Include the internals header, which itself includes Standard C headers plus
+the external pcre header. */
+
+#include "internal.h"
+
+
+
+/*************************************************
+* Copy captured string to given buffer *
+*************************************************/
+
+/* This function copies a single captured substring into a given buffer.
+Note that we use memcpy() rather than strncpy() in case there are binary zeros
+in the string.
+
+Arguments:
+ subject the subject string that was matched
+ ovector pointer to the offsets table
+ stringcount the number of substrings that were captured
+ (i.e. the yield of the pcre_exec call, unless
+ that was zero, in which case it should be 1/3
+ of the offset table size)
+ stringnumber the number of the required substring
+ buffer where to put the substring
+ size the size of the buffer
+
+Returns: if successful:
+ the length of the copied string, not including the zero
+ that is put on the end; can be zero
+ if not successful:
+ PCRE_ERROR_NOMEMORY (-6) buffer too small
+ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring
+*/
+
+int
+pcre_copy_substring(const char *subject, int *ovector, int stringcount,
+ int stringnumber, char *buffer, int size)
+{
+int yield;
+if (stringnumber < 0 || stringnumber >= stringcount)
+ return PCRE_ERROR_NOSUBSTRING;
+stringnumber *= 2;
+yield = ovector[stringnumber+1] - ovector[stringnumber];
+if (size < yield + 1) return PCRE_ERROR_NOMEMORY;
+memcpy(buffer, subject + ovector[stringnumber], yield);
+buffer[yield] = 0;
+return yield;
+}
+
+
+
+/*************************************************
+* Copy all captured strings to new store *
+*************************************************/
+
+/* This function gets one chunk of store and builds a list of pointers and all
+of the captured substrings in it. A NULL pointer is put on the end of the list.
+
+Arguments:
+ subject the subject string that was matched
+ ovector pointer to the offsets table
+ stringcount the number of substrings that were captured
+ (i.e. the yield of the pcre_exec call, unless
+ that was zero, in which case it should be 1/3
+ of the offset table size)
+ listptr set to point to the list of pointers
+
+Returns: if successful: 0
+ if not successful:
+ PCRE_ERROR_NOMEMORY (-6) failed to get store
+*/
+
+int
+pcre_get_substring_list(const char *subject, int *ovector, int stringcount,
+ const char ***listptr)
+{
+int i;
+int size = sizeof(char *);
+int double_count = stringcount * 2;
+char **stringlist;
+char *p;
+
+for (i = 0; i < double_count; i += 2)
+ size += sizeof(char *) + ovector[i+1] - ovector[i] + 1;
+
+stringlist = (char **)(pcre_malloc)(size);
+if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
+
+*listptr = (const char **)stringlist;
+p = (char *)(stringlist + stringcount + 1);
+
+for (i = 0; i < double_count; i += 2)
+ {
+ int len = ovector[i+1] - ovector[i];
+ memcpy(p, subject + ovector[i], len);
+ *stringlist++ = p;
+ p += len;
+ *p++ = 0;
+ }
+
+*stringlist = NULL;
+return 0;
+}
+
+
+
+/*************************************************
+* Copy captured string to new store *
+*************************************************/
+
+/* This function copies a single captured substring into a piece of new
+store
+
+Arguments:
+ subject the subject string that was matched
+ ovector pointer to the offsets table
+ stringcount the number of substrings that were captured
+ (i.e. the yield of the pcre_exec call, unless
+ that was zero, in which case it should be 1/3
+ of the offset table size)
+ stringnumber the number of the required substring
+ stringptr where to put a pointer to the substring
+
+Returns: if successful:
+ the length of the string, not including the zero that
+ is put on the end; can be zero
+ if not successful:
+ PCRE_ERROR_NOMEMORY (-6) failed to get store
+ PCRE_ERROR_NOSUBSTRING (-7) substring not present
+*/
+
+int
+pcre_get_substring(const char *subject, int *ovector, int stringcount,
+ int stringnumber, const char **stringptr)
+{
+int yield;
+char *substring;
+if (stringnumber < 0 || stringnumber >= stringcount)
+ return PCRE_ERROR_NOSUBSTRING;
+stringnumber *= 2;
+yield = ovector[stringnumber+1] - ovector[stringnumber];
+substring = (char *)(pcre_malloc)(yield + 1);
+if (substring == NULL) return PCRE_ERROR_NOMEMORY;
+memcpy(substring, subject + ovector[stringnumber], yield);
+substring[yield] = 0;
+*stringptr = substring;
+return yield;
+}
+
+/* End of get.c */
diff --git a/setedit/libpcre/gnumake.in b/setedit/libpcre/gnumake.in
new file mode 100644
index 0000000..2cc1396
--- /dev/null
+++ b/setedit/libpcre/gnumake.in
@@ -0,0 +1,160 @@
+# Make file for PCRE (Perl-Compatible Regular Expression) library.
+
+# If you are using a Unix system, see below. I am a Unix person, so that is
+# the stuff I really know about. PCRE is developed on a Unix box.
+
+# To build mingw32 DLL uncomment the next two lines. This addition for mingw32
+# was contributed by Paul Sokolovsky <Paul.Sokolovsky@technologist.com>. I
+# (Philip Hazel) don't know anything about it! There are some additional
+# targets at the bottom of this Makefile.
+#
+# include dll.mk
+# DLL_LDFLAGS=-s
+
+
+######## NON-UNIX ############ NON-UNIX ############## NON-UNIX ##############
+# If you want to compile PCRE for a non-Unix system, note that it consists
+# entirely of code written in Standard C, and so should compile successfully
+# using normal compiling commands to do the following:
+#
+# (1) Compile dftables.c as a stand-alone program, and then run it with
+# output sent to chartables.c. This generates a set of standard character
+# tables.
+#
+# (2) Compile maketables.c, get.c, study.c and pcre.c and link them all
+# together. This is the pcre library (chartables.c gets included by means of
+# an #include directive).
+#
+# (3) Compile pcreposix.c and link it as the pcreposix library.
+#
+# (4) Compile the test program pcretest.c. This needs the functions in the
+# pcre and pcreposix libraries when linking.
+#
+# (5) Run pcretest on the testinput files, and check that the output matches
+# the corresponding testoutput files. You must use the -i option with
+# testinput2.
+
+
+######## UNIX ################## UNIX ################## UNIX ################
+# On a Unix system:
+#
+# Edit CC, CFLAGS, and RANLIB for your system.
+#
+# It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux,
+# MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.
+#
+# Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the
+# memmove() function, but has bcopy().
+#
+# Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that
+# lacks the strerror() function, but can provide the equivalent by indexing
+# into errlist.
+
+AR = @AR@ cq
+CC = @CC@ -DSTATIC
+CFLAGS = @CFLAGS@
+RANLIB = ranlib
+
+# If you are going to obey "make install", edit these settings for your
+# system. BINDIR is the directory in which the pgrep command is installed.
+# INCDIR is the directory in which the public header file pcre.h is installed.
+# LIBDIR is the directory in which the libraries are installed. MANDIR is the
+# directory in which the man pages are installed. The pcretest program, as it
+# is a test program, does not get installed anywhere.
+
+PREFIX = @PREFIX@
+BINDIR = $(PREFIX)/bin
+INCDIR = $(PREFIX)/include
+LIBDIR = $(PREFIX)/lib
+MANDIR = $(PREFIX)/man
+
+
+##############################################################################
+
+
+OBJ = maketables.o get.o study.o pcre.o
+
+all: libpcre.a libpcreposix.a pcretest pgrep
+
+pgrep: libpcre.a pgrep.o
+ $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a
+
+pcretest: libpcre.a libpcreposix.a pcretest.o
+ $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
+
+libpcre.a: $(OBJ)
+ -rm -f libpcre.a
+ $(AR) libpcre.a $(OBJ)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+libpcreposix.a: pcreposix.o
+ -rm -f libpcreposix.a
+ $(AR) libpcreposix.a pcreposix.o
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+pcre.o: chartables.c pcre.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) pcre.c
+
+pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h Makefile
+ $(CC) -c $(CFLAGS) pcreposix.c
+
+maketables.o: maketables.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) maketables.c
+
+get.o: get.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) get.c
+
+study.o: study.c pcre.h internal.h Makefile
+ $(CC) -c $(CFLAGS) study.c
+
+pcretest.o: pcretest.c pcre.h Makefile
+ $(CC) -c $(CFLAGS) pcretest.c
+
+pgrep.o: pgrep.c pcre.h Makefile
+ $(CC) -c $(CFLAGS) pgrep.c
+
+# An auxiliary program makes the default character table source
+
+chartables.c: dftables
+ ./dftables >chartables.c
+
+dftables: dftables.c maketables.c pcre.h internal.h Makefile
+ $(CC) -o dftables $(CFLAGS) dftables.c
+
+install: all
+ cp libpcre.a libpcreposix.a $(LIBDIR)
+ cp pcre.h $(INCDIR)
+ cp pgrep $(BINDIR)
+ cp pcre.3 pcreposix.3 $(MANDIR)/man3
+ cp pgrep.1 $(MANDIR)/man1
+
+# We deliberately omit dftables and chartables.c from 'make clean'; once made
+# chartables.c shouldn't change, and if people have edited the tables by hand,
+# you don't want to throw them away.
+
+clean:; -rm -f *.o *.a pcretest pgrep
+
+runtest: all
+ ./RunTest
+
+######## MINGW32 ############### MINGW32 ############### MINGW32 #############
+
+# This addition for mingw32 was contributed by Paul Sokolovsky
+# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it!
+
+dll: _dll libpcre.dll.a pgrep_d pcretest_d
+
+_dll:
+ $(MAKE) CFLAGS=-DSTATIC pcre.dll
+
+pcre.dll: $(OBJ) pcreposix.o pcre.def
+libpcre.dll.a: pcre.def
+
+pgrep_d: libpcre.dll.a pgrep.o
+ $(CC) $(CFLAGS) -L. -o pgrep pgrep.o -lpcre.dll
+
+pcretest_d: libpcre.dll.a pcretest.o
+ $(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll
+
+# End
+
diff --git a/setedit/libpcre/internal.h b/setedit/libpcre/internal.h
new file mode 100644
index 0000000..13df1d6
--- /dev/null
+++ b/setedit/libpcre/internal.h
@@ -0,0 +1,343 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+
+/* This is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language. See
+the file Tech.Notes for some information on the internals.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+ Copyright (c) 1997-1999 University of Cambridge
+
+-----------------------------------------------------------------------------
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+-----------------------------------------------------------------------------
+*/
+
+/* This header contains definitions that are shared between the different
+modules, but which are not relevant to the outside. */
+
+/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(),
+define a macro for memmove() if USE_BCOPY is defined. */
+
+#ifdef USE_BCOPY
+#undef memmove /* some systems may have a macro */
+#define memmove(a, b, c) bcopy(b, a, c)
+#endif
+
+/* Standard C headers plus the external interface definition */
+
+#include <ctype.h>
+#include <limits.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "pcre.h"
+
+/* In case there is no definition of offsetof() provided - though any proper
+Standard C system should have one. */
+
+#ifndef offsetof
+#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))
+#endif
+
+/* These are the public options that can change during matching. */
+
+#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)
+
+/* Private options flags start at the most significant end of the four bytes,
+but skip the top bit so we can use ints for convenience without getting tangled
+with negative values. The public options defined in pcre.h start at the least
+significant end. Make sure they don't overlap, though now that we have expanded
+to four bytes there is plenty of space. */
+
+#define PCRE_FIRSTSET 0x40000000 /* first_char is set */
+#define PCRE_REQCHSET 0x20000000 /* req_char is set */
+#define PCRE_STARTLINE 0x10000000 /* start after \n for multiline */
+#define PCRE_INGROUP 0x08000000 /* compiling inside a group */
+#define PCRE_ICHANGED 0x04000000 /* i option changes within regex */
+
+/* Options for the "extra" block produced by pcre_study(). */
+
+#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */
+
+/* Masks for identifying the public options which are permitted at compile
+time, run time or study time, respectively. */
+
+#define PUBLIC_OPTIONS \
+ (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \
+ PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY)
+
+#define PUBLIC_EXEC_OPTIONS \
+ (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY)
+
+#define PUBLIC_STUDY_OPTIONS 0 /* None defined */
+
+/* Magic number to provide a small check against being handed junk. */
+
+#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */
+
+/* Miscellaneous definitions */
+
+typedef int BOOL;
+
+#define FALSE 0
+#define TRUE 1
+
+/* These are escaped items that aren't just an encoding of a particular data
+value such as \n. They must have non-zero values, as check_escape() returns
+their negation. Also, they must appear in the same order as in the opcode
+definitions below, up to ESC_z. The final one must be ESC_REF as subsequent
+values are used for \1, \2, \3, etc. There is a test in the code for an escape
+greater than ESC_b and less than ESC_X to detect the types that may be
+repeated. If any new escapes are put in-between that don't consume a character,
+that code will have to change. */
+
+enum { ESC_A = 1, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, ESC_w,
+ ESC_Z, ESC_z, ESC_REF };
+
+/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets
+that extract substrings. Starting from 1 (i.e. after OP_END), the values up to
+OP_EOD must correspond in order to the list of escapes immediately above. */
+
+enum {
+ OP_END, /* End of pattern */
+
+ /* Values corresponding to backslashed metacharacters */
+
+ OP_SOD, /* Start of data: \A */
+ OP_NOT_WORD_BOUNDARY, /* \B */
+ OP_WORD_BOUNDARY, /* \b */
+ OP_NOT_DIGIT, /* \D */
+ OP_DIGIT, /* \d */
+ OP_NOT_WHITESPACE, /* \S */
+ OP_WHITESPACE, /* \s */
+ OP_NOT_WORDCHAR, /* \W */
+ OP_WORDCHAR, /* \w */
+ OP_EODN, /* End of data or \n at end of data: \Z. */
+ OP_EOD, /* End of data: \z */
+
+ OP_OPT, /* Set runtime options */
+ OP_CIRC, /* Start of line - varies with multiline switch */
+ OP_DOLL, /* End of line - varies with multiline switch */
+ OP_ANY, /* Match any character */
+ OP_CHARS, /* Match string of characters */
+ OP_NOT, /* Match anything but the following char */
+
+ OP_STAR, /* The maximizing and minimizing versions of */
+ OP_MINSTAR, /* all these opcodes must come in pairs, with */
+ OP_PLUS, /* the minimizing one second. */
+ OP_MINPLUS, /* This first set applies to single characters */
+ OP_QUERY,
+ OP_MINQUERY,
+ OP_UPTO, /* From 0 to n matches */
+ OP_MINUPTO,
+ OP_EXACT, /* Exactly n matches */
+
+ OP_NOTSTAR, /* The maximizing and minimizing versions of */
+ OP_NOTMINSTAR, /* all these opcodes must come in pairs, with */
+ OP_NOTPLUS, /* the minimizing one second. */
+ OP_NOTMINPLUS, /* This first set applies to "not" single characters */
+ OP_NOTQUERY,
+ OP_NOTMINQUERY,
+ OP_NOTUPTO, /* From 0 to n matches */
+ OP_NOTMINUPTO,
+ OP_NOTEXACT, /* Exactly n matches */
+
+ OP_TYPESTAR, /* The maximizing and minimizing versions of */
+ OP_TYPEMINSTAR, /* all these opcodes must come in pairs, with */
+ OP_TYPEPLUS, /* the minimizing one second. These codes must */
+ OP_TYPEMINPLUS, /* be in exactly the same order as those above. */
+ OP_TYPEQUERY, /* This set applies to character types such as \d */
+ OP_TYPEMINQUERY,
+ OP_TYPEUPTO, /* From 0 to n matches */
+ OP_TYPEMINUPTO,
+ OP_TYPEEXACT, /* Exactly n matches */
+
+ OP_CRSTAR, /* The maximizing and minimizing versions of */
+ OP_CRMINSTAR, /* all these opcodes must come in pairs, with */
+ OP_CRPLUS, /* the minimizing one second. These codes must */
+ OP_CRMINPLUS, /* be in exactly the same order as those above. */
+ OP_CRQUERY, /* These are for character classes and back refs */
+ OP_CRMINQUERY,
+ OP_CRRANGE, /* These are different to the three seta above. */
+ OP_CRMINRANGE,
+
+ OP_CLASS, /* Match a character class */
+ OP_REF, /* Match a back reference */
+
+ OP_ALT, /* Start of alternation */
+ OP_KET, /* End of group that doesn't have an unbounded repeat */
+ OP_KETRMAX, /* These two must remain together and in this */
+ OP_KETRMIN, /* order. They are for groups the repeat for ever. */
+
+ /* The assertions must come before ONCE and COND */
+
+ OP_ASSERT, /* Positive lookahead */
+ OP_ASSERT_NOT, /* Negative lookahead */
+ OP_ASSERTBACK, /* Positive lookbehind */
+ OP_ASSERTBACK_NOT, /* Negative lookbehind */
+ OP_REVERSE, /* Move pointer back - used in lookbehind assertions */
+
+ /* ONCE and COND must come after the assertions, with ONCE first, as there's
+ a test for >= ONCE for a subpattern that isn't an assertion. */
+
+ OP_ONCE, /* Once matched, don't back up into the subpattern */
+ OP_COND, /* Conditional group */
+ OP_CREF, /* Used to hold an extraction string number */
+
+ OP_BRAZERO, /* These two must remain together and in this */
+ OP_BRAMINZERO, /* order. */
+
+ OP_BRA /* This and greater values are used for brackets that
+ extract substrings. */
+};
+
+/* The highest extraction number. This is limited by the number of opcodes
+left after OP_BRA, i.e. 255 - OP_BRA. We actually set it somewhat lower. */
+
+#define EXTRACT_MAX 99
+
+/* The texts of compile-time error messages are defined as macros here so that
+they can be accessed by the POSIX wrapper and converted into error codes. Yes,
+I could have used error codes in the first place, but didn't feel like changing
+just to accommodate the POSIX wrapper. */
+
+#define ERR1 "\\ at end of pattern"
+#define ERR2 "\\c at end of pattern"
+#define ERR3 "unrecognized character follows \\"
+#define ERR4 "numbers out of order in {} quantifier"
+#define ERR5 "number too big in {} quantifier"
+#define ERR6 "missing terminating ] for character class"
+#define ERR7 "invalid escape sequence in character class"
+#define ERR8 "range out of order in character class"
+#define ERR9 "nothing to repeat"
+#define ERR10 "operand of unlimited repeat could match the empty string"
+#define ERR11 "internal error: unexpected repeat"
+#define ERR12 "unrecognized character after (?"
+#define ERR13 "too many capturing parenthesized sub-patterns"
+#define ERR14 "missing )"
+#define ERR15 "back reference to non-existent subpattern"
+#define ERR16 "erroffset passed as NULL"
+#define ERR17 "unknown option bit(s) set"
+#define ERR18 "missing ) after comment"
+#define ERR19 "too many sets of parentheses"
+#define ERR20 "regular expression too large"
+#define ERR21 "failed to get memory"
+#define ERR22 "unmatched parentheses"
+#define ERR23 "internal error: code overflow"
+#define ERR24 "unrecognized character after (?<"
+#define ERR25 "lookbehind assertion is not fixed length"
+#define ERR26 "malformed number after (?("
+#define ERR27 "conditional group contains more than two branches"
+#define ERR28 "assertion expected after (?("
+
+/* All character handling must be done as unsigned characters. Otherwise there
+are problems with top-bit-set characters and functions such as isspace().
+However, we leave the interface to the outside world as char *, because that
+should make things easier for callers. We define a short type for unsigned char
+to save lots of typing. I tried "uchar", but it causes problems on Digital
+Unix, where it is defined in sys/types, so use "uschar" instead. */
+
+typedef unsigned char uschar;
+
+/* The real format of the start of the pcre block; the actual code vector
+runs on as long as necessary after the end. */
+
+typedef struct real_pcre {
+ unsigned long int magic_number;
+ const unsigned char *tables;
+ unsigned long int options;
+ uschar top_bracket;
+ uschar top_backref;
+ uschar first_char;
+ uschar req_char;
+ uschar code[1];
+} real_pcre;
+
+/* The real format of the extra block returned by pcre_study(). */
+
+typedef struct real_pcre_extra {
+ uschar options;
+ uschar start_bits[32];
+} real_pcre_extra;
+
+
+/* Structure for passing "static" information around between the functions
+doing the compiling, so that they are thread-safe. */
+
+typedef struct compile_data {
+ const uschar *lcc; /* Points to lower casing table */
+ const uschar *fcc; /* Points to case-flipping table */
+ const uschar *cbits; /* Points to character type table */
+ const uschar *ctypes; /* Points to table of type maps */
+} compile_data;
+
+/* Structure for passing "static" information around between the functions
+doing the matching, so that they are thread-safe. */
+
+typedef struct match_data {
+ int errorcode; /* As it says */
+ int *offset_vector; /* Offset vector */
+ int offset_end; /* One past the end */
+ int offset_max; /* The maximum usable for return data */
+ const uschar *lcc; /* Points to lower casing table */
+ const uschar *ctypes; /* Points to table of type maps */
+ BOOL offset_overflow; /* Set if too many extractions */
+ BOOL notbol; /* NOTBOL flag */
+ BOOL noteol; /* NOTEOL flag */
+ BOOL endonly; /* Dollar not before final \n */
+ BOOL notempty; /* Empty string match not wanted */
+ const uschar *start_subject; /* Start of the subject string */
+ const uschar *end_subject; /* End of the subject string */
+ const uschar *start_match; /* Start of this match attempt */
+ const uschar *end_match_ptr; /* Subject position at end match */
+ int end_offset_top; /* Highwater mark at end of match */
+} match_data;
+
+/* Bit definitions for entries in the pcre_ctypes table. */
+
+#define ctype_space 0x01
+#define ctype_letter 0x02
+#define ctype_digit 0x04
+#define ctype_xdigit 0x08
+#define ctype_word 0x10 /* alphameric or '_' */
+#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */
+
+/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
+of bits for a class map. */
+
+#define cbit_digit 0 /* for \d */
+#define cbit_word 32 /* for \w */
+#define cbit_space 64 /* for \s */
+#define cbit_length 96 /* Length of the cbits table */
+
+/* Offsets of the various tables from the base tables pointer, and
+total length. */
+
+#define lcc_offset 0
+#define fcc_offset 256
+#define cbits_offset 512
+#define ctypes_offset (cbits_offset + cbit_length)
+#define tables_length (ctypes_offset + 256)
+
+/* End of internal.h */
diff --git a/setedit/libpcre/licence b/setedit/libpcre/licence
new file mode 100644
index 0000000..246515a
--- /dev/null
+++ b/setedit/libpcre/licence
@@ -0,0 +1,32 @@
+PCRE LICENCE
+------------
+
+PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+University of Cambridge Computing Service,
+Cambridge, England. Phone: +44 1223 334714.
+
+Copyright (c) 1997-1999 University of Cambridge
+
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+
+End
diff --git a/setedit/libpcre/maketables.c b/setedit/libpcre/maketables.c
new file mode 100644
index 0000000..eb5fcd1
--- /dev/null
+++ b/setedit/libpcre/maketables.c
@@ -0,0 +1,113 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/*
+PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+ Copyright (c) 1997-1999 University of Cambridge
+
+-----------------------------------------------------------------------------
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+-----------------------------------------------------------------------------
+
+See the file Tech.Notes for some information on the internals.
+*/
+
+
+/* This file is compiled on its own as part of the PCRE library. However,
+it is also included in the compilation of dftables.c, in which case the macro
+DFTABLES is defined. */
+
+#ifndef DFTABLES
+#include "internal.h"
+#endif
+
+
+
+/*************************************************
+* Create PCRE character tables *
+*************************************************/
+
+/* This function builds a set of character tables for use by PCRE and returns
+a pointer to them. They are build using the ctype functions, and consequently
+their contents will depend upon the current locale setting. When compiled as
+part of the library, the store is obtained via pcre_malloc(), but when compiled
+inside dftables, use malloc().
+
+Arguments: none
+Returns: pointer to the contiguous block of data
+*/
+
+unsigned const char *
+pcre_maketables(void)
+{
+unsigned char *yield, *p;
+int i;
+
+#ifndef DFTABLES
+yield = (unsigned char*)(pcre_malloc)(tables_length);
+#else
+yield = (unsigned char*)malloc(tables_length);
+#endif
+
+if (yield == NULL) return NULL;
+p = yield;
+
+/* First comes the lower casing table */
+
+for (i = 0; i < 256; i++) *p++ = tolower(i);
+
+/* Next the case-flipping table */
+
+for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
+
+/* Then the character class tables */
+
+memset(p, 0, cbit_length);
+for (i = 0; i < 256; i++)
+ {
+ if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7);
+ if (isalnum(i) || i == '_')
+ p[cbit_word + i/8] |= 1 << (i&7);
+ if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
+ }
+p += cbit_length;
+
+/* Finally, the character type table */
+
+for (i = 0; i < 256; i++)
+ {
+ int x = 0;
+ if (isspace(i)) x += ctype_space;
+ if (isalpha(i)) x += ctype_letter;
+ if (isdigit(i)) x += ctype_digit;
+ if (isxdigit(i)) x += ctype_xdigit;
+ if (isalnum(i) || i == '_') x += ctype_word;
+ if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta;
+ *p++ = x;
+ }
+
+return yield;
+}
+
+/* End of maketables.c */
diff --git a/setedit/libpcre/pcre.c b/setedit/libpcre/pcre.c
new file mode 100644
index 0000000..6735b82
--- /dev/null
+++ b/setedit/libpcre/pcre.c
@@ -0,0 +1,4477 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/*
+This is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language. See
+the file Tech.Notes for some information on the internals.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+ Copyright (c) 1997-1999 University of Cambridge
+
+-----------------------------------------------------------------------------
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+-----------------------------------------------------------------------------
+*/
+
+
+/* Define DEBUG to get debugging output on stdout. */
+
+/* #define DEBUG */
+
+/* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef
+inline, and there are *still* stupid compilers about that don't like indented
+pre-processor statements. I suppose it's only been 10 years... */
+
+#ifdef DEBUG
+#define DPRINTF(p) printf p
+#else
+#define DPRINTF(p) /*nothing*/
+#endif
+
+/* Include the internals header, which itself includes Standard C headers plus
+the external pcre header. */
+
+#include "internal.h"
+
+
+/* Allow compilation as C++ source code, should anybody want to do that. */
+
+#ifdef __cplusplus
+#define class pcre_class
+#endif
+
+
+/* Number of items on the nested bracket stacks at compile time. This should
+not be set greater than 200. */
+
+#define BRASTACK_SIZE 200
+
+
+/* Min and max values for the common repeats; for the maxima, 0 => infinity */
+
+static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };
+static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
+
+/* Text forms of OP_ values and things, for debugging (not all used) */
+
+#ifdef DEBUG
+static const char *OP_names[] = {
+ "End", "\\A", "\\B", "\\b", "\\D", "\\d",
+ "\\S", "\\s", "\\W", "\\w", "\\Z", "\\z",
+ "Opt", "^", "$", "Any", "chars", "not",
+ "*", "*?", "+", "+?", "?", "??", "{", "{", "{",
+ "*", "*?", "+", "+?", "?", "??", "{", "{", "{",
+ "*", "*?", "+", "+?", "?", "??", "{", "{", "{",
+ "*", "*?", "+", "+?", "?", "??", "{", "{",
+ "class", "Ref",
+ "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",
+ "AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cref",
+ "Brazero", "Braminzero", "Bra"
+};
+#endif
+
+/* Table for handling escaped characters in the range '0'-'z'. Positive returns
+are simple data values; negative values are for special things like \d and so
+on. Zero means further processing is needed (for things like \x), or the escape
+is invalid. */
+
+static const short int escapes[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */
+ 0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */
+ '@', -ESC_A, -ESC_B, 0, -ESC_D, 0, 0, 0, /* @ - G */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */
+ 0, 0, 0, -ESC_S, 0, 0, 0, -ESC_W, /* P - W */
+ 0, 0, -ESC_Z, '[', '\\', ']', '^', '_', /* X - _ */
+ '`', 7, -ESC_b, 0, -ESC_d, 27, '\f', 0, /* ` - g */
+ 0, 0, 0, 0, 0, 0, '\n', 0, /* h - o */
+ 0, 0, '\r', -ESC_s, '\t', 0, 0, -ESC_w, /* p - w */
+ 0, 0, -ESC_z /* x - z */
+};
+
+/* Definition to allow mutual recursion */
+
+static BOOL
+ compile_regex(int, int, int *, uschar **, const uschar **, const char **,
+ BOOL, int, int *, int *, compile_data *);
+
+
+
+/*************************************************
+* Global variables *
+*************************************************/
+
+/* PCRE is thread-clean and doesn't use any global variables in the normal
+sense. However, it calls memory allocation and free functions via the two
+indirections below, which are can be changed by the caller, but are shared
+between all threads. */
+
+void *(*pcre_malloc)(size_t) = malloc;
+void (*pcre_free)(void *) = free;
+
+
+
+
+/*************************************************
+* Default character tables *
+*************************************************/
+
+/* A default set of character tables is included in the PCRE binary. Its source
+is built by the maketables auxiliary program, which uses the default C ctypes
+functions, and put in the file chartables.c. These tables are used by PCRE
+whenever the caller of pcre_compile() does not provide an alternate set of
+tables. */
+
+#include "chartables.c"
+
+
+
+/*************************************************
+* Return version string *
+*************************************************/
+
+#define STRING(a) # a
+#define XSTRING(s) STRING(s)
+
+const char *
+pcre_version(void)
+{
+return XSTRING(PCRE_MAJOR) "." XSTRING(PCRE_MINOR) " " XSTRING(PCRE_DATE);
+}
+
+
+
+
+/*************************************************
+* Return info about a compiled pattern *
+*************************************************/
+
+/* This function picks potentially useful data out of the private
+structure. The public options are passed back in an int - though the
+re->options field has been expanded to a long int, all the public options
+at the low end of it, and so even on 16-bit systems this will still be OK.
+Therefore, I haven't changed the API for pcre_info().
+
+Arguments:
+ external_re points to compiled code
+ optptr where to pass back the options
+ first_char where to pass back the first character,
+ or -1 if multiline and all branches start ^,
+ or -2 otherwise
+
+Returns: number of identifying extraction brackets
+ or negative values on error
+*/
+
+int
+pcre_info(const pcre *external_re, int *optptr, int *first_char)
+{
+const real_pcre *re = (const real_pcre *)external_re;
+if (re == NULL) return PCRE_ERROR_NULL;
+if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC;
+if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_OPTIONS);
+if (first_char != NULL)
+ *first_char = ((re->options & PCRE_FIRSTSET) != 0)? re->first_char :
+ ((re->options & PCRE_STARTLINE) != 0)? -1 : -2;
+return re->top_bracket;
+}
+
+
+
+
+#ifdef DEBUG
+/*************************************************
+* Debugging function to print chars *
+*************************************************/
+
+/* Print a sequence of chars in printable format, stopping at the end of the
+subject if the requested.
+
+Arguments:
+ p points to characters
+ length number to print
+ is_subject TRUE if printing from within md->start_subject
+ md pointer to matching data block, if is_subject is TRUE
+
+Returns: nothing
+*/
+
+static void
+pchars(const uschar *p, int length, BOOL is_subject, match_data *md)
+{
+int c;
+if (is_subject && length > md->end_subject - p) length = md->end_subject - p;
+while (length-- > 0)
+ if (isprint(c = *(p++))) printf("%c", c); else printf("\\x%02x", c);
+}
+#endif
+
+
+
+
+/*************************************************
+* Handle escapes *
+*************************************************/
+
+/* This function is called when a \ has been encountered. It either returns a
+positive value for a simple escape such as \n, or a negative value which
+encodes one of the more complicated things such as \d. On entry, ptr is
+pointing at the \. On exit, it is on the final character of the escape
+sequence.
+
+Arguments:
+ ptrptr points to the pattern position pointer
+ errorptr points to the pointer to the error message
+ bracount number of previous extracting brackets
+ options the options bits
+ isclass TRUE if inside a character class
+ cd pointer to char tables block
+
+Returns: zero or positive => a data character
+ negative => a special escape sequence
+ on error, errorptr is set
+*/
+
+static int
+check_escape(const uschar **ptrptr, const char **errorptr, int bracount,
+ int options, BOOL isclass, compile_data *cd)
+{
+const uschar *ptr = *ptrptr;
+int c = *(++ptr) & 255; /* Ensure > 0 on signed-char systems */
+int i;
+
+if (c == 0) *errorptr = ERR1;
+
+/* Digits or letters may have special meaning; all others are literals. */
+
+else if (c < '0' || c > 'z') {}
+
+/* Do an initial lookup in a table. A non-zero result is something that can be
+returned immediately. Otherwise further processing may be required. */
+
+else if ((i = escapes[c - '0']) != 0) c = i;
+
+/* Escapes that need further processing, or are illegal. */
+
+else
+ {
+ const uschar *oldptr;
+ switch (c)
+ {
+ /* The handling of escape sequences consisting of a string of digits
+ starting with one that is not zero is not straightforward. By experiment,
+ the way Perl works seems to be as follows:
+
+ Outside a character class, the digits are read as a decimal number. If the
+ number is less than 10, or if there are that many previous extracting
+ left brackets, then it is a back reference. Otherwise, up to three octal
+ digits are read to form an escaped byte. Thus \123 is likely to be octal
+ 123 (cf \0123, which is octal 012 followed by the literal 3). If the octal
+ value is greater than 377, the least significant 8 bits are taken. Inside a
+ character class, \ followed by a digit is always an octal number. */
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+
+ if (!isclass)
+ {
+ oldptr = ptr;
+ c -= '0';
+ while ((cd->ctypes[ptr[1]] & ctype_digit) != 0)
+ c = c * 10 + *(++ptr) - '0';
+ if (c < 10 || c <= bracount)
+ {
+ c = -(ESC_REF + c);
+ break;
+ }
+ ptr = oldptr; /* Put the pointer back and fall through */
+ }
+
+ /* Handle an octal number following \. If the first digit is 8 or 9, Perl
+ generates a binary zero byte and treats the digit as a following literal.
+ Thus we have to pull back the pointer by one. */
+
+ if ((c = *ptr) >= '8')
+ {
+ ptr--;
+ c = 0;
+ break;
+ }
+
+ /* \0 always starts an octal number, but we may drop through to here with a
+ larger first octal digit */
+
+ case '0':
+ c -= '0';
+ while(i++ < 2 && (cd->ctypes[ptr[1]] & ctype_digit) != 0 &&
+ ptr[1] != '8' && ptr[1] != '9')
+ c = c * 8 + *(++ptr) - '0';
+ break;
+
+ /* Special escapes not starting with a digit are straightforward */
+
+ case 'x':
+ c = 0;
+ while (i++ < 2 && (cd->ctypes[ptr[1]] & ctype_xdigit) != 0)
+ {
+ ptr++;
+ c = c * 16 + cd->lcc[*ptr] -
+ (((cd->ctypes[*ptr] & ctype_digit) != 0)? '0' : 'W');
+ }
+ break;
+
+ case 'c':
+ c = *(++ptr);
+ if (c == 0)
+ {
+ *errorptr = ERR2;
+ return 0;
+ }
+
+ /* A letter is upper-cased; then the 0x40 bit is flipped */
+
+ if (c >= 'a' && c <= 'z') c = cd->fcc[c];
+ c ^= 0x40;
+ break;
+
+ /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any
+ other alphameric following \ is an error if PCRE_EXTRA was set; otherwise,
+ for Perl compatibility, it is a literal. This code looks a bit odd, but
+ there used to be some cases other than the default, and there may be again
+ in future, so I haven't "optimized" it. */
+
+ default:
+ if ((options & PCRE_EXTRA) != 0) switch(c)
+ {
+ default:
+ *errorptr = ERR3;
+ break;
+ }
+ break;
+ }
+ }
+
+*ptrptr = ptr;
+return c;
+}
+
+
+
+/*************************************************
+* Check for counted repeat *
+*************************************************/
+
+/* This function is called when a '{' is encountered in a place where it might
+start a quantifier. It looks ahead to see if it really is a quantifier or not.
+It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd}
+where the ddds are digits.
+
+Arguments:
+ p pointer to the first char after '{'
+ cd pointer to char tables block
+
+Returns: TRUE or FALSE
+*/
+
+static BOOL
+is_counted_repeat(const uschar *p, compile_data *cd)
+{
+if ((cd->ctypes[*p++] & ctype_digit) == 0) return FALSE;
+while ((cd->ctypes[*p] & ctype_digit) != 0) p++;
+if (*p == '}') return TRUE;
+
+if (*p++ != ',') return FALSE;
+if (*p == '}') return TRUE;
+
+if ((cd->ctypes[*p++] & ctype_digit) == 0) return FALSE;
+while ((cd->ctypes[*p] & ctype_digit) != 0) p++;
+return (*p == '}');
+}
+
+
+
+/*************************************************
+* Read repeat counts *
+*************************************************/
+
+/* Read an item of the form {n,m} and return the values. This is called only
+after is_counted_repeat() has confirmed that a repeat-count quantifier exists,
+so the syntax is guaranteed to be correct, but we need to check the values.
+
+Arguments:
+ p pointer to first char after '{'
+ minp pointer to int for min
+ maxp pointer to int for max
+ returned as -1 if no max
+ errorptr points to pointer to error message
+ cd pointer to character tables clock
+
+Returns: pointer to '}' on success;
+ current ptr on error, with errorptr set
+*/
+
+static const uschar *
+read_repeat_counts(const uschar *p, int *minp, int *maxp,
+ const char **errorptr, compile_data *cd)
+{
+int min = 0;
+int max = -1;
+
+while ((cd->ctypes[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0';
+
+if (*p == '}') max = min; else
+ {
+ if (*(++p) != '}')
+ {
+ max = 0;
+ while((cd->ctypes[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0';
+ if (max < min)
+ {
+ *errorptr = ERR4;
+ return p;
+ }
+ }
+ }
+
+/* Do paranoid checks, then fill in the required variables, and pass back the
+pointer to the terminating '}'. */
+
+if (min > 65535 || max > 65535)
+ *errorptr = ERR5;
+else
+ {
+ *minp = min;
+ *maxp = max;
+ }
+return p;
+}
+
+
+
+/*************************************************
+* Find the fixed length of a pattern *
+*************************************************/
+
+/* Scan a pattern and compute the fixed length of subject that will match it,
+if the length is fixed. This is needed for dealing with backward assertions.
+
+Arguments:
+ code points to the start of the pattern (the bracket)
+
+Returns: the fixed length, or -1 if there is no fixed length
+*/
+
+static int
+find_fixedlength(uschar *code)
+{
+int length = -1;
+
+register int branchlength = 0;
+register uschar *cc = code + 3;
+
+/* Scan along the opcodes for this branch. If we get to the end of the
+branch, check the length against that of the other branches. */
+
+for (;;)
+ {
+ int d;
+ register int op = *cc;
+ if (op >= OP_BRA) op = OP_BRA;
+
+ switch (op)
+ {
+ case OP_BRA:
+ case OP_ONCE:
+ case OP_COND:
+ d = find_fixedlength(cc);
+ if (d < 0) return -1;
+ branchlength += d;
+ do cc += (cc[1] << 8) + cc[2]; while (*cc == OP_ALT);
+ cc += 3;
+ break;
+
+ /* Reached end of a branch; if it's a ket it is the end of a nested
+ call. If it's ALT it is an alternation in a nested call. If it is
+ END it's the end of the outer call. All can be handled by the same code. */
+
+ case OP_ALT:
+ case OP_KET:
+ case OP_KETRMAX:
+ case OP_KETRMIN:
+ case OP_END:
+ if (length < 0) length = branchlength;
+ else if (length != branchlength) return -1;
+ if (*cc != OP_ALT) return length;
+ cc += 3;
+ branchlength = 0;
+ break;
+
+ /* Skip over assertive subpatterns */
+
+ case OP_ASSERT:
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ do cc += (cc[1] << 8) + cc[2]; while (*cc == OP_ALT);
+ cc += 3;
+ break;
+
+ /* Skip over things that don't match chars */
+
+ case OP_REVERSE:
+ cc++;
+ /* Fall through */
+
+ case OP_CREF:
+ case OP_OPT:
+ cc++;
+ /* Fall through */
+
+ case OP_SOD:
+ case OP_EOD:
+ case OP_EODN:
+ case OP_CIRC:
+ case OP_DOLL:
+ case OP_NOT_WORD_BOUNDARY:
+ case OP_WORD_BOUNDARY:
+ cc++;
+ break;
+
+ /* Handle char strings */
+
+ case OP_CHARS:
+ branchlength += *(++cc);
+ cc += *cc + 1;
+ break;
+
+ /* Handle exact repetitions */
+
+ case OP_EXACT:
+ case OP_TYPEEXACT:
+ branchlength += (cc[1] << 8) + cc[2];
+ cc += 4;
+ break;
+
+ /* Handle single-char matchers */
+
+ case OP_NOT_DIGIT:
+ case OP_DIGIT:
+ case OP_NOT_WHITESPACE:
+ case OP_WHITESPACE:
+ case OP_NOT_WORDCHAR:
+ case OP_WORDCHAR:
+ case OP_ANY:
+ branchlength++;
+ cc++;
+ break;
+
+
+ /* Check a class for variable quantification */
+
+ case OP_CLASS:
+ cc += (*cc == OP_REF)? 2 : 33;
+
+ switch (*cc)
+ {
+ case OP_CRSTAR:
+ case OP_CRMINSTAR:
+ case OP_CRQUERY:
+ case OP_CRMINQUERY:
+ return -1;
+
+ case OP_CRRANGE:
+ case OP_CRMINRANGE:
+ if ((cc[1] << 8) + cc[2] != (cc[3] << 8) + cc[4]) return -1;
+ branchlength += (cc[1] << 8) + cc[2];
+ cc += 5;
+ break;
+
+ default:
+ branchlength++;
+ }
+ break;
+
+ /* Anything else is variable length */
+
+ default:
+ return -1;
+ }
+ }
+/* Control never gets here */
+}
+
+
+
+
+/*************************************************
+* Compile one branch *
+*************************************************/
+
+/* Scan the pattern, compiling it into the code vector.
+
+Arguments:
+ options the option bits
+ brackets points to number of brackets used
+ code points to the pointer to the current code point
+ ptrptr points to the current pattern pointer
+ errorptr points to pointer to error message
+ optchanged set to the value of the last OP_OPT item compiled
+ reqchar set to the last literal character required, else -1
+ countlits set to count of mandatory literal characters
+ cd contains pointers to tables
+
+Returns: TRUE on success
+ FALSE, with *errorptr set on error
+*/
+
+static BOOL
+compile_branch(int options, int *brackets, uschar **codeptr,
+ const uschar **ptrptr, const char **errorptr, int *optchanged,
+ int *reqchar, int *countlits, compile_data *cd)
+{
+int repeat_type, op_type;
+int repeat_min, repeat_max;
+int bravalue, length;
+int greedy_default, greedy_non_default;
+int prevreqchar;
+int condcount = 0;
+int subcountlits = 0;
+register int c;
+register uschar *code = *codeptr;
+uschar *tempcode;
+const uschar *ptr = *ptrptr;
+const uschar *tempptr;
+uschar *previous = NULL;
+uschar class[32];
+
+/* Set up the default and non-default settings for greediness */
+
+greedy_default = ((options & PCRE_UNGREEDY) != 0);
+greedy_non_default = greedy_default ^ 1;
+
+/* Initialize no required char, and count of literals */
+
+*reqchar = prevreqchar = -1;
+*countlits = 0;
+
+/* Switch on next character until the end of the branch */
+
+for (;; ptr++)
+ {
+ BOOL negate_class;
+ int class_charcount;
+ int class_lastchar;
+ int newoptions;
+ int condref;
+ int subreqchar;
+
+ c = *ptr;
+ if ((options & PCRE_EXTENDED) != 0)
+ {
+ if ((cd->ctypes[c] & ctype_space) != 0) continue;
+ if (c == '#')
+ {
+ while ((c = *(++ptr)) != 0 && c != '\n');
+ continue;
+ }
+ }
+
+ switch(c)
+ {
+ /* The branch terminates at end of string, |, or ). */
+
+ case 0:
+ case '|':
+ case ')':
+ *codeptr = code;
+ *ptrptr = ptr;
+ return TRUE;
+
+ /* Handle single-character metacharacters */
+
+ case '^':
+ previous = NULL;
+ *code++ = OP_CIRC;
+ break;
+
+ case '$':
+ previous = NULL;
+ *code++ = OP_DOLL;
+ break;
+
+ case '.':
+ previous = code;
+ *code++ = OP_ANY;
+ break;
+
+ /* Character classes. These always build a 32-byte bitmap of the permitted
+ characters, except in the special case where there is only one character.
+ For negated classes, we build the map as usual, then invert it at the end.
+ */
+
+ case '[':
+ previous = code;
+ *code++ = OP_CLASS;
+
+ /* If the first character is '^', set the negation flag and skip it. */
+
+ if ((c = *(++ptr)) == '^')
+ {
+ negate_class = TRUE;
+ c = *(++ptr);
+ }
+ else negate_class = FALSE;
+
+ /* Keep a count of chars so that we can optimize the case of just a single
+ character. */
+
+ class_charcount = 0;
+ class_lastchar = -1;
+
+ /* Initialize the 32-char bit map to all zeros. We have to build the
+ map in a temporary bit of store, in case the class contains only 1
+ character, because in that case the compiled code doesn't use the
+ bit map. */
+
+ memset(class, 0, 32 * sizeof(uschar));
+
+ /* Process characters until ] is reached. By writing this as a "do" it
+ means that an initial ] is taken as a data character. */
+
+ do
+ {
+ if (c == 0)
+ {
+ *errorptr = ERR6;
+ goto FAILED;
+ }
+
+ /* Backslash may introduce a single character, or it may introduce one
+ of the specials, which just set a flag. Escaped items are checked for
+ validity in the pre-compiling pass. The sequence \b is a special case.
+ Inside a class (and only there) it is treated as backspace. Elsewhere
+ it marks a word boundary. Other escapes have preset maps ready to
+ or into the one we are building. We assume they have more than one
+ character in them, so set class_count bigger than one. */
+
+ if (c == '\\')
+ {
+ c = check_escape(&ptr, errorptr, *brackets, options, TRUE, cd);
+ if (-c == ESC_b) c = '\b';
+ else if (c < 0)
+ {
+ register const uschar *cbits = cd->cbits;
+ class_charcount = 10;
+ switch (-c)
+ {
+ case ESC_d:
+ for (c = 0; c < 32; c++) class[c] |= cbits[c+cbit_digit];
+ continue;
+
+ case ESC_D:
+ for (c = 0; c < 32; c++) class[c] |= ~cbits[c+cbit_digit];
+ continue;
+
+ case ESC_w:
+ for (c = 0; c < 32; c++)
+ class[c] |= (cbits[c+cbit_digit] | cbits[c+cbit_word]);
+ continue;
+
+ case ESC_W:
+ for (c = 0; c < 32; c++)
+ class[c] |= ~(cbits[c+cbit_digit] | cbits[c+cbit_word]);
+ continue;
+
+ case ESC_s:
+ for (c = 0; c < 32; c++) class[c] |= cbits[c+cbit_space];
+ continue;
+
+ case ESC_S:
+ for (c = 0; c < 32; c++) class[c] |= ~cbits[c+cbit_space];
+ continue;
+
+ default:
+ *errorptr = ERR7;
+ goto FAILED;
+ }
+ }
+ /* Fall through if single character */
+ }
+
+ /* A single character may be followed by '-' to form a range. However,
+ Perl does not permit ']' to be the end of the range. A '-' character
+ here is treated as a literal. */
+
+ if (ptr[1] == '-' && ptr[2] != ']')
+ {
+ int d;
+ ptr += 2;
+ d = *ptr;
+
+ if (d == 0)
+ {
+ *errorptr = ERR6;
+ goto FAILED;
+ }
+
+ /* The second part of a range can be a single-character escape, but
+ not any of the other escapes. */
+
+ if (d == '\\')
+ {
+ d = check_escape(&ptr, errorptr, *brackets, options, TRUE, cd);
+ if (d < 0)
+ {
+ if (d == -ESC_b) d = '\b'; else
+ {
+ *errorptr = ERR7;
+ goto FAILED;
+ }
+ }
+ }
+
+ if (d < c)
+ {
+ *errorptr = ERR8;
+ goto FAILED;
+ }
+
+ for (; c <= d; c++)
+ {
+ class[c/8] |= (1 << (c&7));
+ if ((options & PCRE_CASELESS) != 0)
+ {
+ int uc = cd->fcc[c]; /* flip case */
+ class[uc/8] |= (1 << (uc&7));
+ }
+ class_charcount++; /* in case a one-char range */
+ class_lastchar = c;
+ }
+ continue; /* Go get the next char in the class */
+ }
+
+ /* Handle a lone single character - we can get here for a normal
+ non-escape char, or after \ that introduces a single character. */
+
+ class [c/8] |= (1 << (c&7));
+ if ((options & PCRE_CASELESS) != 0)
+ {
+ c = cd->fcc[c]; /* flip case */
+ class[c/8] |= (1 << (c&7));
+ }
+ class_charcount++;
+ class_lastchar = c;
+ }
+
+ /* Loop until ']' reached; the check for end of string happens inside the
+ loop. This "while" is the end of the "do" above. */
+
+ while ((c = *(++ptr)) != ']');
+
+ /* If class_charcount is 1 and class_lastchar is not negative, we saw
+ precisely one character. This doesn't need the whole 32-byte bit map.
+ We turn it into a 1-character OP_CHAR if it's positive, or OP_NOT if
+ it's negative. */
+
+ if (class_charcount == 1 && class_lastchar >= 0)
+ {
+ if (negate_class)
+ {
+ code[-1] = OP_NOT;
+ }
+ else
+ {
+ code[-1] = OP_CHARS;
+ *code++ = 1;
+ }
+ *code++ = class_lastchar;
+ }
+
+ /* Otherwise, negate the 32-byte map if necessary, and copy it into
+ the code vector. */
+
+ else
+ {
+ if (negate_class)
+ for (c = 0; c < 32; c++) code[c] = ~class[c];
+ else
+ memcpy(code, class, 32);
+ code += 32;
+ }
+ break;
+
+ /* Various kinds of repeat */
+
+ case '{':
+ if (!is_counted_repeat(ptr+1, cd)) goto NORMAL_CHAR;
+ ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorptr, cd);
+ if (*errorptr != NULL) goto FAILED;
+ goto REPEAT;
+
+ case '*':
+ repeat_min = 0;
+ repeat_max = -1;
+ goto REPEAT;
+
+ case '+':
+ repeat_min = 1;
+ repeat_max = -1;
+ goto REPEAT;
+
+ case '?':
+ repeat_min = 0;
+ repeat_max = 1;
+
+ REPEAT:
+ if (previous == NULL)
+ {
+ *errorptr = ERR9;
+ goto FAILED;
+ }
+
+ /* If the next character is '?' this is a minimizing repeat, by default,
+ but if PCRE_UNGREEDY is set, it works the other way round. Advance to the
+ next character. */
+
+ if (ptr[1] == '?')
+ { repeat_type = greedy_non_default; ptr++; }
+ else repeat_type = greedy_default;
+
+ /* If previous was a string of characters, chop off the last one and use it
+ as the subject of the repeat. If there was only one character, we can
+ abolish the previous item altogether. A repeat with a zero minimum wipes
+ out any reqchar setting, backing up to the previous value. We must also
+ adjust the countlits value. */
+
+ if (*previous == OP_CHARS)
+ {
+ int len = previous[1];
+
+ if (repeat_min == 0) *reqchar = prevreqchar;
+ *countlits += repeat_min - 1;
+
+ if (len == 1)
+ {
+ c = previous[2];
+ code = previous;
+ }
+ else
+ {
+ c = previous[len+1];
+ previous[1]--;
+ code--;
+ }
+ op_type = 0; /* Use single-char op codes */
+ goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */
+ }
+
+ /* If previous was a single negated character ([^a] or similar), we use
+ one of the special opcodes, replacing it. The code is shared with single-
+ character repeats by adding a suitable offset into repeat_type. */
+
+ else if ((int)*previous == OP_NOT)
+ {
+ op_type = OP_NOTSTAR - OP_STAR; /* Use "not" opcodes */
+ c = previous[1];
+ code = previous;
+ goto OUTPUT_SINGLE_REPEAT;
+ }
+
+ /* If previous was a character type match (\d or similar), abolish it and
+ create a suitable repeat item. The code is shared with single-character
+ repeats by adding a suitable offset into repeat_type. */
+
+ else if ((int)*previous < OP_EODN || *previous == OP_ANY)
+ {
+ op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */
+ c = *previous;
+ code = previous;
+
+ OUTPUT_SINGLE_REPEAT:
+
+ /* If the maximum is zero then the minimum must also be zero; Perl allows
+ this case, so we do too - by simply omitting the item altogether. */
+
+ if (repeat_max == 0) goto END_REPEAT;
+
+ /* Combine the op_type with the repeat_type */
+
+ repeat_type += op_type;
+
+ /* A minimum of zero is handled either as the special case * or ?, or as
+ an UPTO, with the maximum given. */
+
+ if (repeat_min == 0)
+ {
+ if (repeat_max == -1) *code++ = OP_STAR + repeat_type;
+ else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;
+ else
+ {
+ *code++ = OP_UPTO + repeat_type;
+ *code++ = repeat_max >> 8;
+ *code++ = (repeat_max & 255);
+ }
+ }
+
+ /* The case {1,} is handled as the special case + */
+
+ else if (repeat_min == 1 && repeat_max == -1)
+ *code++ = OP_PLUS + repeat_type;
+
+ /* The case {n,n} is just an EXACT, while the general case {n,m} is
+ handled as an EXACT followed by an UPTO. An EXACT of 1 is optimized. */
+
+ else
+ {
+ if (repeat_min != 1)
+ {
+ *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */
+ *code++ = repeat_min >> 8;
+ *code++ = (repeat_min & 255);
+ }
+
+ /* If the mininum is 1 and the previous item was a character string,
+ we either have to put back the item that got cancelled if the string
+ length was 1, or add the character back onto the end of a longer
+ string. For a character type nothing need be done; it will just get
+ put back naturally. Note that the final character is always going to
+ get added below. */
+
+ else if (*previous == OP_CHARS)
+ {
+ if (code == previous) code += 2; else previous[1]++;
+ }
+
+ /* For a single negated character we also have to put back the
+ item that got cancelled. */
+
+ else if (*previous == OP_NOT) code++;
+
+ /* If the maximum is unlimited, insert an OP_STAR. */
+
+ if (repeat_max < 0)
+ {
+ *code++ = c;
+ *code++ = OP_STAR + repeat_type;
+ }
+
+ /* Else insert an UPTO if the max is greater than the min. */
+
+ else if (repeat_max != repeat_min)
+ {
+ *code++ = c;
+ repeat_max -= repeat_min;
+ *code++ = OP_UPTO + repeat_type;
+ *code++ = repeat_max >> 8;
+ *code++ = (repeat_max & 255);
+ }
+ }
+
+ /* The character or character type itself comes last in all cases. */
+
+ *code++ = c;
+ }
+
+ /* If previous was a character class or a back reference, we put the repeat
+ stuff after it, but just skip the item if the repeat was {0,0}. */
+
+ else if (*previous == OP_CLASS || *previous == OP_REF)
+ {
+ if (repeat_max == 0)
+ {
+ code = previous;
+ goto END_REPEAT;
+ }
+ if (repeat_min == 0 && repeat_max == -1)
+ *code++ = OP_CRSTAR + repeat_type;
+ else if (repeat_min == 1 && repeat_max == -1)
+ *code++ = OP_CRPLUS + repeat_type;
+ else if (repeat_min == 0 && repeat_max == 1)
+ *code++ = OP_CRQUERY + repeat_type;
+ else
+ {
+ *code++ = OP_CRRANGE + repeat_type;
+ *code++ = repeat_min >> 8;
+ *code++ = repeat_min & 255;
+ if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */
+ *code++ = repeat_max >> 8;
+ *code++ = repeat_max & 255;
+ }
+ }
+
+ /* If previous was a bracket group, we may have to replicate it in certain
+ cases. */
+
+ else if ((int)*previous >= OP_BRA || (int)*previous == OP_ONCE ||
+ (int)*previous == OP_COND)
+ {
+ register int i;
+ int ketoffset = 0;
+ int len = code - previous;
+ uschar *bralink = NULL;
+
+ /* If the maximum repeat count is unlimited, find the end of the bracket
+ by scanning through from the start, and compute the offset back to it
+ from the current code pointer. There may be an OP_OPT setting following
+ the final KET, so we can't find the end just by going back from the code
+ pointer. */
+
+ if (repeat_max == -1)
+ {
+ register uschar *ket = previous;
+ do ket += (ket[1] << 8) + ket[2]; while (*ket != OP_KET);
+ ketoffset = code - ket;
+ }
+
+ /* The case of a zero minimum is special because of the need to stick
+ OP_BRAZERO in front of it, and because the group appears once in the
+ data, whereas in other cases it appears the minimum number of times. For
+ this reason, it is simplest to treat this case separately, as otherwise
+ the code gets far too mess. There are several special subcases when the
+ minimum is zero. */
+
+ if (repeat_min == 0)
+ {
+ /* If we set up a required char from the bracket, we must back off
+ to the previous value and reset the countlits value too. */
+
+ if (subcountlits > 0)
+ {
+ *reqchar = prevreqchar;
+ *countlits -= subcountlits;
+ }
+
+ /* If the maximum is also zero, we just omit the group from the output
+ altogether. */
+
+ if (repeat_max == 0)
+ {
+ code = previous;
+ goto END_REPEAT;
+ }
+
+ /* If the maximum is 1 or unlimited, we just have to stick in the
+ BRAZERO and do no more at this point. */
+
+ if (repeat_max <= 1)
+ {
+ memmove(previous+1, previous, len);
+ code++;
+ *previous++ = OP_BRAZERO + repeat_type;
+ }
+
+ /* If the maximum is greater than 1 and limited, we have to replicate
+ in a nested fashion, sticking OP_BRAZERO before each set of brackets.
+ The first one has to be handled carefully because it's the original
+ copy, which has to be moved up. The remainder can be handled by code
+ that is common with the non-zero minimum case below. We just have to
+ adjust the value or repeat_max, since one less copy is required. */
+
+ else
+ {
+ int offset;
+ memmove(previous+4, previous, len);
+ code += 4;
+ *previous++ = OP_BRAZERO + repeat_type;
+ *previous++ = OP_BRA;
+
+ /* We chain together the bracket offset fields that have to be
+ filled in later when the ends of the brackets are reached. */
+
+ offset = (bralink == NULL)? 0 : previous - bralink;
+ bralink = previous;
+ *previous++ = offset >> 8;
+ *previous++ = offset & 255;
+ }
+
+ repeat_max--;
+ }
+
+ /* If the minimum is greater than zero, replicate the group as many
+ times as necessary, and adjust the maximum to the number of subsequent
+ copies that we need. */
+
+ else
+ {
+ for (i = 1; i < repeat_min; i++)
+ {
+ memcpy(code, previous, len);
+ code += len;
+ }
+ if (repeat_max > 0) repeat_max -= repeat_min;
+ }
+
+ /* This code is common to both the zero and non-zero minimum cases. If
+ the maximum is limited, it replicates the group in a nested fashion,
+ remembering the bracket starts on a stack. In the case of a zero minimum,
+ the first one was set up above. In all cases the repeat_max now specifies
+ the number of additional copies needed. */
+
+ if (repeat_max >= 0)
+ {
+ for (i = repeat_max - 1; i >= 0; i--)
+ {
+ *code++ = OP_BRAZERO + repeat_type;
+
+ /* All but the final copy start a new nesting, maintaining the
+ chain of brackets outstanding. */
+
+ if (i != 0)
+ {
+ int offset;
+ *code++ = OP_BRA;
+ offset = (bralink == NULL)? 0 : code - bralink;
+ bralink = code;
+ *code++ = offset >> 8;
+ *code++ = offset & 255;
+ }
+
+ memcpy(code, previous, len);
+ code += len;
+ }
+
+ /* Now chain through the pending brackets, and fill in their length
+ fields (which are holding the chain links pro tem). */
+
+ while (bralink != NULL)
+ {
+ int oldlinkoffset;
+ int offset = code - bralink + 1;
+ uschar *bra = code - offset;
+ oldlinkoffset = (bra[1] << 8) + bra[2];
+ bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;
+ *code++ = OP_KET;
+ *code++ = bra[1] = offset >> 8;
+ *code++ = bra[2] = (offset & 255);
+ }
+ }
+
+ /* If the maximum is unlimited, set a repeater in the final copy. We
+ can't just offset backwards from the current code point, because we
+ don't know if there's been an options resetting after the ket. The
+ correct offset was computed above. */
+
+ else code[-ketoffset] = OP_KETRMAX + repeat_type;
+ }
+
+ /* Else there's some kind of shambles */
+
+ else
+ {
+ *errorptr = ERR11;
+ goto FAILED;
+ }
+
+ /* In all case we no longer have a previous item. */
+
+ END_REPEAT:
+ previous = NULL;
+ break;
+
+
+ /* Start of nested bracket sub-expression, or comment or lookahead or
+ lookbehind or option setting or condition. First deal with special things
+ that can come after a bracket; all are introduced by ?, and the appearance
+ of any of them means that this is not a referencing group. They were
+ checked for validity in the first pass over the string, so we don't have to
+ check for syntax errors here. */
+
+ case '(':
+ newoptions = options;
+ condref = -1;
+
+ if (*(++ptr) == '?')
+ {
+ int set, unset;
+ int *optset;
+
+ switch (*(++ptr))
+ {
+ case '#': /* Comment; skip to ket */
+ ptr++;
+ while (*ptr != ')') ptr++;
+ continue;
+
+ case ':': /* Non-extracting bracket */
+ bravalue = OP_BRA;
+ ptr++;
+ break;
+
+ case '(':
+ bravalue = OP_COND; /* Conditional group */
+ if ((cd->ctypes[*(++ptr)] & ctype_digit) != 0)
+ {
+ condref = *ptr - '0';
+ while (*(++ptr) != ')') condref = condref*10 + *ptr - '0';
+ ptr++;
+ }
+ else ptr--;
+ break;
+
+ case '=': /* Positive lookahead */
+ bravalue = OP_ASSERT;
+ ptr++;
+ break;
+
+ case '!': /* Negative lookahead */
+ bravalue = OP_ASSERT_NOT;
+ ptr++;
+ break;
+
+ case '<': /* Lookbehinds */
+ switch (*(++ptr))
+ {
+ case '=': /* Positive lookbehind */
+ bravalue = OP_ASSERTBACK;
+ ptr++;
+ break;
+
+ case '!': /* Negative lookbehind */
+ bravalue = OP_ASSERTBACK_NOT;
+ ptr++;
+ break;
+
+ default: /* Syntax error */
+ *errorptr = ERR24;
+ goto FAILED;
+ }
+ break;
+
+ case '>': /* One-time brackets */
+ bravalue = OP_ONCE;
+ ptr++;
+ break;
+
+ default: /* Option setting */
+ set = unset = 0;
+ optset = &set;
+
+ while (*ptr != ')' && *ptr != ':')
+ {
+ switch (*ptr++)
+ {
+ case '-': optset = &unset; break;
+
+ case 'i': *optset |= PCRE_CASELESS; break;
+ case 'm': *optset |= PCRE_MULTILINE; break;
+ case 's': *optset |= PCRE_DOTALL; break;
+ case 'x': *optset |= PCRE_EXTENDED; break;
+ case 'U': *optset |= PCRE_UNGREEDY; break;
+ case 'X': *optset |= PCRE_EXTRA; break;
+
+ default:
+ *errorptr = ERR12;
+ goto FAILED;
+ }
+ }
+
+ /* Set up the changed option bits, but don't change anything yet. */
+
+ newoptions = (options | set) & (~unset);
+
+ /* If the options ended with ')' this is not the start of a nested
+ group with option changes, so the options change at this level. At top
+ level there is nothing else to be done (the options will in fact have
+ been set from the start of compiling as a result of the first pass) but
+ at an inner level we must compile code to change the ims options if
+ necessary, and pass the new setting back so that it can be put at the
+ start of any following branches, and when this group ends, a resetting
+ item can be compiled. */
+
+ if (*ptr == ')')
+ {
+ if ((options & PCRE_INGROUP) != 0 &&
+ (options & PCRE_IMS) != (newoptions & PCRE_IMS))
+ {
+ *code++ = OP_OPT;
+ *code++ = *optchanged = newoptions & PCRE_IMS;
+ }
+ options = newoptions; /* Change options at this level */
+ previous = NULL; /* This item can't be repeated */
+ continue; /* It is complete */
+ }
+
+ /* If the options ended with ':' we are heading into a nested group
+ with possible change of options. Such groups are non-capturing and are
+ not assertions of any kind. All we need to do is skip over the ':';
+ the newoptions value is handled below. */
+
+ bravalue = OP_BRA;
+ ptr++;
+ }
+ }
+
+ /* Else we have a referencing group; adjust the opcode. */
+
+ else
+ {
+ if (++(*brackets) > EXTRACT_MAX)
+ {
+ *errorptr = ERR13;
+ goto FAILED;
+ }
+ bravalue = OP_BRA + *brackets;
+ }
+
+ /* Process nested bracketed re. Assertions may not be repeated, but other
+ kinds can be. We copy code into a non-register variable in order to be able
+ to pass its address because some compilers complain otherwise. Pass in a
+ new setting for the ims options if they have changed. */
+
+ previous = (bravalue >= OP_ONCE)? code : NULL;
+ *code = bravalue;
+ tempcode = code;
+
+ if (!compile_regex(
+ options | PCRE_INGROUP, /* Set for all nested groups */
+ ((options & PCRE_IMS) != (newoptions & PCRE_IMS))?
+ newoptions & PCRE_IMS : -1, /* Pass ims options if changed */
+ brackets, /* Bracket level */
+ &tempcode, /* Where to put code (updated) */
+ &ptr, /* Input pointer (updated) */
+ errorptr, /* Where to put an error message */
+ (bravalue == OP_ASSERTBACK ||
+ bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */
+ condref, /* Condition reference number */
+ &subreqchar, /* For possible last char */
+ &subcountlits, /* For literal count */
+ cd)) /* Tables block */
+ goto FAILED;
+
+ /* At the end of compiling, code is still pointing to the start of the
+ group, while tempcode has been updated to point past the end of the group
+ and any option resetting that may follow it. The pattern pointer (ptr)
+ is on the bracket. */
+
+ /* If this is a conditional bracket, check that there are no more than
+ two branches in the group. */
+
+ if (bravalue == OP_COND)
+ {
+ uschar *tc = code;
+ condcount = 0;
+
+ do {
+ condcount++;
+ tc += (tc[1] << 8) | tc[2];
+ }
+ while (*tc != OP_KET);
+
+ if (condcount > 2)
+ {
+ *errorptr = ERR27;
+ goto FAILED;
+ }
+ }
+
+ /* Handle updating of the required character. If the subpattern didn't
+ set one, leave it as it was. Otherwise, update it for normal brackets of
+ all kinds, forward assertions, and conditions with two branches. Don't
+ update the literal count for forward assertions, however. If the bracket
+ is followed by a quantifier with zero repeat, we have to back off. Hence
+ the definition of prevreqchar and subcountlits outside the main loop so
+ that they can be accessed for the back off. */
+
+ if (subreqchar > 0 &&
+ (bravalue >= OP_BRA || bravalue == OP_ONCE || bravalue == OP_ASSERT ||
+ (bravalue == OP_COND && condcount == 2)))
+ {
+ prevreqchar = *reqchar;
+ *reqchar = subreqchar;
+ if (bravalue != OP_ASSERT) *countlits += subcountlits;
+ }
+
+ /* Now update the main code pointer to the end of the group. */
+
+ code = tempcode;
+
+ /* Error if hit end of pattern */
+
+ if (*ptr != ')')
+ {
+ *errorptr = ERR14;
+ goto FAILED;
+ }
+ break;
+
+ /* Check \ for being a real metacharacter; if not, fall through and handle
+ it as a data character at the start of a string. Escape items are checked
+ for validity in the pre-compiling pass. */
+
+ case '\\':
+ tempptr = ptr;
+ c = check_escape(&ptr, errorptr, *brackets, options, FALSE, cd);
+
+ /* Handle metacharacters introduced by \. For ones like \d, the ESC_ values
+ are arranged to be the negation of the corresponding OP_values. For the
+ back references, the values are ESC_REF plus the reference number. Only
+ back references and those types that consume a character may be repeated.
+ We can test for values between ESC_b and ESC_Z for the latter; this may
+ have to change if any new ones are ever created. */
+
+ if (c < 0)
+ {
+ if (-c >= ESC_REF)
+ {
+ previous = code;
+ *code++ = OP_REF;
+ *code++ = -c - ESC_REF;
+ }
+ else
+ {
+ previous = (-c > ESC_b && -c < ESC_Z)? code : NULL;
+ *code++ = -c;
+ }
+ continue;
+ }
+
+ /* Data character: reset and fall through */
+
+ ptr = tempptr;
+ c = '\\';
+
+ /* Handle a run of data characters until a metacharacter is encountered.
+ The first character is guaranteed not to be whitespace or # when the
+ extended flag is set. */
+
+ NORMAL_CHAR:
+ default:
+ previous = code;
+ *code = OP_CHARS;
+ code += 2;
+ length = 0;
+
+ do
+ {
+ if ((options & PCRE_EXTENDED) != 0)
+ {
+ if ((cd->ctypes[c] & ctype_space) != 0) continue;
+ if (c == '#')
+ {
+ while ((c = *(++ptr)) != 0 && c != '\n');
+ if (c == 0) break;
+ continue;
+ }
+ }
+
+ /* Backslash may introduce a data char or a metacharacter. Escaped items
+ are checked for validity in the pre-compiling pass. Stop the string
+ before a metaitem. */
+
+ if (c == '\\')
+ {
+ tempptr = ptr;
+ c = check_escape(&ptr, errorptr, *brackets, options, FALSE, cd);
+ if (c < 0) { ptr = tempptr; break; }
+ }
+
+ /* Ordinary character or single-char escape */
+
+ *code++ = c;
+ length++;
+ }
+
+ /* This "while" is the end of the "do" above. */
+
+ while (length < 255 && (cd->ctypes[c = *(++ptr)] & ctype_meta) == 0);
+
+ /* Update the last character and the count of literals */
+
+ prevreqchar = (length > 1)? code[-2] : *reqchar;
+ *reqchar = code[-1];
+ *countlits += length;
+
+ /* Compute the length and set it in the data vector, and advance to
+ the next state. */
+
+ previous[1] = length;
+ if (length < 255) ptr--;
+ break;
+ }
+ } /* end of big loop */
+
+/* Control never reaches here by falling through, only by a goto for all the
+error states. Pass back the position in the pattern so that it can be displayed
+to the user for diagnosing the error. */
+
+FAILED:
+*ptrptr = ptr;
+return FALSE;
+}
+
+
+
+
+/*************************************************
+* Compile sequence of alternatives *
+*************************************************/
+
+/* On entry, ptr is pointing past the bracket character, but on return
+it points to the closing bracket, or vertical bar, or end of string.
+The code variable is pointing at the byte into which the BRA operator has been
+stored. If the ims options are changed at the start (for a (?ims: group) or
+during any branch, we need to insert an OP_OPT item at the start of every
+following branch to ensure they get set correctly at run time, and also pass
+the new options into every subsequent branch compile.
+
+Argument:
+ options the option bits
+ optchanged new ims options to set as if (?ims) were at the start, or -1
+ for no change
+ brackets -> int containing the number of extracting brackets used
+ codeptr -> the address of the current code pointer
+ ptrptr -> the address of the current pattern pointer
+ errorptr -> pointer to error message
+ lookbehind TRUE if this is a lookbehind assertion
+ condref > 0 for OPT_CREF setting at start of conditional group
+ reqchar -> place to put the last required character, or a negative number
+ countlits -> place to put the shortest literal count of any branch
+ cd points to the data block with tables pointers
+
+Returns: TRUE on success
+*/
+
+static BOOL
+compile_regex(int options, int optchanged, int *brackets, uschar **codeptr,
+ const uschar **ptrptr, const char **errorptr, BOOL lookbehind, int condref,
+ int *reqchar, int *countlits, compile_data *cd)
+{
+const uschar *ptr = *ptrptr;
+uschar *code = *codeptr;
+uschar *last_branch = code;
+uschar *start_bracket = code;
+uschar *reverse_count = NULL;
+int oldoptions = options & PCRE_IMS;
+int branchreqchar, branchcountlits;
+
+*reqchar = -1;
+*countlits = INT_MAX;
+code += 3;
+
+/* At the start of a reference-based conditional group, insert the reference
+number as an OP_CREF item. */
+
+if (condref > 0)
+ {
+ *code++ = OP_CREF;
+ *code++ = condref;
+ }
+
+/* Loop for each alternative branch */
+
+for (;;)
+ {
+ int length;
+
+ /* Handle change of options */
+
+ if (optchanged >= 0)
+ {
+ *code++ = OP_OPT;
+ *code++ = optchanged;
+ options = (options & ~PCRE_IMS) | optchanged;
+ }
+
+ /* Set up dummy OP_REVERSE if lookbehind assertion */
+
+ if (lookbehind)
+ {
+ *code++ = OP_REVERSE;
+ reverse_count = code;
+ *code++ = 0;
+ *code++ = 0;
+ }
+
+ /* Now compile the branch */
+
+ if (!compile_branch(options, brackets, &code, &ptr, errorptr, &optchanged,
+ &branchreqchar, &branchcountlits, cd))
+ {
+ *ptrptr = ptr;
+ return FALSE;
+ }
+
+ /* Fill in the length of the last branch */
+
+ length = code - last_branch;
+ last_branch[1] = length >> 8;
+ last_branch[2] = length & 255;
+
+ /* Save the last required character if all branches have the same; a current
+ value of -1 means unset, while -2 means "previous branch had no last required
+ char". */
+
+ if (*reqchar != -2)
+ {
+ if (branchreqchar >= 0)
+ {
+ if (*reqchar == -1) *reqchar = branchreqchar;
+ else if (*reqchar != branchreqchar) *reqchar = -2;
+ }
+ else *reqchar = -2;
+ }
+
+ /* Keep the shortest literal count */
+
+ if (branchcountlits < *countlits) *countlits = branchcountlits;
+ DPRINTF(("literal count = %d min=%d\n", branchcountlits, *countlits));
+
+ /* If lookbehind, check that this branch matches a fixed-length string,
+ and put the length into the OP_REVERSE item. Temporarily mark the end of
+ the branch with OP_END. */
+
+ if (lookbehind)
+ {
+ *code = OP_END;
+ length = find_fixedlength(last_branch);
+ DPRINTF(("fixed length = %d\n", length));
+ if (length < 0)
+ {
+ *errorptr = ERR25;
+ *ptrptr = ptr;
+ return FALSE;
+ }
+ reverse_count[0] = (length >> 8);
+ reverse_count[1] = length & 255;
+ }
+
+ /* Reached end of expression, either ')' or end of pattern. Insert a
+ terminating ket and the length of the whole bracketed item, and return,
+ leaving the pointer at the terminating char. If any of the ims options
+ were changed inside the group, compile a resetting op-code following. */
+
+ if (*ptr != '|')
+ {
+ length = code - start_bracket;
+ *code++ = OP_KET;
+ *code++ = length >> 8;
+ *code++ = length & 255;
+ if (optchanged >= 0)
+ {
+ *code++ = OP_OPT;
+ *code++ = oldoptions;
+ }
+ *codeptr = code;
+ *ptrptr = ptr;
+ return TRUE;
+ }
+
+ /* Another branch follows; insert an "or" node and advance the pointer. */
+
+ *code = OP_ALT;
+ last_branch = code;
+ code += 3;
+ ptr++;
+ }
+/* Control never reaches here */
+}
+
+
+
+
+/*************************************************
+* Find first significant op code *
+*************************************************/
+
+/* This is called by several functions that scan a compiled expression looking
+for a fixed first character, or an anchoring op code etc. It skips over things
+that do not influence this. For one application, a change of caseless option is
+important.
+
+Arguments:
+ code pointer to the start of the group
+ options pointer to external options
+ optbit the option bit whose changing is significant, or
+ zero if none are
+ optstop TRUE to return on option change, otherwise change the options
+ value and continue
+
+Returns: pointer to the first significant opcode
+*/
+
+static const uschar*
+first_significant_code(const uschar *code, int *options, int optbit,
+ BOOL optstop)
+{
+for (;;)
+ {
+ switch ((int)*code)
+ {
+ case OP_OPT:
+ if (optbit > 0 && ((int)code[1] & optbit) != (*options & optbit))
+ {
+ if (optstop) return code;
+ *options = (int)code[1];
+ }
+ code += 2;
+ break;
+
+ case OP_CREF:
+ code += 2;
+ break;
+
+ case OP_WORD_BOUNDARY:
+ case OP_NOT_WORD_BOUNDARY:
+ code++;
+ break;
+
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ do code += (code[1] << 8) + code[2]; while (*code == OP_ALT);
+ code += 3;
+ break;
+
+ default:
+ return code;
+ }
+ }
+/* Control never reaches here */
+}
+
+
+
+
+/*************************************************
+* Check for anchored expression *
+*************************************************/
+
+/* Try to find out if this is an anchored regular expression. Consider each
+alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket
+all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then
+it's anchored. However, if this is a multiline pattern, then only OP_SOD
+counts, since OP_CIRC can match in the middle.
+
+A branch is also implicitly anchored if it starts with .* and DOTALL is set,
+because that will try the rest of the pattern at all possible matching points,
+so there is no point trying them again.
+
+Arguments:
+ code points to start of expression (the bracket)
+ options points to the options setting
+
+Returns: TRUE or FALSE
+*/
+
+static BOOL
+is_anchored(register const uschar *code, int *options)
+{
+do {
+ const uschar *scode = first_significant_code(code + 3, options,
+ PCRE_MULTILINE, FALSE);
+ register int op = *scode;
+ if (op >= OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND)
+ { if (!is_anchored(scode, options)) return FALSE; }
+ else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR) &&
+ (*options & PCRE_DOTALL) != 0)
+ { if (scode[1] != OP_ANY) return FALSE; }
+ else if (op != OP_SOD &&
+ ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC))
+ return FALSE;
+ code += (code[1] << 8) + code[2];
+ }
+while (*code == OP_ALT);
+return TRUE;
+}
+
+
+
+/*************************************************
+* Check for starting with ^ or .* *
+*************************************************/
+
+/* This is called to find out if every branch starts with ^ or .* so that
+"first char" processing can be done to speed things up in multiline
+matching and for non-DOTALL patterns that start with .* (which must start at
+the beginning or after \n).
+
+Argument: points to start of expression (the bracket)
+Returns: TRUE or FALSE
+*/
+
+static BOOL
+is_startline(const uschar *code)
+{
+do {
+ const uschar *scode = first_significant_code(code + 3, NULL, 0, FALSE);
+ register int op = *scode;
+ if (op >= OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND)
+ { if (!is_startline(scode)) return FALSE; }
+ else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR)
+ { if (scode[1] != OP_ANY) return FALSE; }
+ else if (op != OP_CIRC) return FALSE;
+ code += (code[1] << 8) + code[2];
+ }
+while (*code == OP_ALT);
+return TRUE;
+}
+
+
+
+/*************************************************
+* Check for fixed first char *
+*************************************************/
+
+/* Try to find out if there is a fixed first character. This is called for
+unanchored expressions, as it speeds up their processing quite considerably.
+Consider each alternative branch. If they all start with the same char, or with
+a bracket all of whose alternatives start with the same char (recurse ad lib),
+then we return that char, otherwise -1.
+
+Arguments:
+ code points to start of expression (the bracket)
+ options pointer to the options (used to check casing changes)
+
+Returns: -1 or the fixed first char
+*/
+
+static int
+find_firstchar(const uschar *code, int *options)
+{
+register int c = -1;
+do {
+ int d;
+ const uschar *scode = first_significant_code(code + 3, options,
+ PCRE_CASELESS, TRUE);
+ register int op = *scode;
+
+ if (op >= OP_BRA) op = OP_BRA;
+
+ switch(op)
+ {
+ default:
+ return -1;
+
+ case OP_BRA:
+ case OP_ASSERT:
+ case OP_ONCE:
+ case OP_COND:
+ if ((d = find_firstchar(scode, options)) < 0) return -1;
+ if (c < 0) c = d; else if (c != d) return -1;
+ break;
+
+ case OP_EXACT: /* Fall through */
+ scode++;
+
+ case OP_CHARS: /* Fall through */
+ scode++;
+
+ case OP_PLUS:
+ case OP_MINPLUS:
+ if (c < 0) c = scode[1]; else if (c != scode[1]) return -1;
+ break;
+ }
+
+ code += (code[1] << 8) + code[2];
+ }
+while (*code == OP_ALT);
+return c;
+}
+
+
+
+
+
+/*************************************************
+* Compile a Regular Expression *
+*************************************************/
+
+/* This function takes a string and returns a pointer to a block of store
+holding a compiled version of the expression.
+
+Arguments:
+ pattern the regular expression
+ options various option bits
+ errorptr pointer to pointer to error text
+ erroroffset ptr offset in pattern where error was detected
+ tables pointer to character tables or NULL
+
+Returns: pointer to compiled data block, or NULL on error,
+ with errorptr and erroroffset set
+*/
+
+pcre *
+pcre_compile(const char *pattern, int options, const char **errorptr,
+ int *erroroffset, const unsigned char *tables)
+{
+real_pcre *re;
+int length = 3; /* For initial BRA plus length */
+int runlength;
+int c, size, reqchar, countlits;
+int bracount = 0;
+int top_backref = 0;
+int branch_extra = 0;
+int branch_newextra;
+unsigned int brastackptr = 0;
+uschar *code;
+const uschar *ptr;
+compile_data compile_block;
+int brastack[BRASTACK_SIZE];
+uschar bralenstack[BRASTACK_SIZE];
+
+#ifdef DEBUG
+uschar *code_base, *code_end;
+#endif
+
+/* We can't pass back an error message if errorptr is NULL; I guess the best we
+can do is just return NULL. */
+
+if (errorptr == NULL) return NULL;
+*errorptr = NULL;
+
+/* However, we can give a message for this error */
+
+if (erroroffset == NULL)
+ {
+ *errorptr = ERR16;
+ return NULL;
+ }
+*erroroffset = 0;
+
+if ((options & ~PUBLIC_OPTIONS) != 0)
+ {
+ *errorptr = ERR17;
+ return NULL;
+ }
+
+/* Set up pointers to the individual character tables */
+
+if (tables == NULL) tables = pcre_default_tables;
+compile_block.lcc = tables + lcc_offset;
+compile_block.fcc = tables + fcc_offset;
+compile_block.cbits = tables + cbits_offset;
+compile_block.ctypes = tables + ctypes_offset;
+
+/* Reflect pattern for debugging output */
+
+DPRINTF(("------------------------------------------------------------------\n"));
+DPRINTF(("%s\n", pattern));
+
+/* The first thing to do is to make a pass over the pattern to compute the
+amount of store required to hold the compiled code. This does not have to be
+perfect as long as errors are overestimates. At the same time we can detect any
+internal flag settings. Make an attempt to correct for any counted white space
+if an "extended" flag setting appears late in the pattern. We can't be so
+clever for #-comments. */
+
+ptr = (const uschar *)(pattern - 1);
+while ((c = *(++ptr)) != 0)
+ {
+ int min, max;
+ int class_charcount;
+
+ if ((options & PCRE_EXTENDED) != 0)
+ {
+ if ((compile_block.ctypes[c] & ctype_space) != 0) continue;
+ if (c == '#')
+ {
+ while ((c = *(++ptr)) != 0 && c != '\n');
+ continue;
+ }
+ }
+
+ switch(c)
+ {
+ /* A backslashed item may be an escaped "normal" character or a
+ character type. For a "normal" character, put the pointers and
+ character back so that tests for whitespace etc. in the input
+ are done correctly. */
+
+ case '\\':
+ {
+ const uschar *save_ptr = ptr;
+ c = check_escape(&ptr, errorptr, bracount, options, FALSE, &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ if (c >= 0)
+ {
+ ptr = save_ptr;
+ c = '\\';
+ goto NORMAL_CHAR;
+ }
+ }
+ length++;
+
+ /* A back reference needs an additional char, plus either one or 5
+ bytes for a repeat. We also need to keep the value of the highest
+ back reference. */
+
+ if (c <= -ESC_REF)
+ {
+ int refnum = -c - ESC_REF;
+ if (refnum > top_backref) top_backref = refnum;
+ length++; /* For single back reference */
+ if (ptr[1] == '{' && is_counted_repeat(ptr+2, &compile_block))
+ {
+ ptr = read_repeat_counts(ptr+2, &min, &max, errorptr, &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ if ((min == 0 && (max == 1 || max == -1)) ||
+ (min == 1 && max == -1))
+ length++;
+ else length += 5;
+ if (ptr[1] == '?') ptr++;
+ }
+ }
+ continue;
+
+ case '^':
+ case '.':
+ case '$':
+ case '*': /* These repeats won't be after brackets; */
+ case '+': /* those are handled separately */
+ case '?':
+ length++;
+ continue;
+
+ /* This covers the cases of repeats after a single char, metachar, class,
+ or back reference. */
+
+ case '{':
+ if (!is_counted_repeat(ptr+1, &compile_block)) goto NORMAL_CHAR;
+ ptr = read_repeat_counts(ptr+1, &min, &max, errorptr, &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ if ((min == 0 && (max == 1 || max == -1)) ||
+ (min == 1 && max == -1))
+ length++;
+ else
+ {
+ length--; /* Uncount the original char or metachar */
+ if (min == 1) length++; else if (min > 0) length += 4;
+ if (max > 0) length += 4; else length += 2;
+ }
+ if (ptr[1] == '?') ptr++;
+ continue;
+
+ /* An alternation contains an offset to the next branch or ket. If any ims
+ options changed in the previous branch(es), and/or if we are in a
+ lookbehind assertion, extra space will be needed at the start of the
+ branch. This is handled by branch_extra. */
+
+ case '|':
+ length += 3 + branch_extra;
+ continue;
+
+ /* A character class uses 33 characters. Don't worry about character types
+ that aren't allowed in classes - they'll get picked up during the compile.
+ A character class that contains only one character uses 2 or 3 bytes,
+ depending on whether it is negated or not. Notice this where we can. */
+
+ case '[':
+ class_charcount = 0;
+ if (*(++ptr) == '^') ptr++;
+ do
+ {
+ if (*ptr == '\\')
+ {
+ int ch = check_escape(&ptr, errorptr, bracount, options, TRUE,
+ &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ if (-ch == ESC_b) class_charcount++; else class_charcount = 10;
+ }
+ else class_charcount++;
+ ptr++;
+ }
+ while (*ptr != 0 && *ptr != ']');
+
+ /* Repeats for negated single chars are handled by the general code */
+
+ if (class_charcount == 1) length += 3; else
+ {
+ length += 33;
+
+ /* A repeat needs either 1 or 5 bytes. */
+
+ if (*ptr != 0 && ptr[1] == '{' && is_counted_repeat(ptr+2, &compile_block))
+ {
+ ptr = read_repeat_counts(ptr+2, &min, &max, errorptr, &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ if ((min == 0 && (max == 1 || max == -1)) ||
+ (min == 1 && max == -1))
+ length++;
+ else length += 5;
+ if (ptr[1] == '?') ptr++;
+ }
+ }
+ continue;
+
+ /* Brackets may be genuine groups or special things */
+
+ case '(':
+ branch_newextra = 0;
+
+ /* Handle special forms of bracket, which all start (? */
+
+ if (ptr[1] == '?')
+ {
+ int set, unset;
+ int *optset;
+
+ switch (c = ptr[2])
+ {
+ /* Skip over comments entirely */
+ case '#':
+ ptr += 3;
+ while (*ptr != 0 && *ptr != ')') ptr++;
+ if (*ptr == 0)
+ {
+ *errorptr = ERR18;
+ goto PCRE_ERROR_RETURN;
+ }
+ continue;
+
+ /* Non-referencing groups and lookaheads just move the pointer on, and
+ then behave like a non-special bracket, except that they don't increment
+ the count of extracting brackets. Ditto for the "once only" bracket,
+ which is in Perl from version 5.005. */
+
+ case ':':
+ case '=':
+ case '!':
+ case '>':
+ ptr += 2;
+ break;
+
+ /* Lookbehinds are in Perl from version 5.005 */
+
+ case '<':
+ if (ptr[3] == '=' || ptr[3] == '!')
+ {
+ ptr += 3;
+ branch_newextra = 3;
+ length += 3; /* For the first branch */
+ break;
+ }
+ *errorptr = ERR24;
+ goto PCRE_ERROR_RETURN;
+
+ /* Conditionals are in Perl from version 5.005. The bracket must either
+ be followed by a number (for bracket reference) or by an assertion
+ group. */
+
+ case '(':
+ if ((compile_block.ctypes[ptr[3]] & ctype_digit) != 0)
+ {
+ ptr += 4;
+ length += 2;
+ while ((compile_block.ctypes[*ptr] & ctype_digit) != 0) ptr++;
+ if (*ptr != ')')
+ {
+ *errorptr = ERR26;
+ goto PCRE_ERROR_RETURN;
+ }
+ }
+ else /* An assertion must follow */
+ {
+ ptr++; /* Can treat like ':' as far as spacing is concerned */
+
+ if (ptr[2] != '?' || strchr("=!<", ptr[3]) == NULL)
+ {
+ ptr += 2; /* To get right offset in message */
+ *errorptr = ERR28;
+ goto PCRE_ERROR_RETURN;
+ }
+ }
+ break;
+
+ /* Else loop checking valid options until ) is met. Anything else is an
+ error. If we are without any brackets, i.e. at top level, the settings
+ act as if specified in the options, so massage the options immediately.
+ This is for backward compatibility with Perl 5.004. */
+
+ default:
+ set = unset = 0;
+ optset = &set;
+ ptr += 2;
+
+ for (;; ptr++)
+ {
+ c = *ptr;
+ switch (c)
+ {
+ case 'i':
+ *optset |= PCRE_CASELESS;
+ continue;
+
+ case 'm':
+ *optset |= PCRE_MULTILINE;
+ continue;
+
+ case 's':
+ *optset |= PCRE_DOTALL;
+ continue;
+
+ case 'x':
+ *optset |= PCRE_EXTENDED;
+ continue;
+
+ case 'X':
+ *optset |= PCRE_EXTRA;
+ continue;
+
+ case 'U':
+ *optset |= PCRE_UNGREEDY;
+ continue;
+
+ case '-':
+ optset = &unset;
+ continue;
+
+ /* A termination by ')' indicates an options-setting-only item;
+ this is global at top level; otherwise nothing is done here and
+ it is handled during the compiling process on a per-bracket-group
+ basis. */
+
+ case ')':
+ if (brastackptr == 0)
+ {
+ options = (options | set) & (~unset);
+ set = unset = 0; /* To save length */
+ }
+ /* Fall through */
+
+ /* A termination by ':' indicates the start of a nested group with
+ the given options set. This is again handled at compile time, but
+ we must allow for compiled space if any of the ims options are
+ set. We also have to allow for resetting space at the end of
+ the group, which is why 4 is added to the length and not just 2.
+ If there are several changes of options within the same group, this
+ will lead to an over-estimate on the length, but this shouldn't
+ matter very much. We also have to allow for resetting options at
+ the start of any alternations, which we do by setting
+ branch_newextra to 2. Finally, we record whether the case-dependent
+ flag ever changes within the regex. This is used by the "required
+ character" code. */
+
+ case ':':
+ if (((set|unset) & PCRE_IMS) != 0)
+ {
+ length += 4;
+ branch_newextra = 2;
+ if (((set|unset) & PCRE_CASELESS) != 0) options |= PCRE_ICHANGED;
+ }
+ goto END_OPTIONS;
+
+ /* Unrecognized option character */
+
+ default:
+ *errorptr = ERR12;
+ goto PCRE_ERROR_RETURN;
+ }
+ }
+
+ /* If we hit a closing bracket, that's it - this is a freestanding
+ option-setting. We need to ensure that branch_extra is updated if
+ necessary. The only values branch_newextra can have here are 0 or 2.
+ If the value is 2, then branch_extra must either be 2 or 5, depending
+ on whether this is a lookbehind group or not. */
+
+ END_OPTIONS:
+ if (c == ')')
+ {
+ if (branch_newextra == 2 && (branch_extra == 0 || branch_extra == 3))
+ branch_extra += branch_newextra;
+ continue;
+ }
+
+ /* If options were terminated by ':' control comes here. Fall through
+ to handle the group below. */
+ }
+ }
+
+ /* Extracting brackets must be counted so we can process escapes in a
+ Perlish way. */
+
+ else bracount++;
+
+ /* Non-special forms of bracket. Save length for computing whole length
+ at end if there's a repeat that requires duplication of the group. Also
+ save the current value of branch_extra, and start the new group with
+ the new value. If non-zero, this will either be 2 for a (?imsx: group, or 3
+ for a lookbehind assertion. */
+
+ if (brastackptr >= sizeof(brastack)/sizeof(int))
+ {
+ *errorptr = ERR19;
+ goto PCRE_ERROR_RETURN;
+ }
+
+ bralenstack[brastackptr] = branch_extra;
+ branch_extra = branch_newextra;
+
+ brastack[brastackptr++] = length;
+ length += 3;
+ continue;
+
+ /* Handle ket. Look for subsequent max/min; for certain sets of values we
+ have to replicate this bracket up to that many times. If brastackptr is
+ 0 this is an unmatched bracket which will generate an error, but take care
+ not to try to access brastack[-1] when computing the length and restoring
+ the branch_extra value. */
+
+ case ')':
+ length += 3;
+ {
+ int minval = 1;
+ int maxval = 1;
+ int duplength;
+
+ if (brastackptr > 0)
+ {
+ duplength = length - brastack[--brastackptr];
+ branch_extra = bralenstack[brastackptr];
+ }
+ else duplength = 0;
+
+ /* Leave ptr at the final char; for read_repeat_counts this happens
+ automatically; for the others we need an increment. */
+
+ if ((c = ptr[1]) == '{' && is_counted_repeat(ptr+2, &compile_block))
+ {
+ ptr = read_repeat_counts(ptr+2, &minval, &maxval, errorptr,
+ &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ }
+ else if (c == '*') { minval = 0; maxval = -1; ptr++; }
+ else if (c == '+') { maxval = -1; ptr++; }
+ else if (c == '?') { minval = 0; ptr++; }
+
+ /* If the minimum is zero, we have to allow for an OP_BRAZERO before the
+ group, and if the maximum is greater than zero, we have to replicate
+ maxval-1 times; each replication acquires an OP_BRAZERO plus a nesting
+ bracket set - hence the 7. */
+
+ if (minval == 0)
+ {
+ length++;
+ if (maxval > 0) length += (maxval - 1) * (duplength + 7);
+ }
+
+ /* When the minimum is greater than zero, 1 we have to replicate up to
+ minval-1 times, with no additions required in the copies. Then, if
+ there is a limited maximum we have to replicate up to maxval-1 times
+ allowing for a BRAZERO item before each optional copy and nesting
+ brackets for all but one of the optional copies. */
+
+ else
+ {
+ length += (minval - 1) * duplength;
+ if (maxval > minval) /* Need this test as maxval=-1 means no limit */
+ length += (maxval - minval) * (duplength + 7) - 6;
+ }
+ }
+ continue;
+
+ /* Non-special character. For a run of such characters the length required
+ is the number of characters + 2, except that the maximum run length is 255.
+ We won't get a skipped space or a non-data escape or the start of a #
+ comment as the first character, so the length can't be zero. */
+
+ NORMAL_CHAR:
+ default:
+ length += 2;
+ runlength = 0;
+ do
+ {
+ if ((options & PCRE_EXTENDED) != 0)
+ {
+ if ((compile_block.ctypes[c] & ctype_space) != 0) continue;
+ if (c == '#')
+ {
+ while ((c = *(++ptr)) != 0 && c != '\n');
+ continue;
+ }
+ }
+
+ /* Backslash may introduce a data char or a metacharacter; stop the
+ string before the latter. */
+
+ if (c == '\\')
+ {
+ const uschar *saveptr = ptr;
+ c = check_escape(&ptr, errorptr, bracount, options, FALSE,
+ &compile_block);
+ if (*errorptr != NULL) goto PCRE_ERROR_RETURN;
+ if (c < 0) { ptr = saveptr; break; }
+ }
+
+ /* Ordinary character or single-char escape */
+
+ runlength++;
+ }
+
+ /* This "while" is the end of the "do" above. */
+
+ while (runlength < 255 &&
+ (compile_block.ctypes[c = *(++ptr)] & ctype_meta) == 0);
+
+ ptr--;
+ length += runlength;
+ continue;
+ }
+ }
+
+length += 4; /* For final KET and END */
+
+if (length > 65539)
+ {
+ *errorptr = ERR20;
+ return NULL;
+ }
+
+/* Compute the size of data block needed and get it, either from malloc or
+externally provided function. We specify "code[0]" in the offsetof() expression
+rather than just "code", because it has been reported that one broken compiler
+fails on "code" because it is also an independent variable. It should make no
+difference to the value of the offsetof(). */
+
+size = length + offsetof(real_pcre, code[0]);
+re = (real_pcre *)(pcre_malloc)(size);
+
+if (re == NULL)
+ {
+ *errorptr = ERR21;
+ return NULL;
+ }
+
+/* Put in the magic number and the options. */
+
+re->magic_number = MAGIC_NUMBER;
+re->options = options;
+re->tables = tables;
+
+/* Set up a starting, non-extracting bracket, then compile the expression. On
+error, *errorptr will be set non-NULL, so we don't need to look at the result
+of the function here. */
+
+ptr = (const uschar *)pattern;
+code = re->code;
+*code = OP_BRA;
+bracount = 0;
+(void)compile_regex(options, -1, &bracount, &code, &ptr, errorptr, FALSE, -1,
+ &reqchar, &countlits, &compile_block);
+re->top_bracket = bracount;
+re->top_backref = top_backref;
+
+/* If not reached end of pattern on success, there's an excess bracket. */
+
+if (*errorptr == NULL && *ptr != 0) *errorptr = ERR22;
+
+/* Fill in the terminating state and check for disastrous overflow, but
+if debugging, leave the test till after things are printed out. */
+
+*code++ = OP_END;
+
+#ifndef DEBUG
+if (code - re->code > length) *errorptr = ERR23;
+#endif
+
+/* Give an error if there's back reference to a non-existent capturing
+subpattern. */
+
+if (top_backref > re->top_bracket) *errorptr = ERR15;
+
+/* Failed to compile */
+
+if (*errorptr != NULL)
+ {
+ (pcre_free)(re);
+ PCRE_ERROR_RETURN:
+ *erroroffset = ptr - (const uschar *)pattern;
+ return NULL;
+ }
+
+/* If the anchored option was not passed, set flag if we can determine that the
+pattern is anchored by virtue of ^ characters or \A or anything else (such as
+starting with .* when DOTALL is set).
+
+Otherwise, see if we can determine what the first character has to be, because
+that speeds up unanchored matches no end. If not, see if we can set the
+PCRE_STARTLINE flag. This is helpful for multiline matches when all branches
+start with ^. and also when all branches start with .* for non-DOTALL matches.
+*/
+
+if ((options & PCRE_ANCHORED) == 0)
+ {
+ int temp_options = options;
+ if (is_anchored(re->code, &temp_options))
+ re->options |= PCRE_ANCHORED;
+ else
+ {
+ int ch = find_firstchar(re->code, &temp_options);
+ if (ch >= 0)
+ {
+ re->first_char = ch;
+ re->options |= PCRE_FIRSTSET;
+ }
+ else if (is_startline(re->code))
+ re->options |= PCRE_STARTLINE;
+ }
+ }
+
+/* Save the last required character if there are at least two literal
+characters on all paths, or if there is no first character setting. */
+
+if (reqchar >= 0 && (countlits > 1 || (re->options & PCRE_FIRSTSET) == 0))
+ {
+ re->req_char = reqchar;
+ re->options |= PCRE_REQCHSET;
+ }
+
+/* Print out the compiled data for debugging */
+
+#ifdef DEBUG
+
+printf("Length = %d top_bracket = %d top_backref = %d\n",
+ length, re->top_bracket, re->top_backref);
+
+if (re->options != 0)
+ {
+ printf("%s%s%s%s%s%s%s%s%s\n",
+ ((re->options & PCRE_ANCHORED) != 0)? "anchored " : "",
+ ((re->options & PCRE_CASELESS) != 0)? "caseless " : "",
+ ((re->options & PCRE_ICHANGED) != 0)? "case state changed " : "",
+ ((re->options & PCRE_EXTENDED) != 0)? "extended " : "",
+ ((re->options & PCRE_MULTILINE) != 0)? "multiline " : "",
+ ((re->options & PCRE_DOTALL) != 0)? "dotall " : "",
+ ((re->options & PCRE_DOLLAR_ENDONLY) != 0)? "endonly " : "",
+ ((re->options & PCRE_EXTRA) != 0)? "extra " : "",
+ ((re->options & PCRE_UNGREEDY) != 0)? "ungreedy " : "");
+ }
+
+if ((re->options & PCRE_FIRSTSET) != 0)
+ {
+ if (isprint(re->first_char)) printf("First char = %c\n", re->first_char);
+ else printf("First char = \\x%02x\n", re->first_char);
+ }
+
+if ((re->options & PCRE_REQCHSET) != 0)
+ {
+ if (isprint(re->req_char)) printf("Req char = %c\n", re->req_char);
+ else printf("Req char = \\x%02x\n", re->req_char);
+ }
+
+code_end = code;
+code_base = code = re->code;
+
+while (code < code_end)
+ {
+ int charlength;
+
+ printf("%3d ", code - code_base);
+
+ if (*code >= OP_BRA)
+ {
+ printf("%3d Bra %d", (code[1] << 8) + code[2], *code - OP_BRA);
+ code += 2;
+ }
+
+ else switch(*code)
+ {
+ case OP_OPT:
+ printf(" %.2x %s", code[1], OP_names[*code]);
+ code++;
+ break;
+
+ case OP_COND:
+ printf("%3d Cond", (code[1] << 8) + code[2]);
+ code += 2;
+ break;
+
+ case OP_CREF:
+ printf(" %.2d %s", code[1], OP_names[*code]);
+ code++;
+ break;
+
+ case OP_CHARS:
+ charlength = *(++code);
+ printf("%3d ", charlength);
+ while (charlength-- > 0)
+ if (isprint(c = *(++code))) printf("%c", c); else printf("\\x%02x", c);
+ break;
+
+ case OP_KETRMAX:
+ case OP_KETRMIN:
+ case OP_ALT:
+ case OP_KET:
+ case OP_ASSERT:
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ case OP_ONCE:
+ printf("%3d %s", (code[1] << 8) + code[2], OP_names[*code]);
+ code += 2;
+ break;
+
+ case OP_REVERSE:
+ printf("%3d %s", (code[1] << 8) + code[2], OP_names[*code]);
+ code += 2;
+ break;
+
+ case OP_STAR:
+ case OP_MINSTAR:
+ case OP_PLUS:
+ case OP_MINPLUS:
+ case OP_QUERY:
+ case OP_MINQUERY:
+ case OP_TYPESTAR:
+ case OP_TYPEMINSTAR:
+ case OP_TYPEPLUS:
+ case OP_TYPEMINPLUS:
+ case OP_TYPEQUERY:
+ case OP_TYPEMINQUERY:
+ if (*code >= OP_TYPESTAR)
+ printf(" %s", OP_names[code[1]]);
+ else if (isprint(c = code[1])) printf(" %c", c);
+ else printf(" \\x%02x", c);
+ printf("%s", OP_names[*code++]);
+ break;
+
+ case OP_EXACT:
+ case OP_UPTO:
+ case OP_MINUPTO:
+ if (isprint(c = code[3])) printf(" %c{", c);
+ else printf(" \\x%02x{", c);
+ if (*code != OP_EXACT) printf("0,");
+ printf("%d}", (code[1] << 8) + code[2]);
+ if (*code == OP_MINUPTO) printf("?");
+ code += 3;
+ break;
+
+ case OP_TYPEEXACT:
+ case OP_TYPEUPTO:
+ case OP_TYPEMINUPTO:
+ printf(" %s{", OP_names[code[3]]);
+ if (*code != OP_TYPEEXACT) printf(",");
+ printf("%d}", (code[1] << 8) + code[2]);
+ if (*code == OP_TYPEMINUPTO) printf("?");
+ code += 3;
+ break;
+
+ case OP_NOT:
+ if (isprint(c = *(++code))) printf(" [^%c]", c);
+ else printf(" [^\\x%02x]", c);
+ break;
+
+ case OP_NOTSTAR:
+ case OP_NOTMINSTAR:
+ case OP_NOTPLUS:
+ case OP_NOTMINPLUS:
+ case OP_NOTQUERY:
+ case OP_NOTMINQUERY:
+ if (isprint(c = code[1])) printf(" [^%c]", c);
+ else printf(" [^\\x%02x]", c);
+ printf("%s", OP_names[*code++]);
+ break;
+
+ case OP_NOTEXACT:
+ case OP_NOTUPTO:
+ case OP_NOTMINUPTO:
+ if (isprint(c = code[3])) printf(" [^%c]{", c);
+ else printf(" [^\\x%02x]{", c);
+ if (*code != OP_NOTEXACT) printf(",");
+ printf("%d}", (code[1] << 8) + code[2]);
+ if (*code == OP_NOTMINUPTO) printf("?");
+ code += 3;
+ break;
+
+ case OP_REF:
+ printf(" \\%d", *(++code));
+ code ++;
+ goto CLASS_REF_REPEAT;
+
+ case OP_CLASS:
+ {
+ int i, min, max;
+ code++;
+ printf(" [");
+
+ for (i = 0; i < 256; i++)
+ {
+ if ((code[i/8] & (1 << (i&7))) != 0)
+ {
+ int j;
+ for (j = i+1; j < 256; j++)
+ if ((code[j/8] & (1 << (j&7))) == 0) break;
+ if (i == '-' || i == ']') printf("\\");
+ if (isprint(i)) printf("%c", i); else printf("\\x%02x", i);
+ if (--j > i)
+ {
+ printf("-");
+ if (j == '-' || j == ']') printf("\\");
+ if (isprint(j)) printf("%c", j); else printf("\\x%02x", j);
+ }
+ i = j;
+ }
+ }
+ printf("]");
+ code += 32;
+
+ CLASS_REF_REPEAT:
+
+ switch(*code)
+ {
+ case OP_CRSTAR:
+ case OP_CRMINSTAR:
+ case OP_CRPLUS:
+ case OP_CRMINPLUS:
+ case OP_CRQUERY:
+ case OP_CRMINQUERY:
+ printf("%s", OP_names[*code]);
+ break;
+
+ case OP_CRRANGE:
+ case OP_CRMINRANGE:
+ min = (code[1] << 8) + code[2];
+ max = (code[3] << 8) + code[4];
+ if (max == 0) printf("{%d,}", min);
+ else printf("{%d,%d}", min, max);
+ if (*code == OP_CRMINRANGE) printf("?");
+ code += 4;
+ break;
+
+ default:
+ code--;
+ }
+ }
+ break;
+
+ /* Anything else is just a one-node item */
+
+ default:
+ printf(" %s", OP_names[*code]);
+ break;
+ }
+
+ code++;
+ printf("\n");
+ }
+printf("------------------------------------------------------------------\n");
+
+/* This check is done here in the debugging case so that the code that
+was compiled can be seen. */
+
+if (code - re->code > length)
+ {
+ *errorptr = ERR23;
+ (pcre_free)(re);
+ *erroroffset = ptr - (uschar *)pattern;
+ return NULL;
+ }
+#endif
+
+return (pcre *)re;
+}
+
+
+
+/*************************************************
+* Match a back-reference *
+*************************************************/
+
+/* If a back reference hasn't been set, the length that is passed is greater
+than the number of characters left in the string, so the match fails.
+
+Arguments:
+ offset index into the offset vector
+ eptr points into the subject
+ length length to be matched
+ md points to match data block
+ ims the ims flags
+
+Returns: TRUE if matched
+*/
+
+static BOOL
+match_ref(int offset, register const uschar *eptr, int length, match_data *md,
+ unsigned long int ims)
+{
+const uschar *p = md->start_subject + md->offset_vector[offset];
+
+#ifdef DEBUG
+if (eptr >= md->end_subject)
+ printf("matching subject <null>");
+else
+ {
+ printf("matching subject ");
+ pchars(eptr, length, TRUE, md);
+ }
+printf(" against backref ");
+pchars(p, length, FALSE, md);
+printf("\n");
+#endif
+
+/* Always fail if not enough characters left */
+
+if (length > md->end_subject - eptr) return FALSE;
+
+/* Separate the caselesss case for speed */
+
+if ((ims & PCRE_CASELESS) != 0)
+ {
+ while (length-- > 0)
+ if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE;
+ }
+else
+ { while (length-- > 0) if (*p++ != *eptr++) return FALSE; }
+
+return TRUE;
+}
+
+
+
+/*************************************************
+* Match from current position *
+*************************************************/
+
+/* On entry ecode points to the first opcode, and eptr to the first character
+in the subject string, while eptrb holds the value of eptr at the start of the
+last bracketed group - used for breaking infinite loops matching zero-length
+strings.
+
+Arguments:
+ eptr pointer in subject
+ ecode position in code
+ offset_top current top pointer
+ md pointer to "static" info for the match
+ ims current /i, /m, and /s options
+ condassert TRUE if called to check a condition assertion
+ eptrb eptr at start of last bracket
+
+Returns: TRUE if matched
+*/
+
+static BOOL
+match(register const uschar *eptr, register const uschar *ecode,
+ int offset_top, match_data *md, unsigned long int ims, BOOL condassert,
+ const uschar *eptrb)
+{
+unsigned long int original_ims = ims; /* Save for resetting on ')' */
+
+for (;;)
+ {
+ int op = (int)*ecode;
+ int min, max, ctype;
+ register int i;
+ register int c;
+ BOOL minimize = FALSE;
+
+ /* Opening capturing bracket. If there is space in the offset vector, save
+ the current subject position in the working slot at the top of the vector. We
+ mustn't change the current values of the data slot, because they may be set
+ from a previous iteration of this group, and be referred to by a reference
+ inside the group.
+
+ If the bracket fails to match, we need to restore this value and also the
+ values of the final offsets, in case they were set by a previous iteration of
+ the same bracket.
+
+ If there isn't enough space in the offset vector, treat this as if it were a
+ non-capturing bracket. Don't worry about setting the flag for the error case
+ here; that is handled in the code for KET. */
+
+ if (op > OP_BRA)
+ {
+ int number = op - OP_BRA;
+ int offset = number << 1;
+
+#ifdef DEBUG
+ printf("start bracket %d subject=", number);
+ pchars(eptr, 16, TRUE, md);
+ printf("\n");
+#endif
+
+ if (offset < md->offset_max)
+ {
+ int save_offset1 = md->offset_vector[offset];
+ int save_offset2 = md->offset_vector[offset+1];
+ int save_offset3 = md->offset_vector[md->offset_end - number];
+
+ DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));
+ md->offset_vector[md->offset_end - number] = eptr - md->start_subject;
+
+ do
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ ecode += (ecode[1] << 8) + ecode[2];
+ }
+ while (*ecode == OP_ALT);
+
+ DPRINTF(("bracket %d failed\n", number));
+
+ md->offset_vector[offset] = save_offset1;
+ md->offset_vector[offset+1] = save_offset2;
+ md->offset_vector[md->offset_end - number] = save_offset3;
+ return FALSE;
+ }
+
+ /* Insufficient room for saving captured contents */
+
+ else op = OP_BRA;
+ }
+
+ /* Other types of node can be handled by a switch */
+
+ switch(op)
+ {
+ case OP_BRA: /* Non-capturing bracket: optimized */
+ DPRINTF(("start bracket 0\n"));
+ do
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ ecode += (ecode[1] << 8) + ecode[2];
+ }
+ while (*ecode == OP_ALT);
+ DPRINTF(("bracket 0 failed\n"));
+ return FALSE;
+
+ /* Conditional group: compilation checked that there are no more than
+ two branches. If the condition is false, skipping the first branch takes us
+ past the end if there is only one branch, but that's OK because that is
+ exactly what going to the ket would do. */
+
+ case OP_COND:
+ if (ecode[3] == OP_CREF) /* Condition is extraction test */
+ {
+ int offset = ecode[4] << 1; /* Doubled reference number */
+ return match(eptr,
+ ecode + ((offset < offset_top && md->offset_vector[offset] >= 0)?
+ 5 : 3 + (ecode[1] << 8) + ecode[2]),
+ offset_top, md, ims, FALSE, eptr);
+ }
+
+ /* The condition is an assertion. Call match() to evaluate it - setting
+ the final argument TRUE causes it to stop at the end of an assertion. */
+
+ else
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, TRUE, NULL))
+ {
+ ecode += 3 + (ecode[4] << 8) + ecode[5];
+ while (*ecode == OP_ALT) ecode += (ecode[1] << 8) + ecode[2];
+ }
+ else ecode += (ecode[1] << 8) + ecode[2];
+ return match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr);
+ }
+ /* Control never reaches here */
+
+ /* Skip over conditional reference data if encountered (should not be) */
+
+ case OP_CREF:
+ ecode += 2;
+ break;
+
+ /* End of the pattern. If PCRE_NOTEMPTY is set, fail if we have matched
+ an empty string - recursion will then try other alternatives, if any. */
+
+ case OP_END:
+ if (md->notempty && eptr == md->start_match) return FALSE;
+ md->end_match_ptr = eptr; /* Record where we ended */
+ md->end_offset_top = offset_top; /* and how many extracts were taken */
+ return TRUE;
+
+ /* Change option settings */
+
+ case OP_OPT:
+ ims = ecode[1];
+ ecode += 2;
+ DPRINTF(("ims set to %02lx\n", ims));
+ break;
+
+ /* Assertion brackets. Check the alternative branches in turn - the
+ matching won't pass the KET for an assertion. If any one branch matches,
+ the assertion is true. Lookbehind assertions have an OP_REVERSE item at the
+ start of each branch to move the current point backwards, so the code at
+ this level is identical to the lookahead case. */
+
+ case OP_ASSERT:
+ case OP_ASSERTBACK:
+ do
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, NULL)) break;
+ ecode += (ecode[1] << 8) + ecode[2];
+ }
+ while (*ecode == OP_ALT);
+ if (*ecode == OP_KET) return FALSE;
+
+ /* If checking an assertion for a condition, return TRUE. */
+
+ if (condassert) return TRUE;
+
+ /* Continue from after the assertion, updating the offsets high water
+ mark, since extracts may have been taken during the assertion. */
+
+ do ecode += (ecode[1] << 8) + ecode[2]; while (*ecode == OP_ALT);
+ ecode += 3;
+ offset_top = md->end_offset_top;
+ continue;
+
+ /* Negative assertion: all branches must fail to match */
+
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK_NOT:
+ do
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, NULL)) return FALSE;
+ ecode += (ecode[1] << 8) + ecode[2];
+ }
+ while (*ecode == OP_ALT);
+
+ if (condassert) return TRUE;
+ ecode += 3;
+ continue;
+
+ /* Move the subject pointer back. This occurs only at the start of
+ each branch of a lookbehind assertion. If we are too close to the start to
+ move back, this match function fails. */
+
+ case OP_REVERSE:
+ eptr -= (ecode[1] << 8) + ecode[2];
+ if (eptr < md->start_subject) return FALSE;
+ ecode += 3;
+ break;
+
+
+ /* "Once" brackets are like assertion brackets except that after a match,
+ the point in the subject string is not moved back. Thus there can never be
+ a move back into the brackets. Check the alternative branches in turn - the
+ matching won't pass the KET for this kind of subpattern. If any one branch
+ matches, we carry on as at the end of a normal bracket, leaving the subject
+ pointer. */
+
+ case OP_ONCE:
+ {
+ const uschar *prev = ecode;
+
+ do
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr)) break;
+ ecode += (ecode[1] << 8) + ecode[2];
+ }
+ while (*ecode == OP_ALT);
+
+ /* If hit the end of the group (which could be repeated), fail */
+
+ if (*ecode != OP_ONCE && *ecode != OP_ALT) return FALSE;
+
+ /* Continue as from after the assertion, updating the offsets high water
+ mark, since extracts may have been taken. */
+
+ do ecode += (ecode[1] << 8) + ecode[2]; while (*ecode == OP_ALT);
+
+ offset_top = md->end_offset_top;
+ eptr = md->end_match_ptr;
+
+ /* For a non-repeating ket, just continue at this level. This also
+ happens for a repeating ket if no characters were matched in the group.
+ This is the forcible breaking of infinite loops as implemented in Perl
+ 5.005. If there is an options reset, it will get obeyed in the normal
+ course of events. */
+
+ if (*ecode == OP_KET || eptr == eptrb)
+ {
+ ecode += 3;
+ break;
+ }
+
+ /* The repeating kets try the rest of the pattern or restart from the
+ preceding bracket, in the appropriate order. We need to reset any options
+ that changed within the bracket before re-running it, so check the next
+ opcode. */
+
+ if (ecode[3] == OP_OPT)
+ {
+ ims = (ims & ~PCRE_IMS) | ecode[4];
+ DPRINTF(("ims set to %02lx at group repeat\n", ims));
+ }
+
+ if (*ecode == OP_KETRMIN)
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr) ||
+ match(eptr, prev, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ }
+ else /* OP_KETRMAX */
+ {
+ if (match(eptr, prev, offset_top, md, ims, FALSE, eptr) ||
+ match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ }
+ }
+ return FALSE;
+
+ /* An alternation is the end of a branch; scan along to find the end of the
+ bracketed group and go to there. */
+
+ case OP_ALT:
+ do ecode += (ecode[1] << 8) + ecode[2]; while (*ecode == OP_ALT);
+ break;
+
+ /* BRAZERO and BRAMINZERO occur just before a bracket group, indicating
+ that it may occur zero times. It may repeat infinitely, or not at all -
+ i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper
+ repeat limits are compiled as a number of copies, with the optional ones
+ preceded by BRAZERO or BRAMINZERO. */
+
+ case OP_BRAZERO:
+ {
+ const uschar *next = ecode+1;
+ if (match(eptr, next, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ do next += (next[1] << 8) + next[2]; while (*next == OP_ALT);
+ ecode = next + 3;
+ }
+ break;
+
+ case OP_BRAMINZERO:
+ {
+ const uschar *next = ecode+1;
+ do next += (next[1] << 8) + next[2]; while (*next == OP_ALT);
+ if (match(eptr, next+3, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ ecode++;
+ }
+ break;
+
+ /* End of a group, repeated or non-repeating. If we are at the end of
+ an assertion "group", stop matching and return TRUE, but record the
+ current high water mark for use by positive assertions. Do this also
+ for the "once" (not-backup up) groups. */
+
+ case OP_KET:
+ case OP_KETRMIN:
+ case OP_KETRMAX:
+ {
+ const uschar *prev = ecode - (ecode[1] << 8) - ecode[2];
+
+ if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT ||
+ *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT ||
+ *prev == OP_ONCE)
+ {
+ md->end_match_ptr = eptr; /* For ONCE */
+ md->end_offset_top = offset_top;
+ return TRUE;
+ }
+
+ /* In all other cases except a conditional group we have to check the
+ group number back at the start and if necessary complete handling an
+ extraction by setting the offsets and bumping the high water mark. */
+
+ if (*prev != OP_COND)
+ {
+ int number = *prev - OP_BRA;
+ int offset = number << 1;
+
+ DPRINTF(("end bracket %d\n", number));
+
+ if (number > 0)
+ {
+ if (offset >= md->offset_max) md->offset_overflow = TRUE; else
+ {
+ md->offset_vector[offset] =
+ md->offset_vector[md->offset_end - number];
+ md->offset_vector[offset+1] = eptr - md->start_subject;
+ if (offset_top <= offset) offset_top = offset + 2;
+ }
+ }
+ }
+
+ /* Reset the value of the ims flags, in case they got changed during
+ the group. */
+
+ ims = original_ims;
+ DPRINTF(("ims reset to %02lx\n", ims));
+
+ /* For a non-repeating ket, just continue at this level. This also
+ happens for a repeating ket if no characters were matched in the group.
+ This is the forcible breaking of infinite loops as implemented in Perl
+ 5.005. If there is an options reset, it will get obeyed in the normal
+ course of events. */
+
+ if (*ecode == OP_KET || eptr == eptrb)
+ {
+ ecode += 3;
+ break;
+ }
+
+ /* The repeating kets try the rest of the pattern or restart from the
+ preceding bracket, in the appropriate order. */
+
+ if (*ecode == OP_KETRMIN)
+ {
+ if (match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr) ||
+ match(eptr, prev, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ }
+ else /* OP_KETRMAX */
+ {
+ if (match(eptr, prev, offset_top, md, ims, FALSE, eptr) ||
+ match(eptr, ecode+3, offset_top, md, ims, FALSE, eptr)) return TRUE;
+ }
+ }
+ return FALSE;
+
+ /* Start of subject unless notbol, or after internal newline if multiline */
+
+ case OP_CIRC:
+ if (md->notbol && eptr == md->start_subject) return FALSE;
+ if ((ims & PCRE_MULTILINE) != 0)
+ {
+ if (eptr != md->start_subject && eptr[-1] != '\n') return FALSE;
+ ecode++;
+ break;
+ }
+ /* ... else fall through */
+
+ /* Start of subject assertion */
+
+ case OP_SOD:
+ if (eptr != md->start_subject) return FALSE;
+ ecode++;
+ break;
+
+ /* Assert before internal newline if multiline, or before a terminating
+ newline unless endonly is set, else end of subject unless noteol is set. */
+
+ case OP_DOLL:
+ if ((ims & PCRE_MULTILINE) != 0)
+ {
+ if (eptr < md->end_subject) { if (*eptr != '\n') return FALSE; }
+ else { if (md->noteol) return FALSE; }
+ ecode++;
+ break;
+ }
+ else
+ {
+ if (md->noteol) return FALSE;
+ if (!md->endonly)
+ {
+ if (eptr < md->end_subject - 1 ||
+ (eptr == md->end_subject - 1 && *eptr != '\n')) return FALSE;
+
+ ecode++;
+ break;
+ }
+ }
+ /* ... else fall through */
+
+ /* End of subject assertion (\z) */
+
+ case OP_EOD:
+ if (eptr < md->end_subject) return FALSE;
+ ecode++;
+ break;
+
+ /* End of subject or ending \n assertion (\Z) */
+
+ case OP_EODN:
+ if (eptr < md->end_subject - 1 ||
+ (eptr == md->end_subject - 1 && *eptr != '\n')) return FALSE;
+ ecode++;
+ break;
+
+ /* Word boundary assertions */
+
+ case OP_NOT_WORD_BOUNDARY:
+ case OP_WORD_BOUNDARY:
+ {
+ BOOL prev_is_word = (eptr != md->start_subject) &&
+ ((md->ctypes[eptr[-1]] & ctype_word) != 0);
+ BOOL cur_is_word = (eptr < md->end_subject) &&
+ ((md->ctypes[*eptr] & ctype_word) != 0);
+ if ((*ecode++ == OP_WORD_BOUNDARY)?
+ cur_is_word == prev_is_word : cur_is_word != prev_is_word)
+ return FALSE;
+ }
+ break;
+
+ /* Match a single character type; inline for speed */
+
+ case OP_ANY:
+ if ((ims & PCRE_DOTALL) == 0 && eptr < md->end_subject && *eptr == '\n')
+ return FALSE;
+ if (eptr++ >= md->end_subject) return FALSE;
+ ecode++;
+ break;
+
+ case OP_NOT_DIGIT:
+ if (eptr >= md->end_subject ||
+ (md->ctypes[*eptr++] & ctype_digit) != 0)
+ return FALSE;
+ ecode++;
+ break;
+
+ case OP_DIGIT:
+ if (eptr >= md->end_subject ||
+ (md->ctypes[*eptr++] & ctype_digit) == 0)
+ return FALSE;
+ ecode++;
+ break;
+
+ case OP_NOT_WHITESPACE:
+ if (eptr >= md->end_subject ||
+ (md->ctypes[*eptr++] & ctype_space) != 0)
+ return FALSE;
+ ecode++;
+ break;
+
+ case OP_WHITESPACE:
+ if (eptr >= md->end_subject ||
+ (md->ctypes[*eptr++] & ctype_space) == 0)
+ return FALSE;
+ ecode++;
+ break;
+
+ case OP_NOT_WORDCHAR:
+ if (eptr >= md->end_subject ||
+ (md->ctypes[*eptr++] & ctype_word) != 0)
+ return FALSE;
+ ecode++;
+ break;
+
+ case OP_WORDCHAR:
+ if (eptr >= md->end_subject ||
+ (md->ctypes[*eptr++] & ctype_word) == 0)
+ return FALSE;
+ ecode++;
+ break;
+
+ /* Match a back reference, possibly repeatedly. Look past the end of the
+ item to see if there is repeat information following. The code is similar
+ to that for character classes, but repeated for efficiency. Then obey
+ similar code to character type repeats - written out again for speed.
+ However, if the referenced string is the empty string, always treat
+ it as matched, any number of times (otherwise there could be infinite
+ loops). */
+
+ case OP_REF:
+ {
+ int length;
+ int offset = ecode[1] << 1; /* Doubled reference number */
+ ecode += 2; /* Advance past the item */
+
+ /* If the reference is unset, set the length to be longer than the amount
+ of subject left; this ensures that every attempt at a match fails. We
+ can't just fail here, because of the possibility of quantifiers with zero
+ minima. */
+
+ length = (offset >= offset_top || md->offset_vector[offset] < 0)?
+ md->end_subject - eptr + 1 :
+ md->offset_vector[offset+1] - md->offset_vector[offset];
+
+ /* Set up for repetition, or handle the non-repeated case */
+
+ switch (*ecode)
+ {
+ case OP_CRSTAR:
+ case OP_CRMINSTAR:
+ case OP_CRPLUS:
+ case OP_CRMINPLUS:
+ case OP_CRQUERY:
+ case OP_CRMINQUERY:
+ c = *ecode++ - OP_CRSTAR;
+ minimize = (c & 1) != 0;
+ min = rep_min[c]; /* Pick up values from tables; */
+ max = rep_max[c]; /* zero for max => infinity */
+ if (max == 0) max = INT_MAX;
+ break;
+
+ case OP_CRRANGE:
+ case OP_CRMINRANGE:
+ minimize = (*ecode == OP_CRMINRANGE);
+ min = (ecode[1] << 8) + ecode[2];
+ max = (ecode[3] << 8) + ecode[4];
+ if (max == 0) max = INT_MAX;
+ ecode += 5;
+ break;
+
+ default: /* No repeat follows */
+ if (!match_ref(offset, eptr, length, md, ims)) return FALSE;
+ eptr += length;
+ continue; /* With the main loop */
+ }
+
+ /* If the length of the reference is zero, just continue with the
+ main loop. */
+
+ if (length == 0) continue;
+
+ /* First, ensure the minimum number of matches are present. We get back
+ the length of the reference string explicitly rather than passing the
+ address of eptr, so that eptr can be a register variable. */
+
+ for (i = 1; i <= min; i++)
+ {
+ if (!match_ref(offset, eptr, length, md, ims)) return FALSE;
+ eptr += length;
+ }
+
+ /* If min = max, continue at the same level without recursion.
+ They are not both allowed to be zero. */
+
+ if (min == max) continue;
+
+ /* If minimizing, keep trying and advancing the pointer */
+
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ if (i >= max || !match_ref(offset, eptr, length, md, ims))
+ return FALSE;
+ eptr += length;
+ }
+ /* Control never gets here */
+ }
+
+ /* If maximizing, find the longest string and work backwards */
+
+ else
+ {
+ const uschar *pp = eptr;
+ for (i = min; i < max; i++)
+ {
+ if (!match_ref(offset, eptr, length, md, ims)) break;
+ eptr += length;
+ }
+ while (eptr >= pp)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ eptr -= length;
+ }
+ return FALSE;
+ }
+ }
+ /* Control never gets here */
+
+
+
+ /* Match a character class, possibly repeatedly. Look past the end of the
+ item to see if there is repeat information following. Then obey similar
+ code to character type repeats - written out again for speed. */
+
+ case OP_CLASS:
+ {
+ const uschar *data = ecode + 1; /* Save for matching */
+ ecode += 33; /* Advance past the item */
+
+ switch (*ecode)
+ {
+ case OP_CRSTAR:
+ case OP_CRMINSTAR:
+ case OP_CRPLUS:
+ case OP_CRMINPLUS:
+ case OP_CRQUERY:
+ case OP_CRMINQUERY:
+ c = *ecode++ - OP_CRSTAR;
+ minimize = (c & 1) != 0;
+ min = rep_min[c]; /* Pick up values from tables; */
+ max = rep_max[c]; /* zero for max => infinity */
+ if (max == 0) max = INT_MAX;
+ break;
+
+ case OP_CRRANGE:
+ case OP_CRMINRANGE:
+ minimize = (*ecode == OP_CRMINRANGE);
+ min = (ecode[1] << 8) + ecode[2];
+ max = (ecode[3] << 8) + ecode[4];
+ if (max == 0) max = INT_MAX;
+ ecode += 5;
+ break;
+
+ default: /* No repeat follows */
+ min = max = 1;
+ break;
+ }
+
+ /* First, ensure the minimum number of matches are present. */
+
+ for (i = 1; i <= min; i++)
+ {
+ if (eptr >= md->end_subject) return FALSE;
+ c = *eptr++;
+ if ((data[c/8] & (1 << (c&7))) != 0) continue;
+ return FALSE;
+ }
+
+ /* If max == min we can continue with the main loop without the
+ need to recurse. */
+
+ if (min == max) continue;
+
+ /* If minimizing, keep testing the rest of the expression and advancing
+ the pointer while it matches the class. */
+
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ if (i >= max || eptr >= md->end_subject) return FALSE;
+ c = *eptr++;
+ if ((data[c/8] & (1 << (c&7))) != 0) continue;
+ return FALSE;
+ }
+ /* Control never gets here */
+ }
+
+ /* If maximizing, find the longest possible run, then work backwards. */
+
+ else
+ {
+ const uschar *pp = eptr;
+ for (i = min; i < max; eptr++, i++)
+ {
+ if (eptr >= md->end_subject) break;
+ c = *eptr;
+ if ((data[c/8] & (1 << (c&7))) != 0) continue;
+ break;
+ }
+
+ while (eptr >= pp)
+ if (match(eptr--, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ return FALSE;
+ }
+ }
+ /* Control never gets here */
+
+ /* Match a run of characters */
+
+ case OP_CHARS:
+ {
+ register int length = ecode[1];
+ ecode += 2;
+
+#ifdef DEBUG /* Sigh. Some compilers never learn. */
+ if (eptr >= md->end_subject)
+ printf("matching subject <null> against pattern ");
+ else
+ {
+ printf("matching subject ");
+ pchars(eptr, length, TRUE, md);
+ printf(" against pattern ");
+ }
+ pchars(ecode, length, FALSE, md);
+ printf("\n");
+#endif
+
+ if (length > md->end_subject - eptr) return FALSE;
+ if ((ims & PCRE_CASELESS) != 0)
+ {
+ while (length-- > 0)
+ if (md->lcc[*ecode++] != md->lcc[*eptr++])
+ return FALSE;
+ }
+ else
+ {
+ while (length-- > 0) if (*ecode++ != *eptr++) return FALSE;
+ }
+ }
+ break;
+
+ /* Match a single character repeatedly; different opcodes share code. */
+
+ case OP_EXACT:
+ min = max = (ecode[1] << 8) + ecode[2];
+ ecode += 3;
+ goto REPEATCHAR;
+
+ case OP_UPTO:
+ case OP_MINUPTO:
+ min = 0;
+ max = (ecode[1] << 8) + ecode[2];
+ minimize = *ecode == OP_MINUPTO;
+ ecode += 3;
+ goto REPEATCHAR;
+
+ case OP_STAR:
+ case OP_MINSTAR:
+ case OP_PLUS:
+ case OP_MINPLUS:
+ case OP_QUERY:
+ case OP_MINQUERY:
+ c = *ecode++ - OP_STAR;
+ minimize = (c & 1) != 0;
+ min = rep_min[c]; /* Pick up values from tables; */
+ max = rep_max[c]; /* zero for max => infinity */
+ if (max == 0) max = INT_MAX;
+
+ /* Common code for all repeated single-character matches. We can give
+ up quickly if there are fewer than the minimum number of characters left in
+ the subject. */
+
+ REPEATCHAR:
+ if (min > md->end_subject - eptr) return FALSE;
+ c = *ecode++;
+
+ /* The code is duplicated for the caseless and caseful cases, for speed,
+ since matching characters is likely to be quite common. First, ensure the
+ minimum number of matches are present. If min = max, continue at the same
+ level without recursing. Otherwise, if minimizing, keep trying the rest of
+ the expression and advancing one matching character if failing, up to the
+ maximum. Alternatively, if maximizing, find the maximum number of
+ characters and work backwards. */
+
+ DPRINTF(("matching %c{%d,%d} against subject %.*s\n", c, min, max,
+ max, eptr));
+
+ if ((ims & PCRE_CASELESS) != 0)
+ {
+ c = md->lcc[c];
+ for (i = 1; i <= min; i++)
+ if (c != md->lcc[*eptr++]) return FALSE;
+ if (min == max) continue;
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ if (i >= max || eptr >= md->end_subject ||
+ c != md->lcc[*eptr++])
+ return FALSE;
+ }
+ /* Control never gets here */
+ }
+ else
+ {
+ const uschar *pp = eptr;
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || c != md->lcc[*eptr]) break;
+ eptr++;
+ }
+ while (eptr >= pp)
+ if (match(eptr--, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ return FALSE;
+ }
+ /* Control never gets here */
+ }
+
+ /* Caseful comparisons */
+
+ else
+ {
+ for (i = 1; i <= min; i++) if (c != *eptr++) return FALSE;
+ if (min == max) continue;
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ if (i >= max || eptr >= md->end_subject || c != *eptr++) return FALSE;
+ }
+ /* Control never gets here */
+ }
+ else
+ {
+ const uschar *pp = eptr;
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || c != *eptr) break;
+ eptr++;
+ }
+ while (eptr >= pp)
+ if (match(eptr--, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ return FALSE;
+ }
+ }
+ /* Control never gets here */
+
+ /* Match a negated single character */
+
+ case OP_NOT:
+ if (eptr >= md->end_subject) return FALSE;
+ ecode++;
+ if ((ims & PCRE_CASELESS) != 0)
+ {
+ if (md->lcc[*ecode++] == md->lcc[*eptr++]) return FALSE;
+ }
+ else
+ {
+ if (*ecode++ == *eptr++) return FALSE;
+ }
+ break;
+
+ /* Match a negated single character repeatedly. This is almost a repeat of
+ the code for a repeated single character, but I haven't found a nice way of
+ commoning these up that doesn't require a test of the positive/negative
+ option for each character match. Maybe that wouldn't add very much to the
+ time taken, but character matching *is* what this is all about... */
+
+ case OP_NOTEXACT:
+ min = max = (ecode[1] << 8) + ecode[2];
+ ecode += 3;
+ goto REPEATNOTCHAR;
+
+ case OP_NOTUPTO:
+ case OP_NOTMINUPTO:
+ min = 0;
+ max = (ecode[1] << 8) + ecode[2];
+ minimize = *ecode == OP_NOTMINUPTO;
+ ecode += 3;
+ goto REPEATNOTCHAR;
+
+ case OP_NOTSTAR:
+ case OP_NOTMINSTAR:
+ case OP_NOTPLUS:
+ case OP_NOTMINPLUS:
+ case OP_NOTQUERY:
+ case OP_NOTMINQUERY:
+ c = *ecode++ - OP_NOTSTAR;
+ minimize = (c & 1) != 0;
+ min = rep_min[c]; /* Pick up values from tables; */
+ max = rep_max[c]; /* zero for max => infinity */
+ if (max == 0) max = INT_MAX;
+
+ /* Common code for all repeated single-character matches. We can give
+ up quickly if there are fewer than the minimum number of characters left in
+ the subject. */
+
+ REPEATNOTCHAR:
+ if (min > md->end_subject - eptr) return FALSE;
+ c = *ecode++;
+
+ /* The code is duplicated for the caseless and caseful cases, for speed,
+ since matching characters is likely to be quite common. First, ensure the
+ minimum number of matches are present. If min = max, continue at the same
+ level without recursing. Otherwise, if minimizing, keep trying the rest of
+ the expression and advancing one matching character if failing, up to the
+ maximum. Alternatively, if maximizing, find the maximum number of
+ characters and work backwards. */
+
+ DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", c, min, max,
+ max, eptr));
+
+ if ((ims & PCRE_CASELESS) != 0)
+ {
+ c = md->lcc[c];
+ for (i = 1; i <= min; i++)
+ if (c == md->lcc[*eptr++]) return FALSE;
+ if (min == max) continue;
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ if (i >= max || eptr >= md->end_subject ||
+ c == md->lcc[*eptr++])
+ return FALSE;
+ }
+ /* Control never gets here */
+ }
+ else
+ {
+ const uschar *pp = eptr;
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || c == md->lcc[*eptr]) break;
+ eptr++;
+ }
+ while (eptr >= pp)
+ if (match(eptr--, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ return FALSE;
+ }
+ /* Control never gets here */
+ }
+
+ /* Caseful comparisons */
+
+ else
+ {
+ for (i = 1; i <= min; i++) if (c == *eptr++) return FALSE;
+ if (min == max) continue;
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ if (i >= max || eptr >= md->end_subject || c == *eptr++) return FALSE;
+ }
+ /* Control never gets here */
+ }
+ else
+ {
+ const uschar *pp = eptr;
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || c == *eptr) break;
+ eptr++;
+ }
+ while (eptr >= pp)
+ if (match(eptr--, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ return FALSE;
+ }
+ }
+ /* Control never gets here */
+
+ /* Match a single character type repeatedly; several different opcodes
+ share code. This is very similar to the code for single characters, but we
+ repeat it in the interests of efficiency. */
+
+ case OP_TYPEEXACT:
+ min = max = (ecode[1] << 8) + ecode[2];
+ minimize = TRUE;
+ ecode += 3;
+ goto REPEATTYPE;
+
+ case OP_TYPEUPTO:
+ case OP_TYPEMINUPTO:
+ min = 0;
+ max = (ecode[1] << 8) + ecode[2];
+ minimize = *ecode == OP_TYPEMINUPTO;
+ ecode += 3;
+ goto REPEATTYPE;
+
+ case OP_TYPESTAR:
+ case OP_TYPEMINSTAR:
+ case OP_TYPEPLUS:
+ case OP_TYPEMINPLUS:
+ case OP_TYPEQUERY:
+ case OP_TYPEMINQUERY:
+ c = *ecode++ - OP_TYPESTAR;
+ minimize = (c & 1) != 0;
+ min = rep_min[c]; /* Pick up values from tables; */
+ max = rep_max[c]; /* zero for max => infinity */
+ if (max == 0) max = INT_MAX;
+
+ /* Common code for all repeated single character type matches */
+
+ REPEATTYPE:
+ ctype = *ecode++; /* Code for the character type */
+
+ /* First, ensure the minimum number of matches are present. Use inline
+ code for maximizing the speed, and do the type test once at the start
+ (i.e. keep it out of the loop). Also test that there are at least the
+ minimum number of characters before we start. */
+
+ if (min > md->end_subject - eptr) return FALSE;
+ if (min > 0) switch(ctype)
+ {
+ case OP_ANY:
+ if ((ims & PCRE_DOTALL) == 0)
+ { for (i = 1; i <= min; i++) if (*eptr++ == '\n') return FALSE; }
+ else eptr += min;
+ break;
+
+ case OP_NOT_DIGIT:
+ for (i = 1; i <= min; i++)
+ if ((md->ctypes[*eptr++] & ctype_digit) != 0) return FALSE;
+ break;
+
+ case OP_DIGIT:
+ for (i = 1; i <= min; i++)
+ if ((md->ctypes[*eptr++] & ctype_digit) == 0) return FALSE;
+ break;
+
+ case OP_NOT_WHITESPACE:
+ for (i = 1; i <= min; i++)
+ if ((md->ctypes[*eptr++] & ctype_space) != 0) return FALSE;
+ break;
+
+ case OP_WHITESPACE:
+ for (i = 1; i <= min; i++)
+ if ((md->ctypes[*eptr++] & ctype_space) == 0) return FALSE;
+ break;
+
+ case OP_NOT_WORDCHAR:
+ for (i = 1; i <= min; i++)
+ if ((md->ctypes[*eptr++] & ctype_word) != 0)
+ return FALSE;
+ break;
+
+ case OP_WORDCHAR:
+ for (i = 1; i <= min; i++)
+ if ((md->ctypes[*eptr++] & ctype_word) == 0)
+ return FALSE;
+ break;
+ }
+
+ /* If min = max, continue at the same level without recursing */
+
+ if (min == max) continue;
+
+ /* If minimizing, we have to test the rest of the pattern before each
+ subsequent match. */
+
+ if (minimize)
+ {
+ for (i = min;; i++)
+ {
+ if (match(eptr, ecode, offset_top, md, ims, FALSE, eptrb)) return TRUE;
+ if (i >= max || eptr >= md->end_subject) return FALSE;
+
+ c = *eptr++;
+ switch(ctype)
+ {
+ case OP_ANY:
+ if ((ims & PCRE_DOTALL) == 0 && c == '\n') return FALSE;
+ break;
+
+ case OP_NOT_DIGIT:
+ if ((md->ctypes[c] & ctype_digit) != 0) return FALSE;
+ break;
+
+ case OP_DIGIT:
+ if ((md->ctypes[c] & ctype_digit) == 0) return FALSE;
+ break;
+
+ case OP_NOT_WHITESPACE:
+ if ((md->ctypes[c] & ctype_space) != 0) return FALSE;
+ break;
+
+ case OP_WHITESPACE:
+ if ((md->ctypes[c] & ctype_space) == 0) return FALSE;
+ break;
+
+ case OP_NOT_WORDCHAR:
+ if ((md->ctypes[c] & ctype_word) != 0) return FALSE;
+ break;
+
+ case OP_WORDCHAR:
+ if ((md->ctypes[c] & ctype_word) == 0) return FALSE;
+ break;
+ }
+ }
+ /* Control never gets here */
+ }
+
+ /* If maximizing it is worth using inline code for speed, doing the type
+ test once at the start (i.e. keep it out of the loop). */
+
+ else
+ {
+ const uschar *pp = eptr;
+ switch(ctype)
+ {
+ case OP_ANY:
+ if ((ims & PCRE_DOTALL) == 0)
+ {
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || *eptr == '\n') break;
+ eptr++;
+ }
+ }
+ else
+ {
+ c = max - min;
+ if (c > md->end_subject - eptr) c = md->end_subject - eptr;
+ eptr += c;
+ }
+ break;
+
+ case OP_NOT_DIGIT:
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) != 0)
+ break;
+ eptr++;
+ }
+ break;
+
+ case OP_DIGIT:
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) == 0)
+ break;
+ eptr++;
+ }
+ break;
+
+ case OP_NOT_WHITESPACE:
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) != 0)
+ break;
+ eptr++;
+ }
+ break;
+
+ case OP_WHITESPACE:
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) == 0)
+ break;
+ eptr++;
+ }
+ break;
+
+ case OP_NOT_WORDCHAR:
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) != 0)
+ break;
+ eptr++;
+ }
+ break;
+
+ case OP_WORDCHAR:
+ for (i = min; i < max; i++)
+ {
+ if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) == 0)
+ break;
+ eptr++;
+ }
+ break;
+ }
+
+ while (eptr >= pp)
+ if (match(eptr--, ecode, offset_top, md, ims, FALSE, eptrb))
+ return TRUE;
+ return FALSE;
+ }
+ /* Control never gets here */
+
+ /* There's been some horrible disaster. */
+
+ default:
+ DPRINTF(("Unknown opcode %d\n", *ecode));
+ md->errorcode = PCRE_ERROR_UNKNOWN_NODE;
+ return FALSE;
+ }
+
+ /* Do not stick any code in here without much thought; it is assumed
+ that "continue" in the code above comes out to here to repeat the main
+ loop. */
+
+ } /* End of main loop */
+/* Control never reaches here */
+}
+
+
+
+
+/*************************************************
+* Execute a Regular Expression *
+*************************************************/
+
+/* This function applies a compiled re to a subject string and picks out
+portions of the string if it matches. Two elements in the vector are set for
+each substring: the offsets to the start and end of the substring.
+
+Arguments:
+ external_re points to the compiled expression
+ external_extra points to "hints" from pcre_study() or is NULL
+ subject points to the subject string
+ length length of subject string (may contain binary zeros)
+ start_offset where to start in the subject string
+ options option bits
+ offsets points to a vector of ints to be filled in with offsets
+ offsetcount the number of elements in the vector
+
+Returns: > 0 => success; value is the number of elements filled in
+ = 0 => success, but offsets is not big enough
+ -1 => failed to match
+ < -1 => some kind of unexpected problem
+*/
+
+int
+pcre_exec(const pcre *external_re, const pcre_extra *external_extra,
+ const char *subject, int length, int start_offset, int options, int *offsets,
+ int offsetcount)
+{
+int resetcount, ocount;
+int first_char = -1;
+int req_char = -1;
+int req_char2 = -1;
+unsigned long int ims = 0;
+match_data match_block;
+const uschar *start_bits = NULL;
+const uschar *start_match = (const uschar *)subject + start_offset;
+const uschar *end_subject;
+const uschar *req_char_ptr = start_match - 1;
+const real_pcre *re = (const real_pcre *)external_re;
+const real_pcre_extra *extra = (const real_pcre_extra *)external_extra;
+BOOL using_temporary_offsets = FALSE;
+BOOL anchored = ((re->options | options) & PCRE_ANCHORED) != 0;
+BOOL startline = (re->options & PCRE_STARTLINE) != 0;
+
+if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;
+
+if (re == NULL || subject == NULL ||
+ (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;
+if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC;
+
+match_block.start_subject = (const uschar *)subject;
+match_block.end_subject = match_block.start_subject + length;
+end_subject = match_block.end_subject;
+
+match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
+
+match_block.notbol = (options & PCRE_NOTBOL) != 0;
+match_block.noteol = (options & PCRE_NOTEOL) != 0;
+match_block.notempty = (options & PCRE_NOTEMPTY) != 0;
+
+match_block.errorcode = PCRE_ERROR_NOMATCH; /* Default error */
+
+match_block.lcc = re->tables + lcc_offset;
+match_block.ctypes = re->tables + ctypes_offset;
+
+/* The ims options can vary during the matching as a result of the presence
+of (?ims) items in the pattern. They are kept in a local variable so that
+restoring at the exit of a group is easy. */
+
+ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL);
+
+/* If the expression has got more back references than the offsets supplied can
+hold, we get a temporary bit of working store to use during the matching.
+Otherwise, we can use the vector supplied, rounding down its size to a multiple
+of 3. */
+
+ocount = offsetcount - (offsetcount % 3);
+
+if (re->top_backref > 0 && re->top_backref >= ocount/3)
+ {
+ ocount = re->top_backref * 3 + 3;
+ match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
+ if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
+ using_temporary_offsets = TRUE;
+ DPRINTF(("Got memory to hold back references\n"));
+ }
+else match_block.offset_vector = offsets;
+
+match_block.offset_end = ocount;
+match_block.offset_max = (2*ocount)/3;
+match_block.offset_overflow = FALSE;
+
+/* Compute the minimum number of offsets that we need to reset each time. Doing
+this makes a huge difference to execution time when there aren't many brackets
+in the pattern. */
+
+resetcount = 2 + re->top_bracket * 2;
+if (resetcount > offsetcount) resetcount = ocount;
+
+/* Reset the working variable associated with each extraction. These should
+never be used unless previously set, but they get saved and restored, and so we
+initialize them to avoid reading uninitialized locations. */
+
+if (match_block.offset_vector != NULL)
+ {
+ register int *iptr = match_block.offset_vector + ocount;
+ register int *iend = iptr - resetcount/2 + 1;
+ while (--iptr >= iend) *iptr = -1;
+ }
+
+/* Set up the first character to match, if available. The first_char value is
+never set for an anchored regular expression, but the anchoring may be forced
+at run time, so we have to test for anchoring. The first char may be unset for
+an unanchored pattern, of course. If there's no first char and the pattern was
+studied, there may be a bitmap of possible first characters. */
+
+if (!anchored)
+ {
+ if ((re->options & PCRE_FIRSTSET) != 0)
+ {
+ first_char = re->first_char;
+ if ((ims & PCRE_CASELESS) != 0) first_char = match_block.lcc[first_char];
+ }
+ else
+ if (!startline && extra != NULL &&
+ (extra->options & PCRE_STUDY_MAPPED) != 0)
+ start_bits = extra->start_bits;
+ }
+
+/* For anchored or unanchored matches, there may be a "last known required
+character" set. If the PCRE_CASELESS is set, implying that the match starts
+caselessly, or if there are any changes of this flag within the regex, set up
+both cases of the character. Otherwise set the two values the same, which will
+avoid duplicate testing (which takes significant time). This covers the vast
+majority of cases. It will be suboptimal when the case flag changes in a regex
+and the required character in fact is caseful. */
+
+if ((re->options & PCRE_REQCHSET) != 0)
+ {
+ req_char = re->req_char;
+ req_char2 = ((re->options & (PCRE_CASELESS | PCRE_ICHANGED)) != 0)?
+ (re->tables + fcc_offset)[req_char] : req_char;
+ }
+
+/* Loop for handling unanchored repeated matching attempts; for anchored regexs
+the loop runs just once. */
+
+do
+ {
+ int rc;
+ register int *iptr = match_block.offset_vector;
+ register int *iend = iptr + resetcount;
+
+ /* Reset the maximum number of extractions we might see. */
+
+ while (iptr < iend) *iptr++ = -1;
+
+ /* Advance to a unique first char if possible */
+
+ if (first_char >= 0)
+ {
+ if ((ims & PCRE_CASELESS) != 0)
+ while (start_match < end_subject &&
+ match_block.lcc[*start_match] != first_char)
+ start_match++;
+ else
+ while (start_match < end_subject && *start_match != first_char)
+ start_match++;
+ }
+
+ /* Or to just after \n for a multiline match if possible */
+
+ else if (startline)
+ {
+ if (start_match > match_block.start_subject + start_offset)
+ {
+ while (start_match < end_subject && start_match[-1] != '\n')
+ start_match++;
+ }
+ }
+
+ /* Or to a non-unique first char after study */
+
+ else if (start_bits != NULL)
+ {
+ while (start_match < end_subject)
+ {
+ register int c = *start_match;
+ if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; else break;
+ }
+ }
+
+#ifdef DEBUG /* Sigh. Some compilers never learn. */
+ printf(">>>> Match against: ");
+ pchars(start_match, end_subject - start_match, TRUE, &match_block);
+ printf("\n");
+#endif
+
+ /* If req_char is set, we know that that character must appear in the subject
+ for the match to succeed. If the first character is set, req_char must be
+ later in the subject; otherwise the test starts at the match point. This
+ optimization can save a huge amount of backtracking in patterns with nested
+ unlimited repeats that aren't going to match. We don't know what the state of
+ case matching may be when this character is hit, so test for it in both its
+ cases if necessary. However, the different cased versions will not be set up
+ unless PCRE_CASELESS was given or the casing state changes within the regex.
+ Writing separate code makes it go faster, as does using an autoincrement and
+ backing off on a match. */
+
+ if (req_char >= 0)
+ {
+ register const uschar *p = start_match + ((first_char >= 0)? 1 : 0);
+
+ /* We don't need to repeat the search if we haven't yet reached the
+ place we found it at last time. */
+
+ if (p > req_char_ptr)
+ {
+ /* Do a single test if no case difference is set up */
+
+ if (req_char == req_char2)
+ {
+ while (p < end_subject)
+ {
+ if (*p++ == req_char) { p--; break; }
+ }
+ }
+
+ /* Otherwise test for either case */
+
+ else
+ {
+ while (p < end_subject)
+ {
+ register int pp = *p++;
+ if (pp == req_char || pp == req_char2) { p--; break; }
+ }
+ }
+
+ /* If we can't find the required character, break the matching loop */
+
+ if (p >= end_subject) break;
+
+ /* If we have found the required character, save the point where we
+ found it, so that we don't search again next time round the loop if
+ the start hasn't passed this character yet. */
+
+ req_char_ptr = p;
+ }
+ }
+
+ /* When a match occurs, substrings will be set for all internal extractions;
+ we just need to set up the whole thing as substring 0 before returning. If
+ there were too many extractions, set the return code to zero. In the case
+ where we had to get some local store to hold offsets for backreferences, copy
+ those back references that we can. In this case there need not be overflow
+ if certain parts of the pattern were not used. */
+
+ match_block.start_match = start_match;
+ if (!match(start_match, re->code, 2, &match_block, ims, FALSE, start_match))
+ continue;
+
+ /* Copy the offset information from temporary store if necessary */
+
+ if (using_temporary_offsets)
+ {
+ if (offsetcount >= 4)
+ {
+ memcpy(offsets + 2, match_block.offset_vector + 2,
+ (offsetcount - 2) * sizeof(int));
+ DPRINTF(("Copied offsets from temporary memory\n"));
+ }
+ if (match_block.end_offset_top > offsetcount)
+ match_block.offset_overflow = TRUE;
+
+ DPRINTF(("Freeing temporary memory\n"));
+ (pcre_free)(match_block.offset_vector);
+ }
+
+ rc = match_block.offset_overflow? 0 : match_block.end_offset_top/2;
+
+ if (match_block.offset_end < 2) rc = 0; else
+ {
+ offsets[0] = start_match - match_block.start_subject;
+ offsets[1] = match_block.end_match_ptr - match_block.start_subject;
+ }
+
+ DPRINTF((">>>> returning %d\n", rc));
+ return rc;
+ }
+
+/* This "while" is the end of the "do" above */
+
+while (!anchored &&
+ match_block.errorcode == PCRE_ERROR_NOMATCH &&
+ start_match++ < end_subject);
+
+if (using_temporary_offsets)
+ {
+ DPRINTF(("Freeing temporary memory\n"));
+ (pcre_free)(match_block.offset_vector);
+ }
+
+DPRINTF((">>>> returning %d\n", match_block.errorcode));
+
+return match_block.errorcode;
+}
+
+/* End of pcre.c */
diff --git a/setedit/libpcre/pcre.h b/setedit/libpcre/pcre.h
new file mode 100644
index 0000000..4888b45
--- /dev/null
+++ b/setedit/libpcre/pcre.h
@@ -0,0 +1,94 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* Copyright (c) 1997-1999 University of Cambridge */
+
+#ifndef _PCRE_H
+#define _PCRE_H
+
+#define PCRE_MAJOR 2
+#define PCRE_MINOR 08
+#define PCRE_DATE 31-Aug-1999
+
+/* Win32 uses DLL by default */
+
+#ifdef _WIN32
+# ifdef STATIC
+# define PCRE_DL_IMPORT
+# else
+# define PCRE_DL_IMPORT __declspec(dllimport)
+# endif
+#else
+# define PCRE_DL_IMPORT
+#endif
+
+/* Have to include stdlib.h in order to ensure that size_t is defined;
+it is needed here for malloc. */
+
+#include <sys/types.h>
+#include <stdlib.h>
+
+/* Allow for C++ users */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Options */
+
+#define PCRE_CASELESS 0x0001
+#define PCRE_MULTILINE 0x0002
+#define PCRE_DOTALL 0x0004
+#define PCRE_EXTENDED 0x0008
+#define PCRE_ANCHORED 0x0010
+#define PCRE_DOLLAR_ENDONLY 0x0020
+#define PCRE_EXTRA 0x0040
+#define PCRE_NOTBOL 0x0080
+#define PCRE_NOTEOL 0x0100
+#define PCRE_UNGREEDY 0x0200
+#define PCRE_NOTEMPTY 0x0400
+
+/* Exec-time and get-time error codes */
+
+#define PCRE_ERROR_NOMATCH (-1)
+#define PCRE_ERROR_NULL (-2)
+#define PCRE_ERROR_BADOPTION (-3)
+#define PCRE_ERROR_BADMAGIC (-4)
+#define PCRE_ERROR_UNKNOWN_NODE (-5)
+#define PCRE_ERROR_NOMEMORY (-6)
+#define PCRE_ERROR_NOSUBSTRING (-7)
+
+/* Types */
+
+typedef void pcre;
+typedef void pcre_extra;
+
+/* Store get and free functions. These can be set to alternative malloc/free
+functions if required. Some magic is required for Win32 DLL; it is null on
+other OS. */
+
+PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);
+PCRE_DL_IMPORT extern void (*pcre_free)(void *);
+
+#undef PCRE_DL_IMPORT
+
+/* Functions */
+
+extern pcre *pcre_compile(const char *, int, const char **, int *,
+ const unsigned char *);
+extern int pcre_copy_substring(const char *, int *, int, int, char *, int);
+extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
+ int, int, int, int *, int);
+extern int pcre_get_substring(const char *, int *, int, int, const char **);
+extern int pcre_get_substring_list(const char *, int *, int, const char ***);
+extern int pcre_info(const pcre *, int *, int *);
+extern unsigned const char *pcre_maketables(void);
+extern pcre_extra *pcre_study(const pcre *, int, const char **);
+extern const char *pcre_version(void);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* End of pcre.h */
diff --git a/setedit/libpcre/study.c b/setedit/libpcre/study.c
new file mode 100644
index 0000000..284833b
--- /dev/null
+++ b/setedit/libpcre/study.c
@@ -0,0 +1,397 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/*
+This is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language. See
+the file Tech.Notes for some information on the internals.
+
+Written by: Philip Hazel <ph10@cam.ac.uk>
+
+ Copyright (c) 1997-1999 University of Cambridge
+
+-----------------------------------------------------------------------------
+Permission is granted to anyone to use this software for any purpose on any
+computer system, and to redistribute it freely, subject to the following
+restrictions:
+
+1. This software 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.
+
+2. The origin of this software must not be misrepresented, either by
+ explicit claim or by omission.
+
+3. Altered versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+4. If PCRE is embedded in any software that is released under the GNU
+ General Purpose Licence (GPL), then the terms of that licence shall
+ supersede any condition above with which it is incompatible.
+-----------------------------------------------------------------------------
+*/
+
+
+/* Include the internals header, which itself includes Standard C headers plus
+the external pcre header. */
+
+#include "internal.h"
+
+
+
+/*************************************************
+* Set a bit and maybe its alternate case *
+*************************************************/
+
+/* Given a character, set its bit in the table, and also the bit for the other
+version of a letter if we are caseless.
+
+Arguments:
+ start_bits points to the bit map
+ c is the character
+ caseless the caseless flag
+ cd the block with char table pointers
+
+Returns: nothing
+*/
+
+static void
+set_bit(uschar *start_bits, int c, BOOL caseless, compile_data *cd)
+{
+start_bits[c/8] |= (1 << (c&7));
+if (caseless && (cd->ctypes[c] & ctype_letter) != 0)
+ start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7));
+}
+
+
+
+/*************************************************
+* Create bitmap of starting chars *
+*************************************************/
+
+/* This function scans a compiled unanchored expression and attempts to build a
+bitmap of the set of initial characters. If it can't, it returns FALSE. As time
+goes by, we may be able to get more clever at doing this.
+
+Arguments:
+ code points to an expression
+ start_bits points to a 32-byte table, initialized to 0
+ caseless the current state of the caseless flag
+ cd the block with char table pointers
+
+Returns: TRUE if table built, FALSE otherwise
+*/
+
+static BOOL
+set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless,
+ compile_data *cd)
+{
+register int c;
+
+/* This next statement and the later reference to dummy are here in order to
+trick the optimizer of the IBM C compiler for OS/2 into generating correct
+code. Apparently IBM isn't going to fix the problem, and we would rather not
+disable optimization (in this module it actually makes a big difference, and
+the pcre module can use all the optimization it can get). */
+
+volatile int dummy;
+
+do
+ {
+ const uschar *tcode = code + 3;
+ BOOL try_next = TRUE;
+
+ while (try_next)
+ {
+ try_next = FALSE;
+
+ /* If a branch starts with a bracket or a positive lookahead assertion,
+ recurse to set bits from within them. That's all for this branch. */
+
+ if ((int)*tcode >= OP_BRA || *tcode == OP_ASSERT)
+ {
+ if (!set_start_bits(tcode, start_bits, caseless, cd))
+ return FALSE;
+ }
+
+ else switch(*tcode)
+ {
+ default:
+ return FALSE;
+
+ /* Skip over lookbehind and negative lookahead assertions */
+
+ case OP_ASSERT_NOT:
+ case OP_ASSERTBACK:
+ case OP_ASSERTBACK_NOT:
+ try_next = TRUE;
+ do tcode += (tcode[1] << 8) + tcode[2]; while (*tcode == OP_ALT);
+ tcode += 3;
+ break;
+
+ /* Skip over an option setting, changing the caseless flag */
+
+ case OP_OPT:
+ caseless = (tcode[1] & PCRE_CASELESS) != 0;
+ tcode += 2;
+ try_next = TRUE;
+ break;
+
+ /* BRAZERO does the bracket, but carries on. */
+
+ case OP_BRAZERO:
+ case OP_BRAMINZERO:
+ if (!set_start_bits(++tcode, start_bits, caseless, cd))
+ return FALSE;
+ dummy = 1;
+ do tcode += (tcode[1] << 8) + tcode[2]; while (*tcode == OP_ALT);
+ tcode += 3;
+ try_next = TRUE;
+ break;
+
+ /* Single-char * or ? sets the bit and tries the next item */
+
+ case OP_STAR:
+ case OP_MINSTAR:
+ case OP_QUERY:
+ case OP_MINQUERY:
+ set_bit(start_bits, tcode[1], caseless, cd);
+ tcode += 2;
+ try_next = TRUE;
+ break;
+
+ /* Single-char upto sets the bit and tries the next */
+
+ case OP_UPTO:
+ case OP_MINUPTO:
+ set_bit(start_bits, tcode[3], caseless, cd);
+ tcode += 4;
+ try_next = TRUE;
+ break;
+
+ /* At least one single char sets the bit and stops */
+
+ case OP_EXACT: /* Fall through */
+ tcode++;
+
+ case OP_CHARS: /* Fall through */
+ tcode++;
+
+ case OP_PLUS:
+ case OP_MINPLUS:
+ set_bit(start_bits, tcode[1], caseless, cd);
+ break;
+
+ /* Single character type sets the bits and stops */
+
+ case OP_NOT_DIGIT:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= ~cd->cbits[c+cbit_digit];
+ break;
+
+ case OP_DIGIT:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= cd->cbits[c+cbit_digit];
+ break;
+
+ case OP_NOT_WHITESPACE:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= ~cd->cbits[c+cbit_space];
+ break;
+
+ case OP_WHITESPACE:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= cd->cbits[c+cbit_space];
+ break;
+
+ case OP_NOT_WORDCHAR:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= ~(cd->cbits[c] | cd->cbits[c+cbit_word]);
+ break;
+
+ case OP_WORDCHAR:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= (cd->cbits[c] | cd->cbits[c+cbit_word]);
+ break;
+
+ /* One or more character type fudges the pointer and restarts, knowing
+ it will hit a single character type and stop there. */
+
+ case OP_TYPEPLUS:
+ case OP_TYPEMINPLUS:
+ tcode++;
+ try_next = TRUE;
+ break;
+
+ case OP_TYPEEXACT:
+ tcode += 3;
+ try_next = TRUE;
+ break;
+
+ /* Zero or more repeats of character types set the bits and then
+ try again. */
+
+ case OP_TYPEUPTO:
+ case OP_TYPEMINUPTO:
+ tcode += 2; /* Fall through */
+
+ case OP_TYPESTAR:
+ case OP_TYPEMINSTAR:
+ case OP_TYPEQUERY:
+ case OP_TYPEMINQUERY:
+ switch(tcode[1])
+ {
+ case OP_NOT_DIGIT:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= ~cd->cbits[c+cbit_digit];
+ break;
+
+ case OP_DIGIT:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= cd->cbits[c+cbit_digit];
+ break;
+
+ case OP_NOT_WHITESPACE:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= ~cd->cbits[c+cbit_space];
+ break;
+
+ case OP_WHITESPACE:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= cd->cbits[c+cbit_space];
+ break;
+
+ case OP_NOT_WORDCHAR:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= ~(cd->cbits[c] | cd->cbits[c+cbit_word]);
+ break;
+
+ case OP_WORDCHAR:
+ for (c = 0; c < 32; c++)
+ start_bits[c] |= (cd->cbits[c] | cd->cbits[c+cbit_word]);
+ break;
+ }
+
+ tcode += 2;
+ try_next = TRUE;
+ break;
+
+ /* Character class: set the bits and either carry on or not,
+ according to the repeat count. */
+
+ case OP_CLASS:
+ {
+ tcode++;
+ for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];
+ tcode += 32;
+ switch (*tcode)
+ {
+ case OP_CRSTAR:
+ case OP_CRMINSTAR:
+ case OP_CRQUERY:
+ case OP_CRMINQUERY:
+ tcode++;
+ try_next = TRUE;
+ break;
+
+ case OP_CRRANGE:
+ case OP_CRMINRANGE:
+ if (((tcode[1] << 8) + tcode[2]) == 0)
+ {
+ tcode += 5;
+ try_next = TRUE;
+ }
+ break;
+ }
+ }
+ break; /* End of class handling */
+
+ } /* End of switch */
+ } /* End of try_next loop */
+
+ code += (code[1] << 8) + code[2]; /* Advance to next branch */
+ }
+while (*code == OP_ALT);
+return TRUE;
+}
+
+
+
+/*************************************************
+* Study a compiled expression *
+*************************************************/
+
+/* This function is handed a compiled expression that it must study to produce
+information that will speed up the matching. It returns a pcre_extra block
+which then gets handed back to pcre_exec().
+
+Arguments:
+ re points to the compiled expression
+ options contains option bits
+ errorptr points to where to place error messages;
+ set NULL unless error
+
+Returns: pointer to a pcre_extra block,
+ NULL on error or if no optimization possible
+*/
+
+pcre_extra *
+pcre_study(const pcre *external_re, int options, const char **errorptr)
+{
+uschar start_bits[32];
+real_pcre_extra *extra;
+const real_pcre *re = (const real_pcre *)external_re;
+compile_data compile_block;
+
+*errorptr = NULL;
+
+if (re == NULL || re->magic_number != MAGIC_NUMBER)
+ {
+ *errorptr = "argument is not a compiled regular expression";
+ return NULL;
+ }
+
+if ((options & ~PUBLIC_STUDY_OPTIONS) != 0)
+ {
+ *errorptr = "unknown or incorrect option bit(s) set";
+ return NULL;
+ }
+
+/* For an anchored pattern, or an unchored pattern that has a first char, or a
+multiline pattern that matches only at "line starts", no further processing at
+present. */
+
+if ((re->options & (PCRE_ANCHORED|PCRE_FIRSTSET|PCRE_STARTLINE)) != 0)
+ return NULL;
+
+/* Set the character tables in the block which is passed around */
+
+compile_block.lcc = re->tables + lcc_offset;
+compile_block.fcc = re->tables + fcc_offset;
+compile_block.cbits = re->tables + cbits_offset;
+compile_block.ctypes = re->tables + ctypes_offset;
+
+/* See if we can find a fixed set of initial characters for the pattern. */
+
+memset(start_bits, 0, 32 * sizeof(uschar));
+if (!set_start_bits(re->code, start_bits, (re->options & PCRE_CASELESS) != 0,
+ &compile_block)) return NULL;
+
+/* Get an "extra" block and put the information therein. */
+
+extra = (real_pcre_extra *)(pcre_malloc)(sizeof(real_pcre_extra));
+
+if (extra == NULL)
+ {
+ *errorptr = "failed to get memory";
+ return NULL;
+ }
+
+extra->options = PCRE_STUDY_MAPPED;
+memcpy(extra->start_bits, start_bits, sizeof(start_bits));
+
+return (pcre_extra *)extra;
+}
+
+/* End of study.c */
diff --git a/setedit/librhuti/abstorel.cc b/setedit/librhuti/abstorel.cc
new file mode 100644
index 0000000..dd90cec
--- /dev/null
+++ b/setedit/librhuti/abstorel.cc
@@ -0,0 +1,137 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <stdio.h>
+#include <rhutils.h>
+#include <string.h>
+
+/*
+ This functions makes ret_path relative to ref_path
+ It assumes that ref_path is an absolute path which can
+ optionally have a slash appended
+*/
+
+int AbsToRelPath(char *ref_path,char *& ret_path, const char *subst)
+{
+ char *ref = ref_path;
+ char *ret;
+ char *ret_val;
+ // Just in case, that ret_pat is not absolute, make it now absolute
+ // relative to the current directory
+ if (!ref_path || !*ref_path) return 0;
+ ret = ret_path;
+ while (*ret && *ret == *ref)
+ {
+ ret++;
+ ref++;
+ }
+ // total different
+ if (ret == ret_path)
+ return 0;
+ // ref is part of ret
+ if (!*ref)
+ {
+ // they are equal (can happen only when comparing directories)
+ if (!*ret)
+ {
+ string_free(ret_path);
+ if (subst)
+ string_dup(ret_path, subst);
+ else
+ string_dup(ret_path,"");
+ return 1;
+ }
+ // ref is completely a directory part of ret
+ if (*ret == '/' || ref[-1] == '/' /* ref had a slash as last char */)
+ {
+ // do no copy the slash
+ if (*ret == '/') ret++;
+ if (subst)
+ {
+ string_dup(ret_val, subst);
+ string_cat(ret_val, "/", ret, NULL);
+ }
+ else
+ string_dup(ret_val,ret);
+ string_free(ret_path);
+ ret_path = ret_val;
+ return 1;
+ }
+ // ref was only a sub_string of ret
+ while (*ret != '/')
+ {
+ ret--;
+ ref--;
+ }
+ ret++;
+ ref++;
+ }
+ // ret is part of ref
+ if (!*ret)
+ {
+ // ret is completely a directoy part of ref
+ if (*ref == '/')
+ {
+ ref++;
+ string_dup(ret_val,"..");
+ while ((ref = strchr(ref,'/')) != NULL)
+ {
+ ref++;
+ string_cat(ret_val,"/..");
+ }
+ string_free(ret_path);
+ ret_path = ret_val;
+ return 1;
+ }
+ // ret was simply a substring of ref
+ while (*ret != '/')
+ {
+ ref--;
+ ret--;
+ }
+ ref++;
+ ret++;
+ }
+ while (*ref != '/' || *ret != '/')
+ {
+ ref--;
+ ret--;
+ }
+ ref++;
+ ret++;
+ string_dup(ret_val,"..");
+ while ((ref = strchr(ref,'/')) != NULL)
+ {
+ string_cat(ret_val,"/..");
+ ref++;
+ }
+ if (*ret)
+ {
+ string_cat(ret_val,"/");
+ string_cat(ret_val,ret);
+ }
+ string_free(ret_path);
+ ret_path = ret_val;
+ return 1;
+}
+
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int main(int argc,char *argv[])
+{
+ char *ref;
+ char *ret;
+ int retf;
+ if (argc < 3) return -1;
+ string_dup(ref,argv[1]);
+ string_dup(ret,argv[2]);
+ fprintf(stderr, "%s relative to %s is ",ret,ref);
+ retf=AbsToRelPath(ref,ret,0);
+ fprintf(stderr, "%s (%d)\n",ret,retf);
+ return 0;
+}
+
+#endif
+
diff --git a/setedit/librhuti/back2sl.cc b/setedit/librhuti/back2sl.cc
new file mode 100644
index 0000000..e50ed1d
--- /dev/null
+++ b/setedit/librhuti/back2sl.cc
@@ -0,0 +1,15 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <stdio.h>
+#include <rhutils.h>
+#include <string.h>
+
+void BackslashToSlash(char * name)
+{
+ char *tmp;
+ if (!name || !*name) return;
+ while ((tmp = strchr(name,'\\')) != NULL) *tmp = '/';
+}
+
+
+
diff --git a/setedit/librhuti/basename.cc b/setedit/librhuti/basename.cc
new file mode 100644
index 0000000..8f5fae2
--- /dev/null
+++ b/setedit/librhuti/basename.cc
@@ -0,0 +1,65 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <rhutils.h>
+
+/**[txh]********************************************************************
+
+ Function: BaseName
+ Include: rhutils.h
+ Prototype: void BaseName(char *name, int with_suffix = 1)
+ Description: Removes any directory part of 'name'. Set 'with_suffix'
+ to 0 to remove also the suffix.
+
+***************************************************************************/
+
+void BaseName(char *name, int with_suffix)
+{
+ char *_name = strrchr(name,'/');
+ if (!_name)
+ _name = name;
+ else
+ _name++;
+ if (!with_suffix)
+ {
+ char *ext = strrchr(_name,'.');
+ if (ext)
+ *ext = 0;
+ }
+ if (_name != name)
+ strcpy(name,_name);
+}
+
+/**[txh]********************************************************************
+
+ Function: BaseName
+ Prototype: void BaseName(const char *name, char *&bname, int with_suffix)
+ Description: The same as @x{BaseName}, but here the result is stored in the
+ newly allocated 'bname'.
+
+***************************************************************************/
+
+void BaseName(const char *name, char *&bname, int with_suffix)
+{
+ const char *_name = strrchr(name,'/');
+ if (!_name)
+ _name = name;
+ else
+ _name++;
+ const char *ext = _name + strlen(_name);
+ if (!with_suffix)
+ {
+ const char *_ext = strrchr(_name,'.');
+ if (_ext)
+ ext = _ext;
+ }
+ int len = ext - _name;
+ bname = (char *)malloc(len+1);
+ memcpy(bname, _name, len);
+ bname[len] = 0;
+}
+
+
+
diff --git a/setedit/librhuti/expvar.cc b/setedit/librhuti/expvar.cc
new file mode 100644
index 0000000..650c2a9
--- /dev/null
+++ b/setedit/librhuti/expvar.cc
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <rhutils.h>
+#include <string.h>
+
+char *expand_variables(char *&x)
+{
+ char *var,*var_end,*env;
+ char *buffer;
+ char *xptr,*bptr;
+ if (!strchr(*x,'$')) return *x;
+ buffer = _static_buffer;
+ xptr = *x;
+ bptr = buffer;
+ while (*xptr)
+ {
+ if (*xptr == '$' && xptr[1] == '(')
+ {
+ char old;
+ var = xptr+2;
+ var_end = var+1;
+ while (*var_end && *var_end != ')') var_end++;
+ old = *var_end;
+ *var_end = 0;
+ env = getenv(var);
+ *var_end = old;
+ if (env)
+ {
+ while (*env)
+ {
+ *bptr++ = *env++;
+ }
+ xptr = var_end+1;
+ continue;
+ }
+ *bptr++ = *xptr++;
+ }
+ else
+ {
+ *bptr++ = *xptr++;
+ }
+ }
+ *bptr = 0;
+ string_free(*x);
+ string_dup(*x,buffer);
+ return *x;
+}
+
diff --git a/setedit/librhuti/fexpand.cc b/setedit/librhuti/fexpand.cc
new file mode 100644
index 0000000..f4c7006
--- /dev/null
+++ b/setedit/librhuti/fexpand.cc
@@ -0,0 +1,24 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#define Uses_fixpath
+#define Uses_string
+#define Uses_stdio
+#include <compatlayer.h>
+#include <rhutils.h>
+
+static char _static_buffer[2048]; // this should be enough
+
+void FExpand(char * & name,int new_alloc)
+{
+ char *fname = _static_buffer;
+ _fixpath(name,fname);
+ if (new_alloc)
+ {
+ string_free(name);
+ string_dup(name,fname);
+ }
+ else strcpy(name,fname);
+}
+
+
+
diff --git a/setedit/librhuti/io.cc b/setedit/librhuti/io.cc
new file mode 100644
index 0000000..ef49af2
--- /dev/null
+++ b/setedit/librhuti/io.cc
@@ -0,0 +1,174 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* Copyright (C) 1998-2005 Salvador E. Tropea */
+/* This file is part of RHIDE. */
+#define Uses_string
+#define Uses_unistd
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_sys_stat
+#define Uses_fcntl
+#define Uses_free
+#define Uses_mkstemp
+#include <compatlayer.h>
+#include <rhutils.h>
+
+#define STDOUT 1
+#define STDERR 2
+
+static char *errname = NULL;
+static char *outname = NULL;
+static char *erroutname = NULL;
+static int h_out,h_outbak;
+static int h_err,h_errbak;
+
+/* returns a malloced unique tempname in $TMPDIR */
+char *unique_name(char *before, char *retval)
+{
+ char *name;
+ int h=unique_name(0,name,before,retval);
+ if (h!=-1)
+ close(h);
+ return name;
+}
+
+/* returns a malloced unique tempname in $TMPDIR */
+FILE *unique_name_f(char *&retname, char *before, char *retval)
+{
+ char *name;
+ int h=unique_name(1,name,before,retval);
+ if (h!=-1)
+ {
+ retname=name;
+ return fdopen(h,"w+");
+ }
+ return NULL;
+}
+
+/* returns a malloced unique tempname in $TMPDIR */
+int unique_name(int remove, char *&retname, char *before, char *retval)
+{
+ char *name,*tmp = getenv("TMPDIR");
+ // SET: The next 2 fallbacks aren't usually needed because RHIDE and SETEdit
+ // defines TMPDIR. SAA added them and I keep it because they make more
+ // robust the code if anybody uses the library in another project.
+ if (!tmp) tmp = getenv("TEMP");
+ if (!tmp) tmp = getenv("TMP");
+ if (!tmp) tmp = ".";
+ int l=strlen(tmp);
+ if (retval)
+ {
+ strcpy(retval,tmp);
+ if (!CLY_IsValidDirSep(tmp[l-1]))
+ strcat(retval,DIRSEPARATOR_);
+ strcat(retval,before);
+ strcat(retval,"XXXXXX");
+ name = string_dup(retval);
+ }
+ else
+ {
+ string_dup(name,tmp);
+ if (!CLY_IsValidDirSep(tmp[l-1]))
+ string_cat(name,DIRSEPARATOR_);
+ string_cat(name,before);
+ string_cat(name,"XXXXXX");
+ }
+ /* SET: Modified to use mkstemp because mktemp is dangerous */
+ int handler=mkstemp(name);
+ if (handler!=-1)
+ {
+ if (retval) strcpy(retval,name);
+ retname=name;
+ #ifdef TVOS_UNIX
+ if (remove) unlink(name);
+ #endif
+ return handler;
+ }
+ free(name);
+ retname=NULL;
+ return -1; // What to do here?
+}
+
+char *open_stderr(int *nherr)
+{
+ if (errname) free(errname);
+ errname = unique_name("er");
+ h_err = open (errname,O_WRONLY | O_BINARY | O_CREAT | O_TRUNC,
+ S_IREAD | S_IWRITE);
+ h_errbak = dup (STDERR);
+ fflush(stderr); /* so any buffered chars will be written out */
+ dup2 (h_err, STDERR);
+ if (nherr)
+ *nherr=h_err;
+ return errname;
+}
+
+char *open_stderr(void)
+{
+ return open_stderr(NULL);
+}
+
+void close_stderr(void)
+{
+ dup2 (h_errbak, STDERR);
+ close (h_err);
+ close (h_errbak);
+}
+
+char *open_stdout(void)
+{
+ if (outname) free(outname);
+ outname = unique_name("ou");
+ h_out = open (outname,O_WRONLY | O_BINARY | O_CREAT | O_TRUNC,
+ S_IREAD | S_IWRITE);
+ h_outbak = dup (STDOUT);
+ fflush(stdout); /* so any buffered chars will be written out */
+ dup2 (h_out, STDOUT);
+ return outname;
+}
+
+void close_stdout(void)
+{
+ dup2 (h_outbak, STDOUT);
+ close (h_out);
+ close (h_outbak);
+}
+
+char *open_stderr_out(int *nherr)
+{
+ if (erroutname) free(erroutname);
+ erroutname = unique_name("eo");
+ h_err = open (erroutname,O_WRONLY | O_BINARY | O_CREAT | O_TRUNC,
+ S_IREAD | S_IWRITE);
+ h_errbak = dup(STDERR);
+ h_outbak = dup(STDOUT);
+ fflush(stderr); /* so any buffered chars will be written out */
+ fflush(stdout); /* so any buffered chars will be written out */
+ if (nherr)
+ *nherr=h_err;
+ return erroutname;
+}
+
+char *open_stderr_out(void)
+{
+ open_stderr_out(NULL);
+ dup2(h_err,STDERR);
+ dup2(h_err,STDOUT);
+ return erroutname;
+}
+
+void close_stderr_out(void)
+{
+ dup2(h_errbak,STDERR);
+ dup2(h_outbak,STDOUT);
+ close (h_err);
+ close (h_errbak);
+ close (h_outbak);
+}
+
+void op_cl_std_clean_up(void)
+{
+ free(errname);
+ free(outname);
+ free(erroutname);
+}
+
diff --git a/setedit/librhuti/rhutils.h b/setedit/librhuti/rhutils.h
new file mode 100644
index 0000000..2576ff8
--- /dev/null
+++ b/setedit/librhuti/rhutils.h
@@ -0,0 +1,196 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* Copyright (C) 1998-2005 Salvador E. Tropea */
+/* This file is part of RHIDE. */
+#ifndef __rhutils_h
+#define __rhutils_h
+
+#ifndef __cplusplus
+#error You can use these functions only in C++ programs!!
+#endif
+
+/* return a malloced string 'src'. When scr=NULL return malloced "" */
+char *string_dup(const char *src);
+/* the same as above, but store the result also in 'dest' */
+char *string_dup(char *&dest, const char *src);
+/* convert 'str' to lowercase */
+char *string_down(char *str);
+/* convert 'str' to uppercase */
+char *string_up(char *str);
+
+/* expand_spec expands the spec 'spec' which can be $(VARIABLE) and
+ or $(function [args]). Additionally you can pass a function which
+ is called when the builtin specs do not match to define your own
+ specs and/or special variables. The 'ext_func' function is called
+ in the second argument with the internal function of
+ 'expand_spec' which does the real expansion so you can use in your
+ code also references to the standard expansion code.
+
+ If you set the last argument to nonzero, the external function
+ is called before any builtin function, otherwise it is called
+ last.
+ */
+typedef char *(*token_func)(char *);
+typedef char *(*external_token_func)(const char *, token_func);
+/* This returns a malloced string ever!!
+ Currently it knows about the following string_functions. (For
+ a description of them please look in the GNU Make doc, because
+ the functionallity is the same (new functions have a small comment):
+
+ $(strip TEXT)
+ $(addsuffix suffix,TEXT)
+ $(addprefix prefix,TEXT)
+ $(notdir filename)
+ $(dir filename)
+ $(subst from,to,TEXT)
+ $(suffix filename)
+ $(nosuffix filename) this removes the suffix (if any) from 'filename'
+ $(setsuffix suffix,filename) thsi replaces (or add) the 'suffix' for 'filename'
+ $(sort TEXT)
+ $(foreach variable,list,command)
+ $(shell command)
+ $(wildcard WILDCARD)
+ $(word nr,TEXT)
+*/
+char *expand_spec(const char *spec, external_token_func ext_func,
+ int expand_extern_first = 0);
+
+/*
+ Set this to a function, which is called for each newline '\n'
+ character.
+*/
+extern void (*handle_newline)();
+
+/*
+ Set this variable to 0, if variable-names itself should not
+ be expanded, i.e. treat $(var$(other)) as a variable with the
+ name 'var$(other)', otherwise $(other) is expande to lets say
+ 'foo' and $(var$(other)) becomes to $(varfoo) */
+extern int expand_variable_names;
+
+/* Some helper functions for 'expand_spec' which expand _ONLY_ variables,
+ and no string functions or external specs. The first simply calls the
+ second with 'use_env=1' and the 'use_env' of the second functions can
+ be used to disable the search in the real environment for the wanted
+ variable by setting it to zero. */
+//const char * GetVariable(const char *variable);
+//const char * GetVariable(const char *variable,int use_env);
+void set_variable(const char *variable, const char *contents);
+
+/* Array of strings with the internal variables with the organization
+ vars[i] - variable name
+ vars[i+1] - variable contents
+*/
+extern char **vars;
+/* The count of the variables (Note that this is the variable count and
+ _NOT_ the string count in 'vars') */
+extern int var_count;
+
+/* set this to nonzero to print to stderr debug information about expanding
+ the specs */
+extern int debug_specs;
+
+/* Add a variable 'variable' with contents 'contents'. If 'contents==NULL',
+ then the variable is removed. */
+void insert_variable(const char *variable, const char *contents);
+
+/* Some helper functions: 'open_brace' points to an opening brace
+ or parenthesis and return the matching closing character or
+ NULL if not found */
+char *find_close_brace(char *open_brace);
+/* Find the next comma in the string where it knows about quoting characters
+ '\'' and '"' or return NULL if no comma was found */
+char *find_next_comma(char *arg);
+
+/* Split a given filename in its parts given in the format string 'fmt'
+ similar to scanf. The results are stored in the paramters you have
+ to pass in '...' (for each format spec one 'char *'). Possible format
+ codes are:
+
+ %D - drive + directory (drive of course only on DJGPP)
+ %d - directory
+ %f - filename + suffix
+ %F - filename without suffix
+ %e - suffix
+*/
+void split_fname_fmt(const char *filename, const char *fmt, ...);
+
+/* Append 'src' to 'dest' and return 'dest' (malloced or realloced
+ strings) */
+char *string_cat(char *&dest, const char *src);
+/* The same as above, but with variable count of arguments.
+ _NOTE_: The last argument must be NULL!!!! */
+char *string_cat(char *&, const char *src1, const char *src2, ...);
+/* Free 'str' and set it to NULL */
+void string_free(char *&str);
+/* Remove any directory part in 'name' and when 'with_suffix==0' also
+ the suffix */
+void BaseName(char *name, int with_suffix = 1);
+/* The same as above, but store the result in the malloced 'bname' */
+void BaseName(const char *name, char *&bname, int with_suffix = 1);
+/* Convert any '\' to '/' in 'name' */
+void BackslashToSlash(char * name);
+/* split the given filename 'fname' in its components and return them
+ malloc'd. If the filename contained a drive letter and colon, it will
+ be part of 'dir'. */
+void split_fname(const char *fname, char *&dir, char *&name, char *&ext);
+/* The same as above, except that the drive letter is stored in 'drive'.
+ If there is no drive letter, 'drive' will be zero. 'dir' will contain
+ only the directory and not (if any) drive and colon. */
+void split_fname(const char *fname, char &drive, char *&dir, char *&name,
+ char *&ext);
+/* Expands an given name 'name' to an absolute filename relative to the
+ current directory. If it was
+ already absolute nothing is done. If 'new_alloc==0' the 'name' is
+ not realloced */
+void FExpand(char * & name,int new_alloc=1);
+
+/*
+ I moved it to compat layer library. We had 2 copies!
+ Very usefull function from DJGPP's libc, which "fixes" the path 'in'
+ and placing it in 'out'. If 'in' is a relative filename it is made
+ absolute to the current directory. Example:
+
+ char Out[256];
+ __fixpath("/foo/foo1/../.././foo",Out);
+
+ will return "/foo" in 'Out'
+#ifndef TVCompf_djgpp
+void __fixpath(const char *in, char *out);
+#endif
+*/
+
+/* Some functions for redirecting stdout and stderr. They cannot
+ be called nested!!! */
+/* redirect stderr to a file and return the name of that file */
+char * open_stderr(void);
+char * open_stderr(int *nherr);
+/* the same for stdout */
+char * open_stdout(void);
+/* close the redirected stderr */
+void close_stderr(void);
+/* the same for stdout */
+void close_stdout(void);
+/* SET: that's for stderr and stdout redirected to the same file */
+char *open_stderr_out(void);
+char *open_stderr_out(int *nherr); // Without dup2
+void close_stderr_out(void);
+/* SET: can be used to shut-up leak reporters */
+void op_cl_std_clean_up(void);
+
+/* Return an unique filename in $TMPDIR which starts with 'before'.
+ Store the result also in 'retval' if it is != NULL. This function
+ creates the file to make sure that it is really unique. That means
+ the application is responsible for deleting this file */
+char *unique_name(char *before,char *retval=NULL);
+/* Returns the file already opened and unlinked for UNIX */
+FILE *unique_name_f(char *&retname, char *before, char *retval=NULL);
+/* The base for the above functions */
+int unique_name(int remove, char *&retname, char *before, char *retval=NULL);
+
+/* This functions makes ret_path relative to ref_path
+ It assumes that ref_path is an absolute path which can
+ optionally have a slash appended */
+int AbsToRelPath(char *ref_path,char *& ret_path, const char *subst);
+#endif /* __rhutils_h */
+
+
diff --git a/setedit/librhuti/specs.cc b/setedit/librhuti/specs.cc
new file mode 100644
index 0000000..6a0d74a
--- /dev/null
+++ b/setedit/librhuti/specs.cc
@@ -0,0 +1,890 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+
+/* This code isn't used by SETEdit, just disabled. */
+#if 0
+
+#include <rhutils.h>
+#define Uses_stdio
+#define Uses_glob
+#define Uses_alloca
+#define Uses_string
+#define Uses_stdlib
+#include <compatlayer.h>
+
+#ifdef USE_REGPARM
+#define A(n) __attribute__ (( regparm(n) ))
+#else
+#define A(n)
+#endif
+
+const char * GetVariable(const char *variable);
+const char * GetVariable(const char *variable,int use_env);
+
+static void _handle_newline();
+void (*handle_newline)() = _handle_newline;
+int expand_variable_names = 1;
+char **vars = NULL;
+int var_count = 0;
+static int var_size = 0;
+/* set this nonzero to print to stderr, how the specs
+ are expanded */
+int debug_specs = 0;
+
+static void _handle_newline()
+{
+}
+
+static void
+_add_variable(char **&_vars, int & _var_count, int & _var_size,
+ const char *variable, const char *contents)
+{
+ /* Special case when contents==NULL, remove that variable */
+ if (!contents)
+ {
+ int i;
+ for (i=_var_count;i>0;i--)
+ {
+ int j=(i-1)*2;
+ if (strcmp(_vars[j],variable) == 0)
+ {
+ string_free(_vars[j]);
+ string_free(_vars[j+1]);
+ if (i<_var_count)
+ {
+ memcpy(_vars+j,_vars+j+2,(_var_count-i)*sizeof(char *)*2);
+ }
+ _var_count--;
+ break;
+ }
+ }
+ return;
+ }
+ if (_var_count == _var_size)
+ {
+ _var_size += 16;
+ _vars = (char **)realloc(_vars,_var_size*2*sizeof(char *));
+ }
+ _var_count++;
+ string_dup(_vars[_var_count*2-2],variable);
+ string_dup(_vars[_var_count*2-1],contents);
+}
+
+static void
+_set_variable(char **_vars, int _var_count, const char *variable,
+ const char *contents)
+{
+ int i;
+ for (i=_var_count;i>0;i--)
+ {
+ int j = (i-1)*2;
+ if (strcmp(_vars[j],variable) == 0)
+ {
+ string_free(_vars[j+1]);
+ _vars[j+1] = string_dup(contents);
+ return;
+ }
+ }
+}
+
+static const char *
+_get_variable(char **_vars, int _var_count, const char *variable)
+{
+ int i;
+ for (i=_var_count;i>0;i--)
+ {
+ int j=(i-1)*2;
+ if (strcmp(_vars[j],variable) == 0)
+ return _vars[j+1];
+ }
+ return NULL;
+}
+
+void insert_variable(const char *variable,const char *contents)
+{
+ _add_variable(vars, var_count, var_size, variable, contents);
+}
+
+void set_variable(const char *variable, const char *contents)
+{
+ _set_variable(vars, var_count, variable, contents);
+}
+
+static int internal_var_count = 0;
+static int internal_var_size = 0;
+static char **internal_vars = NULL;
+
+static void add_internal_var(const char *name,const char *value)
+{
+ _add_variable(internal_vars, internal_var_count, internal_var_size,
+ name, value);
+}
+
+static void remove_internal_var(const char *name)
+{
+ _add_variable(internal_vars, internal_var_count, internal_var_size,
+ name, NULL);
+}
+
+static const char *
+get_internal_var(const char *name)
+{
+ return _get_variable(internal_vars, internal_var_count, name);
+}
+
+static void set_internal_var(const char *name,const char *value)
+{
+ if (!get_internal_var(name))
+ add_internal_var(name, value);
+ else
+ _set_variable(internal_vars, internal_var_count, name, value);
+}
+
+const char *RHGetVariable(const char *variable)
+{
+ return GetVariable(variable,1);
+}
+
+const char * GetVariable(const char *variable,int use_env)
+{
+ const char *ival = get_internal_var(variable);
+ if (!ival)
+ {
+ ival = _get_variable(vars, var_count, variable);
+ if (!ival && use_env)
+ ival = getenv(variable);
+ }
+ if (debug_specs)
+ {
+ fprintf(stderr,"GetVariable(%s,%d) ==> %s\n",variable,use_env,
+ ival?ival:"NULL");
+ }
+ return ival;
+}
+
+#ifdef TVCompf_djgpp
+extern char **environ;
+#endif
+
+typedef A(1) char *(*string_function)(char *);
+
+typedef struct
+{
+ char *name;
+ int name_len;
+ string_function function;
+} string_function_rec;
+
+static A(1)
+char *string_function_strip(char *);
+static A(1)
+char *string_function_addsuffix(char *);
+static A(1)
+char *string_function_addprefix(char *);
+static A(1)
+char *string_function_notdir(char *);
+static A(1)
+char *string_function_dir(char *);
+static A(1)
+char *string_function_subst(char *);
+static A(1)
+char *string_function_suffix(char *);
+static A(1)
+char *string_function_nosuffix(char *);
+static A(1)
+char *string_function_setsuffix(char *);
+static A(1)
+char *string_function_sort(char *);
+static A(1)
+char *string_function_foreach(char *);
+static A(1)
+char *string_function_shell(char *);
+static A(1)
+char *string_function_wildcard(char *);
+static A(1)
+char *string_function_word(char *);
+
+static string_function_rec string_function_list[] =
+{
+#define SF(x) {#x,sizeof(#x)-1,string_function_##x}
+ SF(strip),
+ SF(addsuffix),
+ SF(addprefix),
+ SF(notdir),
+ SF(dir),
+ SF(subst),
+ SF(suffix),
+ SF(nosuffix),
+ SF(setsuffix),
+ SF(sort),
+ SF(foreach),
+ SF(shell),
+ SF(wildcard),
+ SF(word),
+ {NULL,0,NULL}
+#undef SF
+};
+
+char *find_close_brace(char *open_brace)
+{
+ int brace_count = 1;
+ open_brace++;
+ while (brace_count > 0 && *open_brace)
+ {
+ if (*open_brace == '\\')
+ {
+ open_brace += 2;
+ continue;
+ }
+ if (*open_brace == ')') brace_count--;
+ else if (*open_brace == '(') brace_count++;
+ open_brace++;
+ }
+ if (brace_count != 0) return NULL;
+ return open_brace-1;
+}
+
+char *find_next_comma(char *arg)
+{
+ while (*arg)
+ {
+ if (*arg == '\\')
+ {
+ arg += 2;
+ continue;
+ }
+ if (*arg == ',') return arg;
+ if (*arg == '(')
+ {
+ arg = find_close_brace(arg+1);
+ if (!arg) return NULL;
+ }
+ arg++;
+ }
+ return NULL;
+}
+
+static
+external_token_func external_expand_token;
+
+static A(1)
+char *expand_tokens(char *tokens);
+
+static A(1)
+char *expand_variable(char *__token)
+{
+ char *token;
+
+ // At first expand the variable name itself, because it
+ // can be a computed variable like $(RHIDE_OS_LIBS_$(RHIDE_OS))
+ // which can be computed at runtime depending on the value
+ // of $(RHIDE_OS)
+ // if the expand_variable_names == 0, do not the above
+ char *end;
+ if (expand_variable_names && ((end = find_close_brace(__token+2)) != NULL))
+ {
+ char *_token;
+ *end = 0;
+ _token = expand_tokens(__token+2);
+ *end = ')';
+ token = (char *)alloca(strlen(_token)+4);
+ strcpy(token,"$(");
+ strcat(token,_token);
+ strcat(token,")");
+ string_free(_token);
+ }
+ else
+ {
+ token = (char *)alloca(strlen(__token)+1);
+ strcpy(token,__token);
+ }
+ end = token + strlen(token) - 1;
+ char *retval;
+ const char *variable;
+ *end = 0;
+ variable = GetVariable(token+2);
+ *end = ')';
+ if (!variable)
+ {
+ retval = NULL;
+ goto END;
+ }
+ string_dup(end,variable);
+ retval = expand_tokens(end);
+ string_free(end);
+END:
+ if (debug_specs)
+ {
+ fprintf(stderr,"expand_variable(%s) ==> %s\n",__token,
+ retval?retval:"NULL");
+ }
+ return retval;
+}
+
+static A(1)
+char *check_for_string_function(char *token)
+{
+ int i=0;
+ while (string_function_list[i].name)
+ {
+ int name_len = string_function_list[i].name_len;
+ if (strncmp(token+2,string_function_list[i].name,name_len) == 0
+ && token[2+name_len] == ' ')
+ {
+ char *start,*end,*expanded;
+ start = token + 3 + name_len;
+ end = token + strlen(token)-1;
+ *end = 0;
+#if 0
+/* I cannot expand the argument here, because at least the
+ foreach function expects the last argument unexpanded. If
+ I would expand it here, it would become probably empty.
+ That means, any string function is responsible for expanding
+ the arguments */
+ expanded = expand_tokens(start);
+ *end = ')';
+ end = string_function_list[i].function(expanded);
+ string_free(expanded);
+ return end;
+#else
+ expanded = string_function_list[i].function(start);
+ *end = ')';
+ return expanded;
+#endif
+ }
+ i++;
+ }
+ return NULL;
+}
+
+static int _call_extern_first = 0;
+
+static A(1)
+char *expand_token(char *token)
+{
+ char *retval = NULL;
+ if (_call_extern_first && external_expand_token)
+ retval = external_expand_token(token,expand_tokens);
+ if (!retval)
+ retval = check_for_string_function(token);
+ if (!retval)
+ retval = expand_variable(token);
+ if (!_call_extern_first && !retval && external_expand_token)
+ retval = external_expand_token(token,expand_tokens);
+ if (!retval) retval = string_dup("");
+ if (debug_specs)
+ {
+ fprintf(stderr,"expand_token(%s) ==> %s\n",token,retval);
+ }
+ return retval;
+}
+
+static A(1)
+char *expand_tokens(char *__tokens)
+{
+ char *start;
+ char *end,c;
+ char *tokens = __tokens;
+ char *_tokens=NULL;
+ char *expanded;
+ start = tokens;
+ while (*start)
+ {
+ if (*start == '\n')
+ handle_newline();
+ if (start[0] == '$' && start[1] == '(')
+ {
+ *start = 0;
+ string_cat(_tokens,tokens);
+ *start = '$';
+ end = find_close_brace(start+1);
+ if (!end)
+ {
+ string_cat(_tokens,start);
+ goto END;
+ }
+ end++;
+ c = *end;
+ *end = 0;
+ expanded = expand_token(start);
+ string_cat(_tokens,expanded);
+ string_free(expanded);
+ *end = c;
+ start = tokens = end;
+ }
+ else if (start[0] == '$' && start[1] == '$')
+ {
+ start++;
+ *start = 0;
+ string_cat(_tokens,tokens);
+ start++;
+ tokens = start;
+ }
+ else start++;
+ }
+ string_cat(_tokens,tokens);
+END:
+ if (debug_specs)
+ {
+ fprintf(stderr,"expand_tokens(%s) ==> %s\n",__tokens,
+ _tokens?_tokens:"NULL");
+ }
+ return _tokens;
+}
+
+char *expand_spec(const char *spec,external_token_func ext_func,
+ int call_extern_first)
+{
+ char *retval;
+ int __call_extern_first = _call_extern_first;
+ _call_extern_first = call_extern_first;
+ char *tokens = string_dup(spec);
+ external_token_func old_func = external_expand_token;
+ external_expand_token = ext_func;
+ retval = expand_tokens(tokens);
+ string_free(tokens);
+ external_expand_token = old_func;
+ _call_extern_first = __call_extern_first;
+ return retval;
+}
+
+static A(1)
+char *string_function_shell(char *_arg)
+{
+ #ifndef TVComp_BCPP
+ char *arg = expand_tokens(_arg);
+ char *retval = NULL;
+ char *err_file = open_stderr();
+ FILE *pipe = popen(arg,"r");
+ if (pipe)
+ {
+ char buf[1024];
+ int count;
+ while ((count = fread(buf,1,1023,pipe)))
+ {
+ char *tmp = buf;
+ while (count--)
+ {
+ if (*tmp == '\n' || *tmp == '\r')
+ *tmp = ' ';
+ tmp++;
+ }
+ *tmp = 0;
+ string_cat(retval,buf);
+ }
+ pclose(pipe);
+ }
+ string_free(arg);
+ if (!retval)
+ retval = string_dup("");
+ else
+ {
+ int len;
+ if (retval[len = strlen(retval)-1] == ' ')
+ retval[len] = 0;
+ }
+ close_stderr();
+ remove(err_file);
+ return retval;
+ #else
+ return (char*)"";
+ //$todo: implement
+ #endif
+}
+
+static A(1)
+char *string_function_foreach(char *arg)
+{
+ char *arg1;
+ char *arg2;
+ char *arg3;
+ char *retval = NULL;
+ char *tok;
+ char *expanded;
+ arg3 = find_next_comma(arg);
+ if (!arg3)
+ return NULL;
+ *arg3 = 0;
+ arg1 = expand_tokens(arg);
+ *arg3 = ',';
+ arg3 = find_next_comma(arg2 = (arg3+1));
+ if (!arg3)
+ {
+ string_free(arg1);
+ return NULL;
+ }
+ *arg3 = 0;
+ arg2 = expand_tokens(arg2);
+ *arg3 = ',';
+ arg3++;
+ tok = arg2;
+ while (1)
+ {
+ while (*tok && *tok == ' ') tok++;
+ if (!*tok) break;
+ char *_tok = tok;
+ while (*_tok && *_tok != ' ') _tok++;
+ char c = *_tok;
+ *_tok = 0;
+ set_internal_var(arg1,tok);
+ expanded = expand_tokens(arg3);
+ if (expanded && *expanded)
+ {
+ if (retval)
+ string_cat(retval," ");
+ string_cat(retval,expanded);
+ }
+ string_free(expanded);
+ *_tok = c;
+ tok = _tok;
+ }
+ remove_internal_var(arg1);
+ string_free(arg1);
+ string_free(arg2);
+ if (!retval)
+ retval = string_dup("");
+ return retval;
+}
+
+static A(1)
+char *string_function_strip(char *arg)
+{
+ char *retval;
+ char *tmp;
+ char quote_char = '\'';
+ int in_quote = 0;
+ retval = expand_tokens(arg);
+ tmp = retval;
+ while (*tmp && *tmp == ' ') tmp++;
+ strcpy(retval,tmp);
+ if (!*retval) return retval;
+ tmp =retval;
+ while (*tmp)
+ {
+ if (in_quote)
+ {
+ if (*tmp == quote_char) in_quote = 0;
+ tmp++;
+ continue;
+ }
+ if (*tmp == '\'' || *tmp == '"')
+ {
+ in_quote = 1;
+ quote_char = *tmp;
+ tmp++;
+ continue;
+ }
+ if (tmp[0] == ' ' && tmp[1] == ' ')
+ strcpy(tmp,tmp+1);
+ else tmp++;
+ }
+ tmp = retval + strlen(retval) - 1;
+ while (*tmp == ' ') tmp--;
+ tmp++;
+ *tmp = 0;
+ return retval;
+}
+
+static int search(char **items, int count, char *key, int &index)
+{
+ int h = count - 1;
+ int res = 0;
+ index = 0;
+ while( index <= h )
+ {
+ int i = (index + h) >> 1;
+ int c = strcmp(items[i], key);
+ if( c < 0 )
+ index = i + 1;
+ else
+ {
+ h = i - 1;
+ if( c == 0 )
+ {
+ res = 1;
+ index = i;
+ }
+ }
+ }
+ return res;
+}
+
+static void add_string(char **&strings, int &strings_count, char *string)
+{
+ int index=0;
+ if (strings_count && search(strings, strings_count, string, index))
+ return;
+ strings_count++;
+ strings = (char **)realloc(strings, strings_count*sizeof(char *));
+ memmove(strings+index+1, strings+index, (strings_count-index-1)*sizeof(char *));
+ strings[index] = string_dup(string);
+}
+
+static A(1)
+char *string_function_sort(char *_arg)
+{
+ char *arg = expand_tokens(_arg);
+ char *retval = NULL;
+ char *tok;
+ char **strings = NULL;
+ int strings_count = 0;
+ int i;
+ for (tok = strtok(arg," ");tok;tok=strtok(NULL," "))
+ {
+ add_string(strings, strings_count, tok);
+ }
+ for (i=0;i<strings_count;i++)
+ {
+ if (retval)
+ string_cat(retval," ");
+ string_cat(retval,strings[i]);
+ string_free(strings[i]);
+ }
+ if (!retval)
+ retval = string_dup("");
+ string_free(arg);
+ if (strings)
+ free(strings);
+ return retval;
+}
+
+static A(1)
+char *string_function_suffix(char *_arg)
+{
+ char *retval=NULL;
+ char *arg = expand_tokens(_arg);
+ char *tok;
+ for (tok = strtok(arg," ");tok;tok=strtok(NULL," "))
+ {
+ char *dot = strrchr(tok,'.');
+ if (!dot)
+ continue;
+ if (retval)
+ string_cat(retval," ");
+ string_cat(retval,dot);
+ }
+ if (!retval)
+ string_dup(retval,"");
+ string_free(arg);
+ return retval;
+}
+
+static A(1)
+char *string_function_nosuffix(char *_arg)
+{
+ char *retval = NULL;
+ char *arg = expand_tokens(_arg);
+ char *dot = strrchr(arg,'.');
+ if (dot)
+ {
+ char *slash = strrchr(arg, '/');
+ if (dot > slash)
+ *dot = 0;
+ }
+ retval = string_dup(arg);
+ string_free(arg);
+ return retval;
+}
+
+static A(1)
+char *string_function_setsuffix(char *arg)
+{
+ char *retval = NULL;
+ char *arg1,*arg2,*dot,*tmp;
+ tmp = find_next_comma(arg);
+ if (!tmp) return NULL;
+ *tmp = 0;
+ arg1 = expand_tokens(arg);
+ *tmp = ',';
+ tmp++;
+ arg2 = expand_tokens(tmp);
+ dot = strrchr(arg2,'.');
+ if (dot)
+ {
+ if (strrchr(arg2,'/') < dot)
+ *dot = 0;
+ }
+ retval = string_dup(arg2);
+ string_cat(retval,arg1);
+ string_free(arg1);
+ string_free(arg1);
+ return retval;
+}
+
+static A(2)
+char *string_function_add_pre_or_suffix(char *arg,int prefix)
+{
+ char *retval=NULL;
+ char *tmp;
+ char *arg1,*arg2;
+ char *tok;
+ tmp = find_next_comma(arg);
+ if (!tmp) return NULL;
+ *tmp = 0;
+ arg1 = expand_tokens(arg);
+ *tmp = ',';
+ tmp++;
+ arg2 = expand_tokens(tmp);
+ for (tok = strtok(arg2," ");tok;tok = strtok(NULL," "))
+ {
+ if (retval) string_cat(retval," ");
+ if (prefix)
+ {
+ string_cat(retval,arg1);
+ string_cat(retval,tok);
+ }
+ else
+ {
+ string_cat(retval,tok);
+ string_cat(retval,arg1);
+ }
+ }
+ string_free(arg1);
+ string_free(arg2);
+ if (!retval) // arg2 may be consist of only ws's or empty
+ {
+ string_dup(retval,"");
+ }
+ return retval;
+}
+
+static A(1)
+char *string_function_addprefix(char *arg)
+{
+ return string_function_add_pre_or_suffix(arg,1);
+}
+
+static A(1)
+char *string_function_addsuffix(char *arg)
+{
+ return string_function_add_pre_or_suffix(arg,0);
+}
+
+static A(1)
+char *string_function_notdir(char *_arg)
+{
+ char *retval;
+ char *arg = expand_tokens(_arg);
+ BaseName(arg,retval);
+ string_free(arg);
+ return retval;
+}
+
+static A(1)
+char *string_function_dir(char *_arg)
+{
+ char *dir,*name,*ext,*arg = expand_tokens(_arg);
+ split_fname(arg,dir,name,ext);
+ string_free(name);
+ string_free(ext);
+ string_free(arg);
+ return dir;
+}
+
+static A(1)
+char *string_function_subst(char *arg)
+{
+ char *arg1,*arg2,*arg3;
+ char *retval=NULL;
+ char *tmp,*temp;
+ int l_arg1;
+ tmp = find_next_comma(arg);
+ if (!tmp) return NULL;
+ arg3 = find_next_comma(tmp+1);
+ if (!arg3) return NULL;
+ *tmp = 0;
+ arg1 = expand_tokens(arg);
+ l_arg1 = strlen(arg1);
+ *tmp = ',';
+ tmp++;
+ *arg3 = 0;
+ arg2 = expand_tokens(tmp);
+ *arg3 = ',';
+ tmp = arg3+1;
+ arg3 = expand_tokens(tmp);
+ temp = arg3;
+ while (l_arg1 && (tmp = strstr(temp,arg1)) != NULL)
+ {
+ char c = *tmp;
+ *tmp = 0;
+ string_cat(retval,temp);
+ string_cat(retval,arg2);
+ *tmp = c;
+ temp = tmp + l_arg1;
+ }
+ if (*temp) string_cat(retval,temp);
+ string_free(arg1);
+ string_free(arg2);
+ string_free(arg3);
+ return retval;
+}
+
+#ifdef TVOSf_Linux
+#include <sys/stat.h>
+#endif
+
+static A(1)
+char *string_function_wildcard(char *arg)
+{
+ size_t cnt, i, first = 1;
+ glob_t glob_results;
+ char *retval = NULL;
+ char *wildcard = expand_tokens(arg);
+ if (glob(wildcard, GLOB_NOSORT, 0, &glob_results)
+ == 0)
+ {
+ cnt = glob_results.gl_pathc;
+ for (i=0; i<cnt; i++)
+ {
+ #ifdef TVOSf_Linux
+ /* glob() on linux returns the filename, if it contains no
+ meta characters even when it does not exist */
+ struct stat st;
+ if (stat(glob_results.gl_pathv[i], &st))
+ continue;
+ #endif
+ if (!first)
+ string_cat(retval, " ");
+ string_cat(retval, glob_results.gl_pathv[i]);
+ first = 0;
+ }
+ globfree(&glob_results);
+ }
+ else
+ retval = string_dup("");
+ string_free(wildcard);
+ return retval;
+}
+
+static A(1)
+char *string_function_word(char *_arg)
+{
+ int nr;
+ char *arg = expand_tokens(_arg);
+ char *retval = string_dup("");
+ char *arg2 = find_next_comma(arg);
+ char *tok;
+ if (!arg2)
+ goto end;
+ if (sscanf(arg, "%d", &nr) != 1)
+ goto end;
+ if (nr < 1)
+ goto end;
+ arg2++;
+ for (tok = strtok(arg2," ");tok;tok = strtok(NULL," "))
+ {
+ nr--;
+ if (!nr)
+ {
+ string_cat(retval, tok);
+ goto end;
+ }
+ }
+end:
+ string_free(arg);
+ return retval;
+}
+
+#endif
+
+
diff --git a/setedit/librhuti/splitfn.cc b/setedit/librhuti/splitfn.cc
new file mode 100644
index 0000000..68a497d
--- /dev/null
+++ b/setedit/librhuti/splitfn.cc
@@ -0,0 +1,134 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <rhutils.h>
+#define ucisalpha(a) isalpha((unsigned char)a)
+
+void split_fname(const char *fname, char &drive, char *&dir,
+ char *&name,char *&ext)
+{
+ const char *slash;
+ const char *dot = NULL;
+ const char *filename=fname;
+ if (ucisalpha(fname[0]) && fname[1] == ':')
+ {
+ drive = fname[0];
+ filename = fname+2;
+ }
+ else
+ drive = 0;
+ slash = strrchr(filename, '/');
+ if (slash)
+ dot = strrchr(slash, '.');
+ else
+ dot = strrchr(filename, '.');
+ if (slash)
+ {
+ int dirlen = (slash-filename)+1;
+ dir = (char *)malloc(dirlen+1);
+ strncpy(dir, filename, dirlen);
+ dir[dirlen] = 0;
+ }
+ else
+ dir = string_dup("");
+ if (dot)
+ {
+ if (!slash)
+ slash = filename;
+ else
+ slash++;
+ int namelen = (dot - slash);
+ name = (char *)malloc(namelen+1);
+ strncpy(name, slash, namelen);
+ name[namelen] = 0;
+ ext = string_dup(dot);
+ }
+ else
+ {
+ ext = string_dup("");
+ if (slash)
+ slash++;
+ else
+ slash = filename;
+ name = string_dup(slash);
+ }
+}
+
+/*
+ %D - drive + directory
+ %d - directory
+ %f - filename + suffix
+ %F - filename without suffix
+ %e - suffix
+*/
+
+void split_fname_fmt(const char *filename, const char *fmt, ...)
+{
+ char drive,*dir,*name,*ext,c,*arg=NULL;
+ va_list va;
+ va_start(va, fmt);
+ split_fname(filename,drive,dir,name,ext);
+ if (*fmt != '%')
+ goto end;
+ while ((c = *fmt++)!=0)
+ {
+ switch (c)
+ {
+ case '%':
+ arg = va_arg(va, char *);
+ if (!arg)
+ goto end;
+ *arg = 0;
+ break;
+ case 'D':
+ arg[0] = drive;
+ arg[1] = 0;
+ if (drive)
+ {
+ arg[1] = ':';
+ arg[2] = 0;
+ }
+ case 'd':
+ strcat(arg,dir);
+ break;
+ case 'F':
+ strcat(arg,name);
+ break;
+ case 'f':
+ strcat(arg,name);
+ case 'e':
+ strcat(arg,ext);
+ break;
+ default:
+ break;
+ }
+ }
+end:
+ va_end(va);
+ string_free(dir);
+ string_free(name);
+ string_free(ext);
+}
+
+void split_fname(const char *fname,char *&dir,char *&name,char *&ext)
+{
+ char drive;
+ split_fname(fname,drive,dir,name,ext);
+ if (drive)
+ {
+ char dr[2] = {drive,0};
+ char *_dir = string_dup(dr);
+ string_cat(_dir,":",dir,NULL);
+ string_free(dir);
+ dir = _dir;
+ }
+}
+
+
+
+
+
diff --git a/setedit/librhuti/stricat.cc b/setedit/librhuti/stricat.cc
new file mode 100644
index 0000000..26aaaee
--- /dev/null
+++ b/setedit/librhuti/stricat.cc
@@ -0,0 +1,46 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <rhutils.h>
+
+char *string_cat(char * &dest,const char *src)
+{
+ if (!dest)
+ {
+ string_dup(dest,src);
+ return dest;
+ }
+ if (!src)
+ return dest;
+ int l1 = strlen(dest), l2 = strlen(src);
+ dest = (char *)realloc(dest,l1+l2+1);
+ memcpy(dest+l1,src,l2+1);
+ return dest;
+}
+
+static void string_cat(char *&dest, va_list va)
+{
+ const char *arg;
+ while ((arg = va_arg(va, const char *)) != NULL)
+ {
+ string_cat(dest, arg);
+ }
+}
+
+char *string_cat(char *&dest, const char *src, const char *src1...)
+{
+ va_list va;
+ va_start(va, src1);
+ string_cat(dest, src);
+ string_cat(dest, src1);
+ string_cat(dest, va);
+ va_end(va);
+ return dest;
+}
+
+
+
+
diff --git a/setedit/librhuti/stridown.cc b/setedit/librhuti/stridown.cc
new file mode 100644
index 0000000..7aaea95
--- /dev/null
+++ b/setedit/librhuti/stridown.cc
@@ -0,0 +1,23 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <ctype.h>
+#include <stdio.h>
+#include <rhutils.h>
+#define uctolower(a) tolower((unsigned char)a)
+#define uctoupper(a) toupper((unsigned char)a)
+
+char *string_down(char * dest)
+{
+ if (!dest) return dest;
+ while (*dest) { *dest = uctolower(*dest); dest++; }
+ return dest;
+}
+
+char *string_up(char * dest)
+{
+ if (!dest) return dest;
+ while (*dest) { *dest = uctoupper(*dest); dest++; }
+ return dest;
+}
+
+
diff --git a/setedit/librhuti/stridup.cc b/setedit/librhuti/stridup.cc
new file mode 100644
index 0000000..9505067
--- /dev/null
+++ b/setedit/librhuti/stridup.cc
@@ -0,0 +1,30 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <rhutils.h>
+
+/*
+ This function is similar to strdup, but it returns
+ always an allocated string.
+ You can call it with an empty string or NULL
+*/
+char *string_dup(const char *src)
+{
+ char *dest;
+ if (!src || !*src)
+ {
+ dest = (char *)malloc(1);
+ *dest = 0;
+ }
+ else dest = strdup(src);
+ return dest;
+}
+
+char *string_dup(char *&dest, const char *src)
+{
+ return (dest = string_dup(src));
+}
+
+
diff --git a/setedit/librhuti/strifree.cc b/setedit/librhuti/strifree.cc
new file mode 100644
index 0000000..a95228f
--- /dev/null
+++ b/setedit/librhuti/strifree.cc
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996-1998 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+#include <stdlib.h>
+#include <stdio.h>
+#include <rhutils.h>
+
+void string_free(char * &dest)
+{
+ if (dest) free(dest);
+ dest = NULL;
+}
+
+
diff --git a/setedit/libz/.cvsignore b/setedit/libz/.cvsignore
new file mode 100644
index 0000000..550bd25
--- /dev/null
+++ b/setedit/libz/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+
diff --git a/setedit/libz/Makefile b/setedit/libz/Makefile
new file mode 100644
index 0000000..c1d8416
--- /dev/null
+++ b/setedit/libz/Makefile
@@ -0,0 +1,175 @@
+# Makefile for zlib
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# ./configure; make test
+# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+# make install
+# To install in $HOME instead of /usr/local, use:
+# make install prefix=$HOME
+
+CC=gcc
+
+CFLAGS=-O3 -fomit-frame-pointer -ffast-math -pipe
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+LDFLAGS=-L. -lz
+LDSHARED=$(CC)
+CPP=$(CC) -E
+
+VER=1.1.3
+LIBS=libz.a
+SHAREDLIB=libz.so
+
+AR=ar rc
+RANLIB=ranlib
+TAR=tar
+SHELL=/bin/sh
+
+prefix = /usr
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+includedir = ${prefix}/include
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+OBJA =
+# to use the asm code: make OBJA=match.o
+
+TEST_OBJS = example.o minigzip.o
+
+DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+ contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+ contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+ contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+ contrib/delphi*/*.???
+
+all: example minigzip
+
+test: all
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+libz.a: $(OBJS) $(OBJA)
+ $(AR) $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+
+$(SHAREDLIB).$(VER): $(OBJS)
+ $(LDSHARED) -o $@ $(OBJS)
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
+
+example: example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+
+minigzip: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+install: $(LIBS)
+ -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
+ -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
+ cp zlib.h zconf.h $(includedir)
+ chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+ cp $(LIBS) $(libdir)
+ cd $(libdir); chmod 755 $(LIBS)
+ -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+ cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
+ (ldconfig || true) >/dev/null 2>&1; \
+ fi
+# The ranlib in install is needed on NeXTSTEP which checks file times
+# ldconfig is for Linux
+
+uninstall:
+ cd $(includedir); \
+ v=$(VER); \
+ if test -f zlib.h; then \
+ v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
+ rm -f zlib.h zconf.h; \
+ fi; \
+ cd $(libdir); rm -f libz.a; \
+ if test -f $(SHAREDLIB).$$v; then \
+ rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
+ fi
+
+clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
+ _match.s maketree
+
+distclean: clean
+
+zip:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ zip -ul9 zlib$$v $(DISTFILES)
+ mv Makefile~ Makefile
+
+dist:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ rm -f $$d.tar.gz; \
+ if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+ files=""; \
+ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+ cd ..; \
+ GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ if test ! -d $$d; then rm -f $$d; fi
+ mv Makefile~ Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
+
diff --git a/setedit/libz/Makefile.bcc b/setedit/libz/Makefile.bcc
new file mode 100644
index 0000000..978033f
--- /dev/null
+++ b/setedit/libz/Makefile.bcc
@@ -0,0 +1,100 @@
+# Makefile for zlib for compiling by Borland C++ 5.5
+
+!ifndef _SUBMAKE
+
+CC = bcc32
+LD = bcc32
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLFLAGS = -WR
+!endif
+
+CFLAGS = -D_BCPP -w-aus -w-ccc -a8 $(DYNRTLFLAGS) -WC -X -q $(CDEBUGFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+!endif
+
+O = .obj
+
+
+# variables
+OBJ1 = gzio$(O) deflate$(O) adler32$(O) compress$(O) crc32$(O) uncompr$(O) \
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+
+all: zlib.lib
+
+adler32.obj: adler32.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+ infcodes.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+ infcodes.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+ $(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+zlib.lib: $(OBJ1) $(OBJ2)
+ del $@
+ tlib /E $@ @&&!
++$(**: = &^
++)
+!
+
+example.exe: example.obj zlib.lib
+ $(LD) $(LDFLAGS) example.obj zlib.lib
+
+minigzip.exe: minigzip.obj zlib.lib
+ $(LD) $(LDFLAGS) minigzip.obj zlib.lib
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ del *.obj
+ del *.exe
+ del *.dll
+ del *.lib
+ del *.tds
diff --git a/setedit/libz/Makefile.nmk b/setedit/libz/Makefile.nmk
new file mode 100644
index 0000000..7fcf64b
--- /dev/null
+++ b/setedit/libz/Makefile.nmk
@@ -0,0 +1,95 @@
+# Makefile for zlib for compiling by MSVC
+
+!ifndef _SUBMAKE
+
+#clean default extension list
+.SUFFIXES:
+#append extensions to list
+.SUFFIXES: .cc .cpp .c
+
+CC = cl /nologo
+CXX = $(CC) /TP
+LD = $(CXX)
+
+CFLAGS = -O2 $(INC) -D_WIN32 /GR- /GX-
+LDFLAGS =
+
+!endif
+
+O = .o
+
+
+# variables
+OBJ1 = gzio$(O) deflate$(O) adler32$(O) compress$(O) crc32$(O) uncompr$(O) \
+ trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+ infutil$(O) inffast$(O)
+
+all:: zlib.lib
+
+adler32.o: adler32.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+compress.o: compress.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+crc32.o: crc32.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+deflate.o: deflate.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+gzio.o: gzio.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+infblock.o: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+ infcodes.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+infcodes.o: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+ infcodes.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+inflate.o: inflate.c zutil.h zlib.h zconf.h infblock.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+inftrees.o: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+infutil.o: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+inffast.o: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+trees.o: trees.c deflate.h zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+uncompr.o: uncompr.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+zutil.o: zutil.c zutil.h zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c -Fo$*.o
+
+zlib.lib: $(OBJ1) $(OBJ2)
+ -del zlib.lib
+ lib /OUT:zlib.lib $(OBJ1) $(OBJ2)
+
+
+example.exe: example.o zlib.lib
+ $(LD) $(LDFLAGS) example.o zlib.lib
+
+minigzip.exe: minigzip.o zlib.lib
+ $(LD) $(LDFLAGS) minigzip.o zlib.lib
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ del *.o
+ del *.exe
+ del *.dll
+ del *.lib
+ del *.tds
+
diff --git a/setedit/libz/README b/setedit/libz/README
new file mode 100644
index 0000000..8ff4587
--- /dev/null
+++ b/setedit/libz/README
@@ -0,0 +1,148 @@
+zlib 1.1.3 is a general purpose data compression library. All the code
+is thread safe. The data format used by the zlib library
+is described by RFCs (Request for Comments) 1950 to 1952 in the files
+ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
+format) and rfc1952.txt (gzip format). These documents are also available in
+other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact jloup@gzip.org). A usage
+example of the library is given in the file example.c which also tests that
+the library is working correctly. Another example is given in the file
+minigzip.c. The compression library itself is composed of all source files
+except example.c and minigzip.c.
+
+To compile all files and run the test program, follow the instructions
+given at the top of Makefile. In short "make test; make install"
+should work for most machines. For Unix: "configure; make test; make install"
+For MSDOS, use one of the special makefiles such as Makefile.msc.
+For VMS, use Make_vms.com or descrip.mms.
+
+Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov>, or to
+Gilles Vollant <info@winimage.com> for the Windows DLL version.
+The zlib home page is http://www.cdrom.com/pub/infozip/zlib/
+The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/
+Before reporting a problem, please check those sites to verify that
+you have the latest version of zlib; otherwise get the latest version and
+check whether the problem still exists or not.
+
+Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997
+issue of Dr. Dobb's Journal; a copy of the article is available in
+http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
+
+The changes made in version 1.1.3 are documented in the file ChangeLog.
+The main changes since 1.1.2 are:
+
+- fix "an inflate input buffer bug that shows up on rare but persistent
+ occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+ (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+plus many changes for portability.
+
+Unsupported third party contributions are provided in directory "contrib".
+
+A Java implementation of zlib is available in the Java Development Kit 1.1
+http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
+See the zlib home page http://www.cdrom.com/pub/infozip/zlib/ for details.
+
+A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
+is in the CPAN (Comprehensive Perl Archive Network) sites, such as:
+ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
+
+A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
+is available in Python 1.5 and later versions, see
+http://www.python.org/doc/lib/module-zlib.html
+
+A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
+is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
+
+An experimental package to read and write files in .zip format,
+written on top of zlib by Gilles Vollant <info@winimage.com>, is
+available at http://www.winimage.com/zLibDll/unzip.html
+and also in the contrib/minizip directory of zlib.
+
+
+Notes for some targets:
+
+- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc
+ and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL
+ The zlib DLL support was initially done by Alessandro Iacopetti and is
+ now maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL
+ home page at http://www.winimage.com/zLibDll
+
+ From Visual Basic, you can call the DLL functions which do not take
+ a structure as argument: compress, uncompress and all gz* functions.
+ See contrib/visual-basic.txt for more information, or get
+ http://www.tcfb.com/dowseware/cmp-z-it.zip
+
+- For 64-bit Irix, deflate.c must be compiled without any optimization.
+ With -O, one libpng test fails. The test works in 32 bit mode (with
+ the -n32 compiler flag). The compiler bug has been reported to SGI.
+
+- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1
+ it works when compiled with cc.
+
+- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1
+ is necessary to get gzprintf working correctly. This is done by configure.
+
+- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
+ with other compilers. Use "make test" to check your compiler.
+
+- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
+
+- For Turbo C the small model is supported only with reduced performance to
+ avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+
+- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
+ Per Harald Myrvang <perm@stud.cs.uit.no>
+
+
+Acknowledgments:
+
+ The deflate format used by zlib was defined by Phil Katz. The deflate
+ and zlib specifications were written by L. Peter Deutsch. Thanks to all the
+ people who reported problems and suggested various improvements in zlib;
+ they are too numerous to cite here.
+
+Copyright notice:
+
+ (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not*
+receiving lengthy legal documents to sign. The sources are provided
+for free but without warranty of any kind. The library has been
+entirely written by Jean-loup Gailly and Mark Adler; it does not
+include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include
+in the file ChangeLog history information documenting your changes.
diff --git a/setedit/libz/adler32.c b/setedit/libz/adler32.c
new file mode 100644
index 0000000..fb88b78
--- /dev/null
+++ b/setedit/libz/adler32.c
@@ -0,0 +1,48 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: adler32.c,v 1.1.1.1 2001/09/11 13:58:57 set Exp $ */
+
+#include "zlib.h"
+
+#define BASE 65521L /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+ uLong adler;
+ const Bytef *buf;
+ uInt len;
+{
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int k;
+
+ if (buf == Z_NULL) return 1L;
+
+ while (len > 0) {
+ k = len < NMAX ? len : NMAX;
+ len -= k;
+ while (k >= 16) {
+ DO16(buf);
+ buf += 16;
+ k -= 16;
+ }
+ if (k != 0) do {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k);
+ s1 %= BASE;
+ s2 %= BASE;
+ }
+ return (s2 << 16) | s1;
+}
diff --git a/setedit/libz/compress.c b/setedit/libz/compress.c
new file mode 100644
index 0000000..f33cb5e
--- /dev/null
+++ b/setedit/libz/compress.c
@@ -0,0 +1,68 @@
+/* compress.c -- compress a memory buffer
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: compress.c,v 1.1.1.1 2001/09/11 13:58:57 set Exp $ */
+
+#include "zlib.h"
+
+/* ===========================================================================
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+ int level;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (Bytef*)source;
+ stream.avail_in = (uInt)sourceLen;
+#ifdef MAXSEG_64K
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+#endif
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+ stream.opaque = (voidpf)0;
+
+ err = deflateInit(&stream, level);
+ if (err != Z_OK) return err;
+
+ err = deflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ deflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = deflateEnd(&stream);
+ return err;
+}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
diff --git a/setedit/libz/crc32.c b/setedit/libz/crc32.c
new file mode 100644
index 0000000..2d8540c
--- /dev/null
+++ b/setedit/libz/crc32.c
@@ -0,0 +1,162 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: crc32.c,v 1.1.1.1 2001/09/11 13:58:57 set Exp $ */
+
+#include "zlib.h"
+
+#define local static
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local int crc_table_empty = 1;
+local uLongf crc_table[256];
+local void make_crc_table OF((void));
+
+/*
+ Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
+ x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+ Polynomials over GF(2) are represented in binary, one bit per coefficient,
+ with the lowest powers in the most significant bit. Then adding polynomials
+ is just exclusive-or, and multiplying a polynomial by x is a right shift by
+ one. If we call the above polynomial p, and represent a byte as the
+ polynomial q, also with the lowest power in the most significant bit (so the
+ byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+ where a mod b means the remainder after dividing a by b.
+
+ This calculation is done using the shift-register method of multiplying and
+ taking the remainder. The register is initialized to zero, and for each
+ incoming bit, x^32 is added mod p to the register if the bit is a one (where
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+ x (which is shifting right by one and adding x^32 mod p if the bit shifted
+ out is a one). We start with the highest power (least significant bit) of
+ q and repeat for all eight bits of q.
+
+ The table is simply the CRC of all possible eight bit values. This is all
+ the information needed to generate CRC's on data a byte at a time for all
+ combinations of CRC register values and incoming bytes.
+*/
+local void make_crc_table()
+{
+ uLong c;
+ int n, k;
+ uLong poly; /* polynomial exclusive-or pattern */
+ /* terms of polynomial defining this crc (except x^32): */
+ static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+ /* make exclusive-or pattern from polynomial (0xedb88320L) */
+ poly = 0L;
+ for (n = 0; n < sizeof(p)/sizeof(Byte); n++)
+ poly |= 1L << (31 - p[n]);
+
+ for (n = 0; n < 256; n++)
+ {
+ c = (uLong)n;
+ for (k = 0; k < 8; k++)
+ c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+ crc_table[n] = c;
+ }
+ crc_table_empty = 0;
+}
+#else
+/* ========================================================================
+ * Table of CRC-32's of all single-byte values (made by make_crc_table)
+ */
+local const uLongf crc_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+#endif
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const uLongf * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty) make_crc_table();
+#endif
+ return (const uLongf *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
+#define DO2(buf) DO1(buf); DO1(buf);
+#define DO4(buf) DO2(buf); DO2(buf);
+#define DO8(buf) DO4(buf); DO4(buf);
+
+/* ========================================================================= */
+uLong ZEXPORT crc32(crc, buf, len)
+ uLong crc;
+ const Bytef *buf;
+ uInt len;
+{
+ if (buf == Z_NULL) return 0L;
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty)
+ make_crc_table();
+#endif
+ crc = crc ^ 0xffffffffL;
+ while (len >= 8)
+ {
+ DO8(buf);
+ len -= 8;
+ }
+ if (len) do {
+ DO1(buf);
+ } while (--len);
+ return crc ^ 0xffffffffL;
+}
diff --git a/setedit/libz/deflate.c b/setedit/libz/deflate.c
new file mode 100644
index 0000000..8001823
--- /dev/null
+++ b/setedit/libz/deflate.c
@@ -0,0 +1,1350 @@
+/* deflate.c -- compress data using the deflation algorithm
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process depends on being able to identify portions
+ * of the input text which are identical to earlier input (within a
+ * sliding window trailing behind the input currently being processed).
+ *
+ * The most straightforward technique turns out to be the fastest for
+ * most input files: try all possible matches and select the longest.
+ * The key feature of this algorithm is that insertions into the string
+ * dictionary are very simple and thus fast, and deletions are avoided
+ * completely. Insertions are performed at each input character, whereas
+ * string matches are performed only when the previous match ends. So it
+ * is preferable to spend more time in matches to allow very fast string
+ * insertions and avoid deletions. The matching algorithm for small
+ * strings is inspired from that of Rabin & Karp. A brute force approach
+ * is used to find longer strings when a small match has been found.
+ * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
+ * (by Leonid Broukhis).
+ * A previous version of this file used a more sophisticated algorithm
+ * (by Fiala and Greene) which is guaranteed to run in linear amortized
+ * time, but has a larger average cost, uses more memory and is patented.
+ * However the F&G algorithm may be faster for some highly redundant
+ * files if the parameter max_chain_length (described below) is too large.
+ *
+ * ACKNOWLEDGEMENTS
+ *
+ * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
+ * I found it in 'freeze' written by Leonid Broukhis.
+ * Thanks to many people for bug reports and testing.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ * Available in ftp://ds.internic.net/rfc/rfc1951.txt
+ *
+ * A description of the Rabin and Karp algorithm is given in the book
+ * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
+ *
+ * Fiala,E.R., and Greene,D.H.
+ * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
+ *
+ */
+
+/* @(#) $Id: deflate.c,v 1.1.1.1 2001/09/11 13:58:58 set Exp $ */
+
+#include "deflate.h"
+
+const char deflate_copyright[] =
+ " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/* ===========================================================================
+ * Function prototypes.
+ */
+typedef enum {
+ need_more, /* block not completed, need more input or more output */
+ block_done, /* block flush performed */
+ finish_started, /* finish started, need only more output at next deflate */
+ finish_done /* finish done, accept no more input or output */
+} block_state;
+
+typedef block_state (*compress_func) OF((deflate_state *s, int flush));
+/* Compression function. Returns the block state after the call. */
+
+local void fill_window OF((deflate_state *s));
+local block_state deflate_stored OF((deflate_state *s, int flush));
+local block_state deflate_fast OF((deflate_state *s, int flush));
+local block_state deflate_slow OF((deflate_state *s, int flush));
+local void lm_init OF((deflate_state *s));
+local void putShortMSB OF((deflate_state *s, uInt b));
+local void flush_pending OF((z_streamp strm));
+local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
+#ifdef ASMV
+ void match_init OF((void)); /* asm code initialization */
+ uInt longest_match OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match OF((deflate_state *s, IPos cur_match));
+#endif
+
+#ifdef DEBUG
+local void check_match OF((deflate_state *s, IPos start, IPos match,
+ int length));
+#endif
+
+/* ===========================================================================
+ * Local data
+ */
+
+#define NIL 0
+/* Tail of hash chains */
+
+#ifndef TOO_FAR
+# define TOO_FAR 4096
+#endif
+/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+typedef struct config_s {
+ ush good_length; /* reduce lazy search above this match length */
+ ush max_lazy; /* do not perform lazy search above this match length */
+ ush nice_length; /* quit search above this match length */
+ ush max_chain;
+ compress_func func;
+} config;
+
+local const config configuration_table[10] = {
+/* good lazy nice chain */
+/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */
+/* 2 */ {4, 5, 16, 8, deflate_fast},
+/* 3 */ {4, 6, 32, 32, deflate_fast},
+
+/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
+/* 5 */ {8, 16, 32, 32, deflate_slow},
+/* 6 */ {8, 16, 128, 128, deflate_slow},
+/* 7 */ {8, 32, 128, 256, deflate_slow},
+/* 8 */ {32, 128, 258, 1024, deflate_slow},
+/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */
+
+/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+ * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
+ * meaning.
+ */
+
+#define EQUAL 0
+/* result of memcmp for equal strings */
+
+struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN assertion: all calls to to UPDATE_HASH are made with consecutive
+ * input characters, so that a running hash key can be computed from the
+ * previous key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+
+
+/* ===========================================================================
+ * Insert string str in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
+ * IN assertion: all calls to to INSERT_STRING are made with consecutive
+ * input characters and the first MIN_MATCH bytes of str are valid
+ * (except for the last MIN_MATCH-1 bytes of the input file).
+ */
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#else
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#endif
+
+/* ===========================================================================
+ * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+#define CLEAR_HASH(s) \
+ s->head[s->hash_size-1] = NIL; \
+ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+
+/* ========================================================================= */
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
+ z_streamp strm;
+ int level;
+ const char *version;
+ int stream_size;
+{
+ return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+ Z_DEFAULT_STRATEGY, version, stream_size);
+ /* To do: ignore strm->next_in if we use it as window */
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+ version, stream_size)
+ z_streamp strm;
+ int level;
+ int method;
+ int windowBits;
+ int memLevel;
+ int strategy;
+ const char *version;
+ int stream_size;
+{
+ deflate_state *s;
+ int noheader = 0;
+ static const char* my_version = ZLIB_VERSION;
+
+ ushf *overlay;
+ /* We overlay pending_buf and d_buf+l_buf. This works since the average
+ * output size for (length,distance) codes is <= 24 bits.
+ */
+
+ if (version == Z_NULL || version[0] != my_version[0] ||
+ stream_size != sizeof(z_stream)) {
+ return Z_VERSION_ERROR;
+ }
+ if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->msg = Z_NULL;
+ if (strm->zalloc == Z_NULL) {
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+ }
+ if (strm->zfree == Z_NULL) strm->zfree = zcfree;
+
+ if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#ifdef FASTEST
+ level = 1;
+#endif
+
+ if (windowBits < 0) { /* undocumented feature: suppress zlib header */
+ noheader = 1;
+ windowBits = -windowBits;
+ }
+ if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+ windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+ strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+ if (s == Z_NULL) return Z_MEM_ERROR;
+ strm->state = (struct internal_state FAR *)s;
+ s->strm = strm;
+
+ s->noheader = noheader;
+ s->w_bits = windowBits;
+ s->w_size = 1 << s->w_bits;
+ s->w_mask = s->w_size - 1;
+
+ s->hash_bits = memLevel + 7;
+ s->hash_size = 1 << s->hash_bits;
+ s->hash_mask = s->hash_size - 1;
+ s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+ s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+ s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
+ s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+ s->pending_buf = (uchf *) overlay;
+ s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+ if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+ s->pending_buf == Z_NULL) {
+ strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
+ deflateEnd (strm);
+ return Z_MEM_ERROR;
+ }
+ s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+ s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+
+ s->level = level;
+ s->strategy = strategy;
+ s->method = (Byte)method;
+
+ return deflateReset(strm);
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+ z_streamp strm;
+ const Bytef *dictionary;
+ uInt dictLength;
+{
+ deflate_state *s;
+ uInt length = dictLength;
+ uInt n;
+ IPos hash_head = 0;
+
+ if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
+ strm->state->status != INIT_STATE) return Z_STREAM_ERROR;
+
+ s = strm->state;
+ strm->adler = adler32(strm->adler, dictionary, dictLength);
+
+ if (length < MIN_MATCH) return Z_OK;
+ if (length > MAX_DIST(s)) {
+ length = MAX_DIST(s);
+#ifndef USE_DICT_HEAD
+ dictionary += dictLength - length; /* use the tail of the dictionary */
+#endif
+ }
+ zmemcpy(s->window, dictionary, length);
+ s->strstart = length;
+ s->block_start = (long)length;
+
+ /* Insert all strings in the hash table (except for the last two bytes).
+ * s->lookahead stays null, so s->ins_h will be recomputed at the next
+ * call of fill_window.
+ */
+ s->ins_h = s->window[0];
+ UPDATE_HASH(s, s->ins_h, s->window[1]);
+ for (n = 0; n <= length - MIN_MATCH; n++) {
+ INSERT_STRING(s, n, hash_head);
+ }
+ if (hash_head) hash_head = 0; /* to make compiler happy */
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+ z_streamp strm;
+{
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->total_in = strm->total_out = 0;
+ strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+ strm->data_type = Z_UNKNOWN;
+
+ s = (deflate_state *)strm->state;
+ s->pending = 0;
+ s->pending_out = s->pending_buf;
+
+ if (s->noheader < 0) {
+ s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */
+ }
+ s->status = s->noheader ? BUSY_STATE : INIT_STATE;
+ strm->adler = 1;
+ s->last_flush = Z_NO_FLUSH;
+
+ _tr_init(s);
+ lm_init(s);
+
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateParams(strm, level, strategy)
+ z_streamp strm;
+ int level;
+ int strategy;
+{
+ deflate_state *s;
+ compress_func func;
+ int err = Z_OK;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ s = strm->state;
+
+ if (level == Z_DEFAULT_COMPRESSION) {
+ level = 6;
+ }
+ if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ func = configuration_table[s->level].func;
+
+ if (func != configuration_table[level].func && strm->total_in != 0) {
+ /* Flush the last buffer: */
+ err = deflate(strm, Z_PARTIAL_FLUSH);
+ }
+ if (s->level != level) {
+ s->level = level;
+ s->max_lazy_match = configuration_table[level].max_lazy;
+ s->good_match = configuration_table[level].good_length;
+ s->nice_match = configuration_table[level].nice_length;
+ s->max_chain_length = configuration_table[level].max_chain;
+ }
+ s->strategy = strategy;
+ return err;
+}
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+local void putShortMSB (s, b)
+ deflate_state *s;
+ uInt b;
+{
+ put_byte(s, (Byte)(b >> 8));
+ put_byte(s, (Byte)(b & 0xff));
+}
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output goes
+ * through this function so some applications may wish to modify it
+ * to avoid allocating a large strm->next_out buffer and copying into it.
+ * (See also read_buf()).
+ */
+local void flush_pending(strm)
+ z_streamp strm;
+{
+ unsigned len = strm->state->pending;
+
+ if (len > strm->avail_out) len = strm->avail_out;
+ if (len == 0) return;
+
+ zmemcpy(strm->next_out, strm->state->pending_out, len);
+ strm->next_out += len;
+ strm->state->pending_out += len;
+ strm->total_out += len;
+ strm->avail_out -= len;
+ strm->state->pending -= len;
+ if (strm->state->pending == 0) {
+ strm->state->pending_out = strm->state->pending_buf;
+ }
+}
+
+/* ========================================================================= */
+int ZEXPORT deflate (strm, flush)
+ z_streamp strm;
+ int flush;
+{
+ int old_flush; /* value of flush param for previous deflate call */
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ flush > Z_FINISH || flush < 0) {
+ return Z_STREAM_ERROR;
+ }
+ s = strm->state;
+
+ if (strm->next_out == Z_NULL ||
+ (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+ (s->status == FINISH_STATE && flush != Z_FINISH)) {
+ ERR_RETURN(strm, Z_STREAM_ERROR);
+ }
+ if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+ s->strm = strm; /* just in case */
+ old_flush = s->last_flush;
+ s->last_flush = flush;
+
+ /* Write the zlib header */
+ if (s->status == INIT_STATE) {
+
+ uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+ uInt level_flags = (s->level-1) >> 1;
+
+ if (level_flags > 3) level_flags = 3;
+ header |= (level_flags << 6);
+ if (s->strstart != 0) header |= PRESET_DICT;
+ header += 31 - (header % 31);
+
+ s->status = BUSY_STATE;
+ putShortMSB(s, header);
+
+ /* Save the adler32 of the preset dictionary: */
+ if (s->strstart != 0) {
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ }
+ strm->adler = 1L;
+ }
+
+ /* Flush as much pending output as possible */
+ if (s->pending != 0) {
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ /* Since avail_out is 0, deflate will be called again with
+ * more output space, but possibly with both pending and
+ * avail_in equal to zero. There won't be anything to do,
+ * but this is not an error situation so make sure we
+ * return OK instead of BUF_ERROR at next call of deflate:
+ */
+ s->last_flush = -1;
+ return Z_OK;
+ }
+
+ /* Make sure there is something to do and avoid duplicate consecutive
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUFF_ERROR.
+ */
+ } else if (strm->avail_in == 0 && flush <= old_flush &&
+ flush != Z_FINISH) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* User must not provide more input after the first FINISH: */
+ if (s->status == FINISH_STATE && strm->avail_in != 0) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* Start a new block or continue the current one.
+ */
+ if (strm->avail_in != 0 || s->lookahead != 0 ||
+ (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+ block_state bstate;
+
+ bstate = (*(configuration_table[s->level].func))(s, flush);
+
+ if (bstate == finish_started || bstate == finish_done) {
+ s->status = FINISH_STATE;
+ }
+ if (bstate == need_more || bstate == finish_started) {
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+ }
+ return Z_OK;
+ /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+ * of deflate should use the same flush parameter to make sure
+ * that the flush is complete. So we don't have to output an
+ * empty block here, this will be done at next call. This also
+ * ensures that for a very small output buffer, we emit at most
+ * one empty block.
+ */
+ }
+ if (bstate == block_done) {
+ if (flush == Z_PARTIAL_FLUSH) {
+ _tr_align(s);
+ } else { /* FULL_FLUSH or SYNC_FLUSH */
+ _tr_stored_block(s, (char*)0, 0L, 0);
+ /* For a full flush, this empty block will be recognized
+ * as a special marker by inflate_sync().
+ */
+ if (flush == Z_FULL_FLUSH) {
+ CLEAR_HASH(s); /* forget history */
+ }
+ }
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+ return Z_OK;
+ }
+ }
+ }
+ Assert(strm->avail_out > 0, "bug2");
+
+ if (flush != Z_FINISH) return Z_OK;
+ if (s->noheader) return Z_STREAM_END;
+
+ /* Write the zlib trailer (adler32) */
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ flush_pending(strm);
+ /* If avail_out is zero, the application will call deflate again
+ * to flush the rest.
+ */
+ s->noheader = -1; /* write the trailer only once! */
+ return s->pending != 0 ? Z_OK : Z_STREAM_END;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateEnd (strm)
+ z_streamp strm;
+{
+ int status;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ status = strm->state->status;
+ if (status != INIT_STATE && status != BUSY_STATE &&
+ status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
+ }
+
+ /* Deallocate in reverse order of allocations: */
+ TRY_FREE(strm, strm->state->pending_buf);
+ TRY_FREE(strm, strm->state->head);
+ TRY_FREE(strm, strm->state->prev);
+ TRY_FREE(strm, strm->state->window);
+
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+
+ return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+}
+
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
+ z_streamp dest;
+ z_streamp source;
+{
+#ifdef MAXSEG_64K
+ return Z_STREAM_ERROR;
+#else
+ deflate_state *ds;
+ deflate_state *ss;
+ ushf *overlay;
+
+
+ if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
+
+ ss = source->state;
+
+ *dest = *source;
+
+ ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+ if (ds == Z_NULL) return Z_MEM_ERROR;
+ dest->state = (struct internal_state FAR *) ds;
+ *ds = *ss;
+ ds->strm = dest;
+
+ ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+ ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
+ ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
+ overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+ ds->pending_buf = (uchf *) overlay;
+
+ if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+ ds->pending_buf == Z_NULL) {
+ deflateEnd (dest);
+ return Z_MEM_ERROR;
+ }
+ /* following zmemcpy do not work for 16-bit MSDOS */
+ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+ zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
+ zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
+ zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+ ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+ ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+ ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+ ds->l_desc.dyn_tree = ds->dyn_ltree;
+ ds->d_desc.dyn_tree = ds->dyn_dtree;
+ ds->bl_desc.dyn_tree = ds->bl_tree;
+
+ return Z_OK;
+#endif
+}
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read. All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->next_in buffer and copying from it.
+ * (See also flush_pending()).
+ */
+local int read_buf(strm, buf, size)
+ z_streamp strm;
+ Bytef *buf;
+ unsigned size;
+{
+ unsigned len = strm->avail_in;
+
+ if (len > size) len = size;
+ if (len == 0) return 0;
+
+ strm->avail_in -= len;
+
+ if (!strm->state->noheader) {
+ strm->adler = adler32(strm->adler, strm->next_in, len);
+ }
+ zmemcpy(buf, strm->next_in, len);
+ strm->next_in += len;
+ strm->total_in += len;
+
+ return (int)len;
+}
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+local void lm_init (s)
+ deflate_state *s;
+{
+ s->window_size = (ulg)2L*s->w_size;
+
+ CLEAR_HASH(s);
+
+ /* Set the default configuration parameters:
+ */
+ s->max_lazy_match = configuration_table[s->level].max_lazy;
+ s->good_match = configuration_table[s->level].good_length;
+ s->nice_match = configuration_table[s->level].nice_length;
+ s->max_chain_length = configuration_table[s->level].max_chain;
+
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->lookahead = 0;
+ s->match_length = s->prev_length = MIN_MATCH-1;
+ s->match_available = 0;
+ s->ins_h = 0;
+#ifdef ASMV
+ match_init(); /* initialize the asm code */
+#endif
+}
+
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+#ifndef ASMV
+/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
+ * match.S. The code will be functionally equivalent.
+ */
+#ifndef FASTEST
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ unsigned chain_length = s->max_chain_length;/* max hash chain length */
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ int best_len = s->prev_length; /* best match length so far */
+ int nice_match = s->nice_match; /* stop if match long enough */
+ IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+ s->strstart - (IPos)MAX_DIST(s) : NIL;
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+ Posf *prev = s->prev;
+ uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+ /* Compare two bytes at a time. Note: this is not always beneficial.
+ * Try with and without -DUNALIGNED_OK to check.
+ */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+ register ush scan_start = *(ushf*)scan;
+ register ush scan_end = *(ushf*)(scan+best_len-1);
+#else
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+ register Byte scan_end1 = scan[best_len-1];
+ register Byte scan_end = scan[best_len];
+#endif
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ /* Do not waste too much time if we already have a good match: */
+ if (s->prev_length >= s->good_match) {
+ chain_length >>= 2;
+ }
+ /* Do not look for matches beyond the end of the input. This is necessary
+ * to make deflate deterministic.
+ */
+ if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ do {
+ Assert(cur_match < s->strstart, "no future");
+ match = s->window + cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2:
+ */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+ /* This code assumes sizeof(unsigned short) == 2. Do not use
+ * UNALIGNED_OK if your compiler uses a different size.
+ */
+ if (*(ushf*)(match+best_len-1) != scan_end ||
+ *(ushf*)match != scan_start) continue;
+
+ /* It is not necessary to compare scan[2] and match[2] since they are
+ * always equal when the other bytes match, given that the hash keys
+ * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+ * strstart+3, +5, ... up to strstart+257. We check for insufficient
+ * lookahead only every 4th comparison; the 128th check will be made
+ * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+ * necessary to put more guard bytes at the end of the window, or
+ * to check more often for insufficient lookahead.
+ */
+ Assert(scan[2] == match[2], "scan[2]?");
+ scan++, match++;
+ do {
+ } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ scan < strend);
+ /* The funny "do {}" generates better code on most compilers */
+
+ /* Here, scan <= window+strstart+257 */
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ if (*scan == *match) scan++;
+
+ len = (MAX_MATCH - 1) - (int)(strend-scan);
+ scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match++;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+ scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+ if (len > best_len) {
+ s->match_start = cur_match;
+ best_len = len;
+ if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+ scan_end = *(ushf*)(scan+best_len-1);
+#else
+ scan_end1 = scan[best_len-1];
+ scan_end = scan[best_len];
+#endif
+ }
+ } while ((cur_match = prev[cur_match & wmask]) > limit
+ && --chain_length != 0);
+
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ return s->lookahead;
+}
+
+#else /* FASTEST */
+/* ---------------------------------------------------------------------------
+ * Optimized version for level == 1 only
+ */
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ Assert(cur_match < s->strstart, "no future");
+
+ match = s->window + cur_match;
+
+ /* Return failure if the match length is less than 2:
+ */
+ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match += 2;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+
+ if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+ s->match_start = cur_match;
+ return len <= s->lookahead ? len : s->lookahead;
+}
+#endif /* FASTEST */
+#endif /* ASMV */
+
+#ifdef DEBUG
+/* ===========================================================================
+ * Check that the match at match_start is indeed a match.
+ */
+local void check_match(s, start, match, length)
+ deflate_state *s;
+ IPos start, match;
+ int length;
+{
+ /* check that the match is indeed a match */
+ if (zmemcmp(s->window + match,
+ s->window + start, length) != EQUAL) {
+ fprintf(stderr, " start %u, match %u, length %d\n",
+ start, match, length);
+ do {
+ fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
+ } while (--length != 0);
+ z_error("invalid match");
+ }
+ if (z_verbose > 1) {
+ fprintf(stderr,"\\[%d,%d]", start-match, length);
+ do { putc(s->window[start++], stderr); } while (--length != 0);
+ }
+}
+#else
+# define check_match(s, start, match, length)
+#endif
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ * At least one byte has been read, or avail_in == 0; reads are
+ * performed for at least two bytes (required for the zip translate_eol
+ * option -- not supported here).
+ */
+local void fill_window(s)
+ deflate_state *s;
+{
+ register unsigned n, m;
+ register Posf *p;
+ unsigned more; /* Amount of free space at the end of the window. */
+ uInt wsize = s->w_size;
+
+ do {
+ more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+
+ /* Deal with !@#$% 64K limit: */
+ if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+ more = wsize;
+
+ } else if (more == (unsigned)(-1)) {
+ /* Very unlikely, but possible on 16 bit machine if strstart == 0
+ * and lookahead == 1 (input done one byte at time)
+ */
+ more--;
+
+ /* If the window is almost full and there is insufficient lookahead,
+ * move the upper half to the lower one to make room in the upper half.
+ */
+ } else if (s->strstart >= wsize+MAX_DIST(s)) {
+
+ zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+ s->match_start -= wsize;
+ s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
+ s->block_start -= (long) wsize;
+
+ /* Slide the hash table (could be avoided with 32 bit values
+ at the expense of memory usage). We slide even when level == 0
+ to keep the hash table consistent if we switch back to level > 0
+ later. (Using level 0 permanently is not an optimal usage of
+ zlib, so we don't care about this pathological case.)
+ */
+ n = s->hash_size;
+ p = &s->head[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ } while (--n);
+
+ n = wsize;
+#ifndef FASTEST
+ p = &s->prev[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ } while (--n);
+#endif
+ more += wsize;
+ }
+ if (s->strm->avail_in == 0) return;
+
+ /* If there was no sliding:
+ * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+ * more == window_size - lookahead - strstart
+ * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+ * => more >= window_size - 2*WSIZE + 2
+ * In the BIG_MEM or MMAP case (not yet supported),
+ * window_size == input_size + MIN_LOOKAHEAD &&
+ * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+ * Otherwise, window_size == 2*WSIZE so more >= 2.
+ * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+ */
+ Assert(more >= 2, "more < 2");
+
+ n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+ s->lookahead += n;
+
+ /* Initialize the hash value now that we have some input: */
+ if (s->lookahead >= MIN_MATCH) {
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ }
+ /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+ * but this is not important since only literal bytes will be emitted.
+ */
+
+ } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK_ONLY(s, eof) { \
+ _tr_flush_block(s, (s->block_start >= 0L ? \
+ (charf *)&s->window[(unsigned)s->block_start] : \
+ (charf *)Z_NULL), \
+ (ulg)((long)s->strstart - s->block_start), \
+ (eof)); \
+ s->block_start = s->strstart; \
+ flush_pending(s->strm); \
+ Tracev((stderr,"[FLUSH]")); \
+}
+
+/* Same but force premature exit if necessary. */
+#define FLUSH_BLOCK(s, eof) { \
+ FLUSH_BLOCK_ONLY(s, eof); \
+ if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
+}
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ * This function does not insert new strings in the dictionary since
+ * uncompressible data is probably not useful. This function is used
+ * only for the level=0 compression option.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
+ */
+local block_state deflate_stored(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+ * to pending_buf_size, and each stored block has a 5 byte header:
+ */
+ ulg max_block_size = 0xffff;
+ ulg max_start;
+
+ if (max_block_size > s->pending_buf_size - 5) {
+ max_block_size = s->pending_buf_size - 5;
+ }
+
+ /* Copy as much as possible from input to output: */
+ for (;;) {
+ /* Fill the window as much as possible: */
+ if (s->lookahead <= 1) {
+
+ Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+ s->block_start >= (long)s->w_size, "slide too late");
+
+ fill_window(s);
+ if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+ Assert(s->block_start >= 0L, "block gone");
+
+ s->strstart += s->lookahead;
+ s->lookahead = 0;
+
+ /* Emit a stored block if pending_buf will be full: */
+ max_start = s->block_start + max_block_size;
+ if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
+ /* strstart == 0 is possible when wraparound on 16-bit machine */
+ s->lookahead = (uInt)(s->strstart - max_start);
+ s->strstart = (uInt)max_start;
+ FLUSH_BLOCK(s, 0);
+ }
+ /* Flush if we may have to slide, otherwise block_start may become
+ * negative and the data will be gone:
+ */
+ if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
+ FLUSH_BLOCK(s, 0);
+ }
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+local block_state deflate_fast(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head = NIL; /* head of the hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ * At this point we have always match_length < MIN_MATCH
+ */
+ if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ if (s->strategy != Z_HUFFMAN_ONLY) {
+ s->match_length = longest_match (s, hash_head);
+ }
+ /* longest_match() sets match_start */
+ }
+ if (s->match_length >= MIN_MATCH) {
+ check_match(s, s->strstart, s->match_start, s->match_length);
+
+ _tr_tally_dist(s, s->strstart - s->match_start,
+ s->match_length - MIN_MATCH, bflush);
+
+ s->lookahead -= s->match_length;
+
+ /* Insert new strings in the hash table only if the match length
+ * is not too large. This saves time but degrades compression.
+ */
+#ifndef FASTEST
+ if (s->match_length <= s->max_insert_length &&
+ s->lookahead >= MIN_MATCH) {
+ s->match_length--; /* string at strstart already in hash table */
+ do {
+ s->strstart++;
+ INSERT_STRING(s, s->strstart, hash_head);
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ } while (--s->match_length != 0);
+ s->strstart++;
+ } else
+#endif
+ {
+ s->strstart += s->match_length;
+ s->match_length = 0;
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+ * matter since it will be recomputed at next deflate call.
+ */
+ }
+ } else {
+ /* No match, output a literal byte */
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ }
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
+
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+local block_state deflate_slow(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head = NIL; /* head of hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ /* Process the input block. */
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ */
+ s->prev_length = s->match_length, s->prev_match = s->match_start;
+ s->match_length = MIN_MATCH-1;
+
+ if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+ s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ if (s->strategy != Z_HUFFMAN_ONLY) {
+ s->match_length = longest_match (s, hash_head);
+ }
+ /* longest_match() sets match_start */
+
+ if (s->match_length <= 5 && (s->strategy == Z_FILTERED ||
+ (s->match_length == MIN_MATCH &&
+ s->strstart - s->match_start > TOO_FAR))) {
+
+ /* If prev_match is also MIN_MATCH, match_start is garbage
+ * but we will ignore the current match anyway.
+ */
+ s->match_length = MIN_MATCH-1;
+ }
+ }
+ /* If there was a match at the previous step and the current
+ * match is not better, output the previous match:
+ */
+ if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+ uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+ /* Do not insert strings in hash table beyond this. */
+
+ check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+
+ _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+ s->prev_length - MIN_MATCH, bflush);
+
+ /* Insert in hash table all strings up to the end of the match.
+ * strstart-1 and strstart are already inserted. If there is not
+ * enough lookahead, the last two strings are not inserted in
+ * the hash table.
+ */
+ s->lookahead -= s->prev_length-1;
+ s->prev_length -= 2;
+ do {
+ if (++s->strstart <= max_insert) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+ } while (--s->prev_length != 0);
+ s->match_available = 0;
+ s->match_length = MIN_MATCH-1;
+ s->strstart++;
+
+ if (bflush) FLUSH_BLOCK(s, 0);
+
+ } else if (s->match_available) {
+ /* If there was no match at the previous position, output a
+ * single literal. If there was a match but the current match
+ * is longer, truncate the previous match to a single literal.
+ */
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ if (bflush) {
+ FLUSH_BLOCK_ONLY(s, 0);
+ }
+ s->strstart++;
+ s->lookahead--;
+ if (s->strm->avail_out == 0) return need_more;
+ } else {
+ /* There is no previous match to compare with, wait for
+ * the next step to decide.
+ */
+ s->match_available = 1;
+ s->strstart++;
+ s->lookahead--;
+ }
+ }
+ Assert (flush != Z_NO_FLUSH, "no flush?");
+ if (s->match_available) {
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ s->match_available = 0;
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
diff --git a/setedit/libz/deflate.h b/setedit/libz/deflate.h
new file mode 100644
index 0000000..7fddd1e
--- /dev/null
+++ b/setedit/libz/deflate.h
@@ -0,0 +1,318 @@
+/* deflate.h -- internal compression state
+ * Copyright (C) 1995-1998 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: deflate.h,v 1.1.1.1 2001/09/11 13:58:58 set Exp $ */
+
+#ifndef _DEFLATE_H
+#define _DEFLATE_H
+
+#include "zutil.h"
+
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+#define LENGTH_CODES 29
+/* number of length codes, not counting the special END_BLOCK code */
+
+#define LITERALS 256
+/* number of literal bytes 0..255 */
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+#define D_CODES 30
+/* number of distance codes */
+
+#define BL_CODES 19
+/* number of codes used to transfer the bit lengths */
+
+#define HEAP_SIZE (2*L_CODES+1)
+/* maximum heap size */
+
+#define MAX_BITS 15
+/* All codes must not exceed MAX_BITS bits */
+
+#define INIT_STATE 42
+#define BUSY_STATE 113
+#define FINISH_STATE 666
+/* Stream status */
+
+
+/* Data structure describing a single value and its code string. */
+typedef struct ct_data_s {
+ union {
+ ush freq; /* frequency count */
+ ush code; /* bit string */
+ } fc;
+ union {
+ ush dad; /* father node in Huffman tree */
+ ush len; /* length of bit string */
+ } dl;
+} FAR ct_data;
+
+#define Freq fc.freq
+#define Code fc.code
+#define Dad dl.dad
+#define Len dl.len
+
+typedef struct static_tree_desc_s static_tree_desc;
+
+typedef struct tree_desc_s {
+ ct_data *dyn_tree; /* the dynamic tree */
+ int max_code; /* largest code with non zero frequency */
+ static_tree_desc *stat_desc; /* the corresponding static tree */
+} FAR tree_desc;
+
+typedef ush Pos;
+typedef Pos FAR Posf;
+typedef unsigned IPos;
+
+/* A Pos is an index in the character window. We use short instead of int to
+ * save space in the various tables. IPos is used only for parameter passing.
+ */
+
+typedef struct internal_state {
+ z_streamp strm; /* pointer back to this zlib stream */
+ int status; /* as the name implies */
+ Bytef *pending_buf; /* output still pending */
+ ulg pending_buf_size; /* size of pending_buf */
+ Bytef *pending_out; /* next pending byte to output to the stream */
+ int pending; /* nb of bytes in the pending buffer */
+ int noheader; /* suppress zlib header and adler32 */
+ Byte data_type; /* UNKNOWN, BINARY or ASCII */
+ Byte method; /* STORED (for zip only) or DEFLATED */
+ int last_flush; /* value of flush param for previous deflate call */
+
+ /* used by deflate.c: */
+
+ uInt w_size; /* LZ77 window size (32K by default) */
+ uInt w_bits; /* log2(w_size) (8..16) */
+ uInt w_mask; /* w_size - 1 */
+
+ Bytef *window;
+ /* Sliding window. Input bytes are read into the second half of the window,
+ * and move to the first half later to keep a dictionary of at least wSize
+ * bytes. With this organization, matches are limited to a distance of
+ * wSize-MAX_MATCH bytes, but this ensures that IO is always
+ * performed with a length multiple of the block size. Also, it limits
+ * the window size to 64K, which is quite useful on MSDOS.
+ * To do: use the user input buffer as sliding window.
+ */
+
+ ulg window_size;
+ /* Actual size of window: 2*wSize, except when the user input buffer
+ * is directly used as sliding window.
+ */
+
+ Posf *prev;
+ /* Link to older string with same hash index. To limit the size of this
+ * array to 64K, this link is maintained only for the last 32K strings.
+ * An index in this array is thus a window index modulo 32K.
+ */
+
+ Posf *head; /* Heads of the hash chains or NIL. */
+
+ uInt ins_h; /* hash index of string to be inserted */
+ uInt hash_size; /* number of elements in hash table */
+ uInt hash_bits; /* log2(hash_size) */
+ uInt hash_mask; /* hash_size-1 */
+
+ uInt hash_shift;
+ /* Number of bits by which ins_h must be shifted at each input
+ * step. It must be such that after MIN_MATCH steps, the oldest
+ * byte no longer takes part in the hash key, that is:
+ * hash_shift * MIN_MATCH >= hash_bits
+ */
+
+ long block_start;
+ /* Window position at the beginning of the current output block. Gets
+ * negative when the window is moved backwards.
+ */
+
+ uInt match_length; /* length of best match */
+ IPos prev_match; /* previous match */
+ int match_available; /* set if previous match exists */
+ uInt strstart; /* start of string to insert */
+ uInt match_start; /* start of matching string */
+ uInt lookahead; /* number of valid bytes ahead in window */
+
+ uInt prev_length;
+ /* Length of the best match at previous step. Matches not greater than this
+ * are discarded. This is used in the lazy match evaluation.
+ */
+
+ uInt max_chain_length;
+ /* To speed up deflation, hash chains are never searched beyond this
+ * length. A higher limit improves compression ratio but degrades the
+ * speed.
+ */
+
+ uInt max_lazy_match;
+ /* Attempt to find a better match only when the current match is strictly
+ * smaller than this value. This mechanism is used only for compression
+ * levels >= 4.
+ */
+# define max_insert_length max_lazy_match
+ /* Insert new strings in the hash table only if the match length is not
+ * greater than this length. This saves time but degrades compression.
+ * max_insert_length is used only for compression levels <= 3.
+ */
+
+ int level; /* compression level (1..9) */
+ int strategy; /* favor or force Huffman coding*/
+
+ uInt good_match;
+ /* Use a faster search when the previous match is longer than this */
+
+ int nice_match; /* Stop searching when current match exceeds this */
+
+ /* used by trees.c: */
+ /* Didn't use ct_data typedef below to supress compiler warning */
+ struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
+ struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+ struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
+
+ struct tree_desc_s l_desc; /* desc. for literal tree */
+ struct tree_desc_s d_desc; /* desc. for distance tree */
+ struct tree_desc_s bl_desc; /* desc. for bit length tree */
+
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
+ int heap_len; /* number of elements in the heap */
+ int heap_max; /* element of largest frequency */
+ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+ * The same heap array is used to build all trees.
+ */
+
+ uch depth[2*L_CODES+1];
+ /* Depth of each subtree used as tie breaker for trees of equal frequency
+ */
+
+ uchf *l_buf; /* buffer for literals or lengths */
+
+ uInt lit_bufsize;
+ /* Size of match buffer for literals/lengths. There are 4 reasons for
+ * limiting lit_bufsize to 64K:
+ * - frequencies can be kept in 16 bit counters
+ * - if compression is not successful for the first block, all input
+ * data is still in the window so we can still emit a stored block even
+ * when input comes from standard input. (This can also be done for
+ * all blocks if lit_bufsize is not greater than 32K.)
+ * - if compression is not successful for a file smaller than 64K, we can
+ * even emit a stored file instead of a stored block (saving 5 bytes).
+ * This is applicable only for zip (not gzip or zlib).
+ * - creating new Huffman trees less frequently may not provide fast
+ * adaptation to changes in the input data statistics. (Take for
+ * example a binary file with poorly compressible code followed by
+ * a highly compressible string table.) Smaller buffer sizes give
+ * fast adaptation but have of course the overhead of transmitting
+ * trees more frequently.
+ * - I can't count above 4
+ */
+
+ uInt last_lit; /* running index in l_buf */
+
+ ushf *d_buf;
+ /* Buffer for distances. To simplify the code, d_buf and l_buf have
+ * the same number of elements. To use different lengths, an extra flag
+ * array would be necessary.
+ */
+
+ ulg opt_len; /* bit length of current block with optimal trees */
+ ulg static_len; /* bit length of current block with static trees */
+ uInt matches; /* number of string matches in current block */
+ int last_eob_len; /* bit length of EOB code for last block */
+
+#ifdef DEBUG
+ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
+#endif
+
+ ush bi_buf;
+ /* Output buffer. bits are inserted starting at the bottom (least
+ * significant bits).
+ */
+ int bi_valid;
+ /* Number of valid bits in bi_buf. All bits above the last valid bit
+ * are always zero.
+ */
+
+} FAR deflate_state;
+
+/* Output a byte on the stream.
+ * IN assertion: there is enough room in pending_buf.
+ */
+#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
+
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
+/* In order to simplify the code, particularly on 16 bit machines, match
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
+ /* in trees.c */
+void _tr_init OF((deflate_state *s));
+int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ int eof));
+void _tr_align OF((deflate_state *s));
+void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ int eof));
+
+#define d_code(dist) \
+ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+ extern uch _length_code[];
+ extern uch _dist_code[];
+#else
+ extern const uch _length_code[];
+ extern const uch _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+ { uch cc = (c); \
+ s->d_buf[s->last_lit] = 0; \
+ s->l_buf[s->last_lit++] = cc; \
+ s->dyn_ltree[cc].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+# define _tr_tally_dist(s, distance, length, flush) \
+ { uch len = (length); \
+ ush dist = (distance); \
+ s->d_buf[s->last_lit] = dist; \
+ s->l_buf[s->last_lit++] = len; \
+ dist--; \
+ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+ s->dyn_dtree[d_code(dist)].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+ flush = _tr_tally(s, distance, length)
+#endif
+
+#endif
diff --git a/setedit/libz/gnumake.in b/setedit/libz/gnumake.in
new file mode 100644
index 0000000..f1edd59
--- /dev/null
+++ b/setedit/libz/gnumake.in
@@ -0,0 +1,175 @@
+# Makefile for zlib
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# ./configure; make test
+# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+# make install
+# To install in $HOME instead of /usr/local, use:
+# make install prefix=$HOME
+
+CC=@CC@
+
+CFLAGS=@XCFLAGS@
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+LDFLAGS=-L. -lz
+LDSHARED=$(CC)
+CPP=$(CC) -E
+
+VER=1.1.3
+LIBS=libz.a
+SHAREDLIB=libz.so
+
+AR=@AR@ rc
+RANLIB=ranlib
+TAR=tar
+SHELL=/bin/sh
+
+prefix = @PREFIX@
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+includedir = ${prefix}/include
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+OBJA =
+# to use the asm code: make OBJA=match.o
+
+TEST_OBJS = example.o minigzip.o
+
+DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+ contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+ contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+ contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+ contrib/delphi*/*.???
+
+all: example minigzip
+
+test: all
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+libz.a: $(OBJS) $(OBJA)
+ $(AR) $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+
+$(SHAREDLIB).$(VER): $(OBJS)
+ $(LDSHARED) -o $@ $(OBJS)
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
+
+example: example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+
+minigzip: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+install: $(LIBS)
+ -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
+ -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
+ cp zlib.h zconf.h $(includedir)
+ chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+ cp $(LIBS) $(libdir)
+ cd $(libdir); chmod 755 $(LIBS)
+ -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+ cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
+ (ldconfig || true) >/dev/null 2>&1; \
+ fi
+# The ranlib in install is needed on NeXTSTEP which checks file times
+# ldconfig is for Linux
+
+uninstall:
+ cd $(includedir); \
+ v=$(VER); \
+ if test -f zlib.h; then \
+ v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
+ rm -f zlib.h zconf.h; \
+ fi; \
+ cd $(libdir); rm -f libz.a; \
+ if test -f $(SHAREDLIB).$$v; then \
+ rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
+ fi
+
+clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
+ _match.s maketree
+
+distclean: clean
+
+zip:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ zip -ul9 zlib$$v $(DISTFILES)
+ mv Makefile~ Makefile
+
+dist:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ rm -f $$d.tar.gz; \
+ if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+ files=""; \
+ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+ cd ..; \
+ GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ if test ! -d $$d; then rm -f $$d; fi
+ mv Makefile~ Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
+
diff --git a/setedit/libz/gzio.c b/setedit/libz/gzio.c
new file mode 100644
index 0000000..710896e
--- /dev/null
+++ b/setedit/libz/gzio.c
@@ -0,0 +1,875 @@
+/* gzio.c -- IO on .gz files
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Compile this file with -DNO_DEFLATE to avoid the compression code.
+ */
+
+/* @(#) $Id: gzio.c,v 1.1.1.1 2001/09/11 13:58:58 set Exp $ */
+
+#include <stdio.h>
+
+#include "zutil.h"
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#ifndef Z_BUFSIZE
+# ifdef MAXSEG_64K
+# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
+# else
+# define Z_BUFSIZE 16384
+# endif
+#endif
+#ifndef Z_PRINTF_BUFSIZE
+# define Z_PRINTF_BUFSIZE 4096
+#endif
+
+#define ALLOC(size) malloc(size)
+#define TRYFREE(p) {if (p) free(p);}
+
+static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+
+/* gzip flag byte */
+#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
+#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
+#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
+#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define COMMENT 0x10 /* bit 4 set: file comment present */
+#define RESERVED 0xE0 /* bits 5..7: reserved */
+
+typedef struct gz_stream {
+ z_stream stream;
+ int z_err; /* error code for last stream operation */
+ int z_eof; /* set if end of input file */
+ FILE *file; /* .gz file */
+ Byte *inbuf; /* input buffer */
+ Byte *outbuf; /* output buffer */
+ uLong crc; /* crc32 of uncompressed data */
+ char *msg; /* error message */
+ char *path; /* path name for debugging only */
+ int transparent; /* 1 if input file is not a .gz file */
+ char mode; /* 'w' or 'r' */
+ long startpos; /* start of compressed data in file (header skipped) */
+} gz_stream;
+
+
+local gzFile gz_open OF((const char *path, const char *mode, int fd));
+local int do_flush OF((gzFile file, int flush));
+local int get_byte OF((gz_stream *s));
+local void check_header OF((gz_stream *s));
+local int destroy OF((gz_stream *s));
+local void putLong OF((FILE *file, uLong x));
+local uLong getLong OF((gz_stream *s));
+
+/* ===========================================================================
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb"). The file is given either by file descriptor
+ or path name (if fd == -1).
+ gz_open return NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR).
+*/
+local gzFile gz_open (path, mode, fd)
+ const char *path;
+ const char *mode;
+ int fd;
+{
+ int err;
+ int level = Z_DEFAULT_COMPRESSION; /* compression level */
+ int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
+ char *p = (char*)mode;
+ gz_stream *s;
+ char fmode[80]; /* copy of mode, without the compression level */
+ char *m = fmode;
+
+ if (!path || !mode) return Z_NULL;
+
+ s = (gz_stream *)ALLOC(sizeof(gz_stream));
+ if (!s) return Z_NULL;
+
+ s->stream.zalloc = (alloc_func)0;
+ s->stream.zfree = (free_func)0;
+ s->stream.opaque = (voidpf)0;
+ s->stream.next_in = s->inbuf = Z_NULL;
+ s->stream.next_out = s->outbuf = Z_NULL;
+ s->stream.avail_in = s->stream.avail_out = 0;
+ s->file = NULL;
+ s->z_err = Z_OK;
+ s->z_eof = 0;
+ s->crc = crc32(0L, Z_NULL, 0);
+ s->msg = NULL;
+ s->transparent = 0;
+
+ s->path = (char*)ALLOC(strlen(path)+1);
+ if (s->path == NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ strcpy(s->path, path); /* do this early for debugging */
+
+ s->mode = '\0';
+ do {
+ if (*p == 'r') s->mode = 'r';
+ if (*p == 'w' || *p == 'a') s->mode = 'w';
+ if (*p >= '0' && *p <= '9') {
+ level = *p - '0';
+ } else if (*p == 'f') {
+ strategy = Z_FILTERED;
+ } else if (*p == 'h') {
+ strategy = Z_HUFFMAN_ONLY;
+ } else {
+ *m++ = *p; /* copy the mode */
+ }
+ } while (*p++ && m != fmode + sizeof(fmode));
+ if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ err = Z_STREAM_ERROR;
+#else
+ err = deflateInit2(&(s->stream), level,
+ Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
+ /* windowBits is passed < 0 to suppress zlib header */
+
+ s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
+#endif
+ if (err != Z_OK || s->outbuf == Z_NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ } else {
+ s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
+
+ err = inflateInit2(&(s->stream), -MAX_WBITS);
+ /* windowBits is passed < 0 to tell that there is no zlib header.
+ * Note that in this case inflate *requires* an extra "dummy" byte
+ * after the compressed stream in order to complete decompression and
+ * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
+ * present after the compressed stream.
+ */
+ if (err != Z_OK || s->inbuf == Z_NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+
+ errno = 0;
+ s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
+
+ if (s->file == NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ if (s->mode == 'w') {
+ /* Write a very simple .gz header:
+ */
+ fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
+ Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
+ s->startpos = 10L;
+ /* We use 10L instead of ftell(s->file) to because ftell causes an
+ * fflush on some systems. This version of the library doesn't use
+ * startpos anyway in write mode, so this initialization is not
+ * necessary.
+ */
+ } else {
+ check_header(s); /* skip the .gz header */
+ s->startpos = (ftell(s->file) - s->stream.avail_in);
+ }
+
+ return (gzFile)s;
+}
+
+/* ===========================================================================
+ Opens a gzip (.gz) file for reading or writing.
+*/
+gzFile ZEXPORT gzopen (path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open (path, mode, -1);
+}
+
+/* ===========================================================================
+ Associate a gzFile with the file descriptor fd. fd is not dup'ed here
+ to mimic the behavio(u)r of fdopen.
+*/
+gzFile ZEXPORT gzdopen (fd, mode)
+ int fd;
+ const char *mode;
+{
+ char name[20];
+
+ if (fd < 0) return (gzFile)Z_NULL;
+ sprintf(name, "<fd:%d>", fd); /* for debugging */
+
+ return gz_open (name, mode, fd);
+}
+
+/* ===========================================================================
+ * Update the compression level and strategy
+ */
+int ZEXPORT gzsetparams (file, level, strategy)
+ gzFile file;
+ int level;
+ int strategy;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ /* Make room to allow flushing */
+ if (s->stream.avail_out == 0) {
+
+ s->stream.next_out = s->outbuf;
+ if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
+ s->z_err = Z_ERRNO;
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+
+ return deflateParams (&(s->stream), level, strategy);
+}
+
+/* ===========================================================================
+ Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+ for end of file.
+ IN assertion: the stream s has been sucessfully opened for reading.
+*/
+local int get_byte(s)
+ gz_stream *s;
+{
+ if (s->z_eof) return EOF;
+ if (s->stream.avail_in == 0) {
+ errno = 0;
+ s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
+ if (s->stream.avail_in == 0) {
+ s->z_eof = 1;
+ if (ferror(s->file)) s->z_err = Z_ERRNO;
+ return EOF;
+ }
+ s->stream.next_in = s->inbuf;
+ }
+ s->stream.avail_in--;
+ return *(s->stream.next_in)++;
+}
+
+/* ===========================================================================
+ Check the gzip header of a gz_stream opened for reading. Set the stream
+ mode to transparent if the gzip magic header is not present; set s->err
+ to Z_DATA_ERROR if the magic header is present but the rest of the header
+ is incorrect.
+ IN assertion: the stream s has already been created sucessfully;
+ s->stream.avail_in is zero for the first time, but may be non-zero
+ for concatenated .gz files.
+*/
+local void check_header(s)
+ gz_stream *s;
+{
+ int method; /* method byte */
+ int flags; /* flags byte */
+ uInt len;
+ int c;
+
+ /* Check the gzip magic header */
+ for (len = 0; len < 2; len++) {
+ c = get_byte(s);
+ if (c != gz_magic[len]) {
+ if (len != 0) s->stream.avail_in++, s->stream.next_in--;
+ if (c != EOF) {
+ s->stream.avail_in++, s->stream.next_in--;
+ s->transparent = 1;
+ }
+ s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END;
+ return;
+ }
+ }
+ method = get_byte(s);
+ flags = get_byte(s);
+ if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
+ s->z_err = Z_DATA_ERROR;
+ return;
+ }
+
+ /* Discard time, xflags and OS code: */
+ for (len = 0; len < 6; len++) (void)get_byte(s);
+
+ if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
+ len = (uInt)get_byte(s);
+ len += ((uInt)get_byte(s))<<8;
+ /* len is garbage if EOF but the loop below will quit anyway */
+ while (len-- != 0 && get_byte(s) != EOF) ;
+ }
+ if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
+ while ((c = get_byte(s)) != 0 && c != EOF) ;
+ }
+ if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
+ while ((c = get_byte(s)) != 0 && c != EOF) ;
+ }
+ if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
+ for (len = 0; len < 2; len++) (void)get_byte(s);
+ }
+ s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
+}
+
+ /* ===========================================================================
+ * Cleanup then free the given gz_stream. Return a zlib error code.
+ Try freeing in the reverse order of allocations.
+ */
+local int destroy (s)
+ gz_stream *s;
+{
+ int err = Z_OK;
+
+ if (!s) return Z_STREAM_ERROR;
+
+ TRYFREE(s->msg);
+
+ if (s->stream.state != NULL) {
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ err = Z_STREAM_ERROR;
+#else
+ err = deflateEnd(&(s->stream));
+#endif
+ } else if (s->mode == 'r') {
+ err = inflateEnd(&(s->stream));
+ }
+ }
+ if (s->file != NULL && fclose(s->file)) {
+#ifdef ESPIPE
+ if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
+#endif
+ err = Z_ERRNO;
+ }
+ if (s->z_err < 0) err = s->z_err;
+
+ TRYFREE(s->inbuf);
+ TRYFREE(s->outbuf);
+ TRYFREE(s->path);
+ TRYFREE(s);
+ return err;
+}
+
+/* ===========================================================================
+ Reads the given number of uncompressed bytes from the compressed file.
+ gzread returns the number of bytes actually read (0 for end of file).
+*/
+int ZEXPORT gzread (file, buf, len)
+ gzFile file;
+ voidp buf;
+ unsigned len;
+{
+ gz_stream *s = (gz_stream*)file;
+ Bytef *start = (Bytef*)buf; /* starting point for crc computation */
+ Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
+
+ if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
+
+ if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
+ if (s->z_err == Z_STREAM_END) return 0; /* EOF */
+
+ next_out = (Byte*)buf;
+ s->stream.next_out = (Bytef*)buf;
+ s->stream.avail_out = len;
+
+ while (s->stream.avail_out != 0) {
+
+ if (s->transparent) {
+ /* Copy first the lookahead bytes: */
+ uInt n = s->stream.avail_in;
+ if (n > s->stream.avail_out) n = s->stream.avail_out;
+ if (n > 0) {
+ zmemcpy(s->stream.next_out, s->stream.next_in, n);
+ next_out += n;
+ s->stream.next_out = next_out;
+ s->stream.next_in += n;
+ s->stream.avail_out -= n;
+ s->stream.avail_in -= n;
+ }
+ if (s->stream.avail_out > 0) {
+ s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out,
+ s->file);
+ }
+ len -= s->stream.avail_out;
+ s->stream.total_in += (uLong)len;
+ s->stream.total_out += (uLong)len;
+ if (len == 0) s->z_eof = 1;
+ return (int)len;
+ }
+ if (s->stream.avail_in == 0 && !s->z_eof) {
+
+ errno = 0;
+ s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
+ if (s->stream.avail_in == 0) {
+ s->z_eof = 1;
+ if (ferror(s->file)) {
+ s->z_err = Z_ERRNO;
+ break;
+ }
+ }
+ s->stream.next_in = s->inbuf;
+ }
+ s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
+
+ if (s->z_err == Z_STREAM_END) {
+ /* Check CRC and original size */
+ s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
+ start = s->stream.next_out;
+
+ if (getLong(s) != s->crc) {
+ s->z_err = Z_DATA_ERROR;
+ } else {
+ (void)getLong(s);
+ /* The uncompressed length returned by above getlong() may
+ * be different from s->stream.total_out) in case of
+ * concatenated .gz files. Check for such files:
+ */
+ check_header(s);
+ if (s->z_err == Z_OK) {
+ uLong total_in = s->stream.total_in;
+ uLong total_out = s->stream.total_out;
+
+ inflateReset(&(s->stream));
+ s->stream.total_in = total_in;
+ s->stream.total_out = total_out;
+ s->crc = crc32(0L, Z_NULL, 0);
+ }
+ }
+ }
+ if (s->z_err != Z_OK || s->z_eof) break;
+ }
+ s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
+
+ return (int)(len - s->stream.avail_out);
+}
+
+
+/* ===========================================================================
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+int ZEXPORT gzgetc(file)
+ gzFile file;
+{
+ unsigned char c;
+
+ return gzread(file, &c, 1) == 1 ? c : -1;
+}
+
+
+/* ===========================================================================
+ Reads bytes from the compressed file until len-1 characters are
+ read, or a newline character is read and transferred to buf, or an
+ end-of-file condition is encountered. The string is then terminated
+ with a null character.
+ gzgets returns buf, or Z_NULL in case of error.
+
+ The current implementation is not optimized at all.
+*/
+char * ZEXPORT gzgets(file, buf, len)
+ gzFile file;
+ char *buf;
+ int len;
+{
+ char *b = buf;
+ if (buf == Z_NULL || len <= 0) return Z_NULL;
+
+ while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
+ *buf = '\0';
+ return b == buf && len > 0 ? Z_NULL : b;
+}
+
+
+#ifndef NO_DEFLATE
+/* ===========================================================================
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of bytes actually written (0 in case of error).
+*/
+int ZEXPORT gzwrite (file, buf, len)
+ gzFile file;
+ const voidp buf;
+ unsigned len;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ s->stream.next_in = (Bytef*)buf;
+ s->stream.avail_in = len;
+
+ while (s->stream.avail_in != 0) {
+
+ if (s->stream.avail_out == 0) {
+
+ s->stream.next_out = s->outbuf;
+ if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
+ s->z_err = Z_ERRNO;
+ break;
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+ s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
+ if (s->z_err != Z_OK) break;
+ }
+ s->crc = crc32(s->crc, (const Bytef *)buf, len);
+
+ return (int)(len - s->stream.avail_in);
+}
+
+/* ===========================================================================
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+#ifdef STDC
+#include <stdarg.h>
+
+int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
+{
+ char buf[Z_PRINTF_BUFSIZE];
+ va_list va;
+ int len;
+
+ va_start(va, format);
+#ifdef HAS_vsnprintf
+ (void)vsnprintf(buf, sizeof(buf), format, va);
+#else
+ (void)vsprintf(buf, format, va);
+#endif
+ va_end(va);
+ len = strlen(buf); /* some *sprintf don't return the nb of bytes written */
+ if (len <= 0) return 0;
+
+ return gzwrite(file, buf, (unsigned)len);
+}
+#else /* not ANSI C */
+
+int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
+ gzFile file;
+ const char *format;
+ int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
+{
+ char buf[Z_PRINTF_BUFSIZE];
+ int len;
+
+#ifdef HAS_snprintf
+ snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#else
+ sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#endif
+ len = strlen(buf); /* old sprintf doesn't return the nb of bytes written */
+ if (len <= 0) return 0;
+
+ return gzwrite(file, buf, len);
+}
+#endif
+
+/* ===========================================================================
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+int ZEXPORT gzputc(file, c)
+ gzFile file;
+ int c;
+{
+ unsigned char cc = (unsigned char) c; /* required for big endian systems */
+
+ return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
+}
+
+
+/* ===========================================================================
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+int ZEXPORT gzputs(file, s)
+ gzFile file;
+ const char *s;
+{
+ return gzwrite(file, (char*)s, (unsigned)strlen(s));
+}
+
+
+/* ===========================================================================
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function.
+*/
+local int do_flush (file, flush)
+ gzFile file;
+ int flush;
+{
+ uInt len;
+ int done = 0;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ s->stream.avail_in = 0; /* should be zero already anyway */
+
+ for (;;) {
+ len = Z_BUFSIZE - s->stream.avail_out;
+
+ if (len != 0) {
+ if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
+ s->z_err = Z_ERRNO;
+ return Z_ERRNO;
+ }
+ s->stream.next_out = s->outbuf;
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+ if (done) break;
+ s->z_err = deflate(&(s->stream), flush);
+
+ /* Ignore the second of two consecutive flushes: */
+ if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
+
+ /* deflate has finished flushing only when it hasn't used up
+ * all the available space in the output buffer:
+ */
+ done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
+
+ if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
+ }
+ return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
+}
+
+int ZEXPORT gzflush (file, flush)
+ gzFile file;
+ int flush;
+{
+ gz_stream *s = (gz_stream*)file;
+ int err = do_flush (file, flush);
+
+ if (err) return err;
+ fflush(s->file);
+ return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
+}
+#endif /* NO_DEFLATE */
+
+/* ===========================================================================
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error.
+ SEEK_END is not implemented, returns error.
+ In this version of the library, gzseek can be extremely slow.
+*/
+z_off_t ZEXPORT gzseek (file, offset, whence)
+ gzFile file;
+ z_off_t offset;
+ int whence;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || whence == SEEK_END ||
+ s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
+ return -1L;
+ }
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ return -1L;
+#else
+ if (whence == SEEK_SET) {
+ offset -= s->stream.total_in;
+ }
+ if (offset < 0) return -1L;
+
+ /* At this point, offset is the number of zero bytes to write. */
+ if (s->inbuf == Z_NULL) {
+ s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
+ zmemzero(s->inbuf, Z_BUFSIZE);
+ }
+ while (offset > 0) {
+ uInt size = Z_BUFSIZE;
+ if (offset < Z_BUFSIZE) size = (uInt)offset;
+
+ size = gzwrite(file, s->inbuf, size);
+ if (size == 0) return -1L;
+
+ offset -= size;
+ }
+ return (z_off_t)s->stream.total_in;
+#endif
+ }
+ /* Rest of function is for reading only */
+
+ /* compute absolute position */
+ if (whence == SEEK_CUR) {
+ offset += s->stream.total_out;
+ }
+ if (offset < 0) return -1L;
+
+ if (s->transparent) {
+ /* map to fseek */
+ s->stream.avail_in = 0;
+ s->stream.next_in = s->inbuf;
+ if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
+
+ s->stream.total_in = s->stream.total_out = (uLong)offset;
+ return offset;
+ }
+
+ /* For a negative seek, rewind and use positive seek */
+ if ((uLong)offset >= s->stream.total_out) {
+ offset -= s->stream.total_out;
+ } else if (gzrewind(file) < 0) {
+ return -1L;
+ }
+ /* offset is now the number of bytes to skip. */
+
+ if (offset != 0 && s->outbuf == Z_NULL) {
+ s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
+ }
+ while (offset > 0) {
+ int size = Z_BUFSIZE;
+ if (offset < Z_BUFSIZE) size = (int)offset;
+
+ size = gzread(file, s->outbuf, (uInt)size);
+ if (size <= 0) return -1L;
+ offset -= size;
+ }
+ return (z_off_t)s->stream.total_out;
+}
+
+/* ===========================================================================
+ Rewinds input file.
+*/
+int ZEXPORT gzrewind (file)
+ gzFile file;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'r') return -1;
+
+ s->z_err = Z_OK;
+ s->z_eof = 0;
+ s->stream.avail_in = 0;
+ s->stream.next_in = s->inbuf;
+ s->crc = crc32(0L, Z_NULL, 0);
+
+ if (s->startpos == 0) { /* not a compressed file */
+ rewind(s->file);
+ return 0;
+ }
+
+ (void) inflateReset(&s->stream);
+ return fseek(s->file, s->startpos, SEEK_SET);
+}
+
+/* ===========================================================================
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+*/
+z_off_t ZEXPORT gztell (file)
+ gzFile file;
+{
+ return gzseek(file, 0L, SEEK_CUR);
+}
+
+/* ===========================================================================
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+int ZEXPORT gzeof (file)
+ gzFile file;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ return (s == NULL || s->mode != 'r') ? 0 : s->z_eof;
+}
+
+/* ===========================================================================
+ Outputs a long in LSB order to the given file
+*/
+local void putLong (file, x)
+ FILE *file;
+ uLong x;
+{
+ int n;
+ for (n = 0; n < 4; n++) {
+ fputc((int)(x & 0xff), file);
+ x >>= 8;
+ }
+}
+
+/* ===========================================================================
+ Reads a long in LSB order from the given gz_stream. Sets z_err in case
+ of error.
+*/
+local uLong getLong (s)
+ gz_stream *s;
+{
+ uLong x = (uLong)get_byte(s);
+ int c;
+
+ x += ((uLong)get_byte(s))<<8;
+ x += ((uLong)get_byte(s))<<16;
+ c = get_byte(s);
+ if (c == EOF) s->z_err = Z_DATA_ERROR;
+ x += ((uLong)c)<<24;
+ return x;
+}
+
+/* ===========================================================================
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state.
+*/
+int ZEXPORT gzclose (file)
+ gzFile file;
+{
+ int err;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL) return Z_STREAM_ERROR;
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ return Z_STREAM_ERROR;
+#else
+ err = do_flush (file, Z_FINISH);
+ if (err != Z_OK) return destroy((gz_stream*)file);
+
+ putLong (s->file, s->crc);
+ putLong (s->file, s->stream.total_in);
+#endif
+ }
+ return destroy((gz_stream*)file);
+}
+
+/* ===========================================================================
+ Returns the error message for the last error which occured on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occured in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+const char* ZEXPORT gzerror (file, errnum)
+ gzFile file;
+ int *errnum;
+{
+ char *m;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL) {
+ *errnum = Z_STREAM_ERROR;
+ return (const char*)ERR_MSG(Z_STREAM_ERROR);
+ }
+ *errnum = s->z_err;
+ if (*errnum == Z_OK) return (const char*)"";
+
+ m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
+
+ if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
+
+ TRYFREE(s->msg);
+ s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
+ strcpy(s->msg, s->path);
+ strcat(s->msg, ": ");
+ strcat(s->msg, m);
+ return (const char*)s->msg;
+}
diff --git a/setedit/libz/infblock.c b/setedit/libz/infblock.c
new file mode 100644
index 0000000..f4920fa
--- /dev/null
+++ b/setedit/libz/infblock.c
@@ -0,0 +1,398 @@
+/* infblock.c -- interpret and process block types to last block
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* Table for deflate from PKZIP's appnote.txt. */
+local const uInt border[] = { /* Order of the bit length code lengths */
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+/*
+ Notes beyond the 1.93a appnote.txt:
+
+ 1. Distance pointers never point before the beginning of the output
+ stream.
+ 2. Distance pointers can point back across blocks, up to 32k away.
+ 3. There is an implied maximum of 7 bits for the bit length table and
+ 15 bits for the actual data.
+ 4. If only one code exists, then it is encoded using one bit. (Zero
+ would be more efficient, but perhaps a little confusing.) If two
+ codes exist, they are coded using one bit each (0 and 1).
+ 5. There is no way of sending zero distance codes--a dummy must be
+ sent if there are none. (History: a pre 2.0 version of PKZIP would
+ store blocks with no distance codes, but this was discovered to be
+ too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
+ zero distance codes, which is sent as one code of zero bits in
+ length.
+ 6. There are up to 286 literal/length codes. Code 256 represents the
+ end-of-block. Note however that the static length tree defines
+ 288 codes just to fill out the Huffman codes. Codes 286 and 287
+ cannot be used though, since there is no length base or extra bits
+ defined for them. Similarily, there are up to 30 distance codes.
+ However, static trees define 32 codes (all 5 bits) to fill out the
+ Huffman codes, but the last two had better not show up in the data.
+ 7. Unzip can check dynamic Huffman blocks for complete code sets.
+ The exception is that a single code would not be complete (see #4).
+ 8. The five bits following the block type is really the number of
+ literal codes sent minus 257.
+ 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
+ (1+6+6). Therefore, to output three times the length, you output
+ three codes (1+1+1), whereas to output four times the same length,
+ you only need two codes (1+3). Hmm.
+ 10. In the tree reconstruction algorithm, Code = Code + Increment
+ only if BitLength(i) is not zero. (Pretty obvious.)
+ 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
+ 12. Note: length code 284 can represent 227-258, but length code 285
+ really is 258. The last length deserves its own, short code
+ since it gets used a lot in very redundant files. The length
+ 258 is special since 258 - 3 (the min match length) is 255.
+ 13. The literal/length and distance code bit lengths are read as a
+ single stream of lengths. It is possible (and advantageous) for
+ a repeat code (16, 17, or 18) to go across the boundary between
+ the two sets of lengths.
+ */
+
+
+void inflate_blocks_reset(s, z, c)
+inflate_blocks_statef *s;
+z_streamp z;
+uLongf *c;
+{
+ if (c != Z_NULL)
+ *c = s->check;
+ if (s->mode == BTREE || s->mode == DTREE)
+ ZFREE(z, s->sub.trees.blens);
+ if (s->mode == CODES)
+ inflate_codes_free(s->sub.decode.codes, z);
+ s->mode = TYPE;
+ s->bitk = 0;
+ s->bitb = 0;
+ s->read = s->write = s->window;
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+ Tracev((stderr, "inflate: blocks reset\n"));
+}
+
+
+inflate_blocks_statef *inflate_blocks_new(z, c, w)
+z_streamp z;
+check_func c;
+uInt w;
+{
+ inflate_blocks_statef *s;
+
+ if ((s = (inflate_blocks_statef *)ZALLOC
+ (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
+ return s;
+ if ((s->hufts =
+ (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
+ {
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
+ {
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ s->end = s->window + w;
+ s->checkfn = c;
+ s->mode = TYPE;
+ Tracev((stderr, "inflate: blocks allocated\n"));
+ inflate_blocks_reset(s, z, Z_NULL);
+ return s;
+}
+
+
+int inflate_blocks(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt t; /* temporary storage */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input based on current state */
+ while (1) switch (s->mode)
+ {
+ case TYPE:
+ NEEDBITS(3)
+ t = (uInt)b & 7;
+ s->last = t & 1;
+ switch (t >> 1)
+ {
+ case 0: /* stored */
+ Tracev((stderr, "inflate: stored block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ t = k & 7; /* go to byte boundary */
+ DUMPBITS(t)
+ s->mode = LENS; /* get length of stored block */
+ break;
+ case 1: /* fixed */
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ s->last ? " (last)" : ""));
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+
+ inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+ s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
+ if (s->sub.decode.codes == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ }
+ DUMPBITS(3)
+ s->mode = CODES;
+ break;
+ case 2: /* dynamic */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ s->mode = TABLE;
+ break;
+ case 3: /* illegal */
+ DUMPBITS(3)
+ s->mode = BAD;
+ z->msg = (char*)"invalid block type";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ break;
+ case LENS:
+ NEEDBITS(32)
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
+ {
+ s->mode = BAD;
+ z->msg = (char*)"invalid stored block lengths";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ s->sub.left = (uInt)b & 0xffff;
+ b = k = 0; /* dump bits */
+ Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
+ s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
+ break;
+ case STORED:
+ if (n == 0)
+ LEAVE
+ NEEDOUT
+ t = s->sub.left;
+ if (t > n) t = n;
+ if (t > m) t = m;
+ zmemcpy(q, p, t);
+ p += t; n -= t;
+ q += t; m -= t;
+ if ((s->sub.left -= t) != 0)
+ break;
+ Tracev((stderr, "inflate: stored end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ s->mode = s->last ? DRY : TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14)
+ s->sub.trees.table = t = (uInt)b & 0x3fff;
+#ifndef PKZIP_BUG_WORKAROUND
+ if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
+ {
+ s->mode = BAD;
+ z->msg = (char*)"too many length or distance symbols";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+#endif
+ t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
+ if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ DUMPBITS(14)
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ s->mode = BTREE;
+ case BTREE:
+ while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
+ {
+ NEEDBITS(3)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
+ DUMPBITS(3)
+ }
+ while (s->sub.trees.index < 19)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
+ s->sub.trees.bb = 7;
+ t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
+ &s->sub.trees.tb, s->hufts, z);
+ if (t != Z_OK)
+ {
+ ZFREE(z, s->sub.trees.blens);
+ r = t;
+ if (r == Z_DATA_ERROR)
+ s->mode = BAD;
+ LEAVE
+ }
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: bits tree ok\n"));
+ s->mode = DTREE;
+ case DTREE:
+ while (t = s->sub.trees.table,
+ s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
+ {
+ inflate_huft *h;
+ uInt i, j, c;
+
+ t = s->sub.trees.bb;
+ NEEDBITS(t)
+ h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
+ t = h->bits;
+ c = h->base;
+ if (c < 16)
+ {
+ DUMPBITS(t)
+ s->sub.trees.blens[s->sub.trees.index++] = c;
+ }
+ else /* c == 16..18 */
+ {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ NEEDBITS(t + i)
+ DUMPBITS(t)
+ j += (uInt)b & inflate_mask[i];
+ DUMPBITS(i)
+ i = s->sub.trees.index;
+ t = s->sub.trees.table;
+ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
+ (c == 16 && i < 1))
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = BAD;
+ z->msg = (char*)"invalid bit length repeat";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
+ do {
+ s->sub.trees.blens[i++] = c;
+ } while (--j);
+ s->sub.trees.index = i;
+ }
+ }
+ s->sub.trees.tb = Z_NULL;
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ inflate_codes_statef *c;
+
+ bl = 9; /* must be <= 9 for lookahead assumptions */
+ bd = 6; /* must be <= 9 for lookahead assumptions */
+ t = s->sub.trees.table;
+ t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ ZFREE(z, s->sub.trees.blens);
+ if (t != Z_OK)
+ {
+ if (t == (uInt)Z_DATA_ERROR)
+ s->mode = BAD;
+ r = t;
+ LEAVE
+ }
+ Tracev((stderr, "inflate: trees ok\n"));
+ if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ s->sub.decode.codes = c;
+ }
+ s->mode = CODES;
+ case CODES:
+ UPDATE
+ if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
+ return inflate_flush(s, z, r);
+ r = Z_OK;
+ inflate_codes_free(s->sub.decode.codes, z);
+ LOAD
+ Tracev((stderr, "inflate: codes end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ if (!s->last)
+ {
+ s->mode = TYPE;
+ break;
+ }
+ s->mode = DRY;
+ case DRY:
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ s->mode = DONE;
+ case DONE:
+ r = Z_STREAM_END;
+ LEAVE
+ case BAD:
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+}
+
+
+int inflate_blocks_free(s, z)
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_blocks_reset(s, z, Z_NULL);
+ ZFREE(z, s->window);
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ Tracev((stderr, "inflate: blocks freed\n"));
+ return Z_OK;
+}
+
+
+void inflate_set_dictionary(s, d, n)
+inflate_blocks_statef *s;
+const Bytef *d;
+uInt n;
+{
+ zmemcpy(s->window, d, n);
+ s->read = s->write = s->window + n;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH.
+ * IN assertion: s != Z_NULL
+ */
+int inflate_blocks_sync_point(s)
+inflate_blocks_statef *s;
+{
+ return s->mode == LENS;
+}
diff --git a/setedit/libz/infblock.h b/setedit/libz/infblock.h
new file mode 100644
index 0000000..bd25c80
--- /dev/null
+++ b/setedit/libz/infblock.h
@@ -0,0 +1,39 @@
+/* infblock.h -- header to use infblock.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+struct inflate_blocks_state;
+typedef struct inflate_blocks_state FAR inflate_blocks_statef;
+
+extern inflate_blocks_statef * inflate_blocks_new OF((
+ z_streamp z,
+ check_func c, /* check function */
+ uInt w)); /* window size */
+
+extern int inflate_blocks OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int)); /* initial return code */
+
+extern void inflate_blocks_reset OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ uLongf *)); /* check value on output */
+
+extern int inflate_blocks_free OF((
+ inflate_blocks_statef *,
+ z_streamp));
+
+extern void inflate_set_dictionary OF((
+ inflate_blocks_statef *s,
+ const Bytef *d, /* dictionary */
+ uInt n)); /* dictionary length */
+
+extern int inflate_blocks_sync_point OF((
+ inflate_blocks_statef *s));
diff --git a/setedit/libz/infcodes.c b/setedit/libz/infcodes.c
new file mode 100644
index 0000000..d4e5ee9
--- /dev/null
+++ b/setedit/libz/infcodes.c
@@ -0,0 +1,257 @@
+/* infcodes.c -- process literals and length/distance pairs
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ START, /* x: set up for LEN */
+ LEN, /* i: get length/literal/eob next */
+ LENEXT, /* i: getting length extra (have base) */
+ DIST, /* i: get distance next */
+ DISTEXT, /* i: getting distance extra */
+ COPY, /* o: copying bytes in window, waiting for space */
+ LIT, /* o: got literal, waiting for output space */
+ WASH, /* o: got eob, possibly still output waiting */
+ END, /* x: got eob and all data flushed */
+ BADCODE} /* x: got error */
+inflate_codes_mode;
+
+/* inflate codes private state */
+struct inflate_codes_state {
+
+ /* mode */
+ inflate_codes_mode mode; /* current inflate_codes mode */
+
+ /* mode dependent information */
+ uInt len;
+ union {
+ struct {
+ inflate_huft *tree; /* pointer into tree */
+ uInt need; /* bits needed */
+ } code; /* if LEN or DIST, where in tree */
+ uInt lit; /* if LIT, literal */
+ struct {
+ uInt get; /* bits to get for extra */
+ uInt dist; /* distance back to copy from */
+ } copy; /* if EXT or COPY, where and how much */
+ } sub; /* submode */
+
+ /* mode independent information */
+ Byte lbits; /* ltree bits decoded per branch */
+ Byte dbits; /* dtree bits decoder per branch */
+ inflate_huft *ltree; /* literal/length/eob tree */
+ inflate_huft *dtree; /* distance tree */
+
+};
+
+
+inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+z_streamp z;
+{
+ inflate_codes_statef *c;
+
+ if ((c = (inflate_codes_statef *)
+ ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
+ {
+ c->mode = START;
+ c->lbits = (Byte)bl;
+ c->dbits = (Byte)bd;
+ c->ltree = tl;
+ c->dtree = td;
+ Tracev((stderr, "inflate: codes new\n"));
+ }
+ return c;
+}
+
+
+int inflate_codes(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt j; /* temporary storage */
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ Bytef *f; /* pointer to copy strings from */
+ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input and output based on current state */
+ while (1) switch (c->mode)
+ { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ case START: /* x: set up for LEN */
+#ifndef SLOW
+ if (m >= 258 && n >= 10)
+ {
+ UPDATE
+ r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
+ LOAD
+ if (r != Z_OK)
+ {
+ c->mode = r == Z_STREAM_END ? WASH : BADCODE;
+ break;
+ }
+ }
+#endif /* !SLOW */
+ c->sub.code.need = c->lbits;
+ c->sub.code.tree = c->ltree;
+ c->mode = LEN;
+ case LEN: /* i: get length/literal/eob next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e == 0) /* literal */
+ {
+ c->sub.lit = t->base;
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", t->base));
+ c->mode = LIT;
+ break;
+ }
+ if (e & 16) /* length */
+ {
+ c->sub.copy.get = e & 15;
+ c->len = t->base;
+ c->mode = LENEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ if (e & 32) /* end of block */
+ {
+ Tracevv((stderr, "inflate: end of block\n"));
+ c->mode = WASH;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid literal/length code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case LENEXT: /* i: getting length extra (have base) */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->len += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ c->sub.code.need = c->dbits;
+ c->sub.code.tree = c->dtree;
+ Tracevv((stderr, "inflate: length %u\n", c->len));
+ c->mode = DIST;
+ case DIST: /* i: get distance next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e & 16) /* distance */
+ {
+ c->sub.copy.get = e & 15;
+ c->sub.copy.dist = t->base;
+ c->mode = DISTEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid distance code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case DISTEXT: /* i: getting distance extra */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->sub.copy.dist += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
+ c->mode = COPY;
+ case COPY: /* o: copying bytes in window, waiting for space */
+#ifndef __TURBOC__ /* Turbo C bug for following expression */
+ f = (uInt)(q - s->window) < c->sub.copy.dist ?
+ s->end - (c->sub.copy.dist - (q - s->window)) :
+ q - c->sub.copy.dist;
+#else
+ f = q - c->sub.copy.dist;
+ if ((uInt)(q - s->window) < c->sub.copy.dist)
+ f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
+#endif
+ while (c->len)
+ {
+ NEEDOUT
+ OUTBYTE(*f++)
+ if (f == s->end)
+ f = s->window;
+ c->len--;
+ }
+ c->mode = START;
+ break;
+ case LIT: /* o: got literal, waiting for output space */
+ NEEDOUT
+ OUTBYTE(c->sub.lit)
+ c->mode = START;
+ break;
+ case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ c->mode = END;
+ case END:
+ r = Z_STREAM_END;
+ LEAVE
+ case BADCODE: /* x: got error */
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+void inflate_codes_free(c, z)
+inflate_codes_statef *c;
+z_streamp z;
+{
+ ZFREE(z, c);
+ Tracev((stderr, "inflate: codes free\n"));
+}
diff --git a/setedit/libz/infcodes.h b/setedit/libz/infcodes.h
new file mode 100644
index 0000000..6c750d8
--- /dev/null
+++ b/setedit/libz/infcodes.h
@@ -0,0 +1,27 @@
+/* infcodes.h -- header to use infcodes.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+struct inflate_codes_state;
+typedef struct inflate_codes_state FAR inflate_codes_statef;
+
+extern inflate_codes_statef *inflate_codes_new OF((
+ uInt, uInt,
+ inflate_huft *, inflate_huft *,
+ z_streamp ));
+
+extern int inflate_codes OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+extern void inflate_codes_free OF((
+ inflate_codes_statef *,
+ z_streamp ));
+
diff --git a/setedit/libz/inffast.c b/setedit/libz/inffast.c
new file mode 100644
index 0000000..61a78ee
--- /dev/null
+++ b/setedit/libz/inffast.c
@@ -0,0 +1,170 @@
+/* inffast.c -- process literals and length/distance pairs fast
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* macros for bit input with no checking and for returning unused bytes */
+#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
+
+/* Called with number of bytes left to write in window at least 258
+ (the maximum string length) and number of input bytes available
+ at least ten. The ten bytes are six bytes for the longest length/
+ distance pair plus four bytes for overloading the bit buffer. */
+
+int inflate_fast(bl, bd, tl, td, s, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ uInt ml; /* mask for literal/length tree */
+ uInt md; /* mask for distance tree */
+ uInt c; /* bytes to copy */
+ uInt d; /* distance back to copy from */
+ Bytef *r; /* copy source pointer */
+
+ /* load input, output, bit values */
+ LOAD
+
+ /* initialize masks */
+ ml = inflate_mask[bl];
+ md = inflate_mask[bd];
+
+ /* do until not enough input or output space for fast loop */
+ do { /* assume called with m >= 258 && n >= 10 */
+ /* get literal/length code */
+ GRABBITS(20) /* max bits for literal/length code */
+ if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ continue;
+ }
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits for length */
+ e &= 15;
+ c = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * length %u\n", c));
+
+ /* decode distance base of block to copy */
+ GRABBITS(15); /* max bits for distance code */
+ e = (t = td + ((uInt)b & md))->exop;
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits to add to distance base */
+ e &= 15;
+ GRABBITS(e) /* get extra bits (up to 13) */
+ d = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * distance %u\n", d));
+
+ /* do the copy */
+ m -= c;
+ if ((uInt)(q - s->window) >= d) /* offset before dest */
+ { /* just copy */
+ r = q - d;
+ *q++ = *r++; c--; /* minimum count is three, */
+ *q++ = *r++; c--; /* so unroll loop a little */
+ }
+ else /* else offset after destination */
+ {
+ e = d - (uInt)(q - s->window); /* bytes from offset to end */
+ r = s->end - e; /* pointer to offset */
+ if (c > e) /* if source crosses, */
+ {
+ c -= e; /* copy to end of window */
+ do {
+ *q++ = *r++;
+ } while (--e);
+ r = s->window; /* copy rest from start of window */
+ }
+ }
+ do { /* copy all or what's left */
+ *q++ = *r++;
+ } while (--c);
+ break;
+ }
+ else if ((e & 64) == 0)
+ {
+ t += t->base;
+ e = (t += ((uInt)b & inflate_mask[e]))->exop;
+ }
+ else
+ {
+ z->msg = (char*)"invalid distance code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ break;
+ }
+ if ((e & 64) == 0)
+ {
+ t += t->base;
+ if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ break;
+ }
+ }
+ else if (e & 32)
+ {
+ Tracevv((stderr, "inflate: * end of block\n"));
+ UNGRAB
+ UPDATE
+ return Z_STREAM_END;
+ }
+ else
+ {
+ z->msg = (char*)"invalid literal/length code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ } while (m >= 258 && n >= 10);
+
+ /* not enough input or output--restore pointers and return */
+ UNGRAB
+ UPDATE
+ return Z_OK;
+}
diff --git a/setedit/libz/inffast.h b/setedit/libz/inffast.h
new file mode 100644
index 0000000..8facec5
--- /dev/null
+++ b/setedit/libz/inffast.h
@@ -0,0 +1,17 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+extern int inflate_fast OF((
+ uInt,
+ uInt,
+ inflate_huft *,
+ inflate_huft *,
+ inflate_blocks_statef *,
+ z_streamp ));
diff --git a/setedit/libz/inffixed.h b/setedit/libz/inffixed.h
new file mode 100644
index 0000000..77f7e76
--- /dev/null
+++ b/setedit/libz/inffixed.h
@@ -0,0 +1,151 @@
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by the maketree.c program
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+local uInt fixed_bl = 9;
+local uInt fixed_bd = 5;
+local inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+local inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
diff --git a/setedit/libz/inflate.c b/setedit/libz/inflate.c
new file mode 100644
index 0000000..32e9b8d
--- /dev/null
+++ b/setedit/libz/inflate.c
@@ -0,0 +1,366 @@
+/* inflate.c -- zlib interface to inflate modules
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+
+struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
+
+typedef enum {
+ METHOD, /* waiting for method byte */
+ FLAG, /* waiting for flag byte */
+ DICT4, /* four dictionary check bytes to go */
+ DICT3, /* three dictionary check bytes to go */
+ DICT2, /* two dictionary check bytes to go */
+ DICT1, /* one dictionary check byte to go */
+ DICT0, /* waiting for inflateSetDictionary */
+ BLOCKS, /* decompressing blocks */
+ CHECK4, /* four check bytes to go */
+ CHECK3, /* three check bytes to go */
+ CHECK2, /* two check bytes to go */
+ CHECK1, /* one check byte to go */
+ DONE, /* finished check, done */
+ BAD} /* got an error--stay here */
+inflate_mode;
+
+/* inflate private state */
+struct internal_state {
+
+ /* mode */
+ inflate_mode mode; /* current inflate mode */
+
+ /* mode dependent information */
+ union {
+ uInt method; /* if FLAGS, method byte */
+ struct {
+ uLong was; /* computed check value */
+ uLong need; /* stream check value */
+ } check; /* if CHECK, check values to compare */
+ uInt marker; /* if BAD, inflateSync's marker bytes count */
+ } sub; /* submode */
+
+ /* mode independent information */
+ int nowrap; /* flag for no wrapper */
+ uInt wbits; /* log2(window size) (8..15, defaults to 15) */
+ inflate_blocks_statef
+ *blocks; /* current inflate_blocks state */
+
+};
+
+
+int ZEXPORT inflateReset(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->total_in = z->total_out = 0;
+ z->msg = Z_NULL;
+ z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
+ inflate_blocks_reset(z->state->blocks, z, Z_NULL);
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateEnd(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->blocks != Z_NULL)
+ inflate_blocks_free(z->state->blocks, z);
+ ZFREE(z, z->state);
+ z->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateInit2_(z, w, version, stream_size)
+z_streamp z;
+int w;
+const char *version;
+int stream_size;
+{
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != sizeof(z_stream))
+ return Z_VERSION_ERROR;
+
+ /* initialize state */
+ if (z == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->msg = Z_NULL;
+ if (z->zalloc == Z_NULL)
+ {
+ z->zalloc = zcalloc;
+ z->opaque = (voidpf)0;
+ }
+ if (z->zfree == Z_NULL) z->zfree = zcfree;
+ if ((z->state = (struct internal_state FAR *)
+ ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
+ return Z_MEM_ERROR;
+ z->state->blocks = Z_NULL;
+
+ /* handle undocumented nowrap option (no zlib header or check) */
+ z->state->nowrap = 0;
+ if (w < 0)
+ {
+ w = - w;
+ z->state->nowrap = 1;
+ }
+
+ /* set window size */
+ if (w < 8 || w > 15)
+ {
+ inflateEnd(z);
+ return Z_STREAM_ERROR;
+ }
+ z->state->wbits = (uInt)w;
+
+ /* create inflate_blocks state */
+ if ((z->state->blocks =
+ inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
+ == Z_NULL)
+ {
+ inflateEnd(z);
+ return Z_MEM_ERROR;
+ }
+ Tracev((stderr, "inflate: allocated\n"));
+
+ /* reset state */
+ inflateReset(z);
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateInit_(z, version, stream_size)
+z_streamp z;
+const char *version;
+int stream_size;
+{
+ return inflateInit2_(z, DEF_WBITS, version, stream_size);
+}
+
+
+#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+
+int ZEXPORT inflate(z, f)
+z_streamp z;
+int f;
+{
+ int r;
+ uInt b;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
+ return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+ r = Z_BUF_ERROR;
+ while (1) switch (z->state->mode)
+ {
+ case METHOD:
+ NEEDBYTE
+ if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"unknown compression method";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"invalid window size";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ z->state->mode = FLAG;
+ case FLAG:
+ NEEDBYTE
+ b = NEXTBYTE;
+ if (((z->state->sub.method << 8) + b) % 31)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect header check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ if (!(b & PRESET_DICT))
+ {
+ z->state->mode = BLOCKS;
+ break;
+ }
+ z->state->mode = DICT4;
+ case DICT4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = DICT3;
+ case DICT3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = DICT2;
+ case DICT2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = DICT1;
+ case DICT1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+ z->adler = z->state->sub.check.need;
+ z->state->mode = DICT0;
+ return Z_NEED_DICT;
+ case DICT0:
+ z->state->mode = BAD;
+ z->msg = (char*)"need dictionary";
+ z->state->sub.marker = 0; /* can try inflateSync */
+ return Z_STREAM_ERROR;
+ case BLOCKS:
+ r = inflate_blocks(z->state->blocks, z, r);
+ if (r == Z_DATA_ERROR)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0; /* can try inflateSync */
+ break;
+ }
+ if (r == Z_OK)
+ r = f;
+ if (r != Z_STREAM_END)
+ return r;
+ r = f;
+ inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
+ if (z->state->nowrap)
+ {
+ z->state->mode = DONE;
+ break;
+ }
+ z->state->mode = CHECK4;
+ case CHECK4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = CHECK3;
+ case CHECK3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = CHECK2;
+ case CHECK2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = CHECK1;
+ case CHECK1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+
+ if (z->state->sub.check.was != z->state->sub.check.need)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect data check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib check ok\n"));
+ z->state->mode = DONE;
+ case DONE:
+ return Z_STREAM_END;
+ case BAD:
+ return Z_DATA_ERROR;
+ default:
+ return Z_STREAM_ERROR;
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+int ZEXPORT inflateSetDictionary(z, dictionary, dictLength)
+z_streamp z;
+const Bytef *dictionary;
+uInt dictLength;
+{
+ uInt length = dictLength;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0)
+ return Z_STREAM_ERROR;
+
+ if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR;
+ z->adler = 1L;
+
+ if (length >= ((uInt)1<<z->state->wbits))
+ {
+ length = (1<<z->state->wbits)-1;
+ dictionary += dictLength - length;
+ }
+ inflate_set_dictionary(z->state->blocks, dictionary, length);
+ z->state->mode = BLOCKS;
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateSync(z)
+z_streamp z;
+{
+ uInt n; /* number of bytes to look at */
+ Bytef *p; /* pointer to bytes */
+ uInt m; /* number of marker bytes found in a row */
+ uLong r, w; /* temporaries to save total_in and total_out */
+
+ /* set up */
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->mode != BAD)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0;
+ }
+ if ((n = z->avail_in) == 0)
+ return Z_BUF_ERROR;
+ p = z->next_in;
+ m = z->state->sub.marker;
+
+ /* search */
+ while (n && m < 4)
+ {
+ static const Byte mark[4] = {0, 0, 0xff, 0xff};
+ if (*p == mark[m])
+ m++;
+ else if (*p)
+ m = 0;
+ else
+ m = 4 - m;
+ p++, n--;
+ }
+
+ /* restore */
+ z->total_in += p - z->next_in;
+ z->next_in = p;
+ z->avail_in = n;
+ z->state->sub.marker = m;
+
+ /* return no joy or set up to restart on a new block */
+ if (m != 4)
+ return Z_DATA_ERROR;
+ r = z->total_in; w = z->total_out;
+ inflateReset(z);
+ z->total_in = r; z->total_out = w;
+ z->state->mode = BLOCKS;
+ return Z_OK;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
+ * but removes the length bytes of the resulting empty stored block. When
+ * decompressing, PPP checks that at the end of input packet, inflate is
+ * waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
+ return Z_STREAM_ERROR;
+ return inflate_blocks_sync_point(z->state->blocks);
+}
diff --git a/setedit/libz/inftrees.c b/setedit/libz/inftrees.c
new file mode 100644
index 0000000..ef1e0b6
--- /dev/null
+++ b/setedit/libz/inftrees.c
@@ -0,0 +1,455 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#if !defined(BUILDFIXED) && !defined(STDC)
+# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
+#endif
+
+const char inflate_copyright[] =
+ " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+
+local int huft_build OF((
+ uIntf *, /* code lengths in bits */
+ uInt, /* number of codes */
+ uInt, /* number of "simple" codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
+ inflate_huft * FAR*,/* result: starting table */
+ uIntf *, /* maximum lookup bits (returns actual) */
+ inflate_huft *, /* space for trees */
+ uInt *, /* hufts used in space */
+ uIntf * )); /* space for values */
+
+/* Tables for deflate from PKZIP's appnote.txt. */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ /* see note #13 above about 258 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+/*
+ Huffman code decoding is performed using a multi-level table lookup.
+ The fastest way to decode is to simply build a lookup table whose
+ size is determined by the longest code. However, the time it takes
+ to build this table can also be a factor if the data being decoded
+ is not very long. The most common codes are necessarily the
+ shortest codes, so those codes dominate the decoding time, and hence
+ the speed. The idea is you can have a shorter table that decodes the
+ shorter, more probable codes, and then point to subsidiary tables for
+ the longer codes. The time it costs to decode the longer codes is
+ then traded against the time it takes to make longer tables.
+
+ This results of this trade are in the variables lbits and dbits
+ below. lbits is the number of bits the first level table for literal/
+ length codes can decode in one step, and dbits is the same thing for
+ the distance codes. Subsequent tables are also less than or equal to
+ those sizes. These values may be adjusted either when all of the
+ codes are shorter than that, in which case the longest code length in
+ bits is used, or when the shortest code is *longer* than the requested
+ table size, in which case the length of the shortest code in bits is
+ used.
+
+ There are two different values for the two tables, since they code a
+ different number of possibilities each. The literal/length table
+ codes 286 possible values, or in a flat code, a little over eight
+ bits. The distance table codes 30 possible values, or a little less
+ than five bits, flat. The optimum values for speed end up being
+ about one bit more than those, so lbits is 8+1 and dbits is 5+1.
+ The optimum values may differ though from machine to machine, and
+ possibly even between compilers. Your mileage may vary.
+ */
+
+
+/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
+#define BMAX 15 /* maximum bit length of any code */
+
+local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
+uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
+uInt n; /* number of codes (assumed <= 288) */
+uInt s; /* number of simple-valued codes (0..s-1) */
+const uIntf *d; /* list of base values for non-simple codes */
+const uIntf *e; /* list of extra bits for non-simple codes */
+inflate_huft * FAR *t; /* result: starting table */
+uIntf *m; /* maximum lookup bits, returns actual */
+inflate_huft *hp; /* space for trees */
+uInt *hn; /* hufts used in space */
+uIntf *v; /* working area: values in order of bit length */
+/* Given a list of code lengths and a maximum table size, make a set of
+ tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
+ if the given code set is incomplete (the tables are still built in this
+ case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
+ lengths), or Z_MEM_ERROR if not enough memory. */
+{
+
+ uInt a; /* counter for codes of length k */
+ uInt c[BMAX+1]; /* bit length count table */
+ uInt f; /* i repeats in table every f entries */
+ int g; /* maximum code length */
+ int h; /* table level */
+ register uInt i; /* counter, current code */
+ register uInt j; /* counter */
+ register int k; /* number of bits in current code */
+ int l; /* bits per table (returned in m) */
+ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
+ register uIntf *p; /* pointer into c[], b[], or v[] */
+ inflate_huft *q; /* points to current table */
+ struct inflate_huft_s r; /* table entry for structure assignment */
+ inflate_huft *u[BMAX]; /* table stack */
+ register int w; /* bits before this table == (l * h) */
+ uInt x[BMAX+1]; /* bit offsets, then code stack */
+ uIntf *xp; /* pointer into x */
+ int y; /* number of dummy codes added */
+ uInt z; /* number of entries in current table */
+
+
+ /* Generate counts for each bit length */
+ p = c;
+#define C0 *p++ = 0;
+#define C2 C0 C0 C0 C0
+#define C4 C2 C2 C2 C2
+ C4 /* clear c[]--assume BMAX+1 is 16 */
+ p = b; i = n;
+ do {
+ c[*p++]++; /* assume all entries <= BMAX */
+ } while (--i);
+ if (c[0] == n) /* null input--all zero length codes */
+ {
+ *t = (inflate_huft *)Z_NULL;
+ *m = 0;
+ return Z_OK;
+ }
+
+
+ /* Find minimum and maximum length, bound *m by those */
+ l = *m;
+ for (j = 1; j <= BMAX; j++)
+ if (c[j])
+ break;
+ k = j; /* minimum code length */
+ if ((uInt)l < j)
+ l = j;
+ for (i = BMAX; i; i--)
+ if (c[i])
+ break;
+ g = i; /* maximum code length */
+ if ((uInt)l > i)
+ l = i;
+ *m = l;
+
+
+ /* Adjust last length count to fill out codes, if needed */
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return Z_DATA_ERROR;
+ if ((y -= c[i]) < 0)
+ return Z_DATA_ERROR;
+ c[i] += y;
+
+
+ /* Generate starting offsets into the value table for each length */
+ x[1] = j = 0;
+ p = c + 1; xp = x + 2;
+ while (--i) { /* note that i == g from above */
+ *xp++ = (j += *p++);
+ }
+
+
+ /* Make a table of values in order of bit lengths */
+ p = b; i = 0;
+ do {
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ } while (++i < n);
+ n = x[g]; /* set n to length of v */
+
+
+ /* Generate the Huffman codes and for each, make the table entries */
+ x[0] = i = 0; /* first Huffman code is zero */
+ p = v; /* grab values in bit order */
+ h = -1; /* no tables yet--level -1 */
+ w = -l; /* bits decoded == (l * h) */
+ u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
+ q = (inflate_huft *)Z_NULL; /* ditto */
+ z = 0; /* ditto */
+
+ /* go through the bit lengths (k already is bits in shortest code) */
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ /* here i is the Huffman code of length k bits for value *p */
+ /* make tables up to required level */
+ while (k > w + l)
+ {
+ h++;
+ w += l; /* previous table always l bits */
+
+ /* compute minimum size table less than or equal to l bits */
+ z = g - w;
+ z = z > (uInt)l ? l : z; /* table size upper limit */
+ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
+ { /* too few codes for k-w bit table */
+ f -= a + 1; /* deduct codes from patterns left */
+ xp = c + k;
+ if (j < z)
+ while (++j < z) /* try smaller tables up to z bits */
+ {
+ if ((f <<= 1) <= *++xp)
+ break; /* enough codes to use up j bits */
+ f -= *xp; /* else deduct codes from patterns */
+ }
+ }
+ z = 1 << j; /* table entries for j-bit table */
+
+ /* allocate new table */
+ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
+ return Z_MEM_ERROR; /* not enough memory */
+ u[h] = q = hp + *hn;
+ *hn += z;
+
+ /* connect to last table, if there is one */
+ if (h)
+ {
+ x[h] = i; /* save pattern for backing up */
+ r.bits = (Byte)l; /* bits to dump before this table */
+ r.exop = (Byte)j; /* bits in this table */
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
+ u[h-1][j] = r; /* connect to last table */
+ }
+ else
+ *t = q; /* first table is returned result */
+ }
+
+ /* set up table entry in r */
+ r.bits = (Byte)(k - w);
+ if (p >= v + n)
+ r.exop = 128 + 64; /* out of values--invalid code */
+ else if (*p < s)
+ {
+ r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
+ r.base = *p++; /* simple code is just the value */
+ }
+ else
+ {
+ r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
+ r.base = d[*p++ - s];
+ }
+
+ /* fill code-like entries with r */
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+
+ /* backwards increment the k-bit code i */
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+
+ /* backup over finished tables */
+ mask = (1 << w) - 1; /* needed on HP, cc -O bug */
+ while ((i & mask) != x[h])
+ {
+ h--; /* don't need to update q */
+ w -= l;
+ mask = (1 << w) - 1;
+ }
+ }
+ }
+
+
+ /* Return Z_BUF_ERROR if we were given an incomplete table */
+ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
+}
+
+
+int inflate_trees_bits(c, bb, tb, hp, z)
+uIntf *c; /* 19 code lengths */
+uIntf *bb; /* bits tree desired/actual depth */
+inflate_huft * FAR *tb; /* bits tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ tb, bb, hp, &hn, v);
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed dynamic bit lengths tree";
+ else if (r == Z_BUF_ERROR || *bb == 0)
+ {
+ z->msg = (char*)"incomplete dynamic bit lengths tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+}
+
+
+int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
+uInt nl; /* number of literal/length codes */
+uInt nd; /* number of distance codes */
+uIntf *c; /* that many (total) code lengths */
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate work area */
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+
+ /* build literal/length tree */
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed literal/length tree";
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"incomplete literal/length tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+ }
+
+ /* build distance tree */
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed distance tree";
+ else if (r == Z_BUF_ERROR) {
+#ifdef PKZIP_BUG_WORKAROUND
+ r = Z_OK;
+ }
+#else
+ z->msg = (char*)"incomplete distance tree";
+ r = Z_DATA_ERROR;
+ }
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+#endif
+ }
+
+ /* done */
+ ZFREE(z, v);
+ return Z_OK;
+}
+
+
+/* build fixed tables only once--keep them here */
+#ifdef BUILDFIXED
+local int fixed_built = 0;
+#define FIXEDH 544 /* number of hufts used by fixed tables */
+local inflate_huft fixed_mem[FIXEDH];
+local uInt fixed_bl;
+local uInt fixed_bd;
+local inflate_huft *fixed_tl;
+local inflate_huft *fixed_td;
+#else
+#include "inffixed.h"
+#endif
+
+
+int inflate_trees_fixed(bl, bd, tl, td, z)
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+z_streamp z; /* for memory allocation */
+{
+#ifdef BUILDFIXED
+ /* build fixed tables if not already */
+ if (!fixed_built)
+ {
+ int k; /* temporary variable */
+ uInt f = 0; /* number of hufts used in fixed_mem */
+ uIntf *c; /* length list for huft_build */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate memory */
+ if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ {
+ ZFREE(z, c);
+ return Z_MEM_ERROR;
+ }
+
+ /* literal table */
+ for (k = 0; k < 144; k++)
+ c[k] = 8;
+ for (; k < 256; k++)
+ c[k] = 9;
+ for (; k < 280; k++)
+ c[k] = 7;
+ for (; k < 288; k++)
+ c[k] = 8;
+ fixed_bl = 9;
+ huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
+ fixed_mem, &f, v);
+
+ /* distance table */
+ for (k = 0; k < 30; k++)
+ c[k] = 5;
+ fixed_bd = 5;
+ huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
+ fixed_mem, &f, v);
+
+ /* done */
+ ZFREE(z, v);
+ ZFREE(z, c);
+ fixed_built = 1;
+ }
+#endif
+ *bl = fixed_bl;
+ *bd = fixed_bd;
+ *tl = fixed_tl;
+ *td = fixed_td;
+ return Z_OK;
+}
diff --git a/setedit/libz/inftrees.h b/setedit/libz/inftrees.h
new file mode 100644
index 0000000..85853e0
--- /dev/null
+++ b/setedit/libz/inftrees.h
@@ -0,0 +1,58 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Huffman code lookup table entry--this entry is four bytes for machines
+ that have 16-bit pointers (e.g. PC's in the small or medium model). */
+
+typedef struct inflate_huft_s FAR inflate_huft;
+
+struct inflate_huft_s {
+ union {
+ struct {
+ Byte Exop; /* number of extra bits or operation */
+ Byte Bits; /* number of bits in this code or subcode */
+ } what;
+ uInt pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit int's) */
+ uInt base; /* literal, length base, distance base,
+ or table offset */
+};
+
+/* Maximum size of dynamic tree. The maximum found in a long but non-
+ exhaustive search was 1004 huft structures (850 for length/literals
+ and 154 for distances, the latter actually the result of an
+ exhaustive search). The actual maximum is not known, but the
+ value below is more than safe. */
+#define MANY 1440
+
+extern int inflate_trees_bits OF((
+ uIntf *, /* 19 code lengths */
+ uIntf *, /* bits tree desired/actual depth */
+ inflate_huft * FAR *, /* bits tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int inflate_trees_dynamic OF((
+ uInt, /* number of literal/length codes */
+ uInt, /* number of distance codes */
+ uIntf *, /* that many (total) code lengths */
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int inflate_trees_fixed OF((
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ z_streamp)); /* for memory allocation */
diff --git a/setedit/libz/infutil.c b/setedit/libz/infutil.c
new file mode 100644
index 0000000..824dab5
--- /dev/null
+++ b/setedit/libz/infutil.c
@@ -0,0 +1,87 @@
+/* inflate_util.c -- data and routines common to blocks and codes
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* And'ing with mask[n] masks the lower n bits */
+uInt inflate_mask[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+
+/* copy as much as possible from the sliding window to the output area */
+int inflate_flush(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt n;
+ Bytef *p;
+ Bytef *q;
+
+ /* local copies of source and destination pointers */
+ p = z->next_out;
+ q = s->read;
+
+ /* compute number of bytes to copy as far as end of window */
+ n = (uInt)((q <= s->write ? s->write : s->end) - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy as far as end of window */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+
+ /* see if more to copy at beginning of window */
+ if (q == s->end)
+ {
+ /* wrap pointers */
+ q = s->window;
+ if (s->write == s->end)
+ s->write = s->window;
+
+ /* compute bytes to copy */
+ n = (uInt)(s->write - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ /* update pointers */
+ z->next_out = p;
+ s->read = q;
+
+ /* done */
+ return r;
+}
diff --git a/setedit/libz/infutil.h b/setedit/libz/infutil.h
new file mode 100644
index 0000000..99d1135
--- /dev/null
+++ b/setedit/libz/infutil.h
@@ -0,0 +1,98 @@
+/* infutil.h -- types and macros common to blocks and codes
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFUTIL_H
+#define _INFUTIL_H
+
+typedef enum {
+ TYPE, /* get type bits (3, including end bit) */
+ LENS, /* get lengths for stored */
+ STORED, /* processing stored block */
+ TABLE, /* get table lengths */
+ BTREE, /* get bit lengths tree for a dynamic block */
+ DTREE, /* get length, distance trees for a dynamic block */
+ CODES, /* processing fixed or dynamic block */
+ DRY, /* output remaining window bytes */
+ DONE, /* finished last block, done */
+ BAD} /* got a data error--stuck here */
+inflate_block_mode;
+
+/* inflate blocks semi-private state */
+struct inflate_blocks_state {
+
+ /* mode */
+ inflate_block_mode mode; /* current inflate_block mode */
+
+ /* mode dependent information */
+ union {
+ uInt left; /* if STORED, bytes left to copy */
+ struct {
+ uInt table; /* table lengths (14 bits) */
+ uInt index; /* index into blens (or border) */
+ uIntf *blens; /* bit lengths of codes */
+ uInt bb; /* bit length tree depth */
+ inflate_huft *tb; /* bit length decoding tree */
+ } trees; /* if DTREE, decoding info for trees */
+ struct {
+ inflate_codes_statef
+ *codes;
+ } decode; /* if CODES, current state */
+ } sub; /* submode */
+ uInt last; /* true if this block is the last block */
+
+ /* mode independent information */
+ uInt bitk; /* bits in bit buffer */
+ uLong bitb; /* bit buffer */
+ inflate_huft *hufts; /* single malloc for tree space */
+ Bytef *window; /* sliding window */
+ Bytef *end; /* one byte after sliding window */
+ Bytef *read; /* window read pointer */
+ Bytef *write; /* window write pointer */
+ check_func checkfn; /* check function */
+ uLong check; /* check on output */
+
+};
+
+
+/* defines for inflate input/output */
+/* update pointers and return */
+#define UPDBITS {s->bitb=b;s->bitk=k;}
+#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
+#define UPDOUT {s->write=q;}
+#define UPDATE {UPDBITS UPDIN UPDOUT}
+#define LEAVE {UPDATE return inflate_flush(s,z,r);}
+/* get bytes and bits */
+#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
+#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
+#define NEXTBYTE (n--,*p++)
+#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define DUMPBITS(j) {b>>=(j);k-=(j);}
+/* output bytes */
+#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
+#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
+#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
+#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
+#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
+/* load local pointers */
+#define LOAD {LOADIN LOADOUT}
+
+/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
+extern uInt inflate_mask[17];
+
+/* copy as much as possible from the sliding window to the output area */
+extern int inflate_flush OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#endif
diff --git a/setedit/libz/trees.c b/setedit/libz/trees.c
new file mode 100644
index 0000000..85baafe
--- /dev/null
+++ b/setedit/libz/trees.c
@@ -0,0 +1,1214 @@
+/* trees.c -- output deflated data using Huffman coding
+ * Copyright (C) 1995-1998 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process uses several Huffman trees. The more
+ * common source values are represented by shorter bit sequences.
+ *
+ * Each code tree is stored in a compressed form which is itself
+ * a Huffman encoding of the lengths of all the code strings (in
+ * ascending order by source values). The actual code strings are
+ * reconstructed from the lengths in the inflate process, as described
+ * in the deflate specification.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
+ * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *
+ * Storer, James A.
+ * Data Compression: Methods and Theory, pp. 49-50.
+ * Computer Science Press, 1988. ISBN 0-7167-8156-5.
+ *
+ * Sedgewick, R.
+ * Algorithms, p290.
+ * Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ */
+
+/* @(#) $Id: trees.c,v 1.1.1.1 2001/09/11 13:59:00 set Exp $ */
+
+/* #define GEN_TREES_H */
+
+#include "deflate.h"
+
+#ifdef DEBUG
+# include <ctype.h>
+#endif
+
+/* ===========================================================================
+ * Constants
+ */
+
+#define MAX_BL_BITS 7
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+#define END_BLOCK 256
+/* end of block literal code */
+
+#define REP_3_6 16
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+#define REPZ_3_10 17
+/* repeat a zero length 3-10 times (3 bits of repeat count) */
+
+#define REPZ_11_138 18
+/* repeat a zero length 11-138 times (7 bits of repeat count) */
+
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+ = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
+ = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+ = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+local const uch bl_order[BL_CODES]
+ = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+#define Buf_size (8 * 2*sizeof(char))
+/* Number of bits used within bi_buf. (bi_buf might be implemented on
+ * more than 16 bits on some systems.)
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
+local ct_data static_ltree[L_CODES+2];
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+local ct_data static_dtree[D_CODES];
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+local int base_length[LENGTH_CODES];
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+local int base_dist[D_CODES];
+/* First normalized distance for each code (0 = distance of 1) */
+
+#else
+# include "trees.h"
+#endif /* GEN_TREES_H */
+
+struct static_tree_desc_s {
+ const ct_data *static_tree; /* static tree or NULL */
+ const intf *extra_bits; /* extra bits for each code or NULL */
+ int extra_base; /* base index for extra_bits */
+ int elems; /* max number of elements in the tree */
+ int max_length; /* max bit length for the codes */
+};
+
+local static_tree_desc static_l_desc =
+{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+
+local static_tree_desc static_d_desc =
+{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
+
+local static_tree_desc static_bl_desc =
+{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
+
+/* ===========================================================================
+ * Local (static) routines in this file.
+ */
+
+local void tr_static_init OF((void));
+local void init_block OF((deflate_state *s));
+local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
+local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
+local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
+local void build_tree OF((deflate_state *s, tree_desc *desc));
+local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local int build_bl_tree OF((deflate_state *s));
+local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
+ int blcodes));
+local void compress_block OF((deflate_state *s, ct_data *ltree,
+ ct_data *dtree));
+local void set_data_type OF((deflate_state *s));
+local unsigned bi_reverse OF((unsigned value, int length));
+local void bi_windup OF((deflate_state *s));
+local void bi_flush OF((deflate_state *s));
+local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
+ int header));
+
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
+#ifndef DEBUG
+# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
+ /* Send a code of the given tree. c and tree must not have side effects */
+
+#else /* DEBUG */
+# define send_code(s, c, tree) \
+ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+ send_bits(s, tree[c].Code, tree[c].Len); }
+#endif
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+#define put_short(s, w) { \
+ put_byte(s, (uch)((w) & 0xff)); \
+ put_byte(s, (uch)((ush)(w) >> 8)); \
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+#ifdef DEBUG
+local void send_bits OF((deflate_state *s, int value, int length));
+
+local void send_bits(s, value, length)
+ deflate_state *s;
+ int value; /* value to send */
+ int length; /* number of bits */
+{
+ Tracevv((stderr," l %2d v %4x ", length, value));
+ Assert(length > 0 && length <= 15, "invalid length");
+ s->bits_sent += (ulg)length;
+
+ /* If not enough room in bi_buf, use (valid) bits from bi_buf and
+ * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+ * unused bits in value.
+ */
+ if (s->bi_valid > (int)Buf_size - length) {
+ s->bi_buf |= (value << s->bi_valid);
+ put_short(s, s->bi_buf);
+ s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
+ s->bi_valid += length - Buf_size;
+ } else {
+ s->bi_buf |= value << s->bi_valid;
+ s->bi_valid += length;
+ }
+}
+#else /* !DEBUG */
+
+#define send_bits(s, value, length) \
+{ int len = length;\
+ if (s->bi_valid > (int)Buf_size - len) {\
+ int val = value;\
+ s->bi_buf |= (val << s->bi_valid);\
+ put_short(s, s->bi_buf);\
+ s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
+ s->bi_valid += len - Buf_size;\
+ } else {\
+ s->bi_buf |= (value) << s->bi_valid;\
+ s->bi_valid += len;\
+ }\
+}
+#endif /* DEBUG */
+
+
+#define MAX(a,b) (a >= b ? a : b)
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Initialize the various 'constant' tables.
+ */
+local void tr_static_init()
+{
+#if defined(GEN_TREES_H) || !defined(STDC)
+ static int static_init_done = 0;
+ int n; /* iterates over tree elements */
+ int bits; /* bit counter */
+ int length; /* length value */
+ int code; /* code value */
+ int dist; /* distance index */
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ if (static_init_done) return;
+
+ /* For some embedded targets, global variables are not initialized: */
+ static_l_desc.static_tree = static_ltree;
+ static_l_desc.extra_bits = extra_lbits;
+ static_d_desc.static_tree = static_dtree;
+ static_d_desc.extra_bits = extra_dbits;
+ static_bl_desc.extra_bits = extra_blbits;
+
+ /* Initialize the mapping length (0..255) -> length code (0..28) */
+ length = 0;
+ for (code = 0; code < LENGTH_CODES-1; code++) {
+ base_length[code] = length;
+ for (n = 0; n < (1<<extra_lbits[code]); n++) {
+ _length_code[length++] = (uch)code;
+ }
+ }
+ Assert (length == 256, "tr_static_init: length != 256");
+ /* Note that the length 255 (match length 258) can be represented
+ * in two different ways: code 284 + 5 bits or code 285, so we
+ * overwrite length_code[255] to use the best encoding:
+ */
+ _length_code[length-1] = (uch)code;
+
+ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+ dist = 0;
+ for (code = 0 ; code < 16; code++) {
+ base_dist[code] = dist;
+ for (n = 0; n < (1<<extra_dbits[code]); n++) {
+ _dist_code[dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: dist != 256");
+ dist >>= 7; /* from now on, all distances are divided by 128 */
+ for ( ; code < D_CODES; code++) {
+ base_dist[code] = dist << 7;
+ for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+ _dist_code[256 + dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+ /* Construct the codes of the static literal tree */
+ for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+ n = 0;
+ while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+ while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+ while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+ while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+ /* Codes 286 and 287 do not exist, but we must include them in the
+ * tree construction to get a canonical Huffman tree (longest code
+ * all ones)
+ */
+ gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+
+ /* The static distance tree is trivial: */
+ for (n = 0; n < D_CODES; n++) {
+ static_dtree[n].Len = 5;
+ static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+ }
+ static_init_done = 1;
+
+# ifdef GEN_TREES_H
+ gen_trees_header();
+# endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
+}
+
+/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+# ifndef DEBUG
+# include <stdio.h>
+# endif
+
+# define SEPARATOR(i, last, width) \
+ ((i) == (last)? "\n};\n\n" : \
+ ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+ FILE *header = fopen("trees.h", "w");
+ int i;
+
+ Assert (header != NULL, "Can't open trees.h");
+ fprintf(header,
+ "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+ fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+ for (i = 0; i < L_CODES+2; i++) {
+ fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+ static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+ }
+
+ fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+ static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+ }
+
+ fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+ for (i = 0; i < DIST_CODE_LEN; i++) {
+ fprintf(header, "%2u%s", _dist_code[i],
+ SEPARATOR(i, DIST_CODE_LEN-1, 20));
+ }
+
+ fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+ for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+ fprintf(header, "%2u%s", _length_code[i],
+ SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+ }
+
+ fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+ for (i = 0; i < LENGTH_CODES; i++) {
+ fprintf(header, "%1u%s", base_length[i],
+ SEPARATOR(i, LENGTH_CODES-1, 20));
+ }
+
+ fprintf(header, "local const int base_dist[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "%5u%s", base_dist[i],
+ SEPARATOR(i, D_CODES-1, 10));
+ }
+
+ fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+void _tr_init(s)
+ deflate_state *s;
+{
+ tr_static_init();
+
+ s->l_desc.dyn_tree = s->dyn_ltree;
+ s->l_desc.stat_desc = &static_l_desc;
+
+ s->d_desc.dyn_tree = s->dyn_dtree;
+ s->d_desc.stat_desc = &static_d_desc;
+
+ s->bl_desc.dyn_tree = s->bl_tree;
+ s->bl_desc.stat_desc = &static_bl_desc;
+
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ s->last_eob_len = 8; /* enough lookahead for inflate */
+#ifdef DEBUG
+ s->compressed_len = 0L;
+ s->bits_sent = 0L;
+#endif
+
+ /* Initialize the first block of the first file: */
+ init_block(s);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+local void init_block(s)
+ deflate_state *s;
+{
+ int n; /* iterates over tree elements */
+
+ /* Initialize the trees. */
+ for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
+ for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
+ for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+ s->dyn_ltree[END_BLOCK].Freq = 1;
+ s->opt_len = s->static_len = 0L;
+ s->last_lit = s->matches = 0;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(s, tree, top) \
+{\
+ top = s->heap[SMALLEST]; \
+ s->heap[SMALLEST] = s->heap[s->heap_len--]; \
+ pqdownheap(s, tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m, depth) \
+ (tree[n].Freq < tree[m].Freq || \
+ (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+local void pqdownheap(s, tree, k)
+ deflate_state *s;
+ ct_data *tree; /* the tree to restore */
+ int k; /* node to move down */
+{
+ int v = s->heap[k];
+ int j = k << 1; /* left son of k */
+ while (j <= s->heap_len) {
+ /* Set j to the smallest of the two sons: */
+ if (j < s->heap_len &&
+ smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+ j++;
+ }
+ /* Exit if v is smaller than both sons */
+ if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+ /* Exchange v with the smallest son */
+ s->heap[k] = s->heap[j]; k = j;
+
+ /* And continue down the tree, setting j to the left son of k */
+ j <<= 1;
+ }
+ s->heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ * above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ * array bl_count contains the frequencies for each bit length.
+ * The length opt_len is updated; static_len is also updated if stree is
+ * not null.
+ */
+local void gen_bitlen(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ int max_code = desc->max_code;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ const intf *extra = desc->stat_desc->extra_bits;
+ int base = desc->stat_desc->extra_base;
+ int max_length = desc->stat_desc->max_length;
+ int h; /* heap index */
+ int n, m; /* iterate over the tree elements */
+ int bits; /* bit length */
+ int xbits; /* extra bits */
+ ush f; /* frequency */
+ int overflow = 0; /* number of elements with bit length too large */
+
+ for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+ /* In a first pass, compute the optimal bit lengths (which may
+ * overflow in the case of the bit length tree).
+ */
+ tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+ for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+ n = s->heap[h];
+ bits = tree[tree[n].Dad].Len + 1;
+ if (bits > max_length) bits = max_length, overflow++;
+ tree[n].Len = (ush)bits;
+ /* We overwrite tree[n].Dad which is no longer needed */
+
+ if (n > max_code) continue; /* not a leaf node */
+
+ s->bl_count[bits]++;
+ xbits = 0;
+ if (n >= base) xbits = extra[n-base];
+ f = tree[n].Freq;
+ s->opt_len += (ulg)f * (bits + xbits);
+ if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+ }
+ if (overflow == 0) return;
+
+ Trace((stderr,"\nbit length overflow\n"));
+ /* This happens for example on obj2 and pic of the Calgary corpus */
+
+ /* Find the first bit length which could increase: */
+ do {
+ bits = max_length-1;
+ while (s->bl_count[bits] == 0) bits--;
+ s->bl_count[bits]--; /* move one leaf down the tree */
+ s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+ s->bl_count[max_length]--;
+ /* The brother of the overflow item also moves one step up,
+ * but this does not affect bl_count[max_length]
+ */
+ overflow -= 2;
+ } while (overflow > 0);
+
+ /* Now recompute all bit lengths, scanning in increasing frequency.
+ * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+ * lengths instead of fixing only the wrong ones. This idea is taken
+ * from 'ar' written by Haruhiko Okumura.)
+ */
+ for (bits = max_length; bits != 0; bits--) {
+ n = s->bl_count[bits];
+ while (n != 0) {
+ m = s->heap[--h];
+ if (m > max_code) continue;
+ if (tree[m].Len != (unsigned) bits) {
+ Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+ s->opt_len += ((long)bits - (long)tree[m].Len)
+ *(long)tree[m].Freq;
+ tree[m].Len = (ush)bits;
+ }
+ n--;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ * zero code length.
+ */
+local void gen_codes (tree, max_code, bl_count)
+ ct_data *tree; /* the tree to decorate */
+ int max_code; /* largest code with non zero frequency */
+ ushf *bl_count; /* number of codes at each bit length */
+{
+ ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+ ush code = 0; /* running code value */
+ int bits; /* bit index */
+ int n; /* code index */
+
+ /* The distribution counts are first used to generate the code values
+ * without bit reversal.
+ */
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = (code + bl_count[bits-1]) << 1;
+ }
+ /* Check that the bit counts in bl_count are consistent. The last code
+ * must be all ones.
+ */
+ Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+ "inconsistent bit counts");
+ Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+
+ for (n = 0; n <= max_code; n++) {
+ int len = tree[n].Len;
+ if (len == 0) continue;
+ /* Now reverse the bits */
+ tree[n].Code = bi_reverse(next_code[len]++, len);
+
+ Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+ n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+ }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ * and corresponding code. The length opt_len is updated; static_len is
+ * also updated if stree is not null. The field max_code is set.
+ */
+local void build_tree(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ int elems = desc->stat_desc->elems;
+ int n, m; /* iterate over heap elements */
+ int max_code = -1; /* largest code with non zero frequency */
+ int node; /* new node being created */
+
+ /* Construct the initial heap, with least frequent element in
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[0] is not used.
+ */
+ s->heap_len = 0, s->heap_max = HEAP_SIZE;
+
+ for (n = 0; n < elems; n++) {
+ if (tree[n].Freq != 0) {
+ s->heap[++(s->heap_len)] = max_code = n;
+ s->depth[n] = 0;
+ } else {
+ tree[n].Len = 0;
+ }
+ }
+
+ /* The pkzip format requires that at least one distance code exists,
+ * and that at least one bit should be sent even if there is only one
+ * possible code. So to avoid special checks later on we force at least
+ * two codes of non zero frequency.
+ */
+ while (s->heap_len < 2) {
+ node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+ tree[node].Freq = 1;
+ s->depth[node] = 0;
+ s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+ /* node is 0 or 1 so it does not have extra bits */
+ }
+ desc->max_code = max_code;
+
+ /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ * establish sub-heaps of increasing lengths:
+ */
+ for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+ /* Construct the Huffman tree by repeatedly combining the least two
+ * frequent nodes.
+ */
+ node = elems; /* next internal node of the tree */
+ do {
+ pqremove(s, tree, n); /* n = node of least frequency */
+ m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+ s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+ s->heap[--(s->heap_max)] = m;
+
+ /* Create a new node father of n and m */
+ tree[node].Freq = tree[n].Freq + tree[m].Freq;
+ s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1);
+ tree[n].Dad = tree[m].Dad = (ush)node;
+#ifdef DUMP_BL_TREE
+ if (tree == s->bl_tree) {
+ fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+ node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+ }
+#endif
+ /* and insert the new node in the heap */
+ s->heap[SMALLEST] = node++;
+ pqdownheap(s, tree, SMALLEST);
+
+ } while (s->heap_len >= 2);
+
+ s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+ /* At this point, the fields freq and dad are set. We can now
+ * generate the bit lengths.
+ */
+ gen_bitlen(s, (tree_desc *)desc);
+
+ /* The field len is now set, we can generate the bit codes */
+ gen_codes ((ct_data *)tree, max_code, s->bl_count);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+local void scan_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ if (nextlen == 0) max_count = 138, min_count = 3;
+ tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ s->bl_tree[curlen].Freq += count;
+ } else if (curlen != 0) {
+ if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+ s->bl_tree[REP_3_6].Freq++;
+ } else if (count <= 10) {
+ s->bl_tree[REPZ_3_10].Freq++;
+ } else {
+ s->bl_tree[REPZ_11_138].Freq++;
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+local void send_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ /* tree[max_code+1].Len = -1; */ /* guard already set */
+ if (nextlen == 0) max_count = 138, min_count = 3;
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+ } else if (curlen != 0) {
+ if (curlen != prevlen) {
+ send_code(s, curlen, s->bl_tree); count--;
+ }
+ Assert(count >= 3 && count <= 6, " 3_6?");
+ send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+ } else if (count <= 10) {
+ send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+ } else {
+ send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+local int build_bl_tree(s)
+ deflate_state *s;
+{
+ int max_blindex; /* index of last bit length code of non zero freq */
+
+ /* Determine the bit length frequencies for literal and distance trees */
+ scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+ scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+ /* Build the bit length tree: */
+ build_tree(s, (tree_desc *)(&(s->bl_desc)));
+ /* opt_len now includes the length of the tree representations, except
+ * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ */
+
+ /* Determine the number of bit length codes to send. The pkzip format
+ * requires that at least 4 bit length codes be sent. (appnote.txt says
+ * 3 but the actual value used is 4.)
+ */
+ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+ if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+ }
+ /* Update opt_len to include the bit length tree and counts */
+ s->opt_len += 3*(max_blindex+1) + 5+5+4;
+ Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+ s->opt_len, s->static_len));
+
+ return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+local void send_all_trees(s, lcodes, dcodes, blcodes)
+ deflate_state *s;
+ int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+ int rank; /* index in bl_order */
+
+ Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+ Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+ "too many codes");
+ Tracev((stderr, "\nbl counts: "));
+ send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+ send_bits(s, dcodes-1, 5);
+ send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
+ for (rank = 0; rank < blcodes; rank++) {
+ Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+ send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+ }
+ Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+ Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+ Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+/* ===========================================================================
+ * Send a stored block
+ */
+void _tr_stored_block(s, buf, stored_len, eof)
+ deflate_state *s;
+ charf *buf; /* input block */
+ ulg stored_len; /* length of input block */
+ int eof; /* true if this is the last block for a file */
+{
+ send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
+#ifdef DEBUG
+ s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+ s->compressed_len += (stored_len + 4) << 3;
+#endif
+ copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+}
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ * The current inflate code requires 9 bits of lookahead. If the
+ * last two codes for the previous block (real code plus EOB) were coded
+ * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
+ * the last real code. In this case we send two empty static blocks instead
+ * of one. (There are no problems if the previous block is stored or fixed.)
+ * To simplify the code, we assume the worst case of last real code encoded
+ * on one bit only.
+ */
+void _tr_align(s)
+ deflate_state *s;
+{
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
+ bi_flush(s);
+ /* Of the 10 bits for the empty block, we have already sent
+ * (10 - bi_valid) bits. The lookahead for the last real code (before
+ * the EOB of the previous block) was thus at least one plus the length
+ * of the EOB plus what we have just sent of the empty static block.
+ */
+ if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L;
+#endif
+ bi_flush(s);
+ }
+ s->last_eob_len = 7;
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file.
+ */
+void _tr_flush_block(s, buf, stored_len, eof)
+ deflate_state *s;
+ charf *buf; /* input block, or NULL if too old */
+ ulg stored_len; /* length of input block */
+ int eof; /* true if this is the last block for a file */
+{
+ ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+ int max_blindex = 0; /* index of last bit length code of non zero freq */
+
+ /* Build the Huffman trees unless a stored block is forced */
+ if (s->level > 0) {
+
+ /* Check if the file is ascii or binary */
+ if (s->data_type == Z_UNKNOWN) set_data_type(s);
+
+ /* Construct the literal and distance trees */
+ build_tree(s, (tree_desc *)(&(s->l_desc)));
+ Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+
+ build_tree(s, (tree_desc *)(&(s->d_desc)));
+ Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+ /* At this point, opt_len and static_len are the total bit lengths of
+ * the compressed block data, excluding the tree representations.
+ */
+
+ /* Build the bit length tree for the above two trees, and get the index
+ * in bl_order of the last bit length code to send.
+ */
+ max_blindex = build_bl_tree(s);
+
+ /* Determine the best encoding. Compute first the block length in bytes*/
+ opt_lenb = (s->opt_len+3+7)>>3;
+ static_lenb = (s->static_len+3+7)>>3;
+
+ Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+ opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+ s->last_lit));
+
+ if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+ } else {
+ Assert(buf != (char*)0, "lost buf");
+ opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+ }
+
+#ifdef FORCE_STORED
+ if (buf != (char*)0) { /* force stored block */
+#else
+ if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+ /* 4: two words for the lengths */
+#endif
+ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+ * Otherwise we can't have processed more than WSIZE input bytes since
+ * the last block flush, because compression would have been
+ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+ * transform a block into a stored block.
+ */
+ _tr_stored_block(s, buf, stored_len, eof);
+
+#ifdef FORCE_STATIC
+ } else if (static_lenb >= 0) { /* force static trees */
+#else
+ } else if (static_lenb == opt_lenb) {
+#endif
+ send_bits(s, (STATIC_TREES<<1)+eof, 3);
+ compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->static_len;
+#endif
+ } else {
+ send_bits(s, (DYN_TREES<<1)+eof, 3);
+ send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+ max_blindex+1);
+ compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->opt_len;
+#endif
+ }
+ Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+ /* The above check is made mod 2^32, for files larger than 512 MB
+ * and uLong implemented on 32 bits.
+ */
+ init_block(s);
+
+ if (eof) {
+ bi_windup(s);
+#ifdef DEBUG
+ s->compressed_len += 7; /* align on byte boundary */
+#endif
+ }
+ Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+ s->compressed_len-7*eof));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int _tr_tally (s, dist, lc)
+ deflate_state *s;
+ unsigned dist; /* distance of matched string */
+ unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+ s->d_buf[s->last_lit] = (ush)dist;
+ s->l_buf[s->last_lit++] = (uch)lc;
+ if (dist == 0) {
+ /* lc is the unmatched char */
+ s->dyn_ltree[lc].Freq++;
+ } else {
+ s->matches++;
+ /* Here, lc is the match length - MIN_MATCH */
+ dist--; /* dist = match distance - 1 */
+ Assert((ush)dist < (ush)MAX_DIST(s) &&
+ (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+ (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
+
+ s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+ s->dyn_dtree[d_code(dist)].Freq++;
+ }
+
+#ifdef TRUNCATE_BLOCK
+ /* Try to guess if it is profitable to stop the current block here */
+ if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
+ /* Compute an upper bound for the compressed length */
+ ulg out_length = (ulg)s->last_lit*8L;
+ ulg in_length = (ulg)((long)s->strstart - s->block_start);
+ int dcode;
+ for (dcode = 0; dcode < D_CODES; dcode++) {
+ out_length += (ulg)s->dyn_dtree[dcode].Freq *
+ (5L+extra_dbits[dcode]);
+ }
+ out_length >>= 3;
+ Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+ s->last_lit, in_length, out_length,
+ 100L - out_length*100L/in_length));
+ if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+ }
+#endif
+ return (s->last_lit == s->lit_bufsize-1);
+ /* We avoid equality with lit_bufsize because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+local void compress_block(s, ltree, dtree)
+ deflate_state *s;
+ ct_data *ltree; /* literal tree */
+ ct_data *dtree; /* distance tree */
+{
+ unsigned dist; /* distance of matched string */
+ int lc; /* match length or unmatched char (if dist == 0) */
+ unsigned lx = 0; /* running index in l_buf */
+ unsigned code; /* the code to send */
+ int extra; /* number of extra bits to send */
+
+ if (s->last_lit != 0) do {
+ dist = s->d_buf[lx];
+ lc = s->l_buf[lx++];
+ if (dist == 0) {
+ send_code(s, lc, ltree); /* send a literal byte */
+ Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = _length_code[lc];
+ send_code(s, code+LITERALS+1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra != 0) {
+ lc -= base_length[code];
+ send_bits(s, lc, extra); /* send the extra length bits */
+ }
+ dist--; /* dist is now the match distance - 1 */
+ code = d_code(dist);
+ Assert (code < D_CODES, "bad d_code");
+
+ send_code(s, code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra != 0) {
+ dist -= base_dist[code];
+ send_bits(s, dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+
+ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+ Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow");
+
+ } while (lx < s->last_lit);
+
+ send_code(s, END_BLOCK, ltree);
+ s->last_eob_len = ltree[END_BLOCK].Len;
+}
+
+/* ===========================================================================
+ * Set the data type to ASCII or BINARY, using a crude approximation:
+ * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.
+ * IN assertion: the fields freq of dyn_ltree are set and the total of all
+ * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
+ */
+local void set_data_type(s)
+ deflate_state *s;
+{
+ int n = 0;
+ unsigned ascii_freq = 0;
+ unsigned bin_freq = 0;
+ while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;
+ while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;
+ while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
+ s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+local unsigned bi_reverse(code, len)
+ unsigned code; /* the value to invert */
+ int len; /* its bit length */
+{
+ register unsigned res = 0;
+ do {
+ res |= code & 1;
+ code >>= 1, res <<= 1;
+ } while (--len > 0);
+ return res >> 1;
+}
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+local void bi_flush(s)
+ deflate_state *s;
+{
+ if (s->bi_valid == 16) {
+ put_short(s, s->bi_buf);
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ } else if (s->bi_valid >= 8) {
+ put_byte(s, (Byte)s->bi_buf);
+ s->bi_buf >>= 8;
+ s->bi_valid -= 8;
+ }
+}
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+local void bi_windup(s)
+ deflate_state *s;
+{
+ if (s->bi_valid > 8) {
+ put_short(s, s->bi_buf);
+ } else if (s->bi_valid > 0) {
+ put_byte(s, (Byte)s->bi_buf);
+ }
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+#ifdef DEBUG
+ s->bits_sent = (s->bits_sent+7) & ~7;
+#endif
+}
+
+/* ===========================================================================
+ * Copy a stored block, storing first the length and its
+ * one's complement if requested.
+ */
+local void copy_block(s, buf, len, header)
+ deflate_state *s;
+ charf *buf; /* the input data */
+ unsigned len; /* its length */
+ int header; /* true if block header must be written */
+{
+ bi_windup(s); /* align on byte boundary */
+ s->last_eob_len = 8; /* enough lookahead for inflate */
+
+ if (header) {
+ put_short(s, (ush)len);
+ put_short(s, (ush)~len);
+#ifdef DEBUG
+ s->bits_sent += 2*16;
+#endif
+ }
+#ifdef DEBUG
+ s->bits_sent += (ulg)len<<3;
+#endif
+ while (len--) {
+ put_byte(s, *buf++);
+ }
+}
diff --git a/setedit/libz/trees.h b/setedit/libz/trees.h
new file mode 100644
index 0000000..72facf9
--- /dev/null
+++ b/setedit/libz/trees.h
@@ -0,0 +1,128 @@
+/* header created automatically with -DGEN_TREES_H */
+
+local const ct_data static_ltree[L_CODES+2] = {
+{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
+{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
+{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
+{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
+{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
+{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
+{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
+{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
+{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
+{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
+{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
+{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
+{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
+{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
+{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
+{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
+{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
+{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
+{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
+{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
+{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
+{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
+{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
+{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
+{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
+{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
+{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
+{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
+{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
+{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
+{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
+{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
+{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
+{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
+{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
+{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
+{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
+{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
+{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
+{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
+{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
+{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
+{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
+{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
+{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
+{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
+{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
+{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
+{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
+{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
+{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
+{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
+{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
+{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
+{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
+{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
+{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
+{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
+};
+
+local const ct_data static_dtree[D_CODES] = {
+{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+};
+
+const uch _dist_code[DIST_CODE_LEN] = {
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
+10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
+18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+};
+
+const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
+13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+};
+
+local const int base_length[LENGTH_CODES] = {
+0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+64, 80, 96, 112, 128, 160, 192, 224, 0
+};
+
+local const int base_dist[D_CODES] = {
+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
+ 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
+};
+
diff --git a/setedit/libz/uncompr.c b/setedit/libz/uncompr.c
new file mode 100644
index 0000000..8b895c1
--- /dev/null
+++ b/setedit/libz/uncompr.c
@@ -0,0 +1,58 @@
+/* uncompr.c -- decompress a memory buffer
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: uncompr.c,v 1.1.1.1 2001/09/11 13:59:01 set Exp $ */
+
+#include "zlib.h"
+
+/* ===========================================================================
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (Bytef*)source;
+ stream.avail_in = (uInt)sourceLen;
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+
+ err = inflateInit(&stream);
+ if (err != Z_OK) return err;
+
+ err = inflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ inflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = inflateEnd(&stream);
+ return err;
+}
diff --git a/setedit/libz/zconf.h b/setedit/libz/zconf.h
new file mode 100644
index 0000000..e03c74c
--- /dev/null
+++ b/setedit/libz/zconf.h
@@ -0,0 +1,279 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h,v 1.1.1.1 2001/09/11 13:59:01 set Exp $ */
+
+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateReset z_inflateReset
+# define compress z_compress
+# define compress2 z_compress2
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
+#endif
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+# define WIN32
+#endif
+#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
+# ifndef __32BIT__
+# define __32BIT__
+# endif
+#endif
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#if defined(MSDOS) && !defined(__32BIT__)
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
+# define STDC
+#endif
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+# ifndef STDC
+# define STDC
+# endif
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Old Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# define NEED_DUMMY_RETURN
+#endif
+
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+#endif
+#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
+# ifndef __32BIT__
+# define SMALL_MEDIUM
+# define FAR _far
+# endif
+#endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+# if defined(_WINDOWS) || defined(WINDOWS)
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR _cdecl _export
+# endif
+# endif
+# if defined (__BORLANDC__)
+# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+# include <windows.h>
+# define ZEXPORT __declspec(dllexport) WINAPI
+# define ZEXPORTRVA __declspec(dllexport) WINAPIV
+# else
+# if defined (_Windows) && defined (__DLL__)
+# define ZEXPORT _export
+# define ZEXPORTVA _export
+# endif
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# if defined (ZLIB_DLL)
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+#endif
+
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(MACOS) && !defined(TARGET_OS_MAC)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <sys/types.h> /* for off_t */
+# include <unistd.h> /* for SEEK_* and off_t */
+# define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(inflate_blocks,"INBL")
+# pragma map(inflate_blocks_new,"INBLNE")
+# pragma map(inflate_blocks_free,"INBLFR")
+# pragma map(inflate_blocks_reset,"INBLRE")
+# pragma map(inflate_codes_free,"INCOFR")
+# pragma map(inflate_codes,"INCO")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_flush,"INFLU")
+# pragma map(inflate_mask,"INMA")
+# pragma map(inflate_set_dictionary,"INSEDI2")
+# pragma map(inflate_copyright,"INCOPY")
+# pragma map(inflate_trees_bits,"INTRBI")
+# pragma map(inflate_trees_dynamic,"INTRDY")
+# pragma map(inflate_trees_fixed,"INTRFI")
+# pragma map(inflate_trees_free,"INTRFR")
+#endif
+
+#endif /* _ZCONF_H */
diff --git a/setedit/libz/zlib.h b/setedit/libz/zlib.h
new file mode 100644
index 0000000..49f56b4
--- /dev/null
+++ b/setedit/libz/zlib.h
@@ -0,0 +1,893 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.1.3, July 9th, 1998
+
+ Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.1.3"
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: ascii or binary */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+/* Allowed flush values; see deflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ 0.1% larger than avail_in plus 12 bytes. If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update data_type if it can make a good guess about
+ the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+ output as possible to the output buffer. The flushing behavior of inflate is
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
+ and Z_FINISH, but the current implementation actually flushes as much output
+ as possible anyway.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster routine
+ may be used for the single inflate() call.
+
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match). Filtered data consists mostly of small values with a
+ somewhat random distribution. In this case, the compression algorithm is
+ tuned to compress them better. The effect of Z_FILTERED is to force more
+ Huffman coding and less string matching; it is somewhat intermediate
+ between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
+ the compression ratio but not the correctness of the compressed output even
+ if it is not set appropriately.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
+ Upon return of this function, strm->adler is set to the Adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The Adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.)
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
+ dictionary (see deflateSetDictionary).
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect Adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least 0.1% larger than
+ sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+/*
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h". (See the description
+ of deflateInit2 for more information about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ const voidp buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running crc with the bytes buf[0..len-1] and return the updated
+ crc. If buf is NULL, this function returns the required initial value
+ for the crc. Pre- and post-conditioning (one's complement) is performed
+ within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zError OF((int err));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZLIB_H */
diff --git a/setedit/libz/zutil.c b/setedit/libz/zutil.c
new file mode 100644
index 0000000..3b8c25c
--- /dev/null
+++ b/setedit/libz/zutil.c
@@ -0,0 +1,225 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zutil.c,v 1.1.1.1 2001/09/11 13:59:02 set Exp $ */
+
+#include "zutil.h"
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#ifndef STDC
+extern void exit OF((int));
+#endif
+
+const char *z_errmsg[10] = {
+"need dictionary", /* Z_NEED_DICT 2 */
+"stream end", /* Z_STREAM_END 1 */
+"", /* Z_OK 0 */
+"file error", /* Z_ERRNO (-1) */
+"stream error", /* Z_STREAM_ERROR (-2) */
+"data error", /* Z_DATA_ERROR (-3) */
+"insufficient memory", /* Z_MEM_ERROR (-4) */
+"buffer error", /* Z_BUF_ERROR (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+
+const char * ZEXPORT zlibVersion()
+{
+ return ZLIB_VERSION;
+}
+
+#ifdef DEBUG
+
+# ifndef verbose
+# define verbose 0
+# endif
+int z_verbose = verbose;
+
+void z_error (m)
+ char *m;
+{
+ fprintf(stderr, "%s\n", m);
+ exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+ int err;
+{
+ return ERR_MSG(err);
+}
+
+
+#ifndef HAVE_MEMCPY
+
+void zmemcpy(dest, source, len)
+ Bytef* dest;
+ const Bytef* source;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = *source++; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+
+int zmemcmp(s1, s2, len)
+ const Bytef* s1;
+ const Bytef* s2;
+ uInt len;
+{
+ uInt j;
+
+ for (j = 0; j < len; j++) {
+ if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+ }
+ return 0;
+}
+
+void zmemzero(dest, len)
+ Bytef* dest;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = 0; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+#endif
+
+#ifdef __TURBOC__
+#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
+/* Small and medium model in Turbo C are for now limited to near allocation
+ * with reduced MAX_WBITS and MAX_MEM_LEVEL
+ */
+# define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+ voidpf org_ptr;
+ voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ voidpf buf = opaque; /* just to make some compilers happy */
+ ulg bsize = (ulg)items*size;
+
+ /* If we allocate less than 65520 bytes, we assume that farmalloc
+ * will return a usable pointer which doesn't have to be normalized.
+ */
+ if (bsize < 65520L) {
+ buf = farmalloc(bsize);
+ if (*(ush*)&buf != 0) return buf;
+ } else {
+ buf = farmalloc(bsize + 16L);
+ }
+ if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+ table[next_ptr].org_ptr = buf;
+
+ /* Normalize the pointer to seg:0 */
+ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+ *(ush*)&buf = 0;
+ table[next_ptr++].new_ptr = buf;
+ return buf;
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ int n;
+ if (*(ush*)&ptr != 0) { /* object < 64K */
+ farfree(ptr);
+ return;
+ }
+ /* Find the original pointer */
+ for (n = 0; n < next_ptr; n++) {
+ if (ptr != table[n].new_ptr) continue;
+
+ farfree(table[n].org_ptr);
+ while (++n < next_ptr) {
+ table[n-1] = table[n];
+ }
+ next_ptr--;
+ return;
+ }
+ ptr = opaque; /* just to make some compilers happy */
+ Assert(0, "zcfree: ptr not found");
+}
+#endif
+#endif /* __TURBOC__ */
+
+
+#if defined(M_I86) && !defined(__32BIT__)
+/* Microsoft C in 16-bit mode */
+
+# define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+# define _halloc halloc
+# define _hfree hfree
+#endif
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ return _halloc((long)items, size);
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ _hfree(ptr);
+}
+
+#endif /* MSC */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp calloc OF((uInt items, uInt size));
+extern void free OF((voidpf ptr));
+#endif
+
+voidpf zcalloc (opaque, items, size)
+ voidpf opaque;
+ unsigned items;
+ unsigned size;
+{
+ if (opaque) items += size - size; /* make compiler happy */
+ return (voidpf)calloc(items, size);
+}
+
+void zcfree (opaque, ptr)
+ voidpf opaque;
+ voidpf ptr;
+{
+ free(ptr);
+ if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
diff --git a/setedit/libz/zutil.h b/setedit/libz/zutil.h
new file mode 100644
index 0000000..5f8763a
--- /dev/null
+++ b/setedit/libz/zutil.h
@@ -0,0 +1,220 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: zutil.h,v 1.1.1.1 2001/09/11 13:59:02 set Exp $ */
+
+#ifndef _Z_UTIL_H
+#define _Z_UTIL_H
+
+#include "zlib.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long ulg;
+
+extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+ return (strm->msg = (char*)ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+ /* common constants */
+
+#ifndef DEF_WBITS
+# define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+/* The three kinds of block type */
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+ /* target dependencies */
+
+#ifdef MSDOS
+# define OS_CODE 0x00
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# include <malloc.h>
+# endif
+#endif
+
+#ifdef OS2
+# define OS_CODE 0x06
+#endif
+
+#ifdef WIN32 /* Window 95 & Windows NT */
+# define OS_CODE 0x0b
+#endif
+
+#if defined(VAXC) || defined(VMS)
+# define OS_CODE 0x02
+# define F_OPEN(name, mode) \
+ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#ifdef AMIGA
+# define OS_CODE 0x01
+#endif
+
+#if defined(ATARI) || defined(atarist)
+# define OS_CODE 0x05
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+# define OS_CODE 0x07
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+# endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+# define OS_CODE 0x0F
+#endif
+
+#ifdef TOPS20
+# define OS_CODE 0x0a
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600))
+# define fdopen(fd,type) _fdopen(fd,type)
+#endif
+
+
+ /* Common defaults */
+
+#ifndef OS_CODE
+# define OS_CODE 0x03 /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+# define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+ /* functions */
+
+#ifdef HAVE_STRERROR
+ extern char *strerror OF((int));
+# define zstrerror(errnum) strerror(errnum)
+#else
+# define zstrerror(errnum) ""
+#endif
+
+#if defined(pyr)
+# define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+ * You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
+ */
+# define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+# define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+# define zmemcpy _fmemcpy
+# define zmemcmp _fmemcmp
+# define zmemzero(dest, len) _fmemset(dest, 0, len)
+# else
+# define zmemcpy memcpy
+# define zmemcmp memcmp
+# define zmemzero(dest, len) memset(dest, 0, len)
+# endif
+#else
+ extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ extern void zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+# include <stdio.h>
+ extern int z_verbose;
+ extern void z_error OF((char *m));
+# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+# define Assert(cond,msg)
+# define Trace(x)
+# define Tracev(x)
+# define Tracevv(x)
+# define Tracec(c,x)
+# define Tracecv(c,x)
+#endif
+
+
+typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
+ uInt len));
+voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
+void zcfree OF((voidpf opaque, voidpf ptr));
+
+#define ZALLOC(strm, items, size) \
+ (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+#endif /* _Z_UTIL_H */
diff --git a/setedit/mainsrc/accehtml.cc b/setedit/mainsrc/accehtml.cc
new file mode 100644
index 0000000..6135b5d
--- /dev/null
+++ b/setedit/mainsrc/accehtml.cc
@@ -0,0 +1,313 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+
+#define Uses_TView
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_MsgBox
+#define Uses_TCEditWindow
+#define Uses_TVCodePage
+#include <ceditor.h>
+#define Uses_SETAppVarious
+
+#include <setapp.h>
+#include <ctype.h>
+#include <ucdefs.h>
+
+static void ExpandAccents(TCEditor *e);
+static void CompactAccents(TCEditor *e);
+
+void HTMLAcc_Entry(Boolean compact)
+{
+ TView *p;
+
+ p=TApplication::deskTop->current;
+ if (!p) return; // Avoid a search
+ if (IsAnEditor(p))
+ {
+ TCEditor *e=((TCEditWindow *)p)->editor;
+ if (e->isReadOnly || TCEditor::editorDialog(edActionWOUndo)!=cmYes)
+ return;
+ if (e->IslineInEdition)
+ e->MakeEfectiveLineInEdition();
+ e->buffer[e->bufLen]=0;
+ e->SetMarker(9);
+
+ if (compact)
+ CompactAccents(e);
+ else
+ ExpandAccents(e);
+
+ /* Jump to the start because the line offset is no longer valid and it can
+ mess the drawing */
+ e->ResetCursorPosition();
+ e->GotoOffSet(e->Markers[9]);
+ e->update(ufView);
+ e->trackCursor(True);
+
+ /* Flush the undo information */
+ e->flushUndoInfo();
+ }
+ else
+ messageBox(__("You must select the editor window first"),mfError | mfOKButton);
+}
+
+/*****************************************************************************
+
+ The following table translates my internal fonts numbers to ISO-1 html
+strings.
+
+*****************************************************************************/
+static char *Remap[]=
+{
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0..15
+ 0,0,0,0,
+ "para", // 20 pilcrow (paragraph sign)
+ "sect", // 21 section sign
+ 0,0,0,0,0,0,0,0,0,0, // ..31
+ 0,0,0,0,
+ "curren", // 36 general currency sign
+ 0,0,0,0,0,0,0,0,0,0,0, // ..47
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // ..127
+ "Ccedil", // 128 capital C, cedilla
+ "uuml", // 129 small u, dieresis or umlaut mark
+ "eacute", // 130 small e, acute accent
+ "acirc", // 131 small a, circumflex accent
+ "auml", // 132 mall a, dieresis or umlaut mark
+ "agrave", // 133 small a, grave accent
+ "aring", // 134 small a, ring
+ "ccedil", // 135 small c, cedilla
+ "ecirc", // 136 small e, circumflex accent
+ "euml", // 137 small e, dieresis or umlaut mark
+ "egrave", // 138 small e, grave accent
+ "iuml", // 139 small i, dieresis or umlaut mark
+ "icirc", // 140 small i, circumflex accent
+ "igrave", // 141 small i, grave accent
+ "Auml", // 142 capital A, dieresis or umlaut mark
+ "Aring", // 143 capital A, ring
+ "Eacute", // 144 capital E, acute accent
+ "aelig", // 145 small ae diphthong (ligature)
+ "AElig", // 146 capital AE diphthong (ligature)
+ "ocirc", // 147 small o, circumflex accent
+ "ouml", // 148 small o, dieresis or umlaut mark
+ "ograve", // 149 small o, grave accent
+ "ucirc", // 150 small u, circumflex accent
+ "ugrave", // 151 small u, grave accent
+ "yuml", // 152 small y, dieresis or umlaut mark
+ "Ouml", // 153 capital O, dieresis or umlaut mark
+ "Uuml", // 154 capital U, dieresis or umlaut mark
+ "cent", // 155 cent sign
+ "pound", // 156 pound sterling sign
+ "yen", // 157 yen sign
+ 0, // 158 peseta
+ 0, // 159 florn
+ "aacute", // 160 small a, acute accent
+ "iacute", // 161 small i, acute accent
+ "oacute", // 162 small o, acute accent
+ "uacute", // 163 small u, acute accent
+ "ntilde", // 164 small n, tilde
+ "Ntilde", // 165 capital N, tilde
+ "ordf", // 166 ordinal indicator, feminine
+ "ordm", // 167 ordinal indicator, masculine
+ "iquest", // 168 inverted question mark
+ 0, // 169
+ "not", // 170 not sign
+ "frac12", // 171 fraction one-half
+ "frac14", // 172 fraction one-quarter
+ "iexcl", // 173 inverted exclamation mark
+ "laquo", // 174 angle quotation mark, left
+ "raquo", // 175 angle quotation mark, right
+ 0,0,0,0,0, // 176 .. 180
+ 0,0,0,0,0,0,0,0,0,0, // 181 .. 190
+ 0,0,0,0,0,0,0,0,0,0, // 191 .. 200
+ 0,0,0,0,0,0,0,0,0,0, // 201 .. 210
+ 0,0,0,0,0,0,0,0,0,0, // 211 .. 220
+ 0,0,0,
+ 0, // 224 alfa
+ "szlig", // 225 small sharp s, German (sz ligature)
+ 0, // 226 gama may.
+ 0, // 227 pi
+ 0, // 228 sigma may.
+ 0, // 229 sigma
+ "micro", // 230 micro sign
+ 0, // 231 tau
+ 0,0,0,0,0,0,0,0,0,
+ "plusmn", // 241 plus-or-minus sign
+ 0,0,0,0,
+ "divide", // 246 divide sign
+ 0,
+ "deg", // 248 degree sign
+ "middot", // 249 middle dot
+ 0,0,0,
+ "sup2", // 253 superscript two
+ 0,0, // ..255
+ 0,0,0,0,0,
+ "yacute", // 261 small y, acute accent
+ 0,
+ "Aacute", // 263 capital A, acute accent
+ 0,
+ "Iacute", // 265 capital I, acute accent
+ 0,0,
+ "Oacute", // 268 capital O, acute accent
+ 0,0,
+ "Uacute", // 271 capital U, acute accent
+ "Yacute", // 272 capital Y, acute accent
+ 0,0,
+ "Agrave", // 275 capital A, grave accent
+ "Egrave", // 276 capital E, grave accent
+ "Igrave", // 277 capital I, grave accent
+ "Ograve", // 278 capital O, grave accent
+ "Ugrave", // 279 capital U, grave accent
+ "Euml", // 280 capital E, dieresis or umlaut mark
+ "Iuml", // 281 capital I, dieresis or umlaut mark
+ 0,0,
+ "atilde", // 284 small a, tilde
+ "otilde", // 285 small o, tilde
+ 0,
+ "Atilde", // 287 capital A, tilde
+ "Otilde", // 288 capital O, tilde
+ "Acirc", // 289 capital A, circumflex accent
+ "Ecirc", // 290 capital E, circumflex accent
+ "Icirc", // 291 capital I, circumflex accent
+ "Ocirc", // 292 capital O, circumflex accent
+ "Ucirc", // 293 capital U, circumflex accent
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ "oslash", // 318 small o, slash
+ 0,
+ "Oslash", // 320 capital O, slash
+ "eth", // 321 small eth, Icelandic
+ 0,
+ "ETH", // 323 capital Eth, Icelandic
+ 0,0,0,0,0,0,0,0,
+ "thorn", // 332 small thorn, Icelandic
+ "THORN", // 333 capital THORN, Icelandic
+ "times", // 334 multiply sign
+ "reg", // 335 registered sign
+ "copy", // 336 copyrigh\t sign
+ 0,
+ "brvbar", // 338 broken (vertical) bar
+ 0,
+ "acute", // 340 acute accent
+ "shy", // 341 soft hyphen /// macron
+ 0,
+ "frac34", // 343 fraction three-quarters
+ "cedil", // 344 cedilla
+ "uml", // 345 umlaut (dieresis)
+ "sup1", // 346 superscript one
+ "sup3" // 347 superscript three
+};
+
+const unsigned LastRemap=sizeof(Remap)/sizeof(char *);
+
+static
+void ExpandAccents(TCEditor *e)
+{
+ // Get the map for the current code page
+ ushort *map=TVCodePage::GetTranslate(TVCodePage::GetAppCodePage());
+
+ e->lock();
+ e->lockUndo();
+
+ uchar *s=(uchar *)e->buffer;
+ char *repl;
+ unsigned len=e->bufLen,pos=0,value,index;
+ char buf[12];
+ buf[0]='&';
+
+ while (pos<len)
+ {
+ // Convert the char code to the internal representation
+ value=map[s[pos]];
+ if (value<LastRemap)
+ {
+ if (Remap[value])
+ {
+ e->deleteRange((char *)s+pos,(char *)s+pos+1,False);
+ repl=Remap[value];
+ for (index=0; repl[index]; index++)
+ buf[index+1]=repl[index];
+ buf[index+1]=';';
+ e->insertText(buf,index+2,False);
+ // Adjust the len because it changed
+ len=e->bufLen;
+ // The buffer could be reallocated and hence changed!
+ s=(uchar *)e->buffer;
+ }
+ }
+ pos++;
+ }
+ e->unlockUndo();
+ e->unlock();
+}
+
+static
+void CompactAccents(TCEditor *e)
+{
+ // Get the map for the current code page
+ ushort *map=TVCodePage::GetTranslate(TVCodePage::GetAppCodePage());
+
+ e->lock();
+ e->lockUndo();
+
+ uchar *s=(uchar *)e->buffer;
+ unsigned len=e->bufLen,pos=0,value,index,lenW,posStart;
+ char buf[12];
+
+ while (pos<len)
+ {
+ if (s[pos]!='&')
+ {
+ pos++;
+ continue;
+ }
+ posStart=pos;
+ // Take the word
+ index=0; pos++;
+ while (pos<len && TVCodePage::isAlpha(s[pos]) && index<6)
+ {
+ buf[index++]=s[pos];
+ pos++;
+ }
+ lenW=index+1;
+ buf[index]=0;
+ if (pos<len)
+ {
+ if (TVCodePage::isAlpha(s[pos]))
+ continue;
+ if (s[pos]==';')
+ lenW++;
+ }
+
+ // Search what's the code for it
+ // Could be faster creating a sorted collection with the names.
+ for (value=0; value<LastRemap; value++)
+ if (Remap[value] && strcmp(Remap[value],buf)==0)
+ break;
+ if (value==LastRemap) continue;
+
+ // Search the code in this code page
+ // Could be faster creating a look-up table
+ for (index=0; index<256; index++)
+ if ((unsigned)map[index]==value)
+ break;
+ if (index==256) continue;
+
+ e->deleteRange((char *)s+posStart,(char *)s+posStart+lenW,False);
+ buf[0]=index;
+ e->insertText(buf,1,False);
+ pos-=lenW-1;
+ // Adjust the len because it changed
+ len=e->bufLen;
+ // The buffer could be reallocated and hence changed!
+ s=(uchar *)e->buffer;
+ }
+ e->unlockUndo();
+ e->unlock();
+}
+
+
diff --git a/setedit/mainsrc/bufun.cc b/setedit/mainsrc/bufun.cc
new file mode 100644
index 0000000..62caaab
--- /dev/null
+++ b/setedit/mainsrc/bufun.cc
@@ -0,0 +1,1024 @@
+/****************************************************************************
+
+ Busca Funciones (BuFun), Copyright (c) 1996-2007 by Salvador E. Tropea (SET)
+
+ int SelectFunctionToJump(char *b, unsigned l)
+
+ Is the external entry point, this routine calls to one routine that parses
+the C source searching for functions, the methode is heuristic and doesn't
+detect all the possible cases, in particular the K & R edition I style of
+functions (totally obsolete).
+ The routine creates a StringCollection with the functions found and then
+creates a dialog box to select one. If the user select a function the
+routine returns the line where the function starts if there are no functions
+or the user choose cancel the routine returns -1.
+ The parameters passed to the routine are:
+ char *b: The buffer where the routines will search.
+ unsigned l: The length of the buffer.
+
+ Defining the label TEST you can test the module as an standalone program.
+
+****************************************************************************/
+
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_string
+#define Uses_stdlib
+#define Uses_itoa
+
+#define Uses_MsgBox
+#define Uses_TLabel
+#define Uses_TScrollBar
+#define Uses_TRect
+#define Uses_TButton
+#define Uses_TDialog
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_TVCodePage
+
+#define Uses_TCEditor_External // For mode constants
+#define Uses_TCEditor_Commands // For the cmcJumpToFunction context
+
+#define Uses_TSSOSSortedListBox
+#define Uses_TSLabel
+#define Uses_TSButton
+#define Uses_TSHzGroup
+#define Uses_TSStaticText
+#include <easydia1.h>
+#include <ceditor.h>
+#include <easydiag.h>
+
+#define Uses_TGrowDialog
+#define Uses_SOStack
+#define Uses_TNoCaseSOSStringCollection
+#define Uses_TSOSSortedListBox
+#include <settvuti.h>
+
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <edmsg.h>
+#include <bufun.h>
+#include <splinman.h>
+
+extern ushort execDialog( TDialog *d, void *data );
+
+//#define TEST
+
+inline int IsWordChar(char c)
+{
+ return c=='_' || TVCodePage::isAlpha(c);
+}
+
+char bfBuffer[MaxLenWith0];
+char bfNomFun[MaxLenWith0];
+char bfTempNomFun[MaxLenWith0];
+static char Alone;
+static int Used,UsedNom;
+static int Line,LineFun;
+typedef struct
+{
+ int line;
+ ccIndex index;
+} stItem;
+
+#ifdef TEST
+static FILE *in;
+#else
+static char *buffer;
+static unsigned IndexB;
+static unsigned BufLen;
+#endif
+
+static int TakeWord(int TakeOneCharToo=0);
+
+
+#ifdef TEST
+static int GetAChar()
+{
+ char c=getc(in);
+ if (c=='\n')
+ Line++;
+ return c;
+}
+
+static void UnGetAChar(int c)
+{
+ ungetc(c,in);
+ if (c=='\n')
+ Line--;
+}
+#else
+static int GetAChar()
+{
+ if (IndexB>=BufLen)
+ return EOF;
+ int c=(unsigned char)buffer[IndexB++];
+ if (c=='\n')
+ Line++;
+ return c;
+}
+
+static void UnGetAChar(int c)
+{
+ IndexB--;
+ if (c=='\n')
+ Line--;
+}
+#endif
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Puts the next word in Buffer. It skips white spaces, comments,
+preprocesor lines, etc. So only words that can be interesting are collected.
+If TakeOneCharToo!=0 the routine also collects single chars in Alone global
+variable.
+
+ Return:
+ 0 nothing found.
+ 1 a word.
+ 2 a single character
+ 3 a preprocessor line. The buffer contains the #xxx that started the line.
+
+***************************************************************************/
+
+static
+int TakeWord(int TakeOneCharToo)
+{
+ int c;
+ char last;
+
+ do
+ {
+ c=GetAChar();
+ if (c==EOF)
+ return 0;
+ if (IsWordChar(c))
+ {
+ Used=0;
+ do
+ {
+ bfBuffer[Used++]=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && Used<MaxLen && (TVCodePage::isAlNum(c) || c==':' || c=='_' || c=='~'));
+ bfBuffer[Used]=0;
+ if (c!=EOF)
+ UnGetAChar(c);
+ if (Used==0)
+ return 0;
+ return 1;
+ }
+ else
+ if (ucisspace(c))
+ {
+ do
+ {
+ c=GetAChar();
+ }
+ while (c!=EOF && ucisspace(c));
+ UnGetAChar(c);
+ }
+ else
+ {
+ switch (c)
+ {
+ case '\"':
+ do
+ {
+ c=GetAChar();
+ if (c=='\\')
+ {
+ c=GetAChar();
+ if (c!=EOF) c=0;
+ }
+ }
+ while (c!=EOF && c!='\"');
+ break;
+
+ case '\'':
+ do
+ {
+ c=GetAChar();
+ if (c=='\\')
+ {
+ c=GetAChar();
+ if (c!=EOF) c=0;
+ }
+ }
+ while (c!=EOF && c!='\'');
+ break;
+
+ case '/':
+ c=GetAChar();
+ if (c=='/')
+ {
+ do
+ {
+ do
+ {
+ last=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && c!='\n' && c!='\r');
+ if (c=='\r') c=GetAChar();
+ }
+ while (last=='\\');
+ }
+ else
+ if (c=='*')
+ {
+ do
+ {
+ c=GetAChar();
+ if (c=='*')
+ {
+ c=GetAChar();
+ if (c=='/')
+ break;
+ UnGetAChar(c);
+ }
+ }
+ while (c!=EOF);
+ }
+ break;
+
+ case '#':
+ Used=0;
+ do
+ {
+ bfBuffer[Used++]=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && Used<MaxLen && TVCodePage::isAlpha(c));
+ bfBuffer[Used]=0;
+ if (c==EOF || Used==0)
+ return 0;
+ UnGetAChar(c);
+ do
+ {
+ do
+ {
+ last=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && c!='\n' && c!='\r');
+ if (c=='\r') c=GetAChar();
+ }
+ while (last=='\\');
+ return 3;
+
+
+ default:
+ // Is a single char
+ if (TakeOneCharToo)
+ {
+ Alone=c;
+ return 2;
+ }
+ }
+ }
+ }
+ while (c!=EOF);
+
+ return 0;
+}
+
+const int maxPreproStates=64;
+
+static int SearchBalance(char ref, char ref2)
+{
+ int r,bal=1;
+ int preproLevel=0;
+ static char preproStates[maxPreproStates];
+
+ preproStates[0]=0;
+ do
+ {
+ r=TakeWord(1);
+ if (r==2)
+ {
+ if (preproStates[preproLevel]) continue;
+ if (Alone==ref)
+ bal--;
+ else
+ if (Alone==ref2) bal++;
+ }
+ else if (r==3)
+ {
+ if (strncmp(bfBuffer,"#if",3)==0)
+ {
+ preproLevel++;
+ if (preproLevel==maxPreproStates) preproLevel--;
+ preproStates[preproLevel]=0;
+ }
+ else if (strncmp(bfBuffer,"#else",5)==0 || strncmp(bfBuffer,"#elif",5)==0)
+ {
+ preproStates[preproLevel]=1;
+ }
+ else if (strncmp(bfBuffer,"#endif",6)==0)
+ {
+ preproLevel--;
+ if (preproLevel<0) preproLevel=0;
+ }
+ }
+ if (!bal) break;
+ }
+ while (r);
+
+ return r;
+}
+
+
+static
+int SearchBalanceCopy(char ref, char ref2)
+{
+ int r,bal=1;
+
+ if (Used<MaxLen)
+ bfNomFun[Used++]=ref2;
+ UsedNom=Used;
+ do
+ {
+ r=TakeWord(1);
+ if (r==2)
+ {
+ if (Alone==ref)
+ bal--;
+ else
+ if (Alone==ref2) bal++;
+ if (UsedNom<MaxLen)
+ {
+ if (Alone==')' && bfNomFun[UsedNom-1]==' ')
+ bfNomFun[UsedNom-1]=Alone;
+ else
+ if (Alone==',' && bfNomFun[UsedNom-1]==' ')
+ {
+ bfNomFun[UsedNom-1]=Alone;
+ bfNomFun[UsedNom++]=' ';
+ }
+ else
+ bfNomFun[UsedNom++]=Alone;
+ }
+ }
+ else
+ if (r==1)
+ {
+ if (UsedNom+Used<MaxLen_1)
+ {
+ strcpy(&bfNomFun[UsedNom],bfBuffer);
+ UsedNom+=Used;
+ bfNomFun[UsedNom++]=' ';
+ }
+ }
+ if (!bal) break;
+ }
+ while (r);
+ bfNomFun[UsedNom++]=0;
+
+ return r;
+}
+
+static
+int SearchCFuncs(char *b, unsigned l, int mode, tAddFunc AddFunc)
+{
+ int funs=0;
+ int opLen=0;
+ char opBuf[8];
+ int rearrageName=mode & modeBFClassSep;
+ mode&=modeBFFunctions; // Only function/prototype setting
+
+ buffer=b;
+ IndexB=0;
+ BufLen=l;
+
+ Line=1;
+ int r;
+ do
+ {
+ r=TakeWord();
+ if (!r) break;
+ if (strcmp(bfBuffer,"operator")==0 || (Used>10 && strcmp(bfBuffer+Used-10,"::operator")==0))
+ { // C++ operators are a special case.
+ // Here we collect the name of the operator, that's symbols until
+ // the ( [We can't get fooled by () operator because we always skip
+ // the first]
+ opLen=1;
+ TakeWord(1);
+ opBuf[0]=Alone;
+ do
+ {
+ r=TakeWord(1);
+ if (r==2 && opLen<4 && Alone!='(')
+ opBuf[opLen++]=Alone;
+ }
+ while (r==2 && Alone!='(');
+ opBuf[opLen]=0;
+ }
+ else
+ { // Not an operator, it can be the return type of a function or any
+ // other thing. Collect the last word before anything that isn't a
+ // word. That's potentially the name of a function
+ do
+ {
+ r=TakeWord(1);
+ }
+ while(r==1);
+ if (!r) break;
+ }
+ // Ok, we should have the name in Buffer and Alone should be (
+ if (Alone=='(')
+ {
+ strcpy(bfNomFun,bfBuffer);
+ if (opLen)
+ { // operators
+ strcat(bfNomFun," ");
+ strcat(bfNomFun,opBuf);
+ strcat(bfNomFun," ");
+ Used+=opLen+2;
+ opLen=0;
+ }
+ LineFun=Line;
+ // Collect all the parameters
+ r=SearchBalanceCopy(')','(');
+ if (!r) break;
+ // Now we should find: (a) a { if that's a function or (b) a ; if that's
+ // a prototype.
+ do
+ {
+ r=TakeWord(1);
+ }
+ while (r==3 && bfBuffer[0]=='#');
+ if (!r) break;
+
+ int SearchOpen=0,SkipCatch=0;
+ int Eureka=0,isProto=0;
+
+ // Another special case for C++ const member atributes
+ // For: proto const ...
+ if (r==1 && strcmp(bfBuffer,"const")==0)
+ r=TakeWord(1);
+ // List of exceptions that can be thrown
+ // For: proto throw(...) ...
+ if (r==1 && strcmp(bfBuffer,"throw")==0)
+ {
+ r=TakeWord(1);
+ if (r==2 && Alone=='(') // throw(
+ {
+ r=SearchBalance(')','(');
+ if (!r) break;
+ // throw(...)
+ r=TakeWord(1);
+ }
+ }
+
+ if (mode==modeBFPrototypes && r==2 && Alone==';')
+ {// Looking for a prototype
+ Eureka=isProto=1;
+ }
+
+ if (!isProto)
+ {// Looking for a function
+ if (r==2)
+ {
+ if (Alone=='{')
+ Eureka=1;
+ else
+ if (Alone==':') // Special case for C++ constructors with
+ // initialization lists.
+ SearchOpen=Eureka=1;
+ }
+ else
+ {
+ // A bizarre case: try/catch not inside the body
+ if (strcmp(bfBuffer,"try")==0)
+ SkipCatch=SearchOpen=Eureka=1;
+ }
+ }
+ if (Eureka)
+ {
+ // Delay the insertion until we know the line of ending
+ int used=UsedNom;
+ if (mode!=modeBFPrototypes || isProto)
+ strcpy(bfTempNomFun,bfNomFun);
+
+ if (!isProto)
+ {// If the { was delayed look now for it
+ if (SearchOpen)
+ {
+ do
+ {
+ r=TakeWord(1);
+ if (r==2 && Alone=='{') break;
+ }
+ while (r);
+ if (!r) break;
+ }
+ // Skip the body of the function
+ r=SearchBalance('}','{');
+ if (!r) break;
+ }
+ // We found a `try', we should find a `catch'.
+ // If found skip it adding to the function body these lines.
+ if (SkipCatch)
+ {
+ unsigned pIndexB=IndexB;
+ int pLine=Line;
+ do
+ {
+ r=TakeWord(0);
+ }
+ while (r==3);
+ if (r==1 && (strcmp(bfBuffer,"catch")==0))
+ {
+ r=TakeWord(1);
+ if (r==2 && Alone=='(')
+ {
+ if (SearchBalance(')','('))
+ {
+ r=TakeWord(1);
+ if (r==2 && Alone=='{')
+ SearchBalance('}','{');
+ }
+ }
+ }
+ else
+ {
+ IndexB=pIndexB;
+ Line=pLine;
+ }
+ }
+
+ // Now insert it
+ if (mode!=modeBFPrototypes || isProto)
+ {
+ //stkHandler s=StrDup(bfTempNomFun,LineFun,Line,used,stk,rearrageName);
+ //FunList->insert(s);
+ char *member=NULL, *aux;
+
+ // Look for the member name. But only in the function name.
+ aux=strchr(bfTempNomFun,'(');
+ if (aux)
+ {
+ *aux=0;
+ // Look for the *last* :: (namespace::class::member)
+ // Pointed out by Andris.
+ member=strrchr(bfTempNomFun,':');
+ if (member && member!=bfTempNomFun && member[-1]==':')
+ member--;
+ else
+ member=NULL;
+ *aux='(';
+ }
+
+ if (!rearrageName || member==NULL)
+ {
+ strcpy(bfNomFun,bfTempNomFun);
+ }
+ else
+ { // Change class::member to member (class)
+ used++;
+ char *source=member+2,*dest=bfNomFun;
+ for (; *source; source++,dest++) *dest=*source;
+ *(dest++)=' ';
+ *(dest++)='(';
+ char *s=bfTempNomFun;
+ for (;s<member; s++,dest++) *dest=*s;
+ *(dest++)=')';
+ *dest=0;
+ }
+ AddFunc(bfNomFun,used,LineFun,Line);
+ funs++;
+ }
+ #ifdef TEST
+ printf("Function: %s, Line %d, Line end %d\n",bfTempNomFun,LineFun,Line);
+ #endif
+ }
+ }
+ }
+ while(r);
+
+ return funs;
+}
+
+
+static TNoCaseSOSStringCollection *glFunList;
+static SOStack *glStk;
+
+// A copy of this function is used in txhgen.cc, any update here should be
+// reflected there until I find a better solution.
+inline
+void AlignLen(int &len)
+{
+ if (len & 3)
+ len+=4-(len & 3);
+}
+
+static
+void StrDup(char *s, int len, int line, int lineEnd)
+{
+ stkHandler h;
+ char *d,b[64];
+ ccIndex ind;
+ int differentiate=0;
+
+ if (glFunList->Search(s,ind))
+ {// Already there
+ itoa(line,b,10);
+ len+=strlen(b)+1;
+ differentiate=1;
+ }
+
+ AlignLen(len);
+ h=glStk->alloc(len+sizeof(int)*2);
+ d=glStk->GetStrOf(h);
+ strcpy(d,s);
+ if (differentiate)
+ {
+ strcat(d," ");
+ strcat(d,b);
+ }
+ int *l=(int *)&d[len];
+ l[0]=line;
+ l[1]=lineEnd;
+ glFunList->insert(h);
+}
+
+static stFuncsSHL FuncsAvail[]=
+{
+ {"Clipper 5.x",SearchClipperFuncs},
+ {"Perl",SearchPerlFuncs},
+ {"Syntax Highlight File",SearchSHLDefs},
+ {"Texinfo source",SearchTxiSecs},
+ {"80x86 asm (AT&T syntax)",SearchAsmLabels},
+ {"80x86 asm (Intel syntax)",SearchAsmLabels},
+ {"Netwide Assembler",SearchAsmLabels},
+ {"8x51 asm",SearchAsmLabels},
+ {"PICs asm",SearchAsmLabels},
+ {"PDP11 asm",SearchAsmLabels},
+ {"PHP",SearchPHPFuncs},
+ {"Python",SearchPythonSymbols},
+ {"VHDL",SearchVHDLStuff},
+ {"PMacros file",SearchPMDefs},
+ {"KICAD Library",SearchKICADLib},
+ {"Makefile",SearchMakeLabels},
+ {"HTML",SearchHTMLAnchors},
+ {0,SearchCFuncs}
+};
+
+static
+int SearchFuncs(char *b, unsigned l, TNoCaseSOSStringCollection *FunList,
+ SOStack *stk, int mode, const char *shl)
+{
+ if (!shl) return 0;
+ glFunList=FunList;
+ glStk=stk;
+ int i=0;
+ //FunList->duplicates=True;
+ while (FuncsAvail[i].shl)
+ {
+ if (!strcmp(FuncsAvail[i].shl,shl))
+ return FuncsAvail[i].func(b,l,mode,StrDup);
+ i++;
+ }
+ return FuncsAvail[i].func(b,l,mode,StrDup);
+}
+
+#ifndef TEST
+
+class TLFuns : public TGrowDialog
+{
+public:
+ TLFuns( TRect r, const char *name, int extraOptions=0 ) :
+ TWindowInit( &TLFuns::initFrame ),
+ TGrowDialog(r,name,extraOptions) {};
+ void handleEvent(TEvent& event);
+};
+
+void TLFuns::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if ( event.what == evCommand || event.what == evBroadcast)
+ {
+ switch ( event.message.command )
+ {
+ // a button
+ case cmListItemSelected:
+ endModal(event.message.command);
+ clearEvent(event);
+ break;
+ case cmeZoom:
+ event.message.command=cmZoom;
+ TDialog::handleEvent(event);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static TDialog *createDialog( )
+{
+ TLFuns *d=new TLFuns(TRect(1,1,1,1),__("Jump to function"));
+ TSViewCol *col=new TSViewCol(d);
+
+ TRect r=TApplication::deskTop->getExtent();
+ int h=r.b.y-r.a.y-10;
+ int w=r.b.x-r.a.x-15;
+
+ TSSOSSortedListBox *ListaH=new TSSOSSortedListBox(w,h,tsslbVertical|tsslbHorizontal,1,256);
+ ((TListViewer *)ListaH->view)->handleSpace=False;
+ ListaH->view->growMode=gfMoveBottomCorner;
+ TSLabel *lista=new TSLabel(__("List of functions"),ListaH);
+
+ col->insert(xTSLeft,yTSUp,lista);
+
+ TSButton *ok=new TSButton(__("O~K~"),cmOK,bfDefault);
+ TSButton *cancel=new TSButton(__("Cancel"),cmCancel);
+ TSButton *browse=new TSButton(__("~B~rowse"),cmYes);
+ ok->view->growMode=cancel->view->growMode=browse->view->growMode=gfGrowAll;
+ TSHzGroup *but123=MakeHzGroup(ok,cancel,browse,0);
+ col->insert(xTSCenter,yTSDown,but123);
+ col->doItCenter(cmcJumpToFunction);
+ delete col;
+ return d;
+}
+
+static
+char *GetNameLine(TNoCaseSOSStringCollection *FunList, int i, int *line)
+{
+ char *s=FunList->atStr(i);
+ int length=strlen(s)+1;
+ AlignLen(length);
+ *line=*(int *)(s+length);
+ return s;
+}
+
+static
+int cmpStItem(const void *e1, const void *e2)
+{
+ stItem *i1=(stItem *)e1,*i2=(stItem *)e2;
+ return i1->line-i2->line;
+}
+
+static
+int AskSortList()
+{
+ TSViewCol *col=new TSViewCol(__("Sort mode"));
+
+ col->insert(xTSCenter,yTSUp,new TSStaticText(__("Sort the functions")));
+ col->insert(xTSCenter,yTSDown,
+ new TSHzGroup(new TSButton(__("~A~lphabetically"),cmYes,bfDefault),
+ new TSButton(__("by ~L~ine"),cmNo)));
+ TDialog *d=col->doItCenter(cmcJumpToFunction);
+ delete col;
+ return execDialog(d,0);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs functions and prototypes and ask for jumping.
+
+ Include: ced_exte
+ Return: Line to jump or -1
+
+***************************************************************************/
+
+int SelectFunctionToJump(char *b, unsigned l, char *word, int mode,
+ char *fileName, const char *shl)
+{
+ SOStack stk;
+ TNoCaseSOSStringCollection *FunList = new TNoCaseSOSStringCollection(20,5,&stk);
+
+ int funcs=SearchFuncs(b,l,FunList,&stk,mode|modeBFClassSep,shl);
+
+ struct TListBoxRec
+ {
+ TCollection *items;
+ ccIndex selection;
+ } br;
+
+ br.items=FunList;
+ br.selection=0;
+
+ if (!funcs)
+ {
+ messageBox(__("Hmmm ... I can't find any function, are you sure?"),mfError | mfOKButton);
+ delete FunList;
+ return -1;
+ }
+ else
+ {
+ if (word)
+ {
+ FunList->Search(word,br.selection);
+ if (br.selection>=FunList->getCount())
+ br.selection=FunList->getCount()-1;
+ }
+ int ret=execDialog(createDialog(),&br);
+ if (ret==cmCancel)
+ {
+ delete FunList;
+ return -1;
+ }
+ // The Browse button have cmYes as command, just for commodity
+ if (ret==cmYes)
+ {
+ ret=AskSortList();
+ if (ret==cmCancel)
+ {
+ delete FunList;
+ return -1;
+ }
+ TProgram::deskTop->lock();
+ char *aux=TVIntl::getTextNew(__("Functions:"));
+ EdShowMessage(aux,True);
+ DeleteArray(aux);
+ int i,c=FunList->getCount();
+ FileInfo fInfo;
+ fInfo.Column=0; fInfo.offset=fInfo.len=-1;
+ if (ret==cmYes)
+ {
+ br.selection=0;
+ // Add to the message window
+ for (i=0; i<c; i++)
+ {
+ char *s=GetNameLine(FunList,i,&fInfo.Line);
+ EdShowMessageFile(s,fInfo,fileName);
+ }
+ }
+ else
+ {
+ // Sort by line number
+ stItem *s=new stItem[c];
+ for (i=0; i<c; i++)
+ {
+ GetNameLine(FunList,i,&s[i].line);
+ s[i].index=i;
+ }
+ qsort(s,c,sizeof(stItem),cmpStItem);
+ br.selection=s[0].index;
+ // Add to the message window
+ for (i=0; i<c; i++)
+ {
+ char *name=GetNameLine(FunList,s[i].index,&fInfo.Line);
+ EdShowMessageFile(name,fInfo,fileName);
+ }
+ DeleteArray(s);
+ }
+ SpLinesUpdate();
+ EdJumpToMessage(0);
+ TProgram::deskTop->unlock();
+ }
+ }
+
+ int line;
+ GetNameLine(FunList,br.selection,&line);
+ delete FunList;
+
+ return line;
+}
+
+int CreateFunctionList(char *b, unsigned l, SOStack &stk,
+ TNoCaseSOSStringCollection *FunList, unsigned ops,
+ const char *shl)
+{
+ int funcs=SearchFuncs(b,l,FunList,&stk,modeBFFunctions | ops,shl);
+ return funcs==0;
+}
+
+static SOStack *stkBufun=0;
+static TNoCaseSOSStringCollection *lstBufun=0;
+static const char *FileName=0;
+static unsigned FileID=0, numFuncs;
+
+/**[txh]********************************************************************
+
+ Description:
+ Destroys a list of functions created with CreateFunctionList. You should
+call it if you are sure the user won't need the list again.
+@x{CreateFunctionList}.
+
+***************************************************************************/
+
+void DestroyFunctionList()
+{
+ CLY_destroy(lstBufun);
+ delete stkBufun;
+ DeleteArray(FileName);
+ lstBufun=0;
+ stkBufun=0;
+ FileName=0;
+ FileID=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a function list for this file. The information is hold internally
+and the file name is memorized. That's done so if you call it twice for the
+same file it won't create the list twice. In addition a number that changes
+each time the file is modified should be suplied. In this way the list will
+be computed if the file was changed. You must pass the pointer to the buffer
+containing the code and the length.@p
+ Is safe to call this function even when another list is cached because it
+won't leak memory, the old list will be destroyed.
+
+ Return:
+ The number of functions found.
+
+***************************************************************************/
+
+int CreateFunctionList(char *b, unsigned l, const char *fileName, unsigned ID,
+ const char *shl)
+{// Check if that's the one we have cached
+ if (stkBufun && FileName && strcmp(FileName,fileName)==0 && FileID==ID)
+ return numFuncs;
+ DestroyFunctionList();
+ stkBufun=new SOStack;
+ lstBufun=new TNoCaseSOSStringCollection(20,5,stkBufun);
+ FileName=newStr(fileName);
+ FileID=ID;
+ numFuncs=CreateFunctionList(b,l,*stkBufun,lstBufun,modeBFClassSep,shl);
+ return numFuncs;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs the name of the function that contains the provided line number.
+It uses the list created by CreateFunctionList, so you must call it before.
+@x{CreateFunctionList}.
+
+ Return:
+ !=0 => start, end and name were filled with the starting line of the
+function, end line and the name of the function. The pointer to the name
+of the function shouldn't be altered or released.
+
+***************************************************************************/
+
+int SearchFunctionByLine(int line, int &start, int &end, char *&name)
+{
+ if (!lstBufun) return 0;
+ int i,c=lstBufun->getCount(),len,lineS,lineE,*l;
+
+ // ToDo: a binary search, they are sorted!
+ for (i=0; i<c; i++)
+ {
+ char *s=lstBufun->atStr(i);
+ len=strlen(s)+1;
+ AlignLen(len);
+ l=(int *)(s+len);
+ lineS=l[0];
+ lineE=l[1];
+ if (lineE==-1)
+ {
+ if (i+1<c)
+ {
+ char *s=lstBufun->atStr(i+1);
+ len=strlen(s)+1;
+ AlignLen(len);
+ l=(int *)(s+len);
+ lineE=l[0]-1;
+ }
+ else
+ lineE=INT_MAX;
+ }
+ if (line>=lineS && line<lineE)
+ {
+ start=lineS; end=lineE; name=s;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+#else
+static void writeStr(void *p, void *)
+{
+ char *s=(char *)p;
+ int l=strlen(s)+1;
+ AlignLen(l);
+ printf("%s %d\n",s,*(int *)(s+l));
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc!=2)
+ return 1;
+ in=fopen(argv[1],"rb");
+
+ TStringCollection *FunList = new TStringCollection(20,5);
+
+ int funcs=SearchFuncs(FunList);
+
+ printf("\n\nLista ordenada de las funciones: (%d)\n\n",funs);
+ FunList->forEach(writeStr,NULL);
+ return 0;
+}
+#endif
diff --git a/setedit/mainsrc/ceditor.cc b/setedit/mainsrc/ceditor.cc
new file mode 100644
index 0000000..d45db50
--- /dev/null
+++ b/setedit/mainsrc/ceditor.cc
@@ -0,0 +1,14361 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ TCEditor class by SET.
+
+ E-Mail: salvador@inti.gov.ar or set@ieee.org or set@computer.org
+
+ Telephone: (+5411) 4759-0013
+
+ Postal Address:
+ Salvador E. Tropea
+ Curapaligue 2124
+ (1678) Caseros - 3 de Febrero
+ Prov: Buenos Aires
+ Argentina
+
+ Contributors:
+ Robert Hoehne (Robert.Hoehne@Mathematik.TU-Chemnitz.DE)
+ Marek Habersack (grendel@ananke.amu.edu.pl)
+ Molnar Laszlo (molnarl@postabank.hu)
+ And more ...
+
+*****************************************************************************/
+
+// That's the first include because is used to configure the editor.
+#include <ceditint.h>
+
+#define Uses_string
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_alloca
+#define Uses_ctype
+#define Uses_AllocLocal
+#define Uses_time
+#define Uses_fcntl
+#define Uses_sys_stat
+#define Uses_unistd
+#define Uses_regex
+#define Uses_utime
+#define Uses_filelength
+#define Uses_itoa
+#define Uses_getline
+#define Uses_access
+#define Uses_snprintf
+
+#define Uses_TKeys
+#define Uses_TFindCDialogRec
+#define Uses_TReplaceCDialogRec
+#define Uses_TReplaceDialogRec
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TMacroCollection
+#define Uses_TStringCollection
+#define Uses_MsgBox
+#define Uses_TGroup
+#define Uses_TPalette
+#define Uses_TCommandSet
+#define Uses_TFileDialog
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TGKey
+#define Uses_TColorCommands
+#define Uses_TSubMenu
+#define Uses_TMenuBox
+#define Uses_TStringableListBox
+#define Uses_TVOSClipboard
+#define Uses_TVCodePage
+#define Uses_TListBox
+
+#define Uses_TNoCaseStringCollection
+#define Uses_TCEditor
+#define Uses_LineLengthArray
+#define Uses_TFindCDialogRec
+#define Uses_TReplaceCDialogRec
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor_External
+#define Uses_TCEditor_Commands
+#define Uses_TStringable
+#define Uses_ProgBar
+#define Uses_TScreen
+#include <ceditor.h>
+#include <tv/tvconfig.h>
+#include <edhists.h>
+#include <slpinter.h>
+#include <bufun.h>
+#define Uses_TNLIndentCol
+#include <loadshl.h>
+#include <advice.h>
+#include <splinman.h>
+#include <completi.h>
+
+#include <setconst.h>
+
+#include <loadkbin.h>
+#include <sys/types.h>
+#define Uses_GZInterfaceOnly
+#include <gzfiles.h>
+#include <pathtool.h>
+#ifdef TVOSf_Linux
+#include <sys/time.h>
+#endif
+#include <rhutils.h>
+
+#ifdef STANDALONE
+// The code page support is only for the standalone version
+#include <codepage.h>
+#endif
+
+#define Uses_TKeyTranslate
+#include <keytrans.h>
+
+#define DEBUG
+
+#define flushLine() if (IslineInEdition) MakeEfectiveLineInEdition()
+#define flushLine2(a) if (a->IslineInEdition) a->MakeEfectiveLineInEdition()
+
+#define CheckScrollLockCenters ((TGKey::getShiftState() & kbScrollLockToggle) && (editorFlags & efScrollLock))
+
+static unsigned LineMeassureC(char *s, char *end, uint32 &Attr, uint32 *extra=0);
+static unsigned LineMeassurePascal(char *s, char *end, uint32 &Attr, uint32 *extra=0);
+static unsigned LineMeassureClipper(char *s, char *end, uint32 &Attr, uint32 *extra=0);
+static unsigned LineMeassureGeneric(char *s, char *end, uint32 &Attr, uint32 *extra=0);
+static void readBlock(TCEditor *editor);
+static void writeBlock(TCEditor *editor);
+static uint32 MakeItGranular( uint32 value );
+
+#define DecWithWrap(a,b) if (a) a--; else a=b-1
+#define IncWithWrap(a,b) a++; if (a==b) a=0
+
+#undef min
+inline uint32 min( uint32 u1, uint32 u2 )
+{
+ return u1 < u2 ? u1 : u2;
+}
+
+static int ClassInitialized=0;
+
+static
+void DeInitTCEditor(void)
+{
+ CLY_destroy(TCEditor::PMColl);
+#ifdef STANDALONE
+ DestroySHShortCutTables();
+#endif
+ TCEditor::FreeRegExMemory();
+ ClassInitialized=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It disables all the editor's commands. Just a few broadcasts and the
+global options remains. You must pass the a copy of the actual commands to
+the function, the routine will disable the commands and call the static
+member of TView to make it effective.
+
+***************************************************************************/
+
+static
+void DisableCommands(TCommandSet &cmdsAux)
+{
+ cmdsAux.disableCmd(cmbBaseNumber,cmbBaseNumber+cmbLastCommand);
+ // Let the broadcasts enabled
+ cmdsAux.enableCmd(cmcSetGlobalOptions);
+ cmdsAux.enableCmd(cmcColorsChanged); // Is really needed?
+ TView::setCommands(cmdsAux);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Intialize all the things needed by the class. The function is
+automagically called by the constructor if never was called but can be
+called by hand to force some things.@p
+ This function loads the pseudo macros file, creates the pseudo hash tables
+for the reserved words (if compiled STANDALONE) and disables all the editor
+commands.@p
+ The @var{s} argument is the name of the Pseudo Macros file and the
+@var{force} argument can be used to force the initialization.
+
+ Return: if all OK or the class is already initialized. 1 if the Pseudo
+macros couldn't be loaded.
+
+***************************************************************************/
+
+int InitTCEditor(char *s,Boolean force)
+{
+ int ret=0;
+
+ if (!ClassInitialized || force)
+ {
+ if (!TCEditor::PMColl)
+ TCEditor::PMColl=new TPMCollection(32,8);
+ if (LoadPseudoMacroFile(ExpandFileNameToThePointWhereTheProgramWasLoaded(s),*TCEditor::PMColl)==False)
+ ret|=1;
+ TView::getCommands(TCEditor::cmdsAux);
+ DisableCommands(TCEditor::cmdsAux);
+ #ifdef STANDALONE
+ CreateSHShortCutTables();
+ #endif
+
+ ClassInitialized=1;
+ atexit(DeInitTCEditor);
+ }
+
+ return ret;
+}
+
+
+/****************************************************************************
+
+ Function: TCEditor( const TRect& bounds,TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,TSIndicator *aIndicator,
+ uint32 aBufSize )
+
+ Type: TCEditor member.
+
+ Objetive: Constructor of the Class
+
+ Parameters:
+ TRect &bounds: Original size and location for the editor.
+ TScrollBar *aHScrollBar
+ TScrollBar *aVScrollBar
+ TIndicator *aIndicator: Pointers to objects for scroll bars & info.
+ uint32 aBufSize: Starting size of the editor buffer.
+
+ by SET
+
+****************************************************************************/
+
+TCEditor::TCEditor( const TRect& bounds,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ TSIndicator *aIndicator,
+ const char *aFileName,
+ Boolean openRO ) :
+ TViewPlus(bounds),
+ hScrollBar(aHScrollBar),
+ vScrollBar(aVScrollBar),
+ indicator(aIndicator),
+ bufSize(4050),
+ canUndo(True),
+ selecting(False),
+ overwrite(False),
+ NoNativeEOL(False),
+ IsaCompressedFile(gzNoCompressed),
+ lockCount(0),
+ updateFlags(0),
+ keyState(0),
+ bufEdit(0), // Not buffer allocated
+ bufEditLen(0), // zero length
+ GenericSHL(0),
+ CrossCurInCacheC(False),
+ CrossCurInCacheR(False),
+ IsStatusLineOn(False),
+ IsFoundOn(False),
+ IsHLCOn(False),
+ SpecialLines(NULL),
+ DiskTime(0)
+{
+ InitTCEditor("pmacros.pmc",False);
+ // Initialize the mode of edition
+ UseTabs=staticUseTabs; // Don't put Tabs, indent
+ autoIndent=staticAutoIndent;
+ indentSize=staticIndentSize;
+ intelIndent=staticIntelIndent;
+ tabSize=staticTabSize;
+ PersistentBlocks=staticPersistentBlocks;
+ CrossCursorInCol=staticCrossCursorInCol;
+ CrossCursorInRow=staticCrossCursorInRow;
+ ShowMatchPair=staticShowMatchPair;
+ ShowMatchPairFly=staticShowMatchPairFly;
+ ShowMatchPairNow=staticShowMatchPairNow;
+ TransparentSel=staticTransparentSel;
+ OptimalFill=staticOptimalFill;
+ WrapCol=staticWrapCol;
+ WrapLine=staticWrapLine;
+ SeeTabs=staticSeeTabs;
+ NoInsideTabs=staticNoInsideTabs;
+ TabIndents=staticTabIndents;
+ BackSpUnindents=staticBackSpUnindents;
+ UseIndentSize=staticUseIndentSize;
+ DontPurgeSpaces=staticDontPurgeSpaces;
+ ColumnMarkers=staticColumnMarkers;
+ colMarkers=CopyColMarkers(staticColMarkers);
+ forceNextTimeCheck=False;
+ isDisassemblerEditor=0;
+
+ CrossCursorY2=size.y;
+ CrossCursorX2=size.x;
+ CrossCursorCol=0;
+ CrossCursorRow=0;
+
+ isReadOnly=openRO;
+
+ /* TSIndicators uses a pointer to the editor, so link it */
+ if (indicator) // Some routines creates temporal editors without indicators
+ // or even scroll bars so we must check before accessing.
+ indicator->editor=this;
+
+ TurnOffHighLight();
+ LineMeassure=LineMeassureC;
+
+ growMode = gfGrowHiX | gfGrowHiY;
+ options |= ofSelectable;
+ eventMask = evMouseDown | evKeyDown | evCommand | evBroadcast;
+ showCursor();
+ initBuffer();
+ if (buffer)
+ isValid = True;
+ else
+ {
+ editorDialog(edOutOfMemory);
+ bufSize = 0;
+ isValid = False;
+ }
+ setBufLen(0);
+
+ CLY_GetDefaultFileAttr(&ModeOfFile);
+
+ // File part
+ if (aFileName==0)
+ {
+ fileName[0]=EOS;
+ SHLTransferDefaultsNewFile(*this);
+ FailedToLoad=False;
+ }
+ else
+ {
+ strcpy(fileName,aFileName);
+ if (isValid)
+ isValid=loadFile(True);
+ }
+}
+
+
+/****************************************************************************
+
+ Function: ~TCEditor()
+
+ Type: TCEditor member.
+
+ Objetive: Destructor of the Class.
+ Deletes the buffer used to edit a line.
+
+ doneBuffer deletes the editor buffer (? Called by ~TView).
+
+ by SET.
+
+****************************************************************************/
+
+TCEditor::~TCEditor()
+{
+ if (bufEdit)
+ free(bufEdit);
+ flushUndoInfo();
+ delete selRectClip;
+ delete[] colMarkers;
+}
+
+/****************************************************************************
+
+ Function: shutDown()
+
+ Type: TCEditor member.
+
+ Objetive: Just to shutdown the editor.
+
+****************************************************************************/
+
+void TCEditor::shutDown()
+{
+ doneBuffer();
+ TView::shutDown();
+}
+
+/****************************************************************************
+
+ Function: changeBounds( const TRect& bounds )
+
+ Type: TCEditor member.
+
+ Objetive: Adjust the delta in the text when the bounds of the window are
+ changed.
+
+ by SET
+
+****************************************************************************/
+
+void TCEditor::changeBounds( const TRect& bounds )
+{
+ setBounds(bounds);
+ delta.x = max(0, min(delta.x, limit.x - size.x));
+ delta.y = max(0, delta.y);
+ if (curPos.y>=delta.y+size.y)
+ delta.y=curPos.y-size.y+1;
+ if (curPos.y<delta.y)
+ delta.y=curPos.y;
+ update(ufView);
+}
+
+/****************************************************************************
+
+ Function: Boolean clipCopy()
+
+ Type: TCEditor member.
+
+ Objetive: Copy the selected text to the clipboard.
+
+ Returns: True if OK.
+
+****************************************************************************/
+
+Boolean TCEditor::clipCopy()
+{
+ Boolean res = False;
+ flushLine();
+ if ( (clipboard != 0) && (clipboard != this) )
+ {
+ res = clipboard->insertFrom(this);
+ selecting = False;
+ update(ufUpdate);
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Copies the selection to the OS clipboard. Originally designed to be used
+for Windows.
+
+ Return:
+ Boolean True if all was OK.
+
+***************************************************************************/
+
+Boolean TCEditor::clipWinCopy(int id)
+{
+ Boolean res=False;
+ if (hasSelection())
+ {
+ if (!TVOSClipboard::isAvailable())
+ {
+ messageBox(__("Sorry but no OS specific clipboard is available"),mfError | mfOKButton);
+ return False;
+ }
+ flushLine();
+ res=TVOSClipboard::copy(id,buffer+selStart,selEnd-selStart) ? True : False;
+ if (!res)
+ {
+ messageBox(mfError | mfOKButton,__("Error copying to clipboard: %s"),
+ TVOSClipboard::getError());
+ return False;
+ }
+ // id == 1 => "selection clipboard", in this case we don't want to stop the selection.
+ // I'm not sure if we really want to stop the selection in other cases, but that's the
+ // old behavior.
+ if (!id)
+ selecting=False;
+ }
+ return res;
+}
+
+/****************************************************************************
+
+ Function: void clipCut()
+
+ Type: TCEditor member.
+
+ Objetive: Cut the selected text to the clipboard.
+
+****************************************************************************/
+
+void TCEditor::clipCut()
+{
+ if (isReadOnly) return;
+ flushLine();
+ if (clipCopy())
+ deleteSelect();
+}
+
+/****************************************************************************
+
+ Function: void clipPaste()
+
+ Type: TCEditor member.
+
+ Objetive: Paste from the clipboard.
+
+ Modified to avoid insertions at the limit of the line capability.
+
+****************************************************************************/
+
+void TCEditor::clipPaste()
+{
+ if (isReadOnly) return;
+ flushLine();
+ if ( (clipboard != 0) && (clipboard != this) && curPos.x<(MaxLineLen-1))
+ insertFrom(clipboard);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Pastes the Windows clipboard in the editor. If not persistent deletes
+the selection. The pasted text is selected only if persistent blocks are
+enabled. This behavior is what a windows user spect and was modified by
+suggestion of Anatoli Soltan (Win32 porter).
+
+***************************************************************************/
+
+void TCEditor::clipWinPaste(int id)
+{
+ if (isReadOnly)
+ return;
+ if (!TVOSClipboard::isAvailable())
+ {
+ messageBox(__("Sorry but no OS specific clipboard is available"),mfError | mfOKButton);
+ return;
+ }
+ flushLine();
+ if (curPos.x<(MaxLineLen-1))
+ {
+ unsigned size;
+ char *p=TVOSClipboard::paste(id,size);
+ if (p)
+ {
+ if (!PersistentBlocks && hasSelection())
+ { // Save the selected text in the windows clipboard
+ // That isn't what a windows user spect so I disabled it
+ //if (!WINOLDAP_SetClipboard(buffer+selStart,selEnd-selStart))
+ // return;
+ deleteSelect();
+ }
+ insertBuffer(p,0,size,canUndo,PersistentBlocks,False);
+ DeleteArray(p);
+ trackCursor(False);
+ }
+ else
+ messageBox(mfError | mfOKButton,__("Error pasting from clipboard: %s"),
+ TVOSClipboard::getError());
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Copies the selected text into a special file used as clipboard. Specially
+useful when the OS lacks a robust clipboard mechanism.
+
+***************************************************************************/
+
+Boolean TCEditor::clipFileCopy()
+{
+ Boolean res=False;
+ if (hasVisibleSelection())
+ {
+ flushLine();
+ char *name=ExpandHomeSave("clipboard");
+ if (name)
+ {
+ FILE *f=fopen(name,"wb");
+ if (f)
+ {
+ if (fwrite(buffer+selStart,selEnd-selStart,1,f)!=1)
+ editorDialog(edWriteError,name,NULL);
+ else
+ res=True;
+ fclose(f);
+ }
+ else
+ editorDialog(edCreateError,name);
+ }
+ selecting=False;
+ }
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Pastes text from a special file used as clipboard. Specially useful when
+the OS lacks a robust clipboard mechanism.
+
+***************************************************************************/
+
+void TCEditor::clipFilePaste()
+{
+ if (isReadOnly)
+ return;
+ flushLine();
+ if (curPos.x<(MaxLineLen-1))
+ {
+ char *name=ExpandHomeSave("clipboard");
+ if (edTestForFile(name))
+ {
+ FILE *f=fopen(name,"rb");
+ if (f)
+ {
+ long fsize=filelength(fileno(f));
+ char *p=new char[fsize];
+ if (fread(p,fsize,1,f)==1)
+ {
+ if (!PersistentBlocks && hasSelection())
+ deleteSelect();
+ insertBuffer(p,0,fsize,canUndo,PersistentBlocks,False);
+ delete[] p;
+ }
+ else
+ editorDialog(edReadError,name,NULL);
+ }
+ else
+ editorDialog(edReadError,name,NULL);
+ }
+ }
+}
+
+/****************************************************************************
+
+ Function: Boolean clipReplace()
+
+ Type: TCEditor member.
+
+ Objetive: Cut to clipboard and paste from clipboard.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::clipReplace()
+{
+ if (isReadOnly) return False;
+ flushLine();
+ if ((clipboard!=0) && (clipboard!=this))
+ {
+ if (clipboard->insertBuffer(buffer,selStart,selEnd-selStart,False,False,True))
+ {
+ deleteSelect();
+ return insertFrom(clipboard);
+ }
+ }
+ return False;
+}
+
+
+
+/****************************************************************************
+
+ Function: void convertEvent( TEvent& event )
+
+ Type: TCEditor member.
+
+ Objetive: Translate a key convination to a command.
+
+ Parameters:
+ TEvent& event: The event.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::convertEvent( TEvent& /*event*/ )
+{
+}
+
+/****************************************************************************
+
+ Function: Boolean cursorVisible()
+
+ Type: TCEditor member.
+
+ Objetive: Make visible the cursor.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+Boolean TCEditor::cursorVisible()
+{
+ return ((curPos.y >= delta.y) && (curPos.y < delta.y + size.y)) ? True : False;
+}
+
+
+/****************************************************************************
+
+ Function: void deleteRange( uint32 startPtr,uint32 endPtr,
+ Boolean delSelect )
+
+ Type: TCEditor member.
+
+ Objetive: Delete the piece of text from startPtr to endPtr or the selected
+ text.
+
+ Parameters:
+ startPtr endPtr: Range to delete.
+ delSelect: If True and there is a selection deletes the selected text.
+
+ This function is only for compatibility
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::deleteRange( uint32 startPtr,
+ uint32 endPtr,
+ Boolean delSelect
+ )
+{
+ if ( hasSelection() && delSelect )
+ deleteSelect();
+ else
+ deleteRange(buffer+startPtr,buffer+endPtr);
+}
+
+
+/****************************************************************************
+
+ Function: void deleteSelect()
+
+ Type: TCEditor member.
+
+ Objetive: Delete the selected text.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::deleteSelect()
+{
+ if (hasSelection())
+ deleteRange(buffer+selStart,buffer+selEnd);
+}
+
+
+/****************************************************************************
+
+ Function: void doneBuffer()
+
+ Type: TCEditor member.
+
+ Objetive: Delete the editor buffer.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+void TCEditor::doneBuffer()
+{
+ free(buffer);
+}
+
+/**[txh]********************************************************************
+
+ Description: Make a Search or Replace in the text.
+
+***************************************************************************/
+
+Boolean TCEditor::doSearchReplace()
+{
+ int i;
+ int oldPromptOnReplace=editorFlags & efPromptOnReplace;
+ Boolean ret=False, needsUnlock=True;
+
+ if (SearchInSel && !hasVisibleSelection())
+ {
+ editorDialog(edSearchAndNoSel);
+ return False;
+ }
+
+ lock();
+ do
+ {
+ i=cmCancel;
+ if (!search(findStr,editorFlags))
+ {
+ needsUnlock=False;
+ unlock();
+ if (!(editorFlags & efNoFindFailMsg) &&
+ (editorFlags & (efReplaceAll | efDoReplace))!=(efReplaceAll | efDoReplace))
+ editorDialog(edSearchFailed);
+ ret=False;
+ }
+ else
+ {
+ if (editorFlags & efDoReplace)
+ {
+ i=cmYes;
+ if (editorFlags & efPromptOnReplace)
+ {
+ unlock();
+ TPoint c=makeGlobal(cursor);
+ i=editorDialog(edReplacePrompt,&c);
+ lock();
+ }
+ if (i==cmOK)
+ { // Used to signal ALL
+ i=cmYes;
+ editorFlags&=~efPromptOnReplace;
+ }
+ if (i==cmYes)
+ {
+ lockUndo();
+ int mustDelete;
+ uint32 l;
+ char *repl=GetTheReplace(mustDelete,l);
+ // The delete MUST be after retreiving the match
+ deleteRange(buffer+selStartF,buffer+selEndF);
+ if (repl)
+ {
+ insertText(repl,l,False);
+ if (mustDelete)
+ delete repl;
+ }
+ trackCursor(False);
+ StartOfSearch=selStartF+l;
+ unlockUndo();
+ ret=True;
+ }
+ else
+ StartOfSearch=selEndF;
+ }
+ else
+ ret=True;
+ }
+ }
+ while(i!=cmCancel && (editorFlags & efReplaceAll)!=0);
+
+ if (needsUnlock)
+ unlock();
+ // Restore it in case the ALL changed the value
+ editorFlags|=oldPromptOnReplace;
+ return ret;
+}
+
+/****************************************************************************
+
+ Function: int TestPropagation(uint32 OldAttr,uin16 NewAttr,
+ char *proxLine, uint32 proxLineNum)
+
+ Type: TCEditor member.
+
+ Objetive: Check if the changes made in a line affects the next lines and
+ if is the case update all the affected lines.
+ This function updates the syntax highlight flags, for example if you
+ start a comment in a line this produce a propagation.
+
+ Parameters:
+ OldAttr: Old syntax flags for this line.
+ NewAttr: New syntax flags for this line.
+ proxLine: a pointer to the next line.
+ proxLineNum: the number of the next line.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::TestPropagation(uint32 OldAttr,uint32 NewAttr,
+ char *proxLine, uint32 proxLineNum)
+{
+ uint32 PrevAttr;
+
+ CacheSyntaxHLData(GenericSHL);
+
+ if ((OldAttr & FilterProp)!=(NewAttr & FilterProp))
+ { // The changes afects the rest of the file
+ PrevAttr=NewAttr;
+ do
+ {
+ if (proxLineNum>totalLines)
+ break;
+ OldAttr=lenLines.getAttr(proxLineNum);
+ proxLine+=LineMeassure(proxLine,proxLine+lenLines[proxLineNum],PrevAttr,NULL);
+ lenLines.setAttr(proxLineNum,PrevAttr);
+ proxLineNum++;
+ }
+ while (OldAttr!=PrevAttr && (unsigned)(proxLine-buffer)<bufLen);
+ return 1;
+ }
+ return 0;
+}
+
+/****************************************************************************
+
+ Function: void doUpdate()
+
+ Type: TCEditor member.
+
+ Objetive: Update the screen according to updateFlags.
+
+ by SET.
+
+ ToDo:
+ 1st step) Avoid a constant LineMeassure, call it only when a special key
+ is pressed or when some special thing is deleted.
+ 2nd step) ? Never call to LineMeassure, keep track of the syntax at
+ cursor position.
+
+****************************************************************************/
+
+void TCEditor::doUpdate()
+{
+ CacheSyntaxHLData(GenericSHL);
+ if (updateFlags) // Only if needed
+ {
+ // moves the hardware cursor
+ setCursor(curPos.x-delta.x,curPos.y-delta.y);
+
+ // Repair the highligthed position
+ if (IsHLCOn)
+ {
+ if (updateFlags & (ufLine | ufFound | ufStatus | ufHLChar | ufClHLCh))
+ {
+ int y=YHLCc-delta.y;
+ int x=XHLCc-delta.x;
+ if (x>=0 && x<size.x && y>=0 && y<size.y)
+ setAttrOfCoor(x,y,OldHLAttr);
+ y=YHLCo-delta.y;
+ x=XHLCo-delta.x;
+ if (x>=0 && x<size.x && y>=0 && y<size.y)
+ setAttrOfCoor(x,y,OldHLAttro);
+ IsHLCOn=False;
+ }
+ else if (updateFlags & ufView) // It cleans the situation
+ IsHLCOn=False;
+ }
+
+ unsigned selAuxE=0,selAuxS=0;
+ Boolean oldSelHided=selHided;
+
+ // Used for a temporal select when the search was OK.
+ if (updateFlags & ufFound)
+ { // Put the selection of the found
+ selAuxE=selEnd;
+ selAuxS=selStart;
+ selEnd=selEndF;
+ selStart=selStartF;
+ selHided=False;
+ IsFoundOn=True;
+ }
+ else
+ {
+ if (IsFoundOn)
+ { // Put away the fake select
+ updateFlags|=ufView;
+ IsFoundOn=False;
+ }
+ }
+
+ if (IsStatusLineOn)
+ {
+ if (!(updateFlags & ufView))
+ {// Repair the damage of the status line
+ int y=delta.y;
+ unsigned p=drawPtr;
+ if (StatusLinePos)
+ {
+ int i=size.y-1;
+ for (;i; y++, --i)
+ p+=lenLines.safeLen(y);
+ }
+ drawLines(y,1,p);
+ }
+ // In any case it isn't there anymore
+ IsStatusLineOn=False;
+ }
+
+ if (updateFlags & ufView)
+ {
+ if (IslineInEdition && (updateFlags & ufLine))
+ { // When we type in the last column the editor forces a full draw and we must
+ // test for propagation even when isn't an ufLine alone.
+ uint32 attr;
+ if (curPos.y)
+ attr=lenLines.getAttr(curPos.y-1);
+ else
+ attr=0;
+ LineMeassure(bufEdit,inEditPtr+restCharsInLine,attr,NULL);
+ TestPropagation(attrInEdit,attr,curLinePtr+lenLines[curPos.y],curPos.y+1);
+ attrInEdit=attr;
+ }
+ drawView(); // All the window
+ }
+ else
+ if (updateFlags & ufLine)
+ {
+ if (IslineInEdition)
+ { // The following is a test and can be optimized a lot
+ uint32 attr;
+ if (curPos.y)
+ attr=lenLines.getAttr(curPos.y-1);
+ else
+ attr=0;
+ LineMeassure(bufEdit,inEditPtr+restCharsInLine,attr,NULL);
+ if (TestPropagation(attrInEdit,attr,curLinePtr+lenLines[curPos.y],curPos.y+1))
+ {
+ attrInEdit=attr;
+ drawView();
+ updateFlags|=ufView;
+ }
+ else
+ {
+ attrInEdit=attr;
+ drawLines( curPos.y, 1, (uint32)(curLinePtr-buffer) );
+ }
+ }
+ else
+ drawLines( curPos.y, 1, (uint32)(curLinePtr-buffer) ); // only this line
+ }
+
+ // For the find & replace
+ if (updateFlags & ufFound)
+ { // Let OK the select
+ selEnd=selAuxE;
+ selStart=selAuxS;
+ selHided=oldSelHided;
+ }
+
+ if (CrossCursorInCol || CrossCursorInRow)
+ updateCrossCur();
+
+ // The status line
+ if (updateFlags & ufStatus)
+ { // Put it and record the state
+ if (curPos.y==delta.y+size.y-1)
+ {
+ StatusLinePos=0;
+ writeLine(0,0,size.x,1,StatusLine);
+ }
+ else
+ {
+ StatusLinePos=1;
+ writeLine(0,size.y-1,size.x,1,StatusLine);
+ }
+ IsStatusLineOn=True;
+ }
+
+ if (updateFlags & ufHLChar)
+ {
+ int y=YHLCC-delta.y;
+ int x=XHLCC-delta.x;
+ char c=getColor(cMPHighL);
+ IsHLCOn=True;
+ getAttrsOfCol(x,y,y,&OldHLAttr);
+ setAttrOfCoor(x,y,c);
+ y=YHLCO-delta.y;
+ x=XHLCO-delta.x;
+ getAttrsOfCol(x,y,y,&OldHLAttro);
+ setAttrOfCoor(x,y,c);
+ YHLCc=YHLCC; XHLCc=XHLCC;
+ YHLCo=YHLCO; XHLCo=XHLCO;
+ }
+
+ // rest of the things
+ if ( hScrollBar != 0 )
+ hScrollBar->setParams(delta.x, 0, limit.x - size.x, size.x / 2, 1);
+ if ( vScrollBar != 0 )
+ vScrollBar->setParams(delta.y, 0, limit.y, size.y - 1, 1); // - size.y cutted
+ if (indicator)
+ indicator->drawView();
+ if ( (state & sfActive) != 0 )
+ updateCommands();
+ updateFlags = 0;
+ }
+}
+
+/****************************************************************************
+
+ Function: void updateCrossCur(void)
+
+ Type: TCEditor member.
+
+ Objetive: Update the extended cursor (column, row or cross).
+
+ The basic routine is very simple, the actual routine is a little
+ complicated because is optimized to allow some redraws.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::updateCrossCur(void)
+{
+ int i;
+ int xAnt=CrossCursorCol;
+ int xAct=curPos.x-delta.x;
+ int yAnt=CrossCursorRow;
+ int yAct=curPos.y-delta.y;
+ int updateCol=1;
+ int updateRow=1;
+ char color=getColor(cCrossCur);
+
+ // Erase the old Col-cursor
+ if (CrossCursorInCol && CrossCursorCol>=0 && CrossCursorCol<size.x)
+ {
+ if (updateFlags & ufView)
+ // If the editor was redrawed there is no need to do this
+ CrossCursorY2=size.y;
+ else
+ {
+ if (CrossCurInCacheC)
+ { // Only if we have the info in the cache
+ if (xAnt!=xAct)
+ { // If the col was changed make a full erase
+ if (updateFlags & ufLine)
+ {
+ // if the line was redrawed don't touch it
+ for (i=0; i<CrossCursorY2; i++)
+ if (i!=yAct)
+ setAttrOfCoor(CrossCursorCol,i,CrossCursorBuf[i]);
+ }
+ else
+ {
+ // full column erase
+ for (i=0; i<CrossCursorY2; i++)
+ setAttrOfCoor(CrossCursorCol,i,CrossCursorBuf[i]);
+ }
+ }
+ else
+ {
+ // erase only the last row, but only if the line is unmodified
+ if (!(updateFlags & ufLine))
+ setAttrOfCoor(xAct,yAct,CrossCursorBuf[yAct]);
+ updateCol=0;
+ }
+ }
+ else
+ CrossCursorY2=size.y;
+ }
+ }
+
+ // Erase the old Row-cursor
+ if (CrossCursorInRow && CrossCursorRow>=0 && CrossCursorRow<size.y)
+ {
+ if (updateFlags & (ufView | ufLine))
+ // If the editor was redrawed there is no need to do this
+ CrossCursorX2=size.x;
+ else
+ {
+ if (CrossCurInCacheR)
+ { // Only if we have the info in the cache
+ if (yAnt!=yAct)
+ { // If the row was changed make a full erase
+ for (i=0; i<CrossCursorX2; i++)
+ setAttrOfCoor(i,CrossCursorRow,CrossCursorBufR[i]);
+ }
+ else
+ {
+ // erase only the last col, but only if the value changed
+ if (xAct!=xAnt)
+ setAttrOfCoor(xAct,yAct,CrossCursorBufR[xAct]);
+ updateRow=0;
+ }
+ }
+ else
+ CrossCursorX2=size.x;
+ }
+ }
+
+ CrossCursorCol=xAct;
+ CrossCursorRow=yAct;
+
+ // Draw the new Col-cursor
+ if (CrossCursorInCol && CrossCursorCol>=0 && CrossCursorCol<size.x)
+ {
+ int i;
+
+ if (updateCol)
+ {
+ // If a full erase was done make a full draw
+ // First try to copy all in the cache
+ if (getAttrsOfCol(CrossCursorCol,0,CrossCursorY2,CrossCursorBuf))
+ CrossCurInCacheC=False;
+ else
+ {
+ // If all is in the cache draw the col, but not where the cursor is
+ for (i=0; i<CrossCursorY2; i++)
+ if (i!=CrossCursorRow)
+ setAttrOfCoor(CrossCursorCol,i,color);
+ CrossCurInCacheC=True;
+ }
+ }
+ else
+ {
+ // If only one character was erased draw only one
+ if (getAttrsOfCol(CrossCursorCol,yAnt,yAnt,&CrossCursorBuf[yAnt]))
+ CrossCurInCacheC=False;
+ else
+ {
+ if (yAnt!=yAct)
+ setAttrOfCoor(CrossCursorCol,yAnt,color);
+ CrossCurInCacheC=True;
+ }
+ }
+ }
+
+ // Draw the new Row-cursor
+ if (CrossCursorInRow && CrossCursorRow>=0 && CrossCursorRow<size.y)
+ {
+ int i;
+
+ if (updateRow)
+ {
+ if (getAttrsOfRow(0,CrossCursorX2,CrossCursorRow,CrossCursorBufR))
+ CrossCurInCacheR=False;
+ else
+ {
+ for (i=0; i<CrossCursorX2; i++)
+ if (i!=CrossCursorCol)
+ setAttrOfCoor(i,CrossCursorRow,color);
+ CrossCurInCacheR=True;
+ }
+ }
+ else
+ {
+ if (getAttrsOfRow(xAnt,xAnt,CrossCursorRow,&CrossCursorBufR[xAnt]))
+ CrossCurInCacheR=False;
+ else
+ {
+ setAttrOfCoor(xAnt,CrossCursorRow,color);
+ CrossCurInCacheR=True;
+ }
+ }
+ }
+}
+
+/****************************************************************************
+
+ Function: void draw()
+
+ Type: TCEditor member.
+
+ Objetive: Update the content of the window (the text, not the rest).
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::draw()
+{
+ AdjustDrawPtr();
+ drawLines( drawLine, size.y, drawPtr );
+}
+
+/****************************************************************************
+
+ Function: void AdjustDrawPtr(void)
+
+ Type: TCEditor member.
+
+ Objetive: Update the current pointer for drawing.
+ The drawPtr pointer keeps track of the position that correspond to the
+ drawLine variable, this variable is the first line drawed by drawLine by
+ draw. This value is adjusted each time the delta.Y is modified in the
+ window. The calculus is made based on the assumption that the actual
+ values: drawLine and drawPtr are OK, some routines can modify the buffer
+ invalidating this pair of values, under such situations is necesary to
+ make these two values coherents, a method is make the both 0, but then
+ this routine must spend more time to recalculate the actual values,
+ another way is move these values to a point that will not be modified in
+ the routine. To see an example see UnIndentBlock.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::AdjustDrawPtr(void)
+{
+ unsigned deltaY=delta.y;
+
+ if ( drawLine!=deltaY )
+ {
+ // Adjust the pointer drawPtr
+ if (drawLine>deltaY)
+ for (;drawLine>deltaY; drawLine--)
+ drawPtr-=lenLines.safeLen(drawLine-1);
+ else
+ for (;drawLine<deltaY; drawLine++)
+ drawPtr+=lenLines.safeLen(drawLine);
+ }
+}
+
+
+/****************************************************************************
+
+ Function: uint32 LenWithoutCRLF(uint32 y, char *cl)
+
+ Type: TCEditor member.
+
+ Objetive: Compute the length of a line, but excluding the '\r','\n' at the
+ end of the line.
+
+ 14/05/97 Mod. to support only '\n' by Robert.
+
+ by SET.
+
+****************************************************************************/
+
+uint32 TCEditor::LenWithoutCRLF(uint32 y, char *cl)
+{
+ unsigned len=lenLines.safeLen(y);
+ /* Remove at first LF */
+ if (len>0 && cl[len-1]=='\n') len--;
+ /* and now CR on DOS-files */
+ if (len>0 && cl[len-1]=='\r') len--;
+
+ return len;
+}
+
+/****************************************************************************
+
+ Function: void drawLines( int y, int count, uint32 linePtr )
+
+ Type: TCEditor member.
+
+ Objetive: Draw some lines in the screen.
+
+ Parameters:
+ y: pos in the file (not the window)
+ count: number of lines to draw
+ linePtr: offset of the start of the line in the buffer
+
+ by SET.
+
+ ToDo:
+ If necesary a best patch for the draw of the line in edition.
+
+****************************************************************************/
+
+void TCEditor::drawLines( int y, int count, uint32 linePtr )
+{
+ uint16 color = getColor(0x0201);
+ unsigned yInFile=y;
+ Boolean FirstEmpty=True;
+ y-=delta.y;
+ unsigned width=delta.x+size.x;
+ int IsPostRectOn=0; // Indicates that there is no need to paint the rect
+ char *bc; // Alias to access to the buffer with chars
+ int OffXr1=0,OffXr2=0,Off;
+ char ColRect=0;
+
+ if (!colorsCached)
+ {
+ CacheColors();
+ colorsCached=1;
+ }
+ CacheSyntaxHLData(GenericSHL);
+
+ // Set IsPostRectOn only if really needed
+ if (hasRectSel())
+ {
+ if (Xr1<(int)width && Xr2>=delta.x && Yr1<delta.y+size.y && Yr2>=delta.y)
+ {
+ IsPostRectOn=1;
+ OffXr1=(Xr1<<1)+1;
+ OffXr2=((min(Xr2-1,(int)width))<<1)+1;
+ ColRect=getColor(cRectSel);
+ }
+ }
+
+ // temporal buffer, ever 1 more than the width to avoid problems
+ ushort *b=(ushort *)alloca((width+tabSize+16+1)<<1);
+ //ushort b[maxLineLenBuff]; Old fix-length version.
+ if (b==NULL) abort();
+ bc=(char *)b;
+
+ while ( count-- > 0 )
+ {
+ if (yInFile<=totalLines)
+ {
+ if (IslineInEdition && yInFile==(unsigned)curPos.y)
+ {
+ char *bb=buffer;
+ unsigned s=selStart,e=selEnd;
+ unsigned bs=bufLen;
+ bufLen=delta.x+size.x;
+ selStart=selLineStart;
+ selEnd=selLineEnd;
+ buffer=bufEdit;
+ (this->*formatLinePtr)(b,0,width,color,(unsigned)(inEditPtr+restCharsInLine-bufEdit),
+ attrInEdit,yInFile,ColumnMarkers ? colMarkers : 0);
+ buffer=bb;
+ selEnd=e;
+ selStart=s;
+ bufLen=bs;
+ }
+ else
+ (this->*formatLinePtr)(b,linePtr,width,color,
+ LenWithoutCRLF(yInFile,buffer+linePtr),
+ lenLines.getAttr(yInFile),yInFile,
+ ColumnMarkers ? colMarkers : 0);
+
+ if (IsPostRectOn)
+ {
+ if (yInFile>=(unsigned)Yr1 && yInFile<=(unsigned)Yr2)
+ for (Off=OffXr1; Off<=OffXr2; Off+=2)
+ bc[Off]=ColRect;
+ }
+
+ {/* Paint breakpoint and CPU lines. */
+ int i,off,j, cnt;
+ if (SpecialLines)
+ {
+ cnt=SpecialLines->getCount();
+ for (i=0; i<cnt; i++)
+ {
+ stSpLine *p=SpecialLines->At(i);
+ if (p->nline==(int)yInFile)
+ {
+ int color=0;
+ if (p->id==idsplBreak)
+ color=getColor(cBreak) & 0xF0;
+ else if (p->id==idsplRunLine)
+ color=getColor(cCPU) & 0xF0;
+ if (color)
+ {
+ int colAvoid=color>>4, colFg;
+
+ for (off=delta.x, j=size.x; j; off++,j--)
+ {
+ colFg=bc[off*2+1] & 0xF;
+ if (colFg==colAvoid)
+ colFg=(colFg+1) & 0xF;
+ bc[off*2+1]=colFg | color;
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ writeLine(0,y, size.x, 1, &b[delta.x]);
+ // Adjust the pointer linePtr
+ linePtr = linePtr+lenLines[yInFile++];
+ }
+ else
+ { // Empty lines
+ if (FirstEmpty)
+ { // If is the first make the empty line
+ FirstEmpty=False;
+ ushort Val;
+ ((char *)&Val)[0]=0x20;
+ ((char *)&Val)[1]=color;
+ for (int i=size.x; i;)
+ b[--i]=Val;
+ }
+ writeLine(0,y, size.x, 1, b);
+ yInFile++;
+ }
+ y++;
+ }
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Puts text in the status line removing tabs and stoping in \r or \n. The
+buffer is altered. The string must be ASCIIZ.
+
+***************************************************************************/
+
+void TCEditor::setStatusLine(char *s)
+{
+ int l;
+ for (l=0; s[l] && s[l]!='\n' && s[l]!='\r'; l++)
+ {
+ if (s[l]=='\t')
+ s[l]=' ';
+ }
+ char color=getColor(cStatusLi);
+
+ if (l>=setMaxScreenX)
+ l=setMaxScreenX-1;
+
+ int fill=setMaxScreenX-1-l;
+ char *b=StatusLine;
+
+ while (l--)
+ {
+ *(b++)=*(s++);
+ *(b++)=color;
+ }
+
+ while (fill--)
+ {
+ *(b++)=' ';
+ *(b++)=color;
+ }
+
+ update(ufStatus);
+}
+
+
+static unsigned PipeOrigin;
+static char *PipeBuf;
+static unsigned PipeBufLen;
+
+int PipeTCEditor(unsigned PosRel)
+{
+ if (PosRel+PipeOrigin<PipeBufLen)
+ return PipeBuf[PosRel+PipeOrigin];
+ return -1;
+}
+
+/**[txh]********************************************************************
+
+ Description: Make the dialog and search in the text.
+
+***************************************************************************/
+
+void TCEditor::find()
+{
+ char *Word;
+
+ if ((Word=WordUnderCursor(80))!=NULL)
+ {
+ strcpy(findStr,Word);
+ delete[] Word;
+ }
+
+ editorFlags&=~efOptimizedRegex;
+ TFindCDialogRec findRec(findStr,editorFlags,SearchInSel,FromWhere);
+ TRegexDialogRec regexRec;
+ regexRecCreate(regexRec);
+
+ if (editorDialog(edFind,&findRec,&regexRec)!=cmCancel)
+ {
+ regexRecUpdate(regexRec);
+ strcpy(findStr,findRec.find);
+ editorFlags=findRec.options & ~efDoReplace;
+ SearchInSel=findRec.in_sel;
+ FromWhere=findRec.from;
+ if (findRec.direction)
+ editorFlags|=efSearchBack;
+ else
+ editorFlags&=~efSearchBack;
+ if (FromWhere)
+ StartOfSearch=editorFlags & efSearchBack ? bufLen-1 : 0; // All
+ else
+ StartOfSearch=(unsigned)(ColToPointer()-buffer);
+ if (CompileSearch(findStr))
+ return;
+ doSearchReplace();
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets the word under the cursor position. You must specify the maximun
+length of the returned string.@p
+ The routine supports the pipe feature to connect the word with an input
+line object.
+
+ Return:
+ A pointer to the string (a new allocated one) or NULL if the cursor isn't
+over a word.
+
+***************************************************************************/
+
+
+char *TCEditor::WordUnderCursor(uint32 maxLength, unsigned options)
+{
+ char *word,*aux;
+ char *wordStart,*wordEnd,*i;
+ unsigned l;
+
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+
+ char *s=ColToPointer();
+ char *end=buffer+bufLen;
+
+ // Set-Up the pipe
+ PipeOrigin=(unsigned)(s-buffer);
+ PipeBuf=buffer;
+ PipeBufLen=bufLen;
+
+ if (options & wucCanStartColon)
+ {
+ if (!isWordCharColon(*s))
+ {
+ if ((options & wucTakeOneLeft) && s>buffer)
+ s--;
+ if (!isWordCharColon(*s))
+ return NULL;
+ }
+ }
+ else
+ {
+ if (!isWordChar(*s))
+ {
+ if ((options & wucTakeOneLeft) && s>buffer)
+ s--;
+ if (!isWordChar(*s))
+ return NULL;
+ }
+ }
+
+ if (options & wucIncludeColon)
+ { // For C++ members
+ wordStart=s;
+ while (--wordStart>buffer && isWordCharColon(*wordStart));
+ if (wordStart!=buffer || !isWordCharColon(*wordStart))
+ wordStart++;
+
+ wordEnd=s;
+ while (wordEnd<end && isWordCharColon(*wordEnd)) wordEnd++;
+ }
+ else
+ {
+ wordStart = s;
+ while (--wordStart>buffer && isWordChar(*wordStart));
+ if (wordStart!=buffer || !isWordChar(*wordStart))
+ wordStart++;
+
+ wordEnd=s;
+ while (wordEnd<end && isWordChar(*wordEnd)) wordEnd++;
+ }
+
+ // Adjust the pipe
+ PipeOrigin=(unsigned)(wordStart-buffer);
+
+ l=(unsigned)(wordEnd-wordStart+1);
+ if (l>maxLength)
+ return NULL;
+ word=new char[l];
+
+ for (i=wordStart,aux=word; i<wordEnd; i++)
+ *aux++ = *i;
+ *aux=0;
+
+ return word;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Select the word under cursor.
+
+***************************************************************************/
+
+void TCEditor::SelWordUnderCursor(void)
+{
+ char *p=ColToPointer();
+ char *end=buffer+bufLen;
+
+ if (isWordChar(*p))
+ {
+ // Walk backward to the start of a word
+ for (;p>buffer && isWordChar(*p); --p);
+ if (p!=buffer) p++;
+ }
+ else
+ {
+ if (0) // This is the original code. It ever takes the next word.
+ {
+ // if isn't in a word walk forward
+ for (;p<end && !isWordChar(*p); ++p);
+ if (!isWordChar(*p))
+ return;
+ }
+ else
+ { // This code tries to be a little bit smarter and takes the closest word.
+ unsigned distF, distB;
+ char *forward=p, *back=p;
+ // Search forward
+ for (;forward<end && !isWordChar(*forward); ++forward);
+ if (isWordChar(*forward))
+ distF=forward-p;
+ else
+ distF=bufLen+1;
+ // Search backward
+ for (;back>buffer && !isWordChar(*back); --back);
+ if (isWordChar(*back))
+ distB=p-back;
+ else
+ distB=bufLen+1;
+ for (;back>buffer && isWordChar(*back); --back);
+ if (back!=buffer) back++;
+ // Take one
+ if (distF==distB && distF==bufLen+1)
+ return;
+ if (distF<=distB)
+ p=forward;
+ else
+ p=back;
+ }
+ }
+ selStartOffSet=selStart=(uint32)(p-buffer);
+ // Now forward to the end
+ for (;p<end && isWordChar(*p); ++p);
+ selEnd=(uint32)(p-buffer);
+}
+
+/****************************************************************************
+
+ Function: void MoveToMouse( TPoint m, uchar selMode )
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor to the position pointed by the mouse updating
+ the selection if necesary.
+ Handle the double click to select the word under cursor.
+
+ Parameter:
+ TPoint m: The point where the mouse is.
+ uchar selMode: The flags for the selection mode.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::MoveToMouse( TPoint m, uchar selMode )
+{
+ TPoint mouse = makeLocal( m );
+ mouse.x = max(0, min(mouse.x, size.x - 1));
+ mouse.y = max(0, min(mouse.y, size.y - 1));
+
+ MoveCursorTo(mouse.x+delta.x,mouse.y+delta.y);
+ if (selMode & smDontSel)
+ {
+ update(ufUpdate);
+ return;
+ }
+ if (selMode & smExtend)
+ { // Extends the selection
+ unsigned selAux=(unsigned)(ColToPointer()-buffer); // To where?
+ if (selAux>bufLen)
+ selAux=bufLen;
+ if (selAux>selStartOffSet)
+ {
+ selEnd=selAux;
+ selStart=selStartOffSet;
+ }
+ else
+ {
+ selEnd=selStartOffSet;
+ selStart=selAux;
+ }
+ }
+ else
+ { // Starts a selection
+ if (selMode & smDouble)
+ { // Select the word under cursor or the nearest
+ SelWordUnderCursor();
+ }
+ else
+ {
+ int dif;
+ selStart=(uint32)(ColToPointer(dif)-buffer);
+ if (dif>0)
+ selStart--;
+ if (selStart>bufLen)
+ selStart=bufLen;
+ selEnd=selStartOffSet=selStart;
+ }
+ selHided=False;
+ }
+ update(ufView);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Return the palette for the editor. Currently that's a palette created by
+Robert that have space for all the colors used by the editor.
+
+ Return: a reference to the palette.
+
+***************************************************************************/
+
+TPalette& TCEditor::getPalette() const
+{
+ static TPalette palette(cpEditor,sizeof(cpEditor)-1);
+ return palette;
+}
+
+/****************************************************************************
+
+ Function: void checkScrollBar( const TEvent& event, TScrollBar *p,
+ int& d )
+
+ Type: TCEditor member.
+
+ Objetive: ? Check if the event is a change in the Scroll bars.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+void TCEditor::checkScrollBar( const TEvent& event,
+ TScrollBar *p,
+ int& d
+ )
+{
+ if ( (event.message.infoPtr == p) && (p->value != d) )
+ {
+ d = p->value;
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ update( ufView );
+ }
+}
+
+/****************************************************************************
+
+ Function: int IsFirstCharInLine(void)
+
+ Type: TCEditor member.
+
+ Objetive: Check if the cursor is over the first non-blanc char in the
+ line.
+ Works when a line is in edition and when isn't.
+
+ Return: 0 not OK.
+
+ by SET
+
+****************************************************************************/
+
+int TCEditor::IsFirstCharInLine(void)
+{
+ if (IslineInEdition)
+ {
+ char *s=bufEdit;
+
+ for (;*s && s!=inEditPtr && ucisspace(*s); s++);
+ return s==inEditPtr;
+ }
+ char *s=curLinePtr;
+ uint32 l=LenWithoutCRLF(curPos.y,curLinePtr),x,xpos=curPos.x,i;
+
+ for (x=0,i=0; x<xpos && i<l && ucisspace(*s); s++,i++)
+ { AdvanceWithTab(*s,x); }
+ return x==xpos;
+}
+
+/****************************************************************************
+
+ Function: int GoFirstCharInLine(void)
+
+ Type: TCEditor member.
+
+ Objetive: Put the cursor on the first non-blank character in the line, if
+ exists.
+
+ Return: 0 not OK.
+
+ by SET
+
+****************************************************************************/
+
+int TCEditor::GoFirstCharInLine(void)
+{
+ char *s;
+ uint32 l,x,i;
+
+ if (IslineInEdition)
+ {
+ s=bufEdit;
+ l=(uint32)(inEditPtr-bufEdit+restCharsInLine);
+ }
+ else
+ {
+ s=curLinePtr;
+ l=LenWithoutCRLF(curPos.y,curLinePtr);
+ }
+
+ for (x=0,i=0; i<l && ucisspace(*s); s++,i++)
+ { AdvanceWithTab(*s,x); }
+ if (i<l)
+ {
+ curPos.x=x;
+ update(ufUpdate);
+ return 1;
+ }
+ return 0;
+}
+
+/****************************************************************************
+
+ Function: void handleEvent( TEvent& event )
+
+ Type: TCEditor member.
+
+ Objetive: Is the main switch/case of the class.
+
+ by SET
+
+ ToDo: Put in separated routines the cases.
+
+****************************************************************************/
+
+void TCEditor::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+ switch(event.what)
+ {
+ case evMouseDown:
+ handleMouse(event);
+ break;
+
+ case evKeyDown:
+ handleKey(event);
+ break;
+
+ case evCommand:
+ if (handleCommand(event.message.command))
+ clearEvent(event);
+ break;
+
+ case evBroadcast:
+ switch(event.message.command)
+ {
+ case cmScrollBarChanged:
+ checkScrollBar(event,hScrollBar,delta.x);
+ checkScrollBar(event,vScrollBar,delta.y);
+ break;
+
+ case cmcSetGlobalOptions:
+ ExpandGlobalOptionsLocally((GlobalOptionsRect *)event.message.infoPtr);
+ return;
+
+ case cmUpdateColorsChanged:
+ case cmcColorsChanged:
+ CacheColors();
+ break;
+
+ default:
+ return;
+ }
+ clearEvent(event);
+ break;
+ }
+}
+
+
+void TCEditor::handleKey(TEvent &event)
+{
+ // Hack: disassembler windows must work as a widget
+ if (isDisassemblerEditor && owner && owner->owner &&
+ event.keyDown.keyCode==kbTab)
+ {
+ owner->owner->selectNext(True);
+ clearEvent(event);
+ return;
+ }
+ // First translate it to a command
+ KeyTNode node;
+ int ret=KeyTrans.get(event.keyDown.keyCode,&node);
+
+ if (!ret)
+ { // This key haven't any assigment
+ unsigned char Character;
+ Character=event.keyDown.charScan.charCode;
+ // Filter strange characters
+ //if (Character=='\t' || (Character>=32 && Character<255))
+ if (event.keyDown.keyCode==kbTab)
+ Character='\t';
+ if (!isReadOnly && Character && Character!='\n' && Character!='\r')
+ {
+ lock();
+ CutIfNotPersistent();
+ //addToUndo(undoPutChar,(void *)&Character);
+ if (!IslineInEdition)
+ EditLine();
+ if (IslineInEdition)
+ {
+ InsertCharInLine(Character);
+ if (Recording)
+ MacroArray[MacroCount++]=0xF0000+Character;
+ update(ufLine);
+ if (ShowMatchPairFly && ShowMatchPairNow)
+ SearchMatchOnTheFly();
+ }
+ unlock();
+ }
+ else
+ return;
+ }
+ else
+ if (ret>0)
+ {
+ KeyTSeq *se;
+ int i;
+ switch (node.flags)
+ {
+ case kbtIsComm:
+ handleCommand(node.d.command);
+ break;
+ case kbtIsMacro:
+ lock();
+ SLPSearchMacro(this,node.d.macro,False);
+ unlock();
+ break;
+ case kbtIsSeq:
+ se=node.d.sequence;
+ for (i=0; i<se->cant; i++)
+ handleCommand(se->commands[i]);
+ break;
+ }
+ }
+ // r<0 is part of a sequence so just clear the event
+ clearEvent(event);
+}
+
+void TCEditor::handleMouse(TEvent &event)
+{
+ // Mouse events, Full Ok Level 1
+ uchar selectMode=0;
+
+ flushLine();
+ if (RightClickMenu && event.mouse.buttons==mbRightButton)
+ {// Move the cursor so WordUnderCursor can get the pointed word
+ MoveToMouse(event.mouse.where,smDontSel);
+ // Pop-up the box
+ TRect dkt=TProgram::deskTop->getExtent();
+ TMenuBox *mbox=new TMenuBox(TRect(event.mouse.where.x-2,event.mouse.where.y-2,
+ dkt.b.x,dkt.b.y),RightClickMenu->subMenu,0);
+ unsigned command=TProgram::deskTop->execView(mbox);
+ CLY_destroy(mbox);
+ if (command)
+ message(TProgram::application,evCommand,command,0);
+ return;
+ }
+
+ if (event.mouse.buttons==mbMiddleButton && TVOSClipboard::isAvailable()>1)
+ {// Uncommenting the next line the text is pasted at the mouse position.
+ // It looks a good idea, but isn't good in practice.
+ //MoveToMouse(event.mouse.where,smDontSel);
+ clipWinPaste(1);
+ return;
+ }
+
+ if (event.mouse.buttons==mbButton4)
+ {
+ ScrollLinesUp(5);
+ return;
+ }
+
+ if (event.mouse.buttons==mbButton5)
+ {
+ ScrollLinesDown(5);
+ return;
+ }
+
+ if (event.mouse.doubleClick)
+ selectMode|=smDouble;
+ do
+ {
+ lock();
+ if (event.what==evMouseAuto)
+ {
+ TPoint mouse = makeLocal( event.mouse.where );
+ TPoint d = delta;
+ if (mouse.x<0)
+ d.x--;
+ if (mouse.x>=size.x)
+ d.x++;
+ if (mouse.y<0)
+ d.y--;
+ if (mouse.y>=size.y)
+ d.y++;
+ scrollTo(d.x, d.y);
+ }
+ MoveToMouse(event.mouse.where,selectMode);
+ //setCurPtr(getMousePtr(event.mouse.where), selectMode);
+ selectMode|=smExtend;
+ if (ShowMatchPairFly && ShowMatchPairNow)
+ SearchMatchOnTheFly();
+ unlock();
+ }
+ while (mouseEvent(event,evMouseMove+evMouseAuto));
+ clearEvent(event);
+ SetSelectionBuffer();
+ if (TVOSClipboard::isAvailable()>1)
+ clipWinCopy(1);
+}
+
+void TCEditor::ScrollLinesUp(int lines)
+{
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ MoveLinesUp(lines);
+ delta.y=max(delta.y-lines,0);
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ update(ufView);
+}
+
+void TCEditor::ScrollLinesDown(int lines)
+{
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ MoveLinesDown(lines);
+ delta.y=min(delta.y+lines,limit.y);
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ update(ufView);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to show something in the status line from a function that knows
+nothing about TCEditors.
+
+***************************************************************************/
+
+static
+void CallBackStatusLine(const char *msg, void *obj)
+{
+ TCEditor *e=(TCEditor *)obj;
+ e->setStatusLine((char *)msg);
+}
+
+int TCEditor::handleCommand(ushort command)
+{
+ Boolean centerCursor=(!cursorVisible()) ? True : False;
+ int i; // To be used as iterator in any of the case in the switch
+ int cursorMoved=0;
+ TPoint oldCurPos;
+
+ /* Note: Most of the routines check isReadOnly to avoid problems if in some
+ way the command is processed without using this routine.
+ Only the routines made in the case need the test.
+ The check is very redundant */
+ switch (command)
+ {
+ // First commands without locking, I must resee it
+ case cmcFind:
+ flushLine();
+ lastCurPos=curPos;
+ find();
+ updateCommands(); // In case the user copied/pasted
+ break;
+
+ case cmcReplace:
+ flushLine();
+ lastCurPos=curPos;
+ replace();
+ updateCommands(); // In case the user copied/pasted
+ break;
+
+ // ^L
+ case cmcSearchAgain:
+ flushLine();
+ lastCurPos=curPos;
+ StartOfSearch=(unsigned)(ColToPointer()-buffer)+1;
+ doSearchReplace();
+ break;
+
+ case cmcForceMatchPairHL:
+ SearchMatchOnTheFly();
+ break;
+
+ default:
+ lock();
+ lockUndo();
+ oldCurPos=curPos;
+ switch(command)
+ {
+ case cmcSelectOn:
+ flushLine();
+ SetStartOfSelecting((uint32)(ColToPointerPost()-buffer));
+ break;
+
+ case cmcSelectOff:
+ selecting=False;
+ break;
+
+ // ^KY or ShiftDel Full Level 2
+ case cmcCut:
+ clipCut();
+ break;
+
+ // Full Level 2
+ case cmcCopy:
+ clipCopy();
+ break;
+
+ // Full Level 2
+ case cmcPaste:
+ if (PersistentBlocks)
+ clipPaste();
+ else
+ {
+ clipReplace();
+ selEnd=selStart;
+ }
+ break;
+
+ // Alt+Backspace
+ case cmcUndo:
+ undo();
+ break;
+
+ // No key
+ case cmcRedo:
+ redo();
+ break;
+
+ // Ctrl+Del, Full Level 2
+ case cmcClear:
+ flushLine();
+ deleteSelect();
+ break;
+
+ // ^KC
+ case cmcCopyBlock:
+ if (isReadOnly) break;
+ if (PersistentBlocks && hasSelection())
+ {
+ if (!selHided)
+ {
+ flushLine();
+ char *s;
+ unsigned l=selEnd-selStart;
+ s=new char[l];
+ if (s)
+ {
+ memcpy(s,buffer+selStart,l);
+ insertBuffer(s,0,l,True,True,False);
+ delete s;
+ }
+ }
+ else
+ {
+ selHided=False;
+ update(ufView);
+ }
+ }
+ break;
+
+ // Full Ok level 2 + selExtend
+ case cmcCharLeft:
+ if (curPos.x>0)
+ {
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ {
+ curPos.x--;
+ if (*inEditPtr=='\t')
+ {
+ if (curPos.x<LineWidth(bufEdit,inEditPtr))
+ {
+ inEditPtr--;
+ restCharsInLine++;
+ }
+ }
+ else // if (tab)
+ {
+ inEditPtr--;
+ restCharsInLine++;
+ }
+ if (NoInsideTabs && *inEditPtr=='\t')
+ curPos.x=LineWidth(bufEdit,inEditPtr);
+ ClearSelIfNonPers();
+ }
+ else // if (Line in edition)
+ {
+ if (NoInsideTabs)
+ curPos.x=PosLeftChar();
+ else
+ curPos.x--;
+ cursorMoved=1;
+ }
+ update(ufUpdate);
+ }
+ break;
+
+ // Full Ok level 2 + selExtend
+ case cmcCharRight:
+ if (curPos.x<MaxLineLen)
+ {
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ {
+ addToUndo(undoInMov);
+ if (*inEditPtr)
+ {
+ curPos.x++;
+ if (*inEditPtr=='\t')
+ {
+ if (NoInsideTabs)
+ {
+ inEditPtr++;
+ restCharsInLine--;
+ curPos.x=LineWidth(bufEdit,inEditPtr);
+ }
+ else // if (NoInsideTabs)
+ {
+ if (IsATabPos(curPos.x))
+ {
+ inEditPtr++;
+ restCharsInLine--;
+ }
+ }
+ }
+ else // if (*inEditPtr=='\t')
+ {
+ inEditPtr++;
+ restCharsInLine--;
+ }
+ update(ufUpdate);
+ }
+ else
+ {
+ InsertCharInLine(32);
+ restCharsInLine=0;
+ update(ufLine);
+ }
+ ClearSelIfNonPers();
+ }
+ else // if (IslineInEdition)
+ {
+ addToUndo(undoInMov);
+ curPos.x++;
+ if (NoInsideTabs)
+ {
+ int dif;
+ ColToPointer(dif);
+ if (dif>0)
+ curPos.x+=dif;
+ }
+ cursorMoved=1;
+ }
+ }
+ break;
+
+ // Full OK Level 2 + selExtend
+ case cmcWordLeft:
+ if (curPos.y>0 || curPos.x>0)
+ {
+ CheckForShiftSelection();
+ if (IslineInEdition) // This can be optimized
+ MakeEfectiveLineInEdition();
+ addToUndo(undoInMov);
+ prevWord();
+ cursorMoved=1;
+ }
+ break;
+
+ // Full OK Level 2 + selExtend
+ case cmcWordRight:
+ CheckForShiftSelection();
+ if (IslineInEdition) // This can be optimized
+ MakeEfectiveLineInEdition();
+ addToUndo(undoInMov);
+ nextWord();
+ cursorMoved=1;
+ break;
+
+ case cmcGoEndOfWord:
+ cursorMoved=goEndWord();
+ break;
+
+ // Full OK Level 2 + selExtend
+ case cmcLineStart:
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ {
+ restCharsInLine+=(int)(inEditPtr-bufEdit);
+ inEditPtr=bufEdit;
+ // We purge spaces so we should show it now if tabs are involved
+ // and visible.
+ if (SeeTabs)
+ {
+ int tabs=0;
+ char *s,*e;
+ for (s=bufEdit, e=bufEdit+restCharsInLine; s<e && isspace(*s); s++)
+ if (*s=='\t') tabs++;
+ if (s==e && tabs)
+ {
+ restCharsInLine=0;
+ *inEditPtr=0;
+ update(ufLine);
+ }
+ }
+ }
+ curPos.x=0;
+ cursorMoved=1;
+ break;
+
+ // Full OK Level 2 + selExtend
+ case cmcLineOrScrEnd: // It moves to the last visible column (g-end in VI)
+ case cmcLineEnd:
+ {
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ int len=0;
+ i=0;
+ if (IslineInEdition)
+ {
+ if (DontPurgeSpaces)
+ { // Real end of line
+ len=curPos.x;
+ while (*inEditPtr)
+ {
+ AdvanceWithTab(*inEditPtr,len);
+ inEditPtr++;
+ }
+ restCharsInLine=0;
+ }
+ else
+ { // Calculate the "visible" length of the line and purge the rest
+ char *auxPos=bufEdit;
+ char *lastUsedPos=auxPos;
+ int lastUsedX=0;
+ while (*auxPos)
+ {
+ AdvanceWithTab(*auxPos,len);
+ if (!ucisspace(*auxPos))
+ {
+ lastUsedPos=auxPos;
+ lastUsedX=len;
+ }
+ auxPos++;
+ }
+ // Purge any spaces at the end of the line
+ restCharsInLine=0;
+ if (!ucisspace(*lastUsedPos))
+ lastUsedPos++;
+ inEditPtr=lastUsedPos;
+ *lastUsedPos=0;
+ len=lastUsedX;
+ // If the user is looking tabs perhaps we purged some so update it
+ if (SeeTabs)
+ update(ufLine);
+ }
+ }
+ else
+ {
+ int c=LenWithoutCRLF(curPos.y,curLinePtr);
+ while (c--)
+ {
+ AdvanceWithTab(curLinePtr[i],len);
+ i++;
+ }
+ }
+ if (command==cmcLineOrScrEnd && len>delta.x+size.x-1)
+ curPos.x=delta.x+size.x-1;
+ else
+ curPos.x=len;
+ cursorMoved=1;
+ }
+ break;
+
+ // Full OK level 2 + selExtend
+ case cmcLineUp:
+ if (curPos.y>0)
+ {
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ curLinePtr-=lenLines[--curPos.y];
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ cursorMoved=1;
+ }
+ break;
+
+ // Full OK level 2 + selExtend
+ case cmcLineDown:
+ if ((unsigned)curPos.y<totalLines)
+ {
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ curLinePtr+=lenLines[curPos.y++];
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ cursorMoved=1;
+ }
+ break;
+
+ // Full Ok level 2 (Pg Up) + selExtend
+ case cmcPageUp:
+ ScrollLinesUp(size.y-1);
+ cursorMoved=1;
+ break;
+
+ // Full Ok level 1 (Pg Down) + selExtend
+ case cmcPageDown:
+ ScrollLinesDown(size.y-1);
+ cursorMoved=1;
+ break;
+
+ // Full Ok level 2 (^Pg Up) + selExtend
+ case cmcTextStart:
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ curPos.x=0;
+ curPos.y=0;
+ curLinePtr=buffer;
+ cursorMoved=1;
+ break;
+
+ // Full Ok level 2 (^Pg Down) + selExtend
+ case cmcTextEnd:
+ JumpEndOfText();
+ cursorMoved=1;
+ break;
+
+ // Full OK level 2
+ case cmcNewLine:
+ newLine();
+ break;
+
+ // Full Ok level 2 (Backspace)
+ case cmcBackSpace:
+ BackSpace();
+ break;
+
+
+ // Full Ok level 2 (Delete)
+ case cmcDelCharClear:
+ case cmcDelChar:
+ if (isReadOnly)
+ break;
+ showMatchPairFlyCache=NULL;
+ if (!PersistentBlocks && hasSelection())
+ {
+ if (command==cmcDelChar)
+ clipCut();
+ else
+ { // For people that wants clear
+ flushLine();
+ deleteSelect();
+ }
+ break;
+ }
+ if (IslineInEdition && restCharsInLine)
+ { // easy
+ addToUndo(undoDelCharDel,inEditPtr);
+ int wasATab=*inEditPtr=='\t';
+ memcpy(inEditPtr,inEditPtr+1,restCharsInLine);
+ if (wasATab)
+ RecalculateXofLineInEdit();
+ restCharsInLine--;
+ MarkAsModified();
+ update(ufLine);
+
+ unsigned PosOfIns=(unsigned)(inEditPtr-bufEdit);
+ AdjustLineSel(PosOfIns,-1,False,False);
+
+ // Update the markers
+ for (i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0 && (unsigned)Pos>PosOfIns)
+ MarkersInLine[i]--;
+ }
+ }
+ else
+ {
+ // Could be optimized
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+
+ // 2 cases: 1) in the line 2) outside
+ int x=LineWidth();
+ if (x>curPos.x)
+ { // OK in the line
+ EditLine();
+ if (!IslineInEdition)
+ break;
+ addToUndo(undoDelCharDel,inEditPtr);
+ int wasATab=*inEditPtr=='\t';
+ memcpy(inEditPtr,inEditPtr+1,restCharsInLine);
+ if (wasATab)
+ RecalculateXofLineInEdit();
+ restCharsInLine--;
+ MarkAsModified();
+ update(ufLine);
+ unsigned PosOfIns=(unsigned)(inEditPtr-bufEdit);
+ AdjustLineSel(PosOfIns,-1,False,False);
+ // Update the markers
+ for (i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0 && (unsigned)Pos>PosOfIns)
+ MarkersInLine[i]--;
+ }
+ }
+ else
+ { // No!!!
+ if ((unsigned)curPos.y<totalLines)
+ {
+ // Expand the line
+ int ToInsert=curPos.x-x;
+ //curPos.x=x;
+ // delete the CR-LF
+ deleteRange(curLinePtr+LenWithoutCRLF(curPos.y,curLinePtr),curLinePtr+lenLines[curPos.y]);
+ if (ToInsert)
+ insertSpaces(ToInsert,x);
+ // To clean extra spaces if exist
+ EditLine();
+ }
+ }
+ }
+ break;
+
+ // Full Ok level 2 (^T)
+ case cmcDelWord:
+ {
+ if (isReadOnly)
+ break;
+ ClearSelIfNonPers();
+ if (IslineInEdition)
+ {
+ if (restCharsInLine==0) // If is the end of line
+ MakeEfectiveLineInEdition();
+ else
+ {
+ char *p=inEditPtr;
+
+ if (!ucisspace(*p))
+ {
+ if (isWordChar(*p))
+ while (*p && isWordChar(*p)) p++;
+ else
+ p++;
+ }
+ /*if (!isWordChar(*p))
+ while ( *p && !isWordChar(*p) ) p++;
+ else
+ while ( *p && isWordChar(*p) ) p++;*/
+ while (*p && ucisspace(*p)) p++;
+ restCharsInLine-=(int)(p-inEditPtr);
+ deleteRangeLineInEdition(inEditPtr,p,-1);
+ break;
+ }
+ }
+ int dif;
+ char *s=ColToPointer(dif);
+ addToUndo(undoPreDelete);
+ deleteRange(s,s+nextCWord());
+ if (dif<0)
+ insertSpaces(-dif,curPos.x);
+ }
+ break;
+
+ // ^BackSpace, Full Ok level 2
+ case cmcDelPrevWord:
+ {
+ if (isReadOnly) break;
+ ClearSelIfNonPers();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ char *s=ColToPointer();
+ deleteRange(s+prevWord(False),s);
+ }
+ break;
+
+ // Full Ok level 2 (^QH)
+ case cmcDelStart:
+ if (isReadOnly) break;
+ ClearSelIfNonPers();
+ if (IslineInEdition)
+ deleteRangeLineInEdition(bufEdit,inEditPtr,0);
+ else
+ deleteRange(curLinePtr,ColToPointer());
+ break;
+
+ // ^QM
+ case cmcChooseMacro:
+ flushLine();
+ SLPInterfaceRun(this);
+ break;
+
+ case cmcRepeatMacro:
+ flushLine();
+ SLPInterfaceReRun(this);
+ break;
+
+ // Full Ok level 2 (^QY)
+ case cmcDelEnd:
+ if (isReadOnly) break;
+ ClearSelIfNonPers();
+ if (IslineInEdition)
+ {
+ deleteRangeLineInEdition(inEditPtr,inEditPtr+restCharsInLine,-1);
+ restCharsInLine=0;
+ }
+ else
+ {
+ char *s=ColToPointer();
+ if (CLY_IsntEOL(*s))
+ deleteRange(s,curLinePtr+LenWithoutCRLF(curPos.y,curLinePtr));
+ }
+ break;
+
+ // Full Ok level 2 (^Y)
+ case cmcDelLine:
+ if (isReadOnly) break;
+ ClearSelIfNonPers();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ if ((uint32)curPos.y!=totalLines)
+ deleteRange(curLinePtr,curLinePtr+lenLines[curPos.y]);
+ else
+ deleteRange(curLinePtr,curLinePtr+LenWithoutCRLF(curPos.y,curLinePtr));
+ break;
+
+ // ^KB, OK Level 2
+ case cmcStartSelect:
+ addToUndo(undoCutInMov,NULL);
+ if (IslineInEdition)
+ {
+ uint32 posL=(uint32)(curLinePtr-buffer);
+ selLineStart=(uint32)(inEditPtr-bufEdit);
+ selNewStart=posL+selLineStart;
+ selStart=posL;
+ }
+ else
+ selStart=(uint32)(ColToPointer()-buffer);
+ selHided=False;
+ update(ufView);
+ break;
+
+ // ^KK, OK Level 2
+ case cmcEndSelect:
+ if (IslineInEdition)
+ {
+ uint32 posL=(uint32)(curLinePtr-buffer);
+ selLineEnd=(uint32)(inEditPtr-bufEdit);
+ selNewEnd=posL+selLineEnd;
+ selEnd=posL;
+ }
+ else
+ selEnd=(uint32)(ColToPointer()-buffer);
+ selHided=False;
+ update(ufView);
+ addToUndo(undoCutInMov,NULL);
+ break;
+
+ // ^KH Full Ok Level 2
+ case cmcHideSelect:
+ addToUndo(undoCutInMov,NULL);
+ hideSelect();
+ break;
+
+ // New ^Home Full Ok Level 2 + selExtend
+ case cmcFirstLineInScreen:
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ MoveLinesUp(curPos.y-delta.y);
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ cursorMoved=1;
+ break;
+
+ // New ^End Full Ok Level 2 + selExtend
+ case cmcLastLineInScreen:
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ MoveLinesDown(delta.y+size.y-curPos.y-1);
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ cursorMoved=1;
+ break;
+
+ // It moves to the last visible column
+ case cmcLastColInScreen:
+ i=delta.x+size.x-1;
+ if (curPos.x<i)
+ {
+ flushLine()
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ curPos.x=i;
+ cursorMoved=1;
+ }
+ break;
+
+ // ^O
+ case cmcIndentMode:
+ autoIndent = (!autoIndent) ? True : False;
+ break;
+
+ case cmcIntelIndentMode:
+ intelIndent=(intelIndent) ? False : True;
+ break;
+
+ // ^V
+ case cmcInsMode:
+ toggleInsMode(True);
+ break;
+
+ // ^KI Full Ok level 2
+ case cmcIndentBlkOne:
+ IndentBlock(" ");
+ break;
+
+ // ^KU Full Ok level 2
+ case cmcUnIndentBlkOne:
+ UnIndentBlock(1);
+ break;
+
+ // ^KTab Full Ok level 2
+ case cmcIndentBlk:
+ if (UseTabs)
+ IndentBlock("\t");
+ else
+ IndentBlock(0);
+ break;
+
+ // ^KShiftTab Full Ok level 2
+ case cmcUnIndentBlk:
+ if (UseTabs)
+ UnIndentBlock(1);
+ else
+ UnIndentBlock(0);
+ break;
+
+ case cmcArbitraryIndent:
+ ArbitraryIndent();
+ break;
+
+ case cmcCommentIndent:
+ CommentIndent();
+ break;
+
+ case cmcCommentUnIndent:
+ CommentUnIndent();
+ break;
+
+ // ^ShiftIns Full Ok level 2
+ case cmcReplaceSelect:
+ clipReplace();
+ break;
+
+ // ^Kn Without Undo
+ case cmcPutMark0:
+ case cmcPutMark1:
+ case cmcPutMark2:
+ case cmcPutMark3:
+ case cmcPutMark4:
+ case cmcPutMark5:
+ case cmcPutMark6:
+ case cmcPutMark7:
+ case cmcPutMark8:
+ case cmcPutMark9:
+ SetMarker(command-cmcPutMark0);
+ break;
+
+ // ^Qn
+ case cmcGotoMark0:
+ case cmcGotoMark1:
+ case cmcGotoMark2:
+ case cmcGotoMark3:
+ case cmcGotoMark4:
+ case cmcGotoMark5:
+ case cmcGotoMark6:
+ case cmcGotoMark7:
+ case cmcGotoMark8:
+ case cmcGotoMark9:
+ ClearSelIfNonPers();
+ addToUndo(undoInMov);
+ flushLine();
+ GotoOffSet(Markers[command-cmcGotoMark0]);
+ update(ufView);
+ centerCursor=True;
+ break;
+
+ case cmcPushCursorPos:
+ PushCursorPosition();
+ break;
+
+ case cmcPopCursorPos:
+ if (PopCursorPosition())
+ centerCursor=True;
+ break;
+
+ // ^[ Full Ok level 2
+ case cmcSearchStart:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ if ((Pos=SearchOpenSymbol('{','}'))!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // ^] Full Ok level 2
+ case cmcSearchEnd:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ if ((Pos=SearchCloseSymbol('{','}'))!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // ^( Full Ok level 2
+ case cmcSearchOpPar:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ if ((Pos=SearchOpenSymbol('(',')'))!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // ^) Full Ok level 2
+ case cmcSearchClPar:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ if ((Pos=SearchCloseSymbol('(',')'))!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // ^{ is for [ Full Ok level 2
+ case cmcSearchOpCor:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ if ((Pos=SearchOpenSymbol('[',']'))!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // ^} is for ] Full Ok level 2
+ case cmcSearchClCor:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ if ((Pos=SearchCloseSymbol('[',']'))!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // ^QEsc Full Ok level 2
+ case cmcSearchComplement:
+ CheckForShiftSelection();
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ {
+ int Pos;
+ char *s=ColToPointer();
+ switch (*s)
+ {
+ case '}':
+ Pos=SearchOpenSymbol('{','}');
+ break;
+ case '{':
+ Pos=SearchCloseSymbol('{','}');
+ break;
+ case ')':
+ Pos=SearchOpenSymbol('(',')');
+ break;
+ case '(':
+ Pos=SearchCloseSymbol('(',')');
+ break;
+ case ']':
+ Pos=SearchOpenSymbol('[',']');
+ break;
+ case '[':
+ Pos=SearchCloseSymbol('[',']');
+ break;
+ default:
+ Pos=-1;
+ }
+ if (Pos!=-1)
+ {
+ addToUndo(undoInMov);
+ GotoOffSet(Pos);
+ ClearSelIfNonPers();
+ update(ufUpdate);
+ }
+ }
+ break;
+
+ // Ctrl+Space Full Ok level 2
+ case cmcExpandCode:
+ ClearSelIfNonPers();
+ ExpandMacro();
+ break;
+
+ // ^KM Full Ok level 2
+ case cmcToUpper:
+ BlockToUpper(True);
+ break;
+
+ // ^KO Full Ok level 2
+ case cmcToLower:
+ BlockToLower(True);
+ break;
+
+ case cmcToggleCharCase:
+ SetCharCase(2);
+ break;
+
+ case cmcInvertCase:
+ BlockInvertCase();
+ break;
+
+ case cmcAltCase:
+ BlockAltCase();
+ break;
+
+ // ^Tab Ok level 2
+ case cmcSmartIndent:
+ {
+ if (isReadOnly)
+ break;
+ flushLine();
+
+ int Pos;
+ if ((Pos=SearchOpenSymbol('{','}'))!=-1)
+ {
+ ClearSelIfNonPers();
+ char *s=Pos+buffer;
+ // Back to the start
+ for (;*s!='\n' && s!=buffer; --s);
+ if (*s=='\n') s++;
+
+ char *s1=Pos+buffer;
+ uint32 x;
+ // Forward to the pos
+ for (x=0; s!=s1; ++s)
+ { AdvanceWithTab(*s,x); }
+ ++x;
+
+ if (x>(uint32)curPos.x)
+ {
+ EditLine();
+ if (!IslineInEdition)
+ break;
+ Boolean oldOverW=overwrite;
+ overwrite=False;
+ for (x-=curPos.x;x;--x) InsertCharInLine(32);
+ overwrite=oldOverW;
+ }
+ update(ufLine);
+ }
+ }
+ break;
+
+ // ^ShiftTab Ok level 2
+ case cmcSmartUnIndent:
+ {
+ /*if (!IsFirstCharInLine())
+ break;*/
+ if (isReadOnly || !GoFirstCharInLine())
+ break;
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+
+ int Pos;
+ if ((Pos=SearchOpenSymbol('{','}'))!=-1)
+ {
+ ClearSelIfNonPers();
+ char *s=Pos+buffer;
+ // Back to the start
+ for (;*s!='\n' && s!=buffer; --s);
+ if (*s=='\n') s++;
+
+ char *s1=Pos+buffer;
+ uint32 x;
+ // Forward to the pos
+ for (x=0; s!=s1; ++s)
+ { AdvanceWithTab(*s,x); }
+ ++x;
+
+ if ((uint32)curPos.x>x)
+ {
+ Boolean oldOverW=overwrite;
+ overwrite=False;
+ EditLine();
+ while ((uint32)curPos.x>x)
+ BackSpace();
+ while ((uint32)curPos.x<x)
+ InsertCharInLine(' ');
+ overwrite=oldOverW;
+ }
+ update(ufLine);
+ }
+ }
+ break;
+
+ // ^QL Without Undo
+ case cmcSelLength:
+ ShowLength();
+ break;
+
+ // ^J Full Ok Level 2
+ case cmcGotoEditorLine:
+ {
+ int line=curPos.y+1;
+ if (editorDialog(edGotoLine,&line))
+ {
+ GoAndSelectLine(line);
+ centerCursor=True;
+ }
+ break;
+ }
+
+ // Full Ok Level 2
+ case cmcJumpToPrototype:
+ case cmcJumpToFunction:
+ {
+ int line;
+ char *Word;
+
+ CacheSyntaxHLData(GenericSHL);
+ Word=WordUnderCursor(80/*,wucIncludeColon*/);
+ if (editorDialog(command==cmcJumpToFunction ? edJumpToFunction :
+ edJumpToPrototype,&line,buffer,bufLen,Word,fileName,strC.Name))
+ {
+ if (line<0)
+ line=0;
+ if (line>limit.y)
+ line=limit.y;
+ MoveCursorTo(0,--line,True);
+ selStartF=(uint32)(curLinePtr-buffer);
+ selEndF=selStartF+LenWithoutCRLF(line,curLinePtr);
+ centerCursor=True;
+ update(ufUpdate|ufFound|ufLine);
+ }
+ delete[] Word;
+ break;
+ }
+
+ case cmcWhichFunctionIs:
+ ShowWhichFunInStatus();
+ break;
+
+ // ^QB Full Ok Level 2
+ case cmcGoBeginBlock:
+ if (hasVisibleSelection())
+ {
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ GotoOffSet(selStart);
+ update(ufUpdate);
+ }
+ break;
+
+ // ^QK Full Ok Level 2
+ case cmcGoEndBlock:
+ if (hasVisibleSelection())
+ {
+ addToUndo(undoInMov);
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ GotoOffSet(selEnd);
+ update(ufUpdate);
+ }
+ break;
+
+ // ^KL Full Ok Level 2
+ case cmcMarkLine:
+ MarkLine(True);
+ break;
+
+ // ^KT Full Ok Level 2
+ case cmcMarkWord:
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ addToUndo(undoCutInMov,NULL);
+ selHided=False;
+ SelWordUnderCursor();
+ update(ufView);
+ addToUndo(undoCutInMov,NULL);
+ break;
+
+ // ^KV Full OK Level 2
+ case cmcMoveBlock:
+ if (!isReadOnly && hasVisibleSelection() && PersistentBlocks)
+ {
+ flushLine();
+ unsigned pos=(unsigned)(ColToPointer()-buffer);
+ unsigned l=selEnd-selStart;
+ if (pos<selStart)
+ {
+ char *s=new char[l];
+ if (s)
+ {// Temporal copy, if we use the buffer then the selected
+ // text is moved during the insertion.
+ memcpy(s,buffer+selStart,l);
+ uint32 x,y;
+ x=curPos.x; y=curPos.y;
+ deleteSelect();
+ MoveCursorTo(x,y);
+ insertBuffer(s,0,l,True,True,False);
+ update(ufView);
+ }
+ }
+ else
+ if (pos>=selEnd)
+ {
+ uint32 st,e;
+ st=selStart; e=selEnd;
+ insertBuffer(buffer,selStart,l,True,True,False);
+ deleteRange(buffer+st,buffer+e);
+ GotoOffSet(staticNoMoveToEndPaste ? selStart : selEnd);
+ update(ufView);
+ }
+ }
+ break;
+
+ // ^W Without Undo
+ case cmcScrollDown:
+ if (delta.y>0)
+ {
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ delta.y--;
+ if (curPos.y>=delta.y+size.y)
+ {
+ MoveLinesUp(1);
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ }
+ update(ufView);
+ }
+ break;
+
+ // ^Z Without Undo
+ case cmcScrollUp:
+ if ((unsigned)delta.y<totalLines)
+ {
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ delta.y++;
+ if (curPos.y<delta.y)
+ {
+ MoveLinesDown(1);
+ if (NoInsideTabs)
+ curPos.x=FixPosCharLeft();
+ }
+ update(ufView);
+ }
+ break;
+
+ // From the menu
+ case cmcSetLocalOptions:
+ {
+ LocalOptionsRect temp1;
+ ShlDiagBox temp2;
+ temp1.t1=CompactFlags();
+ temp2.t2=SyntaxHL;
+ temp2.items=SHLGenList;
+ temp2.selection=SHLConvValToPos(GenericSHL);
+ sprintf(temp1.tab,"%2u",tabSize);
+ sprintf(temp1.ind,"%2u",indentSize);
+ sprintf(temp1.wcol,"%3u",WrapCol);
+ ColMarkers2Str(colMarkers,temp1.colMarkers,colMarkersStrLen-1);
+ if (editorDialog(edSetLocalOptions,&temp1,&temp2))
+ {
+ ExpandFlags(temp1.t1);
+ SetHighlightTo((shlState)temp2.t2,SHLConvPosToVal(temp2.selection));
+ tabSize=max(atoi(temp1.tab),1);
+ indentSize=max(atoi(temp1.ind),1);
+ WrapCol=max(atoi(temp1.wcol),8);
+ delete[] colMarkers;
+ colMarkers=Str2ColMarkers(temp1.colMarkers);
+ update(ufView);
+ // If using a syntax highlight and tabs the user will most probably
+ // want to indent. Give advice about coherent indentation settings
+ // for tab users.
+ if (SyntaxHL!=shlNoSyntax && UseTabs &&
+ (!autoIndent || intelIndent || !OptimalFill ||
+ !NoInsideTabs || TabIndents || UseIndentSize || BackSpUnindents))
+ GiveAdvice(gadvTabsOps);
+ }
+ }
+ break;
+
+ // From the menu
+ case cmcSetGlobalOptions:
+ SetGlobalOptions();
+ break;
+
+ case cmcExpandAllTabs:
+ ExpandAllTabs(True);
+ break;
+
+ case cmcExpandAllTabsNi:
+ ExpandAllTabs(False);
+ break;
+
+ case cmcCompactBuffer:
+ CompactBuffer(True);
+ break;
+
+ case cmcCompactBufferNi:
+ CompactBuffer(False);
+ break;
+
+ case cmcRecordMacro:
+ Recording=True;
+ MacroCount=0;
+ break;
+
+ case cmcStopMacro:
+ Recording=False;
+ break;
+
+ case cmcPlayMacro:
+ Recording=False;
+ unlock(); // Let all the updates to update the syntax hl.
+ for (i=0; i<MacroCount; i++)
+ {
+ TEvent e;
+ if (MacroArray(i)>=0xF0000)
+ {
+ e.what=evKeyDown;
+ e.keyDown.charScan.charCode=MacroArray(i)-0xF0000;
+ // Avoid triggering a command
+ e.keyDown.keyCode=0;
+ e.keyDown.shiftState=0;
+ handleEvent(e);
+ }
+ else
+ {
+ e.what=evCommand;
+ e.message.command=MacroArray(i) & 0xFFFF;
+ handleEvent(e); // It could be handleCommand for speed but if
+ // I make it nobody can inherit clearly
+ }
+ }
+ // Sanity
+ selecting=False;
+ break;
+
+ case cmcSelRectStart:
+ FillUndoForRectangularStartEnd(undoRectStart);
+ Xr1=curPos.x;
+ Yr1=curPos.y;
+ selRectHided=False;
+ updateRectCommands();
+ update(ufView);
+ break;
+
+ case cmcSelRectEnd:
+ FillUndoForRectangularStartEnd(undoRectEnd);
+ Xr2=curPos.x;
+ Yr2=curPos.y;
+ selRectHided=False;
+ updateRectCommands();
+ update(ufView);
+ break;
+
+ case cmcSelRectCopy:
+ flushLine();
+ selRectCopy(); // It updates cmcSelRectPaste command
+ update(ufUpdate);
+ break;
+
+ case cmcSelRectPaste:
+ if (selRectClip)
+ {
+ flushLine();
+ selRectPaste(selRectClip,curPos.x,curPos.y);
+ updateRectCommands();
+ }
+ break;
+
+ case cmcSelRectDel:
+ flushLine();
+ selRectDelete(Xr1,Yr1,Xr2,Yr2);
+ updateRectCommands();
+ break;
+
+ case cmcSelRectCut:
+ if (isReadOnly) break;
+ flushLine();
+ selRectCopy();
+ selRectDelete(Xr1,Yr1,Xr2,Yr2);
+ updateRectCommands();
+ break;
+
+ case cmcSelRectMove:
+ if (isReadOnly) break;
+ flushLine();
+ {
+ int X=curPos.x,Y=curPos.y;
+
+ if (unsigned(Y+Yr2-Yr1+1)>totalLines)
+ editorDialog(edRectOutside);
+ else
+ {
+ selRectCopy();
+ selRectDelete(Xr1,Yr1,Xr2,Yr2);
+ selRectPaste(selRectClip,X,Y);
+ }
+ updateRectCommands();
+ }
+ break;
+
+ case cmcSelRectHide:
+ addToUndo(undoRectHide,(void *)&selRectHided);
+ selRectHided=Boolean(!selRectHided);
+ updateRectCommands();
+ update(ufView);
+ break;
+
+ case cmcSelRectToUpper:
+ selRectToUpper();
+ break;
+
+ case cmcSelRectToLower:
+ selRectToLower();
+ break;
+
+ case cmcLastPosCur:
+ if (UndoSt==undoInMov)
+ {
+ flushLine();
+ MoveCursorTo(UndoArray[UndoActual].X,UndoArray[UndoActual].Y);
+ cursorMoved=1;
+ }
+ break;
+
+ case cmcToggleMoveOnPaste:
+ staticNoMoveToEndPaste = staticNoMoveToEndPaste ? False : True;
+ break;
+
+ case cmcWrapOn:
+ WrapLine=True;
+ break;
+
+ case cmcWrapOff:
+ WrapLine=False;
+ break;
+
+ case cmcWrapToggle:
+ WrapLine=WrapLine ? False : True;
+ break;
+
+ case cmcMouseToggle:
+ #ifdef SEOSf_Linux
+ // That's very Linux specific: If I suspend the mouse TVision
+ // closes the connection with the gpm server and the mouse
+ // behaves as default allowing the gpm paste mechanism
+ if (TMouse::present())
+ TMouse::suspend();
+ else
+ TMouse::resume();
+ #endif
+ break;
+
+ case cmcGenCodeForMacro:
+ MacroGenerateCode();
+ break;
+
+ case cmcProfileEditor:
+ ProfileEditor();
+ break;
+
+ case cmcLoadFileUnderCur:
+ flushLine();
+ LoadFileUnderCursor(curLinePtr,ColToPointer(),LenWithoutCRLF(curPos.y,curLinePtr),
+ CallBackStatusLine,this,fileName);
+ break;
+
+ // ------ From the File -------
+ case cmcSave:
+ if (modified)
+ save();
+ break;
+
+ case cmcSaveAs:
+ saveAs();
+ break;
+
+ case cmcSaveSameTime:
+ saveSameTime();
+ break;
+
+ case cmcReadBlock:
+ readBlock(this);
+ break;
+
+ case cmcWriteBlock:
+ writeBlock(this);
+ break;
+
+ case cmcSaveAsConvertEOL:
+ saveAsConvertEOL();
+ break;
+
+ case cmcSaveAsNoConvertEOL:
+ saveAsNoConvertEOL();
+ break;
+
+ case cmcCopyClipWin:
+ clipWinCopy(0);
+ break;
+
+ case cmcPasteClipWin:
+ clipWinPaste(0);
+ break;
+
+ case cmcCutClipWin:
+ if (clipWinCopy(0) && !isReadOnly)
+ deleteSelect();
+ break;
+
+ case cmcCopyClipFile:
+ clipFileCopy();
+ break;
+
+ case cmcPasteClipFile:
+ clipFilePaste();
+ break;
+
+ case cmcPasteEmacsMode:
+ PasteEmacsMode();
+ break;
+ /*case cmcFirstMacro ... cmcLastMacro:
+ SLPSearchMacro(this,TranslateCommandToMacroName(event.message.command));
+ break;*/
+
+ case cmcChoosePMacrosList:
+ ChoosePMacroFromList();
+ break;
+
+ case cmcQuotedPrintDecode:
+ QuotedPrintDecode();
+ break;
+
+ case cmcInsertKeyName:
+ InsertKeyName();
+ break;
+
+ case cmcRunSel_sLisp:
+ SLPInterfaceRunSelection(this);
+ break;
+
+ case cmcRunEnter_sLisp:
+ RunSLispAsk();
+ break;
+
+ case cmcJumpLastCursorPos:
+ MoveCursorTo(lastCurPos.x,lastCurPos.y,True);
+ cursorMoved=1;
+ centerCursor=True;
+ break;
+
+ case cmcInsertNewLine:
+ flushLine();
+ insertBuffer(CLY_crlf,0,CLY_LenEOL,canUndo,False,False);
+ break;
+
+ case cmcSearchSelBackward:
+ SearchSelBackward();
+ break;
+
+ case cmcSearchSelForward:
+ SearchSelForward();
+ break;
+
+ case cmcSmartTab:
+ SmartTab();
+ break;
+
+ default:
+ unlock();
+ unlockUndo();
+ return 0;
+ }
+ if (CheckScrollLockCenters)
+ centerCursor=True;
+ trackCursor(centerCursor);
+
+ if (cursorMoved)
+ {
+ lastCurPos=oldCurPos;
+ if (selecting)
+ {
+ UpdateSelecting();
+ update(ufView);
+ }
+ else
+ {
+ update(ufUpdate);
+ ClearSelIfNonPers();
+ }
+ }
+ if (ShowMatchPairFly && ShowMatchPairNow)
+ SearchMatchOnTheFly();
+ unlock();
+ unlockUndo();
+ break;
+ }
+ if (Recording && command!=cmcRecordMacro &&
+ command!=cmcForceMatchPairHL) // This command is sent periodically, if we
+ // record it the macro becomes huge
+ {
+ if (command==(unsigned)cmcSelectOn && MacroCount &&
+ MacroArray[MacroCount-1]==(unsigned)cmcSelectOff)
+ MacroCount--; // If that's an Sel On after a Sel Off kill the Off
+ else
+ MacroArray[MacroCount++]=command;
+ }
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Indicates that this object contains the current selection. Used for the
+"selection search" mechanism.
+
+***************************************************************************/
+
+void TCEditor::SetSelectionBuffer()
+{
+ haveCurSelection=this;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Indicates we no longer hold the selection.
+
+***************************************************************************/
+
+void TCEditor::UnsetSelectionBuffer()
+{
+ if (haveCurSelection==this)
+ haveCurSelection=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Copies the selected text to the @var{destination} buffer. If nothing is
+selected informs it to the user. If the selection contains \n also informs it
+to the user. It also checks for @var{max} bytes.
+
+ Return: True if the selection was copied.
+
+***************************************************************************/
+
+Boolean TCEditor::CopySelToFindStr(char *destination, unsigned max,
+ Boolean &isWholeWord)
+{
+ flushLine();
+ isWholeWord=False;
+ // Must have a selection.
+ // Note: the command is disabled when no selection is available.
+ if (!hasVisibleSelection())
+ {
+ editorDialog(edNothingSelected);
+ return False;
+ }
+ // Must be less than maxFindStrLenEd chars
+ unsigned selLen=selEnd-selStart;
+ if (selLen>=max)
+ {
+ editorDialog(edSelTooBig,max);
+ return False;
+ }
+ // Shouldn't contain more than a line
+ for (unsigned offset=selStart; offset<selEnd; offset++)
+ if (CLY_IsEOL(buffer[offset]))
+ {
+ editorDialog(edSelHaveEOL);
+ return False;
+ }
+ // Now is safe to copy
+ strncpyZ(destination,buffer+selStart,selLen+1);
+ // Solve the isWholeWord stuff
+ if ((!selStart || isWordChar(bufChar(selStart-1))) &&
+ (selStart+selLen>=bufLen || isWordChar(bufChar(selStart+selLen))))
+ isWholeWord=True;
+ return True;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs the selected text forward or backward from the cursor position. If
+@var{back} is True the search is backward.
+
+ Return: True if a match was found.
+
+***************************************************************************/
+
+Boolean TCEditor::SearchSelForB(Boolean back)
+{
+ if (!bufLen) // Sanity check
+ return False;
+
+ Boolean isWholeWord=True;
+ // Get a copy of the current selection
+ char findStrSel[maxFindStrLenEd];
+ TCEditor *fromEd;
+ if (haveCurSelection && haveCurSelection->hasVisibleSelection())
+ fromEd=haveCurSelection;
+ else
+ fromEd=this;
+
+ if (fromEd->hasVisibleSelection())
+ {
+ if (!fromEd->CopySelToFindStr(findStrSel,maxFindStrLenEd,isWholeWord))
+ return False;
+ }
+ else
+ {// No selection, get the word under cursor
+ char *s=WordUnderCursor(maxFindStrLenEd);
+ if (!s)
+ return False;
+ strncpyZ(findStrSel,s,maxFindStrLenEd);
+ delete[] s;
+ }
+
+ // Remmember the old search settings
+ unsigned oldOps=editorFlags;
+ ushort oldSearchInSel=SearchInSel;
+ ushort oldFromWhere=FromWhere;
+ // Change the settings for this search
+ editorFlags&=~(efCaseSensitive | efRegularEx | efSearchInComm |
+ efSearchOutComm | efDoReplace | efSearchBack);
+ editorFlags|=efWholeWordsOnly;
+ if (strC.Flags1 & FG1_CaseSensitive)
+ editorFlags|=efCaseSensitive;
+ if (back)
+ editorFlags|=efSearchBack;
+ SearchInSel=FromWhere=0;
+ // Compile the search
+ if (CompileSearch(findStrSel))
+ return False;
+
+ StartOfSearch=(unsigned)(ColToPointer()-buffer);
+ if (back)
+ {
+ if (StartOfSearch)
+ StartOfSearch--;
+ }
+ else
+ StartOfSearch++;
+ Boolean found=search(findStrSel,editorFlags);
+
+ if (!found)
+ {// Start from the other end
+ if (back)
+ StartOfSearch=bufLen-1;
+ else
+ StartOfSearch=0;
+ found=search(findStrSel,editorFlags);
+ if (found)
+ {
+ char bufaux[80];
+ char *fmt=TVIntl::getTextNew(__("Search wrapped, continued from %s."));
+ char *from=TVIntl::getTextNew(back ? __("bottom") : __("top"));
+ CLY_snprintf(bufaux,80,fmt,from);
+ DeleteArray(fmt);
+ DeleteArray(from);
+ setStatusLine(bufaux);
+ }
+ }
+
+ // Restore previous settings
+ editorFlags=oldOps;
+ SearchInSel=oldSearchInSel;
+ FromWhere=oldFromWhere;
+ // Compile the old search
+ CompileSearch(findStr);
+ return found;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs the selected text forward from the cursor position.
+
+ Return: True if a match was found.
+
+***************************************************************************/
+
+Boolean TCEditor::SearchSelForward()
+{
+ return SearchSelForB(False);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs the selected text backward from the cursor position.
+
+ Return: True if a match was found.
+
+***************************************************************************/
+
+Boolean TCEditor::SearchSelBackward()
+{
+ return SearchSelForB(True);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Select the current line and optionally move the cursor to the beggining.
+
+***************************************************************************/
+
+void TCEditor::MarkLine(Boolean moveCursor)
+{
+ flushLine();
+ if (moveCursor)
+ {
+ addToUndo(undoInMov);
+ curPos.x=0;
+ }
+ selHided=False;
+ selStart=(uint32)(curLinePtr-buffer);
+ selEnd=selStart+lenLines[curPos.y];
+ update(ufView);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets the sLisp code under the cursor position. You must specify the
+maximun length of the returned string.@p
+ The routine supports the pipe feature to connect the word with an input
+line object.
+
+ Return:
+ A pointer to the string (a new allocated one) or NULL if the cursor isn't
+over sLisp code.
+
+***************************************************************************/
+
+char *TCEditor::sLispUnderCursor(uint32 maxLength)
+{
+ flushLine();
+
+ // Set-Up the pipe
+ char *s=ColToPointer();
+ PipeOrigin=(unsigned)(s-buffer);
+ PipeBuf=buffer;
+ PipeBufLen=bufLen;
+
+ int PosStart,PosEnd;
+ if (*s=='(')
+ PosStart=s-buffer;
+ else
+ if ((PosStart=SearchOpenSymbol('(',')'))==-1)
+ return NULL;
+ if (*s==')')
+ PosEnd=s-buffer;
+ else
+ if ((PosEnd=SearchCloseSymbol('(',')'))==-1)
+ return NULL;
+
+ // Adjust the pipe
+ PipeOrigin=PosStart;
+
+ unsigned l=PosEnd-PosStart+1;
+ if (l>maxLength-1)
+ return NULL;
+ char *code=new char[l+1];
+
+ memcpy(code,buffer+PosStart,l);
+ code[l]=0;
+ return code;
+}
+
+void TCEditor::RunSLispAsk()
+{
+ char *Code;
+
+ Code=sLispUnderCursor(maxRunAskCode);
+ SLPInterfaceRunAsk(this,Code);
+ delete[] Code;
+}
+
+void TCEditor::InsertKeyName()
+{
+ unsigned short k=TCEditor_SelectAKey();
+ if (k)
+ {
+ char b[tktMaxKeyName];
+ TCEditor_MakeKeyName(b,k);
+ insertText(b,strlen(b),True);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Displays the name of the function where we are positioned in the status
+line.
+
+***************************************************************************/
+
+void TCEditor::ShowWhichFunInStatus()
+{
+ flushLine();
+ CreateFunctionList(buffer,bufLen,fileName,modifiedCounter,strC.Name);
+ int s,e;
+ char *n;
+ if (SearchFunctionByLine(curPos.y,s,e,n))
+ setStatusLine(n);
+ //DestroyFunctionList(); Just left it, it could be needed soon
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Indents a block asking the indentation text to the user.
+
+***************************************************************************/
+
+void TCEditor::ArbitraryIndent()
+{
+ char b[maxArbitraryStrLen+2]; *b=0;
+ if (isReadOnly || !hasVisibleSelection() ||
+ editorDialog(edArbitraryIndent,b,maxArbitraryStrLen)!=cmOK)
+ return;
+ if (*b)
+ IndentBlock(b,True);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Indents a block using a line comment if available. If nothing is selected
+the line where the cursor is located is selected and then indented.
+
+***************************************************************************/
+
+void TCEditor::CommentIndent()
+{
+ int l=strC.lEOLCom1; // For clarity, I hope gcc is smart enough
+ if (isReadOnly || !l)
+ return;
+ if (!hasVisibleSelection())
+ MarkLine(True);
+ AllocLocalStr(b,l+2);
+ strncpy(b,strC.EOLCom1,l);
+ b[l]=' ';
+ b[l+1]=0;
+ IndentBlock(b,True);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Unindents a block using a line comment if available. No check to see if
+each line really starts with the comment is done. If nothing is selected
+the line where the cursor is located is selected and then indented.
+
+***************************************************************************/
+
+void TCEditor::CommentUnIndent()
+{
+ int l=strC.lEOLCom1; // For clarity, I hope gcc is smart enough
+ if (isReadOnly || !l)
+ return;
+
+ if (!hasVisibleSelection())
+ MarkLine(False);
+
+ // Update the line and go to the first selected line
+ flushLine();
+ addToUndo(undoInMov);
+ unsigned Pos=JumpLineStartSelection();
+
+ // Verify that at least the first line is already indented
+ AllocLocalStr(b,l+2);
+ strncpy(b,strC.EOLCom1,l);
+ b[l]=' ';
+ b[l+1]=0;
+ if (strncmp(curLinePtr,b,l+1)!=0)
+ return; // Nope, abort.
+
+ // How many lines?
+ unsigned Lines,PosAux,y;
+ for (Lines=0,y=curPos.y,PosAux=Pos; PosAux<selEnd-1;)
+ {
+ PosAux+=lenLines[y++];
+ Lines++;
+ }
+ // Mark the begining of the rectangular block
+ FillUndoForRectangularStartEnd(undoRectStart);
+ Xr1=0;
+ Yr1=curPos.y;
+ selRectHided=False;
+ // Mark the end of the rectangular block
+ FillUndoForRectangularStartEnd(undoRectEnd);
+ Xr2=l+1;
+ Yr2=curPos.y+Lines-1;
+ // Delete the rectangle
+ selRectDelete(Xr1,Yr1,Xr2,Yr2);
+ updateRectCommands();
+}
+
+static
+unsigned char ASCII2Hex(const char *s)
+{
+ unsigned ret;
+ ret=(*s > '9' ? *s-'A'+10 : *s-'0')*16;
+ s++;
+ ret+=*s > '9' ? *s-'A'+10 : *s-'0';
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Decodes the current block from MIME Quoted Printable format.
+
+***************************************************************************/
+
+void TCEditor::QuotedPrintDecode()
+{
+ if (isReadOnly || !hasVisibleSelection()) return;
+ flushLine();
+
+ int len=selEnd-selStart;
+ char *bf=new char[len];
+ unsigned i=selStart,j=0;
+ while (i<selEnd)
+ {
+ if (buffer[i]=='=' && i+2<selEnd)
+ {
+ if (strncmp(buffer+i+1,CLY_crlf,CLY_LenEOL)==0)
+ i+=CLY_LenEOL+1;
+ else
+ {
+ bf[j++]=ASCII2Hex(buffer+i+1);
+ i+=3;
+ }
+ }
+ else
+ bf[j++]=buffer[i++];
+ }
+ deleteSelect();
+ insertText(bf,j,True);
+ delete[] bf;
+}
+
+#ifdef STANDALONE
+/**[txh]********************************************************************
+
+ Description:
+ Remaps the characters from code page sourID to code page destID. It is
+high level.
+
+***************************************************************************/
+
+void TCEditor::RemapCodePageBuffer(int sourID, int destID, unsigned ops,
+ Boolean allowUndo)
+{
+ if (isReadOnly)
+ return;
+
+ if (ops & rbgOnlySelected)
+ {
+ if (!hasVisibleSelection())
+ return;
+ flushLine();
+ char *s=buffer+selStart;
+ char *end=buffer+selEnd;
+ // Save all the undo info
+ UndoCell un;
+ if (allowUndo)
+ {
+ BlockUndoInfoStartFill(un,undoRecodeBlock,s,end);
+ RecodeInfo *p=new RecodeInfo;
+ p->sourID=sourID; p->destID=destID; p->ops=ops;
+ un.s2.Recode=p;
+ }
+ TVCodePage::RemapBufferGeneric(sourID,destID,(uchar *)s,selEnd-selStart,ops);
+ // Add the undo info to the array
+ if (allowUndo)
+ BlockUndoInfoEndFill(un);
+ }
+ else
+ {
+ if (editorDialog(edActionWOUndo)!=cmYes)
+ return;
+ flushLine();
+ TVCodePage::RemapBufferGeneric(sourID,destID,(uchar *)buffer,bufLen,ops);
+ flushUndoInfo();
+ }
+
+ MarkAsModified();
+ update(ufView);
+}
+#else
+void TCEditor::RemapCodePageBuffer(int , int , unsigned , Boolean )
+{}
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ Highlights the matching (, ), [, ], { or } under the cursor.
+
+***************************************************************************/
+
+Boolean TCEditor::SearchMatchOnTheFly()
+{
+ static int oldX,oldY;
+
+ // Don't do it again /*IsHLCOn && */
+ if (showMatchPairFlyCache==this && curPos.x==oldX && curPos.y==oldY) return False;
+
+ showMatchPairFlyCache=this;
+ oldX=curPos.x;
+ oldY=curPos.y;
+
+ if (IslineInEdition)
+ { // Don't flush the line if that isn't really necesary
+ if (!*inEditPtr || !strchr("{}()[]",*inEditPtr)) return False;
+ }
+ int wasInEdition=0;
+ if (IslineInEdition)
+ {
+ MakeEfectiveLineInEdition();
+ wasInEdition=1;
+ }
+ int Pos, dif;
+ char *s=ColToPointer(dif);
+ // Outside the line or inside a tab
+ if (dif)
+ return False;
+ switch (*s)
+ { // Note: s+1 because the routines are designed assuming the cursor is passing the char
+ case '}':
+ Pos=SearchOpenSymbolXY('{','}',XHLCC,YHLCC,s+1);
+ break;
+ case '{':
+ Pos=SearchCloseSymbolXY('{','}',XHLCC,YHLCC,s+1);
+ break;
+ case ')':
+ Pos=SearchOpenSymbolXY('(',')',XHLCC,YHLCC,s+1);
+ break;
+ case '(':
+ Pos=SearchCloseSymbolXY('(',')',XHLCC,YHLCC,s+1);
+ break;
+ case ']':
+ Pos=SearchOpenSymbolXY('[',']',XHLCC,YHLCC,s+1);
+ break;
+ case '[':
+ Pos=SearchCloseSymbolXY('[',']',XHLCC,YHLCC,s+1);
+ break;
+ default:
+ Pos=-1;
+ }
+ if (Pos!=-1)
+ {
+ int y=YHLCC-delta.y;
+ int x=XHLCC-delta.x;
+ XHLCO=curPos.x;
+ YHLCO=curPos.y;
+ if (x>=0 && x<size.x && y>=0 && y<size.y)
+ {
+ if (IsStatusLineOn)
+ update(ufHLChar | ufStatus);
+ else
+ update(ufHLChar);
+ }
+ if (wasInEdition && ShowMatchPairNow)
+ EditLine();
+ }
+ return True;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Pastes the Emacs mode comment at the start of the file.
+
+***************************************************************************/
+
+void TCEditor::PasteEmacsMode()
+{
+ if (isReadOnly) return;
+ int sizeSt, sizeEnd;
+ char *text=SHLConstructEmacsModeComment(*this,sizeSt,sizeEnd);
+
+ if (text)
+ {
+ int lenText=strlen(text);
+ // Check if already there
+ char buf[MaxExtension];
+ int start,end;
+ if (TakeCommentEmacs(buffer,bufLen,buf,NULL,&start,&end))
+ {
+ int stComp=start-1-sizeSt;
+ // Is there, check if we pasted it:
+ if (stComp>=0 && strncmp(buffer+stComp,text,sizeSt)==0 &&
+ (!sizeEnd || ((unsigned)end+3+sizeEnd<bufLen &&
+ strncmp(text+lenText-CLY_LenEOL-sizeEnd,buffer+end+3,sizeEnd+CLY_LenEOL)==0)))
+ {// Yes, delete it
+ deleteRange(buffer+stComp,buffer+end+3+sizeEnd+CLY_LenEOL,canUndo);
+ }
+ else
+ {// Nope, is too risky to silently delete it.
+ //printf("Actual mode definition: %s\n",buffer+stComp);
+ messageBox(__("Emacs mode already pasted without this editor"),mfError|mfOKButton);
+ ::free(text);
+ return;
+ }
+ }
+ else
+ {
+ // Beggining of text
+ handleCommand(cmcTextStart);
+ // Avoid pasting before a `bangline'
+ if (bufLen>3 && *buffer=='#' && buffer[1]=='!')
+ {// One line down
+ handleCommand(cmcLineDown);
+ if (curPos.y==0)
+ {// It failed, one line file
+ handleCommand(cmcLineEnd);
+ newLine();
+ }
+ }
+ }
+
+ insertBuffer(text,0,lenText,canUndo,True,False);
+ ::free(text);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It shows the length of the selection in a dialog box.
+
+***************************************************************************/
+
+void TCEditor::ShowLength()
+{
+ flushLine();
+ if (hasSelection() && !selHided)
+ {
+ unsigned pos=selStart,lines=0;
+ while (pos<selEnd)
+ {
+ if (buffer[pos++]=='\n')
+ lines++;
+ }
+ // This could be optionally selected.
+ //editorDialog(edLineLenght,selEnd-selStart,lines);
+ if (buffer[pos-1]!='\n')
+ lines++;
+ int l=size.x+1, offset;
+ unsigned selBytes=selEnd-selStart;
+ AllocLocalStr(b,l);
+ if (selBytes>1)
+ offset=TVIntl::snprintf(b,l,__("%d bytes selected"),selBytes);
+ else
+ offset=TVIntl::snprintf(b,l,__("One byte selected"));
+ if (lines>1)
+ TVIntl::snprintf(b+offset,l-offset,__(" in %d lines"),lines);
+ else
+ TVIntl::snprintf(b+offset,l-offset,__(" in one line"));
+ setStatusLine(b);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the indicated marker to the current cursor position.
+
+***************************************************************************/
+
+void TCEditor::SetMarker(unsigned marker)
+{
+ if (IslineInEdition)
+ MarkersInLine[marker]=(int)(inEditPtr-bufEdit);
+ else
+ Markers[marker]=(unsigned)(ColToPointer()-buffer);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Pastes the code for the recorded macro in the editor buffer.
+
+***************************************************************************/
+
+void TCEditor::MacroGenerateCode(void)
+{
+ char buf[MaxRecMacroLen*2];
+ int pos,i,len;
+
+ Recording=False;
+ if (isReadOnly || !MacroCount)
+ return;
+ flushLine();
+ len=sprintf(buf,"(defmacro 'Recorded macro'%s (eval%s",CLY_crlf,CLY_crlf);
+ insertText(buf,len,False);
+ for (i=0; i<MacroCount; i++)
+ {
+ if (MacroArray(i)>=0xF0000)
+ {
+ char val;
+
+ strcpy(buf," (InsertText \"");
+ pos=strlen(buf);
+ for (; MacroArray(i)>=0xF0000 && i<MacroCount; i++)
+ {
+ val=MacroArray(i)-0xF0000;
+ if (val=='\t')
+ {
+ buf[pos++]='\\';
+ buf[pos++]='t';
+ }
+ else
+ {
+ if (val=='\"')
+ buf[pos++]='\\';
+ buf[pos++]=val;
+ }
+ }
+ buf[pos]=0;
+ strcat(buf,"\")");
+ strcat(buf,CLY_crlf);
+ insertText(buf,strlen(buf),False);
+ if (i<MacroCount)
+ i--;
+ }
+ else
+ {
+ MacroArray(i);
+ len=sprintf(buf," (SendCommands");
+ insertText(buf,len,False);
+ for (; MacroArray(i)<0x10000 && i<MacroCount; i++)
+ {
+ if ((i & 3)==3)
+ {
+ len=sprintf(buf,"%s ",CLY_crlf);
+ insertText(buf,len,False);
+ }
+ len=sprintf(buf," cmc%s",TranslateEdCommand(MacroArray(i) & 0xFFFF));
+ insertText(buf,len,False);
+ }
+ len=sprintf(buf,")%s",CLY_crlf);
+ insertText(buf,len,False);
+ if (i<MacroCount)
+ i--;
+ }
+ }
+ len=sprintf(buf," )%s)%s",CLY_crlf,CLY_crlf);
+ insertText(buf,len,False);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Moves the cursor to the end of the file. High level, but doesn't force a
+redraw, you should take care about.
+
+***************************************************************************/
+
+void TCEditor::JumpEndOfText()
+{
+ CheckForShiftSelection();
+ addToUndo(undoInMov);
+ flushLine();
+ MoveLinesDown(totalLines-curPos.y);
+ unsigned chars=LenWithoutCRLF(curPos.y,curLinePtr);
+ unsigned count,x;
+ for (count=0,x=0; count<chars; count++)
+ { AdvanceWithTab(curLinePtr[count],x); }
+ curPos.x=x;
+}
+
+
+/**[txh]**********************************************************************
+
+ Description:
+ Goes to the specified 'line' number and selects the line. Is used by
+cmcGotoEditorLine.
+
+*****************************************************************************/
+
+void TCEditor::GoAndSelectLine(int line, int column, Boolean selectLine)
+{
+ if (line<0)
+ line=0;
+ if (line>limit.y)
+ line=limit.y;
+ MoveCursorTo(column-1,--line,True);
+ if (selectLine)
+ {
+ /* Use selStartF and selEndF here so any real selection
+ will not removed. */
+ selStartF=(uint32)(curLinePtr-buffer);
+ /* Use the total length of the line to higlight it
+ from the total left to total right */
+ selEndF=selStartF+lenLines[line];
+ update(ufUpdate|ufFound|ufLine);
+ }
+ else
+ update(ufUpdate);
+}
+
+/****************************************************************************
+
+ Function: void ProfileEditor(void)
+
+ Type: TCEditor member.
+
+ Objetive: Compare the speed of different modes.
+
+ by SET.
+ 15/05 Version with clock by Robert.
+
+****************************************************************************/
+
+void TCEditor::ProfileEditor(void)
+{
+ if (limit.y<1000)
+ {
+ messageBox(__("Use a file with 1000 lines or more for that"),mfError | mfOKButton);
+ return;
+ }
+#if 0
+ // UClock is more accurate under DOS so I keep that
+ int oldDeltaY=delta.y;
+ int y=0;
+ uclock_t t1,t2;
+ char buf[80];
+
+ t1=uclock();
+ while (y<limit.y)
+ {
+ update(ufView);
+ delta.y=y;
+ doUpdate();
+ y++;
+ }
+ t2=uclock();
+ messageBox(mfOKButton,__("Speed: %f lines/second"),(y/((t2-t1)/(double)UCLOCKS_PER_SEC)));
+ delta.y=oldDeltaY;
+ update(ufView);
+#else
+ #if defined(SECompf_djgpp) || defined(TVComp_BCPP)
+ // That's valid only under DOS where clock is absolute, in UNIX clock
+ // gives information about the CPU we consumed
+ int oldDeltaY=delta.y;
+ int y=0;
+ clock_t t1,t2;
+ double secs;
+
+ t1=clock();
+ while (y<limit.y)
+ {
+ update(ufView);
+ delta.y=y;
+ doUpdate();
+ y++;
+ }
+ t2=clock();
+ secs=(t2-t1)/(double)CLOCKS_PER_SEC;
+ messageBox(mfOKButton,__("Time: %f seconds\nSpeed: %f lines/second\n%f chars/sec"),
+ secs,y/secs*size.y,y/secs*size.y*size.x);
+ delta.y=oldDeltaY;
+ update(ufView);
+ #endif
+ #ifdef SEOSf_Linux
+ int oldDeltaY=delta.y;
+ int y=0;
+ clock_t t1,t2;
+ struct timeval T1,T2;
+ double secs,secs2;
+
+ t1=clock();
+ gettimeofday(&T1,0);
+ while (y<limit.y)
+ {
+ update(ufView);
+ delta.y=y;
+ doUpdate();
+ y++;
+ }
+ t2=clock();
+ gettimeofday(&T2,0);
+ // Substract the reference
+ T2.tv_sec-=T1.tv_sec;
+ if (T2.tv_usec<T1.tv_usec)
+ {
+ T2.tv_sec--;
+ T2.tv_usec=T1.tv_usec-T2.tv_usec;
+ }
+ else
+ T2.tv_usec-=T1.tv_usec;
+ secs=T2.tv_sec+T2.tv_usec/1e6;
+ secs2=(t2-t1)/(double)CLOCKS_PER_SEC;
+ messageBox(mfOKButton,__("Time: %f seconds\nSpeed: %f lines/second\n%5.2f%% Editor\n%f chars/sec"),
+ secs,y/secs*size.y,secs2/secs*100,y/secs*size.y*size.x);
+ delta.y=oldDeltaY;
+ update(ufView);
+ #endif
+#endif
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes the code in HTML to the provided stream. The pal parameter is a
+pointer to a 16 entries array containing the RGB palette to be used. The
+flags parameters are used to fine tune some details.@p
+
+xhtmlTitle: File name as title.@*
+xhtmlBackground: Same background color as the editor.@*
+xhtmlMonoFont: Monospacied font.@*
+xhtmlBoldFont: Bold attribute.@*
+xhtmlUseCSS: Use CSS and HTML 4.01.@*
+
+***************************************************************************/
+
+void TCEditor::SourceToHTML(FILE *f, unsigned *pal, unsigned flags)
+{
+ if (flags & xhtmlUseCSS)
+ SourceToHTML_CSS(f,pal,flags);
+ else
+ SourceToHTML_Old(f,pal,flags);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This version uses plain old HTML. @x{::SourceToHTML}.
+
+***************************************************************************/
+
+void TCEditor::SourceToHTML_Old(FILE *f, unsigned *pal, unsigned flags)
+{
+ flushLine();
+
+ ushort *b=(ushort *)malloc(limit.x*sizeof(ushort));
+ if (!b)
+ return;
+ int bSize=limit.x,thisSize,x,i;
+ uint32 linePtr=0;
+ uint16 color=getColor(0x0201);
+ uchar *bc=(uchar *)b;
+ uchar col,antcol=0x10,fontOpen=0,val;
+
+ // Head
+ fputs("<HTML><HEAD>\n",f);
+ fputs("<Meta name=\"GENERATOR\" content=\"SETEdit "TCEDITOR_VERSION_STR"\">\n",f);
+ // Name of file
+ if (flags & xhtmlTitle)
+ fprintf(f,"<Title>%s</Title>",fileName);
+ // End of head
+ fputs("</HEAD>",f);
+ // Background color as in the editor
+ if (flags & xhtmlBackground)
+ fprintf(f,"<Body BGColor=#%06X>\n",pal[(color>>4) & 0xF]);
+ // That's a normal monospacied font
+ if (flags & xhtmlMonoFont)
+ fputs("<Font face=\"Courier New\">\n",f);
+ // Bold is needed or the letters become hard to read
+ if (flags & xhtmlBoldFont)
+ fputs("<b>",f);
+ for (int y=0; y<limit.y; y++)
+ {
+ char *s=buffer+linePtr;
+ thisSize=LenWithoutCRLF(y,s);
+ for (x=0,i=0; i<thisSize; s++,i++)
+ { AdvanceWithTab(*s,x); }
+ if (x>bSize)
+ {
+ b=(ushort *)realloc(b,x*sizeof(ushort));
+ if (!b) return;
+ bc=(uchar *)b;
+ bSize=x;
+ }
+ (this->*formatLinePtr)(b,linePtr,x,color,x,lenLines.getAttr(y),y,0);
+ for (i=0; i<x; i++)
+ {
+ col=bc[i*2+1] & 0xF;
+ val=bc[i*2];
+ if ((flags & xhtmlUseColors) && col!=antcol && val!=' ')
+ {
+ if (fontOpen)
+ fputs("</Font>",f);
+ else
+ fontOpen=1;
+ fprintf(f,"<Font color=#%06X>",pal[col]);
+ antcol=col;
+ }
+ switch (val)
+ {
+ case ' ':
+ if (i && i+1<x && bc[(i+1)*2]!=' ')
+ fputc(' ',f);
+ else
+ fputs("&nbsp;",f);
+ break;
+ case '>':
+ fputs("&gt;",f);
+ break;
+ case '<':
+ fputs("&lt;",f);
+ break;
+ default:
+ fputc(val,f);
+ }
+ }
+ fputs("<br>\n",f);
+ linePtr+=lenLines[y];
+ }
+ if (fontOpen)
+ fputs("</Font>",f);
+ if (flags & xhtmlMonoFont)
+ fputs("</Font>",f);
+ fputs("</Body></HTML>",f);
+
+ free(b);
+}
+
+const char *TCEditor::shlNames[]=
+{
+ "",
+ "Normal",
+ "Marked",
+ "Comment",
+ "Reserved",
+ "Ident",
+ "Symbol",
+ "String",
+ "Integer",
+ "Float",
+ "Octal",
+ "Hex",
+ "Char",
+ "Pre",
+ "Illegal",
+ "User",
+ "CPU",
+ "Break",
+ "Symbol2",
+ "CrossCur",
+ "StatusLi",
+ "MPHighL",
+ "RectSel",
+ "OddTab",
+ "EvenTab",
+ "ColMark"
+};
+
+/**[txh]********************************************************************
+
+ Description:
+ This variant uses CSS and HTML 4.01 Strict. @x{::SourceToHTML}.
+
+***************************************************************************/
+
+void TCEditor::SourceToHTML_CSS(FILE *f, unsigned *pal, unsigned flags)
+{
+ flushLine();
+
+ ushort *b=(ushort *)malloc(limit.x*sizeof(ushort));
+ if (!b)
+ return;
+ int bSize=limit.x,thisSize,x,i;
+ uint32 linePtr=0;
+ uint16 color=getColor(0x0201);
+ uchar *bc=(uchar *)b;
+ uchar col,antcol=0x10,fontOpen=0,val;
+ uchar aColors[cNumColors];
+ Boolean oldSel=selHided;
+ selHided=True; // It interferes with the painting
+
+ // Head
+ fputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<HTML><HEAD>\n",f);
+ // Name of file
+ if (flags & xhtmlTitle)
+ fprintf(f,"<Title>%s</Title>",fileName);
+ // Common options, needs some adjusts, could be better
+ fputs("<Meta name=\"GENERATOR\" content=\"SETEdit "TCEDITOR_VERSION_STR"\">\n",f);
+ fputs("<meta name=\"resource-type\" content=\"document\">\n",f);
+ fputs("<meta name=\"distribution\" content=\"global\">\n",f);
+ fputs("<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">\n",f);
+ fputs("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n",f);
+ // Embedded stylesheet, the user should move it to a file
+ fputs("<style type=\"text/css\">\n<!--\n",f);
+ // Background color as in the editor
+ if (flags & xhtmlBackground)
+ fprintf(f,"body { background:#%06X }\n",pal[(color>>4) & 0xF]);
+ // A tricky but compact solution:
+ for (i=1; i<cNumColors; i++)
+ {
+ aColors[i]=col=getColor(i);
+ fprintf(f,"b.%s { color:#%06X; background:#%06X; ",shlNames[i],
+ pal[col & 0xF],pal[col>>4]);
+ // Bold is needed or the letters become hard to read
+ if (!(flags & xhtmlBoldFont))
+ fputs("font-weight:normal; ",f);
+ // That's a normal monospacied font
+ if (flags & xhtmlMonoFont)
+ fputs("font-family:Courier New; ",f);
+ fputs("}\n",f);
+ }
+ fputs("-->\n</style>\n",f);
+ // End of head
+ fputs("</HEAD><Body><p>",f);
+ ColorsCacheToIDs();
+ for (int y=0; y<limit.y; y++)
+ {
+ char *s=buffer+linePtr;
+ thisSize=LenWithoutCRLF(y,s);
+ for (x=0,i=0; i<thisSize; s++,i++)
+ { AdvanceWithTab(*s,x); }
+ if (x>bSize)
+ {
+ b=(ushort *)realloc(b,x*sizeof(ushort));
+ if (!b) return;
+ bc=(uchar *)b;
+ bSize=x;
+ }
+ (this->*formatLinePtr)(b,linePtr,x,color,x,lenLines.getAttr(y),y,0);
+ for (i=0; i<x; i++)
+ {
+ col=bc[i*2+1];
+ val=bc[i*2];
+ if ((flags & xhtmlUseColors) && col!=antcol &&
+ (val!=' ' || (aColors[col] & 0xF0)!=(aColors[antcol] & 0xF0)))
+ {
+ if (fontOpen)
+ fputs("</b>",f);
+ else
+ fontOpen=1;
+ fprintf(f,"<b class=%s>",shlNames[col]);
+ antcol=col;
+ }
+ switch (val)
+ {
+ case ' ':
+ if (i && i+1<x && bc[(i+1)*2]!=' ')
+ fputc(' ',f);
+ else
+ fputs("&nbsp;",f);
+ break;
+ case '>':
+ fputs("&gt;",f);
+ break;
+ case '<':
+ fputs("&lt;",f);
+ break;
+ default:
+ fputc(val,f);
+ }
+ }
+ fputs("<br>\n",f);
+ linePtr+=lenLines[y];
+ }
+ if (fontOpen)
+ fputs("</b>",f);
+ fputs("</Body></HTML>",f);
+
+ free(b);
+ CacheColors();
+ selHided=oldSel;
+}
+
+/****************************************************************************
+
+ Function: void SetGlobalOptions(void)
+
+ Type: TCEditor member.
+
+ Objetive: Sets the statics members calling to the dialog box.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::SetGlobalOptions(void)
+{
+ struct GlobalOptionsRect temp;
+
+ CompactGlobalOptions(&temp);
+
+ if (editorDialog(edSetGlobalOptions,&temp))
+ {
+ ExpandGlobalOptions(&temp);
+ // If using tabs the user will most probably want to indent. Give advice about
+ // coherent indentation settings for tab users.
+ if (staticUseTabs &&
+ (!staticAutoIndent || staticIntelIndent || !staticOptimalFill ||
+ !staticNoInsideTabs || staticTabIndents || staticUseIndentSize ||
+ staticBackSpUnindents))
+ GiveAdvice(gadvTabsOps);
+ //update(ufView);
+ }
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the statics members according to the values of the dialog box.@p
+ temp: The structure filled by the dialog box.
+
+***************************************************************************/
+
+void TCEditor::ExpandGlobalOptions(GlobalOptionsRect *temp)
+{
+ #define S(var) static##var=(temp->t1 & go##var) ? True : False;
+ S(AutoIndent);
+ S(UseTabs);
+ S(PersistentBlocks);
+ S(IntelIndent);
+ S(CrossCursorInCol);
+ S(CrossCursorInRow);
+ S(ShowMatchPair);
+ S(ShowMatchPairFly);
+ S(ShowMatchPairNow);
+ S(NoMoveToEndPaste);
+ S(TransparentSel);
+ S(OptimalFill);
+ S(WrapLine);
+ S(SeeTabs);
+ S(NoInsideTabs);
+ S(TabIndents);
+ S(UseIndentSize);
+ S(DontPurgeSpaces);
+ S(BackSpUnindents);
+ S(ColumnMarkers);
+ #undef S
+ if (temp->t1 & goScrollLock)
+ editorFlags|=efScrollLock;
+ else
+ editorFlags&=~efScrollLock;
+ staticTabSize=max(atoi(temp->tab),1);
+ staticIndentSize=max(atoi(temp->ind),1);
+ staticWrapCol=max(atoi(temp->wcol),8);
+ delete[] staticColMarkers;
+ staticColMarkers=Str2ColMarkers(temp->colMarkers);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Compact the statics members.@p
+ temp: The structure to be used by the dialog box.
+
+***************************************************************************/
+
+void TCEditor::CompactGlobalOptions(GlobalOptionsRect *temp)
+{
+ temp->t1 = 0;
+ #define S(var) if(static##var) temp->t1|=go##var;
+ S(AutoIndent);
+ S(UseTabs);
+ S(PersistentBlocks);
+ S(IntelIndent);
+ S(CrossCursorInCol);
+ S(CrossCursorInRow);
+ S(ShowMatchPair);
+ S(ShowMatchPairFly);
+ S(ShowMatchPairNow);
+ S(NoMoveToEndPaste);
+ S(TransparentSel);
+ S(OptimalFill);
+ S(WrapLine);
+ S(SeeTabs);
+ S(NoInsideTabs);
+ S(TabIndents);
+ S(UseIndentSize);
+ S(DontPurgeSpaces);
+ S(BackSpUnindents);
+ S(ColumnMarkers);
+ #undef S
+ if (editorFlags & efScrollLock) temp->t1|=goScrollLock;
+
+ sprintf(temp->tab,"%2u",staticTabSize);
+ sprintf(temp->ind,"%2u",staticIndentSize);
+ sprintf(temp->wcol,"%3u",staticWrapCol);
+ ColMarkers2Str(staticColMarkers,temp->colMarkers,colMarkersStrLen-1);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the normal members according to the values of the dialog box.@p
+ temp: The structure filled by the dialog box.
+
+***************************************************************************/
+
+void TCEditor::ExpandGlobalOptionsLocally(GlobalOptionsRect *temp)
+{
+ Boolean oldTra=TransparentSel;
+
+ autoIndent = (temp->t1 & goAutoIndent) ? True : False;
+ UseTabs = (temp->t1 & goUseTabs) ? True : False;
+ PersistentBlocks= (temp->t1 & goPersistentBlocks) ? True : False;
+ intelIndent = (temp->t1 & goIntelIndent) ? True : False;
+ CrossCursorInCol= (temp->t1 & goCrossCursorInCol) ? True : False;
+ CrossCursorInRow= (temp->t1 & goCrossCursorInRow) ? True : False;
+ ShowMatchPair = (temp->t1 & goShowMatchPair) ? True : False;
+ ShowMatchPairFly= (temp->t1 & goShowMatchPairFly) ? True : False;
+ ShowMatchPairNow= (temp->t1 & goShowMatchPairNow) ? True : False;
+ TransparentSel = (temp->t1 & goTransparentSel) ? True : False;
+ OptimalFill = (temp->t1 & goOptimalFill) ? True : False;
+ WrapLine = (temp->t1 & goWrapLine) ? True : False;
+ SeeTabs = (temp->t1 & goSeeTabs) ? True : False;
+ NoInsideTabs = (temp->t1 & goNoInsideTabs) ? True : False;
+ TabIndents = (temp->t1 & goTabIndents) ? True : False;
+ UseIndentSize = (temp->t1 & goUseIndentSize) ? True : False;
+ DontPurgeSpaces = (temp->t1 & goDontPurgeSpaces) ? True : False;
+ BackSpUnindents = (temp->t1 & goBackSpUnindents) ? True : False;
+ ColumnMarkers = (temp->t1 & goColumnMarkers) ? True : False;
+
+ staticNoMoveToEndPaste=(temp->t1 & goNoMoveToEndPaste) ? True : False;
+ tabSize=max(atoi(temp->tab),1);
+ indentSize=max(atoi(temp->ind),1);
+ WrapCol=max(atoi(temp->wcol),8);
+ delete[] colMarkers;
+ colMarkers=Str2ColMarkers(temp->colMarkers);
+ if (TransparentSel!=oldTra)
+ SetHighlightTo(SyntaxHL,GenericSHL);
+ update(ufView);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Calculates the offset of the start of a line in the buffer.
+
+ Return: The offset.
+
+***************************************************************************/
+
+unsigned TCEditor::GetOffSetOffLine(int y)
+{
+ return GetOffsetGeneric(y,curPos.y,(unsigned)(curLinePtr-buffer));
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Computes the offset for a specified line @var{y}. You have to specify an
+already know reference. The @var{yRef} is the line for the reference and
+@var{lOff} is its offset.
+
+ Return: The offset of the indicated line in the buffer.
+
+***************************************************************************/
+
+unsigned TCEditor::GetOffsetGeneric(int y, int yRef, unsigned lOff)
+{
+ int deltaCur=y-yRef;
+
+ if (deltaCur==0)
+ return lOff;
+
+ if (abs(deltaCur)>y)
+ {
+ unsigned o=0;
+ int i=0;
+ while (y--)
+ o+=lenLines[i++];
+ return o;
+ }
+ else
+ {
+ if (deltaCur<0)
+ {
+ deltaCur=-deltaCur;
+ unsigned o=lOff;
+ int i=yRef;
+ while (deltaCur--)
+ o-=lenLines[--i];
+ return o;
+ }
+ else
+ {
+ unsigned o=lOff;
+ int i=yRef;
+ while (deltaCur--)
+ o+=lenLines[i++];
+ return o;
+ }
+ }
+}
+
+char *LineHandler::getLine(int y, unsigned &len)
+{
+ if (!isReady() || (unsigned)y>ed->totalLines)
+ return NULL;
+ offset=ed->GetOffsetGeneric(y,line,offset);
+ line=y;
+ len=ed->lenLines[line];
+ return ed->buffer+offset;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function creates a new copy of a rectangular structure. Is called by
+the undo/redo stuff to undo/redo the rectangle copy operation.
+
+***************************************************************************/
+
+static
+struct selRecSt *DuplicateRectSt(char *block)
+{
+ if (!block)
+ return 0;
+
+ struct selRecSt *p=(struct selRecSt *)block;
+
+ int Width=p->Xr2-p->Xr1;
+ int Height=p->Yr2-p->Yr1+1;
+ unsigned size=(unsigned)Width*(unsigned)Height+sizeof(struct selRecSt);
+ struct selRecSt *auxR;
+
+ // Try to get the memory
+ auxR=(struct selRecSt *)(new char[size]);
+ memcpy(auxR,block,size);
+
+ return auxR;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts all the characters in the selected rectangle to upper case. Is
+a highlevel routine and is simple instead of fast. Side effect: tabs are
+converted to spaces.
+
+***************************************************************************/
+
+void TCEditor::selRectToUpper()
+{
+ if (isReadOnly) return;
+ flushLine();
+
+ selRectCopy();
+ selRectDelete(Xr1,Yr1,Xr2,Yr2);
+
+ unsigned size=(selRectClip->Xr2-selRectClip->Xr1)*(selRectClip->Yr2-selRectClip->Yr1+1);
+ char *s=selRectClip->s;
+ char *end=s+size;
+ for (; s<end; s++)
+ *s=TVCodePage::toUpper(*s);
+
+ selRectPaste(selRectClip,Xr1,Yr1);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts all the characters in the selected rectangle to lower case. Is
+a highlevel routine and is simple instead of fast. Side effect: tabs are
+converted to spaces.
+
+***************************************************************************/
+
+void TCEditor::selRectToLower()
+{
+ if (isReadOnly) return;
+ flushLine();
+
+ selRectCopy();
+ selRectDelete(Xr1,Yr1,Xr2,Yr2);
+
+ unsigned size=(selRectClip->Xr2-selRectClip->Xr1)*(selRectClip->Yr2-selRectClip->Yr1+1);
+ char *s=selRectClip->s;
+ char *end=s+size;
+ for (; s<end; s++)
+ *s=TVCodePage::toLower(*s);
+
+ selRectPaste(selRectClip,Xr1,Yr1);
+}
+
+/****************************************************************************
+
+ Function: Boolean selRectCopy()
+
+ Type: TCEditor member.
+
+ Objetive: Copy the selected rectangle into a buffer.
+
+ Returns: False on error.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::selRectCopy(Boolean allowUndo)
+{
+ // Avoid to be out of buffer
+ if ((unsigned)Yr2>totalLines)
+ Yr2=totalLines;
+
+ if (!hasRectSel())
+ return True;
+
+ int Width=Xr2-Xr1;
+ int Height=Yr2-Yr1+1;
+ unsigned size=(unsigned)Width*(unsigned)Height+sizeof(struct selRecSt);
+ struct selRecSt *auxR;
+
+ // Try to get the memory
+ if ((auxR=(struct selRecSt *)malloc(size))==0)
+ return False;
+
+ // A pointer to the buffer area
+ char *b=(char *)(auxR)+sizeof(struct selRecSt);
+
+ auxR->Xr1=Xr1;
+ auxR->Xr2=Xr2;
+ auxR->Yr1=Yr1;
+ auxR->Yr2=Yr2;
+
+ int y,x;
+ char *s=buffer+GetOffSetOffLine(Yr1);
+ char *sy=s;
+ int w;
+ char c=' ';
+ // Scan the lines inside the rectangle
+ for (y=Yr1; y<=Yr2; y++)
+ {
+ // Initialize vars
+ w=0; x=0;
+ s=sy;
+ // fill untill you reach the right side of the rect
+ while (x<Xr2)
+ {
+ // w is the width of the actual char
+ if (!w)
+ {
+ c=*s;
+ s++;
+ if (c=='\t')
+ { // the tabs don't have 1 char of width
+ w=tabSize-(x%tabSize);
+ c=' ';
+ }
+ else
+ if (c=='\r' || c==0 || c=='\n')
+ { // the end of line is like infinit blanks
+ w=MaxLineLen+1;
+ c=' ';
+ }
+ else
+ w=1; // The normal case
+ }
+ if (x>=Xr1)
+ { // If is inside the rect copy it
+ *b=c;
+ b++;
+ }
+ x++;
+ w--;
+ }
+ // Point to the next line.
+ sy+=lenLines[y];
+ }
+
+ // Store it when we have it finished
+ if (allowUndo)
+ addToUndo(undoRectCopy,auxR);
+ delete selRectClip;
+ selRectClip=auxR;
+ enableCommand(cmcSelRectPaste);
+
+ return True;
+}
+
+
+/****************************************************************************
+
+ Function: void EnsureXDontTab(char *s,int x,int w,char **stop)
+
+ Type: TCEditor member.
+
+ Objetive: Ensure that the zone x to x+w is free of tabs, if a tab is
+ found convert it to spaces.
+ This routine is very delicated and was made in an easy, but no fast,
+ way.
+
+ Notes:
+ canUndo must be False to avoid multiple undos.
+ Can't be called with a line under edition.
+
+ Parameters:
+ s: pointer to the start of the line.
+ x: x to start checking.
+ w: width of the region.
+ stop: returns from where the block delete must delete to eat all the extra
+ chars, is NULL is there is no need to delete anything.
+
+ Returns:
+ 0 process OK.
+ 1 end of line before the end of process.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::EnsureXDontTab(char *s,int x,int w,char **stop)
+{
+ int X=0;
+ int oldX=0;
+ char *lastUsed=s;
+
+ if (isReadOnly)
+ return 0;
+ while (X<x)
+ {
+ oldX=X;
+ AdvanceWithTab(*s,X);
+ if (!ucisspace(*s))
+ lastUsed=s;
+ s++;
+ if (!*s || *s=='\r' || *s=='\n')
+ {
+ *stop=NULL;
+ return 1;
+ }
+ }
+ *stop=s;
+ if (X!=x)
+ {
+ unsigned o=(unsigned)(s-buffer);
+ deleteRange(s-1,s,False);
+ insertSpaces(X-oldX,0,False);
+ s=buffer+o+x-oldX;
+ }
+ while (w--)
+ {
+ if (*s=='\t')
+ {
+ unsigned o=(unsigned)(s-buffer);
+ deleteRange(s,s+1,False);
+ insertSpaces(tabSize-(x%tabSize),0,False);
+ s=buffer+o;
+ }
+ if (!*s || *s=='\r' || *s=='\n')
+ {
+ *stop=lastUsed+1;
+ return 1;
+ }
+ s++;
+ x++;
+ }
+ return 0;
+}
+
+/****************************************************************************
+
+ Function: Boolean selRectPaste(struct selRecSt *st, int X, int Y)
+
+ Type: TCEditor member.
+
+ Objetive: Paste the previously copied rectangle.
+
+ Parameters:
+ st: The struct that contains the rectangle.
+ X,Y: The insertion point.
+
+ Returns: False on error.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::selRectPaste(struct selRecSt *st, int X, int Y, Boolean allowUndo)
+{
+ if (isReadOnly) return False;
+
+ int Width=st->Xr2-st->Xr1;
+ int Height=st->Yr2-st->Yr1+1;
+
+ if ((unsigned)(Y+Height)>totalLines)
+ {
+ editorDialog(edRectOutside);
+ return False;
+ }
+
+ // Filled by hand
+ struct UndoCell un;
+ if (allowUndo)
+ {
+ addToUndo(undoPreCopyInfo);
+ UndoSaveStartState(un);
+ }
+
+ if (X!=curPos.x || Y!=curPos.y)
+ MoveCursorTo(X,Y);
+
+ int y=Y;
+ char *b=st->s;
+ char *stop;
+ int cant;
+
+ if (allowUndo)
+ if (!FillUndoForRectangularPasteClear(Height,un,undoRectPaste))
+ return False;
+
+ Boolean oldCanUndo=canUndo;
+ canUndo=False;
+ while (Height--)
+ {
+ if (EnsureXDontTab(curLinePtr,X,0,&stop))
+ { // The insertion is outside of the real line, don't create extra spaces
+ char *sb=b,*sc=b;
+ int i=Width;
+ while (i--)
+ {
+ if (!ucisspace(*sb))
+ sc=sb+1;
+ sb++;
+ }
+ cant=(int)(sc-b);
+ }
+ else
+ cant=Width;
+ curPos.x=X;
+ if (cant)
+ insertBuffer(b,0,cant,False,False,False);
+ b+=Width;
+ curLinePtr+=lenLines[y];
+ y++;
+ curPos.y=y;
+ curPos.x=X;
+ }
+ Xr1=X;
+ Xr2=X+Width;
+ Yr1=Y;
+ Yr2=Y+st->Yr2-st->Yr1;
+ selRectHided=False;
+ MoveCursorTo(X,Y);
+ canUndo=oldCanUndo;
+ return True;
+}
+
+
+/****************************************************************************
+
+ Function: void UndoRectangularPasteClear(UndoCell &un)
+
+ Type: TCEditor member.
+
+ Objetive: Undoes the action made by a paste of a rectangle.
+ Is in a separated function because that's a relative complex undo (too
+ much variables).
+
+ Parameters:
+ un: The UndoCell information.
+
+ The information is stored in s with the following structure:
+ char [...] Buffer with the text affected (the length is in un.Length).
+ struct selRectSt of the current state
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::UndoRectangularPasteClear(UndoCell &un)
+{
+ char *s=un.s;
+ unsigned size=un.Length;
+ struct selRecSt *sr=(struct selRecSt *)(s+size);
+ int Y1=sr->Yr1;
+ int Y2=sr->Yr2;
+ unsigned Height=Y2-Y1+1;
+ Y1=sr->Ycur; // In the undo for Paste the cursor isn't in the selection
+
+ char *sLine=buffer+GetOffSetOffLine(Y1);
+ char *end_line=sLine;
+
+ // to end_line must be saved
+ int y=Y1;
+ while (Height--)
+ end_line+=lenLines[y++];
+
+ // Put away all the zone
+ deleteRange(sLine,end_line,False);
+ // Put in the original one
+ insertBuffer(s,0,size,False,False,False);
+
+ // Recreate the rectangular selection
+ Xr1=sr->Xr1;
+ Yr1=sr->Yr1;
+ Xr2=sr->Xr2;
+ Yr2=sr->Yr2;
+ selRectHided=sr->selHide;
+
+ MoveCursorTo(un.X,un.Y);
+}
+
+
+/****************************************************************************
+
+ Function: Boolean FillUndoForRectangularPasteClear(int Height,
+ struct UndoCell &un,UndoState st)
+
+ Type: TCEditor member.
+
+ Objetive: Fills the undo cell with the information necesary to undo a
+ Paste or a Clear of a rectangular area.
+
+ Parameters:
+ Height: of the rectangle.
+ un: The UndoCell.
+ st: to difference the paste from the Del.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::FillUndoForRectangularPasteClear(int Height,struct UndoCell &un,
+ UndoState st)
+{
+ // from curLinePtr
+ char *end_line=curLinePtr;
+ unsigned h=Height;
+ int y=curPos.y;
+ char *aux;
+
+ // to end_line must be saved
+ while (h--)
+ end_line+=lenLines[y++];
+
+ // Allocate memory for that
+ unsigned size=(unsigned)(end_line-curLinePtr);
+ unsigned sizer=sizeof(struct selRecSt);
+ aux=new char[size+sizer];
+ if (aux==NULL)
+ return False;
+
+ // Save the info of the actual rectangle
+ struct selRecSt stact;
+ stact.Xr1=Xr1;
+ stact.Yr1=Yr1;
+ stact.Xr2=Xr2;
+ stact.Yr2=Yr2;
+ stact.Ycur=curPos.y;
+ stact.selHide=selRectHided;
+
+ memcpy(aux,curLinePtr,size);
+ memcpy(aux+size,&stact,sizer);
+
+ un.s=aux;
+ un.Type=st;
+ un.Length=size;
+
+ addToUndo(undoPostCopyInfo,&un);
+ return True;
+}
+
+
+/****************************************************************************
+
+ Function: Boolean FillUndoForRectangularStartEnd(UndoState st)
+
+ Type: TCEditor member.
+
+ Objetive: Adds to the undo the info for start and end of rectangular
+ selection.
+
+ Parameters:
+ st: to difference the start from the end.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::FillUndoForRectangularStartEnd(UndoState st)
+{
+ struct selRecSt *stact=new selRecSt;
+
+ if (stact==NULL)
+ return False;
+
+ if (st==undoRectStart)
+ {
+ stact->Xr1=Xr1;
+ stact->Yr1=Yr1;
+ stact->Xr2=curPos.x;
+ stact->Yr2=curPos.y;
+ }
+ else
+ {
+ stact->Xr1=curPos.x;
+ stact->Yr1=curPos.y;
+ stact->Xr2=Xr2;
+ stact->Yr2=Yr2;
+ }
+ stact->selHide=selRectHided;
+
+ addToUndo(st,stact);
+ return True;
+}
+
+
+/****************************************************************************
+
+ Function: Boolean selRectDelete(int X1, int Y1, int X2, int Y2)
+
+ Type: TCEditor member.
+
+ Objetive: Deletes (Clear) the specified rectangle.
+
+ Parameters:
+ X1,Y1: Top left.
+ X2,Y2: Bottom right.
+
+ Returns: False on error.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::selRectDelete(int X1, int Y1, int X2, int Y2, Boolean allowUndo)
+{
+ if (isReadOnly) return False;
+ int Width=X2-X1;
+ int Height=Y2-Y1+1;
+
+ // Filled by hand
+ struct UndoCell un;
+
+ if (allowUndo)
+ {
+ addToUndo(undoPreCopyInfo);
+ UndoSaveStartState(un);
+ }
+
+ if (X1!=curPos.x || Y1!=curPos.y)
+ {
+ MoveCursorTo(X1,Y1);
+ if (curPos.y<delta.y)
+ {
+ trackCursor(True);
+ AdjustDrawPtr(); // because we will modify the rest of the lines
+ }
+ }
+
+ if (allowUndo)
+ if (!FillUndoForRectangularPasteClear(Height,un,undoRectDel))
+ return False;
+
+ char *stop;
+
+ while (Height--)
+ {
+ if (EnsureXDontTab(curLinePtr,X1,Width,&stop))
+ {
+ if (stop!=NULL && CLY_IsntEOL(*stop)) // If stop==NULL nothing to do
+ { // Delete from stop to the end of the line
+ deleteRange(stop,curLinePtr+LenWithoutCRLF(curPos.y,curLinePtr),False);
+ }
+ }
+ else
+ {
+ deleteRange(stop,stop+Width,False);
+ }
+ curLinePtr+=lenLines[curPos.y++];
+ }
+ MoveCursorTo(X1,Y1);
+ selRectHided=True;
+ return True;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Compact the Boolean flags of the editor into a word.
+
+ Return:
+ The compacted word.
+
+***************************************************************************/
+
+uint32 TCEditor::CompactFlags(void)
+{
+ uint32 t=0;
+ if (overwrite) t|=loOverwrite;
+ if (autoIndent) t|=loAutoIndent;
+ if (UseTabs) t|=loUseTabs;
+ if (PersistentBlocks) t|=loPersistentBlocks;
+ if (intelIndent) t|=loIntelIndent;
+ if (CrossCursorInCol) t|=loCrossCursorInCol;
+ if (CrossCursorInRow) t|=loCrossCursorInRow;
+ if (ShowMatchPair) t|=loShowMatchPair;
+ if (ShowMatchPairFly) t|=loShowMatchPairFly;
+ if (ShowMatchPairNow) t|=loShowMatchPairNow;
+ if (TransparentSel) t|=loTransparentSel;
+ if (OptimalFill) t|=loOptimalFill;
+ if (WrapLine) t|=loWrapLine;
+ if (SeeTabs) t|=loSeeTabs;
+ if (NoInsideTabs) t|=loNoInsideTabs;
+ if (TabIndents) t|=loTabIndents;
+ if (UseIndentSize) t|=loUseIndentSize;
+ if (DontPurgeSpaces) t|=loDontPurgeSpaces;
+ if (BackSpUnindents) t|=loBackSpUnindents;
+ if (ColumnMarkers) t|=loColumnMarkers;
+
+ return t;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Expand a word to the Boolean flags.
+
+***************************************************************************/
+
+void TCEditor::ExpandFlags(uint32 t, Boolean allowUndo)
+{
+ if (overwrite!=((t & loOverwrite) ? True : False))
+ toggleInsMode(allowUndo);
+ autoIndent = (t & loAutoIndent) ? True : False;
+ UseTabs = (t & loUseTabs) ? True : False;
+ PersistentBlocks = (t & loPersistentBlocks) ? True : False;
+ intelIndent = (t & loIntelIndent) ? True : False;
+ CrossCursorInCol = (t & loCrossCursorInCol) ? True : False;
+ CrossCursorInRow = (t & loCrossCursorInRow) ? True : False;
+ ShowMatchPair = (t & loShowMatchPair) ? True : False;
+ ShowMatchPairFly = (t & loShowMatchPairFly) ? True : False;
+ ShowMatchPairNow = (t & loShowMatchPairNow) ? True : False;
+ TransparentSel = (t & loTransparentSel) ? True : False;
+ OptimalFill = (t & loOptimalFill) ? True : False;
+ WrapLine = (t & loWrapLine) ? True : False;
+ SeeTabs = (t & loSeeTabs) ? True : False;
+ NoInsideTabs = (t & loNoInsideTabs) ? True : False;
+ TabIndents = (t & loTabIndents) ? True : False;
+ UseIndentSize = (t & loUseIndentSize) ? True : False;
+ DontPurgeSpaces = (t & loDontPurgeSpaces) ? True : False;
+ BackSpUnindents = (t & loBackSpUnindents) ? True : False;
+ ColumnMarkers = (t & loColumnMarkers) ? True : False;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the cursor position to the start of the buffer. Is called when you
+modified the whole buffer and want to recalculate the shl attributes, line
+lengths, etc.
+
+***************************************************************************/
+
+void TCEditor::ResetCursorPosition(void)
+{
+ buffer[bufLen]=0;
+ RecalculateLineAttributes();
+ curLinePtr=buffer;
+ curPos.x=curPos.y=0;
+ selStart=selEnd=0;
+ drawLine=drawPtr=0;
+ MarkAsModified();
+}
+
+/****************************************************************************
+
+ Function: void ExpandAllTabs(void)
+
+ Type: TCEditor member.
+
+ Objetive: Convert all the tabs in the file to spaces.
+ The function uses a temporal file to expand the buffer, after the
+ operation the cursor is positioned at the top of the file, the selection
+ is cleaned and the lenLines array is updated.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::ExpandAllTabs(Boolean interactive)
+{
+ char *s,*end;
+ int x,aux;
+ long l;
+ FILE *f;
+
+ if (isReadOnly)
+ return;
+ if (interactive && editorDialog(edActionWOUndo)!=cmYes)
+ return;
+
+ char *n=unique_name("tb");
+ if (!n)
+ {
+ editorDialog(edCreateTMPError);
+ return;
+ }
+ flushLine();
+ f=fopen(n,"w+b");
+ if (f)
+ {
+ end=buffer+bufLen;
+ for (s=buffer,x=0; s<end; s++)
+ {
+ if (*s=='\t')
+ {
+ aux=tabSize-(x%tabSize);
+ x+=aux;
+ while (aux--)
+ putc(' ',f);
+ }
+ else
+ {
+ putc(*s,f);
+ if (*s=='\n')
+ x=0;
+ else
+ x++;
+ }
+ }
+ l=ftell(f);
+ if (!ferror(f))
+ {
+ if ((uint32)l!=bufLen && setBufSize((uint32)l+1))
+ {
+ rewind(f);
+ fread(buffer,(size_t)l,1,f);
+ if (!ferror(f))
+ {
+ bufLen=(uint32)l;
+ ResetCursorPosition();
+ flushUndoInfo();
+ update(ufView);
+ }
+ }
+ }
+ fclose(f);
+ remove(n);
+ }
+ free(n);
+}
+
+
+/****************************************************************************
+
+ Function: void CompactBuffer(void)
+
+ Type: TCEditor member.
+
+ Objetive: Compact the buffer using tabs to get a smaller file.
+
+ Modified to let the comments and strings untouched as NIK pointed.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::CompactBuffer(Boolean interactive)
+{
+ int y,x,x1,x2;
+ char *s,*r,*end;
+ int inString=0,inComment=0,inCppComment;
+ int /*extString=0,*/extCppComment=0;
+
+ if (isReadOnly)
+ return;
+ if (interactive && editorDialog(edActionWOUndo)!=cmYes)
+ return;
+
+ if (IslineInEdition) // I forgot it and I saw it with a report of Leon
+ MakeEfectiveLineInEdition();
+
+ end=buffer+bufLen;
+ for (y=0, s=r=buffer; y<=(int)totalLines; y++)
+ {
+ x=0;
+ //inString=extString;
+ inCppComment=extCppComment;
+ //extString=0;
+ extCppComment=0;
+ while (*s!='\n' && s<end)
+ {
+ if (*s==' ' && !inString && !inComment && !inCppComment)
+ {
+ x1=x;
+ while (*s==' ')
+ {
+ x++;
+ s++;
+ }
+ while (x1<x)
+ {
+ x2=NextTabPos(x1);
+ if (x2<=x && x2-x1>1)
+ {
+ *r='\t';
+ r++;
+ x1=x2;
+ }
+ else
+ {
+ while (x1<x2 && x1<x)
+ {
+ *r=' ';
+ r++;
+ x1++;
+ }
+ }
+ }
+ }
+ else
+ {
+ while ((*s!=' ' || inComment || inString || inCppComment) && *s!='\n' && s<end)
+ {
+ switch (*s)
+ {
+ case '\"':
+ if (!inComment && !inCppComment)
+ inString=!inString;
+ break;
+
+ case '/':
+ if (!inComment && !inString && !inCppComment)
+ {
+ *r=*s; x++; s++; r++;
+ if (*s=='*')
+ inComment=1;
+ else
+ if (*s=='/')
+ inCppComment=1;
+ }
+ break;
+
+ case '*':
+ if (inComment)
+ {
+ if (*(s+1)=='/')
+ {
+ *r=*s; x++; s++; r++;
+ inComment=0;
+ }
+ }
+ break;
+
+ case '\\':
+ if (inString)
+ { // Just skip one char
+ *r=*s; x++; s++; r++;
+ //if (*s=='\r' || *s=='\n') The strings are extended automatically
+ // extString=1;
+ }
+ else
+ if (inCppComment)
+ { // Skip & test for extention
+ *r=*s; x++; s++; r++;
+ if (*s=='\r' || *s=='\n')
+ extCppComment=1;
+ }
+ break;
+ }
+ AdvanceWithTab(*s,x);
+ *r=*s;
+ s++; r++;
+ }
+ }
+ }
+ if (s<end)
+ {
+ *r=*s;
+ s++; r++;
+ }
+ }
+ if ((unsigned)(r-buffer)!=bufLen) // Any modification
+ {
+ bufLen=(uint32)(r-buffer);
+ ResetCursorPosition();
+ flushUndoInfo();
+ update(ufView);
+ }
+}
+
+
+/**[txh]********************************************************************
+
+ Description: Implements cmcSmartTab, that's the behavior of the TAB key
+in the editor.
+
+***************************************************************************/
+
+void TCEditor::SmartTab()
+{
+ if (isReadOnly)
+ return;
+
+ lock();
+ CutIfNotPersistent();
+ if (!IslineInEdition)
+ EditLine();
+ if (IslineInEdition)
+ {
+ if (UseTabs)
+ InsertCharInLine('\t');
+ // Tab in indent mode
+ else
+ {
+ int X;
+ if (TabIndents)
+ {
+ int Xact=curPos.x;
+ X=0;
+ if (curPos.y>0)
+ { // Search a hole in the last line
+ char *s=curLinePtr-lenLines[curPos.y-1];
+
+ do
+ {
+ for (;CLY_IsntEOL(*s) && !ucisspace(*s); s++) // While letters
+ { AdvanceWithTab(*s,X); }
+ for (;CLY_IsntEOL(*s) && ucisspace(*s); s++) // While spaces
+ { AdvanceWithTab(*s,X); }
+ }
+ while (CLY_IsntEOL(*s) && X<=Xact); // to a mayor X or the end of line
+ if (X>Xact)
+ X-=Xact;
+ else
+ X=NextTabPos(Xact)-Xact;
+ }
+ else
+ X=NextTabPos(Xact)-Xact;
+ }
+ else
+ {
+ int Xact=curPos.x;
+ if (UseIndentSize)
+ X=NextIndentPos(Xact)-Xact;
+ else
+ X=NextTabPos(Xact)-Xact;
+ }
+ for (;X;--X) InsertCharInLine(' ');
+ }
+ update(ufLine);
+ if (ShowMatchPairFly && ShowMatchPairNow)
+ SearchMatchOnTheFly();
+ }
+ unlock();
+}
+
+/**[txh]********************************************************************
+
+ Description: Insert a char in the edited line. Keeps track of:
+ 1) The selected text.
+ 2) The markers.
+ 3) The overwrite mode.
+ 4) The undo.
+ @var{cVal} is the char to insert.
+
+***************************************************************************/
+
+void TCEditor::InsertCharInLine(char cVal, Boolean allowUndo)
+{
+ if (!IslineInEdition)
+ return;
+
+ if (overwrite)
+ {
+ char vals[2];
+ if (allowUndo)
+ {
+ vals[0]=cVal;
+ vals[1]=*inEditPtr;
+ // Don't add to the undo yet, we could need a move
+ lockUndo();
+ }
+
+ if (*inEditPtr)
+ {
+ if (*inEditPtr=='\t') // Is over a Tab?
+ {
+ if (allowUndo)
+ addToUndo(undoInMov);
+ curPos.x=LineWidth(bufEdit,inEditPtr);
+ }
+ *inEditPtr++=cVal;
+ restCharsInLine--; // Why?!, if we advance a char we have one less in the line
+ //return;
+ }
+ else
+ { // At the end of line
+ if (AdjustBufEditFor((int)(inEditPtr-bufEdit+1)))
+ return;
+ *inEditPtr++=cVal;
+ *inEditPtr=0;
+ }
+ if (allowUndo)
+ {
+ addToUndo(undoOvrPutChar,(void *)&vals[0]);
+ unlockUndo();
+ }
+ }
+ else
+ {
+ unsigned PosOfIns=(unsigned)(inEditPtr-bufEdit);
+
+ if (allowUndo)
+ addToUndo(undoPutChar,(void *)&cVal);
+
+ if (AdjustBufEditFor((int)(inEditPtr-bufEdit+restCharsInLine+1)))
+ return;
+ if (*inEditPtr)
+ {
+ if (*inEditPtr=='\t') // Is over a Tab?
+ curPos.x=LineWidth(bufEdit,inEditPtr);
+ memmove(inEditPtr+1,inEditPtr,restCharsInLine+1);
+ *inEditPtr++=cVal;
+ }
+ else
+ { // At the end of line
+ *inEditPtr++=cVal;
+ *inEditPtr=0;
+ }
+
+ // Update the markers
+ for (int i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0 && (unsigned)Pos>=PosOfIns)
+ MarkersInLine[i]++;
+ }
+
+ AdjustLineSel((uint32)(inEditPtr-bufEdit-1),1);
+ }
+ AdvanceWithTab(cVal,curPos.x);
+ // Move the screen if the position is outside
+ if ((delta.x+size.x-1)<curPos.x)
+ {
+ delta.x=curPos.x-size.x+8;
+ // Adjust the limit or the scroll bar will neutralize the increment
+ if (limit.x<delta.x+size.x)
+ limit.x=delta.x+size.x;
+ update(ufView);
+ }
+ if (curPos.x<delta.x || curPos.y>=delta.y+size.y || curPos.y<delta.y)
+ trackCursor(True);
+ // If the character is outside the limit adjust it
+ if (curPos.x>=limit.x)
+ limit.x=curPos.x+1;
+
+ if (WrapLine && !ucisspace(cVal) && curPos.x>=WrapCol)
+ {
+ // Go back in the line searching a gap
+ char *s=inEditPtr;
+ while (!ucisspace(*s) && s>bufEdit) s--;
+ if (s!=bufEdit)
+ { // If found
+ // Calculate how many spaces before
+ int dif=inEditPtr-s-1;
+ // Flush the line
+ MakeEfectiveLineInEdition();
+ // Move back
+ addToUndo(undoInMov);
+ GotoOffSet(ColToPointer()-buffer-dif);
+ // Insert a CR
+ insertText(CLY_crlf,CLY_LenEOL,False);
+ // Go to the correct position
+ addToUndo(undoInMov);
+ GotoOffSet(ColToPointer()-buffer+dif);
+ // Make it visible if the screen scrolled
+ trackCursor(False);
+ delta.x = 0;
+ update(ufView);
+ }
+ }
+ MarkAsModified();
+ // This must be *after* the wrap because:
+ // 1) Can flush the line and it complicates the wrap.
+ // 2) The pair could be moved.
+ // Also after the MarkAsModified because of ufHLChar
+ if (ShowMatchPair && cVal && strchr("{}()[]",cVal))
+ {
+ int pos=-2;
+
+ flushLine();
+ switch (cVal)
+ {
+ case '}':
+ pos=SearchOpenSymbolXY('{','}',XHLCC,YHLCC);
+ break;
+ case ')':
+ pos=SearchOpenSymbolXY('(',')',XHLCC,YHLCC);
+ break;
+ case ']':
+ pos=SearchOpenSymbolXY('[',']',XHLCC,YHLCC);
+ break;
+ case '{':
+ pos=SearchCloseSymbolXY('{','}',XHLCC,YHLCC);
+ break;
+ case '(':
+ pos=SearchCloseSymbolXY('(',')',XHLCC,YHLCC);
+ break;
+ case '[':
+ pos=SearchCloseSymbolXY('[',']',XHLCC,YHLCC);
+ break;
+ }
+ if (pos!=-2)
+ {
+ if (pos==-1)
+ {
+ char *s=TVIntl::getTextNew(__("No match found"));
+ setStatusLine(s);
+ DeleteArray(s);
+ }
+ else
+ {
+ int y=YHLCC-delta.y;
+ int x=XHLCC-delta.x;
+ XHLCO=curPos.x-1;
+ YHLCO=curPos.y;
+ if (x>=0 && x<size.x && y>=0 && y<size.y)
+ update(ufHLChar);
+ else
+ {
+ char bufaux[80];
+ char *fmt=TVIntl::getTextNew(__("Match found at line %d column %d."));
+ CLY_snprintf(bufaux,80,fmt,YHLCC+1,XHLCC+1);
+ DeleteArray(fmt);
+ setStatusLine(bufaux);
+ }
+ }
+ }
+ }
+}
+
+/****************************************************************************
+
+ Function: void AdjustLineSel(uint32 pos,int dif)
+
+ Type: TCEditor member.
+
+ Objetive: Adjusts the selLineStart, selNewStart, selLineEnd and selNewEnd
+ vars when is needed.
+
+ Parameters:
+ pos: Position of the modification.
+ dif: Difference of length.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::AdjustLineSel(uint32 pos,int dif, Boolean IncludeStart, Boolean toLeft)
+{
+ if (selNewStart<selNewEnd)
+ {
+ int CondStart,CondEnd;
+ if (IncludeStart)
+ {
+ CondStart=pos<=selLineStart;
+ CondEnd=pos<=selLineEnd;
+ }
+ else
+ {
+ CondStart=pos<selLineStart;
+ CondEnd=pos<selLineEnd;
+ }
+
+ if (CondStart)
+ {
+ selLineStart+=dif; selNewStart+=dif;
+ selLineEnd+=dif; selNewEnd+=dif;
+ }
+ else
+ if (CondEnd)
+ {
+ selLineEnd+=dif;
+ selNewEnd+=dif;
+ // If we are deleting characters to left we can delete the point that's the
+ // start of the selection and that's must be taked in count.
+ if (toLeft)
+ {
+ int difSt=pos-selLineStart+dif;
+ if (dif<0 && difSt<0)
+ {
+ selLineStart+=difSt;
+ selNewStart+=difSt;
+ }
+ }
+ }
+ else
+ {
+ // If we are deleting characters to left we can enter inside the selection
+ // even when pos isn't inside.
+ if (toLeft)
+ {
+ int difSt=pos-selLineEnd+dif;
+ if (dif<0 && difSt<0)
+ {
+ selLineEnd+=difSt;
+ selNewEnd+=difSt;
+ }
+ }
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is a helper function for routines that damages a block of text like
+BlockToUpper. It fills the undo info.
+
+***************************************************************************/
+
+void TCEditor::BlockUndoInfoStartFill(UndoCell &un, UndoState type,
+ char *start, char *end)
+{
+ addToUndo(undoPreCopyInfo);
+ UndoSaveStartState(un);
+ un.Type=type;
+ int l=(int)(end-start);
+ un.Length=l;
+ un.s=new char[l];
+ memcpy(un.s,start,l);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This is a helper function for routines that damages a block of text like
+BlockToUpper. It commits the undo info.
+
+***************************************************************************/
+
+void TCEditor::BlockUndoInfoEndFill(UndoCell &un)
+{
+ UndoSaveFinalState(un);
+ addToUndo(undoPostCopyInfo,&un);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts all the characters of the selected block to uppercase.
+
+***************************************************************************/
+
+void TCEditor::BlockToUpper(Boolean allowUndo)
+{
+ BlockCaseChange(undoToUpper,allowUndo);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts all the characters of the selected block to lowercase.
+
+***************************************************************************/
+
+void TCEditor::BlockToLower(Boolean allowUndo)
+{
+ BlockCaseChange(undoToLower,allowUndo);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Changes lowercase characters into uppercase characters and viceversa.
+
+***************************************************************************/
+
+void TCEditor::BlockInvertCase(Boolean allowUndo)
+{
+ BlockCaseChange(undoInvertCase,allowUndo);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Alternate characters, one uppercase and the next lowercase.
+
+***************************************************************************/
+
+void TCEditor::BlockAltCase(Boolean allowUndo)
+{
+ BlockCaseChange(undoAltCase,allowUndo);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts all the characters of the selected block to a desired *case.
+Is the base for other routines like BlockToLower and BlockToUpper.
+
+***************************************************************************/
+
+void TCEditor::BlockCaseChange(UndoState action, Boolean allowUndo)
+{
+ int ff;
+ if (isReadOnly) return;
+ if (hasSelection() && !selHided)
+ {
+ flushLine();
+ char *s=buffer+selStart;
+ char *end=buffer+selEnd;
+
+ // Save all the undo info
+ UndoCell un;
+ if (allowUndo)
+ BlockUndoInfoStartFill(un,action,s,end);
+
+ switch (action)
+ {
+ case undoToLower:
+ for (; s<end; s++)
+ *s=TVCodePage::toLower(*s);
+ break;
+ case undoToUpper:
+ for (; s<end; s++)
+ *s=TVCodePage::toUpper(*s);
+ break;
+ case undoInvertCase:
+ for (; s<end; s++)
+ if (TVCodePage::isLower(*s))
+ *s=TVCodePage::toUpper(*s);
+ else
+ *s=TVCodePage::toLower(*s);
+ break;
+ case undoAltCase:
+ ff=0;
+ for (; s<end; s++)
+ if (TVCodePage::isAlpha(*s))
+ {
+ if (ff & 1)
+ *s=TVCodePage::toLower(*s);
+ else
+ *s=TVCodePage::toUpper(*s);
+ ff++;
+ }
+ break;
+ default:
+ return;
+ }
+ MarkAsModified();
+
+ // Add the undo info to the array
+ if (allowUndo)
+ BlockUndoInfoEndFill(un);
+
+ update(ufView);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Changes the case of the char under cursor. High level. 0=lower, 1=upper
+and 2=toggle.
+
+***************************************************************************/
+
+void TCEditor::SetCharCase(int option)
+{
+ if (isReadOnly) return;
+ flushLine();
+ int dif;
+ char *s=ColToPointer(dif);
+ if (dif) // Only if over a char
+ return;
+ uchar upper=TVCodePage::toUpper(*s);
+ uchar lower=TVCodePage::toLower(*s),result;
+ switch (option)
+ {
+ case 0:
+ result=lower;
+ break;
+ case 1:
+ result=upper;
+ break;
+ default:
+ result=(*s==upper) ? lower : upper;
+ }
+ if (result!=0xFF && result && result==*s) // If no change needed just advance & return
+ {
+ handleCommand(cmcCharRight);
+ return;
+ }
+ deleteRange(s,s+1);
+ insertBuffer((char *)&result,0,1,True,False,False);
+}
+
+/****************************************************************************
+
+ Function: int SearchOpenSymbol(char open, char close)
+
+ Type: TCEditor member.
+
+ Objetive: Search the offset of the { where the cursor is.
+
+ Parameters:
+ open: ASCII of the open.
+ close: ASCII of the close.
+
+ Return: The offset or -1 if the cursor isn't inside a {}.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::SearchOpenSymbol(char open, char close)
+{
+ char *s=ColToPointer();
+ char *start=curLinePtr;
+ int y=curPos.y;
+ return SearchOpenSymbol(open,close,s,start,y);
+}
+
+int TCEditor::SearchOpenSymbol(char open, char close, char *s, char *&start,
+ int &y)
+{
+ unsigned Count=1;
+ uint32 extraStart=SyntaxHighlightExtraFor(start,s,y);
+
+ while (s!=buffer)
+ {
+ if (*--s==open)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(start,s,y);
+ if (extraStart==extraEnd && !--Count)
+ return (int)(s-buffer);
+ }
+ else
+ {
+ if (*s==close)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(start,s,y);
+ if (extraStart==extraEnd)
+ Count++;
+ }
+ else
+ if (*s=='\n')
+ {
+ y--;
+ if (y>=0)
+ start-=lenLines[y];
+ }
+ }
+ }
+ return -1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Search the offset, X and Y of the match pair for open indicated by close.@*
+ Parameters:@*
+ open: ASCII of the open.@*
+ close: ASCII of the close.@*
+ X,Y: Coordinates of the match.@*
+ pos: [Optional] value returned by ColToPointer(). It avoids recalculating
+this value.@*
+
+ Return:
+ The offset or -1 if the cursor isn't inside a {}.
+
+***************************************************************************/
+
+int TCEditor::SearchOpenSymbolXY(char open, char close, int &X, int &Y, char *pos)
+{
+ unsigned Count=1;
+ char *s=pos ? pos : ColToPointer(),*start=curLinePtr;
+
+ if (s==buffer)
+ return -1;
+
+ // Compute the SHL for this char
+ uint32 extraStart=SyntaxHighlightExtraFor(start,s,curPos.y);
+
+ s--;
+ Y=curPos.y;
+ X=0;
+ while (s>buffer)
+ {
+ s--;
+ if (*s==open)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(start,s,Y);
+ if (extraEnd==extraStart && !--Count)
+ {
+ while (start!=s)
+ {
+ AdvanceWithTab(*start,X);
+ start++;
+ }
+ return (int)(s-buffer);
+ }
+ }
+ else
+ {
+ if (*s==close)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(start,s,Y);
+ if (extraEnd==extraStart) Count++;
+ }
+ else
+ {
+ if (*s=='\n')
+ {
+ Y--;
+ if (Y>=0)
+ start-=lenLines[Y];
+ }
+ }
+ }
+ }
+ return -1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Search the offset of the } where the cursor is.@*
+ Parameters:@*
+ open: ASCII of the open.@*
+ close: ASCII of the close.@*
+
+ Return:
+ The offset or -1 if the cursor isn't inside a {}.
+
+***************************************************************************/
+
+int TCEditor::SearchCloseSymbolXY(char open, char close, int &X, int &Y, char *pos)
+{
+ unsigned Count=1;
+ char *s=pos ? pos : ColToPointer();
+ char *end=buffer+bufLen,*lastl;
+
+ X=0;
+ Y=curPos.y;
+ lastl=curLinePtr;
+
+ // Compute the SHL for this char
+ uint32 extraStart=SyntaxHighlightExtraFor(lastl,s,Y);
+
+ if (s!=end)
+ {
+ while (s!=end)
+ {
+ if (*s==close)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(lastl,s,Y);
+ if (extraEnd==extraStart && !--Count)
+ {
+ while (lastl!=s)
+ {
+ AdvanceWithTab(*lastl,X);
+ lastl++;
+ }
+ return (int)(s-buffer);
+ }
+ }
+ else
+ {
+ if (*s==open)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(lastl,s,Y);
+ if (extraEnd==extraStart) Count++;
+ }
+ else
+ if (*s=='\n')
+ {
+ Y++;
+ lastl=s+1;
+ }
+ }
+ s++;
+ }
+ }
+ return -1;
+}
+
+/****************************************************************************
+
+ Function: int SearchCloseSymbol(char open, char close)
+
+ Type: TCEditor member.
+
+ Objetive: Search the offset of the } where the cursor is.
+
+ Parameters:
+ open: ASCII of the open.
+ close: ASCII of the close.
+
+ Return: The offset or -1 if the cursor isn't inside a {}.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::SearchCloseSymbol(char open, char close)
+{
+ int dif;
+ char *s=ColToPointer(dif);
+ char *lastl=curLinePtr;
+ int y=curPos.y;
+ return SearchCloseSymbol(open,close,s,lastl,y,dif);
+}
+
+int TCEditor::SearchCloseSymbol(char open, char close, char *s, char *lastl,
+ int y, int dif)
+{
+ unsigned Count=1;
+ char *end=buffer+bufLen;
+ // Compute the SHL for this char
+ uint32 extraStart=SyntaxHighlightExtraFor(lastl,s,y);
+
+ if (s!=end)
+ {
+ // If the cursor is in a Tab check the first char
+ if (dif<=0) s++;
+ while (s!=end)
+ {
+ if (*s==close)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(lastl,s,y);
+ if (extraEnd==extraStart && !--Count)
+ return (int)(s-buffer);
+ }
+ else
+ {
+ if (*s==open)
+ {
+ uint32 extraEnd=SyntaxHighlightExtraFor(lastl,s,y);
+ if (extraEnd==extraStart) Count++;
+ }
+ else
+ if (*s=='\n')
+ {
+ y++;
+ lastl=s+1;
+ }
+ }
+ s++;
+ }
+ }
+ return -1;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Put the line in edition inside the buffer.
+
+***************************************************************************/
+
+void TCEditor::MakeEfectiveLineInEdition(Boolean allowUndo)
+{
+ int actual,lastChar;
+ int SpacesEated;
+ char *s;
+
+ if (DontPurgeSpaces || !allowUndo) // Undo or user option
+ {
+ for (s=bufEdit,lastChar=0; *s; s++)
+ lastChar++;
+ actual=lastChar;
+ SpacesEated=0;
+ }
+ else
+ {
+ int lastCol=0, auxCol=0;
+ for (s=bufEdit,actual=lastChar=0; *s; s++)
+ {
+ lastChar++;
+ AdvanceWithTab(*s,auxCol);
+ if (*s!='\t' && *s!=' ')
+ {
+ actual=lastChar;
+ lastCol=auxCol;
+ }
+ }
+ SpacesEated=lastChar-actual;
+ #ifndef DISABLE_AUTOSP_PATCH
+ if (SpacesEated)
+ {
+ addToUndo(undoPreDelete,bufEdit+actual);
+ addToUndo(undoDeleteBuf,bufEdit+lastChar);
+ UndoArray[UndoActual].s2.OffSet=(curLinePtr-buffer)+actual;
+ }
+ #endif
+ // In case we are killing tabs and they are visible
+ if (SpacesEated)
+ {
+ if (SeeTabs)
+ update(ufView); // Not just the line, we are leaving it!
+ if (selLineEnd>0)
+ // Use the position we had before eating!
+ AdjustLineSel(lastChar,-SpacesEated);
+ }
+ }
+ #ifdef CLY_UseCrLf
+ bufEdit[actual++]='\r';
+ #endif
+ bufEdit[actual++]='\n';
+ bufEdit[actual]=0;
+
+ int old=lenLines[lineInEdition];
+ int dif=actual-old;
+
+ if (actual>old)
+ {
+ if (bufSize<bufLen+dif)
+ setBufSize(bufLen+dif);
+ }
+ if (actual!=old)
+ memmove(curLinePtr+actual,curLinePtr+old,(size_t)(bufLen-(curLinePtr+old-buffer)));
+
+ unsigned curLineOff=(unsigned)(curLinePtr-buffer);
+ if (selNewStart!=selStart || selNewEnd!=selEnd)
+ {
+ selStart=selNewStart;
+ selEnd=selNewEnd;
+ updateFlags|=ufView;
+ }
+
+ // Translate the markers
+ for (int i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0) // It's in this line
+ Markers[i]=Pos+curLineOff;
+ else
+ {
+ Pos=Markers[i];
+ if ((unsigned)Pos>curLineOff) // It's beyond this line
+ Markers[i]+=dif;
+ }
+ }
+
+ memcpy(curLinePtr,bufEdit,actual);
+
+ IslineInEdition=False;
+ lenLines.setAll(lineInEdition,actual,attrInEdit);
+ bufLen+=dif;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Ensures that pmacros for the current syntax are loaded.
+
+ Return: NULL if no SHL, the current strSHL otherwise.
+
+***************************************************************************/
+
+struct strSHL *TCEditor::LoadPMForCurSHL()
+{
+ struct strSHL *s=NULL;
+
+ // Check if a SHL is used
+ if (SHLValueSelected>=0 && SHLArray)
+ {
+ s=&SHLArray[SHLValueSelected];
+ // Check if the pmacros is loaded
+ if (!s->PM)
+ { // Now if not loaded check if a name was provided
+ if (s->PMacros)
+ {
+ s->PM=new TPMCollection(32,8);
+ LoadPseudoMacroFile(ExpandFileNameToThePointWhereTheProgramWasLoaded(s->PMacros),*(s->PM));
+ }
+ }
+ }
+ return s;
+}
+
+typedef struct
+{
+ char match;
+ TStringCollection *col;
+ size_t len;
+} stAddMatchPM;
+
+static
+void AddMatchPM(void *item, void *data)
+{
+ PMacroStr *pm=(PMacroStr *)item;
+ stAddMatchPM *st=(stAddMatchPM *)data;
+
+ if (!st->match || pm->trigger[0]==st->match)
+ {
+ if (pm->name)
+ {
+ size_t len=strlen(pm->name);
+ st->col->insert(pm->name);
+ if (len>st->len)
+ st->len=len;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It searchs a trigger in the PMColl pmacros collection. If isn't there it
+tries to search in the TPMacrosCollection of the actual syntax highlight.
+Additionally if the file isn't loaded it loads the file.
+
+ Return:
+ A void * to the PMacroStr if found or 0 if not.
+
+***************************************************************************/
+
+void *TCEditor::SearchPMTrigger(char *trg)
+{
+ void *ret=NULL;
+ struct strSHL *s=NULL;
+ ccIndex pos;
+
+ if (trg[0] && trg[1])
+ {
+ // Search in the global list
+ if (PMColl->search(trg,pos))
+ ret=PMColl->at(pos);
+ else
+ {// If not try in the language specific list
+ s=LoadPMForCurSHL();
+ if (s && s->PM && s->PM->search(trg,pos))
+ ret=s->PM->at(pos);
+ }
+ if (ret)
+ return ret;
+ }
+ if (!s)
+ s=LoadPMForCurSHL();
+
+ if (trg[0])
+ {// Try to find all the pmacros with the first char
+ stAddMatchPM stM;
+ stM.match=trg[0];
+ stM.col=new TNoCaseStringCollection(10,4);
+ stM.len=0;
+ PMColl->forEach(AddMatchPM,&stM);
+ if (s && s->PM)
+ s->PM->forEach(AddMatchPM,&stM);
+ // Found any?
+ int count=stM.col->getCount();
+ if (count)
+ {
+ char *res=CompletionChooseFromList(stM.col,count,stM.len,cursor.x+owner->origin.x,
+ cursor.y+owner->origin.y+1,0,0,False);
+ if (res)
+ {
+ ret=PMColl->searchByNamePointer(res);
+ if (!ret && s && s->PM)
+ ret=s->PM->searchByNamePointer(res);
+ }
+ }
+ delete stM.col;
+ if (ret)
+ return ret;
+ }
+
+ // Show all
+ stAddMatchPM stM;
+ stM.match=0;
+ stM.col=new TNoCaseStringCollection(10,4);
+ stM.len=0;
+ PMColl->forEach(AddMatchPM,&stM);
+ if (s && s->PM)
+ s->PM->forEach(AddMatchPM,&stM);
+ // Found any?
+ int count=stM.col->getCount();
+ if (count)
+ {
+ char *res=CompletionChooseFromList(stM.col,count,stM.len,cursor.x+owner->origin.x,
+ cursor.y+owner->origin.y+1,0,0,False);
+ if (res)
+ {
+ ret=PMColl->searchByNamePointer(res);
+ if (!ret && s && s->PM)
+ ret=s->PM->searchByNamePointer(res);
+ }
+ }
+ delete stM.col;
+
+ return ret;
+}
+
+static
+void AddPM(void *item, void *data)
+{
+ PMacroStr *pm=(PMacroStr *)item;
+ TNoCaseStringCollection *colName=(TNoCaseStringCollection *)data;
+
+ colName->insert(pm->name);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Shows a list with the available pseudo macros to choose one from the list.
+That's basically to help people remember the available pmacros but I think
+isn't a good idea to use it all the time, just to learn what's available.
+
+***************************************************************************/
+
+void TCEditor::ChoosePMacroFromList(void)
+{
+ if (isReadOnly)
+ return;
+
+ TPMCollection *col=0;
+
+ // Check if a SHL is used
+ if (SHLValueSelected>=0 && SHLArray)
+ {
+ struct strSHL *s=&SHLArray[SHLValueSelected];
+ // Check if the pmacros is loaded
+ if (!s->PM)
+ { // Now if not loaded check if a name was provided
+ if (s->PMacros)
+ {
+ s->PM=new TPMCollection(32,8);
+ LoadPseudoMacroFile(ExpandFileNameToThePointWhereTheProgramWasLoaded(s->PMacros),*(s->PM));
+ }
+ }
+ col=s->PM;
+ }
+ if (!col)
+ col=PMColl;
+ if (!col)
+ {
+ editorDialog(edNoPMacrosAvail);
+ return;
+ }
+
+ // Create a temporal collection sorted by name
+ TNoCaseStringCollection *colName=new TNoCaseStringCollection(col->getCount(),1);
+ col->forEach(AddPM,colName);
+
+ TListBoxRec box;
+ box.items=colName;
+ box.selection=0;
+ if (editorDialog(edChoosePMacro,&box)==cmOK)
+ {
+ flushLine();
+ ExpandPMacro(col->searchByNamePointer(colName->at(box.selection)),0);
+ }
+ delete colName; // Keep the elemenyts.
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Expands a pseudo-macro. The routines looks 2 bytes before the cursor
+position. Uses @x{ExpandPMacro}.
+
+***************************************************************************/
+
+void TCEditor::ExpandMacro(void)
+{
+ char Trg[4];
+
+ if (isReadOnly)
+ return;
+ flushLine();
+ int dif;
+ char *s=ColToPointer(dif);
+ if (dif!=0 || s-buffer<2 || ucisspace(s[-1]))
+ Trg[0]=Trg[1]=0; // Show all
+ else if (ucisspace(s[-2]))
+ {
+ Trg[0]=s[-1];
+ Trg[1]=0; // Show triggers that match the first letter
+ }
+ else
+ {// Exact match | first letter
+ Trg[0]=s[-2]; Trg[1]=s[-1]; Trg[2]=0;
+ }
+
+ // Search if there are a trigger for it
+ ExpandPMacro(SearchPMTrigger(Trg),s,Trg);
+}
+
+const unsigned MaxAuxMarker=3;
+
+/**[txh]********************************************************************
+
+ Description:
+ Low level pmacro expansion, is called only by high-level members when they
+know that's safe and know what to expand.
+
+***************************************************************************/
+
+void TCEditor::ExpandPMacro(void *pm, char *s, char *trg)
+{
+ if (!pm)
+ return;
+ unsigned AuxMarkers[MaxAuxMarker];
+ unsigned i;
+ unsigned Pos,Val;
+ int XCur=-1,YCur=0;
+
+ PMacroStr *d=(PMacroStr *)pm;
+ if (!d->str) return;
+
+ // Ask for vars if this macro have them
+ unsigned nVars;
+ char *varsVals;
+ if (!AskForPMVars(varsVals,d->vars,nVars,d->mLenVar,d->name,d->defaults))
+ return;
+
+ // Change to the correct mode
+ uint32 oldFlags=CompactFlags();
+ ExpandFlags(d->flags);
+
+ memset(AuxMarkers,0,MaxAuxMarker*sizeof(unsigned));
+ NotExpandingMacro=False;
+ if (!s)
+ s=ColToPointer();
+ else
+ {
+ if (trg[0])
+ BackSpace();
+ if (trg[1])
+ BackSpace();
+ }
+ unsigned varPos=0;
+ for (s=d->str; *s; s++)
+ {
+ switch (*s)
+ {
+ case '\n':
+ newLine();
+ break;
+ case '\b':
+ BackSpace();
+ break;
+ case '\t':
+ SmartTab();
+ break;
+ case '@':
+ if (s[1]=='@') // the user want to insert a '@'
+ {
+ if (!IslineInEdition)
+ EditLine();
+ InsertCharInLine(*s++);
+ break;
+ }
+ if (s[1]=='{') // An input var, by name
+ {
+ s+=2;
+ if (*s=='(') // sLisp code
+ {
+ char *start=s;
+ for (s++; *s && *s!='}'; s++);
+ if (!*s)
+ {// Error!
+ s--;
+ break;
+ }
+ //printf("%s - %d\n",start,s-start);
+ flushLine();
+ char *Code=newStrL(start,s-start);
+ SLPInterfaceRunString(this,Code,False);
+ delete[] Code;
+ break;
+ }
+ else
+ {
+ for (; *s && *s!='}'; s++);
+ if (!*s)
+ {// Error!
+ s--;
+ break;
+ }
+ char *str=varsVals+MaxVarValLen*varPos;
+ int len=strlen(str);
+ if (len)
+ {
+ flushLine();
+ insertBuffer(str,0,len,True,False,True);
+ //printf("<%s> %d\n",str,len);
+ }
+ varPos++;
+ break;
+ }
+ }
+ if (s[1]=='v') // An input var, by position
+ {
+ s+=2;
+ Val=*s-0x30;
+ if (Val>=0 && Val<nVars)
+ {
+ char *str=varsVals+MaxVarValLen*Val;
+ flushLine();
+ insertBuffer(str,0,strlen(str),True,False,True);
+ }
+ break;
+ }
+ if (IslineInEdition)
+ {
+ Pos=(unsigned)((curLinePtr-buffer)+(inEditPtr-bufEdit));
+ }
+ else
+ Pos=(unsigned)(ColToPointer()-buffer);
+ Val=*++s-0x30;
+ if (Val)
+ {
+ Val--;
+ if (Val<MaxAuxMarker)
+ AuxMarkers[Val]=Pos;
+ }
+ else
+ {
+ XCur=curPos.x;
+ YCur=curPos.y;
+ }
+ break;
+ default:
+ if (!IslineInEdition)
+ EditLine();
+ InsertCharInLine(*s);
+ }
+ }
+ NotExpandingMacro=True;
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ if (XCur!=-1)
+ MoveCursorTo(XCur,YCur,True);
+ for (i=0; i<MaxAuxMarker; i++)
+ if (AuxMarkers[i])
+ Markers[i+7]=AuxMarkers[i];
+
+ // return to the original mode
+ ExpandFlags(oldFlags);
+ delete[] varsVals;
+
+ update(ufView);
+}
+
+#define Block ((const char *)(block))
+
+/**[txh]********************************************************************
+
+ Description: Hide the selected area.
+
+***************************************************************************/
+
+void TCEditor::hideSelect()
+{
+ selecting=False;
+ if (selHided)
+ {
+ selHided=False;
+ UnsetSelectionBuffer();
+ }
+ else
+ {
+ selHided=True;
+ SetSelectionBuffer();
+ }
+ update(ufView);
+}
+
+
+/****************************************************************************
+
+ Function: void MoveLinesUp(int i)
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor i lines up.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::MoveLinesUp(int i)
+{
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ for (; i && curPos.y; --i)
+ curLinePtr-=lenLines[--curPos.y];
+ update(ufUpdate);
+}
+
+/****************************************************************************
+
+ Function: void MoveLinesDown(int i)
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor i lines down.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::MoveLinesDown(int i)
+{
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition();
+ for (; i && (unsigned)curPos.y<totalLines; --i)
+ curLinePtr+=lenLines[curPos.y++];
+ update(ufUpdate);
+}
+
+/****************************************************************************
+
+ Function: void initBuffer()
+
+ Type: TCEditor member.
+
+ Objetive: Allocate memory for the buffer according to bufSize.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+void TCEditor::initBuffer()
+{
+ buffer=(char *)malloc(bufSize);
+ if (bufSize>6)
+ {
+ /* That's a test to initialize the buffer and catch bugs */
+ unsigned i;
+ for (i=0; i<bufSize-6; i+=6)
+ strcpy(&buffer[i],"bug ");
+ }
+}
+
+/****************************************************************************
+
+ Function: BufPlusLen *CreateBufPlusLen(char *s,unsigned l)
+
+ Type: static function
+
+ Objetive: Create a copy of a buffer including the length information
+ inside, like a Pascal string.
+
+ Parameters:
+ char *s: The buffer.
+ unsigned l: The length.
+
+ Return: a BufPlusLen structure pointer to the allocated memory.
+
+ by SET.
+
+****************************************************************************/
+
+static BufPlusLen *CreateBufPlusLen(char *s,unsigned l)
+{
+ BufPlusLen *p;
+
+ p=(BufPlusLen *)malloc(l+sizeof(BufPlusLen));
+ if (p)
+ {
+ p->len=l;
+ memcpy(p->s,s,l);
+ }
+ return p;
+}
+
+
+static unsigned CalcNeededCharsToFill(int X1, int X2, int tabSize, Boolean OptimalFill)
+{
+ if (X2<=X1) return 0; // sanity check
+
+ if (OptimalFill)
+ {
+ // Calculate the number of tabs to add
+ unsigned tabs=X2/tabSize-X1/tabSize;
+ if (tabs)
+ return tabs+X2%tabSize; // The rest if filled with spaces
+ // if no tabs the difference of columns is the number of spaces
+ }
+ return X2-X1;
+}
+
+
+static void FillGapInBuffer(int X1, int X2, char *s, int tabSize, Boolean OptimalFill)
+{
+ int x;
+ if (X2<=X1) return; // sanity check
+
+ if (OptimalFill)
+ {
+ while (X1<X2)
+ {
+ x=NextTabPos(X1);
+ if (x<=X2 && x-X1>1)
+ {
+ *s='\t';
+ s++;
+ X1=x;
+ }
+ else
+ {
+ while (X1<X2 && X1<x)
+ {
+ *s=' ';
+ s++;
+ X1++;
+ }
+ }
+ }
+ return;
+ }
+ memset(s,' ',X2-X1);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Helper function to recompute the shl of a modified block.
+
+***************************************************************************/
+
+void TCEditor::UpdateSyntaxHLBlock(unsigned firstLine, char *firstTouchedP,
+ unsigned lastLine)
+
+{
+ uint32 attr;
+ char *end=buffer+bufLen;
+ // Prev. line attr
+ if (firstLine)
+ attr=lenLines.getAttr(firstLine-1);
+ else
+ attr=0;
+ CacheSyntaxHLData(GenericSHL);
+ // Recalculate for the inserted block
+ for (;firstLine<=lastLine;firstLine++)
+ {
+ firstTouchedP+=LineMeassure(firstTouchedP,end,attr,NULL);
+ lenLines.setAttr(firstLine,attr);
+ }
+ // Test for propagation:
+ // There are more lines?
+ if (firstLine<=totalLines)
+ {
+ // Yes, recalculate the following line
+ firstTouchedP+=LineMeassure(firstTouchedP,end,attr,NULL);
+ // Test if there are a propagation
+ TestPropagation(lenLines.getAttr(firstLine),attr,firstTouchedP,firstLine+1);
+ // Set the recalculated value
+ lenLines.setAttr(firstLine,attr);
+ }
+}
+
+
+/****************************************************************************
+
+ Function: Boolean insertBuffer( char *p, uint32 offset, uint32 length,
+ Boolean allowUndo, Boolean selectText,
+ Boolean moveToEnd )
+
+ Type: TCEditor member.
+
+ Objetive: Insert a text in the buffer.
+
+ Parameters:
+ p: pointer to the source buffer.
+ offset: offset in the source buffer.
+ length: of the string to insert.
+ allowUndo: if True the action is saved in the Undo.
+ selecText: True => the insertion becomes selected.
+ moveToEnd: If True the cursor is moved to the end of the insertion.
+
+ Return: True if all OK.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::insertBuffer(char *p, uint32 offset, uint32 length,
+ Boolean allowUndo, Boolean selectText,
+ Boolean moveToEnd)
+{
+ if (isReadOnly)
+ return False;
+ if (!length)
+ return True;
+
+ struct stUndoInsert undoSt;
+ undoSt.Eated=0;
+
+ // To allow copying from the same buffer (only works if the insertion point
+ // is greater than p+offtset+length).
+ // When we do a realloc we know we need to re-compute the pointer.
+ Boolean copyFromItself=(Boolean)(p==buffer);
+
+ if (bufLen==0 && bufSize==0)
+ { // It's a new buffer?
+ bufSize=MakeItGranular(length);
+ initBuffer();
+ setBufLen(0);
+ if (copyFromItself)
+ // Pointer could be changed
+ p=buffer;
+ }
+
+ int lar=LenWithoutCRLF(curPos.y,curLinePtr);
+ // This information is to complete the one in lar
+ int CRLFLenOfTheLine=lenLines[curPos.y]-lar;
+
+ // Calculate the cursor position inside the line
+ char *s=curLinePtr;
+ int i,x,extraSpaces,pF;
+ int TotalToAdd;
+ int IncludeFirstLine=1; // The first line is included when SpecialLines is updated
+ p+=offset; // That's the real source
+
+ // Walk in the line trying to reach the cursor position to translate that
+ // into an offset in the line called pF.
+ for (pF=0,x=0; pF<lar && x<curPos.x; s++)
+ {
+ AdvanceWithTab(*s,x);
+ if (IncludeFirstLine && !ucisspace(*s)) // That's for the SpecialLines
+ IncludeFirstLine=0;
+ pF++;
+ }
+ // is outside the real line? AND the inserted text won't destroy the new
+ // spaces (| we won't purge spaces).
+ if (x<curPos.x && (CLY_IsntEOL(*p) || DontPurgeSpaces))
+ {
+ extraSpaces=CalcNeededCharsToFill(x,curPos.x,tabSize,OptimalFill);
+ if (allowUndo)
+ {// We will insert some extra spaces so we must record this action in
+ // the undo history.
+ // Move the cursor to the place where we will insert spaces
+ addToUndo(undoInMov);
+ int curX=curPos.x;
+ curPos.x=x;
+ // Record the spaces we are adding
+ addToUndo(undoPreInsert,NULL);
+ struct stUndoInsert undoStSps;
+ undoStSps.Eated=0;
+ undoStSps.l=extraSpaces;
+ undoStSps.s=new char[extraSpaces];
+ FillGapInBuffer(x,curPos.x,undoStSps.s,tabSize,OptimalFill);
+ addToUndo(undoInsert,(void *)&undoStSps);
+ delete[] undoStSps.s;
+ curPos.x=curX;
+ }
+ }
+ else
+ extraSpaces=0;
+ // s points to the "insertion point"
+ s=curLinePtr+pF;
+ TotalToAdd=extraSpaces+length;
+ if (allowUndo) // Just remember the actual selected area
+ addToUndo(undoPreInsert,NULL);
+
+ // insertion point as offset
+ unsigned point=(unsigned)(s-buffer);
+
+ if (allowUndo && !DontPurgeSpaces && CLY_IsEOL(*p)) // Don't purge spaces if we can't undo
+ { // Search for spaces at the end of the new inserted line
+ char *s1;
+ for (s1=s-1; (*s1==' ' || *s1=='\t') && s1>=curLinePtr; s1--);
+
+ if (s1!=(s-1))
+ {
+ int dif=(int)(s-s1-1);
+ s=s1+1;
+ TotalToAdd-=dif;
+ pF-=dif;
+ lar-=dif;
+ undoSt.Eated=CreateBufPlusLen(s,dif);
+ }
+ }
+
+ // Is the buffer large enough?
+ {
+ uint32 DeltaS=(uint32)(s-buffer); // If we need more space the pointer change
+ //uint32 DeltaCL=(uint32)(curLinePtr-buffer);
+ if (bufSize<bufLen+TotalToAdd+1) // 1 to keep space for a \x0
+ {
+ if (!setBufSize(bufLen+TotalToAdd+1))
+ return False;
+ if (copyFromItself)
+ // Pointer could be changed
+ p=buffer+offset;
+ }
+ s=buffer+DeltaS;
+ //curLinePtr=buffer+DeltaCL;
+ }
+ undoSt.s=s;
+
+ lenLines.set(curPos.y,pF);
+
+ // If the section invalidates the drawPtr force a full recalculation
+ if (drawPtr>=unsigned(s-buffer))
+ drawLine=drawPtr=0;
+
+ // * Insert the buffer
+ // first make a hole
+ unsigned holeSize=(unsigned)(bufLen-(s-buffer));
+ if (holeSize)
+ {
+ if (TotalToAdd>0)
+ memmove(s+TotalToAdd,s,holeSize);
+ else
+ if (TotalToAdd)
+ memmove(s,s-TotalToAdd,holeSize);
+ }
+
+ // Update the selection pointers
+ if (selectText)
+ {
+ selStart=(uint32)(s-buffer);
+ selEnd=selStart+TotalToAdd;
+ selStart+=extraSpaces;
+ selStartOffSet=selStart;
+ selHided=False;
+ }
+ else
+ {
+ if (hasSelection())
+ {
+ if (point<selStart)
+ { // before
+ selStart+=TotalToAdd;
+ selEnd+=TotalToAdd;
+ updateFlags|=ufView;
+ }
+ else
+ if (point<selEnd)
+ { // inside
+ selEnd+=TotalToAdd;
+ updateFlags|=ufView;
+ }
+ // else beyond
+ }
+ }
+
+ // Update markers
+ for (i=0; i<10; i++)
+ {
+ if (Markers[i]>point)
+ Markers[i]+=TotalToAdd;
+ }
+
+ if (extraSpaces)
+ {
+ FillGapInBuffer(x,curPos.x,s,tabSize,OptimalFill);
+ memcpy(s+extraSpaces,p,length);
+ lenLines.set(curPos.y,lenLines[curPos.y]+extraSpaces);
+ }
+ else
+ memcpy(s,p,length);
+
+ if (allowUndo)
+ {
+ undoSt.l=length;
+ addToUndo(undoInsert,(void *)&undoSt);
+ }
+
+ bufLen+=TotalToAdd;
+ if (!holeSize)
+ buffer[bufLen]=0;
+
+ // Walk in the inserted text to see the changes in line lengths
+ // Note: x is y.
+ int inFirstLine;
+ unsigned chars;
+ unsigned firstTouchedLine=curPos.y;
+ char *firstTouchedP=curLinePtr;
+
+ if (isClipboard())
+ moveToEnd=True;
+
+ if (moveToEnd || !staticNoMoveToEndPaste)
+ {
+ for (s=p,i=0,x=curPos.y,inFirstLine=1,chars=0; (unsigned)i<length; i++,s++,chars++)
+ {
+ // Is a line feed?
+ if (*s=='\n')
+ {
+ // Is the first line?
+ if (inFirstLine)
+ {
+ // Adjust the len of the first line
+ lenLines.set(x,lenLines[x]+chars+1);
+ // No more this
+ inFirstLine=0;
+ // Put the rest of the chars in the following line inserting one
+ lenLines.insert(x+1,lar+CRLFLenOfTheLine-pF);
+ }
+ else
+ // Only insert a line
+ lenLines.insert(x,chars);
+ curLinePtr+=lenLines[x++]; // Move the pointer and the cursor
+ curPos.x=0;
+ chars=0;
+ totalLines++;
+ }
+ else
+ if (*s=='\t')
+ MoveWithTab(curPos.x);
+ else
+ if (CLY_IsntEOL(*s))
+ curPos.x++;
+ }
+ curPos.y=x;
+ limit.y=totalLines+1;
+ }
+ else
+ {
+ for (s=p,i=0,x=curPos.y,inFirstLine=1,chars=0; (unsigned)i<length; i++,s++,chars++)
+ {
+ // Is a line feed?
+ if (*s=='\n')
+ {
+ // Is the first line?
+ if (inFirstLine)
+ {
+ // Adjust the len of the first line
+ chars+=lenLines[x]+1;
+ lenLines.set(x,chars);
+ // No more this
+ inFirstLine=0;
+ // Put the rest of the chars in the following line inserting one
+ lenLines.insert(x+1,lar+CRLFLenOfTheLine-pF);
+ }
+ else
+ // Only insert a line
+ lenLines.insert(x,chars);
+ // Update the maximun width
+ if ((int)chars>limit.x)
+ limit.x=chars;
+ x++;
+ chars=0;
+ totalLines++;
+ }
+ }
+ // Update the maximun width
+ if ((int)chars>limit.x)
+ limit.x=chars;
+ limit.y=totalLines+1;
+ }
+ // There are characters added to the last line?
+ if (chars)
+ if (inFirstLine)
+ {// Only a little text inside the line
+ lenLines.set(x,lar+CRLFLenOfTheLine+extraSpaces+chars);
+ }
+ else
+ lenLines.set(x,lenLines[x]+chars-1);
+
+ // If needed adjust the SpecialLines array
+ if (SpecialLines)
+ {
+ int fromLine=(int)firstTouchedLine+1; // Included
+ int toLine=x+1; // Not Included
+ int dif=toLine-fromLine,i;
+ if (IncludeFirstLine)
+ fromLine--;
+ int cnt=SpecialLines->getCount();
+ for (i=0; i<cnt; i++)
+ {
+ stSpLine *p=SpecialLines->At(i);
+ if (p->nline>=fromLine)
+ p->nline+=dif;
+ }
+ }
+
+ UpdateSyntaxHLBlock(firstTouchedLine,firstTouchedP,x);
+
+ if (!isClipboard())
+ MarkAsModified();
+ update(ufView);
+
+ return True;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Copy the selection to a buffer (b). Stops in the first '\n'. The size is
+limited by l. The string is ASCIIZ. The routine will use l bytes plus one
+for the 0 if necesary.
+@p
+ Is used to copy from the clipboard to a TInputLinePiped object.
+
+ Return: The number of bytes copied to the buffer.
+
+***************************************************************************/
+
+unsigned TCEditor::CopySelToBuffer(char *b, unsigned l)
+{
+ unsigned copied=0;
+ if (hasSelection())
+ {
+ char *start=buffer+selStart;
+ char *end=buffer+selEnd;
+
+ for (;copied<l && CLY_IsntEOL(*start) && start<end; copied++, start++, b++)
+ *b=*start;
+ *b=0;
+ }
+ return copied;
+}
+
+/****************************************************************************
+
+ Function: void deleteRangeLineInEdition(char *from,char *to,int x);
+
+ Type: TCEditor member.
+
+ Objetive: Delete a piece of the buffer in edition.
+ Includes from but not to, deletes to-from chars.
+
+ Parameters:
+ from: From where.
+ to: To where.
+ x: -1 => No change, else the new x position.
+
+ This routine must be finished.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::deleteRangeLineInEdition(char *from,char *to,int x)
+{
+ if (isReadOnly)
+ return;
+ addToUndo(undoPreDelete,from);
+ if (x>=0)
+ curPos.x=x;
+ addToUndo(undoDelete,to);
+ memcpy(from,to,restCharsInLine+1);
+
+ // Update markers
+ int start=(int)(from-bufEdit);
+ int end=(int)(to-bufEdit);
+ int dif=end-start,i;
+ for (i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0)
+ {
+ if (Pos>=start && Pos<end)
+ MarkersInLine[i]=start;
+ else
+ if (Pos>=end)
+ MarkersInLine[i]-=dif;
+ }
+ }
+ AdjustLineSel(start,-dif,True,x>=0 ? True : False); // I'm not sure about the True
+ // The x>=0 is a little complex, if x<0 (-1) the cursor isn't moved so we are
+ // deleting to the right of the line, so the toLeft parameter MUST be False.
+ // ^T and ^QY deletes the right part and pass -1, ^QH deletes the left part.
+ MarkAsModified();
+ update(ufLine);
+}
+
+/****************************************************************************
+
+ Function: void deleteRange(char *from,char *to,Boolean allowUndo)
+
+ Type: TCEditor member.
+
+ Objetive: Delete a piece of the buffer.
+ Includes from but not to, deletes to-from chars.
+
+ Parameters:
+ from: From where.
+ to: To where.
+ allowUndo: True if the action is recorded in the undo array.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::deleteRange(char *from, char *to, Boolean allowUndo)
+{
+ if (isReadOnly || from>=to)
+ return;
+ CacheSyntaxHLData(GenericSHL);
+ showMatchPairFlyCache=NULL;
+
+ // Fix to pointer if that's outside the buffer
+ if ((unsigned)(to-buffer)>bufLen)
+ to=buffer+bufLen;
+
+ char *fromOrig=from;
+ // If the block will let the end of the current line exposed see if
+ // there are spaces at the end and eat it.
+ if (!DontPurgeSpaces && (*to=='\r' || *to=='\n' || !*to) && allowUndo)
+ {
+ while (from!=buffer)
+ {
+ --from;
+ if (*from!=' ' && *from!='\t')
+ {
+ from++;
+ break;
+ }
+ }
+ }
+
+ if (allowUndo)
+ addToUndo(undoPreDelete,from);
+
+ // Put the cursor in "from"
+ int y=0,x=0;
+ char *pos=buffer;
+ while (pos<=from)
+ pos+=lenLines[y++];
+ curPos.y=y-1;
+ curLinePtr=pos-lenLines[curPos.y];
+ pos=curLinePtr;
+ while (pos!=fromOrig)
+ {
+ AdvanceWithTab(*pos++,x);
+ }
+ curPos.x=x;
+ int IncludeFirstLine = x==0;
+
+ // If the section invalidates the drawPtr force a full recalculation
+ if (drawPtr>=unsigned(from-buffer)) // unsigned(from-buffer) is usually selStart
+ drawLine=drawPtr=0;
+
+ // Correct the line lengths
+#if 0
+ // Old version
+ for (pos=from,y=curPos.y; pos<to; pos++)
+ {
+ lenLines.elArray[y]--;
+ if (*pos=='\n')
+ {
+ if ((unsigned)y<totalLines)
+ {
+ lenLines.elArray[y]+=lenLines.elArray[y+1];
+ lenLines.del(y+1);
+ }
+ else
+ {
+ if (curPos.y)
+ curLinePtr-=lenLines[--curPos.y];
+ }
+ if (totalLines)
+ totalLines--;
+ limit.y=totalLines+1;
+ }
+ }
+#else
+ // New optimized one
+ y=curPos.y;
+ uint32 lenOfThisLine=lenLines[y];
+ uint32 nextLine=y+1;
+ for (pos=from; pos<to; pos++)
+ {
+ lenOfThisLine--;
+ if (*pos=='\n')
+ {
+ if ((unsigned)y<totalLines)
+ {
+ lenOfThisLine+=lenLines[nextLine++];
+ }
+ else
+ {
+ if (curPos.y)
+ curLinePtr-=lenLines[--curPos.y];
+ }
+ if (totalLines)
+ totalLines--;
+ }
+ }
+ lenLines.set(y,lenOfThisLine);
+ if ((nextLine-y)>1)
+ { // If we need to delete lines
+ lenLines.deleteRange(y+1,nextLine-1);
+ // If needed adjust the SpecialLines array
+ if (SpecialLines)
+ {
+ int fromLine=y+1; // Included
+ int toLine=nextLine; // Not Included
+ int l,dif=toLine-fromLine,i;
+ if (IncludeFirstLine)
+ fromLine--;
+ if (*(pos-1)=='\n')
+ toLine--;
+ int cnt=SpecialLines->getCount();
+ for (i=0; i<cnt; i++)
+ {
+ stSpLine *p=SpecialLines->At(i);
+ l=p->nline;
+ if (l>=toLine)
+ p->nline-=dif;
+ else
+ if (l>=fromLine)
+ p->nline=-1;
+ }
+ }
+ }
+ limit.y=totalLines+1;
+#endif
+
+ // Correct the Markers
+ {
+ int i;
+ unsigned ToPoint=(unsigned)(to-buffer);
+ unsigned FromPoint=(unsigned)(from-buffer);
+ for (i=0; i<10; i++)
+ {
+ if (Markers[i]>ToPoint)
+ Markers[i]-=ToPoint-FromPoint;
+ else
+ if (Markers[i]>FromPoint)
+ Markers[i]=FromPoint;
+ }
+ }
+
+ if (allowUndo)
+ addToUndo(undoDeleteBuf,to);
+
+ // do the work
+ CLY_memcpy(from,to,(size_t)(bufLen-(to-buffer)));
+ bufLen-=(unsigned)(to-from);
+
+ // Correct the syntax of the line and test for propagation
+ {
+ uint32 attr;
+ char *s=curLinePtr;
+ uint32 y=curPos.y;
+
+ // get the previous line attr
+ if (y)
+ attr=lenLines.getAttr(y-1);
+ else
+ attr=0;
+ // recalculate the attr of the actual (modified) line
+ s+=LineMeassure(s,s+lenLines[y],attr,NULL);
+ lenLines.setAttr(y,attr);
+ // There are more lines?
+ if ((uint32)curPos.y<totalLines)
+ {
+ // Yes, recalculate the following line
+ s+=LineMeassure(s,s+lenLines[++y],attr,NULL);
+ // Test if there are a propagation
+ TestPropagation(lenLines.getAttr(y),attr,s,y+1);
+ // Set the recalculated value
+ lenLines.setAttr(y,attr);
+ }
+ }
+
+ if (hasSelection())
+ {
+ uint32 pos1=(uint32)(from-buffer);
+ unsigned pos2=(unsigned)(to-buffer);
+ unsigned diff=pos2-pos1;
+ if (pos1<selStart)
+ {
+ if (pos2<=selStart)
+ { // pos1<selStart && pos2<=selEnd
+ selStart-=diff;
+ selEnd-=diff;
+ }
+ else
+ {
+ if (pos2>selEnd) // All is inside
+ selEnd=selStart=0;
+ else
+ { // a part
+ selStart=pos1;
+ selEnd-=diff;
+ }
+ }
+ }
+ else
+ { // >= selStart
+ if (pos1<selEnd)
+ {
+ if (pos2<=selEnd)
+ selEnd-=diff;
+ else
+ selEnd=pos1;
+ }
+ }
+ }
+
+ MarkAsModified();
+ update(ufView);
+}
+
+
+/****************************************************************************
+
+ Function: int LineWidth()
+
+ Type: TCEditor member.
+
+ Objetive: Compute the length of the current line, taking care about tabs.
+
+ Return: The length.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::LineWidth()
+{
+ char *s;
+ int x,off,lar=LenWithoutCRLF(curPos.y,curLinePtr);
+
+ for (s=curLinePtr,x=off=0; off<lar; off++,s++)
+ {
+ AdvanceWithTab(*s,x);
+ }
+ return x;
+}
+
+/****************************************************************************
+
+ Function: int LineWidth(char *s, char *d)
+
+ Type: TCEditor member.
+
+ Objetive: Compute the length of the current line, taking care about tabs.
+
+ Parameters:
+ s: pointer to the start of the line.
+ d: pointer to the end of the line.
+
+ Return: The length.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::LineWidth(char *s, char *d)
+{
+ int lar=(int)(d-s);
+ int x,off;
+
+ for (x=off=0; off<lar; off++,s++)
+ {
+ AdvanceWithTab(*s,x);
+ }
+ return x;
+}
+
+
+/****************************************************************************
+
+ Function: Boolean insertFrom( TEditor *editor )
+
+ Type: TCEditor member.
+
+ Objetive: Insert the selected text of another editor in this editor.
+
+ Return: True = OK.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+Boolean TCEditor::insertFrom( TCEditor *editor )
+{
+ return insertBuffer( editor->buffer,
+ editor->selStart,
+ editor->selEnd - editor->selStart,
+ canUndo,
+ True,
+ False
+ );
+}
+
+/****************************************************************************
+
+ Function: Boolean insertText( const void *text, unsigned length,
+ Boolean selectText )
+
+ Type: TCEditor member.
+
+ Objetive: Insert text from another buffer.
+
+ Parameters:
+ text: source buffer.
+ length: of the text.
+ selectText: if the text will be selected after the operation.
+
+ Return: True = OK.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+Boolean TCEditor::insertText( const void *text, unsigned length, Boolean selectText )
+{
+ return insertBuffer( (char *)text, 0, length, canUndo, selectText);
+}
+
+/****************************************************************************
+
+ Function: void insertSpaces( unsigned length, Boolean canUseTabs )
+
+ Type: TCEditor member.
+
+ Objetive: Insert some spaces in the text.
+
+ Parameters:
+ length: number of spaces to insert.
+ canUseTabs: True if tabs can be used.
+
+ Note: Don't call this function when there is a line in edition.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::insertSpaces( unsigned length, int X1, Boolean canUseTabs )
+{
+ if (OptimalFill && canUseTabs)
+ {
+ unsigned l=CalcNeededCharsToFill(X1,X1+length,tabSize,OptimalFill);
+ if (AdjustBufEditFor(l))
+ return;
+ FillGapInBuffer(X1,X1+length,bufEdit,tabSize,OptimalFill);
+ insertText(bufEdit,l,False);
+ }
+ else
+ {
+ if (AdjustBufEditFor(length))
+ return;
+ memset(bufEdit,' ',length);
+ insertText(bufEdit,length,False);
+ }
+}
+
+/****************************************************************************
+
+ Function: uint32 lineMove( uint32 p, int count )
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor to a position, based on an offset plus a number
+ of lines.
+
+ Parameters:
+ p: offset of the origin.
+ count: number of lines from this point.
+
+ Return:
+ The new offset of the cursor in the buffer.
+
+ by SET.
+
+****************************************************************************/
+
+uint32 TCEditor::lineMove( uint32 p, int count )
+{
+ GotoOffSet(p);
+ MoveCursorTo(curPos.x,curPos.y+count);
+ return (uint32)(ColToPointer()-buffer);
+}
+
+
+int TCEditor::Comment1Here(char *s, int l)
+{
+ return isComment1(*s) && CheckForSequenceNotFirst(strC.OpenCom1,strC.lOpenCom1,l,s);
+}
+
+int TCEditor::Comment2Here(char *s, int l)
+{
+ return isComment2(*s) && CheckForSequenceNotFirst(strC.OpenCom2,strC.lOpenCom2,l,s);
+}
+
+int TCEditor::EOLCommentHere(char *s, int l)
+{
+ return isEOLComment(*s) &&
+ (CheckForSequenceNotFirst(strC.EOLCom1,strC.lEOLCom1,l,s) ||
+ CheckForSequenceNotFirst(strC.EOLCom2,strC.lEOLCom2,l,s));
+}
+
+int TCEditor::SkipComment1(char *&sp, int &avail, int &col)
+{
+ char *s=sp;
+ int l=avail;
+ int c=col;
+ int ret=0;
+
+ if (Comment1Here(s,l))
+ {
+ s+=strC.lOpenCom1;
+ l-=strC.lOpenCom1;
+ c+=strC.lOpenCom1;
+ while (l && *s!='\n')
+ {
+ if (isCloseComm1(*s) && CheckForSequenceNotFirst(strC.CloseCom1,
+ strC.lCloseCom1,l,s))
+ {
+ s+=strC.lCloseCom1;
+ l-=strC.lCloseCom1;
+ c+=strC.lCloseCom1;
+ break;
+ }
+ AdvanceWithTab(*s,c);
+ l--;
+ s++;
+ }
+ sp=s;
+ avail=l;
+ col=c;
+ ret=1;
+ }
+ return ret;
+}
+
+int TCEditor::SkipComment2(char *&sp, int &avail, int &col)
+{
+ char *s=sp;
+ int l=avail;
+ int c=col;
+ int ret=0;
+
+ if (Comment2Here(s,l))
+ {
+ s+=strC.lOpenCom2;
+ l-=strC.lOpenCom2;
+ c+=strC.lOpenCom2;
+ while (l && *s!='\n')
+ {
+ if (isCloseComm2(*s) && CheckForSequenceNotFirst(strC.CloseCom2,
+ strC.lCloseCom2,l,s))
+ {
+ s+=strC.lCloseCom2;
+ l-=strC.lCloseCom2;
+ c+=strC.lCloseCom2;
+ break;
+ }
+ AdvanceWithTab(*s,c);
+ l--;
+ s++;
+ }
+ sp=s;
+ avail=l;
+ col=c;
+ ret=1;
+ }
+ return ret;
+}
+
+void TCEditor::FindFirstChar(char *s, int x, int l, char *&fch, int &fcol, int &laf)
+{
+ // Look for the first non-blank char
+ char *firstChar=s;
+ int firstCol=x;
+ int lAfterFirst=l;
+ // Skip spaces
+ while (*firstChar==' ' || *firstChar=='\t')
+ {
+ AdvanceWithTab(*firstChar,firstCol);
+ lAfterFirst--;
+ firstChar++;
+ }
+ // Is that a comment?
+ if (lAfterFirst && (
+ Comment1Here(firstChar,lAfterFirst) ||
+ Comment2Here(firstChar,lAfterFirst)))
+ {// We found something, remmember it and then skip comments
+ char *firstCharAux=firstChar;
+ int firstColAux=firstCol;
+ int lAfterFirstAux=lAfterFirst;
+ // skip comments
+ while (lAfterFirst)
+ {// Skip spaces
+ while (*firstChar==' ' || *firstChar=='\t')
+ {
+ AdvanceWithTab(*firstChar,firstCol);
+ lAfterFirst--;
+ firstChar++;
+ }
+ // Skip comments type 1
+ if (SkipComment1(firstChar,lAfterFirst,firstCol))
+ continue;
+ // Skip comments type 2
+ if (SkipComment2(firstChar,lAfterFirst,firstCol))
+ continue;
+ // Ok, something is here
+ break;
+ }
+ // We couldn't find anything after the comments
+ if (!lAfterFirst)
+ {
+ firstChar=firstCharAux;
+ firstCol=firstColAux;
+ lAfterFirst=lAfterFirstAux;
+ }
+ }
+ fch=firstChar;
+ fcol=firstCol;
+ laf=lAfterFirst;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the Intelligent C indent function.
+
+***************************************************************************/
+
+int TCEditor::AnalizeLineForIndent(char *s, int x, Boolean &mu, int l,
+ char *lineStart, char *prevLine,
+ int prevLineNum)
+{// Check if we can use it
+ if (SyntaxHL==shlNoSyntax)
+ return x;
+ CacheSyntaxHLData(GenericSHL);
+ if (!strC.nlIndent || strC.nlIndent->getCount()==0)
+ return x;
+
+ // 1) Extract the first word or symbol
+ // Look for the first non-blank/no-comment char
+ char *firstChar;
+ int firstCol;
+ int lAfterFirst;
+ FindFirstChar(s,x,l,firstChar,firstCol,lAfterFirst);
+ // Here we point to the first useful char
+ int lenWord=0;
+ char *afterWord=firstChar;
+ int lAfterWord=lAfterFirst;
+ int afterWordCol=firstCol;
+ while (lAfterFirst && isWordChar(*afterWord))
+ {
+ lenWord++;
+ lAfterWord--;
+ afterWord++;
+ afterWordCol++;
+ }
+
+ // 2) Analize the ( and ) balance for the rest of the line
+ // 3) What's the last used char
+ int parBalance=0;
+ char *sPar=afterWord, lastChar=0, *lastClosePar=NULL;
+ int lPar=lAfterWord;
+ int parCol=afterWordCol;
+ int colFirstPar=-2;
+ int yPrev=prevLineNum;
+ while (lPar)
+ {
+ if (Comment1Here(sPar,lPar))
+ {
+ SkipComment1(sPar,lPar,parCol);
+ continue;
+ }
+ if (Comment2Here(sPar,lPar))
+ {
+ SkipComment2(sPar,lPar,parCol);
+ continue;
+ }
+ if (EOLCommentHere(sPar,lPar))
+ break;
+ if (*sPar=='(' || *sPar==')')
+ {
+ if (!(SyntaxHighlightExtraFor(prevLine,sPar,yPrev) & FilterProp))
+ {
+ if (*sPar=='(')
+ {
+ parBalance++;
+ if (colFirstPar==-2)
+ colFirstPar++;
+ }
+ else
+ {
+ parBalance--;
+ lastClosePar=sPar;
+ }
+ }
+ lastChar=*sPar;
+ }
+ else
+ if (!ucisspace(*sPar))
+ {
+ lastChar=*sPar;
+ if (colFirstPar==-1)
+ colFirstPar=parCol;
+ }
+ AdvanceWithTab(*sPar,parCol);
+ sPar++;
+ lPar--;
+ }
+ if (colFirstPar==-1)
+ colFirstPar=parCol;
+
+ // 4) If we have extra ) analize the starting point
+ if (parBalance<0)
+ {
+ char *lineOpenStart=prevLine;
+ int lineOpen=prevLineNum;
+ int offset=SearchOpenSymbol('(',')',lastClosePar,lineOpenStart,lineOpen);
+ if (offset>=0)
+ {// We found the line where it gets balanced
+ // Look for the first usable char there
+ char *firstChar2;
+ int firstCol2;
+ int lAfterFirst2;
+ FindFirstChar(lineOpenStart,0,offset-(lineOpenStart-buffer),firstChar2,
+ firstCol2,lAfterFirst2);
+ // Check if the line is balanced upto the point we found
+ char *s=firstChar2;
+ int preBalance=0;
+ int lAvail=lAfterFirst2;
+ while (lAvail)
+ {
+ if (*s=='(' || *s==')')
+ {
+ if (!(SyntaxHighlightExtraFor(lineOpenStart,s,lineOpen) & FilterProp))
+ {
+ if (*s=='(')
+ preBalance++;
+ else
+ preBalance--;
+ }
+ }
+ s++;
+ lAvail--;
+ }
+ if (preBalance==0)
+ {// Ok, we assume this is the starting line
+ // Take the first word from here
+ lenWord=0;
+ afterWord=firstChar=firstChar2;
+ lAfterWord=lAfterFirst=lAfterFirst2;
+ afterWordCol=firstCol=firstCol2;
+ while (lAfterFirst && isWordChar(*afterWord))
+ {
+ lenWord++;
+ lAfterWord--;
+ afterWord++;
+ afterWordCol++;
+ }
+ // Indicate we found the balance
+ parBalance=0;
+ }
+ }
+ }
+
+ // Try with all the rules in reverse order
+ TNLIndentCol *col=strC.nlIndent;
+ int c=col->getCount();
+ for (int i=c-1; i>=0; i--)
+ {// Test the conditions
+ NLIndent *s=col->At(i);
+ int cond[2]={0,0};
+ for (int j=0; j<2; j++)
+ {
+ switch (s->cond[j])
+ {
+ case nliAlways:
+ cond[j]=1;
+ break;
+ case nliParBalancePos:
+ cond[j]=parBalance>0;
+ break;
+ case nliParBalanceNeg:
+ cond[j]=parBalance<0;
+ break;
+ case nliFirstWord:
+ if (lenWord==0)
+ // symbol
+ cond[j]=s->cArgStr[j][0]==firstChar[0];
+ else
+ {
+ // word
+ int match=strC.Flags1 & FG1_CaseSensitive ?
+ strncmp(s->cArgStr[j],firstChar,lenWord)==0 :
+ strncasecmp(s->cArgStr[j],firstChar,lenWord)==0;
+ cond[j]=s->cArgInt[j]==(unsigned)lenWord && match;
+ }
+ break;
+ case nliNoLastChar:
+ cond[j]=lastChar!=(char)s->cArgInt[j];
+ break;
+ }
+ }
+ if (cond[0] && cond[1])
+ {// Execute the action
+ switch (s->action)
+ {
+ case nliAutoIndent:
+ return firstCol+s->acArgInt;
+ case nliUnindent:
+ mu=True;
+ return firstCol;
+ case nliMoveAfterPar:
+ return colFirstPar;
+ }
+ }
+ }
+
+ return firstCol;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts an end of line at the current position. That's \n for UNIX buffers
+and \r\n for DOS buffers. It autoindents and also computes the "Intelligent
+Indent" mode.
+
+***************************************************************************/
+
+void TCEditor::newLine()
+{
+ if (isReadOnly)
+ return;
+ if (IslineInEdition) // This can be optimized
+ MakeEfectiveLineInEdition();
+ ClearSelIfNonPers();
+
+ // Autoindent looks in the line before the ENTER, fuck!
+ unsigned larThis=0,larAnt=0,firstUsedCol=0;
+ char *prevLine=curLinePtr,*firstUsedPos=curLinePtr;
+ if (!intelIndent && autoIndent)
+ {
+ int lineAnalize=curPos.y;
+
+ larAnt=larThis=lenLines[lineAnalize];
+ while (lineAnalize>=0)
+ {
+ if (larAnt>CLY_LenEOL)
+ { // This line seems to have something, check it
+ firstUsedPos=prevLine;
+ while (*firstUsedPos==' ' || *firstUsedPos=='\t')
+ {
+ AdvanceWithTab(*firstUsedPos,firstUsedCol);
+ firstUsedPos++;
+ }
+ if (*firstUsedPos!='\n' && *firstUsedPos!='\r')
+ break; // if really contains something stop searching
+ }
+ firstUsedCol=0;
+ if (lineAnalize)
+ {
+ larAnt=lenLines[lineAnalize-1];
+ prevLine-=larAnt;
+ }
+ lineAnalize--;
+ }
+ }
+
+ insertText(CLY_crlf,CLY_LenEOL,False);
+
+ if (intelIndent && curPos.y>0)
+ {
+ // analize the last line
+ unsigned firstUsedCol=0,firstColHere;
+ int i;
+ char *firstUsedPos,*firstUsedHere;
+
+ larThis=lenLines[curPos.y];
+ // Searchs the first line located before than the
+ // actual line that contains at least 1 character
+ prevLine=curLinePtr;
+ i=1;
+ do
+ {
+ larAnt=lenLines[curPos.y-i];
+ prevLine-=larAnt;
+ i++;
+ }
+ while (i<=curPos.y && larAnt<=CLY_LenEOL);
+ firstUsedPos=prevLine;
+ int prevLineNum=curPos.y-i+1;
+
+ // Search the position of the first used char and its column.
+ while (*firstUsedPos==' ' || *firstUsedPos=='\t')
+ {
+ AdvanceWithTab(*firstUsedPos,firstUsedCol);
+ firstUsedPos++;
+ larAnt--;
+ }
+
+ // Move the cursor to the first char
+ firstColHere=0;
+ firstUsedHere=curLinePtr;
+
+ // The same but in the current line
+ while (*firstUsedHere==' ' || *firstUsedHere=='\t')
+ {
+ AdvanceWithTab(*firstUsedHere,firstColHere);
+ firstUsedHere++;
+ }
+ //addToUndo(undoInMov);
+ curPos.x=firstColHere;
+
+ unsigned TargetCol=firstUsedCol;
+ Boolean makeUnIndent=False;
+
+ TargetCol=AnalizeLineForIndent(firstUsedPos,firstUsedCol,makeUnIndent,
+ larAnt-CLY_LenEOL,curLinePtr,prevLine,prevLineNum);
+
+ // Avoid a backspace at the start of the line
+ if (!TargetCol && makeUnIndent)
+ makeUnIndent=False;
+
+#if 0
+ int haveColon=*(curLinePtr-3)==';';
+
+ if (*firstUsedPos=='{')
+ TargetCol++;
+ else
+ if (((strncmp(firstUsedPos,"do",2)==0 || strncmp(firstUsedPos,"while",4)==0 ||
+ strncmp(firstUsedPos,"if",2)==0) && !haveColon) ||
+ strncmp(firstUsedPos,"else",4)==0 || strncmp(firstUsedPos,"switch",5)==0)
+ {
+ TargetCol+=2;
+ }
+ else
+ if (strncmp(firstUsedPos,"case",4)==0 || strncmp(firstUsedPos,"default",7)==0)
+ {
+ /* Old: Is inpractic for switchs with labels
+ while (*firstUsedPos!=':' && *firstUsedPos!='\n')
+ {
+ TargetCol++;
+ firstUsedPos++;
+ }
+ if (*firstUsedPos==':')
+ {
+ do
+ {
+ TargetCol++;
+ firstUsedPos++;
+ }
+ while (*firstUsedPos==' ' || *firstUsedPos=='\t');
+ }*/
+ TargetCol+=5;
+ }
+ else
+ if (strncmp(firstUsedPos,"break",5)==0 || strncmp(firstUsedPos,"return",6)==0)
+ makeUnIndent=True;
+ else
+ if (*firstUsedPos=='}' && TargetCol!=0)
+ makeUnIndent=True;
+ else
+ if (strncmp(firstUsedPos,"for",3)==0 && !haveColon)
+ TargetCol+=3;
+#endif
+
+ if ((unsigned)curPos.x<TargetCol)
+ {
+ if (larThis>CLY_LenEOL)
+ { // The line have chars
+ insertSpaces(TargetCol-curPos.x,curPos.x);
+ }
+ else
+ {// Is empty, only move the cursor
+ curPos.x=TargetCol;
+ }
+ }
+ if (makeUnIndent)
+ {
+ Boolean oldUseTabs=UseTabs;
+ Boolean oldBackSpUnindents=BackSpUnindents;
+ UseTabs=False; // Force the unindent even whe the user isn't in the
+ // rigth mode.
+ BackSpUnindents=True;
+ BackSpace();
+ UseTabs=oldUseTabs;
+ BackSpUnindents=oldBackSpUnindents;
+ }
+ }
+ else
+ if (autoIndent)
+ {
+ unsigned firstColHere;
+ char *firstUsedHere;
+
+ // Move the cursor to the first char
+ firstColHere=0;
+ firstUsedHere=curLinePtr;
+
+ while (*firstUsedHere==' ' || *firstUsedHere=='\t')
+ {
+ AdvanceWithTab(*firstUsedHere,firstColHere);
+ firstUsedHere++;
+ }
+ //addToUndo(undoInMov);
+ curPos.x=firstColHere;
+
+ if ((unsigned)curPos.x<firstUsedCol)
+ {
+ if (larThis>CLY_LenEOL)
+ { // The line have chars
+ insertSpaces(firstUsedCol-curPos.x,curPos.x);
+ }
+ else
+ { // Is empty, only move the cursor
+ curPos.x=firstUsedCol;
+ }
+ }
+ }
+}
+
+/****************************************************************************
+
+ Function: char *ColToPointer()
+
+ Type: TCEditor member.
+
+ Objetive: Returns a pointer to the "closest" position to curPos.x in the
+ buffer.
+ Note: more than one col reports the same pointer if the X pos is in a tab.
+ Note: if the cursor is outside the buffer the pointer is to the \n.
+
+ Return:
+ A char pointer to the cursor position in the buffer.
+
+ by SET.
+
+****************************************************************************/
+
+char *TCEditor::ColToPointer()
+{
+ char *s=curLinePtr,*end=buffer+bufLen;
+ int x,xDest=curPos.x;
+
+ for (x=0; CLY_IsntEOL(*s) && x<xDest && s<end; s++)
+ {
+ AdvanceWithTab(*s,x);
+ }
+ return s;
+}
+
+/****************************************************************************
+
+ Function: char *ColToPointer(int &Dif)
+
+ Type: TCEditor member.
+
+ Objetive: Is a variant of ColToPointer()
+ Dif is the difference between the point gived and the point desired.
+ If Dif is negative the cursor was beyond the end of line
+ If Dif is positive the cursor was in a tab
+
+ Return:
+ A char pointer to the cursor position in the buffer.
+
+ by SET.
+
+****************************************************************************/
+
+char *TCEditor::ColToPointer(int &Dif)
+{
+ char *s=curLinePtr;
+ int x,xDest=curPos.x;
+
+ for (x=0; CLY_IsntEOL(*s) && x<xDest; s++)
+ {
+ AdvanceWithTab(*s,x);
+ }
+ Dif=x-xDest;
+ return s;
+}
+
+/****************************************************************************
+
+ Function: char *ColToPointerPost()
+
+ Type: TCEditor member.
+
+ Objetive: Is another variant of ColToPointer().
+ The pointer is to the POSITION BEFORE THE \xA
+ ^^^^^^^^^^^^^^^^^^^
+ Some time ago this text was missing and was a
+ real funny bug.
+
+ Return:
+ A char pointer to the cursor position in the buffer.
+
+ by SET.
+
+****************************************************************************/
+
+char *TCEditor::ColToPointerPost()
+{
+ char *s=curLinePtr;
+ int x,xDest=curPos.x;
+
+ for (x=0; CLY_IsntEOL(*s) && x<xDest; s++)
+ {
+ AdvanceWithTab(*s,x);
+ }
+ return s;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This routine returns the x column for the character at the right of the
+one above the cursor. If we are inside a tab it is != curPos.x-1.
+
+***************************************************************************/
+
+int TCEditor::PosLeftChar()
+{
+ char *s=curLinePtr,*end=buffer+bufLen;
+ int x,xDest=curPos.x,xold;
+
+ for (x=0,xold=0; CLY_IsntEOL(*s) && x<xDest && s<end; s++)
+ {
+ AdvanceWithTab(*s,x);
+ if (x<xDest)
+ xold=x;
+ }
+ if (x<xDest)
+ return xDest-1;
+ return xold;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It returns curPos.x if the cursor isn't inside the tab. If not the column
+returned is the one of the start of the tab.
+
+***************************************************************************/
+
+int TCEditor::FixPosCharLeft()
+{
+ char *s=curLinePtr,*end=buffer+bufLen;
+ int x,xDest=curPos.x,xold;
+
+ for (x=0,xold=0; CLY_IsntEOL(*s) && x<xDest && s<end; s++)
+ {
+ AdvanceWithTab(*s,x);
+ if (x<=xDest)
+ xold=x;
+ }
+ if (x<xDest)
+ return xDest;
+ return xold;
+}
+
+/****************************************************************************
+
+ Function: void SetStartOfSelecting(uint32 startOffSet)
+
+ Type: TCEditor member.
+
+ Objetive: Set the start of the selected area.
+
+ Parameter:
+ startOffSet: new start offset.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::SetStartOfSelecting(uint32 startOffSet)
+{
+ int selVisible=!selHided && hasSelection();
+
+ if (startOffSet>bufLen)
+ startOffSet=bufLen;
+ if (!(selVisible && (startOffSet==selEnd || startOffSet==selStart)))
+ {
+ selStartOffSet=startOffSet;
+ if (selVisible)
+ update(ufView);
+ else
+ update(ufLine);
+ selHided=False;
+ // Make the selected area NULL because if the start of selection forced a
+ // line flush we will repaint the screen but with selHided==False so the
+ // old selection will be visible for a fraction of a second, that's annoying
+ selEnd=selStart=selStartOffSet;
+ }
+ selecting=True;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Update the selected area according to the new position of the cursor. It
+also makes a copy of the selection to the auxiliar OS clipboard (selection
+clipboard) and the "selection" search clipboard.
+
+***************************************************************************/
+
+void TCEditor::UpdateSelecting(void)
+{
+ uint32 actualPos=(uint32)(ColToPointerPost()-buffer);
+
+ if (actualPos>selStartOffSet)
+ {
+ selStart=selStartOffSet;
+ selEnd=actualPos;
+ }
+ else
+ {
+ selStart=actualPos;
+ selEnd=selStartOffSet;
+ }
+ // Sanity check
+ if (selStart>bufLen)
+ selStart=bufLen;
+ if (selEnd>bufLen)
+ selEnd=bufLen;
+
+ SetSelectionBuffer();
+
+ if (TVOSClipboard::isAvailable()>1)
+ clipWinCopy(1);
+}
+
+/****************************************************************************
+
+ Function: void MoveCursor(char *ori,char *dest)
+
+ Type: TCEditor member.
+
+ Objetive: Moves the cursor from one point of the buffer to other based on
+ pointers to this location, ori is the actual position of the cursor.
+ The funtion computes the \n and the tabs.
+
+ Parameters:
+ ori: Pointer to the cursor position.
+ dest: Pointer to the new cursor position.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::MoveCursor(char *ori,char *dest)
+{
+ if (ori>dest)
+ {
+ while (ori>dest)
+ {
+ ori--;
+ if (*ori=='\n')
+ curLinePtr-=lenLines[--curPos.y];
+ }
+ char *s=curLinePtr;
+ curPos.x=0;
+ while (s!=dest)
+ {
+ AdvanceWithTab(*s++,curPos.x);
+ }
+ }
+ else
+ while (dest!=ori)
+ {
+ switch (*ori++)
+ {
+ case '\n': curLinePtr+=lenLines[curPos.y++];
+ curPos.x=0;
+ break;
+ case '\t': MoveWithTab(curPos.x);
+ break;
+ case '\r': break;
+ default: curPos.x++;
+ }
+ }
+}
+
+
+/****************************************************************************
+
+ Function: int prevWord()
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor to the previous word in the text.
+
+ Return:
+ How many characters was moved the cursor.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::prevWord(Boolean moveCursor)
+{
+ char *p=ColToPointer();
+ if (p==buffer)
+ return 0;
+ char *ori=p;
+
+ if (isWordChar(*p) && isWordChar(*(p-1)))
+ { // If we are inside a word (not at start or outside)
+ // Move to the start
+ while (p>buffer && isWordChar(*p)) p--;
+ // Adjust
+ if (p<ori) p++;
+ }
+ else
+ {
+ // Get out of the start of the word or the EOL or we'll stay here
+ if (isWordChar(*p) || CLY_IsEOL(*p))
+ p--;
+ // Skip the spaces but stop in EOLs
+ while (p>buffer && !isWordChar(*p) && CLY_IsntEOL(*p)) p--;
+ if (isWordChar(*p))
+ { // We found a word
+ // Go to the start
+ while (p>buffer && isWordChar(*p)) p--;
+ // Adjust
+ if (!isWordChar(*p)) p++;
+ }
+ else
+ // We found an EOL so if is a DOS file move to the CR or it will bomb
+ if (p>buffer && *(p-1)=='\r') p--;
+ }
+ if (p>ori)
+ p=ori;
+ else
+ if (moveCursor)
+ MoveCursor(ori,p);
+ return (int)(p-ori);
+}
+
+/****************************************************************************
+
+ Function: int nextWord()
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor to the next word in the text.
+
+ Return:
+ How many characters was moved the cursor.
+ See nextCWord() for comments, it almost the same but uses !isWord...
+ instead of isspace.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::nextWord()
+{
+ int dif;
+ char *p=ColToPointer(dif);
+ char *ori=p;
+ char *end=buffer+bufLen;
+
+ if (p==end)
+ return 0;
+
+ if (dif>0)
+ {
+ ori--;
+ p--;
+ }
+
+ if (CLY_IsEOL(*p))
+ {
+ if (!CLY_IsTrueEOL(*p))
+ do { p++; } while (p<end && !CLY_IsTrueEOL(*p));
+ p+=CLY_LenEOL;
+ if (p>=end)
+ return 0;
+ }
+ else
+ {
+ if (!isWordChar(*p))
+ while (p<end && CLY_IsntEOL(*p) && !isWordChar(*p)) p++;
+ else
+ while (p<end && isWordChar(*p)) p++;
+ }
+ if (CLY_IsntEOL(*p))
+ while (p<end && !isWordChar(*p) && CLY_IsntEOL(*p)) p++;
+ if (p==end) p--;
+ if (ori>p)
+ p=ori;
+ else
+ MoveCursor(ori,p);
+ return (int)(p-ori);
+}
+
+/****************************************************************************
+
+ Function: int nextCWord()
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor to the next word in the text but stoping in
+ any symbol.
+ Used by DeleteWord
+ Here is how it works:
+ 1 If we are at the end of line skip the EOL and goto 5.
+ 2 else If we are in a space go to 5.
+ 3 else If we are in a symbol eat just one and go to 5.
+ 4 else skip the word.
+ 5 If we aren't at the EOL skip all the SPACES but stop if an EOL is reached.
+
+ What's the effect?
+ a) If we are at the end of a line the line is concatenated with the next
+ line but the spaces are deleted.
+ b) Never delete a word+symbols in one pass.
+ c) Never delete space and more than one symbol in one pass.
+ d) Ever stop at EOLs to avoid deleting various lines.
+
+ That's how BC behaves (or very close to ...) and that's what I spect.
+
+ Return:
+ How many characters was moved the cursor.
+
+ 30/9/97:
+ I changed the behavior to get even more compatibility with the BC behavior. Now
+ the symbols aren't eated so quickly.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::nextCWord()
+{
+ int dif;
+ char *p=ColToPointer(dif);
+ char *ori=p;
+ char *end=buffer+bufLen;
+
+ if (p==end)
+ return 0;
+
+ // Count the tab later
+ if (dif>0)
+ {
+ //ori--;
+ p--;
+ }
+
+ if (CLY_IsEOL(*p))
+ { // If we are at the end of the line delete the EOL
+ p+=CLY_LenEOL;
+ if (p>=end)
+ return 0;
+ }
+ else
+ { // If not:
+ if (!ucisspace(*p))
+ {
+ if (isWordChar(*p))
+ // If we are in a word delete up-to the end
+ while (p<end && isWordChar(*p)) p++;
+ else
+ p++;
+ }
+ }
+ // Eat ONLY the remaining spaces
+ if (CLY_IsntEOL(*p))
+ while (p<end && ucisspace(*p) && CLY_IsntEOL(*p)) p++;
+ // Here are some safety checks that don't remember when are needed
+ if (p==end) p--;
+ if (ori>p)
+ p=ori;
+ else
+ MoveCursor(ori,p);
+ return (int)(p-ori);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Moves the cursor to the end of the word. If the cursor isn't inside a word
+isn't moved. Is highlevel (flushLine and undo).
+
+ Return:
+ The number of characters moved.
+
+***************************************************************************/
+
+int TCEditor::goEndWord()
+{
+ flushLine();
+
+ int dif;
+ char *p=ColToPointer(dif);
+ char *ori=p;
+ char *end=buffer+bufLen;
+
+ if (p>=end || dif || !isWordChar(*p))
+ return 0;
+
+ while (p<end && isWordChar(*p)) p++;
+ addToUndo(undoInMov);
+ MoveCursor(ori,p);
+
+ return p-ori;
+}
+
+void TCEditor::Beep(void)
+{
+ CLY_Beep();
+}
+
+
+/****************************************************************************
+
+ Function: void AdjustBufEditFor(int lar)
+
+ Type: TCEditor member.
+
+ Objetive: Adjust the length of the bufEdit buffer to support lar chars.
+ limit.x is adjusted too. The function reallocates the buffer for this
+ reason inEditPtr is updated.
+
+ Parameters:
+ lar: Desired legth.
+
+ Returns:
+ 0 = OK.
+ 1 = Impossible.
+
+ by SET.
+
+****************************************************************************/
+
+int TCEditor::AdjustBufEditFor(int lar)
+{
+ if (lar>bufEditLen)
+ {
+ char *s=bufEdit;
+
+ if (lar>MaxLineLen)
+ {
+ Beep();
+ return 1;
+ }
+ if (limit.x<=lar)
+ limit.x=lar+1;
+ bufEditLen=limit.x+min(DeltaLineLen,MaxLineLen-limit.x);
+ if ((s=(char *)realloc(bufEdit,bufEditLen+4))!=NULL)
+ {
+ inEditPtr=s+(int)(inEditPtr-bufEdit);
+ bufEdit=s;
+ return 0;
+ }
+ Beep();
+ return 1;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+ Description:
+ Computes inEditPtr value for the current curPos.x value.
+***************************************************************************/
+
+int TCEditor::ComputeXLineInEdition(Boolean alsoRestChars)
+{
+ int i;
+ // Calculate the position inside the buffer
+ for (inEditPtr=bufEdit, i=0; i<curPos.x && *inEditPtr;
+ inEditPtr++)
+ {
+ AdvanceWithTab(*inEditPtr,i);
+ }
+ if (i>curPos.x) // Only when the cursor is over a tab
+ inEditPtr--;
+ if (alsoRestChars)
+ for (restCharsInLine=0; inEditPtr[restCharsInLine]; restCharsInLine++);
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts the edition of the line under the cursor.
+
+***************************************************************************/
+
+void TCEditor::EditLine(Boolean allowUndo)
+{
+ int i;
+
+ lineInEdition=curPos.y;
+
+ // Copy the line into the edition buffer
+ int lar=LenWithoutCRLF(lineInEdition,curLinePtr);
+
+ unsigned startLine=(unsigned)(curLinePtr-buffer);
+ unsigned endLine=startLine+lar;
+
+ // See if we have enough buffer for this line.
+ if (AdjustBufEditFor(max(lar,limit.x-1)))
+ {
+ if (lar==MaxLineLen+1)
+ return;
+ if (editorDialog( edLineOverflow )==cmYes)
+ {
+ int X=curPos.x;
+ addToUndo(undoInMov);
+ Boolean oldAI=autoIndent;
+ autoIndent=False;
+ curPos.x=MaxLineLen;
+ newLine();
+ MoveCursorTo(X,curPos.y-1,True);
+ autoIndent=oldAI;
+ if (AdjustBufEditFor(max(lar,limit.x-1)))
+ return;
+ }
+ else
+ return;
+ }
+
+ IslineInEdition=True;
+ memcpy(bufEdit,curLinePtr,lar);
+ bufEdit[lar]=0;
+ i=ComputeXLineInEdition();
+
+ // Is large enough to hold the cursor pos?
+ int added=0;
+ if (i<curPos.x)
+ { // Nop, insert spaces
+ added=CalcNeededCharsToFill(i,curPos.x,tabSize,OptimalFill);
+ FillGapInBuffer(i,curPos.x,bufEdit+lar,tabSize,OptimalFill);
+ #ifndef DISABLE_AUTOSP_PATCH
+ if (allowUndo)
+ {
+ stUndoInsert st={bufEdit+lar,NULL,added};
+ int aux=curPos.x;
+ curPos.x=i;
+ addToUndo(undoPreInsert,NULL);
+ curPos.x=aux;
+ addToUndo(undoInsert,(void *)&st);
+ }
+ #endif
+ inEditPtr=bufEdit+lar+added;
+ lar+=added;
+ *inEditPtr=0;
+ }
+ restCharsInLine=lar-(int)(inEditPtr-bufEdit);
+
+ selNewStart=selStart;
+ selNewEnd=selEnd;
+
+ if (hasSelection())
+ {
+ // If we added spaces and the spaces are inside of the seleccion take care about it
+ if (added && selEnd>endLine)
+ {
+ if (selStart>endLine)
+ {
+ //added++;
+ selNewEnd+=added;
+ selNewStart+=added;
+ }
+ else
+ selNewEnd+=added;
+ }
+ if (selStart<=startLine)
+ {
+ if (selNewEnd>startLine) // No for New
+ {
+ selLineStart=0;
+ selLineEnd=selNewEnd-startLine; // No for New
+ }
+ else
+ { selLineStart=selLineEnd=0; }
+ }
+ else
+ {
+ if (selNewStart<endLine) // No for New
+ {
+ selLineStart=selNewStart-startLine; // No for New
+ selLineEnd=selNewEnd-startLine; // No for New
+ }
+ else
+ { selLineStart=selLineEnd=lar+1; } // Out off the line
+ }
+ }
+ else
+ {
+ selLineStart=0;
+ selLineEnd=0;
+ }
+
+ // Translate the markers
+ for (i=0; i<10; i++)
+ {
+ unsigned Pos=Markers[i];
+ if (startLine<=Pos && Pos<endLine)
+ MarkersInLine[i]=Pos-startLine;
+ else
+ MarkersInLine[i]=-1;
+ }
+
+ // Copy the original attribute
+ attrInEdit=lenLines.getAttr(lineInEdition);
+}
+
+/**[txh]********************************************************************
+
+ Description: Create the dialog for Search & Replace and execute it.
+
+***************************************************************************/
+
+void TCEditor::replace()
+{
+ char *Word;
+ int ret;
+
+ if (isReadOnly) return;
+ if ((Word=WordUnderCursor(80))!=NULL)
+ {
+ strcpy(findStr,Word);
+ delete[] Word;
+ }
+
+ editorFlags&=~efOptimizedRegex;
+ TReplaceCDialogRec replaceRec(findStr,replaceStr,editorFlags,SearchInSel,FromWhere);
+ TRegexDialogRec regexRec;
+ regexRecCreate(regexRec);
+
+ if ((ret=editorDialog(edReplace,&replaceRec,&regexRec))!=cmCancel)
+ {
+ regexRecUpdate(regexRec);
+ strcpy(findStr,replaceRec.find);
+ strcpy(replaceStr,replaceRec.replace);
+ editorFlags=replaceRec.options | efDoReplace;
+ if (replaceRec.direction)
+ editorFlags|=efSearchBack;
+ else
+ editorFlags&=~efSearchBack;
+ if (ret==cmYes)
+ editorFlags|=efReplaceAll;
+ SearchInSel=replaceRec.in_sel;
+ FromWhere=replaceRec.from;
+ if (FromWhere)
+ StartOfSearch=editorFlags & efSearchBack ? bufLen-1 : 0; // All
+ else
+ StartOfSearch=(unsigned)(ColToPointer()-buffer);
+ if (CompileSearch(findStr,replaceStr))
+ return;
+ doSearchReplace();
+ }
+}
+
+/****************************************************************************
+
+ Function: void scrollTo( int x, int y )
+
+ Type: TCEditor member.
+
+ Objetive: Adjust the delta to make the x,y point visible.
+
+ Parameters:
+ x,y cursor position.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+void TCEditor::scrollTo( int x, int y )
+{
+ x = max(0, min(x, limit.x - size.x));
+ y = max(0, min(y, limit.y)); // - size.y cutted
+ if ( x != delta.x || y != delta.y )
+ {
+ delta.x = x;
+ delta.y = y;
+ update(ufView);
+ }
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds what line contains the desired offset. The rest value returns the
+offset inside the line.
+
+ Return:
+ The line number.
+
+***************************************************************************/
+
+int TCEditor::FindLineForOffSet(unsigned offset, unsigned &rest)
+{
+ unsigned offCursor=curLinePtr-buffer;
+ unsigned here,thisLine;
+ int y;
+ if (offset>offCursor)
+ {// Search from the cursor
+ here=offCursor;
+ y=curPos.y;
+ do
+ {
+ thisLine=lenLines[y++];
+ here+=thisLine;
+ }
+ while (here<=offset);
+ rest=thisLine-(here-offset);
+ return y-1;
+ }
+ if (offset<offCursor/2)
+ {// Search from start
+ here=0; y=0;
+ do
+ {
+ thisLine=lenLines[y++];
+ here+=thisLine;
+ }
+ while (here<=offset);
+ rest=thisLine-(here-offset);
+ return y-1;
+ }
+ // Search backwards from the cursor
+ here=offCursor;
+ y=curPos.y;
+ while (y>0 && here>offset)
+ {
+ thisLine=lenLines[--y];
+ here-=thisLine;
+ }
+ rest=offset-here;
+ return y+1;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the syntax highlight for a character pointed by an offset in the
+file.
+
+ Return: The shl flags.
+
+***************************************************************************/
+
+uint32 TCEditor::SyntaxHighlightForOffset(unsigned offset)
+{
+ if (SyntaxHL==shlNoSyntax)
+ return 0;
+ unsigned rest;
+ int y=FindLineForOffSet(offset,rest);
+ uint32 attr=lenLines.getAttr(y);
+ LineMeassure(buffer+offset-rest,buffer+offset,attr,NULL);
+ return attr;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the extra SHL attributes for a position. We must know the pointer
+to the line start, a pointer to the character and the line number.
+
+ Return: The extra attributes (in string, comment and/or preprocessor).
+
+***************************************************************************/
+
+uint32 TCEditor::SyntaxHighlightExtraFor(char *lineStart, char *posTarget,
+ int line)
+{
+ if (SyntaxHL==shlNoSyntax)
+ return 0;
+ uint32 attr=line ? lenLines.getAttr(line-1) : 0;
+ uint32 extra;
+ LineMeassure(lineStart,posTarget,attr,&extra);
+ return extra;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Make a Search with/out Replace calling scan and iScan. @var{findStr} is
+the string to search and @var{opts} are the flags to indicate the action and
+type of search.
+
+***************************************************************************/
+
+Boolean TCEditor::search(const char *, unsigned opts)
+{
+ unsigned pos,end_s;
+ unsigned i=sfSearchFailed;
+ int MatchLen=0,scrllCenter;
+
+ if (editorFlags & efSearchBack)
+ {
+ if (SearchInSel)
+ {
+ pos=min(StartOfSearch,selEnd);
+ end_s=selStart;
+ }
+ else
+ {
+ pos=StartOfSearch;
+ end_s=0;
+ }
+ }
+ else
+ {
+ if (SearchInSel)
+ {
+ pos=max(StartOfSearch,selStart);
+ end_s=selEnd;
+ }
+ else
+ {
+ pos=StartOfSearch;
+ end_s=bufLen;
+ }
+ }
+
+ do
+ {
+ if (editorFlags & efSearchBack)
+ {
+ if (pos>end_s)
+ i=MakeASearchBack(&buffer[pos],pos-end_s,MatchLen);
+ }
+ else
+ {
+ if (pos<end_s)
+ i=MakeASearch(&buffer[pos],end_s-pos,MatchLen);
+ }
+
+ if (i!=sfSearchFailed)
+ {
+ if (editorFlags & efSearchBack)
+ i=pos-i;
+ else
+ i+=pos;
+ int takeThisHit=1;
+ // Whole Words, the following can be expressed in one line, but I doubt gcc
+ // will generate better code; what I'm sure is that then is very hard to understand
+ if (opts & efWholeWordsOnly)
+ {// The letter before the first character can't be another letter
+ if (i && isWordChar(bufChar(i-1)))
+ takeThisHit=0;
+ else // The letter after the match can't be another letter
+ if (i+MatchLen<bufLen && isWordChar(bufChar(i+MatchLen)))
+ takeThisHit=0;
+ }
+ // In/Outside comments
+ if (takeThisHit && SyntaxHL!=shlNoSyntax &&
+ (opts & (efSearchInComm | efSearchOutComm)))
+ {// Find the attributes of this point
+ uint32 attr=SyntaxHighlightForOffset(i);
+ if (attr & IsInsideCom)
+ takeThisHit=opts & efSearchInComm;
+ else
+ takeThisHit=opts & efSearchOutComm;
+ }
+ if (takeThisHit)
+ {
+ lock();
+ selStartF=i;
+ selEndF=i+MatchLen;
+ addToUndo(undoInMov);
+ GotoOffSet(selEndF);
+ scrllCenter=CheckScrollLockCenters;
+ trackCursor((scrllCenter || !cursorVisible()) ? True : False);
+ GotoOffSet(i);
+ trackCursor((scrllCenter || !cursorVisible()) ? True : False);
+ if (opts & efShowFuncName)
+ ShowWhichFunInStatus();
+ update(ufView | ufFound);
+ unlock();
+ return True;
+ }
+ else
+ pos=editorFlags & efSearchBack ? i+MatchLen-1 : i+1;
+ }
+ }
+ while (i!=sfSearchFailed);
+ return False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Performes a regex search and jumps to the hit. This function uses the
+editor's search machinery and restore the previous values before returning.
+
+ Return: !=0 if a hit found.
+
+***************************************************************************/
+
+Boolean TCEditor::SearchAndJump(char *text, unsigned flags)
+{
+ // Back-up current options
+ unsigned oldEdFlags=editorFlags;
+ ushort oldSearchInSel=SearchInSel;
+ ushort oldFromWhere=FromWhere;
+ ushort oldRegExStyle=RegExStyle;
+ unsigned oldStartOfSearch=StartOfSearch;
+
+ // Create new search
+ editorFlags=flags;
+ CompileSearch(text);
+ SearchInSel=0;
+ FromWhere=1;
+ RegExStyle=efBasicRegEx;
+ StartOfSearch=0;
+ Boolean ret=search(text,flags);
+
+ // Restore normal search
+ SearchInSel=oldSearchInSel;
+ FromWhere=oldFromWhere;
+ RegExStyle=oldRegExStyle;
+ editorFlags=oldEdFlags;
+ StartOfSearch=oldStartOfSearch;
+ CompileSearch(findStr);
+
+ return ret;
+}
+
+/****************************************************************************
+
+ Function: unsigned LineMeassureC(char *s, char *end, uint32 &Attr)
+ unsigned LineMeassurePascal(char *s, char *end, uint32 &Attr)
+ unsigned LineMeassureClipper(char *s, char *end, uint32 &Attr)
+ unsigned LineMeassureGeneric(char *s, char *end, uint32 &Attr)
+
+ Type: Static function.
+
+ Objetive: Meassure the length of the line and calculate the syntax
+ highlight flags.
+ There are one for each syntax highlight system.
+
+ Parameters:
+ char *s: Pointer to the start of the line.
+ char *end: Pointer to the end of the buffer.
+ uint16 &Attr: In => Attribute of the previous line.
+ Out => Attribute of this line.
+
+ Returns:
+ The length of the line.
+
+ Notes:
+ for C:
+ Added support for strings that have a \ at the end of a line (by Robert).
+ Added support for // \ feature of gcc.
+
+ by SET.
+
+****************************************************************************/
+
+
+static
+unsigned LineMeassureC(char *s, char *end, uint32 &Attr, uint32 *extra)
+{
+ uint32 l=0;
+ char *end2=end-1;
+ int in_char=0;
+ int in_string=0;
+ int in_com=0;
+ int in_prepro=0;
+ int firstchar=1;
+ uint32 attr=Attr;
+
+ if (attr & ExtCom)
+ {
+ attr|=InsideCom | StartInCom;
+ attr&=Not_ExtCom2;
+ in_com=1;
+ }
+ else
+ if (attr & ExtCom2)
+ {
+ attr|=InsideCom | StartInCom;
+ attr&=Not_ExtCom2;
+ in_com=1;
+ }
+ else
+ attr&=Not_InsideCom & Not_StartInCom; // If not clear that
+
+ if (!(attr & ExtPrepro))
+ attr&=Not_Prepro;
+ else
+ in_prepro=1;
+
+ if (attr & ExtString)
+ in_string = 1;
+
+ attr&=FilterHere;
+
+ if (in_string)
+ attr|=StartString;
+
+ while (s<end && *s!='\n')
+ {
+ if (*s=='\'')
+ {
+ if (!in_com && !in_string)
+ {
+ in_char=!in_char;
+ firstchar=0;
+ }
+ }
+ else
+ if (*s=='\"')
+ {
+ if (!in_com && !in_char)
+ {
+ in_string=!in_string;
+ firstchar=0;
+ }
+ }
+ else
+ // A line ended with \ is concatenated with the next line
+ if (*s=='\\' && (s==end2 || CLY_IsEOL(*(s+1))))
+ {
+ if (in_string)
+ attr|=ExtString;
+ else
+ if (in_com) /*(attr & (ComInside | InsideCom | StartInCom))*/
+ attr|=ExtCom2;
+ else
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ else
+ if (*s=='\\' && (in_string || in_char))
+ {
+ s++;
+ l++;
+ }
+ else
+ if (!in_string && !in_char)
+ {
+ switch (*s)
+ {
+ case '/':
+ if (!in_com && s<end2)
+ {
+ s++;
+ if (*s=='/')
+ {
+ in_com=1;
+ attr|=ComInside;
+ if (firstchar)
+ attr|=InsideCom;
+ l++;
+ }
+ else
+ if (*s=='*')
+ {
+ in_com=1;
+ attr|=StartCom | ExtCom;
+ if (firstchar)
+ attr|=InsideCom;
+ l++;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case '*':
+ if (s<end2)
+ {
+ s++;
+ if (*s=='/' && !(attr & ComInside) && (attr & (ExtCom | InsideCom)))
+ {
+ in_com=0;
+ attr|=EndCom;
+ attr&=Not_ExtCom & Not_InsideCom;
+ l++;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case '#':
+ if (firstchar)
+ {
+ firstchar=0;
+ in_prepro=1;
+ attr|=Prepro;
+ }
+ break;
+
+ default:
+ if (firstchar && !ucisspace(*s))
+ firstchar=0;
+ }
+ }
+ ++l;
+ ++s;
+ }
+ // I saw that in a source of John (aka Fighteer), the string is propagated.
+ if (in_string)
+ {
+ attr|=ExtString;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ // Comments of type /* */ with more than 1 line in a preprocessor line
+ if (in_prepro && (attr & ExtCom))
+ attr|=ExtPrepro;
+ Attr=attr;
+ if (extra)
+ {
+ *extra=0;
+ if (in_string) *extra|=InString;
+ if (in_char) *extra|=InString2;
+ if (in_com) *extra|=InComment;
+ if (in_prepro) *extra|=InPrepro;
+ }
+#if 0
+ if (l && *s=='\n') l++;
+#else
+ // Touched by Robert, I don't know if it's safe
+ if (s<end && *s=='\n') l++;
+#endif
+ return l;
+}
+
+
+static
+unsigned LineMeassurePascal(char *s, char *end, uint32 &Attr, uint32 *extra)
+{
+ uint32 l=0;
+ char *end2=end-1;
+ int in_string=0;
+ int in_com1=0;
+ int in_com2=0;
+ int in_prepro = 0;
+ int firstchar=1;
+ uint32 attr=Attr;
+
+ if (attr & ExtCom)
+ {
+ attr|=InsideCom | StartInCom;
+ in_com1=1;
+ }
+ else
+ if (attr & ExtCom2)
+ {
+ attr|=InsideCom2 | StartInCom2;
+ in_com2=1;
+ }
+ else
+ attr&=Not_InsideCom & Not_StartInCom & Not_InsideCom2 & Not_StartInCom2;
+
+ if (!(attr & ExtPrepro))
+ attr&=Not_Prepro;
+ else
+ in_prepro=1;
+
+ attr&=FilterHere;
+
+ while (s<end && *s!='\n')
+ {
+ if (*s=='\'')
+ {
+ if (!in_prepro && !in_com1 && !in_com2)
+ {
+ in_string=!in_string;
+ firstchar=0;
+ }
+ }
+ else
+ if (*s=='\\' && (s==end2 || CLY_IsEOL(*(s+1))))
+ {
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ else
+ if (!in_string)
+ {
+ switch (*s)
+ {
+ case '#':
+ if (firstchar)
+ {
+ firstchar=0;
+ in_prepro=1;
+ attr|=Prepro;
+ }
+ break;
+
+ case '(':
+ if (!in_com1 && !in_com2 && s<end2)
+ {
+ s++;
+ if (*s=='*')
+ {
+ in_com1=1;
+ attr|=StartCom | ExtCom;
+ if (firstchar)
+ attr|=InsideCom;
+ l++;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case '{':
+ if (!in_com1 && !in_com2)
+ {
+ in_com2=1;
+ attr|=StartCom2 | ExtCom2;
+ if (firstchar)
+ attr|=InsideCom2;
+ }
+ firstchar=0;
+ break;
+
+ case '*':
+ if (s<end2 && !in_com2)
+ {
+ s++;
+ if (*s==')' && !(attr & ComInside) && (attr & (ExtCom | InsideCom)))
+ {
+ in_com1=0;
+ attr|=EndCom;
+ attr&=Not_ExtCom & Not_InsideCom;
+ l++;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case '}':
+ if (!in_com1 && !(attr & ComInside) && (attr & (ExtCom2 | InsideCom2)))
+ {
+ in_com2=0;
+ attr|=EndCom2;
+ attr&=Not_ExtCom2 & Not_InsideCom2;
+ }
+ firstchar=0;
+ break;
+
+ default:
+ if (firstchar && !ucisspace(*s))
+ firstchar=0;
+ }
+ }
+ ++l;
+ ++s;
+ }
+ Attr=attr;
+ if (extra)
+ {
+ *extra=0;
+ if (in_string) *extra|=InString;
+ if (in_com1 ||
+ in_com2) *extra|=InComment;
+ if (in_prepro) *extra|=InPrepro;
+ }
+#if 0
+ if (l && *s=='\n') l++;
+#else
+ if (*s=='\n') l++;
+#endif
+ return l;
+}
+
+
+
+static
+unsigned LineMeassureClipper(char *s, char *end, uint32 &Attr, uint32 *extra)
+{
+ uint32 l=0;
+ char *end2=end-1;
+ char *end3=end-3;
+ int in_char=0;
+ int in_string=0;
+ int in_com=0;
+ int in_prepro=0;
+ int firstchar=1;
+ uint32 attr=Attr;
+
+ if (attr & ExtCom)
+ {
+ attr|=InsideCom | StartInCom;
+ in_com=1;
+ }
+ else
+ attr&=Not_InsideCom & Not_StartInCom;
+ if (!(attr & ExtPrepro))
+ attr&=Not_Prepro;
+ else
+ in_prepro=1;
+ attr&=FilterHere;
+
+ while (s<end && *s!='\n')
+ {
+ if (*s=='\'')
+ {
+ if (!in_prepro && !in_com && !in_string)
+ {
+ in_char=!in_char;
+ firstchar=0;
+ }
+ }
+ else
+ if (*s=='\"')
+ {
+ if (!in_prepro && !in_com && !in_char)
+ {
+ in_string=!in_string;
+ firstchar=0;
+ }
+ }
+ else
+ if (!in_string && !in_char)
+ {
+ switch (*s)
+ {
+ case '/':
+ if (!in_com && s<end2)
+ {
+ s++;
+ if (*s=='/')
+ {
+ in_com=1;
+ attr|=ComInside;
+ if (firstchar)
+ attr|=InsideCom;
+ l++;
+ }
+ else
+ if (*s=='*')
+ {
+ in_com=1;
+ attr|=StartCom | ExtCom;
+ if (firstchar)
+ attr|=InsideCom;
+ l++;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case '&':
+ if (!in_com && s<end2)
+ {
+ s++;
+ if (*s=='&')
+ {
+ in_com=1;
+ attr|=ComInside;
+ if (firstchar)
+ attr|=InsideCom;
+ l++;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case '*':
+ if (s<end2)
+ {
+ s++;
+ if (*s=='/' && !(attr & ComInside) && (attr & (ExtCom | InsideCom)))
+ {
+ in_com=0;
+ attr|=EndCom;
+ attr&=Not_ExtCom & Not_InsideCom;
+ l++;
+ }
+ else
+ if (!(attr & ComInside) && !(attr & InsideCom) &&
+ s<end3 && *s==' ' && *(s+1)=='-')
+ {
+ in_com=1;
+ attr|=ComInside;
+ if (firstchar)
+ attr|=InsideCom;
+ s+=2;
+ l+=3;
+ }
+ else
+ --s;
+ }
+ firstchar=0;
+ break;
+
+ case ';':
+ if ((s==end2 || CLY_IsEOL(*(s+1))) && in_prepro)
+ attr|=ExtPrepro;
+ firstchar=0;
+ break;
+
+ case '#':
+ if (firstchar)
+ {
+ firstchar=0;
+ in_prepro=1;
+ attr|=Prepro;
+ }
+ break;
+
+ default:
+ if (firstchar && !ucisspace(*s))
+ firstchar=0;
+ }
+ }
+ ++l;
+ ++s;
+ }
+ Attr=attr;
+ if (extra)
+ {
+ *extra=0;
+ if (in_string) *extra|=InString;
+ if (in_char) *extra|=InString2;
+ if (in_com) *extra|=InComment;
+ if (in_prepro) *extra|=InPrepro;
+ }
+#if 0
+ if (l && *s=='\n') l++;
+#else
+ if (*s=='\n') l++;
+#endif
+ return l;
+}
+
+/*****************************************************************************
+
+ That's the generic version, is a little complex but seems to work, at least
+for C/C++.
+ Some parts are like that: isComment() && CheckForSequence..., that means a
+very important improvement in speed, without that the speed of the routine
+is a dissaster in comparisson with the specialized C version.
+
+*****************************************************************************/
+
+static
+unsigned LineMeassureGeneric(char *s, char *end, uint32 &Attr, uint32 *extra)
+{
+ uint32 l=0;
+ char *end2=end-1;
+ int in_string=0,in_string2=0,in_string3=0;
+ int type_com=0;
+ int in_prepro=0;
+ int firstchar=1;
+ // firstCol is realted to the FG1_EOLCInFirstCol, trick to avoid anding
+ int firstCol1_1=1,firstCol2_1=1,firstCol1_2,firstCol2_2;
+ int firstUse1_1=1,firstUse2_1=1,firstUse1_2,firstUse2_2;
+ int escapeAnywhere, VHDLNumbers, VHDLStr1, VHDLStr2, VHDLShortStr;
+ uint32 attr=Attr;
+ char *start=s;
+
+ // Set the Case Sensitive comparation status for check sequence
+ CheckSeqCase =(TCEditor::strC.Flags1 & FG1_CaseSensitive)!=0;
+ firstCol1_2 =(TCEditor::strC.Flags1 & FG1_EOLCInFirstCol1)==0;
+ firstCol2_2 =(TCEditor::strC.Flags1 & FG1_EOLCInFirstCol2)==0;
+ firstUse1_2 =(TCEditor::strC.Flags1 & FG1_EOLCInFirstUse1)==0;
+ firstUse2_2 =(TCEditor::strC.Flags2 & FG2_EOLCInFirstUse2)==0;
+ escapeAnywhere=(TCEditor::strC.Flags2 & FG2_EscapeAnywhere)!=0;
+ VHDLNumbers =(TCEditor::strC.Flags2 & FG2_VHDLNumbers)!=0;
+ VHDLStr1 =(TCEditor::strC.Flags2 & FG2_VHDLStr1)!=0;
+ VHDLStr2 =(TCEditor::strC.Flags2 & FG2_VHDLStr2)!=0;
+ VHDLShortStr =(TCEditor::strC.Flags2 & FG2_VHDLShortStr)!=0;
+ // Is the continuation of a comment?
+ if (attr & ExtCom) // Type 1
+ {
+ attr|=InsideCom | StartInCom; // So is inside and starts commented
+ attr&=Not_ExtOneLineCom; // Not extend single line
+ type_com=1;
+ }
+ else
+ if (attr & ExtCom2) // Type 2 idem
+ {
+ attr|=InsideCom2 | StartInCom2;
+ attr&=Not_ExtOneLineCom;
+ type_com=2;
+ }
+ else
+ if (attr & ExtOneLineCom) // One line
+ {
+ attr|=InsideCom | StartInCom;
+ attr&=Not_ExtOneLineCom;
+ type_com=3;
+ }
+ else
+ attr&=Not_InsideCom & Not_StartInCom; // If not clear that
+
+ // Is the continuation of a preprocessor line?
+ if (!(attr & ExtPrepro))
+ attr&=Not_Prepro; // No clean it
+ else
+ in_prepro=1; // Yes
+
+ // Is the continuation of an string?
+ if (attr & ExtString)
+ in_string=1;
+ if (attr & ExtString2)
+ in_string2=1;
+ if (attr & ExtString3)
+ in_string3=1;
+
+ attr&=FilterHere;
+
+ if (in_string)
+ {
+ attr|=StartString;
+ if (s==end || *s=='\n') // That's a particular case where lines are empty
+ {
+ attr|=ExtString;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ }
+ if (in_string2)
+ {
+ attr|=StartString2;
+ if (s==end || *s=='\n')
+ {
+ attr|=ExtString2;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ }
+ if (in_string3)
+ {
+ attr|=StartString3;
+ if (s==end || *s=='\n')
+ {
+ attr|=ExtString3;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ }
+
+
+ while (s<end && *s!='\n')
+ {
+ if (/*!in_prepro && */!type_com) // Yes, strings exist inside preprocessor.
+ {
+ if (escapeAnywhere && *s==TCEditor::strC.Escape && CLY_IsntEOL(*(s+1)))
+ {
+ s+=2;
+ continue;
+ }
+ if (isString(*s) || in_string)
+ {
+ if (!in_string)
+ {
+ s++;
+ in_string=1;
+ }
+ firstchar=0;
+ while (s<end && *s!='\n')
+ {
+ if (*s==TCEditor::strC.Escape)
+ {
+ if (!(s==end2 || CLY_IsEOL(*(s+1))))
+ s++;
+ }
+ else
+ if (isString(*s))
+ {
+ if (VHDLStr1 && s<end2 && isString(s[1]))
+ s++; // VHDL: """" => C/C++: "\""
+ else
+ {
+ in_string=0;
+ s++;
+ break;
+ }
+ }
+ s++;
+ }
+ if (in_string && !VHDLStr1)
+ {
+ attr|=ExtString;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ continue;
+ }
+ // Repeated for string2
+ if (isString2(*s) || in_string2)
+ {
+ if (!in_string2)
+ {
+ s++;
+ in_string2=1;
+ }
+ firstchar=0;
+ while (s<end && *s!='\n')
+ {
+ if (*s==TCEditor::strC.Escape)
+ {
+ if (!(s==end2 || CLY_IsEOL(*(s+1))))
+ s++;
+ }
+ else
+ if (isString2(*s))
+ {
+ if (VHDLStr2 && s<end2 && isString2(s[1]))
+ s++; // VHDL: """" => C/C++: "\""
+ else
+ {
+ in_string2=0;
+ s++;
+ break;
+ }
+ }
+ s++;
+ }
+ if (in_string2 && !VHDLStr2)
+ {
+ attr|=ExtString2;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ continue;
+ }
+ // Repeated for string3
+ if (isString3(*s) || in_string3)
+ {
+ if (!in_string3)
+ {
+ s++;
+ in_string3=1;
+ }
+ firstchar=0;
+ while (s<end && *s!='\n')
+ {
+ if (*s==TCEditor::strC.Escape)
+ {
+ if (!(s==end2 || CLY_IsEOL(*(s+1))))
+ s++;
+ }
+ else
+ if (isString3(*s))
+ {
+ in_string3=0;
+ s++;
+ break;
+ }
+ s++;
+ }
+ if (in_string3)
+ {
+ attr|=ExtString3;
+ if (in_prepro)
+ attr|=ExtPrepro;
+ }
+ continue;
+ }
+
+ if (isCharacter(*s) && !VHDLShortStr)
+ {
+ s++;
+ firstchar=0;
+ while (s<end && *s!='\n')
+ {
+ if (*s==TCEditor::strC.Escape)
+ s++;
+ else
+ if (isCharacter(*s))
+ {
+ s++;
+ break;
+ }
+ s++;
+ }
+ continue;
+ }
+ if ((*s==TCEditor::strC.Preprocessor || *s==TCEditor::strC.Preprocessor2) &&
+ firstchar)
+ {
+ in_prepro=1;
+ attr|=Prepro;
+ s++;
+ continue;
+ }
+ // VHDL numbers can contain ", that's the case for Bit string literals
+ if (VHDLNumbers && (*s=='B' || *s=='O' || *s=='X' || *s=='b' || *s=='o' || *s=='x'))
+ {
+ uint32 dispo=end-s;
+ uint32 pDispo=dispo;
+ int res=isVHDLBitStringLiteral(s,dispo);
+ if (res!=3)
+ {
+ s+=pDispo-dispo;
+ continue;
+ }
+ }
+ }
+ if (in_prepro && *s==TCEditor::strC.Escape && (s==end2 || CLY_IsEOL(*(s+1))))
+ {
+ attr|=ExtPrepro;
+ s++;
+ continue;
+ }
+ int available=end-s;
+ if ((isComment1(*s) && CheckForSequenceNotFirst(TCEditor::strC.OpenCom1,TCEditor::strC.lOpenCom1,available,s))
+ || type_com==1)
+ {
+ if (type_com!=1)
+ {
+ s+=TCEditor::strC.lOpenCom1;
+ available-=TCEditor::strC.lOpenCom1;
+ attr|=StartCom | ExtCom;
+ if (firstchar)
+ attr|=InsideCom;
+ }
+ while (s<end && *s!='\n')
+ {
+ if (isCloseComm1(*s) && CheckForSequenceNotFirst(TCEditor::strC.CloseCom1,TCEditor::strC.lCloseCom1,available,s))
+ {
+ s+=TCEditor::strC.lCloseCom1;
+ attr|=EndCom;
+ attr&=Not_ExtCom & Not_InsideCom;
+ type_com=0;
+ break;
+ }
+ available--;
+ s++;
+ }
+ firstchar=0;
+ }
+ else
+ if (isComment2(*s) && CheckForSequenceNotFirst(TCEditor::strC.OpenCom2,TCEditor::strC.lOpenCom2,available,s))
+ {
+ if (type_com!=2)
+ {
+ s+=TCEditor::strC.lOpenCom2;
+ available-=TCEditor::strC.lOpenCom2;
+ attr|=StartCom2 | ExtCom2;
+ if (firstchar)
+ attr|=InsideCom2;
+ }
+ while (s<end && *s!='\n')
+ {
+ if (isCloseComm2(*s) && CheckForSequenceNotFirst(TCEditor::strC.CloseCom2,TCEditor::strC.lCloseCom2,available,s))
+ {
+ s+=TCEditor::strC.lCloseCom2;
+ attr|=EndCom2;
+ attr&=Not_ExtCom2 & Not_InsideCom2;
+ type_com=0;
+ break;
+ }
+ available--;
+ s++;
+ }
+ firstchar=0;
+ }
+ else
+ if (type_com==3 || // Commented from the previous line
+ // EOL Comment 1
+ (firstCol1_1 && firstUse1_1 && isEOLComment(*s) &&
+ CheckForSequence(TCEditor::strC.EOLCom1,TCEditor::strC.lEOLCom1,available,s))
+ ||
+ // EOL Comment 2
+ (firstCol2_1 && firstUse2_1 && isEOLComment(*s) &&
+ CheckForSequence(TCEditor::strC.EOLCom2,TCEditor::strC.lEOLCom2,available,s))
+ )
+ {
+ if (type_com!=3)
+ {
+ attr|=ComInside;
+ if (firstchar)
+ attr|=InsideCom;
+ }
+ while (s<end && *s!='\n')
+ {
+ if (*s==TCEditor::strC.Escape && (s==end2 || *(s+1)=='\r'))
+ attr|=ExtOneLineCom;
+ s++;
+ }
+ firstchar=0;
+ }
+ else
+ if (!type_com && isSpecialSymb(*s) && s+1<end && isSpecialSCon(s[1]))
+ {// Special symbols acts like one atom
+ s+=2;
+ firstchar=0;
+ continue;
+ }
+ else
+ if (firstchar && !ucisspace(*s))
+ {
+ s++;
+ firstchar=0;
+ }
+ else
+ s++;
+ firstCol1_1=firstCol1_2;
+ firstCol2_1=firstCol2_2;
+ if (!firstchar)
+ {
+ firstUse1_1=firstUse1_2;
+ firstUse2_1=firstUse2_2;
+ }
+ }
+ // Comments of type /* */ with more than 1 line in a preprocessor line
+ if (in_prepro && (attr & (ExtCom | ExtCom2)))
+ attr|=ExtPrepro;
+ Attr=attr;
+ if (extra)
+ {
+ *extra=0;
+ if (in_string) *extra|=InString;
+ if (in_string2) *extra|=InString2;
+ if (in_string3) *extra|=InString3;
+ if (type_com) *extra|=InComment;
+ if (in_prepro) *extra|=InPrepro;
+ }
+ l=s-start;
+#if 0
+ if (l && *s=='\n') l++;
+#else
+ if (*s=='\n') l++;
+#endif
+ return l;
+}
+
+
+/****************************************************************************
+
+ Function: void setBufLen( uint32 length )
+
+ Type: TCEditor member.
+
+ Objetive: Set the length of the buffer, that's very different to the
+ size, the length is the *used* part, the size is the amount of memory
+ allocated (>= length).
+ That forces an initialization of all the variables.
+
+ Parameters:
+ length: length of the buffer.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::setBufLen( uint32 length )
+{
+ bufLen = length;
+ gapLen = 0;
+ selStart = 0;
+ selEnd = 0;
+ curPtr = 0;
+ drawPtr = 0;
+ selStartOffSet = 0;
+ modified=False;
+ modifiedCounter=0; // It could be a random value
+ IsStatusLineOn=False;
+ IsFoundOn=False;
+ IsHLCOn=False;
+
+ uint32 lines = 0,
+ maxLen = 0; // To know how large must be the edition buffer
+ //buffer[length] = 0;
+
+ unsigned conta;
+ int haveASCII0=0;
+ for (conta=0; conta<length; conta++)
+ {
+ if (buffer[conta]=='\r')
+ {
+ conta++;
+ if (conta==length)
+ {
+ setBufSize(length+1);
+ bufLen++; length++;
+ buffer[conta]='\n';
+ }
+ else
+ if (buffer[conta]!='\n')
+ {
+ setBufSize(length+1);
+ bufLen++; length++;
+ memmove(buffer+conta+1,buffer+conta,length-conta);
+ buffer[conta]='\n';
+ }
+ }
+ else
+ if (buffer[conta]==0)
+ haveASCII0=1;
+ #ifdef CLY_UseCrLf
+ else
+ if (buffer[conta]=='\n')
+ {
+ conta++;
+ if (conta==length)
+ {
+ setBufSize(length+1);
+ bufLen++; length++;
+ buffer[conta-1]='\r';
+ buffer[conta]='\n';
+ }
+ else
+ {
+ setBufSize(length+1);
+ bufLen++; length++;
+ memmove(buffer+conta,buffer+conta-1,length-conta+1);
+ buffer[conta-1]='\r';
+ }
+ }
+ #endif
+ }
+
+ if (haveASCII0)
+ messageBox(__("This file contains ASCII 0 values, all the characters in this line after it become invisible. Be careful."),mfWarning | mfOKButton);
+
+ if (bufLen)
+ {
+ char *s=buffer,*end=s+bufLen;
+ uint32 ThisLine;
+ uint32 Attr=0;
+
+#ifndef PROFILE_LINE_MEASSURE
+ CacheSyntaxHLData(GenericSHL);
+ int useProgressBar=0,accumulated=0,chunkSize=0;
+ if (bufLen>(1<<20))
+ {
+ useProgressBar=1;
+ chunkSize=bufLen/110;
+ ProgBar_Init(__("Parsing file"),bufLen);
+ }
+ while (s<end)
+ {
+ ThisLine=LineMeassure(s,end,Attr,NULL);
+ if (ThisLine)
+ {
+ if (ThisLine>65535)
+ {
+ editorDialog(edLineTooLong);
+ isValid=False;
+ return;
+ }
+ lenLines.setAll(lines++,ThisLine,Attr);
+ if (ThisLine>maxLen)
+ maxLen=ThisLine;
+ }
+ s+=ThisLine;
+ if (useProgressBar)
+ {
+ accumulated+=ThisLine;
+ if (accumulated>chunkSize)
+ {
+ accumulated=0;
+ ProgBar_UpDate(s-buffer);
+ }
+ }
+ }
+ if (useProgressBar)
+ ProgBar_DeInit();
+#else
+ clock_t t0,t1,t2,t3;
+ char buf[100];
+
+ LineMeassure=LineMeassureC;
+ t0=clock();
+ while (s<end)
+ {
+ ThisLine=LineMeassure(s,end,Attr);
+ if (ThisLine)
+ {
+ lenLines.setAll(lines++,ThisLine,Attr);
+ if (ThisLine>maxLen)
+ maxLen=ThisLine;
+ }
+ s+=ThisLine;
+ }
+ t1=clock();
+
+ LineMeassure=LineMeassureGeneric;
+ CacheSyntaxHLData(GenericSHL);
+ s=buffer;
+ end=s+bufLen;
+ Attr=0;
+ t2=clock();
+ while (s<end)
+ {
+ ThisLine=LineMeassure(s,end,Attr);
+ if (ThisLine)
+ {
+ lenLines.setAll(lines++,ThisLine,Attr);
+ if (ThisLine>maxLen)
+ maxLen=ThisLine;
+ }
+ s+=ThisLine;
+ }
+ t3=clock();
+
+ messageBox(mfError | mfOKButton,"Tiempo para la de C: %u Tiempo para la generica: %u",t1-t0,t3-t2);
+#endif
+ }
+ else
+ lenLines.setAll(0,0,0);
+ drawLine=0; // First displayed line
+ totalLines=lines ? lines-1 : 0; // Total number of lines
+ limit.y=lines;
+ lineInEdition=0; // Line number in edition process
+ IslineInEdition=False; // There is a line under edition?
+ curLinePtr=buffer; // Pointer to the start of the line under the cursor
+ delta.x=0;
+ delta.y=0; // Origin in window
+ lastCurPos=curPos=delta; // Origin in file
+
+ // Allocate the Edition buffer
+ if (bufEdit && (maxLen>(uint32)bufEditLen))
+ {
+ free(bufEdit);
+ bufEdit=0;
+ }
+ limit.x=max(maxLen,(uint32)MinLineLen);
+ if (!bufEdit)
+ {
+ bufEditLen=limit.x;
+ bufEdit=(char *)malloc(bufEditLen+4);
+ }
+
+ selLineStart=selLineEnd=selNewStart=selNewEnd=0;
+ selHided=False; // Hide the selection
+ NotExpandingMacro=True;
+ memset((void *)Markers,0,10*sizeof(uint32)); // Clean the markers
+
+ // Initialize the undo thing.
+ UndoArray[0].Type=UndoSt=undoNoUndo;
+ UndoBase=UndoActual=UndoTop=0;
+ undoLockCount=undoGroupCount=0;
+ UndoArray[0].X=UndoArray[0].Y=0;
+ UndoArray[0].Count=0;
+
+ // Initialize the rect. sel
+ Xr1=Yr1=Xr2=Yr2=0;
+ selRectHided=True;
+ selRectClip=NULL;
+
+ update(ufView);
+ return;
+}
+
+/****************************************************************************
+
+ Function: Boolean setBufSize( uint32 newSize )
+
+ Type: TCEditor member.
+
+ Objetive: Set the size of the buffer, and allocate the memory for it.
+ The function doesn't use realloc because is dangerous, if we
+ use realloc and it fails we loose all the data.
+
+ Parameters:
+ newSize: obvious.
+
+ Return:
+ True if there is enough space.
+
+ by SET.
+
+****************************************************************************/
+
+// Not 4096 because we will waste a lot of memory bacause libc allocates in
+// powers of 2 and if we need 63000 then we will ask for 65536 + overhead
+// and libc will allocate 131072 bytes, but if we use 4064 we will ask for
+// 64800 + overhead and libc will allocate 65536.
+#define Granularity 4064
+
+static uint32 MakeItGranular( uint32 value )
+{
+ value+=Granularity;
+ value-=value % Granularity;
+
+ return value;
+}
+
+#if 0
+extern "C" int _mstats(char *s);
+
+Boolean TCEditor::setBufSize( uint32 newSize )
+{
+ newSize = MakeItGranular(newSize);
+
+ _mstats("Antes");
+ if (newSize!=bufSize)
+ {
+ // Make all in a way that allow a fail without loosing the data
+ unsigned DeltaCl=(unsigned)(curLinePtr-buffer);
+ char *temp;
+ if ((temp=(char *)malloc(newSize))==0)
+ {
+ //delete temp; Why I put that?
+ editorDialog( edOutOfMemory );
+ return False;
+ }
+ memcpy( temp, buffer, min( newSize, bufSize ) );
+ free(buffer);
+ buffer=temp;
+ bufSize=newSize;
+ curLinePtr=buffer+DeltaCl;
+ }
+ _mstats("Despues");
+ return True;
+}
+#endif
+
+Boolean TCEditor::setBufSize( uint32 newSize )
+{
+ newSize = MakeItGranular(newSize);
+
+ //_mstats("Antes");
+ if (newSize!=bufSize)
+ {
+ // Make all in a way that allow a fail without loosing the data
+ unsigned DeltaCl=(unsigned)(curLinePtr-buffer);
+ char *temp;
+ if ((temp=(char *)realloc(buffer,newSize))==0)
+ {
+ // Here I'm taking a risk, the pointer was passed to free but still
+ // having the text so the user can save but the behavior of the
+ // rest is unpredictable.
+ editorDialog( edOutOfMemory );
+ return False;
+ }
+ buffer=temp;
+ bufSize=newSize;
+ curLinePtr=buffer+DeltaCl;
+ }
+ //_mstats("Despues");
+ return True;
+}
+
+/****************************************************************************
+
+ Function: void setCmdState( uint16 command, Boolean enable )
+
+ Type: TCEditor member.
+
+ Objetive:
+ Enables or disables the given command depending on whether enable is True
+ or False and whether the editor is sfActive.
+ The command is always disabled if the editor is not the selected view.
+ Offers a convenient alternative to enableCommands and disableCommands.
+
+ Parameters:
+ command: The selected command (Copy, Paste, etc).
+ enable: The new state.
+
+ by Robert.
+
+****************************************************************************/
+
+void TCEditor::setCmdState( uint16 command, Boolean enable )
+{
+ if (enable && (state & sfActive))
+ enableCommand(command);
+ else
+ disableCommand(command);
+}
+
+
+/****************************************************************************
+
+ Function: void setSelect( uint32 newStart, uint32 newEnd,
+ Boolean curStart )
+
+ Type: TCEditor member.
+
+ Objetive:
+ Sets the selection to the given offsets into the file, and redraws the
+ view as needed.
+ This member function will either place the cursor in front of or behind
+ the selection, depending on the value (True or False, respectively) of
+ curStart.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::setSelect( uint32 newStart, uint32 newEnd, Boolean curStart )
+{
+ uint32 p;
+ if ( curStart != 0 )
+ p = newStart;
+ else
+ p = newEnd;
+
+ uchar flags = ufUpdate;
+
+ if ( newStart != selStart || newEnd != selEnd )
+ if ( newStart != newEnd || selStart != selEnd )
+ flags = ufView;
+
+ if (p!=(uint32)(ColToPointer()-buffer))
+ GotoOffSet(p);
+
+ selStart = newStart;
+ selEnd = newEnd;
+ selHided = False;
+ update(flags);
+}
+
+
+/****************************************************************************
+
+ Function: void setState( uint16 aState, Boolean enable )
+
+ Type: TCEditor member.
+
+ Objetive:
+ Overrides TView::setState to hide and show the indicator and scroll bars.
+ It first calls TView::setState to enable and disable commands. If you
+ wish to enable and disable additional commands, override updateCommands
+ instead.
+ This is called whenever the command states should be updated.
+
+****************************************************************************/
+
+void TCEditor::setState(uint16 aState, Boolean enable)
+{
+ TView::setState(aState, enable);
+ switch (aState)
+ {
+ case sfActive:
+ if (hScrollBar)
+ hScrollBar->setState(sfVisible,enable);
+ if (vScrollBar)
+ vScrollBar->setState(sfVisible,enable);
+ if (indicator)
+ indicator->setState(sfVisible,enable);
+ // Note: Commands could be updated when sfFocused is indicated.
+ // But it doesn't help at all. One could think it can help when a modal dialog
+ // is used and it changes the stuff that affects commands. But modal dialogs are
+ // executed through TView::execView and it first saves the current command set
+ // and then restores it. If we process the commands during sfFocused the changes
+ // are lost when execView restores the values.
+ updateCommands(1);
+ message(TProgram::application,evBroadcast,cmcEditorGotFocus,owner);
+ forceNextTimeCheck=True;
+ if (CheckScrollLockCenters)
+ trackCursor(True);
+ break;
+
+ case sfExposed:
+ if (enable)
+ unlock();
+ }
+}
+
+/****************************************************************************
+
+ Function: void startSelect()
+
+ Type: TCEditor member.
+
+ Objetive: Set the start of the selection, but doesn't do more. See
+ SetStartOfSelecting.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::startSelect()
+{
+ selStart=(uint32)(ColToPointer()-buffer);
+}
+
+/****************************************************************************
+
+ Function: void toggleInsMode(Boolean allowUndo)
+
+ Type: TCEditor member.
+
+ Objetive: Toggle the insertion/overwrite mode.
+
+****************************************************************************/
+
+void TCEditor::toggleInsMode(Boolean allowUndo)
+{
+ if (allowUndo)
+ addToUndo(undoCutInMov);
+ overwrite = (!overwrite) ? True : False;
+ setState(sfCursorIns,overwrite);
+ if (!TScreen::cursorShapes())
+ update(ufUpdate);
+}
+
+
+/****************************************************************************
+
+ Function: void trackCursor( Boolean center )
+
+ Type: TCEditor member.
+
+ Objetive: Adjust the delta to make the cursor position visible.
+
+ Parameter:
+ center: True => keep the cursor in the middle of the screen in the y axe.
+
+ Notes:
+ Adapted to limit the cursor movement
+
+****************************************************************************/
+
+void TCEditor::trackCursor( Boolean center )
+{
+ int x=curPos.x;
+
+ if (x>=MaxLineLen)
+ {
+ Beep();
+ curPos.x=x=MaxLineLen-1;
+ }
+ if (x>=limit.x)
+ limit.x=x+1;
+
+ if ( center )
+ scrollTo( x - size.x + 1, curPos.y - size.y / 2);
+ else
+ scrollTo( max(x - size.x + 1, min(delta.x, x)),
+ max(curPos.y - size.y + 1, min(delta.y, curPos.y)));
+}
+
+/****************************************************************************
+
+ Function: void unlock()
+
+ Type: TCEditor member.
+
+ Objetive: Unlock the draw system and force an adecuated redraw.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+void TCEditor::unlock()
+{
+ if ( lockCount > 0 )
+ {
+ lockCount--;
+ if ( lockCount == 0 )
+ doUpdate();
+ }
+}
+
+/****************************************************************************
+
+ Function: void update( uchar aFlags )
+
+ Type: TCEditor member.
+
+ Objetive: Set the draw flags to the desired value, and make a redraw if
+ the editor is unlocked.
+
+ Parameter:
+ aFlags: flags to activate.
+
+ From Borland's TV 1.03.
+
+****************************************************************************/
+
+void TCEditor::update( uchar aFlags )
+{
+ updateFlags|=aFlags;
+ if (!lockCount)
+ doUpdate();
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Called whenever the commands should be updated. This is used to
+enable and disable commands such as cmcUndo, cmcClip, and cmcCopy. The
+function is basically called when the editor get/lose the focus and when
+something is redrawed.@p
+ When the editor get/lose the focus a full update is done, in includes all
+the commands used by the editor. Normally only few commands are updated.
+To reduce the overhead when a full update is done an auxiliar set of
+commands is used and a special feature (added by me) is used to set/clear
+all the commands in one call.
+
+***************************************************************************/
+
+void TCEditor::updateCommands(int full)
+{
+ if (full)
+ { // We are getting or losing the focus so we must do a big work
+ getCommands(cmdsAux);
+
+ if (!(state & sfActive))
+ { // We lost the focus, disable all
+ DisableCommands(cmdsAux);
+ return;
+ }
+ // We got the focus, enable all
+ cmdsAux.enableCmd(cmbBaseNumber,cmbBaseNumber+cmbLastCommand);
+ if (isClipboard())
+ { // Restrict some stuff for the clipboard
+ cmdsAux.disableCmd(cmcCut);
+ cmdsAux.disableCmd(cmcCutClipWin);
+ cmdsAux.disableCmd(cmcCopy);
+ cmdsAux.disableCmd(cmcCopyClipFile);
+ cmdsAux.disableCmd(cmcCopyClipWin);
+ cmdsAux.disableCmd(cmcPaste);
+ cmdsAux.disableCmd(cmcPasteClipFile);
+ cmdsAux.disableCmd(cmcPasteClipWin);
+ cmdsAux.disableCmd(cmcClear);
+ cmdsAux.disableCmd(cmcUndo);
+ cmdsAux.disableCmd(cmcRedo);
+ cmdsAux.disableCmd(cmcSelRectPaste);
+ cmdsAux.disableCmd(cmcSelRectDel);
+ cmdsAux.disableCmd(cmcSelRectMove);
+ cmdsAux.disableCmd(cmcSelRectCut);
+ cmdsAux.disableCmd(cmcSelRectToUpper);
+ cmdsAux.disableCmd(cmcSelRectToLower);
+ }
+ if (!hasRectSel())
+ {
+ cmdsAux.disableCmd(cmcSelRectCopy);
+ cmdsAux.disableCmd(cmcSelRectDel);
+ cmdsAux.disableCmd(cmcSelRectMove);
+ cmdsAux.disableCmd(cmcSelRectCut);
+ cmdsAux.disableCmd(cmcSelRectHide);
+ cmdsAux.disableCmd(cmcSelRectToUpper);
+ cmdsAux.disableCmd(cmcSelRectToLower);
+ }
+ if (!selRectClip)
+ cmdsAux.disableCmd(cmcSelRectPaste);
+ if (NoNativeEOL && (editorFlags & efSaveEOLasis))
+ cmdsAux.disableCmd(cmcSaveAsConvertEOL);
+ else
+ cmdsAux.disableCmd(cmcSaveAsNoConvertEOL);
+ if (SHLValueSelected<0 || SHLValueSelected>=SHLCant || !SHLArray ||
+ !SHLArray[SHLValueSelected].EmacsModes)
+ cmdsAux.disableCmd(cmcPasteEmacsMode);
+ setCommands(cmdsAux);
+ }
+
+ Boolean hs=hasVisibleSelection();
+ if (!isClipboard())
+ {
+ setCmdState(cmcUndo,Boolean(UndoActual!=UndoBase));
+ setCmdState(cmcRedo,Boolean(UndoActual<UndoTop));
+
+ Boolean oscli=TVOSClipboard::isAvailable() ? True : False;
+ setCmdState(cmcCut,hs);
+ setCmdState(cmcCutClipWin,(hs && oscli) ? True : False);
+ setCmdState(cmcCopy,hs);
+ setCmdState(cmcCopyClipFile,hs);
+ setCmdState(cmcCopyClipWin,(hs && oscli) ? True : False);
+ setCmdState(cmcClear,hs);
+ setCmdState(cmcPaste,Boolean(clipboard && clipboard->hasSelection()));
+ setCmdState(cmcPasteClipWin,oscli);
+ }
+ //setCmdState(cmcSearchSelBackward,hs);
+ //setCmdState(cmcSearchSelForward,hs);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Updates the state of the rectangular selection commands. Is called by the
+operations that alters the rectangular selection.
+
+***************************************************************************/
+
+void TCEditor::updateRectCommands()
+{
+ Boolean rs=hasRectSel();
+ setCmdState(cmcSelRectCopy,rs);
+ setCmdState(cmcSelRectHide,rs);
+ rs=(rs==True && isClipboard()==False) ? True : False;
+ setCmdState(cmcSelRectDel,rs);
+ setCmdState(cmcSelRectMove,rs);
+ setCmdState(cmcSelRectCut,rs);
+ setCmdState(cmcSelRectToUpper,rs);
+ setCmdState(cmcSelRectToLower,rs);
+ // cmcSelRectPaste is an exception and is updated by selRectCopy()
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Moves the cursor to the x,y coordinate. If the @var{undo} argument is true
+then the line in edition is flushed and the action is recorded in the undo.
+
+***************************************************************************/
+
+void TCEditor::MoveCursorTo(uint32 x, uint32 y, Boolean undo)
+{
+ if (undo)
+ {
+ flushLine();
+ addToUndo(undoInMov);
+ }
+ if (y<(uint32)curPos.y)
+ MoveLinesUp(curPos.y-y);
+ else
+ if (y>(uint32)curPos.y)
+ MoveLinesDown(y-curPos.y);
+ curPos.x=x;
+}
+
+
+// Circular stack routines
+
+XYRingStack::XYRingStack()
+{
+ pushPos=basePos=0;
+}
+
+inline
+void incWithWrap(int &value, int max)
+{
+ value++;
+ if (value==max)
+ value=0;
+}
+
+inline
+void decWithWrap(int &value, int max)
+{
+ value--;
+ if (value<0)
+ value=max-1;
+}
+
+void XYRingStack::push(uint32 x, uint32 y)
+{
+ Xarray[pushPos]=x;
+ Yarray[pushPos]=y;
+ incWithWrap(pushPos,MaxXYRingStack);
+ if (pushPos==basePos)
+ incWithWrap(basePos,MaxXYRingStack);
+}
+
+int XYRingStack::pop(uint32 &x, uint32 &y)
+{
+ if (pushPos==basePos)
+ return 0;
+ decWithWrap(pushPos,MaxXYRingStack);
+ x=Xarray[pushPos];
+ y=Yarray[pushPos];
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stores the current cursor position in a circular stack.
+
+***************************************************************************/
+
+void TCEditor::PushCursorPosition()
+{
+ CurPosStack.push(curPos.x,curPos.y);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Restores the current cursor position from a circular stack.
+
+***************************************************************************/
+
+int TCEditor::PopCursorPosition()
+{
+ uint32 x,y;
+
+ if (CurPosStack.pop(x,y))
+ {
+ ClearSelIfNonPers();
+ MoveCursorTo(x,y,True);
+ return 1;
+ }
+ return 0;
+}
+
+
+/****************************************************************************
+
+ Function: void RecalculateLineAttributes(void)
+
+ Type: TCEditor member.
+
+ Objetive: Recalculates the syntax highlight attributes of each line in
+ the editor. Called by SetHighlightTo when there is a change in the
+ syntax highlight system.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::RecalculateLineAttributes(void)
+{
+ uint32 lines=0;
+
+ if (bufLen)
+ {
+ char *s=buffer,*end=s+bufLen;
+ uint32 ThisLine,Attr=0;
+
+ CacheSyntaxHLData(GenericSHL);
+ while (s<end)
+ {
+ ThisLine=LineMeassure(s,end,Attr,NULL);
+ if (ThisLine)
+ lenLines.setAll(lines++,ThisLine,Attr);
+ s+=ThisLine;
+ }
+ }
+}
+
+/****************************************************************************
+
+ Function: void SetHighlightTo(shlState sHL)
+
+ Type: TCEditor member.
+
+ Objetive: Set the selected syntax highligth mode
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::SetHighlightTo(shlState sHL, int subSHL)
+{
+ switch (sHL)
+ {
+ case shlNoSyntax:
+ TurnOffHighLight();
+ SHLValueSelected=-1;
+ break;
+ case shlCSyntax:
+ TurnOnCHighLight();
+ SHLValueSelected=SHLTableUse[sHL];
+ if (LineMeassure!=LineMeassureC)
+ {
+ LineMeassure=LineMeassureC;
+ RecalculateLineAttributes();
+ }
+ break;
+ case shlPascalSyntax:
+ TurnOnPascalHighLight();
+ SHLValueSelected=SHLTableUse[sHL];
+ if (LineMeassure!=LineMeassurePascal)
+ {
+ LineMeassure=LineMeassurePascal;
+ RecalculateLineAttributes();
+ }
+ break;
+ case shlClipperSyntax:
+ TurnOnClipperHighLight();
+ SHLValueSelected=SHLTableUse[sHL];
+ if (LineMeassure!=LineMeassureClipper)
+ {
+ LineMeassure=LineMeassureClipper;
+ RecalculateLineAttributes();
+ }
+ break;
+ case shlGenericSyntax:
+ TurnOnGenericHighLight();
+ SHLValueSelected=subSHL;
+ if (LineMeassure!=LineMeassureGeneric || subSHL!=GenericSHL)
+ {
+ GenericSHL=subSHL;
+ LineMeassure=LineMeassureGeneric;
+ RecalculateLineAttributes();
+ }
+ break;
+ default: messageBox(__("Unhandled syntax highlighting"),mfError | mfOKButton);
+ }
+}
+
+/****************************************************************************
+
+ Function: void write( opstream& os )
+
+ Type: TCEditor member.
+
+ Objetive: Write the asociated data to the class.
+
+****************************************************************************/
+
+void TCEditor::write( opstream& os )
+{
+ TView::write( os );
+ os << (unsigned)TCEDITOR_VERSION << hScrollBar << vScrollBar << indicator
+ << bufSize << (int)canUndo;
+ os.writeString( fileName );
+ os << selStart << selEnd // The selected area
+ << curPos.x << curPos.y // The real position, a pointer can point to
+ // a non existing position but the cursor can
+ // be in a X position where there is no text.
+ << (uchar)selHided // Needed to know if the selection is hided or not.
+ // The mode of edition
+ << (uchar)SyntaxHL
+ ;
+ os << CompactFlags() << tabSize << indentSize;
+
+ SaveColMarkers(os,colMarkers); // 0.4.50
+ os << WrapCol; // From v0.4.1 the wrap thing
+
+ // From v0.4.27 the generic shl. name (was type from 0.3.1 to 0.4.26)
+ os.writeString(SHLNameOf(GenericSHL));
+
+ // Markers
+ os.writeBytes(Markers,sizeof(Markers));
+
+ // From v0.2.11
+ os << Xr1 << Yr1 << Xr2 << Yr2 << (uchar)selRectHided;
+
+ // From v0.2.13
+ os << (uchar)staticNoMoveToEndPaste;
+
+ // From v0.4.19
+ os << (uchar)isReadOnly;
+}
+
+static inline
+unsigned MoveFlags(unsigned flags, unsigned mask, unsigned pos)
+{
+ return (flags & mask) | ((flags & (~mask))<<pos);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Reads the asociated data to the class.
+
+***************************************************************************/
+
+void *TCEditor::read( ipstream& is )
+{
+ TView::read(is);
+ int temp;
+
+ is >> LoadingVersion >> hScrollBar >> vScrollBar;
+
+ if (LoadingVersion<=0x420)
+ { /* Old versions used a diferent indicator */
+ is >> OldIndicator;
+ indicator=new TSIndicator(OldIndicator->getBounds());
+ }
+ else
+ {
+ OldIndicator=0;
+ is >> indicator;
+ }
+ indicator->editor=this;
+
+ is >> bufSize >> temp;
+ canUndo=(temp) ? True : False;
+ selecting =False;
+ overwrite =False;
+ autoIndent=False;
+ keyState=0;
+ if (DontLoadFile) bufSize=0;
+ initBuffer();
+ if (buffer)
+ isValid=True;
+ else
+ {
+ TCEditor::editorDialog(edOutOfMemory,0);
+ bufSize=0;
+ }
+ lockCount=0;
+ //lock();
+ bufEdit=NULL; // must be initialized before setBufLen()
+ bufEditLen=0;
+ // Normally the files aren't compressed, if the file is really compressed we will
+ // know it in loadFile
+ IsaCompressedFile=gzNoCompressed;
+ TurnOffHighLight(); // Here only to ensure that the functions pointers are
+ // pointing to some valid place.
+ LineMeassure=LineMeassureC;
+ GenericSHL=0;
+ // The setBufLen member does a call to update. So we must initialize some
+ // stuff related to the drawing machinery.
+ updateFlags=0;
+ CrossCursorInCol=CrossCursorInRow=False;
+ // We aren't a disassembler window
+ isDisassemblerEditor=0;
+ setBufLen(0);
+
+ SpecialLines=NULL;
+
+ is.readString(fileName,sizeof(fileName));
+ if (isValid)
+ {
+ uint32 sStart, sEnd;
+ int X,Y;
+ uchar sh,shl,subshl;
+ uint32 flags;
+ is >> sStart >> sEnd >> X >> Y >> sh >> shl;
+ if (LoadingVersion>=0x443)
+ is >> flags >> tabSize >> indentSize;
+ else
+ {
+ uint16 oldFlags;
+ is >> oldFlags >> tabSize;
+ indentSize=4;
+ flags=oldFlags;
+ }
+
+ if (LoadingVersion<0x450)
+ colMarkers=CopyColMarkers(staticColMarkers);
+ else
+ colMarkers=LoadColMarkers(is);
+
+ if (LoadingVersion>=0x401)
+ is >> WrapCol;
+ else
+ WrapCol=60;
+
+ if (LoadingVersion<0x427)
+ is >> subshl;
+ else
+ {
+ char *name=is.readString();
+ subshl=SHLNumberOf(name); // Must be unsigned! (unsigned)-1
+ delete[] name;
+ }
+ // Avoid problems if the value isn't valid
+ if (subshl>=SHLCant)
+ shl=shlNoSyntax;
+
+ if (LoadingVersion<0x432)
+ flags=MoveFlags(flags,0xFF,1); // Inserted: ShowMatchPairFly
+ if (LoadingVersion<0x445)
+ flags=MoveFlags(flags,0x1FF,1); // Inserted: ShowMatchPairNow
+ // Now we have all like now restore some stuff that was implicit
+ if (LoadingVersion<0x440)
+ flags|=loTabIndents;
+ if (LoadingVersion<0x445 && !(flags & loUseTabs))
+ flags|=loBackSpUnindents;
+ if (LoadingVersion<0x450 && staticColumnMarkers)
+ flags|=loColumnMarkers;
+ ExpandFlags(flags,False);
+ SetHighlightTo((shlState)shl,subshl);
+ isReadOnly=False; // Will be read later
+ if (!DontLoadFile)
+ isValid = loadFile();
+
+ // Markers after the loadFile because loadFile cleans the markers
+ is.readBytes(Markers,sizeof(Markers));
+
+ char aux;
+ is >> Xr1 >> Yr1 >> Xr2 >> Yr2 >> aux;
+ selRectHided=Boolean(aux);
+
+ is >> aux;
+ staticNoMoveToEndPaste=Boolean(aux);
+ if (LoadingVersion>=0x419)
+ {
+ is >> aux;
+ isReadOnly=Boolean(aux);
+ }
+ else
+ isReadOnly=False;
+
+ CrossCursorY2=size.y;
+ CrossCursorX2=size.x;
+ CrossCursorCol=X;
+ CrossCursorRow=Y;
+
+ if (X>limit.x)
+ limit.x=X+1;
+ selHided=(sh) ? True : False;
+ if (sEnd<=bufLen)
+ {
+ selStart=sStart;
+ selEnd=sEnd;
+ selStartOffSet=sStart;
+ }
+
+ if (isValid && !DontLoadFile)
+ {
+ MoveCursorTo(X,Y);
+ trackCursor(True);
+ update(ufView);
+ }
+ else
+ { // Setup this so we can construct a good resume
+ curPos.x=X;
+ curPos.y=Y;
+ }
+ }
+ return this;
+}
+
+
+/****************************************************************************
+
+ Function: void GotoOffSet(uint32 o)
+
+ Type: TCEditor member.
+
+ Objetive: Move the cursor position to an offset in the buffer.
+
+ Parameter:
+ o: destination offset.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::GotoOffSet(uint32 o)
+{
+ uint32 Acu=0;
+ uint32 y=0;
+ char *s;
+
+ if (o>bufLen) return;
+
+ // Could use FindLineForOffSet, but isn't enough tested (july 1999)
+ for (;y<totalLines && Acu<o; y++)
+ Acu+=lenLines[y];
+
+ if (Acu>o)
+ Acu-=lenLines[--y];
+ curPos.y=y;
+ s=curLinePtr=buffer+Acu;
+ Acu=o-Acu;
+ for (curPos.x=0; Acu; --Acu,s++)
+ { AdvanceWithTab(*s,curPos.x); }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Helper function to put the cursor in the first line of the selection.
+The first line is also selected and the position is adjusted to the
+begining of the line.
+
+***************************************************************************/
+
+unsigned TCEditor::JumpLineStartSelection()
+{
+ unsigned Pos=(unsigned)(curLinePtr-buffer);
+ // Is the cursor in the first line of the selection?
+ if (selStart<Pos || selStart>Pos+lenLines[curPos.y])
+ { // Nop
+ GotoOffSet(selStart);
+ if (curPos.y<delta.y)
+ {
+ trackCursor(True);
+ AdjustDrawPtr();
+ }
+ }
+
+ // Force to select the whole first line
+ Pos=(unsigned)(curLinePtr-buffer);
+ selStart=Pos;
+ return Pos;
+}
+
+/****************************************************************************
+
+ Function: void IndentBlock(uint32 Amount, char Fill, Boolean allowUndo)
+
+ Type: TCEditor member.
+
+ Objetive: indent a block.
+ If Amount==0 indents to the first hole of the previous line.
+
+ Parameter:
+ Amount: number of chars to insert in each line.
+ Fill: the character to insert (' ' or tab).
+ allowUndo: if the operation is recorded in the undo array.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::IndentBlock(char *Fill, Boolean allowUndo)
+{
+ if (isReadOnly) return;
+ if (hasVisibleSelection())
+ {
+ // This code is pretty Waco:
+ flushLine();
+
+ if (allowUndo)
+ addToUndo(undoPre1IndBlock,NULL);
+ unsigned Pos=JumpLineStartSelection();
+ // Save info to update de shl
+ unsigned firstLine=curPos.y;
+ char *firstTouchedP=curLinePtr;
+
+ unsigned Amount;
+
+ if (Fill)
+ Amount=strlen(Fill);
+ else
+ {
+ // That's an special case: Indent all the block taking as reference
+ // the first line.
+ int Xact,X=0;
+ char *s=curLinePtr;
+
+ // Search the column of the first non-blank in the first line of the block
+ for (Xact=curPos.x; CLY_IsntEOL(*s) && ucisspace(*s); s++)
+ { AdvanceWithTab(*s,Xact); }
+ if (curPos.y>0)
+ { // Search a hole in the last line
+ s=curLinePtr-lenLines[curPos.y-1];
+
+ do
+ {
+ for (;CLY_IsntEOL(*s) && !ucisspace(*s); s++) // While letters
+ { AdvanceWithTab(*s,X); }
+ for (;CLY_IsntEOL(*s) && ucisspace(*s); s++) // While spaces
+ { AdvanceWithTab(*s,X); }
+ }
+ while (CLY_IsntEOL(*s) && X<=Xact); // to a mayor X or the end of line
+ if (X>Xact)
+ Amount=X-Xact;
+ else
+ Amount=NextTabPos(Xact)-Xact;
+ }
+ else
+ Amount=NextTabPos(Xact)-Xact;
+ Fill=(char *)alloca(Amount+1);
+ memset(Fill,' ',Amount);
+ Fill[Amount]=0;
+ }
+
+ // How many lines?
+ unsigned Lines,PosAux,y;
+ for (Lines=0,y=curPos.y,PosAux=Pos; PosAux<selEnd;)
+ {
+ PosAux+=lenLines[y++];
+ Lines++;
+ }
+ unsigned lastLine=firstLine+Lines;
+
+ // Now let's go, do the work.
+
+ // 1) Insert Lines bytes
+ // Is the buffer large enough?
+ unsigned Total=Lines*Amount;
+ if (bufSize<bufLen+Total)
+ setBufSize(bufLen+Total);
+ memmove(buffer+PosAux+Total,buffer+PosAux,bufLen-PosAux);
+
+ // 2) Update the selection and Buffer Length
+ selEnd+=Total;
+ bufLen+=Total;
+
+ if (allowUndo)
+ {
+ addToUndo(undoPre2IndBlock,&Amount);
+ addToUndo(undoIndBlock,Fill);
+ }
+
+ // 3) Move the lines
+ unsigned Length=lenLines[--y];
+ for (Pos=PosAux; Lines; --Lines)
+ {
+ Pos-=Length;
+ // Hey! don't forget the Markers
+ for (int i=0; i<10; i++)
+ {
+ if (Markers[i]>=Pos && Markers[i]<(Pos+Length))
+ Markers[i]+=Total;
+ }
+ memmove(buffer+Pos+Total,buffer+Pos,Length);
+ memcpy(buffer+Pos+Total-Amount,Fill,Amount);
+ //buffer[Pos+Lines-1]=32;
+ lenLines.set(y,Length+Amount);
+ Length=lenLines[--y];
+ Total-=Amount;
+ }
+
+ UpdateSyntaxHLBlock(firstLine,firstTouchedP,lastLine);
+ MarkAsModified();
+ update(ufView);
+ }
+}
+
+/****************************************************************************
+
+ Function: uint32 IsUnIndentable(char *buffer,uint32 Pos,uint32 Amount)
+
+ Type: Static function.
+
+ Objetive: Check if the line can be unIndented Amount bytes.
+
+ Parameter:
+ buffer: The buffer.
+ Pos: The offset of the line in the buffer.
+ Amount: The number of bytes to delete.
+
+ Return:
+ The quantity to unIndent (Amount if there is enough space or the maximun
+ available).
+
+ by SET.
+
+****************************************************************************/
+
+static uint32 IsUnIndentable(char *buffer,uint32 Pos,uint32 Amount)
+{
+ uint32 i;
+ buffer+=Pos;
+ for (i=0; i<Amount; i++,buffer++)
+ {
+ if (*buffer!=' ' && *buffer!='\t')
+ return i;
+ }
+ return Amount;
+}
+
+/****************************************************************************
+
+ Function: void UnIndentBlock(uint32 Amount, Boolean allowUndo)
+
+ Type: TCEditor member.
+
+ Objetive: Unindent a block.
+ If Amount==0 unindents to the first available start of block.
+
+ Parameter:
+ Amount: number of chars to delete in each line.
+ allowUndo: if the operation is recorded in the undo array. When that's
+ false the routine ever eats Amount spaces because is supposed
+ to be called from the undo!
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::UnIndentBlock(uint32 Amount, Boolean allowUndo)
+{
+ int i;
+ UndoCell un;
+
+ if (isReadOnly) return;
+ if (hasSelection() && !selHided)
+ {
+ flushLine();
+
+ if (allowUndo)
+ {
+ addToUndo(undoPreCopyInfo);
+ UndoSaveStartState(un);
+ un.Type=undoUnIndBlock;
+ }
+
+ unsigned Pos=JumpLineStartSelection();
+ char *firstTouchedP=curLinePtr;
+ un.selStart=Pos;
+
+ if (Amount==0)
+ { // That's an special case: UnIndent the block using the first line as
+ // reference.
+ char *s=curLinePtr,*p;
+ int Y,X,Xact;
+
+ // Search the column of the first non-blank in the first line of the block
+ for (Xact=curPos.x; CLY_IsntEOL(*s) && ucisspace(*s); s++)
+ { AdvanceWithTab(*s,Xact); }
+ s=curLinePtr;
+ X=Xact;
+ Y=curPos.y;
+ while (Y && X>=Xact)
+ {
+ s-=lenLines[--Y];
+ for (p=s,X=0; CLY_IsntEOL(*p) && ucisspace(*p) && X<Xact; p++)
+ { AdvanceWithTab(*p,X); }
+ }
+ if (X>=Xact)
+ Amount=Xact;
+ else
+ Amount=Xact-X;
+ }
+ // If still in 0 => nothing to do
+ if (Amount==0)
+ return;
+ MarkAsModified();
+
+ unsigned Length=selEnd-selStart;
+ char *buf=new char[Length+sizeof(uint32)];
+ if (buf==NULL) return;
+ memcpy(buf+sizeof(uint32),buffer+selStart,Length);
+ *(uint32 *)buf=Amount;
+ un.Length=Length;
+ un.s=buf;
+
+ // Now let's go, do the work.
+ unsigned PosAux,y;
+ unsigned Eated=0;
+ unsigned bytesToEat;
+ unsigned firstLine=curPos.y;
+ for (y=curPos.y, PosAux=Pos; Pos<selEnd; ++y)
+ {
+ Length=lenLines[y];
+ // Is UnIndentable?
+ if ((bytesToEat=allowUndo ? IsUnIndentable(buffer,Pos,Amount) : Amount)!=0)
+ { // Move plus del
+ // Adjust the Markers
+ for (i=0; i<10; i++)
+ {
+ if (Markers[i]>Pos && Markers[i]<(Pos+Length))
+ Markers[i]-=(Eated+bytesToEat);
+ else if (Markers[i]==Pos)
+ Markers[i]-=Eated;
+ }
+ Eated+=bytesToEat;
+ Length-=bytesToEat;
+ memmove(buffer+PosAux,buffer+Pos+bytesToEat,Length);
+ lenLines.set(y,Length);
+ Pos+=bytesToEat;
+ }
+ else
+ { // Only Move
+ memmove(buffer+PosAux,buffer+Pos,Length);
+ // Adjust the Markers
+ for (i=0; i<10; i++)
+ {
+ if (Markers[i]>=Pos && Markers[i]<(Pos+Length))
+ Markers[i]-=Eated;
+ }
+ }
+ PosAux+=Length;
+ Pos+=Length;
+ }
+ if (Eated)
+ {
+ memcpy(buffer+PosAux,buffer+PosAux+Eated,bufLen-(PosAux+Eated));
+ bufLen-=Eated;
+ selEnd-=Eated;
+ UpdateSyntaxHLBlock(firstLine,firstTouchedP,y);
+ }
+
+ if (allowUndo)
+ {
+ UndoSaveFinalState(un);
+ addToUndo(undoPostCopyInfo,&un);
+ }
+
+ update(ufView);
+ }
+}
+
+
+/****************************************************************************
+
+ Function: void RecalculateXofLineInEdit(void)
+
+ Type: TCEditor member.
+
+ Objetive: Calculate the X position based on the inEditPtr pointer.
+ This routine should be called only when the line is under edition and you
+ need to recalculate the X position.
+ Called by BackSpace and Delete when the user deletes a Tab.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::RecalculateXofLineInEdit(void)
+{
+ char *s=bufEdit;
+ int X=0;
+ while (s!=inEditPtr)
+ {
+ AdvanceWithTab(*s,X);
+ s++;
+ }
+ curPos.x=X;
+}
+
+
+/****************************************************************************
+
+ Function: void BackSpace(Boolean allowUndo)
+
+ Type: TCEditor member.
+
+ Objetive: Just the action for the backspace key.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::BackSpace(Boolean allowUndo)
+{
+ int WidthFirstChar;
+
+ if (isReadOnly) return;
+ if (!PersistentBlocks && hasSelection())
+ {
+ clipCut();
+ return;
+ }
+ WidthFirstChar = ((IslineInEdition ? *bufEdit : *curLinePtr)=='\t') ? tabSize : 1;
+ if (curPos.x<WidthFirstChar) // Is the first char in the line
+ {
+ if (curLinePtr!=buffer)
+ {
+ flushLine();
+ deleteRange(curLinePtr-CLY_LenEOL,curLinePtr,allowUndo);
+ }
+ }
+ else
+ {
+ if (!IslineInEdition)
+ {
+ EditLine();
+ if (!IslineInEdition)
+ return;
+ }
+ uint32 PosOfIns=(uint32)(inEditPtr-bufEdit);
+ if (BackSpUnindents && IsFirstCharInLine())
+ { // UnIndent
+ char *s=curLinePtr,*p;
+ int Y,X,Xact;
+ UndoDestroy temp=destBack;
+
+ // The undo is very complex because the routine can replace tabs
+ // with spaces and is imposible to reconstruct if we don't save
+ // a total copy of the line.
+ if (allowUndo)
+ addToUndo(undoDestroyLine,(void *)&temp);
+ X=Xact=curPos.x;
+ Y=curPos.y;
+ while (Y && X>=Xact)
+ {
+ s-=lenLines[--Y];
+ for (p=s,X=0; CLY_IsntEOL(*p) && ucisspace(*p) && X<Xact; p++)
+ { AdvanceWithTab(*p,X); }
+ if (CLY_IsEOL(*p))
+ X=Xact; // if that's an empty line force to ignore it
+ }
+ if (X>=Xact)
+ X=0;
+ //if (X>(inEditPtr-bufEdit))
+ memmove(bufEdit+X,inEditPtr,restCharsInLine+1);
+ memset(bufEdit,32,X);
+
+ int dif=X-(int)PosOfIns;
+ AdjustLineSel(PosOfIns,dif,True);
+
+ // Update the markers
+ for (int i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0)
+ {
+ if ((unsigned)Pos>=PosOfIns)
+ MarkersInLine[i]+=dif;
+ else if (Pos>=X)
+ MarkersInLine[i]=X;
+ }
+ }
+
+ inEditPtr=bufEdit+X;
+ curPos.x=X;
+ }
+ else
+ {
+ if (allowUndo)
+ addToUndo(undoDelChar,inEditPtr-1);
+ // If one of the 2 chars is a tab the X must be recalculated
+ int wasATab=*(inEditPtr-1)=='\t' || *inEditPtr=='\t';
+ CLY_memcpy(inEditPtr-1,inEditPtr,restCharsInLine+1);
+ AdjustLineSel((uint32)(inEditPtr-bufEdit),-1,True);
+
+ // Update the markers
+ for (int i=0; i<10; i++)
+ {
+ int Pos=MarkersInLine[i];
+ if (Pos>=0 && (unsigned)Pos>=PosOfIns)
+ MarkersInLine[i]--;
+ }
+ inEditPtr--;
+ if (wasATab)
+ RecalculateXofLineInEdit();
+ else
+ curPos.x--;
+ }
+ MarkAsModified();
+ update(ufLine);
+ }
+ if (curPos.x<delta.x)
+ {
+ if (delta.x>7)
+ delta.x-=8;
+ else
+ delta.x=0;
+ update(ufView);
+ }
+}
+
+
+/****************************************************************************
+
+ Function: void unlockUndo(void)
+
+ Type: TCEditor member.
+
+ Objetive: Manages the undoGroupCount variable to allow the undo grouping.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::unlockUndo(void)
+{
+ if (undoLockCount>0)
+ {
+ undoLockCount--;
+ if (!undoLockCount)
+ undoGroupCount=0;
+ }
+}
+
+
+/****************************************************************************
+
+ Function: void undo()
+
+ Type: TCEditor member.
+
+ Objetive: Undoes some action.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::undo()
+{
+ if (UndoActual!=UndoBase)
+ {
+ int count=UndoArray[UndoActual].Count;
+ do
+ {
+ undoOneAction();
+ }
+ while (count--);
+ }
+}
+
+
+void TCEditor::undoOneAction()
+{
+ if (UndoActual!=UndoBase)
+ {
+ UndoCell &un=UndoArray[UndoActual];
+ char *s;
+
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition(False);
+
+ // Is a change, first save the end parameters
+ if (UndoSt!=undoNoUndo)
+ UndoSaveFinalState(un);
+
+ switch (un.Type)
+ {
+ case undoInMov:
+ MoveCursorTo(un.X,un.Y);
+ update(ufUpdate);
+ break;
+
+ case undoPutChar:
+ {
+ int d;
+ char *s=ColToPointer(d);
+ if (d<0)
+ {
+ if (-d<un.Length)
+ deleteRange(s-un.Length-d,s,False);
+ }
+ else
+ deleteRange(s-un.Length,s,False);
+ EditLine(False);
+ }
+ //MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoOvrPutChar:
+ MoveCursorTo(un.X,un.Y);
+ if (overwrite!=(((un.Flags & undoOverWrite)!=0) ? True : False))
+ toggleInsMode(False);
+ EditLine(False);
+ {
+ int i;
+ for (i=0; i<un.Length; i++)
+ InsertCharInLine(un.s2.s[i],False);
+ }
+ MoveCursorTo(un.X,un.Y);
+ ComputeXLineInEdition(True);
+ update(ufLine);
+ break;
+
+ case undoDelCharDel:
+ insertBuffer( un.s, 0, un.Length, False, False, False );
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoDelChar:
+ insertBuffer( un.s, 0, un.Length, False, False, False );
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoDelete:
+ MoveCursorTo(un.Xf,un.Yf);
+ insertBuffer(un.s,0,un.Length,False,False,False);
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoDeleteBuf:
+ GotoOffSet(un.s2.OffSet);
+ insertBuffer(un.s,0,un.Length,False,False,False);
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoInsert:
+ {
+ MoveCursorTo(un.X,un.Y);
+ int dif;
+ s=ColToPointer(dif);
+ deleteRange(s,s+un.Length,False);
+ if (un.s2.l)
+ insertBuffer(un.s2.BufL->s,0,un.s2.BufL->len,False,False,True);
+ }
+ break;
+
+ case undoDestroyLine:
+ MoveCursorTo(un.X,un.Y);
+ deleteRange(curLinePtr,curLinePtr+LenWithoutCRLF(un.Y,curLinePtr),False);
+ // We must be sure the line is inserted at the beginning
+ MoveCursorTo(0,un.Y);
+ insertBuffer(un.s,0,un.Length,False,False,False);
+ MoveCursorTo(un.X,un.Y);
+ if (un.Flags & undoLineInEd)
+ EditLine(False);
+ break;
+
+ case undoIndBlock:
+ selStart=un.selStartf;
+ selEnd=un.selEndf;
+ selHided=False;
+ UnIndentBlock(un.Length,False);
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoUnIndBlock:
+ deleteRange(buffer+un.selStartf,buffer+un.selEndf,False);
+ insertBuffer(un.s,sizeof(uint32),un.Length,False,False,False);
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoToUpper:
+ case undoToLower:
+ case undoRecodeBlock:
+ case undoInvertCase:
+ case undoAltCase:
+ deleteRange(buffer+un.selStartf,buffer+un.selEndf,False);
+ insertBuffer(un.s,0,un.Length,False,False,False);
+ MoveCursorTo(un.X,un.Y);
+ break;
+
+ case undoRectDel:
+ case undoRectPaste:
+ UndoRectangularPasteClear(un);
+ break;
+
+ case undoRectCopy:
+ delete selRectClip;
+ selRectClip=DuplicateRectSt(un.s);
+ update(ufUpdate);
+ break;
+
+ case undoRectHide:
+ selRectHided=Boolean(un.Length);
+ update(ufView);
+ break;
+
+ case undoRectStart:
+ {
+ selRecSt *s=(selRecSt *)un.s;
+ Xr1=s->Xr1;
+ Yr1=s->Yr1;
+ update(ufView);
+ }
+ break;
+
+ case undoRectEnd:
+ {
+ selRecSt *s=(selRecSt *)un.s;
+ Xr2=s->Xr2;
+ Yr2=s->Yr2;
+ update(ufView);
+ }
+ break;
+
+ default:
+ messageBox(__("Unhandled undo"),mfError | mfOKButton);
+ }
+
+ Boolean newBool=((un.Flags & undoModified)!=0) ? True : False;
+ if (modified!=newBool)
+ {
+ modified=newBool;
+ // Note: we don't restore the modifiedCounter, currently the use of this
+ // variable is limited so it doesn't affect, but perhaps a write from scratch
+ // should simply use the counter.
+ update(ufUpdate);
+ }
+ newBool=((un.Flags & undoSelHided)!=0) ? True : False;
+ if (un.selStart!=selStart || un.selEnd!=selEnd || selHided!=newBool)
+ {
+ selStart=un.selStart;
+ selEnd=un.selEnd;
+ selHided=newBool;
+ update(ufView);
+ }
+ newBool=((un.Flags & undoSelRecHided)!=0) ? True : False;
+ if (newBool!=selRectHided)
+ {
+ selRectHided=newBool;
+ update(ufView);
+ }
+ if (IslineInEdition)
+ {
+ selNewStart=un.selStart;
+ selNewEnd=un.selEnd;
+ }
+ if (overwrite!=(((un.Flags & undoOverWrite)!=0) ? True : False))
+ toggleInsMode(False);
+
+ UndoSt=undoNoUndo;
+
+ DecWithWrap(UndoActual,MAX_UNDO);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It sets the modified flag for all the previous entries in the array.
+That's called after a save.
+
+***************************************************************************/
+
+void TCEditor::RevertModifFlagInUndo()
+{
+ int pos;
+
+ for (pos=0; pos<MAX_UNDO; pos++)
+ UndoArray[pos].Flags|=undoModified;
+}
+
+/****************************************************************************
+
+ Function: void redo(void)
+
+ Type: TCEditor member.
+
+ Objetive: Redoes an action.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::redo(void)
+{
+ if (UndoActual!=UndoTop)
+ {
+ char *s;
+
+ if (IslineInEdition)
+ MakeEfectiveLineInEdition(False);
+
+ IncWithWrap(UndoActual,MAX_UNDO);
+ UndoSt=undoNoUndo;
+ UndoCell &un=UndoArray[UndoActual];
+
+ switch (un.Type)
+ {
+ case undoInMov:
+ MoveCursorTo(un.Xf,un.Yf);
+ update(ufUpdate);
+ break;
+
+ case undoPutChar:
+ MoveCursorTo(un.X,un.Y);
+ insertBuffer( un.s, 0, un.Length, False, False, False );
+ break;
+
+ case undoOvrPutChar:
+ MoveCursorTo(un.X,un.Y);
+ if (overwrite!=(((un.Flags & undoOverWrite)!=0) ? True : False))
+ toggleInsMode(False);
+ EditLine(False);
+ {
+ int i;
+ for (i=0; i<un.Length; i++)
+ InsertCharInLine(un.s[i],False);
+ }
+ update(ufLine);
+ break;
+
+ case undoDelCharDel:
+ s=ColToPointer();
+ deleteRange(s,s+un.Length,False);
+ break;
+
+ case undoDelChar:
+ s=ColToPointer();
+ deleteRange(s-un.Length,s,False);
+ break;
+
+ case undoDelete:
+ MoveCursorTo(un.X,un.Y);
+ s=ColToPointer();
+ deleteRange(s,s+un.Length,False);
+ MoveCursorTo(un.Xf,un.Yf);
+ break;
+
+ case undoDeleteBuf:
+ s=buffer+un.s2.OffSet;
+ deleteRange(s,s+un.Length,False);
+ MoveCursorTo(un.Xf,un.Yf);
+ break;
+
+ case undoInsert:
+ MoveCursorTo(un.X,un.Y);
+ insertBuffer( un.s, 0, un.Length, False, False, False );
+ MoveCursorTo(un.Xf,un.Yf);
+ break;
+
+ case undoDestroyLine:
+ MoveCursorTo(un.X,un.Y);
+ BackSpace(False);
+ break;
+
+ case undoIndBlock:
+ selStart=un.selStart;
+ selEnd=un.selEnd;
+ selHided=False;
+ IndentBlock(un.s,False);
+ MoveCursorTo(un.Xf,un.Yf);
+ break;
+
+ case undoUnIndBlock:
+ UnIndentBlock(*((uint32 *)un.s),False);
+ break;
+
+ case undoToUpper:
+ BlockToUpper(False);
+ break;
+
+ case undoToLower:
+ BlockToLower(False);
+ break;
+
+ case undoInvertCase:
+ BlockInvertCase(False);
+ break;
+
+ case undoAltCase:
+ BlockAltCase(False);
+ break;
+
+ case undoRecodeBlock:
+ RemapCodePageBuffer(un.s2.Recode->sourID,un.s2.Recode->destID,
+ un.s2.Recode->ops,False);
+ break;
+
+ case undoRectDel:
+ selRectDelete(Xr1,Yr1,Xr2,Yr2,False);
+ break;
+
+ case undoRectPaste:
+ selRectPaste(selRectClip,curPos.x,curPos.y,False);
+ break;
+
+ case undoRectCopy:
+ delete selRectClip;
+ selRectClip=DuplicateRectSt(un.s2.s);
+ update(ufUpdate);
+ break;
+
+ case undoRectHide:
+ selRectHided=Boolean(!selRectHided);
+ update(ufView);
+ break;
+
+ case undoRectStart:
+ {
+ selRecSt *s=(selRecSt *)un.s;
+ Xr1=s->Xr2;
+ Yr1=s->Yr2;
+ update(ufView);
+ }
+ break;
+
+ case undoRectEnd:
+ {
+ selRecSt *s=(selRecSt *)un.s;
+ Xr2=s->Xr1;
+ Yr2=s->Yr1;
+ update(ufView);
+ }
+ break;
+
+ default:
+ messageBox(__("Unhandled redo"),mfError | mfOKButton);
+ }
+
+ Boolean newBool=((un.Flags & undoModifiedF)!=0) ? True : False;
+ if (modified!=newBool)
+ {
+ modified=newBool; // See comment in similar sentence
+ update(ufUpdate);
+ }
+ newBool=((un.Flags & undoSelHidedF)!=0) ? True : False;
+ if (un.selStartf!=selStart || un.selEndf!=selEnd || selHided!=newBool)
+ {
+ selStart=un.selStartf;
+ selEnd=un.selEndf;
+ selHided=newBool;
+ update(ufView);
+ }
+ newBool=((un.Flags & undoSelRecHidedF)!=0) ? True : False;
+ if (newBool!=selRectHided)
+ {
+ selRectHided=newBool;
+ update(ufView);
+ }
+ if (overwrite!=(((un.Flags & undoOverWriteF)!=0) ? True : False))
+ toggleInsMode(False);
+
+ // Recall the function until we finish with the chain
+ if (UndoActual!=UndoTop)
+ {
+ int aux=UndoActual;
+ IncWithWrap(aux,MAX_UNDO);
+
+ while (UndoArray[aux].Count)
+ {
+ redo();
+ if (UndoActual==UndoTop) break;
+ IncWithWrap(aux,MAX_UNDO);
+ }
+ }
+ }
+}
+
+
+
+/****************************************************************************
+
+ Function: void UndoSaveFinalState(UndoCell &un)
+
+ Type: TCEditor member.
+
+ Objetive: Fill the undo structure with the status of the editor at the
+ end of the action.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::UndoSaveFinalState(UndoCell &un)
+{
+ un.Xf=curPos.x;
+ un.Yf=curPos.y;
+ if (IslineInEdition)
+ {
+ un.selStartf=selNewStart;
+ un.selEndf=selNewEnd;
+ }
+ else
+ {
+ un.selStartf=selStart;
+ un.selEndf=selEnd;
+ }
+ if (selHided) un.Flags|=undoSelHidedF;
+ if (selRectHided) un.Flags|=undoSelRecHidedF;
+ if (modified) un.Flags|=undoModifiedF;
+ if (overwrite) un.Flags|=undoOverWriteF;
+ if (IslineInEdition) un.Flags|=undoLineInEd;
+}
+
+
+/****************************************************************************
+
+ Function: void UndoSaveStartState(UndoCell &un)
+
+ Type: TCEditor member.
+
+ Objetive: Fill the undo structure with the status of the editor at the
+ start of the action.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::UndoSaveStartState(UndoCell &un)
+{
+ un.X=curPos.x;
+ un.Y=curPos.y;
+ if (IslineInEdition)
+ {
+ un.selStart=selNewStart;
+ un.selEnd=selNewEnd;
+ }
+ else
+ {
+ un.selStart=selStart;
+ un.selEnd=selEnd;
+ }
+ un.Flags=0;
+ if (selHided) un.Flags|=undoSelHided;
+ if (selRectHided) un.Flags|=undoSelRecHided;
+ if (modified) un.Flags|=undoModified;
+ if (overwrite) un.Flags|=undoOverWrite;
+ if (IslineInEdition) un.Flags|=undoLineInEd;
+}
+
+/****************************************************************************
+
+ Function: void addToUndo(UndoState st, void *p)
+
+ Type: TCEditor member.
+
+ Objetive: Add an action to the undo list.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::addToUndo(UndoState st, void *p)
+{
+ unsigned cont;
+
+ UndoCell &un=UndoArray[UndoActual];
+
+ if (un.Count<=undoGroupCount)
+ if (st==UndoSt)
+ {
+ switch (st) // Grouped things
+ {
+ case undoInMov: // The cursor movement is grouped
+ return;
+ // The chars inserted one by one are stored in one cell
+ case undoDelCharDel:
+ case undoPutChar:
+ if (un.Length && !(un.Length%UNDO_CHARS_SIZE))
+ {
+ char *s=(char *)realloc(un.s,un.Length+UNDO_CHARS_SIZE);
+ UndoArray[UndoActual].s=s;
+ s[un.Length++]=*((char *)p);
+ return;
+ }
+ un.s[un.Length++]=*((char *)p);
+ return;
+
+ case undoOvrPutChar:
+ if (un.Length && !(un.Length%UNDO_CHARS_SIZE))
+ {
+ UndoArray[UndoActual].s=(char *)realloc(un.s,un.Length+UNDO_CHARS_SIZE);
+ UndoArray[UndoActual].s2.s=(char *)realloc(un.s2.s,un.Length+UNDO_CHARS_SIZE);
+ UndoArray[UndoActual].s[un.Length]=*((char *)p);
+ UndoArray[UndoActual].s2.s[un.Length++]=*((char *)p+1);
+ return;
+ }
+ un.s[un.Length]=*((char *)p);
+ un.s2.s[un.Length++]=*((char *)p+1);
+ return;
+
+ // The same but in reverse order
+ case undoDelChar:
+ if (un.Length && !(un.Length%UNDO_CHARS_SIZE))
+ {
+ char *s=(char *)realloc(un.s,un.Length+UNDO_CHARS_SIZE);
+ UndoArray[UndoActual].s=s;
+ memmove(s+1,s,un.Length++);
+ s[0]=*((char *)p);
+ return;
+ }
+ memmove(un.s+1,un.s,un.Length++);
+ un.s[0]=*((char *)p);
+ return;
+
+ // If he repeat the pre-delete info simply ingnore it, that's made to
+ // allow a preset of the data from some place different to deleteRange.
+ // BUT not the pointer.
+ case undoPreDelete:
+ un.s=(char *)p;
+ un.s2.l=0;
+ return;
+
+ // Second time is the final X,Y
+ //case undoDifSpaces:
+ // return;
+ default:
+ break;
+ }
+ }
+
+ // undoToUpper undoToLower undoUnIndBlock undoRectPaste undoRectDel
+ // undoRecodeBlock undoInvertCase undoAltCase
+ if (st==undoPostCopyInfo)
+ {
+ memcpy(&UndoArray[UndoActual],p,sizeof(UndoCell));
+ UndoArray[UndoActual].Count=undoGroupCount;
+ if (undoLockCount)
+ undoGroupCount++;
+ return;
+ }
+
+ // First cames a predelete and then the delete
+ if (st==undoDelete)
+ {
+ char *s=(char *)UndoArray[UndoActual].s;
+ unsigned l=(unsigned)((char *)p-s);
+
+ un.Length=l;
+ un.s=new char[l];
+ UndoSt=un.Type=st;
+ memcpy(un.s,s,l);
+ return;
+ }
+
+ // First comes a predelete and then the deletebuf
+ if (st==undoDeleteBuf)
+ {
+ char *s=(char *)UndoArray[UndoActual].s;
+ un.s2.OffSet=(unsigned)((char *)s-buffer); // Where to place the buffer
+
+ unsigned l=(unsigned)((char *)p-s);
+ un.Length=l; // How many bytes
+
+ un.s=new char[l];
+ UndoSt=un.Type=st;
+ memcpy(un.s,s,l);
+ return;
+ }
+
+ // First cames a preinsert and then the insert
+ if (st==undoInsert)
+ {
+ // A pointer to the data
+ struct stUndoInsert *stI=(struct stUndoInsert *)p;
+
+ uint32 l=un.Length=stI->l;
+ un.s=new char[l];
+ memcpy(un.s,stI->s,l);
+ un.s2.BufL=stI->Eated;
+ UndoSt=un.Type=st;
+ return;
+ }
+
+
+ if (st==undoPre2IndBlock)
+ {
+ un.Length=*((uint32 *)p);
+ return;
+ }
+
+ if (st==undoIndBlock)
+ {
+ un.s=newStr((char *)p);
+ UndoSt=un.Type=st;
+ return;
+ }
+
+ // Is a change, first save the end parameters first
+ UndoSaveFinalState(un);
+
+ // Increment the pointers
+ IncWithWrap(UndoActual,MAX_UNDO);
+ if (UndoActual==UndoBase)
+ {
+ do
+ {
+ freeUndoCell(UndoBase);
+ IncWithWrap(UndoBase,MAX_UNDO);
+ }
+ while (UndoArray[UndoBase].Count && UndoActual!=UndoBase);
+ }
+ IncWithWrap(UndoTop,MAX_UNDO);
+ while (UndoTop!=UndoActual)
+ {
+ DecWithWrap(UndoTop,MAX_UNDO);
+ freeUndoCell(UndoTop);
+ }
+
+ UndoSt=st;
+ UndoCell &un2=UndoArray[UndoActual];
+ un2.Type=st;
+ // Increment now, some cases returns.
+ un2.Count=undoGroupCount;
+
+ switch (st)
+ {
+ case undoPre1IndBlock:
+ case undoInMov:
+ UndoSaveStartState(un2);
+ break;
+
+ case undoOvrPutChar:
+ un2.s2.s=new char[UNDO_CHARS_SIZE];
+ un2.s2.s[0]=*((char *)p+1);
+ case undoDelChar:
+ case undoDelCharDel:
+ case undoPutChar:
+ un2.Length=1;
+ un2.s=new char[UNDO_CHARS_SIZE];
+ un2.s[0]=*((char *)p);
+ UndoSaveStartState(un2);
+ break;
+
+ case undoRectCopy:
+ un2.s=(char *)DuplicateRectSt((char *)selRectClip);
+ un2.s2.s=(char *)DuplicateRectSt((char *)p);
+ UndoSaveStartState(un2);
+ break;
+
+ case undoRectStart:
+ case undoRectEnd:
+ case undoPreDelete:
+ un2.s=(char *)p;
+ UndoSaveStartState(un2);
+ break;
+
+ case undoPreInsert:
+ UndoSaveStartState(un2);
+ break;
+
+ // When we eat or put spaces like in the unindent in backspace
+ /*
+ case undoDifSpaces:
+ un2.Length=*((int *)p);
+ UndoSaveStartState(un2);
+ break;*/
+
+ // That's only to put a point between two movements
+ case undoCutInMov:
+ UndoSt=un2.Type=undoInMov;
+ UndoSaveStartState(un2);
+ break;
+
+ case undoDestroyLine:
+ cont=(unsigned)(inEditPtr-bufEdit+restCharsInLine);
+ un2.Length=cont;
+ un2.s=new char[cont+1];
+ memcpy(un2.s,bufEdit,cont+1);
+ UndoSaveStartState(un2);
+ break;
+
+ case undoRectHide:
+ un.Length=(int)*((Boolean *)p);
+ break;
+
+ // That's used by the routines that handle the undo by itself
+ case undoPreCopyInfo:
+ return;
+ default:
+ break;
+ }
+
+ if (undoLockCount)
+ undoGroupCount++;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function release all the undo information. Must be called by routines
+that doesn't have undo to avoid a mess.
+
+***************************************************************************/
+
+void TCEditor::flushUndoInfo()
+{
+ while (UndoBase!=UndoTop)
+ {
+ freeUndoCell(UndoTop);
+ DecWithWrap(UndoTop,MAX_UNDO);
+ }
+ freeUndoCell(UndoTop);
+ UndoActual=UndoBase;
+}
+
+/****************************************************************************
+
+ Function: void freeUndoCell(int Index)
+
+ Type: TCEditor member.
+
+ Objetive: Eliminates an undo cell in the list.
+
+ by SET.
+
+****************************************************************************/
+
+void TCEditor::freeUndoCell(int Index)
+{
+ switch (UndoArray[Index].Type)
+ {
+ // This must free the allocated memory
+ case undoRectCopy:
+ case undoOvrPutChar:
+ case undoRecodeBlock:
+ delete UndoArray[Index].s2.s;
+ case undoAltCase:
+ case undoDelChar:
+ case undoDelCharDel:
+ case undoDelete:
+ case undoDeleteBuf:
+ case undoIndBlock:
+ case undoInsert:
+ case undoInvertCase:
+ case undoPutChar:
+ case undoRectDel:
+ case undoRectEnd:
+ case undoRectPaste:
+ case undoRectStart:
+ case undoToLower:
+ case undoToUpper:
+ case undoUnIndBlock:
+ DeleteArray(UndoArray[Index].s);
+ break;
+ default:
+ break;
+ }
+ UndoArray[Index].Type=undoNoUndo;
+}
+
+void TCEditor::TurnOnCHighLight(void)
+{
+ formatLinePtr=&TCEditor::formatLineHighLight;
+ SyntaxHL=shlCSyntax;
+}
+
+void TCEditor::TurnOnPascalHighLight(void)
+{
+ formatLinePtr=&TCEditor::formatLineHighLightPascal;
+ SyntaxHL=shlPascalSyntax;
+}
+
+void TCEditor::TurnOnClipperHighLight(void)
+{
+ formatLinePtr=&TCEditor::formatLineHighLightClipper;
+ SyntaxHL=shlClipperSyntax;
+}
+
+void TCEditor::TurnOnGenericHighLight(void)
+{
+ formatLinePtr=&TCEditor::formatLineHighLightGeneric;
+ SyntaxHL=shlGenericSyntax;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function copies the syntax highlight information selected by id to
+an static cache. That's in this way because then editorfo.cc have references
+to this static buffer symplifying the addressing mode and hence using less
+CPU registers.
+@p
+ All the functions that needs to use the cached value must call this member
+before. If the value is already cached it returns inmediatly. That means
+is fast.
+
+***************************************************************************/
+
+void TCEditor::CacheSyntaxHLData(int id)
+{
+ if ((id!=strCid || SyntaxHL!=strCtype) && SHLArray && SHLValueSelected>=0)
+ {
+ strSHL *s=&SHLArray[SHLValueSelected];
+ // If the keywords aren't loaded now is time
+ if (!s->Keywords)
+ LoadSyntaxHighLightKeywords(*s);
+ // If the user words aren't loaded do it now. Do it after loading the
+ // .shl because the former can define some userwords and the real user
+ // words have more priority.
+ if (!(s->Flags1 & FG1_UserWordsTried))
+ LoadUserWords(s,id);
+ memcpy(&strC,s,sizeof(strSHL));
+ // Check if we use the internal version
+ /*if (SyntaxHL==shlGenericSyntax)
+ memcpy(&strC,s,sizeof(strSHL));
+ else
+ { // Cache only a few things
+ strC.Name=s->Name;
+ strC.Flags1=s->Flags1;
+ strC.UserWords=s->UserWords;
+ strC.SearchUserWords=s->SearchUserWords;
+ }*/
+ // Memorize what is cached
+ strCid=id;
+ strCtype=SyntaxHL;
+ }
+}
+
+/****************************************************************************
+
+ Function: readBlock(TCEditor *editor)
+
+ Type: Normal function.
+
+ Objetive: Used to read a file and insert it as a block in the text.
+
+ from Robert adapted to the new class.
+
+****************************************************************************/
+
+static void readBlock(TCEditor *editor)
+{
+ char fname[PATH_MAX];
+
+ if (editor->isReadOnly)
+ return;
+
+ strcpy(fname,"*");
+
+ if (TCEditor::editorDialog(edReadBlock,fname)!=cmCancel)
+ {
+ flushLine2(editor);
+ // Save the cursor pos
+ uint32 c = (uint32)(editor->ColToPointer()-editor->buffer);
+ // Create a new editor for this file, this is made in this way to get
+ // an automatic conversion for UNIX files.
+ TCEditor *feditor = new TCEditor(TRect(0,0,1,1),NULL,NULL,NULL,fname);
+ // If non-persistent blocks kill the selection
+ if (!editor->PersistentBlocks && editor->hasSelection())
+ editor->clipCut();
+ editor->lock();
+ editor->selHided=False;
+ // Insert all the new editor
+ editor->insertBuffer(feditor->buffer,0,feditor->bufLen,True,True);
+ // Destroy the temporal editor
+ delete feditor;
+ // Put the cursor in the original position
+ editor->GotoOffSet(c);
+ editor->trackCursor(False);
+ // Update the view
+ editor->unlock();
+ editor->update(ufView);
+ }
+}
+
+/****************************************************************************
+
+ Function: writeBlock(TCEditor *editor)
+
+ Type: Normal function.
+
+ Objetive: Used to write a block to a file.
+
+ from Robert adapted to the new class.
+
+****************************************************************************/
+
+static void writeBlock(TCEditor *editor)
+{
+ if (editor->selHided || !editor->hasSelection())
+ return;
+
+ char fname[PATH_MAX];
+ strcpy(fname,"*");
+
+ if (TCEditor::editorDialog(edSaveBlock,fname)!=cmCancel)
+ {
+ FILE *f;
+ struct stat st;
+ int error=0;
+ if (stat(fname,&st)==0)
+ {
+ if (S_ISREG(st.st_mode))
+ {
+ if (TCEditor::editorDialog(edFileExists,fname,0)!=cmYes)
+ return;
+ }
+ else
+ {
+ if (TCEditor::editorDialog(edFileNoFile,fname)!=cmYes)
+ return;
+ }
+ }
+ f=fopen(fname,"w+b");
+ if (f)
+ {
+ flushLine2(editor);
+ fwrite(editor->buffer+editor->selStart,1,editor->selEnd-editor->selStart,f);
+ error=ferror(f);
+ fclose(f);
+ }
+ else
+ error=1;
+ if (error)
+ TCEditor::editorDialog(edWriteError,fname,NULL);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Saves the contents of the buffer to a temporal file and returns the name
+of the file. The file have "di" as prefix.
+
+ Return: A malloced name for the temporal file containing the buffer. If it
+failed NULL is returned.
+
+***************************************************************************/
+
+char *TCEditor::saveToTemp()
+{
+ char *name=unique_name("di",NULL);
+ if (!name)
+ return NULL;
+ FILE *f=fopen(name,"wt");
+ int error=0;
+ if (f)
+ {
+ flushLine();
+ fwrite(buffer,1,bufLen,f);
+ error=ferror(f);
+ fclose(f);
+ }
+ else
+ error=1;
+ if (error)
+ {
+ editorDialog(edWriteError,name,NULL);
+ free(name);
+ return NULL;
+ }
+ return name;
+}
+
+static
+void GetFileMode(CLY_mode_t *mode, struct stat *statVal, char *fileName)
+{
+ CLY_GetFileAttributes(mode,statVal,fileName);
+ // We will modify the file so we set this bit in advance
+ CLY_FileAttrModified(mode);
+}
+
+static
+FILE *ExpandToTempIfNeeded(FILE *f, char *&temp, char *name, int &IsCompressed)
+{
+ IsCompressed=GZFiles_IsGZ(f);
+ if (!IsCompressed)
+ return f;
+ GZFiles_ResetError();
+ fclose(f);
+ char *tmp;
+ f=unique_name_f(tmp,"gz");
+ if (!f)
+ {
+ TCEditor::editorDialog(edCreateTMPError);
+ return NULL;
+ }
+
+ if (GZFiles_ExpandHL(f,name))
+ {
+ fclose(f);
+ unlink(tmp);
+ return NULL;
+ }
+
+ temp=tmp;
+ return f;
+}
+
+/****************************************************************************
+
+ Function: Boolean loadFile()
+
+ Type: TCEditor member.
+
+ Objetive: Loads a file into the editor buffer, checks if is a UNIX file,
+ in this case the file is converted to DOS style.
+
+ Returns: True if the file was loaded. False if an error ocurred. If the
+ file doesn't exist it assumes a new one is wanted, an empty editor is
+ created and True is returned, but the FailedToLoad flag is set.
+
+ Originally by Robert.
+ 5/97 Mod. by Robert to (1) Use fopen (2) Only convert files in DOS
+ (3) Take in count that Linux can convert DOS files on MS-DOS mounted
+ drives.
+
+****************************************************************************/
+
+#ifdef CLY_UseCrLf
+#define RemoveTemporal() if (wasCompressed) { remove(wasCompressed); \
+ free(wasCompressed); \
+ wasCompressed=0; } \
+ if (!crfound) remove(tmp); \
+ string_free(tmp);
+#else
+#define RemoveTemporal() if (wasCompressed) { remove(wasCompressed); \
+ free(wasCompressed); \
+ wasCompressed=0; } \
+ if (crfound) remove(tmp); \
+ string_free(tmp);
+#endif
+
+Boolean TCEditor::loadFile(Boolean setSHL)
+{
+ int i,crfound=0;
+ char *tmp=0;
+ struct stat s;
+ char *wasCompressed=0;
+
+ FailedToLoad=False;
+ DiskTime=0;
+ lastTimeCheck=0;
+ NoNativeEOL=False;
+ // This structure differentiate the file
+ FillEditorId(&EditorId);
+
+ // We need some information about the file later. First I tried using fstat
+ // but under DOS stat can give much more accurate information because we
+ // provide the name of the file. In particular fstat fails under DOS+NETX
+ if (stat(fileName,&s)!=0)
+ { // I don't know if that's the best, I just assume the file isn't there
+ if (setSHL)
+ SHLSelect(*this,buffer,0);
+ setBufLen(0);
+ FailedToLoad=True;
+ return True;
+ }
+ // Get the current attributes/rights
+ GetFileMode(&ModeOfFile,&s,fileName);
+ FILE *f=fopen(fileName,"rb");
+
+ if (!f)
+ { // New file, it's OK
+ if (setSHL)
+ SHLSelect(*this,buffer,0);
+ setBufLen(0);
+ FailedToLoad=True;
+ return True;
+ }
+
+ // Get the modification time (from stat)
+ DiskTime=s.st_mtime;
+ time(&lastTimeCheck);
+ FillEditorId(&EditorId,0,&s);
+ // Check if we can write
+ if (CLY_FileAttrIsRO(&ModeOfFile))
+ {
+ if (!isReadOnly && !(editorFlags & efDoNotWarnRO) &&
+ editorDialog(edIsReadOnly,fileName)==cmYes)
+ {
+ // Close it, DOS 6 fails if we change the mode while opened
+ fclose(f);
+ CLY_FileAttrReadWrite(&ModeOfFile);
+ if (!CLY_SetFileAttributes(&ModeOfFile,fileName))
+ {
+ editorDialog(edStillReadOnly);
+ // Check if the user wants to mark them as R.O.
+ if (editorFlags & efROasRO)
+ isReadOnly=True;
+ // Undo the change to reflect reality
+ CLY_FileAttrReadOnly(&ModeOfFile);
+ }
+ f=fopen(fileName,"rb");
+ if (!f)
+ {
+ editorDialog(edReadError,fileName,NULL);
+ return False;
+ }
+ }
+ else
+ // Check if the user wants to mark them as R.O.
+ if (editorFlags & efROasRO)
+ isReadOnly=True;
+ }
+
+ Boolean oldBusy=TScreen::showBusyState(True);
+ f=ExpandToTempIfNeeded(f,wasCompressed,fileName,IsaCompressedFile);
+ if (!f)
+ {
+ TScreen::showBusyState(oldBusy);
+ editorDialog(edReadError,fileName,GZFiles_GetError());
+ return False;
+ }
+
+ // Check for a unix text file (is a heuristic, because only 1024 chars checked
+ {
+ char tmpbuf[1024];
+ memset(tmpbuf,0,1024);
+ long fsize=filelength(fileno(f));
+ if (fsize > 1024) fsize=1024;
+ fread(tmpbuf,fsize,1,f);
+ for (i=0; i<fsize; i++)
+ {
+ if (tmpbuf[i]==13)
+ crfound=1;
+ else
+ if (tmpbuf[i]==10)
+ break;
+ }
+ #ifdef CLY_UseCrLf
+ // DOS: Check if the file is in UNIX format, in this case convert it
+ if (crfound)
+ fseek(f,0,SEEK_SET);
+ else
+ {
+ /* This uses the feature of DJGPP to convert automatically
+ LF's to CR/LF's when writing in TEXT-mode */
+ FILE *ftemp;
+ NoNativeEOL=True;
+ fseek(f,0,SEEK_SET);
+ tmp=unique_name("ed");
+ ftemp=fopen(tmp,"w+t");
+ while ((fsize = fread(tmpbuf,1,1024,f)) > 0)
+ fwrite(tmpbuf,1,fsize,ftemp);
+ fclose(ftemp);
+ fclose(f);
+ f=fopen(tmp,"rb");
+ }
+ #else
+ // UNIX: Check if the file is in DOS format, in this case convert it
+ if (crfound)
+ {
+ FILE *ftemp;
+ NoNativeEOL=True;
+ fseek(f,0,SEEK_SET);
+ tmp=unique_name("ed");
+ ftemp=fopen(tmp,"w+t");
+
+ ssize_t len;
+ char *line=0;
+ size_t lenLine=0;
+ while ((len=CLY_getline(&line,&lenLine,f))!=-1)
+ {
+ if (len>=2 && line[len-2]=='\r')
+ {
+ len--;
+ line[len-1]='\n';
+ }
+ fwrite(line,len,1,ftemp);
+ }
+ free(line);
+
+ fclose(ftemp);
+ fclose(f);
+ f=fopen(tmp,"rb");
+ }
+ else
+ fseek(f,0,SEEK_SET);
+ #endif
+ }
+ unsigned long fSize=filelength(fileno(f));
+ if (!setBufSize(fSize))
+ {
+ TScreen::showBusyState(oldBusy);
+ editorDialog(edOutOfMemory);
+ RemoveTemporal();
+ return False;
+ }
+ unsigned long realRead;
+ /* On linux you can (like I) mount an MS-DOS filesystem with
+ conv=auto, which converts CR/LF to LF. In that case
+ realRead < fSize [Robert] */
+ realRead=fread(buffer,1,fSize,f);
+ fclose(f);
+ if (realRead==0 && fSize!=0) // 1999/04/08: fSize=0 is not an error ;-)
+ {
+ TScreen::showBusyState(oldBusy);
+ editorDialog(edReadError,fileName,NULL);
+ RemoveTemporal();
+ return False;
+ }
+ if (setSHL)
+ SHLSelect(*this,buffer,realRead);
+ isValid=True;
+ setBufLen(realRead);
+ TScreen::showBusyState(oldBusy);
+ RemoveTemporal();
+ return isValid;
+}
+
+Boolean TCEditor::reLoadFile()
+{// Free memory we won't use anymore
+ flushUndoInfo();
+ // Load the file again
+ return loadFile();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Saves the editor buffer to disk, this file just desides if we need to call
+saveAs or saveFile.
+
+ Return: True on success.
+
+***************************************************************************/
+
+Boolean TCEditor::save()
+{
+ if (isReadOnly)
+ return False;
+ if (*fileName==EOS)
+ return saveAs();
+ else
+ return saveFile();
+}
+
+Boolean TCEditor::saveSameTime()
+{
+ if (isReadOnly)
+ return False;
+ if (DiskTime && *fileName!=EOS)
+ return saveFile(False,False,True);
+ editorDialog(edNotFromDisk);
+ return False;
+}
+
+/* No longer used now the user sees the name s/he wants and I use the device and inode
+ to differentiate the file (suggested by Eli)
+#ifdef TVCompf_djgpp
+static void FExpand(char *name)
+{
+ if (_USE_LFN)
+ return;
+ char tmp[PATH_MAX];
+ // First force 8+3 if not LFN
+ _truename(name,tmp);
+ // Now force Unix style names
+ fexpand(tmp);
+ strcpy(name,tmp);
+}
+#else
+inline
+static void FExpand(char *name)
+{
+ fexpand(name);
+}
+#endif
+*/
+
+/****************************************************************************
+
+ Function: Boolean saveAs()
+
+ Type: TCEditor member.
+
+ Objetive: Saves the editor buffer to disk as a new file. Call with true
+ to save as UNIX. There are a shortcut called saveAsUnix.
+
+ by SET.
+
+****************************************************************************/
+
+Boolean TCEditor::saveAs(Boolean ConvertEOL, Boolean AvoidAutoConvert)
+{
+ Boolean revertToReadOnly=False;
+ if (isReadOnly)
+ {
+ CLY_FileAttrReadWrite(&ModeOfFile);
+ isReadOnly=False;
+ revertToReadOnly=True;
+ }
+ Boolean res=False;
+ char *oldName=0;
+
+ oldName=strdup(fileName);
+ if (editorDialog(edSaveAs,fileName)!=cmCancel)
+ {
+ if (access(fileName,F_OK)==0)
+ {
+ // If the user is trying to save the same file in UNIX format let do it
+ if (editorDialog(edFileExists,fileName,(ConvertEOL || AvoidAutoConvert)
+ && strcmp(oldName,fileName)==0)!=cmYes)
+ {
+ strcpy(fileName,oldName);
+ free(oldName);
+ return False;
+ }
+ }
+ if (IsaCompressedFile && editorDialog(edFileCompMant)==cmNo)
+ IsaCompressedFile=0;
+ if ((res=saveFile(ConvertEOL,AvoidAutoConvert))==True)
+ {
+ message(owner,evBroadcast,cmcUpdateTitle,0);
+ SHLSelect(*this,buffer,bufLen);
+ update(ufView);
+ revertToReadOnly=False;
+ }
+ else
+ strcpy(fileName,oldName);
+ if (isClipboard())
+ *fileName=EOS;
+ }
+ if (revertToReadOnly)
+ {
+ CLY_FileAttrReadOnly(&ModeOfFile);
+ isReadOnly=True;
+ }
+ free(oldName);
+ return res;
+}
+
+
+/*static void writeBlock( ofstream& f, char *buf, unsigned len )
+{
+ while( len > 0 )
+ {
+ int l = len < INT_MAX ? len : INT_MAX;
+ f.write( buf, l );
+ buf += l;
+ len -= l;
+ }
+} No longer used*/
+
+const int bkpMoved=1,bkpCopied=0,bkpNone=2;
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to copy the original file to the back-up. It will just change the
+name for regular files, but if the file is a symlink it will copy the file.
+
+ Return:
+ !=0 on success
+
+***************************************************************************/
+
+static
+int FileCopyOrMove(char *file, char *newFile, int &whichUsed)
+{
+ if (strcmp(file,newFile)==0)
+ return 0;
+ if (IsASoftLink(file))
+ {
+ whichUsed=bkpCopied;
+ return FileCopy(file,newFile);
+ }
+ whichUsed=bkpMoved;
+ #ifdef SEOS_Win32
+ unlink(newFile);
+ #endif
+ return rename(file,newFile)==0;
+}
+
+/**[txh]********************************************************************
+
+ Description: Saves the editor buffer to disk as a new file, as is or
+converting the EOL format. Boolean ConvertEOL: If true changes the EOL to
+DOS/UNIX according to the current OS. Note that memory buffers are always
+in the native format.
+
+ Return:
+ True on success
+
+***************************************************************************/
+
+Boolean TCEditor::saveFile(Boolean ConvertEOL, Boolean AvoidAutoConvert,
+ Boolean noChangeTime)
+{
+ if (NoNativeEOL && (editorFlags & efSaveEOLasis) && !AvoidAutoConvert)
+ ConvertEOL=True;
+
+ int actionUsed=bkpNone;
+ if ((editorFlags & efBackupFiles) &&
+ edTestForFile(fileName) && // Forget about it if that's a new file
+ (MakeBkpForIt==0 || MakeBkpForIt(fileName)))
+ {
+ char backupName[PATH_MAX];
+ strcpy(backupName,fileName);
+
+ if (editorFlags & efUNIXBkpStyle)
+ AddToNameOfFile(backupName,"~");
+ else
+ ReplaceExtension(backupName,(char *)backupExt);
+
+ if (!FileCopyOrMove(fileName,backupName,actionUsed))
+ {
+ if (editorDialog(edCantBkp)!=cmYes)
+ return False;
+ }
+ else
+ {
+ // Now set the original attributes, but only if we used a copy
+ if (actionUsed==bkpCopied)
+ CLY_SetFileAttributes(&ModeOfFile,backupName);
+ if (editorFlags & efHiddenBkps)
+ MakeFileHidden(backupName);
+ }
+ AddToFilesToKill(backupName);
+ }
+ else
+ {// We are not going to back-up the file.
+ // Check if it was a RO and the user asked not to warn.
+ if ((editorFlags & efDoNotWarnRO) && CLY_FileAttrIsRO(&ModeOfFile))
+ {// Ok, we will most probably fail to replace the file
+ if (editorDialog(edIsReadOnly,fileName)==cmYes)
+ {
+ CLY_FileAttrReadWrite(&ModeOfFile);
+ if (!CLY_SetFileAttributes(&ModeOfFile,fileName))
+ {// Bad luck
+ editorDialog(edStillReadOnly);
+ // Undo the change to reflect reality
+ CLY_FileAttrReadOnly(&ModeOfFile);
+ // We will go on, the user could be root and finally
+ // overwrite the file.
+ }
+ }
+ }
+ }
+
+ TGZFileWrite *f=new TGZFileWrite(fileName,IsaCompressedFile);
+
+ if (!f->ok)
+ {
+ editorDialog(edCreateError,fileName);
+ delete f;
+ return False;
+ }
+ else
+ {
+ flushLine();
+
+ if (!ConvertEOL)
+ f->write(buffer,bufLen);
+ else
+ {
+ unsigned y;
+ int Limit=limit.x;
+ // A little bit more for a CR and negative offsets
+ char *s=(char *)malloc(Limit+4+4);
+ if (!s)
+ {
+ editorDialog(edOutOfMemory);
+ return False;
+ }
+ char *cur=buffer;
+ int l;
+ s[0]=s[1]=s[2]=s[3]=0;
+ s+=4; // To allow negative offsets
+
+ for (y=0; y<=totalLines; y++)
+ {
+ l=lenLines[y];
+ if (l>Limit)
+ {
+ Limit=limit.x=l;
+ s-=4; // Back to the allocated pointer
+ s=(char *)realloc(s,Limit+4+4);
+ if (!s)
+ {
+ editorDialog(edOutOfMemory);
+ return False;
+ }
+ s[0]=s[1]=s[2]=s[3]=0;
+ s+=4;
+ }
+ memcpy(s,cur,l);
+ cur+=l;
+ #ifdef CLY_UseCrLf
+ if (s[l-1]=='\n' && s[l-2]=='\r')
+ {
+ s[l-2]='\n';
+ l--;
+ }
+ #else
+ // In UNIX is save as DOS
+ if (s[l-1]=='\n' && s[l-2]!='\r')
+ {
+ s[l-1]='\r';
+ s[l]='\n';
+ l++;
+ }
+ #endif
+ f->write(s,l);
+ }
+ s-=4; // Back to the allocated pointer
+ free(s);
+ }
+
+ f->close();
+ if (!f->ok)
+ {
+ editorDialog(edWriteError,fileName,GZFiles_GetError());
+ delete f;
+ return False;
+ }
+ else
+ {
+ struct stat s;
+ char aux[PATH_MAX+30],*auxIntl;
+
+ modified=False;
+ update(ufUpdate);
+ RevertModifFlagInUndo();
+ delete f;
+ if (NoNativeEOL!=ConvertEOL)
+ updateCommands(1);
+ // The buffer *is* native, if we converted the file is no native.
+ NoNativeEOL=ConvertEOL;
+ // If we moved the file to do the backup we created a new file and hence it have
+ // the umask default attributes and not the right ones.
+ if (actionUsed==bkpMoved)
+ CLY_SetFileAttributes(&ModeOfFile,fileName);
+ if (stat(fileName,&s)==0)
+ {
+ auxIntl=TVIntl::getTextNew(__("Saved: %s (%ld bytes %d lines)."));
+ CLY_snprintf(aux,PATH_MAX+30,auxIntl,fileName,(long)s.st_size,totalLines+1);
+ FillEditorId(&EditorId,0,&s);
+ // Update it we don't know if all went OK
+ GetFileMode(&ModeOfFile,&s,fileName);
+ if (!noChangeTime)
+ DiskTime=s.st_mtime;
+ }
+ else
+ {
+ auxIntl=TVIntl::getTextNew(__("Stat failed."));
+ strcpy(aux,auxIntl);
+ }
+ DeleteArray(auxIntl);
+ setStatusLine(aux);
+ if (noChangeTime)
+ { // Set the modif. and access time to the previous
+ struct utimbuf utm;
+ utm.actime=utm.modtime=DiskTime;
+ utime(fileName,&utm);
+ }
+ time(&lastTimeCheck);
+ }
+ }
+ return True;
+}
+
+
+Boolean TCEditor::valid( ushort command )
+{
+ if (command==cmValid)
+ return isValid;
+ else
+ {// If we are quiting or the user closed the window check if we must save
+ if (command==cmQuit || command==cmClose)
+ {
+ if (modified==True)
+ {
+ int d;
+ if (*fileName==EOS)
+ d=edSaveUntitled;
+ else
+ d=edSaveModify;
+
+ switch( editorDialog( d, fileName ) )
+ {
+ case cmYes:
+ return save();
+ case cmNo:
+ modified=False;
+ return True;
+ case cmCancel:
+ return False;
+ }
+ }
+ }
+ }
+ return True;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Computes the length of the column markers array.
+
+***************************************************************************/
+
+int TCEditor::LenColMarkers(uint32 *markers)
+{
+ if (!markers) return 0;
+ int i=0;
+ while (markers[i]!=lastColMarker)
+ i++;
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a copy of the column markers array.
+
+***************************************************************************/
+
+uint32 *TCEditor::CopyColMarkers(uint32 *markers)
+{
+ int l=LenColMarkers(markers);
+ if (!l) return 0;
+ l++;
+ uint32 *ret=new uint32[l];
+ memcpy(ret,markers,l*sizeof(uint32));
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Reads the columns markers array from disk.
+
+***************************************************************************/
+
+uint32 *TCEditor::LoadColMarkers(ipstream& is)
+{
+ uchar aux;
+ is >> aux; // Version
+ is >> aux; // How many?
+
+ if (!aux) return 0;
+
+ int c=aux;
+ uint32 *ret=new uint32[c+1];
+ is.readBytes(ret,c*sizeof(uint32));
+ ret[c]=lastColMarker;
+
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes the columns markers array to disk.
+
+***************************************************************************/
+
+void TCEditor::SaveColMarkers(opstream& os, uint32 *markers)
+{
+ const uchar version=1;
+ os << version;
+ uchar c=(uchar)LenColMarkers(markers);
+ os << c;
+
+ if (c)
+ os.writeBytes(markers,c*sizeof(uint32));
+}
+
+void TCEditor::ColMarkers2Str(uint32 *markers, char *str, unsigned maxLen)
+{
+ char b[64];
+ int l=LenColMarkers(markers),i;
+ unsigned lenThis,len=0;
+
+ str[0]=0;
+ for (i=0; i<l; i++)
+ {
+ itoa(markers[i],b,10);
+ lenThis=strlen(b);
+ if (len+lenThis+2<maxLen)
+ {
+ strcat(str,b);
+ len+=lenThis;
+ if (i+1<l)
+ {
+ strcat(str," ");
+ len++;
+ }
+ }
+ }
+}
+
+static
+int compareUint32(const void *k1, const void *k2)
+{
+ return *((uint32 *)k1)-*((uint32 *)k2);
+}
+
+uint32 *TCEditor::Str2ColMarkers(char *str)
+{
+ char *s=str,*end;
+ int count=0,i;
+
+ do
+ {
+ strtoul(s,&end,10);
+ if (s!=end)
+ {
+ s=end;
+ if (*s) s++;
+ count++;
+ }
+ else
+ break;
+ }
+ while (1);
+
+ if (!count)
+ return 0;
+
+ uint32 *markers=new uint32[count+1];
+ for (i=0, s=str; i<count; i++)
+ {
+ markers[i]=(uint32)strtoul(s,&end,10);
+ s=end;
+ if (*s) s++;
+ }
+ markers[count]=lastColMarker;
+ qsort(markers,count,sizeof(uint32),compareUint32);
+
+ return markers;
+}
+
+#define DEBUG_SPLINES_UPDATE 0
+
+/**[txh]********************************************************************
+
+ Description:
+ Changes the list of special lines for a new one. The object will keep a
+copy of the list. The lines that changed are updated if they are visible.
+
+***************************************************************************/
+
+void TCEditor::SetSpecialLines(TSpCollection *nLines)
+{
+ // Move the drawPtr to the first visible line
+ AdjustDrawPtr();
+
+ int y1=delta.y, y2=delta.y+size.y, y, i, j, type;
+ TSpCollection *oLines;
+
+ if (DEBUG_SPLINES_UPDATE)
+ printf("\n\nTCEditor::SetSpecialLines\n");
+
+ oLines=SpecialLines;
+ SpecialLines=NULL;
+
+ // We are painting individual lines without calling doUpdate, so we have to
+ // clean some things before.
+ if (IsHLCOn)
+ update(ufClHLCh);
+
+ if (oLines)
+ {// We already have them redraw the affected lines
+ int cnt=oLines->getCount();
+ if (DEBUG_SPLINES_UPDATE)
+ printf("Processing %d old splines\n",cnt);
+ for (i=0; i<cnt; i++)
+ {
+ stSpLine *st=oLines->At(i);
+ y=st->nline;
+ type=st->id;
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) y=%d type=%d\n",i+1,y,type);
+ if (y>=y1 && y<y2 && (type==idsplBreak || type==idsplRunLine))
+ {// This line is visible
+ // Check if it will change
+ int found=0;
+ if (nLines)
+ {
+ int cnt=nLines->getCount();
+ for (j=0; !found && j<cnt; j++)
+ {
+ stSpLine *st=nLines->At(j);
+ if (st->nline==y && st->id!=idsplError)
+ // It was painted
+ found=1;
+ }
+ }
+ if (!found)
+ {// This line is no longer special or changed its type
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) Painting %d as normal\n",i+1,y);
+ unsigned p=drawPtr;
+ int ya;
+ for (ya=y1; ya<y; ya++)
+ p+=lenLines.safeLen(ya);
+ drawLines(y,1,p);
+ }
+ else
+ {
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) Found %d skipping\n",i+1,y);
+ }
+ }
+ }
+ }
+
+ SpecialLines=nLines;
+ if (nLines)
+ {// We got a new set, draw the affected lines
+ int cnt=nLines->getCount();
+ if (DEBUG_SPLINES_UPDATE)
+ printf("Processing %d new splines\n",cnt);
+ for (i=0; i<cnt; i++)
+ {
+ stSpLine *st=nLines->At(i);
+ y=st->nline;
+ type=st->id;
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) y=%d type=%d\n",i+1,y,type);
+ if (y>=y1 && y<y2 && (type==idsplBreak || type==idsplRunLine))
+ {// This line is visible
+ int found=0;
+ // 1) If another will be painted over it just skip
+ for (j=i-1; j>=0; j--)
+ {
+ stSpLine *st=nLines->At(j);
+ if (st->nline==y)
+ {
+ found=1;
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) Skip because %d is over (y=%d)\n",i+1,j+1,y);
+ break;
+ }
+ }
+ // 2) Check if it's changing
+ if (!found && oLines)
+ {
+ int cnt=oLines->getCount();
+ // From the last, that's the one visible
+ for (j=0; j<cnt; j++)
+ {
+ stSpLine *st=oLines->At(j);
+ if (st->nline==y && st->id!=idsplError)
+ {// We found an spline there
+ if (st->id==type)
+ {
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) Skip because old %d was the same (y=%d)\n",i+1,j+1,y);
+ // Same type, skip
+ found=1;
+ }
+ break;
+ }
+ }
+ }
+ if (!found)
+ {// This line is no longer special or changed its type
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) Painting %d as special\n",i+1,y);
+ unsigned p=drawPtr;
+ int ya;
+ for (ya=y1; ya<y; ya++)
+ p+=lenLines.safeLen(ya);
+ drawLines(y,1,p);
+ }
+ else
+ {
+ if (DEBUG_SPLINES_UPDATE)
+ printf("%d) Found %d skipping\n",i+1,y);
+ }
+ }
+ }
+ }
+
+ if (DEBUG_SPLINES_UPDATE)
+ printf("Now we have %d splines\n\n",SpecialLines ? SpecialLines->getCount() : 0);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Is the default function to handle the dialogs, the editor must define a
+real one.
+
+***************************************************************************/
+
+unsigned defEditorDialog( int, ... )
+{
+ return cmCancel;
+}
+
+int FillEditorId(stEditorId *id, const char *name, struct stat *st)
+{
+ #if defined(SEOS_Win32) && !defined(SECompf_Cygwin)
+ // This function must fail on WIN32 systems.
+ // Inode number reported by stat is always 0.
+ if (st) st=0;
+ if (name) name=0;
+ #else
+ if (st && (st->st_dev!=0 || st->st_ino!=0))
+ {
+ id->dev=st->st_dev;
+ id->inode=st->st_ino;
+ return 1;
+ }
+ struct stat s;
+ if (name && stat(name,&s)==0)
+ {
+ id->dev=s.st_dev;
+ id->inode=s.st_ino;
+ return 1;
+ }
+ #endif
+
+ id->dev=0;
+ id->inode=0;
+ return 0;
+}
+
+int CompareEditorId(stEditorId *id1, stEditorId *id2)
+{
+ return id1->dev==id2->dev && id1->inode==id2->inode;
+}
+
+int IsEmptyEditorId(stEditorId *id)
+{
+ return id->dev==0 && id->inode==0;
+}
+
+Boolean TCEditor::checkDiskCopyChanged(Boolean force)
+{
+ /* Read Only editors are like snap-shots, don't reload */
+ /* Don't be fooled by new files, they aren't on disk! */
+ if (isReadOnly || !DiskTime)
+ return False;
+ time_t now;
+ time(&now);
+ if (!force && !forceNextTimeCheck &&
+ difftime(now,lastTimeCheck)<minDifModCheck)
+ return False;
+ lastTimeCheck=now;
+ forceNextTimeCheck=False;
+ struct stat st;
+ if (stat(fileName,&st)==0)
+ {
+ if (difftime(st.st_mtime,DiskTime)>0)
+ {// To avoid problems we assume the user will reload the file or doesn't
+ // care about it. So, in order to avoid a storm of questions and dialogs
+ // we set the time of the buffer in memory to the time of the file on disk.
+ DiskTime=st.st_mtime;
+ // Code to debug it
+ #if 0
+ struct tm *tmv=localtime(&now);
+ char buffer[32];
+ printf("%s changed:\n",fileName);
+ strftime(buffer,32,"now: %X %F",tmv);
+ puts(buffer);
+ tmv=localtime(&st.st_mtime);
+ strftime(buffer,32,"file: %X %F\n",tmv);
+ puts(buffer);
+ #endif
+ return True;
+ }
+ }
+ return False;
+}
+
+TEditorDialog
+ TCEditor::editorDialog=defEditorDialog;
+unsigned TCEditor::editorFlags=efBackupFiles | efPromptOnReplace;
+char TCEditor::findStr[maxFindStrLen]="";
+char TCEditor::replaceStr[maxReplaceStrLen]="";
+TCEditor *
+ TCEditor::clipboard=0;
+int TCEditor::colorsCached=0;
+uint32 TCEditor::minDifModCheck=8;
+unsigned TCEditor::staticTabSize=8;
+unsigned TCEditor::staticIndentSize=4;
+unsigned TCEditor::LoadingVersion;
+Boolean TCEditor::staticUseTabs=False;
+Boolean TCEditor::staticAutoIndent=True;
+Boolean TCEditor::staticIntelIndent=False;
+Boolean TCEditor::staticPersistentBlocks=False;
+Boolean TCEditor::staticCrossCursorInRow=False;
+Boolean TCEditor::staticCrossCursorInCol=False;
+Boolean TCEditor::staticShowMatchPair=True;
+Boolean TCEditor::staticShowMatchPairFly=True;
+Boolean TCEditor::staticShowMatchPairNow=True;
+Boolean TCEditor::staticTransparentSel=True;
+Boolean TCEditor::staticOptimalFill=False;
+Boolean TCEditor::staticDontPurgeSpaces=False;
+Boolean TCEditor::staticSeeTabs=True;
+Boolean TCEditor::staticNoInsideTabs=True;
+Boolean TCEditor::staticTabIndents=False;
+Boolean TCEditor::staticUseIndentSize=False;
+Boolean TCEditor::staticWrapLine=False;
+Boolean TCEditor::staticBackSpUnindents=False;
+Boolean TCEditor::staticNoMoveToEndPaste=False;
+Boolean TCEditor::staticColumnMarkers=False;
+uint32 *TCEditor::staticColMarkers=0;
+char TCEditor::oTabChar=0xB1;
+char TCEditor::TabChar =0xB1;
+ushort TCEditor::SearchInSel=0;
+ushort TCEditor::FromWhere=0;
+ushort TCEditor::RegExStyle=0;
+ushort TCEditor::ReplaceStyle=0;
+ushort TCEditor::CanOptimizeRegEx=0;
+char TCEditor::StatusLine[setMaxScreenX*2];
+strSHL *TCEditor::SHLArray=NULL;
+strSHL TCEditor::strC;
+int TCEditor::strCid=-1;
+shlState TCEditor::strCtype=shlNoSyntax;
+int TCEditor::SHLCant=0;
+Boolean TCEditor::Recording=False;
+int TCEditor::MacroCount=0;
+int TCEditor::staticWrapCol=78;
+int TCEditor::DontLoadFile=0;
+TCEditor *TCEditor::haveCurSelection=NULL;
+TCEditor *TCEditor::showMatchPairFlyCache=NULL;
+TSubMenu *TCEditor::RightClickMenu=0;
+TPMCollection *TCEditor::PMColl=NULL;
+TStringCollection *TCEditor::SHLGenList=NULL;
+TSArray<unsigned int> TCEditor::MacroArray(28,32);
+TCommandSet TCEditor::cmdsAux;
+const char *TCEditor::backupExt=".bkp";
+unsigned char TCEditor::SHLTableUse[4]={0,0,0,0};
+dflOptions TCEditor::dflOps={0,0xFFFFFFFF,0,0};
+int (*TCEditor::MakeBkpForIt)(const char *name)=0;
diff --git a/setedit/mainsrc/completi.cc b/setedit/mainsrc/completi.cc
new file mode 100644
index 0000000..c09d244
--- /dev/null
+++ b/setedit/mainsrc/completi.cc
@@ -0,0 +1,247 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <ctype.h>
+#define Uses_string
+#include <limits.h>
+
+#define Uses_TStringCollection
+#define Uses_TSortedListBox
+#define Uses_TScrollBar
+#define Uses_TPalette
+#define Uses_TKeys
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TDeskTop
+
+#define Uses_TCEditor_Internal // isSymbol, etc.
+#define Uses_TCEditor // SHL cache
+#include <ceditor.h>
+#include <completi.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ Special TSortedListBox class that handles key events so they can be used
+for word completion.
+
+***************************************************************************/
+
+class TCompletionBox : public TSortedListBox
+{
+public:
+ TCompletionBox(const TRect& bounds, TScrollBar *aScrollBar) :
+ TSortedListBox(bounds,1,aScrollBar) { moveIt=0; };
+
+ virtual void draw();
+ void setSearchPos(ushort val) { searchPos=val-1; moveIt=1; };
+ virtual void handleEvent(TEvent& event);
+
+ char endChar;
+
+protected:
+ char moveIt;
+};
+
+void TCompletionBox::draw()
+{
+ TSortedListBox::draw();
+ if (moveIt && (state & (sfSelected | sfActive))==(sfSelected | sfActive) && range>0)
+ {
+ moveIt=0;
+ setCursor(cursor.x+searchPos,cursor.y);
+ }
+}
+
+void TCompletionBox::handleEvent(TEvent& event)
+{
+ if (event.what==evKeyDown)
+ {
+ unsigned code=event.keyDown.keyCode;
+ unsigned char v=event.keyDown.charScan.charCode;
+ // Valid character for move
+ if (code==kbUp || code==kbDown || code==kbPgUp || code==kbPgDn || code==kbBack)
+ TSortedListBox::handleEvent(event);
+ else
+ // Accepted selection
+ if (code==kbEnter)
+ {
+ endChar=0;
+ endModal(cmOK);
+ clearEvent(event);
+ }
+ else
+ if (isSymbol(v) || v==' ')
+ {
+ endChar=v;
+ endModal(cmOK);
+ clearEvent(event);
+ }
+ else
+ // Incrementar search
+ if ((searchPos==USHRT_MAX && isWordCharBe(v)) || isWordCharIn(v))
+ TSortedListBox::handleEvent(event);
+ else
+ {
+ // End rejecting
+ endModal(cmCancel);
+ clearEvent(event);
+ }
+ }
+ else
+ TSortedListBox::handleEvent(event);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Simple TGroup with the TDialog palette, used to create groups without a
+frame.
+
+***************************************************************************/
+
+class TNoFrame : public TGroup
+{
+public:
+ TNoFrame(const TRect &r) : TGroup(r) {};
+
+ virtual TPalette& getPalette() const;
+ virtual void setCursor(int x, int y);
+};
+
+// Same as a TDialog
+#define cpNoFrame "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"\
+ "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F"
+
+TPalette& TNoFrame::getPalette() const
+{
+ static TPalette palette(cpNoFrame,sizeof(cpNoFrame)-1);
+ return palette;
+}
+
+void TNoFrame::setCursor(int x, int y)
+{
+ TGroup::setCursor(x+origin.x,y+origin.y);
+}
+
+
+char *CompletionChooseFromList(TStringCollection *list, int cant, int len,
+ int xC, int yC, unsigned ops, int lPartial,
+ Boolean aNewStr)
+{
+ // Don't pop-up if the answer is obvious
+ if (cant<1)
+ return 0;
+ if (cant==1)
+ return aNewStr ? newStr((char *)list->at(0)) : (char *)list->at(0);
+
+ // Heavy stuff: position the list in a good place
+ TRect dktR=TProgram::deskTop->getExtent();
+ int dktW=dktR.b.x-dktR.a.x;
+ int dktH=dktR.b.y-dktR.a.y;
+ int x,y,h,w;
+ len+=3; // 1 at left, 1 at right and 1 for scroll bar
+
+ if (yC+cant>=dktH && yC>dktH/2)
+ {// Do it in the reverse direction
+ h=min(yC,cant);
+ y=yC-h;
+ }
+ else
+ {
+ y=yC+1;
+ h=min(dktH-yC-TProgram::deskTop->origin.y,cant);
+ }
+
+ w=min(dktW-2,len);
+ if (xC+w>=dktW)
+ x=dktW-1-w;
+ else
+ x=xC;
+
+ TNoFrame *group=new TNoFrame(TRect(x,y,x+w,y+h));
+ TListBoxRec r={list,0};
+ TScrollBar *ts=h<cant ? new TScrollBar(TRect(w-1,0,w,h)) : NULL;
+ TCompletionBox *b=new TCompletionBox(TRect(0,0,w-(ts ? 1 : 0),h),ts);
+ b->setData(&r);
+ if (lPartial)
+ b->setSearchPos(lPartial);
+ group->insert(b);
+ b->setState(sfSelected | sfActive,True);
+ if (ts)
+ {
+ group->insert(ts);
+ ts->show();
+ }
+
+ char *ret;
+ if (TProgram::deskTop->execView(group)==cmOK)
+ {
+ b->getData(&r);
+ char *s=(char *)list->at(r.selection);
+ if (aNewStr)
+ {
+ int l=strlen(s)+1;
+ ret=new char[l+1];
+ strcpy(ret,s);
+ if ((ops & cmplDontAddEndChar)==0 && b->endChar)
+ {
+ ret[l-1]=b->endChar;
+ ret[l]=0;
+ }
+ }
+ else
+ ret=s;
+ }
+ else
+ ret=0;
+ CLY_destroy(group);
+
+ return ret;
+}
+
+char *CompletionChoose(char *options, const char *delimiter, int x, int y,
+ unsigned ops)
+{
+ if (!options || !delimiter) return 0;
+
+ int numOps=0,lenDelim=strlen(delimiter),maxLen=0,thisLen;
+ char *curPos=options,*posAnt=options;
+ TStringCollection *list=new TStringCollection(10,4);
+ list->setOwnerShip(False);
+
+ // Split the string
+ do
+ {
+ if ((curPos=strstr(curPos,delimiter))!=0)
+ {
+ memset(curPos,0,lenDelim);
+ curPos+=lenDelim;
+ }
+ numOps++;
+ if (*posAnt)
+ {
+ thisLen=strlen(posAnt);
+ if (thisLen>maxLen)
+ maxLen=thisLen;
+ list->insert(posAnt);
+ posAnt=curPos;
+ }
+ }
+ while (curPos);
+
+ char *ret=CompletionChooseFromList(list,list->getCount(),maxLen,x,y,ops);
+
+ // Restore it
+ curPos=options;
+ numOps--;
+ for (int i=0; i<numOps; i++)
+ {
+ for (; *curPos; curPos++);
+ memcpy(curPos,delimiter,lenDelim);
+ curPos+=lenDelim;
+ }
+
+ return ret;
+}
+
diff --git a/setedit/mainsrc/deedidia.cc b/setedit/mainsrc/deedidia.cc
new file mode 100644
index 0000000..5646dec
--- /dev/null
+++ b/setedit/mainsrc/deedidia.cc
@@ -0,0 +1,527 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// That's the first include because is used to configure the editor.
+#include <ceditint.h>
+
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_string
+#define Uses_AllocLocal
+
+#define Uses_TDialog
+#define Uses_TDeskTop
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TObject
+#define Uses_TInputLine
+#define Uses_TLabel
+#define Uses_THistory
+#define Uses_TRect
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TButton
+#define Uses_MsgBox
+#define Uses_TSItem
+#define Uses_TStringCollection
+#define Uses_fpstream
+#define Uses_TKeys
+#define Uses_TStaticText
+#define Uses_TCEditor_Internal
+#define Uses_TCEditWindow
+#define Uses_TInputLinePiped
+#define Uses_TCEditor_Commands
+
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSHzGroup
+#define Uses_TSInputLinePiped
+#define Uses_TSInputLine
+#define Uses_TSCheckBoxes
+#define Uses_TSRadioButtons
+#define Uses_TSLabel
+#define Uses_TSSortedListBox
+#define Uses_TSVeGroup
+#define Uses_TSLabelCheck
+#define Uses_TSLabelRadio
+#define Uses_TSStringableListBox
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#include <edhists.h>
+#include <diaghelp.h>
+#include <setconst.h>
+#include <editcoma.h>
+
+#include <stdarg.h>
+
+#define Uses_SETAppConst
+#include <setapp.h>
+
+/**[txh]********************************************************************
+
+ Description:
+ This dialog is used to configure the RegEx options. They are: style
+(basic,extended and perl), replace (normal or tagged) and optimize (allow
+optimization of the regex when the search isn't a regex).
+
+***************************************************************************/
+
+TDialog *createRegExOpsDialog()
+{
+ TSViewCol *col=new TSViewCol(__("Regular Expression Options"));
+
+ // EN: ABDENPT
+ TSLabel *Style=TSLabelRadio(__("RegEx style"),__("~B~asic POSIX"),
+ __("~E~xtended POSIX"),
+ SUP_PCRE ? __("~P~erl Compatible") : 0,
+ 0);
+
+ TSLabel *Replace=TSLabelRadio(__("Replace text"),__("~N~ormal text"),
+ __("~D~ollar tags"),0);
+ TSLabel *Optimize=TSLabelRadio(__("Optimize"),__("~T~ry to use normal search"),
+ __("~A~lways use RegEx"),0);
+
+ TSVeGroup *rightG=new TSVeGroup(Replace,Optimize);
+ rightG->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,Style);
+ col->insert(xTSRightOf,yTSUp,rightG,Style);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcRegExOptions);
+ delete col;
+ return d;
+}
+
+static void *boxRegEx;
+
+static
+int RegExDialog(unsigned , void *)
+{
+ execDialog(createRegExOpsDialog(),boxRegEx);
+ return btcbGoOn;
+}
+
+// Eng: BCDEFGHIKOSTUWX
+// Esp: ABCDFGHIKLMOPSTX
+TDialog *createFindDialog(void *regexBox)
+{
+ boxRegEx=regexBox;
+ TSViewCol *col=new TSViewCol(__("Find"));
+
+ TSVeGroup *Options=
+ MakeVeGroup(0, // All together
+ new TSLabel(__("~T~ext to find"),
+ new TSInputLinePiped(maxFindStrLenEd,1,hID_TextSearchEditor,
+ GetDeskTopCols()/2+2)),
+ TSLabelCheck(__("Options"),__("~C~ase sensitive"),
+ __("~W~hole words only"),__("Regular e~x~pressions"),
+ __("Only ~i~nside comments"),__("Only o~u~tside comments"),
+ __("S~h~ow function name"),0),
+ TSLabelRadio(__("Scope"),__("~G~lobal"),__("~S~elected text"),0),
+ TSLabelRadio(__("Origin"),__("~F~rom cursor"),
+ __("~E~ntire scope"),0),
+ TSLabelRadio(__("Direction"),__("Forwar~d~"),
+ __("~B~ackward"),0),
+ 0);
+ Options->makeSameW();
+
+ TSHzGroup *but123=MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("RegEx ~O~ps"),cmRegExOptions,
+ bfNormal,RegExDialog),
+ 0);
+
+ col->insert(xTSCenter,yTSUp,Options);
+ col->insert(xTSCenter,yTSDown,but123);
+
+ TDialog *d=col->doItCenter(cmcFind);
+ delete col;
+ return d;
+}
+
+
+// Eng: ABCDEFGHIKNOPRSTWX
+// Esp: ABCDEFGHKLMNOPRSTUX
+TDialog *createReplaceDialog(void *regexBox)
+{
+ boxRegEx=regexBox;
+ TSViewCol *col=new TSViewCol(__("Replace"));
+ int FixWTest=(GetDeskTopCols()-12)/2;
+
+ TSLabel *TextToFind=new TSLabel(__("~T~ext to find"),
+ new TSInputLinePiped(maxFindStrLenEd,1,hID_TextSearchEditor,FixWTest));
+
+ TSLabel *newText=new TSLabel(__("~N~ew text"),
+ new TSInputLinePiped(maxReplaceStrLenEd,1,hID_TextReplaceEditor,FixWTest));
+
+ TSLabel *Options=TSLabelCheck(
+ __("Options"),__("~C~ase sensitive"),__("~W~hole words only"),
+ __("Regular e~x~pressions"),__("Only ~i~nside comments"),
+ __("Only o~u~tside comments"),__("S~h~ow function ~n~ame"),
+ __("~P~rompt on replace"),__("~R~eplace all"),0);
+ Options->setWidth(FixWTest);
+
+ TSVeGroup *OriScoDir=
+ MakeVeGroup(tsveMakeSameW, // All together + same width
+ TSLabelRadio(__("Scope"),__("~G~lobal"),__("~S~elected text"),0),
+ TSLabelRadio(__("Or~i~gin"),__("~F~rom cursor"),__("~E~ntire scope"),0),
+ TSLabelRadio(__("Direction"),__("Forwar~d~"),__("~B~ackward"),0),
+ 0);
+ TSView::makeSameW(newText,OriScoDir);
+
+ TSHzGroup *but123=MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Replace ~A~ll"),cmYes),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("RegEx ~O~ps"),cmRegExOptions,
+ bfNormal,RegExDialog),
+ 0);
+
+ col->insert(xTSLeft,yTSUp,TextToFind);
+ col->insert(xTSRightOf,yTSUp,newText,TextToFind);
+ col->insert(xTSLeft,yTSUnder,Options,0,TextToFind);
+ col->insert(xTSRightOf,yTSUnder,OriScoDir,TextToFind,newText);
+ col->insert(xTSCenter,yTSDown,but123);
+
+ TDialog *d=col->doItCenter(cmcReplace);
+ delete col;
+ return d;
+}
+
+
+TDialog *createGotoLineDialog()
+{
+ TSViewCol *col=new TSViewCol(__("Goto Line"));
+
+ TSInputLine *lineInp=new TSInputLine(10,(ushort)hID_GotoLine);
+ TSHzLabel *lineLabel=new TSHzLabel(__("Desired line"),lineInp);
+
+ col->insert(xTSCenter,yTSUpSep,lineLabel);
+ EasyInsertOKCancel(col,3);
+
+ TDialog *d=col->doItCenter(cmcGotoEditorLine);
+ delete col;
+ return d;
+}
+
+// Syntax Highlight options is a subdialog of local options
+static ShlDiagBox *SHL_Box;
+
+static
+int SHLSubDiag(unsigned , void *)
+{
+ TSViewCol *col=new TSViewCol(__("Syntax Highlighting"));
+
+ #define VeSHLW 30
+ int VeSHLH=GetDeskTopRows()-15;
+ TSRadioButtons *Shl=new TSRadioButtons(
+ new TSItem(__("Off ~1~"),
+ new TSItem(__("C++ st~y~le"),
+ new TSItem(__("Pa~s~cal style"),
+ new TSItem(__("C~l~ipper style"),
+ new TSItem(__("User ~d~efined"),0))))),VeSHLW);
+ TSSortedListBox *ListaH=new TSSortedListBox(VeSHLW,VeSHLH,tsslbVertical);
+ TSVeGroup *ShlVe=new TSVeGroup(Shl,ListaH,0);
+
+ col->insert(xTSCenter,yTSUp,ShlVe);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmcSetLocalOptions);
+ delete col;
+
+ ShlDiagBox temp;
+ memcpy(&temp,SHL_Box,sizeof(ShlDiagBox));
+ if (execDialog(d,&temp)!=cmCancel)
+ memcpy(SHL_Box,&temp,sizeof(ShlDiagBox));
+
+ return btcbGoOn;
+}
+
+TDialog *createSetLocalOptions(ShlDiagBox *shlBox)
+{ // English: ABCDEFGHIKLMNOPRSTUWYZ 1234
+ // BEGJQVXZ
+ TSViewCol *col=new TSViewCol(__("Local Options"));
+ SHL_Box=shlBox;
+
+ TSLabel *Options=TSLabelCheck(2,__("Options ~3~"),__("~O~verwrite"),__("~A~utoindent"),
+ __("~U~se real tabs (ASCII 9)"),__("~P~ersistent blocks"),__("~I~ntelligent indent"),
+ __("~C~olumn cursor"),__("~R~ow cursor"),__("~M~atched pair highlighting"),
+ __("Match pair on the fl~y~"),__("Don't wait to search for the pair ~1~"),
+ __("Tra~n~sparent Blocks"),__("Optimal ~F~ill"),__("~W~rap words"),
+ __("S~e~e tabs"),__("Don't move inside ta~b~s"),
+ __("Tab ~s~mart indents"),__("Use in~d~ent size"),
+ __("Keep trailin~g~ whitespace"),__("Backspace unindents ~2~"),
+ __("Column markers ~4~"),0);
+
+ TSHzGroup *Inputs=MakeHzGroup(3,
+ new TSHzLabel(__("~T~ab size"),new TSInputLine(3)),
+ new TSHzLabel(__("Indent si~z~e"),new TSInputLine(3)),
+ new TSHzLabel(__("Wrap co~l~umn"),new TSInputLine(4)),
+ 0);
+ TSHzLabel *colMarkers=new TSHzLabel(__("Column markers"),
+ new TSInputLine(colMarkersStrLen,30));
+ TSVeGroup *Ops=MakeVeGroup(0,Options,Inputs,colMarkers,0);
+
+ TSHzGroup *but123=MakeHzGroup(
+ new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("Syntax ~H~L Options"),cmSHLOptions,bfNormal,SHLSubDiag),
+ 0);
+
+ col->insert(xTSCenter,yTSUp,Ops);
+ col->insert(xTSCenter,yTSDown,but123);
+
+ TDialog *d=col->doItCenter(cmcSetLocalOptions);
+ delete col;
+ return d;
+}
+
+
+// Shortcuts: English: ABCDEFGHIKLMNOPRSTUWYZ 5689
+TDialog *createSetGlobalOptions()
+{
+ TSViewCol *col=new TSViewCol(__("Global Options"));
+
+ TSLabel *Options=TSLabelCheck(2,__("Options"),
+ __("~A~utoindent"),
+ __("~U~se tabs"),
+ __("~P~ersistent blocks"),
+ __("~I~ntelligent indent"),
+ __("~C~olumn cursor"),
+ __("~R~ow cursor"),
+ __("~M~atched pair highlighting"),
+ __("Match pair on the fl~y~"),
+ __("Don't wait to searc~h~ for the pair"),
+ __("~D~on't move the cursor on Paste"),
+ __("Tra~n~sparent Blocks"),
+ __("Optimal ~F~ill"),
+ __("~W~rap words"),
+ __("~S~croll Lock centers"),
+ __("S~e~e tabs"),
+ __("Don't move inside ta~b~s"),
+ __("Tab smart indents ~5~"),
+ __("Use indent size ~6~"),
+ __("Keep trailin~g~ whitespace"),
+ __("Backspace unindents ~8~"),
+ __("Column markers ~9~"),
+ 0);
+ TSHzGroup *Inputs=MakeHzGroup(3,
+ new TSHzLabel(__("~T~ab size"),new TSInputLine(3)),
+ new TSHzLabel(__("Indent si~z~e"),new TSInputLine(3)),
+ new TSHzLabel(__("Wrap co~l~umn"),new TSInputLine(4)),
+ 0);
+ TSHzLabel *colMarkers=new TSHzLabel(__("Column markers"),
+ new TSInputLine(colMarkersStrLen,30));
+ TSVeGroup *Ops=MakeVeGroup(0,Options,Inputs,colMarkers,0);
+
+ TSHzGroup *but123=MakeHzGroup(new TSButton(__("T~o~ all"), cmYes),
+ new TSButton(__("O~K~"), cmOK, bfDefault),
+ new TSButton(__("Cancel"), cmCancel),
+ 0);
+
+ col->insert(xTSCenter,yTSUp,Ops);
+ col->insert(xTSCenter,yTSDown,but123);
+
+ TDialog *d=col->doItCenter(cmcSetGlobalOptions);
+ delete col;
+ return d;
+}
+
+TDialog *createYesNoAllCancel(TPoint *size, TPoint *cursor)
+{
+ TSViewCol *col=new TSViewCol(__("Search hit"));
+
+ TSStaticText *text=new TSStaticText(__("Replace this occurence?"));
+ TSHzGroup *buttons=MakeHzGroup(new TSButton(__("~Y~es"),cmYes,bfDefault),
+ new TSButton(__("~N~o"),cmNo),
+ new TSButton(__("~A~ll"),cmOK),
+ new TSButton(__("Cancel"),cmCancel),
+ 0);
+
+ col->insert(xTSCenter,yTSUpSep,text);
+ col->insert(xTSCenter,yTSUnder,buttons,0,text);
+ TDialog *d=col->doIt();
+ delete col;
+
+ // Avoid placing the dialog over the cursor
+ int xOff=(size->x-d->size.x)/2;
+ int yOff=(size->y-d->size.y)/2;
+ // +1 because the shadow
+ if (yOff<=cursor->y && yOff+d->size.y+1>=cursor->y)
+ yOff=cursor->y+1;
+ d->moveTo(xOff,yOff);
+ return d;
+}
+
+
+TDialog *createHTMLExportOps()
+{// BCDFLMO
+ TSViewCol *col=new TSViewCol(__("Export Options"));
+
+ TSVeGroup *Ops=new TSVeGroup(
+ TSLabelCheck(__("~O~ptions"),
+ __("~F~ile name as title"),
+ __("Same ~b~ackground color as the editor"),
+ __("~M~onospaced font"),
+ __("Bo~l~d attribute"),
+ __("~U~se CSS and HTML 4.01"),0),
+ TSLabelRadio(__("Colors"),__("Use ~c~olors"),
+ __("~D~on't use colors"),0)
+ );
+
+ Ops->makeSameW();
+
+ col->insert(xTSCenter,yTSUp,Ops);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmeExportAsHTML);
+ delete col;
+ return d;
+}
+
+TDialog *createPMChoose()
+{// BFLMO
+ TSViewCol *col=new TSViewCol(__("Pseudo Macros"));
+
+ col->insert(xTSCenter,yTSUp,new TSSortedListBox(40,GetDeskTopRows()-9,tsslbVertical));
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmcChoosePMacrosList);
+ delete col;
+ return d;
+}
+
+TDialog *createArbitraryIndent(int len)
+{
+ TSViewCol *col=new TSViewCol(__("Arbitrary indent"));
+
+ TSLabel *label=new TSLabel(__("Indentation text"),
+ new TSInputLinePiped(len,1,hID_ArbitraryIndent,GetDeskTopCols()-20));
+ col->insert(xTSCenter,yTSUp,label);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmcArbitraryIndent);
+ delete col;
+ return d;
+}
+
+unsigned LimitedFileNameDialog(unsigned flags, const char *format, const char *file)
+{
+ char b[100];
+ int l=strlen(file);
+ if (l>90)
+ {
+ strcpy(b,"~");
+ strcat(b,file+l-90);
+ }
+ else
+ strcpy(b,file);
+
+ return messageBox(flags,format,b);
+}
+
+void ShowSavePoint(const char *file)
+{
+ LimitedFileNameDialog(mfInformation|mfOKButton,__("Data saved to file: %s"),file);
+}
+
+TDialog *createSolveModifCollision(Boolean haveDiff)
+{
+ TSViewCol *col=new TSViewCol(__("Solve collision"));
+
+ col->insert(xTSCenter,yTSUp,
+ MakeVeGroup(tsveMakeSameW,
+ new TSStaticText(__("Problem:\nThe copy in memory is also modified\n")),
+ new TSButton(__("~L~oad file from disk (discard changes)"),cmOK,bfDefault),
+ new TSButton(__("~A~bort operation"),cmCancel),
+ haveDiff ? new TSButton(__("Load and ~s~how differences"),cmYes) : 0,
+ haveDiff ? new TSButton(__("~D~on't load and show differences"),cmNo) : 0,
+ 0));
+ TDialog *d=col->doItCenter(cmeSetModiCkOps);
+ delete col;
+ return d;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates a dialog containing the variables from a pmacro. The
+@var{varsVals} is newly allocated buffer containing @var{nVars} elements of
+MaxVarValLen bytes. The labels for the input boxes are collected from
+@var{vars} and its maximum length must be indicated in @var{mLenVar}. The
+name of the dialog should be provided in @var{name}.
+
+ Return: False if the user aborted the macro.
+
+***************************************************************************/
+
+Boolean AskForPMVars(char *&varsVals, TNSCollection *vars, unsigned &nVars,
+ unsigned mLenVar, const char *name, TNSCollection *defs)
+{// Default values
+ nVars=0;
+ varsVals=NULL;
+ if (!vars) // No vars, go on
+ return True;
+ // How many?
+ nVars=vars->getCount();
+ if (!nVars) // No vars, go on
+ return True;
+ // Buffer for the values
+ varsVals=new char[MaxVarValLen*nVars];
+ memset(varsVals,0,MaxVarValLen*nVars);
+ // Buffer for the labels
+ AllocLocalStr(auxName,mLenVar+1);
+ // Dialog
+ TSViewCol *col=new TSViewCol(name ? name : "");
+ TSView *tsv=NULL;
+ int w=GetDeskTopCols()-8-mLenVar;
+ if (w<10) w=10;
+ for (unsigned i=0; i<nVars; i++)
+ {
+ TSInputLinePiped *lineInp=new TSInputLinePiped(MaxVarValLen,w);
+ // Pad with spaces
+ char *o=(char *)vars->at(i);
+ unsigned offset=0;
+ for (; offset<mLenVar; offset++)
+ {
+ if (*o)
+ {
+ auxName[offset]=*o;
+ o++;
+ }
+ else
+ auxName[offset]=' ';
+ }
+ auxName[offset]=0;
+ stTVIntl *intlCache=TVIntl::dontTranslateSt();
+ TSHzLabel *lineLabel=new TSHzLabel(auxName,lineInp,intlCache);
+ lineLabel->ySep=0;
+ if (!tsv)
+ col->insert(xTSLeft,yTSUp,lineLabel);
+ else
+ col->insert(xTSLeft,yTSUnder,lineLabel,NULL,tsv);
+ tsv=lineLabel;
+ // Have a default?
+ o=(char *)defs->at(i);
+ if (o)
+ strncpyZ(varsVals+MaxVarValLen*i,o,MaxVarValLen);
+ }
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doItCenter(0);
+ delete col;
+
+ if (execDialog(d,varsVals)==cmCancel)
+ {
+ delete[] varsVals;
+ return False;
+ }
+
+ return True;
+}
+
+
diff --git a/setedit/mainsrc/doedidia.cc b/setedit/mainsrc/doedidia.cc
new file mode 100644
index 0000000..43ff431
--- /dev/null
+++ b/setedit/mainsrc/doedidia.cc
@@ -0,0 +1,307 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This module contains the default definitions for the editor dialogs. To
+overwrite the behavior you must:@p
+
+1) Assign TCEditor::editorDialog to the function to handle your dialogs.@*
+2) Overwrite the needed dialogs.@*
+3) Call to doEditDialog for the rest.@p
+
+The routines needs ushort execDialog( TDialog *d, void *data ); to be
+somewhere in your code to execute the dialogs.
+
+
+***************************************************************************/
+
+#include <ceditint.h>
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_limits
+#define Uses_snprintf
+#define Uses_MsgBox
+#define Uses_fpstream
+#define Uses_TPoint
+#define Uses_TView
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TCEditor_Commands
+#define Uses_TCEditor_External
+#include <ceditor.h>
+#include <bufun.h>
+#define Uses_FileOpenAid
+#include <settvuti.h>
+#include <setconst.h>
+#include <errno.h>
+
+typedef char *_charPtr;
+typedef TPoint *PPoint;
+
+void ApplyBroadcast(TView *p, void *e)
+{
+ p->handleEvent(*(TEvent *)e);
+}
+
+#ifdef SEOSf_Solaris
+ #define StrError(a) strerror(a)
+#else
+ #if defined(SEOSf_Linux) && ((__GLIBC__==2 && __GLIBC_MINOR__>1) || __GLIBC__>2)
+ #define StrError(a) strerror(a)
+ #else
+ #define StrError(a) sys_errlist[a]
+ #endif
+#endif
+
+unsigned doEditDialog(int dialog, va_list arg)
+{
+ char *s;
+ switch(dialog)
+ {
+ case edOutOfMemory:
+ return messageBox(__("Not enough memory for this operation"),
+ mfError | mfOKButton);
+ case edReadError:
+ {
+ s=va_arg(arg,_charPtr);
+ char *err=va_arg(arg,_charPtr);
+ va_end(arg);
+ if (err)
+ return messageBox(mfError | mfOKButton,__("Error reading file %s. %s"),s,err);
+ return messageBox(mfError | mfOKButton,__("Error reading file %s. %s (%d)"),
+ s,StrError(errno),errno);
+ }
+ case edWriteError:
+ {
+ s=va_arg(arg,_charPtr);
+ char *err=va_arg(arg,_charPtr);
+ va_end(arg);
+ if (err)
+ return messageBox(mfError | mfOKButton,__("Error writing file %s. %s"),s,err);
+ return messageBox(mfError | mfOKButton,__("Error writing file %s. %s (%d)"),
+ s,StrError(errno),errno);
+ }
+ case edCreateError:
+ {
+ s=va_arg(arg,_charPtr);
+ va_end(arg);
+ return messageBox(mfError | mfOKButton,__("Error creating file %s. %s (%d)"),
+ s,StrError(errno),errno);
+ }
+ case edCreateTMPError:
+ return messageBox(__("Error creating temporal file, operation aborted"),mfError | mfOKButton);
+ case edSaveModify:
+ {
+ s=va_arg(arg,_charPtr);
+ va_end(arg);
+ return messageBox(mfInformation | mfYesNoCancel,
+ __("%s has been modified. Save?"),s);
+ }
+ case edSaveUntitled:
+ return messageBox( __("Save untitled file?"),
+ mfInformation | mfYesNoCancel );
+ case edSaveAs:
+ return GenericFileDialog(__("Save file as"),va_arg(arg,_charPtr),"*",
+ hID_FileSave,fdDialogForSave);
+ /*return execDialog( new TFileDialog( "*.*",
+ __("Save file as"),
+ __("~N~ame"),
+ fdOKButton,
+ 101 ), va_arg(arg,_charPtr) );*/
+ case edSaveBlock:
+ return GenericFileDialog(__("Write to file"),va_arg(arg,_charPtr),0,
+ hID_SaveBlock,fdDialogForSave);
+ case edReadBlock:
+ return GenericFileDialog(__("Read from file"),va_arg(arg,_charPtr),0,
+ hID_SaveBlock);
+
+ case edFind:
+ {
+ void *box1=va_arg(arg,void *);
+ void *box2=va_arg(arg,void *);
+ return execDialog(createFindDialog(box2),box1);
+ }
+
+ case edSearchFailed:
+ return messageBox( __("Search string not found."),
+ mfError | mfOKButton );
+ case edReplace:
+ {
+ void *box1=va_arg(arg,void *);
+ void *box2=va_arg(arg,void *);
+ return execDialog(createReplaceDialog(box2),box1);
+ }
+
+ case edReplacePrompt:
+ {
+ // Avoid placing the dialog on the same line as the cursor
+ TPoint *pt=va_arg(arg,PPoint);
+ return execDialog(createYesNoAllCancel(&TProgram::deskTop->size,pt),NULL);
+ }
+
+ /* Currently unused
+ case edLineLenght:
+ {
+ uint32 bytes=va_arg(arg,uint32);
+ uint32 lines=va_arg(arg,uint32);
+ return messageBox(mfInformation | mfOKButton,
+ __("%d byte(s) selected in %d line(s)"),bytes,lines);
+ }*/
+
+ case edGotoLine:
+ {
+ int *p;
+ char buf[64];
+
+ p=va_arg(arg,int *);
+ CLY_snprintf(buf,64,"%d",*p);
+
+ if (execDialog(createGotoLineDialog(),(void *)buf)==cmOK)
+ {
+ sscanf(buf,"%d",p);
+ return 1;
+ }
+ return 0;
+ }
+
+ case edJumpToPrototype:
+ case edJumpToFunction:
+ {
+ int *p;
+ char *bu,*word,*file,*shl;
+ unsigned l;
+
+ p=va_arg(arg,int *);
+ bu=va_arg(arg,char *);
+ l=va_arg(arg,unsigned);
+ word=va_arg(arg,char *);
+ file=va_arg(arg,char *);
+ shl=va_arg(arg,char *);
+
+ *p=SelectFunctionToJump(bu,l,word,dialog==edJumpToFunction ? modeBFFunctions :
+ modeBFPrototypes,file,shl);
+
+ return (*p!=-1);
+ }
+
+ case edSetLocalOptions:
+ {
+ void *box1=va_arg(arg,void *);
+ ShlDiagBox *box2=va_arg(arg,ShlDiagBox *);
+ return (execDialog(createSetLocalOptions(box2),box1)==cmOK);
+ }
+
+ case edSetGlobalOptions:
+ {
+ void *p;
+ p=va_arg(arg,void *);
+ ushort ret=execDialog( createSetGlobalOptions(), p );
+ if (ret==cmApplyAll)
+ {
+ TEvent event;
+ event.what = evBroadcast;
+ event.message.command = cmcSetGlobalOptions;
+ event.message.infoPtr = p;
+ TProgram::deskTop->forEach(ApplyBroadcast,&event);
+ }
+ return (ret==cmApplyAll) || (ret==cmOK);
+ }
+
+ case edLineOverflow:
+ return messageBox(__("Line too long, cut it?"),
+ mfError | mfYesButton | mfNoButton);
+
+ case edLineTooLong:
+ return messageBox(__("Line extremely long. Can't handle it reliably, sorry"),
+ mfError | mfOKButton);
+
+ case edNotFromDisk:
+ return messageBox(__("This file isn't on the disk!"),
+ mfInformation | mfOKButton);
+
+ case edIsReadOnly:
+ {
+ char *file=va_arg(arg,_charPtr);
+ return LimitedFileNameDialog(mfWarning | mfYesButton | mfNoButton,
+ __("The file %s is read-only, try to revert it?"),file);
+ }
+ case edStillReadOnly:
+ return messageBox(__("Failed to revert the read-only status, you won't be able to overwrite this file"),
+ mfError | mfOKButton);
+
+ case edActionWOUndo:
+ return messageBox(__("This action can't be undone. Are you sure?"),
+ mfWarning | mfYesButton | mfNoButton);
+
+ case edFileExists:
+ s=va_arg(arg,_charPtr);
+ va_end(arg);
+ return messageBox(mfYesButton | mfNoButton | mfWarning,
+ __("%s already exists. Overwrite?"),s);
+
+ case edFileNoFile:
+ s=va_arg(arg,_charPtr);
+ va_end(arg);
+ return messageBox(mfYesButton | mfNoButton | mfWarning,
+ __("%s isn't a file, probably a device, go ahead?"),s);
+
+ case edCantBkp:
+ return messageBox(__("Can't create a backup. Continue saving?"),mfYesButton | mfNoButton | mfError);
+
+ case edRectOutside:
+ messageBox(__("You can't paste a rectangle crossing the end of the file"),mfError | mfOKButton);
+ break;
+
+ case edExportHTMLOps:
+ {
+ void *p;
+ p=va_arg(arg,void *);
+ return (execDialog(createHTMLExportOps(),p)==cmOK);
+ }
+
+ case edNoPMacrosAvail:
+ return messageBox(__("No pseudo macros available"),mfError | mfOKButton);
+
+ case edChoosePMacro:
+ {
+ void *p;
+ p=va_arg(arg,void *);
+ return execDialog(createPMChoose(),p);
+ }
+
+ case edArbitraryIndent:
+ {
+ char *Buf=va_arg(arg,char *);
+ int len=va_arg(arg,int);
+ return execDialog(createArbitraryIndent(len),Buf);
+ }
+
+ case edFileCompMant:
+ return messageBox(__("The file is compressed. Do you want to save with compression?"),mfInformation | mfYesNoCancel);
+
+ case edSearchAndNoSel:
+ messageBox(__("Searching inside a selection but nothing is selected"),mfError | mfOKButton);
+ break;
+
+ case edNothingSelected:
+ messageBox(__("You must select some text for this operation"),mfError | mfOKButton);
+ break;
+
+ case edSelTooBig:
+ {
+ uint32 bytes=va_arg(arg,uint32);
+ return messageBox(mfError | mfOKButton,
+ __("You must select less than %d characters"),bytes);
+ }
+ break;
+
+ case edSelHaveEOL:
+ messageBox(__("The selection can't contain more than one line"),mfError | mfOKButton);
+ break;
+ }
+ return 0;
+}
+
+
diff --git a/setedit/mainsrc/dumpfile.cc b/setedit/mainsrc/dumpfile.cc
new file mode 100644
index 0000000..471fece
--- /dev/null
+++ b/setedit/mainsrc/dumpfile.cc
@@ -0,0 +1,211 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_string
+#define Uses_sys_stat
+#include <tv.h> // Boolean typedef
+#include <edmsg.h>
+
+int DumpFileToMessage(char *file, const char *from, uint32 SMOps,
+ char *(*ParseFun)(char *buf,FileInfo &fI,char *&fileName),
+ int kill)
+{
+ FILE *f;
+ char buf[1024];
+ int l;
+ FileInfo fInfo;
+ char *fileName;
+ int count=0;
+
+ f=fopen(file,"rt");
+ if (f)
+ {
+ fgets(buf,1000,f);
+ if (!feof(f))
+ {
+ EdShowMessageI(from);
+ do
+ {
+ l=strlen(buf);
+ if (l && buf[l-1]=='\n')
+ {
+ buf[l-1]=0;
+ if (l>1 && buf[l-2]=='\r')
+ buf[l-2]=0;
+ }
+ if (ParseFun)
+ {
+ char *s=ParseFun(buf,fInfo,fileName);
+ if (s)
+ {
+ EdShowMessageFile(s,fInfo,fileName,SMOps);
+ delete[] s;
+ delete[] fileName;
+ if (fileName)
+ count++;
+ }
+ }
+ else
+ EdShowMessage(buf,SMOps);
+ }
+ while (fgets(buf,1000,f));
+ }
+ fclose(f);
+ if (kill)
+ unlink(file);
+ }
+ return count;
+}
+
+/*****************************************************************************
+ Incremental dumper
+*****************************************************************************/
+
+static char *incFile;
+static char *(*incParseFun)(char *buf,FileInfo &fI,char *&fileName);
+static FILE *incf;
+static char incFinished;
+static uint32 incSMOps;
+static char *fromPrevRun=NULL;
+
+/**[txh]********************************************************************
+
+ Description:
+ Initializes the incremental dumper. It just sets some internal variables
+(to avoid passing them all the time) and prints the starting message.
+
+***************************************************************************/
+
+void DumpFileToMessageInit(char *file, const char *from, uint32 SMOps,
+ char *(*ParseFun)(char *buf,FileInfo &fI,char *&fileName))
+{
+ EdShowMessageI(from);
+ incParseFun=ParseFun;
+ incFile=file;
+ incSMOps=SMOps;
+ incf=0;
+ incFinished=0;
+ delete[] fromPrevRun;
+ fromPrevRun=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Dumps the next line to the message window.
+
+ Return:
+ !=0 if we finished parsing or we found an error or there are nothing to
+ parse.
+
+***************************************************************************/
+
+int DumpFileToMessageParseMore(int Lines, int *goBack)
+{
+ if (incFinished)
+ return 1;
+ if (!incf)
+ {// We didn't open the file yet
+ struct stat st;
+ if (stat(incFile,&st))
+ {// If the file doesn't exist something went wrong
+ incFinished=1; // Don't try again
+ //fprintf(stderr,"Error: Stat sobre %s fall\n",incFile);
+ return 1;
+ }
+ if (st.st_size==0)
+ {
+ // If the file is empty then we finished or we must
+ // wait until it grows
+ //fprintf(stderr,"Warning: Largo 0\n");
+ return 1;
+ }
+ // Ok, the file is there and have something
+ incf=fopen(incFile,"rt");
+ if (!incf)
+ {// Ugh!
+ incFinished=1; // Don't try again
+ //fprintf(stderr,"Error: al abrir %s\n",incFile);
+ return 1;
+ }
+ }
+
+ // Get a line, if nothing is there return
+ char buf[1024];
+ int lines=0,ret=0;
+ while (lines<Lines)
+ {
+ clearerr(incf);
+ buf[0]=0;
+ fgets(buf,1000,incf);
+ if (feof(incf))
+ {
+ ret=1;
+ if (buf[0])
+ {// If we have a partial line save it for the next run
+ delete[] fromPrevRun;
+ fromPrevRun=newStr(buf);
+ }
+ break;
+ }
+
+ // Add it
+ lines++;
+ int l=strlen(buf);
+ if (l && buf[l-1]=='\n')
+ {
+ buf[l-1]=0;
+ if (l>1 && buf[l-2]=='\r')
+ buf[l-2]=0;
+ }
+ // Check if we have a partial line from a previous run
+ if (fromPrevRun)
+ {
+ int l2=strlen(fromPrevRun);
+ if (l+l2<1020)
+ {
+ memmove(buf+l2,buf,l+1);
+ memcpy(buf,fromPrevRun,l2);
+ }
+ delete[] fromPrevRun;
+ fromPrevRun=NULL;
+ }
+ if (incParseFun)
+ {
+ FileInfo fInfo;
+ char *fileName;
+ char *s=incParseFun(buf,fInfo,fileName);
+ if (s)
+ {
+ EdShowMessageFile(s,fInfo,fileName,edsmUpdateSpLines | edsmDontUpdate);
+ delete s;
+ delete fileName;
+ if (fileName)
+ (*goBack)++;
+ }
+ }
+ else
+ EdShowMessage(buf,edsmDontUpdate);
+ }
+ if (lines)
+ EdShowMessageUpdate(edsmDontSelect | incSMOps);
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Indicates we don't want to continue dumping so the routines can close the
+file.
+
+***************************************************************************/
+
+void DumpFileToMessageEnd()
+{
+ if (incf)
+ fclose(incf);
+ incFinished=1;
+ delete[] fromPrevRun;
+ fromPrevRun=NULL;
+}
diff --git a/setedit/mainsrc/edconst.cc b/setedit/mainsrc/edconst.cc
new file mode 100644
index 0000000..c16ed99
--- /dev/null
+++ b/setedit/mainsrc/edconst.cc
@@ -0,0 +1,655 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdlib.h>
+#define Uses_TCEditor_Commands
+#define Uses_TNoCaseNoOwnerStringCollection
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor_External
+#define Uses_TInputLinePipedConst
+#define Uses_MsgBox
+// InfView requests
+#include <infr.h>
+
+#include <ceditor.h>
+#include <setapp.h>
+
+#include <inf.h>
+#include <editcoma.h>
+#include <dskwin.h>
+#include <mliedito.h>
+
+typedef struct
+{
+ char *name;
+ unsigned command;
+} edCList;
+
+static edCList List[] =
+{
+{ "AltCase", 146 },
+{ "ArbitraryIndent", 139 },
+{ "BackSpace", 49 },
+{ "BlockTrigger", 255 },
+{ "CharLeft", 50 },
+{ "CharRight", 51 },
+{ "ChooseMacro", 116 },
+{ "ChoosePMacrosList", 132 },
+{ "Clear", 77 },
+{ "ColorsChanged", 107 },
+{ "CommentIndent", 143 },
+{ "CommentUnIndent", 144 },
+{ "CompactBuffer", 88 },
+{ "CompactBufferNi", 157 },
+{ "Copy", 73 },
+{ "CopyBlock", 94 },
+{ "CopyClipFile", 150 },
+{ "CopyClipWin", 110 },
+{ "CopyOSClip", 110 },
+{ "Cut", 72 },
+{ "CutClipWin", 137 },
+{ "CutOSClip", 137 },
+{ "DelChar", 62 },
+{ "DelCharClear", 113 },
+{ "DelEnd", 65 },
+{ "DelLine", 66 },
+{ "DelPrevWord", 12 },
+{ "DelStart", 64 },
+{ "DelWord", 63 },
+{ "EndSelect", 13 },
+{ "ExpandAllTabs", 87 },
+{ "ExpandAllTabsNi", 156 },
+{ "ExpandCode", 11 },
+{ "Find", 79 },
+{ "FirstLineInScreen", 3 },
+{ "ForceMatchPairHL", 131 },
+{ "GenCodeForMacro", 118 },
+{ "GoBeginBlock", 18 },
+{ "GoEndBlock", 19 },
+{ "GoEndOfWord", 130 },
+{ "GotoEditorLine", 17 },
+{ "GotoMark0", 35 },
+{ "GotoMark1", 36 },
+{ "GotoMark2", 37 },
+{ "GotoMark3", 38 },
+{ "GotoMark4", 39 },
+{ "GotoMark5", 40 },
+{ "GotoMark6", 41 },
+{ "GotoMark7", 42 },
+{ "GotoMark8", 43 },
+{ "GotoMark9", 44 },
+{ "HideSelect", 69 },
+{ "IndentBlk", 7 },
+{ "IndentBlkOne", 5 },
+{ "IndentMode", 70 },
+{ "InsMode", 67 },
+{ "InsertKeyName", 147 },
+{ "InsertNewLine", 154 },
+{ "InsertText", 45 },
+{ "IntelIndentMode", 112 },
+{ "InvertCase", 145 },
+{ "JumpLastCursorPos", 153 },
+{ "JumpToFunction", 105 },
+{ "JumpToPrototype", 136 },
+{ "LastColInScreen", 140 },
+{ "LastLineInScreen", 4 },
+{ "LastPosCur", 103 },
+{ "LineDown", 57 },
+{ "LineEnd", 55 },
+{ "LineOrScrEnd", 141 },
+{ "LineStart", 54 },
+{ "LineUp", 56 },
+{ "LoadFileUnderCur", 108 },
+{ "MarkLine", 20 },
+{ "MarkWord", 21 },
+{ "MouseToggle", 126 },
+{ "MoveBlock", 22 },
+{ "NewLine", 48 },
+{ "NoCommand", 0 },
+{ "PageDown", 59 },
+{ "PageUp", 58 },
+{ "Paste", 74 },
+{ "PasteClipFile", 151 },
+{ "PasteClipWin", 111 },
+{ "PasteEmacsMode", 129 },
+{ "PasteOSClip", 111 },
+{ "PlayMacro", 91 },
+{ "PopCursorPos", 134 },
+{ "ProfileEditor", 106 },
+{ "PushCursorPos", 133 },
+{ "PutMark0", 25 },
+{ "PutMark1", 26 },
+{ "PutMark2", 27 },
+{ "PutMark3", 28 },
+{ "PutMark4", 29 },
+{ "PutMark5", 30 },
+{ "PutMark6", 31 },
+{ "PutMark7", 32 },
+{ "PutMark8", 33 },
+{ "PutMark9", 34 },
+{ "QuickTrigger", 254 },
+{ "QuotedPrintDecode", 138 },
+{ "ReadBlock", 46 },
+{ "RecordMacro", 89 },
+{ "Redo", 85 },
+{ "RepeatMacro", 117 },
+{ "Replace", 78 },
+{ "ReplaceSelect", 16 },
+{ "RunEnter_sLisp", 149 },
+{ "RunSel_sLisp", 148 },
+{ "Save", 114 },
+{ "SaveAs", 115 },
+{ "SaveAsConvertEOL", 93 },
+{ "SaveAsDOS", 93 }, // Alias for cmcSaveAsConvertEOL
+{ "SaveAsNoConvertEOL", 155 },
+{ "SaveAsUNIX", 93 }, // Alias for cmcSaveAsConvertEOL
+{ "SaveSameTime", 121 },
+{ "ScrollDown", 23 },
+{ "ScrollUp", 24 },
+{ "SearchAgain", 76 },
+{ "SearchClCor", 83 },
+{ "SearchClPar", 81 },
+{ "SearchComplement", 109 },
+{ "SearchEnd", 10 },
+{ "SearchOpCor", 82 },
+{ "SearchOpPar", 80 },
+{ "SearchSelBackward", 159 },
+{ "SearchSelForward", 158 },
+{ "SearchStart", 9 },
+{ "SelLength", 2 },
+{ "SelRectCopy", 97 },
+{ "SelRectCut", 100 },
+{ "SelRectDel", 99 },
+{ "SelRectEnd", 96 },
+{ "SelRectHide", 102 },
+{ "SelRectMove", 101 },
+{ "SelRectPaste", 98 },
+{ "SelRectStart", 95 },
+{ "SelRectToLower", 128 },
+{ "SelRectToUpper", 127 },
+{ "SelectOff", 120 },
+{ "SelectOn", 119 },
+{ "SetGlobalOptions", 92 },
+{ "SetLocalOptions", 86 },
+{ "SmartIndent", 15 },
+{ "SmartTab", 160 },
+{ "SmartUnIndent", 14 },
+{ "StartSelect", 68 },
+{ "StopMacro", 90 },
+{ "TextEnd", 61 },
+{ "TextStart", 60 },
+{ "ToLower", 1 },
+{ "ToUpper", 84 },
+{ "ToggleCharCase", 135 },
+{ "ToggleMoveOnPaste", 104 },
+{ "UnIndentBlk", 8 },
+{ "UnIndentBlkOne", 6 },
+{ "Undo", 75 },
+{ "UpdateCodePage", 125 },
+{ "UpdateTitle", 71 },
+{ "WhichFunctionIs", 142 },
+{ "WordLeft", 52 },
+{ "WordRight", 53 },
+{ "WrapOff", 123 },
+{ "WrapOn", 122 },
+{ "WrapToggle", 124 },
+{ "WriteBlock", 47 }
+};
+
+// cmeBase
+static edCList SetApp[] =
+{
+{ "ASCIIChart" , 59 },
+{ "AboutBox" , 41 },
+{ "AdviceDiagConf" , 88 },
+{ "AnotherInfView" , 10 },
+{ "BoardMixer" , 70 },
+{ "Breakpoint" ,110 },
+{ "Calculator" , 4 },
+{ "Calendar" , 60 },
+{ "Cascade" , 21 },
+{ "ChangeDrct" , 2 },
+{ "ClassBrowser" , 81 },
+{ "Close" , 24 },
+{ "ClosePrj" , 12 },
+{ "ColorTheme" , 74 },
+{ "ConfRunCommand" , 39 },
+{ "DbgCallStack" ,120 },
+{ "DbgCleanElem" ,134 },
+{ "DbgCloseSession",128 },
+{ "DbgDataWindow" ,132 },
+{ "DbgDetach" ,138 },
+{ "DbgDisAsmWin" ,137 },
+{ "DbgEditBreakPts",131 },
+{ "DbgEditWatchPts",125 },
+{ "DbgEndSession" ,127 },
+{ "DbgEvalModify" ,121 },
+{ "DbgFinishFun" ,116 },
+{ "DbgGoConnected" ,129 },
+{ "DbgGoReadyToRun",130 },
+{ "DbgGoToCursor" ,115 },
+{ "DbgInspector" ,126 },
+{ "DbgKill" ,119 },
+{ "DbgOptionsAdv" ,136 },
+{ "DbgOptsMsgs" ,122 },
+{ "DbgReturnNow" ,117 },
+{ "DbgRunContinue" ,112 },
+{ "DbgStackWindow" ,133 },
+{ "DbgStepOver" ,113 },
+{ "DbgStop" ,118 },
+{ "DbgThreadSel" ,135 },
+{ "DbgTraceInto" ,114 },
+{ "DbgWatchExpNorm",123 },
+{ "DbgWatchExpScp" ,124 },
+{ "DebugOptions" ,111 },
+{ "DeleteBkps" , 55 },
+{ "DosShell" , 3 },
+{ "EdGralOptions" , 37 },
+{ "EditDeflOpts" , 58 },
+{ "EditKeyBind" , 25 },
+{ "EditNoBkp" , 72 },
+{ "EditPalette" , 36 },
+{ "EditUserWords" , 57 },
+{ "Encodings" , 76 },
+{ "ExportAsHTML" , 64 },
+{ "ExportPrj" , 83 },
+{ "FileOpenOptions", 61 },
+{ "Fonts" , 77 },
+{ "GPopCursorPos" ,162 },
+{ "GPushCursorPos" ,161 },
+{ "GrepDialog" , 32 },
+{ "HTMLAccents" , 53 },
+{ "HTMLTag2Accent" , 68 },
+{ "HolidaysConf" , 86 },
+{ "ImportPrj" , 84 },
+{ "IncludeList" , 73 },
+{ "InfView" , 6 },
+{ "KbBackDefault" , 28 },
+{ "KeyPadBehavior" , 49 },
+{ "KeyboardSetUp" , 66 },
+{ "LastHelp" , 8 },
+{ "ListWin" , 7 },
+{ "LoadKeyScans" , 26 },
+{ "MP3Convert" , 43 },
+{ "MP3EditPlayList", 44 },
+{ "MP3Open" , 42 },
+{ "MP3PlayList" , 47 },
+{ "MP3Start" , 45 },
+{ "MP3Stop" , 46 },
+{ "MP3StopList" , 48 },
+{ "ManPageView" , 63 },
+{ "New" , 1 },
+{ "Next" , 22 },
+{ "NextMessage" , 33 },
+{ "Open" , 0 },
+{ "OpenPrj" , 11 },
+{ "OpenROCopy" , 56 },
+{ "PocketCalc" , 54 },
+{ "Prev" , 23 },
+{ "PrevMessage" , 34 },
+{ "PrintEditor" , 30 },
+{ "Quit" , 17 },
+{ "QuitDelete" , 16 },
+{ "ReDraw" , 67 },
+{ "RemapCodePage" , 65 },
+{ "Resize" , 18 },
+{ "RunCommand" , 38 },
+{ "SDG" , 13 },
+{ "SDGDialog" , 14 },
+{ "SaveAll" , 78 },
+{ "SaveDesktop" , 75 },
+{ "SavePrj" , 69 },
+{ "ScreenSaverOpts", 62 },
+{ "SearchTag" , 80 },
+{ "SeeScanCodes" , 29 },
+{ "SelDebugWin" ,163 },
+{ "SelWatchesWin" ,164 },
+{ "SelWinMessage" ,109 },
+{ "SelWinPrj" ,108 },
+{ "SelWindow1" , 89 },
+{ "SelWindow10" , 98 },
+{ "SelWindow11" , 99 },
+{ "SelWindow12" ,100 },
+{ "SelWindow13" ,101 },
+{ "SelWindow14" ,102 },
+{ "SelWindow15" ,103 },
+{ "SelWindow16" ,104 },
+{ "SelWindow17" ,105 },
+{ "SelWindow18" ,106 },
+{ "SelWindow19" ,107 },
+{ "SelWindow2" , 90 },
+{ "SelWindow3" , 91 },
+{ "SelWindow4" , 92 },
+{ "SelWindow5" , 93 },
+{ "SelWindow6" , 94 },
+{ "SelWindow7" , 95 },
+{ "SelWindow8" , 96 },
+{ "SelWindow9" , 97 },
+{ "SetColors" , 15 },
+{ "SetModiCkOps" , 87 },
+{ "SetScreenOps" , 35 },
+{ "SetUpAltKeys" , 27 },
+{ "SetUpPrinter" , 31 },
+{ "ShowClip" , 5 },
+{ "SourceList" ,160 },
+{ "StopChild" , 71 },
+{ "SyntaxHelp" , 50 },
+{ "SyntaxHelpFiles", 52 },
+{ "SyntaxHelpOps" , 51 },
+{ "TagFiles" , 79 },
+{ "TagsAutoRegen" ,165 },
+{ "TagsOps" , 85 },
+{ "Tile" , 20 },
+{ "TipOfTheDay" , 40 },
+{ "UserScreen" , 9 },
+{ "WordCompletion" , 82 },
+{ "Zoom" , 19 }
+};
+
+// Editor constants used by sLisp (edf*)
+static edCList SetFlags[] =
+{
+{"BasicRegEx" ,efBasicRegExSL },
+
+{"CaseSensitive" ,efCaseSensitive },
+{"ComInside" ,ComInside }, // C++ comment in this line
+
+{"DoReplace" ,efDoReplace },
+
+{"EndCom" ,EndCom }, // */
+{"EndCom2" ,EndCom2 }, // }
+{"ExtCom" ,ExtCom }, // more /* than */
+{"ExtCom2" ,ExtCom2 }, // more { than }
+{"ExtOneLineCom" ,ExtOneLineCom },
+{"ExtPrepro" ,ExtPrepro }, // Prepro+ends with \ <= be careful
+{"ExtString" ,ExtString }, // a String ends with a \ and is continued on the next line
+{"ExtString2" ,ExtString2 },
+{"ExtString3" ,ExtString3 },
+{"ExtendedRegEx" ,efExtendedRegExSL },
+
+{"FromBeggining" ,efFromBegginingSL },
+{"FromCursor" ,efFromCursorSL },
+
+//{"InSelection" ,efInSelection },
+{"InfCPU" ,edfInfCPU },
+{"InfCompiler" ,edfInfCompiler },
+{"InfCompilerFlavor",edfInfCompilerFlavor},
+{"InfOS" ,edfInfOS },
+{"InfOSFlavor" ,edfInfOSFlavor },
+{"InfTVDriver" ,edfInfTVDriver },
+
+{"InsideCom" ,InsideCom }, // All commented
+{"InsideCom2" ,InsideCom2 }, // All commented with { }
+
+// Message Box
+{"MBCancelButton" ,mfCancelButton },
+{"MBConfirmation" ,mfConfirmation },
+{"MBError" ,mfError },
+{"MBInformation" ,mfInformation },
+{"MBNoButton" ,mfNoButton },
+{"MBOKButton" ,mfOKButton },
+{"MBOKCancel" ,mfOKCancel },
+{"MBWarning" ,mfWarning },
+{"MBYesButton" ,mfYesButton },
+{"MBYesNoCancel" ,mfYesNoCancel },
+
+{"NoOptimizeRegEx",efNoOptimizeRegExSL},
+{"NormalText" ,efNormalTextSL },
+
+{"OnlySelection" ,efOnlySelectionSL },
+{"OptimizeRegEx" ,efOptimizeRegExSL },
+
+{"PerlRegEx" ,efPerlRegExSL },
+{"Prepro" ,Prepro }, // Starts with #
+{"PromptOnReplace",efPromptOnReplace },
+
+{"RegularEx" ,efRegularEx },
+{"ReplaceAll" ,efReplaceAll },
+{"RunNoRedirect" ,2 }, // Don't redirect stdout
+{"RunStopDebug" ,4 }, // Stop debug session
+{"RunUserScreen" ,1 }, // Use the user screen to run the external command
+
+{"SearchInComm" ,efSearchInComm },
+{"SearchOutComm" ,efSearchOutComm },
+{"ShowFuncName" ,efShowFuncName },
+{"StartCom" ,StartCom }, // /*
+{"StartCom2" ,StartCom2 }, // {
+{"StartInCom" ,StartInCom }, // The first char is commented
+{"StartInCom2" ,StartInCom2 }, // The first char is commented
+{"StartString" ,StartString }, // the line starts within a string (see ExtString)
+{"StartString2" ,StartString2 },
+{"StartString3" ,StartString3 },
+
+{"TagsText" ,efTagsTextSL },
+
+{"WEDisk" ,3 }, // WhichEditor constants
+{"WEExtension" ,4 },
+{"WEFull" ,0 },
+{"WEFullNoExt" ,1 },
+{"WENameNoExt" ,5 },
+{"WEPath" ,2 },
+{"WholeWordsOnly" ,efWholeWordsOnly },
+{"WinASCII" ,-dktASCII }, // SelectWindowNumber constants
+{"WinCalendar" ,-dktCalendar },
+{"WinClipboard" ,-dktClipboard },
+{"WinDebugger" ,-dktDbgMsg },
+{"WinHelp" ,-dktHelp },
+{"WinMP3" ,-dktMP3 },
+{"WinMan" ,-dktMan },
+{"WinMessage" ,-dktMessage },
+{"WinPrj" ,-dktPrj },
+{"WinWatches" ,-dktDbgWt }
+};
+
+
+
+static int ptf(const void *ckey, const void *celem)
+{
+ return strcmp((char *)ckey,((edCList *)celem)->name);
+}
+
+const int NumCommands=sizeof(List)/sizeof(edCList);
+const int NumCommandsEdit=sizeof(SetApp)/sizeof(edCList);
+const int NumFlags=sizeof(SetFlags)/sizeof(edCList);
+
+int SearchEdCommand(char *name)
+{
+ void *elem=bsearch(name,List,NumCommands,sizeof(edCList),ptf);
+ if (elem==NULL)
+ return -1;
+ return ((edCList *)elem)->command;
+}
+
+int SearchEditCommand(char *name)
+{
+ void *elem=bsearch(name,SetApp,NumCommandsEdit,sizeof(edCList),ptf);
+ if (elem==NULL)
+ return -1;
+ return ((edCList *)elem)->command;
+}
+
+int SearchEditFlag(char *name, unsigned &val)
+{
+ void *elem=bsearch(name,SetFlags,NumFlags,sizeof(edCList),ptf);
+ if (elem==NULL)
+ return 0;
+ val=((edCList *)elem)->command;
+ return 1;
+}
+
+char *TranslateEdCommand(unsigned cmc_Com)
+{
+ int i;
+ // Turbo Vision commands are 16 bits long. For some technical reasons some
+ // times I use unsigned or int to handle them but in some special cases the
+ // high 16 bits have crap. Old keybind.dat files can produce it.
+ cmc_Com&=0xFFFF;
+ cmc_Com-=cmbBaseNumber;
+ for (i=0; i<NumCommands; i++)
+ if (List[i].command==cmc_Com)
+ return List[i].name;
+ return "Unknown";
+}
+
+TNoCaseNoOwnerStringCollection *CreateEdCommandCol(void)
+{
+ TNoCaseNoOwnerStringCollection *p=new TNoCaseNoOwnerStringCollection(NumCommands,1);
+ int i;
+ for (i=0; i<NumCommands; i++)
+ p->insert(List[i].name);
+ return p;
+}
+
+/*****************************************************************************
+
+ Miscellaneous constants used from the status line.
+ All start with 'cm' which is omitted in the list.
+ They must be alphabetically sorted because I use a binary search.
+
+*****************************************************************************/
+
+static edCList Simple[] =
+{
+#define C(a) { #a, cm##a }
+ C(BkAdd),
+ C(BkDel),
+ C(BkDisable),
+ C(BkEnable),
+ C(BkGo),
+ C(BkModify),
+ C(ChangeSort),
+ C(Close),
+ C(Collapse),
+ C(DWBaseAddress),
+ C(DWBaseDecrement),
+ C(DWBaseIncrement),
+ C(DWClear),
+ C(DWDispMode),
+ C(DWDown),
+ C(DWFill),
+ C(DWFirstColumn),
+ C(DWFirstRow),
+ C(DWFollowPointer),
+ C(DWFollowPtnNew),
+ C(DWGotoAddress),
+ C(DWLastColumn),
+ C(DWLastRow),
+ C(DWLeft),
+ C(DWLessLines),
+ C(DWMoreLines),
+ C(DWMove),
+ C(DWPgDn),
+ C(DWPgUp),
+ C(DWRadix),
+ C(DWRead),
+ C(DWRecompute),
+ C(DWRight),
+ C(DWTogAutoF),
+ C(DWTogEndian),
+ C(DWUp),
+ C(DWUpdateMemory),
+ C(DWWrite),
+ C(DbgInspect),
+ C(DelFile),
+ C(Delete),
+ C(EditWatch),
+ C(Eval),
+ C(Expand),
+ C(FormatIns),
+ C(GDBCommand),
+ C(InfBack),
+ C(InfBookM),
+ C(InfControl),
+ C(InfDir),
+ C(InfGoto),
+ C(InfHelp),
+ C(InfLastLink),
+ C(InfLink1),
+ C(InfLink2),
+ C(InfLink3),
+ C(InfLink4),
+ C(InfLink5),
+ C(InfLink6),
+ C(InfLink7),
+ C(InfLink8),
+ C(InfLink9),
+ C(InfNodes),
+ C(InfOpen),
+ C(InfPasteIn),
+ C(InfTop),
+ C(Insert),
+ C(InsertWScope),
+ C(Menu),
+ C(ModifyIns),
+ C(ModifyReg),
+ C(Recycle),
+ C(Zoom),
+#undef C
+#define C(a) { "h" #a, cmh##a }
+ C(BookMarks),
+ C(ConfigDia),
+ C(Hide),
+ C(HistSel),
+ C(Next),
+ C(NodeList),
+ C(OpenInfo),
+ C(Prev),
+ C(PrevH),
+ C(Up),
+#undef C
+#define C(a) { "til" #a, cmtil##a }
+ C(Copy),
+ C(CopyOS),
+ C(Paste),
+ C(PasteOS)
+#undef C
+};
+
+static
+int compare(const void *s1, const void *s2)
+{
+ return strcmp((char *)s1,((edCList *)s2)->name);
+}
+
+int SearchSimpleCommand(char *name)
+{
+ edCList *res=(edCList *)bsearch(name,Simple,sizeof(Simple)/sizeof(edCList),
+ sizeof(edCList),compare);
+ return res ? (int)res->command : -1;
+}
+
+#define C(a) { #a, hc##a }
+static edCList HelpCtx[] =
+{
+ C(BkptDialog),
+ C(Calculator),
+ C(DataViewer),
+ C(DebugMsgWin),
+ C(Disassembler),
+ C(EditKeys),
+ C(EditKeysCom),
+ C(EditKeysMac),
+ C(EditKeysSeq),
+ C(EditorProjectWindow),
+ C(InfBookMark),
+ C(InfChoose),
+ C(InfConfig),
+ C(InfControl),
+ C(InfGoto),
+ C(InfSearch),
+ C(InfView),
+ C(Inspector),
+ C(ListWin),
+ C(MessageWindow),
+ C(RegExOptions),
+ C(WatchesWin)
+};
+#undef C
+
+int SearchHelpCtxCommand(char *name)
+{
+ edCList *res=(edCList *)bsearch(name,HelpCtx,sizeof(HelpCtx)/sizeof(edCList),
+ sizeof(edCList),compare);
+ return res ? (int)res->command : -1;
+}
+
+
diff --git a/setedit/mainsrc/editorfo.cc b/setedit/mainsrc/editorfo.cc
new file mode 100644
index 0000000..30337a1
--- /dev/null
+++ b/setedit/mainsrc/editorfo.cc
@@ -0,0 +1,3944 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/******************************************************************************
+
+ This file is part of the TCEditor class by SET.
+
+ Made:
+
+ Added the table for comments and preprocessor.
+ Search enhanced by my own fast engine 2.75 to 25 times faster depending on
+ the case.
+ Better floats highlight.
+ Eliminated the in_string, in_char, in_cpp_comment and in_prep test.
+ is_symbol uses a look up table.
+ Eliminated the temporal copy of name (faster and safter).
+ Modified the SetChar for a (char *)DrawBuffer[bufptr*2]=c much better
+ option.
+
+26/9
+ Patch from Robert for:
+ 1) Kill a bug with the garbage at the end of a line, a test for <=0 was
+ added.
+ 2) Get the colors instead of use fixed values, that's includes the assign
+ for EDITOR.
+
+28/9
+ Added Pascal highlight, is very green by now.
+ Added Clipper highlight, is even more green.
+
+30/9
+ Applied the second patch of Robert to support strings crossing lines.
+
+17/10
+ Added a new method to avoid unused warnings (by Robert).
+ Corrected to support reserved words with '_'
+
+28/10
+ Corrected some stuff about the number of bytes filled in the drawbuffer.
+
+******************************************************************************/
+
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+#include <stdio.h>
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TCEditor
+#define Uses_TCEditor_Internal
+#define Uses_ctype
+#define Uses_TVCodePage
+#include <ceditor.h>
+
+#define Uses_SOStack
+#define Uses_TSOSStringCollection
+#include <settvuti.h>
+
+inline
+static int in_range(uint32 start,uint32 end,uint32 pos)
+{
+ //if (start >= end) return 0;
+ if (pos >= start && pos < end) return 1;
+ return 0;
+}
+
+void SyntaxFormatLine(TCEditor * editor,char *DrawBuf,uint32 LinePtr,int Width,
+ uint32 Attr,unsigned lineLength,int seeTabs);
+void SyntaxFormatLinePascal(TCEditor * editor,char *DrawBuf,uint32 LinePtr,int Width,
+ int check_comment_1,int check_comment_2,unsigned lineLength,
+ int seeTabs);
+void SyntaxFormatLineClipper(TCEditor * editor,char *DrawBuf,uint32 LinePtr,int Width,
+ int check_c_comment, unsigned,int seeTabs);
+void SyntaxFormatLineGeneric(TCEditor * editor,char *DrawBuf,uint32 LinePtr,
+ int Width, uint32 Attr, unsigned lineLength,
+ int seeTabs);
+
+#define CALL(a) if (!call10(buffer,(char *)DrawBuf,color,count,offset,LinePtr,Width,tabSize,SeeTabs,a)) goto paint
+//#define CALL2 if (!call10(buffer,(char *)DrawBuf,color,count,offset,LinePtr,Width,tabSize,SeeTabs)) goto paint
+#define CALL3 call30(buffer,(char *)DrawBuf,bufLen,LinePtr,Width,tabSize,color,normalColor,SeeTabs,TabChar)
+#define CALL4 call20(buffer,(char *)DrawBuf,bufLen,LinePtr,Width,tabSize,color)
+
+static unsigned fl_bufptr;
+// Colored tabs stuff
+// Globals because they must be shared between functions
+static char tabColor;
+static int tabFF;
+
+static char *BUFFER;
+static TCEditor *EDITOR;
+static uint32 lineptr;
+
+/*
+by Robert:
+
+ Enable the following code if you know, what it does.
+
+1. It caches the color attributes for the editor and brings
+ a big speedup especially for the syntax highlight, because
+ TView::getColor is slow and called very often.
+
+2. The cached colors are valid only, if the final application
+ does not change the colors. If it changes the colors, the
+ application should set 'colors_cached' to zero.
+ One possiblity for this is to use that global variable. An
+ other thing would be to change the handleEvent method of the
+ editor to handle to an colors_changed broadcast or something
+ like that.
+
+3. Enabling the cache brings a speedup of about 15%
+ without caching: about 87 lines/second
+ with caching: about 100 lines/second
+*/
+
+uchar TCEditor::cachedColors[cNumColors];
+
+void TCEditor::CacheColors()
+{
+ int i;
+ for (i=1; i<cNumColors; i++)
+ cachedColors[i]=getColor(i);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills the colors cache with correlative numbers. This can be used to get
+SHL id values instead of colors so you can analyze according to the data
+type instead of the color.
+
+***************************************************************************/
+
+void TCEditor::ColorsCacheToIDs()
+{
+ int i;
+ for (i=1; i<cNumColors; i++)
+ cachedColors[i]=i;
+}
+
+#define GetColor(a) TCEditor::cachedColors[a]
+
+#define NormalColor GetColor(cNormal)
+#define CommentColor GetColor(cComment)
+#define PreproColor GetColor(cPre)
+#define StringColor GetColor(cString)
+#define CharColor GetColor(cChar)
+#define IlegalColor GetColor(cIllegal)
+#define ResColor GetColor(cReserved)
+#define IdentColor GetColor(cIdent)
+#define UserColor GetColor(cUser)
+#define OctalColor GetColor(cOctal)
+#define IntColor GetColor(cInteger)
+#define FloatColor GetColor(cFloat)
+#define SymbolColor GetColor(cSymbol)
+#define Symbol2Color GetColor(cSymbol2)
+#define HexColor GetColor(cHex)
+#define OddTabColor GetColor(cOddTab)
+#define EvenTabColor GetColor(cEvenTab)
+#define ColMarkColor GetColor(cColMark)
+
+inline
+static void ToggleTabColor()
+{
+ tabFF=~tabFF;
+ tabColor=tabFF ? EvenTabColor : OddTabColor;
+}
+
+#define fill_line(flag)\
+{\
+ int count = Width-offset;\
+ if (count<=0) return flag;\
+ offset+=count;\
+ while (count--)\
+ {\
+ drawBuf[fl_bufptr] = ' ';\
+ drawBuf[fl_bufptr+1] = color; \
+ fl_bufptr+=2;\
+ }\
+ return flag;\
+}
+
+#define SETCHAR(c)\
+ {\
+ drawBuf[fl_bufptr]=c;\
+ drawBuf[fl_bufptr+1]=color;\
+ fl_bufptr+=2;\
+ offset++;\
+ }
+
+#define SETCHARTAB(c)\
+ {\
+ drawBuf[fl_bufptr]=c;\
+ drawBuf[fl_bufptr+1]=tabColor;\
+ fl_bufptr+=2;\
+ offset++;\
+ }
+
+
+static Boolean call10(char *buffer,char *drawBuf,char color,int cx,
+ unsigned &offset, unsigned &lineptr,unsigned Width,
+ unsigned tabSize,int seeTabs,char tabChar)
+{
+ uchar c;
+ long count = (long)cx - (long)lineptr;
+ if (count<=0)
+ return True;
+
+ // Colored tabs stuff
+ /*tabFF=0; No here!
+ tabColor=OddTabColor;*/
+
+ do {
+ c = buffer[lineptr++];
+ if ( !c || c == '\n' || c == '\r' || c == '\t')
+ {
+ if (c=='\t')
+ {
+ if (seeTabs)
+ {
+ do
+ {
+ SETCHARTAB(tabChar);
+ }
+ while ((offset % tabSize)!=0);
+ ToggleTabColor();
+ }
+ else
+ {
+ do
+ {
+ SETCHAR(' ');
+ } while ((offset % tabSize)!=0);
+ }
+ }
+ else
+ {
+ fill_line(False);
+ }
+ }
+ else SETCHAR(c);
+ if (offset >= Width)
+ {
+ return False;
+ }
+ count--;
+ } while (count>0);
+ return True;
+}
+
+static unsigned call20(char *buffer,char *drawBuf,int bytesAvail, unsigned lineptr,
+ unsigned Width,unsigned tabSize,char color)
+{
+ uchar c;
+ int count = bytesAvail - (int)lineptr;
+
+ if (count<=0) return 0;
+ unsigned offset=0;
+ buffer+=lineptr;
+
+ do
+ {
+ c = *buffer;
+ buffer++;
+ if (c=='\r' || !c || c=='\n') // !c is for the lines under edition where 0 is the end
+ {
+ int count = Width-offset;
+ if (count<=0) return offset;
+ while (count--)
+ {
+ *drawBuf=' ';
+ *(drawBuf+1)=color;
+ drawBuf+=2;
+ }
+ return Width;
+ }
+ if (c=='\t')
+ {
+ int tabCount=tabSize-(offset % tabSize);
+ while (tabCount--)
+ {
+ *drawBuf=' ';
+ drawBuf+=2;
+ offset++;
+ }
+ }
+ else
+ {
+ *drawBuf=c;
+ drawBuf+=2;
+ offset++;
+ }
+ if (offset >= Width)
+ return offset;
+ count--;
+ }
+ while (count>0);
+ return offset;
+}
+
+static unsigned call30(char *buffer,char *drawBuf,int bytesAvail, unsigned lineptr,
+ unsigned Width,unsigned tabSize,char color,char normalCol,
+ int seeTabs, char tabChar)
+{
+ uchar c;
+ int count = bytesAvail - (int)lineptr;
+
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ if (count<=0) return 0;
+ unsigned offset=0;
+ buffer+=lineptr;
+
+ do
+ {
+ c = *buffer;
+ buffer++;
+ if (c=='\r' || !c || c=='\n') // !c is for the lines under edition where 0 is the end
+ {
+ int count = Width-offset;
+ if (count<=0) return offset;
+ while (count--)
+ {
+ *drawBuf=' ';
+ *(drawBuf+1)=normalCol;
+ drawBuf+=2;
+ }
+ return Width;
+ }
+ if (c=='\t')
+ {
+ int tabCount=tabSize-(offset % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabCount--)
+ {
+ *drawBuf=' ';
+ *(drawBuf+1)=tabColor;
+ drawBuf+=2;
+ offset++;
+ }
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabCount--)
+ {
+ *drawBuf=' ';
+ *(drawBuf+1)=color;
+ drawBuf+=2;
+ offset++;
+ }
+ }
+ }
+ else
+ {
+ *drawBuf=c;
+ *(drawBuf+1)=color;
+ drawBuf+=2;
+ offset++;
+ }
+ if (offset >= Width)
+ return offset;
+ count--;
+ }
+ while (count>0);
+ return offset;
+}
+
+static
+void PaintMarkers(char *db, char Color, unsigned Width, uint32 *colMarkers)
+{
+ int marker=0;
+ unsigned nextCol=colMarkers[marker]-1;
+ char color=Color & 0xF0; // Only the background
+
+ while (nextCol<Width)
+ {
+ db[nextCol*2+1]=(db[nextCol*2+1] & 0xF) | color;
+ nextCol=colMarkers[++marker]-1;
+ }
+}
+
+#define normalColor (Colors & 0xff)
+#define selectColor (Colors >> 8)
+
+/* Old function
+void TCEditor::formatLine( void *DrawBuf,
+ unsigned LinePtr,
+ int Width,
+ unsigned short Colors
+ )
+{
+ unsigned count,offset;
+ char color;
+ fl_bufptr = 0;
+ offset = 0;
+
+
+ if (selHided)
+ {
+ color = normalColor;
+ count = bufLen;
+ CALL;
+ }
+
+ if (selStart > LinePtr)
+ {
+ color = normalColor;
+ count = selStart;
+ CALL;
+ }
+ color = selectColor;
+ count = selEnd;
+ CALL;
+
+ color = normalColor;
+ count = bufLen;
+ CALL;
+ count = Width-offset;
+ //if (count<=offset) return;
+ //while (count--) ((ushort far *)(DrawBuf))[bufptr++] = (color << 8) | ' ';
+ while (count--)
+ {
+ ((char *)(DrawBuf))[fl_bufptr]=' ';
+ ((char *)(DrawBuf))[fl_bufptr+1]=color;
+ fl_bufptr+=2;
+ }
+}
+*/
+
+void TCEditor::formatLine(void *DrawBuf, unsigned LinePtr, int Width, ushort Colors,
+ unsigned , // lineLen
+ uint32 , // shl attributes
+ unsigned , // LineNo needed for RHIDE
+ uint32 *colMarkers)
+{
+ unsigned offset;
+ int count; // must be signed
+ char color;
+ fl_bufptr = 0;
+ offset = 0;
+
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ if (selHided)
+ {
+ color = normalColor;
+ count = bufLen;
+ CALL(' ');
+ }
+ if (selStart > LinePtr)
+ {
+ color = normalColor;
+ count = selStart>bufLen ? bufLen : selStart;
+ CALL(' ');
+ }
+ color = selectColor;
+ count = selEnd;
+ CALL(TabChar);
+
+ color = normalColor;
+ count = bufLen;
+ CALL(' ');
+
+ count = Width-offset;
+ // Bug corrected by Robert:
+ if (count<=0) return; // This is the fix for the bug with the garbage at
+ // the end of the line
+ while (count--)
+ {
+ ((char *)(DrawBuf))[fl_bufptr]=' ';
+ ((char *)(DrawBuf))[fl_bufptr+1]=color;
+ fl_bufptr+=2;
+ }
+
+paint:
+ // Column markers over the selection
+ if (colMarkers)
+ PaintMarkers((char *)DrawBuf,ColMarkColor,Width,colMarkers);
+}
+
+static void PaintPreproNoSel(unsigned offset,char *db,char *buffer,unsigned lineLen,
+ unsigned VisibleWidth,int tabSize,int extCom,
+ int seeTabs, char tabChar)
+{
+ char col=PreproColor,c;
+ int in_com,in_cpp_com,x=0;
+
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ in_com=extCom;
+ if (in_com)
+ col=CommentColor;
+ in_cpp_com=0;
+ VisibleWidth<<=1;
+ // adjust lineLen relative to offset
+ lineLen += offset;
+ do
+ {
+ c=buffer[offset++];
+ x++;
+ if (CLY_IsEOL(c)) break;
+ if (in_com)
+ {
+ if (c=='*' && buffer[offset]=='/')
+ {
+ db[fl_bufptr++]=c;
+ db[fl_bufptr++]=col;
+ c=buffer[offset++];
+ x++;
+ db[fl_bufptr++]=c;
+ db[fl_bufptr++]=col;
+ in_com=0;
+ col=PreproColor;
+ continue;
+ }
+ }
+ else
+ {
+ if (!in_cpp_com)
+ {
+ if (c=='/')
+ {
+ if (buffer[offset]=='/')
+ {
+ in_cpp_com=1;
+ in_com=0;
+ col=CommentColor;
+ }
+ else
+ if (buffer[offset]=='*')
+ {
+ in_com=1;
+ col=CommentColor;
+ db[fl_bufptr++]=c;
+ db[fl_bufptr++]=col;
+ c=buffer[offset++];
+ x++;
+ }
+ }
+ }
+ }
+ if (c=='\t')
+ {
+ x--;
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ do
+ {
+ db[fl_bufptr++]=' ';
+ db[fl_bufptr++]=tabColor;
+ x++;
+ }
+ while ((x%tabSize)!=0);
+ ToggleTabColor();
+ }
+ else
+ {
+ do
+ {
+ db[fl_bufptr++]=' ';
+ db[fl_bufptr++]=col;
+ x++;
+ }
+ while ((x%tabSize)!=0);
+ }
+ }
+ else
+ {
+ db[fl_bufptr++]=c;
+ db[fl_bufptr++]=col;
+ }
+ }
+ while (offset<lineLen && fl_bufptr<VisibleWidth);
+}
+
+
+static void PaintSelection(unsigned selStart,unsigned selEnd,unsigned lineStart,
+ char *db,char oldColor,unsigned lineLen,char *buffer,
+ unsigned tabSize,unsigned Width,Boolean TransparentSel,
+ int seeTabs, char tabChar)
+{
+ unsigned offset;
+ int count;
+ char color;
+
+ char *s=buffer+lineStart; // Is a pointer to the char in the buffer
+ char *ori=s;
+ offset=0; // Is the X coordinate
+
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ // Move s and offset to the start of the selection, calculate the length of
+ // the selected area.
+ count=selStart-lineStart;
+ if (count>0)
+ { // The start is inside the line
+ while (count--)
+ {
+ AdvanceWithTab(*s,offset);
+ ToggleTabColor();
+ s++;
+ }
+ count=selEnd-selStart;
+ }
+ else
+ count=selEnd-lineStart;
+
+ // Prepare the colors
+ color = oldColor & 0xF0; // Only the background
+ char colFor = ((unsigned char)color) >> 4;
+
+ // Prepare a pointer in the buffer
+ char *db2=db+((offset<<1)+1);
+
+ // Adjust count
+ int PaintAll;
+ unsigned skiped=s-ori;
+ if ((unsigned)count+skiped>lineLen)
+ { // If the selection ends outside the line
+ count=lineLen-skiped;
+ PaintAll=1;
+ }
+ else
+ PaintAll=0;
+
+ if (TransparentSel)
+ {
+ // Paint the line in the transparent fashion
+ while (count-- && offset<Width)
+ {
+ if (*s=='\t')
+ {
+ int tabcount = tabSize-(offset % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ {
+ db2[0]=tabColor;
+ db2[-1]=tabChar;
+ db2+=2;
+ offset++;
+ }
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ {
+ *db2=oldColor;
+ db2+=2;
+ offset++;
+ }
+ }
+ }
+ else
+ {
+ char colOri=(*db2 & 0x0F);
+ if (colOri==colFor)
+ *db2=((colOri+1) & 0x0F) | color; // Ops!, the same color!
+ else
+ *db2=colOri | color;
+ db2+=2;
+ offset++;
+ }
+ s++;
+ }
+ }
+ else
+ {
+ // Paint the line normally
+ while (count-- && offset<Width)
+ {
+ if (*s=='\t')
+ {
+ int tabcount = tabSize-(offset % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ {
+ db2[0]=tabColor;
+ db2[-1]=tabChar;
+ db2+=2;
+ offset++;
+ }
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ {
+ *db2=oldColor;
+ db2+=2;
+ offset++;
+ }
+ }
+ }
+ else
+ {
+ *db2=oldColor;
+ db2+=2;
+ offset++;
+ }
+ s++;
+ }
+ }
+
+ // Paint outside it, if needed.
+ if (PaintAll)
+ while (offset<(unsigned)Width)
+ {
+ *db2=oldColor;
+ db2+=2;
+ offset++;
+ }
+}
+
+#define FillRestOfLine() \
+ { \
+ count = Width-offset; \
+ if (count>0) \
+ { \
+ while (count--) \
+ { \
+ ((char *)(DrawBuf))[fl_bufptr]=' '; \
+ ((char *)(DrawBuf))[fl_bufptr+1]=color; \
+ fl_bufptr+=2; \
+ } \
+ } \
+ }
+
+void TCEditor::formatLineHighLight(void *DrawBuf, unsigned LinePtr, int Width,
+ ushort Colors, unsigned lineLen, uint32 Attr, unsigned , uint32 *colMarkers)
+{
+ unsigned offset;
+ int count;
+ char color;
+ unsigned lineStart=LinePtr;
+ char *db=(char *)DrawBuf;
+ EDITOR = this; // for the two functions above
+ fl_bufptr = 0;
+ offset = 0;
+
+ if (!lineLen)
+ { // If empty just fill it with spaces
+ color = normalColor;
+ }
+ else
+ if (Attr & InsideCom)
+ { // All comented
+ color = CommentColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ if ((Attr & PartialCom) && (Attr & Prepro))
+ { // Partially comented
+ PaintPreproNoSel(LinePtr,db,buffer,lineLen,Width,tabSize,Attr & StartInCom,
+ SeeTabs,TabChar);
+ offset=fl_bufptr>>1;
+ color = normalColor;
+ }
+ else
+ if ((Attr & Prepro) && !(Attr & PartialCom))
+ { // Preprocesor
+ color = PreproColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ {
+ color = normalColor;
+ offset=CALL4;
+ fl_bufptr=offset<<1;
+ SyntaxFormatLine( this,(char *)DrawBuf,lineStart,Width,Attr,lineLen,SeeTabs);
+ }
+
+ FillRestOfLine();
+
+ // Now paint the selection OVER the buffer
+ if (!selHided && selStart<selEnd && selStart<=lineLen+lineStart && selEnd>lineStart)
+ PaintSelection(selStart,selEnd,lineStart,db,selectColor,
+ lineLen,buffer,tabSize,Width,TransparentSel,SeeTabs,TabChar);
+
+ // Column markers over the selection
+ if (colMarkers)
+ PaintMarkers(db,ColMarkColor,Width,colMarkers);
+}
+
+
+
+void TCEditor::formatLineHighLightPascal(void *DrawBuf, unsigned LinePtr, int Width,
+ ushort Colors, unsigned lineLen, uint32 Attr, unsigned , uint32 *colMarkers)
+{
+ unsigned offset;
+ int count;
+ char color;
+ unsigned lineStart=LinePtr;
+ char *db=(char *)DrawBuf;
+ EDITOR = this; // for the two functions above
+ fl_bufptr = 0;
+ offset = 0;
+
+ if (!lineLen)
+ { // If empty just fill it with spaces
+ color = normalColor;
+ }
+ else
+ if (Attr & InsidePascalCom)
+ { // All comented
+ color = CommentColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ if ((Attr & PartialCom) && (Attr & Prepro))
+ { // Partially comented
+ PaintPreproNoSel(LinePtr,db,buffer,lineLen,Width,tabSize,Attr & StartInCom,
+ SeeTabs,TabChar);
+ offset=fl_bufptr>>1;
+ color = normalColor;
+ }
+ else
+ if ((Attr & Prepro) && !(Attr & PartialCom))
+ { // Preprocesor
+ color = PreproColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ {
+ color = normalColor;
+ offset=CALL4;
+ fl_bufptr=offset<<1;
+ SyntaxFormatLinePascal( this,(char *)DrawBuf,lineStart,Width,
+ Attr & StartInCom,Attr & StartInCom2,lineLen,SeeTabs);
+ }
+
+ FillRestOfLine();
+
+ // Now paint the selection OVER the buffer
+ if (!selHided && selStart<selEnd && selStart<=lineLen+lineStart && selEnd>lineStart)
+ PaintSelection(selStart,selEnd,lineStart,db,selectColor,
+ lineLen,buffer,tabSize,Width,TransparentSel,SeeTabs,TabChar);
+
+ // Column markers over the selection
+ if (colMarkers)
+ PaintMarkers(db,ColMarkColor,Width,colMarkers);
+}
+
+
+
+void TCEditor::formatLineHighLightClipper(void *DrawBuf, unsigned LinePtr, int Width,
+ ushort Colors, unsigned lineLen, uint32 Attr, unsigned, uint32 *colMarkers)
+{
+ unsigned offset;
+ int count;
+ char color;
+ unsigned lineStart=LinePtr;
+ char *db=(char *)DrawBuf;
+ EDITOR = this; // for the two functions above
+ fl_bufptr = 0;
+ offset = 0;
+
+ if (!lineLen)
+ { // If empty just fill it with spaces
+ color = normalColor;
+ }
+ else
+ if (Attr & InsideCom)
+ { // All comented
+ color = CommentColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ if ((Attr & PartialCom) && (Attr & Prepro))
+ { // Partially comented
+ PaintPreproNoSel(LinePtr,db,buffer,lineLen,Width,tabSize,Attr & StartInCom,
+ SeeTabs,TabChar);
+ offset=fl_bufptr>>1;
+ color = normalColor;
+ }
+ else
+ if ((Attr & Prepro) && !(Attr & PartialCom))
+ { // Preprocesor
+ color = PreproColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ {
+ color = normalColor;
+ offset=CALL4;
+ fl_bufptr=offset<<1;
+ SyntaxFormatLineClipper( this,(char *)DrawBuf,lineStart,Width,Attr & StartInCom,
+ lineLen,SeeTabs);
+ }
+
+ FillRestOfLine();
+
+ // Now paint the selection OVER the buffer
+ if (!selHided && selStart<selEnd && selStart<=lineLen+lineStart && selEnd>lineStart)
+ PaintSelection(selStart,selEnd,lineStart,db,selectColor,
+ lineLen,buffer,tabSize,Width,TransparentSel,SeeTabs,TabChar);
+
+ // Column markers over the selection
+ if (colMarkers)
+ PaintMarkers(db,ColMarkColor,Width,colMarkers);
+}
+
+
+void TCEditor::formatLineHighLightGeneric(void *DrawBuf, unsigned LinePtr, int Width,
+ ushort Colors, unsigned lineLen, uint32 Attr, unsigned, uint32 *colMarkers)
+{
+ unsigned offset;
+ int count;
+ char color;
+ unsigned lineStart=LinePtr;
+ char *db=(char *)DrawBuf;
+ EDITOR = this; // for the two functions above
+ fl_bufptr = 0;
+ offset = 0;
+
+ if (!lineLen)
+ { // If empty just fill it with spaces
+ color = normalColor;
+ }
+ else
+ if (Attr & InsideGenericCom)
+ { // All comented
+ color = CommentColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ if ((Attr & PartialCom) && (Attr & Prepro))
+ { // Partially comented
+ PaintPreproNoSel(LinePtr,db,buffer,lineLen,Width,tabSize,Attr & StartInGenericCom,
+ SeeTabs,TabChar);
+ offset=fl_bufptr>>1;
+ color = normalColor;
+ }
+ else
+ if ((Attr & Prepro) && !(Attr & PartialCom))
+ { // Preprocesor
+ color = PreproColor;
+ offset= CALL3;
+ fl_bufptr=offset<<1;
+ }
+ else
+ {
+ color = normalColor;
+ offset=CALL4;
+ fl_bufptr=offset<<1;
+ SyntaxFormatLineGeneric( this,(char *)DrawBuf,lineStart,Width,Attr,lineLen,
+ SeeTabs);
+ }
+
+ FillRestOfLine();
+
+ // Now paint the selection OVER the buffer
+ if (!selHided && selStart<selEnd && selStart<=lineLen+lineStart && selEnd>lineStart)
+ PaintSelection(selStart,selEnd,lineStart,db,selectColor,
+ lineLen,buffer,tabSize,Width,TransparentSel,SeeTabs,TabChar);
+
+ // Column markers over the selection
+ if (colMarkers)
+ PaintMarkers(db,ColMarkColor,Width,colMarkers);
+}
+
+// For Reserved words
+static strSETSE stRW={NULL,NULL,NULL,NULL,NULL,0};
+// For User words
+static strSETSE stUW={NULL,NULL,NULL,NULL,NULL,0};
+// For Pascal Reserved words
+static strSETSE stPR={NULL,NULL,NULL,NULL,NULL,0};
+// For Clipper Reserved words
+static strSETSE stCR={NULL,NULL,NULL,NULL,NULL,0};
+
+#if 0
+/*****************************************************************************
+
+ Function: SETSECreateTables
+
+ Create the necesary tables for the search
+
+*****************************************************************************/
+
+static Boolean SETSECreateTables(char *&firstLetters,
+ int *&lenTable,
+ int *&firstWithLength,
+ char **&mainTable,
+ int *&equalCharsInNext,
+ int &maxLen,
+ TStrCol *TSC)
+{
+ int i;
+ int total=TSC->getCount();
+ int thisLen;
+ maxLen=0;
+
+ for (i=0; i<total; i++)
+ {
+ if ((thisLen=strlen((char *)TSC->at(i)))>maxLen)
+ maxLen=thisLen;
+ }
+
+ // The following is nice but missaling data, some platforms doesn't support it.
+ // Linux/PPC logs it as a warning at kernel level and Linux/SPARC64 just raise
+ // a SIGBUS signal.
+ // *:-P One allocation for the five tables.
+ //firstLetters=new char[total*(sizeof(char)+sizeof(char *)+sizeof(int))+(2*sizeof(int))*(maxLen+1)];
+ firstLetters =new char[total];
+ lenTable =new int[maxLen+1];
+ firstWithLength =new int[maxLen+1];
+ mainTable =new char *[total];
+ equalCharsInNext=new int[total];
+
+ // Fill the length table
+ for (i=0; i<=maxLen; i++)
+ {
+ firstWithLength[i]=0;
+ lenTable[i]=0;
+ }
+
+ for (i=0; i<total; i++)
+ lenTable[strlen((char *)TSC->at(i))]++;
+
+ // Search & Clasify
+ int pos=0;
+ for (i=0; i<=maxLen; i++)
+ {
+ int j=0,n=0;
+ while (j<lenTable[i])
+ {
+ char *s=(char *)TSC->at(n);
+ if ((int)strlen(s)==i)
+ {
+ if (j==0)
+ firstWithLength[i]=pos;
+ mainTable[pos++]=s;
+ j++;
+ }
+ n++;
+ }
+ }
+
+ // Make the first letters
+ for (i=0; i<total; i++)
+ firstLetters[i]=mainTable[i][0];
+
+ // Make the equality table
+ for (pos=0,i=0; i<=maxLen; i++)
+ {
+ int j=lenTable[i];
+ while (j)
+ {
+ if (j>1)
+ {
+ char *este=mainTable[pos];
+ char *prox=mainTable[pos+1];
+ int c;
+ for (c=0; *este==*prox && *este; este++, prox++, c++);
+ equalCharsInNext[pos]=c;
+ }
+ else
+ equalCharsInNext[pos]=0;
+ pos++;
+ j--;
+ }
+ }
+ return True;
+}
+#endif
+
+Boolean SETSECreateTables(strSETSE &st, int CaseSens,
+ TStringCollection *TSC)
+{
+ int i;
+ int total=TSC->getCount();
+ int thisLen;
+ st.maxLen=0;
+
+ for (i=0; i<total; i++)
+ {
+ char *elem=(char *)TSC->at(i);
+ if ((thisLen=strlen(elem))>st.maxLen)
+ st.maxLen=thisLen;
+ if (!CaseSens)
+ strlwr(elem);
+ }
+
+ st.firstLetters =new char[total];
+ st.lenTable =new int[st.maxLen+1];
+ st.firstWithLength =new int[st.maxLen+1];
+ st.mainTable =new char *[total];
+ st.equalCharsInNext=new int[total];
+
+ // Fill the length table
+ for (i=0; i<=st.maxLen; i++)
+ {
+ st.firstWithLength[i]=0;
+ st.lenTable[i]=0;
+ }
+
+ for (i=0; i<total; i++)
+ st.lenTable[strlen((char *)TSC->at(i))]++;
+
+ // Search & Clasify
+ int pos=0;
+ for (i=0; i<=st.maxLen; i++)
+ {
+ int j=0,n=0;
+ while (j<st.lenTable[i])
+ {
+ char *s=(char *)TSC->at(n);
+ if ((int)strlen(s)==i)
+ {
+ if (j==0)
+ st.firstWithLength[i]=pos;
+ st.mainTable[pos++]=s;
+ j++;
+ }
+ n++;
+ }
+ }
+
+ // Make the first letters
+ for (i=0; i<total; i++)
+ st.firstLetters[i]=st.mainTable[i][0];
+
+ // Make the equality table
+ for (pos=0,i=0; i<=st.maxLen; i++)
+ {
+ int j=st.lenTable[i];
+ while (j)
+ {
+ if (j>1)
+ {
+ char *este=st.mainTable[pos];
+ char *prox=st.mainTable[pos+1];
+ int c;
+ for (c=0; *este==*prox && *este; este++, prox++, c++);
+ st.equalCharsInNext[pos]=c;
+ }
+ else
+ st.equalCharsInNext[pos]=0;
+ pos++;
+ j--;
+ }
+ }
+ return True;
+}
+
+/*****************************************************************************
+
+ Function: SETSE_RW_Search
+
+ Is the search engine of the SETSE algorithm.
+ The tables are sorted 1st by string length and then by alphabetic order.
+ When we need to search a string first we check if the length is valid, if
+not the search ends, if the length is OK we go directly to the first element
+with this length, then we use a table with the first letters of the list and
+we search in this table until we found the letter or we exced the range of
+word with the desired length ... puf ..., if we found a match we start to
+compare the whole string, if the any letter fails we ask if the following
+string have enough equal letters (there is a table for this) if not we return,
+if yes we continue the comparison in the next string, not from the start the
+start because we know that this string match the first letters.
+ The goal of the system is: We never retrace in the string index we ever
+advance or still in the same index.
+ If you don't understand what I'm saying don't worry my english is a
+disaster and the algorithm is a little tricky.
+
+*****************************************************************************/
+
+#define is_reserved(a,b) SETSE_RW_Search(a,b)
+static int SETSE_RW_Search(char *s, int l)
+{
+ // Is in the length range?
+ if (l<=stRW.maxLen)
+ {
+ int cant=stRW.lenTable[l];
+ // Exist any of this length?
+ if (cant)
+ {
+ // Take the pos of the first string of this length
+ int pos=stRW.firstWithLength[l];
+ do
+ {
+ // Search a string of this length that starts with the same character
+ if (stRW.firstLetters[pos]==*s)
+ {
+ int equals=1;
+ // Compare the string
+ char *aux=stRW.mainTable[pos]+1;
+ s++;
+RWProxSSearch1:
+ if (--l==0) // Eureka!
+ return pos+1; // +1 because the position 0 exist
+RWProxSSearch2:
+ if (*aux==*s)
+ {
+ // Next char
+ equals++;
+ s++;
+ aux++;
+ goto RWProxSSearch1;
+ }
+ // Is usefull the next string?
+ if (stRW.equalCharsInNext[pos]>=equals)
+ {
+ // Yes!, use it, but don't waste the work already done
+ aux=stRW.mainTable[++pos]+equals;
+ goto RWProxSSearch2;
+ }
+ return 0;
+ }
+ pos++;
+ }
+ while (--cant);
+ }
+ }
+ return 0;
+}
+
+static
+int SETSE_UW_Search(char *s, int l)
+{
+ // Is in the length range?
+ if (l<=stUW.maxLen)
+ {
+ int cant=stUW.lenTable[l];
+ // Exist any of this length?
+ if (cant)
+ {
+ // Take the pos of the first string of this length
+ int pos=stUW.firstWithLength[l];
+ do
+ {
+ // Search a string of this length that starts with the same character
+ if (stUW.firstLetters[pos]==*s)
+ {
+ int equals=1;
+ // Compare the string
+ char *aux=stUW.mainTable[pos]+1;
+ s++;
+UWProxSSearch1:
+ if (--l==0) // Eureka!
+ return pos+1;
+UWProxSSearch2:
+ if (*aux==*s)
+ {
+ // Next char
+ equals++;
+ s++;
+ aux++;
+ goto UWProxSSearch1;
+ }
+ // Is usefull the next string?
+ if (stUW.equalCharsInNext[pos]>=equals)
+ {
+ // Yes!, use it, but don't waste the work already done
+ aux=stUW.mainTable[++pos]+equals;
+ goto UWProxSSearch2;
+ }
+ return 0;
+ }
+ pos++;
+ }
+ while (--cant);
+ }
+ }
+ return 0;
+}
+
+#define is_pascal_rword(a,b) SETSE_PR_Search(a,b)
+static int SETSE_PR_Search(char *s, int l)
+{
+ // Is in the length range?
+ if (l<=stPR.maxLen)
+ {
+ int cant=stPR.lenTable[l];
+ // Exist any of this length?
+ if (cant)
+ {
+ // Take the pos of the first string of this length
+ int pos=stPR.firstWithLength[l];
+ uchar c=TVCodePage::toLower(*s);
+ do
+ {
+ // Search a string of this length that starts with the same character
+ if (stPR.firstLetters[pos]==c)
+ {
+ int equals=1;
+ // Compare the string
+ char *aux=stPR.mainTable[pos]+1;
+ s++; c=TVCodePage::toLower(*s);
+PRProxSSearch1:
+ if (--l==0) // Eureka!
+ return pos+1;
+PRProxSSearch2:
+ if (*aux==c)
+ {
+ // Next char
+ equals++;
+ s++; c=TVCodePage::toLower(*s);
+ aux++;
+ goto PRProxSSearch1;
+ }
+ // Is usefull the next string?
+ if (stPR.equalCharsInNext[pos]>=equals)
+ {
+ // Yes!, use it, but don't waste the work already done
+ aux=stPR.mainTable[++pos]+equals;
+ goto PRProxSSearch2;
+ }
+ return 0;
+ }
+ pos++;
+ }
+ while (--cant);
+ }
+ }
+ return 0;
+}
+
+#define is_clipper_rword(a,b) SETSE_CR_Search(a,b)
+static int SETSE_CR_Search(char *s, int l)
+{
+ // Is in the length range?
+ if (l<=stCR.maxLen)
+ {
+ int cant=stCR.lenTable[l];
+ // Exist any of this length?
+ if (cant)
+ {
+ // Take the pos of the first string of this length
+ int pos=stCR.firstWithLength[l];
+ uchar c=TVCodePage::toLower(*s);
+ do
+ {
+ // Search a string of this length that starts with the same character
+ if (stCR.firstLetters[pos]==c)
+ {
+ int equals=1;
+ // Compare the string
+ char *aux=stCR.mainTable[pos]+1;
+ s++; c=TVCodePage::toLower(*s);
+CRProxSSearch1:
+ if (--l==0) // Eureka!
+ return pos+1;
+CRProxSSearch2:
+ if (*aux==c)
+ {
+ // Next char
+ equals++;
+ s++; c=TVCodePage::toLower(*s);
+ aux++;
+ goto CRProxSSearch1;
+ }
+ // Is usefull the next string?
+ if (stCR.equalCharsInNext[pos]>=equals)
+ {
+ // Yes!, use it, but don't waste the work already done
+ aux=stCR.mainTable[++pos]+equals;
+ goto CRProxSSearch2;
+ }
+ return 0;
+ }
+ pos++;
+ }
+ while (--cant);
+ }
+ }
+ return 0;
+}
+
+static
+int isGeneralReservedWord(char *s, int l, int CaseSens, strSETSE &st)
+{
+ // Is in the length range?
+ if (l<=st.maxLen)
+ {
+ int cant=st.lenTable[l];
+ // Exist any of this length?
+ if (cant)
+ {
+ // Take the pos of the first string of this length
+ int pos=st.firstWithLength[l];
+ uchar c = CaseSens ? *s : TVCodePage::toLower(*s);
+ do
+ {
+ // Search a string of this length that starts with the same character
+ if (st.firstLetters[pos]==c)
+ {
+ int equals=1;
+ // Compare the string
+ char *aux=st.mainTable[pos]+1;
+ s++; c=CaseSens ? *s : TVCodePage::toLower(*s);
+stProxSSearch1:
+ if (--l==0) // Eureka!
+ return pos+1;
+stProxSSearch2:
+ if (*aux==c)
+ {
+ // Next char
+ equals++;
+ s++; c=CaseSens ? *s : TVCodePage::toLower(*s);
+ aux++;
+ goto stProxSSearch1;
+ }
+ // Is usefull the next string?
+ if (st.equalCharsInNext[pos]>=equals)
+ {
+ // Yes!, use it, but don't waste the work already done
+ aux=st.mainTable[++pos]+equals;
+ goto stProxSSearch2;
+ }
+ return 0;
+ }
+ pos++;
+ }
+ while (--cant);
+ }
+ }
+ return 0;
+}
+
+static
+int is_user_word(char *s, int l, int caseSens)
+{
+ if (TCEditor::strC.UserWords)
+ return isGeneralReservedWord(s,l,caseSens,TCEditor::strC.SearchUserWords);
+ return SETSE_UW_Search(s,l);
+}
+
+static
+int isPartialKeyword(char *s, int l, int CaseSens, TStringCollection *keywords,
+ unsigned &end)
+{
+ // Do it ASCIIZ for the search
+ AllocLocalStr(temp,l+1);
+ memcpy(temp,s,l);
+ temp[l]=0;
+ if (!CaseSens)
+ strlwr(temp);
+
+ // Search for it
+ ccIndex pos;
+ Boolean res=keywords->search(temp,pos);
+ if (res) // Full match
+ return 1;
+
+ // Now see if it could be a partial
+ if (pos) // We ever get the next, but dont go negative
+ pos--;
+ char *test=(char *)keywords->at(pos);
+ int i,len;
+ len=strlen(test);
+ if (len>=l) // Impossible, quit
+ return 0;
+ // Check if they match using the length of the keyword
+ if (CaseSens)
+ {
+ for (i=0; i<len; i++)
+ {
+ if (s[i]!=test[i])
+ return 0;
+ }
+ }
+ else
+ {
+ for (i=0; i<len; i++)
+ {
+ if (s[i]!=TVCodePage::toLower(test[i]))
+ return 0;
+ }
+ }
+ // Ok, reduce the length of the word to the matched part
+ end+=len-l;
+ return 1;
+}
+
+void SETSEDeleteTables(strSETSE &st)
+{
+ if (st.firstLetters)
+ {
+ delete[] st.firstLetters;
+ st.firstLetters=NULL;
+ delete[] st.lenTable;
+ delete[] st.firstWithLength;
+ delete[] st.mainTable;
+ delete[] st.equalCharsInNext;
+ }
+}
+
+/*****************************************************************************
+
+ Function: Boolean CreateSHShortCutTables(void)
+
+ Initialize the search tables for ReservedWords and UserWords.
+
+*****************************************************************************/
+
+Boolean CreateSHShortCutTables(void)
+{
+ if (ReservedWords)
+ {
+ SETSEDeleteTables(stRW);
+ if (!SETSECreateTables(stRW,1,ReservedWords))
+ return False;
+ }
+ else
+ stRW.maxLen=0;
+
+ if (UserWords)
+ {
+ SETSEDeleteTables(stUW);
+ if (!SETSECreateTables(stUW,1,UserWords))
+ return False;
+ }
+ else
+ stUW.maxLen=0;
+
+ if (PascalRWords)
+ {
+ SETSEDeleteTables(stPR);
+ if (!SETSECreateTables(stPR,1,PascalRWords))
+ return False;
+ }
+ else
+ stPR.maxLen=0;
+
+ if (ClipperRWords)
+ {
+ SETSEDeleteTables(stCR);
+ if (!SETSECreateTables(stCR,1,ClipperRWords))
+ return False;
+ }
+ else
+ stCR.maxLen=0;
+
+ return True;
+}
+
+
+void DestroySHShortCutTables(void)
+{
+ SETSEDeleteTables(stRW);
+ SETSEDeleteTables(stUW);
+ SETSEDeleteTables(stPR);
+ SETSEDeleteTables(stCR);
+}
+
+
+/*****************************************************************************
+
+ Function: int is_integer_float(const char *name,uint32 l,uint32 rest)
+
+ Parameters:
+ name: string to analyze.
+ l: length.
+ rest: available chars in the line.
+
+ Return:
+ 0 an invalid number.
+ 1 an integer.
+ 2 a float.
+
+ Notes:
+ Adapted for length.
+ Added u and l.
+ Added floats
+ Added support for [uU][lL]{0,2} | [lL][uU]?[lL]? | [lL][lL]?[uU]?
+ Added [lL] | [fF] for floats (Vik's recommendation)
+
+ by SET based in the Robert's version.
+
+*****************************************************************************/
+
+#define OneOrZeroOf(a,b) \
+ if (dispo==0) return 1; \
+ name++; \
+ if (!isalnum((uchar)*name)) return 1; \
+ if (*name!=a && *name!=b) \
+ return 0; \
+ dispo--
+
+#define OkIfSepRet(a) \
+ if (dispo==0) return a; \
+ name++; \
+ if (!isalnum((uchar)*name)) return a
+
+static int is_integer_float(const char *name, uint32 &dispo)
+{
+ while (dispo--)
+ {
+ if (!ucisdigit(*name))
+ {
+ if (*name=='U' || *name=='u') // [uU][lL]{0,2} with brut force
+ {
+ OneOrZeroOf('l','L');
+ OneOrZeroOf('l','L');
+ OkIfSepRet(1);
+ return 0;
+ }
+ if (*name=='L' || *name=='l') // [lL]...
+ {
+ OkIfSepRet(1);
+ if (*name=='u' || *name=='U') // ...[uU][lL]?
+ {
+ dispo--;
+ OneOrZeroOf('l','L');
+ OkIfSepRet(1);
+ }
+ else
+ if (*name=='l' || *name=='L') // ...[lL][uU]?
+ {
+ dispo--;
+ OneOrZeroOf('u','U');
+ OkIfSepRet(1);
+ }
+ return 0;
+ }
+ if (*name=='E' || *name=='e')
+ goto TryFloat1;
+ if (*name=='.')
+ goto TryFloat0;
+ if (!TVCodePage::isAlpha(*name))
+ {
+ dispo++;
+ return 1;
+ }
+ return 0;
+ }
+ name++;
+ }
+
+ if (!dispo || *name!='.')
+ return 1;
+
+TryFloat0:
+ name++;
+ //dispo--;
+ while (dispo--)
+ {
+ if (!ucisdigit(*name))
+ {
+ if (*name=='E' || *name=='e')
+ goto TryFloat1;
+ if (*name=='l' || *name=='L' || *name=='f' || *name=='F')
+ {
+ OkIfSepRet(2);
+ return 0;
+ }
+ if (TVCodePage::isAlpha(*name) || *name=='.')
+ return 0;
+ else
+ {
+ dispo++;
+ return 2;
+ }
+ }
+ name++;
+ }
+
+ return 2;
+
+TryFloat1:
+ if (!dispo) return 0;
+ name++;
+ //dispo--;
+ if (!ucisdigit(*name) && !((*name=='+' || *name=='-') && dispo && ucisdigit(*(name+1)))) return 0;
+ name++;
+ dispo--;
+ while (dispo--)
+ {
+ if (!ucisdigit(*name))
+ {
+ if (*name=='l' || *name=='L' || *name=='f' || *name=='F')
+ {
+ OkIfSepRet(2);
+ return 0;
+ }
+ if (TVCodePage::isAlpha(*name)) return 0;
+ dispo++;
+ return 2;
+ }
+ name++;
+ }
+ return 2;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Checks if we have an integer or floating point number in the @var{name}
+string. Only @var{dispo} bytes are tested. The value of @var{dispo} is
+modified to indicate how many characters we parsed.
+
+ Return: 0 an invalid number, 1 an integer and 2 a float.
+
+***************************************************************************/
+
+static
+int is_pascal_integer_float(const char *name, uint32 &dispo)
+{
+ while (dispo--)
+ {
+ if (!ucisdigit(*name))
+ {
+ if (*name=='E' || *name=='e')
+ goto TryFloat1;
+ if (*name=='.')
+ goto TryFloat0;
+ if (!TVCodePage::isAlpha(*name))
+ {
+ dispo++;
+ return 1;
+ }
+ return 0;
+ }
+ name++;
+ }
+
+ if (!dispo || *name!='.')
+ return 1;
+
+TryFloat0:
+ name++;
+ //dispo--;
+ while (dispo--)
+ {
+ if (!ucisdigit(*name))
+ {
+ if (*name=='E' || *name=='e')
+ goto TryFloat1;
+ if (TVCodePage::isAlpha(*name))
+ return 0;
+ if (*name=='.')
+ {
+ dispo+=2;
+ return 1;
+ }
+ dispo++;
+ return 2;
+ }
+ name++;
+ }
+
+ return 2;
+
+TryFloat1:
+ if (!dispo) return 0;
+ name++;
+ //dispo--;
+ if (!ucisdigit(*name) && !((*name=='+' || *name=='-') && dispo && ucisdigit(*(name+1)))) return 0;
+ name++;
+ dispo--;
+ while (dispo--)
+ {
+ if (!ucisdigit(*name))
+ {
+ if (TVCodePage::isAlpha(*name)) return 0;
+ return 2;
+ }
+ name++;
+ }
+ return 2;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Checks if the @var{val} represents a digit for @var{base}.
+
+ Return: The equivalent digit or -1 if outside the base.
+
+***************************************************************************/
+
+int vhdl_val_digit(char val, int base)
+{
+ int digit;
+ if (val>='0' && val<='9')
+ digit=val-'0';
+ else
+ if (val>='A' && val<='Z')
+ digit=val-'A'+10;
+ else
+ if (val>='a' && val<='z')
+ digit=val-'a'+10;
+ else
+ return -1;
+ return digit<base ? digit : -1;
+}
+
+// Some helpful macros to make the code easier to read:
+// Handle the _d sequence
+#define CheckUnderscore(doAcum) \
+ if (*s=='_') \
+ {/* Can't end here */ \
+ if (!dispo) \
+ return 0; \
+ s++; \
+ /* Must be followed by a valid digit */\
+ digVal=vhdl_val_digit(*s,base); \
+ if (digVal<0) \
+ return 0; \
+ if (doAcum) \
+ { \
+ acum*=10; \
+ acum+=digVal; \
+ } \
+ dispo--; \
+ s++; \
+ continue; \
+ }
+
+// Verify that's a valid digit
+#define CheckDigit(retVal,ckAlpha) \
+ digVal=vhdl_val_digit(*s,base); \
+ if (digVal<0) \
+ { \
+ dispo++; \
+ if (ckAlpha && TVCodePage::isAlpha(*s)) \
+ return 0; \
+ return retVal; \
+ }
+
+/**[txh]********************************************************************
+
+ Description:
+ Checks if we have an integer or floating point number in the @var{s}
+string. That's VHDL specific. Only @var{dispo} bytes are tested. The value
+of @var{dispo} is modified to indicate how many characters we parsed.@p
+ It must be called only if @var{s} starts with 0-9.@p
+ The code supports abstract literals (decimal and based).
+
+ Return: 0 an invalid number, 1 an integer, 2 a float, 3 not a number.
+
+***************************************************************************/
+
+int isVHDLAbstractLiteral(const char *s, uint32 &dispo)
+{
+ int base, digVal, result;
+ unsigned acum;
+
+ // Abstract literals (13.4)
+ // We assume the first character is a digit (caller responsability)
+ base=10;
+ acum=vhdl_val_digit(*s,base);
+ s++;
+ dispo--;
+ result=1;
+ while (dispo--)
+ {
+ CheckUnderscore(1);
+ if (*s=='.') // dd.
+ goto ParseAfterFP;
+ if (*s=='#')
+ goto ParseBased; // dd#
+ if (*s=='E' || *s=='e')
+ goto ParseAfterExp; // ddE
+ CheckDigit(1,1);
+ acum*=10;
+ acum+=digVal;
+ s++;
+ }
+ return 1;
+
+ParseAfterFP:
+ // Decimal literal (13.4.1)
+ // Here we have dddd.
+ result=2;
+ s++;
+ if (!ucisdigit(*s))
+ return 0; // Incomplete
+ // Here we have dddd.d
+ s++;
+ dispo--;
+ while (dispo--)
+ {
+ CheckUnderscore(0);
+ if (*s=='E' || *s=='e') // dd.ddE
+ goto ParseAfterExp;
+ CheckDigit(2,1);
+ s++;
+ }
+ return 2;
+
+ParseAfterExp:
+ // Here we have dd.ddE
+ s++;
+ if (*s=='+' || (result==2 && *s=='-'))
+ {// Skip the sign
+ dispo--;
+ s++;
+ }
+ if (!ucisdigit(*s))
+ return 0; // Incomplete
+ while (dispo--)
+ {
+ CheckUnderscore(0);
+ CheckDigit(result,1);
+ s++;
+ }
+ return result;
+
+ParseBased:
+ // Based literals (13.4.2)
+ // Here we have dd#
+ base=acum;
+ result=1;
+ if (base<2 || base>16)
+ return 0; // base must be in [2;16] range
+ s++;
+ // Must be followed by a digit
+ if (!dispo)
+ return 0;
+ dispo--;
+ CheckDigit(0,0);
+ s++;
+ while (dispo--)
+ {
+ CheckUnderscore(0);
+ if (*s=='.') // dd#dd.
+ goto ParseAfterFPBL;
+ if (*s=='#')
+ goto ParseExpBL; // dd#dd#
+ CheckDigit(0,0);
+ s++;
+ }
+ // Only dd#dd is incomplete
+ return 0;
+
+ParseAfterFPBL:
+ // Here we have dd#dd.
+ result=2;
+ // A digit must be here
+ s++;
+ if (!dispo)
+ return 0;
+ dispo--;
+ CheckDigit(0,0);
+ s++;
+ // Here we have dd#dd.d
+ while (dispo--)
+ {
+ CheckUnderscore(0);
+ if (*s=='#')
+ goto ParseExpBL; // dd#dd.dd#
+ CheckDigit(0,0);
+ s++;
+ }
+ // Only dd#dd.dd is incomplete
+ return 0;
+
+ParseExpBL:
+ // Here we have dd#dd.dd#
+ // The exponent is decimal
+ base=10;
+ s++;
+ if (dispo && (*s=='e' || *s=='E'))
+ {
+ dispo--;
+ s++;
+ // Here we have dd#dd.dd#E
+ if (!dispo)
+ return 0; // incomplete
+ if (*s=='+' || (result==2 && *s=='-'))
+ {
+ dispo--;
+ s++;
+ }
+ // At least one digit
+ if (!dispo)
+ return 0;
+ dispo--;
+ CheckDigit(0,0);
+ s++;
+ }
+ while (dispo--)
+ {
+ CheckUnderscore(0);
+ CheckDigit(result,1);
+ s++;
+ }
+
+ return result;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Checks if we have a "bit string literal" (BSL) in the @var{s} string.
+That's VHDL specific. Only @var{dispo} bytes are tested. The value
+of @var{dispo} is modified to indicate how many characters we parsed.@p
+ It must be called only if @var{s} starts with B,O or X.@p
+
+ Return: 0 invalid BSL, 1 valid BSL, 3 not a BSL.
+
+***************************************************************************/
+
+int isVHDLBitStringLiteral(const char *s, uint32 &dispo)
+{
+ int base, digVal;
+ unsigned acum;
+ char sep;
+
+ if (dispo==1)
+ return 3; // Standalone char
+ switch (*s)
+ {
+ case 'B':
+ case 'b':
+ base=2;
+ break;
+ case 'O':
+ case 'o':
+ base=8;
+ break;
+ case 'X':
+ case 'x':
+ base=16;
+ break;
+ default:
+ return 3;
+ }
+ // Bit string literals (13.7)
+ // B,O,X
+ s++;
+ if (*s=='"' || *s=='%')
+ sep=*s;
+ else
+ return 3; // Not followed by a valid separator
+ dispo-=2;
+ s++;
+ // B"10_" or B%10_%, etc.
+ while (dispo--)
+ {
+ if (*s==sep)
+ return 1;
+ CheckUnderscore(0);
+ CheckDigit(0,0); // Check if it maps to a valid digit
+ s++;
+ }
+ // Incomplete, that's an error
+ return 0;
+}
+
+/*****************************************************************************
+
+ Function: int is_hex(const char *name,uint32 l)
+
+ Parameters:
+ name: string to analyze.
+ l: length.
+
+ Return:
+ 1 if is a valid hexadecimal number.
+
+ Notes:
+ Adapted for length.
+ Added u,U,l and L.
+ Added a check to avoid more than 16 digits, is that correct?
+
+ by SET based in the Robert's version.
+
+*****************************************************************************/
+
+#define OneOrZeroOfHex(a,b) \
+ if (l==0) return (lori<=19); \
+ name++; \
+ if (!isalnum((uchar)*name)) return (lori<=19); \
+ if (*name!=a && *name!=b) \
+ return 0; \
+ l--; lori--
+
+#define OkIfSepRetHex() \
+ if (l==0) return (lori<=19); \
+ name++; \
+ if (!isalnum((uchar)*name)) return (lori<=19)
+
+static int is_hex(const char *name, uint32 l)
+{
+ uint32 lori=l;
+ int notYetANumber=1;
+
+ // We can't use a char * as an uint16 * in some RISC machines like SPARC
+ //if (l<3 || (*(uint16 *)name!=0x7830 && *(uint16 *)name!=0x5830)) return 0;
+ if (l<3 || name[0]!='0' || (name[1]!='x' && name[1]!='X')) return 0;
+ name+=2;
+ l-=2;
+ while (l--)
+ {
+ if (!ucisxdigit(*name))
+ {
+ if (*name=='U' || *name=='u') // [uU][lL]{0,2} with brut force
+ {
+ OneOrZeroOfHex('l','L');
+ OneOrZeroOfHex('l','L');
+ OkIfSepRetHex();
+ return 0;
+ }
+ if (*name=='L' || *name=='l') // [lL]...
+ {
+ OkIfSepRetHex();
+ if (*name=='u' || *name=='U') // ...[uU][lL]?
+ {
+ l--; lori--;
+ OneOrZeroOfHex('l','L');
+ OkIfSepRetHex();
+ }
+ else
+ if (*name=='l' || *name=='L') // ...[lL][uU]?
+ {
+ l--; lori--;
+ OneOrZeroOfHex('u','U');
+ OkIfSepRetHex();
+ }
+ }
+ return 0;
+ }
+ if (notYetANumber)
+ {
+ if (*name=='0')
+ lori--;
+ else
+ notYetANumber=0;
+ }
+ name++;
+ }
+ return (lori<=10);
+}
+
+/*****************************************************************************
+
+ Function: int is_pascal_hex(const char *name,uint32 &dispo)
+
+ Parameters:
+ name: string to analyze.
+ dispo: disponible length.
+
+ Return:
+ 1 if is a valid hexadecimal number for pascal.
+
+ by SET.
+
+*****************************************************************************/
+
+static int is_pascal_hex(const char *name, uint32 &dispo)
+{
+ name++;
+ if (!ucisxdigit(*name))
+ return 0;
+ while (--dispo)
+ {
+ if (!ucisxdigit(*name))
+ {
+ if (*name=='.')
+ return 0;
+ return 1;
+ }
+ name++;
+ }
+ return 1;
+}
+
+static int is_octal(const char *name,uint32 l)
+{
+ // The first is a 0
+ //while (*(name++)=='0') l--;
+ //if (l==0) return 1;
+ while (l--)
+ {
+ if (*name<'0' || *name>'7') return 0;
+ name++;
+ }
+ return 1;
+}
+
+unsigned char TableTypesEditor[256]=
+{
+ 0, // \0
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // \t
+ 0, // \n
+ 0, //
+ 0, //
+ 0, // \r
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // x1A
+ 0, // x1B
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, // 
+ 0, //
+ ttedIsClipSymb | ttedIsCsymb2 | ttedIsPasSymb2, // !
+ 0, // "
+ ttedIsClipSymb | ttedIsPasSymb2, // #
+ ttedIsClipSymb, // $
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // %
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // &
+ 0, // '
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // (
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // )
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // *
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // +
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // ,
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // -
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // .
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // /
+ ttedIsWordChar, // 0
+ ttedIsWordChar, // 1
+ ttedIsWordChar, // 2
+ ttedIsWordChar, // 3
+ ttedIsWordChar, // 4
+ ttedIsWordChar, // 5
+ ttedIsWordChar, // 6
+ ttedIsWordChar, // 7
+ ttedIsWordChar, // 8
+ ttedIsWordChar, // 9
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // :
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // ;
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // <
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // =
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // >
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // ?
+ ttedIsClipSymb | ttedIsPasSymb2, // @
+ ttedIsWordChar, // A
+ ttedIsWordChar, // B
+ ttedIsWordChar, // C
+ ttedIsWordChar, // D
+ ttedIsWordChar, // E
+ ttedIsWordChar, // F
+ ttedIsWordChar, // G
+ ttedIsWordChar, // H
+ ttedIsWordChar, // I
+ ttedIsWordChar, // J
+ ttedIsWordChar, // K
+ ttedIsWordChar, // L
+ ttedIsWordChar, // M
+ ttedIsWordChar, // N
+ ttedIsWordChar, // O
+ ttedIsWordChar, // P
+ ttedIsWordChar, // Q
+ ttedIsWordChar, // R
+ ttedIsWordChar, // S
+ ttedIsWordChar, // T
+ ttedIsWordChar, // U
+ ttedIsWordChar, // V
+ ttedIsWordChar, // W
+ ttedIsWordChar, // X
+ ttedIsWordChar, // Y
+ ttedIsWordChar, // Z
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // [
+ 0, // \.
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // ]
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // ^
+ ttedIsWordChar, // _
+ 0, // `
+ ttedIsWordChar, // a
+ ttedIsWordChar, // b
+ ttedIsWordChar, // c
+ ttedIsWordChar, // d
+ ttedIsWordChar, // e
+ ttedIsWordChar, // f
+ ttedIsWordChar, // g
+ ttedIsWordChar, // h
+ ttedIsWordChar, // i
+ ttedIsWordChar, // j
+ ttedIsWordChar, // k
+ ttedIsWordChar, // l
+ ttedIsWordChar, // m
+ ttedIsWordChar, // n
+ ttedIsWordChar, // o
+ ttedIsWordChar, // p
+ ttedIsWordChar, // q
+ ttedIsWordChar, // r
+ ttedIsWordChar, // s
+ ttedIsWordChar, // t
+ ttedIsWordChar, // u
+ ttedIsWordChar, // v
+ ttedIsWordChar, // w
+ ttedIsWordChar, // x
+ ttedIsWordChar, // y
+ ttedIsWordChar, // z
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // {
+ ttedIsClipSymb | ttedIsPasSymb2 | ttedIsCsymb2, // |
+ ttedIsClipSymb | ttedIsPasSymb1 | ttedIsCsymb1, // }
+ ttedIsCsymb2, // ~
+ 0, // 
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ ttedIsWordChar, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ ttedIsWordChar, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0, //
+ 0 //
+};
+
+
+/*****************************************************************************
+
+ Function: int is_symbol(char *name, uint32 l)
+
+ Parameters:
+ name: string to analyze.
+ l: length.
+
+ Return:
+ 1 if is a group of symbols.
+
+ by SET based in a Molnar's idea.
+
+*****************************************************************************/
+
+static int is_symbol(char *name, uint32 l)
+{
+ int ret=0;
+
+ while (l--)
+ {
+ if ((ret=TableTypesEditor[(uchar)*(name++)] & ttedIsCsymb)==0)
+ return 0;
+ }
+ return ret & ttedIsCsymb1 ? 1 : 2;
+}
+
+/*****************************************************************************
+
+ Function: int is_pascal_symbol(char *name, uint32 l)
+
+ Parameters:
+ name: string to analyze.
+ l: length.
+
+ Return:
+ 1 if is a group of symbols.
+
+ Differences with C:
+ @ and # are symbols.
+
+ by SET.
+
+*****************************************************************************/
+
+static int is_pascal_symbol(char *name, uint32 l)
+{
+ int ret=0;
+
+ while (l--)
+ {
+ if ((ret=TableTypesEditor[(uchar)*(name++)] & ttedIsPasSymb)==0)
+ return 0;
+ }
+ return ret & ttedIsPasSymb1 ? 1 : 2;
+}
+
+/*****************************************************************************
+
+ Function: int is_clipper_symbol(char *name, uint32 l)
+
+ Parameters:
+ name: string to analyze.
+ l: length.
+
+ Return:
+ 1 if is a group of symbols.
+
+ Differences with C:
+ @,# and $ are symbols.
+
+ by SET.
+
+*****************************************************************************/
+
+static int is_clipper_symbol(char *name, uint32 l)
+{
+ int ret=0;
+
+ while (l--)
+ {
+ if ((ret=TableTypesEditor[(uchar)*(name++)] & ttedIsClipSymb)==0)
+ return 0;
+ }
+ return 1;
+}
+
+
+inline
+static int isWordChar(char c)
+{
+ return TVCodePage::isAlNum(c) || c == '_';
+}
+
+
+void SyntaxFormatLine( TCEditor * editor,
+ char *DrawBuf,
+ uint32 LinePtr,
+ int Width,
+ uint32 Attr,
+ unsigned lineLength,
+ int seeTabs
+ )
+{
+ unsigned bufptr;
+ unsigned offset;
+ unsigned tabSize=editor->tabSize;
+ char color;
+ int in_c_comment=Attr & StartInCom;
+ int in_string=Attr & StartString;
+ uint32 word_end;
+
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ EDITOR = editor;
+ BUFFER = editor->buffer;
+ DrawBuf++;
+ lineptr = LinePtr;
+ bufptr = 0;
+ offset = 0;
+
+ // Draw until we reach the EOL of we filled the visible line
+ while (offset<=lineLength && bufptr<(unsigned)Width)
+ {
+ char c2=0;
+ int c2_valid = 0;
+
+ // Take a word
+ word_end = offset-1;
+ do
+ {
+ word_end++;
+ }
+ while (word_end <= lineLength &&
+ isWordChar(BUFFER[lineptr+word_end]));
+
+ if (word_end > lineLength ||
+ (word_end > offset && !isWordChar(BUFFER[lineptr+word_end])))
+ word_end--;
+
+ { // Analize the word
+ char *name;
+ char c1;
+ uint32 LenOfName;
+
+ name=&BUFFER[lineptr+offset];
+ c1=*name;
+ LenOfName=word_end-offset+1;
+
+ if (word_end+1<=lineLength)
+ {
+ c2_valid = 1;
+ c2 = name[1];
+ }
+
+ if (TVCodePage::isAlpha(c1))
+ color = IdentColor;
+ else
+ color = NormalColor;
+
+ if (in_c_comment)
+ { // The line is commented by the last
+ color = CommentColor;
+ word_end=0;
+ char *s=name=&BUFFER[lineptr];
+ while (word_end<lineLength)
+ {
+ if (*s=='*')
+ {
+ if (word_end<lineLength)
+ {
+ s++;
+ word_end++;
+ if (*s=='/')
+ {
+ in_c_comment=0;
+ break;
+ }
+ } // more chars
+ } // '*'
+ s++;
+ word_end++;
+ } // Of while
+ } // Is c comment
+ else
+ if (in_string || c1 == '\"')
+ {
+ uint32 ll=lineLength-1;
+ char *s=name + (LenOfName - 1); // if in_string LenOfName > 1
+ if (!(in_string && c1 == '\"')) // the line may be start with \"
+ // which means the end of the string
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='\\')
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ }
+ }
+ else
+ if (*s=='\"')
+ break;
+ }
+ color = StringColor;
+ in_string = 0;
+ }
+ else
+ if (c1 == '\'')
+ {
+ uint32 ll=lineLength-1;
+ char *s=name;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='\\')
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ }
+ }
+ else
+ if (*s=='\'')
+ break;
+ }
+ color = CharColor;
+ }
+ else
+ if (c1 == '\\')
+ color = IlegalColor;
+ else
+ if (c1 == '#')
+ color = IlegalColor;
+ else
+ if (c1 == '/' && c2_valid && (c2 == '/' || c2 == '*'))
+ {
+ color = CommentColor;
+ word_end++;
+ if (c2=='/')
+ word_end=lineLength-1; // Paint the rest of the line
+ else
+ {
+ // Search the end
+ char *s=name;
+ s++;
+ uint32 ll=lineLength-1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='*')
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='/')
+ break;
+ } // more chars
+ } // '*'
+ } // Of while
+ } // Is c comment
+ }
+ else
+ if ((TVCodePage::isLower(c1) || c1=='_') && is_reserved(name,LenOfName))
+ color = ResColor;
+ else
+ if ((TVCodePage::isAlpha(c1) || c1=='_') && is_user_word(name,LenOfName,1))
+ color = UserColor;
+ else
+ if (ucisdigit(c1))
+ {
+ if (c1=='0' && c2_valid && (c2=='x' || c2=='X' || ucisdigit(c2)))
+ {
+ // Octal or Hexa or Invalid
+ if (is_hex(name,LenOfName))
+ color=HexColor;
+ else
+ if (is_octal(name,LenOfName))
+ color=OctalColor;
+ else
+ {
+ color=IlegalColor;
+ // Is a float camuflated?
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ if (is_integer_float(name,dispo)==2)
+ {
+ color = FloatColor;
+ word_end=lineLength-dispo-1;
+ }
+ }
+ }
+ else
+ {
+ // Integer, float or Invalid
+ // Calculate the available space in the line
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the namber is an integer or a float or an invalid
+ // sequence
+ switch (is_integer_float(name,dispo))
+ {
+ case 0: color = IlegalColor;
+ break;
+ case 1: color = IntColor;
+ break;
+ case 2: color = FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ word_end=lineLength-dispo-1;
+ }
+ }
+ else
+ if (c1=='.' && c2_valid && ucisdigit(c2))
+ {
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the namber is a float or an invalid sequence
+ switch (is_integer_float(name,dispo))
+ {
+ case 0: color = IlegalColor;
+ break;
+ case 2: color = FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ word_end=lineLength-dispo-1;
+ }
+ else
+ switch (is_symbol(name,LenOfName))
+ {
+ case 1: color = SymbolColor;
+ break;
+ case 2: color = Symbol2Color;
+ break;
+ }
+
+ while (offset<=word_end && bufptr<(unsigned)Width)
+ {
+ if (*(name++)=='\t')
+ {
+ int tabcount=tabSize-(bufptr % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=tabColor;
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=color;
+ }
+ }
+ else
+ {
+ DrawBuf[bufptr*2]=color;
+ bufptr++;
+ }
+ offset++;
+ }
+ }
+ }
+}
+
+
+
+void SyntaxFormatLinePascal( TCEditor * editor,
+ char *DrawBuf,
+ uint32 LinePtr,
+ int Width,
+ int check_comment_1,
+ int check_comment_2,
+ unsigned lineLength,
+ int seeTabs
+ )
+{
+ unsigned bufptr;
+ unsigned tabSize=editor->tabSize;
+ unsigned offset;
+ char color;
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ EDITOR = editor;
+ BUFFER = editor->buffer;
+ DrawBuf++;
+ lineptr = LinePtr;
+ bufptr = 0;
+ offset = 0;
+
+ {
+ int in_comment1=check_comment_1;
+ int in_comment2=check_comment_2;
+ uint32 word_end;
+ while (offset<=lineLength && bufptr<(unsigned)Width)
+ {
+ char c2=0;
+ int c2_valid = 0;
+ word_end = offset-1;
+ do
+ {
+ word_end++;
+ }
+ while (word_end <= lineLength &&
+ isWordChar(BUFFER[lineptr+word_end]));
+
+ if (word_end > lineLength ||
+ (word_end > offset && !isWordChar(BUFFER[lineptr+word_end])))
+ word_end--;
+
+ {
+ char *name;
+ char c1;
+ uint32 LenOfName;
+
+ name=&BUFFER[lineptr+offset];
+ c1=*name;
+ LenOfName=word_end-offset+1;
+
+ if (word_end+1<=lineLength)
+ {
+ c2_valid = 1;
+ c2 = BUFFER[lineptr+offset+1];
+ }
+
+ if (TVCodePage::isAlpha(c1))
+ color = IdentColor;
+ else
+ color = NormalColor;
+
+ if (in_comment1)
+ { // The line is commented by the last
+ color = CommentColor;
+ word_end=0;
+ char *s=name=&BUFFER[lineptr];
+ while (word_end<lineLength)
+ {
+ s++;
+ word_end++;
+ if (*s=='*')
+ {
+ if (word_end<lineLength)
+ {
+ s++;
+ word_end++;
+ if (*s==')')
+ {
+ in_comment1=0;
+ break;
+ }
+ } // more chars
+ } // '*'
+ } // Of while
+ } // Is comment 1
+ else
+ if (in_comment2)
+ { // The line is commented by the last
+ color = CommentColor;
+ word_end=0;
+ char *s=name=&BUFFER[lineptr];
+ while (word_end<lineLength)
+ {
+ s++;
+ word_end++;
+ if (*s=='}')
+ {
+ in_comment2=0;
+ break;
+ } // '}'
+ } // Of while
+ } // Is comment 2
+ else
+ if (c1 == '\'')
+ {
+ uint32 ll=lineLength-1;
+ char *s=name;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='\'')
+ break;
+ }
+ color = StringColor;
+ }
+ else
+ if (c1 == '\\')
+ color = IlegalColor;
+ else
+ if (c1 == '(' && c2_valid && c2 == '*')
+ {
+ color = CommentColor;
+ word_end++;
+ // Search the end
+ char *s=name;
+ s++;
+ uint32 ll=lineLength-1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='*')
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s==')')
+ break;
+ } // more chars
+ } // '*'
+ } // Of while
+ }
+ else
+ if (c1 == '{')
+ {
+ color = CommentColor;
+ word_end++;
+ // Search the end
+ char *s=name;
+ s++;
+ uint32 ll=lineLength-1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='}')
+ break;
+ } // Of while
+ }
+ else
+ if (is_pascal_rword(name,LenOfName))
+ color = ResColor;
+ else
+ if (is_user_word(name,LenOfName,1))
+ color = UserColor;
+ else
+ if (c1=='$')
+ {
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ if (dispo && is_pascal_hex(name,dispo))
+ color=HexColor;
+ else
+ {
+ color=IlegalColor;
+ dispo--;
+ }
+ word_end=lineLength-dispo-1;
+ }
+ else
+ if (ucisdigit(c1))
+ {
+ // Integer, float or Invalid
+ // Calculate the available space in the line
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the namber is an integer or a float or an invalid
+ // sequence
+ switch (is_pascal_integer_float(name,dispo))
+ {
+ case 0: color = IlegalColor;
+ break;
+ case 1: color = IntColor;
+ break;
+ case 2: color = FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ word_end=lineLength-dispo-1;
+ }
+ else
+ if (c1=='.' && c2_valid && ucisdigit(c2))
+ {
+ color = IlegalColor;
+ word_end++;
+ }
+ else
+ if (c1=='.' && c2_valid && c2=='.')
+ {
+ color = Symbol2Color;
+ word_end++;
+ }
+ else
+ switch (is_pascal_symbol(name,LenOfName))
+ {
+ case 1: color = SymbolColor;
+ break;
+ case 2: color = Symbol2Color;
+ break;
+ }
+
+ while (offset<=word_end && bufptr<(unsigned)Width)
+ {
+ if (*(name++)=='\t')
+ {
+ int tabcount=tabSize-(bufptr % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=tabColor;
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=color;
+ }
+ }
+ else
+ {
+ DrawBuf[bufptr*2]=color;
+ bufptr++;
+ }
+ offset++;
+ }
+ }
+ }
+ }
+}
+
+
+void SyntaxFormatLineClipper( TCEditor * editor,
+ char *DrawBuf,
+ uint32 LinePtr,
+ int Width,
+ int check_c_comment,
+ unsigned lineLength,
+ int seeTabs
+ )
+{
+ unsigned bufptr;
+ unsigned offset;
+ unsigned tabSize=editor->tabSize;
+ char color;
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ EDITOR = editor;
+ BUFFER = editor->buffer;
+ DrawBuf++;
+ lineptr = LinePtr;
+ bufptr = 0;
+ offset = 0;
+
+ {
+ int in_c_comment=check_c_comment;
+ uint32 word_end;
+ while (offset<=lineLength && bufptr<(unsigned)Width)
+ {
+ char c2=0,c3=0;
+ int c2_valid=0, c3_valid=0;
+ word_end = offset-1;
+ do
+ {
+ word_end++;
+ }
+ while (word_end <= lineLength &&
+ isWordChar(BUFFER[lineptr+word_end]));
+
+ if (word_end > lineLength ||
+ (word_end > offset && !isWordChar(BUFFER[lineptr+word_end])))
+ word_end--;
+
+ {
+ char *name;
+ char c1;
+ uint32 LenOfName;
+
+ name=&BUFFER[lineptr+offset];
+ c1=*name;
+ LenOfName=word_end-offset+1;
+
+ if (word_end+1<=lineLength)
+ {
+ c2_valid = 1;
+ c2 = BUFFER[lineptr+offset+1];
+ }
+
+ if (word_end+2<=lineLength)
+ {
+ c3_valid = 1;
+ c3 = BUFFER[lineptr+offset+2];
+ }
+
+ if (TVCodePage::isAlpha(c1))
+ color = IdentColor;
+ else
+ color = NormalColor;
+
+ if (in_c_comment)
+ { // The line is commented by the last
+ color = CommentColor;
+ word_end=0;
+ char *s=name=&BUFFER[lineptr];
+ while (word_end<lineLength)
+ {
+ if (*s=='*')
+ {
+ if (word_end<lineLength)
+ {
+ s++;
+ word_end++;
+ if (*s=='/')
+ {
+ in_c_comment=0;
+ // Check for extra chars after the end of a comment,
+ // Clipper 5 doesn't support this
+ while (word_end<lineLength-1)
+ {
+ s++;
+ if (!ucisspace(*s) && *s!=26) // Let the EOF
+ {
+ word_end=lineLength-1;
+ color=IlegalColor;
+ break;
+ }
+ word_end++;
+ }
+ break;
+ }
+ } // more chars
+ } // '*'
+ s++;
+ word_end++;
+ } // Of while
+ } // Is c comment
+ else
+ // Strings as "xxxx"
+ if (c1 == '\"')
+ {
+ uint32 ll=lineLength-1;
+ char *s=name;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='\"')
+ break;
+ }
+ color = StringColor;
+ }
+ else
+ // Strings as 'xxxx' are supported too
+ if (c1 == '\'')
+ {
+ uint32 ll=lineLength-1;
+ char *s=name;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='\'')
+ break;
+ }
+ color = StringColor;
+ }
+ else
+ if (c1 == '\\')
+ color = IlegalColor;
+ else
+ // The C++ comments and C comments are supported
+ if (c1 == '/' && c2_valid && (c2 == '/' || c2 == '*'))
+ {
+ color = CommentColor;
+ word_end++;
+ if (c2=='/')
+ word_end=lineLength-1; // Paint the rest of the line
+ else
+ {
+ // Search the end
+ char *s=name;
+ s++;
+ uint32 ll=lineLength-1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='*')
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='/')
+ break;
+ } // more chars
+ } // '*'
+ } // Of while
+ } // Is c comment
+ }
+ else
+ // The && is like // in C++, is arkaic but ...
+ if (c1=='&' && c2_valid && c2=='&')
+ {
+ color = CommentColor;
+ word_end=lineLength-1; // Paint the rest of the line
+ }
+ else
+ // The '* -' is like // in C++, is arkaic but ...
+ if (c1=='*' && c2_valid && c2==' ' && c3_valid && c3=='-')
+ {
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ if (dispo>3)
+ {
+ // Clipper 5 doesn't support this if there is no comment
+ color = CommentColor;
+ word_end=lineLength-1; // Paint the rest of the line
+ }
+ else
+ {
+ word_end+=2;
+ color=IlegalColor;
+ }
+ }
+ else
+ if (is_clipper_rword(name,LenOfName))
+ color = ResColor;
+ else
+ if (is_user_word(name,LenOfName,0))
+ color = UserColor;
+ else
+ if (ucisdigit(c1))
+ {
+ // Integer, float or Invalid
+ // Calculate the available space in the line
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the namber is an integer or a float or an invalid
+ // sequence
+ switch (is_integer_float(name,dispo))
+ {
+ case 0: color = IlegalColor;
+ break;
+ case 1: color = IntColor;
+ break;
+ case 2: color = FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ word_end=lineLength-dispo-1;
+ }
+ else
+ // Clipper supports .NNNN floats
+ if (c1=='.' && c2_valid && ucisdigit(c2))
+ {
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the number is a float or an invalid sequence
+ switch (is_integer_float(name,dispo))
+ {
+ case 0: color = IlegalColor;
+ break;
+ case 2: color = FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ word_end=lineLength-dispo-1;
+ }
+ else
+ // .t. .f. .and. .or. are special
+ if (c1=='.' && c2_valid && TVCodePage::isAlpha(c2))
+ {
+ uint32 ll=lineLength-1;
+ int ok=0;
+ char *s=name+1;
+ char *s1=s;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s=='.')
+ {
+ word_end++;
+ ll=(uint32)(s-s1);
+ switch (ll)
+ {
+ case 1:
+ ok = *s1=='t' || *s1=='T' || *s1=='f' ||
+ *s1=='F' || *s1=='y' || *s1=='Y' ||
+ *s1=='n' || *s1=='N';
+ break;
+ case 2:
+ ok = (*s1=='o' || *s1=='O') &&
+ (*(s1+1)=='r' || *(s1+1)=='R');
+ break;
+ case 3:
+ ok = ((*s1=='a' || *s1=='A') &&
+ (*(s1+1)=='n' || *(s1+1)=='N') &&
+ (*(s1+2)=='d' || *(s1+2)=='D')) ||
+ ((*s1=='n' || *s1=='N') &&
+ (*(s1+1)=='o' || *(s1+1)=='O') &&
+ (*(s1+2)=='t' || *(s1+2)=='T'));
+ break;
+ }
+ if (ok)
+ color = ResColor;
+ else
+ color = IlegalColor;
+ break;
+ }
+ if (!TVCodePage::isAlpha(*s))
+ {
+ color = IlegalColor;
+ break;
+ }
+ }
+ }
+ else
+ if (is_clipper_symbol(name,LenOfName))
+ color = SymbolColor;
+
+ while (offset<=word_end && bufptr<(unsigned)Width)
+ {
+ if (*(name++)=='\t')
+ {
+ int tabcount=tabSize-(bufptr % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=tabColor;
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=color;
+ }
+ }
+ else
+ {
+ DrawBuf[bufptr*2]=color;
+ bufptr++;
+ }
+ offset++;
+ }
+ }
+ }
+ }
+}
+
+char CheckSeqCase;
+
+int CheckForSequence(char *s, int len, int available, char *d)
+{
+ int pos;
+
+ if (available<len || len==0)
+ return 0;
+ if (CheckSeqCase)
+ for (pos=0; pos<len && s[pos]==d[pos]; pos++);
+ else
+ for (pos=0; pos<len && s[pos]==TVCodePage::toUpper(d[pos]); pos++);
+ return pos==len;
+}
+
+
+int CheckForSequenceNotFirst(char *s, int len, int available, char *d)
+{
+ int pos;
+
+ if (available<len || len==0)
+ return 0;
+ if (CheckSeqCase)
+ for (pos=1; pos<len && s[pos]==d[pos]; pos++);
+ else
+ for (pos=1; pos<len && s[pos]==TVCodePage::toUpper(d[pos]); pos++);
+ return pos==len;
+}
+
+
+void SyntaxFormatLineGeneric(TCEditor * editor,
+ char *DrawBuf,
+ uint32 LinePtr,
+ int Width,
+ uint32 Attr,
+ unsigned lineLength,
+ int seeTabs
+ )
+{
+ unsigned bufptr;
+ unsigned offset;
+ unsigned tabSize=editor->tabSize;
+ char color;
+ int in_c_comment1=Attr & StartInCom;
+ int in_c_comment2=Attr & StartInCom2;
+ int in_string =Attr & StartString;
+ int in_string2=Attr & StartString2;
+ int in_string3=Attr & StartString3;
+ uint32 word_end;
+ char Escape;
+ int TestNumbers,isInFirstCol=1,PartialKeywords,RelaxNumbers;
+ int isInFirstUsed=1,checkEOLC1=1,checkEOLC2=1;
+ int EscapeAnywhere, VHDLNumbers, VHDLStr1, VHDLStr2, VHDLShortStr;
+
+ // Set the Case Sensitive comparation status to check sequence
+ CheckSeqCase =(TCEditor::strC.Flags1 & FG1_CaseSensitive)!=0;
+ TestNumbers =(TCEditor::strC.Flags1 & FG1_NoNumbers)==0;
+ PartialKeywords =(TCEditor::strC.Flags1 & FG1_PartialKeyword)!=0;
+ RelaxNumbers =(TCEditor::strC.Flags1 & FG1_RelaxNumbers)!=0;
+ EscapeAnywhere =(TCEditor::strC.Flags2 & FG2_EscapeAnywhere)!=0;
+ VHDLNumbers =(TCEditor::strC.Flags2 & FG2_VHDLNumbers)!=0;
+ VHDLStr1 =(TCEditor::strC.Flags2 & FG2_VHDLStr1)!=0;
+ VHDLStr2 =(TCEditor::strC.Flags2 & FG2_VHDLStr2)!=0;
+ VHDLShortStr =(TCEditor::strC.Flags2 & FG2_VHDLShortStr)!=0;
+ EDITOR = editor;
+ // Colored tabs stuff
+ tabFF=0;
+ tabColor=OddTabColor;
+
+ DrawBuf++;
+ lineptr = LinePtr;
+ BUFFER = &(editor->buffer[lineptr]);
+ bufptr = 0;
+ offset = 0;
+
+ // Draw until we reach the EOL of we filled the visible line
+ while (offset<=lineLength && bufptr<(unsigned)Width)
+ {
+ char c2=0;
+ int c2_valid = 0;
+
+ // Eat spaces
+ color = NormalColor;
+ while (offset<=lineLength && bufptr<(unsigned)Width && ucisspace(BUFFER[offset]))
+ {
+ if (BUFFER[offset]=='\t')
+ {
+ int tabcount=tabSize-(bufptr % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=tabColor;
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=color;
+ }
+ }
+ else
+ {
+ DrawBuf[bufptr*2]=color;
+ bufptr++;
+ }
+ offset++;
+ }
+ if (offset>=lineLength || bufptr==(unsigned)Width)
+ return;
+
+ if (isInFirstCol && bufptr!=0)
+ {
+ isInFirstCol=0;
+ if (TCEditor::strC.Flags1 & FG1_EOLCInFirstCol1)
+ checkEOLC1=0;
+ if (TCEditor::strC.Flags1 & FG1_EOLCInFirstCol2)
+ checkEOLC2=0;
+ }
+ // Take a word
+ word_end = offset;
+ if (!in_c_comment1 && !in_c_comment2)
+ {
+ if (word_end<=lineLength && isWordCharBe(BUFFER[word_end]))
+ {
+ do
+ {
+ word_end++;
+ }
+ while (word_end<=lineLength && isWordCharIn(BUFFER[word_end]));
+ }
+
+ if (word_end > lineLength ||
+ (word_end > offset && !isWordCharIn(BUFFER[word_end])))
+ word_end--;
+ }
+
+ { // Analize the word
+ char *name;
+ char c1;
+ uint32 LenOfName,BytesLeft;
+
+ name=&BUFFER[offset];
+ c1=*name;
+ LenOfName=word_end-offset+1;
+ BytesLeft=lineLength-offset;
+
+ if (word_end+1<=lineLength)
+ {
+ c2_valid = 1;
+ c2 = name[1];
+ }
+
+ if (TVCodePage::isAlpha(c1))
+ color = IdentColor;
+ else
+ color = NormalColor;
+
+ if (in_c_comment1)
+ { // The line is commented by the last
+ color=CommentColor;
+ char *s=name=BUFFER+word_end;
+ while (word_end<lineLength)
+ {
+ if (CheckForSequence(TCEditor::strC.CloseCom1,TCEditor::strC.lCloseCom1,BytesLeft,&BUFFER[word_end]))
+ {
+ word_end+=TCEditor::strC.lCloseCom1-1;
+ in_c_comment1=0;
+ break;
+ }
+ s++;
+ word_end++;
+ BytesLeft--;
+ } // Of while
+ } // Is c comment
+ else
+ if (in_c_comment2)
+ { // The line is commented by the last
+ color=CommentColor;
+ char *s=name=BUFFER+word_end;
+ while (word_end<lineLength)
+ {
+ if (CheckForSequence(TCEditor::strC.CloseCom2,TCEditor::strC.lCloseCom2,BytesLeft,&BUFFER[word_end]))
+ {
+ word_end+=TCEditor::strC.lCloseCom2-1;
+ in_c_comment2=0;
+ break;
+ }
+ s++;
+ word_end++;
+ BytesLeft--;
+ } // Of while
+ } // Is c comment
+ else
+ if (EscapeAnywhere && c2_valid && c1==TCEditor::strC.Escape)
+ {
+ color = SymbolColor;
+ word_end=offset+1;
+ }
+ else
+ if (in_string || isString(c1))
+ {
+ uint32 ll=lineLength-1;
+ char *s=name+(LenOfName-1); // if in_string LenOfName>1
+ Escape=TCEditor::strC.Escape;
+ if (!(in_string && isString(c1))) // the line may start with \"
+ // which means the end of the string
+ {
+ in_string=1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s==Escape)
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ }
+ }
+ else
+ if (isString(*s))
+ {
+ if (VHDLStr1 && word_end<ll && isString(s[1]))
+ {// String literals 13.6
+ s++;
+ word_end++;
+ }
+ else
+ {
+ in_string=0;
+ break;
+ }
+ }
+ }
+ }
+ if (in_string && VHDLStr1)
+ color=IlegalColor;
+ else
+ color=StringColor;
+ in_string=0;
+ }
+ else // Repeated for string2
+ if (in_string2 || isString2(c1))
+ {
+ uint32 ll=lineLength-1;
+ char *s=name+(LenOfName-1); // if in_string LenOfName>1
+ Escape=TCEditor::strC.Escape;
+ if (!(in_string2 && isString2(c1))) // the line may start with \"
+ // which means the end of the string
+ {
+ in_string=1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s==Escape)
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ }
+ }
+ else
+ if (isString2(*s))
+ {
+ if (VHDLStr2 && word_end<ll && isString2(s[1]))
+ {
+ s++;
+ word_end++;
+ }
+ else
+ {
+ in_string=0;
+ break;
+ }
+ }
+ }
+ }
+ if (in_string && VHDLStr2)
+ color=IlegalColor;
+ else
+ color=CharColor;
+ in_string=0;
+ }
+ else // Repeated for string3
+ if (in_string3 || isString3(c1))
+ {
+ uint32 ll=lineLength-1;
+ char *s=name + (LenOfName - 1); // if in_string LenOfName > 1
+ Escape=TCEditor::strC.Escape;
+ if (!(in_string3 && isString3(c1))) // the line may be start with \"
+ // which means the end of the string
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s==Escape)
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ }
+ }
+ else
+ if (isString3(*s))
+ break;
+ }
+ color = StringColor;
+ in_string3 = 0;
+ }
+ else
+ if (isCharacter(c1))
+ {
+ uint32 ll=lineLength-1;
+ char *s=name;
+ if (VHDLShortStr)
+ {// Character literals 13.5
+ if (ll>=2 && isCharacter(s[2]))
+ {
+ s+=2;
+ word_end+=2;
+ }
+ }
+ else
+ {
+ Escape=TCEditor::strC.Escape;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ if (*s==Escape)
+ {
+ if (word_end<ll)
+ {
+ s++;
+ word_end++;
+ }
+ }
+ else
+ if (isCharacter(*s))
+ break;
+ }
+ }
+ color=CharColor;
+ }
+ else
+ if (c1==TCEditor::strC.Preprocessor || c1==TCEditor::strC.Preprocessor2)
+ color = IlegalColor;
+ else
+ if (CheckForSequence(TCEditor::strC.OpenCom1,TCEditor::strC.lOpenCom1,BytesLeft,name))
+ {
+ color = CommentColor;
+ word_end++;
+ // Search the end
+ char *s=name;
+ s++;
+ uint32 ll=lineLength-1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ BytesLeft--;
+ if (CheckForSequence(TCEditor::strC.CloseCom1,TCEditor::strC.lCloseCom1,BytesLeft,s))
+ {
+ word_end++;
+ break;
+ }
+ } // Of while
+ }
+ else
+ if (CheckForSequence(TCEditor::strC.OpenCom2,TCEditor::strC.lOpenCom2,BytesLeft,name))
+ {
+ color = CommentColor;
+ word_end++;
+ // Search the end
+ char *s=name;
+ s++;
+ uint32 ll=lineLength-1;
+ while (word_end<ll)
+ {
+ s++;
+ word_end++;
+ BytesLeft--;
+ if (CheckForSequence(TCEditor::strC.CloseCom2,TCEditor::strC.lCloseCom2,BytesLeft,s))
+ {
+ word_end++;
+ break;
+ }
+ } // Of while
+ }
+ else
+ if ((checkEOLC1 &&
+ CheckForSequence(TCEditor::strC.EOLCom1,TCEditor::strC.lEOLCom1,BytesLeft,name))
+ ||
+ (checkEOLC2 &&
+ CheckForSequence(TCEditor::strC.EOLCom2,TCEditor::strC.lEOLCom2,BytesLeft,name)))
+ {
+ color = CommentColor;
+ word_end=lineLength-1; // Paint the rest of the line
+ }
+ else
+ if (CheckForSequence(TCEditor::strC.HexStart,TCEditor::strC.lHexStart,BytesLeft,name))
+ {
+ int extra=TCEditor::strC.lHexStart;
+ uint32 dispo=lineLength-word_end+LenOfName-extra;
+ name+=extra-1;
+ if (dispo && is_pascal_hex(name,dispo))
+ color=HexColor;
+ else
+ {
+ color=IlegalColor;
+ dispo--;
+ }
+ name-=extra-1;
+ word_end=lineLength-dispo-1;
+ }
+ else
+ if (TestNumbers && ucisdigit(c1))
+ {
+ // Integer, float or Invalid
+ // Calculate the available space in the line
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the number is an integer or a float or an invalid
+ // sequence
+ int res=VHDLNumbers ? isVHDLAbstractLiteral(name,dispo) :
+ is_pascal_integer_float(name,dispo);
+ switch (res)
+ {
+ case 0:
+ color=RelaxNumbers ? NormalColor : IlegalColor;
+ break;
+ case 1:
+ color=IntColor;
+ break;
+ case 2:
+ color=FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ if (res!=3)
+ word_end=lineLength-dispo-1;
+ }
+ else
+ if (TestNumbers && !VHDLNumbers && c1=='.' && c2_valid && ucisdigit(c2))
+ {
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ // Check if the namber is a float or an invalid sequence
+ switch (is_integer_float(name,dispo))
+ {
+ case 0: color = RelaxNumbers ? NormalColor : IlegalColor;
+ break;
+ case 2: color = FloatColor;
+ break;
+ }
+ // Adjust the length according to the routine use
+ word_end=lineLength-dispo-1;
+ }
+ else
+ if (!PartialKeywords && isGeneralReservedWord(name,LenOfName,CheckSeqCase,TCEditor::strC.Search))
+ color = ResColor;
+ else // Check if a user word does a full match before checking for a partial
+ // match with a reserved (@ref v.s. @refMenu).
+ if (is_user_word(name,LenOfName,CheckSeqCase))
+ color = UserColor;
+ else
+ if (PartialKeywords && isPartialKeyword(name,LenOfName,CheckSeqCase,TCEditor::strC.Keywords,word_end))
+ color = ResColor;
+ else
+ if (isSpecialSymb(*name) && c2_valid && isSpecialSCon(c2))
+ {
+ color = SymbolColor;
+ word_end=offset+1;
+ }
+ else
+ if (isSymbol1(*name))
+ {
+ color = SymbolColor;
+ word_end=offset;
+ }
+ else
+ if (isSymbol2(*name))
+ {
+ color = Symbol2Color;
+ word_end=offset;
+ }
+ else
+ if (c1==TCEditor::strC.Escape)
+ color=IlegalColor;
+ else
+ if (TestNumbers && VHDLNumbers && (c1=='B' || c1=='O' || c1=='X' ||
+ c1=='b' || c1=='o' || c1=='x'))
+ {// VHDL Bit String Literals, at the end because they are a mess ...
+ // Note that we highlight them as integers.
+ uint32 dispo=lineLength-word_end+LenOfName-1;
+ int res=isVHDLBitStringLiteral(name,dispo);
+ switch (res)
+ {
+ case 0:
+ color=RelaxNumbers ? NormalColor : IlegalColor;
+ break;
+ case 1:
+ color=IntColor;
+ break;
+ }
+ if (res!=3)
+ word_end=lineLength-dispo-1;
+ }
+
+
+ while (offset<=word_end && bufptr<(unsigned)Width)
+ {
+ if (*(name++)=='\t')
+ {
+ int tabcount=tabSize-(bufptr % tabSize);
+ if (seeTabs)
+ { // It paints the tabs to be visible
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=tabColor;
+ ToggleTabColor();
+ }
+ else
+ {
+ while (tabcount--)
+ DrawBuf[(bufptr++)*2]=color;
+ }
+ }
+ else
+ {
+ DrawBuf[bufptr*2]=color;
+ bufptr++;
+ }
+ offset++;
+ }
+ }
+ if (isInFirstUsed)
+ {
+ isInFirstUsed=0;
+ if (TCEditor::strC.Flags1 & FG1_EOLCInFirstUse1)
+ checkEOLC1=0;
+ if (TCEditor::strC.Flags2 & FG2_EOLCInFirstUse2)
+ checkEOLC2=0;
+ }
+ }
+}
diff --git a/setedit/mainsrc/editwind.cc b/setedit/mainsrc/editwind.cc
new file mode 100644
index 0000000..3bc744a
--- /dev/null
+++ b/setedit/mainsrc/editwind.cc
@@ -0,0 +1,345 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+
+#define Uses_TFrame
+#define Uses_TWindow
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStringCollection
+#define Uses_TPalette
+#define Uses_TScreen
+
+#define Uses_TCEditWindow
+#define Uses_TCEditor_Commands
+#include <ceditor.h>
+
+// Palette management added by Robert to allow the customization of the
+// palette.
+#define cpBlueEditWindow "\x08\x09\x0A\x0B\x0C\x40\x41\x42\x43\x44\x45\x46"\
+ "\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x76"\
+ "\x77\x78\x79\x7A\x7B\x7C"
+#define cpCyanEditWindow "\x10\x11\x12\x13\x14\x52\x53\x54\x55\x56\x57\x58"\
+ "\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x76"\
+ "\x77\x78\x79\x7A\x7B\x7C"
+#define cpGrayEditWindow "\x18\x19\x1A\x1B\x1C\x64\x65\x66\x67\x68\x69\x6A"\
+ "\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76"\
+ "\x77\x78\x79\x7A\x7B\x7C"
+
+const int TCEditWindow::ResumeVersion=6;
+const char *TCEditWindow::clipboardTitle=__("Clipboard");
+const char *TCEditWindow::untitled=__("Untitled");
+stTVIntl *TCEditWindow::iClipboardTitle=NULL;
+stTVIntl *TCEditWindow::iUntitled=NULL;
+
+TPalette & TCEditWindow::getPalette() const
+{
+ static TPalette blue(cpBlueEditWindow,sizeof(cpBlueEditWindow)-1);
+ static TPalette cyan(cpCyanEditWindow,sizeof(cpCyanEditWindow)-1);
+ static TPalette gray(cpGrayEditWindow,sizeof(cpGrayEditWindow)-1);
+ static TPalette * palettes[] =
+ {
+ &blue,
+ &cyan,
+ &gray
+ };
+ return *(palettes[palette]);
+}
+
+const TPoint minEditWinSize = {24, 6};
+
+TCEditWindow::TCEditWindow( const TRect& bounds,
+ const char *fileName,
+ int aNumber,
+ Boolean openRO ) :
+ TWindowInit( &TCEditWindow::initFrame ),
+ TWindow( bounds, 0, aNumber )
+{
+ options |= ofTileable;
+
+ TScrollBar *hScrollBar =
+ new TScrollBar( TRect( 18, size.y - 1, size.x - 2, size.y ) );
+ hScrollBar->hide();
+ insert(hScrollBar);
+
+ TScrollBar *vScrollBar =
+ new TScrollBar( TRect( size.x - 1, 1, size.x, size.y - 1 ) );
+ vScrollBar->hide();
+ insert(vScrollBar);
+
+ TSIndicator *indicator =
+ new TSIndicator( TRect( 2, size.y - 1, 16, size.y ) );
+ indicator->hide();
+ insert(indicator);
+
+
+ TRect r( getExtent() );
+ r.grow(-1, -1);
+ editor=new TCEditor(r,hScrollBar,vScrollBar,indicator,fileName,openRO);
+ insert(editor);
+}
+
+
+void TCEditWindow::close()
+{
+ if (editor->isClipboard())
+ hide();
+ else
+ TWindow::close();
+}
+
+const char *TCEditWindow::getTitle( short )
+{
+ if( editor->isClipboard() )
+ return TVIntl::getText(clipboardTitle,iClipboardTitle);
+ else if( *(editor->fileName) == EOS )
+ return TVIntl::getText(untitled,iUntitled);
+ else
+ return editor->fileName;
+}
+
+void TCEditWindow::handleEvent( TEvent& event )
+{
+ TWindow::handleEvent(event);
+ if( event.what == evBroadcast && event.message.command == cmcUpdateTitle )
+ {
+ if( frame != 0 )
+ frame->drawView();
+ clearEvent(event);
+ }
+}
+
+void TCEditWindow::sizeLimits( TPoint& min, TPoint& max )
+{
+ TWindow::sizeLimits(min, max);
+ min = minEditWinSize;
+}
+
+void TCEditWindow::write( opstream& os )
+{
+ TWindow::write( os );
+ os << editor;
+}
+
+void *TCEditWindow::read( ipstream& is )
+{
+ TWindow::read( is );
+ is >> editor;
+
+ /* It can be done only here because I must remove the old version from the
+ Group and that's inserted after the read */
+ if (editor->OldIndicator)
+ {
+ remove(editor->OldIndicator);
+ editor->indicator->hide();
+ editor->indicator->editor=editor;
+ insert(editor->indicator);
+ }
+ return this;
+}
+
+TCEditWindow::TCEditWindow( StreamableInit ) :
+ TWindowInit( NULL ),
+ TWindow( streamableInit )
+{
+}
+
+void TCEditWindow::EnlargeSizesResume(EditorResume &r)
+{
+ int wS=TScreen::getCols(), hS=TScreen::getRows();
+ EnlargeSizeResume(r.origin_x,r.origin_y,wS,hS);
+ EnlargeSizeResume(r.size_x,r.size_y,wS,hS);
+ EnlargeSizeResume(r.zorigin_x,r.zorigin_y,wS,hS);
+ EnlargeSizeResume(r.zsize_x,r.zsize_y,wS,hS);
+}
+
+void TCEditWindow::ReduceSizesResume(EditorResume &r)
+{
+ int wS=TScreen::getCols(), hS=TScreen::getRows();
+ ReduceSizeResume(r.origin_x,r.origin_y,wS,hS);
+ ReduceSizeResume(r.size_x,r.size_y,wS,hS);
+ ReduceSizeResume(r.zorigin_x,r.zorigin_y,wS,hS);
+ ReduceSizeResume(r.zsize_x,r.zsize_y,wS,hS);
+}
+
+void TCEditWindow::EnlargeSizeResume(short &x, short &y, int wS, int hS)
+{
+ int max=2*wS-1;
+ if (x>max) x=max;
+ x=(x*0x4000+wS/2)/wS;
+ max=2*hS-1;
+ if (y>max) y=max;
+ y=(y*0x4000+hS/2)/hS;
+}
+
+void TCEditWindow::ReduceSizeResume(short &x, short &y, int wS, int hS)
+{
+ x=(x*wS+0x2000)/0x4000;
+ y=(y*hS+0x2000)/0x4000;
+}
+
+void TCEditWindow::FillResume(EditorResume &r)
+{
+ r.version=ResumeVersion;
+ r.shl=editor->SyntaxHL;
+ r.subshl=editor->GenericSHL;
+
+ r.origin_x=origin.x; r.origin_y=origin.y;
+ r.size_x=size.x; r.size_y=size.y;
+ r.cursor_x=editor->curPos.x; r.cursor_y=editor->curPos.y;
+ r.zorigin_x=zoomRect.a.x; r.zorigin_y=zoomRect.a.y;
+ r.zsize_x=zoomRect.b.x; r.zsize_y=zoomRect.b.y;
+ r.ed_flags=editor->CompactFlags();
+ r.tabSize=editor->tabSize;
+ r.indentSize=editor->indentSize;
+ r.wrapCol=editor->WrapCol;
+
+ EnlargeSizesResume(r);
+
+ r.extraSize=sizeof(EditorResume)-(sizeof(EditorResumeV5)+sizeof(uint32));
+ time(&r.dateResume);
+}
+
+void TCEditWindow::ApplyResume(EditorResume &r)
+{
+ ReduceSizesResume(r);
+ moveTo(r.origin_x,r.origin_y);
+ growTo(r.size_x,r.size_y);
+ zoomRect.a.x=r.zorigin_x;
+ zoomRect.a.y=r.zorigin_y;
+ zoomRect.b.x=r.zsize_x;
+ zoomRect.b.y=r.zsize_y;
+ editor->tabSize=r.tabSize;
+ editor->indentSize=r.indentSize;
+ editor->WrapCol=r.wrapCol;
+ editor->MoveCursorTo(r.cursor_x,r.cursor_y);
+ editor->trackCursor(True);
+ editor->update(ufView); // needed if trackCursor didn't do it
+ if (r.shl!=255)
+ {
+ editor->ExpandFlags(r.ed_flags,False);
+ editor->SetHighlightTo((shlState)r.shl,r.subshl);
+ }
+}
+
+static inline
+unsigned MoveFlags(unsigned flags, unsigned mask, unsigned pos)
+{
+ return (flags & mask) | ((flags & (~mask))<<pos);
+}
+
+void TCEditWindow::ReadResume(EditorResume &r, ipstream& is)
+{
+ uchar version;
+
+ is >> version;
+ if (version>ResumeVersion) version=2;
+ r.version=version;
+ if (version<3)
+ { // v1 and v2
+ EditorResumeV2 r2;
+ is.readBytes(((char *)&r2)+1,sizeof(EditorResumeV2)-1);
+ if (r.version==1)
+ { // In v0.4.31 I moved some flags so now resumes changed version
+ r.ed_flags=MoveFlags(r.ed_flags,0xFF,1);
+ r.version=2;
+ }
+ // Translate it into the v3 structure.
+ r.version=3;
+ r.shl=r2.shl;
+ r.subshl=r2.subshl;
+ r.origin_x=r2.origin_x;
+ r.origin_y=r2.origin_y;
+ r.size_x=r2.size_x;
+ r.size_y=r2.size_y;
+ r.cursor_x=r2.cursor_x;
+ r.cursor_y=r2.cursor_y;
+ r.zorigin_x=r2.zorigin_x;
+ r.zorigin_y=r2.zorigin_y;
+ r.zsize_x=r2.zsize_x;
+ r.zsize_y=r2.zsize_y;
+ r.ed_flags=r2.ed_flags;
+ r.prj_flags=r2.prj_flags;
+ // exits as v3
+ }
+ else
+ {
+ if (version==3)
+ // v3
+ is.readBytes(((char *)&r)+1,sizeof(EditorResumeV3)-1);
+ else
+ {// v4 & v5
+ is.readBytes(((char *)&r)+1,sizeof(EditorResumeV5)-1);
+ if (version>=6)
+ {
+ is >> r.extraSize;
+ if (r.extraSize==0) r.extraSize=4; // Workaround
+ is.readBytes(&r.dateResume,r.extraSize);
+ }
+ }
+ }
+ if (r.version==3)
+ {
+ r.version=4;
+ r.tabSize=TCEditor::staticTabSize;
+ r.indentSize=TCEditor::staticIndentSize;
+ r.wrapCol=TCEditor::staticWrapCol;
+ }
+ if (r.version==4)
+ {
+ r.version=5;
+ EnlargeSizesResume(r);
+ }
+ if (r.version==5)
+ {
+ r.version=6;
+ r.extraSize=sizeof(EditorResume)-(sizeof(EditorResumeV5)+sizeof(uint32));
+ time(&r.dateResume);
+ }
+}
+
+void TCEditWindow::SaveResume(EditorResume &r, opstream& os)
+{
+ // If the file wasn't closed the resume is empty, even the version!
+ r.version=ResumeVersion;
+ // It must be filled properly.
+ // PrjItem *TPrjItemColl::createNewElement(char *name, int flags) doesn't
+ // fill it for new (and hence empty) items.
+ r.extraSize=sizeof(EditorResume)-(sizeof(EditorResumeV5)+sizeof(uint32));
+ os.writeBytes(&r,sizeof(EditorResume));
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used when reading desktop versions older than 0.3.6.
+
+***************************************************************************/
+
+void TCEditWindow::FillResumeWith(EditorResume &r, TPoint &origin,
+ TPoint &size, TPoint &cursor)
+{
+ r.version=ResumeVersion;
+ r.shl=255; // Unknown, is applied to the flags too
+ r.zorigin_x=r.origin_x=origin.x;
+ r.zorigin_y=r.origin_y=origin.y;
+ r.zsize_x=r.size_x=size.x;
+ r.zsize_y=r.size_y=size.y;
+ r.cursor_x=cursor.x; r.cursor_y=cursor.y;
+ r.tabSize=TCEditor::staticTabSize;
+ r.indentSize=TCEditor::staticIndentSize;
+ r.wrapCol=TCEditor::staticWrapCol;
+ r.ed_flags=0;
+ EnlargeSizesResume(r);
+ r.extraSize=sizeof(EditorResume)-(sizeof(EditorResumeV5)+sizeof(uint32));
+ time(&r.dateResume);
+}
+
+TCEditWindow::~TCEditWindow()
+{
+ TVIntl::freeSt(iClipboardTitle);
+ TVIntl::freeSt(iUntitled);
+}
diff --git a/setedit/mainsrc/edspecs.cc b/setedit/mainsrc/edspecs.cc
new file mode 100644
index 0000000..fd39ff9
--- /dev/null
+++ b/setedit/mainsrc/edspecs.cc
@@ -0,0 +1,275 @@
+/* Copyright (C) 2001-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* This file is an adaptation of idespecs.cc from Robert Hoehne to make the editor */
+/* more coherent with RHIDE and more easy to configure (?) */
+
+#define Uses_string
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_limits
+#include <pathtool.h>
+#include <tv.h>
+
+#include <ced_inte.h>
+#include <edspecs.h>
+
+#ifndef TVComp_BCPP
+// BC++ defines it in stdlib.h
+extern char **environ;
+#endif
+
+static char *default_variables[]=
+{
+ "SET_CONFQUIT","0",
+ "SET_CREATE_DST","1",
+ 0,0
+};
+
+static char **vars;
+static int var_count = 0;
+
+static
+void add_variable(const char *variable, const char *contents)
+{
+ var_count++;
+ vars = (char **)realloc(vars,var_count*2*sizeof(char *));
+ vars[var_count*2-2]=strdup(variable);
+ vars[var_count*2-1]=contents ? strdup(contents) : NULL;
+}
+
+void InsertEnvironmentVar(const char *variable, const char *contents)
+{
+ int i;
+ for (i=0;i<var_count;i++)
+ {
+ if (strcmp(vars[i*2],variable)==0)
+ {
+ free(vars[2*i+1]);
+ vars[2*i+1]=contents ? strdup(contents) : NULL;
+ return;
+ }
+ }
+ add_variable(variable,contents);
+}
+
+const char *GetVariable(const char *variable, const char *def)
+{
+ int i;
+ for (i=0;i<var_count;i++)
+ {
+ if (strcmp(variable,vars[i*2])==0 && vars[i*2+1])
+ return vars[i*2+1];
+ }
+ const char *env=getenv(variable);
+ return env ? env : def;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the settings for the .dst files: create only one, create it
+hidden, etc. Called by edprj.cc
+
+ Return:
+ The flags as defined in edspecs.h.
+
+***************************************************************************/
+
+unsigned GetDSTOptions()
+{
+ return EnvirGetIntVar("SET_CREATE_DST",dstCreate);
+}
+
+unsigned EnvirGetIntVar(const char *name, unsigned aDefault)
+{
+ const char *s=GetVariable(name);
+ if (!s) return aDefault;
+ char *end;
+ return (unsigned)strtol(s,&end,0);
+}
+
+unsigned EnvirGetBits(const char *name, unsigned Value, unsigned aDefault)
+{
+ return EnvirGetIntVar(name,aDefault) & Value;
+}
+
+void EnvirSetIntVar(const char *name, unsigned Value)
+{
+ char buf[32];
+ sprintf(buf,"0x%X",Value);
+ InsertEnvironmentVar(name,buf);
+}
+
+unsigned EnvirSetBits(const char *name, unsigned Value)
+{
+ unsigned v=EnvirGetIntVar(name);
+ v|=Value;
+ EnvirSetIntVar(name,v);
+ return v;
+}
+
+unsigned EnvirResetBits(const char *name, unsigned Value)
+{
+ unsigned v=EnvirGetIntVar(name);
+ v&= ~Value;
+ EnvirSetIntVar(name,v);
+ return v;
+}
+
+static char Signature[]="SET's editor enviroment\x1A";
+
+static
+void fGetStr(char *s, FILE *f)
+{
+ ushort len;
+ fread(&len,sizeof(ushort),1,f);
+ if (!feof(f))
+ {
+ fread(s,len,1,f);
+ s[len]=0;
+ }
+ else
+ *s=0;
+}
+
+static
+void ReadEnviromentFile(void)
+{// ExpandHome so it also tries all locations (~/.setenvir.dat)
+ char *s=ExpandHome("setenvir.dat");
+
+ if (s)
+ {
+ char Name[PATH_MAX];
+ char Val[PATH_MAX];
+ FILE *f=fopen(s,"rb");
+ if (f)
+ {
+ fread(Name,sizeof(Signature),1,f);
+ if (strcmp(Name,Signature)==0)
+ {
+ do
+ {
+ fGetStr(Name,f);
+ fGetStr(Val,f);
+ if (!feof(f))
+ InsertEnvironmentVar(Name,Val);
+ }
+ while (!feof(f));
+ }
+ fclose(f);
+ }
+ }
+}
+
+static
+void fPutVar(char *var,FILE *f)
+{
+ char *c=(char *)GetVariable(var);
+ if (c && c[0])
+ {
+ ushort len=strlen(var);
+ fwrite(&len,sizeof(ushort),1,f);
+ fwrite(var,len,1,f);
+ len=strlen(c);
+ fwrite(&len,sizeof(ushort),1,f);
+ fwrite(c,len,1,f);
+ }
+}
+
+void SaveEnviromentFile(void)
+{
+ char *s=ExpandHomeSave("setenvir.dat");
+ if (s)
+ {
+ FILE *f=fopen(s,"wb");
+ if (f)
+ {
+ fwrite(Signature,sizeof(Signature),1,f);
+ fPutVar("SET_CONFQUIT",f);
+ fPutVar("SET_VERUSED",f);
+ fPutVar("SET_CREATE_DST",f);
+ fPutVar("SET_TIP_INFO",f);
+ fPutVar("SET_README_SHOWN",f);
+ fPutVar("SET_TIPS1",f);
+ fPutVar("SET_VARIOUS1",f);
+ fPutVar("SET_FORCED_LANG",f);
+ fPutVar("SET_GDB_TIME_OUT",f);
+ fPutVar("SET_GDB_MSG_LINES",f);
+ fPutVar("SET_GDB_MISC",f);
+ fPutVar("SET_GDB_EXE",f);
+ fPutVar("SET_XTERM_EXE",f);
+ fclose(f);
+ }
+ }
+}
+
+//static __attribute__ ((__constructor__))
+void InitEnvirVariables(void)
+{
+ char *variable,*contents;
+ int i=0;
+ // The lower priority is the one of the hardcoded
+ while (default_variables[i])
+ {
+ variable = default_variables[i];
+ contents = default_variables[i+1];
+ add_variable(variable,contents);
+ i += 2;
+ }
+ // Now read the binary enviroment file
+ ReadEnviromentFile();
+ // Now check the env for any SET_ variable (higher priority)
+ for (i=0;environ[i];i++)
+ {
+ if (strncmp(environ[i],"SET_",4)==0)
+ {
+ contents = strchr(environ[i],'=');
+ if (!contents) continue;
+ contents++;
+ char var[256];
+ memcpy(var,environ[i],(int)(contents-environ[i])-1);
+ var[(int)(contents-environ[i])-1] = 0;
+ InsertEnvironmentVar(var,contents);
+ }
+ }
+ // Now fix old version flags to new version
+ // First try to figure out what version wrote the file
+ unsigned version=EnvirGetIntVar("SET_VERUSED");
+ // First time?
+ //if (!version) return;
+ // Is this version or newer?
+ if (version>=TCEDITOR_VERSION) return;
+ // An old version, mark the new one
+ EnvirSetIntVar("SET_VERUSED",TCEDITOR_VERSION);
+ // Force to see the start about
+ EnvirResetBits("SET_VARIOUS1",svr1DontShowAbout);
+ // In 0.4.47 I introduced a better control for what is saved/restored
+ // to/from the dst file/s.
+ if (version<0x447)
+ {
+ unsigned opsDst=GetDSTOptions();
+ // Have dstOpenSpec enabled?
+ if (opsDst & 4)
+ {// Remove the old flag that now have another meaning
+ opsDst&= ~4;
+ // Set the equivalent options
+ opsDst|=dstEdOnlyIfNoCL | dstOwOnlyIfNoCL | dstCfEver;
+ EnvirSetIntVar("SET_CREATE_DST",opsDst);
+ }
+ }
+}
+
+// Is ever good to have a way to destroy all the allocated memory and helps to
+// find leaks.
+void DeInitEnvirVariables(void)
+{
+ int i;
+ for (i=0;i<var_count;i++)
+ {
+ free(vars[i*2]);
+ free(vars[i*2+1]);
+ }
+ free(vars);
+ vars=0;
+ var_count=0;
+}
diff --git a/setedit/mainsrc/fstrcmp.c b/setedit/mainsrc/fstrcmp.c
new file mode 100644
index 0000000..03a8ce9
--- /dev/null
+++ b/setedit/mainsrc/fstrcmp.c
@@ -0,0 +1,664 @@
+/* Copyright (C) 1996,1997 Robert Hhne, see COPYING.RH for details */
+/* This file is part of RHIDE. */
+/* Functions to make fuzzy comparisons between strings
+ Copyright (C) 1988, 1989, 1992, 1993, 1995 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+ Derived from GNU diff 2.7, analyze.c et al.
+
+ The basic algorithm is described in:
+ "An O(ND) Difference Algorithm and its Variations", Eugene Myers,
+ Algorithmica Vol. 1 No. 2, 1986, pp. 251-266;
+ see especially section 4.2, which describes the variation used below.
+
+ The basic algorithm was independently discovered as described in:
+ "Algorithms for Approximate String Matching", E. Ukkonen,
+ Information and Control Vol. 64, 1985, pp. 100-118.
+
+ Modified to work on strings rather than files
+ by Peter Miller <pmiller@agso.gov.au>, October 1995 */
+
+/* Modified to be used standalone by Robert Hoehne, April 1997 */
+
+#if 0
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#else
+#define INT_MAX ((int)(~(unsigned)0 >> 1))
+#endif
+
+#include "fstrcmp.h"
+#include "system.h"
+
+#else
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#define xrealloc realloc
+double fstrcmp(const char *,const char *);
+
+#ifndef __P
+#define __P(x) x
+#endif
+
+#endif
+/*
+ * Data on one input string being compared.
+ */
+struct string_data
+{
+ /* The string to be compared. */
+ const char *data;
+
+ /* The length of the string to be compared. */
+ int data_length;
+
+ /* The number of characters inserted or deleted. */
+ int edit_count;
+};
+
+static struct string_data string[2];
+
+
+#ifdef MINUS_H_FLAG
+
+/* This corresponds to the diff -H flag. With this heuristic, for
+ strings with a constant small density of changes, the algorithm is
+ linear in the strings size. This is unlikely in typical uses of
+ fstrcmp, and so is usually compiled out. Besides, there is no
+ interface to set it true. */
+static int heuristic;
+
+#endif
+
+
+/* Vector, indexed by diagonal, containing 1 + the X coordinate of the
+ point furthest along the given diagonal in the forward search of the
+ edit matrix. */
+static int *fdiag;
+
+/* Vector, indexed by diagonal, containing the X coordinate of the point
+ furthest along the given diagonal in the backward search of the edit
+ matrix. */
+static int *bdiag;
+
+/* Edit scripts longer than this are too expensive to compute. */
+static int too_expensive;
+
+/* Snakes bigger than this are considered `big'. */
+#define SNAKE_LIMIT 20
+
+struct partition
+{
+ /* Midpoints of this partition. */
+ int xmid, ymid;
+
+ /* Nonzero if low half will be analyzed minimally. */
+ int lo_minimal;
+
+ /* Likewise for high half. */
+ int hi_minimal;
+};
+
+/* SET: I moved it here to be able to release it in some way, they where inside
+ fstrcmp. Also: I added initialization to 0 just to left it clear */
+static int *fdiag_buf=0;
+static size_t fdiag_max=0;
+
+void fstrcmp_free_memory(void)
+{
+ free(fdiag_buf);
+ fdiag_buf=0;
+ fdiag_max=0;
+}
+
+/* NAME
+ diag - find diagonal path
+
+ SYNOPSIS
+ int diag(int xoff, int xlim, int yoff, int ylim, int minimal,
+ struct partition *part);
+
+ DESCRIPTION
+ Find the midpoint of the shortest edit script for a specified
+ portion of the two strings.
+
+ Scan from the beginnings of the strings, and simultaneously from
+ the ends, doing a breadth-first search through the space of
+ edit-sequence. When the two searches meet, we have found the
+ midpoint of the shortest edit sequence.
+
+ If MINIMAL is nonzero, find the minimal edit script regardless
+ of expense. Otherwise, if the search is too expensive, use
+ heuristics to stop the search and report a suboptimal answer.
+
+ RETURNS
+ Set PART->(XMID,YMID) to the midpoint (XMID,YMID). The diagonal
+ number XMID - YMID equals the number of inserted characters
+ minus the number of deleted characters (counting only characters
+ before the midpoint). Return the approximate edit cost; this is
+ the total number of characters inserted or deleted (counting
+ only characters before the midpoint), unless a heuristic is used
+ to terminate the search prematurely.
+
+ Set PART->LEFT_MINIMAL to nonzero iff the minimal edit script
+ for the left half of the partition is known; similarly for
+ PART->RIGHT_MINIMAL.
+
+ CAVEAT
+ This function assumes that the first characters of the specified
+ portions of the two strings do not match, and likewise that the
+ last characters do not match. The caller must trim matching
+ characters from the beginning and end of the portions it is
+ going to specify.
+
+ If we return the "wrong" partitions, the worst this can do is
+ cause suboptimal diff output. It cannot cause incorrect diff
+ output. */
+
+static int diag __P((int, int, int, int, int, struct partition *));
+
+static int
+diag (xoff, xlim, yoff, ylim, minimal, part)
+ int xoff;
+ int xlim;
+ int yoff;
+ int ylim;
+ int minimal;
+ struct partition *part;
+{
+ int *const fd = fdiag; /* Give the compiler a chance. */
+ int *const bd = bdiag; /* Additional help for the compiler. */
+ const char *const xv = string[0].data; /* Still more help for the compiler. */
+ const char *const yv = string[1].data; /* And more and more . . . */
+ const int dmin = xoff - ylim; /* Minimum valid diagonal. */
+ const int dmax = xlim - yoff; /* Maximum valid diagonal. */
+ const int fmid = xoff - yoff; /* Center diagonal of top-down search. */
+ const int bmid = xlim - ylim; /* Center diagonal of bottom-up search. */
+ int fmin = fmid;
+ int fmax = fmid; /* Limits of top-down search. */
+ int bmin = bmid;
+ int bmax = bmid; /* Limits of bottom-up search. */
+ int c; /* Cost. */
+ int odd = (fmid - bmid) & 1;
+
+ /*
+ * True if southeast corner is on an odd diagonal with respect
+ * to the northwest.
+ */
+ fd[fmid] = xoff;
+ bd[bmid] = xlim;
+ for (c = 1;; ++c)
+ {
+ int d; /* Active diagonal. */
+ int big_snake;
+
+ big_snake = 0;
+ /* Extend the top-down search by an edit step in each diagonal. */
+ if (fmin > dmin)
+ fd[--fmin - 1] = -1;
+ else
+ ++fmin;
+ if (fmax < dmax)
+ fd[++fmax + 1] = -1;
+ else
+ --fmax;
+ for (d = fmax; d >= fmin; d -= 2)
+ {
+ int x;
+ int y;
+ int oldx;
+ int tlo;
+ int thi;
+
+ tlo = fd[d - 1],
+ thi = fd[d + 1];
+
+ if (tlo >= thi)
+ x = tlo + 1;
+ else
+ x = thi;
+ oldx = x;
+ y = x - d;
+ while (x < xlim && y < ylim && xv[x] == yv[y])
+ {
+ ++x;
+ ++y;
+ }
+ if (x - oldx > SNAKE_LIMIT)
+ big_snake = 1;
+ fd[d] = x;
+ if (odd && bmin <= d && d <= bmax && bd[d] <= x)
+ {
+ part->xmid = x;
+ part->ymid = y;
+ part->lo_minimal = part->hi_minimal = 1;
+ return 2 * c - 1;
+ }
+ }
+ /* Similarly extend the bottom-up search. */
+ if (bmin > dmin)
+ bd[--bmin - 1] = INT_MAX;
+ else
+ ++bmin;
+ if (bmax < dmax)
+ bd[++bmax + 1] = INT_MAX;
+ else
+ --bmax;
+ for (d = bmax; d >= bmin; d -= 2)
+ {
+ int x;
+ int y;
+ int oldx;
+ int tlo;
+ int thi;
+
+ tlo = bd[d - 1],
+ thi = bd[d + 1];
+ if (tlo < thi)
+ x = tlo;
+ else
+ x = thi - 1;
+ oldx = x;
+ y = x - d;
+ while (x > xoff && y > yoff && xv[x - 1] == yv[y - 1])
+ {
+ --x;
+ --y;
+ }
+ if (oldx - x > SNAKE_LIMIT)
+ big_snake = 1;
+ bd[d] = x;
+ if (!odd && fmin <= d && d <= fmax && x <= fd[d])
+ {
+ part->xmid = x;
+ part->ymid = y;
+ part->lo_minimal = part->hi_minimal = 1;
+ return 2 * c;
+ }
+ }
+
+ if (minimal)
+ continue;
+
+#ifdef MINUS_H_FLAG
+ /* Heuristic: check occasionally for a diagonal that has made lots
+ of progress compared with the edit distance. If we have any
+ such, find the one that has made the most progress and return
+ it as if it had succeeded.
+
+ With this heuristic, for strings with a constant small density
+ of changes, the algorithm is linear in the strings size. */
+ if (c > 200 && big_snake && heuristic)
+ {
+ int best;
+
+ best = 0;
+ for (d = fmax; d >= fmin; d -= 2)
+ {
+ int dd;
+ int x;
+ int y;
+ int v;
+
+ dd = d - fmid;
+ x = fd[d];
+ y = x - d;
+ v = (x - xoff) * 2 - dd;
+
+ if (v > 12 * (c + (dd < 0 ? -dd : dd)))
+ {
+ if
+ (
+ v > best
+ &&
+ xoff + SNAKE_LIMIT <= x
+ &&
+ x < xlim
+ &&
+ yoff + SNAKE_LIMIT <= y
+ &&
+ y < ylim
+ )
+ {
+ /* We have a good enough best diagonal; now insist
+ that it end with a significant snake. */
+ int k;
+
+ for (k = 1; xv[x - k] == yv[y - k]; k++)
+ {
+ if (k == SNAKE_LIMIT)
+ {
+ best = v;
+ part->xmid = x;
+ part->ymid = y;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (best > 0)
+ {
+ part->lo_minimal = 1;
+ part->hi_minimal = 0;
+ return 2 * c - 1;
+ }
+ best = 0;
+ for (d = bmax; d >= bmin; d -= 2)
+ {
+ int dd;
+ int x;
+ int y;
+ int v;
+
+ dd = d - bmid;
+ x = bd[d];
+ y = x - d;
+ v = (xlim - x) * 2 + dd;
+
+ if (v > 12 * (c + (dd < 0 ? -dd : dd)))
+ {
+ if (v > best && xoff < x && x <= xlim - SNAKE_LIMIT &&
+ yoff < y && y <= ylim - SNAKE_LIMIT)
+ {
+ /* We have a good enough best diagonal; now insist
+ that it end with a significant snake. */
+ int k;
+
+ for (k = 0; xv[x + k] == yv[y + k]; k++)
+ {
+ if (k == SNAKE_LIMIT - 1)
+ {
+ best = v;
+ part->xmid = x;
+ part->ymid = y;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (best > 0)
+ {
+ part->lo_minimal = 0;
+ part->hi_minimal = 1;
+ return 2 * c - 1;
+ }
+ }
+#endif /* MINUS_H_FLAG */
+
+ /* Heuristic: if we've gone well beyond the call of duty, give up
+ and report halfway between our best results so far. */
+ if (c >= too_expensive)
+ {
+ int fxybest;
+ int fxbest;
+ int bxybest;
+ int bxbest;
+
+ /* Pacify `gcc -Wall'. */
+ fxbest = 0;
+ bxbest = 0;
+
+ /* Find forward diagonal that maximizes X + Y. */
+ fxybest = -1;
+ for (d = fmax; d >= fmin; d -= 2)
+ {
+ int x;
+ int y;
+
+ x = fd[d] < xlim ? fd[d] : xlim;
+ y = x - d;
+
+ if (ylim < y)
+ {
+ x = ylim + d;
+ y = ylim;
+ }
+ if (fxybest < x + y)
+ {
+ fxybest = x + y;
+ fxbest = x;
+ }
+ }
+ /* Find backward diagonal that minimizes X + Y. */
+ bxybest = INT_MAX;
+ for (d = bmax; d >= bmin; d -= 2)
+ {
+ int x;
+ int y;
+
+ x = xoff > bd[d] ? xoff : bd[d];
+ y = x - d;
+
+ if (y < yoff)
+ {
+ x = yoff + d;
+ y = yoff;
+ }
+ if (x + y < bxybest)
+ {
+ bxybest = x + y;
+ bxbest = x;
+ }
+ }
+ /* Use the better of the two diagonals. */
+ if ((xlim + ylim) - bxybest < fxybest - (xoff + yoff))
+ {
+ part->xmid = fxbest;
+ part->ymid = fxybest - fxbest;
+ part->lo_minimal = 1;
+ part->hi_minimal = 0;
+ }
+ else
+ {
+ part->xmid = bxbest;
+ part->ymid = bxybest - bxbest;
+ part->lo_minimal = 0;
+ part->hi_minimal = 1;
+ }
+ return 2 * c - 1;
+ }
+ }
+}
+
+
+/* NAME
+ compareseq - find edit sequence
+
+ SYNOPSIS
+ void compareseq(int xoff, int xlim, int yoff, int ylim, int minimal);
+
+ DESCRIPTION
+ Compare in detail contiguous subsequences of the two strings
+ which are known, as a whole, to match each other.
+
+ The subsequence of string 0 is [XOFF, XLIM) and likewise for
+ string 1.
+
+ Note that XLIM, YLIM are exclusive bounds. All character
+ numbers are origin-0.
+
+ If MINIMAL is nonzero, find a minimal difference no matter how
+ expensive it is. */
+
+static void compareseq __P((int, int, int, int, int));
+
+static void
+compareseq (xoff, xlim, yoff, ylim, minimal)
+ int xoff;
+ int xlim;
+ int yoff;
+ int ylim;
+ int minimal;
+{
+ const char *const xv = string[0].data; /* Help the compiler. */
+ const char *const yv = string[1].data;
+
+ /* Slide down the bottom initial diagonal. */
+ while (xoff < xlim && yoff < ylim && xv[xoff] == yv[yoff])
+ {
+ ++xoff;
+ ++yoff;
+ }
+
+ /* Slide up the top initial diagonal. */
+ while (xlim > xoff && ylim > yoff && xv[xlim - 1] == yv[ylim - 1])
+ {
+ --xlim;
+ --ylim;
+ }
+
+ /* Handle simple cases. */
+ if (xoff == xlim)
+ {
+ while (yoff < ylim)
+ {
+ ++string[1].edit_count;
+ ++yoff;
+ }
+ }
+ else if (yoff == ylim)
+ {
+ while (xoff < xlim)
+ {
+ ++string[0].edit_count;
+ ++xoff;
+ }
+ }
+ else
+ {
+ int c;
+ struct partition part;
+
+ /* Find a point of correspondence in the middle of the strings. */
+ c = diag (xoff, xlim, yoff, ylim, minimal, &part);
+ if (c == 1)
+ {
+#if 0
+ /* This should be impossible, because it implies that one of
+ the two subsequences is empty, and that case was handled
+ above without calling `diag'. Let's verify that this is
+ true. */
+ abort ();
+#else
+ /* The two subsequences differ by a single insert or delete;
+ record it and we are done. */
+ if (part.xmid - part.ymid < xoff - yoff)
+ ++string[1].edit_count;
+ else
+ ++string[0].edit_count;
+#endif
+ }
+ else
+ {
+ /* Use the partitions to split this problem into subproblems. */
+ compareseq (xoff, part.xmid, yoff, part.ymid, part.lo_minimal);
+ compareseq (part.xmid, xlim, part.ymid, ylim, part.hi_minimal);
+ }
+ }
+}
+
+
+/* NAME
+ fstrcmp - fuzzy string compare
+
+ SYNOPSIS
+ double fstrcmp(const char *, const char *);
+
+ DESCRIPTION
+ The fstrcmp function may be used to compare two string for
+ similarity. It is very useful in reducing "cascade" or
+ "secondary" errors in compilers or other situations where
+ symbol tables occur.
+
+ RETURNS
+ double; 0 if the strings are entirly dissimilar, 1 if the
+ strings are identical, and a number in between if they are
+ similar. */
+
+double
+fstrcmp (string1, string2)
+ const char *string1;
+ const char *string2;
+{
+ int i;
+
+ size_t fdiag_len;
+
+ /* set the info for each string. */
+ string[0].data = string1;
+ string[0].data_length = strlen (string1);
+ string[1].data = string2;
+ string[1].data_length = strlen (string2);
+
+ /* short-circuit obvious comparisons */
+ if (string[0].data_length == 0 && string[1].data_length == 0)
+ return 1.0;
+ if (string[0].data_length == 0 || string[1].data_length == 0)
+ return 0.0;
+
+ /* Set TOO_EXPENSIVE to be approximate square root of input size,
+ bounded below by 256. */
+ too_expensive = 1;
+ for (i = string[0].data_length + string[1].data_length; i != 0; i >>= 2)
+ too_expensive <<= 1;
+ if (too_expensive < 256)
+ too_expensive = 256;
+
+ /* Because fstrcmp is typically called multiple times, while scanning
+ symbol tables, etc, attempt to minimize the number of memory
+ allocations performed. Thus, we use a static buffer for the
+ diagonal vectors, and never free them. */
+ fdiag_len = string[0].data_length + string[1].data_length + 3;
+ if (fdiag_len > fdiag_max)
+ {
+ fdiag_max = fdiag_len;
+ fdiag_buf = xrealloc (fdiag_buf, fdiag_max * (2 * sizeof (int)));
+ }
+ fdiag = fdiag_buf + string[1].data_length + 1;
+ bdiag = fdiag + fdiag_len;
+
+ /* Now do the main comparison algorithm */
+ string[0].edit_count = 0;
+ string[1].edit_count = 0;
+ compareseq (0, string[0].data_length, 0, string[1].data_length, 0);
+
+ /* The result is
+ ((number of chars in common) / (average length of the strings)).
+ This is admittedly biased towards finding that the strings are
+ similar, however it does produce meaningful results. */
+ return ((double) (string[0].data_length + string[1].data_length -
+ string[1].edit_count - string[0].edit_count) / (string[0].data_length
+ + string[1].data_length));
+}
diff --git a/setedit/mainsrc/gzfiles.cc b/setedit/mainsrc/gzfiles.cc
new file mode 100644
index 0000000..2105c81
--- /dev/null
+++ b/setedit/mainsrc/gzfiles.cc
@@ -0,0 +1,752 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_fcntl
+#define Uses_sys_stat
+#define Uses_string
+#define Uses_ctype
+#define Uses_snprintf
+#define Uses_AllocLocal
+#define Uses_MsgBox
+
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSInputLine
+#define Uses_TSLabel
+
+#define Uses_TCEditor_External
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+//#include <tv.h>
+// Second request the headers
+#include <easydiag.h>
+#include <editcoma.h>
+#include <diaghelp.h>
+#include <rhutils.h>
+#include <advice.h>
+
+#ifdef SUP_GZ
+#include <zlib.h>
+#endif
+#include <gzfiles.h>
+#ifdef HAVE_GPG
+#include <sys/wait.h>
+#endif
+
+static int CheckGPGInstalled();
+
+static char *gzError=NULL;
+static GZFiles_CB gzCB=NULL;
+
+void GZFiles_SetMessageCallback(GZFiles_CB cb)
+{
+ gzCB=cb;
+}
+
+void GZFiles_ResetError()
+{
+ delete[] gzError;
+ gzError=NULL;
+}
+
+const char *GZFiles_GetError()
+{
+ return gzError;
+}
+
+void GZFiles_SetError(const char *error)
+{
+ delete[] gzError;
+ gzError=newStr(error);
+}
+
+const int eachRead=16300;
+
+#ifdef SUP_GZ
+static
+int GZFiles_ExpandGZ(FILE *dest, char *orig)
+{
+ // First I alloc a 16Kb buffer
+ char *buf=new char[eachRead];
+ if (!buf)
+ return 1;
+
+ gzFile file;
+ file=gzopen(orig,"rb");
+ if (file==NULL)
+ {
+ delete buf;
+ return 2;
+ }
+
+ int read;
+ do
+ {
+ read=gzread(file,buf,eachRead);
+ fwrite(buf,read,1,dest);
+ }
+ while(read==eachRead);
+
+ gzclose(file);
+ DeleteArray(buf);
+
+ return 0;
+}
+
+static
+int GZFiles_SimpleCopy(FILE *dest, char *orig)
+{
+ // First I alloc a 16Kb buffer
+ char *buf=new char[eachRead];
+ if (!buf)
+ return 1;
+
+ FILE *file;
+ file=fopen(orig,"rb");
+ if (file==NULL)
+ {
+ delete buf;
+ return 2;
+ }
+
+ int read;
+ do
+ {
+ read=fread(buf,1,eachRead,file);
+ fwrite(buf,read,1,dest);
+ }
+ while(read==eachRead);
+
+ fclose(file);
+ delete buf;
+
+ return 0;
+}
+#endif // SUP_GZ
+
+#ifdef HAVE_BZIP2
+#ifdef HAVE_BZIP2PRE1
+#define BZ2_bzReadOpen bzReadOpen
+#define BZ2_bzReadClose bzReadClose
+#define BZ2_bzRead bzRead
+#define BZ2_bzWriteOpen bzWriteOpen
+#define BZ2_bzWriteClose bzWriteClose
+#define BZ2_bzWrite bzWrite
+#endif
+static
+int GZFiles_ExpandBZ2(FILE *dest, char *orig)
+{
+ // First I alloc a 16Kb buffer
+ char *buf=new char[eachRead];
+ if (!buf)
+ return 1;
+
+ FILE *fi;
+ fi=fopen(orig,"rb");
+ if (fi==NULL)
+ {
+ delete buf;
+ return 2;
+ }
+
+ BZFILE *file;
+ int bzError;
+ // Small=1 => slow, silence
+ file=BZ2_bzReadOpen(&bzError,fi,1,0,NULL,0);
+ if (bzError!=BZ_OK)
+ {
+ fclose(fi);
+ delete buf;
+ return 2;
+ }
+
+ int read;
+ do
+ {
+ read=BZ2_bzRead(&bzError,file,buf,eachRead);
+ fwrite(buf,read,1,dest);
+ }
+ while(bzError==BZ_OK);
+
+ BZ2_bzReadClose(&bzError,file);
+ fclose(fi);
+ delete[] buf;
+
+ return 0;
+}
+#endif // HAVE_BZIP2
+
+
+int GZFiles_ExpandHL(FILE *dest, char *orig)
+{
+ int ret=-1;
+
+ FILE *f=fopen(orig,"rb");
+ int mode=GZFiles_IsGZ(f);
+ fclose(f);
+
+ switch (mode)
+ {
+ case gzNoCompressed:
+ ret=GZFiles_SimpleCopy(dest,orig);
+ break;
+
+ #ifdef SUP_GZ
+ case gzGZIP:
+ // If libz is linked use this routine
+ ret=GZFiles_ExpandGZ(dest,orig);
+ break;
+ #endif
+
+ #ifdef HAVE_BZIP2
+ case gzBZIP2:
+ ret=GZFiles_ExpandBZ2(dest,orig);
+ break;
+ #endif
+
+ #ifdef HAVE_GPG
+ case gzGPG:
+ ret=GZFiles_DecryptGPG(dest,orig);
+ break;
+ #endif
+ }
+
+ return ret;
+}
+
+int GZFiles_IsGZ(FILE *f)
+{
+ unsigned val=0;
+ long pos=ftell(f);
+
+ #ifdef SUP_GZ
+ // Try with gzip
+ fread(&val,2,1,f);
+ fseek(f,pos,SEEK_SET);
+ if (val==0x8B1F)
+ return gzGZIP;
+ #endif
+
+ #ifdef HAVE_BZIP2
+ // Try Bzip2
+ char b[4];
+ fread(b,4,1,f);
+ fseek(f,pos,SEEK_SET);
+ if (strncmp(b,"BZh",3)==0 && ucisdigit(b[3]))
+ return gzBZIP2;
+ #endif
+
+ #ifdef HAVE_GPG
+ // GPG encrypted
+ char bgpg[27];
+ fread(bgpg,27,1,f);
+ fseek(f,pos,SEEK_SET);
+ if (strncmp(bgpg,"-----BEGIN PGP MESSAGE-----",27)==0)
+ return CheckGPGInstalled() ? gzGPG : gzNoCompressed;
+ #endif
+
+ return gzNoCompressed;
+}
+
+TGZFileWrite::TGZFileWrite(char *fileName, int comp)
+{
+ GZFiles_ResetError();
+ switch (comp)
+ {
+ case gzNoCompressed:
+ f=fopen(fileName,"wb");
+ ok=f!=NULL;
+ break;
+
+ #ifdef SUP_GZ
+ case gzGZIP:
+ fc=gzopen(fileName,"wb9");
+ ok=fc!=NULL;
+ break;
+ #endif
+
+ #ifdef HAVE_BZIP2
+ case gzBZIP2:
+ f=fopen(fileName,"wb");
+ ok=f!=NULL && ferror(f)==0;
+ if (ok)
+ {
+ int bzError;
+ // Block: 900Kb (no memory conservative), silent, default workFactor
+ // I don't know if that's correct but is the default of the
+ // standalone tool.
+ fc2=BZ2_bzWriteOpen(&bzError,f,9,0,0);
+ ok=fc2!=NULL && bzError==BZ_OK;
+ }
+ break;
+ #endif
+
+ #ifdef HAVE_GPG
+ case gzGPG:
+ ok=GZFiles_CreateGPG(fileName,hi,ho,he,child);
+ break;
+ #endif
+ }
+ compressed=comp;
+}
+
+void TGZFileWrite::close()
+{
+ switch (compressed)
+ {
+ case gzNoCompressed:
+ if (f)
+ {
+ fclose(f);
+ f=NULL;
+ }
+ break;
+
+ #ifdef SUP_GZ
+ case gzGZIP:
+ if (fc)
+ {
+ gzclose(fc);
+ fc=NULL;
+ }
+ break;
+ #endif
+
+ #ifdef HAVE_BZIP2
+ case gzBZIP2:
+ if (ok)
+ {
+ int bzError;
+ BZ2_bzWriteClose(&bzError,fc2,0,0,0);
+ }
+ if (f)
+ {
+ fclose(f);
+ f=NULL;
+ }
+ break;
+ #endif
+
+ #ifdef HAVE_GPG
+ case gzGPG:
+ if (hi!=-1)
+ {
+ ok=!GZFiles_CloseGPG(hi,ho,he,child);
+ hi=-1;
+ }
+ break;
+ #endif
+ }
+}
+
+TGZFileWrite::~TGZFileWrite()
+{
+}
+
+size_t TGZFileWrite::write(void *buffer, size_t len)
+{
+ if (!ok || len==0) return 0;
+
+ size_t ret;
+ switch (compressed)
+ {
+ case gzNoCompressed:
+ ret=fwrite(buffer,len,1,f);
+ if (ret<1) ok=0;
+ break;
+
+ #ifdef SUP_GZ
+ case gzGZIP:
+ ret=gzwrite(fc,buffer,len);
+ if (ret==0)
+ {
+ ok=0; ret=(size_t)-1;
+ }
+ break;
+ #endif
+
+ #ifdef HAVE_BZIP2
+ case gzBZIP2:
+ {
+ int bzError;
+ BZ2_bzWrite(&bzError,fc2,buffer,len);
+ if (bzError!=BZ_OK)
+ {
+ ok=0; ret=(size_t)-1;
+ }
+ else
+ ret=len;
+ }
+ break;
+ #endif
+
+ #ifdef HAVE_GPG
+ case gzGPG:
+ {// We must iterate until the child process all the data
+ ssize_t r;
+ size_t lori=len;
+ do
+ {
+ r=::write(hi,buffer,len);
+ if (r==-1)
+ break;
+ len-=r;
+ buffer=(char *)buffer+r;
+ }
+ while (len);
+ if (r==-1)
+ {
+ ok=0; ret=(size_t)-1;
+ }
+ else
+ ret=lori;
+ }
+ break;
+ #endif
+
+ default:
+ ret=0;
+ }
+ return ret;
+}
+
+/*****************************************************************************
+ GPG stuff. Experimental and not secure at all, use at your own risk.
+ Only for Linux.
+*****************************************************************************/
+
+#ifdef HAVE_GPG
+const unsigned maxPhraseLen=256;
+// Cached passphrase
+static char gpgPassPhrase[maxPhraseLen];
+// Do we have a phrase to try?
+static int gpgValidPhrase=0;
+// User ID to encrypt
+static ulong gpgUserID;
+
+const int sysError=-1;
+const int gpgEachRead=32768;
+const char *gpgCommand="/usr/bin/gpg";
+const char *gpgCLine=" --passphrase-fd 0 --no-verbose --batch --output - ";
+const char *gpgWCLine="%s --batch --quiet --no-verbose --output %s --encrypt --textmode --armor --always-trust -r 0x%lX";
+
+static
+TDialog *createGetPassPhrase(int len)
+{
+ TSViewCol *col=new TSViewCol(__("Validation"));
+
+ TSInputLine *il=new TSInputLine(len,GetDeskTopCols()-8);
+ il->setHide(True);
+ TSLabel *label=new TSLabel(__("Passphrase"),il);
+ col->insert(xTSCenter,yTSUp,label);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcPassphrase);
+ delete col;
+ return d;
+}
+
+static
+char *gpgGetPhrase()
+{
+ if (gpgValidPhrase)
+ return gpgPassPhrase;
+ if (execDialog(createGetPassPhrase(maxPhraseLen),gpgPassPhrase)==cmOK)
+ return gpgPassPhrase;
+
+ return NULL;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ A popen replacement to redirect stdin, stdout and stderr.
+
+ Return: The stdin handle on success, -1 on error.
+ Example:
+
+***************************************************************************/
+
+static
+int gpgPopen(const char *command, pid_t &pid, int &wrh, int &rde)
+{
+ int rc, wr, er;
+ int pipefd[2], pipewr[2], pipeer[2];
+
+ rc=pipe(pipefd);
+ if (rc==sysError)
+ return sysError;
+ wr=pipe(pipewr);
+ if (wr==sysError)
+ {
+ close(pipefd[0]);
+ close(pipefd[1]);
+ return sysError;
+ }
+ er=pipe(pipeer);
+ if (er==sysError)
+ {
+ close(pipewr[0]);
+ close(pipewr[1]);
+ close(pipefd[0]);
+ close(pipefd[1]);
+ return sysError;
+ }
+
+ pid=fork();
+ switch (pid)
+ {
+ case sysError:
+ close(pipeer[0]);
+ close(pipeer[1]);
+ close(pipewr[0]);
+ close(pipewr[1]);
+ close(pipefd[0]);
+ close(pipefd[1]);
+ return sysError;
+
+ case 0: /* Child */
+ close(pipefd[0]);
+ dup2(pipefd[1],STDOUT_FILENO);
+ close(pipefd[1]);
+
+ close(pipeer[0]);
+ dup2(pipeer[1],STDERR_FILENO);
+ close(pipeer[1]);
+
+ close(pipewr[1]);
+ dup2(pipewr[0],STDIN_FILENO);
+ close(pipewr[0]);
+ /*
+ * The System() call assumes that /bin/sh is
+ * always available, and so will we.
+ */
+ execl("/bin/sh", "/bin/sh", "-c", command, NULL);
+ _exit(EXIT_FAILURE);
+ break;
+
+ default: /* Parent */
+ close(pipefd[1]);
+ rc=pipefd[0];
+ close(pipeer[1]);
+ rde=pipeer[0];
+ close(pipewr[0]);
+ wrh=pipewr[1];
+ break;
+ } /* switch */
+ return rc;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a line of text from the child.
+ By breese.
+
+ Return:
+ The ammount of bytes read.
+
+***************************************************************************/
+static
+int gpgGetline(int fd, char *buffer, int max)
+{
+ char c;
+ int i=0;
+
+ do
+ {
+ if (read(fd,&c,1)<1)
+ return 0;
+ if (i<max)
+ buffer[i++]=c;
+ }
+ while (c!='\n');
+ buffer[i]=(char)0;
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the pipe and ensures the child dies.
+ By SET.
+
+***************************************************************************/
+static
+int gpgPclose(int fd, int wp, int we, int pid)
+{
+ int wstatus;
+ /* Close the pipe, it should kill the child with SIGPIPE */
+ close(fd);
+ close(wp);
+ close(we);
+ waitpid(pid,&wstatus,0);
+ return wstatus>256 ? (wstatus>>8) : wstatus;
+}
+
+// TODO: Send the error to the message window. Tell the user, a callback?
+int GZFiles_DecryptGPG(FILE *dest, char *orig)
+{
+ // Get the passphrase
+ char *pass=gpgGetPhrase();
+ if (!pass)
+ {
+ GZFiles_SetError(__("No passphrase available"));
+ return 1;
+ }
+ gpgValidPhrase=0;
+
+ // Alloc a 32Kb buffer
+ char *buf=new char[gpgEachRead];
+ if (!buf)
+ {
+ GZFiles_SetError(__("Out of memory"));
+ return 2;
+ }
+
+ // Pipe to GPG
+ pid_t child;
+ int wr, er;
+ char *aux=NULL;
+ string_cat(aux,gpgCommand,gpgCLine,orig,NULL);
+ if (gzCB)
+ {
+ gzCB(__("Running:"));
+ gzCB(aux);
+ }
+ int h=gpgPopen(aux,child,wr,er);
+ string_free(aux);
+ if (h<0)
+ {
+ delete[] buf;
+ GZFiles_SetError(__("Failed to invoke gpg"));
+ return 4;
+ }
+
+ // Send the passphrase
+ write(wr,pass,strlen(pass));
+ write(wr,"\n",1);
+
+ // Copy the output from GPG
+ int l;
+ while ((l=gpgGetline(h,buf,gpgEachRead))!=0)
+ fwrite(buf,l,1,dest);
+
+ // Analyze error messages
+ int foundId=0;
+ while (gpgGetline(er,buf,gpgEachRead))
+ {
+ if (gzCB)
+ {
+ for (char *s=buf; *s; s++)
+ if (*s=='\r' || *s=='\n')
+ *s=' ';
+ gzCB(buf);
+ }
+ if (strncmp(buf,"gpg: encrypted with",19)==0)
+ {
+ char *name=strstr(buf,", ID ");
+ if (name)
+ {
+ char *end;
+ gpgUserID=strtoul(name+5,&end,16);
+ foundId=1;
+ }
+ }
+ }
+
+ // Close the pipe
+ int gpgStatus=gpgPclose(h,wr,er,child);
+ // Check if we have a valid passphrase
+ if (gpgStatus)
+ GZFiles_SetError(__("Error while decrypting"));
+ else
+ if (!foundId)
+ {
+ GZFiles_SetError(__("Failed to determine user ID"));
+ gpgStatus=-1;
+ }
+ else
+ gpgValidPhrase=1;
+ delete[] buf;
+
+ return gpgStatus;
+}
+
+int GZFiles_CreateGPG(const char *file, int &hi, int &ho, int &he, pid_t &child)
+{
+ int len=CLY_snprintf(NULL,0,gpgWCLine,gpgCommand,file,gpgUserID);
+ AllocLocalStr(buf,len+1);
+ CLY_snprintf(buf,len+1,gpgWCLine,gpgCommand,file,gpgUserID);
+
+ unlink(file);
+ // Pipe to GPG
+ if (gzCB)
+ {
+ gzCB(__("Running:"));
+ gzCB(buf);
+ }
+ ho=gpgPopen(buf,child,hi,he);
+ if (ho<0)
+ {
+ GZFiles_SetError(__("Failed to invoke gpg"));
+ return 0;
+ }
+
+ return 1;
+}
+
+
+int GZFiles_CloseGPG(int hi, int ho, int he, pid_t child)
+{
+ if (gzCB)
+ {// We must avoid blocking. Usually GPG have nothing to say through stderr.
+ int h=he;
+ int oldflags=fcntl(h,F_GETFL,0);
+ if (oldflags!=-1)
+ {
+ if (fcntl(h,F_SETFL,oldflags|O_NONBLOCK)!=-1)
+ {
+ char buf[80];
+ while (gpgGetline(h,buf,80))
+ {
+ for (char *s=buf; *s; s++)
+ if (*s=='\r' || *s=='\n')
+ *s=' ';
+ gzCB(buf);
+ }
+ }
+ }
+ }
+ int ret=gpgPclose(hi,ho,he,child);
+ if (ret)
+ GZFiles_SetError(__("Error from GPG"));
+ return ret;
+}
+
+
+static
+int CheckGPGInstalled()
+{
+ struct stat st;
+ static int informed=0;
+
+ if (stat(gpgCommand,&st)==0)
+ return 1;
+ if (!informed)
+ {
+ informed=1;
+ GiveAdvice(gadvGPG);
+ }
+ return 0;
+}
+#endif
+
diff --git a/setedit/mainsrc/keytrans.cc b/setedit/mainsrc/keytrans.cc
new file mode 100644
index 0000000..9861c68
--- /dev/null
+++ b/setedit/mainsrc/keytrans.cc
@@ -0,0 +1,1281 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Test to make a really complex translator from a keyboard sequence to a
+ command sequence.
+
+*****************************************************************************/
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_string
+#define Uses_limits
+
+#define Uses_TNSCollection
+#define Uses_TEvent
+#define Uses_MsgBox
+#define Uses_TStringable
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TGKey
+#include <settvuti.h>
+#define Uses_TCEditor_Commands
+#define Uses_TCEditor_External
+#include <ceditor.h>
+//#define NDEBUG
+#include <assert.h>
+#include <dyncat.h>
+#define Uses_TKeyTranslate
+#define Uses_TComSeqCol
+#define Uses_TKeySeqCol
+#include <keytrans.h>
+
+
+static char *Error=0;
+static void StoreError(const char *error,char *file);
+static const char *loadedFile=0;
+
+TKeyTranslate::TKeyTranslate(KeyTTable *aBase, int aType) :
+ TStringable()
+{
+ assert(type!=kbtExpanded);
+ base=aBase;
+ curTable=aBase;
+ type=aType;
+ state=0;
+ // That's a helper to avoid counting the values by hand
+ Count=base->total=CountKeys(base);
+}
+
+TKeyTranslate::~TKeyTranslate()
+{
+ deleteTree();
+}
+
+KeyTNode *TKeyTranslate::search(unsigned key)
+{
+ KeyTNode *array=curTable->nodes,*cmpval;
+ int nelem=curTable->cant,lim;
+
+ for (lim=nelem; lim!=0; lim>>=1)
+ {
+ cmpval=&array[lim>>1];
+ if (cmpval->key==(int)key)
+ return cmpval;
+ if (cmpval->key<(int)key)
+ { /* key > p: move right */
+ array=cmpval+1;
+ lim--;
+ } /* else move left */
+ }
+ return 0;
+}
+
+inline
+void AlignSize(unsigned &aux)
+{
+ if (aux & 3)
+ aux=(aux | 3)+1;
+}
+
+#define EOS 0
+
+void TKeyTranslate::getText(char *dest, unsigned item, int maxLen)
+{
+ if (item>=base->total)
+ {
+ *dest=EOS;
+ return;
+ }
+ DynStrCatStruct cat;
+ // That initializes the structure
+ DynStrCatInit(&cat,0,0);
+ KeyTTable *t=base;
+ unsigned c=0,i=0;
+
+ while (1)
+ {
+ KeyTNode *node=&(t->nodes[i]);
+ if (node->flags==kbtIsSComm)
+ {
+ KeyTTable *nT=GetTableE(node);
+ if (item<c+nT->total)
+ { // Is in a deeper table
+ CatFullNameKey(node,&cat);
+ t=nT;
+ i=0;
+ }
+ else
+ {
+ c+=nT->total;
+ i++;
+ }
+ }
+ else
+ {
+ if (c==item)
+ {
+ CatFullNameKey(node,&cat);
+ break;
+ }
+ c++;
+ i++;
+ }
+ }
+ #ifndef NDEBUG
+ //printf("%s\n",cat.str);
+ #endif
+ strncpy(dest,cat.str,maxLen);
+ dest[maxLen]=EOS;
+ delete cat.str;
+}
+
+void TKeyTranslate::deleteKey(unsigned which)
+{
+ assert(type==kbtExpanded);
+ assert(base->total>which);
+ DeleteKey(base,0,which);
+ Count=base->total;
+}
+
+void TKeyTranslate::DeleteKey(KeyTTable *t, unsigned baseNumKey, unsigned which)
+{
+ unsigned cant=t->cant;
+ unsigned i;
+
+ for (i=0; i<cant; )
+ {
+ KeyTNode *node=&(t->nodes[i]);
+ if (node->flags==kbtIsSComm && baseNumKey!=which)
+ {
+ KeyTTable *nT=GetTableE(node);
+ if (which<baseNumKey+nT->total)
+ { // Is in a deeper table
+ DeleteKey(nT,baseNumKey,which);
+ if (nT->cant==0)
+ { // The table is empty
+ delete nT;
+ // Now reduce it
+ memcpy(node,node+1,sizeof(KeyTNode)*(cant-i-1));
+ t->cant--;
+ }
+ t->total--;
+ return;
+ }
+ else
+ { // Skip the table
+ baseNumKey+=nT->total;
+ i++;
+ }
+ }
+ else
+ {
+ if (baseNumKey==which)
+ {
+ if (node->flags==kbtIsMacro || node->flags==kbtIsSeq)
+ delete[] node->d.macro;
+ else if (node->flags==kbtIsSComm)
+ // It removes a branch in the tree
+ DeleteTree(GetTableE(node));
+ memcpy(node,node+1,sizeof(KeyTNode)*(cant-i-1));
+ t->cant--;
+ t->total--;
+ return;
+ }
+ baseNumKey++;
+ i++;
+ }
+ }
+}
+
+void TCEditor_MakeKeyName(char *s, unsigned short key)
+{
+ char *b=s;
+
+ #define A(cas,a,b) if (key & cas) { *s=a; *(s+1)=b; s+=2; }
+ A(kbShiftCode,'S','h')
+ A(kbCtrlCode,'C','t')
+ A(kbAltRCode,'a','l')
+ A(kbAltLCode,'A','l')
+ #undef A
+ *s=0;
+ strcat(b,TGKey::NumberToKeyName(key & kbKeyMask));
+}
+
+int InterpretKeyName(char *s, ushort &code)
+{
+ ushort lcode=0;
+
+ #define A(cas,a,b) if (*s==a && *(s+1)==b) { s+=2; lcode|=cas; }
+ A(kbShiftCode,'S','h')
+ A(kbCtrlCode,'C','t')
+ A(kbAltRCode,'a','l')
+ A(kbAltLCode,'A','l')
+ #undef A
+ ushort n=TGKey::KeyNameToNumber(s);
+ if (n==(ushort)-1)
+ return 1;
+ code=lcode | n;
+ return 0;
+}
+
+void TKeyTranslate::CatFullNameKey(KeyTNode *node, DynStrCatStruct *cat)
+{
+ assert(type==kbtExpanded);
+ int i;
+ char b[tktMaxKeyName]; // must be enough for any key name
+
+ TCEditor_MakeKeyName(b,node->key);
+ if (node->flags==kbtIsSComm)
+ strcat(b," ");
+ else
+ strcat(b," -> ");
+ DynStrCat(cat,b);
+
+ KeyTSeq *se;
+ switch (node->flags)
+ {
+ case kbtIsComm:
+ DynStrCat(cat,TranslateEdCommand(node->d.command));
+ break;
+ case kbtIsMacro:
+ DynStrCat(cat,GetMNameE(node));
+ break;
+ case kbtIsSeq:
+ se=GetTSeqE(node);
+ for (i=0; i<se->cant; i++)
+ {
+ char *p=TranslateEdCommand(se->commands[i]);
+ if (p)
+ {
+ DynStrCat(cat,p);
+ DynStrCat(cat," ");
+ }
+ }
+ break;
+ }
+}
+
+unsigned TKeyTranslate::CountKeys(KeyTTable *t)
+{
+ unsigned cant=t->cant;
+ unsigned i,aCount=0;
+
+ for (i=0; i<cant; i++)
+ {
+ KeyTNode *node=&(t->nodes[i]);
+ if (node->flags==kbtIsSComm)
+ {
+ KeyTTable *nT=GetTableC(node);
+ unsigned c=CountKeys(nT);
+ nT->total=c;
+ aCount+=c;
+ }
+ else
+ aCount++;
+ }
+ return aCount;
+}
+
+int TKeyTranslate::get(unsigned key,KeyTNode *ret)
+{
+ assert(type!=kbtExpanded);
+ KeyTNode *p=search(key);
+ if (!p)
+ {
+ rewind();
+ return 0;
+ }
+ memcpy(ret,p,sizeof(KeyTNode));
+ switch (ret->flags)
+ {
+ case kbtIsSComm:
+ state++;
+ curTable=GetTableC(ret);
+ return -1;
+ case kbtIsMacro:
+ ret->d.data=GetMNameC(ret);
+ break;
+ case kbtIsSeq:
+ ret->d.data=GetTSeqC(ret);
+ break;
+ }
+ rewind();
+ return 1;
+}
+
+KeyTNode *TKeyTranslate::move(unsigned key, int add)
+{
+ KeyTNode *array=curTable->nodes,*p=0;
+ int c=curTable->cant,i,found=0,num;
+
+ for (i=0,num=0; i<c; i++)
+ {
+ p=array+i;
+ if (p->key==(int)key)
+ {
+ found++;
+ break;
+ }
+ if (p->flags==kbtIsSComm)
+ num+=(GetTable(p))->total;
+ else
+ num++;
+ }
+ if (!found || !p)
+ return 0;
+
+ curTable->total+=add;
+ numKey+=num;
+ if (p->flags==kbtIsSComm)
+ {
+ state++;
+ lastTableInSearch=p;
+ curTable=GetTable(p);
+ }
+
+ return p;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Expands the tree to be easylly editable. That means: all small chuncks
+of memory. Calls @x{::ExpandTable}, to do the job.@p
+ Returns the old compacted block that must be deleted by the caller. That's
+to allow an easy undo during the expanded phase. Additionally canBeDeleted
+indicates if delete can be used or the pointer is to the original.
+
+***************************************************************************/
+
+KeyTTable *TKeyTranslate::expand(int &canBeDeleted)
+{
+ assert(type!=kbtExpanded);
+ canBeDeleted=0;
+ KeyTTable *newT=ExpandTable(base);
+ if (!newT)
+ return 0;
+ canBeDeleted=(type==kbtDynamic);
+ type=kbtExpanded;
+ KeyTTable *oldT=base;
+ base=newT;
+
+ return oldT;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the function that recursivelly travels the tree generating a
+fully unpacked version.
+
+***************************************************************************/
+
+KeyTTable *TKeyTranslate::ExpandTable(KeyTTable *t)
+{
+ unsigned cant=t->cant;
+ unsigned i,size=sizeof(KeyTTable)+cant*sizeof(KeyTNode);
+ KeyTTable *nAux;
+
+ KeyTTable *nT=(KeyTTable *)new char[size];
+ if (!nT)
+ return 0;
+ memcpy(nT,t,size);
+ for (i=0; i<cant; i++)
+ {
+ KeyTNode *node=&(nT->nodes[i]);
+ KeyTSeq *s,*s2;
+ switch (node->flags)
+ {
+ case kbtIsComm:
+ break;
+ case kbtIsSComm:
+ nAux=ExpandTable(GetTableC(node));
+ if (!nAux)
+ return 0;
+ node->d.data=nAux;
+ break;
+ case kbtIsMacro:
+ node->d.data=newStr(GetMNameC(node));
+ break;
+ case kbtIsSeq:
+ s=GetTSeqC(node);
+ size=sizeof(unsigned short)*(s->cant+1);
+ s2=(KeyTSeq *)(new char[size]);
+ if (!s2)
+ return 0;
+ memcpy(s2,s,size);
+ node->d.data=s2;
+ break;
+ }
+ }
+ return nT;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Calculates how much memory I need to store the tree in one block.
+
+***************************************************************************/
+
+unsigned TKeyTranslate::MeassureTree(KeyTTable *t)
+{
+ assert(type==kbtExpanded);
+ unsigned cant=t->cant;
+ unsigned i,size=sizeof(KeyTTable)+cant*sizeof(KeyTNode),aux;
+
+ for (i=0; i<cant; i++)
+ {
+ KeyTNode *node=&(t->nodes[i]);
+ KeyTSeq *s;
+ switch (node->flags)
+ {
+ case kbtIsComm:
+ break;
+ case kbtIsSComm:
+ size+=MeassureTree(GetTableE(node));
+ break;
+ case kbtIsMacro:
+ aux=strlen(GetMNameE(node))+1;
+ AlignSize(aux);
+ size+=aux;
+ break;
+ case kbtIsSeq:
+ s=GetTSeqE(node);
+ aux=sizeof(unsigned short)*(s->cant+1);
+ AlignSize(aux);
+ size+=aux;
+ break;
+ }
+ }
+ return size;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Reports the size of the structure, can't be called when static.
+
+***************************************************************************/
+
+unsigned TKeyTranslate::getLen(void)
+{
+ assert(type!=kbtStatic);
+ if (type==kbtExpanded)
+ return MeassureTree(base);
+ return cSize;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Deletes the current table and uses the new one.
+
+***************************************************************************/
+
+void TKeyTranslate::ChangeTable(KeyTTable *aBase, int aType)
+{
+ deleteTree();
+ base=aBase;
+ curTable=aBase;
+ type=aType;
+ state=0;
+ Count=base->total=CountKeys(base);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Compacts the tree in one block, switable for writing to disk. Calls to
+@x{::CompactTable}, to do the job.
+
+***************************************************************************/
+
+void TKeyTranslate::compact(void)
+{
+ assert(type==kbtExpanded);
+ cSize=MeassureTree(base);
+ OffSet=0;
+ newBase=new char[cSize];
+ if (!newBase)
+ return;
+ CompactTable(base);
+ deleteTree();
+ type=kbtDynamic;
+ curTable=base=(KeyTTable *)newBase;
+ state=0;
+}
+
+void TKeyTranslate::CompactTable(KeyTTable *t)
+{
+ unsigned cant=t->cant;
+ unsigned i,size=sizeof(KeyTTable)+cant*sizeof(KeyTNode),aux;
+
+ KeyTTable *nT=(KeyTTable *)(newBase+OffSet);
+ memcpy(nT,t,size);
+ OffSet+=size;
+ for (i=0; i<cant; i++)
+ {
+ KeyTNode *node=&(nT->nodes[i]);
+ KeyTSeq *s;
+ switch (node->flags)
+ {
+ case kbtIsComm:
+ break;
+ case kbtIsSComm:
+ aux=OffSet;
+ CompactTable(GetTableE(node));
+ node->d.offset=aux;
+ break;
+ case kbtIsMacro:
+ aux=strlen(GetMNameE(node))+1;
+ AlignSize(aux);
+ strcpy((char *)(newBase+OffSet),GetMNameE(node));
+ node->d.offset=OffSet;
+ OffSet+=aux;
+ break;
+ case kbtIsSeq:
+ s=GetTSeqE(node);
+ aux=sizeof(unsigned short)*(s->cant+1);
+ AlignSize(aux);
+ memcpy((KeyTSeq *)(newBase+OffSet),s,aux);
+ node->d.offset=OffSet;
+ OffSet+=aux;
+ break;
+ }
+ }
+}
+
+void TKeyTranslate::deleteTree(void)
+{
+ if (type==kbtDynamic)
+ delete[] base;
+ else
+ if (type==kbtExpanded)
+ DeleteTree(base);
+}
+
+void TKeyTranslate::DeleteTree(KeyTTable *t)
+{
+ unsigned cant=t->cant;
+ unsigned i;
+
+ for (i=0; i<cant; i++)
+ {
+ KeyTNode *node=&(t->nodes[i]);
+ switch (node->flags)
+ {
+ case kbtIsComm:
+ break;
+ case kbtIsSComm:
+ DeleteTree(GetTableE(node));
+ break;
+ case kbtIsMacro:
+ delete GetMNameE(node);
+ break;
+ case kbtIsSeq:
+ delete GetTSeqE(node);
+ break;
+ }
+ }
+ delete t;
+}
+
+void TKeySeqCol::getText(char *dest, unsigned item, int maxLen)
+{
+ char b[tktMaxKeyName];
+ TCEditor_MakeKeyName(b,(unsigned short)((unsigned long)at(item)));
+ strncpy(dest,b,maxLen);
+ dest[maxLen]=EOS;
+}
+
+void TComSeqCol::getText(char *dest, unsigned item, int maxLen)
+{
+ char b[40];
+ *b=0;
+
+ char *s=TranslateEdCommand((unsigned long)(at(item)));
+ if (s)
+ {
+ strcpy(b,"cmc");
+ strcat(b,s);
+ }
+ strncpy(dest,b,maxLen);
+ dest[maxLen]=EOS;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Inserts a KeyTNode in the curTable and assigns key to it. The rest of
+data must be arranged by the caller.
+
+***************************************************************************/
+
+KeyTNode *TKeyTranslate::InsertKey(unsigned key)
+{
+ KeyTNode *array=curTable->nodes;
+ int c=curTable->cant,i,updateBase;
+
+ updateBase=curTable==base;
+ // look the position for it to keep the table sorted
+ i=0;
+ while (i<c && array[i].key<(int)key) i++;
+ // Make room for one more
+ curTable->cant++;
+ //curTable->total++; Later
+ curTable=(KeyTTable *)realloc(curTable,sizeof(KeyTTable)+curTable->cant*sizeof(KeyTNode));
+ // Insert the key
+ if (i!=c)
+ memmove(&(curTable->nodes[i+1]),&(curTable->nodes[i]),(c-i)*sizeof(KeyTNode));
+ curTable->nodes[i].key=key;
+ // If this table is conected to another don't forget that realloc can
+ // change the pointer.
+ if (lastTableInSearch)
+ lastTableInSearch->d.data=curTable;
+ if (updateBase)
+ base=curTable;
+ return &(curTable->nodes[i]);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a very complex thing because I must:@p
+1) Check if the key can be added without problems.@*
+2) Add a new key to the tree, it can mean extend the tree.@*
+3) Update the counters of keys in each table.@p
+ The @var{simulate} arguments instructs to just verify if the key can be
+added.@p
+
+ Return:
+ A non-negative value if there are a key already defined for the
+sequence or part of the sequence. The value is returned to allow to the
+program ask for deletion.@p
+ -1 if the sequence will break more than one key assigment.@p
+ -2 if the key was added.
+
+***************************************************************************/
+
+int TKeyTranslate::addKey(TKeySeqCol *sKeys, void *data, int Type,
+ int *keyDef, Boolean simulate)
+{
+ assert(type==kbtExpanded);
+ int c=sKeys->getCount();
+ int i,ok=0;
+ KeyTNode *node;
+ //char b[100];
+
+ numKey=0;
+ lastTableInSearch=0;
+ rewind();
+ for (i=0; i<c; i++)
+ {
+ node=move((unsigned long)(sKeys->at(i)));
+ if (!node)
+ {
+ ok=1;
+ break;
+ }
+ if (node->flags!=kbtIsSComm)
+ {
+ /*printf("Ya tiene asignado algo (%d)\n",numKey);
+ getText(b,numKey,99);*/
+ rewind();
+ return numKey;
+ }
+ }
+ if (!ok)
+ {
+ //printf("No se puede ya que tiene mas de 1 asignada\n");
+ rewind();
+ if (keyDef)
+ *keyDef=numKey;
+ return -1;
+ }
+ if (simulate)
+ {
+ rewind();
+ return -2;
+ }
+ node=InsertKey((unsigned long)(sKeys->at(i)));
+ // Now if the sequence is larger create a ramification in the tree to hold it
+ while (i<(c-1))
+ {
+ node->flags=kbtIsSComm;
+ KeyTTable *nT=(KeyTTable *)new char[sizeof(KeyTTable)+sizeof(KeyTNode)];
+ node->d.data=nT;
+ nT->cant=1;
+ nT->total=0; // Later
+ node=nT->nodes;
+ node->key=(unsigned short)(unsigned long)(sKeys->at(++i));
+ }
+ // Now node points to an end of the tree
+ // The valid Types are kbtIsMacro kbtIsSeq
+ if (Type==kbtIsMacro)
+ { // Easy ;-)
+ node->flags=kbtIsMacro;
+ node->d.data=newStr((char *)data);
+ }
+ else
+ {
+ TComSeqCol *p=(TComSeqCol *)data;
+ c=p->getCount();
+ if (c==1)
+ {
+ node->flags=kbtIsComm;
+ node->d.command=(unsigned short)((unsigned long)p->at(0));
+ }
+ else
+ { // The never ending story ...
+ KeyTSeq *s=(KeyTSeq *)new char[sizeof(KeyTSeq)+sizeof(unsigned short)*c];
+ s->cant=c;
+ for (i=0; i<c; i++)
+ s->commands[i]=(unsigned short)((unsigned long)p->at(i));
+ node->flags=kbtIsSeq;
+ node->d.data=s;
+ }
+ }
+ // Hoppefully the key is there
+ rewind();
+ // But what about the counters?
+ Count++;
+ c=sKeys->getCount();
+ for (i=0; i<c; i++)
+ {
+ #ifdef NDEBUG
+ move((unsigned)(sKeys->at(i)),1);
+ #else
+ node=move((unsigned long)(sKeys->at(i)),1);
+ assert(node!=0);
+ #endif
+ }
+ rewind();
+
+ return -2;
+}
+
+static char Signature[]="SET's editor keyboard binding file\x1A";;
+const int Version=4;
+
+int TKeyTranslate::Save(char *name)
+{
+ assert(type!=kbtExpanded);
+ FILE *f=fopen(name,"wb");
+ if (!f)
+ return 1;
+ fwrite(Signature,sizeof(Signature),1,f);
+ fputc(Version,f);
+ ushort w=TGKey::GetAltSettings();
+ fwrite(&w,sizeof(w),1,f);
+ if (type==kbtStatic)
+ { // Don't save the keys if not needed
+ unsigned c=0;
+ fwrite(&c,sizeof(cSize),1,f);
+ }
+ else
+ {
+ fwrite(&cSize,sizeof(cSize),1,f);
+ fwrite(base,cSize,1,f);
+ }
+ int translateKeyPad=TGKey::GetKbdMapping(TGKey::dosTranslateKeypad);
+ fwrite(&translateKeyPad,sizeof(translateKeyPad),1,f);
+ fclose(f);
+ return 0;
+}
+
+#undef GenError
+#define GenError(a) \
+{\
+ StoreError(a,name);\
+ fclose(f);\
+ return 1;\
+}
+
+int TKeyTranslate::Load(char *name)
+{
+ char buf[sizeof(Signature)];
+ FILE *f=fopen(name,"rb");
+ if (!f)
+ return 0;
+ fread(buf,sizeof(Signature),1,f);
+ if (strcmp(buf,Signature))
+ GenError(__("Wrong file"));
+
+ int V=fgetc(f);
+ if (V>Version || V<3)
+ GenError(__("Wrong version"));
+
+ ushort w;
+ fread(&w,sizeof(w),1,f);
+ TGKey::SetAltSettings(w);
+
+ int lcSize,replaceK=0;
+ fread(&lcSize,sizeof(lcSize),1,f);
+ if (lcSize)
+ {
+ newBase=new char[lcSize];
+ fread(newBase,lcSize,1,f);
+ replaceK=1;
+ }
+ if (ferror(f))
+ {
+ delete newBase;
+ GenError(__("Error while reading"));
+ }
+ if (V>=4)
+ {
+ int translateKeyPad;
+ fread(&translateKeyPad,sizeof(translateKeyPad),1,f);
+ TGKey::SetKbdMapping(translateKeyPad ? TGKey::dosTranslateKeypad : TGKey::dosNormalKeypad);
+ }
+ fclose(f);
+ if (replaceK)
+ {
+ deleteTree();
+ type=kbtDynamic;
+ curTable=base=(KeyTTable *)newBase;
+ }
+
+ return 0;
+}
+
+
+/******************************* DEFAULT key assigment *******************************/
+
+
+
+
+
+// That's a trick to have a hardcoded tree. Is dirty
+#define DeclareTable(a) \
+typedef struct \
+{ unsigned cant; unsigned total; KeyTNode nodes[a]; } KeyTTable##a
+
+#define DeclareSeq(a) \
+typedef struct \
+{ unsigned short cant; unsigned short commands[a]; } KeyTSeq##a
+
+#define pSeq(a) (((char *)&a)-((char *)&base))
+#define dSeqSel(name,comm) \
+ KeyTSeq3 name={ 3, {cmcSelectOn,comm,cmcSelectOff} }
+
+// Doesn't exist by now, will be implemented
+//const cmcSelectOn=1000,cmcSelectOff=1001;
+
+DeclareSeq(3);
+
+extern KeyTSeq3 ShUp,ShDn,ShHome,ShEnd,ShPgUp,ShPgDn,ShL,ShR,ShCtL,ShCtR,
+ ShCtHome,ShCtEnd,ShCtPgUp,ShCtPgDn;
+
+// 196 keys defined
+const int NormalSize=89,CtrlQSize=50,CtrlKSize=61;
+#define NormalTable KeyTTable89
+#define CtrlQTable KeyTTable50
+#define CtrlKTable KeyTTable61
+DeclareTable(89);
+DeclareTable(50);
+DeclareTable(61);
+
+extern CtrlQTable CtrlQ;
+extern CtrlKTable CtrlK;
+
+NormalTable base=
+{ NormalSize,0,
+ { // MUST be sorted
+ // Normal 15
+ { kbEsc, kbtIsComm, {cmcHideSelect} }, // 31
+ { kbBackSpace, kbtIsComm, {cmcBackSpace} }, // 42
+ { kbTab, kbtIsComm, {cmcSmartTab} }, // 43
+ { kbEnter, kbtIsComm, {cmcNewLine} }, // 44
+ { kbHome, kbtIsComm, {cmcLineStart} }, // 69
+ { kbUp, kbtIsComm, {cmcLineUp} }, // 70
+ { kbPgUp, kbtIsComm, {cmcPageUp} }, // 71
+ { kbLeft, kbtIsComm, {cmcCharLeft} }, // 72
+ { kbRight, kbtIsComm, {cmcCharRight} }, // 73
+ { kbEnd, kbtIsComm, {cmcLineEnd} }, // 74
+ { kbDown, kbtIsComm, {cmcLineDown} }, // 75
+ { kbPgDn, kbtIsComm, {cmcPageDown} }, // 76
+ { kbInsert, kbtIsComm, {cmcInsMode} }, // 77
+ { kbDelete, kbtIsComm, {cmcDelCharClear} }, // 78
+ { kbMacro, kbtIsComm, {cmcExpandCode} }, // 98
+ // Shift 10
+ { kbShBackSpace, kbtIsComm, {cmcBackSpace} }, // 42
+ { kbShEnter, kbtIsComm, {cmcNewLine} }, // 44
+ { kbShHome, kbtIsSeq, {pSeq(ShHome)} }, // 69
+ { kbShUp, kbtIsSeq, {pSeq(ShUp)} }, // 70
+ { kbShPgUp, kbtIsSeq, {pSeq(ShPgUp)} }, // 71
+ { kbShLeft, kbtIsSeq, {pSeq(ShL)} }, // 72
+ { kbShRight, kbtIsSeq, {pSeq(ShR)} }, // 73
+ { kbShEnd, kbtIsSeq, {pSeq(ShEnd)} }, // 74
+ { kbShDown, kbtIsSeq, {pSeq(ShDn)} }, // 75
+ { kbShPgDn, kbtIsSeq, {pSeq(ShPgDn)} }, // 76
+ // Control 46
+ { kbCtA, kbtIsComm, {cmcWordLeft} }, // 1
+ { kbCtC, kbtIsComm, {cmcPageDown} }, // 3
+ { kbCtD, kbtIsComm, {cmcCharRight} }, // 4
+ { kbCtE, kbtIsComm, {cmcLineUp} }, // 5
+ { kbCtF, kbtIsComm, {cmcWordRight} }, // 6
+ { kbCtG, kbtIsComm, {cmcDelChar} }, // 7
+ { kbCtH, kbtIsComm, {cmcBackSpace} }, // 8
+ { kbCtJ, kbtIsComm, {cmcGotoEditorLine} }, // 10
+ { kbCtK, kbtIsSComm, {pSeq(CtrlK)} }, // 11
+ { kbCtL, kbtIsComm, {cmcSearchAgain} }, // 12
+ { kbCtM, kbtIsComm, {cmcNewLine} }, // 13
+ { kbCtN, kbtIsComm, {cmcInsertNewLine} }, // 14
+ { kbCtO, kbtIsComm, {cmcIndentMode} }, // 15
+ { kbCtP, kbtIsComm, {cmcIntelIndentMode} }, // 16
+ { kbCtQ, kbtIsSComm, {pSeq(CtrlQ)} }, // 17
+ { kbCtR, kbtIsComm, {cmcPageUp} }, // 18
+ { kbCtS, kbtIsComm, {cmcCharLeft} }, // 19
+ { kbCtT, kbtIsComm, {cmcDelWord} }, // 20
+ { kbCtU, kbtIsComm, {cmcUndo} }, // 21
+ { kbCtV, kbtIsComm, {cmcInsMode} }, // 22
+ // Moved to menues { kbCtW, kbtIsComm, {cmcScrollDown} }, // 23
+ { kbCtX, kbtIsComm, {cmcLineDown} }, // 24
+ { kbCtY, kbtIsComm, {cmcDelLine} }, // 25
+ // Moved to menues { kbCtZ, kbtIsComm, {cmcScrollUp} }, // 26
+ { kbCtOpenBrace, kbtIsComm, {cmcSearchStart} }, // 27
+ { kbCtCloseBrace, kbtIsComm, {cmcSearchEnd} }, // 29
+ { kbCt0, kbtIsComm, {cmcGotoMark0} }, // 32
+ { kbCt1, kbtIsComm, {cmcGotoMark1} }, // 33
+ { kbCt2, kbtIsComm, {cmcGotoMark2} }, // 34
+ { kbCt3, kbtIsComm, {cmcGotoMark3} }, // 35
+ { kbCt4, kbtIsComm, {cmcGotoMark4} }, // 36
+ { kbCt5, kbtIsComm, {cmcGotoMark5} }, // 37
+ { kbCt6, kbtIsComm, {cmcGotoMark6} }, // 38
+ { kbCt7, kbtIsComm, {cmcGotoMark7} }, // 39
+ { kbCt8, kbtIsComm, {cmcGotoMark8} }, // 40
+ { kbCt9, kbtIsComm, {cmcGotoMark9} }, // 41
+ { kbCtBackSpace, kbtIsComm, {cmcDelPrevWord} }, // 42
+ { kbCtTab, kbtIsComm, {cmcSmartIndent} }, // 43
+ { kbCtEnter, kbtIsComm, {cmcLoadFileUnderCur} }, // 44
+ { kbCtSpace, kbtIsComm, {cmcExpandCode} }, // 52
+ { kbCtHome, kbtIsComm, {cmcFirstLineInScreen} }, // 69
+ { kbCtPgUp, kbtIsComm, {cmcTextStart} }, // 71
+ { kbCtLeft, kbtIsComm, {cmcWordLeft} }, // 72
+ { kbCtRight, kbtIsComm, {cmcWordRight} }, // 73
+ { kbCtEnd, kbtIsComm, {cmcLastLineInScreen} }, // 74
+ { kbCtPgDn, kbtIsComm, {cmcTextEnd} }, // 76
+ { kbCtInsert, kbtIsComm, {cmcCopy} }, // 77
+ { kbCtDelete, kbtIsComm, {cmcClear} }, // 78
+ // Shift Ctrl 15
+ { kbShCtA, kbtIsSeq, {pSeq(ShCtL)} }, // 1
+ { kbShCtC, kbtIsSeq, {pSeq(ShPgUp)} }, // 3
+ { kbShCtD, kbtIsSeq, {pSeq(ShR)} }, // 4
+ { kbShCtE, kbtIsSeq, {pSeq(ShUp)} }, // 5
+ { kbShCtF, kbtIsSeq, {pSeq(ShCtR)} }, // 6
+ { kbShCtR, kbtIsSeq, {pSeq(ShPgUp)} }, // 18
+ { kbShCtS, kbtIsSeq, {pSeq(ShL)} }, // 19
+ { kbShCtX, kbtIsSeq, {pSeq(ShDn)} }, // 24
+ { kbShCt0, kbtIsComm, {cmcSearchClPar} }, // 32
+ { kbShCt9, kbtIsComm, {cmcSearchOpPar} }, // 41
+ { kbShCtTab, kbtIsComm, {cmcSmartUnIndent} }, // 43
+ { kbShCtHome, kbtIsSeq, {pSeq(ShCtHome)} }, // 69
+ { kbShCtPgUp, kbtIsSeq, {pSeq(ShCtPgUp)} }, // 71
+ { kbShCtLeft, kbtIsSeq, {pSeq(ShCtL)} }, // 72
+ { kbShCtRight,kbtIsSeq, {pSeq(ShCtR)} }, // 73
+ { kbShCtEnd, kbtIsSeq, {pSeq(ShCtEnd)} }, // 74
+ { kbShCtPgDn, kbtIsSeq, {pSeq(ShCtPgDn)} }, // 76
+ { kbShCtInsert, kbtIsComm, {cmcReplaceSelect} } // 77
+ }
+};
+
+CtrlQTable CtrlQ=
+{ CtrlQSize,0,
+ { // MUST be sorted
+ // Normal 26
+ { kbA, kbtIsComm, {cmcReplace} }, // 1
+ { kbB, kbtIsComm, {cmcGoBeginBlock} }, // 2
+ { kbC, kbtIsComm, {cmcTextEnd} }, // 3
+ { kbD, kbtIsComm, {cmcLineEnd} }, // 4
+ { kbE, kbtIsComm, {cmcFirstLineInScreen} }, // 5
+ { kbF, kbtIsComm, {cmcFind} }, // 6
+ { kbH, kbtIsComm, {cmcDelStart} }, // 8
+ { kbK, kbtIsComm, {cmcGoEndBlock} }, // 11
+ { kbL, kbtIsComm, {cmcSelLength} }, // 12
+ { kbM, kbtIsComm, {cmcChooseMacro} }, // 13
+ { kbP, kbtIsComm, {cmcJumpLastCursorPos} }, //
+ { kbR, kbtIsComm, {cmcTextStart} }, // 18
+ { kbS, kbtIsComm, {cmcLineStart} }, // 19
+ { kbX, kbtIsComm, {cmcLastLineInScreen} }, // 24
+ { kbY, kbtIsComm, {cmcDelEnd} }, // 25
+ { kbEsc, kbtIsComm, {cmcSearchComplement} }, // 31
+ { kb0, kbtIsComm, {cmcGotoMark0} }, // 32
+ { kb1, kbtIsComm, {cmcGotoMark1} }, // 33
+ { kb2, kbtIsComm, {cmcGotoMark2} }, // 34
+ { kb3, kbtIsComm, {cmcGotoMark3} }, // 35
+ { kb4, kbtIsComm, {cmcGotoMark4} }, // 36
+ { kb5, kbtIsComm, {cmcGotoMark5} }, // 37
+ { kb6, kbtIsComm, {cmcGotoMark6} }, // 38
+ { kb7, kbtIsComm, {cmcGotoMark7} }, // 39
+ { kb8, kbtIsComm, {cmcGotoMark8} }, // 40
+ { kb9, kbtIsComm, {cmcGotoMark9} }, // 41
+
+ // Control 24 All twice for the people that lets the finger in Ctrl
+ { kbCtA, kbtIsComm, {cmcReplace} }, // 1
+ { kbCtB, kbtIsComm, {cmcGoBeginBlock} }, // 2
+ { kbCtC, kbtIsComm, {cmcTextEnd} }, // 3
+ { kbCtD, kbtIsComm, {cmcLineEnd} }, // 4
+ { kbCtE, kbtIsComm, {cmcFirstLineInScreen} }, // 5
+ { kbCtF, kbtIsComm, {cmcFind} }, // 6
+ { kbCtH, kbtIsComm, {cmcDelStart} }, // 8
+ { kbCtK, kbtIsComm, {cmcGoEndBlock} }, // 11
+ { kbCtL, kbtIsComm, {cmcSelLength} }, // 12
+ { kbCtM, kbtIsComm, {cmcChooseMacro} }, // 13
+ { kbCtR, kbtIsComm, {cmcTextStart} }, // 18
+ { kbCtS, kbtIsComm, {cmcLineStart} }, // 19
+ { kbCtX, kbtIsComm, {cmcLastLineInScreen} }, // 24
+ { kbCtY, kbtIsComm, {cmcDelEnd} }, // 25
+ { kbCt0, kbtIsComm, {cmcGotoMark0} }, // 32
+ { kbCt1, kbtIsComm, {cmcGotoMark1} }, // 33
+ { kbCt2, kbtIsComm, {cmcGotoMark2} }, // 34
+ { kbCt3, kbtIsComm, {cmcGotoMark3} }, // 35
+ { kbCt4, kbtIsComm, {cmcGotoMark4} }, // 36
+ { kbCt5, kbtIsComm, {cmcGotoMark5} }, // 37
+ { kbCt6, kbtIsComm, {cmcGotoMark6} }, // 38
+ { kbCt7, kbtIsComm, {cmcGotoMark7} }, // 39
+ { kbCt8, kbtIsComm, {cmcGotoMark8} }, // 40
+ { kbCt9, kbtIsComm, {cmcGotoMark9} } // 41
+ }
+};
+
+CtrlKTable CtrlK=
+{ CtrlKSize,0,
+ { // MUST be sorted
+ // Normal 25
+ { kbB, kbtIsComm, {cmcStartSelect} }, // 2
+ { kbC, kbtIsComm, {cmcCopyBlock} }, // 3
+ { kbH, kbtIsComm, {cmcHideSelect} }, // 8
+ { kbI, kbtIsComm, {cmcIndentBlkOne} }, // 9
+ { kbK, kbtIsComm, {cmcEndSelect} }, // 11
+ { kbL, kbtIsComm, {cmcMarkLine} }, // 12
+ { kbM, kbtIsComm, {cmcToUpper} }, // 13
+ { kbO, kbtIsComm, {cmcToLower} }, // 15
+ { kbR, kbtIsComm, {cmcReadBlock} }, // 18
+ { kbT, kbtIsComm, {cmcMarkWord} }, // 20
+ { kbU, kbtIsComm, {cmcUnIndentBlkOne} }, // 21
+ { kbV, kbtIsComm, {cmcMoveBlock} }, // 22
+ { kbW, kbtIsComm, {cmcWriteBlock} }, // 23
+ { kbY, kbtIsComm, {cmcCut} }, // 25
+ { kb0, kbtIsComm, {cmcPutMark0} }, // 32
+ { kb1, kbtIsComm, {cmcPutMark1} }, // 33
+ { kb2, kbtIsComm, {cmcPutMark2} }, // 34
+ { kb3, kbtIsComm, {cmcPutMark3} }, // 35
+ { kb4, kbtIsComm, {cmcPutMark4} }, // 36
+ { kb5, kbtIsComm, {cmcPutMark5} }, // 37
+ { kb6, kbtIsComm, {cmcPutMark6} }, // 38
+ { kb7, kbtIsComm, {cmcPutMark7} }, // 39
+ { kb8, kbtIsComm, {cmcPutMark8} }, // 40
+ { kb9, kbtIsComm, {cmcPutMark9} }, // 41
+ { kbTab, kbtIsComm, {cmcIndentBlk} }, // 43
+
+ // Shift 11
+ { kbShA, kbtIsComm, {cmcToggleMoveOnPaste} }, // 1
+ { kbShB, kbtIsComm, {cmcSelRectStart} }, // 2
+ { kbShC, kbtIsComm, {cmcSelRectCopy} }, // 3
+ { kbShH, kbtIsComm, {cmcSelRectHide} }, // 8
+ { kbShK, kbtIsComm, {cmcSelRectEnd} }, // 11
+ { kbShL, kbtIsComm, {cmcSelRectDel} }, // 12
+ { kbShM, kbtIsComm, {cmcSelRectMove} }, // 13
+ { kbShP, kbtIsComm, {cmcSelRectPaste} }, // 16
+ { kbShT, kbtIsComm, {cmcSelRectCut} }, // 20
+ { kbShV, kbtIsComm, {cmcSelRectMove} }, // 22
+ { kbShTab, kbtIsComm, {cmcUnIndentBlk} }, // 43
+
+ // Control 25
+ { kbCtB, kbtIsComm, {cmcStartSelect} }, // 2
+ { kbCtC, kbtIsComm, {cmcCopyBlock} }, // 3
+ { kbCtH, kbtIsComm, {cmcHideSelect} }, // 8
+ { kbCtI, kbtIsComm, {cmcIndentBlkOne} }, // 9
+ { kbCtK, kbtIsComm, {cmcEndSelect} }, // 11
+ { kbCtL, kbtIsComm, {cmcMarkLine} }, // 12
+ { kbCtM, kbtIsComm, {cmcToUpper} }, // 13
+ { kbCtO, kbtIsComm, {cmcToLower} }, // 15
+ { kbCtR, kbtIsComm, {cmcReadBlock} }, // 18
+ { kbCtT, kbtIsComm, {cmcMarkWord} }, // 20
+ { kbCtU, kbtIsComm, {cmcUnIndentBlkOne} }, // 21
+ { kbCtV, kbtIsComm, {cmcMoveBlock} }, // 22
+ { kbCtW, kbtIsComm, {cmcWriteBlock} }, // 23
+ { kbCtY, kbtIsComm, {cmcCut} }, // 25
+ { kbCt0, kbtIsComm, {cmcPutMark0} }, // 32
+ { kbCt1, kbtIsComm, {cmcPutMark1} }, // 33
+ { kbCt2, kbtIsComm, {cmcPutMark2} }, // 34
+ { kbCt3, kbtIsComm, {cmcPutMark3} }, // 35
+ { kbCt4, kbtIsComm, {cmcPutMark4} }, // 36
+ { kbCt5, kbtIsComm, {cmcPutMark5} }, // 37
+ { kbCt6, kbtIsComm, {cmcPutMark6} }, // 38
+ { kbCt7, kbtIsComm, {cmcPutMark7} }, // 39
+ { kbCt8, kbtIsComm, {cmcPutMark8} }, // 40
+ { kbCt9, kbtIsComm, {cmcPutMark9} }, // 41
+ { kbCtTab, kbtIsComm, {cmcIndentBlk} } // 43
+ }
+};
+
+dSeqSel(ShHome,cmcLineStart);
+dSeqSel(ShUp,cmcLineUp);
+dSeqSel(ShPgUp,cmcPageUp);
+dSeqSel(ShL,cmcCharLeft);
+dSeqSel(ShR,cmcCharRight);
+dSeqSel(ShEnd,cmcLineEnd);
+dSeqSel(ShDn,cmcLineDown);
+dSeqSel(ShPgDn,cmcPageDown);
+dSeqSel(ShCtL,cmcWordLeft);
+dSeqSel(ShCtR,cmcWordRight);
+dSeqSel(ShCtHome,cmcFirstLineInScreen);
+dSeqSel(ShCtEnd,cmcLastLineInScreen);
+dSeqSel(ShCtPgUp,cmcTextStart);
+dSeqSel(ShCtPgDn,cmcTextEnd);
+
+
+/******************************* INTERFACE routines *******************************/
+
+
+
+
+
+TKeyTranslate KeyTrans((KeyTTable *)((void *)&base));
+
+static void StoreError(const char *error,char *file)
+{
+ char buf[PATH_MAX+80];
+ char *aux=TVIntl::getTextNew(error);
+ TVIntl::snprintf(buf,PATH_MAX+80,__("%s, file \"%s\"\n"),aux,file);
+ Error=strdup(buf);
+ DeleteArray(aux);
+}
+
+void ShowKeyBindError(void)
+{
+ if (Error)
+ {
+ messageBox(mfError | mfOKButton,__("Error while loading the keyboard binding: %s"),Error);
+ Error=0;
+ }
+}
+
+int LoadKeysForTCEditor(char *name)
+{
+ loadedFile=newStr(name);
+ return KeyTrans.Load(name);
+}
+
+void LoadKeysForTCEditorFreeMemory()
+{
+ DeleteArray(loadedFile);
+}
+
+int SaveKeyBind(char *name)
+{
+ if (KeyTrans.Save(name))
+ return 1;
+ if (loadedFile)
+ {
+ if (strcmp(name,loadedFile)!=0)
+ ShowSavePoint(name);
+ DeleteArray(loadedFile);
+ loadedFile=0;
+ }
+ return 0;
+}
+
+int KeyBackToDefault(Boolean ask)
+{
+ // If the user is useing defaults let as-is
+ if (KeyTrans.getType()==kbtStatic)
+ return 0;
+
+ if (ask)
+ if (messageBox(__("You'll lose all the changes"),mfOKCancel)==cmCancel)
+ return 0;
+
+ KeyTrans.ChangeTable((KeyTTable *)((void *)&base));
+ return 1;
+}
+
+#ifdef TEST
+#include <stdio.h>
+
+int main(void)
+{
+ char b[100];
+/* unsigned i,c;
+
+ do
+ {
+ while (!TGKey::kbhit());
+ TGKey::gkey();
+ KeyTrans.get(TGKey::Abstract,TGKey::ascii);
+ }
+ while (TGKey::Abstract!=kbEsc);
+ KeyTrans.expand();
+
+ c=KeyTrans.getCount();
+ printf("Size: %u (%d)\n",KeyTrans.getLen(),c);
+ for (i=0; i<c; i++)
+ KeyTrans.getText(b,i,99);
+ printf("Deleting key 36\n");
+ KeyTrans.deleteKey(36);
+ c=KeyTrans.getCount();
+ printf("Size: %u (%d)\n",KeyTrans.getLen(),c);
+ for (i=0; i<c; i++)
+ KeyTrans.getText(b,i,99);
+
+ KeyTrans.compact();
+ printf("Size: %u\n",KeyTrans.getLen());
+ do
+ {
+ while (!TGKey::kbhit());
+ TGKey::gkey();
+ KeyTrans.get(TGKey::Abstract,TGKey::ascii);
+ }
+ while (TGKey::Abstract!=kbEsc);
+ */
+ printf("\n");
+ // A test sequence
+ TKeySeqCol tkc(4,5);
+ /*tkc.insert(kbCtQ); // 0
+ tkc.insert(kbI); // 1*/
+ tkc.insert(kbCtK); // 0
+ tkc.insert(kbA); // 1
+ tkc.insert(kbShT); // 1
+ tkc.insert(kbT); // 1
+
+ //tkc.getText(b,0,99);
+ //printf(b);
+ //printf("\n");
+
+ // A commands sequence
+ TComSeqCol tcc(3,5);
+ tcc.insert(cmcSelectOn);
+ tcc.insert(cmcLineUp);
+ tcc.insert(cmcSelectOff);
+ tcc.getText(b,0,99);
+ printf(b);
+ printf("\n");
+
+ KeyTrans.expand();
+ printf("Agrega retorna: %d",KeyTrans.addKey(&tkc,&tcc,kbtIsSeq));
+ printf("\n");
+ KeyTrans.compact();
+
+ // Now see if it's there
+ KeyTrans.get(kbCtK,0);
+ KeyTrans.get(kbA,0);
+ KeyTrans.get(kbShT,0);
+ KeyTrans.get(kbT,0);
+
+ do
+ {
+ while (!TGKey::kbhit());
+ TGKey::gkey();
+ KeyTrans.get(TGKey::Abstract,TGKey::ascii);
+ }
+ while (TGKey::Abstract!=kbEsc);
+
+ KeyTrans.Save("l:/pepe.dat");
+
+ return 0;
+}
+#endif
diff --git a/setedit/mainsrc/linelen.cc b/setedit/mainsrc/linelen.cc
new file mode 100644
index 0000000..bbb7d40
--- /dev/null
+++ b/setedit/mainsrc/linelen.cc
@@ -0,0 +1,104 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdlib.h>
+#include <stdio.h>
+#define Uses_string
+
+#define Uses_LineLengthArray
+#include <ceditor.h>
+
+/****************************************************************************
+
+ Class for a transparent and dynamic array used for the length of the
+ lines and for the syntax flags.
+
+****************************************************************************/
+
+const unsigned incElements=1020;
+
+LineLengthArray::LineLengthArray()
+{
+ elArray =(uint16 *)malloc(incElements*2);
+ elArrayAttr=(uint32 *)malloc(incElements*4);
+ if (!elArray || !elArrayAttr)
+ MaxPos=0;
+ else
+ MaxPos=incElements;
+ Length=0;
+}
+
+LineLengthArray::~LineLengthArray()
+{
+ if (elArray)
+ free(elArray);
+ if (elArrayAttr)
+ free(elArrayAttr);
+ elArrayAttr=0;
+ elArray=0;
+}
+
+void LineLengthArray::Resize(unsigned size)
+{
+ if ((elArray=elArray=(uint16 *)realloc(elArray,size*2))==0
+ || (elArrayAttr=(uint32 *)realloc(elArrayAttr,size*4))==0)
+ abort();
+ MaxPos=size;
+}
+
+void LineLengthArray::set(unsigned pos, uint16 val)
+{
+ if (pos<MaxPos)
+ {
+ elArray[pos]=val;
+ }
+ else
+ {
+ Resize((pos/incElements+1)*incElements);
+ elArray[pos]=val;
+ }
+ if (++pos>Length)
+ Length=pos;
+ return;
+}
+
+void LineLengthArray::setAttr(unsigned pos, uint32 attr)
+{
+ if (pos>=MaxPos)
+ set(pos,0);
+ elArrayAttr[pos]=attr;
+ return;
+}
+
+void LineLengthArray::setAll(unsigned pos, uint16 length, uint32 attr)
+{
+ set(pos,length);
+ elArrayAttr[pos]=attr;
+ return;
+}
+
+void LineLengthArray::insert(unsigned pos, uint16 val)
+{
+ if (Length>=MaxPos)
+ Resize(MaxPos+incElements);
+
+ memmove(&elArray[pos+1],&elArray[pos],(Length-pos)<<1);
+ memmove(&elArrayAttr[pos+1],&elArrayAttr[pos],(Length-pos)<<2);
+ Length++;
+ elArray[pos]=val;
+}
+
+void LineLengthArray::del(unsigned pos)
+{
+ memcpy(&elArray[pos],&elArray[pos+1],(Length-pos-1)<<1);
+ memcpy(&elArrayAttr[pos],&elArrayAttr[pos+1],(Length-pos-1)<<2);
+ Length--;
+}
+
+void LineLengthArray::deleteRange(unsigned from,unsigned to)
+{
+ unsigned count=to-from+1;
+ CLY_memcpy(&elArray[from],&elArray[to+1],(Length-from-count)<<1);
+ CLY_memcpy(&elArrayAttr[from],&elArrayAttr[to+1],(Length-from-count)<<2);
+ Length-=count;
+}
+
diff --git a/setedit/mainsrc/loaddefl.cc b/setedit/mainsrc/loaddefl.cc
new file mode 100644
index 0000000..2a5dcef
--- /dev/null
+++ b/setedit/mainsrc/loaddefl.cc
@@ -0,0 +1,727 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#define Uses_string
+#define Uses_ctype
+#define Uses_AllocLocal
+#define Uses_TSOSStringCollection
+#define Uses_TCEditor_External
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor
+#define Uses_TPoint
+#define Uses_TDialog
+#define Uses_TDialogAID
+#define Uses_TStringable
+#define Uses_TNoCaseStringCollection
+#define Uses_MsgBox
+
+#define Uses_TSSortedListBox
+#define Uses_TSButton
+#define Uses_TSHzGroup
+#define Uses_TSInputLine
+#define Uses_TSHzLabel
+#define Uses_TSLabelRadio
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#include <pathtool.h>
+#include <loadshl.h>
+#define Uses_SETAppVarious // EdReloadIfOpened
+#include <setapp.h>
+
+static const char *DefaultOptsFileName="deflopts.txt";
+static const char *noSHL="None";
+static const int maxDefaultOptLen=80+256;
+static const int stateLookingName=0,stateCollecting=1,stateExitLoop=2;
+static char *destFile=0;
+static unsigned localCtxHelp;
+static char warnSaveDifDir=1;
+static TNoCaseStringCollection *listSettings;
+
+static void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+typedef struct
+{
+ const char *name;
+ int len;
+ uint16 type;
+ uint32 mask;
+} setting;
+
+typedef struct
+{
+ setting st;
+ unsigned value;
+ char str[colMarkersStrLen+1];
+} editSetting;
+
+typedef struct
+{
+ TCollection *c;
+ ccIndex f;
+} boxCol;
+
+const uint32 tyFlag=0,tyInt=1,tyStr=2,loTabSize=1,loWrapCol=2,loIndentSize=3,loColArM=1;
+
+setting Settings[]=
+{
+{"AutoIndent", 10, tyFlag, loAutoIndent},
+{"ColMarkersArray", 15, tyStr, loColArM},
+{"ColumnMarkers", 13, tyFlag, loColumnMarkers},
+{"CrossCursorInCol", 16, tyFlag, loCrossCursorInCol},
+{"CrossCursorInRow", 16, tyFlag, loCrossCursorInRow},
+{"DontPurgeSpaces", 15, tyFlag, loDontPurgeSpaces},
+{"IndentSize", 10, tyInt, loIndentSize},
+{"IntelIndent", 11, tyFlag, loIntelIndent},
+{"NoInsideTabs", 12, tyFlag, loNoInsideTabs},
+{"OptimalFill", 11, tyFlag, loOptimalFill},
+{"Overwrite", 9, tyFlag, loOverwrite},
+{"PersistentBlocks", 16, tyFlag, loPersistentBlocks},
+{"SeeTabs", 7, tyFlag, loSeeTabs},
+{"ShowMatchPairFly", 16, tyFlag, loShowMatchPairFly},
+{"ShowMatchPair", 13, tyFlag, loShowMatchPair},
+{"TabIndents", 5, tyFlag, loTabIndents},
+{"TabSize", 7, tyInt, loTabSize},
+{"TransparentSel", 14, tyFlag, loTransparentSel},
+{"UseIndentSize", 13, tyFlag, loUseIndentSize},
+{"UseTabs", 7, tyFlag, loUseTabs},
+{"WrapCol", 7, tyInt, loWrapCol},
+{"WrapLine", 8, tyFlag, loWrapLine}
+};
+
+const int cantSettings=sizeof(Settings)/sizeof(setting);
+
+static
+void ParseIt(char *s, dflOptions *shl, int set)
+{
+ int i;
+ for (i=0; i<cantSettings; i++)
+ {
+ if (strncasecmp(Settings[i].name,s,Settings[i].len)==0)
+ break;
+ }
+ if (i==cantSettings)
+ return; // Not found, just ignore it
+ if (Settings[i].type==tyFlag)
+ {
+ if (set)
+ shl->setOpts|=Settings[i].mask;
+ else
+ shl->resetOpts&=~Settings[i].mask;
+ }
+ else if (Settings[i].type==tyInt)
+ {
+ s+=Settings[i].len;
+ // Some small parsing:
+ for (;*s!='=' && *s; s++);
+ if (!*s) return;
+ for (s++; ucisspace(*s) && *s; s++);
+ if (!*s) return;
+ int val=atoi(s);
+ if (val<=0) return;
+ switch (Settings[i].mask)
+ {
+ case loTabSize:
+ shl->tabSize=val;
+ break;
+ case loIndentSize:
+ shl->indentSize=val;
+ break;
+ case loWrapCol:
+ shl->wrapCol=val;
+ break;
+ }
+ }
+ else if (Settings[i].type==tyStr)
+ {
+ s+=Settings[i].len;
+ // Some small parsing:
+ for (;*s!='=' && *s; s++);
+ if (!*s) return;
+ for (s++; ucisspace(*s) && *s; s++);
+ if (!*s || *s!='"') return;
+ s++;
+ char *e;
+ for (e=s; *e && *e!='"'; e++);
+ if (*e!='"') return;
+ *e=0;
+
+ switch (Settings[i].mask)
+ {
+ case loColArM:
+ shl->colMarkers=TCEditor::Str2ColMarkers(s);
+ break;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads the default options in the shl array.
+
+***************************************************************************/
+
+void LoadDefaultOpts(strSHL *shl, int cant)
+{
+ // That's the first we should do.
+ for (int i=0; i<cant; i++)
+ {
+ shl[i].df.wrapCol=shl[i].df.tabSize=shl[i].df.setOpts=0;
+ shl[i].df.resetOpts=0xFFFFFFFF;
+ }
+
+ char *fileName=ExpandHome(DefaultOptsFileName);
+ FILE *f=fopen(fileName,"rt");
+ if (!f)
+ return;
+
+ char line[maxDefaultOptLen];
+ int id;
+ dflOptions *dflOps=0;
+
+ while (fgets(line,maxDefaultOptLen,f))
+ {
+ ReplaceCRby0(line);
+ switch (line[0])
+ {
+ case '.':
+ id=SHLNumberOf(line+1);
+ if (id>=0)
+ dflOps=&shl[id].df;
+ else
+ if (strcasecmp(line+1,noSHL)==0)
+ dflOps=&TCEditor::dflOps;
+ else
+ dflOps=0;
+ break;
+ case '+':
+ if (dflOps)
+ ParseIt(line+1,dflOps,1);
+ break;
+ case '-':
+ if (dflOps)
+ ParseIt(line+1,dflOps,0);
+ break;
+ }
+ }
+ fclose(f);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the name of the file (without path) for the user words file. Is
+just because the constant is local.
+
+ Return:
+ A pointer to the internal constant.
+
+***************************************************************************/
+
+const char *GetNameOfDefaultOptsFile()
+{
+ return DefaultOptsFileName;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Asks for a new user setting.
+
+ Return:
+ A newly allocated setting or 0 if the user aborted.
+
+***************************************************************************/
+
+static
+editSetting *EnterNewSetting()
+{
+ TDialog *d=CreateChooseDialog(40,8,__("Available"),10,24);
+ boxCol box={ listSettings, 0 };
+ if (execDialog(d,&box)!=cmOK)
+ return 0;
+
+ int sel=box.f;
+ // Search what index is it
+ char *name=(char *)listSettings->at(sel);
+ for (int i=0; i<cantSettings; i++)
+ if (name==Settings[i].name)
+ sel=i;
+
+ editSetting *ret;
+ if (Settings[sel].type==tyFlag)
+ {// Ask if is enable or disable.
+ TSViewCol *col=new TSViewCol(__("What to do"));
+ TSLabel *p=TSLabelRadio(__("Action"),__("~D~isable"),__("~E~nable"),0);
+ p->Flags|=wSpan;
+ col->insert(2,1,p);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt(); delete col;
+ d->options|=ofCentered; d->helpCtx=localCtxHelp;
+
+ uint32 ops=1;
+ if (execDialog(d,&ops)!=cmOK)
+ return 0;
+
+ ret=new editSetting;
+ ret->value=ops;
+ }
+ else if (Settings[sel].type==tyInt)
+ { // Ask the value
+ TSViewCol *col=new TSViewCol(__("Associated value"));
+ TSHzLabel *p=new TSHzLabel(__("Value:"),new TSInputLine(6));
+ p->Flags|=wSpan;
+ col->insert(2,2,p);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt(); delete col;
+ d->options|=ofCentered; d->helpCtx=localCtxHelp;
+
+ char val[6]="0";
+ if (execDialog(d,&val)!=cmOK)
+ return 0;
+ int value=atoi(val);
+ if (value<=0)
+ return 0;
+
+ ret=new editSetting;
+ ret->value=value;
+ }
+ else
+ { // Ask the value
+ TSViewCol *col=new TSViewCol(__("Associated string"));
+ TSHzLabel *p=new TSHzLabel(__("Value:"),new TSInputLine(256,30));
+ p->Flags|=wSpan;
+ col->insert(2,2,p);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt(); delete col;
+ d->options|=ofCentered; d->helpCtx=localCtxHelp;
+
+ char val[colMarkersStrLen]="";
+ if (execDialog(d,&val)!=cmOK || *val==0)
+ return 0;
+
+ ret=new editSetting;
+ strcpy(ret->str,val);
+ }
+ ret->st=Settings[sel];
+ return ret;
+}
+
+// Look at this
+class TSetting : public TStringCollection, public TStringable
+{
+public:
+ TSetting(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta),
+ TStringable() { };
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ void insert(uint32 mask, uint16 type, unsigned value, char *str=0);
+ void insert(editSetting *p) { TStringCollection::insert((void *)p); };
+ editSetting *at(ccIndex pos) { return (editSetting *)TStringCollection::at(pos); };
+ virtual int compare(void *s1,void *s2);
+ virtual void freeItem(void *item) { delete (editSetting *)item; };
+ ccIndex searchByName(char *s);
+};
+
+
+ccIndex TSetting::searchByName(char *s)
+{
+ ccIndex i;
+ for (i=0; i<count; i++)
+ {
+ if (strcasecmp(s,at(i)->st.name)==0)
+ return i;
+ }
+ return -1;
+}
+
+
+void TSetting::getText(char *dest, unsigned item, int maxLen)
+{
+ editSetting *s=at(item);
+ int l;
+ if (s->st.type==tyFlag)
+ l=s->st.len+3;
+ else
+ l=s->st.len+3+1+5;
+ AllocLocalStr(buf,l);
+ if (s->st.type==tyFlag)
+ sprintf(buf,"%c%s",s->value ? '+' : '-',s->st.name);
+ else if (s->st.type==tyInt)
+ sprintf(buf,"+%s=%d",s->st.name,s->value);
+ else
+ sprintf(buf,"+%s=\"%s\"",s->st.name,s->str);
+
+ strncpy(dest,buf,maxLen);
+ dest[maxLen]=EOS;
+}
+
+void TSetting::insert(uint32 mask, uint16 type, unsigned value, char *str)
+{
+ int i;
+ editSetting *s=0;
+
+ for (i=0; i<cantSettings; i++)
+ {
+ if (Settings[i].type==type && Settings[i].mask==mask)
+ {
+ s=new editSetting;
+ s->st=Settings[i];
+ if (str)
+ strcpy(s->str,str);
+ else
+ s->value=value;
+ break;
+ }
+ }
+ if (i==cantSettings)
+ return; // mask not found
+
+ TStringCollection::insert((void *)s);
+}
+
+int TSetting::compare(void *s1, void *s2)
+{
+ editSetting *v1=(editSetting *)s1,*v2=(editSetting *)s2;
+ int ret=strcasecmp(v1->st.name,v2->st.name);
+ if (!ret)
+ {
+ if (v1->st.type==tyStr)
+ return strcmp(v1->str,v2->str);
+ if (v1->value!=v2->value)
+ ret=v1->value<v2->value ? -1 : 1;
+ }
+ return ret;
+}
+
+static
+void WriteSettings(char *name, TSetting *col, FILE *f)
+{
+ char buf[maxDefaultOptLen];
+
+ fprintf(f,".%s\n",name);
+ int i,c=col->getCount();
+ for (i=0; i<c; i++)
+ {
+ col->getText(buf,i,maxDefaultOptLen-1);
+ fprintf(f,"%s\n",buf);
+ }
+ fprintf(f,"\n"); // Just to make it more readable
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Updates the user's word file deleting the old definitions and adding the
+new ones. The arguments are the name of the syntax hl and the list of user
+words.
+
+***************************************************************************/
+
+static
+void UpdateFile(char *name, TSetting *col)
+{
+ char *origFile=ExpandHome(DefaultOptsFileName);
+ FILE *dest,*ori;
+ int differentFile=0;
+ stEditorId idFile;
+
+ // Be sure the idFile is cleared
+ FillEditorId(&idFile);
+ if (edTestForFile(origFile))
+ {// We must use the values in this file
+ if (CompareFileNames(origFile,destFile))
+ {// We will overwrite the original
+ // We must identify the file before anything
+ FillEditorId(&idFile,origFile);
+ // Now backup it
+ char *bkpName=newStr(origFile);
+ ReplaceExtension(bkpName,TCEditor::backupExt,".txt");
+ rename(origFile,bkpName);
+ ori=fopen(bkpName,"rt");
+ delete[] bkpName;
+ }
+ else
+ {// Is OK we are creating another
+ ori=fopen(origFile,"rt");
+ differentFile=1;
+ }
+ if (!ori)
+ return;
+ dest=fopen(destFile,"wt");
+ if (!dest)
+ {
+ fclose(ori);
+ return;
+ }
+ // Put the edited values at the start of the file
+ WriteSettings(name,col,dest);
+ // Copy all but this definition
+ char line[maxDefaultOptLen];
+ int state=stateLookingName;
+
+ while (fgets(line,maxDefaultOptLen,ori))
+ {
+ ReplaceCRby0(line);
+ switch (state)
+ {
+ case stateLookingName:
+ if (line[0]=='.' && strcasecmp(name,line+1)==0)
+ state=stateCollecting;
+ else
+ fprintf(dest,"%s\n",line);
+ break;
+ case stateCollecting:
+ if (line[0]=='.' && strcasecmp(name,line+1)!=0)
+ {
+ state=stateLookingName;
+ fprintf(dest,"%s\n",line);
+ }
+ break;
+ }
+ }
+ fclose(ori);
+ if (differentFile && warnSaveDifDir)
+ {
+ ShowSavePoint(destFile);
+ warnSaveDifDir=0;
+ }
+ }
+ else
+ {// Just create a new one
+ dest=fopen(destFile,"wt");
+ WriteSettings(name,col,dest);
+ differentFile=1;
+ }
+ fclose(dest);
+ if (!differentFile)
+ EdReloadIfOpened(origFile,&idFile);
+}
+
+static TSetting *settingsCol;
+static int listChanged;
+
+static
+int DeleteSetting(int which)
+{
+ // Make it available to choose
+ editSetting *s=settingsCol->at(which);
+ ccIndex pos;
+ if (!listSettings->search((void *)s->st.name,pos))
+ listSettings->atInsert(pos,(void *)s->st.name);
+ // Remove from the list
+ settingsCol->atRemove(which);
+ listChanged++;
+ return 1;
+}
+
+static
+int AddSetting(void)
+{
+ editSetting *s=EnterNewSetting();
+ if (s)
+ {// Remove from the availables list
+ ccIndex pos;
+ if (listSettings->search((void *)s->st.name,pos))
+ listSettings->atRemove(pos);
+ // Remove from the list
+ settingsCol->insert(s);
+ listChanged++;
+ return 1;
+ }
+ return 0;
+}
+
+static
+int CancelConfirm(void)
+{
+ if (listChanged)
+ return messageBox(__("Do you want to discard the changes?"),mfWarning | mfYesButton | mfNoButton)==cmYes;
+ return 1;
+}
+
+static
+void EditList(dflOptions *ops, char *name)
+{
+ TDialogAID *d=CreateAddInsDelDialog(24,3,__("Settings"),12,30,aidOKEnabled);
+ TStringableListBoxRec box;
+ d->helpCtx=localCtxHelp;
+
+ // Expand the settings to a list
+ settingsCol=new TSetting(4,4);
+ uint32 mask=1;
+ for (; mask; mask<<=1)
+ {
+ if (ops->setOpts & mask)
+ settingsCol->insert(mask,tyFlag,1);
+ if (~ops->resetOpts & mask)
+ settingsCol->insert(mask,tyFlag,0);
+ }
+ if (ops->tabSize)
+ settingsCol->insert(loTabSize,tyInt,ops->tabSize);
+ if (ops->indentSize)
+ settingsCol->insert(loIndentSize,tyInt,ops->indentSize);
+ if (ops->wrapCol)
+ settingsCol->insert(loWrapCol,tyInt,ops->wrapCol);
+ if (ops->colMarkers)
+ {
+ char b[colMarkersStrLen];
+ TCEditor::ColMarkers2Str(ops->colMarkers,b,colMarkersStrLen);
+ settingsCol->insert(loColArM,tyStr,0,newStr(b));
+ }
+
+
+ // Create a list of settings to choose
+ listSettings=new TNoCaseStringCollection(cantSettings,1);
+ listSettings->setOwnerShip(False);
+ for (int i=0; i<cantSettings; i++)
+ {
+ char *s=(char *)Settings[i].name;
+ // Only if not already available
+ if (settingsCol->searchByName(s)<0)
+ listSettings->insert(s);
+ }
+
+ box.items=settingsCol;
+ box.selection=0;
+ d->DelAction=DeleteSetting;
+ d->AddAction=AddSetting;
+ d->CancelAction=CancelConfirm;
+
+ if (settingsCol->getCount()==0)
+ {
+ //TView::disableCommand(cmOKApply); All is ok
+ TView::disableCommand(cmDeleteKey);
+ }
+ listChanged=0;
+ int ret=execDialog(d,&box);
+ if (ret==cmOK && listChanged)
+ {// Compact the settings
+ int i,c=settingsCol->getCount();
+ ops->wrapCol=ops->tabSize=ops->setOpts=ops->indentSize=0;
+ ops->resetOpts=0xFFFFFFFF;
+ editSetting *st;
+ for (i=0; i<c; i++)
+ {
+ st=settingsCol->at(i);
+ if (st->st.type==tyFlag)
+ {
+ if (st->value)
+ ops->setOpts|=st->st.mask;
+ else
+ ops->resetOpts&=~st->st.mask;
+ }
+ else if (st->st.type==tyInt)
+ {
+ switch (st->st.mask)
+ {
+ case loTabSize:
+ ops->tabSize=st->value;
+ break;
+ case loIndentSize:
+ ops->indentSize=st->value;
+ break;
+ case loWrapCol:
+ ops->wrapCol=st->value;
+ break;
+ }
+ }
+ else
+ {
+ delete[] ops->colMarkers;
+ ops->colMarkers=TCEditor::Str2ColMarkers(st->str);
+ }
+ }
+ UpdateFile(name,settingsCol);
+ }
+ CLY_destroy(settingsCol);
+ CLY_destroy(listSettings);
+}
+
+class TDiaDO : public TDialog
+{
+public:
+ TDiaDO(void);
+ virtual void handleEvent(TEvent& event);
+ TSortedListBox *list;
+};
+
+TDiaDO::TDiaDO(void) :
+ TWindowInit(&TDiaDO::initFrame),
+ TDialog(TRect(1,1,1,1),__("Default global options"))
+{
+}
+
+void TDiaDO::handleEvent(TEvent& event)
+{
+ if (event.what==evCommand)
+ {
+ if (event.message.command==cmYes)
+ {
+ char *s=(char *)(TCEditor::SHLGenList->at(list->focused));
+ unsigned id=SHLNumberOf(s);
+ EditList(&TCEditor::SHLArray[id].df,s);
+ clearEvent(event);
+ }
+ else
+ if (event.message.command==cmNo)
+ {
+ EditList(&TCEditor::dflOps,(char *)noSHL);
+ clearEvent(event);
+ }
+ }
+ TDialog::handleEvent(event);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Entry point for the dialogs stuff of the default options. Call it passing
+the name of the destination file where the definitions will be stored.@p
+ You should specify the help context to be used for the dialogs.
+
+***************************************************************************/
+
+void TCEditDefaultOpts(char *destinationFile, unsigned ctxHelp)
+{
+ if (!TCEditor::SHLGenList)
+ return;
+
+ destFile=newStr(destinationFile);
+ localCtxHelp=ctxHelp;
+
+ TDiaDO *ddo=new TDiaDO();
+ TSViewCol *col=new TSViewCol(ddo);
+
+ #define VeSHLW 30
+ TSSortedListBox *ListaH=new TSSortedListBox(VeSHLW,12,tsslbVertical);
+ ddo->list=(TSortedListBox *)ListaH->view;
+ ListaH->Flags|=wSpan;
+
+ TSHzGroup *buts=new TSHzGroup(new TSButton(__("~E~dit"),cmYes,bfDefault),
+ new TSHzGroup(new TSButton(__("O~K~"),cmOK),
+ new TSButton(__("~N~o SHL"),cmNo)));
+
+ col->insert(2,1,ListaH);
+ col->insert(xTSCenter,yTSDown,buts);
+ col->doIt();
+ delete col;
+
+ ddo->helpCtx=localCtxHelp;
+ boxCol box={ TCEditor::SHLGenList, 0 };
+ execDialog(ddo,&box);
+
+ delete[] destFile;
+ destFile=0;
+}
diff --git a/setedit/mainsrc/loadfunc.cc b/setedit/mainsrc/loadfunc.cc
new file mode 100644
index 0000000..9010501
--- /dev/null
+++ b/setedit/mainsrc/loadfunc.cc
@@ -0,0 +1,165 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+//#define DEBUG
+#define Uses_string
+#define Uses_stdlib
+#define Uses_alloca
+#define Uses_ctype
+#define Uses_TVCodePage
+#define Uses_snprintf
+#ifdef DEBUG
+ #define Uses_MsgBox
+#endif
+#include <tv.h>
+
+#include <pathtool.h>
+
+int isValidForFile(char *c, char *start);
+extern void OpenFileFromEditor(char *fullName);
+
+#define NoFile() NoFileNameUnderCursor(Message,data)
+
+static
+void NoFileNameUnderCursor(void (*Message)(const char *msg, void *data),
+ void *data)
+{
+ const char *msg=TVIntl::getTextNew(__("No file name under cursor"));
+ Message(msg,data);
+ DeleteArray(msg);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Try to separate the name of the file under the cursor and pass it to the
+editor to load this file.
+
+ Return: True if loaded.
+
+***************************************************************************/
+
+Boolean LoadFileUnderCursor(char *lineStart, char *cursor, unsigned l,
+ void (*Message)(const char *msg, void *data),
+ void *data, const char *reference)
+{
+ char *end=lineStart+l;
+ char *startWord,*endWord,*name,*fullName;
+ int lname;
+
+ // eat all the white spaces at the start
+ for (;lineStart<end && ucisspace(*lineStart); lineStart++);
+ if (lineStart>=end)
+ {
+ NoFile();
+ return False;
+ }
+
+ if (strncmp(lineStart,"#include",8)==0)
+ { // Is #include, so is easy to parse
+ lineStart+=8;
+ // Search for " or <
+ for (;lineStart<end && *lineStart!='\"' && *lineStart!='<'; lineStart++);
+ for (lineStart++;lineStart<end && ucisspace(*lineStart); lineStart++);
+ if (lineStart>=end)
+ {
+ NoFile();
+ return False;
+ }
+ startWord=lineStart;
+ // Search for " or < or space
+ for (;lineStart<end && *lineStart!='\"' && *lineStart!='>' && !ucisspace(*lineStart); lineStart++);
+ if (lineStart>=end)
+ {
+ NoFile();
+ return False;
+ }
+ endWord=lineStart;
+ }
+ else
+ { // Nope, so make some thing like WordUnderCursor
+ if (isValidForFile(cursor,lineStart))
+ {
+ // Walk backward to the start of the name
+ for (;cursor>lineStart && isValidForFile(cursor,lineStart); --cursor);
+ if (cursor!=lineStart) cursor++;
+ }
+ else
+ {
+ // If isn't in a word walk forward
+ for (;cursor<end && !isValidForFile(cursor,lineStart); ++cursor);
+ if (!isValidForFile(cursor,lineStart))
+ {
+ NoFile();
+ return False;
+ }
+ }
+ startWord=cursor;
+ // Now forward to the end
+ for (;cursor<end && isValidForFile(cursor,lineStart); ++cursor);
+ endWord=cursor;
+ }
+ // Now we have a file name enclosed
+ lname=endWord-startWord;
+ if (!lname)
+ {
+ NoFile();
+ return False;
+ }
+ name=(char *)alloca(lname+1);
+ strncpy(name,startWord,lname);
+ name[lname]=0;
+ #ifdef DEBUG
+ messageBox(name,mfOKButton);
+ #endif
+
+ int result=FindFile(name,fullName,reference);
+ if (!result)
+ {// We failed, try changing slashes
+ char *s=name;
+ int changed=0;
+ for (; *s; s++)
+ if (*s=='\\')
+ {
+ *s='/';
+ changed++;
+ }
+ if (changed)
+ result=FindFile(name,fullName,reference);
+ }
+ if (result)
+ {
+ OpenFileFromEditor(fullName);
+ free(fullName);
+ return True;
+ }
+
+ // Generate a message indicating we couldn't load it
+ const char *msg=TVIntl::getTextNew(__("Can't find \"%s\" file"));
+ int len=strlen(msg)+lname+1;
+ char *msgF=(char *)alloca(len);
+ CLY_snprintf(msgF,len,msg,name);
+ Message(msgF,data);
+ DeleteArray(msg);
+
+ return False;
+}
+
+int isValidForFile(char *c, char *start)
+{
+ if (ucisspace(*c) || !ucisprint(*c) || *c=='\"' || *c=='>' || *c=='<' || *c=='|')
+ return 0;
+ #ifdef CLY_HaveDriveLetters
+ if (*c==':')
+ {
+ if (c==start) return 0;
+ if (!TVCodePage::isAlpha(c[-1])) return 0;
+ if (c==start-1) return 1;
+ uchar b=(uchar)c[-2];
+ return ucisspace(b) || !ucisprint(b) || b=='\"' || b=='>' || b=='<' || b=='|';
+ }
+ return 1;
+ #else
+ return *c!=':';
+ #endif
+}
+
diff --git a/setedit/mainsrc/loadshl.cc b/setedit/mainsrc/loadshl.cc
new file mode 100644
index 0000000..153827f
--- /dev/null
+++ b/setedit/mainsrc/loadshl.cc
@@ -0,0 +1,1469 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_stdio
+#define Uses_getline
+#define Uses_string
+#define Uses_ctype
+#define Uses_AllocLocal
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor_External
+#define Uses_TCEditor
+#define Uses_TVCodePage
+#define Uses_TNSCollection
+#define Uses_TDialog // edmsg.h
+#include <ceditor.h>
+#define Uses_TNLIndentCol
+#define Uses_TSHLErros
+#include <loadshl.h>
+#include <edspecs.h>
+#include <edmsg.h>
+
+#include <ced_pcre.h>
+#include <dyncat.h>
+
+static char *nameSHLFile;
+static PCREData shlPCRE={0,0};
+static TSHLErrors *Errors=NULL;
+
+ccIndex *ConvTable=0;
+
+static void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+static char *MoveAfterEqual(char *s)
+{
+ for (; *s && *s!='='; s++);
+ if (*s) s++;
+ for (; *s && ucisspace(*s); s++);
+ return s;
+}
+
+static void GetUpTo(int len, char *s, char *d, int &l)
+{
+ if (*s=='"')
+ {
+ for (s++,l=0; *s && *s!='\n' && *s!='\r' && *s!='"' && l<len; s++,l++)
+ {
+ if (*s=='\\' && *s && *s!='\n' && *s!='\r')
+ s++;
+ d[l]=*s;
+ }
+ return;
+ }
+ for (l=0; *s && *s!='\n' && *s!='\r' && l<len; s++,l++) d[l]=*s;
+}
+
+static void FillTableWith(unsigned char *s, ushort *t, int mask)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++) t[*s]|=mask;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts a syntax value (index in the syntax hl array) into an index in
+the alphabetic collection.
+
+***************************************************************************/
+
+ccIndex SHLConvValToPos(int a)
+{
+ if (!ConvTable) return a;
+ return ConvTable[a];
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts an index in the sorted collection of syntax hl names in a syntax
+value (index in the syntax hl array).
+
+***************************************************************************/
+
+int SHLConvPosToVal(ccIndex a)
+{
+ if (!ConvTable) return a;
+
+ int i=0;
+ while (ConvTable[i]!=a) i++;
+ return i;
+}
+
+static
+void PutInTables(int len, char *s, unsigned flag, ushort *Table, int Case)
+{
+ int i;
+
+ if (len)
+ {
+ if (!Case)
+ {
+ for (i=0; i<len; i++)
+ s[i]=TVCodePage::toUpper(s[i]);
+ Table[TVCodePage::toLower(*s)]|=flag;
+ }
+ Table[*s]|=flag;
+ }
+}
+
+static
+void CreateSearchTables(strSHL &hl)
+{
+ if (hl.Keywords)
+ SETSECreateTables(hl.Search,hl.Flags1 & FG1_CaseSensitive,hl.Keywords);
+ if (hl.UserWords)
+ SETSECreateTables(hl.SearchUserWords,hl.Flags1 & FG1_CaseSensitive,hl.UserWords);
+}
+
+static
+void GetKeywords(char *b, TStringCollection *&Keywords, int isCase)
+{
+ if (!Keywords)
+ Keywords=new TStringCollection(48,12);
+ char *pos=MoveAfterEqual(b), *s;
+ int end=0;
+ while (!end)
+ {
+ for (s=pos; *s && *s!='\n' && *s!='\r' && *s!=','; s++);
+ if (*s!=',')
+ end=1;
+ if (s!=pos)
+ {
+ *s=0;
+ char *t=newStr(pos);
+ if (!isCase)
+ strlwr(t); // Make sure they are lower case if the language is not
+ // case sensitive, the seachs assumes it
+ ccIndex curPos;
+ if (Keywords->search(t,curPos))
+ delete[] t;
+ else
+ Keywords->insert(t);
+ }
+ pos=s+1;
+ }
+}
+
+int LoadSyntaxHighLightKeywords(strSHL &hl)
+{
+ int loadIt=0,isCase=hl.Flags1 & FG1_CaseSensitive;
+ FILE *f;
+ ssize_t len;
+ size_t lenLine=0;
+ char *b=0;
+ char *pos;
+
+ if ((f=fopen(nameSHLFile,"rb"))==NULL)
+ return 1;
+
+ do
+ {
+ do
+ {
+ do
+ {
+ len=CLY_getline(&b,&lenLine,f);
+ }
+ while (len!=-1 && !feof(f) && (*b=='#' || ucisspace(*b)));
+
+ if (strncasecmp(b,"Name",4)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ if (strcasecmp(pos,hl.Name)==0)
+ loadIt=1;
+ }
+ else
+ if (strncasecmp(b,"Keywords",8)==0)
+ {// Only if that's the one to load
+ if (loadIt)
+ GetKeywords(b,hl.Keywords,isCase);
+ }
+ else
+ if (strncasecmp(b,"UserKeywords",12)==0)
+ {// Only if that's the one to load
+ if (loadIt)
+ GetKeywords(b,hl.UserWords,isCase);
+ }
+ }
+ while (!feof(f) && strncasecmp(b,"End",3)!=0);
+ }
+ while (!loadIt && !feof(f));
+ fclose(f);
+ free(b);
+ CreateSearchTables(hl);
+
+ return 0;
+}
+
+static
+void addStrToColl(const char *str, void *data)
+{
+ TNSCollection *args=(TNSCollection *)data;
+ args->insert((void *)str);
+}
+
+int ParseNLICond(TNSCollection *col, int from, NLIndent *p, int c)
+{
+ char *s=(char *)col->at(from);
+ if (*s==0)
+ p->cond[c]=nliAlways;
+ else
+ if (strcmp(s,"ParBalancePos")==0)
+ p->cond[c]=nliParBalancePos;
+ else
+ if (strcmp(s,"ParBalanceNeg")==0)
+ p->cond[c]=nliParBalanceNeg;
+ else
+ if (strcmp(s,"FirstWord")==0)
+ p->cond[c]=nliFirstWord;
+ else
+ if (strcmp(s,"NoLastChar")==0)
+ p->cond[c]=nliNoLastChar;
+ else
+ return 0;
+
+ s=(char *)col->at(from+1);
+ int l;
+ switch (p->cond[c])
+ {
+ case nliFirstWord:
+ if (!*s)
+ return 0;
+ l=strlen(s);
+ p->cArgStr[c]=newStrL(s,l);
+ p->cArgInt[c]=l;
+ break;
+ case nliNoLastChar:
+ l=strlen(s);
+ if (l!=1)
+ return 0;
+ p->cArgStr[c]=NULL;
+ p->cArgInt[c]=*s;
+ break;
+ default:
+ p->cArgStr[c]=NULL;
+ }
+
+ return 1;
+}
+
+int ParseNLIAction(TNSCollection *col, int from, NLIndent *p, int haveArg)
+{
+ char *s=(char *)col->at(from);
+ if (*s==0 || strcmp(s,"AutoIndent")==0)
+ {
+ p->action=nliAutoIndent;
+ if (!haveArg)
+ p->acArgInt=0;
+ else
+ p->acArgInt=atoi((char *)col->at(from+1));
+ }
+ else
+ if (strcmp(s,"Unindent")==0)
+ p->action=nliUnindent;
+ else
+ if (strcmp(s,"MoveAfterPar")==0)
+ p->action=nliMoveAfterPar;
+ else
+ {
+ //printf("?: <%s>\n",s);
+ return 0;
+ }
+
+ return 1;
+}
+
+int LoadSyntaxHighLightFile(char *name, strSHL *&hl, TStringCollection *list,int &Cant)
+{
+ FILE *f;
+ ssize_t len;
+ size_t lenLine=0;
+ char *b=0;
+ int defs,def,i,isCase,preLoad;
+ char *pos;
+
+ nameSHLFile=newStr(name);
+ Cant=0;
+ if ((f=fopen(name,"rb"))==NULL)
+ return 1;
+
+ // Meassure the number of definitions
+ for (defs=0; !feof(f); )
+ {
+ len=CLY_getline(&b,&lenLine,f);
+ if (len!=-1 && !feof(f) && strncasecmp(b,"End",3)==0)
+ defs++;
+ }
+
+ Cant=defs;
+ if (!defs)
+ {
+ free(b);
+ return 2;
+ }
+
+ // Allocate enough memory
+ hl=new strSHL[defs];
+ if (!hl)
+ {
+ free(b);
+ return 3;
+ }
+ memset(hl,0,sizeof(strSHL)*defs);
+ ConvTable=new ccIndex[defs];
+ if (!ConvTable)
+ {
+ free(b);
+ return 3;
+ }
+
+ PCREInitCompiler(shlPCRE);
+ // Load and parse all
+ rewind(f);
+ int nLine=0;
+ for (def=0; def<defs && !feof(f); def++)
+ {
+ hl[def].Keywords=0;
+ isCase=preLoad=0;
+ for (i=0; i<256; i++)
+ if (TVCodePage::isAlNum(i) || i=='_')
+ hl[def].SymbolT[i]|=shl_INSNAME | shl_BEGNAME;
+ do
+ {
+ do
+ {
+ len=CLY_getline(&b,&lenLine,f);
+ nLine++;
+ }
+ while (len!=-1 && *b=='#' || ucisspace(*b));
+
+ if (strncasecmp(b,"NameMatch",9)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ if (*pos)
+ hl[def].NameMatch=PCRECompileRegEx(pos,shlPCRE);
+ }
+ else
+ if (strncasecmp(b,"Preload",7)==0)
+ { // Preload the keywords
+ preLoad=1;
+ }
+ else
+ if (strncasecmp(b,"FullNameMatch",13)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ if (*pos)
+ hl[def].PathMatch=PCRECompileRegEx(pos,shlPCRE);
+ }
+ else
+ if (strncasecmp(b,"Name",4)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ char *s=newStr(pos);
+ hl[def].Name=s;
+ list->insert(s);
+ }
+ else
+ if (strncasecmp(b,"Files",5)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ hl[def].Extensions=newStr(pos);
+ }
+ else
+ if (strncasecmp(b,"EmacsModes",10)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ hl[def].EmacsModes=newStr(pos);
+ }
+ else
+ if (strncasecmp(b,"ShellScript",11)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ hl[def].ShellScript=newStr(pos);
+ }
+ else
+ if (strncasecmp(b,"OpenComment1",12)==0)
+ {
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].OpenCom1,hl[def].lOpenCom1);
+ PutInTables(hl[def].lOpenCom1,hl[def].OpenCom1,shl_OPC1,hl[def].SymbolT,isCase);
+ }
+ else
+ if (strncasecmp(b,"CloseComment1",13)==0)
+ {
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].CloseCom1,hl[def].lCloseCom1);
+ PutInTables(hl[def].lCloseCom1,hl[def].CloseCom1,shl_CLOSE1,hl[def].SymbolT,isCase);
+ }
+ else
+ if (strncasecmp(b,"OpenComment2",12)==0)
+ {
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].OpenCom2,hl[def].lOpenCom2);
+ PutInTables(hl[def].lOpenCom2,hl[def].OpenCom2,shl_OPC2,hl[def].SymbolT,isCase);
+ }
+ else
+ if (strncasecmp(b,"CloseComment2",13)==0)
+ {
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].CloseCom2,hl[def].lCloseCom2);
+ PutInTables(hl[def].lCloseCom2,hl[def].CloseCom2,shl_CLOSE2,hl[def].SymbolT,isCase);
+ }
+ else
+ if (strncasecmp(b,"EOLComment1",11)==0)
+ {
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].EOLCom1,hl[def].lEOLCom1);
+ PutInTables(hl[def].lEOLCom1,hl[def].EOLCom1,shl_EOL,hl[def].SymbolT,isCase);
+ }
+ else
+ if (strncasecmp(b,"EOLComment2",11)==0)
+ {
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].EOLCom2,hl[def].lEOLCom2);
+ PutInTables(hl[def].lEOLCom2,hl[def].EOLCom2,shl_EOL,hl[def].SymbolT,isCase);
+ }
+ else
+ if (strncasecmp(b,"HexMarker",9)==0)
+ {
+ int i_l;
+ pos=MoveAfterEqual(b);
+ GetUpTo(4,pos,hl[def].HexStart,hl[def].lHexStart);
+ if (!isCase)
+ for (i_l=0; i_l<4; i_l++)
+ hl[def].HexStart[i_l]=TVCodePage::toUpper(hl[def].HexStart[i_l]);
+ }
+ else
+ if (strncasecmp(b,"Symbols1",8)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_SYM1);
+ }
+ else
+ if (strncasecmp(b,"Symbols2",8)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_SYM2);
+ }
+ else
+ if (strncasecmp(b,"String1",7)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_STR1);
+ }
+ else
+ if (strncasecmp(b,"String2",7)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_STR2);
+ }
+ else
+ if (strncasecmp(b,"String3",7)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_STR3);
+ }
+ else
+ if (strncasecmp(b,"ShortString",11)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_CHAR);
+ }
+ else
+ if (strncasecmp(b,"EscapeAnywhere",14)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags2|=FG2_EscapeAnywhere;
+ }
+ else
+ if (strncasecmp(b,"Escape",6)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos && *pos!='\r' && *pos!='\n')
+ hl[def].Escape=*pos;
+ }
+ else
+ if (strncasecmp(b,"Preprocessor",12)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos && *pos!='\r' && *pos!='\n')
+ hl[def].Preprocessor=*pos;
+ }
+ else
+ if (strncasecmp(b,"Preprocessor2",12)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos && *pos!='\r' && *pos!='\n')
+ hl[def].Preprocessor2=*pos;
+ }
+ else
+ if (strncasecmp(b,"Case",4)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ {
+ isCase=1;
+ hl[def].Flags1|=FG1_CaseSensitive;
+ }
+ }
+ else
+ if (strncasecmp(b,"PartialKeywords",15)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ {
+ isCase=1;
+ hl[def].Flags1|=FG1_PartialKeyword;
+ }
+ }
+ else
+ if (strncasecmp(b,"RelaxNumberCheck",16)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags1|=FG1_RelaxNumbers;
+ }
+ else
+ if (strncasecmp(b,"UseInternal",11)==0)
+ {
+ int i=0;
+ pos=MoveAfterEqual(b);
+ i=atoi(pos); // Another bug in egcs 1.1.2, if I declare int i; before pos=.. thinks it can be used unitialized
+ if (i<0 || i>3)
+ i=0;
+ TCEditor::SHLTableUse[i]=def;
+ hl[def].UseInternal=i;
+ }
+ else
+ if (strncasecmp(b,"Keywords",8)==0)
+ {// If not preload just ignore them
+ if (preLoad)
+ GetKeywords(b,hl[def].Keywords,isCase);
+ }
+ else
+ if (strncasecmp(b,"UserKeywords",12)==0)
+ {// If not preload just ignore them
+ if (preLoad)
+ GetKeywords(b,hl[def].UserWords,isCase);
+ }
+ else
+ if (strncasecmp(b,"AllowedInsideNames",18)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_INSNAME);
+ }
+ else
+ if (strncasecmp(b,"CanStartAName",13)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_BEGNAME);
+ }
+ else
+ if (strncasecmp(b,"SpecialSymbolCont",17)==0)
+ {//Before SpecialSymbol or we will confuse it ;-)
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_SPC);
+ }
+ else
+ if (strncasecmp(b,"SpecialSymbol",13)==0)
+ {
+ pos=MoveAfterEqual(b);
+ FillTableWith((uchar *)pos,hl[def].SymbolT,shl_SP);
+ }
+ else
+ if (strncasecmp(b,"PMacros",7)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ hl[def].PMacros=newStr(pos);
+ }
+ else
+ if (strncasecmp(b,"NoCheckNumbers",14)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags1|=FG1_NoNumbers;
+ }
+ else
+ if (strncasecmp(b,"EOLCInFirstCol1",15)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags1|=FG1_EOLCInFirstCol1;
+ }
+ else
+ if (strncasecmp(b,"EOLCInFirstCol2",15)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags1|=FG1_EOLCInFirstCol2;
+ }
+ else
+ if (strncasecmp(b,"EOLCInFirstCol",14)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags1|=FG1_EOLCInFirstCol1 | FG1_EOLCInFirstCol2;
+ }
+ else
+ if (strncasecmp(b,"EOLCInFirstUse1",15)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags1|=FG1_EOLCInFirstUse1;
+ }
+ else
+ if (strncasecmp(b,"EOLCInFirstUse2",15)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags2|=FG2_EOLCInFirstUse2;
+ }
+ else
+ if (strncasecmp(b,"NLIndent",8)==0)
+ {// New Line Indentation rule
+ if (!hl[def].nlIndent)
+ hl[def].nlIndent=new TNLIndentCol();
+ NLIndent *p=new NLIndent();
+ int added=0;
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ TNSCollection *args=new TNSCollection(6,2);
+ int cargs=SplitStr(pos,0,",",addStrToColl,args);
+ if (cargs==5 || cargs==6)
+ {
+ if (ParseNLICond(args,0,p,0))
+ {
+ if (ParseNLICond(args,2,p,1))
+ {
+ if (ParseNLIAction(args,4,p,cargs-5))
+ {
+ hl[def].nlIndent->insert(p);
+ added=1;
+ }
+ else
+ SHLAddLoadError(__("Wrong action in NLIndent"),nLine);
+ }
+ else
+ SHLAddLoadError(__("Wrong second condition in NLIndent"),nLine);
+ }
+ else
+ SHLAddLoadError(__("Wrong first condition in NLIndent"),nLine);
+ }
+ else
+ SHLAddLoadError(__("Wrong number of arguments for NLIndent"),nLine);
+ delete args;
+ if (!added)
+ delete p;
+ }
+ else
+ if (strncasecmp(b,"VHDLNumbers",11)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags2|=FG2_VHDLNumbers;
+ }
+ else
+ if (strncasecmp(b,"VHDLStr1",8)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags2|=FG2_VHDLStr1;
+ }
+ else
+ if (strncasecmp(b,"VHDLStr2",8)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags2|=FG2_VHDLStr2;
+ }
+ else
+ if (strncasecmp(b,"VHDLShortStr",12)==0)
+ {
+ pos=MoveAfterEqual(b);
+ if (*pos=='1')
+ hl[def].Flags2|=FG2_VHDLShortStr;
+ }
+ }
+ while (!feof(f) && strncasecmp(b,"End",3)!=0);
+ }
+ fclose(f);
+ free(b);
+
+ PCREStopCompiler(shlPCRE);
+ for (def=0; def<defs; def++)
+ {
+ CreateSearchTables(hl[def]);
+ list->search(hl[def].Name,ConvTable[def]);
+ }
+ LoadDefaultOpts(hl,Cant);
+
+ return 0;
+}
+
+// That's just to deallocate all the memory allocated and owned by this module
+void UnLoadSyntaxHighLightFile(strSHL *&hl, TStringCollection *list, int &Cant)
+{
+ int i;
+
+ for (i=0; i<Cant; i++)
+ {// Collections
+ CLY_destroy(hl[i].PM);
+ CLY_destroy(hl[i].Keywords);
+ CLY_destroy(hl[i].UserWords);
+ // Various strings
+ delete[] hl[i].Extensions;
+ delete[] hl[i].EmacsModes;
+ delete[] hl[i].ShellScript;
+ delete[] hl[i].PMacros;
+ // Search tables
+ SETSEDeleteTables(hl[i].Search);
+ SETSEDeleteTables(hl[i].SearchUserWords);
+ // PCREs
+ free(hl[i].NameMatch);
+ free(hl[i].PathMatch);
+ // Indent
+ CLY_destroy(hl[i].nlIndent);
+ }
+ delete[] hl;
+ CLY_destroy(list);
+ Cant=0;
+ delete[] ConvTable;
+ ConvTable=0;
+ // PCRE compiler memory
+ PCREInitCompiler(shlPCRE);
+ delete[] nameSHLFile;
+}
+
+extern char *strncpyZ(char *dest, const char *orig, int size);
+
+static
+int TakeExtension(char *file, char *ext)
+{
+ char *s=file,*e=0,*e2=0;
+ int wasExt=0;
+
+ for (; *s; s++)
+ if (*s=='/' || *s=='\\')
+ wasExt=0;
+ else
+ if (*s=='.')
+ {
+ wasExt++;
+ e2=e;
+ e=s;
+ }
+
+ if (!wasExt)
+ return 0;
+
+ // If the extension contains gz and we have 2 extensions use the other
+ // it works nice with LFNs, SFNs have 1 extension
+ if (wasExt>1 && strstr(e,"gz"))
+ strncpyZ(ext,e2+1,min(MaxExtension,e-e2));
+ else
+ strncpyZ(ext,e+1,MaxExtension);
+ return 1;
+}
+
+static
+int TakeCommentLowLev(char *buffer, int l, char *ext, int *tab_width,
+ int *startCom, int *endCom, int *modeFound, int offset)
+{
+ int i;
+ char buf[MaxExtension];
+
+ if (l<7)
+ return 0;
+ l-=2;
+
+ char *s=buffer+offset;
+ int p1=-1,p2=-1;
+
+ for (i=0; i<l; i++)
+ {
+ if (s[i]=='-' && s[i+1]=='*' && s[i+2]=='-')
+ {
+ if (p1==-1)
+ {
+ p1=i;
+ i+=2;
+ }
+ else
+ if (p2==-1)
+ {
+ p2=i;
+ break;
+ }
+ }
+ }
+ if (p2==-1)
+ return 0;
+
+ if (startCom)
+ *startCom=p1+offset;
+ if (endCom)
+ *endCom=p2+offset;
+ for (p1+=3; ucisspace(s[p1]); p1++);
+ for (p2--; ucisspace(s[p2]); p2--);
+
+ l=p2-p1+2;
+ if (l<2)
+ return 1;
+
+ if (l>MaxExtension)
+ l=MaxExtension;
+
+ strncpyZ(ext,&s[p1],l);
+ strcpy(buf,ext);
+ //printf("Parsing comment: -*- %s -*-\n",buf);
+ // Make a little bit of parsing here
+ s=strstr(buf,"mode:");
+ if (s)
+ {
+ s+=5;
+ for (;*s && ucisspace(*s); s++);
+ char *end=s;
+ for (;*end && (TVCodePage::isAlNum(*end) || *end=='-'); end++);
+ *end=0;
+ strcpy(ext,s);
+ *end=';';
+ *modeFound=1;
+ }
+ if (tab_width)
+ {
+ s=strstr(buf,"tab-width:");
+ if (s)
+ {
+ s+=10;
+ for (;*s && ucisspace(*s); s++);
+ char *end;
+ int temp=strtol(s,&end,0);
+ if (temp>0 && temp<32) // Tabs>32 looks like an error, no?
+ *tab_width=temp;
+ }
+ }
+ return 1;
+}
+
+const int searchFromStart=1000, searchAtEnd=3000;
+
+/**[txh]********************************************************************
+
+ Description:
+ This function looks for the Emacs style variables in the provided
+@var{buffer}. The search is done upto the @var{lenBuf} offset. The content
+of the "mode" variable is returned in @var{ext} argument. If the
+@var{tab_width} argument is provided the content of the "tab-width" variable
+is stored there. Providing @var{startCom} and @var{endCom} you can get
+pointers to the beggining and the end of the comment.@*
+ Note that only the first 1 KB and last 3 KB of the buffer are analyzed.@*
+ This function have some high-level behavior and that's why is documented.
+If you don't pass the @var{startCom} and @var{endCom} they are NULL and in
+this case the function does a search looking for all instances of variable
+definitions, it doesn't stop after finding one definition. If the pointers
+are provided the function looks for a definition where at least "mode" is
+defined.
+
+ Return: 0 if not found.
+
+***************************************************************************/
+
+int TakeCommentEmacs(char *buffer, int lenBuf, char *ext, int *tab_width,
+ int *startCom, int *endCom)
+{
+ int len,start;
+
+ /* Don't borther with empty buffers */
+ if (!buffer || lenBuf<7)
+ return 0;
+
+ /* First 1Kb or available */
+ start=0;
+ len=searchFromStart;
+ if (lenBuf<len)
+ len=lenBuf;
+
+ int searchAll=startCom==NULL;
+ int found, lStart, lEnd, totalFound=0, modeFound=0;
+ if (searchAll)
+ {
+ startCom=&lStart;
+ endCom=&lEnd;
+ }
+
+ found=TakeCommentLowLev(buffer,len,ext,tab_width,startCom,endCom,&modeFound,0);
+ if (found)
+ {
+ if (!searchAll && modeFound)
+ return 1;
+ while (found && *endCom+3<len)
+ {
+ totalFound++;
+ *endCom+=3;
+ found=TakeCommentLowLev(buffer,len-*endCom,ext,tab_width,startCom,endCom,
+ &modeFound,*endCom);
+ if (found && !searchAll && modeFound)
+ return 1;
+ }
+ }
+
+ /* If we searched in all the buffer give up */
+ if (lenBuf<=searchFromStart)
+ return 0;
+
+ /* Last 3Kb or available */
+ start=lenBuf-searchAtEnd;
+ if (start<searchFromStart)
+ start=searchFromStart;
+ len=lenBuf-start;
+
+ found=TakeCommentLowLev(buffer,len,ext,tab_width,startCom,endCom,&modeFound,start);
+ if (found)
+ {
+ if (!searchAll && modeFound)
+ return 1;
+ while (found && *endCom+3<len)
+ {
+ totalFound++;
+ *endCom+=3;
+ found=TakeCommentLowLev(buffer,len-*endCom,ext,tab_width,startCom,endCom,
+ &modeFound,*endCom);
+ if (found && !searchAll && modeFound)
+ return 1;
+ }
+ }
+ if (!searchAll)
+ return 0;
+ return totalFound;
+}
+
+
+static
+int TakeLocalVarLowLev(char *buffer, int lenBuf, char *ext, int *tab_width)
+{
+ unsigned lv,mode,end,i,tabWidth;
+ char *s=buffer;
+
+ if (!buffer || lenBuf<25)
+ return 0;
+
+ // Search these magic words, quit if one isn't there, ensure they are in the right
+ // order
+ lv=TCEditor_iScan(s,lenBuf,"Local Variables:");
+ if (lv==sfSearchFailed)
+ return 0;
+
+ lenBuf-=lv;
+ s+=lv;
+ if (lenBuf<5)
+ return 0;
+ end=TCEditor_iScan(s,lenBuf,"End");
+ if (end==sfSearchFailed)
+ return 0;
+
+ if (tab_width)
+ {
+ tabWidth=TCEditor_iScan(s,end,"tab-width:");
+ if (tabWidth!=sfSearchFailed)
+ {
+ unsigned offset=tabWidth+10;
+ for (; offset<end && isspace(s[offset]); offset++);
+ if (offset<end && isdigit(s[offset]))
+ *tab_width=atoi(s+offset);
+ }
+ }
+
+ mode=TCEditor_iScan(s,end,"mode:");
+ if (mode==sfSearchFailed)
+ return 0;
+ s=buffer+lv+mode+5;
+ for (i=0; i<MaxExtension-1 && s[i]!='\n' && s[i]!='\r'; i++)
+ ext[i]=s[i];
+ ext[i]=0;
+ return 1;
+}
+
+static
+int TakeCommentLocalVars(char *buffer, int lenBuf, char *ext, int *tab_width)
+{
+ int start;
+
+ /* Last 3Kb or available */
+ start=lenBuf-searchAtEnd;
+ if (start<0)
+ start=0;
+
+ return TakeLocalVarLowLev(buffer+start,lenBuf-start,ext,tab_width);
+}
+
+static
+int TakeComment(char *buffer, int lenBuf, char *ext, int &tab_width)
+{
+ if (TakeCommentEmacs(buffer,lenBuf,ext,&tab_width))
+ return 1;
+ return TakeCommentLocalVars(buffer,lenBuf,ext,&tab_width);
+}
+
+static
+int TakeScriptPrg(char *buffer, int lenBuf, char *ext)
+{
+ // I assume it must start with #!
+ if (lenBuf<3 || *buffer!='#' || buffer[1]!='!')
+ return 0;
+ char *end=buffer+lenBuf;
+ *ext=0;
+ // Kill any space before the path (also /)
+ for (buffer+=2; buffer<end && (ucisspace(*buffer) || *buffer=='/'); buffer++);
+ int i;
+ do
+ {
+ if (*buffer=='/')
+ buffer++;
+ for (i=0; buffer<end && *buffer!='/' && *buffer!=' ' && CLY_IsntEOL(*buffer); buffer++)
+ if (i<MaxExtension-1)
+ ext[i++]=*buffer;
+ ext[i]=0;
+ if (strcmp(ext,"env")==0 && *buffer==' ')
+ {
+ for (; buffer<end && ucisspace(*buffer); buffer++);
+ i=-1;
+ }
+ }
+ while (*buffer=='/' || i==-1);
+ return *ext;
+}
+
+static
+int IsInList(char *list, char *val, int noCase=0)
+{
+ int l=strlen(list)+1;
+
+ AllocLocalStr(buf,l);
+ strcpy(buf,list); // Because strtok fucks the string
+
+ char *tok=strtok(buf,",");
+
+ if (noCase)
+ {
+ while (tok)
+ {
+ if (strcasecmp(tok,val)==0)
+ return 1;
+ tok=strtok(NULL,",");
+ }
+ }
+ else
+ {
+ while (tok)
+ {
+ if (strcmp(tok,val)==0)
+ return 1;
+ tok=strtok(NULL,",");
+ }
+ }
+ return 0;
+}
+
+const int extExtension=1, extEmacsModes=2, extShellScript=3;
+
+static
+int SearchSHLForIt(TCEditor &e, char *Extension, int &index, int type)
+{
+ char EnvName[MaxExtension+10];
+ const char *v;
+ int i;
+
+ if (Extension[0]==0)
+ return 0;
+ else
+ {
+ if (TCEditor::SHLGenList)
+ {// Search if the user overwritten the roules with an enviro. var.
+ strcpy(EnvName,"SET_SHL.");
+ strcat(EnvName,Extension);
+ if ((v=GetVariable(EnvName))!=NULL)
+ {
+ ccIndex posAlpha;
+ if (TCEditor::SHLGenList->search((void *)v,posAlpha))
+ {
+ index=SHLConvPosToVal(posAlpha);
+ return 1;
+ }
+ }
+ }
+ // User defined
+ for (i=0; i<e.SHLCant; i++)
+ {
+ switch (type)
+ {
+ case extExtension:
+ if (e.SHLArray[i].Extensions &&
+ IsInList(e.SHLArray[i].Extensions,Extension))
+ {
+ index=i;
+ return 1;
+ }
+ break;
+ case extEmacsModes:
+ if (e.SHLArray[i].EmacsModes &&
+ IsInList(e.SHLArray[i].EmacsModes,Extension,1))
+ {
+ index=i;
+ return 1;
+ }
+ break;
+ case extShellScript:
+ if (e.SHLArray[i].ShellScript &&
+ IsInList(e.SHLArray[i].ShellScript,Extension))
+ {
+ index=i;
+ return 1;
+ }
+ break;
+ }
+ }
+ }
+ return 0;
+}
+
+const int typeFullName=0,typeName=1;
+
+static
+int SearchByName(TCEditor &e, char *fileName, int &index, int type)
+{
+ char *name=fileName;
+ if (type==typeName)
+ {
+ char *name=strrchr(fileName,'/');
+ if (!name)
+ name=fileName;
+ else
+ name++;
+ }
+ int len=strlen(name),i;
+ for (i=0; i<e.SHLCant; i++)
+ {
+ pcre *regex=type==typeFullName ? e.SHLArray[i].PathMatch : e.SHLArray[i].NameMatch;
+ if (regex && PCREDoSearch(name,len,regex,shlPCRE))
+ {
+ index=i;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int SHLSelect(TCEditor &e, char *buffer, int lenBuf)
+{
+ int i,found=0,tab_width=-1;
+ char Extension[MaxExtension];
+ Extension[0] = 0; // this must be initialized !! (RH)
+
+ // In case the editor isn't locked is better to lock it to avoid multiple
+ // redraws, for example because a SHL change and a tab size change
+ e.lock();
+ int oldTab=e.tabSize;
+ e.SHLValueSelected=-1;
+ // First try using Emacs style syntax highlight methode
+ if (TakeComment(buffer,lenBuf,Extension,tab_width))
+ found=SearchSHLForIt(e,Extension,i,extEmacsModes);
+
+ // If not present then check if the file is a UNIX script
+ if (!found && TakeScriptPrg(buffer,lenBuf,Extension))
+ {
+ found=SearchSHLForIt(e,Extension,i,extShellScript);
+ if (!found)
+ {
+ char *s=Extension;
+ // Try without the numbers. Example: python2.2 => try python
+ for (; *s && !ucisdigit(*s); s++);
+ if (*s)
+ {
+ *s=0;
+ found=SearchSHLForIt(e,Extension,i,extShellScript);
+ }
+ }
+ }
+
+ // Try RegEx with the full name
+ if (!found)
+ found=SearchByName(e,e.fileName,i,typeFullName);
+
+ // Try RegEx with the name
+ if (!found)
+ found=SearchByName(e,e.fileName,i,typeName);
+
+ // If not present then try with the extension
+ if (!found)
+ {
+ TakeExtension(e.fileName,Extension);
+ found=SearchSHLForIt(e,Extension,i,extExtension);
+ }
+
+ dflOptions *dflOps;
+ if (found)
+ {
+ if (e.SHLArray[i].UseInternal)
+ e.SetHighlightTo((shlState)e.SHLArray[i].UseInternal);
+ else
+ e.SetHighlightTo(shlGenericSyntax,i);
+ e.SHLValueSelected=i;
+ dflOps=&e.SHLArray[i].df;
+ }
+ else
+ {
+ e.SetHighlightTo(shlNoSyntax);
+ dflOps=&e.dflOps;
+ }
+ // Transfer the default options
+ uint32 lo=e.CompactFlags();
+ lo&=dflOps->resetOpts;
+ lo|=dflOps->setOpts;
+ e.ExpandFlags(lo);
+ if (dflOps->tabSize)
+ {
+ e.tabSize=dflOps->tabSize;
+ e.update(ufView);
+ }
+ if (dflOps->indentSize)
+ e.indentSize=dflOps->indentSize;
+ if (dflOps->wrapCol)
+ e.WrapCol=dflOps->wrapCol;
+ if (dflOps->colMarkers)
+ {
+ delete[] e.colMarkers;
+ e.colMarkers=TCEditor::CopyColMarkers(dflOps->colMarkers);
+ }
+
+ if (tab_width>0 && tab_width!=oldTab)
+ {
+ e.tabSize=tab_width;
+ e.update(ufView);
+ }
+ e.unlock();
+
+ return found;
+}
+
+void SHLTransferDefaultsNewFile(TCEditor &e)
+{
+ dflOptions *dflOps=&e.dflOps;
+ uint32 lo=e.CompactFlags();
+ lo&=dflOps->resetOpts;
+ lo|=dflOps->setOpts;
+ e.ExpandFlags(lo);
+ if (dflOps->tabSize)
+ {
+ e.tabSize=dflOps->tabSize;
+ e.update(ufView);
+ }
+ if (dflOps->indentSize)
+ e.indentSize=dflOps->indentSize;
+ if (dflOps->wrapCol)
+ e.WrapCol=dflOps->wrapCol;
+}
+
+char *SHLNameOf(unsigned number)
+{
+ if (number<(unsigned)TCEditor::SHLCant)
+ return TCEditor::SHLArray[number].Name;
+ return "";
+}
+
+
+int SHLNumberOf(char *name)
+{
+ int i;
+
+ for (i=0; i<TCEditor::SHLCant; i++)
+ {
+ if (strcmp(TCEditor::SHLArray[i].Name,name)==0)
+ return i;
+ }
+ return -1;
+}
+
+char *SHLConstructEmacsModeComment(TCEditor &e, int &sizeSt, int &sizeEnd)
+{
+ int shl=e.SHLValueSelected;
+ if (shl<0 || shl>=e.SHLCant || !e.SHLArray[shl].EmacsModes)
+ return 0;
+
+ char *list=e.SHLArray[shl].EmacsModes;
+ char *tok=strtok(list,",");
+ if (!tok)
+ return 0;
+
+ int useEOL=e.SHLArray[shl].lEOLCom1!=0;
+ if (!useEOL && (!e.SHLArray[shl].lOpenCom1 || !e.SHLArray[shl].lCloseCom1))
+ return 0;
+
+ DynStrCatStruct cat;
+ if (useEOL)
+ {
+ DynStrCatInit(&cat,e.SHLArray[shl].EOLCom1,e.SHLArray[shl].lEOLCom1);
+ sizeSt=e.SHLArray[shl].lEOLCom1;
+ }
+ else
+ {
+ DynStrCatInit(&cat,e.SHLArray[shl].OpenCom1,e.SHLArray[shl].lOpenCom1);
+ sizeSt=e.SHLArray[shl].lOpenCom1;
+ }
+ DynStrCat(&cat," -""*- mode:");
+ DynStrCat(&cat,tok);
+ char buf[32];
+ int l=sprintf(buf,"; tab-width: %d -""*-",e.tabSize);
+ DynStrCat(&cat,buf,l);
+ if (useEOL)
+ sizeEnd=0;
+ else
+ {
+ DynStrCat(&cat," ",1);
+ sizeEnd=e.SHLArray[shl].lCloseCom1+1;
+ DynStrCat(&cat,e.SHLArray[shl].CloseCom1,e.SHLArray[shl].lCloseCom1);
+ }
+ DynStrCat(&cat,(char *)CLY_crlf);
+
+ return cat.str;
+}
+
+PMacroStr *SHLSearchPMTrigger(char *trg);
+
+/************************ Regular expressions file matching stuff *******************/
+/**[txh]********************************************************************
+
+ Description:
+ Initialize the matchs array to 0. Called before starting to compile the
+expressions.
+
+***************************************************************************/
+
+void PCREInitCompiler(PCREData &p)
+{
+ if (!SUP_PCRE)
+ return;
+ p.PCREMaxMatchs=0;
+ DeleteArray(p.PCREMatchs);
+ p.PCREMatchs=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Allocates memory for the matchs array. Called after compiling all the
+expressions and before executing any of them.
+
+***************************************************************************/
+
+void PCREStopCompiler(PCREData &p)
+{
+ if (!SUP_PCRE)
+ return;
+ p.PCREMatchs=new int[p.PCREMaxMatchs];
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Compiles a RegEx.
+
+ Return: A pointer to the compiled RegEx or 0 if error.
+
+***************************************************************************/
+
+pcre *PCRECompileRegEx(char *text, PCREData &p)
+{
+ if (!SUP_PCRE)
+ return NULL;
+ const char *error;
+ int errorOffset;
+ pcre *ret=pcre_compile(text,0,&error,&errorOffset,0);
+ if (!ret)
+ return NULL;
+
+ int matchs=(pcre_info(ret,0,0)+1)*3;
+ if (matchs>p.PCREMaxMatchs)
+ p.PCREMaxMatchs=matchs;
+
+ return ret;
+}
+
+int PCREDoSearch(char *search, int len, pcre *CompiledPCRE, PCREData &p)
+{
+ if (!SUP_PCRE)
+ return 0;
+ p.PCREHits=pcre_exec(CompiledPCRE,0,search,len,PCRE206 0,p.PCREMatchs,p.PCREMaxMatchs);
+
+ return p.PCREHits>0;
+}
+
+void PCREGetMatch(int match, int &offset, int &len, PCREData &p)
+{
+ if (!SUP_PCRE || match<0 || match>=p.PCREHits)
+ {
+ offset=-1; len=0;
+ return;
+ }
+ offset=p.PCREMatchs[match*2];
+ int end=p.PCREMatchs[match*2+1];
+ len=end-offset;
+}
+/********************** End Regular expressions file matching stuff *****************/
+
+void TNLIndentCol::freeItem(void *item)
+{
+ NLIndent *st=(NLIndent *)item;
+ delete st;
+}
+
+void TSHLErrors::freeItem(void *item)
+{
+ SHLError *st=(SHLError *)item;
+ delete st;
+}
+
+static
+void AddErrorToMsgBox(void *item, void *)
+{
+ SHLError *p=(SHLError *)item;
+ char *aux=TVIntl::getTextNew(p->str);
+ FileInfo fI;
+ fI.Line=p->line;
+ fI.Column=1;
+ fI.offset=0;
+ fI.len=strlen(aux);
+ EdShowMessageFile(aux,fI,nameSHLFile);
+ DeleteArray(aux);
+}
+
+void ShowSHLLoadErrors()
+{
+ if (Errors)
+ {
+ EdShowMessageI(__("Errors while loading syntax highlight file"),(unsigned)0);
+ Errors->forEach(AddErrorToMsgBox,NULL);
+ destroy0(Errors);
+ }
+}
+
+void SHLAddLoadError(const char *error, int line)
+{
+ if (!Errors)
+ Errors=new TSHLErrors();
+ Errors->insert(new SHLError(error,line));
+ //printf("%s %d\n",error,line);
+}
+
diff --git a/setedit/mainsrc/loadusew.cc b/setedit/mainsrc/loadusew.cc
new file mode 100644
index 0000000..dd3eedd
--- /dev/null
+++ b/setedit/mainsrc/loadusew.cc
@@ -0,0 +1,412 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#define Uses_string
+
+#define Uses_TSOSStringCollection
+#define Uses_TCEditor_External
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor
+#define Uses_TPoint
+#define Uses_TDialog
+#define Uses_TDialogAID
+#define Uses_TStringable
+
+#define Uses_TSSortedListBox
+#define Uses_TSButton
+#define Uses_TSHzGroup
+#define Uses_TSInputLine
+#define Uses_TSHzLabel
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#include <pathtool.h>
+#include <loadshl.h>
+#define Uses_SETAppVarious // EdReloadIfOpened
+#include <setapp.h>
+
+static const char *UserWordsFileName="userword.txt";
+static const int maxUserWordLen=80;
+static const int stateLookingName=0,stateCollecting=1,stateExitLoop=2;
+static char *destFile=0;
+static unsigned localCtxHelp;
+static char warnSaveDifDir=1;
+
+static void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads the user words for the desired syntax hl. The ExpandFileName... hook
+is used to find the file containing the words. The routine marks the
+FG1_UserWordsTried flag even if didn't succeed.
+
+***************************************************************************/
+
+void LoadUserWords(strSHL *s, int id)
+{
+ // Mark are already tried
+ s->Flags1|=FG1_UserWordsTried;
+
+ char *fileName=ExpandHome(UserWordsFileName);
+ FILE *f=fopen(fileName,"rt");
+ if (!f)
+ return;
+ char *name=SHLNameOf(id);
+ char line[maxUserWordLen];
+ int state=stateLookingName;
+ TStringCollection *col=0;
+
+ while (fgets(line,maxUserWordLen,f) && state!=stateExitLoop)
+ {
+ ReplaceCRby0(line);
+ switch (state)
+ {
+ case stateLookingName:
+ if (line[0]=='.' && strcasecmp(name,line+1)==0)
+ {
+ state=stateCollecting;
+ // Delete any value from the SHL file.
+ destroy0(s->UserWords);
+ delete[] s->SearchUserWords.firstLetters;
+ // New collection
+ s->UserWords=col=new TStringCollection(12,6);
+ }
+ break;
+ case stateCollecting:
+ if (line[0]=='.')
+ state=stateExitLoop;
+ else
+ if (line[0]=='+')
+ col->insert(newStr(line+1));
+ break;
+ }
+ }
+ fclose(f);
+
+ if (col)
+ SETSECreateTables(s->SearchUserWords,s->Flags1 & FG1_CaseSensitive,col);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the name of the file (without path) for the user words file. Is
+just because the constant is local.
+
+ Return:
+ A pointer to the internal constant.
+
+***************************************************************************/
+
+const char *GetNameOfUserWordsFile()
+{
+ return UserWordsFileName;
+}
+
+static
+void WriteWords(char *name, TStringCollection *col, FILE *f)
+{
+ fprintf(f,".%s\n",name);
+ int i,c=col->getCount();
+ for (i=0; i<c; i++)
+ fprintf(f,"+%s\n",(char *)col->at(i));
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Updates the user's word file deleting the old definitions and adding the
+new ones. The arguments are the name of the syntax hl and the list of user
+words.
+
+***************************************************************************/
+
+static
+void UpdateFile(char *name, TStringCollection *col)
+{
+ char *origFile=ExpandHome(UserWordsFileName);
+ FILE *dest,*ori;
+ int differentFile=0;
+ stEditorId idFile;
+
+ // Be sure the idFile is cleared
+ FillEditorId(&idFile);
+ if (edTestForFile(origFile))
+ {// We must use the values in this file
+ if (CompareFileNames(origFile,destFile))
+ {// We will overwrite the original
+ // We must identify the file before anything
+ FillEditorId(&idFile,origFile);
+ // Now backup it
+ char *bkpName=newStr(origFile);
+ ReplaceExtension(bkpName,TCEditor::backupExt,".txt");
+ rename(origFile,bkpName);
+ ori=fopen(bkpName,"rt");
+ delete[] bkpName;
+ }
+ else
+ {// Is OK we are creating another
+ ori=fopen(origFile,"rt");
+ differentFile=1;
+ }
+ if (!ori)
+ return;
+ dest=fopen(destFile,"wt");
+ if (!dest)
+ {
+ fclose(ori);
+ return;
+ }
+ // Put the edited values at the start of the file
+ WriteWords(name,col,dest);
+ // Copy all but this definition
+ char line[maxUserWordLen];
+ int state=stateLookingName;
+
+ while (fgets(line,maxUserWordLen,ori))
+ {
+ ReplaceCRby0(line);
+ switch (state)
+ {
+ case stateLookingName:
+ if (line[0]=='.' && strcasecmp(name,line+1)==0)
+ state=stateCollecting;
+ else
+ fprintf(dest,"%s\n",line);
+ break;
+ case stateCollecting:
+ if (line[0]=='.' && strcasecmp(name,line+1)!=0)
+ {
+ state=stateLookingName;
+ fprintf(dest,"%s\n",line);
+ }
+ break;
+ }
+ }
+ fclose(ori);
+ if (differentFile && warnSaveDifDir)
+ {
+ ShowSavePoint(destFile);
+ warnSaveDifDir=0;
+ }
+ }
+ else
+ {// Just create a new one
+ dest=fopen(destFile,"wt");
+ WriteWords(name,col,dest);
+ differentFile=1;
+ }
+ fclose(dest);
+ if (!differentFile)
+ EdReloadIfOpened(origFile,&idFile);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Asks for a new user word.
+
+ Return:
+ A newly allocated word or 0 if the user aborted or didn't enter anything.
+
+***************************************************************************/
+
+static
+char *EnterNewWord()
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("New user word")));
+
+ TSHzLabel *lineLabel=new TSHzLabel(__("Word:"),new TSInputLine(80,20));
+
+ col->insert(2,2,lineLabel);
+ EasyInsertOKCancel(col,3);
+
+ TDialog *d=col->doIt();
+ delete col;
+
+ d->options|=ofCentered;
+ d->helpCtx=localCtxHelp;
+ char word[80];
+ word[0]=0;
+
+ if (execDialog(d,word)==cmOK && *word)
+ return newStr(word);
+
+ return 0;
+}
+
+// Simple class for a stringable string, I need it to use TDialogAID
+class TStrStringable : public TStringCollection, public TStringable
+{
+public:
+ TStrStringable(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta),
+ TStringable() { };
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ void insert(char *str) { TStringCollection::insert((void *)str); };
+ char *at(ccIndex pos) { return (char *)TStringCollection::at(pos); };
+};
+
+void TStrStringable::getText(char *dest, unsigned item, int maxLen)
+{
+ char *s=at(item);
+ strncpy(dest,s,maxLen);
+ dest[maxLen]=EOS;
+}
+
+static TStrStringable *listCopy;
+static int listChanged;
+
+static
+int DeleteWord(int wich)
+{
+ listCopy->atRemove(wich);
+ listChanged++;
+ return 1;
+}
+
+static
+int AddNewWord(void)
+{
+ char *s=EnterNewWord();
+ if (s)
+ {
+ listChanged++;
+ listCopy->insert(s);
+ return 1;
+ }
+ return 0;
+}
+
+static
+void EditList(char *name)
+{
+ int id=SHLNumberOf(name);
+
+ strSHL *s=&TCEditor::SHLArray[id];
+ // If the user words aren't loaded do it now
+ if (!(s->Flags1 & FG1_UserWordsTried))
+ LoadUserWords(s,id);
+
+
+ TDialogAID *d=CreateAddInsDelDialog(35,3,__("List of words"),12,30,aidOKEnabled);
+ TStringableListBoxRec box;
+ d->helpCtx=localCtxHelp;
+
+ // Make a copy to edit
+ int i;
+ TStringCollection *col=s->UserWords;
+ listCopy=new TStrStringable(col ? col->getCount() : 4,6);
+ if (col)
+ for (i=0; i<col->getCount(); i++)
+ listCopy->insert(newStr((char *)col->at(i)));
+
+ box.items=listCopy;
+ box.selection=0;
+ d->DelAction=DeleteWord;
+ d->AddAction=AddNewWord;
+
+ if (listCopy->getCount()==0)
+ {
+ //TView::disableCommand(cmOKApply);
+ TView::disableCommand(cmDeleteKey);
+ }
+ listChanged=0;
+ int ret=execDialog(d,&box);
+ if (ret==cmOK && listChanged)
+ {// Destroy the previous words
+ CLY_destroy(col);
+ delete[] s->SearchUserWords.firstLetters;
+ // Create a new one
+ col=new TStringCollection(listCopy->getCount(),6);
+ for (i=0; i<listCopy->getCount(); i++)
+ col->insert(newStr(listCopy->at(i)));
+ s->UserWords=col;
+ SETSECreateTables(s->SearchUserWords,s->Flags1 & FG1_CaseSensitive,col);
+ // Force a cache reload
+ TCEditor::InvalidateSHLCache();
+ UpdateFile(name,col);
+ }
+ CLY_destroy(listCopy);
+}
+
+class TDiaUW : public TDialog
+{
+public:
+ TDiaUW(void);
+ virtual void handleEvent(TEvent& event);
+ TSortedListBox *list;
+};
+
+TDiaUW::TDiaUW(void) :
+ TWindowInit(&TDiaUW::initFrame),
+ TDialog(TRect(3,2,1,1),__("User words"))
+{
+}
+
+void TDiaUW::handleEvent(TEvent& event)
+{
+ if (event.what==evCommand && event.message.command==cmYes)
+ {
+ EditList((char *)(TCEditor::SHLGenList->at(list->focused)));
+ clearEvent(event);
+ }
+ TDialog::handleEvent(event);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Entry point for the dialogs stuff of the user's words. Call it passing the
+name of the destination file where the definitions will be stored.@p
+ You should specify the help context to be used for the dialogs.
+
+***************************************************************************/
+
+void TCEditUserWords(char *destinationFile, unsigned ctxHelp)
+{
+ if (!TCEditor::SHLGenList)
+ return;
+
+ destFile=newStr(destinationFile);
+ localCtxHelp=ctxHelp;
+ TDiaUW *duw=new TDiaUW();
+ TSViewCol *col=new TSViewCol(duw);
+
+ #define VeSHLW 30
+ TSSortedListBox *ListaH=new TSSortedListBox(VeSHLW,12,tsslbVertical);
+ duw->list=(TSortedListBox *)ListaH->view;
+
+ TSHzGroup *buts=new TSHzGroup(new TSButton(__("~E~dit"),cmYes,bfDefault),
+ new TSButton(__("O~K~"),cmOK));
+
+ col->insert(2,1,ListaH);
+ col->insert(xTSCenter,yTSDown,buts);
+ col->doIt();
+ delete col;
+
+ duw->helpCtx=localCtxHelp;
+ struct
+ {
+ TCollection *c;
+ ccIndex f;
+ } box;
+ box.c=TCEditor::SHLGenList;
+ box.f=0;
+ execDialog(duw,&box);
+
+ delete[] destFile;
+ destFile=0;
+}
diff --git a/setedit/mainsrc/macrocom.cc b/setedit/mainsrc/macrocom.cc
new file mode 100644
index 0000000..2a85f22
--- /dev/null
+++ b/setedit/mainsrc/macrocom.cc
@@ -0,0 +1,120 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This module is used to translate commands to macros. This technique is
+used by the menu. As the TVision menu classes can't trigger a macro this
+routine allocates a range of values and translate the command into a macro.@p
+ Needs: isAnEditor, SLPSearchMacro.
+
+***************************************************************************/
+
+#define Uses_TStringCollection
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TCEditWindow
+#define Uses_TCEditor
+#include <ceditor.h>
+#include <slpinter.h>
+#define Uses_SETAppVarious
+#include <setapp.h>
+
+typedef struct
+{
+ unsigned command;
+ char *macro;
+} stCommToMacro;
+
+const unsigned cmmBase=0x2600;
+
+class TCommToMacroCol : public TStringCollection
+{
+public:
+ TCommToMacroCol() : TStringCollection(5,4) {};
+ virtual int compare(void *key1, void *key2);
+ virtual void *keyOf(void *item) { return (void *)(long)(((stCommToMacro *)item)->command); };
+ virtual void freeItem( void *item );
+};
+
+int TCommToMacroCol::compare(void *key1, void *key2)
+{
+ return (unsigned long)key1-(unsigned long)key2;
+}
+
+void TCommToMacroCol::freeItem(void *item)
+{
+ stCommToMacro *p=(stCommToMacro *)item;
+ delete[] p->macro;
+ delete p;
+}
+
+static unsigned LastUsed=cmmBase-1;
+static TCommToMacroCol *List=0;
+
+char *TranslateCommandToMacro(unsigned command)
+{
+ if (!List || !(command>=cmmBase && command<=LastUsed))
+ return 0;
+
+ ccIndex pos;
+ if (!List->search((void *)(unsigned long)command,pos))
+ return 0;
+
+ return ((stCommToMacro *)(List->at(pos)))->macro;
+}
+
+
+int RegisterMacroCommand(char *name)
+{
+ if (!List)
+ List=new TCommToMacroCol();
+ if (!List)
+ return -1;
+
+ stCommToMacro *entry=new stCommToMacro;
+ entry->command=++LastUsed;
+ entry->macro=newStr(name);
+
+ List->insert(entry);
+ return (int)LastUsed;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Unregisters all the macro commands. Just to free the allocated memory.
+Called by menuload.cc.
+
+***************************************************************************/
+
+void UnRegisterMacroCommands(void)
+{
+ CLY_destroy(List);
+ List=0;
+}
+
+
+int isAMacroInMenu(unsigned command)
+{
+ TCEditor *target;
+ TView *p;
+
+ char *s=TranslateCommandToMacro(command);
+ if (!s)
+ return 0;
+
+ p=TApplication::deskTop->current;
+ if (!p || !IsAnEditor(p))
+ {
+ target=TCEditor::clipboard;
+ if (!target)
+ return 0;
+ }
+ else
+ target=((TCEditWindow *)p)->editor;
+
+ SLPSearchMacro(target,s,False);
+ return 1;
+}
+
diff --git a/setedit/mainsrc/pathtool.cc b/setedit/mainsrc/pathtool.cc
new file mode 100644
index 0000000..bc90483
--- /dev/null
+++ b/setedit/mainsrc/pathtool.cc
@@ -0,0 +1,880 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#define Uses_sys_stat
+#define Uses_string
+#define Uses_fnmatch
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_limits
+#define Uses_fcntl
+#define Uses_mkstemp
+#define Uses_dirent
+#define Uses_stdio
+#define Uses_getcwd
+#define Uses_HaveLFNs
+#ifdef SECompf_djgpp
+#include <io.h> // _chmod
+#include <dpmi.h> // GetShortNameOf: dpmi_regs, dpmi_int
+#include <go32.h> // GetShortNameOf: transfer buffer
+#endif
+#ifdef TVComp_BCPP
+#include <io.h>
+#endif
+#define Uses_TScreen
+#define Uses_TStringCollectionW
+#include <settvuti.h>
+#include <rhutils.h>
+#include <pathtool.h>
+#include <pathlist.h>
+#include <edspecs.h>
+
+// Get HIDDEN_DIFFERENT, it should be moved to CLY
+#define Uses_SETAppFiles
+#define Uses_SETAppProject
+#include <setapp.h>
+
+#ifdef SEOS_Win32
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #ifndef SECompf_Cygwin
+ #define getuid()
+ #define getgid()
+ #define chown(file,uid,gid)
+ #endif
+#endif
+
+static char PathOrig[PATH_MAX];
+static char *PathOrigPos;
+
+#if !defined(NoHomeOrientedOS) || defined(STANDALONE)
+static char FileNameToLoad[PATH_MAX];
+#endif
+
+int IsADirectory(const char *name);
+
+int edTestForFile(const char *name, struct stat &st)
+{
+ if (stat(name,&st)==0)
+ return S_ISREG(st.st_mode);
+ return 0;
+}
+
+int edTestForFile(const char *name)
+{
+ struct stat st;
+ return edTestForFile(name,st);
+}
+
+char *GetHome(void)
+{
+ char *s=getenv("HOME");
+ if (!s)
+ {
+ s=getenv("HOMEDIR");
+ if (!s)
+ s=".";
+ }
+ return s;
+}
+
+#ifdef NoHomeOrientedOS
+char *ExpandHomeSave(const char *s)
+{
+ return ExpandHome(s);
+}
+#else
+static
+char *ExpandHomeWDir(const char *s, int hidden=0)
+{
+ static int HiddenDirFailed=0;
+ char *h=GetHome();
+ if (!HiddenDirFailed)
+ {// Check ~/.setedit/
+ strcpy(FileNameToLoad,h);
+ strcat(FileNameToLoad,"/.setedit");
+ if (!IsADirectory(FileNameToLoad))
+ {// No? try to create it. 0750 mode
+ if (mkdir(FileNameToLoad,S_IRWXU | S_IRGRP | S_IXGRP)==-1)
+ {// Oops! something went wrong
+ HiddenDirFailed=1;
+ }
+ else
+ {// We are in the start-up so we could be SUID yet
+ chown(FileNameToLoad,getuid(),getgid());
+ }
+ }
+ if (!HiddenDirFailed)
+ {// Ok see if we can write
+ if (access(FileNameToLoad,W_OK)==0)
+ {
+ strcat(FileNameToLoad,"/");
+ if (hidden) strcat(FileNameToLoad,".");
+ strcat(FileNameToLoad,s);
+ return FileNameToLoad;
+ }
+ // No write access?!
+ HiddenDirFailed=1;
+ }
+ }
+ return 0;
+}
+
+static
+char *ExpandHomeCommon(const char *s)
+{
+ strcpy(FileNameToLoad,GetHome());
+ strcat(FileNameToLoad,"/.");
+ strcat(FileNameToLoad,s);
+ return FileNameToLoad;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This funtion returns a suitable place to write configuration files. Note
+it doesn't have to be the same point as where we read it. In UNIX we will
+read default values from /usr/share/setedit and store them in
+~/.setedit/.file.
+
+ Return: A pointer to a static buffer containing the path+file name.
+
+***************************************************************************/
+
+char *ExpandHomeSave(const char *s)
+{
+ char *r=ExpandHomeWDir(s);
+ return r ? r : ExpandHomeCommon(s);
+}
+#endif
+
+#ifdef STANDALONE
+static
+char *ExpandFileNameToUserHomeNoDot(const char *s)
+{
+ strcpy(FileNameToLoad,GetHome());
+ strcat(FileNameToLoad,"/");
+ strcat(FileNameToLoad,s);
+ return FileNameToLoad;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This routine searchs the desired file in various directories and returns
+the full qualified path for the location or the default location if the
+file doesn't exist.@*
+ Linux behavior: (a) The user's home (first in ~/.setedit/?, then ~/.? and
+finally ~/?) (b) The SET_FILES directory.@*
+ DOS behavior: (a) The user's home (b) The SET_FILES directory
+(c) The directory where the editor was loaded. Note that (c) shoul not
+happend.@*
+
+ Return:
+ The full path for the file found or the place where the file should be.
+
+***************************************************************************/
+
+char *ExpandFileNameToThePointWhereTheProgramWasLoaded(const char *s)
+{
+ const char *v;
+
+ #ifndef NoHomeOrientedOS
+ char *r;
+ // That's only for UNIX,
+ // Try in the ~/.setedit dir
+ r=ExpandHomeWDir(s);
+ if (r && edTestForFile(r))
+ return r;
+ // Try the same place but a dot-file (hidden)
+ r=ExpandHomeWDir(s,1);
+ if (r && edTestForFile(r))
+ return r;
+ r=ExpandHomeCommon(s);
+ if (edTestForFile(r))
+ return r;
+ #endif
+
+ // Try it in DOS too, so the user can define HOME or HOMEDIR
+ ExpandFileNameToUserHomeNoDot(s);
+ if (edTestForFile(FileNameToLoad))
+ return FileNameToLoad;
+
+ // The directory where the original files are installed
+ if ((v=GetVariable("SET_FILES"))!=NULL)
+ {
+ strcpy(FileNameToLoad,v);
+ strcat(FileNameToLoad,"/");
+ strcat(FileNameToLoad,s);
+ return FileNameToLoad;
+ }
+
+ #ifndef SEOS_UNIX
+ // The point where the editor was loaded doesn't have any sense in UNIX
+ if (PathOrigPos!=NULL)
+ {
+ *PathOrigPos=0;
+ strcat(PathOrig,s);
+ }
+ else
+ strcpy(PathOrig,s);
+ if (edTestForFile(PathOrig))
+ return PathOrig;
+ #endif
+
+ return PathOrig;
+}
+
+int FindFile(const char *name, char *&fullName, const char *reference)
+{
+ if (strlen(name)>=PATH_MAX)
+ return 0;
+ fullName=new char[PATH_MAX];
+ if (!fullName)
+ return 0;
+ strcpy(fullName,name);
+ const char *onlyName=strrchr(name,'/');
+ if (onlyName)
+ onlyName++;
+ else
+ onlyName=name;
+ if (!edTestForFile(fullName))
+ {
+ ccIndex i;
+ int found=0, j;
+ // Path+name
+ for (j=0; !found && j<paliLists; j++)
+ for (i=0; PathListGetItem(i,fullName,j); i++)
+ {
+ char *s=fullName+strlen(fullName)-1;
+ if (!CLY_IsValidDirSep(*s))
+ strcat(s,DIRSEPARATOR_);
+ strcat(s,name);
+ if (edTestForFile(fullName))
+ {
+ found=1;
+ break;
+ }
+ }
+ // Path+onlyName
+ for (j=0; !found && j<paliLists; j++)
+ for (i=0; PathListGetItem(i,fullName,j); i++)
+ {
+ char *s=fullName+strlen(fullName)-1;
+ if (!CLY_IsValidDirSep(*s))
+ strcat(s,DIRSEPARATOR_);
+ strcat(s,onlyName);
+ if (edTestForFile(fullName))
+ {
+ found=1;
+ break;
+ }
+ }
+ if (!found)
+ {
+ // Try with the project
+ char *prjName=GetAbsForNameInPrj(name);
+ if (!prjName)
+ prjName=GetAbsForNameInPrj(onlyName);
+ if (prjName)
+ strcpy(fullName,prjName);
+ else
+ {// Try in the same place as the reference
+ int found=0;
+ if (reference)
+ {
+ const char *s=strrchr(reference,'/');
+ if (s)
+ {
+ int l=s-reference+1;
+ memcpy(fullName,reference,l);
+ strcpy(fullName+l,name);
+ //printf("Intentando: %s\n",fullName);
+ if (edTestForFile(fullName))
+ found=1;
+ else
+ {// One more try, use only the name
+ memcpy(fullName,reference,l);
+ strcpy(fullName+l,onlyName);
+ if (edTestForFile(fullName))
+ found=1;
+ }
+ }
+ }
+ if (!found)
+ {
+ DeleteArray(fullName);
+ return 0;
+ }
+ }
+ }
+ }
+ CLY_fexpand(fullName);
+ return 1;
+}
+#endif // STANDALONE
+
+/**[txh]********************************************************************
+
+ Description:
+ Replaces old extension of name by the provided extension.
+
+ Return:
+ name
+
+***************************************************************************/
+
+char *ReplaceExtension(char *name, const char *ext, const char *old)
+{
+ char *pos;
+ pos=strrchr(name,'/');
+ if (!pos)
+ pos=name;
+ pos=strstr(pos,old);
+ if (pos)
+ strcpy(pos,ext);
+ else
+ strcat(name,ext);
+ return name;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Replaces the extension of name by the provided extension. If none is found
+the extension is added and if the file name starts with dot the extension
+is added too.
+
+ Return:
+ name.
+
+***************************************************************************/
+
+char *ReplaceExtension(char *name, const char *ext)
+{
+ char *dot,*slash;
+ int flen=strlen(name);
+
+ dot=strrchr(name,'.');
+ slash=strrchr(name,'/');
+ if (dot<slash) // dot in directories, not in file
+ dot=0;
+ if (!dot || dot==slash+1) // .files should be .files.bkp and not .bkp ;-)
+ dot=name+flen;
+ strcpy(dot,ext);
+
+ return name;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's used to create back-up file names with xxxx~ stile.
+
+ Return:
+ fname.
+
+***************************************************************************/
+
+char *AddToNameOfFile(char *fname, char *add)
+{
+ #ifdef SEOS_DOS
+ // It could fail, but in this case the user should disable the option
+ if (CLY_HaveLFNs())
+ return strcat(fname,add);
+ // Not so easy boy, 8+3 limitations:
+ char *dir,*name,*ext;
+ int lext;
+ split_fname(fname,dir,name,ext);
+ lext=strlen(ext);
+ if (lext==0)
+ string_cat(ext,".",add,0);
+ else
+ if (lext<4)
+ string_cat(ext,add);
+ else
+ {
+ for (lext=3; lext>1 && ext[lext]==*add; lext--);
+ ext[lext]=*add;
+ }
+ strcpy(fname,dir);
+ strcat(fname,name);
+ strcat(fname,ext);
+ string_free(dir);
+ string_free(name);
+ string_free(ext);
+ return fname;
+ #else
+ // In UNIX that's much more easy
+ return strcat(fname,add);
+ #endif
+}
+
+int DeleteWildcard(char *mask)
+{
+ int deleted=0;
+ DIR *d;
+ d=opendir(".");
+
+ if (d)
+ {
+ struct dirent *de;
+ while ((de=readdir(d))!=0)
+ {
+ if (!fnmatch(mask,de->d_name,0))
+ {
+ unlink(de->d_name);
+ deleted++;
+ }
+ }
+ closedir(d);
+ }
+ return deleted;
+}
+
+
+char *GetPathRelativeToRunPoint(char *dest, const char *binReplace, char *file)
+{
+ char *ret;
+
+ if (PathOrigPos!=NULL)
+ {
+ *PathOrigPos=0;
+ strcpy(dest,PathOrig);
+ char *s=strstr(dest,"bin");
+ if (!s)
+ s=strstr(dest,"BIN");
+ if (s)
+ strcpy(s,binReplace);
+ ret=dest+strlen(dest)-1;
+ }
+ else
+ {
+ *dest=0;
+ ret=dest;
+ }
+
+ strcat(dest,file);
+
+ return ret;
+}
+
+
+void SetReferencePath(char *orig)
+{
+ PathOrigPos=strrchr(orig,'/');
+ if (PathOrigPos)
+ {
+ PathOrigPos++;
+ char oldVal=*PathOrigPos;
+ *PathOrigPos=0;
+ strcpy(PathOrig,orig);
+ *PathOrigPos=oldVal;
+ PathOrigPos=PathOrig+(int)(PathOrigPos-orig);
+ }
+ else
+ PathOrig[0]=0;
+}
+
+char *RedirectStdErrToATemp(int &StdErrOri,int &StdErrNew)
+{
+ char aux[PATH_MAX];
+ char *s=ExpandHomeSave("");
+ char *ret=0;
+
+ /*#ifdef TVComp_BCPP
+ sprintf(aux,"%s/",s);
+ StdErrNew=creattemp(aux, 0);
+ #elif defined(TVCompf_MinGW) || defined(TVComp_MSC)
+ sprintf(aux,"%s/erXXXXXX",s);
+ char *tempName=mktemp(aux);
+ StdErrNew=open(tempName,O_RDWR | O_CREAT,S_IRUSR | S_IWUSR);
+ #else
+ #endif*/
+ sprintf(aux,"%serXXXXXX",s);
+ StdErrNew=mkstemp(aux);
+ if (StdErrNew>0)
+ {// In UNIX if the program is suid (needed before starting TV) we are
+ // at a point where TV wasn't initialized and hence didn't set the
+ // euid and egid to the real user. So we must ensure the temporal file
+ // is owned by the real user.
+ chown(aux,getuid(),getgid());
+ ret=strdup(aux);
+ StdErrOri=dup(fileno(stderr));
+ fflush(stderr);
+ dup2(StdErrNew,fileno(stderr));
+ }
+ return ret;
+}
+
+const int eachRead=16300;
+
+int FileCopy(const char *orig, const char *dest)
+{
+ // First I alloc a 16Kb buffer
+ char *buf=new char[eachRead];
+ if (!buf)
+ return 0;
+
+ // Create destination
+ FILE *d=fopen(dest,"wb");
+ if (!d)
+ {
+ delete buf;
+ return 0;
+ }
+
+ // Open source
+ FILE *o=fopen(orig,"rb");
+ if (!o)
+ {
+ fclose(d);
+ delete buf;
+ return 0;
+ }
+
+ int read;
+ do
+ {
+ read=fread(buf,1,eachRead,o);
+ fwrite(buf,read,1,d);
+ }
+ while (read==eachRead);
+
+ int ret=!(ferror(o) || ferror(d));
+ fclose(o);
+ fclose(d);
+ delete buf;
+
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a direct replacement for access(name,D_OK) which Linux lacks.
+
+ Return:
+ 0 not a directory or no access allowed.
+
+***************************************************************************/
+
+int IsADirectory(const char *name)
+{
+ #ifdef SEOS_UNIX
+ struct stat s;
+ return stat(name,&s)==0 && S_ISDIR(s.st_mode) && !access(name,X_OK);
+ #endif
+ #ifdef SECompf_djgpp
+ return !access(name,D_OK);
+ #endif
+ #ifdef SEOS_Win32
+ return CLY_IsDir(name)==True;
+ #endif
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Checks if a file is a symbolic link.
+
+ Return:
+ 0 not a link.
+
+***************************************************************************/
+
+int IsASoftLink(const char *name)
+{
+ #ifdef S_ISLNK
+ struct stat s;
+ return lstat(name,&s)==0 && S_ISLNK(s.st_mode);
+ #else
+ return 0;
+ #endif
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ TMPDIR variable could be not defined or pointing to an invalid drive. As
+the librhutils assumes TMPDIR is working I must ensure it or the
+stderr/stdout could misserably fail.
+
+***************************************************************************/
+
+void CheckForValidTMPDIR()
+{
+ char *tmp=getenv("TMPDIR");
+
+ // If the variable is defined && is a directory all is ok
+ if (!(tmp && IsADirectory(tmp)))
+ {
+ // Ok, this system lacks it or worst it point to nowhere
+ tmp=getenv("TEMP");
+ if (!tmp || !IsADirectory(tmp))
+ { // No luck with TEMP
+ tmp=getenv("TMP");
+ if (!tmp || !IsADirectory(tmp))
+ { // No luck with TMP
+ tmp="/tmp"; // It should work in UNIX
+ if (!IsADirectory(tmp))
+ {
+ tmp="c:/"; // It should work in DOS
+ if (!IsADirectory(tmp))
+ { // Hey! nothing is good!
+ tmp="."; // Well, give up and try in current directory
+ }
+ }
+ }
+ }
+ }
+
+ char *b=new char[8+strlen(tmp)];
+ sprintf(b,"TMPDIR=%s",tmp);
+ #if defined(SECompf_djgpp) || defined(TVComp_BCPP)
+ // Mixing forward and backslashes could produce problems (path\/file is invalid).
+ char *s=b;
+ for (; *s; s++)
+ if (*s=='\\')
+ *s='/';
+ #endif
+ putenv(b);
+ //fprintf(stderr,"Using: %s\n",tmp);
+}
+
+
+#ifdef HIDDEN_DIFFERENT
+char *MakeItHiddenName(char *file)
+{
+ // Look for the real name:
+ char *name=strrchr(file,'/');
+ if (name)
+ name++;
+ else
+ name=file;
+ // Already hidden?
+ if (*name=='.')
+ return 0;
+ // Ugh! here UNIX is pretty bad:
+ int l=strlen(file)+2;
+ char *s=new char[l];
+ strcpy(s,file);
+ l=name-file;
+ strcpy(s+l+1,name);
+ s[l]='.';
+
+ return s;
+}
+#else
+char *MakeItHiddenName(char *)
+{
+ return 0;
+}
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ Changes the status of the file to hidden. IMPORTANT! if the OS needs to
+change the name of the file to make it hidden (UNIX case) the name provided
+will be altered so it should have enough space for it.
+
+ Return:
+ 0 succes, 1 fail
+
+***************************************************************************/
+
+int MakeFileHidden(char *file)
+{
+ if (!file) return 0;
+ int ret=0;
+
+ #ifdef SEOS_Win32
+ // At least BC++ 5.5 says _chmod is obsolet and looking in the implementation
+ // (oh no! reverse eng.! just saw the .obj ;-) it calls Get/SetFileAttributes
+ // from Win32 API
+ // Get current status
+ DWORD mode=GetFileAttributes(file);
+ if (mode==0xFFFFFFFF) return 1;
+ // Already hidden?
+ if (mode & FILE_ATTRIBUTE_HIDDEN) return 0;
+ // Set the attribute
+ SetFileAttributes(file,mode | FILE_ATTRIBUTE_HIDDEN);
+ #endif
+ #ifdef SEOS_DOS
+ // Get current status
+ int mode=_chmod(file,0,0);
+ if (mode==-1) return 1;
+ // Already hidden?
+ if (mode & 2) return 0;
+ // Set the attribute
+ _chmod(file,1,mode | 2);
+ #endif
+ #ifdef SEOS_UNIX
+ char *s=MakeItHiddenName(file);
+ if (!s) return 0;
+ ret=rename(file,s);
+ strcpy(file,s);
+ delete[] s;
+ #endif
+ return ret;
+}
+
+int RemoveFileHidden(char *file)
+{
+ #ifndef SEOS_UNIX
+ // Hidden files are the same as not hidden files, just an attribute.
+ return 1;
+ #else
+ if (!file) return 0;
+ int ret=0;
+
+ char *s=MakeItHiddenName(file);
+ if (!s) return 0;
+ ret=unlink(s);
+ delete[] s;
+ return ret;
+ #endif
+}
+
+
+static TStringCollectionW *filesToKill=0;
+
+void AddToFilesToKill(char *name)
+{
+ if (!filesToKill)
+ filesToKill=new TStringCollectionW(6,4);
+
+ ccIndex i;
+ if (filesToKill->search(filesToKill->keyOf(name),i)==0)
+ // A simple insert here will leak memory because the dupped name won't
+ // be released.
+ filesToKill->atInsert(i,newStr(name));
+}
+
+static
+void killIt(void *name, void *)
+{
+ unlink((char *)name);
+}
+
+void KillFilesToKill()
+{
+ if (!filesToKill)
+ return;
+ filesToKill->forEach(killIt,0);
+}
+
+void ReleaseFilesToKill()
+{
+ destroy0(filesToKill);
+}
+
+TStringCollectionW *GetFilesToKill()
+{
+ return filesToKill;
+}
+
+void SetFilesToKill(TStringCollectionW *files)
+{
+ ReleaseFilesToKill();
+ filesToKill=files;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Determines if 2 file names belongs to the same file. The function uses the
+inode/device to find it.
+
+ Return:
+ !=0 if the files are the same.
+
+***************************************************************************/
+
+int CompareFileNames(char *origFile, char *destFile)
+{
+ struct stat st1,st2;
+
+ if (stat(origFile,&st1) || stat(destFile,&st2))
+ return 0;
+
+ return st1.st_dev==st2.st_dev && st1.st_ino==st2.st_ino;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ If the current directory is invalid aborts the execution.
+
+***************************************************************************/
+
+void CheckIfCurDirValid(void)
+{
+ long *aux=(long *)PathOrig;
+ *aux=0xFFFEFDFC;
+ getcwd(PathOrig,PATH_MAX);
+ if (*aux==(long)0xFFFEFDFC)
+ {
+ TScreen::suspend();
+ fprintf(stderr,_("\nError! please run the editor from a valid directory\n\n"));
+ fflush(stderr);
+ exit(1);
+ }
+}
+
+#ifdef SECompf_djgpp
+/**[txh]********************************************************************
+
+ Description:
+ Returns the short file name of the passed file. The shortName pointer must
+point to a buffer with at least maxSFNSize bytes.
+
+ Return:
+ A pointer to the converted name if succesful or the original name if it
+fails.
+
+***************************************************************************/
+
+char *GetShortNameOf(char *longName, char *shortName)
+{
+ __dpmi_regs r;
+ unsigned long tbuf=__tb;
+
+ r.x.ax=0x7100;
+ if (_USE_LFN)
+ {
+ dosmemput (longName,strlen(longName)+1,tbuf+maxSFNSize);
+ r.x.ax=0x7160;
+ r.x.es=r.x.ds=tbuf >> 4;
+ r.x.di=0;
+ r.x.si=maxSFNSize;
+ r.x.cx=0x8001;
+ __dpmi_int(0x21, &r);
+ }
+ if ((r.x.flags & 1)==0 && r.x.ax!=0x7100)
+ {
+ dosmemget(tbuf,maxSFNSize,shortName);
+ return shortName;
+ }
+ return longName;
+}
+#else
+char *GetShortNameOf(char *longName, char *)
+{
+ return longName;
+}
+#endif
+
+int CheckIfPathAbsolute(const char *s)
+{
+ //$todo: implement it for Win32 (SAA)
+ if (!s) return 0;
+ #ifndef SEOS_UNIX
+ return *s=='/' || *s=='\\' || s[1]==':';
+ #else
+ return *s=='/';
+ #endif
+}
+
diff --git a/setedit/mainsrc/pclipper.cc b/setedit/mainsrc/pclipper.cc
new file mode 100644
index 0000000..a8026bf
--- /dev/null
+++ b/setedit/mainsrc/pclipper.cc
@@ -0,0 +1,284 @@
+/* Copyright (C) 2000-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ Clipper parser used by bufun.cc when the syntax is Clipper 5.x.
+
+***************************************************************************/
+
+#define Uses_string
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_TVCodePage
+#include <tv.h>
+
+#include <bufun.h>
+
+#if 0
+FILE *f;
+
+static
+int GetChar()
+{
+ return fgetc(f);
+}
+#else
+static char *buffer;
+static unsigned lenBuffer, indexBuffer;
+
+static
+int GetChar()
+{
+ return indexBuffer>=lenBuffer ? EOF : buffer[indexBuffer++];
+}
+#endif
+
+const int LargoMax=255;
+static char FirstCol=1;
+static int Line=1;
+
+static
+int GetUpToEOL()
+{
+ int c;
+ do
+ {
+ c=GetChar();
+ }
+ while (c!='\n' && c!=EOF);
+ FirstCol=1;
+ Line++;
+ return c;
+}
+
+static
+int GetWord()
+{
+ int c,IndiceW=0;
+ do
+ {
+ c=GetChar();
+ switch (c)
+ {
+ case '"':
+ FirstCol=0;
+ do
+ {
+ c=GetChar();
+ }
+ while (c!='"' && c!='\n' && c!=EOF);
+ if (c=='\n')
+ {
+ FirstCol=1;
+ Line++;
+ }
+ if (IndiceW) return IndiceW;
+ break;
+
+ case '\'':
+ FirstCol=0;
+ do
+ {
+ c=GetChar();
+ }
+ while (c!='\'' && c!='\n' && c!=EOF);
+ if (c=='\n')
+ {
+ FirstCol=1;
+ Line++;
+ }
+ if (IndiceW) return IndiceW;
+ break;
+
+ case '*':
+ FirstCol=0;
+ c=GetChar();
+ if (c==' ')
+ {
+ c=GetChar();
+ if (c=='-')
+ { // That's an EOL comment.
+ c=GetUpToEOL();
+ }
+ }
+ if (IndiceW) return IndiceW;
+ break;
+
+ case '/':
+ FirstCol=0;
+ c=GetChar();
+ if (c=='/')
+ { // That's an EOL comment.
+ c=GetUpToEOL();
+ }
+ else
+ {
+ if (c=='*')
+ { // Large comment
+ c=GetChar();
+ if (c=='\n') Line++;
+ do
+ {
+ if (c=='*')
+ {
+ c=GetChar();
+ if (c=='/')
+ break;
+ }
+ else
+ c=GetChar();
+ if (c=='\n') Line++;
+ }
+ while (c!=EOF);
+ FirstCol=0;
+ }
+ }
+ if (IndiceW) return IndiceW;
+ break;
+
+ case '&':
+ FirstCol=0;
+ c=GetChar();
+ if (c=='&')
+ c=GetUpToEOL();
+ if (IndiceW) return IndiceW;
+ break;
+
+ case '#':
+ if (FirstCol)
+ c=GetUpToEOL();
+ if (IndiceW) return IndiceW;
+ break;
+
+ default:
+ if (isalnum(c) || c=='_')
+ {
+ if (IndiceW<MaxLen)
+ bfBuffer[IndiceW++]=c;
+ }
+ else
+ {
+ if (c=='\n')
+ {
+ FirstCol=1;
+ Line++;
+ }
+ else
+ {
+ if (!isspace(c))
+ FirstCol=0;
+ }
+ if (IndiceW) return IndiceW;
+ }
+ }
+ }
+ while (c!=EOF);
+ return IndiceW;
+}
+
+static
+int CheckStr(char *word, char *toCheck)
+{
+ int l=0;
+ while (*toCheck && *word)
+ {
+ if (toupper(*toCheck)!=*word) return 0;
+ toCheck++; word++;
+ l++;
+ }
+ if (*toCheck) return 0;
+ return l>=4;
+}
+
+static
+int Parsear(tAddFunc AddFunc, int mode)
+{
+ int r,f,p,line=-1,funs=0,Static=0,lastReturn=-1,lenTemp=0;
+ FirstCol=1;
+ Line=1;
+ do
+ {
+ r=GetWord();
+ if (r)
+ {
+ bfBuffer[r]=0; p=0;
+ // Memorize the last return/quit
+ if (CheckStr("RETURN",bfBuffer) || CheckStr("QUIT",bfBuffer))
+ {
+ lastReturn=Line;
+ Static=0;
+ continue;
+ }
+ // Memorize if the static modifier is there
+ if (!Static)
+ {
+ Static=CheckStr("STATIC",bfBuffer);
+ if (Static) continue;
+ }
+ // Check if that's a function or procedure
+ f=CheckStr("FUNCTION",bfBuffer);
+ if (!f) p=CheckStr("PROCEDURE",bfBuffer);
+ if (f || p)
+ {
+ if (line>=0)
+ { // We have one cached, add it
+ AddFunc(bfNomFun,lenTemp,line,lastReturn);
+ lastReturn=-1;
+ }
+ line=Line;
+ r=GetWord();
+ bfBuffer[r]=0;
+ if (r<MaxLen-5 && (mode & modeBFClassSep))
+ {
+ sprintf(bfNomFun,"%s (%c%c)",bfBuffer,
+ f ? 'F' : 'P', // Function or Procedure
+ Static ? 'S' : ' '); // Static or normal
+ lenTemp=r+6;
+ }
+ else
+ {
+ strcpy(bfNomFun,bfBuffer);
+ lenTemp=r+1;
+ }
+ //printf("%s %s %d\n",f ? "Function" : "Procedure",bfNomFun,line);
+ funs++;
+ }
+ Static=0;
+ }
+ }
+ while (r);
+ if (line>=0) // We have one cached, add it
+ AddFunc(bfNomFun,lenTemp,line,lastReturn);
+
+ return funs;
+}
+
+int SearchClipperFuncs(char *b, unsigned l, int mode, tAddFunc AddFunc)
+{
+ buffer=b;
+ lenBuffer=l;
+ indexBuffer=0;
+ return Parsear(AddFunc,mode);
+}
+
+#if 0
+int main(int argc, char *argv[])
+{
+ if (argc!=2)
+ {
+ printf("Prueba de parser de Clipper, Copyright 2000 by Salvador E. Tropea\n");
+ printf("Uso: pclipper archivo\n");
+ return 1;
+ }
+ f=fopen(argv[1],"rt");
+ if (!f)
+ {
+ printf("No se pudo abrir %s\n",argv[1]);
+ return 2;
+ }
+ Parsear();
+ fclose(f);
+ return 0;
+}
+#endif
diff --git a/setedit/mainsrc/pmacros.cc b/setedit/mainsrc/pmacros.cc
new file mode 100644
index 0000000..2ac0bbf
--- /dev/null
+++ b/setedit/mainsrc/pmacros.cc
@@ -0,0 +1,347 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#define Uses_string
+#define Uses_ctype
+#define Uses_ftell
+#define Uses_TPMCollection
+#define Uses_MsgBox
+#define Uses_snprintf
+#define Uses_AllocLocal
+#include <ceditor.h>
+#include <dyncat.h>
+
+static
+char *FGets(char *s, int n, FILE *f)
+{
+ char *ret=fgets(s,n,f);
+ if (ret)
+ {
+ int l=strlen(s);
+ if (l>1 && s[l-2]=='\r' && s[l-1]=='\n')
+ {
+ s[l-2]='\n';
+ s[l-1]=0;
+ }
+ }
+ return ret;
+}
+
+/****************************************************************************
+
+ Pseudo Macros
+
+****************************************************************************/
+
+
+ccIndex TPMCollection::insert(void *item)
+{
+ // Fill the vars field
+ PMacroStr *pm=(PMacroStr *)item;
+ char *s=pm->str;
+ for (; *s; s++)
+ {
+ if (*s=='@' && s[1]=='{' && s[2]!='(')
+ {
+ s+=2;
+ char *start=s;
+ for (; *s && *s!='}'; s++);
+ if (*s=='}')
+ {
+ if (!pm->vars)
+ {
+ pm->vars=new TNSCollection(2,2);
+ pm->defaults=new TNSCollection(2,2);
+ pm->mLenVar=0;
+ }
+ // Extract the variable
+ char *aux=newStrL(start,s-start);
+ char *val=strtok(aux,";");
+ unsigned lenVal=strlen(val);
+ pm->vars->insert(newStrL(val,lenVal));
+ if (lenVal>pm->mLenVar)
+ pm->mLenVar=lenVal;
+ //printf("Var: %s %d\n",val,lenVal);
+ // Default value?
+ val=strtok(NULL,";");
+ pm->defaults->insert(newStr(val));
+ //printf("Default: %s\n",val);
+ // Free the temporal
+ delete[] aux;
+ }
+ }
+ }
+ // Insert it
+ return TStringCollection::insert(item);
+}
+
+void TPMCollection::freeItem(void *p)
+{
+ PMacroStr *s=(PMacroStr *)p;
+ delete[] s->str;
+ delete[] s->name;
+ destroy(s->vars);
+ destroy(s->defaults);
+ delete s;
+}
+
+void *TPMCollection::keyOf(void *p)
+{
+ return ((PMacroStr *)p)->trigger;
+}
+
+void TPMCollection::getText(char *dest, unsigned item, int maxLen)
+{
+ PMacroStr *s=(PMacroStr *)(at(item));
+ char *aux=NULL;
+ if (!s->name && !s->str)
+ aux=TVIntl::getTextNew(__("Unknown"));
+ strncpyZ(dest,s->name ? s->name : (s->str ? s->str : aux),maxLen);
+ DeleteArray(aux);
+}
+
+PMacroStr *TPMCollection::searchByNamePointer(void *name)
+{
+ ccIndex i,c=getCount();
+
+ for (i=0; i<c; i++)
+ {
+ PMacroStr *p=(PMacroStr *)at(i);
+ if (p->name==name)
+ return p;
+ }
+ return NULL;
+}
+
+static
+int MeassureTriLine(char *b,unsigned &s,unsigned &e)
+{
+ int l;
+ char *p=b;
+
+ for (; *b && *b!='"'; b++);
+ if (*b==0) return -1;
+ s=(unsigned)(b-p);
+ b++;
+ for (l=0; *b && *b!='"'; b++)
+ {
+ if (*b=='\\')
+ {
+ if (*(b+1)==0)
+ return -2;
+ b++;
+ }
+ l++;
+ }
+ if (*b==0) return -2;
+ e=(unsigned)(b-p);
+ return l;
+}
+
+Boolean LoadPseudoMacroFile(char *name, TPMCollection &coll)
+{
+ FILE *f;
+ char buf[256];
+ char *sep="\"",*s;
+ int Trs=0,partial,loaded;
+ unsigned l,start,end,total=0;
+ unsigned mode,bit;
+ PMacroStr *nDef;
+ long startDef;
+
+ if (!(&coll) || (f=fopen(name,"rb"))==NULL)
+ return False;
+
+ FGets(buf,250,f);
+ do
+ {
+ if (buf[0]==0 || buf[0]==';' || buf[0]=='\n')
+ {
+ FGets(buf,250,f);
+ continue;
+ }
+ if (strncmp(buf,"Trigger:",8)!=0)
+ {
+ messageBox(__("Macro definition doesn't start with Trigger"),mfError | mfOKButton);
+ fclose(f);
+ return False;
+ }
+ strtok(buf,sep);
+ s=strtok(NULL,sep);
+ if (s==NULL || strlen(s)!=2)
+ {
+ messageBox(__("Missing Trigger sequence or too short"),mfError | mfOKButton);
+ fclose(f);
+ return False;
+ }
+ nDef=new PMacroStr;
+ if (!nDef)
+ {
+ fclose(f);
+ return False;
+ }
+ nDef->trigger[0]=s[0];
+ nDef->trigger[1]=s[1];
+ nDef->trigger[2]=0;
+ nDef->vars=NULL;
+ nDef->defaults=NULL;
+
+ // Process the mode keyword
+ FGets(buf,250,f);
+ if (strncmp(buf,"Mode:",5)!=0)
+ {
+ messageBox(__("Macro definition without mode keyword"),mfError | mfOKButton);
+ fclose(f);
+ return False;
+ }
+ for (s=buf+5; *s!=0 && ucisspace(*s); s++);
+ for (l=0,mode=0,bit=1; l<32; l++,bit<<=1)
+ {
+ for (; *s && ucisspace(*s); s++);
+ if (!*s) break;
+ if (*s!='0' && *s!='1')
+ {
+ messageBox(__("Wrong mode definition in pseudo macro."),mfError | mfOKButton);
+ fclose(f);
+ return False;
+ }
+ if (*s=='1')
+ mode|=bit;
+ for (s++; *s && ucisspace(*s); s++);
+ if (!*s) break;
+ if (*s!=',')
+ {
+ messageBox(__("Wrong mode definition in pseudo macro."),mfError | mfOKButton);
+ fclose(f);
+ return False;
+ }
+ s++;
+ }
+ nDef->flags=mode;
+ nDef->str=0; // Is loaded later
+ nDef->name=0; // idem
+
+ startDef=ftell(f);
+ // Check if it have a name
+ loaded=1;
+ FGets(buf,250,f);
+ if (strncmp(buf,"Name:",5)==0)
+ {
+ loaded=0;
+ for (s=buf+5; *s && ucisspace(*s); s++);
+ char *aux;
+ for (aux=s; *aux && *aux!='\n'; aux++);
+ *aux=0;
+ int len=aux-s;
+ if (len)
+ {
+ aux=nDef->name=new char[len+1+5];
+ strcpy(aux,s);
+ aux[len+0]=' ';
+ aux[len+1]='[';
+ aux[len+2]=nDef->trigger[0];
+ aux[len+3]=nDef->trigger[1];
+ aux[len+4]=']';
+ aux[len+5]=0;
+ }
+ startDef=ftell(f);
+ }
+ // End of optional name
+
+ l=0;
+ while (!feof(f))
+ {
+ if (loaded)
+ loaded=0;
+ else
+ FGets(buf,250,f);
+ if (feof(f)) break;
+ if (buf[0]==0 || buf[0]==';' || buf[0]=='\n')
+ continue;
+ if (buf[0]=='T') break;
+ partial=MeassureTriLine(buf,start,end);
+ switch (partial)
+ {
+ case -1:
+ messageBox(__("Missing start in pseudo macro"),mfError | mfOKButton);
+ fclose(f);
+ return False;
+
+ case -2:
+ messageBox(__("Missing end in pseudo macro"),mfError | mfOKButton);
+ fclose(f);
+ return False;
+
+ default: l+=partial;
+ }
+ }
+ if (l==0)
+ {
+ messageBox(__("Empty pseudo macro"),mfError | mfOKButton);
+ fclose(f);
+ return False;
+ }
+ fseek(f,startDef,SEEK_SET);
+ s=nDef->str=new char[l+1];
+ while (!feof(f))
+ {
+ FGets(buf,250,f);
+ if (feof(f)) break;
+ if (buf[0]==0 || buf[0]==';' || buf[0]=='\n')
+ continue;
+ if (buf[0]=='T') break;
+ MeassureTriLine(buf,start,end);
+ int in_slash;
+ for (in_slash=0,l=start+1; l<end; l++)
+ {
+ if (!in_slash && buf[l]=='\\')
+ in_slash=1;
+ else
+ {
+ if (in_slash)
+ {
+ in_slash=0;
+ switch (buf[l])
+ {
+ case 'a': *s='\a';
+ break;
+ case 'f': *s='\f';
+ break;
+ case 'v': *s='\v';
+ break;
+ case '\\': *s='\\';
+ break;
+ case 'n': *s='\n';
+ break;
+ case 'b': *s='\b';
+ break;
+ case 't': *s='\t';
+ break;
+ default: *s=buf[l];
+ }
+ }
+ else
+ *s=buf[l];
+ s++;
+ }
+ }
+ }
+ *s=0;
+ if (!nDef->name)
+ {// Use a default name is none is provided
+ size_t len=CLY_snprintf(NULL,(size_t)0,"%s [%c%c]",__("No name"),nDef->trigger[0],
+ nDef->trigger[1]);
+ char *name=new char[len+1];
+ CLY_snprintf(name,len+1,"%s [%c%c]",__("No name"),nDef->trigger[0],nDef->trigger[1]);
+ nDef->name=name;
+ }
+ coll.insert(nDef);
+ Trs++;
+ total+=l+1;
+ }
+ while (!feof(f));
+ fclose(f);
+ return True;
+}
+
+
diff --git a/setedit/mainsrc/pperl.cc b/setedit/mainsrc/pperl.cc
new file mode 100644
index 0000000..87cb40e
--- /dev/null
+++ b/setedit/mainsrc/pperl.cc
@@ -0,0 +1,225 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001 by Salvador Eduardo Tropea.
+ This program is covered by the GPL license.
+
+ Description:
+ Parses a Perl script looking for function definitions.
+ It can be compiled as an standalone program by defining STANDALONE.
+ That's just an heuristic, not a real parser and I'm quite sure it can be
+fulled, but is fast and small.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <ctype.h>
+#include <bufun.h>
+#include <string.h>
+
+//#define STANDALONE
+
+static unsigned Index,Line,lenWord,Len;
+static unsigned char *Buffer;
+
+static
+void GetEndOfStr(unsigned char end)
+{
+ for (Index++; Index<Len; Index++)
+ {
+ if (Buffer[Index]=='\n')
+ {
+ Line++;
+ continue;
+ }
+ if (Buffer[Index]=='\\')
+ Index++;
+ else
+ if (Buffer[Index]==end)
+ break;
+ }
+ Index++;
+}
+
+static
+void AddToWord(char val)
+{
+ if (lenWord<(unsigned)MaxLen_1)
+ {
+ bfBuffer[lenWord++]=val;
+ bfBuffer[lenWord]=0;
+ }
+ Index++;
+}
+
+static
+int isWordChar()
+{
+ return (isalnum(Buffer[Index]) || Buffer[Index]=='_');
+}
+
+static
+void GetWordChars()
+{
+ while (Index<Len && isWordChar())
+ AddToWord(Buffer[Index]);
+}
+
+static
+int GetNextValue()
+{
+ lenWord=0;
+ bfBuffer[0]=0;
+ while (Index<Len)
+ {// Eat spaces
+ for (; Index<Len && isspace(Buffer[Index]); Index++)
+ if (Buffer[Index]=='\n')
+ Line++;
+ switch (Buffer[Index])
+ {
+ case '#': // EOL comment eat upto the EOL
+ for (; Index<Len && Buffer[Index]!='\n'; Index++);
+ if (Buffer[Index]=='\n')
+ {
+ Index++;
+ Line++;
+ }
+ break;
+ case '"': // Parseable string, search the end
+ GetEndOfStr('"');
+ break;
+ case '\'': // Simple string, search the end
+ GetEndOfStr('\'');
+ break;
+ case '`': // Shell string, search the end
+ GetEndOfStr('`');
+ break;
+ case '\\': // Escape sequence, mostly in search patterns
+ Index+=2;
+ break;
+ case '$': // Scalar
+ AddToWord('$');
+ GetWordChars();
+ return 2;
+ case '@': // Array
+ AddToWord('@');
+ GetWordChars();
+ return 2;
+ default:
+ AddToWord(Buffer[Index]);
+ Index--;
+ if (isWordChar())
+ {
+ Index++;
+ GetWordChars();
+ return 1;
+ }
+ Index++;
+ return 0;
+ }
+ }
+ return 0;
+}
+
+static
+void GetWord()
+{
+ do
+ {
+ if (GetNextValue()==1)
+ return;
+ }
+ while (Index<Len);
+}
+
+static
+void SearchBalance(char start, char end)
+{
+ do
+ {
+ if (GetNextValue()==0 && bfBuffer[0]==start)
+ break;
+ }
+ while (Index<Len);
+ int level=1;
+ do
+ {
+ if (GetNextValue()==0)
+ {
+ if (bfBuffer[0]==start)
+ level++;
+ else
+ if (bfBuffer[0]==end)
+ {
+ level--;
+ if (level==0)
+ break;
+ }
+ }
+ }
+ while (Index<Len);
+}
+
+int SearchPerlFuncs(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned lenFound,lineFound,funcs=0;
+ Index=0; Line=1; Len=len; Buffer=(unsigned char *)buffer;
+ while (Index<len)
+ {
+ GetWord();
+ if (strcmp(bfBuffer,"sub")==0)
+ {
+ GetWord();
+ lenFound=lenWord+1;
+ lineFound=Line;
+ strcpy(bfNomFun,bfBuffer);
+ SearchBalance('{','}');
+ AddFunc(bfNomFun,lenFound,lineFound,Line);
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+#ifdef STANDALONE
+char bfBuffer[MaxLenWith0];
+char bfNomFun[MaxLenWith0];
+char bfTempNomFun[MaxLenWith0];
+
+void PrintFunc(char *name, int len, int lineStart, int lineEnd)
+{
+ printf("%s [%d,%d]\n",name,lineStart,lineEnd);
+}
+
+int main(int argc, char *argv[])
+{
+ printf("Perl Functions Parser, Copyright 2001 by Salvador E. Tropea\n");
+ if (argc!=2)
+ {
+ printf("Use: pperl file\n");
+ return 1;
+ }
+ FILE *f=fopen(argv[1],"rt");
+ if (!f)
+ {
+ printf("Can't open %s\n",argv[1]);
+ return 2;
+ }
+ fseek(f,0,SEEK_END);
+ long len=ftell(f);
+ fseek(f,0,SEEK_SET);
+ char *buffer=new char[len+1];
+ long bread=fread(buffer,len,1,f);
+ if (bread!=1)
+ {
+ printf("Error reading file %s\n",argv[1]);
+ perror("Error");
+ fclose(f);
+ return 3;
+ }
+ fclose(f);
+ buffer[len]=0;
+ SearchPerlFuncs(buffer,len,0,PrintFunc);
+
+ return 0;
+}
+#endif // STANDALONE
diff --git a/setedit/mainsrc/pphp.cc b/setedit/mainsrc/pphp.cc
new file mode 100644
index 0000000..a71efec
--- /dev/null
+++ b/setedit/mainsrc/pphp.cc
@@ -0,0 +1,510 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2002 by Ivn Baldo.
+ This program is covered by the GPL license.
+
+ Description:
+ Parses a PHP script looking for function and class definitions.
+ It can be compiled as an standalone program by defining STANDALONE.
+ That's just an heuristic, not a real parser and I'm quite sure it can be
+fooled, but is fast and small.
+ Based on code from other parsers in SETEdit.
+
+
+ Temporary notes (last upd. 2002/11/11):
+ - normalize some names, maybe translate go* to seek* or search* and eat*
+to skip*.
+***************************************************************************/
+//#define STANDALONE
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#ifndef STANDALONE
+ #include <bufun.h>
+ #include <tv.h> // bool definition for compilers without it
+#endif
+
+#ifndef EXTRA_INLINE
+ #ifdef STANDALONE
+ #define EXTRA_INLINE inline
+ #else
+ #define EXTRA_INLINE /*inline*/
+ #endif
+#endif
+
+#ifdef STANDALONE
+//The following is as defined in bufun.h:
+typedef void (*tAddFunc)(char *name, int len, int lineStart, int lineEnd);
+const int MaxLenWith0=256;
+char bfBuffer[MaxLenWith0];
+char bfNomFun[MaxLenWith0];
+
+
+int SearchPHPFuncs(char *srcBuffer, unsigned len, int mode, tAddFunc addFunc);
+
+static void printFunc(char *name, int len, int lineStart, int lineEnd)
+{
+ printf("%s [%d,%d] len=%d strlen=%d \n", name, lineStart, lineEnd, len,
+ strlen(name));
+}
+
+int main(int argc, char *argv[])
+{
+ puts("PHP Functions Parser, Copyright 2002 by Ivn Baldo.");
+ if(argc != 2) {
+ puts("Use: pphp file");
+ return 1;
+ }
+ FILE *f = fopen(argv[1], "rt");
+ if(!f) {
+ printf("Can't open '%s'.\n", argv[1]);
+ return 2;
+ }
+ fseek(f,0,SEEK_END);
+ long len = ftell(f);
+ fseek(f,0,SEEK_SET);
+ char *buffer = new char[len+1];
+ size_t bread = fread(buffer, len, 1, f);
+ if(bread != 1) {
+ printf("Error reading file '%s'.\n", argv[1]);
+ perror("Error");
+ fclose(f);
+ return 3;
+ }
+ fclose(f);
+ buffer[len] = 0;
+ SearchPHPFuncs(buffer, len, 0, printFunc);
+ delete [] buffer;
+ return 0;
+}
+#endif // STANDALONE
+
+/*** DECLARATIONS ***/
+
+//Source code buffer pointers:
+static const char *srcBufStart, *srcBufEnd; //Note: past from end!
+static const char *curBufPtr; //Pointer to current position on buffer.
+static unsigned curLine; //Current line number.
+static unsigned curFuncNum; //Current function number.
+static tAddFunc funcAddPtr;
+
+enum eKeyWord { KEYWORD_NONE, KEYWORD_FUNCTION, KEYWORD_CLASS };
+
+static eKeyWord goClassOrFunc();
+static void goEndOfIdentifier();
+static void processFunc(const char *className=NULL,
+ const unsigned classNameSize=0);
+static void processClass();
+static void goMatching(const char startChar, const char endChar,
+ const bool copy=false);
+static void registerFunc(const char *funcName, const unsigned funcNameSize,
+ const char *param, const unsigned paramSize, const unsigned funcStartLine,
+ const char *className=NULL, unsigned classNameSize=0);
+
+
+/*** INLINE DEFINITIONS ***/
+
+inline static bool atEndOfBuf()
+{
+ return curBufPtr >= srcBufEnd;
+}
+
+inline static bool atStartOfString()
+{
+ if(*curBufPtr=='\'' || *curBufPtr=='"' || *curBufPtr=='`')
+ return true;
+ return false;
+}
+
+#if 0
+EXTRA_INLINE static bool atStartOfComment()
+{
+ if(atEndOfBuf()) return false;
+ if(*curBufPtr=='#')
+ return true;
+ else if(*curBufPtr=='/')
+ if(*(curBufPtr+1)=='/' || *(curBufPtr+1)=='*')
+ return true;
+ return false;
+}
+#endif
+
+//Skip blanks leaving curBufPtr after the blanks.
+//Returns true if it has skipped something.
+EXTRA_INLINE static bool eatBlanks()
+{
+ const char * const p = curBufPtr;
+ for(; !atEndOfBuf() && isspace(*curBufPtr); curBufPtr++)
+ if(*curBufPtr=='\n') ++curLine;
+ return p!=curBufPtr;
+}
+
+//Skip the rest of a line leaving curBufPtr at the beginning of the new line.
+EXTRA_INLINE static void eatLine()
+{
+ for(; !atEndOfBuf(); curBufPtr++)
+ if(*curBufPtr=='\n') {
+ ++curLine;
+ ++curBufPtr;
+ return;
+ }
+}
+
+//Skip a comment, leaving curBufPtr after it.
+//Returns true if it has skipped something.
+EXTRA_INLINE static bool eatComment()
+{
+ if(atEndOfBuf()) return false;
+ if(*curBufPtr=='#') {
+ eatLine();
+ return true;
+ } else if(*curBufPtr=='/' && *(curBufPtr+1)=='/') {
+ eatLine();
+ return true;
+ } else if(*curBufPtr=='/' && *(curBufPtr+1)=='*') {
+ for(curBufPtr+=2; !atEndOfBuf(); curBufPtr++) {
+ if(*curBufPtr=='*' && *(curBufPtr+1)=='/') {
+ curBufPtr+=2;
+ return true;
+ } else if(*curBufPtr=='\n')
+ curLine++;
+ }
+ return true;
+ }
+ return false;
+}
+
+/*
+ Position curBufPtr after the end of a string (after the ending
+character). You should be positioned at the starting character of the string.
+ Takes into account new lines and escape characters.
+ Note: doesn't support "Here Documents", a different mechanism is needed
+for that.
+ Returns true if it has found the string and skipped it.
+*/
+EXTRA_INLINE static bool eatString()
+{
+ if(!atStartOfString()) return false;
+ const char endChar=*curBufPtr;
+ for(curBufPtr++; !atEndOfBuf(); curBufPtr++) {
+ if(*curBufPtr=='\n')
+ ++curLine;
+ else if(*curBufPtr=='\\') {
+ ++curBufPtr; //Skip next char...
+ if(*curBufPtr=='\n') ++curLine; //But take new lines into account!
+ } else if(*curBufPtr==endChar) {
+ ++curBufPtr; //Skip ending char!
+ return true;
+ }
+ }
+ return true;
+}
+
+//Skip blanks or comments leaving curBufPtr after them.
+//Returns true if it has skipped something.
+EXTRA_INLINE static bool eatBlanksOrComments()
+{
+ const char * const p = curBufPtr;
+ const char *lastBufPtr=0;
+ while(lastBufPtr!=curBufPtr) {
+ lastBufPtr=curBufPtr;
+ eatBlanks();
+ eatComment();
+ }
+ return p!=curBufPtr;
+}
+
+//Skip blanks, comments or strings, leaving curBufPtr after them.
+//Returns true if it has skipped something.
+EXTRA_INLINE static bool eatBlanksOrCommentsOrStrings()
+{
+ const char * const p = curBufPtr;
+ const char *lastBufPtr=0;
+ while(lastBufPtr!=curBufPtr) {
+ lastBufPtr=curBufPtr;
+ eatBlanks();
+ eatComment();
+ eatString();
+ }
+ return p!=curBufPtr;
+}
+
+/*
+ Returns true if at curBufPtr says "function" (or "class" respectively)
+case insensitively.
+ This functions avoid calling the strncasecmp libc function and speed up
+things, while at the same time not crossing the end of the buffer.
+*/
+EXTRA_INLINE static bool saysFunction()
+{
+ if(*curBufPtr!='f' && *curBufPtr!='F') return false;
+ if(*(curBufPtr+1)!='u' && *(curBufPtr+1)!='U') return false;
+ if(curBufPtr+sizeof("function")-1 >= srcBufEnd) return false;
+ if(*(curBufPtr+2)!='n' && *(curBufPtr+2)!='N') return false;
+ if(*(curBufPtr+3)!='c' && *(curBufPtr+3)!='C') return false;
+ if(*(curBufPtr+4)!='t' && *(curBufPtr+4)!='T') return false;
+ if(*(curBufPtr+5)!='i' && *(curBufPtr+5)!='I') return false;
+ if(*(curBufPtr+6)!='o' && *(curBufPtr+6)!='O') return false;
+ if(*(curBufPtr+7)!='n' && *(curBufPtr+7)!='N') return false;
+ return true;
+}
+EXTRA_INLINE static bool saysClass()
+{
+ if(*curBufPtr!='c' && *curBufPtr!='C') return false;
+ if(*(curBufPtr+1)!='l' && *(curBufPtr+1)!='L') return false;
+ if(curBufPtr+sizeof("class")-1 >= srcBufEnd) return false;
+ if(*(curBufPtr+2)!='a' && *(curBufPtr+2)!='A') return false;
+ if(*(curBufPtr+3)!='s' && *(curBufPtr+3)!='S') return false;
+ if(*(curBufPtr+4)!='s' && *(curBufPtr+4)!='S') return false;
+ return true;
+}
+
+inline static int min(int value1, int value2)
+{
+ return value1 < value2 ? value1 : value2;
+}
+
+
+/*** DEFINITIONS ***/
+
+//The entry point:
+int SearchPHPFuncs(char *srcBuffer, unsigned len, int mode, tAddFunc addFunc)
+{
+ //we ignore "mode" since we only have definitions and not prototypes.
+ srcBufStart = srcBuffer;
+ srcBufEnd = srcBufStart + len + 1; //Note: 1 past the end!
+ curBufPtr = srcBufStart;
+ curLine = 1;
+ curFuncNum = 0;
+ funcAddPtr = addFunc;
+
+ while( !atEndOfBuf() ) {
+ const eKeyWord kwrdt = goClassOrFunc();
+ if( kwrdt == KEYWORD_FUNCTION )
+ processFunc();
+ else if( kwrdt == KEYWORD_CLASS )
+ processClass();
+ else
+ ++curBufPtr; //a } could be found or other strange character.
+ }
+ return curFuncNum; //we return the number of functions found!
+}
+
+/*
+ Position curBufPtr at the first letter of a class or function
+declaration (at the beginning of its name).
+ If a } is found, we return KEYWORD_NONE.
+ If we reach the end of the buffer, it returns KEYWORD_NONE.
+ Note: doesn't detect functions or classes at the beginning of the buffer
+or at the starting of a PHP block, only when they are surrounded of blanks
+and comments, shouldn't be a big problem right?
+*/
+static eKeyWord goClassOrFunc()
+{
+ while( !atEndOfBuf() ) {
+ if( eatBlanksOrComments() ) { //Possible beginning of keyword!
+ if( saysFunction() ) {
+ curBufPtr += sizeof("function")-1;
+ if( eatBlanksOrComments() ) {
+ return KEYWORD_FUNCTION;
+ }
+ } else {
+ if( saysClass() ) {
+ curBufPtr += sizeof("class")-1;
+ if( eatBlanksOrComments() ) {
+ return KEYWORD_CLASS;
+ }
+ }
+ }
+ } else { //Not a blank or comment...
+ if(!eatString()) {
+ if(*curBufPtr=='}')
+ return KEYWORD_NONE; //Needed so we can process it
+ else //somewhere else
+ ++curBufPtr; //Unknown character, skip it.
+ }
+ }
+ }
+ return KEYWORD_NONE; //No more keywords found!
+}
+
+/*
+ Process a function. Should be called with curBufPtr pointing exactly at
+the first letter of the identifier (after eating the blanks following the
+"function" keyword).
+ It returns after processing the function body, just after the enclosing
+'}'.
+ If we are inside a class definition, then pass a pointer to the beginning
+of the name of the class and its length in characters, without counting the
+null character or other characters (real length of the word).
+*/
+static void processFunc(const char *className/*=NULL*/,
+ const unsigned classNameSize/*=0*/)
+{
+ const char *funcNameStartPtr = curBufPtr;
+ const unsigned funcStartLine = curLine;
+ goEndOfIdentifier();
+ const unsigned funcNameSize = curBufPtr-funcNameStartPtr;
+ eatBlanksOrComments();
+ if(*curBufPtr != '(') return; //Must be the parameters declaration!
+ goMatching('(',')', true);
+ const char *paramStartPtr = bfBuffer;
+ const unsigned paramSize = strlen(bfBuffer);
+ eatBlanksOrComments();
+ if(*curBufPtr != '{') return; //Must be the function body!
+ goMatching('{','}');
+
+ registerFunc(funcNameStartPtr, funcNameSize, paramStartPtr, paramSize,
+ funcStartLine, className, classNameSize);
+}
+
+
+/*
+ Process a class. Should be called with curBufPtr pointing exactly at
+the first letter of the identifier (after eating the blanks following the
+"class" keyword).
+ It returns after processing the class body, just after the enclosing
+'}'.
+*/
+static void processClass()
+{
+ const char *classNameStartPtr = curBufPtr;
+ goEndOfIdentifier();
+ const unsigned classNameSize = curBufPtr-classNameStartPtr;
+
+ while(!atEndOfBuf()) {
+ const eKeyWord kwrdt = goClassOrFunc();
+ if( kwrdt == KEYWORD_FUNCTION )
+ processFunc(classNameStartPtr, classNameSize);
+ else { //No more functions, find the end of the class:
+ while( !atEndOfBuf() ) {
+ if(*curBufPtr=='}') {
+ ++curBufPtr;
+ return;
+ }
+ if(*curBufPtr=='{')
+ goMatching('{','}');
+ else
+ if( !eatBlanksOrCommentsOrStrings() )
+ ++curBufPtr; //Unknown char.
+ }
+ }
+ }
+}
+
+/*
+ Position curBufPtr after the matching endChar, balancing the startChar's
+and endChar's between.
+ You should be positioned just over the startChar.
+ If copy==true, then it stores the text of the subexpresion in bfBuffer
+substituting comments and blanks by just a space.
+*/
+static void goMatching(const char startChar, const char endChar,
+ const bool copy/*=false*/)
+{
+ int idx=copy ? 1 : MaxLenWith0;
+ unsigned int level=1;
+ if(copy) bfBuffer[0] = *curBufPtr;
+ ++curBufPtr;
+ while(!atEndOfBuf()) {
+ if(eatBlanksOrComments()) {
+ if(idx < MaxLenWith0-2)
+ bfBuffer[idx++]=' '; //Only add a space...
+ continue; //and skip them!
+ }
+ const char *startPtr = curBufPtr;
+ if(!eatString()) {
+ if(*curBufPtr==startChar) {
+ ++level;
+ } else if(*curBufPtr==endChar) {
+ --level;
+ }
+ ++curBufPtr;
+ }
+ //Add the word to the temporary buffer:
+ for(; idx < MaxLenWith0-2 && startPtr < curBufPtr; startPtr++, idx++)
+ bfBuffer[idx]=*startPtr;
+ if(level==0) {
+ bfBuffer[idx]=0;
+ return;
+ }
+ }
+}
+
+/*
+ Position curBufPtr after the end of an identifier (name of function,
+etc.). When calling, should be positioned on the first letter of an
+identifier.
+*/
+static void goEndOfIdentifier()
+{
+ //First character must be an alphabetic letter:
+ if(!isalpha(*curBufPtr)) return;
+ ++curBufPtr;
+ for(; !atEndOfBuf() && (isalnum(*curBufPtr)||*curBufPtr=='_');
+ curBufPtr++);
+}
+
+/*
+ It calls funcAddPtr with the apropriate parameters and registers the
+function found.
+*/
+static void registerFunc(const char *funcName, const unsigned funcNameSize,
+ const char *param, const unsigned paramSize, const unsigned funcStartLine,
+ const char *className/*=NULL*/, unsigned classNameSize/*=0*/)
+{
+ ++curFuncNum;
+ int tsz=funcNameSize+paramSize+1+1+classNameSize+1;
+ if(tsz > MaxLenWith0-1) return; //Doesn't fit on the buffer!
+ char *p=bfNomFun;
+ strncpy(p, funcName, funcNameSize);
+ p+=funcNameSize;
+ strncpy(p, param, paramSize);
+ p+=paramSize;
+ if(className && classNameSize) {
+ *p++=' ';
+ *p++='(';
+ strncpy(p, className, classNameSize);
+ p+=classNameSize;
+ *p++=')';
+ }
+ *p++=0;
+
+ funcAddPtr(bfNomFun, p-bfNomFun /*Length including ending 0!*/,
+ funcStartLine, curLine);
+}
+
+
+/*
+BENCHMARKS (last updated: 2002/12/14)
+=====================================
+cat $(locate '*.php') > prueba.php
+wc prueba.php:
+87584 287427 2890866 (that's lines, words and bytes, respectively).
+
+Compile command: gcc -pipe -O2 -s -Wall -DSTANDALONE -lstdc++ \
+ -DEXTRA_INLINE='' -o pphp pphp.cc
+I tested compiling with gcc 2.95.4 and gcc 3.0.4 and with EXTRA_INLINE and
+without (four combinations).
+
+wc -c pphp pphp.30 pphp.ei pphp.30.ei:
+ 7264 pphp
+ 6652 pphp.30
+ 8960 pphp.ei
+ 7292 pphp.30.ei
+
+Then benchmarked with: sync; time ./pphp prueba.php > /dev/null
+The results:
+pphp: real 0m0.349s
+pphp.30: real 0m0.349s
+pphp.ei: real 0m0.236s (32% less time)
+pphp.30.ei: real 0m0.281s (19% less time)
+
+That's on my AMD Athlon K7 750 Mhz (real Mhz), PC133 CAS 3, Kernel 2.4.20,
+GLIBC 2.3.1.
+
+Can someone explain why the result with GCC 3.0.4 is slower than 2.95.4 and
+know if 3.2.x is any better? Benchmarks welcome!!!
+*/
+
diff --git a/setedit/mainsrc/ppython.cc b/setedit/mainsrc/ppython.cc
new file mode 100644
index 0000000..9d006d6
--- /dev/null
+++ b/setedit/mainsrc/ppython.cc
@@ -0,0 +1,451 @@
+// -*- mode:C++; tab-width: 3 -*-
+/**[txh]********************************************************************
+
+ Copyright (c) 2004 by Grzegorz Adam Hankiewicz.
+ This program is covered by the GPL license.
+
+ Description:
+ Parses a .py file looking for function and class definitions.
+ It can be compiled as an standalone program by defining STANDALONE_TEST.
+
+***************************************************************************/
+
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_string
+//#define Uses_TVCodePage
+#include <tv.h>
+
+#include <bufun.h>
+#include <assert.h>
+
+#define STATE_NOTHING 0
+#define STATE_PARAGRAPH_QUOTE 1
+#define STATE_CLASS 2
+#define STATE_FUNCTION 3
+
+#define SYMBOL_EOL 0
+#define SYMBOL_COMMENT 1
+#define SYMBOL_QUOTE_A 2
+#define SYMBOL_QUOTE_B 3
+#define SYMBOL_QUOTE_C 4
+#define SYMBOL_WHITESPACE 5
+#define SYMBOL_CLASS 6
+#define SYMBOL_FUNCTION 7
+#define SYMBOL_ESCAPE 8
+#define SYMBOL_NULL 9
+#define SYMBOL_RUBBISH 10
+#define SYMBOL_OPEN_BRACKET 11
+#define SYMBOL_CLOSE_BRACKET 12
+#define SYMBOL_COLON 13
+
+class PARSE_STATE
+{
+public:
+ int state;
+ int line;
+ char *text;
+ char *text_end;
+
+ PARSE_STATE(char *buffer, unsigned len)
+ : state(STATE_NOTHING),
+ line(1),
+ text(buffer),
+ text_end(buffer + len)
+ { }
+
+ PARSE_STATE(const PARSE_STATE &other)
+ : state(other.state),
+ line(other.line),
+ text(other.text),
+ text_end(other.text_end)
+ { }
+};
+
+typedef struct {
+ char text[MaxLenWith0];
+ int len;
+ int line_start;
+ int line_end;
+} PARSE_RESULT;
+
+/**[txh]********************************************************************
+
+ Description: Reads whatever logical symbol is found pointer by
+ the text pointer. Pass the length of how much text can be read
+ to discard long symbols and read past the end of the buffer.
+
+ Return: One of the SYMBOL defines. As a special case, end of file
+ (when length is less than 1) returns SYMBOL_EOL.
+
+***************************************************************************/
+
+static int read_symbol(const char *text, const int length)
+{
+ if (length < 1)
+ return SYMBOL_EOL;
+
+ switch (*text) {
+ case 0: return SYMBOL_NULL;
+ case ':': return SYMBOL_COLON;
+ case '(': return SYMBOL_OPEN_BRACKET;
+ case ')': return SYMBOL_CLOSE_BRACKET;
+ case '\n': return SYMBOL_EOL;
+ case '#': return SYMBOL_COMMENT;
+ case '\'': return SYMBOL_QUOTE_A;
+ case '"':
+ if (length >= 3 && text[1] == '"' && text[2] == '"')
+ return SYMBOL_QUOTE_C;
+ else
+ return SYMBOL_QUOTE_B;
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\f':
+ case '\v':
+ return SYMBOL_WHITESPACE;
+ case 'c':
+ if (length >= 6 && text[1] == 'l' && text[2] == 'a' &&
+ text[3] == 's' && text[4] == 's' &&
+ read_symbol(text + 5, length - 5) == SYMBOL_WHITESPACE)
+ return SYMBOL_CLASS;
+ else
+ return SYMBOL_RUBBISH;
+ case 'd':
+ if (length >= 4 && text[1] == 'e' && text[2] == 'f' &&
+ read_symbol(text + 3, length - 3) == SYMBOL_WHITESPACE)
+ return SYMBOL_FUNCTION;
+ else
+ return SYMBOL_RUBBISH;
+ case '\\':
+ if (length >= 2 && text[1] == '\\')
+ return SYMBOL_RUBBISH;
+ else
+ return SYMBOL_ESCAPE;
+ default:
+ return SYMBOL_RUBBISH;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: Advances the text pointer until the first instance
+ of symbol, SYMBOL_EOL, or end of text buffer.
+
+***************************************************************************/
+
+void consume_line_until(PARSE_STATE &state, int symbol)
+{
+ while (state.text < state.text_end) {
+ const int ret = read_symbol(state.text, state.text_end - state.text);
+ if (ret == symbol || ret == SYMBOL_EOL)
+ return;
+ else
+ state.text++;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: Advances the text pointer until it doesn't point
+ at whitespace.
+
+***************************************************************************/
+
+void consume_whitespace(PARSE_STATE &state)
+{
+ while (state.text < state.text_end) {
+ if (*state.text == ' ' || *state.text == '\v' || *state.text == '\t' ||
+ *state.text == '\f' || *state.text == '\r')
+ state.text++;
+ else
+ return ;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: Advances the text pointer while it points at some
+ alphanumeric letter or underscore.
+
+***************************************************************************/
+
+void consume_alphanumeric(PARSE_STATE &state)
+{
+ while (state.text < state.text_end) {
+ if (isalnum((unsigned)*state.text) || *state.text == '_')
+ state.text++;
+ else
+ return ;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: A mixed combination of other consumer helpers. This
+ advances the text pointer while it looks at whitespace, opening
+ or closing braces, commas, equal symbols and alphanumeric characters.
+
+***************************************************************************/
+
+void consume_until_colon(PARSE_STATE &state)
+{
+ while (state.text < state.text_end) {
+ if (isalnum((unsigned)*state.text) || *state.text == '_' ||
+ *state.text == ' ' || *state.text == '\v' ||
+ *state.text == '\t' || *state.text == '\f' ||
+ *state.text == '\r' || *state.text == '(' ||
+ *state.text == ')' || *state.text == ',' ||
+ *state.text == '=')
+ state.text++;
+ else
+ return ;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description: Helper to extract_symbol(), this creates a duplicate parsing
+ state to operate on the current line without disturbing the state of
+ the parent function. The helper tries to verify that the current line is
+ really pointing to a valid class line.
+
+ Return: True if the line is valid and results were saved, false otherwise.
+
+***************************************************************************/
+
+static bool detect_class_name(PARSE_RESULT &result,
+ const PARSE_STATE &parent_state)
+{
+ PARSE_STATE find_eol_state(parent_state);
+ consume_line_until(find_eol_state, SYMBOL_EOL);
+ const int length = find_eol_state.text - parent_state.text;
+ if (length >= MaxLenWith0)
+ return false;
+
+ // Copy into result buffer.
+ strncpy(result.text, parent_state.text, length);
+ result.text[length] = 0;
+
+ // Start parsing the result buffer.
+ PARSE_STATE state(result.text, length);
+ consume_alphanumeric(state);
+ char *end_of_word = state.text;
+ consume_until_colon(state);
+
+ if (read_symbol(state.text, state.text_end - state.text) == SYMBOL_COLON) {
+ *end_of_word = 0;
+ strcat(result.text, " (class)");
+ result.len = end_of_word - result.text + 8;
+ result.line_start = parent_state.line;
+ result.line_end = -1;
+ return true;
+ }
+
+ return false;
+}
+
+/**[txh]********************************************************************
+
+ Description: Helper to extract_symbol(), this creates a duplicate parsing
+ state to operate on the current line without disturbing the state of
+ the parent function. The helper tries to verify that the current line is
+ really pointing to a valid function line.
+
+ Return: True if the line is valid and results were saved, false otherwise.
+
+***************************************************************************/
+
+static bool detect_function_name(PARSE_RESULT &result,
+ const PARSE_STATE &parent_state)
+{
+ PARSE_STATE find_eol_state(parent_state);
+ consume_line_until(find_eol_state, SYMBOL_EOL);
+ const int length = find_eol_state.text - parent_state.text;
+ if (length >= MaxLenWith0)
+ return false;
+
+ // Copy into result buffer.
+ strncpy(result.text, parent_state.text, length);
+ result.text[length] = 0;
+
+ // Start parsing the result buffer.
+ PARSE_STATE state(result.text, length);
+ consume_alphanumeric(state);
+ consume_until_colon(state);
+
+ if (read_symbol(state.text, state.text_end - state.text) == SYMBOL_COLON) {
+ *state.text = 0;
+ result.len = state.text - result.text;
+ result.line_start = parent_state.line;
+ result.line_end = -1;
+ return true;
+ }
+
+ return false;
+}
+
+/**[txh]********************************************************************
+
+ Description: Main function coordinating the parsing. This is
+ basically the heart of the state machine. It works in an infinite
+ loop until either a symbol is found or all the text has been
+ processed.
+
+ Return: False if the text has been processed, true if a symbol
+ was found, in which case the results have been written in to the
+ PARSE_RESULT structure.
+
+***************************************************************************/
+
+static bool extract_symbol(PARSE_STATE &state, PARSE_RESULT &result)
+{
+ bool ret;
+
+ while (state.text < state.text_end) {
+ if (read_symbol(state.text, 1) == SYMBOL_EOL) {
+ state.text++;
+ state.line++;
+ }
+ else switch (state.state) {
+ case STATE_NOTHING:
+ switch (read_symbol(state.text, state.text_end - state.text)) {
+ case SYMBOL_RUBBISH:
+ case SYMBOL_COMMENT:
+ case SYMBOL_OPEN_BRACKET:
+ case SYMBOL_CLOSE_BRACKET:
+ case SYMBOL_COLON:
+ case SYMBOL_NULL:
+ case SYMBOL_QUOTE_A:
+ case SYMBOL_QUOTE_B:
+ case SYMBOL_ESCAPE:
+ consume_line_until(state, SYMBOL_EOL);
+ break;
+ case SYMBOL_QUOTE_C:
+ state.text += 3;
+ state.state = STATE_PARAGRAPH_QUOTE;
+ break;
+ case SYMBOL_WHITESPACE:
+ state.text++;
+ break;
+ case SYMBOL_CLASS:
+ state.text += 5;
+ consume_whitespace(state);
+ if (read_symbol(state.text, 1) != SYMBOL_EOL)
+ state.state = STATE_CLASS;
+ break;
+ case SYMBOL_FUNCTION:
+ state.text += 3;
+ consume_whitespace(state);
+ if (read_symbol(state.text, 1) != SYMBOL_EOL)
+ state.state = STATE_FUNCTION;
+ break;
+ default:
+ assert(0 && "Shouldn't reach here");
+ break;
+ }
+ break;
+
+ case STATE_PARAGRAPH_QUOTE:
+ consume_line_until(state, SYMBOL_QUOTE_C);
+ if (read_symbol(state.text, state.text_end - state.text) == SYMBOL_QUOTE_C) {
+ state.text += 3;
+ state.state = STATE_NOTHING;
+ }
+ break;
+
+ case STATE_CLASS:
+ ret = detect_class_name(result, state);
+ consume_line_until(state, SYMBOL_EOL);
+ state.state = STATE_NOTHING;
+ if (ret)
+ return ret;
+ break;
+
+ case STATE_FUNCTION:
+ ret = detect_function_name(result, state);
+ consume_line_until(state, SYMBOL_EOL);
+ state.state = STATE_NOTHING;
+ if (ret)
+ return ret;
+ break;
+
+ default:
+ assert(0 && "Shouldn't reach here");
+ break;
+ }
+ }
+
+ return false;
+}
+
+/**[txh]********************************************************************
+
+ Description: Parent function of the parsing process. Given buffer
+ of len length, it calls AddFunc for each found symbol.
+
+ Return: Number of found symbols.
+
+***************************************************************************/
+
+int SearchPythonSymbols(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ PARSE_STATE state(buffer, len);
+
+ PARSE_RESULT result;
+
+ int found_symbols = 0;
+
+ while (extract_symbol(state, result)) {
+ found_symbols++;
+ AddFunc(result.text, result.len+1, result.line_start, result.line_end);
+ }
+
+ return found_symbols;
+ mode = 0;
+}
+
+#ifdef STANDALONE_TEST
+char bfBuffer[MaxLenWith0];
+char bfNomFun[MaxLenWith0];
+char bfTempNomFun[MaxLenWith0];
+
+void PrintFunc(char *name, int len, int lineStart, int lineEnd)
+{
+ printf("`%s' [%d,%d:%d]\n", name, lineStart, lineEnd, len);
+}
+
+int main(int argc, char *argv[])
+{
+ printf("Python function/class parser, Copyright "
+ "2004 by Grzegorz Adam Hankiewicz.\n");
+ if (argc != 2) {
+ printf("Use: ppython file\n");
+ return 1;
+ }
+
+ FILE *f = fopen(argv[1], "rt");
+ if (!f) {
+ printf("Can't open %s\n", argv[1]);
+ return 2;
+ }
+
+ fseek(f, 0, SEEK_END);
+ long len = ftell(f);
+ fseek(f, 0, SEEK_SET);
+ char *buffer = new char[len + 1];
+ long bread = fread(buffer, len, 1, f);
+
+ if (bread != 1) {
+ printf("Error reading file %s\n", argv[1]);
+ perror("Error");
+ fclose(f);
+ return 3;
+ }
+ fclose(f);
+ buffer[len]=0;
+ SearchPythonSymbols(buffer, len, 0, PrintFunc);
+
+ return 0;
+}
+#endif // STANDALONE_TEST
diff --git a/setedit/mainsrc/pvarious.cc b/setedit/mainsrc/pvarious.cc
new file mode 100644
index 0000000..9ec6203
--- /dev/null
+++ b/setedit/mainsrc/pvarious.cc
@@ -0,0 +1,378 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001-2005 by Salvador Eduardo Tropea.
+ This program is covered by the GPL license.
+
+ Description:
+ Parses a .shl, .txi, .pmc or assembler file looking for function
+definitions.
+ It can be compiled as an standalone program by defining STANDALONE.
+
+***************************************************************************/
+
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_string
+#define Uses_TVCodePage
+#define Uses_snprintf
+#include <settvuti.h>
+
+#include <bufun.h>
+
+//#define STANDALONE
+
+static unsigned Index,Line,Len;
+static unsigned char *Buffer;
+typedef unsigned char uchar;
+
+static
+void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+static
+char *MoveAfterEqual(char *s)
+{
+ for (; *s && *s!='='; s++);
+ if (*s) s++;
+ for (; *s && isspace((uchar)*s); s++);
+ return s;
+}
+
+static
+char *MoveAfterColon(char *s)
+{
+ for (; *s && *s!=':'; s++);
+ if (*s) s++;
+ for (; *s && isspace((uchar)*s); s++);
+ return s;
+}
+
+static
+void GetLine()
+{
+ int i=0;
+ while (Index<Len && Buffer[Index]!='\n' && i<MaxLen)
+ bfBuffer[i++]=Buffer[Index++];
+ bfBuffer[i]=0;
+ while (Index<Len && Buffer[Index]!='\n') Index++;
+ if (Index<Len && Buffer[Index]=='\n') Index++;
+}
+
+int SearchSHLDefs(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned lineFound=0,funcs=0;
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ if (strncasecmp(bfBuffer,"Name",4)==0 && !TVCodePage::isAlpha((uchar)bfBuffer[4]))
+ {
+ char *pos=MoveAfterEqual(bfBuffer);
+ ReplaceCRby0(pos);
+ strcpy(bfNomFun,pos);
+ lineFound=Line;
+ }
+ else if (strncasecmp(bfBuffer,"End",3)==0)
+ {
+ AddFunc(bfNomFun,strlen(bfNomFun)+1,lineFound,Line);
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+struct Entry
+{
+ const char *name;
+ int len;
+};
+
+static
+Entry Sections[]=
+{
+{"chapter",7},
+{"section",7},
+{"subsection",10},
+{"subsubsection",13},
+{"top",3},
+{"unnumbered",10},
+{"unnumberedsec",13},
+{"unnumberedsubsec",16},
+{"unnumberedsubsubsec",19},
+{"appendix",8},
+{"appendixsec",11},
+{"appendixsubsec",14},
+{"appendixsubsubsec",17},
+{0,0}};
+
+int SearchTxiSecs(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned funcs=0;
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ if (bfBuffer[0]=='@')
+ {
+ int i;
+ for (i=0; Sections[i].name; i++)
+ {
+ if (strncmp(Sections[i].name,bfBuffer+1,Sections[i].len)==0 &&
+ isspace((uchar)bfBuffer[1+Sections[i].len]))
+ {
+ char *pos=bfBuffer+1+Sections[i].len;
+ for (; *pos && isspace((uchar)*pos); pos++);
+ ReplaceCRby0(pos);
+ strcpy(bfNomFun,pos);
+ int l=strlen(bfNomFun);
+ if (l+3+Sections[i].len<MaxLen)
+ {
+ strcpy(bfNomFun+l," (");
+ strcpy(bfNomFun+l+2,Sections[i].name);
+ strcpy(bfNomFun+l+2+Sections[i].len,")");
+ l+=3+Sections[i].len;
+ }
+ AddFunc(bfNomFun,l+1,Line,-1);
+ funcs++;
+ break;
+ }
+ }
+ }
+ }
+ return funcs;
+}
+
+static
+int IsAsmChar(uchar s)
+{
+ return isalnum(s) || s=='_' || s=='@' || s=='$';
+}
+
+static
+int GetLabel(int &len)
+{
+ int i=0;
+ while (IsAsmChar(bfBuffer[i]))
+ {
+ bfNomFun[i]=bfBuffer[i];
+ i++;
+ }
+ bfNomFun[i]=0;
+ len=i;
+ return bfBuffer[i]==':' && i!=0;
+}
+
+int SearchAsmLabels(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned funcs=0;
+ int l;
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ if (GetLabel(l))
+ {
+ AddFunc(bfNomFun,l+1,Line,-1);
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+int SearchPMDefs(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned lineFound=0,funcs=0,lenNom=0;
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ ReplaceCRby0(bfBuffer);
+ if (strncasecmp(bfBuffer,"Trigger:",8)==0 && isspace((uchar)bfBuffer[8]))
+ {
+ char *pos=MoveAfterColon(bfBuffer);
+ strncpyZ(bfTempNomFun,pos,MaxLenWith0);
+ lineFound=Line;
+ }
+ else if (strncasecmp(bfBuffer,"Name:",5)==0 && isspace((uchar)bfBuffer[5]))
+ {
+ char *pos=MoveAfterColon(bfBuffer);
+ lenNom=CLY_snprintf(bfNomFun,MaxLenWith0,"%s %s",pos,bfTempNomFun);
+ }
+ else if (lineFound && lenNom && !bfBuffer[0]) // Empty line
+ {
+ AddFunc(bfNomFun,lenNom+1,lineFound,Line);
+ lineFound=lenNom=0;
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+
+int SearchKICADLib(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned lineFound=0,funcs=0,lenNom=0;
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ ReplaceCRby0(bfBuffer);
+ if (strncasecmp(bfBuffer,"DEF",3)==0 && isspace((uchar)bfBuffer[3]))
+ {
+ char *pos=bfBuffer+3;
+ for (;*pos && isspace((uchar)*pos); pos++);
+ for (lenNom=0;*pos && !isspace((uchar)*pos) && lenNom<(unsigned)MaxLen_1; pos++)
+ bfNomFun[lenNom++]=*pos;
+ bfNomFun[lenNom++]=0;
+ lineFound=Line;
+ }
+ else if (strncasecmp(bfBuffer,"ENDDEF",6)==0 &&
+ (bfBuffer[6]==0 || isspace((uchar)bfBuffer[6])))
+ {
+ AddFunc(bfNomFun,lenNom,lineFound,Line);
+ lineFound=lenNom=0;
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+static
+int IsMakeChar(uchar s)
+{
+ return isalnum(s) || s=='_' || s=='-';
+}
+
+static
+int GetMakeLabel(int &len)
+{
+ int i=0;
+ while (IsMakeChar(bfBuffer[i]))
+ {
+ if (i<MaxLen)
+ bfNomFun[i]=bfBuffer[i];
+ i++;
+ }
+ bfNomFun[i]=0;
+ len=i;
+ return bfBuffer[i]==':' && i!=0;
+}
+
+int SearchMakeLabels(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned funcs=0;
+ int l;
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ if (GetMakeLabel(l))
+ {
+ AddFunc(bfNomFun,l+1,Line,-1);
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+
+static
+char *GetHTMLAnchor(int &len, char *buffer)
+{
+ char *pos, *s, delim;
+
+ s=buffer;
+ while ((pos=strstr(s,"name"))!=NULL)
+ {
+ for (s=pos+4; *s && isspace((uchar)*s); s++);
+ if (*s=='=')
+ {
+ for (s++; *s && isspace((uchar)*s); s++);
+ if (*s=='\'' || *s=='"')
+ delim=*s;
+ else
+ delim=0;
+ s++;
+ int l;
+ for (l=0; l<MaxLen && ((delim && s[l]!=delim) ||
+ (!delim && isspace((uchar)s[l]))); l++)
+ bfNomFun[l]=s[l];
+ bfNomFun[l]=0;
+ s+=l+1;
+ len=l;
+ return s;
+ }
+ }
+ return NULL;
+}
+
+int SearchHTMLAnchors(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned funcs=0;
+ int l;
+
+ Index=0; Line=0; Len=len; Buffer=(uchar *)buffer;
+ while (Index<len)
+ {
+ GetLine(); Line++;
+ char *buffer=bfBuffer;
+ while ((buffer=GetHTMLAnchor(l,buffer))!=NULL)
+ {
+ AddFunc(bfNomFun,l+1,Line,-1);
+ funcs++;
+ }
+ }
+ return funcs;
+}
+
+
+#ifdef STANDALONE
+char bfBuffer[MaxLenWith0];
+char bfNomFun[MaxLenWith0];
+char bfTempNomFun[MaxLenWith0];
+
+void PrintFunc(char *name, int len, int lineStart, int lineEnd)
+{
+ printf("%s [%d,%d]\n",name,lineStart,lineEnd);
+}
+
+int main(int argc, char *argv[])
+{
+ //printf(".SHL Definitions Parser, Copyright 2001 by Salvador E. Tropea\n");
+ //printf(".TXI Definitions Parser, Copyright 2001 by Salvador E. Tropea\n");
+ printf("Assembler Labels Parser, Copyright 2001 by Salvador E. Tropea\n");
+ if (argc!=2)
+ {
+ printf("Use: pvarious file\n");
+ return 1;
+ }
+ FILE *f=fopen(argv[1],"rt");
+ if (!f)
+ {
+ printf("Can't open %s\n",argv[1]);
+ return 2;
+ }
+ fseek(f,0,SEEK_END);
+ long len=ftell(f);
+ fseek(f,0,SEEK_SET);
+ char *buffer=new char[len+1];
+ long bread=fread(buffer,len,1,f);
+ if (bread!=1)
+ {
+ printf("Error reading file %s\n",argv[1]);
+ perror("Error");
+ fclose(f);
+ return 3;
+ }
+ fclose(f);
+ buffer[len]=0;
+ //SearchSHLDefs(buffer,len,0,PrintFunc);
+ //SearchTxiSecs(buffer,len,0,PrintFunc);
+ SearchAsmLabels(buffer,len,0,PrintFunc);
+
+ return 0;
+}
+#endif // STANDALONE
diff --git a/setedit/mainsrc/pvhdl.cc b/setedit/mainsrc/pvhdl.cc
new file mode 100644
index 0000000..a898e5f
--- /dev/null
+++ b/setedit/mainsrc/pvhdl.cc
@@ -0,0 +1,335 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001-2005 by Salvador Eduardo Tropea.
+ This program is covered by the GPL license.
+
+ Description:
+ Parses a VHDL description looking for entities, architectures, components,
+functions, procedures and packages definitions.
+ It can be compiled as an standalone program by defining STANDALONE.
+ That's just an heuristic, not a real parser and I'm quite sure it can be
+fulled, but is fast and small.
+ Based on the Perl parser.
+
+***************************************************************************/
+
+//#define STANDALONE_TEST
+
+#ifndef STANDALONE_TEST
+ #define Uses_snprintf
+ #define Uses_string
+ #define Uses_stdio
+ #define Uses_ctype
+ #include <compatlayer.h>
+ #include <bufun.h>
+#else
+ const int MaxLenWith0=256,MaxLen=255,MaxLen_1=254;
+ extern char bfBuffer[];
+ extern char bfNomFun[];
+ extern char bfTempNomFun[];
+ typedef void (*tAddFunc)(char *name, int len, int lineStart, int lineEnd);
+ #define CLY_snprintf snprintf
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
+#endif
+
+static unsigned Index,Line,lenWord,Len;
+static unsigned char *Buffer;
+static int canBeStr=0;
+
+static
+void GetEndOfStr(unsigned char end)
+{
+ for (Index++; Index<Len; Index++)
+ {
+ if (Buffer[Index]=='\n')
+ {
+ Line++;
+ continue;
+ }
+ if (Buffer[Index]=='\\')
+ Index++;
+ else
+ if (Buffer[Index]==end)
+ break;
+ }
+ Index++;
+}
+
+static
+void AddToWord(char val)
+{
+ if (lenWord<(unsigned)MaxLen_1)
+ {
+ bfBuffer[lenWord++]=val;
+ bfBuffer[lenWord]=0;
+ }
+ Index++;
+}
+
+static
+int isWordChar()
+{
+ return (isalnum(Buffer[Index]) || Buffer[Index]=='_');
+}
+
+static
+void GetWordChars()
+{
+ while (Index<Len && isWordChar())
+ AddToWord(Buffer[Index]);
+}
+
+static
+void GetUptoStr()
+{
+ while (Index<Len && Buffer[Index]!='"')
+ AddToWord(Buffer[Index]);
+}
+
+static
+void EatSpaces()
+{
+ for (; Index<Len && isspace(Buffer[Index]); Index++)
+ if (Buffer[Index]=='\n')
+ Line++;
+}
+
+static
+int GetNextValue()
+{
+ lenWord=0;
+ bfBuffer[0]=0;
+ while (Index<Len)
+ {// Eat spaces
+ EatSpaces();
+ if (Buffer[Index]=='-' && Buffer[Index+1]=='-')
+ { // EOL comment eat upto the EOL
+ for (; Index<Len && Buffer[Index]!='\n'; Index++);
+ if (Buffer[Index]=='\n')
+ {
+ Index++;
+ Line++;
+ }
+ continue;
+ }
+ switch (Buffer[Index])
+ {
+ case '"': // String, search the end
+ if (!canBeStr)
+ GetEndOfStr('"');
+ else
+ {
+ Index++;
+ GetUptoStr();
+ Index++;
+ return 1;
+ }
+ break;
+ default:
+ AddToWord(Buffer[Index]);
+ Index--;
+ if (isWordChar())
+ {
+ Index++;
+ GetWordChars();
+ return 1;
+ }
+ Index++;
+ return 0;
+ }
+ }
+ return 0;
+}
+
+static
+void GetWord()
+{
+ do
+ {
+ if (GetNextValue()==1)
+ return;
+ }
+ while (Index<Len);
+}
+
+static
+void SearchBalance(char start, char end)
+{
+ int level=1;
+ do
+ {
+ if (GetNextValue()==0)
+ {
+ if (bfBuffer[0]==start)
+ level++;
+ else
+ if (bfBuffer[0]==end)
+ {
+ level--;
+ if (level==0)
+ break;
+ }
+ }
+ }
+ while (Index<Len);
+}
+
+void GetFunction(const char *type, tAddFunc AddFunc)
+{
+ unsigned lenFound,lineFound;
+ int proto=0;
+
+ canBeStr=1;
+ GetWord();
+ canBeStr=0;
+ lineFound=Line;
+ strcpy(bfNomFun,bfBuffer);
+ do
+ {
+ int nv=GetNextValue();
+ if (nv==0)
+ {
+ if (bfBuffer[0]=='(')
+ SearchBalance('(',')');
+ else if (bfBuffer[0]==';')
+ {
+ proto=1;
+ break;
+ }
+ }
+ else if (nv==1 && strcasecmp(bfBuffer,"is")==0)
+ {
+ break;
+ }
+ }
+ while (Index<Len);
+ lenFound=CLY_snprintf(bfTempNomFun,MaxLenWith0,"%s [%s%s]",bfNomFun,type,
+ proto ? " Declaration" : "");
+ AddFunc(bfTempNomFun,lenFound+1,lineFound,-1);
+}
+
+int SearchVHDLStuff(char *buffer, unsigned len, int mode, tAddFunc AddFunc)
+{
+ unsigned lenFound,lineFound,funcs=0;
+ Index=0; Line=1; Len=len; Buffer=(unsigned char *)buffer;
+ while (Index<len)
+ {
+ GetWord();
+ if (strcasecmp(bfBuffer,"entity")==0)
+ {
+ GetWord();
+ lenFound=CLY_snprintf(bfTempNomFun,MaxLenWith0,"%s [Entity]",bfBuffer);
+ AddFunc(bfTempNomFun,lenFound+1,Line,-1);
+ funcs++;
+ }
+ else if (strcasecmp(bfBuffer,"architecture")==0)
+ {
+ GetWord();
+ // Name of the architecture
+ lineFound=Line;
+ strcpy(bfNomFun,bfBuffer);
+ // "of"
+ GetWord();
+ if (strcasecmp(bfBuffer,"of"))
+ continue;
+ // Name of the entity
+ GetWord();
+ lenFound=CLY_snprintf(bfTempNomFun,MaxLenWith0,"%s [Architecture of %s]",
+ bfNomFun,bfBuffer);
+ AddFunc(bfTempNomFun,lenFound+1,lineFound,-1);
+ }
+ else if (strcasecmp(bfBuffer,"component")==0)
+ {
+ GetWord();
+ lenFound=CLY_snprintf(bfTempNomFun,MaxLenWith0,"%s [Component]",
+ bfBuffer);
+ AddFunc(bfTempNomFun,lenFound+1,Line,-1);
+ funcs++;
+ }
+ else if (strcasecmp(bfBuffer,"function")==0)
+ {
+ GetFunction("Function",AddFunc);
+ funcs++;
+ }
+ else if (strcasecmp(bfBuffer,"procedure")==0)
+ {
+ GetFunction("Procedure",AddFunc);
+ funcs++;
+ }
+ else if (strcasecmp(bfBuffer,"package")==0)
+ {
+ GetWord();
+ if (strcasecmp(bfBuffer,"body")==0)
+ {
+ GetWord();
+ lenFound=CLY_snprintf(bfTempNomFun,MaxLenWith0,"%s [Package body]",
+ bfBuffer);
+ }
+ else
+ {
+ lenFound=CLY_snprintf(bfTempNomFun,MaxLenWith0,
+ "%s [Package declaration]",bfBuffer);
+ }
+ AddFunc(bfTempNomFun,lenFound+1,Line,-1);
+ funcs++;
+ }
+ else if (strcasecmp(bfBuffer,"end")==0)
+ {// Get the next word to avoid confusing things like "End Entity XXXX"
+ // First make sure we have a word
+ EatSpaces();
+ if (Buffer[Index]!=';')
+ {
+ canBeStr=1; // For overloaded operators
+ GetWord();
+ canBeStr=0;
+ }
+ }
+ }
+ return funcs;
+}
+
+#ifdef STANDALONE_TEST
+char bfBuffer[MaxLenWith0];
+char bfNomFun[MaxLenWith0];
+char bfTempNomFun[MaxLenWith0];
+
+void PrintFunc(char *name, int len, int lineStart, int lineEnd)
+{
+ printf("%s [%d,%d]\n",name,lineStart,lineEnd);
+}
+
+int main(int argc, char *argv[])
+{
+ printf("VHDL Pseudo-parser, Copyright 2001-2005 by Salvador E. Tropea\n");
+ if (argc!=2)
+ {
+ printf("Use: pvhdl file\n");
+ return 1;
+ }
+ FILE *f=fopen(argv[1],"rt");
+ if (!f)
+ {
+ printf("Can't open %s\n",argv[1]);
+ return 2;
+ }
+ fseek(f,0,SEEK_END);
+ long len=ftell(f);
+ fseek(f,0,SEEK_SET);
+ char *buffer=new char[len+1];
+ long bread=fread(buffer,len,1,f);
+ if (bread!=1)
+ {
+ printf("Error reading file %s\n",argv[1]);
+ perror("Error");
+ fclose(f);
+ return 3;
+ }
+ fclose(f);
+ buffer[len]=0;
+ SearchVHDLStuff(buffer,len,0,PrintFunc);
+
+ return 0;
+}
+#endif // STANDALONE
diff --git a/setedit/mainsrc/rhideint.cc b/setedit/mainsrc/rhideint.cc
new file mode 100644
index 0000000..6937eda
--- /dev/null
+++ b/setedit/mainsrc/rhideint.cc
@@ -0,0 +1,374 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_stdlib
+#include <tv.h>
+#define Uses_EditorId
+#define Uses_TCEditor_External
+#include <ced_exte.h>
+#include <edmsg.h>
+#include "rhutils.h"
+
+class TCEditor;
+extern int FindFile(const char *name, char *&fullName);
+
+/**[txh]********************************************************************
+
+ Comments:
+ This module is used to interface with RHIDE.@p
+ Here is the interface with the message window of RHIDE. The module is
+100% untested so Robert must check it, I simply can't.@p
+ Note that from time to time I add new functions here that are just dummies
+to compile RHIDE but they need to be implemented propperly in RHIDE.
+
+***************************************************************************/
+
+extern void show_message(const char *msg, const char *file=NULL,
+ int line=0, int column=0, int msg_type=0);
+/*
+This function can then be declared for the standalone editor
+by you and for RHIDE by me and then the editor class can
+call this function if it wants to show something.
+
+The prototype of the function is derived from my currently
+used message record, which has the following structure
+
+typedef enum {
+ msgError,
+ msgWarning,
+ msgMessage
+} msgType;
+
+struct MsgRec
+{
+ char * filename;
+ msgType type;
+ int lineno;
+ int column;
+ char * msg;
+ MsgRec(const char *file_name,const char *msg,
+ msgType atype = msgMessage,
+ int alineno = 0, int acolumn = 1);
+ ~MsgRec();
+};
+*/
+
+void EdShowMessage(const char *msg, Boolean /*remove_old*/)
+{
+ show_message(msg,NULL,0,0,2);
+}
+
+void EdShowMessageI(const char *msg, unsigned /*Options*/)
+{
+ char *aux=TVIntl::getTextNew(msg);
+ show_message(aux,NULL,0,0,2);
+ DeleteArray(aux);
+}
+
+void EdShowMessageI(const char *msg, Boolean , Boolean )
+{
+ char *aux=TVIntl::getTextNew(msg);
+ show_message(aux,NULL,0,0,2);
+ DeleteArray(aux);
+}
+
+void EdShowMessageFile(const char *msg, FileInfo &fInfo, char *fileName,
+ unsigned /*Options*/)
+{
+ show_message(msg,fileName,fInfo.Line,fInfo.Column,0);
+}
+
+void EdJumpToMessage(ccIndex )
+{
+}
+
+// It should reload a file from disk
+int EdReloadIfOpened(const char *name, stEditorId *id)
+{
+ return 0;
+}
+
+extern int RunProgram(const char *cmd,
+ Boolean redir_stderr,Boolean redir_stdout,
+ Boolean SwitchToUser);
+
+/**[txh]********************************************************************
+
+ Description:
+ This function is needed for sLisp, it must call an external program using
+system. In the editor the stderr is redirected and I parse the errors.
+ IMPORTANT! one flag passed to it can indicate we want to redirect the
+input stream of the child process:
+
+ if ((flags & repRedirIn) && RedirInputFile && strlen(RedirInputFile)+
+ strlen(s)+4<PATH_MAX)
+
+ This should be implemented in RHIDE. I already copied the support functions
+that stores/remove the data into a temporal file whose name is pointed by
+RedirInputFile.
+
+***************************************************************************/
+
+void RunExternalProgram(char *Program, unsigned )
+{
+ if (!Program)
+ return;
+ RunProgram((const char *)Program,True,True,False);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Dummy for the sLisp redirection to a variable. Robert should provide a
+replacement.
+
+***************************************************************************/
+
+char *RunExternalProgramGetFile(int &len)
+{
+ len=0;
+ char *s=new char[1];
+ *s=0;
+ return s;
+}
+
+static char *RedirInputFile=0;
+
+/**[txh]********************************************************************
+
+ Description:
+ Saves the indicated data to a temporal file. It can be used to redirect
+the input of a program when calling RunExternalProgram with the repRedirIn
+option. Use RunExternalProgramRemoveInRedir to release the used resources.
+@x{RunExternalProgramRemoveInRedir}.
+
+***************************************************************************/
+
+void RunExternalProgramSetInRedir(const char *buffer, unsigned len)
+{
+ free(RedirInputFile);
+ RedirInputFile=unique_name("in");
+ FILE *f=fopen(RedirInputFile,"wb");
+ if (f)
+ {
+ fwrite(buffer,len,1,f);
+ fclose(f);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Releases all the resourses allocated by RunExternalProgramSetInRedir.
+@x{RunExternalProgramSetInRedir}.
+
+***************************************************************************/
+
+void RunExternalProgramRemoveInRedir()
+{
+ if (RedirInputFile)
+ {
+ unlink(RedirInputFile);
+ free(RedirInputFile);
+ RedirInputFile=0;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Dummy for the Special Lines Manager (spliman.cc)
+
+***************************************************************************/
+
+void SpLinesUpdate()
+{
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Dummy for the EdShowMessage(const char*,bool,bool) (edmsg.cc)
+
+***************************************************************************/
+
+void EdShowMessage (const char *, bool, bool)
+{
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Dummy for the GiveAdvice(int) (advice.cc)
+
+***************************************************************************/
+
+int GiveAdvice (int)
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Selects the window that matchs the provided number. The number can be
+negative indicating a type of DskWin object, in this case the first match
+is returned.
+
+ Return: !=0 if the window was selected.
+
+***************************************************************************/
+
+int SelectWindowNumber(int number)
+{
+ return 0;
+}
+
+// The following doesn't have to be implemented by RHIDE.
+TCEditor *GetCurrentIfEditor()
+{
+ return NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to know the biggest number of editor window
+
+ Return: The biggest number or 0 if no editors.
+
+***************************************************************************/
+
+int GetMaxWindowNumber()
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Look for a file name in the project. If the file is there return the full
+name of the file (with path).
+ This is also used by the function that looks for a file under the cursor.
+
+ Return: A newly allocated file name or NULL.
+
+***************************************************************************/
+
+char *GetAbsForNameInPrj(const char * /*name*/)
+{
+ return NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ My function have an extra argument, this wrapper adapts it to RHIDE's
+version.
+
+***************************************************************************/
+
+int FindFile(const char *name, char *&fullName, const char *)
+{
+ return FindFile(name,fullName);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Open the @<var>{fullName} file.
+
+ Return: opfAlreadyThere if the file was already opened, opfOpened if we
+opened it to fulfill this request and opfFail if the file doesn't exists.
+The @<var>{number} variable is filled with the window number.
+
+***************************************************************************/
+
+int OpenFileFromEditorRet(char *, int &)
+{
+ return opfFail;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the file name of the project item indicated by @<var>{number}.
+
+ Return: A newly allocated string (using malloc) containing the name. An
+empty string on fail (also allocated).
+
+***************************************************************************/
+
+char *GetProjectItem(int )
+{
+ return string_dup(NULL);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to know how many items contains the project.
+
+ Return: The number of items, 0 on fail.
+
+***************************************************************************/
+
+int GetMaxProjectItem()
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the requested window.
+
+ Return: !=0 if the window was there.
+
+***************************************************************************/
+
+int CloseWindowNumber(int )
+{
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description: Returns the number of cols for the indicated window.
+
+ Return: 78
+
+***************************************************************************/
+
+int GetWindowCols(int )
+{
+ return 78;
+}
+
+/**[txh]********************************************************************
+
+ Description: Returns the number of rows for the indicated window.
+
+ Return: 21
+
+***************************************************************************/
+
+int GetWindowRows(int )
+{
+ return 21;
+}
+
+/**[txh]********************************************************************
+
+ Description: Returns the wrap column for the indicated window.
+
+ Return: 60
+
+***************************************************************************/
+
+int GetWrapCol(int )
+{
+ return 60;
+}
diff --git a/setedit/mainsrc/sdginter.cc b/setedit/mainsrc/sdginter.cc
new file mode 100644
index 0000000..d6e41e3
--- /dev/null
+++ b/setedit/mainsrc/sdginter.cc
@@ -0,0 +1,218 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#ifndef SUP_SDG
+#define Uses_fpstream
+#include <tv.h>
+void SDGInterfaceRun(void) {}
+void SDGInterfaceDialog(void) {}
+void SDGInterfaceSaveData(fpstream *) {}
+void SDGInterfaceReadData(fpstream *) {}
+#else
+#define Uses_stdio
+#define Uses_string
+#define Uses_snprintf
+#include <txhgen.h>
+#define Uses_TMLISDGDefs
+#define Uses_MsgBox
+#define Uses_TDialog
+#define Uses_TInputLine
+#define Uses_TCheckBoxes
+#define Uses_TRect
+#define Uses_TButton
+#define Uses_TLabel
+#define Uses_TSItem
+#define Uses_fpstream
+#define INCL_TV_H
+#include <mli.h>
+class TSOSListBox;
+#include <edmsg.h>
+#define Uses_SETAppDialogs
+#define Uses_SETAppVarious
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <edspecs.h>
+
+extern char *DskPrjGetNextFile(int &l, int &MustBeDeleted, char *FileName);
+extern int DskPrjSDGInit(void);
+
+const int maxStrs=120;
+
+typedef struct
+{
+ char format[maxStrs];
+ char temp[maxStrs];
+ char out[maxStrs];
+ char files_dir[maxStrs];
+ uint32 options;
+} TSDGDiagRec;
+
+static TSDGDiagRec SDGOps = {"html.frt","Generated.txh","out","",1};
+
+static void PrintMessage(char *s)
+{
+ //messageBox(s, mfOKButton | mfError);
+ EdShowMessage(s);
+}
+
+static
+void InitOps(void)
+{
+ if (SDGOps.files_dir[0]==0)
+ {
+ const char *v;
+ if ((v=GetVariable("SET_FILES"))!=NULL)
+ strcpy(SDGOps.files_dir,v);
+ else
+ strcpy(SDGOps.files_dir,".");
+ }
+}
+
+#define IntMessage1(a,b) aux=TVIntl::getTextNew(a); \
+ CLY_snprintf(buf,256,aux,b); \
+ EdShowMessage(buf); \
+ DeleteArray(aux);
+#define IntMessage2(a,b,c) aux=TVIntl::getTextNew(a); \
+ CLY_snprintf(buf,256,aux,b,c); \
+ EdShowMessage(buf); \
+ DeleteArray(aux);
+#define IntMessage3(a,b,c,d) aux=TVIntl::getTextNew(a); \
+ CLY_snprintf(buf,256,aux,b,c,d); \
+ EdShowMessage(buf); \
+ DeleteArray(aux);
+
+void SDGInterfaceRun(void)
+{
+ InitOps();
+
+ // These variables controls SDG
+ TXHGetNextFile=DskPrjGetNextFile;
+ TXHKeepTemporal=SDGOps.options & 1;
+ TXHFormatFile=SDGOps.format;
+ TXHTempGenFile=SDGOps.temp;
+ TXHOutBaseName=SDGOps.out;
+ TXHFilesDir=SDGOps.files_dir;
+ TXHPrintMessage=PrintMessage;
+
+ if (DskPrjSDGInit())
+ return;
+ // Init the Message Window
+ EdShowMessageI(__("Starting SDG:"),True);
+
+ int error;
+ if ((error=TXHGenerateAll())!=0)
+ {
+ char buf[256];
+ char *aux;
+ IntMessage1(__("Error while %s:"),TXHGetErrorSection(error))
+ switch (error)
+ {
+ case 1:
+ IntMessage3(__("(%d) %s in line %d"),TXHError,TXHGetErrorMessage(),TXHLine)
+ break;
+ case 0:
+ case 2:
+ sprintf(buf,"(%d) %s",TXHError,TXHGetErrorMessage());
+ EdShowMessage(buf);
+ break;
+ case 3:
+ IntMessage1(__("In section %s"),TXHGetGenSect())
+ IntMessage1(__("Type of error: %s"),MLISDGTypeError)
+ EdShowMessage(MLISDGErrorName);
+ IntMessage1(__("Code: ...%s..."),MLISDGErrorCode)
+ break;
+ }
+ }
+ EdShowMessageI(__("End of SDG"));
+ ReLoadModifEditors();
+}
+
+#define AnDiag 46
+#define XIns 2
+#define AnIns (AnDiag-2)
+#define DeltaIn 3
+// Format input
+#define XFRT XIns
+#define AnFRT AnIns
+#define YFRT 3
+// Intermediate input
+#define XINT XIns
+#define AnINT AnIns
+#define YINT (YFRT+DeltaIn)
+// Output file
+#define XOUT XIns
+#define AnOUT AnIns
+#define YOUT (YINT+DeltaIn)
+// Files directory
+#define XDIR XIns
+#define AnDIR AnIns
+#define YDIR (YOUT+DeltaIn)
+// Options
+#define nOPS 1
+#define XOPS XIns
+#define AnOPS AnIns
+#define YOPS (YDIR+2)
+// Buttons
+#define AnOK 10
+#define AnCan 12
+#define XOK ((AnDiag-AnOK-AnCan-2)/2)
+#define YOK (YOPS+2)
+#define XCan (XOK+AnOK+2)
+#define YCan YOK
+
+#define AlDiag YOK+3
+
+static TDialog *SDGCreateDialog(void)
+{
+ TDialog *d=new TDialog(TRect(0,0,AnDiag,AlDiag),__("SDG Parameters"));
+
+ d->options|=ofCentered;
+ d->helpCtx =cmeSDGDialog;
+
+ TInputLine *format=new TInputLine(TRect(XFRT,YFRT,AnFRT,YFRT+1),maxStrs);
+ d->insert(format);
+ d->insert(new TLabel(TRect(XFRT,YFRT-1,AnFRT,YFRT),__("~F~ormat file (.frt)"),format));
+
+ TInputLine *intermediate=new TInputLine(TRect(XINT,YINT,AnINT,YINT+1),maxStrs);
+ d->insert(intermediate);
+ d->insert(new TLabel(TRect(XINT,YINT-1,AnINT,YINT),__("~I~ntermediate file"),intermediate));
+
+ TInputLine *outfile=new TInputLine(TRect(XOUT,YOUT,AnOUT,YOUT+1),maxStrs);
+ d->insert(outfile);
+ d->insert(new TLabel(TRect(XOUT,YOUT-1,AnOUT,YOUT),__("~B~ase output (no extentions)"),outfile));
+
+ TInputLine *dir=new TInputLine(TRect(XDIR,YDIR,AnDIR,YDIR+1),maxStrs);
+ d->insert(dir);
+ d->insert(new TLabel(TRect(XDIR,YDIR-1,AnDIR,YDIR),__("~D~irectory of formats"),dir));
+
+ d->insert(new TCheckBoxes32(TRect(XOPS,YOPS,AnOPS,YOPS+nOPS),
+ new TSItem( __("K~e~ep intermediate"), 0 )));
+
+ d->insert(new TButton(TRect(XOK,YOK,XOK+AnOK,YOK+2),__("O~K~"),cmOK,bfDefault));
+ d->insert(new TButton(TRect(XCan,YCan,XCan+AnCan,YCan+2),__("Cancel"),cmCancel,bfNormal));
+
+ d->selectNext( False );
+ return d;
+}
+
+void SDGInterfaceDialog(void)
+{
+ TSDGDiagRec ops;
+
+ InitOps();
+ memcpy(&ops,&SDGOps,sizeof(SDGOps));
+ if (execDialog(SDGCreateDialog(),&ops)!=cmCancel)
+ memcpy(&SDGOps,&ops,sizeof(SDGOps));
+}
+
+void SDGInterfaceSaveData(fpstream *f)
+{
+ f->writeBytes(&SDGOps,sizeof(TSDGDiagRec));
+}
+
+void SDGInterfaceReadData(fpstream *f)
+{
+ f->readBytes(&SDGOps,sizeof(TSDGDiagRec));
+}
+#endif
diff --git a/setedit/mainsrc/search.cc b/setedit/mainsrc/search.cc
new file mode 100644
index 0000000..c0e0222
--- /dev/null
+++ b/setedit/mainsrc/search.cc
@@ -0,0 +1,630 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This module have all the low level functions for search and replace in
+the editor. I put it in a separated file because the support of normal
+search, RegEx and PCRE is a little complex and messy.
+
+***************************************************************************/
+#include <ceditint.h>
+
+#include <stddef.h>
+#define Uses_regex
+#define Uses_string
+#define Uses_TVCodePage
+#include <stdio.h>
+
+#include <ced_pcre.h>
+#define Uses_AllocLocal
+#define Uses_MsgBox
+#define Uses_TCEditor
+#define Uses_TCEditor_Class
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor_External
+#include <ceditor.h>
+
+#define Block ((const char *)(block))
+
+/*****************************************************************************
+
+ General interface, it calls to the specific functions.
+ They use the static flags of the class for the mode.
+
+*****************************************************************************/
+
+static char *GetPCREHit(int hit, int &len);
+static char *GetRegExHit(int hit, int &len);
+static char *GetNormalHit(int hit, int &len);
+
+/**[txh]********************************************************************
+
+ Description:
+ It compiles the search. That's just a wrapper. For RegEx the functions
+really compile the expressions, for common searchs it just makes some simple
+tasks.
+
+***************************************************************************/
+
+int TCEditor::CompileSearch(char *searchStr, char *replaceStr)
+{
+ if (replaceStr)
+ if (CompileReplace(replaceStr))
+ return -1;
+
+ if (editorFlags & efRegularEx)
+ {
+ if (SUP_PCRE && RegExStyle==efPerlRegEx)
+ return CompilePCRE(searchStr);
+ else
+ return CompileRegEx(searchStr);
+ }
+ return CompileNormal(searchStr);
+}
+
+
+uint32 TCEditor::MakeASearch(char *text, uint32 len, int &matchLen)
+{
+ if ((editorFlags & efRegularEx) && !(editorFlags & efOptimizedRegex))
+ {
+ if (SUP_PCRE && RegExStyle==efPerlRegEx)
+ return MakeAPCRESearch(text,len,matchLen);
+ else
+ return MakeARegExSearch(text,len,matchLen);
+ }
+ return MakeANormalSearch(text,len,matchLen);
+}
+
+uint32 TCEditor::MakeASearchBack(char *text, uint32 len, int &matchLen)
+{
+ // Go line by line
+ char *thisLine=text;
+ uint32 lenThisLine=1;
+ len++;
+ uint32 lenOri=len;
+ while (len)
+ {
+ uint32 res=MakeASearch(thisLine,lenThisLine,matchLen);
+ if (res!=sfSearchFailed)
+ return (lenOri-len)+res;
+ thisLine--;
+ lenThisLine++;
+ len--;
+ if (len && CLY_IsEOL(*thisLine))
+ {
+ do
+ {
+ thisLine--;
+ len--;
+ }
+ while (len && CLY_IsEOL(*thisLine));
+ lenThisLine=1;
+ }
+ }
+ return sfSearchFailed;
+}
+
+char *TCEditor::GetTheReplace(int &mustDelete, uint32 &len)
+{
+ if ((ReplaceStyle==efNormalText) || !(editorFlags & efRegularEx))
+ {
+ return GetNormalReplace(mustDelete,len);
+ }
+ if ((editorFlags & efRegularEx) && !(editorFlags & efOptimizedRegex))
+ {
+ if (SUP_PCRE && RegExStyle==efPerlRegEx)
+ return GetSpecialReplace(mustDelete,len,GetPCREHit);
+ else
+ return GetSpecialReplace(mustDelete,len,GetRegExHit);
+ }
+ return GetSpecialReplace(mustDelete,len,GetNormalHit);
+}
+
+static
+int TryToOptimize(const char *expr)
+{
+ const char *s=expr;
+ for (; *s; s++)
+ if (!isWordChar(*s))
+ break;
+ return (*s==0);
+}
+
+/*****************************************************************************
+
+ Replace routines
+
+*****************************************************************************/
+
+static char *CompiledReplace=0;
+static char ReplaceIsCompiled=0;
+static int numReplaceTags;
+static int lenReplaceStr;
+static int MaxReplaceNeeded;
+
+int TCEditor::CompileReplace(char *replaceStr)
+{
+ if (ReplaceIsCompiled)
+ {
+ ReplaceIsCompiled=0;
+ delete CompiledReplace;
+ }
+
+ if (ReplaceStyle==efNormalText)
+ {
+ CompiledReplace=replaceStr;
+ lenReplaceStr=strlen(replaceStr);
+ return 0;
+ }
+
+ // Make a copy
+ int l=strlen(replaceStr);
+ char *aux=new char[l+1];
+ if (!aux)
+ return 1;
+ memcpy(aux,replaceStr,l);
+ aux[l]=0;
+ CompiledReplace=aux;
+
+ numReplaceTags=0;
+ lenReplaceStr=0;
+ MaxReplaceNeeded=0;
+ char *s=CompiledReplace, *end;
+ int val,dist;
+ while (*s)
+ {
+ if (*s=='$')
+ {
+ s++;
+ if (ucisdigit(*s))
+ {
+ val=strtol(s,&end,10);
+ *(s-1)=0;
+ dist=end-s-1;
+ if (dist)
+ memcpy(s+1,end,l-(end-CompiledReplace)+1);
+ *s=char(val);
+ if (int(*s)>MaxReplaceNeeded)
+ MaxReplaceNeeded=int(*s);
+ numReplaceTags++;
+ s++;
+ }
+ else
+ {
+ lenReplaceStr++;
+ if (*s)
+ {
+ lenReplaceStr++;
+ s++;
+ }
+ }
+ }
+ else
+ {
+ lenReplaceStr++;
+ s++;
+ }
+ }
+ #if 0
+ fprintf(stderr,"Targets: %d, largo: %d\n",numReplaceTags,lenReplaceStr);
+ #endif
+ ReplaceIsCompiled=1;
+ MaxReplaceNeeded++;
+
+ return 0;
+}
+
+char *TCEditor::GetNormalReplace(int &mustDelete, uint32 &len)
+{
+ mustDelete=0;
+ len=lenReplaceStr;
+ return CompiledReplace;
+}
+
+char *TCEditor::GetSpecialReplace(int &mustDelete, uint32 &len,
+ char *(*GetHit)(int numHit, int &lenHit))
+{
+ if (!ReplaceIsCompiled)
+ return 0;
+ // first meassure the size
+ int lenMatchs=lenReplaceStr;
+ int i,wich,lenHit;
+ char *s=CompiledReplace;
+ char *ret,*dest,*hit;
+
+ mustDelete=1;
+ i=0;
+ while (i<numReplaceTags)
+ {
+ while (*s) s++;
+ s++;
+ wich=*s;
+ hit=GetHit(wich,lenHit);
+ if (hit)
+ lenMatchs+=lenHit;
+ s++;
+ i++;
+ }
+ ret=new char[lenMatchs+1];
+ len=lenMatchs;
+ dest=ret;
+ s=CompiledReplace;
+ i=0;
+ while (i<numReplaceTags)
+ {
+ while (*s) *(dest++)=*(s++);
+ s++;
+ wich=*s;
+ hit=GetHit(wich,lenHit);
+ if (hit)
+ {
+ while (lenHit--)
+ *(dest++)=*(hit++);
+ }
+ s++;
+ i++;
+ }
+ while (*s) *(dest++)=*(s++);
+ *dest=0;
+
+ return ret;
+}
+
+/*****************************************************************************
+
+ POSIX RegEx interface
+
+*****************************************************************************/
+
+// Perhaps that's wrong, but I didn't put this variable in the class just because
+// if I do it I'll force to include the RegEx header everywhere.
+static regex_t CompiledRegEx;
+static regmatch_t *RegExMatchs=0;
+static int RegExMaxMatchs=0;
+static char *RegExText;
+static char RegExIsCompiled=0;
+static char RegExHitAvailable=0;
+
+static
+void ShowRegexError(int retval)
+{
+ char b[200];
+
+ regerror(retval,&CompiledRegEx,b,200);
+ messageBox(mfError | mfOKButton,__("Regular expression error: %s"),b);
+ RegExIsCompiled=0;
+}
+
+
+static
+void FreeRegExLastSearch(void)
+{
+ // Free the memory of the last search
+ if (RegExIsCompiled)
+ {
+ RegExIsCompiled=0;
+ RegExHitAvailable=0;
+ delete RegExMatchs;
+ regfree(&CompiledRegEx);
+ }
+}
+
+int TCEditor::CompileRegEx(char *searchStr)
+{
+ FreeRegExLastSearch();
+
+ // Test if REGEX are needed.
+ if (CanOptimizeRegEx==efOptimizeRegEx)
+ {
+ if (TryToOptimize(searchStr))
+ {
+ editorFlags|=efOptimizedRegex;
+ return CompileNormal(searchStr);
+ }
+ }
+
+ RegExMaxMatchs=max(MaxReplaceNeeded,1);
+ RegExMatchs=new regmatch_t[RegExMaxMatchs];
+ if (!RegExMatchs)
+ return -1;
+
+ int flags=REG_NEWLINE;
+ if (RegExStyle==efExtendedRegEx)
+ flags|=REG_EXTENDED;
+ if (!(editorFlags & efCaseSensitive))
+ flags|=REG_ICASE;
+
+ int retcomp=regcomp(&CompiledRegEx,searchStr,flags);
+
+ if (retcomp)
+ {
+ ShowRegexError(retcomp);
+ return -1;
+ }
+ RegExIsCompiled=1;
+ return 0;
+}
+
+uint32 TCEditor::MakeARegExSearch(char *block, uint32 size, int &matchLen)
+{
+ if (!size || !RegExIsCompiled)
+ return sfSearchFailed;
+
+ RegExText=block;
+ char v=block[size];
+ block[size]=0;
+ int retval=regexec(&CompiledRegEx,Block,RegExMaxMatchs,RegExMatchs,0);
+ block[size]=v;
+
+ if (retval && retval!=REG_NOMATCH)
+ ShowRegexError(retval);
+ else
+ {
+ if (retval!=REG_NOMATCH)
+ {
+ RegExHitAvailable=1;
+ matchLen=RegExMatchs[0].rm_eo-RegExMatchs[0].rm_so;
+ return RegExMatchs[0].rm_so;
+ }
+ }
+ return sfSearchFailed;
+}
+
+static
+char *GetRegExHit(int hit, int &len)
+{
+ if (!RegExHitAvailable || hit>=RegExMaxMatchs)
+ return 0;
+ len=RegExMatchs[hit].rm_eo-RegExMatchs[hit].rm_so;
+ return RegExText+RegExMatchs[hit].rm_so;
+}
+
+
+/*****************************************************************************
+
+ Perl-Compatible Regular Expressions (PCRE) interface
+ Thanks to the University of Cambridge
+
+*****************************************************************************/
+
+// Perhaps that's wrong, but I didn't put this variable in the class just because
+// if I do it I'll force to include the RegEx header everywhere.
+static pcre *CompiledPCRE;
+static pcre_extra *CompiledPCREExtra;
+static int *PCREMatchs=0;
+static int PCREMaxMatchs=0;
+static char *PCREText;
+static char PCREIsCompiled=0;
+static char PCREHitAvailable=0;
+
+static
+void ShowPCREError(const char *error)
+{
+ messageBox(mfError | mfOKButton,__("Regular expression error: %s"),error);
+ PCREIsCompiled=0;
+}
+
+static
+void FreePCRELastSearch()
+{
+ if (!SUP_PCRE)
+ return;
+ if (PCREIsCompiled)
+ {
+ PCREIsCompiled=0;
+ PCREHitAvailable=0;
+ delete PCREMatchs;
+ // No regfree?
+ free(CompiledPCRE);
+ free(CompiledPCREExtra);
+ }
+}
+
+int TCEditor::CompilePCRE(char *searchStr)
+{
+ if (!SUP_PCRE)
+ return -1;
+ // Free the memory of the last search
+ FreePCRELastSearch();
+
+ // Test if PCRE are needed.
+ if (CanOptimizeRegEx==efOptimizeRegEx)
+ {
+ if (TryToOptimize(searchStr))
+ {
+ editorFlags|=efOptimizedRegex;
+ return CompileNormal(searchStr);
+ }
+ }
+
+ int flags=PCRE_MULTILINE;
+ if (!(editorFlags & efCaseSensitive))
+ flags|=PCRE_CASELESS;
+
+ const char *error;
+ int errorOffset;
+ CompiledPCRE=pcre_compile(searchStr,flags,&error,&errorOffset,0);
+ if (!CompiledPCRE)
+ {
+ ShowPCREError(error);
+ return -1;
+ }
+
+ CompiledPCREExtra=pcre_study(CompiledPCRE,0,&error);
+ if (error)
+ {
+ free(CompiledPCRE);
+ ShowPCREError(error);
+ return -1;
+ }
+
+ // For PCRE 2.x this value should be enlarged to left space needed by
+ // pcre_exec
+ PCREMaxMatchs=(pcre_info(CompiledPCRE,0,0)+1)*3;
+ PCREMatchs=new int[PCREMaxMatchs];
+
+ if (!PCREMatchs)
+ {
+ free(CompiledPCRE);
+ free(CompiledPCREExtra);
+ return -1;
+ }
+
+ PCREIsCompiled=1;
+ return 0;
+}
+
+uint32 TCEditor::MakeAPCRESearch(char *block, uint32 size, int &matchLen)
+{
+ if (!SUP_PCRE || !size || !PCREIsCompiled)
+ return sfSearchFailed;
+
+ PCREText=block;
+ int hits=pcre_exec(CompiledPCRE,CompiledPCREExtra,block,size, PCRE206 0,PCREMatchs,
+ PCREMaxMatchs);
+
+ PCREHitAvailable=0;
+ if (hits<0 && hits!=PCRE_ERROR_NOMATCH)
+ {
+ char *s=TVIntl::getTextNew(__("PCRE Exec error"));
+ ShowPCREError(s);
+ DeleteArray(s);
+ }
+ else
+ {
+ if (hits!=PCRE_ERROR_NOMATCH)
+ {
+ PCREHitAvailable=hits;
+ matchLen=PCREMatchs[1]-PCREMatchs[0];
+ return PCREMatchs[0];
+ }
+ }
+ return sfSearchFailed;
+}
+
+static
+char *GetPCREHit(int hit, int &len)
+{
+ if (!SUP_PCRE || hit>=PCREHitAvailable || PCREMatchs[2*hit]<0)
+ return NULL;
+ len=PCREMatchs[2*hit+1]-PCREMatchs[2*hit];
+ return PCREText+PCREMatchs[2*hit];
+}
+
+void TCEditor::FreeRegExMemory(void)
+{
+ FreeRegExLastSearch();
+ FreePCRELastSearch();
+}
+
+/*****************************************************************************
+
+ Normal search interface
+
+*****************************************************************************/
+
+static char *NormalText=0;
+static int lenNormalText;
+static uint32 lastHit=0;
+
+int TCEditor::CompileNormal(char *searchStr)
+{
+ NormalText=searchStr;
+ lenNormalText=strlen(searchStr);
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Search a string inside the buffer. Case sensitive. block: The buffer.
+size: Size of the buffer. str: The string to search.
+
+***************************************************************************/
+
+unsigned TCEditor_scan(const void *block, unsigned size, const char *str)
+{
+ if (!size)
+ return sfSearchFailed;
+ uint32 ret=0;
+ while (size--)
+ {
+ if (Block[ret]==str[0])
+ {
+ uint32 i=0;
+ do
+ {
+ i++;
+ if (!str[i])
+ return (ret);
+ if (size<i)
+ return sfSearchFailed;
+ }
+ while (Block[ret+i]==str[i]);
+ }
+ ret++;
+ }
+ return sfSearchFailed;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Search a string inside the buffer. No case sensitive. block: The buffer.
+size: Size of the buffer. str: The string to search.
+
+***************************************************************************/
+
+unsigned TCEditor_iScan(const void *block, unsigned size, const char *str)
+{
+ if (!size)
+ return sfSearchFailed;
+ uint32 ret=0;
+ while (size--)
+ {
+ if (TVCodePage::toUpper(Block[ret])==TVCodePage::toUpper(str[0]))
+ {
+ uint32 i=0;
+ do
+ {
+ i++;
+ if (!str[i])
+ return (ret);
+ if (size<i)
+ return sfSearchFailed;
+ }
+ while (TVCodePage::toUpper(Block[ret+i])==TVCodePage::toUpper(str[i]));
+ }
+ ret++;
+ }
+ return sfSearchFailed;
+}
+
+
+uint32 TCEditor::MakeANormalSearch(char *block, uint32 size, int &matchLen)
+{
+ if (!NormalText)
+ return sfSearchFailed;
+
+ uint32 pos;
+ if (editorFlags & efCaseSensitive)
+ pos=TCEditor_scan(block,size,NormalText);
+ else
+ pos=TCEditor_iScan(block,size,NormalText);
+
+ matchLen=lenNormalText;
+ lastHit=pos;
+
+ return pos;
+}
+
+static
+char *GetNormalHit(int hit, int &len)
+{
+ if (hit>0)
+ return 0;
+ len=lenNormalText;
+ return NormalText+lastHit;
+}
+
diff --git a/setedit/mainsrc/slpinter.cc b/setedit/mainsrc/slpinter.cc
new file mode 100644
index 0000000..72e7838
--- /dev/null
+++ b/setedit/mainsrc/slpinter.cc
@@ -0,0 +1,754 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#define Uses_stdio
+#define Uses_snprintf
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TNoCaseStringCollection
+#define Uses_TCEditor
+#define Uses_TCEditor_Commands
+#define Uses_TCEditor_Internal
+#define Uses_TProgram
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSInputLinePiped
+#define Uses_TSLabel
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_TLispVariableCol
+#define Uses_TMLIBase
+#define Uses_TLispBaseVars
+#define Uses_TLispVarDefs
+#define Uses_TMLIArrayBase
+#define Uses_TMLIEditor
+#define Uses_MsgBox
+#define Uses_TDialog
+#define Uses_TSortedListBox
+#define Uses_TRect
+#define Uses_TButton
+#define Uses_TLabel
+#include <mli.h>
+#undef GetString
+class TSOSListBox;
+#include <edmsg.h>
+#define Uses_SETAppDialogs
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <completi.h>
+#include <edhists.h>
+#include <slpinter.h>
+#define Uses_TKeyTranslate
+#define Uses_TKeySeqCol
+#define Uses_TComSeqCol
+#include <keytrans.h>
+
+TCEditor *TMLIEditor::Editor;
+
+
+char *TMLIEditor::GetWordUnderCursor(int lenMax, int &len, unsigned options)
+{
+ char *s=Editor ? Editor->WordUnderCursor(lenMax,options) : NULL;
+ if (s)
+ {
+ len=strlen(s);
+ return s;
+ }
+ len=0;
+ // Allocate a dummy just in case
+ s=new char[1];
+ *s=0;
+ return s;
+}
+
+char *TMLIEditor::GetEditorName(void)
+{
+ return Editor ? Editor->fileName : NULL;
+}
+
+char *TMLIEditor::GetSelection(int &len)
+{
+ if (Editor && Editor->hasSelection() && !Editor->selHided)
+ {
+ len=Editor->selEnd-Editor->selStart;
+ char *s=new char[len+1];
+ memcpy(s,&Editor->buffer[Editor->selStart],len);
+ s[len]=0;
+ return s;
+ }
+ char *s=new char[1];
+ s[0]=0; // Just in case
+ len=0;
+ return s;
+}
+
+int TMLIEditor::SendCommand(int command)
+{
+ if (!Editor)
+ return 0;
+ if (command>=cmbBaseNumber && command<=cmbBaseNumber+cmbLastCommand)
+ {// Editor commands
+ if (Editor)
+ {
+ TEvent event;
+ event.what=evCommand;
+ event.message.command=command;
+ Editor->handleEvent(event);
+ return event.what==evNothing;
+ }
+ }
+ else
+ {// Application commands
+ TEvent event;
+ event.what=evCommand;
+ event.message.command=command;
+ TProgram::application->handleEvent(event);
+ return event.what==evNothing;
+ }
+ return 0;
+}
+
+/*
+inline static
+void Replace2By1(char *str, int ind, int len, char rep)
+{
+ str[ind-1]=rep;
+ memmove(&str[ind],&str[ind+1],len-ind-1);
+}
+
+inline static
+void Replace2By2(char *str, int ind, const char *rep)
+{
+ str[ind-1]=*rep;
+ str[ind]=rep[1];
+}
+
+static int AdjustString(char *str, int len)
+{
+ int ind,lret=len;
+
+ for (ind=0; ind<len; ind++)
+ if (str[ind]=='\\')
+ {
+ ind++;
+ switch (str[ind])
+ {
+ case 'n':
+ #ifdef CLY_UseCrLf
+ Replace2By2(str,ind,CLY_crlf);
+ #else
+ Replace2By1(str,ind,len,'\n');
+ lret--;
+ #endif
+ break;
+ case 't':
+ Replace2By1(str,ind,len,9);
+ lret--;
+ break;
+ default:
+ Replace2By1(str,ind,len,str[ind]);
+ lret--;
+ }
+ }
+ return lret;
+}
+*/
+
+// ONLY FOR CR LF!!!!! not more than 2 characters!!
+static
+char *AdjustCRLF(char *str, int &len)
+{
+ int l=len,num=0,i;
+ const char *crlf=CLY_crlf;
+
+ if (l<2)
+ return str;
+ for (i=0; i<l; i++)
+ if (str[i]==crlf[0] && str[i+1]!=crlf[1])
+ num++;
+
+ if (num)
+ {
+ len+=num;
+ char *s=new char[len+1],*s2;
+ for (s2=s, i=0; i<l; s2++, i++)
+ if (str[i]==crlf[0] && str[i+1]!=crlf[1])
+ *(s2++)=crlf[0], *s2=crlf[1];
+ else
+ *s2=str[i];
+ *s2=0;
+ return s;
+ }
+ return str;
+}
+
+int TMLIEditor::InsertText(char *str, int len, int select, int move)
+{
+ if (Editor)
+ {
+ Boolean moveToEnd;
+
+ switch (move)
+ {
+ case SLP_MOVE_CURSOR:
+ moveToEnd=True;
+ break;
+ case SLP_DONT_MOVE_CURSOR:
+ moveToEnd=False;
+ break;
+ default: // SLP_DEFAULT_MOVE
+ moveToEnd=TCEditor::staticNoMoveToEndPaste ? False : True;
+ }
+ //len=AdjustString(str,len);
+ char *Str=str;
+ if (CLY_LenEOL!=1)
+ Str=AdjustCRLF(str,len);
+ // I forgot it the first time and produced a hard bug
+ if (Editor->IslineInEdition)
+ Editor->MakeEfectiveLineInEdition();
+ // Usually an insertion resets the "found" highlight.
+ // So we must do the same here
+ Editor->updateFlags&=~ufFound;
+ int ret=Editor->insertBuffer(str,0,len,True,select ? True : False,moveToEnd);
+ Editor->trackCursor(False);
+ if (Str!=str)
+ delete[] Str;
+ return ret;
+ }
+ return 0;
+}
+
+void TMLIEditor::ShowInStatusLine(char *s, int l)
+{
+ if (!Editor)
+ return;
+ // Limit to 1Kb screen width
+ if (l>1024)
+ l=1024;
+ // Sanity check, I don't want to crash thanks to a macro.
+ if (l<0 || !s)
+ return;
+ // Copy it to a buffer because the string will be altered if it contains tabs or \n
+ AllocLocalStr(b,l+1);
+ memcpy(b,s,l);
+ b[l]=0;
+ Editor->setStatusLine(b);
+}
+
+char *TMLIEditor::CompletionChoose(char *options, char *delimiter, unsigned flags)
+{
+ if (!Editor)
+ return NULL;
+ return ::CompletionChoose(options,delimiter,Editor->cursor.x+Editor->owner->origin.x,
+ Editor->cursor.y+Editor->owner->origin.y+1,flags);
+}
+
+int TMLIEditor::GetSyntaxAtCursor()
+{
+ if (!Editor)
+ return 0;
+ if (Editor->IslineInEdition)
+ Editor->MakeEfectiveLineInEdition();
+
+ uint32 attr=Editor->lenLines.getAttr(Editor->curPos.y);
+ Editor->LineMeassure(Editor->curLinePtr,Editor->ColToPointer(),attr,NULL);
+ return attr;
+}
+
+int TMLIEditor::ForceUpdate()
+{
+ if (!Editor) return 0;
+ Editor->unlock();
+ Editor->lock();
+ return 1;
+}
+
+char *TMLIEditor::AskString(const char *title, const char *message)
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),title));
+ TSLabel *label=new TSLabel(message,new TSInputLinePiped(1024,60));
+ col->insert(2,1,label);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt(); delete col; d->options|=ofCentered;
+ char b[1024]; *b=0;
+ if (execDialog(d,b)!=cmCancel)
+ return newStr(b);
+ return newStr("");
+}
+
+Boolean TMLIEditor::SelectionExists()
+{
+ return Editor ? Editor->hasVisibleSelection() : False;
+}
+
+unsigned TMLIEditor::GetFindFlags()
+{
+ if (!Editor)
+ return 0;
+ unsigned ret=Editor->editorFlags & efFindMaskSL;
+ // Compact the global options inside the flags
+ if (TCEditor::ReplaceStyle==efTagsText)
+ ret|=efTagsTextSL;
+ if (TCEditor::RegExStyle==efExtendedRegEx)
+ ret|=efExtendedRegExSL;
+ else if (TCEditor::RegExStyle==efPerlRegEx)
+ ret|=efPerlRegExSL;
+ if (TCEditor::CanOptimizeRegEx==efNoOptimizeRegEx)
+ ret|=efNoOptimizeRegExSL;
+ return ret;
+}
+
+Boolean TMLIEditor::FindOrReplaceString(char *str, char *repl, unsigned flags,
+ char *&string, unsigned &len, Boolean again)
+{
+ if (!Editor)
+ return False;
+ // Save the current state
+ unsigned tmpFlags=Editor->editorFlags;
+ unsigned tmpStartOfSearch=Editor->StartOfSearch;
+ unsigned tmpRegExStyle=TCEditor::RegExStyle;
+ unsigned tmpReplaceStyle=TCEditor::ReplaceStyle;
+ unsigned tmpCanOptimize=TCEditor::CanOptimizeRegEx;
+ unsigned tmpSearchInSel=TCEditor::SearchInSel;
+ Boolean ret=False;
+
+ // Expand the flags
+ if (flags & efTagsTextSL)
+ TCEditor::ReplaceStyle=efTagsText;
+ else
+ TCEditor::ReplaceStyle=efNormalText;
+ if (flags & efOnlySelectionSL)
+ TCEditor::SearchInSel=1;
+ else
+ TCEditor::SearchInSel=0;
+ switch (flags & efRexExStyleMask)
+ {
+ case efBasicRegExSL:
+ TCEditor::RegExStyle=efBasicRegEx;
+ break;
+ case efExtendedRegExSL:
+ TCEditor::RegExStyle=efExtendedRegEx;
+ break;
+ case efPerlRegExSL:
+ TCEditor::RegExStyle=efPerlRegEx;
+ break;
+ }
+ if (flags & efNoOptimizeRegExSL)
+ TCEditor::CanOptimizeRegEx=efNoOptimizeRegEx;
+ else
+ TCEditor::CanOptimizeRegEx=efOptimizeRegEx;
+
+
+ if (!again)
+ {
+ Editor->editorFlags=(flags & efFindMaskSL & ~efOptimizedRegex) | efNoFindFailMsg;
+ if (repl)
+ Editor->editorFlags|=efDoReplace;
+ else
+ Editor->editorFlags&=~efDoReplace;
+
+ // Solve the scope of the search
+ if (flags & efFromBegginingSL)
+ Editor->StartOfSearch=0;
+ else
+ Editor->StartOfSearch=(unsigned)(Editor->ColToPointer()-Editor->buffer);
+ // Memorize the string to search. It is needed during the "find again" and
+ // what we have now are sLisp strings from the sLisp stack that will most
+ // probably disapear before the call to FindAgain
+ DeleteArray(findAgainStr);
+ findAgainStr=newStr(str);
+ // Do it!
+ if (repl)
+ {// Do a search & replace
+ DeleteArray(replaceAgainStr);
+ replaceAgainStr=newStr(repl);
+ if (!Editor->CompileSearch(findAgainStr,replaceAgainStr))
+ ret=Editor->doSearchReplace();
+ }
+ else
+ {// Do the search
+ Editor->CompileSearch(findAgainStr);
+ ret=Editor->search(NULL,flags);
+ }
+ findAgainFlags=Editor->editorFlags | (flags & ~efFindMaskSL);
+ }
+ else
+ {// Repeat the last operation
+ Editor->editorFlags=flags & efFindMaskSL;
+ Editor->StartOfSearch=(unsigned)(Editor->ColToPointer()-Editor->buffer)+1;
+ ret=Editor->doSearchReplace();
+ }
+ if ((Editor->editorFlags & efDoReplace) && ret)
+ Editor->updateFlags&=~ufFound;
+ if ((Editor->editorFlags & efDoReplace) || !ret)
+ string=NULL;
+ else
+ {
+ len=Editor->selEndF-Editor->selStartF;
+ string=newStrL(Editor->buffer+Editor->selStartF,len);
+ }
+
+ // Restore the original state
+ Editor->editorFlags=tmpFlags;
+ Editor->StartOfSearch=tmpStartOfSearch;
+ TCEditor::RegExStyle=tmpRegExStyle;
+ TCEditor::ReplaceStyle=tmpReplaceStyle;
+ TCEditor::CanOptimizeRegEx=tmpCanOptimize;
+ TCEditor::SearchInSel=tmpSearchInSel;
+
+ return ret;
+}
+
+Boolean TMLIEditor::FindAgain(char *&string, unsigned &len)
+{
+ if (!findAgainStr)
+ return False;
+ return FindOrReplaceString(findAgainStr,NULL,findAgainFlags,string,len,True);
+}
+
+int TMLIEditor::GetCursorX()
+{
+ return Editor ? Editor->curPos.x : 0;
+}
+
+int TMLIEditor::GetCursorY()
+{
+ return Editor ? Editor->curPos.y : 0;
+}
+
+void TMLIEditor::SetCursorXY(int x, int y)
+{
+ if (Editor)
+ Editor->MoveCursorTo(x,y,True);
+}
+
+const char *TMLIEditor::GetSyntaxLang()
+{
+ if (!Editor)
+ return "";
+ Editor->CacheSyntaxHLData(Editor->GenericSHL);
+ return Editor->SyntaxHL!=shlNoSyntax ? Editor->strC.Name : "";
+}
+
+int TMLIEditor::GetWrapCol(int wn)
+{
+ return ::GetWrapCol(wn);
+}
+
+int TMLIEditor::SelectWindowNumber(int num)
+{
+ int ret=::SelectWindowNumber(num);
+ if (ret)
+ {// Change the sLisp target editor if that's an editor
+ TCEditor *p=GetCurrentIfEditor();
+ if (p)
+ {
+ if (Editor)
+ {
+ Editor->update(ufView);
+ Editor->unlock();
+ }
+ Editor=p;
+ }
+ }
+ return ret;
+}
+
+int TMLIEditor::CloseWindowNumber(int num)
+{
+ int current=GetCurWindowNumber();
+ int ret=::CloseWindowNumber(num);
+ if (num==current)
+ Editor=NULL;
+ return ret;
+}
+
+int TMLIEditor::GetCurWindowNumber()
+{
+ return Editor ? ((TWindow *)Editor->owner)->number : 0;
+}
+
+int TMLIEditor::GetMaxWindowNumber()
+{
+ return ::GetMaxWindowNumber();
+}
+
+int TMLIEditor::GetWindowCols(int wn)
+{
+ return ::GetWindowCols(wn);
+}
+
+int TMLIEditor::GetWindowRows(int wn)
+{
+ return ::GetWindowRows(wn);
+}
+/*****************************************************************************
+ Key binding operations
+*****************************************************************************/
+
+KeyTTable *TMLIEditor::oriKeyTable=NULL;
+int TMLIEditor::oriCanBeDeleted;
+
+int TMLIEditor::StartKeyBind()
+{
+ if (oriKeyTable)
+ return 0;
+ oriKeyTable=KeyTrans.expand(oriCanBeDeleted);
+ return oriKeyTable!=NULL;
+}
+
+void TMLIEditor::EndKeyBind()
+{
+ if (!oriKeyTable)
+ return;
+ if (oriCanBeDeleted)
+ delete oriKeyTable;
+ KeyTrans.compact();
+ oriKeyTable=NULL;
+}
+
+void TMLIEditor::AbortKeyBind()
+{
+ if (!oriKeyTable)
+ return;
+ KeyTrans.ChangeTable(oriKeyTable,oriCanBeDeleted ? kbtDynamic : kbtStatic);
+ oriKeyTable=NULL;
+}
+
+int TMLIEditor::BindKey(TKeySeqCol *sKeys, void *data, int Type)
+{
+ int keyBranch;
+ int ret=KeyTrans.addKey(sKeys,data,Type,&keyBranch);
+ if (ret>=0)
+ {
+ KeyTrans.deleteKey(ret);
+ KeyTrans.addKey(sKeys,data,Type);
+ }
+ else
+ if (ret==-1)
+ {// This is something not allowed from the dialogs: to simply destroy
+ // a group of assigments to replace it by just one assignment.
+ KeyTrans.deleteKey(keyBranch);
+ KeyTrans.addKey(sKeys,data,Type);
+ }
+ return 1;
+}
+
+#define IntMessage1(a,b) aux=TVIntl::getTextNew(a); \
+ CLY_snprintf(buf,256,aux,b); \
+ EdShowMessage(buf); \
+ DeleteArray(aux);
+static void SLPShowError(void)
+{
+ char buf[256],*aux;
+ EdShowMessageI(__("Error in sLisp interpreter:"),True);
+ IntMessage1(__("Type of error: %s"),MLIEditorTypeError)
+ EdShowMessage(MLIEditorErrorName);
+ IntMessage1(__("Code: ...%s..."),MLIEditorErrorCode)
+ EdShowMessageI(__("End of SLP"));
+}
+
+static char *slpFile=0;
+
+void SLPInterfaceInit(char *file)
+{
+ if (slpFile)
+ return;
+ FILE *f;
+ // avoid problems if somebody tries to access an editor
+ TMLIEditor::Editor=0;
+ if (!InitLispEditor())
+ return;
+ f=fopen(file,"rb");
+ if (f)
+ {
+ fseek(f,0,SEEK_END);
+ int len=ftell(f);
+ fseek(f,0,SEEK_SET);
+ slpFile=new char[len+1];
+ if (slpFile)
+ {
+ fread(slpFile,len,1,f);
+ slpFile[len]=0;
+ if (!InterpretLispEditorFile(slpFile))
+ SLPShowError();
+ }
+ fclose(f);
+ }
+}
+
+void SLPInterfaceDeInit(void)
+{
+ DeInitLispEditor();
+ delete[] slpFile;
+ slpFile=0;
+}
+
+void SLPInterfaceRunSelection(TCEditor *ed)
+{
+ if (ed->hasVisibleSelection())
+ {
+ if (ed->IslineInEdition)
+ ed->MakeEfectiveLineInEdition();
+ unsigned l=ed->selEnd-ed->selStart;
+ char *s=(char *)malloc(l+1);
+ if (s)
+ {
+ memcpy(s,ed->buffer+ed->selStart,l);
+ s[l]=0;
+ SLPInterfaceRunString(ed,s,True);
+ free(s);
+ }
+ }
+}
+
+int SLPInterfaceRunString(TCEditor *ed, char *code, Boolean verbose)
+{
+ int ret=SLP_OK;
+ TMLIEditor::Editor=ed;
+ if (!InterpretLispEditor(code,verbose))
+ {
+ SLPShowError();
+ ret=SLP_ERROR;
+ }
+ ed->update(ufView);
+ TMLIEditor::Editor=0;
+
+ return ret;
+}
+
+void SLPInterfaceRunAsk(TCEditor *ed, char *code)
+{
+ TSViewCol *col=new TSViewCol(__("Enter sLisp code to interpret"));
+ TSInputLinePiped *inp=new TSInputLinePiped(maxRunAskCode-1,1,hID_sLispMacros,60);
+ col->insert(xTSCenter,yTSUp,inp);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt(); delete col; d->options|=ofCentered;
+ char b[maxRunAskCode];
+ if (code)
+ strcpy(b,code);
+ else
+ *b=0;
+ if (execDialog(d,b)!=cmCancel)
+ {
+ b[maxRunAskCode-1]=0;
+ SLPInterfaceRunString(ed,b,True);
+ }
+}
+
+void SLPInterfaceRun(TCEditor *ed)
+{
+ if (!slpFile)
+ return;
+ TMLIEditor::Editor=ed;
+
+ switch (ChooseAndRunLispEditor())
+ {
+ case SLP_ERROR:
+ SLPShowError();
+ break;
+ case SLP_NO_MACROS:
+ messageBox(__("No macros defined"),mfWarning | mfOKButton);
+ break;
+ }
+ // Is better to redraw it because in some cases is needed, for example when the
+ // line is in edition and the series of commands moves the cursor outside the line
+ ed->update(ufView);
+ TMLIEditor::Editor=0;
+}
+
+void SLPInterfaceReRun(TCEditor *ed)
+{
+ if (!slpFile)
+ return;
+ TMLIEditor::Editor=ed;
+
+ if (ReRunLastChooseLispEditor()==SLP_ERROR)
+ SLPShowError();
+ // Is better to redraw it because in some cases is needed, for example when the
+ // line is in edition and the series of commands moves the cursor outside the line
+ ed->update(ufView);
+ TMLIEditor::Editor=0;
+}
+
+#define AnDiag 36
+// List
+#define XL 2
+#define AnL 31
+#define X2L (XL+AnL)
+#define YL 2
+#define AlL 12
+#define Y2L (YL+AlL)
+// Buttons
+#define AnOK 10
+#define AnCan 12
+#define XOK ((AnDiag-AnOK-AnCan-2)/2)
+#define YOK (Y2L+1)
+#define XCan (XOK+AnOK+2)
+#define YCan YOK
+
+#define AlDiag YOK+3
+
+static TDialog *SLPCreateDialog(void)
+{
+ TDialog *d=new TDialog(TRect(0,0,AnDiag,AlDiag),__("sLisp macros"));
+
+ d->options |= ofCentered;
+ d->helpCtx = cmcChooseMacro;
+
+ TScrollBar *sb=new TScrollBar(TRect(X2L,YL,X2L+1,Y2L));
+ d->insert(sb);
+
+ TSortedListBox *Lista=new TSortedListBox(TRect(XL,YL,X2L,Y2L),1,sb);
+ d->insert(Lista);
+ d->insert(new TLabel(TRect(XL,YL-1,X2L,YL),__("~M~acros"),Lista));
+
+ d->insert(new TButton(TRect(XOK,YOK,XOK+AnOK,YOK+2),__("O~K~"),cmOK,bfDefault));
+ d->insert(new TButton(TRect(XCan,YCan,XCan+AnCan,YCan+2),__("Cancel"),cmCancel,bfNormal));
+
+ d->selectNext( False );
+ return d;
+}
+
+ccIndex SLPChoose(TNoCaseStringCollection *Col)
+{
+ struct TListBoxRec
+ {
+ TCollection *items;
+ ccIndex selection;
+ } br;
+
+ br.items=Col;
+ br.selection=0;
+
+ if (execDialog(SLPCreateDialog(),&br)==cmCancel)
+ return -1;
+
+ return br.selection;
+}
+
+int SLPSearchMacro(TCEditor *ed, char *name, Boolean verbose)
+{
+ if (!name)
+ return SLP_NO_CHOOSE;
+
+ // Macro names can't start with (, it must be a piece of code
+ if (*name=='(')
+ return SLPInterfaceRunString(ed,name,verbose);
+
+ TMLIEditor::Editor=ed;
+
+ int ret=MLIEdSeachAndRunCom(name,verbose);
+ if (ret==SLP_ERROR)
+ SLPShowError();
+
+ ed->update(ufView);
+ TMLIEditor::Editor=0;
+ return ret;
+}
+
diff --git a/setedit/mainsrc/splinman.cc b/setedit/mainsrc/splinman.cc
new file mode 100644
index 0000000..37db6a7
--- /dev/null
+++ b/setedit/mainsrc/splinman.cc
@@ -0,0 +1,436 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Special Lines Manager
+
+ Comments:
+ The special lines are a little complex thing because they can virtually
+come from various sources and your live can vary. I say virtually because
+actually the standalone editor can generate it only from the message box,
+but in RHIDE the breakpoints are other source.
+
+IMPORTANT!!!!
+Internally the splines are list of lines associated with a file name. This
+file name can be a file we are editing or not. The splines itself can't be
+saved to disk. So they are "internal representations". For this reason they
+associate a *full qualified* file name with line numbers. To ensure it all
+the functions first expand the name and then does the work (searches for
+example). It means that internally we use absolute file names, but you can
+specify relative names when adding or deleting splines.
+A very important detail is that the editor is even smarter and uses inode
+values to diferentiate files. So when we apply the special lines the editor
+will apply them even to a file name that isn't the same but represents the
+same file in disk.
+I'm not sure what problems and limitations can be derived from that.
+
+***************************************************************************/
+//#define DEBUG
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+#define Uses_string
+
+#define Uses_TCEditor
+#define Uses_TNSCollection
+#define Uses_TStringCollection
+#define Uses_TCEditor_Internal
+#include <ceditor.h>
+#include <splinman.h>
+
+#define TO_KEY(a) ((void *)(long)(a))
+
+void TSpCollection::insert(int line, int id)
+{
+ stSpLine *p=new stSpLine;
+ p->oline=p->nline=line;
+ p->id=id;
+ TNSSortedCollection::insert(p);
+}
+
+TSpCollection &TSpCollection::operator=(const TSpCollection &pl)
+{
+ int i;
+ freeAll();
+ for (i=0; i<pl.count; i++)
+ {
+ stSpLine *d=new stSpLine, *o=(stSpLine *)pl.items[i];
+ d->oline=o->oline;
+ d->nline=o->nline;
+ d->id=o->id;
+ // Maintain the same sorting, even for duplicated items.
+ // That's important because duplicated newer entries goes first, but when
+ // we copy they are inserted in the reverse order. This can make an old
+ // breakpoint hide the CPU line.
+ TNSCollection::insert(d);
+ }
+ return *this;
+}
+
+void *TSpCollection::keyOf(void *item)
+{
+ stSpLine *p=(stSpLine *)item;
+ return TO_KEY(p->oline);
+}
+
+int TSpCollection::compare(void *s1, void *s2)
+{
+ return (long)s1-(long)s2;
+}
+
+void TSpCollection::freeItem(void *s)
+{// Nothing special, just be sure we don t mix delete and delete[]
+ delete (stSpLine *)s;
+}
+
+// Base cell
+typedef struct
+{
+ char *file; // File owner of the lines
+ TSpCollection *SpecialLines; // Which lines
+ TSpCollection *NewSpLines; // When we modify (add/delete) lines the operation
+ // is performed on a copy. It helps the editor to know what changed and avoid
+ // drawing the whole window.
+} NodeCol;
+
+
+// A collection to associate files and lines
+class TSpLAsoc : public TStringCollection
+{
+public:
+ TSpLAsoc(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) { }
+ virtual void *keyOf(void *item) { return ((NodeCol *)item)->file; };
+ virtual void freeItem( void *item );
+ NodeCol *At(ccIndex pos) { return (NodeCol *)at(pos); };
+};
+
+void TSpLAsoc::freeItem( void *item )
+{
+ NodeCol *p=(NodeCol *)item;
+ delete[] p->file;
+ CLY_destroy(p->SpecialLines);
+ CLY_destroy(p->NewSpLines);
+ delete p;
+}
+
+static TSpLAsoc *SpLines=NULL;
+
+static
+void ApplyOneSpLines(void *item, void *)
+{
+ NodeCol *p=(NodeCol *)item;
+ // Note: ApplySpLines is smart and will search the file by its inode.
+ if (p->NewSpLines)
+ {
+ ApplySpLines(p->file,p->NewSpLines);
+ // Reflect it
+ CLY_destroy(p->SpecialLines);
+ p->SpecialLines=p->NewSpLines;
+ p->NewSpLines=NULL;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It adds an special line to some file. fileName is the name of the file, it
+can be opened or not, line is the line number and idSource is the id of the
+section of the program that sets it, is the kind of line.@p
+ If TransferNow is True (default) the special lines are transfered
+inmediatly to the owner, if not you MUST call @x{SpLinesUpdate}.
+
+***************************************************************************/
+
+void SpLinesAdd(char *fName, int line, int idSource, Boolean TransferNow)
+{
+ ccIndex pos;
+
+ if (!SpLines)
+ {
+ SpLines=new TSpLAsoc(4,2);
+ if (!SpLines)
+ return;
+ }
+ NodeCol *p;
+ line--; // Because the editor uses 0 internally
+
+ // TODO: should we implement some inode mechanism?
+ char fileName[PATH_MAX];
+ strcpy(fileName,fName);
+ CLY_fexpand(fileName);
+
+ if (SpLines->search(fileName,pos))
+ {
+ p=SpLines->At(pos);
+ if (!p->NewSpLines)
+ {// We don't have a list to transfer, create it.
+ p->NewSpLines=new TSpCollection(0);
+ *p->NewSpLines=*p->SpecialLines;
+ }
+ p->NewSpLines->insert(line,idSource);
+ #ifdef DEBUG
+ fprintf(stderr,"Adding a spl for: %s (%d), id: %d transfer: %d\n",fileName,line,idSource,TransferNow ? 1 : 0);
+ #endif
+ }
+ else
+ {
+ // This file doesn't have special lines yet
+ p=new NodeCol;
+ p->file=newStr(fileName);
+ p->SpecialLines=NULL;
+ p->NewSpLines=new TSpCollection(8);
+ p->NewSpLines->insert(line,idSource);
+ SpLines->insert(p);
+ #ifdef DEBUG
+ fprintf(stderr,"Adding a spl for: NEW %s (%d), id: %d transfer: %d\n",fileName,line,idSource,TransferNow ? 1 : 0);
+ #endif
+ }
+ if (TransferNow)
+ ApplyOneSpLines(p,NULL);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function updates the special lines of ALL the editors. That's made
+through calls to ApplySpLines, this function must be provided by the main
+part of the editor. Prototype:@p
+extern void ApplySpLines(char *fileName,TSpCollection *spLines);
+
+***************************************************************************/
+
+void SpLinesUpdate(void)
+{
+ if (!SpLines)
+ return;
+ SpLines->forEach(ApplyOneSpLines,NULL);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function is called by the function that opens editors from disk. This
+routine looks if there are special lines for the new editor and in this case
+returns the list.
+
+ Return:
+ The special lines array or NULL.
+
+***************************************************************************/
+
+TSpCollection *SpLinesGetFor(char *fName)
+{
+ if (!SpLines || !fName) // New files doesn't have a name
+ return NULL;
+
+ char fileName[PATH_MAX];
+ strcpy(fileName,fName);
+ CLY_fexpand(fileName);
+
+ ccIndex pos;
+ if (SpLines->search(fileName,pos))
+ return (SpLines->At(pos))->SpecialLines;
+ return NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function deletes all the special lines associated with the provided
+id. I use it for example when the message window is cleaned and hence these
+special lines no longer exists.
+
+***************************************************************************/
+
+void SpLinesDeleteForId(int id, const char *file, Boolean aLine, int oLine)
+{
+ if (!SpLines)
+ return;
+ ccIndex count=SpLines->getCount();
+ ccIndex i;
+ Boolean deleted;
+ NodeCol *p;
+ oLine--;
+
+ char fileName[PATH_MAX];
+ if (file)
+ {
+ strcpy(fileName,file);
+ CLY_fexpand(fileName);
+ file=fileName;
+ }
+
+ for (i=0; i<count;)
+ {
+ p=SpLines->At(i);
+ // If we are looking for a particular file and it isn't just continue
+ if (file && strcmp(file,p->file))
+ {
+ i++;
+ continue;
+ }
+ if (!p->NewSpLines)
+ {// We don't have a list to transfer, create it.
+ p->NewSpLines=new TSpCollection(0);
+ *p->NewSpLines=*p->SpecialLines;
+ }
+ ccIndex c2,j;
+ c2=p->NewSpLines->getCount();
+ deleted=False;
+ for (j=0; j<c2;)
+ {
+ stSpLine *st=p->NewSpLines->At(j);
+ if (st->id==id &&
+ // Not a particular line or the line we want
+ (!aLine || st->oline==oLine))
+ {
+ p->NewSpLines->atFree(j);
+ c2--;
+ deleted=True;
+ // If it was the line we wanted stop searching
+ if (aLine)
+ break;
+ }
+ else
+ j++;
+ }
+ if (c2==0) // All deleted
+ {
+ ApplySpLines(p->file,NULL);
+ SpLines->atFree(i);
+ count--;
+ }
+ else
+ {
+ if (deleted) // Reflex the change
+ ApplyOneSpLines(p,NULL);
+ i++;
+ }
+ // If it was the file we wanted we are done
+ if (file)
+ break;
+ }
+ if (count==0)
+ {
+ CLY_destroy(SpLines);
+ SpLines=NULL;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function searchs the specified line and returns the actual value.
+To know if the line was actually found use the @var{found} argument. That's
+optional.
+
+***************************************************************************/
+
+int SpLineGetNewValueOf(int line, char *fName, Boolean *found)
+{
+ if (found)
+ *found=False;
+ if (!SpLines)
+ return line;
+
+ char fileName[PATH_MAX];
+ strcpy(fileName,fName);
+ CLY_fexpand(fileName);
+
+ ccIndex Pos;
+ line--;
+ if (SpLines->search(fileName,Pos))
+ {
+ TSpCollection *p=(SpLines->At(Pos))->SpecialLines;
+ if (p && p->search(TO_KEY(line),Pos))
+ {
+ if (found)
+ *found=True;
+ return (p->At(Pos))->nline+1;
+ }
+ }
+ return line+1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function searchs the specified actual line and returns the original
+value. To know if the line was actually found use the @var{found} argument.
+That's optional.
+
+***************************************************************************/
+
+int SpLineGetOldValueOf(int line, char *fName, int type, Boolean *found)
+{
+ if (found)
+ *found=False;
+ if (!SpLines)
+ return line;
+
+ char fileName[PATH_MAX];
+ strcpy(fileName,fName);
+ CLY_fexpand(fileName);
+
+ ccIndex Pos;
+ line--;
+ if (SpLines->search(fileName,Pos))
+ {
+ TSpCollection *p=(SpLines->At(Pos))->SpecialLines;
+ ccIndex c=p->getCount();
+ ccIndex i;
+ for (i=0; i<c; i++)
+ {
+ stSpLine *st=p->At(i);
+ if (st->nline==line && (type==idsplAny || st->id==type))
+ {
+ if (found)
+ *found=True;
+ return st->oline+1;
+ }
+ }
+ }
+ return line+1;
+}
+
+void SpLinesCleanUp()
+{
+ CLY_destroy(SpLines);
+ SpLines=NULL;
+}
+
+struct idAndData
+{
+ int id;
+ void *data;
+ spLineApplyF apply;
+};
+
+static
+void SpLinesForEachFile(void *item, void *data)
+{
+ idAndData *d=(idAndData *)data;
+ NodeCol *p=(NodeCol *)item;
+
+ TSpCollection *col=p->SpecialLines;
+ int i, c=col->getCount();
+ for (i=0; i<c; i++)
+ {
+ stSpLine *s=col->At(i);
+ if (d->id==idsplAny || d->id==s->id)
+ d->apply(p->file,s,d->data);
+ }
+}
+
+void SpLinesForEach(int id, spLineApplyF apply, void *data)
+{
+ if (!SpLines)
+ return;
+ idAndData d;
+ d.id=id;
+ d.data=data;
+ d.apply=apply;
+ SpLines->forEach(SpLinesForEachFile,&d);
+}
+
diff --git a/setedit/mainsrc/ssyntax.cc b/setedit/mainsrc/ssyntax.cc
new file mode 100644
index 0000000..14e8779
--- /dev/null
+++ b/setedit/mainsrc/ssyntax.cc
@@ -0,0 +1,1083 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Syntax Help
+ Description:
+ This module is used to bring help about the word under cursor. I taked
+some ideas from the Robert implementation but that's totally diferent. I
+was hopping to make it a little bit more friendly.@p
+ The interface with the program is done through:@p
+
+int SyntaxSearch_Search(char *word, char *&FileName, char *&NodeName);@*
+int SyntaxSearch_Load(fpstream &s);@*
+int SyntaxSearch_Save(fpstream &s);@*
+int SyntaxSearch_InitWithDefaults(void);@*
+void SyntaxSearch_EditFilesList(void);@*
+void SyntaxSearch_EditSettings(void);@*
+void SyntaxSearch_ShutDown(void);@*
+
+***************************************************************************/
+
+#include <ceditint.h>
+#define Uses_TSortedCollection
+#define Uses_TStringable
+#define Uses_TDialogAID
+#define Uses_fpstream
+#define Uses_MsgBox
+#define Uses_TVCodePage
+// EasyDiag requests
+#define Uses_TSInputLine
+#define Uses_TSButton
+#define Uses_TSStringableListBox
+#define Uses_TStreamableClass
+#define Uses_TSLabelRadio
+#define Uses_TSLabelCheck
+#define Uses_TSVeGroup
+#define Uses_string
+#define Uses_ctype
+#define Uses_snprintf
+// InfView requests
+#include <infr.h>
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <settvuti.h>
+// Second request the headers
+#include <easydiag.h>
+
+#include <inf.h>
+#include <ssyntax.h>
+
+// Help context:
+#define Uses_SETAppConst
+#include <setapp.h>
+
+extern ushort execDialog( TDialog *d, void *data );
+
+const char Version=2;
+const int maxFuzzy=1000;
+
+/********************** Settings structure ************************
+ This structure holds the search preferences.
+ global static.
+******************************************************************/
+
+struct SearchSettings
+{
+ int type; // scht*
+ int fuzzyThresold; // 0..1000
+ int caseSensitive; // 0 => no, 1 => yes
+ int sortByScore; // 1 => scores instead of alphabetical
+ int otherOps; // 1 => jumps to the word in the node
+};
+
+const int schtExact=0,schtSubStr=1,schtFuzzy=2;
+
+/* Hardcoded defaults: Fuzzy with 600 as trigger, case sensitive and
+ sorted by score */
+static SearchSettings seSet={schtFuzzy,600,1,1,1};
+
+
+/**[txh]********************************************************************
+
+ Class: TFileEntryCollection
+ Description:
+ This class contains the list of entries provided by the user for syntax
+search, each entry is a file/node pair.@p
+ That's the main class, but it's relative independent of InfView.
+
+***************************************************************************/
+
+// This structure holds the information for one entry in the list of
+// files/nodes to search provided by the user
+typedef struct
+{
+ char *file;
+ char *node;
+ char isOK;
+ TStringCollection *items;
+} entryInfo;
+
+const char fileOK=1,fileNotFound=0,fileDontKnow=2,fileCheckIt=3;
+static char fileInfo[]={'*',' ','?'};
+
+class TFileEntryCollection : public TStringCollection, public TStringable
+{
+public:
+ TFileEntryCollection(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) { };
+ void insert(entryInfo *entry);
+ void insertCopy(char *file, char *node, int ok=fileDontKnow, TStringCollection *it=0);
+ char Solve(entryInfo *entry);
+ virtual int compare(void *key1, void *key2);
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void);
+ virtual void freeItem(void *s);
+
+ SetDefStreamMembers(TFileEntryCollection,TStringCollection)
+};
+
+SetDefStreamOperators(TFileEntryCollection)
+const char * const TFileEntryCollection::name="TFileEntryCollection";
+s(FileEntryCollection);
+
+void TFileEntryCollection::insert(entryInfo *entry)
+{
+ TSortedCollection::insert(entry);
+}
+
+void TFileEntryCollection::insertCopy(char *file, char *node, int ok,
+ TStringCollection *it)
+{
+ entryInfo *entry;
+
+ entry=new entryInfo;
+ if (entry)
+ {
+ entry->file=strdup(file);
+ entry->node=strdup(node);
+ switch (ok)
+ {
+ case fileCheckIt:
+ entry->isOK=Solve(entry);
+ break;
+ case fileOK:
+ entry->isOK=ok;
+ entry->items=it;
+ break;
+ case fileNotFound:
+ case fileDontKnow:
+ entry->isOK=ok;
+ entry->items=0;
+ break;
+ }
+ insert(entry);
+ }
+}
+
+int TFileEntryCollection::compare(void *key1, void *key2)
+{
+ entryInfo *s1=(entryInfo *)key1;
+ entryInfo *s2=(entryInfo *)key2;
+ int ret;
+ ret=strcmp(s1->file,s2->file);
+ if (ret==0)
+ {
+ if (s1->node)
+ return s2->file ? strcmp(s1->node,s2->node) : -1;
+ return s2->file ? 1 : 0;
+ }
+ return ret;
+}
+
+void TFileEntryCollection::getText(char *dest, unsigned item, int maxLen)
+{
+ entryInfo *p=(entryInfo *)(at(item));
+ int d=0;
+ char *s=p->file;
+ maxLen--;
+
+ dest[d++]=fileInfo[(int) p->isOK];
+ dest[d++]=' ';
+ if (s)
+ {
+ if (d<maxLen)
+ dest[d++]='(';
+ while (d<maxLen && *s)
+ {
+ dest[d++]=*(s++);
+ }
+ if (d<maxLen)
+ dest[d++]=')';
+ }
+ s=p->node;
+ while (d<maxLen && *s)
+ {
+ dest[d++]=*(s++);
+ }
+ if (d<maxLen && p->isOK==fileOK && p->items)
+ {
+ char buf[64],*aux;
+ aux=TVIntl::getTextNew(__(" [%d nodes]"));
+ CLY_snprintf(buf,64,aux,p->items->getCount());
+ DeleteArray(aux);
+ s=buf;
+ while (d<maxLen && *s)
+ dest[d++]=*(s++);
+ }
+ dest[d++]=0;
+}
+
+unsigned TFileEntryCollection::GetCount(void)
+{
+ return getCount();
+}
+
+void TFileEntryCollection::writeItem(void *obj, opstream& os)
+{
+ entryInfo *p=(entryInfo *)obj;
+ os.writeString(p->file);
+ os.writeString(p->node);
+}
+
+void *TFileEntryCollection::readItem(ipstream& is)
+{
+ entryInfo *p=new entryInfo;
+ p->file=is.readString();
+ p->node=is.readString();
+ p->isOK=fileDontKnow;
+ p->items=0;
+ return p;
+}
+
+void TFileEntryCollection::freeItem(void *s)
+{
+ entryInfo *p=(entryInfo *)s;
+ delete[] p->file;
+ delete[] p->node;
+ if (p->isOK==fileOK)
+ CLY_destroy(p->items);
+ delete p;
+}
+
+static
+char *StrDupDual(char *s1, char *s2)
+{
+ int l2=0;
+ int l1=strlen(s1)+1;
+ int l=l1+1;
+ int use_s2=s2 && strcmp(s1,s2)!=0;
+ if (use_s2)
+ {
+ l2=strlen(s2);
+ l+=l2;
+ }
+
+ char *s=new char[l];
+ memcpy(s,s1,l1);
+ if (use_s2)
+ memcpy(s+l1,s2,l2+1);
+ else
+ s[l1]=0;
+
+ return s;
+}
+
+char TFileEntryCollection::Solve(entryInfo *entry)
+{
+ TInfFile *i=new TInfFile(entry->file);
+
+ if (!i || i->Status)
+ {
+ delete i; // Sure, delete checks for 0
+ return fileNotFound;
+ }
+
+ if (entry->node[0]==0)
+ {
+ TInfIndexCollection *p=i->index->coll;
+ int j,c;
+
+ c=p->getCount();
+ entry->items=new TStringCollection(c,2);
+ for (j=0; j<c; j++)
+ entry->items->insert( StrDupDual(p->GetString(p->at(j)),0) );
+ }
+ else
+ {
+ int suggY;
+ TInfTopic *topic=i->getTopic(entry->node,0,moinCutNodeWord | moinHideNodeLink,suggY);
+ if (!topic || topic->Status || topic->numRefs==0 ||
+ (entry->items=new TStringCollection(topic->numRefs,2))==0)
+ {
+ delete topic;
+ delete i;
+ return fileNotFound;
+ }
+ int j;
+ for (j=0; j<topic->numRefs; j++)
+ entry->items->insert( StrDupDual(topic->crossRefs[j].Name2,
+ topic->crossRefs[j].Name) );
+ delete topic;
+ }
+ delete i;
+ return fileOK;
+}
+/************************************************************************************/
+
+static TFileEntryCollection *entries=0;
+static TFileEntryCollection *entriesCopy=0;
+static int Modified;
+
+int SyntaxSearch_GetJumpOption(void)
+{
+ return seSet.otherOps & 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Initializes the files/nodes list with hardcoded defaults. Only if the list
+isn't initialized yet.
+
+ Return:
+ 0 on success.
+
+***************************************************************************/
+
+int SyntaxSearch_InitWithDefaults(void)
+{
+ if (entries)
+ return 0;
+ entries=new TFileEntryCollection(4,2);
+ if (!entries)
+ return 1;
+ #ifdef TVCompf_djgpp
+ entries->insertCopy("libc","Alphabetical List");
+ entries->insertCopy("allegro","Index");
+ #else
+ entries->insertCopy("libc","Function Index");
+ #endif
+ return 0;
+}
+
+/**************************** List of files User Interface *************************/
+// Action for delete button
+static
+int DeleteItem(int wich)
+{
+ entriesCopy->atFree(wich);
+ Modified=1;
+ return 1;
+}
+
+static
+int OkApply(void)
+{
+ return 1;
+}
+
+
+static
+int AddNewItem(void)
+{
+ struct
+ {
+ char file[60];
+ char node[60];
+ } box;
+
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("New node for search")));
+
+ TSInputLine *file=new TSInputLine(60);
+ TSLabel *File=new TSLabel(__("Name of the info file"),file);
+ TSInputLine *node=new TSInputLine(60);
+ TSLabel *Node=new TSLabel(__("Name of the node (leave blank for all)"),node);
+
+ col->insert(xTSCenter,2,File);
+ col->insert(xTSCenter,yTSUnder,Node,0,File);
+ EasyInsertOKCancel(col,3);
+
+ TDialog *d=col->doIt();
+ delete col;
+
+ d->options|=ofCentered;
+ d->helpCtx=cmeSyntaxHelpFiles;
+ box.file[0]=0;
+ strcpy(box.node,"Index");
+ if (execDialog(d,&box)!=cmCancel)
+ {
+ entriesCopy->insertCopy(box.file,box.node,fileCheckIt);
+ Modified=1;
+ return 1;
+ }
+ return 0;
+}
+
+char *DuplicateDual(char *s)
+{
+ int l=strlen(s)+1;
+ if (s[l]!=0)
+ l+=strlen(s+l);
+ l++;
+
+ char *ret=new char[l];
+ memcpy(ret,s,l);
+ return ret;
+}
+
+static
+void forEachAction(void *item, void *)
+{
+ entryInfo *p=(entryInfo *)item;
+ TStringCollection *it=0;
+
+ if (p->isOK==fileOK && p->items)
+ {
+ int i,c=p->items->getCount();
+ it=new TStringCollection(c,2);
+ for (i=0; i<c; i++)
+ it->insert( DuplicateDual((char *)p->items->at(i)) );
+ }
+ entriesCopy->insertCopy(p->file,p->node,p->isOK,it);
+}
+
+void EditSearchList(void)
+{
+ TStringableListBoxRec boxParam;
+ // Make a copy
+ entriesCopy=new TFileEntryCollection(entries->getCount(),2);
+ if (!entriesCopy)
+ return;
+ entries->forEach(forEachAction,0);
+
+ TDialogAID *d=CreateAddInsDelDialog(-1,-1,__("Nodes for syntax help"),12,56,0);
+ d->helpCtx=cmeSyntaxHelpFiles;
+ boxParam.items=entriesCopy;
+ boxParam.selection=0;
+ d->DelAction=DeleteItem;
+ d->AddAction=AddNewItem;
+ d->OkAction =OkApply;
+ d->CancelAction=0;
+ Modified=0;
+
+ if (execDialog(d,&boxParam)!=cmCancel && Modified)
+ {
+ CLY_destroy(entries);
+ entries=entriesCopy;
+ }
+ else
+ CLY_destroy(entriesCopy);
+ entriesCopy=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ External routine for the call to the dialog that allows the user
+configure the list of files/nodes to uses for syntax help.
+
+***************************************************************************/
+
+void SyntaxSearch_EditFilesList(void)
+{
+ if (SyntaxSearch_InitWithDefaults())
+ return;
+ EditSearchList();
+}
+/******************* End of List of files User Interface *************************/
+
+void SyntaxSearch_EditSettings(void)
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Options for syntax help")));
+
+ /* I think that's easiest way! The following 5 lines are equivalent to 20 lines
+ of cryptic stuff if you don't use EasyDiag! (I can write it in 1 too ;-) */
+ TSLabel *Method=TSLabelRadio(__("Search ~m~ethod"),__("E~x~act"),__("~S~ubstring"),
+ __("~F~uzzy"),0);
+ TSLabel *Options=TSLabelCheck(__("Search O~p~tions"),__("~C~ase sensitive"),
+ __("So~r~t by score"),0);
+ TSVeGroup *o1=new TSVeGroup(Method,Options);
+
+ o1->Flags=wSpan;
+ TSLabel *FuzzyV=new TSLabel(__("Fu~z~zy value [1..1000]"),new TSInputLine(5));
+
+ TSLabel *oOptions=TSLabelCheck(__("Other options"),__("Search word in the ~t~opic"),0);
+
+ col->insert(2,1,o1);
+ col->insert(2,yTSUnder,oOptions,0,o1);
+ col->insert(2,yTSUnder,FuzzyV,0,oOptions);
+ EasyInsertOKCancelSp(col,2);
+
+ TDialog *d=col->doIt();
+ d->helpCtx=cmeSyntaxHelpOps;
+ delete col;
+
+ d->options|=ofCentered;
+
+ struct
+ {
+ uint32 type;
+ uint32 options;
+ uint32 oOps;
+ char b[5];
+ } box;
+ box.type=seSet.type;
+ box.options=seSet.caseSensitive ? 1 : 0;
+ if (seSet.sortByScore)
+ box.options|=2;
+ /* Avoid b overflow */
+ if (seSet.fuzzyThresold<0)
+ seSet.fuzzyThresold=0;
+ if (seSet.fuzzyThresold>maxFuzzy)
+ seSet.fuzzyThresold=maxFuzzy;
+ sprintf(box.b,"%d",seSet.fuzzyThresold);
+ box.oOps=seSet.otherOps;
+
+ if (execDialog(d,&box)!=cmCancel)
+ {
+ seSet.type=box.type;
+ seSet.caseSensitive=(box.options & 1) ? 1 : 0;
+ seSet.sortByScore=(box.options & 2) ? 1 : 0;
+ seSet.fuzzyThresold=atoi(box.b);
+ if (seSet.fuzzyThresold<0)
+ seSet.fuzzyThresold=0;
+ if (seSet.fuzzyThresold>maxFuzzy)
+ seSet.fuzzyThresold=maxFuzzy;
+ seSet.otherOps=box.oOps;
+ }
+ return;
+}
+
+struct NodeInfo
+{
+ char *file; // This pointer points to one instance of the file name never delete it!
+ char *node; // the same.
+ int points; // Wow, that's a very good idea. Like the Web search engines ;-)
+};
+
+class TNodeCollection : public TSortedCollection, public TStringable
+{
+public:
+ TNodeCollection(int aMode) :
+ TSortedCollection(15,15), mode(aMode) { duplicates=True; };
+ virtual void *keyOf(void *item);
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void);
+private:
+ virtual void *readItem( ipstream& ) { return this; };
+ virtual void writeItem( void *, opstream& ) {};
+ virtual int compare(void *,void *);
+ virtual void freeItem(void *p) { delete (NodeInfo *)p; }
+ int mode; // 1 => alphabetical, 0 => score
+};
+
+unsigned TNodeCollection::GetCount(void)
+{
+ return getCount();
+}
+
+void *TNodeCollection::keyOf(void *item)
+{
+ if (mode)
+ return (void *)(long)(((NodeInfo *)item)->points);
+ return ((NodeInfo *)item)->node;
+}
+
+int TNodeCollection::compare(void *n1,void *n2)
+{
+ if (mode)
+ return (long)n1==(long)n2 ? 0 : ((long)n1>(long)n2 ? -1 : 1);
+ return strcmp((char *)n1,(char *)n2);
+}
+
+const int lenFile=12;
+
+void TNodeCollection::getText(char *dest, unsigned item, int maxLen)
+{
+ NodeInfo *node=(NodeInfo *)(at(item));
+ int i,fpos=maxLen-lenFile-5-2; // 17 file name 5 number 2 because the nature of it
+ char *s=node->node;
+ char b[12];
+
+ for (i=0; i<fpos && s[i]; i++)
+ dest[i]=s[i];
+ for (; i<fpos; i++)
+ dest[i]=' ';
+ s=node->file;
+ for (fpos+=lenFile; i<fpos && *s; i++,s++)
+ dest[i]=*s;
+ for (; i<fpos; i++)
+ dest[i]=' ';
+ sprintf(b," %4d",node->points);
+ s=b;
+ for (fpos+=5; i<fpos; i++,s++)
+ dest[i]=*s;
+ dest[i]=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a node to the list of "found nodes".
+
+***************************************************************************/
+
+static
+NodeInfo *AddNewNode(entryInfo *file,TNodeCollection *nodes, ccIndex pos, int points)
+{
+ NodeInfo *i=new NodeInfo;
+ i->file=file->file;
+ i->node=(char *)file->items->at(pos);
+ i->points=points;
+ nodes->insert(i);
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Generic version of the routine that searchs in the list of nodes and adds
+matchs to the node collection. SearchFun points to the specialized match
+routine.
+
+***************************************************************************/
+
+static
+void *GenericSearch(char *word,entryInfo *file,TNodeCollection *nodes,
+ int (*SearchFun)(char *s, char *find))
+{
+ TStringCollection *items=file->items;
+ int cant=items->getCount(),i,ret;
+ void *exact=0;
+
+ for (i=0; i<cant; i++)
+ {
+ ret=SearchFun((char *)items->at(i),word);
+ if (ret)
+ AddNewNode(file,nodes,i,ret);
+ }
+ return exact;
+}
+
+
+/*********************** EXACT SEARCH STUFF *******************************/
+static
+void SearchExact(char *word,entryInfo *file,TNodeCollection *nodes)
+{
+ ccIndex pos;
+ TStringCollection *items=file->items;
+
+ if (seSet.caseSensitive)
+ {
+ if (items->search(word,pos))
+ AddNewNode(file,nodes,pos,1000);
+ return;
+ }
+
+ // no case sensitive
+ char aux[2],*candidate;
+ aux[0]=TVCodePage::toLower(word[0]);
+ aux[1]=0;
+ int cant=items->getCount();
+ items->search(aux,pos);
+ // Search words starting with the same letter only
+ while (pos<cant)
+ {
+ candidate=(char *)items->at(pos);
+ if (*candidate!=*aux)
+ break;
+ if (strcasecmp(word,candidate)==0)
+ AddNewNode(file,nodes,pos,strcmp(word,candidate)==0 ? 1000 : 500);
+ pos++;
+ }
+ aux[0]=TVCodePage::toUpper(aux[0]);
+ items->search(aux,pos);
+ while (pos<cant)
+ {
+ candidate=(char *)items->at(pos);
+ if (*candidate!=*aux)
+ break;
+ if (strcasecmp(word,candidate)==0)
+ AddNewNode(file,nodes,pos,strcmp(word,candidate)==0 ? 1000 : 500);
+ pos++;
+ }
+}
+/******************** End of EXACT SEARCH STUFF ****************************/
+
+/********************** SubString SEARCH STUFF******************************/
+/**[txh]********************************************************************
+
+ Description:
+ Modified version of strstr to return 1 if the string is inside or 2 if we
+have a perfect match.
+
+***************************************************************************/
+
+static
+int StrStr(char *s, char *find)
+{
+ char c, sc;
+ size_t len=0,lenS;
+
+ lenS=strlen(s);
+ if ((c=*find++)!=0)
+ {
+ len=strlen(find);
+ do
+ {
+ do
+ {
+ if ((sc=*s++)==0)
+ return 0;
+ }
+ while (sc!=c);
+ }
+ while (strncmp(s,find,len)!=0);
+ s--;
+ }
+ len++;
+ return len*1000/lenS;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Modified version of strstr to return 1 if the string is inside or 2 if we
+have a semi-perfect match. That's the non-case sensitive version.
+Attention: assumes the s parameter is uppercase.
+
+***************************************************************************/
+
+static
+int StrStrUCase(char *s, char *find)
+{
+ char c, sc;
+ size_t len=0,lenS;
+
+ lenS=strlen(s);
+ if ((c=*find++)!=0)
+ {
+ len=strlen(find);
+ do
+ {
+ do
+ {
+ if ((sc=*s++)==0)
+ return 0;
+ }
+ while (TVCodePage::toUpper(sc)!=c);
+ }
+ while (strncasecmp(s,find,len)!=0);
+ s--;
+ }
+ len++;
+ return len*1000/lenS;
+}
+
+static
+void SearchSubString(char *word,entryInfo *file,TNodeCollection *nodes)
+{
+ if (seSet.caseSensitive)
+ GenericSearch(word,file,nodes,StrStr);
+ else
+ GenericSearch(word,file,nodes,StrStrUCase);
+}
+/****************** End of SubString SEARCH STUFF ****************************/
+
+/************************ Fuzzy SEARCH STUFF *********************************/
+
+// declared in fstrcmp.h from gettext
+extern "C" double fstrcmp(const char *,const char *);
+// added by me:
+extern "C" void fstrcmp_free_memory(void);
+
+#ifndef TVCompf_djgpp
+extern "C" void *xrealloc(void *ptr,int new_size)
+{
+ return realloc(ptr,new_size);
+}
+#endif
+
+static
+int FuzzyCase(char *s, char *find)
+{
+ int result=(int)(fstrcmp(s,find)*maxFuzzy);
+ return result>=seSet.fuzzyThresold ? result : 0;
+}
+
+static
+int FuzzyNoCase(char *s, char *find)
+{
+ char upper[MAX_NODE_NAME];
+ /* string copy limiting the size and converting to uppercase */
+ int i;
+ for (i=0; i<MAX_NODE_NAME-1 && s[i]; i++)
+ upper[i]=TVCodePage::toUpper(s[i]);
+ upper[i]=0;
+
+ int result=(int)(fstrcmp(upper,find)*maxFuzzy);
+ return result>=seSet.fuzzyThresold ? result : 0;
+}
+
+
+static
+void SearchFuzzy(char *word,entryInfo *file,TNodeCollection *nodes)
+{
+ if (seSet.caseSensitive)
+ GenericSearch(word,file,nodes,FuzzyCase);
+ else
+ GenericSearch(word,file,nodes,FuzzyNoCase);
+ // We finished owr search, we can release it. Is just to avoid confusing messages in
+ // the leaks report.
+ fstrcmp_free_memory();
+}
+/********************* End of Fuzzy SEARCH STUFF ***************************/
+
+class TSelNodeDiag : public TDialog
+{
+public:
+ TSelNodeDiag(TRect r, const char *name) :
+ TWindowInit( &TSelNodeDiag::initFrame ),
+ TDialog(r,name) {};
+ void handleEvent(TEvent& event);
+};
+
+void TSelNodeDiag::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if ( event.what == evCommand || event.what == evBroadcast)
+ {
+ switch ( event.message.command )
+ {
+ case cmListItemSelected:
+ endModal(event.message.command);
+ clearEvent(event);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ User interface function to offer to the user a list of possible matchs.
+You must pass the list of choices in nodes.
+
+ Return:
+ A NodeInfo pointer to the selected node or 0 if none.
+
+***************************************************************************/
+
+static
+NodeInfo *ChooseOne(TNodeCollection *nodes)
+{
+ /* Search the best match */
+ int max=0,i,c,mp=0;
+
+ if (!seSet.sortByScore)
+ {
+ c=nodes->getCount();
+ for (i=0; i<c; i++)
+ {
+ NodeInfo *p=(NodeInfo *)nodes->at(i);
+ if (p->points>max)
+ {
+ max=p->points;
+ mp=i;
+ }
+ }
+ }
+
+ TSViewCol *col=new TSViewCol(new TSelNodeDiag(TRect(1,1,1,1),__("Choose a node")));
+
+ TSStringableListBox *Nodes=new TSStringableListBox(73,16,tsslbVertical);
+ col->insert(2,1,Nodes);
+ EasyInsertOKCancel(col,15);
+
+ TDialog *d=col->doIt();
+ delete col;
+
+ d->options|=ofCentered;
+
+ TStringableListBoxRec box;
+ box.items=nodes;
+ box.selection=mp;
+
+ if (execDialog(d,&box)!=cmCancel)
+ {
+ return (NodeInfo *)nodes->at(box.selection);
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Searchs word, offers a window with the possible matchs and returns the
+name of the file and node in the reference parameters. The passed string
+belongs to the internal collections so you don't have to delete it.
+
+ Return:
+ 1 => FileName and NodeName holds the node to jump.@*
+ 0 => no match.@*
+ 2 => User aborter.
+
+***************************************************************************/
+
+int SyntaxSearch_Search(char *word, char *&FileName, char *&NodeName,
+ char *&VisibleName)
+{
+ /* Reject 0 len strings */
+ if (!word || *word==0)
+ return 0;
+
+ /* Be sure we have a list of files */
+ SyntaxSearch_InitWithDefaults();
+ if (!entries)
+ return 0;
+
+ /* Check the list isn't empty */
+ int numFiles=entries->getCount(),numFile;
+ if (numFiles==0)
+ {
+ messageBox(__("No INFO files for syntax help defined"),mfError|mfOKButton);
+ return 0;
+ }
+ entryInfo *file;
+ TNodeCollection *nodes=new TNodeCollection(seSet.sortByScore);
+ if (!seSet.caseSensitive)
+ strupr(word);
+ /* Search in each file */
+ for (numFile=0; numFile<numFiles; numFile++)
+ {
+ file=(entryInfo *)(entries->at(numFile));
+ if (file->isOK==fileDontKnow || file->isOK==fileCheckIt)
+ file->isOK=entries->Solve(file);
+ /* Only if the file is there */
+ if (file->isOK==fileOK)
+ {
+ switch (seSet.type)
+ {
+ case schtExact:
+ SearchExact(word,file,nodes);
+ break;
+ case schtSubStr:
+ SearchSubString(word,file,nodes);
+ break;
+ case schtFuzzy:
+ SearchFuzzy(word,file,nodes);
+ break;
+ }
+ }
+ }
+ int ret=0;
+ if (nodes->getCount()>0)
+ {
+ NodeInfo *choice;
+ /* If only one just use it */
+ if (nodes->getCount()==1)
+ {
+ choice=(NodeInfo *)nodes->at(0);
+ ret=1;
+ FileName=choice->file;
+ NodeName=choice->node;
+ }
+ else
+ { /* Ask the user which one */
+ choice=ChooseOne(nodes);
+ if (choice)
+ {
+ ret=1;
+ FileName=choice->file;
+ NodeName=choice->node;
+ }
+ else
+ ret=2;
+ }
+ }
+ CLY_destroy(nodes);
+ if (ret==1)
+ {
+ VisibleName=NodeName;
+ int l=strlen(NodeName)+1;
+ if (NodeName[l]!=0)
+ NodeName+=l;
+ }
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Just a call to destroy all the allocated objects.
+
+***************************************************************************/
+
+void SyntaxSearch_ShutDown(void)
+{
+ CLY_destroy(entries);
+ entries=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads the list of files/nodes to search from the s stream.
+
+ Return:
+ 0 on success.
+
+***************************************************************************/
+
+int SyntaxSearch_Load(fpstream &s)
+{
+ char cVersion,aux;
+ s >> cVersion;
+ if (cVersion==1)
+ {
+ s.readBytes(&seSet,sizeof(SearchSettings)-sizeof(int));
+ seSet.otherOps=1;
+ }
+ else
+ s.readBytes(&seSet,sizeof(SearchSettings));
+ s >> aux;
+ if (aux)
+ {
+ s >> entriesCopy;
+ // Now don't waste any efforts we did in entries, just copy all the index
+ // we can find
+ if (entries && entriesCopy)
+ {
+ ccIndex pos,c,i;
+ entryInfo *p,*pNew;
+
+ c=entriesCopy->getCount();
+ for (i=0; i<c; i++)
+ {
+ pNew=(entryInfo *)entriesCopy->at(i);
+ if (entries->search(pNew,pos))
+ {
+ p=(entryInfo *)entries->at(pos);
+ if (p->isOK==fileOK)
+ {
+ pNew->items=p->items;
+ pNew->isOK=fileOK;
+ p->items=0;
+ p->isOK=fileNotFound;
+ }
+ }
+ }
+ }
+ CLY_destroy(entries);
+ entries=entriesCopy;
+ entriesCopy=0;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stores the list of files/nodes to search to the s stream.
+
+ Return:
+ 0 on success.
+
+***************************************************************************/
+
+int SyntaxSearch_Save(fpstream &s)
+{
+ s << Version;
+ s.writeBytes(&seSet,sizeof(SearchSettings));
+ if (entries)
+ s << (char)1 << entries;
+ else
+ s << (char)0;
+ return 0;
+}
+
+
diff --git a/setedit/mainsrc/tags.cc b/setedit/mainsrc/tags.cc
new file mode 100644
index 0000000..0b87e2a
--- /dev/null
+++ b/setedit/mainsrc/tags.cc
@@ -0,0 +1,2127 @@
+/* Copyright (C) 2003-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This is a group of classes to handle TAG files as created by Exuberant
+Ctags using format 2.
+ The classes implements a sorted collection of tags from one or more tag
+files.
+ I use the following command line to generate the tags:
+
+ctags -R --exclude="*.mak" --exclude=Makefile --exclude=".*.pl~" --fields=+i+l+m+z
+
+TODO:
+* make a SortedStringableListBox
+* Itenationalize: void TTagFiles::getText(char *dest, unsigned item, int maxLen)
+ and others
+
+***************************************************************************/
+
+#define Uses_getcwd
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define Uses_getline
+#define Uses_ctype
+#define Uses_limits
+#define Uses_sys_stat
+#define Uses_time
+#define Uses_snprintf
+#define Uses_TStringCollection
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_MsgBox
+#define Uses_fpstream
+#define Uses_TScreen
+#define Uses_AllocLocal
+
+#define Uses_TCEditor_External // For mode constants
+#define Uses_TCEditor_Commands // For the cmcJumpToFunction context
+
+#define Uses_TSLabel
+#define Uses_TSButton
+#define Uses_TSHzGroup
+#define Uses_TSStaticText
+#define Uses_TSStringableListBox
+#define Uses_TSVeGroup
+#define Uses_TSSortedListBox
+#define Uses_TSLabelRadio
+
+#define Uses_TGrowDialog
+#define Uses_TStringable
+#define Uses_TDialogAID
+#define Uses_FileOpenAid
+#define Uses_TNoCaseStringCollection
+
+#include <easydia1.h>
+#include <ceditor.h>
+#include <easydiag.h>
+
+#include <tags.h>
+
+#define Uses_SETAppConst
+#define Uses_SETAppProject
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <rhutils.h>
+#include <pathtool.h>
+#include <completi.h>
+#include <advice.h>
+#include <dyncat.h>
+
+static int InitTagsCollection();
+
+// Variables for this module
+static TTagCollection *tags=NULL;
+static uint32 autoGenMode=0;
+static char forceRegen=0;
+
+/* Uncomment it to get stats about the length of the id tags printed to stdout.
+ I got this for SETEdit + TVision (may 5th 2003)
+Max length for an Id: 48
+Number of collected Ids: 28777
+Accumulated length: 308819
+Average length: 10.73
+Distribution:
+ 1 457 1.59 *******
+ 2 367 1.28 *****
+ 3 580 2.02 *********
+ 4 1482 5.15 **********************
+ 5 1400 4.86 *********************
+ 6 1574 5.47 ************************
+ 7 1954 6.79 *****************************
+ 8 1978 6.87 ******************************
+ 9 1880 6.53 ****************************
+ 10 2610 9.07 ***************************************
+ 11 3214 11.17 ************************************************
+ 12 1937 6.73 *****************************
+ 13 2067 7.18 *******************************
+ 14 1567 5.45 ***********************
+ 15 1180 4.10 ******************
+ 16 1234 4.29 ******************
+ 17 824 2.86 ************
+ 18 600 2.08 *********
+ 19 401 1.39 ******
+ 20 293 1.02 ****
+ 21 351 1.22 *****
+ 22 235 0.82 ****
+ 23 161 0.56 **
+ 24 88 0.31 *
+*/
+#define TAG_STATS 0
+#ifdef TAG_STATS
+static unsigned maxLenIdTags, totalCantTags, lenAllIdTags;
+static unsigned *idTagsLenTable;
+#endif
+static void JumpToTag(TListBoxRec &br, Boolean isClassCol=False);
+
+// Small helpers
+static
+char *toTab(char *e)
+{
+ for (; *e && *e!='\t'; e++);
+ return e;
+}
+
+static
+char *toTabSp(char *e)
+{
+ for (; *e && *e!='\t'; e++)
+ if (*e=='_')
+ *e=' ';
+ return e;
+}
+
+static
+char *toTabSl(char *e)
+{
+ for (; *e && *e!='\t' && *e!='/'; e++)
+ if (*e=='\\')
+ e++;
+ return e;
+}
+
+static
+char *toSl(char *e)
+{
+ for (; *e && *e!='/'; e++)
+ if (*e=='\\')
+ e++;
+ return e;
+}
+
+static
+char *toQuestion(char *e)
+{
+ for (; *e && *e!='?'; e++)
+ if (*e=='\\')
+ e++;
+ return e;
+}
+
+/*****************************************************************************
+ TTagInfo class
+*****************************************************************************/
+
+void TTagInfo::print1(void *item, void *arg)
+{
+ stTagInfo *p=(stTagInfo *)item;
+ printf("%s=%s",p->var,p->value);
+ if (p->comment)
+ printf(" # %s",p->comment);
+ puts("");
+}
+
+void TTagInfo::getText(char *dest, unsigned item, int maxLen)
+{
+ stTagInfo *p=(stTagInfo *)at(item);
+
+ if (p->comment)
+ CLY_snprintf(dest,maxLen,"%s=%s # %s",p->var,p->value,p->comment);
+ else
+ CLY_snprintf(dest,maxLen,"%s=%s",p->var,p->value);
+}
+
+void *TTagInfo::keyOf(void *item)
+{
+ stTagInfo *p=(stTagInfo *)item;
+ return (void *)p->var;
+}
+
+int TTagInfo::addValue(char *s)
+{
+ stTagInfo *p=new stTagInfo;
+ p->var=NULL;
+ p->value=NULL;
+ p->comment=NULL;
+ s+=6;
+ char *e=toTabSp(s);
+ if (*e)
+ {
+ p->var=newStrL(s,e-s);
+ s=e+1;
+ e=toTab(s);
+ if (*e)
+ {
+ p->value=newStrL(s,e-s);
+ s=e+1;
+ if (*s=='/') s++;
+ e=toTabSl(s);
+ if (*e && e-s>1)
+ p->comment=newStrL(s,e-s);
+ }
+ }
+ insert(p);
+ return 0;
+}
+
+void TTagInfo::freeItem(void *item)
+{
+ if (!item) return;
+ stTagInfo *p=(stTagInfo *)item;
+ DeleteArray(p->var);
+ DeleteArray(p->value);
+ DeleteArray(p->comment);
+ delete p;
+}
+
+/*****************************************************************************
+ TTagFiles class
+*****************************************************************************/
+
+TTagFiles::TTagFiles() :
+ TStringCollection(2,2)
+{
+}
+
+void TTagFiles::print1(void *item, void *)
+{
+ stTagFile *p=(stTagFile *)item;
+ printf("%s [%s]",p->file,p->base);
+ char b[40];
+ struct tm *t=localtime(&p->modtime);
+ strftime(b,40,"%d/%m/%Y %X",t);
+ printf(" %s %d entries\n",b,p->entries);
+ printf("TTagInfo:\n");
+ p->info->print();
+ puts("");
+}
+
+void TTagFiles::getText(char *dest, unsigned item, int maxLen)
+{
+ stTagFile *p=(stTagFile *)at(item);
+ if (p->entries<0)
+ CLY_snprintf(dest,maxLen,"%s [%s] %s",p->file,p->entries==-1 ? "error" : "not loaded",
+ p->flags & stfAutoGenerated ? "automatic" : "");
+ else
+ CLY_snprintf(dest,maxLen,"%s [%d entries] %s",p->file,p->entries,
+ p->flags & stfAutoGenerated ? "automatic" : "");
+}
+
+void TTagFiles::freeItem(void *item)
+{
+ stTagFile *p=(stTagFile *)item;
+ DeleteArray(p->file);
+ DeleteArray(p->base);
+ CLY_destroy(p->info);
+ delete p;
+}
+
+void *TTagFiles::keyOf(void *item)
+{
+ stTagFile *p=(stTagFile *)item;
+ return (void *)p->file;
+}
+
+void TTagFiles::removeAutoGenerated()
+{
+ ccIndex i;
+ for (i=0; i<count; )
+ {
+ stTagFile *p=atPos(i);
+ if (p->flags & stfAutoGenerated)
+ atFree(i);
+ else
+ i++;
+ }
+}
+
+void TTagFiles::clearFlag(void *item, void *arg)
+{
+ uchar mask=*((unsigned *)arg);
+ stTagFile *p=(stTagFile *)item;
+ p->flags&= ~mask;
+}
+
+/*****************************************************************************
+ TTagCollection and TSpTagCollection classes
+ The TSpTagCollection is a simple collection.
+ The TTagCollection is the collection plus all the stuff needed to handle the
+TAG files.
+*****************************************************************************/
+
+int TSpTagCollection::compare(void *key1, void *key2)
+{
+ return strcasecmp((char *)key1,(char *)key2);
+}
+
+const char *TSpTagCollection::Languages[]=
+{
+ "Asm", "ASP", "Awk", "BETA", "C", "C++",
+ "Cobol","Eiffel","Fortran", "HTML", "Java", "Lisp",
+ "Lua", "Make", "Pascal", "Perl", "PHP", "Python",
+ "REXX", "Ruby", "Scheme", "Sh", "SLang", "Tcl",
+ "Vim", "YACC", "VHDL", "C#", "Erlang", "JavaScript",
+ "SML", "SQL", "Vera", "Verilog", NULL
+};
+
+const int
+ ttclAsm=0, ttclASP=1, ttclAwk=2, ttclBETA=3, ttclC=4, ttclCpp=5,
+ ttclCobol=6,ttclEiffel=7, ttclFortran=8,ttclHTML=9, ttclJava=10, ttclLisp=11,
+ ttclLua=12, ttclMake=13, ttclPascal=14,ttclPerl=15, ttclPHP=16, ttclPython=17,
+ ttclREXX=18,ttclRuby=19, ttclScheme=20,ttclSh=21, ttclSLang=22, ttclTcl=23,
+ ttclVim=24, ttclYACC=25, ttclVHDL=26, ttclCH=27, ttclErlang=28,ttclJavaScript=29,
+ ttclSML=30, ttclSQL=31, ttclVera=32, ttclVerilog=33,
+ ttclUnknown=255;
+
+static stTagKind Asm[]={{'d',"define"},{'l',"label"},{'m',"macro"},{'t',"type"}};
+static stTagKind ASP[]={{'f',"function"},{'s',"subroutine"},{'v',"variable"}};
+static stTagKind Func[]={{'f',"function"}};
+static stTagKind BETA[]={{'f',"fragment definition"},{'p',"all pattern"},
+ {'s',"slot"},{'v',"pattern"}};
+static stTagKind Cpp[]={{'c',"class"},{'d',"macro definition"},{'e',"enumerator"},
+ {'f',"function definition"},{'g',"enumeration name"},
+ {'l',"local var."},
+ {'m',"member (c, s, or u)"},{'n',"namespaces"},
+ {'p',"function prot. and dec."},
+ {'s',"structure name"},{'t',"typedef"},
+ {'u',"union name"},{'v',"variable definition"},
+ {'x',"extern & forward var. dec."}};
+static stTagKind Cobol[]={{'d',"data item"},{'f',"file description"},{'g',"group item"},
+ {'p',"paragraph"},{'P',"program id"},{'s',"section"}};
+static stTagKind Eiffel[]={{'c',"class"},{'f',"feature"},{'l',"local entity"}};
+static stTagKind Fortran[]={{'b',"block data"},{'c',"common block"},{'e',"entry point"},
+ {'f',"function"},{'i',"interface"},{'k',"type component"},
+ {'l',"label"},{'L',"local and common block var"},
+ {'m',"module"},{'n',"namelist"},{'p',"program"},
+ {'s',"subroutine"},{'t',"derived type"},
+ {'v',"module variable"}};
+static stTagKind HTML[]={{'a',"anchor"},{'f',"JavaScript function"}};
+static stTagKind Java[]={{'c',"class"},{'f',"field"},{'i',"interface"},{'m',"method"},
+ {'p',"package"}};
+static stTagKind Make[]={{'m',"macro"}};
+static stTagKind Pascal[]={{'f',"function"},{'p',"procedure"}};
+static stTagKind Perl[]={{'c',"constant"},{'l',"label"},{'p',"package"},{'s',"subroutine"}};
+static stTagKind PHP[]={{'c',"class"},{'d',"define"},{'f',"function"},{'v',"variable"}};
+static stTagKind Python[]={{'c',"class"},{'f',"function"},{'m',"member"}};
+static stTagKind REXX[]={{'s',"subroutine"}}; // REXX
+static stTagKind Ruby[]={{'c',"class"},{'f',"method"},{'F',"singleton method"},{'m',"mixin"}};
+static stTagKind Scheme[]={{'f',"function"},{'s',"set"}};
+static stTagKind SLang[]={{'f',"function"},{'n',"namespace"}};
+static stTagKind Tcl[]={{'c',"class"},{'m',"method"},{'p',"procedure"}};
+static stTagKind Vim[]={{'a',"augroup"},{'f',"function"},{'v',"variable"}};
+static stTagKind YACC[]={{'l',"labels"}};
+static stTagKind VHDL[]={{'a',"architecture"},{'b',"package body"},{'c',"component"},
+ {'e',"entity"},{'f',"function"},{'F',"function prototype"},
+ {'k',"package"},{'p',"procedure"},{'P',"procedure prototype"}};
+static stTagKind CH[]={{'c',"class"},{'d',"macro definition"},{'e',"enumerator"},
+ {'E',"event"},{'f',"field"},{'g',"enumeration"},
+ {'i',"interface"},{'l',"local variable"},{'m',"method"},
+ {'n',"namespace"},{'p',"property"},{'s',"structure"},
+ {'t',"typedef"}};
+static stTagKind Erlang[]={{'d',"macro"},{'f',"function"},{'m',"module"},{'r',"record"}};
+static stTagKind SML[]={{'e',"exception"},{'f',"function"},{'c',"functor"},
+ {'s',"signature"},{'r',"structure"},{'t',"type"},{'v',"value"}};
+static stTagKind SQL[]={{'c',"cursor"},{'d',"prototype"},{'f',"function"},
+ {'F',"field"},{'l',"local variable"},{'L',"block label"},
+ {'P',"package"},{'p',"procedure"},{'r',"record"},
+ {'s',"subtype"},{'t',"table"},{'T',"trigger"},
+ {'v',"variable"}};
+static stTagKind Vera[]={{'c',"class"},{'d',"macro"},{'e',"enumerator"},{'f',"function"},
+ {'g',"enumeration"},{'l',"local variable"},{'m',"member"},
+ {'p',"program"},{'P',"function prototype"},{'t',"task"},
+ {'T',"typedef"},{'v',"variable"},{'x',"external variable"}};
+static stTagKind Verilog[]={{'c',"constant"},{'e',"event"},{'f',"function"},
+ {'m',"module"},{'n',"net data type"},{'p',"port"},
+ {'r',"register data type"},{'t',"task"}};
+
+stTagKinds TSpTagCollection::Kinds[]=
+{
+ {4,Asm},{3,ASP},{1,Func},{4,BETA},{14,Cpp},{14,Cpp},
+ {6,Cobol},{3,Eiffel},{14,Fortran},{2,HTML},{5,Java},
+ {1,Func},{1,Func},{1,Make},{2,Pascal},{4,Perl},
+ {4,PHP},{3,Python},{1,REXX},{4,Ruby},
+ {2,Scheme},{1,Func},{2,SLang},{3,Tcl},{3,Vim},
+ {1,YACC},{9,VHDL},{13,CH},{4,Erlang},{1,Func},
+ {7,SML},{13,SQL},{13,Vera},{8,Verilog}
+};
+
+TSpTagCollection::TSpTagCollection(unsigned size) :
+ TStringCollection(size,size/2)
+{
+ files=new TStringCollection(size/10,size/10);
+ duplicates=True;
+}
+
+TSpTagCollection::~TSpTagCollection()
+{
+ CLY_destroy(files);
+}
+
+TTagCollection::TTagCollection() :
+ TSpTagCollection(100)
+{
+ tagFiles=new TTagFiles();
+}
+
+TTagCollection::~TTagCollection()
+{
+ CLY_destroy(tagFiles);
+}
+
+void *TSpTagCollection::keyOf(void *item)
+{
+ stTag *p=(stTag *)item;
+ return (void *)p->id;
+}
+
+void TSpTagCollection::freeItem(void *item)
+{
+ stTag *p=(stTag *)item;
+ DeleteArray(p->id);
+ DeleteArray(p->partof);
+ if (!(p->flags & sttFgLine))
+ DeleteArray(p->regex);
+ delete p;
+}
+
+void TTagCollection::print1(void *item, void *)
+{
+ char b[120];
+ getText(b,item,120);
+ puts(b);
+}
+
+const char *TSpTagCollection::getLanguage(stTag *p)
+{
+ return p->lang==ttclUnknown ? "unknown" : Languages[p->lang];
+}
+
+const char *TSpTagCollection::getKind(stTag *p)
+{
+ if (p->lang!=ttclUnknown)
+ {
+ int count=Kinds[p->lang].count;
+ stTagKind *k=Kinds[p->lang].kinds;
+ int i;
+ for (i=0; i<count; i++)
+ if (k[i].kind==p->kind)
+ return k[i].name;
+ }
+ return "unknown";
+}
+
+void TSpTagCollection::getText(char *buf, unsigned item, int maxLen)
+{
+ if (((int)item)==-1)
+ {
+ *buf=EOS;
+ return;
+ }
+ getText(buf,at(item),maxLen);
+}
+
+void TSpTagCollection::getTextType(char *buf, void *item, int maxLen)
+{
+ stTag *p=(stTag *)item;
+ // Debug info uses | to show the point to replace the name
+ char *pos=strchr((char *)p->type,'|');
+ if (!pos)
+ {
+ CLY_snprintf(buf,maxLen,"%s",p->type);
+ return;
+ }
+ int l,acum;
+ // Copy all the text before |
+ l=pos-p->type;
+ if (l>=maxLen)
+ {
+ strncpy(buf,p->type,maxLen-1);
+ buf[maxLen-1]=EOS;
+ return;
+ }
+ strncpy(buf,p->type,l);
+ acum=l;
+ // Copy the name
+ l=strlen(p->id);
+ if (acum+l>=maxLen)
+ {
+ strncpy(buf+acum,p->id,maxLen-acum-1);
+ buf[maxLen-1]=EOS;
+ return;
+ }
+ strncpy(buf+acum,p->id,l);
+ acum+=l;
+ // Copy the rest
+ pos++;
+ l=strlen(pos);
+ if (!l)
+ return;
+ if (acum+l>=maxLen)
+ {
+ strncpy(buf+acum,pos,maxLen-acum-1);
+ buf[maxLen-1]=EOS;
+ return;
+ }
+ strcpy(buf+acum,pos);
+}
+
+#define Advance maxLen-=aux; buf+=aux; if (maxLen<2) return
+
+void TSpTagCollection::getText(char *buf, void *item, int maxLen)
+{
+ stTag *p=(stTag *)item;
+ AllocLocalStr(preBuf,maxLen);
+
+ int aux=p->flags & sttFgPMask;
+ if (aux!=0 && aux!=sttFgInherits)
+ {
+ char idP;
+ switch (aux)
+ {
+ case sttFgStruct:
+ idP='s';
+ break;
+ case sttFgClass:
+ idP='c';
+ break;
+ case sttFgEnum:
+ case sttFgEntity:
+ idP='e';
+ break;
+ case sttFgUnion:
+ idP='u';
+ break;
+ default:
+ idP='?';
+ }
+ CLY_snprintf(preBuf,maxLen,"%s (%s:%c)",p->id,p->partof,idP);
+ }
+ else
+ {
+ CLY_snprintf(preBuf,maxLen,"%s",p->id);
+ }
+ CLY_snprintf(buf,maxLen,"%-36s [%-26s] %-6s %-40s %s",preBuf,getKind(p),getLanguage(p),
+ p->source,p->type ? p->type : "");
+}
+
+#undef Advance
+
+// Exuberant Ctags escapes '\' and '/' using '\'
+static
+void removeEscapeSeq(char *s)
+{
+ char *d=s;
+ for (; *s; s++)
+ {
+ if (*s=='\\')
+ s++;
+ *(d++)=*s;
+ }
+ *d=0;
+}
+
+int TSpTagCollection::addValue(char *s, stTagFile *tf)
+{
+ stTag *p=new stTag;
+ memset(p,0,sizeof(stTag));
+ // If no language is specified assume that's C.
+ // This is common for the objdump, in this case the language is unknown but
+ // the kinds are reported like in C.
+ p->lang=ttclC;
+
+ char *e=toTab(s);
+ if (!*e)
+ {
+ delete p;
+ return 1;
+ }
+ p->id=newStrL(s,e-s);
+
+ if (TAG_STATS)
+ {
+ unsigned l=e-s;
+ if (l>maxLenIdTags)
+ {
+ idTagsLenTable=(unsigned *)realloc(idTagsLenTable,sizeof(unsigned)*(l+1));
+ for (maxLenIdTags++; maxLenIdTags<l; maxLenIdTags++)
+ idTagsLenTable[maxLenIdTags]=0;
+ idTagsLenTable[maxLenIdTags]=1;
+ }
+ else
+ idTagsLenTable[l]++;
+ totalCantTags++;
+ lenAllIdTags+=l;
+ }
+
+ s=e+1;
+ e=toTab(s);
+ if (!*e)
+ {
+ delete p;
+ return 2;
+ }
+ *e=0;
+ ccIndex pos;
+ if (files->search(s,pos))
+ {
+ //printf("%s already there (%d)\n",s,pos);
+ p->source=(char *)files->at(pos);
+ }
+ else
+ {
+ char *f=newStr(s);
+ //printf("First time for: %s\n",f);
+ p->source=f;
+ files->insert(f);
+ }
+ s=e+1;
+ if (!*s)
+ {
+ delete p;
+ return 3;
+ }
+ if (ucisdigit(*s))
+ {// Line number
+ p->line=strtol(s,&e,10);
+ p->flags|=sttFgLine;
+ }
+ else if (*s=='/')
+ {
+ s++;
+ e=toSl(s);
+ // Exuberant Ctags doesn't use a real regex here.
+ // It just puts /^*$/ where * is the content of the line.
+ // So I just take this text and do a "whole word" search.
+ char *newRegex=newStrL(s+1,e-s-2);
+ removeEscapeSeq(newRegex);
+ p->regex=newRegex;
+ e++;
+ //printf("Regex: %s\n",p->regex);
+ }
+ else if (*s=='?')
+ { // Hmm... this is wrong, how to implement it?
+ // But may be isn't wrong because that's also fake.
+ s++;
+ e=toQuestion(s);
+ p->regex=newStrL(s+1,e-s-2);
+ e++;
+ //printf("Backwards Regex: %s\n",p->regex);
+ }
+ else
+ {
+ printf("What it means?: %s\n",s);
+ delete p;
+ return 4;
+ }
+ p->tagFile=tf;
+ if (*e!=';' || e[1]!='"')
+ {// Most probably that's a format 1 (original ctags) file
+ insert(p);
+ return 0;
+ }
+ e+=2;
+ if (*e=='\t') e++;
+ for (s=e; *s && *s!='\r' && *s!='\n'; s++);
+ *s=0;
+ e=strtok(e,"\t");
+ while (e)
+ {
+ if (!e[1]) // The kind: can be implicit
+ {
+ p->kind=*e;
+ }
+ else if (strncmp(e,"kind:",5)==0)
+ {
+ p->kind=e[5];
+ }
+ else if (strncmp(e,"language:",9)==0)
+ {
+ int i;
+ e+=9;
+ for (i=0; Languages[i]; i++)
+ if (strcmp(e,Languages[i])==0)
+ {
+ p->lang=i;
+ break;
+ }
+ if (!Languages[i])
+ {
+ p->lang=ttclUnknown;
+ printf("Warning! unknown language: <%s>\n",e);
+ }
+ }
+ else if (strncmp(e,"class:",6)==0)
+ {
+ p->partof=newStr(e+6);
+ p->flags|=sttFgClass;
+ }
+ else if (strncmp(e,"struct:",7)==0)
+ {
+ p->partof=newStr(e+7);
+ p->flags|=sttFgStruct;
+ }
+ else if (strncmp(e,"enum:",5)==0)
+ {
+ p->partof=newStr(e+5);
+ p->flags|=sttFgEnum;
+ }
+ else if (strncmp(e,"union:",6)==0)
+ {
+ p->partof=newStr(e+6);
+ p->flags|=sttFgUnion;
+ }
+ else if (strncmp(e,"inherits:",9)==0)
+ {
+ p->partof=newStr(e+9);
+ p->flags|=sttFgInherits;
+ }
+ else if (strncmp(e,"entity:",7)==0)
+ {
+ p->partof=newStr(e+7);
+ p->flags|=sttFgEntity;
+ }
+ else if (strncmp(e,"file:",5)==0)
+ {
+ p->flags|=sttFgLocal;
+ }
+ else if (strncmp(e,"implementation:",15)==0)
+ {
+ e+=15;
+ if (strcmp(e,"virtual")==0)
+ p->flags|=sttFgVirtual;
+ else if (strcmp(e,"pure virtual")==0)
+ p->flags|=sttFgPureVirtual;
+ else if (strcmp(e,"abstract")==0)
+ p->flags|=sttFgAbstract;
+ }
+ else if (strncmp(e,"type:",5)==0)
+ {
+ p->type=newStr(e+5);
+ }
+ else if (strncmp(e,"access:",7)==0)
+ {
+ // Ignore it. Is language specific and not yet handled.
+ }
+ else if (strncmp(e,"register:",9)==0)
+ {// Generated by objdump: optimized to a register
+ p->flags|=sttFgRegister;
+ }
+ else if (strncmp(e,"value:",6)==0)
+ {
+ // Ignore it. It is generated by objdump and contains the value for
+ // enum members.
+ }
+ else if (strncmp(e,"union class:",12)==0)
+ {
+ // Ignore it. It is generated by objdump and contains the name of
+ // the "union class".
+ }
+ else if (strncmp(e,"typeref:struct:",15)==0)
+ {
+ // Ignore it. Is used for annonymous structures
+ }
+ else
+ {
+ printf("Warning unknown attribute: %s\n",e);
+ }
+ e=strtok(NULL,"\t");
+ }
+ insert(p);
+ return 0;
+}
+
+int TTagCollection::loadTagsFromFile(stTagFile *p)
+{
+ int ret=1;
+ // Open the file
+ FILE *f=fopen(p->file,"rt");
+ if (f)
+ {
+ ret=0;
+
+ struct stat st;
+ fstat(fileno(f),&st);
+ p->modtime=st.st_mtime;
+ unsigned entries=0;
+
+ // Read the data
+ char *line=(char *)malloc(200);
+ size_t size=200;
+ int varsFound=0;
+ while (!feof(f))
+ {
+ if (CLY_getline(&line,&size,f)!=-1)
+ {
+ if (strncmp(line,"!_TAG_",6)==0)
+ {
+ p->info->addValue(line);
+ varsFound++;
+ }
+ else
+ {
+ if (!varsFound)
+ {
+ messageBox(__("Wrong format for tags file!"),mfError | mfOKButton);
+ break;
+ }
+ if (addValue(line,p)==0)
+ entries++;
+ }
+ }
+ }
+ ::free(line);
+
+ // Close the file and insert the info
+ fclose(f);
+ p->entries=entries;
+
+ // Check if that's a FORMAT 2 Exuberant Ctags file.
+ int format=0;
+ ccIndex pos;
+ if (p->info->search((void *)"FILE FORMAT",pos))
+ {
+ stTagInfo *info=p->info->atPos(pos);
+ format=atoi(info->value);
+ }
+ if (!abortInit && format!=2 && GiveAdvice(gadvTagsOld)==cmYes)
+ {
+ abortInit=1;
+ ShowHelpTopic("setedit","TAGS files");
+ }
+ }
+ else
+ p->entries=-1;
+ return ret;
+}
+
+int TTagCollection::addFile(const char *file, int defer, uchar specialFlags)
+{
+ ccIndex pos;
+ if (tagFiles->search((void *)file,pos))
+ {
+ stTagFile *p=tagFiles->atPos(pos);
+ p->flags=specialFlags;
+ return 0;
+ }
+
+ // Create a structure for info about this file
+ stTagFile *p=new stTagFile;
+ p->file=newStr(file);
+
+ char b[PATH_MAX],bfile[PATH_MAX],bdir[PATH_MAX];
+ strcpy(b,file);
+ CLY_fexpand(b);
+ CLY_ExpandPath(b,bdir,bfile);
+ p->base=newStr(bdir);
+ p->info=new TTagInfo();
+ p->entries=defer ? -2 : -1;
+ p->flags=specialFlags;
+
+ //printf("f: %s\nb: %s\n",p->file,p->base);
+ int ret=0;
+ if (!defer)
+ ret=loadTagsFromFile(p);
+ tagFiles->insert(p);
+
+ return ret;
+}
+
+static
+int CheckForCTAGS(void)
+{
+ static int isCTAGSInstalled=0;
+
+ if (!isCTAGSInstalled)
+ {
+ // We must rediret the error to avoid getting it in the stderr file
+ char *err=open_stderr_out();
+ TScreen::System("ctags --version");
+ close_stderr_out();
+ // Check what we got
+ FILE *f=fopen(err,"r");
+ int ok=0;
+ if (f)
+ {
+ char resp[80];
+ fgets(resp,80,f);
+ fclose(f);
+ ok=strstr(resp,"Exuberant Ctags")!=0;
+ }
+ unlink(err);
+
+ if (ok)
+ isCTAGSInstalled=1;
+ }
+
+ return isCTAGSInstalled;
+}
+
+int TTagCollection::refresh(Boolean advice)
+{
+ ccIndex c=tagFiles->getCount(),i;
+
+ // Indicate we are busy
+ Boolean oldBusy=TScreen::showBusyState(True);
+
+ // Automatic central tags maintainance
+ if (autoGenMode==stfAutoCentral)
+ for (i=0; i<c; i++)
+ {
+ stTagFile *p=tagFiles->atPos(i);
+ // Is that the central file?
+ if (strcmp(p->file,"tags")==0)
+ {
+ if (forceRegen)
+ {
+ unlink(p->file);
+ forceRegen=0;
+ }
+ struct stat st;
+ int retStat=stat(p->file,&st);
+ // Create a list with files newer than tags file
+ char *lst=unique_name("tg");
+ FILE *f=fopen(lst,"wt");
+ if (f)
+ {
+ int ret;
+ if (retStat)
+ ret=WriteNamesOfProjectTo(f,wnopLineSep);
+ else
+ ret=WriteNamesOfProjectToTime(f,st.st_mtime,prjtTags);
+ fclose(f);
+ if (ret)
+ {// Call ctags only if we have at least one newer
+ AllocLocalStr(buffer,36+strlen(lst));
+ sprintf(buffer,"ctags -a --fields=+i+l+m+z -L %s",lst);
+ TScreen::System(buffer);
+ ClearForceTargetBits(prjtTags);
+ }
+ unlink(lst);
+ }
+ string_free(lst);
+ break;
+ }
+ }
+ if (TAG_STATS)
+ {
+ maxLenIdTags=totalCantTags=lenAllIdTags=0;
+ idTagsLenTable=(unsigned *)malloc(sizeof(unsigned));
+ idTagsLenTable[0]=0;
+ }
+ abortInit=0;
+ for (i=0; i<c; i++)
+ {
+ stTagFile *p=tagFiles->atPos(i);
+ // Failed to load?
+ int reload=p->entries<0;
+ if (!reload)
+ {// Changed?
+ struct stat st;
+ if (stat(p->file,&st)==0)
+ reload=difftime(p->modtime,st.st_mtime)!=0.0;
+ if (reload)
+ {// Delete all current entries
+ deleteTagsFor(p);
+ }
+ }
+ if (reload)
+ {
+ //printf("Trying to reload %s\n",p->file);
+ loadTagsFromFile(p);
+ }
+ }
+
+ // We finished the blocking stuff
+ TScreen::showBusyState(oldBusy);
+
+ if (advice && !abortInit && c==1) // Only one entry and ...
+ {
+ stTagFile *p=tagFiles->atPos(0);
+ // and failed to load and is the default
+ if (p->entries==-1 && strcmp(p->file,"tags")==0)
+ {// Ask to RTFM
+ if (GiveAdvice(gadvNoTags)==cmYes)
+ {
+ abortInit=1;
+ ShowHelpTopic("setedit","TAGS files");
+ }
+ else
+ {// Nope?
+ if (CheckForCTAGS())
+ {// Ask to generate a new one
+ if (messageBox(__("I can try to generate a tag file, go ahead?"),
+ mfInformation | mfYesButton | mfNoButton)==cmYes)
+ {// Try doing it
+ TScreen::System("ctags -R --fields=+i+l+m+z");
+ loadTagsFromFile(p);
+ }
+ }
+ else
+ // Not installed explain how to get it.
+ messageBox(__("Install Exuberant Ctags, download it from http://ctags.sourceforge.net"), mfError | mfOKButton);
+ }
+ }
+ }
+ if (TAG_STATS)
+ {
+ printf("Max length for an Id: %d\n",maxLenIdTags);
+ printf("Number of collected Ids: %d\n",totalCantTags);
+ printf("Accumulated length: %d\n",lenAllIdTags);
+ printf("Average length: %6.2f\n",lenAllIdTags/(double)totalCantTags);
+ unsigned i;
+ double maxPercent=0.0;
+ for (i=0; i<=maxLenIdTags; i++)
+ {
+ double percent=idTagsLenTable[i]/(double)totalCantTags*100.0;
+ if (percent>maxPercent)
+ maxPercent=percent;
+ }
+ double scale=48.0/maxPercent;
+ printf("Distribution:\n");
+ for (i=0; i<=maxLenIdTags; i++)
+ {
+ double percent=idTagsLenTable[i]/(double)totalCantTags*100.0;
+ printf("%3d\t%8d\t%6.2f",i,idTagsLenTable[i],percent);
+ unsigned dots=unsigned(scale*percent+0.5);
+ putc(' ',stdout);
+ while (dots--)
+ putc('*',stdout);
+ putc('\n',stdout);
+ }
+ }
+ return abortInit;
+}
+
+void TTagCollection::deleteTagsFor(stTagFile *p)
+{
+ ccIndex in=0;
+ while (in<count)
+ {
+ stTag *tg=atPos(in);
+ if (tg->tagFile==p)
+ atFree(in);
+ else
+ in++;
+ }
+}
+
+TStringCollection *TTagCollection::getTagFilesList()
+{
+ ccIndex c=tagFiles->getCount(),i;
+ TStringCollection *fileC=new TStringCollection(c,1);
+ for (i=0; i<c; i++)
+ {
+ stTagFile *p=tagFiles->atPos(i);
+ fileC->insert((void *)p->file);
+ }
+ return fileC;
+}
+
+/*****************************************************************************
+ TTagClassCol
+*****************************************************************************/
+
+TTagClassCol::TTagClassCol(TSpTagCollection *from) :
+ TNoCaseStringCollection(20,10)
+ //TStringCollection(20,10)
+{
+ ccIndex c=from->getCount(),i;
+ for (i=0; i<c; i++)
+ {
+ stTag *p=from->atPos(i);
+ if (p->kind=='c') // Class for most languages except Fortran
+ {
+ addClass(p);
+ }
+ /*else if (p->kind=='m' && // member | method
+ (p->lang==ttclCpp || p->lang==ttclJava) && // from C++ | Java
+ (p->flags & sttFgPMask)==sttFgClass) // from a class*/
+ else if ((p->flags & sttFgPMask)==sttFgClass)
+ {
+ addMember(p);
+ }
+ }
+}
+
+void TTagClassCol::addClass(stTag *p)
+{
+ ccIndex pos;
+ stClassTagInfo *cl;
+ Boolean addParents=False;
+ if (searchId(p->id,pos))
+ {// Already there
+ cl=atPos(pos);
+ if (!cl->cl->source)
+ {// That's a fake entry, replace using the real data
+ deleteFake(cl->cl);
+ cl->cl=p;
+ addParents=True;
+ }
+ }
+ else
+ {// New class
+ cl=newClass();
+ cl->cl=p;
+ atInsert(pos,cl);
+ addParents=True;
+ }
+ if (addParents && p->partof)
+ {
+ char *s=strdup(p->partof);
+ char *tok=strtok(s,",");
+ while (tok)
+ {
+ cl->parents->insert(newStr(tok));
+ addChildTo(tok,p->id);
+ tok=strtok(NULL,",");
+ }
+ ::free(s);
+ }
+}
+
+void TTagClassCol::addChildTo(const char *parent, const char *child)
+{
+ stClassTagInfo *cl=getClassOrFake(parent);
+ cl->childs->insert((void *)child);
+}
+
+stTag *TTagClassCol::newFake(const char *id)
+{
+ stTag *p=new stTag;
+ p->source=NULL;
+ p->id=newStr(id);
+ return p;
+}
+
+void TTagClassCol::deleteFake(stTag *p)
+{
+ DeleteArray(p->id);
+ delete p;
+}
+
+stClassTagInfo *TTagClassCol::newClass()
+{
+ stClassTagInfo *ret=new stClassTagInfo;
+ ret->parents=new TStringCollection(2,2);
+ ret->childs =new TStringCollection(2,2);
+ ret->members=new TSpTagCollection(10);
+ return ret;
+}
+
+stClassTagInfo *TTagClassCol::getClassOrFake(const char *id)
+{
+ ccIndex pos;
+ stClassTagInfo *cl;
+ if (searchId(id,pos))
+ {// Already there
+ cl=atPos(pos);
+ }
+ else
+ {// Add a fake
+ cl=newClass();
+ cl->cl=newFake(id);
+ atInsert(pos,cl);
+ }
+ return cl;
+}
+
+void TTagClassCol::addMember(stTag *p)
+{
+ const char *to=p->partof;
+ if (!to)
+ return;
+ stClassTagInfo *cl=getClassOrFake(to);
+ cl->members->insert(p);
+}
+
+void TTagClassCol::freeItem(void *item)
+{
+ stClassTagInfo *p=(stClassTagInfo *)item;
+ CLY_destroy(p->parents);
+ delete p->childs;
+ delete p->members;
+}
+
+void *TTagClassCol::keyOf(void *item)
+{
+ stClassTagInfo *p=(stClassTagInfo *)item;
+ return (void *)p->cl->id;
+}
+
+/*****************************************************************************
+ Save and restore
+*****************************************************************************/
+
+const char tagsVersion=2;
+
+int TTagCollection::save(fpstream& s)
+{
+ ccIndex count=tagFiles->getCount(),i;
+ s << (char)tagsVersion;
+ ccIndex saveCount=0;
+ // Don't save auto-maintained files.
+ for (i=0; i<count; i++)
+ {
+ stTagFile *p=tagFiles->atPos(i);
+ if (!(p->flags & stfAutoGenerated))
+ saveCount++;
+ }
+ s << saveCount;
+ for (i=0; i<count; i++)
+ {
+ stTagFile *p=tagFiles->atPos(i);
+ if (!(p->flags & stfAutoGenerated))
+ s.writeString(p->file);
+ }
+ s << (uchar)autoGenMode;
+ return 0;
+}
+
+int TTagCollection::load(fpstream& s)
+{
+ char version;
+ ccIndex count,i;
+ s >> version >> count;
+ for (i=0; i<count; i++)
+ {
+ char *file=s.readString();
+ addFile(file,1);
+ DeleteArray(file);
+ }
+ if (version>1)
+ {
+ uchar aux;
+ s >> aux;
+ autoGenMode=aux;
+ }
+ return 0;
+}
+
+int TagsSave(fpstream& s)
+{
+ if (InitTagsCollection()) return 1;
+ return tags->save(s);
+}
+
+int TagsLoad(fpstream& s)
+{
+ CLY_destroy(tags);
+ tags=new TTagCollection();
+ return tags->load(s);
+}
+
+/*****************************************************************************
+ TTagMembersCol
+ Used to browse class members from this class and the parents.
+*****************************************************************************/
+
+TTagMembersCol::TTagMembersCol() :
+ TSpTagCollection(10)
+{
+ levels=new TNSCollection(10,5);
+}
+
+TTagMembersCol::~TTagMembersCol()
+{
+ delete levels;
+}
+
+void TTagMembersCol::getText(char *dest, unsigned item, int maxLen)
+{
+ stTag *p=(stTag *)at(item);
+ int level=(long)levels->at(item);
+ if (level)
+ CLY_snprintf(dest,maxLen,"%s (%s) %d",p->id,p->partof,level);
+ else
+ CLY_snprintf(dest,maxLen,"%s",p->id);
+}
+
+void TTagMembersCol::insert(stTag *tg, int level)
+{
+ atInsert(count,tg);
+ levels->atInsert(levels->getCount(),(void *)(long)level);
+}
+
+void TTagMembersCol::insertSorted(stTag *tg, int level)
+{
+ ccIndex i;
+ search((void *)tg->id,i);
+ atInsert(i,tg);
+ levels->atInsert(i,(void *)(long)level);
+}
+
+void TTagMembersCol::collectFromOne(TSpTagCollection *cl, int level, Boolean sort)
+{
+ ccIndex c=cl->getCount(),i;
+ if (sort)
+ for (i=0; i<c; i++)
+ insertSorted(cl->atPos(i),level);
+ else
+ for (i=0; i<c; i++)
+ insert(cl->atPos(i),level);
+}
+
+void TTagMembersCol::collect(stClassTagInfo *p, TTagClassCol *clist,
+ int level, Boolean sort)
+{
+ collectFromOne(p->members,level,sort);
+ ccIndex cParents, iParent;
+ cParents=p->parents->getCount();
+ for (iParent=0; iParent<cParents; iParent++)
+ {
+ ccIndex pos;
+ if (clist->search((char *)p->parents->at(iParent),pos))
+ collect(clist->atPos(pos),clist,level+1,sort);
+ }
+}
+
+/*****************************************************************************
+ User interface
+*****************************************************************************/
+
+static
+int InitTagsCollection()
+{
+ if (tags) return 0;
+ tags=new TTagCollection();
+ if (!tags) return 1;
+ tags->addFile("tags",1);
+ return 0;
+}
+
+void TagsFreeMemory()
+{
+ destroy0(tags);
+}
+
+/*****************************************************************************
+ List of tag files
+*****************************************************************************/
+
+static int Modified;
+
+static
+int DeleteItem(int which)
+{
+ stTagFile *p=tags->tagFiles->atPos(which);
+ if (p->flags & stfAutoGenerated)
+ {
+ messageBox(__("This file is automatically maintained"),mfError|mfOKButton);
+ return 0;
+ }
+ tags->deleteTagsFor(p);
+ tags->tagFiles->atFree(which);
+ Modified=1;
+ return 1;
+}
+
+static
+int OkApply(void)
+{
+ return 1;
+}
+
+static
+int CancelConfirm(void)
+{
+ if (Modified)
+ return messageBox(__("Do you want to discard the changes?"),mfWarning | mfYesButton | mfNoButton)==cmYes;
+ return 1;
+}
+
+static
+int AddNewItem(void)
+{
+ char buffer[PATH_MAX];
+ strcpy(buffer,"tags*");
+
+ if (GenericFileDialog(__("Select tags file"),buffer,0,hID_SelectTagFile)==cmCancel)
+ return 0;
+
+ // Check if we can add it as relative path
+ int options=0;
+ char *entered =strdup(buffer);
+ char *relative=strdup(buffer);
+ getcwd(buffer,PATH_MAX);
+ if (CheckIfPathAbsolute(entered))
+ {
+ options=AbsToRelPath(buffer,relative,0);
+ //printf("a: %s\nr: %s\n",entered,relative);
+ }
+ char *toUse;
+ if (options)
+ {
+ int ret=messageBox(__("Use relative path for the file?"),
+ mfYesButton | mfNoButton | mfConfirmation);
+ if (ret==cmCancel)
+ {
+ free(entered);
+ free(relative);
+ return 0;
+ }
+ toUse=ret==cmYes ? relative : entered;
+ }
+ else
+ toUse=entered;
+ tags->addFile(toUse);
+ free(entered);
+ free(relative);
+ return 1;
+}
+
+static
+int ShowVars(int which)
+{
+ TDialog *d=CreateChooseDialog(0,0,__("Variables"),7,60,aidStringable|aidNoCancel);
+ stTagFile *p=tags->tagFiles->atPos(which);
+ TStringableListBoxRec box={p->info,0};
+ execDialog(d,&box);
+ return 0;
+}
+
+void EditTagFiles()
+{
+ if (InitTagsCollection()) return;
+ // Note: avoid asking to generate the tags file here
+ if (tags->refresh(False)) return;
+ // Make a copy of the list to allow reverting the actions
+ TStringCollection *oldList=tags->getTagFilesList();
+
+ TStringableListBoxRec boxParam;
+ TDialogAID *d=CreateAddInsDelDialog(-1,-1,__("Tag files"),12,56,aidInfo);
+ d->helpCtx=cmeTagFiles;
+ boxParam.items=tags->tagFiles;
+ boxParam.selection=0;
+ d->DelAction=DeleteItem;
+ d->AddAction=AddNewItem;
+ d->OkAction =OkApply;
+ d->CancelAction=CancelConfirm;
+ d->InfoAction=ShowVars;
+ Modified=0;
+
+ if (execDialog(d,&boxParam)==cmCancel && Modified)
+ {// Revert
+ // 1) Delete all entries not found in the old list
+ ccIndex i=0,pos;
+ TTagFiles *tagFiles=tags->tagFiles;
+ while (i<tagFiles->getCount())
+ {
+ stTagFile *p=tagFiles->atPos(i);
+ if (!oldList->search((void *)p->file,pos))
+ {// Not in the old list, remove it
+ tags->deleteTagsFor(p);
+ tagFiles->atFree(i);
+ }
+ else
+ i++;
+ }
+ // 2) Insert all the files, the repeated will be rejected
+ for (i=0; oldList->getCount(); i++)
+ tags->addFile((char *)oldList->at(i),1);
+ }
+
+ delete oldList; // Not owner
+}
+
+/*****************************************************************************
+ Jump to tag
+*****************************************************************************/
+
+class TTagsListBox : public TSortedListBox
+{
+public:
+ TTagsListBox(const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar)
+ : TSortedListBox(bounds,aNumCols,aScrollBar) {};
+ TTagsListBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar,
+ Boolean aCenterOps=False)
+ : TSortedListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,aCenterOps) {};
+ virtual void getText(char *dest, ccIndex item, short maxLen);
+};
+
+void TTagsListBox::getText(char *dest, ccIndex item, short maxLen)
+{
+ TSpTagCollection *p=(TSpTagCollection *)items;
+ p->getText(dest,item,maxLen);
+}
+
+ListBoxSpecialize(TSTagsListBox);
+ListBoxImplement(TagsListBox);
+
+static
+TDialog *createDialogTags(const char *title, const char *label,
+ const char *okLabel, const char *yesLabel=NULL)
+{
+ TGrowDialogZ *d=new TGrowDialogZ(TRect(1,1,1,1),title);
+ TSViewCol *col=new TSViewCol(d);
+
+ TRect r=TApplication::deskTop->getExtent();
+ int h=r.b.y-r.a.y-10;
+ int w=r.b.x-r.a.x-15;
+
+ //TSStringableListBox *ListaH=new TSStringableListBox(w,h,tsslbVertical|tsslbHorizontal,1,256);
+ TSTagsListBox *ListaH=new TSTagsListBox(w,h,tsslbVertical|tsslbHorizontal,1,256);
+
+ ListaH->view->growMode=gfMoveBottomCorner;
+ TSLabel *lista=new TSLabel(label,ListaH);
+
+ col->insert(xTSLeft,yTSUp,lista);
+
+ TSButton *ok=new TSButton(okLabel,cmOK,bfDefault);
+ TSButton *cancel=new TSButton(__("Cancel"),cmCancel);
+ ok->view->growMode=cancel->view->growMode=gfGrowAll;
+ TSHzGroup *but123;
+
+ if (yesLabel)
+ {
+ TSButton *yes=new TSButton(yesLabel,cmYes);
+ yes->view->growMode=gfGrowAll;
+ but123=MakeHzGroup(ok,yes,cancel,0);
+ }
+ else
+ but123=MakeHzGroup(ok,cancel,0);
+
+ col->insert(xTSCenter,yTSDown,but123);
+ col->doItCenter(cmeSearchTag);
+ delete col;
+ return d;
+}
+
+static
+TDialog *createDialog()
+{
+ return createDialogTags(__("Jump to symbol"),__("List of symbols"),__("O~K~"),
+ __("~S~earch members"));
+}
+
+static
+void JumpToTag(TListBoxRec &br, Boolean isClassCol)
+{
+ char b[PATH_MAX],desc[120];
+ stTag *p;
+ TSpTagCollection *tgs;
+
+ if (isClassCol)
+ {// TTagClassCol aren't TSpTagCollection childs
+ TTagClassCol *clcol=(TTagClassCol *)br.items;
+ stClassTagInfo *info=clcol->atPos(br.selection);
+ p=info->cl;
+ tgs=info->members;
+ }
+ else
+ {// The rest are TSpTagCollection or childs
+ tgs=(TSpTagCollection *)br.items;
+ p=tgs->atPos(br.selection);
+ }
+ if (CLY_IsValidDirSep(p->source[0]))
+ CLY_snprintf(b,PATH_MAX,"%s",p->source);
+ else
+ CLY_snprintf(b,PATH_MAX,"%s%s",p->tagFile->base,p->source);
+ if (p->type)
+ tgs->getTextType(desc,p,120);
+ else
+ tgs->getText(desc,p,120);
+ if (!p->line)
+ {
+ messageBox(__("Unknown line"),mfError|mfOKButton);
+ p->line=1;
+ }
+ GPushCursorPos();
+ if (p->flags & sttFgLine)
+ GotoFileLine(p->line,1,b,desc);
+ else
+ GotoFileText((char *)p->regex,b,desc);
+}
+
+static
+int ShowMembers(ccIndex pos)
+{
+ stTag *p=tags->atPos(pos);
+ if (((p->kind=='e'|| p->kind=='u' || p->kind=='s') &&
+ (p->lang==ttclC || p->lang==ttclCpp)) ||
+ (p->kind=='c' && p->lang!=ttclFortran))
+ {
+ uchar mask=0;
+ switch (p->kind)
+ {
+ case 'c':
+ mask=sttFgClass;
+ break;
+ case 'e':
+ mask=sttFgEnum;
+ break;
+ case 'u':
+ mask=sttFgUnion;
+ break;
+ case 's':
+ mask=sttFgStruct;
+ break;
+ }
+ ccIndex c=tags->getCount(), i;
+ TSpTagCollection *members=new TSpTagCollection(10);
+ for (i=0; i<c; i++)
+ {
+ stTag *it=tags->atPos(i);
+ if ((it->flags & sttFgPMask)==mask && strcmp(p->id,it->partof)==0)
+ members->insert(it);
+ }
+ if (members->getCount())
+ {
+ TListBoxRec b={members,0};
+ int ret=execDialog(createDialogTags(p->id,__("Members"),__("~J~ump")),&b);
+ if (ret==cmOK)
+ {
+ JumpToTag(b);
+ delete members;
+ return 1;
+ }
+ }
+ else
+ messageBox(__("Sorry, couldn't find any member"),mfError|mfOKButton);
+ delete members;
+ }
+ else
+ {
+ messageBox(__("I don't know any members for this type"),mfError|mfOKButton);
+ return 0;
+ }
+ return 0;
+}
+
+int SearchTag(char *word)
+{
+ if (InitTagsCollection() ||
+ tags->refresh() ||
+ !tags->getCount()) return 0;
+
+ TListBoxRec br;
+ br.items=tags;
+ br.selection=0;
+ int perfectMatch=0;
+
+ if (word)
+ {
+ if (tags->search(word,br.selection))
+ {
+ ccIndex pos=br.selection;
+ char *id=(char *)tags->keyOf(tags->at(pos));
+ if (strcmp(word,id)==0)
+ {// Full match, is the only one?
+ pos++;
+ if (pos<tags->getCount())
+ {
+ id=(char *)tags->keyOf(tags->at(pos));
+ //if (strncmp(word,id,strlen(word))!=0)
+ if (strcmp(word,id)!=0)
+ perfectMatch=1;
+ }
+ }
+ }
+ else
+ {
+ if (br.selection>=tags->getCount())
+ br.selection=tags->getCount()-1;
+ }
+ DeleteArray(word);
+ if (perfectMatch)
+ {
+ JumpToTag(br);
+ return 1;
+ }
+ }
+
+ int ret;
+ do
+ {
+ ret=execDialog(createDialog(),&br);
+ if (ret==cmYes && ShowMembers(br.selection))
+ break;
+ }
+ while (ret==cmYes);
+ if (ret==cmOK)
+ {
+ JumpToTag(br);
+ return 1;
+ }
+ return 0;
+}
+
+/*****************************************************************************
+ Class Browser
+*****************************************************************************/
+
+class TClListBox : public TSortedListBox
+{
+public:
+ TClListBox(const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar)
+ : TSortedListBox(bounds,aNumCols,aScrollBar) {};
+ TClListBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aHScrollBar, TScrollBar *aVScrollBar,
+ Boolean aCenterOps)
+ : TSortedListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,aCenterOps) {};
+ virtual void getText(char *dest, ccIndex item, short maxLen);
+};
+
+void TClListBox::getText(char *dest, ccIndex item, short maxLen)
+{
+ if (item<0)
+ {
+ *dest=0;
+ return;
+ }
+ TTagClassCol *p=(TTagClassCol *)items;
+ //p->getText(dest,item,maxLen);
+ CLY_snprintf(dest,maxLen,"%s",p->atPos(item)->cl->id);
+}
+
+ListBoxSpecialize(TSClListBox);
+ListBoxImplement(ClListBox);
+
+static TDialog *createDialogCl()
+{
+ TGrowDialogZ *d=new TGrowDialogZ(TRect(1,1,1,1),__("Class list"));
+ TSViewCol *col=new TSViewCol(d);
+
+ TRect r=TApplication::deskTop->getExtent();
+ int h=r.b.y-r.a.y-10;
+ int w=r.b.x-r.a.x-25;
+
+ //TSStringableListBox *ListaH=new TSStringableListBox(w,h,tsslbVertical|tsslbHorizontal,1,256);
+ TSClListBox *ListaH=new TSClListBox(w,h,tsslbVertical|tsslbHorizontal,1,256);
+
+ ListaH->view->growMode=gfMoveBottomCorner;
+ TSLabel *lista=new TSLabel(__("List of classes"),ListaH);
+
+ col->insert(xTSLeft,yTSUp,lista);
+
+ TSButton *ok=new TSButton(__("~V~iew"),cmOK,bfDefault);
+ TSButton *yes=new TSButton(__("~J~ump"),cmYes);
+ TSButton *cancel=new TSButton(__("Cancel"),cmCancel);
+ ok->view->growMode=cancel->view->growMode=yes->view->growMode=gfGrowAll;
+ TSHzGroup *but123=MakeHzGroup(ok,yes,cancel,0);
+ col->insert(xTSCenter,yTSDown,but123);
+ col->doItCenter(cmeClassBrowser);
+ delete col;
+ return d;
+}
+
+const int cmThisClass=cmOK,
+ cmThisAParents=cmYes,
+ cmSorted=cmNo,
+ cmExit=cmCancel;
+const unsigned
+ cmParent=0x2000,
+ cmChild =0x2001,
+ cmNone =0;
+
+// This small trick saves me from creating an specialized TDialog
+static unsigned commandCB;
+static
+int buttonsCB_VCl(unsigned command, void *)
+{
+ commandCB=command;
+ return btcbEndModal;
+}
+
+static
+TDialog *createDialogVCl(stClassTagInfo *cl)
+{
+ TSViewCol *col=new TSViewCol(cl->cl->id);
+ commandCB=cmNone;
+
+ TSVeGroup *parents=NULL, *childs=NULL;
+ if (cl->parents->getCount())
+ {
+ parents=MakeVeGroup(1 | tsveMakeSameW,
+ new TSLabel(__("P~a~rents"),
+ new TSSortedListBox(20,6,tsslbVertical|tsslbHorizontal,1,80)),
+ new TSButton(__("Browse ~p~arent"),cmParent,bfNormal,buttonsCB_VCl),0);
+ }
+ if (cl->childs->getCount())
+ {
+ childs=MakeVeGroup(1 | tsveMakeSameW,
+ new TSLabel(__("Chil~d~ren"),
+ new TSSortedListBox(20,6,tsslbVertical|tsslbHorizontal,1,80)),
+ new TSButton(__("Browse ~c~hild"),cmChild,bfNormal,buttonsCB_VCl),0);
+ }
+ TSView *relations=NULL;
+ if (parents && childs)
+ relations=MakeHzGroup(parents,childs,0);
+ else
+ relations=parents ? parents : childs;
+
+ TSVeGroup *grp=MakeVeGroup(tsveMakeSameW,
+ new TSStaticText(__("View")),
+ new TSButton(__("~T~his class"),cmThisClass,bfDefault),
+ new TSButton(__("This & Pa~r~ents"),cmThisAParents),
+ new TSButton(__("~S~orted"),cmSorted),
+ new TSButton(__("E~x~it"),cmExit),
+ relations,
+ 0);
+ col->insert(xTSCenter,yTSUp,grp);
+
+ TDialog *d=col->doItCenter(cmeClassBrowser);
+ delete col;
+ return d;
+}
+
+static
+int BrowseClassMembers(stClassTagInfo *cl)
+{
+ TListBoxRec b={cl->members,0};
+ int ret=execDialog(createDialogTags(cl->cl->id,__("Members"),__("~J~ump")),&b);
+ if (ret==cmOK)
+ {
+ JumpToTag(b);
+ return cmCancel;
+ }
+ return cmOK;
+}
+
+static
+int BrowseThisAParents(stClassTagInfo *cl, TTagClassCol *clist, Boolean sorted,
+ ccIndex &toView)
+{
+ TTagMembersCol *col=new TTagMembersCol();
+ col->collect(cl,clist,0,sorted);
+ TListBoxRec b={col,0};
+ int ret=execDialog(createDialogTags(cl->cl->id,__("Members"),__("~J~ump"),
+ __("View ~C~lass")),&b);
+ if (ret==cmOK)
+ {
+ JumpToTag(b);
+ ret=cmCancel;
+ }
+ else if (ret==cmYes)
+ {
+ clist->searchId(col->atPos(b.selection)->partof,toView);
+ }
+ else
+ ret=cmOK;
+ delete col;
+ return ret;
+}
+
+static
+Boolean BrowseClass(ccIndex index, TTagClassCol *clist)
+{
+ int ret;
+ Boolean jumped=False;
+ do
+ {
+ stClassTagInfo *cl=clist->atPos(index);
+ struct
+ {
+ TListBoxRec b1;
+ TListBoxRec b2;
+ } box;
+ TListBoxRec *next=&box.b1;
+ TListBoxRec *parents=NULL, *childs=NULL;
+ if (cl->parents->getCount())
+ {
+ box.b1.items=cl->parents;
+ box.b1.selection=0;
+ parents=&box.b1;
+ next=&box.b2;
+ }
+ if (cl->childs->getCount())
+ {
+ next->items=cl->childs;
+ next->selection=0;
+ childs=next;
+ }
+ ret=execDialog(createDialogVCl(cl),&box);
+ if (commandCB==cmParent)
+ {
+ clist->search(cl->parents->at(parents->selection),index);
+ }
+ else if (commandCB==cmChild)
+ {
+ clist->search(cl->childs->at(childs->selection),index);
+ }
+ else
+ {
+ switch (ret)
+ {
+ case cmThisClass:
+ ret=BrowseClassMembers(cl);
+ jumped=ret==cmCancel ? True : False;
+ break;
+ case cmThisAParents:
+ ret=BrowseThisAParents(cl,clist,False,index);
+ jumped=ret==cmCancel ? True : False;
+ break;
+ case cmSorted:
+ ret=BrowseThisAParents(cl,clist,True,index);
+ jumped=ret==cmCancel ? True : False;
+ break;
+ }
+ }
+ }
+ while (ret!=cmCancel);
+ return jumped;
+}
+
+static
+void BrowseClasses(TListBoxRec &br, TTagClassCol *clist)
+{
+ int ret;
+ do
+ {
+ ret=execDialog(createDialogCl(),&br);
+ if (ret==cmYes)
+ JumpToTag(br,True);
+ if (ret==cmOK && BrowseClass(br.selection,clist))
+ break;
+ }
+ while (ret==cmOK);
+}
+
+void TagsClassBrowser(char *word)
+{
+ if (InitTagsCollection()) return;
+ if (tags->refresh()) return;
+ TTagClassCol *classList=new TTagClassCol(tags);
+
+ if (!classList->getCount())
+ {
+ CLY_destroy(classList);
+ messageBox(__("Sorry, but I can't find any class."),mfError | mfOKButton);
+ return;
+ }
+
+ TListBoxRec br;
+ br.items=classList;
+ br.selection=0;
+
+ Boolean perfectMatch=False;
+ if (word)
+ {
+ perfectMatch=classList->search(word,br.selection);
+ if (br.selection>=classList->getCount())
+ br.selection=classList->getCount()-1;
+ DeleteArray(word);
+ }
+ if (perfectMatch)
+ BrowseClass(br.selection,classList);
+ else
+ BrowseClasses(br,classList);
+
+ CLY_destroy(classList);
+}
+
+/*****************************************************************************
+ Word Completion
+*****************************************************************************/
+
+static inline
+stTag *SearchTagFor(char *word, int lenW, ccIndex &pos)
+{
+ tags->search(word,pos);
+ if (pos>=tags->getCount())
+ return NULL;
+ stTag *p=tags->atPos(pos);
+ if (strncasecmp(p->id,word,lenW)!=0)
+ return NULL;
+
+ return p;
+}
+
+char *TagsWordCompletion(int x, int y, char *word)
+{
+ if (!word || InitTagsCollection()) return NULL;
+ if (tags->refresh()) return NULL;
+ if (!tags->getCount()) return NULL;
+
+ // Search a tag that matches
+ int lenW=strlen(word),tLen;
+ ccIndex pos;
+ stTag *p=SearchTagFor(word,lenW,pos);
+ if (!p)
+ return NULL;
+
+ TStringCollection *list=new TNoCaseStringCollection(10,4);
+ int len=0;
+ while (strncasecmp(p->id,word,lenW)==0)
+ {
+ list->insert((char *)p->id);
+ tLen=strlen(p->id);
+ if (tLen>len)
+ len=tLen;
+ pos++;
+ if (pos>=tags->getCount())
+ break;
+ p=tags->atPos(pos);
+ }
+
+ char *ret=CompletionChooseFromList(list,list->getCount(),len,x-lenW,y,0,lenW);
+ delete list;
+
+ return ret;
+}
+
+char *TagsWordCompletionClass(int x, int y, char *word)
+{
+ if (!word || InitTagsCollection()) return NULL;
+ if (tags->refresh()) return NULL;
+ if (!tags->getCount()) return NULL;
+
+ // Search a tag that matches
+ ccIndex pos, max=tags->getCount();
+ if (!tags->search(word,pos))
+ return NULL;
+
+ // Found, now search a class
+ stTag *p=tags->atPos(pos);
+ while (p->kind!='c')
+ {
+ pos++;
+ if (pos>=max)
+ return NULL;
+ p=tags->atPos(pos);
+ if (strcmp(p->id,word))
+ return NULL;
+ }
+
+ // Found a class. Go and collect the members
+ TStringCollection *list=new TNoCaseStringCollection(10,4);
+ ccIndex c=tags->getCount(),i;
+ int len=0,cant=0,tLen=0;
+ for (i=0; i<c; i++)
+ {
+ stTag *p=tags->atPos(i);
+ if ((p->flags & sttFgPMask)==sttFgClass && strcmp(word,p->partof)==0)
+ {
+ list->insert((char *)p->id);
+ cant++;
+ tLen=strlen(p->id);
+ if (tLen>len)
+ len=tLen;
+ }
+ }
+
+ char *ret=NULL;
+ if (cant)
+ ret=CompletionChooseFromList(list,cant,len,x,y,0);
+ delete list;
+
+ return ret;
+}
+
+/*****************************************************************************
+ Tag file generation options
+*****************************************************************************/
+
+void SetTagFilesGenerationOptions()
+{
+ if (!IsPrjOpened())
+ {
+ messageBox(__("This option is only available when using projects"),
+ mfInformation | mfOKButton);
+ return;
+ }
+ if (InitTagsCollection()) return;
+ TSViewCol *col=new TSViewCol(__("Tags options"));
+ col->insert(xTSCenter,yTSUp,
+ TSLabelRadio(__("Automatic generation"),__("~D~isabled"),
+ __("~U~sing central file"),0));
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doItCenter(cmeTagsOps);
+ delete col;
+ unsigned ops=autoGenMode;
+ if (execDialog(d,&ops)==cmOK)
+ {
+ autoGenMode=ops;
+ if (autoGenMode==stfAutoCentral)
+ {
+ ProjectInsertAutoTagFiles(); // Ensure the central is included
+ }
+ else
+ {
+ if (messageBox(__("Remove the tags files that I maintained from the list of files to use?"),
+ mfConfirmation|mfYesButton|mfNoButton)==cmYes)
+ RemoveAutoGenerated();
+ else
+ tags->tagFiles->unmarkAutoGenerated();
+ }
+ }
+}
+
+void RemoveAutoGenerated()
+{
+ if (tags)
+ tags->tagFiles->removeAutoGenerated();
+}
+
+void InsertAutoGenerated(const char *name)
+{
+ if (tags)
+ tags->addFile(name,1,stfAutoGenerated);
+}
+
+uint32 GetAutoGenMode()
+{
+ return autoGenMode;
+}
+
+void TagsAutoRegen()
+{
+ if (tags)
+ {
+ forceRegen=1;
+ tags->refresh(False);
+ }
+}
+
diff --git a/setedit/mainsrc/tsindica.cc b/setedit/mainsrc/tsindica.cc
new file mode 100644
index 0000000..35ceb63
--- /dev/null
+++ b/setedit/mainsrc/tsindica.cc
@@ -0,0 +1,59 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#define Uses_string
+
+#define Uses_TSIndicator
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+#define Uses_TView
+#define Uses_opstream
+#define Uses_ipstream
+#define Uses_TStreamableClass
+#define Uses_TCEditor
+#define Uses_TScreen
+#include <ceditor.h>
+
+void TSIndicator::draw()
+{
+ uchar color, frame;
+ TDrawBuffer b;
+ char s[15];
+
+ if ((state & sfDragging)==0)
+ {
+ color = getColor(1);
+ frame = dragFrame;
+ }
+ else
+ {
+ color = getColor(2);
+ frame = normalFrame;
+ }
+
+ b.moveChar(0,frame,color,size.x);
+
+ if (editor->isReadOnly)
+ b.putChar(0,'R');
+ else
+ if (editor->modified)
+ b.putChar(0,modifiedStar);
+
+ if (!TScreen::cursorShapes())
+ b.putChar(1,editor->overwrite ? 'O' : 'I');
+
+ sprintf(s," %d:%d ",editor->curPos.y+1,editor->curPos.x+1);
+ b.moveCStr(8-int(strchr(s,':')-s),s,color);
+
+ writeBuf(0,0,size.x,1,b);
+}
+
+TStreamable *TSIndicator::build()
+{
+ return new TSIndicator(streamableInit);
+}
+
+TSIndicator::TSIndicator(StreamableInit) : TIndicator( streamableInit )
+{
+}
+
diff --git a/setedit/makes/.cvsignore b/setedit/makes/.cvsignore
new file mode 100644
index 0000000..333aa45
--- /dev/null
+++ b/setedit/makes/.cvsignore
@@ -0,0 +1,5 @@
+*.mak
+rhide.env
+ed.tags
+mapita
+
diff --git a/setedit/makes/Makefile b/setedit/makes/Makefile
new file mode 100644
index 0000000..d7c4e82
--- /dev/null
+++ b/setedit/makes/Makefile
@@ -0,0 +1,176 @@
+srcdir=.
+VPATH=$(srcdir)
+
+.PHONY: editor
+
+include rhide.env
+
+ifneq ($(strip $(DJDIR)),)
+export editor_OS:=DJGPP
+endif
+
+# If not DOS then just Linux, no other supported by now
+ifeq ($(strip $(editor_OS)),)
+export editor_OS:=Linux
+endif
+
+# Enable the .imk and .umk maintainance only in "maintainer mode"
+ifdef MAINTAINER_MODE
+MAKES_TARGET=makes
+else
+MAKES_TARGET=
+endif
+
+# That's the default target
+editor: $(MAKES_TARGET)
+ $(MAKE) -f editor.mkf
+
+###########################################################################
+# #
+# Rules to generate makefiles from RHIDE's projects #
+# #
+###########################################################################
+
+main_targets=editor infview libset install sdgcline testeasy
+editorprjs=$(main_targets) amp3 easydiag extra inffd librhuti settv
+mp3_targets=../mp3/libamp/libamp ../mp3/mpegsound/mpegsnd
+allprjs=$(editorprjs) $(mp3_targets)
+
+# The list of "targets"
+mkfs_list=$(main_targets) $(mp3_targets)
+# Makefiles for them
+mkfs_files=$(addsuffix .mkf,$(mkfs_list))
+# Dependencies for them
+imks_files=$(addsuffix .imk,$(mkfs_list))
+
+# Tool to extract dependencies
+extrimk.exe: extrimk.cc
+ $(RHIDE_GCC) -o $@ $< $(STDCPP_LIB)
+
+# Tool to create temporal .mak files and call extrimk
+genimk.exe: genimk.cc extrimk.exe
+ $(RHIDE_GCC) -o $@ $< $(STDCPP_LIB)
+
+# Main project, the editor
+editor.imk: editor.gpr amp3.gpr easydiag.gpr extra.gpr inffd.gpr librhuti.gpr \
+ settv.gpr genimk.exe extrimk.exe
+ @./genimk.exe $@ $^
+
+# InfView project
+infview.imk: infview.gpr easydiag.gpr librhuti.gpr settv.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+# LibSET for RHIDE
+libset.imk: libset.gpr easydiag.gpr extra.gpr settv.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+# DOS Installer
+install.imk: install.gpr easydiag.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+# Command line version of sdg, not fully maintained
+sdgcline.imk: sdgcline.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+# EasyDiag example/test, not fully maintained
+testeasy.imk: testeasy.gpr easydiag.gpr settv.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+# LibAMP
+../mp3/libamp/libamp.imk: ../mp3/libamp/libamp.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+# LibMPEGSound (splay)
+../mp3/mpegsound/mpegsnd.imk: ../mp3/mpegsound/mpegsnd.gpr genimk.cc extrimk.cc
+ @./genimk.exe $@ $^
+
+makes: extrimk.exe genimk.exe $(mkfs_files) $(imks_files)
+
+###########################################################################
+# #
+# Clean targets #
+# #
+###########################################################################
+
+clean:
+ rm -f *.imk *.bak *.bkp
+
+clean-o:
+ rm -f obj*/*.o
+
+clean-docs:
+ cd ../doc; make clean-docs; cd ../makes
+
+infview: $(MAKES_TARGET)
+ $(MAKE) -f infview.mkf
+
+libset: $(MAKES_TARGET)
+ $(MAKE) -f libset.mkf
+
+ifeq ($(editor_OS),DJGPP)
+scrnsave:
+ $(MAKE) -C ../scrnsave
+
+distrib-all: distrib distrib-infview installer
+
+distrib: editor scrnsave
+ cd djgpp; compress.bat $(EXTRA_INS_OPS) ; cd ..
+
+distrib-infview: infview
+ cd djgpp; perl compinf.pl $(EXTRA_INS_OPS) ; cd ..
+
+distrib-source:
+ cd djgpp; compress.bat --only-source $(EXTRA_INS_OPS) ; cd ..
+
+installer: distrib
+ $(MAKE) -f install.mkf
+ cd ../install; perl create.pl; cd ..
+
+#
+# Installation prefix: MPREFIX, mprefix or DJDIR
+#
+ifneq ($(strip $(MPREFIX)),)
+inst_prefix=$(MPREFIX)
+else
+ ifneq ($(strip $(mprefix)),)
+ inst_prefix=$(mprefix)
+ else
+ inst_prefix=$(DJDIR)
+ endif
+endif
+
+install: editor
+ cd djgpp; compress.bat $(EXTRA_INS_OPS) --prefix $(inst_prefix) --install; cd ..
+
+install-infview: infview
+ cd djgpp; perl compinf.pl $(EXTRA_INS_OPS) --prefix $(inst_prefix) --install; cd ..
+
+else
+#
+# Installation prefix: MPREFIX, mprefix or /usr
+#
+ifneq ($(strip $(MPREFIX)),)
+inst_prefix=$(MPREFIX)
+else
+ ifneq ($(strip $(mprefix)),)
+ inst_prefix=$(mprefix)
+ else
+ inst_prefix=/usr
+ endif
+endif
+
+distrib: editor
+ cd linux; perl ./compress.pl $(EXTRA_INS_OPS) --prefix $(inst_prefix) --fhs $(SET_USE_FHS); cd ..
+
+distrib-infview: infview
+ cd linux; perl ./compinf.pl $(EXTRA_INS_OPS) --prefix $(inst_prefix) --fhs $(SET_USE_FHS); cd ..
+
+distrib-source:
+ cd linux; perl ./compress.pl --only-source $(EXTRA_INS_OPS) ; cd ..
+
+install: editor
+ cd linux; perl ./compress.pl $(EXTRA_INS_OPS) --prefix $(inst_prefix) --install --fhs $(SET_USE_FHS); cd ..
+
+install-infview: infview
+ cd linux; perl ./compinf.pl $(EXTRA_INS_OPS) --prefix $(inst_prefix) --install --fhs $(SET_USE_FHS); cd ..
+endif
diff --git a/setedit/makes/allegro.cfg b/setedit/makes/allegro.cfg
new file mode 100644
index 0000000..5084283
--- /dev/null
+++ b/setedit/makes/allegro.cfg
@@ -0,0 +1,3 @@
+[sound]
+sb_freq = 45454
+quality = 1
diff --git a/setedit/makes/amp3.gpr b/setedit/makes/amp3.gpr
new file mode 100644
index 0000000..b6ff310
--- /dev/null
+++ b/setedit/makes/amp3.gpr
Binary files differ
diff --git a/setedit/makes/amp3.imk b/setedit/makes/amp3.imk
new file mode 100644
index 0000000..f778381
--- /dev/null
+++ b/setedit/makes/amp3.imk
@@ -0,0 +1,203 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+obj/ampdiag$(ExOBJ):: ../mp3/ampdiag.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ dskmp3.h \
+ dskwin.h \
+ easydia1.h \
+ easydiag.h \
+ intermp3.h \
+ mp3play.h \
+ nostatex.h \
+ setapp.h \
+ settvuti.h \
+ snostate.h \
+ tsbutton.h \
+ tshscrol.h \
+ tshzgrp.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/intermp3$(ExOBJ):: ../mp3/intermp3.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ intermp3.h \
+ mp3play.h \
+ settvuti.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mp3list$(ExOBJ):: ../mp3/mp3list.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ intermp3.h \
+ setapp.h \
+ settvuti.h \
+ tnosostr.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortva.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mp3play$(ExOBJ):: ../mp3/mp3play.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ mp3play.h \
+ mpegsound/mpegsound.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/amp3.umk b/setedit/makes/amp3.umk
new file mode 100644
index 0000000..d25d11b
--- /dev/null
+++ b/setedit/makes/amp3.umk
@@ -0,0 +1,16 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+obj/ampdiag$(ExOBJ):: ../mp3/ampdiag.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/intermp3$(ExOBJ):: ../mp3/intermp3.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mp3list$(ExOBJ):: ../mp3/mp3list.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mp3play$(ExOBJ):: ../mp3/mp3play.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/blink.c b/setedit/makes/blink.c
new file mode 100644
index 0000000..ba74a62
--- /dev/null
+++ b/setedit/makes/blink.c
@@ -0,0 +1,63 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador E. Tropea.
+ Covered by the GPL license.
+ Description:
+ tlink have a really useless command line. This wrapper avoids all the
+complexities.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define MAX_FILE 256
+
+int main(int argc, char *argv[])
+{
+ FILE *f;
+ int i,ret;
+ char *s;
+ char b[MAX_FILE];
+
+ if (argc<3)
+ {
+ printf("tlink wrapper\n");
+ printf("Copyright (c) 2003 by Salvador E. Tropea. GPL.\n");
+ printf("Usage: blink lib list_obj_files\n");
+ return 1;
+ }
+ f=fopen("bcclink.lnk","wt");
+ if (!f)
+ {
+ printf("Can't create response file\n");
+ return 2;
+ }
+ for (i=2; i<argc; i++)
+ {
+ s=argv[i];
+ if (!strstr(s,".obj"))
+ continue;
+ ret=strlen(s);
+ if (ret>MAX_FILE-1)
+ {
+ printf("Name too long: %s\n",s);
+ return 3;
+ }
+ strcpy(b,s);
+ for (s=b; *s; s++)
+ if (*s=='/') *s='\\';
+ fprintf(f,"+%s &\n",b);
+ }
+ fprintf(f,"+");
+ fclose(f);
+
+ unlink(argv[1]);
+ s=(char *)malloc(strlen(argv[1])+32);
+ sprintf(s,"tlib %s /E @bcclink.lnk",argv[1]);
+ ret=system(s);
+ if (!ret)
+ unlink("bcclink.lnk");
+ return ret;
+}
diff --git a/setedit/makes/common.bmk b/setedit/makes/common.bmk
new file mode 100644
index 0000000..84f2519
--- /dev/null
+++ b/setedit/makes/common.bmk
@@ -0,0 +1,61 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+# For Borland C++.
+# This file contains the definitions needed to compile and link the rules
+# found in .umk files.
+# The definitions are used by all the makefiles.
+#
+
+#
+# That configure the compilation and linking options.
+# Is equivalent to rhide.env.
+#
+!include config.bcc
+
+SRCDIRS_2=$(SRCDIRS);.
+.path.cc=$(SRCDIRS_2)
+.path.c=$(SRCDIRS_2)
+.path.s=$(SRCDIRS_2)
+
+# Turn off the implicit rule to generate .obj files from .c files.
+# If we don't do it make will use both rules.
+.c.obj:
+
+# These files changes the compilation process so they are important
+# dependencies.
+MAKEFILE_DEPS=blink.exe
+# Extensions used by Borland tools
+ExOBJ=.obj
+ExEXE=.exe
+ExLIB=.lib
+
+RHIDE_AR=blink
+RHIDE_ARFLAGS=
+
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(LDFLAGS) -e$(OUTFILE) $(OBJFILES) \
+ $(LIBRARIES) $(RHIDE_LIBDIRS) $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) -c $(CFLAGS) $(INCLUDE_DIRS) -o$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) -c $(CXXFLAGS) $(INCLUDE_DIRS) -o$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) \
+ $(ALL_PREREQ)
+# This is fake, the .S files are used only for DJGPP and they are protected
+# by preprocessor constructions. For this reason they can be used as C sources
+# to generate dummy .obj files.
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_GCC) -c $(CFLAGS) $(INCLUDE_DIRS) -o$(OUTFILE) \
+ $(SOURCE_NAME)
+
+SOURCE_NAME=$**
+OUTFILE=$@
+ALL_PREREQ=$**
+
+#LIB_DIRS=$(RHIDE_OS_LIBS_PATH) -L.
+
+blink.exe: blink.c
+ $(RHIDE_GCC) -e$(OUTFILE) $(ALL_PREREQ)
+
+HELPER_TARGET=blink.exe
diff --git a/setedit/makes/common.imk b/setedit/makes/common.imk
new file mode 100644
index 0000000..5d0a852
--- /dev/null
+++ b/setedit/makes/common.imk
@@ -0,0 +1,35 @@
+#!/usr/bin/make
+
+#
+# Any configurable detail should come from here.
+#
+include rhide.env
+
+vpath %.c $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath_obj=obj
+vpath %.o $(vpath_obj)
+vpath %.h $(INCLUDE_DIRS)
+
+# These files changes the compilation process so they are important
+# dependencies.
+MAKEFILE_DEPS=rhide.env common.imk
+# Extensions used by GNU tools
+ExOBJ=.o
+ExEXE=.exe
+ExLIB=.a
+
+RHIDE_AS=$(RHIDE_GCC)
+SOURCE_NAME=$<
+OUTFILE=$@
+ALL_PREREQ=$^
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler-with-cpp\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+LIB_DIRS=$(RHIDE_OS_LIBS_PATH) -L.
+RHIDE_ARFLAGS=rcs
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE)\
+ $(ALL_PREREQ)
+
diff --git a/setedit/makes/common.nmk b/setedit/makes/common.nmk
new file mode 100644
index 0000000..7afbd30
--- /dev/null
+++ b/setedit/makes/common.nmk
@@ -0,0 +1,63 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea.
+# Covered by the GPL license.
+#
+# For MSVC. NOT TESTED PLEASE HELP ME TO FIX IT.
+# This file contains the definitions needed to compile and link the rules
+# found in .umk files.
+# The definitions are used by all the makefiles.
+#
+
+#
+# That configure the compilation and linking options.
+# Is equivalent to rhide.env.
+#
+!include config.nmk
+
+SRCDIRS_2=$(SRCDIRS);.
+#.path.cc=$(SRCDIRS_2)
+#.path.c=$(SRCDIRS_2)
+#.path.s=$(SRCDIRS_2)
+
+# Turn off the implicit rule to generate .obj files from .c files.
+# If we don't do it make will use both rules.
+.c.obj:
+
+HELPER_TARGET=mlink.exe
+# These files changes the compilation process so they are important
+# dependencies.
+#MAKEFILE_DEPS=$(HELPER_TARGET)
+MAKEFILE_DEPS=
+# Extensions used by Microsoft tools
+ExOBJ=.obj
+ExEXE=.exe
+ExLIB=.lib
+
+RHIDE_AR=lib
+RHIDE_ARFLAGS=
+
+# Is that correct? Why not with cl?
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(LDFLAGS) /OUT:$(OUTFILE) $(OBJ_DIR) \
+ $(LIBRARIES) $(RHIDE_LIBDIRS) user32.lib $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) -c $(CFLAGS) $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) -c $(CXXFLAGS) $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) /OUT:$(OUTFILE) \
+ $(ALL_PREREQ)
+# This is fake, the .S files are used only for DJGPP and they are protected
+# by preprocessor constructions. For this reason they can be used as C sources
+# to generate dummy .obj files.
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_GCC) -c $(CFLAGS) /TC $(INCLUDE_DIRS) -Fo$(OUTFILE) \
+ $(SOURCE_NAME)
+
+# Are these correct?
+SOURCE_NAME=$**
+OUTFILE=$@
+ALL_PREREQ=$**
+
+mlink.exe:: mlink.c
+ $(RHIDE_GCC) kernel32.lib $(ALL_PREREQ) /link /OUT:$(OUTFILE)
+
+
diff --git a/setedit/makes/config.bcc b/setedit/makes/config.bcc
new file mode 100644
index 0000000..e22daeb
--- /dev/null
+++ b/setedit/makes/config.bcc
@@ -0,0 +1,42 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This file contains the definitions that configures the compilation.
+# They include the C and C++ options and linker options.
+# I used BC++ 5.5 free command line tools for testing.
+#
+
+TVISION_INC=-I..\..\tvision\winnt\include -I..\..\tvision\include
+# Why it doesn't work?
+#RHIDE_LIBDIRS=-L..\libz -L..\libpcre -L..\libbzip2
+TVLIBDIR=..\..\tvision\makes
+
+!ifdef DEBUG
+CDEBUGFLAGS = -v -vi -y -6 -Od
+!else
+CDEBUGFLAGS = -O2 -6 -T -DNDEBUG
+!endif
+
+!ifdef DYNRTL
+DYNRTLDFLAGS = -WR
+!endif
+
+CFLAGS = -w-aus -w-ccc -a8 $(DYNRTLDFLAGS) -WC -X -q $(CDEBUGFLAGS) \
+ -DFOR_EDITOR
+# Note: rch == Unreachable code. BC++ 5.5 is idiot to detect code that is
+# disabled on purpose. i.e. if (0) ...
+CXXFLAGS = -P -RT- -w-hid -w-par -w-rch $(CFLAGS)
+LDFLAGS = $(DYNRTLDFLAGS) -WC
+
+RHIDE_GCC=bcc32
+RHIDE_GXX=bcc32
+RHIDE_LD=bcc32
+
+# Sets the variables for the sub-makes
+EXTRALIB_MAKE_ARGS=_SUBMAKE=1 CC="$(RHIDE_GCC)" LD="$(RHIDE_LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.bcc
+
+MK_EXT=.bcc
+MKF_EXT=.bmk
+
diff --git a/setedit/makes/config.nmk b/setedit/makes/config.nmk
new file mode 100644
index 0000000..c384c6d
--- /dev/null
+++ b/setedit/makes/config.nmk
@@ -0,0 +1,34 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This file contains the definitions that configures the compilation.
+# They include the C and C++ options and linker options.
+#
+
+TVISION_INC=-I..\..\tvision\winnt\include -I..\..\tvision\include
+TVLIBDIR=..\..\tvision\makes
+
+!ifdef DEBUG
+# Options to debug
+CFLAGS = /nologo -D_WIN32 -DFOR_EDITOR /GX /Zi
+LDFLAGS = /DEBUG
+!else
+# Options for optimization (production)
+CFLAGS = /nologo -O2 -D_WIN32 -DFOR_EDITOR /GX
+#CFLAGS = /nologo -O2 -D_WIN32 -DFOR_EDITOR /GR- /GX-
+LDFLAGS = /verbose
+!endif
+CXXFLAGS = /TP $(CFLAGS)
+
+RHIDE_GCC=cl
+RHIDE_GXX=cl
+RHIDE_LD=mlink
+
+# Sets the variables for the sub-makes
+EXTRALIB_MAKE_ARGS=_SUBMAKE=1 CC="$(RHIDE_GCC)" LD="$(RHIDE_LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -f Makefile.nmk
+
+MK_EXT=.nmk
+MKF_EXT=.nmk
+
diff --git a/setedit/makes/djgpp/compinf.pl b/setedit/makes/djgpp/compinf.pl
new file mode 100644
index 0000000..da188e3
--- /dev/null
+++ b/setedit/makes/djgpp/compinf.pl
@@ -0,0 +1,333 @@
+#!/usr/bin/perl
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+open(FIL,'../../infview/version.txt') || return 0;
+$version=<FIL>;
+chop($version);
+close(FIL);
+$version1=$version;
+$version1=~ s/\.//g;
+
+$r=cat('../../infview/infmain.cc');
+if ($r!~/$version/)
+ {
+ die "Error! inconsistent version in infmain.cc\n";
+ }
+
+$binManifest='';
+
+# Default prefix
+$pwd=Pwd();
+$prefix=$pwd;
+# Environment prefix
+$i=$ENV{'prefix'};
+if (length($i))
+ {
+ $prefix=$i;
+ }
+else
+ {
+ $i=$ENV{'PREFIX'};
+ if (length($i))
+ {
+ $prefix=$i;
+ }
+ }
+
+# Parse command line
+$nextisprefix=0;
+$iMode=0; # Installation mode
+$iCompressExe=1;
+foreach $i (@ARGV)
+ {
+ if ($nextisprefix)
+ {
+ $prefix=$i;
+ $nextisprefix=0;
+ }
+ elsif ($i eq '--prefix')
+ {
+ $nextisprefix=1;
+ }
+ elsif ($i eq '--install')
+ {
+ $iMode=1;
+ }
+ elsif ($i eq '--no-compress')
+ {
+ $iCompressExe=0;
+ }
+ else
+ {
+ print "Unknown command line option: $i\n";
+ print "Usage: compres.pl [--prefix path] [--install] [--no-compress]\n\n";
+ }
+ }
+
+# Update the makefiles if needed
+if (!$iMode)
+ {
+ print "Creating makefile: ";
+ #system('cp -p ../djgppenv.env ../rhide.env');
+ chdir('..');
+ system('make makes');
+ chdir('djgpp');
+ print "done.\n\n";
+ }
+
+
+# Create the distribution tree if needed
+print "Creating directories: \n";
+
+if ($iMode)
+ {
+ # Installation directories
+ $bindir =$prefix.'/bin';
+ $contrib1 =$prefix.'/contrib';
+ $contrib =$contrib1.'/infview';
+ $info =$prefix.'/info';
+ $share1 =$prefix.'/share';
+ $share =$share1.'/infview';
+ $manifest =$prefix.'/manifest';
+ $Locale2 =$share1.'/locale';
+ $spLocale1 =$Locale2.'/es';
+ $spLocale =$spLocale1.'/LC_MESSAGES';
+ $deLocale1 =$Locale2.'/de';
+ $deLocale =$deLocale1.'/LC_MESSAGES';
+
+ @tree=(
+ $bindir,
+ $contrib1,
+ $contrib,
+ $info,
+ $share1,
+ $share,
+ $manifest,
+ $Locale2,
+ $spLocale1,
+ $spLocale,
+ $deLocale1,
+ $deLocale);
+ }
+else
+ {
+ # Distribution directories
+ $distPrefix=$prefix.'/distinf';
+ $bindir =$distPrefix.'/bin';
+ $contrib1 =$distPrefix.'/contrib';
+ $contrib =$contrib1.'/infview';
+ $info =$distPrefix.'/info';
+ $share1 =$distPrefix.'/share';
+ $share =$share1.'/infview';
+ $manifest =$distPrefix.'/manifest';
+ $Locale2 =$share1.'/locale';
+ $spLocale1 =$Locale2.'/es';
+ $spLocale =$spLocale1.'/LC_MESSAGES';
+ $deLocale1 =$Locale2.'/de';
+ $deLocale =$deLocale1.'/LC_MESSAGES';
+ $result =$prefix.'/resulinf';
+
+ @tree=(
+ $distPrefix,
+ $bindir,
+ $contrib1,
+ $contrib,
+ $info,
+ $share1,
+ $share,
+ $manifest,
+ $Locale2,
+ $spLocale1,
+ $spLocale,
+ $deLocale1,
+ $deLocale,
+ $result);
+ }
+
+foreach $i (@tree)
+ {
+ if (!(-d $i))
+ {
+ mkdir($i,00755);
+ print "$i\n";
+ }
+ }
+print "done.\n\n";
+
+
+print "Copying the exe: ";
+$d=$bindir.'/infview.exe';
+$o='../infview.exe';
+$binManifest.=$d."\n";
+if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o .");
+ system("zip -9u $result/infview-$version-DOS-debug.zip infview.exe") unless($iMode);
+ # I could use --best but is slooooowwwwwwwww and doesn't compress much in
+ # the case of the editor.
+ system('upx -9 infview.exe') unless $iCompressExe==0;
+ system("mv infview.exe $d");
+ }
+print "done.\n\n";
+
+
+print "Copying doc files: ";
+chdir('../../doc');
+if (system('make txt info man')==0)
+ {
+ CopyIf('infeng.inf',$info.'/infview.inf',$binManifest);
+ CopyIf('infeng.txt',$contrib.'/infview.txt',$binManifest);
+ CopyIf('infview.1',$info.'/infview.1',$binManifest);
+ }
+else
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "Failed to generate the docs ... Skipping the documentation,\n";
+ print "you can create it latter, now press ENTER or ^C to stop\n";
+ <STDIN>;
+ }
+chdir('../makes/djgpp');
+CopyIfRpl('../../distrib/distrib3.txt',$contrib.'/readme.1st',$binManifest);
+print "done.\n\n";
+
+
+print "Copying other files: ";
+print 'copyrigh' if (CopyIf('../../copyrigh',$contrib.'/copyrigh',$binManifest));
+print 'copying.dj' if (CopyIf('../../copying.dj',$contrib.'/copying.dj',$binManifest));
+print 'copying.gpl' if (CopyIf('../../copying.gpl',$contrib.'/copying.gpl',$binManifest));
+print 'copying.lgp' if (CopyIf('../../copying.lgp',$contrib.'/copying.lgp',$binManifest));
+print 'copying.rh' if (CopyIf('../../copying.rh',$contrib.'/copying.rh',$binManifest));
+print 'Spanish messages' if (CopyIf('../../internac/es.mo',$spLocale.'/setedit.mo',$binManifest));
+print 'German messages' if (CopyIf('../../internac/de.mo',$deLocale.'/setedit.mo',$binManifest));
+print "done.\n\n";
+
+
+print "Generating manifest and version files: \n";
+$d="$manifest/inf$version1"."b.ver";
+open(FIL,">$d") || die "Can't create version file";
+print FIL ("inf".$version1."b Info Viewer v$version for DJGPP");
+close(FIL);
+$binManifest.="$d\n";
+$d="$share/version.txt";
+open(FIL,">$d") || die "Can't create version.txt";
+print FIL ("$version\n$version1\n");
+close(FIL);
+$binManifest.="$d\n";
+$d="$manifest/inf$version1"."b.mft";
+$binManifest.="$d\n";
+if ($iMode)
+ {
+ $prefix.='/';
+ $binManifest =~ s/$prefix//g;
+ }
+else
+ {
+ $i="$distPrefix/";
+ $binManifest =~ s/$i//g;
+ }
+open(FIL,">$d");
+print FIL ($binManifest);
+close(FIL);
+print "done.\n\n";
+
+
+if ($iMode)
+ {
+ print "End of installation\n";
+ }
+else
+ {
+ print "Compressing the files: ";
+ $i=Pwd();
+ chdir($distPrefix);
+ system("zip -9ru $result/inf".$version1."b.zip *");
+ chdir($i);
+ print "done.\n\n";
+
+ CopyIfRpl('../../distrib/distrib3.txt',"$result/readme.1st");
+
+ chdir('contrib/setedit/makes/djgpp');
+
+ ToHTML("$result/readme.1st","$result/readmeinf.html",'readme.1st');
+ }
+
+0;
+
+sub ToHTML
+{
+ my $a;
+
+ $a=cat($_[0]);
+ open(FIL,">$_[1]") || die "Can't create readme $_[1]";
+ print FIL ("<HTML><Title>$_[2] for InfView</Title><Body><Pre>");
+ print FIL ($a);
+ print FIL ('</Pre></Body></HTML>');
+ close(FIL);
+}
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+
+sub replace
+{
+ my $b=$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
+
+
+sub CopyIf
+{
+ my ($o,$d)=@_;
+ my $list=\$_[2];
+
+ $$list.=$d."\n";
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o $d");
+ return 1;
+ }
+ 0;
+}
+
+
+sub CopyIfRpl
+{
+ my ($o,$d)=@_;
+ my $a;
+ my $list=\$_[2];
+
+ $$list.=$d."\n";
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ $a=cat($o);
+ $a =~ s/\@\@v\@\@/$version/g;
+ $a =~ s/\@\@v1\@\@/$version1/g;
+ replace($d,$a);
+ return 1;
+ }
+ 0;
+}
+
+sub Pwd
+{
+ my $pwd;
+ $pwd=`pwd`;
+ $pwd=`sh pwd` unless $pwd;
+ chop($pwd);
+ return $pwd;
+}
+
diff --git a/setedit/makes/djgpp/compress.bat b/setedit/makes/djgpp/compress.bat
new file mode 100755
index 0000000..a3f341e
--- /dev/null
+++ b/setedit/makes/djgpp/compress.bat
@@ -0,0 +1,6 @@
+@echo off
+Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+Rem see copyrigh file for details
+
+set lfn=y
+perl compress.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/setedit/makes/djgpp/compress.pl b/setedit/makes/djgpp/compress.pl
new file mode 100644
index 0000000..6dc6a09
--- /dev/null
+++ b/setedit/makes/djgpp/compress.pl
@@ -0,0 +1,508 @@
+#!/usr/bin/perl
+# Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+open(FIL,'../../version.txt') || die;
+$version=<FIL>;
+chop($version);
+close(FIL);
+$version1=$version;
+$version1=~ s/\.//g;
+
+$r=cat('../../include/ced_inte.h');
+if ($r!~/$version/)
+ {
+ die "Error! inconsistent version in ced_inte.h\n";
+ }
+
+$r=cat('../../include/vername.h');
+$revision=$1 if $r=~/VERSION_REV\s+(\d+)/;
+$relname=$1 if $r=~/VERSION_NAME\s+\"([^\"]+)\"/;
+
+$binManifest='';
+
+# Default prefix
+$pwd=Pwd();
+$prefix=$pwd;
+# Environment prefix
+$i=$ENV{'prefix'};
+if (length($i))
+ {
+ $prefix=$i;
+ }
+else
+ {
+ $i=$ENV{'PREFIX'};
+ if (length($i))
+ {
+ $prefix=$i;
+ }
+ }
+
+# Parse command line
+$nextisprefix=0;
+$iMode=0; # Installation mode
+$iCompressExe=1;
+$Strip=1;
+$OnlySources=0;
+foreach $i (@ARGV)
+ {
+ if ($nextisprefix)
+ {
+ $prefix=$i;
+ $nextisprefix=0;
+ }
+ elsif ($i eq '--prefix')
+ {
+ $nextisprefix=1;
+ }
+ elsif ($i eq '--install')
+ {
+ $iMode=1;
+ }
+ elsif ($i eq '--no-compress')
+ {
+ $iCompressExe=0;
+ }
+ elsif ($i eq '--no-strip')
+ {
+ $Strip=0;
+ }
+ elsif ($i eq '--only-source')
+ {
+ $OnlySources=1;
+ }
+ elsif ($i eq '--use-bzip2')
+ {
+ $UseBzip2=1;
+ }
+ else
+ {
+ print "Unknown command line option: $i\n";
+ print "Usage: compres.pl [--prefix path] [--install] [--no-compress]\n\n";
+ }
+ }
+
+@files=('../../distrib/distrib1.txt','../../distrib/distrib2.txt');
+
+
+# Update the makefiles if needed
+if (!$iMode)
+ {
+ print "Creating makefile: ";
+ #system('cp -p ../djgppenv.env ../rhide.env');
+ chdir('..');
+ system('make makes');
+ chdir('djgpp');
+ print "done.\n\n";
+
+ print "Creating Borland C++ makefile: ";
+ chdir('../..');
+ system('perl confignt.pl');
+ chdir('makes/djgpp');
+ print "done.\n\n";
+ }
+
+if ($OnlySources)
+ {
+ GenerateSourceDistro();
+ exit 0;
+ }
+
+# Create the distribution tree if needed
+print "Creating directories: \n";
+
+if ($iMode)
+ {
+ # Installation directories
+ $bindir =$prefix.'/bin';
+ $contrib1 =$prefix.'/contrib';
+ $contrib =$contrib1.'/setedit.bin';
+ $contribX =$contrib.'/examples';
+ $contribTg =$contrib.'/tag_imgs';
+ $info =$prefix.'/info';
+ $share1 =$prefix.'/share';
+ $share =$share1.'/setedit';
+ $manifest =$prefix.'/manifest';
+ $Locale2 =$share1.'/locale';
+ $spLocale1 =$Locale2.'/es';
+ $spLocale =$spLocale1.'/LC_MESSAGES';
+ $deLocale1 =$Locale2.'/de';
+ $deLocale =$deLocale1.'/LC_MESSAGES';
+
+ @tree=(
+ $bindir,
+ $contrib1,
+ $contrib,
+ $contribX,
+ $contribTg,
+ $info,
+ $share1,
+ $share,
+ $manifest,
+ $Locale2,
+ $spLocale1,
+ $spLocale,
+ $deLocale1,
+ $deLocale);
+ }
+else
+ {
+ # Distribution directories
+ $distPrefix=$prefix.'/distrib';
+ $bindir =$distPrefix.'/bin';
+ $contrib1 =$distPrefix.'/contrib';
+ $contrib =$contrib1.'/setedit.bin';
+ $contribX =$contrib.'/examples';
+ $contribTg =$contrib.'/tag_imgs';
+ $info =$distPrefix.'/info';
+ $share1 =$distPrefix.'/share';
+ $share =$share1.'/setedit';
+ $manifest =$distPrefix.'/manifest';
+ $Locale2 =$share1.'/locale';
+ $spLocale1 =$Locale2.'/es';
+ $spLocale =$spLocale1.'/LC_MESSAGES';
+ $deLocale1 =$Locale2.'/de';
+ $deLocale =$deLocale1.'/LC_MESSAGES';
+ $result =$prefix.'/result';
+
+ @tree=(
+ $distPrefix,
+ $bindir,
+ $contrib1,
+ $contrib,
+ $contribX,
+ $contribTg,
+ $info,
+ $share1,
+ $share,
+ $manifest,
+ $Locale2,
+ $spLocale1,
+ $spLocale,
+ $deLocale1,
+ $deLocale,
+ $result);
+ }
+
+foreach $i (@tree)
+ {
+ if (!(-d $i))
+ {
+ mkdir($i,00755);
+ print "$i\n";
+ }
+ }
+print "done.\n\n";
+
+
+print "Copying the exe: ";
+$d=$bindir.'/setedit.exe';
+$o='../editor.exe';
+$binManifest.=$d."\n";
+if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o .");
+ if ($Strip)
+ {
+ system("zip -9u $result/setedit-$version-DOS-debug.zip editor.exe") unless($iMode);
+ system('strip editor.exe');
+ # I could use --best but is slooooowwwwwwwww and doesn't compress much in
+ # the case of the editor.
+ system('upx -9 editor.exe') unless $iCompressExe==0;
+ }
+ system("mv editor.exe $d");
+ }
+print "done.\n\n";
+
+
+print "Copying the batch: ";
+$d=$bindir.'/e.bat';
+$o='../../distrib/arranca.bat';
+CopyIf($o,$d,$binManifest);
+print "done.\n\n";
+
+
+print "Copying share files: ";
+@cfgs=('../../cfgfiles/*.pmc','../../cfgfiles/*.shl','../../cfgfiles/*.tip',
+ '../../fonts/*.sft','../../sdg/txhgen-i.*','../../sdg/*.frt',
+ '../../cfgfiles/*.smn','../../cfgfiles/simple.dst',
+ '../../cfgfiles/*.slp','../../scrnsave/plasma1/ps1.exe',
+ '../../scrnsave/plasma2/ps2.exe','../../scrnsave/plasma3/ps3.exe',
+ '../../scrnsave/plasma4/ps4.exe','../../scrnsave/extrscsv.txt',
+ '../../cfgfiles/*.cle');
+foreach $i (@cfgs)
+ {
+ @a=glob($i);
+ foreach $o (@a)
+ {
+ $o =~ /.*\/(.*)/;
+ $d = $share.'/'.$1;
+ print $1.' ' if (CopyIf($o,$d,$binManifest));
+ }
+ }
+print "done.\n\n";
+
+
+print "Copying doc files: ";
+chdir('../../doc');
+if (system('make txt info man')==0)
+ {
+ CopyIf('editor.inf',$info.'/setedit.inf',$binManifest);
+ CopyIf('sdg.inf',$info.'/sdg.inf',$binManifest);
+ CopyIf('infeng.inf',$info.'/infview.inf',$binManifest);
+ CopyIf('setedit.1',$info.'/setedit.1',$binManifest);
+ CopyIf('editor.txt',$contrib.'/setedit.txt',$binManifest);
+ CopyIf('sdg.txt',$contrib.'/sdg.txt',$binManifest);
+ CopyIf('infeng.txt',$contrib.'/infview.txt',$binManifest);
+ }
+else
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "Failed to generate the docs ... Skipping the documentation,\n";
+ print "you can create it latter, now press ENTER or ^C to stop\n";
+ <STDIN>;
+ }
+chdir('../makes/djgpp');
+CopyIfRpl('../../distrib/distrib1.txt',$contrib.'/readme.1st',$binManifest);
+print "done.\n\n";
+
+
+print "Copying other files: ";
+print 'example.zip ' if (CopyIf('../../distrib/example.zip',$contrib.'/example.zip',$binManifest));
+print 'kexpand.zip ' if (CopyIf('../../distrib/kextend.zip',$contrib.'/kextend.zip',$binManifest));
+print 'calltpc7.zip ' if (CopyIf('../../distrib/calltpc7.zip',$contrib.'/calltpc7.zip',$binManifest));
+print 'change.log ' if (CopyIf('../../change.log',$contrib.'/change.log',$binManifest));
+print 'copyrigh ' if (CopyIf('../../copyrigh',$contrib.'/copyrigh',$binManifest));
+print 'copying.dj ' if (CopyIf('../../copying.dj',$contrib.'/copying.dj',$binManifest));
+print 'copying.gpl ' if (CopyIf('../../copying.gpl',$contrib.'/copying.gpl',$binManifest));
+print 'copying.lgp ' if (CopyIf('../../copying.lgp',$contrib.'/copying.lgp',$binManifest));
+print 'copying.rh ' if (CopyIf('../../copying.rh',$contrib.'/copying.rh',$binManifest));
+print 'windos.faq ' if (CopyIf('../../windos.faq',$contrib.'/readme.faq',$binManifest));
+print 'setedit.pif ' if (CopyIf('../../distrib/setedit.pif',$bindir.'/setedit.pif',$binManifest));
+print 'Spanish messages ' if (CopyIf('../../internac/es.mo',$spLocale.'/setedit.mo',$binManifest));
+print 'German messages ' if (CopyIf('../../internac/de.mo',$deLocale.'/setedit.mo',$binManifest));
+$a= CopyIf('../../distrib/examples/tvrc',$contribX.'/tvrc',$binManifest);
+$a|=CopyIf('../../distrib/examples/examp1.epr',$contribX.'/examp1.epr',$binManifest);
+$a|=CopyIf('../../distrib/examples/examp1.dst',$contribX.'/examp1.dst',$binManifest);
+$a|=CopyIf('../../distrib/examples/test1.cc',$contribX.'/test1.cc',$binManifest);
+print 'Examples ' if ($a);
+$a= CopyIf('../../www-site/tags.html',$contrib.'/tags.html',$binManifest);
+$a|=CopyIf('../../www-site/my_file1.html',$contrib.'/my_file1.html',$binManifest);
+$a|=CopyIf('../../www-site/my_file2.html',$contrib.'/my_file2.html',$binManifest);
+$a|=CopyIf('../../www-site/my_file3.html',$contrib.'/my_file3.html',$binManifest);
+$a|=CopyIf('../../www-site/examples.css',$contrib.'/examples.css',$binManifest);
+print 'Tags tutorial ' if ($a);
+@a=glob('../../www-site/tag_imgs/*.png');
+foreach $o (@a)
+ {
+ $o =~ /.*\/(.*)/;
+ $d = $contribTg.'/'.$1;
+ CopyIf($o,$d,$binManifest);
+ }
+print "done.\n\n";
+
+
+print "Generating manifest and version files: \n";
+$d="$manifest/edi$version1"."b.ver";
+unlink glob("$manifest/edi*b.ver") unless $iMode;
+open(FIL,">$d") || die "Can't create version file";
+print FIL ("edi".$version1."b SET's editor v$version for DJGPP");
+close(FIL);
+$binManifest.="$d\n";
+$d="$share/version.txt";
+open(FIL,">$d") || die "Can't create version.txt";
+print FIL ("$version\n$version1\n");
+close(FIL);
+$binManifest.="$d\n";
+$d="$manifest/edi$version1"."b.mft";
+$binManifest.="$d\n";
+if ($iMode)
+ {
+ $prefix.='/';
+ $binManifest =~ s/$prefix//g;
+ }
+else
+ {
+ $i="$distPrefix/";
+ $binManifest =~ s/$i//g;
+ unlink glob("$manifest/edi*b.mft");
+ }
+open(FIL,">$d");
+print FIL ($binManifest);
+close(FIL);
+print "done.\n\n";
+
+
+if ($iMode)
+ {
+ print "End of installation\n";
+ }
+else
+ {
+ print "Compressing the files: ";
+ $i=Pwd();
+ chdir($distPrefix);
+ system("zip -9ru $result/edi".$version1."b.zip *");
+ chdir($i);
+ print "done.\n\n";
+
+
+ CopyIfRpl('../../distrib/distrib1.txt',"$result/readme.1st");
+ CopyIfRpl('../../distrib/distrib2.txt',"$result/announce.txt");
+
+ GenerateSourceDistro();
+
+ #############################
+ # Change.log in HTML format #
+ #############################
+
+ $a=cat('../../change.log');
+ # Line separators
+ $a =~ s/\n(-)+\n/<hr>/mg;
+ # Lines between text are paragraphs
+ $a =~ s/\n\n/<p>\n/mg;
+ $a =~ s/\n\.\n/<p>\n/mg;
+ # Convert * to list items
+ $a =~ s/\n\*/<br>\n<li>/mg;
+ # If any survives
+ $a =~ s/\n-/<br>-/mg;
+ $a =~ s/-\n/-<br>/mg;
+ # Beautyful ;-)
+ $a =~ s/Revision/<b>Revision<\/b>/mg;
+ $a =~ s/\$\n/\$<br>/mg;
+
+ open(FIL,">$result/change.html") || die 'Can not create changelog';
+ print FIL ('<HTML><Title>change.log for setedit</Title><Body>');
+ print FIL ($a);
+ print FIL ('<p>Converted to HTML by a simple Perl script &copy; by SET</Body></HTML>');
+ close(FIL);
+
+ ToHTML("$result/readme.1st","$result/readme.html",'readme.1st');
+ ToHTML("$result/announce.txt","$result/announce.html",'announce');
+ }
+0;
+
+sub ToHTML
+{
+ my $a;
+
+ $a=cat($_[0]);
+ $a=~s/</&lt;/g;
+ $a=~s/>/&gt;/g;
+ open(FIL,">$_[1]") || die "Can't create readme $_[1]";
+ print FIL ("<HTML><Title>$_[2] for setedit</Title><Body><Pre>");
+ print FIL ($a);
+ print FIL ('</Pre></Body></HTML>');
+ close(FIL);
+}
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+
+sub replace
+{
+ my $b=$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
+
+
+sub CopyIf
+{
+ my ($o,$d)=@_;
+ my $list=\$_[2];
+
+ $$list.=$d."\n";
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o $d");
+ return 1;
+ }
+ 0;
+}
+
+
+sub CopyIfRpl
+{
+ my ($o,$d)=@_;
+ my $a;
+ my $list=\$_[2];
+
+ $$list.=$d."\n";
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ $a=cat($o);
+ $a =~ s/\@\@v\@\@/$version/g;
+ $a =~ s/\@\@v1\@\@/$version1/g;
+ $a =~ s/\@\@relname\@\@/$relname/g;
+ $a =~ s/\@\@rev\@\@/$revision/g;
+ replace($d,$a);
+ return 1;
+ }
+ 0;
+}
+
+sub Pwd
+{
+ my $pwd;
+ $pwd=`pwd`;
+ $pwd=`sh pwd` unless $pwd;
+ chop($pwd);
+ return $pwd;
+}
+
+sub GenerateSourceDistro
+{
+ print "\n\nCreating source distribution\n";
+ $srcmft="manifest/edi$version1".'s.mft';
+ $srcver="manifest/edi$version1".'s.ver';
+
+ chdir('../../../..');
+
+ open(FIL,'contrib/setedit/makes/lista');
+ @files=<FIL>;
+ close(FIL);
+ $r='';
+ foreach $i (@files)
+ {
+ $a=substr($i,0,1);
+ if (($a eq '-') or ($a eq '+') or ($a eq '*'))
+ {
+ $i=substr($i,1);
+ }
+ $r.='contrib/setedit/'.$i;
+ }
+ open(FIL,'contrib/setedit/makes/listaxtr');
+ @files=<FIL>;
+ close(FIL);
+ foreach $i (@files)
+ {
+ chop($i);
+ $r.=join("\r",glob('contrib/setedit/'.$i))."\r";
+ }
+ $r.="$srcmft\n$srcver\n";
+ replace($srcmft,$r);
+ replace($srcver,"edi".$version1."s SET's editor v$version for DJGPP");
+
+
+ # Generate the zip files
+ $srcdist="edi$version1".'s.zip';
+ unlink($srcdist);
+ system("zip -9u $result/$srcdist \@$srcmft");
+
+ chdir('contrib/setedit/makes/djgpp');
+}
+
diff --git a/setedit/makes/djgppenv.env b/setedit/makes/djgppenv.env
new file mode 100644
index 0000000..4dfbcfe
--- /dev/null
+++ b/setedit/makes/djgppenv.env
@@ -0,0 +1,39 @@
+#
+# This include file have common options for all the subprojects.
+#
+
+#
+# Common Warning and debug options, change it if you don't want debug
+# information or your compiler emmits too much warnings with -Wall.
+#
+RHIDE_OS_BOTH=-Wall -Werror -gstabs+3 -O2
+RHIDE_OS_CFLAGS=$(RHIDE_OS_BOTH)
+RHIDE_OS_CXXFLAGS=$(RHIDE_OS_BOTH) -fno-exceptions -fno-rtti
+#
+# It indicates where are located the system includes so they aren't included
+# in the dependencies.
+#
+RHIDE_STDINC=$(DJDIR)/include $(DJDIR)/lang/cxx $(DJDIR)/lib/gcc-lib
+#
+# These are OS dependent libraries.
+#
+RHIDE_OS_LIBS=amp alleg intl
+#
+# These are the paths libraries that are OS dependent (the paths no the libs).
+#
+RHIDE_OS_LIBS_PATH=../../tvision/djgpp djgpp
+#
+# Location for the Turbo Vision includes
+#
+TVISION_INC=../../tvision/include
+#
+# Location for the support libraries, if you have them installed (PCRE and
+# libz) you could want to use the installed ones. In this case you should
+# remove djgpp from RHIDE_OS_LIBS_PATH and assign nothing to SUPPORT_INC.
+#
+SUPPORT_INC=../support
+#
+# That's needed because RHIDE uses a wrong order and then -static doesn't
+# affect all the libraries.
+#
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
diff --git a/setedit/makes/easydiag.gpr b/setedit/makes/easydiag.gpr
new file mode 100644
index 0000000..5ad9c43
--- /dev/null
+++ b/setedit/makes/easydiag.gpr
Binary files differ
diff --git a/setedit/makes/easydiag.imk b/setedit/makes/easydiag.imk
new file mode 100644
index 0000000..558e3bd
--- /dev/null
+++ b/setedit/makes/easydiag.imk
@@ -0,0 +1,1072 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+libeasyd$(ExLIB):: \
+ obj/lablchek$(ExOBJ) \
+ obj/lablradi$(ExOBJ) \
+ obj/snostate$(ExOBJ) \
+ obj/tcheck2$(ExOBJ) \
+ obj/tmiclust$(ExOBJ) \
+ obj/tsbutton$(ExOBJ) \
+ obj/tschkarr$(ExOBJ) \
+ obj/tschkbox$(ExOBJ) \
+ obj/tshscrol$(ExOBJ) \
+ obj/tshzgrp$(ExOBJ) \
+ obj/tsinplin$(ExOBJ) \
+ obj/tsinplpi$(ExOBJ) \
+ obj/tslabel$(ExOBJ) \
+ obj/tslider$(ExOBJ) \
+ obj/tslistbo$(ExOBJ) \
+ obj/tsradbot$(ExOBJ) \
+ obj/tssortlb$(ExOBJ) \
+ obj/tssosslb$(ExOBJ) \
+ obj/tstatext$(ExOBJ) \
+ obj/tstextsc$(ExOBJ) \
+ obj/tstsorlb$(ExOBJ) \
+ obj/tsvegrp$(ExOBJ) \
+ obj/tsview$(ExOBJ) \
+ obj/tsviewco$(ExOBJ) \
+ obj/ttextscr$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/lablchek$(ExOBJ):: ../easydiag/lablchek.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tschkbox.h \
+ tslabel.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/lablradi$(ExOBJ):: ../easydiag/lablradi.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tslabel.h \
+ tsradbot.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/snostate$(ExOBJ):: ../easydiag/snostate.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ nostatex.h \
+ settvuti.h \
+ snostate.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tcheck2$(ExOBJ):: ../easydiag/tcheck2.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tcheck2.h \
+ tmiclust.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tmiclust$(ExOBJ):: ../easydiag/tmiclust.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tmiclust.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsbutton$(ExOBJ):: ../easydiag/tsbutton.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tschkarr$(ExOBJ):: ../easydiag/tschkarr.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tcheck2.h \
+ tmiclust.h \
+ tschkarr.h \
+ tsview.h \
+ tv.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tschkbox$(ExOBJ):: ../easydiag/tschkbox.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tschkbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tshscrol$(ExOBJ):: ../easydiag/tshscrol.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tshscrol.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tshzgrp$(ExOBJ):: ../easydiag/tshzgrp.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tshzgrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsinplin$(ExOBJ):: ../easydiag/tsinplin.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tsinplin.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsinplpi$(ExOBJ):: ../easydiag/tsinplpi.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ settvuti.h \
+ tinppipe.h \
+ tsinplpi.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tslabel$(ExOBJ):: ../easydiag/tslabel.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tslabel.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tslider$(ExOBJ):: ../easydiag/tslider.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tslider.h \
+ tsview.h \
+ tv.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tslistbo$(ExOBJ):: ../easydiag/tslistbo.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tslistbo.h \
+ tssortva.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsradbot$(ExOBJ):: ../easydiag/tsradbot.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tsradbot.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tssortlb$(ExOBJ):: ../easydiag/tssortlb.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tssosslb$(ExOBJ):: ../easydiag/tssosslb.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tslistbo.h \
+ tssortva.h \
+ tssosslb.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatext$(ExOBJ):: ../easydiag/tstatext.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tstatext.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstextsc$(ExOBJ):: ../easydiag/tstextsc.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tstextsc.h \
+ tsview.h \
+ tsviewco.h \
+ ttextscr.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstsorlb$(ExOBJ):: ../easydiag/tstsorlb.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ settvuti.h \
+ tslistbo.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsvegrp$(ExOBJ):: ../easydiag/tsvegrp.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsview$(ExOBJ):: ../easydiag/tsview.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tsview.h \
+ tv.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsviewco$(ExOBJ):: ../easydiag/tsviewco.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ttextscr$(ExOBJ):: ../easydiag/ttextscr.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ ttextscr.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/easydiag.umk b/setedit/makes/easydiag.umk
new file mode 100644
index 0000000..6e49301
--- /dev/null
+++ b/setedit/makes/easydiag.umk
@@ -0,0 +1,108 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+libeasyd$(ExLIB):: \
+ obj/lablchek$(ExOBJ) \
+ obj/lablradi$(ExOBJ) \
+ obj/snostate$(ExOBJ) \
+ obj/tcheck2$(ExOBJ) \
+ obj/tmiclust$(ExOBJ) \
+ obj/tsbutton$(ExOBJ) \
+ obj/tschkarr$(ExOBJ) \
+ obj/tschkbox$(ExOBJ) \
+ obj/tshscrol$(ExOBJ) \
+ obj/tshzgrp$(ExOBJ) \
+ obj/tsinplin$(ExOBJ) \
+ obj/tsinplpi$(ExOBJ) \
+ obj/tslabel$(ExOBJ) \
+ obj/tslider$(ExOBJ) \
+ obj/tslistbo$(ExOBJ) \
+ obj/tsradbot$(ExOBJ) \
+ obj/tssortlb$(ExOBJ) \
+ obj/tssosslb$(ExOBJ) \
+ obj/tstatext$(ExOBJ) \
+ obj/tstextsc$(ExOBJ) \
+ obj/tstsorlb$(ExOBJ) \
+ obj/tsvegrp$(ExOBJ) \
+ obj/tsview$(ExOBJ) \
+ obj/tsviewco$(ExOBJ) \
+ obj/ttextscr$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/lablchek$(ExOBJ):: ../easydiag/lablchek.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/lablradi$(ExOBJ):: ../easydiag/lablradi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/snostate$(ExOBJ):: ../easydiag/snostate.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tcheck2$(ExOBJ):: ../easydiag/tcheck2.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tmiclust$(ExOBJ):: ../easydiag/tmiclust.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsbutton$(ExOBJ):: ../easydiag/tsbutton.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tschkarr$(ExOBJ):: ../easydiag/tschkarr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tschkbox$(ExOBJ):: ../easydiag/tschkbox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tshscrol$(ExOBJ):: ../easydiag/tshscrol.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tshzgrp$(ExOBJ):: ../easydiag/tshzgrp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsinplin$(ExOBJ):: ../easydiag/tsinplin.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsinplpi$(ExOBJ):: ../easydiag/tsinplpi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tslabel$(ExOBJ):: ../easydiag/tslabel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tslider$(ExOBJ):: ../easydiag/tslider.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tslistbo$(ExOBJ):: ../easydiag/tslistbo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsradbot$(ExOBJ):: ../easydiag/tsradbot.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tssortlb$(ExOBJ):: ../easydiag/tssortlb.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tssosslb$(ExOBJ):: ../easydiag/tssosslb.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstatext$(ExOBJ):: ../easydiag/tstatext.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstextsc$(ExOBJ):: ../easydiag/tstextsc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstsorlb$(ExOBJ):: ../easydiag/tstsorlb.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsvegrp$(ExOBJ):: ../easydiag/tsvegrp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsview$(ExOBJ):: ../easydiag/tsview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsviewco$(ExOBJ):: ../easydiag/tsviewco.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ttextscr$(ExOBJ):: ../easydiag/ttextscr.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/editor.bmk b/setedit/makes/editor.bmk
new file mode 100644
index 0000000..1fcbf28
--- /dev/null
+++ b/setedit/makes/editor.bmk
@@ -0,0 +1,76 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This is the Borland C++ makefile for the editor.
+# Also used by the MSVC makefile.
+#
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+SRCD1=../mainsrc;../names;../streams;../setedit;../setedit/names
+SRCD2=../setedit/streams;../infview;../sdg;../settvuti;../settvuti/names
+SRCD3=../settvuti/streams;../extra;../mp3;../calcu;../easydiag
+SRCD4=../infview/names;../infview/streams;../librhuti
+SRCDIRS=$(SRCD1);$(SRCD2);$(SRCD3);$(SRCD4)
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+SDG_INC_DIR=../sdg/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_INC_DIR=../mp3
+CALCU_INC_DIR=../calcu
+HOLIDAYS_DIR=../holidays
+MP3_PREV_DIR=..
+INCLUDE_DIRS=-I../winnt -I$(INCLUDE_DIR) -I$(SETEDIT_INC_DIR) \
+ -I$(SETTVUTI_INC_DIR) -I$(SDG_INC_DIR) -I$(INFVIEW_INC_DIR) \
+ $(TVISION_INC) -I$(EXTRA_INC_DIR) -I$(EASYDIAG_INC_DIR) \
+ -I$(LIBRHUTI_INC_DIR) -I$(MP3_INC_DIR) \
+ -I$(CALCU_INC_DIR) -I$(HOLIDAYS_DIR) -I..\libz -I..\libpcre -I..\libbzip2
+C_EXTRA_FLAGS=-DFOR_EDITOR
+RHIDE_LIBS=..\libz\zlib.lib ..\libpcre\pcre.lib ..\libbzip2\bzip2.lib \
+ $(TVLIBDIR)\librhtv.lib
+OBJ_DIR=obj
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+!ifndef MKF_EXT
+MKF_EXT=.bmk
+!endif
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+!include common$(MKF_EXT)
+
+all: $(HELPER_TARGET) editor.exe
+
+#
+# All the RHIDE data should come from here.
+#
+ExIMK=.umk
+!include editor$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+!include includer.bmk
+
+
diff --git a/setedit/makes/editor.gpr b/setedit/makes/editor.gpr
new file mode 100644
index 0000000..4ac3ca4
--- /dev/null
+++ b/setedit/makes/editor.gpr
Binary files differ
diff --git a/setedit/makes/editor.imk b/setedit/makes/editor.imk
new file mode 100644
index 0000000..a9156a4
--- /dev/null
+++ b/setedit/makes/editor.imk
@@ -0,0 +1,5750 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ obj/accehtml$(ExOBJ) \
+ obj/advice$(ExOBJ) \
+ obj/ampdiag$(ExOBJ) \
+ obj/intermp3$(ExOBJ) \
+ obj/mp3list$(ExOBJ) \
+ obj/mp3play$(ExOBJ) \
+ obj/ascii$(ExOBJ) \
+ obj/boardmix$(ExOBJ) \
+ obj/bufun$(ExOBJ) \
+ obj/calcu$(ExOBJ) \
+ obj/calendar$(ExOBJ) \
+ obj/ceditor$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/completi$(ExOBJ) \
+ obj/debug$(ExOBJ) \
+ obj/deedidia$(ExOBJ) \
+ obj/doedidia$(ExOBJ) \
+ obj/dskascii$(ExOBJ) \
+ obj/dskcalen$(ExOBJ) \
+ obj/dskclip$(ExOBJ) \
+ obj/dskclose$(ExOBJ) \
+ obj/dskedito$(ExOBJ) \
+ obj/dskhelp$(ExOBJ) \
+ obj/dskman$(ExOBJ) \
+ obj/dskmessa$(ExOBJ) \
+ obj/dskmp3$(ExOBJ) \
+ obj/dskwin$(ExOBJ) \
+ obj/dstfile$(ExOBJ) \
+ obj/dumpfile$(ExOBJ) \
+ obj/edcolor$(ExOBJ) \
+ obj/edconst$(ExOBJ) \
+ obj/edfonts$(ExOBJ) \
+ obj/editdiag$(ExOBJ) \
+ obj/editmain$(ExOBJ) \
+ obj/editmenu$(ExOBJ) \
+ obj/editorfo$(ExOBJ) \
+ obj/editpale$(ExOBJ) \
+ obj/editwind$(ExOBJ) \
+ obj/edkeys$(ExOBJ) \
+ obj/edmsg$(ExOBJ) \
+ obj/edprefs$(ExOBJ) \
+ obj/edprint$(ExOBJ) \
+ obj/edprj$(ExOBJ) \
+ obj/edspecs$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ obj/fstrcmp$(ExOBJ) \
+ obj/getctxhl$(ExOBJ) \
+ obj/gzfiles$(ExOBJ) \
+ obj/holidays$(ExOBJ) \
+ obj/inf$(ExOBJ) \
+ obj/infbase$(ExOBJ) \
+ obj/manview$(ExOBJ) \
+ obj/nhiscoll$(ExOBJ) \
+ obj/ninfview$(ExOBJ) \
+ obj/ninfwind$(ExOBJ) \
+ obj/nmanwind$(ExOBJ) \
+ obj/sinf$(ExOBJ) \
+ obj/sman$(ExOBJ) \
+ obj/intgrep$(ExOBJ) \
+ obj/keytrans$(ExOBJ) \
+ obj/linelen$(ExOBJ) \
+ obj/loadcle$(ExOBJ) \
+ obj/loaddefl$(ExOBJ) \
+ obj/loadfunc$(ExOBJ) \
+ obj/loadnobkp$(ExOBJ) \
+ obj/loadshl$(ExOBJ) \
+ obj/loadusew$(ExOBJ) \
+ obj/macrocom$(ExOBJ) \
+ obj/menuload$(ExOBJ) \
+ obj/mli$(ExOBJ) \
+ obj/mliasimp$(ExOBJ) \
+ obj/mlicsdg$(ExOBJ) \
+ obj/mliediti$(ExOBJ) \
+ obj/mliedito$(ExOBJ) \
+ obj/mlisdg$(ExOBJ) \
+ obj/msignal$(ExOBJ) \
+ obj/nceditor$(ExOBJ) \
+ obj/ndskwasc$(ExOBJ) \
+ obj/ndskwcal$(ExOBJ) \
+ obj/ndskwcli$(ExOBJ) \
+ obj/ndskwclo$(ExOBJ) \
+ obj/ndskwedi$(ExOBJ) \
+ obj/ndskwhel$(ExOBJ) \
+ obj/ndskwman$(ExOBJ) \
+ obj/ndskwmes$(ExOBJ) \
+ obj/ndskwmp3$(ExOBJ) \
+ obj/ndskwprj$(ExOBJ) \
+ obj/neditwin$(ExOBJ) \
+ obj/nfileedi$(ExOBJ) \
+ obj/nsindica$(ExOBJ) \
+ obj/ntedcol$(ExOBJ) \
+ obj/parser$(ExOBJ) \
+ obj/pathlist$(ExOBJ) \
+ obj/pathtool$(ExOBJ) \
+ obj/pclipper$(ExOBJ) \
+ obj/pmacros$(ExOBJ) \
+ obj/pperl$(ExOBJ) \
+ obj/pphp$(ExOBJ) \
+ obj/ppython$(ExOBJ) \
+ obj/pvarious$(ExOBJ) \
+ obj/pvhdl$(ExOBJ) \
+ obj/runprog$(ExOBJ) \
+ obj/sceditor$(ExOBJ) \
+ obj/scresave$(ExOBJ) \
+ obj/sdginter$(ExOBJ) \
+ obj/sdskasci$(ExOBJ) \
+ obj/sdskcale$(ExOBJ) \
+ obj/sdskclip$(ExOBJ) \
+ obj/sdskclos$(ExOBJ) \
+ obj/sdskedit$(ExOBJ) \
+ obj/sdskhelp$(ExOBJ) \
+ obj/sdskman$(ExOBJ) \
+ obj/sdskmess$(ExOBJ) \
+ obj/sdskmp3$(ExOBJ) \
+ obj/sdskprj$(ExOBJ) \
+ obj/search$(ExOBJ) \
+ obj/sedcolle$(ExOBJ) \
+ obj/slpinter$(ExOBJ) \
+ obj/splinman$(ExOBJ) \
+ obj/ssindica$(ExOBJ) \
+ obj/ssyntax$(ExOBJ) \
+ obj/tags$(ExOBJ) \
+ obj/tedcolle$(ExOBJ) \
+ obj/tips$(ExOBJ) \
+ obj/tpaltext$(ExOBJ) \
+ obj/tsindica$(ExOBJ) \
+ obj/txhgen$(ExOBJ) \
+ obj/winlistd$(ExOBJ)
+
+LIBRARIES=\
+ librhuti$(ExLIB) \
+ libsettv$(ExLIB) \
+ libeasyd$(ExLIB)
+
+editor$(ExEXE):: \
+ obj/accehtml$(ExOBJ) \
+ obj/advice$(ExOBJ) \
+ obj/ampdiag$(ExOBJ) \
+ obj/intermp3$(ExOBJ) \
+ obj/mp3list$(ExOBJ) \
+ obj/mp3play$(ExOBJ) \
+ obj/ascii$(ExOBJ) \
+ obj/boardmix$(ExOBJ) \
+ obj/bufun$(ExOBJ) \
+ obj/calcu$(ExOBJ) \
+ obj/calendar$(ExOBJ) \
+ obj/ceditor$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/completi$(ExOBJ) \
+ obj/debug$(ExOBJ) \
+ obj/deedidia$(ExOBJ) \
+ obj/doedidia$(ExOBJ) \
+ obj/dskascii$(ExOBJ) \
+ obj/dskcalen$(ExOBJ) \
+ obj/dskclip$(ExOBJ) \
+ obj/dskclose$(ExOBJ) \
+ obj/dskedito$(ExOBJ) \
+ obj/dskhelp$(ExOBJ) \
+ obj/dskman$(ExOBJ) \
+ obj/dskmessa$(ExOBJ) \
+ obj/dskmp3$(ExOBJ) \
+ obj/dskwin$(ExOBJ) \
+ obj/dstfile$(ExOBJ) \
+ obj/dumpfile$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ obj/edcolor$(ExOBJ) \
+ obj/edconst$(ExOBJ) \
+ obj/edfonts$(ExOBJ) \
+ obj/editdiag$(ExOBJ) \
+ obj/editmain$(ExOBJ) \
+ obj/editmenu$(ExOBJ) \
+ obj/editorfo$(ExOBJ) \
+ obj/editpale$(ExOBJ) \
+ obj/editwind$(ExOBJ) \
+ obj/edkeys$(ExOBJ) \
+ obj/edmsg$(ExOBJ) \
+ obj/edprefs$(ExOBJ) \
+ obj/edprint$(ExOBJ) \
+ obj/edprj$(ExOBJ) \
+ obj/edspecs$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ obj/fstrcmp$(ExOBJ) \
+ obj/getctxhl$(ExOBJ) \
+ obj/gzfiles$(ExOBJ) \
+ obj/holidays$(ExOBJ) \
+ obj/inf$(ExOBJ) \
+ obj/infbase$(ExOBJ) \
+ obj/manview$(ExOBJ) \
+ obj/nhiscoll$(ExOBJ) \
+ obj/ninfview$(ExOBJ) \
+ obj/ninfwind$(ExOBJ) \
+ obj/nmanwind$(ExOBJ) \
+ obj/sinf$(ExOBJ) \
+ obj/sman$(ExOBJ) \
+ obj/intgrep$(ExOBJ) \
+ obj/keytrans$(ExOBJ) \
+ librhuti$(ExLIB) \
+ obj/linelen$(ExOBJ) \
+ obj/loadcle$(ExOBJ) \
+ obj/loaddefl$(ExOBJ) \
+ obj/loadfunc$(ExOBJ) \
+ obj/loadnobkp$(ExOBJ) \
+ obj/loadshl$(ExOBJ) \
+ obj/loadusew$(ExOBJ) \
+ obj/macrocom$(ExOBJ) \
+ obj/menuload$(ExOBJ) \
+ obj/mli$(ExOBJ) \
+ obj/mliasimp$(ExOBJ) \
+ obj/mlicsdg$(ExOBJ) \
+ obj/mliediti$(ExOBJ) \
+ obj/mliedito$(ExOBJ) \
+ obj/mlisdg$(ExOBJ) \
+ obj/msignal$(ExOBJ) \
+ obj/nceditor$(ExOBJ) \
+ obj/ndskwasc$(ExOBJ) \
+ obj/ndskwcal$(ExOBJ) \
+ obj/ndskwcli$(ExOBJ) \
+ obj/ndskwclo$(ExOBJ) \
+ obj/ndskwedi$(ExOBJ) \
+ obj/ndskwhel$(ExOBJ) \
+ obj/ndskwman$(ExOBJ) \
+ obj/ndskwmes$(ExOBJ) \
+ obj/ndskwmp3$(ExOBJ) \
+ obj/ndskwprj$(ExOBJ) \
+ obj/neditwin$(ExOBJ) \
+ obj/nfileedi$(ExOBJ) \
+ obj/nsindica$(ExOBJ) \
+ obj/ntedcol$(ExOBJ) \
+ obj/parser$(ExOBJ) \
+ obj/pathlist$(ExOBJ) \
+ obj/pathtool$(ExOBJ) \
+ obj/pclipper$(ExOBJ) \
+ obj/pmacros$(ExOBJ) \
+ obj/pperl$(ExOBJ) \
+ obj/pphp$(ExOBJ) \
+ obj/ppython$(ExOBJ) \
+ obj/pvarious$(ExOBJ) \
+ obj/pvhdl$(ExOBJ) \
+ obj/runprog$(ExOBJ) \
+ obj/sceditor$(ExOBJ) \
+ obj/scresave$(ExOBJ) \
+ obj/sdginter$(ExOBJ) \
+ obj/sdskasci$(ExOBJ) \
+ obj/sdskcale$(ExOBJ) \
+ obj/sdskclip$(ExOBJ) \
+ obj/sdskclos$(ExOBJ) \
+ obj/sdskedit$(ExOBJ) \
+ obj/sdskhelp$(ExOBJ) \
+ obj/sdskman$(ExOBJ) \
+ obj/sdskmess$(ExOBJ) \
+ obj/sdskmp3$(ExOBJ) \
+ obj/sdskprj$(ExOBJ) \
+ obj/search$(ExOBJ) \
+ obj/sedcolle$(ExOBJ) \
+ libsettv$(ExLIB) \
+ obj/slpinter$(ExOBJ) \
+ obj/splinman$(ExOBJ) \
+ obj/ssindica$(ExOBJ) \
+ obj/ssyntax$(ExOBJ) \
+ obj/tags$(ExOBJ) \
+ obj/tedcolle$(ExOBJ) \
+ obj/tips$(ExOBJ) \
+ obj/tpaltext$(ExOBJ) \
+ obj/tsindica$(ExOBJ) \
+ obj/txhgen$(ExOBJ) \
+ obj/winlistd$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+obj/accehtml$(ExOBJ):: ../mainsrc/accehtml.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/ssc_streams.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ ucdefs.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/advice$(ExOBJ):: ../setedit/advice.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ edspecs.h \
+ setapp.h \
+ settvuti.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortva.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=amp3$(ExIMK)
+
+obj/ascii$(ExOBJ):: ../setedit/ascii.cc \
+ ascii.h \
+ compatlayer.h \
+ dskwin.h \
+ setapp.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/boardmix$(ExOBJ):: ../setedit/boardmix.cc \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ mixer.h \
+ setapp.h \
+ tsbutton.h \
+ tschkbox.h \
+ tslider.h \
+ tstatext.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/bufun$(ExOBJ):: ../mainsrc/bufun.cc \
+ bufun.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edmsg.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ splinman.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortva.h \
+ tssosslb.h \
+ tstatext.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/calcu$(ExOBJ):: ../calcu/calcu.cc \
+ calcu.h \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ edhists.h \
+ editcoma.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tinppipe.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/calendar$(ExOBJ):: ../setedit/calendar.cc \
+ calendar.h \
+ compatlayer.h \
+ datetools.h \
+ editcoma.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ceditor$(ExOBJ):: ../mainsrc/ceditor.cc \
+ advice.h \
+ bufun.h \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ edhists.h \
+ gzfiles.h \
+ keytrans.h \
+ loadkbin.h \
+ loadshl.h \
+ pathtool.h \
+ pmcoll.h \
+ rhutils.h \
+ sarray.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ slpinter.h \
+ splinman.h \
+ tnocastc.h \
+ tprogdia.h \
+ tstringa.h \
+ tstrlbox.h \
+ tv.h \
+ tv/app.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/colorsel.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/findrepl.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/lstviewr.h \
+ tv/menubox.h \
+ tv/menuitem.h \
+ tv/menus.h \
+ tv/menuview.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/submenu.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/codepage$(ExOBJ):: ../setedit/codepage.cc \
+ calendar.h \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ mp3play.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tprogdia.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fontcoll.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/completi$(ExOBJ):: ../mainsrc/completi.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ completi.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/debug$(ExOBJ):: ../setedit/debug.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ debug.h \
+ dskwin.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ editcoma.h \
+ edmsg.h \
+ nostatex.h \
+ pathlist.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ splinman.h \
+ tinppipe.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tsinplpi.h \
+ tslabel.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/deedidia$(ExOBJ):: ../mainsrc/deedidia.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ editcoma.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tinppipe.h \
+ tnocastc.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tsinplpi.h \
+ tslabel.h \
+ tslistbo.h \
+ tsradbot.h \
+ tssortlb.h \
+ tssortva.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/doedidia$(ExOBJ):: ../mainsrc/doedidia.cc \
+ bufun.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/app.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskascii$(ExOBJ):: ../setedit/dskascii.cc \
+ ascii.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskascii.h \
+ dskwin.h \
+ setapp.h \
+ settvuti.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskcalen$(ExOBJ):: ../setedit/dskcalen.cc \
+ calendar.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskcalen.h \
+ dskwin.h \
+ setapp.h \
+ settvuti.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskclip$(ExOBJ):: ../setedit/dskclip.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskclip.h \
+ dskwin.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskclose$(ExOBJ):: ../setedit/dskclose.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskclose.h \
+ dskwin.h \
+ edcollec.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskedito$(ExOBJ):: ../setedit/dskedito.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskedito.h \
+ dskwin.h \
+ edcollec.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskhelp$(ExOBJ):: ../setedit/dskhelp.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskhelp.h \
+ dskwin.h \
+ edcollec.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskman$(ExOBJ):: ../setedit/dskman.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ dskman.h \
+ dskwin.h \
+ manview.h \
+ rhutils.h \
+ setapp.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskmessa$(ExOBJ):: ../setedit/dskmessa.cc \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskmessa.h \
+ dskwin.h \
+ edmsg.h \
+ setapp.h \
+ settvuti.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/screen.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskmp3$(ExOBJ):: ../setedit/dskmp3.cc \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskmp3.h \
+ dskwin.h \
+ intermp3.h \
+ mixer.h \
+ setapp.h \
+ settvuti.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dskwin$(ExOBJ):: ../setedit/dskwin.cc \
+ ceditor.h \
+ compatlayer.h \
+ dskwin.h \
+ setapp.h \
+ settvuti.h \
+ tv.h \
+ tv/app.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dstfile$(ExOBJ):: ../setedit/dstfile.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ configed.h \
+ dktclock.h \
+ dskclip.h \
+ dskhelp.h \
+ dskwin.h \
+ edcollec.h \
+ edhists.h \
+ edmsg.h \
+ edprint.h \
+ edspecs.h \
+ fileopen.h \
+ fiopeaid.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ mixer.h \
+ pathlist.h \
+ pathtool.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ ssyntax.h \
+ tags.h \
+ tnocastc.h \
+ tpaltext.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configfile.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filecoll.h \
+ tv/fontcoll.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/searchrc.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dumpfile$(ExOBJ):: ../mainsrc/dumpfile.cc \
+ compatlayer.h \
+ edmsg.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE01=easydiag$(ExIMK)
+
+obj/edcolor$(ExOBJ):: ../setedit/edcolor.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ diaghelp.h \
+ easydia1.h \
+ easydiag.h \
+ pal.h \
+ palbcc.h \
+ palconv.h \
+ paldjd.h \
+ palfte.h \
+ palmc.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tsbutton.h \
+ tslistbo.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/clrdlg.h \
+ tv/clrgroup.h \
+ tv/clritem.h \
+ tv/collectn.h \
+ tv/colorsel.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edconst$(ExOBJ):: ../mainsrc/edconst.cc \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskwin.h \
+ editcoma.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tinppipe.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edfonts$(ExOBJ):: ../setedit/edfonts.cc \
+ compatlayer.h \
+ setapp.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fontcoll.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/editdiag$(ExOBJ):: ../setedit/editdiag.cc \
+ advice.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edspecs.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tsbutton.h \
+ tschkbox.h \
+ tstatext.h \
+ tstextsc.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ ttextscr.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ vername.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/editmain$(ExOBJ):: ../setedit/editmain.cc \
+ advice.h \
+ bufun.h \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ datetools.h \
+ debug.h \
+ diaghelp.h \
+ dktclock.h \
+ dskclose.h \
+ dskedito.h \
+ dskhelp.h \
+ dskman.h \
+ dskwin.h \
+ edcollec.h \
+ edhists.h \
+ edmsg.h \
+ edprint.h \
+ edspecs.h \
+ fileopen.h \
+ fiopeaid.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ intermp3.h \
+ loadcle.h \
+ loadkbin.h \
+ loadnobkp.h \
+ loadshl.h \
+ mixer.h \
+ pal.h \
+ pathlist.h \
+ pathtool.h \
+ pmcoll.h \
+ rhutils.h \
+ runprog.h \
+ sarray.h \
+ sdginter.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ splinman.h \
+ ssyntax.h \
+ stackdbg.h \
+ tags.h \
+ tnocastc.h \
+ tnosostr.h \
+ tpaltext.h \
+ tprogdia.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/calc.h \
+ tv/chdirdlg.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configfile.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filecoll.h \
+ tv/filedlg.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menubar.h \
+ tv/menuitem.h \
+ tv/menus.h \
+ tv/menuview.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/searchrc.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/submenu.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/editmenu$(ExOBJ):: ../setedit/editmenu.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ editcoma.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tinppipe.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menubar.h \
+ tv/menuitem.h \
+ tv/menus.h \
+ tv/menuview.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/statsdef.h \
+ tv/statsitm.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/submenu.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/editorfo$(ExOBJ):: ../mainsrc/editorfo.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/editpale$(ExOBJ):: ../setedit/editpale.cc \
+ compatlayer.h \
+ configed.h \
+ setapp.h \
+ tpaltext.h \
+ tv.h \
+ tv/button.h \
+ tv/clrselct.h \
+ tv/cluster.h \
+ tv/colorsel.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/editwind$(ExOBJ):: ../mainsrc/editwind.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edkeys$(ExOBJ):: ../setedit/edkeys.cc \
+ ced_coma.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ editcoma.h \
+ edmsg.h \
+ inputsca.h \
+ keytrans.h \
+ loadkbin.h \
+ mli.h \
+ mlieditd.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/cluster.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edmsg$(ExOBJ):: ../setedit/edmsg.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ configed.h \
+ dskmessa.h \
+ dskwin.h \
+ edhists.h \
+ editcoma.h \
+ edmsg.h \
+ fileopen.h \
+ fiopeaid.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ splinman.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edprefs$(ExOBJ):: ../setedit/edprefs.cc \
+ advice.h \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ diaghelp.h \
+ dktclock.h \
+ easydia1.h \
+ easydiag.h \
+ edcollec.h \
+ edmsg.h \
+ edspecs.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tsradbot.h \
+ tssortlb.h \
+ tssortva.h \
+ tstatext.h \
+ tstringa.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filecoll.h \
+ tv/fontcoll.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/searchrc.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edprint$(ExOBJ):: ../setedit/edprint.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edmsg.h \
+ setapp.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tsradbot.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edprj$(ExOBJ):: ../setedit/edprj.cc \
+ advice.h \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ configed.h \
+ debug.h \
+ dskprj.h \
+ dskwin.h \
+ edcollec.h \
+ edhists.h \
+ editcoma.h \
+ edspecs.h \
+ fileopen.h \
+ fiopeaid.h \
+ pathtool.h \
+ pmcoll.h \
+ rhutils.h \
+ sarray.h \
+ sdginter.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tags.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filecoll.h \
+ tv/filedlg.h \
+ tv/filelist.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/searchrc.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/edspecs$(ExOBJ):: ../mainsrc/edspecs.cc \
+ ced_inte.h \
+ compatlayer.h \
+ edspecs.h \
+ pathtool.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE02=extra$(ExIMK)
+
+obj/fstrcmp$(ExOBJ):: ../mainsrc/fstrcmp.c \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/getctxhl$(ExOBJ):: ../setedit/getctxhl.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskhelp.h \
+ dskwin.h \
+ editcoma.h \
+ fileopen.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/gzfiles$(ExOBJ):: ../mainsrc/gzfiles.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ gzfiles.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/holidays$(ExOBJ):: ../setedit/holidays.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ datetools.h \
+ easydia1.h \
+ easydiag.h \
+ editcoma.h \
+ edspecs.h \
+ setapp.h \
+ tsbutton.h \
+ tslabel.h \
+ tsradbot.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE03=inffd$(ExIMK)
+
+obj/intgrep$(ExOBJ):: ../setedit/intgrep.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ edhists.h \
+ edmsg.h \
+ pathtool.h \
+ pmcoll.h \
+ rhutils.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ splinman.h \
+ tinppipe.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/keytrans$(ExOBJ):: ../mainsrc/keytrans.cc \
+ ced_coma.h \
+ ced_exte.h \
+ ceditor.h \
+ compatlayer.h \
+ dyncat.h \
+ keytrans.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/event.h \
+ tv/gkey.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE04=librhuti$(ExIMK)
+
+obj/linelen$(ExOBJ):: ../mainsrc/linelen.cc \
+ ced_clas.h \
+ ceditor.h \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/loadcle$(ExOBJ):: ../setedit/loadcle.cc \
+ ced_pcre.h \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ loadcle.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/loaddefl$(ExOBJ):: ../mainsrc/loaddefl.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ loadshl.h \
+ pathtool.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/loadfunc$(ExOBJ):: ../mainsrc/loadfunc.cc \
+ compatlayer.h \
+ pathtool.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/loadnobkp$(ExOBJ):: ../setedit/loadnobkp.cc \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ loadnobkp.h \
+ loadshl.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/loadshl$(ExOBJ):: ../mainsrc/loadshl.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ loadshl.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/loadusew$(ExOBJ):: ../mainsrc/loadusew.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ loadshl.h \
+ pathtool.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/macrocom$(ExOBJ):: ../mainsrc/macrocom.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ slpinter.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/menuload$(ExOBJ):: ../setedit/menuload.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ keytrans.h \
+ mli.h \
+ mlieditd.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/menu.h \
+ tv/menubar.h \
+ tv/menuitem.h \
+ tv/menus.h \
+ tv/menuview.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/statsdef.h \
+ tv/statsitm.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/submenu.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mli$(ExOBJ):: ../sdg/mli.cc \
+ ced_pcre.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ loadshl.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlivar.h \
+ pathtool.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mliasimp$(ExOBJ):: ../sdg/mliasimp.cc \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlivar.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mlicsdg$(ExOBJ):: ../sdg/mlicsdg.cc \
+ compatlayer.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlicsdg.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ ucdefs.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mliediti$(ExOBJ):: ../sdg/mliediti.cc \
+ compatlayer.h \
+ edmsg.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlieditd.h \
+ mliedito.h \
+ mlivar.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mliedito$(ExOBJ):: ../sdg/mliedito.cc \
+ ced_coma.h \
+ ceditor.h \
+ compatlayer.h \
+ dyncat.h \
+ edmsg.h \
+ keytrans.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlieditd.h \
+ mliedito.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ rhutils.h \
+ runprog.h \
+ settvuti.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mlisdg$(ExOBJ):: ../sdg/mlisdg.cc \
+ compatlayer.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlicsdg.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/msignal$(ExOBJ):: ../setedit/msignal.cc \
+ ced_inte.h \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ stackdbg.h \
+ tv.h \
+ tv/configtv.h \
+ tv/event.h \
+ tv/eventqu.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/screen.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nceditor$(ExOBJ):: ../names/nceditor.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwasc$(ExOBJ):: ../names/ndskwasc.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwcal$(ExOBJ):: ../names/ndskwcal.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwcli$(ExOBJ):: ../names/ndskwcli.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwclo$(ExOBJ):: ../names/ndskwclo.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwedi$(ExOBJ):: ../names/ndskwedi.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwhel$(ExOBJ):: ../names/ndskwhel.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwman$(ExOBJ):: ../names/ndskwman.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwmes$(ExOBJ):: ../names/ndskwmes.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwmp3$(ExOBJ):: ../names/ndskwmp3.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwprj$(ExOBJ):: ../names/ndskwprj.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/neditwin$(ExOBJ):: ../names/neditwin.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nfileedi$(ExOBJ):: ../names/nfileedi.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nsindica$(ExOBJ):: ../names/nsindica.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ntedcol$(ExOBJ):: ../names/ntedcol.cc \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/parser$(ExOBJ):: ../calcu/parser.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/pathlist$(ExOBJ):: ../setedit/pathlist.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ pathlist.h \
+ rhutils.h \
+ setapp.h \
+ settvuti.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pathtool$(ExOBJ):: ../mainsrc/pathtool.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ pathlist.h \
+ pathtool.h \
+ rhutils.h \
+ setapp.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pclipper$(ExOBJ):: ../mainsrc/pclipper.cc \
+ bufun.h \
+ compatlayer.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pmacros$(ExOBJ):: ../mainsrc/pmacros.cc \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ settvuti.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pperl$(ExOBJ):: ../mainsrc/pperl.cc \
+ bufun.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pphp$(ExOBJ):: ../mainsrc/pphp.cc \
+ bufun.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ppython$(ExOBJ):: ../mainsrc/ppython.cc \
+ bufun.h \
+ compatlayer.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pvarious$(ExOBJ):: ../mainsrc/pvarious.cc \
+ bufun.h \
+ compatlayer.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/pvhdl$(ExOBJ):: ../mainsrc/pvhdl.cc \
+ bufun.h \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/runprog$(ExOBJ):: ../setedit/runprog.cc \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ edmsg.h \
+ intermp3.h \
+ loadcle.h \
+ rhutils.h \
+ runprog.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ splinman.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sceditor$(ExOBJ):: ../streams/sceditor.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/scresave$(ExOBJ):: ../setedit/scresave.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ intermp3.h \
+ pathtool.h \
+ pmcoll.h \
+ rhutils.h \
+ runprog.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/eventqu.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdginter$(ExOBJ):: ../mainsrc/sdginter.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ edmsg.h \
+ mli.h \
+ mlisdgi.h \
+ setapp.h \
+ tv.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ txhgen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskasci$(ExOBJ):: ../setedit/streams/sdskasci.cc \
+ compatlayer.h \
+ dskascii.h \
+ dskwin.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskcale$(ExOBJ):: ../setedit/streams/sdskcale.cc \
+ compatlayer.h \
+ dskcalen.h \
+ dskwin.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskclip$(ExOBJ):: ../setedit/streams/sdskclip.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskclip.h \
+ dskwin.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskclos$(ExOBJ):: ../setedit/streams/sdskclos.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskclose.h \
+ dskwin.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskedit$(ExOBJ):: ../setedit/streams/sdskedit.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskedito.h \
+ dskwin.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskhelp$(ExOBJ):: ../setedit/streams/sdskhelp.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskhelp.h \
+ dskwin.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskman$(ExOBJ):: ../setedit/streams/sdskman.cc \
+ compatlayer.h \
+ dskman.h \
+ dskwin.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskmess$(ExOBJ):: ../setedit/streams/sdskmess.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskmessa.h \
+ dskwin.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskmp3$(ExOBJ):: ../setedit/streams/sdskmp3.cc \
+ compatlayer.h \
+ dskmp3.h \
+ dskwin.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskprj$(ExOBJ):: ../setedit/streams/sdskprj.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskprj.h \
+ dskwin.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/search$(ExOBJ):: ../mainsrc/search.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sedcolle$(ExOBJ):: ../setedit/streams/sedcolle.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskwin.h \
+ edcollec.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE05=settv$(ExIMK)
+
+obj/slpinter$(ExOBJ):: ../mainsrc/slpinter.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ completi.h \
+ configed.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ edmsg.h \
+ keytrans.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlieditd.h \
+ mliedito.h \
+ mlivar.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ slpinter.h \
+ tinppipe.h \
+ tnocastc.h \
+ tsbutton.h \
+ tsinplpi.h \
+ tslabel.h \
+ tstringa.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/splinman$(ExOBJ):: ../mainsrc/splinman.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ splinman.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ssindica$(ExOBJ):: ../streams/ssindica.cc \
+ ceditor.h \
+ compatlayer.h \
+ settvuti.h \
+ sindicat.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ssyntax$(ExOBJ):: ../mainsrc/ssyntax.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ ssyntax.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tags$(ExOBJ):: ../mainsrc/tags.cc \
+ advice.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ completi.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ pathtool.h \
+ rhutils.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tags.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tedcolle$(ExOBJ):: ../setedit/tedcolle.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dskclose.h \
+ dskedito.h \
+ dskwin.h \
+ easydia1.h \
+ easydiag.h \
+ edcollec.h \
+ edspecs.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tstringa.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tips$(ExOBJ):: ../setedit/tips.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edmsg.h \
+ edspecs.h \
+ setapp.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslabel.h \
+ tsradbot.h \
+ tstextsc.h \
+ tsview.h \
+ tsviewco.h \
+ ttextscr.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/cluster.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tpaltext$(ExOBJ):: ../setedit/tpaltext.cc \
+ compatlayer.h \
+ tpaltext.h \
+ tv.h \
+ tv/configtv.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/screen.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tsindica$(ExOBJ):: ../mainsrc/tsindica.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/txhgen$(ExOBJ):: ../sdg/txhgen.cc \
+ bufun.h \
+ compatlayer.h \
+ mli.h \
+ mlisdgi.h \
+ rhutils.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ txhgen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/winlistd$(ExOBJ):: ../setedit/winlistd.cc \
+ advice.h \
+ ced_clas.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditor.h \
+ compatlayer.h \
+ dskwin.h \
+ easydia1.h \
+ easydiag.h \
+ edcollec.h \
+ editcoma.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslistbo.h \
+ tssortva.h \
+ tstringa.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/editor.mkf b/setedit/makes/editor.mkf
new file mode 100644
index 0000000..1a1f63b
--- /dev/null
+++ b/setedit/makes/editor.mkf
@@ -0,0 +1,61 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=../mainsrc ../names ../streams ../setedit ../setedit/names ../setedit/streams \
+ ../infview ../sdg ../settvuti ../settvuti/names ../settvuti/streams ../extra \
+ ../mp3 ../calcu ../easydiag ../infview/names ../infview/streams ../librhuti
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+SDG_INC_DIR=../sdg/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_INC_DIR=../mp3
+CALCU_INC_DIR=../calcu
+HOLIDAYS_DIR=../holidays
+MP3_PREV_DIR=..
+INCLUDE_DIRS=$(INCLUDE_DIR) $(SETEDIT_INC_DIR) $(SETTVUTI_INC_DIR) \
+ $(SDG_INC_DIR) $(INFVIEW_INC_DIR) $(TVISION_INC) $(EXTRA_INC_DIR) \
+ $(EASYDIAG_INC_DIR) $(LIBRHUTI_INC_DIR) $(SUPPORT_INC) \
+ $(MP3_INC_DIR) $(CALCU_INC_DIR) $(HOLIDAYS_DIR)
+C_EXTRA_FLAGS=-DFOR_EDITOR
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+ifdef MAINTAINER_MODE
+ ExIMK=.imk
+else
+ ExIMK=.umk
+endif
+include editor$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/setedit/makes/editor.umk b/setedit/makes/editor.umk
new file mode 100644
index 0000000..1ca4685
--- /dev/null
+++ b/setedit/makes/editor.umk
@@ -0,0 +1,644 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ obj/accehtml$(ExOBJ) \
+ obj/advice$(ExOBJ) \
+ obj/ampdiag$(ExOBJ) \
+ obj/intermp3$(ExOBJ) \
+ obj/mp3list$(ExOBJ) \
+ obj/mp3play$(ExOBJ) \
+ obj/ascii$(ExOBJ) \
+ obj/boardmix$(ExOBJ) \
+ obj/bufun$(ExOBJ) \
+ obj/calcu$(ExOBJ) \
+ obj/calendar$(ExOBJ) \
+ obj/ceditor$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/completi$(ExOBJ) \
+ obj/debug$(ExOBJ) \
+ obj/deedidia$(ExOBJ) \
+ obj/doedidia$(ExOBJ) \
+ obj/dskascii$(ExOBJ) \
+ obj/dskcalen$(ExOBJ) \
+ obj/dskclip$(ExOBJ) \
+ obj/dskclose$(ExOBJ) \
+ obj/dskedito$(ExOBJ) \
+ obj/dskhelp$(ExOBJ) \
+ obj/dskman$(ExOBJ) \
+ obj/dskmessa$(ExOBJ) \
+ obj/dskmp3$(ExOBJ) \
+ obj/dskwin$(ExOBJ) \
+ obj/dstfile$(ExOBJ) \
+ obj/dumpfile$(ExOBJ) \
+ obj/edcolor$(ExOBJ) \
+ obj/edconst$(ExOBJ) \
+ obj/edfonts$(ExOBJ) \
+ obj/editdiag$(ExOBJ) \
+ obj/editmain$(ExOBJ) \
+ obj/editmenu$(ExOBJ) \
+ obj/editorfo$(ExOBJ) \
+ obj/editpale$(ExOBJ) \
+ obj/editwind$(ExOBJ) \
+ obj/edkeys$(ExOBJ) \
+ obj/edmsg$(ExOBJ) \
+ obj/edprefs$(ExOBJ) \
+ obj/edprint$(ExOBJ) \
+ obj/edprj$(ExOBJ) \
+ obj/edspecs$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ obj/fstrcmp$(ExOBJ) \
+ obj/getctxhl$(ExOBJ) \
+ obj/gzfiles$(ExOBJ) \
+ obj/holidays$(ExOBJ) \
+ obj/inf$(ExOBJ) \
+ obj/infbase$(ExOBJ) \
+ obj/manview$(ExOBJ) \
+ obj/nhiscoll$(ExOBJ) \
+ obj/ninfview$(ExOBJ) \
+ obj/ninfwind$(ExOBJ) \
+ obj/nmanwind$(ExOBJ) \
+ obj/sinf$(ExOBJ) \
+ obj/sman$(ExOBJ) \
+ obj/intgrep$(ExOBJ) \
+ obj/keytrans$(ExOBJ) \
+ obj/linelen$(ExOBJ) \
+ obj/loadcle$(ExOBJ) \
+ obj/loaddefl$(ExOBJ) \
+ obj/loadfunc$(ExOBJ) \
+ obj/loadnobkp$(ExOBJ) \
+ obj/loadshl$(ExOBJ) \
+ obj/loadusew$(ExOBJ) \
+ obj/macrocom$(ExOBJ) \
+ obj/menuload$(ExOBJ) \
+ obj/mli$(ExOBJ) \
+ obj/mliasimp$(ExOBJ) \
+ obj/mlicsdg$(ExOBJ) \
+ obj/mliediti$(ExOBJ) \
+ obj/mliedito$(ExOBJ) \
+ obj/mlisdg$(ExOBJ) \
+ obj/msignal$(ExOBJ) \
+ obj/nceditor$(ExOBJ) \
+ obj/ndskwasc$(ExOBJ) \
+ obj/ndskwcal$(ExOBJ) \
+ obj/ndskwcli$(ExOBJ) \
+ obj/ndskwclo$(ExOBJ) \
+ obj/ndskwedi$(ExOBJ) \
+ obj/ndskwhel$(ExOBJ) \
+ obj/ndskwman$(ExOBJ) \
+ obj/ndskwmes$(ExOBJ) \
+ obj/ndskwmp3$(ExOBJ) \
+ obj/ndskwprj$(ExOBJ) \
+ obj/neditwin$(ExOBJ) \
+ obj/nfileedi$(ExOBJ) \
+ obj/nsindica$(ExOBJ) \
+ obj/ntedcol$(ExOBJ) \
+ obj/parser$(ExOBJ) \
+ obj/pathlist$(ExOBJ) \
+ obj/pathtool$(ExOBJ) \
+ obj/pclipper$(ExOBJ) \
+ obj/pmacros$(ExOBJ) \
+ obj/pperl$(ExOBJ) \
+ obj/pphp$(ExOBJ) \
+ obj/ppython$(ExOBJ) \
+ obj/pvarious$(ExOBJ) \
+ obj/pvhdl$(ExOBJ) \
+ obj/runprog$(ExOBJ) \
+ obj/sceditor$(ExOBJ) \
+ obj/scresave$(ExOBJ) \
+ obj/sdginter$(ExOBJ) \
+ obj/sdskasci$(ExOBJ) \
+ obj/sdskcale$(ExOBJ) \
+ obj/sdskclip$(ExOBJ) \
+ obj/sdskclos$(ExOBJ) \
+ obj/sdskedit$(ExOBJ) \
+ obj/sdskhelp$(ExOBJ) \
+ obj/sdskman$(ExOBJ) \
+ obj/sdskmess$(ExOBJ) \
+ obj/sdskmp3$(ExOBJ) \
+ obj/sdskprj$(ExOBJ) \
+ obj/search$(ExOBJ) \
+ obj/sedcolle$(ExOBJ) \
+ obj/slpinter$(ExOBJ) \
+ obj/splinman$(ExOBJ) \
+ obj/ssindica$(ExOBJ) \
+ obj/ssyntax$(ExOBJ) \
+ obj/tags$(ExOBJ) \
+ obj/tedcolle$(ExOBJ) \
+ obj/tips$(ExOBJ) \
+ obj/tpaltext$(ExOBJ) \
+ obj/tsindica$(ExOBJ) \
+ obj/txhgen$(ExOBJ) \
+ obj/winlistd$(ExOBJ)
+
+LIBRARIES=\
+ librhuti$(ExLIB) \
+ libsettv$(ExLIB) \
+ libeasyd$(ExLIB)
+
+editor$(ExEXE):: \
+ obj/accehtml$(ExOBJ) \
+ obj/advice$(ExOBJ) \
+ obj/ampdiag$(ExOBJ) \
+ obj/intermp3$(ExOBJ) \
+ obj/mp3list$(ExOBJ) \
+ obj/mp3play$(ExOBJ) \
+ obj/ascii$(ExOBJ) \
+ obj/boardmix$(ExOBJ) \
+ obj/bufun$(ExOBJ) \
+ obj/calcu$(ExOBJ) \
+ obj/calendar$(ExOBJ) \
+ obj/ceditor$(ExOBJ) \
+ obj/codepage$(ExOBJ) \
+ obj/completi$(ExOBJ) \
+ obj/debug$(ExOBJ) \
+ obj/deedidia$(ExOBJ) \
+ obj/doedidia$(ExOBJ) \
+ obj/dskascii$(ExOBJ) \
+ obj/dskcalen$(ExOBJ) \
+ obj/dskclip$(ExOBJ) \
+ obj/dskclose$(ExOBJ) \
+ obj/dskedito$(ExOBJ) \
+ obj/dskhelp$(ExOBJ) \
+ obj/dskman$(ExOBJ) \
+ obj/dskmessa$(ExOBJ) \
+ obj/dskmp3$(ExOBJ) \
+ obj/dskwin$(ExOBJ) \
+ obj/dstfile$(ExOBJ) \
+ obj/dumpfile$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ obj/edcolor$(ExOBJ) \
+ obj/edconst$(ExOBJ) \
+ obj/edfonts$(ExOBJ) \
+ obj/editdiag$(ExOBJ) \
+ obj/editmain$(ExOBJ) \
+ obj/editmenu$(ExOBJ) \
+ obj/editorfo$(ExOBJ) \
+ obj/editpale$(ExOBJ) \
+ obj/editwind$(ExOBJ) \
+ obj/edkeys$(ExOBJ) \
+ obj/edmsg$(ExOBJ) \
+ obj/edprefs$(ExOBJ) \
+ obj/edprint$(ExOBJ) \
+ obj/edprj$(ExOBJ) \
+ obj/edspecs$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ obj/fstrcmp$(ExOBJ) \
+ obj/getctxhl$(ExOBJ) \
+ obj/gzfiles$(ExOBJ) \
+ obj/holidays$(ExOBJ) \
+ obj/inf$(ExOBJ) \
+ obj/infbase$(ExOBJ) \
+ obj/manview$(ExOBJ) \
+ obj/nhiscoll$(ExOBJ) \
+ obj/ninfview$(ExOBJ) \
+ obj/ninfwind$(ExOBJ) \
+ obj/nmanwind$(ExOBJ) \
+ obj/sinf$(ExOBJ) \
+ obj/sman$(ExOBJ) \
+ obj/intgrep$(ExOBJ) \
+ obj/keytrans$(ExOBJ) \
+ librhuti$(ExLIB) \
+ obj/linelen$(ExOBJ) \
+ obj/loadcle$(ExOBJ) \
+ obj/loaddefl$(ExOBJ) \
+ obj/loadfunc$(ExOBJ) \
+ obj/loadnobkp$(ExOBJ) \
+ obj/loadshl$(ExOBJ) \
+ obj/loadusew$(ExOBJ) \
+ obj/macrocom$(ExOBJ) \
+ obj/menuload$(ExOBJ) \
+ obj/mli$(ExOBJ) \
+ obj/mliasimp$(ExOBJ) \
+ obj/mlicsdg$(ExOBJ) \
+ obj/mliediti$(ExOBJ) \
+ obj/mliedito$(ExOBJ) \
+ obj/mlisdg$(ExOBJ) \
+ obj/msignal$(ExOBJ) \
+ obj/nceditor$(ExOBJ) \
+ obj/ndskwasc$(ExOBJ) \
+ obj/ndskwcal$(ExOBJ) \
+ obj/ndskwcli$(ExOBJ) \
+ obj/ndskwclo$(ExOBJ) \
+ obj/ndskwedi$(ExOBJ) \
+ obj/ndskwhel$(ExOBJ) \
+ obj/ndskwman$(ExOBJ) \
+ obj/ndskwmes$(ExOBJ) \
+ obj/ndskwmp3$(ExOBJ) \
+ obj/ndskwprj$(ExOBJ) \
+ obj/neditwin$(ExOBJ) \
+ obj/nfileedi$(ExOBJ) \
+ obj/nsindica$(ExOBJ) \
+ obj/ntedcol$(ExOBJ) \
+ obj/parser$(ExOBJ) \
+ obj/pathlist$(ExOBJ) \
+ obj/pathtool$(ExOBJ) \
+ obj/pclipper$(ExOBJ) \
+ obj/pmacros$(ExOBJ) \
+ obj/pperl$(ExOBJ) \
+ obj/pphp$(ExOBJ) \
+ obj/ppython$(ExOBJ) \
+ obj/pvarious$(ExOBJ) \
+ obj/pvhdl$(ExOBJ) \
+ obj/runprog$(ExOBJ) \
+ obj/sceditor$(ExOBJ) \
+ obj/scresave$(ExOBJ) \
+ obj/sdginter$(ExOBJ) \
+ obj/sdskasci$(ExOBJ) \
+ obj/sdskcale$(ExOBJ) \
+ obj/sdskclip$(ExOBJ) \
+ obj/sdskclos$(ExOBJ) \
+ obj/sdskedit$(ExOBJ) \
+ obj/sdskhelp$(ExOBJ) \
+ obj/sdskman$(ExOBJ) \
+ obj/sdskmess$(ExOBJ) \
+ obj/sdskmp3$(ExOBJ) \
+ obj/sdskprj$(ExOBJ) \
+ obj/search$(ExOBJ) \
+ obj/sedcolle$(ExOBJ) \
+ libsettv$(ExLIB) \
+ obj/slpinter$(ExOBJ) \
+ obj/splinman$(ExOBJ) \
+ obj/ssindica$(ExOBJ) \
+ obj/ssyntax$(ExOBJ) \
+ obj/tags$(ExOBJ) \
+ obj/tedcolle$(ExOBJ) \
+ obj/tips$(ExOBJ) \
+ obj/tpaltext$(ExOBJ) \
+ obj/tsindica$(ExOBJ) \
+ obj/txhgen$(ExOBJ) \
+ obj/winlistd$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+obj/accehtml$(ExOBJ):: ../mainsrc/accehtml.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/advice$(ExOBJ):: ../setedit/advice.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=amp3$(ExIMK)
+
+obj/ascii$(ExOBJ):: ../setedit/ascii.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/boardmix$(ExOBJ):: ../setedit/boardmix.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/bufun$(ExOBJ):: ../mainsrc/bufun.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/calcu$(ExOBJ):: ../calcu/calcu.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/calendar$(ExOBJ):: ../setedit/calendar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ceditor$(ExOBJ):: ../mainsrc/ceditor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/codepage$(ExOBJ):: ../setedit/codepage.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/completi$(ExOBJ):: ../mainsrc/completi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/debug$(ExOBJ):: ../setedit/debug.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/deedidia$(ExOBJ):: ../mainsrc/deedidia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/doedidia$(ExOBJ):: ../mainsrc/doedidia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskascii$(ExOBJ):: ../setedit/dskascii.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskcalen$(ExOBJ):: ../setedit/dskcalen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskclip$(ExOBJ):: ../setedit/dskclip.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskclose$(ExOBJ):: ../setedit/dskclose.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskedito$(ExOBJ):: ../setedit/dskedito.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskhelp$(ExOBJ):: ../setedit/dskhelp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskman$(ExOBJ):: ../setedit/dskman.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskmessa$(ExOBJ):: ../setedit/dskmessa.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskmp3$(ExOBJ):: ../setedit/dskmp3.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dskwin$(ExOBJ):: ../setedit/dskwin.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dstfile$(ExOBJ):: ../setedit/dstfile.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dumpfile$(ExOBJ):: ../mainsrc/dumpfile.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE01=easydiag$(ExIMK)
+
+obj/edcolor$(ExOBJ):: ../setedit/edcolor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edconst$(ExOBJ):: ../mainsrc/edconst.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edfonts$(ExOBJ):: ../setedit/edfonts.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/editdiag$(ExOBJ):: ../setedit/editdiag.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/editmain$(ExOBJ):: ../setedit/editmain.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/editmenu$(ExOBJ):: ../setedit/editmenu.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/editorfo$(ExOBJ):: ../mainsrc/editorfo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/editpale$(ExOBJ):: ../setedit/editpale.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/editwind$(ExOBJ):: ../mainsrc/editwind.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edkeys$(ExOBJ):: ../setedit/edkeys.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edmsg$(ExOBJ):: ../setedit/edmsg.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edprefs$(ExOBJ):: ../setedit/edprefs.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edprint$(ExOBJ):: ../setedit/edprint.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edprj$(ExOBJ):: ../setedit/edprj.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/edspecs$(ExOBJ):: ../mainsrc/edspecs.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE02=extra$(ExIMK)
+
+obj/fstrcmp$(ExOBJ):: ../mainsrc/fstrcmp.c
+ $(RHIDE_COMPILE_C)
+
+obj/getctxhl$(ExOBJ):: ../setedit/getctxhl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/gzfiles$(ExOBJ):: ../mainsrc/gzfiles.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/holidays$(ExOBJ):: ../setedit/holidays.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE03=inffd$(ExIMK)
+
+obj/intgrep$(ExOBJ):: ../setedit/intgrep.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/keytrans$(ExOBJ):: ../mainsrc/keytrans.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE04=librhuti$(ExIMK)
+
+obj/linelen$(ExOBJ):: ../mainsrc/linelen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/loadcle$(ExOBJ):: ../setedit/loadcle.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/loaddefl$(ExOBJ):: ../mainsrc/loaddefl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/loadfunc$(ExOBJ):: ../mainsrc/loadfunc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/loadnobkp$(ExOBJ):: ../setedit/loadnobkp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/loadshl$(ExOBJ):: ../mainsrc/loadshl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/loadusew$(ExOBJ):: ../mainsrc/loadusew.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/macrocom$(ExOBJ):: ../mainsrc/macrocom.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/menuload$(ExOBJ):: ../setedit/menuload.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mli$(ExOBJ):: ../sdg/mli.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mliasimp$(ExOBJ):: ../sdg/mliasimp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mlicsdg$(ExOBJ):: ../sdg/mlicsdg.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mliediti$(ExOBJ):: ../sdg/mliediti.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mliedito$(ExOBJ):: ../sdg/mliedito.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mlisdg$(ExOBJ):: ../sdg/mlisdg.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/msignal$(ExOBJ):: ../setedit/msignal.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nceditor$(ExOBJ):: ../names/nceditor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwasc$(ExOBJ):: ../names/ndskwasc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwcal$(ExOBJ):: ../names/ndskwcal.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwcli$(ExOBJ):: ../names/ndskwcli.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwclo$(ExOBJ):: ../names/ndskwclo.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwedi$(ExOBJ):: ../names/ndskwedi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwhel$(ExOBJ):: ../names/ndskwhel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwman$(ExOBJ):: ../names/ndskwman.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwmes$(ExOBJ):: ../names/ndskwmes.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwmp3$(ExOBJ):: ../names/ndskwmp3.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ndskwprj$(ExOBJ):: ../names/ndskwprj.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/neditwin$(ExOBJ):: ../names/neditwin.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nfileedi$(ExOBJ):: ../names/nfileedi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nsindica$(ExOBJ):: ../names/nsindica.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ntedcol$(ExOBJ):: ../names/ntedcol.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/parser$(ExOBJ):: ../calcu/parser.c
+ $(RHIDE_COMPILE_C)
+
+obj/pathlist$(ExOBJ):: ../setedit/pathlist.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pathtool$(ExOBJ):: ../mainsrc/pathtool.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pclipper$(ExOBJ):: ../mainsrc/pclipper.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pmacros$(ExOBJ):: ../mainsrc/pmacros.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pperl$(ExOBJ):: ../mainsrc/pperl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pphp$(ExOBJ):: ../mainsrc/pphp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ppython$(ExOBJ):: ../mainsrc/ppython.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pvarious$(ExOBJ):: ../mainsrc/pvarious.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/pvhdl$(ExOBJ):: ../mainsrc/pvhdl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/runprog$(ExOBJ):: ../setedit/runprog.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sceditor$(ExOBJ):: ../streams/sceditor.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/scresave$(ExOBJ):: ../setedit/scresave.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdginter$(ExOBJ):: ../mainsrc/sdginter.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskasci$(ExOBJ):: ../setedit/streams/sdskasci.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskcale$(ExOBJ):: ../setedit/streams/sdskcale.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskclip$(ExOBJ):: ../setedit/streams/sdskclip.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskclos$(ExOBJ):: ../setedit/streams/sdskclos.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskedit$(ExOBJ):: ../setedit/streams/sdskedit.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskhelp$(ExOBJ):: ../setedit/streams/sdskhelp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskman$(ExOBJ):: ../setedit/streams/sdskman.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskmess$(ExOBJ):: ../setedit/streams/sdskmess.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskmp3$(ExOBJ):: ../setedit/streams/sdskmp3.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sdskprj$(ExOBJ):: ../setedit/streams/sdskprj.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/search$(ExOBJ):: ../mainsrc/search.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sedcolle$(ExOBJ):: ../setedit/streams/sedcolle.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE05=settv$(ExIMK)
+
+obj/slpinter$(ExOBJ):: ../mainsrc/slpinter.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/splinman$(ExOBJ):: ../mainsrc/splinman.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ssindica$(ExOBJ):: ../streams/ssindica.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ssyntax$(ExOBJ):: ../mainsrc/ssyntax.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tags$(ExOBJ):: ../mainsrc/tags.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tedcolle$(ExOBJ):: ../setedit/tedcolle.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tips$(ExOBJ):: ../setedit/tips.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tpaltext$(ExOBJ):: ../setedit/tpaltext.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tsindica$(ExOBJ):: ../mainsrc/tsindica.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/txhgen$(ExOBJ):: ../sdg/txhgen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/winlistd$(ExOBJ):: ../setedit/winlistd.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/extra.gpr b/setedit/makes/extra.gpr
new file mode 100644
index 0000000..1a028e3
--- /dev/null
+++ b/setedit/makes/extra.gpr
Binary files differ
diff --git a/setedit/makes/extra.imk b/setedit/makes/extra.imk
new file mode 100644
index 0000000..702f0f0
--- /dev/null
+++ b/setedit/makes/extra.imk
@@ -0,0 +1,51 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+obj/djmdr$(ExOBJ):: ../extra/djmdr.s \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ASM_FORCE)
+
+obj/dyncat$(ExOBJ):: ../extra/dyncat.cc \
+ configed.h \
+ dyncat.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/memmove$(ExOBJ):: ../extra/memmove.s \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ASM_FORCE)
+
+obj/mixer$(ExOBJ):: ../extra/mixer.c \
+ configed.h \
+ mixer.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/mixersb$(ExOBJ):: ../extra/mixersb.c \
+ configed.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/mixoss$(ExOBJ):: ../extra/mixoss.c \
+ configed.h \
+ mixer.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/stackdbg$(ExOBJ):: ../extra/stackdbg.c \
+ compatlayer.h \
+ configed.h \
+ stackdbg.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/strncpyz$(ExOBJ):: ../extra/strncpyz.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/strndup$(ExOBJ):: ../extra/strndup.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/extra.umk b/setedit/makes/extra.umk
new file mode 100644
index 0000000..6f2f31b
--- /dev/null
+++ b/setedit/makes/extra.umk
@@ -0,0 +1,31 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+obj/djmdr$(ExOBJ):: ../extra/djmdr.s
+ $(RHIDE_COMPILE_ASM_FORCE)
+
+obj/dyncat$(ExOBJ):: ../extra/dyncat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/memmove$(ExOBJ):: ../extra/memmove.s
+ $(RHIDE_COMPILE_ASM_FORCE)
+
+obj/mixer$(ExOBJ):: ../extra/mixer.c
+ $(RHIDE_COMPILE_C)
+
+obj/mixersb$(ExOBJ):: ../extra/mixersb.c
+ $(RHIDE_COMPILE_C)
+
+obj/mixoss$(ExOBJ):: ../extra/mixoss.c
+ $(RHIDE_COMPILE_C)
+
+obj/stackdbg$(ExOBJ):: ../extra/stackdbg.c
+ $(RHIDE_COMPILE_C)
+
+obj/strncpyz$(ExOBJ):: ../extra/strncpyz.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/strndup$(ExOBJ):: ../extra/strndup.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/extrimk.cc b/setedit/makes/extrimk.cc
new file mode 100644
index 0000000..589e8cc
--- /dev/null
+++ b/setedit/makes/extrimk.cc
@@ -0,0 +1,1062 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003-2005 by Salvador Eduardo Tropea.
+ Covered by the GPL license.
+ Description:
+ This program generates a .imk file containing the dependencies for a
+project.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <unistd.h>
+#include <time.h>
+#include <ctype.h>
+
+#define ONE_DEP_BY_LINE 1
+
+const int maxLine=1024;
+unsigned maxCol=78;
+
+struct node;
+static char *projectBase;
+static int projectBaseL;
+static int IncludeCounter=0;
+
+struct stMak
+{
+ node *base, *last;
+ char *objDir;
+ char *mainTarget;
+ char *baseDir;
+};
+
+struct node
+{
+ char *name;
+ node *deps;
+ node *ldep;
+ node *next;
+ stMak *subprj;
+};
+
+struct stIncDir
+{
+ char *var;
+ char *dir;
+ int ldir;
+};
+
+struct stLibItem
+{
+ int priority;
+ const char *name;
+};
+
+stIncDir incDirs[]=
+{
+{"TVISION_INC", 0, 0},
+{"INCLUDE_DIR", "../include", 0},
+{"SETEDIT_INC_DIR", "../setedit/include", 0},
+{"SETTVUTI_INC_DIR", "../settvuti/include", 0},
+{"SDG_INC_DIR", "../sdg/include", 0},
+{"INFVIEW_INC_DIR", "../infview/include", 0},
+{"EXTRA_INC_DIR", "../extra", 0},
+{"EASYDIAG_INC_DIR", "../easydiag", 0},
+{"LIBRHUTI_INC_DIR", "../librhuti", 0},
+{"MP3_INC_DIR", "../mp3", 0},
+{"CALCU_INC_DIR", "../calcu", 0},
+{"HOLIDAYS_DIR", "../holidays", 0},
+{"MP3_MAIN_DIR", "../../include", 0},
+{"MP3_PREV_DIR", "..", 0},
+{0,0}
+};
+
+char *srcDirs[]=
+{
+ "../mainsrc",
+ "../names",
+ "../streams",
+ "../setedit",
+ "../setedit/names",
+ "../setedit/streams",
+ "../infview",
+ "../sdg",
+ "../settvuti",
+ "../settvuti/names",
+ "../settvuti/streams",
+ "../extra",
+ "../mp3",
+ "../calcu",
+ "../easydiag",
+ "../infview/names",
+ "../infview/streams",
+ "../librhuti",
+ NULL
+};
+
+stLibItem sortLibs[]=
+{
+ {100,"libeasy"},
+ { 0,NULL}
+};
+
+static
+void AddFileName(const char *name, stMak &mk)
+{
+ //printf("`%s'\n",name);
+ if (mk.base)
+ {
+ mk.last->next=new node;
+ mk.last=mk.last->next;
+ }
+ else
+ mk.base=mk.last=new node;
+ mk.last->name=strdup(name);
+ mk.last->next=mk.last->deps=mk.last->ldep=NULL;
+ mk.last->subprj=NULL;
+}
+
+static
+int PrConvertExt(FILE *d, const char *file)
+{
+ char *s=strrchr(file,'.');
+ if (!s)
+ return fprintf(d,"%s",file);
+ int l=s-file;
+ fwrite(file,l,1,d);
+ if (strcmp(s,".o")==0)
+ l+=fprintf(d,"$(ExOBJ)");
+ else if (strcmp(s,".exe")==0)
+ l+=fprintf(d,"$(ExEXE)");
+ else if (strcmp(s,".a")==0)
+ l+=fprintf(d,"$(ExLIB)");
+ else if (strcmp(s,".env")==0)
+ l+=fprintf(d,".env");
+ else if (strcmp(s,".imk")==0)
+ l+=fprintf(d,".imk");
+ else if (strcmp(s,".h")==0)
+ l+=fprintf(d,".h");
+ else if (strcmp(s,".c")==0)
+ l+=fprintf(d,".c");
+ else if (strcmp(s,".cc")==0)
+ l+=fprintf(d,".cc");
+ else if (strcmp(s,".cpp")==0)
+ l+=fprintf(d,".cpp");
+ else
+ {
+ fprintf(stderr,"Unknown extension: '%s'\n",s);
+ exit(15);
+ }
+ return l;
+}
+
+static
+void ExtractSources(FILE *f, stMak &mk)
+{
+ char buffer[maxLine];
+ char found=0;
+ do
+ {
+ if (fgets(buffer,maxLine,f))
+ if (strncmp(buffer,"PROJECT_ITEMS",13)==0)
+ {
+ found=1;
+ break;
+ }
+ }
+ while (!feof(f));
+ if (!found)
+ {
+ fprintf(stderr,"Can't find project items\n");
+ exit(1);
+ }
+ char *s=buffer+14;
+ do
+ {
+ char *fName=strtok(s," \t\\\n");
+ while (fName)
+ {
+ if (*fName)
+ AddFileName(fName,mk);
+ fName=strtok(NULL," \t\\\n");
+ }
+ fgets(buffer,maxLine,f);
+ s=buffer;
+ }
+ while (!feof(f) && buffer[0]=='\t');
+}
+
+static
+void AddDependency(const char *name, node *p)
+{
+ node *nNode=new node;
+ nNode->next=NULL;
+ if (p->deps)
+ {
+ node *r=p->deps, *a=NULL;
+ // Force the list to be sorted, it reduces the output of diff
+ while (r && strcmp(r->name,name)<0)
+ {
+ a=r;
+ r=r->next;
+ }
+ if (!r)
+ {// @ the end
+ p->ldep->next=nNode;
+ p->ldep=nNode;
+ }
+ else if (!a) // @ the beggining
+ {
+ nNode->next=p->deps;
+ p->deps=nNode;
+ }
+ else // in the middle
+ {
+ a->next=nNode;
+ nNode->next=r;
+ }
+ }
+ else
+ p->deps=p->ldep=nNode;
+ nNode->name=strdup(name);
+ nNode->deps=nNode->ldep=NULL;
+ nNode->subprj=NULL;
+}
+
+static
+void ExtractDeps(FILE *f, node *p)
+{
+ char buffer[maxLine];
+ char bName[maxLine];
+ char found=0;
+ int depNum;
+ do
+ {
+ if (fgets(buffer,maxLine,f) &&
+ sscanf(buffer,"DEPS_%d=%s ",&depNum,bName)==2 &&
+ depNum)
+ {
+ if (strcmp(bName,p->name))
+ {
+ fprintf(stderr,"Error: unsorted deps? (%d,%s looking for %s)\n",depNum,bName,
+ p->name);
+ exit(2);
+ }
+ found=1;
+ break;
+ }
+ }
+ while (!feof(f));
+ if (!found)
+ {
+ fprintf(stderr,"Failed to find %s dependencies\n",p->name);
+ exit(3);
+ }
+ char *s=strchr(buffer,'=')+1+strlen(p->name);
+ do
+ {
+ char *fName=strtok(s," \t\\\n");
+ while (fName)
+ {
+ if (*fName)
+ AddDependency(fName,p);
+ fName=strtok(NULL," \t\\\n");
+ }
+ fgets(buffer,maxLine,f);
+ s=buffer;
+ }
+ while (!feof(f) && buffer[0]=='\t');
+}
+
+static
+int PrintDep(FILE *d, int l, const char *s)
+{
+ if (ONE_DEP_BY_LINE)
+ {
+ fputs("\\\n\t",d);
+ l=8+PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ else
+ {
+ if (l+strlen(s)+2>maxCol)
+ {
+ fputs("\\\n\t",d);
+ l=8;
+ }
+ l+=PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ return l;
+}
+
+static
+int PrintDepDir(FILE *d, int l, const char *s,int lenDir, const char *dir)
+{
+ if (ONE_DEP_BY_LINE)
+ {
+ fputs("\\\n\t",d);
+ l=8+fprintf(d,"%s/",dir)+PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ else
+ {
+ if (l+strlen(s)+3+lenDir>maxCol)
+ {
+ fputs("\\\n\t",d);
+ l=8;
+ }
+ l+=fprintf(d,"%s/",dir)+PrConvertExt(d,s)+1;
+ fputc(' ',d);
+ }
+ return l;
+}
+
+static
+int AddFixedDeps(FILE *d, int l)
+{
+ //l=PrintDep(d,l,"rhide.env");
+ //l=PrintDep(d,l,"common.imk");
+ l=PrintDep(d,l,"$(MAKEFILE_DEPS)");
+ return l;
+}
+
+static
+char *SearchSrc(char *toStat)
+{
+ struct stat st;
+ if (stat(toStat,&st))
+ {
+ int i;
+ char buf[PATH_MAX];
+ for (i=0; srcDirs[i]; i++)
+ {
+ strcpy(buf,srcDirs[i]);
+ strcat(buf,"/");
+ strcat(buf,toStat);
+ if (stat(buf,&st)==0)
+ return strdup(buf);
+ }
+ }
+ return toStat;
+}
+
+static
+void GenerateDepFor(node *p, FILE *d, stMak &mk)
+{
+ char *baseName=strdup(p->name);
+ char *s=strrchr(baseName,'.');
+ char *ext=s+1;
+ *s=0;
+
+ // Already compiled item?
+ if (strcmp(ext,"o")==0 || strcmp(ext,"a")==0)
+ return;
+
+ char *relName=SearchSrc(p->name);
+ int l=fprintf(d,"%s/%s$(ExOBJ):: %s ",mk.objDir,baseName,relName);
+ if (relName!=p->name)
+ free(relName);
+ node *c=p->deps;
+ while (c)
+ {
+ s=c->name;
+ if (strstr(s,p->name)!=NULL)
+ {// RHIDE 1.5 duplicates the source as dependency
+ c=c->next;
+ continue;
+ }
+ char *toStat;
+ struct stat st;
+ if (mk.baseDir)
+ {
+ toStat=new char[strlen(mk.baseDir)+strlen(s)+1];
+ strcpy(toStat,mk.baseDir);
+ strcat(toStat,s);
+ }
+ else
+ toStat=strdup(s);
+ int foundOnVPath=0;
+ if (stat(toStat,&st))
+ {
+ // RHIDE 1.5 CVS filters the VPATH part, now I added it to common.imk.
+ int i;
+ char buf[PATH_MAX];
+ for (i=0; !foundOnVPath && incDirs[i].var; i++)
+ {
+ strcpy(buf,incDirs[i].dir);
+ strcat(buf,"/");
+ strcat(buf,toStat);
+ //printf("%s\n",buf);
+ if (stat(buf,&st)==0)
+ foundOnVPath=1;
+ }
+ for (i=0; !foundOnVPath && srcDirs[i]; i++)
+ {
+ strcpy(buf,srcDirs[i]);
+ strcat(buf,"/");
+ strcat(buf,toStat);
+ //printf("%s\n",buf);
+ if (stat(buf,&st)==0)
+ foundOnVPath=1;
+ }
+ if (!foundOnVPath)
+ {
+ fprintf(stderr,"Can't stat %s dependency\n",toStat);
+ exit(12);
+ }
+ }
+ free(toStat);
+ if (!foundOnVPath)
+ {
+ int i;
+ if (strchr(s,'/'))
+ {
+ for (i=0; incDirs[i].var; i++)
+ {
+ if (strncmp(s,incDirs[i].dir,incDirs[i].ldir)==0)
+ {
+ s=(char *)malloc(3+strlen(incDirs[i].var)+1+strlen(s+incDirs[i].ldir));
+ sprintf(s,"$(%s)%s",incDirs[i].var,c->name+incDirs[i].ldir);
+ break;
+ }
+ }
+ if (s==c->name)
+ {
+ // This is some bug in RHIDE 1.5 CVS: some paths are emitted as absolute,
+ // maybe is because the program is loading an old project.
+ if (strncmp(s,projectBase,projectBaseL)==0)
+ {
+ char *sub=s+projectBaseL;
+ char *toTest=(char *)malloc(strlen(sub)+3+1);
+ sprintf(toTest,"../%s",sub);
+ for (i=0; incDirs[i].var; i++)
+ if (strncmp(toTest,incDirs[i].dir,incDirs[i].ldir)==0)
+ {
+ s=(char *)malloc(3+strlen(incDirs[i].var)+1+strlen(toTest+incDirs[i].ldir));
+ sprintf(s,"$(%s)%s",incDirs[i].var,toTest+incDirs[i].ldir);
+ //fprintf(stderr,"%s Da: %s\n",c->name,s);
+ break;
+ }
+ free(toTest);
+ }
+ if (s==c->name)
+ {
+ fprintf(stderr,"Unknown include dir: %s\n",c->name);
+ exit(4);
+ }
+ }
+ }
+ }
+ l=PrintDep(d,l,s);
+ if (s!=c->name)
+ free(s);
+ c=c->next;
+ }
+ l=AddFixedDeps(d,l);
+ fputc('\n',d);
+ if (strcmp(ext,"c")==0)
+ fputs("\t$(RHIDE_COMPILE_C)",d);
+ else if (strcmp(ext,"cc")==0)
+ fputs("\t$(RHIDE_COMPILE_CC)",d);
+ else if (strcmp(ext,"cpp")==0)
+ fputs("\t$(RHIDE_COMPILE_CC)",d);
+ else if (strcmp(ext,"s")==0)
+ fputs("\t$(RHIDE_COMPILE_ASM_FORCE)",d);
+ else
+ {
+ fprintf(stderr,"\nUnknown extension `%s'\n",ext);
+ exit(5);
+ }
+ fputs("\n\n",d);
+ free(baseName);
+}
+
+static
+int ExtractVar(FILE *f, const char *var, char *&dest, char ret)
+{
+ char buffer[maxLine];
+ int l=strlen(var);
+ do
+ {
+ if (fgets(buffer,maxLine,f))
+ {
+ if (strncmp(buffer,var,l)==0)
+ {
+ char *s=strtok(buffer+l+1,"\n");
+ dest=s ? strdup(s) : strdup("");
+ return 1;
+ }
+ else
+ {
+ if (strncmp(buffer,"include",7)==0)
+ {
+ char *s=strtok(buffer+8,"\n");
+ FILE *inc=fopen(s,"rt");
+ if (!inc)
+ {
+ fprintf(stderr,"Can't open include %s\n",s);
+ exit(13);
+ }
+ int retVal=ExtractVar(inc,var,dest,1);
+ fclose(inc);
+ if (retVal)
+ return 1;
+ }
+ }
+ }
+ }
+ while (!feof(f));
+ if (ret)
+ return 0;
+ fprintf(stderr,"Unable to find %s var\n",var);
+ exit(7);
+}
+
+static
+void ExtractObjDir(FILE *f, stMak &mk)
+{
+ ExtractVar(f,"vpath_obj",mk.objDir,0);
+}
+
+static
+void ExtractTVDir(FILE *f)
+{
+ if (incDirs[0].dir)
+ return;
+ ExtractVar(f,"TVISION_INC",incDirs[0].dir,0);
+}
+
+static
+void ExtractTarget(FILE *f, stMak &mk)
+{
+ ExtractVar(f,"MAIN_TARGET",mk.mainTarget,0);
+}
+
+static
+int CollectTargets(FILE *d, const char *name, stMak &mk, int l);
+
+static
+int ListTargetItems(FILE *d, int l, stMak &mk)
+{
+ node *p=mk.base;
+ int lenObjDir=strlen(mk.objDir);
+ while (p)
+ {
+ if (strstr(p->name,".gpr")==NULL)
+ {
+ char *s=strdup(p->name);
+ char *ext=strrchr(s,'.');
+ if (strcmp(ext,".o")==0 || strcmp(ext,".a")==0)
+ {
+ l=PrintDep(d,l,s);
+ }
+ else
+ {
+ strcpy(ext,".o");
+ l=PrintDepDir(d,l,s,lenObjDir,mk.objDir);
+ }
+ free(s);
+ }
+ else
+ {
+ l=CollectTargets(d,p->name,*p->subprj,l);
+ }
+ p=p->next;
+ }
+ return l;
+}
+
+static
+int CollectTargets(FILE *d, const char *name, stMak &mk, int l)
+{
+ if (mk.mainTarget && *mk.mainTarget)
+ {// Simple, it have a lib
+ l=PrintDep(d,l,mk.mainTarget);
+ }
+ else
+ {// More complex
+ l=ListTargetItems(d,l,mk);
+ }
+ return l;
+}
+
+static
+void GenerateTarget(FILE *d, stMak &mk)
+{
+ if (!*mk.mainTarget)
+ return;
+ int l=PrConvertExt(d,mk.mainTarget)+3;
+ fputs(":: ",d);
+ l=ListTargetItems(d,l,mk);
+ l=AddFixedDeps(d,l);
+ char *ext=strrchr(mk.mainTarget,'.')+1;
+ fputc('\n',d);
+ if (strcmp(ext,"exe")==0)
+ fputs("\t$(RHIDE_COMPILE_LINK)",d);
+ else if (strcmp(ext,"a")==0)
+ fputs("\t$(RHIDE_COMPILE_ARCHIVE)",d);
+ else
+ {
+ fprintf(stderr,"\nUnknown extension `%s'\n",ext);
+ exit(8);
+ }
+ fputs("\n\n",d);
+}
+
+static
+void GenerateAll(FILE *f, stMak &mk)
+{
+ GenerateTarget(f,mk);
+ node *p=mk.base;
+ while (p)
+ {
+ if (p->subprj)
+ {
+ if (0)
+ GenerateAll(f,*p->subprj);
+ else
+ {
+ char *s=strdup(p->name);
+ char *ext=strrchr(s,'.');
+ *ext=0;
+ fprintf(f,"INCLUDE%02d=%s$(ExIMK)\n\n",IncludeCounter++,s);
+ free(s);
+ }
+ }
+ else
+ GenerateDepFor(p,f,mk);
+ p=p->next;
+ }
+}
+
+static
+int ListTargetOItems(FILE *d, int l, stMak &mk)
+{
+ node *p=mk.base;
+ int lenObjDir=strlen(mk.objDir);
+ while (p)
+ {
+ if (strstr(p->name,".gpr")==NULL)
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".a"))
+ {
+ char *s=strdup(p->name);
+ if (strcmp(ext,".o"))
+ strcpy(strrchr(s,'.'),".o");
+ l=PrintDepDir(d,l,s,lenObjDir,mk.objDir);
+ free(s);
+ }
+ }
+ else
+ {
+ if (!p->subprj->mainTarget || !*p->subprj->mainTarget)
+ l=ListTargetOItems(d,l,*p->subprj);
+ }
+ p=p->next;
+ }
+ return l;
+}
+
+static
+void CollectOTargets(FILE *d, const char *name, stMak &mk)
+{
+
+}
+
+
+static
+void GenerateObjs(FILE *f, stMak &mk)
+{
+ int l=fprintf(f,"OBJFILES=");
+ ListTargetOItems(f,l,mk);
+ fputs("\n\n",f);
+}
+
+
+/*****************************************************************************
+ The following mess is to just "resort" the libraries according to its
+dependency.
+ I took TNSSortedCollection from TV to implement the sorted list. It could
+be used by other lists in this module.
+*****************************************************************************/
+
+typedef int ccIndex;
+
+class TNSSortedCollection
+{
+public:
+ TNSSortedCollection(ccIndex aLimit, ccIndex aDelta);
+ virtual ~TNSSortedCollection();
+
+ void atInsert(ccIndex index, void *item);
+ ccIndex insert(void *item);
+ bool search(void *key, ccIndex &index);
+ void freeAll();
+ void setLimit(ccIndex aLimit);
+ ccIndex getCount() { return count; }
+ virtual int compare(void *key1, void *key2)=0;
+ virtual void freeItem(void *item);
+ void *at(ccIndex index)
+ {
+ if (index<0 || index>=count)
+ abort();
+ return items[index];
+ }
+protected:
+ void **items;
+ ccIndex count;
+ ccIndex limit;
+ ccIndex delta;
+
+};
+
+TNSSortedCollection::TNSSortedCollection(ccIndex aLimit, ccIndex aDelta) :
+ items(0),
+ count(0),
+ limit(0),
+ delta(aDelta)
+{
+ setLimit(aLimit);
+}
+
+TNSSortedCollection::~TNSSortedCollection()
+{
+ freeAll();
+ delete[] items;
+}
+
+void TNSSortedCollection::freeAll()
+{
+ for (ccIndex i=0; i<count; i++)
+ freeItem(at(i));
+ count=0;
+}
+
+void TNSSortedCollection::freeItem(void *item)
+{
+ delete[] (char *)item;
+}
+
+void TNSSortedCollection::setLimit(ccIndex aLimit)
+{
+ if (aLimit<count)
+ aLimit=count;
+ if (aLimit!=limit)
+ {
+ void **aItems;
+ if (!aLimit)
+ aItems=NULL;
+ else
+ {
+ aItems=new void *[aLimit];
+ if (count && items)
+ memcpy(aItems,items,count*sizeof(void *));
+ }
+ if (items)
+ delete[] items;
+ items=aItems;
+ limit=aLimit;
+ }
+}
+
+ccIndex TNSSortedCollection::insert(void *item)
+{
+ ccIndex i;
+ if (search(item,i)==0)
+ atInsert(i,item);
+ return i;
+}
+
+void TNSSortedCollection::atInsert(ccIndex index, void *item)
+{
+ if (index<0)
+ abort();
+ if (count==limit)
+ setLimit(count+delta);
+
+ memmove(&items[index+1],&items[index],(count-index)*sizeof(void *));
+ count++;
+
+ items[index]=item;
+}
+
+bool TNSSortedCollection::search(void *key, ccIndex &index)
+{
+ ccIndex l=0;
+ ccIndex h=count-1;
+ bool res=false;
+ while (l<=h)
+ {
+ ccIndex i=(l+h)>>1;
+ ccIndex c=compare(items[i],key);
+ if (c<0)
+ l=i+1;
+ else
+ {
+ h=i-1;
+ if (c==0)
+ {
+ res=true;
+ l=i;
+ }
+ }
+ }
+ index=l;
+ return res;
+}
+
+
+class TLibCol : public TNSSortedCollection
+{
+public:
+ TLibCol() : TNSSortedCollection(8,4) {}
+
+ virtual int compare(void *key1, void *key2);
+ ccIndex insert(const char *name);
+ virtual void freeItem(void *item);
+ stLibItem *At(ccIndex pos) { return (stLibItem *)at(pos); }
+};
+
+void TLibCol::freeItem(void *item)
+{
+ delete (stLibItem *)item;
+}
+
+ccIndex TLibCol::insert(const char *name)
+{
+ stLibItem *p=new stLibItem;
+ p->priority=50;
+ for (int i=0; sortLibs[i].name; i++)
+ if (strstr(name,sortLibs[i].name))
+ p->priority=sortLibs[i].priority;
+ p->name=name;
+ //fprintf(stderr,"%d) Inserting %s (%d)\n",count,name,p->priority);
+ TNSSortedCollection::insert((void *)p);
+}
+
+int TLibCol::compare(void *key1, void *key2)
+{
+ stLibItem *p1=(stLibItem *)key1;
+ stLibItem *p2=(stLibItem *)key2;
+
+ if (p1->priority==p2->priority)
+ return strcmp(p1->name,p2->name);
+
+ return p1->priority-p2->priority;
+}
+
+static
+int ListTargetAItems(FILE *d, int l, stMak &mk, TLibCol &col)
+{
+ node *p=mk.base;
+ if (mk.mainTarget && *mk.mainTarget)
+ {
+ //l=PrintDep(d,l,mk.mainTarget);
+ col.insert(mk.mainTarget);
+ }
+ else
+ {
+ while (p)
+ {
+ if (p->subprj)
+ ListTargetAItems(d,l,*p->subprj,col);
+ else
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".a")==0)
+ //l=PrintDep(d,l,p->name);
+ col.insert(p->name);
+ }
+ p=p->next;
+ }
+ }
+ return l;
+}
+
+static
+void GenerateLibs(FILE *f, stMak &mk)
+{
+ int l=fprintf(f,"LIBRARIES=");
+ TLibCol col;
+
+ node *p=mk.base;
+ while (p)
+ {
+ if (p->subprj)
+ l=ListTargetAItems(f,l,*p->subprj,col);
+ else
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".a")==0)
+ //l=PrintDep(f,l,p->name);
+ col.insert(p->name);
+ }
+ p=p->next;
+ }
+
+ ccIndex c=col.getCount();
+ for (int i=0; i<c; i++)
+ l=PrintDep(f,l,col.At(i)->name);
+
+ fputs("\n\n",f);
+}
+
+/*****************************************************************************
+ End of LIBRARIES=
+*****************************************************************************/
+
+static
+void ExtractBaseDir(const char *mak, stMak &mk)
+{
+ char *s=strrchr(mak,'/');
+ if (s)
+ {
+ int l=s-mak+1;
+ mk.baseDir=new char[l+1];
+ memcpy(mk.baseDir,mak,l);
+ mk.baseDir[l]=0;
+ }
+}
+
+static
+void ProcessMakefile(const char *mak, stMak &mk, int level)
+{
+ //printf("\n\n\nParsing %s makefile\n\n\n",mak);
+ ExtractBaseDir(mak,mk);
+ FILE *f;
+ f=fopen(mak,"rt");
+ if (!f)
+ {
+ fprintf(stderr,"Can't open %s\n",mak);
+ exit(8);
+ }
+ ExtractObjDir(f,mk);
+ long pos=ftell(f);
+ ExtractTarget(f,mk);
+ ExtractSources(f,mk);
+ // RHIDE 1.4.7 have a different order than 1.4.9 and 1.5
+ fseek(f,pos,SEEK_SET);
+ ExtractTVDir(f);
+ int i;
+ if (!incDirs[0].ldir)
+ for (i=0; incDirs[i].var; i++)
+ incDirs[i].ldir=strlen(incDirs[i].dir);
+ node *p;
+ //printf("Should dig:\n");
+ p=mk.base;
+ while (p)
+ {
+ char *s=strstr(p->name,".gpr");
+ if (s)
+ {
+ //printf("%s\n",p->name);
+ p->subprj=new stMak;
+ memset(p->subprj,0,sizeof(stMak));
+ char *subMak=strdup(p->name);
+ s=strstr(subMak,".gpr");
+ strcpy(s,".mak");
+ ProcessMakefile(subMak,*p->subprj,level+1);
+ free(subMak);
+ }
+ p=p->next;
+ }
+ p=mk.base;
+ while (p)
+ {
+ char *ext=strrchr(p->name,'.');
+ if (strcmp(ext,".gpr") && strcmp(ext,".a") && strcmp(ext,".o"))
+ ExtractDeps(f,p);
+ p=p->next;
+ }
+ // Generation
+ if (level)
+ return;
+
+ char timeBuf[32];
+ time_t now;
+ time(&now);
+ struct tm *brkT=localtime(&now);
+ strftime(timeBuf,32,"%Y-%m-%d %H:%M",brkT);
+ //fprintf(stdout,"#!/usr/bin/make\n# Automatically generated from RHIDE projects, don't edit\n# %s\n#\n\n",timeBuf);
+ // Don't know why I needed the time, so I'm disabling it.
+ fprintf(stdout,"#!/usr/bin/make\n# Automatically generated from RHIDE projects, don't edit\n#\n\n");
+
+ // Write the body to a temporal
+ char bNameT[12];
+ strcpy(bNameT,"mkXXXXXX");
+ int hT=mkstemp(bNameT);
+ FILE *fT=fdopen(hT,"wt");
+ if (hT==-1 || !fT)
+ {
+ fprintf(stderr,"Unable to create temporal\n");
+ exit(31);
+ }
+ GenerateAll(fT,mk);
+ fclose(fT);
+
+ // Write the variables now
+ if (mk.mainTarget && *mk.mainTarget)
+ {
+ char *ext=strrchr(mk.mainTarget,'.');
+ if (strcmp(ext,".exe")==0)
+ {
+ GenerateObjs(stdout,mk);
+ GenerateLibs(stdout,mk);
+ }
+ }
+
+ // Now copy the body
+ fT=fopen(bNameT,"rt");
+ if (!fT)
+ {
+ fprintf(stderr,"Unable to copy temporal\n");
+ exit(32);
+ }
+ char buffer[maxLine];
+ while (!feof(fT))
+ {
+ if (fgets(buffer,maxLine,fT))
+ fputs(buffer,stdout);
+ }
+ fclose(fT);
+ unlink(bNameT);
+}
+
+static
+void SetUpCurDir()
+{
+ char buf[PATH_MAX];
+ getcwd(buf,PATH_MAX);
+ char *mk=strstr(buf,"/make");
+ if (!mk)
+ {
+ fprintf(stderr,"We aren't in make directory\n");
+ exit(30);
+ }
+ mk[1]=0;
+ projectBase=strdup(buf);
+ projectBaseL=strlen(projectBase);
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc!=2)
+ {
+ printf("Usage: %s file.mak\n",argv[0]);
+ return 1;
+ }
+ stMak mak;
+ memset(&mak,0,sizeof(mak));
+ SetUpCurDir();
+ ProcessMakefile(argv[1],mak,0);
+ //ExtractSources();
+ return 0;
+}
+
diff --git a/setedit/makes/genimk.cc b/setedit/makes/genimk.cc
new file mode 100644
index 0000000..8b465d4
--- /dev/null
+++ b/setedit/makes/genimk.cc
@@ -0,0 +1,193 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2003 by Salvador Eduardo Tropea
+ Covered by the GPL license.
+ Description:
+ This program generates the .imk files from the .gpr files. To achieve it
+first creates the .mak files and then calls the extrimk.exe program.
+ It also generates a simplified version called .umk without extra
+dependencies, just the needed to get the executables.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <ctype.h>
+
+const int maxLine=256;
+
+static
+void ChangeExt(char *s, const char *newE)
+{
+ int l=strlen(s);
+ int lE=strlen(newE);
+ strcpy(s+(l-lE),newE);
+}
+
+// Needed to force a make of the wrong files.
+static
+void RemoveGen(int argc, char *argv[])
+{
+ int i;
+
+ for (i=2; i<argc; i++)
+ {
+ if (strstr(argv[i],".gpr"))
+ {
+ char *gpr=argv[i];
+ char *imk=strdup(gpr);
+ char *umk=strdup(gpr);
+ ChangeExt(imk,".imk");
+ ChangeExt(umk,".umk");
+ unlink(imk);
+ unlink(umk);
+ free(imk);
+ free(umk);
+ }
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc<3)
+ {
+ printf("Usage: genimk output main.gpr [other.gprs...]\n");
+ return 1;
+ }
+ const char *dest=argv[1];
+ const char *mainGpr=argv[2];
+ char *mainMak=strdup(mainGpr);
+ ChangeExt(mainMak,".mak");
+ printf("\nGenerating %s for %s (%s)\n",dest,mainGpr,mainMak);
+
+ int i;
+ unsigned lenTot=20;
+ for (i=0; i<argc; i++)
+ lenTot+=2+strlen(argv[i]);
+
+ char *b=new char[lenTot];
+ for (i=2; i<argc; i++)
+ {
+ if (strstr(argv[i],".gpr"))
+ {
+ char *gpr=argv[i];
+ char *mak=strdup(gpr);
+ ChangeExt(mak,".mak");
+
+ struct stat stGpr;
+ if (stat(gpr,&stGpr)!=0)
+ {
+ fprintf(stderr,"%s: Can't stat %s\n",argv[0],gpr);
+ return 20;
+ }
+
+ struct stat stMak;
+ if (stat(mak,&stMak)!=0 || stMak.st_mtime<stGpr.st_mtime)
+ {
+ printf("%s => %s\n",gpr,mak);
+ sprintf(b,"gprexp %s",gpr);
+ system(b);
+ sprintf(b,"gpr2mak %s",gpr);
+ system(b);
+ if (stat(mak,&stMak)!=0)
+ {
+ fprintf(stderr,"%s: Can't create .mak file for %s\n",argv[0],gpr);
+ return 21;
+ }
+ }
+
+ free(mak);
+ }
+ }
+ for (i=2; i<argc; i++)
+ {
+ if (strstr(argv[i],".gpr"))
+ {
+ char *gpr=argv[i];
+ char *mak=strdup(gpr);
+ char *imk=strdup(gpr);
+ char *umk=strdup(gpr);
+ ChangeExt(mak,".mak");
+ ChangeExt(imk,".imk");
+ ChangeExt(umk,".umk");
+
+ struct stat stImk;
+ printf("%s => %s\n",mak,imk);
+ sprintf(b,"./extrimk.exe %s > %s",mak,imk);
+ int ret=system(b);
+ if (ret)
+ {
+ RemoveGen(argc,argv);
+ return ret>256 ? ret>>8 : ret;
+ }
+ if (stat(mak,&stImk)!=0)
+ {
+ RemoveGen(argc,argv);
+ fprintf(stderr,"%s: Can't create .imk file for %s\n",argv[0],mak);
+ return 22;
+ }
+
+ printf("%s => %s\n",imk,umk);
+ FILE *ori=fopen(imk,"rt");
+ if (!ori)
+ {
+ RemoveGen(argc,argv);
+ fprintf(stderr,"%s: Can't open .imk file for %s\n",argv[0],mak);
+ return 23;
+ }
+ FILE *des=fopen(umk,"wt");
+ if (!des)
+ {
+ RemoveGen(argc,argv);
+ fprintf(stderr,"%s: Can't create .umk file for %s\n",argv[0],mak);
+ return 24;
+ }
+ char b[maxLine], *sep;
+ int skip=0;
+ while (fgets(b,maxLine,ori))
+ {
+ if ((isalpha(b[0]) || b[0]=='.') && (sep=strchr(b,':'))!=0)
+ {
+ char *ext=sep-1;
+ for (;*ext!='$' && ext>b; ext--);
+ if (*ext!='$')
+ {
+ fprintf(stderr,"%s: Parser error (ext): %s\n",argv[0],b);
+ RemoveGen(argc,argv);
+ return 25;
+ }
+ if (ext[4]=='O')
+ {// That's an object, only the first is relevant.
+ for (;*sep && *sep!='\\'; sep++);
+ if (*sep) *sep=' ';
+ skip=1;
+ fputs(b,des);
+ continue;
+ }
+ }
+ if (skip)
+ {
+ char *slash=b;
+ for (;*slash && *slash!='\\'; slash++);
+ if (!*slash)
+ skip=0;
+ }
+ else
+ fputs(b,des);
+ }
+ fclose(des);
+ fclose(ori);
+
+ free(mak);
+ free(imk);
+ free(umk);
+ }
+ }
+
+ printf("\n");
+ return 0;
+}
+
diff --git a/setedit/makes/includer.bmk b/setedit/makes/includer.bmk
new file mode 100644
index 0000000..117c2a8
--- /dev/null
+++ b/setedit/makes/includer.bmk
@@ -0,0 +1,35 @@
+#!/usr/bin/make
+# This file is to absorve the difference between GNU Make's include directive
+# and Borland's !include directive. :-(
+#
+!ifdef INCLUDE00
+!include $(INCLUDE00)
+!endif
+!ifdef INCLUDE01
+!include $(INCLUDE01)
+!endif
+!ifdef INCLUDE02
+!include $(INCLUDE02)
+!endif
+!ifdef INCLUDE03
+!include $(INCLUDE03)
+!endif
+!ifdef INCLUDE04
+!include $(INCLUDE04)
+!endif
+!ifdef INCLUDE05
+!include $(INCLUDE05)
+!endif
+!ifdef INCLUDE06
+!include $(INCLUDE06)
+!endif
+!ifdef INCLUDE07
+!include $(INCLUDE07)
+!endif
+!ifdef INCLUDE08
+!include $(INCLUDE08)
+!endif
+!ifdef INCLUDE09
+!include $(INCLUDE09)
+!endif
+
diff --git a/setedit/makes/includer.imk b/setedit/makes/includer.imk
new file mode 100644
index 0000000..ce82fac
--- /dev/null
+++ b/setedit/makes/includer.imk
@@ -0,0 +1,35 @@
+#!/usr/bin/make
+# This file is to absorve the difference between GNU Make's include directive
+# and Borland's !include directive. :-(
+#
+ifdef INCLUDE00
+include $(INCLUDE00)
+endif
+ifdef INCLUDE01
+include $(INCLUDE01)
+endif
+ifdef INCLUDE02
+include $(INCLUDE02)
+endif
+ifdef INCLUDE03
+include $(INCLUDE03)
+endif
+ifdef INCLUDE04
+include $(INCLUDE04)
+endif
+ifdef INCLUDE05
+include $(INCLUDE05)
+endif
+ifdef INCLUDE06
+include $(INCLUDE06)
+endif
+ifdef INCLUDE07
+include $(INCLUDE07)
+endif
+ifdef INCLUDE08
+include $(INCLUDE08)
+endif
+ifdef INCLUDE09
+include $(INCLUDE09)
+endif
+
diff --git a/setedit/makes/inffd.gpr b/setedit/makes/inffd.gpr
new file mode 100644
index 0000000..d9f5363
--- /dev/null
+++ b/setedit/makes/inffd.gpr
Binary files differ
diff --git a/setedit/makes/inffd.imk b/setedit/makes/inffd.imk
new file mode 100644
index 0000000..33a36ff
--- /dev/null
+++ b/setedit/makes/inffd.imk
@@ -0,0 +1,378 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+obj/inf$(ExOBJ):: ../infview/inf.cc \
+ ced_coma.h \
+ ced_exte.h \
+ ced_pcre.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ dyncat.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tprogrdi.h \
+ tprogres.h \
+ tv.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/findrepl.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menus.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/infbase$(ExOBJ):: ../infview/infbase.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ gzfiles.h \
+ infbase.h \
+ infbaser.h \
+ rhutils.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tprogdia.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/manview$(ExOBJ):: ../infview/manview.cc \
+ ced_coma.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ diaghelp.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ manview.h \
+ rhutils.h \
+ settvuti.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nhiscoll$(ExOBJ):: ../infview/names/nhiscoll.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ninfview$(ExOBJ):: ../infview/names/ninfview.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ninfwind$(ExOBJ):: ../infview/names/ninfwind.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nmanwind$(ExOBJ):: ../infview/names/nmanwind.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sinf$(ExOBJ):: ../infview/streams/sinf.cc \
+ compatlayer.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sman$(ExOBJ):: ../infview/streams/sman.cc \
+ compatlayer.h \
+ manview.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/inffd.umk b/setedit/makes/inffd.umk
new file mode 100644
index 0000000..18b780b
--- /dev/null
+++ b/setedit/makes/inffd.umk
@@ -0,0 +1,31 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+obj/inf$(ExOBJ):: ../infview/inf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/infbase$(ExOBJ):: ../infview/infbase.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/manview$(ExOBJ):: ../infview/manview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nhiscoll$(ExOBJ):: ../infview/names/nhiscoll.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ninfview$(ExOBJ):: ../infview/names/ninfview.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ninfwind$(ExOBJ):: ../infview/names/ninfwind.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nmanwind$(ExOBJ):: ../infview/names/nmanwind.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sinf$(ExOBJ):: ../infview/streams/sinf.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sman$(ExOBJ):: ../infview/streams/sman.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/infview.bmk b/setedit/makes/infview.bmk
new file mode 100644
index 0000000..5feb357
--- /dev/null
+++ b/setedit/makes/infview.bmk
@@ -0,0 +1,68 @@
+#!/usr/bin/make
+#
+# Copyright (c) 2003-2005 by Salvador E. Tropea
+# Covered by the GPL license.
+#
+# This is the Borland C++ makefile for the editor.
+# Also used by the MSVC makefile.
+#
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+SRCD1=../infview;../extra;../mp3;../easydiag;../infview/names
+SRCD2=../infview/streams;../librhuti;../settvuti;../settvuti/names
+SRCD3=../settvuti/streams;../mainsrc
+SRCDIRS=$(SRCD1);$(SRCD2);$(SRCD3)
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_PREV_DIR=..
+INCLUDE_DIRS=-I../winnt -I$(INCLUDE_DIR) -I$(SETEDIT_INC_DIR) -I$(SETTVUTI_INC_DIR) \
+ -I$(INFVIEW_INC_DIR) $(TVISION_INC) -I$(EXTRA_INC_DIR) \
+ -I$(EASYDIAG_INC_DIR) -I$(LIBRHUTI_INC_DIR) -I..\libz -I..\libpcre -I..\libbzip2
+C_EXTRA_FLAGS=-DFOR_EDITOR
+RHIDE_LIBS=..\libz\zlib.lib ..\libpcre\pcre.lib ..\libbzip2\bzip2.lib \
+ $(TVLIBDIR)\librhtv.lib
+OBJ_DIR=objinf
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+all: infview.exe
+
+!ifndef MKF_EXT
+MKF_EXT=.bmk
+!endif
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+!include common$(MKF_EXT)
+
+#
+# All the RHIDE data should come from here.
+#
+ExIMK=.umk
+!include infview$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+!include includer.bmk
+
diff --git a/setedit/makes/infview.gpr b/setedit/makes/infview.gpr
new file mode 100644
index 0000000..9645f39
--- /dev/null
+++ b/setedit/makes/infview.gpr
Binary files differ
diff --git a/setedit/makes/infview.imk b/setedit/makes/infview.imk
new file mode 100644
index 0000000..e2c45ca
--- /dev/null
+++ b/setedit/makes/infview.imk
@@ -0,0 +1,635 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ objinf/dyncat$(ExOBJ) \
+ objinf/fstrcmp$(ExOBJ) \
+ objinf/gzfiles$(ExOBJ) \
+ objinf/inf$(ExOBJ) \
+ objinf/infbase$(ExOBJ) \
+ objinf/infdummy$(ExOBJ) \
+ objinf/infmain$(ExOBJ) \
+ objinf/infmenu$(ExOBJ) \
+ objinf/manview$(ExOBJ) \
+ objinf/nhiscoll$(ExOBJ) \
+ objinf/ninfview$(ExOBJ) \
+ objinf/ninfwind$(ExOBJ) \
+ objinf/nmanwind$(ExOBJ) \
+ objinf/sinf$(ExOBJ) \
+ objinf/sman$(ExOBJ) \
+ objinf/strncpyz$(ExOBJ)
+
+LIBRARIES=\
+ librhuti$(ExLIB) \
+ libsettv$(ExLIB) \
+ libeasyd$(ExLIB)
+
+infview$(ExEXE):: \
+ objinf/dyncat$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ objinf/fstrcmp$(ExOBJ) \
+ objinf/gzfiles$(ExOBJ) \
+ objinf/inf$(ExOBJ) \
+ objinf/infbase$(ExOBJ) \
+ objinf/infdummy$(ExOBJ) \
+ objinf/infmain$(ExOBJ) \
+ objinf/infmenu$(ExOBJ) \
+ librhuti$(ExLIB) \
+ objinf/manview$(ExOBJ) \
+ objinf/nhiscoll$(ExOBJ) \
+ objinf/ninfview$(ExOBJ) \
+ objinf/ninfwind$(ExOBJ) \
+ objinf/nmanwind$(ExOBJ) \
+ libsettv$(ExLIB) \
+ objinf/sinf$(ExOBJ) \
+ objinf/sman$(ExOBJ) \
+ objinf/strncpyz$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+objinf/dyncat$(ExOBJ):: ../extra/dyncat.cc \
+ configed.h \
+ dyncat.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=easydiag$(ExIMK)
+
+objinf/fstrcmp$(ExOBJ):: ../mainsrc/fstrcmp.c \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+objinf/gzfiles$(ExOBJ):: ../mainsrc/gzfiles.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ gzfiles.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/inf$(ExOBJ):: ../infview/inf.cc \
+ ced_coma.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ dyncat.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tprogrdi.h \
+ tprogres.h \
+ tv.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/findrepl.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menus.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/infbase$(ExOBJ):: ../infview/infbase.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ gzfiles.h \
+ infbase.h \
+ infbaser.h \
+ rhutils.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tprogdia.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/infdummy$(ExOBJ):: ../infview/infdummy.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/infmain$(ExOBJ):: ../infview/infmain.cc \
+ ced_coma.h \
+ ceditint.h \
+ ceditor.h \
+ codepage.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ inf.h \
+ infalone.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ manview.h \
+ pal.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/chdirdlg.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/editors.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menus.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/infmenu$(ExOBJ):: ../infview/infmenu.cc \
+ ced_coma.h \
+ ceditor.h \
+ compatlayer.h \
+ inf.h \
+ infalone.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/cmdset.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/editors.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menubar.h \
+ tv/menuitem.h \
+ tv/menus.h \
+ tv/menuview.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/statsdef.h \
+ tv/statsitm.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/submenu.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE01=librhuti$(ExIMK)
+
+objinf/manview$(ExOBJ):: ../infview/manview.cc \
+ ced_coma.h \
+ ceditor.h \
+ cl/unistd.h \
+ codepage.h \
+ compatlayer.h \
+ diaghelp.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ manview.h \
+ rhutils.h \
+ settvuti.h \
+ tsbutton.h \
+ tsinplin.h \
+ tslabel.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/nhiscoll$(ExOBJ):: ../infview/names/nhiscoll.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/ninfview$(ExOBJ):: ../infview/names/ninfview.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/ninfwind$(ExOBJ):: ../infview/names/ninfwind.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/nmanwind$(ExOBJ):: ../infview/names/nmanwind.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE02=settv$(ExIMK)
+
+objinf/sinf$(ExOBJ):: ../infview/streams/sinf.cc \
+ compatlayer.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/sman$(ExOBJ):: ../infview/streams/sman.cc \
+ compatlayer.h \
+ manview.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scroller.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objinf/strncpyz$(ExOBJ):: ../extra/strncpyz.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/infview.mkf b/setedit/makes/infview.mkf
new file mode 100644
index 0000000..baea788
--- /dev/null
+++ b/setedit/makes/infview.mkf
@@ -0,0 +1,56 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=../infview ../extra ../mp3 ../easydiag ../infview/names ../infview/streams \
+ ../librhuti ../settvuti ../settvuti/names ../settvuti/streams ../mainsrc
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_PREV_DIR=..
+INCLUDE_DIRS=$(INCLUDE_DIR) $(SETEDIT_INC_DIR) $(SETTVUTI_INC_DIR) \
+ $(SDG_INC_DIR) $(INFVIEW_INC_DIR) $(TVISION_INC) $(EXTRA_INC_DIR) \
+ $(EASYDIAG_INC_DIR) $(LIBRHUTI_INC_DIR) $(SUPPORT_INC) \
+ $(MP3_INC_DIR) $(CALCU_INC_DIR)
+C_EXTRA_FLAGS=-DFOR_EDITOR
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+ifdef MAINTAINER_MODE
+ ExIMK=.imk
+else
+ ExIMK=.umk
+endif
+include infview$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/setedit/makes/infview.umk b/setedit/makes/infview.umk
new file mode 100644
index 0000000..2c05129
--- /dev/null
+++ b/setedit/makes/infview.umk
@@ -0,0 +1,104 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ objinf/dyncat$(ExOBJ) \
+ objinf/fstrcmp$(ExOBJ) \
+ objinf/gzfiles$(ExOBJ) \
+ objinf/inf$(ExOBJ) \
+ objinf/infbase$(ExOBJ) \
+ objinf/infdummy$(ExOBJ) \
+ objinf/infmain$(ExOBJ) \
+ objinf/infmenu$(ExOBJ) \
+ objinf/manview$(ExOBJ) \
+ objinf/nhiscoll$(ExOBJ) \
+ objinf/ninfview$(ExOBJ) \
+ objinf/ninfwind$(ExOBJ) \
+ objinf/nmanwind$(ExOBJ) \
+ objinf/sinf$(ExOBJ) \
+ objinf/sman$(ExOBJ) \
+ objinf/strncpyz$(ExOBJ)
+
+LIBRARIES=\
+ librhuti$(ExLIB) \
+ libsettv$(ExLIB) \
+ libeasyd$(ExLIB)
+
+infview$(ExEXE):: \
+ objinf/dyncat$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ objinf/fstrcmp$(ExOBJ) \
+ objinf/gzfiles$(ExOBJ) \
+ objinf/inf$(ExOBJ) \
+ objinf/infbase$(ExOBJ) \
+ objinf/infdummy$(ExOBJ) \
+ objinf/infmain$(ExOBJ) \
+ objinf/infmenu$(ExOBJ) \
+ librhuti$(ExLIB) \
+ objinf/manview$(ExOBJ) \
+ objinf/nhiscoll$(ExOBJ) \
+ objinf/ninfview$(ExOBJ) \
+ objinf/ninfwind$(ExOBJ) \
+ objinf/nmanwind$(ExOBJ) \
+ libsettv$(ExLIB) \
+ objinf/sinf$(ExOBJ) \
+ objinf/sman$(ExOBJ) \
+ objinf/strncpyz$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+objinf/dyncat$(ExOBJ):: ../extra/dyncat.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=easydiag$(ExIMK)
+
+objinf/fstrcmp$(ExOBJ):: ../mainsrc/fstrcmp.c
+ $(RHIDE_COMPILE_C)
+
+objinf/gzfiles$(ExOBJ):: ../mainsrc/gzfiles.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/inf$(ExOBJ):: ../infview/inf.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/infbase$(ExOBJ):: ../infview/infbase.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/infdummy$(ExOBJ):: ../infview/infdummy.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/infmain$(ExOBJ):: ../infview/infmain.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/infmenu$(ExOBJ):: ../infview/infmenu.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE01=librhuti$(ExIMK)
+
+objinf/manview$(ExOBJ):: ../infview/manview.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/nhiscoll$(ExOBJ):: ../infview/names/nhiscoll.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/ninfview$(ExOBJ):: ../infview/names/ninfview.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/ninfwind$(ExOBJ):: ../infview/names/ninfwind.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/nmanwind$(ExOBJ):: ../infview/names/nmanwind.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE02=settv$(ExIMK)
+
+objinf/sinf$(ExOBJ):: ../infview/streams/sinf.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/sman$(ExOBJ):: ../infview/streams/sman.cc
+ $(RHIDE_COMPILE_CC)
+
+objinf/strncpyz$(ExOBJ):: ../extra/strncpyz.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/install.gpr b/setedit/makes/install.gpr
new file mode 100644
index 0000000..2453530
--- /dev/null
+++ b/setedit/makes/install.gpr
Binary files differ
diff --git a/setedit/makes/install.imk b/setedit/makes/install.imk
new file mode 100644
index 0000000..c06df91
--- /dev/null
+++ b/setedit/makes/install.imk
@@ -0,0 +1,133 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ obj/datafile$(ExOBJ) \
+ obj/install$(ExOBJ) \
+ obj/nostatex$(ExOBJ) \
+ obj/nprogbar$(ExOBJ) \
+ obj/nprogres$(ExOBJ) \
+ obj/tprogbar$(ExOBJ) \
+ obj/tprogdia$(ExOBJ) \
+ obj/tprogres$(ExOBJ)
+
+LIBRARIES=\
+ libeasyd$(ExLIB)
+
+../install/install$(ExEXE):: \
+ obj/datafile$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ obj/install$(ExOBJ) \
+ obj/nostatex$(ExOBJ) \
+ obj/nprogbar$(ExOBJ) \
+ obj/nprogres$(ExOBJ) \
+ obj/tprogbar$(ExOBJ) \
+ obj/tprogdia$(ExOBJ) \
+ obj/tprogres$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+obj/datafile$(ExOBJ):: datafile.c \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+INCLUDE00=easydiag$(ExIMK)
+
+obj/install$(ExOBJ):: install.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ nostatex.h \
+ settvuti.h \
+ snostate.h \
+ tprogdia.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tstatext.h \
+ tstextsc.h \
+ tsview.h \
+ tsviewco.h \
+ ttextscr.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/cmdset.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/editors.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/menus.h \
+ tv/msgbox.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/statsdef.h \
+ tv/statsitm.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nostatex$(ExOBJ):: ../settvuti/nostatex.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogbar$(ExOBJ):: ../settvuti/names/nprogbar.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogres$(ExOBJ):: ../settvuti/names/nprogres.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogbar$(ExOBJ):: ../settvuti/tprogbar.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogdia$(ExOBJ):: ../settvuti/tprogdia.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogres$(ExOBJ):: ../settvuti/tprogres.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/install.mkf b/setedit/makes/install.mkf
new file mode 100644
index 0000000..e19f3cf
--- /dev/null
+++ b/setedit/makes/install.mkf
@@ -0,0 +1,58 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=../install ../easydiag ../settvuti ../settvuti/names ../settvuti/streams
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+SDG_INC_DIR=../sdg/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_INC_DIR=../mp3
+CALCU_INC_DIR=../calcu
+INCLUDE_DIRS=$(INCLUDE_DIR) $(SETEDIT_INC_DIR) $(SETTVUTI_INC_DIR) \
+ $(SDG_INC_DIR) $(INFVIEW_INC_DIR) $(TVISION_INC) $(EXTRA_INC_DIR) \
+ $(EASYDIAG_INC_DIR) $(LIBRHUTI_INC_DIR) $(SUPPORT_INC) \
+ $(MP3_INC_DIR) $(CALCU_INC_DIR)
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include common.imk
+# This is specific for this project
+RHIDE_OS_LIBS:=$(RHIDE_OS_LIBS) -lwin
+
+#
+# All the RHIDE data should come from here.
+#
+ifdef MAINTAINER_MODE
+ ExIMK=.imk
+else
+ ExIMK=.umk
+endif
+include install$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/setedit/makes/install.umk b/setedit/makes/install.umk
new file mode 100644
index 0000000..cf53436
--- /dev/null
+++ b/setedit/makes/install.umk
@@ -0,0 +1,56 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ obj/datafile$(ExOBJ) \
+ obj/install$(ExOBJ) \
+ obj/nostatex$(ExOBJ) \
+ obj/nprogbar$(ExOBJ) \
+ obj/nprogres$(ExOBJ) \
+ obj/tprogbar$(ExOBJ) \
+ obj/tprogdia$(ExOBJ) \
+ obj/tprogres$(ExOBJ)
+
+LIBRARIES=\
+ libeasyd$(ExLIB)
+
+../install/install$(ExEXE):: \
+ obj/datafile$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ obj/install$(ExOBJ) \
+ obj/nostatex$(ExOBJ) \
+ obj/nprogbar$(ExOBJ) \
+ obj/nprogres$(ExOBJ) \
+ obj/tprogbar$(ExOBJ) \
+ obj/tprogdia$(ExOBJ) \
+ obj/tprogres$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+obj/datafile$(ExOBJ):: datafile.c
+ $(RHIDE_COMPILE_C)
+
+INCLUDE00=easydiag$(ExIMK)
+
+obj/install$(ExOBJ):: install.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nostatex$(ExOBJ):: ../settvuti/nostatex.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogbar$(ExOBJ):: ../settvuti/names/nprogbar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogres$(ExOBJ):: ../settvuti/names/nprogres.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogbar$(ExOBJ):: ../settvuti/tprogbar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogdia$(ExOBJ):: ../settvuti/tprogdia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogres$(ExOBJ):: ../settvuti/tprogres.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/librhuti.gpr b/setedit/makes/librhuti.gpr
new file mode 100644
index 0000000..a3d16cd
--- /dev/null
+++ b/setedit/makes/librhuti.gpr
Binary files differ
diff --git a/setedit/makes/librhuti.imk b/setedit/makes/librhuti.imk
new file mode 100644
index 0000000..306f408
--- /dev/null
+++ b/setedit/makes/librhuti.imk
@@ -0,0 +1,81 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+librhuti$(ExLIB):: \
+ obj/abstorel$(ExOBJ) \
+ obj/back2sl$(ExOBJ) \
+ obj/basename$(ExOBJ) \
+ obj/fexpand$(ExOBJ) \
+ obj/io$(ExOBJ) \
+ obj/specs$(ExOBJ) \
+ obj/splitfn$(ExOBJ) \
+ obj/stricat$(ExOBJ) \
+ obj/stridown$(ExOBJ) \
+ obj/stridup$(ExOBJ) \
+ obj/strifree$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/abstorel$(ExOBJ):: ../librhuti/abstorel.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/back2sl$(ExOBJ):: ../librhuti/back2sl.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/basename$(ExOBJ):: ../librhuti/basename.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fexpand$(ExOBJ):: ../librhuti/fexpand.cc \
+ compatlayer.h \
+ rhutils.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/io$(ExOBJ):: ../librhuti/io.cc \
+ cl/unistd.h \
+ compatlayer.h \
+ rhutils.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/specs$(ExOBJ):: ../librhuti/specs.cc \
+ compatlayer.h \
+ rhutils.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/splitfn$(ExOBJ):: ../librhuti/splitfn.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/stricat$(ExOBJ):: ../librhuti/stricat.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/stridown$(ExOBJ):: ../librhuti/stridown.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/stridup$(ExOBJ):: ../librhuti/stridup.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/strifree$(ExOBJ):: ../librhuti/strifree.cc \
+ rhutils.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/librhuti.umk b/setedit/makes/librhuti.umk
new file mode 100644
index 0000000..311a2c0
--- /dev/null
+++ b/setedit/makes/librhuti.umk
@@ -0,0 +1,52 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+librhuti$(ExLIB):: \
+ obj/abstorel$(ExOBJ) \
+ obj/back2sl$(ExOBJ) \
+ obj/basename$(ExOBJ) \
+ obj/fexpand$(ExOBJ) \
+ obj/io$(ExOBJ) \
+ obj/specs$(ExOBJ) \
+ obj/splitfn$(ExOBJ) \
+ obj/stricat$(ExOBJ) \
+ obj/stridown$(ExOBJ) \
+ obj/stridup$(ExOBJ) \
+ obj/strifree$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/abstorel$(ExOBJ):: ../librhuti/abstorel.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/back2sl$(ExOBJ):: ../librhuti/back2sl.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/basename$(ExOBJ):: ../librhuti/basename.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fexpand$(ExOBJ):: ../librhuti/fexpand.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/io$(ExOBJ):: ../librhuti/io.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/specs$(ExOBJ):: ../librhuti/specs.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/splitfn$(ExOBJ):: ../librhuti/splitfn.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/stricat$(ExOBJ):: ../librhuti/stricat.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/stridown$(ExOBJ):: ../librhuti/stridown.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/stridup$(ExOBJ):: ../librhuti/stridup.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/strifree$(ExOBJ):: ../librhuti/strifree.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/libset.gpr b/setedit/makes/libset.gpr
new file mode 100644
index 0000000..5ce6bf3
--- /dev/null
+++ b/setedit/makes/libset.gpr
Binary files differ
diff --git a/setedit/makes/libset.imk b/setedit/makes/libset.imk
new file mode 100644
index 0000000..90e3546
--- /dev/null
+++ b/setedit/makes/libset.imk
@@ -0,0 +1,2350 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+libset$(ExLIB):: \
+ objlib/bufun$(ExOBJ) \
+ objlib/calcu$(ExOBJ) \
+ objlib/ceditor$(ExOBJ) \
+ objlib/completi$(ExOBJ) \
+ objlib/deedidia$(ExOBJ) \
+ objlib/doedidia$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ objlib/edconst$(ExOBJ) \
+ objlib/editorfo$(ExOBJ) \
+ objlib/editwind$(ExOBJ) \
+ objlib/edkeys$(ExOBJ) \
+ objlib/edprint$(ExOBJ) \
+ objlib/edspecs$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ objlib/gzfiles$(ExOBJ) \
+ objlib/inf$(ExOBJ) \
+ objlib/infbase$(ExOBJ) \
+ objlib/keytrans$(ExOBJ) \
+ objlib/linelen$(ExOBJ) \
+ objlib/loaddefl$(ExOBJ) \
+ objlib/loadfunc$(ExOBJ) \
+ objlib/loadshl$(ExOBJ) \
+ objlib/loadusew$(ExOBJ) \
+ objlib/macrocom$(ExOBJ) \
+ objlib/mli$(ExOBJ) \
+ objlib/mliasimp$(ExOBJ) \
+ objlib/mlicsdg$(ExOBJ) \
+ objlib/mliediti$(ExOBJ) \
+ objlib/mliedito$(ExOBJ) \
+ objlib/mlisdg$(ExOBJ) \
+ objlib/nceditor$(ExOBJ) \
+ objlib/neditwin$(ExOBJ) \
+ objlib/nfileedi$(ExOBJ) \
+ objlib/nhiscoll$(ExOBJ) \
+ objlib/ninfview$(ExOBJ) \
+ objlib/ninfwind$(ExOBJ) \
+ objlib/nostatex$(ExOBJ) \
+ objlib/nsindica$(ExOBJ) \
+ objlib/parser$(ExOBJ) \
+ objlib/pathtool$(ExOBJ) \
+ objlib/pclipper$(ExOBJ) \
+ objlib/pmacros$(ExOBJ) \
+ objlib/pperl$(ExOBJ) \
+ objlib/pphp$(ExOBJ) \
+ objlib/ppython$(ExOBJ) \
+ objlib/pvarious$(ExOBJ) \
+ objlib/pvhdl$(ExOBJ) \
+ objlib/rhideint$(ExOBJ) \
+ objlib/sceditor$(ExOBJ) \
+ objlib/sdginter$(ExOBJ) \
+ objlib/search$(ExOBJ) \
+ libsettv$(ExLIB) \
+ objlib/sinf$(ExOBJ) \
+ objlib/slpinter$(ExOBJ) \
+ objlib/splinman$(ExOBJ) \
+ objlib/ssindica$(ExOBJ) \
+ objlib/tsindica$(ExOBJ) \
+ objlib/txhgen$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+objlib/bufun$(ExOBJ):: ../mainsrc/bufun.cc \
+ bufun.h \
+ ced_coma.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edmsg.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ splinman.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortva.h \
+ tssosslb.h \
+ tstatext.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/calcu$(ExOBJ):: ../calcu/calcu.cc \
+ calcu.h \
+ ced_clas.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ edhists.h \
+ editcoma.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tinppipe.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/ceditor$(ExOBJ):: ../mainsrc/ceditor.cc \
+ advice.h \
+ bufun.h \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ cl/unistd.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ edhists.h \
+ gzfiles.h \
+ keytrans.h \
+ loadkbin.h \
+ loadshl.h \
+ pathtool.h \
+ pmcoll.h \
+ rhutils.h \
+ sarray.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ slpinter.h \
+ tnocastc.h \
+ tprogdia.h \
+ tstringa.h \
+ tstrlbox.h \
+ tv.h \
+ tv/app.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/colorsel.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/findrepl.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/lstviewr.h \
+ tv/menubox.h \
+ tv/menuitem.h \
+ tv/menus.h \
+ tv/menuview.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/submenu.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/completi$(ExOBJ):: ../mainsrc/completi.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditor.h \
+ compatlayer.h \
+ completi.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/deedidia$(ExOBJ):: ../mainsrc/deedidia.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ editcoma.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tinppipe.h \
+ tnocastc.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tsinplpi.h \
+ tslabel.h \
+ tslistbo.h \
+ tsradbot.h \
+ tssortlb.h \
+ tssortva.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tstsorlb.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/doedidia$(ExOBJ):: ../mainsrc/doedidia.cc \
+ bufun.h \
+ ced_coma.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ setconst.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/app.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=easydiag$(ExIMK)
+
+objlib/edconst$(ExOBJ):: ../mainsrc/edconst.cc \
+ ced_coma.h \
+ ced_inte.h \
+ ceditor.h \
+ compatlayer.h \
+ editcoma.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tinppipe.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/editorfo$(ExOBJ):: ../mainsrc/editorfo.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/editwind$(ExOBJ):: ../mainsrc/editwind.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/edkeys$(ExOBJ):: ../setedit/edkeys.cc \
+ ced_coma.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ dyncat.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ editcoma.h \
+ edmsg.h \
+ inputsca.h \
+ keytrans.h \
+ loadkbin.h \
+ mli.h \
+ mlieditd.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tslabel.h \
+ tstatext.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/cluster.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/gkey.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/edprint$(ExOBJ):: ../setedit/edprint.cc \
+ ceditint.h \
+ cl/unistd.h \
+ compatlayer.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edmsg.h \
+ setapp.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tsradbot.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/sitem.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/edspecs$(ExOBJ):: ../mainsrc/edspecs.cc \
+ ced_inte.h \
+ compatlayer.h \
+ edspecs.h \
+ pathtool.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE01=extra$(ExIMK)
+
+objlib/gzfiles$(ExOBJ):: ../mainsrc/gzfiles.cc \
+ ceditint.h \
+ cl/unistd.h \
+ compatlayer.h \
+ configed.h \
+ gzfiles.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/inf$(ExOBJ):: ../infview/inf.cc \
+ ced_coma.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ diaghelp.h \
+ dyncat.h \
+ edhists.h \
+ fileopen.h \
+ fiopeaid.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tprogrdi.h \
+ tprogres.h \
+ tv.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/cmdset.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filedlg.h \
+ tv/findrepl.h \
+ tv/frame.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/menus.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/osclipboard.h \
+ tv/palette.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/statslin.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/infbase$(ExOBJ):: ../infview/infbase.cc \
+ ceditint.h \
+ cl/unistd.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ gzfiles.h \
+ infbase.h \
+ infbaser.h \
+ rhutils.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tprogdia.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/keytrans$(ExOBJ):: ../mainsrc/keytrans.cc \
+ ced_coma.h \
+ ced_exte.h \
+ ceditor.h \
+ compatlayer.h \
+ dyncat.h \
+ keytrans.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/event.h \
+ tv/gkey.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeyext.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/linelen$(ExOBJ):: ../mainsrc/linelen.cc \
+ ced_clas.h \
+ ceditor.h \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/loaddefl$(ExOBJ):: ../mainsrc/loaddefl.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditor.h \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ loadshl.h \
+ pathtool.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/loadfunc$(ExOBJ):: ../mainsrc/loadfunc.cc \
+ compatlayer.h \
+ pathtool.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/loadshl$(ExOBJ):: ../mainsrc/loadshl.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ dyncat.h \
+ loadshl.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/loadusew$(ExOBJ):: ../mainsrc/loadusew.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditor.h \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ loadshl.h \
+ pathtool.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tdiagaid.h \
+ tdiagrow.h \
+ tnocastc.h \
+ tsbutton.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tslabel.h \
+ tslistbo.h \
+ tssortlb.h \
+ tssortva.h \
+ tstringa.h \
+ tstrlbox.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/macrocom$(ExOBJ):: ../mainsrc/macrocom.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ slpinter.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/mli$(ExOBJ):: ../sdg/mli.cc \
+ compatlayer.h \
+ dyncat.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlivar.h \
+ pathtool.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/mliasimp$(ExOBJ):: ../sdg/mliasimp.cc \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlivar.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/mlicsdg$(ExOBJ):: ../sdg/mlicsdg.cc \
+ compatlayer.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlicsdg.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ ucdefs.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/mliediti$(ExOBJ):: ../sdg/mliediti.cc \
+ compatlayer.h \
+ edmsg.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlieditd.h \
+ mliedito.h \
+ mlivar.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/mliedito$(ExOBJ):: ../sdg/mliedito.cc \
+ ced_coma.h \
+ ceditor.h \
+ compatlayer.h \
+ dyncat.h \
+ edmsg.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlieditd.h \
+ mliedito.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ rhutils.h \
+ runprog.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/mlisdg$(ExOBJ):: ../sdg/mlisdg.cc \
+ compatlayer.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlicsdg.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/nceditor$(ExOBJ):: ../names/nceditor.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/neditwin$(ExOBJ):: ../names/neditwin.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/nfileedi$(ExOBJ):: ../names/nfileedi.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/nhiscoll$(ExOBJ):: ../infview/names/nhiscoll.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/ninfview$(ExOBJ):: ../infview/names/ninfview.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/ninfwind$(ExOBJ):: ../infview/names/ninfwind.cc \
+ compatlayer.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/nostatex$(ExOBJ):: ../settvuti/nostatex.cc \
+ compatlayer.h \
+ nostatex.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/nsindica$(ExOBJ):: ../names/nsindica.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/parser$(ExOBJ):: ../calcu/parser.c \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+objlib/pathtool$(ExOBJ):: ../mainsrc/pathtool.cc \
+ ceditint.h \
+ cl/unistd.h \
+ compatlayer.h \
+ configed.h \
+ pathlist.h \
+ pathtool.h \
+ rhutils.h \
+ setapp.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/pclipper$(ExOBJ):: ../mainsrc/pclipper.cc \
+ bufun.h \
+ compatlayer.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/pmacros$(ExOBJ):: ../mainsrc/pmacros.cc \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ settvuti.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/pperl$(ExOBJ):: ../mainsrc/pperl.cc \
+ bufun.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/pphp$(ExOBJ):: ../mainsrc/pphp.cc \
+ bufun.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/ppython$(ExOBJ):: ../mainsrc/ppython.cc \
+ bufun.h \
+ compatlayer.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/pvarious$(ExOBJ):: ../mainsrc/pvarious.cc \
+ bufun.h \
+ compatlayer.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/pvhdl$(ExOBJ):: ../mainsrc/pvhdl.cc \
+ bufun.h \
+ compatlayer.h \
+ tv/configtv.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/rhideint$(ExOBJ):: ../mainsrc/rhideint.cc \
+ ced_exte.h \
+ cl/unistd.h \
+ compatlayer.h \
+ edmsg.h \
+ rhutils.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/sceditor$(ExOBJ):: ../streams/sceditor.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/sdginter$(ExOBJ):: ../mainsrc/sdginter.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ tv.h \
+ tv/configtv.h \
+ tv/fpbase.h \
+ tv/fpstream.h \
+ tv/intl.h \
+ tv/iopstrm.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/search$(ExOBJ):: ../mainsrc/search.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ configed.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE02=settv$(ExIMK)
+
+objlib/sinf$(ExOBJ):: ../infview/streams/sinf.cc \
+ compatlayer.h \
+ inf.h \
+ infbase.h \
+ infbaser.h \
+ infr.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/slpinter$(ExOBJ):: ../mainsrc/slpinter.cc \
+ ced_clas.h \
+ ced_coma.h \
+ ced_exte.h \
+ ceditint.h \
+ ceditor.h \
+ compatlayer.h \
+ completi.h \
+ configed.h \
+ easydia1.h \
+ easydiag.h \
+ edhists.h \
+ edmsg.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlieditd.h \
+ mliedito.h \
+ mlivar.h \
+ pmcoll.h \
+ sarray.h \
+ setapp.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ slpinter.h \
+ tinppipe.h \
+ tnocastc.h \
+ tsbutton.h \
+ tsinplpi.h \
+ tslabel.h \
+ tstringa.h \
+ tsview.h \
+ tsviewco.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/indicato.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/msgbox.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/splinman$(ExOBJ):: ../mainsrc/splinman.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ced_inte.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ splinman.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/ssindica$(ExOBJ):: ../streams/ssindica.cc \
+ ceditor.h \
+ compatlayer.h \
+ settvuti.h \
+ sindicat.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/tsindica$(ExOBJ):: ../mainsrc/tsindica.cc \
+ ced_clas.h \
+ ced_exte.h \
+ ceditor.h \
+ compatlayer.h \
+ pmcoll.h \
+ sarray.h \
+ setstack.h \
+ settvuti.h \
+ sindicat.h \
+ tnocastc.h \
+ tstringa.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/indicato.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/resource.h \
+ tv/screen.h \
+ tv/scrlbar.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ viewplus.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objlib/txhgen$(ExOBJ):: ../sdg/txhgen.cc \
+ bufun.h \
+ cl/unistd.h \
+ compatlayer.h \
+ mli.h \
+ mlisdgi.h \
+ rhutils.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ txhgen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/libset.mkf b/setedit/makes/libset.mkf
new file mode 100644
index 0000000..a6d27a8
--- /dev/null
+++ b/setedit/makes/libset.mkf
@@ -0,0 +1,60 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=../mainsrc ../names ../streams ../setedit ../setedit/names ../setedit/streams \
+ ../infview ../sdg ../settvuti ../settvuti/names ../settvuti/streams ../extra \
+ ../mp3 ../calcu ../easydiag ../infview/names ../infview/streams ../librhuti
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+SDG_INC_DIR=../sdg/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_INC_DIR=../mp3
+CALCU_INC_DIR=../calcu
+MP3_PREV_DIR=..
+INCLUDE_DIRS=$(INCLUDE_DIR) $(SETEDIT_INC_DIR) $(SETTVUTI_INC_DIR) \
+ $(SDG_INC_DIR) $(INFVIEW_INC_DIR) $(TVISION_INC) $(EXTRA_INC_DIR) \
+ $(EASYDIAG_INC_DIR) $(LIBRHUTI_INC_DIR) $(SUPPORT_INC) \
+ $(MP3_INC_DIR) $(CALCU_INC_DIR)
+C_EXTRA_FLAGS=-DFOR_LIBSET
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+ifdef MAINTAINER_MODE
+ ExIMK=.imk
+else
+ ExIMK=.umk
+endif
+include libset$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/setedit/makes/libset.umk b/setedit/makes/libset.umk
new file mode 100644
index 0000000..09fb89b
--- /dev/null
+++ b/setedit/makes/libset.umk
@@ -0,0 +1,245 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+libset$(ExLIB):: \
+ objlib/bufun$(ExOBJ) \
+ objlib/calcu$(ExOBJ) \
+ objlib/ceditor$(ExOBJ) \
+ objlib/completi$(ExOBJ) \
+ objlib/deedidia$(ExOBJ) \
+ objlib/doedidia$(ExOBJ) \
+ libeasyd$(ExLIB) \
+ objlib/edconst$(ExOBJ) \
+ objlib/editorfo$(ExOBJ) \
+ objlib/editwind$(ExOBJ) \
+ objlib/edkeys$(ExOBJ) \
+ objlib/edprint$(ExOBJ) \
+ objlib/edspecs$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ objlib/gzfiles$(ExOBJ) \
+ objlib/inf$(ExOBJ) \
+ objlib/infbase$(ExOBJ) \
+ objlib/keytrans$(ExOBJ) \
+ objlib/linelen$(ExOBJ) \
+ objlib/loaddefl$(ExOBJ) \
+ objlib/loadfunc$(ExOBJ) \
+ objlib/loadshl$(ExOBJ) \
+ objlib/loadusew$(ExOBJ) \
+ objlib/macrocom$(ExOBJ) \
+ objlib/mli$(ExOBJ) \
+ objlib/mliasimp$(ExOBJ) \
+ objlib/mlicsdg$(ExOBJ) \
+ objlib/mliediti$(ExOBJ) \
+ objlib/mliedito$(ExOBJ) \
+ objlib/mlisdg$(ExOBJ) \
+ objlib/nceditor$(ExOBJ) \
+ objlib/neditwin$(ExOBJ) \
+ objlib/nfileedi$(ExOBJ) \
+ objlib/nhiscoll$(ExOBJ) \
+ objlib/ninfview$(ExOBJ) \
+ objlib/ninfwind$(ExOBJ) \
+ objlib/nostatex$(ExOBJ) \
+ objlib/nsindica$(ExOBJ) \
+ objlib/parser$(ExOBJ) \
+ objlib/pathtool$(ExOBJ) \
+ objlib/pclipper$(ExOBJ) \
+ objlib/pmacros$(ExOBJ) \
+ objlib/pperl$(ExOBJ) \
+ objlib/pphp$(ExOBJ) \
+ objlib/ppython$(ExOBJ) \
+ objlib/pvarious$(ExOBJ) \
+ objlib/pvhdl$(ExOBJ) \
+ objlib/rhideint$(ExOBJ) \
+ objlib/sceditor$(ExOBJ) \
+ objlib/sdginter$(ExOBJ) \
+ objlib/search$(ExOBJ) \
+ libsettv$(ExLIB) \
+ objlib/sinf$(ExOBJ) \
+ objlib/slpinter$(ExOBJ) \
+ objlib/splinman$(ExOBJ) \
+ objlib/ssindica$(ExOBJ) \
+ objlib/tsindica$(ExOBJ) \
+ objlib/txhgen$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+objlib/bufun$(ExOBJ):: ../mainsrc/bufun.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/calcu$(ExOBJ):: ../calcu/calcu.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/ceditor$(ExOBJ):: ../mainsrc/ceditor.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/completi$(ExOBJ):: ../mainsrc/completi.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/deedidia$(ExOBJ):: ../mainsrc/deedidia.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/doedidia$(ExOBJ):: ../mainsrc/doedidia.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=easydiag$(ExIMK)
+
+objlib/edconst$(ExOBJ):: ../mainsrc/edconst.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/editorfo$(ExOBJ):: ../mainsrc/editorfo.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/editwind$(ExOBJ):: ../mainsrc/editwind.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/edkeys$(ExOBJ):: ../setedit/edkeys.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/edprint$(ExOBJ):: ../setedit/edprint.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/edspecs$(ExOBJ):: ../mainsrc/edspecs.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE01=extra$(ExIMK)
+
+objlib/gzfiles$(ExOBJ):: ../mainsrc/gzfiles.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/inf$(ExOBJ):: ../infview/inf.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/infbase$(ExOBJ):: ../infview/infbase.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/keytrans$(ExOBJ):: ../mainsrc/keytrans.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/linelen$(ExOBJ):: ../mainsrc/linelen.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/loaddefl$(ExOBJ):: ../mainsrc/loaddefl.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/loadfunc$(ExOBJ):: ../mainsrc/loadfunc.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/loadshl$(ExOBJ):: ../mainsrc/loadshl.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/loadusew$(ExOBJ):: ../mainsrc/loadusew.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/macrocom$(ExOBJ):: ../mainsrc/macrocom.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/mli$(ExOBJ):: ../sdg/mli.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/mliasimp$(ExOBJ):: ../sdg/mliasimp.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/mlicsdg$(ExOBJ):: ../sdg/mlicsdg.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/mliediti$(ExOBJ):: ../sdg/mliediti.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/mliedito$(ExOBJ):: ../sdg/mliedito.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/mlisdg$(ExOBJ):: ../sdg/mlisdg.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/nceditor$(ExOBJ):: ../names/nceditor.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/neditwin$(ExOBJ):: ../names/neditwin.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/nfileedi$(ExOBJ):: ../names/nfileedi.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/nhiscoll$(ExOBJ):: ../infview/names/nhiscoll.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/ninfview$(ExOBJ):: ../infview/names/ninfview.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/ninfwind$(ExOBJ):: ../infview/names/ninfwind.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/nostatex$(ExOBJ):: ../settvuti/nostatex.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/nsindica$(ExOBJ):: ../names/nsindica.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/parser$(ExOBJ):: ../calcu/parser.c
+ $(RHIDE_COMPILE_C)
+
+objlib/pathtool$(ExOBJ):: ../mainsrc/pathtool.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/pclipper$(ExOBJ):: ../mainsrc/pclipper.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/pmacros$(ExOBJ):: ../mainsrc/pmacros.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/pperl$(ExOBJ):: ../mainsrc/pperl.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/pphp$(ExOBJ):: ../mainsrc/pphp.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/ppython$(ExOBJ):: ../mainsrc/ppython.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/pvarious$(ExOBJ):: ../mainsrc/pvarious.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/pvhdl$(ExOBJ):: ../mainsrc/pvhdl.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/rhideint$(ExOBJ):: ../mainsrc/rhideint.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/sceditor$(ExOBJ):: ../streams/sceditor.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/sdginter$(ExOBJ):: ../mainsrc/sdginter.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/search$(ExOBJ):: ../mainsrc/search.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE02=settv$(ExIMK)
+
+objlib/sinf$(ExOBJ):: ../infview/streams/sinf.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/slpinter$(ExOBJ):: ../mainsrc/slpinter.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/splinman$(ExOBJ):: ../mainsrc/splinman.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/ssindica$(ExOBJ):: ../streams/ssindica.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/tsindica$(ExOBJ):: ../mainsrc/tsindica.cc
+ $(RHIDE_COMPILE_CC)
+
+objlib/txhgen$(ExOBJ):: ../sdg/txhgen.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/line.par b/setedit/makes/line.par
new file mode 100644
index 0000000..e820038
--- /dev/null
+++ b/setedit/makes/line.par
@@ -0,0 +1,5 @@
+../settvuti/setstack.cc
+../settvuti/tinppipe.cc
+../settvuti/tdiagrow.cc
+../setedit/dskwin.cc
+../setedit/tedcollec.cc
diff --git a/setedit/makes/linux.env b/setedit/makes/linux.env
new file mode 100644
index 0000000..db1797d
--- /dev/null
+++ b/setedit/makes/linux.env
@@ -0,0 +1,47 @@
+#
+# This include file have common options for all the subprojects.
+#
+# Attention! this file isn't bullet proof, take a look to linux_set.env too.
+# I think this one is better but it also needs more stuff installed.
+#
+
+#
+# Common Warning and debug options, change it if you don't want debug
+# information or your compiler emmits too much warnings with -Wall.
+# I don't use -fno-exceptions -fno-rtti in Linux because I still using
+# gcc 2.7.2.3.
+#
+RHIDE_OS_BOTH=-O2
+RHIDE_OS_CFLAGS=$(RHIDE_OS_BOTH)
+RHIDE_OS_CXXFLAGS=$(RHIDE_OS_BOTH)
+#
+# It indicates where are located the system includes so they aren't included
+# in the dependencies.
+#
+RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib
+#
+# These are OS dependent libraries.
+# I don't use intl because I use glibc2 and intl is included in glibc2.
+#
+RHIDE_OS_LIBS=ncurses gpm m
+#
+# These are the paths libraries that are OS dependent (the paths no the libs).
+# Here I fallback to /usr/lib in case TVision is there.
+#
+RHIDE_OS_LIBS_PATH=../../tvision/linux /usr/lib
+#
+# Location for the Turbo Vision headers
+# Here I fallback to /usr/include/tvision in case TVision is there.
+#
+TVISION_INC=../../tvision/include /usr/include/tvision
+#
+# Location for the support libraries. Here I assume you have libz and libpcre
+# installed, if not use linux_set.env.
+#
+SUPPORT_INC=
+#
+# Here I commented it so you get a dynamic file:
+# That's needed because RHIDE uses a wrong order and then -static doesn't
+# affect all the libraries.
+#
+#RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) -static $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
diff --git a/setedit/makes/linux/.cvsignore b/setedit/makes/linux/.cvsignore
new file mode 100644
index 0000000..5de6a5e
--- /dev/null
+++ b/setedit/makes/linux/.cvsignore
@@ -0,0 +1,5 @@
+setedit-*
+infview-*
+result
+resultInf
+libncurses.a
diff --git a/setedit/makes/linux/compinf.pl b/setedit/makes/linux/compinf.pl
new file mode 100755
index 0000000..56eb93b
--- /dev/null
+++ b/setedit/makes/linux/compinf.pl
@@ -0,0 +1,371 @@
+#!/usr/bin/perl
+# Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+open(FIL,'../../infview/version.txt') || return 0;
+$version=<FIL>;
+chop($version);
+# Cygwin's Perl bug workaround
+$version=~ s/\r//;
+close(FIL);
+$version1=$version;
+$version1=~ s/\.//g;
+
+$r=cat('../../infview/infmain.cc');
+if ($r!~/$version/)
+ {
+ die "Error! inconsistent version in infmain.cc\n";
+ }
+
+# Default prefix
+$prefix='/usr';
+# Environment prefix
+$i=$ENV{'prefix'};
+if (length($i))
+ {
+ $prefix=$i;
+ }
+else
+ {
+ $i=$ENV{'PREFIX'};
+ if (length($i))
+ {
+ $prefix=$i;
+ }
+ }
+
+# Parse command line
+$nextisprefix=0; $nextisfhs=0;
+$iMode=0; # Installation mode
+$iCompressExe=1;
+$useFHS=0;
+$ExeExtension='';
+foreach $i (@ARGV)
+ {
+ if ($nextisprefix)
+ {
+ $prefix=$i;
+ $nextisprefix=0;
+ }
+ elsif ($nextisfhs)
+ {
+ $useFHS=$i eq 'yes';
+ $nextisfhs=0;
+ }
+ elsif ($i eq '--prefix')
+ {
+ $nextisprefix=1;
+ }
+ elsif ($i eq '--fhs')
+ {
+ $nextisfhs=1;
+ }
+ elsif ($i eq '--install')
+ {
+ $iMode=1;
+ }
+ elsif ($i eq '--no-compress')
+ {
+ $iCompressExe=0;
+ }
+ elsif ($i eq '--keep-extension')
+ {
+ $ExeExtension='.exe';
+ }
+ else
+ {
+ print "Unknown command line option: $i\n";
+ print "Usage: compres.pl [--prefix path] [--install] [--no-compress]\n\n";
+ }
+ }
+
+# Alternative prefix used for examples in INSTALL
+if ($prefix eq '/usr/local')
+ {
+ $prefix_alt='/usr';
+ }
+else
+ {
+ $prefix_alt='/usr/local';
+ }
+
+# Check for make
+$test=`make --version 2> /dev/null`;
+if ($test=~/GNU Make/)
+ {
+ $Make='make';
+ }
+else
+ {
+ $test=`gmake --version 2> /dev/null`;
+ if ($test=~/GNU Make/)
+ {
+ $Make='gmake';
+ }
+ else
+ {
+ die "Where is make!\n";
+ }
+ }
+
+# Adjust install tool
+$os=`uname`;
+if ($os=~/SunOS/)
+ { # Solaris install is quite different
+ $inst_bin='$(INSTALL_BIN) -f $(@D) $<';
+ $inst_data='$(INSTALL_DATA) -f $(@D) $<';
+ }
+else
+ {
+ $inst_bin='$(INSTALL_BIN) $< $@';
+ $inst_data='$(INSTALL_DATA) $< $@';
+ }
+
+# Check for gzip
+$i=`which gzip`;
+if (!length($i))
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "You must install gzip to compress the documentation\n";
+ print "Skipping compression, if you want to stop press ^C, if not press ENTER\n";
+ <STDIN>;
+ }
+
+# Update the makefiles if needed
+if (!$iMode)
+ {
+ print "Creating makefile: ";
+ #system('cp -p ../linux.env ../rhide.env');
+ chdir('..');
+ system($Make.' makes');
+ chdir('linux');
+ print "done.\n\n";
+ }
+
+# Create the distribution tree if needed
+print "Creating directories: ";
+$base="infview-$version";
+$bin_dir=$base.'/bin';
+$cfg_dir1=$base.'/share';
+$cfg_dir=$cfg_dir1.'/infview';
+
+$Locale2 =$cfg_dir1.'/locale';
+$spLocale1=$Locale2.'/es';
+$spLocale =$spLocale1.'/LC_MESSAGES';
+$deLocale1=$Locale2.'/de';
+$deLocale =$deLocale1.'/LC_MESSAGES';
+
+$baseFHS=$base;
+$baseFHS.='/share' if $useFHS;
+$doc_dir0=$baseFHS;
+$doc_dir0.='/share' if ($os=~/FreeBSD/ && !$useFHS);
+$doc_dir1=$doc_dir0.'/doc';
+$doc_dir =$doc_dir1.'/infview';
+$man_dir1=$baseFHS.'/man';
+$man_dir=$man_dir1.'/man1';
+$inf_dir=$baseFHS.'/info';
+
+@tree=(
+$base,
+$bin_dir,
+$cfg_dir1,
+$cfg_dir,
+$inf_dir,
+$doc_dir0,
+$doc_dir1,
+$doc_dir,
+$man_dir1,
+$man_dir,
+$cfg_dir2,
+$cfg_dir3,
+$Locale2,
+$spLocale1,$spLocale,
+$deLocale1,$deLocale,
+'resultInf');
+
+foreach $i (@tree)
+ {
+ if (!(-d $i))
+ {
+ mkdir($i,00755);
+ print "$i\n";
+ }
+ }
+print "done.\n\n";
+
+
+print "Copying the exe: ";
+$d=$bin_dir.'/infview'.$ExeExtension;
+$o='../infview.exe';
+if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o .");
+ system("zip -9u resultInf/infview-$version-Linux-debug.zip infview.exe") unless($iMode);
+ system('strip infview.exe');
+ $i=`which upx`;
+ if (length($i))
+ {
+ system('upx -9 infview.exe') unless $iCompressExe==0;
+ }
+ system("mv infview.exe $d");
+ }
+print "done.\n\n";
+
+
+print "Copying doc files: ";
+chdir('../../doc');
+$i=`which makeinfo`;
+if (!length($i))
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "You must install the makeinfo package to generate the docs\n";
+ print "Skipping the documentation, you can create it latter, now press ENTER\n";
+ <STDIN>;
+ }
+else
+ {
+ if (system($Make.' txt info')==0)
+ {
+ CopyIfCpr('infeng.inf','../makes/linux/'.$inf_dir.'/infview.info');
+ CopyIfCpr('infeng.txt','../makes/linux/'.$doc_dir.'/infview.txt');
+ CopyIfCpr('infview.man','../makes/linux/'.$man_dir.'/infview.1');
+ }
+ else
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "Failed to generate the docs\n";
+ print "Skipping the documentation, you can create it latter, now press ENTER\n";
+ <STDIN>;
+ }
+ }
+chdir('..');
+CopyIf('copyrigh','makes/linux/'.$doc_dir.'/copyrigh');
+CopyIf('copying.dj','makes/linux/'.$doc_dir.'/copying.dj');
+CopyIf('copying.gpl','makes/linux/'.$doc_dir.'/copying.gpl');
+CopyIf('copying.lgp','makes/linux/'.$doc_dir.'/copying.lgp');
+CopyIf('copying.rh','makes/linux/'.$doc_dir.'/copying.rh');
+chdir('makes/linux');
+CopyIfRpl('../../distrib/distrib3.txt',$doc_dir.'/readme.1st');
+CopyIfRpl('../../distrib/distrib3.txt',$cfg_dir.'/readme.1st');
+CopyIf('../../internac/es.mo',$spLocale.'/setedit.mo');
+CopyIf('../../internac/de.mo',$deLocale.'/setedit.mo');
+print "done.\n\n";
+
+
+print "Copying other files: ";
+@fext=(
+'INSTALL.LINUX',
+'VCSA.SH',
+'infREMOVE_UNNEEDED',
+'infINSTALL.MAK'
+);
+# Here we say which files changes their name
+%frep=(
+'INSTALL.LINUX' => 'INSTALL',
+'infREMOVE_UNNEEDED' => 'REMOVE_UNNEEDED',
+'infINSTALL.MAK' => 'INSTALL.MAK'
+);
+foreach $i (@fext)
+ {
+ $r=$frep{$i};
+ $r=$i if !$r;
+ print $i.' ' if (CopyIfRpl('../../distrib/'.$i,$base.'/'.$r));
+ }
+print "done.\n\n";
+chmod 0755, $base.'/INSTALL';
+
+if ($iMode)
+ {
+ chdir($base);
+ system('./INSTALL');
+ chdir('..');
+ print "End of installation\n";
+ }
+else
+ {
+ print "Compressing the files: ";
+ system('tar cvf - '.$base.' | gzip -c > resultInf/infview-'.$version.'.bin.i386.elf.static.linux.tar.gz ');
+ print "done.\n";
+
+ CopyIfRpl('../../distrib/distrib3.txt','resultInf/readme.1st');
+
+ chdir('setedit/makes/linux');
+ }
+0;
+
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+
+sub replace
+{
+ my $b=$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
+
+
+sub CopyIf
+{
+ my ($o,$d)=@_;
+
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o $d");
+ return 1;
+ }
+ 0;
+}
+
+sub CopyIfCpr
+{
+ my ($o,$d)=@_;
+
+ if (!(-e $d.'.gz') or (-M $d.'.gz' > -M $o))
+ {
+ system("rm -f $d.gz");
+ system("cp -p $o $d");
+ system("gzip -9 $d");
+ return 1;
+ }
+ 0;
+}
+
+sub CopyIfRpl
+{
+ my ($o,$d)=@_;
+ my $a;
+
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ $a=cat($o);
+ $a =~ s/\@\@v\@\@/$version/g;
+ $a =~ s/\@\@v1\@\@/$version1/g;
+ $a =~ s/\@\@pref\@\@/$prefix/g;
+ $a =~ s/\@\@pref_alt\@\@/$prefix_alt/g;
+ $a =~ s/\@\@install_bin\@\@/$inst_bin/g;
+ $a =~ s/\@\@install_data\@\@/$inst_data/g;
+ $a =~ s/\@\@make\@\@/$Make/g;
+ replace($d,$a);
+ if (-x $o)
+ {
+ chmod(0755,$d);
+ }
+ return 1;
+ }
+ 0;
+}
+
+
diff --git a/setedit/makes/linux/compress.pl b/setedit/makes/linux/compress.pl
new file mode 100755
index 0000000..1645265
--- /dev/null
+++ b/setedit/makes/linux/compress.pl
@@ -0,0 +1,590 @@
+#!/usr/bin/perl
+# Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+open(FIL,'../../version.txt') || die;
+$version=<FIL>;
+chop($version);
+# Cygwin's Perl bug workaround
+$version=~ s/\r//;
+close(FIL);
+$version1=$version;
+$version1=~ s/\.//g;
+
+# Adjust Debian version
+$r=cat('../../debian/changelog');
+if ($r!~/$version/)
+ {
+ chdir('../../debian');
+ @ENV{'DEBEMAIL'}='salvador@inti.gov.ar';
+ @ENV{'DEBFULLNAME'}='Salvador E. Tropea (SET)';
+ system("dch -v$version"."-0.1 \"New version automatically modified by version update scripts\"");
+ chdir('../makes/linux');
+ }
+
+$r=cat('../../include/ced_inte.h');
+if ($r!~/$version/)
+ {
+ die "Error! inconsistent version in ced_inte.h\n";
+ }
+
+$r=cat('../../include/vername.h');
+$revision=$1 if $r=~/VERSION_REV\s+(\d+)/;
+$relname=$1 if $r=~/VERSION_NAME\s+\"([^\"]+)\"/;
+
+$r=0;
+
+# Default prefix
+$prefix='/usr';
+# Environment prefix
+$i=$ENV{'prefix'};
+if (length($i))
+ {
+ $prefix=$i;
+ }
+else
+ {
+ $i=$ENV{'PREFIX'};
+ if (length($i))
+ {
+ $prefix=$i;
+ }
+ }
+
+# Parse command line
+$nextisprefix=0; $nextisfhs=0;
+$iMode=0; # Installation mode
+$iCompressExe=1;
+$useFHS=0;
+$Strip=1;
+$OnlySources=0;
+$UseVersioInSourceDir=0;
+$ExeExtension='';
+foreach $i (@ARGV)
+ {
+ if ($nextisprefix)
+ {
+ $prefix=$i;
+ $nextisprefix=0;
+ }
+ elsif ($nextisfhs)
+ {
+ $useFHS=$i eq 'yes';
+ $nextisfhs=0;
+ }
+ elsif ($i eq '--prefix')
+ {
+ $nextisprefix=1;
+ }
+ elsif ($i eq '--fhs')
+ {
+ $nextisfhs=1;
+ }
+ elsif ($i eq '--install')
+ {
+ $iMode=1;
+ }
+ elsif ($i eq '--no-compress')
+ {
+ $iCompressExe=0;
+ }
+ elsif ($i eq '--no-strip')
+ {
+ $Strip=0;
+ }
+ elsif ($i eq '--only-source')
+ {
+ $OnlySources=1;
+ }
+ elsif ($i eq '--use-bzip2')
+ {
+ $UseBzip2=1;
+ }
+ elsif ($i eq '--dir-version')
+ {
+ $UseVersioInSourceDir=1;
+ }
+ elsif ($i eq '--keep-extension')
+ {
+ $ExeExtension='.exe';
+ }
+ else
+ {
+ print "Unknown command line option: $i\n";
+ print "Usage: compres.pl [--prefix path] [--install] [--no-compress]\n\n";
+ }
+ }
+
+# Alternative prefix used for examples in INSTALL
+if ($prefix eq '/usr/local')
+ {
+ $prefix_alt='/usr';
+ }
+else
+ {
+ $prefix_alt='/usr/local';
+ }
+
+if ($OnlySources)
+ {
+ GenerateSourceDistro();
+ exit 0;
+ }
+
+# Check for make
+$test=`make --version 2> /dev/null`;
+if ($test=~/GNU Make/)
+ {
+ $Make='make';
+ }
+else
+ {
+ $test=`gmake --version 2> /dev/null`;
+ if ($test=~/GNU Make/)
+ {
+ $Make='gmake';
+ }
+ else
+ {
+ die "Where is make!\n";
+ }
+ }
+
+# Adjust install tool
+$os=`uname`;
+if ($os=~/SunOS/)
+ { # Solaris install is quite different
+ $inst_bin='$(INSTALL_BIN) -f $(@D) $<';
+ $inst_data='$(INSTALL_DATA) -f $(@D) $<';
+ }
+else
+ {
+ $inst_bin='$(INSTALL_BIN) $< $@';
+ $inst_data='$(INSTALL_DATA) $< $@';
+ }
+
+@files=('../../distrib/distrib1.txt','../../distrib/distrib2.txt');
+
+# Check for gzip
+$i=`which gzip`;
+if (!length($i))
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "You must install gzip to compress the documentation\n";
+ print "Skipping compression, if you want to stop press ^C, if not press ENTER\n";
+ <STDIN>;
+ }
+
+# Update the makefiles if needed
+if (!$iMode)
+ {
+ print "Creating makefile: ";
+ #system('cp -p ../linux.env ../rhide.env');
+ chdir('..');
+ system($Make.' makes');
+ chdir('linux');
+ print "done.\n\n";
+ }
+
+# Create the distribution tree if needed
+print "Creating directories: ";
+$base="setedit-$version";
+$bin_dir=$base.'/bin';
+$cfg_dir1=$base.'/share';
+$cfg_dir=$cfg_dir1.'/setedit';
+$cfg_dir2=$cfg_dir.'/eterm';
+$cfg_dir3=$cfg_dir2.'/Setedit';
+
+$Locale2 =$cfg_dir1.'/locale';
+$spLocale1=$Locale2.'/es';
+$spLocale =$spLocale1.'/LC_MESSAGES';
+$deLocale1=$Locale2.'/de';
+$deLocale =$deLocale1.'/LC_MESSAGES';
+
+$libdir1=$base.'/lib';
+$libdir =$libdir1.'/setedit';
+
+$baseFHS=$base;
+$baseFHS.='/share' if $useFHS;
+$doc_dir0=$baseFHS;
+$doc_dir0.='/share' if ($os=~/FreeBSD/ && !$useFHS);
+$doc_dir1=$doc_dir0.'/doc';
+$doc_dir =$doc_dir1.'/setedit';
+$xmp_dir=$doc_dir.'/examples';
+$tag_doc=$doc_dir.'/tag_imgs';
+$man_dir1=$baseFHS.'/man';
+$man_dir=$man_dir1.'/man1';
+$inf_dir=$baseFHS.'/info';
+
+@tree=(
+$base,
+$bin_dir,
+$cfg_dir1,
+$cfg_dir,
+$cfg_dir2,
+$cfg_dir3,
+$inf_dir,
+$doc_dir0,
+$doc_dir1,
+$doc_dir,
+$xmp_dir,
+$tag_doc,
+$man_dir1,
+$man_dir,
+$Locale2,
+$spLocale1,$spLocale,
+$deLocale1,$deLocale,
+$libdir1,$libdir,
+'result');
+
+foreach $i (@tree)
+ {
+ if (!(-d $i))
+ {
+ mkdir($i,00755);
+ print "$i\n";
+ }
+ }
+print "done.\n\n";
+
+print "Copying the exe: ";
+$d=$bin_dir.'/setedit'.$ExeExtension;
+$o='../editor.exe';
+if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o .");
+ if ($Strip)
+ {
+ system("zip -9u result/setedit-$version-Linux-debug.zip editor.exe") unless($iMode);
+ system('strip editor.exe');
+ $i=`which upx`;
+ if (length($i))
+ {
+ system('upx -9 editor.exe') unless $iCompressExe==0;
+ }
+ }
+ system("mv editor.exe $d");
+ }
+print "done.\n\n";
+
+
+print "Copying share files: ";
+@cfgs=('../../cfgfiles/*.pmc','../../cfgfiles/*.shl','../../cfgfiles/*.tip',
+ '../../fonts/*.sft','../../sdg/txhgen-i.*','../../sdg/*.frt',
+ '../../cfgfiles/menubind.smn','../../cfgfiles/redmond.smn',
+ '../../cfgfiles/*.slp','../../cfgfiles/*.cle');
+foreach $i (@cfgs)
+ {
+ @a=glob($i);
+ foreach $o (@a)
+ {
+ $o =~ /.*\/(.*)/;
+ $d = $cfg_dir.'/'.$1;
+ print $1.' ' if (CopyIf($o,$d));
+ }
+ }
+print 'eterm/readme.txt ' if (CopyIf('../../cfgfiles/eterm/readme.txt',$cfg_dir.'/eterm/readme.txt'));
+print 'eterm/xterm-eterm-tv ' if (CopyIf('../../cfgfiles/eterm/xterm-eterm-tv',$cfg_dir.'/eterm/xterm-eterm-tv'));
+print 'eterm/Setedit/MAIN ' if (CopyIf('../../cfgfiles/eterm/Setedit/MAIN',$cfg_dir.'/eterm/Setedit/MAIN'));
+print 'eterm/Setedit/Setedit.menu ' if (CopyIf('../../cfgfiles/eterm/Setedit/Setedit.menu',$cfg_dir.'/eterm/Setedit/Setedit.menu'));
+print "done.\n\n";
+
+
+print "Copying doc files: ";
+chdir('../../doc');
+$i=`which makeinfo`;
+if (!length($i))
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "You must install the makeinfo package to generate the docs\n";
+ print "Skipping the documentation, you can create it latter, now press ENTER\n";
+ <STDIN>;
+ }
+else
+ {
+ if (system($Make.' txt info')==0)
+ {
+ CopyIfCpr('editor.inf','../makes/linux/'.$inf_dir.'/setedit.info');
+ CopyIfCpr('sdg.inf','../makes/linux/'.$inf_dir.'/sdg.info');
+ CopyIfCpr('infeng.inf','../makes/linux/'.$inf_dir.'/infview.info');
+ CopyIfCpr('editor.txt','../makes/linux/'.$doc_dir.'/setedit.txt');
+ CopyIfCpr('sdg.txt','../makes/linux/'.$doc_dir.'/sdg.txt');
+ CopyIfCpr('infeng.txt','../makes/linux/'.$doc_dir.'/infview.txt');
+ CopyIfCpr('setedit.man','../makes/linux/'.$man_dir.'/setedit.1');
+ }
+ else
+ {
+ print "\n************* Attention!! *************\n\n";
+ print "Failed to generate the docs\n";
+ print "Skipping the documentation, you can create it latter, now press ENTER\n";
+ <STDIN>;
+ }
+ }
+chdir('..');
+CopyIf('copyrigh','makes/linux/'.$doc_dir.'/copyrigh');
+CopyIf('copying.dj','makes/linux/'.$doc_dir.'/copying.dj');
+CopyIf('copying.gpl','makes/linux/'.$doc_dir.'/copying.gpl');
+CopyIf('copying.lgp','makes/linux/'.$doc_dir.'/copying.lgp');
+CopyIf('copying.rh','makes/linux/'.$doc_dir.'/copying.rh');
+CopyIfCpr('change.log','makes/linux/'.$doc_dir.'/change.log');
+# Tags stuff
+CopyIf('www-site/tags.html','makes/linux/'.$doc_dir.'/tags.html');
+CopyIf('www-site/my_file1.html','makes/linux/'.$doc_dir.'/my_file1.html');
+CopyIf('www-site/my_file2.html','makes/linux/'.$doc_dir.'/my_file2.html');
+CopyIf('www-site/my_file3.html','makes/linux/'.$doc_dir.'/my_file3.html');
+CopyIf('www-site/examples.css','makes/linux/'.$doc_dir.'/examples.css');
+@a=glob('www-site/tag_imgs/*.png');
+foreach $o (@a)
+ {
+ $o =~ /.*\/(.*)/;
+ $d = 'makes/linux/'.$tag_doc.'/'.$1;
+ CopyIf($o,$d);
+ }
+chdir('makes/linux');
+CopyIfRpl('../../distrib/distrib1.txt',$doc_dir.'/readme.1st');
+CopyIfRpl('../../distrib/distrib1.txt',$cfg_dir.'/readme.1st');
+CopyIf('../../distrib/linux.faq',$doc_dir.'/faq.txt');
+CopyIf('../../internac/es.mo',$spLocale.'/setedit.mo');
+CopyIf('../../internac/de.mo',$deLocale.'/setedit.mo');
+CopyIf('../../distrib/examples/tvrc',$xmp_dir.'/tvrc');
+CopyIf('../../distrib/examples/examp1.dst',$xmp_dir.'/examp1.dst');
+CopyIf('../../distrib/examples/examp1.epr',$xmp_dir.'/examp1.epr');
+CopyIf('../../distrib/examples/test1.cc',$xmp_dir.'/test1.cc');
+print "done.\n\n";
+
+
+print "Copying calendar plug-ins: ";
+CopyIf('../../holidays/holidays.conf',$libdir.'/holidays.conf');
+CopyIf('../../holidays/datetools.so',$libdir.'/datetools.so');
+CopyIf('../../holidays/argentina.so',$libdir.'/argentina.so');
+CopyIf('../../holidays/defholidays.so',$libdir.'/defholidays.so');
+print "done.\n\n";
+
+
+print "Copying other files: ";
+@fext=(
+'INSTALL.LINUX',
+'INSTALL.MAK',
+'REMOVE_UNNEEDED',
+'VCSA.SH',
+'default.map',
+'linux.faq',
+'ask_config.sh');
+# Here we say which files changes their name
+%frep=(
+'INSTALL.LINUX' => 'INSTALL');
+foreach $i (@fext)
+ {
+ $r=$frep{$i};
+ $r=$i if !$r;
+ print $i.' ' if (CopyIfRpl('../../distrib/'.$i,$base.'/'.$r));
+ }
+print "done.\n\n";
+chmod 0755, $base.'/INSTALL';
+
+if ($iMode)
+ {
+ chdir($base);
+ system('./INSTALL');
+ chdir('..');
+ print "End of installation\n";
+ }
+else
+ {
+ print "Compressing the files: ";
+ system('tar cvf - '.$base.' | gzip -c > result/setedit-'.$version.'.bin.i386.elf.static.linux.tar.gz');
+ print "done.\n";
+
+ CopyIfRpl('../../distrib/distrib1.txt','result/readme.1st');
+ CopyIfRpl('../../distrib/distrib2.txt','result/announce.txt');
+
+ GenerateSourceDistro();
+
+ #############################
+ # Change.log in HTML format #
+ #############################
+
+ $a=cat('../../change.log');
+ # Line separators
+ $a =~ s/\n(-)+\n/<hr>/mg;
+ # Lines between text are paragraphs
+ $a =~ s/\n\n/<p>\n/mg;
+ $a =~ s/\n\.\n/<p>\n/mg;
+ # Convert * to list items
+ $a =~ s/\n\*/<br>\n<li>/mg;
+ # If any survives
+ $a =~ s/\n-/<br>-/mg;
+ $a =~ s/-\n/-<br>/mg;
+ # Beautyful ;-)
+ $a =~ s/Revision/<b>Revision<\/b>/mg;
+ $a =~ s/\$\n/\$<br>/mg;
+
+ open(FIL,">result/change.html") || die 'Can not create changelog';
+ print FIL ('<HTML><Title>change.log for setedit</Title><Body>');
+ print FIL ($a);
+ print FIL ('<p>Converted to HTML by a simple Perl script &copy; by SET</Body></HTML>');
+ close(FIL);
+
+ ToHTML("result/readme.1st","result/readme.html",'readme.1st');
+ ToHTML("result/announce.txt","result/announce.html",'announce');
+ }
+
+0;
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+sub ToHTML
+{
+ my $a;
+
+ $a=cat($_[0]);
+ $a=~s/</&lt;/g;
+ $a=~s/>/&gt;/g;
+ open(FIL,">$_[1]") || die "Can't create readme $_[1]";
+ print FIL ("<HTML><Title>$_[2] for setedit</Title><Body><Pre>");
+ print FIL ($a);
+ print FIL ('</Pre></Body></HTML>');
+ close(FIL);
+}
+
+sub replace
+{
+ my $b=$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
+
+
+sub CopyIf
+{
+ my ($o,$d)=@_;
+
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ system("cp -p $o $d");
+ return 1;
+ }
+ 0;
+}
+
+sub CopyIfCpr
+{
+ my ($o,$d)=@_;
+
+ if (!(-e $d.'.gz') or (-M $d.'.gz' > -M $o))
+ {
+ system("rm -f $d.gz");
+ system("cp -p $o $d");
+ system("gzip -9 $d");
+ return 1;
+ }
+ 0;
+}
+
+sub CopyIfRpl
+{
+ my ($o,$d)=@_;
+ my $a;
+
+ if (!(-e $d) or (-M $d > -M $o))
+ {
+ $a=cat($o);
+ $a =~ s/\@\@v\@\@/$version/g;
+ $a =~ s/\@\@v1\@\@/$version1/g;
+ $a =~ s/\@\@pref\@\@/$prefix/g;
+ $a =~ s/\@\@pref_alt\@\@/$prefix_alt/g;
+ $a =~ s/\@\@install_bin\@\@/$inst_bin/g;
+ $a =~ s/\@\@install_data\@\@/$inst_data/g;
+ $a =~ s/\@\@relname\@\@/$relname/g;
+ $a =~ s/\@\@rev\@\@/$revision/g;
+ $a =~ s/\@\@make\@\@/$Make/g;
+ replace($d,$a);
+ if (-x $o)
+ {
+ chmod(0755,$d);
+ }
+ return 1;
+ }
+ 0;
+}
+
+sub GenerateSourceDistro
+{
+ my $dir;
+
+ mkdir('result',00755) unless -d 'result';
+
+ print "\n\nCreating source distribution\n";
+
+ chdir('../../..');
+
+ $dir='setedit';
+ if ($UseVersioInSourceDir)
+ {
+ $dir.='-'.$version;
+ `mv setedit setedit-$version`;
+ }
+
+ open(FIL,$dir.'/makes/lista');
+ @files=<FIL>;
+ close(FIL);
+ $r='';
+ foreach $i (@files)
+ {
+ chop($i);
+ # Exclude libamp
+ #next if ($i =~ /libamp\//);
+ $a=substr($i,0,1);
+ if (($a eq '-') or ($a eq '+') or ($a eq '*'))
+ {
+ $i=substr($i,1);
+ }
+ $r.=' '.$dir.'/'.$i;
+ }
+ open(FIL,$dir.'/makes/listaxtr');
+ @files=<FIL>;
+ close(FIL);
+ foreach $i (@files)
+ {
+ chop($i);
+ $r.=' '.join(' ',glob($dir.'/'.$i)) if length($i);
+ }
+ # libmigdb sources, optional
+ if (-d 'libmigdb')
+ {
+ open(FIL,'libmigdb/files');
+ @files=<FIL>;
+ close(FIL);
+ `ln -s ../libmigdb $dir/libmigdb`;
+ foreach $i (@files)
+ {
+ chop($i);
+ $r.=' '.join(' ',glob($dir.'/'.$i)) if length($i);
+ }
+ }
+
+ # Generate the tar file
+ $srcdist="setedit-$version.tar";
+ unlink($srcdist);
+ system("tar cvf - $r | gzip -9c > $dir/makes/linux/result/$srcdist.gz") unless $UseBzip2;
+ system("tar cvf - $r | bzip2 -9c > $dir/makes/linux/result/$srcdist.bz2") if $UseBzip2;
+ #replace('pp',$r);
+ `mv setedit-$version setedit` if $UseVersioInSourceDir;
+ unlink 'setedit/libmigdb' if -d 'libmigdb';
+
+ chdir('setedit/makes/linux');
+}
+
+
diff --git a/setedit/makes/linux_set.env b/setedit/makes/linux_set.env
new file mode 100644
index 0000000..23dab5a
--- /dev/null
+++ b/setedit/makes/linux_set.env
@@ -0,0 +1,42 @@
+#
+# This include file have common options for all the subprojects.
+#
+
+#
+# Common Warning and debug options, change it if you don't want debug
+# information or your compiler emmits too much warnings with -Wall.
+# I don't use -fno-exceptions -fno-rtti in Linux because I still using
+# gcc 2.7.2.3.
+#
+RHIDE_OS_BOTH=-Wall -Werror -gstabs+3 -O2
+RHIDE_OS_CFLAGS=$(RHIDE_OS_BOTH)
+RHIDE_OS_CXXFLAGS=$(RHIDE_OS_BOTH)
+#
+# It indicates where are located the system includes so they aren't included
+# in the dependencies.
+#
+RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib
+#
+# These are OS dependent libraries.
+# I don't use intl because I use glibc2 and intl is included in glibc2.
+#
+RHIDE_OS_LIBS=ncurses gpm m
+#
+# These are the paths libraries that are OS dependent (the paths no the libs).
+#
+RHIDE_OS_LIBS_PATH=../../tvision/linux linux
+#
+# Location for the Turbo Vision headers
+#
+TVISION_INC=../../tvision/include
+#
+# Location for the support libraries, if you have them installed (PCRE and
+# libz) you could want to use the installed ones. In this case you should
+# remove linux from RHIDE_OS_LIBS_PATH and assign nothing to SUPPORT_INC.
+#
+SUPPORT_INC=../support
+#
+# That's needed because RHIDE uses a wrong order and then -static doesn't
+# affect all the libraries.
+#
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) -static $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
diff --git a/setedit/makes/lista b/setedit/makes/lista
new file mode 100644
index 0000000..458603e
--- /dev/null
+++ b/setedit/makes/lista
@@ -0,0 +1,892 @@
+.cvsignore
+calcu/calcu.cc
+calcu/calcu.h
+*calcu/large.txt
+calcu/parser.c
+calcu/parserbr.c
+calcu/parserml.c
+*calcu/parser.txt
+calcu/small.c
+*cfgfiles/asm51.pmc
+*cfgfiles/clippmac.pmc
+*cfgfiles/cpmacros.pmc
+*cfgfiles/editor.tip
+cfgfiles/eterm/Setedit/MAIN
+cfgfiles/eterm/Setedit/Setedit.menu
+cfgfiles/eterm/readme.txt
+cfgfiles/eterm/xterm-eterm-tv
+*cfgfiles/errors.cle
+*cfgfiles/examples.slp
+*cfgfiles/htmlmac.pmc
+*cfgfiles/macros.slp
+*cfgfiles/menubind.smn
+*cfgfiles/redmond.smn
+*cfgfiles/perlmac.pmc
+*cfgfiles/pmacros.pmc
+*cfgfiles/simple.smn
+-cfgfiles/simple.dst
+*cfgfiles/simple.tip
+*cfgfiles/syntaxhl.shl
+cfgfiles/test_shl/test.vhdl
+*cfgfiles/vhdl.pmc
+*cfgfiles/wmlmac.pmc
+change.log
+change0.log
+config.pl
+confignt.pl
++configset
+*configset.bat
++configure
+*configure.bat
+conflib.pl
+copying.dj
+copying.gpl
+copying.lgp
+copying.rh
+copyrigh
++debian/buildpackage
+debian/changelog
+debian/control
+debian/copyright
+debian/files_to_backup
+debian/info.ex
+debian/infview.doc-base
+debian/infview.menu
+debian/infview.postinst
+debian/infview.postrm
+debian/infview.preinst
+debian/infview.prerm
+debian/maintainer.notes
+debian/README
+debian/README.debian
++debian/rules
++debian/setedit.config
+debian/setedit.templates
+debian/setedit.templates.es
+debian/setedit.doc-base
+debian/setedit.menu
+debian/setedit.postinst
+debian/setedit.prerm
+debian/watch.ex
+*distrib/arranca.bat
++distrib/ask_config.sh
+-distrib/calltpc7.zip
+distrib/default.map
+*distrib/distrib1.txt
+*distrib/distrib2.txt
+*distrib/distrib3.txt
+-distrib/examples/examp1.dst
+-distrib/examples/examp1.epr
+distrib/examples/test1.cc
+distrib/examples/tvrc
+-distrib/example.zip
++distrib/INSTALL.LINUX
++distrib/INSTALL.MAK
++distrib/infINSTALL.MAK
++distrib/infREMOVE_UNNEEDED
+-distrib/kextend.zip
+distrib/linux.faq
++distrib/REMOVE_UNNEEDED
+-distrib/setedit.pif
++distrib/VCSA.SH
+doc/.cvsignore
+doc/editor.tx
+doc/infeng.tx
+doc/infview.man
+doc/install/bcc.txt
+doc/install/cygwin.txt
+doc/install/djgpp.txt
+doc/install/linux.txt
+doc/install/mingwin.txt
+doc/install/msvc.txt
+doc/install/tools.txt
+doc/install/unix.txt
+doc/gnumake.in
+doc/line.par
+doc/Makefile
+doc/Makefile.bcc
+*doc/readme.1st
+doc/rhidemac.htm
+doc/rhidemac.txi
+doc/rhidemac.txt
+doc/setedit.man
+doc/sdg.tx
+doc/sdh.c
+-doc/sdh.gpr
+doc/set.htm
+doc/set.txi
+doc/set.txt
+easydiag/easydiag.h
+easydiag/easydia1.h
+easydiag/lablchek.cc
+easydiag/lablradi.cc
+easydiag/snostate.cc
+easydiag/snostate.h
+easydiag/tcheck2.cc
+easydiag/tcheck2.h
+easydiag/test.cc
+easydiag/tmiclust.cc
+easydiag/tmiclust.h
+easydiag/tsbutton.cc
+easydiag/tsbutton.h
+easydiag/tschkarr.cc
+easydiag/tschkarr.h
+easydiag/tschkbox.cc
+easydiag/tschkbox.h
+easydiag/tshscrol.cc
+easydiag/tshscrol.h
+easydiag/tshzgrp.cc
+easydiag/tshzgrp.h
+easydiag/tsinplin.cc
+easydiag/tsinplin.h
+easydiag/tsinplpi.cc
+easydiag/tsinplpi.h
+easydiag/tslabel.cc
+easydiag/tslabel.h
+easydiag/tslider.cc
+easydiag/tslider.h
+easydiag/tslistbo.cc
+easydiag/tslistbo.h
+easydiag/tsradbot.cc
+easydiag/tsradbot.h
+easydiag/tssortlb.cc
+easydiag/tssortlb.h
+easydiag/tssortva.h
+easydiag/tssosslb.cc
+easydiag/tssosslb.h
+easydiag/tstatext.cc
+easydiag/tstatext.h
+easydiag/tstextsc.cc
+easydiag/tstextsc.h
+easydiag/tstsorlb.cc
+easydiag/tstsorlb.h
+easydiag/tsvegrp.cc
+easydiag/tsvegrp.h
+easydiag/tsviewco.cc
+easydiag/tsviewco.h
+easydiag/tsview.cc
+easydiag/tsview.h
+easydiag/ttextscr.cc
+easydiag/ttextscr.h
+extra/djmdr.s
+extra/dyncat.cc
+extra/dyncat.h
+extra/memmove.s
+extra/mixer.c
+extra/mixer.h
+extra/mixoss.c
+extra/mixersb.c
+extra/stackdbg.c
+extra/stackdbg.h
+extra/strncpyz.cc
+extra/strndup.cc
+fonts/.cvsignore
+-fonts/BTerminus.sft
+-fonts/Terminus.sft
+-fonts/XFont.sft
+fonts/Makefile
+-fonts/antique.016
+-fonts/antique.sft
+fonts/boxround.cc
+-fonts/boxround.sft
+fonts/boxroun0.000
+fonts/cntdown0.000
+fonts/cntdown.cc
+-fonts/cntdown.sft
+fonts/convpcf1.cc
+fonts/common1.h
+fonts/common2.h
+fonts/intcode.h
+fonts/let.txt
+-fonts/medieval.016
+-fonts/medieval.sft
+fonts/ocr0.000
+fonts/ocr.cc
+-fonts/ocr.sft
+fonts/raw2sft.cc
+-fonts/roman.016
+-fonts/roman.sft
+fonts/rombios0.000
+fonts/rombios.cc
+-fonts/rombios.sft
+fonts/thin0.000
+fonts/thin.cc
+-fonts/thin.sft
+fromdos.pl
+fromunix.pl
+gettext/.cvsignore
+gettext/Makefile
+gettext/Makefile.in
+gettext/bindtextdom.c
+gettext/config.h
+gettext/dcgettext.c
+gettext/dcigettext.c
+gettext/dcngettext.c
+gettext/dgettext.c
+gettext/djgpp.h
+gettext/dngettext.c
+gettext/explodename.c
+gettext/finddomain.c
+gettext/gettext.c
+gettext/gettext.h
+gettext/gettextP.h
+gettext/hash-string.h
+gettext/intl-compat.c
+gettext/l10nflist.c
+gettext/libgettext.h
+gettext/libgnuintl.h
+gettext/loadinfo.h
+gettext/loadmsgcat.c
+gettext/localcharset.c
+gettext/localealias.c
+gettext/ngettext.c
+gettext/plural.c
+gettext/plural.y
+gettext/textdomain.c
+holidays/.cvsignore
+holidays/argentina.c
+holidays/datetools.c
+holidays/datetools.h
+holidays/defholidays.c
+holidays/holidays.conf
+holidays/Makefile
+holidays/Makefile.in
+holidays/README
+include/.cvsignore
+include/bufun.h
+include/ceditint.h
+include/ceditor.h
+include/ced_clas.h
+include/ced_coma.h
+include/ced_exte.h
+include/ced_inte.h
+include/ced_pcre.h
+include/completi.h
+include/configed.h
+include/edmsg.h
+include/edspecs.h
+include/gzfiles.h
+include/keytrans.h
+include/loadshl.h
+include/loadkbin.h
+include/pathtool.h
+include/pmcoll.h
+include/runprog.h
+include/sdginter.h
+include/setconst.h
+include/sindicat.h
+include/slpinter.h
+include/splinman.h
+include/ssyntax.h
+include/tags.h
+include/tvsetuti.h
+include/ucdefs.h
+include/vername.h
+infview/change.log
+infview/include/inf.h
+infview/include/infr.h
+infview/include/infalone.h
+infview/include/infbase.h
+infview/include/infbaser.h
+infview/include/manview.h
+infview/inf.cc
+infview/infbase.cc
+infview/infdummy.cc
+infview/infmain.cc
+infview/infmenu.cc
+infview/manview.cc
+infview/names/nhiscoll.cc
+infview/names/ninfview.cc
+infview/names/ninfwind.cc
+infview/names/nmanwind.cc
+infview/streams/sinf.cc
+infview/streams/sman.cc
+infview/version.txt
+INSTALL.txt
+install/.cvsignore
+install/create.pl
+install/datafile.c
+install/install.cc
+install/readme.txt
+internac/.cvsignore
+internac/colors.cc
+internac/de.po
+internac/h_de.po
+internac/es.po
+internac/h_es.po
+internac/emptymsg.cc
+internac/fix.pl
+internac/fix.c
+internac/getcolors.cc
+internac/getids.cc
+internac/gnumake.in
+internac/Makefile
+internac/makelist.pl
+internac/po_list
+internac/utod.pl
+libbzip2/.cvsignore
+libbzip2/Makefile
+libbzip2/Makefile.bcc
+libbzip2/Makefile.nmk
+libbzip2/blocksort.c
+libbzip2/bzlib.c
+libbzip2/bzlib.h
+libbzip2/bzlib_private.h
+libbzip2/compress.c
+libbzip2/crctable.c
+libbzip2/decompress.c
+libbzip2/gnumake.in
+libbzip2/huffman.c
+libbzip2/license
+libbzip2/randtable.c
+libbzip2/readme
+libpcre/.cvsignore
+libpcre/dftables.c
+libpcre/get.c
+libpcre/gnumake.in
+libpcre/internal.h
+libpcre/licence
+libpcre/Makefile
+libpcre/Makefile.bcc
+libpcre/Makefile.nmk
+libpcre/maketables.c
+libpcre/pcre.c
+libpcre/pcre.h
+libpcre/README
+libpcre/study.c
+librhuti/abstorel.cc
+librhuti/back2sl.cc
+librhuti/basename.cc
+librhuti/expvar.cc
+librhuti/fexpand.cc
+librhuti/io.cc
+librhuti/rhutils.h
+librhuti/specs.cc
+librhuti/splitfn.cc
+librhuti/stricat.cc
+librhuti/stridown.cc
+librhuti/stridup.cc
+librhuti/strifree.cc
+libz/.cvsignore
+libz/adler32.c
+libz/compress.c
+libz/crc32.c
+libz/deflate.c
+libz/deflate.h
+libz/gnumake.in
+libz/gzio.c
+libz/infblock.c
+libz/infblock.h
+libz/infcodes.c
+libz/infcodes.h
+libz/inffast.c
+libz/inffast.h
+libz/inffixed.h
+libz/inflate.c
+libz/inftrees.c
+libz/inftrees.h
+libz/infutil.c
+libz/infutil.h
+libz/README
+libz/trees.c
+libz/trees.h
+libz/uncompr.c
+libz/zconf.h
+libz/zlib.h
+libz/zutil.c
+libz/zutil.h
+libz/Makefile
+libz/Makefile.bcc
+libz/Makefile.nmk
+mainsrc/accehtml.cc
+mainsrc/bufun.cc
+mainsrc/ceditor.cc
+mainsrc/completi.cc
+mainsrc/deedidia.cc
+mainsrc/doedidia.cc
+mainsrc/dumpfile.cc
+mainsrc/edconst.cc
+mainsrc/editorfo.cc
+mainsrc/editwind.cc
+mainsrc/edspecs.cc
+mainsrc/fstrcmp.c
+mainsrc/gzfiles.cc
+mainsrc/keytrans.cc
+mainsrc/linelen.cc
+mainsrc/loaddefl.cc
+mainsrc/loadfunc.cc
+mainsrc/loadshl.cc
+mainsrc/loadusew.cc
+mainsrc/macrocom.cc
+mainsrc/pathtool.cc
+mainsrc/pclipper.cc
+mainsrc/pphp.cc
+mainsrc/pmacros.cc
+mainsrc/pperl.cc
+mainsrc/ppython.cc
+mainsrc/pvarious.cc
+mainsrc/pvhdl.cc
+mainsrc/rhideint.cc
+mainsrc/sdginter.cc
+mainsrc/search.cc
+mainsrc/slpinter.cc
+mainsrc/splinman.cc
+mainsrc/ssyntax.cc
+mainsrc/tags.cc
+mainsrc/tsindica.cc
+Makefile
+Makefile.bcc
+Makefile.nmk
+makes/.cvsignore
+makes/allegro.cfg
+-makes/amp3.gpr
+makes/blink.c
+makes/common.bmk
+makes/common.nmk
+makes/config.bcc
+makes/config.nmk
+*makes/djgppenv.env
+makes/djgpp/compinf.pl
+*makes/djgpp/compress.bat
+makes/djgpp/compress.pl
+-makes/easydiag.gpr
+-makes/editor.gpr
+makes/editor.bmk
+makes/editor.mkf
+-makes/extra.gpr
+makes/extrimk.cc
+makes/genimk.cc
+makes/includer.bmk
+-makes/inffd.gpr
+makes/infview.bmk
+-makes/infview.gpr
+makes/infview.mkf
+-makes/install.gpr
+makes/install.mkf
+-makes/librhuti.gpr
+-makes/libset.gpr
+makes/libset.mkf
+makes/line.par
+makes/linux.env
+makes/linux_set.env
+makes/linux/.cvsignore
++makes/linux/compress.pl
++makes/linux/compinf.pl
+makes/lista
+makes/listaxtr
+makes/Makefile
+makes/mlink.c
+makes/objinf/delete.me
+makes/objlib/delete.me
+makes/objsdg/delete.me
+makes/obj/delete.me
+*makes/readme.txt
+*makes/rhide.env
+*makes/r.bat
+-makes/sdgcline.gpr
+makes/sdgcline.mkf
+-makes/settv.gpr
+-makes/testeasy.gpr
+makes/testeasy.mkf
+makes/tmp/delete.me
+*makes/try-y.bat
+*makes/yamd-on.bat
+*makes/yamd-off.bat
+makes/yamddos.env
+miscperl.pl
+mp3/ampdiag.cc
+mp3/consts.h
+mp3/intermp3.cc
+mp3/intermp3.h
+mp3/libamp/.cvsignore
+mp3/libamp/amp.h
+mp3/libamp/audio.h
+mp3/libamp/audioalg.c
+mp3/libamp/audioio.h
+mp3/libamp/audiolib.c
+mp3/libamp/common.imk
+mp3/libamp/config.h
+mp3/libamp/controldata.h
+mp3/libamp/dump.c
+mp3/libamp/dump.h
+mp3/libamp/formats.h
+mp3/libamp/formats.c
+mp3/libamp/getbits.h
+mp3/libamp/getbits.c
+mp3/libamp/getdata.c
+mp3/libamp/getdata.h
+mp3/libamp/guicontr.c
+mp3/libamp/guicontrol.h
+mp3/libamp/huffman.c
+mp3/libamp/huffman.h
+mp3/libamp/layer2.c
+mp3/libamp/layer2.h
+mp3/libamp/layer3.c
+mp3/libamp/layer3.h
+mp3/libamp/libamp.h
+-mp3/libamp/libamp.gpr
+mp3/libamp/libamp.mkf
+mp3/libamp/misc2.c
+mp3/libamp/misc2.h
+mp3/libamp/obj/delete.me
+mp3/libamp/position.c
+mp3/libamp/position.h
+mp3/libamp/proto.h
+mp3/libamp/readme
+mp3/libamp/readme.txt
+mp3/libamp/rhide.env
+mp3/libamp/rtbuf.c
+mp3/libamp/rtbuf.h
+mp3/libamp/transfor.c
+mp3/libamp/transform.h
+mp3/libamp/util.c
+mp3/mp3list.cc
+mp3/mp3play.cc
+mp3/mp3play.h
+mp3/mpegsound/.cvsignore
+mp3/mpegsound/bitwindow.cc
+mp3/mpegsound/common.imk
+mp3/mpegsound/fileinput.cc
+mp3/mpegsound/fileplayer.cc
+mp3/mpegsound/filter.cc
+mp3/mpegsound/filter_2.cc
+mp3/mpegsound/httpinput.cc
+mp3/mpegsound/huffmantable.cc
+mp3/mpegsound/mpegtable.cc
+mp3/mpegsound/mpegtoraw.cc
+mp3/mpegsound/mpegwtoraw.cc
+mp3/mpegsound/mpglayr1.cc
+mp3/mpegsound/mpglayr2.cc
+mp3/mpegsound/mpglayr3.cc
+mp3/mpegsound/obj/delete.me
+mp3/mpegsound/osdisk.cc
+mp3/mpegsound/rawplayer.cc
+mp3/mpegsound/rawtofile.cc
+mp3/mpegsound/rawtowav.cc
+mp3/mpegsound/soundinputstream.cc
+mp3/mpegsound/soundplayer.cc
+mp3/mpegsound/wavetoraw.cc
+-mp3/mpegsound/mpegsnd.gpr
+mp3/mpegsound/mpegsnd.mkf
+mp3/mpegsound/mpegsound.h
+mp3/mpegsound/mpg_locals.h
+mp3/mpegsound/rhide.env
+names/nceditor.cc
+names/ndskwasc.cc
+names/ndskwcal.cc
+names/ndskwcli.cc
+names/ndskwclo.cc
+names/ndskwedi.cc
+names/ndskwhel.cc
+names/ndskwman.cc
+names/ndskwmes.cc
+names/ndskwmp3.cc
+names/ndskwprj.cc
+names/neditwin.cc
+names/nfileedi.cc
+names/nsindica.cc
+names/ntedcol.cc
+*policy.txt
+*README
++redhat/config-rpm.sh
++redhat/create-all-rpms.sh
++redhat/create-dirs.sh
++redhat/create-rpms.sh
+redhat/README
+redhat/setedit.spec.in
+scrnsave/Makefile
+scrnsave/copying
+scrnsave/extrscsv.txt
+scrnsave/how-to.txt
+scrnsave/readme.txt
+scrnsave/fakealle/fakealle.c
+scrnsave/fakealle/fakealle.gpr
+scrnsave/fakealle/fakealle.mak
+scrnsave/fakealle/putscree.c
+scrnsave/fakealle/varios1.c
+scrnsave/fakealle/include/fakealle.h
+scrnsave/fakealle/include/putscree.h
+scrnsave/fakealle/include/varios.h
+scrnsave/plasma1/ps1.c
+scrnsave/plasma1/ps1.gpr
+scrnsave/plasma1/ps1.mak
+scrnsave/plasma2/ps2.c
+scrnsave/plasma2/ps2.gpr
+scrnsave/plasma2/ps2.mak
+scrnsave/plasma3/ps3.c
+scrnsave/plasma3/ps3.gpr
+scrnsave/plasma3/ps3.mak
+scrnsave/plasma4/ps4.c
+scrnsave/plasma4/ps4.gpr
+scrnsave/plasma4/ps4.mak
+scrnsave/plasmlib/lissa.c
+scrnsave/plasmlib/math1.c
+scrnsave/plasmlib/math2.c
+scrnsave/plasmlib/math4.c
+scrnsave/plasmlib/mixsfake.gpr
+scrnsave/plasmlib/mixsfake.mak
+scrnsave/plasmlib/mixsurf.c
+scrnsave/plasmlib/mksurf1.c
+scrnsave/plasmlib/mksurf2.c
+scrnsave/plasmlib/mksurf4.c
+scrnsave/plasmlib/movsurf1.c
+scrnsave/plasmlib/movsurf2.c
+scrnsave/plasmlib/palette.c
+scrnsave/plasmlib/plasa1.c
+scrnsave/plasmlib/plasa2.c
+scrnsave/plasmlib/plasa2g.c
+scrnsave/plasmlib/plasa3.c
+scrnsave/plasmlib/plasmlib.gpr
+scrnsave/plasmlib/plasmlib.mak
+scrnsave/plasmlib/include/lissa.h
+scrnsave/plasmlib/include/math1.h
+scrnsave/plasmlib/include/math2.h
+scrnsave/plasmlib/include/math4.h
+scrnsave/plasmlib/include/mixsurf.h
+scrnsave/plasmlib/include/mksurf.h
+scrnsave/plasmlib/include/mksurf4.h
+scrnsave/plasmlib/include/movsurf1.h
+scrnsave/plasmlib/include/movsurf2.h
+scrnsave/plasmlib/include/palette.h
+scrnsave/plasmlib/include/plasa1.h
+scrnsave/plasmlib/obj/delete.me
+scrnsave/plasmlib/objfake/delete.me
+sdg/bufun2.cc
+sdg/edspecs2.cc
+sdg/gettext.c
+*sdg/html.frt
+sdg/include/mliabase.h
+sdg/include/mliasimp.h
+sdg/include/mlibase.h
+sdg/include/mlicsdg.h
+sdg/include/mlieditd.h
+sdg/include/mliedito.h
+sdg/include/mlisdgi.h
+sdg/include/mlisdg.h
+sdg/include/mlivar.h
+sdg/include/mli.h
+sdg/include/txhgen.h
+sdg/mliasimp.cc
+sdg/mlicsdg.cc
+sdg/mliediti.cc
+sdg/mliedito.cc
+sdg/mlisdg.cc
+sdg/mli.cc
+*sdg/multi.frt
+sdg/sdg.his
+*sdg/tex.frt
+*sdg/txhgen-i.htm
+*sdg/txhgen-i.txi
+*sdg/txhgen-i.txt
+sdg/txhgen.cc
+*sdg/txhgen.txt
+sdg/txhmain.cc
+setedit/advice.cc
+setedit/ascii.cc
+setedit/boardmix.cc
+setedit/calendar.cc
+setedit/codepage.cc
+setedit/debug.cc
+setedit/dskascii.cc
+setedit/dskcalen.cc
+setedit/dskclip.cc
+setedit/dskclose.cc
+setedit/dskedito.cc
+setedit/dskhelp.cc
+setedit/dskmessa.cc
+setedit/dskman.cc
+setedit/dskmp3.cc
+setedit/dskwin.cc
+setedit/dstfile.cc
+setedit/edcolor.cc
+setedit/edfonts.cc
+setedit/editdiag.cc
+setedit/editmain.cc
+setedit/editmenu.cc
+setedit/editpale.cc
+setedit/edkeys.cc
+setedit/edmsg.cc
+setedit/edprefs.cc
+setedit/edprint.cc
+setedit/edprj.cc
+setedit/getctxhl.cc
+setedit/holidays.cc
+setedit/include/ascii.h
+setedit/include/calendar.h
+setedit/include/advice.h
+setedit/include/codepage.h
+setedit/include/debug.h
+setedit/include/dskascii.h
+setedit/include/dskcalen.h
+setedit/include/dskclip.h
+setedit/include/dskclose.h
+setedit/include/dskedito.h
+setedit/include/dskhelp.h
+setedit/include/dskmessa.h
+setedit/include/dskman.h
+setedit/include/dskmp3.h
+setedit/include/dskprj.h
+setedit/include/dskwin.h
+setedit/include/edcollec.h
+setedit/include/editcoma.h
+setedit/include/edprint.h
+setedit/include/loadcle.h
+setedit/include/loadnobkp.h
+setedit/include/pal.h
+setedit/include/palbcc.h
+setedit/include/palconv.h
+setedit/include/palfte.h
+setedit/include/paldjd.h
+setedit/include/palmc.h
+setedit/include/pathlist.h
+setedit/include/setapp.h
+setedit/include/tpaltext.h
+setedit/intgrep.cc
+setedit/loadcle.cc
+setedit/loadnobkp.cc
+setedit/menuload.cc
+setedit/msignal.cc
+setedit/pathlist.cc
+setedit/runprog.cc
+setedit/scresave.cc
+setedit/streams/sdskasci.cc
+setedit/streams/sdskcale.cc
+setedit/streams/sdskclip.cc
+setedit/streams/sdskclos.cc
+setedit/streams/sdskedit.cc
+setedit/streams/sdskhelp.cc
+setedit/streams/sdskmess.cc
+setedit/streams/sdskman.cc
+setedit/streams/sdskmp3.cc
+setedit/streams/sdskprj.cc
+setedit/streams/sedcolle.cc
+setedit/tedcolle.cc
+setedit/tips.cc
+setedit/tpaltext.cc
+setedit/winlistd.cc
+settvuti/diaghelp.cc
+settvuti/dktclock.cc
+settvuti/fileopen.cc
+settvuti/fiopeaid.cc
+settvuti/include/diaghelp.h
+settvuti/include/dktclock.h
+settvuti/include/edhists.h
+settvuti/include/fileopen.h
+settvuti/include/fiopeaid.h
+settvuti/include/inputsca.h
+settvuti/include/nostatex.h
+settvuti/include/sarray.cc
+settvuti/include/sarray.h
+settvuti/include/setstack.h
+settvuti/include/settvuti.h
+settvuti/include/tdiagaid.h
+settvuti/include/tdiagrow.h
+settvuti/include/tinppipe.h
+settvuti/include/tnocastc.h
+settvuti/include/tnosostr.h
+settvuti/include/tprogbar.h
+settvuti/include/tprogdia.h
+settvuti/include/tprogrdi.h
+settvuti/include/tprogres.h
+settvuti/include/tstringa.h
+settvuti/include/tstrlbox.h
+settvuti/include/viewplus.h
+settvuti/inputsca.cc
+settvuti/names/ninputsc.cc
+settvuti/names/nprogbar.cc
+settvuti/names/nprogres.cc
+settvuti/names/ntnocast.cc
+settvuti/names/ntnosost.cc
+settvuti/nostatex.cc
+settvuti/setstack.cc
+settvuti/streams/sprogbar.cc
+settvuti/streams/sprogres.cc
+settvuti/streams/stnocast.cc
+settvuti/streams/stnonost.cc
+settvuti/tdiagaid.cc
+settvuti/tdiagrow.cc
+settvuti/tinppipe.cc
+settvuti/tnocastc.cc
+settvuti/tnosostr.cc
+settvuti/tprogbar.cc
+settvuti/tprogdia.cc
+settvuti/tprogrdi.cc
+settvuti/tprogres.cc
+settvuti/tstrlbox.cc
+settvuti/uisarray.cc
+settvuti/ussarray.cc
+settvuti/viewplus.cc
++set_insed
+snapshot.pl
+streams/sceditor.cc
+streams/sedhelp.cc
+streams/ssindica.cc
+TODO
+tools/applycvs.pl
+tools/cmclist.c
+tools/conv.cc
++tools/cvssget
++tools/cvssput
+tools/cvssyncget.cc
+tools/cvssyncput.cc
+tools/kbv.c
+tools/lines.pl
+*tools/makediff.bat
++tools/makediff.pl
+tools/mapa.cc
+tools/mft.c
+tools/mft.gpr
+tools/mideline.cc
+tools/moverepo.pl
++tools/putcopyr.pl
+tools/symify.cc
+tools/TVpo.pl
+tools/valgrind.cmd
+tools/woody.supp
+tools/sarge.supp
++update
+*update.bat
+version.txt
+updaterev.pl
+*windos.faq
+www-site/announce.html
+www-site/change.html
+www-site/ComparativaGCC.html
+www-site/ComparativaGCC_html_m35e8e2b6.jpg
+www-site/Cygwin_install.txt
+www-site/examples.css
+www-site/iguazu.html
+www-site/index.html
+www-site/infview.html
+www-site/my_file1.html
+www-site/my_file2.html
+www-site/my_file3.html
+www-site/pmoreno.html
+www-site/readme.html
+www-site/readmeinf.html
+www-site/tag_imgs/a_project.png
+www-site/tag_imgs/advice_tags.png
+www-site/tag_imgs/class_child1.png
+www-site/tag_imgs/class_list.png
+www-site/tag_imgs/d_tag_options.png
+www-site/tag_imgs/generate_tags.png
+www-site/tag_imgs/jump_symbol.png
+www-site/tag_imgs/name_project.png
+www-site/tag_imgs/project_open.png
+www-site/tag_imgs/sorted.png
+www-site/tag_imgs/symbols_example.png
+www-site/tag_imgs/tag_options.png
+www-site/tag_imgs/this_and_parents.png
+www-site/tag_imgs/this_class.png
+www-site/tag_imgs/w_completion.png
+www-site/tags.html
++www-site/update
+www-site/xterm.html
+WinNT/configed.h
+-WinNT/makeinfo/makeinfo.exe
+WinNT/bccmake.in
+WinNT/Makefile
+WinNT/Makefile.nmk
+WinNT/msvcmake.in
+WinNT/README
+WinNT/objs/delete.me
diff --git a/setedit/makes/listaxtr b/setedit/makes/listaxtr
new file mode 100644
index 0000000..db08b39
--- /dev/null
+++ b/setedit/makes/listaxtr
@@ -0,0 +1,6 @@
+makes/*.imk
+makes/*.umk
+mp3/libamp/libamp.imk
+mp3/libamp/libamp.umk
+mp3/mpegsound/mpegsnd.imk
+mp3/mpegsound/mpegsnd.umk
diff --git a/setedit/makes/mlink.c b/setedit/makes/mlink.c
new file mode 100644
index 0000000..a963833
--- /dev/null
+++ b/setedit/makes/mlink.c
@@ -0,0 +1,73 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2004-2005 by Salvador E. Tropea.
+ Covered by the GPL license.
+ Description:
+ MS lib have a really useless command line. This wrapper avoids all the
+complexities.
+ Also: I failed to create a macro that expands to something that creates
+a response file. Looks like it only works outside macros. This program
+just collects the files from the specified directories and creates the
+library with all of them.
+
+***************************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define MAX_FILE 256
+
+int main(int argc, char *argv[])
+{
+ FILE *f;
+ int i,ret;
+ WIN32_FIND_DATA de;
+ char dirMask[MAX_PATH+8];
+ HANDLE d;
+
+ if (argc<3)
+ {
+ printf("MS lib wrapper\n");
+ printf("Copyright (c) 2004-2005 by Salvador E. Tropea. GPL.\n");
+ printf("Usage: mlink [switches] [libraries] directories\n");
+ return 1;
+ }
+ f=fopen("mslink.lnk","wt");
+ if (!f)
+ {
+ printf("Can't create response file\n");
+ return 2;
+ }
+ for (i=1; i<argc; i++)
+ {
+ if (argv[i][0]=='/' || strstr(argv[i],".lib") || strstr(argv[i],".obj"))
+ {
+ fprintf(f,"%s ",argv[i]);
+ continue;
+ }
+ sprintf(dirMask,"%s\\*.obj",argv[i]);
+ d=FindFirstFile(dirMask,&de);
+ if (d==INVALID_HANDLE_VALUE)
+ {
+ printf("Can't open directory %s\n",argv[i]);
+ return 4;
+ }
+ do
+ {
+ //printf("%s\n",de.cFileName);
+ fprintf(f,"%s\\%s ",argv[i],de.cFileName);
+ }
+ while (FindNextFile(d,&de));
+ FindClose(d);
+ }
+ fprintf(f,"\n");
+ fclose(f);
+
+ ret=system("link @mslink.lnk");
+ if (!ret)
+ unlink("mslink.lnk");
+ return ret;
+}
+
diff --git a/setedit/makes/obj/delete.me b/setedit/makes/obj/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/makes/obj/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/makes/objinf/delete.me b/setedit/makes/objinf/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/makes/objinf/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/makes/objlib/delete.me b/setedit/makes/objlib/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/makes/objlib/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/makes/objsdg/delete.me b/setedit/makes/objsdg/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/makes/objsdg/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/makes/r.bat b/setedit/makes/r.bat
new file mode 100644
index 0000000..44de1d5
--- /dev/null
+++ b/setedit/makes/r.bat
@@ -0,0 +1,8 @@
+Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+Rem see copyrigh file for details
+
+Rem That's normally true:
+SET TVISION=../../tvision
+
+Rem I use this redirection to catch RHIDE bugs
+redir -e errorrh.bak rhide editor.gpr
diff --git a/setedit/makes/readme.txt b/setedit/makes/readme.txt
new file mode 100644
index 0000000..4ac25fa
--- /dev/null
+++ b/setedit/makes/readme.txt
@@ -0,0 +1,218 @@
+Hi!
+
+ This directory contains the files needed to make the editor. You should
+read the readme.txt file located in the root directory of the distribution
+before reading it.
+ Please read this file if you want to have less problems while compiling.
+
+Topics:
+
+0. I don't have time to read it. <----- Quick instructions
+1. Systems where RHIDE is installed.
+2. Systems without RHIDE.
+3. Other .gpr files included.
+4. MP3 support under DOS.
+5. Generating the distribution files.
+6. Installing the compiled files.
+
+
+0. I don't have time to read it:
+-------------------------------
+
+
+DOS ONLY: ------->
+ Edit the ../include/ceditint.h and comment the line:
+ # define SUP_MP3
+ Remove alleg and amp in editor.mak, the line looks like it:
+ RHIDE_OS_LIBS=amp alleg intl
+<-------
+Windows NT ONLY: ------->
+ Read the README located in ..\WinNT directory.
+<-------
+
+ If that's your case just run 'make' in this directory and cross your
+fingers. If you have all the needed tools you'll get the editor compiled
+after some minutes. Then just run 'make install' to install it. If it fails
+then you'll need time to read the rest ;-)
+ Note: You can just run 'make install' directly.
+ Don't forget to install Turbo Vision first.
+
+
+
+1. Systems where RHIDE is installed:
+-----------------------------------
+
+Needed tools: RHIDE: last beta release.
+
+ The .gpr files are RHIDE projects files and they are the best methode to
+make the editor. You must have the last release of RHIDE to use these files.
+The files contains the dependencies. These dependencies are to internal .h
+files or Turbo Vision files, they are constructed supposing you installed
+Turbo Vision in ../../tvision/ for example: /usr/src/tvision and
+/usr/src/setedit or c:/djgpp/contrib/tvision or c:/djgpp/contrib/setedit.
+If you didn't do it the dependencies will fail.
+
+ The .gpr files are the same for both OSs (DOS and Linux) all the OS
+specific (or just configurable) stuff is specified in the rhide.env file.
+
+ If you have the DOS distribution and you want to compile it under Linux you
+can copy linux.env to rhide.env (don't worry you can overwrite it because
+djgppenv.env contains what rhide.env currently contains) and that's all.
+
+ You can easilly configure the compilation process editing rhide.env. For
+example: if you want to compile the editor without debug information you can
+do it editing the
+
+RHIDE_OS_BOTH=-Wall -Werror -gstabs3 -O2
+
+definition to delete the -gstabs3 option.
+
+ The steps are:
+0) Read the point 4 for the DOS version.
+A) Edit rhide.env to match your OS and needs. djgppenv.env is what I use in
+DOS and linux.env is what I use in Linux. You should choose the debug
+options, optimization, C++ especific options, etc.
+B) Run "rhide editor.gpr".
+C) Press F9.
+
+
+
+2. Systems without RHIDE:
+------------------------
+
+Needed tools:
+make: I use 3.77 in DOS and 3.76.1 in Linux.
+fileutiles: it means rm, mv, cat, etc.
+perl: 5.x. Not normally needed, but some scripts are in perl.
+
+ That's the alternative way, I tried it and works ok.
+
+ The .mak files contains the dependencies. These dependencies are to
+internal .h files or Turbo Vision files, they are constructed supposing
+you installed in ../../tvision/ for example: /usr/src/tvision and
+/usr/src/setedit or c:/djgpp/contrib/tvision or c:/djgpp/contrib/setedit.
+If you didn't do it the dependencies will fail.
+
+ Currently I create the makefiles (*.mak) using a Makefile that calls
+gpr2mak (a RHIDE tool to convert .gpr files to make format). The .gpr files
+are the same for both OSs (DOS and Linux) all the OS specific stuff is
+specified in the rhide.env file.
+
+ If you have the DOS distribution and you want to compile it under Linux you
+can copy linux.env to rhide.env (don't worry you can overwrite it because
+djgppenv.env contains what rhide.env currently contains), do a "touch
+rhide.env" (or just delete all the .mak files) and run "make makes". It will
+create the makefiles again but with the Linux settings.
+ If you need to reconfigure the makefiles for an OS where you don't have
+gpr2mak you can do it in another OS and then copy the .mak files, you just
+need to edit rhide.env. If you don't have access to a platform with RHIDE
+don't desesperate and continue reading.
+
+ To configure the .gpr files you just need to edit the rhide.env file, this
+will also configure the .imk and .mkf files derived from the .mak files.
+
+ The steps are:
+1) Read the point 4 for the DOS version.
+2) Edit rhide.env to match your OS and needs. djgppenv.env is what I use in
+DOS and linux.env is what I use in Linux. You should choose the debug
+options, optimization, C++ especific options, etc.
+3) Run "make".
+
+
+
+3. Other .gpr files included:
+----------------------------
+
+ I'm including some extra project files that you could want to use. They are
+only in RHIDE format by now because I think they won't be used by much
+people.
+ testeasy.gpr: Creates an easydiag test program. This program is only to test
+some easydiag features and debug it. The program will probably end with a
+SIGSEGV if you close the test dialog, that's fine because I'm not
+initializing some important things. The test is just to see how well the
+widgets are aligned and show how to use the library.
+ sdgcline.gpr: Creates a command line version of SDG (SET's Documentation
+Generator). It could be outdated because I don't normally use the command
+line version.
+ libset.gpr: Creates a libset.a file containing all the modules. That's used
+by Robert Hoehne to incorporate the editor in RHIDE.
+
+
+
+4. MP3 support under DOS:
+------------------------
+
+ The DOS version supports MP3 songs, yes you can play your favorite song
+while reading/writing even under plain DOS (no multitasker).
+ By default the editor enables the MP3 support, you can disable it editing
+the include/ceditint.h file and commenting the #define SUP_MP3 line.
+Additionally you should edit rhide.env and remove "amp alleg" from the
+definition of the RHIDE_OS_LIBS variable.
+ If you want the support enabled (the default) you'll need libamp and
+liballeg in your system. Allegro can be downloaded from any Simtelnet mirror
+(normally is in the /pub/simtelnet/gnu/djgpp/v2tk/allegro). Only sources are
+available for download so you'll need to compile it. The version needed is
+the one named in readme.src (3.1 for v0.4.23 for example). I use a patched
+version of libamp so I included the sources. As the code is just a disaster I
+didn't include the libamp project in the main project. The code uses tabs
+and a very bad indentation methode. I guess that's the most common but when
+the code have 5 or 6 levels of if/else the code is totally impossible to
+track, in fact gcc gives tons of warnings about ambiguos else statements and
+I think at least 3 of them are plain bugs! Anyways, the code works. To create
+the library go to the mp3/libamp directory and start RHIDE or do "make -f
+libamp.mak".
+
+
+
+5. Generating the distribution files:
+------------------------------------
+
+Needed tools: make, perl and makeinfo.
+
+ To generated the distribution packages you just need to run 'make distrib'.
+It will generate the distribution in the djgpp/result or linux/result
+directory. Under DOS the output files are in ZIP format and in Linux .tar.gz.
+To do it you need Perl 5.x and fileutils for DOS.
+ Notes for DOS:
+ The files are placed in djgpp/result in .ZIP format. An uncompressed tree
+is left in djgpp/distrib. You can change the target directory defining an
+environment variable called prefix or PREFIX or calling the compress.pl
+script by hand and using '--prefix PATH' as parameter. It will generate the
+.ZIP files in PATH/result and the tree in PATH/distrib. The files are *ever*
+packed to be installed in a djgpp tree, no matters what the prefix is.
+ Notes for Linux:
+ The files are placed in linux/result in .tar.gz format. An uncompressed
+tree is left in linux/distrib. The user rights and destination directory are
+configured in the INSTALL.MAK file. If you define an environment variable
+called prefix or PREFIX the script will modify the INSTALL.MAK makefile to
+match this definition. The same can be done using the '--prefix PATH'
+parameter of the script. By default the prefix is /usr.
+
+
+
+6. Installing the compiled files:
+--------------------------------
+
+ The recommended methode is first generate the distribution package and then
+just install the file, just like if you downloaded it. If you are a make
+fanatic or need something very automatic you can just try 'make install'. I
+don't think that's the best because you don't keep a package and because you
+can't see what exactly will be installed until the files are installed.
+You'll need the same tools needed for 'Generating the distribution files'.
+ Notes for DOS:
+ Using 'make install' the files are simply copied from the sources to the
+%DJDIR% tree. If you want to install the files in other directory use the
+prefix mechanism descripted in 'Generating the distribution files'.
+ Notes for Linux:
+ The make install process is relative 'fake', what I do is first create the
+distribution tree (not the .tar.gz) and then just run the INSTALL.LINUX
+script. So if you want to configure the user rights and other stuff just edit
+the ../distrib/INSTALL.MAK file. The only thing you can configure without
+editing this file is the prefix. By default the package is generated to be
+installed in /usr but as some people uses /usr/local you can fix it defining
+an environment variable like this (bash):
+
+export PREFIX="/usr/local"
+
+ And then calling 'make install'. In this way the files will be installed in
+/usr/local/bin, /usr/local/share/setedit, etc.
diff --git a/setedit/makes/rhide.env b/setedit/makes/rhide.env
new file mode 100644
index 0000000..5f81452
--- /dev/null
+++ b/setedit/makes/rhide.env
@@ -0,0 +1,21 @@
+#
+# Automatically generated by configure script
+#
+
+RHIDE_GCC=gcc
+RHIDE_GXX=g++
+RHIDE_LD=g++
+RHIDE_AR=ar
+RHIDE_OS_CFLAGS=-march=i686 -mtune=generic -O2 -pipe
+RHIDE_OS_CXXFLAGS=-march=i686 -mtune=generic -O2 -pipe
+RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib ../libmigdb/src $(TVISION_INC)/cl
+RHIDE_OS_LIBS=-lrhtv -ldl -lbz2 -lmpegsnd -laa -lz -lpcre -lmigdb
+RHIDE_OS_LIBS_PATH=-L/usr/lib -L/home/sergej/community-my.svn/tvision/trunk/src/tvision/makes -L/usr/X11R6/lib -L../libmigdb/src -L.
+TVISION_INC=/usr/include/rhtvision
+SUPPORT_INC= ../libmigdb/src
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+STDCPP_LIB=-lstdc++
+RHIDE_LIBS=$(LIBS) $(RHIDE_OS_LIBS)
+RHIDE_LIBDIRS=$(LIB_DIRS)
diff --git a/setedit/makes/sdgcline.gpr b/setedit/makes/sdgcline.gpr
new file mode 100644
index 0000000..cdbcb8a
--- /dev/null
+++ b/setedit/makes/sdgcline.gpr
Binary files differ
diff --git a/setedit/makes/sdgcline.imk b/setedit/makes/sdgcline.imk
new file mode 100644
index 0000000..947d687
--- /dev/null
+++ b/setedit/makes/sdgcline.imk
@@ -0,0 +1,374 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ objsdg/bufun2$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ objsdg/mli$(ExOBJ) \
+ objsdg/mliasimp$(ExOBJ) \
+ objsdg/mlicsdg$(ExOBJ) \
+ objsdg/mlisdg$(ExOBJ) \
+ objsdg/ntnocast$(ExOBJ) \
+ objsdg/setstack$(ExOBJ) \
+ objsdg/stnocast$(ExOBJ) \
+ objsdg/tnocastc$(ExOBJ) \
+ objsdg/txhgen$(ExOBJ) \
+ objsdg/txhmain$(ExOBJ)
+
+LIBRARIES=\
+ librhuti$(ExLIB)
+
+sdg$(ExEXE):: \
+ objsdg/bufun2$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ librhuti$(ExLIB) \
+ objsdg/mli$(ExOBJ) \
+ objsdg/mliasimp$(ExOBJ) \
+ objsdg/mlicsdg$(ExOBJ) \
+ objsdg/mlisdg$(ExOBJ) \
+ objsdg/ntnocast$(ExOBJ) \
+ objsdg/setstack$(ExOBJ) \
+ objsdg/stnocast$(ExOBJ) \
+ objsdg/tnocastc$(ExOBJ) \
+ objsdg/txhgen$(ExOBJ) \
+ objsdg/txhmain$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+objsdg/bufun2$(ExOBJ):: ../sdg/bufun2.cc \
+ compatlayer.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ ucdefs.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=extra$(ExIMK)
+
+objsdg/mli$(ExOBJ):: ../sdg/mli.cc \
+ compatlayer.h \
+ dyncat.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlivar.h \
+ pathtool.h \
+ tv.h \
+ tv/codepage.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/mliasimp$(ExOBJ):: ../sdg/mliasimp.cc \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlivar.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/mlicsdg$(ExOBJ):: ../sdg/mlicsdg.cc \
+ compatlayer.h \
+ mli.h \
+ mliabase.h \
+ mlibase.h \
+ mlicsdg.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ ucdefs.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/mlisdg$(ExOBJ):: ../sdg/mlisdg.cc \
+ compatlayer.h \
+ mli.h \
+ mliabase.h \
+ mliasimp.h \
+ mlibase.h \
+ mlicsdg.h \
+ mlisdg.h \
+ mlisdgi.h \
+ mlivar.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/ntnocast$(ExOBJ):: ../settvuti/names/ntnocast.cc \
+ compatlayer.h \
+ tv/configtv.h \
+ tv/tvutil.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/setstack$(ExOBJ):: ../settvuti/setstack.cc \
+ compatlayer.h \
+ setstack.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/stnocast$(ExOBJ):: ../settvuti/streams/stnocast.cc \
+ compatlayer.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strmblcl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/tnocastc$(ExOBJ):: ../settvuti/tnocastc.cc \
+ compatlayer.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tkeys.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ tvsetuti.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/txhgen$(ExOBJ):: ../sdg/txhgen.cc \
+ bufun.h \
+ cl/unistd.h \
+ compatlayer.h \
+ mli.h \
+ mlisdgi.h \
+ rhutils.h \
+ setstack.h \
+ settvuti.h \
+ tnocastc.h \
+ tv.h \
+ tv/codepage.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/parttree.h \
+ tv/pstream.h \
+ tv/resource.h \
+ tv/sortcoll.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/strncoll.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/views.h \
+ tv/yes_mss.h \
+ txhgen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+objsdg/txhmain$(ExOBJ):: ../sdg/txhmain.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ mli.h \
+ mlisdgi.h \
+ tv.h \
+ tv/configtv.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/opstream.h \
+ tv/pstream.h \
+ tv/stddlg.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvutil.h \
+ tv/views.h \
+ txhgen.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/sdgcline.mkf b/setedit/makes/sdgcline.mkf
new file mode 100644
index 0000000..bcd1986
--- /dev/null
+++ b/setedit/makes/sdgcline.mkf
@@ -0,0 +1,58 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=../mainsrc ../names ../streams ../setedit ../setedit/names ../setedit/streams \
+ ../infview ../sdg ../settvuti ../settvuti/names ../settvuti/streams ../extra \
+ ../mp3 ../calcu ../easydiag ../infview/names ../infview/streams ../librhuti
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+SDG_INC_DIR=../sdg/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_INC_DIR=../mp3
+CALCU_INC_DIR=../calcu
+INCLUDE_DIRS=$(INCLUDE_DIR) $(SETEDIT_INC_DIR) $(SETTVUTI_INC_DIR) \
+ $(SDG_INC_DIR) $(INFVIEW_INC_DIR) $(TVISION_INC) $(EXTRA_INC_DIR) \
+ $(EASYDIAG_INC_DIR) $(LIBRHUTI_INC_DIR) $(SUPPORT_INC) \
+ $(MP3_INC_DIR) $(CALCU_INC_DIR)
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+ifdef MAINTAINER_MODE
+ ExIMK=.imk
+else
+ ExIMK=.umk
+endif
+include sdgcline$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/setedit/makes/sdgcline.umk b/setedit/makes/sdgcline.umk
new file mode 100644
index 0000000..274d0ab
--- /dev/null
+++ b/setedit/makes/sdgcline.umk
@@ -0,0 +1,89 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ objsdg/bufun2$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ objsdg/mli$(ExOBJ) \
+ objsdg/mliasimp$(ExOBJ) \
+ objsdg/mlicsdg$(ExOBJ) \
+ objsdg/mlisdg$(ExOBJ) \
+ objsdg/ntnocast$(ExOBJ) \
+ objsdg/setstack$(ExOBJ) \
+ objsdg/stnocast$(ExOBJ) \
+ objsdg/tnocastc$(ExOBJ) \
+ objsdg/txhgen$(ExOBJ) \
+ objsdg/txhmain$(ExOBJ)
+
+LIBRARIES=\
+ librhuti$(ExLIB)
+
+sdg$(ExEXE):: \
+ objsdg/bufun2$(ExOBJ) \
+ obj/djmdr$(ExOBJ) \
+ obj/dyncat$(ExOBJ) \
+ obj/memmove$(ExOBJ) \
+ obj/mixer$(ExOBJ) \
+ obj/mixersb$(ExOBJ) \
+ obj/mixoss$(ExOBJ) \
+ obj/stackdbg$(ExOBJ) \
+ obj/strncpyz$(ExOBJ) \
+ obj/strndup$(ExOBJ) \
+ librhuti$(ExLIB) \
+ objsdg/mli$(ExOBJ) \
+ objsdg/mliasimp$(ExOBJ) \
+ objsdg/mlicsdg$(ExOBJ) \
+ objsdg/mlisdg$(ExOBJ) \
+ objsdg/ntnocast$(ExOBJ) \
+ objsdg/setstack$(ExOBJ) \
+ objsdg/stnocast$(ExOBJ) \
+ objsdg/tnocastc$(ExOBJ) \
+ objsdg/txhgen$(ExOBJ) \
+ objsdg/txhmain$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+objsdg/bufun2$(ExOBJ):: ../sdg/bufun2.cc
+ $(RHIDE_COMPILE_CC)
+
+INCLUDE00=extra$(ExIMK)
+
+objsdg/mli$(ExOBJ):: ../sdg/mli.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/mliasimp$(ExOBJ):: ../sdg/mliasimp.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/mlicsdg$(ExOBJ):: ../sdg/mlicsdg.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/mlisdg$(ExOBJ):: ../sdg/mlisdg.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/ntnocast$(ExOBJ):: ../settvuti/names/ntnocast.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/setstack$(ExOBJ):: ../settvuti/setstack.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/stnocast$(ExOBJ):: ../settvuti/streams/stnocast.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/tnocastc$(ExOBJ):: ../settvuti/tnocastc.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/txhgen$(ExOBJ):: ../sdg/txhgen.cc
+ $(RHIDE_COMPILE_CC)
+
+objsdg/txhmain$(ExOBJ):: ../sdg/txhmain.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/settv.gpr b/setedit/makes/settv.gpr
new file mode 100644
index 0000000..74cf303
--- /dev/null
+++ b/setedit/makes/settv.gpr
Binary files differ
diff --git a/setedit/makes/settv.imk b/setedit/makes/settv.imk
new file mode 100644
index 0000000..7545e37
--- /dev/null
+++ b/setedit/makes/settv.imk
@@ -0,0 +1,261 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+libsettv$(ExLIB):: \
+ obj/diaghelp$(ExOBJ) \
+ obj/dktclock$(ExOBJ) \
+ obj/fileopen$(ExOBJ) \
+ obj/fiopeaid$(ExOBJ) \
+ obj/inputsca$(ExOBJ) \
+ obj/ninputsc$(ExOBJ) \
+ obj/nostatex$(ExOBJ) \
+ obj/nprogbar$(ExOBJ) \
+ obj/nprogres$(ExOBJ) \
+ obj/ntnocast$(ExOBJ) \
+ obj/ntnosost$(ExOBJ) \
+ obj/setstack$(ExOBJ) \
+ obj/sprogbar$(ExOBJ) \
+ obj/sprogres$(ExOBJ) \
+ obj/stnocast$(ExOBJ) \
+ obj/stnonost$(ExOBJ) \
+ obj/tdiagaid$(ExOBJ) \
+ obj/tdiagrow$(ExOBJ) \
+ obj/tinppipe$(ExOBJ) \
+ obj/tnocastc$(ExOBJ) \
+ obj/tnosostr$(ExOBJ) \
+ obj/tprogbar$(ExOBJ) \
+ obj/tprogdia$(ExOBJ) \
+ obj/tprogrdi$(ExOBJ) \
+ obj/tprogres$(ExOBJ) \
+ obj/tstrlbox$(ExOBJ) \
+ obj/uisarray$(ExOBJ) \
+ obj/ussarray$(ExOBJ) \
+ obj/viewplus$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/diaghelp$(ExOBJ):: ../settvuti/diaghelp.cc \
+ compatlayer.h \
+ edspecs.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/msgbox.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/ssc_streams.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/dktclock$(ExOBJ):: ../settvuti/dktclock.cc \
+ ceditint.h \
+ compatlayer.h \
+ configed.h \
+ dktclock.h \
+ settvuti.h \
+ tv.h \
+ tv/configtv.h \
+ tv/drawbuf.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/pstream.h \
+ tv/ssc_streams.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fileopen$(ExOBJ):: ../settvuti/fileopen.cc \
+ compatlayer.h \
+ fileopen.h \
+ tv.h \
+ tv/app.h \
+ tv/button.h \
+ tv/chdirdlg.h \
+ tv/collectn.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/filecoll.h \
+ tv/filedlg.h \
+ tv/filelist.h \
+ tv/group.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/nssorcol.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/rect.h \
+ tv/searchrc.h \
+ tv/sortcoll.h \
+ tv/sortlibo.h \
+ tv/ssc_streams.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fiopeaid$(ExOBJ):: ../settvuti/fiopeaid.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/inputsca$(ExOBJ):: ../settvuti/inputsca.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ninputsc$(ExOBJ):: ../settvuti/names/ninputsc.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nostatex$(ExOBJ):: ../settvuti/nostatex.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogbar$(ExOBJ):: ../settvuti/names/nprogbar.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogres$(ExOBJ):: ../settvuti/names/nprogres.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ntnocast$(ExOBJ):: ../settvuti/names/ntnocast.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ntnosost$(ExOBJ):: ../settvuti/names/ntnosost.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/setstack$(ExOBJ):: ../settvuti/setstack.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sprogbar$(ExOBJ):: ../settvuti/streams/sprogbar.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/sprogres$(ExOBJ):: ../settvuti/streams/sprogres.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/stnocast$(ExOBJ):: ../settvuti/streams/stnocast.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/stnonost$(ExOBJ):: ../settvuti/streams/stnonost.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdiagaid$(ExOBJ):: ../settvuti/tdiagaid.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tdiagrow$(ExOBJ):: ../settvuti/tdiagrow.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tinppipe$(ExOBJ):: ../settvuti/tinppipe.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tnocastc$(ExOBJ):: ../settvuti/tnocastc.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tnosostr$(ExOBJ):: ../settvuti/tnosostr.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogbar$(ExOBJ):: ../settvuti/tprogbar.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogdia$(ExOBJ):: ../settvuti/tprogdia.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogrdi$(ExOBJ):: ../settvuti/tprogrdi.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogres$(ExOBJ):: ../settvuti/tprogres.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrlbox$(ExOBJ):: ../settvuti/tstrlbox.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/uisarray$(ExOBJ):: ../settvuti/uisarray.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/ussarray$(ExOBJ):: ../settvuti/ussarray.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/viewplus$(ExOBJ):: ../settvuti/viewplus.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/settv.umk b/setedit/makes/settv.umk
new file mode 100644
index 0000000..9848fe1
--- /dev/null
+++ b/setedit/makes/settv.umk
@@ -0,0 +1,124 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+libsettv$(ExLIB):: \
+ obj/diaghelp$(ExOBJ) \
+ obj/dktclock$(ExOBJ) \
+ obj/fileopen$(ExOBJ) \
+ obj/fiopeaid$(ExOBJ) \
+ obj/inputsca$(ExOBJ) \
+ obj/ninputsc$(ExOBJ) \
+ obj/nostatex$(ExOBJ) \
+ obj/nprogbar$(ExOBJ) \
+ obj/nprogres$(ExOBJ) \
+ obj/ntnocast$(ExOBJ) \
+ obj/ntnosost$(ExOBJ) \
+ obj/setstack$(ExOBJ) \
+ obj/sprogbar$(ExOBJ) \
+ obj/sprogres$(ExOBJ) \
+ obj/stnocast$(ExOBJ) \
+ obj/stnonost$(ExOBJ) \
+ obj/tdiagaid$(ExOBJ) \
+ obj/tdiagrow$(ExOBJ) \
+ obj/tinppipe$(ExOBJ) \
+ obj/tnocastc$(ExOBJ) \
+ obj/tnosostr$(ExOBJ) \
+ obj/tprogbar$(ExOBJ) \
+ obj/tprogdia$(ExOBJ) \
+ obj/tprogrdi$(ExOBJ) \
+ obj/tprogres$(ExOBJ) \
+ obj/tstrlbox$(ExOBJ) \
+ obj/uisarray$(ExOBJ) \
+ obj/ussarray$(ExOBJ) \
+ obj/viewplus$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/diaghelp$(ExOBJ):: ../settvuti/diaghelp.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/dktclock$(ExOBJ):: ../settvuti/dktclock.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fileopen$(ExOBJ):: ../settvuti/fileopen.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fiopeaid$(ExOBJ):: ../settvuti/fiopeaid.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/inputsca$(ExOBJ):: ../settvuti/inputsca.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ninputsc$(ExOBJ):: ../settvuti/names/ninputsc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nostatex$(ExOBJ):: ../settvuti/nostatex.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogbar$(ExOBJ):: ../settvuti/names/nprogbar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/nprogres$(ExOBJ):: ../settvuti/names/nprogres.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ntnocast$(ExOBJ):: ../settvuti/names/ntnocast.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ntnosost$(ExOBJ):: ../settvuti/names/ntnosost.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/setstack$(ExOBJ):: ../settvuti/setstack.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sprogbar$(ExOBJ):: ../settvuti/streams/sprogbar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/sprogres$(ExOBJ):: ../settvuti/streams/sprogres.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/stnocast$(ExOBJ):: ../settvuti/streams/stnocast.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/stnonost$(ExOBJ):: ../settvuti/streams/stnonost.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdiagaid$(ExOBJ):: ../settvuti/tdiagaid.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tdiagrow$(ExOBJ):: ../settvuti/tdiagrow.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tinppipe$(ExOBJ):: ../settvuti/tinppipe.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tnocastc$(ExOBJ):: ../settvuti/tnocastc.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tnosostr$(ExOBJ):: ../settvuti/tnosostr.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogbar$(ExOBJ):: ../settvuti/tprogbar.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogdia$(ExOBJ):: ../settvuti/tprogdia.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogrdi$(ExOBJ):: ../settvuti/tprogrdi.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tprogres$(ExOBJ):: ../settvuti/tprogres.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/tstrlbox$(ExOBJ):: ../settvuti/tstrlbox.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/uisarray$(ExOBJ):: ../settvuti/uisarray.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/ussarray$(ExOBJ):: ../settvuti/ussarray.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/viewplus$(ExOBJ):: ../settvuti/viewplus.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/testeasy.gpr b/setedit/makes/testeasy.gpr
new file mode 100644
index 0000000..b05818f
--- /dev/null
+++ b/setedit/makes/testeasy.gpr
Binary files differ
diff --git a/setedit/makes/testeasy.imk b/setedit/makes/testeasy.imk
new file mode 100644
index 0000000..b14353c
--- /dev/null
+++ b/setedit/makes/testeasy.imk
@@ -0,0 +1,96 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ obj/test$(ExOBJ)
+
+LIBRARIES=\
+ libsettv$(ExLIB) \
+ libeasyd$(ExLIB)
+
+test$(ExEXE):: \
+ libeasyd$(ExLIB) \
+ libsettv$(ExLIB) \
+ obj/test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+INCLUDE00=easydiag$(ExIMK)
+
+obj/test$(ExOBJ):: ../easydiag/test.cc \
+ compatlayer.h \
+ easydia1.h \
+ easydiag.h \
+ nostatex.h \
+ settvuti.h \
+ snostate.h \
+ tinppipe.h \
+ tsbutton.h \
+ tschkbox.h \
+ tshzgrp.h \
+ tsinplin.h \
+ tsinplpi.h \
+ tslabel.h \
+ tslider.h \
+ tslistbo.h \
+ tsradbot.h \
+ tssortlb.h \
+ tssortva.h \
+ tstatext.h \
+ tstextsc.h \
+ tsvegrp.h \
+ tsview.h \
+ tsviewco.h \
+ ttextscr.h \
+ tv.h \
+ tv/app.h \
+ tv/applictn.h \
+ tv/button.h \
+ tv/checkbox.h \
+ tv/cluster.h \
+ tv/configtv.h \
+ tv/desktop.h \
+ tv/dialog.h \
+ tv/dialogs.h \
+ tv/drawbuf.h \
+ tv/event.h \
+ tv/group.h \
+ tv/history.h \
+ tv/inputln.h \
+ tv/intl.h \
+ tv/ipstream.h \
+ tv/label.h \
+ tv/listbox.h \
+ tv/lstviewr.h \
+ tv/no_mss.h \
+ tv/nscoll.h \
+ tv/object.h \
+ tv/objects.h \
+ tv/opstream.h \
+ tv/palette.h \
+ tv/point.h \
+ tv/program.h \
+ tv/pstream.h \
+ tv/radiobtn.h \
+ tv/rect.h \
+ tv/scrlbar.h \
+ tv/scroller.h \
+ tv/sitem.h \
+ tv/sortlibo.h \
+ tv/stddlg.h \
+ tv/streambl.h \
+ tv/sttctext.h \
+ tv/system.h \
+ tv/tobjstrm.h \
+ tv/ttypes.h \
+ tv/tvconfig.h \
+ tv/tvobjs.h \
+ tv/tvutil.h \
+ tv/view.h \
+ tv/views.h \
+ tv/window.h \
+ tv/yes_mss.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/testeasy.mkf b/setedit/makes/testeasy.mkf
new file mode 100644
index 0000000..c4cad6d
--- /dev/null
+++ b/setedit/makes/testeasy.mkf
@@ -0,0 +1,58 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=../mainsrc ../names ../streams ../setedit ../setedit/names ../setedit/streams \
+ ../infview ../sdg ../settvuti ../settvuti/names ../settvuti/streams ../extra \
+ ../mp3 ../calcu ../easydiag ../infview/names ../infview/streams ../librhuti
+#
+# Include directories
+#
+INCLUDE_DIR=../include
+SETEDIT_INC_DIR=../setedit/include
+SETTVUTI_INC_DIR=../settvuti/include
+SDG_INC_DIR=../sdg/include
+INFVIEW_INC_DIR=../infview/include
+EXTRA_INC_DIR=../extra
+EASYDIAG_INC_DIR=../easydiag
+LIBRHUTI_INC_DIR=../librhuti
+MP3_INC_DIR=../mp3
+CALCU_INC_DIR=../calcu
+INCLUDE_DIRS=$(INCLUDE_DIR) $(SETEDIT_INC_DIR) $(SETTVUTI_INC_DIR) \
+ $(SDG_INC_DIR) $(INFVIEW_INC_DIR) $(TVISION_INC) $(EXTRA_INC_DIR) \
+ $(EASYDIAG_INC_DIR) $(LIBRHUTI_INC_DIR) $(SUPPORT_INC) \
+ $(MP3_INC_DIR) $(CALCU_INC_DIR)
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Common rules used by RHIDE.
+# It also includes rhide.env.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+ifdef MAINTAINER_MODE
+ ExIMK=.imk
+else
+ ExIMK=.umk
+endif
+include testeasy$(ExIMK)
+
+#
+# This file pulls all the .imk
+#
+include includer.imk
+
diff --git a/setedit/makes/testeasy.umk b/setedit/makes/testeasy.umk
new file mode 100644
index 0000000..fa98570
--- /dev/null
+++ b/setedit/makes/testeasy.umk
@@ -0,0 +1,23 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+OBJFILES=\
+ obj/test$(ExOBJ)
+
+LIBRARIES=\
+ libsettv$(ExLIB) \
+ libeasyd$(ExLIB)
+
+test$(ExEXE):: \
+ libeasyd$(ExLIB) \
+ libsettv$(ExLIB) \
+ obj/test$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_LINK)
+
+INCLUDE00=easydiag$(ExIMK)
+
+obj/test$(ExOBJ):: ../easydiag/test.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/makes/tmp/delete.me b/setedit/makes/tmp/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/makes/tmp/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/makes/try-y.bat b/setedit/makes/try-y.bat
new file mode 100644
index 0000000..ce1f70e
--- /dev/null
+++ b/setedit/makes/try-y.bat
@@ -0,0 +1,6 @@
+@Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+@Rem see copyrigh file for details
+@
+redir -e error.txt editor --no-redirect --no-signal
+gsymify -i error.txt -o error.rep editor.exe
+gsymify -i yamd.log -o yamd.sym editor.exe
diff --git a/setedit/makes/yamd-off.bat b/setedit/makes/yamd-off.bat
new file mode 100644
index 0000000..d7ea702
--- /dev/null
+++ b/setedit/makes/yamd-off.bat
@@ -0,0 +1,5 @@
+@Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+@Rem see copyrigh file for details
+@
+set YAMD_ENABLE=0
+
diff --git a/setedit/makes/yamd-on.bat b/setedit/makes/yamd-on.bat
new file mode 100644
index 0000000..c939c51
--- /dev/null
+++ b/setedit/makes/yamd-on.bat
@@ -0,0 +1,8 @@
+@Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+@Rem see copyrigh file for details
+@
+set YAMD_ENABLE=1
+set YAMD_LOGFILE_NAME=yamd.log
+set YAMD_LOGLEVEL=2
+set YAMD_FOR_GSYMIFY=1
+
diff --git a/setedit/makes/yamddos.env b/setedit/makes/yamddos.env
new file mode 100644
index 0000000..33f43eb
--- /dev/null
+++ b/setedit/makes/yamddos.env
@@ -0,0 +1,43 @@
+#
+# This include file have common options for all the subprojects.
+#
+
+#
+# Common Warning and debug options, change it if you don't want debug
+# information or your compiler emmits too much warnings with -Wall.
+#
+RHIDE_OS_BOTH=-Wall -Werror -gstabs3
+RHIDE_OS_CFLAGS=$(RHIDE_OS_BOTH)
+RHIDE_OS_CXXFLAGS=$(RHIDE_OS_BOTH) -fno-exceptions -fno-rtti
+#
+# It indicates where are located the system includes so they aren't included
+# in the dependencies.
+#
+RHIDE_STDINC=$(DJDIR)/include $(DJDIR)/lang/cxx $(DJDIR)/lib/gcc-lib
+#
+# These are OS dependent libraries.
+#
+RHIDE_OS_LIBS=amp alleg intl
+#
+# These are the paths libraries that are OS dependent (the paths no the libs).
+#
+RHIDE_OS_LIBS_PATH=../../tvision/djgpp djgpp
+#
+# Location for the Turbo Vision includes
+#
+TVISION_INC=../../tvision/include
+#
+# Location for the support libraries, if you have them installed (PCRE and
+# libz) you could want to use the installed ones. In this case you should
+# remove djgpp from RHIDE_OS_LIBS_PATH and assign nothing to SUPPORT_INC.
+#
+SUPPORT_INC=../support
+#
+# That's needed because RHIDE uses a wrong order and then -static doesn't
+# affect all the libraries.
+#
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
+#
+# That's needed to link the editor with the YAMD library
+#
+RHIDE_LD=yamd-gcc
diff --git a/setedit/miscperl.pl b/setedit/miscperl.pl
new file mode 100644
index 0000000..133f28f
--- /dev/null
+++ b/setedit/miscperl.pl
@@ -0,0 +1,43 @@
+# Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Version is stored in the root directory in a file called version.txt.
+# It contains the version in Major.Middle.Minor format followed by only one
+# line feed.
+sub GetVersion
+{
+ $Version=cat($_[0].'version.txt');
+ if (!$Version)
+ {
+ die "Missing version file! ($_[0]version.txt)\n";
+ }
+ chop $Version;
+ $Version=~/(\d+)\.(\d+)\.(\d+)/;
+ $VersionMajor =$1;
+ $VersionMiddle=$2;
+ $VersionMinor =$3;
+ $Version="$1.$2.$3";
+}
+
+sub replace
+{
+ my $b=$_[1];
+
+ open(FIL,">$_[0]") || return 0;
+ print FIL ($b);
+ close(FIL);
+}
+
+sub cat
+{
+ local $/;
+ my $b;
+
+ open(FIL,$_[0]) || return 0;
+ $b=<FIL>;
+ close(FIL);
+
+ $b;
+}
+
+1;
diff --git a/setedit/mp3/ampdiag.cc b/setedit/mp3/ampdiag.cc
new file mode 100644
index 0000000..56d7cba
--- /dev/null
+++ b/setedit/mp3/ampdiag.cc
@@ -0,0 +1,464 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#ifdef SUP_MP3
+#define Uses_stdio
+#define Uses_string
+#define Uses_limits
+
+#define Uses_TApplication
+#define Uses_TDialog
+#define Uses_TEvent
+#define Uses_TStaticText
+#define Uses_TDeskTop
+#define Uses_fpstream
+#define Uses_MsgBox
+
+#define Uses_TSNoStaticText
+#define Uses_TSVeGroup
+#define Uses_TSHzGroup
+#define Uses_TSButton
+#define Uses_TSHScrollBar
+
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+#define Uses_PrivateMP3Info
+#include <intermp3.h>
+#include <mp3play.h>
+
+#define Uses_SETAppHelper
+#include <setapp.h>
+
+#include <dskwin.h>
+#include <dskmp3.h>
+
+static TDskWinMP3 *MP3Manager=0;
+
+void MP3ShowTime()
+{
+ static int lastTime;
+ int thisTime=mp3.GetTime();
+
+ if (thisTime!=lastTime)
+ {
+ lastTime=thisTime;
+ message(TProgram::deskTop,evBroadcast,cmaUpdateTime,&thisTime);
+ }
+}
+
+class TAmpDiag : public TDialog
+{
+public:
+ TAmpDiag(const TRect& bounds, const char *aTitle) :
+ TWindowInit(&TAmpDiag::initFrame),
+ TDialog(bounds,aTitle) {lockSBTime=0;};
+ virtual void handleEvent(TEvent &event);
+ virtual void close();
+ virtual Boolean valid(ushort command);
+
+ void SetHeaderValues();
+ void ReflectStatus();
+ TNoStaticText *time,*status,*total;
+ TNoStaticText *SR_BR;
+ TNoStaticText *Mode_Type;
+ TNoStaticText *info1,*info2,*info3,*info4,*info5;
+ TScrollBar *timeBar;
+ char lockSBTime;
+};
+
+void TAmpDiag::close()
+{
+ hide();
+ if (MP3Manager)
+ MP3Manager->CanBeSaved=0;
+}
+
+Boolean TAmpDiag::valid(ushort command)
+{
+ if (mp3.Converting)
+ {
+ unsigned ret=messageBox(__("You are expanding a MP3 file, do you really want to quit?"),
+ mfConfirmation | mfYesButton | mfNoButton);
+ if (ret==cmYes)
+ {
+ mp3.Stop();
+ return True;
+ }
+ return False;
+ }
+ return TDialog::valid(command);
+}
+
+void TAmpDiag::SetHeaderValues()
+{
+ char buffer[80];
+
+ TProgram::deskTop->lock();
+ TVIntl::snprintf(buffer,80,__("Sample Rate: %5d Hz Bitrate: %4d Kbits/s"),
+ mp3.SampleRate,mp3.BitRate);
+ SR_BR->setText(buffer);
+ TVIntl::snprintf(buffer,80,__("Mode: %6s File: MPEG %1d.0 layer %1d"),
+ mp3.Mode,mp3.MPEGVer,mp3.Layer);
+ Mode_Type->setText(buffer);
+ TVIntl::snprintf(buffer,80,__("Total: %3d:%02d"),mp3.TotalLen/60,mp3.TotalLen%60);
+ total->setText(buffer);
+
+ TVIntl::snprintf(buffer,80,__("Title: %s"),mp3.Title);
+ info1->setText(buffer);
+ TVIntl::snprintf(buffer,80,__("Author: %s"),mp3.Author);
+ info2->setText(buffer);
+ TVIntl::snprintf(buffer,80,__("Album: %s"),mp3.Album);
+ info3->setText(buffer);
+ TVIntl::snprintf(buffer,80,__("Comme.: %s"),mp3.Comment);
+ info4->setText(buffer);
+ TVIntl::snprintf(buffer,80,__("Genre: %s"),mp3.Genre);
+ info5->setText(buffer);
+
+ timeBar->setParams(0,0,mp3.TotalLen,(int)(mp3.TotalLen/40.0+0.5),2);
+
+ ReflectStatus();
+ TProgram::deskTop->unlock();
+}
+
+
+void TAmpDiag::ReflectStatus()
+{
+ if (mp3.Paused)
+ status->setText(__("[ PAUSE ]"));
+ else
+ if (mp3.Stoped)
+ status->setText(__("[ STOP ]"));
+ else
+ status->setText(__("[ PLAY ]"));
+ if (TView::commandEnabled(cmaMP3Prev))
+ {
+ if (!mp3.PlayingList || !MP3ListHavePrev())
+ TView::disableCommand(cmaMP3Prev);
+ }
+ else
+ {
+ if (mp3.PlayingList && MP3ListHavePrev())
+ TView::enableCommand(cmaMP3Prev);
+ }
+ if (TView::commandEnabled(cmaMP3Next))
+ {
+ if (!mp3.PlayingList || !MP3ListHaveNext())
+ TView::disableCommand(cmaMP3Next);
+ }
+ else
+ {
+ if (mp3.PlayingList && MP3ListHaveNext())
+ TView::enableCommand(cmaMP3Next);
+ }
+}
+
+
+void TAmpDiag::handleEvent(TEvent &event)
+{
+ char timestr[32];
+ int thisTime;
+
+ TDialog::handleEvent( event );
+ if (event.what==evCommand)
+ {
+ switch( event.message.command )
+ {
+ case cmaMP3Play:
+ if (mp3.Paused)
+ mp3.TogglePause();
+ else
+ if (mp3.Stoped)
+ {
+ mp3.PlaySelectedFile();
+ SetHeaderValues();
+ }
+ break;
+ case cmaMP3Stop:
+ mp3.Stop();
+ break;
+ case cmaMP3Pause:
+ mp3.TogglePause();
+ break;
+ case cmaMP3Ffw:
+ mp3.FFwd();
+ break;
+ case cmaMP3Rew:
+ mp3.Rew();
+ break;
+ case cmaMP3Prev:
+ MP3ListGoBack();
+ mp3.PlayNext();
+ SetHeaderValues();
+ break;
+ case cmaMP3Next:
+ mp3.PlayNext();
+ SetHeaderValues();
+ break;
+ default:
+ return;
+ }
+ ReflectStatus();
+ }
+ else
+ if (event.what==evBroadcast)
+ {
+ switch( event.message.command )
+ {
+ case cmaIsAmpDiagThere:
+ break;
+ case cmaUpdateTime:
+ thisTime=*((int *)event.message.infoPtr);
+ TVIntl::snprintf(timestr,32,__("Time: %3d:%02d"),thisTime/60,thisTime%60);
+ time->setText(timestr);
+ lockSBTime=1;
+ timeBar->setValue(thisTime);
+ lockSBTime=0;
+ break;
+ case cmaUpdateFile:
+ SetHeaderValues();
+ break;
+ case cmaReflectStatus:
+ ReflectStatus();
+ break;
+ case cmScrollBarChanged:
+ if (!lockSBTime)
+ mp3.SeekAbs(timeBar->value);
+ break;
+ default:
+ return;
+ }
+ }
+ else
+ return;
+ clearEvent(event);
+}
+
+TAmpDiag *ampDia;
+
+static
+TAmpDiag *CreateShowDialog()
+{
+ ampDia=new TAmpDiag(TRect(1,1,1,1),__("Player status"));
+
+ char buffer[80];
+ int i;
+ for (i=0; i<46; i++) buffer[i]=' ';
+ buffer[i]=0;
+
+ TSViewCol *col=new TSViewCol(ampDia);
+
+ TSNoStaticText *info1=new TSNoStaticText(buffer);
+ ampDia->info1=(TNoStaticText *)info1->view;
+ TSNoStaticText *info2=new TSNoStaticText(buffer);
+ ampDia->info2=(TNoStaticText *)info2->view;
+ TSNoStaticText *info3=new TSNoStaticText(buffer);
+ ampDia->info3=(TNoStaticText *)info3->view;
+ TSNoStaticText *info4=new TSNoStaticText(buffer);
+ ampDia->info4=(TNoStaticText *)info4->view;
+ TSNoStaticText *info5=new TSNoStaticText(buffer);
+ ampDia->info5=(TNoStaticText *)info5->view;
+ TSVeGroup *Info=MakeVeGroup(0,info1,info2,info3,info4,info5,0);
+
+ TSNoStaticText *SR_BR=new TSNoStaticText(buffer);
+ ampDia->SR_BR=(TNoStaticText *)SR_BR->view;
+ TSNoStaticText *Mode_Type=new TSNoStaticText(buffer);
+ ampDia->Mode_Type=(TNoStaticText *)Mode_Type->view;
+ TSVeGroup *Rest=new TSVeGroup(SR_BR,Mode_Type,0);
+
+ TSNoStaticText *time=new TSNoStaticText(__("Time: 000:00"));
+ ampDia->time=(TNoStaticText *)time->view;
+ TSNoStaticText *status=new TSNoStaticText(__("[ STOP ]"));
+ ampDia->status=(TNoStaticText *)status->view;
+ TSNoStaticText *total=new TSNoStaticText(__("Total: 000:00"));
+ ampDia->total=(TNoStaticText *)total->view;
+ TSHzGroup *Time=new TSHzGroup(time,new TSHzGroup(status,total,2),2);
+
+ TSHScrollBar *timeBar=new TSHScrollBar(40);
+ ampDia->timeBar=timeBar->sb;
+
+ TSHzGroup *buttons=MakeHzGroup(
+ new TSButton(__("Prev."),cmaMP3Prev),
+ new TSButton(MP3Player::butRew,cmaMP3Rew),
+ new TSButton(MP3Player::butStop,cmaMP3Stop,bfDefault),
+ new TSButton(MP3Player::butPlay,cmaMP3Play),
+ new TSButton(MP3Player::butPause,cmaMP3Pause),
+ new TSButton(MP3Player::butFfw,cmaMP3Ffw),
+ new TSButton(__("Next"),cmaMP3Next),
+ 0);
+
+ ampDia->SetHeaderValues();
+ col->insert(2,1,Info);
+ col->insert(2,yTSUnder,Rest,0,Info);
+ col->insert(xTSCenter,yTSUnder,Time,0,Rest);
+ col->insert(xTSCenter,yTSUnder,timeBar,0,Time);
+ col->insert(xTSCenter,yTSDown,buttons);
+
+ ampDia->options|=ofCentered;
+ col->doIt();
+
+ delete col;
+ return ampDia;
+}
+
+void MP3CreateShowDialog()
+{
+ // First check if already in desktop:
+ if (!message(TProgram::deskTop,evBroadcast,cmaIsAmpDiagThere,0))
+ {
+ CreateShowDialog();
+ TProgram::deskTop->insert(ampDia);
+ MP3Manager=new TDskWinMP3(ampDia);
+ AddNonEditorToHelper(MP3Manager);
+ }
+}
+
+
+void MP3WriteInfo(opstream &os, TView *view)
+{
+ TAmpDiag *edw=(TAmpDiag *)view;
+ os << (int)1 << edw->origin << (int)(TProgram::deskTop->indexOf(edw));
+
+ // Stoped means 1 => no song is playing 0 => a song is playing so that's a very
+ // important variable
+ os << mp3.Stoped <<
+ // When the engine is in Pause is at the same time stoped, but we have information
+ // to resume the playing
+ mp3.Paused << mp3.PausedPos;
+ // That's the name of the file we are playing
+ os.writeString(mp3.FileToPlay);
+ // Now the information for a single sound stuff
+ os << mp3.Selected;
+ if (mp3.Selected)
+ {
+ os.writeString(mp3.Name);
+ }
+ // Now stop playing
+ mp3.Pause();
+ // Remember the position
+ os << mp3.PausedPos;
+ // And finally the list stuff
+ os << mp3.PlayingList;
+ MP3ListSaveState(os);
+}
+
+TView *MP3ReadInfo(ipstream &is, int &zorder, TDskWinMP3 *manager)
+{
+ TPoint pos;
+ int version;
+ int from;
+
+ MP3Manager=manager;
+
+ is >> version >> pos >> zorder;
+ is >> mp3.Stoped >> mp3.Paused >> mp3.PausedPos;
+ is.readString(mp3.FileToPlay,PATH_MAX);
+ is >> mp3.Selected;
+ if (mp3.Selected)
+ {
+ is.readString(mp3.Name,PATH_MAX);
+ }
+ is >> from >> mp3.PlayingList;
+ MP3ListLoadState(is);
+
+ InitMP3Engine();
+ if (mp3.Selected && (mp3.Stoped && !mp3.Paused))
+ {
+ TView::enableCommand(cmeMP3Start);
+ TView::enableCommand(cmeMP3Convert);
+ }
+ if (mp3.PlayingList)
+ {// Setup the playing list stuff first!!
+ MP3SetUpPlayList;
+ TView::enableCommand(cmeMP3StopList);
+ TView::disableCommand(cmeMP3PlayList);
+ TView::disableCommand(cmeMP3EditPlayList);
+ if (!mp3.Paused)
+ {
+ mp3.Paused=1;
+ mp3.PausedPos=from;
+ mp3.TogglePause();
+ }
+ else
+ {
+ mp3.TogglePause();
+ mp3.TogglePause();
+ }
+ }
+ else
+ {
+ if (!mp3.Stoped || mp3.Paused)
+ TView::enableCommand(cmeMP3Stop);
+ if (!mp3.Stoped && !mp3.Paused)
+ {
+ mp3.Paused=1;
+ mp3.PausedPos=from;
+ mp3.TogglePause();
+ }
+ else
+ if (mp3.Paused)
+ {
+ mp3.TogglePause();
+ mp3.TogglePause();
+ }
+ else
+ {
+ mp3.PlayFileToPlay();
+ mp3.Stop();
+ }
+ }
+ CreateShowDialog();
+ ampDia->moveTo(pos.x,pos.y);
+ return ampDia;
+}
+
+#else
+
+#define Uses_TDialog
+#define Uses_TRect
+#define Uses_fpstream
+#define Uses_TStaticText
+#define Uses_TView
+#define Uses_limits
+#include <tv.h>
+
+#include <dskwin.h>
+#include <dskmp3.h>
+
+#include <intermp3.h>
+
+class TDialogX : public TDialog
+{
+public:
+ TDialogX(const TRect& bounds, const char *aTitle) :
+ TWindowInit(&TDialogX::initFrame),
+ TDialog(bounds,aTitle) {};
+ virtual void close() { hide(); };
+};
+
+TView *MP3ReadInfo(ipstream &is, int &zorder, TDskWinMP3 * /*manager*/)
+{
+ TPoint pos;
+ int iAux;
+ char aux;
+ char buf[PATH_MAX];
+
+ is >> iAux >> pos >> zorder;
+ is >> aux >> aux >> iAux;
+ is.readString(buf,PATH_MAX);
+ is >> aux;
+ if (aux)
+ {
+ is.readString(buf,PATH_MAX);
+ }
+ is >> iAux >> aux;
+ MP3ListLoadState(is);
+
+ TDialogX *d=new TDialogX(TRect(0,0,30,6),__("MP3 Player"));
+ d->insert(new TStaticText(TRect(2,2,28,3),__("MP3 support not linked")));
+ d->options|=ofCentered;
+ return d;
+}
+#endif
diff --git a/setedit/mp3/consts.h b/setedit/mp3/consts.h
new file mode 100644
index 0000000..2fe04f5
--- /dev/null
+++ b/setedit/mp3/consts.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+const int cmaBase=0x22A0;
+
+#define h(a,b) const int cma##a=cmaBase+b,hc##a=cmaBase+b;
+
+h(UpdateTime,0)
+h(IsAmpDiagThere,1)
+h(UpdateFile,2)
+h(MP3Play,3)
+h(MP3Stop,4)
+h(MP3Pause,5)
+h(MP3Ffw,6)
+h(MP3Rew,7)
+h(ReflectStatus,8)
+h(AddMP3,9)
+h(InsertMP3,10)
+h(DeleteMP3,11)
+h(SaveMP3List,12)
+h(LoadMP3List,13)
+h(MP3Prev,14)
+h(MP3Next,15)
+
+#undef h
+
diff --git a/setedit/mp3/intermp3.cc b/setedit/mp3/intermp3.cc
new file mode 100644
index 0000000..32940a6
--- /dev/null
+++ b/setedit/mp3/intermp3.cc
@@ -0,0 +1,279 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#ifdef SUP_MP3
+#define Uses_string
+#define Uses_TView
+#define Uses_MsgBox
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_FileOpenAid
+#include <settvuti.h>
+
+// Commands and functions
+#define Uses_PrivateMP3Info
+#include <intermp3.h>
+// MP3 playing routings interface
+#include <mp3play.h>
+
+// ************* Functions to process the commands from the editor *****************
+static
+void CommandsForStop()
+{
+ TView::disableCommand(cmeMP3Stop);
+ TView::enableCommand(cmeMP3Start);
+ TView::enableCommand(cmeMP3Convert);
+}
+
+static
+void CommandsForPlay()
+{
+ TView::enableCommand(cmeMP3Stop);
+ TView::disableCommand(cmeMP3Start);
+ TView::disableCommand(cmeMP3Convert);
+}
+
+void InitMP3Engine()
+{
+ static int mp3Initialized=0;
+ if (!mp3Initialized)
+ {
+ if (mp3.Init())
+ return;
+ else
+ mp3Initialized=1;
+ }
+}
+
+static
+void Open()
+{
+ char fileName[PATH_MAX];
+ strcpy(fileName,"*.mp[23]");
+
+ if (GenericFileDialog(__("MP3 Open"),fileName,0,hID_OpenMP3)!=cmCancel)
+ {
+ InitMP3Engine();
+ mp3.SelectNewFile(fileName);
+ TView::enableCommand(cmeMP3Start);
+ TView::enableCommand(cmeMP3Convert);
+ }
+}
+
+static
+void Convert()
+{
+ char fileName[PATH_MAX];
+ strcpy(fileName,"*.wav");
+
+ if (GenericFileDialog(__("Output WAV file"),fileName,0,hID_SaveMP3,fdDialogForSave)
+ ==cmCancel)
+ return;
+
+ switch (mp3.ConvertSelectedFile(fileName))
+ {
+ case 1:
+ messageBox(__("First select a file"),mfError | mfOKButton);
+ break;
+ case 2:
+ message(TProgram::deskTop,evBroadcast,cmaUpdateFile,0);
+ MP3CreateShowDialog();
+ CommandsForStop();
+ break;
+ }
+}
+
+static
+void Start()
+{
+ switch (mp3.PlaySelectedFile())
+ {
+ case 1:
+ messageBox(__("First select a file"),mfError | mfOKButton);
+ break;
+ case 2:
+ message(TProgram::deskTop,evBroadcast,cmaUpdateFile,0);
+ case 3:
+ MP3CreateShowDialog();
+ CommandsForStop();
+ break;
+ }
+}
+
+static
+void Stop()
+{
+ mp3.Stop();
+ message(TProgram::deskTop,evBroadcast,cmaReflectStatus,0);
+ CommandsForPlay();
+}
+
+static
+void CommandsForStopList()
+{
+ TView::disableCommand(cmeMP3StopList);
+ TView::enableCommand(cmeMP3PlayList);
+ TView::enableCommand(cmeMP3EditPlayList);
+}
+
+static
+void CommandsForPlayList()
+{
+ TView::enableCommand(cmeMP3StopList);
+ TView::disableCommand(cmeMP3PlayList);
+ TView::disableCommand(cmeMP3EditPlayList);
+}
+
+static
+void MP3EndOfList()
+{
+ MP3ListResetCount();
+ CommandsForStopList();
+}
+
+static
+void PlayList()
+{
+ InitMP3Engine();
+ mp3.StartPlayList(MP3ListGetNext,MP3EndOfList);
+ if (!mp3.Stoped)
+ {
+ message(TProgram::deskTop,evBroadcast,cmaUpdateFile,0);
+ MP3CreateShowDialog();
+ CommandsForPlayList();
+ }
+}
+
+void MP3SetUpPlayListFunctions()
+{
+ mp3.SetupPlayList(MP3ListGetNext,MP3EndOfList);
+}
+
+static
+void StopList()
+{
+ mp3.StopPlayList();
+ MP3ListResetCount();
+ CommandsForStopList();
+}
+
+
+
+// ************* Checks if the command is an MP3 one *****************
+#define m(a) case cmeMP3##a: a(); break;
+#define k(a) case cmeMP3##a: MP3##a(); break;
+int MP3ProcessCommand(int command)
+{
+ switch (command)
+ {
+ m(Open)
+ m(Convert)
+ k(EditPlayList)
+ m(Start)
+ m(Stop)
+ m(PlayList)
+ m(StopList)
+ default:
+ return 0;
+ }
+ return 1;
+}
+#undef k
+#undef m
+
+void MP3PollPlayer()
+{
+ switch (mp3.Poll())
+ {
+ case 1:
+ MP3ShowTime();
+ break;
+ case 2:
+ TView::disableCommand(cmeMP3Stop);
+ TView::enableCommand(cmeMP3Start);
+ case 4:
+ message(TProgram::deskTop,evBroadcast,cmaReflectStatus,0);
+ break;
+ case 3:
+ message(TProgram::deskTop,evBroadcast,cmaUpdateFile,0);
+ break;
+ }
+}
+
+void MP3DeInitStuff()
+{
+ mp3.deInit();
+}
+
+// The following routines are used to temporally stop the engine and then resume
+// for example when calling the shell.
+
+static int playerWasPaused=0;
+
+void MP3PausePlayer()
+{
+ if (!playerWasPaused && !mp3.Stoped)
+ {
+ mp3.Pause();
+ playerWasPaused=1;
+ }
+}
+
+void MP3ResumePlayer()
+{
+ if (playerWasPaused)
+ {
+ mp3.TogglePause();
+ playerWasPaused=0;
+ }
+}
+
+void MP3SetPlayerStrategy(int strategy)
+{
+ mp3.Strategy=strategy ? mp3Buffered : mp3UnBuffered;
+}
+
+#else
+
+#define Uses_MsgBox
+#define Uses_TView
+#include <tv.h>
+// Commands and functions
+#define Uses_PrivateMP3Info
+#include <intermp3.h>
+
+#define m(a) case cmeMP3##a:
+int MP3ProcessCommand(int command)
+{
+ switch (command)
+ {
+ m(Open)
+ m(Convert)
+ m(EditPlayList)
+ m(Start)
+ m(Stop)
+ m(PlayList)
+ m(StopList)
+ messageBox(__("The MP3 routines aren't linked in the editor"),mfError | mfOKButton);
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
+#undef m
+
+#endif
+
+void MP3InitStuff()
+{
+ #define d(a) TView::disableCommand(cmeMP3##a)
+ d(Start);
+ d(Stop);
+ d(PlayList);
+ d(StopList);
+ d(Convert);
+ #undef d
+}
+
diff --git a/setedit/mp3/intermp3.h b/setedit/mp3/intermp3.h
new file mode 100644
index 0000000..b146af1
--- /dev/null
+++ b/setedit/mp3/intermp3.h
@@ -0,0 +1,102 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class ipstream;
+class TView;
+class TDskWinMP3;
+extern TView *MP3ReadInfo(ipstream &is, int &zorder, TDskWinMP3 *manager);
+
+#ifdef SUP_MP3
+
+class opstream;
+class TView;
+
+// From intermp3.cc
+extern int MP3ProcessCommand(int command);
+extern void MP3PollPlayer();
+extern void MP3InitStuff();
+extern void MP3DeInitStuff();
+extern void MP3PausePlayer();
+extern void MP3ResumePlayer();
+extern void MP3SetPlayerStrategy(int strategy);
+extern void MP3WriteInfo(opstream &os, TView *view);
+extern void MP3SetUpPlayListFunctions();
+
+#define ProcessMP3Commands if (MP3ProcessCommand(event.message.command)) break
+#define ProcessMP3Idle MP3PollPlayer()
+#define MP3Initialize MP3InitStuff()
+#define MP3DeInitialize MP3DeInitStuff()
+#define MP3Suspend MP3PausePlayer()
+#define MP3Resume MP3ResumePlayer()
+#define MP3Buffered MP3SetPlayerStrategy(1)
+#define MP3UnBuffered MP3SetPlayerStrategy(0)
+#define MP3SetUpPlayList MP3SetUpPlayListFunctions()
+
+#ifdef Uses_PrivateMP3Info
+// From ampdiag.cc
+extern void MP3ShowTime();
+extern void MP3CreateShowDialog();
+// From mp3list.cc
+extern void MP3EditPlayList();
+extern char *MP3ListGetNext();
+extern void MP3ListResetCount();
+extern int MP3ListHavePrev();
+extern int MP3ListHaveNext();
+extern void MP3ListGoBack();
+extern void MP3ListSaveState(opstream &os);
+extern void MP3ListLoadState(ipstream &is);
+
+extern void InitMP3Engine();
+
+#endif // Uses_PrivateMP3Info
+
+#else
+
+extern int MP3ProcessCommand(int command);
+extern void MP3InitStuff();
+extern void MP3ListLoadState(ipstream &is);
+
+#define ProcessMP3Commands if (MP3ProcessCommand(event.message.command)) break
+#define ProcessMP3Idle
+#define MP3Initialize MP3InitStuff()
+#define MP3DeInitialize
+#define MP3Suspend
+#define MP3Resume
+#define MP3Buffered
+#define MP3UnBuffered
+#define MP3SetUpPlayList
+
+#endif
+
+#ifdef Uses_PrivateMP3Info
+const int cmaBase=0x22A0;
+#define h(a,b) const int cma##a=cmaBase+b,hc##a=cmaBase+b;
+h(UpdateTime,0)
+h(IsAmpDiagThere,1)
+h(UpdateFile,2)
+h(MP3Play,3)
+h(MP3Stop,4)
+h(MP3Pause,5)
+h(MP3Ffw,6)
+h(MP3Rew,7)
+h(ReflectStatus,8)
+h(AddMP3,9)
+h(InsertMP3,10)
+h(DeleteMP3,11)
+h(SaveMP3List,12)
+h(LoadMP3List,13)
+h(MP3Prev,14)
+h(MP3Next,15)
+#undef h
+
+// These values are coordinated with the application to add a new
+// command you must look the available number in setapp.h
+const int cmeBase=0x2500;
+const int
+ cmeMP3Open = cmeBase+42,
+ cmeMP3Convert = cmeBase+43,
+ cmeMP3EditPlayList= cmeBase+44,
+ cmeMP3Start = cmeBase+45,
+ cmeMP3Stop = cmeBase+46,
+ cmeMP3PlayList = cmeBase+47,
+ cmeMP3StopList = cmeBase+48;
+#endif
diff --git a/setedit/mp3/libamp/.cvsignore b/setedit/mp3/libamp/.cvsignore
new file mode 100644
index 0000000..8443338
--- /dev/null
+++ b/setedit/mp3/libamp/.cvsignore
@@ -0,0 +1,2 @@
+*.mak
+rhide.env
diff --git a/setedit/mp3/libamp/amp.h b/setedit/mp3/libamp/amp.h
new file mode 100644
index 0000000..e16d21d
--- /dev/null
+++ b/setedit/mp3/libamp/amp.h
@@ -0,0 +1,59 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* these should not be touched
+*/
+#define SYNCWORD 0xfff
+#define TRUE 1
+#define FALSE 0
+
+/* version
+*/
+#define MAJOR 0
+#define MINOR 7
+#define PATCH 6
+
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#define MAX3(a,b,c) ((a) > (b) ? MAX(a, c) : MAX(b, c))
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+
+
+/* Debugging flags */
+
+struct debugFlags_t {
+ int audio,args,buffer,buffer2,misc,misc2;
+};
+
+struct debugLookup_t {
+ char *name; int *var;
+};
+
+extern struct debugFlags_t debugFlags;
+
+/* This is only here to keep all the debug stuff together */
+#ifdef AMP_UTIL
+struct debugLookup_t debugLookup[] = {
+ {"audio", &debugFlags.audio},
+ {"args", &debugFlags.args},
+ {"buffer", &debugFlags.buffer},
+ {"buffer2", &debugFlags.buffer2},
+ {"misc", &debugFlags.misc},
+ {"misc2", &debugFlags.misc2},
+ {0,0}
+};
+#endif /* AMP_UTIL */
+
+extern struct debugLookup_t debugLookup[];
+
+
+#ifdef DEBUG
+ #define DB(type,cmd) if (debugFlags.type) { cmd ; }
+#else
+ #define DB(type,cmd)
+#endif
+
+#include "config.h"
+#include "proto.h"
+
+
+extern int AUDIO_BUFFER_SIZE;
diff --git a/setedit/mp3/libamp/audio.h b/setedit/mp3/libamp/audio.h
new file mode 100644
index 0000000..0d0bbfb
--- /dev/null
+++ b/setedit/mp3/libamp/audio.h
@@ -0,0 +1,180 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* audio.h some global variables
+ *
+ * Created by: tomislav uzelac Mar/Apr, Jul 96
+ */
+
+#include <stdio.h>
+
+struct AUDIO_HEADER {
+ int ID;
+ int layer;
+ int protection_bit;
+ int bitrate_index;
+ int sampling_frequency;
+ int padding_bit;
+ int private_bit;
+ int mode;
+ int mode_extension;
+ int copyright;
+ int original;
+ int emphasis;
+};
+
+struct SIDE_INFO {
+ int main_data_begin;
+ int scfsi[2][4];
+ int part2_3_length[2][2];
+ int big_values[2][2];
+ int global_gain[2][2];
+ int scalefac_compress[2][2];
+ int window_switching_flag[2][2];
+ int block_type[2][2];
+ int mixed_block_flag[2][2];
+ int table_select[2][2][3];
+ int subblock_gain[2][2][3];
+ int region0_count[2][2];
+ int region1_count[2][2];
+ int preflag[2][2];
+ int scalefac_scale[2][2];
+ int count1table_select[2][2];
+};
+
+
+/* global stuff
+*/
+
+extern FILE *in_file,*out_file;
+
+extern void statusDisplay(struct AUDIO_HEADER *header, int frameNo);
+extern int decodeMPEG(void);
+extern void initialise_globals(void);
+extern void report_header_error(int err);
+
+extern int scalefac_l[2][2][22];
+extern int scalefac_s[2][2][13][3];
+extern int t_b8_l[2][3][22];
+extern int t_b8_s[2][3][13];
+extern short t_bitrate[2][3][15];
+
+extern int is[2][578];
+extern float xr[2][32][18];
+
+extern int *t_l,*t_s;
+extern int nch;
+extern int t_sampling_frequency[2][3];
+
+extern int A_QUIET,A_SHOW_CNT,A_FORMAT_WAVE,A_DUMP_BINARY;
+extern int A_WRITE_TO_AUDIO,A_WRITE_TO_FILE;
+extern short pcm_sample[64];
+extern int A_AUDIO_PLAY;
+extern int A_SET_VOLUME,A_SHOW_TIME;
+extern int A_MSG_STDOUT;
+extern int A_DOWNMIX;
+
+/* GUI CONTROL STUFF */
+extern int GUI_PLAY;
+extern int GUI_PLAYING;
+extern int GUI_PAUSE;
+extern int GUI_PAUSED;
+extern int GUI_STOP;
+extern int GUI_STOPPED;
+extern int GUI_FD_TO_PLAY;
+extern int GUI_NEXT_FILE_READY;
+
+/* GUI control stuff */
+extern int send_fd;
+extern int receive_fd;
+
+extern int stop_flag;
+extern int quit_flag;
+
+/* ...
+*/
+
+#ifdef AUDIO
+
+FILE *in_file,*out_file;
+
+int scalefac_l[2][2][22];
+int scalefac_s[2][2][13][3];
+
+int is[2][578];
+float xr[2][32][18];
+
+int *t_l,*t_s;
+int nch;
+int t_sampling_frequency[2][3] = {
+{ 22050 , 24000 , 16000},
+{ 44100 , 48000 , 32000}
+};
+
+/* GUI control stuff */
+int send_fd;
+int receive_fd;
+
+int stop_flag;
+int quit_flag;
+
+int GUI_PLAY,GUI_PLAYING,GUI_STOP,GUI_STOPPED,GUI_PAUSE,GUI_PAUSED;
+int GUI_FD_TO_PLAY,GUI_NEXT_FILE_READY;
+
+int A_QUIET,A_SHOW_CNT,A_FORMAT_WAVE,A_DUMP_BINARY;
+int A_WRITE_TO_FILE;
+int A_AUDIO_PLAY;
+int A_SET_VOLUME, A_SHOW_TIME;
+int A_MSG_STDOUT;
+int A_DOWNMIX;
+
+short pcm_sample[64];
+
+short t_bitrate[2][3][15] = {{
+{0,32,48,56,64,80,96,112,128,144,160,176,192,224,256},
+{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160},
+{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160}
+},{
+{0,32,64,96,128,160,192,224,256,288,320,352,384,416,448},
+{0,32,48,56,64,80,96,112,128,160,192,224,256,320,384},
+{0,32,40,48,56,64,80,96,112,128,160,192,224,256,320}
+}};
+
+/* the last sfb is given implicitly on pg.28. of the standard. scalefactors
+ * for that one are 0, pretab also
+ */
+/* leftmost index denotes ID, so first three tables are for MPEG2 (header->ID==0)
+ * and the other three are for MPEG1 (header->ID==1)
+ */
+/* 22.05, 24, 16 */
+int t_b8_l[2][3][22]={{ /* table B.8b ISO/IEC 11172-3 */
+{5,11,17,23,29,35,43,53,65,79,95,115,139,167,199,237,283,335,395,463,521,575},
+{5,11,17,23,29,35,43,53,65,79,95,113,135,161,193,231,277,331,393,463,539,575},
+{5,11,17,23,29,35,43,53,65,79,95,115,139,167,199,237,283,335,395,463,521,575}
+},{
+{3,7,11,15,19,23,29,35,43,51,61,73,89,109,133,161,195,237,287,341,417,575},
+{3,7,11,15,19,23,29,35,41,49,59,71,87,105,127,155,189,229,275,329,383,575},
+{3,7,11,15,19,23,29,35,43,53,65,81,101,125,155,193,239,295,363,447,549,575}
+}};
+int t_b8_s[2][3][13]={{ /* table B.8b ISO/IEC 11172-3 */
+{3,7,11,17,23,31,41,55,73,99,131,173,191},
+{3,7,11,17,25,35,47,61,79,103,135,179,191},
+{3,7,11,17,25,35,47,61,79,103,133,173,191}
+},{
+{3,7,11,15,21,29,39,51,65,83,105,135,191},
+{3,7,11,15,21,27,37,49,63,79,99,125,191},
+{3,7,11,15,21,29,41,57,77,103,137,179,191}
+}};
+
+int args(int argc,char **argv);
+void initialise_decoder(void);
+int decodeMPEG(void);
+void initialise_globals(void);
+void report_header_error(int err);
+int setup_audio(struct AUDIO_HEADER *header);
+void close_audio(void);
+int ready_audio(void);
+
+void play(char *inFileStr, char *outFileStr);
+
+#endif /* AUDIO */
diff --git a/setedit/mp3/libamp/audioalg.c b/setedit/mp3/libamp/audioalg.c
new file mode 100644
index 0000000..ba7584b
--- /dev/null
+++ b/setedit/mp3/libamp/audioalg.c
@@ -0,0 +1,422 @@
+/*
+ Allegro code
+ Written by: Ove Kaaven <ovek@arcticnet.no>
+
+ */
+
+/* Support for Allegro */
+
+#include "amp.h"
+#include "transform.h"
+
+#include <stdio.h>
+#include <string.h>
+#include "audioio.h"
+#include "audio.h"
+
+#include "allegro.h"
+#include "libamp.h"
+
+
+/* SET: Here I check the Allegro version to avoid confusion */
+#if (ALLEGRO_VERSION<3) || ((ALLEGRO_VERSION==3) && (ALLEGRO_SUB_VERSION<1))
+#error You need Allegro 3.1 to compile it.
+#endif
+
+
+/* TODO: */
+/* Better buffer size control */
+
+#undef FULL_BUFFER
+//#define TRACK_FRAME
+
+/* Buffering scheme is based on 9*1024=16*576 */
+
+#ifdef FULL_BUFFER
+
+#define STREAM_SAMP (2*18*1024)
+#define BUF_SAMP (2*32*576)
+
+#else
+
+/* #define STREAM_SAMP (2*1024) */
+#define STREAM_SAMP (2*9*1024)
+#define BUF_SAMP (2*32*576)
+
+#endif
+
+#define UPD_SAMP 1024
+
+static AUDIOSTREAM*audio_left,*audio_right;
+static unsigned short*stream_left,*stream_right;
+static int freq,instereo;
+
+static unsigned short*buffer_left,*buffer_right;
+static unsigned buffer_head,buffer_tail,buffer_used;
+#ifdef TRACK_FRAME
+static unsigned last_frame,*buffer_frame,*stream_frame;
+#endif
+
+unsigned short*amp_buf_left,*amp_buf_right;
+int amp_buf_len;
+
+int amp_dec_frame; /* (duplicate) definition here, so amp.exe will link */
+int amp_reverse_phase; /* another duplicate */
+
+unsigned short*amp_play_left,*amp_play_right;
+int amp_play_len;
+
+int audioAlloc(void)
+{
+ audio_left=play_audio_stream(STREAM_SAMP,16,0,freq,255,instereo?0:128);
+ if (!audio_left) return(0);
+ if (instereo) {
+ audio_right=play_audio_stream(STREAM_SAMP,16,0,freq,255,255);
+ if (!audio_right) return(0);
+ }
+ return(1);
+}
+
+int audioBufferAlloc(void)
+{
+ buffer_left=malloc(BUF_SAMP*sizeof(short));
+ if (!buffer_left) return(0);
+ if (instereo) {
+ buffer_right=malloc(BUF_SAMP*sizeof(short));
+ if (!buffer_right) return(0);
+ }
+#ifdef TRACK_FRAME
+ buffer_frame=malloc(BUF_SAMP*sizeof(unsigned));
+ if (!buffer_frame) return(0);
+ stream_frame=malloc(2*STREAM_SAMP*sizeof(unsigned));
+ if (!stream_frame) return(0);
+ memset(stream_frame,-1,2*STREAM_SAMP*sizeof(unsigned));
+#endif
+ return(1);
+}
+
+void
+audioOpen(int frequency, int stereo, int volume)
+{
+ /* Set 1 or 2 channels */
+ instereo=(stereo ? 1 : 0);
+ DB(audio, msg("Setting stereo to %d\n",instereo) )
+
+ /* Set the output frequency */
+ freq=frequency;
+
+ /* Allocate output channels */
+ if (!audioAlloc())
+ die("Unable to open audio device\n");
+
+ /* Allocate output buffers */
+ if (!audioBufferAlloc())
+ die("Unable to allocate write buffer\n");
+
+ buffer_head=buffer_tail=buffer_used=0;
+ stream_left=stream_right=NULL;
+ amp_buf_left=amp_buf_right=NULL;
+ amp_buf_len=STREAM_SAMP;
+ amp_play_left=amp_play_right=NULL;
+ amp_play_len=UPD_SAMP;
+
+ DB(audio, msg("Audio device opened\n"); )
+
+ if (volume != -1)
+ audioSetVolume(volume);
+}
+
+void
+audioSetVolume(int volume)
+{
+ DB(audio, msg("Setting volume to: %d\n",volume); )
+ set_volume(volume*2,-1);
+}
+
+inline void
+audioStop()
+{
+ DB(audio, msg("audio: stop\n") );
+ if (audio_left) stop_audio_stream(audio_left);
+ if (audio_right) stop_audio_stream(audio_right);
+ amp_buf_left=amp_buf_right=NULL;
+ audio_left=audio_right=NULL;
+ buffer_head=buffer_tail=buffer_used=0;
+}
+
+inline void
+audioStart()
+{
+ if (!audioAlloc())
+ die("Unable to open audio device\n");
+#ifdef TRACK_FRAME
+ memset(stream_frame,-1,2*STREAM_SAMP*sizeof(unsigned));
+#endif
+}
+
+inline void
+audioFlush()
+{
+ DB(audio, msg("audio: flush\n") );
+ audioStop();
+ audioStart();
+}
+
+void
+audioClose()
+{
+ if (audio_left) stop_audio_stream(audio_left);
+ if (audio_right) stop_audio_stream(audio_right);
+ free(buffer_left);
+ free(buffer_right);
+#ifdef TRACK_FRAME
+ free(buffer_frame);
+ free(stream_frame);
+#endif
+ DB(audio, msg("audio: closed stream\n") );
+}
+
+int audioReady(void)
+{
+ if (!stream_left)
+ stream_left=get_audio_stream_buffer(audio_left);
+ if (!stream_left) return(0);
+ if (instereo) {
+ if (!stream_right)
+ stream_right=get_audio_stream_buffer(audio_right);
+ if (!stream_right) return(0);
+ }
+ return(1);
+}
+
+inline int audioUsedSpace(void)
+{
+ return(buffer_used);
+}
+
+int audioSpaceRemaining(void)
+{
+ return(BUF_SAMP-audioUsedSpace());
+}
+
+int
+audioWrite(char *buffer, int count)
+{
+ while (!audioReady()) __dpmi_yield();
+ audioBufferWrite(buffer,count);
+ return(count);
+}
+
+void
+audioBufferTransfer(void)
+{
+ while (audioReady()&&(buffer_used>=STREAM_SAMP)) {
+ memcpy(stream_left,buffer_left+buffer_tail,STREAM_SAMP*sizeof(short));
+ if (instereo) memcpy(stream_right,buffer_right+buffer_tail,STREAM_SAMP*sizeof(short));
+#ifdef TRACK_FRAME
+ memcpy(stream_frame+STREAM_SAMP*audio_left->bufnum,buffer_frame+buffer_tail,STREAM_SAMP*sizeof(unsigned));
+#endif
+ free_audio_stream_buffer(audio_left);
+ if (instereo) free_audio_stream_buffer(audio_right);
+ amp_buf_left=stream_left;
+ if (instereo) amp_buf_right=stream_right; else amp_buf_right=amp_buf_left;
+#ifndef TRACK_FRAME
+ amp_play_left=amp_buf_left; amp_play_right=amp_buf_right;
+#endif
+ stream_left=stream_right=NULL;
+ buffer_tail=(buffer_tail+STREAM_SAMP)%BUF_SAMP;
+ buffer_used-=STREAM_SAMP;
+ }
+}
+
+unsigned
+audioBufferGetFrame(void)
+{
+#ifdef TRACK_FRAME
+ int stream_pos,frame=-1;
+ unsigned block;
+
+ if (amp_buf_left) {
+ amp_play_left=amp_play_right=NULL;
+ if (audio_left&&((stream_pos=voice_get_position(audio_left->voice))>=0)) {
+ block=stream_pos/UPD_SAMP;
+ amp_play_left=(short*)(audio_left->samp->data)+block*UPD_SAMP;
+ if (instereo)
+ amp_play_right=(short*)(audio_right->samp->data)+block*UPD_SAMP;
+ else
+ amp_play_right=amp_play_left;
+ frame=stream_frame[stream_pos];
+ } else frame=last_frame+1;
+ } /* -1 = preparing to play */
+ return(frame);
+#else
+ return(amp_dec_frame);
+#endif
+}
+
+int
+audioIsPlaying(void)
+{
+ if (audioUsedSpace()) return(TRUE);
+ if (audioReady()) return(FALSE);
+ return(TRUE);
+}
+
+void printout(void)
+{
+int j;
+
+ if (nch==2)
+ j=32 * 18 * 2;
+ else
+ j=32 * 18;
+
+ if (A_WRITE_TO_FILE) {
+#ifndef NO_BYTE_SWAPPING
+ short *ptr = (short*) sample_buffer;
+ int i = j;
+
+ for (;i>=0;--i)
+ ptr[i] = ptr[i] << 8 | ptr[i] >> 8;
+#endif
+
+ fwrite(sample_buffer, sizeof(short), j, out_file);
+ }
+
+
+ if (A_AUDIO_PLAY) {
+ if (AUDIO_BUFFER_SIZE==0)
+ audioWrite((char*)sample_buffer, j * sizeof(short));
+ else
+ audioBufferWrite((char*)sample_buffer, j * sizeof(short));
+ }
+
+}
+
+int AUDIO_BUFFER_SIZE;
+
+int
+audioBufferOpen(int frequency, int stereo, int volume)
+{
+ audioOpen(frequency, stereo, volume);
+ return(0);
+}
+
+void
+audioBufferClose()
+{
+ audioClose();
+}
+
+void
+audioBufferWrite(char *buffer, int count)
+{
+ int asmp,smp,cnt;
+
+ DB(audio, msg("audio: Writing %d bytes to audio stream\n",count) );
+
+ asmp=count/sizeof(short);
+ smp=instereo?asmp/2:asmp;
+ while (smp) {
+ cnt=MIN(smp,BUF_SAMP-buffer_head);
+ /* block until free buffer space, if necessary */
+ while ((buffer_used+cnt)>BUF_SAMP) {
+ while (!audioReady()) __dpmi_yield();
+ audioBufferTransfer();
+ }
+ /* split channels */
+ if (instereo) {
+ if (amp_reverse_phase) {
+ int d1,d2,d3,d4;
+ asm volatile (
+ "0: \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "movw %%ax,(%%edi) \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "notw %%ax \n"
+ "movw %%ax,(%%ebx) \n"
+ "addl $2,%%edi \n"
+ "addl $2,%%ebx \n"
+ "decl %%ecx \n"
+ "jnz 0b \n"
+ : "=b" (d1), "=c" (d2), "=S" (d3), "=D" (d4)
+ : "S" (buffer), "D" (buffer_left+buffer_head), "b" (buffer_right+buffer_head), "c" (cnt)
+ : "ax", "memory" );
+ }
+ else {
+ int d1,d2,d3,d4;
+ asm volatile (
+ "0: \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "movw %%ax,(%%edi) \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "movw %%ax,(%%ebx) \n"
+ "addl $2,%%edi \n"
+ "addl $2,%%ebx \n"
+ "decl %%ecx \n"
+ "jnz 0b \n"
+ : "=b" (d1), "=c" (d2), "=S" (d3), "=D" (d4)
+ : "S" (buffer), "D" (buffer_left+buffer_head), "b" (buffer_right+buffer_head), "c" (cnt)
+ : "ax", "memory" );
+ }
+ } else {
+ int d2,d3,d4;
+ asm volatile (
+ "0: \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "stosw \n"
+ "decl %%ecx \n"
+ "jnz 0b \n"
+ : "=c" (d2), "=S" (d3), "=D" (d4)
+ : "S" (buffer), "D" (buffer_left+buffer_head), "c" (cnt)
+ : "ax", "memory" );
+ }
+#ifdef TRACK_FRAME
+ {
+ int d3,d4;
+ asm volatile (
+ "rep \n"
+ "stosl \n"
+ : "=c" (d2), "=D" (d4)
+ : "a" (amp_dec_frame), "D" (buffer_frame+buffer_head), "c" (cnt)
+ : "memory" );
+ }
+ last_frame=amp_dec_frame;
+#endif
+ buffer_head=(buffer_head+cnt)%BUF_SAMP;
+ buffer_used+=cnt; smp-=cnt;
+ }
+
+ audioBufferTransfer();
+}
+
+void audioBufferPad(void)
+{
+ int req,cnt;
+
+ if ((buffer_used)&&(buffer_used<STREAM_SAMP)) {
+ req=STREAM_SAMP-buffer_used;
+ for (cnt=0; cnt<req; cnt++)
+ buffer_left[buffer_head+cnt]=0x8000;
+ if (instereo)
+ for (cnt=0; cnt<req; cnt++)
+ buffer_right[buffer_head+cnt]=0x8000;
+#ifdef TRACK_FRAME
+ for (cnt=0; cnt<req; cnt++)
+ buffer_frame[buffer_head+cnt]=last_frame+1;
+#endif
+ buffer_head=(buffer_head+req)%BUF_SAMP;
+ buffer_used+=req;
+ }
+}
+
+void audioBufferFlush(void)
+{
+ audioFlush();
+}
+
diff --git a/setedit/mp3/libamp/audioio.h b/setedit/mp3/libamp/audioio.h
new file mode 100644
index 0000000..9937f85
--- /dev/null
+++ b/setedit/mp3/libamp/audioio.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* AUSUZ should be the amount of data your audio device will accept after it
+ * has said it is ready to receive data. ie when the device is ready for data it
+ * will accept it without blocking. It must also be a multiple of 128
+ */
+
+#ifdef OS_AIX
+ #define AUSIZ 32768
+#endif
+
+#ifdef OS_Linux
+extern int AUSIZ;
+#endif
+
+#ifdef OS_BSD
+ #define AUSIZ 32768
+#endif
+
+#if defined(OS_IRIX) || defined(OS_IRIX64)
+ #define AUSIZ 32768
+#endif
+
+#ifdef OS_HPUX
+ #define AUSIZ 4096
+#endif
+
+#ifdef OS_SunOS
+ #define AUSIZ 4096
+#endif
+
+
diff --git a/setedit/mp3/libamp/audiolib.c b/setedit/mp3/libamp/audiolib.c
new file mode 100644
index 0000000..1fdfb5a
--- /dev/null
+++ b/setedit/mp3/libamp/audiolib.c
@@ -0,0 +1,408 @@
+/*
+ Amp Library interface
+ (audio.c + guicontrol.c)
+ Adapted by Ove Kaaven <ovek@arcticnet.no>
+ */
+
+
+#include "amp.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifndef __DJGPP__
+#ifndef __BEOS__
+#include <sys/uio.h>
+#endif
+#endif
+
+#ifndef __DJGPP__
+#include <sys/socket.h>
+#endif
+#include <errno.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#define AUDIO
+#include "audio.h"
+#include "formats.h"
+#include "getbits.h"
+#include "huffman.h"
+#include "layer2.h"
+#include "layer3.h"
+#include "position.h"
+#include "rtbuf.h"
+#include "transform.h"
+#include "controldata.h"
+#include "guicontrol.h"
+
+#include "libamp.h"
+
+#ifndef __BEOS__
+typedef int bool;
+#endif
+
+void calculate_t43(void);
+
+int install_amp(void)
+{
+ static bool is_installed=FALSE;
+
+ if (!is_installed) {
+/* initialise_decoder */
+ premultiply();
+ imdct_init();
+ calculate_t43();
+
+/* args */
+ AUDIO_BUFFER_SIZE=300*1024;
+ A_DUMP_BINARY=FALSE;
+ A_QUIET=TRUE;
+ A_FORMAT_WAVE=FALSE;
+ A_SHOW_CNT=FALSE;
+ A_SET_VOLUME=-1;
+ A_SHOW_TIME=0;
+ A_AUDIO_PLAY=TRUE;
+ A_WRITE_TO_FILE=FALSE;
+ A_MSG_STDOUT=FALSE;
+ A_DOWNMIX=FALSE;
+
+ is_installed=TRUE;
+ }
+
+ return(is_installed);
+}
+
+int amp_bitrate,amp_samprat;
+int amp_mpg_ver,amp_layer,amp_stereo,amp_pollsize;
+int amp_playing,amp_draining,amp_loaded=FALSE,amp_reverse_phase=FALSE;
+int amp_looping;
+int amp_dec_frame,amp_dec_time;
+int amp_frame,amp_time;
+struct AUDIO_HEADER amp_cur_header;
+
+void get_amp_info(struct AUDIO_HEADER*header)
+{
+ /* show_header from dump.c */
+ amp_bitrate=t_bitrate[header->ID][3-header->layer][header->bitrate_index];
+ amp_samprat=t_sampling_frequency[header->ID][header->sampling_frequency];
+
+ amp_layer=4-header->layer;
+ if (header->ID==1) amp_mpg_ver=1; else amp_mpg_ver=2;
+
+ if (header->mode==3) amp_stereo=FALSE; else amp_stereo=TRUE;
+
+ amp_pollsize=2*576;
+ if (amp_layer==3)
+ if (!header->ID) amp_pollsize=576;
+}
+
+int read_amp_frame(struct AUDIO_HEADER*header)
+{
+ if (header->layer==1) {
+ if (layer3_frame(header,amp_dec_frame)) {
+ unload_amp();
+ warn(" error. blip.\n");
+ return(0);
+ }
+ } else if (header->layer==2)
+ if (layer2_frame(header,amp_dec_frame)) {
+ unload_amp();
+ warn(" error. blip.\n");
+ return(0);
+ }
+ return(1);
+}
+
+
+int load_amp(char*filename,int loop)
+{
+ int g;
+
+ if (amp_loaded)
+ if (!unload_amp()) return(0);
+
+ if (!install_amp()) return(0);
+
+ if ((in_file=fopen(filename,"rb"))==NULL) {
+ warn("Could not open file: %s\n",filename);
+ return(0);
+ }
+
+/* initialise_globals */
+ append=data=nch=0;
+ f_bdirty=TRUE;
+ bclean_bytes=0;
+ memset(s,0,sizeof s);
+ memset(res,0,sizeof res);
+
+/* load MPEG header */
+ if ((g=gethdr(&amp_cur_header))!=0) {
+ report_header_error(g);
+ fclose(in_file);
+ return(0);
+ }
+ if (amp_cur_header.protection_bit==0) getcrc();
+
+ get_amp_info(&amp_cur_header);
+
+/* setup_audio */
+ if (AUDIO_BUFFER_SIZE==0)
+ audioOpen(amp_samprat,(amp_stereo && !A_DOWNMIX),A_SET_VOLUME);
+ else
+ audioBufferOpen(amp_samprat,(amp_stereo && !A_DOWNMIX),A_SET_VOLUME);
+
+ amp_looping=loop;
+ amp_dec_time=amp_dec_frame=0;
+ amp_time=amp_frame=0;
+
+ return(amp_playing=amp_loaded=TRUE);
+}
+
+extern int audioUsedSpace(void);
+extern int audioSpaceRemaining(void);
+extern int audioReady(void);
+extern int audioStop(void);
+extern int audioStart(void);
+extern int audioBufferPad(void);
+extern unsigned audioBufferGetFrame(void);
+extern int audioIsPlaying(void);
+
+static void update_track_pos(void)
+{
+ int new_frame=audioBufferGetFrame();
+
+ if (new_frame>=0) {
+ amp_frame=new_frame;
+ }
+ amp_time=amp_frame*1152/amp_samprat;
+}
+
+static int init_stop(void)
+{
+ amp_playing=FALSE;
+ /* check for any data left to play in buffer */
+ if (audioIsPlaying()) {
+ amp_draining=TRUE;
+ return(0);
+ }
+ /* nothing left to play, stop */
+ audioStop();
+ return(-1);
+}
+
+static int fetch_header(struct AUDIO_HEADER*header)
+{
+ int g;
+
+ if ((g=gethdr(header))!=0) {
+ report_header_error(g);
+ if (g==GETHDR_EOF && A_FORMAT_WAVE) wav_end(header);
+ A_WRITE_TO_FILE=FALSE; A_FORMAT_WAVE=FALSE;
+ return(-1);
+ }
+
+ if (header->protection_bit==0) getcrc();
+
+ return(0);
+}
+
+static int init_rewind(struct AUDIO_HEADER*header)
+{
+ fseek(in_file,0,SEEK_SET);
+ amp_dec_time=amp_dec_frame=0;
+
+ return(fetch_header(header));
+}
+
+static int exec_replay(void)
+{
+ if (!(amp_playing||amp_draining)) {
+ amp_frame=amp_dec_frame;
+ audioStart();
+ update_track_pos();
+ }
+
+ amp_draining=FALSE;
+
+ return(amp_playing=TRUE);
+}
+
+static int init_replay(void)
+{
+ if (init_rewind(&amp_cur_header)<0) {
+ return(init_stop());
+ }
+
+ return(exec_replay());
+}
+
+static int end_of_track(void)
+{
+ if (amp_looping) {
+ return(init_replay());
+ } else {
+ return(init_stop());
+ }
+}
+
+int poll_amp(void)
+{
+ int poll_size;
+
+ if (!amp_loaded)
+ return(-1);
+ if (!amp_playing)
+ {
+ if (amp_draining)
+ {
+ if (audioUsedSpace())
+ {
+ audioBufferPad();
+ /* try to move some data from buffer to sound card */
+ audioBufferWrite(NULL,0);
+ }
+ update_track_pos();
+ /* check for any data left to play in buffer */
+ if (audioIsPlaying())
+ return(0);
+ /* nothing left to play, stop */
+ amp_draining=FALSE; audioStop();
+ return(-1);
+ }
+ else
+ return(-1);
+ }
+
+ poll_size=2*576;
+ if (amp_cur_header.layer==1)
+ if (!amp_cur_header.ID) poll_size=576;
+
+/* make sure we have enough buffer space left, to avoid blocking */
+ if (audioSpaceRemaining()<poll_size) {
+ /* try to move some data from buffer to sound card */
+ audioBufferWrite(NULL,0);
+ update_track_pos();
+ /* failing that, return */
+ if (audioSpaceRemaining()<poll_size) return(0);
+ }
+
+ amp_dec_frame++;
+ amp_dec_time=amp_dec_frame*1152/amp_samprat;
+
+ if (!read_amp_frame(&amp_cur_header)) {
+ update_track_pos();
+ return(end_of_track());
+ }
+
+ update_track_pos();
+
+ /* get next header */
+ if (fetch_header(&amp_cur_header)<0) {
+ return(end_of_track());
+ }
+
+ return(1);
+}
+
+int run_amp(void)
+{
+ int ret=1;
+
+ if (!amp_loaded) return(-1);
+ if (!(amp_playing||amp_draining)) return(-1);
+ while ((ret=poll_amp())>0);
+ return(ret);
+}
+
+int replay_amp(void)
+{
+ if (!amp_loaded) return(-1);
+ if (amp_playing) {
+ audioStop(); amp_playing=amp_draining=FALSE;
+ }
+ return(init_replay());
+}
+
+int stop_amp(void)
+{
+ if (!amp_loaded)
+ return(-1);
+ if (amp_playing)
+ {
+ audioStop();
+ amp_playing=amp_draining=FALSE;
+ }
+ return 0;
+}
+
+int seek_amp_abs(int frame)
+{
+ if (!amp_loaded) return(-1);
+ if (amp_playing) {
+ audioStop(); amp_playing=amp_draining=FALSE;
+ }
+
+ if (frame>amp_dec_frame) {
+ amp_dec_frame+=ffwd(&amp_cur_header,frame-amp_dec_frame);
+ exec_replay();
+ return(0);
+ } else
+ if (frame<amp_dec_frame) {
+ if (frame<(amp_dec_frame/2)) {
+ if (init_rewind(&amp_cur_header)<0) return(-1);
+ amp_dec_frame+=ffwd(&amp_cur_header,frame);
+ } else {
+ amp_dec_frame-=rew(&amp_cur_header,amp_dec_frame-frame);
+ }
+ exec_replay();
+ return(0);
+ } else {
+ exec_replay();
+ return(0);
+ }
+}
+
+int seek_amp_rel(int framecnt)
+{
+ int frame;
+
+ frame=amp_frame+framecnt;
+ if (frame<0) frame=0;
+ return(seek_amp_abs(frame));
+}
+
+int unload_amp(void)
+{
+ if (!amp_loaded) return(0);
+ amp_loaded=amp_playing=amp_draining=FALSE;
+ if (AUDIO_BUFFER_SIZE!=0)
+ audioBufferClose();
+ else
+ audioClose();
+ fclose(in_file);
+ return(1);
+}
+
+void report_header_error(int err)
+{
+ switch (err) {
+ case GETHDR_ERR: die("error reading mpeg bitstream. exiting.\n");
+ break;
+ case GETHDR_NS : warn("this is a file in MPEG 2.5 format, which is not defined\n");
+ warn("by ISO/MPEG. It is \"a special Fraunhofer format\".\n");
+ warn("amp does not support this format. sorry.\n");
+ break;
+ case GETHDR_FL1: warn("ISO/MPEG layer 1 is not supported by amp (yet).\n");
+ break;
+ case GETHDR_FF : warn("free format bitstreams are not supported. sorry.\n");
+ break;
+ case GETHDR_SYN: warn("oops, we're out of sync.\n");
+ break;
+ case GETHDR_EOF:
+ default: ; /* some stupid compilers need the semicolon */
+ }
+}
+
diff --git a/setedit/mp3/libamp/common.imk b/setedit/mp3/libamp/common.imk
new file mode 100644
index 0000000..a49a2b7
--- /dev/null
+++ b/setedit/mp3/libamp/common.imk
@@ -0,0 +1,30 @@
+#!/usr/bin/make
+
+vpath %.c $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath_obj=obj
+vpath %.o $(vpath_obj)
+
+# These files changes the compilation process so they are important
+# dependencies.
+MAKEFILE_DEPS=rhide.env common.imk
+# Extensions used by GNU tools
+ExOBJ=.o
+ExEXE=.exe
+ExLIB=.a
+
+RHIDE_AS=$(RHIDE_GCC)
+SOURCE_NAME=$<
+OUTFILE=$@
+ALL_PREREQ=$^
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler-with-cpp\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+LIB_DIRS=$(RHIDE_OS_LIBS_PATH) .
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_ARFLAGS=rcs
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE)\
+ $(ALL_PREREQ)
diff --git a/setedit/mp3/libamp/config.h b/setedit/mp3/libamp/config.h
new file mode 100644
index 0000000..8c53d21
--- /dev/null
+++ b/setedit/mp3/libamp/config.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define if you don't have vprintf but do have _doprnt. */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define if you have the vprintf function. */
+#define HAVE_VPRINTF 1
+
+/* Define as __inline if that's what the C compiler calls it. */
+/* #undef inline */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if you have the mlock function. */
+/* #undef HAVE_MLOCK */
+
+/* Define if you have the mlockall function. */
+/* #undef HAVE_MLOCKALL */
+
+/* Define if you have the sched_setscheduler function. */
+/* #undef HAVE_SCHED_SETSCHEDULER */
+
+/* Define if you have the select function. */
+#define HAVE_SELECT 1
+
+/* Define if you have the <dmedia/audio.h> header file. */
+/* #undef HAVE_DMEDIA_AUDIO_H */
+
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the <linux/soundcard.h> header file. */
+/* #undef HAVE_LINUX_SOUNDCARD_H */
+
+/* Define if you have the <machine/soundcard.h> header file. */
+/* #undef HAVE_MACHINE_SOUNDCARD_H */
+
+/* Define if you have the <sys/audioio.h> header file. */
+/* #undef HAVE_SYS_AUDIOIO_H */
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* define if you want playing to use Linux realtime features */
+/* #undef LINUX_REALTIME */
diff --git a/setedit/mp3/libamp/controldata.h b/setedit/mp3/libamp/controldata.h
new file mode 100644
index 0000000..5ba7da1
--- /dev/null
+++ b/setedit/mp3/libamp/controldata.h
@@ -0,0 +1,224 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef __CONTROLDATA_H
+#define __CONTROLDATA_H
+
+#define MSG_CTRL 0
+#define MSG_BUFFER 1
+#define MSG_SONG 2
+#define MSG_QUIT 3
+#define MSG_NEXT 4
+#define MSG_QUERY 5
+#define MSG_RESPONSE 6
+#define MSG_BUFAHEAD 7
+#define MSG_FRAMES 8
+#define MSG_POSITION 9
+#define MSG_SEEK 10
+#define MSG_PRIORITY 11
+#define MSG_RELEASE 12
+#define MSG_AUDIOFAILURE 13
+#define MSG_INFO 14
+
+/* MSG_PRIORITY */
+#define PRIORITY_NORMAL 1
+#define PRIORITY_REALTIME 2
+#define PRIORITY_NICE 3
+
+/* MSG_CTRL */
+#define PLAY_STOP 0
+#define PLAY_PAUSE 1
+#define FORWARD_BEGIN 2
+#define FORWARD_STEP 3
+#define FORWARD_END 4
+#define REWIND_BEGIN 5
+#define REWIND_STEP 6
+#define REWIND_END 7
+
+/* MSG_QUERY */
+#define QUERY_PLAYING 1
+#define QUERY_PAUSED 2
+
+/* MSG_RESPONSE */
+#define FAILURE 0
+#define SUCCESS 1
+
+struct m_cmsghdr
+{
+ unsigned int cmsg_len;
+ int cmsg_level;
+ int cmsg_type;
+ int fd;
+};
+
+typedef struct __controlmsg
+{
+ int type;
+ int data;
+} TControlMsg, *PControlMsg;
+
+/*
+ * The Jukebox assumes that the player reads its commands from stdin
+ * and writes its replies to stdout. The connection type setup by the
+ * jukebox and the player is of type socket.
+ * The jukebox knows nothing more about the player than the following
+ * messages. If they are properly implemented, any player should work.
+ *
+ * The receiving player should send the following messages when specific
+ * events occurs.
+ *
+ ************************************************************************
+ *
+ * MSG_NEXT
+ * When the player is done playing a song, and the playing has not
+ * been explicitly stopped by use of MSG_CTRL/PLAY_STOP, the player
+ * need to send a MSG_NEXT to notify the Jukebox that it's done.
+ *
+ * MSG_INFO
+ * When the player recieves and starts decoding a new song, it can
+ * send a MSG_INFO to the Jukebox telling it about various data
+ * regarding the song. The Information is sent by first sending
+ * a MSG_INFO, directly followed by a AudioInfo struct.
+ *
+ ************************************************************************
+ *
+ * The receiving player should send the following messages at some interval
+ * to notify the Jukebox regarding its progress.
+ *
+ ************************************************************************
+ *
+ * MSG_POSITION
+ * The data member of the message contains the file position, ie what
+ * position is currently being played. This message updates the progress
+ * bar.
+ *
+ * MSG_FRAMES
+ * The number of Mpeg frames currently played. An Mpeg frame, as far as
+ * I know is 4608 bytes. This message updates the clock.
+ *
+ ************************************************************************
+ *
+ * The receiving player can send the following messages to notify the
+ * player regarding some kind of error.
+ ************************************************************************
+ *
+ * MSG_AUDIOFAILURE
+ * The player could not acquire the audiodevice.
+ *
+ * MSG_PRIORITY
+ * If the Jukebox receives this message it will notify the user that
+ * the player does not have the permissions required to use the priority
+ * mode the user wanted.
+ *
+ ************************************************************************
+ *
+ * The receiving process has to be able to handle the following messages:
+ ************************************************************************
+ * MSG_CTRL
+ *
+ * FORWARD_BEGIN
+ * FORWARD_STEP
+ * FORWARD_END
+ * The reason there are three messages is because you might need to lock
+ * the decoding/playing thread while jumping forward in the song.
+ * Once the player has fulfilled one request, it responds with a
+ * MSG_RESPONSE, with data set to FORWARD_BEGIN, FORWARD_STEP,
+ * FORWARD_END. The reason for this is that the jukebox will not send
+ * a new FORWARD_STEP or FORWARD_END request until it is certain the
+ * previous has been served.
+ * If you do not wish to implement forward, just send a MSG_RESPONSE
+ * back immediately upon receiving a forward request.
+ *
+ * REWIND_BEGIN
+ * REWIND_STEP
+ * REWIND_END
+ * The same setup as with forward, and the response is MSG_RESPONSE with
+ * data set to REWIND_BEGIN, REWIND_STEP, REWIND_END.
+ *
+ * PLAY_STOP
+ * This message is sent when the jukebox want the player to stop playing.
+ * The player will not reply to this message in any way, and will neither
+ * send a MSG_NEXT.
+ *
+ * PLAY_PAUSE
+ * This message is sent to either release a paused player, or to pause
+ * the player. No reply is expected.
+ *
+ ************************************************************************
+ *
+ * MSG_QUIT
+ * This message is sent by the Jukebox when the jukebox want the player
+ * to die. No reply is expected. The Jukebox will capture the SIGCHLD if
+ * its around to receive it.
+ *
+ ************************************************************************
+ *
+ * MSG_QUERY
+ * QUERY_PLAYING
+ * This message is sent by the Jukebox when it needs to know if the
+ * player is currently playing or not. It will expect a reply in the
+ * form of MSG_RESPONSE, with data set to TRUE or FALSE.
+ *
+ * QUERY_PAUSED
+ * This message is sent by the Jukebox when it needs to know if the
+ * player is currently paused or not. It will expect a reply in the
+ * form of MSG_RESPONSE, with data set to TRUE or FALSE.
+ *
+ ************************************************************************
+ *
+ * MSG_SONG
+ * This is the most complicated message that the player needs to support.
+ * It's an ordinary message, followed by a message sent by sendmsg with
+ * a filedescriptor `in flight'. Once the MSG_SONG is recieved and read,
+ * the player immediately need to call recvmsg to fetch the filedescriptor.
+ * The recvmsg requries a buffer as an argument. You should have one iovec,
+ * a char buffer of two bytes, and an iovec length of 2.
+ * Basically, if you're confused, look in sajberplay how it extracts the
+ * filedescriptor from the message.
+ *
+ ************************************************************************
+ *
+ *
+ * The following are features that should be included.
+ ************************************************************************
+ *
+ * MSG_BUFFER
+ * The data contains the number of frames that the Jukebox wants buffered
+ * ahead.
+ *
+ * MSG_BUFAHEAD
+ * The data contains the number of frames that the Jukebox wants decoded
+ * before actual play starts. Be careful with the relationship between
+ * frames buffered and bufahead, or you'll deadlock.
+ *
+ * MSG_SEEK
+ * This message tells the player that the Jukebox wants playing to continue
+ * at the file position specified by the data.
+ * Any request that can't be served should just be silently ignored,
+ * like a rewind requests on a stream or socket.
+ *
+ ************************************************************************
+ *
+ * The following are features that would be good if they are included.
+ * Most of them are rather easy to do.
+ ************************************************************************
+ *
+ * MSG_PRIORITY
+ * PRIORITY_NORMAL
+ * Tells the player that is should set its scheduling and static priorities
+ * to SCHED_OTHER and 0.
+ * PRIORITY_REALTIME
+ * Tells the player that its allowed to enter realtime scheduling and
+ * changing static priorities as it sees fit.
+ * PRIORITY_NICE
+ * Tells the player that it's to use SCHED_OTHER scheduling but may change
+ * static priorities at will.
+ *
+ * MSG_RELEASE
+ * The data member of the message is either TRUE or FALSE. This message
+ * tells the player if it should release the audiodevice on an explicit
+ * MSG_STOP or when playing stops [The player might want to wait with
+ * releasing the audio device until the Jukebox has had ample time
+ * anwering a MSG_NEXT].
+ */
+
+#endif
diff --git a/setedit/mp3/libamp/dump.c b/setedit/mp3/libamp/dump.c
new file mode 100644
index 0000000..ed79b2f
--- /dev/null
+++ b/setedit/mp3/libamp/dump.c
@@ -0,0 +1,64 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* dump.c binary/hex dump from buffer
+ *
+ * Created by: tomislav uzelac May 1996
+ * Last modified by: tomislav May 31 1997
+ */
+#include <unistd.h>
+#include <string.h>
+
+#include "audio.h"
+#include "getbits.h"
+
+#define DUMP
+#include "dump.h"
+
+/* no hex dump, sorry
+ */
+void dump(int *length) /* in fact int length[4] */
+{
+int i,j;
+int _data,space=0;
+ printf(" *********** binary dump\n");
+ _data=data;
+ for (i=0;i<4;i++) {
+ for (j=0;j<space;j++) printf(" ");
+ for (j=0;j<length[i];j++) {
+ printf("%1d",(buffer[_data/8] >> (7-(_data&7)) )&1 );
+ space++;
+ _data++;
+ _data&=8*BUFFER_SIZE-1;
+ if (!(_data & 7)) {
+ printf(" ");
+ space++;
+ if (space>70) {
+ printf("\n");
+ space=0;
+ }
+ }
+ }
+ printf("~\n");
+ }
+}
+
+void show_header(struct AUDIO_HEADER *header)
+{
+int bitrate=t_bitrate[header->ID][3-header->layer][header->bitrate_index];
+int fs=t_sampling_frequency[header->ID][header->sampling_frequency];
+int mpg,layer;
+char stm[8];
+ if (A_QUIET) return;
+ layer=4-header->layer;
+ if (header->ID==1) mpg=1;
+ else mpg=2;
+ if (header->mode==3) strcpy(stm,"mono");
+ else strcpy(stm,"stereo");
+
+ printf("\n\
+Properties: %s %dHz\n\
+Coding Method: MPEG%1d.0 layer%1d\n\
+Bitrate: %dkbit/s\n"\
+ ,stm,fs,mpg,layer,bitrate);
+}
diff --git a/setedit/mp3/libamp/dump.h b/setedit/mp3/libamp/dump.h
new file mode 100644
index 0000000..79ebbcd
--- /dev/null
+++ b/setedit/mp3/libamp/dump.h
@@ -0,0 +1,18 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+/* dump.h
+ *
+ * Last modified by: tomislav uzelac May 31 1997
+ */
+
+extern void dump(int *length);
+extern void show_header(struct AUDIO_HEADER *header);
+
+#ifdef DUMP
+void dump(int *length);
+void show_header(struct AUDIO_HEADER *header);
+/*
+static char *t_modes[] = {
+ "stereo","joint_stereo","dual_channel","single_channel"};
+*/
+#endif /* DUMP */
diff --git a/setedit/mp3/libamp/formats.c b/setedit/mp3/libamp/formats.c
new file mode 100644
index 0000000..91747b9
--- /dev/null
+++ b/setedit/mp3/libamp/formats.c
@@ -0,0 +1,64 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* formats.c put functions for different audio formats in here. currently
+ * only .wav, .au would be fine
+ * Created by: tomislav uzelac May 1996
+ */
+#include "audio.h"
+
+#define FORMATS
+#include "formats.h"
+
+/* leave room for .wav header
+*/
+void wav_begin(void)
+{
+ fwrite("",1,44,out_file);
+}
+
+/* this is not proper really, but works!
+*/
+void wav_end(struct AUDIO_HEADER *header)
+{
+unsigned char ispred[20]={0x52 ,0x49 ,0x46 ,0x46 ,0xfc ,0x59 ,0x4 ,0x0 ,0x57
+ ,0x41 ,0x56 ,0x45 ,0x66 ,0x6d ,0x74 ,0x20 ,0x10 ,0x0 ,0x0 ,0x0 };
+unsigned char iza[8]={0x64 ,0x61 ,0x74 ,0x61};
+int len,fs,i;
+
+ len=ftell(out_file)-44;
+ fs=t_sampling_frequency[header->ID][header->sampling_frequency];
+ rewind(out_file);
+ fwrite(ispred,1,20,out_file);
+
+ /* 'microsoft' PCM */
+ fputc(1,out_file);
+ fputc(0,out_file);
+
+ /* nch */
+ fputc(nch,out_file);
+ fputc(0,out_file);
+
+ /* samples_per_second */
+ for (i=0;i<32;i+=8) fputc((fs>>i)&0xff,out_file);
+
+ /* average block size */
+ fs *= 2*nch;
+ for (i=0;i<32;i+=8) fputc((fs>>i)&0xff,out_file);
+
+ /* block align */
+ fs = 2*nch;
+ for (i=0;i<16;i+=8) fputc((fs>>i)&0xff,out_file);
+
+ /* bits per sample */
+ fputc(16,out_file);
+ fputc(0,out_file);
+
+ /* i jope anomalija! */
+ fwrite(iza,1,4,out_file);
+
+ /* length */
+ for (i=0;i<32;i+=8) fputc((len>>i)&0xff,out_file);
+
+/* exit(0); F*k U man! why?!!!*/
+}
diff --git a/setedit/mp3/libamp/formats.h b/setedit/mp3/libamp/formats.h
new file mode 100644
index 0000000..7146258
--- /dev/null
+++ b/setedit/mp3/libamp/formats.h
@@ -0,0 +1,14 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* formats.h
+ *
+ * Created by: tomislav uzelac Dec 22 1996
+ */
+extern void wav_end(struct AUDIO_HEADER *header);
+extern void wav_begin(void);
+
+#ifdef FORMATS
+void wav_end(struct AUDIO_HEADER *header);
+void wav_begin(void);
+#endif /* FORMATS */
diff --git a/setedit/mp3/libamp/getbits.c b/setedit/mp3/libamp/getbits.c
new file mode 100644
index 0000000..6a1577e
--- /dev/null
+++ b/setedit/mp3/libamp/getbits.c
@@ -0,0 +1,274 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* getbits.c bit level routines, input buffer
+ *
+ * Created by: tomislav uzelac Apr 1996
+ * better synchronization, tomislav uzelac, Apr 23 1997
+ */
+#include "amp.h"
+#include "audio.h"
+#include "formats.h"
+#include "rtbuf.h"
+
+#define GETBITS
+#include "getbits.h"
+
+/*
+ * buffer and bit manipulation functions ***************************************
+ */
+static inline int _fillbfr(unsigned int size)
+{
+ _bptr=0;
+ return get_input(_buffer, size);
+}
+
+static inline int readsync()
+{
+ _bptr=0;
+ _buffer[0]=_buffer[1];
+ _buffer[1]=_buffer[2];
+ _buffer[2]=_buffer[3];
+ return get_input(&_buffer[3],1);
+}
+
+static inline unsigned int _getbits(int n)
+{
+unsigned int pos,ret_value;
+
+ pos = _bptr >> 3;
+ ret_value = _buffer[pos] << 24 |
+ _buffer[pos+1] << 16 |
+ _buffer[pos+2] << 8 |
+ _buffer[pos+3];
+ ret_value <<= _bptr & 7;
+ ret_value >>= 32 - n;
+ _bptr += n;
+ return ret_value;
+}
+
+int fillbfr(unsigned int advance)
+{
+int overflow,retval;
+
+ retval=get_input(&buffer[append], advance);
+
+ if ( append + advance >= BUFFER_SIZE ) {
+ overflow = append + advance - BUFFER_SIZE;
+ memcpy (buffer,&buffer[BUFFER_SIZE], overflow);
+ if (overflow < 4) memcpy(&buffer[BUFFER_SIZE],buffer,4);
+ append = overflow;
+ } else {
+ if (append==0) memcpy(&buffer[BUFFER_SIZE],buffer,4);
+ append+=advance;
+ }
+ return retval;
+}
+
+unsigned int getbits(int n)
+{
+ if (n) {
+ unsigned int pos,ret_value;
+
+ pos = data >> 3;
+ ret_value = buffer[pos] << 24 |
+ buffer[pos+1] << 16 |
+ buffer[pos+2] << 8 |
+ buffer[pos+3];
+ ret_value <<= data & 7;
+ ret_value >>= 32 - n;
+
+ data += n;
+ data &= (8*BUFFER_SIZE)-1;
+
+ return ret_value;
+ } else
+ return 0;
+}
+
+/*
+ * header and side info parsing stuff ******************************************
+ */
+static inline void parse_header(struct AUDIO_HEADER *header)
+{
+ header->ID=_getbits(1);
+ header->layer=_getbits(2);
+ header->protection_bit=_getbits(1);
+ header->bitrate_index=_getbits(4);
+ header->sampling_frequency=_getbits(2);
+ header->padding_bit=_getbits(1);
+ header->private_bit=_getbits(1);
+ header->mode=_getbits(2);
+ header->mode_extension=_getbits(2);
+ if (!header->mode) header->mode_extension=0;
+ header->copyright=_getbits(1);
+ header->original=_getbits(1);
+ header->emphasis=_getbits(2);
+}
+
+static inline int header_sanity_check(struct AUDIO_HEADER *header)
+{
+ if ( header->layer==0 ||
+ header->bitrate_index==15 ||
+ header->sampling_frequency==3) return -1;
+
+ /* an additional check to make shure that stuffing never gets mistaken
+ * for a syncword. This rules out some legal layer1 streams, but who
+ * cares about layer1 anyway :-). I must get this right sometime.
+ */
+ if ( header->ID==1 && header->layer==3 && header->protection_bit==1) return -1;
+ return 0;
+}
+
+
+int gethdr(struct AUDIO_HEADER *header)
+{
+int s,retval;
+struct AUDIO_HEADER tmp;
+
+ /* TODO: add a simple byte counter to check only first, say, 1024
+ * bytes for a new header and then return GETHDR_SYN
+ */
+ if ((retval=_fillbfr(4))!=0) return retval;
+
+ for(;;) {
+ while ((s=_getbits(12)) != 0xfff) {
+ if (s==0xffe) {
+ parse_header(&tmp);
+ if (header_sanity_check(&tmp)==0) return GETHDR_NS;
+ }
+ if ((retval=readsync())!=0) return retval;
+ }
+
+ parse_header(&tmp);
+ if (header_sanity_check(&tmp)!=0) {
+ if ((retval=readsync())!=0) return retval;
+ } else break;
+ }
+
+ if (tmp.layer==3) return GETHDR_FL1;
+ /* if (tmp.layer==2) return GETHDR_FL2; */
+ if (tmp.bitrate_index==0) return GETHDR_FF;
+
+ memcpy(header,&tmp,sizeof(tmp));
+ return 0;
+}
+
+/* dummy function, to get crc out of the way
+*/
+void getcrc()
+{
+ _fillbfr(2);
+ _getbits(16);
+}
+
+/* sizes of side_info:
+ * MPEG1 1ch 17 2ch 32
+ * MPEG2 1ch 9 2ch 17
+ */
+void getinfo(struct AUDIO_HEADER *header,struct SIDE_INFO *info)
+{
+int gr,ch,scfsi_band,region,window;
+int nch;
+ if (header->mode==3) {
+ nch=1;
+ if (header->ID) {
+ _fillbfr(17);
+ info->main_data_begin=_getbits(9);
+ _getbits(5);
+ } else {
+ _fillbfr(9);
+ info->main_data_begin=_getbits(8);
+ _getbits(1);
+ }
+ } else {
+ nch=2;
+ if (header->ID) {
+ _fillbfr(32);
+ info->main_data_begin=_getbits(9);
+ _getbits(3);
+ } else {
+ _fillbfr(17);
+ info->main_data_begin=_getbits(8);
+ _getbits(2);
+ }
+ }
+
+ if (header->ID) for (ch=0;ch<nch;ch++)
+ for (scfsi_band=0;scfsi_band<4;scfsi_band++)
+ info->scfsi[ch][scfsi_band]=_getbits(1);
+
+ for (gr=0;gr<(header->ID ? 2:1);gr++)
+ for (ch=0;ch<nch;ch++) {
+ info->part2_3_length[gr][ch]=_getbits(12);
+ info->big_values[gr][ch]=_getbits(9);
+ info->global_gain[gr][ch]=_getbits(8);
+ if (header->ID) info->scalefac_compress[gr][ch]=_getbits(4);
+ else info->scalefac_compress[gr][ch]=_getbits(9);
+ info->window_switching_flag[gr][ch]=_getbits(1);
+
+ if (info->window_switching_flag[gr][ch]) {
+ info->block_type[gr][ch]=_getbits(2);
+ info->mixed_block_flag[gr][ch]=_getbits(1);
+
+ for (region=0;region<2;region++)
+ info->table_select[gr][ch][region]=_getbits(5);
+ info->table_select[gr][ch][2]=0;
+
+ for (window=0;window<3;window++)
+ info->subblock_gain[gr][ch][window]=_getbits(3);
+ } else {
+ for (region=0;region<3;region++)
+ info->table_select[gr][ch][region]=_getbits(5);
+
+ info->region0_count[gr][ch]=_getbits(4);
+ info->region1_count[gr][ch]=_getbits(3);
+ info->block_type[gr][ch]=0;
+ }
+
+ if (header->ID) info->preflag[gr][ch]=_getbits(1);
+ info->scalefac_scale[gr][ch]=_getbits(1);
+ info->count1table_select[gr][ch]=_getbits(1);
+ }
+ return;
+}
+
+int dummy_getinfo(int n)
+{
+ n-=4;
+ if ( fseek(in_file,n,SEEK_CUR) != 0)
+ {
+ if (feof(in_file))
+ return GETHDR_EOF;
+ else
+ return GETHDR_ERR;
+ }
+ return 0;
+}
+
+int rewind_stream(int nbytes)
+{
+ nbytes+=5;
+ if (fseek(in_file, -nbytes, SEEK_CUR) != 0) {
+ /* what if we need to be at the very beginning? */
+ nbytes--;
+ if (fseek(in_file, -nbytes, SEEK_CUR) != 0) return GETHDR_ERR;
+ }
+ return 0;
+}
+
+static inline int get_input(unsigned char* bp, unsigned int size)
+{
+#ifdef LINUX_REALTIME
+ return prefetch_get_input(bp,size);
+#else /* LINUX_REALTIME */
+ if ( fread( bp , 1, size, in_file) != size)
+ {
+ if (feof(in_file))
+ return GETHDR_EOF;
+ else
+ return GETHDR_ERR;
+ }
+ return 0;
+#endif /* LINUX_REALTIME */
+}
diff --git a/setedit/mp3/libamp/getbits.h b/setedit/mp3/libamp/getbits.h
new file mode 100644
index 0000000..3aa9c5a
--- /dev/null
+++ b/setedit/mp3/libamp/getbits.h
@@ -0,0 +1,79 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* getbits.h
+ *
+ * Created by: tomislav uzelac Apr 1996
+ */
+
+/* gethdr() error codes
+*/
+#define GETHDR_ERR 0x1
+#define GETHDR_NS 0x2
+#define GETHDR_FL1 0x4
+#define GETHDR_FL2 0x8
+#define GETHDR_FF 0x10
+#define GETHDR_SYN 0x20
+#define GETHDR_EOF 0x30
+
+/* buffer for the 'bit reservoir'
+*/
+#define BUFFER_SIZE 4096
+#define BUFFER_AUX 2048
+extern unsigned char buffer[];
+extern int append,data,f_bdirty,bclean_bytes;
+
+/* exports
+*/
+extern int fillbfr(unsigned int advance);
+extern unsigned int getbits(int n);
+extern int gethdr(struct AUDIO_HEADER *header);
+extern void getcrc();
+extern void getinfo(struct AUDIO_HEADER *header,struct SIDE_INFO *info);
+extern int dummy_getinfo(int n);
+extern int rewind_stream(int nbytes);
+
+
+#ifdef GETBITS
+
+/* buffer, AUX is used in case of input buffer "overflow", and its contents
+ * are copied to the beginning of the buffer
+*/
+unsigned char buffer[BUFFER_SIZE+BUFFER_AUX];
+
+/* buffer pointers: append counts in bytes, data in bits
+ */
+int append,data;
+
+/* bit reservoir stuff. f_bdirty must be set to TRUE when starting play!
+ */
+int f_bdirty,bclean_bytes;
+
+/* internal buffer, _bptr holds the position in _bits_
+ */
+static unsigned char _buffer[32];
+static int _bptr;
+
+
+/* buffer and bit manipulation functions
+ */
+static inline int _fillbfr(unsigned int size);
+static inline int readsync();
+static inline int get_input(unsigned char* bp, unsigned int size);
+static inline unsigned int _getbits(int n);
+int fillbfr(unsigned int advance);
+unsigned int getbits(int n);
+int dummy_getinfo(int n);
+int rewind_stream(int nbytes);
+
+/* header and side info parsing stuff
+ */
+static inline void parse_header(struct AUDIO_HEADER *header);
+static inline int header_sanity_check(struct AUDIO_HEADER *header);
+
+int gethdr(struct AUDIO_HEADER *header);
+void getcrc();
+void getinfo(struct AUDIO_HEADER *header,struct SIDE_INFO *info);
+
+#endif /* GETBITS */
+
diff --git a/setedit/mp3/libamp/getdata.c b/setedit/mp3/libamp/getdata.c
new file mode 100644
index 0000000..e697d55
--- /dev/null
+++ b/setedit/mp3/libamp/getdata.c
@@ -0,0 +1,235 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* getdata.c scalefactor & huffman data extraction
+ *
+ * Created by: tomislav uzelac Apr 1996
+ * Last modified by: tomislav uzelac Feb 27 1997
+ */
+#include "amp.h"
+#include "audio.h"
+#include "getbits.h"
+#include "huffman.h"
+
+#define GETDATA
+#include "getdata.h"
+
+/* layer3 scalefactor decoding. should we check for the number
+ * of bits read, just in case?
+ */
+int decode_scalefactors(struct SIDE_INFO *info,struct AUDIO_HEADER *header,int gr,int ch)
+{
+int sfb,window;
+int slen1,slen2;
+int i1,i2,i=0;
+int j,k;
+ if (header->ID==1) {
+ /* this is MPEG-1 scalefactors format, quite different than
+ * the MPEG-2 format.
+ */
+ slen1=t_slen1[info->scalefac_compress[gr][ch]];
+ slen2=t_slen2[info->scalefac_compress[gr][ch]];
+ i1=3*slen1;
+ i2=3*slen2;
+
+ if (info->window_switching_flag[gr][ch] && info->block_type[gr][ch]==2) {
+ if (info->mixed_block_flag[gr][ch]) {
+ for (sfb=0;sfb<8;sfb++) {
+ scalefac_l[gr][ch][sfb]=getbits(slen1);
+ i+=slen1;
+ }
+ for (sfb=3;sfb<6;sfb++) {
+ for (window=0;window<3;window++)
+ scalefac_s[gr][ch][sfb][window]=getbits(slen1);
+ i+=i1;
+ }
+ for (;sfb<12;sfb++) {
+ for (window=0;window<3;window++)
+ scalefac_s[gr][ch][sfb][window]=getbits(slen2);
+ i+=i2;
+ }
+ } else { /* !mixed_block_flag */
+ for (sfb=0;sfb<6;sfb++) {
+ for (window=0;window<3;window++)
+ scalefac_s[gr][ch][sfb][window]=getbits(slen1);
+ i+=i1;
+ }
+ for (;sfb<12;sfb++) {
+ for (window=0;window<3;window++)
+ scalefac_s[gr][ch][sfb][window]=getbits(slen2);
+ i+=i2;
+ }
+ }
+ for (window=0;window<3;window++)
+ scalefac_s[gr][ch][12][window]=0;
+ } else { /* block_type!=2 */
+ if ( !info->scfsi[ch][0] || !gr )
+ for (sfb=0;sfb<6;sfb++) {
+ scalefac_l[gr][ch][sfb]=getbits(slen1);
+ i+=slen1;
+ }
+ else for (sfb=0;sfb<6;sfb++) {
+ scalefac_l[1][ch][sfb]=scalefac_l[0][ch][sfb];
+ }
+ if ( !info->scfsi[ch][1] || !gr )
+ for (sfb=6;sfb<11;sfb++) {
+ scalefac_l[gr][ch][sfb]=getbits(slen1);
+ i+=slen1;
+ }
+ else for (sfb=6;sfb<11;sfb++) {
+ scalefac_l[1][ch][sfb]=scalefac_l[0][ch][sfb];
+ }
+ if ( !info->scfsi[ch][2] || !gr )
+ for (sfb=11;sfb<16;sfb++) {
+ scalefac_l[gr][ch][sfb]=getbits(slen2);
+ i+=slen2;
+ }
+ else for (sfb=11;sfb<16;sfb++) {
+ scalefac_l[1][ch][sfb]=scalefac_l[0][ch][sfb];
+ }
+ if ( !info->scfsi[ch][3] || !gr )
+ for (sfb=16;sfb<21;sfb++) {
+ scalefac_l[gr][ch][sfb]=getbits(slen2);
+ i+=slen2;
+ }
+ else for (sfb=16;sfb<21;sfb++) {
+ scalefac_l[1][ch][sfb]=scalefac_l[0][ch][sfb];
+ }
+ scalefac_l[gr][ch][21]=0;
+ }
+ } else { /* ID==0 */
+ int index=0,index2,spooky_index;
+ int slen[5],nr_of_sfb[5]; /* actually, there's four of each, not five, labelled 1 through 4, but
+ * what's a word of storage compared to one's sanity. so [0] is irellevant.
+ */
+
+ /* ok, so we got 3 indexes.
+ * spooky_index - indicates whether we use the normal set of slen eqs and nr_of_sfb tables
+ * or the one for the right channel of intensity stereo coded frame
+ * index - corresponds to the value of scalefac_compress, as listed in the standard
+ * index2 - 0 for long blocks, 1 for short wo/ mixed_block_flag, 2 for short with it
+ */
+ if ( (header->mode_extension==1 || header->mode_extension==3) && ch==1) { /* right ch... */
+ int int_scalefac_compress=info->scalefac_compress[0][ch]>>1;
+ intensity_scale=info->scalefac_compress[0][1]&1;
+ spooky_index=1;
+ if (int_scalefac_compress < 180) {
+ slen[1]=int_scalefac_compress/36;
+ slen[2]=(int_scalefac_compress%36)/6;
+ slen[3]=(int_scalefac_compress%36)%6;
+ slen[4]=0;
+ info->preflag[0][ch]=0;
+ index=0;
+ }
+ if ( 180 <= int_scalefac_compress && int_scalefac_compress < 244) {
+ slen[1]=((int_scalefac_compress-180)%64)>>4;
+ slen[2]=((int_scalefac_compress-180)%16)>>2;
+ slen[3]=(int_scalefac_compress-180)%4;
+ slen[4]=0;
+ info->preflag[0][ch]=0;
+ index=1;
+ }
+ if ( 244 <= int_scalefac_compress && int_scalefac_compress < 255) {
+ slen[1]=(int_scalefac_compress-244)/3;
+ slen[2]=(int_scalefac_compress-244)%3;
+ slen[3]=0;
+ slen[4]=0;
+ info->preflag[0][ch]=0;
+ index=2;
+ }
+ } else { /* the usual */
+ spooky_index=0;
+ if (info->scalefac_compress[0][ch] < 400) {
+ slen[1]=(info->scalefac_compress[0][ch]>>4)/5;
+ slen[2]=(info->scalefac_compress[0][ch]>>4)%5;
+ slen[3]=(info->scalefac_compress[0][ch]%16)>>2;
+ slen[4]=info->scalefac_compress[0][ch]%4;
+ info->preflag[0][ch]=0;
+ index=0;
+ }
+ if (info->scalefac_compress[0][ch] >= 400 && info->scalefac_compress[0][ch] < 500) {
+ slen[1]=((info->scalefac_compress[0][ch]-400)>>2)/5;
+ slen[2]=((info->scalefac_compress[0][ch]-400)>>2)%5;
+ slen[3]=(info->scalefac_compress[0][ch]-400)%4;
+ slen[4]=0;
+ info->preflag[0][ch]=0;
+ index=1;
+ }
+ if (info->scalefac_compress[0][ch] >= 500 && info->scalefac_compress[0][ch] < 512) {
+ slen[1]=(info->scalefac_compress[0][ch]-500)/3;
+ slen[2]=(info->scalefac_compress[0][ch]-500)%3;
+ slen[3]=0;
+ slen[4]=0;
+ info->preflag[0][ch]=1;
+ index=2;
+ }
+ }
+
+ if (info->window_switching_flag[0][ch] && info->block_type[0][ch]==2)
+ {
+ if (info->mixed_block_flag[0][ch])
+ index2=2;
+ else
+ index2=1;
+ }
+ else
+ index2=0;
+
+ for (j=1;j<=4;j++) nr_of_sfb[j]=spooky_table[spooky_index][index][index2][j-1];
+
+ /* now we'll do some actual scalefactor extraction, and a little more.
+ * for each scalefactor band we'll set the value of is_max to indicate
+ * illegal is_pos, since with MPEG2 it's not 'hardcoded' to 7.
+ */
+ if (!info->window_switching_flag[0][ch] || (info->window_switching_flag[0][ch] && info->block_type[0][ch]!=2)) {
+ sfb=0;
+ for (j=1;j<=4;j++)
+ for (k=0;k<nr_of_sfb[j];k++) {
+ scalefac_l[0][ch][sfb]=getbits(slen[j]);
+ i+=slen[j];
+ if (ch) is_max[sfb]=(1<<slen[j])-1;
+ sfb++;
+ }
+ } else if (info->block_type[0][ch]==2)
+ if (!info->mixed_block_flag[0][ch]) {
+ sfb=0;
+ for (j=1;j<=4;j++)
+ for (k=0;k<nr_of_sfb[j];k+=3) {
+ /* we assume here that nr_of_sfb is divisible by 3. it is.
+ */
+ scalefac_s[0][ch][sfb][0]=getbits(slen[j]);
+ scalefac_s[0][ch][sfb][1]=getbits(slen[j]);
+ scalefac_s[0][ch][sfb][2]=getbits(slen[j]);
+ i+=3*slen[j];
+ if (ch) is_max[sfb+6]=(1<<slen[j])-1;
+ sfb++;
+ }
+ } else {
+ /* what we do here is:
+ * 1. assume that for every fs, the two lowest subbands are equal to the
+ * six lowest scalefactor bands for long blocks/MPEG2. they are.
+ * 2. assume that for every fs, the two lowest subbands are equal to the
+ * three lowest scalefactor bands for short blocks. they are.
+ */
+ sfb=0;
+ for (k=0;k<6;k++) {
+ scalefac_l[0][ch][sfb]=getbits(slen[1]);
+ i+=slen[j];
+ if (ch) is_max[sfb]=(1<<slen[1])-1;
+ sfb++;
+ }
+ nr_of_sfb[1]-=6;
+ sfb=3;
+ for (j=1;j<=4;j++)
+ for (k=0;k<nr_of_sfb[j];k+=3) {
+ scalefac_s[0][ch][sfb][0]=getbits(slen[j]);
+ scalefac_s[0][ch][sfb][1]=getbits(slen[j]);
+ scalefac_s[0][ch][sfb][2]=getbits(slen[j]);
+ i+=3*slen[j];
+ if (ch) is_max[sfb+6]=(1<<slen[j])-1;
+ sfb++;
+ }
+ }
+ }
+return i;
+}
diff --git a/setedit/mp3/libamp/getdata.h b/setedit/mp3/libamp/getdata.h
new file mode 100644
index 0000000..f5d3a0d
--- /dev/null
+++ b/setedit/mp3/libamp/getdata.h
@@ -0,0 +1,42 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* getdata.h
+ *
+ * tomislav uzelac Apr 1996
+ */
+
+extern int decode_scalefactors(struct SIDE_INFO *info,struct AUDIO_HEADER *header,int gr,int ch);
+
+extern int is_max[21];
+extern int intensity_scale;
+
+#ifdef GETDATA
+
+static char t_slen1[16]={0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4};
+static char t_slen2[16]={0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3};
+
+int is_max[21]; /* the maximum value of is_pos. for short blocks is_max[sfb=0] == is_max[6],
+ * it's sloppy but i'm sick of waisting storage. blaah...
+ */
+int intensity_scale;
+
+int decode_scalefactors(struct SIDE_INFO *info,struct AUDIO_HEADER *header,int gr,int ch);
+
+/* my implementation of MPEG2 scalefactor decoding is, admitably, horrible
+ * anyway, just take a look at pg.18 of MPEG2 specs, and you'll know what
+ * this is all about
+ */
+static const char spooky_table[2][3][3][4]={
+{
+{ {6,5,5,5}, {9,9,9,9}, {6,9,9,9} },
+{ {6,5,7,3}, {9,9,12,6}, {6,9,12,6}},
+{ {11,10,0,0}, {18,18,0,0}, {15,18,0,0}}
+},
+{
+{ {7,7,7,0}, {12,12,12,0}, {6,15,12,0}},
+{ {6,6,6,3}, {12,9,9,6}, {6,12,9,6}},
+{ {8,8,5,0}, {15,12,9,0}, {6,18,9,0}}
+}};
+
+#endif /* GETDATA */
diff --git a/setedit/mp3/libamp/guicontr.c b/setedit/mp3/libamp/guicontr.c
new file mode 100644
index 0000000..e766bea
--- /dev/null
+++ b/setedit/mp3/libamp/guicontr.c
@@ -0,0 +1,469 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+/* guicontrol.c
+ *
+ * Edouard Lafargue, 12 May 1997
+ */
+#ifndef __DJGPP__
+#ifndef OS_SunOS
+#include "amp.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifndef __DJGPP__
+#ifndef __BEOS__
+#include <sys/uio.h>
+#endif
+#endif
+
+#ifndef __DJGPP__
+#include <sys/socket.h>
+#endif
+#include <errno.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "audio.h"
+#include "formats.h"
+#include "getbits.h"
+#include "huffman.h"
+#include "layer2.h"
+#include "layer3.h"
+#include "position.h"
+#include "rtbuf.h"
+#include "transform.h"
+#include "controldata.h"
+
+#ifndef __BEOS__
+typedef int bool;
+#endif
+
+
+typedef struct __nextsong
+{
+ bool avail;
+ int fd;
+ int type;
+} TNextSong, *PNextSong;
+
+TNextSong nextSong;
+
+void send_msg(PControlMsg msg, bool safe)
+{
+ if(send_fd != -1)
+ {
+ if(safe)
+ while(write(send_fd, msg, sizeof(TControlMsg)) < 0 &&
+ errno == EAGAIN)
+ ;
+ else
+ write(send_fd, msg, sizeof(TControlMsg));
+ }
+}
+
+int get_msg(PControlMsg msg)
+{
+ return read(receive_fd, msg, sizeof(TControlMsg));
+}
+
+
+
+void seek_rewind(int pos)
+{
+ fprintf(stderr,"Seek rewind\n");
+}
+
+
+/* This routine sends the current frame,
+ * and where we are in the file (in percent)
+ */
+
+void GUIstatusDisplay(int frameno)
+{
+ TControlMsg message;
+
+ message.type = MSG_FRAMES;
+ message.data = frameno;
+ send_msg(&message,TRUE);
+
+ message.type = MSG_POSITION;
+ message.data = frameno*419;
+ send_msg(&message,TRUE);
+
+}
+
+void next_song(int fd, int type)
+{
+
+ nextSong.avail = TRUE;
+ nextSong.fd = fd;
+ nextSong.type = type;
+
+}
+
+
+/* parse_msg returns the current "cnt" (it may have been modified
+ * if we did "ffwd" or "rew")
+ * Large chunks of this routine were taken from "sajberplay",
+ * the mpeg part of the original sajber jukebox.
+ * The Sajber Jukebox was written by
+ * Joel Lindholm <wizball@kewl.campus.luth.se>
+ */
+
+int parse_msg(PControlMsg msg, struct AUDIO_HEADER *header, int cnt)
+{
+ switch(msg->type) {
+ case MSG_BUFFER:
+/* fprintf(stderr, "MSG_BUFFER %d\n", msg->data); */
+ break;
+ case MSG_BUFAHEAD:
+/* fprintf(stderr, "MSG_PLAYAHEAD %d\n", msg->data); */
+ break;
+ case MSG_SEEK:
+ break;
+ case MSG_RELEASE:
+ break;
+ case MSG_PRIORITY:
+ break;
+ case MSG_QUERY:
+/* fprintf(stderr,"MSG_QUERY\n"); */
+ {
+ TControlMsg rmsg;
+ rmsg.type = MSG_RESPONSE;
+ switch(msg->data)
+ {
+ case QUERY_PLAYING:
+ rmsg.data = GUI_PLAYING; /* No need to synch. */
+/* fprintf(stderr, "Reply to query playing\n"); */
+ send_msg(&rmsg, TRUE);
+ break;
+ case QUERY_PAUSED:
+/* fprintf(stderr, "Reply to QUERY_PAUSED\n"); */
+ rmsg.data = GUI_PAUSE;
+ send_msg(&rmsg, TRUE);
+ break;
+ }
+ }
+ break;
+ case MSG_CTRL:
+ switch(msg->data)
+ {
+ case PLAY_PAUSE:
+/* fprintf(stderr, "MSG_CTRL - PLAY_PAUSE\n"); */
+ if(GUI_PAUSE)
+ GUI_PAUSE= FALSE;
+ else {
+ GUI_PAUSE=TRUE ;
+ /*
+ if (GUI_PLAYING) audioBufferFlush();
+ */
+ }
+ break;
+ case PLAY_STOP:
+/* fprintf(stderr, "MSG_CTRL - PLAY_STOP\n"); */
+ GUI_STOP = TRUE;
+ if (GUI_PLAYING) audioBufferFlush();
+ break;
+ case FORWARD_BEGIN:
+/* fprintf(stderr, "FORWARD_BEGIN\n"); */
+ /* forward(8); */
+ {
+ TControlMsg rmsg;
+
+ rmsg.type = MSG_RESPONSE;
+ rmsg.data = FORWARD_BEGIN;
+
+ send_msg(&rmsg, TRUE);
+ }
+ break;
+ case FORWARD_STEP:
+ {
+/* fprintf(stderr, "FORWARD_STEP\n"); */
+ if(ffwd(header, 10)==10) cnt+=10;
+ {
+ TControlMsg rmsg;
+
+ rmsg.type = MSG_RESPONSE;
+ rmsg.data = FORWARD_STEP;
+
+ send_msg(&rmsg, TRUE);
+ }
+
+ if (GUI_PLAYING) audioBufferFlush();
+ }
+ break;
+ case FORWARD_END:
+/* fprintf(stderr, "FORWARD_END\n"); */
+ break;
+ case REWIND_BEGIN:
+/* fprintf(stderr, "REWIND_BEGIN\n"); */
+ {
+ TControlMsg rmsg;
+
+ rmsg.type = MSG_RESPONSE;
+ rmsg.data = REWIND_BEGIN;
+
+ send_msg(&rmsg, TRUE);
+ }
+ break;
+ case REWIND_STEP:
+ {
+ int result;
+ /* fprintf(stderr, "REWIND_STEP\n"); */
+ if (cnt>10){
+ if ((result = rew(header, 10))!= -1) {
+ cnt-=result;
+ }
+ }
+ {
+ TControlMsg rmsg;
+
+ rmsg.type = MSG_RESPONSE;
+ rmsg.data = REWIND_STEP;
+
+ send_msg(&rmsg, TRUE);
+ }
+
+ if (GUI_PLAYING) audioBufferFlush();
+ }
+ break;
+ case REWIND_END:
+/* fprintf(stderr, "REWIND_END\n"); */
+ break;
+ }
+ break;
+ case MSG_QUIT:
+ fprintf(stderr, "MSG_QUIT\n");
+ if (GUI_PLAYING) audioBufferFlush();
+ break;
+ case MSG_SONG:
+ {
+ int fd;
+ struct msghdr hdr;
+ struct m_cmsghdr fdhdr;
+ struct iovec iov[1];
+ char data[2];
+
+ iov[0].iov_base = data;
+ iov[0].iov_len = 2;
+
+/* fprintf(stderr, "MSG_SONG\n"); */
+
+ hdr.msg_iov = iov;
+ hdr.msg_iovlen = 1;
+ hdr.msg_name = NULL;
+ hdr.msg_namelen = 0;
+
+ fdhdr.cmsg_len = sizeof(struct m_cmsghdr);
+ fdhdr.cmsg_level = SOL_SOCKET;
+ fdhdr.cmsg_type = SCM_RIGHTS;
+ fdhdr.fd = 0;
+
+ hdr.msg_control = &fdhdr;
+ hdr.msg_controllen = sizeof(struct m_cmsghdr);
+
+ if(recvmsg(receive_fd, &hdr, 0) < 0)
+ perror("recvmsg");
+
+ fd = fdhdr.fd;
+
+/* fprintf(stderr, "FILEFD READ=%d\n", fd); */
+
+ GUI_FD_TO_PLAY = fd;
+ if (GUI_PLAYING) audioBufferFlush();
+ }
+
+ break;
+ }
+ return cnt;
+}
+
+void gui_control(void)
+{
+ int flags,dummy;
+ TControlMsg msg;
+ struct AUDIO_HEADER head;
+
+/* fprintf(stderr,"Amp est contrl par le jukebox...\n"); */
+
+ if((flags = fcntl(STDOUT_FILENO, F_GETFL, 0)) < 0)
+ perror("fcntl");
+ flags |= O_NONBLOCK;
+
+ if(fcntl(STDOUT_FILENO, F_SETFL, flags) < 0)
+ perror("fcntl");
+
+ send_fd = STDOUT_FILENO;
+ receive_fd = STDIN_FILENO;
+
+ GUI_FD_TO_PLAY = -1;
+
+ while(1)
+ {
+ GUI_PAUSE = FALSE;
+ GUI_STOP = FALSE;
+ GUI_STOPPED = TRUE;
+ GUI_PLAY = FALSE;
+ GUI_PLAYING = FALSE;
+
+ if(get_msg(&msg) <= 0)
+ quit_flag = TRUE;
+ else
+ dummy = parse_msg(&msg, &head,0);
+
+ if (quit_flag)
+ {
+/* fprintf(stderr, "quit_flag is true\n"); */
+ exit(0);
+ }
+ while(GUI_FD_TO_PLAY != -1)
+ {
+ GUI_PAUSE = FALSE;
+ GUI_STOP = FALSE;
+ GUI_STOPPED = TRUE;
+ GUI_PLAY = FALSE;
+ GUI_PLAYING = FALSE;
+
+ /* Set stdin to non-blocking */
+ if((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
+ perror("fcntl");
+ flags |= O_NONBLOCK;
+
+ if(fcntl(STDIN_FILENO, F_SETFL, flags) < 0)
+ perror("fcntl");
+
+ decodeMPEG_2(GUI_FD_TO_PLAY);
+
+ if((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
+ perror("fcntl");
+ flags ^= O_NONBLOCK;
+
+ if(fcntl(STDIN_FILENO, F_SETFL, flags) < 0)
+ perror("fcntl");
+ }
+ }
+}
+
+
+int decodeMPEG_2(int inFilefd)
+{
+ struct AUDIO_HEADER header;
+ int cnt,g,err=0;
+ TControlMsg message;
+
+
+ if ((in_file=fdopen(inFilefd,"r"))==NULL) {
+ return(1);
+ }
+
+ append=data=nch=0; /* initialize globals */
+
+ GUI_STOPPED = FALSE;
+ GUI_PLAYING = TRUE;
+ GUI_FD_TO_PLAY = -1;
+
+ for (cnt=0;;cnt++) {
+ if ((g=gethdr(&header))!=0) {
+ switch (g) {
+ case GETHDR_ERR: die("error reading mpeg bitstream. exiting.\n");
+ break;
+ case GETHDR_NS : warn("this is a file in MPEG 2.5 format, which is not defined\n");
+ warn("by ISO/MPEG. It is \"a special Fraunhofer format\".\n");
+ warn("amp does not support this format. sorry.\n");
+ break;
+ case GETHDR_FL1: warn("ISO/MPEG layer 1 is not supported by amp (yet).\n");
+ break;
+ case GETHDR_FF : warn("free format bitstreams are not supported. sorry.\n");
+ break;
+ case GETHDR_SYN: warn("oops, we're out of sync.\n");
+ break;
+ default:
+ }
+ break;
+ }
+
+ if (!(cnt%10)){
+ GUIstatusDisplay(cnt);
+ }
+
+ if(get_msg(&message) >= 0)
+ {
+ int pflag = 0;
+ cnt = parse_msg(&message,&header,cnt);
+ if (GUI_PAUSE) {
+ int flags;
+ pflag = 1;
+ /* Set stdin to blocking */
+ if((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
+ perror("fcntl");
+ flags ^= O_NONBLOCK;
+ if(fcntl(STDIN_FILENO, F_SETFL, flags) < 0)
+ perror("fcntl");
+ }
+ while(GUI_PAUSE){
+ if(get_msg(&message) >= 0)
+ cnt = parse_msg(&message,&header,cnt);
+ }
+ if (pflag) {
+ int flags;
+ /* Set stdin to non-blocking */
+ if((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
+ perror("fcntl");
+ flags |= O_NONBLOCK;
+ if(fcntl(STDIN_FILENO, F_SETFL, flags) < 0)
+ perror("fcntl");
+ }
+ if (GUI_STOP || (GUI_FD_TO_PLAY != -1)){
+ break;
+ }
+ }
+
+ /* crc is read just to get out of the way.
+ */
+ if (header.protection_bit==0) getcrc();
+
+ if (!cnt && A_AUDIO_PLAY) { /* setup the audio when we have the frame info */
+
+ if (AUDIO_BUFFER_SIZE==0)
+ audioOpen(t_sampling_frequency[header.ID][header.sampling_frequency],
+ (header.mode!=3),
+ A_SET_VOLUME);
+ else
+ audioBufferOpen(t_sampling_frequency[header.ID][header.sampling_frequency],(header.mode!=3),A_SET_VOLUME);
+ }
+
+ if (layer3_frame(&header,cnt)) {
+ warn(" error. blip.\n");
+ err=1;
+ break;
+ }
+
+ }
+ fclose(in_file);
+ if (A_AUDIO_PLAY)
+ if (AUDIO_BUFFER_SIZE!=0)
+ audioBufferClose();
+ else
+ audioClose();
+ else
+ fclose(out_file);
+ if (!(GUI_STOP) && (GUI_FD_TO_PLAY == -1)) {
+ /* We've reached the end of the track, notify the jukebox...
+ */
+ TControlMsg rmsg;
+
+ rmsg.type = MSG_NEXT;
+ rmsg.data = 0;
+ send_msg(&rmsg, TRUE);
+ }
+
+ GUI_STOPPED = TRUE;
+ GUI_PLAYING = FALSE;
+ return(err);
+}
+#endif /*OS_SunOS*/
+#endif /* DJGPP */
+
diff --git a/setedit/mp3/libamp/guicontrol.h b/setedit/mp3/libamp/guicontrol.h
new file mode 100644
index 0000000..771bc48
--- /dev/null
+++ b/setedit/mp3/libamp/guicontrol.h
@@ -0,0 +1,3 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void gui_control(void);
diff --git a/setedit/mp3/libamp/huffman.c b/setedit/mp3/libamp/huffman.c
new file mode 100644
index 0000000..d8847e8
--- /dev/null
+++ b/setedit/mp3/libamp/huffman.c
@@ -0,0 +1,208 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* huffman.c huffman decoding
+ *
+ * Created by: tomislav uzelac Mar,Apr 1996
+ * Last modified by: tomislav uzelac Mar 8 97
+ */
+#include "audio.h"
+#include "getbits.h"
+
+#define HUFFMAN
+#include "huffman.h"
+
+static inline unsigned int viewbits(int n)
+{
+unsigned int pos,ret_value;
+
+ pos = data >> 3;
+ ret_value = buffer[pos] << 24 |
+ buffer[pos+1] << 16 |
+ buffer[pos+2] << 8 |
+ buffer[pos+3];
+ ret_value <<= data & 7;
+ ret_value >>= 32 - n;
+
+ return ret_value;
+}
+
+static inline void sackbits(int n)
+{
+ data += n;
+ data &= 8*BUFFER_SIZE-1;
+}
+
+/* huffman_decode() is supposed to be faster now
+ * decodes one codeword and returns no. of bits
+ */
+static inline int huffman_decode(int tbl,int *x,int *y)
+{
+unsigned int chunk;
+register unsigned int *h_tab;
+register unsigned int lag;
+register unsigned int half_lag;
+int len;
+
+ h_tab=tables[tbl];
+ chunk=viewbits(19);
+
+ h_tab += h_cue[tbl][chunk >> (19-NC_O)];
+
+ len=(*h_tab>>8)&0x1f;
+
+ /* check for an immediate hit, so we can decode those short codes very fast
+ */
+ if ((*h_tab>>(32-len)) != (chunk>>(19-len))) {
+ if (chunk >> (19-NC_O) < N_CUE-1)
+ lag=(h_cue[tbl][(chunk >> (19-NC_O))+1] -
+ h_cue[tbl][chunk >> (19-NC_O)]);
+ else {
+ /* we strongly depend on h_cue[N_CUE-1] to point to
+ * the last entry in the huffman table, so we should
+ * not get here anyway. if it didn't, we'd have to
+ * have another table with huffman tables lengths, and
+ * it would be a mess. just in case, scream&shout.
+ */
+ printf(" h_cue clobbered. this is a bug. blip.\n");
+ exit (-1);
+ }
+ chunk <<= 32-19;
+ chunk |= 0x1ff;
+
+ half_lag = lag >> 1;
+
+ h_tab += half_lag;
+ lag -= half_lag;
+
+ while (lag > 1) {
+ half_lag = lag >> 1;
+
+ if (*h_tab < chunk)
+ h_tab += half_lag;
+ else
+ h_tab -= half_lag;
+
+ lag -= half_lag;
+ }
+
+ len=(*h_tab>>8)&0x1f;
+ if ((*h_tab>>(32-len)) != (chunk>>(32-len))) {
+ if (*h_tab > chunk)
+ h_tab--;
+ else
+ h_tab++;
+
+ len=(*h_tab>>8)&0x1f;
+ }
+ }
+ sackbits(len);
+ *x=(*h_tab>>4)&0xf;
+ *y=*h_tab&0xf;
+ return len;
+}
+
+static inline int _qsign(int x,int *q)
+{
+int ret_value=0,i;
+ for (i=3;i>=0;i--)
+ if ((x>>i) & 1) {
+ if (getbits(1)) *q++=-1;
+ else *q++=1;
+ ret_value++;
+ }
+ else *q++=0;
+ return ret_value;
+}
+
+int decode_huffman_data(struct SIDE_INFO *info,int gr,int ch,int ssize)
+{
+int l,i,cnt,x,y;
+int q[4],r[3],linbits[3],tr[4]={0,0,0,0};
+int big_value = info->big_values[gr][ch] << 1;
+
+ for (l=0;l<3;l++) {
+ tr[l]=info->table_select[gr][ch][l];
+ linbits[l]=t_linbits[info->table_select[gr][ch][l]];
+ }
+
+ tr[3]=32+info->count1table_select[gr][ch];
+
+ /* we have to be careful here because big_values are not necessarily
+ * aligned with sfb boundaries
+ */
+ if (!info->window_switching_flag[gr][ch] && info->block_type[gr][ch]==0) {
+
+ /* this code needed some cleanup
+ */
+ r[0]=t_l[info->region0_count[gr][ch]] + 1;
+ if (r[0] > big_value)
+ r[0]=r[1]=big_value;
+ else {
+ r[1]=t_l[ info->region0_count[gr][ch] + info->region1_count[gr][ch] + 1 ] + 1;
+ if (r[1] > big_value)
+ r[1]=big_value;
+ }
+ r[2]=big_value;
+
+ } else {
+
+ if (info->block_type[gr][ch]==2 && info->mixed_block_flag[gr][ch]==0)
+ r[0]=3*(t_s[2]+1);
+ else
+ r[0]=t_l[7]+1;
+
+ if (r[0] > big_value)
+ r[0]=big_value;
+
+ r[1]=r[2]=big_value;
+ }
+
+ l=0; cnt=0;
+ for (i=0;i<3;i++) {
+ for (;l<r[i];l+=2) {
+ int j = linbits[i];
+
+ cnt+=huffman_decode(tr[i],&x,&y);
+
+ if (x==15 && j>0) {
+ x+=getbits(j);
+ cnt+=j;
+ }
+ if (x) {
+ if (getbits(1)) x=-x;
+ cnt++;
+ }
+ if (y==15 && j>0) {
+ y+=getbits(j);
+ cnt+=j;
+ }
+ if (y) {
+ if (getbits(1)) y=-y;
+ cnt++;
+ }
+
+ is[ch][l]=x;
+ is[ch][l+1]=y;
+ }
+ }
+ while ((cnt < info->part2_3_length[gr][ch]-ssize) && (l<576)) {
+ cnt+=huffman_decode(tr[3],&x,&y);
+ cnt+=_qsign(x,q);
+ for (i=0;i<4;i++) is[ch][l+i]=q[i]; /* ziher je ziher, is[578]*/
+ l+=4;
+ }
+
+ /* set position to start of the next gr/ch
+ */
+ if (cnt != info->part2_3_length[gr][ch] - ssize ) {
+ data-=cnt-(info->part2_3_length[gr][ch] - ssize);
+ data&= 8*BUFFER_SIZE - 1;
+ }
+ if (l<576) non_zero[ch]=l;
+ else non_zero[ch]=576;
+ /* zero out everything else
+ */
+ for (;l<576;l++) is[ch][l]=0;
+ return 1;
+}
diff --git a/setedit/mp3/libamp/huffman.h b/setedit/mp3/libamp/huffman.h
new file mode 100644
index 0000000..440d258
--- /dev/null
+++ b/setedit/mp3/libamp/huffman.h
@@ -0,0 +1,259 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* huffman.h
+ *
+ * Created by: tomislav uzelac Mar 1996
+ * Last edited by: tomislav uzelac Mar 8 97
+ */
+
+extern int decode_huffman_data(struct SIDE_INFO *info,int gr,int ch,int ssize);
+
+extern int non_zero[2];
+extern int t_linbits[32];
+
+#ifdef HUFFMAN
+
+static inline unsigned int viewbits(int n);
+static inline void sackbits(int n);
+static inline int huffman_decode(int tbl,int *x,int *y);
+static inline int _qsign(int x,int *q);
+int decode_huffman_data(struct SIDE_INFO *info,int gr,int ch,int ssize);
+
+int non_zero[2]; /* this is 2*bigvalues+4*count1, i guess...*/
+
+#define N_CUE 16
+#define NC_O 4
+
+int t_linbits[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,6,8,10,13,4,5,6,7,8,9,11,13};
+
+/* these are the huffman tables, rearranged for lookup
+*/
+unsigned int h0[1]={0x0};
+unsigned int h1[4]={0x311, 0x20000301, 0x40000210, 0x80000100};
+unsigned int h2[9]={0x622, 0x4000602, 0x8000512, 0x10000521, 0x18000520, 0x20000311, 0x40000301, 0x60000310,
+ 0x80000100};
+unsigned int h3[9]={ 0x622, 0x4000602, 0x8000512, 0x10000521, 0x18000520, 0x20000310, 0x40000211, 0x80000201,
+ 0xc0000200};
+unsigned int h5[16]={0x833, 0x1000823, 0x2000732, 0x4000631, 0x8000713, 0xa000703, 0xc000730, 0xe000722,
+ 0x10000612, 0x14000621, 0x18000602, 0x1c000620, 0x20000311, 0x40000301, 0x60000310, 0x80000100};
+unsigned int h6[16]={0x733, 0x2000703, 0x4000623, 0x8000632, 0xc000630, 0x10000513, 0x18000531, 0x20000522,
+ 0x28000502, 0x30000412, 0x40000421, 0x50000420, 0x60000301, 0x80000211, 0xc0000310, 0xe0000300};
+unsigned int h7[36]={ 0xa55, 0x400a45, 0x800a54, 0xc00a53, 0x1000935, 0x1800944, 0x2000925, 0x2800952,
+ 0x3000815, 0x4000851, 0x5000905, 0x5800934, 0x6000850, 0x7000943, 0x7800933, 0x8000824,
+ 0x9000842, 0xa000714, 0xc000741, 0xe000740, 0x10000804, 0x11000823, 0x12000832, 0x13000803,
+ 0x14000713, 0x16000731, 0x18000730, 0x1a000722, 0x1c000612, 0x20000521, 0x28000602, 0x2c000620,
+ 0x30000411, 0x40000301, 0x60000310, 0x80000100};
+unsigned int h8[36]={0xb55, 0x200b54, 0x400a45, 0x800953, 0x1000a35, 0x1400a44, 0x1800925, 0x2000952,
+ 0x2800905, 0x3000815, 0x4000851, 0x5000934, 0x5800943, 0x6000950, 0x6800933, 0x7000824,
+ 0x8000842, 0x9000814, 0xa000741, 0xc000804, 0xd000840, 0xe000823, 0xf000832, 0x10000813,
+ 0x11000831, 0x12000803, 0x13000830, 0x14000622, 0x18000602, 0x1c000620, 0x20000412, 0x30000421,
+ 0x40000211, 0x80000301, 0xa0000310, 0xc0000200};
+unsigned int h9[36]={ 0x955, 0x800945, 0x1000835, 0x2000853, 0x3000954, 0x3800905, 0x4000844, 0x5000825,
+ 0x6000852, 0x7000815, 0x8000751, 0xa000734, 0xc000743, 0xe000850, 0xf000804, 0x10000724,
+ 0x12000742, 0x14000733, 0x16000740, 0x18000614, 0x1c000641, 0x20000623, 0x24000632, 0x28000513,
+ 0x30000531, 0x38000603, 0x3c000630, 0x40000522, 0x48000502, 0x50000412, 0x60000421, 0x70000420,
+ 0x80000311, 0xa0000301, 0xc0000310, 0xe0000300};
+unsigned int h10[64]={ 0xb77, 0x200b67, 0x400b76, 0x600b57, 0x800b75, 0xa00b66, 0xc00a47, 0x1000a74,
+ 0x1400a56, 0x1800a65, 0x1c00a37, 0x2000a73, 0x2400a46, 0x2800b55, 0x2a00b54, 0x2c00a63,
+ 0x3000927, 0x3800972, 0x4000a64, 0x4400a07, 0x4800970, 0x5000962, 0x5800a45, 0x5c00a35,
+ 0x6000906, 0x6800a53, 0x6c00a44, 0x7000817, 0x8000871, 0x9000936, 0x9800926, 0xa000a25,
+ 0xa400a52, 0xa800915, 0xb000951, 0xb800a34, 0xbc00a43, 0xc000816, 0xd000861, 0xe000860,
+ 0xf000905, 0xf800950, 0x10000924, 0x10800942, 0x11000933, 0x11800904, 0x12000814, 0x13000841,
+ 0x14000840, 0x15000823, 0x16000832, 0x17000803, 0x18000713, 0x1a000731, 0x1c000730, 0x1e000722,
+ 0x20000612, 0x24000621, 0x28000602, 0x2c000620, 0x30000411, 0x40000301, 0x60000310, 0x80000100};
+unsigned int h11[64]={ 0xa77, 0x400a67, 0x800a76, 0xc00a75, 0x1000a66, 0x1400a47, 0x1800a74, 0x1c00b57,
+ 0x1e00b55, 0x2000a56, 0x2400a65, 0x2800937, 0x3000973, 0x3800946, 0x4000a45, 0x4400a54,
+ 0x4800a35, 0x4c00a53, 0x5000827, 0x6000872, 0x7000964, 0x7800907, 0x8000771, 0xa000817,
+ 0xb000870, 0xc000836, 0xd000863, 0xe000860, 0xf000944, 0xf800925, 0x10000952, 0x10800905,
+ 0x11000815, 0x12000762, 0x14000826, 0x15000806, 0x16000716, 0x18000761, 0x1a000851, 0x1b000834,
+ 0x1c000850, 0x1d000943, 0x1d800933, 0x1e000824, 0x1f000842, 0x20000814, 0x21000841, 0x22000804,
+ 0x23000840, 0x24000723, 0x26000732, 0x28000613, 0x2c000631, 0x30000703, 0x32000730, 0x34000622,
+ 0x38000521, 0x40000412, 0x50000502, 0x58000520, 0x60000311, 0x80000301, 0xa0000310, 0xc0000200};
+unsigned int h12[64]={ 0xa77, 0x400a67, 0x800976, 0x1000957, 0x1800975, 0x2000966, 0x2800947, 0x3000974,
+ 0x3800965, 0x4000856, 0x5000837, 0x6000973, 0x6800955, 0x7000827, 0x8000872, 0x9000846,
+ 0xa000864, 0xb000817, 0xc000871, 0xd000907, 0xd800970, 0xe000836, 0xf000863, 0x10000845,
+ 0x11000854, 0x12000844, 0x13000906, 0x13800905, 0x14000726, 0x16000762, 0x18000761, 0x1a000816,
+ 0x1b000860, 0x1c000835, 0x1d000853, 0x1e000825, 0x1f000852, 0x20000715, 0x22000751, 0x24000734,
+ 0x26000743, 0x28000850, 0x29000804, 0x2a000724, 0x2c000742, 0x2e000714, 0x30000633, 0x34000641,
+ 0x38000623, 0x3c000632, 0x40000740, 0x42000703, 0x44000630, 0x48000513, 0x50000531, 0x58000522,
+ 0x60000412, 0x70000421, 0x80000502, 0x88000520, 0x90000400, 0xa0000311, 0xc0000301, 0xe0000310};
+unsigned int h13[256]={
+ 0x13fe, 0x33fc, 0x52fd, 0x91ed, 0x110ff, 0x210ef, 0x310df, 0x410ee,
+ 0x510cf, 0x610de, 0x710bf, 0x810fb, 0x910ce, 0xa10dc, 0xb11af, 0xb91e9,
+ 0xc0fec, 0xe0fdd, 0x1010fa, 0x1110cd, 0x120fbe, 0x140feb, 0x160f9f, 0x180ff9,
+ 0x1a0fea, 0x1c0fbd, 0x1e0fdb, 0x200f8f, 0x220ff8, 0x240fcc, 0x2610ae, 0x27109e,
+ 0x280f8e, 0x2a107f, 0x2b107e, 0x2c0ef7, 0x300eda, 0x340fad, 0x360fbc, 0x380fcb,
+ 0x3a0ff6, 0x3c0e6f, 0x400ee8, 0x440e5f, 0x480e9d, 0x4c0ed9, 0x500ef5, 0x540ee7,
+ 0x580eac, 0x5c0ebb, 0x600e4f, 0x640ef4, 0x680fca, 0x6a0fe6, 0x6c0ef3, 0x700d3f,
+ 0x780e8d, 0x7c0ed8, 0x800d2f, 0x880df2, 0x900e6e, 0x940e9c, 0x980d0f, 0xa00ec9,
+ 0xa40e5e, 0xa80dab, 0xb00e7d, 0xb40ed7, 0xb80d4e, 0xc00ec8, 0xc40ed6, 0xc80d3e,
+ 0xd00db9, 0xd80e9b, 0xdc0eaa, 0xe00c1f, 0xf00cf1, 0x1000cf0, 0x1100dba, 0x1180de5,
+ 0x1200de4, 0x1280d8c, 0x1300d6d, 0x1380de3, 0x1400ce2, 0x1500d2e, 0x1580d0e, 0x1600c1e,
+ 0x1700ce1, 0x1800de0, 0x1880d5d, 0x1900dd5, 0x1980d7c, 0x1a00dc7, 0x1a80d4d, 0x1b00d8b,
+ 0x1b80db8, 0x1c00dd4, 0x1c80d9a, 0x1d00da9, 0x1d80d6c, 0x1e00cc6, 0x1f00c3d, 0x2000dd3,
+ 0x2080d7b, 0x2100c2d, 0x2200cd2, 0x2300c1d, 0x2400cb7, 0x2500d5c, 0x2580dc5, 0x2600d99,
+ 0x2680d7a, 0x2700cc3, 0x2800da7, 0x2880d97, 0x2900c4b, 0x2a00bd1, 0x2c00c0d, 0x2d00cd0,
+ 0x2e00c8a, 0x2f00ca8, 0x3000c4c, 0x3100cc4, 0x3200c6b, 0x3300cb6, 0x3400b3c, 0x3600b2c,
+ 0x3800bc2, 0x3a00b5b, 0x3c00cb5, 0x3d00c89, 0x3e00b1c, 0x4000bc1, 0x4200c98, 0x4300c0c,
+ 0x4400bc0, 0x4600cb4, 0x4700c6a, 0x4800ca6, 0x4900c79, 0x4a00b3b, 0x4c00bb3, 0x4e00c88,
+ 0x4f00c5a, 0x5000b2b, 0x5200ca5, 0x5300c69, 0x5400ba4, 0x5600c78, 0x5700c87, 0x5800b94,
+ 0x5a00c77, 0x5b00c76, 0x5c00ab2, 0x6000a1b, 0x6400ab1, 0x6800b0b, 0x6a00bb0, 0x6c00b96,
+ 0x6e00b4a, 0x7000b3a, 0x7200ba3, 0x7400b59, 0x7600b95, 0x7800a2a, 0x7c00aa2, 0x8000a1a,
+ 0x8400aa1, 0x8800b0a, 0x8a00b68, 0x8c00aa0, 0x9000b86, 0x9200b49, 0x9400a93, 0x9800b39,
+ 0x9a00b58, 0x9c00b85, 0x9e00b67, 0xa000a29, 0xa400a92, 0xa800b57, 0xaa00b75, 0xac00a38,
+ 0xb000a83, 0xb400b66, 0xb600b47, 0xb800b74, 0xba00b56, 0xbc00b65, 0xbe00b73, 0xc000919,
+ 0xc800991, 0xd000a09, 0xd400a90, 0xd800a48, 0xdc00a84, 0xe000a72, 0xe400b46, 0xe600b64,
+ 0xe800928, 0xf000982, 0xf800918, 0x10000a37, 0x10400a27, 0x10800917, 0x11000971, 0x11800a55,
+ 0x11c00a07, 0x12000a70, 0x12400a36, 0x12800a63, 0x12c00a45, 0x13000a54, 0x13400a26, 0x13800a62,
+ 0x13c00a35, 0x14000881, 0x15000908, 0x15800980, 0x16000916, 0x16800961, 0x17000906, 0x17800960,
+ 0x18000a53, 0x18400a44, 0x18800925, 0x19000952, 0x19800905, 0x1a000815, 0x1b000851, 0x1c000934,
+ 0x1c800943, 0x1d000950, 0x1d800924, 0x1e000942, 0x1e800933, 0x1f000814, 0x20000741, 0x22000804,
+ 0x23000840, 0x24000823, 0x25000832, 0x26000713, 0x28000731, 0x2a000703, 0x2c000730, 0x2e000722,
+ 0x30000612, 0x34000621, 0x38000602, 0x3c000620, 0x40000411, 0x50000401, 0x60000310, 0x80000100};
+unsigned int h15[256]={ 0xdff, 0x80def, 0x100dfe, 0x180ddf, 0x200cee, 0x300dfd, 0x380dcf, 0x400dfc,
+ 0x480dde, 0x500ded, 0x580dbf, 0x600cfb, 0x700dce, 0x780dec, 0x800cdd, 0x900caf,
+ 0xa00cfa, 0xb00cbe, 0xc00ceb, 0xd00ccd, 0xe00cdc, 0xf00c9f, 0x1000cf9, 0x1100cea,
+ 0x1200cbd, 0x1300cdb, 0x1400c8f, 0x1500cf8, 0x1600ccc, 0x1700c9e, 0x1800ce9, 0x1900c7f,
+ 0x1a00cf7, 0x1b00cad, 0x1c00cda, 0x1d00cbc, 0x1e00c6f, 0x1f00dae, 0x1f80d0f, 0x2000bcb,
+ 0x2200bf6, 0x2400c8e, 0x2500ce8, 0x2600c5f, 0x2700c9d, 0x2800bf5, 0x2a00b7e, 0x2c00be7,
+ 0x2e00bac, 0x3000bca, 0x3200bbb, 0x3400cd9, 0x3500c8d, 0x3600b4f, 0x3800bf4, 0x3a00b3f,
+ 0x3c00bf3, 0x3e00bd8, 0x4000be6, 0x4200b2f, 0x4400bf2, 0x4600c6e, 0x4700cf0, 0x4800b1f,
+ 0x4a00bf1, 0x4c00b9c, 0x4e00bc9, 0x5000b5e, 0x5200bab, 0x5400bba, 0x5600be5, 0x5800b7d,
+ 0x5a00bd7, 0x5c00b4e, 0x5e00be4, 0x6000b8c, 0x6200bc8, 0x6400b3e, 0x6600b6d, 0x6800bd6,
+ 0x6a00be3, 0x6c00b9b, 0x6e00bb9, 0x7000b2e, 0x7200baa, 0x7400be2, 0x7600b1e, 0x7800be1,
+ 0x7a00c0e, 0x7b00ce0, 0x7c00b5d, 0x7e00bd5, 0x8000b7c, 0x8200bc7, 0x8400b4d, 0x8600b8b,
+ 0x8800ad4, 0x8c00bb8, 0x8e00b9a, 0x9000ba9, 0x9200b6c, 0x9400bc6, 0x9600b3d, 0x9800ad3,
+ 0x9c00ad2, 0xa000b2d, 0xa200b0d, 0xa400a1d, 0xa800a7b, 0xac00ab7, 0xb000ad1, 0xb400b5c,
+ 0xb600bd0, 0xb800ac5, 0xbc00a8a, 0xc000aa8, 0xc400a4c, 0xc800ac4, 0xcc00a6b, 0xd000ab6,
+ 0xd400b99, 0xd600b0c, 0xd800a3c, 0xdc00ac3, 0xe000a7a, 0xe400aa7, 0xe800aa6, 0xec00bc0,
+ 0xee00b0b, 0xf0009c2, 0xf800a2c, 0xfc00a5b, 0x10000ab5, 0x10400a1c, 0x10800a89, 0x10c00a98,
+ 0x11000ac1, 0x11400a4b, 0x11800ab4, 0x11c00a6a, 0x12000a3b, 0x12400a79, 0x128009b3, 0x13000a97,
+ 0x13400a88, 0x13800a2b, 0x13c00a5a, 0x140009b2, 0x14800aa5, 0x14c00a1b, 0x150009b1, 0x15800ab0,
+ 0x15c00a69, 0x16000a96, 0x16400a4a, 0x16800aa4, 0x16c00a78, 0x17000a87, 0x17400a3a, 0x178009a3,
+ 0x18000959, 0x18800995, 0x1900092a, 0x198009a2, 0x1a00091a, 0x1a8009a1, 0x1b000a0a, 0x1b400aa0,
+ 0x1b800968, 0x1c000986, 0x1c800949, 0x1d000994, 0x1d800939, 0x1e000993, 0x1e800a77, 0x1ec00a09,
+ 0x1f000958, 0x1f800985, 0x20000929, 0x20800967, 0x21000976, 0x21800992, 0x22000891, 0x23000919,
+ 0x23800990, 0x24000948, 0x24800984, 0x25000957, 0x25800975, 0x26000938, 0x26800983, 0x27000966,
+ 0x27800947, 0x28000828, 0x29000882, 0x2a000818, 0x2b000881, 0x2c000974, 0x2c800908, 0x2d000980,
+ 0x2d800956, 0x2e000965, 0x2e800937, 0x2f000973, 0x2f800946, 0x30000827, 0x31000872, 0x32000864,
+ 0x33000817, 0x34000855, 0x35000871, 0x36000907, 0x36800970, 0x37000836, 0x38000863, 0x39000845,
+ 0x3a000854, 0x3b000826, 0x3c000862, 0x3d000816, 0x3e000906, 0x3e800960, 0x3f000835, 0x40000761,
+ 0x42000853, 0x43000844, 0x44000725, 0x46000752, 0x48000715, 0x4a000751, 0x4c000805, 0x4d000850,
+ 0x4e000734, 0x50000743, 0x52000724, 0x54000742, 0x56000733, 0x58000641, 0x5c000714, 0x5e000704,
+ 0x60000623, 0x64000632, 0x68000740, 0x6a000703, 0x6c000613, 0x70000631, 0x74000630, 0x78000522,
+ 0x80000512, 0x88000521, 0x90000502, 0x98000520, 0xa0000311, 0xc0000401, 0xd0000410, 0xe0000300};
+unsigned int h16[256]={ 0xbef, 0x200bfe, 0x400bdf, 0x600bfd, 0x800bcf, 0xa00bfc, 0xc00bbf, 0xe00bfb,
+ 0x1000aaf, 0x1400bfa, 0x1600b9f, 0x1800bf9, 0x1a00bf8, 0x1c00a8f, 0x2000a7f, 0x2400af7,
+ 0x2800a6f, 0x2c00af6, 0x30008ff, 0x4000a5f, 0x4400af5, 0x480094f, 0x50009f4, 0x58009f3,
+ 0x60009f0, 0x6800a3f, 0x6c010ce, 0x6c111ec, 0x6c191dd, 0x6c20fde, 0x6c40fe9, 0x6c610ea,
+ 0x6c710d9, 0x6c80eee, 0x6cc0fed, 0x6ce0feb, 0x6d00ebe, 0x6d40ecd, 0x6d80fdc, 0x6da0fdb,
+ 0x6dc0eae, 0x6e00ecc, 0x6e40fad, 0x6e60fda, 0x6e80f7e, 0x6ea0fac, 0x6ec0eca, 0x6f00fc9,
+ 0x6f20f7d, 0x6f40e5e, 0x6f80dbd, 0x70008f2, 0x800092f, 0x880090f, 0x900081f, 0xa0008f1,
+ 0xb000d9e, 0xb080ebc, 0xb0c0ecb, 0xb100e8e, 0xb140ee8, 0xb180e9d, 0xb1c0ee7, 0xb200ebb,
+ 0xb240e8d, 0xb280ed8, 0xb2c0e6e, 0xb300de6, 0xb380d9c, 0xb400eab, 0xb440eba, 0xb480ee5,
+ 0xb4c0ed7, 0xb500d4e, 0xb580ee4, 0xb5c0e8c, 0xb600dc8, 0xb680d3e, 0xb700d6d, 0xb780ed6,
+ 0xb7c0e9b, 0xb800eb9, 0xb840eaa, 0xb880de1, 0xb900dd4, 0xb980eb8, 0xb9c0ea9, 0xba00d7b,
+ 0xba80eb7, 0xbac0ed0, 0xbb00ce3, 0xbc00d0e, 0xbc80de0, 0xbd00d5d, 0xbd80dd5, 0xbe00d7c,
+ 0xbe80dc7, 0xbf00d4d, 0xbf80d8b, 0xc000d9a, 0xc080d6c, 0xc100dc6, 0xc180d3d, 0xc200d5c,
+ 0xc280dc5, 0xc300c0d, 0xc400d8a, 0xc480da8, 0xc500d99, 0xc580d4c, 0xc600db6, 0xc680d7a,
+ 0xc700c3c, 0xc800d5b, 0xc880d89, 0xc900c1c, 0xca00cc0, 0xcb00d98, 0xcb80d79, 0xcc00be2,
+ 0xce00c2e, 0xcf00c1e, 0xd000cd3, 0xd100c2d, 0xd200cd2, 0xd300cd1, 0xd400c3b, 0xd500d97,
+ 0xd580d88, 0xd600b1d, 0xd800cc4, 0xd900c6b, 0xda00cc3, 0xdb00ca7, 0xdc00b2c, 0xde00cc2,
+ 0xdf00cb5, 0xe000cc1, 0xe100c0c, 0xe200c4b, 0xe300cb4, 0xe400c6a, 0xe500ca6, 0xe600bb3,
+ 0xe800c5a, 0xe900ca5, 0xea00b2b, 0xec00bb2, 0xee00b1b, 0xf000bb1, 0xf200c0b, 0xf300cb0,
+ 0xf400c69, 0xf500c96, 0xf600c4a, 0xf700ca4, 0xf800c78, 0xf900c87, 0xfa00ba3, 0xfc00c3a,
+ 0xfd00c59, 0xfe00b2a, 0x10000c95, 0x10100c68, 0x10200ba1, 0x10400c86, 0x10500c77, 0x10600b94,
+ 0x10800c49, 0x10900c57, 0x10a00b67, 0x10c00aa2, 0x11000a1a, 0x11400b0a, 0x11600ba0, 0x11800b39,
+ 0x11a00b93, 0x11c00b58, 0x11e00b85, 0x12000a29, 0x12400a92, 0x12800b76, 0x12a00b09, 0x12c00a19,
+ 0x13000a91, 0x13400b90, 0x13600b48, 0x13800b84, 0x13a00b75, 0x13c00b38, 0x13e00b83, 0x14000b66,
+ 0x14200b28, 0x14400a82, 0x14800b47, 0x14a00b74, 0x14c00a18, 0x15000a81, 0x15400a80, 0x15800b08,
+ 0x15a00b56, 0x15c00a37, 0x16000a73, 0x16400b65, 0x16600b46, 0x16800a27, 0x16c00a72, 0x17000b64,
+ 0x17200b55, 0x17400a07, 0x17800917, 0x18000971, 0x18800a70, 0x18c00a36, 0x19000a63, 0x19400a45,
+ 0x19800a54, 0x19c00a26, 0x1a000962, 0x1a800916, 0x1b000961, 0x1b800a06, 0x1bc00a60, 0x1c000953,
+ 0x1c800a35, 0x1cc00a44, 0x1d000925, 0x1d800952, 0x1e000851, 0x1f000915, 0x1f800905, 0x20000934,
+ 0x20800943, 0x21000950, 0x21800924, 0x22000942, 0x22800933, 0x23000814, 0x24000841, 0x25000904,
+ 0x25800940, 0x26000823, 0x27000832, 0x28000713, 0x2a000731, 0x2c000803, 0x2d000830, 0x2e000722,
+ 0x30000612, 0x34000621, 0x38000602, 0x3c000620, 0x40000411, 0x50000401, 0x60000310, 0x80000100};
+unsigned int h24[256]={ 0x8ef, 0x10008fe, 0x20008df, 0x30008fd, 0x40008cf, 0x50008fc, 0x60008bf, 0x70008fb,
+ 0x80007fa, 0xa0008af, 0xb00089f, 0xc0007f9, 0xe0007f8, 0x1000088f, 0x1100087f, 0x120007f7,
+ 0x1400076f, 0x160007f6, 0x1800075f, 0x1a0007f5, 0x1c00074f, 0x1e0007f4, 0x2000073f, 0x220007f3,
+ 0x2400072f, 0x260007f2, 0x280007f1, 0x2a00081f, 0x2b0008f0, 0x2c00090f, 0x2c800bee, 0x2ca00bde,
+ 0x2cc00bed, 0x2ce00bce, 0x2d000bec, 0x2d200bdd, 0x2d400bbe, 0x2d600beb, 0x2d800bcd, 0x2da00bdc,
+ 0x2dc00bae, 0x2de00bea, 0x2e000bbd, 0x2e200bdb, 0x2e400bcc, 0x2e600b9e, 0x2e800be9, 0x2ea00bad,
+ 0x2ec00bda, 0x2ee00bbc, 0x2f000bcb, 0x2f200b8e, 0x2f400be8, 0x2f600b9d, 0x2f800bd9, 0x2fa00b7e,
+ 0x2fc00be7, 0x2fe00bac, 0x300004ff, 0x40000bca, 0x40200bbb, 0x40400b8d, 0x40600bd8, 0x40800c0e,
+ 0x40900ce0, 0x40a00b0d, 0x40c00ae6, 0x41000b6e, 0x41200b9c, 0x41400ac9, 0x41800a5e, 0x41c00aba,
+ 0x42000ae5, 0x42400bab, 0x42600b7d, 0x42800ad7, 0x42c00ae4, 0x43000a8c, 0x43400ac8, 0x43800b4e,
+ 0x43a00b2e, 0x43c00a3e, 0x44000a6d, 0x44400ad6, 0x44800ae3, 0x44c00a9b, 0x45000ab9, 0x45400aaa,
+ 0x45800ae2, 0x45c00a1e, 0x46000ae1, 0x46400a5d, 0x46800ad5, 0x46c00a7c, 0x47000ac7, 0x47400a4d,
+ 0x47800a8b, 0x47c00ab8, 0x48000ad4, 0x48400a9a, 0x48800aa9, 0x48c00a6c, 0x49000ac6, 0x49400a3d,
+ 0x49800ad3, 0x49c00a2d, 0x4a000ad2, 0x4a400a1d, 0x4a800a7b, 0x4ac00ab7, 0x4b000ad1, 0x4b400a5c,
+ 0x4b800ac5, 0x4bc00a8a, 0x4c000aa8, 0x4c400a99, 0x4c800a4c, 0x4cc00ac4, 0x4d000a6b, 0x4d400ab6,
+ 0x4d800bd0, 0x4da00b0c, 0x4dc00a3c, 0x4e000ac3, 0x4e400a7a, 0x4e800aa7, 0x4ec00a2c, 0x4f000ac2,
+ 0x4f400a5b, 0x4f800ab5, 0x4fc00a1c, 0x50000a89, 0x50400a98, 0x50800ac1, 0x50c00a4b, 0x51000bc0,
+ 0x51200b0b, 0x51400a3b, 0x51800bb0, 0x51a00b0a, 0x51c00a1a, 0x520009b4, 0x52800a6a, 0x52c00aa6,
+ 0x53000a79, 0x53400a97, 0x53800ba0, 0x53a00b09, 0x53c00a90, 0x540009b3, 0x54800988, 0x55000a2b,
+ 0x55400a5a, 0x558009b2, 0x56000aa5, 0x56400a1b, 0x56800ab1, 0x56c00a69, 0x57000996, 0x578009a4,
+ 0x58000a4a, 0x58400a78, 0x58800987, 0x5900093a, 0x598009a3, 0x5a000959, 0x5a800995, 0x5b00092a,
+ 0x5b8009a2, 0x5c0009a1, 0x5c800968, 0x5d000986, 0x5d800977, 0x5e000949, 0x5e800994, 0x5f000939,
+ 0x5f800993, 0x60000958, 0x60800985, 0x61000929, 0x61800967, 0x62000976, 0x62800992, 0x63000919,
+ 0x63800991, 0x64000948, 0x64800984, 0x65000957, 0x65800975, 0x66000938, 0x66800983, 0x67000966,
+ 0x67800928, 0x68000982, 0x68800918, 0x69000947, 0x69800974, 0x6a000981, 0x6a800a08, 0x6ac00a80,
+ 0x6b000956, 0x6b800965, 0x6c000917, 0x6c800a07, 0x6cc00a70, 0x6d000873, 0x6e000937, 0x6e800927,
+ 0x6f000872, 0x70000846, 0x71000864, 0x72000855, 0x73000871, 0x74000836, 0x75000863, 0x76000845,
+ 0x77000854, 0x78000826, 0x79000862, 0x7a000816, 0x7b000861, 0x7c000906, 0x7c800960, 0x7d000835,
+ 0x7e000853, 0x7f000844, 0x80000825, 0x81000852, 0x82000815, 0x83000905, 0x83800950, 0x84000751,
+ 0x86000834, 0x87000843, 0x88000724, 0x8a000742, 0x8c000733, 0x8e000714, 0x90000741, 0x92000804,
+ 0x93000840, 0x94000723, 0x96000732, 0x98000613, 0x9c000631, 0xa0000703, 0xa2000730, 0xa4000622,
+ 0xa8000512, 0xb0000521, 0xb8000602, 0xbc000620, 0xc0000411, 0xd0000401, 0xe0000410, 0xf0000400};
+unsigned int hA[16]={ 0x6b0, 0x40006f0, 0x80006d0, 0xc0006e0, 0x10000670, 0x14000650, 0x18000590, 0x20000560,
+ 0x28000530, 0x300005a0, 0x380005c0, 0x40000420, 0x50000410, 0x60000440, 0x70000480, 0x80000100};
+unsigned int hB[16]={ 0x4f0, 0x100004e0, 0x200004d0, 0x300004c0, 0x400004b0, 0x500004a0, 0x60000490, 0x70000480,
+ 0x80000470, 0x90000460, 0xa0000450, 0xb0000440, 0xc0000430, 0xd0000420, 0xe0000410, 0xf0000400};
+
+/* now the cues, remember to change these tables if you change N_CUE
+*/
+unsigned char h_cue[34][N_CUE]={
+{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3},
+{0,3,5,5,6,6,7,7,8,8,8,8,8,8,8,8},
+{0,3,5,5,6,6,6,6,7,7,7,7,8,8,8,8},
+{0,8,12,12,13,13,14,14,15,15,15,15,15,15,15,15},
+{0,8,12,12,13,13,14,14,15,15,15,15,15,15,15,15},
+{0,5,7,9,10,11,12,12,13,13,13,13,14,14,15,15},
+{0,20,29,32,33,33,34,34,35,35,35,35,35,35,35,35},
+{0,23,30,31,32,32,32,32,33,33,34,34,35,35,35,35},
+{0,15,21,24,27,29,30,31,32,32,33,33,34,34,35,35},
+{0,42,56,60,61,61,62,62,63,63,63,63,63,63,63,63},
+{0,30,45,53,57,58,60,60,61,61,62,62,63,63,63,63},
+{0,23,37,46,50,54,56,57,58,60,61,61,62,62,63,63},
+{0,203,238,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,132,178,205,223,233,240,245,248,250,252,252,253,254,255,255},
+{0,132,178,205,223,233,240,245,248,250,252,252,253,254,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,162,231,248,252,253,254,254,255,255,255,255,255,255,255,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,13,22,58,59,131,177,209,226,238,245,249,252,253,254,255},
+{0,4,7,9,11,12,13,14,15,15,15,15,15,15,15,15},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
+};
+
+/* h4->h5, h14->h15 as suggested by Fraunhofer
+ * tomislav Aug 21 1997
+ */
+unsigned int *tables[34]={h0,h1,h2,h3,h5,h5,h6,h7,h8,h9,h10,h11,h12,h13,h15,h15,
+ h16,h16,h16,h16,h16,h16,h16,h16,h24,h24,h24,h24,h24,h24,h24,h24,hA,hB};
+#endif /* HUFFMAN */
diff --git a/setedit/mp3/libamp/layer2.c b/setedit/mp3/libamp/layer2.c
new file mode 100644
index 0000000..97c3376
--- /dev/null
+++ b/setedit/mp3/libamp/layer2.c
@@ -0,0 +1,320 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* layer2.c MPEG audio layer2 support
+ *
+ * Created by: Tomislav Uzelac Mar 1996
+ * merged with amp, May 19 1997
+ */
+#include "amp.h"
+#include "audio.h"
+#include "getbits.h"
+#include "transform.h"
+
+#define LAYER2
+#include "layer2.h"
+
+int layer2_frame(struct AUDIO_HEADER *header,int cnt)
+{
+int i,s,sb,ch,gr,bitrate,bound;
+char (*nbal)[],(*bit_alloc_index)[][16];
+unsigned char allocation[2][32];
+unsigned char scfsi[2][32];
+float scalefactor[2][32][3];
+float subband_sample[2][32][36];
+int sblimit,nlevels,grouping;
+
+float c,d;
+int no_of_bits,mpi;
+unsigned short sb_sample_buf[3];
+
+int hsize,fs,mean_frame_size;
+
+ hsize=4;
+ if (header->protection_bit==0) hsize+=2;
+
+ bitrate=t_bitrate[header->ID][3-header->layer][header->bitrate_index];
+ fs=t_sampling_frequency[header->ID][header->sampling_frequency];
+ if (header->ID) mean_frame_size=144000*bitrate/fs;
+ else mean_frame_size=72000*bitrate/fs;
+
+ /* layers 1 and 2 do not have a 'bit reservoir'
+ */
+ append=data=0;
+
+ fillbfr(mean_frame_size + header->padding_bit - hsize);
+
+ switch (header->mode)
+ {
+ case 0 :
+ case 2 : nch=2; bound=32; bitrate=bitrate/2;
+ break;
+ case 3 : nch=1; bound=32;
+ break;
+ case 1 : nch=2; bitrate=bitrate/2; bound=(header->mode_extension+1)*4;
+ }
+
+ if (header->ID==1) switch (header->sampling_frequency) {
+ case 0 : switch (bitrate) /* 0 = 44.1 kHz */
+ {
+ case 56 :
+ case 64 :
+ case 80 : bit_alloc_index=&t_alloc0;
+ nbal=&t_nbal0;
+ sblimit=27;
+ break;
+ case 96 :
+ case 112 :
+ case 128 :
+ case 160 :
+ case 192 : bit_alloc_index=&t_alloc1;
+ nbal=&t_nbal1;
+ sblimit=30;
+ break;
+ case 32 :
+ case 48 : bit_alloc_index=&t_alloc2;
+ nbal=&t_nbal2;
+ sblimit=8;
+ break;
+ default : printf(" bit alloc info no gud ");
+ }
+ break;
+ case 1 : switch (bitrate) /* 1 = 48 kHz */
+ {
+ case 56 :
+ case 64 :
+ case 80 :
+ case 96 :
+ case 112 :
+ case 128 :
+ case 160 :
+ case 192 : bit_alloc_index=&t_alloc0;
+ nbal=&t_nbal0;
+ sblimit=27;
+ break;
+ case 32 :
+ case 48 : bit_alloc_index=&t_alloc2;
+ nbal=&t_nbal2;
+ sblimit=8;
+ break;
+ default : printf(" bit alloc info no gud ");
+ }
+ break;
+ case 2 : switch (bitrate) /* 2 = 32 kHz */
+ {
+ case 56 :
+ case 64 :
+ case 80 : bit_alloc_index=&t_alloc0;
+ nbal=&t_nbal0;
+ sblimit=27;
+ break;
+ case 96 :
+ case 112 :
+ case 128 :
+ case 160 :
+ case 192 : bit_alloc_index=&t_alloc1;
+ nbal=&t_nbal1;
+ sblimit=30;
+ break;
+ case 32 :
+ case 48 : bit_alloc_index=&t_alloc3;
+ nbal=&t_nbal3;
+ sblimit=12;
+ break;
+ default : printf("bit alloc info not ok\n");
+ }
+ break;
+ default : printf("sampling freq. not ok/n");
+ } else {
+ bit_alloc_index=&t_allocMPG2;
+ nbal=&t_nbalMPG2;
+ sblimit=30;
+ }
+
+/*
+ * bit allocation per subband per channel decoding *****************************
+ */
+
+ if (bound==32) bound=sblimit; /* bound=32 means there is no intensity stereo */
+
+ for (sb=0;sb<bound;sb++)
+ for (ch=0;ch<nch;ch++)
+ allocation[ch][sb]=getbits((*nbal)[sb]);
+
+ for (sb=bound;sb<sblimit;sb++)
+ allocation[1][sb] = allocation[0][sb] = getbits((*nbal)[sb]);
+
+
+/*
+ * scfsi ***********************************************************************
+ */
+
+ for (sb=0;sb<sblimit;sb++)
+ for (ch=0;ch<nch;ch++)
+ if (allocation[ch][sb]!=0) scfsi[ch][sb]=getbits(2);
+ else scfsi[ch][sb]=0;
+
+/*
+ * scalefactors ****************************************************************
+ */
+
+ for (sb=0;sb<sblimit;sb++)
+ for (ch=0;ch<nch;ch++)
+ if (allocation[ch][sb]!=0) {
+ scalefactor[ch][sb][0]=t_scalefactor[getbits(6)];
+ switch (scfsi[ch][sb])
+ {
+ case 0: scalefactor[ch][sb][1]=t_scalefactor[getbits(6)];
+ scalefactor[ch][sb][2]=t_scalefactor[getbits(6)];
+ break;
+ case 1: scalefactor[ch][sb][2]=t_scalefactor[getbits(6)];
+ scalefactor[ch][sb][1]=scalefactor[ch][sb][0];
+ break;
+ case 2: scalefactor[ch][sb][1]=scalefactor[ch][sb][0];
+ scalefactor[ch][sb][2]=scalefactor[ch][sb][0];
+ break;
+ case 3: scalefactor[ch][sb][2]=t_scalefactor[getbits(6)];
+ scalefactor[ch][sb][1]=scalefactor[ch][sb][2];
+ }
+ }
+ else scalefactor[ch][sb][0]=scalefactor[ch][sb][1]=\
+ scalefactor[ch][sb][2]=0.0;
+
+
+/*
+ * samples *********************************************************************
+ */
+
+ for (gr=0;gr<12;gr++) {
+ /*
+ * normal ********************************
+ */
+
+ for (sb=0;sb<bound;sb++)
+ for (ch=0;ch<nch;ch++)
+ if (allocation[ch][sb]!=0) {
+ mpi=(*bit_alloc_index)[sb][allocation[ch][sb]];
+ no_of_bits=t_bpc[mpi];
+ c=t_c[mpi];
+ d=t_d[mpi];
+ grouping=t_grouping[mpi];
+ nlevels=t_nlevels[mpi];
+
+ if (grouping) {
+ int samplecode=getbits(no_of_bits);
+ convert_samplecode(samplecode,grouping,sb_sample_buf);
+
+ for (s=0;s<3;s++)
+ subband_sample[ch][sb][3*gr+s]=requantize_sample (sb_sample_buf[s],nlevels,c,d,scalefactor[ch][sb][gr/4]);
+ } else {
+ for (s=0;s<3;s++) sb_sample_buf[s]=getbits(no_of_bits);
+
+ for (s=0;s<3;s++) {
+ /*subband_sample[ch][sb][3*gr+s]=requantize_sample (sb_sample_buf[s],nlevels,c,d,scalefactor[ch][sb][gr/4]);*/
+ subband_sample[ch][sb][3*gr+s]=(t_dd[mpi]+sb_sample_buf[s]*t_nli[mpi])*c*scalefactor[ch][sb][gr>>2];
+ }
+ }
+ } else
+ for (s=0;s<3;s++) subband_sample[ch][sb][3*gr+s]=0;
+
+
+ /*
+ * joint stereo ********************************************
+ */
+
+ for (sb=bound;sb<sblimit;sb++)
+ if (allocation[0][sb]!=0) {
+ /*ispravka!
+ */
+ mpi=(*bit_alloc_index)[sb][allocation[0][sb]];
+ no_of_bits=t_bpc[mpi];
+ c=t_c[mpi];
+ d=t_d[mpi];
+ grouping=t_grouping[mpi];
+ nlevels=t_nlevels[mpi];
+
+ if (grouping) {
+ int samplecode=getbits(no_of_bits);
+ convert_samplecode(samplecode,grouping,sb_sample_buf);
+
+ for (s=0;s<3;s++) {
+ subband_sample[0][sb][3*gr+s]=requantize_sample (sb_sample_buf[s],nlevels,c,d,scalefactor[0][sb][gr/4]);
+ subband_sample[1][sb][3*gr+s]=subband_sample[0][sb][3*gr+s];
+ }
+ } else {
+ for (s=0;s<3;s++) sb_sample_buf[s]=getbits(no_of_bits);
+
+ for (s=0;s<3;s++) {
+ subband_sample[0][sb][3*gr+s]=subband_sample[1][sb][3*gr+s]=\
+ (t_dd[mpi]+sb_sample_buf[s]*t_nli[mpi])*c*scalefactor[0][sb][gr>>2];
+ }
+ }
+
+ } else for (s=0;s<3;s++) {
+ subband_sample[0][sb][3*gr+s]=0;
+ subband_sample[1][sb][3*gr+s]=0;
+ }
+
+ /*
+ * the rest *******************************************
+ */
+ for (sb=sblimit;sb<32;sb++)
+ for (ch=0;ch<nch;ch++)
+
+ for (s=0;s<3;s++) subband_sample[ch][sb][3*gr+s]=0;
+ }
+
+ /*
+ * this is, in fact, horrible, but I had to adjust it to amp/mp3. The hack to make downmixing
+ * work is as ugly as possible.
+ */
+
+ if (A_DOWNMIX && header->mode!=3) {
+ for (ch=0;ch<nch;ch++)
+ for (sb=0;sb<32;sb++)
+ for (i=0;i<36;i++)
+ subband_sample[0][sb][i]=(subband_sample[0][sb][i]+subband_sample[1][sb][i])*0.5f;
+ nch=1;
+ }
+
+ for (ch=0;ch<nch;ch++) {
+ for (sb=0;sb<32;sb++)
+ for (i=0;i<18;i++) res[sb][i]=subband_sample[ch][sb][i];
+ for (i=0;i<18;i++)
+ poly(ch,i);
+ }
+ printout();
+ for (ch=0;ch<nch;ch++) {
+ for (sb=0;sb<32;sb++)
+ for (i=0;i<18;i++) res[sb][i]=subband_sample[ch][sb][i+18];
+ for (i=0;i<18;i++)
+ poly(ch,i);
+ }
+ printout();
+
+ if (A_DOWNMIX && header->mode!=3) nch=2;
+
+ return 0;
+}
+/****************************************************************************/
+/****************************************************************************/
+
+void convert_samplecode(unsigned int samplecode,unsigned int nlevels,unsigned short* sb_sample_buf)
+{
+int i;
+
+ for (i=0;i<3;i++) {
+ *sb_sample_buf=samplecode%nlevels;
+ samplecode=samplecode/nlevels;
+ sb_sample_buf++;
+ }
+}
+
+float requantize_sample(unsigned short s4,unsigned short nlevels,float c,float d,float factor)
+{
+register float s,s2,s3;
+s3=-1.0+s4*2.0/(nlevels+1);
+s2=c*(s3+d);
+s=factor*s2;
+return s;
+}
diff --git a/setedit/mp3/libamp/layer2.h b/setedit/mp3/libamp/layer2.h
new file mode 100644
index 0000000..25ba521
--- /dev/null
+++ b/setedit/mp3/libamp/layer2.h
@@ -0,0 +1,190 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+/* layer2.h
+ * Tomislav Uzelac - cca. Feb 1996
+ */
+
+
+extern int layer2_frame(struct AUDIO_HEADER *header,int cnt);
+
+#ifdef LAYER2
+
+int layer2_frame(struct AUDIO_HEADER *header,int cnt);
+float requantize_sample(unsigned short s4,unsigned short nlevels,float c,float d,float factor);
+void convert_samplecode(unsigned int samplecode,unsigned int nlevels,unsigned short* sb_sample_buf);
+
+char t_nbal0[27]={4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2};
+char t_nbal1[30]={4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2};
+char t_nbal2[8] ={4,4,3,3,3,3,3,3};
+char t_nbal3[12]={4,4,3,3,3,3,3,3,3,3,3,3};
+char t_nbalMPG2[30]={4,4,4,4,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
+
+char t_alloc0[27][16] = { /* table B.2a ISO/IEC 11172-3 */
+{0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17},
+{0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17},
+{0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17}};
+
+char t_alloc1[30][16] = { /* table B.2b ISO/IEC 11172-3 */
+{0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17},
+{0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17},
+{0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,3,4,5,6,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17},
+{0,1,2,17}};
+
+char t_alloc2[8][16] = { /* table B.2c ISO/IEC 11172-3 */
+{0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16},
+{0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127}};
+
+char t_alloc3[12][16] = { /* table B.2d ISO/IEC 11172-3 */
+{0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16},
+{0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127},
+{0,1,2,4,5,6,7,127}};
+
+char t_allocMPG2[30][16] = { /* table B.1. ISO/IEC 13818-3 */
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4,5,6,7,8},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4},
+{0,1,2,4}};
+
+double t_scalefactor[64] = {
+2.00000000000000, 1.58740105196820, 1.25992104989487,
+1.00000000000000, 0.79370052598410, 0.62996052494744, 0.50000000000000,
+0.39685026299205, 0.31498026247372, 0.25000000000000, 0.19842513149602,
+0.15749013123686, 0.12500000000000, 0.09921256574801, 0.07874506561843,
+0.06250000000000, 0.04960628287401, 0.03937253280921, 0.03125000000000,
+0.02480314143700, 0.01968626640461, 0.01562500000000, 0.01240157071850,
+0.00984313320230, 0.00781250000000, 0.00620078535925, 0.00492156660115,
+0.00390625000000, 0.00310039267963, 0.00246078330058, 0.00195312500000,
+0.00155019633981, 0.00123039165029, 0.00097656250000, 0.00077509816991,
+0.00061519582514, 0.00048828125000, 0.00038754908495, 0.00030759791257,
+0.00024414062500, 0.00019377454248, 0.00015379895629, 0.00012207031250,
+0.00009688727124, 0.00007689947814, 0.00006103515625, 0.00004844363562,
+0.00003844973907, 0.00003051757813, 0.00002422181781, 0.00001922486954,
+0.00001525878906, 0.00001211090890, 0.00000961243477, 0.00000762939453,
+0.00000605545445, 0.00000480621738, 0.00000381469727, 0.00000302772723,
+0.00000240310869, 0.00000190734863, 0.00000151386361, 0.00000120155435,
+1E-20};
+
+double t_c[18] = { 0,
+ 1.33333333333, 1.60000000000, 1.14285714286,
+ 1.77777777777, 1.06666666666, 1.03225806452,
+ 1.01587301587, 1.00787401575, 1.00392156863,
+ 1.00195694716, 1.00097751711, 1.00048851979,
+ 1.00024420024, 1.00012208522, 1.00006103888,
+ 1.00003051851, 1.00001525902 };
+
+double t_d[18] = {0,
+ 0.500000000, 0.500000000, 0.250000000, 0.500000000,
+ 0.125000000, 0.062500000, 0.031250000, 0.015625000,
+ 0.007812500, 0.003906250, 0.001953125, 0.0009765625,
+ 0.00048828125,0.00024414063,0.00012207031,
+ 0.00006103516,0.00003051758 };
+
+float t_dd[18]={ -1, -0.5, -0.5, -0.75, -0.5, -0.875, -0.9375, -0.96875, -0.984375,
+-0.992188, -0.996094, -0.998047, -0.999023, -0.999512, -0.999756, -0.999878, -0.999939,
+-0.999969};
+
+char t_grouping[18]={0,3,5,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+/*
+int t_nlevels[18] = {0,3,5,7,9,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
+*/
+int t_nlevels[18] = {0,3,7,7,15,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
+
+
+float t_nli[18]={ 0, 0.5, 0.25, 0.25, 0.125, 0.125, 0.0625, 0.03125, 0.015625, 0.0078125, 0.00390625,
+0.00195313, 0.000976563, 0.000488281, 0.000244141, 0.00012207, 6.10352e-05, 3.05176e-05};
+
+int t_bpc[18] = {0,5,7,3,10,4,5,6,7,8,9,10,11,12,13,14,15,16};
+
+#endif /* LAYER2 */
diff --git a/setedit/mp3/libamp/layer3.c b/setedit/mp3/libamp/layer3.c
new file mode 100644
index 0000000..a7cb92f
--- /dev/null
+++ b/setedit/mp3/libamp/layer3.c
@@ -0,0 +1,193 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* layer3.c layer3 audio decoding
+ *
+ * Created by: tomislav uzelac Mar 1 97
+ * Last modified by:
+ */
+#include "amp.h"
+#include "audio.h"
+#include "dump.h"
+#include "getbits.h"
+#include "getdata.h"
+#include "huffman.h"
+#include "misc2.h"
+#include "rtbuf.h"
+#include "transform.h"
+
+#define LAYER3
+#include "layer3.h"
+
+/* this function decodes one layer3 audio frame, except for the header decoding
+ * which is done in main() [audio.c]. returns 0 if everything is ok.
+ */
+int layer3_frame(struct AUDIO_HEADER *header,int cnt)
+{
+static struct SIDE_INFO info;
+
+int gr,ch,sb,i;
+int mean_frame_size,bitrate,fs,hsize,ssize;
+
+/* we need these later, hsize is the size of header+side_info
+*/
+ if (header->ID)
+ if (header->mode==3) {
+ nch=1;
+ hsize=21;
+ } else {
+ nch=2;
+ hsize=36;
+ }
+ else
+ if (header->mode==3) {
+ nch=1;
+ hsize=13;
+ } else {
+ nch=2;
+ hsize=21;
+ }
+
+/* crc increases hsize by 2
+*/
+ if (header->protection_bit==0) hsize+=2;
+
+
+/* read layer3 specific side_info
+*/
+ getinfo(header,&info);
+
+
+/* MPEG2 only has one granule
+*/
+ bitrate=t_bitrate[header->ID][3-header->layer][header->bitrate_index];
+ fs=t_sampling_frequency[header->ID][header->sampling_frequency];
+ if (header->ID) mean_frame_size=144000*bitrate/fs;
+ else mean_frame_size=72000*bitrate/fs;
+
+
+/* check if mdb is too big for the first few frames. this means that
+ * a part of the stream could be missing. We must still fill the buffer
+ *
+ * don't forget to (re)initialise bclean_bytes to 0, and f_bdirty to FALSE!!!
+ */
+ if (f_bdirty)
+ if (info.main_data_begin > bclean_bytes) {
+ fillbfr(mean_frame_size + header->padding_bit - hsize);
+ bclean_bytes+=mean_frame_size + header->padding_bit - hsize;
+ /* warn(" frame %d discarded, incomplete main_data\n",cnt); */
+ return 0;
+ } else {
+ /* re-initialise */
+ f_bdirty=FALSE;
+ bclean_bytes=0;
+ }
+
+/* now update the data 'pointer' (counting in bits) according to
+ * the main_data_begin information
+ */
+ data = 8 * ((append - info.main_data_begin) & (BUFFER_SIZE-1));
+
+
+/* read into the buffer all bytes up to the start of next header
+*/
+ fillbfr(mean_frame_size + header->padding_bit - hsize);
+
+
+/* these two should go away
+*/
+ t_l=&t_b8_l[header->ID][header->sampling_frequency][0];
+ t_s=&t_b8_s[header->ID][header->sampling_frequency][0];
+
+/* debug/dump stuff
+*/
+ if (A_DUMP_BINARY) dump((int *)info.part2_3_length);
+
+/* decode the scalefactors and huffman data
+ * this part needs to be enhanced for error robustness
+ */
+ for (gr=0;gr < ((header->ID) ? 2 : 1);gr++) {
+ for (ch=0;ch<nch;ch++) {
+ ssize=decode_scalefactors(&info,header,gr,ch);
+ decode_huffman_data(&info,gr,ch,ssize);
+ }
+
+ /* requantization, stereo processing, reordering(shortbl)
+ */
+
+ if (A_DOWNMIX && nch==2) requantize_downmix(gr,&info,header);
+ else
+ if (header->mode!=1 || (header->mode==1 && header->mode_extension==0))
+ for (ch=0;ch<nch;ch++) requantize_mono(gr,ch,&info,header);
+ else requantize_ms(gr,&info,header);
+
+ /* just which window?
+ */
+
+ /* this is a very temporary, very ugly hack.
+ */
+ if (A_DOWNMIX) nch=1;
+
+ for (ch=0; ch < (A_DOWNMIX ? 1:nch) ;ch++) {
+ int win_type; /* same as in the standard, long=0, start=1 ,.... */
+ int window_switching_flag = info.window_switching_flag[gr][ch];
+ int block_type = info.block_type[gr][ch];
+ int mixed_block_flag = info.mixed_block_flag[gr][ch];
+
+ /* antialiasing butterflies
+ */
+ if (!(window_switching_flag &&
+ block_type==2))
+ alias_reduction(ch);
+
+ if (window_switching_flag &&
+ block_type==2 &&
+ mixed_block_flag)
+ win_type=0;
+ else
+ if (!window_switching_flag) win_type=0;
+ else win_type=block_type;
+
+ /* imdct ...
+ */
+ for (sb=0;sb<2;sb++)
+ imdct(win_type,sb,ch);
+
+ if (window_switching_flag &&
+ block_type==2 &&
+ mixed_block_flag)
+ win_type=2;
+
+ /* no_of_imdcts tells us how many subbands from the top are all zero
+ * it is set by the requantize functions in misc2.c
+ */
+ for (sb=2;sb<no_of_imdcts[ch];sb++)
+ imdct(win_type,sb,ch);
+
+ for (;sb<32;sb++)
+ for (i=0;i<18;i++) {
+ res[sb][i]=s[ch][sb][i];
+ s[ch][sb][i]=0.0f;
+ }
+
+ /* polyphase filterbank
+ */
+ /* if (nch == 2) this was a bug, tomislav */
+ for (i=0;i<18;i++)
+ poly(ch,i);
+ }
+
+ printout();
+
+ /* this is part2 of a particularily ugly hack. this should vanish as soon as nch isn't
+ a global variable anymore
+ */
+ if (A_DOWNMIX && header->mode!=3) nch=2;
+
+ } /* for (gr... */
+
+ /* return status: 0 for ok, errors will be added
+ */
+ return 0;
+}
+
diff --git a/setedit/mp3/libamp/layer3.h b/setedit/mp3/libamp/layer3.h
new file mode 100644
index 0000000..d8c08ed
--- /dev/null
+++ b/setedit/mp3/libamp/layer3.h
@@ -0,0 +1,16 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* layer3.h
+ *
+ * Created by: tomislav uzelac Mar 1 97
+ * Last modified by:
+ */
+
+extern int layer3_frame(struct AUDIO_HEADER *header,int cnt);
+
+#ifdef LAYER3
+
+int layer3_frame(struct AUDIO_HEADER *header,int cnt);
+
+#endif /* LAYER3 */
diff --git a/setedit/mp3/libamp/libamp.gpr b/setedit/mp3/libamp/libamp.gpr
new file mode 100644
index 0000000..811408a
--- /dev/null
+++ b/setedit/mp3/libamp/libamp.gpr
Binary files differ
diff --git a/setedit/mp3/libamp/libamp.h b/setedit/mp3/libamp/libamp.h
new file mode 100644
index 0000000..2ff233b
--- /dev/null
+++ b/setedit/mp3/libamp/libamp.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* libamp header */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int amp_bitrate,amp_samprat;
+extern int amp_mpg_ver,amp_layer,amp_stereo,amp_pollsize;
+extern int amp_playing,amp_loaded,amp_reverse_phase;
+extern int amp_dec_frame,amp_dec_time;
+extern int amp_frame,amp_time;
+
+extern unsigned short*amp_buf_left,*amp_buf_right;
+extern int amp_buf_len;
+
+extern unsigned short*amp_play_left,*amp_play_right;
+extern int amp_play_len;
+
+int install_amp(void);
+int load_amp(char*filename,int loop);
+int poll_amp(void);
+int run_amp(void);
+int replay_amp(void);
+int seek_amp_abs(int frame);
+int seek_amp_rel(int framecnt);
+int unload_amp(void);
+int stop_amp(void);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/setedit/mp3/libamp/libamp.imk b/setedit/mp3/libamp/libamp.imk
new file mode 100644
index 0000000..6d554be
--- /dev/null
+++ b/setedit/mp3/libamp/libamp.imk
@@ -0,0 +1,188 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+../../makes/djgpp/libamp$(ExLIB):: \
+ obj/audioalg$(ExOBJ) \
+ obj/audiolib$(ExOBJ) \
+ obj/dump$(ExOBJ) \
+ obj/formats$(ExOBJ) \
+ obj/getbits$(ExOBJ) \
+ obj/getdata$(ExOBJ) \
+ obj/guicontr$(ExOBJ) \
+ obj/huffman$(ExOBJ) \
+ obj/layer2$(ExOBJ) \
+ obj/layer3$(ExOBJ) \
+ obj/misc2$(ExOBJ) \
+ obj/position$(ExOBJ) \
+ obj/rtbuf$(ExOBJ) \
+ obj/transfor$(ExOBJ) \
+ obj/util$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/audioalg$(ExOBJ):: audioalg.c \
+ amp.h \
+ audio.h \
+ audioio.h \
+ config.h \
+ libamp.h \
+ proto.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/audiolib$(ExOBJ):: audiolib.c \
+ amp.h \
+ audio.h \
+ config.h \
+ controldata.h \
+ formats.h \
+ getbits.h \
+ guicontrol.h \
+ huffman.h \
+ layer2.h \
+ layer3.h \
+ libamp.h \
+ position.h \
+ proto.h \
+ rtbuf.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/dump$(ExOBJ):: dump.c \
+ audio.h \
+ dump.h \
+ getbits.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/formats$(ExOBJ):: formats.c \
+ audio.h \
+ formats.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/getbits$(ExOBJ):: getbits.c \
+ amp.h \
+ audio.h \
+ config.h \
+ formats.h \
+ getbits.h \
+ proto.h \
+ rtbuf.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/getdata$(ExOBJ):: getdata.c \
+ amp.h \
+ audio.h \
+ config.h \
+ getbits.h \
+ getdata.h \
+ huffman.h \
+ proto.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/guicontr$(ExOBJ):: guicontr.c \
+ amp.h \
+ audio.h \
+ config.h \
+ controldata.h \
+ formats.h \
+ getbits.h \
+ huffman.h \
+ layer2.h \
+ layer3.h \
+ position.h \
+ proto.h \
+ rtbuf.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/huffman$(ExOBJ):: huffman.c \
+ audio.h \
+ getbits.h \
+ huffman.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/layer2$(ExOBJ):: layer2.c \
+ amp.h \
+ audio.h \
+ config.h \
+ getbits.h \
+ layer2.h \
+ proto.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/layer3$(ExOBJ):: layer3.c \
+ amp.h \
+ audio.h \
+ config.h \
+ dump.h \
+ getbits.h \
+ getdata.h \
+ huffman.h \
+ layer3.h \
+ misc2.h \
+ proto.h \
+ rtbuf.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/misc2$(ExOBJ):: misc2.c \
+ amp.h \
+ audio.h \
+ config.h \
+ getdata.h \
+ huffman.h \
+ misc2.h \
+ proto.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/position$(ExOBJ):: position.c \
+ amp.h \
+ audio.h \
+ config.h \
+ getbits.h \
+ position.h \
+ proto.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/rtbuf$(ExOBJ):: rtbuf.c \
+ amp.h \
+ audio.h \
+ config.h \
+ getbits.h \
+ layer3.h \
+ proto.h \
+ rtbuf.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/transfor$(ExOBJ):: transfor.c \
+ audio.h \
+ getdata.h \
+ misc2.h \
+ transform.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
+obj/util$(ExOBJ):: util.c \
+ amp.h \
+ audio.h \
+ config.h \
+ proto.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_C)
+
diff --git a/setedit/mp3/libamp/libamp.mkf b/setedit/mp3/libamp/libamp.mkf
new file mode 100644
index 0000000..bb70cc3
--- /dev/null
+++ b/setedit/mp3/libamp/libamp.mkf
@@ -0,0 +1,39 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=
+#
+# Include directories
+#
+MP3_PREV_DIR=..
+MP3_MAIN_DIR=../../include
+INCLUDE_DIRS=. $(MP3_PREV_DIR) $(MP3_MAIN_DIR)
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Any configurable detail should come from here.
+#
+include rhide.env
+
+#
+# Common rules used by RHIDE.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+include libamp.imk
+
diff --git a/setedit/mp3/libamp/libamp.umk b/setedit/mp3/libamp/libamp.umk
new file mode 100644
index 0000000..8957d59
--- /dev/null
+++ b/setedit/mp3/libamp/libamp.umk
@@ -0,0 +1,68 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+../../makes/djgpp/libamp$(ExLIB):: \
+ obj/audioalg$(ExOBJ) \
+ obj/audiolib$(ExOBJ) \
+ obj/dump$(ExOBJ) \
+ obj/formats$(ExOBJ) \
+ obj/getbits$(ExOBJ) \
+ obj/getdata$(ExOBJ) \
+ obj/guicontr$(ExOBJ) \
+ obj/huffman$(ExOBJ) \
+ obj/layer2$(ExOBJ) \
+ obj/layer3$(ExOBJ) \
+ obj/misc2$(ExOBJ) \
+ obj/position$(ExOBJ) \
+ obj/rtbuf$(ExOBJ) \
+ obj/transfor$(ExOBJ) \
+ obj/util$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/audioalg$(ExOBJ):: audioalg.c
+ $(RHIDE_COMPILE_C)
+
+obj/audiolib$(ExOBJ):: audiolib.c
+ $(RHIDE_COMPILE_C)
+
+obj/dump$(ExOBJ):: dump.c
+ $(RHIDE_COMPILE_C)
+
+obj/formats$(ExOBJ):: formats.c
+ $(RHIDE_COMPILE_C)
+
+obj/getbits$(ExOBJ):: getbits.c
+ $(RHIDE_COMPILE_C)
+
+obj/getdata$(ExOBJ):: getdata.c
+ $(RHIDE_COMPILE_C)
+
+obj/guicontr$(ExOBJ):: guicontr.c
+ $(RHIDE_COMPILE_C)
+
+obj/huffman$(ExOBJ):: huffman.c
+ $(RHIDE_COMPILE_C)
+
+obj/layer2$(ExOBJ):: layer2.c
+ $(RHIDE_COMPILE_C)
+
+obj/layer3$(ExOBJ):: layer3.c
+ $(RHIDE_COMPILE_C)
+
+obj/misc2$(ExOBJ):: misc2.c
+ $(RHIDE_COMPILE_C)
+
+obj/position$(ExOBJ):: position.c
+ $(RHIDE_COMPILE_C)
+
+obj/rtbuf$(ExOBJ):: rtbuf.c
+ $(RHIDE_COMPILE_C)
+
+obj/transfor$(ExOBJ):: transfor.c
+ $(RHIDE_COMPILE_C)
+
+obj/util$(ExOBJ):: util.c
+ $(RHIDE_COMPILE_C)
+
diff --git a/setedit/mp3/libamp/misc2.c b/setedit/mp3/libamp/misc2.c
new file mode 100644
index 0000000..a773c14
--- /dev/null
+++ b/setedit/mp3/libamp/misc2.c
@@ -0,0 +1,801 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* misc2.c requantization, stereo processing, reordering(shortbl) and antialiasing butterflies
+ *
+ * misc.c was created by tomislav uzelac in May 1996, and was completely awful
+ * Created by: tomislav uzelac Dec 22 1996
+ * some more speed injected, cca. Jun 1 1997
+ */
+#include <math.h>
+
+#include "amp.h"
+#include "audio.h"
+#include "getdata.h"
+#include "huffman.h"
+
+#define MISC2
+#include "misc2.h"
+
+/*
+ * fras == Formula for Requantization and All Scaling **************************
+ */
+static inline float fras_l(int sfb,int global_gain,int scalefac_scale,int scalefac,int preflag)
+{
+register int a,scale;
+ /*
+ if (scalefac_scale) scale=2;
+ else scale=1;
+ */
+ scale=scalefac_scale+1;
+ a= global_gain -210 -(scalefac << scale);
+ if (preflag) a-=(t_pretab[sfb] << scale);
+
+/* bugfix, Mar 13 97: shifting won't produce a legal result if we shift by more than 31
+ * since global_gain<256, this can only occur for (very) negative values of a.
+*/
+ if (a < -127) return 0;
+
+/* a minor change here as well, no point in abs() if we now that a<0
+*/
+ if (a>=0) return tab[a&3]*(1 << (a>>2));
+ else return tabi[(-a)&3]/(1 << ((-a) >> 2));
+}
+
+static inline float fras_s(int global_gain,int subblock_gain,int scalefac_scale,int scalefac)
+{
+int a;
+ a=global_gain - 210 - (subblock_gain << 3);
+ if (scalefac_scale) a-= (scalefac << 2);
+ else a-= (scalefac << 1);
+
+ if (a < -127) return 0;
+
+ if (a>=0) return tab[a&3]*(1 << (a>>2));
+ else return tabi[(-a)&3]/(1 << ((-a) >> 2));
+}
+
+/* this should be faster than pow()
+ */
+static inline float fras2(int is,float a)
+{
+ if (is > 0) return t_43[is]*a;
+ else return -t_43[-is]*a;
+}
+
+/*
+ * requantize_mono *************************************************************
+ */
+
+/* generally, the two channels do not have to be of the same block type - that's why we do two passes with requantize_mono.
+ * if ms or intensity stereo is enabled we do a single pass with requantize_ms because both channels are same block type
+ */
+
+void requantize_mono(int gr,int ch,struct SIDE_INFO *info,struct AUDIO_HEADER *header)
+{
+int l,i,sfb;
+float a;
+int global_gain=info->global_gain[gr][ch];
+int scalefac_scale=info->scalefac_scale[gr][ch];
+int sfreq=header->sampling_frequency;
+
+
+ no_of_imdcts[0]=no_of_imdcts[1]=32;
+
+ if (info->window_switching_flag[gr][ch] && info->block_type[gr][ch]==2)
+ if (info->mixed_block_flag[gr][ch]) {
+ /*
+ * requantize_mono - mixed blocks/long block part **********************
+ */
+ int window,window_len,preflag=0; /* pretab is all zero in this low frequency area */
+ int scalefac=scalefac_l[gr][ch][0];
+
+ l=0;sfb=0;
+ a=fras_l(sfb,global_gain,scalefac_scale,scalefac,preflag);
+ while (l<36) {
+ xr[ch][0][l]=fras2(is[ch][l],a);
+ if (l==t_l[sfb]) {
+ scalefac=scalefac_l[gr][ch][++sfb];
+ a=fras_l(sfb,global_gain,scalefac_scale,scalefac,preflag);
+ }
+ l++;
+ }
+ /*
+ * requantize_mono - mixed blocks/short block part *********************
+ */
+ sfb=3;
+ window_len=t_s[sfb]-t_s[sfb-1];
+ while (l<non_zero[ch]) {
+ for (window=0;window<3;window++) {
+ int scalefac=scalefac_s[gr][ch][sfb][window];
+ int subblock_gain=info->subblock_gain[gr][ch][window];
+ a=fras_s(global_gain,subblock_gain,scalefac_scale,scalefac);
+ for (i=0;i<window_len;i++) {
+ xr[ch][0][t_reorder[header->ID][sfreq][l]]=fras2(is[ch][l],a);
+ l++;
+ }
+ }
+ sfb++;
+ window_len=t_s[sfb]-t_s[sfb-1];
+ }
+ while (l<576) xr[ch][0][t_reorder[header->ID][sfreq][l++]]=0;
+ } else {
+ /*
+ * requantize mono - short blocks **************************************
+ */
+ int window,window_len;
+
+ sfb=0; l=0;
+ window_len=t_s[0]+1;
+ while (l<non_zero[ch]) {
+ for (window=0;window<3;window++) {
+ int scalefac=scalefac_s[gr][ch][sfb][window];
+ int subblock_gain=info->subblock_gain[gr][ch][window];
+ float a=fras_s(global_gain,subblock_gain,scalefac_scale,scalefac);
+ for (i=0;i<window_len;i++) {
+ xr[ch][0][t_reorder[header->ID][sfreq][l]]=fras2(is[ch][l],a);
+ l++;
+ }
+ }
+ sfb++;
+ window_len=t_s[sfb]-t_s[sfb-1];
+ }
+ while (l<576) xr[ch][0][t_reorder[header->ID][sfreq][l++]]=0;
+ }
+ else {
+ /* long blocks */
+ int preflag=info->preflag[gr][ch];
+ int scalefac=scalefac_l[gr][ch][0];
+
+ sfb=0; l=0;
+ a=fras_l(sfb,global_gain,scalefac_scale,scalefac,preflag);
+ while (l<non_zero[ch]) {
+ xr[ch][0][l]=fras2(is[ch][l],a);
+ if (l==t_l[sfb]) {
+ scalefac=scalefac_l[gr][ch][++sfb];
+ a=fras_l(sfb,global_gain,scalefac_scale,scalefac,preflag);
+ }
+ l++;
+ }
+ while (l<576) xr[ch][0][l++]=0;
+ }
+}
+
+/*
+ * stereo stuff ****************************************************************
+ */
+static int find_isbound(int isbound[3],int gr,struct SIDE_INFO *info,struct AUDIO_HEADER *header)
+{
+int sfb,window,window_len,ms_flag,tmp,i;
+
+ isbound[0]=isbound[1]=isbound[2]=-1;
+ no_of_imdcts[0]=no_of_imdcts[1]=32;
+
+ if (header->mode_extension==1 || header->mode_extension==3) {
+ if (info->window_switching_flag[gr][0] && info->block_type[gr][0]==2) {
+
+ /* find that isbound!
+ */
+ tmp=non_zero[1];
+ sfb=0; while ((3*t_s[sfb]+2) < tmp && sfb < 12) sfb++;
+ while ((isbound[0]<0 || isbound[1]<0 || isbound[2]<0) && !(info->mixed_block_flag[gr][0] && sfb<3) && sfb) {
+ for (window=0;window<3;window++) {
+ if (sfb==0) {
+ window_len=t_s[0]+1;
+ tmp=(window+1)*window_len - 1;
+ } else {
+ window_len=t_s[sfb]-t_s[sfb-1];
+ tmp=(3*t_s[sfb-1]+2) + (window+1)*window_len;
+ }
+ if (isbound[window] < 0)
+ for (i=0;i<window_len;i++)
+ if (is[1][tmp--] != 0) {
+ isbound[window]=t_s[sfb]+1;
+ break;
+ }
+ }
+ sfb--;
+ }
+
+ /* mixed block magic now...
+ */
+ if (sfb==2 && info->mixed_block_flag[gr][0])
+ if (isbound[0]<0 && isbound[1]<0 && isbound[2]<0) {
+ tmp=35;
+ while (is[1][tmp] == 0) tmp--;
+ sfb=0; while (t_l[sfb] < tmp && sfb < 21) sfb++;
+ isbound[0]=isbound[1]=isbound[2]=t_l[sfb]+1;
+ } else for (window=0;window<3;window++)
+ if (isbound[window]<0) isbound[window]=36;
+ if (header->ID==1) isbound[0]=isbound[1]=isbound[2]=MAX(isbound[0],MAX(isbound[1],isbound[2]));
+
+ /* just how many imdcts?
+ */
+ tmp=non_zero[0];
+ sfb=0; while ((3*t_s[sfb]+2) < tmp && sfb < 12) sfb++;
+ no_of_imdcts[0]=no_of_imdcts[1]=(t_s[sfb]-1)/6+1;
+ } else {
+
+ /* long blocks now
+ */
+ tmp=non_zero[1];
+ while (is[1][tmp] == 0) tmp--;
+ sfb=0; while (t_l[sfb] < tmp && sfb < 21) sfb++;
+ isbound[0]=isbound[1]=isbound[2]=t_l[sfb]+1;
+ no_of_imdcts[0]=no_of_imdcts[1]=(non_zero[0]-1)/18+1;
+ }
+ if (header->mode_extension==1) ms_flag=0;
+ else ms_flag=1;
+ } else {
+
+ /* intensity stereo is, regretably, turned off
+ */
+ ms_flag=1;
+
+ /* i really put a lot of work in this, but it still looks like shit (works, though)
+ */
+ if (!info->window_switching_flag[gr][0] || (info->window_switching_flag[gr][0] && info->block_type[gr][0]!=2))
+ isbound[0]=isbound[1]=isbound[2]=(MAX(non_zero[0],non_zero[1]));
+ else isbound[0]=isbound[1]=isbound[2]=576;
+
+ if (info->window_switching_flag[gr][0] && info->block_type[gr][0]==2) {
+ /* should do for mixed blocks too, though i havent tested... */
+ tmp=(MAX(non_zero[0],non_zero[1]))/3;
+ sfb=0; while (t_s[sfb]<tmp && sfb<12) sfb++;
+ no_of_imdcts[0]=no_of_imdcts[1]=(t_s[sfb]-1)/6+1;
+ }
+ else no_of_imdcts[0]=no_of_imdcts[1]=(isbound[0]-1)/18+1;
+
+ }
+
+ return ms_flag;
+}
+
+static inline void stereo_s(int l,float a[2],int pos,int ms_flag,int is_pos,struct AUDIO_HEADER *header)
+{
+float ftmp,Mi,Si;
+
+ if (l>=576) return; /* brrr... */
+
+ if ((is_pos != IS_ILLEGAL) && (header->ID==1)) {
+ ftmp=fras2(is[0][l],a[0]);
+ xr[0][0][pos]=(1-t_is[is_pos])*ftmp;
+ xr[1][0][pos]=t_is[is_pos]*ftmp;
+ return;
+ }
+
+ if ((is_pos != IS_ILLEGAL) && (header->ID==0)) {
+ ftmp=fras2(is[0][l],a[0]);
+ if (is_pos&1) {
+ xr[0][0][pos]= t_is2[intensity_scale][(is_pos+1)>>1] * ftmp;
+ xr[1][0][pos]= ftmp;
+ } else {
+ xr[0][0][pos]= ftmp;
+ xr[1][0][pos]= t_is2[intensity_scale][is_pos>>1] * ftmp;
+ }
+ return;
+ }
+
+ if (ms_flag) {
+ Mi=fras2(is[0][l],a[0]);
+ Si=fras2(is[1][l],a[1]);
+ xr[0][0][pos]=(Mi+Si)*i_sq2;
+ xr[1][0][pos]=(Mi-Si)*i_sq2;
+ } else {
+ xr[0][0][pos]=fras2(is[0][l],a[0]);
+ xr[1][0][pos]=fras2(is[1][l],a[1]);
+ }
+}
+
+static inline void stereo_l(int l,float a[2],int ms_flag,int is_pos,struct AUDIO_HEADER *header)
+{
+float ftmp,Mi,Si;
+ if (l>=576) return;
+
+/* new code by ???
+*/
+ if (is_pos != IS_ILLEGAL) {
+ ftmp = fras2(is[0][l], a[0]);
+ if (header -> ID ==1) {
+ xr[0][0][l] = (1 - t_is[is_pos]) * ftmp;
+ xr[1][0][l] = t_is[is_pos] * ftmp;
+ return;
+ } else if (is_pos & 1) {
+ xr[0][0][l] = t_is2[intensity_scale][(is_pos + 1) >> 1] * ftmp;
+ xr[1][0][l] = ftmp;
+ } else {
+ xr[0][0][l] = ftmp;
+ xr[1][0][l] = t_is2[intensity_scale][is_pos >> 1] * ftmp;
+ }
+ return;
+ }
+
+ if (ms_flag) {
+ Mi=fras2(is[0][l],a[0]);
+ Si=fras2(is[1][l],a[1]);
+ xr[0][0][l]=(Mi+Si)*i_sq2;
+ xr[1][0][l]=(Mi-Si)*i_sq2;
+ } else {
+ xr[0][0][l]=fras2(is[0][l],a[0]);
+ xr[1][0][l]=fras2(is[1][l],a[1]);
+ }
+
+}
+
+
+/*
+ * requantize_ms ***************************************************************
+ */
+void requantize_ms(int gr,struct SIDE_INFO *info,struct AUDIO_HEADER *header)
+{
+int l,sfb,ms_flag,is_pos,i,ch;
+int *global_gain,subblock_gain[2],*scalefac_scale,scalefac[2],isbound[3];
+int sfreq=header->sampling_frequency;
+int id = header->ID;
+float a[2];
+
+global_gain=info->global_gain[gr];
+scalefac_scale=info->scalefac_scale[gr];
+
+ if (info->window_switching_flag[gr][0] && info->block_type[gr][0]==2)
+ if (info->mixed_block_flag[gr][0]) {
+ /*
+ * mixed blocks w/stereo processing - long block part ******************
+ */
+ int window,window_len;
+ int preflag[2]={0,0};
+
+ ms_flag=find_isbound(isbound,gr,info,header);
+
+ sfb=0; l=0;
+ for (ch=0;ch<2;ch++) {
+ scalefac[ch]=scalefac_l[gr][ch][0];
+ a[ch]=fras_l(0,global_gain[ch],scalefac_scale[ch],scalefac[ch],preflag[ch]);
+ }
+
+
+ while (l<36) {
+ int is_pos;
+ if (l<isbound[0]) is_pos=IS_ILLEGAL;
+ else {
+ is_pos=scalefac[1];
+ if (id==1) /* MPEG1 */
+ if (is_pos==7) is_pos=IS_ILLEGAL;
+ else /* MPEG2 */
+ if (is_pos==is_max[sfb]) is_pos=IS_ILLEGAL;
+ }
+
+ stereo_l(l,a,ms_flag,is_pos,header);
+
+ if (l==t_l[sfb]) {
+ sfb++;
+ for (ch=0;ch<2;ch++) {
+ scalefac[ch]=scalefac_l[gr][ch][sfb];
+ a[ch]=fras_l(sfb,global_gain[ch],scalefac_scale[ch],scalefac[ch],preflag[ch]);
+ }
+ }
+
+ l++;
+ }
+ /*
+ * mixed blocks w/stereo processing - short block part *****************
+ */
+ sfb=3;
+ window_len=t_s[sfb]-t_s[sfb-1];
+
+ while (l<(MAX(non_zero[0],non_zero[1]))) {
+ for (window=0;window<3;window++) {
+ subblock_gain[0]=info->subblock_gain[gr][0][window];
+ subblock_gain[1]=info->subblock_gain[gr][1][window];
+ scalefac[0]=scalefac_s[gr][0][sfb][window];
+ scalefac[1]=scalefac_s[gr][1][sfb][window];
+
+ if (t_s[sfb] < isbound[window]) {
+ is_pos=IS_ILLEGAL;
+ a[0]=fras_s(global_gain[0],subblock_gain[0],scalefac_scale[0],scalefac[0]);
+ a[1]=fras_s(global_gain[1],subblock_gain[1],scalefac_scale[1],scalefac[1]);
+ } else {
+ is_pos=scalefac[1];
+ if (id==1) /* MPEG1 */
+ if (is_pos==7) is_pos=IS_ILLEGAL;
+ else /* MPEG2 */
+ if (is_pos==is_max[sfb+6]) is_pos=IS_ILLEGAL;
+
+ a[0]=fras_s(global_gain[0],subblock_gain[0],scalefac_scale[0],scalefac[0]);
+ }
+
+ for (i=0;i<window_len;i++) {
+ stereo_s(l,a,t_reorder[id][sfreq][l],ms_flag,is_pos,header);
+ l++;
+ }
+ }
+ sfb++;
+ window_len=t_s[sfb]-t_s[sfb-1];
+ }
+ while (l<576) {
+ int reorder = t_reorder[id][sfreq][l++];
+
+ xr[0][0][reorder]=xr[1][0][reorder]=0;
+ }
+ } else {
+ /*
+ * requantize_ms - short blocks w/stereo processing ********************
+ */
+ int window,window_len;
+
+ ms_flag=find_isbound(isbound,gr,info,header);
+ sfb=0; l=0;
+ window_len=t_s[0]+1;
+
+ while (l<(MAX(non_zero[0],non_zero[1]))) {
+ for (window=0;window<3;window++) {
+ subblock_gain[0]=info->subblock_gain[gr][0][window];
+ subblock_gain[1]=info->subblock_gain[gr][1][window];
+ scalefac[0]=scalefac_s[gr][0][sfb][window];
+ scalefac[1]=scalefac_s[gr][1][sfb][window];
+
+ if (t_s[sfb] < isbound[window]) {
+ is_pos=IS_ILLEGAL;
+ a[0]=fras_s(global_gain[0],subblock_gain[0],scalefac_scale[0],scalefac[0]);
+ a[1]=fras_s(global_gain[1],subblock_gain[1],scalefac_scale[1],scalefac[1]);
+ } else {
+ is_pos=scalefac[1];
+ if (id==1) /* MPEG1 */
+ if (is_pos==7) is_pos=IS_ILLEGAL;
+ else /* MPEG2 */
+ if (is_pos==is_max[sfb+6]) is_pos=IS_ILLEGAL;
+
+ a[0]=fras_s(global_gain[0],subblock_gain[0],scalefac_scale[0],scalefac[0]);
+ }
+
+ for (i=0;i<window_len;i++) {
+ stereo_s(l,a,t_reorder[id][sfreq][l],ms_flag,is_pos,header);
+ l++;
+ }
+ }
+ /* this won't do anymore
+ * window_len=-t_s[sfb]+t_s[++sfb];
+ */
+ window_len = -t_s[sfb++];
+ window_len += t_s[sfb];
+
+ }
+ while (l<576) {
+ int reorder = t_reorder[id][sfreq][l++];
+
+ xr[0][0][reorder]=xr[1][0][reorder]=0;
+ }
+ }
+ else {
+ /*
+ * long blocks w/stereo processing *************************************
+ */
+ int *preflag=info->preflag[gr];
+
+ ms_flag=find_isbound(isbound,gr,info,header);
+
+ sfb=0; l=0;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ a[1]=fras_l(sfb,global_gain[1],scalefac_scale[1],scalefac[1],preflag[1]);
+
+ /* no intensity stereo part
+ */
+ if (ms_flag)
+ while (l< isbound[0]) {
+#if defined(PENTIUM_RDTSC)
+
+unsigned int cnt4, cnt3, cnt2, cnt1;
+static int min_cycles = 99999999;
+
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt1), "=d" (cnt4));
+#endif
+
+ {
+ register float Mi = fras2(is[0][l],a[0]);
+ register float Si = fras2(is[1][l],a[1]);
+ register float tmp = i_sq2;
+ xr[0][0][l]=(Mi+Si)*tmp;
+ xr[1][0][l]=(Mi-Si)*tmp;
+ }
+
+#if defined(PENTIUM_RDTSC)
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt2), "=d" (cnt4));
+
+ if (cnt2-cnt1 < min_cycles) {
+ min_cycles = cnt2-cnt1;
+ printf("%d cycles\n", min_cycles);
+ }
+
+#endif
+ if (l==t_l[sfb]) {
+#if defined(PENTIUM_RDTSC2)
+
+unsigned int cnt4, cnt2, cnt1;
+static int min_cycles = 99999999;
+
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt1), "=d" (cnt4));
+#endif
+
+ sfb++;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ a[1]=fras_l(sfb,global_gain[1],scalefac_scale[1],scalefac[1],preflag[1]);
+#if defined(PENTIUM_RDTSC2)
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt2), "=d" (cnt4));
+
+ if (cnt2-cnt1 < min_cycles) {
+ min_cycles = cnt2-cnt1;
+ printf("%d cycles, sfb %d\n", min_cycles, sfb);
+ }
+
+#endif
+ }
+ l++;
+ }
+ else
+ while (l< isbound[0]) {
+ xr[0][0][l]=fras2(is[0][l],a[0]);
+ xr[1][0][l]=fras2(is[1][l],a[1]);
+ if (l==t_l[sfb]) {
+ sfb++;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ a[1]=fras_l(sfb,global_gain[1],scalefac_scale[1],scalefac[1],preflag[1]);
+ }
+ l++;
+ }
+
+
+ /* intensity stereo part
+ */
+ while (l<(MAX(non_zero[0],non_zero[1]))) {
+ int is_pos=scalefac[1];
+
+ if (id==1) /* MPEG1 */
+ if (is_pos==7) is_pos=IS_ILLEGAL;
+ else /* MPEG2 */
+ if (is_pos==is_max[sfb]) is_pos=IS_ILLEGAL;
+
+ stereo_l(l,a,ms_flag,is_pos,header);
+
+ if (l==t_l[sfb]) {
+ sfb++;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ }
+ l++;
+ }
+
+ while (l<576) {
+ xr[0][0][l]=0;
+ xr[1][0][l]=0;
+ l++;
+ }
+ }
+}
+
+/*
+ * requantize_downmix **********************************************************
+ */
+void requantize_downmix(int gr,struct SIDE_INFO *info,struct AUDIO_HEADER *header)
+{
+int l,sfb,ms_flag,is_pos,i,ch;
+int *global_gain,subblock_gain[2],*scalefac_scale,scalefac[2],isbound[3];
+int sfreq=header->sampling_frequency;
+int id = header->ID;
+float a[2];
+
+ /* first set some variables
+ */
+ global_gain=info->global_gain[gr];
+ scalefac_scale=info->scalefac_scale[gr];
+
+ if (header->mode_extension==2 || header->mode_extension==3) ms_flag=1;
+ else ms_flag=0;
+
+ /* ... and then we're off for requantization
+ */
+ if (info->window_switching_flag[gr][0] && info->block_type[gr][0]==2)
+ if (info->mixed_block_flag[gr][0]) {
+ die("mixed block? hmmmm...., downmix for mixed blocks is not yet implemented\n");
+ } else {
+ int window,window_len;
+ int isbound[3];
+ int is_pos;
+ int dummy=find_isbound(isbound,gr,info,header); /* ugly hack, part3 */
+
+ sfb=0; l=0; window_len=t_s[0]+1;
+
+ while (l<(MAX(non_zero[0],non_zero[1]))) {
+ for (window=0;window<3;window++) {
+ subblock_gain[0]=info->subblock_gain[gr][0][window];
+ subblock_gain[1]=info->subblock_gain[gr][1][window];
+ scalefac[0]=scalefac_s[gr][0][sfb][window];
+ is_pos=scalefac[1]=scalefac_s[gr][1][sfb][window];
+
+ if (t_s[sfb] < isbound[window]) {
+ a[0]=fras_s(global_gain[0],subblock_gain[0],scalefac_scale[0],scalefac[0]);
+ if (ms_flag) {
+ for (i=0;i<window_len;i++) {
+ register float Mi=fras2(is[0][l],a[0]);
+ register float tmp = i_sq2;
+ xr[0][0][t_reorder[id][sfreq][l]]=Mi*i_sq2;
+ l++;
+ }
+ } else {
+ a[1]=fras_s(global_gain[1],subblock_gain[1],scalefac_scale[1],scalefac[1]);
+ for (i=0;i<window_len;i++) {
+ register float tmp1=fras2(is[0][l],a[0]);
+ register float tmp2=fras2(is[1][l],a[1]);
+ xr[0][0][t_reorder[id][sfreq][l]]=(tmp1+tmp2)*0.5f;
+ l++;
+ }
+ }
+ } else {
+ a[0]=fras_s(global_gain[0],subblock_gain[0],scalefac_scale[0],scalefac[0]);
+ for (i=0;i<window_len;i++) {
+ register float ftmp = fras2(is[0][l], a[0]);
+ if (id==0 && is_pos<is_max[sfb])
+ ftmp*=t_downmix[intensity_scale][(is_pos+1)>>1];
+ xr[0][0][t_reorder[id][sfreq][l]] = ftmp;
+ l++;
+ }
+ }
+ }
+ window_len = -t_s[sfb++];
+ window_len += t_s[sfb];
+ }
+ while (l<576) {
+ xr[0][0][l]=0;
+ l++;
+ }
+ }
+ else {
+ int *preflag=info->preflag[gr];
+ int isbound;
+
+ if (header->mode_extension==1 || header->mode_extension==3) {
+ int tmp=non_zero[1];
+ while (is[1][tmp] == 0) tmp--;
+ sfb=0; while (t_l[sfb] < tmp && sfb < 21) sfb++;
+ isbound=t_l[sfb]+1;
+ no_of_imdcts[0]=no_of_imdcts[1]=(non_zero[0]-1)/18+1;
+ } else {
+ isbound=(MAX(non_zero[0],non_zero[1]));
+ no_of_imdcts[0]=no_of_imdcts[1]=(isbound-1)/18+1;
+ }
+
+ sfb=0; l=0;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ a[1]=fras_l(sfb,global_gain[1],scalefac_scale[1],scalefac[1],preflag[1]);
+
+ /* no intensity stereo part
+ */
+ if (ms_flag)
+ while (l < isbound) {
+ register float Mi = fras2(is[0][l],a[0]);
+ register float tmp = i_sq2;
+ xr[0][0][l]=Mi*tmp;
+
+ if (l==t_l[sfb]) {
+ sfb++;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ }
+ l++;
+ }
+ else
+ while (l < isbound) {
+ register float tmp1=fras2(is[0][l],a[0]);
+ register float tmp2=fras2(is[1][l],a[1]);
+ xr[0][0][l]=(tmp1+tmp2)*0.5f;
+ if (l==t_l[sfb]) {
+ sfb++;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ a[1]=fras_l(sfb,global_gain[1],scalefac_scale[1],scalefac[1],preflag[1]);
+ }
+ l++;
+ }
+ /* intensity stereo part
+ */
+ while (l<(MAX(non_zero[0],non_zero[1]))) {
+ int is_pos=scalefac[1];
+ register float ftmp=fras2(is[0][l], a[0]);
+
+ if (id==0 && is_pos<is_max[sfb]) {
+ ftmp*=t_downmix[intensity_scale][(is_pos+1)>>1];
+ }
+
+ xr[0][0][l] = ftmp;
+
+ if (l==t_l[sfb]) {
+ sfb++;
+ scalefac[0]=scalefac_l[gr][0][sfb];
+ a[0]=fras_l(sfb,global_gain[0],scalefac_scale[0],scalefac[0],preflag[0]);
+ scalefac[1]=scalefac_l[gr][1][sfb];
+ }
+ l++;
+ }
+
+ /* _always_ zero out everything else
+ */
+ while (l<576) {
+ xr[0][0][l]=0;
+ l++;
+ }
+ }
+}
+
+/*
+ * antialiasing butterflies ****************************************************
+ *
+ */
+void alias_reduction(int ch)
+{
+unsigned int sb;
+
+ for (sb=1;sb<32;sb++) {
+ float *x = xr[ch][sb];
+ register float a, b;
+
+ a = x[0];
+ b = x[-1];
+ x[-1] = b * Cs[0] - a * Ca[0];
+ x[0] = a * Cs[0] + b * Ca[0];
+
+ a = x[1];
+ b = x[-2];
+ x[-2] = b * Cs[1] - a * Ca[1];
+ x[1] = a * Cs[1] + b * Ca[1];
+
+ a = x[2];
+ b = x[-3];
+ x[-3] = b * Cs[2] - a * Ca[2];
+ x[2] = a * Cs[2] + b * Ca[2];
+
+ a = x[3];
+ b = x[-4];
+ x[-4] = b * Cs[3] - a * Ca[3];
+ x[3] = a * Cs[3] + b * Ca[3];
+
+ a = x[4];
+ b = x[-5];
+ x[-5] = b * Cs[4] - a * Ca[4];
+ x[4] = a * Cs[4] + b * Ca[4];
+
+ a = x[5];
+ b = x[-6];
+ x[-6] = b * Cs[5] - a * Ca[5];
+ x[5] = a * Cs[5] + b * Ca[5];
+
+ a = x[6];
+ b = x[-7];
+ x[-7] = b * Cs[6] - a * Ca[6];
+ x[6] = a * Cs[6] + b * Ca[6];
+
+ a = x[7];
+ b = x[-8];
+ x[-8] = b * Cs[7] - a * Ca[7];
+ x[7] = a * Cs[7] + b * Ca[7];
+ }
+}
+
+/* calculating t_43 instead of having that big table in misc2.h
+ */
+
+void calculate_t43(void)
+{
+int i;
+ for (i=0;i<8192;i++)
+ t_43[i]=(float)pow((float)i,1.33333333333f);
+}
diff --git a/setedit/mp3/libamp/misc2.h b/setedit/mp3/libamp/misc2.h
new file mode 100644
index 0000000..cf49ab7
--- /dev/null
+++ b/setedit/mp3/libamp/misc2.h
@@ -0,0 +1,253 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* misc2.h
+ *
+ * Created by: tomislav uzelac May 1996
+ * Last modified by: tomislav uzelac Jan 8 1997
+ */
+
+extern void requantize_mono(int gr,int ch,struct SIDE_INFO *info,struct AUDIO_HEADER *header);
+extern void requantize_ms(int gr,struct SIDE_INFO *info,struct AUDIO_HEADER *header);
+extern void alias_reduction(int ch);
+extern void calculate_t43(void);
+
+extern int no_of_imdcts[2];
+
+#ifdef MISC2
+
+#define i_sq2 0.707106781188
+#define IS_ILLEGAL 0xfeed
+
+void requantize_mono(int gr,int ch,struct SIDE_INFO *info,struct AUDIO_HEADER *header);
+void requantize_ms(int gr,struct SIDE_INFO *info,struct AUDIO_HEADER *header);
+void alias_reduction(int ch);
+
+static inline float fras_l(int sfb,int global_gain,int scalefac_scale,int scalefac,int preflag);
+static inline float fras_s(int global_gain,int subblock_gain,int scalefac_scale,int scalefac);
+static inline float fras2(int is,float a);
+static int find_isbound(int isbound[3],int gr,struct SIDE_INFO *info,struct AUDIO_HEADER *header);
+static inline void stereo_s(int l,float a[2],int pos,int ms_flag,int is_pos,struct AUDIO_HEADER *header);
+static inline void stereo_l(int l,float a[2],int ms_flag,int is_pos,struct AUDIO_HEADER *header);
+
+int no_of_imdcts[2];
+
+static const int t_pretab[22]={0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0};
+static const float t_is[7]={ 1.0, 0.788675134596, 0.633974596215,
+ 0.5, 0.366025403784, 0.211324865405, 0.0};
+static const float t_is2[2][32]={
+{ 1, 0.840896, 0.707107, 0.594604, 0.5, 0.420448,
+ 0.353553, 0.297302, 0.25, 0.210224, 0.176777, 0.148651,
+ 0.125, 0.105112, 0.0883883, 0.0743254},
+{ 1, 0.707107, 0.5, 0.353553, 0.25, 0.176777,
+ 0.125, 0.0883883, 0.0625, 0.0441942, 0.03125, 0.0220971,
+ 0.015625, 0.0110485, 0.0078125, 0.00552427}
+};
+static const float t_downmix[2][32]={
+{ 1.000000, 0.920448, 0.853554, 0.797302, 0.750000, 0.710224,
+ 0.676776, 0.648651, 0.625000, 0.605112, 0.588389, 0.574326,
+ 0.562500, 0.552556, 0.544194, 0.537163},
+{ 1.000000, 0.853554, 0.750000, 0.676776, 0.625000, 0.588389,
+ 0.562500, 0.544194, 0.531250, 0.522097, 0.515625, 0.511049,
+ 0.507813, 0.505524, 0.503906, 0.502762}
+};
+
+static const float Cs[8]={0.857492925712, 0.881741997318, 0.949628649103,
+ 0.983314592492, 0.995517816065, 0.999160558175,
+ 0.999899195243, 0.999993155067};
+static const float Ca[8]={-0.5144957554270, -0.4717319685650, -0.3133774542040,
+ -0.1819131996110, -0.0945741925262, -0.0409655828852,
+ -0.0141985685725, -0.00369997467375};
+static const float tab[4]={1,1.189207115,1.414213562,1.6817928301};
+static const float tabi[4]={1,0.840896415,0.707106781,0.594603557};
+
+static float t_43[8192];
+
+
+/* leftmost index denotes header->ID, so first three are for MPEG2
+ * and the others are for MPEG1
+ */
+static const short t_reorder[2][3][576]={{
+{ 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 4, 5, 18, 19, 10, 11, 24, 25,
+ 16, 17, 30, 31, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 90, 91,
+ 78, 79, 80, 81, 82, 83, 96, 97, 84, 85, 86, 87, 88, 89, 102, 103, 92, 93, 94, 95,
+ 108, 109, 110, 111, 112, 113, 98, 99, 100, 101, 114, 115, 116, 117, 118, 119, 104, 105, 106, 107,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 144, 145, 146, 147, 148, 149, 162, 163,
+ 132, 133, 134, 135, 136, 137, 150, 151, 152, 153, 154, 155, 168, 169, 138, 139, 140, 141, 142, 143,
+ 156, 157, 158, 159, 160, 161, 174, 175, 164, 165, 166, 167, 180, 181, 182, 183, 184, 185, 198, 199,
+ 200, 201, 202, 203, 216, 217, 170, 171, 172, 173, 186, 187, 188, 189, 190, 191, 204, 205, 206, 207,
+ 208, 209, 222, 223, 176, 177, 178, 179, 192, 193, 194, 195, 196, 197, 210, 211, 212, 213, 214, 215,
+ 228, 229, 218, 219, 220, 221, 234, 235, 236, 237, 238, 239, 252, 253, 254, 255, 256, 257, 270, 271,
+ 272, 273, 274, 275, 288, 289, 290, 291, 224, 225, 226, 227, 240, 241, 242, 243, 244, 245, 258, 259,
+ 260, 261, 262, 263, 276, 277, 278, 279, 280, 281, 294, 295, 296, 297, 230, 231, 232, 233, 246, 247,
+ 248, 249, 250, 251, 264, 265, 266, 267, 268, 269, 282, 283, 284, 285, 286, 287, 300, 301, 302, 303,
+ 292, 293, 306, 307, 308, 309, 310, 311, 324, 325, 326, 327, 328, 329, 342, 343, 344, 345, 346, 347,
+ 360, 361, 362, 363, 364, 365, 378, 379, 380, 381, 382, 383, 298, 299, 312, 313, 314, 315, 316, 317,
+ 330, 331, 332, 333, 334, 335, 348, 349, 350, 351, 352, 353, 366, 367, 368, 369, 370, 371, 384, 385,
+ 386, 387, 388, 389, 304, 305, 318, 319, 320, 321, 322, 323, 336, 337, 338, 339, 340, 341, 354, 355,
+ 356, 357, 358, 359, 372, 373, 374, 375, 376, 377, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399,
+ 400, 401, 414, 415, 416, 417, 418, 419, 432, 433, 434, 435, 436, 437, 450, 451, 452, 453, 454, 455,
+ 468, 469, 470, 471, 472, 473, 486, 487, 488, 489, 490, 491, 504, 505, 506, 507, 508, 509, 402, 403,
+ 404, 405, 406, 407, 420, 421, 422, 423, 424, 425, 438, 439, 440, 441, 442, 443, 456, 457, 458, 459,
+ 460, 461, 474, 475, 476, 477, 478, 479, 492, 493, 494, 495, 496, 497, 510, 511, 512, 513, 514, 515,
+ 408, 409, 410, 411, 412, 413, 426, 427, 428, 429, 430, 431, 444, 445, 446, 447, 448, 449, 462, 463,
+ 464, 465, 466, 467, 480, 481, 482, 483, 484, 485, 498, 499, 500, 501, 502, 503, 516, 517, 518, 519,
+ 520, 521, 522, 523, 524, 525, 526, 527, 540, 541, 542, 543, 544, 545, 558, 559, 560, 561, 562, 563,
+ 528, 529, 530, 531, 532, 533, 546, 547, 548, 549, 550, 551, 564, 565, 566, 567, 568, 569, 534, 535,
+ 536, 537, 538, 539, 552, 553, 554, 555, 556, 557, 570, 571, 572, 573, 574, 575},
+
+{ 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 4, 5, 18, 19, 10, 11, 24, 25,
+ 16, 17, 30, 31, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 72, 73, 60, 61, 62, 63, 64, 65, 78, 79, 66, 67, 68, 69, 70, 71, 84, 85, 74, 75,
+ 76, 77, 90, 91, 92, 93, 94, 95, 80, 81, 82, 83, 96, 97, 98, 99, 100, 101, 86, 87,
+ 88, 89, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 126, 127, 128, 129, 130, 131,
+ 114, 115, 116, 117, 118, 119, 132, 133, 134, 135, 136, 137, 120, 121, 122, 123, 124, 125, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 162, 163, 164, 165, 166, 167, 180, 181, 150, 151,
+ 152, 153, 154, 155, 168, 169, 170, 171, 172, 173, 186, 187, 156, 157, 158, 159, 160, 161, 174, 175,
+ 176, 177, 178, 179, 192, 193, 182, 183, 184, 185, 198, 199, 200, 201, 202, 203, 216, 217, 218, 219,
+ 220, 221, 234, 235, 188, 189, 190, 191, 204, 205, 206, 207, 208, 209, 222, 223, 224, 225, 226, 227,
+ 240, 241, 194, 195, 196, 197, 210, 211, 212, 213, 214, 215, 228, 229, 230, 231, 232, 233, 246, 247,
+ 236, 237, 238, 239, 252, 253, 254, 255, 256, 257, 270, 271, 272, 273, 274, 275, 288, 289, 290, 291,
+ 292, 293, 306, 307, 242, 243, 244, 245, 258, 259, 260, 261, 262, 263, 276, 277, 278, 279, 280, 281,
+ 294, 295, 296, 297, 298, 299, 312, 313, 248, 249, 250, 251, 264, 265, 266, 267, 268, 269, 282, 283,
+ 284, 285, 286, 287, 300, 301, 302, 303, 304, 305, 318, 319, 308, 309, 310, 311, 324, 325, 326, 327,
+ 328, 329, 342, 343, 344, 345, 346, 347, 360, 361, 362, 363, 364, 365, 378, 379, 380, 381, 382, 383,
+ 396, 397, 398, 399, 314, 315, 316, 317, 330, 331, 332, 333, 334, 335, 348, 349, 350, 351, 352, 353,
+ 366, 367, 368, 369, 370, 371, 384, 385, 386, 387, 388, 389, 402, 403, 404, 405, 320, 321, 322, 323,
+ 336, 337, 338, 339, 340, 341, 354, 355, 356, 357, 358, 359, 372, 373, 374, 375, 376, 377, 390, 391,
+ 392, 393, 394, 395, 408, 409, 410, 411, 400, 401, 414, 415, 416, 417, 418, 419, 432, 433, 434, 435,
+ 436, 437, 450, 451, 452, 453, 454, 455, 468, 469, 470, 471, 472, 473, 486, 487, 488, 489, 490, 491,
+ 504, 505, 506, 507, 508, 509, 522, 523, 524, 525, 526, 527, 406, 407, 420, 421, 422, 423, 424, 425,
+ 438, 439, 440, 441, 442, 443, 456, 457, 458, 459, 460, 461, 474, 475, 476, 477, 478, 479, 492, 493,
+ 494, 495, 496, 497, 510, 511, 512, 513, 514, 515, 528, 529, 530, 531, 532, 533, 412, 413, 426, 427,
+ 428, 429, 430, 431, 444, 445, 446, 447, 448, 449, 462, 463, 464, 465, 466, 467, 480, 481, 482, 483,
+ 484, 485, 498, 499, 500, 501, 502, 503, 516, 517, 518, 519, 520, 521, 534, 535, 536, 537, 538, 539,
+ 540, 541, 542, 543, 544, 545, 558, 559, 560, 561, 562, 563, 546, 547, 548, 549, 550, 551, 564, 565,
+ 566, 567, 568, 569, 552, 553, 554, 555, 556, 557, 570, 571, 572, 573, 574, 575},
+
+{ 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 4, 5, 18, 19, 10, 11, 24, 25,
+ 16, 17, 30, 31, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 72, 73, 60, 61, 62, 63, 64, 65, 78, 79, 66, 67, 68, 69, 70, 71, 84, 85, 74, 75,
+ 76, 77, 90, 91, 92, 93, 94, 95, 80, 81, 82, 83, 96, 97, 98, 99, 100, 101, 86, 87,
+ 88, 89, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 126, 127, 128, 129, 130, 131,
+ 114, 115, 116, 117, 118, 119, 132, 133, 134, 135, 136, 137, 120, 121, 122, 123, 124, 125, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 162, 163, 164, 165, 166, 167, 180, 181, 150, 151,
+ 152, 153, 154, 155, 168, 169, 170, 171, 172, 173, 186, 187, 156, 157, 158, 159, 160, 161, 174, 175,
+ 176, 177, 178, 179, 192, 193, 182, 183, 184, 185, 198, 199, 200, 201, 202, 203, 216, 217, 218, 219,
+ 220, 221, 234, 235, 188, 189, 190, 191, 204, 205, 206, 207, 208, 209, 222, 223, 224, 225, 226, 227,
+ 240, 241, 194, 195, 196, 197, 210, 211, 212, 213, 214, 215, 228, 229, 230, 231, 232, 233, 246, 247,
+ 236, 237, 238, 239, 252, 253, 254, 255, 256, 257, 270, 271, 272, 273, 274, 275, 288, 289, 290, 291,
+ 292, 293, 306, 307, 242, 243, 244, 245, 258, 259, 260, 261, 262, 263, 276, 277, 278, 279, 280, 281,
+ 294, 295, 296, 297, 298, 299, 312, 313, 248, 249, 250, 251, 264, 265, 266, 267, 268, 269, 282, 283,
+ 284, 285, 286, 287, 300, 301, 302, 303, 304, 305, 318, 319, 308, 309, 310, 311, 324, 325, 326, 327,
+ 328, 329, 342, 343, 344, 345, 346, 347, 360, 361, 362, 363, 364, 365, 378, 379, 380, 381, 382, 383,
+ 396, 397, 314, 315, 316, 317, 330, 331, 332, 333, 334, 335, 348, 349, 350, 351, 352, 353, 366, 367,
+ 368, 369, 370, 371, 384, 385, 386, 387, 388, 389, 402, 403, 320, 321, 322, 323, 336, 337, 338, 339,
+ 340, 341, 354, 355, 356, 357, 358, 359, 372, 373, 374, 375, 376, 377, 390, 391, 392, 393, 394, 395,
+ 408, 409, 398, 399, 400, 401, 414, 415, 416, 417, 418, 419, 432, 433, 434, 435, 436, 437, 450, 451,
+ 452, 453, 454, 455, 468, 469, 470, 471, 472, 473, 486, 487, 488, 489, 490, 491, 504, 505, 506, 507,
+ 508, 509, 404, 405, 406, 407, 420, 421, 422, 423, 424, 425, 438, 439, 440, 441, 442, 443, 456, 457,
+ 458, 459, 460, 461, 474, 475, 476, 477, 478, 479, 492, 493, 494, 495, 496, 497, 510, 511, 512, 513,
+ 514, 515, 410, 411, 412, 413, 426, 427, 428, 429, 430, 431, 444, 445, 446, 447, 448, 449, 462, 463,
+ 464, 465, 466, 467, 480, 481, 482, 483, 484, 485, 498, 499, 500, 501, 502, 503, 516, 517, 518, 519,
+ 520, 521, 522, 523, 524, 525, 526, 527, 540, 541, 542, 543, 544, 545, 558, 559, 560, 561, 562, 563,
+ 528, 529, 530, 531, 532, 533, 546, 547, 548, 549, 550, 551, 564, 565, 566, 567, 568, 569, 534, 535,
+ 536, 537, 538, 539, 552, 553, 554, 555, 556, 557, 570, 571, 572, 573, 574, 575}
+},
+{
+{ 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 4, 5, 18, 19, 10, 11, 24, 25,
+ 16, 17, 30, 31, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39,
+ 42, 43, 44, 45, 48, 49, 50, 51, 40, 41, 54, 55, 56, 57, 46, 47, 60, 61, 62, 63,
+ 52, 53, 66, 67, 68, 69, 58, 59, 72, 73, 74, 75, 76, 77, 64, 65, 78, 79, 80, 81,
+ 82, 83, 70, 71, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 108, 109, 110, 111,
+ 96, 97, 98, 99, 100, 101, 114, 115, 116, 117, 102, 103, 104, 105, 106, 107, 120, 121, 122, 123,
+ 112, 113, 126, 127, 128, 129, 130, 131, 144, 145, 146, 147, 118, 119, 132, 133, 134, 135, 136, 137,
+ 150, 151, 152, 153, 124, 125, 138, 139, 140, 141, 142, 143, 156, 157, 158, 159, 148, 149, 162, 163,
+ 164, 165, 166, 167, 180, 181, 182, 183, 184, 185, 154, 155, 168, 169, 170, 171, 172, 173, 186, 187,
+ 188, 189, 190, 191, 160, 161, 174, 175, 176, 177, 178, 179, 192, 193, 194, 195, 196, 197, 198, 199,
+ 200, 201, 202, 203, 216, 217, 218, 219, 220, 221, 234, 235, 236, 237, 238, 239, 204, 205, 206, 207,
+ 208, 209, 222, 223, 224, 225, 226, 227, 240, 241, 242, 243, 244, 245, 210, 211, 212, 213, 214, 215,
+ 228, 229, 230, 231, 232, 233, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 270, 271,
+ 272, 273, 274, 275, 288, 289, 290, 291, 292, 293, 306, 307, 308, 309, 258, 259, 260, 261, 262, 263,
+ 276, 277, 278, 279, 280, 281, 294, 295, 296, 297, 298, 299, 312, 313, 314, 315, 264, 265, 266, 267,
+ 268, 269, 282, 283, 284, 285, 286, 287, 300, 301, 302, 303, 304, 305, 318, 319, 320, 321, 310, 311,
+ 324, 325, 326, 327, 328, 329, 342, 343, 344, 345, 346, 347, 360, 361, 362, 363, 364, 365, 378, 379,
+ 380, 381, 382, 383, 396, 397, 398, 399, 316, 317, 330, 331, 332, 333, 334, 335, 348, 349, 350, 351,
+ 352, 353, 366, 367, 368, 369, 370, 371, 384, 385, 386, 387, 388, 389, 402, 403, 404, 405, 322, 323,
+ 336, 337, 338, 339, 340, 341, 354, 355, 356, 357, 358, 359, 372, 373, 374, 375, 376, 377, 390, 391,
+ 392, 393, 394, 395, 408, 409, 410, 411, 400, 401, 414, 415, 416, 417, 418, 419, 432, 433, 434, 435,
+ 436, 437, 450, 451, 452, 453, 454, 455, 468, 469, 470, 471, 472, 473, 486, 487, 488, 489, 490, 491,
+ 504, 505, 506, 507, 508, 509, 522, 523, 524, 525, 526, 527, 540, 541, 542, 543, 544, 545, 558, 559,
+ 560, 561, 562, 563, 406, 407, 420, 421, 422, 423, 424, 425, 438, 439, 440, 441, 442, 443, 456, 457,
+ 458, 459, 460, 461, 474, 475, 476, 477, 478, 479, 492, 493, 494, 495, 496, 497, 510, 511, 512, 513,
+ 514, 515, 528, 529, 530, 531, 532, 533, 546, 547, 548, 549, 550, 551, 564, 565, 566, 567, 568, 569,
+ 412, 413, 426, 427, 428, 429, 430, 431, 444, 445, 446, 447, 448, 449, 462, 463, 464, 465, 466, 467,
+ 480, 481, 482, 483, 484, 485, 498, 499, 500, 501, 502, 503, 516, 517, 518, 519, 520, 521, 534, 535,
+ 536, 537, 538, 539, 552, 553, 554, 555, 556, 557, 570, 571, 572, 573, 574, 575},
+
+{ 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 4, 5, 18, 19, 10, 11, 24, 25,
+ 16, 17, 30, 31, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39,
+ 42, 43, 44, 45, 48, 49, 50, 51, 40, 41, 54, 55, 56, 57, 46, 47, 60, 61, 62, 63,
+ 52, 53, 66, 67, 68, 69, 58, 59, 72, 73, 74, 75, 64, 65, 78, 79, 80, 81, 70, 71,
+ 84, 85, 86, 87, 76, 77, 90, 91, 92, 93, 94, 95, 108, 109, 82, 83, 96, 97, 98, 99,
+ 100, 101, 114, 115, 88, 89, 102, 103, 104, 105, 106, 107, 120, 121, 110, 111, 112, 113, 126, 127,
+ 128, 129, 130, 131, 144, 145, 116, 117, 118, 119, 132, 133, 134, 135, 136, 137, 150, 151, 122, 123,
+ 124, 125, 138, 139, 140, 141, 142, 143, 156, 157, 146, 147, 148, 149, 162, 163, 164, 165, 166, 167,
+ 180, 181, 182, 183, 152, 153, 154, 155, 168, 169, 170, 171, 172, 173, 186, 187, 188, 189, 158, 159,
+ 160, 161, 174, 175, 176, 177, 178, 179, 192, 193, 194, 195, 184, 185, 198, 199, 200, 201, 202, 203,
+ 216, 217, 218, 219, 220, 221, 234, 235, 190, 191, 204, 205, 206, 207, 208, 209, 222, 223, 224, 225,
+ 226, 227, 240, 241, 196, 197, 210, 211, 212, 213, 214, 215, 228, 229, 230, 231, 232, 233, 246, 247,
+ 236, 237, 238, 239, 252, 253, 254, 255, 256, 257, 270, 271, 272, 273, 274, 275, 288, 289, 290, 291,
+ 242, 243, 244, 245, 258, 259, 260, 261, 262, 263, 276, 277, 278, 279, 280, 281, 294, 295, 296, 297,
+ 248, 249, 250, 251, 264, 265, 266, 267, 268, 269, 282, 283, 284, 285, 286, 287, 300, 301, 302, 303,
+ 292, 293, 306, 307, 308, 309, 310, 311, 324, 325, 326, 327, 328, 329, 342, 343, 344, 345, 346, 347,
+ 360, 361, 362, 363, 364, 365, 298, 299, 312, 313, 314, 315, 316, 317, 330, 331, 332, 333, 334, 335,
+ 348, 349, 350, 351, 352, 353, 366, 367, 368, 369, 370, 371, 304, 305, 318, 319, 320, 321, 322, 323,
+ 336, 337, 338, 339, 340, 341, 354, 355, 356, 357, 358, 359, 372, 373, 374, 375, 376, 377, 378, 379,
+ 380, 381, 382, 383, 396, 397, 398, 399, 400, 401, 414, 415, 416, 417, 418, 419, 432, 433, 434, 435,
+ 436, 437, 450, 451, 452, 453, 454, 455, 468, 469, 470, 471, 472, 473, 486, 487, 488, 489, 490, 491,
+ 504, 505, 506, 507, 508, 509, 522, 523, 524, 525, 526, 527, 540, 541, 542, 543, 544, 545, 558, 559,
+ 560, 561, 562, 563, 384, 385, 386, 387, 388, 389, 402, 403, 404, 405, 406, 407, 420, 421, 422, 423,
+ 424, 425, 438, 439, 440, 441, 442, 443, 456, 457, 458, 459, 460, 461, 474, 475, 476, 477, 478, 479,
+ 492, 493, 494, 495, 496, 497, 510, 511, 512, 513, 514, 515, 528, 529, 530, 531, 532, 533, 546, 547,
+ 548, 549, 550, 551, 564, 565, 566, 567, 568, 569, 390, 391, 392, 393, 394, 395, 408, 409, 410, 411,
+ 412, 413, 426, 427, 428, 429, 430, 431, 444, 445, 446, 447, 448, 449, 462, 463, 464, 465, 466, 467,
+ 480, 481, 482, 483, 484, 485, 498, 499, 500, 501, 502, 503, 516, 517, 518, 519, 520, 521, 534, 535,
+ 536, 537, 538, 539, 552, 553, 554, 555, 556, 557, 570, 571, 572, 573, 574, 575},
+
+{ 0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 4, 5, 18, 19, 10, 11, 24, 25,
+ 16, 17, 30, 31, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39,
+ 42, 43, 44, 45, 48, 49, 50, 51, 40, 41, 54, 55, 56, 57, 46, 47, 60, 61, 62, 63,
+ 52, 53, 66, 67, 68, 69, 58, 59, 72, 73, 74, 75, 76, 77, 64, 65, 78, 79, 80, 81,
+ 82, 83, 70, 71, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 108, 109, 110, 111,
+ 112, 113, 96, 97, 98, 99, 100, 101, 114, 115, 116, 117, 118, 119, 102, 103, 104, 105, 106, 107,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 144, 145, 146, 147, 148, 149, 162, 163,
+ 164, 165, 132, 133, 134, 135, 136, 137, 150, 151, 152, 153, 154, 155, 168, 169, 170, 171, 138, 139,
+ 140, 141, 142, 143, 156, 157, 158, 159, 160, 161, 174, 175, 176, 177, 166, 167, 180, 181, 182, 183,
+ 184, 185, 198, 199, 200, 201, 202, 203, 216, 217, 218, 219, 220, 221, 172, 173, 186, 187, 188, 189,
+ 190, 191, 204, 205, 206, 207, 208, 209, 222, 223, 224, 225, 226, 227, 178, 179, 192, 193, 194, 195,
+ 196, 197, 210, 211, 212, 213, 214, 215, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+ 252, 253, 254, 255, 256, 257, 270, 271, 272, 273, 274, 275, 288, 289, 290, 291, 292, 293, 306, 307,
+ 240, 241, 242, 243, 244, 245, 258, 259, 260, 261, 262, 263, 276, 277, 278, 279, 280, 281, 294, 295,
+ 296, 297, 298, 299, 312, 313, 246, 247, 248, 249, 250, 251, 264, 265, 266, 267, 268, 269, 282, 283,
+ 284, 285, 286, 287, 300, 301, 302, 303, 304, 305, 318, 319, 308, 309, 310, 311, 324, 325, 326, 327,
+ 328, 329, 342, 343, 344, 345, 346, 347, 360, 361, 362, 363, 364, 365, 378, 379, 380, 381, 382, 383,
+ 396, 397, 398, 399, 400, 401, 314, 315, 316, 317, 330, 331, 332, 333, 334, 335, 348, 349, 350, 351,
+ 352, 353, 366, 367, 368, 369, 370, 371, 384, 385, 386, 387, 388, 389, 402, 403, 404, 405, 406, 407,
+ 320, 321, 322, 323, 336, 337, 338, 339, 340, 341, 354, 355, 356, 357, 358, 359, 372, 373, 374, 375,
+ 376, 377, 390, 391, 392, 393, 394, 395, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
+ 432, 433, 434, 435, 436, 437, 450, 451, 452, 453, 454, 455, 468, 469, 470, 471, 472, 473, 486, 487,
+ 488, 489, 490, 491, 504, 505, 506, 507, 508, 509, 522, 523, 524, 525, 526, 527, 420, 421, 422, 423,
+ 424, 425, 438, 439, 440, 441, 442, 443, 456, 457, 458, 459, 460, 461, 474, 475, 476, 477, 478, 479,
+ 492, 493, 494, 495, 496, 497, 510, 511, 512, 513, 514, 515, 528, 529, 530, 531, 532, 533, 426, 427,
+ 428, 429, 430, 431, 444, 445, 446, 447, 448, 449, 462, 463, 464, 465, 466, 467, 480, 481, 482, 483,
+ 484, 485, 498, 499, 500, 501, 502, 503, 516, 517, 518, 519, 520, 521, 534, 535, 536, 537, 538, 539,
+ 540, 541, 542, 543, 544, 545, 558, 559, 560, 561, 562, 563, 546, 547, 548, 549, 550, 551, 564, 565,
+ 566, 567, 568, 569, 552, 553, 554, 555, 556, 557, 570, 571, 572, 573, 574, 575}
+}};
+
+#endif
diff --git a/setedit/mp3/libamp/obj/delete.me b/setedit/mp3/libamp/obj/delete.me
new file mode 100644
index 0000000..7d65639
--- /dev/null
+++ b/setedit/mp3/libamp/obj/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/mp3/libamp/position.c b/setedit/mp3/libamp/position.c
new file mode 100644
index 0000000..005f430
--- /dev/null
+++ b/setedit/mp3/libamp/position.c
@@ -0,0 +1,101 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+/* position.c ffwd/rew within a stream
+ *
+ * Creted by: Tomislav Uzelac, May 10 1997
+ */
+#include "amp.h"
+#include "audio.h"
+#include "getbits.h"
+
+#define POSITION
+#include "position.h"
+
+/* Returns the number of frames actually skipped, -1 on error.
+ *
+ * Values in header are not changed if retval!=nframes.
+ * This is not necessary because gethdr() doesn't clobber
+ * the contents of header, but I don't want to rely on that.
+ */
+int ffwd(struct AUDIO_HEADER *header, int nframes)
+{
+int cnt=0,g;
+int hsize,bitrate,fs,mean_frame_size;
+struct AUDIO_HEADER tmp;
+ memcpy(&tmp,header,sizeof(tmp));
+
+ while (cnt < nframes) {
+ if (tmp.ID)
+ if (tmp.mode==3) hsize=21;
+ else hsize=36;
+ else
+ if (tmp.mode==3) hsize=13;
+ else hsize=21;
+ if (tmp.protection_bit==0) hsize+=2;
+ if ((g=dummy_getinfo(hsize))) /* dummy_getinfo: reads hsize-4 bytes */
+ switch (g) {
+ case GETHDR_EOF: return cnt;
+ case GETHDR_ERR:
+ default: return -1;
+ }
+
+ bitrate=t_bitrate[tmp.ID][3-tmp.layer][tmp.bitrate_index];
+ fs=t_sampling_frequency[tmp.ID][tmp.sampling_frequency];
+ if (tmp.ID) mean_frame_size=144000*bitrate/fs;
+ else mean_frame_size=72000*bitrate/fs;
+ fillbfr(mean_frame_size + tmp.padding_bit - hsize);
+
+ if ((g=gethdr(&tmp)))
+ switch (g) {
+ case GETHDR_EOF: return cnt;
+ case GETHDR_ERR:
+ default: return -1;
+ }
+ cnt++;
+ }
+
+ memcpy(header,&tmp,sizeof(tmp));
+ return cnt;
+}
+
+/* Mostly the same as ffwd. Some streams might be 'tough', i.e.
+ * the ones switching bitrates.
+ */
+int rew(struct AUDIO_HEADER *header, int nframes)
+{
+int cnt=0;
+int bitrate,fs,mean_frame_size;
+struct AUDIO_HEADER tmp;
+ memcpy(&tmp,header,sizeof(tmp));
+
+ while (cnt < nframes) {
+ /* ffwd/rew functions are to be called right after the header has been parsed
+ * so we have to go back one frame + 4 bytes + 1 byte (in case padding was used).
+ */
+ bitrate=t_bitrate[tmp.ID][3-tmp.layer][tmp.bitrate_index];
+ fs=t_sampling_frequency[tmp.ID][tmp.sampling_frequency];
+ if (tmp.ID) mean_frame_size=144000*bitrate/fs;
+ else mean_frame_size=72000*bitrate/fs;
+
+ if (rewind_stream(mean_frame_size) !=0) {
+ memcpy(header,&tmp,sizeof(tmp));
+ return cnt;
+ }
+ if ((gethdr(&tmp))) return -1;
+ cnt++;
+ }
+ /* We have to make sure that the bit reservoir contains enough data.
+ * Hopefully, layer3_frame will take care of that.
+ */
+ f_bdirty=TRUE;
+ bclean_bytes=0;
+
+ memcpy(header,&tmp,sizeof(tmp));
+ return cnt;
+}
+
+/* TODO: after the gethdr function is enhanced with the counter to count
+ * the number of bytes to search for the next syncword, make the call to
+ * gethdr() from rew() have that counter something like (frame_size-1) so
+ * that we don't go back again and again to the same header. (not very important)
+ */
diff --git a/setedit/mp3/libamp/position.h b/setedit/mp3/libamp/position.h
new file mode 100644
index 0000000..cce0856
--- /dev/null
+++ b/setedit/mp3/libamp/position.h
@@ -0,0 +1,10 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+extern int ffwd(struct AUDIO_HEADER *header, int nframes);
+extern int rew(struct AUDIO_HEADER *header, int nframes);
+
+#ifdef POSITION
+int ffwd(struct AUDIO_HEADER *header, int nframes);
+int rew(struct AUDIO_HEADER *header, int nframes);
+#endif
diff --git a/setedit/mp3/libamp/proto.h b/setedit/mp3/libamp/proto.h
new file mode 100644
index 0000000..43ad705
--- /dev/null
+++ b/setedit/mp3/libamp/proto.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* From: util.c */
+void die(char *, ...);
+void warn(char *, ...);
+void msg(char *, ...);
+void debugSetup(char *);
+void debugOptions();
+
+/* From: audioIO_<OSTYPE>.c */
+void audioOpen(int frequency, int stereo, int volume);
+void audioSetVolume(int);
+void audioFlush();
+void audioClose();
+int audioWrite(char *, int);
+int getAudioFd();
+void audioBufferOn(int);
+
+/* From: buffer.c */
+void printout(void);
+int audioBufferOpen(int, int, int);
+void audioBufferClose();
+void audioBufferWrite(char *, int);
+void audioBufferFlush();
+
+/* From: audio.c */
+void displayUsage();
diff --git a/setedit/mp3/libamp/readme b/setedit/mp3/libamp/readme
new file mode 100644
index 0000000..3717c62
--- /dev/null
+++ b/setedit/mp3/libamp/readme
@@ -0,0 +1,139 @@
+amp MPEG audio decoder readme file (version 0.7.5)
+(C) Tomislav Uzelac 1996,1997
+
+amp is free software and can be _used_ freely by anyone. If you want to
+do anything else with it, be sure to check the Legal section of this
+document for legal issues.
+
+THERE IS NO WARRANTY FOR THIS PROGRAM. Please check out the Legal section
+of this document.
+
+1. Introduction
+2. Installation
+3. Running
+4. Feedback
+5. Contributing
+6. Legal
+
+
+1. Introduction
+
+amp (Audio Mpeg Player) is an MPEG audio decoder which I originally started
+putting together as a side project of the MPEG hardware design project at
+FER/Zagreb - just to confirm my knowledge of the standard. It works with
+both MPEG1 and MPEG2 audio streams (except for the multichannel extensions
+defined in MPEG2), layers 2 and 3.
+
+There is a gui for amp, written in Tcl/Tk by Edouard Lafargue. It is
+available at the amp home site ftp://ftp.rasip.fer.hr
+
+Another gui supported is the Sajber Jukebox, written by Joel Lindholm.
+
+The following people contributed their time and knowledge to amp:
+Karl Anders Oygard, Ilkka Karvinen, Lutz Vieweg, Dan Nelson,
+Edouard Lafargue, Andrew Richards, George Colouris,
+Dmitry Boldyrev, Andy Lo A Foe, Thomas Sailer, Justin Frankel
+
+amp home location is
+ ftp://ftp.rasip.fer.hr/pub/mpeg/
+
+and the mailing list: send 'HELP' in the body of the message to:
+ multimedia@rasip.fer.hr
+
+If you want to find out more about MPEG, best places to start are
+ http://www.mpeg.org
+ http://www.mpeg2.de
+
+
+2. Installation
+
+Installation should be simple enough if amp was ported to your system,
+just do a
+
+./configure
+make
+
+You can edit the makefile further to suit your system. If configure fails
+to make a usable Makefile, you'll _have_ to edit it yourself.
+
+Linux users should try real-time playing support, as described
+in doc/realtime.txt. Some people that might pass on this feature are
+those with slower machines (i.e. 486's), or SMP systems (see the
+doc/linuxrealtime.txt file).
+Some versions of the linux C library produce an error when compiling
+amp with realtime support. A quick fix is to edit /usr/include/sched.h
+and replace _P in the offending line with __P.
+
+./configure --enable-realtime
+make
+chown root.root amp
+chmod u+s amp
+
+... this requires /dev/dsp to be both world readable and writeable. If you
+have a special group for people allowed to use the sound device (for
+instance, a group called sound), you can do a:
+
+chmod g+s amp
+
+or make your audio card world read/writeable (not recomended)
+
+chmod o+rw /dev/dsp*
+
+3. Running:
+
+'amp -h' gives you usage & options. If your computer is on the slower
+side, direct playback might not work, but you can decode it
+to .wav or raw pcm and play it later.
+
+
+4. Feedback
+
+Send in your makefiles, opinions, bugreports, fixes; anything related to this
+program. You can also send me unlimited amounts of money, sugar, milk, etc.
+
+If you find any mpeg audio files that amp has trouble decoding, please tell
+me about this via e-mail <tuzelac@rasip.fer.hr>.
+
+
+5. Contributing
+
+Please contribute to amp. If you want to know what is going on in amp
+development, you can join the developers mailing list
+
+ mpeg_audio_developers@rasip.fer.hr
+
+There are certain debugging facilities that I made in amp, but are disabled
+in the current release (they are neither nice nor user-friendly). If anyone
+enhances them (they are in dump.c) to the point that they're actually
+usable I'll be happy to include the changes in the release. I think this
+kind of debug output would be very useful to people studying these audio
+algorithms.
+
+
+6. Legal
+
+This software can be used freely for any purpose. It can be distributed
+freely, as long as it is not sold commercially without permission from
+Tomislav Uzelac <tuzelac@rasip.fer.hr>. However, including this software
+on CD_ROMs containing other free software is explicitly permitted even
+when a modest distribution fee is charged for the CD, as long as this
+software is not a primary selling argument for the CD.
+
+Building derived versions of this software is permitted, as long as they
+are not sold commercially without permission from Tomislav Uzelac
+<tuzelac@rasip.fer.hr>. Any derived versions must be clearly marked as
+such, and must be called by a name other than amp. Any derived versions
+must retain this copyright notice.
+
+/* This license is itself copied from Tatu Ylonen's ssh package. It does
+ * not mention being copyrighted itself :)
+ */
+
+THERE IS NO WARRANTY FOR THIS PROGRAM - whatsoever. You use it entirely
+at your risk, and neither Tomislav Uzelac, nor FER will be liable for
+any damages that might occur to your computer, software, etc. in
+consequence of you using this freeware program.
+
+
+Tomislav Uzelac
+<tuzelac@rasip.fer.hr>
diff --git a/setedit/mp3/libamp/readme.txt b/setedit/mp3/libamp/readme.txt
new file mode 100644
index 0000000..e7ee0ca
--- /dev/null
+++ b/setedit/mp3/libamp/readme.txt
@@ -0,0 +1,41 @@
+LibAmp 0.2
+
+Based on Amp 0.7.6 by Tomislav Uzelac
+
+Ported to DJGPP/Allegro and turned into library form by Ove Kaaven
+ <ovek@arcticnet.no>
+(the direct Amp port can be made with: make -f makefile.amp)
+
+To use, #include "libamp.h" into your program and link with -lamp
+(Beware of name clashes between routines in this library and your program,
+ there is potentially some serious name space pollution here.)
+
+See the demo MP3 player libdemo.c for an example.
+(You're welcome to write a better player if you wish.)
+
+New in LibAmp 0.2
+ amp_reverse_phase, enables the classic 3D effect
+ volume slider in libdemo
+
+Notes:
+ #defines in audioalg.c
+
+ TRACK_FRAME is useful for players that want to show real-time scopes
+ (like libdemo), but is otherwise unnecessary and just wastes CPU time
+ and RAM. You may want to undefine it if you don't need it.
+
+ STREAM_SAMP is how big the Allegro stream buffer size should be.
+ Increase it if the playback becomes jerky due to run_amp() or poll_amp()
+ not being called often enough to supply the stream with data often enough.
+
+ BUF_SAMP is how big the internal audio buffer size should be.
+ It *must* be a multiple of 2*576 *and* a multiple of STREAM_SAMP for
+ proper operation. run_amp() will try to fill it up completely, so if
+ the buffer is big, it may spend some time on first call after load or
+ seek.
+
+ UPD_SAMP is with what resolution amp_play_left and amp_play_right is
+ updated to provide real-time scope functionality. amp_play_len will
+ be set to this value. STREAM_SAMP must be a multiple of this value.
+ It is only meaningful if TRACK_FRAME is defined.
+
diff --git a/setedit/mp3/libamp/rhide.env b/setedit/mp3/libamp/rhide.env
new file mode 100644
index 0000000..1ecc543
--- /dev/null
+++ b/setedit/mp3/libamp/rhide.env
@@ -0,0 +1,21 @@
+#
+# Automatically generated by configure script
+#
+
+RHIDE_GCC=gcc
+RHIDE_GXX=g++
+RHIDE_LD=g++
+RHIDE_AR=ar
+RHIDE_OS_CFLAGS=-O3 -fomit-frame-pointer -ffast-math -pipe
+RHIDE_OS_CXXFLAGS=-O3 -fomit-frame-pointer -ffast-math -pipe
+RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib ../libmigdb/src $(TVISION_INC)/cl
+RHIDE_OS_LIBS=-lrhtv -ldl -lbz2 -lmpegsnd -laa -lz -lpcre -lmigdb
+RHIDE_OS_LIBS_PATH=-L/usr/lib -L/home/sergej/community-my.svn/tvision/trunk/src/tvision/makes -L/usr/X11R6/lib -L../libmigdb/src -L.
+TVISION_INC=/usr/include/rhtvision
+SUPPORT_INC= ../libmigdb/src
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+STDCPP_LIB=-lstdc++
+RHIDE_LIBS=$(LIBS) $(RHIDE_OS_LIBS)
+RHIDE_LIBDIRS=$(LIB_DIRS)
diff --git a/setedit/mp3/libamp/rtbuf.c b/setedit/mp3/libamp/rtbuf.c
new file mode 100644
index 0000000..3319066
--- /dev/null
+++ b/setedit/mp3/libamp/rtbuf.c
@@ -0,0 +1,535 @@
+/*****************************************************************************/
+
+/*
+ * rtbuf.c -- Linux realtime audio output.
+ *
+ * Copyright (C) 1996 Thomas Sailer (sailer@ife.ee.ethz.ch)
+ * Swiss Federal Institute of Technology (ETH), Electronics Lab
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * This is the Linux realtime sound output driver
+ */
+
+/*****************************************************************************/
+
+#include "amp.h"
+#include "transform.h"
+#include "audio.h"
+#include "getbits.h"
+#include "layer3.h"
+
+#define RTBUF
+#include "rtbuf.h"
+
+#ifdef LINUX_REALTIME
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/soundcard.h>
+#include <sys/time.h>
+#include <sched.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <sys/user.h>
+
+
+static int audio_fd;
+static struct audio_buf_info abinfo;
+static caddr_t abuf;
+static unsigned int abuf_wptr;
+static unsigned int abuf_sz;
+
+static struct count_info cinfo;
+
+#define IBUFSZ 65520
+
+typedef volatile int atomic_t;
+
+static struct ibuf {
+ atomic_t rdptr;
+ atomic_t wrptr;
+ unsigned char buf[IBUFSZ];
+} *ibuf;
+
+#define atomic_set(x,y) x = y
+#define atomic_read(x) (x)
+
+static pid_t bufproc;
+
+
+/* --------------------------------------------------------------------- */
+
+int prefetch_get_input(unsigned char *bp, int bytes)
+{
+ unsigned int rd, wr, rem, u;
+ int stat;
+ pid_t ret;
+
+ rd = atomic_read(ibuf->rdptr);
+ wr = atomic_read(ibuf->wrptr);
+ rem = (IBUFSZ+wr-rd) % IBUFSZ;
+ if (bytes > rem) {
+ /* TODO: figure out the best way to find out whether it was an
+ * error or an eof. bufproc exit ststus?
+ */
+ ret = wait4(bufproc, &stat, WNOHANG, NULL);
+ /*
+ if (ret != (pid_t)-1 && ret == bufproc) {
+ bufproc = (pid_t) -1;
+#if 0
+ printf("prefetch_get_input(): Terminating");
+#endif
+ } else
+ fprintf(stderr, "get_input: Underrun\n");
+ snd_eof = 1;
+ */
+ if (ret!=0)
+ bufproc = (pid_t) -1;
+ else
+ fprintf(stderr, "get_input: Underrun\n");
+
+ memset(bp, 0, bytes);
+ return -1;
+ }
+ u = IBUFSZ-rd;
+ if (bytes >= u) {
+ memcpy(bp, ibuf->buf+rd, u);
+ bp += u;
+ rd = 0;
+ bytes -= u;
+ }
+ if (bytes > 0) {
+ memcpy(bp, ibuf->buf+rd, bytes);
+ rd += bytes;
+ }
+ atomic_set(ibuf->rdptr, rd);
+ return 0;
+}
+
+/* --------------------------------------------------------------------- */
+
+static void child(char *file)
+{
+ int fd, i;
+ unsigned int rd, wr, free;
+
+ /*
+ * release superuser priority
+ */
+ setreuid(getuid(), getuid());
+ /*
+ * open file
+ */
+ if ((fd = open(file, O_RDONLY, 0)) < 0) {
+ fprintf(stderr, "Cannot open file \"%s\"\n", file);
+ return;
+ }
+ for (;;) {
+ rd = atomic_read(ibuf->rdptr);
+ wr = atomic_read(ibuf->wrptr);
+ free = (IBUFSZ + rd - wr - 1) % IBUFSZ;
+ if (free <= 0) {
+ usleep(100000L);
+ } else {
+ if (free > 4096)
+ free = 4096;
+ i = read(fd, ibuf->buf+wr,
+ (wr + free > IBUFSZ) ? IBUFSZ-wr : free);
+ if (i == -1) {
+ perror("read");
+ close(fd);
+ return;
+ }
+ if (i == 0)
+ break;
+ wr += i;
+ if (wr >= IBUFSZ)
+ wr = 0;
+ atomic_set(ibuf->wrptr, wr);
+#if 0
+ fprintf(stderr, "buffer fill: wr: %d rd: %d\n", wr, rd);
+ fflush(stderr);
+#endif
+ }
+ }
+ close(fd);
+}
+
+
+/* --------------------------------------------------------------------- */
+
+int rt_play(char *file)
+{
+ pid_t playproc;
+ int i;
+
+ /*
+ * this fork enables us to run both the buffering
+ * process and the decoding/play process to run at
+ * user privileges while retaining superuser privileges
+ * for subsequent files. This should minimize security
+ * problems
+ */
+ switch (playproc = fork()) {
+ case -1:
+ perror("fork");
+ return -1;
+
+ case 0:
+ break;
+
+ default:
+#if 0
+ fprintf(stderr, "Play task PID: %d\n", playproc);
+ fflush(stderr);
+#endif
+ wait4(playproc, &i, 0, NULL);
+ return i;
+ }
+ /*
+ * allocate the communication buffer between the
+ * prefetch and the decode processes
+ */
+#if 0
+ ibuf = (struct ibuf *)mmap(NULL, sizeof(struct ibuf), PROT_READ|PROT_WRITE,
+ MAP_SHARED|MAP_ANON, -1, 0);
+ if (ibuf == (struct ibuf *)-1) {
+ perror("mmap: shared anonymous memory");
+ exit(-1);
+ }
+#else
+ if ((i = shmget(IPC_PRIVATE, /*SHMLBA*/sizeof(struct ibuf),
+ IPC_CREAT | IPC_EXCL | 0600)) < 0) {
+ perror("shmget");
+ exit(-1);
+ }
+ if ((ibuf = (struct ibuf *)shmat(i, NULL, 0)) == (struct ibuf *)-1) {
+ perror("shmat");
+ exit(-1);
+ }
+ if (shmctl(i, IPC_RMID, NULL)) {
+ perror("shmctl");
+ exit(-1);
+ }
+#endif
+ atomic_set(ibuf->rdptr, 0);
+ atomic_set(ibuf->wrptr, 0);
+ /*
+ * lock memory down
+ */
+ if (mlockall(MCL_CURRENT) == -1)
+ perror("mlockall");
+ /*
+ * fork the prefetch process
+ */
+ switch (bufproc = fork()) {
+ case 0:
+ child(file);
+ exit(0);
+
+ case -1:
+ perror("fork");
+ if (munlockall() == -1)
+ perror("munlockall");
+ exit(-1);
+
+ default:
+#if 0
+ fprintf(stderr, "Buffering task PID: %d\n", bufproc);
+ fflush(stderr);
+#endif
+ audio_fd = -1;
+ //decoder_process();
+ decodeMPEG();
+ if (audio_fd != -1)
+ close(audio_fd);
+ if (bufproc != (pid_t)-1) {
+ /* TODO: think of something nicer here. This is really a quick
+ * workaround. The reason is that if gethdr() returns GETHDR_NS
+ * we just don't know if bufproc exited.
+ */
+ if (kill(bufproc, SIGTERM) == -1)
+ /*perror("kill")*/;
+ if (wait4(bufproc, NULL, 0, NULL) == (pid_t)-1)
+ /*perror("wait4")*/;
+ }
+ break;
+ }
+ if (munlockall() == -1)
+ /*perror("munlockall")*/;
+ exit(0);
+}
+
+/* --------------------------------------------------------------------- */
+
+void rt_printout(short *sbuf, int ln)
+{
+ int rem = abuf_sz - abuf_wptr;
+
+ if (ln >= rem) {
+ memcpy((void *)(abuf + abuf_wptr), sbuf, rem);
+ (unsigned char *)sbuf += rem;
+ abuf_wptr = 0;
+ ln -= rem;
+ }
+ if (ln > 0) {
+ memcpy((void *)(abuf + abuf_wptr), sbuf, ln);
+ abuf_wptr += ln;
+ }
+}
+
+/* --------------------------------------------------------------------- */
+
+int setup_fancy_audio(struct AUDIO_HEADER *mpegheader)
+{
+int apar;
+
+ /*
+ * open the audio device
+ * Don't use O_WRONLY, as the following mmap will fail with permission error!
+ */
+ if ((audio_fd = open("/dev/dsp", O_RDWR, 0)) < 0) {
+ perror("open /dev/dsp");
+ return -1;
+ }
+
+ /*
+ * configure audio
+ */
+ apar = AFMT_S16_LE;
+ if (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_SETFMT");
+ return -1;
+ }
+ if (apar != AFMT_S16_LE) {
+ fprintf(stderr, "16 bit format not supported\n");
+ return -1;
+ }
+ apar = ((mpegheader->mode != 3) && !A_DOWNMIX);
+ if (ioctl(audio_fd, SNDCTL_DSP_STEREO, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_STEREO");
+ return -1;
+ }
+ if (apar != ((mpegheader->mode != 3)&& !A_DOWNMIX)) {
+ fprintf(stderr, "%s not supported\n",
+ (mpegheader->mode != 3) ? "stereo" : "mono");
+ return -1;
+ }
+ apar = t_sampling_frequency[mpegheader->ID][mpegheader->sampling_frequency];
+ if (ioctl(audio_fd, SNDCTL_DSP_SPEED, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_SPEED");
+ return -1;
+ }
+ if (apar != t_sampling_frequency[mpegheader->ID][mpegheader->sampling_frequency]) {
+ fprintf(stderr, "Warning: requested sampling rate %d does not "
+ "match effective %d\n",
+ t_sampling_frequency[mpegheader->ID][mpegheader->sampling_frequency],
+ apar);
+ }
+
+ /* volume A_SET_VOLUME */
+ /*
+ * determine if the driver is capable to support our access method
+ */
+ if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_GETCAPS");
+ return -1;
+ }
+ if (!(apar & DSP_CAP_TRIGGER) || !(apar & DSP_CAP_MMAP)) {
+ fprintf(stderr, "Sound driver does not support mmap and/or trigger\n");
+ return -1;
+ }
+
+ /*
+ * set fragment sizes
+ */
+ apar = 0xffff000d;
+ if (ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_SETFRAGMENT");
+ return -1;
+ }
+ if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &abinfo) == -1) {
+ perror("ioctl: SNDCTL_DSP_GETOSPACE");
+ return -1;
+ }
+ abuf_sz = abinfo.fragstotal * abinfo.fragsize;
+#if 0
+ fprintf(stderr, "OSS: # fragments: %d fragment size: %d total buffer size: %d\n",
+ abinfo.fragstotal, abinfo.fragsize, abuf_sz);
+#endif
+
+ /*
+ * mmap buffer
+ * BSD people attention: you may need to uncomment the PROT_READ
+ * feedback welcome: sailer@ife.ee.ethz.ch
+ */
+ if ((abuf = mmap(NULL, abuf_sz, PROT_WRITE /* | PROT_READ*/, MAP_FILE | MAP_SHARED,
+ audio_fd, 0)) == (caddr_t)-1) {
+ perror("mmap");
+ return -1;
+ }
+
+ memset(abuf, 0, abinfo.fragstotal * abinfo.fragsize);
+ abuf_wptr = 0;
+ return 0;
+}
+
+int start_fancy_audio(struct AUDIO_HEADER *mpegheader)
+{
+int apar;
+ /*
+ * start audio device
+ */
+ /* cinfo.ptr = 0; is this one needed? */
+ apar = 0;
+ if (ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_SETTRIGGER");
+ return -1;
+ }
+ apar = PCM_ENABLE_OUTPUT;
+ if (ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_SETTRIGGER");
+ return -1;
+ }
+ return 0;
+}
+
+int stop_fancy_audio(void)
+{
+int apar;
+ apar = 0;
+ if (ioctl(audio_fd, SNDCTL_DSP_RESET, &apar) == -1) {
+ perror("ioctl: SNDCTL_DSP_RESET");
+ return -1;
+ }
+
+ return 0;
+}
+
+int block_fancy_audio(int snd_eof)
+{
+int i;
+struct fd_set wmask;
+struct timeval tm;
+
+ do {
+ FD_ZERO(&wmask);
+ FD_SET(audio_fd, &wmask);
+ tm.tv_sec = 10;
+ tm.tv_usec = 0;
+ i = select(audio_fd+1, NULL, &wmask, NULL, &tm);
+ if (i < 0) {
+ perror("select");
+ return -1;
+ }
+ if (i == 0) {
+ fprintf(stderr, "Sound output: timeout\n");
+ return -1;
+ }
+ if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &cinfo) == -1) {
+ perror("ioctl: SNDCTL_DSP_GETOPTR");
+ return -1;
+ }
+ } while (snd_eof && cinfo.ptr/abinfo.fragsize != abuf_wptr/abinfo.fragsize);
+
+ return 0;
+}
+
+int ready_fancy_audio(void)
+{
+int i = (abuf_sz + cinfo.ptr - abuf_wptr - 1) % abuf_sz;
+
+ if (i >= 2*sizeof sample_buffer)
+ return 1;
+ else
+ return 0;
+}
+
+void cleanup_fancy_audio(void)
+{
+ memset(abuf+abuf_wptr,0,abinfo.fragsize-(abuf_wptr%abinfo.fragsize));
+}
+
+int set_realtime_priority(void)
+{
+struct sched_param schp;
+ /*
+ * set the process to realtime privs
+ */
+ memset(&schp, 0, sizeof(schp));
+ schp.sched_priority = sched_get_priority_min(SCHED_RR);
+
+ if (sched_setscheduler(0, SCHED_RR, &schp) != 0) {
+ perror("sched_setscheduler");
+ return -1;
+ }
+
+ return 0;
+
+#if 0
+/*
+ Try to set the priority of this process to a value which
+ allows us to play without buffering, thus saving memory
+ and avoiding cache-misses.
+ If we cannot get any priority high enough to allow for
+ undisturbed replay (because we don't have sufficient
+ priviledges), return a zero, otherwise, return a one.
+*/
+
+ /* try to lock process in physical memory, just ignore if this
+ * fails
+ */
+ plock(PROCSHLIBLOCK);
+
+ /* try to set a realtime-priority of 64 */
+ if (-1 != rtprio(0, 64)) {
+ DB(audio, msg("using real-time priority\n"); )
+ return 0;
+ }
+
+ /* try to set a nice-level of -20 */
+ if (-1 != nice(-20)) {
+ DB(audio, msg("using nice-level -20\n"); )
+ return 0;
+ }
+
+ DB(audio, msg("using buffered output\n"); )
+
+ return -1;
+#endif
+}
+
+void prefetch_initial_fill(void)
+{
+int i;
+ while (atomic_read(ibuf->wrptr) < IBUFSZ/2) {
+ if (wait4(bufproc, &i, WNOHANG, NULL) == bufproc) {
+ break;
+ }
+ usleep(100000L);
+ }
+}
+
+#endif /* LINUX_REALTIME */
diff --git a/setedit/mp3/libamp/rtbuf.h b/setedit/mp3/libamp/rtbuf.h
new file mode 100644
index 0000000..de67400
--- /dev/null
+++ b/setedit/mp3/libamp/rtbuf.h
@@ -0,0 +1,63 @@
+/*****************************************************************************/
+
+/*
+ * rtbuf.h -- Linux realtime audio output.
+ *
+ * Copyright (C) 1996 Thomas Sailer (sailer@ife.ee.ethz.ch)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * This is the Linux realtime sound output driver
+ */
+
+/*****************************************************************************/
+
+#include "config.h"
+
+#ifndef HAVE_MLOCKALL
+#undef LINUX_REALTIME
+#endif
+
+#ifndef HAVE_SCHED_SETSCHEDULER
+#undef LINUX_REALTIME
+#endif
+
+#if 0
+#ifndef _POSIX_MEMLOCK
+#undef LINUX_REALTIME
+#endif
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#undef LINUX_REALTIME
+#endif
+#endif
+
+#ifdef LINUX_REALTIME
+
+int prefetch_get_input(unsigned char *bp, int bytes);
+int rt_play(char *file);
+void rt_printout(short *sbuf, int ln);
+int setup_fancy_audio(struct AUDIO_HEADER *mpegheader);
+int start_fancy_audio(struct AUDIO_HEADER *mpegheader);
+int stop_fancy_audio(void);
+int block_fancy_audio(int snd_eof);
+int ready_fancy_audio(void);
+void cleanup_fancy_audio(void);
+void prefetch_initial_fill(void);
+int set_realtime_priority(void);
+
+#endif /* LINUX_REALTIME */
+
diff --git a/setedit/mp3/libamp/transfor.c b/setedit/mp3/libamp/transfor.c
new file mode 100644
index 0000000..9af5765
--- /dev/null
+++ b/setedit/mp3/libamp/transfor.c
@@ -0,0 +1,1521 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* transform.c imdct and polyphase(DCT) transforms
+ *
+ * Created by: tomislav uzelac May 1996
+ * Karl Anders Oygard optimized this for speed, Mar 13 97
+ * Some optimisations based on ideas from Michael Hipp's mpg123 package
+ */
+
+/*
+ * Comments for this file:
+ *
+ * The polyphase algorithm is clearly the most cpu consuming part of mpeg 1
+ * layer 3 decoding. Thus, there has been some effort to optimise this
+ * particular algorithm. Currently, everything has been kept in straight C
+ * with no assembler optimisations, but in order to provide efficient paths
+ * for different architectures, alternative implementations of some
+ * critical sections has been done. You may want to experiment with these,
+ * to see which suits your architecture better.
+ *
+ * Selection of the different implementations is done with the following
+ * defines:
+ *
+ * HAS_AUTOINCREMENT
+ *
+ * Define this if your architecture supports preincrementation of
+ * pointers when referencing (applies to e.g. 68k)
+ *
+ * For those who are optimising amp, check out the Pentium rdtsc code
+ * (define PENTIUM_RDTSC). This code uses the rdtsc counter for showing
+ * how many cycles are spent in different parts of the code.
+ */
+
+#include <math.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "audio.h"
+#include "getdata.h"
+#include "misc2.h"
+
+#define TRANSFORM
+#include "transform.h"
+
+#define PI12 0.261799387f
+#define PI36 0.087266462f
+
+void imdct_init()
+{
+ int i;
+
+ for(i=0;i<36;i++) /* 0 */
+ win[0][i] = (float) sin(PI36 *(i+0.5));
+ for(i=0;i<18;i++) /* 1 */
+ win[1][i] = (float) sin(PI36 *(i+0.5));
+ for(i=18;i<24;i++)
+ win[1][i] = 1.0f;
+ for(i=24;i<30;i++)
+ win[1][i] = (float) sin(PI12 *(i+0.5-18));
+ for(i=30;i<36;i++)
+ win[1][i] = 0.0f;
+ for(i=0;i<6;i++) /* 3 */
+ win[3][i] = 0.0f;
+ for(i=6;i<12;i++)
+ win[3][i] = (float) sin(PI12 * (i+ 0.5 - 6.0));
+ for(i=12;i<18;i++)
+ win[3][i] = 1.0f;
+ for(i=18;i<36;i++)
+ win[3][i] = (float) sin(PI36 * (i + 0.5));
+}
+
+/* This uses Byeong Gi Lee's Fast Cosine Transform algorithm to decompose
+ the 36 point and 12 point IDCT's into 9 point and 3 point IDCT's,
+ respectively. Then the 9 point IDCT is computed by a modified version of
+ Mikko Tommila's IDCT algorithm, based on the WFTA. See his comments
+ before the first 9 point IDCT. The 3 point IDCT is already efficient to
+ implement. -- Jeff Tsay. */
+/* I got the unrolled IDCT from Jeff Tsay; the code is presumably by
+ Francois-Raymond Boyer - I unrolled it a little further. tu */
+
+void imdct(int win_type,int sb,int ch)
+{
+/*------------------------------------------------------------------*/
+/* */
+/* Function: Calculation of the inverse MDCT */
+/* In the case of short blocks the 3 output vectors are already */
+/* overlapped and added in this modul. */
+/* */
+/* New layer3 */
+/* */
+/*------------------------------------------------------------------*/
+
+ float tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10, tmp11;
+
+ register float save;
+ float pp1, pp2;
+ float *win_bt;
+ int i, p, ss;
+ float *in = xr[ch][sb];
+ float *s_p = s[ch][sb];
+ float *res_p = res[sb];
+ float out[36];
+
+ if(win_type == 2){
+ for(p=0;p<36;p+=9) {
+ out[p] = out[p+1] = out[p+2] = out[p+3] =
+ out[p+4] = out[p+5] = out[p+6] = out[p+7] =
+ out[p+8] = 0.0f;
+ }
+
+ for(ss=0;ss<18;ss+=6) {
+
+ /*
+ * 12 point IMDCT
+ */
+
+ /* Begin 12 point IDCT */
+
+ /* Input aliasing for 12 pt IDCT */
+ in[5+ss]+=in[4+ss];in[4+ss]+=in[3+ss];in[3+ss]+=in[2+ss];
+ in[2+ss]+=in[1+ss];in[1+ss]+=in[0+ss];
+
+ /* Input aliasing on odd indices (for 6 point IDCT) */
+ in[5+ss] += in[3+ss]; in[3+ss] += in[1+ss];
+
+ /* 3 point IDCT on even indices */
+
+ pp2 = in[4+ss] * 0.500000000f;
+ pp1 = in[2+ss] * 0.866025403f;
+ save = in[0+ss] + pp2;
+ tmp1 = in[0+ss] - in[4+ss];
+ tmp0 = save + pp1;
+ tmp2 = save - pp1;
+
+ /* End 3 point IDCT on even indices */
+
+ /* 3 point IDCT on odd indices (for 6 point IDCT) */
+
+ pp2 = in[5+ss] * 0.500000000f;
+ pp1 = in[3+ss] * 0.866025403f;
+ save = in[1+ss] + pp2;
+ tmp4 = in[1+ss] - in[5+ss];
+ tmp5 = save + pp1;
+ tmp3 = save - pp1;
+
+ /* End 3 point IDCT on odd indices */
+
+ /* Twiddle factors on odd indices (for 6 point IDCT) */
+
+ tmp3 *= 1.931851653f;
+ tmp4 *= 0.707106781f;
+ tmp5 *= 0.517638090f;
+
+ /* Output butterflies on 2 3 point IDCT's (for 6 point IDCT) */
+
+ save = tmp0;
+ tmp0 += tmp5;
+ tmp5 = save - tmp5;
+
+ save = tmp1;
+ tmp1 += tmp4;
+ tmp4 = save - tmp4;
+
+ save = tmp2;
+ tmp2 += tmp3;
+ tmp3 = save - tmp3;
+
+ /* End 6 point IDCT */
+
+ /* Twiddle factors on indices (for 12 point IDCT) */
+
+ tmp0 *= 0.504314480f;
+ tmp1 *= 0.541196100f;
+ tmp2 *= 0.630236207f;
+ tmp3 *= 0.821339815f;
+ tmp4 *= 1.306562965f;
+ tmp5 *= 3.830648788f;
+
+ /* End 12 point IDCT */
+
+ /* Shift to 12 point modified IDCT, multiply by window type 2 */
+ tmp8 = tmp0 * -0.793353340f;
+ tmp9 = tmp0 * -0.608761429f;
+ tmp7 = tmp1 * -0.923879532f;
+ tmp10 = tmp1 * -0.382683432f;
+ tmp6 = tmp2 * -0.991444861f;
+ tmp11 = tmp2 * -0.130526192f;
+
+ tmp0 = tmp3;
+ tmp1 = tmp4 * 0.382683432f;
+ tmp2 = tmp5 * 0.608761429f;
+
+ tmp3 = tmp5 * -0.793353340f;
+ tmp4 = tmp4 * -0.923879532f;
+ tmp5 = tmp0 * -0.991444861f;
+
+ tmp0 *= 0.130526192f;
+
+ out[ss + 6] += tmp0;
+ out[ss + 7] += tmp1;
+ out[ss + 8] += tmp2;
+ out[ss + 9] += tmp3;
+ out[ss + 10] += tmp4;
+ out[ss + 11] += tmp5;
+ out[ss + 12] += tmp6;
+ out[ss + 13] += tmp7;
+ out[ss + 14] += tmp8;
+ out[ss + 15] += tmp9;
+ out[ss + 16] += tmp10;
+ out[ss + 17] += tmp11;
+
+ }
+ if (sb&1) {
+ for (i=0;i<18;i+=2) res_p[i]=out[i] + s_p[i];
+ for (i=1;i<18;i+=2) res_p[i]=-out[i] - s_p[i];
+ } else
+ for (i=0;i<18;i++) res_p[i]=out[i] + s_p[i];
+ for (i=18;i<36;i++) s_p[i-18]=out[i];
+
+ } else {
+/*
+ * 36 point IDCT ****************************************************************
+ */
+ float tmp[18];
+
+ /* input aliasing for 36 point IDCT */
+ in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14]; in[14]+=in[13];
+ in[13]+=in[12]; in[12]+=in[11]; in[11]+=in[10]; in[10]+=in[9];
+ in[9] +=in[8]; in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5];
+ in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2]; in[2] +=in[1];
+ in[1] +=in[0];
+
+ /* 18 point IDCT for odd indices */
+
+ /* input aliasing for 18 point IDCT */
+ in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9];
+ in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1];
+
+
+{
+ float tmp0,tmp1,tmp2,tmp3,tmp4,tmp0_,tmp1_,tmp2_,tmp3_;
+ float tmp0o,tmp1o,tmp2o,tmp3o,tmp4o,tmp0_o,tmp1_o,tmp2_o,tmp3_o;
+
+/* Fast 9 Point Inverse Discrete Cosine Transform
+//
+// By Francois-Raymond Boyer
+// mailto:boyerf@iro.umontreal.ca
+// http://www.iro.umontreal.ca/~boyerf
+//
+// The code has been optimized for Intel processors
+// (takes a lot of time to convert float to and from iternal FPU representation)
+//
+// It is a simple "factorization" of the IDCT matrix.
+*/
+ /* 9 point IDCT on even indices */
+ {
+ /* 5 points on odd indices (not realy an IDCT) */
+ float i0 = in[0]+in[0];
+ float i0p12 = i0 + in[12];
+
+ tmp0 = i0p12 + in[4]*1.8793852415718f + in[8]*1.532088886238f + in[16]*0.34729635533386f;
+ tmp1 = i0 + in[4] - in[8] - in[12] - in[12] - in[16];
+ tmp2 = i0p12 - in[4]*0.34729635533386f - in[8]*1.8793852415718f + in[16]*1.532088886238f;
+ tmp3 = i0p12 - in[4]*1.532088886238f + in[8]*0.34729635533386f - in[16]*1.8793852415718f;
+ tmp4 = in[0] - in[4] + in[8] - in[12] + in[16];
+ }
+ {
+ float i6_ = in[6]*1.732050808f;
+
+ tmp0_ = in[2]*1.9696155060244f + i6_ + in[10]*1.2855752193731f + in[14]*0.68404028665134f;
+ tmp1_ = (in[2] - in[10] - in[14])*1.732050808f;
+ tmp2_ = in[2]*1.2855752193731f - i6_ - in[10]*0.68404028665134f + in[14]*1.9696155060244f;
+ tmp3_ = in[2]*0.68404028665134f - i6_ + in[10]*1.9696155060244f - in[14]*1.2855752193731f;
+ }
+
+ /* 9 point IDCT on odd indices */
+ {
+ /* 5 points on odd indices (not realy an IDCT) */
+ float i0 = in[0+1]+in[0+1];
+ float i0p12 = i0 + in[12+1];
+
+ tmp0o = i0p12 + in[4+1]*1.8793852415718f + in[8+1]*1.532088886238f + in[16+1]*0.34729635533386f;
+ tmp1o = i0 + in[4+1] - in[8+1] - in[12+1] - in[12+1] - in[16+1];
+ tmp2o = i0p12 - in[4+1]*0.34729635533386f - in[8+1]*1.8793852415718f + in[16+1]*1.532088886238f;
+ tmp3o = i0p12 - in[4+1]*1.532088886238f + in[8+1]*0.34729635533386f - in[16+1]*1.8793852415718f;
+ tmp4o = (in[0+1] - in[4+1] + in[8+1] - in[12+1] + in[16+1])*0.707106781f; /* Twiddled */
+ }
+ {
+ /* 4 points on even indices */
+ float i6_ = in[6+1]*1.732050808f; /* Sqrt[3] */
+
+ tmp0_o = in[2+1]*1.9696155060244f + i6_ + in[10+1]*1.2855752193731f + in[14+1]*0.68404028665134f;
+ tmp1_o = (in[2+1] - in[10+1] - in[14+1])*1.732050808f;
+ tmp2_o = in[2+1]*1.2855752193731f - i6_ - in[10+1]*0.68404028665134f + in[14+1]*1.9696155060244f;
+ tmp3_o = in[2+1]*0.68404028665134f - i6_ + in[10+1]*1.9696155060244f - in[14+1]*1.2855752193731f;
+ }
+
+ /* Twiddle factors on odd indices
+ // and
+ // Butterflies on 9 point IDCT's
+ // and
+ // twiddle factors for 36 point IDCT
+ */
+ {
+ float e, o;
+ e = tmp0 + tmp0_; o = (tmp0o + tmp0_o)*0.501909918f; tmp[0] = (e + o)*(-0.500476342f*.5f); tmp[17] = (e - o)*(-11.46279281f*.5f);
+ e = tmp1 + tmp1_; o = (tmp1o + tmp1_o)*0.517638090f; tmp[1] = (e + o)*(-0.504314480f*.5f); tmp[16] = (e - o)*(-3.830648788f*.5f);
+ e = tmp2 + tmp2_; o = (tmp2o + tmp2_o)*0.551688959f; tmp[2] = (e + o)*(-0.512139757f*.5f); tmp[15] = (e - o)*(-2.310113158f*.5f);
+ e = tmp3 + tmp3_; o = (tmp3o + tmp3_o)*0.610387294f; tmp[3] = (e + o)*(-0.524264562f*.5f); tmp[14] = (e - o)*(-1.662754762f*.5f);
+ tmp[4] = (tmp4 + tmp4o)*(-0.541196100f); tmp[13] = (tmp4 - tmp4o)*(-1.306562965f);
+ e = tmp3 - tmp3_; o = (tmp3o - tmp3_o)*0.871723397f; tmp[5] = (e + o)*(-0.563690973f*.5f); tmp[12] = (e - o)*(-1.082840285f*.5f);
+ e = tmp2 - tmp2_; o = (tmp2o - tmp2_o)*1.183100792f; tmp[6] = (e + o)*(-0.592844523f*.5f); tmp[11] = (e - o)*(-0.930579498f*.5f);
+ e = tmp1 - tmp1_; o = (tmp1o - tmp1_o)*1.931851653f; tmp[7] = (e + o)*(-0.630236207f*.5f); tmp[10] = (e - o)*(-0.821339815f*.5f);
+ e = tmp0 - tmp0_; o = (tmp0o - tmp0_o)*5.736856623f; tmp[8] = (e + o)*(-0.678170852f*.5f); tmp[9] = (e - o)*(-0.740093616f*.5f);
+ }
+ }
+ /* shift to modified IDCT */
+ win_bt = win[win_type];
+
+ if (sb&1) {
+ res_p[0] = -tmp[9] * win_bt[0] + s_p[0];
+ res_p[1] =-(-tmp[10] * win_bt[1] + s_p[1]);
+ res_p[2] = -tmp[11] * win_bt[2] + s_p[2];
+ res_p[3] =-(-tmp[12] * win_bt[3] + s_p[3]);
+ res_p[4] = -tmp[13] * win_bt[4] + s_p[4];
+ res_p[5] =-(-tmp[14] * win_bt[5] + s_p[5]);
+ res_p[6] = -tmp[15] * win_bt[6] + s_p[6];
+ res_p[7] =-(-tmp[16] * win_bt[7] + s_p[7]);
+ res_p[8] = -tmp[17] * win_bt[8] + s_p[8];
+
+ res_p[9] = -(tmp[17] * win_bt[9] + s_p[9]);
+ res_p[10]= tmp[16] * win_bt[10] + s_p[10];
+ res_p[11]=-(tmp[15] * win_bt[11] + s_p[11]);
+ res_p[12]= tmp[14] * win_bt[12] + s_p[12];
+ res_p[13]=-(tmp[13] * win_bt[13] + s_p[13]);
+ res_p[14]= tmp[12] * win_bt[14] + s_p[14];
+ res_p[15]=-(tmp[11] * win_bt[15] + s_p[15]);
+ res_p[16]= tmp[10] * win_bt[16] + s_p[16];
+ res_p[17]=-(tmp[9] * win_bt[17] + s_p[17]);
+ } else {
+ res_p[0] = -tmp[9] * win_bt[0] + s_p[0];
+ res_p[1] = -tmp[10] * win_bt[1] + s_p[1];
+ res_p[2] = -tmp[11] * win_bt[2] + s_p[2];
+ res_p[3] = -tmp[12] * win_bt[3] + s_p[3];
+ res_p[4] = -tmp[13] * win_bt[4] + s_p[4];
+ res_p[5] = -tmp[14] * win_bt[5] + s_p[5];
+ res_p[6] = -tmp[15] * win_bt[6] + s_p[6];
+ res_p[7] = -tmp[16] * win_bt[7] + s_p[7];
+ res_p[8] = -tmp[17] * win_bt[8] + s_p[8];
+
+ res_p[9] = tmp[17] * win_bt[9] + s_p[9];
+ res_p[10]= tmp[16] * win_bt[10] + s_p[10];
+ res_p[11]= tmp[15] * win_bt[11] + s_p[11];
+ res_p[12]= tmp[14] * win_bt[12] + s_p[12];
+ res_p[13]= tmp[13] * win_bt[13] + s_p[13];
+ res_p[14]= tmp[12] * win_bt[14] + s_p[14];
+ res_p[15]= tmp[11] * win_bt[15] + s_p[15];
+ res_p[16]= tmp[10] * win_bt[16] + s_p[16];
+ res_p[17]= tmp[9] * win_bt[17] + s_p[17];
+ }
+
+ s_p[0]= tmp[8] * win_bt[18];
+ s_p[1]= tmp[7] * win_bt[19];
+ s_p[2]= tmp[6] * win_bt[20];
+ s_p[3]= tmp[5] * win_bt[21];
+ s_p[4]= tmp[4] * win_bt[22];
+ s_p[5]= tmp[3] * win_bt[23];
+ s_p[6]= tmp[2] * win_bt[24];
+ s_p[7]= tmp[1] * win_bt[25];
+ s_p[8]= tmp[0] * win_bt[26];
+
+ s_p[9]= tmp[0] * win_bt[27];
+ s_p[10]= tmp[1] * win_bt[28];
+ s_p[11]= tmp[2] * win_bt[29];
+ s_p[12]= tmp[3] * win_bt[30];
+ s_p[13]= tmp[4] * win_bt[31];
+ s_p[14]= tmp[5] * win_bt[32];
+ s_p[15]= tmp[6] * win_bt[33];
+ s_p[16]= tmp[7] * win_bt[34];
+ s_p[17]= tmp[8] * win_bt[35];
+ }
+}
+
+/* fast DCT according to Lee[84]
+ * reordering according to Konstantinides[94]
+ */
+void poly(const int ch,int f)
+{
+static float u[2][2][17][16]; /* no v[][], it's redundant */
+static int u_start[2]={0,0}; /* first element of u[][] */
+static int u_div[2]={0,0}; /* which part of u[][] is currently used */
+int start = u_start[ch];
+int div = u_div[ch];
+float (*u_p)[16];
+
+#if defined(PENTIUM_RDTSC)
+unsigned int cnt4, cnt3, cnt2, cnt1;
+static int min_cycles = 99999999;
+
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt1), "=d" (cnt4));
+#endif
+
+ {
+ float d16,d17,d18,d19,d20,d21,d22,d23,d24,d25,d26,d27,d28,d29,d30,d31;
+ float d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15;
+
+ /* step 1: initial reordering and 1st (16 wide) butterflies
+ */
+
+ d0 = res[ 0][f]; d16=(d0 - res[31][f]) * b1; d0 += res[31][f];
+ d1 = res[ 1][f]; d17=(d1 - res[30][f]) * b3; d1 += res[30][f];
+ d3 = res[ 2][f]; d19=(d3 - res[29][f]) * b5; d3 += res[29][f];
+ d2 = res[ 3][f]; d18=(d2 - res[28][f]) * b7; d2 += res[28][f];
+ d6 = res[ 4][f]; d22=(d6 - res[27][f]) * b9; d6 += res[27][f];
+ d7 = res[ 5][f]; d23=(d7 - res[26][f]) * b11; d7 += res[26][f];
+ d5 = res[ 6][f]; d21=(d5 - res[25][f]) * b13; d5 += res[25][f];
+ d4 = res[ 7][f]; d20=(d4 - res[24][f]) * b15; d4 += res[24][f];
+ d12= res[ 8][f]; d28=(d12 - res[23][f]) * b17; d12+= res[23][f];
+ d13= res[ 9][f]; d29=(d13 - res[22][f]) * b19; d13+= res[22][f];
+ d15= res[10][f]; d31=(d15 - res[21][f]) * b21; d15+= res[21][f];
+ d14= res[11][f]; d30=(d14 - res[20][f]) * b23; d14+= res[20][f];
+ d10= res[12][f]; d26=(d10 - res[19][f]) * b25; d10+= res[19][f];
+ d11= res[13][f]; d27=(d11 - res[18][f]) * b27; d11+= res[18][f];
+ d9 = res[14][f]; d25=(d9 - res[17][f]) * b29; d9 += res[17][f];
+ d8 = res[15][f]; d24=(d8 - res[16][f]) * b31; d8 += res[16][f];
+
+ {
+ float c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15;
+
+/* a test to see what can be done with memory separation
+ * first we process indexes 0-15
+*/
+ c0 = d0 + d8 ; c8 = ( d0 - d8 ) * b2;
+ c1 = d1 + d9 ; c9 = ( d1 - d9 ) * b6;
+ c2 = d2 + d10; c10= ( d2 - d10) * b14;
+ c3 = d3 + d11; c11= ( d3 - d11) * b10;
+ c4 = d4 + d12; c12= ( d4 - d12) * b30;
+ c5 = d5 + d13; c13= ( d5 - d13) * b26;
+ c6 = d6 + d14; c14= ( d6 - d14) * b18;
+ c7 = d7 + d15; c15= ( d7 - d15) * b22;
+
+ /* step 3: 4-wide butterflies
+ */
+ d0 = c0 + c4 ; d4 = ( c0 - c4 ) * b4;
+ d1 = c1 + c5 ; d5 = ( c1 - c5 ) * b12;
+ d2 = c2 + c6 ; d6 = ( c2 - c6 ) * b28;
+ d3 = c3 + c7 ; d7 = ( c3 - c7 ) * b20;
+
+ d8 = c8 + c12; d12= ( c8 - c12) * b4;
+ d9 = c9 + c13; d13= ( c9 - c13) * b12;
+ d10= c10+ c14; d14= (c10 - c14) * b28;
+ d11= c11+ c15; d15= (c11 - c15) * b20;
+
+
+ /* step 4: 2-wide butterflies
+ */
+ {
+ float rb8 = b8;
+ float rb24 = b24;
+
+/**/ c0 = d0 + d2 ; c2 = ( d0 - d2 ) * rb8;
+ c1 = d1 + d3 ; c3 = ( d1 - d3 ) * rb24;
+/**/ c4 = d4 + d6 ; c6 = ( d4 - d6 ) * rb8;
+ c5 = d5 + d7 ; c7 = ( d5 - d7 ) * rb24;
+/**/ c8 = d8 + d10; c10= ( d8 - d10) * rb8;
+ c9 = d9 + d11; c11= ( d9 - d11) * rb24;
+/**/ c12= d12+ d14; c14= (d12 - d14) * rb8;
+ c13= d13+ d15; c15= (d13 - d15) * rb24;
+ }
+
+ /* step 5: 1-wide butterflies
+ */
+ {
+ float rb16 = b16;
+
+ /* this is a little 'hacked up'
+ */
+ d0 = (-c0 -c1) * 2; d1 = ( c0 - c1 ) * rb16;
+ d2 = c2 + c3; d3 = ( c2 - c3 ) * rb16;
+ d3 -= d2;
+
+ d4 = c4 +c5; d5 = ( c4 - c5 ) * rb16;
+ d5 += d4;
+ d7 = -d5;
+ d7 += ( c6 - c7 ) * rb16; d6 = +c6 +c7;
+
+ d8 = c8 + c9 ; d9 = ( c8 - c9 ) * rb16;
+ d11= +d8 +d9;
+ d11 +=(c10 - c11) * rb16; d10= c10+ c11;
+
+ d12 = c12+ c13; d13 = (c12 - c13) * rb16;
+ d13 += -d8-d9+d12;
+ d14 = c14+ c15; d15 = (c14 - c15) * rb16;
+ d15-=d11;
+ d14 += -d8 -d10;
+ }
+
+ /* step 6: final resolving & reordering
+ * the other 32 are stored for use with the next granule
+ */
+
+ u_p = (float (*)[16]) &u[ch][div][0][start];
+
+/*16*/ u_p[ 0][0] =+d1 ;
+ u_p[ 2][0] = +d9 -d14;
+/*20*/ u_p[ 4][0] = +d5 -d6;
+ u_p[ 6][0] = -d10 +d13;
+/*24*/ u_p[ 8][0] =d3;
+ u_p[10][0] = -d8 -d9 +d11 -d13;
+/*28*/ u_p[12][0] = +d7;
+ u_p[14][0] = +d15;
+
+ /* the other 32 are stored for use with the next granule
+ */
+
+ u_p = (float (*)[16]) &u[ch][!div][0][start];
+
+/*0*/ u_p[16][0] = d0;
+ u_p[14][0] = -(+d8 );
+/*4*/ u_p[12][0] = -(+d4 );
+ u_p[10][0] = -(-d8 +d12 );
+/*8*/ u_p[ 8][0] = -(+d2 );
+ u_p[ 6][0] = -(+d8 +d10 -d12 );
+/*12*/ u_p[ 4][0] = -(-d4 +d6 );
+ u_p[ 2][0] = -d14;
+ u_p[ 0][0] = -d1;
+ }
+
+ {
+ float c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15;
+
+/* memory separation, second part
+*/
+/* 2
+*/
+ c0=d16 + d24; c8= (d16 - d24) * b2;
+ c1=d17 + d25; c9= (d17 - d25) * b6;
+ c2=d18 + d26; c10= (d18 - d26) * b14;
+ c3=d19 + d27; c11= (d19 - d27) * b10;
+ c4=d20 + d28; c12= (d20 - d28) * b30;
+ c5=d21 + d29; c13= (d21 - d29) * b26;
+ c6=d22 + d30; c14= (d22 - d30) * b18;
+ c7=d23 + d31; c15= (d23 - d31) * b22;
+
+/* 3
+*/
+ d16= c0+ c4; d20= (c0 - c4) * b4;
+ d17= c1+ c5; d21= (c1 - c5) * b12;
+ d18= c2+ c6; d22= (c2 - c6) * b28;
+ d19= c3+ c7; d23= (c3 - c7) * b20;
+
+ d24= c8+ c12; d28= (c8 - c12) * b4;
+ d25= c9+ c13; d29= (c9 - c13) * b12;
+ d26= c10+ c14; d30= (c10 - c14) * b28;
+ d27= c11+ c15; d31= (c11 - c15) * b20;
+
+/* 4
+*/
+ {
+ float rb8 = b8;
+ float rb24 = b24;
+
+/**/ c0= d16+ d18; c2= (d16 - d18) * rb8;
+ c1= d17+ d19; c3= (d17 - d19) * rb24;
+/**/ c4= d20+ d22; c6= (d20 - d22) * rb8;
+ c5= d21+ d23; c7= (d21 - d23) * rb24;
+/**/ c8= d24+ d26; c10= (d24 - d26) * rb8;
+ c9= d25+ d27; c11= (d25 - d27) * rb24;
+/**/ c12= d28+ d30; c14= (d28 - d30) * rb8;
+ c13= d29+ d31; c15= (d29 - d31) * rb24;
+ }
+
+/* 5
+*/
+ {
+ float rb16 = b16;
+ d16= c0+ c1; d17= (c0 - c1) * rb16;
+ d18= c2+ c3; d19= (c2 - c3) * rb16;
+
+ d20= c4+ c5; d21= (c4 - c5) * rb16;
+ d20+=d16; d21+=d17;
+ d22= c6+ c7; d23= (c6 - c7) * rb16;
+ d22+=d16; d22+=d18;
+ d23+=d16; d23+=d17; d23+=d19;
+
+
+ d24= c8+ c9; d25= (c8 - c9) * rb16;
+ d26= c10+ c11; d27= (c10 - c11) * rb16;
+ d26+=d24;
+ d27+=d24; d27+=d25;
+
+ d28= c12+ c13; d29= (c12 - c13) * rb16;
+ d28-=d20; d29+=d28; d29-=d21;
+ d30= c14+ c15; d31= (c14 - c15) * rb16;
+ d30-=d22;
+ d31-=d23;
+ }
+
+ /* step 6: final resolving & reordering
+ * the other 32 are stored for use with the next granule
+ */
+
+ u_p = (float (*)[16]) &u[ch][!div][0][start];
+
+ u_p[ 1][0] = -(+d30 );
+ u_p[ 3][0] = -(+d22 -d26 );
+ u_p[ 5][0] = -(-d18 -d20 +d26 );
+ u_p[ 7][0] = -(+d18 -d28 );
+ u_p[ 9][0] = -(+d28 );
+ u_p[11][0] = -(+d20 -d24 );
+ u_p[13][0] = -(-d16 +d24 );
+ u_p[15][0] = -(+d16 );
+
+ /* the other 32 are stored for use with the next granule
+ */
+
+ u_p = (float (*)[16]) &u[ch][div][0][start];
+
+ u_p[15][0] = +d31;
+ u_p[13][0] = +d23 -d27;
+ u_p[11][0] = -d19 -d20 -d21 +d27;
+ u_p[ 9][0] = +d19 -d29;
+ u_p[ 7][0] = -d18 +d29;
+ u_p[ 5][0] = +d18 +d20 +d21 -d25 -d26;
+ u_p[ 3][0] = -d17 -d22 +d25 +d26;
+ u_p[ 1][0] = +d17 -d30;
+ }
+ }
+
+#if defined(PENTIUM_RDTSC)
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt3), "=d" (cnt4));
+#endif
+
+ /* we're doing dewindowing and calculating final samples now
+ */
+
+#if defined(ARCH_i586)
+ /* x86 assembler optimisations. These optimisations are tuned
+ specifically for Intel Pentiums. */
+
+ asm("movl $15,%%eax\n\t"\
+ "1:\n\t"\
+ "flds (%0)\n\t"\
+ "fmuls (%1)\n\t"\
+ "flds 4(%0)\n\t"\
+ "fmuls 4(%1)\n\t"\
+ "flds 8(%0)\n\t"\
+ "fmuls 8(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 12(%0)\n\t"\
+ "fmuls 12(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 16(%0)\n\t"\
+ "fmuls 16(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 20(%0)\n\t"\
+ "fmuls 20(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 24(%0)\n\t"\
+ "fmuls 24(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 28(%0)\n\t"\
+ "fmuls 28(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 32(%0)\n\t"\
+ "fmuls 32(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 36(%0)\n\t"\
+ "fmuls 36(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 40(%0)\n\t"\
+ "fmuls 40(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 44(%0)\n\t"\
+ "fmuls 44(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 48(%0)\n\t"\
+ "fmuls 48(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 52(%0)\n\t"\
+ "fmuls 52(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 56(%0)\n\t"\
+ "fmuls 56(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 60(%0)\n\t"\
+ "fmuls 60(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "addl $64,%0\n\t"\
+ "addl $128,%1\n\t"\
+ "subl $4,%%esp\n\t"\
+ "faddp\n\t"\
+ "fistpl (%%esp)\n\t"\
+ "popl %%ecx\n\t"\
+ "cmpl $32767,%%ecx\n\t"\
+ "jle 2f\n\t"\
+ "movw $32767,%%cx\n\t"\
+ "jmp 3f\n\t"\
+ "2: cmpl $-32768,%%ecx\n\t"\
+ "jge 3f\n\t"\
+ "movw $-32768,%%cx\n\t"\
+ "3: movw %%cx,(%2)\n\t"\
+ "addl %3,%2\n\t"\
+ "decl %%eax\n\t"\
+ "jns 1b\n\t"\
+
+ "testb $1,%4\n\t"\
+ "je 4f\n\t"
+
+ "flds (%0)\n\t"\
+ "fmuls (%1)\n\t"\
+ "flds 8(%0)\n\t"\
+ "fmuls 8(%1)\n\t"\
+ "flds 16(%0)\n\t"\
+ "fmuls 16(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 24(%0)\n\t"\
+ "fmuls 24(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 32(%0)\n\t"\
+ "fmuls 32(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 40(%0)\n\t"\
+ "fmuls 40(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 48(%0)\n\t"\
+ "fmuls 48(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 56(%0)\n\t"\
+ "fmuls 56(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "subl $4,%%esp\n\t"\
+ "subl $64,%0\n\t"\
+ "subl $192,%1\n\t"\
+ "faddp\n\t"\
+ "fistpl (%%esp)\n\t"\
+ "popl %%ecx\n\t"\
+ "cmpl $32767,%%ecx\n\t"\
+ "jle 2f\n\t"\
+ "movw $32767,%%cx\n\t"\
+ "jmp 3f\n\t"\
+ "2: cmpl $-32768,%%ecx\n\t"\
+ "jge 3f\n\t"\
+ "movw $-32768,%%cx\n\t"\
+ "3: movw %%cx,(%2)\n\t"\
+
+ "movl %5,%%ecx\n\t"\
+ "sall $3,%%ecx\n\t"\
+ "addl %%ecx,%1\n\t"\
+ "addl %3,%2\n\t"\
+ "movl $14,%%eax\n\t"\
+
+ "1:flds 4(%0)\n\t"\
+ "fmuls 56(%1)\n\t"\
+ "flds (%0)\n\t"\
+ "fmuls 60(%1)\n\t"\
+ "flds 12(%0)\n\t"\
+ "fmuls 48(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubp\n\t"\
+ "flds 8(%0)\n\t"\
+ "fmuls 52(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 20(%0)\n\t"\
+ "fmuls 40(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 16(%0)\n\t"\
+ "fmuls 44(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 28(%0)\n\t"\
+ "fmuls 32(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 24(%0)\n\t"\
+ "fmuls 36(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 36(%0)\n\t"\
+ "fmuls 24(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 32(%0)\n\t"\
+ "fmuls 28(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 44(%0)\n\t"\
+ "fmuls 16(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 40(%0)\n\t"\
+ "fmuls 20(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 52(%0)\n\t"\
+ "fmuls 8(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 48(%0)\n\t"\
+ "fmuls 12(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 60(%0)\n\t"\
+ "fmuls (%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 56(%0)\n\t"\
+ "fmuls 4(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "subl $64,%0\n\t"\
+ "subl $128,%1\n\t"\
+ "subl $4,%%esp\n\t"\
+ "fsubp\n\t"\
+ "fistpl (%%esp)\n\t"\
+ "popl %%ecx\n\t"\
+ "cmpl $32767,%%ecx\n\t"\
+ "jle 2f\n\t"\
+ "movw $32767,%%cx\n\t"\
+ "jmp 3f\n\t"\
+ "2: cmpl $-32768,%%ecx\n\t"\
+ "jge 3f\n\t"\
+ "movw $-32768,%%cx\n\t"\
+ "3: movw %%cx,(%2)\n\t"\
+ "addl %3,%2\n\t"\
+ "decl %%eax\n\t"\
+ "jns 1b\n\t"\
+ "jmp 5f\n\t"\
+
+ "4:flds 4(%0)\n\t"\
+ "fmuls 4(%1)\n\t"\
+ "flds 12(%0)\n\t"\
+ "fmuls 12(%1)\n\t"\
+ "flds 20(%0)\n\t"\
+ "fmuls 20(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 28(%0)\n\t"\
+ "fmuls 28(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 36(%0)\n\t"\
+ "fmuls 36(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 44(%0)\n\t"\
+ "fmuls 44(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 52(%0)\n\t"\
+ "fmuls 52(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 60(%0)\n\t"\
+ "fmuls 60(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "subl $4,%%esp\n\t"\
+ "subl $64,%0\n\t"\
+ "subl $192,%1\n\t"\
+ "faddp\n\t"\
+ "fistpl (%%esp)\n\t"\
+ "popl %%ecx\n\t"\
+ "cmpl $32767,%%ecx\n\t"\
+ "jle 2f\n\t"\
+ "movw $32767,%%cx\n\t"\
+ "jmp 3f\n\t"\
+ "2: cmpl $-32768,%%ecx\n\t"\
+ "jge 3f\n\t"\
+ "movw $-32768,%%cx\n\t"\
+ "3: movw %%cx,(%2)\n\t"\
+
+ "movl %5,%%ecx\n\t"\
+ "sall $3,%%ecx\n\t"\
+ "addl %%ecx,%1\n\t"\
+ "addl %3,%2\n\t"\
+
+ "movl $14,%%eax\n\t"\
+ "1:flds (%0)\n\t"\
+ "fmuls 60(%1)\n\t"\
+ "flds 4(%0)\n\t"\
+ "fmuls 56(%1)\n\t"\
+ "flds 8(%0)\n\t"\
+ "fmuls 52(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubp\n\t"\
+ "flds 12(%0)\n\t"\
+ "fmuls 48(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 16(%0)\n\t"\
+ "fmuls 44(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 20(%0)\n\t"\
+ "fmuls 40(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 24(%0)\n\t"\
+ "fmuls 36(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 28(%0)\n\t"\
+ "fmuls 32(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 32(%0)\n\t"\
+ "fmuls 28(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 36(%0)\n\t"\
+ "fmuls 24(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 40(%0)\n\t"\
+ "fmuls 20(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 44(%0)\n\t"\
+ "fmuls 16(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 48(%0)\n\t"\
+ "fmuls 12(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 52(%0)\n\t"\
+ "fmuls 8(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "flds 56(%0)\n\t"\
+ "fmuls 4(%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "fsubrp\n\t"\
+ "flds 60(%0)\n\t"\
+ "fmuls (%1)\n\t"\
+ "fxch %%st(2)\n\t"\
+ "faddp\n\t"\
+ "subl $64,%0\n\t"\
+ "subl $128,%1\n\t"\
+ "subl $4,%%esp\n\t"\
+ "fsubp\n\t"\
+ "fistpl (%%esp)\n\t"\
+ "popl %%ecx\n\t"\
+ "cmpl $32767,%%ecx\n\t"\
+ "jle 2f\n\t"\
+ "movw $32767,%%cx\n\t"\
+ "jmp 3f\n\t"\
+ "2: cmpl $-32768,%%ecx\n\t"\
+ "jge 3f\n\t"\
+ "movw $-32768,%%cx\n\t"\
+ "3: movw %%cx,(%2)\n\t"\
+ "addl %3,%2\n\t"\
+ "decl %%eax\n\t"\
+ "jns 1b\n\t"\
+
+ "5:"\
+ : : "b" (u[ch][div]), "d" (t_dewindow[0] + 16 - start), "S" (&sample_buffer[f>>(2-nch)][nch==2?0:(f&1?16:0)][ch]), "m" (sizeof(short) * nch), "m" (div), "m" (start)\
+ : "eax", "ecx", "memory");
+#else
+ {
+ short *samples = (&sample_buffer[f>>(2-nch)][nch==2?0:(f&1?16:0)][ch]);
+ int out, j;
+
+#define PUT_SAMPLE(out) \
+ if (out > 32767) \
+ *samples = 32767; \
+ else \
+ if (out < -32768) \
+ *samples = -32768; \
+ else \
+ *samples = out; \
+ \
+ samples += nch;
+
+#if defined(SUPERHACK)
+ /* These is a simple implementation which should be nicer to the
+ cache; computation of samples are done in one pass rather than
+ two. However, for various reasons which I do not have time to
+ investigate, it runs quite a lot slower than two pass
+ computations. If you have time, you are welcome to look into
+ it. */
+
+ {
+ float (*u_ptr)[16] = u[ch][div];
+ const float *dewindow2 = t_dewindow[0] + start;
+
+ {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = u_ptr[0][ 0] * dewindow[0x0];
+ outf2 = u_ptr[0][ 1] * dewindow[0x1];
+ outf3 = u_ptr[0][ 2] * dewindow[0x2];
+ outf4 = u_ptr[0][ 3] * dewindow[0x3];
+ outf1 += u_ptr[0][ 4] * dewindow[0x4];
+ outf2 += u_ptr[0][ 5] * dewindow[0x5];
+ outf3 += u_ptr[0][ 6] * dewindow[0x6];
+ outf4 += u_ptr[0][ 7] * dewindow[0x7];
+ outf1 += u_ptr[0][ 8] * dewindow[0x8];
+ outf2 += u_ptr[0][ 9] * dewindow[0x9];
+ outf3 += u_ptr[0][10] * dewindow[0xa];
+ outf4 += u_ptr[0][11] * dewindow[0xb];
+ outf1 += u_ptr[0][12] * dewindow[0xc];
+ outf2 += u_ptr[0][13] * dewindow[0xd];
+ outf3 += u_ptr[0][14] * dewindow[0xe];
+ outf4 += u_ptr[0][15] * dewindow[0xf];
+
+ out = outf1 + outf2 + outf3 + outf4;
+
+ dewindow += 32;
+ dewindow2 += 32;
+ u_ptr++;
+
+ if (out > 32767)
+ samples[0] = 32767;
+ else
+ if (out < -32768)
+ samples[0] = -32768;
+ else
+ samples[0] = out;
+ }
+
+ if (div & 0x1) {
+ for (j = 1; j < 16; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = u_ptr[0][ 0] * dewindow[0x0];
+ outf3 = u_ptr[0][ 0] * dewindow2[0xf];
+ outf2 = u_ptr[0][ 1] * dewindow[0x1];
+ outf4 = u_ptr[0][ 1] * dewindow2[0xe];
+ outf1 += u_ptr[0][ 2] * dewindow[0x2];
+ outf3 += u_ptr[0][ 2] * dewindow2[0xd];
+ outf2 += u_ptr[0][ 3] * dewindow[0x3];
+ outf4 += u_ptr[0][ 3] * dewindow2[0xc];
+ outf1 += u_ptr[0][ 4] * dewindow[0x4];
+ outf3 += u_ptr[0][ 4] * dewindow2[0xb];
+ outf2 += u_ptr[0][ 5] * dewindow[0x5];
+ outf4 += u_ptr[0][ 5] * dewindow2[0xa];
+ outf1 += u_ptr[0][ 6] * dewindow[0x6];
+ outf3 += u_ptr[0][ 6] * dewindow2[0x9];
+ outf2 += u_ptr[0][ 7] * dewindow[0x7];
+ outf4 += u_ptr[0][ 7] * dewindow2[0x8];
+ outf1 += u_ptr[0][ 8] * dewindow[0x8];
+ outf3 += u_ptr[0][ 8] * dewindow2[0x7];
+ outf2 += u_ptr[0][ 9] * dewindow[0x9];
+ outf4 += u_ptr[0][ 9] * dewindow2[0x6];
+ outf1 += u_ptr[0][10] * dewindow[0xa];
+ outf3 += u_ptr[0][10] * dewindow2[0x5];
+ outf2 += u_ptr[0][11] * dewindow[0xb];
+ outf4 += u_ptr[0][11] * dewindow2[0x4];
+ outf1 += u_ptr[0][12] * dewindow[0xc];
+ outf3 += u_ptr[0][12] * dewindow2[0x3];
+ outf2 += u_ptr[0][13] * dewindow[0xd];
+ outf4 += u_ptr[0][13] * dewindow2[0x2];
+ outf1 += u_ptr[0][14] * dewindow[0xe];
+ outf3 += u_ptr[0][14] * dewindow2[0x1];
+ outf2 += u_ptr[0][15] * dewindow[0xf];
+ outf4 += u_ptr[0][15] * dewindow2[0x0];
+
+ dewindow += 32;
+ dewindow2 += 32;
+ u_ptr++;
+
+ out = outf1 + outf2;
+
+ if (out > 32767)
+ samples[j * 2] = 32767;
+ else
+ if (out < -32768)
+ samples[j * 2] = -32768;
+ else
+ samples[j * 2] = out;
+
+ out = outf4 - outf3;
+
+ if (out > 32767)
+ samples[64 - (j * 2)] = 32767;
+ else
+ if (out < -32768)
+ samples[64 - (j * 2)] = -32768;
+ else
+ samples[64 - (j * 2)] = out;
+ }
+
+ {
+ float outf2, outf4;
+
+ outf2 = u_ptr[0][ 0] * dewindow[0x0];
+ outf4 = u_ptr[0][ 2] * dewindow[0x2];
+ outf2 += u_ptr[0][ 4] * dewindow[0x4];
+ outf4 += u_ptr[0][ 6] * dewindow[0x6];
+ outf2 += u_ptr[0][ 8] * dewindow[0x8];
+ outf4 += u_ptr[0][10] * dewindow[0xa];
+ outf2 += u_ptr[0][12] * dewindow[0xc];
+ outf4 += u_ptr[0][14] * dewindow[0xe];
+
+ out = outf2 + outf4;
+
+ if (out > 32767)
+ samples[16 * 2] = 32767;
+ else
+ if (out < -32768)
+ samples[16 * 2] = -32768;
+ else
+ samples[16 * 2] = out;
+ }
+ } else {
+ for (j = 1; j < 16; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = u_ptr[0][ 0] * dewindow[0x0];
+ outf3 = u_ptr[0][ 0] * dewindow2[0xf];
+ outf2 = u_ptr[0][ 1] * dewindow[0x1];
+ outf4 = u_ptr[0][ 1] * dewindow2[0xe];
+ outf1 += u_ptr[0][ 2] * dewindow[0x2];
+ outf3 += u_ptr[0][ 2] * dewindow2[0xd];
+ outf2 += u_ptr[0][ 3] * dewindow[0x3];
+ outf4 += u_ptr[0][ 3] * dewindow2[0xc];
+ outf1 += u_ptr[0][ 4] * dewindow[0x4];
+ outf3 += u_ptr[0][ 4] * dewindow2[0xb];
+ outf2 += u_ptr[0][ 5] * dewindow[0x5];
+ outf4 += u_ptr[0][ 5] * dewindow2[0xa];
+ outf1 += u_ptr[0][ 6] * dewindow[0x6];
+ outf3 += u_ptr[0][ 6] * dewindow2[0x9];
+ outf2 += u_ptr[0][ 7] * dewindow[0x7];
+ outf4 += u_ptr[0][ 7] * dewindow2[0x8];
+ outf1 += u_ptr[0][ 8] * dewindow[0x8];
+ outf3 += u_ptr[0][ 8] * dewindow2[0x7];
+ outf2 += u_ptr[0][ 9] * dewindow[0x9];
+ outf4 += u_ptr[0][ 9] * dewindow2[0x6];
+ outf1 += u_ptr[0][10] * dewindow[0xa];
+ outf3 += u_ptr[0][10] * dewindow2[0x5];
+ outf2 += u_ptr[0][11] * dewindow[0xb];
+ outf4 += u_ptr[0][11] * dewindow2[0x4];
+ outf1 += u_ptr[0][12] * dewindow[0xc];
+ outf3 += u_ptr[0][12] * dewindow2[0x3];
+ outf2 += u_ptr[0][13] * dewindow[0xd];
+ outf4 += u_ptr[0][13] * dewindow2[0x2];
+ outf1 += u_ptr[0][14] * dewindow[0xe];
+ outf3 += u_ptr[0][14] * dewindow2[0x1];
+ outf2 += u_ptr[0][15] * dewindow[0xf];
+ outf4 += u_ptr[0][15] * dewindow2[0x0];
+
+ dewindow += 32;
+ dewindow2 += 32;
+ u_ptr++;
+
+ out = outf1 + outf2;
+
+ if (out > 32767)
+ samples[j * 2] = 32767;
+ else
+ if (out < -32768)
+ samples[j * 2] = -32768;
+ else
+ samples[j * 2] = out;
+
+ out = outf3 - outf4;
+
+ if (out > 32767)
+ samples[64 - (j * 2)] = 32767;
+ else
+ if (out < -32768)
+ samples[64 - (j * 2)] = -32768;
+ else
+ samples[64 - (j * 2)] = out;
+ }
+
+ {
+ float outf2, outf4;
+
+ outf2 = u_ptr[0][ 1] * dewindow[0x1];
+ outf4 = u_ptr[0][ 3] * dewindow[0x3];
+ outf2 += u_ptr[0][ 5] * dewindow[0x5];
+ outf4 += u_ptr[0][ 7] * dewindow[0x7];
+ outf2 += u_ptr[0][ 9] * dewindow[0x9];
+ outf4 += u_ptr[0][11] * dewindow[0xb];
+ outf2 += u_ptr[0][13] * dewindow[0xd];
+ outf4 += u_ptr[0][15] * dewindow[0xf];
+
+ out = outf2 + outf4;
+
+ if (out > 32767)
+ samples[16 * 2] = 32767;
+ else
+ if (out < -32768)
+ samples[16 * 2] = -32768;
+ else
+ samples[16 * 2] = out;
+ }
+ }
+ }
+#elif defined(HAS_AUTOINCREMENT)
+ const float *dewindow = t_dewindow[0] + 15 - start;
+
+ /* This is tuned specifically for architectures with
+ autoincrement and -decrement. */
+
+ {
+ float *u_ptr = (float*) u[ch][div];
+
+ u_ptr--;
+
+ for (j = 0; j < 16; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = *++u_ptr * *++dewindow;
+ outf2 = *++u_ptr * *++dewindow;
+ outf3 = *++u_ptr * *++dewindow;
+ outf4 = *++u_ptr * *++dewindow;
+ outf1 += *++u_ptr * *++dewindow;
+ outf2 += *++u_ptr * *++dewindow;
+ outf3 += *++u_ptr * *++dewindow;
+ outf4 += *++u_ptr * *++dewindow;
+ outf1 += *++u_ptr * *++dewindow;
+ outf2 += *++u_ptr * *++dewindow;
+ outf3 += *++u_ptr * *++dewindow;
+ outf4 += *++u_ptr * *++dewindow;
+ outf1 += *++u_ptr * *++dewindow;
+ outf2 += *++u_ptr * *++dewindow;
+ outf3 += *++u_ptr * *++dewindow;
+ outf4 += *++u_ptr * *++dewindow;
+
+ out = outf1 + outf2 + outf3 + outf4;
+
+ dewindow += 16;
+
+ PUT_SAMPLE(out)
+ }
+
+ if (div & 0x1) {
+ {
+ float outf2, outf4;
+
+ outf2 = u_ptr[ 1] * dewindow[0x1];
+ outf4 = u_ptr[ 3] * dewindow[0x3];
+ outf2 += u_ptr[ 5] * dewindow[0x5];
+ outf4 += u_ptr[ 7] * dewindow[0x7];
+ outf2 += u_ptr[ 9] * dewindow[0x9];
+ outf4 += u_ptr[11] * dewindow[0xb];
+ outf2 += u_ptr[13] * dewindow[0xd];
+ outf4 += u_ptr[15] * dewindow[0xf];
+
+ out = outf2 + outf4;
+
+ PUT_SAMPLE(out)
+ }
+
+ dewindow -= 31;
+ dewindow += start;
+ dewindow += start;
+ u_ptr -= 16;
+
+ for (; j < 31; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = *++u_ptr * *--dewindow;
+ outf2 = *++u_ptr * *--dewindow;
+ outf3 = *++u_ptr * *--dewindow;
+ outf4 = *++u_ptr * *--dewindow;
+ outf1 += *++u_ptr * *--dewindow;
+ outf2 += *++u_ptr * *--dewindow;
+ outf3 += *++u_ptr * *--dewindow;
+ outf4 += *++u_ptr * *--dewindow;
+ outf1 += *++u_ptr * *--dewindow;
+ outf2 += *++u_ptr * *--dewindow;
+ outf3 += *++u_ptr * *--dewindow;
+ outf4 += *++u_ptr * *--dewindow;
+ outf1 += *++u_ptr * *--dewindow;
+ outf2 += *++u_ptr * *--dewindow;
+ outf3 += *++u_ptr * *--dewindow;
+ outf4 += *++u_ptr * *--dewindow;
+
+ out = outf2 - outf1 + outf4 - outf3;
+
+ dewindow -= 16;
+ u_ptr -= 32;
+
+ PUT_SAMPLE(out)
+ }
+ } else {
+ {
+ float outf2, outf4;
+
+ outf2 = u_ptr[ 2] * dewindow[ 0x2];
+ outf4 = u_ptr[ 4] * dewindow[ 0x4];
+ outf2 += u_ptr[ 6] * dewindow[ 0x6];
+ outf4 += u_ptr[ 8] * dewindow[ 0x8];
+ outf2 += u_ptr[10] * dewindow[ 0xa];
+ outf4 += u_ptr[12] * dewindow[ 0xc];
+ outf2 += u_ptr[14] * dewindow[ 0xe];
+ outf4 += u_ptr[16] * dewindow[0x10];
+
+ out = outf2 + outf4;
+
+ PUT_SAMPLE(out)
+ }
+
+ dewindow -= 31;
+ dewindow += start;
+ dewindow += start;
+ u_ptr -= 16;
+
+ for (; j < 31; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = *++u_ptr * *--dewindow;
+ outf2 = *++u_ptr * *--dewindow;
+ outf3 = *++u_ptr * *--dewindow;
+ outf4 = *++u_ptr * *--dewindow;
+ outf1 += *++u_ptr * *--dewindow;
+ outf2 += *++u_ptr * *--dewindow;
+ outf3 += *++u_ptr * *--dewindow;
+ outf4 += *++u_ptr * *--dewindow;
+ outf1 += *++u_ptr * *--dewindow;
+ outf2 += *++u_ptr * *--dewindow;
+ outf3 += *++u_ptr * *--dewindow;
+ outf4 += *++u_ptr * *--dewindow;
+ outf1 += *++u_ptr * *--dewindow;
+ outf2 += *++u_ptr * *--dewindow;
+ outf3 += *++u_ptr * *--dewindow;
+ outf4 += *++u_ptr * *--dewindow;
+
+ out = outf1 - outf2 + outf3 - outf4;
+
+ dewindow -= 16;
+ u_ptr -= 32;
+
+ PUT_SAMPLE(out)
+ }
+ }
+ }
+#else
+ const float *dewindow = t_dewindow[0] + 16 - start;
+
+ /* These optimisations are tuned specifically for architectures
+ without autoincrement and -decrement. */
+
+ {
+ float (*u_ptr)[16] = u[ch][div];
+
+ for (j = 0; j < 16; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ outf1 = u_ptr[0][ 0] * dewindow[0x0];
+ outf2 = u_ptr[0][ 1] * dewindow[0x1];
+ outf3 = u_ptr[0][ 2] * dewindow[0x2];
+ outf4 = u_ptr[0][ 3] * dewindow[0x3];
+ outf1 += u_ptr[0][ 4] * dewindow[0x4];
+ outf2 += u_ptr[0][ 5] * dewindow[0x5];
+ outf3 += u_ptr[0][ 6] * dewindow[0x6];
+ outf4 += u_ptr[0][ 7] * dewindow[0x7];
+ outf1 += u_ptr[0][ 8] * dewindow[0x8];
+ outf2 += u_ptr[0][ 9] * dewindow[0x9];
+ outf3 += u_ptr[0][10] * dewindow[0xa];
+ outf4 += u_ptr[0][11] * dewindow[0xb];
+ outf1 += u_ptr[0][12] * dewindow[0xc];
+ outf2 += u_ptr[0][13] * dewindow[0xd];
+ outf3 += u_ptr[0][14] * dewindow[0xe];
+ outf4 += u_ptr[0][15] * dewindow[0xf];
+
+ out = outf1 + outf2 + outf3 + outf4;
+
+ dewindow += 32;
+ u_ptr++;
+
+ PUT_SAMPLE(out)
+ }
+
+ if (div & 0x1) {
+ {
+ float outf2, outf4;
+
+ outf2 = u_ptr[0][ 0] * dewindow[0x0];
+ outf4 = u_ptr[0][ 2] * dewindow[0x2];
+ outf2 += u_ptr[0][ 4] * dewindow[0x4];
+ outf4 += u_ptr[0][ 6] * dewindow[0x6];
+ outf2 += u_ptr[0][ 8] * dewindow[0x8];
+ outf4 += u_ptr[0][10] * dewindow[0xa];
+ outf2 += u_ptr[0][12] * dewindow[0xc];
+ outf4 += u_ptr[0][14] * dewindow[0xe];
+
+ out = outf2 + outf4;
+
+ PUT_SAMPLE(out)
+ }
+
+ dewindow -= 48;
+ dewindow += start;
+ dewindow += start;
+
+ for (; j < 31; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ --u_ptr;
+
+ outf1 = u_ptr[0][ 0] * dewindow[0xf];
+ outf2 = u_ptr[0][ 1] * dewindow[0xe];
+ outf3 = u_ptr[0][ 2] * dewindow[0xd];
+ outf4 = u_ptr[0][ 3] * dewindow[0xc];
+ outf1 += u_ptr[0][ 4] * dewindow[0xb];
+ outf2 += u_ptr[0][ 5] * dewindow[0xa];
+ outf3 += u_ptr[0][ 6] * dewindow[0x9];
+ outf4 += u_ptr[0][ 7] * dewindow[0x8];
+ outf1 += u_ptr[0][ 8] * dewindow[0x7];
+ outf2 += u_ptr[0][ 9] * dewindow[0x6];
+ outf3 += u_ptr[0][10] * dewindow[0x5];
+ outf4 += u_ptr[0][11] * dewindow[0x4];
+ outf1 += u_ptr[0][12] * dewindow[0x3];
+ outf2 += u_ptr[0][13] * dewindow[0x2];
+ outf3 += u_ptr[0][14] * dewindow[0x1];
+ outf4 += u_ptr[0][15] * dewindow[0x0];
+
+ out = -outf1 + outf2 - outf3 + outf4;
+
+ dewindow -= 32;
+
+ PUT_SAMPLE(out)
+ }
+ } else {
+ {
+ float outf2, outf4;
+
+ outf2 = u_ptr[0][ 1] * dewindow[0x1];
+ outf4 = u_ptr[0][ 3] * dewindow[0x3];
+ outf2 += u_ptr[0][ 5] * dewindow[0x5];
+ outf4 += u_ptr[0][ 7] * dewindow[0x7];
+ outf2 += u_ptr[0][ 9] * dewindow[0x9];
+ outf4 += u_ptr[0][11] * dewindow[0xb];
+ outf2 += u_ptr[0][13] * dewindow[0xd];
+ outf4 += u_ptr[0][15] * dewindow[0xf];
+
+ out = outf2 + outf4;
+
+ PUT_SAMPLE(out)
+ }
+
+ dewindow -= 48;
+ dewindow += start;
+ dewindow += start;
+
+ for (; j < 31; ++j) {
+ float outf1, outf2, outf3, outf4;
+
+ --u_ptr;
+
+ outf1 = u_ptr[0][ 0] * dewindow[0xf];
+ outf2 = u_ptr[0][ 1] * dewindow[0xe];
+ outf3 = u_ptr[0][ 2] * dewindow[0xd];
+ outf4 = u_ptr[0][ 3] * dewindow[0xc];
+ outf1 += u_ptr[0][ 4] * dewindow[0xb];
+ outf2 += u_ptr[0][ 5] * dewindow[0xa];
+ outf3 += u_ptr[0][ 6] * dewindow[0x9];
+ outf4 += u_ptr[0][ 7] * dewindow[0x8];
+ outf1 += u_ptr[0][ 8] * dewindow[0x7];
+ outf2 += u_ptr[0][ 9] * dewindow[0x6];
+ outf3 += u_ptr[0][10] * dewindow[0x5];
+ outf4 += u_ptr[0][11] * dewindow[0x4];
+ outf1 += u_ptr[0][12] * dewindow[0x3];
+ outf2 += u_ptr[0][13] * dewindow[0x2];
+ outf3 += u_ptr[0][14] * dewindow[0x1];
+ outf4 += u_ptr[0][15] * dewindow[0x0];
+
+ out = outf1 - outf2 + outf3 - outf4;
+
+ dewindow -= 32;
+
+ PUT_SAMPLE(out)
+ }
+ }
+ }
+#endif
+ }
+#endif
+
+ --u_start[ch];
+ u_start[ch] &= 0xf;
+ u_div[ch]=u_div[ch] ? 0 : 1;
+
+#if defined(PENTIUM_RDTSC)
+ __asm__(".byte 0x0f,0x31" : "=a" (cnt2), "=d" (cnt4));
+
+ if (cnt2-cnt1 < min_cycles) {
+ min_cycles = cnt2-cnt1;
+ printf("%d, %d cycles, %d\n", cnt3-cnt1, min_cycles, start);
+ }
+#endif
+}
+
+void premultiply()
+{
+ int i,t;
+
+ for (i = 0; i < 17; ++i)
+ for (t = 0; t < 32; ++t)
+ t_dewindow[i][t] *= 16383.5f;
+}
diff --git a/setedit/mp3/libamp/transform.h b/setedit/mp3/libamp/transform.h
new file mode 100644
index 0000000..e914531
--- /dev/null
+++ b/setedit/mp3/libamp/transform.h
@@ -0,0 +1,168 @@
+/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
+*/
+
+/* transform.h tables galore
+ *
+ * Created by: tomislav uzelac May 1996
+ * Last modified by: tomislav uzelac Mar 1 97
+ */
+extern void imdct_init();
+extern void imdct(int win_type,int sb,int ch);
+extern void poly(int ch,int i);
+extern void premultiply();
+
+extern short sample_buffer[18][32][2];
+extern float res[32][18];
+extern float s[2][32][18];
+
+#ifdef TRANSFORM
+
+void imdct_init();
+void imdct(int win_type,int sb,int ch);
+void poly(int ch,int i);
+void premultiply();
+
+short sample_buffer[18][32][2];
+float s[2][32][18];
+float res[32][18];
+float win[4][36];
+
+static const float t_sin[4][36]={{
+ -0.032160, 0.103553, -0.182543, 0.266729, -0.353554, 0.440377,
+ -0.524563, 0.603553, -0.674947, 0.736575, -0.786566, 0.823400,
+ -0.845957, 0.853554, -0.845957, 0.823399, -0.786566, 0.736575,
+ -0.674947, 0.603553, -0.524564, 0.440378, -0.353553, 0.266729,
+ -0.182544, 0.103553, -0.032160, -0.029469, 0.079459, -0.116293,
+ 0.138851, -0.146446, 0.138851, -0.116293, 0.079459, -0.029469
+},{
+ -0.032160, 0.103553, -0.182543, 0.266729, -0.353554, 0.440377,
+ -0.524563, 0.603553, -0.674947, 0.736575, -0.786566, 0.823400,
+ -0.845957, 0.853554, -0.845957, 0.823399, -0.786566, 0.736575,
+ -0.675590, 0.608761, -0.537300, 0.461749, -0.382683, 0.300706,
+ -0.214588, 0.120590, -0.034606, -0.026554, 0.049950, -0.028251,
+ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000
+},{
+ -0.103553, 0.353554, -0.603553, 0.786566, -0.853554, 0.786566,
+ -0.603553, 0.353553, -0.103553, -0.079459, 0.146446, -0.079459,
+ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000
+},{
+ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+ -0.127432, 0.379410, -0.608182, 0.792598, -0.915976, 0.967944,
+ -0.953717, 0.923880, -0.887011, 0.843391, -0.793353, 0.737277,
+ -0.674947, 0.603553, -0.524564, 0.440378, -0.353553, 0.266729,
+ -0.182544, 0.103553, -0.032160, -0.029469, 0.079459, -0.116293,
+ 0.138851, -0.146446, 0.138851, -0.116293, 0.079459, -0.029469
+}};
+
+static const float t_2cos[4][18]={
+{ -0.174311, -0.517638, -0.845237, -1.147153, -1.414214, -1.638304, -1.812616, -1.931852, -1.992389,
+ 0.174311, 0.517638, 0.845237, 1.147153, 1.414214, 1.638304, 1.812616, 1.931852, 1.992389},
+{ -0.174311, -0.517638, -0.845237, -1.147153, -1.414214, -1.638304, -1.812616, -1.931852, -1.992389,
+ 0.174311, 0.517638, 0.845237, 1.147153, 1.414214, 1.638304, 1.812616, 1.931852, 1.992389},
+{ -0.517638, -1.41421, -1.93185, 0.517638, 1.41421, 1.93185,0,0,0,0,0,0,0,0,0,0,0,0},
+{ -0.174311, -0.517638, -0.845237, -1.147153, -1.414214, -1.638304, -1.812616, -1.931852, -1.992389,
+ 0.174311, 0.517638, 0.845237, 1.147153, 1.414214, 1.638304, 1.812616, 1.931852, 1.992389}
+};
+
+static const float b1 = 1.997590912; static const float b2 = 1.990369453; static const float b3 = 1.978353019;
+static const float b4 = 1.961570560; static const float b5 = 1.940062506; static const float b6 = 1.913880671;
+static const float b7 = 1.883088130; static const float b8 = 1.847759065; static const float b9 = 1.807978586;
+static const float b10= 1.763842529; static const float b11= 1.715457220; static const float b12= 1.662939225;
+static const float b13= 1.606415063; static const float b14= 1.546020907; static const float b15= 1.481902251;
+static const float b16= 1.414213562; static const float b17= 1.343117910; static const float b18= 1.268786568;
+static const float b19= 1.191398609; static const float b20= 1.111140466; static const float b21= 1.028205488;
+static const float b22= 0.942793474; static const float b23= 0.855110187; static const float b24= 0.765366865;
+static const float b25= 0.673779707; static const float b26= 0.580569355; static const float b27= 0.485960360;
+static const float b28= 0.390180644; static const float b29= 0.293460949; static const float b30= 0.196034281;
+static const float b31= 0.098135349;
+
+static float t_dewindow[17][32] = {{
+ 0.000000000 ,-0.000442505 , 0.003250122 ,-0.007003784 , 0.031082153 ,-0.078628540 , 0.100311279 ,-0.572036743 ,
+ 1.144989014 , 0.572036743 , 0.100311279 , 0.078628540 , 0.031082153 , 0.007003784 , 0.003250122 , 0.000442505 ,
+ 0.000000000 ,-0.000442505 , 0.003250122 ,-0.007003784 , 0.031082153 ,-0.078628540 , 0.100311279 ,-0.572036743 ,
+ 1.144989014 , 0.572036743 , 0.100311279 , 0.078628540 , 0.031082153 , 0.007003784 , 0.003250122 , 0.000442505 ,
+},{
+-0.000015259 ,-0.000473022 , 0.003326416 ,-0.007919312 , 0.030517578 ,-0.084182739 , 0.090927124 ,-0.600219727 ,
+ 1.144287109 , 0.543823242 , 0.108856201 , 0.073059082 , 0.031478882 , 0.006118774 , 0.003173828 , 0.000396729 ,
+-0.000015259 ,-0.000473022 , 0.003326416 ,-0.007919312 , 0.030517578 ,-0.084182739 , 0.090927124 ,-0.600219727 ,
+ 1.144287109 , 0.543823242 , 0.108856201 , 0.073059082 , 0.031478882 , 0.006118774 , 0.003173828 , 0.000396729 ,
+},{
+-0.000015259 ,-0.000534058 , 0.003387451 ,-0.008865356 , 0.029785156 ,-0.089706421 , 0.080688477 ,-0.628295898 ,
+ 1.142211914 , 0.515609741 , 0.116577148 , 0.067520142 , 0.031738281 , 0.005294800 , 0.003082275 , 0.000366211 ,
+-0.000015259 ,-0.000534058 , 0.003387451 ,-0.008865356 , 0.029785156 ,-0.089706421 , 0.080688477 ,-0.628295898 ,
+ 1.142211914 , 0.515609741 , 0.116577148 , 0.067520142 , 0.031738281 , 0.005294800 , 0.003082275 , 0.000366211 ,
+},{
+-0.000015259 ,-0.000579834 , 0.003433228 ,-0.009841919 , 0.028884888 ,-0.095169067 , 0.069595337 ,-0.656219482 ,
+ 1.138763428 , 0.487472534 , 0.123474121 , 0.061996460 , 0.031845093 , 0.004486084 , 0.002990723 , 0.000320435 ,
+-0.000015259 ,-0.000579834 , 0.003433228 ,-0.009841919 , 0.028884888 ,-0.095169067 , 0.069595337 ,-0.656219482 ,
+ 1.138763428 , 0.487472534 , 0.123474121 , 0.061996460 , 0.031845093 , 0.004486084 , 0.002990723 , 0.000320435 ,
+},{
+-0.000015259 ,-0.000625610 , 0.003463745 ,-0.010848999 , 0.027801514 ,-0.100540161 , 0.057617187 ,-0.683914185 ,
+ 1.133926392 , 0.459472656 , 0.129577637 , 0.056533813 , 0.031814575 , 0.003723145 , 0.002899170 , 0.000289917 ,
+-0.000015259 ,-0.000625610 , 0.003463745 ,-0.010848999 , 0.027801514 ,-0.100540161 , 0.057617187 ,-0.683914185 ,
+ 1.133926392 , 0.459472656 , 0.129577637 , 0.056533813 , 0.031814575 , 0.003723145 , 0.002899170 , 0.000289917 ,
+},{
+-0.000015259 ,-0.000686646 , 0.003479004 ,-0.011886597 , 0.026535034 ,-0.105819702 , 0.044784546 ,-0.711318970 ,
+ 1.127746582 , 0.431655884 , 0.134887695 , 0.051132202 , 0.031661987 , 0.003005981 , 0.002792358 , 0.000259399 ,
+-0.000015259 ,-0.000686646 , 0.003479004 ,-0.011886597 , 0.026535034 ,-0.105819702 , 0.044784546 ,-0.711318970 ,
+ 1.127746582 , 0.431655884 , 0.134887695 , 0.051132202 , 0.031661987 , 0.003005981 , 0.002792358 , 0.000259399 ,
+},{
+-0.000015259 ,-0.000747681 , 0.003479004 ,-0.012939453 , 0.025085449 ,-0.110946655 , 0.031082153 ,-0.738372803 ,
+ 1.120223999 , 0.404083252 , 0.139450073 , 0.045837402 , 0.031387329 , 0.002334595 , 0.002685547 , 0.000244141 ,
+-0.000015259 ,-0.000747681 , 0.003479004 ,-0.012939453 , 0.025085449 ,-0.110946655 , 0.031082153 ,-0.738372803 ,
+ 1.120223999 , 0.404083252 , 0.139450073 , 0.045837402 , 0.031387329 , 0.002334595 , 0.002685547 , 0.000244141 ,
+},{
+-0.000030518 ,-0.000808716 , 0.003463745 ,-0.014022827 , 0.023422241 ,-0.115921021 , 0.016510010 ,-0.765029907 ,
+ 1.111373901 , 0.376800537 , 0.143264771 , 0.040634155 , 0.031005859 , 0.001693726 , 0.002578735 , 0.000213623 ,
+-0.000030518 ,-0.000808716 , 0.003463745 ,-0.014022827 , 0.023422241 ,-0.115921021 , 0.016510010 ,-0.765029907 ,
+ 1.111373901 , 0.376800537 , 0.143264771 , 0.040634155 , 0.031005859 , 0.001693726 , 0.002578735 , 0.000213623 ,
+},{
+-0.000030518 ,-0.000885010 , 0.003417969 ,-0.015121460 , 0.021575928 ,-0.120697021 , 0.001068115 ,-0.791213989 ,
+ 1.101211548 , 0.349868774 , 0.146362305 , 0.035552979 , 0.030532837 , 0.001098633 , 0.002456665 , 0.000198364 ,
+-0.000030518 ,-0.000885010 , 0.003417969 ,-0.015121460 , 0.021575928 ,-0.120697021 , 0.001068115 ,-0.791213989 ,
+ 1.101211548 , 0.349868774 , 0.146362305 , 0.035552979 , 0.030532837 , 0.001098633 , 0.002456665 , 0.000198364 ,
+},{
+-0.000030518 ,-0.000961304 , 0.003372192 ,-0.016235352 , 0.019531250 ,-0.125259399 ,-0.015228271 ,-0.816864014 ,
+ 1.089782715 , 0.323318481 , 0.148773193 , 0.030609131 , 0.029937744 , 0.000549316 , 0.002349854 , 0.000167847 ,
+-0.000030518 ,-0.000961304 , 0.003372192 ,-0.016235352 , 0.019531250 ,-0.125259399 ,-0.015228271 ,-0.816864014 ,
+ 1.089782715 , 0.323318481 , 0.148773193 , 0.030609131 , 0.029937744 , 0.000549316 , 0.002349854 , 0.000167847 ,
+},{
+-0.000030518 ,-0.001037598 , 0.003280640 ,-0.017349243 , 0.017257690 ,-0.129562378 ,-0.032379150 ,-0.841949463 ,
+ 1.077117920 , 0.297210693 , 0.150497437 , 0.025817871 , 0.029281616 , 0.000030518 , 0.002243042 , 0.000152588 ,
+-0.000030518 ,-0.001037598 , 0.003280640 ,-0.017349243 , 0.017257690 ,-0.129562378 ,-0.032379150 ,-0.841949463 ,
+ 1.077117920 , 0.297210693 , 0.150497437 , 0.025817871 , 0.029281616 , 0.000030518 , 0.002243042 , 0.000152588 ,
+},{
+-0.000045776 ,-0.001113892 , 0.003173828 ,-0.018463135 , 0.014801025 ,-0.133590698 ,-0.050354004 ,-0.866363525 ,
+ 1.063217163 , 0.271591187 , 0.151596069 , 0.021179199 , 0.028533936 ,-0.000442505 , 0.002120972 , 0.000137329 ,
+-0.000045776 ,-0.001113892 , 0.003173828 ,-0.018463135 , 0.014801025 ,-0.133590698 ,-0.050354004 ,-0.866363525 ,
+ 1.063217163 , 0.271591187 , 0.151596069 , 0.021179199 , 0.028533936 ,-0.000442505 , 0.002120972 , 0.000137329 ,
+},{
+-0.000045776 ,-0.001205444 , 0.003051758 ,-0.019577026 , 0.012115479 ,-0.137298584 ,-0.069168091 ,-0.890090942 ,
+ 1.048156738 , 0.246505737 , 0.152069092 , 0.016708374 , 0.027725220 ,-0.000869751 , 0.002014160 , 0.000122070 ,
+-0.000045776 ,-0.001205444 , 0.003051758 ,-0.019577026 , 0.012115479 ,-0.137298584 ,-0.069168091 ,-0.890090942 ,
+ 1.048156738 , 0.246505737 , 0.152069092 , 0.016708374 , 0.027725220 ,-0.000869751 , 0.002014160 , 0.000122070 ,
+},{
+-0.000061035 ,-0.001296997 , 0.002883911 ,-0.020690918 , 0.009231567 ,-0.140670776 ,-0.088775635 ,-0.913055420 ,
+ 1.031936646 , 0.221984863 , 0.151962280 , 0.012420654 , 0.026840210 ,-0.001266479 , 0.001907349 , 0.000106812 ,
+-0.000061035 ,-0.001296997 , 0.002883911 ,-0.020690918 , 0.009231567 ,-0.140670776 ,-0.088775635 ,-0.913055420 ,
+ 1.031936646 , 0.221984863 , 0.151962280 , 0.012420654 , 0.026840210 ,-0.001266479 , 0.001907349 , 0.000106812 ,
+},{
+-0.000061035 ,-0.001388550 , 0.002700806 ,-0.021789551 , 0.006134033 ,-0.143676758 ,-0.109161377 ,-0.935195923 ,
+ 1.014617920 , 0.198059082 , 0.151306152 , 0.008316040 , 0.025909424 ,-0.001617432 , 0.001785278 , 0.000106812 ,
+-0.000061035 ,-0.001388550 , 0.002700806 ,-0.021789551 , 0.006134033 ,-0.143676758 ,-0.109161377 ,-0.935195923 ,
+ 1.014617920 , 0.198059082 , 0.151306152 , 0.008316040 , 0.025909424 ,-0.001617432 , 0.001785278 , 0.000106812 ,
+},{
+-0.000076294 ,-0.001480103 , 0.002487183 ,-0.022857666 , 0.002822876 ,-0.146255493 ,-0.130310059 ,-0.956481934 ,
+ 0.996246338 , 0.174789429 , 0.150115967 , 0.004394531 , 0.024932861 ,-0.001937866 , 0.001693726 , 0.000091553 ,
+-0.000076294 ,-0.001480103 , 0.002487183 ,-0.022857666 , 0.002822876 ,-0.146255493 ,-0.130310059 ,-0.956481934 ,
+ 0.996246338 , 0.174789429 , 0.150115967 , 0.004394531 , 0.024932861 ,-0.001937866 , 0.001693726 , 0.000091553 ,
+},{
+-0.000076294 ,-0.001586914 , 0.002227783 ,-0.023910522 ,-0.000686646 ,-0.148422241 ,-0.152206421 ,-0.976852417 ,
+ 0.976852417 , 0.152206421 , 0.148422241 , 0.000686646 , 0.023910522 ,-0.002227783 , 0.001586914 , 0.000076294 ,
+-0.000076294 ,-0.001586914 , 0.002227783 ,-0.023910522 ,-0.000686646 ,-0.148422241 ,-0.152206421 ,-0.976852417 ,
+ 0.976852417 , 0.152206421 , 0.148422241 , 0.000686646 , 0.023910522 ,-0.002227783 , 0.001586914 , 0.000076294 ,
+} };
+#endif /* TRANSFORM */
diff --git a/setedit/mp3/libamp/util.c b/setedit/mp3/libamp/util.c
new file mode 100644
index 0000000..149c42e
--- /dev/null
+++ b/setedit/mp3/libamp/util.c
@@ -0,0 +1,109 @@
+/* this file is a part of amp software
+
+ util.c: created by Andrew Richards
+
+*/
+
+#define AMP_UTIL
+#include "amp.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "audio.h"
+
+struct debugFlags_t debugFlags;
+
+
+/* die - for terminal conditions prints the error message and exits */
+/* can not be suppressed with -q,-quiet */
+void
+die(char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap,fmt);
+ vfprintf(stderr, fmt, ap);
+ exit(-1);
+}
+
+
+/* warn - for warning messages. Can be suppressed by -q,-quiet */
+void
+warn(char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap,fmt);
+ if (!A_QUIET) {
+ fprintf(stderr,"Warning: ");
+ vfprintf(stderr, fmt, ap);
+ }
+}
+
+
+/* msg - for general output. Can be suppressed by -q,-quiet. Output */
+/* goes to stderr so it doesn't conflict with stdout output */
+void
+msg(char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap,fmt);
+
+ if (!A_QUIET)
+ if (A_MSG_STDOUT) {
+ vfprintf(stdout, fmt, ap);
+ fflush(stdout);
+ } else {
+ vfprintf(stderr, fmt, ap);
+ fflush(stderr);
+ }
+}
+
+void
+debugOptions()
+{
+ int idx;
+ msg("Possible options are: ");
+ for(idx=0;debugLookup[idx].name!=0;idx++)
+ msg("%s,",debugLookup[idx].name);
+ msg("\010 \n");
+}
+
+
+/* debugSetup - if debugging is turned on sets up the debug flags from */
+/* the command line arguments */
+
+void
+debugSetup(char *dbgFlags)
+{
+#ifndef DEBUG
+ warn("Debugging has not been compiled into this version of amp\n");
+#else
+ char *ptr;
+ int idx;
+
+ memset(&debugFlags,0,sizeof(debugFlags));
+
+ ptr=strtok(dbgFlags,",");
+ while(ptr) {
+ for(idx=0;debugLookup[idx].name!=0;idx++) {
+ if (strcmp(debugLookup[idx].name,ptr)==0) {
+ *(debugLookup[idx].var)=1;
+ break;
+ }
+ }
+ if (debugLookup[idx].name==0) {
+ warn("Debug option, %s, does not exist\n",ptr);
+ debugOptions();
+ exit(1);
+ }
+ ptr=strtok(NULL,",");
+ }
+
+ DB(args,
+ for(idx=0;debugLookup[idx].name!=0;idx++)
+ printf("Flag: %s = %d\n",debugLookup[idx].name,*(debugLookup[idx].var));
+ );
+#endif
+}
+
diff --git a/setedit/mp3/mp3list.cc b/setedit/mp3/mp3list.cc
new file mode 100644
index 0000000..369a60d
--- /dev/null
+++ b/setedit/mp3/mp3list.cc
@@ -0,0 +1,412 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#ifdef SUP_MP3
+/*****************************************************************************
+
+Falta agregar opciones al men de iniciar y parar de tocar una lista =>
+va pidiendo archivos de aca previo chequear que haya alguna. Sera bueno
+habilitar y deshabilitar los comandos del men.
+
+*****************************************************************************/
+
+#include <stdio.h>
+
+#define Uses_TSListBox
+#define Uses_TStringCollection
+#define Uses_TSLabel
+#define Uses_TEvent
+#define Uses_TApplication
+#define Uses_TDialog
+#define Uses_TSHzGroup
+#define Uses_TSButton
+#define Uses_fpstream
+#define Uses_MsgBox
+#define Uses_TStreamable
+#define Uses_TStreamableClass
+#define Uses_FileOpenAid
+#define Uses_TNoSortedStringCollection
+#define Uses_TFileDialog
+#define Uses_fcntl
+#define Uses_limits
+#define Uses_string
+#define Uses_unistd
+
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+#define SUP_MP3
+#define Uses_PrivateMP3Info
+#include <intermp3.h>
+
+// for execDialog
+#define Uses_SETAppDialogs
+#include <setapp.h>
+
+#include <fileopen.h>
+
+static int LastServed=0;
+const char *mp3ListExt="*.[lm][s3][tu]";
+const char M3USignature[]="#EXTM3U";
+
+static TNoSortedStringCollection *List=0;
+
+class TListDiag : public TDialog
+{
+public:
+ TListDiag(const TRect& bounds, const char *aTitle) :
+ TWindowInit(&TListDiag::initFrame),
+ TDialog(bounds,aTitle) {};
+ virtual void handleEvent(TEvent &event);
+ void SaveList(char *s);
+ void LoadList(char *s);
+ void ImportM3U(const char *name);
+
+ TListBox *listBox;
+ int style;
+};
+
+static
+void EnableComms(void)
+{
+ TView::enableCommand(cmaDeleteMP3);
+ TView::enableCommand(cmaInsertMP3);
+}
+
+static
+void DisableComms(void)
+{
+ TView::disableCommand(cmaDeleteMP3);
+ TView::disableCommand(cmaInsertMP3);
+}
+
+
+const char *MP3ext="*.mp[23]";
+
+void TListDiag::handleEvent(TEvent &event)
+{
+ char fileName[PATH_MAX];
+
+ TDialog::handleEvent( event );
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmaInsertMP3:
+ case cmaAddMP3:
+ strcpy(fileName,MP3ext);
+ style=(event.message.command==cmaAddMP3);
+ GenericFileDialog(__("Select a file"),fileName,(char *)MP3ext,
+ hID_OpenMP3,fdMultipleSel | fdSelectButton);
+ if (List->getCount())
+ EnableComms();
+ break;
+ case cmaDeleteMP3:
+ // Note: we can't trust in the disabled command, this task is performed
+ // during idle and if you delete the entries quickly you can get here.
+ if (listBox->focused<List->getCount())
+ {
+ List->atRemove(listBox->focused);
+ listBox->setRange(List->getCount());
+ listBox->drawView();
+ if (!List->getCount())
+ DisableComms();
+ }
+ break;
+ case cmaSaveMP3List:
+ strcpy(fileName,mp3ListExt);
+ if (GenericFileDialog(__("Save file list"),fileName,0,hID_SaveMP3,
+ fdDialogForSave)!=cmCancel)
+ SaveList(fileName);
+ break;
+ case cmaLoadMP3List:
+ strcpy(fileName,mp3ListExt);
+ if (GenericFileDialog(__("Load list of files"),fileName,0,hID_OpenMP3)
+ !=cmCancel)
+ {
+ LoadList(fileName);
+ if (List->getCount())
+ EnableComms();
+ }
+ break;
+ default:
+ return;
+ }
+ }
+ else
+ if (event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmFileDialogFileSelected:
+ if (style)
+ List->insert(newStr((char *)event.message.infoPtr));
+ else
+ List->atInsert(listBox->focused,
+ newStr((char *)event.message.infoPtr));
+ listBox->setRange(List->getCount());
+ listBox->drawView();
+ break;
+ default:
+ return;
+ }
+ }
+ else
+ return;
+ clearEvent(event);
+}
+
+static char *Signature="SET's Files list\x1A";
+const int Version=0x100;
+
+void TListDiag::SaveList(char *name)
+{
+ fpstream *f=new fpstream(name,CLY_IOSOut|CLY_IOSBin);
+
+ if (f)
+ {
+ fpstream &s=*f;
+
+ // Analize the extension
+ char *ext=strrchr(name,'.');
+ if (ext && strcasecmp(ext,".m3u")==0)
+ {// Export as M3U file
+ f->close();
+ delete f;
+ FILE *f=fopen(name,"wt");
+ if (f)
+ {
+ fprintf(f,"%s\n",M3USignature);
+ int i,c=List->getCount();
+ for (i=0; i<c; i++)
+ fprintf(f,"%s\n",(char *)(List->at(i)));
+ }
+ return;
+ }
+ s.writeString(Signature);
+ s << Version << List;
+
+ if (!f)
+ {
+ messageBox(__("Could not create the list file."),mfOKButton | mfError);
+ f->close();
+ ::remove(name);
+ }
+ else
+ f->close();
+ }
+ delete f;
+}
+
+void TListDiag::ImportM3U(const char *name)
+{
+ TNoSortedStringCollection *newList=new TNoSortedStringCollection(10,5);
+
+ FILE *f=fopen(name,"r");
+ if (!f) return;
+
+ char buffer[PATH_MAX+4],*s;
+ while (!feof(f))
+ {
+ if (fgets(buffer,PATH_MAX+2,f))
+ {
+ if (buffer[0]=='#') continue;
+ buffer[PATH_MAX]=0;
+ for (s=buffer; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+ newList->insert(newStr(buffer));
+ }
+ }
+ if (newList->getCount())
+ {
+ listBox->newList(newList);
+ List=newList;
+ }
+ fclose(f);
+}
+
+void TListDiag::LoadList(char *name)
+{
+ char buffer[80];
+
+ #ifdef BROKEN_CPP_OPEN_STREAM
+ // In this way we avoid the destruction of the file
+ int h=open(name, O_RDONLY | O_BINARY);
+ fpstream *f=new fpstream(h);
+ #else
+ fpstream *f=new fpstream(name,CLY_IOSIn | CLY_IOSBin);
+ #endif
+
+ if (!f)
+ messageBox(__("Could not open the list file"),mfOKButton | mfError);
+ else
+ {
+ // Check for .m3u
+ f->readBytes(buffer,sizeof(M3USignature));
+ f->seekg(0);
+ if (strncmp(buffer,M3USignature,sizeof(M3USignature)-1)==0)
+ {
+ ImportM3U(name);
+ f->close();
+ }
+ else
+ {
+ fpstream &s=*f;
+ int fileVersion;
+
+ s.readString(buffer,80);
+ if (strcmp(buffer,Signature)!=0)
+ {
+ messageBox(__("Wrong file type."), mfOKButton | mfError);
+ return;
+ }
+ s >> fileVersion;
+ TNoSortedStringCollection *newList;
+ s >> newList;
+
+ if (!f)
+ messageBox(__("Error reading the file list"),mfOKButton | mfError);
+ else
+ {
+ if (newList)
+ {
+ listBox->newList(newList);
+ List=newList;
+ }
+ }
+ f->close();
+ }
+ }
+ delete f;
+}
+
+void MP3ListSaveState(opstream &os)
+{
+ if (List)
+ os << 1 << List << LastServed;
+ else
+ os << 0;
+}
+
+void MP3ListLoadState(ipstream &is)
+{
+ int aux;
+
+ is >> aux;
+ if (aux)
+ {
+ is >> List >> LastServed;
+ if (List)
+ TView::enableCommand(cmeMP3PlayList);
+ }
+ else
+ {
+ List=0;
+ LastServed=0;
+ }
+}
+
+struct stDataRect
+{
+ TCollection *col;
+ unsigned focused;
+} dataRect;
+
+void MP3EditPlayList()
+{
+ if (!List)
+ List=new TNoSortedStringCollection(5,3);
+ if (List->getCount())
+ EnableComms();
+ else
+ DisableComms();
+
+ TListDiag *ListDia=new TListDiag(TRect(1,1,1,1),__("Play List"));
+ TSViewCol *col=new TSViewCol(ListDia);
+
+ TSListBox *listB=new TSListBox(60,12,tsslbVertical | tsslbHorizontal,1,PATH_MAX);
+ TSLabel *ListB=new TSLabel(__("List of files"),listB);
+ ListDia->listBox=(TListBox *)listB->view;
+
+ TSHzGroup *buttons=new TSHzGroup(new TSButton(__("~A~dd"),cmaAddMP3),
+ new TSHzGroup(new TSButton(__("~I~nsert"),cmaInsertMP3),
+ new TSHzGroup(new TSButton(__("~D~elete"),cmaDeleteMP3),
+ new TSHzGroup(new TSButton(__("~S~ave"),cmaSaveMP3List),
+ new TSHzGroup(new TSButton(__("~L~oad"),cmaLoadMP3List),
+ new TSButton(__("~O~k"),cmOK,bfDefault))))));
+
+ col->insert(2,1,ListB);
+ col->insert(xTSCenter,yTSDown,buttons);
+ col->doIt();
+ delete col;
+
+ dataRect.col=List;
+ dataRect.focused=0;
+
+ ListDia->options|=ofCentered;
+ execDialog(ListDia,&dataRect);
+
+ if (List->getCount()>0)
+ TView::enableCommand(cmeMP3PlayList);
+ else
+ {
+ TView::disableCommand(cmeMP3PlayList);
+ TView::disableCommand(cmeMP3StopList);
+ }
+}
+
+char *MP3ListGetNext()
+{
+ if (LastServed<List->getCount())
+ return (char *)List->at(LastServed++);
+ return 0;
+}
+
+void MP3ListResetCount()
+{
+ LastServed=0;
+}
+
+int MP3ListHavePrev()
+{
+ return LastServed>1;
+}
+
+int MP3ListHaveNext()
+{
+ return LastServed<List->getCount();
+}
+
+void MP3ListGoBack()
+{
+ if (MP3ListHavePrev())
+ LastServed-=2;
+}
+#else
+
+#define Uses_TNoSortedStringCollection
+#include <settvuti.h>
+
+void MP3ListLoadState(ipstream &is)
+{
+ int aux;
+ int LastServed;
+ TNoSortedStringCollection *List;
+
+ is >> aux;
+ if (aux)
+ {
+ is >> List >> LastServed;
+ if (List)
+ delete List;
+ }
+ else
+ {
+ List=0;
+ LastServed=0;
+ }
+}
+
+#endif
diff --git a/setedit/mp3/mp3play.cc b/setedit/mp3/mp3play.cc
new file mode 100644
index 0000000..0ad460c
--- /dev/null
+++ b/setedit/mp3/mp3play.cc
@@ -0,0 +1,684 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#ifdef SUP_MP3
+
+#define Uses_limits
+#define Uses_stdio
+#define Uses_string
+#include <tv.h>
+
+#ifdef HAVE_ALLEGRO
+#include <allegro.h>
+#endif
+#include <mp3play.h>
+
+MP3Player mp3;
+
+char MP3Player::Name[PATH_MAX]="";
+
+char MP3Player::Stoped=1;
+char MP3Player::Selected=0;
+char MP3Player::SelectedIsLoaded=0;
+char MP3Player::Paused=0;
+char MP3Player::PlayingList=0;
+char MP3Player::Converting=0;
+
+char MP3Player::Title[31];
+char MP3Player::Author[31];
+char MP3Player::Album[35];
+char MP3Player::Comment[31];
+const char *MP3Player::Genre="Unknown";
+int MP3Player::SampleRate=0;
+int MP3Player::BitRate=0;
+const char *MP3Player::Mode="";
+int MP3Player::MPEGVer=0;
+int MP3Player::Layer=0;
+int MP3Player::TotalLen=0;
+int MP3Player::PausedPos=0;
+char *(*MP3Player::GetNext)()=0;
+void (*MP3Player::EndOfList)()=0;
+char MP3Player::FileToPlay[PATH_MAX]="";
+int MP3Player::Strategy=mp3UnBuffered;
+char MP3Player::butRew[]="\x11\x11";
+char MP3Player::butStop[]="\xFE";
+char MP3Player::butPlay[]="\x10";
+char MP3Player::butPause[]="\x13";
+char MP3Player::butFfw[]="\x10\x10";
+char MP3Player::obutRew[]="\x11\x11";
+char MP3Player::obutStop[]="\xFE";
+char MP3Player::obutPlay[]="\x10";
+char MP3Player::obutPause[]="\x13";
+char MP3Player::obutFfw[]="\x10\x10";
+
+void MP3Player::SelectNewFile(char *fileName)
+{
+ strcpy(Name,fileName);
+ Selected=1;
+ SelectedIsLoaded=0;
+}
+
+int MP3Player::ConvertSelectedFile(char *name)
+{
+ if (!Selected)
+ return 1;
+
+ Converting=1;
+ PlayingList=0;
+ strcpy(FileToPlay,Name);
+ if (!PlayFileToPlay(name))
+ Converting=0;
+
+ return 2;
+}
+
+void MP3Player::StartPlayList(char *(*aGetNext)(), void (*aEndOfList)())
+{
+ SetupPlayList(aGetNext,aEndOfList);
+ PlayingList=1;
+ PlayNext();
+}
+
+void MP3Player::SetupPlayList(char *(*aGetNext)(), void (*aEndOfList)())
+{
+ GetNext=aGetNext;
+ EndOfList=aEndOfList;
+}
+
+void MP3Player::PlayNext()
+{
+ if (!PlayingList)
+ return;
+ char *next=GetNext();
+ if (!next)
+ {
+ Stoped=1;
+ PlayingList=0;
+ EndOfList();
+ }
+ else
+ {
+ strcpy(FileToPlay,next);
+ PlayFileToPlay();
+ }
+}
+
+void MP3Player::StopPlayList()
+{
+ Stop();
+ PlayingList=0;
+}
+
+#ifdef HAVE_AMP
+/*****************************************************************************
+
+I'm using a patched libamp because:
+
+1) formats.c: wav_end ends with exit(0) Ugh!
+2) audiolib.c: undefined TRACK... to save CPU and to get track of the
+ position when writing to a file.
+
+Old stuff:
+Q: Why the sound quality is so poor? the same data sent to a file and played
+with GRepVoc is FAR better.
+A: Seems that Allegro streaming routines are crap (22KHz 8bits).
+--> So then I contributed 16 bits mixing code to Allegro project ;-)))
+
+*****************************************************************************/
+
+
+#include <libamp.h>
+
+extern "C" {
+#include <getbits.h>
+#include <audio.h>
+#include <formats.h>
+}
+
+
+static
+const char *GenreStr[]={
+"Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop", // 0-7
+"Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock",// 8-17
+"Techno","Industrial","Alternative","Ska","Death Metal","Pranks", // 18-23
+"Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk", // 24-29
+"Fusion","Trance","Classical","Instrumental","Acid","House","Game", // 30-36
+"Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space", // 37-44
+"Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic", // 45-49
+"Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream", // 50-55
+"Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap", // 56-61
+"Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic", // 62-67
+"Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz", // 63-74
+"Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock", // 75-81
+"National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic", // 82-88
+"Bluegrass","Avantgarde","Gothic Rock","Progressive Rock", // 89-92
+"Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus", // 93-97
+"Easy Listening","Acoustic","Humour","Speech","Chanson","Opera", // 98-103
+"Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove", // 104-109
+"Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad", // 110-116
+"Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo", // 117-122
+"Acapella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House", // 123-128
+"Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk punk","Beat", // 129-135
+"Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover", // 136-139
+"Contemporary Christian","Christian Rock" // 140-141
+};
+
+const int maxKnownGenre=sizeof(GenreStr)/sizeof(char *);
+
+extern struct AUDIO_HEADER amp_cur_header;
+
+// Returns 1 if no file were selected, 2 if the file was loaded, 3 if the file
+// was already loaded and just did a play
+int MP3Player::PlaySelectedFile()
+{
+ if (!Selected)
+ return 1;
+
+ int ret;
+ PlayingList=0;
+
+ if (SelectedIsLoaded)
+ {
+ replay_amp();
+ Stoped=0;
+ ret=3;
+ }
+ else
+ {
+ strcpy(FileToPlay,Name);
+ if (PlayFileToPlay())
+ SelectedIsLoaded=1;
+ ret=2;
+ }
+ return ret;
+}
+
+int MP3Player::PlayFileToPlay(char *out)
+{
+ long fileLen=GetMP3Info();
+
+ if (fileLen==-1)
+ {
+ Stoped=1;
+ return 0;
+ }
+
+ if (out)
+ {
+ out_file=fopen(out,"wb");
+ A_AUDIO_PLAY=FALSE;
+ A_WRITE_TO_FILE=TRUE;
+ A_FORMAT_WAVE=TRUE;
+ }
+ else
+ {
+ A_AUDIO_PLAY=TRUE;
+ A_WRITE_TO_FILE=FALSE;
+ }
+ if (!load_amp(FileToPlay,0))
+ {
+ Stoped=1;
+ return 0;
+ }
+
+ // Fill the information fields with the data from the header
+ SampleRate=t_sampling_frequency[amp_cur_header.ID][amp_cur_header.sampling_frequency];
+ BitRate=t_bitrate[amp_cur_header.ID][3-amp_cur_header.layer][amp_cur_header.bitrate_index];
+ Mode=amp_cur_header.mode==3 ? "mono" : "stereo";
+ MPEGVer=amp_cur_header.ID==1 ? 1 : 2;
+ Layer=4-amp_cur_header.layer;
+ TotalLen=(int)(fileLen/(BitRate*1000.0)*8.0);
+
+ Stoped=0;
+ return 1;
+}
+
+long MP3Player::GetMP3Info(void)
+{
+ FILE *f;
+ char buffer[128];
+ long ret;
+
+ f=fopen(FileToPlay,"rb");
+ if (!f)
+ {
+ *Title=0;
+ *Author=0;
+ *Album=0;
+ *Comment=0;
+ Genre="";
+ return -1;
+ }
+ fseek(f,-128,SEEK_END);
+ fread(buffer,128,1,f);
+ ret=ftell(f);
+ if (buffer[0]=='T' && buffer[1]=='A' && buffer[2]=='G')
+ {
+ memcpy(Title,buffer+3,30);
+ Title[30]=0;
+ memcpy(Author,buffer+33,30);
+ Author[30]=0;
+ memcpy(Album,buffer+63,34); // Plus year
+ Album[34]=0;
+ memcpy(Comment,buffer+97,30);
+ Comment[30]=0;
+ if (((unsigned char)buffer[127])>=maxKnownGenre)
+ Genre="Unknown";
+ else
+ Genre=GenreStr[(unsigned char)buffer[127]];
+ ret-=128;
+ }
+ else
+ {
+ int l=strlen(FileToPlay);
+ if (l>30)
+ {
+ memcpy(Title,FileToPlay+(l-30),30);
+ Title[0]=Title[1]=Title[2]='.';
+ Title[30]=0;
+ }
+ else
+ {
+ memcpy(Title,FileToPlay,l);
+ Title[l]=0;
+ }
+ *Author=0;
+ *Album=0;
+ *Comment=0;
+ }
+ fclose(f);
+
+ return ret;
+}
+
+void MP3Player::Stop()
+{
+ stop_amp();
+ if (A_WRITE_TO_FILE)
+ {
+ A_AUDIO_PLAY=TRUE;
+ A_WRITE_TO_FILE=FALSE;
+ wav_end(&amp_cur_header);
+ fclose(out_file);
+ }
+ Stoped=1;
+ Paused=0;
+ Converting=0;
+}
+
+int MP3Player::Poll()
+{
+ if (!Stoped)
+ {
+ int ret=Strategy==mp3UnBuffered ? poll_amp() : run_amp();
+ if (ret<0)
+ {
+ if (PlayingList)
+ {
+ PlayNext();
+ if (Stoped)
+ return 4;
+ return 3;
+ }
+ Stoped=1;
+ Converting=0;
+ return 2;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+int MP3Player::Init()
+{
+ allegro_init();
+ if (install_sound(DIGI_AUTODETECT,MIDI_NONE,NULL))
+ {
+ printf("Unable to install Allegro sound driver\n");
+ return 1;
+ }
+ install_amp();
+
+ set_volume(255,-1);
+ amp_reverse_phase=1;
+ return 0;
+}
+
+void MP3Player::deInit()
+{
+ unload_amp();
+ remove_sound();
+}
+
+int MP3Player::GetTime()
+{
+ return amp_time;
+}
+
+void MP3Player::FFwd()
+{
+ if (!Converting && !Stoped)
+ seek_amp_rel(4*amp_samprat/amp_pollsize); /* seek 4 seconds */
+}
+
+void MP3Player::Rew()
+{
+ if (!Converting && !Stoped)
+ seek_amp_rel(-4*amp_samprat/amp_pollsize); /* seek 4 seconds */
+}
+
+void MP3Player::TogglePause()
+{
+ if (!Converting && (!Stoped || Paused))
+ {
+ if (Paused)
+ {
+ Paused=0;
+ //PlaySelectedFile();
+ if (PlayFileToPlay())
+ seek_amp_abs(PausedPos);
+ }
+ else
+ {
+ PausedPos=amp_frame;
+ Stop();
+ Paused=1;
+ }
+ }
+}
+
+void MP3Player::Pause()
+{
+ if (!Stoped && !Converting)
+ {
+ Stop();
+ Paused=1; // After calling stop because stop resets Paused
+ PausedPos=amp_frame;
+ }
+}
+
+void MP3Player::SeekAbs(int seconds)
+{
+ seek_amp_abs(seconds*amp_samprat/amp_pollsize);
+}
+
+#endif // HAVE_AMP
+
+#ifdef HAVE_MPEGSOUND
+/*****************************************************************************
+
+I'm using a patched mpegsound library because:
+
+1) I added support for MP3s inside wavs.
+2) I added support for Allegro.
+3) I did the library more robust to support damaged files.
+4) I added support for VBR encoded files.
+5) Fixed many bugs and added various members to make it easier to use.
+
+I tried to contact the author to merge my changes without luck.
+
+*****************************************************************************/
+
+#include <string.h>
+#include "mpegsound/mpegsound.h"
+
+static Mpegwavtoraw *MP3Engine=0;
+static Soundinputstream *InputStream=0;
+static Rawplayer *Player=0;
+static Rawtowav *ToFile=0;
+
+// Returns 1 if no file were selected, 2 if the file was loaded, 3 if the file
+// was already loaded and just did a play
+int MP3Player::PlaySelectedFile()
+{
+ if (!Selected)
+ return 1;
+
+ int ret;
+ PlayingList=0;
+
+ if (SelectedIsLoaded)
+ {
+ MP3Engine->setframe(0);
+ MP3Engine->startplay();
+ Stoped=0;
+ ret=3;
+ }
+ else
+ {
+ strcpy(FileToPlay,Name);
+ if (PlayFileToPlay())
+ SelectedIsLoaded=1;
+ ret=2;
+ }
+ return ret;
+}
+
+static
+double OneFrameInSeconds()
+{
+ return (MP3Engine->getframesize()*8.0)/(MP3Engine->getbitrate()*1000);
+}
+
+int MP3Player::PlayFileToPlay(char *out)
+{
+ // Destroy old engine:
+ delete MP3Engine;
+ delete InputStream;
+ delete ToFile;
+ MP3Engine=0;
+ InputStream=0;
+ ToFile=0;
+ // Create a new input stream
+ int errorcode;
+ InputStream=Soundinputstream::hopen(FileToPlay,&errorcode);
+ if (!InputStream)
+ {
+ GetMP3Info(); // Just the name
+ Stoped=1;
+ return 0;
+ }
+ // If we are converting to a file create it
+ if (out)
+ {
+ ToFile=new Rawtowav;
+ if (!ToFile->initialize(out))
+ {
+ Stoped=0;
+ return 0;
+ }
+ }
+ // Now create the engine
+ MP3Engine=new Mpegwavtoraw(InputStream,out ? (Soundplayer *)ToFile :
+ (Soundplayer *)Player);
+ MP3Engine->initialize(FileToPlay,false);
+ GetMP3Info();
+ MP3Engine->startplay();
+
+ // Fill the information fields with the data from the header
+ SampleRate=MP3Engine->getfrequency();
+ BitRate=MP3Engine->getbitrate();
+ Mode=MP3Engine->isstereo() ? "stereo" : "mono";
+ MPEGVer=MP3Engine->getversion()+1;
+ Layer=MP3Engine->getlayer();
+ TotalLen=MP3Engine->gettotaltime()/1000;
+
+ Stoped=0;
+ return 1;
+}
+
+long MP3Player::GetMP3Info(void)
+{
+ if (MP3Engine)
+ {
+ memcpy(Title,MP3Engine->getname(),31);
+ memcpy(Author,MP3Engine->getartist(),31);
+ memcpy(Album,MP3Engine->getalbum(),31);
+ int i;
+ for (i=0; Album[i]; i++);
+ for (; i<30; i++) Album[i]=' ';
+ Album[i]=0;
+ strcat(Album,MP3Engine->getyear());
+ memcpy(Comment,MP3Engine->getcomment(),31);
+ Genre=MP3Engine->getgenre();
+ }
+ else
+ {
+ *Title=0;
+ *Author=0;
+ *Album=0;
+ *Comment=0;
+ Genre="Unknown";
+ }
+
+ if (!*Title)
+ {
+ int l=strlen(FileToPlay);
+ if (l>30)
+ {
+ memcpy(Title,FileToPlay+(l-30),30);
+ Title[0]=Title[1]=Title[2]='.';
+ Title[30]=0;
+ }
+ else
+ {
+ memcpy(Title,FileToPlay,l);
+ Title[l]=0;
+ }
+ }
+ return 0;
+}
+
+void MP3Player::Stop()
+{
+ if (MP3Engine) MP3Engine->stopplay();
+ Stoped=1;
+ Paused=0;
+ Converting=0;
+}
+
+static
+int DoAPoll(int strategy)
+{
+ if (!MP3Engine) return -1;
+ if (strategy==mp3UnBuffered)
+ {
+ if (MP3Engine->callformore())
+ return MP3Engine->run(1) ? 0 : -1;
+ }
+ else
+ {
+ while (MP3Engine->callformore())
+ if (!MP3Engine->run(1)) return -1;
+ }
+ return 0;
+}
+
+int MP3Player::Poll()
+{
+ if (!Stoped && !Paused)
+ {
+ #ifdef TVOS_DOS
+ int ret=DoAPoll(Strategy);
+ #else
+ int ret=DoAPoll(mp3Buffered);
+ #endif
+ if (ret<0)
+ {
+ if (PlayingList)
+ {
+ PlayNext();
+ if (Stoped)
+ return 4;
+ return 3;
+ }
+ Stoped=1;
+ Converting=0;
+ return 2;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+int MP3Player::Init()
+{
+ Player=new Rawplayer;
+ Player->initialize(Rawplayer::defaultdevice);
+ if (Player->geterrorcode()!=SOUND_ERROR_OK) return 1;
+ return 0;
+}
+
+void MP3Player::deInit()
+{
+ delete MP3Engine;
+ delete InputStream;
+ delete Player;
+}
+
+int MP3Player::GetTime()
+{
+ return MP3Engine ? MP3Engine->getcurtime()/1000 : 0;
+}
+
+void MP3Player::FFwd()
+{
+ if (!MP3Engine) return;
+ if (!Converting && !Stoped)
+ { // Compute 4 seconds in frames:
+ int offset=(int)(4.0/OneFrameInSeconds());
+ MP3Engine->setframe(MP3Engine->getcurrentframe()+offset);
+ }
+}
+
+void MP3Player::Rew()
+{
+ if (!MP3Engine) return;
+ if (!Converting && !Stoped)
+ { // Compute 4 seconds in frames:
+ int offset=(int)(4.0/OneFrameInSeconds());
+ MP3Engine->setframe(MP3Engine->getcurrentframe()-offset);
+ }
+}
+
+void MP3Player::TogglePause()
+{
+ if (!Converting && (!Stoped || Paused))
+ {
+ if (Paused)
+ {
+ if (!MP3Engine) PlayFileToPlay();
+ if (!MP3Engine) return;
+ MP3Engine->setframe(PausedPos);
+ Paused=0;
+ }
+ else
+ {
+ if (!MP3Engine) return;
+ PausedPos=MP3Engine->getcurrentframe();
+ MP3Engine->stopplay();
+ Paused=1;
+ }
+ }
+}
+
+void MP3Player::Pause()
+{
+ if (!Stoped && !Converting)
+ {
+ PausedPos=MP3Engine->getcurrentframe();
+ MP3Engine->stopplay();
+ Paused=1;
+ }
+}
+
+void MP3Player::SeekAbs(int seconds)
+{
+ if (!MP3Engine) return;
+ MP3Engine->settimepos(seconds*1000);
+}
+
+#endif // HAVE_MPEGSOUND
+
+#endif // SUP_MP3
diff --git a/setedit/mp3/mp3play.h b/setedit/mp3/mp3play.h
new file mode 100644
index 0000000..eda1acc
--- /dev/null
+++ b/setedit/mp3/mp3play.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// A static class to join the variables
+class MP3Player
+{
+public:
+ MP3Player() {};
+
+ static void SelectNewFile(char *fileName);
+ static int PlaySelectedFile(void);
+ static int ConvertSelectedFile(char *name);
+ static long GetMP3Info(void);
+ static void Stop();
+ static int Poll();
+ static int Init();
+ static void deInit();
+ static int GetTime();
+ static void FFwd();
+ static void Rew();
+ static void TogglePause();
+ static void Pause();
+ static void SeekAbs(int seconds);
+ static void StartPlayList(char *(*aGetNext)(), void (*aEndOfList)());
+ static void SetupPlayList(char *(*aGetNext)(), void (*aEndOfList)());
+ static void StopPlayList();
+
+ static char Name[PATH_MAX];
+ static char Title[31];
+ static char Author[31];
+ static char Album[35];
+ static char Comment[31];
+ static const char *Genre;
+
+ static char Stoped;
+ static char Selected;
+ static char SelectedIsLoaded;
+ static char Paused;
+ static char PlayingList;
+ static char Converting;
+
+ static int SampleRate;
+ static int BitRate;
+ static const char *Mode;
+ static int MPEGVer;
+ static int Layer;
+ static int TotalLen;
+ static int PausedPos;
+
+ static int Strategy;
+
+ static void PlayNext();
+
+ static char FileToPlay[PATH_MAX];
+ static int PlayFileToPlay(char *out=0);
+
+ static char butRew[];
+ static char butStop[];
+ static char butPlay[];
+ static char butPause[];
+ static char butFfw[];
+ static char obutRew[];
+ static char obutStop[];
+ static char obutPlay[];
+ static char obutPause[];
+ static char obutFfw[];
+
+protected:
+ static char *(*GetNext)();
+ static void (*EndOfList)();
+};
+
+extern MP3Player mp3;
+
+const int mp3Buffered=1, mp3UnBuffered=0;
diff --git a/setedit/mp3/mpegsound/.cvsignore b/setedit/mp3/mpegsound/.cvsignore
new file mode 100644
index 0000000..6fff36c
--- /dev/null
+++ b/setedit/mp3/mpegsound/.cvsignore
@@ -0,0 +1,3 @@
+*.mak
+rhide.env
+
diff --git a/setedit/mp3/mpegsound/bitwindow.cc b/setedit/mp3/mpegsound/bitwindow.cc
new file mode 100644
index 0000000..604035b
--- /dev/null
+++ b/setedit/mp3/mpegsound/bitwindow.cc
@@ -0,0 +1,64 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Bitwindow.cc
+// It's bit reservior for MPEG layer 3
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+#ifndef WORDS_BIGENDIAN
+#define _KEY 0
+#else
+#define _KEY 3
+#endif
+
+int Mpegbitwindow::getbits(int bits)
+{
+ union
+ {
+ char store[4];
+ int current;
+ }u;
+ int bi;
+
+ if(!bits)return 0;
+
+ u.current=0;
+ bi=(bitindex&7);
+ // u.store[_KEY]=buffer[(bitindex>>3)&(WINDOWSIZE-1)]<<bi;
+ u.store[_KEY]=buffer[bitindex>>3]<<bi;
+ bi=8-bi;
+ bitindex+=bi;
+
+ while(bits)
+ {
+ if(!bi)
+ {
+ // u.store[_KEY]=buffer[(bitindex>>3)&(WINDOWSIZE-1)];
+ u.store[_KEY]=buffer[bitindex>>3];
+ bitindex+=8;
+ bi=8;
+ }
+
+ if(bits>=bi)
+ {
+ u.current<<=bi;
+ bits-=bi;
+ bi=0;
+ }
+ else
+ {
+ u.current<<=bits;
+ bi-=bits;
+ bits=0;
+ }
+ }
+ bitindex-=bi;
+
+ return (u.current>>8);
+}
diff --git a/setedit/mp3/mpegsound/common.imk b/setedit/mp3/mpegsound/common.imk
new file mode 100644
index 0000000..a49a2b7
--- /dev/null
+++ b/setedit/mp3/mpegsound/common.imk
@@ -0,0 +1,30 @@
+#!/usr/bin/make
+
+vpath %.c $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath_obj=obj
+vpath %.o $(vpath_obj)
+
+# These files changes the compilation process so they are important
+# dependencies.
+MAKEFILE_DEPS=rhide.env common.imk
+# Extensions used by GNU tools
+ExOBJ=.o
+ExEXE=.exe
+ExLIB=.a
+
+RHIDE_AS=$(RHIDE_GCC)
+SOURCE_NAME=$<
+OUTFILE=$@
+ALL_PREREQ=$^
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler-with-cpp\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+LIB_DIRS=$(RHIDE_OS_LIBS_PATH) .
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_ARFLAGS=rcs
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE)\
+ $(ALL_PREREQ)
diff --git a/setedit/mp3/mpegsound/fileinput.cc b/setedit/mp3/mpegsound/fileinput.cc
new file mode 100644
index 0000000..ebfbd1b
--- /dev/null
+++ b/setedit/mp3/mpegsound/fileinput.cc
@@ -0,0 +1,95 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Woo-jae Jung */
+
+// Binput.cc
+// Inputstream from file
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "mpegsound.h"
+
+/************************/
+/* Input bitstrem class */
+/************************/
+Soundinputstreamfromfile::~Soundinputstreamfromfile()
+{
+ if(fp)fclose(fp);
+}
+
+bool Soundinputstreamfromfile::open(char *filename)
+{
+ struct stat buf;
+
+ stat(filename,&buf);
+ size=buf.st_size;
+
+ if(filename==NULL)
+ {
+ fp=stdin;
+ size=0;
+ return true;
+ }
+ else if((fp=Mpegsound_fopenR(filename))==NULL)
+ {
+ seterrorcode(SOUND_ERROR_FILEOPENFAIL);
+ return false;
+ }
+ canseek=true;
+ return true;
+}
+
+int Soundinputstreamfromfile::getbytedirect(void)
+{
+ int c;
+
+ if((c=getc(fp))<0)
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+
+ return c;
+}
+
+bool Soundinputstreamfromfile::_readbuffer(char *buffer,int size)
+{
+ if(fread(buffer,size,1,fp)!=1)
+ {
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return false;
+ }
+
+ return true;
+}
+
+bool Soundinputstreamfromfile::eof(void)
+{
+ return feof(fp);
+};
+
+int Soundinputstreamfromfile::getblock(char *buffer,int size)
+{
+ return fread(buffer,1,size,fp);
+}
+
+int Soundinputstreamfromfile::getsize(void)
+{
+ return size;
+}
+
+void Soundinputstreamfromfile::setposition(int pos)
+{
+ if(fp==stdin)return;
+ fseek(fp,pos,SEEK_SET);
+}
+
+int Soundinputstreamfromfile::getposition(void)
+{
+ if(fp==stdin)return 0;
+ return ftell(fp);
+}
+
+
diff --git a/setedit/mp3/mpegsound/fileplayer.cc b/setedit/mp3/mpegsound/fileplayer.cc
new file mode 100644
index 0000000..a46f533
--- /dev/null
+++ b/setedit/mp3/mpegsound/fileplayer.cc
@@ -0,0 +1,252 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Fileplayer.cc
+// It's an example for how to use MPEG/WAVE Sound library
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#include "mpegsound.h"
+
+// File player superclass
+Fileplayer::Fileplayer()
+{
+ __errorcode=SOUND_ERROR_OK;
+ player=NULL;
+};
+
+Fileplayer::~Fileplayer()
+{
+ delete player;
+};
+
+
+// Wave file player
+Wavefileplayer::Wavefileplayer()
+{
+ loader=NULL;
+ server=NULL;
+}
+
+Wavefileplayer::~Wavefileplayer()
+{
+ if(loader)delete loader;
+ if(server)delete server;
+}
+
+bool Wavefileplayer::openfile(char *filename,char *device)
+{
+// Player
+ if(device==NULL)device=Rawplayer::defaultdevice;
+
+ if(device[0]=='/')player=new Rawplayer;
+ else
+ {
+ if(strstr(device,".WAV") || strstr(device,".wav"))
+ player=new Rawtowav;
+ else
+ player=new Rawtofile;
+ if(device[0]=='-')device=NULL;
+ }
+
+ if(player==NULL)
+ return seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ if(!player->initialize(device))return seterrorcode(player->geterrorcode());
+
+// Loader
+ {
+ int err;
+
+ if((loader=Soundinputstream::hopen(filename,&err))==NULL)
+ return seterrorcode(err);
+ }
+
+// Server
+ if((server=new Wavetoraw(loader,player))==NULL)
+ return seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ return server->initialize();
+}
+
+void Wavefileplayer::setforcetomono(bool flag)
+{
+ server->setforcetomono(flag);
+};
+
+bool Wavefileplayer::playing(int verbose)
+{
+ if(!server->run())return false; // Read first time
+
+ if(verbose>0)
+ {
+ fprintf(stderr,
+ "Verbose : %dbits, "
+ "%dHz, "
+ "%s\n",
+ server->getsamplesize(),
+ server->getfrequency(),
+ server->isstereo()?"Stereo":"Mono");
+ }
+
+ while(server->run()); // Playing
+
+ seterrorcode(server->geterrorcode());
+ if(geterrorcode()==SOUND_ERROR_FINISH)return true;
+ return false;
+}
+
+
+
+
+// Mpegfileplayer
+Mpegfileplayer::Mpegfileplayer()
+{
+ loader=NULL;
+ server=NULL;
+};
+
+Mpegfileplayer::~Mpegfileplayer()
+{
+ if(loader)delete loader;
+ if(server)delete server;
+}
+
+bool Mpegfileplayer::openfile(char *filename,char *device)
+{
+// Player
+ if(device==NULL)device=Rawplayer::defaultdevice;
+
+ if(device[0]=='/')player=new Rawplayer;
+ else
+ {
+ if(strstr(device,".WAV") || strstr(device,".wav"))
+ player=new Rawtowav;
+ else
+ player=new Rawtofile;
+ if(device[0]=='-')device=NULL;
+ }
+
+ if(player==NULL)
+ return seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ if(!player->initialize(device))
+ return seterrorcode(player->geterrorcode());
+
+// Loader
+ {
+ int err;
+ if((loader=Soundinputstream::hopen(filename,&err))==NULL)
+ return seterrorcode(err);
+ }
+
+// Server
+ if((server=new Mpegwavtoraw(loader,player))==NULL)
+ return seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+
+// Initialize server
+ server->initialize(filename);
+ return true;
+}
+
+void Mpegfileplayer::setforcetomono(bool flag)
+{
+ server->setforcetomono(flag);
+};
+
+void Mpegfileplayer::setdownfrequency(int value)
+{
+ server->setdownfrequency(value);
+};
+
+#ifdef __DJGPP__
+#include <dpmi.h>
+#define ReleaseCPU() __dpmi_yield()
+#else
+#define ReleaseCPU() usleep(10)
+#endif
+
+bool Mpegfileplayer::playing(int verbose)
+{
+ if(!server->startplay())return false; // Initialize MPEG Layer 3
+ if(verbose>0)showverbose(verbose);
+ do
+ {
+ while(!server->callformore()) ReleaseCPU();
+ }
+ while(server->run(1)); // Playing
+
+ seterrorcode(server->geterrorcode());
+ if(seterrorcode(SOUND_ERROR_FINISH))return true;
+ return false;
+}
+
+#ifdef PTHREADEDMPEG
+bool Mpegfileplayer::playingwiththread(int verbose,int framenumbers)
+{
+ if(framenumbers<20)return playing(verbose);
+
+ server->makethreadedplayer(framenumbers);
+
+ if(!server->run(-1))return false; // Initialize MPEG Layer 3
+ if(verbose>0)showverbose(verbose);
+ while(server->run(100)); // Playing
+ server->freethreadedplayer();
+
+ seterrorcode(server->geterrorcode());
+ if(seterrorcode(SOUND_ERROR_FINISH))return true;
+ return false;
+}
+#endif
+
+void Mpegfileplayer::showverbose(int verbose)
+{
+ static char *modestring[4]={"stereo","joint stereo","dual channel","mono"};
+
+ fprintf(stderr,"Verbose: MPEG-%d Layer %d, %s,\n\t%dHz%s, %dkbit/s, ",
+ server->getversion()+1,
+ server->getlayer(),modestring[server->getmode()],
+ server->getfrequency(),server->getdownfrequency()?"/2":"",
+ server->getbitrate());
+ fprintf(stderr,server->getcrccheck()
+ ? "with crc check\n"
+ : "without crc check\n");
+ if(verbose>1)
+ {
+ fprintf(stderr,
+ "Songname : %s\n"
+ "Artist : %s\n"
+ "Album : %s\n"
+ "Year : %s\n"
+ "Comment : %s\n"
+ "Genre : %s\n",
+ server->getname(),
+ server->getartist(),
+ server->getalbum(),
+ server->getyear(),
+ server->getcomment(),
+ server->getgenre());
+ }
+}
+
+bool Mpegfileplayer::startplay(void)
+{
+ return server->startplay();
+}
+
+bool Mpegfileplayer::callformore(void)
+{
+ return server->callformore();
+}
+
+bool Mpegfileplayer::playmore(void)
+{
+ server->run(1);
+ seterrorcode(server->geterrorcode());
+ if(seterrorcode(SOUND_ERROR_FINISH))return false;
+ return true;
+}
+
diff --git a/setedit/mp3/mpegsound/filter.cc b/setedit/mp3/mpegsound/filter.cc
new file mode 100644
index 0000000..f3f5d35
--- /dev/null
+++ b/setedit/mp3/mpegsound/filter.cc
@@ -0,0 +1,341 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Filter.cc
+// Subbandsynthesis routines from maplay 1.2 for Linux
+// I've modified some macros for reducing source code.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+void Mpegtoraw::computebuffer(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE])
+{
+ REAL p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,pf;
+ REAL q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,qa,qb,qc,qd,qe,qf;
+ REAL *out1,*out2;
+
+ out1=buffer[currentcalcbuffer]+calcbufferoffset;
+ out2=buffer[currentcalcbuffer^1]+calcbufferoffset;
+#define OUT1(v,t) out1[(32-(v))*16] =(-(out1[(v)*16]=t))
+#define OUT2(v) out2[(96-(v)-32)*16]=out2[((v)-32)*16]
+
+ // compute new values via a fast cosine transform:
+ {
+ register REAL *x=fraction;
+
+ p0=x[ 0]+x[31];p1=x[ 1]+x[30];p2=x[ 2]+x[29];p3=x[ 3]+x[28];
+ p4=x[ 4]+x[27];p5=x[ 5]+x[26];p6=x[ 6]+x[25];p7=x[ 7]+x[24];
+ p8=x[ 8]+x[23];p9=x[ 9]+x[22];pa=x[10]+x[21];pb=x[11]+x[20];
+ pc=x[12]+x[19];pd=x[13]+x[18];pe=x[14]+x[17];pf=x[15]+x[16];
+ }
+
+
+ q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
+ q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
+ q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
+ qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
+ qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
+ qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);
+
+ p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
+ p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
+ p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
+ p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
+ pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
+ pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);
+
+ q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
+ q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
+ q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
+ qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);
+
+ p0=q0+q1;p1=hcos_4*(q0-q1);p2=q2+q3;p3=hcos_4*(q2-q3);
+ p4=q4+q5;p5=hcos_4*(q4-q5);p6=q6+q7;p7=hcos_4*(q6-q7);
+ p8=q8+q9;p9=hcos_4*(q8-q9);pa=qa+qb;pb=hcos_4*(qa-qb);
+ pc=qc+qd;pd=hcos_4*(qc-qd);pe=qe+qf;pf=hcos_4*(qe-qf);
+
+ {
+ register REAL tmp;
+
+ tmp=p6+p7;
+ OUT2(36)=-(p5+tmp);
+ OUT2(44)=-(p4+tmp);
+ tmp=pb+pf;
+ OUT1(10,tmp);
+ OUT1(6,pd+tmp);
+ tmp=pe+pf;
+ OUT2(46)=-(p8+pc+tmp);
+ OUT2(34)=-(p9+pd+tmp);
+ tmp+=pa+pb;
+ OUT2(38)=-(pd+tmp);
+ OUT2(42)=-(pc+tmp);
+ OUT1(2,p9+pd+pf);
+ OUT1(4,p5+p7);
+ OUT2(48)=-p0;
+ out2[0]=-(out1[0]=p1);
+ OUT1( 8,p3);
+ OUT1(12,p7);
+ OUT1(14,pf);
+ OUT2(40)=-(p2+p3);
+ }
+
+ {
+ register REAL *x=fraction;
+
+ p0=hcos_64[ 0]*(x[ 0]-x[31]);p1=hcos_64[ 1]*(x[ 1]-x[30]);
+ p2=hcos_64[ 2]*(x[ 2]-x[29]);p3=hcos_64[ 3]*(x[ 3]-x[28]);
+ p4=hcos_64[ 4]*(x[ 4]-x[27]);p5=hcos_64[ 5]*(x[ 5]-x[26]);
+ p6=hcos_64[ 6]*(x[ 6]-x[25]);p7=hcos_64[ 7]*(x[ 7]-x[24]);
+ p8=hcos_64[ 8]*(x[ 8]-x[23]);p9=hcos_64[ 9]*(x[ 9]-x[22]);
+ pa=hcos_64[10]*(x[10]-x[21]);pb=hcos_64[11]*(x[11]-x[20]);
+ pc=hcos_64[12]*(x[12]-x[19]);pd=hcos_64[13]*(x[13]-x[18]);
+ pe=hcos_64[14]*(x[14]-x[17]);pf=hcos_64[15]*(x[15]-x[16]);
+ }
+
+ q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
+ q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
+ q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
+ qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
+ qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
+ qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);
+
+ p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
+ p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
+ p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
+ p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
+ pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
+ pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);
+
+ q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
+ q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
+ q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
+ qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);
+
+ p0=q0+q1;p1=hcos_4*(q0-q1);
+ p2=q2+q3;p3=hcos_4*(q2-q3);
+ p4=q4+q5;p5=hcos_4*(q4-q5);
+ p6=q6+q7;p7=hcos_4*(q6-q7);
+ p8=q8+q9;p9=hcos_4*(q8-q9);
+ pa=qa+qb;pb=hcos_4*(qa-qb);
+ pc=qc+qd;pd=hcos_4*(qc-qd);
+ pe=qe+qf;pf=hcos_4*(qe-qf);
+
+ {
+ REAL tmp;
+
+ tmp=pd+pf;
+ OUT1(5,p5+p7+pb+tmp);
+ tmp+=p9;
+ OUT1(1,p1+tmp);
+ OUT2(33)=-(p1+pe+tmp);
+ tmp+=p5+p7;
+ OUT1(3,tmp);
+ OUT2(35)=-(p6+pe+tmp);
+ tmp=pa+pb+pc+pd+pe+pf;
+ OUT2(39)=-(p2+p3+tmp-pc);
+ OUT2(43)=-(p4+p6+p7+tmp-pd);
+ OUT2(37)=-(p5+p6+p7+tmp-pc);
+ OUT2(41)=-(p2+p3+tmp-pd);
+ tmp=p8+pc+pe+pf;
+ OUT2(47)=-(p0+tmp);
+ OUT2(45)=-(p4+p6+p7+tmp);
+ tmp=pb+pf;
+ OUT1(11,p7+tmp);
+ tmp+=p3;
+ OUT1( 9,tmp);
+ OUT1( 7,pd+tmp);
+ OUT1(13,p7+pf);
+ OUT1(15,pf);
+ }
+}
+
+
+#define SAVE \
+ raw=(int)(r*scalefactor); \
+ if(raw>MAXSCALE)raw=MAXSCALE;else if(raw<MINSCALE)raw=MINSCALE; \
+ putraw(raw);
+#define OS r=*vp * *dp++
+#define XX vp+=15;r+=*vp * *dp++
+#define OP r+=*--vp * *dp++
+
+/*inline SET: I don't see what can we gain making it inline and it makes some gcc
+ versions get confused in some situations */
+void Mpegtoraw::generatesingle(void)
+{
+ int i;
+ register REAL r, *vp;
+ register const REAL *dp;
+ int raw;
+
+ i=32;
+ dp=filter;
+ vp=calcbufferL[currentcalcbuffer]+calcbufferoffset;
+// actual_v+actual_write_pos;
+
+ switch (calcbufferoffset)
+ {
+ case 0:for(;i;i--,vp+=15){
+ OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 1:for(;i;i--,vp+=15){
+ OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 2:for(;i;i--,vp+=15){
+ OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 3:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 4:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 5:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 6:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 7:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 8:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 9:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 10:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
+ SAVE;}break;
+ case 11:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
+ SAVE;}break;
+ case 12:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
+ SAVE;}break;
+ case 13:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
+ SAVE;}break;
+ case 14:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
+ SAVE;}break;
+ case 15:for(;i;i--,vp+=31){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ }
+}
+
+#undef OS
+#undef XX
+#undef OP
+#undef SAVE
+
+#define SAVE \
+ raw=(int)(r1*scalefactor); \
+ if(raw>MAXSCALE)raw=MAXSCALE;else if(raw<MINSCALE)raw=MINSCALE; \
+ putraw(raw); \
+ raw=(int)(r2*scalefactor); \
+ if(raw>MAXSCALE)raw=MAXSCALE;else if(raw<MINSCALE)raw=MINSCALE; \
+ putraw(raw);
+#define OS r1=*vp1 * *dp; \
+ r2=*vp2 * *dp++
+#define XX vp1+=15;r1+=*vp1 * *dp; \
+ vp2+=15;r2+=*vp2 * *dp++
+#define OP r1+=*--vp1 * *dp; \
+ r2+=*--vp2 * *dp++
+
+
+/*inline */
+void Mpegtoraw::generate(void)
+{
+ int i;
+ REAL r1,r2;
+ register REAL *vp1,*vp2;
+ register const REAL *dp;
+ int raw;
+
+ dp=filter;
+ vp1=calcbufferL[currentcalcbuffer]+calcbufferoffset;
+ vp2=calcbufferR[currentcalcbuffer]+calcbufferoffset;
+// actual_v+actual_write_pos;
+
+ i=32;
+ switch (calcbufferoffset)
+ {
+ case 0:for(;i;i--,vp1+=15,vp2+=15){
+ OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 1:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 2:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 3:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 4:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 5:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 6:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 7:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 8:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 9:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 10:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
+ SAVE;}break;
+ case 11:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
+ SAVE;}break;
+ case 12:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
+ SAVE;}break;
+ case 13:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
+ SAVE;}break;
+ case 14:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
+ SAVE;}break;
+ case 15:for(;i;i--,vp1+=31,vp2+=31){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ }
+}
+
+
+void Mpegtoraw::subbandsynthesis(REAL *fractionL,REAL *fractionR)
+{
+ if(downfrequency)
+ {
+ subbandsynthesis_2(fractionL,fractionR);
+ return;
+ }
+
+ computebuffer(fractionL,calcbufferL);
+ if(!outputstereo)generatesingle();
+ else
+ {
+ computebuffer(fractionR,calcbufferR);
+ generate();
+ }
+
+ if(calcbufferoffset<15)calcbufferoffset++;
+ else calcbufferoffset=0;
+
+ currentcalcbuffer^=1;
+}
diff --git a/setedit/mp3/mpegsound/filter_2.cc b/setedit/mp3/mpegsound/filter_2.cc
new file mode 100644
index 0000000..1b8a2db
--- /dev/null
+++ b/setedit/mp3/mpegsound/filter_2.cc
@@ -0,0 +1,357 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Filter.cc
+// Subbandsynthesis routines from maplay 1.2 for Linux
+// I've modified some macros for reducing source code.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+void Mpegtoraw::computebuffer_2(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE])
+{
+ REAL p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,pf;
+ REAL q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,qa,qb,qc,qd,qe,qf;
+ REAL *out1,*out2;
+
+ out1=buffer[currentcalcbuffer]+calcbufferoffset;
+ out2=buffer[currentcalcbuffer^1]+calcbufferoffset;
+#define OUT1(v,t) out1[(32-(v))*16] =(-(out1[(v)*16]=t))
+#define OUT2(v) out2[(96-(v)-32)*16]=out2[((v)-32)*16]
+
+ // compute new values via a fast cosine transform:
+ /* {
+ register REAL *x=fraction;
+
+ p0=x[ 0]+x[31];p1=x[ 1]+x[30];p2=x[ 2]+x[29];p3=x[ 3]+x[28];
+ p4=x[ 4]+x[27];p5=x[ 5]+x[26];p6=x[ 6]+x[25];p7=x[ 7]+x[24];
+ p8=x[ 8]+x[23];p9=x[ 9]+x[22];pa=x[10]+x[21];pb=x[11]+x[20];
+ pc=x[12]+x[19];pd=x[13]+x[18];pe=x[14]+x[17];pf=x[15]+x[16];
+ }
+
+ q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
+ q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
+ q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
+ qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
+ qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
+ qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8); */
+
+ {
+ register REAL *x=fraction;
+
+ q0=x[ 0]+x[15];q1=x[ 1]+x[14];q2=x[ 2]+x[13];q3=x[ 3]+x[12];
+ q4=x[ 4]+x[11];q5=x[ 5]+x[10];q6=x[ 6]+x[ 9];q7=x[ 7]+x[ 8];
+
+ q8=hcos_32[0]*(x[ 0]-x[15]);q9=hcos_32[1]*(x[ 1]-x[14]);
+ qa=hcos_32[2]*(x[ 2]-x[13]);qb=hcos_32[3]*(x[ 3]-x[12]);
+ qc=hcos_32[4]*(x[ 4]-x[11]);qd=hcos_32[5]*(x[ 5]-x[10]);
+ qe=hcos_32[6]*(x[ 6]-x[ 9]);qf=hcos_32[7]*(x[ 7]-x[ 8]);
+ }
+
+ p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
+ p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
+ p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
+ p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
+ pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
+ pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);
+
+ q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
+ q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
+ q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
+ qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);
+
+ p0=q0+q1;p1=hcos_4*(q0-q1);p2=q2+q3;p3=hcos_4*(q2-q3);
+ p4=q4+q5;p5=hcos_4*(q4-q5);p6=q6+q7;p7=hcos_4*(q6-q7);
+ p8=q8+q9;p9=hcos_4*(q8-q9);pa=qa+qb;pb=hcos_4*(qa-qb);
+ pc=qc+qd;pd=hcos_4*(qc-qd);pe=qe+qf;pf=hcos_4*(qe-qf);
+
+ {
+ register REAL tmp;
+
+ tmp=p6+p7;
+ OUT2(36)=-(p5+tmp);
+ OUT2(44)=-(p4+tmp);
+ tmp=pb+pf;
+ OUT1(10,tmp);
+ OUT1(6,pd+tmp);
+ tmp=pe+pf;
+ OUT2(46)=-(p8+pc+tmp);
+ OUT2(34)=-(p9+pd+tmp);
+ tmp+=pa+pb;
+ OUT2(38)=-(pd+tmp);
+ OUT2(42)=-(pc+tmp);
+ OUT1(2,p9+pd+pf);
+ OUT1(4,p5+p7);
+ OUT2(48)=-p0;
+ out2[0]=-(out1[0]=p1);
+ OUT1( 8,p3);
+ OUT1(12,p7);
+ OUT1(14,pf);
+ OUT2(40)=-(p2+p3);
+ }
+
+ {
+ register REAL *x=fraction;
+
+ /* p0=hcos_64[ 0]*(x[ 0]-x[31]);p1=hcos_64[ 1]*(x[ 1]-x[30]);
+ p2=hcos_64[ 2]*(x[ 2]-x[29]);p3=hcos_64[ 3]*(x[ 3]-x[28]);
+ p4=hcos_64[ 4]*(x[ 4]-x[27]);p5=hcos_64[ 5]*(x[ 5]-x[26]);
+ p6=hcos_64[ 6]*(x[ 6]-x[25]);p7=hcos_64[ 7]*(x[ 7]-x[24]);
+ p8=hcos_64[ 8]*(x[ 8]-x[23]);p9=hcos_64[ 9]*(x[ 9]-x[22]);
+ pa=hcos_64[10]*(x[10]-x[21]);pb=hcos_64[11]*(x[11]-x[20]);
+ pc=hcos_64[12]*(x[12]-x[19]);pd=hcos_64[13]*(x[13]-x[18]);
+ pe=hcos_64[14]*(x[14]-x[17]);pf=hcos_64[15]*(x[15]-x[16]); */
+
+ p0=hcos_64[ 0]*x[ 0];p1=hcos_64[ 1]*x[ 1];
+ p2=hcos_64[ 2]*x[ 2];p3=hcos_64[ 3]*x[ 3];
+ p4=hcos_64[ 4]*x[ 4];p5=hcos_64[ 5]*x[ 5];
+ p6=hcos_64[ 6]*x[ 6];p7=hcos_64[ 7]*x[ 7];
+ p8=hcos_64[ 8]*x[ 8];p9=hcos_64[ 9]*x[ 9];
+ pa=hcos_64[10]*x[10];pb=hcos_64[11]*x[11];
+ pc=hcos_64[12]*x[12];pd=hcos_64[13]*x[13];
+ pe=hcos_64[14]*x[14];pf=hcos_64[15]*x[15];
+ }
+
+ q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
+ q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
+ q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
+ qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
+ qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
+ qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);
+
+ p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
+ p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
+ p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
+ p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
+ pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
+ pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);
+
+ q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
+ q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
+ q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
+ qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);
+
+ p0=q0+q1;p1=hcos_4*(q0-q1);
+ p2=q2+q3;p3=hcos_4*(q2-q3);
+ p4=q4+q5;p5=hcos_4*(q4-q5);
+ p6=q6+q7;p7=hcos_4*(q6-q7);
+ p8=q8+q9;p9=hcos_4*(q8-q9);
+ pa=qa+qb;pb=hcos_4*(qa-qb);
+ pc=qc+qd;pd=hcos_4*(qc-qd);
+ pe=qe+qf;pf=hcos_4*(qe-qf);
+
+ {
+ REAL tmp;
+
+ tmp=pd+pf;
+ OUT1(5,p5+p7+pb+tmp);
+ tmp+=p9;
+ OUT1(1,p1+tmp);
+ OUT2(33)=-(p1+pe+tmp);
+ tmp+=p5+p7;
+ OUT1(3,tmp);
+ OUT2(35)=-(p6+pe+tmp);
+ tmp=pa+pb+pc+pd+pe+pf;
+ OUT2(39)=-(p2+p3+tmp-pc);
+ OUT2(43)=-(p4+p6+p7+tmp-pd);
+ OUT2(37)=-(p5+p6+p7+tmp-pc);
+ OUT2(41)=-(p2+p3+tmp-pd);
+ tmp=p8+pc+pe+pf;
+ OUT2(47)=-(p0+tmp);
+ OUT2(45)=-(p4+p6+p7+tmp);
+ tmp=pb+pf;
+ OUT1(11,p7+tmp);
+ tmp+=p3;
+ OUT1( 9,tmp);
+ OUT1( 7,pd+tmp);
+ OUT1(13,p7+pf);
+ OUT1(15,pf);
+ }
+}
+
+
+#define SAVE \
+ raw=(int)(r*scalefactor); \
+ if(raw>MAXSCALE)raw=MAXSCALE;else if(raw<MINSCALE)raw=MINSCALE; \
+ putraw(raw); \
+ dp+=16;vp+=15+(15-14)
+#define OS r=*vp * *dp++
+#define XX vp+=15;r+=*vp * *dp++
+#define OP r+=*--vp * *dp++
+
+/*inline SET: I don't see what can we gain making it inline and it makes some gcc
+ versions get confused in some situations */
+void Mpegtoraw::generatesingle_2(void)
+{
+ int i;
+ register REAL r, *vp;
+ register const REAL *dp;
+ int raw;
+
+ i=32/2;
+ dp=filter;
+ vp=calcbufferL[currentcalcbuffer]+calcbufferoffset;
+// actual_v+actual_write_pos;
+
+ switch (calcbufferoffset)
+ {
+ case 0:for(;i;i--,vp+=15){
+ OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 1:for(;i;i--,vp+=15){
+ OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 2:for(;i;i--,vp+=15){
+ OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 3:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 4:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 5:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 6:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 7:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 8:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 9:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 10:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
+ SAVE;}break;
+ case 11:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
+ SAVE;}break;
+ case 12:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
+ SAVE;}break;
+ case 13:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
+ SAVE;}break;
+ case 14:for(;i;i--,vp+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
+ SAVE;}break;
+ case 15:for(;i;i--,vp+=31){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ }
+}
+
+#undef OS
+#undef XX
+#undef OP
+#undef SAVE
+
+#define SAVE \
+ raw=(int)(r1*scalefactor); \
+ if(raw>MAXSCALE)raw=MAXSCALE;else if(raw<MINSCALE)raw=MINSCALE; \
+ putraw(raw); \
+ raw=(int)(r2*scalefactor); \
+ if(raw>MAXSCALE)raw=MAXSCALE;else if(raw<MINSCALE)raw=MINSCALE; \
+ putraw(raw); \
+ dp+=16;vp1+=15+(15-14);vp2+=15+(15-14)
+#define OS r1=*vp1 * *dp; \
+ r2=*vp2 * *dp++
+#define XX vp1+=15;r1+=*vp1 * *dp; \
+ vp2+=15;r2+=*vp2 * *dp++
+#define OP r1+=*--vp1 * *dp; \
+ r2+=*--vp2 * *dp++
+
+
+/*inline */
+void Mpegtoraw::generate_2(void)
+{
+ int i;
+ REAL r1,r2;
+ register REAL *vp1,*vp2;
+ register const REAL *dp;
+ int raw;
+
+ dp=filter;
+ vp1=calcbufferL[currentcalcbuffer]+calcbufferoffset;
+ vp2=calcbufferR[currentcalcbuffer]+calcbufferoffset;
+// actual_v+actual_write_pos;
+
+ i=32/2;
+ switch (calcbufferoffset)
+ {
+ case 0:for(;i;i--,vp1+=15,vp2+=15){
+ OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 1:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 2:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 3:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 4:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 5:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 6:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 7:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 8:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 9:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ case 10:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
+ SAVE;}break;
+ case 11:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
+ SAVE;}break;
+ case 12:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
+ SAVE;}break;
+ case 13:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
+ SAVE;}break;
+ case 14:for(;i;i--,vp1+=15,vp2+=15){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
+ SAVE;}break;
+ case 15:for(;i;i--,vp1+=31,vp2+=31){
+ OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
+ SAVE;}break;
+ }
+}
+
+
+void Mpegtoraw::subbandsynthesis_2(REAL *fractionL,REAL *fractionR)
+{
+ computebuffer_2(fractionL,calcbufferL);
+ if(!outputstereo)generatesingle_2();
+ else
+ {
+ computebuffer_2(fractionR,calcbufferR);
+ generate_2();
+ }
+
+ if(calcbufferoffset<15)calcbufferoffset++;
+ else calcbufferoffset=0;
+
+ currentcalcbuffer^=1;
+}
diff --git a/setedit/mp3/mpegsound/httpinput.cc b/setedit/mp3/mpegsound/httpinput.cc
new file mode 100644
index 0000000..c70377a
--- /dev/null
+++ b/setedit/mp3/mpegsound/httpinput.cc
@@ -0,0 +1,308 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Woo-jae Jung */
+
+// Httpinputstream.cc
+// Inputstream for http
+
+// It's from mpg123
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_SOCKET
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "mpegsound.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <netdb.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xffffffff
+#endif
+
+static const char *httpstr="http://";
+
+bool Soundinputstreamfromhttp::writestring(int fd, char *string)
+{
+ int result,bytes=strlen(string);
+
+ while(bytes)
+ {
+ if((result=write(fd,string,bytes))<0 && errno!=EINTR)
+ {
+ seterrorcode(SOUND_ERROR_HTTPWRITEFAIL);
+ return false;
+ }
+ else if(result==0)
+ {
+ seterrorcode(SOUND_ERROR_HTTPWRITEFAIL);
+ return false;
+ }
+ string += result;
+ bytes -= result;
+ }
+
+ return true;
+}
+
+bool Soundinputstreamfromhttp::readstring(char *string,int maxlen,FILE *f)
+{
+ char *result;
+
+ do{
+ result=fgets(string,maxlen,f);
+ }while(!result && errno==EINTR);
+ if(!result)
+ {
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return false;
+ }
+
+ return true;
+}
+
+static char *strndup(char *src,int num)
+{
+ char *dst;
+
+ if(!(dst=(char *)malloc(num+1)))return NULL;
+ dst[num]='\0';
+
+ return strncpy(dst, src, num);
+}
+
+static char *url2hostport(char *url,char **hname,
+ unsigned long *hip,unsigned int *port)
+{
+ char *cptr;
+ struct hostent *myhostent;
+ struct in_addr myaddr;
+ int isip=1;
+
+ if(!(strncmp(url,httpstr,7)))url+=7;
+ cptr=url;
+ while(*cptr && *cptr!=':' && *cptr!='/')
+ {
+ if((*cptr<'0' || *cptr>'9') && *cptr!='.')isip=0;
+ cptr++;
+ }
+ if(!(*hname=strndup(url,cptr-url)))
+ {
+ *hname=NULL;
+ return NULL;
+ }
+ if(!isip)
+ {
+ if (!(myhostent=gethostbyname(*hname)))return NULL;
+ memcpy(&myaddr,myhostent->h_addr,sizeof(myaddr));
+ *hip=myaddr.s_addr;
+ }
+ else if((*hip=inet_addr(*hname))==INADDR_NONE)return NULL;
+ if(!*cptr || *cptr=='/')
+ {
+ *port=80;
+ return cptr;
+ }
+ *port=atoi(++cptr);
+ while(*cptr && *cptr!='/')cptr++;
+ return cptr;
+}
+
+char *proxyurl=NULL;
+unsigned long proxyip=0;
+unsigned int proxyport;
+
+FILE *Soundinputstreamfromhttp::http_open(char *url)
+{
+ char *purl=NULL,*host,*request,*sptr;
+ char agent[50];
+ int linelength;
+ unsigned long myip;
+ unsigned int myport;
+ int sock;
+ int relocate=0,numrelocs=0;
+ struct sockaddr_in server;
+ FILE *myfile;
+
+ if(!proxyip)
+ {
+ if(!proxyurl)
+ if(!(proxyurl=getenv("MP3_HTTP_PROXY")))
+ if(!(proxyurl=getenv("http_proxy")))
+ proxyurl = getenv("HTTP_PROXY");
+ if (proxyurl && proxyurl[0] && strcmp(proxyurl, "none"))
+ {
+ if (!(url2hostport(proxyurl, &host, &proxyip, &proxyport)))
+ {
+ seterrorcode(SOUND_ERROR_UNKNOWNPROXY);
+ return NULL;
+ }
+ if(host)free(host);
+ }
+ else
+ proxyip = INADDR_NONE;
+ }
+
+ if((linelength=strlen(url)+100)<1024)
+ linelength=1024;
+ if(!(request=(char *)malloc(linelength)) || !(purl=(char *)malloc(1024)))
+ {
+ seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ return NULL;
+ }
+ strncpy(purl,url,1023);
+ purl[1023]='\0';
+ do{
+ strcpy(request,"GET ");
+ if(proxyip!=INADDR_NONE)
+ {
+ if(strncmp(url,httpstr,7))
+ strcat(request,httpstr);
+ strcat(request,purl);
+ myport=proxyport;
+ myip=proxyip;
+ }
+ else
+ {
+ if(!(sptr=url2hostport(purl,&host,&myip,&myport)))
+ {
+ seterrorcode(SOUND_ERROR_UNKNOWNHOST);
+ return NULL;
+ }
+ if (host)
+ free (host);
+ strcat (request, sptr);
+ }
+ sprintf (agent, " HTTP/1.0\r\nUser-Agent: %s/%s\r\n\r\n",
+ "Splay","0.6");
+ strcat (request, agent);
+ server.sin_family = AF_INET;
+ server.sin_port = htons(myport);
+ server.sin_addr.s_addr = myip;
+ if((sock=socket(PF_INET,SOCK_STREAM,6))<0)
+ {
+ seterrorcode(SOUND_ERROR_SOCKET);
+ return NULL;
+ }
+ if(connect(sock,(struct sockaddr *)&server,sizeof(server)))
+ {
+ seterrorcode(SOUND_ERROR_CONNECT);
+ return NULL;
+ }
+ if(!writestring(sock,request))return NULL;
+ if(!(myfile=fdopen(sock, "rb")))
+ {
+ seterrorcode(SOUND_ERROR_FDOPEN);
+ return NULL;
+ };
+ relocate=false;
+ purl[0]='\0';
+ if(!readstring(request,linelength-1,myfile))return NULL;
+ if((sptr=strchr(request,' ')))
+ {
+ switch(sptr[1])
+ {
+ case '3':relocate=true;
+ case '2':break;
+ default: seterrorcode(SOUND_ERROR_HTTPFAIL);
+ return NULL;
+ }
+ }
+ do{
+ if(!readstring(request,linelength-1,myfile))return NULL;
+ if(!strncmp(request,"Location:",9))
+ strncpy (purl,request+10,1023);
+ }while(request[0]!='\r' && request[0]!='n');
+ }while(relocate && purl[0] && numrelocs++<5);
+ if(relocate)
+ {
+ seterrorcode(SOUND_ERROR_TOOMANYRELOC);
+ return NULL;
+ }
+ free(purl);
+ free(request);
+ return myfile;
+}
+
+Soundinputstreamfromhttp::Soundinputstreamfromhttp()
+{
+ fp=NULL;
+}
+
+Soundinputstreamfromhttp::~Soundinputstreamfromhttp()
+{
+ if(fp)fclose(fp);
+}
+
+bool Soundinputstreamfromhttp::open(char *url)
+{
+ if((fp=http_open(url))==NULL)
+ {
+ seterrorcode(SOUND_ERROR_FILEOPENFAIL);
+ return false;
+ }
+
+ return true;
+}
+
+int Soundinputstreamfromhttp::getbytedirect(void)
+{
+ int c;
+
+ if((c=getc(fp))<0)
+ {
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return -1;
+ }
+
+ return c;
+}
+
+bool Soundinputstreamfromhttp::_readbuffer(char *buffer,int size)
+{
+ if(fread(buffer,size,1,fp)!=1)
+ {
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return false;
+ }
+ return true;
+}
+
+bool Soundinputstreamfromhttp::eof(void)
+{
+ return feof(fp);
+};
+
+int Soundinputstreamfromhttp::getblock(char *buffer,int size)
+{
+ int l;
+ l=fread(buffer,1,size,fp);
+ if(l==0)seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return l;
+}
+
+int Soundinputstreamfromhttp::getsize(void)
+{
+ return 0;
+}
+
+void Soundinputstreamfromhttp::setposition(int)
+{
+}
+
+int Soundinputstreamfromhttp::getposition(void)
+{
+ return 0;
+}
+#endif
diff --git a/setedit/mp3/mpegsound/huffmantable.cc b/setedit/mp3/mpegsound/huffmantable.cc
new file mode 100644
index 0000000..d02f849
--- /dev/null
+++ b/setedit/mp3/mpegsound/huffmantable.cc
@@ -0,0 +1,587 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Huffmantable.cc
+// It contains initialized huffman table for MPEG layer 3
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+static const unsigned int
+htd01[ 7][2]={{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 2, 1},{ 0, 1},
+ { 0, 17}},
+
+htd02[ 17][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
+ { 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 33},
+ { 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}},
+
+htd03[ 17][2]={{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 1},{ 2, 1},{ 0, 17},
+ { 2, 1},{ 0, 16},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 33},
+ { 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}},
+
+htd05[ 31][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
+ { 2, 1},{ 0, 17},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 32},
+ { 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 3},{ 0, 19},
+ { 2, 1},{ 0, 49},{ 2, 1},{ 0, 50},{ 2, 1},{ 0, 35},
+ { 0, 51}},
+
+htd06[ 31][2]={{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},{ 0, 17},
+ { 6, 1},{ 2, 1},{ 0, 1},{ 2, 1},{ 0, 32},{ 0, 33},
+ { 6, 1},{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34},
+ { 4, 1},{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},
+ { 0, 48},{ 0, 50},{ 2, 1},{ 0, 35},{ 2, 1},{ 0, 3},
+ { 0, 51}},
+
+htd07[ 71][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
+ { 8, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
+ { 0, 2},{ 0, 33},{ 18, 1},{ 6, 1},{ 2, 1},{ 0, 18},
+ { 2, 1},{ 0, 34},{ 0, 48},{ 4, 1},{ 2, 1},{ 0, 49},
+ { 0, 19},{ 4, 1},{ 2, 1},{ 0, 3},{ 0, 50},{ 2, 1},
+ { 0, 35},{ 0, 4},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 64},
+ { 0, 65},{ 2, 1},{ 0, 20},{ 2, 1},{ 0, 66},{ 0, 36},
+ { 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 51},{ 0, 67},
+ { 0, 80},{ 4, 1},{ 2, 1},{ 0, 52},{ 0, 5},{ 0, 81},
+ { 6, 1},{ 2, 1},{ 0, 21},{ 2, 1},{ 0, 82},{ 0, 37},
+
+ { 4, 1},{ 2, 1},{ 0, 68},{ 0, 53},{ 4, 1},{ 2, 1},
+ { 0, 83},{ 0, 84},{ 2, 1},{ 0, 69},{ 0, 85}},
+
+htd08[ 71][2]={{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 0, 1},
+ { 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 33},{ 0, 18},
+ { 14, 1},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 2},{ 2, 1},
+ { 0, 34},{ 4, 1},{ 2, 1},{ 0, 48},{ 0, 3},{ 2, 1},
+ { 0, 49},{ 0, 19},{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0, 50},{ 0, 35},{ 2, 1},{ 0, 64},{ 0, 4},{ 2, 1},
+ { 0, 65},{ 2, 1},{ 0, 20},{ 0, 66},{ 12, 1},{ 6, 1},
+ { 2, 1},{ 0, 36},{ 2, 1},{ 0, 51},{ 0, 80},{ 4, 1},
+ { 2, 1},{ 0, 67},{ 0, 52},{ 0, 81},{ 6, 1},{ 2, 1},
+ { 0, 21},{ 2, 1},{ 0, 5},{ 0, 82},{ 6, 1},{ 2, 1},
+
+ { 0, 37},{ 2, 1},{ 0, 68},{ 0, 53},{ 2, 1},{ 0, 83},
+ { 2, 1},{ 0, 69},{ 2, 1},{ 0, 84},{ 0, 85}},
+
+htd09[ 71][2]={{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},{ 2, 1},
+ { 0, 1},{ 0, 17},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 32},
+ { 0, 33},{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34},
+ { 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 48},{ 0, 3},
+ { 0, 49},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 50},{ 0, 35},
+ { 12, 1},{ 4, 1},{ 2, 1},{ 0, 65},{ 0, 20},{ 4, 1},
+ { 2, 1},{ 0, 64},{ 0, 51},{ 2, 1},{ 0, 66},{ 0, 36},
+ { 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 4},{ 0, 80},
+ { 0, 67},{ 2, 1},{ 0, 52},{ 0, 81},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0, 21},{ 0, 82},{ 2, 1},{ 0, 37},{ 0, 68},
+
+ { 6, 1},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 84},{ 0, 83},
+ { 2, 1},{ 0, 53},{ 2, 1},{ 0, 69},{ 0, 85}},
+
+htd10[127][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
+ { 10, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
+ { 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 28, 1},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 49},
+ { 0, 19},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 3},{ 0, 50},
+ { 2, 1},{ 0, 35},{ 0, 64},{ 4, 1},{ 2, 1},{ 0, 65},
+ { 0, 20},{ 4, 1},{ 2, 1},{ 0, 4},{ 0, 51},{ 2, 1},
+ { 0, 66},{ 0, 36},{ 28, 1},{ 10, 1},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0, 80},{ 0, 5},{ 0, 96},{ 2, 1},{ 0, 97},
+ { 0, 22},{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 67},
+
+ { 0, 52},{ 0, 81},{ 2, 1},{ 0, 21},{ 2, 1},{ 0, 82},
+ { 0, 37},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 54},{ 0,113},
+ { 20, 1},{ 8, 1},{ 2, 1},{ 0, 23},{ 4, 1},{ 2, 1},
+ { 0, 68},{ 0, 83},{ 0, 6},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0, 53},{ 0, 69},{ 0, 98},{ 2, 1},{ 0,112},{ 2, 1},
+ { 0, 7},{ 0,100},{ 14, 1},{ 4, 1},{ 2, 1},{ 0,114},
+ { 0, 39},{ 6, 1},{ 2, 1},{ 0, 99},{ 2, 1},{ 0, 84},
+ { 0, 85},{ 2, 1},{ 0, 70},{ 0,115},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0, 55},{ 0,101},{ 2, 1},{ 0, 86},{ 0,116},
+ { 6, 1},{ 2, 1},{ 0, 71},{ 2, 1},{ 0,102},{ 0,117},
+
+ { 4, 1},{ 2, 1},{ 0, 87},{ 0,118},{ 2, 1},{ 0,103},
+ { 0,119}},
+
+htd11[127][2]={{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 0, 1},
+ { 8, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
+ { 0, 2},{ 0, 18},{ 24, 1},{ 8, 1},{ 2, 1},{ 0, 33},
+ { 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},{ 4, 1},
+ { 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},{ 0, 50},
+ { 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},{ 2, 1},
+ { 0, 65},{ 0, 20},{ 30, 1},{ 16, 1},{ 10, 1},{ 4, 1},
+ { 2, 1},{ 0, 66},{ 0, 36},{ 4, 1},{ 2, 1},{ 0, 51},
+ { 0, 67},{ 0, 80},{ 4, 1},{ 2, 1},{ 0, 52},{ 0, 81},
+ { 0, 97},{ 6, 1},{ 2, 1},{ 0, 22},{ 2, 1},{ 0, 6},
+
+ { 0, 38},{ 2, 1},{ 0, 98},{ 2, 1},{ 0, 21},{ 2, 1},
+ { 0, 5},{ 0, 82},{ 16, 1},{ 10, 1},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0, 37},{ 0, 68},{ 0, 96},{ 2, 1},{ 0, 99},
+ { 0, 54},{ 4, 1},{ 2, 1},{ 0,112},{ 0, 23},{ 0,113},
+ { 16, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 7},{ 0,100},
+ { 0,114},{ 2, 1},{ 0, 39},{ 4, 1},{ 2, 1},{ 0, 83},
+ { 0, 53},{ 2, 1},{ 0, 84},{ 0, 69},{ 10, 1},{ 4, 1},
+ { 2, 1},{ 0, 70},{ 0,115},{ 2, 1},{ 0, 55},{ 2, 1},
+ { 0,101},{ 0, 86},{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0, 85},{ 0, 87},{ 0,116},{ 2, 1},{ 0, 71},{ 0,102},
+
+ { 4, 1},{ 2, 1},{ 0,117},{ 0,118},{ 2, 1},{ 0,103},
+ { 0,119}},
+
+htd12[127][2]={{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},{ 2, 1},
+ { 0, 17},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 32},{ 0, 2},
+ { 16, 1},{ 4, 1},{ 2, 1},{ 0, 33},{ 0, 18},{ 4, 1},
+ { 2, 1},{ 0, 34},{ 0, 49},{ 2, 1},{ 0, 19},{ 2, 1},
+ { 0, 48},{ 2, 1},{ 0, 3},{ 0, 64},{ 26, 1},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0, 50},{ 0, 35},{ 2, 1},{ 0, 65},
+ { 0, 51},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 20},{ 0, 66},
+ { 2, 1},{ 0, 36},{ 2, 1},{ 0, 4},{ 0, 80},{ 4, 1},
+ { 2, 1},{ 0, 67},{ 0, 52},{ 2, 1},{ 0, 81},{ 0, 21},
+ { 28, 1},{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 82},
+
+ { 0, 37},{ 2, 1},{ 0, 83},{ 0, 53},{ 4, 1},{ 2, 1},
+ { 0, 96},{ 0, 22},{ 0, 97},{ 4, 1},{ 2, 1},{ 0, 98},
+ { 0, 38},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 6},
+ { 0, 68},{ 2, 1},{ 0, 84},{ 0, 69},{ 18, 1},{ 10, 1},
+ { 4, 1},{ 2, 1},{ 0, 99},{ 0, 54},{ 4, 1},{ 2, 1},
+ { 0,112},{ 0, 7},{ 0,113},{ 4, 1},{ 2, 1},{ 0, 23},
+ { 0,100},{ 2, 1},{ 0, 70},{ 0,114},{ 10, 1},{ 6, 1},
+ { 2, 1},{ 0, 39},{ 2, 1},{ 0, 85},{ 0,115},{ 2, 1},
+ { 0, 55},{ 0, 86},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,101},
+ { 0,116},{ 2, 1},{ 0, 71},{ 0,102},{ 4, 1},{ 2, 1},
+
+ { 0,117},{ 0, 87},{ 2, 1},{ 0,118},{ 2, 1},{ 0,103},
+ { 0,119}},
+
+htd13[511][2]={{ 2, 1},{ 0, 0},{ 6, 1},{ 2, 1},{ 0, 16},{ 2, 1},
+ { 0, 1},{ 0, 17},{ 28, 1},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0, 32},{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 3},
+ { 0, 49},{ 6, 1},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 50},
+ { 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},{ 0, 65},
+ { 70, 1},{ 28, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0, 20},
+ { 2, 1},{ 0, 51},{ 0, 66},{ 4, 1},{ 2, 1},{ 0, 36},
+ { 0, 80},{ 2, 1},{ 0, 67},{ 0, 52},{ 4, 1},{ 2, 1},
+ { 0, 81},{ 0, 21},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 82}, // 60
+
+ { 2, 1},{ 0, 37},{ 2, 1},{ 0, 68},{ 0, 83},{ 14, 1},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0, 96},{ 0, 6},{ 2, 1},
+ { 0, 97},{ 0, 22},{ 4, 1},{ 2, 1},{ 0,128},{ 0, 8},
+ { 0,129},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 53},
+ { 0, 98},{ 2, 1},{ 0, 38},{ 0, 84},{ 4, 1},{ 2, 1},
+ { 0, 69},{ 0, 99},{ 2, 1},{ 0, 54},{ 0,112},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0, 7},{ 0, 85},{ 0,113},{ 2, 1},
+ { 0, 23},{ 2, 1},{ 0, 39},{ 0, 55},{ 72, 1},{ 24, 1},
+ { 12, 1},{ 4, 1},{ 2, 1},{ 0, 24},{ 0,130},{ 2, 1},
+ { 0, 40},{ 4, 1},{ 2, 1},{ 0,100},{ 0, 70},{ 0,114}, // 120
+
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,132},{ 0, 72},{ 2, 1},
+ { 0,144},{ 0, 9},{ 2, 1},{ 0,145},{ 0, 25},{ 24, 1},
+ { 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,115},{ 0,101},
+ { 2, 1},{ 0, 86},{ 0,116},{ 4, 1},{ 2, 1},{ 0, 71},
+ { 0,102},{ 0,131},{ 6, 1},{ 2, 1},{ 0, 56},{ 2, 1},
+ { 0,117},{ 0, 87},{ 2, 1},{ 0,146},{ 0, 41},{ 14, 1},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,103},{ 0,133},{ 2, 1},
+ { 0, 88},{ 0, 57},{ 2, 1},{ 0,147},{ 2, 1},{ 0, 73},
+ { 0,134},{ 6, 1},{ 2, 1},{ 0,160},{ 2, 1},{ 0,104},
+ { 0, 10},{ 2, 1},{ 0,161},{ 0, 26},{ 68, 1},{ 24, 1}, // 180
+
+ { 12, 1},{ 4, 1},{ 2, 1},{ 0,162},{ 0, 42},{ 4, 1},
+ { 2, 1},{ 0,149},{ 0, 89},{ 2, 1},{ 0,163},{ 0, 58},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0, 74},{ 0,150},{ 2, 1},
+ { 0,176},{ 0, 11},{ 2, 1},{ 0,177},{ 0, 27},{ 20, 1},
+ { 8, 1},{ 2, 1},{ 0,178},{ 4, 1},{ 2, 1},{ 0,118},
+ { 0,119},{ 0,148},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,135},
+ { 0,120},{ 0,164},{ 4, 1},{ 2, 1},{ 0,105},{ 0,165},
+ { 0, 43},{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 90},
+ { 0,136},{ 0,179},{ 2, 1},{ 0, 59},{ 2, 1},{ 0,121},
+ { 0,166},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,106},{ 0,180}, // 240
+
+ { 0,192},{ 4, 1},{ 2, 1},{ 0, 12},{ 0,152},{ 0,193},
+ { 60, 1},{ 22, 1},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 28},
+ { 2, 1},{ 0,137},{ 0,181},{ 2, 1},{ 0, 91},{ 0,194},
+ { 4, 1},{ 2, 1},{ 0, 44},{ 0, 60},{ 4, 1},{ 2, 1},
+ { 0,182},{ 0,107},{ 2, 1},{ 0,196},{ 0, 76},{ 16, 1},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,168},{ 0,138},{ 2, 1},
+ { 0,208},{ 0, 13},{ 2, 1},{ 0,209},{ 2, 1},{ 0, 75},
+ { 2, 1},{ 0,151},{ 0,167},{ 12, 1},{ 6, 1},{ 2, 1},
+ { 0,195},{ 2, 1},{ 0,122},{ 0,153},{ 4, 1},{ 2, 1},
+ { 0,197},{ 0, 92},{ 0,183},{ 4, 1},{ 2, 1},{ 0, 29}, // 300
+
+ { 0,210},{ 2, 1},{ 0, 45},{ 2, 1},{ 0,123},{ 0,211},
+ { 52, 1},{ 28, 1},{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 61},
+ { 0,198},{ 4, 1},{ 2, 1},{ 0,108},{ 0,169},{ 2, 1},
+ { 0,154},{ 0,212},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,184},
+ { 0,139},{ 2, 1},{ 0, 77},{ 0,199},{ 4, 1},{ 2, 1},
+ { 0,124},{ 0,213},{ 2, 1},{ 0, 93},{ 0,224},{ 10, 1},
+ { 4, 1},{ 2, 1},{ 0,225},{ 0, 30},{ 4, 1},{ 2, 1},
+ { 0, 14},{ 0, 46},{ 0,226},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0,227},{ 0,109},{ 2, 1},{ 0,140},{ 0,228},{ 4, 1},
+ { 2, 1},{ 0,229},{ 0,186},{ 0,240},{ 38, 1},{ 16, 1}, // 360
+
+ { 4, 1},{ 2, 1},{ 0,241},{ 0, 31},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0,170},{ 0,155},{ 0,185},{ 2, 1},{ 0, 62},
+ { 2, 1},{ 0,214},{ 0,200},{ 12, 1},{ 6, 1},{ 2, 1},
+ { 0, 78},{ 2, 1},{ 0,215},{ 0,125},{ 2, 1},{ 0,171},
+ { 2, 1},{ 0, 94},{ 0,201},{ 6, 1},{ 2, 1},{ 0, 15},
+ { 2, 1},{ 0,156},{ 0,110},{ 2, 1},{ 0,242},{ 0, 47},
+ { 32, 1},{ 16, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,216},
+ { 0,141},{ 0, 63},{ 6, 1},{ 2, 1},{ 0,243},{ 2, 1},
+ { 0,230},{ 0,202},{ 2, 1},{ 0,244},{ 0, 79},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0,187},{ 0,172},{ 2, 1},{ 0,231}, // 420
+
+ { 0,245},{ 4, 1},{ 2, 1},{ 0,217},{ 0,157},{ 2, 1},
+ { 0, 95},{ 0,232},{ 30, 1},{ 12, 1},{ 6, 1},{ 2, 1},
+ { 0,111},{ 2, 1},{ 0,246},{ 0,203},{ 4, 1},{ 2, 1},
+ { 0,188},{ 0,173},{ 0,218},{ 8, 1},{ 2, 1},{ 0,247},
+ { 4, 1},{ 2, 1},{ 0,126},{ 0,127},{ 0,142},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0,158},{ 0,174},{ 0,204},{ 2, 1},
+ { 0,248},{ 0,143},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0,219},{ 0,189},{ 2, 1},{ 0,234},{ 0,249},{ 4, 1},
+ { 2, 1},{ 0,159},{ 0,235},{ 2, 1},{ 0,190},{ 2, 1},
+ { 0,205},{ 0,250},{ 14, 1},{ 4, 1},{ 2, 1},{ 0,221}, // 480
+
+ { 0,236},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,233},{ 0,175},
+ { 0,220},{ 2, 1},{ 0,206},{ 0,251},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0,191},{ 0,222},{ 2, 1},{ 0,207},{ 0,238},
+ { 4, 1},{ 2, 1},{ 0,223},{ 0,239},{ 2, 1},{ 0,255},
+ { 2, 1},{ 0,237},{ 2, 1},{ 0,253},{ 2, 1},{ 0,252},
+ { 0,254}},
+
+htd15[511][2]={{ 16, 1},{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},
+ { 0, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
+ { 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 50, 1},{ 16, 1},
+ { 6, 1},{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 49},
+ { 6, 1},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 3},{ 0, 64},
+ { 2, 1},{ 0, 50},{ 0, 35},{ 14, 1},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0, 4},{ 0, 20},{ 0, 65},{ 4, 1},{ 2, 1},
+ { 0, 51},{ 0, 66},{ 2, 1},{ 0, 36},{ 0, 67},{ 10, 1},
+ { 6, 1},{ 2, 1},{ 0, 52},{ 2, 1},{ 0, 80},{ 0, 5},
+ { 2, 1},{ 0, 81},{ 0, 21},{ 4, 1},{ 2, 1},{ 0, 82}, // 60
+
+ { 0, 37},{ 4, 1},{ 2, 1},{ 0, 68},{ 0, 83},{ 0, 97},
+ { 90, 1},{ 36, 1},{ 18, 1},{ 10, 1},{ 6, 1},{ 2, 1},
+ { 0, 53},{ 2, 1},{ 0, 96},{ 0, 6},{ 2, 1},{ 0, 22},
+ { 0, 98},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 84},{ 2, 1},
+ { 0, 69},{ 0, 99},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 54},
+ { 2, 1},{ 0,112},{ 0, 7},{ 2, 1},{ 0,113},{ 0, 85},
+ { 4, 1},{ 2, 1},{ 0, 23},{ 0,100},{ 2, 1},{ 0,114},
+ { 0, 39},{ 24, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0, 70},{ 0,115},{ 2, 1},{ 0, 55},{ 0,101},{ 4, 1},
+ { 2, 1},{ 0, 86},{ 0,128},{ 2, 1},{ 0, 8},{ 0,116}, // 120
+
+ { 4, 1},{ 2, 1},{ 0,129},{ 0, 24},{ 2, 1},{ 0,130},
+ { 0, 40},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 71},
+ { 0,102},{ 2, 1},{ 0,131},{ 0, 56},{ 4, 1},{ 2, 1},
+ { 0,117},{ 0, 87},{ 2, 1},{ 0,132},{ 0, 72},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0,144},{ 0, 25},{ 0,145},{ 4, 1},
+ { 2, 1},{ 0,146},{ 0,118},{ 2, 1},{ 0,103},{ 0, 41},
+ { 92, 1},{ 36, 1},{ 18, 1},{ 10, 1},{ 4, 1},{ 2, 1},
+ { 0,133},{ 0, 88},{ 4, 1},{ 2, 1},{ 0, 9},{ 0,119},
+ { 0,147},{ 4, 1},{ 2, 1},{ 0, 57},{ 0,148},{ 2, 1},
+ { 0, 73},{ 0,134},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,104}, // 180
+
+ { 2, 1},{ 0,160},{ 0, 10},{ 2, 1},{ 0,161},{ 0, 26},
+ { 4, 1},{ 2, 1},{ 0,162},{ 0, 42},{ 2, 1},{ 0,149},
+ { 0, 89},{ 26, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0,163},
+ { 2, 1},{ 0, 58},{ 0,135},{ 4, 1},{ 2, 1},{ 0,120},
+ { 0,164},{ 2, 1},{ 0, 74},{ 0,150},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0,105},{ 0,176},{ 0,177},{ 4, 1},{ 2, 1},
+ { 0, 27},{ 0,165},{ 0,178},{ 14, 1},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0, 90},{ 0, 43},{ 2, 1},{ 0,136},{ 0,151},
+ { 2, 1},{ 0,179},{ 2, 1},{ 0,121},{ 0, 59},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0,106},{ 0,180},{ 2, 1},{ 0, 75}, // 240
+
+ { 0,193},{ 4, 1},{ 2, 1},{ 0,152},{ 0,137},{ 2, 1},
+ { 0, 28},{ 0,181},{ 80, 1},{ 34, 1},{ 16, 1},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0, 91},{ 0, 44},{ 0,194},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0, 11},{ 0,192},{ 0,166},{ 2, 1},
+ { 0,167},{ 0,122},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,195},
+ { 0, 60},{ 4, 1},{ 2, 1},{ 0, 12},{ 0,153},{ 0,182},
+ { 4, 1},{ 2, 1},{ 0,107},{ 0,196},{ 2, 1},{ 0, 76},
+ { 0,168},{ 20, 1},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,138},
+ { 0,197},{ 4, 1},{ 2, 1},{ 0,208},{ 0, 92},{ 0,209},
+ { 4, 1},{ 2, 1},{ 0,183},{ 0,123},{ 2, 1},{ 0, 29}, // 300
+
+ { 2, 1},{ 0, 13},{ 0, 45},{ 12, 1},{ 4, 1},{ 2, 1},
+ { 0,210},{ 0,211},{ 4, 1},{ 2, 1},{ 0, 61},{ 0,198},
+ { 2, 1},{ 0,108},{ 0,169},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0,154},{ 0,184},{ 0,212},{ 4, 1},{ 2, 1},{ 0,139},
+ { 0, 77},{ 2, 1},{ 0,199},{ 0,124},{ 68, 1},{ 34, 1},
+ { 18, 1},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,213},{ 0, 93},
+ { 4, 1},{ 2, 1},{ 0,224},{ 0, 14},{ 0,225},{ 4, 1},
+ { 2, 1},{ 0, 30},{ 0,226},{ 2, 1},{ 0,170},{ 0, 46},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,185},{ 0,155},{ 2, 1},
+ { 0,227},{ 0,214},{ 4, 1},{ 2, 1},{ 0,109},{ 0, 62}, // 360
+
+ { 2, 1},{ 0,200},{ 0,140},{ 16, 1},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0,228},{ 0, 78},{ 2, 1},{ 0,215},{ 0,125},
+ { 4, 1},{ 2, 1},{ 0,229},{ 0,186},{ 2, 1},{ 0,171},
+ { 0, 94},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,201},{ 0,156},
+ { 2, 1},{ 0,241},{ 0, 31},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0,240},{ 0,110},{ 0,242},{ 2, 1},{ 0, 47},{ 0,230},
+ { 38, 1},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,216},
+ { 0,243},{ 2, 1},{ 0, 63},{ 0,244},{ 6, 1},{ 2, 1},
+ { 0, 79},{ 2, 1},{ 0,141},{ 0,217},{ 2, 1},{ 0,187},
+ { 0,202},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,172},{ 0,231}, // 420
+
+ { 2, 1},{ 0,126},{ 0,245},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0,157},{ 0, 95},{ 2, 1},{ 0,232},{ 0,142},{ 2, 1},
+ { 0,246},{ 0,203},{ 34, 1},{ 18, 1},{ 10, 1},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0, 15},{ 0,174},{ 0,111},{ 2, 1},
+ { 0,188},{ 0,218},{ 4, 1},{ 2, 1},{ 0,173},{ 0,247},
+ { 2, 1},{ 0,127},{ 0,233},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0,158},{ 0,204},{ 2, 1},{ 0,248},{ 0,143},{ 4, 1},
+ { 2, 1},{ 0,219},{ 0,189},{ 2, 1},{ 0,234},{ 0,249},
+ { 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,159},{ 0,220},
+ { 2, 1},{ 0,205},{ 0,235},{ 4, 1},{ 2, 1},{ 0,190}, // 480
+
+ { 0,250},{ 2, 1},{ 0,175},{ 0,221},{ 14, 1},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0,236},{ 0,206},{ 0,251},{ 4, 1},
+ { 2, 1},{ 0,191},{ 0,237},{ 2, 1},{ 0,222},{ 0,252},
+ { 6, 1},{ 4, 1},{ 2, 1},{ 0,207},{ 0,253},{ 0,238},
+ { 4, 1},{ 2, 1},{ 0,223},{ 0,254},{ 2, 1},{ 0,239},
+ { 0,255}},
+
+htd16[511][2]={{ 2, 1},{ 0, 0},{ 6, 1},{ 2, 1},{ 0, 16},{ 2, 1},
+ { 0, 1},{ 0, 17},{ 42, 1},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0, 32},{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 10, 1},
+ { 6, 1},{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},
+ { 2, 1},{ 0, 49},{ 0, 19},{ 10, 1},{ 4, 1},{ 2, 1},
+ { 0, 50},{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},
+ { 0, 65},{ 6, 1},{ 2, 1},{ 0, 20},{ 2, 1},{ 0, 51},
+ { 0, 66},{ 4, 1},{ 2, 1},{ 0, 36},{ 0, 80},{ 2, 1},
+ { 0, 67},{ 0, 52},{138, 1},{ 40, 1},{ 16, 1},{ 6, 1},
+ { 4, 1},{ 2, 1},{ 0, 5},{ 0, 21},{ 0, 81},{ 4, 1}, // 60
+
+ { 2, 1},{ 0, 82},{ 0, 37},{ 4, 1},{ 2, 1},{ 0, 68},
+ { 0, 53},{ 0, 83},{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0, 96},{ 0, 6},{ 0, 97},{ 2, 1},{ 0, 22},{ 0, 98},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 84},{ 2, 1},
+ { 0, 69},{ 0, 99},{ 4, 1},{ 2, 1},{ 0, 54},{ 0,112},
+ { 0,113},{ 40, 1},{ 18, 1},{ 8, 1},{ 2, 1},{ 0, 23},
+ { 2, 1},{ 0, 7},{ 2, 1},{ 0, 85},{ 0,100},{ 4, 1},
+ { 2, 1},{ 0,114},{ 0, 39},{ 4, 1},{ 2, 1},{ 0, 70},
+ { 0,101},{ 0,115},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 55},
+ { 2, 1},{ 0, 86},{ 0, 8},{ 2, 1},{ 0,128},{ 0,129}, // 120
+
+ { 6, 1},{ 2, 1},{ 0, 24},{ 2, 1},{ 0,116},{ 0, 71},
+ { 2, 1},{ 0,130},{ 2, 1},{ 0, 40},{ 0,102},{ 24, 1},
+ { 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,131},{ 0, 56},
+ { 2, 1},{ 0,117},{ 0,132},{ 4, 1},{ 2, 1},{ 0, 72},
+ { 0,144},{ 0,145},{ 6, 1},{ 2, 1},{ 0, 25},{ 2, 1},
+ { 0, 9},{ 0,118},{ 2, 1},{ 0,146},{ 0, 41},{ 14, 1},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,133},{ 0, 88},{ 2, 1},
+ { 0,147},{ 0, 57},{ 4, 1},{ 2, 1},{ 0,160},{ 0, 10},
+ { 0, 26},{ 8, 1},{ 2, 1},{ 0,162},{ 2, 1},{ 0,103},
+ { 2, 1},{ 0, 87},{ 0, 73},{ 6, 1},{ 2, 1},{ 0,148}, // 180
+
+ { 2, 1},{ 0,119},{ 0,134},{ 2, 1},{ 0,161},{ 2, 1},
+ { 0,104},{ 0,149},{220, 1},{126, 1},{ 50, 1},{ 26, 1},
+ { 12, 1},{ 6, 1},{ 2, 1},{ 0, 42},{ 2, 1},{ 0, 89},
+ { 0, 58},{ 2, 1},{ 0,163},{ 2, 1},{ 0,135},{ 0,120},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,164},{ 0, 74},{ 2, 1},
+ { 0,150},{ 0,105},{ 4, 1},{ 2, 1},{ 0,176},{ 0, 11},
+ { 0,177},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 27},{ 0,178},
+ { 2, 1},{ 0, 43},{ 2, 1},{ 0,165},{ 0, 90},{ 6, 1},
+ { 2, 1},{ 0,179},{ 2, 1},{ 0,166},{ 0,106},{ 4, 1},
+ { 2, 1},{ 0,180},{ 0, 75},{ 2, 1},{ 0, 12},{ 0,193}, // 240
+
+ { 30, 1},{ 14, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,181},
+ { 0,194},{ 0, 44},{ 4, 1},{ 2, 1},{ 0,167},{ 0,195},
+ { 2, 1},{ 0,107},{ 0,196},{ 8, 1},{ 2, 1},{ 0, 29},
+ { 4, 1},{ 2, 1},{ 0,136},{ 0,151},{ 0, 59},{ 4, 1},
+ { 2, 1},{ 0,209},{ 0,210},{ 2, 1},{ 0, 45},{ 0,211},
+ { 18, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 30},{ 0, 46},
+ { 0,226},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,121},{ 0,152},
+ { 0,192},{ 2, 1},{ 0, 28},{ 2, 1},{ 0,137},{ 0, 91},
+ { 14, 1},{ 6, 1},{ 2, 1},{ 0, 60},{ 2, 1},{ 0,122},
+ { 0,182},{ 4, 1},{ 2, 1},{ 0, 76},{ 0,153},{ 2, 1}, // 300
+
+ { 0,168},{ 0,138},{ 6, 1},{ 2, 1},{ 0, 13},{ 2, 1},
+ { 0,197},{ 0, 92},{ 4, 1},{ 2, 1},{ 0, 61},{ 0,198},
+ { 2, 1},{ 0,108},{ 0,154},{ 88, 1},{ 86, 1},{ 36, 1},
+ { 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,139},{ 0, 77},
+ { 2, 1},{ 0,199},{ 0,124},{ 4, 1},{ 2, 1},{ 0,213},
+ { 0, 93},{ 2, 1},{ 0,224},{ 0, 14},{ 8, 1},{ 2, 1},
+ { 0,227},{ 4, 1},{ 2, 1},{ 0,208},{ 0,183},{ 0,123},
+ { 6, 1},{ 4, 1},{ 2, 1},{ 0,169},{ 0,184},{ 0,212},
+ { 2, 1},{ 0,225},{ 2, 1},{ 0,170},{ 0,185},{ 24, 1},
+ { 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,155},{ 0,214}, // 360
+
+ { 0,109},{ 2, 1},{ 0, 62},{ 0,200},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0,140},{ 0,228},{ 0, 78},{ 4, 1},{ 2, 1},
+ { 0,215},{ 0,229},{ 2, 1},{ 0,186},{ 0,171},{ 12, 1},
+ { 4, 1},{ 2, 1},{ 0,156},{ 0,230},{ 4, 1},{ 2, 1},
+ { 0,110},{ 0,216},{ 2, 1},{ 0,141},{ 0,187},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0,231},{ 0,157},{ 2, 1},{ 0,232},
+ { 0,142},{ 4, 1},{ 2, 1},{ 0,203},{ 0,188},{ 0,158},
+ { 0,241},{ 2, 1},{ 0, 31},{ 2, 1},{ 0, 15},{ 0, 47},
+ { 66, 1},{ 56, 1},{ 2, 1},{ 0,242},{ 52, 1},{ 50, 1},
+ { 20, 1},{ 8, 1},{ 2, 1},{ 0,189},{ 2, 1},{ 0, 94}, // 420
+
+ { 2, 1},{ 0,125},{ 0,201},{ 6, 1},{ 2, 1},{ 0,202},
+ { 2, 1},{ 0,172},{ 0,126},{ 4, 1},{ 2, 1},{ 0,218},
+ { 0,173},{ 0,204},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,174},
+ { 2, 1},{ 0,219},{ 0,220},{ 2, 1},{ 0,205},{ 0,190},
+ { 6, 1},{ 4, 1},{ 2, 1},{ 0,235},{ 0,237},{ 0,238},
+ { 6, 1},{ 4, 1},{ 2, 1},{ 0,217},{ 0,234},{ 0,233},
+ { 2, 1},{ 0,222},{ 4, 1},{ 2, 1},{ 0,221},{ 0,236},
+ { 0,206},{ 0, 63},{ 0,240},{ 4, 1},{ 2, 1},{ 0,243},
+ { 0,244},{ 2, 1},{ 0, 79},{ 2, 1},{ 0,245},{ 0, 95},
+ { 10, 1},{ 2, 1},{ 0,255},{ 4, 1},{ 2, 1},{ 0,246}, // 480
+
+ { 0,111},{ 2, 1},{ 0,247},{ 0,127},{ 12, 1},{ 6, 1},
+ { 2, 1},{ 0,143},{ 2, 1},{ 0,248},{ 0,249},{ 4, 1},
+ { 2, 1},{ 0,159},{ 0,250},{ 0,175},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0,251},{ 0,191},{ 2, 1},{ 0,252},{ 0,207},
+ { 4, 1},{ 2, 1},{ 0,253},{ 0,223},{ 2, 1},{ 0,254},
+ { 0,239}},
+
+htd24[512][2]={{ 60, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},
+ { 2, 1},{ 0, 1},{ 0, 17},{ 14, 1},{ 6, 1},{ 4, 1},
+ { 2, 1},{ 0, 32},{ 0, 2},{ 0, 33},{ 2, 1},{ 0, 18},
+ { 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},{ 14, 1},
+ { 4, 1},{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},
+ { 0, 50},{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},
+ { 0, 65},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 20},{ 0, 51},
+ { 2, 1},{ 0, 66},{ 0, 36},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0, 67},{ 0, 52},{ 0, 81},{ 6, 1},{ 4, 1},{ 2, 1},
+ { 0, 80},{ 0, 5},{ 0, 21},{ 2, 1},{ 0, 82},{ 0, 37}, // 60
+
+ {250+85, 1},{ 98, 1},{ 34, 1},{ 18, 1},{ 10, 1},{ 4, 1},
+ { 2, 1},{ 0, 68},{ 0, 83},{ 2, 1},{ 0, 53},{ 2, 1},
+ { 0, 96},{ 0, 6},{ 4, 1},{ 2, 1},{ 0, 97},{ 0, 22},
+ { 2, 1},{ 0, 98},{ 0, 38},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0, 84},{ 0, 69},{ 2, 1},{ 0, 99},{ 0, 54},{ 4, 1},
+ { 2, 1},{ 0,113},{ 0, 85},{ 2, 1},{ 0,100},{ 0, 70},
+ { 32, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0,114},{ 2, 1},
+ { 0, 39},{ 0, 55},{ 2, 1},{ 0,115},{ 4, 1},{ 2, 1},
+ { 0,112},{ 0, 7},{ 0, 23},{ 10, 1},{ 4, 1},{ 2, 1},
+ { 0,101},{ 0, 86},{ 4, 1},{ 2, 1},{ 0,128},{ 0, 8}, // 120
+
+ { 0,129},{ 4, 1},{ 2, 1},{ 0,116},{ 0, 71},{ 2, 1},
+ { 0, 24},{ 0,130},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},
+ { 0, 40},{ 0,102},{ 2, 1},{ 0,131},{ 0, 56},{ 4, 1},
+ { 2, 1},{ 0,117},{ 0, 87},{ 2, 1},{ 0,132},{ 0, 72},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,145},{ 0, 25},{ 2, 1},
+ { 0,146},{ 0,118},{ 4, 1},{ 2, 1},{ 0,103},{ 0, 41},
+ { 2, 1},{ 0,133},{ 0, 88},{ 92, 1},{ 34, 1},{ 16, 1},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,147},{ 0, 57},{ 2, 1},
+ { 0,148},{ 0, 73},{ 4, 1},{ 2, 1},{ 0,119},{ 0,134},
+ { 2, 1},{ 0,104},{ 0,161},{ 8, 1},{ 4, 1},{ 2, 1}, // 180
+
+ { 0,162},{ 0, 42},{ 2, 1},{ 0,149},{ 0, 89},{ 4, 1},
+ { 2, 1},{ 0,163},{ 0, 58},{ 2, 1},{ 0,135},{ 2, 1},
+ { 0,120},{ 0, 74},{ 22, 1},{ 12, 1},{ 4, 1},{ 2, 1},
+ { 0,164},{ 0,150},{ 4, 1},{ 2, 1},{ 0,105},{ 0,177},
+ { 2, 1},{ 0, 27},{ 0,165},{ 6, 1},{ 2, 1},{ 0,178},
+ { 2, 1},{ 0, 90},{ 0, 43},{ 2, 1},{ 0,136},{ 0,179},
+ { 16, 1},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,144},{ 2, 1},
+ { 0, 9},{ 0,160},{ 2, 1},{ 0,151},{ 0,121},{ 4, 1},
+ { 2, 1},{ 0,166},{ 0,106},{ 0,180},{ 12, 1},{ 6, 1},
+ { 2, 1},{ 0, 26},{ 2, 1},{ 0, 10},{ 0,176},{ 2, 1}, // 240
+
+ { 0, 59},{ 2, 1},{ 0, 11},{ 0,192},{ 4, 1},{ 2, 1},
+ { 0, 75},{ 0,193},{ 2, 1},{ 0,152},{ 0,137},{ 67, 1},
+ { 34, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 28},
+ { 0,181},{ 2, 1},{ 0, 91},{ 0,194},{ 4, 1},{ 2, 1},
+ { 0, 44},{ 0,167},{ 2, 1},{ 0,122},{ 0,195},{ 10, 1},
+ { 6, 1},{ 2, 1},{ 0, 60},{ 2, 1},{ 0, 12},{ 0,208},
+ { 2, 1},{ 0,182},{ 0,107},{ 4, 1},{ 2, 1},{ 0,196},
+ { 0, 76},{ 2, 1},{ 0,153},{ 0,168},{ 16, 1},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0,138},{ 0,197},{ 2, 1},{ 0, 92},
+ { 0,209},{ 4, 1},{ 2, 1},{ 0,183},{ 0,123},{ 2, 1}, // 300
+
+ { 0, 29},{ 0,210},{ 9, 1},{ 4, 1},{ 2, 1},{ 0, 45},
+ { 0,211},{ 2, 1},{ 0, 61},{ 0,198},{ 85,250},{ 4, 1}, // 306 -
+ { 2, 1},{ 0,108},{ 0,169},{ 2, 1},{ 0,154},{ 0,212},
+ { 32, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,184},
+ { 0,139},{ 2, 1},{ 0, 77},{ 0,199},{ 4, 1},{ 2, 1},
+ { 0,124},{ 0,213},{ 2, 1},{ 0, 93},{ 0,225},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0, 30},{ 0,226},{ 2, 1},{ 0,170},
+ { 0,185},{ 4, 1},{ 2, 1},{ 0,155},{ 0,227},{ 2, 1},
+ { 0,214},{ 0,109},{ 20, 1},{ 10, 1},{ 6, 1},{ 2, 1},
+ { 0, 62},{ 2, 1},{ 0, 46},{ 0, 78},{ 2, 1},{ 0,200}, // 360
+
+ { 0,140},{ 4, 1},{ 2, 1},{ 0,228},{ 0,215},{ 4, 1},
+ { 2, 1},{ 0,125},{ 0,171},{ 0,229},{ 10, 1},{ 4, 1},
+ { 2, 1},{ 0,186},{ 0, 94},{ 2, 1},{ 0,201},{ 2, 1},
+ { 0,156},{ 0,110},{ 8, 1},{ 2, 1},{ 0,230},{ 2, 1},
+ { 0, 13},{ 2, 1},{ 0,224},{ 0, 14},{ 4, 1},{ 2, 1},
+ { 0,216},{ 0,141},{ 2, 1},{ 0,187},{ 0,202},{ 74, 1},
+ { 2, 1},{ 0,255},{ 64, 1},{ 58, 1},{ 32, 1},{ 16, 1},
+ { 8, 1},{ 4, 1},{ 2, 1},{ 0,172},{ 0,231},{ 2, 1},
+ { 0,126},{ 0,217},{ 4, 1},{ 2, 1},{ 0,157},{ 0,232},
+ { 2, 1},{ 0,142},{ 0,203},{ 8, 1},{ 4, 1},{ 2, 1}, // 420
+
+ { 0,188},{ 0,218},{ 2, 1},{ 0,173},{ 0,233},{ 4, 1},
+ { 2, 1},{ 0,158},{ 0,204},{ 2, 1},{ 0,219},{ 0,189},
+ { 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,234},{ 0,174},
+ { 2, 1},{ 0,220},{ 0,205},{ 4, 1},{ 2, 1},{ 0,235},
+ { 0,190},{ 2, 1},{ 0,221},{ 0,236},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0,206},{ 0,237},{ 2, 1},{ 0,222},{ 0,238},
+ { 0, 15},{ 4, 1},{ 2, 1},{ 0,240},{ 0, 31},{ 0,241},
+ { 4, 1},{ 2, 1},{ 0,242},{ 0, 47},{ 2, 1},{ 0,243},
+ { 0, 63},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,244},
+ { 0, 79},{ 2, 1},{ 0,245},{ 0, 95},{ 4, 1},{ 2, 1}, // 480
+
+ { 0,246},{ 0,111},{ 2, 1},{ 0,247},{ 2, 1},{ 0,127},
+ { 0,143},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,248},{ 0,249},
+ { 4, 1},{ 2, 1},{ 0,159},{ 0,175},{ 0,250},{ 8, 1},
+ { 4, 1},{ 2, 1},{ 0,251},{ 0,191},{ 2, 1},{ 0,252},
+ { 0,207},{ 4, 1},{ 2, 1},{ 0,253},{ 0,223},{ 2, 1},
+ { 0,254},{ 0,239}},
+
+htd32[ 31][2]={{ 2, 1},{ 0, 0},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 8},
+ { 0, 4},{ 2, 1},{ 0, 1},{ 0, 2},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0, 12},{ 0, 10},{ 2, 1},{ 0, 3},{ 0, 6},
+ { 6, 1},{ 2, 1},{ 0, 9},{ 2, 1},{ 0, 5},{ 0, 7},
+ { 4, 1},{ 2, 1},{ 0, 14},{ 0, 13},{ 2, 1},{ 0, 15},
+ { 0, 11}},
+
+htd33[ 31][2]={{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 1},
+ { 2, 1},{ 0, 2},{ 0, 3},{ 4, 1},{ 2, 1},{ 0, 4},
+ { 0, 5},{ 2, 1},{ 0, 6},{ 0, 7},{ 8, 1},{ 4, 1},
+ { 2, 1},{ 0, 8},{ 0, 9},{ 2, 1},{ 0, 10},{ 0, 11},
+ { 4, 1},{ 2, 1},{ 0, 12},{ 0, 13},{ 2, 1},{ 0, 14},
+ { 0, 15}};
+
+const HUFFMANCODETABLE Mpegtoraw::ht[HTN]=
+{
+ { 0, 0-1, 0-1, 0, 0, htd33},
+ { 1, 2-1, 2-1, 0, 7,htd01},
+ { 2, 3-1, 3-1, 0, 17,htd02},
+ { 3, 3-1, 3-1, 0, 17,htd03},
+ { 4, 0-1, 0-1, 0, 0, htd33},
+ { 5, 4-1, 4-1, 0, 31,htd05},
+ { 6, 4-1, 4-1, 0, 31,htd06},
+ { 7, 6-1, 6-1, 0, 71,htd07},
+ { 8, 6-1, 6-1, 0, 71,htd08},
+ { 9, 6-1, 6-1, 0, 71,htd09},
+ {10, 8-1, 8-1, 0,127,htd10},
+ {11, 8-1, 8-1, 0,127,htd11},
+ {12, 8-1, 8-1, 0,127,htd12},
+ {13,16-1,16-1, 0,511,htd13},
+ {14, 0-1, 0-1, 0, 0, htd33},
+ {15,16-1,16-1, 0,511,htd15},
+ {16,16-1,16-1, 1,511,htd16},
+ {17,16-1,16-1, 2,511,htd16},
+ {18,16-1,16-1, 3,511,htd16},
+ {19,16-1,16-1, 4,511,htd16},
+ {20,16-1,16-1, 6,511,htd16},
+ {21,16-1,16-1, 8,511,htd16},
+ {22,16-1,16-1,10,511,htd16},
+ {23,16-1,16-1,13,511,htd16},
+ {24,16-1,16-1, 4,512,htd24},
+ {25,16-1,16-1, 5,512,htd24},
+ {26,16-1,16-1, 6,512,htd24},
+ {27,16-1,16-1, 7,512,htd24},
+ {28,16-1,16-1, 8,512,htd24},
+ {29,16-1,16-1, 9,512,htd24},
+ {30,16-1,16-1,11,512,htd24},
+ {31,16-1,16-1,13,512,htd24},
+ {32, 1-1,16-1, 0, 31,htd32},
+ {33, 1-1,16-1, 0, 31,htd33}
+};
diff --git a/setedit/mp3/mpegsound/mpegsnd.gpr b/setedit/mp3/mpegsound/mpegsnd.gpr
new file mode 100644
index 0000000..1f75b18
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegsnd.gpr
Binary files differ
diff --git a/setedit/mp3/mpegsound/mpegsnd.imk b/setedit/mp3/mpegsound/mpegsnd.imk
new file mode 100644
index 0000000..db84494
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegsnd.imk
@@ -0,0 +1,148 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+../../makes/libmpegsnd$(ExLIB):: \
+ obj/bitwindow$(ExOBJ) \
+ obj/fileinput$(ExOBJ) \
+ obj/fileplayer$(ExOBJ) \
+ obj/filter$(ExOBJ) \
+ obj/filter_2$(ExOBJ) \
+ obj/httpinput$(ExOBJ) \
+ obj/huffmantable$(ExOBJ) \
+ obj/mpegtable$(ExOBJ) \
+ obj/mpegtoraw$(ExOBJ) \
+ obj/mpegwtoraw$(ExOBJ) \
+ obj/mpglayr1$(ExOBJ) \
+ obj/mpglayr2$(ExOBJ) \
+ obj/mpglayr3$(ExOBJ) \
+ obj/osdisk$(ExOBJ) \
+ obj/rawplayer$(ExOBJ) \
+ obj/rawtofile$(ExOBJ) \
+ obj/rawtowav$(ExOBJ) \
+ obj/soundinputstream$(ExOBJ) \
+ obj/soundplayer$(ExOBJ) \
+ obj/wavetoraw$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/bitwindow$(ExOBJ):: bitwindow.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fileinput$(ExOBJ):: fileinput.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/fileplayer$(ExOBJ):: fileplayer.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/filter$(ExOBJ):: filter.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/filter_2$(ExOBJ):: filter_2.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/httpinput$(ExOBJ):: httpinput.cc \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/huffmantable$(ExOBJ):: huffmantable.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mpegtable$(ExOBJ):: mpegtable.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mpegtoraw$(ExOBJ):: mpegtoraw.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ mpg_locals.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mpegwtoraw$(ExOBJ):: mpegwtoraw.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mpglayr1$(ExOBJ):: mpglayr1.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mpglayr2$(ExOBJ):: mpglayr2.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/mpglayr3$(ExOBJ):: mpglayr3.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ mpg_locals.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/osdisk$(ExOBJ):: osdisk.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/rawplayer$(ExOBJ):: rawplayer.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/rawtofile$(ExOBJ):: rawtofile.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/rawtowav$(ExOBJ):: rawtowav.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/soundinputstream$(ExOBJ):: soundinputstream.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/soundplayer$(ExOBJ):: soundplayer.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
+obj/wavetoraw$(ExOBJ):: wavetoraw.cc \
+ $(MP3_MAIN_DIR)/configed.h \
+ mpegsound.h \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/mp3/mpegsound/mpegsnd.mkf b/setedit/mp3/mpegsound/mpegsnd.mkf
new file mode 100644
index 0000000..40216e9
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegsnd.mkf
@@ -0,0 +1,39 @@
+#!/usr/bin/make
+
+##########################################################################################
+#
+# Beggining of maintained lines
+#
+##########################################################################################
+#
+# Source directories
+#
+vpath_src=
+#
+# Include directories
+#
+MP3_PREV_DIR=..
+MP3_MAIN_DIR=../../include
+INCLUDE_DIRS=. $(MP3_PREV_DIR) $(MP3_MAIN_DIR)
+
+##########################################################################################
+#
+# Beggining of fixed part
+#
+##########################################################################################
+
+#
+# Any configurable detail should come from here.
+#
+include rhide.env
+
+#
+# Common rules used by RHIDE.
+#
+include common.imk
+
+#
+# All the RHIDE data should come from here.
+#
+include mpegsnd.imk
+
diff --git a/setedit/mp3/mpegsound/mpegsnd.umk b/setedit/mp3/mpegsound/mpegsnd.umk
new file mode 100644
index 0000000..aa32da4
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegsnd.umk
@@ -0,0 +1,88 @@
+#!/usr/bin/make
+# Automatically generated from RHIDE projects, don't edit
+#
+
+../../makes/libmpegsnd$(ExLIB):: \
+ obj/bitwindow$(ExOBJ) \
+ obj/fileinput$(ExOBJ) \
+ obj/fileplayer$(ExOBJ) \
+ obj/filter$(ExOBJ) \
+ obj/filter_2$(ExOBJ) \
+ obj/httpinput$(ExOBJ) \
+ obj/huffmantable$(ExOBJ) \
+ obj/mpegtable$(ExOBJ) \
+ obj/mpegtoraw$(ExOBJ) \
+ obj/mpegwtoraw$(ExOBJ) \
+ obj/mpglayr1$(ExOBJ) \
+ obj/mpglayr2$(ExOBJ) \
+ obj/mpglayr3$(ExOBJ) \
+ obj/osdisk$(ExOBJ) \
+ obj/rawplayer$(ExOBJ) \
+ obj/rawtofile$(ExOBJ) \
+ obj/rawtowav$(ExOBJ) \
+ obj/soundinputstream$(ExOBJ) \
+ obj/soundplayer$(ExOBJ) \
+ obj/wavetoraw$(ExOBJ) \
+ $(MAKEFILE_DEPS)
+ $(RHIDE_COMPILE_ARCHIVE)
+
+obj/bitwindow$(ExOBJ):: bitwindow.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fileinput$(ExOBJ):: fileinput.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/fileplayer$(ExOBJ):: fileplayer.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/filter$(ExOBJ):: filter.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/filter_2$(ExOBJ):: filter_2.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/httpinput$(ExOBJ):: httpinput.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/huffmantable$(ExOBJ):: huffmantable.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mpegtable$(ExOBJ):: mpegtable.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mpegtoraw$(ExOBJ):: mpegtoraw.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mpegwtoraw$(ExOBJ):: mpegwtoraw.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mpglayr1$(ExOBJ):: mpglayr1.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mpglayr2$(ExOBJ):: mpglayr2.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/mpglayr3$(ExOBJ):: mpglayr3.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/osdisk$(ExOBJ):: osdisk.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/rawplayer$(ExOBJ):: rawplayer.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/rawtofile$(ExOBJ):: rawtofile.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/rawtowav$(ExOBJ):: rawtowav.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/soundinputstream$(ExOBJ):: soundinputstream.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/soundplayer$(ExOBJ):: soundplayer.cc
+ $(RHIDE_COMPILE_CC)
+
+obj/wavetoraw$(ExOBJ):: wavetoraw.cc
+ $(RHIDE_COMPILE_CC)
+
diff --git a/setedit/mp3/mpegsound/mpegsound.h b/setedit/mp3/mpegsound/mpegsound.h
new file mode 100644
index 0000000..27aaa58
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegsound.h
@@ -0,0 +1,790 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Woo-jae Jung */
+
+// Mpegsound.h
+// This is typeset for functions in MPEG/WAVE Sound library.
+// Now, it's for only linux-pc-?86
+
+/************************************/
+/* Inlcude default library packages */
+/************************************/
+#include <stdio.h>
+#include <sys/types.h>
+
+#include <configed.h>
+
+#if defined(SECPU_SPARC64) || defined(SECPU_SPARC) || defined(SECPU_PPC)
+ #define WORDS_BIGENDIAN 1
+#endif
+
+#ifdef PTHREADEDMPEG
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#else
+#ifdef HAVE_PTHREAD_MIT_PTHREAD_H
+#include <pthread/mit/pthread.h>
+#endif
+#endif
+#endif
+
+#ifndef _L__SOUND__
+#define _L__SOUND__
+
+/****************/
+/* Sound Errors */
+/****************/
+// General error
+#define SOUND_ERROR_OK 0
+#define SOUND_ERROR_FINISH -1
+
+// Device error (for player)
+#define SOUND_ERROR_DEVOPENFAIL 1
+#define SOUND_ERROR_DEVBUSY 2
+#define SOUND_ERROR_DEVBADBUFFERSIZE 3
+#define SOUND_ERROR_DEVCTRLERROR 4
+
+// Sound file (for reader)
+#define SOUND_ERROR_FILEOPENFAIL 5
+#define SOUND_ERROR_FILEREADFAIL 6
+
+// Network
+#define SOUND_ERROR_UNKNOWNPROXY 7
+#define SOUND_ERROR_UNKNOWNHOST 8
+#define SOUND_ERROR_SOCKET 9
+#define SOUND_ERROR_CONNECT 10
+#define SOUND_ERROR_FDOPEN 11
+#define SOUND_ERROR_HTTPFAIL 12
+#define SOUND_ERROR_HTTPWRITEFAIL 13
+#define SOUND_ERROR_TOOMANYRELOC 14
+
+// Miscellneous (for translater)
+#define SOUND_ERROR_MEMORYNOTENOUGH 15
+#define SOUND_ERROR_EOF 16
+#define SOUND_ERROR_BAD 17
+
+#define SOUND_ERROR_THREADFAIL 18
+
+#define SOUND_ERROR_UNKNOWN 19
+
+
+/**************************/
+/* Define values for MPEG */
+/**************************/
+#define SCALEBLOCK 12
+#define CALCBUFFERSIZE 512
+#define MAXSUBBAND 32
+#define MAXCHANNEL 2
+#define MAXTABLE 2
+#define SCALE 32768
+#define MAXSCALE (SCALE-1)
+#define MINSCALE (-SCALE)
+#define RAWDATASIZE (2*2*32*SSLIMIT)
+
+#define LS 0
+#define RS 1
+
+#define SSLIMIT 18
+#define SBLIMIT 32
+
+#define WINDOWSIZE 4096
+
+// Huffmancode
+#define HTN 34
+
+
+/*******************************************/
+/* Define values for Microsoft WAVE format */
+/*******************************************/
+#define RIFF 0x46464952
+#define WAVE 0x45564157
+#define FMT 0x20746D66
+#define DATA 0x61746164
+#define PCM_CODE 1
+#define MPEG_CODE 85
+#define WAVE_MONO 1
+#define WAVE_STEREO 2
+
+#define MODE_MONO 0
+#define MODE_STEREO 1
+
+/********************/
+/* Type definitions */
+/********************/
+typedef float REAL;
+
+typedef struct _waveheader {
+ unsigned int main_chunk; // 'RIFF'
+ unsigned int length; // filelen
+ unsigned int chunk_type; // 'WAVE'
+
+ unsigned int sub_chunk; // 'fmt '
+ unsigned int sc_len; // length of sub_chunk, =16
+ unsigned short format; // should be 1 for PCM-code
+ unsigned short modus; // 1 Mono, 2 Stereo
+ unsigned int sample_fq; // frequence of sample
+ unsigned int byte_p_sec;
+ unsigned short byte_p_spl; // samplesize; 1 or 2 bytes
+ unsigned short bit_p_spl; // 8, 12 or 16 bit
+
+ unsigned int data_chunk; // 'data'
+ unsigned int data_length; // samplecount
+}WAVEHEADER;
+
+typedef struct
+{
+ bool generalflag;
+ unsigned int part2_3_length;
+ unsigned int big_values;
+ unsigned int global_gain;
+ unsigned int scalefac_compress;
+ unsigned int window_switching_flag;
+ unsigned int block_type;
+ unsigned int mixed_block_flag;
+ unsigned int table_select[3];
+ unsigned int subblock_gain[3];
+ unsigned int region0_count;
+ unsigned int region1_count;
+ unsigned int preflag;
+ unsigned int scalefac_scale;
+ unsigned int count1table_select;
+}layer3grinfo;
+
+typedef struct
+{
+ unsigned main_data_begin;
+ unsigned private_bits;
+ struct
+ {
+ unsigned scfsi[4];
+ layer3grinfo gr[2];
+ }ch[2];
+}layer3sideinfo;
+
+typedef struct
+{
+ int l[23]; /* [cb] */
+ int s[3][13]; /* [window][cb] */
+}layer3scalefactor; /* [ch] */
+
+typedef struct
+{
+ int tablename;
+ unsigned int xlen,ylen;
+ unsigned int linbits;
+ unsigned int treelen;
+ const unsigned int (*val)[2];
+}HUFFMANCODETABLE;
+
+/*********************************/
+/* Sound input interface classes */
+/*********************************/
+// Superclass for Inputbitstream // Yet, Temporary
+class Soundinputstream
+{
+public:
+ Soundinputstream();
+ virtual ~Soundinputstream();
+
+ static Soundinputstream *hopen(char *filename,int *errcode);
+
+ int geterrorcode(void) {return __errorcode;};
+
+ virtual bool open(char *filename) =0;
+ virtual int getbytedirect(void) =0;
+ virtual bool _readbuffer(char *buffer,int size)=0;
+ virtual bool eof(void) =0;
+ virtual int getblock(char *buffer,int size) =0;
+
+ virtual int getsize(void) =0;
+ virtual int getposition(void) =0;
+ virtual void setposition(int pos) =0;
+ bool getcanseek() { return canseek; };
+
+protected:
+ void seterrorcode(int errorcode) {__errorcode=errorcode;};
+ bool canseek;
+
+private:
+ int __errorcode;
+};
+
+// Inputstream from file
+class Soundinputstreamfromfile : public Soundinputstream
+{
+public:
+ Soundinputstreamfromfile() {fp=NULL;};
+ ~Soundinputstreamfromfile();
+
+ bool open(char *filename);
+ bool _readbuffer(char *buffer,int bytes);
+ int getbytedirect(void);
+ bool eof(void);
+ int getblock(char *buffer,int size);
+
+ int getsize(void);
+ int getposition(void);
+ void setposition(int pos);
+ FILE *getfilepointer();
+
+private:
+ FILE *fp;
+ int size;
+};
+
+// Inputstream from http
+class Soundinputstreamfromhttp : public Soundinputstream
+{
+public:
+ Soundinputstreamfromhttp();
+ ~Soundinputstreamfromhttp();
+
+ bool open(char *filename);
+ bool _readbuffer(char *buffer,int bytes);
+ int getbytedirect(void);
+ bool eof(void);
+ int getblock(char *buffer,int size);
+
+ int getsize(void);
+ int getposition(void);
+ void setposition(int pos);
+
+private:
+ FILE *fp;
+ int size;
+
+ bool writestring(int fd,char *string);
+ bool readstring(char *string,int maxlen,FILE *f);
+ FILE *http_open(char *url);
+};
+
+
+/**********************************/
+/* Sound player interface classes */
+/**********************************/
+// Superclass for player
+class Soundplayer
+{
+public:
+ Soundplayer() {__errorcode=SOUND_ERROR_OK;};
+ virtual ~Soundplayer();
+
+ virtual bool initialize(char *filename) =0;
+ virtual void abort(void);
+ virtual int getprocessed(void);
+
+ virtual bool setsoundtype(int stereo,int samplesize,int speed)=0;
+ virtual bool resetsoundtype(void);
+
+ virtual bool putblock(void *buffer,int size) =0;
+ virtual int getblocksize(void);
+ virtual bool roomformore(unsigned ) { return true; };
+
+ int geterrorcode(void) {return __errorcode;};
+
+protected:
+ bool seterrorcode(int errorno) {__errorcode=errorno; return false;};
+
+private:
+ int __errorcode;
+};
+
+
+class Rawtofile : public Soundplayer
+{
+public:
+ ~Rawtofile();
+
+ bool initialize(char *filename);
+ bool setsoundtype(int stereo,int samplesize,int speed);
+ bool putblock(void *buffer,int size);
+
+private:
+ int filehandle;
+ int rawstereo,rawsamplesize,rawspeed;
+};
+
+class Rawtowav : public Soundplayer
+{
+public:
+ ~Rawtowav();
+
+ bool initialize(char *filename);
+ bool setsoundtype(int stereo,int samplesize,int speed);
+ bool putblock(void *buffer,int size);
+
+private:
+ int filehandle;
+ int length;
+};
+
+// Class for playing raw data
+class Rawplayer : public Soundplayer
+{
+public:
+ ~Rawplayer();
+
+ bool initialize(char *filename);
+ void abort(void);
+ int getprocessed(void);
+
+ bool setsoundtype(int stereo,int samplesize,int speed);
+ bool resetsoundtype(void);
+
+ bool putblock(void *buffer,int size);
+
+ int getblocksize(void);
+
+ void setquota(int q){quota=q;};
+ int getquota(void) {return quota;};
+ bool roomformore(unsigned size);
+
+ static char *defaultdevice;
+ static int setvolume(int volume);
+
+private:
+ short int rawbuffer[RAWDATASIZE];
+ int rawbuffersize;
+ int audiohandle,audiobuffersize;
+ int rawstereo,rawsamplesize,rawspeed;
+ bool forcetomono,forceto8;
+ int quota;
+ // SET: I added them for the Solaris code
+ unsigned sizeSamp;
+ unsigned bufSize;
+};
+
+
+
+/*********************************/
+/* Data format converter classes */
+/*********************************/
+// Class for converting wave format to raw format
+class Wavetoraw
+{
+public:
+ Wavetoraw(Soundinputstream *loader,Soundplayer *player);
+ ~Wavetoraw();
+
+ bool initialize(void);
+ void setforcetomono(bool flag){forcetomonoflag=flag;};
+ bool run(void);
+
+ int getfrequency(void) const {return speed;};
+ bool isstereo(void) const {return stereo;};
+ int getsamplesize(void) const {return samplesize;};
+
+ int geterrorcode(void) const {return __errorcode;};
+
+ int gettotallength(void) const {return size/pcmsize;};
+ int getcurrentpoint(void) const {return currentpoint/pcmsize;};
+ void setcurrentpoint(int p);
+
+private:
+ int __errorcode;
+ void seterrorcode(int errorcode) {__errorcode=errorcode;};
+
+ bool forcetomonoflag;
+
+ Soundinputstream *loader;
+ Soundplayer *player;
+
+ bool initialized;
+ char *buffer;
+ int buffersize;
+ int samplesize,speed,stereo;
+ int currentpoint,size;
+ int pcmsize;
+
+ bool testwave(char *buffer);
+};
+
+
+// Class for Mpeg layer3
+class Mpegbitwindow
+{
+public:
+ Mpegbitwindow(){bitindex=point=0;};
+
+ void initialize(void) {bitindex=point=0;};
+ int gettotalbit(void) const {return bitindex;};
+ void putbyte(int c) {buffer[point&(WINDOWSIZE-1)]=c;point++;};
+ void wrap(void);
+ void rewind(int bits) {bitindex-=bits;};
+ void forward(int bits) {bitindex+=bits;};
+ int getbit(void);
+ int getbits9(int bits);
+ int getbits(int bits);
+
+private:
+ int point,bitindex;
+ char buffer[2*WINDOWSIZE];
+};
+
+
+
+// Class for converting mpeg format to raw format
+class Mpegtoraw
+{
+ /*****************************/
+ /* Constant tables for layer */
+ /*****************************/
+private:
+ static const int bitrate[2][3][15],frequencies[2][3];
+ static const REAL scalefactorstable[64];
+ static const HUFFMANCODETABLE ht[HTN];
+ static const REAL filter[512];
+ static REAL hcos_64[16],hcos_32[8],hcos_16[4],hcos_8[2],hcos_4;
+
+ /*************************/
+ /* MPEG header variables */
+ /*************************/
+private:
+ int layer,protection,bitrateindex,padding,extendedmode;
+ enum _mpegversion {mpeg1,mpeg2} version;
+ enum _mode {fullstereo,joint,dual,single} mode;
+ enum _frequency {frequency44100,frequency48000,frequency32000} frequency;
+
+ /*******************************************/
+ /* Functions getting MPEG header variables */
+ /*******************************************/
+public:
+ // General
+ int getversion(void) const {return version;};
+ int getlayer(void) const {return layer;};
+ bool getcrccheck(void) const {return (!protection);};
+ // Stereo or not
+ int getmode(void) const {return mode;};
+ bool isstereo(void) const {return (getmode()!=single);};
+ // Frequency and bitrate
+ int getfrequency(void) const {return frequencies[version][frequency];};
+ int getbitrate(void) const {return bitrate[version][layer-1][bitrateindex];};
+
+ /***************************************/
+ /* Interface for setting music quality */
+ /***************************************/
+private:
+ bool forcetomonoflag;
+ int downfrequency;
+
+public:
+ void setforcetomono(bool flag);
+ void setdownfrequency(int value);
+
+ /******************************************/
+ /* Functions getting other MPEG variables */
+ /******************************************/
+public:
+ bool getforcetomono(void);
+ int getdownfrequency(void);
+ int getpcmperframe(void);
+
+ /******************************/
+ /* Frame management variables */
+ /******************************/
+private:
+ int currentframe,totalframe;
+ int decodeframe;
+ int *frameoffsets;
+ int *frametimes;
+ bool playing;
+ bool haveTOC;
+ unsigned char TOC[100];
+ int totaltime;
+
+ /******************************/
+ /* Frame management functions */
+ /******************************/
+public:
+ int getcurrentframe(void) const {return currentframe;};
+ int gettotalframe(void) const {return totalframe;};
+ void setframe(int framenumber);
+ int getframesize(void) const {return framesize;};
+ int getcurtime(void) const {return frametimes && currentframe && currentframe<totalframe ? frametimes[currentframe-1]:0;};
+ int gettotaltime(void);
+ void settimepos(int time);
+
+ /***************************************/
+ /* Variables made by MPEG-Audio header */
+ /***************************************/
+private:
+ int tableindex,channelbitrate;
+ int stereobound,subbandnumber,inputstereo,outputstereo;
+ REAL scalefactor;
+ int framesize;
+ int ComputeTimeForFrame(int i);
+
+ /********************/
+ /* Song information */
+ /********************/
+private:
+ struct
+ {
+ char name [30+1];
+ char artist [30+1];
+ char album [30+1];
+ char year [ 4+1];
+ char comment[30+1];
+ const char *genre;
+ }songinfo;
+
+ /* Song information functions */
+public:
+ const char *getname (void) const { return (const char *)songinfo.name; };
+ const char *getartist (void) const { return (const char *)songinfo.artist; };
+ const char *getalbum (void) const { return (const char *)songinfo.album; };
+ const char *getyear (void) const { return (const char *)songinfo.year; };
+ const char *getcomment (void) const { return (const char *)songinfo.comment;};
+ const char *getgenre (void) const { return (const char *)songinfo.genre; };
+
+ /*******************/
+ /* Mpegtoraw class */
+ /*******************/
+public:
+ Mpegtoraw(Soundinputstream *loader,Soundplayer *player);
+ virtual ~Mpegtoraw();
+ virtual void initialize(char *filename, bool avoidID3=false);
+ bool run(int frames);
+ bool startplay(void) { return run(-1); };
+ void stopplay(void);
+ bool callformore(void) { return player->roomformore(rawdataoffset<<1); };
+ int geterrorcode(void) {return __errorcode;};
+ void clearbuffer(void);
+
+private:
+ int __errorcode;
+ bool seterrorcode(int errorno){__errorcode=errorno;return false;};
+
+ /*****************************/
+ /* Loading MPEG-Audio stream */
+ /*****************************/
+protected:
+ Soundinputstream *loader; // Interface
+private:
+ union
+ {
+ unsigned char store[4];
+ unsigned int current;
+ }u;
+ char buffer[4096];
+ int bitindex;
+ bool fillbuffer(int size){bitindex=0;return loader->_readbuffer(buffer,size);};
+ void sync(void) {bitindex=(bitindex+7)&0xFFFFFFF8;};
+ bool issync(void){return (bitindex&7);};
+ int getbyte(void);
+ int getbits(int bits);
+ int getbits9(int bits);
+ int getbits8(void);
+ int getbit(void);
+
+ /********************/
+ /* Global variables */
+ /********************/
+private:
+ int lastfrequency,laststereo;
+
+ // for Layer3
+ int layer3slots,layer3framestart,layer3part2start;
+ REAL prevblck[2][2][SBLIMIT][SSLIMIT];
+ int currentprevblock;
+ layer3sideinfo sideinfo;
+ layer3scalefactor scalefactors[2];
+
+ Mpegbitwindow bitwindow;
+ int wgetbit(void);
+ int wgetbits9(int bits);
+ int wgetbits(int bits);
+
+
+ /*************************************/
+ /* Decoding functions for each layer */
+ /*************************************/
+private:
+ bool loadheader(void);
+ bool checkforvbr(void);
+
+ //
+ // Subbandsynthesis
+ //
+ REAL calcbufferL[2][CALCBUFFERSIZE],calcbufferR[2][CALCBUFFERSIZE];
+ int currentcalcbuffer,calcbufferoffset;
+
+ void computebuffer(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]);
+ void generatesingle(void);
+ void generate(void);
+ void subbandsynthesis(REAL *fractionL,REAL *fractionR);
+
+ void computebuffer_2(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]);
+ void generatesingle_2(void);
+ void generate_2(void);
+ void subbandsynthesis_2(REAL *fractionL,REAL *fractionR);
+
+ // Extractor
+ void extractlayer1(void); // MPEG-1
+ void extractlayer2(void);
+ void extractlayer3(void);
+ void extractlayer3_2(void); // MPEG-2
+
+
+ // Functions for layer 3
+ void layer3initialize(void);
+ bool layer3getsideinfo(void);
+ bool layer3getsideinfo_2(void);
+ void layer3getscalefactors(int ch,int gr);
+ void layer3getscalefactors_2(int ch);
+ void layer3huffmandecode(int ch,int gr,int out[SBLIMIT][SSLIMIT]);
+ REAL layer3twopow2(int scale,int preflag,int pretab_offset,int l);
+ REAL layer3twopow2_1(int a,int b,int c);
+ void layer3dequantizesample(int ch,int gr,int in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT]);
+ void layer3fixtostereo(int gr,REAL in[2][SBLIMIT][SSLIMIT]);
+ void layer3reorderandantialias(int ch,int gr,REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT]);
+
+ void layer3hybrid(int ch,int gr,REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SSLIMIT][SBLIMIT]);
+
+ void huffmandecoder_1(const HUFFMANCODETABLE *h,int *x,int *y);
+ void huffmandecoder_2(const HUFFMANCODETABLE *h,int *x,int *y,int *v,int *w);
+
+ /********************/
+ /* Playing raw data */
+ /********************/
+private:
+ Soundplayer *player; // General playing interface
+ int rawdataoffset;
+ short int rawdata[RAWDATASIZE];
+
+ void clearrawdata(void) {rawdataoffset=0;};
+ void putraw(short int pcm) {rawdata[rawdataoffset++]=pcm;};
+ void flushrawdata(void);
+
+ /***************************/
+ /* Interface for threading */
+ /***************************/
+#ifdef PTHREADEDMPEG
+private:
+ struct
+ {
+ short int *buffer;
+ int framenumber,frametail;
+ int head,tail;
+ int *sizes;
+ }threadqueue;
+
+ struct
+ {
+ bool thread;
+ bool quit,done;
+ bool pause;
+ bool criticallock,criticalflag;
+ }threadflags;
+
+ pthread_t thread;
+
+public:
+ void threadedplayer(void);
+ bool makethreadedplayer(int framenumbers);
+ void freethreadedplayer(void);
+
+ void stopthreadedplayer(void);
+ void pausethreadedplayer(void);
+ void unpausethreadedplayer(void);
+
+ bool existthread(void);
+ int getframesaved(void);
+#endif
+};
+
+/***********************************************************/
+/* This class is to play MPEG files enclosed in WAVE files */
+/* It is only for files (not http nor stdin). */
+/* Added by Salvador E. Tropea */
+/***********************************************************/
+class Mpegwavtoraw : public Mpegtoraw
+{
+public:
+ Mpegwavtoraw(Soundinputstream *aLoader,Soundplayer *aPlayer) :
+ Mpegtoraw(aLoader,aPlayer) {};
+ void initialize(char *filename, bool avoidID3=false);
+};
+// Used to check if this class is suitable
+bool Mpegsound_CheckMP3WAV(char *filename);
+
+/***********************/
+/* File player classes */
+/***********************/
+// Superclass for playing file
+class Fileplayer
+{
+public:
+ Fileplayer();
+ virtual ~Fileplayer();
+
+ int geterrorcode(void) {return __errorcode;};
+
+ virtual bool openfile(char *filename,char *device)=0;
+ virtual void setforcetomono(bool flag) =0;
+ virtual bool playing(int verbose) =0;
+
+protected:
+ bool seterrorcode(int errorno){__errorcode=errorno;return false;};
+ Soundplayer *player;
+
+private:
+ int __errorcode;
+};
+
+
+// Class for playing wave file
+class Wavefileplayer : public Fileplayer
+{
+public:
+ Wavefileplayer();
+ ~Wavefileplayer();
+
+ bool openfile(char *filename,char *device);
+ void setforcetomono(bool flag);
+ bool playing(int verbose);
+
+private:
+ Soundinputstream *loader;
+ Wavetoraw *server;
+};
+
+
+// Class for playing MPEG file
+class Mpegfileplayer : public Fileplayer
+{
+public:
+ Mpegfileplayer();
+ ~Mpegfileplayer();
+
+ bool openfile(char *filename,char *device);
+ void setforcetomono(bool flag);
+ void setdownfrequency(int value);
+ bool playing(int verbose);
+#if PTHREADEDMPEG
+ bool playingwiththread(int verbose,int framenumbers);
+#endif
+ bool startplay(void);
+ bool callformore(void);
+ bool playmore(void);
+
+private:
+ Soundinputstream *loader;
+ Mpegtoraw *server;
+
+ void showverbose(int verbose);
+};
+
+/*
+ Disk functions to make it DOS friendly.
+ Added by Salvador E. Tropea
+*/
+
+extern mode_t Mpegsound_DefaultCreateMode; // So the user can change it
+extern int Mpegsound_creat(const char *filename);
+extern FILE *Mpegsound_fopenR(const char *filename);
+
+#endif
diff --git a/setedit/mp3/mpegsound/mpegtable.cc b/setedit/mp3/mpegsound/mpegtable.cc
new file mode 100644
index 0000000..994192f
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegtable.cc
@@ -0,0 +1,191 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Mpegtable.cc
+// It has tables for MPEG layer 1, 2 and a part of layer 3
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+// For header
+const int Mpegtoraw::frequencies[2][3]=
+{
+ {44100,48000,32000}, // MPEG 1
+ {22050,24000,16000} // MPEG 2
+};
+
+const int Mpegtoraw::bitrate[2][3][15]=
+{
+ // MPEG 1
+ {{0,32,64,96,128,160,192,224,256,288,320,352,384,416,448},
+ {0,32,48,56,64,80,96,112,128,160,192,224,256,320,384},
+ {0,32,40,48,56,64,80,96,112,128,160,192,224,256,320}},
+
+ // MPEG 2
+ {{0,32,48,56,64,80,96,112,128,144,160,176,192,224,256},
+ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160},
+ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160}}
+};
+
+// Mpeg general table
+const REAL Mpegtoraw::scalefactorstable[64] =
+{
+ 2.00000000000000, 1.58740105196820, 1.25992104989487, 1.00000000000000,
+ 0.79370052598410, 0.62996052494744, 0.50000000000000, 0.39685026299205,
+ 0.31498026247372, 0.25000000000000, 0.19842513149602, 0.15749013123686,
+ 0.12500000000000, 0.09921256574801, 0.07874506561843, 0.06250000000000,
+ 0.04960628287401, 0.03937253280921, 0.03125000000000, 0.02480314143700,
+ 0.01968626640461, 0.01562500000000, 0.01240157071850, 0.00984313320230,
+ 0.00781250000000, 0.00620078535925, 0.00492156660115, 0.00390625000000,
+ 0.00310039267963, 0.00246078330058, 0.00195312500000, 0.00155019633981,
+ 0.00123039165029, 0.00097656250000, 0.00077509816991, 0.00061519582514,
+ 0.00048828125000, 0.00038754908495, 0.00030759791257, 0.00024414062500,
+ 0.00019377454248, 0.00015379895629, 0.00012207031250, 0.00009688727124,
+ 0.00007689947814, 0.00006103515625, 0.00004844363562, 0.00003844973907,
+ 0.00003051757813, 0.00002422181781, 0.00001922486954, 0.00001525878906,
+ 0.00001211090890, 0.00000961243477, 0.00000762939453, 0.00000605545445,
+ 0.00000480621738, 0.00000381469727, 0.00000302772723, 0.00000240310869,
+ 0.00000190734863, 0.00000151386361, 0.00000120155435, 0.00000000000000
+};
+
+const REAL Mpegtoraw::filter[512]=
+{
+ 0.000000000, -0.000442505, 0.003250122, -0.007003784,
+ 0.031082153, -0.078628540, 0.100311279, -0.572036743,
+ 1.144989014, 0.572036743, 0.100311279, 0.078628540,
+ 0.031082153, 0.007003784, 0.003250122, 0.000442505,
+ -0.000015259, -0.000473022, 0.003326416, -0.007919312,
+ 0.030517578, -0.084182739, 0.090927124, -0.600219727,
+ 1.144287109, 0.543823242, 0.108856201, 0.073059082,
+ 0.031478882, 0.006118774, 0.003173828, 0.000396729,
+ -0.000015259, -0.000534058, 0.003387451, -0.008865356,
+ 0.029785156, -0.089706421, 0.080688477, -0.628295898,
+ 1.142211914, 0.515609741, 0.116577148, 0.067520142,
+ 0.031738281, 0.005294800, 0.003082275, 0.000366211,
+ -0.000015259, -0.000579834, 0.003433228, -0.009841919,
+ 0.028884888, -0.095169067, 0.069595337, -0.656219482,
+ 1.138763428, 0.487472534, 0.123474121, 0.061996460,
+ 0.031845093, 0.004486084, 0.002990723, 0.000320435,
+ -0.000015259, -0.000625610, 0.003463745, -0.010848999,
+ 0.027801514, -0.100540161, 0.057617188, -0.683914185,
+ 1.133926392, 0.459472656, 0.129577637, 0.056533813,
+ 0.031814575, 0.003723145, 0.002899170, 0.000289917,
+ -0.000015259, -0.000686646, 0.003479004, -0.011886597,
+ 0.026535034, -0.105819702, 0.044784546, -0.711318970,
+ 1.127746582, 0.431655884, 0.134887695, 0.051132202,
+ 0.031661987, 0.003005981, 0.002792358, 0.000259399,
+ -0.000015259, -0.000747681, 0.003479004, -0.012939453,
+ 0.025085449, -0.110946655, 0.031082153, -0.738372803,
+ 1.120223999, 0.404083252, 0.139450073, 0.045837402,
+ 0.031387329, 0.002334595, 0.002685547, 0.000244141,
+ -0.000030518, -0.000808716, 0.003463745, -0.014022827,
+ 0.023422241, -0.115921021, 0.016510010, -0.765029907,
+ 1.111373901, 0.376800537, 0.143264771, 0.040634155,
+ 0.031005859, 0.001693726, 0.002578735, 0.000213623,
+ -0.000030518, -0.000885010, 0.003417969, -0.015121460,
+ 0.021575928, -0.120697021, 0.001068115, -0.791213989,
+ 1.101211548, 0.349868774, 0.146362305, 0.035552979,
+ 0.030532837, 0.001098633, 0.002456665, 0.000198364,
+ -0.000030518, -0.000961304, 0.003372192, -0.016235352,
+ 0.019531250, -0.125259399, -0.015228271, -0.816864014,
+ 1.089782715, 0.323318481, 0.148773193, 0.030609131,
+ 0.029937744, 0.000549316, 0.002349854, 0.000167847,
+ -0.000030518, -0.001037598, 0.003280640, -0.017349243,
+ 0.017257690, -0.129562378, -0.032379150, -0.841949463,
+ 1.077117920, 0.297210693, 0.150497437, 0.025817871,
+ 0.029281616, 0.000030518, 0.002243042, 0.000152588,
+ -0.000045776, -0.001113892, 0.003173828, -0.018463135,
+ 0.014801025, -0.133590698, -0.050354004, -0.866363525,
+ 1.063217163, 0.271591187, 0.151596069, 0.021179199,
+ 0.028533936, -0.000442505, 0.002120972, 0.000137329,
+ -0.000045776, -0.001205444, 0.003051758, -0.019577026,
+ 0.012115479, -0.137298584, -0.069168091, -0.890090942,
+ 1.048156738, 0.246505737, 0.152069092, 0.016708374,
+ 0.027725220, -0.000869751, 0.002014160, 0.000122070,
+ -0.000061035, -0.001296997, 0.002883911, -0.020690918,
+ 0.009231567, -0.140670776, -0.088775635, -0.913055420,
+ 1.031936646, 0.221984863, 0.151962280, 0.012420654,
+ 0.026840210, -0.001266479, 0.001907349, 0.000106812,
+ -0.000061035, -0.001388550, 0.002700806, -0.021789551,
+ 0.006134033, -0.143676758, -0.109161377, -0.935195923,
+ 1.014617920, 0.198059082, 0.151306152, 0.008316040,
+ 0.025909424, -0.001617432, 0.001785278, 0.000106812,
+ -0.000076294, -0.001480103, 0.002487183, -0.022857666,
+ 0.002822876, -0.146255493, -0.130310059, -0.956481934,
+ 0.996246338, 0.174789429, 0.150115967, 0.004394531,
+ 0.024932861, -0.001937866, 0.001693726, 0.000091553,
+ -0.000076294, -0.001586914, 0.002227783, -0.023910522,
+ -0.000686646, -0.148422241, -0.152206421, -0.976852417,
+ 0.976852417, 0.152206421, 0.148422241, 0.000686646,
+ 0.023910522, -0.002227783, 0.001586914, 0.000076294,
+ -0.000091553, -0.001693726, 0.001937866, -0.024932861,
+ -0.004394531, -0.150115967, -0.174789429, -0.996246338,
+ 0.956481934, 0.130310059, 0.146255493, -0.002822876,
+ 0.022857666, -0.002487183, 0.001480103, 0.000076294,
+ -0.000106812, -0.001785278, 0.001617432, -0.025909424,
+ -0.008316040, -0.151306152, -0.198059082, -1.014617920,
+ 0.935195923, 0.109161377, 0.143676758, -0.006134033,
+ 0.021789551, -0.002700806, 0.001388550, 0.000061035,
+ -0.000106812, -0.001907349, 0.001266479, -0.026840210,
+ -0.012420654, -0.151962280, -0.221984863, -1.031936646,
+ 0.913055420, 0.088775635, 0.140670776, -0.009231567,
+ 0.020690918, -0.002883911, 0.001296997, 0.000061035,
+ -0.000122070, -0.002014160, 0.000869751, -0.027725220,
+ -0.016708374, -0.152069092, -0.246505737, -1.048156738,
+ 0.890090942, 0.069168091, 0.137298584, -0.012115479,
+ 0.019577026, -0.003051758, 0.001205444, 0.000045776,
+ -0.000137329, -0.002120972, 0.000442505, -0.028533936,
+ -0.021179199, -0.151596069, -0.271591187, -1.063217163,
+ 0.866363525, 0.050354004, 0.133590698, -0.014801025,
+ 0.018463135, -0.003173828, 0.001113892, 0.000045776,
+ -0.000152588, -0.002243042, -0.000030518, -0.029281616,
+ -0.025817871, -0.150497437, -0.297210693, -1.077117920,
+ 0.841949463, 0.032379150, 0.129562378, -0.017257690,
+ 0.017349243, -0.003280640, 0.001037598, 0.000030518,
+ -0.000167847, -0.002349854, -0.000549316, -0.029937744,
+ -0.030609131, -0.148773193, -0.323318481, -1.089782715,
+ 0.816864014, 0.015228271, 0.125259399, -0.019531250,
+ 0.016235352, -0.003372192, 0.000961304, 0.000030518,
+ -0.000198364, -0.002456665, -0.001098633, -0.030532837,
+ -0.035552979, -0.146362305, -0.349868774, -1.101211548,
+ 0.791213989, -0.001068115, 0.120697021, -0.021575928,
+ 0.015121460, -0.003417969, 0.000885010, 0.000030518,
+ -0.000213623, -0.002578735, -0.001693726, -0.031005859,
+ -0.040634155, -0.143264771, -0.376800537, -1.111373901,
+ 0.765029907, -0.016510010, 0.115921021, -0.023422241,
+ 0.014022827, -0.003463745, 0.000808716, 0.000030518,
+ -0.000244141, -0.002685547, -0.002334595, -0.031387329,
+ -0.045837402, -0.139450073, -0.404083252, -1.120223999,
+ 0.738372803, -0.031082153, 0.110946655, -0.025085449,
+ 0.012939453, -0.003479004, 0.000747681, 0.000015259,
+ -0.000259399, -0.002792358, -0.003005981, -0.031661987,
+ -0.051132202, -0.134887695, -0.431655884, -1.127746582,
+ 0.711318970, -0.044784546, 0.105819702, -0.026535034,
+ 0.011886597, -0.003479004, 0.000686646, 0.000015259,
+ -0.000289917, -0.002899170, -0.003723145, -0.031814575,
+ -0.056533813, -0.129577637, -0.459472656, -1.133926392,
+ 0.683914185, -0.057617188, 0.100540161, -0.027801514,
+ 0.010848999, -0.003463745, 0.000625610, 0.000015259,
+ -0.000320435, -0.002990723, -0.004486084, -0.031845093,
+ -0.061996460, -0.123474121, -0.487472534, -1.138763428,
+ 0.656219482, -0.069595337, 0.095169067, -0.028884888,
+ 0.009841919, -0.003433228, 0.000579834, 0.000015259,
+ -0.000366211, -0.003082275, -0.005294800, -0.031738281,
+ -0.067520142, -0.116577148, -0.515609741, -1.142211914,
+ 0.628295898, -0.080688477, 0.089706421, -0.029785156,
+ 0.008865356, -0.003387451, 0.000534058, 0.000015259,
+ -0.000396729, -0.003173828, -0.006118774, -0.031478882,
+ -0.073059082, -0.108856201, -0.543823242, -1.144287109,
+ 0.600219727, -0.090927124, 0.084182739, -0.030517578,
+ 0.007919312, -0.003326416, 0.000473022, 0.000015259
+};
+
+REAL Mpegtoraw::hcos_64[16],
+ Mpegtoraw::hcos_32[ 8],
+ Mpegtoraw::hcos_16[ 4],
+ Mpegtoraw::hcos_8 [ 2],
+ Mpegtoraw::hcos_4;
diff --git a/setedit/mp3/mpegsound/mpegtoraw.cc b/setedit/mp3/mpegsound/mpegtoraw.cc
new file mode 100644
index 0000000..29792fc
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegtoraw.cc
@@ -0,0 +1,850 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae
+ (C) 2000 by Salvador E. Tropea */
+
+// Mpegtoraw.cc
+// Server which get mpeg format and put raw format.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <math.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "mpegsound.h"
+#include "mpg_locals.h"
+
+#define MY_PI 3.14159265358979323846
+
+Mpegtoraw::Mpegtoraw(Soundinputstream *loader,Soundplayer *player)
+{
+ __errorcode=SOUND_ERROR_OK;
+ frameoffsets=frametimes=NULL;
+
+ forcetomonoflag=false;
+ downfrequency=0;
+ playing=false;
+
+ this->loader=loader;
+ this->player=player;
+}
+
+Mpegtoraw::~Mpegtoraw()
+{
+ if(frameoffsets)delete [] frameoffsets;
+ if(frametimes)delete [] frametimes;
+}
+
+#ifndef WORDS_BIGENDIAN
+#define _KEY 0
+#else
+#define _KEY 3
+#endif
+
+int Mpegtoraw::getbits(int bits)
+{
+ union
+ {
+ char store[4];
+ int current;
+ }u;
+ int bi;
+
+ if(!bits)return 0;
+
+ u.current=0;
+ bi=(bitindex&7);
+ u.store[_KEY]=buffer[bitindex>>3]<<bi;
+ bi=8-bi;
+ bitindex+=bi;
+
+ while(bits)
+ {
+ if(!bi)
+ {
+ u.store[_KEY]=buffer[bitindex>>3];
+ bitindex+=8;
+ bi=8;
+ }
+
+ if(bits>=bi)
+ {
+ u.current<<=bi;
+ bits-=bi;
+ bi=0;
+ }
+ else
+ {
+ u.current<<=bits;
+ bi-=bits;
+ bits=0;
+ }
+ }
+ bitindex-=bi;
+
+ return (u.current>>8);
+}
+
+void Mpegtoraw::setforcetomono(bool flag)
+{
+ forcetomonoflag=flag;
+}
+
+void Mpegtoraw::setdownfrequency(int value)
+{
+ downfrequency=0;
+ if(value)downfrequency=1;
+}
+
+bool Mpegtoraw::getforcetomono(void)
+{
+ return forcetomonoflag;
+}
+
+int Mpegtoraw::getdownfrequency(void)
+{
+ return downfrequency;
+}
+
+int Mpegtoraw::getpcmperframe(void)
+{
+ int s;
+
+ s=32;
+ if(layer==3)
+ {
+ s*=18;
+ if(version==0)s*=2;
+ }
+ else
+ {
+ s*=SCALEBLOCK;
+ if(layer==2)s*=3;
+ }
+
+ return s;
+}
+
+inline void Mpegtoraw::flushrawdata(void)
+#ifdef PTHREADEDMPEG
+{
+ if(threadflags.thread)
+ {
+ if(((threadqueue.tail+1)%threadqueue.framenumber)==threadqueue.head)
+ {
+ while(((threadqueue.tail+1)%threadqueue.framenumber)==threadqueue.head)
+ usleep(200);
+ }
+ memcpy(threadqueue.buffer+(threadqueue.tail*RAWDATASIZE),rawdata,
+ RAWDATASIZE*sizeof(short int));
+ threadqueue.sizes[threadqueue.tail]=(rawdataoffset<<1);
+
+ if(threadqueue.tail>=threadqueue.frametail)
+ threadqueue.tail=0;
+ else threadqueue.tail++;
+ }
+ else
+ {
+ player->putblock((char *)rawdata,rawdataoffset<<1);
+ currentframe++;
+ }
+}
+#else
+{
+ player->putblock((char *)rawdata,rawdataoffset<<1);
+ currentframe++;
+};
+#endif
+
+typedef struct
+{
+ char *songname;
+ char *artist;
+ char *album;
+ char *year;
+ char *comment;
+}ID3;
+
+static void strman(char *str,int max)
+{
+ int i;
+
+ str[max]=0;
+
+ for(i=max-1;i>=0;i--)
+ if(((unsigned char)str[i])<26 || str[i]==' ')str[i]=0; else break;
+}
+
+/**************** Genre by Salvador E. Tropea (SET) *********************/
+static
+const char *GenreStr[]={
+"Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop", // 0-7
+"Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock",// 8-17
+"Techno","Industrial","Alternative","Ska","Death Metal","Pranks", // 18-23
+"Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk", // 24-29
+"Fusion","Trance","Classical","Instrumental","Acid","House","Game", // 30-36
+"Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space", // 37-44
+"Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic", // 45-49
+"Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream", // 50-55
+"Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap", // 56-61
+"Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic", // 62-67
+"Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz", // 63-74
+"Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock", // 75-81
+"National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic", // 82-88
+"Bluegrass","Avantgarde","Gothic Rock","Progressive Rock", // 89-92
+"Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus", // 93-97
+"Easy Listening","Acoustic","Humour","Speech","Chanson","Opera", // 98-103
+"Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove", // 104-109
+"Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad", // 110-116
+"Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo", // 117-122
+"Acapella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House", // 123-128
+"Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk punk","Beat", // 129-135
+"Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover", // 136-139
+"Contemporary Christian","Christian Rock" // 140-141
+};
+
+const int maxKnownGenre=sizeof(GenreStr)/sizeof(char *);
+/********** End of Genre by Salvador E. Tropea (SET) *********************/
+
+inline void parseID3(Soundinputstream *fp,ID3 *data,const char *&genre,
+ bool avoidID3)
+{
+ int tryflag=0;
+
+ data->songname[0]=0;
+ data->artist [0]=0;
+ data->album [0]=0;
+ data->year [0]=0;
+ data->comment [0]=0;
+ genre="Unknown";
+ if(avoidID3 || !fp->getcanseek())return;
+
+ int oldPos=fp->getposition();
+ fp->setposition(fp->getsize()-128);
+
+ for(;;)
+ {
+ if(fp->getbytedirect()==0x54)
+ if(fp->getbytedirect()==0x41)
+ if(fp->getbytedirect()==0x47)
+ {
+ fp->_readbuffer(data->songname,30);strman(data->songname,30);
+ fp->_readbuffer(data->artist ,30);strman(data->artist, 30);
+ fp->_readbuffer(data->album ,30);strman(data->album, 30);
+ fp->_readbuffer(data->year , 4);strman(data->year, 4);
+ fp->_readbuffer(data->comment ,30);strman(data->comment, 30);
+ int g=fp->getbytedirect();
+ if(g<maxKnownGenre && g>=0)genre=GenreStr[g];
+ break;
+ }
+
+ tryflag++;
+ if(tryflag==1)fp->setposition(fp->getsize()-125); // for mpd 0.1, Sorry..
+ else break;
+ }
+
+ fp->setposition(oldPos);
+}
+
+inline void stripfilename(char *dtr,char *str,int max)
+{
+ char *ss;
+ int p=0,s=0;
+
+ for(;str[p];p++)
+ if(str[p]=='/')
+ {
+ p++;
+ s=p;
+ }
+
+ ss=str+s;
+ for(p=0;p<max && ss[p];p++)dtr[p]=ss[p];
+ dtr[p]=0;
+}
+
+/*****************************************************************************
+
+ SET:
+ The following member checks if the file is a Variable Bit Rate one (VBR).
+ I took the information of VBR files from LAME source code.
+
+*****************************************************************************/
+
+// Amount of free bytes after the header
+int SizeOfEmptyFrame[2][2]={{32,17},{17,9}};
+// Options flags
+const int fFrames=1,fBytes=2,fTOC=4,fVBRScale=8;
+// Data is stored in big endian format, this is a converter
+static
+unsigned ExtractI4(unsigned char *buf)
+{
+ unsigned x;
+ #if WORDS_BIGENDIAN
+ x=*((unsigned *)buf);
+ #else
+ x =buf[0]; x<<=8;
+ x|=buf[1]; x<<=8;
+ x|=buf[2]; x<<=8;
+ x|=buf[3];
+ #endif
+ return x;
+}
+
+bool Mpegtoraw::checkforvbr(void)
+{
+ // Seek to the VBR tag position, 4 is the size of the MPG header
+ loader->setposition(SizeOfEmptyFrame[version][mode==single ? 1 : 0]+4);
+ // Check the tag: Xing
+ char buf[4];
+ loader->getblock(buf,4);
+ if (buf[0]!='X' || buf[1]!='i' || buf[2]!='n' || buf[3]!='g') return false;
+ // Get the flags
+ unsigned flags;
+ loader->getbytedirect();
+ loader->getbytedirect();
+ loader->getbytedirect();
+ flags=loader->getbytedirect();
+ // Total number of frames
+ if (!(flags & fFrames)) return false;
+ loader->getblock(buf,4);
+ totalframe=ExtractI4((unsigned char *)buf);
+ // Total file size
+ if (flags & fBytes)
+ loader->getblock(buf,4);
+ // Table of contents
+ if (flags & fTOC)
+ {
+ haveTOC=true;
+ loader->getblock((char *)TOC,100);
+ }
+ // Then comes the VBR scale but we don't need it.
+ // Now go to the first real frame
+ int startPosition=framesize;
+ loader->setposition(startPosition);
+ // Read information of a real frame
+ loadheader();
+ // Let the position where the real frame is.
+ loader->setposition(startPosition);
+ return true;
+}
+
+// Convert mpeg to raw
+// Mpeg headder class
+void Mpegtoraw::initialize(char *filename, bool avoidID3)
+{
+ static bool initialized=false;
+
+ register int i;
+ register REAL *s1,*s2;
+ REAL *s3,*s4;
+
+ scalefactor=SCALE;
+ calcbufferoffset=15;
+ currentcalcbuffer=0;
+
+ s1=calcbufferL[0];s2=calcbufferR[0];
+ s3=calcbufferL[1];s4=calcbufferR[1];
+ for(i=CALCBUFFERSIZE-1;i>=0;i--)
+ calcbufferL[0][i]=calcbufferL[1][i]=
+ calcbufferR[0][i]=calcbufferR[1][i]=0.0;
+
+ if(!initialized)
+ {
+ for(i=0;i<16;i++)hcos_64[i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/64.0));
+ for(i=0;i< 8;i++)hcos_32[i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/32.0));
+ for(i=0;i< 4;i++)hcos_16[i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/16.0));
+ for(i=0;i< 2;i++)hcos_8 [i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/ 8.0));
+ hcos_4=1.0/(2.0*cos(MY_PI*1.0/4.0));
+ initialized=true;
+ }
+
+ layer3initialize();
+
+ currentframe=decodeframe=0;
+ haveTOC=false;
+ if(loader->getcanseek() && loadheader())
+ {
+ if(!checkforvbr())
+ {
+ totalframe=(loader->getsize()+framesize-1)/framesize;
+ loader->setposition(0);
+ }
+ totaltime=8*getframesize()/getbitrate()*totalframe;
+ }
+ else totalframe=0;
+
+
+ if(frameoffsets)delete [] frameoffsets;
+ if(frametimes)delete [] frametimes;
+
+ songinfo.name[0]=0;
+ if(totalframe>0)
+ {
+ frameoffsets=new int[totalframe];
+ frametimes=new int[totalframe];
+ for(i=totalframe-1;i>=0;i--)
+ frameoffsets[i]=0, frametimes[i]=0;
+
+ {
+ ID3 data;
+
+ data.songname=songinfo.name;
+ data.artist =songinfo.artist;
+ data.album =songinfo.album;
+ data.year =songinfo.year;
+ data.comment =songinfo.comment;
+ parseID3(loader,&data,songinfo.genre,avoidID3);
+ }
+ frameoffsets[0]=loader->getposition();
+ }
+ else frameoffsets=frametimes=NULL;
+
+ if(songinfo.name[0]==0)
+ if(filename!=NULL)
+ stripfilename(songinfo.name,filename,30);
+
+#ifdef PTHREADEDMPEG
+ threadflags.thread=false;
+ threadqueue.buffer=NULL;
+ threadqueue.sizes=NULL;
+#endif
+};
+
+// This function computes how many miliseconds of sound contains this frame
+// and adds it to the previous one.
+// Added by SET to compute Variable Bit Rate encoded files.
+int Mpegtoraw::ComputeTimeForFrame(int i)
+{
+ int prev=i==0 ? 0 : frametimes[i-1];
+ int br=getbitrate();
+ return br ? prev+(8*getframesize()/br) : prev;
+}
+
+// This function returns an estimation for the total time of the MP3 based
+// on the amount of sound played.
+// Time is in miliseconds.
+int Mpegtoraw::gettotaltime(void)
+{
+ return totaltime;
+ /*if(!frameoffsets)return 0;
+ if(frameoffsets[currentframe]==0)return 8*loader->getsize()/getbitrate();
+ return (int)((double)(loader->getsize())/frameoffsets[currentframe]*
+ getcurtime()+0.5);*/
+}
+
+void Mpegtoraw::setframe(int framenumber)
+{
+ player->abort();
+ int pos=0;
+
+ if(frameoffsets==NULL)return;
+ if(framenumber<=0)pos=frameoffsets[0];
+ else
+ {
+ if(framenumber>=totalframe)framenumber=totalframe-1;
+ pos=frameoffsets[framenumber];
+ if(pos==0)
+ {
+ int i;
+
+ for(i=framenumber-1;i>0;i--)
+ if(frameoffsets[i]!=0)break;
+
+ loader->setposition(frameoffsets[i]);
+
+ while(i<framenumber)
+ {
+ loadheader();
+ i++;
+ frameoffsets[i]=loader->getposition();
+ frametimes[i]=ComputeTimeForFrame(i);
+ }
+ pos=frameoffsets[framenumber];
+ }
+ }
+
+ clearbuffer();
+ loader->setposition(pos);
+ decodeframe=currentframe=framenumber;
+}
+
+
+void Mpegtoraw::settimepos(int time)
+{
+ player->abort();
+ int pos,i=0;
+
+ if(frameoffsets==NULL)return;
+ if(time<=0)pos=frameoffsets[0];
+ else
+ {
+ i=0; pos=frametimes[0];
+ while (i<totalframe && pos && pos<time) pos=frametimes[++i];
+ if(!pos)
+ {
+ loader->setposition(frameoffsets[i-1]);
+ while (i<totalframe)
+ {
+ loadheader();
+ if(geterrorcode()==SOUND_ERROR_BAD)
+ {
+ seterrorcode(SOUND_ERROR_OK);
+ continue; // Just skip this frame
+ }
+ if(geterrorcode()!=SOUND_ERROR_OK)break;
+ frameoffsets[i]=loader->getposition();
+ pos=frametimes[i]=ComputeTimeForFrame(i);
+ if(pos>=time)break;
+ i++;
+ }
+ }
+ i--;
+ pos=frameoffsets[i];
+ }
+
+ clearbuffer();
+ loader->setposition(pos);
+ decodeframe=currentframe=i;
+}
+
+void Mpegtoraw::clearbuffer(void)
+{
+#ifdef PTHREADEDMPEG
+ if(threadflags.thread)
+ {
+ threadflags.criticalflag=false;
+ threadflags.criticallock=true;
+ while(!threadflags.criticalflag)usleep(1);
+ threadqueue.head=threadqueue.tail=0;
+ threadflags.criticallock=false;
+ }
+#endif
+ player->abort();
+ player->resetsoundtype();
+ playing=true;
+}
+
+bool Mpegtoraw::loadheader(void)
+{
+ register int c;
+ bool flag;
+
+ sync();
+
+// Synchronize
+ flag=false;
+ do
+ {
+
+ if((c=loader->getbytedirect())<0)break;
+
+ if(c==0xff)
+ while(!flag)
+ {
+ if((c=loader->getbytedirect())<0)
+ {
+ flag=true;
+ break;
+ }
+ if((c&0xf0)==0xf0)
+ {
+ flag=true;
+ break;
+ }
+ else if(c!=0xff)break;
+ }
+ }while(!flag);
+
+ if(c<0)return seterrorcode(SOUND_ERROR_FINISH);
+
+
+
+// Analyzing
+ c&=0xf;
+ protection=c&1;
+ layer=4-((c>>1)&3);
+ version=(_mpegversion)((c>>3)^1);
+
+ c=((loader->getbytedirect()))>>1;
+ padding=(c&1); c>>=1;
+ frequency=(_frequency)(c&2); c>>=2;
+ bitrateindex=(int)c;
+ if(bitrateindex==15)return seterrorcode(SOUND_ERROR_BAD);
+
+ c=((unsigned int)(loader->getbytedirect()))>>4;
+ extendedmode=c&3;
+ mode=(_mode)(c>>2);
+
+
+// Making information
+ inputstereo= (mode==single)?0:1;
+ if(forcetomonoflag)outputstereo=0; else outputstereo=inputstereo;
+
+ /* if(layer==2)
+ if((bitrateindex>=1 && bitrateindex<=3) || (bitrateindex==5)) {
+ if(inputstereo)return seterrorcode(SOUND_ERROR_BAD); }
+ else if(bitrateindex==11 && mode==single)
+ return seterrorcode(SOUND_ERROR_BAD); */
+
+ channelbitrate=bitrateindex;
+ if(inputstereo)
+ if(channelbitrate==4)channelbitrate=1;
+ else channelbitrate-=4;
+
+ if(channelbitrate==1 || channelbitrate==2)tableindex=0; else tableindex=1;
+
+ if(layer==1)subbandnumber=MAXSUBBAND;
+ else
+ {
+ if(!tableindex)
+ if(frequency==frequency32000)subbandnumber=12; else subbandnumber=8;
+ else if(frequency==frequency48000||
+ (channelbitrate>=3 && channelbitrate<=5))
+ subbandnumber=27;
+ else subbandnumber=30;
+ }
+
+ if(mode==single)stereobound=0;
+ else if(mode==joint)stereobound=(extendedmode+1)<<2;
+ else stereobound=subbandnumber;
+
+ if(stereobound>subbandnumber)stereobound=subbandnumber;
+
+ // framesize & slots
+ if(layer==1)
+ {
+ framesize=(12000*bitrate[version][0][bitrateindex])/
+ frequencies[version][frequency];
+ if(frequency==frequency44100 && padding)framesize++;
+ framesize<<=2;
+ }
+ else
+ {
+ framesize=(144000*bitrate[version][layer-1][bitrateindex])/
+ (frequencies[version][frequency]<<version);
+ if(padding)framesize++;
+ if(layer==3)
+ {
+ if(version)
+ layer3slots=framesize-((mode==single)?9:17)
+ -(protection?0:2)
+ -4;
+ else
+ layer3slots=framesize-((mode==single)?17:32)
+ -(protection?0:2)
+ -4;
+ }
+ }
+
+ if(framesize-4>RAWDATASIZE)
+ {// SET: Avoid corrupting data if we got a wrong framesize.
+ seterrorcode(SOUND_ERROR_BAD);
+ return false;
+ }
+ if(!fillbuffer(framesize-4))seterrorcode(SOUND_ERROR_FILEREADFAIL);
+
+ if(!protection)
+ {
+ getbyte(); // CRC, Not check!!
+ getbyte();
+ }
+
+
+ if(loader->eof())return seterrorcode(SOUND_ERROR_FINISH);
+
+ return true;
+}
+
+/***************************/
+/* Playing in multi-thread */
+/***************************/
+#ifdef PTHREADEDMPEG
+/* Player routine */
+void Mpegtoraw::threadedplayer(void)
+{
+ while(!threadflags.quit)
+ {
+ while(threadflags.pause || threadflags.criticallock)
+ {
+ threadflags.criticalflag=true;
+ usleep(200);
+ }
+
+ if(threadqueue.head!=threadqueue.tail)
+ {
+ player->putblock(threadqueue.buffer+threadqueue.head*RAWDATASIZE,
+ threadqueue.sizes[threadqueue.head]);
+ currentframe++;
+ if(threadqueue.head==threadqueue.frametail)
+ threadqueue.head=0;
+ else threadqueue.head++;
+ }
+ else
+ {
+ if(threadflags.done)break; // Terminate when done
+ usleep(200);
+ }
+ }
+ threadflags.thread=false;
+}
+
+static void *threadlinker(void *arg)
+{
+ ((Mpegtoraw *)arg)->threadedplayer();
+
+ return NULL;
+}
+
+bool Mpegtoraw::makethreadedplayer(int framenumbers)
+{
+ threadqueue.buffer=
+ (short int *)malloc(sizeof(short int)*RAWDATASIZE*framenumbers);
+ if(threadqueue.buffer==NULL)
+ seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ threadqueue.sizes=(int *)malloc(sizeof(int)*framenumbers);
+ if(threadqueue.sizes==NULL)
+ seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ threadqueue.framenumber=framenumbers;
+ threadqueue.frametail=framenumbers-1;
+ threadqueue.head=threadqueue.tail=0;
+
+
+ threadflags.quit=threadflags.done=
+ threadflags.pause=threadflags.criticallock=false;
+
+ threadflags.thread=true;
+ if(pthread_create(&thread,0,threadlinker,this))
+ seterrorcode(SOUND_ERROR_THREADFAIL);
+
+ return true;
+}
+
+void Mpegtoraw::freethreadedplayer(void)
+{
+ threadflags.criticallock=
+ threadflags.pause=false;
+ threadflags.done=true; // Terminate thread player
+ while(threadflags.thread)usleep(10); // Wait for done...
+ if(threadqueue.buffer)free(threadqueue.buffer);
+ if(threadqueue.sizes)free(threadqueue.sizes);
+}
+
+
+
+
+void Mpegtoraw::stopthreadedplayer(void)
+{
+ threadflags.quit=true;
+};
+
+void Mpegtoraw::pausethreadedplayer(void)
+{
+ threadflags.pause=true;
+};
+
+void Mpegtoraw::unpausethreadedplayer(void)
+{
+ threadflags.pause=false;
+};
+
+
+bool Mpegtoraw::existthread(void)
+{
+ return threadflags.thread;
+}
+
+int Mpegtoraw::getframesaved(void)
+{
+ if(threadqueue.framenumber)
+ return
+ ((threadqueue.tail+threadqueue.framenumber-threadqueue.head)
+ %threadqueue.framenumber);
+ return 0;
+}
+
+#endif
+
+void Mpegtoraw::stopplay()
+{
+ player->abort();
+ playing=false;
+ loader->setposition(frameoffsets ? frameoffsets[0] : 0);
+ currentframe=decodeframe=0;
+ loadheader();
+}
+
+// Convert mpeg to raw
+bool Mpegtoraw::run(int frames)
+{
+ if (!playing && frames!=-1) return false;
+ clearrawdata();
+ if(frames<0)lastfrequency=-1; // SET: not 0 because that's 44.1 KHz!
+
+ for(;frames;frames--)
+ {
+ if(totalframe>0)
+ {
+ if(decodeframe<totalframe)
+ {
+ frameoffsets[decodeframe]=loader->getposition();
+ frametimes[decodeframe]=ComputeTimeForFrame(decodeframe);
+ }
+ }
+
+ if(loader->eof())
+ {
+ seterrorcode(SOUND_ERROR_FINISH);
+ break;
+ }
+
+ bool headerOK=loadheader();
+ if(!headerOK || (frequency!=lastfrequency && lastfrequency!=-1))
+ {
+ // SET: I added it to make the player more robust. I have a lot a severely
+ // damaged files.
+ // SOUND_ERROR_BAD is generated when the bit rate is incoherent. Under such
+ // a case I force to read more headers until I find one with the same sample
+ // rate.
+ // It works quite well for my files. I have files with 5 and more errors.
+ //printf("Error al leer el header en: frame %d offset: %d\n",decodeframe,loader->getposition());
+ if(frequency!=lastfrequency)seterrorcode(SOUND_ERROR_BAD);
+ bool giveChance=true;
+ while(geterrorcode()==SOUND_ERROR_BAD && !loader->eof() && giveChance)
+ giveChance=!(loadheader() && frequency==lastfrequency);
+ if(frequency!=lastfrequency){seterrorcode(SOUND_ERROR_BAD); break;}
+ if(giveChance)break;
+ seterrorcode(SOUND_ERROR_OK);
+ }
+
+ if(frequency!=lastfrequency)lastfrequency=frequency;
+ if(frames<0)
+ {
+ frames=-frames;
+ player->setsoundtype(outputstereo,16,
+ frequencies[version][frequency]>>downfrequency);
+ playing=true;
+ seterrorcode(SOUND_ERROR_OK);
+ }
+
+ decodeframe++;
+
+ rawdataoffset=0; // SET: Clear it only here so callformore have an
+ // estimation of how much data is a an uncompressed frame.
+ if (layer==3)extractlayer3();
+ else if(layer==2)extractlayer2();
+ else if(layer==1)extractlayer1();
+
+ flushrawdata();
+ if(player->geterrorcode())seterrorcode(player->geterrorcode());
+ }
+
+ bool ret=(geterrorcode()==SOUND_ERROR_OK);
+ if (!ret)
+ stopplay();
+ return ret;
+}
+
diff --git a/setedit/mp3/mpegsound/mpegwtoraw.cc b/setedit/mp3/mpegsound/mpegwtoraw.cc
new file mode 100644
index 0000000..0324369
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpegwtoraw.cc
@@ -0,0 +1,105 @@
+#include <stdio.h>
+
+#include "mpegsound.h"
+
+static bool CheckForMP3InsideWavDontMove(Soundinputstream *f);
+static bool CheckForMP3InsideWav(Soundinputstream *f);
+
+void Mpegwavtoraw::initialize(char *filename, bool avoidID3)
+{
+ if (loader->getcanseek())
+ // Check if that's an MP3 inside a RIFF/WAVe.
+ // In this case avoid looking for the ID3 info.
+ avoidID3=CheckForMP3InsideWavDontMove(loader);
+ Mpegtoraw::initialize(filename,avoidID3);
+}
+
+
+#define getVal() f->getblock((char *)&val,4)
+#define seekCur(off) f->setposition(f->getposition()+off)
+// That's the internal function
+static
+bool CheckForMP3InsideWav(Soundinputstream *f)
+{
+ // Check if that's a RIFF and contains WAVE data
+ unsigned int val=0;
+
+ getVal();
+ if (val!=RIFF) return false;
+ getVal(); // Length of file
+ getVal();
+ if (val!=WAVE) return false;
+
+ // Ok, now look for the format of the WAVE
+ while(1)
+ {
+ if (getVal()==0) return false;
+ if (val==FMT) break;
+ // Nope, it isn't a format tag, skip it
+ getVal();
+ seekCur(val);
+ if (f->eof()) return false;
+ }
+
+ getVal(); // Size of fmt chunk
+ if (val<16) return false; // Should be at least 16 bytes
+
+ // Read the fmt values we know all WAVE files have
+ #pragma pack(1)
+ struct {
+ short wFormatTag;
+ short nChannels;
+ long nSamplesPerSec;
+ long nAvgBytePerSec;
+ short nBlockAlign;
+ short wBitsPerSample;
+ } pcm;
+ #pragma pack()
+ f->getblock((char *)&pcm,16);
+ // Skip the rest because we don't know what it means
+ if (val!=16) seekCur(val-16);
+
+ // Check if we have an MPEG stream
+ if (pcm.wFormatTag!=MPEG_CODE) return false;
+
+ // Now look for a data tag
+ while(1)
+ {
+ if (getVal()==0) return false;
+ if (val==DATA) break;
+ // Nope, it isn't a data tag, skip it
+ getVal();
+ seekCur(val);
+ if (f->eof()) return false;
+ }
+ getVal();
+ // Ok, now the file pointer is in a data and that's an MPEG stream.
+ // It isn't completly right because we could have more fmt,data,info,etc.
+ // tags, but this library wasn't designed for such a flexibility.
+ return true;
+}
+
+
+// A wrapper to avoid moving the file position
+static
+bool CheckForMP3InsideWavDontMove(Soundinputstream *f)
+{
+ long pos=f->getposition();
+ bool ret=CheckForMP3InsideWav(f);
+ if (!ret)
+ f->setposition(pos);
+ return ret;
+}
+
+// Checks if a file is an MPEG stream inside a WAVE file.
+bool Mpegsound_CheckMP3WAV(char *filename)
+{
+ if (!filename) return false;
+ int error;
+ Soundinputstream *in=Soundinputstream::hopen(filename,&error);
+ if (!in) return false;
+ bool ret=false;
+ if (in->getcanseek()) ret=CheckForMP3InsideWav(in);
+ delete in;
+ return ret;
+}
diff --git a/setedit/mp3/mpegsound/mpg_locals.h b/setedit/mp3/mpegsound/mpg_locals.h
new file mode 100644
index 0000000..c8c7cac
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpg_locals.h
@@ -0,0 +1,57 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Mpegsound_locals.h
+// It is used for compiling library
+
+#ifndef _L__SOUND_LOCALS__
+#define _L__SOUND_LOCALS__
+
+// Inline functions
+inline int Mpegtoraw::getbyte(void)
+{
+ int r=(unsigned char)buffer[bitindex>>3];
+
+ bitindex+=8;
+ return r;
+};
+
+inline int Mpegtoraw::getbits9(int bits)
+{
+ register unsigned short a;
+ {
+ int offset=bitindex>>3;
+
+ a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
+ }
+
+ a<<=(bitindex&7);
+ bitindex+=bits;
+ return (int)((unsigned int)(a>>(16-bits)));
+};
+
+inline int Mpegtoraw::getbits8(void)
+{
+ register unsigned short a;
+
+ {
+ int offset=bitindex>>3;
+
+ a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
+ }
+
+ a<<=(bitindex&7);
+ bitindex+=8;
+ return (int)((unsigned int)(a>>8));
+};
+
+inline int Mpegtoraw::getbit(void)
+{
+ register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
+
+ bitindex++;
+ return r;
+};
+
+#endif
diff --git a/setedit/mp3/mpegsound/mpglayr1.cc b/setedit/mp3/mpegsound/mpglayr1.cc
new file mode 100644
index 0000000..48844d7
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpglayr1.cc
@@ -0,0 +1,107 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Mpeglayer1.cc
+// It's for MPEG Layer 1
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+// Tables for layer 1
+static const REAL factortable[15] =
+{
+ 0.0,
+ (1.0/2.0) * (4.0/3.0), (1.0/4.0) * (8.0/7.0),
+ (1.0/8.0) * (16.0/15.0), (1.0/16.0) * (32.0/31.0),
+ (1.0/32.0) * (64.0/63.0), (1.0/64.0) * (128.0/127.0),
+ (1.0/128.0) * (256.0/255.0), (1.0/256.0) * (512.0/511.0),
+ (1.0/512.0) * (1024.0/1023.0), (1.0/1024.0) * (2048.0/2047.0),
+ (1.0/2048.0) * (4096.0/4095.0), (1.0/4096.0) * (8192.0/8191.0),
+ (1.0/8192.0) * (16384.0/16383.0), (1.0/16384.0) * (32768.0/32767.0)
+};
+
+static const REAL offsettable[15] =
+{
+ 0.0,
+ ((1.0/2.0)-1.0) * (4.0/3.0), ((1.0/4.0)-1.0) * (8.0/7.0),
+ ((1.0/8.0)-1.0) * (16.0/15.0), ((1.0/16.0)-1.0) * (32.0/31.0),
+ ((1.0/32.0)-1.0) * (64.0/63.0), ((1.0/64.0)-1.0) * (128.0/127.0),
+ ((1.0/128.0)-1.0) * (256.0/255.0), ((1.0/256.0)-1.0) * (512.0/511.0),
+ ((1.0/512.0)-1.0) * (1024.0/1023.0), ((1.0/1024.0)-1.0) * (2048.0/2047.0),
+ ((1.0/2048.0)-1.0) * (4096.0/4095.0), ((1.0/4096.0)-1.0) * (8192.0/8191.0),
+ ((1.0/8192.0)-1.0) * (16384.0/16383.0), ((1.0/16384.0)-1.0) * (32768.0/32767.0)
+};
+
+// Mpeg layer 1
+void Mpegtoraw::extractlayer1(void)
+{
+ REAL fraction[MAXCHANNEL][MAXSUBBAND];
+ REAL scalefactor[MAXCHANNEL][MAXSUBBAND];
+
+ int bitalloc[MAXCHANNEL][MAXSUBBAND],
+ sample[MAXCHANNEL][MAXSUBBAND];
+
+ register int i,j;
+ int s=stereobound,l;
+
+
+// Bitalloc
+ for(i=0;i<s;i++)
+ {
+ bitalloc[LS][i]=getbits(4);
+ bitalloc[RS][i]=getbits(4);
+ }
+ for(;i<MAXSUBBAND;i++)
+ bitalloc[LS][i]=
+ bitalloc[RS][i]=getbits(4);
+
+// Scale index
+ if(inputstereo)
+ for(i=0;i<MAXSUBBAND;i++)
+ {
+ if(bitalloc[LS][i])scalefactor[LS][i]=scalefactorstable[getbits(6)];
+ if(bitalloc[RS][i])scalefactor[RS][i]=scalefactorstable[getbits(6)];
+ }
+ else
+ for(i=0;i<MAXSUBBAND;i++)
+ if(bitalloc[LS][i])scalefactor[LS][i]=scalefactorstable[getbits(6)];
+
+ for(l=0;l<SCALEBLOCK;l++)
+ {
+ // Sample
+ for(i=0;i<s;i++)
+ {
+ if((j=bitalloc[LS][i]))sample[LS][i]=getbits(j+1);
+ if((j=bitalloc[RS][i]))sample[RS][i]=getbits(j+1);
+ }
+ for(;i<MAXSUBBAND;i++)
+ if((j=bitalloc[LS][i]))sample[LS][i]=sample[RS][i]=getbits(j+1);
+
+
+ // Fraction
+ if(outputstereo)
+ for(i=0;i<MAXSUBBAND;i++)
+ {
+ if((j=bitalloc[LS][i]))
+ fraction[LS][i]=(REAL(sample[LS][i])*factortable[j]+offsettable[j])
+ *scalefactor[LS][i];
+ else fraction[LS][i]=0.0;
+ if((j=bitalloc[RS][i]))
+ fraction[RS][i]=(REAL(sample[RS][i])*factortable[j]+offsettable[j])
+ *scalefactor[RS][i];
+ else fraction[RS][i]=0.0;
+ }
+ else
+ for(i=0;i<MAXSUBBAND;i++)
+ if((j=bitalloc[LS][i]))
+ fraction[LS][i]=(REAL(sample[LS][i])*factortable[j]+offsettable[j])
+ *scalefactor[LS][i];
+ else fraction[LS][i]=0.0;
+
+ subbandsynthesis(fraction[LS],fraction[RS]);
+ }
+}
diff --git a/setedit/mp3/mpegsound/mpglayr2.cc b/setedit/mp3/mpegsound/mpglayr2.cc
new file mode 100644
index 0000000..a4f5316
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpglayr2.cc
@@ -0,0 +1,754 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Mpeglayer2.cc
+// It's for MPEG Layer 2
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+#define MAXTABLE 2
+
+// Tables for layer 2
+static const int bitalloclengthtable[MAXTABLE][MAXSUBBAND]=
+{{4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
+ {4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3, 3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2}};
+
+static const REAL group5bits[27*3]=
+{
+ -2.0/3.0, -2.0/3.0, -2.0/3.0,
+ 0.0, -2.0/3.0, -2.0/3.0,
+ 2.0/3.0, -2.0/3.0, -2.0/3.0,
+ -2.0/3.0, 0.0, -2.0/3.0,
+ 0.0, 0.0, -2.0/3.0,
+ 2.0/3.0, 0.0, -2.0/3.0,
+ -2.0/3.0, 2.0/3.0, -2.0/3.0,
+ 0.0, 2.0/3.0, -2.0/3.0,
+ 2.0/3.0, 2.0/3.0, -2.0/3.0,
+ -2.0/3.0, -2.0/3.0, 0.0,
+ 0.0, -2.0/3.0, 0.0,
+ 2.0/3.0, -2.0/3.0, 0.0,
+ -2.0/3.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 2.0/3.0, 0.0, 0.0,
+ -2.0/3.0, 2.0/3.0, 0.0,
+ 0.0, 2.0/3.0, 0.0,
+ 2.0/3.0, 2.0/3.0, 0.0,
+ -2.0/3.0, -2.0/3.0, 2.0/3.0,
+ 0.0, -2.0/3.0, 2.0/3.0,
+ 2.0/3.0, -2.0/3.0, 2.0/3.0,
+ -2.0/3.0, 0.0, 2.0/3.0,
+ 0.0, 0.0, 2.0/3.0,
+ 2.0/3.0, 0.0, 2.0/3.0,
+ -2.0/3.0, 2.0/3.0, 2.0/3.0,
+ 0.0, 2.0/3.0, 2.0/3.0,
+ 2.0/3.0, 2.0/3.0, 2.0/3.0
+};
+
+static const REAL group7bits[125*3]=
+{
+ -0.8,-0.8,-0.8, -0.4,-0.8,-0.8, 0.0,-0.8,-0.8, 0.4,-0.8,-0.8, 0.8,-0.8,-0.8,
+ -0.8,-0.4,-0.8, -0.4,-0.4,-0.8, 0.0,-0.4,-0.8, 0.4,-0.4,-0.8, 0.8,-0.4,-0.8,
+ -0.8, 0.0,-0.8, -0.4, 0.0,-0.8, 0.0, 0.0,-0.8, 0.4, 0.0,-0.8, 0.8, 0.0,-0.8,
+ -0.8, 0.4,-0.8, -0.4, 0.4,-0.8, 0.0, 0.4,-0.8, 0.4, 0.4,-0.8, 0.8, 0.4,-0.8,
+ -0.8, 0.8,-0.8, -0.4, 0.8,-0.8, 0.0, 0.8,-0.8, 0.4, 0.8,-0.8, 0.8, 0.8,-0.8,
+ -0.8,-0.8,-0.4, -0.4,-0.8,-0.4, 0.0,-0.8,-0.4, 0.4,-0.8,-0.4, 0.8,-0.8,-0.4,
+ -0.8,-0.4,-0.4, -0.4,-0.4,-0.4, 0.0,-0.4,-0.4, 0.4,-0.4,-0.4, 0.8,-0.4,-0.4,
+ -0.8, 0.0,-0.4, -0.4, 0.0,-0.4, 0.0, 0.0,-0.4, 0.4, 0.0,-0.4, 0.8, 0.0,-0.4,
+ -0.8, 0.4,-0.4, -0.4, 0.4,-0.4, 0.0, 0.4,-0.4, 0.4, 0.4,-0.4, 0.8, 0.4,-0.4,
+ -0.8, 0.8,-0.4, -0.4, 0.8,-0.4, 0.0, 0.8,-0.4, 0.4, 0.8,-0.4, 0.8, 0.8,-0.4,
+ -0.8,-0.8, 0.0, -0.4,-0.8, 0.0, 0.0,-0.8, 0.0, 0.4,-0.8, 0.0, 0.8,-0.8, 0.0,
+ -0.8,-0.4, 0.0, -0.4,-0.4, 0.0, 0.0,-0.4, 0.0, 0.4,-0.4, 0.0, 0.8,-0.4, 0.0,
+ -0.8, 0.0, 0.0, -0.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 0.0, 0.0, 0.8, 0.0, 0.0,
+ -0.8, 0.4, 0.0, -0.4, 0.4, 0.0, 0.0, 0.4, 0.0, 0.4, 0.4, 0.0, 0.8, 0.4, 0.0,
+ -0.8, 0.8, 0.0, -0.4, 0.8, 0.0, 0.0, 0.8, 0.0, 0.4, 0.8, 0.0, 0.8, 0.8, 0.0,
+ -0.8,-0.8, 0.4, -0.4,-0.8, 0.4, 0.0,-0.8, 0.4, 0.4,-0.8, 0.4, 0.8,-0.8, 0.4,
+ -0.8,-0.4, 0.4, -0.4,-0.4, 0.4, 0.0,-0.4, 0.4, 0.4,-0.4, 0.4, 0.8,-0.4, 0.4,
+ -0.8, 0.0, 0.4, -0.4, 0.0, 0.4, 0.0, 0.0, 0.4, 0.4, 0.0, 0.4, 0.8, 0.0, 0.4,
+ -0.8, 0.4, 0.4, -0.4, 0.4, 0.4, 0.0, 0.4, 0.4, 0.4, 0.4, 0.4, 0.8, 0.4, 0.4,
+ -0.8, 0.8, 0.4, -0.4, 0.8, 0.4, 0.0, 0.8, 0.4, 0.4, 0.8, 0.4, 0.8, 0.8, 0.4,
+ -0.8,-0.8, 0.8, -0.4,-0.8, 0.8, 0.0,-0.8, 0.8, 0.4,-0.8, 0.8, 0.8,-0.8, 0.8,
+ -0.8,-0.4, 0.8, -0.4,-0.4, 0.8, 0.0,-0.4, 0.8, 0.4,-0.4, 0.8, 0.8,-0.4, 0.8,
+ -0.8, 0.0, 0.8, -0.4, 0.0, 0.8, 0.0, 0.0, 0.8, 0.4, 0.0, 0.8, 0.8, 0.0, 0.8,
+ -0.8, 0.4, 0.8, -0.4, 0.4, 0.8, 0.0, 0.4, 0.8, 0.4, 0.4, 0.8, 0.8, 0.4, 0.8,
+ -0.8, 0.8, 0.8, -0.4, 0.8, 0.8, 0.0, 0.8, 0.8, 0.4, 0.8, 0.8, 0.8, 0.8, 0.8
+};
+
+static const REAL group10bits[729*3]=
+{
+ -8.0/9.0,-8.0/9.0,-8.0/9.0, -6.0/9.0,-8.0/9.0,-8.0/9.0, -4.0/9.0,-8.0/9.0,-8.0/9.0,
+ -2.0/9.0,-8.0/9.0,-8.0/9.0, 0.0,-8.0/9.0,-8.0/9.0, 2.0/9.0,-8.0/9.0,-8.0/9.0,
+ 4.0/9.0,-8.0/9.0,-8.0/9.0, 6.0/9.0,-8.0/9.0,-8.0/9.0, 8.0/9.0,-8.0/9.0,-8.0/9.0,
+ -8.0/9.0,-6.0/9.0,-8.0/9.0, -6.0/9.0,-6.0/9.0,-8.0/9.0, -4.0/9.0,-6.0/9.0,-8.0/9.0,
+ -2.0/9.0,-6.0/9.0,-8.0/9.0, 0.0,-6.0/9.0,-8.0/9.0, 2.0/9.0,-6.0/9.0,-8.0/9.0,
+ 4.0/9.0,-6.0/9.0,-8.0/9.0, 6.0/9.0,-6.0/9.0,-8.0/9.0, 8.0/9.0,-6.0/9.0,-8.0/9.0,
+ -8.0/9.0,-4.0/9.0,-8.0/9.0, -6.0/9.0,-4.0/9.0,-8.0/9.0, -4.0/9.0,-4.0/9.0,-8.0/9.0,
+ -2.0/9.0,-4.0/9.0,-8.0/9.0, 0.0,-4.0/9.0,-8.0/9.0, 2.0/9.0,-4.0/9.0,-8.0/9.0,
+ 4.0/9.0,-4.0/9.0,-8.0/9.0, 6.0/9.0,-4.0/9.0,-8.0/9.0, 8.0/9.0,-4.0/9.0,-8.0/9.0,
+ -8.0/9.0,-2.0/9.0,-8.0/9.0, -6.0/9.0,-2.0/9.0,-8.0/9.0, -4.0/9.0,-2.0/9.0,-8.0/9.0,
+ -2.0/9.0,-2.0/9.0,-8.0/9.0, 0.0,-2.0/9.0,-8.0/9.0, 2.0/9.0,-2.0/9.0,-8.0/9.0,
+ 4.0/9.0,-2.0/9.0,-8.0/9.0, 6.0/9.0,-2.0/9.0,-8.0/9.0, 8.0/9.0,-2.0/9.0,-8.0/9.0,
+ -8.0/9.0, 0.0,-8.0/9.0, -6.0/9.0, 0.0,-8.0/9.0, -4.0/9.0, 0.0,-8.0/9.0,
+ -2.0/9.0, 0.0,-8.0/9.0, 0.0, 0.0,-8.0/9.0, 2.0/9.0, 0.0,-8.0/9.0,
+ 4.0/9.0, 0.0,-8.0/9.0, 6.0/9.0, 0.0,-8.0/9.0, 8.0/9.0, 0.0,-8.0/9.0,
+ -8.0/9.0, 2.0/9.0,-8.0/9.0, -6.0/9.0, 2.0/9.0,-8.0/9.0, -4.0/9.0, 2.0/9.0,-8.0/9.0,
+ -2.0/9.0, 2.0/9.0,-8.0/9.0, 0.0, 2.0/9.0,-8.0/9.0, 2.0/9.0, 2.0/9.0,-8.0/9.0,
+ 4.0/9.0, 2.0/9.0,-8.0/9.0, 6.0/9.0, 2.0/9.0,-8.0/9.0, 8.0/9.0, 2.0/9.0,-8.0/9.0,
+ -8.0/9.0, 4.0/9.0,-8.0/9.0, -6.0/9.0, 4.0/9.0,-8.0/9.0, -4.0/9.0, 4.0/9.0,-8.0/9.0,
+ -2.0/9.0, 4.0/9.0,-8.0/9.0, 0.0, 4.0/9.0,-8.0/9.0, 2.0/9.0, 4.0/9.0,-8.0/9.0,
+ 4.0/9.0, 4.0/9.0,-8.0/9.0, 6.0/9.0, 4.0/9.0,-8.0/9.0, 8.0/9.0, 4.0/9.0,-8.0/9.0,
+ -8.0/9.0, 6.0/9.0,-8.0/9.0, -6.0/9.0, 6.0/9.0,-8.0/9.0, -4.0/9.0, 6.0/9.0,-8.0/9.0,
+ -2.0/9.0, 6.0/9.0,-8.0/9.0, 0.0, 6.0/9.0,-8.0/9.0, 2.0/9.0, 6.0/9.0,-8.0/9.0,
+ 4.0/9.0, 6.0/9.0,-8.0/9.0, 6.0/9.0, 6.0/9.0,-8.0/9.0, 8.0/9.0, 6.0/9.0,-8.0/9.0,
+ -8.0/9.0, 8.0/9.0,-8.0/9.0, -6.0/9.0, 8.0/9.0,-8.0/9.0, -4.0/9.0, 8.0/9.0,-8.0/9.0,
+ -2.0/9.0, 8.0/9.0,-8.0/9.0, 0.0, 8.0/9.0,-8.0/9.0, 2.0/9.0, 8.0/9.0,-8.0/9.0,
+ 4.0/9.0, 8.0/9.0,-8.0/9.0, 6.0/9.0, 8.0/9.0,-8.0/9.0, 8.0/9.0, 8.0/9.0,-8.0/9.0,
+ -8.0/9.0,-8.0/9.0,-6.0/9.0, -6.0/9.0,-8.0/9.0,-6.0/9.0, -4.0/9.0,-8.0/9.0,-6.0/9.0,
+ -2.0/9.0,-8.0/9.0,-6.0/9.0, 0.0,-8.0/9.0,-6.0/9.0, 2.0/9.0,-8.0/9.0,-6.0/9.0,
+ 4.0/9.0,-8.0/9.0,-6.0/9.0, 6.0/9.0,-8.0/9.0,-6.0/9.0, 8.0/9.0,-8.0/9.0,-6.0/9.0,
+ -8.0/9.0,-6.0/9.0,-6.0/9.0, -6.0/9.0,-6.0/9.0,-6.0/9.0, -4.0/9.0,-6.0/9.0,-6.0/9.0,
+ -2.0/9.0,-6.0/9.0,-6.0/9.0, 0.0,-6.0/9.0,-6.0/9.0, 2.0/9.0,-6.0/9.0,-6.0/9.0,
+ 4.0/9.0,-6.0/9.0,-6.0/9.0, 6.0/9.0,-6.0/9.0,-6.0/9.0, 8.0/9.0,-6.0/9.0,-6.0/9.0,
+ -8.0/9.0,-4.0/9.0,-6.0/9.0, -6.0/9.0,-4.0/9.0,-6.0/9.0, -4.0/9.0,-4.0/9.0,-6.0/9.0,
+ -2.0/9.0,-4.0/9.0,-6.0/9.0, 0.0,-4.0/9.0,-6.0/9.0, 2.0/9.0,-4.0/9.0,-6.0/9.0,
+ 4.0/9.0,-4.0/9.0,-6.0/9.0, 6.0/9.0,-4.0/9.0,-6.0/9.0, 8.0/9.0,-4.0/9.0,-6.0/9.0,
+ -8.0/9.0,-2.0/9.0,-6.0/9.0, -6.0/9.0,-2.0/9.0,-6.0/9.0, -4.0/9.0,-2.0/9.0,-6.0/9.0,
+ -2.0/9.0,-2.0/9.0,-6.0/9.0, 0.0,-2.0/9.0,-6.0/9.0, 2.0/9.0,-2.0/9.0,-6.0/9.0,
+ 4.0/9.0,-2.0/9.0,-6.0/9.0, 6.0/9.0,-2.0/9.0,-6.0/9.0, 8.0/9.0,-2.0/9.0,-6.0/9.0,
+ -8.0/9.0, 0.0,-6.0/9.0, -6.0/9.0, 0.0,-6.0/9.0, -4.0/9.0, 0.0,-6.0/9.0,
+ -2.0/9.0, 0.0,-6.0/9.0, 0.0, 0.0,-6.0/9.0, 2.0/9.0, 0.0,-6.0/9.0,
+ 4.0/9.0, 0.0,-6.0/9.0, 6.0/9.0, 0.0,-6.0/9.0, 8.0/9.0, 0.0,-6.0/9.0,
+ -8.0/9.0, 2.0/9.0,-6.0/9.0, -6.0/9.0, 2.0/9.0,-6.0/9.0, -4.0/9.0, 2.0/9.0,-6.0/9.0,
+ -2.0/9.0, 2.0/9.0,-6.0/9.0, 0.0, 2.0/9.0,-6.0/9.0, 2.0/9.0, 2.0/9.0,-6.0/9.0,
+ 4.0/9.0, 2.0/9.0,-6.0/9.0, 6.0/9.0, 2.0/9.0,-6.0/9.0, 8.0/9.0, 2.0/9.0,-6.0/9.0,
+ -8.0/9.0, 4.0/9.0,-6.0/9.0, -6.0/9.0, 4.0/9.0,-6.0/9.0, -4.0/9.0, 4.0/9.0,-6.0/9.0,
+ -2.0/9.0, 4.0/9.0,-6.0/9.0, 0.0, 4.0/9.0,-6.0/9.0, 2.0/9.0, 4.0/9.0,-6.0/9.0,
+ 4.0/9.0, 4.0/9.0,-6.0/9.0, 6.0/9.0, 4.0/9.0,-6.0/9.0, 8.0/9.0, 4.0/9.0,-6.0/9.0,
+ -8.0/9.0, 6.0/9.0,-6.0/9.0, -6.0/9.0, 6.0/9.0,-6.0/9.0, -4.0/9.0, 6.0/9.0,-6.0/9.0,
+ -2.0/9.0, 6.0/9.0,-6.0/9.0, 0.0, 6.0/9.0,-6.0/9.0, 2.0/9.0, 6.0/9.0,-6.0/9.0,
+ 4.0/9.0, 6.0/9.0,-6.0/9.0, 6.0/9.0, 6.0/9.0,-6.0/9.0, 8.0/9.0, 6.0/9.0,-6.0/9.0,
+ -8.0/9.0, 8.0/9.0,-6.0/9.0, -6.0/9.0, 8.0/9.0,-6.0/9.0, -4.0/9.0, 8.0/9.0,-6.0/9.0,
+ -2.0/9.0, 8.0/9.0,-6.0/9.0, 0.0, 8.0/9.0,-6.0/9.0, 2.0/9.0, 8.0/9.0,-6.0/9.0,
+ 4.0/9.0, 8.0/9.0,-6.0/9.0, 6.0/9.0, 8.0/9.0,-6.0/9.0, 8.0/9.0, 8.0/9.0,-6.0/9.0,
+ -8.0/9.0,-8.0/9.0,-4.0/9.0, -6.0/9.0,-8.0/9.0,-4.0/9.0, -4.0/9.0,-8.0/9.0,-4.0/9.0,
+ -2.0/9.0,-8.0/9.0,-4.0/9.0, 0.0,-8.0/9.0,-4.0/9.0, 2.0/9.0,-8.0/9.0,-4.0/9.0,
+ 4.0/9.0,-8.0/9.0,-4.0/9.0, 6.0/9.0,-8.0/9.0,-4.0/9.0, 8.0/9.0,-8.0/9.0,-4.0/9.0,
+ -8.0/9.0,-6.0/9.0,-4.0/9.0, -6.0/9.0,-6.0/9.0,-4.0/9.0, -4.0/9.0,-6.0/9.0,-4.0/9.0,
+ -2.0/9.0,-6.0/9.0,-4.0/9.0, 0.0,-6.0/9.0,-4.0/9.0, 2.0/9.0,-6.0/9.0,-4.0/9.0,
+ 4.0/9.0,-6.0/9.0,-4.0/9.0, 6.0/9.0,-6.0/9.0,-4.0/9.0, 8.0/9.0,-6.0/9.0,-4.0/9.0,
+ -8.0/9.0,-4.0/9.0,-4.0/9.0, -6.0/9.0,-4.0/9.0,-4.0/9.0, -4.0/9.0,-4.0/9.0,-4.0/9.0,
+ -2.0/9.0,-4.0/9.0,-4.0/9.0, 0.0,-4.0/9.0,-4.0/9.0, 2.0/9.0,-4.0/9.0,-4.0/9.0,
+ 4.0/9.0,-4.0/9.0,-4.0/9.0, 6.0/9.0,-4.0/9.0,-4.0/9.0, 8.0/9.0,-4.0/9.0,-4.0/9.0,
+ -8.0/9.0,-2.0/9.0,-4.0/9.0, -6.0/9.0,-2.0/9.0,-4.0/9.0, -4.0/9.0,-2.0/9.0,-4.0/9.0,
+ -2.0/9.0,-2.0/9.0,-4.0/9.0, 0.0,-2.0/9.0,-4.0/9.0, 2.0/9.0,-2.0/9.0,-4.0/9.0,
+ 4.0/9.0,-2.0/9.0,-4.0/9.0, 6.0/9.0,-2.0/9.0,-4.0/9.0, 8.0/9.0,-2.0/9.0,-4.0/9.0,
+ -8.0/9.0, 0.0,-4.0/9.0, -6.0/9.0, 0.0,-4.0/9.0, -4.0/9.0, 0.0,-4.0/9.0,
+ -2.0/9.0, 0.0,-4.0/9.0, 0.0, 0.0,-4.0/9.0, 2.0/9.0, 0.0,-4.0/9.0,
+ 4.0/9.0, 0.0,-4.0/9.0, 6.0/9.0, 0.0,-4.0/9.0, 8.0/9.0, 0.0,-4.0/9.0,
+ -8.0/9.0, 2.0/9.0,-4.0/9.0, -6.0/9.0, 2.0/9.0,-4.0/9.0, -4.0/9.0, 2.0/9.0,-4.0/9.0,
+ -2.0/9.0, 2.0/9.0,-4.0/9.0, 0.0, 2.0/9.0,-4.0/9.0, 2.0/9.0, 2.0/9.0,-4.0/9.0,
+ 4.0/9.0, 2.0/9.0,-4.0/9.0, 6.0/9.0, 2.0/9.0,-4.0/9.0, 8.0/9.0, 2.0/9.0,-4.0/9.0,
+ -8.0/9.0, 4.0/9.0,-4.0/9.0, -6.0/9.0, 4.0/9.0,-4.0/9.0, -4.0/9.0, 4.0/9.0,-4.0/9.0,
+ -2.0/9.0, 4.0/9.0,-4.0/9.0, 0.0, 4.0/9.0,-4.0/9.0, 2.0/9.0, 4.0/9.0,-4.0/9.0,
+ 4.0/9.0, 4.0/9.0,-4.0/9.0, 6.0/9.0, 4.0/9.0,-4.0/9.0, 8.0/9.0, 4.0/9.0,-4.0/9.0,
+ -8.0/9.0, 6.0/9.0,-4.0/9.0, -6.0/9.0, 6.0/9.0,-4.0/9.0, -4.0/9.0, 6.0/9.0,-4.0/9.0,
+ -2.0/9.0, 6.0/9.0,-4.0/9.0, 0.0, 6.0/9.0,-4.0/9.0, 2.0/9.0, 6.0/9.0,-4.0/9.0,
+ 4.0/9.0, 6.0/9.0,-4.0/9.0, 6.0/9.0, 6.0/9.0,-4.0/9.0, 8.0/9.0, 6.0/9.0,-4.0/9.0,
+ -8.0/9.0, 8.0/9.0,-4.0/9.0, -6.0/9.0, 8.0/9.0,-4.0/9.0, -4.0/9.0, 8.0/9.0,-4.0/9.0,
+ -2.0/9.0, 8.0/9.0,-4.0/9.0, 0.0, 8.0/9.0,-4.0/9.0, 2.0/9.0, 8.0/9.0,-4.0/9.0,
+ 4.0/9.0, 8.0/9.0,-4.0/9.0, 6.0/9.0, 8.0/9.0,-4.0/9.0, 8.0/9.0, 8.0/9.0,-4.0/9.0,
+ -8.0/9.0,-8.0/9.0,-2.0/9.0, -6.0/9.0,-8.0/9.0,-2.0/9.0, -4.0/9.0,-8.0/9.0,-2.0/9.0,
+ -2.0/9.0,-8.0/9.0,-2.0/9.0, 0.0,-8.0/9.0,-2.0/9.0, 2.0/9.0,-8.0/9.0,-2.0/9.0,
+ 4.0/9.0,-8.0/9.0,-2.0/9.0, 6.0/9.0,-8.0/9.0,-2.0/9.0, 8.0/9.0,-8.0/9.0,-2.0/9.0,
+ -8.0/9.0,-6.0/9.0,-2.0/9.0, -6.0/9.0,-6.0/9.0,-2.0/9.0, -4.0/9.0,-6.0/9.0,-2.0/9.0,
+ -2.0/9.0,-6.0/9.0,-2.0/9.0, 0.0,-6.0/9.0,-2.0/9.0, 2.0/9.0,-6.0/9.0,-2.0/9.0,
+ 4.0/9.0,-6.0/9.0,-2.0/9.0, 6.0/9.0,-6.0/9.0,-2.0/9.0, 8.0/9.0,-6.0/9.0,-2.0/9.0,
+ -8.0/9.0,-4.0/9.0,-2.0/9.0, -6.0/9.0,-4.0/9.0,-2.0/9.0, -4.0/9.0,-4.0/9.0,-2.0/9.0,
+ -2.0/9.0,-4.0/9.0,-2.0/9.0, 0.0,-4.0/9.0,-2.0/9.0, 2.0/9.0,-4.0/9.0,-2.0/9.0,
+ 4.0/9.0,-4.0/9.0,-2.0/9.0, 6.0/9.0,-4.0/9.0,-2.0/9.0, 8.0/9.0,-4.0/9.0,-2.0/9.0,
+ -8.0/9.0,-2.0/9.0,-2.0/9.0, -6.0/9.0,-2.0/9.0,-2.0/9.0, -4.0/9.0,-2.0/9.0,-2.0/9.0,
+ -2.0/9.0,-2.0/9.0,-2.0/9.0, 0.0,-2.0/9.0,-2.0/9.0, 2.0/9.0,-2.0/9.0,-2.0/9.0,
+ 4.0/9.0,-2.0/9.0,-2.0/9.0, 6.0/9.0,-2.0/9.0,-2.0/9.0, 8.0/9.0,-2.0/9.0,-2.0/9.0,
+ -8.0/9.0, 0.0,-2.0/9.0, -6.0/9.0, 0.0,-2.0/9.0, -4.0/9.0, 0.0,-2.0/9.0,
+ -2.0/9.0, 0.0,-2.0/9.0, 0.0, 0.0,-2.0/9.0, 2.0/9.0, 0.0,-2.0/9.0,
+ 4.0/9.0, 0.0,-2.0/9.0, 6.0/9.0, 0.0,-2.0/9.0, 8.0/9.0, 0.0,-2.0/9.0,
+ -8.0/9.0, 2.0/9.0,-2.0/9.0, -6.0/9.0, 2.0/9.0,-2.0/9.0, -4.0/9.0, 2.0/9.0,-2.0/9.0,
+ -2.0/9.0, 2.0/9.0,-2.0/9.0, 0.0, 2.0/9.0,-2.0/9.0, 2.0/9.0, 2.0/9.0,-2.0/9.0,
+ 4.0/9.0, 2.0/9.0,-2.0/9.0, 6.0/9.0, 2.0/9.0,-2.0/9.0, 8.0/9.0, 2.0/9.0,-2.0/9.0,
+ -8.0/9.0, 4.0/9.0,-2.0/9.0, -6.0/9.0, 4.0/9.0,-2.0/9.0, -4.0/9.0, 4.0/9.0,-2.0/9.0,
+ -2.0/9.0, 4.0/9.0,-2.0/9.0, 0.0, 4.0/9.0,-2.0/9.0, 2.0/9.0, 4.0/9.0,-2.0/9.0,
+ 4.0/9.0, 4.0/9.0,-2.0/9.0, 6.0/9.0, 4.0/9.0,-2.0/9.0, 8.0/9.0, 4.0/9.0,-2.0/9.0,
+ -8.0/9.0, 6.0/9.0,-2.0/9.0, -6.0/9.0, 6.0/9.0,-2.0/9.0, -4.0/9.0, 6.0/9.0,-2.0/9.0,
+ -2.0/9.0, 6.0/9.0,-2.0/9.0, 0.0, 6.0/9.0,-2.0/9.0, 2.0/9.0, 6.0/9.0,-2.0/9.0,
+ 4.0/9.0, 6.0/9.0,-2.0/9.0, 6.0/9.0, 6.0/9.0,-2.0/9.0, 8.0/9.0, 6.0/9.0,-2.0/9.0,
+ -8.0/9.0, 8.0/9.0,-2.0/9.0, -6.0/9.0, 8.0/9.0,-2.0/9.0, -4.0/9.0, 8.0/9.0,-2.0/9.0,
+ -2.0/9.0, 8.0/9.0,-2.0/9.0, 0.0, 8.0/9.0,-2.0/9.0, 2.0/9.0, 8.0/9.0,-2.0/9.0,
+ 4.0/9.0, 8.0/9.0,-2.0/9.0, 6.0/9.0, 8.0/9.0,-2.0/9.0, 8.0/9.0, 8.0/9.0,-2.0/9.0,
+ -8.0/9.0,-8.0/9.0, 0.0, -6.0/9.0,-8.0/9.0, 0.0, -4.0/9.0,-8.0/9.0, 0.0,
+ -2.0/9.0,-8.0/9.0, 0.0, 0.0,-8.0/9.0, 0.0, 2.0/9.0,-8.0/9.0, 0.0,
+ 4.0/9.0,-8.0/9.0, 0.0, 6.0/9.0,-8.0/9.0, 0.0, 8.0/9.0,-8.0/9.0, 0.0,
+ -8.0/9.0,-6.0/9.0, 0.0, -6.0/9.0,-6.0/9.0, 0.0, -4.0/9.0,-6.0/9.0, 0.0,
+ -2.0/9.0,-6.0/9.0, 0.0, 0.0,-6.0/9.0, 0.0, 2.0/9.0,-6.0/9.0, 0.0,
+ 4.0/9.0,-6.0/9.0, 0.0, 6.0/9.0,-6.0/9.0, 0.0, 8.0/9.0,-6.0/9.0, 0.0,
+ -8.0/9.0,-4.0/9.0, 0.0, -6.0/9.0,-4.0/9.0, 0.0, -4.0/9.0,-4.0/9.0, 0.0,
+ -2.0/9.0,-4.0/9.0, 0.0, 0.0,-4.0/9.0, 0.0, 2.0/9.0,-4.0/9.0, 0.0,
+ 4.0/9.0,-4.0/9.0, 0.0, 6.0/9.0,-4.0/9.0, 0.0, 8.0/9.0,-4.0/9.0, 0.0,
+ -8.0/9.0,-2.0/9.0, 0.0, -6.0/9.0,-2.0/9.0, 0.0, -4.0/9.0,-2.0/9.0, 0.0,
+ -2.0/9.0,-2.0/9.0, 0.0, 0.0,-2.0/9.0, 0.0, 2.0/9.0,-2.0/9.0, 0.0,
+ 4.0/9.0,-2.0/9.0, 0.0, 6.0/9.0,-2.0/9.0, 0.0, 8.0/9.0,-2.0/9.0, 0.0,
+ -8.0/9.0, 0.0, 0.0, -6.0/9.0, 0.0, 0.0, -4.0/9.0, 0.0, 0.0,
+ -2.0/9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0/9.0, 0.0, 0.0,
+ 4.0/9.0, 0.0, 0.0, 6.0/9.0, 0.0, 0.0, 8.0/9.0, 0.0, 0.0,
+ -8.0/9.0, 2.0/9.0, 0.0, -6.0/9.0, 2.0/9.0, 0.0, -4.0/9.0, 2.0/9.0, 0.0,
+ -2.0/9.0, 2.0/9.0, 0.0, 0.0, 2.0/9.0, 0.0, 2.0/9.0, 2.0/9.0, 0.0,
+ 4.0/9.0, 2.0/9.0, 0.0, 6.0/9.0, 2.0/9.0, 0.0, 8.0/9.0, 2.0/9.0, 0.0,
+ -8.0/9.0, 4.0/9.0, 0.0, -6.0/9.0, 4.0/9.0, 0.0, -4.0/9.0, 4.0/9.0, 0.0,
+ -2.0/9.0, 4.0/9.0, 0.0, 0.0, 4.0/9.0, 0.0, 2.0/9.0, 4.0/9.0, 0.0,
+ 4.0/9.0, 4.0/9.0, 0.0, 6.0/9.0, 4.0/9.0, 0.0, 8.0/9.0, 4.0/9.0, 0.0,
+ -8.0/9.0, 6.0/9.0, 0.0, -6.0/9.0, 6.0/9.0, 0.0, -4.0/9.0, 6.0/9.0, 0.0,
+ -2.0/9.0, 6.0/9.0, 0.0, 0.0, 6.0/9.0, 0.0, 2.0/9.0, 6.0/9.0, 0.0,
+ 4.0/9.0, 6.0/9.0, 0.0, 6.0/9.0, 6.0/9.0, 0.0, 8.0/9.0, 6.0/9.0, 0.0,
+ -8.0/9.0, 8.0/9.0, 0.0, -6.0/9.0, 8.0/9.0, 0.0, -4.0/9.0, 8.0/9.0, 0.0,
+ -2.0/9.0, 8.0/9.0, 0.0, 0.0, 8.0/9.0, 0.0, 2.0/9.0, 8.0/9.0, 0.0,
+ 4.0/9.0, 8.0/9.0, 0.0, 6.0/9.0, 8.0/9.0, 0.0, 8.0/9.0, 8.0/9.0, 0.0,
+ -8.0/9.0,-8.0/9.0, 2.0/9.0, -6.0/9.0,-8.0/9.0, 2.0/9.0, -4.0/9.0,-8.0/9.0, 2.0/9.0,
+ -2.0/9.0,-8.0/9.0, 2.0/9.0, 0.0,-8.0/9.0, 2.0/9.0, 2.0/9.0,-8.0/9.0, 2.0/9.0,
+ 4.0/9.0,-8.0/9.0, 2.0/9.0, 6.0/9.0,-8.0/9.0, 2.0/9.0, 8.0/9.0,-8.0/9.0, 2.0/9.0,
+ -8.0/9.0,-6.0/9.0, 2.0/9.0, -6.0/9.0,-6.0/9.0, 2.0/9.0, -4.0/9.0,-6.0/9.0, 2.0/9.0,
+ -2.0/9.0,-6.0/9.0, 2.0/9.0, 0.0,-6.0/9.0, 2.0/9.0, 2.0/9.0,-6.0/9.0, 2.0/9.0,
+ 4.0/9.0,-6.0/9.0, 2.0/9.0, 6.0/9.0,-6.0/9.0, 2.0/9.0, 8.0/9.0,-6.0/9.0, 2.0/9.0,
+ -8.0/9.0,-4.0/9.0, 2.0/9.0, -6.0/9.0,-4.0/9.0, 2.0/9.0, -4.0/9.0,-4.0/9.0, 2.0/9.0,
+ -2.0/9.0,-4.0/9.0, 2.0/9.0, 0.0,-4.0/9.0, 2.0/9.0, 2.0/9.0,-4.0/9.0, 2.0/9.0,
+ 4.0/9.0,-4.0/9.0, 2.0/9.0, 6.0/9.0,-4.0/9.0, 2.0/9.0, 8.0/9.0,-4.0/9.0, 2.0/9.0,
+ -8.0/9.0,-2.0/9.0, 2.0/9.0, -6.0/9.0,-2.0/9.0, 2.0/9.0, -4.0/9.0,-2.0/9.0, 2.0/9.0,
+ -2.0/9.0,-2.0/9.0, 2.0/9.0, 0.0,-2.0/9.0, 2.0/9.0, 2.0/9.0,-2.0/9.0, 2.0/9.0,
+ 4.0/9.0,-2.0/9.0, 2.0/9.0, 6.0/9.0,-2.0/9.0, 2.0/9.0, 8.0/9.0,-2.0/9.0, 2.0/9.0,
+ -8.0/9.0, 0.0, 2.0/9.0, -6.0/9.0, 0.0, 2.0/9.0, -4.0/9.0, 0.0, 2.0/9.0,
+ -2.0/9.0, 0.0, 2.0/9.0, 0.0, 0.0, 2.0/9.0, 2.0/9.0, 0.0, 2.0/9.0,
+ 4.0/9.0, 0.0, 2.0/9.0, 6.0/9.0, 0.0, 2.0/9.0, 8.0/9.0, 0.0, 2.0/9.0,
+ -8.0/9.0, 2.0/9.0, 2.0/9.0, -6.0/9.0, 2.0/9.0, 2.0/9.0, -4.0/9.0, 2.0/9.0, 2.0/9.0,
+ -2.0/9.0, 2.0/9.0, 2.0/9.0, 0.0, 2.0/9.0, 2.0/9.0, 2.0/9.0, 2.0/9.0, 2.0/9.0,
+ 4.0/9.0, 2.0/9.0, 2.0/9.0, 6.0/9.0, 2.0/9.0, 2.0/9.0, 8.0/9.0, 2.0/9.0, 2.0/9.0,
+ -8.0/9.0, 4.0/9.0, 2.0/9.0, -6.0/9.0, 4.0/9.0, 2.0/9.0, -4.0/9.0, 4.0/9.0, 2.0/9.0,
+ -2.0/9.0, 4.0/9.0, 2.0/9.0, 0.0, 4.0/9.0, 2.0/9.0, 2.0/9.0, 4.0/9.0, 2.0/9.0,
+ 4.0/9.0, 4.0/9.0, 2.0/9.0, 6.0/9.0, 4.0/9.0, 2.0/9.0, 8.0/9.0, 4.0/9.0, 2.0/9.0,
+ -8.0/9.0, 6.0/9.0, 2.0/9.0, -6.0/9.0, 6.0/9.0, 2.0/9.0, -4.0/9.0, 6.0/9.0, 2.0/9.0,
+ -2.0/9.0, 6.0/9.0, 2.0/9.0, 0.0, 6.0/9.0, 2.0/9.0, 2.0/9.0, 6.0/9.0, 2.0/9.0,
+ 4.0/9.0, 6.0/9.0, 2.0/9.0, 6.0/9.0, 6.0/9.0, 2.0/9.0, 8.0/9.0, 6.0/9.0, 2.0/9.0,
+ -8.0/9.0, 8.0/9.0, 2.0/9.0, -6.0/9.0, 8.0/9.0, 2.0/9.0, -4.0/9.0, 8.0/9.0, 2.0/9.0,
+ -2.0/9.0, 8.0/9.0, 2.0/9.0, 0.0, 8.0/9.0, 2.0/9.0, 2.0/9.0, 8.0/9.0, 2.0/9.0,
+ 4.0/9.0, 8.0/9.0, 2.0/9.0, 6.0/9.0, 8.0/9.0, 2.0/9.0, 8.0/9.0, 8.0/9.0, 2.0/9.0,
+ -8.0/9.0,-8.0/9.0, 4.0/9.0, -6.0/9.0,-8.0/9.0, 4.0/9.0, -4.0/9.0,-8.0/9.0, 4.0/9.0,
+ -2.0/9.0,-8.0/9.0, 4.0/9.0, 0.0,-8.0/9.0, 4.0/9.0, 2.0/9.0,-8.0/9.0, 4.0/9.0,
+ 4.0/9.0,-8.0/9.0, 4.0/9.0, 6.0/9.0,-8.0/9.0, 4.0/9.0, 8.0/9.0,-8.0/9.0, 4.0/9.0,
+ -8.0/9.0,-6.0/9.0, 4.0/9.0, -6.0/9.0,-6.0/9.0, 4.0/9.0, -4.0/9.0,-6.0/9.0, 4.0/9.0,
+ -2.0/9.0,-6.0/9.0, 4.0/9.0, 0.0,-6.0/9.0, 4.0/9.0, 2.0/9.0,-6.0/9.0, 4.0/9.0,
+ 4.0/9.0,-6.0/9.0, 4.0/9.0, 6.0/9.0,-6.0/9.0, 4.0/9.0, 8.0/9.0,-6.0/9.0, 4.0/9.0,
+ -8.0/9.0,-4.0/9.0, 4.0/9.0, -6.0/9.0,-4.0/9.0, 4.0/9.0, -4.0/9.0,-4.0/9.0, 4.0/9.0,
+ -2.0/9.0,-4.0/9.0, 4.0/9.0, 0.0,-4.0/9.0, 4.0/9.0, 2.0/9.0,-4.0/9.0, 4.0/9.0,
+ 4.0/9.0,-4.0/9.0, 4.0/9.0, 6.0/9.0,-4.0/9.0, 4.0/9.0, 8.0/9.0,-4.0/9.0, 4.0/9.0,
+ -8.0/9.0,-2.0/9.0, 4.0/9.0, -6.0/9.0,-2.0/9.0, 4.0/9.0, -4.0/9.0,-2.0/9.0, 4.0/9.0,
+ -2.0/9.0,-2.0/9.0, 4.0/9.0, 0.0,-2.0/9.0, 4.0/9.0, 2.0/9.0,-2.0/9.0, 4.0/9.0,
+ 4.0/9.0,-2.0/9.0, 4.0/9.0, 6.0/9.0,-2.0/9.0, 4.0/9.0, 8.0/9.0,-2.0/9.0, 4.0/9.0,
+ -8.0/9.0, 0.0, 4.0/9.0, -6.0/9.0, 0.0, 4.0/9.0, -4.0/9.0, 0.0, 4.0/9.0,
+ -2.0/9.0, 0.0, 4.0/9.0, 0.0, 0.0, 4.0/9.0, 2.0/9.0, 0.0, 4.0/9.0,
+ 4.0/9.0, 0.0, 4.0/9.0, 6.0/9.0, 0.0, 4.0/9.0, 8.0/9.0, 0.0, 4.0/9.0,
+ -8.0/9.0, 2.0/9.0, 4.0/9.0, -6.0/9.0, 2.0/9.0, 4.0/9.0, -4.0/9.0, 2.0/9.0, 4.0/9.0,
+ -2.0/9.0, 2.0/9.0, 4.0/9.0, 0.0, 2.0/9.0, 4.0/9.0, 2.0/9.0, 2.0/9.0, 4.0/9.0,
+ 4.0/9.0, 2.0/9.0, 4.0/9.0, 6.0/9.0, 2.0/9.0, 4.0/9.0, 8.0/9.0, 2.0/9.0, 4.0/9.0,
+ -8.0/9.0, 4.0/9.0, 4.0/9.0, -6.0/9.0, 4.0/9.0, 4.0/9.0, -4.0/9.0, 4.0/9.0, 4.0/9.0,
+ -2.0/9.0, 4.0/9.0, 4.0/9.0, 0.0, 4.0/9.0, 4.0/9.0, 2.0/9.0, 4.0/9.0, 4.0/9.0,
+ 4.0/9.0, 4.0/9.0, 4.0/9.0, 6.0/9.0, 4.0/9.0, 4.0/9.0, 8.0/9.0, 4.0/9.0, 4.0/9.0,
+ -8.0/9.0, 6.0/9.0, 4.0/9.0, -6.0/9.0, 6.0/9.0, 4.0/9.0, -4.0/9.0, 6.0/9.0, 4.0/9.0,
+ -2.0/9.0, 6.0/9.0, 4.0/9.0, 0.0, 6.0/9.0, 4.0/9.0, 2.0/9.0, 6.0/9.0, 4.0/9.0,
+ 4.0/9.0, 6.0/9.0, 4.0/9.0, 6.0/9.0, 6.0/9.0, 4.0/9.0, 8.0/9.0, 6.0/9.0, 4.0/9.0,
+ -8.0/9.0, 8.0/9.0, 4.0/9.0, -6.0/9.0, 8.0/9.0, 4.0/9.0, -4.0/9.0, 8.0/9.0, 4.0/9.0,
+ -2.0/9.0, 8.0/9.0, 4.0/9.0, 0.0, 8.0/9.0, 4.0/9.0, 2.0/9.0, 8.0/9.0, 4.0/9.0,
+ 4.0/9.0, 8.0/9.0, 4.0/9.0, 6.0/9.0, 8.0/9.0, 4.0/9.0, 8.0/9.0, 8.0/9.0, 4.0/9.0,
+ -8.0/9.0,-8.0/9.0, 6.0/9.0, -6.0/9.0,-8.0/9.0, 6.0/9.0, -4.0/9.0,-8.0/9.0, 6.0/9.0,
+ -2.0/9.0,-8.0/9.0, 6.0/9.0, 0.0,-8.0/9.0, 6.0/9.0, 2.0/9.0,-8.0/9.0, 6.0/9.0,
+ 4.0/9.0,-8.0/9.0, 6.0/9.0, 6.0/9.0,-8.0/9.0, 6.0/9.0, 8.0/9.0,-8.0/9.0, 6.0/9.0,
+ -8.0/9.0,-6.0/9.0, 6.0/9.0, -6.0/9.0,-6.0/9.0, 6.0/9.0, -4.0/9.0,-6.0/9.0, 6.0/9.0,
+ -2.0/9.0,-6.0/9.0, 6.0/9.0, 0.0,-6.0/9.0, 6.0/9.0, 2.0/9.0,-6.0/9.0, 6.0/9.0,
+ 4.0/9.0,-6.0/9.0, 6.0/9.0, 6.0/9.0,-6.0/9.0, 6.0/9.0, 8.0/9.0,-6.0/9.0, 6.0/9.0,
+ -8.0/9.0,-4.0/9.0, 6.0/9.0, -6.0/9.0,-4.0/9.0, 6.0/9.0, -4.0/9.0,-4.0/9.0, 6.0/9.0,
+ -2.0/9.0,-4.0/9.0, 6.0/9.0, 0.0,-4.0/9.0, 6.0/9.0, 2.0/9.0,-4.0/9.0, 6.0/9.0,
+ 4.0/9.0,-4.0/9.0, 6.0/9.0, 6.0/9.0,-4.0/9.0, 6.0/9.0, 8.0/9.0,-4.0/9.0, 6.0/9.0,
+ -8.0/9.0,-2.0/9.0, 6.0/9.0, -6.0/9.0,-2.0/9.0, 6.0/9.0, -4.0/9.0,-2.0/9.0, 6.0/9.0,
+ -2.0/9.0,-2.0/9.0, 6.0/9.0, 0.0,-2.0/9.0, 6.0/9.0, 2.0/9.0,-2.0/9.0, 6.0/9.0,
+ 4.0/9.0,-2.0/9.0, 6.0/9.0, 6.0/9.0,-2.0/9.0, 6.0/9.0, 8.0/9.0,-2.0/9.0, 6.0/9.0,
+ -8.0/9.0, 0.0, 6.0/9.0, -6.0/9.0, 0.0, 6.0/9.0, -4.0/9.0, 0.0, 6.0/9.0,
+ -2.0/9.0, 0.0, 6.0/9.0, 0.0, 0.0, 6.0/9.0, 2.0/9.0, 0.0, 6.0/9.0,
+ 4.0/9.0, 0.0, 6.0/9.0, 6.0/9.0, 0.0, 6.0/9.0, 8.0/9.0, 0.0, 6.0/9.0,
+ -8.0/9.0, 2.0/9.0, 6.0/9.0, -6.0/9.0, 2.0/9.0, 6.0/9.0, -4.0/9.0, 2.0/9.0, 6.0/9.0,
+ -2.0/9.0, 2.0/9.0, 6.0/9.0, 0.0, 2.0/9.0, 6.0/9.0, 2.0/9.0, 2.0/9.0, 6.0/9.0,
+ 4.0/9.0, 2.0/9.0, 6.0/9.0, 6.0/9.0, 2.0/9.0, 6.0/9.0, 8.0/9.0, 2.0/9.0, 6.0/9.0,
+ -8.0/9.0, 4.0/9.0, 6.0/9.0, -6.0/9.0, 4.0/9.0, 6.0/9.0, -4.0/9.0, 4.0/9.0, 6.0/9.0,
+ -2.0/9.0, 4.0/9.0, 6.0/9.0, 0.0, 4.0/9.0, 6.0/9.0, 2.0/9.0, 4.0/9.0, 6.0/9.0,
+ 4.0/9.0, 4.0/9.0, 6.0/9.0, 6.0/9.0, 4.0/9.0, 6.0/9.0, 8.0/9.0, 4.0/9.0, 6.0/9.0,
+ -8.0/9.0, 6.0/9.0, 6.0/9.0, -6.0/9.0, 6.0/9.0, 6.0/9.0, -4.0/9.0, 6.0/9.0, 6.0/9.0,
+ -2.0/9.0, 6.0/9.0, 6.0/9.0, 0.0, 6.0/9.0, 6.0/9.0, 2.0/9.0, 6.0/9.0, 6.0/9.0,
+ 4.0/9.0, 6.0/9.0, 6.0/9.0, 6.0/9.0, 6.0/9.0, 6.0/9.0, 8.0/9.0, 6.0/9.0, 6.0/9.0,
+ -8.0/9.0, 8.0/9.0, 6.0/9.0, -6.0/9.0, 8.0/9.0, 6.0/9.0, -4.0/9.0, 8.0/9.0, 6.0/9.0,
+ -2.0/9.0, 8.0/9.0, 6.0/9.0, 0.0, 8.0/9.0, 6.0/9.0, 2.0/9.0, 8.0/9.0, 6.0/9.0,
+ 4.0/9.0, 8.0/9.0, 6.0/9.0, 6.0/9.0, 8.0/9.0, 6.0/9.0, 8.0/9.0, 8.0/9.0, 6.0/9.0,
+ -8.0/9.0,-8.0/9.0, 8.0/9.0, -6.0/9.0,-8.0/9.0, 8.0/9.0, -4.0/9.0,-8.0/9.0, 8.0/9.0,
+ -2.0/9.0,-8.0/9.0, 8.0/9.0, 0.0,-8.0/9.0, 8.0/9.0, 2.0/9.0,-8.0/9.0, 8.0/9.0,
+ 4.0/9.0,-8.0/9.0, 8.0/9.0, 6.0/9.0,-8.0/9.0, 8.0/9.0, 8.0/9.0,-8.0/9.0, 8.0/9.0,
+ -8.0/9.0,-6.0/9.0, 8.0/9.0, -6.0/9.0,-6.0/9.0, 8.0/9.0, -4.0/9.0,-6.0/9.0, 8.0/9.0,
+ -2.0/9.0,-6.0/9.0, 8.0/9.0, 0.0,-6.0/9.0, 8.0/9.0, 2.0/9.0,-6.0/9.0, 8.0/9.0,
+ 4.0/9.0,-6.0/9.0, 8.0/9.0, 6.0/9.0,-6.0/9.0, 8.0/9.0, 8.0/9.0,-6.0/9.0, 8.0/9.0,
+ -8.0/9.0,-4.0/9.0, 8.0/9.0, -6.0/9.0,-4.0/9.0, 8.0/9.0, -4.0/9.0,-4.0/9.0, 8.0/9.0,
+ -2.0/9.0,-4.0/9.0, 8.0/9.0, 0.0,-4.0/9.0, 8.0/9.0, 2.0/9.0,-4.0/9.0, 8.0/9.0,
+ 4.0/9.0,-4.0/9.0, 8.0/9.0, 6.0/9.0,-4.0/9.0, 8.0/9.0, 8.0/9.0,-4.0/9.0, 8.0/9.0,
+ -8.0/9.0,-2.0/9.0, 8.0/9.0, -6.0/9.0,-2.0/9.0, 8.0/9.0, -4.0/9.0,-2.0/9.0, 8.0/9.0,
+ -2.0/9.0,-2.0/9.0, 8.0/9.0, 0.0,-2.0/9.0, 8.0/9.0, 2.0/9.0,-2.0/9.0, 8.0/9.0,
+ 4.0/9.0,-2.0/9.0, 8.0/9.0, 6.0/9.0,-2.0/9.0, 8.0/9.0, 8.0/9.0,-2.0/9.0, 8.0/9.0,
+ -8.0/9.0, 0.0, 8.0/9.0, -6.0/9.0, 0.0, 8.0/9.0, -4.0/9.0, 0.0, 8.0/9.0,
+ -2.0/9.0, 0.0, 8.0/9.0, 0.0, 0.0, 8.0/9.0, 2.0/9.0, 0.0, 8.0/9.0,
+ 4.0/9.0, 0.0, 8.0/9.0, 6.0/9.0, 0.0, 8.0/9.0, 8.0/9.0, 0.0, 8.0/9.0,
+ -8.0/9.0, 2.0/9.0, 8.0/9.0, -6.0/9.0, 2.0/9.0, 8.0/9.0, -4.0/9.0, 2.0/9.0, 8.0/9.0,
+ -2.0/9.0, 2.0/9.0, 8.0/9.0, 0.0, 2.0/9.0, 8.0/9.0, 2.0/9.0, 2.0/9.0, 8.0/9.0,
+ 4.0/9.0, 2.0/9.0, 8.0/9.0, 6.0/9.0, 2.0/9.0, 8.0/9.0, 8.0/9.0, 2.0/9.0, 8.0/9.0,
+ -8.0/9.0, 4.0/9.0, 8.0/9.0, -6.0/9.0, 4.0/9.0, 8.0/9.0, -4.0/9.0, 4.0/9.0, 8.0/9.0,
+ -2.0/9.0, 4.0/9.0, 8.0/9.0, 0.0, 4.0/9.0, 8.0/9.0, 2.0/9.0, 4.0/9.0, 8.0/9.0,
+ 4.0/9.0, 4.0/9.0, 8.0/9.0, 6.0/9.0, 4.0/9.0, 8.0/9.0, 8.0/9.0, 4.0/9.0, 8.0/9.0,
+ -8.0/9.0, 6.0/9.0, 8.0/9.0, -6.0/9.0, 6.0/9.0, 8.0/9.0, -4.0/9.0, 6.0/9.0, 8.0/9.0,
+ -2.0/9.0, 6.0/9.0, 8.0/9.0, 0.0, 6.0/9.0, 8.0/9.0, 2.0/9.0, 6.0/9.0, 8.0/9.0,
+ 4.0/9.0, 6.0/9.0, 8.0/9.0, 6.0/9.0, 6.0/9.0, 8.0/9.0, 8.0/9.0, 6.0/9.0, 8.0/9.0,
+ -8.0/9.0, 8.0/9.0, 8.0/9.0, -6.0/9.0, 8.0/9.0, 8.0/9.0, -4.0/9.0, 8.0/9.0, 8.0/9.0,
+ -2.0/9.0, 8.0/9.0, 8.0/9.0, 0.0, 8.0/9.0, 8.0/9.0, 2.0/9.0, 8.0/9.0, 8.0/9.0,
+ 4.0/9.0, 8.0/9.0, 8.0/9.0, 6.0/9.0, 8.0/9.0, 8.0/9.0, 8.0/9.0, 8.0/9.0, 8.0/9.0
+};
+
+
+static const REAL *grouptableA[16] =
+{ 0,group5bits,group7bits,group10bits,0,0,0,0,0,0,0,0,0,0,0,0};
+static const REAL *grouptableB1[16] =
+{ 0,group5bits,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+static const REAL *grouptableB234[16] =
+{ 0,group5bits,group7bits,0,group10bits,0,0,0,0,0,0,0,0,0,0,0};
+
+static const int codelengthtableA[16] =
+{ 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+static const int codelengthtableB1[16] =
+{ 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
+static const int codelengthtableB2[16] =
+{ 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 };
+static const int codelengthtableB3[8] = { 0, 5, 7, 3, 10, 4, 5, 16 };
+static const int codelengthtableB4[4] = { 0, 5, 7, 16 };
+
+
+static const REAL factortableA[16] =
+{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/8.0,
+ 1.0/8.0, 1.0/16.0, 1.0/32.0, 1.0/64.0,
+ 1.0/128.0, 1.0/256.0, 1.0/512.0, 1.0/1024.0,
+ 1.0/2048.0, 1.0/4096.0, 1.0/8192.0, 1.0/16384.0 };
+static const REAL factortableB1[16] =
+{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/8.0,
+ 1.0/16.0, 1.0/32.0, 1.0/64.0, 1.0/128.0,
+ 1.0/256.0, 1.0/512.0, 1.0/1024.0, 1.0/2048.0,
+ 1.0/4096.0, 1.0/8192.0, 1.0/16384.0, 1.0/32768.0 };
+static const REAL factortableB2[16] =
+{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/4.0,
+ 1.0/8.0, 1.0/8.0, 1.0/16.0, 1.0/32.0,
+ 1.0/64.0, 1.0/128.0, 1.0/256.0, 1.0/512.0,
+ 1.0/1024.0, 1.0/2048.0, 1.0/4096.0, 1.0/32768.0 };
+static const REAL factortableB3[8] =
+{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/4.0, 1.0/8.0, 1.0/8.0, 1.0/16.0, 1.0/32768.0 };
+static const REAL factortableB4[4] = { 0.0, 1.0/2.0, 1.0/4.0, 1.0/32768.0 };
+
+
+static const REAL ctableA[16]=
+{ 0.0, 1.33333333333, 1.60000000000, 1.77777777777,
+ 1.06666666666, 1.03225806452, 1.01587301587, 1.00787401575,
+ 1.00392156863, 1.00195694716, 1.00097751711, 1.00048851979,
+ 1.00024420024, 1.00012208522, 1.00006103888, 1.00003051851};
+static const REAL ctableB1[16]=
+{ 0.0, 1.33333333333, 1.14285714286, 1.06666666666,
+ 1.03225806452, 1.01587301587, 1.00787401575, 1.00392156863,
+ 1.00195694716, 1.00097751711, 1.00048851979, 1.00024420024,
+ 1.00012208522, 1.00006103888, 1.00003051851, 1.00001525902};
+static const REAL ctableB2[16] =
+{ 0.0, 1.33333333333, 1.60000000000, 1.14285714286,
+ 1.77777777777, 1.06666666666, 1.03225806452, 1.01587301587,
+ 1.00787401575, 1.00392156863, 1.00195694716, 1.00097751711,
+ 1.00048851979, 1.00024420024, 1.00012208522, 1.00001525902};
+static const REAL ctableB3[8] =
+{ 0.0, 1.33333333333, 1.60000000000, 1.14285714286,
+ 1.77777777777, 1.06666666666, 1.03225806452, 1.00001525902 };
+static const REAL ctableB4[4] =
+{ 0.0, 1.33333333333, 1.60000000000, 1.00001525902 };
+
+
+static const REAL dtableA[16]=
+{ 0.0, 0.50000000000, 0.50000000000, 0.50000000000,
+ 0.12500000000, 0.06250000000, 0.03125000000, 0.01562500000,
+ 0.00781250000, 0.00390625000, 0.00195312500, 0.00097656250,
+ 0.00048828125, 0.00024414063, 0.00012207031, 0.00006103516};
+
+static const REAL dtableB1[16]=
+{ 0.0, 0.50000000000, 0.25000000000, 0.12500000000,
+ 0.06250000000, 0.03125000000, 0.01562500000, 0.00781250000,
+ 0.00390625000, 0.00195312500, 0.00097656250, 0.00048828125,
+ 0.00024414063, 0.00012207031, 0.00006103516, 0.00003051758};
+
+static const REAL dtableB2[16]=
+{ 0.0, 0.50000000000, 0.50000000000, 0.25000000000,
+ 0.50000000000, 0.12500000000, 0.06250000000, 0.03125000000,
+ 0.01562500000, 0.00781250000, 0.00390625000, 0.00195312500,
+ 0.00097656250, 0.00048828125, 0.00024414063, 0.00003051758};
+
+static const REAL dtableB3[8]=
+{ 0.0, 0.50000000000, 0.50000000000, 0.25000000000,
+ 0.50000000000, 0.12500000000, 0.06250000000, 0.00003051758};
+
+static const REAL dtableB4[4]=
+{0.0, 0.50000000000, 0.50000000000, 0.00003051758};
+
+
+// Mpeg layer 2
+void Mpegtoraw::extractlayer2(void)
+{
+ REAL fraction[MAXCHANNEL][3][MAXSUBBAND];
+ unsigned int bitalloc[MAXCHANNEL][MAXSUBBAND],
+ scaleselector[MAXCHANNEL][MAXSUBBAND];
+ REAL scalefactor[2][3][MAXSUBBAND];
+
+ const REAL *group[MAXCHANNEL][MAXSUBBAND];
+ unsigned int codelength[MAXCHANNEL][MAXSUBBAND];
+ REAL factor[MAXCHANNEL][MAXSUBBAND];
+ REAL c[MAXCHANNEL][MAXSUBBAND],d[MAXCHANNEL][MAXSUBBAND];
+
+ int s=stereobound,n=subbandnumber;
+
+
+// Bitalloc
+ {
+ register int i;
+ register const int *t=bitalloclengthtable[tableindex];
+
+ for(i=0;i<s;i++,t++)
+ {
+ bitalloc[LS][i]=getbits(*t);
+ bitalloc[RS][i]=getbits(*t);
+ }
+ for(;i<n;i++,t++)
+ bitalloc[LS][i]=bitalloc[RS][i]=getbits(*t);
+ }
+
+
+ // Scale selector
+ if(inputstereo)
+ for(register int i=0;i<n;i++)
+ {
+ if(bitalloc[LS][i])scaleselector[LS][i]=getbits(2);
+ if(bitalloc[RS][i])scaleselector[RS][i]=getbits(2);
+ }
+ else
+ for(register int i=0;i<n;i++)
+ if(bitalloc[LS][i])scaleselector[LS][i]=getbits(2);
+
+ // Scale index
+ {
+ register int i,j;
+
+ for(i=0;i<n;i++)
+ {
+ if((j=bitalloc[LS][i]))
+ {
+ if(!tableindex)
+ {
+ group[LS][i]=grouptableA[j];
+ codelength[LS][i]=codelengthtableA[j];
+ factor[LS][i]=factortableA[j];
+ c[LS][i]=ctableA[j];
+ d[LS][i]=dtableA[j];
+ }
+ else
+ {
+ if(i<=2)
+ {
+ group[LS][i]=grouptableB1[j];
+ codelength[LS][i]=codelengthtableB1[j];
+ factor[LS][i]=factortableB1[j];
+ c[LS][i]=ctableB1[j];
+ d[LS][i]=dtableB1[j];
+ }
+ else
+ {
+ group[LS][i]=grouptableB234[j];
+ if(i<=10)
+ {
+ codelength[LS][i]=codelengthtableB2[j];
+ factor[LS][i]=factortableB2[j];
+ c[LS][i]=ctableB2[j];
+ d[LS][i]=dtableB2[j];
+ }
+ else if(i<=22)
+ {
+ codelength[LS][i]=codelengthtableB3[j];
+ factor[LS][i]=factortableB3[j];
+ c[LS][i]=ctableB3[j];
+ d[LS][i]=dtableB3[j];
+ }
+ else
+ {
+ codelength[LS][i]=codelengthtableB4[j];
+ factor[LS][i]=factortableB4[j];
+ c[LS][i]=ctableB4[j];
+ d[LS][i]=dtableB4[j];
+ }
+ }
+ }
+
+ switch(scaleselector[LS][i])
+ {
+ case 0:scalefactor[LS][0][i]=scalefactorstable[getbits(6)];
+ scalefactor[LS][1][i]=scalefactorstable[getbits(6)];
+ scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ case 1:scalefactor[LS][0][i]=
+ scalefactor[LS][1][i]=scalefactorstable[getbits(6)];
+ scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ case 2:scalefactor[LS][0][i]=
+ scalefactor[LS][1][i]=
+ scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ case 3:scalefactor[LS][0][i]=scalefactorstable[getbits(6)];
+ scalefactor[LS][1][i]=
+ scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ }
+ }
+
+ if(inputstereo && (j=bitalloc[RS][i]))
+ {
+ if(!tableindex)
+ {
+ group[RS][i]=grouptableA[j];
+ codelength[RS][i]=codelengthtableA[j];
+ factor[RS][i]=factortableA[j];
+ c[RS][i]=ctableA[j];
+ d[RS][i]=dtableA[j];
+ }
+ else
+ {
+ if(i<=2)
+ {
+ group[RS][i]=grouptableB1[j];
+ codelength[RS][i]=codelengthtableB1[j];
+ factor[RS][i]=factortableB1[j];
+ c[RS][i]=ctableB1[j];
+ d[RS][i]=dtableB1[j];
+ }
+ else
+ {
+ group[RS][i]=grouptableB234[j];
+ if(i<=10)
+ {
+ codelength[RS][i]=codelengthtableB2[j];
+ factor[RS][i]=factortableB2[j];
+ c[RS][i]=ctableB2[j];
+ d[RS][i]=dtableB2[j];
+ }
+ else if(i<=22)
+ {
+ codelength[RS][i]=codelengthtableB3[j];
+ factor[RS][i]=factortableB3[j];
+ c[RS][i]=ctableB3[j];
+ d[RS][i]=dtableB3[j];
+ }
+ else
+ {
+ codelength[RS][i]=codelengthtableB4[j];
+ factor[RS][i]=factortableB4[j];
+ c[RS][i]=ctableB4[j];
+ d[RS][i]=dtableB4[j];
+ }
+ }
+ }
+
+ switch(scaleselector[RS][i])
+ {
+ case 0 : scalefactor[RS][0][i]=scalefactorstable[getbits(6)];
+ scalefactor[RS][1][i]=scalefactorstable[getbits(6)];
+ scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ case 1 : scalefactor[RS][0][i]=
+ scalefactor[RS][1][i]=scalefactorstable[getbits(6)];
+ scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ case 2 : scalefactor[RS][0][i]=
+ scalefactor[RS][1][i]=
+ scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ case 3 : scalefactor[RS][0][i]=scalefactorstable[getbits(6)];
+ scalefactor[RS][1][i]=
+ scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
+ break;
+ }
+ }
+ }
+ }
+
+
+// Read Sample
+ {
+ register int i;
+
+ for(int l=0;l<SCALEBLOCK;l++)
+ {
+ // Read Sample
+ for(i=0;i<s;i++)
+ {
+ if(bitalloc[LS][i])
+ {
+ if(group[LS][i])
+ {
+ register const REAL *s;
+ int code=getbits(codelength[LS][i]);
+
+ code+=code<<1;
+ s=group[LS][i]+code;
+
+ fraction[LS][0][i]=s[0];
+ fraction[LS][1][i]=s[1];
+ fraction[LS][2][i]=s[2];
+ }
+ else
+ {
+ fraction[LS][0][i]=
+ REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0;
+ fraction[LS][1][i]=
+ REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0;
+ fraction[LS][2][i]=
+ REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0;
+ }
+ }
+ else fraction[LS][0][i]=fraction[LS][1][i]=fraction[LS][2][i]=0.0;
+
+ if(inputstereo && bitalloc[RS][i])
+ {
+ if(group[RS][i])
+ {
+ const REAL *s;
+ int code=getbits(codelength[RS][i]);
+
+ code+=code<<1;
+ s=group[RS][i]+code;
+
+ fraction[RS][0][i]=s[0];
+ fraction[RS][1][i]=s[1];
+ fraction[RS][2][i]=s[2];
+ }
+ else
+ {
+ fraction[RS][0][i]=
+ REAL(getbits(codelength[RS][i]))*factor[RS][i]-1.0;
+ fraction[RS][1][i]=
+ REAL(getbits(codelength[RS][i]))*factor[RS][i]-1.0;
+ fraction[RS][2][i]=
+ REAL(getbits(codelength[RS][i]))*factor[RS][i]-1.0;
+ }
+ }
+ else fraction[RS][0][i]=fraction[RS][1][i]=fraction[RS][2][i]=0.0;
+ }
+
+ for(;i<n;i++)
+ {
+ if(bitalloc[LS][i])
+ {
+ if(group[LS][i])
+ {
+ register const REAL *s;
+ int code=getbits(codelength[LS][i]);
+
+ code+=code<<1;
+ s=group[LS][i]+code;
+
+ fraction[LS][0][i]=fraction[RS][0][i]=s[0];
+ fraction[LS][1][i]=fraction[RS][1][i]=s[1];
+ fraction[LS][2][i]=fraction[RS][2][i]=s[2];
+ }
+ else
+ {
+ fraction[LS][0][i]=fraction[RS][0][i]=
+ REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0;
+ fraction[LS][1][i]=fraction[RS][1][i]=
+ REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0;
+ fraction[LS][2][i]=fraction[RS][2][i]=
+ REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0;
+ }
+ }
+ else fraction[LS][0][i]=fraction[LS][1][i]=fraction[LS][2][i]=
+ fraction[RS][0][i]=fraction[RS][1][i]=fraction[RS][2][i]=0.0;
+ }
+
+
+
+ //Fraction
+ if(outputstereo)
+ for(i=0;i<n;i++)
+ {
+ if(bitalloc[LS][i])
+ {
+ if(!group[LS][i])
+ {
+ fraction[LS][0][i]=(fraction[LS][0][i]+d[LS][i])*c[LS][i];
+ fraction[LS][1][i]=(fraction[LS][1][i]+d[LS][i])*c[LS][i];
+ fraction[LS][2][i]=(fraction[LS][2][i]+d[LS][i])*c[LS][i];
+ }
+
+ register REAL t=scalefactor[LS][l>>2][i];
+ fraction[LS][0][i]*=t;
+ fraction[LS][1][i]*=t;
+ fraction[LS][2][i]*=t;
+ }
+
+ if(bitalloc[RS][i])
+ {
+ if(!group[RS][i])
+ {
+ fraction[RS][0][i]=(fraction[RS][0][i]+d[RS][i])*c[LS][i];
+ fraction[RS][1][i]=(fraction[RS][1][i]+d[RS][i])*c[LS][i];
+ fraction[RS][2][i]=(fraction[RS][2][i]+d[RS][i])*c[LS][i];
+ }
+
+ register REAL t=scalefactor[RS][l>>2][i];
+ fraction[RS][0][i]*=t;
+ fraction[RS][1][i]*=t;
+ fraction[RS][2][i]*=t;
+ }
+ }
+ else
+ for(i=0;i<n;i++)
+ if(bitalloc[LS][i])
+ {
+ if(!group[LS][i])
+ {
+ fraction[LS][0][i]=(fraction[LS][0][i]+d[LS][i])*c[LS][i];
+ fraction[LS][1][i]=(fraction[LS][1][i]+d[LS][i])*c[LS][i];
+ fraction[LS][2][i]=(fraction[LS][2][i]+d[LS][i])*c[LS][i];
+ }
+
+ register REAL t=scalefactor[LS][l>>2][i];
+ fraction[LS][0][i]*=t;
+ fraction[LS][1][i]*=t;
+ fraction[LS][2][i]*=t;
+ }
+
+ for(;i<MAXSUBBAND;i++)
+ fraction[LS][0][i]=fraction[LS][1][i]=fraction[LS][2][i]=
+ fraction[RS][0][i]=fraction[RS][1][i]=fraction[RS][2][i]=0.0;
+
+ for(i=0;i<3;i++)
+ subbandsynthesis(fraction[LS][i],fraction[RS][i]);
+ }
+ }
+}
diff --git a/setedit/mp3/mpegsound/mpglayr3.cc b/setedit/mp3/mpegsound/mpglayr3.cc
new file mode 100644
index 0000000..2fdefcc
--- /dev/null
+++ b/setedit/mp3/mpegsound/mpglayr3.cc
@@ -0,0 +1,1912 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Mpeglayer3.cc
+// It's for MPEG Layer 3
+// I've made array of superior functions for speed.
+// Extend TO_FOUR_THIRDS to negative.
+// Bug fix : maplay 1.2+ have wrong TO_FOUR_THIRDS ranges.
+// Force to mono!!
+// MPEG-2 is implemented
+// Speed up in fixstereo (maybe buggy)
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <math.h>
+#include <stdlib.h>
+
+#include "mpegsound.h"
+#include "mpg_locals.h"
+
+// Change to 0 if you need to debug the code unoptimized.
+#if 1
+ #define ASK_INLINE inline
+#else
+ #define ASK_INLINE
+#endif
+
+ASK_INLINE int Mpegtoraw::wgetbit(void) {return bitwindow.getbit (); }
+ASK_INLINE int Mpegtoraw::wgetbits9(int bits){return bitwindow.getbits9(bits);}
+ASK_INLINE int Mpegtoraw::wgetbits(int bits) {return bitwindow.getbits (bits);}
+
+ASK_INLINE void Mpegbitwindow::wrap(void)
+{
+ int p=bitindex>>3;
+ point&=(WINDOWSIZE-1);
+
+ if(p>=point)
+ {
+ for(register int i=4;i<point;i++)
+ buffer[WINDOWSIZE+i]=buffer[i];
+ }
+ *((int *)(buffer+WINDOWSIZE))=*((int *)buffer);
+}
+
+ASK_INLINE int Mpegbitwindow::getbit(void)
+{
+// register int r=(buffer[(bitindex>>3)&(WINDOWSIZE-1)]>>(7-(bitindex&7)))&1;
+ register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
+ bitindex++;
+ return r;
+};
+
+ASK_INLINE int Mpegbitwindow::getbits9(int bits)
+{
+ register unsigned short a;
+
+ {
+ int offset=bitindex>>3;
+
+ a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
+ }
+
+ a<<=(bitindex&7);
+ bitindex+=bits;
+ return (int)((unsigned int)(a>>(16-bits)));
+}
+
+#define MUL3(a) (((a)<<1)+(a))
+
+#define REAL0 0
+
+#define ARRAYSIZE (SBLIMIT*SSLIMIT)
+#define REALSIZE (sizeof(REAL))
+
+#ifdef PI
+#undef PI
+#endif
+#define PI 3.141593
+#define PI_12 (PI/12.0)
+#define PI_18 (PI/18.0)
+#define PI_24 (PI/24.0)
+#define PI_36 (PI/36.0)
+#define PI_72 (PI/72.0)
+
+#ifdef NATIVE_ASSEMBLY
+ASK_INLINE void long_memset(void * s,unsigned int c,int count)
+{
+__asm__ __volatile__(
+ "cld\n\t"
+ "rep ; stosl\n\t"
+ : /* no output */
+ :"a" (c), "c" (count/4), "D" ((long) s)
+ :"cx","di","memory");
+}
+#endif
+
+#define FOURTHIRDSTABLENUMBER (1<<13)
+
+static REAL two_to_negative_half_pow[40];
+static REAL TO_FOUR_THIRDSTABLE[FOURTHIRDSTABLENUMBER*2];
+static REAL POW2[256];
+static REAL POW2_1[8][2][16];
+static REAL ca[8],cs[8];
+
+
+
+static REAL cos1_6=cos(PI/6.0*1.0);
+static REAL cos2_6=cos(PI/6.0*2.0);
+static REAL win[4][36];
+static REAL cos_18[9];
+static REAL hsec_36[9],hsec_12[3];
+
+typedef struct
+{
+ REAL l,r;
+}RATIOS;
+
+static RATIOS rat_1[16],rat_2[2][64];
+
+void Mpegtoraw::layer3initialize(void)
+{
+ static bool initializedlayer3=false;
+
+ layer3framestart=0;
+ currentprevblock=0;
+
+ {
+ int i,j,k,l;
+
+ for(l=0;l<2;l++)
+ for(i=0;i<2;i++)
+ for(j=0;j<SBLIMIT;j++)
+ for(k=0;k<SSLIMIT;k++)
+ prevblck[l][i][j][k]=0.0f;
+ }
+
+ bitwindow.initialize();
+
+ if(initializedlayer3)return;
+
+ // Calculate win
+ {
+ register int i;
+
+ for(i=0;i<18;i++)
+ win[0][i]=win[1][i]=0.5*sin(PI_72*(double)(2*i+1))/cos(PI_72*(double)(2*i+19));
+ for(;i<36;i++)
+ win[0][i]=win[3][i]=0.5*sin(PI_72*(double)(2*i+1))/cos(PI_72*(double)(2*i+19));
+
+ for(i=0;i<6;i++)
+ {
+ win[1][i+18]=0.5/cos(PI_72*(double)(2*(i+18)+19));
+ win[3][i+12]=0.5/cos(PI_72*(double)(2*(i+12)+19));
+ win[1][i+24]=0.5*sin(PI_24*(double)(2*i+13))/cos(PI_72*(double)(2*(i+24)+19));
+ win[1][i+30]=win[3][i]=0.0;
+ win[3][i+6 ]=0.5*sin(PI_24*(double)(2*i+1))/cos(PI_72*(double)(2*(i+6)+19));
+ }
+ for(i=0;i<12;i++)
+ win[2][i]=0.5*sin(PI_24*(double)(2*i+1))/cos(PI_24*(double)(2*i+7));
+ }
+
+ for(register int i=0;i<9;i++)
+ cos_18[i]=cos(PI_18*double(i));
+ for(register int i=0;i<9;i++)
+ hsec_36[i]=0.5/cos(PI_36*double(i*2+1));
+ for(register int i=0;i<3;i++)
+ hsec_12[i]=0.5/cos(PI_12*double(i*2+1));
+
+ for(int i=0;i<40;i++)
+ two_to_negative_half_pow[i]=(REAL)pow(2.0,-0.5*(double)i);
+ {
+ REAL *TO_FOUR_THIRDS=TO_FOUR_THIRDSTABLE+FOURTHIRDSTABLENUMBER;
+
+ for(int i=0;i<FOURTHIRDSTABLENUMBER;i++)
+ TO_FOUR_THIRDS[-i]=
+ -(TO_FOUR_THIRDS[i]=(REAL)pow((double)i,4.0/3.0));
+ }
+ for(int i=0;i<256;i++)POW2[i]=(REAL)pow(2.0,(0.25*(i-210.0)));
+ for(int i=0,j,k;i<8;i++)
+ for(j=0;j<2;j++)
+ for(k=0;k<16;k++)POW2_1[i][j][k]=pow(2.0,(-2.0*i)-(0.5*(1.0+j)*k));
+
+ {
+ static REAL TAN12[16]=
+ { 0.0, 0.26794919, 0.57735027 , 1.0,
+ 1.73205081, 3.73205081, 9.9999999e10,-3.73205081,
+ -1.73205081,-1.01, -0.57735027, -0.26794919,
+ 0.0, 0.26794919, 0.57735027, 1.0};
+
+ for(int i=0;i<16;i++)
+ {
+ rat_1[i].l=TAN12[i]/(1.0+TAN12[i]);
+ rat_1[i].r=1.0/(1.0+TAN12[i]);
+ }
+ }
+
+#define IO0 ((double)0.840896415256)
+#define IO1 ((double)0.707106781188)
+ rat_2[0][0].l=rat_2[0][0].r=
+ rat_2[1][0].l=rat_2[1][0].r=1.;
+
+ for(int i=1;i<64;i++)
+ if((i%2)==1)
+ {
+ rat_2[0][i].l=pow(IO0,(i+1)/2);
+ rat_2[1][i].l=pow(IO1,(i+1)/2);
+ rat_2[0][i].r=
+ rat_2[1][i].r=1.;
+ }
+ else
+ {
+ rat_2[0][i].l=
+ rat_2[1][i].l=1.;
+ rat_2[0][i].r=pow(IO0,i/2);
+ rat_2[1][i].r=pow(IO1,i/2);
+ }
+
+ {
+ static REAL Ci[8]=
+ {-0.6f,-0.535f,-0.33f,-0.185f,-0.095f,-0.041f,-0.0142f,-0.0037f};
+ REAL sq;
+
+ for(int i=0;i<8;i++)
+ {
+ sq=sqrt(1.0f+Ci[i]*Ci[i]);
+ cs[i]=1.0f/sq;
+ ca[i]=Ci[i]*cs[i];
+ }
+ }
+
+ initializedlayer3=true;
+}
+
+bool Mpegtoraw::layer3getsideinfo(void)
+{
+ sideinfo.main_data_begin=getbits(9);
+
+ if(!inputstereo)sideinfo.private_bits=getbits(5);
+ else sideinfo.private_bits=getbits(3);
+
+ sideinfo.ch[LS].scfsi[0]=getbit();
+ sideinfo.ch[LS].scfsi[1]=getbit();
+ sideinfo.ch[LS].scfsi[2]=getbit();
+ sideinfo.ch[LS].scfsi[3]=getbit();
+ if(inputstereo)
+ {
+ sideinfo.ch[RS].scfsi[0]=getbit();
+ sideinfo.ch[RS].scfsi[1]=getbit();
+ sideinfo.ch[RS].scfsi[2]=getbit();
+ sideinfo.ch[RS].scfsi[3]=getbit();
+ }
+
+ for(int gr=0,ch;gr<2;gr++)
+ for(ch=0;;ch++)
+ {
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]);
+
+ gi->part2_3_length =getbits(12);
+ gi->big_values =getbits(9);
+ gi->global_gain =getbits(8);
+ gi->scalefac_compress =getbits(4);
+ gi->window_switching_flag=getbit();
+ if(gi->window_switching_flag)
+ {
+ gi->block_type =getbits(2);
+ gi->mixed_block_flag=getbit();
+
+ gi->table_select[0] =getbits(5);
+ gi->table_select[1] =getbits(5);
+
+ gi->subblock_gain[0]=getbits(3);
+ gi->subblock_gain[1]=getbits(3);
+ gi->subblock_gain[2]=getbits(3);
+
+ /* Set region_count parameters since they are implicit in this case. */
+ if(gi->block_type==0)
+ {
+ /* printf("Side info bad: block_type == 0 in split block.\n");
+ exit(0); */
+ return false;
+ }
+ else if (gi->block_type==2 && gi->mixed_block_flag==0)
+ gi->region0_count=8; /* MI 9; */
+ else gi->region0_count=7; /* MI 8; */
+ gi->region1_count=20-(gi->region0_count);
+ }
+ else
+ {
+ gi->table_select[0] =getbits(5);
+ gi->table_select[1] =getbits(5);
+ gi->table_select[2] =getbits(5);
+ gi->region0_count =getbits(4);
+ gi->region1_count =getbits(3);
+ gi->block_type =0;
+ gi->mixed_block_flag=0;
+ }
+ gi->preflag =getbit();
+ gi->scalefac_scale =getbit();
+ gi->count1table_select=getbit();
+
+ gi->generalflag=gi->window_switching_flag && (gi->block_type==2);
+
+ if(!inputstereo || ch)break;
+ }
+
+ return true;
+}
+
+bool Mpegtoraw::layer3getsideinfo_2(void)
+{
+ sideinfo.main_data_begin=getbits(8);
+
+ if(!inputstereo)sideinfo.private_bits=getbit();
+ else sideinfo.private_bits=getbits(2);
+
+ for(int ch=0;;ch++)
+ {
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[0]);
+
+ gi->part2_3_length =getbits(12);
+ gi->big_values =getbits(9);
+ gi->global_gain =getbits(8);
+ gi->scalefac_compress =getbits(9);
+ gi->window_switching_flag=getbit();
+ if(gi->window_switching_flag)
+ {
+ gi->block_type =getbits(2);
+ gi->mixed_block_flag=getbit();
+
+ gi->table_select[0] =getbits(5);
+ gi->table_select[1] =getbits(5);
+
+ gi->subblock_gain[0]=getbits(3);
+ gi->subblock_gain[1]=getbits(3);
+ gi->subblock_gain[2]=getbits(3);
+
+ /* Set region_count parameters since they are implicit in this case. */
+ if(gi->block_type==0)
+ {
+ /* printf("Side info bad: block_type == 0 in split block.\n");
+ exit(0); */
+ return false;
+ }
+ else if (gi->block_type==2 && gi->mixed_block_flag==0)
+ gi->region0_count=8; /* MI 9; */
+ else gi->region0_count=7; /* MI 8; */
+ gi->region1_count=20-(gi->region0_count);
+ }
+ else
+ {
+ gi->table_select[0] =getbits(5);
+ gi->table_select[1] =getbits(5);
+ gi->table_select[2] =getbits(5);
+ gi->region0_count =getbits(4);
+ gi->region1_count =getbits(3);
+ gi->block_type =0;
+ gi->mixed_block_flag=0;
+ }
+ gi->scalefac_scale =getbit();
+ gi->count1table_select=getbit();
+
+ gi->generalflag=gi->window_switching_flag && (gi->block_type==2);
+
+ if(!inputstereo || ch)break;
+ }
+
+ return true;
+}
+
+void Mpegtoraw::layer3getscalefactors(int ch,int gr)
+{
+ static int slen[2][16]={{0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4},
+ {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}};
+
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]);
+ register layer3scalefactor *sf=(&scalefactors[ch]);
+ int l0,l1;
+
+ {
+ int scale_comp=gi->scalefac_compress;
+
+ l0=slen[0][scale_comp];
+ l1=slen[1][scale_comp];
+ }
+ if(gi->generalflag)
+ {
+ if(gi->mixed_block_flag)
+ { /* MIXED */ /* NEW-ag 11/25 */
+ sf->l[0]=wgetbits9(l0);sf->l[1]=wgetbits9(l0);
+ sf->l[2]=wgetbits9(l0);sf->l[3]=wgetbits9(l0);
+ sf->l[4]=wgetbits9(l0);sf->l[5]=wgetbits9(l0);
+ sf->l[6]=wgetbits9(l0);sf->l[7]=wgetbits9(l0);
+
+ sf->s[0][ 3]=wgetbits9(l0);sf->s[1][ 3]=wgetbits9(l0);
+ sf->s[2][ 3]=wgetbits9(l0);
+ sf->s[0][ 4]=wgetbits9(l0);sf->s[1][ 4]=wgetbits9(l0);
+ sf->s[2][ 4]=wgetbits9(l0);
+ sf->s[0][ 5]=wgetbits9(l0);sf->s[1][ 5]=wgetbits9(l0);
+ sf->s[2][ 5]=wgetbits9(l0);
+
+ sf->s[0][ 6]=wgetbits9(l1);sf->s[1][ 6]=wgetbits9(l1);
+ sf->s[2][ 6]=wgetbits9(l1);
+ sf->s[0][ 7]=wgetbits9(l1);sf->s[1][ 7]=wgetbits9(l1);
+ sf->s[2][ 7]=wgetbits9(l1);
+ sf->s[0][ 8]=wgetbits9(l1);sf->s[1][ 8]=wgetbits9(l1);
+ sf->s[2][ 8]=wgetbits9(l1);
+ sf->s[0][ 9]=wgetbits9(l1);sf->s[1][ 9]=wgetbits9(l1);
+ sf->s[2][ 9]=wgetbits9(l1);
+ sf->s[0][10]=wgetbits9(l1);sf->s[1][10]=wgetbits9(l1);
+ sf->s[2][10]=wgetbits9(l1);
+ sf->s[0][11]=wgetbits9(l1);sf->s[1][11]=wgetbits9(l1);
+ sf->s[2][11]=wgetbits9(l1);
+
+ sf->s[0][12]=sf->s[1][12]=sf->s[2][12]=0;
+ }
+ else
+ { /* SHORT*/
+ sf->s[0][ 0]=wgetbits9(l0);sf->s[1][ 0]=wgetbits9(l0);
+ sf->s[2][ 0]=wgetbits9(l0);
+ sf->s[0][ 1]=wgetbits9(l0);sf->s[1][ 1]=wgetbits9(l0);
+ sf->s[2][ 1]=wgetbits9(l0);
+ sf->s[0][ 2]=wgetbits9(l0);sf->s[1][ 2]=wgetbits9(l0);
+ sf->s[2][ 2]=wgetbits9(l0);
+ sf->s[0][ 3]=wgetbits9(l0);sf->s[1][ 3]=wgetbits9(l0);
+ sf->s[2][ 3]=wgetbits9(l0);
+ sf->s[0][ 4]=wgetbits9(l0);sf->s[1][ 4]=wgetbits9(l0);
+ sf->s[2][ 4]=wgetbits9(l0);
+ sf->s[0][ 5]=wgetbits9(l0);sf->s[1][ 5]=wgetbits9(l0);
+ sf->s[2][ 5]=wgetbits9(l0);
+
+ sf->s[0][ 6]=wgetbits9(l1);sf->s[1][ 6]=wgetbits9(l1);
+ sf->s[2][ 6]=wgetbits9(l1);
+ sf->s[0][ 7]=wgetbits9(l1);sf->s[1][ 7]=wgetbits9(l1);
+ sf->s[2][ 7]=wgetbits9(l1);
+ sf->s[0][ 8]=wgetbits9(l1);sf->s[1][ 8]=wgetbits9(l1);
+ sf->s[2][ 8]=wgetbits9(l1);
+ sf->s[0][ 9]=wgetbits9(l1);sf->s[1][ 9]=wgetbits9(l1);
+ sf->s[2][ 9]=wgetbits9(l1);
+ sf->s[0][10]=wgetbits9(l1);sf->s[1][10]=wgetbits9(l1);
+ sf->s[2][10]=wgetbits9(l1);
+ sf->s[0][11]=wgetbits9(l1);sf->s[1][11]=wgetbits9(l1);
+ sf->s[2][11]=wgetbits9(l1);
+
+ sf->s[0][12]=sf->s[1][12]=sf->s[2][12]=0;
+ }
+ }
+ else
+ { /* LONG types 0,1,3 */
+ if(gr==0)
+ {
+ sf->l[ 0]=wgetbits9(l0);sf->l[ 1]=wgetbits9(l0);
+ sf->l[ 2]=wgetbits9(l0);sf->l[ 3]=wgetbits9(l0);
+ sf->l[ 4]=wgetbits9(l0);sf->l[ 5]=wgetbits9(l0);
+ sf->l[ 6]=wgetbits9(l0);sf->l[ 7]=wgetbits9(l0);
+ sf->l[ 8]=wgetbits9(l0);sf->l[ 9]=wgetbits9(l0);
+ sf->l[10]=wgetbits9(l0);
+ sf->l[11]=wgetbits9(l1);sf->l[12]=wgetbits9(l1);
+ sf->l[13]=wgetbits9(l1);sf->l[14]=wgetbits9(l1);
+ sf->l[15]=wgetbits9(l1);
+ sf->l[16]=wgetbits9(l1);sf->l[17]=wgetbits9(l1);
+ sf->l[18]=wgetbits9(l1);sf->l[19]=wgetbits9(l1);
+ sf->l[20]=wgetbits9(l1);
+ }
+ else
+ {
+ if(sideinfo.ch[ch].scfsi[0]==0)
+ {
+ sf->l[ 0]=wgetbits9(l0);sf->l[ 1]=wgetbits9(l0);
+ sf->l[ 2]=wgetbits9(l0);sf->l[ 3]=wgetbits9(l0);
+ sf->l[ 4]=wgetbits9(l0);sf->l[ 5]=wgetbits9(l0);
+ }
+ if(sideinfo.ch[ch].scfsi[1]==0)
+ {
+ sf->l[ 6]=wgetbits9(l0);sf->l[ 7]=wgetbits9(l0);
+ sf->l[ 8]=wgetbits9(l0);sf->l[ 9]=wgetbits9(l0);
+ sf->l[10]=wgetbits9(l0);
+ }
+ if(sideinfo.ch[ch].scfsi[2]==0)
+ {
+ sf->l[11]=wgetbits9(l1);sf->l[12]=wgetbits9(l1);
+ sf->l[13]=wgetbits9(l1);sf->l[14]=wgetbits9(l1);
+ sf->l[15]=wgetbits9(l1);
+ }
+ if(sideinfo.ch[ch].scfsi[3]==0)
+ {
+ sf->l[16]=wgetbits9(l1);sf->l[17]=wgetbits9(l1);
+ sf->l[18]=wgetbits9(l1);sf->l[19]=wgetbits9(l1);
+ sf->l[20]=wgetbits9(l1);
+ }
+ }
+ sf->l[21]=sf->l[22]=0;
+ }
+}
+
+void Mpegtoraw::layer3getscalefactors_2(int ch)
+{
+ static int sfbblockindex[6][3][4]=
+ {
+ {{ 6, 5, 5, 5},{ 9, 9, 9, 9},{ 6, 9, 9, 9}},
+ {{ 6, 5, 7, 3},{ 9, 9,12, 6},{ 6, 9,12, 6}},
+ {{11,10, 0, 0},{18,18, 0, 0},{15,18, 0, 0}},
+ {{ 7, 7, 7, 0},{12,12,12, 0},{ 6,15,12, 0}},
+ {{ 6, 6, 6, 3},{12, 9, 9, 6},{ 6,12, 9, 6}},
+ {{ 8, 8, 5, 0},{15,12, 9, 0},{ 6,18, 9, 0}}
+ };
+
+ int sb[54];
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[0]);
+ register layer3scalefactor *sf=(&scalefactors[ch]);
+
+ {
+ int blocktypenumber,sc;
+ int blocknumber;
+ int slen[4];
+
+ if(gi->block_type==2)blocktypenumber=1+gi->mixed_block_flag;
+ else blocktypenumber=0;
+
+ sc=gi->scalefac_compress;
+ if(!((extendedmode==1 || extendedmode==3) && (ch==1)))
+ {
+ if(sc<400)
+ {
+ slen[0]=(sc>>4)/5;
+ slen[1]=(sc>>4)%5;
+ slen[2]=(sc%16)>>2;
+ slen[3]=(sc%4);
+ gi->preflag=0;
+ blocknumber=0;
+ }
+ else if(sc<500)
+ {
+ sc-=400;
+ slen[0]=(sc>>2)/5;
+ slen[1]=(sc>>2)%5;
+ slen[2]=sc%4;
+ slen[3]=0;
+ gi->preflag=0;
+ blocknumber=1;
+ }
+ else // if(sc<512)
+ {
+ sc-=500;
+ slen[0]=sc/3;
+ slen[1]=sc%3;
+ slen[2]=0;
+ slen[3]=0;
+ gi->preflag=1;
+ blocknumber=2;
+ }
+ }
+ else
+ {
+ sc>>=1;
+ if(sc<180)
+ {
+ slen[0]=sc/36;
+ slen[1]=(sc%36)/6;
+ slen[2]=(sc%36)%6;
+ slen[3]=0;
+ gi->preflag=0;
+ blocknumber=3;
+ }
+ else if(sc<244)
+ {
+ sc-=180;
+ slen[0]=(sc%64)>>4;
+ slen[1]=(sc%16)>>2;
+ slen[2]=sc%4;
+ slen[3]=0;
+ gi->preflag=0;
+ blocknumber=4;
+ }
+ else // if(sc<255)
+ {
+ sc-=244;
+ slen[0]=sc/3;
+ slen[1]=sc%3;
+ slen[2]=
+ slen[3]=0;
+ gi->preflag=0;
+ blocknumber=5;
+ }
+ }
+
+ {
+ int i,j,k,*si;
+
+ si=sfbblockindex[blocknumber][blocktypenumber];
+ for(i=0;i<45;i++)sb[i]=0;
+
+ for(k=i=0;i<4;i++)
+ for(j=0;j<si[i];j++,k++)
+ if(slen[i]==0)sb[k]=0;
+ else sb[k]=wgetbits(slen[i]);
+ }
+ }
+
+
+ {
+ int sfb,window;
+ int k=0;
+
+ if(gi->window_switching_flag && (gi->block_type==2))
+ {
+ if(gi->mixed_block_flag)
+ {
+ for(sfb=0;sfb<8;sfb++)sf->l[sfb]=sb[k++];
+ sfb=3;
+ }
+ else sfb=0;
+
+ for(;sfb<12;sfb++)
+ for(window=0;window<3;window++)
+ sf->s[window][sfb]=sb[k++];
+
+ sf->s[0][12]=sf->s[1][12]=sf->s[2][12]=0;
+ }
+ else
+ {
+ for(sfb=0;sfb<21;sfb++)
+ sf->l[sfb]=sb[k++];
+ sf->l[21]=sf->l[22]=0;
+ }
+ }
+}
+
+
+typedef unsigned int HUFFBITS;
+#define MXOFF 250
+
+/* do the huffman-decoding */
+/* note! for counta,countb -the 4 bit value is returned in y, discard x */
+// Huffman decoder for tablename<32
+ASK_INLINE void Mpegtoraw::huffmandecoder_1(const HUFFMANCODETABLE *h,int *x,int *y)
+{
+ HUFFBITS level=(1<<(sizeof(HUFFBITS)*8-1));
+ int point=0;
+
+ /* Lookup in Huffman table. */
+ for(;;)
+ {
+ if(h->val[point][0]==0)
+ { /*end of tree*/
+ int xx,yy;
+
+ xx=h->val[point][1]>>4;
+ yy=h->val[point][1]&0xf;
+
+ if(h->linbits)
+ {
+ if((h->xlen)==(unsigned)xx)xx+=wgetbits(h->linbits);
+ if(xx)if(wgetbit())xx=-xx;
+ if((h->ylen)==(unsigned)yy)yy+=wgetbits(h->linbits);
+ if(yy)if(wgetbit())yy=-yy;
+ }
+ else
+ {
+ if(xx)if(wgetbit())xx=-xx;
+ if(yy)if(wgetbit())yy=-yy;
+ }
+ *x=xx;*y=yy;
+ break;
+ }
+
+ point+=h->val[point][wgetbit()];
+
+ level>>=1;
+ if(!(level || ((unsigned)point<ht->treelen)))
+ {
+ register int xx,yy;
+
+ xx=(h->xlen<<1);// set x and y to a medium value as a simple concealment
+ yy=(h->ylen<<1);
+
+ // h->xlen and h->ylen can't be 1 under tablename 32
+ // if(xx)
+ if(wgetbit())xx=-xx;
+ // if(yy)
+ if(wgetbit())yy=-yy;
+
+ *x=xx;*y=yy;
+ break;
+ }
+ }
+}
+
+// Huffman decoder tablenumber>=32
+ASK_INLINE void Mpegtoraw::huffmandecoder_2(const HUFFMANCODETABLE *h,
+ int *x,int *y,int *v,int *w)
+{
+ HUFFBITS level=(1<<(sizeof(HUFFBITS)*8-1));
+ int point=0;
+
+ /* Lookup in Huffman table. */
+ for(;;)
+ {
+ if(h->val[point][0]==0)
+ { /*end of tree*/
+ register int t=h->val[point][1];
+
+ if(t&8)*v=1-(wgetbit()<<1); else *v=0;
+ if(t&4)*w=1-(wgetbit()<<1); else *w=0;
+ if(t&2)*x=1-(wgetbit()<<1); else *x=0;
+ if(t&1)*y=1-(wgetbit()<<1); else *y=0;
+ break;
+ }
+ point+=h->val[point][wgetbit()];
+ level>>=1;
+ if(!(level || ((unsigned)point<ht->treelen)))
+ {
+ *v=1-(wgetbit()<<1);
+ *w=1-(wgetbit()<<1);
+ *x=1-(wgetbit()<<1);
+ *y=1-(wgetbit()<<1);
+ break;
+ }
+ }
+}
+
+typedef struct
+{
+ int l[23];
+ int s[14];
+}SFBANDINDEX;
+
+static SFBANDINDEX sfBandIndextable[2][3]=
+{
+ // MPEG 1
+ {{{0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576},
+ {0,4,8,12,16,22,30,40,52,66,84,106,136,192}},
+ {{0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576},
+ {0,4,8,12,16,22,28,38,50,64,80,100,126,192}},
+ {{0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
+ {0,4,8,12,16,22,30,42,58,78,104,138,180,192}}},
+
+ // MPEG 2
+ {{{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
+ {0,4,8,12,18,24,32,42,56,74,100,132,174,192}},
+ {{0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,330,394,464,540,576},
+ {0,4,8,12,18,26,36,48,62,80,104,136,180,192}},
+ {{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
+ {0,4,8,12,18,26,36,48,62,80,104,134,174,192}}}
+};
+
+
+void Mpegtoraw::layer3huffmandecode(int ch,int gr,int out[SBLIMIT][SSLIMIT])
+{
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]);
+ int part2_3_end=layer3part2start+(gi->part2_3_length);
+ int region1Start,region2Start;
+ int i,e=gi->big_values<<1;
+
+ /* Find region boundary for short block case. */
+ if(gi->generalflag)
+ {
+ /* Region2. */
+ region1Start=36; /* sfb[9/3]*3=36 */
+ region2Start=576;/* No Region2 for short block case. */
+ }
+ else
+ { /* Find region boundary for long block case. */
+ region1Start=sfBandIndextable[version][frequency].l[gi->region0_count+1];
+ region2Start=sfBandIndextable[version][frequency].l[gi->region0_count+
+ gi->region1_count+2];
+ }
+
+ /* Read bigvalues area. */
+ for(i=0;i<e;)
+ {
+ const HUFFMANCODETABLE *h;
+ register int end;
+
+ if (i<region1Start)
+ {
+ h=&ht[gi->table_select[0]];
+ if(region1Start>e)end=e; else end=region1Start;
+ }
+ else if(i<region2Start)
+ {
+ h=&ht[gi->table_select[1]];
+ if(region2Start>e)end=e; else end=region2Start;
+ }
+ else
+ {
+ h=&ht[gi->table_select[2]];
+ end=e;
+ }
+
+ if(h->treelen)
+ while(i<end)
+ {
+ huffmandecoder_1(h,&out[0][i],&out[0][i+1]);
+ i+=2;
+ }
+ else
+ for(;i<end;i+=2)
+ out[0][i] =
+ out[0][i+1]=0;
+ }
+
+ /* Read count1 area. */
+ const HUFFMANCODETABLE *h=&ht[gi->count1table_select+32];
+ while(bitwindow.gettotalbit()<part2_3_end)
+ {
+ huffmandecoder_2(h,&out[0][i+2],&out[0][i+3],
+ &out[0][i ],&out[0][i+1]);
+ i+=4;
+
+ if(i>=ARRAYSIZE)
+ {
+ bitwindow.rewind(bitwindow.gettotalbit()-part2_3_end);
+ return;
+ }
+ }
+
+ for(;i<ARRAYSIZE;i++)out[0][i]=0;
+ bitwindow.rewind(bitwindow.gettotalbit()-part2_3_end);
+}
+
+
+static int pretab[22]={0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0};
+
+ASK_INLINE REAL Mpegtoraw::layer3twopow2(int scale,int preflag,
+ int pretab_offset,int l)
+{
+ int index=l;
+
+ if(preflag)index+=pretab_offset;
+ return(two_to_negative_half_pow[index<<scale]);
+}
+
+ASK_INLINE REAL Mpegtoraw::layer3twopow2_1(int a,int b,int c)
+{
+ return POW2_1[a][b][c];
+}
+
+void Mpegtoraw::layer3dequantizesample(int ch,int gr,
+ int in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT])
+{
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]);
+ SFBANDINDEX *sfBandIndex=&(sfBandIndextable[version][frequency]);
+ REAL globalgain=POW2[gi->global_gain];
+ REAL *TO_FOUR_THIRDS=TO_FOUR_THIRDSTABLE+FOURTHIRDSTABLENUMBER;
+
+ /* choose correct scalefactor band per block type, initalize boundary */
+ /* and apply formula per block type */
+
+ if(!gi->generalflag)
+ { /* LONG blocks: 0,1,3 */
+ int next_cb_boundary;
+ int cb=-1,index=0;
+ REAL factor;
+
+ do
+ {
+ next_cb_boundary=sfBandIndex->l[(++cb)+1];
+ factor=globalgain*
+ layer3twopow2(gi->scalefac_scale,gi->preflag,
+ pretab[cb],scalefactors[ch].l[cb]);
+ for(;index<next_cb_boundary;)
+ {
+ out[0][index]=factor*TO_FOUR_THIRDS[in[0][index]];index++;
+ out[0][index]=factor*TO_FOUR_THIRDS[in[0][index]];index++;
+ }
+ }while(index<ARRAYSIZE);
+ }
+ else if(!gi->mixed_block_flag)
+ {
+ int cb=0,index=0;
+ int cb_width;
+
+ do
+ {
+ cb_width=(sfBandIndex->s[cb+1]-sfBandIndex->s[cb])>>1;
+
+ for(register int k=0;k<3;k++)
+ {
+ register REAL factor;
+ register int count=cb_width;
+
+ factor=globalgain*
+ layer3twopow2_1(gi->subblock_gain[k],gi->scalefac_scale,
+ scalefactors[ch].s[k][cb]);
+ do{
+ out[0][index]=factor*TO_FOUR_THIRDS[in[0][index]];index++;
+ out[0][index]=factor*TO_FOUR_THIRDS[in[0][index]];index++;
+ }while(--count);
+ }
+ cb++;
+ }while(index<ARRAYSIZE);
+ }
+ else
+ {
+ int cb_begin=0,cb_width=0;
+ int cb=0;
+ int next_cb_boundary=sfBandIndex->l[1]; /* LONG blocks: 0,1,3 */
+ int index;
+
+ /* Compute overall (global) scaling. */
+ {
+ for(int sb=0;sb<SBLIMIT;sb++)
+ {
+ int *i=in[sb];
+ REAL *o=out[sb];
+
+ o[ 0]=globalgain*TO_FOUR_THIRDS[i[ 0]];o[ 1]=globalgain*TO_FOUR_THIRDS[i[ 1]];
+ o[ 2]=globalgain*TO_FOUR_THIRDS[i[ 2]];o[ 3]=globalgain*TO_FOUR_THIRDS[i[ 3]];
+ o[ 4]=globalgain*TO_FOUR_THIRDS[i[ 4]];o[ 5]=globalgain*TO_FOUR_THIRDS[i[ 5]];
+ o[ 6]=globalgain*TO_FOUR_THIRDS[i[ 6]];o[ 7]=globalgain*TO_FOUR_THIRDS[i[ 7]];
+ o[ 8]=globalgain*TO_FOUR_THIRDS[i[ 8]];o[ 9]=globalgain*TO_FOUR_THIRDS[i[ 9]];
+ o[10]=globalgain*TO_FOUR_THIRDS[i[10]];o[11]=globalgain*TO_FOUR_THIRDS[i[11]];
+ o[12]=globalgain*TO_FOUR_THIRDS[i[12]];o[13]=globalgain*TO_FOUR_THIRDS[i[13]];
+ o[14]=globalgain*TO_FOUR_THIRDS[i[14]];o[15]=globalgain*TO_FOUR_THIRDS[i[15]];
+ o[16]=globalgain*TO_FOUR_THIRDS[i[16]];o[17]=globalgain*TO_FOUR_THIRDS[i[17]];
+ }
+ }
+
+ for(index=0;index<SSLIMIT*2;index++)
+ {
+ if(index==next_cb_boundary)
+ {
+ if(index==sfBandIndex->l[8])
+ {
+ next_cb_boundary=sfBandIndex->s[4];
+ next_cb_boundary=MUL3(next_cb_boundary);
+ cb=3;
+ cb_width=sfBandIndex->s[4]-sfBandIndex->s[3];
+ cb_begin=sfBandIndex->s[3];
+ cb_begin=MUL3(cb_begin);
+ }
+ else if(index<sfBandIndex->l[8])
+ next_cb_boundary=sfBandIndex->l[(++cb)+1];
+ else
+ {
+ next_cb_boundary=sfBandIndex->s[(++cb)+1];
+ next_cb_boundary=MUL3(next_cb_boundary);
+ cb_begin=sfBandIndex->s[cb];
+ cb_width=sfBandIndex->s[cb+1]-cb_begin;
+ cb_begin=MUL3(cb_begin);
+ }
+ }
+ /* LONG block types 0,1,3 & 1st 2 subbands of switched blocks */
+ out[0][index]*=layer3twopow2(gi->scalefac_scale,gi->preflag,
+ pretab[cb],scalefactors[ch].l[cb]);
+ }
+
+ for(;index<ARRAYSIZE;index++)
+ {
+ if(index==next_cb_boundary)
+ {
+ if(index==sfBandIndex->l[8])
+ {
+ next_cb_boundary=sfBandIndex->s[4];
+ next_cb_boundary=MUL3(next_cb_boundary);
+ cb=3;
+ cb_width=sfBandIndex->s[4]-sfBandIndex->s[3];
+ cb_begin=sfBandIndex->s[3];
+ cb_begin=(cb_begin<<2)-cb_begin;
+ }
+ else if(index<sfBandIndex->l[8])
+ next_cb_boundary=sfBandIndex->l[(++cb)+1];
+ else
+ {
+ next_cb_boundary=sfBandIndex->s[(++cb)+1];
+ next_cb_boundary=MUL3(next_cb_boundary);
+ cb_begin=sfBandIndex->s[cb];
+ cb_width=sfBandIndex->s[cb+1]-cb_begin;
+ cb_begin=MUL3(cb_begin);
+ }
+ }
+ {
+ int t_index=(index-cb_begin)/cb_width;
+ out[0][index]*=layer3twopow2_1(gi->subblock_gain[t_index],
+ gi->scalefac_scale,
+ scalefactors[ch].s[t_index][cb]);
+ }
+ }
+ }
+}
+
+ASK_INLINE void Mpegtoraw::layer3fixtostereo(int gr,REAL in[2][SBLIMIT][SSLIMIT])
+{
+ layer3grinfo *gi=&(sideinfo.ch[0].gr[gr]);
+ SFBANDINDEX *sfBandIndex=&(sfBandIndextable[version][frequency]);
+
+ int ms_stereo=(mode==joint) && (extendedmode & 0x2);
+ int i_stereo =(mode==joint) && (extendedmode & 0x1);
+
+ if(!inputstereo)
+ { /* mono , bypass xr[0][][] to lr[0][][]*/
+ // memcpy(out[0][0],in[0][0],ARRAYSIZE*REALSIZE);
+ return;
+ }
+
+ if(i_stereo)
+ {
+ int i;
+ int is_pos[ARRAYSIZE];
+ RATIOS is_ratio[ARRAYSIZE];
+ RATIOS *ratios;
+
+ if(version)ratios=rat_2[gi->scalefac_compress%2];
+ else ratios=rat_1;
+
+ /* initialization */
+ for(i=0;i<ARRAYSIZE;i+=2)is_pos[i]=is_pos[i+1]=7;
+
+ if(gi->generalflag)
+ {
+ if(gi->mixed_block_flag) // Part I
+ {
+ int max_sfb=0;
+
+ for(int j=0;j<3;j++)
+ {
+ int sfb,sfbcnt=2;
+
+ for(sfb=12;sfb>=3;sfb--)
+ {
+ int lines;
+
+ i=sfBandIndex->s[sfb];
+ lines=sfBandIndex->s[sfb+1]-i;
+ i=MUL3(i)+(j+1)*lines-1;
+ for(;lines>0;lines--,i--)
+ if(in[1][0][i]!=0.0f)
+ {
+ sfbcnt=sfb;
+ sfb=0;break; // quit loop
+ }
+ }
+ sfb=sfbcnt+1;
+
+ if(sfb>max_sfb)max_sfb=sfb;
+
+ for(;sfb<12;sfb++)
+ {
+ int k,t;
+
+ t=sfBandIndex->s[sfb];
+ k=sfBandIndex->s[sfb+1]-t;
+ i=MUL3(t)+j*k;
+
+ t=scalefactors[1].s[j][sfb];
+ if(t!=7)
+ {
+ RATIOS r=ratios[t];
+
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else
+ for(;k>0;k--,i++)is_pos[i]=t;
+ }
+ sfb=sfBandIndex->s[10];
+ sfb=MUL3(sfb)+j*(sfBandIndex->s[11]-sfb);
+
+ {
+ int k,t;
+
+ t=sfBandIndex->s[11];
+ k=sfBandIndex->s[12]-t;
+ i=MUL3(t)+j*k;
+
+ t=is_pos[sfb];
+ if(t!=7)
+ {
+ RATIOS r=is_ratio[sfb];
+
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else
+ for(;k>0;k--,i++)is_pos[i]=t;
+ }
+ }
+
+ if(max_sfb<=3)
+ {
+ {
+ REAL temp;
+ int k;
+
+ temp=in[1][0][0];in[1][0][0]=1.0;
+ for(k=3*SSLIMIT-1;in[1][0][k]==0.0;k--);
+ in[1][0][0]=temp;
+ for(i=0;sfBandIndex->l[i]<=k;i++);
+ }
+ {
+ int sfb=i;
+
+ i=sfBandIndex->l[i];
+ for(;sfb<8;sfb++)
+ {
+ int t=scalefactors[1].l[sfb];
+ int k=sfBandIndex->l[sfb+1]-sfBandIndex->l[sfb];
+
+ if(t!=7)
+ {
+ RATIOS r=ratios[t];
+
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else for(;k>0;k--,i++)is_pos[i]=t;
+ }
+ }
+ }
+ }
+ else // Part II
+ {
+ for(int j=0;j<3;j++)
+ {
+ int sfbcnt=-1;
+
+ for(int sfb=12;sfb>=0;sfb--)
+ {
+ int lines;
+
+ {
+ int t;
+
+ t=sfBandIndex->s[sfb];
+ lines=sfBandIndex->s[sfb+1]-t;
+ i=MUL3(t)+(j+1)*lines-1;
+ }
+
+ for(;lines>0;lines--,i--)
+ if(in[1][0][i]!=0.0f)
+ {
+ sfbcnt=sfb;
+ sfb=0;break; // quit loop
+ }
+ }
+
+ for(int sfb=sfbcnt+1;sfb<12;sfb++)
+ {
+ int k,t;
+
+ t=sfBandIndex->s[sfb];
+ k=sfBandIndex->s[sfb+1]-t;
+ i=MUL3(t)+j*k;
+
+ t=scalefactors[1].s[j][sfb];
+ if(t!=7)
+ {
+ RATIOS r=ratios[t];
+
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else for(;k>0;k--,i++)is_pos[i]=t;
+ }
+
+ {
+ int t1=sfBandIndex->s[10],
+ t2=sfBandIndex->s[11];
+ int k,tt;
+
+ tt=MUL3(t1)+j*(t2-t1);
+ k =sfBandIndex->s[12]-t2;
+ if(is_pos[tt]!=7)
+ {
+ RATIOS r=is_ratio[tt];
+ int t=is_pos[tt];
+
+ i =MUL3(t1)+j*k;
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else
+ for(;k>0;k--,i++)is_pos[i]=7;
+ }
+ }
+ }
+ }
+ else // ms-stereo (Part III)
+ {
+ {
+ REAL temp;
+ int k;
+
+ temp=in[1][0][0];in[1][0][0]=1.0;
+ for(k=ARRAYSIZE-1;in[1][0][k]==0.0;k--);
+ in[1][0][0]=temp;
+ for(i=0;sfBandIndex->l[i]<=k;i++);
+ }
+
+ {
+ int sfb;
+
+ sfb=i;
+ i=sfBandIndex->l[i];
+ for(;sfb<21;sfb++)
+ {
+ int k,t;
+
+ k=sfBandIndex->l[sfb+1]-sfBandIndex->l[sfb];
+ t=scalefactors[1].l[sfb];
+ if(t!=7)
+ {
+ RATIOS r=ratios[t];
+
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else
+ for(;k>0;k--,i++)is_pos[i]=t;
+ }
+ }
+
+ {
+ int k,t,tt;
+
+ tt=sfBandIndex->l[20];
+ k=576-sfBandIndex->l[21];
+ t=is_pos[tt];
+ if(t!=7)
+ {
+ RATIOS r=is_ratio[tt];
+
+ for(;k>0;k--,i++){
+ is_pos[i]=t;is_ratio[i]=r;}
+ }
+ else
+ for(;k>0;k--,i++)is_pos[i]=t;
+ }
+ }
+
+ if(ms_stereo)
+ {
+ i=ARRAYSIZE-1;
+ do{
+ if(is_pos[i]==7)
+ {
+ register REAL t=in[LS][0][i];
+ in[LS][0][i]=(t+in[RS][0][i])*0.7071068f;
+ in[RS][0][i]=(t-in[RS][0][i])*0.7071068f;
+ }
+ else
+ {
+ in[RS][0][i]=in[LS][0][i]*is_ratio[i].r;
+ in[LS][0][i]*=is_ratio[i].l;
+ }
+ }while(i--);
+ }
+ else
+ {
+ i=ARRAYSIZE-1;
+ do{
+ if(is_pos[i]!=7)
+ {
+ in[RS][0][i]=in[LS][0][i]*is_ratio[i].r;
+ in[LS][0][i]*=is_ratio[i].l;
+ }
+ }while(i--);
+ }
+ }
+ else
+ {
+ if(ms_stereo)
+ {
+ int i=ARRAYSIZE-1;
+ do{
+ register REAL t=in[LS][0][i];
+
+ in[LS][0][i]=(t+in[RS][0][i])*0.7071068f;
+ in[RS][0][i]=(t-in[RS][0][i])*0.7071068f;
+ }while(i--);
+ }
+ }
+
+ // channels==2
+}
+
+ASK_INLINE void layer3reorder_1(int version,int frequency,
+ REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT])
+{
+ SFBANDINDEX *sfBandIndex=&(sfBandIndextable[version][frequency]);
+ int sfb,sfb_start,sfb_lines;
+
+ /* NO REORDER FOR LOW 2 SUBBANDS */
+ out[0][ 0]=in[0][ 0];out[0][ 1]=in[0][ 1];out[0][ 2]=in[0][ 2];
+ out[0][ 3]=in[0][ 3];out[0][ 4]=in[0][ 4];out[0][ 5]=in[0][ 5];
+ out[0][ 6]=in[0][ 6];out[0][ 7]=in[0][ 7];out[0][ 8]=in[0][ 8];
+ out[0][ 9]=in[0][ 9];out[0][10]=in[0][10];out[0][11]=in[0][11];
+ out[0][12]=in[0][12];out[0][13]=in[0][13];out[0][14]=in[0][14];
+ out[0][15]=in[0][15];out[0][16]=in[0][16];out[0][17]=in[0][17];
+
+ out[1][ 0]=in[1][ 0];out[1][ 1]=in[1][ 1];out[1][ 2]=in[1][ 2];
+ out[1][ 3]=in[1][ 3];out[1][ 4]=in[1][ 4];out[1][ 5]=in[1][ 5];
+ out[1][ 6]=in[1][ 6];out[1][ 7]=in[1][ 7];out[1][ 8]=in[1][ 8];
+ out[1][ 9]=in[1][ 9];out[1][10]=in[1][10];out[1][11]=in[1][11];
+ out[1][12]=in[1][12];out[1][13]=in[1][13];out[1][14]=in[1][14];
+ out[1][15]=in[1][15];out[1][16]=in[1][16];out[1][17]=in[1][17];
+
+
+ /* REORDERING FOR REST SWITCHED SHORT */
+ for(sfb=3,sfb_start=sfBandIndex->s[3],
+ sfb_lines=sfBandIndex->s[4]-sfb_start;
+ sfb<13;
+ sfb++,sfb_start=sfBandIndex->s[sfb],
+ (sfb_lines=sfBandIndex->s[sfb+1]-sfb_start))
+ {
+ for(int freq=0;freq<sfb_lines;freq++)
+ {
+ int src_line=sfb_start+(sfb_start<<1)+freq;
+ int des_line=src_line+(freq<<1);
+ out[0][des_line ]=in[0][src_line ];
+ out[0][des_line+1]=in[0][src_line+sfb_lines ];
+ out[0][des_line+2]=in[0][src_line+(sfb_lines<<1)];
+ }
+ }
+}
+
+ASK_INLINE void layer3reorder_2(int version,int frequency,REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT])
+{
+ SFBANDINDEX *sfBandIndex=&(sfBandIndextable[version][frequency]);
+ int sfb,sfb_start,sfb_lines;
+
+ for(sfb=0,sfb_start=0,sfb_lines=sfBandIndex->s[1];
+ sfb<13;
+ sfb++,sfb_start=sfBandIndex->s[sfb],
+ (sfb_lines=sfBandIndex->s[sfb+1]-sfb_start))
+ {
+ for(int freq=0;freq<sfb_lines;freq++)
+ {
+ int src_line=sfb_start+(sfb_start<<1)+freq;
+ int des_line=src_line+(freq<<1);
+
+ out[0][des_line ]=in[0][src_line ];
+ out[0][des_line+1]=in[0][src_line+sfb_lines ];
+ out[0][des_line+2]=in[0][src_line+(sfb_lines<<1)];
+ }
+ }
+}
+
+
+ASK_INLINE void layer3antialias_1(REAL in[SBLIMIT][SSLIMIT])
+{
+ for(int ss=0;ss<8;ss++)
+ {
+ REAL bu,bd; /* upper and lower butterfly inputs */
+
+ bu=in[0][17-ss];bd=in[1][ss];
+ in[0][17-ss]=(bu*cs[ss])-(bd*ca[ss]);
+ in[1][ss] =(bd*cs[ss])+(bu*ca[ss]);
+ }
+}
+
+ASK_INLINE
+void layer3antialias_2(REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT])
+{
+ out[0][0]=in[0][0];out[0][1]=in[0][1];
+ out[0][2]=in[0][2];out[0][3]=in[0][3];
+ out[0][4]=in[0][4];out[0][5]=in[0][5];
+ out[0][6]=in[0][6];out[0][7]=in[0][7];
+
+ for(int index=SSLIMIT;index<=(SBLIMIT-1)*SSLIMIT;index+=SSLIMIT)
+ {
+ for(int n=0;n<8;n++)
+ {
+ REAL bu,bd;
+
+ bu=in[0][index-n-1];bd=in[0][index+n];
+ out[0][index-n-1]=(bu*cs[n])-(bd*ca[n]);
+ out[0][index+n ]=(bd*cs[n])+(bu*ca[n]);
+ }
+ out[0][index-SSLIMIT+8]=in[0][index-SSLIMIT+8];
+ out[0][index-SSLIMIT+9]=in[0][index-SSLIMIT+9];
+ }
+
+ out[31][ 8]=in[31][ 8];out[31][ 9]=in[31][ 9];
+ out[31][10]=in[31][10];out[31][11]=in[31][11];
+ out[31][12]=in[31][12];out[31][13]=in[31][13];
+ out[31][14]=in[31][14];out[31][15]=in[31][15];
+ out[31][16]=in[31][16];out[31][17]=in[31][17];
+}
+
+void Mpegtoraw::layer3reorderandantialias(int ch,int gr,
+ REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SBLIMIT][SSLIMIT])
+{
+ register layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]);
+
+ if(gi->generalflag)
+ {
+ if(gi->mixed_block_flag)
+ {
+ fprintf(stderr,"Notchecked!");
+ layer3reorder_1 (version,frequency,in,out); // Not checked...
+ layer3antialias_1(out);
+ }
+ else
+ layer3reorder_2(version,frequency,in,out);
+ }
+ else
+ layer3antialias_2(in,out);
+}
+
+static void dct36(REAL *inbuf,REAL *prevblk1,REAL *prevblk2,REAL *wi,REAL *out)
+{
+#define MACRO0(v) { \
+ REAL tmp; \
+ out2[9+(v)]=(tmp=sum0+sum1)*wi[27+(v)]; \
+ out2[8-(v)]=tmp * wi[26-(v)]; } \
+ sum0-=sum1; \
+ ts[SBLIMIT*(8-(v))]=out1[8-(v)]+sum0*wi[8-(v)]; \
+ ts[SBLIMIT*(9+(v))]=out1[9+(v)]+sum0*wi[9+(v)];
+#define MACRO1(v) { \
+ REAL sum0,sum1; \
+ sum0=tmp1a+tmp2a; \
+ sum1=(tmp1b+tmp2b)*hsec_36[(v)]; \
+ MACRO0(v); }
+#define MACRO2(v) { \
+ REAL sum0,sum1; \
+ sum0=tmp2a-tmp1a; \
+ sum1=(tmp2b-tmp1b) * hsec_36[(v)]; \
+ MACRO0(v); }
+
+ {
+ register REAL *in = inbuf;
+
+ in[17]+=in[16];in[16]+=in[15];in[15]+=in[14];in[14]+=in[13];
+ in[13]+=in[12];in[12]+=in[11];in[11]+=in[10];in[10]+=in[ 9];
+ in[ 9]+=in[ 8];in[ 8]+=in[ 7];in[ 7]+=in[ 6];in[ 6]+=in[ 5];
+ in[ 5]+=in[ 4];in[ 4]+=in[ 3];in[ 3]+=in[ 2];in[ 2]+=in[ 1];
+ in[ 1]+=in[ 0];
+
+ in[17]+=in[15];in[15]+=in[13];in[13]+=in[11];in[11]+=in[ 9];
+ in[ 9]+=in[ 7];in[7] +=in[ 5];in[ 5]+=in[ 3];in[ 3]+=in[ 1];
+
+ {
+ register REAL *c = cos_18;
+ register REAL *out2 = prevblk2;
+ register REAL *out1 = prevblk1;
+ register REAL *ts = out;
+
+ REAL ta33,ta66,tb33,tb66;
+
+ ta33=in[2*3+0]*c[3];
+ ta66=in[2*6+0]*c[6];
+ tb33=in[2*3+1]*c[3];
+ tb66=in[2*6+1]*c[6];
+
+ {
+ REAL tmp1a,tmp2a,tmp1b,tmp2b;
+ tmp1a= in[2*1+0]*c[1]+ta33 +in[2*5+0]*c[5]+in[2*7+0]*c[7];
+ tmp1b= in[2*1+1]*c[1]+tb33 +in[2*5+1]*c[5]+in[2*7+1]*c[7];
+ tmp2a=in[2*0+0]+in[2*2+0]*c[2]+in[2*4+0]*c[4]+ta66 +in[2*8+0]*c[8];
+ tmp2b=in[2*0+1]+in[2*2+1]*c[2]+in[2*4+1]*c[4]+tb66 +in[2*8+1]*c[8];
+ MACRO1(0);
+ MACRO2(8);
+ }
+
+ {
+ REAL tmp1a,tmp2a,tmp1b,tmp2b;
+ tmp1a=(in[2*1+0]-in[2*5+0]-in[2*7+0])*c[3];
+ tmp1b=(in[2*1+1]-in[2*5+1]-in[2*7+1])*c[3];
+ tmp2a=(in[2*2+0]-in[2*4+0]-in[2*8+0])*c[6]-in[2*6+0]+in[2*0+0];
+ tmp2b=(in[2*2+1]-in[2*4+1]-in[2*8+1])*c[6]-in[2*6+1]+in[2*0+1];
+ MACRO1(1);
+ MACRO2(7);
+ }
+
+ {
+ REAL tmp1a,tmp2a,tmp1b,tmp2b;
+ tmp1a= in[2*1+0]*c[5]-ta33 -in[2*5+0]*c[7]+in[2*7+0]*c[1];
+ tmp1b= in[2*1+1]*c[5]-tb33 -in[2*5+1]*c[7]+in[2*7+1]*c[1];
+ tmp2a=in[2*0+0]-in[2*2+0]*c[8]-in[2*4+0]*c[2]+ta66 +in[2*8+0]*c[4];
+ tmp2b=in[2*0+1]-in[2*2+1]*c[8]-in[2*4+1]*c[2]+tb66 +in[2*8+1]*c[4];
+ MACRO1(2);
+ MACRO2(6);
+ }
+
+ {
+ REAL tmp1a,tmp2a,tmp1b,tmp2b;
+ tmp1a= in[2*1+0]*c[7]-ta33 +in[2*5+0]*c[1]-in[2*7+0]*c[5];
+ tmp1b= in[2*1+1]*c[7]-tb33 +in[2*5+1]*c[1]-in[2*7+1]*c[5];
+ tmp2a=in[2*0+0]-in[2*2+0]*c[4]+in[2*4+0]*c[8]+ta66 -in[2*8+0]*c[2];
+ tmp2b=in[2*0+1]-in[2*2+1]*c[4]+in[2*4+1]*c[8]+tb66 -in[2*8+1]*c[2];
+ MACRO1(3);
+ MACRO2(5);
+ }
+
+ {
+ REAL sum0,sum1;
+ sum0= in[2*0+0]-in[2*2+0]+in[2*4+0]-in[2*6+0]+in[2*8+0];
+ sum1=(in[2*0+1]-in[2*2+1]+in[2*4+1]-in[2*6+1]+in[2*8+1])*hsec_36[4];
+ MACRO0(4);
+ }
+ }
+ }
+}
+
+
+static void dct12(REAL *in,REAL *prevblk1,REAL *prevblk2,register REAL *wi,register REAL *out)
+{
+#define DCT12_PART1 \
+ in5=in[5*3]; \
+ in5+=(in4=in[4*3]); \
+ in4+=(in3=in[3*3]); \
+ in3+=(in2=in[2*3]); \
+ in2+=(in1=in[1*3]); \
+ in1+=(in0=in[0*3]); \
+ \
+ in5+=in3;in3+=in1; \
+ \
+ in2*=cos1_6; \
+ in3*=cos1_6;
+
+#define DCT12_PART2 \
+ in0+=in4*cos2_6; \
+ \
+ in4=in0+in2; \
+ in0-=in2; \
+ \
+ in1+=in5*cos2_6; \
+ \
+ in5=(in1+in3)*hsec_12[0]; \
+ in1=(in1-in3)*hsec_12[2]; \
+ \
+ in3=in4+in5; \
+ in4-=in5; \
+ \
+ in2=in0+in1; \
+ in0-=in1;
+
+ {
+ REAL in0,in1,in2,in3,in4,in5;
+ register REAL *pb1=prevblk1;
+ out[SBLIMIT*0]=pb1[0];out[SBLIMIT*1]=pb1[1];out[SBLIMIT*2]=pb1[2];
+ out[SBLIMIT*3]=pb1[3];out[SBLIMIT*4]=pb1[4];out[SBLIMIT*5]=pb1[5];
+
+ DCT12_PART1;
+
+ {
+ REAL tmp0,tmp1=(in0-in4);
+ {
+ register REAL tmp2=(in1-in5)*hsec_12[1];
+ tmp0=tmp1+tmp2;
+ tmp1-=tmp2;
+ }
+ out[(17-1)*SBLIMIT]=pb1[17-1]+tmp0*wi[11-1];
+ out[(12+1)*SBLIMIT]=pb1[12+1]+tmp0*wi[ 6+1];
+ out[(6 +1)*SBLIMIT]=pb1[6 +1]+tmp1*wi[ 1 ];
+ out[(11-1)*SBLIMIT]=pb1[11-1]+tmp1*wi[ 5-1];
+ }
+
+ DCT12_PART2;
+ out[(17-0)*SBLIMIT]=pb1[17-0]+in2*wi[11-0];
+ out[(12+0)*SBLIMIT]=pb1[12+0]+in2*wi[ 6+0];
+ out[(12+2)*SBLIMIT]=pb1[12+2]+in3*wi[ 6+2];
+ out[(17-2)*SBLIMIT]=pb1[17-2]+in3*wi[11-2];
+
+ out[( 6+0)*SBLIMIT]=pb1[ 6+0]+in0*wi[0];
+ out[(11-0)*SBLIMIT]=pb1[11-0]+in0*wi[5-0];
+ out[( 6+2)*SBLIMIT]=pb1[ 6+2]+in4*wi[2];
+ out[(11-2)*SBLIMIT]=pb1[11-2]+in4*wi[5-2];
+ }
+
+ in++;
+ {
+ REAL in0,in1,in2,in3,in4,in5;
+ register REAL *pb2 = prevblk2;
+
+ DCT12_PART1;
+
+ {
+ REAL tmp0,tmp1=(in0-in4);
+ {
+ REAL tmp2=(in1-in5)*hsec_12[1];
+ tmp0=tmp1+tmp2;
+ tmp1-=tmp2;
+ }
+ pb2[5-1]=tmp0*wi[11-1];
+ pb2[0+1]=tmp0*wi[6+1];
+ out[(12+1)*SBLIMIT]+=tmp1*wi[1];
+ out[(17-1)*SBLIMIT]+=tmp1*wi[5-1];
+ }
+
+ DCT12_PART2;
+
+ pb2[5-0]=in2*wi[11-0];
+ pb2[0+0]=in2*wi[6+0];
+ pb2[0+2]=in3*wi[6+2];
+ pb2[5-2]=in3*wi[11-2];
+
+ out[(12+0)*SBLIMIT]+=in0*wi[0];
+ out[(17-0)*SBLIMIT]+=in0*wi[5-0];
+ out[(12+2)*SBLIMIT]+=in4*wi[2];
+ out[(17-2)*SBLIMIT]+=in4*wi[5-2];
+ }
+
+ in++;
+ {
+ REAL in0,in1,in2,in3,in4,in5;
+ register REAL *pb2 = prevblk2;
+ pb2[12]=pb2[13]=pb2[14]=pb2[15]=pb2[16]=pb2[17]=0.0;
+
+ DCT12_PART1;
+
+ {
+ REAL tmp0,tmp1=(in0-in4);
+ {
+ REAL tmp2=(in1-in5)*hsec_12[1];
+ tmp0=tmp1+tmp2;
+ tmp1-=tmp2;
+ }
+ pb2[11-1]=tmp0*wi[11-1];
+ pb2[ 6+1]=tmp0*wi[6+1];
+ pb2[ 0+1]+=tmp1*wi[1];
+ pb2[ 5-1]+=tmp1*wi[5-1];
+ }
+
+ DCT12_PART2;
+ pb2[11-0]=in2*wi[11-0];
+ pb2[ 6+0]=in2*wi[ 6+0];
+ pb2[ 6+2]=in3*wi[ 6+2];
+ pb2[11-2]=in3*wi[11-2];
+
+ pb2[ 0+0]+=in0*wi[0 ];
+ pb2[ 5-0]+=in0*wi[5-0];
+ pb2[ 0+2]+=in4*wi[2 ];
+ pb2[ 5-2]+=in4*wi[5-2];
+ }
+}
+
+void Mpegtoraw::layer3hybrid(int ch,int gr,REAL in[SBLIMIT][SSLIMIT],
+ REAL out[SSLIMIT][SBLIMIT])
+{
+ layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]);
+ int bt1,bt2;
+ REAL *prev1,*prev2;
+
+ prev1=prevblck[ch][currentprevblock][0];
+ prev2=prevblck[ch][currentprevblock^1][0];
+
+ bt1 = gi->mixed_block_flag ? 0 : gi->block_type;
+ bt2 = gi->block_type;
+
+ {
+ REAL *ci=(REAL *)in,
+ *co=(REAL *)out;
+ int i;
+
+ if(downfrequency)i=(SBLIMIT/2)-2;
+ else i=SBLIMIT-2;
+
+ if(bt2==2)
+ {
+ if(!bt1)
+ {
+ dct36(ci,prev1,prev2,win[0],co);
+ ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++;
+ dct36(ci,prev1,prev2,win[0],co);
+ }
+ else
+ {
+ dct12(ci,prev1,prev2,win[2],co);
+ ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++;
+ dct12(ci,prev1,prev2,win[2],co);
+ }
+
+ do{
+ ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++;
+ dct12(ci,prev1,prev2,win[2],co);
+ }while(--i);
+ }
+ else
+ {
+ dct36(ci,prev1,prev2,win[bt1],co);
+ ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++;
+ dct36(ci,prev1,prev2,win[bt1],co);
+
+ do
+ {
+ ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++;
+ dct36(ci,prev1,prev2,win[bt2],co);
+ }while(--i);
+ }
+ }
+}
+
+#define NEG(a) (a)=-(a)
+
+void Mpegtoraw::extractlayer3(void)
+{
+ if(version)
+ {
+ extractlayer3_2();
+ return;
+ }
+
+ {
+ int main_data_end,flush_main;
+ int bytes_to_discard;
+
+ layer3getsideinfo();
+
+ if(issync())
+ {
+ for(register int i=layer3slots;i>0;i--) // read main data.
+ bitwindow.putbyte(getbyte());
+ }
+ else
+ {
+ for(register int i=layer3slots;i>0;i--) // read main data.
+ bitwindow.putbyte(getbits8());
+ }
+
+ main_data_end=bitwindow.gettotalbit()>>3;// of previous frame
+
+ if((flush_main=(bitwindow.gettotalbit() & 0x7)))
+ {
+ bitwindow.forward(8-flush_main);
+ main_data_end++;
+ }
+
+ bytes_to_discard=layer3framestart-(main_data_end+sideinfo.main_data_begin);
+ if(main_data_end>WINDOWSIZE)
+ {
+ layer3framestart-=WINDOWSIZE;
+ bitwindow.rewind(WINDOWSIZE*8);
+ }
+
+ layer3framestart+=layer3slots;
+
+ bitwindow.wrap();
+
+ if(bytes_to_discard<0)return;
+ bitwindow.forward(bytes_to_discard<<3);
+ }
+
+ for(int gr=0;gr<2;gr++)
+ {
+ union
+ {
+ int is [SBLIMIT][SSLIMIT];
+ REAL hin [2][SBLIMIT][SSLIMIT];
+ }b1;
+ union
+ {
+ REAL ro [2][SBLIMIT][SSLIMIT];
+ REAL lr [2][SBLIMIT][SSLIMIT];
+ REAL hout [2][SSLIMIT][SBLIMIT];
+ }b2;
+
+
+ layer3part2start=bitwindow.gettotalbit();
+ layer3getscalefactors (LS,gr);
+ layer3huffmandecode (LS,gr ,b1.is);
+ layer3dequantizesample(LS,gr,b1.is,b2.ro[LS]);
+ if(inputstereo)
+ {
+ layer3part2start=bitwindow.gettotalbit();
+ layer3getscalefactors (RS,gr);
+ layer3huffmandecode (RS,gr ,b1.is);
+ layer3dequantizesample(RS,gr,b1.is,b2.ro[RS]);
+ }
+
+ layer3fixtostereo(gr,b2.ro); // b2.ro -> b2.lr
+
+ currentprevblock^=1;
+ layer3reorderandantialias(LS,gr,b2.lr[LS],b1.hin[LS]);
+ layer3hybrid (LS,gr,b1.hin[LS],b2.hout[LS]);
+ if(outputstereo)
+ {
+ layer3reorderandantialias(RS,gr,b2.lr[RS],b1.hin[RS]);
+ layer3hybrid (RS,gr,b1.hin[RS],b2.hout[RS]);
+
+ register int i=2*SSLIMIT*SBLIMIT-1;
+ do{
+ NEG(b2.hout[0][0][i ]);NEG(b2.hout[0][0][i- 2]);
+ NEG(b2.hout[0][0][i- 4]);NEG(b2.hout[0][0][i- 6]);
+ NEG(b2.hout[0][0][i- 8]);NEG(b2.hout[0][0][i-10]);
+ NEG(b2.hout[0][0][i-12]);NEG(b2.hout[0][0][i-14]);
+ NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]);
+ NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]);
+ NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]);
+ NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]);
+ }while((i-=2*SBLIMIT)>0);
+ }
+ else
+ {
+ register int i=SSLIMIT*SBLIMIT-1;
+ do{
+ NEG(b2.hout[0][0][i ]);NEG(b2.hout[0][0][i- 2]);
+ NEG(b2.hout[0][0][i- 4]);NEG(b2.hout[0][0][i- 6]);
+ NEG(b2.hout[0][0][i- 8]);NEG(b2.hout[0][0][i-10]);
+ NEG(b2.hout[0][0][i-12]);NEG(b2.hout[0][0][i-14]);
+ NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]);
+ NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]);
+ NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]);
+ NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]);
+ }while((i-=2*SBLIMIT)>0);
+ }
+
+ for(int ss=0;ss<SSLIMIT;ss++)
+ subbandsynthesis(b2.hout[LS][ss],b2.hout[RS][ss]);
+ }
+}
+
+void Mpegtoraw::extractlayer3_2(void)
+{
+ {
+ int main_data_end,flush_main;
+ int bytes_to_discard;
+
+ layer3getsideinfo_2();
+
+ if(issync())
+ {
+ for(register int i=layer3slots;i>0;i--) // read main data.
+ bitwindow.putbyte(getbyte());
+ }
+ else
+ {
+ for(register int i=layer3slots;i>0;i--) // read main data.
+ bitwindow.putbyte(getbits8());
+ }
+ bitwindow.wrap();
+
+ main_data_end=bitwindow.gettotalbit()>>3;// of previous frame
+
+ if((flush_main=(bitwindow.gettotalbit() & 0x7)))
+ {
+ bitwindow.forward(8-flush_main);
+ main_data_end++;
+ }
+
+ bytes_to_discard=layer3framestart-main_data_end-sideinfo.main_data_begin;
+ if(main_data_end>WINDOWSIZE)
+ {
+ layer3framestart-=WINDOWSIZE;
+ bitwindow.rewind(WINDOWSIZE*8);
+ }
+
+ layer3framestart+=layer3slots;
+
+ if(bytes_to_discard<0)return;
+ bitwindow.forward(bytes_to_discard<<3);
+ }
+
+ // for(int gr=0;gr<2;gr++)
+ {
+ union
+ {
+ int is [SBLIMIT][SSLIMIT];
+ REAL hin [2][SBLIMIT][SSLIMIT];
+ }b1;
+ union
+ {
+ REAL ro [2][SBLIMIT][SSLIMIT];
+ REAL lr [2][SBLIMIT][SSLIMIT];
+ REAL hout [2][SSLIMIT][SBLIMIT];
+ }b2;
+
+
+ layer3part2start=bitwindow.gettotalbit();
+ layer3getscalefactors_2(LS);
+ layer3huffmandecode (LS,0 ,b1.is);
+ layer3dequantizesample (LS,0,b1.is,b2.ro[LS]);
+ if(inputstereo)
+ {
+ layer3part2start=bitwindow.gettotalbit();
+ layer3getscalefactors_2(RS);
+ layer3huffmandecode (RS,0 ,b1.is);
+ layer3dequantizesample (RS,0,b1.is,b2.ro[RS]);
+ }
+
+ layer3fixtostereo(0,b2.ro); // b2.ro -> b2.lr
+
+ currentprevblock^=1;
+ layer3reorderandantialias(LS,0,b2.lr[LS],b1.hin[LS]);
+ layer3hybrid (LS,0,b1.hin[LS],b2.hout[LS]);
+ if(outputstereo)
+ {
+ layer3reorderandantialias(RS,0,b2.lr[RS],b1.hin[RS]);
+ layer3hybrid (RS,0,b1.hin[RS],b2.hout[RS]);
+
+ register int i=2*SSLIMIT*SBLIMIT-1;
+ do{
+ NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]);
+ NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]);
+ NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]);
+ NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]);
+ }while((i-=2*SBLIMIT)>0);
+ }
+ else
+ {
+ register int i=SSLIMIT*SBLIMIT-1;
+ do{
+ NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]);
+ NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]);
+ NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]);
+ NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]);
+ }while((i-=2*SBLIMIT)>0);
+ }
+
+ for(int ss=0;ss<SSLIMIT;ss++)
+ subbandsynthesis(b2.hout[LS][ss],b2.hout[RS][ss]);
+ }
+}
diff --git a/setedit/mp3/mpegsound/obj/delete.me b/setedit/mp3/mpegsound/obj/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/mp3/mpegsound/obj/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/mp3/mpegsound/osdisk.cc b/setedit/mp3/mpegsound/osdisk.cc
new file mode 100644
index 0000000..817ba31
--- /dev/null
+++ b/setedit/mp3/mpegsound/osdisk.cc
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <fcntl.h>
+
+#include "mpegsound.h"
+
+mode_t Mpegsound_DefaultCreateMode=0644;
+
+int Mpegsound_creat(const char *filename)
+{
+ #ifdef __DJGPP__
+ int oldmode=_fmode;
+ _fmode=O_BINARY;
+ #endif
+ int ret=creat(filename,Mpegsound_DefaultCreateMode);
+ #ifdef __DJGPP__
+ _fmode=oldmode;
+ #endif
+ return ret;
+}
+
+FILE *Mpegsound_fopenR(const char *filename)
+{
+ return fopen(filename,"rb");
+}
diff --git a/setedit/mp3/mpegsound/rawplayer.cc b/setedit/mp3/mpegsound/rawplayer.cc
new file mode 100644
index 0000000..e90e4c7
--- /dev/null
+++ b/setedit/mp3/mpegsound/rawplayer.cc
@@ -0,0 +1,599 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae [Linux code]
+ Allegro routines:
+ (C) 1998 by Ove Kaaven <ovek@arcticnet.no>
+ (C) 2000/2001 by Salvador E. Tropea <set@ieee.org>
+ Solaris routines:
+ (C) 2002 by Salvador E. Tropea <set@ieee.org>
+*/
+
+// Rawplayer.cc
+// Playing raw data with sound type.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef __linux__
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/soundcard.h>
+
+#include "mpegsound.h"
+
+/* IOCTL */
+#ifdef SOUND_VERSION
+#define IOCTL(a,b,c) ioctl(a,b,&c)
+#else
+#define IOCTL(a,b,c) (c = ioctl(a,b,c) )
+#endif
+
+char *Rawplayer::defaultdevice="/dev/dsp";
+
+/* Volume */
+int Rawplayer::setvolume(int volume)
+{
+ int handle;
+ int r;
+
+ handle=open("/dev/mixer",O_RDWR);
+
+ if(volume>100)volume=100;
+ if(volume>=0)
+ {
+ r=(volume<<8) | volume;
+
+ ioctl(handle,MIXER_WRITE(SOUND_MIXER_VOLUME),&r);
+ }
+ ioctl(handle,MIXER_READ(SOUND_MIXER_VOLUME),&r);
+
+ close(handle);
+
+ return (r&0xFF);
+}
+
+/*******************/
+/* Rawplayer class */
+/*******************/
+// Rawplayer class
+Rawplayer::~Rawplayer()
+{
+ close(audiohandle);
+}
+
+bool Rawplayer::initialize(char *filename)
+{
+ int flag;
+
+ rawbuffersize=0;
+ quota=0;
+
+ if((audiohandle=open(filename,O_WRONLY|O_NDELAY,0))==-1)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+
+ if((flag=fcntl(audiohandle,F_GETFL,0))<0)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+ flag&=~O_NDELAY;
+ if(fcntl(audiohandle,F_SETFL,flag)<0)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+
+ // The following value isn't used by SETEdit's strategy and looks like Jung
+ // took it wrong because the value seems to be the granularity (64 in my system).
+ audiobuffersize=0;
+ IOCTL(audiohandle,SNDCTL_DSP_GETBLKSIZE,audiobuffersize);
+ if(audiobuffersize<4 || audiobuffersize>65536)
+ return seterrorcode(SOUND_ERROR_DEVBADBUFFERSIZE);
+
+ return true;
+}
+
+void Rawplayer::abort(void)
+{
+ int a=0;
+
+ IOCTL(audiohandle,SNDCTL_DSP_RESET,a);
+}
+
+// Not used in SETEdit strategy
+int Rawplayer::getprocessed(void)
+{
+ audio_buf_info info;
+ int r;
+
+ IOCTL(audiohandle,SNDCTL_DSP_GETOSPACE,info);
+
+ r=(info.fragstotal-info.fragments)*info.fragsize;
+
+ return r;
+}
+
+// Returns true is the device can accept size bytes more of data.
+// size is in bytes.
+bool Rawplayer::roomformore(unsigned size)
+{
+ audio_buf_info info;
+
+ IOCTL(audiohandle,SNDCTL_DSP_GETOSPACE,info);
+ return info.bytes>=(int)size ? true : false;
+}
+
+/* Not all OSS implementations define an endian-independant samplesize.
+ * This code is taken from linux' <sys/soundcard.h, OSS version 0x030802
+ */
+#ifndef AFMT_S16_NE
+ #if defined(_AIX) || defined(AIX) || defined(sparc) || defined(HPPA) || defined(PPC)
+ /* Big endian machines */
+ #define AFMT_S16_NE AFMT_S16_BE
+ #else
+ #define AFMT_S16_NE AFMT_S16_LE
+ #endif
+#endif
+
+bool Rawplayer::setsoundtype(int stereo,int samplesize,int speed)
+{
+ // 1 = stereo, 0 = mono
+ rawstereo=stereo;
+ // 8 or 16 (bits)
+ rawsamplesize=samplesize==16 ? AFMT_S16_NE : samplesize;
+ // Hz
+ rawspeed=speed;
+ forcetomono=forceto8=false;
+
+ return resetsoundtype();
+}
+
+bool Rawplayer::resetsoundtype(void)
+{
+ int tmp;
+
+ if(ioctl(audiohandle,SNDCTL_DSP_SYNC,NULL)<0)
+ return seterrorcode(SOUND_ERROR_DEVCTRLERROR);
+
+#ifdef SOUND_VERSION
+ if(ioctl(audiohandle,SNDCTL_DSP_STEREO,&rawstereo)<0)
+#else
+ if(rawstereo!=ioctl(audiohandle,SNDCTL_DSP_STEREO,rawstereo))
+#endif
+ {
+ rawstereo=MODE_MONO;
+ forcetomono=true;
+ }
+
+ tmp=rawsamplesize;
+ IOCTL(audiohandle,SNDCTL_DSP_SAMPLESIZE,tmp);
+ if(tmp!=rawsamplesize)
+ if(rawsamplesize==16)
+ {
+ rawsamplesize=8;
+ IOCTL(audiohandle,SNDCTL_DSP_SAMPLESIZE,rawsamplesize);
+ if(rawsamplesize!=8)
+ return seterrorcode(SOUND_ERROR_DEVCTRLERROR);
+
+ forceto8=true;
+ }
+
+ if(IOCTL(audiohandle,SNDCTL_DSP_SPEED,rawspeed)<0)
+ return seterrorcode(SOUND_ERROR_DEVCTRLERROR);
+
+ return true;
+}
+
+// Write size bytes to the device from buffer
+bool Rawplayer::putblock(void *buffer,int size)
+{
+ int modifiedsize=size;
+
+ if(forcetomono || forceto8)
+ {
+ register unsigned char modify=0;
+ register unsigned char *source,*dest;
+ int increment=0,c;
+
+ source=dest=(unsigned char *)buffer;
+
+ if(forcetomono)increment++;
+ if(forceto8)increment++,source++;
+
+ c=modifiedsize=size>>increment;
+ increment<<=1;
+
+ while(c--)
+ {
+ *(dest++)=(*source)+modify;
+ source+=increment;
+ }
+ }
+
+ // quota isn't used by SETEdit
+ if(quota)
+ while(getprocessed()>quota)usleep(3);
+ write(audiohandle,buffer,modifiedsize);
+ if (0)
+ {
+ unsigned char *s=(unsigned char *)buffer;
+ fprintf(stderr,"Ok! %d bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",modifiedsize,s[0],s[1],s[2],s[3]);
+ }
+
+ return true;
+}
+
+// Not used by SETEdit strategy
+int Rawplayer::getblocksize(void)
+{
+ return audiobuffersize;
+}
+#endif
+
+#ifdef __sun__
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+// Stream ioctls:
+#include <sys/types.h>
+#include <stropts.h>
+#include <sys/conf.h>
+// Solaris header that defines /dev/audio interface
+#include <sys/audioio.h>
+
+#include "mpegsound.h"
+
+// If the buffer drops this size we send more data.
+// I don't know the limit so that's just experimental
+#define minBufferedSize 16384 //(4608*4)
+
+char *Rawplayer::defaultdevice="/dev/audio";
+
+// Not implemented!!
+/* Volume */
+int Rawplayer::setvolume(int volume)
+{
+ return volume;
+}
+
+/*******************/
+/* Rawplayer class */
+/*******************/
+// Rawplayer class
+Rawplayer::~Rawplayer()
+{
+ if (audiohandle!=-1)
+ close(audiohandle);
+}
+
+static char *theFilename=0;
+
+bool Rawplayer::initialize(char *filename)
+{
+ int flag;
+
+ rawbuffersize=0;
+ quota=0;
+ theFilename=filename;
+
+ if ((audiohandle=open(filename,O_WRONLY | O_NONBLOCK,0))==-1)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+
+ // I fill this value with the size of the DMA buffer, but isn't
+ // really needed.
+ audio_info_t info;
+ if (ioctl(audiohandle,AUDIO_GETINFO,&info)==-1)
+ return seterrorcode(SOUND_ERROR_DEVCTRLERROR);
+ audiobuffersize=info.play.buffer_size;
+ if (audiobuffersize<4 || audiobuffersize>65536)
+ return seterrorcode(SOUND_ERROR_DEVBADBUFFERSIZE);
+
+ bufSize=0;
+ return true;
+}
+
+void Rawplayer::abort(void)
+{
+ if (audiohandle==-1) return;
+ int a=FLUSHW;
+ ioctl(audiohandle,I_FLUSH,a);
+ ioctl(audiohandle,AUDIO_DRAIN,0);
+ close(audiohandle);
+ audiohandle=-1;
+}
+
+int Rawplayer::getprocessed(void)
+{
+ audio_info_t info;
+ ioctl(audiohandle,AUDIO_GETINFO,&info);
+
+ return bufSize-info.play.samples*sizeSamp;
+}
+
+bool Rawplayer::roomformore(unsigned size)
+{
+ audio_info_t info;
+ ioctl(audiohandle,AUDIO_GETINFO,&info);
+ //fprintf(stderr,"played: %d bufSize %d\n",info.play.samples*sizeSamp,bufSize);
+
+ return bufSize-info.play.samples*sizeSamp>minBufferedSize ? false : true;
+}
+
+bool Rawplayer::setsoundtype(int stereo,int samplesize,int speed)
+{
+ rawstereo=stereo;
+ rawsamplesize=samplesize;
+ rawspeed=speed;
+ forcetomono=forceto8=false;
+ // Compute the size of a sample, needed to do some calculations
+ sizeSamp=1;
+ if (stereo) sizeSamp*=2;
+ if (samplesize==16) sizeSamp*=2;
+
+ return resetsoundtype();
+}
+
+bool Rawplayer::resetsoundtype(void)
+{
+ if (audiohandle==-1)
+ {
+ if ((audiohandle=open(theFilename,O_WRONLY | O_NONBLOCK,0))==-1)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+ bufSize=0;
+ }
+
+ audio_info_t info;
+
+ ioctl(audiohandle,AUDIO_GETINFO,&info);
+ info.play.encoding=AUDIO_ENCODING_LINEAR; // We use PCM
+ info.play.precision=rawsamplesize;
+ info.play.channels=rawstereo+1;
+ info.play.sample_rate=rawspeed;
+ ioctl(audiohandle,AUDIO_SETINFO,&info);
+ // Check we succeed
+ ioctl(audiohandle,AUDIO_GETINFO,&info);
+
+ return (info.play.sample_rate==rawspeed &&
+ info.play.precision==rawsamplesize &&
+ info.play.channels==rawstereo+1 &&
+ info.play.encoding==AUDIO_ENCODING_LINEAR) ? true : false;
+}
+
+bool Rawplayer::putblock(void *buffer,int size)
+{
+ if (quota)
+ while (getprocessed()>quota) usleep(3);
+
+ #if 0
+ unsigned i;
+ unsigned char *s,t;
+ s=(unsigned char *)buffer;
+ for (i=0; i<size; i+=2)
+ {
+ t=s[i];
+ s[i]=s[i+1];
+ s[i+1]=t;
+ }
+ #endif
+
+ unsigned wrote=write(audiohandle,buffer,size);
+ /*if (wrote!=size)
+ fprintf(stderr,"Error! trying to write %d and we wrote %d\n",size,wrote);
+ else
+ fprintf(stderr,"Ok! %d bytes\n",size);*/
+ bufSize+=size;
+
+ return true;
+}
+
+int Rawplayer::getblocksize(void)
+{
+ return audiobuffersize;
+}
+#endif
+
+#ifdef __DJGPP__
+
+#include <string.h>
+#include "mpegsound.h"
+#include <allegro.h>
+
+char *Rawplayer::defaultdevice="/dev/allegro";
+
+// Dirty hack, no get_volume!
+extern int _digi_volume;
+static AUDIOSTREAM *audio_left=0,*audio_right=0;
+// 16 bits, 16*576 (9*1024)
+const unsigned StreamSize=2*9*1024,BufferSize=2*StreamSize;
+static unsigned short*buffer_left,*buffer_right;
+static unsigned short*stream_left,*stream_right;
+static unsigned buffer_head,buffer_tail,buffer_used;
+
+/* Volume */
+int Rawplayer::setvolume(int volume)
+{
+ //fprintf(stderr,"Volumen %d\n",volume);
+ set_volume(volume*2,-1);
+ // Is that correct? volumen is 0-100?
+ if(volume>100)volume=100;
+ if(volume>=0)
+ set_volume(volume*255/100,-1);
+ return _digi_volume;
+}
+
+inline
+void Stop()
+{
+ if (audio_left) stop_audio_stream(audio_left);
+ if (audio_right) stop_audio_stream(audio_right);
+ audio_left=0;
+ audio_right=0;
+}
+
+Rawplayer::~Rawplayer()
+{
+ Stop();
+ free(buffer_left);
+ free(buffer_right);
+ remove_sound();
+}
+
+bool Rawplayer::initialize(char *)
+{
+ //fprintf(stderr,"Inicializacin\n");
+ audiobuffersize=BufferSize;
+ buffer_head=buffer_tail=buffer_used=0;
+ buffer_left=(unsigned short *)malloc(BufferSize*sizeof(short));
+ if (!buffer_left) return false;
+ buffer_right=(unsigned short *)malloc(BufferSize*sizeof(short));
+ if (!buffer_right) return false;
+
+ allegro_init();
+ bool ret=install_sound(DIGI_AUTODETECT,MIDI_NONE,0) ? false : true;
+ set_volume(255,-1);
+ return ret;
+}
+
+void Rawplayer::abort(void)
+{
+ Stop();
+}
+
+int Rawplayer::getprocessed(void)
+{
+ return buffer_used;
+}
+
+bool Rawplayer::setsoundtype(int stereo,int samplesize,int speed)
+{
+ rawstereo=stereo;
+ rawsamplesize=samplesize;
+ rawspeed=speed;
+ forcetomono=forceto8=false;
+
+ return resetsoundtype();
+}
+
+bool Rawplayer::resetsoundtype(void)
+{
+ //fprintf(stderr,"Reset sound\n");
+ Stop();
+ int size=StreamSize;
+ if (rawsamplesize==8) size/=2;
+ audio_left=play_audio_stream(size,rawsamplesize,0,rawspeed,255,rawstereo?0:128);
+ if (!audio_left) return false;
+ //free_audio_stream_buffer(audio_left);
+ if (rawstereo)
+ {
+ audio_right=play_audio_stream(size,rawsamplesize,0,rawspeed,255,255);
+ if (!audio_right) return false;
+ //free_audio_stream_buffer(audio_right);
+ }
+ stream_left=stream_right=0;
+ buffer_head=buffer_tail=buffer_used=0;
+ return true;
+}
+
+static
+int audioReady(int rawstereo)
+{
+ if (!stream_left)
+ stream_left=(unsigned short *)get_audio_stream_buffer(audio_left);
+ if (!stream_left) return 0;
+ if (rawstereo)
+ {
+ if (!stream_right)
+ stream_right=(unsigned short *)get_audio_stream_buffer(audio_right);
+ if (!stream_right) return 0;
+ }
+ return 1;
+}
+
+static
+void audioBufferTransfer(int instereo)
+{
+ while (audioReady(instereo) && (buffer_used>=StreamSize))
+ {
+ memcpy(stream_left,buffer_left+buffer_tail,StreamSize*sizeof(short));
+ if (instereo)
+ memcpy(stream_right,buffer_right+buffer_tail,StreamSize*sizeof(short));
+ free_audio_stream_buffer(audio_left);
+ if (instereo)
+ free_audio_stream_buffer(audio_right);
+ stream_left=stream_right=0;
+ buffer_tail=(buffer_tail+StreamSize)%BufferSize;
+ buffer_used-=StreamSize;
+ }
+}
+
+bool Rawplayer::putblock(void *buffer,int size)
+{
+ //fprintf(stderr,"Put block\n");
+ unsigned asmp,smp,cnt;
+
+ asmp=size/sizeof(short);
+ smp=rawstereo ? asmp/2 : asmp;
+ while (smp)
+ {
+ cnt=MIN(smp,BufferSize-buffer_head);
+ /* block until free buffer space, if necessary */
+ while ((buffer_used+cnt)>BufferSize)
+ {
+ while (!audioReady(rawstereo)) __dpmi_yield();
+ audioBufferTransfer(rawstereo);
+ }
+ /* split channels */
+ if (rawstereo)
+ {
+ int d1,d2,d3,d4;
+ asm volatile (
+ "0: \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "movw %%ax,(%%edi) \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "movw %%ax,(%%ebx) \n"
+ "addl $2,%%edi \n"
+ "addl $2,%%ebx \n"
+ "decl %%ecx \n"
+ "jnz 0b \n"
+ : "=b" (d1), "=c" (d2), "=S" (d3), "=D" (d4)
+ : "S" (buffer), "D" (buffer_left+buffer_head), "b" (buffer_right+buffer_head), "c" (cnt)
+ : "ax", "memory" );
+ }
+ else
+ {
+ int d2,d3,d4;
+ asm volatile (
+ "0: \n"
+ "lodsw \n"
+ "addw $0x8000,%%ax \n"
+ "stosw \n"
+ "decl %%ecx \n"
+ "jnz 0b \n"
+ : "=c" (d2), "=S" (d3), "=D" (d4)
+ : "S" (buffer), "D" (buffer_left+buffer_head), "c" (cnt)
+ : "ax", "memory" );
+ }
+ buffer_head=(buffer_head+cnt)%BufferSize;
+ buffer_used+=cnt; smp-=cnt;
+ }
+
+ audioBufferTransfer(rawstereo);
+ return true;
+}
+
+int Rawplayer::getblocksize(void)
+{
+ return audiobuffersize;
+}
+
+bool Rawplayer::roomformore(unsigned size)
+{
+ unsigned asmp,smp,remaining;
+
+ asmp=size/sizeof(short);
+ smp=rawstereo ? asmp/2 : asmp;
+ remaining=BufferSize-buffer_head;
+ if (remaining>=size) return true;
+ size-=remaining;
+ return audioReady(rawstereo) ? true : false;
+}
+#endif
diff --git a/setedit/mp3/mpegsound/rawtofile.cc b/setedit/mp3/mpegsound/rawtofile.cc
new file mode 100644
index 0000000..879f091
--- /dev/null
+++ b/setedit/mp3/mpegsound/rawtofile.cc
@@ -0,0 +1,45 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Rawtofile.cc
+// Output raw data to file.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "mpegsound.h"
+
+// Rawplayer class
+Rawtofile::~Rawtofile()
+{
+ close(filehandle);
+}
+
+bool Rawtofile::initialize(char *filename)
+{
+ if(filename==NULL)filehandle=1;
+ else if((filehandle=Mpegsound_creat(filename))==-1)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+
+ return true;
+}
+
+bool Rawtofile::setsoundtype(int stereo,int samplesize,int speed)
+{
+ rawstereo=stereo;
+ rawsamplesize=samplesize;
+ rawspeed=speed;
+
+ return true;
+}
+
+bool Rawtofile::putblock(void *buffer,int size)
+{
+ return (write(filehandle,buffer,size)==size);
+};
+
diff --git a/setedit/mp3/mpegsound/rawtowav.cc b/setedit/mp3/mpegsound/rawtowav.cc
new file mode 100644
index 0000000..6d473b8
--- /dev/null
+++ b/setedit/mp3/mpegsound/rawtowav.cc
@@ -0,0 +1,66 @@
+/* MPEG/WAVE Sound library
+
+ (C) 2000 by Salvador E. Tropea */
+
+// Rawtowav.cc
+// Output raw data to a wav file.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "mpegsound.h"
+
+// Rawtowav class
+Rawtowav::~Rawtowav()
+{
+ unsigned l;
+ lseek(filehandle,4,SEEK_SET);
+ l=length-8;
+ write(filehandle,&l,4);
+ lseek(filehandle,sizeof(WAVEHEADER)-4,SEEK_SET);
+ l=length-sizeof(WAVEHEADER);
+ write(filehandle,&l,4);
+ close(filehandle);
+}
+
+bool Rawtowav::initialize(char *filename)
+{
+ if(filename==NULL)filehandle=1;
+ else if((filehandle=Mpegsound_creat(filename))==-1)
+ return seterrorcode(SOUND_ERROR_DEVOPENFAIL);
+ length=sizeof(WAVEHEADER);
+
+ return true;
+}
+
+bool Rawtowav::setsoundtype(int stereo,int samplesize,int speed)
+{
+ WAVEHEADER header;
+
+ header.main_chunk=RIFF;
+ header.length=0; // Will be computed when closing.
+ header.chunk_type=WAVE;
+ header.sub_chunk=FMT;
+ header.sc_len=16;
+ header.format=PCM_CODE;
+ header.modus=stereo==MODE_STEREO ? WAVE_STEREO : WAVE_MONO;
+ header.sample_fq=speed;
+ header.byte_p_spl=samplesize==8 ? 1 : 2;
+ header.byte_p_sec=header.byte_p_spl*speed;
+ header.bit_p_spl=samplesize;
+ header.data_chunk=DATA;
+ header.data_length=0; // Will be computed when closing.
+
+ return write(filehandle,&header,sizeof(WAVEHEADER))==sizeof(WAVEHEADER);
+}
+
+bool Rawtowav::putblock(void *buffer,int size)
+{
+ length+=size;
+ return (write(filehandle,buffer,size)==size);
+}
+
diff --git a/setedit/mp3/mpegsound/rhide.env b/setedit/mp3/mpegsound/rhide.env
new file mode 100644
index 0000000..1ecc543
--- /dev/null
+++ b/setedit/mp3/mpegsound/rhide.env
@@ -0,0 +1,21 @@
+#
+# Automatically generated by configure script
+#
+
+RHIDE_GCC=gcc
+RHIDE_GXX=g++
+RHIDE_LD=g++
+RHIDE_AR=ar
+RHIDE_OS_CFLAGS=-O3 -fomit-frame-pointer -ffast-math -pipe
+RHIDE_OS_CXXFLAGS=-O3 -fomit-frame-pointer -ffast-math -pipe
+RHIDE_STDINC=/usr/include /usr/local/include /usr/include/g++ /usr/local/include/g++ /usr/lib/gcc-lib /usr/local/lib/gcc-lib ../libmigdb/src $(TVISION_INC)/cl
+RHIDE_OS_LIBS=-lrhtv -ldl -lbz2 -lmpegsnd -laa -lz -lpcre -lmigdb
+RHIDE_OS_LIBS_PATH=-L/usr/lib -L/home/sergej/community-my.svn/tvision/trunk/src/tvision/makes -L/usr/X11R6/lib -L../libmigdb/src -L.
+TVISION_INC=/usr/include/rhtvision
+SUPPORT_INC= ../libmigdb/src
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(LDFLAGS) $(RHIDE_LDFLAGS) $(C_EXTRA_FLAGS) -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+STDCPP_LIB=-lstdc++
+RHIDE_LIBS=$(LIBS) $(RHIDE_OS_LIBS)
+RHIDE_LIBDIRS=$(LIB_DIRS)
diff --git a/setedit/mp3/mpegsound/soundinputstream.cc b/setedit/mp3/mpegsound/soundinputstream.cc
new file mode 100644
index 0000000..c56d42b
--- /dev/null
+++ b/setedit/mp3/mpegsound/soundinputstream.cc
@@ -0,0 +1,56 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Woo-jae Jung */
+
+// Soundinputstream.cc
+// Abstractclass of inputstreams
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+
+#include "mpegsound.h"
+
+Soundinputstream::Soundinputstream()
+{
+ __errorcode=SOUND_ERROR_OK;
+ canseek=false;
+};
+
+Soundinputstream::~Soundinputstream()
+{
+ // Nothing...
+};
+
+/********************/
+/* File & Http open */
+/********************/
+Soundinputstream *Soundinputstream::hopen(char *filename,int *errorcode)
+{
+ Soundinputstream *st;
+
+ if(filename==NULL)st=new Soundinputstreamfromfile;
+ #ifdef HAVE_SOCKET
+ else if(strstr(filename,"://"))st=new Soundinputstreamfromhttp;
+ #endif
+ else st=new Soundinputstreamfromfile;
+
+ if(st==NULL)
+ {
+ *errorcode=SOUND_ERROR_MEMORYNOTENOUGH;
+ return NULL;
+ }
+
+ if(!st->open(filename))
+ {
+ *errorcode=st->geterrorcode();
+ delete st;
+ return NULL;
+ }
+
+ return st;
+}
+
+
diff --git a/setedit/mp3/mpegsound/soundplayer.cc b/setedit/mp3/mpegsound/soundplayer.cc
new file mode 100644
index 0000000..f8dfcde
--- /dev/null
+++ b/setedit/mp3/mpegsound/soundplayer.cc
@@ -0,0 +1,40 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Soundplayer.cc
+// Superclass of Rawplayer and Rawtofile
+// It's used for set player of Mpegtoraw & Wavetoraw
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mpegsound.h"
+
+/*********************/
+/* Soundplayer class */
+/*********************/
+Soundplayer::~Soundplayer()
+{
+ // Nothing...
+}
+
+void Soundplayer::abort(void)
+{
+ // Nothing....
+}
+
+int Soundplayer::getprocessed(void)
+{
+ return 0;
+}
+bool Soundplayer::resetsoundtype(void)
+{
+ return true;
+}
+
+int Soundplayer::getblocksize(void)
+{
+ return 1024; // Default value
+}
diff --git a/setedit/mp3/mpegsound/wavetoraw.cc b/setedit/mp3/mpegsound/wavetoraw.cc
new file mode 100644
index 0000000..0bc8ffb
--- /dev/null
+++ b/setedit/mp3/mpegsound/wavetoraw.cc
@@ -0,0 +1,112 @@
+/* MPEG/WAVE Sound library
+
+ (C) 1997 by Jung woo-jae */
+
+// Wavetoraw.cc
+// Server which strips wave header.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <malloc.h>
+
+#include "mpegsound.h"
+
+Wavetoraw::Wavetoraw(Soundinputstream *loader,Soundplayer *player)
+{
+ __errorcode=SOUND_ERROR_OK;
+ initialized=false;buffer=NULL;
+ this->loader=loader;this->player=player;
+};
+
+Wavetoraw::~Wavetoraw()
+{
+ if(buffer)free(buffer);
+};
+
+
+// Convert wave format to raw format class
+bool Wavetoraw::initialize(void)
+{
+ if(!buffer)
+ {
+ buffersize=player->getblocksize();
+ if((buffer=(char *)malloc(buffersize))==NULL)
+ {
+ seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH);
+ return false;
+ }
+ }
+ return true;
+}
+
+bool Wavetoraw::run(void)
+{
+ int c;
+
+ if(initialized)
+ {
+ c=loader->getblock(buffer,buffersize);
+ if(c==0)
+ {
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return false;
+ }
+
+ currentpoint+=c;
+ if(player->putblock(buffer,buffersize)==false)return false;
+
+ if(currentpoint>=size)
+ {
+ seterrorcode(SOUND_ERROR_FINISH);
+ return false;
+ }
+ }
+ else
+ {
+ c=loader->getblock(buffer,sizeof(WAVEHEADER));
+ if(c==0)
+ {
+ seterrorcode(SOUND_ERROR_FILEREADFAIL);
+ return false;
+ }
+
+ if(!testwave(buffer))return false;
+ if(player->setsoundtype(stereo,samplesize,speed)==false)return false;
+ currentpoint=0;
+ initialized=true;
+ }
+ return true;
+}
+
+void Wavetoraw::setcurrentpoint(int p)
+{
+ if(p*pcmsize>size)currentpoint=size;
+ else currentpoint=p*pcmsize;
+ loader->setposition(currentpoint+sizeof(WAVEHEADER));
+}
+
+bool Wavetoraw::testwave(char *buffer)
+{
+ WAVEHEADER *tmp=(WAVEHEADER *)buffer;
+
+ if(tmp->main_chunk==RIFF && tmp->chunk_type==WAVE &&
+ tmp->sub_chunk==FMT && tmp->data_chunk==DATA)
+ if(tmp->format==PCM_CODE && tmp->modus<=2)
+ {
+ stereo=(tmp->modus==WAVE_STEREO) ? 1 : 0;
+ samplesize=(int)(tmp->bit_p_spl);
+ speed=(int)(tmp->sample_fq);
+ size =(int)(tmp->data_length);
+
+ pcmsize=1;
+ if(stereo==1)pcmsize*=2;
+ if(samplesize==16)pcmsize*=2;
+ return true;
+ }
+
+ seterrorcode(SOUND_ERROR_BAD);
+ return false;
+}
+
diff --git a/setedit/names/nceditor.cc b/setedit/names/nceditor.cc
new file mode 100644
index 0000000..4ed0090
--- /dev/null
+++ b/setedit/names/nceditor.cc
@@ -0,0 +1,7 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCEditor)
+
+
diff --git a/setedit/names/ndskwasc.cc b/setedit/names/ndskwasc.cc
new file mode 100644
index 0000000..8acf308
--- /dev/null
+++ b/setedit/names/ndskwasc.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinASCII);
diff --git a/setedit/names/ndskwcal.cc b/setedit/names/ndskwcal.cc
new file mode 100644
index 0000000..d6a8dee
--- /dev/null
+++ b/setedit/names/ndskwcal.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinCalendar);
diff --git a/setedit/names/ndskwcli.cc b/setedit/names/ndskwcli.cc
new file mode 100644
index 0000000..c7b64da
--- /dev/null
+++ b/setedit/names/ndskwcli.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinClipboard);
diff --git a/setedit/names/ndskwclo.cc b/setedit/names/ndskwclo.cc
new file mode 100644
index 0000000..ea28867
--- /dev/null
+++ b/setedit/names/ndskwclo.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinClosed);
diff --git a/setedit/names/ndskwedi.cc b/setedit/names/ndskwedi.cc
new file mode 100644
index 0000000..1121e78
--- /dev/null
+++ b/setedit/names/ndskwedi.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinEditor);
diff --git a/setedit/names/ndskwhel.cc b/setedit/names/ndskwhel.cc
new file mode 100644
index 0000000..6b84fae
--- /dev/null
+++ b/setedit/names/ndskwhel.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinHelp);
diff --git a/setedit/names/ndskwman.cc b/setedit/names/ndskwman.cc
new file mode 100644
index 0000000..44f0508
--- /dev/null
+++ b/setedit/names/ndskwman.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinMan);
diff --git a/setedit/names/ndskwmes.cc b/setedit/names/ndskwmes.cc
new file mode 100644
index 0000000..c08bb46
--- /dev/null
+++ b/setedit/names/ndskwmes.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinMessage);
diff --git a/setedit/names/ndskwmp3.cc b/setedit/names/ndskwmp3.cc
new file mode 100644
index 0000000..f70e4a8
--- /dev/null
+++ b/setedit/names/ndskwmp3.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinMP3);
diff --git a/setedit/names/ndskwprj.cc b/setedit/names/ndskwprj.cc
new file mode 100644
index 0000000..01ffcc0
--- /dev/null
+++ b/setedit/names/ndskwprj.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TDskWinPrj);
diff --git a/setedit/names/neditwin.cc b/setedit/names/neditwin.cc
new file mode 100644
index 0000000..0399285
--- /dev/null
+++ b/setedit/names/neditwin.cc
@@ -0,0 +1,6 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCEditWindow);
+
diff --git a/setedit/names/nfileedi.cc b/setedit/names/nfileedi.cc
new file mode 100644
index 0000000..bf7949c
--- /dev/null
+++ b/setedit/names/nfileedi.cc
@@ -0,0 +1,5 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TCFileEditor);
diff --git a/setedit/names/nsindica.cc b/setedit/names/nsindica.cc
new file mode 100644
index 0000000..cf2de52
--- /dev/null
+++ b/setedit/names/nsindica.cc
@@ -0,0 +1,7 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TSIndicator)
+
+
diff --git a/setedit/names/ntedcol.cc b/setedit/names/ntedcol.cc
new file mode 100644
index 0000000..f182fa8
--- /dev/null
+++ b/setedit/names/ntedcol.cc
@@ -0,0 +1,4 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <tvsetuti.h>
+n2(TEditorCollection,TEdCol);
diff --git a/setedit/policy.txt b/setedit/policy.txt
new file mode 100644
index 0000000..265309e
--- /dev/null
+++ b/setedit/policy.txt
@@ -0,0 +1,41 @@
+This file contains some guidelines for myself (SET) or any other developer.
+
+1. Adding a new file.
+2. Removing a file.
+3. Changing versions.
+
+
+1. Adding a new file:
+--------------------
+
+* If the file is binary and cvs doesn't know it yet: add it in cvswrappers.
+* Run "cvs add file" in the directory where the file is.
+* Add the file to the "lista" file in the "makes" directory. Use '-' preffix
+for binary files, '+' for files that need "chmod +x file" and '*' for files
+that must be converted to DOS format while passing from unix to dos (.bat, a
+copyright file or some readme.1st).
+* Add it to the right .gpr file. Remmember:
+ Is this file dependant of FOR_LIBSET? If yes: Is in gpr included by
+libset.gpr?
+* Add the file to libset.gpr if it will be needed by RHIDE.
+
+
+2. Removing a file:
+------------------
+
+* Delete the file.
+* Run "cvs remove file".
+* Remove the name from the:
+ gpr
+ libset.gpr
+ lista
+ listaxtr
+
+
+3. Changing versions:
+--------------------
+
+* Change ./version.txt and include/ced_inte.h
+* The debian stuff is automatically changed by the scripts and Ivan changes
+it as soon as I put the changes in the CVS.
+
diff --git a/setedit/redhat/README b/setedit/redhat/README
new file mode 100644
index 0000000..63a72bf
--- /dev/null
+++ b/setedit/redhat/README
@@ -0,0 +1,97 @@
+ This directory contains scripts and helpers used to create RPM packages.
+ The name "redhat" is because Red Hat created the RPM format. That's the
+same reason why the directory to create the .deb files is called "debian"
+even when a lot of small distros based on Debian are available.
+
+ The setedit.spec.in file is a template to create the real spec file. The
+real file is created by the configuration script. If you need to do it
+manually just look for names enclosed by @, like @version@ and replace them
+by the proper values (currently only version needs it). The copy the file to
+setedit-@version@.spec (i.e. setedit-0.5.2.spec).
+
+ The spec file was contributed by Michel Catudal <bbcat@users.sf.net>.
+ I include this file to help people to create their own RPM files. This is
+really important because a lot of important Linux distros uses it (Red Hat,
+SuSE, Mandrake, etc.) and RPM packages generated for one of them doesn't have
+to be useful for the other.
+
+ Here is how to use the spec file:
+
+I. THE EASY WAY
+===============
+
+ This procedure is really rigid and could be incorrect for your system. In
+particular it assumes all will compile ok and nothing will fail. For this
+reason I also explain it step by step in point (II).
+
+ To create the RPM files just execute:
+
+$ redhat/create-rpms.sh
+
+ Then look for the RPMs in ~/rpm/RPMS/i386/
+ I'm looking for volunteers to make this script more flexible.
+ IMPORTANT! The script temporally changes your ~/.rpmacros file, please
+back-up it if you have valuable information there. The script creates a
+back-up and restores the original file but it could fail.
+
+ I also provide an script to create Turbo Vision and SETEdit RPMs. This
+script assumes you uncompressed both tarballs (or fetched both CVS trees) in
+the same directory. Example: /usr/src/tvision and /usr/src/setedit
+ In this case you can run:
+
+host:/usr/src/setedit$ redhat/create-all-rpms.sh
+
+ The script is really simple and doesn't check for errors. If you
+have some time to add error level checkings, redirecting the output to a log
+file, etc. please do it and contribute the changes.
+
+II. STEP BY STEP
+================
+
+1) Choose a directory to create the files. If you are root you can use the
+default directories for your system. If not I recommend using a directory
+located in your home directory. I provide a small script that creates the
+directories for you: create-dirs.sh
+
+$ redhat/create-dirs.sh
+
+Note: In the rest of the examples I assume you used your home directory.
+
+2) Configure rpmbuild to use the created directories:
+
+$ redhat/config-rpm.sh
+
+Note: You can skip it if you are root or you alredy configured rpmbuild.
+
+3) Create a tarball containing the sources:
+
+$ cd makes/linux; perl compress.pl --use-bzip2 --only-source --dir-version; cd ../..
+$ mv makes/linux/result/setedit-*.tar.bz2 ~/rpm/SOURCES
+
+Note: ~/rpm/SOURCES should be replaced if you are not using your home
+directory.
+
+4) Make sure the TV library is already compiled and located in the same build
+directory. For this example you should have ~/rpm/BUILD/tvision as a simlink
+pointing to the TV source tree.
+ If you don't have it download Turbo Vision (http://tvision.sf.net/) and
+follow the instructions in the redhat/README file.
+
+5) Invoke rpmbuild to create the package:
+
+$ rpmbuild -bb redhat/setedit-*.spec
+
+Hopefuly you'll get the result in ~/rpm/RPMS/
+Now you just need to install the RPM as `root' user.
+
+*****************************************************************************
+Note 1: The specs doesn't allow building two RPM packages at the same time if
+they use the same root directory.
+
+Note 2: If you want to use a directory different than ~/rpm you can use:
+[bash syntax]
+
+$ mkdir /tmp/example
+$ export SET_RPM_DIR=/tmp/example
+
+
diff --git a/setedit/redhat/config-rpm.sh b/setedit/redhat/config-rpm.sh
new file mode 100755
index 0000000..069891d
--- /dev/null
+++ b/setedit/redhat/config-rpm.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+if [ "$SET_RPM_DIR" ]; then
+ SET_RPM_DIR="$SET_RPM_DIR";
+else
+ SET_RPM_DIR="$HOME";
+fi
+echo "%_topdir " $SET_RPM_DIR/rpm > ~/.rpmmacros
+
diff --git a/setedit/redhat/create-all-rpms.sh b/setedit/redhat/create-all-rpms.sh
new file mode 100755
index 0000000..333e342
--- /dev/null
+++ b/setedit/redhat/create-all-rpms.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Copyright (C) 2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This file executes the steps needed to create the Turbo Vision and SETEdit
+# RPM files. It doesn't check for errors and is really simple.
+# It assumes both tarballs were uncompressed in the same directory and that
+# you are running the script from ../
+#
+cd ../tvision
+chmod +x redhat/create-rpms.sh
+redhat/create-rpms.sh
+cd ../setedit
+chmod +x redhat/create-rpms.sh
+redhat/create-rpms.sh
+
diff --git a/setedit/redhat/create-dirs.sh b/setedit/redhat/create-dirs.sh
new file mode 100755
index 0000000..3cc8e6f
--- /dev/null
+++ b/setedit/redhat/create-dirs.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+if [ "$SET_RPM_DIR" ]; then
+ SET_RPM_DIR="$SET_RPM_DIR";
+else
+ SET_RPM_DIR="$HOME";
+fi
+mkdir $SET_RPM_DIR/rpm
+mkdir $SET_RPM_DIR/rpm/BUILD
+mkdir $SET_RPM_DIR/rpm/RPMS
+mkdir $SET_RPM_DIR/rpm/RPMS/i386
+mkdir $SET_RPM_DIR/rpm/SOURCES
+mkdir $SET_RPM_DIR/rpm/SPECS
+mkdir $SET_RPM_DIR/rpm/SRPMS
diff --git a/setedit/redhat/create-rpms.sh b/setedit/redhat/create-rpms.sh
new file mode 100755
index 0000000..3cc2286
--- /dev/null
+++ b/setedit/redhat/create-rpms.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This file executes the steps needed to create the RPM files. It doesn't
+# check for errors and is really simple.
+# It temporally changes the ~/.rpmmacros file, but the file is restored
+# before exiting. If you stop the script you can recover the original file
+# using the move located at the end.
+# The file should be executed from the ../
+#
+if [ "$SET_RPM_DIR" ]; then
+ SET_RPM_DIR="$SET_RPM_DIR";
+else
+ SET_RPM_DIR="$HOME";
+fi
+./configure --just-spec
+chmod +x redhat/create-dirs.sh
+chmod +x redhat/config-rpm.sh
+redhat/create-dirs.sh
+mv ~/.rpmmacros redhat/.rpmmacros-backup~
+redhat/config-rpm.sh
+cd makes/linux; perl compress.pl --use-bzip2 --only-source --dir-version; cd ../..
+mv makes/linux/result/setedit-`cat version.txt`.tar.bz2 $SET_RPM_DIR/rpm/SOURCES
+rpmbuild -bb redhat/setedit-`cat version.txt`.spec
+mv redhat/.rpmmacros-backup~ ~/.rpmmacros
+
diff --git a/setedit/redhat/setedit.spec.in b/setedit/redhat/setedit.spec.in
new file mode 100644
index 0000000..5fa0278
--- /dev/null
+++ b/setedit/redhat/setedit.spec.in
@@ -0,0 +1,70 @@
+%define name setedit
+%define ver @version@
+%define rel 1
+
+Summary: A user friendly editor for programmers.
+Name: %{name}
+Version: %{ver}
+Release: %{rel}
+Copyright: GPL
+Packager: Michel Catudal <bbcat@users.sf.net>
+Vendor: Salvador Eduardo Tropea <set@users.sf.net>
+Group: Applications/Editors
+Source: %{name}-%{ver}.tar.bz2
+URL: http://setedit.sf.net/
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Docdir: /usr/doc
+Prereq: /sbin/install-info
+
+%description
+Setedit is a text editor specially designed for programmers. It has a nice
+interface with mouse support, menus and windows (text mode). The editor is a
+very good choice for people with DOS background, especially people accustomed
+to Worstar and Borland editors. The editor has overlapped windows so you can
+see more than one file at the same time, configurable syntax highlighting,
+macros, rectangular selection, block indentation, as well as customizable
+keyboard shortcuts and menus.
+
+%prep
+rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_DIR/%{name}-%{ver}
+%setup
+
+%build
+rm -f Makefile
+perl config.pl --libset
+touch $RPM_BUILD_DIR/%{name}-%{ver}/debugfiles.list
+touch $RPM_BUILD_DIR/%{name}-%{ver}/debugsources.list
+make
+
+%install
+make install prefix=$RPM_BUILD_ROOT/usr all
+
+%post
+/sbin/install-info /usr/info/infview.info.gz /usr/info/dir
+/sbin/install-info /usr/info/sdg.info.gz /usr/info/dir
+/sbin/install-info /usr/info/setedit.info.gz /usr/info/dir
+
+%preun
+if [ $1 = 0 ]; then
+ /sbin/install-info --delete /usr/info/infview.info.gz /usr/info/dir
+ /sbin/install-info --delete /usr/info/sdg.info.gz /usr/info/dir
+ /sbin/install-info --delete /usr/info/setedit.info.gz /usr/info/dir
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+/usr/bin/*
+/usr/share/*
+/usr/lib/*
+/usr/doc/*
+/usr/man/*
+/usr/info/*
+
+%define __spec_install_post %{nil}
+%define __debug_install_post %{nil}
+%define debug_package %{nil}
+
diff --git a/setedit/scrnsave/Makefile b/setedit/scrnsave/Makefile
new file mode 100644
index 0000000..da85ea6
--- /dev/null
+++ b/setedit/scrnsave/Makefile
@@ -0,0 +1,55 @@
+srcdir=.
+VPATH=$(srcdir)
+
+# To avoid conflicts with the values provided by .mak files
+CFLAGS=
+CXXFLAGS=
+export
+
+ifneq ($(strip $(DJDIR)),)
+export editor_OS:=DJGPP
+endif
+
+# If not DOS then just Linux, no other supported by now
+ifeq ($(strip $(editor_OS)),)
+export editor_OS:=Linux
+endif
+
+prjs=fakealle/fakealle plasmlib/plasmlib plasmlib/mixsfake \
+ plasma1/ps1 plasma2/ps2 plasma3/ps3 plasma4/ps4
+
+%.mak: %.gpr
+ gpr2mak $<
+
+plasmas: makes ps1.exe ps2.exe ps3.exe ps4.exe
+
+libraries:
+ $(MAKE) -C plasmlib -f plasmlib.mak
+ $(MAKE) -C plasmlib -f mixsfake.mak
+ $(MAKE) -C fakealle -f fakealle.mak
+
+ps1.exe: libraries
+ $(MAKE) -C plasma1 -f ps1.mak
+ -upx -9 plasma1/ps1.exe
+
+ps2.exe: libraries
+ $(MAKE) -C plasma2 -f ps2.mak
+ -upx -9 plasma2/ps2.exe
+
+ps3.exe: libraries
+ $(MAKE) -C plasma3 -f ps3.mak
+ -upx -9 plasma3/ps3.exe
+
+ps4.exe: libraries
+ $(MAKE) -C plasma4 -f ps4.mak
+ -upx -9 plasma4/ps4.exe
+
+makes: $(addsuffix .mak,$(prjs))
+
+clean:
+ rm -f */*.mak *.bkp */*.bkp */*.o */*/*.o */*.a */*.exe
+
+clean-o:
+ rm -f */*.o */*/*.o */*.a */*.exe
+
+
diff --git a/setedit/scrnsave/copying b/setedit/scrnsave/copying
new file mode 100644
index 0000000..02538d1
--- /dev/null
+++ b/setedit/scrnsave/copying
@@ -0,0 +1,24 @@
+All the files here are distributed under the GPL license. This license is
+shipped with the editor in the main directory in a file called: copying.gpl.
+If you distribute the plasma library alone or use it for another project be
+sure you read the GPL license carefully and you are not violating it.
+If for some strange reason you lost this file you can get a copy.
+
+ Copyright (C) 1997-2000 by Salvador E. Tropea
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+SET
+
diff --git a/setedit/scrnsave/extrscsv.txt b/setedit/scrnsave/extrscsv.txt
new file mode 100644
index 0000000..eea195b
--- /dev/null
+++ b/setedit/scrnsave/extrscsv.txt
@@ -0,0 +1,8 @@
+Plasma sin/cos
+ps1.exe
+Plasma mixsurf 1
+ps2.exe
+Plasma mixsurf 2
+ps3.exe
+Plasma mixsurf random
+ps4.exe
diff --git a/setedit/scrnsave/fakealle/fakealle.c b/setedit/scrnsave/fakealle/fakealle.c
new file mode 100644
index 0000000..ded3b81
--- /dev/null
+++ b/setedit/scrnsave/fakealle/fakealle.c
@@ -0,0 +1,117 @@
+/* Copyright (C) 1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#include <fakealle.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <pc.h>
+#include <sys/movedata.h>
+#include <dpmi.h>
+#include <conio.h>
+
+void allegro_exit()
+{
+ asm ("movl $0x3,%eax \n\
+ int $0x10");
+}
+
+int mouse_x,mouse_y,mouse_b,key_pressed=-1;
+
+static
+void getMouseStatus(int *x, int *y, int *b)
+{
+ __dpmi_regs r;
+ r.x.ax=3;
+ __dpmi_int(0x33,&r);
+ *x=r.x.cx;
+ *y=r.x.dx;
+ *b=r.x.bx;
+}
+
+void allegro_init()
+{
+ getMouseStatus(&mouse_x,&mouse_y,&mouse_b);
+}
+
+/* _vsync_out_v:
+ * Waits until the VGA is not in a vertical retrace.
+ */
+inline void _vsync_out_v()
+{
+ do {
+ } while (inportb(0x3DA) & 8);
+}
+
+/* _vsync_in:
+ * Waits until the VGA is in the vertical retrace period.
+ */
+inline void _vsync_in()
+{
+ do {
+ } while (!(inportb(0x3DA) & 8));
+}
+
+void vsync()
+{
+ _vsync_out_v();
+ _vsync_in();
+}
+
+void set_gfx_mode(int driver,int xres, int yres, int x, int y)
+{
+ if (xres!=320 || yres!=200)
+ {
+ printf("Error setting mode\n");
+ exit(1);
+ }
+ asm ("movl $0x13,%eax; int $0x10");
+}
+
+BITMAP *create_bitmap(int x, int y)
+{
+ int size=sizeof(BITMAP)+y*sizeof(unsigned char *);
+ BITMAP *ret;
+ int i;
+ unsigned char *dat;
+
+ ret=(BITMAP *)malloc(size);
+ dat=(unsigned char *)ret->dat=malloc(x*y);
+ for (i=0; i<y; i++)
+ {
+ ret->line[i]=dat;
+ dat+=x;
+ }
+ ret->w=x; ret->h=y;
+ return ret;
+}
+
+void blit(BITMAP *bmp)
+{
+ _dosmemputl(bmp->dat,320*200/4,0xA0000);
+}
+
+int poll_input()
+{
+ int x,y,b;
+
+ if (key_pressed>=0)
+ return KEY_EVENT;
+ if (kbhit())
+ {
+ key_pressed=getch();
+ return KEY_EVENT;
+ }
+ getMouseStatus(&x,&y,&b);
+ if (x!=mouse_x || y!=mouse_y || b!=mouse_b)
+ {
+ mouse_x=x;
+ mouse_y=y;
+ mouse_b=b;
+ return MOUSE_EVENT;
+ }
+ return 0;
+}
+
+void clear(BITMAP *bmp)
+{
+ memset(bmp->dat,0,bmp->w*bmp->h);
+}
diff --git a/setedit/scrnsave/fakealle/fakealle.gpr b/setedit/scrnsave/fakealle/fakealle.gpr
new file mode 100644
index 0000000..740652a
--- /dev/null
+++ b/setedit/scrnsave/fakealle/fakealle.gpr
Binary files differ
diff --git a/setedit/scrnsave/fakealle/fakealle.mak b/setedit/scrnsave/fakealle/fakealle.mak
new file mode 100644
index 0000000..1d864cc
--- /dev/null
+++ b/setedit/scrnsave/fakealle/fakealle.mak
@@ -0,0 +1,319 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# E:\DJ\BIN/gpr2mak.exe fakealle/fakealle.gpr
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=include ../plasmlib/include
+LIB_DIRS=
+C_DEBUG_FLAGS=-g3 -gstabs+
+C_OPT_FLAGS=-O2 -fomit-frame-pointer -ffast-math
+C_WARN_FLAGS=-Wall
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=fakealle.o putscree.o varios1.o
+LIBRARIES=
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=libfakea.a
+PROJECT_ITEMS=fakealle.c putscree.c varios1.c
+DEFAULT_MASK=*.[acfghimnops]*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= fakealle.o putscree.o varios1.o
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+libfakea.a:: $(DEPS_0)
+ $(RHIDE_COMPILE_ARCHIVE)
+DEPS_1=fakealle.c include/fakealle.h
+fakealle.o:: $(DEPS_1)
+ $(RHIDE_COMPILE.c.o)
+DEPS_2=putscree.c include/fakealle.h
+putscree.o:: $(DEPS_2)
+ $(RHIDE_COMPILE.c.o)
+DEPS_3=varios1.c ../plasmlib/include/math1.h include/fakealle.h
+varios1.o:: $(DEPS_3)
+ $(RHIDE_COMPILE.c.o)
+all:: libfakea.a
diff --git a/setedit/scrnsave/fakealle/include/fakealle.h b/setedit/scrnsave/fakealle/include/fakealle.h
new file mode 100644
index 0000000..b695c7e
--- /dev/null
+++ b/setedit/scrnsave/fakealle/include/fakealle.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+typedef struct BITMAP /* a bitmap structure */
+{
+ int w, h; /* width and height in pixels */
+// int clip; /* flag if clipping is turned on */
+// int cl, cr, ct, cb; /* clip left, right, top and bottom values */
+ void *dat; /* the memory we allocated for the bitmap */
+// int bitmap_id; /* for identifying sub-bitmaps */
+// void *extra; /* points to a structure with more info */
+// int x_ofs; /* horizontal offset (for sub-bitmaps) */
+// int y_ofs; /* vertical offset (for sub-bitmaps) */
+// int seg; /* bitmap segment */
+ unsigned char *line[0]; /* pointers to the start of each line */
+} BITMAP;
+
+void allegro_exit();
+void allegro_init();
+void vsync();
+void set_gfx_mode(int driver,int xres, int yres, int x, int y);
+BITMAP *create_bitmap(int x, int y);
+void blit(BITMAP *bmp);
+void clear(BITMAP *bmp);
+
+#define GFX_VGA 0
+
+extern int mouse_x,mouse_y,mouse_b,key_pressed;
+#define MOUSE_EVENT 1
+#define KEY_EVENT 2
+int poll_input();
+
+#define keypressed poll_input
+#define screen 0
+
+extern inline
+void _putpixel(BITMAP *Bmp, int x, int y, unsigned char val)
+{
+ Bmp->line[y][x]=val;
+}
+
+extern inline
+unsigned char _getpixel(BITMAP *Bmp, int x, int y)
+{
+ return Bmp->line[y][x];
+}
+
+#define is_linear_bitmap(a) (1)
+
diff --git a/setedit/scrnsave/fakealle/include/putscree.h b/setedit/scrnsave/fakealle/include/putscree.h
new file mode 100644
index 0000000..3390dc8
--- /dev/null
+++ b/setedit/scrnsave/fakealle/include/putscree.h
@@ -0,0 +1,3 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void PS_FullBlitLinear(BITMAP *bmp,BITMAP *scr);
diff --git a/setedit/scrnsave/fakealle/include/varios.h b/setedit/scrnsave/fakealle/include/varios.h
new file mode 100644
index 0000000..f48d69d
--- /dev/null
+++ b/setedit/scrnsave/fakealle/include/varios.h
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void AllegroInit(void);
+void AllegroSetMode(void);
+void CalcuInit(void);
+void CalcuCallBack(void);
+void CalcuDeInit(void);
+
diff --git a/setedit/scrnsave/fakealle/putscree.c b/setedit/scrnsave/fakealle/putscree.c
new file mode 100644
index 0000000..db5d1c7
--- /dev/null
+++ b/setedit/scrnsave/fakealle/putscree.c
@@ -0,0 +1,8 @@
+/* Copyright (C) 1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#include <fakealle.h>
+
+void PS_FullBlitLinear(BITMAP *bmp, BITMAP *src)
+{
+ blit(bmp);
+}
diff --git a/setedit/scrnsave/fakealle/varios1.c b/setedit/scrnsave/fakealle/varios1.c
new file mode 100644
index 0000000..e030188
--- /dev/null
+++ b/setedit/scrnsave/fakealle/varios1.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#include <stdlib.h>
+#include <stdio.h>
+#include <fakealle.h>
+#include <math1.h>
+
+void AllegroInit(void)
+{
+ MA1_CreateLookUp();
+ allegro_init();
+
+ set_gfx_mode(GFX_VGA,320,200,0,0);
+}
+
+void AllegroSetMode(void)
+{
+ set_gfx_mode(GFX_VGA,320,200,0,0);
+}
+
+void CalcuInit(void)
+{
+ printf("Calculating ...");
+ printf("Please wait a little ");
+}
+
+void CalcuCallBack(void)
+{
+ printf(".");
+}
+
+void CalcuDeInit(void)
+{
+}
diff --git a/setedit/scrnsave/how-to.txt b/setedit/scrnsave/how-to.txt
new file mode 100644
index 0000000..3eb0bc4
--- /dev/null
+++ b/setedit/scrnsave/how-to.txt
@@ -0,0 +1,75 @@
+This text explains how to write an external screen saver for the editor.
+
+ An external screen saver is just a simple program that follows some special
+rules.
+
+1. Command line options that must be supported:
+2. Command line parameters passed by the editor:
+3. Returned value:
+4. How do I make the editor know about a new screen saver?
+5. Some notes
+
+-----------------------------------------------------------------------------
+1. Command line options that must be supported:
+
+-i
+Provides information about the screen saver to stdout.
+Maximun size of the text: 72 columns and 17 lines.
+Note: Including additional \n at the start.
+
+-h
+Command line options explained.
+Maximun size of the text: 72 columns, 17 lines max.
+Including additional \n at the start.
+
+-n
+Descriptive name.
+Just one line, no more than 40 characters and must end with \n. 24 is the
+current size of the dialog.
+
+-----------------------------------------------------------------------------
+2. Command line parameters passed by the editor:
+
+The first three parameters are filled by the editor and means:
+
+A) Number of columns.
+B) Number of lines.
+C) Flags about the video mode, currently that's 1 meaning we are in text
+mode.
+D) A file handle for a file that contains the contents of the screen.
+
+All values are in hexadecimal, except (D), example for 80x25 text mode:
+
+0x0050 0x0019 0x00000001 22
+
+-----------------------------------------------------------------------------
+3. Returned value:
+
+The value returned by the application have some special meaning:
+
+100 The screen and video mode where altered so a full restore must be done.
+ That's the only behavior you'll get currently.
+101 All is like before calling, a redraw is enough. (*)
+etc.
+
+(*) Not implemented yet.
+-----------------------------------------------------------------------------
+4. How do I make the editor know about a new screen saver?
+
+A) Copy the program to the directory where the configuration files are
+located.
+B) Edit the file named extrscsv.txt to name it. The format of the file is
+really simple the first line is the name of the screen saver, the next is the
+program name and so on.
+
+-----------------------------------------------------------------------------
+5. Some notes
+
+ When the external screen saver is running the editor doesn't have the
+control so if the screen saver doesn't release the CPU it will consume as
+much CPU as possible. You must also understand that the editor can't play MP3
+files while the other program is running.
+
+-----------------------------------------------------------------------------
+End of file
+
diff --git a/setedit/scrnsave/plasma1/ps1.c b/setedit/scrnsave/plasma1/ps1.c
new file mode 100644
index 0000000..a0bda2b
--- /dev/null
+++ b/setedit/scrnsave/plasma1/ps1.c
@@ -0,0 +1,226 @@
+/* Copyright (C) 1997-2001 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Description:
+ That's an example on how to use the plasma 1 module. @x{Plasma 1}.
+ It test the 320x200 resolution version. Use -s to force a vsync.
+ Isn't faster than the generic. At least the fps isn't greater.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <conio.h>
+#include <string.h>
+#include <time.h>
+
+#include <fakealle.h>
+#include "palette.h"
+#include "math1.h"
+#include "plasa1.h"
+
+RawPal red_palette,blue_palette,temp,temp2,green_palette,BlueP1,BlueP2;
+unsigned char *screen_buffer;
+BITMAP *BMPAuxScreen;
+int Frames=0;
+unsigned long t1,t2;
+int WaitSync=1;
+
+void setup_palettes(void)
+{
+ RPF_MakeMultiPal(BlueP2);
+ RPF_MakeRedBlueBar(red_palette);
+ RPF_MakeBlueGreenBar(blue_palette);
+ RPF_MakeGreenRedBar2(green_palette);
+ RPF_MakeBlueGreen_RedBars(BlueP1);
+}
+
+void setup_lookup_tables(void)
+{
+ MA1_CreateLookUp();
+}
+
+void terminate(void)
+{//Sets text mode and ends program.
+ double t;
+
+ allegro_exit();
+ t2=rawclock();
+ t=(t2-t1)/18.2;
+ printf("Time: %f Frames: %d => %f fps\n",t,Frames,Frames/t);
+ printf(
+"Designed and Programmed By Salvador Eduardo Tropea SET. Copyright 1997-1999.\n"
+"Original plasma idea By Richard A. Nutman, a.k.a Nutty. Copyright 1997.\n"
+"\n"
+"There is NO warranty. You may redistribute this software\n"
+"under the terms of the GNU General Public License.\n"
+"For more information about these matters, see the files named COPYING.\n"
+);
+ exit(100);
+}
+
+void end_if_user_ready(void)
+{
+ if (poll_input())
+ terminate();
+}
+
+#define Blit320() if (WaitSync) \
+ vsync(); \
+ blit(BMPAuxScreen); \
+ Frames++
+
+void PassFromOneToOther(void (*f1)(unsigned char *),
+ void (*f2)(unsigned char *),
+ unsigned char *p1,unsigned char *p2,int len)
+{
+ int i,f;
+
+ RPF_Negative(p1,temp);
+ for (f=0, i=3; f<15; f++,i+=4)
+ {
+ end_if_user_ready();
+ RPF_AddPaletteStep(p1,temp,temp2,i);
+ f1(screen_buffer);
+ Blit320();
+ RPF_SetAllPal(temp2);
+ }
+ for (f=0, i=63-8; f<7; f++,i-=8)
+ {
+ end_if_user_ready();
+ RPF_FromWhite(p2,temp,i);
+ f2(screen_buffer);
+ Blit320();
+ RPF_SetAllPal(temp);
+ }
+ RPF_SetAllPal(p2);
+ for (i=0; i<len; i++)
+ {
+ end_if_user_ready();
+ f2(screen_buffer);
+ Blit320();
+ }
+}
+
+void PrintHelp(void)
+{
+ printf(
+"\n"
+"Plasma 1 test (c) 1997-1999 by Salvador E. Tropea (SET)\n"
+"e-mail: salvador@inti.gov.ar\n"
+"\n"
+"Use: ps1 [-s] [-h] [-i] [-n]\n"
+"\n"
+"s: Don't wait for vertical retrace, smooth but you can't meassure the\n"
+" frame rate.\n"
+"h: Shows this help.\n"
+"i: Shows information.\n"
+"n: Descriptive name.\n"
+);
+}
+
+void ShowInfo(void)
+{
+printf(
+"\n"
+"Name: Plasma 1\n"
+"Copyright: GPL, (c) 1997-1999 by Salvador E. Tropea (SET)\n"
+"Author: Designed and Programmed By Salvador Eduardo Tropea SET.\n"
+" Original plasma idea By Richard A. Nutman, a.k.a Nutty.\n"
+" Copyright 1997.\n"
+"Description: A sequence of nice plasma effects based in sin/cos look-up\n"
+" tables.\n"
+);
+}
+
+int main(int argc, char *argv[])
+{
+ int i,f;
+ int ShowPar=0;
+
+ for (i=1; !ShowPar && i<argc; i++)
+ {
+ if (argv[i][0]=='-')
+ {
+ switch (argv[i][1])
+ {
+ case 's':
+ WaitSync=0;
+ break;
+ case 'h':
+ ShowPar=1;
+ break;
+ case 'i':
+ ShowInfo();
+ return 2;
+ case 'n':
+ printf("Plasma sin/cos\n");
+ return 3;
+ }
+ }
+ }
+ if (ShowPar)
+ {
+ PrintHelp();
+ return 1;
+ }
+
+ allegro_init();
+
+ // Virtual screen
+ BMPAuxScreen=create_bitmap(320,200);
+ screen_buffer=BMPAuxScreen->line[0];
+
+ memset(temp,0,768);
+ set_gfx_mode(GFX_VGA,320,200,0,0);
+ RPF_SetAllPal(temp);
+ setup_palettes();
+ setup_lookup_tables();
+ t1=rawclock();
+ while (1)
+ {
+ for (i=0; i<64; i++)
+ {
+ end_if_user_ready();
+ RPF_FromBlack(blue_palette,temp,i);
+ PLA1_Step320x200_1(screen_buffer);
+ Blit320();
+ RPF_SetAllPal(temp);
+ }
+ RPF_SetAllPal(blue_palette);
+ for (i=0; i<550; i++)
+ {
+ end_if_user_ready();
+ PLA1_Step320x200_1(screen_buffer);
+ Blit320();
+ }
+ PassFromOneToOther(PLA1_Step320x200_1,PLA1_Step320x200_2,blue_palette,
+ red_palette,500);
+ PassFromOneToOther(PLA1_Step320x200_2,PLA1_Step320x200_3,red_palette,
+ green_palette,500);
+ PassFromOneToOther(PLA1_Step320x200_3,PLA1_Step320x200_1b,green_palette,
+ blue_palette,500);
+ PassFromOneToOther(PLA1_Step320x200_1b,PLA1_Step320x200_2b,blue_palette,
+ red_palette,500);
+ PassFromOneToOther(PLA1_Step320x200_2b,PLA1_Step320x200_4,red_palette,
+ green_palette,500);
+ PassFromOneToOther(PLA1_Step320x200_4,PLA1_Step320x200_6,green_palette,
+ BlueP2,500);
+ PassFromOneToOther(PLA1_Step320x200_6,PLA1_Step320x200_7,BlueP2,BlueP1,500);
+ for (i=0,f=63; i<128; i++)
+ {
+ end_if_user_ready();
+ RPF_FromBlack(BlueP1,temp,f);
+ if (i & 1)
+ f--;
+ PLA1_Step320x200_7(screen_buffer);
+ Blit320();
+ RPF_SetAllPal(temp);
+ }
+ }
+ allegro_exit();
+
+ return 100;
+}
+
diff --git a/setedit/scrnsave/plasma1/ps1.gpr b/setedit/scrnsave/plasma1/ps1.gpr
new file mode 100644
index 0000000..67423a4
--- /dev/null
+++ b/setedit/scrnsave/plasma1/ps1.gpr
Binary files differ
diff --git a/setedit/scrnsave/plasma1/ps1.mak b/setedit/scrnsave/plasma1/ps1.mak
new file mode 100644
index 0000000..b16ae4a
--- /dev/null
+++ b/setedit/scrnsave/plasma1/ps1.mak
@@ -0,0 +1,324 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# E:\DJ\BIN/gpr2mak.exe plasma1/ps1.gpr
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=../fakealle/include ../plasmlib/include
+LIB_DIRS=
+C_DEBUG_FLAGS=-gstabs+
+C_OPT_FLAGS=-O2 -ffast-math -fomit-frame-pointer
+C_WARN_FLAGS=-Wall -Werror
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=ps1.o
+LIBRARIES=../fakealle/libfakea.a ../plasmlib/libplasm.a
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=ps1.exe
+PROJECT_ITEMS=../fakealle/fakealle.gpr ../plasmlib/plasmlib.gpr ps1.c
+DEFAULT_MASK=*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= ps1.o ../fakealle/libfakea.a ../plasmlib/libplasm.a
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+ps1.exe:: $(DEPS_0)
+ $(RHIDE_COMPILE_LINK)
+DEPS_1=
+.PHONY: ../fakealle/fakealle.gpr.force
+all:: ../fakealle/fakealle.gpr.force
+../fakealle/fakealle.gpr.force:
+ $(MAKE) -C ../fakealle/ -f fakealle.mak
+DEPS_2=
+.PHONY: ../plasmlib/plasmlib.gpr.force
+all:: ../plasmlib/plasmlib.gpr.force
+../plasmlib/plasmlib.gpr.force:
+ $(MAKE) -C ../plasmlib/ -f plasmlib.mak
+DEPS_3=ps1.c ../fakealle/include/fakealle.h ../plasmlib/include/math1.h\
+ ../plasmlib/include/palette.h ../plasmlib/include/plasa1.h
+ps1.o:: $(DEPS_3)
+ $(RHIDE_COMPILE.c.o)
+all:: ps1.exe
diff --git a/setedit/scrnsave/plasma2/ps2.c b/setedit/scrnsave/plasma2/ps2.c
new file mode 100644
index 0000000..1b73c66
--- /dev/null
+++ b/setedit/scrnsave/plasma2/ps2.c
@@ -0,0 +1,216 @@
+/* Copyright (C) 1997-2001 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Description:
+ That's an example on how to use the plasma 2 module. @x{Plasma 2}.
+ It test the generic resolution version. Use -s to force a vsync.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <conio.h>
+#include <string.h>
+
+#include "fakealle.h"
+#include "palette.h"
+#include "math1.h"
+#include "math4.h"
+#include "plasa1.h"
+#include "movsurf1.h"
+#include "varios.h"
+#include "putscree.h"
+
+#include <time.h>
+
+RawPal temp,temp2;
+unsigned char *screen_buffer;
+BITMAP *BMPAuxScreen;
+int c,w=320,h=200;
+int WaitSync=1;
+
+void terminate(void)
+{//Sets text mode and ends program.
+ printf("Designed and Programmed By Salvador Eduardo Tropea SET. Copyright 1997-1999.\n"
+ "Original plasma idea By Jan Mller & Erik Hansen.\n\n"
+ "There is NO warranty. You may redistribute this software\n"
+ "under the terms of the GNU General Public License.\n"
+ "For more information about these matters, see the files named COPYING.\n");
+ exit(100);
+}
+
+int end_if_user_ready(void)
+{
+ if (poll_input())
+ terminate();
+ return 0;
+}
+
+
+void PrintHelp(void)
+{
+ printf(
+"\n"
+"Plasma 2 test (c) 1997 by Salvador E. Tropea (SET)\n"
+"e-mail: salvador@inti.gov.ar\n"
+"\n"
+"Use: ps2 [-s] [-h] [-g] [-k float] [-i] [-n]\n"
+"\n"
+"s: Don't wait for vertical retrace, smooth but you can't meassure the\n"
+" frame rate.\n"
+"g: Use the slow algorithm to calculate the surfaces (needed for -k).\n"
+"k: Constant for the plasma sine period. Default: 18.334.\n"
+"h: Shows this help.\n"
+"i: Shows information.\n"
+"n: Descriptive name.\n"
+);
+}
+
+
+void ShowInfo(void)
+{
+printf(
+"\n"
+"Name: Plasma 2\n"
+"Copyright: GPL, (c) 1997-1999 by Salvador E. Tropea (SET)\n"
+"Author: Designed and Programmed By Salvador Eduardo Tropea SET.\n"
+" Original plasma idea By Jan Mller & Erik Hansen.\n"
+"Description: A sequence of nice plasma effects based the addition of\n"
+" surfaces.\n"
+);
+}
+
+#define Blit() if (WaitSync) \
+ vsync(); \
+ blit(BMPAuxScreen); \
+ Frames++
+
+//#define PROFILE
+int main(int argc, char *argv[])
+{
+ int i,Frames=0;
+ unsigned long t1=0,t2,t3,t4;
+ float Time;
+ double k=18.334;
+ int ForceGeneric=0;
+ int Surface=1,UnoMas;
+
+ for (i=1; i<argc; i++)
+ {
+ UnoMas=i<argc-1;
+ if (argv[i][0]=='-')
+ {
+ switch (argv[i][1])
+ {
+ case 's':
+ WaitSync=0;
+ break;
+ case 'g':
+ ForceGeneric=1;
+ break;
+ case 'h':
+ PrintHelp();
+ return 1;
+ case 'i':
+ ShowInfo();
+ return 2;
+ case 'n':
+ printf("Plasma mixsurf 1\n");
+ return 3;
+ case 'F':
+ Surface=0;
+ break;
+ case 'k':
+ if (UnoMas)
+ k=atof(argv[++i]);
+ break;
+ }
+ }
+ }
+
+ AllegroInit();
+ CalcuInit();
+
+ // Virtual screen
+ BMPAuxScreen=create_bitmap(w,h);
+ screen_buffer=BMPAuxScreen->line[0];
+
+ RPF_MakeBlueGreen_RedBars(temp2);
+
+ if (!ForceGeneric)
+ {
+ t3=rawclock();
+ PLA2_InitPlasmaTables();
+ t4=rawclock();
+ AllegroSetMode();
+
+ RPF_RGBBarsWithCos(temp);
+ RPF_SetAllPal(temp);
+ t1=rawclock();
+ while (!poll_input())
+ {
+ for (i=0; i<1000 && !poll_input(); i++)
+ {
+ PLA2_Step2(screen_buffer);
+ RPF_RGBBarsWithCos(temp);
+ if (WaitSync)
+ vsync();
+ PS_FullBlitLinear(BMPAuxScreen,screen);
+ Frames++;
+ RPF_SetAllPal(temp);
+ }
+ if (i<1000) break;
+ RPF_SetAllPal(temp2);
+ for (i=0; i<1000 && !poll_input(); i++)
+ {
+ PLA2_Step2(screen_buffer);
+ if (WaitSync)
+ vsync();
+ PS_FullBlitLinear(BMPAuxScreen,screen);
+ Frames++;
+ }
+ if (i<1000) break;
+ }
+ }
+ else
+ {
+ t3=rawclock();
+ PLA2G_InitPlasmaTables(w,h,screen_buffer,k,Surface,w*2,h*2,CalcuCallBack);
+ t4=rawclock();
+ AllegroSetMode();
+ RPF_RGBBarsWithCos(temp);
+ RPF_SetAllPal(temp);
+ t1=rawclock();
+ while (!poll_input())
+ {
+ for (i=0; i<1000 && !poll_input(); i++)
+ {
+ MVS_4SurfSC();
+ RPF_RGBBarsWithCos(temp);
+ Blit();
+ RPF_SetAllPal(temp);
+ }
+ if (i<1000) break;
+ RPF_SetAllPal(temp2);
+ for (i=0; i<1000 && !poll_input(); i++)
+ {
+ MVS_4SurfSC();
+ Blit();
+ }
+ if (i<1000) break;
+ }
+ }
+ t2=rawclock();
+ PLA2G_DeInit();
+ allegro_exit();
+
+ Time=(t2-t1)/18.2;
+ printf("Time: %f Frames: %d => %f fps.\n",Time,Frames,Frames/Time);
+ Time=(t4-t3)/18.2;
+ printf("Initialization time: %f.\n",Time);
+
+ terminate();
+ return 0;
+}
+
diff --git a/setedit/scrnsave/plasma2/ps2.gpr b/setedit/scrnsave/plasma2/ps2.gpr
new file mode 100644
index 0000000..e2fcfea
--- /dev/null
+++ b/setedit/scrnsave/plasma2/ps2.gpr
Binary files differ
diff --git a/setedit/scrnsave/plasma2/ps2.mak b/setedit/scrnsave/plasma2/ps2.mak
new file mode 100644
index 0000000..37a2be8
--- /dev/null
+++ b/setedit/scrnsave/plasma2/ps2.mak
@@ -0,0 +1,335 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# E:\DJ\BIN/gpr2mak.exe plasma2/ps2.gpr
+vpath_src=e:/pruebas/p/plasmlib e:/pruebas/p/plasmlib/include
+vpath %.c $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath %.cpp $(vpath_src)
+vpath %.C $(vpath_src)
+vpath %.cxx $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.S $(vpath_src)
+vpath %.p $(vpath_src)
+vpath %.pas $(vpath_src)
+vpath %.f $(vpath_src)
+vpath %.for $(vpath_src)
+vpath %.F $(vpath_src)
+vpath %.fpp $(vpath_src)
+vpath %.i $(vpath_src)
+vpath %.ii $(vpath_src)
+vpath %.m $(vpath_src)
+vpath %.asm $(vpath_src)
+vpath %.nsm $(vpath_src)
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=../fakealle/include ../plasmlib/include
+LIB_DIRS=../fakealle ../plasmlib
+C_DEBUG_FLAGS=-gstabs+
+C_OPT_FLAGS=-O2 -ffast-math -fomit-frame-pointer
+C_WARN_FLAGS=-Wall -Werror
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=fakea plasm mixsf
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=ps2.o
+LIBRARIES=
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=e:/pruebas/p/plasmlib e:/pruebas/p/plasmlib/include
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=ps2.exe
+PROJECT_ITEMS=ps2.c
+DEFAULT_MASK=*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= ps2.o
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+ps2.exe:: $(DEPS_0)
+ $(RHIDE_COMPILE_LINK)
+DEPS_1=ps2.c ../fakealle/include/fakealle.h ../fakealle/include/putscree.h\
+ ../fakealle/include/varios.h ../plasmlib/include/math1.h\
+ ../plasmlib/include/math4.h ../plasmlib/include/movsurf1.h\
+ ../plasmlib/include/palette.h ../plasmlib/include/plasa1.h
+ps2.o:: $(DEPS_1)
+ $(RHIDE_COMPILE.c.o)
+all:: ps2.exe
diff --git a/setedit/scrnsave/plasma3/ps3.c b/setedit/scrnsave/plasma3/ps3.c
new file mode 100644
index 0000000..f839009
--- /dev/null
+++ b/setedit/scrnsave/plasma3/ps3.c
@@ -0,0 +1,145 @@
+/* Copyright (C) 1997-2001 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Description:
+ That's an example on how to use the plasma 3 module. @x{Plasma 3}.
+ It test the generic resolution version. Use -s to force a vsync.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <conio.h>
+#include <string.h>
+
+#include "fakealle.h"
+#include "palette.h"
+#include "math1.h"
+#include "plasa1.h"
+#include "movsurf2.h"
+#include "varios.h"
+
+#include <time.h>
+
+RawPal temp,temp2;
+unsigned char *screen_buffer;
+BITMAP *BMPAuxScreen;
+int c,w=320,h=200;
+
+void terminate(void)
+{//Sets text mode and ends program.
+ printf("Designed and Programmed By Salvador Eduardo Tropea SET. Copyright 1997-1999.\n"
+ "Original plasma idea By JCL-software (Jezza). Copyright 1994.\n\n"
+ "There is NO warranty. You may redistribute this software\n"
+ "under the terms of the GNU General Public License.\n"
+ "For more information about these matters, see the files named COPYING.\n");
+ exit(100);
+}
+
+void end_if_user_ready(void)
+{
+ if (keypressed())
+ terminate();
+}
+
+void PrintHelp(void)
+{
+ printf(
+"\n"
+"Plasma 3 test (c) 1997-1999 by Salvador E. Tropea (SET)\n"
+"e-mail: salvador@inti.gov.ar\n"
+"\n"
+"Use: ps3 [-s] [-h] [-i] [-n]\n"
+"\n"
+"s: Don't wait for vertical retrace, smooth but you can't meassure the\n"
+" frame rate.\n"
+"h: Shows this help.\n"
+"i: Shows information.\n"
+"n: Descriptive name.\n"
+);
+}
+
+void ShowInfo(void)
+{
+printf(
+"\n"
+"Name: Plasma 3\n"
+"Copyright: GPL, (c) 1997-1999 by Salvador E. Tropea (SET)\n"
+"Author: Designed and Programmed By Salvador Eduardo Tropea SET.\n"
+" Original plasma idea By JCL-software (Jezza). (c) 1994.\n"
+"Description: A sequence of nice plasma effects based the addition of\n"
+" surfaces.\n"
+);
+}
+
+#define Blit() blit(BMPAuxScreen)
+
+int main(int argc, char *argv[])
+{
+ unsigned long t1a,t2a;
+ int i;
+ int ErrorPar=0;
+ unsigned long t1,t2;
+ int WaitSync=1,Frames=0;
+ double t;
+
+ for (i=1; !ErrorPar && i<argc; i++)
+ {
+ if (argv[i][0]=='-')
+ {
+ switch (argv[i][1])
+ {
+ case 's':
+ WaitSync=0;
+ break;
+ case 'h':
+ PrintHelp();
+ return 1;
+ case 'i':
+ ShowInfo();
+ return 2;
+ case 'n':
+ printf("Plasma mixsurf 2\n");
+ return 3;
+ }
+ }
+ }
+
+ AllegroInit();
+ CalcuInit();
+
+ // Virtual screen
+ BMPAuxScreen=create_bitmap(w,h);
+ screen_buffer=BMPAuxScreen->line[0];
+
+ // 1.3Mb of table for 800x600!
+ t1a=rawclock();
+ PLA3_InitPlasmaTables(1,w,h,screen_buffer,(int)(w*1.8) & 0xFFFFFFFC,
+ (int)(h*1.5) & 0xFFFFFFFC,NULL,CalcuCallBack);
+ t2a=rawclock();
+
+ AllegroSetMode();
+
+ t1=rawclock();
+ while (!keypressed())
+ {
+ MVS_2SurfA();
+ if (WaitSync)
+ vsync();
+ PLA3_StepPal();
+ Blit();
+ Frames++;
+ }
+ t2=rawclock();
+ allegro_exit();
+ PLA3_DeInit();
+
+ t=(t2-t1)/18.2;
+ printf("Time: %f Frames: %d => %f fps\n",t,Frames,Frames/t);
+ t=(t2a-t1a)/18.2;
+ printf("Initialization: %f s\n",t);
+ terminate();
+ return 0;
+}
+
diff --git a/setedit/scrnsave/plasma3/ps3.gpr b/setedit/scrnsave/plasma3/ps3.gpr
new file mode 100644
index 0000000..9de48c2
--- /dev/null
+++ b/setedit/scrnsave/plasma3/ps3.gpr
Binary files differ
diff --git a/setedit/scrnsave/plasma3/ps3.mak b/setedit/scrnsave/plasma3/ps3.mak
new file mode 100644
index 0000000..b80e01c
--- /dev/null
+++ b/setedit/scrnsave/plasma3/ps3.mak
@@ -0,0 +1,334 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# E:\DJ\BIN/gpr2mak.exe plasma3/ps3.gpr
+vpath_src=e:/pruebas/p/plasmlib e:/pruebas/p/plasmlib/include
+vpath %.c $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath %.cpp $(vpath_src)
+vpath %.C $(vpath_src)
+vpath %.cxx $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.S $(vpath_src)
+vpath %.p $(vpath_src)
+vpath %.pas $(vpath_src)
+vpath %.f $(vpath_src)
+vpath %.for $(vpath_src)
+vpath %.F $(vpath_src)
+vpath %.fpp $(vpath_src)
+vpath %.i $(vpath_src)
+vpath %.ii $(vpath_src)
+vpath %.m $(vpath_src)
+vpath %.asm $(vpath_src)
+vpath %.nsm $(vpath_src)
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=../fakealle/include ../plasmlib/include
+LIB_DIRS=../fakealle ../plasmlib
+C_DEBUG_FLAGS=-gstabs+
+C_OPT_FLAGS=-O2 -ffast-math -fomit-frame-pointer
+C_WARN_FLAGS=-Wall -Werror
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=fakea plasm mixsf
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=ps3.o
+LIBRARIES=
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=e:/pruebas/p/plasmlib e:/pruebas/p/plasmlib/include
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=ps3.exe
+PROJECT_ITEMS=ps3.c
+DEFAULT_MASK=*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= ps3.o
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+ps3.exe:: $(DEPS_0)
+ $(RHIDE_COMPILE_LINK)
+DEPS_1=ps3.c ../fakealle/include/fakealle.h ../fakealle/include/varios.h\
+ ../plasmlib/include/math1.h ../plasmlib/include/movsurf2.h\
+ ../plasmlib/include/palette.h ../plasmlib/include/plasa1.h
+ps3.o:: $(DEPS_1)
+ $(RHIDE_COMPILE.c.o)
+all:: ps3.exe
diff --git a/setedit/scrnsave/plasma4/ps4.c b/setedit/scrnsave/plasma4/ps4.c
new file mode 100644
index 0000000..a7d9817
--- /dev/null
+++ b/setedit/scrnsave/plasma4/ps4.c
@@ -0,0 +1,186 @@
+/* Copyright (C) 1997-2001 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Description:
+ That's an example on how to use the plasma 4 module. @x{Plasma 4}.
+ It test the generic resolution version. Use -s to force a vsync.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <conio.h>
+#include <string.h>
+#include <time.h>
+
+#include "fakealle.h"
+#include "palette.h"
+#include "math1.h"
+#include "mksurf4.h"
+#include "plasa1.h"
+#include "lissa.h"
+#include "varios.h"
+#include "movsurf2.h"
+
+#include <time.h>
+
+RawPal temp,temp2;
+unsigned char *screen_buffer;
+BITMAP *BMPAuxScreen,*BMPMap;
+int c,w=320,h=200;
+
+void terminate(void)
+{//Sets text mode and ends program.
+ printf("Designed and Programmed By Salvador Eduardo Tropea SET. Copyright 1997-1999.\n"
+ "Original plasma idea By Tom Dibble. Copyright 1994.\n\n"
+ "There is NO warranty. You may redistribute this software\n"
+ "under the terms of the GNU General Public License.\n"
+ "For more information about these matters, see the files named COPYING.\n");
+ exit(100);
+}
+
+void end_if_user_ready(void)
+{
+ if (keypressed())
+ terminate();
+}
+
+void PrintHelp(void)
+{
+ printf(
+"\n"
+"Plasma 4 test (c) 1997 by Salvador E. Tropea (SET)\n"
+"e-mail: salvador@inti.gov.ar\n"
+"\n"
+"Use: ps4 [-s] [-h] [-t 0|1|3] [-i] [-n]\n"
+"\n"
+"s: Don't wait for vertical retrace, smooth but you can't meassure the\n"
+" frame rate.\n"
+"h: Shows this help.\n"
+"t: Sets the amplitud of the start recursion. 0 is smooth and 3 rought.\n"
+" Default: 3.\n"
+"i: Shows information.\n"
+"n: Descriptive name.\n"
+"\n"
+);
+}
+
+void ShowInfo(void)
+{
+printf(
+"\n"
+"Name: Plasma 4\n"
+"Copyright: GPL, (c) 1997-1999 by Salvador E. Tropea (SET)\n"
+"Author: Designed and Programmed By Salvador Eduardo Tropea SET.\n"
+" Original plasma idea By Tom Dibble. Copyright 1994.\n"
+"Description: A sequence of nice plasma effects based the addition of\n"
+" surfaces. The surfaces are randomly generated.\n"
+);
+}
+
+
+
+#define Blit() blit(BMPAuxScreen)
+
+int main(int argc, char *argv[])
+{
+ int w2,h2;
+ unsigned long t1,t2,t1a,t2a;
+ int i;
+ int UnoMas,MaskInit=255;
+ int WaitSync=1,Frames=0,tipo,count;
+ double t;
+
+ for (i=1; i<argc; i++)
+ {
+ UnoMas=i<argc-1;
+ if (argv[i][0]=='-')
+ {
+ switch (argv[i][1])
+ {
+ case 's':
+ WaitSync=0;
+ break;
+ case 'h':
+ PrintHelp();
+ return 1;
+ case 'i':
+ ShowInfo();
+ return 2;
+ case 'n':
+ printf("Plasma mixsurf random\n");
+ return 3;
+ case 't':
+ if (UnoMas)
+ {
+ tipo=atoi(argv[++i]);
+ if (!(tipo!=0 && tipo!=1 && tipo!=3))
+ MaskInit=(tipo<<6) | 0x3F;
+ }
+ break;
+ }
+ }
+ }
+
+ AllegroInit();
+ CalcuInit();
+
+ // Multiplo de 4!
+ w2=(int)(w*1.8) & 0xFFFFFFFC; h2=(int)(h*1.5) & 0xFFFFFFFC;
+ // Virtual screen
+ BMPAuxScreen=create_bitmap(w,h);
+ screen_buffer=BMPAuxScreen->line[0];
+ // Plasma Map
+ BMPMap=create_bitmap(w2,h2);
+ // Generate the plasma random surface
+ t1a=rawclock();
+ MKS_RamdomFrac1(BMPMap,MaskInit,CalcuCallBack);
+ t2a=rawclock();
+
+ AllegroSetMode();
+
+ // Pass it to the plasma 3 engine
+ PLA3_InitPlasmaTables(1,w,h,screen_buffer,w2,h2,BMPMap->line[0],CalcuCallBack);
+
+ t1=rawclock();
+ while (!keypressed())
+ {
+ count=0;
+ while (!keypressed() && count++<1400)
+ {
+ MVS_2SurfA();
+ if (WaitSync)
+ vsync();
+ PLA3_StepPal();
+ Blit();
+ Frames++;
+ }
+ if (count<1400) break;
+ //readkey();
+ RPF_MakeBlueGreen_RedBars(temp);
+ RPF_SetAllPal(temp);
+ count=0;
+ while (!keypressed() && count++<1400)
+ {
+ MVS_2SurfA();
+ if (WaitSync)
+ vsync();
+ Blit();
+ Frames++;
+ }
+ if (count<1400) break;
+ }
+ t2=rawclock();
+
+ allegro_exit();
+ PLA3_DeInit();
+
+ t=(t2-t1)/18.2;
+ printf("Time: %f Frames: %d => %f fps\n",t,Frames,Frames/t);
+ t=(t2a-t1a)/18.2;
+ printf("Initialization: %f s\n",t);
+ terminate();
+ return 0;
+}
+
diff --git a/setedit/scrnsave/plasma4/ps4.gpr b/setedit/scrnsave/plasma4/ps4.gpr
new file mode 100644
index 0000000..4c88ea1
--- /dev/null
+++ b/setedit/scrnsave/plasma4/ps4.gpr
Binary files differ
diff --git a/setedit/scrnsave/plasma4/ps4.mak b/setedit/scrnsave/plasma4/ps4.mak
new file mode 100644
index 0000000..70a1ee2
--- /dev/null
+++ b/setedit/scrnsave/plasma4/ps4.mak
@@ -0,0 +1,338 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# e:/dj/bin/gpr2mak.exe ps4.gpr
+vpath_src=../plasmlib
+vpath %.c $(vpath_src)
+vpath %.cc $(vpath_src)
+vpath %.cpp $(vpath_src)
+vpath %.C $(vpath_src)
+vpath %.cxx $(vpath_src)
+vpath %.s $(vpath_src)
+vpath %.S $(vpath_src)
+vpath %.p $(vpath_src)
+vpath %.pas $(vpath_src)
+vpath %.f $(vpath_src)
+vpath %.for $(vpath_src)
+vpath %.F $(vpath_src)
+vpath %.fpp $(vpath_src)
+vpath %.i $(vpath_src)
+vpath %.ii $(vpath_src)
+vpath %.m $(vpath_src)
+vpath %.asm $(vpath_src)
+vpath %.nsm $(vpath_src)
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=../fakealle/include ../plasmlib/include
+LIB_DIRS=../fakealle ../plasmlib
+C_DEBUG_FLAGS=-gstabs+
+C_OPT_FLAGS=-O2 -ffast-math -fomit-frame-pointer
+C_WARN_FLAGS=-Wall -Werror
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=fakea plasm mixsf
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=-DFAKE_ALLEGRO
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=mksurf4.o ps4.o
+LIBRARIES=
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=../plasmlib
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=ps4.exe
+PROJECT_ITEMS=mksurf4.c ps4.c
+DEFAULT_MASK=*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= mksurf4.o ps4.o
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+ps4.exe:: $(DEPS_0)
+ $(RHIDE_COMPILE_LINK)
+DEPS_1=mksurf4.c ../fakealle/include/fakealle.h ../plasmlib/include/math2.h
+mksurf4.o:: $(DEPS_1)
+ $(RHIDE_COMPILE.c.o)
+DEPS_2=ps4.c ../fakealle/include/fakealle.h ../fakealle/include/varios.h\
+ ../plasmlib/include/lissa.h ../plasmlib/include/math1.h\
+ ../plasmlib/include/mksurf4.h ../plasmlib/include/movsurf2.h\
+ ../plasmlib/include/palette.h ../plasmlib/include/plasa1.h
+ps4.o:: $(DEPS_2)
+ $(RHIDE_COMPILE.c.o)
+all:: ps4.exe
diff --git a/setedit/scrnsave/plasmlib/include/lissa.h b/setedit/scrnsave/plasmlib/include/lissa.h
new file mode 100644
index 0000000..8bd779d
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/lissa.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct
+{
+ int Xc,Yc; // Center
+ double w,h; // Size
+ double Dalpha; // X angle increment
+ double Dbeta; // Y angle increment
+ double alpha,beta; // Actual angle
+ int len; // Number of points to calculate
+ int flags; // By now just what angle needs wrap
+} Lissajous;
+
+#define LS_BetaWrap 1
+#define LS_AlphaWrap 2
+#define LS_BothWrap 4
+
+void LS_GetPoint(Lissajous *l, int *x, int *y);
+void LST_GetPoint(Lissajous *l, int *x, int *y);
+void LS_FillOffsets(Lissajous *l, int *off, int interleave, int w);
+void LST_FillOffsets(Lissajous *l, int *off, int interleave, int w);
+void LS_FillDegrees(Lissajous *l, int len, double a0, double b0, int a, int b,
+ int x1, int y1, int x2, int y2);
+void LST_FillDegrees(Lissajous *l, int len, double a0, double b0, int a,
+ int b, int x1, int y1, int x2, int y2);
+#ifndef NO_BITMAP
+void LS_DrawLissajous(BITMAP *b,Lissajous *l,int color);
+void LST_DrawLissajous(BITMAP *b,Lissajous *l,int color);
+#endif
+void LS_FillRadInc(Lissajous *l, int len, double a0, double b0, double a,
+ double b, int x1, int y1, int x2, int y2);
+void LS_FillXY(Lissajous *l, int *off, int interleave);
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/setedit/scrnsave/plasmlib/include/math1.h b/setedit/scrnsave/plasmlib/include/math1.h
new file mode 100644
index 0000000..294f22f
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/math1.h
@@ -0,0 +1,190 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define TrigTableSize (360*2)
+#define cos_table (sin_table+TrigTableSize/4)
+#define tsinConst (1/255.0)
+
+extern int sin_table[];
+
+void MA1_CreateLookUp(void);
+
+#ifndef PI
+#define PI 3.14159265358979323846
+#endif
+
+/**[txh]*****
+
+ Function: MA1_WrapAngleG (macro)
+ Prototype: MA1_WrapAngleG(a)
+ Module: Math 1
+ Include: math1.h
+ Description:
+ If the angle is greater than 360 degrees it decrease the value in 360.@p
+ To be used after an increment of less than 360 degrees.@p
+
+************/
+#define MA1_WrapAngleG(a) if (a>=TrigTableSize) a-=TrigTableSize
+/**[txh]*****
+
+ Function: MA1_WrapAngleB (macro)
+ Prototype: MA1_WrapAngleB(a)
+ Description:
+ If the angle is less than 0 degrees it increase the value in 360.@p
+ To be used after an decrement of less than 360 degrees.@p
+
+************/
+#define MA1_WrapAngleB(a) if (a<0) a+=TrigTableSize
+/**[txh]*****
+
+ Function: MA1_WrapAngleG2 (macro)
+ Prototype: MA1_WrapAngleG2(a)
+ Description:
+ If the angle is greater than 720 degrees it decrease the value in 720.@p
+ To be used after an increment of less than 720 degrees.@p
+
+************/
+#define MA1_WrapAngleG2(a) if (a>=TrigTableSize*2) a-=TrigTableSize*2
+/**[txh]*****
+
+ Function: MA1_WrapAngleB2 (macro)
+ Prototype: MA1_WrapAngleB2(a)
+ Description:
+ If the angle is less than 0 degrees it increase the value in 720.@p
+ To be used after an decrement of less than 720 degrees.@p
+
+************/
+#define MA1_WrapAngleB2(a) if (a<0) a+=TrigTableSize*2
+/**[txh]*****
+
+ Function: MA1_FromDegrees (macro)
+ Prototype: MA1_FromDegrees(a)
+ Description:
+ Converts A from degrees to a suitable table for the look-up table.@p
+ A must be in [0,720] degrees range.@p
+
+ Return:
+ The converted value.
+
+************/
+#define MA1_FromDegrees(a) ((a)*(TrigTableSize/360))
+/**[txh]*****
+
+ Function: MA1_FromRad (macro)
+ Prototype: MA1_FromRad(a)
+ Description:
+ Converts A from radians to a suitable table for the look-up table.@p
+ A must be in [0,720] degrees range.@p
+
+ Return:
+ The converted value.
+
+************/
+#define MA1_FromRad(a) ((a)*TrigTableSize/(2*PI))
+/**[txh]*****
+
+ Function: MA1_IncAngRad (macro)
+ Prototype: MA1_IncAngRad(a,b)
+ Description:
+ Adds B to A and then wraps the value. Use it to increment angles safetly.@p
+ B is in radians, the convertion is made with macros so if you provide a
+constant there is no penalty.@p
+ B must be less than 360 degrees.@p
+
+************/
+#define MA1_IncAngRad(a,b) a+=MA1_FromRad(b); MA1_WrapAngleG(a)
+/**[txh]*****
+
+ Function: MA1_IncAng (macro)
+ Prototype: MA1_IncAng(a,b)
+ Description:
+ Adds B to A and then wraps the value. Use it to increment angles safetly.@p
+ B is the units of the array. @x{MA1_FromRad (macro)}. @x{MA1_FromDegrees (macro)}.@p
+ B must be less than 360 degrees.@p
+
+************/
+#define MA1_IncAng(a,b) a+=b; MA1_WrapAngleG(a)
+/**[txh]*****
+
+ Function: MA1_DecAng (macro)
+ Prototype: MA1_DecAng(a,b)
+ Description:
+ Substracts B from A and then wraps the value. Use it to decrement angles
+safetly.@p
+ B is the units of the array. @x{MA1_FromRad (macro)}. @x{MA1_FromDegrees (macro)}.@p
+ B must be less than 360 degrees.@p
+
+************/
+#define MA1_DecAng(a,b) a-=b; MA1_WrapAngleB(a)
+/**[txh]*****
+
+ Function: MA1_DegToRad (macro)
+ Prototype: MA1_DegToRad(a)
+ Description:
+ Converts A degrees to radians.
+
+ Return:
+ The converted value in double format.
+
+************/
+#define MA1_DegToRad(a) (a*PI/180)
+
+/**[txh]*****
+
+ Description:
+ Calculates the sin of V and returns a value in the [-1,1] range.@p
+ Is inline. V is in the units of the array.@p
+
+ Return:
+ A double.
+
+************/
+extern inline double tsin(int v)
+{
+ return sin_table[v]*tsinConst;
+}
+
+/**[txh]*****
+
+ Description:
+ Calculates the cos of V and returns a value in the [-1,1] range.@p
+ Is inline. V is in the units of the array.@p
+
+ Return:
+ A double.
+
+************/
+extern inline double tcos(int v)
+{
+ return cos_table[v]*tsinConst;
+}
+
+/**[txh]*****
+
+ Description:
+ Is a wrapper to avoid the direct use of the array.@p
+ Is inline an is just return sin_table[v];
+
+************/
+extern inline int t255sin(int v)
+{
+ return sin_table[v];
+}
+
+/**[txh]*****
+
+ Description:
+ Is a wrapper to avoid the direct use of the array.@p
+ Is inline an is just return cos_table[v];
+
+************/
+extern inline int t255cos(int v)
+{
+ return cos_table[v];
+}
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/setedit/scrnsave/plasmlib/include/math2.h b/setedit/scrnsave/plasmlib/include/math2.h
new file mode 100644
index 0000000..a16bf59
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/math2.h
@@ -0,0 +1,9 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// 64Kb
+#define RandomTableSize 0x10000
+extern unsigned char RandomTable[RandomTableSize];
+// short to wrap in the table
+extern unsigned short RandomTablePos;
+#define MA2_GetRand8() RandomTable[RandomTablePos++]
+void MA2_InitRTable(void);
diff --git a/setedit/scrnsave/plasmlib/include/math4.h b/setedit/scrnsave/plasmlib/include/math4.h
new file mode 100644
index 0000000..b94b995
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/math4.h
@@ -0,0 +1,121 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int XSin256t[];
+extern int YSin256t[];
+extern double DSin256t[];
+
+// 320 values and not 512 ;-)
+#define XCos256t (XSin256t+64)
+#define YCos256t (YSin256t+64)
+#define DCos256t (DSin256t+64)
+
+#define MA4NoScale 1
+#define MA4Scale 0
+#define MA4XSin 2
+#define MA4YSin 0
+
+// Only 16 bits used but 16 bits access is slow in 32 bits modes
+typedef int fix8_8;
+
+#define MA4_FromRad(a) ((a)*256/(2*PI))
+#define MA4_FromDeg(a) ((a)*256/360.0)
+
+extern inline fix8_8 MA4_f2fix(double x)
+{
+ return (fix8_8)(x*256.0+0.5);
+}
+
+extern inline double MA4_fix2f(fix8_8 x)
+{
+ return x/256.0;
+}
+
+extern inline fix8_8 MA4_i2fix(int x)
+{
+ return (fix8_8)(x*256);
+}
+
+extern inline int MA4_fix2i(fix8_8 x)
+{
+ return x/256;
+}
+
+//#define USE_EAX
+
+// Fast, not the best but supports decimal increments
+extern inline int MA4_XSin(fix8_8 x)
+{
+#ifdef USE_EAX
+ int result;
+ __asm__ __volatile__ (
+" movzbl %%ah,%%eax \n"
+" movl _XSin256t(,%%eax,4),%k0 \n"
+ : "=r" (result)
+ : "a" (x));
+ return result;
+#else
+ return XSin256t[(x>>8) & 0xFF];
+#endif
+}
+
+// With round
+extern inline int MA4_XSinR(fix8_8 x)
+{
+#ifdef USE_EAX
+ int result;
+ __asm__ __volatile__ (
+" addl $0x80,%%eax \n"
+" movzbl %%ah,%%eax \n"
+" movl _XSin256t(,%%eax,4),%k0 \n"
+ : "=r" (result)
+ : "a" (x));
+ return result;
+#else
+ return XSin256t[((x+0x80)>>8) & 0xFF];
+#endif
+}
+
+extern inline int MA4_YSin(fix8_8 x)
+{
+ return YSin256t[(x>>8) & 0xFF];
+}
+
+// With round
+extern inline int MA4_YSinR(fix8_8 x)
+{
+ return YSin256t[((x+0x80)>>8) & 0xFF];
+}
+
+extern inline int MA4_XCos(fix8_8 x)
+{
+ return XCos256t[(x>>8) & 0xFF];
+}
+
+// With round
+extern inline int MA4_XCosR(fix8_8 x)
+{
+ return XCos256t[((x+0x80)>>8) & 0xFF];
+}
+
+extern inline int MA4_YCos(fix8_8 x)
+{
+ return YCos256t[(x>>8) & 0xFF];
+}
+
+// With round
+extern inline int MA4_YCosR(fix8_8 x)
+{
+ return YCos256t[((x+0x80)>>8) & 0xFF];
+}
+
+void MA4_FillTable(double Amp, double Off, double Scale, int Flags);
+void MA4_FillTableI(int Amp, int Off, int Scale, int Flags);
+void MA4_FillTableIW(int Amp, int Off, int Scale, int Flags);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/setedit/scrnsave/plasmlib/include/mixsurf.h b/setedit/scrnsave/plasmlib/include/mixsurf.h
new file mode 100644
index 0000000..118ce4a
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/mixsurf.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct
+{
+ unsigned *s1,*s2,*s3,*s4;
+ unsigned char *dest;
+ unsigned sWw,sH,mWw,mW;
+} MS_4struct;
+
+extern MS_4struct MS_4;
+
+void MS_4add(void);
+void MS_4addC(void);
+void MS_4addW(void);
+void MS_3add(void);
+void MS_3addC(void);
+void MS_2addC(void);
+void MS_2add(void);
+void MS_InvertDWordScreen(int w, int h, unsigned char *b);
+#ifndef NO_BITMAP
+void MS_AddBmpsMem(BITMAP *source, BITMAP *dest, int source_x,
+ int source_y, int dest_x, int dest_y, int width,
+ int height);
+void MS_CutBMPColorsAt(BITMAP *bmp, unsigned char cut, unsigned char val);
+void MS_CutBMPColorsAtInv(BITMAP *bmp, unsigned char cut, unsigned char val);
+void MS_AddWithMaskMem(BITMAP *source, BITMAP *dest, int source_x,
+ int source_y, int dest_x, int dest_y, int width,
+ int height,int val);
+void MS_AddWithMaskMemC(char *source, BITMAP *dest, int dest_x,
+ int dest_y, int width, int height,int val);
+void MS_CompactMask(BITMAP *bmp);
+void MS_DumpCompacted(BITMAP *bmp, char *name, char *file);
+#endif // NO_BITMAP
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/setedit/scrnsave/plasmlib/include/mksurf.h b/setedit/scrnsave/plasmlib/include/mksurf.h
new file mode 100644
index 0000000..b70791f
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/mksurf.h
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void MKS_DistCentS(int w, int h, unsigned char *s, int sw, int sh,
+ void (*CallBack)());
+void MKS_SinDisCentS(int w, int h, unsigned char *s, int sw, int sh,
+ double Bsize, void (*CallBack)());
+
+void MKS_SinDisCentSf(int w, int h, unsigned char *s, int sw, int sh,
+ double Bsize, void (*CallBack)());
+void MKS_C2ySySiCx(int w, int h, unsigned char *s, void (*CallBack)());
+void MKS_SxCxSyCySxyCh(int w, int h, unsigned char *s, void (*CallBack)(void));
+void MKS_SxCxSyCySxy(int w, int h, unsigned char *s, void (*CallBack)(void));
+
diff --git a/setedit/scrnsave/plasmlib/include/mksurf4.h b/setedit/scrnsave/plasmlib/include/mksurf4.h
new file mode 100644
index 0000000..7d1a85e
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/mksurf4.h
@@ -0,0 +1,3 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+int MKS_RamdomFrac1(BITMAP *bmp, unsigned char adj, void (*CallBack)());
diff --git a/setedit/scrnsave/plasmlib/include/movsurf1.h b/setedit/scrnsave/plasmlib/include/movsurf1.h
new file mode 100644
index 0000000..4c71b7d
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/movsurf1.h
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+typedef struct
+{
+ fix8_8 c1,c2,c3,c4,c5,c6,c7,c8; // 8 angles
+ fix8_8 i1,i2,i3,i4,i5,i6,i7,i8; // 8 increments
+ char *s1,*s2,*s3,*s4; // 4 surfaces
+} MVS_4struct;
+
+extern MVS_4struct MVS_4;
+void MVS_4SurfSC(void);
+
diff --git a/setedit/scrnsave/plasmlib/include/movsurf2.h b/setedit/scrnsave/plasmlib/include/movsurf2.h
new file mode 100644
index 0000000..de49bf2
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/movsurf2.h
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+typedef struct
+{
+ int cont; // starting point
+ int cant; // number of points
+ unsigned *Tray; // trajectory
+ char *s1,*s2; // Surfaces
+} MVS_2Astruct;
+
+extern MVS_2Astruct MVS_2A;
+void MVS_2SurfA(void);
diff --git a/setedit/scrnsave/plasmlib/include/palette.h b/setedit/scrnsave/plasmlib/include/palette.h
new file mode 100644
index 0000000..97c27f1
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/palette.h
@@ -0,0 +1,45 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef unsigned char RawPal[768];
+
+/* Nutty's set_entire_palette */
+/* Our inline set palette function. Inline for maximum speed. */
+extern __inline__ void RPF_SetAllPal(unsigned char *_pal_ptr)
+{//Sets all 768 6bit color component entries on the VGA.
+ int dummy;
+ __asm__ __volatile__(
+" movl $0x3c8, %%edx \n"
+" xorl %%eax, %%eax \n"
+" outb %%al, %%dx \n"
+" incl %%edx \n"
+" movl $768, %%ecx \n"
+" cli \n"
+" rep \n"
+" outsb \n"
+" sti \n"
+ : "=S" (dummy) : "S" (_pal_ptr) : "%eax", "%ecx", "%edx");
+}
+
+void RPF_MakeMultiPal(unsigned char *Pal); // SET
+void RPF_MakeRedBlueBar(unsigned char *Pal); // Nutty
+void RPF_MakeBlueGreenBar(unsigned char *Pal); // Nutty
+void RPF_MakeGreenRedBar(unsigned char *Pal); // SET
+void RPF_MakeGreenRedBar2(unsigned char *Pal); // Nutty
+void RPF_MakeBlueGreen_RedBars(unsigned char *Pal); // SET
+void RPF_DrawPalette(int w, int h, unsigned char *s); // SET
+void RPF_FromBlack(unsigned char *dest,unsigned char *out,int step);
+void RPF_Negative(unsigned char *orig,unsigned char *out);
+void RPF_AddPaletteStep(unsigned char *orig,unsigned char *inc,unsigned char *out,int step);
+void RPF_FromWhite(unsigned char *dest,unsigned char *out,int step);
+void RPF_RGBBarsWithCos(unsigned char *Pal);
+void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant);
+void RPF_Argentina(unsigned char *Pal);
+void RPF_GetAllegroPalette(char *pal);
+void RPF_GrayScale(unsigned char *Pal);
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/setedit/scrnsave/plasmlib/include/plasa1.h b/setedit/scrnsave/plasmlib/include/plasa1.h
new file mode 100644
index 0000000..cb17661
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/include/plasa1.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// Plasma 1 using sin(X)+cos(Y) as base. Really simple and fast
+void PLA1_Step320x200_1(unsigned char *screen_buffer);
+void PLA1_Step320x200_1b(unsigned char *screen_buffer);
+void PLA1_Step320x200_2(unsigned char *screen_buffer);
+void PLA1_Step320x200_2b(unsigned char *screen_buffer);
+void PLA1_Step320x200_3(unsigned char *screen_buffer);
+void PLA1_Step320x200_3b(unsigned char *screen_buffer);
+void PLA1_Step320x200_4(unsigned char *screen_buffer);
+void PLA1_Step320x200_5(unsigned char *screen_buffer);
+void PLA1_Step320x200_6(unsigned char *screen_buffer);
+void PLA1_Step320x200_7(unsigned char *screen_buffer);
+void PLA1_Step_1(int w, int h, unsigned char *screen_buffer);
+void PLA1_Step_2(int w, int h, unsigned char *screen_buffer);
+void PLA1_Step_3(int w, int h, unsigned char *screen_buffer);
+void PLA1_Step_4(int w, int h, unsigned char *screen_buffer);
+void PLA1_Step_7(int w, int h, unsigned char *screen_buffer);
+
+// Plasma 2 uses circles (3D cones)
+int PLA2_InitPlasmaTables(void);
+void PLA2_DeInit(void);
+void PLA2_StepBody(unsigned char *buf);
+void PLA2_Step1(unsigned char *buf);
+void PLA2_Step2(unsigned char *buf);
+void PLA2_Step3(unsigned char *buf);
+int PLA2G_InitPlasmaTables(int w,int h, unsigned char *buf,double Bsize,
+ int Surf1, int mW, int mH,
+ void (*CallBack)(void));
+void PLA2G_DeInit(void);
+void PLA2G_Step();
+
+int PLA3_InitPlasmaTables(int Surface,int w,int h,unsigned char *buf,int w2,
+ int h2,unsigned char *extSurface,
+ void (*CallBack)(void));
+void PLA3_DeInit(void);
+//void PLA3_StepMap(unsigned char *buf);
+void PLA3_StepMap(void);
+void PLA3_StepPal(void);
diff --git a/setedit/scrnsave/plasmlib/lissa.c b/setedit/scrnsave/plasmlib/lissa.c
new file mode 100644
index 0000000..726c687
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/lissa.c
@@ -0,0 +1,303 @@
+/* Copyright (C) 1997,1998,1999 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Lissajous
+ Comments:
+ That's a module to calculate smooth trajectories. By now only generates
+tables and draw the trajectory.
+
+***************************************************************************/
+
+#include <math.h>
+#include <string.h>
+#include <allegro.h>
+#include "lissa.h"
+#include "math1.h"
+
+static Lissajous lstemp;
+
+#define LS_CopyStruct(a,b) memcpy(a,b,sizeof(Lissajous))
+
+/**[txh]********************************************************************
+
+ Description:
+ Draws the trajectory to the specified BITMAP with the specified color.@p
+ Uses tables for co/sine.
+
+***************************************************************************/
+
+void LST_DrawLissajous(BITMAP *b,Lissajous *l,int color)
+{
+ int i;
+
+ LS_CopyStruct(&lstemp,l);
+ for (i=lstemp.len; i; --i)
+ {
+ putpixel(b,lstemp.Xc+(int)(lstemp.w*t255sin(lstemp.alpha)),
+ lstemp.Yc+(int)(lstemp.h*t255sin(lstemp.beta)), color);
+ MA1_IncAng(lstemp.alpha,lstemp.Dalpha);
+ MA1_IncAng(lstemp.beta,lstemp.Dbeta);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Draws the trajectory to the specified BITMAP with the specified color.@p
+ Uses FPU for co/sine.
+
+***************************************************************************/
+
+void LS_DrawLissajous(BITMAP *b,Lissajous *l,int color)
+{
+ int i;
+
+ LS_CopyStruct(&lstemp,l);
+ for (i=lstemp.len; i; --i)
+ {
+ putpixel(b,lstemp.Xc+(int)(lstemp.w*sin(lstemp.alpha)),
+ lstemp.Yc+(int)(lstemp.h*sin(lstemp.beta)), color);
+ lstemp.alpha+=lstemp.Dalpha;
+ lstemp.beta+=lstemp.Dbeta;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function fills a Lissajous structure with the needed data helping
+with the convertions. The parameter len is the number of points to generate.
+(x1,y1) (x2,y2) is the rectangle to contain the trajectory. a0 and b0 are
+the phases of the angles in degrees, for example suplying 0 and 90 you'll
+get sine v.s. cosine. a and b are the relations between the angles, where
+eta=b/a. Example a=1 and b=2 => eta=0.5 => alpha goes from 0 to 2*PI and
+b from 0 to 4*PI.
+@p
+ For example a0=0, b0=90, eta=1 is a circle; a0=0, b0=0, eta=0.5 looks like
+an eight and a0=0, b0=0, eta=2 as an infinite symbol. Good and complex
+trajectories can be achived with 1:3, 1:4 and 1:5.
+
+*****************************************************************************/
+
+void LST_FillDegrees(Lissajous *l, int len, double a0, double b0, int a,
+ int b, int x1, int y1, int x2, int y2)
+{
+ double eta=(double)b/a;
+
+ l->Xc=(x2+x1)/2;
+ l->Yc=(y2+y1)/2;
+ l->w=((x2-x1-1)/2)/255.0;
+ l->h=((y2-y1-1)/2)/255.0;
+ l->alpha=MA1_FromDegrees(a0);
+ l->beta=MA1_FromDegrees(b0);
+ if (eta>=1)
+ {
+ l->Dalpha=a*TrigTableSize/(double)len;
+ l->Dbeta=l->Dalpha*eta;
+ }
+ else
+ {
+ l->Dbeta=b*TrigTableSize/(double)len;
+ l->Dalpha=l->Dbeta/eta;
+ }
+ if (a!=1)
+ {
+ if (b!=1)
+ l->flags=LS_AlphaWrap;
+ else
+ l->flags=LS_BothWrap;
+ }
+ else
+ {
+ if (b!=1)
+ l->flags=LS_BetaWrap;
+ else
+ l->flags=0;
+ }
+
+ l->len=len;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ That's the equivalent of @x{LST_FillDegrees} but to use the FPU sin.
+
+*****************************************************************************/
+
+void LS_FillDegrees(Lissajous *l, int len, double a0, double b0, int a, int b,
+ int x1, int y1, int x2, int y2)
+{
+ double eta=(double)b/a;
+
+ l->Xc=(x2+x1)/2;
+ l->Yc=(y2+y1)/2;
+ l->w=(x2-x1-1)/2;
+ l->h=(y2-y1-1)/2;
+ l->alpha=MA1_DegToRad(a0);
+ l->beta=MA1_DegToRad(b0);
+ l->flags=0;
+ if (eta>=1)
+ {
+ l->Dalpha=a*2*PI/len;
+ l->Dbeta=l->Dalpha*eta;
+ }
+ else
+ {
+ l->Dbeta=b*2*PI/len;
+ l->Dalpha=l->Dbeta/eta;
+ }
+ l->len=len;
+}
+
+void LS_FillRadInc(Lissajous *l, int len, double a0, double b0, double a,
+ double b, int x1, int y1, int x2, int y2)
+{
+ l->Xc=(x2+x1)/2;
+ l->Yc=(y2+y1)/2;
+ l->w=(x2-x1-1)/2;
+ l->h=(y2-y1-1)/2;
+ l->alpha=a0;
+ l->beta=b0;
+ l->flags=0;
+ l->Dalpha=a;
+ l->Dbeta=b;
+ l->len=len;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function fills the array off with the offsets calculated for the
+trajectory. The offsets are x+y*w and can be used to move an object in a
+linear addressing space. interleave is the value to increment the index in
+the array, 1 is the normal, but if you want to store 2 trajectories in the
+same array you can use interleave=2.
+@p
+ That's the look-up table version. Is less accurate than the floating point
+but is 58% faster in my machine. Isn't too optimal because is very generic,
+a function where the Dalpha and Dbeta values are integer can be MUCH more
+faster.
+@p
+ The idea for this function is to pre-generate the trajectory so speed isn't
+the most important. Anyways, I got 340600 points per second, isn't so bad no?
+
+*****************************************************************************/
+
+// 340600 pps with -O2 -fast-math
+void LST_FillOffsets(Lissajous *l, int *off, int interleave, int w)
+{
+ int i,k;
+
+ LS_CopyStruct(&lstemp,l);
+ for (k=0,i=lstemp.len; i; k+=interleave,--i)
+ {
+ off[k]= lstemp.Xc+(int)(lstemp.w*t255sin(lstemp.alpha))+
+ w*(lstemp.Yc+(int)(lstemp.h*t255sin(lstemp.beta)));
+ MA1_IncAng(lstemp.alpha,lstemp.Dalpha);
+ MA1_IncAng(lstemp.beta,lstemp.Dbeta);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ The FPU version of @x{LST_FillOffsets}.
+
+***************************************************************************/
+// 192000 points per second -O2
+// 215000 pps with -O2 -fast-math
+void LS_FillOffsets(Lissajous *l, int *off, int interleave, int w)
+{
+ int i;
+
+ LS_CopyStruct(&lstemp,l);
+ for (i=lstemp.len; i; off+=interleave,--i)
+ {
+ *off= lstemp.Xc+(int)(lstemp.w*sin(lstemp.alpha))+
+ w*(lstemp.Yc+(int)(lstemp.h*sin(lstemp.beta)));
+ lstemp.alpha+=lstemp.Dalpha;
+ lstemp.beta+=lstemp.Dbeta;
+ }
+}
+
+void LS_FillXY(Lissajous *l, int *off, int interleave)
+{
+ int i;
+
+ interleave<<=1;
+ LS_CopyStruct(&lstemp,l);
+ for (i=lstemp.len; i; off+=interleave,--i)
+ {
+ *off=lstemp.Xc+(int)(lstemp.w*sin(lstemp.alpha));
+ *(off+1)=lstemp.Yc+(int)(lstemp.h*sin(lstemp.beta));
+ lstemp.alpha+=lstemp.Dalpha;
+ lstemp.beta+=lstemp.Dbeta;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function calculates the next point in a trajectory. Can be used to
+calculate trajectories in real time but I think isn't enough fast for it.
+
+*****************************************************************************/
+
+void LST_GetPoint(Lissajous *l, int *x, int *y)
+{
+ *x=l->Xc+(int)(l->w*t255sin(l->alpha));
+ *y=l->Yc+(int)(l->h*t255sin(l->beta));
+ MA1_IncAng(l->alpha,l->Dalpha);
+ MA1_IncAng(l->beta,l->Dbeta);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ The FPU version of @x{LST_GetPoint}.
+
+***************************************************************************/
+
+void LS_GetPoint(Lissajous *l, int *x, int *y)
+{
+ *x=l->Xc+(int)(l->w*sin(l->alpha));
+ *y=l->Yc+(int)(l->h*sin(l->beta));
+ l->alpha+=l->Dalpha;
+ l->beta+=l->Dbeta;
+}
+/*
+ Code to profile LS?_FillOffsets
+
+ int i=0;
+ uclock_t t2,t1,t3,t4;
+ #define ITER 500
+ off=(int *)malloc(1600);
+ LST_FillDegrees(&t,1600,0,0,2,5,0,0,w,h);
+ t3=uclock();
+ for (i=ITER; i; --i);
+ t4=uclock();
+ t1=uclock();
+ for (i=ITER; i; --i)
+ LST_FillOffsets(&t,off,1,w);
+ t2=uclock();
+ for (i=0; i<1600; i++)
+ putpixel(screen,off[i]%w,off[i]/w,11);
+ readkey();
+ allegro_exit();
+ printf("%f\n",1600*ITER/((t2-t1-t4+t3)/(double)UCLOCKS_PER_SEC));
+*/
+/*
+ Code to test LS?_FillDegrees and LS?_DrawLissajous
+
+ int i;
+ for (i=0; i<360; i++)
+ {
+ LST_FillDegrees(&t,1600,i,0,2,5,0,0,w,h);
+ LST_DrawLissajous(screen,&t,10);
+ vsync();
+ vsync();
+ LST_DrawLissajous(screen,&t,0);
+ }
+*/
diff --git a/setedit/scrnsave/plasmlib/math1.c b/setedit/scrnsave/plasmlib/math1.c
new file mode 100644
index 0000000..1d36f4c
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/math1.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]**********************************************************************
+
+ Module: Math 1
+ Description:
+ This module provides a co/sine table of 4*PI in length, 0.5 degrees of
+resolution and in the range of [-255,255].
+ The tables are merged to save space so the real size is 9/2*PI. That
+reduce the size from 11520 bytes to 6480 bytes.
+ The arrays are called sin_table and cos_table (the last is fake).
+ 2*PI is equivalent to TrigTableSize, use it for convertions.
+ If you need to normalize the amplitud to [-1,1] use the tsinConst constant.
+ The math 4 module is faster but with less resolution. @x{Math 4}.
+
+*****************************************************************************/
+
+#include <math.h>
+#include "math1.h"
+
+#define TamReal (TrigTableSize*2+TrigTableSize/4) // 2*360+90 degrees
+int sin_table[TamReal];
+
+/**[txh]********************************************************************
+
+ Include: math1.h
+ Description:
+ Initializes the look up tables for the module.
+
+***************************************************************************/
+
+void MA1_CreateLookUp(void)
+{
+ unsigned int i;
+ double temp;
+
+ for (i=0; i<TamReal; i++)
+ {
+ temp = sin((double)(i*PI/(180*(TrigTableSize/360)) ));
+ temp *= 255;
+ sin_table[i] = (int)temp;
+ }
+}
+
+
diff --git a/setedit/scrnsave/plasmlib/math2.c b/setedit/scrnsave/plasmlib/math2.c
new file mode 100644
index 0000000..22ff9bb
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/math2.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Math 2
+ Comments:
+ Generates a ramdom table of 65536 elements. The table is in the code. Uses
+the time to start the pseudo-ramdom sequence.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <go32.h>
+#include <libc/farptrgs.h>
+#include "math2.h"
+
+// 64Kb
+unsigned char RandomTable[RandomTableSize];
+// short to wrap in the table
+unsigned short RandomTablePos;
+static char Initialized=0;
+
+// No the library rawclock.
+inline unsigned long _rawclock(void)
+{
+ return _farpeekl(_dos_ds, 0x46c);
+}
+
+/**[txh]********************************************************************
+
+ Include: math2.h
+ Description:
+ Fills the table.
+
+***************************************************************************/
+
+void MA2_InitRTable(void)
+{
+ unsigned short *p=(unsigned short *)RandomTable;
+ int i;
+
+ RandomTablePos=0;
+ if (Initialized)
+ return;
+ Initialized=1;
+ // 64K of Ramdom numbers
+ srandom(_rawclock());
+ for (i=RandomTableSize/2; i; --i)
+ p[i-1]=random();
+}
+
diff --git a/setedit/scrnsave/plasmlib/math4.c b/setedit/scrnsave/plasmlib/math4.c
new file mode 100644
index 0000000..d70b500
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/math4.c
@@ -0,0 +1,230 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Math 4
+ Comments:
+ This module is for ultra-fast/good accuracy co/sine waveforms.
+ It uses 256 values to exploit the 8 bits wrap. In addition it uses some
+fixed point math to allow increments of 0.0055 degrees.
+ This module have a hardcoded table with double values and two tables
+for integer values. The double's table is used to generate the other tables.
+ Why two tables? because these tables are calculated with a customized
+amplitud, offset and scale factors so you can re-use the tables.
+
+***************************************************************************/
+
+#include "math4.h"
+
+// 360+90 degrees
+int XSin256t[256+256/4];
+int YSin256t[256+256/4];
+
+/* Co/Sine table
+Generated with:
+
+int main(void)
+{
+ int i;
+ printf("double DSin256t[256+256/4]={\n");
+ for (i=0; i<320; )
+ {
+ printf("%17.15f",sin(i*2*PI/256));
+ if (i!=319)
+ printf(",");
+ else
+ printf(" };");
+ i++;
+ if (i%4==0)
+ printf("\n");
+ }
+ return 0;
+}
+
+*/
+double DSin256t[256+256/4]={
+0.000000000000000,0.024541228522912,0.049067674327418,0.073564563599667,
+0.098017140329561,0.122410675199216,0.146730474455362,0.170961888760301,
+0.195090322016128,0.219101240156870,0.242980179903264,0.266712757474898,
+0.290284677254462,0.313681740398892,0.336889853392220,0.359895036534988,
+0.382683432365090,0.405241314004990,0.427555093430282,0.449611329654607,
+0.471396736825998,0.492898192229784,0.514102744193222,0.534997619887097,
+0.555570233019602,0.575808191417845,0.595699304492433,0.615231590580627,
+0.634393284163645,0.653172842953777,0.671558954847018,0.689540544737067,
+0.707106781186547,0.724247082951467,0.740951125354959,0.757208846506484,
+0.773010453362737,0.788346427626606,0.803207531480645,0.817584813151584,
+0.831469612302545,0.844853565249707,0.857728610000272,0.870086991108711,
+0.881921264348355,0.893224301195515,0.903989293123443,0.914209755703531,
+0.923879532511287,0.932992798834739,0.941544065183021,0.949528180593037,
+0.956940335732209,0.963776065795440,0.970031253194544,0.975702130038529,
+0.980785280403230,0.985277642388941,0.989176509964781,0.992479534598710,
+0.995184726672197,0.997290456678690,0.998795456205172,0.999698818696204,
+1.000000000000000,0.999698818696204,0.998795456205172,0.997290456678690,
+0.995184726672197,0.992479534598710,0.989176509964781,0.985277642388941,
+0.980785280403230,0.975702130038529,0.970031253194544,0.963776065795440,
+0.956940335732209,0.949528180593037,0.941544065183021,0.932992798834739,
+0.923879532511287,0.914209755703531,0.903989293123443,0.893224301195515,
+0.881921264348355,0.870086991108711,0.857728610000272,0.844853565249707,
+0.831469612302545,0.817584813151584,0.803207531480645,0.788346427626606,
+0.773010453362737,0.757208846506485,0.740951125354959,0.724247082951467,
+0.707106781186548,0.689540544737067,0.671558954847019,0.653172842953777,
+0.634393284163645,0.615231590580627,0.595699304492433,0.575808191417845,
+0.555570233019602,0.534997619887097,0.514102744193222,0.492898192229784,
+0.471396736825998,0.449611329654607,0.427555093430282,0.405241314004990,
+0.382683432365090,0.359895036534988,0.336889853392220,0.313681740398891,
+0.290284677254462,0.266712757474898,0.242980179903264,0.219101240156870,
+0.195090322016129,0.170961888760301,0.146730474455362,0.122410675199216,
+0.098017140329561,0.073564563599668,0.049067674327418,0.024541228522912,
+0.000000000000000,-0.024541228522912,-0.049067674327418,-0.073564563599667,
+-0.098017140329561,-0.122410675199216,-0.146730474455362,-0.170961888760301,
+-0.195090322016128,-0.219101240156870,-0.242980179903264,-0.266712757474898,
+-0.290284677254462,-0.313681740398891,-0.336889853392220,-0.359895036534988,
+-0.382683432365090,-0.405241314004990,-0.427555093430282,-0.449611329654607,
+-0.471396736825998,-0.492898192229784,-0.514102744193222,-0.534997619887097,
+-0.555570233019602,-0.575808191417845,-0.595699304492433,-0.615231590580627,
+-0.634393284163645,-0.653172842953777,-0.671558954847018,-0.689540544737067,
+-0.707106781186547,-0.724247082951467,-0.740951125354959,-0.757208846506484,
+-0.773010453362737,-0.788346427626606,-0.803207531480645,-0.817584813151584,
+-0.831469612302545,-0.844853565249707,-0.857728610000272,-0.870086991108711,
+-0.881921264348355,-0.893224301195515,-0.903989293123443,-0.914209755703530,
+-0.923879532511287,-0.932992798834739,-0.941544065183021,-0.949528180593037,
+-0.956940335732209,-0.963776065795440,-0.970031253194544,-0.975702130038528,
+-0.980785280403230,-0.985277642388941,-0.989176509964781,-0.992479534598710,
+-0.995184726672197,-0.997290456678690,-0.998795456205172,-0.999698818696204,
+-1.000000000000000,-0.999698818696204,-0.998795456205172,-0.997290456678690,
+-0.995184726672197,-0.992479534598710,-0.989176509964781,-0.985277642388941,
+-0.980785280403230,-0.975702130038529,-0.970031253194544,-0.963776065795440,
+-0.956940335732209,-0.949528180593037,-0.941544065183021,-0.932992798834739,
+-0.923879532511287,-0.914209755703531,-0.903989293123443,-0.893224301195515,
+-0.881921264348355,-0.870086991108711,-0.857728610000272,-0.844853565249707,
+-0.831469612302545,-0.817584813151584,-0.803207531480645,-0.788346427626606,
+-0.773010453362737,-0.757208846506485,-0.740951125354959,-0.724247082951467,
+-0.707106781186548,-0.689540544737067,-0.671558954847019,-0.653172842953777,
+-0.634393284163646,-0.615231590580627,-0.595699304492433,-0.575808191417845,
+-0.555570233019602,-0.534997619887097,-0.514102744193222,-0.492898192229784,
+-0.471396736825998,-0.449611329654607,-0.427555093430283,-0.405241314004990,
+-0.382683432365090,-0.359895036534988,-0.336889853392220,-0.313681740398892,
+-0.290284677254462,-0.266712757474899,-0.242980179903264,-0.219101240156870,
+-0.195090322016129,-0.170961888760302,-0.146730474455362,-0.122410675199216,
+-0.098017140329561,-0.073564563599667,-0.049067674327418,-0.024541228522912,
+0.000000000000000,0.024541228522912,0.049067674327418,0.073564563599667,
+0.098017140329560,0.122410675199216,0.146730474455362,0.170961888760301,
+0.195090322016128,0.219101240156870,0.242980179903264,0.266712757474898,
+0.290284677254462,0.313681740398891,0.336889853392220,0.359895036534988,
+0.382683432365090,0.405241314004990,0.427555093430282,0.449611329654607,
+0.471396736825998,0.492898192229784,0.514102744193221,0.534997619887097,
+0.555570233019602,0.575808191417845,0.595699304492433,0.615231590580627,
+0.634393284163646,0.653172842953777,0.671558954847018,0.689540544737067,
+0.707106781186547,0.724247082951467,0.740951125354959,0.757208846506484,
+0.773010453362737,0.788346427626606,0.803207531480645,0.817584813151584,
+0.831469612302545,0.844853565249707,0.857728610000272,0.870086991108711,
+0.881921264348355,0.893224301195515,0.903989293123443,0.914209755703530,
+0.923879532511287,0.932992798834739,0.941544065183021,0.949528180593037,
+0.956940335732209,0.963776065795440,0.970031253194544,0.975702130038528,
+0.980785280403230,0.985277642388941,0.989176509964781,0.992479534598710,
+0.995184726672197,0.997290456678690,0.998795456205172,0.999698818696204 };
+
+/**[txh]********************************************************************
+
+ Include: math4.h
+ Description:
+ This function fills one of the two tables with the values provided.@p
+ The equation is: (Amp*sin(x)+Off)*Scale.@p
+ Scale is used to calculate Y offsets.@p
+ The flags are:@*
+@*
+MA4NoScale Don't use scale.@*
+MA4Scale Use scale (default).@*
+MA4XSin Fill the X table.@*
+MA4YSin Fill the Y table (default).@*
+
+***************************************************************************/
+
+void MA4_FillTable(double Amp, double Off, double Scale, int Flags)
+{
+ int i;
+
+ if (Flags & MA4NoScale)
+ {
+ if (Flags & MA4XSin)
+ for (i=0; i<320; i++)
+ XSin256t[i]=Amp*DSin256t[i]+Off;
+ else
+ for (i=0; i<320; i++)
+ YSin256t[i]=Amp*DSin256t[i]+Off;
+ }
+ else
+ {
+ if (Flags & MA4XSin)
+ for (i=0; i<320; i++)
+ XSin256t[i]=(Amp*DSin256t[i]+Off)*Scale;
+ else
+ for (i=0; i<320; i++)
+ YSin256t[i]=(Amp*DSin256t[i]+Off)*Scale;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the integer version of @x{MA4_FillTable}.
+
+***************************************************************************/
+
+void MA4_FillTableI(int Amp, int Off, int Scale, int Flags)
+{
+ int i;
+
+ if (Flags & MA4NoScale)
+ {
+ if (Flags & MA4XSin)
+ for (i=0; i<320; i++)
+ XSin256t[i]=(int)(Amp*DSin256t[i])+Off;
+ else
+ for (i=0; i<320; i++)
+ YSin256t[i]=(int)(Amp*DSin256t[i])+Off;
+ }
+ else
+ {
+ if (Flags & MA4XSin)
+ for (i=0; i<320; i++)
+ XSin256t[i]=((int)(Amp*DSin256t[i]+Off))*Scale;
+ else
+ for (i=0; i<320; i++)
+ YSin256t[i]=((int)(Amp*DSin256t[i]+Off))*Scale;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the integer version of @x{MA4_FillTable}. Additionally it forces
+the values multiples of four.
+
+***************************************************************************/
+
+void MA4_FillTableIW(int Amp, int Off, int Scale, int Flags)
+{
+ int i;
+
+ if (Flags & MA4NoScale)
+ {
+ if (Flags & MA4XSin)
+ for (i=0; i<320; i++)
+ XSin256t[i]=((int)(Amp*DSin256t[i])+Off) & 0xFFFFFFFC;
+ else
+ for (i=0; i<320; i++)
+ YSin256t[i]=((int)(Amp*DSin256t[i])+Off) & 0xFFFFFFFC;
+ }
+ else
+ {
+ if (Flags & MA4XSin)
+ for (i=0; i<320; i++)
+ XSin256t[i]=(((int)(Amp*DSin256t[i]+Off))*Scale) & 0xFFFFFFFC;
+ else
+ for (i=0; i<320; i++)
+ YSin256t[i]=(((int)(Amp*DSin256t[i]+Off))*Scale) & 0xFFFFFFFC;
+ }
+}
+
+
diff --git a/setedit/scrnsave/plasmlib/mixsfake.gpr b/setedit/scrnsave/plasmlib/mixsfake.gpr
new file mode 100644
index 0000000..fbcec91
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/mixsfake.gpr
Binary files differ
diff --git a/setedit/scrnsave/plasmlib/mixsfake.mak b/setedit/scrnsave/plasmlib/mixsfake.mak
new file mode 100644
index 0000000..95a0add
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/mixsfake.mak
@@ -0,0 +1,318 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# E:\DJ\BIN/gpr2mak.exe plasmlib/mixsfake.gpr
+vpath_obj=objfake
+vpath %.o $(vpath_obj)
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=include ../fakealle/include
+LIB_DIRS=
+C_DEBUG_FLAGS=-g3 -gstabs+
+C_OPT_FLAGS=-O2 -fomit-frame-pointer -ffast-math
+C_WARN_FLAGS=-Wall
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=-DFAKE_ALLEGRO
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=objfake/mixsurf.o objfake/mksurf4.o
+LIBRARIES=
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=libmixsf.a
+PROJECT_ITEMS=mixsurf.c mksurf4.c
+DEFAULT_MASK=*.[acfghimnops]*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= objfake/mixsurf.o objfake/mksurf4.o
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+libmixsf.a:: $(DEPS_0)
+ $(RHIDE_COMPILE_ARCHIVE)
+DEPS_1=mixsurf.c ../fakealle/include/fakealle.h include/mixsurf.h
+objfake/mixsurf.o:: $(DEPS_1)
+ $(RHIDE_COMPILE.c.o)
+DEPS_2=mksurf4.c ../fakealle/include/fakealle.h include/math2.h
+objfake/mksurf4.o:: $(DEPS_2)
+ $(RHIDE_COMPILE.c.o)
+all:: libmixsf.a
diff --git a/setedit/scrnsave/plasmlib/mixsurf.c b/setedit/scrnsave/plasmlib/mixsurf.c
new file mode 100644
index 0000000..de0b212
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/mixsurf.c
@@ -0,0 +1,537 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Mix Surface
+ Comments:
+ This module is used to add bitmaps.
+
+***************************************************************************/
+
+#include <stdio.h>
+#ifdef FAKE_ALLEGRO
+#include <fakealle.h>
+#else
+#include <allegro.h>
+#endif
+#include "mixsurf.h"
+
+MS_4struct MS_4;
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a very generic and very optimized four surfaces mixer.
+
+***************************************************************************/
+
+/* That's the C version used to generate the ASM version.
+ The ASM is 9% faster because I removed 1 silly instruction in the inner
+loop. Is a clear bug in the GCC optimizer.
+ Some interesting numbers:
+ Each mix is 80*200 dwords = 16000 passes. The inner loop have 9
+instructions (144000), the outther 10 more (144800), suppose the rest is
+40 instructions (144840) and I got 182 fps (to memory) => 26360880. Puaj! */
+void MS_4addC(void)
+{
+ static long i;
+ long j;
+ unsigned *s;
+ // Create the pointers to 4 surfaces
+ unsigned *yy1=MS_4.s1;
+ unsigned *yy2=MS_4.s2;
+ unsigned *yy3=MS_4.s3;
+ unsigned *yy4=MS_4.s4;
+ s=(unsigned *)MS_4.dest;
+
+ for (i=MS_4.sH; i; --i)
+ {
+ for (j=0; j<MS_4.sWw; s++,j++)
+ *s=yy1[j]+yy2[j]+yy3[j]+yy4[j];
+ yy1+=MS_4.mWw;
+ yy2+=MS_4.mWw;
+ yy3+=MS_4.mWw;
+ yy4+=MS_4.mWw;
+ }
+}
+
+void MS_4add(void)
+{
+ static int i;
+ asm(" \n\
+ pushl %%ebp \n\
+ \n\
+ // s1,s2,s3,s4 \n\
+ movl _MS_4,%%ebp \n\
+ movl _MS_4+4,%%edi \n\
+ movl _MS_4+8,%%esi \n\
+ movl _MS_4+12,%%ebx \n\
+ \n\
+ // dest \n\
+ movl _MS_4+16,%%ecx \n\
+ // sH, fuck just 1 register more demm Intel \n\
+ movl _MS_4+24,%%eax \n\
+ movl %%eax,%k0 \n\
+ \n\
+LoopI: \n\
+ // j=0 \n\
+ xorl %%edx,%%edx \n\
+ .align 2,0x90 \n\
+ \n\
+LoopJ: \n\
+ movl (%%ebp,%%edx,4),%%eax \n\
+ addl (%%edi,%%edx,4),%%eax \n\
+ addl (%%esi,%%edx,4),%%eax \n\
+ addl (%%ebx,%%edx,4),%%eax \n\
+ movl %%eax,(%%ecx) \n\
+ // I moved it here hoping the P5 will pair the 4 instructions \n\
+ incl %%edx \n\
+ addl $4,%%ecx \n\
+ cmpl %%edx,_MS_4+20 \n\
+ ja LoopJ \n\
+ \n\
+ movl _MS_4+32,%%eax \n\
+ addl %%eax,%%ebp \n\
+ addl %%eax,%%edi \n\
+ addl %%eax,%%esi \n\
+ addl %%eax,%%ebx \n\
+ decl %k0 \n\
+ jne LoopI \n\
+ \n\
+ popl %%ebp \n\
+ ": "=m" (i) : : "%eax","%ebx","%ecx","%edx","%esi","%edi");
+}
+
+/*void MS_4addCyrix(void)
+{
+ static int i;
+ asm(" \n\
+ pushl %%ebp \n\
+ \n\
+ // s1,s2,s3,s4 \n\
+ movl _MS_4,%%ebp \n\
+ movl _MS_4+4,%%ecx \n\
+ movl _MS_4+8,%%esi \n\
+ movl _MS_4+12,%%ebx \n\
+ \n\
+ // dest \n\
+ movl _MS_4+16,%%edi \n\
+ // sH, fuck just 1 register more demm Intel \n\
+ movl _MS_4+24,%%eax \n\
+ movl %%eax,%k0 \n\
+ \n\
+0: \n\
+ // j=0 \n\
+ xorl %%edx,%%edx \n\
+ .align 2,0x90 \n\
+ \n\
+1: \n\
+ movl (%%ebp,%%edx,4),%%eax \n\
+ addl (%%ecx,%%edx,4),%%eax \n\
+ addl (%%esi,%%edx,4),%%eax \n\
+ addl (%%ebx,%%edx,4),%%eax \n\
+ stosl \n\
+ incl %%edx \n\
+ cmpl %%edx,_MS_4+20 \n\
+ ja 1b \n\
+ \n\
+ movl _MS_4+32,%%eax \n\
+ addl %%eax,%%ebp \n\
+ addl %%eax,%%ecx \n\
+ addl %%eax,%%esi \n\
+ addl %%eax,%%ebx \n\
+ decl %k0 \n\
+ jne 0b \n\
+ \n\
+ popl %%ebp \n\
+ ": "=m" (i) : : "%eax","%ebx","%ecx","%edx","%esi","%edi");
+}*/
+
+
+// That's as fast as the assembler version. To be honest is a little slower
+// but you can't meassure the difference. I didn't tested the it in a P5.
+// I think the ASM is faster there.
+void MS_4addW(void)
+{
+ long i=0,j=0;
+ unsigned *s;
+ // Create the pointers to 4 surfaces
+ unsigned *yy1=MS_4.s1;
+ unsigned *yy2=MS_4.s2;
+ unsigned *yy3=MS_4.s3;
+ unsigned *yy4=MS_4.s4;
+ s=(unsigned *)MS_4.dest;
+
+ for (i=MS_4.sH; i; --i)
+ {
+ for (j=MS_4.sWw; j; s++,--j)
+ *s=yy1[j]+yy2[j]+yy3[j]+yy4[j];
+ yy1+=MS_4.mWw;
+ yy2+=MS_4.mWw;
+ yy3+=MS_4.mWw;
+ yy4+=MS_4.mWw;
+ }
+}
+
+void MS_3addC(void)
+{
+ long i,j;
+ unsigned *s;
+ unsigned *yy1=MS_4.s1;
+ unsigned *yy2=MS_4.s2;
+ unsigned *yy3=MS_4.s3;
+ s=(unsigned *)MS_4.dest;
+
+ for (i=MS_4.sH; i; --i)
+ {
+ for (j=0; j<MS_4.sWw; s++,j++)
+ *s=yy1[j]+yy2[j]+yy3[j];
+ yy1+=MS_4.mWw;
+ yy2+=MS_4.mWw;
+ yy3+=MS_4.mWw;
+ }
+}
+
+void MS_3add(void)
+{
+ asm(" \n\
+ pushl %%ebp \n\
+ \n\
+ // s1,s2,s3 \n\
+ movl _MS_4,%%ebp \n\
+ movl _MS_4+4,%%edi \n\
+ movl _MS_4+8,%%esi \n\
+ \n\
+ // dest \n\
+ movl _MS_4+16,%%ecx \n\
+ // sH \n\
+ movl _MS_4+24,%%ebx \n\
+ \n\
+LoopI2: \n\
+ // j=0 \n\
+ xorl %%edx,%%edx \n\
+ \n\
+LoopJ2: \n\
+ movl (%%ebp,%%edx,4),%%eax \n\
+ addl (%%edi,%%edx,4),%%eax \n\
+ addl (%%esi,%%edx,4),%%eax \n\
+ movl %%eax,(%%ecx) \n\
+ // I moved it here hoping the P5 will pair the 4 instruction\n\
+ incl %%edx \n\
+ addl $4,%%ecx \n\
+ cmpl %%edx,_MS_4+20 \n\
+ ja LoopJ2 \n\
+ \n\
+ movl _MS_4+32,%%eax \n\
+ addl %%eax,%%ebp \n\
+ addl %%eax,%%edi \n\
+ addl %%eax,%%esi \n\
+ decl %%ebx \n\
+ jne LoopI2 \n\
+ \n\
+ popl %%ebp \n\
+ ": : : "%eax","%ebx","%ecx","%edx","%esi","%edi");
+}
+
+// Here my meassure indicates C faster than ASM ?!
+void MS_2addC(void)
+{
+ long i,j,k;
+ unsigned *s;
+ unsigned *yy1=MS_4.s1;
+ unsigned *yy2=MS_4.s2;
+ s=(unsigned *)MS_4.dest;
+
+ for (i=MS_4.sH; i; --i)
+ {
+ for (j=0,k=MS_4.sWw; k; s++,j++,--k)
+ *s=yy1[j]+yy2[j];
+ yy1+=MS_4.mWw;
+ yy2+=MS_4.mWw;
+ }
+}
+
+void MS_2add(void)
+{
+ asm(" \n\
+ pushl %%ebp \n\
+ \n\
+ // s1,s2,s3 \n\
+ movl _MS_4,%%esi \n\
+ movl _MS_4+4,%%edi \n\
+ \n\
+ // dest \n\
+ movl _MS_4+16,%%ecx \n\
+ // sH \n\
+ movl _MS_4+24,%%edx \n\
+ \n\
+LoopI3: \n\
+ // j=0 \n\
+ xorl %%eax,%%eax \n\
+ movl _MS_4+20,%%ebp \n\
+ .align 2,0x90 \n\
+ \n\
+LoopJ3: \n\
+ movl (%%esi,%%eax,4),%%ebx \n\
+ addl (%%edi,%%eax,4),%%ebx \n\
+ movl %%ebx,(%%ecx) \n\
+ incl %%eax \n\
+ addl $4,%%ecx \n\
+ decl %%ebp \n\
+ jne LoopJ3 \n\
+ \n\
+ movl _MS_4+32,%%eax \n\
+ addl %%eax,%%esi \n\
+ addl %%eax,%%edi \n\
+ decl %%edx \n\
+ jne LoopI3 \n\
+ \n\
+ popl %%ebp \n\
+ ": : : "%eax","%ebx","%ecx","%edx","%edi","%esi");
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function is used to invert a an image generated with a for loop that
+increments and then blitted with a loop that decrements.@p
+ I used it to speed up the routines but isn't much faster and needs
+multiple of four X coordinates, so isn't smooth.
+
+***************************************************************************/
+
+void MS_InvertDWordScreen(int w, int h, unsigned char *b)
+{
+ int x,y,s1,s2,w2;
+ unsigned *s=(unsigned *)b;
+ unsigned aux;
+
+ w2=w/4;
+ w/=8;
+
+ for (y=h; y; s+=w2,y--)
+ for (s1=0,s2=w2-1,x=w; x; s1++,s2--,x--)
+ {
+ aux=s[s1];
+ s[s1]=s[s2];
+ s[s2]=aux;
+ }
+}
+
+void MS_AddBmpsMem(BITMAP *source, BITMAP *dest, int source_x,
+ int source_y, int dest_x, int dest_y, int width,
+ int height)
+{
+ int y,x;
+ char *src=source->line[source_y]+source_x;
+ int wS=source->w-width;
+ char *dst=dest->line[dest_y]+dest_x;
+ int wD=dest->w-width;
+
+ for (y=height; y; src+=wS,dst+=wD,--y)
+ for (x=width; x; src++,dst++,--x)
+ *dst+=*src;
+}
+
+void MS_CutBMPColorsAt(BITMAP *bmp, unsigned char cut, unsigned char val)
+{
+ int y,x;
+ unsigned char *s=bmp->line[0];
+
+ for (y=bmp->h; y; --y)
+ for (x=bmp->w; x; s++,--x)
+ *s=*s<cut ? 0 : val;
+}
+
+void MS_CutBMPColorsAtInv(BITMAP *bmp, unsigned char cut, unsigned char val)
+{
+ int y,x;
+ unsigned char *s=bmp->line[0];
+
+ for (y=bmp->h; y; --y)
+ for (x=bmp->w; x; s++,--x)
+ *s=*s<cut ? val : 0;
+}
+
+void MS_AddWithMaskMem(BITMAP *source, BITMAP *dest, int source_x,
+ int source_y, int dest_x, int dest_y, int width,
+ int height,int val)
+{
+ int y,x;
+ char *src=source->line[source_y]+source_x;
+ int wS=source->w-width;
+ char *dst=dest->line[dest_y]+dest_x;
+ int wD=dest->w-width;
+
+ for (y=height; y; src+=wS,dst+=wD,--y)
+ for (x=width; x; src++,dst++,--x)
+ if (*src)
+ *dst+=val;
+}
+
+inline void Flush(unsigned char **d,int count,int type)
+{
+ while (count>0)
+ {
+ if (count>127)
+ {
+ *((*d)++)=type | 127;
+ count-=127;
+ }
+ else
+ {
+ *((*d)++)=type | count;
+ count=0;
+ }
+ }
+}
+
+void MS_CompactMask(BITMAP *bmp)
+{
+ int x,y;
+ int w=bmp->w,h=bmp->h,count=1;
+ unsigned char *s=bmp->line[0],*d;
+ int is_1;
+ d=s;
+
+ for (y=h; y; --y)
+ {
+ is_1=*s!=0;
+ count=1;
+ for (s++,x=1; x<w; s++,x++)
+ {
+ if (is_1)
+ {
+ if (*s)
+ {
+ count++;
+ }
+ else
+ {
+ Flush(&d,count,0x80);
+ is_1=0;
+ count=1;
+ }
+ }
+ else
+ {
+ if (!*s)
+ count++;
+ else
+ {
+ Flush(&d,count,0);
+ is_1=1;
+ count=1;
+ }
+ }
+ }
+ if (is_1)
+ Flush(&d,count,0x80);
+ else
+ Flush(&d,count,0);
+ *(d++)=0;
+ }
+}
+
+void MS_AddWithMaskMemC(char *source, BITMAP *dest, int dest_x,
+ int dest_y, int width, int height, int val)
+{
+ int y;
+ char *src=source;
+ char *dst=dest->line[dest_y]+dest_x;
+ int wD=dest->w-width;
+ unsigned char count;
+
+ for (y=height; y; dst+=wD,--y)
+ {
+ while (*src)
+ {
+ if (*src & 0x80)
+ {
+#if 0
+ count=*src & 0x7F;
+ while (count--)
+ *(dst++)+=val;
+#else
+ count=*src & 0x7F;
+ do
+ {
+ *(dst++)+=val;
+ }
+ while (--count);
+#endif
+ }
+ else
+ dst+=*src;
+ src++;
+ }
+ src++;
+ }
+}
+
+void MS_DumpCompacted(BITMAP *bmp, char *name, char *file)
+{
+ int y;
+ int h=bmp->h;
+ FILE *f;
+ unsigned char *src=bmp->line[0];
+
+ f=fopen(file,"wt");
+ if (!f) return;
+ fprintf(f,"int %sW=%d,%sH=%d;\nunsigned char %sP[]={\n",name,bmp->w,name,bmp->h,name);
+
+ for (y=0; y<h; y++)
+ {
+ while (*src)
+ {
+ fprintf(f,"%3d, ",*src);
+ src++;
+ }
+ fprintf(f," 0%c /* %d */\n",y==h-1 ? ' ' : ',',y);
+ src++;
+ }
+ fprintf(f,"}; // Size: %ld Compression: %5.2f %%\n",src-bmp->line[0],(1.0-(src-bmp->line[0])/(double)(h*bmp->w))*100.0);
+ fclose(f);
+}
+
+/* Menos del 3% de diferencia y no funciona! ver por que
+void MS_AddWithMaskMem(BITMAP *source, BITMAP *dest, int source_x,
+ int source_y, int dest_x, int dest_y, int width,
+ int height,int val)
+{
+ char *src=source->line[source_y]+source_x;
+ int wS=source->w-width;
+ char *dst=dest->line[dest_y]+dest_x;
+ int wD=dest->w-width;
+
+ asm ("
+ movl %k1,%%ebp
+ testl %%ecx,%%ecx
+ je 5f
+ testl %%edi,%%edi
+ je 5f
+ .align 2,0x90
+
+1:
+ movl %%edi,%%eax
+2:
+ cmpb $0,(%%esi)
+ je 3f
+ addb %%bl,(%%edx)
+3:
+ incl %%esi
+ incl %%edx
+ decl %%eax
+ jne 2b
+
+4:
+ addl %%ebp,%%esi
+ addl %k0,%%edx
+ decl %%ecx
+ jne 1b
+5:
+ " : "=m" (wD)
+ : "q" (wS), "c" (height), "D" (width), "S" (src), "b" (val), "d" (dst)
+ : "%eax", "%ebp");
+}*/
+
diff --git a/setedit/scrnsave/plasmlib/mksurf1.c b/setedit/scrnsave/plasmlib/mksurf1.c
new file mode 100644
index 0000000..e502302
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/mksurf1.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#include <math.h>
+
+#define uchar unsigned char
+
+void MKS_DistCentS(int w, int h, unsigned char *s, int sw, int sh, void (*CallBack)())
+{
+ int d1,i,j;
+
+ for (i=0; i<h; i++)
+ {
+ d1=16+(sh-i)*(sh-i);
+ for (j=w; j; s++,--j)
+ *s=(uchar)((sqrt( d1+(sw-j)*(sw-j) )-4) *5 );
+ CallBack();
+ }
+}
+
+void MKS_SinDisCentS(int w, int h, unsigned char *s, int sw, int sh,
+ double Bsize, void (*CallBack)())
+{
+ double t2;
+ int t1,i,j;
+
+ for (i=0; i<h; i++)
+ {
+ t1=16+(sh-i)*(sh-i);
+ for (j=w; j; s++,--j)
+ {
+ t2=sqrt(t1+(sw-j)*(sw-j))-4;
+ *s=(sin(t2/Bsize)+1)*90;
+ }
+ CallBack();
+ }
+}
diff --git a/setedit/scrnsave/plasmlib/mksurf2.c b/setedit/scrnsave/plasmlib/mksurf2.c
new file mode 100644
index 0000000..68910da
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/mksurf2.c
@@ -0,0 +1,162 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#include <math.h>
+#include "math1.h"
+
+void MKS_C2ySySiCx(int w, int h, unsigned char *s, void (*CallBack)())
+{
+ int temp;
+ int i,j,X,Y;
+
+ temp=30;
+ for (Y=0,i=h; i; --i)
+ {
+ int Yv=cos_table[Y*2]+sin_table[Y]+sin_table[temp];
+ for (X=0,j=w; j; s++,--j)
+ {
+ *s=(Yv+cos_table[X]+1020)>>4;
+ MA1_IncAng(X,8);
+ }
+ MA1_IncAng(Y,6);
+ MA1_IncAng(temp,5);
+ CallBack();
+ }
+}
+
+void MKS_SinDisCentSf(int w, int h, unsigned char *s, int sw, int sh,
+ double Bsize, void (*CallBack)())
+{
+ int temp,i,j,t2;
+
+ Bsize=MA1_FromRad(1/Bsize);
+ for (i=0; i<h; i++)
+ {
+ t2=(sh-i)*(sh-i);
+ for (j=w; j; s++,--j)
+ {
+ temp=Bsize*sqrt(t2+(sw-j)*(sw-j));
+ *s=(t255sin(temp%TrigTableSize)+255)>>3;
+ }
+ CallBack();
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function calculates the crazy surface for this plasma. The equation
+is TOO complex that's because the plasma uses 2 times the same surface so
+it MUST be very complex.
+@p
+ The original program calculated the surface outside the demo. The equation
+is: z=64+10*[sin(x/30)+cos(y/46)+cos(x/37)+sin(y/70)+sin((x+y)/43)+
+cos(hypot(256-x,150-y)/20)]. Where hypot is sqrt(x^2,y^2).
+
+*****************************************************************************/
+// Using tcos and tsin is 30% faster
+// Using integer x,y 5.7% more
+// Moving the sin(x...)+cos(x...) outside 28% more
+// Moving the sin(y...)+cos(y...) outside 25% more
+// With some little things that takes the half of the original, I tried
+// to use even more integers but that doesn't help because the lack of
+// registers.
+/* That's the original code (3.08 s for the total init)
+
+ for (k=0,y=0;y<pla3h;y++)
+ for (x=0;x<pla3w;k++,x++)
+ {
+ PLA3_Map[k]=64+10*( sin(x/30) + cos(y/46) +
+ cos(x/37) + sin(y/70) +
+ sin((x+y)/43) +
+ cos(hypot(256-x,150-y)/20)
+ );
+ }
+*/
+void MKS_SxCxSyCySxyCh(int w, int h, unsigned char *s,void (*CallBack)(void))
+{
+ double x1,y1,x2,y2,xy,xy2;
+ double aux1,aux2;
+ double *cos_sin_x_t;
+ int k;
+ int x,y,w2,h2;
+
+ w2=w>>1; h2=h>>1;
+ // Precalculate the sin(x/37)+cos(x/30) values (ones and not pla3h times)
+ cos_sin_x_t=(double *)alloca((w+1)*sizeof(double));
+ if (!cos_sin_x_t)
+ return;
+ x1=x2=0;
+ for (x=w; x; --x)
+ {
+ cos_sin_x_t[x]=(t255cos(x2)+t255sin(x1))*tsinConst;
+ MA1_IncAngRad(x1,1/30.0);
+ MA1_IncAngRad(x2,1/37.0);
+ }
+
+ CallBack();
+ y1=y2=xy=0;
+ for (k=0,y=0;y<h;y++)
+ {
+ xy2=xy;
+ aux2=(t255cos(y1)+t255sin(y2))*tsinConst;
+ for (x=w; x; k++,--x)
+ {
+ aux1=cos_sin_x_t[x];
+ s[k]=64+(int)(10*(aux1+aux2+tsin(xy2)+cos(hypot(w2-x,h2-y)/20)));
+ MA1_IncAngRad(xy2,1/43.0);
+ }
+ MA1_IncAngRad(y1,1/46.0);
+ MA1_IncAngRad(y2,1/70.0);
+ MA1_IncAngRad(xy,1/43.0);
+ CallBack();
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's an alternative surface.
+
+***************************************************************************/
+
+void MKS_SxCxSyCySxy(int w, int h, unsigned char *s,void (*CallBack)(void))
+{
+ unsigned x1,y1,x2,y2,xy,xy2;
+ double aux1,aux2;
+ double *cos_sin_x_t;
+ int k;
+ int x,y;
+
+ cos_sin_x_t=(double *)alloca((w+1)*sizeof(double));
+ if (!cos_sin_x_t)
+ return;
+ x1=x2=0;
+ for (x=w; x; --x)
+ {
+ cos_sin_x_t[x]=(t255cos(x2)+t255sin(x1))*tsinConst;
+ if (!(x&3)) x1++;
+ MA1_IncAng(x1,4);
+ MA1_IncAng(x2,3);
+ }
+ CallBack();
+
+ y1=y2=xy=0;
+ for (k=0,y=0;y<h;y++)
+ {
+ xy2=xy;
+ aux2=(t255cos(y1)+t255sin(y2))*tsinConst;
+ for (x=w; x; k++,--x)
+ {
+ aux1=cos_sin_x_t[x];
+ s[k]=64+(int)(10*(aux1+aux2+tsin(xy2)));
+ if (x&1) xy2++;
+ MA1_IncAng(xy2,3);
+ }
+ if (y&1) { y1++; y2++; xy++; }
+ MA1_IncAng(y1,2);
+ MA1_IncAng(y2,2);
+ MA1_IncAng(xy,3);
+ CallBack();
+ }
+}
+
diff --git a/setedit/scrnsave/plasmlib/mksurf4.c b/setedit/scrnsave/plasmlib/mksurf4.c
new file mode 100644
index 0000000..e8d4031
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/mksurf4.c
@@ -0,0 +1,266 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Plasma 4
+ Comments:
+ That's a ramdom fractal. Uses the surface mixer of @x{Plasma 3}.@p
+ The generated surface is very interesting.
+
+***************************************************************************/
+
+#ifdef FAKE_ALLEGRO
+#include <fakealle.h>
+#else
+#include <allegro.h>
+#endif
+#include "math2.h"
+
+/* I did 2 versions, one optimized and the other generic.
+ If you ask for a plasma of width Xopt the optimized routine is used. If
+ not a generic one is used.
+*/
+#define Xopt 576
+#define SetPixel(x,y,val) pl4Scr[x+y*Xopt]=val
+#define GetPixel(x,y) pl4Scr[x+y*Xopt]
+#define SetPixelG(x,y,val) _putpixel(Bmp,x,y,val)
+#define GetPixelG(x,y) _getpixel(Bmp,x,y)
+static unsigned char *pl4Scr;
+static unsigned char recadj=255;
+static BITMAP *Bmp;
+static void (*CB)();
+static int cont;
+#define CB_CONT 500
+
+/**[txh]**********************************************************************
+
+ Include: mksurf4.h
+ Description:
+ This fucnction adjust the value of the (xm,ym) pixel. The value to put is
+the average of the value of (x1,y1) and (x2,y2) plus a ramdom value. The
+ramdom value can be + or -.
+@p
+ The amount of the random value is limited by recadj. This value depends on
+the starting value and the level of recusivity. When the points are closer
+the recadj is lower creating a continuous surface.
+
+*****************************************************************************/
+
+static int Adjust(int x1,int y1,int x2,int y2,int xm,int ym)
+{
+ int val;
+
+ // Pixels average
+ val=(GetPixel(x1,y1)+GetPixel(x2,y2))>>1;
+ // +/- random value
+ val+=(MA2_GetRand8() & recadj)-(recadj>>1);
+
+ if (val<=0)
+ val=1;
+ else
+ if (val>255)
+ val=255;
+
+ SetPixel(xm,ym,val);
+
+ return val;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ The generic version of @x{Adjust}.
+
+***************************************************************************/
+static int AdjustG(int x1,int y1,int x2,int y2,int xm,int ym)
+{
+ int val;
+
+ // Pixels average
+ val=(GetPixelG(x1,y1)+GetPixelG(x2,y2))>>1;
+ // +/- random value
+ val+=(MA2_GetRand8() & recadj)-(recadj>>1);
+
+ if (val<=0)
+ val=1;
+ else
+ if (val>255)
+ val=255;
+
+ SetPixelG(xm,ym,val);
+
+ return val;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ That's the recursive function. It calculates the rectangle (x1,y1)-(x2,y2).
+For it the function divides the rect. in four rectangles, calculates one
+corner for each and the central point of the rectangle (as an average color
+of the four corners) and finally calls to itself to solve each rectangle.
+
+*****************************************************************************/
+
+static void SubDivide(int x1,int y1,int x2,int y2)
+{
+ int x,y,val,acum;
+ signed char oldrecadj;
+
+ // First, check for recursion halts.
+ x=(x1+x2)>>1; // X = X center
+ y=(y1+y2)>>1; // Y = Y center
+ if (x1==x && y1==y) // That means we reached a central point
+ return;
+
+ // Next, check each of the four sides for empty
+ // and call 'Adjust' if so. Meanwhile, keep
+ // a running total of all the four sides so we
+ // can do a quick average of them in the next
+ // step.
+
+ // TOP
+ val=GetPixel(x,y1);
+ if (val==0)
+ val=Adjust(x1,y1,x2,y1,x,y1);
+ acum=val;
+
+ // RIGHT
+ val=GetPixel(x2,y);
+ if (val==0)
+ val=Adjust(x2,y1,x2,y2,x2,y);
+ acum+=val;
+
+ // BOTTOM
+ val=GetPixel(x,y2);
+ if (val==0)
+ val=Adjust(x1,y2,x2,y2,x,y2);
+ acum+=val;
+
+ // LEFT
+ val=GetPixel(x1,y);
+ if (val==0)
+ val=Adjust(x1,y1,x1,y2,x1,y);
+ acum+=val;
+
+ // Okay. All four side pixels have been computed
+ // and plotted on the screen and in memory. AX
+ // holds the sum of all four pixels. Divide by four
+ // and set x,y to the resulting value.
+ acum>>=2;
+ SetPixel(x,y,acum);
+
+ if (!--cont)
+ {
+ cont=CB_CONT;
+ CB();
+ }
+ // Finally. All the real work is done. Now, decrease
+ // the recurse-level adjustment and recurse down
+ // to the next level for each of the four quads
+ oldrecadj=recadj;
+ recadj>>=1;
+ SubDivide(x1,y1,x,y);
+ SubDivide(x,y1,x2,y);
+ SubDivide(x,y,x2,y2);
+ SubDivide(x1,y,x,y2);
+ recadj=oldrecadj;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ The generic version of @x{SubDivide}.
+
+***************************************************************************/
+static void SubDivideG(int x1,int y1,int x2,int y2)
+{
+ int x,y,val,acum;
+ signed char oldrecadj;
+
+ x=(x1+x2)>>1; // X = X center
+ y=(y1+y2)>>1; // Y = Y center
+ if (x1==x && y1==y) // That means we reached a central point
+ return;
+ val=GetPixelG(x,y1);
+ if (val==0)
+ val=AdjustG(x1,y1,x2,y1,x,y1);
+ acum=val;
+ val=GetPixelG(x2,y);
+ if (val==0)
+ val=AdjustG(x2,y1,x2,y2,x2,y);
+ acum+=val;
+ val=GetPixelG(x,y2);
+ if (val==0)
+ val=AdjustG(x1,y2,x2,y2,x,y2);
+ acum+=val;
+ val=GetPixelG(x1,y);
+ if (val==0)
+ val=AdjustG(x1,y1,x1,y2,x1,y);
+ acum+=val;
+ acum>>=2;
+ SetPixelG(x,y,acum);
+ oldrecadj=recadj;
+ recadj>>=1;
+ if (!--cont)
+ {
+ cont=CB_CONT;
+ CB();
+ }
+ SubDivideG(x1,y1,x,y);
+ SubDivideG(x,y1,x2,y);
+ SubDivideG(x,y,x2,y2);
+ SubDivideG(x1,y,x,y2);
+ recadj=oldrecadj;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Generates the ramdom surface in the provided BITMAP.@p
+ ADJ is the recursion amplitud bit pattern. Use 0xFF, 0x7F or 0x3F for
+rougth, medium and smooth surfaces.
+
+***************************************************************************/
+
+int MKS_RamdomFrac1(BITMAP *bmp, unsigned char adj, void (*CallBack)())
+{
+ int w,h;
+
+ if (!is_linear_bitmap(bmp))
+ return 1;
+ clear(bmp);
+ pl4Scr=bmp->line[0];
+ w=bmp->w-1; h=bmp->h-1;
+ recadj=adj;
+ Bmp=bmp;
+ CB=CallBack;
+ cont=CB_CONT;
+
+ // Initialize Random table
+ MA2_InitRTable();
+ if (w==Xopt-1)
+ {
+ // Set the first corners
+ SetPixel(0,0,MA2_GetRand8());
+ SetPixel(w,h,MA2_GetRand8());
+ SetPixel(0,h,MA2_GetRand8());
+ SetPixel(w,0,MA2_GetRand8());
+ // Start the recursion
+ SubDivide(0,0,w,h);
+ }
+ else
+ {
+ // Set the first corners
+ SetPixelG(0,0,MA2_GetRand8());
+ SetPixelG(w,h,MA2_GetRand8());
+ SetPixelG(0,h,MA2_GetRand8());
+ SetPixelG(w,0,MA2_GetRand8());
+ // Start the recursion
+ SubDivideG(0,0,w,h);
+ }
+
+ return 0;
+}
+
+
diff --git a/setedit/scrnsave/plasmlib/movsurf1.c b/setedit/scrnsave/plasmlib/movsurf1.c
new file mode 100644
index 0000000..a5a1707
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/movsurf1.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#include "math4.h"
+#define NO_BITMAP
+#include "mixsurf.h"
+#include "movsurf1.h"
+
+// I use structures to avoid name conflicts but they are static, so then
+// there are no penalty.
+
+MVS_4struct MVS_4;
+
+void MVS_4SurfSC(void)
+{
+ MVS_4.c1+=MVS_4.i1;
+ MVS_4.c2+=MVS_4.i2;
+ MS_4.s1=(unsigned *)(MVS_4.s1+MA4_XSin(MVS_4.c1)+MA4_YCos(MVS_4.c2));
+ MVS_4.c3+=MVS_4.i3;
+ MVS_4.c4+=MVS_4.i4;
+ MS_4.s2=(unsigned *)(MVS_4.s2+MA4_XSin(MVS_4.c3)+MA4_YCos(MVS_4.c4));
+ MVS_4.c5+=MVS_4.i5;
+ MVS_4.c6+=MVS_4.i6;
+ MS_4.s3=(unsigned *)(MVS_4.s3+MA4_XSin(MVS_4.c5)+MA4_YCos(MVS_4.c6));
+ MVS_4.c7+=MVS_4.i7;
+ MVS_4.c8+=MVS_4.i8;
+ MS_4.s4=(unsigned *)(MVS_4.s4+MA4_XSin(MVS_4.c7)+MA4_YCos(MVS_4.c8));
+ MS_4add();
+}
+
+
diff --git a/setedit/scrnsave/plasmlib/movsurf2.c b/setedit/scrnsave/plasmlib/movsurf2.c
new file mode 100644
index 0000000..4cb719f
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/movsurf2.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+#define NO_BITMAP
+#include "movsurf2.h"
+#include "mixsurf.h"
+
+MVS_2Astruct MVS_2A;
+
+void MVS_2SurfA(void)
+{
+ MS_4.s1=(unsigned *)(MVS_2A.s1+MVS_2A.Tray[MVS_2A.cont*2]);
+ MS_4.s2=(unsigned *)(MVS_2A.s2+MVS_2A.Tray[MVS_2A.cont*2+1]);
+ MS_2addC();
+ if (++MVS_2A.cont==MVS_2A.cant)
+ MVS_2A.cont=0;
+}
diff --git a/setedit/scrnsave/plasmlib/obj/delete.me b/setedit/scrnsave/plasmlib/obj/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/obj/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/scrnsave/plasmlib/objfake/delete.me b/setedit/scrnsave/plasmlib/objfake/delete.me
new file mode 100644
index 0000000..13340a4
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/objfake/delete.me
@@ -0,0 +1,2 @@
+Delete this file, is here just to include this directory in the package.
+I know that's need for some un/compressors and is needed by my scripts too.
diff --git a/setedit/scrnsave/plasmlib/palette.c b/setedit/scrnsave/plasmlib/palette.c
new file mode 100644
index 0000000..cf14725
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/palette.c
@@ -0,0 +1,542 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]**********************************************************************
+
+ Module: Palette
+ Comments:
+ This is used to handle palettes.
+@p
+ The functions named RPF_* uses the RAW Palette, that's an array of 768
+bytes.
+
+*****************************************************************************/
+
+#include "palette.h"
+#include <math.h>
+#include "math1.h"
+
+/**[txh]**********************************************************************
+
+ Include: palette.h
+ Description:
+ This function creates a Raw Palette with red, green, blue, yellow and
+cyan bars. The color 0 is black to avoid a border around the screen.
+@p
+ by SET
+
+*****************************************************************************/
+
+void RPF_MakeMultiPal(unsigned char *Pal)
+{
+ int blue,red,green,mz,i,k;
+ for (i=0,k=0,blue=0,mz=0; i<8; i++,blue++,mz+=5)
+ {
+ Pal[k++] = mz;
+ Pal[k++] = mz;//i;
+ Pal[k++] = blue;
+ }
+ for (i=0; i<24; i++,blue++,mz++)
+ {
+ Pal[k++] = mz;
+ Pal[k++] = mz;//i;
+ Pal[k++] = blue;
+ }
+ for (i=0,mz-=2; i<32; i++,blue++,mz-=2)
+ {
+ Pal[k++] = mz;
+ Pal[k++] = mz;//32;
+ Pal[k++] = blue;
+ }
+ for (blue--, green=0, i=0; i<32; i++,blue--,green++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = green;//32;
+ Pal[k++] = blue;
+ }
+ for (i=0; i<32; i++, blue--, green++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = green;//31-i;
+ Pal[k++] = blue;
+ }
+
+ for (i=0, red=0, green--; i<32; i++, red++, green--)
+ {
+ Pal[k++] = red;
+ Pal[k++] = green;//i;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<32; i++, red++, green--)
+ {
+ Pal[k++] = red;
+ Pal[k++] = green;//32;
+ Pal[k++] = 0;
+ }
+ for (red--,i=0,mz=0; i<32; red--,i++,mz+=2)
+ {
+ Pal[k++] = red;
+ Pal[k++] = mz;//32;
+ Pal[k++] = mz;
+ }
+ for (i=0,mz-=2; i<24; i++,red--,mz--)
+ {
+ Pal[k++] = red;
+ Pal[k++] = mz;//31-i;
+ Pal[k++] = mz;
+ }
+ for (i=0; i<8; i++,red--,mz-=5)
+ {
+ Pal[k++] = red;
+ Pal[k++] = mz;//31-i;
+ Pal[k++] = mz;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Creates a red palette with some blue. Red grows from 0 to full in the
+first 64 colors, is sustained by 128 and then falls in the last 64. Blue
+grows and falls in the middle 128 colors.
+
+*****************************************************************************/
+
+void RPF_MakeRedBlueBar(unsigned char *Pal)
+{
+ int i, k;
+ for (i=0, k=0; i<64; i++)
+ {
+ Pal[k++] = i;
+ Pal[k++] = 0;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 63;
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 63;
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 63-i;
+ Pal[k++] = 0;
+ Pal[k++] = 0;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Creates a blue palette with some green. Blue grows from 0 to full in the
+first 64 colors, is sustained by 128 and then falls in the last 64. Green
+grows and falls in the middle 128 colors.
+
+*****************************************************************************/
+
+void RPF_MakeBlueGreenBar(unsigned char *Pal)
+{
+ int i, k;
+ for (i=0, k=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ Pal[k++] = 63;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ Pal[k++] = 63;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Creates a green palette with some red. Green grows from 0 to full in the
+first 64 colors, is sustained by 128 and then falls in the last 64. Red
+grows and falls in the middle 128 colors.
+
+*****************************************************************************/
+
+void RPF_MakeGreenRedBar(unsigned char *Pal)
+{
+ int i, k;
+ for (i=0, k=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = i;
+ Pal[k++] = 63;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 63-i;
+ Pal[k++] = 63;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ Pal[k++] = 0;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Creates a green palette with some red. The bar starts going to green and
+then goes to yellow before disapear. Green grows from 0 to full in the
+first 64 colors, is sustained by 64 and then falls in the last 128. Red
+grows from 64 to 128 and then falls like the green.
+
+*****************************************************************************/
+
+void RPF_MakeGreenRedBar2(unsigned char *Pal)
+{
+ int i,k;
+ for (i=0, k=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = i;
+ Pal[k++] = 63;
+ Pal[k++] = 0;
+ }
+ for (i=0; i<128; i++)
+ {
+ Pal[k++] = 63-(i/2);
+ Pal[k++] = 63-(i/2);
+ Pal[k++] = 0;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Creates 2 bars in the palette. One blue and the other red. Blue grows from
+0 to 63 in the first 64 colors, mantains the value in the middle 128 and falls
+in the last 64. Green is used to enhance the blue luminance and grows and
+falls in the middle 128 colors. Red is used to create a bar with a maximun in
+0 (the border is red). Falls in the first 64 and grows in the last 64.
+
+*****************************************************************************/
+
+void RPF_MakeBlueGreen_RedBars(unsigned char *Pal)
+{
+ int i, k;
+
+ for (i=0, k=0; i<64; i++)
+ {
+ Pal[k++] = 63-i;
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ Pal[k++] = 63;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ Pal[k++] = 63;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = i;
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This generates a light blue with white palette.
+
+***************************************************************************/
+
+void RPF_Argentina(unsigned char *Pal)
+{
+ int i, k;
+ int r,v,a;
+
+ for (i=0, k=0; i<256; i++)
+ {
+ if (i<64)
+ r=cos(i*PI/128)*63;
+ else
+ if (i>=192)
+ r=sin((i-192)*PI/128)*63;
+ else
+ r=0;
+ if (i>32 && i<224)
+ r+=sin((i-32)*PI/192)*55;
+
+ if (i<64)
+ //v=63-i;
+ v=cos(i*PI/128)*63;
+ else
+ if (i>=192)
+ v=sin((i-192)*PI/128)*63;
+ //v=i-192;
+ else
+ v=0;
+ if (i>32 && i<224)
+ v+=sin((i-32)*PI/192)*60;
+
+ if (i<64)
+ a=cos(i*PI/128)*63;
+ else
+ if (i>=192)
+ a=sin((i-192)*PI/128)*63;
+ else
+ a=0;
+ if (i>32 && i<224)
+ a+=sin((i-32)*PI/192)*63;
+
+ Pal[k++] = r;
+ Pal[k++] = v;
+ Pal[k++] = a;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Generates a gray scale palette, 0 is black, 255 is white.
+
+***************************************************************************/
+
+void RPF_GrayScale(unsigned char *Pal)
+{
+ int i,j;
+ for (i=0,j=0; i<63; i++)
+ {
+ Pal[j]=Pal[j+1]=Pal[j+2]=Pal[j+4]=Pal[j+5]=Pal[j+8]=Pal[j+9]=i;
+ Pal[j+3]=Pal[j+6]=Pal[j+7]=Pal[j+10]=Pal[j+11]=i+1;
+ j+=12;
+ }
+ Pal[j]=Pal[j+1]=Pal[j+2]=Pal[j+4]=Pal[j+5]=Pal[j+8]=Pal[j+9]=
+ Pal[j+3]=Pal[j+6]=Pal[j+7]=Pal[j+10]=Pal[j+11]=i;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Draws 256 vertical lines with the 256 colors in the memory provided by s.
+
+*****************************************************************************/
+
+void RPF_DrawPalette(int w, int h, unsigned char *s)
+{
+ int x,y;
+
+ for (y=0; y<h; y++)
+ for (x=0; x<w; s++,x++)
+ if (x<256)
+ *s=x;
+ else
+ *s=0;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Fades from black to the dest palette. The result is stored in out. The step
+can range from 0 to 63.
+
+*****************************************************************************/
+
+void RPF_FromBlack(unsigned char *dest,unsigned char *out,int step)
+{
+ int j;
+ for (j=767; j>=0; j--)
+ out[j]=dest[j]*step/63;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Creates the negative palette of orig.
+
+*****************************************************************************/
+
+void RPF_Negative(unsigned char *orig,unsigned char *out)
+{
+ int i;
+ for (i=767; i>=0; i--)
+ out[i]=(63-orig[i]);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function adds the inc palette to the orig palette and puts the result
+in out. The process is made for the step provided [0-63].
+
+*****************************************************************************/
+
+void RPF_AddPaletteStep(unsigned char *orig,unsigned char *inc,
+ unsigned char *out,int step)
+{
+ int j;
+ for (j=767; j>=0; j--)
+ out[j]=orig[j]+(inc[j]*step)/63;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function goes from white to a dest palette. The steps are from 63 to
+0 in this order.
+
+*****************************************************************************/
+
+void RPF_FromWhite(unsigned char *dest,unsigned char *out,int step)
+{
+ int j;
+ for (j=767; j>=0; j--)
+ {
+ int aux=dest[j]+step;
+ if (aux>63)
+ aux=63;
+ out[j]=aux;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function generates 3 bars in the palette one red the other green and
+one blue. The bars overlaps and generates other colors. Is good to generate
+a beauty palette animation.
+@p
+ Uses the math1 module to calculate the cos.
+
+*****************************************************************************/
+
+void RPF_RGBBarsWithCos(unsigned char *Pal)
+#if 1
+{
+ // That's almost 10 times faster than the floating point version
+ #define mycol(u,a) ((cos_table[u+a]+256)>>3)
+ static int r=MA1_FromDegrees(30),g=MA1_FromDegrees(90),
+ b=MA1_FromDegrees(150);
+ int i=0,j=0;
+ int u;
+ while(i<256)
+ {
+ u=TrigTableSize/256.0*i;
+ Pal[j] =mycol(u,r);
+ Pal[j+1]=mycol(u,g);
+ Pal[j+2]=mycol(u,b);
+ j+=3;
+ i++;
+ }
+ r+=MA1_FromDegrees(3);
+ MA1_WrapAngleG(r);
+ g-=MA1_FromDegrees(3);
+ MA1_WrapAngleB(g);
+ b+=MA1_FromDegrees(6);
+ MA1_WrapAngleG(b);
+}
+#else
+{
+ static double r=1.0/6.0*PI,g=3.0/6.0*PI,b=5.0/6.0*PI;
+ int i=0,j=0;
+ double u;
+ while(i<256)
+ {
+ u=2*PI/256*i;
+//#define mycol(u,a) (max(0.0,cos((u)+(a))))*63 // try this line instead
+#define mycol(u,a) (cos((u)+(a))+1)*31
+ Pal[j] =mycol(u,r);
+ Pal[j+1]=mycol(u,g);
+ Pal[j+2]=mycol(u,b);
+ j+=3;
+ i++;
+ }
+ r+=0.05;
+ g-=0.05;
+ b+=0.1;
+}
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the colors [color,color+cant) in the palette from the _pal_ptr
+raw palette.
+
+ Example:
+ RPF_SetPalRange(palette,1,255); // All but color 0
+
+***************************************************************************/
+
+void RPF_SetPalRange(unsigned char *_pal_ptr, int color, int cant)
+{
+ int dummy1,dummy2,dummy3,dummy4;
+__asm__ __volatile__(" \n\
+ outb %%al,%%dx \n\
+ incl %%edx \n\
+ cli \n\
+ rep \n\
+ outsb \n\
+ sti"
+: "=a" (dummy1), "=d" (dummy2), "=S" (dummy3), "=c" (dummy4)
+: "c" (cant*3), "S" (_pal_ptr), "a" (color), "d" (0x3C8)
+);
+}
+
+void RPF_GetAllegroPalette(char *pal)
+{
+ int dummy1,dummy2;
+ __asm__ __volatile__ (" \n\
+ outb %%al,%%dx \n\
+ incl %%edx \n\
+ cli \n\
+ 1: \n\
+ insb \n\
+ insb \n\
+ insb \n\
+ incl %%edi \n\
+ decl %%ecx \n\
+ jnz 1b \n\
+ sti \n\
+ "
+ : "=a" (dummy1), "=d" (dummy2)
+ : "d" (0x3C8), "a" (0), "c" (256), "D" (pal)
+ );
+}
diff --git a/setedit/scrnsave/plasmlib/plasa1.c b/setedit/scrnsave/plasmlib/plasa1.c
new file mode 100644
index 0000000..298e499
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/plasa1.c
@@ -0,0 +1,464 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]**********************************************************************
+
+ Module: Plasma 1
+ Comments:
+ This module provides some routines for trigonometric plasmas.
+ The functions uses the sin and cos look up tables from @x{Math 1}.
+ Some routines are originally by Nutty, I added new routines and enhanced
+the rest using C instead of assembler. I saw the same plasma idea in other
+sources so I think Nutty just enhanced some code.
+ This plasma is calculated in real time, that's the surface is calculated
+for each frame. That's limited but very good.
+ The module can be optimized using assembler because GCC isn't perfect.
+
+*****************************************************************************/
+
+#include <stdlib.h>
+#include <math.h>
+#include "math1.h"
+#include "plasa1.h"
+#include "palette.h"
+
+//
+// Some macros to make the code more clear
+//
+#define IncWithWrap(a) if (++a==TrigTableSize) a=0
+#define CutExesValue(a) if (a>=TrigTableSize-1) a=0
+#define WrapValue(a) if (a>TrigTableSize-1) a-=TrigTableSize
+
+static int dsI1=0;
+
+/**[txh]**********************************************************************
+
+ Include: plasa1.h
+ Description:
+ Plasma with the equation: [cos(step)+cos(Y)+sin(Y)+cos(X)]*128. A temporal
+copy of step is incremented with Y and the value is incremented each pass.
+@p
+ The values are in half of degrees. That's is X=320 is 160 degrees.
+@p
+ Original code by Nutty. Optimized in C by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_1(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsI1l=dsI1;
+
+ for (Y=200; Y; --Y)
+ {
+ int Yv=cos_table[dsI1l]+cos_table[Y]+sin_table[Y];
+ for (X=320; X; s++,--X)
+ *s=(Yv+cos_table[X])>>1;
+ IncWithWrap(dsI1l);
+ }
+ IncWithWrap(dsI1);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Same as PLA1_Step320x200_1 but with less zoom. @x{PLA1_Step320x200_1}.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_1b(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsI1l=dsI1;
+
+ for (Y=400; Y; Y-=2)
+ {
+ int Yv=cos_table[dsI1l]+cos_table[Y]+sin_table[Y];
+ for (X=640; X; s++,X-=2)
+ *s=(Yv+cos_table[X])>>1;
+ IncWithWrap(dsI1l);
+ }
+ IncWithWrap(dsI1);
+}
+
+static int dsI2=0;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Equation: [cos(256*sin(I)+X)+cos(Itemp)+sin(Y)+cos(Y)]*256. I is incremented
+with each pass, Itemp starts with I and is incremented with Y. The argument
+of the first cos is truncated to 0 if the values is negative.
+@p
+ Original code by Nutty. Optimized in C by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_2(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI2;
+ int temp=sin_table[dsI2]; // Can be negative!
+
+ for (Y=200; Y; --Y)
+ {
+ for (X=320; X; s++,--X) // --X at the end to use the flag saves 1 instruction
+ {
+ register unsigned t2 asm ("%eax"); // Force the addition in 32 bits ;-) saves 1 instruction
+ t2=temp+X;
+ CutExesValue(t2);
+ t2=cos_table[t2]+cos_table[dsIl]+cos_table[Y]+sin_table[Y];
+ *s=t2;
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI2);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Same as PLA1_Step320x200_2 but with less zoom. @x{PLA1_Step320x200_2}.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_2b(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI2;
+ int temp=sin_table[dsI2]; // Can be negative!
+
+ for (Y=400; Y; Y-=2)
+ {
+ for (X=640; X; s++,X-=2) // --X at the end to use the flag saves 1 instruction
+ {
+ register unsigned t2 asm ("%eax"); // Force the addition in 32 bits ;-) saves 1 instruction
+ t2=temp+X;
+ CutExesValue(t2);
+ t2=cos_table[t2]+cos_table[dsIl]+cos_table[Y]+sin_table[Y];
+ *s=t2;
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI2);
+}
+
+static int dsI3=0;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Equation: {cos(step)+[cos(X)+cos(Y)]/2}*256. See the
+@x{PLA1_Step320x200_1,plasma 1}.
+@p
+ Original code by Nutty. Optimized in C by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_3(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI3;
+
+ for (Y=200; Y; --Y)
+ {
+ int temp=(cos_table[dsIl]<<1)+sin_table[Y];
+ for (X=320; X; s++,--X)
+ *s=(temp+cos_table[X])>>1;
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI3);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Same as PLA1_Step320x200_3 but with less zoom. @x{PLA1_Step320x200_3}.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_3b(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI3;
+
+ for (Y=400; Y; Y-=2)
+ {
+ int temp=(cos_table[dsIl]<<1)+sin_table[Y];
+ for (X=640; X; s++,X-=2)
+ *s=(temp+cos_table[X])>>1;
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI3);
+}
+
+static int dsI4=0;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Equation: {sin(step)+[cos(X)+cos(Y)]/2}*256. See the
+@x{PLA1_Step320x200_1,plasma 1}.
+@p
+ by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_4(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI4;
+
+ for (Y=200; Y; --Y)
+ {
+ int temp=(sin_table[dsIl]<<1)+sin_table[Y];
+ for (X=320; X; s++,--X)
+ *s=(temp+cos_table[X])>>1;
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI4);
+}
+
+static int dsI5=0;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Equation: [cos(step)+cos(X)+cos(Y)]*256. See the
+@x{PLA1_Step320x200_1,plasma 1}.
+@p
+ by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_5(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI5;
+
+ for (Y=600; Y; Y-=3)
+ {
+ int Yv=sin_table[Y]+sin_table[dsIl];
+ for (X=640; X; s++,X-=2)
+ *s=Yv+cos_table[X];
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI5);
+}
+
+static int dsI6=0;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Equation: [cos(step)+cos(X)+cos(Y)]*256. See the
+@x{PLA1_Step320x200_1,plasma 1}.
+@p
+ by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_6(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=sin_table[dsI6]+256;
+
+ for (Y=600; Y; Y-=3)
+ {
+ int temp=dsIl;
+ for (X=640; X; s++,X-=2)
+ {
+ IncWithWrap(temp);
+ *s=cos_table[X]+sin_table[Y]+sin_table[temp];
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI6);
+}
+
+
+static int dsI7=0,dsX7=0,dsY7=0,direction7=1;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Equation: [sin(step)+cos(X+Xoff)+cos(Y+Yoff)]*256. That's complex, Xoff is
+a sin, Yoff is a ping-pong (linear) and step is the most complex. The static
+value of step is incremented with each pass, a temporal copy is used for step
+first the value is loaded with (sin(static step)+1)*256 then the value is
+incremented with each Y, finally the step used is a second temporal
+incremented with each X. See the @x{PLA1_Step320x200_1,plasma 1}.
+@p
+ by SET.
+
+*****************************************************************************/
+
+void PLA1_Step320x200_7(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=sin_table[dsI7]+256;
+
+ for (Y=200; Y; Y--)
+ {
+ int temp=dsIl;
+ for (X=320; X; s++,X--)
+ {
+ IncWithWrap(temp);
+ *s=cos_table[X+dsX7]+sin_table[Y+dsY7]+sin_table[temp];
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI7);
+ if (dsY7==(TrigTableSize-200))
+ direction7=-1;
+ else
+ if (dsY7==0 && direction7==-1)
+ direction7=1;
+ dsY7+=direction7;
+ dsX7=(cos_table[dsI7]+256)>>1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ A generic version of @x{PLA1_Step320x200_1}.
+
+***************************************************************************/
+
+void PLA1_Step_1(int w, int h, unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsI1l=dsI1;
+ int Yv;
+
+ for (Y=h; Y; --Y)
+ {
+ // Nutty didn't saw it, C code faster than ASM ;-)
+ Yv=cos_table[dsI1l]+cos_table[Y]+sin_table[Y];
+ for (X=w; X; s++,--X)
+ *s=(Yv+cos_table[X])>>1;
+ IncWithWrap(dsI1l);
+ }
+ IncWithWrap(dsI1);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ A generic version of @x{PLA1_Step320x200_2}.
+
+***************************************************************************/
+
+void PLA1_Step_2(int w, int h, unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI2;
+ int temp=sin_table[dsI2];
+
+ for (Y=h; Y; --Y)
+ {
+ int Yv=cos_table[Y]+sin_table[Y]+cos_table[dsIl];
+ for (X=w; X; s++,--X)
+ {
+ unsigned t2;
+ t2=temp+X;
+ CutExesValue(t2);
+ *s=cos_table[t2]+Yv;
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI2);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ A generic version of @x{PLA1_Step320x200_3}.
+
+***************************************************************************/
+
+void PLA1_Step_3(int w, int h, unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI3;
+
+ for (Y=h; Y; --Y)
+ {
+ int temp=(cos_table[dsIl]<<1)+sin_table[Y];
+ for (X=w; X; s++,--X)
+ *s=(temp+cos_table[X])>>1;
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI3);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ A generic version of @x{PLA1_Step320x200_4}.
+
+***************************************************************************/
+
+void PLA1_Step_4(int w, int h, unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=dsI4;
+
+ for (Y=h; Y; --Y)
+ {
+ int temp=(sin_table[dsIl]<<1)+sin_table[Y];
+ for (X=w; X; s++,--X)
+ *s=(temp+cos_table[X])>>1;
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI4);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ A generic version of @x{PLA1_Step320x200_7}.
+
+***************************************************************************/
+
+void PLA1_Step_7(int w, int h, unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=sin_table[dsI7]+256;
+
+ for (Y=h; Y; Y--)
+ {
+ int temp=dsIl;
+ int temp2=sin_table[Y+dsY7];
+ for (X=w; X; s++,X--)
+ {
+ IncWithWrap(temp);
+ *s=temp2+cos_table[X+dsX7]+sin_table[temp];
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI7);
+ if (dsY7==(TrigTableSize*2-h))
+ direction7=-1;
+ else
+ if (dsY7==0 && direction7==-1)
+ direction7=1;
+ dsY7+=direction7;
+ dsX7=(cos_table[dsI7]+256)>>1;
+}
+
+
diff --git a/setedit/scrnsave/plasmlib/plasa2.c b/setedit/scrnsave/plasmlib/plasa2.c
new file mode 100644
index 0000000..809594c
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/plasa2.c
@@ -0,0 +1,327 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Plasma 2
+ Comments:
+ That's a plasma that uses 4 "circles" (3D cones). Each circle is moved
+without syncro with the others, the addition of the 4 circles gives the
+plasma.@p
+ The original code was by Jan Mller & Erik Hansen.@p
+ Look in the plasma 2g module for a generic version. @x{Plasma 2G}.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <math.h>
+#include "math1.h"
+
+#define pla2w 320
+#define pla2h 200
+#define pla2w2 (pla2w*2)
+#define pla2h2 (pla2h*2)
+#define uchar unsigned char
+
+static unsigned char *tab1,*tab2;
+
+/**[txh]********************************************************************
+
+ Include: plasa1.h
+ Description:
+ It creates the two surfaces used for the plasma. They have w=2*screen
+width and h=2*screen height.@p
+ The equations used are:@*
+{sqrt[16.0+(Y-Ycenter)^2+(X-Xcenter)^2]-4}*5@*
+90*(sin{sqrt[16.0+(Y-Ycenter)^2+(X-Xcenter)^2]-4}+1)@p
+ That's the 320x200 version. @x{PLA2G_InitPlasmaTables}.
+
+ Return:
+ 0 if all OK, 1 if not memory.
+
+***************************************************************************/
+
+int PLA2_InitPlasmaTables(void)
+{
+ int i=0,j=0;
+ float temp;
+ unsigned char *s;
+
+ tab1=(unsigned char *)malloc(pla2w2*pla2h*2);
+ tab2=(unsigned char *)malloc(pla2w2*pla2h*2);
+ if (!tab1 || !tab2)
+ return 1;
+
+ // The table is 2x the screen to move the circles
+ s=tab1;
+ for (i=0; i<pla2h2; i++)
+ for (j=pla2w2; j; s++,--j)
+ *s=(uchar)((sqrt( 16.0+(pla2h-i)*(pla2h-i)+(pla2w-j)*(pla2w-j) )-4) *5 );
+
+ s=tab2;
+ for (i=0; i<pla2h2; i++)
+ for (j=pla2w2; j; s++,--j)
+ {
+ temp=sqrt(16.0+(pla2h-i)*(pla2h-i)+(pla2w-j)*(pla2w-j))-4;
+ *s=(sin(temp/9.5)+1)*90;
+ //tab2[(i*pla2w2)+j]=(sin(sqrt((pla2h-i)*(pla2h-i)+(pla2w-j)*(pla2w-j))/9.5)+1)*90;
+ }
+ return 0;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Deallocates the memory used for the tables.
+
+***************************************************************************/
+
+void PLA2_DeInit(void)
+{
+ free(tab1);
+ free(tab2);
+}
+
+static float circle1=0,circle2=0,circle3=0,circle4=0,circle5=0,circle6=0,circle7=0,circle8=0;
+static int PLA2_x1,PLA2_y1,PLA2_x2,PLA2_y2,PLA2_x3,PLA2_y3,PLA2_x4,PLA2_y4;
+//static int roll=0;
+
+/*void PLA2_StepBody(unsigned char *buf)
+{
+ long i=0,j=0;
+ char *s;
+ // Create the pointers to 4 surfaces
+ char *yy1=tab1+pla2w2*PLA2_y1+PLA2_x1;
+ char *yy2=tab2+pla2w2*PLA2_y2+PLA2_x2;
+ char *yy3=tab2+pla2w2*PLA2_y3+PLA2_x3;
+ char *yy4=tab2+pla2w2*PLA2_y4+PLA2_x4;
+ s=buf;
+
+ for (i=pla2h; i; --i)
+ {
+ for (j=pla2w; j; s++,--j)
+ {
+ // Here we add the surfaces
+ *s=yy1[j]+yy2[j]+yy3[j]+yy4[j];
+ }
+ yy1+=pla2w2;
+ yy2+=pla2w2;
+ yy3+=pla2w2;
+ yy4+=pla2w2;
+ }
+}*/
+/**[txh]********************************************************************
+
+ Description:
+ That's a four surfaces mixer for 320x200. Isn't generic because uses
+320x200 and the surfaces are in fact two, one is used three times with
+different trajectories. @x{PLA2G_StepBody}.@p
+ BUF is the destination buffer.
+
+***************************************************************************/
+
+void PLA2_StepBody(unsigned char *buf)
+{
+ long i=0,j=0;
+ unsigned *s;
+ // Create the pointers to 4 surfaces
+ unsigned *yy1=(unsigned *)(tab1+pla2w2*PLA2_y1+PLA2_x1);
+ unsigned *yy2=(unsigned *)(tab2+pla2w2*PLA2_y2+PLA2_x2);
+ unsigned *yy3=(unsigned *)(tab2+pla2w2*PLA2_y3+PLA2_x3);
+ unsigned *yy4=(unsigned *)(tab2+pla2w2*PLA2_y4+PLA2_x4);
+ s=(unsigned *)buf;
+
+ for (i=pla2h; i; --i)
+ {
+ for (j=0; j<pla2w/4; s++,++j)
+ {
+ // Here we add the surfaces, but with 32 bits ;-))
+ *s=yy1[j]+yy2[j]+yy3[j]+yy4[j];
+ }
+ yy1+=pla2w2/4;
+ yy2+=pla2w2/4;
+ yy3+=pla2w2/4;
+ yy4+=pla2w2/4;
+ }
+}
+
+/* That's the GCC code plus a little optimization. GCC generates a silly
+ reload inside the inner loop (bug).
+ Addtionally it shows a second bug: EBP isn't restored by GCC even when
+ it's in the clobber list (was reported).
+void PLA2_StepBody(unsigned char *buf)
+{
+ int i;
+
+ asm(" pushl %%ebp
+
+ movl _PLA2_y1,%%eax
+ leal (%%eax,%%eax,4),%%eax
+ sall $7,%%eax
+ addl _tab1,%%eax
+ addl _PLA2_x1,%%eax
+ movl %%eax,%%edi
+
+ movl _PLA2_y2,%%eax
+ leal (%%eax,%%eax,4),%%eax
+ sall $7,%%eax
+ movl _tab2,%%ecx
+ addl %%ecx,%%eax
+ movl %%eax,%%ebp
+ addl _PLA2_x2,%%ebp
+
+ movl _PLA2_y3,%%eax
+ leal (%%eax,%%eax,4),%%eax
+ sall $7,%%eax
+ addl %%ecx,%%eax
+ movl %%eax,%%esi
+ addl _PLA2_x3,%%esi
+
+ movl _PLA2_y4,%%eax
+ leal (%%eax,%%eax,4),%%eax
+ sall $7,%%eax
+ addl %%ecx,%%eax
+ movl %%eax,%%ebx
+ addl _PLA2_x4,%%ebx
+
+ movl $200,%k0
+ .align 2,0x90
+LoopY:
+ movl $320,%%ecx
+ .align 2,0x90
+LoopX:
+ movb (%%ecx,%%edi),%%al
+ addb (%%ecx,%%ebp),%%al
+ addb (%%ecx,%%esi),%%al
+ addb (%%ecx,%%ebx),%%al
+ movb %%al,(%%edx)
+
+ incl %%edx
+ decl %%ecx
+ jne LoopX
+
+ addl $640,%%edi
+ addl $640,%%ebp
+ addl $640,%%esi
+ addl $640,%%ebx
+ decl %k0
+ jne LoopY
+
+ popl %%ebp
+ " : "=m" (i)
+ : "d" (buf)
+ : "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "%ebp");
+}*/
+
+/**[txh]********************************************************************
+
+ Description:
+ That's one of the functions you can call to step in this plasma. This
+version uses floating point for the tajectories.
+
+***************************************************************************/
+// That's slow, about 48750 trajectory points per second in my machine
+void PLA2_Step1(unsigned char *buf)
+{
+ circle1+=0.085/6;
+ circle2-=0.1/6;
+ circle3+=.3/6;
+ circle4-=.2/6;
+ circle5+=.4/6;
+ circle6-=.15/6;
+ circle7+=.35/6;
+ circle8-=.05/6;
+ PLA2_x2=(pla2w/2)+(pla2w/2)*sin(circle1);
+ PLA2_y2=(pla2h/2)+(pla2h/2)*cos(circle2);
+
+ PLA2_x1=(pla2w/2)+(pla2w/2)*cos(circle3);
+ PLA2_y1=(pla2h/2)+(pla2h/2)*sin(circle4);
+
+ PLA2_x3=(pla2w/2)+(pla2w/2)*cos(circle5);
+ PLA2_y3=(pla2h/2)+(pla2h/2)*sin(circle6);
+
+ PLA2_x4=(pla2w/2)+(pla2w/2)*cos(circle7);
+ PLA2_y4=(pla2h/2)+(pla2h/2)*sin(circle8);
+ PLA2_StepBody(buf);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ That's one of the functions you can call to step in this plasma. This
+version uses floating point increments and the Math 1 module for the co/sine.
+@x{Math 1}.
+
+***************************************************************************/
+// That's a little faster 79130 per second
+// I guess the error is less than 0.5% (1 pixel?)
+double d1=0,d2=0,d3=0,d4=0,d5=0,d6=0,d7=0,d8=0;
+
+void PLA2_Step2(unsigned char *buf)
+{
+ MA1_IncAng(d1,MA1_FromRad(0.085/6));
+ MA1_DecAng(d2,MA1_FromRad(0.1/6));
+ MA1_IncAng(d3,MA1_FromRad(.3/6));
+ MA1_DecAng(d4,MA1_FromRad(.2/6));
+ MA1_IncAng(d5,MA1_FromRad(.4/6));
+ MA1_DecAng(d6,MA1_FromRad(.15/6));
+ MA1_IncAng(d7,MA1_FromRad(.35/6));
+ MA1_DecAng(d8,MA1_FromRad(.05/6));
+
+ PLA2_x2=(pla2w/2)+(pla2w/2)*tsin(d1);
+ PLA2_y2=(pla2h/2)+(pla2h/2)*tcos(d2);
+
+ PLA2_x1=(pla2w/2)+(pla2w/2)*tcos(d3);
+ PLA2_y1=(pla2h/2)+(pla2h/2)*tsin(d4);
+
+ PLA2_x3=(pla2w/2)+(pla2w/2)*tcos(d5);
+ PLA2_y3=(pla2h/2)+(pla2h/2)*tsin(d6);
+
+ PLA2_x4=(pla2w/2)+(pla2w/2)*tcos(d7);
+ PLA2_y4=(pla2h/2)+(pla2h/2)*tsin(d8);
+
+ PLA2_StepBody(buf);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's one of the functions you can call to step in this plasma. This
+version uses integer increments and the Math 1 module for the co/sine.
+@x{Math 1}.
+
+***************************************************************************/
+// That's really faster 160600 per second, but is a little different.
+// If you need more speed you can:
+// 1) Use a sin/cos table with pla2w/2 as amplitude (other for h).
+// 2) Just precalculate the trajectories with the Lissajous lib.
+static int c1=0,c2=0,c3=0,c4=0,c5=0,c6=0,c7=0,c8=0;
+
+void PLA2_Step3(unsigned char *buf)
+{
+ MA1_IncAng(c1,1);
+ MA1_DecAng(c2,1);
+ MA1_IncAng(c3,3);
+ MA1_DecAng(c4,2);
+ MA1_IncAng(c5,3);
+ MA1_DecAng(c6,1);
+ MA1_IncAng(c7,3);
+ MA1_DecAng(c8,1);
+
+ PLA2_x2=(pla2w/2)+(int)((pla2w/2)*tsin(c1));
+ PLA2_y2=(pla2h/2)+(int)((pla2h/2)*tcos(c2));
+
+ PLA2_x1=(pla2w/2)+(int)((pla2w/2)*tcos(c3));
+ PLA2_y1=(pla2h/2)+(int)((pla2h/2)*tsin(c4));
+
+ PLA2_x3=(pla2w/2)+(int)((pla2w/2)*tcos(c5));
+ PLA2_y3=(pla2h/2)+(int)((pla2h/2)*tsin(c6));
+
+ PLA2_x4=(pla2w/2)+(int)((pla2w/2)*tcos(c7));
+ PLA2_y4=(pla2h/2)+(int)((pla2h/2)*tsin(c8));
+
+ PLA2_StepBody(buf);
+}
+
+
diff --git a/setedit/scrnsave/plasmlib/plasa2g.c b/setedit/scrnsave/plasmlib/plasa2g.c
new file mode 100644
index 0000000..d537a3b
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/plasa2g.c
@@ -0,0 +1,133 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Plasma 2G
+ Comments:
+ That's the generic version of the plasma 2 module. @x{Plasma 2}.@p
+ Supports any resolution and is very optimized. Perhaps no so fast as the
+PLA2_Step3 (@x{PLA2_Step3}), but almost as fast and more accuracy.@p
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <math.h>
+#define NO_BITMAP
+#include "math1.h"
+#include "math4.h"
+#include "mixsurf.h"
+#include "mksurf.h"
+#include "movsurf1.h"
+
+#define uchar unsigned char
+
+static unsigned char *tab1,*tab2;
+
+/**[txh]********************************************************************
+
+ Description:
+ Calculates the surfaces for the plasma.@p
+ SURF1 selects the surface. Use 1 to get the same surfaces used in the
+320x200 version. @x{PLA2G_InitPlasmaTables}. Use 0 for surfaces that are
+calculated much more faster.@p
+ BSIZE sets the size of the sine period. Use values from 2 to 80 with
+decimals.@p
+ W and H sets the size of the screen, the surfaces are twice greater be
+careful in SVGA modes (various Mb).
+
+ Return:
+ 0 if OK, 1 if no memory.
+
+***************************************************************************/
+
+int PLA2G_InitPlasmaTables(int sW, int sH, unsigned char *buf, double Bsize,
+ int Surf1, int mW, int mH, void (*CallBack)(void))
+{
+ unsigned char *s;
+ int tX,tY;
+
+ tX=sW/2; tY=sH/2;
+ MS_4.sWw=sW/4; MS_4.sH=sH; MS_4.mWw=mW/4; MS_4.mW=mW;
+ MS_4.dest=buf;
+
+ // be carefull, 1024*768 => 2048*1536=3.14 Mb => 4Mb so you'll need
+ // 8 Mb for the map and 1 Mb for the virtual screen. That's HUGE and
+ // the map calculation will take a LOT of time, so don't exagerate.
+ tab1=(unsigned char *)malloc(mW*mH);
+ tab2=(unsigned char *)malloc(mW*mH);
+ if (!tab1 || !tab2)
+ return 1;
+
+ // The table is 2x the screen to move the circles
+ s=tab1;
+ switch (Surf1)
+ {
+ case 0:
+ MKS_C2ySySiCx(mW,mH,s,CallBack);
+ break;
+ default:
+ MKS_DistCentS(mW,mH,s,sW,sH,CallBack);
+ }
+
+ s=tab2;
+ switch (Surf1)
+ {
+ case 0:
+ MKS_SinDisCentSf(mW,mH,s,sW,sH,Bsize,CallBack);
+ break;
+ default:
+ MKS_SinDisCentS(mW,mH,s,sW,sH,Bsize,CallBack);
+ break;
+ }
+#ifdef DWORD_ALIGN
+ MS_InvertDWordScreen(mW,mH,tab1);
+ MS_InvertDWordScreen(mW,mH,tab2);
+ MA4_FillTableIW(tX-1,tX,0,MA4NoScale | MA4XSin);
+#else
+ MA4_FillTableI(tX-1,tX,0,MA4NoScale | MA4XSin);
+#endif
+ MA4_FillTableI(tY-1,tY,mW,MA4YSin);
+
+ /* Initialize the trajectory parameters
+ Don't worry about the function call, they are solved in compile time */
+ MVS_4.c1=0; MVS_4.c2=0;
+ MVS_4.i1=MA4_f2fix(MA4_FromRad(0.085/6));
+ MVS_4.i2=MA4_f2fix(MA4_FromRad(0.1/6));
+ MVS_4.s1=tab1;
+
+ // Invert the sin and cos
+ MVS_4.c3=MA4_i2fix(MA4_FromDeg(90)); MVS_4.c4=MA4_i2fix(MA4_FromDeg(270));
+ MVS_4.i3=MA4_f2fix(MA4_FromRad(0.3/6));
+ MVS_4.i4=-MA4_f2fix(MA4_FromRad(0.2/6));
+ MVS_4.s2=tab2;
+
+ MVS_4.c5=MA4_i2fix(MA4_FromDeg(90)); MVS_4.c6=MA4_i2fix(MA4_FromDeg(270));
+ MVS_4.i5=MA4_f2fix(MA4_FromRad(0.4/6));
+ MVS_4.i6=-MA4_f2fix(MA4_FromRad(0.15/6));
+ MVS_4.s3=tab2;
+
+ MVS_4.c7=MA4_i2fix(MA4_FromDeg(90)); MVS_4.c8=MA4_i2fix(MA4_FromDeg(270));
+ MVS_4.i7=MA4_f2fix(MA4_FromRad(0.35/6));
+ MVS_4.i8=-MA4_f2fix(MA4_FromRad(0.05/6));
+ MVS_4.s4=tab2;
+
+ return 0;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Deallocates the memory used for the tables.
+
+***************************************************************************/
+
+void PLA2G_DeInit(void)
+{
+ free(tab1);
+ free(tab2);
+}
+
+
+
+
diff --git a/setedit/scrnsave/plasmlib/plasa3.c b/setedit/scrnsave/plasmlib/plasa3.c
new file mode 100644
index 0000000..9227805
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/plasa3.c
@@ -0,0 +1,173 @@
+/* Copyright (C) 1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copying file for details */
+/**[txh]********************************************************************
+
+ Module: Plasma 3
+ Comments:
+ Plasma 3 is a 2 surfaces mixer. Is based on a plasma by JCL-software
+(Jezza).@p
+ The plasma uses two times the same surfaces so is suitable only for very
+complex surfaces.
+
+***************************************************************************/
+
+#include <stdlib.h>
+#include <math.h>
+#define NO_BITMAP
+#include <string.h>
+#include "math1.h"
+#include "palette.h"
+#include "lissa.h"
+#include "mixsurf.h"
+#include "mksurf.h"
+#include "movsurf2.h"
+
+// Trajectory points
+#define pla3Tp 10000
+// Colors
+#define pla3Co (pla3Tp+240)
+
+static unsigned char *PLA3_Map =NULL;
+static unsigned *PLA3_Tray=NULL;
+static unsigned char *PLA3_Cols=NULL;
+
+/**[txh]********************************************************************
+
+ Description:
+ This function creates the precalculated trajectories.@p
+ Uses the Lissajous module. @x{Lissajous}.
+
+***************************************************************************/
+
+void PLA3_MakeTrajectory(int mw, int mh, int sw, int sh)
+{
+ Lissajous t;
+ int w=mw-sw;
+ int h=mh-sh;
+
+ // 1:2 is like the infinite symbol
+ LS_FillRadInc(&t,pla3Tp,MA1_DegToRad(90),0,1/32.0,1/16.0,0,0,w,h);
+ LS_FillOffsets(&t,PLA3_Tray,2,mw);
+ // That's a very complex: 24:21
+ LS_FillRadInc(&t,pla3Tp,0,MA1_DegToRad(90),1/21.0,1/24.0,0,0,w,h);
+ LS_FillOffsets(&t,PLA3_Tray+1,2,mw);
+}
+
+// That uses a lot of FPU
+void PLA3_CreateSSPal(unsigned char *s)
+{
+ double y1=0,y2=0,y3=0,y4=0,y5=0,y6=0;
+ int i,k;
+
+ memset(s,0,768);
+ for (k=768,i=0; i<256*39; i++,k+=3)
+ {
+ s[k] =31+(int)(tsin(y1)*tsin(y2)*31);
+ s[k+1]=31+(int)(tsin(y3)*tsin(y4)*31);
+ s[k+2]=31+(int)(tsin(y5)*tsin(y6)*31);
+ MA1_IncAngRad(y1,1/20.0);
+ MA1_IncAngRad(y2,1/15.0);
+ MA1_IncAngRad(y3,1/35.0);
+ MA1_IncAngRad(y4,1/22.0);
+ MA1_IncAngRad(y5,1/13.0);
+ MA1_IncAngRad(y6,1/30.0);
+ }
+}
+
+static int deleteSurf;
+
+/**[txh]********************************************************************
+
+ Description:
+ This function initialize all the tables, that's: the surface, the
+trajectories (2) and the colors.@p
+ W,H is the size of the screen.@p
+ W2,H2 is the size of the surface.@p
+ extSurface can be used to provide an external surface. @x{Plasma 4}.
+ Surface selects the surface 1 is the original, 0 one similar.
+
+ Return:
+ 0 if OK.
+
+***************************************************************************/
+
+int PLA3_InitPlasmaTables(int Surface,int w,int h,unsigned char *buf,
+ int w2,int h2,unsigned char *extSurface,
+ void (*CallBack)(void))
+{
+ // Parameters for the surface maker
+ MS_4.sWw=w>>2; MS_4.sH=h;
+ MS_4.mWw=w2>>2; MS_4.mW=w2;
+ MS_4.dest=buf;
+
+ // Allocate memory for surface, tajectory and colors
+ if (!extSurface)
+ {
+ PLA3_Map=(unsigned char *)malloc(w2*h2);
+ deleteSurf=1;
+ }
+ else
+ {
+ PLA3_Map=extSurface;
+ deleteSurf=0;
+ }
+ PLA3_Tray=(unsigned *)malloc(pla3Tp*sizeof(unsigned)*2);
+ PLA3_Cols=(unsigned char *)malloc(pla3Co*3);
+ if (!PLA3_Map || !PLA3_Tray || !PLA3_Cols)
+ return 1;
+
+ // Create the surface
+ if (!extSurface)
+ switch (Surface)
+ {
+ case 0: // Similar to the original
+ MKS_SxCxSyCySxy(w2,h2,PLA3_Map,CallBack);
+ break;
+ default: // Almost the original, with less decimals
+ MKS_SxCxSyCySxyCh(w2,h2,PLA3_Map,CallBack);
+ }
+
+ // Create the trajectory
+ PLA3_MakeTrajectory(w2,h2,w,h);
+ // Create the palette
+ PLA3_CreateSSPal(PLA3_Cols);
+
+ // Initialize the surface mixer parameters
+ MVS_2A.cont=0; MVS_2A.cant=pla3Tp;
+ MVS_2A.Tray=PLA3_Tray;
+ MVS_2A.s1=MVS_2A.s2=PLA3_Map;
+
+ return 0;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Deallocates the memory used for the tables.
+
+***************************************************************************/
+
+void PLA3_DeInit(void)
+{
+ if (deleteSurf)
+ free(PLA3_Map);
+ free(PLA3_Tray);
+ free(PLA3_Cols);
+ PLA3_Map=NULL;
+ PLA3_Tray=NULL;
+ PLA3_Cols=NULL;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ It animates the palette using the precalculated table.
+
+***************************************************************************/
+
+void PLA3_StepPal(void)
+{
+ RPF_SetPalRange(PLA3_Cols+MVS_2A.cont*3,1,255);
+} \ No newline at end of file
diff --git a/setedit/scrnsave/plasmlib/plasmlib.gpr b/setedit/scrnsave/plasmlib/plasmlib.gpr
new file mode 100644
index 0000000..56fb94f
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/plasmlib.gpr
Binary files differ
diff --git a/setedit/scrnsave/plasmlib/plasmlib.mak b/setedit/scrnsave/plasmlib/plasmlib.mak
new file mode 100644
index 0000000..873b46b
--- /dev/null
+++ b/setedit/scrnsave/plasmlib/plasmlib.mak
@@ -0,0 +1,359 @@
+# This file is automatically generated by RHIDE Version 1.4.7
+# created with the command:
+# E:\DJ\BIN/gpr2mak.exe plasmlib/plasmlib.gpr
+vpath_obj=obj
+vpath %.o $(vpath_obj)
+RHIDE_GCC=gcc
+RHIDE_AS=gcc
+RHIDE_GXX=gcc
+RHIDE_GPC=gpc
+RHIDE_FPC=ppc386
+RHIDE_AR=ar
+RHIDE_LD=gcc
+RHIDE_G77=g77
+RHIDE_NASM=nasm
+RHIDE_LD_PASCAL=gpc
+RHIDE_LD_FPC=ld
+RHIDE_GNATBIND=gnatbind
+RHIDE_RM=rm
+RHIDE_ARFLAGS=rcs
+RHIDE_TYPED_LIBS.f=m f2c
+RHIDE_TYPED_LIBS.for=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.F=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS.fpp=$(RHIDE_TYPED_LIBS.f)
+RHIDE_TYPED_LIBS_GPC=m gpc
+RHIDE_TYPED_LIBS_FPC=fpc
+RHIDE_TYPED_LIBS.p=$(RHIDE_TYPED_LIBS_$(PASCAL_TYPE))
+RHIDE_TYPED_LIBS.pas=$(RHIDE_TYPED_LIBS.p)
+RHIDE_TYPED_LIBS.pp=$(RHIDE_TYPED_LIBS_FPC)
+RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
+RHIDE_TYPED_LIBS_Linux.cc=stdc++
+RHIDE_TYPED_LIBS.cc=$(RHIDE_TYPED_LIBS_$(RHIDE_OS).cc)
+RHIDE_TYPED_LIBS.cpp=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.cxx=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.C=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.ii=$(RHIDE_TYPED_LIBS.cc)
+RHIDE_TYPED_LIBS.l=fl
+RHIDE_TYPED_LIBS.m=objc
+RHIDE_TYPED_LIBS.adb=gnat
+RHIDE_TYPED_LIBS_SUFFIXES=$(sort $(foreach item,$(PROJECT_ITEMS),$(suffix\
+ $(item))))
+RHIDE_TYPED_LIBS=$(foreach\
+ suff,$(RHIDE_TYPED_LIBS_SUFFIXES),$(RHIDE_TYPED_LIBS$(suff)))
+RHIDE_INCLUDES=$(SPECIAL_CFLAGS) $(addprefix -I,$(INCLUDE_DIRS))
+RHIDE_LIBDIRS=$(addprefix -L,$(LIB_DIRS))
+RHIDE_LIBS=$(addprefix -l,$(LIBS) $(RHIDE_TYPED_LIBS) $(RHIDE_OS_LIBS))
+RHIDE_LDFLAGS=$(SPECIAL_LDFLAGS) $(addprefix -Xlinker ,$(LD_EXTRA_FLAGS))
+RHIDE_NASM_TARGET_DJGPP=coff
+RHIDE_NASM_TARGET_Linux=elf
+RHIDE_NASM_TARGET=$(RHIDE_NASM_TARGET_$(RHIDE_OS))
+RHIDE_COMPILE_NASM=$(RHIDE_NASM) -f $(RHIDE_NASM_TARGET) $(LOCAL_OPT) -o\
+ $(OUTFILE) $(SOURCE_NAME)
+RHIDE_COMPILE_FORTRAN=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_FORTRAN_FORCE=$(RHIDE_G77) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_F_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x f77 $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_C_FORCE=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ -x c $(LOCAL_OPT) $(CPPFLAGS) $(CFLAGS) $(RHIDE_OS_CFLAGS) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_CC_FORCE=$(RHIDE_GXX) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS)\
+ $(C_CXX_LANG_FLAGS) $(C_EXTRA_FLAGS) $(CPPFLAGS) $(CXXFLAGS)\
+ $(RHIDE_OS_CXXFLAGS) -x c++ $(LOCAL_OPT) -c $(SOURCE_NAME) -o\
+ $(OUTFILE)
+RHIDE_COMPILE_ASM=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_ASM_FORCE=$(RHIDE_AS) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_EXTRA_FLAGS) -x assembler\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_GPC_FLAGS=$(RHIDE_INCLUDES) $(C_DEBUG_FLAGS) $(C_OPT_FLAGS)\
+ $(C_WARN_FLAGS) $(C_P_LANG_FLAGS) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c\
+ $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_COMPILE_GPC_FORCE=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) -x pascal\
+ $(LOCAL_OPT) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_FPC_FLAGS=$(C_FPC_LANG_FLAGS) $(LOCAL_OPT) $(addprefix\
+ -Up,$(INCLUDE_DIRS)) $(C_EXTRA_FLAGS)
+RHIDE_COMPILE_FPC=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -E- $(SOURCE_NAME)
+RHIDE_COMPILE_FPC_FORCE=$(RHIDE_FPC) $(RHIDE_FPC_FLAGS) -B -E-\
+ $(SOURCE_NAME)
+RHIDE_COMPILE_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)\
+ -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS)\
+ $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o\
+ $(OUTFILE) --automake="$(strip $(RHIDE_GPC_FLAGS))"\
+ $(RHIDE_GPC_FLAGS) $(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS)\
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE_PASCAL=$(RHIDE_COMPILE_$(PASCAL_TYPE))
+RHIDE_COMPILE_PASCAL_FORCE=$(RHIDE_COMPILE_$(PASCAL_TYPE)_FORCE)
+RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE)_AUTOMAKE)
+RHIDE_COMPILE_LINK_PASCAL=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
+RHIDE_FPC_LIBDIRS_DJGPP=$(DJDIR)/lib
+RHIDE_FPC_LIBDIRS_Linux=/usr/local/lib /usr/lib /lib
+RHIDE_FPC_LIBDIRS=$(RHIDE_FPC_LIBDIRS_$(RHIDE_OS))
+RHIDE_FPC_LINK_FLAGS_DJGPP=-O coff-go32-exe $(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS_Linux=$(RHIDE_LIBDIRS) $(addprefix\
+ -L,$(RHIDE_FPC_LIBDIRS))
+RHIDE_FPC_LINK_FLAGS=$(RHIDE_FPC_LINK_FLAGS_$(RHIDE_OS))
+RHIDE_COMPILE_LINK_FPC=$(RHIDE_LD_FPC) -o $(OUTFILE) $(OBJFILES)\
+ $(RHIDE_FPC_LINK_FLAGS) $(LIBRARIES) $(RHIDE_LIBS)
+RHIDE_COMPILE_LINK_FPC_AUTOMAKE=$(RHIDE_FPC) -o$(OUTFILE) $(SOURCE_NAME)\
+ $(RHIDE_FPC_FLAGS) -E+
+RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE) $(OBJFILES)
+RHIDE_COMPILE_ADA=$(RHIDE_GCC) $(RHIDE_INCLUDES) $(C_DEBUG_FLAGS)\
+ $(C_OPT_FLAGS) $(C_WARN_FLAGS) $(C_C_LANG_FLAGS) $(C_EXTRA_FLAGS)\
+ $(LOCAL_OPT) $(C_ADA_LANG_FLAGS) $(CPPFLAGS) $(CFLAGS)\
+ $(RHIDE_OS_CFLAGS) -c $(SOURCE_NAME) -o $(OUTFILE)
+RHIDE_ADA_BIND_FILE=$(addprefix _,$(setsuffix .c,$(OUTFILE)))
+RHIDE_COMPILE_LINK_ADA_BIND=$(RHIDE_GNATBIND) -o $(RHIDE_ADA_BIND_FILE)\
+ $(setsuffix .ali,$(OUTFILE))
+RHIDE_COMPILE_LINK_ADA_LINK=$(RHIDE_LD) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(RHIDE_ADA_BIND_FILE) $(OBJFILES) $(LIBRARIES)\
+ $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+_RHIDE_COMPILE_LINK_ADA=$(RHIDE_COMPILE_LINK_ADA_BIND);\
+ $(RHIDE_COMPILE_LINK_ADA_LINK); $(RHIDE_RM)\
+ $(RHIDE_ADA_BIND_FILE)
+RHIDE_COMPILE_LINK_ADA=gnatbl $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS) -o\
+ $(OUTFILE) $(setsuffix .ali,$(OUTFILE)) $(LIBRARIES) $(LDFLAGS) \
+ $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
+RHIDE_COMPILE.c.o=$(RHIDE_COMPILE_C)
+RHIDE_COMPILE.cc.o=$(RHIDE_COMPILE_CC)
+RHIDE_COMPILE.p.o=$(RHIDE_COMPILE_PASCAL)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.pp.o=$(RHIDE_COMPILE_FPC)
+RHIDE_COMPILE.pas.s.GPC=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_GPC))
+RHIDE_COMPILE.pas.s.FPC=$(RHIDE_COMPILE_FPC) -a -s
+RHIDE_COMPILE.pas.s=$(RHIDE_COMPILE.pas.s.$(PASCAL_TYPE))
+RHIDE_COMPILE.f.o=$(RHIDE_COMPILE_FORTRAN)
+RHIDE_COMPILE.nsm.o=$(RHIDE_COMPILE_NASM)
+RHIDE_COMPILE.s.o=$(RHIDE_COMPILE_ASM)
+RHIDE_COMPILE.c.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.c.i=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_C))
+RHIDE_COMPILE.i.s=$(RHIDE_COMPILE.c.s)
+RHIDE_COMPILE.cc.s=$(subst -c $(SOURCE_NAME),-S\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.cc.ii=$(subst -c $(SOURCE_NAME),-E\
+ $(SOURCE_NAME),$(RHIDE_COMPILE_CC))
+RHIDE_COMPILE.ii.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.cxx.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.C.o=$(RHIDE_COMPILE.cc.o)
+RHIDE_COMPILE.pas.o=$(RHIDE_COMPILE.p.o)
+RHIDE_COMPILE.for.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.F.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.fpp.o=$(RHIDE_COMPILE.f.o)
+RHIDE_COMPILE.asm.o=$(RHIDE_COMPILE.nsm.o)
+RHIDE_COMPILE.cpp.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cxx.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.C.s=$(RHIDE_COMPILE.cc.s)
+RHIDE_COMPILE.cpp.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.cxx.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.C.ii=$(RHIDE_COMPILE.cc.ii)
+RHIDE_COMPILE.adb.o=$(RHIDE_COMPILE_ADA)
+RHIDE_FSDB=fsdb $(OUTFILE) $(addprefix -p ,$(SRC_DIRS)) $(PROG_ARGS)
+RHIDE_GDB=gdb $(OUTFILE) $(addprefix -d ,$(SRC_DIRS))
+DEFAULT_GREP_MASK=*.[cfhmnps]*
+RHIDE_GREP=grep -n $(prompt arguments for GREP,$(WUC) $(DEFAULT_GREP_MASK))
+RHIDE_GPROF=gprof $(OUTFILE)
+RHIDE_RLOG=$(shell rlog -R $(rlog_arg))
+RHIDE_CO=$(shell co -q $(co_arg))
+RHIDE_STANDARD_INCLUDES_DJGPP=$(addprefix $(DJDIR)/,include include/sys\
+ lang/cxx lang/cxx/std)
+RHIDE_STANDARD_INCLUDES_Linux=$(addprefix /usr/,include include/sys\
+ include/g++ include/g++/std)
+RHIDE_STANDARD_INCLUDES=$(RHIDE_STANDARD_INCLUDES_$(RHIDE_OS))
+RHIDE_CONFIG_DIRS_DJGPP=. $(RHIDE_SHARE) $(HOME) $(DJDIR)/share/rhide
+RHIDE_CONFIG_DIRS_Linux=. $(RHIDE_SHARE) $(HOME) /usr/local/share/rhide\
+ /usr/share/rhide /local/share/rhide /share/rhide
+RHIDE_CONFIG_DIRS=$(RHIDE_CONFIG_DIRS_$(RHIDE_OS))\
+ $(RHIDE_BIN_DIR)/../share/rhide
+RHIDE_PATH_SEPARATOR_DJGPP=;
+RHIDE_PATH_SEPARATOR_Linux=:
+RHIDE_PATH_SEPARATOR=$(RHIDE_PATH_SEPARATOR_$(RHIDE_OS))
+INCLUDE_DIRS=include
+LIB_DIRS=
+C_DEBUG_FLAGS=-g3 -gstabs+
+C_OPT_FLAGS=-O2 -fomit-frame-pointer -ffast-math
+C_WARN_FLAGS=-Wall
+C_C_LANG_FLAGS=
+C_CXX_LANG_FLAGS=
+C_P_LANG_FLAGS=
+C_FPC_LANG_FLAGS=
+C_F_LANG_FLAGS=
+C_ADA_LANG_FLAGS=
+LIBS=
+LD_EXTRA_FLAGS=
+C_EXTRA_FLAGS=
+LOCAL_OPT=$(subst ___~~~___, ,$(subst $(notdir $<)___,,$(filter $(notdir\
+ $<)___%,$(LOCAL_OPTIONS))))
+OBJFILES=obj/lissa.o obj/math1.o obj/math2.o obj/math4.o obj/mksurf1.o\
+ obj/mksurf2.o obj/movsurf1.o obj/movsurf2.o obj/palette.o\
+ obj/plasa1.o obj/plasa2.o obj/plasa2g.o obj/plasa3.o
+LIBRARIES=
+SOURCE_NAME=$<
+OUTFILE=$@
+SPECIAL_CFLAGS=
+SPECIAL_LDFLAGS=
+PROG_ARGS=
+SRC_DIRS=
+WUC=
+EDITORS=
+RHIDE_OS=$(RHIDE_OS_)
+ifeq ($(strip $(RHIDE_OS)),)
+ifneq ($(strip $(DJDIR)),)
+RHIDE_OS_:=DJGPP
+else
+RHIDE_OS_:=$(shell uname)
+endif
+endif
+
+MAIN_TARGET=libplasm.a
+PROJECT_ITEMS=lissa.c math1.c math2.c math4.c mksurf1.c mksurf2.c\
+ movsurf1.c movsurf2.c palette.c plasa1.c plasa2.c plasa2g.c\
+ plasa3.c
+DEFAULT_MASK=*.[acfghimnops]*
+RHIDE_BIN_DIR=e:/dj/bin
+PASCAL_TYPE=GPC
+%.o: %.c
+ $(RHIDE_COMPILE.c.o)
+%.o: %.i
+ $(RHIDE_COMPILE_C)
+%.o: %.cc
+ $(RHIDE_COMPILE.cc.o)
+%.o: %.cpp
+ $(RHIDE_COMPILE.cpp.o)
+%.o: %.cxx
+ $(RHIDE_COMPILE.cxx.o)
+%.o: %.C
+ $(RHIDE_COMPILE.C.o)
+%.o: %.ii
+ $(RHIDE_COMPILE_CC)
+%.o: %.s
+ $(RHIDE_COMPILE.s.o)
+%.o: %.S
+ $(RHIDE_COMPILE_ASM)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.s: %.i
+ $(RHIDE_COMPILE.i.s)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+%.o: %.pas
+ $(RHIDE_COMPILE.pas.o)
+%.o: %.p
+ $(RHIDE_COMPILE.p.o)
+%.o: %.pp
+ $(RHIDE_COMPILE.pp.o)
+%.s: %.pas
+ $(RHIDE_COMPILE.pas.s)
+%.o: %.m
+ $(RHIDE_COMPILE_OBJC)
+%.o: %.f
+ $(RHIDE_COMPILE.f.o)
+%.o: %.for
+ $(RHIDE_COMPILE.for.o)
+%.o: %.F
+ $(RHIDE_COMPILE.F.o)
+%.o: %.fpp
+ $(RHIDE_COMPILE.fpp.o)
+%.o: %.asm
+ $(RHIDE_COMPILE.asm.o)
+%.o: %.nsm
+ $(RHIDE_COMPILE.nsm.o)
+%.o: %.adb
+ $(RHIDE_COMPILE.adb.o)
+%.i: %.c
+ $(RHIDE_COMPILE.c.i)
+%.s: %.c
+ $(RHIDE_COMPILE.c.s)
+%.ii: %.cc
+ $(RHIDE_COMPILE.cc.ii)
+%.s: %.cc
+ $(RHIDE_COMPILE.cc.s)
+%.ii: %.cpp
+ $(RHIDE_COMPILE.cpp.ii)
+%.s: %.cpp
+ $(RHIDE_COMPILE.cpp.s)
+%.ii: %.cxx
+ $(RHIDE_COMPILE.cxx.ii)
+%.s: %.cxx
+ $(RHIDE_COMPILE.cxx.s)
+%.ii: %.C
+ $(RHIDE_COMPILE.C.ii)
+%.s: %.C
+ $(RHIDE_COMPILE.C.s)
+all::
+DEPS_0= obj/lissa.o obj/math1.o obj/math2.o obj/math4.o obj/mksurf1.o\
+ obj/mksurf2.o obj/movsurf1.o obj/movsurf2.o obj/palette.o\
+ obj/plasa1.o obj/plasa2.o obj/plasa2g.o obj/plasa3.o
+NO_LINK=
+LINK_FILES=$(filter-out $(NO_LINK),$(DEPS_0))
+libplasm.a:: $(DEPS_0)
+ $(RHIDE_COMPILE_ARCHIVE)
+DEPS_1=lissa.c include/lissa.h include/math1.h
+obj/lissa.o:: $(DEPS_1)
+ $(RHIDE_COMPILE.c.o)
+DEPS_2=math1.c include/math1.h
+obj/math1.o:: $(DEPS_2)
+ $(RHIDE_COMPILE.c.o)
+DEPS_3=math2.c include/math2.h
+obj/math2.o:: $(DEPS_3)
+ $(RHIDE_COMPILE.c.o)
+DEPS_4=math4.c include/math4.h
+obj/math4.o:: $(DEPS_4)
+ $(RHIDE_COMPILE.c.o)
+DEPS_5=mksurf1.c
+obj/mksurf1.o:: $(DEPS_5)
+ $(RHIDE_COMPILE.c.o)
+DEPS_6=mksurf2.c include/math1.h
+obj/mksurf2.o:: $(DEPS_6)
+ $(RHIDE_COMPILE.c.o)
+DEPS_7=movsurf1.c include/math4.h include/mixsurf.h include/movsurf1.h
+obj/movsurf1.o:: $(DEPS_7)
+ $(RHIDE_COMPILE.c.o)
+DEPS_8=movsurf2.c include/mixsurf.h include/movsurf2.h
+obj/movsurf2.o:: $(DEPS_8)
+ $(RHIDE_COMPILE.c.o)
+DEPS_9=palette.c include/math1.h include/palette.h
+obj/palette.o:: $(DEPS_9)
+ $(RHIDE_COMPILE.c.o)
+DEPS_10=plasa1.c include/math1.h include/palette.h include/plasa1.h
+obj/plasa1.o:: $(DEPS_10)
+ $(RHIDE_COMPILE.c.o)
+DEPS_11=plasa2.c include/math1.h
+obj/plasa2.o:: $(DEPS_11)
+ $(RHIDE_COMPILE.c.o)
+DEPS_12=plasa2g.c include/math1.h include/math4.h include/mixsurf.h\
+ include/mksurf.h include/movsurf1.h
+obj/plasa2g.o:: $(DEPS_12)
+ $(RHIDE_COMPILE.c.o)
+DEPS_13=plasa3.c include/lissa.h include/math1.h include/mixsurf.h\
+ include/mksurf.h include/movsurf2.h include/palette.h
+obj/plasa3.o:: $(DEPS_13)
+ $(RHIDE_COMPILE.c.o)
+all:: libplasm.a
diff --git a/setedit/scrnsave/readme.txt b/setedit/scrnsave/readme.txt
new file mode 100644
index 0000000..079544a
--- /dev/null
+++ b/setedit/scrnsave/readme.txt
@@ -0,0 +1,15 @@
+ This directory contains instruction on how to create an external screen saver
+(read the how-to.txt file) and some DOS examples.
+ This feature isn't tested under Linux.
+ The idea was introduced in 0.4.34 suggested by "Grzegorz Adam Hankiewicz"
+<gah@jet.es>.
+ All the files here are distributed under the GPL license as the rest of the
+editor.
+ The directory plasmlib contains a reduced version of my plasma library, it
+have various interesting routines. The code is optimized for Cyrix 5x86 and
+gcc 2.7.2, I didn't have time to tune it for Pentium or other gcc versions.
+ The directory fakealle contains some routines that are called like the
+Allegro library function but that just works for 320x200 video modes. I used
+it to make the screen savers really small (35 to 40Kb compressed with UPX)
+but the code was original written for Allegro 3.
+
diff --git a/setedit/sdg/bufun2.cc b/setedit/sdg/bufun2.cc
new file mode 100644
index 0000000..de0893e
--- /dev/null
+++ b/setedit/sdg/bufun2.cc
@@ -0,0 +1,370 @@
+/****************************************************************************
+
+ Busca Funciones(BuFun), Copyright (c) 1996-2007 by Salvador E. Tropea (SET)
+
+ int SelectFunctionToJump(char *b, unsigned l)
+
+ Is the external entry point, this routine calls to one routine that parses
+the C source searching for functions, the methode is heuristic and don't
+detect all the possible cases, in particular the K & R edition I style of
+functions (totally obsolet).
+ The routine creates a StringCollection with the functions found and then
+creates a dialog box to select one. If the user select a function the
+routine returns the line where the function starts if there are no functions
+or the user choose cancel the routine returns -1.
+ The parameters passed to the routine are:
+ char *b: The buffer where the routines will search.
+ unsigned l: The length of the buffer.
+
+ Defining the label TEST you can test the module as an standalone program.
+
+****************************************************************************/
+
+// That's the first include because is used to configure the editor.
+#include <stdio.h>
+#include <ctype.h>
+#define Uses_string
+#include "ucdefs.h"
+
+#define Uses_SOStack
+#define Uses_TNoCaseSOSStringCollection
+#define Uses_TSOSSortedListBox
+#define Uses_TVCodePage
+#include <settvuti.h>
+
+inline int IsWordChar(char c)
+{
+ return c=='_' || TVCodePage::isAlpha(c);
+}
+
+static char Buffer[256];
+static char NomFun[256];
+static char Alone;
+static int Used,UsedNom;
+static int Line,LineFun;
+
+static char *buffer;
+static unsigned IndexB;
+static unsigned BufLen;
+
+static int TakeWord(int TakeOneCharToo=0);
+
+
+static char GetAChar()
+{
+ if (IndexB>=BufLen)
+ return EOF;
+ char c=buffer[IndexB++];
+ if (c=='\n')
+ Line++;
+ return c;
+}
+
+static void UnGetAChar(char c)
+{
+ IndexB--;
+ if (c=='\n')
+ Line--;
+}
+
+
+static stkHandler StrDup(char *s,int line,int len,SOStack &stk)
+{
+ stkHandler h=stk.alloc(len+sizeof(int));
+ char *d=stk.GetStrOf(h);
+ strcpy(d,s);
+ int *l=(int *)&d[len];
+ *l=line;
+ return h;
+}
+
+static int TakeWord(int TakeOneCharToo)
+{
+ char c;
+ char last;
+
+ do
+ {
+ c=GetAChar();
+ if (IsWordChar(c))
+ {
+ Used=0;
+ do
+ {
+ Buffer[Used++]=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && Used<255 && (TVCodePage::isAlNum(c) || c==':' || c=='_' || c=='~'));
+ Buffer[Used]=0;
+ if (c!=EOF)
+ UnGetAChar(c);
+ if (Used==0)
+ return 0;
+ return 1;
+ }
+ else
+ if (ucisspace(c))
+ {
+ do
+ {
+ c=GetAChar();
+ }
+ while (c!=EOF && ucisspace(c));
+ UnGetAChar(c);
+ }
+ else
+ {
+ switch (c)
+ {
+ case '\"':
+ do
+ {
+ c=GetAChar();
+ if (c=='\\')
+ {
+ c=GetAChar();
+ c=GetAChar();
+ }
+ }
+ while (c!=EOF && c!='\"');
+ break;
+
+ case '\'':
+ do
+ {
+ c=GetAChar();
+ if (c=='\\')
+ {
+ c=GetAChar();
+ c=GetAChar();
+ }
+ }
+ while (c!=EOF && c!='\'');
+ break;
+
+ case '/':
+ c=GetAChar();
+ if (c=='/')
+ {
+ do
+ {
+ do
+ {
+ last=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && c!='\n' && c!='\r');
+ if (c=='\r') c=GetAChar();
+ }
+ while (last=='\\');
+ }
+ else
+ if (c=='*')
+ {
+ do
+ {
+ c=GetAChar();
+ if (c=='*')
+ {
+ c=GetAChar();
+ if (c=='/')
+ break;
+ UnGetAChar(c);
+ }
+ }
+ while (c!=EOF);
+ }
+ break;
+
+ case '#':
+ do
+ {
+ do
+ {
+ last=c;
+ c=GetAChar();
+ }
+ while (c!=EOF && c!='\n' && c!='\r');
+ if (c=='\r') c=GetAChar();
+ }
+ while (last=='\\');
+ break;
+
+
+ default:
+ // Is a single char
+ if (TakeOneCharToo)
+ {
+ Alone=c;
+ return 2;
+ }
+ }
+ }
+ }
+ while (c!=EOF);
+
+ return 0;
+}
+
+
+static int SearchBalance(char ref, char ref2)
+{
+ int r,bal=1;
+
+ do
+ {
+ r=TakeWord(1);
+ if (r==2)
+ {
+ if (Alone==ref)
+ bal--;
+ else
+ if (Alone==ref2) bal++;
+ }
+ if (!bal) break;
+ }
+ while (r);
+
+ return r;
+}
+
+static int SearchBalanceCopy(char ref, char ref2)
+{
+ int r,bal=1;
+
+ if (Used<255)
+ NomFun[Used++]=ref2;
+ UsedNom=Used;
+ do
+ {
+ r=TakeWord(1);
+ if (r==2)
+ {
+ if (Alone==ref)
+ bal--;
+ else
+ if (Alone==ref2) bal++;
+ if (UsedNom<255)
+ {
+ if (Alone==')' && NomFun[UsedNom-1]==' ')
+ NomFun[UsedNom-1]=Alone;
+ else
+ if (Alone==',' && NomFun[UsedNom-1]==' ')
+ {
+ NomFun[UsedNom-1]=Alone;
+ NomFun[UsedNom++]=' ';
+ }
+ else
+ NomFun[UsedNom++]=Alone;
+ }
+ }
+ else
+ if (r==1)
+ {
+ if (UsedNom+Used<254)
+ {
+ strcpy(&NomFun[UsedNom],Buffer);
+ UsedNom+=Used;
+ NomFun[UsedNom++]=' ';
+ }
+ }
+ if (!bal) break;
+ }
+ while (r);
+ NomFun[UsedNom++]=0;
+
+ return r;
+}
+
+
+static int SearchFuncs(TNoCaseSOSStringCollection *FunList,SOStack &stk,
+ unsigned )
+{
+ int funs=0;
+
+ Line=1;
+ int r;
+ do
+ {
+ r=TakeWord();
+ if (!r) break;
+ do
+ {
+ r=TakeWord(1);
+ }
+ while(r==1);
+ if (!r) break;
+ if (Alone=='(')
+ {
+ strcpy(NomFun,Buffer);
+ LineFun=Line;
+ r=SearchBalanceCopy(')','(');
+ if (!r) break;
+ r=TakeWord(1);
+ if (!r) break;
+
+ int SearchOpen=0;
+ int Eureka=0;
+ if (r==2)
+ {
+ if (Alone=='{')
+ Eureka=1;
+ else
+ if (Alone==':')
+ SearchOpen=Eureka=1;
+ }
+ else
+ {
+ if (strcmp(Buffer,"const")==0)
+ SearchOpen=Eureka=1;
+ }
+ if (Eureka)
+ {
+#ifdef TEST
+ printf("Function: %s, Line %d\n",NomFun,LineFun);
+#endif
+ stkHandler s=StrDup(NomFun,LineFun,UsedNom,stk);
+ FunList->insert(s);
+ funs++;
+ if (SearchOpen)
+ {
+ do
+ {
+ r=TakeWord(1);
+ if (r==2 && Alone=='{') break;
+ }
+ while (r);
+ if (!r) break;
+ }
+ r=SearchBalance('}','{');
+ if (!r) break;
+ }
+ }
+ }
+ while(r);
+
+ return funs;
+}
+
+int CreateFunctionList(char *b, unsigned l, SOStack &stk,
+ TNoCaseSOSStringCollection *FunList, unsigned ops=0,
+ const char *p=NULL);
+
+int CreateFunctionList(char *b, unsigned l, SOStack &stk,
+ TNoCaseSOSStringCollection *FunList, unsigned ops,
+ const char *p)
+{
+ buffer=b;
+ IndexB=0;
+ BufLen=l;
+
+ int funcs=SearchFuncs(FunList,stk,ops);
+
+ if (!funcs)
+ {
+ printf("Hmmm ... I can't find any function, are you sure?");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/setedit/sdg/edspecs2.cc b/setedit/sdg/edspecs2.cc
new file mode 100644
index 0000000..ddac7da
--- /dev/null
+++ b/setedit/sdg/edspecs2.cc
@@ -0,0 +1,129 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* This file is an adaptation of idespecs.cc from Robert Hoehne to make the editor */
+/* more coherent with RHIDE and more easy to configure (?) */
+
+#define Uses_string
+#include <stdlib.h>
+#include <dir.h>
+#include <stdio.h>
+#include <compatlayer.h>
+#ifndef TVComp_BCPP
+extern char **environ;
+#endif
+
+static char *default_variables[] =
+{
+#if defined(TVCompf_djgpp) || defined(TVComp_BCPP)
+ // In DOS is common to have C:
+ "SET_FILES",
+ "c:/etc",
+#else
+ // For UNIX the right place to put these files is the etc dir
+ "SET_FILES",
+ "/etc",
+#endif
+
+ 0,
+ 0
+};
+
+static char **vars;
+static int var_count = 0;
+
+/**[txh]**********************************************************************
+
+ Function: add_variable
+ Module: Editor Specs
+ Include: edspecs.h
+ Prototype: void add_variable(char *variable,char *contents)
+ Description:
+ Adds a variable to the variables list.
+
+*****************************************************************************/
+
+static
+void add_variable(char *variable,char *contents)
+{
+ var_count++;
+ vars = (char **)realloc(vars,var_count*2*sizeof(char *));
+ vars[var_count*2-2]=strdup(variable);
+ vars[var_count*2-1]=strdup(contents);
+}
+
+static
+void insert_variable(char *variable,char *contents)
+{
+ int i;
+ for (i=0;i<var_count;i++)
+ {
+ if (strcmp(vars[i*2],variable) == 0)
+ {
+ free(vars[2*i+1]);
+ vars[2*i+1]=strdup(contents);
+ return;
+ }
+ }
+ add_variable(variable,contents);
+}
+
+/**[txh]**********************************************************************
+
+ Function: GetVariable
+ Prototype: GetVariable(const char *variable)
+ Description:
+ Gets the contents of a variable.
+
+ Return: a pointer to the variable contents.
+
+*****************************************************************************/
+
+//static
+const char * GetVariable(const char *variable)
+{
+ int i;
+ for (i=0;i<var_count;i++)
+ {
+ if (strcmp(variable,vars[i*2]) == 0)
+ return vars[i*2+1];
+ }
+ return getenv(variable);
+}
+
+// The following function is defined as a structure initializer to be called
+// as a constructor by BC++, but it gives a warning about the fact that even
+// when declared inline won't be inlined. The following pragma disables it.
+#pragma option push -w-inl
+
+struct init_edspecs_t
+{
+init_edspecs_t()
+{
+ char *variable,*contents;
+ int i=0;
+ while (default_variables[i])
+ {
+ variable = default_variables[i];
+ contents = getenv(variable);
+ if (!contents) contents = default_variables[i+1];
+ add_variable(variable,contents);
+ i += 2;
+ }
+ // Now check the env for any SET_ variable
+ for (i=0;environ[i];i++)
+ {
+ if (strncmp(environ[i],"SET_",6) == 0)
+ {
+ contents = strchr(environ[i],'=');
+ if (!contents) continue;
+ contents++;
+ char var[256];
+ memcpy(var,environ[i],(int)(contents-environ[i])-1);
+ var[(int)(contents-environ[i])-1] = 0;
+ insert_variable(var,contents);
+ }
+ }
+}
+} init_edspecs;
+
+#pragma option pop
diff --git a/setedit/sdg/gettext.c b/setedit/sdg/gettext.c
new file mode 100644
index 0000000..355d37d
--- /dev/null
+++ b/setedit/sdg/gettext.c
@@ -0,0 +1,3 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+char *gettext__(char *s) {return s;};
diff --git a/setedit/sdg/html.frt b/setedit/sdg/html.frt
new file mode 100644
index 0000000..7899af4
--- /dev/null
+++ b/setedit/sdg/html.frt
@@ -0,0 +1,266 @@
+#
+# This file sets the behavior of the txh generator
+#
+# Lines starting with # or spaces are skiped except in strings or in [Generate]
+# Be carefull with [ it delimits sections!
+#
+
+[Configuration]
+#
+# No external program is needed!
+# @.html means: Copy the temporal file to xxxxx.html
+#
+CommandLine=@.html
+Name="Direct HTML 3.X format"
+
+[Delimiters]
+# Up to 11 characters
+SectionStart=/**[txh]**
+# Up to 11 characters
+SectionEnd=*********/
+
+[Variables]
+#
+# Up to 16 definitions
+#
+# Codes for the behavior of the definitions:
+# 1 Normal, put the content if found.
+# 2 Repeat, use the last value found in the file, ~no is an exeption, ~clear stops
+# 3 If not found replace by the prototype.
+# 4 If not found replace by the class.
+# 5 If not found replace by the name of the function
+# 6 It disables the node generation for this comment. The variable is
+# stored in the first variable that have associations and is in the comment.
+#
+# Additionally there are 2 special variables:
+# 90 Name of the file
+# 91 Line number of the end of the comment
+# 92 Name of the var 0 in the format: ~0 ~~Distinguish{(~Distinguish)~} (node name)
+#
+# 0 The first variable is the main index variable
+#
+AddDefinition=Function,5
+# 1
+AddDefinition=Class,4
+# 2
+AddDefinition=Include,2
+# 3
+AddDefinition=Module,2
+# 4
+AddDefinition=Prototype,3
+# 5
+AddDefinition=Description,1
+# 6
+AddDefinition=Return,1
+# 7
+AddDefinition=Example,1
+# 8
+AddDefinition=Comments,6
+#
+# It says what variable is added to distinguish between 2 vars 0 that are equal
+#
+Distinguish=1
+
+[Associations]
+#
+# Up to 8 associations
+#
+# The associations are between the 0 variable and another variable.
+#
+# Name in main menu, node, variable, optional to add to each node
+#
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+
+[Replace]
+#
+# All must be delimited by ", they can be used in the GenMain section
+#
+# Title of the HTML
+Constant="My documentation"
+
+# Description for the help
+Constant="This document describes the functions of my library
+@p
+This document applies to version 0.0.1
+of the program named A Real World
+@p"
+
+[Commands]
+#
+# You can enclose these values between " to make more clear where
+# they start and end. Use \n,\r,\t and \" like in C. Use \ at the
+# end to concatenate like in C.
+#
+# @p = end of paragraph
+#
+EndOfPar="<p>"
+#
+# @* = break line
+#
+BreakLine="<br>"
+#
+# @{value} is the special cross ref.
+# ~0 Is the visible name of a reference
+# ~1 Is the real name of a reference
+#
+CrossRef="<a href=\"#~1\">~0</a>"
+#
+# What we must get from a @@ sequence
+#
+Double@="@"
+
+[DefinedCommands]
+#
+# The format is @<name>{parameters ...}
+#
+subtitle="<Font Size=+1><u>~0</u></Font><p>"
+pre=<pre>
+/pre=</pre>
+link="<a href=\"~0\">~1</a>"
+mailto="<a href=\"mailto:~0\">~1</a>"
+
+#
+# This section says how to translate ASCIIs
+#
+[ASCIIConvert]
+=&aacute;
+=&eacute;
+=&iacute;
+=&oacute;
+=&uacute;
+=&ntilde;
+=&Ntilde;
+=&iexcl;
+=&iquest;
+=&auml;
+=&euml;
+=&iuml;
+=&ouml;
+=&uuml;
+=&Uuml;
+=&agrave;
+=&egrave;
+=&igrave;
+=&ograve;
+=&ugrave;
+<=&lt;
+>=&gt;
+
+#
+# Use ~number to use one variable
+# Use ~~number{} for conditional, all the code inside {} will become
+# conditional
+# This section isn't passed for the macro expansion so here you are
+# free to use special commands for the formater.
+#
+[GenNode]
+<p><hr></p>
+<a name="~92"></a>
+<center><Font Size=+2>~0</Font> (~90 ~91)</center>
+
+<Font Size=+1><u>Syntax</u></Font><p>
+
+~~2{
+<pre>
+# This line is a comment, but the next is code
+ #include &lt;~2&gt;
+</pre>
+~}
+~~4{
+<pre>
+ ~4;
+</pre>
+~}
+~~1{
+<Font Size=+1><u>Member of the class:</u></Font>
+~1
+<p>
+~}
+
+~~5{
+<Font Size=+1><u>Description</u></Font><p>
+
+~5
+<p>
+~}
+~~6{
+<Font Size=+1><u>Return Value</u></Font><p>
+
+~6
+<p>
+~}
+~~7{
+<Font Size=+1><u>Example</u></Font><p>
+
+~7
+<p>
+~}
+
+[GenMenu]
+Start="<Menu>"
+#
+# ~1 is the visible name
+# ~2 is the name of the node
+#
+Entry="<li><a href=\"#~2\">~1</a>"
+End="</Menu>"
+
+#
+# ~1 is the name of the association
+# ~2 is the menu for it
+#
+[GenAssoMain]
+<p><hr></p>
+<a name="~1"></a>
+<H1>~1</H1>
+
+~2
+#
+# ~1 is the name of the association
+# ~2 is the name without the distinguish
+# ~3 is the comment for it
+# ~4 is the menu for it
+#
+[GenAssoRest]
+<p><hr></p>
+<a name="~1"></a>
+<H1>~2</H1>
+
+~3
+
+~4
+
+#
+# ~1 Main menu
+# ~2 Name of the function list node
+# ~3 Menu for all the functions
+# ~4 All the associations code
+# ~5 All the function nodes
+# ~50+ Values from section Replace
+#
+[GenMain]
+<html>
+<head>
+<title>~50</title>
+</head>
+<body>
+<H1>~50</H1>
+
+~51
+
+~1
+
+<p><hr></p>
+<a name="~2"></a>
+<H1>~2</H1>
+
+~3
+
+~4
+
+~5
+
+</body>
+</html>
diff --git a/setedit/sdg/include/mli.h b/setedit/sdg/include/mli.h
new file mode 100644
index 0000000..6589359
--- /dev/null
+++ b/setedit/sdg/include/mli.h
@@ -0,0 +1,119 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+#ifdef Uses_TLispSDGstring
+#define INCL_MLISDG_H
+#define Uses_MLI_stdio
+#define Uses_TMLISDGDefs
+#define Uses_TLispVar
+#define Uses_TLispVarDefs
+#endif
+
+#ifdef Uses_TMLISDG
+#define INCL_MLICSDG_H
+#define Uses_TMLISDGDefs
+#define Uses_TMLIBase
+#endif
+
+#ifdef Uses_TMLIEditor
+#define INCL_MLIEDITO_H
+#define Uses_TLispVarDefs
+#define Uses_TMLIEditorDefs
+#define Uses_TMLIBase
+#endif
+
+#ifdef Uses_TMLISDGDefs
+#define Uses_stdio
+#define Uses_MLI_stdio
+#define INCL_MLISDGI_H
+#endif
+
+#ifdef Uses_TMLIEditorDefs
+#define INCL_MLIEDITD_H
+#endif
+
+#ifdef Uses_TMLIArraySimple
+#define INCL_MLIASIMP_H
+#define Uses_TMLIArrayBase
+#endif
+
+#ifdef Uses_TMLIArrayBase
+#define INCL_MLIABASE_H
+#endif
+
+#ifdef Uses_TMLIBase
+#define INCL_MLIBASE_H
+#define Uses_TLispVar
+#define Uses_TLispVarDefs
+#define Uses_TLispVariableCol
+#endif
+
+#ifdef Uses_TLispVariableCol
+#define INCL_TV_H
+#define Uses_TLispVar
+#define Uses_TNSSortedCollection
+#endif
+
+#ifdef Uses_TLispBaseVars
+#define Uses_MLI_stdio
+#define Uses_TLispVar
+#define Uses_TLispVarDefs
+#endif
+
+#ifdef Uses_TLispVar
+#define Uses_MLI_stdio
+#define INCL_MLIVAR_H
+#endif
+
+#ifdef Uses_TLispVarDefs
+#define INCL_MLIVAR_H
+#endif
+
+#ifdef Uses_MLI_stdio
+ #ifdef INCL_TV_H
+ #define Uses_stdio
+ #else
+ #include <stdio.h>
+ #endif
+#endif
+
+#ifdef INCL_TV_H
+#include <tv.h>
+#endif
+
+#ifdef INCL_MLIVAR_H
+#include "mlivar.h"
+#endif
+
+#ifdef INCL_MLIABASE_H
+#include "mliabase.h"
+#endif
+
+#ifdef INCL_MLIBASE_H
+#include "mlibase.h"
+#endif
+
+#ifdef INCL_MLIASIMP_H
+#include "mliasimp.h"
+#endif
+
+#ifdef INCL_MLISDG_H
+#include "mlisdg.h"
+#endif
+
+#ifdef INCL_MLISDGI_H
+#include "mlisdgi.h"
+#endif
+
+#ifdef INCL_MLIEDITD_H
+#include "mlieditd.h"
+#endif
+
+#ifdef INCL_MLICSDG_H
+#include "mlicsdg.h"
+#endif
+
+#ifdef INCL_MLIEDITO_H
+#include "mliedito.h"
+#endif
+
diff --git a/setedit/sdg/include/mliabase.h b/setedit/sdg/include/mliabase.h
new file mode 100644
index 0000000..78a1806
--- /dev/null
+++ b/setedit/sdg/include/mliabase.h
@@ -0,0 +1,20 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLIArrayBase) && !defined(__TMLIArrayBase__)
+#define __TMLIArrayBase__
+class TLispVar;
+
+class TMLIArrayBase
+{
+public:
+ TMLIArrayBase() {firstfree=0;};
+ virtual ~TMLIArrayBase() {};
+ virtual void Push(TLispVar *) = 0;
+ virtual TLispVar *Get(int ) = 0;
+ virtual TLispVar *FreeItems(int ) = 0;
+ virtual void ReplaceItem(int , TLispVar *) = 0;
+ int GetCount() { return firstfree;};
+
+ int firstfree;
+};
+#endif
diff --git a/setedit/sdg/include/mliasimp.h b/setedit/sdg/include/mliasimp.h
new file mode 100644
index 0000000..2b851a7
--- /dev/null
+++ b/setedit/sdg/include/mliasimp.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLIArraySimple) && !defined(__TMLIArraySimple__)
+#define __TMLIArraySimple__
+
+class TMLIArraySimple : public TMLIArrayBase
+{
+public:
+ TMLIArraySimple(int start, int delt);
+ virtual ~TMLIArraySimple();
+ virtual void Push(TLispVar *v);
+ virtual TLispVar *Get(int pos);
+ virtual TLispVar *FreeItems(int cant);
+ virtual void ReplaceItem(int pos, TLispVar *o);
+
+private:
+ int size;
+ int delta;
+ int nextsize;
+ TLispVar **array;
+};
+#endif
diff --git a/setedit/sdg/include/mlibase.h b/setedit/sdg/include/mlibase.h
new file mode 100644
index 0000000..f36aee0
--- /dev/null
+++ b/setedit/sdg/include/mlibase.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLIBase) && !defined(__TMLIBase__)
+#define __TMLIBase__
+const int MLIBaseCommands=25;
+const int MLIBaseConstants=1;
+const int MLIBaseSymbols=10;
+
+class TMLIBase
+{
+public:
+ TMLIBase(TMLIArrayBase *a, TLispVariableCol *v, FILE *out);
+ virtual ~TMLIBase();
+ TLispVar *Interpret(char *);
+ int ParseString(char s);
+ int ParseNumber();
+ int ParseVarOrCommand(int &Params,int &Commands);
+ virtual int ParseSymbol(int &Params,int &Commands);
+ virtual int MLIBooleanValOf(TLispVar *var);
+ virtual Command WhatCommand(char *s);
+ virtual Command WhatSymbol(char *s);
+ virtual TLispVar *WhatConstant(char *s);
+ char *SkipCode();
+ static char *SkipCode(char *&code, int &error);
+ TLispVar *Solve(int i);
+ virtual char *GetTypeError();
+ virtual char *GetError();
+ char *GetCodeError();
+ void AddVariable(char *name, TLispVar *Value);
+ int DuplicateVar(TLispVar *&aux,TLispVar *Value);
+ TLispVar *SearchVar(char *name);
+
+ int Error;
+ TMLIArrayBase *array;
+ TLispVariableCol *Vars;
+ char *EndCode;
+ char *Code;
+ Boolean ExitLoop; // Used to indicate we found an exitloop sentence
+
+private:
+ char *CopyCodeError();
+ TLispVar *InterpretNoClean(char *s);
+
+ FILE *fileOut;
+ static char *cNames[MLIBaseCommands];
+ static Command cComms[MLIBaseCommands];
+ static char *sNames[MLIBaseSymbols];
+ static Command sComms[MLIBaseSymbols];
+ static char *TypeError[];
+ static char *ParseError[];
+ static char *SyntaxError[];
+ static char *cNamesConst[MLIBaseConstants];
+ static TLispVar *cConstants[MLIBaseConstants];
+ char ErrorReported;
+ char *StartCode;
+
+ friend void MLIBasePrint(TMLIBase *o,int start ,int cant);
+};
+
+void MLIRetNULL(TMLIBase *o,int stkPos);
+void MLIRetObj(TMLIBase *o,int stkPos,TLispVar *v);
+void MLIRetString(TMLIBase *o,int stkPos,char *str);
+#define MLIRetInt(val) \
+ o->array->ReplaceItem(start-1,new TLispInteger(val));
+#define MLIRetStrLen(str,len) \
+ o->array->ReplaceItem(start-1,new TLispString(str,len))
+#define MLIRetStrLenExists(str,len) \
+ o->array->ReplaceItem(start-1,new TLispString(str,len,StrAlreadyAllocated))
+#define MLIRetObj(v) \
+ do { \
+ if (v) v->type|=1; \
+ o->array->ReplaceItem(start-1,v); \
+ } while(0)
+#define MLIRetNULL() \
+ o->array->ReplaceItem(start-1,NULL)
+#define MLIRetString(str) \
+ o->array->ReplaceItem(start-1,new TLispString(str));
+
+#define GetString(pos,obj) \
+{ obj=(TLispString *)o->Solve(start+pos); \
+ if(!obj) goto CleanUp; \
+ if ((obj->type>>12)!=MLIGString) \
+ { o->Error=MLITypeParam; goto CleanUp; } \
+}
+#define GetInteger(pos,obj) \
+{ obj=(TLispInteger *)o->Solve(start+pos); \
+ if(!obj) goto CleanUp; \
+ if ((obj->type>>12)!=MLIGInteger) \
+ { o->Error=MLITypeParam; goto CleanUp; } \
+}
+#define GetVar(pos,obj) \
+{ obj=o->Solve(start+pos); if(!obj) goto CleanUp;}
+#define GetIntegerOp(pos,obj,ops,dest) \
+{ if (pos>=cant) \
+ { dest=ops; } \
+ else \
+ { obj=(TLispInteger *)o->Solve(start+pos); \
+ if(!obj) goto CleanUp; \
+ if ((obj->type>>12)!=MLIGInteger) \
+ { o->Error=MLITypeParam; goto CleanUp; } \
+ dest=obj->val; } }
+#define GetCode(pos,obj) \
+{ obj=(TLispCode *)(o->array->Get(start+pos)); \
+ if(!obj) goto CleanUp; \
+ if ((obj->type>>12)!=MLIGCode) \
+ { o->Error=MLITypeParam; goto CleanUp; } \
+}
+#define CheckNumParams(cond) \
+{ if (cond) \
+ { o->Error=MLINumParam; \
+ MLIRetNULL(); \
+ return; } }
+#define CheckForError(cond,error) \
+{ if (cond) \
+ { o->Error=error; \
+ MLIRetNULL(); \
+ goto CleanUp; } }
+
+#define MLIAsInt(var) ((TLispInteger *)var)
+#define MLIAsStr(var) ((TLispString *)var)
+#define MLIAsIntVal(var) (((TLispInteger *)var)->val)
+#define MLIAsStrVal(var) (((TLispString *)var)->str)
+
+#define DecFun(a) void a(TMLIBase *o,int start ,int cant)
+#define LocVarStr(a) TLispString *a=NULL
+#define LocVarInt(a) TLispInteger *a=NULL
+#define LocVarCode(a) TLispCode *a=NULL
+#define LocVar(a) TLispVar *a=NULL
+
+#endif
diff --git a/setedit/sdg/include/mlicsdg.h b/setedit/sdg/include/mlicsdg.h
new file mode 100644
index 0000000..d62af07
--- /dev/null
+++ b/setedit/sdg/include/mlicsdg.h
@@ -0,0 +1,21 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLISDG) && !defined(__TMLISDG__)
+#define __TMLISDG__
+const int MLISDGCommands=1;
+
+class TMLISDG : public TMLIBase
+{
+public:
+ TMLISDG(TMLIArrayBase *a, TLispVariableCol *v, FILE *f) : TMLIBase(a,v,f) {};
+ void SetGetVar(getVarFunction gv) { getVar=gv; };
+ virtual int ParseSymbol(int &Params,int &Commands);
+ virtual int MLIBooleanValOf(TLispVar *var);
+ virtual Command WhatCommand(char *s);
+
+private:
+ static char *cNames[MLISDGCommands];
+ static Command cComms[MLISDGCommands];
+ getVarFunction getVar;
+};
+#endif
diff --git a/setedit/sdg/include/mlieditd.h b/setedit/sdg/include/mlieditd.h
new file mode 100644
index 0000000..75badf4
--- /dev/null
+++ b/setedit/sdg/include/mlieditd.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLIEditorDefs) && !defined(__TMLIEditorDefs__)
+#define __TMLIEditorDefs__
+class TNoCaseStringCollection;
+
+extern int InitLispEditor(void);
+extern void DeInitLispEditor(void);
+extern char *InterpretLispEditor(char *s, Boolean print=False);
+extern int ChooseAndRunLispEditor(void);
+extern int InterpretLispEditorFile(char *s);
+extern int ReRunLastChooseLispEditor(void);
+extern int MLIEdSeachAndRunCom(char *name, Boolean verbose);
+extern TNoCaseStringCollection *GetMacrosList(void);
+extern int MLIEdIsolateCode(char *start, char *&end);
+
+// Definitions for move
+#define SLP_MOVE_CURSOR -1
+#define SLP_DONT_MOVE_CURSOR 0
+#define SLP_DEFAULT_MOVE 1
+
+// Definitions for choose & run
+#define SLP_ERROR 0
+#define SLP_NO_MACROS 1
+#define SLP_OK 2
+#define SLP_NO_CHOOSE 3
+#define SLP_NO_INIT 4
+
+extern int MLIEditorError;
+extern char *MLIEditorTypeError;
+extern char *MLIEditorErrorName;
+extern char *MLIEditorErrorCode;
+#endif
diff --git a/setedit/sdg/include/mliedito.h b/setedit/sdg/include/mliedito.h
new file mode 100644
index 0000000..246321c
--- /dev/null
+++ b/setedit/sdg/include/mliedito.h
@@ -0,0 +1,112 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLIEditor) && !defined(__TMLIEditor__)
+#define __TMLIEditor__
+const int MLIEditorCommands=39;
+class TNoCaseStringCollection;
+class TCEditor;
+
+typedef struct
+{
+ char Name[32];
+ char *start;
+} MLIMacro;
+
+class TMacrosColl : public TNoCaseStringCollection
+{
+public:
+ TMacrosColl() : TNoCaseStringCollection(10,10) {};
+ virtual void freeItem(void *item);
+};
+
+class TKeySeqCol;
+struct KeyTTable;
+class TLispKeyBind : public TLispVar
+{
+public:
+ TLispKeyBind(TKeySeqCol *aSKeys, void *aData, int aBindType);
+ virtual ~TLispKeyBind();
+ virtual int print(FILE *);
+ virtual char *toStr();
+
+ TKeySeqCol *sKeys;
+ void *data;
+ int bindType;
+};
+
+#define GetKeyBind(pos,obj) \
+{ obj=(TLispKeyBind *)o->Solve(start+pos); \
+ if(!obj) goto CleanUp; \
+ if ((obj->type>>12)!=MLIGKeyBind) \
+ { o->Error=MLITypeParam; goto CleanUp; } \
+}
+#define MLIRetKeyBind(skeys,data,type) \
+ o->array->ReplaceItem(start-1,new TLispKeyBind(skeys,data,type))
+#define LocVarKeyBind(a) TLispKeyBind *a=NULL
+
+class TMLIEditor : public TMLIBase
+{
+public:
+ TMLIEditor(TMLIArrayBase *a, TLispVariableCol *v, FILE *f);
+ ~TMLIEditor();
+ virtual Command WhatCommand(char *s);
+ virtual TLispVar *WhatConstant(char *s);
+
+ TMacrosColl *Macros;
+
+ /* These functions are here just for scope reasons, like a namespace */
+ static int SendCommand(int command);
+ static int InsertText(char *str,int len,int select,int move);
+ static char *GetEditorName(void);
+ static char *GetSelection(int &len);
+ static char *GetWordUnderCursor(int lenMax, int &len, unsigned options);
+ static void ShowInStatusLine(char *s, int l);
+ static char *CompletionChoose(char *options, char *delimiter, unsigned flags);
+ static int GetSyntaxAtCursor();
+ static int ForceUpdate();
+ static char *AskString(const char *title, const char *message);
+ static int OpenFile(const char *fileName);
+ static Boolean SelectionExists();
+ static Boolean FindOrReplaceString(char *str, char *repl, unsigned flags,
+ char *&string, unsigned &len,
+ Boolean again=False);
+ static Boolean FindString(char *str, unsigned flags, char *&string, unsigned &len)
+ { return FindOrReplaceString(str,NULL,flags,string,len); }
+ static Boolean FindAgain(char *&string, unsigned &len);
+ static unsigned GetFindFlags();
+ static int GetCursorX();
+ static int GetCursorY();
+ static void SetCursorXY(int x, int y);
+ static const char *GetSyntaxLang();
+ static int SelectWindowNumber(int num);
+ static int CloseWindowNumber(int num);
+ static int GetCurWindowNumber();
+ static int GetMaxWindowNumber();
+ static int GetWindowCols(int wn);
+ static int GetWindowRows(int wn);
+ static int GetWrapCol(int wn);
+ // Key binding operations
+ static int StartKeyBind();
+ static void EndKeyBind();
+ static void AbortKeyBind();
+ static int BindKey(TKeySeqCol *sKeys, void *data, int Type);
+
+ static TCEditor *Editor;
+
+private:
+ static char *cNames[MLIEditorCommands];
+ static Command cComms[MLIEditorCommands];
+ // Variables used for the Find & Replace interface
+ static char *findAgainStr;
+ static char *replaceAgainStr;
+ static unsigned findAgainFlags;
+ // Variables used for key binding operations
+ static KeyTTable *oriKeyTable;
+ static int oriCanBeDeleted;
+};
+
+#endif
+
+const int edfInfTVDriver=0, edfInfOS=1, edfInfOSFlavor=2, edfInfCPU=3,
+ edfInfCompiler=4, edfInfCompilerFlavor=5;
+
diff --git a/setedit/sdg/include/mlisdg.h b/setedit/sdg/include/mlisdg.h
new file mode 100644
index 0000000..6aacc13
--- /dev/null
+++ b/setedit/sdg/include/mlisdg.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TLispSDGstring) && !defined(__TLispSDGstring__)
+#define __TLispSDGstring__
+
+class TLispSDGstring : public TLispVar
+{
+public:
+ TLispSDGstring(char *st,char *en,int flgs)
+ { start=st; end=en; flags=flgs; type=MLITypeSDGvar; };
+ virtual ~TLispSDGstring();
+ virtual int print(FILE *s);
+ virtual char *toStr();
+
+ int flags;
+ char *start,*end;
+};
+#endif
+
diff --git a/setedit/sdg/include/mlisdgi.h b/setedit/sdg/include/mlisdgi.h
new file mode 100644
index 0000000..32c9bd6
--- /dev/null
+++ b/setedit/sdg/include/mlisdgi.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TMLISDGDefs) && !defined(__TMLISDGDefs__)
+#define __TMLISDGDefs__
+typedef int (*getVarFunction)(int,char *&,char *&,int &);
+extern char *InterpretLispCode(char *s,getVarFunction getVar,FILE *f);
+
+// Default: Don't free it, belongs to the generator
+#define sdgFreeIt 1
+// Default: Out it expanding
+#define sdgSimpleString 2
+// Default: end marks the end
+#define sdgASCIIZ 4
+
+extern int MLISDGError;
+extern char *MLISDGTypeError;
+extern char *MLISDGErrorName;
+extern char *MLISDGErrorCode;
+#endif
diff --git a/setedit/sdg/include/mlivar.h b/setedit/sdg/include/mlivar.h
new file mode 100644
index 0000000..36fc3e0
--- /dev/null
+++ b/setedit/sdg/include/mlivar.h
@@ -0,0 +1,179 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TMLIArrayBase;
+class TMLIBase;
+
+#if defined(Uses_TLispVarDefs) && !defined(__TLispVarDefs__)
+#define __TLispVarDefs__
+
+typedef void (*Command)(TMLIBase *a,int start ,int cant);
+
+const int
+ MLITypeString =0x1000,
+ MLITypeInteger=0x2000,
+ MLITypeCommand=0x3000,
+ MLITypeVar =0x4000,
+ MLITypeCode =0x5000,
+ MLITypeSDGvar =0x6000,
+ MLITypeKeyBind=0x7000; // Used by the editor
+
+const int
+ MLIGString =0x1,
+ MLIGInteger=0x2,
+ MLIGCommand=0x3,
+ MLIGVar =0x4,
+ MLIGCode =0x5,
+ MLIGSDGvar =0x6,
+ MLIGKeyBind=0x7;
+
+const int
+ MLIEStrNoEnd =0x1000, // Parse errors
+ MLIENoEnd =0x1001,
+ MLINoIniPar =0x1002,
+ MLIWrongNumber=0x1003,
+ MLIUnknownVal =0x1004,
+ MLIStakOverf =0x1005,
+ MLITooCommands=0x2000, // Syntax errors
+ MLINoCommands =0x2001,
+ MLIComOrder =0x2002,
+ MLINumParam =0x2003,
+ MLITypeParam =0x2004,
+ MLIUndefVar =0x2005,
+ MLIUndefSymbol=0x2006,
+ MLIUndefOp =0x2007,
+ MLIInvaForName=0x2008,
+ MLIInvaKeySeq =0x2009,
+ MLINoPCRE =0x200a,
+ MLIPCRE =0x200b;
+
+// Just an arbitrary limit to stop infinite recursion that will end in a crash
+const int maxNestedsLisp=1024;
+#endif
+
+#if defined(Uses_TLispVar) && !defined(__TLispVar__)
+#define __TLispVar__
+class TLispVar
+{
+public:
+ TLispVar() {};
+ virtual ~TLispVar();
+ virtual int print(FILE *) = 0;
+ virtual char *toStr() = 0;
+
+ int type;
+};
+
+// Destroys a variables from the stack (array)
+inline void destroyVar(TLispVar *v)
+{
+ if (v && !(v->type & 3))
+ {
+ //fprintf(stderr,"Liberando %X del array\n",(unsigned)v);
+ delete v;
+ }
+}
+
+// Destroys a floating variable, that's a returned value
+inline void destroyFloatVar(TLispVar *v)
+{
+ if (v && (v->type & 3)==1)
+ {
+ //fprintf(stderr,"Liberando %X flotante\n",(unsigned)v);
+ delete v;
+ }
+}
+
+#define GroupTypeOf(a) ((a->type)>>12)
+#define GroupValOf(a) ((a)>>12)
+#endif
+
+
+#if defined(Uses_TLispBaseVars) && !defined(__TLispBaseVars__)
+#define __TLispBaseVars__
+const int StrOwner=1,StrAlreadyAllocated=2;
+typedef enum { tlsRaw, tlsParse } tlsMode;
+
+class TLispString : public TLispVar
+{
+public:
+ TLispString(const char *s, tlsMode mode=tlsRaw);
+ TLispString(const char *s, int len, int flags=StrOwner, int extraType=0);
+ TLispString() {}; // Default constructor does nothing, needed by TLispConstString
+ virtual ~TLispString();
+ virtual int print(FILE *s);
+ virtual char *toStr();
+
+ char *str;
+ int len;
+ int flags;
+};
+
+class TLispConstString : public TLispString
+{
+public:
+ TLispConstString(const char *s);
+ TLispConstString(const char *s, int len, int flags=StrOwner, int extraType=0);
+ virtual ~TLispConstString();
+};
+
+class TLispInteger : public TLispVar
+{
+public:
+ TLispInteger(int v);
+ virtual ~TLispInteger() {};
+ virtual int print(FILE *s);
+ virtual char *toStr();
+
+ int val;
+};
+
+class TLispCommand : public TLispVar
+{
+public:
+ TLispCommand(Command c);
+ virtual ~TLispCommand() {};
+ virtual int print(FILE *s);
+ virtual char *toStr();
+
+ Command command;
+};
+
+class TLispVariable : public TLispVar
+{
+public:
+ TLispVariable(char *v, TLispVar *o);
+ virtual ~TLispVariable();
+ virtual int print(FILE *s);
+ virtual char *toStr();
+
+ TLispVar *val;
+ char *var;
+};
+
+class TLispCode : public TLispVar
+{
+public:
+ TLispCode(char *s, char *e);
+ virtual ~TLispCode() {};
+ virtual int print(FILE *s);
+ virtual char *toStr();
+
+ char *start;
+ char *end;
+};
+#endif
+
+
+#if defined(Uses_TLispVariableCol) && !defined(__TLispVariableCol__)
+#define __TLispVariableCol__
+
+class TLispVariableCol : public TNSSortedCollection
+{
+public:
+ TLispVariableCol(ccIndex aLimit, ccIndex aDelta) :
+ TNSSortedCollection(aLimit,aDelta) {};
+ int compare(void *s1,void *s2);
+ void freeItem(void *s);
+ void *keyOf(void *s);
+};
+#endif
diff --git a/setedit/sdg/include/txhgen.h b/setedit/sdg/include/txhgen.h
new file mode 100644
index 0000000..136ac52
--- /dev/null
+++ b/setedit/sdg/include/txhgen.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+typedef char *(*TXHGetNextFileType)(int &l, int &MustBeDeleted, char *FileName);
+extern TXHGetNextFileType TXHGetNextFile;
+extern void (*TXHPrintMessage)(char *s);
+
+#define TXHGetErrorSection(a) TXHErrorSection[a]
+#define TXHGetGenSect() TXHSections[TXHGenSection]
+#define TXHGetErrorMessage() TXHErrors[TXHError]
+extern int TXHGenerateAll(void);
+extern char *TXHErrorSection[];
+extern int TXHGenSection;
+extern char *TXHSections[];
+extern int TXHError;
+extern int TXHLine;
+extern char *TXHErrors[];
+extern int TXHKeepTemporal;
+extern char *TXHFormatFile; // Configuration file
+extern char *TXHTempGenFile; // Name of the temporal for nodes
+extern char *TXHOutBaseName; // No extentions here!
+extern char *TXHFilesDir; // Base for format files
+
diff --git a/setedit/sdg/mli.cc b/setedit/sdg/mli.cc
new file mode 100644
index 0000000..654fbd0
--- /dev/null
+++ b/setedit/sdg/mli.cc
@@ -0,0 +1,1731 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Micro Lisp Interpreter.
+
+ That's a try to create a simple and very flexible Lisp interpreter. The
+idea is to create a kernel for the parsing.
+
+ Important!: The stupid files mlivar.cc and mliabase.cc are because gcc
+needs a file for each of these classes. The mechanism used to detect
+implementations/declarations doesn't work if gcc doesn't see it. In fact if
+I make all in one cc file it doesn't create the virtual tables and generates
+thousand of undefined references. I was able to avoid it with = 0 but the
+code is inflated in some cases ... I moved mlivar.cc to this code.
+
+*****************************************************************************/
+
+#include <configed.h> // To know about PCRE support
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_string
+#define Uses_stdio
+#define Uses_snprintf
+
+#define Uses_TLispVariableCol
+#define Uses_TLispBaseVars
+#define Uses_TLispVarDefs
+#define Uses_TMLIArraySimple
+#define Uses_TMLIBase
+#define Uses_TVCodePage
+#include <mli.h>
+
+#include <dyncat.h>
+#include <pathtool.h>
+#include <loadshl.h>
+
+// Declaring the destructor here instead of in the header
+// seems to save more than 1Kb in the EXE. Is because the
+// virtual table is multiplied?!?. I didn't saw the same
+// with the array.
+TLispVar::~TLispVar() {}
+
+/************************************* Lisp Objects ********************************/
+
+TLispString::TLispString(const char *s, tlsMode mode)
+{ // Support for escaped C characters, is that C Lisp? ;-) only the most common
+ len=strlen(s);
+ str=new char[len+1];
+ if (mode==tlsParse)
+ {
+ int i=0;
+ while (*s)
+ {
+ if (*s=='\\' && s[1])
+ {
+ s++;
+ len--;
+ switch (*s)
+ {// OS dependant
+ case 'n':
+ #if defined(TVOS_DOS) || \
+ (defined(TVOS_Win32) && !defined(TVCompf_Cygwin))
+ str[i++]='\r';
+ str[i]='\n';
+ len++;
+ #else
+ str[i]='\n';
+ #endif
+ break;
+ // Line Feed alone, no matters the OS
+ case 'l':
+ str[i]='\n';
+ break;
+ case 't':
+ str[i]='\t';
+ break;
+ case 'r':
+ str[i]='\r';
+ break;
+ default:
+ str[i]=*s;
+ }
+ }
+ else
+ str[i]=*s;
+ i++;
+ s++;
+ }
+ str[i]=0;
+ }
+ else
+ memcpy(str,s,len+1);
+ type=MLITypeString;
+ flags=StrOwner;
+}
+
+TLispString::TLispString(const char *s, int l, int flgs, int extraType)
+{
+ len=l;
+ if (flgs & StrAlreadyAllocated)
+ str=(char *)s;
+ else
+ {
+ str=new char[l+1];
+ memcpy(str,s,l+1);
+ str[l]=0;
+ }
+ flags=flgs;
+ type=MLITypeString | extraType;
+}
+
+int TLispString::print(FILE *f)
+{
+ fputs(str,f);
+ return len;
+}
+
+char *TLispString::toStr()
+{
+ char *ret=new char[len+1];
+ strcpy(ret,str);
+ return ret;
+}
+
+TLispString::~TLispString()
+{
+ if (flags & StrOwner)
+ delete[] str;
+}
+
+TLispConstString::TLispConstString(const char *s)
+{
+ len=strlen(s);
+ str=(char *)s;
+ type=MLITypeString;
+ flags=StrOwner;
+}
+
+TLispConstString::TLispConstString(const char *s, int l, int flgs, int extraType)
+{
+ len=l;
+ str=(char *)s;
+ flags=flgs;
+ type=MLITypeString | extraType;
+}
+
+TLispConstString::~TLispConstString()
+{
+}
+
+TLispInteger::TLispInteger(int v)
+{
+ val=v;
+ type=MLITypeInteger;
+}
+
+int TLispInteger::print(FILE *s)
+{
+ return fprintf(s,"%d",val);
+}
+
+char *TLispInteger::toStr()
+{
+ char *ret=new char[sizeof(int)*3];
+ sprintf(ret,"%d",val);
+ return ret;
+}
+
+TLispCommand::TLispCommand(Command c)
+{
+ command=c;
+ type=MLITypeCommand;
+}
+
+const char ErrorPrCommand[]=" ERROR: Command printed ";
+
+int TLispCommand::print(FILE *s)
+{
+ return fprintf(s,ErrorPrCommand);
+}
+
+char *TLispCommand::toStr()
+{
+ char *ret=new char[sizeof(ErrorPrCommand)];
+ strcpy(ret,ErrorPrCommand);
+ return ret;
+}
+
+TLispVariable::~TLispVariable()
+{
+ free(var);
+ if (val)
+ delete val;
+}
+
+TLispVariable::TLispVariable(char *v, TLispVar *o)
+{
+ var=strdup(v);
+ val=o;
+ type=MLITypeVar;
+}
+
+int TLispVariable::print(FILE *s)
+{
+ return val->print(s);
+}
+
+char *TLispVariable::toStr()
+{
+ return val->toStr();
+}
+
+int TLispVariableCol::compare(void *s1,void *s2)
+{
+ return strcmp((char *)s1,(char *)s2);
+}
+
+void *TLispVariableCol::keyOf(void *s)
+{
+ return ((TLispVariable *)s)->var;
+}
+
+void TLispVariableCol::freeItem(void *s)
+{
+ if (s)
+ delete ((TLispVariable *)s);
+}
+
+TLispCode::TLispCode(char *s, char *e)
+{
+ start=s;
+ end=e;
+ type=MLITypeCode;
+}
+
+int TLispCode::print(FILE *s)
+{
+ char v=*end;
+ *end=0;
+ fputs(start,s);
+ *end=v;
+ return end-start;
+}
+
+char *TLispCode::toStr()
+{
+ int l=end-start;
+ char *ret=new char[l+1];
+ strncpy(ret,start,l);
+ ret[l]=0;
+ return ret;
+}
+
+/********************************** End Lisp Objects *********************************/
+
+void MLIBasePrint(TMLIBase *o,int start ,int cant)
+{
+ int i,count=0;
+ TLispVar *p;
+
+ for (i=0; i<cant; i++)
+ {
+ p=o->Solve(start+i);
+ if (p)
+ {
+ count+=p->print(o->fileOut);
+ destroyFloatVar(p);
+ }
+ else
+ {
+ MLIRetNULL();
+ return;
+ }
+ }
+ MLIRetInt(count);
+}
+
+int TMLIBase::MLIBooleanValOf(TLispVar *var)
+{
+ switch (GroupTypeOf(var))
+ {
+ case MLIGString:
+ {
+ TLispString *s=(TLispString *)var;
+ return (s->len!=0) ? 0xFFFFFFFF : 0;
+ }
+ case MLIGInteger:
+ {
+ TLispInteger *i=(TLispInteger *)var;
+ return i->val;
+ }
+ case MLIGCommand:
+ case MLIGVar:
+ case MLIGCode:
+ return 0xFFFFFFFF;
+ }
+ return 0;
+}
+
+// If returns the value of the executed code or an integer 0 if no else
+void MLIBaseIf(TMLIBase *o,int start ,int cant)
+{
+ if (cant<2 || cant>3)
+ {
+ o->Error=MLINumParam;
+ MLIRetNULL();
+ return;
+ }
+ TLispVar *p=o->Solve(start);
+ if (!p)
+ {
+ MLIRetNULL();
+ return;
+ }
+ int boolval=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ if (boolval)
+ {// Note that MLIRetObj is a macro and *have* side effects
+ p=o->Solve(start+1);
+ MLIRetObj(p);
+ }
+ else
+ {
+ if (cant==3)
+ {
+ p=o->Solve(start+2);
+ MLIRetObj(p);
+ }
+ else
+ MLIRetInt(0);
+ }
+}
+
+DecFun(MLIBaseCond)
+{
+ CheckNumParams(cant<2 || (cant%2));
+
+ LocVar(If);
+ LocVar(Then);
+
+ for (int i=0; i < cant; i += 2)
+ {
+ GetVar(i,If);
+ int b=o->MLIBooleanValOf(If);
+ destroyFloatVar(If);
+
+ if (b)
+ {
+ GetVar(i+1,Then);
+ MLIRetObj(Then);
+ return;
+ }
+ }
+
+ MLIRetInt(0);
+
+CleanUp:
+ return;
+}
+
+
+DecFun(MLIBaseLeft)
+{
+ int l;
+ LocVarStr(string);
+ LocVarInt(left);
+
+ CheckNumParams(cant!=2);
+ GetString(0,string);
+ GetInteger(1,left);
+
+ l=left->val;
+ if (l>string->len)
+ l=string->len;
+
+ MLIRetStrLen(string->str,l);
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(left);
+}
+
+DecFun(MLIBaseRight)
+{
+ int l,lstr;
+ LocVarStr(string);
+ LocVarInt(len);
+
+ CheckNumParams(cant!=2);
+ GetString(0,string);
+ GetInteger(1,len);
+
+ l=len->val;
+ lstr=string->len;
+ if (l>lstr)
+ l=lstr;
+
+ MLIRetStrLen(string->str+lstr-l,l);
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(len);
+}
+
+DecFun(MLIBaseSubStr)
+{
+ int len,from,lstr;
+ LocVarStr(String);
+ LocVarInt(Start);
+ LocVarInt(Len);
+
+ CheckNumParams(cant!=2 && cant!=3);
+ GetString(0,String);
+ lstr=String->len;
+ GetInteger(1,Start);
+ from=Start->val;
+ GetIntegerOp(2,Len,lstr-from,len);
+
+ if (from>lstr)
+ {
+ len=0;
+ from=0;
+ }
+ else
+ if (len+from>lstr)
+ len=lstr-start;
+ MLIRetStrLen(String->str+from,len);
+
+CleanUp:
+ destroyFloatVar(String);
+ destroyFloatVar(Start);
+ destroyFloatVar(Len);
+}
+
+static
+void MLIBaseStrCmpFunc(TMLIBase *o,int start ,int cant, int type)
+{
+ LocVarStr(Str1);
+ LocVarStr(Str2);
+
+ CheckNumParams(cant!=2);
+ GetString(0,Str1);
+ GetString(1,Str2);
+ MLIRetInt(type ? strcasecmp(Str1->str,Str2->str) : strcmp(Str1->str,Str2->str));
+
+CleanUp:
+ destroyFloatVar(Str1);
+ destroyFloatVar(Str2);
+}
+
+DecFun(MLIBaseStrCmp)
+{
+ MLIBaseStrCmpFunc(o,start,cant,0);
+}
+
+DecFun(MLIBaseStrCaseCmp)
+{
+ MLIBaseStrCmpFunc(o,start,cant,1);
+}
+
+DecFun(MLIBaseLength)
+{
+ LocVarStr(Str);
+
+ CheckNumParams(cant!=1);
+ GetString(0,Str);
+ MLIRetInt(Str->len);
+
+CleanUp:
+ destroyFloatVar(Str);
+}
+
+DecFun(MLIBaseGStr)
+{
+ int l,lstr,lret;
+ LocVarStr(string);
+ LocVarInt(pos);
+
+ CheckNumParams(cant!=2);
+ GetString(0,string);
+ GetInteger(1,pos);
+
+ l=pos->val;
+ lstr=string->len;
+ if (l>lstr)
+ {
+ l=0;
+ lret=0;
+ }
+ else
+ lret=1;
+ MLIRetStrLen(string->str+l,lret);
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(pos);
+}
+
+DecFun(MLIBaseSStr)
+{
+ int l,lstr;
+ LocVarStr(string);
+ LocVarInt(pos);
+ LocVarStr(val);
+
+ CheckNumParams(cant!=3);
+ GetString(0,string);
+ GetInteger(1,pos);
+ GetString(2,val);
+
+ if (val->len)
+ {
+ l=pos->val;
+ lstr=string->len;
+ if (l<lstr)
+ string->str[l]=val->str[0];
+ }
+ MLIRetObj(string);
+
+CleanUp:
+ //destroyFloatVar(string); That's the return value, don't kill!
+ destroyFloatVar(pos);
+ destroyFloatVar(val);
+}
+
+// Create or modify a variable
+DecFun(MLIBaseSetV)
+{
+ LocVar(Variable);
+ LocVarStr(name);
+
+ CheckNumParams(cant!=2);
+ GetString(0,name);
+ GetVar(1,Variable);
+ o->AddVariable(name->str,Variable);
+ MLIRetObj(Variable);
+
+CleanUp:
+ destroyFloatVar(name);
+}
+
+// It just evaluates the parameters.
+DecFun(MLIBaseEval)
+{
+ int i;
+ LocVar(Variable);
+
+ for (i=0; i<cant; i++)
+ {
+ GetVar(i,Variable);
+ if (i+1==cant)
+ MLIRetObj(Variable);
+ else
+ destroyFloatVar(Variable);
+ }
+CleanUp:
+ return;
+}
+
+// It just evaluates the parameters until an exitloop is executed.
+DecFun(MLIBaseLoop)
+{
+ int i;
+ LocVar(Variable);
+ CheckNumParams(cant<1);
+
+ Boolean ExitLoop=o->ExitLoop;
+ o->ExitLoop=False;
+
+ while (!o->ExitLoop)
+ {
+ for (i=0; i<cant; i++)
+ {
+ GetVar(i,Variable);
+ if (o->ExitLoop)
+ {
+ MLIRetObj(Variable);
+ break;
+ }
+ else
+ destroyFloatVar(Variable);
+ }
+ }
+CleanUp:
+ o->ExitLoop=ExitLoop;
+ return;
+}
+
+// It just evaluates the parameters until an exitloop is executed or the
+// maximum number of iterations is reached.
+DecFun(MLIBaseRepeat)
+{
+ int i, loopCount, maxLoop;
+ LocVar(Variable);
+ LocVarInt(oMaxLoop);
+ CheckNumParams(cant<2);
+
+ Boolean ExitLoop=o->ExitLoop;
+ o->ExitLoop=False;
+
+ GetInteger(0,oMaxLoop);
+ maxLoop=oMaxLoop->val;
+ destroyFloatVar(oMaxLoop);
+
+ loopCount=0;
+ while (!o->ExitLoop && loopCount<maxLoop)
+ {
+ for (loopCount++, i=1; i<cant; i++)
+ {
+ GetVar(i,Variable);
+ if (o->ExitLoop)
+ {
+ MLIRetObj(Variable);
+ break;
+ }
+ else
+ destroyFloatVar(Variable);
+ }
+ }
+ if (!o->ExitLoop)
+ {// We must return something:
+ MLIRetInt(loopCount);
+ }
+CleanUp:
+ o->ExitLoop=ExitLoop;
+ return;
+}
+
+DecFun(MLIBaseExitLoop)
+{
+ CheckNumParams(cant!=0);
+ o->ExitLoop=True;
+ return;
+}
+
+static void AddStrings(TLispString *str,TMLIBase *o,int start ,int cant, int startret)
+{
+ DynStrCatStruct cat;
+ LocVar(Variable);
+ int i,l;
+ char b[32];
+
+ DynStrCatInit(&cat,str->str,str->len);
+ for (i=0; i<cant; i++)
+ {
+ GetVar(i,Variable);
+ switch (GroupTypeOf(Variable))
+ {
+ case MLIGString:
+ DynStrCat(&cat,((TLispString *)Variable)->str,((TLispString *)Variable)->len);
+ break;
+ case MLIGInteger:
+ l=CLY_snprintf(b,32,"%d",((TLispInteger *)Variable)->val);
+ DynStrCat(&cat,b,l);
+ break;
+ default:
+ o->Error=MLITypeParam;
+ goto CleanUp;
+ }
+ destroyFloatVar(Variable);
+ Variable=NULL;
+ }
+ start=startret;
+ MLIRetStrLen(cat.str,cat.len);
+ free(cat.str);
+
+CleanUp:
+ destroyFloatVar(Variable);
+}
+
+static void AddIntegers(TLispInteger *Val,TMLIBase *o,int start ,int cant, int startret)
+{
+ LocVarInt(NewVal);
+ int i,ret;
+
+ ret=Val->val;
+ for (i=0; i<cant; i++)
+ {
+ GetInteger(i,NewVal);
+ ret+=NewVal->val;
+ destroyFloatVar(NewVal);
+ NewVal=NULL;
+ }
+ start=startret;
+ MLIRetInt(ret);
+
+CleanUp:
+ destroyFloatVar(NewVal);
+}
+
+DecFun(MLIBaseAdd)
+{
+ LocVar(Variable);
+
+ CheckNumParams(cant<2);
+ GetVar(0,Variable);
+ switch (GroupTypeOf(Variable))
+ {
+ case MLIGString:
+ AddStrings((TLispString *)Variable,o,start+1,cant-1,start);
+ break;
+ case MLIGInteger:
+ AddIntegers((TLispInteger *)Variable,o,start+1,cant-1,start);
+ break;
+ default:
+ o->Error=MLIUndefOp;
+ MLIRetNULL();
+ }
+CleanUp:
+ destroyFloatVar(Variable);
+}
+
+DecFun(MLIBaseSub)
+{
+ LocVarInt(v1);
+ LocVarInt(v2);
+
+ CheckNumParams(cant!=2);
+ GetInteger(0,v1);
+ GetInteger(1,v2);
+ MLIRetInt(v1->val-v2->val);
+
+CleanUp:
+ destroyFloatVar(v1);
+ destroyFloatVar(v2);
+}
+
+// (strstr string search [start_pos])
+DecFun(MLIBaseStrStr)
+{
+ int from,lstr;
+ LocVarStr(String);
+ LocVarStr(Search);
+ LocVarInt(From);
+
+ CheckNumParams(cant!=2 && cant!=3);
+ GetString(0,String);
+ lstr=String->len;
+ GetString(1,Search);
+ GetIntegerOp(2,From,0,from);
+
+ if (from>=lstr)
+ {
+ MLIRetInt(-1);
+ }
+ else
+ {
+ char *s=strstr(String->str+from,Search->str);
+ if (!s)
+ {
+ MLIRetInt(-1);
+ }
+ else
+ {
+ MLIRetInt(s-String->str);
+ }
+ }
+
+CleanUp:
+ destroyFloatVar(String);
+ destroyFloatVar(Search);
+ destroyFloatVar(From);
+}
+
+//(strxlt string search replace)
+DecFun(MLIBaseStrXlt)
+{
+ int slen,sc,ss,lstr;
+ char search,replace,*str;
+ LocVarStr(String);
+ LocVarStr(Search);
+ LocVarStr(Replace);
+
+ CheckNumParams(cant!=3);
+
+ GetString(0,String);
+ GetString(1,Search);
+ GetString(2,Replace);
+
+ slen=min(Search->len,Replace->len);
+ lstr=String->len;
+ str=String->str;
+ for (sc=0; sc<slen; sc++)
+ {
+ search=Search->str[sc];
+ replace=Replace->str[sc];
+ for (ss=0; ss<lstr; ss++)
+ if (str[ss]==search)
+ str[ss]=replace;
+ }
+ MLIRetStrLen(str,lstr);
+
+CleanUp:
+ destroyFloatVar(String);
+ destroyFloatVar(Search);
+ destroyFloatVar(Replace);
+}
+
+// (and v1 v2 [v3...]) Logical and
+DecFun(MLIBaseAnd)
+{
+ CheckNumParams(cant<2);
+ int i,value=1;
+ TLispVar *p;
+
+ for (i=0; value && i<cant; i++)
+ {
+ p=o->Solve(start+i);
+ if (p)
+ {
+ value&=o->MLIBooleanValOf(p) ? 1 : 0;
+ destroyFloatVar(p);
+ }
+ else
+ {
+ MLIRetNULL();
+ return;
+ }
+ }
+ MLIRetInt(value);
+}
+
+// (& v1 v2 [v3...]) Bitwise and
+DecFun(MLIBaseAndB)
+{
+ CheckNumParams(cant<2);
+ int i,value=0xFFFFFFFF;
+ TLispVar *p;
+
+ for (i=0; value && i<cant; i++)
+ {
+ p=o->Solve(start+i);
+ if (p)
+ {
+ value&=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ }
+ else
+ {
+ MLIRetNULL();
+ return;
+ }
+ }
+ MLIRetInt(value);
+}
+
+// (or v1 v2 [v3...]) Logical or
+DecFun(MLIBaseOr)
+{
+ CheckNumParams(cant<2);
+ int i,value=0;
+ TLispVar *p;
+
+ for (i=0; !value && i<cant; i++)
+ {
+ p=o->Solve(start+i);
+ if (p)
+ {
+ value|=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ }
+ else
+ {
+ MLIRetNULL();
+ return;
+ }
+ }
+ MLIRetInt(value);
+}
+
+// (| v1 v2 [v3...]) Bitwise or
+DecFun(MLIBaseOrB)
+{
+ CheckNumParams(cant<2);
+ int i,value=0;
+ TLispVar *p;
+
+ for (i=0; value!=(int)0xFFFFFFFF && i<cant; i++)
+ {
+ p=o->Solve(start+i);
+ if (p)
+ {
+ value|=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ }
+ else
+ {
+ MLIRetNULL();
+ return;
+ }
+ }
+ MLIRetInt(value);
+}
+
+DecFun(MLIBaseNotB)
+{
+ LocVar(value);
+
+ CheckNumParams(cant!=1);
+ GetVar(0,value);
+
+ MLIRetInt(~o->MLIBooleanValOf(value));
+
+CleanUp:
+ destroyFloatVar(value);
+}
+
+DecFun(MLIBaseNot)
+{
+ LocVar(value);
+
+ CheckNumParams(cant!=1);
+ GetVar(0,value);
+
+ MLIRetInt(o->MLIBooleanValOf(value) ? 0 : 1);
+
+CleanUp:
+ destroyFloatVar(value);
+}
+
+DecFun(MLIShortFileName)
+{
+ LocVarStr(File);
+ CheckNumParams(cant!=1);
+ GetString(0,File);
+ char SFN[maxSFNSize];
+ MLIRetString(GetShortNameOf(File->str,SFN));
+CleanUp:
+ destroyFloatVar(File);
+}
+
+static
+void MLIBaseEqualFunc(TMLIBase *o,int start ,int cant, int type)
+{
+ int t1,t2,ret;
+ LocVar(v1);
+ LocVar(v2);
+
+ // Right now we don't suport (== v1 v2 v3 ...)
+ CheckNumParams(cant!=2);
+ GetVar(0,v1);
+ GetVar(1,v2);
+ t1=GroupTypeOf(v1);
+ t2=GroupTypeOf(v2);
+ if (t1==MLIGString && t2==MLIGString)
+ {
+ TLispString *s1=(TLispString *)v1;
+ TLispString *s2=(TLispString *)v2;
+ ret=!strcmp(s1->str,s2->str);
+ MLIRetInt(type ? ret : !ret);
+ }
+ else if (t1==MLIGInteger && t2==MLIGInteger)
+ {
+ TLispInteger *i1=(TLispInteger *)v1;
+ TLispInteger *i2=(TLispInteger *)v2;
+ ret=(i1->val==i2->val);
+ MLIRetInt(type ? ret : !ret);
+ }
+ else
+ {// Right now we don't support mixed types
+ o->Error=MLIUndefOp;
+ MLIRetNULL();
+ }
+
+CleanUp:
+ destroyFloatVar(v1);
+ destroyFloatVar(v2);
+}
+
+DecFun(MLIBaseEqual)
+{
+ MLIBaseEqualFunc(o,start,cant,1);
+}
+
+DecFun(MLIBaseNotEqual)
+{
+ MLIBaseEqualFunc(o,start,cant,0);
+}
+
+static
+void MLIBaseIncDec(TMLIBase *o, int start, int cant, int delta)
+{
+ LocVar(targetVar);
+ LocVar(Val);
+ CheckNumParams(cant!=1);
+
+ GetVar(0,Val);
+ switch (GroupTypeOf(Val))
+ {
+ case MLIGString:
+ // Something that was reduced to a string. Look-up a variable.
+ targetVar=o->SearchVar(MLIAsStrVal(Val));
+ CheckForError(!targetVar,MLIUndefVar);
+ CheckForError(GroupTypeOf(targetVar)!=MLIGInteger,MLIUndefOp);
+ MLIAsIntVal(targetVar)+=delta;
+ MLIRetInt(MLIAsIntVal(targetVar));
+ break;
+ case MLIGInteger:
+ // Something that was reduced to an int, just increment the value and return it
+ MLIRetInt(MLIAsIntVal(Val)+delta);
+ break;
+ default:
+ CheckForError(1,MLITypeParam)
+ }
+
+CleanUp:
+ destroyFloatVar(Val);
+}
+
+
+// (++ value) | (++ "var_name")
+DecFun(MLIBaseInc)
+{
+ MLIBaseIncDec(o,start,cant,1);
+}
+
+// (-- value) | (-- "var_name")
+DecFun(MLIBaseDec)
+{
+ MLIBaseIncDec(o,start,cant,-1);
+}
+
+// (tostr <object>)
+// converts a Lisp object into its "printed representation"
+DecFun(MLIBaseToStr)
+{
+ CheckNumParams(cant!=1);
+
+ char *str;
+ LocVar(val);
+
+ GetVar(0,val);
+ str=val->toStr();
+ destroyFloatVar(val);
+
+ MLIRetStrLenExists(str,strlen(str));
+
+CleanUp:
+ return;
+}
+
+// (prex <string> <str_regex>)
+// performs a Perl regex search
+DecFun(MLIBasePRex)
+{
+ LocVarStr(String);
+ LocVarStr(Search);
+ PCREData prexS={0,NULL};
+ pcre *prexC=NULL;
+
+ CheckForError(!SUP_PCRE,MLINoPCRE);
+ CheckNumParams(cant!=2);
+
+ GetString(0,String);
+ GetString(1,Search);
+
+ PCREInitCompiler(prexS);
+ prexC=PCRECompileRegEx(Search->str,prexS);
+ CheckForError(!prexC,MLIPCRE);
+ PCREStopCompiler(prexS);
+ if (PCREDoSearch(String->str,String->len,prexC,prexS))
+ {// Get the matches
+ char b[32];
+ int offset, len;
+ for (int i=0; i<prexS.PCREHits; i++)
+ {
+ PCREGetMatch(i,offset,len,prexS);
+ if (offset>=0)
+ {
+ CLY_snprintf(b,32,"_%d",i);
+ o->AddVariable(b,new TLispString(String->str+offset,len));
+ }
+ }
+ MLIRetInt(prexS.PCREHits);
+ }
+ else
+ {
+ MLIRetInt(0);
+ }
+
+CleanUp:
+ destroyFloatVar(String);
+ destroyFloatVar(Search);
+ PCREDataDestroy(prexS);
+ free(prexC);
+}
+
+// C like for(inic;condition;increment) code; => (inic cond inc code for)
+/*DecFun(MLIBaseFor)
+{
+}*/
+
+char *TMLIBase::cNames[MLIBaseCommands]=
+{
+ "print",
+ "if",
+ "left",
+ "right",
+ "substr",
+ "gstr",
+ "sstr",
+ "setv",
+ "eval",
+ "strstr",
+ "strxlt",
+ "and",
+ "or",
+ "not",
+ "ShortFileName",
+ "strcmp",
+ "strcasecmp",
+ "length",
+ "progn",
+ "cond",
+ "tostr",
+ "loop",
+ "exitloop",
+ "repeat",
+ "prex"/*,
+ "for"*/
+};
+
+Command TMLIBase::cComms[MLIBaseCommands]=
+{
+ MLIBasePrint,
+ MLIBaseIf,
+ MLIBaseLeft,
+ MLIBaseRight,
+ MLIBaseSubStr,
+ MLIBaseGStr,
+ MLIBaseSStr,
+ MLIBaseSetV,
+ MLIBaseEval,
+ MLIBaseStrStr,
+ MLIBaseStrXlt,
+ MLIBaseAnd,
+ MLIBaseOr,
+ MLIBaseNot,
+ MLIShortFileName,
+ MLIBaseStrCmp,
+ MLIBaseStrCaseCmp,
+ MLIBaseLength,
+ MLIBaseEval,
+ MLIBaseCond,
+ MLIBaseToStr,
+ MLIBaseLoop,
+ MLIBaseExitLoop,
+ MLIBaseRepeat,
+ MLIBasePRex/*,
+ MLIBaseFor*/
+};
+
+char *TMLIBase::sNames[MLIBaseSymbols]=
+{
+ "+",
+ "&",
+ "|",
+ "-",
+ "~",
+ "==",
+ "!=",
+ "++",
+ "--",
+ "="
+};
+
+Command TMLIBase::sComms[MLIBaseSymbols]=
+{
+ MLIBaseAdd,
+ MLIBaseAndB,
+ MLIBaseOrB,
+ MLIBaseSub,
+ MLIBaseNotB,
+ MLIBaseEqual,
+ MLIBaseNotEqual,
+ MLIBaseInc,
+ MLIBaseDec,
+ MLIBaseSetV
+};
+
+TLispConstString CRConstant("\r\n",2,0,2);
+
+char *TMLIBase::cNamesConst[MLIBaseConstants]=
+{
+ "CR"
+};
+
+TLispVar *TMLIBase::cConstants[MLIBaseConstants]=
+{
+ &CRConstant
+};
+
+
+TMLIBase::TMLIBase(TMLIArrayBase *a, TLispVariableCol *v, FILE *out)
+{
+ array=a;
+ Error=0;
+ fileOut=out;
+ EndCode=0;
+ Vars=v;
+ ErrorReported=1;
+ ExitLoop=False;
+}
+
+TMLIBase::~TMLIBase()
+{
+ if (array)
+ {
+ delete array;
+ array=0;
+ }
+ CLY_destroy(Vars);
+ Vars=0;
+}
+
+int TMLIBase::DuplicateVar(TLispVar *&aux,TLispVar *Value)
+{
+ switch (GroupTypeOf(Value))
+ {
+ case MLIGString:
+ aux=new TLispString(((TLispString *)Value)->str,((TLispString *)Value)->len);
+ break;
+ case MLIGInteger:
+ aux=new TLispInteger(((TLispInteger*)Value)->val);
+ break;
+ default:
+ return 1;
+ }
+ return 0;
+}
+
+void TMLIBase::AddVariable(char *name, TLispVar *Value)
+{
+ ccIndex ind;
+ TLispVariable *v;
+
+ if (Value->type & 2)
+ { // The value is the one from other variable, 2 vars can't have the same
+ // value or a modification in one will be reflected in the other.
+ TLispVar *aux;
+ if (DuplicateVar(aux,Value))
+ return;
+ Value=aux;
+ }
+
+ Value->type|=2;
+ if (Vars->search(name,ind))
+ { // If already exists replace the value
+ v=(TLispVariable *)(Vars->at(ind));
+ delete v->val;
+ v->val=Value;
+ }
+ else
+ { // If not create it and insert in the right place
+ v=new TLispVariable(name,Value);
+ v->type|=2;
+ Vars->atInsert(ind,v);
+ }
+}
+
+TLispVar *TMLIBase::SearchVar(char *name)
+{
+ ccIndex ind;
+ TLispVariable *v;
+
+ if (Vars->search(name,ind))
+ {
+ v=(TLispVariable *)(Vars->at(ind));
+ return v->val;
+ }
+ return NULL;
+}
+
+TLispVar *TMLIBase::Solve(int i)
+{
+ TLispVar *o=array->Get(i);
+
+ int type=GroupTypeOf(o);
+ if (type==MLIGCode)
+ return Interpret(((TLispCode *)o)->start);
+ else
+ if (type==MLIGVar)
+ return ((TLispVariable *)o)->val;
+ // Make it a floating var
+ //o->type|=1;
+ return o;
+}
+
+Command TMLIBase::WhatCommand(char *s)
+{
+ int i;
+ for (i=0; i<MLIBaseCommands; i++)
+ if (strcmp(s,cNames[i])==0)
+ return cComms[i];
+ return 0;
+}
+
+TLispVar *TMLIBase::WhatConstant(char *s)
+{
+ int i;
+ for (i=0; i<MLIBaseConstants; i++)
+ if (strcmp(cNamesConst[i],s)==0)
+ return cConstants[i];
+ return 0;
+}
+
+Command TMLIBase::WhatSymbol(char *s)
+{
+ int i;
+ for (i=0; i<MLIBaseSymbols; i++)
+ if (strcmp(s,sNames[i])==0)
+ return sComms[i];
+ return 0;
+}
+
+char *TMLIBase::SkipCode(char *&code, int &error)
+{
+ char *s=code+1,*start;
+ int level;
+
+ for (level=0; *s && (*s!=')' || level!=0); s++)
+ {
+ if (*s=='"')
+ {
+ start=s;
+ for (s++; *s && *s!='"'; s++)
+ if (*s=='\\')
+ s++;
+ if (*s!='"')
+ {
+ code=start;
+ error=MLIEStrNoEnd;
+ return 0;
+ }
+ }
+ else
+ if (*s=='\'')
+ {
+ start=s;
+ for (s++; *s && *s!='\''; s++)
+ if (*s=='\\')
+ s++;
+ if (*s!='\'')
+ {
+ code=start;
+ error=MLIEStrNoEnd;
+ return 0;
+ }
+ }
+ else
+ if (*s==';')
+ {
+ for (s++; *s && *s!='\n'; s++);
+ }
+ else
+ if (*s=='(')
+ level++;
+ else
+ if (*s==')')
+ level--;
+ }
+ if (*s!=')')
+ {
+ error=MLIENoEnd;
+ return 0;
+ }
+ return s;
+}
+
+char *TMLIBase::SkipCode()
+{
+ return SkipCode(Code,Error);
+}
+
+TLispVar *TMLIBase::Interpret(char *s)
+{
+ int stkPos=array->GetCount();
+ TLispVar *ret=InterpretNoClean(s);
+ if (ret==NULL)
+ {// Now we can get the error while we are sure the code exists.
+ // The code could be a variable in the stack and be freed soon.
+ CopyCodeError();
+ // If we parsed some parameters and found an error before finishing
+ // destroy these entries in the stack.
+ if (array->firstfree>stkPos)
+ array->FreeItems(array->firstfree-stkPos-1);
+ }
+ return ret;
+}
+
+TLispVar *TMLIBase::InterpretNoClean(char *s)
+{
+ int Params=0;
+ int Commands=0;
+ int stkPos=array->GetCount();
+ char *start,*end;
+ // Skip whitespace, macros typed by the user could have it
+ while (ucisspace(*s)) s++;
+ StartCode=Code=s;
+ if (*s!='(')
+ {
+ Error=MLINoIniPar;
+ return NULL;
+ }
+ Code++;
+
+ while (*Code)
+ {
+ for (;*Code && ucisspace(*Code); Code++);
+ switch (*Code)
+ {
+ case '(':
+ if (Commands==0)
+ {
+ Error=MLINoCommands;
+ return NULL;
+ }
+ start=Code;
+ end=SkipCode();
+ if (!end)
+ return NULL;
+ Code=end+1;
+ array->Push(new TLispCode(start,Code));
+ Params++;
+ break;
+ case ')':
+ {
+ if (Code>EndCode)
+ EndCode=Code;
+ if (Commands==0)
+ {
+ Error=MLINoCommands;
+ if (Params)
+ array->FreeItems(Params-1);
+ return NULL;
+ }
+ TLispCommand *c=(TLispCommand *)(array->Get(stkPos));
+ (c->command)(this,stkPos+1,Params);
+ if (Error)
+ {
+ array->FreeItems(Params);
+ return NULL;
+ }
+ return array->FreeItems(Params);
+ }
+ case '"':
+ case '\'':
+ if (Commands==0)
+ {
+ Error=MLINoCommands;
+ return NULL;
+ }
+ if (ParseString(*Code))
+ {
+ Error=MLIEStrNoEnd;
+ return NULL;
+ }
+ Params++;
+ break;
+ case ';':
+ while (*Code!='\n' && *Code) Code++;
+ break;
+ default:
+ if (TVCodePage::isAlpha(*Code) || *Code=='_')
+ { // That could be a var or a command
+ if (ParseVarOrCommand(Params,Commands))
+ return NULL;
+ if (Commands>1)
+ {
+ Error=MLITooCommands;
+ return NULL;
+ }
+ }
+ else
+ if ((*Code=='-' && ucisdigit(Code[1])) || ucisdigit(*Code))
+ {
+ if (Commands==0)
+ {
+ Error=MLINoCommands;
+ return NULL;
+ }
+ if (ParseNumber())
+ {
+ Error=MLIWrongNumber;
+ return NULL;
+ }
+ Params++;
+ }
+ else
+ {
+ int OldCommands=Commands;
+ if (ParseSymbol(Params,Commands))
+ {
+ Error=MLIUnknownVal;
+ return NULL;
+ }
+ if (OldCommands!=Commands && Commands!=1)
+ {
+ Error=MLITooCommands;
+ return NULL;
+ }
+ if (Commands==0)
+ {
+ Error=MLINoCommands;
+ return NULL;
+ }
+ }
+ }
+ if (array->GetCount()>maxNestedsLisp)
+ {
+ Error=MLIStakOverf;
+ return NULL;
+ }
+ }
+ Error=MLIENoEnd;
+ return NULL;
+}
+
+int TMLIBase::ParseSymbol(int &,int &Commands)
+{
+ Command p;
+ char *start,*end,v;
+ start=end=Code;
+
+ for (;*end && !ucisspace(*end) && *end!='('; end++);
+ Code=end;
+
+ v=*end;
+ *end=0;
+ p=WhatSymbol(start);
+ *end=v;
+ if (p)
+ {
+ array->Push(new TLispCommand(p));
+ Commands++;
+ }
+ else
+ {
+ Error=MLIUndefSymbol;
+ return 1;
+ }
+ return 0;
+}
+
+int TMLIBase::ParseVarOrCommand(int &Params,int &Commands)
+{
+ char *s=Code;
+ char *start=s,v;
+ Command p;
+
+ for (;*s && (TVCodePage::isAlNum(*s) || *s=='_'); s++);
+ Code=s;
+ v=*s;
+ *s=0;
+ p=WhatCommand(start);
+ if (p)
+ {
+ array->Push(new TLispCommand(p));
+ Commands++;
+ }
+ else
+ {
+ ccIndex pos;
+ if (Vars->search(start,pos))
+ {
+ array->Push((TLispVar *)(Vars->at(pos)));
+ Params++;
+ }
+ else
+ { // Now try a constant
+ TLispVar *constant=WhatConstant(start);
+ if (constant)
+ {
+ array->Push(constant);
+ Params++;
+ }
+ else
+ {
+ *s=v;
+ Error=MLIUndefVar;
+ return 1;
+ }
+ }
+ }
+ *s=v;
+ return 0;
+}
+
+int TMLIBase::ParseString(char end)
+{
+ char *s=Code+1;
+ char *start=s;
+
+ for (;*s && *s!=end; s++)
+ if (*s=='\\')
+ s++;
+ if (*s!=end)
+ return 1;
+ *s=0;
+ array->Push(new TLispString(start,tlsParse));
+ *s=end;
+ Code=s+1;
+ return 0;
+}
+
+int TMLIBase::ParseNumber()
+{
+ char *end;
+ array->Push(new TLispInteger(strtol(Code,&end,0)));
+ Code=end;
+ return !(ucisspace(*end) || *end=='(' || *end==')' || *end==';');
+}
+
+#define maxParse 6
+#define maxSyntax 11
+
+static char *UnkErr=__("unknown");
+
+char *TMLIBase::TypeError[]=
+{
+ UnkErr,
+ __("parser"),
+ __("syntax")
+};
+
+char *TMLIBase::ParseError[]=
+{
+ __("string not closed"),
+ __("no ) at end of code"),
+ __("no starting ("),
+ __("wrong number"),
+ __("unknown value"),
+ __("stack overflow")
+};
+
+char *TMLIBase::SyntaxError[]=
+{
+ __("command where a parameter was expected"),
+ __("command expected"),
+ __("parameter after command"),
+ __("wrong number of parameters"),
+ __("wrong parameter type"),
+ __("undefined variable"),
+ __("undefined symbol"),
+ __("operation not defined"),
+ __("invalid character for a name"),
+ __("invalid key sequence"),
+ __("PCRE not available"),
+ __("PCRE compile error")
+};
+
+char *TMLIBase::GetTypeError()
+{
+ int type=Error>>12;
+ if (type<0 || type>2)
+ type=0;
+ return TypeError[type];
+}
+
+
+char *TMLIBase::GetError()
+{
+ int type=Error>>12;
+ int subtype=Error & 0xFFF;
+
+ switch (type)
+ {
+ case 1:
+ if (subtype>maxParse)
+ return UnkErr;
+ return ParseError[subtype];
+ case 2:
+ if (subtype>maxSyntax)
+ return UnkErr;
+ return SyntaxError[subtype];
+ }
+ return UnkErr;
+}
+
+static char BufError[64];
+
+char *TMLIBase::GetCodeError()
+{
+ ErrorReported=1; // Now we are ready to memorize another error
+ return BufError;
+}
+
+char *TMLIBase::CopyCodeError()
+{// Remmember the error the first time we are called.
+ if (!ErrorReported) return 0;
+ ErrorReported=0;
+
+ char *start=Code-30;
+ memset(BufError,0,64);
+ if (start<StartCode)
+ start=StartCode;
+ int cant=Code-start;
+ strncpy(BufError,start,cant);
+ strcat(BufError,"<*>");
+ strncat(BufError,Code,30);
+ return BufError;
+}
+
+
+#ifdef TEST
+
+char *Code="(('varA' 'Hola que tal' setv) ((varA 4 left) CR (varA 5 substr) print) eval)";
+//char *Code="(('varA' 'Hola que tal' setv) ((varA 4 left) CR (varA 5 substr) print) eval)";
+//char *Code="(0 ('hola' print) ('Es 0' print) if)";
+//char *Code="(\"hola\" (\"chau\" print) print)";
+
+int main()
+{
+ TMLIArraySimple a(10,10);
+ TLispVariableCol v(5,5);
+ TMLIBase Interpreter(&a,&v,stdout);
+ printf("\nOutput of program:\n");
+ TLispVar *val=Interpreter.Interpret(Code);
+ printf("\nReturned:\n");
+ if (val)
+ {
+ val->print(stdout);
+ printf("\nElements in stack: %d\n",Interpreter.array->GetCount());
+ destroyFloatVar(val);
+ }
+ else
+ printf("Error: %X\n",Interpreter.Error);
+ return 0;
+}
+#endif
diff --git a/setedit/sdg/mliasimp.cc b/setedit/sdg/mliasimp.cc
new file mode 100644
index 0000000..50d6098
--- /dev/null
+++ b/setedit/sdg/mliasimp.cc
@@ -0,0 +1,67 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <stdlib.h>
+#define Uses_TLispVar
+#define Uses_TMLIArraySimple
+#include <mli.h>
+
+TMLIArraySimple::TMLIArraySimple(int start, int delt)
+{
+ array=0;
+ delta=delt;
+ size=0;
+ nextsize=start;
+}
+
+TMLIArraySimple::~TMLIArraySimple()
+{
+ int i;
+ for (i=0; i<firstfree; i++)
+ destroyVar(array[i]);
+ free(array);
+ array=0;
+}
+
+void TMLIArraySimple::Push(TLispVar *v)
+{
+ if (firstfree>=size)
+ {
+ array=(TLispVar **)realloc(array,nextsize*sizeof(TLispVar *));
+ size=nextsize;
+ nextsize+=delta;
+ }
+ if (array)
+ array[firstfree++]=v;
+}
+
+TLispVar *TMLIArraySimple::Get(int pos)
+{
+ if (pos>=firstfree || pos<0)
+ return NULL;
+ return array[pos];
+}
+
+TLispVar *TMLIArraySimple::FreeItems(int cant)
+{
+ int h,i;
+
+ if (cant>firstfree-1)
+ cant=firstfree-1;
+ h=firstfree-cant;
+ for (i=h; i<firstfree; i++)
+ destroyVar(array[i]);
+ firstfree=h-1;
+ if (array[firstfree])
+ array[firstfree]->type|=1;
+ return array[firstfree];
+}
+
+void TMLIArraySimple::ReplaceItem(int pos, TLispVar *o)
+{
+ if (pos<firstfree)
+ {
+ destroyVar(array[pos]);
+ array[pos]=o;
+ }
+}
diff --git a/setedit/sdg/mlicsdg.cc b/setedit/sdg/mlicsdg.cc
new file mode 100644
index 0000000..6c6091d
--- /dev/null
+++ b/setedit/sdg/mlicsdg.cc
@@ -0,0 +1,281 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Lisp Interpreter for FRT files
+ Comments:
+ This module defines a derived class from TMLIBase that's suitable for FRT
+files. @x{TMLIBase (class)}.@p
+ The derived interpreter adds support for SDG variables and adds commands
+like cutCprot.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include "ucdefs.h"
+
+#define Uses_TLispVariableCol
+#define Uses_TMLIBase
+#define Uses_TLispBaseVars
+#define Uses_TLispVarDefs
+#define Uses_TMLIArrayBase
+#define Uses_TMLISDG
+#define Uses_TLispSDGstring
+#include <mli.h>
+
+static char *emptyStr="";
+extern char *TakeNum(char *s,int *num);
+
+int TMLISDG::ParseSymbol(int &Params,int &Commands)
+{
+ int num;
+ char *s,*e;
+ int flags;
+
+ if (*Code=='~' && ucisdigit(*(Code+1)))
+ {
+ Code=TakeNum(Code+1,&num);
+ if (getVar(num,s,e,flags))
+ array->Push(new TLispSDGstring(s,e+1,flags));
+ else
+ {
+ s=e=emptyStr;
+ flags=sdgSimpleString | sdgASCIIZ;
+ array->Push(new TLispSDGstring(s,e,flags));
+ }
+ Params++;
+ return 0;
+ }
+ return TMLIBase::ParseSymbol(Params,Commands);
+}
+
+
+int TMLISDG::MLIBooleanValOf(TLispVar *var)
+{
+ if (GroupTypeOf(var)==MLIGSDGvar)
+ {
+ TLispSDGstring *s=(TLispSDGstring *)var;
+ return s->start && s->start[0];
+ }
+ return TMLIBase::MLIBooleanValOf(var);
+}
+
+Command TMLISDG::WhatCommand(char *s)
+{
+ int i;
+ for (i=0; i<MLISDGCommands; i++)
+ if (strcmp(s,cNames[i])==0)
+ return cComms[i];
+ return TMLIBase::WhatCommand(s);
+}
+
+typedef struct
+{
+ char *buf;
+ int len,pos;
+} strCatStruct;
+
+void StrCatInit(char *buf,int len,strCatStruct &s)
+{
+ s.buf=buf;
+ s.len=len-1;
+ s.pos=0;
+}
+
+void StrCatSpaces(int cant,strCatStruct &s)
+{
+ if (s.pos+cant>s.len)
+ cant=s.len-s.pos;
+ for (; cant; s.pos++,cant--) s.buf[s.pos]=' ';
+ s.buf[s.pos]=0;
+}
+
+void StrCat(char *p,strCatStruct &s)
+{
+ for (; *p && s.pos<s.len; s.pos++,p++) s.buf[s.pos]=*p;
+ s.buf[s.pos]=0;
+}
+
+void StrCat(char *p,int cant,strCatStruct &s)
+{
+ for (; cant && *p && s.pos<s.len; s.pos++,p++,cant--) s.buf[s.pos]=*p;
+ s.buf[s.pos]=0;
+}
+
+void StrCat(char val,strCatStruct &s)
+{
+ if (s.pos<s.len)
+ {
+ s.buf[s.pos]=val;
+ s.buf[++s.pos]=0;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the C++ implementation of the sLisp cutCprot command. It reformats
+a C prototype to feet in a requested page width. The routine cuts the
+declaration only after a parameter an tries to align all using the first
+parenthesis as reference.
+
+***************************************************************************/
+
+void MLISDGcutCprot(TMLIBase *o,int start ,int cant)
+{
+ TLispVar *string=NULL;
+ TLispVar *integer1=NULL;
+ TLispVar *integer2=NULL;
+ int error=0,len,indent,lstr;
+ char *s;
+ strCatStruct cat;
+
+ if (cant!=3)
+ {
+ error=MLINumParam;
+ goto CleanUp;
+ }
+ // Get the first parameter
+ string=o->Solve(start);
+ if (GroupTypeOf(string)!=MLIGSDGvar && GroupTypeOf(string)!=MLIGString)
+ {
+ error=MLITypeParam;
+ goto CleanUp;
+ }
+ if (GroupTypeOf(string)==MLIGSDGvar)
+ {
+ TLispSDGstring *p=(TLispSDGstring *)string;
+ s=p->start;
+ if (p->flags & sdgASCIIZ)
+ lstr=strlen(s);
+ else
+ lstr=p->end-s;
+ }
+ else
+ {
+ TLispString *p=(TLispString *)string;
+ s=p->str;
+ lstr=p->len;
+ }
+
+ // Get the second
+ integer1=o->Solve(start+1);
+ if (GroupTypeOf(integer1)!=MLIGInteger)
+ {
+ error=MLITypeParam;
+ goto CleanUp;
+ }
+ len=((TLispInteger *)integer1)->val;
+
+ // And now the third
+ integer2=o->Solve(start+2);
+ if (GroupTypeOf(integer2)!=MLIGInteger)
+ {
+ error=MLITypeParam;
+ goto CleanUp;
+ }
+ indent=((TLispInteger *)integer2)->val;
+
+ // After almost 1Kb of C code I have the parameters :-(
+ #define maxParams 20
+ char *Params[maxParams],*param,v;
+ int Lens[maxParams],numparams,i;
+ numparams=1;
+ v=s[lstr];
+ s[lstr]=0;
+ Params[0]=s;
+ for (param=s; *param && *param!='('; param++);
+ Lens[0]=param-s+1;
+ if (*param)
+ {
+ int level;
+ param++;
+ do
+ {
+ for (;*param && ucisspace(*param); param++);
+ Params[numparams]=param;
+ for (level=0; *param && !((*param==')' || *param==',') && level==0); param++)
+ if (*param=='(')
+ level++;
+ else
+ if (*param==')')
+ level--;
+ if (*param)
+ param++;
+ Lens[numparams]=param-Params[numparams];
+ numparams++;
+ }
+ while (*param && numparams!=(maxParams-1));
+ if (*param)
+ {
+ Params[numparams]=++param;
+ Lens[numparams]=strlen(Params[numparams]);
+ numparams++;
+ }
+
+ int maxLpar=0;
+ for (i=1; i<numparams; i++)
+ if (Lens[i]>maxLpar)
+ maxLpar=Lens[i];
+
+ int parIndent;
+ if (len-maxLpar>Lens[0]+indent)
+ parIndent=Lens[0]+indent;
+ else
+ if (len-maxLpar<indent)
+ parIndent=indent;
+ else
+ parIndent=len-maxLpar;
+
+ int maximorum=parIndent+maxLpar+2;
+ if (Lens[0]+indent+2>maximorum)
+ maximorum=Lens[0]+indent+2;
+ char *rstr=new char[numparams*maximorum];
+
+ StrCatInit(rstr,numparams*maximorum,cat);
+ StrCatSpaces(indent,cat);
+ StrCat(Params[0],Lens[0],cat);
+ int col=indent+Lens[0];
+ for (i=1; i<numparams; i++)
+ {
+ if (col+Lens[i]>len)
+ {
+ StrCat('\n',cat);
+ StrCatSpaces(parIndent,cat);
+ StrCat(Params[i],Lens[i],cat);
+ col=parIndent+Lens[i];
+ }
+ else
+ {
+ StrCat(Params[i],Lens[i],cat);
+ col+=Lens[i];
+ }
+ }
+ s[lstr]=v;
+ MLIRetString(rstr);
+ }
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(integer1);
+ destroyFloatVar(integer2);
+ if (error)
+ {
+ o->Error=error;
+ MLIRetNULL();
+ }
+ return;
+}
+
+char *TMLISDG::cNames[MLISDGCommands]=
+{
+ "cutCprot"
+};
+
+Command TMLISDG::cComms[MLISDGCommands]=
+{
+ MLISDGcutCprot
+};
+
diff --git a/setedit/sdg/mliediti.cc b/setedit/sdg/mliediti.cc
new file mode 100644
index 0000000..b3a0352
--- /dev/null
+++ b/setedit/sdg/mliediti.cc
@@ -0,0 +1,178 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <ctype.h>
+#define Uses_TNoCaseStringCollection
+#include <settvuti.h>
+#define Uses_TLispVariableCol
+#define Uses_TMLIEditor
+#define Uses_TMLIArraySimple
+#define Uses_TLispVar
+#include <mli.h>
+#include <edmsg.h>
+
+int MLIEditorError;
+char *MLIEditorTypeError;
+char *MLIEditorErrorName;
+char *MLIEditorErrorCode;
+
+static TMLIArraySimple *array=0;
+static TLispVariableCol *vars=0;
+static TMLIEditor *Interpreter=0;
+static int okInit=0;
+
+int InitLispEditor(void)
+{
+ if (!okInit)
+ {
+ array=new TMLIArraySimple(10,10);
+ vars=new TLispVariableCol(5,5);
+ if (array && vars)
+ {
+ Interpreter=new TMLIEditor(array,vars,stdout);
+ if (Interpreter)
+ {
+ okInit=1;
+ }
+ }
+ }
+ return okInit;
+}
+
+void DeInitLispEditor(void)
+{
+ if (Interpreter)
+ delete Interpreter;
+ Interpreter=0;
+}
+
+char *InterpretLispEditor(char *s, Boolean print)
+{
+ if (!okInit)
+ {
+ MLIEditorError=0;
+ MLIEditorTypeError=MLIEditorErrorName=MLIEditorErrorCode="";
+ return NULL;
+ }
+
+ if (print)
+ EdShowMessage("Running sLisp macro ...",True);
+ Interpreter->Error=0;
+ TLispVar *val=Interpreter->Interpret(s);
+
+ if (!val)
+ {
+ MLIEditorError=Interpreter->Error;
+ MLIEditorTypeError=Interpreter->GetTypeError();
+ MLIEditorErrorName=Interpreter->GetError();
+ MLIEditorErrorCode=Interpreter->GetCodeError();
+ return NULL;
+ }
+ else
+ {
+ if (print)
+ {
+ char *v=val->toStr();
+ EdShowMessageI(__("Return value:"));
+ EdShowMessage(v);
+ delete[] v;
+ }
+ destroyFloatVar(val);
+ }
+
+ return Interpreter->EndCode+1;
+}
+
+int InterpretLispEditorFile(char *s)
+{
+ while (*s)
+ {
+ if (*s==';')
+ {
+ while (*s && *s!='\n') s++;
+ if (!*s)
+ break;
+ }
+ else
+ if (*s=='(')
+ {
+ s=InterpretLispEditor(s);
+ if (!s)
+ return 0;
+ }
+ s++;
+ }
+ return 1;
+}
+
+extern ccIndex SLPChoose(TNoCaseStringCollection *);
+static ccIndex LastChoose=-1;
+
+int ChooseAndRunLispEditor(void)
+{
+ if (!okInit)
+ return SLP_NO_INIT;
+
+ TMacrosColl *Col=Interpreter->Macros;
+
+ int cant=Col->getCount();
+ if (!cant)
+ return SLP_NO_MACROS;
+
+ ccIndex ind=SLPChoose(Col);
+ if (ind<0)
+ return SLP_OK;
+
+ LastChoose=ind;
+ MLIMacro *m=(MLIMacro *)(Col->at(ind));
+ return InterpretLispEditor(m->start)==NULL ? SLP_ERROR : SLP_OK;
+}
+
+TNoCaseStringCollection *GetMacrosList(void)
+{
+ if (!okInit)
+ return 0;
+
+ return Interpreter->Macros;
+}
+
+int ReRunLastChooseLispEditor(void)
+{
+ if (!okInit)
+ return SLP_NO_INIT;
+
+ TNoCaseStringCollection *Col=Interpreter->Macros;
+ if (LastChoose<0 || LastChoose>=Col->getCount())
+ return SLP_NO_CHOOSE;
+
+ MLIMacro *m=(MLIMacro *)(Col->at(LastChoose));
+ return InterpretLispEditor(m->start)==NULL ? SLP_ERROR : SLP_OK;
+}
+
+int MLIEdSeachAndRunCom(char *name, Boolean verbose)
+{
+ if (!okInit)
+ return SLP_NO_INIT;
+
+ TNoCaseStringCollection *Col=Interpreter->Macros;
+ ccIndex i;
+ ccIndex c=Col->getCount();
+ for (i=0; i<c; i++)
+ {
+ MLIMacro *m=(MLIMacro *)(Col->at(i));
+ if (strcmp(m->Name,name)==0)
+ return InterpretLispEditor(m->start,verbose)==NULL ? SLP_ERROR : SLP_OK;
+ }
+ return SLP_NO_CHOOSE;
+}
+
+int MLIEdIsolateCode(char *start, char *&end)
+{
+ int error;
+ char *ret=TMLIBase::SkipCode(start,error);
+ if (!ret)
+ return SLP_ERROR;
+ end=ret;
+ return SLP_OK;
+}
+
diff --git a/setedit/sdg/mliedito.cc b/setedit/sdg/mliedito.cc
new file mode 100644
index 0000000..6719ab8
--- /dev/null
+++ b/setedit/sdg/mliedito.cc
@@ -0,0 +1,1179 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Lisp Interpreter for the editor
+ Comments:
+ This module defines a derived class from TMLIBase that's suitable for the
+editor. @x{TMLIBase (class)}.@p
+
+***************************************************************************/
+
+#include <configed.h>
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TLispVariableCol
+#define Uses_TMLIBase
+#define Uses_TLispBaseVars
+#define Uses_TLispVarDefs
+#define Uses_TMLIArrayBase
+#define Uses_TMLIEditor
+#define Uses_TLispSDGstring
+#define Uses_MsgBox
+#define Uses_TNoCaseStringCollection
+#define Uses_TStringable // needed for keytrans.h
+#define Uses_TScreen
+#include <settvuti.h>
+#include <mli.h>
+#define Uses_TCEditor_Commands
+#include <ceditor.h>
+#include <rhutils.h>
+#include <dyncat.h>
+#include <runprog.h>
+#include <edmsg.h>
+#define Uses_TKeyTranslate
+#define Uses_TKeySeqCol
+#define Uses_TComSeqCol
+#include <keytrans.h>
+#define Uses_SETAppConst
+#define Uses_SETAppProject
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <edspecs.h>
+
+// Open a file and insert it in the desktop
+// This function should be defined by RHIDE and is already needed
+// by loadfunc.cc. The prototype is defined in setapp.h but this
+// shouldn't be needed by RHIDE.
+extern void OpenFileFromEditor(char *fullName);
+
+extern char *strncpyZ(char *dest, const char *orig, int size);
+extern char *strndup(char *source, int size);
+
+void TMacrosColl::freeItem(void *item)
+{
+ MLIMacro *m=(MLIMacro *)item;
+ delete[] m->start;
+ delete m;
+}
+
+char *TMLIEditor::findAgainStr=NULL;
+char *TMLIEditor::replaceAgainStr=NULL;
+unsigned TMLIEditor::findAgainFlags;
+
+TMLIEditor::TMLIEditor(TMLIArrayBase *a, TLispVariableCol *v, FILE *f) :
+ TMLIBase(a,v,f)
+{
+ Macros=new TMacrosColl();
+}
+
+TMLIEditor::~TMLIEditor()
+{
+ CLY_destroy(Macros);
+ Macros=0;
+ DeleteArray(findAgainStr);
+ DeleteArray(replaceAgainStr);
+}
+
+Command TMLIEditor::WhatCommand(char *s)
+{
+ int i;
+ for (i=0; i<MLIEditorCommands; i++)
+ if (strcmp(s,cNames[i])==0)
+ return cComms[i];
+ return TMLIBase::WhatCommand(s);
+}
+
+TLispVar *TMLIEditor::WhatConstant(char *s)
+{// Editor commands are cmc*
+ if (*s=='c' && *(s+1)=='m' && *(s+2)=='c')
+ {
+ int command=SearchEdCommand(s+3);
+ if (command>=0)
+ return new TLispInteger(command+cmbBaseNumber);
+ }
+ if (*s=='c' && *(s+1)=='m' && *(s+2)=='e')
+ {
+ int command=SearchEditCommand(s+3);
+ if (command>=0)
+ return new TLispInteger(command+cmeBase);
+ }
+ // Editor Flags
+ if (*s=='e' && *(s+1)=='d' && *(s+2)=='f')
+ {
+ unsigned val;
+ if (SearchEditFlag(s+3,val))
+ return new TLispInteger(val);
+ }
+ return TMLIBase::WhatConstant(s);
+}
+
+
+// That's the real send command
+void MLIEditorSendCommand(TMLIBase *o,int start ,int cant)
+{
+ int i,ret=0;
+ LocVarInt(command);
+
+ CheckNumParams(cant<1);
+
+ for (i=0; i<cant; i++)
+ {
+ GetInteger(i,command);
+ if (TMLIEditor::SendCommand(command->val))
+ ret++;
+ destroyFloatVar(command);
+ command=NULL;
+ }
+ MLIRetInt(ret);
+
+CleanUp:
+ destroyFloatVar(command);
+}
+
+// (SendCommands value ...)
+DecFun(MLISendCommNoSel)
+{
+ MLIEditorSendCommand(o,start,cant);
+}
+
+// (SendCommSel value ...)
+/*DecFun(MLISendCommSel)
+{
+ MLIEditorSendCommand(o,start,cant,1);
+}*/
+
+// (InsertText "str" [select] [move])
+DecFun(MLIEditorInsertText)
+{
+ int select=0,move=-1;
+ LocVarStr(string);
+
+ CheckNumParams(cant<1 || cant>3);
+
+ GetString(0,string);
+
+ // Get the select setting
+ if (cant>=2)
+ {
+ TLispVar *p=o->Solve(start+1);
+ select=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ }
+
+ // Get the move
+ if (cant==3)
+ {
+ TLispVar *p=o->Solve(start+2);
+ move=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ }
+
+ MLIRetInt(TMLIEditor::InsertText(string->str,string->len,select,move));
+
+CleanUp:
+ destroyFloatVar(string);
+}
+
+DecFun(MLIdefmacro)
+{
+ ccIndex ind;
+ int len, i;
+ MLIMacro *macro;
+ TMacrosColl *Macros=((TMLIEditor *)o)->Macros;
+ LocVarStr(string);
+ LocVarCode(code);
+
+ CheckNumParams(cant!=2);
+ GetString(0,string);
+ GetCode(1,code);
+
+ for (i=0; i<string->len; i++)
+ CheckForError(string->str[i]=='(' || string->str[i]==')',MLIInvaForName);
+
+ macro=new MLIMacro;
+ // Copy the name
+ len=min(31,string->len);
+ strncpy(macro->Name,string->str,len);
+ macro->Name[len]=0;
+ // Copy the code
+ len=code->end-code->start;
+ macro->start=new char[len+1];
+ memcpy(macro->start,code->start,len);
+ macro->start[len]=0;
+
+ if (Macros->search(macro->Name,ind))
+ { // Exists, so replace it
+ Macros->atFree(ind);
+ }
+ Macros->insert(macro);
+
+ MLIRetInt(1);
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(code);
+}
+
+// (RunProgram "prg1;prg2;..." [options_flags] [compiler])
+DecFun(MLIRunProgram)
+{
+ int Options=0,flags=repDontFork|repDontShowDialog;
+ char *comp="GNU";
+ LocVarStr(string);
+ LocVarInt(option);
+ LocVarStr(compiler);
+
+ CheckNumParams(cant!=1 && cant!=2 && cant!=3);
+ GetString(0,string);
+ if (cant>=2)
+ {
+ GetInteger(1,option);
+ Options=option->val;
+ }
+ if (Options & 1)
+ flags|=repRestoreScreen;
+ if (Options & 2)
+ flags|=repNoRedirOut;
+ if (Options & 4)
+ flags|=repStopDebug;
+ //fprintf(stderr,"Options %d\n",Options);
+ if (cant>=3)
+ {
+ GetString(2,compiler);
+ comp=compiler->str;
+ }
+
+ RunExternalProgram(string->str,flags,comp);
+ MLIRetInt(1);
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(option);
+}
+
+// (RunProgramRedir "prg1;prg2;..." [input_string])
+DecFun(MLIRunProgramRedir)
+{
+ char *s;
+ int l;
+ unsigned flags=repDontShowAsMessage|repDontFork|repDontShowDialog;
+ LocVarStr(string);
+ LocVarStr(input);
+
+ CheckNumParams(cant!=1 && cant!=2);
+
+ GetString(0,string);
+ if (cant==2)
+ {
+ GetString(1,input);
+ RunExternalProgramSetInRedir(input->str,input->len);
+ flags|=repRedirIn;
+ }
+ // Even when strings are stored as char * + len they are ASCIIZ
+ RunExternalProgram(string->str,flags);
+ if (cant==2)
+ RunExternalProgramRemoveInRedir();
+
+ // Ok now we have the redirected result in a file, get it
+ l=0x100000;
+ s=RunExternalProgramGetFile(l);
+ MLIRetStrLenExists(s,l);
+
+CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(input);
+}
+
+//
+// (WhichEditor [n])
+// n is optional by now are supported only:
+// 0 the name as-is (default)
+// 1 the name without extention
+// 2 the path
+// 3 the drive
+// 4 the extention
+// 5 the name of the file without extention
+//
+DecFun(MLIWhichEditor)
+{
+ int Option=0,l;
+ char *s;
+ int remove=0;
+ LocVarInt(option);
+
+ CheckNumParams(cant>1);
+
+ if (cant)
+ {
+ GetInteger(0,option);
+ Option=option->val;
+ }
+
+ s=TMLIEditor::GetEditorName();
+ l=strlen(s);
+ switch (Option)
+ {
+ case 1:
+ {
+ char *lastSlash=strrchr(s,'/');
+ if (!lastSlash)
+ lastSlash=strrchr(s,'\\');
+ char *lastDot=strrchr(s,'.');
+ if (lastDot && (!lastSlash || lastSlash<lastDot))
+ l=lastDot-s;
+ }
+ break;
+ case 2:
+ {
+ char drive,*dir,*name,*ext;
+ DynStrCatStruct str;
+ split_fname(s,drive,dir,name,ext);
+ if (drive)
+ {
+ char tmp[3]={drive,':',0};
+ DynStrCatInit(&str,tmp,2);
+ DynStrCat(&str,dir);
+ s=str.str;
+ l=str.len;
+ string_free(dir);
+ }
+ else
+ {
+ s=dir;
+ l=strlen(dir);
+ }
+ string_free(name);
+ string_free(ext);
+ remove=1;
+ }
+ break;
+ case 3:
+ {
+ char drive,*dir,*name,*ext;
+ split_fname(s,drive,dir,name,ext);
+ s=new char[3];
+ if (drive)
+ {
+ s[0]=drive;
+ s[1]=':';
+ s[2]=0;
+ l=2;
+ }
+ else
+ {
+ s[0]=0;
+ l=0;
+ }
+ string_free(dir);
+ string_free(name);
+ string_free(ext);
+ remove=1;
+ }
+ break;
+ case 4:
+ {
+ char drive,*dir,*name,*ext;
+ split_fname(s,drive,dir,name,ext);
+ s=ext;
+ l=strlen(ext);
+ string_free(dir);
+ string_free(name);
+ remove=1;
+ }
+ break;
+ case 5:
+ {
+ char drive,*dir,*name,*ext;
+ split_fname(s,drive,dir,name,ext);
+ s=name;
+ l=strlen(name);
+ string_free(dir);
+ string_free(ext);
+ remove=1;
+ }
+ break;
+ }
+ MLIRetStrLen(s,l);
+ if (remove)
+ delete s;
+
+CleanUp:
+ destroyFloatVar(option);
+}
+
+DecFun(MLIGetSelection)
+{
+ CheckNumParams(cant!=0);
+
+ int l;
+ char *s=TMLIEditor::GetSelection(l);
+ MLIRetStrLen(s,l);
+}
+
+
+//
+// (WordUnderCursor [n])
+//
+// Returns the word under the cursor, n is the maximun length we will use, 256 by
+// default.
+// Note: if n<4, n is 4. If n>32Kb n is 32Kb
+//
+DecFun(MLIWordUnderCursor)
+{
+ int lenWord=256,Options=0;
+ char *s;
+ LocVarInt(len);
+ LocVarInt(options);
+
+ CheckNumParams(cant>2);
+
+ if (cant)
+ {
+ GetInteger(0,len);
+ lenWord=len->val;
+ // Safety limits, I don't want to crash because the user asked 1Gb ;-)
+ if (lenWord<4)
+ lenWord=4;
+ if (lenWord<0x8000)
+ lenWord=0x8000;
+ if (cant>1)
+ {
+ GetInteger(1,options);
+ Options=options->val;
+ }
+ }
+
+ int l;
+ s=TMLIEditor::GetWordUnderCursor(lenWord,l,Options);
+ MLIRetStrLenExists(s,l);
+
+CleanUp:
+ destroyFloatVar(len);
+}
+
+// (ShowInStatusLine string)
+DecFun(MLIShowInStatusLine)
+{
+ LocVarStr(string);
+
+ CheckNumParams(cant!=1);
+ GetString(0,string);
+ TMLIEditor::ShowInStatusLine(string->str,string->len);
+ MLIRetInt(1);
+
+CleanUp:
+ destroyFloatVar(string);
+}
+
+// (ComplChoose options delimiter [flags])
+DecFun(MLIComplChoose)
+{
+ LocVarStr(options);
+ LocVarStr(delimiter);
+ LocVarInt(oFlags);
+ char *str;
+ unsigned flags=0;
+
+ CheckNumParams(cant!=2 && cant!=3);
+ GetString(0,options);
+ GetString(1,delimiter);
+
+ // Get the flags
+ if (cant>2)
+ {
+ GetInteger(0,oFlags);
+ flags=oFlags->val;
+ }
+
+ str=TMLIEditor::CompletionChoose(options->str,delimiter->str,flags);
+ if (!str)
+ str=newStr("");
+ MLIRetStrLenExists(str,strlen(str));
+
+CleanUp:
+ destroyFloatVar(options);
+ destroyFloatVar(delimiter);
+ destroyFloatVar(oFlags);
+}
+
+// (getenv name)
+DecFun(MLIgetenv)
+{
+ LocVarStr(string);
+ const char *value;
+
+ CheckNumParams(cant!=1);
+ GetString(0,string);
+ value=GetVariable(string->str);
+ if (!value)
+ value="";
+ MLIRetString((char *)value);
+
+CleanUp:
+ destroyFloatVar(string);
+}
+
+DecFun(MLIGetSyntaxAtCursor)
+{
+ CheckNumParams(cant);
+ MLIRetInt(TMLIEditor::GetSyntaxAtCursor());
+}
+
+DecFun(MLIForceUpdate)
+{
+ CheckNumParams(cant);
+ MLIRetInt(TMLIEditor::ForceUpdate());
+}
+
+DecFun(MLIAskString)
+{
+ LocVarStr(title);
+ LocVarStr(message);
+ char *str;
+
+ CheckNumParams(cant!=2);
+
+ GetString(0,title);
+ GetString(1,message);
+ str=TMLIEditor::AskString(title->str,message->str);
+ MLIRetStrLenExists(str,strlen(str));
+
+CleanUp:
+ destroyFloatVar(title);
+ destroyFloatVar(message);
+}
+
+DecFun(MLIOpenFile)
+{
+ LocVarStr(file);
+ LocVarInt(sel);
+ int selectIt=0, number;
+
+ CheckNumParams(cant!=1 && cant!=2);
+
+ GetString(0,file);
+ if (cant==2)
+ {
+ GetInteger(1,sel);
+ selectIt=sel->val;
+ }
+ MLIRetInt(OpenFileFromEditorRet(file->str,number));
+ if (selectIt)
+ TMLIEditor::SelectWindowNumber(number);
+
+CleanUp:
+ destroyFloatVar(file);
+ destroyFloatVar(sel);
+}
+
+DecFun(MLIMessageBox)
+{
+ unsigned ops=mfError|mfOKButton;
+ LocVarStr(message);
+ LocVarInt(options);
+
+ CheckNumParams(cant!=1 && cant!=2);
+
+ GetString(0,message);
+ if (cant>1)
+ {
+ GetInteger(1,options);
+ ops=options->val;
+ }
+
+ MLIRetInt(messageBox(message->str,ops));
+
+CleanUp:
+ destroyFloatVar(message);
+ destroyFloatVar(options);
+}
+
+// (EvalString <string>)
+DecFun(MLIEvalString)
+{
+ CheckNumParams(cant!=1);
+
+ LocVarStr(code);
+ TLispVar *return_value;
+
+ GetString(0,code);
+ return_value=o->Interpret(code->str);
+ destroyFloatVar(code);
+
+ if (!return_value)
+ {
+ MLIRetNULL();
+ return;
+ }
+
+ MLIRetObj(return_value);
+
+CleanUp:
+ return;
+}
+
+// (ShowInMessageWindow var [clean])
+DecFun(MLIShowInMessageWindow)
+{
+ LocVar(value);
+ LocVar(clear);
+ Boolean clearMW=False;
+ char *v;
+ int l;
+
+ CheckNumParams(cant!=1 && cant!=2);
+ GetVar(0,value);
+ if (cant>1)
+ {
+ GetVar(1,clear);
+ clearMW=o->MLIBooleanValOf(clear) ? True : False;
+ }
+
+ v=value->toStr();
+ EdShowMessage(v,clearMW);
+ l=strlen(v);
+ delete[] v;
+ // Return something like printf does
+ MLIRetInt(l);
+
+CleanUp:
+ destroyFloatVar(value);
+ destroyFloatVar(clear);
+}
+
+DecFun(MLISelectionExists)
+{
+ CheckNumParams(cant!=0);
+ MLIRetInt(TMLIEditor::SelectionExists() ? 1 : 0);
+}
+
+// FindString(str [flags])
+DecFun(MLIFindString)
+{
+ unsigned flags=TMLIEditor::GetFindFlags(), ret;
+ LocVarStr(findStr);
+ LocVarInt(findFlags);
+ char *str;
+ unsigned strLen;
+
+ CheckNumParams(cant!=1 && cant!=2);
+ GetString(0,findStr);
+ if (cant>1)
+ {
+ // Get flags
+ GetInteger(1,findFlags);
+ flags=findFlags->val;
+ }
+ ret=TMLIEditor::FindString(findStr->str,flags,str,strLen);
+ if (!str)
+ {
+ str=newStr("");
+ strLen=0;
+ }
+ MLIRetStrLenExists(str,strLen);
+
+CleanUp:
+ destroyFloatVar(findStr);
+ destroyFloatVar(findFlags);
+}
+
+// ReplaceString(to_find replacement [flags])
+DecFun(MLIReplaceString)
+{
+ unsigned flags=TMLIEditor::GetFindFlags(), ret;
+ LocVarStr(findStr);
+ LocVarStr(replaceStr);
+ LocVarInt(findFlags);
+ char *str;
+ unsigned strLen;
+
+ CheckNumParams(cant!=2 && cant!=3);
+ GetString(0,findStr);
+ GetString(1,replaceStr);
+ if (cant>2)
+ {
+ // Get flags
+ GetInteger(2,findFlags);
+ flags=findFlags->val;
+ }
+ ret=TMLIEditor::FindOrReplaceString(findStr->str,replaceStr->str,flags,str,strLen);
+ if (str)
+ DeleteArray(str);
+ MLIRetInt(ret);
+
+CleanUp:
+ destroyFloatVar(findStr);
+ destroyFloatVar(replaceStr);
+ destroyFloatVar(findFlags);
+}
+
+DecFun(MLIFindAgain)
+{
+ char *str;
+ unsigned strLen;
+
+ CheckNumParams(cant);
+ TMLIEditor::FindAgain(str,strLen);
+ if (!str)
+ {
+ str=newStr("");
+ strLen=0;
+ }
+ MLIRetStrLenExists(str,strLen);
+}
+
+DecFun(MLIReplaceAgain)
+{
+ char *str;
+ unsigned strLen;
+
+ CheckNumParams(cant);
+ Boolean ret=TMLIEditor::FindAgain(str,strLen);
+ if (str)
+ DeleteArray(str);
+ MLIRetInt(ret);
+}
+
+DecFun(MLIGetCursorX)
+{
+ CheckNumParams(cant!=0);
+ MLIRetInt(TMLIEditor::GetCursorX());
+}
+
+DecFun(MLIGetCursorY)
+{
+ CheckNumParams(cant!=0);
+ MLIRetInt(TMLIEditor::GetCursorY());
+}
+
+DecFun(MLISetCursorXY)
+{
+ int x,y;
+ LocVarInt(X);
+ LocVarInt(Y);
+
+ CheckNumParams(cant<1);
+ GetInteger(0,X);
+ x=X->val;
+ if (cant>1)
+ {
+ GetInteger(1,Y);
+ y=Y->val;
+ }
+ else
+ y=TMLIEditor::GetCursorY();
+ TMLIEditor::SetCursorXY(x,y);
+ // We must return something and y is optional
+ MLIRetInt(TMLIEditor::GetCursorY());
+
+CleanUp:
+ destroyFloatVar(X);
+ destroyFloatVar(Y);
+}
+
+DecFun(MLIGetSyntaxLang)
+{
+ CheckNumParams(cant!=0);
+ MLIRetString(TMLIEditor::GetSyntaxLang());
+}
+
+DecFun(MLISelectWindowNumber)
+{
+ LocVarInt(n);
+
+ CheckNumParams(cant<1);
+ GetInteger(0,n);
+ MLIRetInt(TMLIEditor::SelectWindowNumber(n->val));
+
+CleanUp:
+ destroyFloatVar(n);
+}
+
+DecFun(MLICloseWindowNumber)
+{
+ LocVarInt(n);
+
+ CheckNumParams(cant<1);
+ GetInteger(0,n);
+ MLIRetInt(TMLIEditor::CloseWindowNumber(n->val));
+
+CleanUp:
+ destroyFloatVar(n);
+}
+
+DecFun(MLIGetCurWindowNumber)
+{
+ CheckNumParams(cant!=0);
+ MLIRetInt(TMLIEditor::GetCurWindowNumber());
+}
+
+DecFun(MLIGetMaxWindowNumber)
+{
+ CheckNumParams(cant!=0);
+ MLIRetInt(TMLIEditor::GetMaxWindowNumber());
+}
+
+// (GetWindowCols [window_number])
+DecFun(MLIGetWindowCols)
+{
+ int wn;
+ LocVarInt(window_number);
+
+ CheckNumParams(cant>1);
+
+ // Optional window number
+ if (!cant)
+ wn=TMLIEditor::GetCurWindowNumber();
+ else
+ {
+ GetInteger(0,window_number);
+ wn=window_number->val;
+ }
+
+ MLIRetInt(TMLIEditor::GetWindowCols(wn));
+CleanUp:
+ destroyFloatVar(window_number);
+}
+
+// (GetWindowRows [window_number])
+DecFun(MLIGetWindowRows)
+{
+ int wn;
+ LocVarInt(window_number);
+
+ CheckNumParams(cant>1);
+
+ // Optional window number
+ if (!cant)
+ wn=TMLIEditor::GetCurWindowNumber();
+ else
+ {
+ GetInteger(0,window_number);
+ wn=window_number->val;
+ }
+
+ MLIRetInt(TMLIEditor::GetWindowRows(wn));
+CleanUp:
+ destroyFloatVar(window_number);
+}
+
+// (GetWrapCol [window_number])
+DecFun(MLIGetWrapCol)
+{
+ int wn;
+ LocVarInt(window_number);
+
+ CheckNumParams(cant>1);
+
+ // Optional window number
+ if (!cant)
+ wn=TMLIEditor::GetCurWindowNumber();
+ else
+ {
+ GetInteger(0,window_number);
+ wn=window_number->val;
+ }
+
+ MLIRetInt(TMLIEditor::GetWrapCol(wn));
+CleanUp:
+ destroyFloatVar(window_number);
+}
+
+// (KeyBindings keyBindOp [keyBindOp ...])
+DecFun(MLIKeyBindings)
+{
+ int i, abortOperation=0;
+ LocVarKeyBind(key);
+
+ CheckNumParams(cant<1);
+
+ if (!TMLIEditor::StartKeyBind())
+ {// Most probably a nested call
+ MLIRetInt(0);
+ goto CleanUp;
+ }
+ abortOperation=1;
+ for (i=0; i<cant; i++)
+ {
+ GetKeyBind(i,key);
+ if (!TMLIEditor::BindKey(key->sKeys,key->data,key->bindType))
+ {
+ MLIRetInt(0);
+ goto CleanUp;
+ }
+ destroyFloatVar(key);
+ key=NULL;
+ }
+ MLIRetInt(1);
+ abortOperation=0;
+ TMLIEditor::EndKeyBind();
+
+CleanUp:
+ destroyFloatVar(key);
+ if (abortOperation)
+ TMLIEditor::AbortKeyBind();
+}
+
+TLispKeyBind::TLispKeyBind(TKeySeqCol *aSKeys, void *aData, int aBindType)
+{
+ sKeys=aSKeys;
+ data=aData;
+ bindType=aBindType;
+ type=MLITypeKeyBind;
+}
+
+TLispKeyBind::~TLispKeyBind()
+{
+ if (bindType!=kbtDelOp)
+ {
+ CLY_destroy(sKeys);
+ if (bindType==kbtIsSeq)
+ CLY_destroy((TComSeqCol *)data);
+ else
+ delete[] (char *)data;
+ }
+}
+
+int TLispKeyBind::print(FILE *) { return 0; }
+char *TLispKeyBind::toStr() { return NULL; }
+
+TKeySeqCol *ParseKeySeq(char *str, int len)
+{
+ ushort code;
+ // Make a local copy
+ AllocLocalStr(s,len+1);
+ memcpy(s,str,len);
+ s[len]=0;
+ // Create the collection
+ TKeySeqCol *ret=new TKeySeqCol(2,2);
+ // Parse it
+ char *key=strtok(s,", ");
+ do
+ {
+ if (InterpretKeyName(key,code))
+ {
+ CLY_destroy(ret);
+ return NULL;
+ }
+ ret->insert(code);
+ key=strtok(NULL,", ");
+ }
+ while (key);
+
+ return ret;
+}
+
+// (BindKey "key1,key2" command [commands ...])
+// (BindKey "key1,key2" "macro")
+DecFun(MLIBindKey)
+{
+ LocVarStr(keySeqStr);
+ LocVar(first);
+ LocVarInt(command);
+ TKeySeqCol *seq=NULL;
+ TComSeqCol *comms=NULL;
+ int i;
+
+ CheckNumParams(cant<2);
+
+ // Get the key sequence
+ GetString(0,keySeqStr);
+ seq=ParseKeySeq(keySeqStr->str,keySeqStr->len);
+ CheckForError(!seq,MLIInvaKeySeq);
+
+ // Get the first as a generic variable to determine the type
+ GetVar(1,first);
+ switch (GroupTypeOf(first))
+ {
+ case MLIGInteger:
+ // Commands
+ comms=new TComSeqCol(2,2);
+ comms->insert(MLIAsIntVal(first));
+ for (i=2; i<cant; i++)
+ {
+ GetInteger(i,command);
+ comms->insert(command->val);
+ destroyFloatVar(command);
+ command=NULL;
+ }
+ MLIRetKeyBind(seq,comms,kbtIsSeq);
+ // They are now part of the return value
+ comms=NULL;
+ seq=NULL;
+ break;
+ case MLIGString:
+ // A macro or sLisp code
+ CheckForError(cant>2,MLINumParam);
+ MLIRetKeyBind(seq,strdup(MLIAsStrVal(first)),kbtIsMacro);
+ // Now part of the return value
+ seq=NULL;
+ break;
+ default:
+ CheckForError(1,MLITypeParam);
+ }
+
+CleanUp:
+ destroyFloatVar(keySeqStr);
+ destroyFloatVar(first);
+ destroyFloatVar(command);
+ CLY_destroy(comms);
+ CLY_destroy(seq);
+}
+
+// (GetSystemInfo which)
+DecFun(MLIGetSystemInfo)
+{
+ LocVarInt(which);
+
+ CheckNumParams(cant!=1);
+
+ GetInteger(0,which);
+ switch (which->val)
+ {
+ case edfInfTVDriver:
+ MLIRetString(TScreen::getDriverShortName());
+ break;
+ case edfInfOS:
+ MLIRetString(SEOS_STR);
+ break;
+ case edfInfOSFlavor:
+ #ifdef SEOSf_STR
+ MLIRetString(SEOSf_STR);
+ #else
+ MLIRetString("");
+ #endif
+ break;
+ case edfInfCPU:
+ MLIRetString(SECPU_STR);
+ break;
+ case edfInfCompiler:
+ MLIRetString(SEComp_STR);
+ break;
+ case edfInfCompilerFlavor:
+ #ifdef SECompf_STR
+ MLIRetString(SECompf_STR);
+ #else
+ MLIRetString("");
+ #endif
+ break;
+ default:
+ MLIRetString("");
+ }
+
+CleanUp:
+ destroyFloatVar(which);
+}
+
+DecFun(MLIGetProjectItem)
+{
+ LocVarInt(n);
+ char *ori;
+
+ CheckNumParams(cant<1);
+ GetInteger(0,n);
+ ori=GetProjectItem(n->val);
+ MLIRetString(ori);
+ string_free(ori);
+
+CleanUp:
+ destroyFloatVar(n);
+}
+
+DecFun(MLIGetMaxProjectItem)
+{
+ CheckNumParams(cant!=0);
+ MLIRetInt(GetMaxProjectItem());
+}
+
+char *TMLIEditor::cNames[MLIEditorCommands]=
+{
+ "SendCommands",
+ "InsertText",
+ //"SendCommSel",
+ "defmacro",
+ "RunProgram",
+ "WhichEditor",
+ "GetSelection",
+ "WordUnderCursor",
+ "RunProgramRedir",
+ "ShowInStatusLine",
+ "ComplChoose",
+ "getenv",
+ "GetSyntaxAtCursor",
+ "ForceUpdate",
+ "AskString",
+ "OpenFile",
+ "MessageBox",
+ "EvalString",
+ "ShowInMessageWindow",
+ "SelectionExists",
+ "FindString",
+ "GetCursorX",
+ "GetCursorY",
+ "SetCursorXY",
+ "GetSyntaxLang",
+ "FindAgain",
+ "ReplaceString",
+ "ReplaceAgain",
+ "SelectWindowNumber",
+ "GetCurWindowNumber",
+ "GetMaxWindowNumber",
+ "KeyBindings",
+ "BindKey",
+ "GetSystemInfo",
+ "GetProjectItem",
+ "GetMaxProjectItem",
+ "CloseWindowNumber",
+ "GetWindowCols",
+ "GetWindowRows",
+ "GetWrapCol"
+};
+
+Command TMLIEditor::cComms[MLIEditorCommands]=
+{
+ MLISendCommNoSel,
+ MLIEditorInsertText,
+ //MLISendCommSel,
+ MLIdefmacro,
+ MLIRunProgram,
+ MLIWhichEditor,
+ MLIGetSelection,
+ MLIWordUnderCursor,
+ MLIRunProgramRedir,
+ MLIShowInStatusLine,
+ MLIComplChoose,
+ MLIgetenv,
+ MLIGetSyntaxAtCursor,
+ MLIForceUpdate,
+ MLIAskString,
+ MLIOpenFile,
+ MLIMessageBox,
+ MLIEvalString,
+ MLIShowInMessageWindow,
+ MLISelectionExists,
+ MLIFindString,
+ MLIGetCursorX,
+ MLIGetCursorY,
+ MLISetCursorXY,
+ MLIGetSyntaxLang,
+ MLIFindAgain,
+ MLIReplaceString,
+ MLIReplaceAgain,
+ MLISelectWindowNumber,
+ MLIGetCurWindowNumber,
+ MLIGetMaxWindowNumber,
+ MLIKeyBindings,
+ MLIBindKey,
+ MLIGetSystemInfo,
+ MLIGetProjectItem,
+ MLIGetMaxProjectItem,
+ MLICloseWindowNumber,
+ MLIGetWindowCols,
+ MLIGetWindowRows,
+ MLIGetWrapCol
+};
+
+
diff --git a/setedit/sdg/mlisdg.cc b/setedit/sdg/mlisdg.cc
new file mode 100644
index 0000000..76ce9e2
--- /dev/null
+++ b/setedit/sdg/mlisdg.cc
@@ -0,0 +1,93 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#define Uses_TLispVariableCol
+#define Uses_TMLISDG
+#define Uses_TLispSDGstring
+#define Uses_TMLIArraySimple
+#include <mli.h>
+
+extern void OutPutString(char *s, char *e,FILE *f);
+extern char *TakeNum(char *s,int *num);
+
+TLispSDGstring::~TLispSDGstring()
+{
+ if (flags & sdgFreeIt)
+ delete start;
+}
+
+int TLispSDGstring::print(FILE *s)
+{
+ char v=0; // can be used unitialized!?
+ int ret;
+
+ if (flags & sdgSimpleString)
+ {
+ if (!(flags & sdgASCIIZ))
+ {
+ v=*end;
+ *end=0;
+ }
+ fputs(start,s);
+ if (flags & sdgASCIIZ)
+ ret=strlen(start);
+ else
+ {
+ ret=end-start;
+ *end=v;
+ }
+ }
+ else
+ {
+ if (flags & sdgASCIIZ)
+ {
+ ret=strlen(start);
+ OutPutString(start,start+ret,s);
+ }
+ else
+ {
+ ret=end-start;
+ OutPutString(start,end,s);
+ }
+ }
+ return ret;
+}
+
+char *TLispSDGstring::toStr()
+{// Not implemented
+ return newStr("");
+}
+
+int MLISDGError;
+char *MLISDGTypeError;
+char *MLISDGErrorName;
+char *MLISDGErrorCode;
+
+char *InterpretLispCode(char *s,getVarFunction getVar,FILE *f)
+{
+ TMLIArraySimple a(10,10);
+ TLispVariableCol v(5,5);
+ TMLISDG Interpreter(&a,&v,f);
+ Interpreter.SetGetVar(getVar);
+ TLispVar *val=Interpreter.Interpret(s);
+/* if (val)
+ {
+ val->print(stdout);
+ printf("\nElements in stack: %d\n",Interpreter.array->GetCount());
+ destroyFloatVar(val);
+ }
+ else*/
+ if (!val)
+ {
+ MLISDGError=Interpreter.Error;
+ MLISDGTypeError=Interpreter.GetTypeError();
+ MLISDGErrorName=Interpreter.GetError();
+ MLISDGErrorCode=Interpreter.GetCodeError();
+ return NULL;
+ }
+ else
+ destroyFloatVar(val);
+ return Interpreter.EndCode+1;
+}
diff --git a/setedit/sdg/multi.frt b/setedit/sdg/multi.frt
new file mode 100644
index 0000000..7c59e48
--- /dev/null
+++ b/setedit/sdg/multi.frt
@@ -0,0 +1,328 @@
+# -*-sdg-*-
+# This file sets the behavior of the txh generator
+#
+# Lines starting with # or spaces are skiped except in strings or in [Generate]
+# Be carefull with [ it delimits sections!
+#
+
+[Configuration]
+#
+# The CommandLine indicates what postprocess program is called.
+# ~0 is the name of the input file.
+# ~1 is the name of the output file.
+# ~90 The path for includes
+#
+# This file can generate .info, .html and .txt files so 3 command
+# lines are provided.
+#
+CommandLine=makeinfo --no-validate --fill-column 78 -I ~90 -o ~1.info ~0
+Name=Info (.info) file format
+CommandLine=makeinfo --no-validate --fill-column 78 -I ~90 -Dhtml -o ~1.html ~0
+Name=HTML file format
+CommandLine=makeinfo --no-validate --fill-column 78 -I ~90 -Dtext -o ~1.txt ~0
+Name=Text (.txt) file format
+
+[Delimiters]
+# Up to 11 characters
+SectionStart=/**[txh]**
+# Up to 11 characters
+SectionEnd=*********/
+
+[Variables]
+#
+# Up to 16 definitions
+#
+# Codes for the behavior of the definitions:
+# 1 Normal, put the content if found.
+# 2 Repeat, use the last value found in the file, ~no is an exeption, ~clear stops
+# 3 If not found replace by the prototype.
+# 4 If not found replace by the class.
+# 5 If not found replace by the name of the function
+# 6 It disables the node generation for this comment. The variable is
+# stored in the first variable that have associations and is in the comment.
+#
+# Additionally there are 2 special variables:
+# 90 Name of the file
+# 91 Line number of the end of the comment
+# 92 Name of the var 0 in the format: ~0 ~~Distinguish{(~Distinguish)~} (node name)
+#
+# 0 The first variable is the main index variable
+#
+AddDefinition=Function,5
+# 1
+AddDefinition=Class,4
+# 2
+AddDefinition=Include,2
+# 3
+AddDefinition=Module,2
+# 4
+AddDefinition=Prototype,3
+# 5
+AddDefinition=Description,1
+# 6
+AddDefinition=Return,1
+# 7
+AddDefinition=Example,1
+# 8
+AddDefinition=Comments,6
+#
+# It says what variable is added to distinguish between 2 vars 0 that are equal
+#
+Distinguish=1
+
+[Associations]
+#
+# Up to 8 associations
+#
+# The associations are between the 0 variable and another variable.
+#
+# Name in main menu, node, variable, optional to add to each node
+#
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+
+[Replace]
+#
+# All must be delimited by ", use as many as you need. They can be used
+# in the GenMain section.
+#
+# Be carreful the strings are passed by the macro expander.
+#
+# Name of the generated file
+Constant="documen.info"
+
+# Name of the documentation manual, title in HTML
+Constant="My documentation"
+
+# Copyright for info files
+Constant="This file documents the functions of my library
+@p
+Copyright 1997
+@p
+Permission is granted to copy this documentation for free.
+@p"
+
+# Name of the printed manual
+Constant="My documentation"
+
+# Author
+Constant="SET"
+
+# Copyright page
+Constant="Copyright @copyright@<{}> 1997
+@p
+Published by SET
+@p
+Permission is granted to copy this documentation for free."
+
+# Description for info files
+Constant="This document describes the functions of my library
+@p
+This document applies to version 0.0.1
+of the program named A Real World
+@p"
+
+[Commands]
+#
+# @p = end of paragraph
+#
+EndOfPar=@paragraph{}
+#
+# @* = break line
+#
+BreakLine=@*
+#
+# @{value} is the special cross ref.
+# ~0 Is the visible name of a reference
+# ~1 Is the real name of a reference
+#
+CrossRef=@xref{~1~~0{,~0~}}
+#
+# What we must get from a @@ sequence
+#
+Double@=@@
+
+[DefinedCommands]
+#
+# The format is @<name>{parameters ...}
+#
+subtitle=@_subheading{~0}
+pre=@example{}
+/pre=@end_example
+
+#
+# This section says how to translate ASCIIs
+#
+[ASCIIConvert]
+=@aacute{}
+=@eacute{}
+=@iacute{}
+=@oacute{}
+=@uacute{}
+=@ntilde{}
+=@Ntilde{}
+=@exclamdown{}
+=@questiondown{}
+=@auml{}
+=@euml{}
+=@iuml{}
+=@ouml{}
+=@uuml{}
+=@Uuml{}
+=@agrave{}
+=@egrave{}
+=@igrave{}
+=@ograve{}
+=@ugrave{}
+{=@{
+}=@}
+<=@lessthan{}
+>=@greaterthan{}
+
+#
+# Use ~number to use one variable
+# Use ~~number{} for conditional, all the code inside {} will become
+# conditional
+#
+[GenNode]
+@node{~92,~90,~~1{~1~},~~3{~3~}}
+@chapter ~0 (~90 ~91)
+
+@_subheading{Syntax}
+
+~~2{@example
+# This line is a comment, but the next is code
+ #include @lessthan{}~2@greaterthan{}
+@end_example~}
+~~4{@example
+ ~4;
+@end_example~}
+~~1{
+@_subheading{Member of the class:}
+~1
+~}
+
+~~5{
+@_subheading{Description}
+
+~5
+~}
+~~6{
+@_subheading{Return Value}
+
+~6
+~}
+~~7{
+@_subheading{Example}
+
+~7
+~}
+@separatenode{}
+@c ----------------------------------------------------------------------
+
+[GenMenu]
+Start=@menu
+#
+# ~1 is the visible name
+# ~2 is the name of the node
+#
+Entry=@mitem{~1,~2}
+End=@end_menu{}
+
+#
+# ~1 is the name of the association
+# ~2 is the menu for it
+#
+[GenAssoMain]
+@node{~1,Top}
+@section ~1
+
+~2
+#
+# ~1 is the name of the association
+# ~2 is the name without the distinguish
+# ~3 is the comment for it
+# ~4 is the menu for it
+#
+[GenAssoRest]
+@node{~1,Top}
+@section ~2
+
+~3
+
+~4
+
+#
+# ~1 Main menu
+# ~2 Name of the function list node
+# ~3 Menu for all the functions
+# ~4 All the associations code
+# ~5 All the function nodes
+# ~50+ Values from section Replace
+#
+[GenMain]
+\input texinfo @c -*-texinfo-*-
+@c %%**start of header
+@setfilename ~50
+@settitle ~51
+@setchapternewpage odd
+@c %%**end of header
+
+@ifset html
+@include txhgen-i.htm
+@html
+@end ifset
+
+@ifset text
+@include txhgen-i.txt
+@end ifset
+
+@ifclear text
+@ifclear html
+@include txhgen-i.txi
+@end ifclear
+@end ifclear
+
+@ifinfo
+~52
+@end ifinfo
+
+@c This title page illustrates only one of the
+@c two methods of forming a title page.
+
+@titlepage
+@title ~53
+@author ~54
+
+@c The following two commands
+@c start the copyright page.
+@page
+@vskip 0pt plus 1filll
+~55
+@end titlepage
+
+@node{Top}
+
+@ifset html
+@htmltitle{~51}
+@end ifset
+
+@ifinfo
+~56
+@end ifinfo
+
+~1
+
+@node{~2,Top}
+@section ~2
+
+~3
+
+~4
+
+~5
+
+@contents
+@bye
+
diff --git a/setedit/sdg/sdg.his b/setedit/sdg/sdg.his
new file mode 100644
index 0000000..9d09e84
--- /dev/null
+++ b/setedit/sdg/sdg.his
@@ -0,0 +1,29 @@
+That's the history file of the SET's Documentation Generator:
+
+29/07/97
+ First alpha release sent to: Laszlo Molnar, Robert Hoehne and George Foot
+v0.0.1
+30/07/97
+ Enhanced the reported errors.
+01/08/97
+ Defined the interface to SDG to be modular.
+02-03/08/97
+ Added left, right, substr, gstr, sstr, setv and eval to the Lisp
+interpreter
+ Added vars and CR constant to the interpreter.
+04/08/97
+ Cleaned the includes and made through a distributor file.
+ Sent to DWI the Alpha 0.0.1.
+ Moved from the under-development dir to the sdg dir.
+05/08/97
+ Interface with the editor.
+ Sent to StarLost the Alpha 0.0.1
+ Changed the extern copy to one internal (Robert's sugestion).
+ Fixed wrong references in HTML files with multi.frt (Robert's report).
+ Added Up and Previous in info files but not in the right way ( " " ).
+06/08/97
+ Messages in the editor.
+ Dialog to set the parameters.
+ Save/Restore values.
+ TXHFilesDir to allow the search of .frt files in other directory.
+ Added ~90 in the command lines to allow -I TXHFilesDir.
diff --git a/setedit/sdg/tex.frt b/setedit/sdg/tex.frt
new file mode 100644
index 0000000..fe41d74
--- /dev/null
+++ b/setedit/sdg/tex.frt
@@ -0,0 +1,292 @@
+# -*-sdg-*-
+# This file sets the behavior of the txh generator
+#
+# Lines starting with # or spaces are skiped except in strings or in [Generate]
+# Be carefull with [ it delimits sections!
+#
+
+[Configuration]
+#
+# The CommandLine indicates what postprocess program is called.
+# ~0 is the name of the input file.
+# ~1 is the name of the output file.
+# ~90 The path for includes
+#
+# This file can generate .info, .html and .txt files so 3 command
+# lines are provided.
+#
+CommandLine="makeinfo --no-validate -I ~90 -E ~1 -o ~1.tmp ~0;tex ~1;texindex ~1.??;tex ~1;dvips -o ~1.ps ~1.dvi"
+Name="DVI and Postscript format with Tex"
+
+[Delimiters]
+# Up to 11 characters
+SectionStart=/**[txh]**
+# Up to 11 characters
+SectionEnd=*********/
+
+[Variables]
+#
+# Up to 16 definitions
+#
+# Codes for the behavior of the definitions:
+# 1 Normal, put the content if found.
+# 2 Repeat, use the last value found in the file, ~no is an exeption, ~clear stops
+# 3 If not found replace by the prototype.
+# 4 If not found replace by the class.
+# 5 If not found replace by the name of the function
+# 6 It disables the node generation for this comment. The variable is
+# stored in the first variable that have associations and is in the comment.
+#
+# Additionally there are 2 special variables:
+# 90 Name of the file
+# 91 Line number of the end of the comment
+# 92 Name of the var 0 in the format: ~0 ~~Distinguish{(~Distinguish)~} (node name)
+#
+# 0 The first variable is the main index variable
+#
+AddDefinition=Function,5
+# 1
+AddDefinition=Class,4
+# 2
+AddDefinition=Include,2
+# 3
+AddDefinition=Module,2
+# 4
+AddDefinition=Prototype,3
+# 5
+AddDefinition=Description,1
+# 6
+AddDefinition=Return,1
+# 7
+AddDefinition=Example,1
+# 8
+AddDefinition=Comments,6
+#
+# It says what variable is added to distinguish between 2 vars 0 that are equal
+#
+Distinguish=1
+
+[Associations]
+#
+# Up to 8 associations
+#
+# The associations are between the 0 variable and another variable.
+#
+# Name in main menu, node, variable, optional to add to each node
+#
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+
+[Replace]
+#
+# All must be delimited by ", use as many as you need. They can be used
+# in the GenMain section.
+#
+# Be carreful the strings are passed by the macro expander.
+#
+# Name of the generated file
+Constant="documen.info"
+
+# Name of the documentation manual, title in HTML
+Constant="My documentation"
+
+# Copyright for info files
+Constant="This file documents the functions of my library
+@p
+Copyright 1997
+@p
+Permission is granted to copy this documentation for free.
+@p"
+
+# Name of the printed manual
+Constant="My documentation"
+
+# Author
+Constant="SET"
+
+# Copyright page
+Constant="Copyright @copyright@<{}> 1997
+@p
+Published by SET
+@p
+Permission is granted to copy this documentation for free."
+
+# Description for info files
+Constant="This document describes the functions of my library
+@p
+This document applies to version 0.0.1
+of the program named A Real World
+@p"
+
+[Commands]
+#
+# @p = end of paragraph
+#
+EndOfPar="@sp 1"
+#
+# @* = break line
+#
+BreakLine="@*"
+#
+# @{value} is the special cross ref.
+# ~0 Is the visible name of a reference
+# ~1 Is the real name of a reference
+#
+CrossRef="@ref{~1~~0{,~0~}}"
+#
+# What we must get from a @@ sequence
+#
+Double@=@@
+
+[DefinedCommands]
+#
+# The format is @<name>{parameters ...}
+#
+subtitle="@subheading ~0"
+pre="@example"
+/pre="@end example"
+
+#
+# This section says how to translate ASCIIs
+#
+[ASCIIConvert]
+="@'a"
+="@'e"
+="@'i"
+="@'o"
+="@'u"
+=@~n
+=@~N
+=@exclamdown{}
+=@questiondown{}
+="@\"a"
+="@\"e"
+="@\"i"
+="@\"o"
+="@\"u"
+="@\"U"
+=@`a
+=@`e
+=@`i
+=@`o
+=@`u
+{=@{
+}=@}
+
+#
+# Use ~number to use one variable
+# Use ~~number{} for conditional, all the code inside {} will become
+# conditional
+#
+[GenNode]
+@node ~92 ~~3{,~3~}
+@section ~0 (~90 ~91)
+
+@subheading Syntax
+
+~~2{@example
+# This line is a comment, but the next is code
+ #include <~2>
+@end example~}
+~(if ~4 (print '@example\n' (cutCprot ~4 64 1) ';\n@end example'))
+~~1{
+@subheading Member of the class:
+~1
+~}
+
+~~5{
+@subheading Description
+
+~5
+~}
+~~6{
+@subheading Return Value
+
+~6
+~}
+~~7{
+@subheading Example
+
+~7
+~}
+@c ----------------------------------------------------------------------
+
+[GenMenu]
+Start="@itemize @bullet"
+#
+# ~1 is the visible name
+# ~2 is the name of the node
+#
+Entry="@item @ref{~2,~1}."
+End="@end itemize"
+
+#
+# ~1 is the name of the association
+# ~2 is the menu for it
+#
+[GenAssoMain]
+@node ~1,Top
+@chapter ~1
+
+~2
+#
+# ~1 is the name of the association
+# ~2 is the name without the distinguish
+# ~3 is the comment for it
+# ~4 is the menu for it
+#
+[GenAssoRest]
+@node ~1,Top
+@section ~2
+
+~3
+
+~4
+
+#
+# ~1 Main menu
+# ~2 Name of the function list node
+# ~3 Menu for all the functions
+# ~4 All the associations code
+# ~5 All the function nodes
+# ~50+ Values from section Replace
+#
+[GenMain]
+\input texinfo @c -*-texinfo-*-
+@c %%**start of header
+@setfilename ~50
+@settitle ~51
+@setchapternewpage odd
+@c %%**end of header
+
+@finalout
+
+@titlepage
+@title ~53
+@author ~54
+
+@page
+@vskip 0pt plus 1filll
+~55
+@end titlepage
+
+@ifinfo
+@node Top
+@top Main list of chapters
+
+~1
+@end ifinfo
+
+@node ~2,Top
+@chapter ~2
+
+~3
+
+~5
+
+~4
+
+@contents
+@bye
+
diff --git a/setedit/sdg/txhgen-i.htm b/setedit/sdg/txhgen-i.htm
new file mode 100644
index 0000000..2e340d9
--- /dev/null
+++ b/setedit/sdg/txhgen-i.htm
@@ -0,0 +1,582 @@
+@c rhidemac.htm: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making RHIDE documentation in HTML format.
+@c
+@c Author: Salvador Eduardo Tropea (salvador@inti.edu.ar), is a modified
+@c version of the one created by (July, 1997):
+@c
+@c Author: Robert Hhne (robert.hoehne@mathematik.tu-chemitz.de)
+@c November 1996.
+@c
+@c Derived from 'faqmacros.txi', which is part of DJGPP FAQ written
+@c by Eli Eli Zaretskii (eliz@is.elta.co.il)
+@c
+@c Many ideas taken from files `multifmt.texi' and html.texi'
+@c written by Brian J. Fox and distributed with GNU Texinfo archive:
+@c
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@c
+@c -------------------------------------------------------------------------
+
+@c
+@c This creates a standard HTML prolog.
+@c
+@macro html
+<html>
+
+<pre>
+
+<!--- This HTML file has been created by Texinfo on @today{}.
+
+@c That's a funny warning:
+---- Please don't look at it but through your Web browser: ---
+---- it looks ugly and ain't supposed to be read by humans. ---
+---- You HAVE been warned! --->
+
+</pre>
+@end macro
+
+@c
+@c TITLEs for HTML
+@c
+@macro htmltitle{line}
+<head>@*
+@w{<TITLE> \line\ </TITLE>}@*
+</head>@*
+<body>@*
+@w{<H1> \line\ </H1>}@*
+@end macro
+
+@macro htmlsubtitle{line}
+@w{<h2> \line\ </h2>}@*
+@end macro
+
+@macro htmlauthor{line}
+@w{<ADDRESS> \line\ </ADDRESS>}@*
+@end macro
+
+
+@c
+@c When making HTML output, @bye does some cleanup.
+@c
+@macro bye
+</body>@*
+</html>@*
+@bye
+@end macro
+
+@c
+@c @anchor{Brian Fox, http://www.ua.com/users/bfox/}
+@c
+@macro anchor{text, link}
+@w{<a href="\link\">\text\</a>}
+@end macro
+
+@macro paragraph{}
+<p>
+@end macro
+
+@c
+@c @mail{Eli Zaretskii, eliz@@is.elta.co.il}
+@c
+@macro mail{name, address}
+@w{<a href="mailto:\address\">\name\</a>}
+@end macro
+
+@c
+@c @ftp{SimTel, ftp.coast.net/SimTel/vendors/djgpp/}
+@c
+@macro ftp{desc, path}
+@w{<a href="ftp://\path\">\desc\</a>}
+@end macro
+
+@c
+@c @ftpdir{ftp.coast.net, /SimTel/vendors/djgpp}
+@c
+@macro ftpdir{host, dir}
+@w{<a href="ftp://\host\\dir\/">\host\</a>}
+@end macro
+
+@c
+@c ftpusr{riceng.rice.edu, login: ezgcc, passwd: ezgcc}
+@c
+@macro ftpusr{desc, host, login, passwd}
+@w{<a href="ftp://\login\:\passwd\@@\host\/">\desc\</a>}
+@end macro
+
+@c
+@c @www{DJGPP server, www.delorie.com/djgpp/}
+@c
+@macro www{desc, path}
+@w{<a href="http://\path\">\desc\</a>.}
+@end macro
+
+@c
+@c @gopher{SimTel, ftp.coast.net/SimTel/vendors/djgpp/}
+@c
+@macro gopher{desc, path}
+@w{<a href="gopher://\path\">\desc\</a>}
+@end macro
+
+@c
+@c @news{comp.os.msdos.djgpp}
+@c
+@macro news{name}
+@w{<a href="news:\name\">\name\</a>}
+@end macro
+
+@c
+@c Redefine the TeXinfo commands which have direct HTML counterparts.
+@c
+
+@macro html-define-0arg{command, html-insertion}
+@macro \command\
+@w{\html-insertion\}
+@end macro
+@end macro
+
+@macro html-define-1arg{command, html-insertion}
+@macro \command\{arg}
+@quote-arg
+@w{\html-insertion\}
+@end macro
+@end macro
+
+@macro html-define-line{command, html-insertion}
+@macro \command\{line}
+@w{\html-insertion\}
+@end macro
+@end macro
+
+@macro asis{arg}
+\arg\
+@end macro
+
+@c
+@c Various lists (@table, @itemize, @enumerate)
+@c
+
+@ignore
+@macro table{flavor}
+
+<dl>@*
+@end macro
+@macro end_table
+@*
+</dl>@*
+@end macro
+
+@macro titem{line}
+@*
+<dt> \line\@*
+<dd>
+@end macro
+@macro titemx{line}
+<dt> \line\@*
+@end macro
+@macro titeml{line}
+<dt> \line\@*
+<dd>
+@end macro
+@end ignore
+
+@c I'm using now the table environment of HTML
+@c Do not nest the table environment
+
+@macro table{table_format}
+@macro _table_format{arg}
+\table_format\{\arg\}
+@end macro
+<table border>
+@end macro
+@macro titem{line}
+<tr><td>@_table_format{\line\}<td>
+@end macro
+@macro titemx{line}
+@titem \line\
+@end macro
+@macro end_table
+<tr></table>
+@unmacro _table_format
+@end macro
+
+@macro itemize{style}
+@*
+<ul>@*
+@end macro
+@macro item{line}
+@*
+<li>\line\
+@end macro
+@macro end_itemize
+@*
+</ul>@*
+@end macro
+@macro enumerate{style}
+@*
+<ol>@*
+@end macro
+@macro end_enumerate
+@*
+</ol>@*
+@end macro
+
+@c
+@c Preformatted stuff (@example, @display, @smallexample, @quotation)
+@c
+
+@macro format
+@exdent <pre>@*
+@format
+@end macro
+@macro end_format
+@end format
+@exdent </pre>@*
+@*
+@end macro
+
+@macro display
+@exdent <pre>@*
+@display
+@end macro
+@macro example
+@exdent <pre>@*
+@example
+@end macro
+@macro smallexample
+@exdent <pre>
+@smallexample
+@end macro
+@macro quotation
+@exdent <blockquote>@*
+@quotation
+@end macro
+@macro end_example
+@end example
+@exdent </pre>
+@end macro
+@macro end_smallexample
+@end smallexample
+@exdent </pre>
+@end macro
+@macro end_display
+@end display
+@exdent </pre>
+@*
+@end macro
+@macro end_quotation
+@end quotation
+@exdent </blockquote>@*
+@*
+@end macro
+
+@c
+@c Nodes, chapters, sections and menus
+@c
+
+@macro menu
+<p>@*
+<MENU>@*
+
+@end macro
+@macro mitem{visible, node}
+<LI>@w{<A HREF="#\node\"> \visible\ </A>}@*
+@end macro
+@macro end_menu
+
+</MENU>@*
+
+@end macro
+
+@macro node{this, next, prev, up}
+<A NAME="\this\">
+@end macro
+
+@macro node_start
+@top
+@end macro
+
+@macro top{line}
+<CENTER>@*
+<H1> \line\ </H1></A><P>@*
+</CENTER>@*
+@end macro
+
+@macro chapter{line}
+<CENTER>@*
+<H2> \line\ </H2></A><P>@*
+</CENTER>@*
+@end macro
+
+@macro section{line}
+@*
+<H3> \line\ </H3></A><P>@*
+@end macro
+
+@macro subsection{line}
+@*
+<H4> \line\ </H4></A><P>@*
+@end macro
+
+@macro subsubsection{line}
+@*
+<H4> \line\ </H4></A><P>@*
+@end macro
+
+@macro unnumbered{line}
+@chapter{\line\}
+@end macro
+
+@macro unnumberedsec{line}
+@section{\line\}
+@end macro
+
+@macro subsubheading{line}
+@subsubsection{\line\}
+@end macro
+
+@macro appendix{line}
+ \line\ </A></H3><P>
+
+@end macro
+
+@macro appendixsec{line}
+ \line\</A></H3><P>
+
+@end macro
+
+@c
+@c Footnotes
+@
+
+@macro footnote{stuff}
+@quote-arg
+
+<P><i><b> Note: </b>\stuff\ </i><P>
+
+@end macro
+
+@macro quest{stuff}
+@quote-arg
+@*
+<em><strong>Question</strong>: \stuff\ </em>
+<p>@*
+@end macro
+
+@macro ans
+@*
+@exdent <hr>
+<strong>Answer</strong>:
+@end macro
+
+@c
+@c Cross-references
+@c
+
+@c NOTE: The internal cross-references only support 2-argument
+@c varieties of the Texinfo commands, and the external
+@c cross-reference only support 4-argument form!
+
+@macro ref{node, desc, title, file, doc}
+@set desc_seen
+@set doc_seen
+@ifeq{"\doc\", "", @clear doc_seen }
+@ifeq{"\desc\", "", @clear desc_seen }
+@ifset doc_seen
+@ifset desc_seen
+<B>Section \desc\ in \doc\</B>
+@end ifset
+@ifclear desc_seen
+<B>Section \node\ in \doc\</B>
+@end ifclear
+@end ifset
+@ifclear doc_seen
+@w{<A HREF="#\node\">}
+@ifset desc_seen
+\desc\
+@end ifset
+@ifclear desc_seen
+\node\
+@end ifclear
+</A>
+@end ifclear
+@end macro
+
+@macro xref{node, desc, title, file, doc}
+See @ref{\node\,\desc\,\title\,\file\,\doc\}
+@end macro
+
+@macro mxref{node, desc, title, file, doc}
+see @ref{\node\,\desc\,\title\,\file\,documentation for \doc\}
+@end macro
+
+@macro pxref{node, desc, title, file, doc}
+see @ref{\node\,\desc\,\title\,\file\,\doc\}
+@end macro
+
+@c @macro extref{node, desc, file, title, url}
+@c See @w{<A HREF="http://\url\">}the ``\node\'' section of the ``\title\''</A>
+@c @end macro
+
+@macro extref{node, desc, file, title, url}
+See @w{<A HREF="\url\#\node\">}the ``\node\'' section of the ``\title\''</A>
+@end macro
+
+@c
+@c ---------------- Common part ------------------------------------
+@c
+
+@macro b{arg}
+<b>\arg\</b>
+@end macro
+@macro code{arg}
+<code>\arg\</code>
+@end macro
+@macro file{arg}
+<code>\arg\</code>
+@end macro
+@macro emph{arg}
+<em>\arg\</em>
+@end macro
+@macro strong{arg}
+<strong>\arg\</strong>
+@end macro
+@macro kbd{arg}
+<kbd>\arg\</kbd>
+@end macro
+
+@macro key{arg}
+<kbd>\arg\</kbd>
+@end macro
+
+@c @macro key{arg}
+@c <table border><tr><td><kbd>\arg\</kbd><tr></table>
+@c @end macro
+
+@macro samp{arg}
+<samp>\arg\</samp>
+@end macro
+@macro var{arg}
+<var>\arg\</var>
+@end macro
+@macro dfn{arg}
+<dfn>\arg\</dfn>
+@end macro
+@macro i{arg}
+<i>\arg\</i>
+@end macro
+@macro t{arg}
+<tt>\arg\</tt>
+@end macro
+@macro sc{arg}
+<b><tt>\arg\</tt></b>
+@end macro
+@macro copyright{}
+&copy;
+@end macro
+
+@macro aacute
+&aacute;
+@end macro
+@macro eacute
+&eacute;
+@end macro
+@macro iacute
+&iacute;
+@end macro
+@macro oacute
+&oacute;
+@end macro
+@macro uacute
+&uacute;
+@end macro
+@macro ntilde
+&ntilde;
+@end macro
+@macro Ntilde
+&Ntilde;
+@end macro
+@macro exclamdown
+&iexcl;
+@end macro
+@macro questiondown
+&iquest;
+@end macro
+@macro auml
+&auml;
+@end macro
+@macro euml
+&euml;
+@end macro
+@macro iuml
+&iuml;
+@end macro
+@macro ouml
+&ouml;
+@end macro
+@macro uuml
+&uuml;
+@end macro
+@macro Uuml
+&Uuml;
+@end macro
+@macro agrave
+&agrave;
+@end macro
+@macro egrave
+&egrave;
+@end macro
+@macro igrave
+&igrave;
+@end macro
+@macro ograve
+&ograve;
+@end macro
+@macro ugrave
+&ugrave;
+@end macro
+
+@macro lessthan
+&lt;
+@end macro
+@macro greaterthan
+&gt;
+@end macro
+
+@macro _subheading{a}
+<H3>\a\</H3>
+@end macro
+
+@macro separatenode
+<p><hr></p>
+@end macro
+
+@macro table4{title1,title2,title3,title4}
+<center><table border cellpadding=5 width=80%>@*
+<tr><th>\title1\</th><th>\title2\</th><th>\title3\</th><th>\title4\</th></tr>@*
+@end macro
+
+@macro table3{title1,title2,title3}
+<center><table border cellpadding=5 width=80%>@*
+<tr><th>\title1\</th><th>\title2\</th><th>\title3\</th></tr>@*
+@end macro
+
+@macro titem4{NOM,COM,KEY,ALT}
+<tr align=center><td>\NOM\</td><td>\COM\</td><td>\KEY\</td><td>\ALT\</td></tr>@*
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+@macro titem3{NOM,COM,KEY}
+<tr align=center><td>\NOM\</td><td>\COM\</td><td>\KEY\</td></tr>@*
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+@macro endtable4{}
+</table></center><p></p>
+@end macro
+
+
diff --git a/setedit/sdg/txhgen-i.txi b/setedit/sdg/txhgen-i.txi
new file mode 100644
index 0000000..383dce4
--- /dev/null
+++ b/setedit/sdg/txhgen-i.txi
@@ -0,0 +1,312 @@
+@c rhidemac.txi: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making RHIDE documentation in TeX and INFO format.
+@c
+@iftex
+@immediate@write17{-------------------------------------------------------------------}
+@immediate@write17{---------IGNORE THE FOLLOWING ERROR ABOUT THE INVALID CHARACTER----}
+@immediate@write17{-------------------------BY SIMPLY PRESSING ENTER------------------}
+@immediate@write17{-------------------------------------------------------------------}
+@end iftex
+@c
+@c Author: Salvador Eduardo Tropea (salvador@inti.edu.ar), is a modified
+@c version of the one created by (July, 1997):
+@c
+@c Author: Robert Hhne (robert.hoehne@mathematik.tu-chemitz.de)
+@c November 1996.
+@c
+@c Derived from 'faqmacros.txi', which is part of DJGPP FAQ written
+@c by Eli Eli Zaretskii (eliz@is.elta.co.il)
+@c
+@c Many ideas taken from files `multifmt.texi' and html.texi'
+@c written by Brian J. Fox and distributed with GNU Texinfo archive:
+@c
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@c
+@c -------------------------------------------------------------------------
+
+
+@macro html
+@end macro
+
+@macro htmltitle{line}
+@end macro
+
+@macro htmlsubtitle{line}
+@end macro
+
+@macro htmlauthor{line}
+@end macro
+
+@macro bye
+@end macro
+
+@macro anchor{text, link}
+\text\, \link\
+@end macro
+
+@macro TeX
+@TeX{}
+@end macro
+
+@macro paragraph{}
+@c @sp 1
+@end macro
+
+@macro mail{name, address}
+@sc{\name\}
+@c @iftex
+@c @par
+@c @end iftex
+@t{<\address\>}
+@end macro
+
+@macro ftp{desc, path}
+\desc\, e.g. ftp://\path\
+@end macro
+
+@macro ftpdir{host, dir}
+\host\, directory \dir\
+@end macro
+
+@macro ftpusr{desc, host, login, passwd}
+\desc\ (FTP to \host\, login as \login\, give \passwd\ as password)
+@end macro
+
+@macro www{desc, path}
+\desc\, at this URL:
+@sp 1
+@display
+http://\path\
+@end display
+@sp 1
+@end macro
+
+@macro gopher{desc, path}
+\desc\, gopher://\path\
+@end macro
+
+@macro news{name}
+\name\ Newsgroup
+@end macro
+
+@macro titem{line}
+@item \line\
+
+@end macro
+@macro titemx{line}
+@itemx \line\
+
+@end macro
+@macro titeml{line}
+@itemx \line\
+@end macro
+
+@macro quest{stuff}
+@quote-arg
+@emph{@strong{Question}: \stuff\}
+@end macro
+
+@macro ans
+@strong{Answer}:
+@end macro
+
+@macro mxref{node, desc, title, file, doc}
+see @ref{\node\,\desc\,\title\,\file\,documentation for \doc\}
+@end macro
+
+@macro extref{node, desc, file, title, url}
+see @ref{\node\,\desc\,,\file\,\title\},
+@end macro
+
+@c To keep it compatible with html.
+@macro mitem{visible, node}
+* \visible\: \node\.
+@end macro
+
+@c Idem.
+@macro end_menu
+@end menu
+@end macro
+
+@macro node{this, next, prev, up}
+@node \this\, \next\, \prev\, \up\
+@end macro
+
+@macro end_example
+@end example
+@end macro
+
+@iftex
+@set tex
+@macro aacute
+@'a
+@end macro
+@macro eacute
+@'e
+@end macro
+@macro iacute
+@'i
+@end macro
+@macro oacute
+@'o
+@end macro
+@macro uacute
+@'u
+@end macro
+@macro ntilde
+@~n
+@end macro
+@macro Ntilde
+@~N
+@end macro
+@macro auml
+@"a
+@end macro
+@macro euml
+@"e
+@end macro
+@macro iuml
+@"i
+@end macro
+@macro ouml
+@"o
+@end macro
+@macro uuml
+@"u
+@end macro
+@macro Uuml
+@"U
+@end macro
+@macro agrave
+@`a
+@end macro
+@macro egrave
+@`e
+@end macro
+@macro igrave
+@`i
+@end macro
+@macro ograve
+@`o
+@end macro
+@macro ugrave
+@`u
+@end macro
+@end iftex
+
+@ifclear tex
+@macro aacute
+
+@end macro
+@macro eacute
+
+@end macro
+@macro iacute
+
+@end macro
+@macro oacute
+
+@end macro
+@macro uacute
+
+@end macro
+@macro ntilde
+
+@end macro
+@macro Ntilde
+
+@end macro
+@macro exclamdown
+
+@end macro
+@macro questiondown
+
+@end macro
+@macro auml
+
+@end macro
+@macro euml
+
+@end macro
+@macro iuml
+
+@end macro
+@macro ouml
+
+@end macro
+@macro uuml
+
+@end macro
+@macro Uuml
+
+@end macro
+@macro agrave
+
+@end macro
+@macro egrave
+
+@end macro
+@macro igrave
+
+@end macro
+@macro ograve
+
+@end macro
+@macro ugrave
+
+@end macro
+@end ifclear
+
+@macro lessthan
+<
+@end macro
+@macro greaterthan
+>
+@end macro
+
+@macro _subheading{a}
+@subheading \a\
+@end macro
+
+@macro separatenode
+@end macro
+
+@macro table4{title1,title2,title3,title4}
+@itemize @bullet
+@end macro
+
+@macro table3{title1,title2,title3}
+@itemize @bullet
+@end macro
+
+@macro titem4{NOM,COM,KEY,ALT}
+@item \NOM\@*
+@itemize @minus
+ @item Editor command: @code{\COM\}@*
+ @item Key: @key{\KEY\}@*
+ @item Alternative: @key{\ALT\}
+@end itemize
+@c @key{\KEY\}
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+@macro titem3{NOM,COM,KEY}
+@item \NOM\@*
+@itemize @minus
+ @item Editor command: @code{\COM\}@*
+ @item Key: @key{\KEY\}
+@end itemize
+@c @key{\KEY\}
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+
+@macro endtable4{}
+@end itemize
+@end macro
+
diff --git a/setedit/sdg/txhgen-i.txt b/setedit/sdg/txhgen-i.txt
new file mode 100644
index 0000000..36e1b6a
--- /dev/null
+++ b/setedit/sdg/txhgen-i.txt
@@ -0,0 +1,251 @@
+@c rhidemac.txt: -*- Texinfo -*-
+
+@c -------------------------------------------------------------------------
+@c
+@c Macros for making RHIDE documentation in text format.
+@c
+@c Author: Robert Hhne (robert.hoehne@mathematik.tu-chemitz.de)
+@c November 1996.
+@c
+@c Derived from 'faqmacros.txi', which is part of DJGPP FAQ written
+@c by Eli Eli Zaretskii (eliz@is.elta.co.il)
+@c
+@c Many ideas taken from files `multifmt.texi' and html.texi'
+@c written by Brian J. Fox and distributed with GNU Texinfo archive:
+@c
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@c
+@c -------------------------------------------------------------------------
+
+
+@macro html
+@end macro
+
+@macro htmltitle{line}
+@end macro
+
+@macro htmlsubtitle{line}
+@end macro
+
+@macro htmlauthor{line}
+@end macro
+
+@macro bye
+@end macro
+
+@macro anchor{text, link}
+\text\, \link\
+@end macro
+
+@macro TeX
+@TeX{}
+@end macro
+
+@macro paragraph{}
+@sp 1
+@end macro
+
+@macro mail{name, address}
+\name\ <\address\>
+@end macro
+
+@macro ftp{desc, path}
+\desc\, e.g. ftp://\path\
+@end macro
+
+@macro ftpdir{host, dir}
+\host\, directory \dir\
+@end macro
+
+@macro ftpusr{desc, host, login, passwd}
+\desc\ (FTP to \host\, login as \login\, give \passwd\ as password)
+@end macro
+
+@macro www{desc, path}
+\desc\, at this URL:
+@sp 1
+@display
+http://\path\
+@end display
+@sp 1
+@end macro
+
+@macro gopher{desc, path}
+\desc\, gopher://\path\
+@end macro
+
+@macro news{name}
+\name\ Newsgroup
+@end macro
+
+@macro titem{line}
+@item \line\
+@end macro
+@macro titemx{line}
+@itemx \line\
+@end macro
+@macro titeml{line}
+@itemx \line\
+@end macro
+
+@macro quest{stuff}
+@quote-arg
+@emph{@strong{Question}: \stuff\}
+@end macro
+
+@macro ans
+@strong{Answer}:
+@end macro
+
+@c
+
+@macro mxref{node, desc, title, file, doc}
+See Section '\node\' in documentation for '\doc\'
+@end macro
+
+@macro xref{node,visible}
+See \visible\
+@end macro
+
+@macro extref{node, desc, file, title, url}
+See \desc\ in ``\title\'', or point your Web browser to http://\url\
+@end macro
+
+@macro footnote{stuff}
+@quote-arg
+(\stuff\)
+@end macro
+
+@c To keep it compatible with html.
+@macro mitem{visible, node}
+* \visible\.
+@end macro
+
+@c Idem.
+@macro end_menu
+@end format
+@sp 1
+@end macro
+
+@macro menu
+@format
+@end macro
+
+@macro end_example
+@end example
+@end macro
+
+@macro aacute
+
+@end macro
+@macro eacute
+
+@end macro
+@macro iacute
+
+@end macro
+@macro oacute
+
+@end macro
+@macro uacute
+
+@end macro
+@macro ntilde
+
+@end macro
+@macro Ntilde
+
+@end macro
+@macro exclamdown
+
+@end macro
+@macro questiondown
+
+@end macro
+@macro auml
+
+@end macro
+@macro euml
+
+@end macro
+@macro iuml
+
+@end macro
+@macro ouml
+
+@end macro
+@macro uuml
+
+@end macro
+@macro Uuml
+
+@end macro
+@macro agrave
+
+@end macro
+@macro egrave
+
+@end macro
+@macro igrave
+
+@end macro
+@macro ograve
+
+@end macro
+@macro ugrave
+
+@end macro
+
+@macro lessthan
+<
+@end macro
+@macro greaterthan
+>
+@end macro
+
+@macro _subheading{a}
+@subheading \a\
+@end macro
+
+@macro separatenode
+@end macro
+
+@macro node{this, next, prev, up}
+@end macro
+
+@macro table4{title1,title2,title3,title4}
+@itemize @bullet
+@end macro
+
+@macro table3{title1,title2,title3}
+@itemize @bullet
+@end macro
+
+@macro titem4{NOM,COM,KEY,ALT}
+@item \NOM\@*
+@itemize @minus
+ @item Editor command: @code{\COM\}@*
+ @item Key: @key{\KEY\}@*
+ @item Alternative: @key{\ALT\}
+@end itemize
+@c @key{\KEY\}
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+@macro titem3{NOM,COM,KEY}
+@item \NOM\@*
+@itemize @minus
+ @item Editor command: @code{\COM\}@*
+ @item Key: @key{\KEY\}
+@end itemize
+@c @key{\KEY\}
+@kindex \COM\ @key{\KEY\}
+@kindex \NOM\ @key{\KEY\}
+@end macro
+
+
+@macro endtable4{}
+@end itemize
+@end macro
+
diff --git a/setedit/sdg/txhgen.cc b/setedit/sdg/txhgen.cc
new file mode 100644
index 0000000..98a2fdd
--- /dev/null
+++ b/setedit/sdg/txhgen.cc
@@ -0,0 +1,2105 @@
+/* Copyright (C) 1996-2007 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+11/7/97
+Wau! es impresionante!.
+
+Ojo no libera la memoria, no puedo usarlo como subrutina, hay que adaptarlo
+26/6/97: Estoy en los sig:
+Ya hace listas asociativas, el problema es como hacerlas configurables, tengo
+que agregar algo en el archivo de configuracin.
+---------
+Hasta ahora genera bastante bien, habria que implementar la busqueda automatica
+de funcion y prototipo. La idea es llamar a bufun y en cada comentario fijarse
+cual es la 1er funcion debajo de el y tomar ese valor.
+25/6/97:
+El archivo .txh generado parece OK, compilado con: --no-validate anda ok.
+El problema es que falta un Top y ademas que necesita un menu. La idea seria
+poner las funciones en una coleccion (ya hecho) y luego volcarlo a un nodo
+Top. Despues habria que unir los dos archivos en uno, con esto quedaria
+bastante bueno.
+
+*****************************************************************************/
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_alloca
+#define Uses_unistd
+#define Uses_limits
+
+#define Uses_fcntl
+#define Uses_TNoCaseSOSStringCollection
+#define Uses_TNCSAssociative
+#define Uses_TNSSOSCol
+#define Uses_TVCodePage
+#include <settvuti.h>
+
+#define Uses_TMLISDGDefs
+#include <mli.h>
+#include <txhgen.h>
+#include <bufun.h>
+#include <rhutils.h>
+
+#define MAX_DEFS 16
+#define MAX_LEN 12
+#define MAX_ASSO 8
+
+static char *Defs[MAX_DEFS];
+static int lDefs[MAX_DEFS];
+static int tDefs[MAX_DEFS];
+static char *Used[MAX_DEFS];
+static char *Ends[MAX_DEFS];
+static char *Defaults[MAX_DEFS];
+static char *DefaultsEnds[MAX_DEFS];
+static char SkipDefault[MAX_DEFS];
+static char AddedToAsoc[MAX_DEFS];
+
+static char *AssoMenu[MAX_ASSO];
+static char *AssoNode[MAX_ASSO];
+static char *AssoExtra[MAX_ASSO];
+static char AssoVar[MAX_ASSO];
+static TNCSAssociative *AssoObj[MAX_ASSO];
+
+static char Start[MAX_LEN];
+static char End[MAX_LEN];
+static char Skip[MAX_LEN];
+static int SkipL;
+static int Definitions;
+static int Associations;
+static char *Mask;
+static stkHandler HandlerKey;
+static int Distinguish=1;
+static char *StartMenu;
+// The next 2 variables have Val at the end to avoid collisions with the
+// Win32 API.
+static char *EntryMenuVal;
+static char *EndMenuVal;
+static char *mAssoMain;
+static char *mAssoRest;
+static char *mMain;
+static char *FileUnderProcess;
+static FILE *TXHNodesFile;
+static char *EndOfPar;
+static char *CrossRef;
+static char *DoubleA;
+static char *BreakLine;
+static char *Language;
+static stkHandler *ASCIIConv;
+static int Replaces;
+
+int TXHLine;
+
+char *TXHErrors[] =
+{
+"Unknown error", //0
+"Can't open the file", //1
+"Can't find SectionStart", //2
+"Can't find SectionEnd", //3
+"Can't find any definition", //4
+"Can't find the code to emit", //5
+"Not enough memory", //6
+"Missing variables", //7
+"Can't find any section", //8
+"Syntax error", //9
+"Too much associations", //10
+"Too much variables", //11
+"Too much replaces", //12
+"Incomplet GenMenu section", //13
+"Missing GenAssoMain section", //14
+"Missing GenAssoRest section", //15
+"Missing GenMain section", //16
+"Missing Commands section", //17
+"CommandLine without name", //18
+"Name without CommandLine, use NULL if none", // 19
+"Can't find the end of the string", // 20
+"Error reading the file", // 21
+"Can't create output file" // 22
+};
+int TXHError;
+
+char *TXHErrorSection[]=
+{
+"unknown part",
+"loading the format file",
+"generating the output file",
+"interpreting a sLisp code"
+};
+
+int TXHGenSection;
+
+// FunList is usually the list of functions. But that's configurable.
+// In fact FunList is just the list of names that distinguish a function
+// from another. That's variable 0 and all the associations are related
+// to it.
+static TNoCaseSOSStringCollection *FunList;
+static TNoCaseSOSStringCollection *fList;
+static TNoCaseSOSStringCollection *DefinedCommands;
+static TNSSOSCol *ListOfConstants;
+static TNSSOSCol *CommandLines;
+static SOStack *stkAliasGlobal;
+
+// The following vars controls the program from outside
+int TXHKeepTemporal=1; // 1=> don't delete the file with the functions code
+TXHGetNextFileType TXHGetNextFile; // Function to get the files
+char *TXHFormatFile; // Configuration file
+char *TXHTempGenFile; // Name of the temporal for nodes
+char *TXHOutBaseName; // No extentions here!
+char *TXHFilesDir=NULL; // Base for format files
+void (*TXHPrintMessage)(char *s);
+
+static void GenerateAssoc(TNCSAssociative *a, char *name, char *extra, FILE *f);
+void OutPutString(char *s, char *e,FILE *f);
+
+char *TXHSections[] =
+{
+ "Delimiters",
+ "Variables",
+ "Associations",
+ "Replace",
+ "GenNode",
+ "GenMenu",
+ "GenAssoMain",
+ "GenAssoRest",
+ "GenMain",
+ "Commands",
+ "DefinedCommands",
+ "ASCIIConvert",
+ "Configuration"
+};
+const int maxSections=sizeof(TXHSections)/sizeof(char *);
+
+static int GenerateCodeFor(char *mask,int (*checkUsedVar)(int),
+ void (*putVarText)(int,FILE*),
+ getVarFunction getVar,FILE *f);
+
+static void CopyFile(char *origin, char *destination)
+{
+ char *buf;
+ buf = new char[16*1024]; // Just the transfer buffer
+ int count;
+ FILE *f = fopen(origin,"rb");
+ FILE *stream = fopen(destination,"w+b");
+ while ((count = fread(buf,1,16*1024,f)) > 0)
+ {
+ fwrite(buf,1,count,stream);
+ }
+ fclose(stream);
+ fclose(f);
+ delete[] buf;
+}
+
+static char *MoveAfterEqual(char *s)
+{
+ for (; *s && *s!='=' && *s!='\n'; s++);
+ if (*s && *s!='\n') s++;
+ for (; *s && ucisspace(*s) && *s!='\n'; s++);
+ return s;
+}
+
+static void GetUpTo(int len, char *s, char *d)
+{
+ int l;
+ for (l=0; *s && *s!='\n' && *s!='\r' && l<len; s++,l++) d[l]=*s;
+ d[l]=0;
+}
+
+static void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+static int LookForSection(char *s)
+{
+ int i;
+
+ for (i=0; i<maxSections; i++)
+ if (strcmp(s,TXHSections[i])==0)
+ return i;
+ return -1;
+}
+
+/*static void CutEOL(char *b)
+{
+ int l=strlen(b);
+ if (b[l-1]=='\n')
+ l--;
+ if (b[l-1]=='\r')
+ l--;
+ if (b[l-1]=='\"')
+ l--;
+ b[l]=0;
+}*/
+
+static char *NextLineOf(char *s)
+{
+ for (;*s && *s!='\n'; s++);
+ if (*s)
+ return s+1;
+ return s;
+}
+
+static char *LoadGenerate(char *&fPos)
+{
+ long l,l1,l2;
+ char *code,*Code,*s;
+
+ code=fPos;
+ do
+ {
+ code=NextLineOf(code);
+ TXHLine++;
+ }
+ while (*code!='[' && *code);
+ TXHLine--; // The last is counted by wasMoved
+
+ l=code-fPos;
+ Code=new char[l+1];
+ if (!Code)
+ {
+ TXHError=6;
+ return NULL;
+ }
+ for (l1=0,l2=0,s=fPos; l1<l; l1++)
+ if (s[l1]=='#')
+ {
+ if (l1 && s[l1-1]=='\n')
+ for (l1++; s[l1]!='\n' && l1<l; l1++);
+ else
+ Code[l2++]=s[l1];
+ }
+ else
+ Code[l2++]=s[l1];
+ Code[l2]=0;
+ fPos=code;
+ return Code;
+}
+
+static stkHandler CopyToStack(char *pos,char *&fPos)
+{
+ fPos=NextLineOf(pos);
+ ReplaceCRby0(pos);
+ return stkAliasGlobal->addStr(pos);
+}
+
+static char *CopyStrQuoted(char *pos, char *s)
+{
+ for (; *s && *s!='\"'; s++,pos++)
+ {
+ if (*s=='\\')
+ {
+ s++;
+ switch (*s)
+ {
+ case 't':
+ *pos='\t';
+ break;
+ case 'r':
+ *pos='\r';
+ break;
+ case 'n':
+ *pos='\n';
+ break;
+ case '"':
+ *pos='"';
+ break;
+ case '\\':
+ *pos='\\';
+ break;
+ // The rest are skipped
+ default:
+ pos--;
+ }
+ }
+ else
+ *pos=*s;
+ if (*s=='\n')
+ TXHLine++;
+ }
+ *pos=0;
+ return s;
+}
+
+static stkHandler GetValueStk(char *&fPos,char &wasMoved)
+{
+ stkHandler stAux;
+ int Size;
+ char *pos;
+
+ pos=MoveAfterEqual(fPos);
+ if (*pos!='"')
+ {
+ wasMoved=1;
+ return CopyToStack(pos,fPos);
+ }
+ for (fPos=++pos; *pos && *pos!='\"'; pos++)
+ {
+ if (*pos=='\\' && *(pos+1)) pos++;
+ }
+ if (!*pos)
+ {
+ TXHError=20;
+ return stkNULL;
+ }
+ Size=pos-fPos+1;
+ stAux=stkAliasGlobal->alloc(Size);
+ if (stAux==stkNULL)
+ {
+ TXHError=6;
+ return stAux;
+ }
+ fPos=CopyStrQuoted(stkAliasGlobal->GetStrOf(stAux),fPos);
+ return stAux;
+}
+
+static stkHandler ExtractPair(char *&fPos, char &wasMoved)
+{
+ char *s=fPos,p,*start_name=fPos;
+ stkHandler ret;
+
+ if (GetValueStk(fPos,wasMoved)==stkNULL)
+ return stkNULL;
+ // Now take the name
+ for(;*s && !ucisspace(*s) && *s!='='; s++);
+ // Now s points to the end of the name
+ p=*s; *s=0;
+ ret=stkAliasGlobal->addStr(start_name);
+ *s=p;
+ return ret;
+}
+
+static char *DuplicateStr(char *&fPos, char &wasMoved)
+{
+ int Size;
+ char *pos,*aux;
+
+ pos=MoveAfterEqual(fPos);
+ if (*pos!='"')
+ {
+ wasMoved=1;
+ fPos=NextLineOf(pos);
+ ReplaceCRby0(pos);
+ return strdup(pos);
+ }
+ for (fPos=++pos; *pos && *pos!='\"'; pos++)
+ {
+ if (*pos=='\\' && *(pos+1)) pos++;
+ }
+ if (!*pos)
+ {
+ TXHError=20;
+ return NULL;
+ }
+ Size=pos-fPos+1;
+ aux=new char[Size];
+ if (aux==NULL)
+ {
+ TXHError=6;
+ return aux;
+ }
+ fPos=CopyStrQuoted(aux,fPos);
+ return aux;
+}
+
+// free checks for NULL that's safe
+#define RetError(a) { TXHError=a; delete file; return 1; }
+
+int TXHReadSpects(char *name, SOStack *stk)
+{
+ FILE *f;
+ char *pos;
+ int StartFound=0,EndFound=0,GenerateFound=0;
+ int Section,i,SpectCommand=1;
+ stkHandler stAux;
+ char *file=NULL,*fPos,auxV,wasMoved=0,*auxP;
+ long fileLen;
+
+ Replaces=0;
+ TXHLine=1;
+ Associations=Definitions=0;
+
+ // Open the file and read it to memory
+ f=fopen(name,"rt");
+ if (!f) RetError(1)
+ fseek(f,0,SEEK_END);
+ fileLen=ftell(f);
+ file=new char[fileLen+1];
+ if (!file)
+ {
+ fclose(f);
+ RetError(6)
+ }
+ fseek(f,0,SEEK_SET);
+ fileLen=fread(file,1,fileLen,f);
+ fclose(f);
+ if (fileLen<=0)
+ RetError(21)
+ fPos=file;
+ file[fileLen]=0;
+
+ // Init Vars
+ for (i=0; i<MAX_ASSO; i++)
+ {
+ AssoMenu[i]=AssoNode[i]=AssoExtra[i]=NULL;
+ AssoObj[i]=NULL;
+ AssoVar[i]=0;
+ }
+ Mask=NULL;
+ StartMenu=EntryMenuVal=EndMenuVal=NULL;
+ mAssoMain=mAssoRest=mMain=NULL;
+ EndOfPar=CrossRef=BreakLine=NULL;
+ Language=NULL;
+ ASCIIConv=NULL;
+
+ // Search a section
+ while (*fPos!='[' && *fPos)
+ {
+ fPos=NextLineOf(fPos);
+ TXHLine++;
+ }
+ if (*fPos!='[') RetError(8)
+ do
+ {
+ // Here we have the section name in b
+ pos=strchr(fPos,']');
+ if (!pos)
+ RetError(9)
+ auxV=*pos; *pos=0;
+ if ((Section=LookForSection(fPos+1))<0)
+ RetError(9)
+ *pos=auxV;
+
+ do
+ {
+ // Search a line with something
+ do
+ {
+ if (wasMoved)
+ wasMoved=0;
+ else
+ fPos=NextLineOf(fPos);
+ TXHLine++;
+ }
+ while ((*fPos=='#' || ucisspace(*fPos)) && *fPos);
+ if (*fPos=='[' || *fPos==0)
+ break;
+
+ switch (Section)
+ {
+ // Delimiters
+ case 0:
+ if (strncmp(fPos,"SectionStart",12)==0)
+ {
+ pos=MoveAfterEqual(fPos);
+ GetUpTo(11,pos,Start);
+ StartFound=strlen(Start);
+ }
+ else
+ if (strncasecmp(fPos,"SectionEnd",10)==0)
+ {
+ pos=MoveAfterEqual(fPos);
+ GetUpTo(11,pos,End);
+ EndFound=strlen(End);
+ }
+ else
+ if (strncasecmp(fPos,"SectionSkip",11)==0)
+ {
+ pos=MoveAfterEqual(fPos);
+ GetUpTo(11,pos,Skip);
+ SkipL=strlen(Skip);
+ }
+ else
+ RetError(9)
+ break;
+
+ // Variables
+ case 1:
+ if (strncmp(fPos,"AddDefinition",13)==0)
+ {
+ if (Definitions==MAX_DEFS)
+ RetError(11)
+ pos=MoveAfterEqual(fPos);
+ fPos=NextLineOf(pos); wasMoved=1;
+ ReplaceCRby0(pos);
+ strtok(pos,",");
+ Defs[Definitions]=strdup(pos);
+ lDefs[Definitions]=strlen(pos);
+ pos=strtok(NULL,",");
+ if (pos)
+ tDefs[Definitions]=atoi(pos);
+ else
+ tDefs[Definitions]=1;
+ Definitions++;
+ }
+ else
+ if (strncmp(fPos,"Distinguish",11)==0)
+ {
+ pos=MoveAfterEqual(fPos);
+ Distinguish=atoi(pos);
+ }
+ else
+ RetError(9)
+ break;
+
+ // Associations
+ case 2:
+ if (strncmp(fPos,"AddAssoc",8)==0)
+ {
+ if (Associations==MAX_ASSO)
+ RetError(10)
+ pos=MoveAfterEqual(fPos);
+ fPos=NextLineOf(pos); wasMoved=1;
+ ReplaceCRby0(pos);
+ strtok(pos,",");
+ AssoMenu[Associations]=strdup(pos);
+ pos=strtok(NULL,",");
+ if (!pos)
+ RetError(9)
+ AssoNode[Associations]=strdup(pos);
+ pos=strtok(NULL,",");
+ if (!pos)
+ RetError(9)
+ AssoVar[Associations]=atoi(pos);
+ pos=strtok(NULL,",");
+ if (pos)
+ AssoExtra[Associations]=strdup(pos);
+ AssoObj[Associations]=new TNCSAssociative(5,5,stk);
+ Associations++;
+ }
+ else
+ RetError(9)
+ break;
+
+ // Replace
+ case 3:
+ if (strncmp(fPos,"Constant",8)!=0)
+ RetError(9)
+ stAux=GetValueStk(fPos,wasMoved);
+ ListOfConstants->insert(stAux);
+ Replaces++;
+ break;
+
+ // GenNode
+ case 4:
+ Mask=LoadGenerate(fPos);
+ if (!Mask)
+ RetError(6)
+ wasMoved=1;
+ GenerateFound=1;
+ break;
+
+ // GenMenu
+ case 5:
+ if (strncmp(fPos,"Start",5)==0)
+ StartMenu=DuplicateStr(fPos,wasMoved);
+ else
+ if (strncasecmp(fPos,"Entry",5)==0)
+ EntryMenuVal=DuplicateStr(fPos,wasMoved);
+ else
+ if (strncasecmp(fPos,"End",3)==0)
+ EndMenuVal=DuplicateStr(fPos,wasMoved);
+ else
+ RetError(9)
+ break;
+
+ // GenAssoMain
+ case 6:
+ mAssoMain=LoadGenerate(fPos);
+ if (!mAssoMain)
+ RetError(6)
+ wasMoved=1;
+ break;
+
+ // GenAssoRest
+ case 7:
+ mAssoRest=LoadGenerate(fPos);
+ if (!mAssoRest)
+ RetError(6)
+ wasMoved=1;
+ break;
+
+ // GenMain
+ case 8:
+ mMain=LoadGenerate(fPos);
+ if (!mMain)
+ RetError(6)
+ wasMoved=1;
+ break;
+
+ // Commands
+ case 9:
+ if (strncmp(fPos,"EndOfPar",8)==0)
+ EndOfPar=DuplicateStr(fPos,wasMoved);
+ else
+ if (strncmp(fPos,"CrossRef",8)==0)
+ CrossRef=DuplicateStr(fPos,wasMoved);
+ else
+ if (strncmp(fPos,"Double@",7)==0)
+ DoubleA=DuplicateStr(fPos,wasMoved);
+ else
+ if (strncmp(fPos,"BreakLine",9)==0)
+ BreakLine=DuplicateStr(fPos,wasMoved);
+ else
+ RetError(9)
+ break;
+
+ // DefinedCommands
+ case 10:
+ if ((stAux=ExtractPair(fPos,wasMoved))!=stkNULL)
+ DefinedCommands->insert(stAux);
+ else
+ RetError(9)
+ break;
+
+ // ASCIIConvert
+ case 11:
+ if (!ASCIIConv)
+ {
+ ASCIIConv=new stkHandler[256];
+ for (i=0; i<256; i++)
+ ASCIIConv[i]=stkNULL;
+ }
+/* pos=MoveAfterEqual(fPos);
+ auxP=fPos;
+ fPos=NextLineOf(pos); wasMoved=1;
+ ReplaceCRby0(pos);
+ ASCIIConv[(unsigned char)*auxP]=stk->addStr(pos);*/
+ auxP=fPos;
+ ASCIIConv[(unsigned char)*auxP]=GetValueStk(fPos,wasMoved);
+ break;
+
+ // Configuration
+ case 12:
+ if (strncmp(fPos,"CommandLine",11)==0)
+ {
+ if (!SpectCommand)
+ RetError(18)
+ GetValueStk(fPos,wasMoved);
+ SpectCommand=0;
+ }
+ else
+ if (strncmp(fPos,"Name",4)==0)
+ {
+ if (SpectCommand)
+ RetError(19)
+ CommandLines->insert(GetValueStk(fPos,wasMoved));
+ SpectCommand=1;
+ }
+ else
+ if (strncmp(fPos,"Language",8)==0)
+ {
+ Language=DuplicateStr(fPos,wasMoved);
+ }
+ else
+ RetError(9)
+ break;
+ }
+ if (TXHError)
+ {
+ delete file;
+ return 1;
+ }
+ }
+ while (*fPos);
+ }
+ while (*fPos);
+
+ delete file;
+ if (!StartFound)
+ {
+ TXHError=2;
+ return 1;
+ }
+ if (!EndFound)
+ {
+ TXHError=3;
+ return 1;
+ }
+ if (!Definitions)
+ {
+ TXHError=4;
+ return 1;
+ }
+ if (!GenerateFound)
+ {
+ TXHError=5;
+ return 1;
+ }
+ if (!StartMenu || !EntryMenuVal || !EndMenuVal)
+ {
+ TXHError=13;
+ return 1;
+ }
+ if (!mAssoMain)
+ {
+ TXHError=14;
+ return 1;
+ }
+ if (!mAssoRest)
+ {
+ TXHError=15;
+ return 1;
+ }
+ if (!mMain)
+ {
+ TXHError=16;
+ return 1;
+ }
+ if (!EndOfPar || !CrossRef)
+ {
+ TXHError=17;
+ return 1;
+ }
+/* for (i=0; i<256; i++)
+ {
+ if (ASCIIConv[i]!=stkNULL)
+ printf("\"%s\", // %d\n",stk->GetStrOf(ASCIIConv[i]),i);
+ else
+ printf("NULL, // %d\n",i);
+ }*/
+ return 0;
+}
+#undef RetError
+
+static char *SkipThisLine(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ if (*s)
+ {
+ for (; *s && ucisspace(*s); s++);
+ if (*s && strncmp(s,Skip,SkipL)==0)
+ for (s+=SkipL; *s && (*s==' ' || *s=='\t'); s++);
+ }
+ return s;
+}
+
+char *TakeNum(char *s,int *num)
+{
+ int val=0;
+
+ if (!*s)
+ return s;
+ if (ucisdigit(*s))
+ {
+ val=*s-'0';
+ s++;
+ if (ucisdigit(*s))
+ {
+ val=val*10+*s-'0';
+ s++;
+ }
+ }
+ *num=val;
+ return s;
+}
+
+static int IsUsed(int n)
+{
+ if (n==100)
+ return 1;
+ if (n>=MAX_DEFS)
+ return 0;
+ return Used[n]!=NULL || (tDefs[n]==2 && Defaults[n]!=NULL && !SkipDefault[n]);
+}
+
+
+static int FixUpPointers(int num, char *&start, char *&end)
+{
+ char *s,*e;
+
+ if (!IsUsed(num))
+ return 0;
+
+ if (Used[num])
+ {
+ s=Used[num];
+ e=Ends[num];
+ }
+ else
+ {
+ s=Defaults[num];
+ e=DefaultsEnds[num];
+ }
+
+ // Skip blanks
+ if (!(SkipDefault[num] && tDefs[num]!=2))
+ {
+ for (s++;*s && s<e && ucisspace(*s); s++);
+ for (--e;e>s && *e!='\n'; e--);
+ do
+ {
+ for (;e>s && ucisspace(*e); e--);
+ if (e-s>=SkipL && strncmp(e-(SkipL-1),Skip,SkipL)==0)
+ e-=SkipL;
+ }
+ while (e>s && ucisspace(*e));
+ if (e==s)
+ return 0;
+ }
+
+ start=s;
+ end=e;
+ return 1;
+}
+
+static char *XrefPar[2];
+
+static int CheckUsedXref(int num)
+{
+ if (num>=0 && num<2)
+ return XrefPar[num]!=NULL;
+ return 0;
+}
+
+static void PutXrefCode(int num,FILE *f)
+{
+ if (num>=0 && num<2)
+ fputs(XrefPar[num],f);
+}
+
+static int GetVarXref(int num,char *&start,char *&end,int &flags)
+{
+ if (CheckUsedXref(num))
+ {
+ start=XrefPar[num];
+ end=0;
+ flags=sdgSimpleString | sdgASCIIZ;
+ return 1;
+ }
+ return 0;
+}
+
+static int ParseXref(char *s, char *e,FILE *f)
+{
+ int l=e-s;
+ int r=0;
+ char *st,*pos,*s2,*e2,v,*saux;
+
+ if (l<4)
+ return 0;
+
+ if (*(s+2)=='{')
+ {
+ for (st=s+3 ;l && *s!='}'; s++,r++,l--);
+ if (*s=='}')
+ {
+ *s=0;
+ pos=strstr(st,"::");
+ if (!pos)
+ {
+ pos=strchr(st,',');
+ if (!pos)
+ XrefPar[1]=XrefPar[0]=st;
+ else
+ {
+ l=pos-st;
+ saux=(char *)alloca(l+1);
+ strncpy(saux,pos,l);
+ saux[l]=0;
+ XrefPar[0]=saux;
+ XrefPar[1]=pos+1;
+ }
+ }
+ else
+ if (pos==st)
+ {
+ l=strlen(st+2);
+ if (Distinguish && FixUpPointers(Distinguish,s2,e2))
+ {
+ l+=5+e2-s2;
+ saux=(char *)alloca(l);
+ v=*(e2+1);
+ *(e2+1)=0;
+ sprintf(saux,"%s (%s)",st+2,s2);
+ *(e2+1)=v;
+ XrefPar[1]=saux;
+ }
+ else
+ XrefPar[1]=st+2;
+ XrefPar[0]=st+2;
+ }
+ else
+ {
+ *pos=0;
+ saux=(char *)alloca(strlen(pos+2)+strlen(st)+5);
+ sprintf(saux,"%s (%s)",pos+2,st);
+ XrefPar[1]=saux;
+ XrefPar[0]=pos+2;
+ *pos=':';
+ }
+ GenerateCodeFor(CrossRef,CheckUsedXref,PutXrefCode,GetVarXref,f);
+ *s='}';
+ }
+ }
+
+ return r;
+}
+
+const int maxParameters=10;
+typedef struct
+{
+ char *command;
+ int num_param;
+ char *parameters[maxParameters];
+ int lens[maxParameters];
+} stParseCom;
+
+stParseCom *GlobalParseCom;
+
+static int CheckUsedPCom(int num)
+{
+ return (num<GlobalParseCom->num_param);
+}
+
+static void PutPComVal(int num, FILE *f)
+{
+ if (num<GlobalParseCom->num_param)
+ OutPutString(GlobalParseCom->parameters[num],
+ GlobalParseCom->parameters[num]+GlobalParseCom->lens[num],
+ f);
+// fwrite(GlobalParseCom->parameters[num],GlobalParseCom->lens[num],1,f);
+}
+
+static int GetVarPCom(int num,char *&start,char *&end,int &flags)
+{
+ if (CheckUsedPCom(num))
+ {
+ start=GlobalParseCom->parameters[num];
+ end=GlobalParseCom->parameters[num]+GlobalParseCom->lens[num];
+ flags=0;
+ return 1;
+ }
+ return 0;
+}
+
+static int ParseCommand(char *s, char *e, FILE *f)
+{
+ int l=e-s,Level;
+ int r=0;
+ char *p,*st;
+ stParseCom pc,*old;
+ ccIndex index;
+
+ old=GlobalParseCom;
+ GlobalParseCom=&pc;
+ if (l<3)
+ goto GoBack;
+ // Start of name
+ st=s+2;
+ for (p=st; p<e && *p!='>'; p++)
+ if (*p=='@' && *(p+1)=='>')
+ p++;
+ if (*p!='>')
+ goto GoBack;
+ l=p-st;
+ pc.command=(char *)alloca(l+1);
+ if (!pc.command)
+ goto GoBack;
+ for (p=pc.command; st<e && *st!='>'; st++,p++)
+ {
+ if (*st=='@' && *(st+1)=='>')
+ st++;
+ *p=*st;
+ }
+ *p=0;
+ pc.num_param=0;
+ p=st; p++;
+ if (p<e && *p=='{')
+ {
+ do
+ {
+ p++;
+ st=pc.parameters[pc.num_param]=p;
+ Level=0;
+ for (l=0; p<e; p++,l++)
+ {
+ if (*p=='@' && p+1<e)
+ {
+ p++; l++;
+ }
+ else
+ if (*p=='{')
+ Level++;
+ else
+ if (*p=='}')
+ {
+ if (Level==0)
+ break;
+ Level--;
+ }
+ else
+ if (*p==',' && Level==0)
+ break;
+ }
+ pc.lens[pc.num_param++]=p-st-1;
+ }
+ while (*p!='}' && pc.num_param<maxParameters);
+ p++;
+ }
+ r=p-s-1;
+
+ // Now: is that a valid command?
+ if (DefinedCommands->Search(pc.command,index))
+ {
+ stkHandler temp=(stkHandler)(DefinedCommands->at(index));
+ temp=stkAliasGlobal->GetPreviousOf(temp);
+ GenerateCodeFor(stkAliasGlobal->GetStrOf(temp),CheckUsedPCom,PutPComVal,GetVarPCom,f);
+ }
+ else
+ // If isn't valid just let as-is
+ fputs(pc.command,f);
+
+GoBack:
+ GlobalParseCom=old;
+ return r;
+}
+
+void OutPutString(char *s, char *e,FILE *f)
+{
+ if (*s && e-s>=SkipL && strncmp(s,Skip,SkipL)==0)
+ s+=SkipL;
+ for (;s<=e && *s; s++)
+ {
+ switch (*s)
+ {
+ case '@':
+ if (s==e)
+ fputc(*s,f);
+ else
+ if (*(s+1)=='@')
+ {
+ if (DoubleA)
+ fputs(DoubleA,f);
+ s++;
+ }
+ else
+ if (*(s+1)=='{' || *(s+1)=='}')
+ {
+ s++;
+ if (ASCIIConv[(unsigned char)*s]!=stkNULL)
+ fputs(stkAliasGlobal->GetStrOf(ASCIIConv[(unsigned char)*s]),f);
+ else
+ fputc(*s,f);
+ }
+ else
+ if (*(s+1)=='p' && !TVCodePage::isAlpha(*(s+2)))
+ {
+ fprintf(f,"\n%s\n",EndOfPar);
+ s++;
+ }
+ else
+ if (*(s+1)=='*')
+ {
+ if (BreakLine)
+ fputs(BreakLine,f);
+ s++;
+ }
+ else
+ if (*(s+1)=='x' && *(s+2)=='{')
+ s+=ParseXref(s,e,f);
+ else
+ if (*(s+1)=='<')
+ s+=ParseCommand(s,e,f);
+ else
+ fputc(*s,f);
+ break;
+
+ case '\r':
+ fputc(*s,f);
+ s++;
+ if (*s!='\n')
+ break;
+ case '\n':
+ fputc(*s,f);
+ // Skip blanks
+ for (s++; s<=e && *s && ucisspace(*s); s++);
+ // Skip indentation
+ if (*s && e-s>=SkipL && strncmp(s,Skip,SkipL)==0)
+ {
+ for (s+=SkipL; s<=e && *s && (*s==' ' || *s=='\t'); s++);
+ }
+ if (*s && s<=e)
+ s--;
+ break;
+
+ default:
+ if (ASCIIConv[(unsigned char)*s]!=stkNULL)
+ fputs(stkAliasGlobal->GetStrOf(ASCIIConv[(unsigned char)*s]),f);
+ else
+ fputc(*s,f);
+ }
+ }
+}
+
+static void TakeValueOf(int num,FILE *f)
+{
+ char *s,*e;
+
+ if (!FixUpPointers(num,s,e))
+ return;
+
+ OutPutString(s,e,f);
+}
+
+static void FillAssociations(int num, char *var)
+{
+ char *s,*e,v;
+ int i;
+
+ if (num>=90)
+ {
+ for (i=0; i<Associations; i++)
+ if (AssoVar[i]==num)
+ AssoObj[i]->insert(var,HandlerKey);
+ }
+ else
+ {
+ if (!FixUpPointers(num,s,e))
+ return;
+
+ for (i=0; i<Associations; i++)
+ if (AssoVar[i]==num)
+ {
+ v=*(e+1);
+ *(e+1)=0;
+ AssoObj[i]->insert(s,HandlerKey);
+ *(e+1)=v;
+ }
+ }
+}
+
+inline
+void AlignLen(int &len)
+{
+ if (len & 3)
+ len+=4-(len & 3);
+}
+
+static char *SearchInfList(int line)
+{
+ ccIndex i,c;
+ int l,min=1000000,dif;
+ char *best=NULL;
+
+ c=fList->getCount();
+ for (i=0; i<c; i++)
+ {
+ char *s=fList->atStr(i);
+ int length=strlen(s)+1;
+ AlignLen(length);
+ l=*(int *)(s+length);
+ dif=abs(l-line);
+ if (dif<min)
+ {
+ min=dif;
+ best=s;
+ }
+ }
+
+ return best;
+}
+
+static void AutoFill(int line)
+{
+ char *s,*p;
+ // GCC says Class and Function can be used unitialized?!
+ char *Class=0,*Function=0,*Prototype;
+ int lClass=0,lFunction=0,lPrototype=0;
+ int l;
+
+ if ((s=SearchInfList(line))!=NULL)
+ {
+ // Get the prototype (no ret value sorry), Function and Class names
+ Prototype=s;
+ lPrototype=strlen(s);
+ s=strstr(Prototype,"::");
+ if (s)
+ {
+ lClass=s-Prototype;
+ Class=Prototype;
+ s+=2;
+ }
+ else
+ s=Prototype;
+ p=strchr(s,'(');
+ if (p)
+ {
+ lFunction=p-s;
+ Function=s;
+ }
+ else
+ {
+ lFunction=lPrototype;
+ Function=Prototype;
+ }
+ // Fill the variables
+ for (l=0; l<Definitions; l++)
+ {
+ if (Used[l]==NULL)
+ {
+ switch (tDefs[l])
+ {
+ case 3:
+ Used[l]=Prototype;
+ Ends[l]=Prototype+lPrototype;
+ SkipDefault[l]=1;
+ break;
+ case 4:
+ if (lClass)
+ {
+ Used[l]=Class;
+ Ends[l]=Class+lClass-1;
+ SkipDefault[l]=1;
+ }
+ break;
+ case 5:
+ if (lFunction)
+ {
+ Used[l]=Function;
+ Ends[l]=Function+lFunction-1;
+ SkipDefault[l]=1;
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+
+
+const int DistExtraLen=8;
+
+/**[txh]********************************************************************
+
+ Description:
+ This function adds a new string to FunList but making sure it is a
+different one.
+
+***************************************************************************/
+
+static
+stkHandler AddDifferentStr(SOStack &stk, char *s, int l)
+{
+ ccIndex pos;
+ char *aux=(char *)alloca(l+DistExtraLen);
+
+ strcpy(aux,s);
+ if (FunList->Search(s,pos))
+ { // Change it until we find a non-used name
+ int i=1;
+ do
+ {
+ sprintf(aux,"%s <%d>",s,i);
+ }
+ while (++i<1000 && FunList->Search(aux,pos));
+ }
+ return stk.addStr(aux);
+}
+
+static void AddMain(SOStack &stk)
+{
+ char *s,*e;
+ char *s2,*e2,*aux;
+
+ if (FixUpPointers(0,s,e))
+ {
+ if (Distinguish && FixUpPointers(Distinguish,s2,e2))
+ {
+ int l1=e-s+1;
+ int l2=e2-s2+1;
+ int l=l1+l2+3+1;
+
+ aux=(char *)alloca(l);
+ strncpy(aux,s,l1);
+ aux[l1]=0;
+ strcat(aux," (");
+ strncat(aux,s2,l2);
+ aux[l-2]=0;
+ strcat(aux,")");
+ HandlerKey=AddDifferentStr(stk,aux,l);
+ }
+ else
+ {
+ int l=e-s+1+1;
+
+ aux=(char *)alloca(l);
+ strncpy(aux,s,l);
+ aux[l-1]=0;
+ HandlerKey=AddDifferentStr(stk,aux,l);
+ }
+ FunList->insert(HandlerKey);
+ }
+}
+
+static void AddContent(void)
+{
+ int i,j,var;
+ char *s1,*e1,*s2,*e2,v1,v2;
+
+ for (i=0; i<Definitions; i++)
+ {
+ if (Used[i]!=NULL && tDefs[i]==6)
+ {
+ for (j=0; j<Associations; j++)
+ {
+ var=AssoVar[j];
+ if (Used[var])
+ {
+ if (!FixUpPointers(i,s1,e1))
+ return;
+ v1=*(e1+1);
+ *(e1+1)=0;
+ if (!FixUpPointers(var,s2,e2))
+ return;
+ v2=*(e2+1);
+ *(e2+1)=0;
+ AssoObj[j]->SetContent(s2,s1);
+ *(e1+1)=v1;
+ *(e2+1)=v2;
+ return;
+ }
+ }
+ }
+ }
+}
+
+static int CheckUsedVar(int num)
+{
+ return num<MAX_DEFS && IsUsed(num);
+}
+
+static int CheckUsedMain(int num)
+{
+ return num>0 && (num<6 || (num>=50 && num<50+Replaces));
+}
+
+#define CheckUsedAssoMain CheckUsedMenu
+#define CheckUsedAssoRest CheckUsedMenu
+static int CheckUsedMenu(int num)
+{
+ return num>0 && num<3;
+}
+
+static void PutVarText(int num,FILE *f)
+{
+ if (num==90)
+ fputs(FileUnderProcess,f);
+ else
+ if (num==91)
+ fprintf(f,"%d",TXHLine);
+ else
+ if (num==92)
+ {
+ #if 1
+ fputs(stkAliasGlobal->GetStrOf(HandlerKey),f);
+ #else
+ TakeValueOf(0,f);
+ if (Used[Distinguish])
+ {
+ fputs(" (",f);
+ TakeValueOf(Distinguish,f);
+ fputs(")",f);
+ }
+ #endif
+ }
+ else
+ TakeValueOf(num,f);
+}
+
+static int GetVarText(int num,char *&start,char *&end,int &flags)
+{
+ if (num==90)
+ {
+ start=end=FileUnderProcess;
+ flags=sdgSimpleString | sdgASCIIZ;
+ return 1;
+ }
+ else
+ if (num==91)
+ {
+ end=start=new char[26];
+ sprintf(start,"%d",TXHLine);
+ flags=sdgSimpleString | sdgASCIIZ;
+ return 1;
+ }
+ else
+ if (num==92)
+ {
+ char *s1,*e1;
+ if (Used[Distinguish] && FixUpPointers(Distinguish,s1,e1))
+ {
+ char *s2,*e2;
+ if (!FixUpPointers(0,s2,e2))
+ return 0;
+ int l=e1-s1+e2-s2+4;
+ end=start=new char[l];
+ strncpy(start,s2,e2-s2);
+ strcat(start," (");
+ strncat(start,s1,e1-s1);
+ strcat(start,")");
+ flags=sdgFreeIt | sdgSimpleString;
+ }
+ else
+ {
+ if (!FixUpPointers(0,start,end))
+ return 0;
+ flags=sdgSimpleString;
+ }
+ return 1;
+ }
+ else
+ {
+ if (!FixUpPointers(num,start,end))
+ return 0;
+ flags=sdgSimpleString;
+ }
+ return 1;
+}
+
+static char *Vs,*No,*Ex;
+
+static void PutMenuVal(int num,FILE *f)
+{
+ switch (num)
+ {
+ case 1:
+ fputs(Vs,f);
+ break;
+ case 2:
+ fputs(No,f);
+ if (Ex)
+ fprintf(f," %s",Ex);
+ break;
+ }
+}
+
+static int GetVarMenu(int num,char *&start,char *&end,int &flags)
+{
+ flags=sdgSimpleString | sdgASCIIZ;
+ switch (num)
+ {
+ case 1:
+ end=start=Vs;
+ return 1;
+ case 2:
+ if (Ex)
+ {
+ int l;
+ char *s;
+ l=strlen(No)+strlen(Ex)+2;
+ s=new char[l];
+ sprintf(s,"%s %s",No,Ex);
+ flags|=sdgFreeIt;
+ }
+ else
+ end=start=No;
+ return 1;
+ }
+ return 0;
+}
+
+void GenMenuEntry(FILE *f, char *Visible, char *Node, char *extra=NULL)
+{
+ char *s1=Vs,*s2=No,*s3=Ex; // Funny thing, a menu entry could support a menu entry inside ;-P
+ Vs=Visible; No=Node; Ex=extra;
+ GenerateCodeFor(EntryMenuVal,CheckUsedMenu,PutMenuVal,GetVarMenu,f);
+ fputc('\n',f);
+ Vs=s1; No=s2; Ex=s3;
+}
+
+static void PutMainCode(int num,FILE *f)
+{
+ int i,l;
+ char LineB[1000];
+
+ switch (num)
+ {
+ // Main menu
+ case 1:
+ fprintf(f,"%s\n",StartMenu);
+ GenMenuEntry(f,"Alphabetical list of functions","Alphabetical List");
+ for (i=0; i<Associations; i++)
+ GenMenuEntry(f,AssoMenu[i],AssoNode[i]);
+ fprintf(f,"%s\n\n",EndMenuVal);
+ break;
+
+ // Name of the function list node
+ case 2:
+ fputs("Alphabetical List",f);
+ break;
+
+ // Menu for all the functions
+ case 3:
+ fprintf(f,"%s\n",StartMenu);
+ i=FunList->getCount();
+ for (l=0; l<i; l++)
+ GenMenuEntry(f,FunList->atStr(l),FunList->atStr(l));
+ fprintf(f,"%s\n\n",EndMenuVal);
+ break;
+
+ // All the associations code
+ case 4:
+ for (i=0; i<Associations; i++)
+ GenerateAssoc(AssoObj[i],AssoNode[i],AssoExtra[i],f);
+ break;
+
+ // All the function nodes from the other file
+ case 5:
+ while (!feof(TXHNodesFile))
+ { // That's strange to me, looks like feof is not enough here
+ if (!fgets(LineB,999,TXHNodesFile))
+ break;
+ fputs(LineB,f);
+ }
+ break;
+
+ default:
+ if (num>=50)
+ { // Values from section Replace
+ num-=50;
+ if (num<Replaces)
+ {
+ char *s=ListOfConstants->atStr(num);
+ OutPutString(s,s+strlen(s),f);
+ }
+ }
+ }
+}
+
+static int GetVarMain(int num,char *&start,char *&end,int &flags)
+{
+ switch (num)
+ {
+ // Name of the function list node
+ case 2:
+ start=end="Alphabetical List";
+ flags=sdgSimpleString | sdgASCIIZ;
+ return 1;
+
+ default:
+ if (num>=50)
+ { // Values from section Replace
+ num-=50;
+ if (num<Replaces)
+ {
+ start=end=ListOfConstants->atStr(num);
+ flags=sdgASCIIZ;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+static int GenerateCodeFor(char *mask,int (*checkUsedVar)(int),
+ void (*putVarText)(int,FILE*),
+ getVarFunction getVar,FILE *f)
+{
+ int Level=0,OkLevel=0,num;
+ char *s;
+
+ for (s=mask; *s;)
+ {
+ if (*s=='~') // Is an special value?
+ {
+ s++;
+ if (*s=='~') // Is a conditional?
+ {
+ s=TakeNum(++s,&num);
+ for (; *s && *s!='{'; s++);
+ if (*s) s++;
+ if (Level==OkLevel && checkUsedVar(num))
+ OkLevel++;
+ Level++;
+ }
+ else
+ if (*s=='}') // End of conditional
+ {
+ Level--;
+ if (OkLevel>Level)
+ OkLevel--;
+ s++;
+ }
+ else
+ if (*s=='(') // sLisp code
+ {
+ s=InterpretLispCode(s,getVar,f);
+ if (!s)
+ return 1; // Ret with error
+ }
+ else
+ { // A simple var
+ s=TakeNum(s,&num);
+ if (Level==OkLevel)
+ putVarText(num,f);
+ }
+ }
+ else
+ {
+ if (Level==OkLevel)
+ fputc(*s,f); // Not special put it
+ s++;
+ }
+ }
+ return 0;
+}
+
+int TXHGenerateFor(char *b,FILE *f,SOStack &stk)
+{
+ char *pos2=NULL,*st,*aux,*Next=b;
+ int i,cual;
+ int GenNode;
+ TXHLine=1;
+
+ for (i=0; i<Definitions; i++)
+ Defaults[i]=NULL;
+ do
+ {
+ // Search the start of the comment
+ b=Next;
+ st=strstr(b,Start);
+ if (st)
+ {
+ // Search the end
+ pos2=strstr(st+1,End);
+ if (pos2)
+ {
+ for (aux=b;aux<=pos2; aux++)
+ if (*aux=='\n')
+ TXHLine++;
+ Next=aux;
+ b=st;
+ // Scan the comment to know what markers are used
+ cual=-1;
+ for (i=0; i<Definitions; i++)
+ {
+ Used[i]=NULL;
+ SkipDefault[i]=0;
+ AddedToAsoc[i]=0;
+ }
+ GenNode=1;
+ do
+ {
+ b=SkipThisLine(b);
+ for (i=0; i<Definitions; i++)
+ if (strncmp(Defs[i],b,lDefs[i])==0)
+ {
+ if (tDefs[i]==6)
+ GenNode=0;
+ if (cual>=0)
+ {
+ Ends[cual]=b;
+ if (!SkipDefault[cual])
+ DefaultsEnds[cual]=b;
+ }
+ b+=lDefs[i];
+ cual=i;
+ if (tDefs[i]==2)
+ {
+ if (strncmp(b+1,"~no",2)==0)
+ SkipDefault[i]=1;
+ else
+ if (strncmp(b+1,"~clear",5)==0)
+ Defaults[i]=NULL;
+ else
+ Defaults[i]=Used[i]=b;
+ }
+ else
+ Used[i]=b;
+ break;
+ }
+ }
+ while (b<pos2);
+ if (cual>=0)
+ {
+ Ends[cual]=pos2;
+ if (!SkipDefault[cual])
+ DefaultsEnds[cual]=pos2;
+ }
+ if (GenNode)
+ {
+ // Process automatic fields
+ AutoFill(TXHLine);
+ // Add to main list
+ AddMain(stk);
+ for (i=0; i<Definitions; i++)
+ FillAssociations(i,NULL);
+ FillAssociations(90,FileUnderProcess);
+ // Scan the "Generate" code
+ if (GenerateCodeFor(Mask,CheckUsedVar,PutVarText,GetVarText,f))
+ return 1;
+ }
+ else // GenNode
+ // For vars type 6 => Set Content of association
+ AddContent();
+ }
+ }
+ }
+ while (st && pos2);
+ return 0;
+}
+
+
+static char *AssoNameT;
+static TNCSAssociative *AssoT;
+static char *extraT;
+
+static void PutAssoMainCode(int num, FILE *f)
+{
+ int i,l;
+ char *n;
+
+ switch (num)
+ {
+ // the name of the association
+ case 1:
+ fputs(AssoNameT,f);
+ break;
+ // the menu for it
+ case 2:
+ i=AssoT->getCount();
+ fprintf(f,"%s\n",StartMenu);
+ for (l=0; l<i; l++)
+ {
+ n=AssoT->atStr(l);
+ GenMenuEntry(f,n,n,extraT);
+ }
+ fprintf(f,"%s\n\n",EndMenuVal);
+ break;
+ }
+}
+
+static int GetVarAssoMain(int num,char *&start,char *&end,int &flags)
+{
+ if (num==1)
+ {
+ // the name of the association
+ end=start=AssoNameT;
+ flags=sdgSimpleString | sdgASCIIZ;
+ return 1;
+ }
+ return 0;
+}
+
+static int AssoNum;
+
+static void PutAssoRestCode(int num, FILE *f)
+{
+ char *Comment;
+ TNoCaseSOSStringCollection *col;
+ col=AssoT->atCol(AssoNum);
+
+ switch (num)
+ {
+ case 1:
+ fputs(AssoT->atStr(AssoNum),f);
+ if (extraT)
+ fprintf(f," %s",extraT);
+ break;
+
+ case 2:
+ fputs(AssoT->atStr(AssoNum),f);
+ break;
+
+ case 3:
+ Comment=AssoT->GetContent(AssoNum);
+ if (Comment)
+ OutPutString(Comment,Comment+strlen(Comment)-1,f);
+ break;
+
+ case 4:
+ {
+ int c,j;
+ c=col->getCount();
+ fprintf(f,"%s\n",StartMenu);
+ for (j=0; j<c; j++)
+ GenMenuEntry(f,col->atStr(j),col->atStr(j));
+ fprintf(f,"%s\n\n",EndMenuVal);
+ }
+ break;
+ }
+}
+
+static int GetVarAssoRest(int num,char *&start,char *&end,int &flags)
+{
+ char *s;
+
+ switch (num)
+ {
+ case 1:
+ s=AssoT->atStr(AssoNum);
+ if (extraT)
+ {
+ int l=strlen(s)+strlen(extraT)+2;
+ end=start=new char[l];
+ sprintf(start,"%s %s",s,extraT);
+ flags=sdgSimpleString | sdgASCIIZ | sdgFreeIt;
+ }
+ else
+ {
+ end=start=s;
+ flags=sdgSimpleString | sdgASCIIZ;
+ }
+ return 1;
+
+ case 2:
+ start=end=AssoT->atStr(AssoNum);
+ flags=sdgSimpleString | sdgASCIIZ;
+ return 1;
+
+ case 3:
+ s=AssoT->GetContent(AssoNum);
+ if (s)
+ {
+ start=end=s;
+ flags=sdgASCIIZ;
+ return 1;
+ }
+ break;
+ }
+ return 0;
+}
+
+static void GenerateAssoc(TNCSAssociative *a, char *name, char *extra, FILE *f)
+{
+ int i,l;
+
+ AssoNameT=name; AssoT=a; extraT=extra;
+ GenerateCodeFor(mAssoMain,CheckUsedAssoMain,PutAssoMainCode,GetVarAssoMain,f);
+ i=a->getCount();
+ for (l=0; l<i; l++)
+ {
+ AssoNum=l;
+ GenerateCodeFor(mAssoRest,CheckUsedAssoRest,PutAssoRestCode,GetVarAssoRest,f);
+ }
+}
+
+static void DumpFile(char *file,char *from,int kill=1)
+{
+ FILE *f;
+ char buf[256];
+ int l;
+
+ f=fopen(file,"rt");
+ if (f)
+ {
+ fgets(buf,256,f);
+ if (!feof(f))
+ {
+ TXHPrintMessage(from);
+ do
+ {
+ l=strlen(buf);
+ if (buf[l-1]=='\n')
+ buf[l-1]=0;
+ TXHPrintMessage(buf);
+ fgets(buf,256,f);
+ }
+ while (!feof(f));
+ }
+ fclose(f);
+ if (kill)
+ unlink(file);
+ }
+}
+
+static void CallCommandLine(char *s,char *pattern,char *s0,char *s1)
+{ // picky tricky string merge ;-)
+ if (strcmp(pattern,"NULL")==0)
+ return;
+ if (*pattern=='@')
+ {
+ char buf[PATH_MAX];
+ strcpy(buf,s1);
+ strcat(buf,pattern+1);
+ TXHPrintMessage("Copying files ...");
+ CopyFile(s0,buf);
+ return;
+ }
+ char *ori=s;
+ char *aux;
+ for (;*pattern; pattern++)
+ {
+ if (*pattern=='~' && *(pattern+1)=='0')
+ for (pattern++,aux=s0; *aux; aux++,s++) *s=*aux;
+ else
+ if (*pattern=='~' && *(pattern+1)=='1')
+ for (pattern++,aux=s1; *aux; aux++,s++) *s=*aux;
+ else
+ if (*pattern=='~' && *(pattern+1)=='9' && *(pattern+2)=='0')
+ {
+ pattern+=2;
+ if (TXHFilesDir)
+ for (aux=TXHFilesDir; *aux; aux++,s++) *s=*aux;
+ else
+ *(s++)='.';
+ }
+ else
+ {
+ *s=*pattern;
+ s++;
+ }
+ }
+ *s=0;
+ char *out=open_stdout();
+ char *err=open_stderr();
+ system(ori);
+ close_stdout();
+ close_stderr();
+ DumpFile(out,"From stdout:");
+ DumpFile(err,"From stderr:");
+}
+
+
+int TXHGenerateAll(void)
+{
+ FILE *f=NULL,*d=NULL;
+ int l,c,i,MustBeDeleted;
+ char *buffer;
+ SOStack stk,stkL;
+ char FileName[PATH_MAX];
+ char LineB[PATH_MAX];
+ char *tmp1=0,*tmp2=0;
+ int ret=0;
+
+ TXHError=0;
+ DefinedCommands=new TNoCaseSOSStringCollection(5,5,&stk);
+ ListOfConstants=new TNSSOSCol(7,5,&stk);
+ CommandLines =new TNSSOSCol(3,2,&stk);
+ stkAliasGlobal=&stk;
+
+ if (!DefinedCommands || !ListOfConstants || !CommandLines)
+ goto CleanUp;
+ // Read the spects
+ if (TXHFilesDir)
+ {
+ strcpy(FileName,TXHFilesDir);
+ l=strlen(FileName)-1;
+ if (FileName[l-1]!='/' && FileName[l-1]!='\\')
+ {
+ FileName[l+1]='/';
+ FileName[l+2]=0;
+ }
+ strcat(FileName,TXHFormatFile);
+ }
+ else
+ strcpy(FileName,TXHFormatFile);
+ if (TXHReadSpects(FileName,&stk))
+ {
+ ret=1;
+ goto CleanUp;
+ }
+
+ // Generate the file
+ ret=2;
+ tmp1=unique_name("tx");
+ if (TXHKeepTemporal)
+ tmp2=string_dup(TXHTempGenFile);
+ else
+ tmp2=unique_name("tg");
+ TXHNodesFile=f=fopen(tmp1,"wt+");
+ if (!f)
+ {
+ TXHError=22;
+ goto CleanUp;
+ }
+ // List of all functions
+ FunList = new TNoCaseSOSStringCollection(20,5,&stk);
+
+ ret=3;
+ TXHGenSection=4;
+ do
+ {
+ buffer=TXHGetNextFile(l,MustBeDeleted,FileName);
+ if (buffer)
+ {
+ fList=new TNoCaseSOSStringCollection(20,5,&stkL);
+ if (fList)
+ {
+ CreateFunctionList(buffer,l,stkL,fList,0,Language ? Language : "C/C++");
+ FileUnderProcess=FileName;
+ if (TXHGenerateFor(buffer,f,stk))
+ goto CleanUp;
+ delete fList;
+ fList=NULL; // Mark as deleted
+ stkL.Clean();
+ }
+ if (MustBeDeleted)
+ delete buffer;
+ }
+ }
+ while (buffer);
+ ret=2;
+
+ rewind(f);
+ d=fopen(tmp2,"wt");
+ if (!d)
+ {
+ TXHError=22;
+ goto CleanUp;
+ }
+ GenerateCodeFor(mMain,CheckUsedMain,PutMainCode,GetVarMain,d);
+ fclose(d);
+ fclose(f);
+ d=f=NULL;
+
+ c=CommandLines->getCount();
+ for (i=0; i<c; i++)
+ {
+ stkHandler st=(stkHandler)(CommandLines->at(i));
+ stkHandler pr=stk.GetPreviousOf(st);
+
+ TXHPrintMessage("");
+ char tmp[200];
+ strcpy(tmp,"Generating: ");
+ strncat(tmp,stk.GetStrOf(st),187);
+ tmp[199]=0;
+ TXHPrintMessage(tmp);
+ CallCommandLine(LineB,stk.GetStrOf(pr),tmp2,TXHOutBaseName);
+ }
+ ret=0;
+
+CleanUp:
+ if (f)
+ fclose(f);
+ if (d)
+ fclose(d);
+
+ unlink(tmp1);
+ string_free(tmp1);
+ if (!TXHKeepTemporal)
+ unlink(tmp2);
+ string_free(tmp2);
+
+ // TVision objects have destroy to check for NULL
+ CLY_destroy(FunList);
+ CLY_destroy(fList);
+ CLY_destroy(DefinedCommands);
+ CLY_destroy(ListOfConstants);
+ CLY_destroy(CommandLines);
+ // Init Vars
+ for (i=0; i<Associations; i++)
+ {
+ // delete double checks for NULL pointers, so it's safe
+ delete AssoMenu[i];
+ delete AssoNode[i];
+ delete AssoExtra[i];
+ delete AssoObj[i];
+ }
+ DeleteArray(Mask);
+ DeleteArray(StartMenu);
+ DeleteArray(EntryMenuVal);
+ DeleteArray(EndMenuVal);
+ DeleteArray(EndOfPar);
+ DeleteArray(CrossRef);
+ DeleteArray(DoubleA);
+ DeleteArray(ASCIIConv);
+ DeleteArray(BreakLine);
+ DeleteArray(Language);
+ return ret;
+}
+
+
diff --git a/setedit/sdg/txhgen.txt b/setedit/sdg/txhgen.txt
new file mode 100644
index 0000000..38b4fd8
--- /dev/null
+++ b/setedit/sdg/txhgen.txt
@@ -0,0 +1,327 @@
+#
+# This file sets the behavior of the txh generator
+#
+# Lines starting with # or spaces are skiped except in strings or in [Generate]
+# Be carefull with [ it delimits sections!
+#
+
+[Configuration]
+#
+# The CommandLine indicates what postprocess program is called.
+# ~0 is the name of the input file.
+# ~1 is the name of the output file.
+#
+# This file can generate .info, .html and .txt files so 3 command
+# lines are provided.
+#
+CommandLine=makeinfo --no-validate --fill-column 78 -o ~1.info ~0
+Name=Info (.info) file format
+CommandLine=makeinfo --no-validate --fill-column 78 -Dhtml -o ~1.html ~0
+Name=HTML file format
+CommandLine=makeinfo --no-validate --fill-column 78 -Dtext -o ~1.txt ~0
+Name=Text (.txt) file format
+
+[Delimiters]
+# Up to 11 characters
+SectionStart=/**[txh]**
+# Up to 11 characters
+SectionEnd=*********/
+
+[Variables]
+#
+# Up to 16 definitions
+#
+# Codes for the behavior of the definitions:
+# 1 Normal, put the content if found.
+# 2 Repeat, use the last value found in the file, ~no is an exeption, ~clear stops
+# 3 If not found replace by the prototype.
+# 4 If not found replace by the class.
+# 5 If not found replace by the name of the function
+# 6 It disables the node generation for this comment. The variable is
+# stored in the first variable that have associations and is in the comment.
+#
+# Additionally there are 2 special variables:
+# 90 Name of the file
+# 91 Line number of the end of the comment
+# 92 Name of the var 0 in the format: ~0 ~~Distinguish{(~Distinguish)~} (node name)
+#
+# 0 The first variable is the main index variable
+#
+AddDefinition=Function,5
+# 1
+AddDefinition=Class,4
+# 2
+AddDefinition=Include,2
+# 3
+AddDefinition=Module,2
+# 4
+AddDefinition=Prototype,3
+# 5
+AddDefinition=Description,1
+# 6
+AddDefinition=Return,1
+# 7
+AddDefinition=Example,1
+# 8
+AddDefinition=Comments,6
+#
+# It says what variable is added to distinguish between 2 vars 0 that are equal
+#
+Distinguish=1
+
+[Associations]
+#
+# Up to 8 associations
+#
+# The associations are between the 0 variable and another variable.
+#
+# Name in main menu, node, variable, optional to add to each node
+#
+AddAssoc=List by classes,Classes,1,(class)
+AddAssoc=List by modules,Modules,3
+AddAssoc=List by files,Files,90
+
+[Replace]
+#
+# All must be delimited by ", use as many as you need. They can be used
+# in the GenMain section.
+#
+# Be carreful the strings are passed by the macro expander.
+#
+# Name of the generated file
+Constant="documen.info"
+
+# Name of the documentation manual, title in HTML
+Constant="My documentation"
+
+# Copyright for info files
+Constant="This file documents the functions of my library
+@p
+Copyright 1997
+@p
+Permission is granted to copy this documentation for free.
+@p"
+
+# Name of the printed manual
+Constant="My documentation"
+
+# Author
+Constant="SET"
+
+# Copyright page
+Constant="Copyright @copyright@<{}> 1997
+@p
+Published by SET
+@p
+Permission is granted to copy this documentation for free."
+
+# Description for info files
+Constant="This document describes the functions of my library
+@p
+This document applies to version 0.0.1
+of the program named A Real World
+@p"
+
+[Commands]
+#
+# @p = end of paragraph
+#
+EndOfPar=@paragraph{}
+#
+# @* = break line
+#
+BreakLine=@*
+#
+# @{value} is the special cross ref.
+# ~0 Is the visible name of a reference
+# ~1 Is the real name of a reference
+#
+CrossRef=@xref{~1~~0{,~0~}}
+#
+# What we must get from a @@ sequence
+#
+Double@=@@
+
+[DefinedCommands]
+#
+# The format is @<name>{parameters ...}
+#
+subtitle=@_subheading{~0}
+pre=@example{}
+/pre=@end_example
+
+#
+# This section says how to translate ASCIIs
+#
+[ASCIIConvert]
+=@aacute{}
+=@eacute{}
+=@iacute{}
+=@oacute{}
+=@uacute{}
+=@ntilde{}
+=@Ntilde{}
+=@exclamdown{}
+=@questiondown{}
+=@auml{}
+=@euml{}
+=@iuml{}
+=@ouml{}
+=@uuml{}
+=@Uuml{}
+=@agrave{}
+=@egrave{}
+=@igrave{}
+=@ograve{}
+=@ugrave{}
+{=@{
+}=@}
+<=@lessthan{}
+>=@greaterthan{}
+
+#
+# Use ~number to use one variable
+# Use ~~number{} for conditional, all the code inside {} will become
+# conditional
+#
+[GenNode]
+@node{~92,~90,~~1{~1~},~~3{~3~}}
+@chapter ~0 (~90 ~91)
+
+@_subheading{Syntax}
+
+~~2{@example
+# This line is a comment, but the next is code
+ #include @lessthan{}~2@greaterthan{}
+@end_example~}
+~~4{@example
+ ~4;
+@end_example~}
+~~1{
+@_subheading{Member of the class:}
+~1
+~}
+
+~~5{
+@_subheading{Description}
+
+~5
+~}
+~~6{
+@_subheading{Return Value}
+
+~6
+~}
+~~7{
+@_subheading{Example}
+
+~7
+~}
+@separatenode{}
+@c ----------------------------------------------------------------------
+
+[GenMenu]
+Start=@menu
+#
+# ~1 is the visible name
+# ~2 is the name of the node
+#
+Entry=@mitem{~1,~2}
+End=@end_menu{}
+
+#
+# ~1 is the name of the association
+# ~2 is the menu for it
+#
+[GenAssoMain]
+@node{~1,Top}
+@section ~1
+
+~2
+#
+# ~1 is the name of the association
+# ~2 is the name without the distinguish
+# ~3 is the comment for it
+# ~4 is the menu for it
+#
+[GenAssoRest]
+@node{~1,Top}
+@section ~2
+
+~3
+
+~4
+
+#
+# ~1 Main menu
+# ~2 Name of the function list node
+# ~3 Menu for all the functions
+# ~4 All the associations code
+# ~5 All the function nodes
+# ~50+ Values from section Replace
+#
+[GenMain]
+\input texinfo @c -*-texinfo-*-
+@c %%**start of header
+@setfilename ~50
+@settitle ~51
+@setchapternewpage odd
+@c %%**end of header
+
+@ifset html
+@include txhgen-i.htm
+@html
+@end ifset
+
+@ifset text
+@include txhgen-i.txt
+@end ifset
+
+@ifclear text
+@ifclear html
+@include txhgen-i.txi
+@end ifclear
+@end ifclear
+
+@ifinfo
+~52
+@end ifinfo
+
+@c This title page illustrates only one of the
+@c two methods of forming a title page.
+
+@titlepage
+@title ~53
+@author ~54
+
+@c The following two commands
+@c start the copyright page.
+@page
+@vskip 0pt plus 1filll
+~55
+@end titlepage
+
+@node{Top}
+
+@ifset html
+@htmltitle{~51}
+@end ifset
+
+@ifinfo
+~56
+@end ifinfo
+
+~1
+
+@node{~2,Top}
+@section ~2
+
+~3
+
+~4
+
+~5
+
+@contents
+@bye
+
diff --git a/setedit/sdg/txhmain.cc b/setedit/sdg/txhmain.cc
new file mode 100644
index 0000000..ebee04f
--- /dev/null
+++ b/setedit/sdg/txhmain.cc
@@ -0,0 +1,187 @@
+/*****************************************************************************
+
+ Copyright (c) 1997-2003 by Salvador Eduardo Tropea.
+
+ That's an example of interface with SDG.
+ In this case the program is a command line one.
+
+ Important:
+ SDGLib uses SET TV Utils and bufun.cc.
+ This example uses a special bufun.cc to avoid linking half of TVision to
+the program.
+
+*****************************************************************************/
+#include <ceditint.h>
+
+#ifdef TVCompf_djgpp
+#include <io.h>
+#endif
+#include <stdio.h>
+#define Uses_string
+#define Uses_filelength
+#include <stdlib.h>
+#include <txhgen.h>
+#define Uses_TMLISDGDefs
+#include <mli.h>
+#include <tv.h>
+
+static int CountFiles;
+static int CantFiles;
+static char **Files;
+
+#ifdef SECompf_djgpp
+#include <dpmi.h>
+#include <go32.h>
+#include <fcntl.h>
+const int maxSFNSize=68;
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the short file name of the passed file. The shortName pointer must
+point to a buffer with at least maxSFNSize bytes.
+
+ Return:
+ A pointer to the converted name if succesful or the original name if it
+fails.
+
+***************************************************************************/
+
+char *GetShortNameOf(char *longName, char *shortName)
+{
+ __dpmi_regs r;
+ unsigned long tbuf=__tb;
+
+ r.x.ax=0x7100;
+ if (_USE_LFN)
+ {
+ dosmemput (longName,strlen(longName)+1,tbuf+maxSFNSize);
+ r.x.ax=0x7160;
+ r.x.es=r.x.ds=tbuf >> 4;
+ r.x.di=0;
+ r.x.si=maxSFNSize;
+ r.x.cx=0x8001;
+ __dpmi_int(0x21, &r);
+ }
+ if ((r.x.flags & 1)==0 && r.x.ax!=0x7100)
+ {
+ dosmemget(tbuf,maxSFNSize,shortName);
+ return shortName;
+ }
+ return longName;
+}
+#else
+char *GetShortNameOf(char *longName, char *)
+{
+ return longName;
+}
+#endif
+
+
+/**[txh]**********************************************************************
+
+ Description:
+ This function must be provided by the program. Your purpose is return the
+next buffer to process by SDG.
+@p
+ The function must fill l with the length of the buffer, MustBeDeleted with
+1 or 0 according to the kind of buffer and FileName with the name of the file.
+The name must be provided as you want it appears in the generated docs.
+
+ Return:
+ A pointer to the buffer with the C source or NULL if no more files are
+provided.
+
+*****************************************************************************/
+
+static char *GetNextFile(int &l, int &MustBeDeleted, char *FileName)
+{
+ FILE *f;
+ char *buffer,*pos;
+
+ if (CountFiles<CantFiles)
+ {
+ CountFiles++;
+ // Read the test file
+ f=fopen(Files[CountFiles],"rt");
+ if (!f)
+ {
+ printf("Failed to open the file %s\n",Files[CountFiles]);
+ return NULL;
+ }
+
+ l=filelength(fileno(f))+1;
+ buffer=new char[l];
+ if (!buffer)
+ return NULL;
+ fread(buffer,l,1,f);
+ buffer[l-1]=0;
+ fclose(f);
+
+ MustBeDeleted=1;
+ // Let just the filename
+ pos=strrchr(Files[CountFiles],'/');
+ if (pos)
+ pos++;
+ else
+ pos=Files[CountFiles];
+ strcpy(FileName,pos);
+ return buffer;
+ }
+ return NULL;
+}
+
+void PrintMessage(char *s)
+{
+ puts(s);
+}
+
+int main(int argc, char *argv[])
+{
+ // MUST BE ON or some frt files will fail
+ #ifdef SECompf_djgpp
+ __system_flags|=__system_allow_multiple_cmds;
+ #endif
+
+ // These variables controls SDG
+ TXHGetNextFile=GetNextFile;
+ TXHKeepTemporal=1;
+ TXHFormatFile="txhgen.txt";
+ TXHTempGenFile="Generated.txh";
+ TXHOutBaseName="out";
+ TXHPrintMessage=PrintMessage;
+
+ printf("SET's Documentation Generator (SDG)\nCopyright (c) 1997,2003 by Salvador E. Tropea\n");
+ if (argc==1)
+ {
+ printf("\nUse: sdg list_of_sources\n\n");
+ return 1;
+ }
+ CountFiles=0;
+ Files=argv;
+ CantFiles=argc-1;
+
+ // That's an example on how to decode the an error, isn't so easy
+ int error;
+ if ((error=TXHGenerateAll())!=0)
+ {
+ printf("Error while %s:\n",TXHGetErrorSection(error));
+ switch (error)
+ {
+ case 1:
+ printf("(%d) %s in line %d\n",TXHError,TXHGetErrorMessage(),TXHLine);
+ break;
+ case 0:
+ case 2:
+ printf("(%d) %s\n",TXHError,TXHGetErrorMessage());
+ break;
+ case 3:
+ printf("In section %s\n",TXHGetGenSect());
+ printf("Error of type: %s\n",MLISDGTypeError);
+ printf("%s\n",MLISDGErrorName);
+ printf("Code: %s\n",MLISDGErrorCode);
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/setedit/set_insed b/setedit/set_insed
new file mode 100755
index 0000000..58db2e2
--- /dev/null
+++ b/setedit/set_insed
@@ -0,0 +1,4 @@
+#!/bin/sh
+# This script is used to just install the editor without stripping
+#
+make EXTRA_INS_OPS=--no-strip install-editor
diff --git a/setedit/setedit/advice.cc b/setedit/setedit/advice.cc
new file mode 100644
index 0000000..9818880
--- /dev/null
+++ b/setedit/setedit/advice.cc
@@ -0,0 +1,261 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_string
+#define Uses_snprintf
+#define Uses_TApplication
+#define Uses_TStringable
+
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSCheckBoxes
+#define Uses_TSHzGroup
+#define Uses_TSLabel
+#define Uses_TSStringableListBox
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <settvuti.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <edspecs.h>
+
+typedef struct
+{
+ const char *label;
+ const char *variable;
+ unsigned mask;
+ unsigned options;
+} advice;
+
+// Note: AdviceManager() support only one
+static const char *AdviceVar1="SET_TIPS1";
+
+const unsigned opsSimple=0, ops40cols=1, ops60cols=2, opsTypeMask=7;
+const unsigned opsButOK=0, opsButYesNo=8, opsButNoYes=0x10, opsButMask=0x38;
+
+static
+advice Advices[]=
+{
+ { __("\x3You are about to switch to the user screen\n\x3Press ENTER to go back"),
+ AdviceVar1, 0x00000001, opsSimple },
+ { __("Avoid using files that aren't in a directory that isn't relative to the working one. For example: on another drive. If you do it, you'll have problems if the directories are moved or transported to another machine."),
+ AdviceVar1, 0x00000002, ops60cols },
+ { __("\x3""Do you really want to delete\n\x3this file from disk?"),
+ AdviceVar1, 0x00000004, opsSimple | opsButYesNo },
+ { __("Keep in mind that SHIFT and CAPS-LOCK will affect the case of the letters during incremental searches"),
+ AdviceVar1, 0x00000008, ops40cols },
+ { __("Keep in mind that incremental searches aren't very intuitive, especially when pressing SHIFT."),
+ AdviceVar1, 0x00000010, ops40cols },
+ { __("Keep in mind that while holding SHIFT the incremental search is done for directory names, rather than files."),
+ AdviceVar1, 0x00000020, ops40cols },
+ { __("When using real tabs the following options are usually desired: Autoindent ON, Intelligent C indent OFF, Optimal Fill ON, Don't move inside tabs ON, Tab smart indents OFF, Use indent size OFF and Backspace unindents OFF.\nI see not all of them are set this way."),
+ AdviceVar1, 0x00000040, ops60cols },
+ { __("Tags file has incorrect format.\nDo you want to read more about it?"),
+ AdviceVar1, 0x00000080, opsSimple | opsButYesNo },
+ { __("This option needs a tags file.\nDo you want to read more about it?"),
+ AdviceVar1, 0x00000100, opsSimple | opsButYesNo },
+ { __("GNU diff isn't installed.\nFor this reason I can't offer some options."),
+ AdviceVar1, 0x00000200, opsSimple },
+ { __("Debug options are stored in project files.\nIf you don't use a project you'll lose the options"),
+ AdviceVar1, 0x00000400, opsSimple },
+ { __("Please confirm you really want to finish the debug session. Breakpoints and other things will be lost."),
+ AdviceVar1, 0x00000800, opsSimple | opsButYesNo },
+ { __("A debug session is active.\nDo you want to stop it?"),
+ AdviceVar1, 0x00001000, opsSimple | opsButYesNo },
+ { __("It will kill the program you are debugging.\nGo ahead?"),
+ AdviceVar1, 0x00002000, opsSimple | opsButYesNo },
+ { __("The program will be started in another virtual terminal.\nConsult the Debug Window to know which one."),
+ AdviceVar1, 0x00004000, ops40cols },
+ { __("Encrypted file detected.\nInstall GPG in /usr/bin/."),
+ AdviceVar1, 0x00008000, opsSimple }
+};
+
+const int cantAdvices=sizeof(Advices)/sizeof(advice);
+
+int GiveAdvice(int number)
+{
+ // Sanity check
+ if (number<0 || number>=cantAdvices)
+ return 0;
+ // Now assign with confidence
+ advice *ad=Advices+number;
+
+ // Check if the user doesn't want it
+ unsigned ops=EnvirGetIntVar(ad->variable);
+ if (ops & ad->mask)
+ {
+ switch (ad->options & opsButMask)
+ {
+ case opsButYesNo:
+ return cmYes;
+ case opsButNoYes:
+ return cmNo;
+ }
+ return 0;
+ }
+
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Advice")));
+
+ TSStaticText *text;
+ switch (ad->options & opsTypeMask)
+ {
+ case ops40cols:
+ text=new TSStaticText(ad->label,40);
+ break;
+ case ops60cols:
+ text=new TSStaticText(ad->label,60);
+ break;
+ default:
+ text=new TSStaticText(ad->label);
+ }
+ col->insert(xTSCenter,2,text);
+ TSCheckBoxes *again=new TSCheckBoxes(new TSItem(__("Don't show it next time"),0));
+ again->Flags=wSpan;
+ col->insert(2,yTSUnder,again,0,text);
+
+ switch (ad->options & opsButMask)
+ {
+ case opsButYesNo:
+ col->insert(xTSCenter,yTSUnder,
+ new TSHzGroup(new TSButton(__("~Y~es"),cmYes,bfDefault),
+ new TSButton(__("~N~o"),cmNo)),
+ 0,again);
+ break;
+ case opsButNoYes:
+ col->insert(xTSCenter,yTSUnder,
+ new TSHzGroup(new TSButton(__("~N~o"),cmNo,bfDefault),
+ new TSButton(__("~Y~es"),cmYes)),
+ 0,again);
+ break;
+ default:
+ col->insert(xTSCenter,yTSUnder,new TSButton(__("O~K~"),cmOK,bfDefault,10),
+ 0,again);
+ }
+
+
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+
+ uint32 op=0;
+ int ret=execDialog(d,&op);
+ if (op)
+ EnvirSetIntVar(ad->variable,ops | ad->mask);
+
+ return ret;
+}
+
+struct stItem
+{
+ const char *str;
+ stTVIntl *intlCache;
+ Boolean state;
+};
+
+class AdvManagedItems : public TStringable
+{
+public:
+ AdvManagedItems();
+ ~AdvManagedItems();
+
+ void apply();
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual Boolean taggingSupported() { return True; };
+ virtual Boolean isTagged(unsigned );
+ virtual Boolean setTag(unsigned , Boolean state);
+
+protected:
+ stItem *items;
+};
+
+AdvManagedItems::AdvManagedItems()
+{
+ Count=cantAdvices+1; // + the cmeQuitDelete question
+ items=new stItem[Count];
+ memset(items,0,sizeof(stItem)*Count);
+ int i;
+ for (i=0; i<cantAdvices; i++)
+ {
+ items[i].str=Advices[i].label;
+ TVIntl::getText(Advices[i].label,items[i].intlCache);
+ items[i].state=EnvirGetIntVar(Advices[i].variable) & Advices[i].mask ? True : False;
+ }
+ items[i].str=cmeQuitDeleteMessage;
+ TVIntl::getText(cmeQuitDeleteMessage,items[i].intlCache);
+ items[i].state=strcmp(GetVariable("SET_CONFQUIT"),"1")==0 ? True : False;
+}
+
+AdvManagedItems::~AdvManagedItems()
+{
+ unsigned i;
+ for (i=0; i<Count; i++)
+ TVIntl::freeSt(items[i].intlCache);
+ delete[] items;
+}
+
+void AdvManagedItems::getText(char *dest, unsigned item, int maxLen)
+{
+ CLY_snprintf(dest,maxLen,"[%c] %s",items[item].state ? ' ' : 'X',
+ TVIntl::getText(items[item].str,items[item].intlCache));
+ char *s=dest;
+ for (;*s; s++)
+ if (*s==3 || *s=='\n')
+ *s=' ';
+}
+
+Boolean AdvManagedItems::isTagged(unsigned item)
+{
+ return items[item].state;
+}
+
+Boolean AdvManagedItems::setTag(unsigned item, Boolean state)
+{
+ Boolean old=items[item].state;
+ items[item].state=state;
+ return old;
+}
+
+void AdvManagedItems::apply()
+{// Slow but simple
+ int i;
+ for (i=0; i<cantAdvices; i++)
+ {
+ unsigned ops=EnvirGetIntVar(Advices[i].variable);
+ if (items[i].state)
+ ops|=Advices[i].mask;
+ else
+ ops&= ~Advices[i].mask;
+ EnvirSetIntVar(Advices[i].variable,ops);
+ }
+ InsertEnvironmentVar("SET_CONFQUIT",items[i].state ? "1" : "0");
+}
+
+void AdviceManager()
+{
+ TSViewCol *col=new TSViewCol(__("Advice dialogs"));
+
+ TRect r=TApplication::deskTop->getExtent();
+ int h=r.b.y-r.a.y-10;
+ int w=r.b.x-r.a.x-15;
+ col->insert(xTSCenter,yTSUp,
+ new TSLabel(__("Select which advice dialogs are enabled"),
+ new TSStringableListBox(w,h,tsslbVertical|tsslbHorizontal,1,256)));
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doItCenter(cmeAdviceDiagConf);
+ delete col;
+
+ AdvManagedItems *list=new AdvManagedItems();
+ TStringableListBoxRec box={list,0};
+ if (execDialog(d,&box)==cmOK)
+ list->apply();
+ delete list;
+}
+
diff --git a/setedit/setedit/ascii.cc b/setedit/setedit/ascii.cc
new file mode 100644
index 0000000..296296e
--- /dev/null
+++ b/setedit/setedit/ascii.cc
@@ -0,0 +1,217 @@
+/*----------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Ascii.cpp: Member functions of following classes: */
+/* TTable */
+/* TReport */
+/* TAsciiChart */
+/*----------------------------------------------------------*/
+
+/* Modified by Robert Hoehne to be used with RHIDE
+ Modified by Salvador E, Tropea to be used with SETEdit */
+
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_string
+#define Uses_TProgram
+#define Uses_snprintf
+#include <tv.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include <ascii.h>
+
+// RemoveFromEditorsHelper
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <dskwin.h>
+
+//
+// TTable functions
+//
+
+TTable::TTable(TRect& r) :
+ TView( r )
+{
+}
+
+
+void TTable::draw()
+{
+ TDrawBuffer buf;
+ char color = getColor(6);
+
+ for(int y = 0; y <= size.y-1; y++)
+ {
+ buf.moveChar(0, ' ', color, size.x);
+ for(int x = 0; x <= size.x-1; x++)
+ buf.moveChar(x, 32*y+x, color, 1);
+ writeLine(0, y, size.x, 1, buf);
+ }
+ showCursor();
+}
+
+//
+// cmCharFocused is a offset value (basically the ascii code of the
+// current selected character) thus should be added, not or'ed, to
+// cmAsciiTableCmdBase.
+//
+
+void TTable::charFocused()
+{
+ message(owner, evBroadcast, cmAsciiTableCmdBase + cmCharFocused,
+ (void *)(long)(cursor.x + 32 * cursor.y));
+}
+
+
+void TTable::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+
+ if (event.what == evMouseDown)
+ {
+ do
+ {
+ if(mouseInView(event.mouse.where))
+ {
+ TPoint spot = makeLocal(event.mouse.where);
+ setCursor(spot.x, spot.y);
+ charFocused();
+ }
+ } while (mouseEvent(event, evMouseMove));
+ clearEvent(event);
+ }
+ else
+ {
+ if (event.what == evKeyboard)
+ {
+ switch (event.keyDown.keyCode)
+ {
+ case kbHome:
+ setCursor(0,0);
+ break;
+ case kbEnd:
+ setCursor(size.x-1, size.y-1);
+ break;
+ case kbUp:
+ if (cursor.y > 0)
+ setCursor(cursor.x, cursor.y-1);
+ break;
+ case kbDown:
+ if (cursor.y < size.y-1)
+ setCursor(cursor.x, cursor.y+1);
+ break;
+ case kbLeft:
+ if (cursor.x > 0)
+ setCursor(cursor.x-1, cursor.y);
+ break;
+ case kbRight:
+ if (cursor.x < size.x-1)
+ setCursor(cursor.x+1, cursor.y);
+ break;
+ default:
+ setCursor(event.keyDown.charScan.charCode % 32,
+ event.keyDown.charScan.charCode / 32);
+ break;
+ }
+ charFocused();
+ clearEvent(event);
+ }
+ }
+}
+
+
+//
+// TReport functions
+//
+
+TReport::TReport(TRect& r) :
+ TView(r)
+{
+ asciiChar = 0;
+}
+
+
+void TReport::draw()
+{
+ TDrawBuffer buf;
+ char color = getColor(6);
+ char str[80];
+ char *ch,*de,*he;
+
+ ch=TVIntl::getTextNew(__(" Char: "));
+ de=TVIntl::getTextNew(__(" Decimal: "));
+ he=TVIntl::getTextNew(__(" Hex: "));
+
+ CLY_snprintf(str, 80, "%s%c%s%3d%s%2X ",
+ ch, (asciiChar==0)?(char)0x20:(char)asciiChar,
+ de, (int)asciiChar,
+ he, (int)asciiChar);
+
+ DeleteArray(ch);
+ DeleteArray(de);
+ DeleteArray(he);
+
+ buf.moveStr(0, str, color);
+ writeLine(0, 0, 32, 1, buf);
+}
+
+
+void TReport::handleEvent(TEvent& event)
+{
+ TView::handleEvent(event);
+ if (event.what == evBroadcast)
+ {
+ if (event.message.command == cmAsciiTableCmdBase + cmCharFocused)
+ {
+ asciiChar = event.message.infoLong;
+ drawView();
+ clearEvent(event);
+ }
+ }
+}
+
+
+//
+// TAsciiChart functions
+//
+
+TAsciiChart::TAsciiChart() :
+ TWindowInit( &TAsciiChart::initFrame ),
+ TWindow(TRect(0, 0, 34, 12), __("ASCII Chart"), wnNoNumber)
+{
+ TView *control;
+
+ flags &= ~(wfGrow | wfZoom);
+ palette = wpGrayWindow;
+ growMode = 0;
+
+ TRect r = getExtent();
+ r.grow(-1, -1);
+ r.a.y = r.b.y - 1;
+ control = new TReport( r );
+ control->options |= ofFramed;
+ control->eventMask |= evBroadcast;
+ insert(control);
+
+ r = getExtent();
+ r.grow(-1, -1);
+ r.b.y = r.b.y - 2;
+ control = new TTable( r );
+ control->options |= ofFramed;
+ control->blockCursor();
+ insert(control);
+
+ control->select();
+}
+
diff --git a/setedit/setedit/boardmix.cc b/setedit/setedit/boardmix.cc
new file mode 100644
index 0000000..abaca8b
--- /dev/null
+++ b/setedit/setedit/boardmix.cc
@@ -0,0 +1,201 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <configed.h>
+#include <mixer.h>
+
+static int JoinChannels=1,SaveToDisk=0;
+static const BOARD_MIXER *elements;
+static int cantElements;
+static char Disabled=0;
+
+#ifdef HAVE_MIXER
+
+#define Uses_TSSlider
+#define Uses_TSStaticText
+#define Uses_TSButton
+#define Uses_TSCheckBoxes
+#include <easydia1.h>
+#define Uses_MsgBox
+#define Uses_TEvent
+#define Uses_fpstream
+#include <tv.h>
+#include <easydiag.h>
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#include <setapp.h>
+
+const int Height=15,chLeft=0,chRight=1;
+
+static inline
+void *CreateID(int index, int channel)
+{
+ return (void *)(long)(index | (channel<<16));
+}
+
+static inline
+int DecomposeID(void *value, int &index)
+{
+ int val=(long)value;
+ index=(val) & 0x7FFF;
+ return (val)>>16;
+}
+
+static
+void CallBack(int value, TScrollBarCB *, void *data)
+{
+ int index;
+ if (DecomposeID(data,index)==chLeft)
+ SetMixerValue(elements[index].id,MaxMixerVol-value,elements[index].right);
+ else
+ SetMixerValue(elements[index].id,elements[index].left,MaxMixerVol-value);
+}
+
+class TMixDiag : public TDialog
+{
+public:
+ TMixDiag(const char *aTitle) :
+ TWindowInit(&TMixDiag::initFrame),
+ TDialog(TRect(1,1,1,1),aTitle) {};
+ virtual void handleEvent(TEvent &event);
+};
+
+void TMixDiag::handleEvent(TEvent &event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evBroadcast && event.message.command==cmClusterPress)
+ {
+ TCluster *cl=(TCluster *)event.message.infoPtr;
+ uint32 val;
+ cl->getData(&val);
+ JoinChannels=val & 1;
+ SaveToDisk=val & 2;
+ }
+}
+
+void BoardMixerDialog()
+{
+ if (Disabled)
+ {
+ messageBox(__("Disabled by configuration"),mfError | mfOKButton);
+ return;
+ }
+ elements=0;
+ if (MixerInit())
+ elements=GetElements(&cantElements);
+ if (!elements || !cantElements)
+ {
+ messageBox(__("Failed to initialize mixer. Sorry"),mfError | mfOKButton);
+ return;
+ }
+
+ // gcc 2.95.2 doesn't like the _() call in the inlined constructor, I wonder why
+ // because 2.7.2.3 and 2.8.1 allows it as spected.
+ TSViewCol *col=new TSViewCol(new TMixDiag(__("Hardward Mixer Settings")));
+
+ TSStaticText *text=new TSStaticText(__("Mixer model:"));
+ TSStaticText *name=new TSStaticText(GetMixerName());
+ col->insert(xTSLeft,yTSUp,text);
+ col->insert(xTSRightOf,yTSUp,name,text);
+ TSSlider *ant=0,*act;
+ int i,oldJoin=JoinChannels;
+ JoinChannels=0; // Setup the values without propagation to the othe channel
+ ant=new TSSlider(Height,IS_BOARD_MIXER_ELEM_STEREO(elements[0]) ? True : False,
+ elements[0].s_name,CallBack,CreateID(0,chLeft),
+ CallBack,CreateID(0,chRight),&JoinChannels,MaxMixerVol);
+ ant->Set(MaxMixerVol-elements[0].left,MaxMixerVol-elements[0].right);
+ col->insert(xTSLeft,yTSUnder,ant,0,text);
+ for (i=1; i<cantElements; i++)
+ {
+ act=new TSSlider(Height,IS_BOARD_MIXER_ELEM_STEREO(elements[i]) ? True :
+ False,elements[i].s_name,CallBack,CreateID(i,chLeft),
+ CallBack,CreateID(i,chRight),&JoinChannels,MaxMixerVol);
+ act->Set(MaxMixerVol-elements[i].left,MaxMixerVol-elements[i].right);
+ col->insert(xTSRightOf,yTSUnder,act,ant,text);
+ ant=act;
+ }
+ JoinChannels=oldJoin;
+ TSCheckBoxes *lock=new TSCheckBoxes(new TSItem(__("~L~ock channels"),new TSItem(__("~S~ave to disk"),0)));
+ col->insert(xTSLeft,yTSUnder,lock,0,ant);
+ TSButton *ok=new TSButton(__("O~K~"),cmOK,bfDefault);
+ ok->Flags=wSpan;
+ col->insert(xTSRightOf,yTSUnder,ok,lock,ant);
+
+ TDialog *d=col->doItCenter(cmeBoardMixer);
+ uint32 ops=JoinChannels | SaveToDisk;
+ execDialog(d,&ops);
+
+ delete col;
+ MixerDeInit();
+}
+
+void BoardMixerInit()
+{
+ if (Disabled) return;
+ MixerInit();
+ MixerDeInit();
+}
+
+void BoardMixerDisable()
+{
+ Disabled=1;
+}
+
+#else // HAVE_MIXER
+
+#define Uses_MsgBox
+#define Uses_fpstream
+#include <tv.h>
+
+void BoardMixerDialog()
+{
+ messageBox(__("No mixer support linked in during configuration, sorry"),mfError | mfOKButton);
+}
+
+void BoardMixerInit()
+{
+}
+
+void BoardMixerDisable()
+{
+}
+#endif // HAVE_MIXER
+
+const char Version=1;
+
+void BoardMixerSave(fpstream& s)
+{
+ s << Version << (JoinChannels | SaveToDisk);
+ elements=0; cantElements=0;
+ if (SaveToDisk)
+ {
+ if (!Disabled && MixerInit())
+ elements=GetElements(&cantElements);
+ }
+ else
+ cantElements=0;
+ s << cantElements;
+ int i;
+ for (i=0; i<cantElements; i++)
+ s << elements[i].id << elements[i].right << elements[i].left;
+ if (!Disabled && SaveToDisk) MixerDeInit();
+}
+
+void BoardMixerLoad(fpstream& s)
+{
+ char version;
+ int flags,id,left,right;
+ s >> version >> flags;
+ JoinChannels=flags & 1;
+ SaveToDisk=flags & 2;
+
+ if (!Disabled && SaveToDisk) MixerInit();
+ s >> cantElements;
+ int i;
+ for (i=0; i<cantElements; i++)
+ {
+ s >> id >> right >> left;
+ if (SaveToDisk)
+ SetMixerValue(id,left,right);
+ }
+ if (!Disabled && SaveToDisk) MixerDeInit();
+}
diff --git a/setedit/setedit/calendar.cc b/setedit/setedit/calendar.cc
new file mode 100644
index 0000000..e6489f8
--- /dev/null
+++ b/setedit/setedit/calendar.cc
@@ -0,0 +1,320 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Calendar.cpp: TCalenderWindow member functions. */
+/*---------------------------------------------------------*/
+
+/* Modified by Robert Hoehne to be used with RHIDE */
+/* Modified by Salvador E. Tropea (SET) for SETEdit */
+#define Uses_ctype
+#define Uses_TRect
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_stdlib
+#define Uses_stdio
+#include <tv.h>
+
+#include <time.h>
+#include <sys/timeb.h>
+
+#include <editcoma.h>
+#include <datetools.h>
+#include <calendar.h>
+
+char TCalendarView::upArrowChar ='\036';
+char TCalendarView::oupArrowChar ='\036';
+char TCalendarView::downArrowChar ='\037';
+char TCalendarView::odownArrowChar='\037';
+
+static char *monthNames[] = {
+ "",
+ __("January"), __("February"), __("March"), __("April"), __("May"),
+ __("June"), __("July"), __("August"), __("September"), __("October"),
+ __("November"), __("December")
+};
+
+
+static unsigned char daysInMonth[] = {
+ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+};
+
+
+#if 1
+// This should be more portable:
+static
+void GetTime(time_t *tt)
+{
+ time(tt);
+}
+#else
+// Funny that ftime is a BSD 4.2 function and doesn't exist for FreeBSD
+// Here just in case is needed.
+static
+void GetTime(time_t *tt)
+{
+ struct timeb tb;
+ ::ftime(&tb);
+ *tt=tb.time;
+}
+#endif
+
+//
+// TCalendarView functions
+//
+
+TCalendarView::TCalendarView(TRect& r) : TView( r )
+{
+ struct tm *tm;
+ time_t tt;
+
+ options |= ofSelectable;
+ eventMask |= evMouseAuto | evBroadcast;
+
+ listOfHolidays=NULL;
+
+ GetTime(&tt);
+ tm = localtime(&tt);
+ year = curYear = 1900 + tm->tm_year;
+ updateYear();
+ month = curMonth = tm->tm_mon + 1;
+ curDay = tm->tm_mday;
+
+ cNDays = NULL;
+
+ drawView();
+}
+
+void TCalendarView::updateYear()
+{
+ ::free(listOfHolidays);
+ listOfHolidays=GetHolidays(year,numOfHolidays);
+}
+
+TCalendarView::~TCalendarView()
+{
+ TVIntl::freeSt(cNDays);
+ CleanUpHolidays();
+ ::free(listOfHolidays);
+}
+
+unsigned dayOfWeek(unsigned day, unsigned month, unsigned year)
+{
+ int century, yr, dw;
+
+ if(month < 3)
+ {
+ month += 10;
+ --year;
+ }
+ else
+ month -= 2;
+
+ century = year / 100;
+ yr = year % 100;
+ dw = (((26 * (int)month - 2) / 10) + (int)day + yr + (yr / 4) + (century / 4) -
+ (2 * century)) % 7;
+
+ if(dw < 0)
+ dw += 7;
+
+ return((unsigned)dw);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It fills the passed buffer with the month and year currently displayed by
+the calendar. The buffer should have size+1 bytes. (SET)
+
+***************************************************************************/
+
+char *TCalendarView::getMonthStr(char *buffer, int size, int addArrows)
+{
+ char *monthName=TVIntl::getTextNew(monthNames[month]);
+ int l=max((int)strlen(monthName),15)+5;
+ if (addArrows)
+ l+=2;
+
+ AllocLocalStr(str,l+1);
+ if (addArrows)
+ sprintf(str,"%c%15s %4d%c", upArrowChar, monthName, year, downArrowChar);
+ else
+ sprintf(str,"%s %4d", monthName, year);
+ DeleteArray(monthName);
+
+ strncpy(buffer,str,size);
+ buffer[size]=0;
+ return buffer;
+}
+
+Boolean TCalendarView::isHoliday(int d, int m)
+{
+ if (!listOfHolidays)
+ return False;
+ int i;
+ for (i=0; i<numOfHolidays; i++)
+ if (listOfHolidays[i].day==d && listOfHolidays[i].month==m)
+ return True;
+ return False;
+}
+
+void TCalendarView::draw()
+{
+ AllocLocalStr(str,size.x+1);
+ unsigned current = 1 - dayOfWeek(1, month, year);
+ unsigned days = daysInMonth[month] + ((year % 4 == 0 && month == 2) ? 1 : 0);
+ char color, boldColor, holidayColor;
+ int i, j;
+ TDrawBuffer buf;
+
+ color = getColor(6);
+ boldColor = getColor(7);
+ holidayColor = getColor(5);
+
+ buf.moveChar(0, ' ', color, size.x);
+
+ getMonthStr(str,size.x,1);
+
+ buf.moveStr(0, str, color);
+ writeLine(0, 0, size.x, 1, buf);
+
+ buf.moveChar(0, ' ', color, size.x);
+ buf.moveStr(1, TVIntl::getText(__("Su Mo Tu We Th Fr Sa"),cNDays), color);
+ writeLine(0, 1, size.x, 1, buf);
+
+ for(i = 1; i <= 6; i++)
+ {
+ buf.moveChar(0, ' ', color, size.x);
+ for(j = 0; j <= 6; j++)
+ {
+ if(current < 1 || current > days)
+ buf.moveStr(1+j*3, " ", color);
+ else
+ {
+ sprintf(str, "%2d", (int)current);
+ if (year == curYear && month == curMonth && current == curDay)
+ buf.moveStr(1+j*3, str, boldColor);
+ else if (isHoliday(current,month))
+ buf.moveStr(1+j*3, str, holidayColor);
+ else
+ buf.moveStr(1+j*3, str, color);
+ }
+ current++;
+ }
+ writeLine(0, i+1, size.x, 1, buf);
+ }
+}
+
+
+void TCalendarView::handleEvent(TEvent& event)
+{
+ TPoint point;
+
+ if (event.what==evBroadcast && event.message.command==cmCalendarPlugIn)
+ {
+ updateYear();
+ drawView();
+ clearEvent(event);
+ return;
+ }
+ TView::handleEvent(event);
+ if (state && sfSelected)
+ {
+ if ( (event.what & evMouse) && (evMouseDown || evMouseAuto) )
+ {
+ point = makeLocal(event.mouse.where);
+ if (point.x == 0 && point.y == 0)
+ {
+ ++month;
+ if (month > 12)
+ {
+ ++year;
+ updateYear();
+ month = 1;
+ }
+ drawView();
+ }
+ else if (point.x == 21 && point.y == 0)
+ {
+ --month;
+ if (month < 1)
+ {
+ --year;
+ updateYear();
+ month = 12;
+ }
+ drawView();
+ }
+ }
+ else if (event.what == evKeyboard)
+ {
+ if ( event.keyDown.keyCode == kbPlus ||
+ event.keyDown.keyCode == kbDown)
+ {
+ ++month;
+ if (month > 12)
+ {
+ ++year;
+ updateYear();
+ month = 1;
+ }
+ }
+ else if ( event.keyDown.keyCode == kbMinus ||
+ event.keyDown.keyCode == kbUp)
+ {
+ --month;
+ if (month < 1)
+ {
+ --year;
+ updateYear();
+ month = 12;
+ }
+ }
+ drawView();
+ }
+ }
+}
+
+
+//
+// TCalendarWindow functions
+//
+
+TCalendarWindow::TCalendarWindow() :
+ TWindowInit( &TCalendarWindow::initFrame ),
+ TWindow( TRect(1, 1, 25, 11), __("Calendar"), wnNoNumber )
+{
+ TRect r(getExtent());
+
+ flags &= ~(wfZoom | wfGrow);
+ growMode = 0;
+
+ palette = wpCyanWindow;
+
+ r.grow(-1, -1);
+ view = new TCalendarView( r );
+ insert( view );
+}
+
+
+void TCalendarWindow::handleEvent(TEvent& event)
+{
+ TWindow::handleEvent(event);
+ if ( event.what == evKeyboard && event.keyDown.keyCode == kbEsc )
+ {
+ close();
+ clearEvent(event);
+ return;
+ }
+}
diff --git a/setedit/setedit/codepage.cc b/setedit/setedit/codepage.cc
new file mode 100644
index 0000000..35e5582
--- /dev/null
+++ b/setedit/setedit/codepage.cc
@@ -0,0 +1,65 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: CodePage
+ Comments:
+ Most of the code was moved to TV.
+
+***************************************************************************/
+
+#define Uses_TVCodePage
+#define Uses_TScreen
+#define Uses_TApplication
+#define Uses_TVFontCollection
+#define Uses_TCEditor
+#define Uses_TCEditor_Internal
+#define Uses_TWindow
+#include <ceditor.h>
+
+#define Uses_TSetEditorApp
+#include <setapp.h>
+#include <mp3play.h>
+#include <calendar.h>
+#include <tprogdia.h>
+#include <ceditint.h> // SUP_MP3
+// From the screen saver
+extern char *coFormaScreenSaverStars[];
+extern char *cFormaScreenSaverStars[];
+
+TVCodePageCallBack
+ TSetEditorApp::oldCPCallBack=NULL;
+
+void TSetEditorApp::cpCallBack(ushort *map)
+{
+ int i;
+
+ #define C(cla,name) TVCodePage::RemapString((uchar *)cla::name,(uchar *)cla::o##name,map)
+ #ifdef SUP_MP3
+ C(MP3Player,butRew);
+ C(MP3Player,butStop);
+ C(MP3Player,butPlay);
+ C(MP3Player,butPause);
+ C(MP3Player,butFfw);
+ #endif
+ #undef C
+ #define C(cla,name) cla::name=TVCodePage::RemapChar(cla::o##name,map)
+ C(TCEditor,TabChar);
+ C(TCalendarView,upArrowChar);
+ C(TCalendarView,downArrowChar);
+ #undef C
+ #define C(num,o,n) for (i=0; i<num; i++) n[i][0]=TVCodePage::RemapChar(o[i][0],map)
+ C(4,coFormaScreenSaverStars,cFormaScreenSaverStars);
+ #undef C
+ ProgBar_CurrentChar=TVCodePage::RemapChar(ProgBar_DefaultChar,map);
+
+ // Update the "is_word_char" bit
+ for (i=0; i<256; i++)
+ if (TVCodePage::isAlNum(i))
+ TableTypesEditor[i]|=ttedIsWordChar;
+ else
+ TableTypesEditor[i]&=~ttedIsWordChar;
+ TableTypesEditor[(int) '_']|=ttedIsWordChar;
+}
+
+
diff --git a/setedit/setedit/debug.cc b/setedit/setedit/debug.cc
new file mode 100644
index 0000000..88104e5
--- /dev/null
+++ b/setedit/setedit/debug.cc
@@ -0,0 +1,8739 @@
+/* Copyright (C) 2004-2007 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Debugger interface.
+ Comments:
+ It implements the interface with the debugger.
+
+ TODO:
+ The most important unimplemented features and unsolved things are:
+
+
+-----------------------------------------------
+Low priority:
+
+General:
+* Some stop mechanism to avoid waiting for response time out.
+* Some way to revert the "don't show next time" options. Like with the
+advices. It means we must concentrate them into one place.
+* Mechanism to select a PID from the running processes.
+
+Breakpoints:
+* Detect recompilation of the target from "outside", that's without using Run
+program. A good moment could be when we are restarting. In this case move the
+breakpoints.
+* Right click on a line where we have a bkpt should offer to edit it.
+* When adding a new breakpoint from the dialog use the current file and
+function to field the empty fields.
+
+Inspectors:
+* Highlight changed values.
+* Add "graphic lines" to the tree.
+* Mouse click to un/fold sections.
+
+Watches:
+* Highlight changed values.
+
+Data Window:
+* Small dialog with all the modes.
+* Mouse movement.
+* Configure the max length (same warning).
+* Things ML had:
+ - search(-next,-prev) ^S ^N ^P
+ - bookmarks?
+ - try to fix 32-bit dependencies
+ - change address types to correct types using libgdb.h
+
+Debug Window:
+* Save content to disk.
+
+Disassembler Window:
+* Keys or similar to change the size used by the registers and the code.
+* Some, slow, way to choose the format for the registers. It will imply
+fetching its values by batchs with the same format.
+* Support syntax hl. for other CPUs.
+* The "code" created is pure UNIX \n text, but what about DOS files with
+\r\n? (I mean source C/C++ files mixed with asm code).
+* Option to avoid the "auto open" (current behavior)
+
+by Function:
+void TSetEditorApp::DebugFinishFun()
+void TSetEditorApp::DebugReturnNow() (same?)
+ Should we check if we are at main? Not sure, the check is expensive:
+1) Get the list of frames, 2) Determine if we are at the top, 3) Release the
+frames. First time I got the gdb error I got confused, but is quite obvious.
+
+void TSetEditorApp::DebugCallStack()
+should I modify mi lib to return something better ...
+Move the code to the "parser.c" in migdb
+
+int TDisAsmEdWin::jumpToFrame(mi_frames *f)
+We should lock the editor until the end, that's annoying because of the
+unlocks on fails.
+
+void TInspector::updateVars(mi_gvar_chg *changed)
+What if a variable changes its type? I don't know how can it be but gdb code
+seems to support it.
+
+int isValidAddress(const char *taddr, unsigned long &addr)
+It determines if something is a pointer using a very weak methode.
+
+void TDataViewer::handleEvent(TEvent & event)
+It does a complete redraw when 1 char is inserted, it looks like an overkill.
+
+-----------------------------------------------
+Whish gdb could:
+
+HAVE LESS BUGS!!!!
+
+Eval/Modify:
+* Set the format for results, currently you must inspect the variable to do it.
+
+Disassembler Window:
+* Choose the format for registers individualy, not for all.
+* Avoid reporting wrong functions. Like when I stop during a getchar and it says
+it was executing read but the read symbol is 800 KB away from the real address.
+
+
+IMPORTANT NOTES!!!
+
+1) Breakpoints are very tied to splines. Splines associate an *absolute*
+file name with some lines. But breakpoints usually are specified as
+*relative* file names. It means that when we search for a breakpoint using
+its name we must expand it. Is gdb the one in charge to keep its name
+relative because we always send to gdb absolute file names.
+
+2) Path for sources and similar details.
+GDB is smart if we compile using absolute paths. But is quite idiot if we
+don't. Specially the one from Debian GNU/Linux Woody (2002-04-01-cvs).
+Is quite bizarre that:
+ -break-insert /full-path/file.cc:line
+ -> file="file.cc"
+But latter says that /full-path/file.cc isn't in the symtab.
+The CLI dir command or MI -environment-directory seems to solve the
+problems. Currently after connecting I'm sending to gdb a list of
+directories to look for sources.
+
+3) When gdb stops in a function inside a library (no debug info) the
+reported function can be bogus. In my tests with getchar it says we stopped
+in read (when sending a sigint or attaching), but read is 800 KB away in
+another library. So in the middle we have a gap with unaccessable memory. So
+when we ask gdb to disassemble read we cross the gap and gdb dies. Here I see
+two bugs: 1) Wrong function name and 2) Crashing just because reading
+unaccessable memory.
+
+***************************************************************************/
+
+#ifndef _GNU_SOURCE
+ // SuSE SLES 8 defines it at the command line!
+ #define _GNU_SOURCE
+#endif
+#include <ceditint.h>
+#define Uses_stdio
+#define Uses_unistd
+#define Uses_snprintf
+#define Uses_TApplication
+#define Uses_TScreen
+#define Uses_TVCodePage
+#define Uses_TCEditor_Class
+#define Uses_TCEditor
+#define Uses_MsgBox
+#define Uses_TStreamableClass
+#define Uses_TCommandSet
+#define Uses_ctype
+#define Uses_TPalette
+#define Uses_TKeys
+#define Uses_TGKey
+
+// Messages
+#define Uses_TDialog
+#define Uses_TScroller
+#define Uses_TScrollBar
+#define Uses_TListBox
+#define Uses_TDeskTop
+#define Uses_TNoStaticText
+#define Uses_AllocLocal
+#define Uses_TFileDialog
+
+// Watches
+#define Uses_TStringableListBox
+
+// Breakpoints
+#define Uses_TSStringableListBox
+#define Uses_TSCheckBoxes
+#define Uses_TSRadioButtons
+
+// Config
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSInputLine
+#define Uses_TSInputLinePiped
+#define Uses_TSLabel
+#define Uses_TSVeGroup
+#define Uses_TSHzGroup
+#define Uses_TSLabelRadio
+#define Uses_TSLabelCheck
+#define Uses_TSNoStaticText
+
+#define Uses_TSSortedListBox
+#define Uses_TDialogAID
+#define Uses_FileOpenAid
+#define Uses_TCEditWindow
+#define Uses_TCEditor_Commands
+#define Uses_TVOSClipboard
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppAll
+#define Uses_SETAppHelper
+#include <setapp.h>
+
+#include <splinman.h>
+#include <editcoma.h>
+#include <edmsg.h>
+#ifdef HAVE_GDB_MI
+ #include <mi_gdb.h>
+ #define Uses_TBreakpoints
+ #define Uses_TWatchpoints
+ #define Uses_TDisAsmWin
+#endif
+#include <debug.h>
+#include <dyncat.h>
+#include <edhists.h>
+#include <dskwin.h>
+#include <pathlist.h>
+#include <diaghelp.h>
+#include <pathtool.h> // FindFile
+#include <edcollec.h>
+#include <edspecs.h>
+#include <loadshl.h> // SHLNumberOf
+#include <advice.h>
+
+const uint32 msgConsole=1, msgTarget=2, msgLog=4, msgTo=8, msgFrom=16;
+static uint32 msgOps=msgConsole | msgTarget | msgLog;
+const char svPresent=1, svAbsent=0, svYes=1, svNo=0;
+const char bkptsVersion=2;
+const char wptsVersion=1;
+const char inspVersion=2;
+const char dwVersion=2;
+const char debugDataVersion=1;
+const char msgWinVersion=2;
+const char watchWinVersion=2;
+
+#ifdef HAVE_GDB_MI
+
+#include <sys/time.h> // Profile
+
+#define DEBUG_ME 0
+#if DEBUG_ME
+ #define dbgPr(format, args...) printf(format , ## args)
+#else
+ #define dbgPr(format, args...)
+#endif
+#define DEBUG_BREAKPOINTS_UPDATE 0
+#define PROFILE 0
+
+// Variables for the configuration
+const int maxWBox=70, widthFiles=256, widthShort=80, widthExpRes=1024;
+const int widthWtExp=widthFiles, maxWtBox=maxWBox;
+const int widthGDBCom=widthFiles, maxGDBComBox=maxWBox;
+const int widthPID=32;
+const unsigned dmLocal=0, dmPID=1, dmRemote=2;
+const int wTimeOut=8, wLinesMsg=8;
+const int wVisible=50, wInt=32, wLabels=9,
+ wFilename=PATH_MAX,
+ wFunction=256,
+ wLine=wInt,
+ wAddress=wInt,
+ wCondition=256,
+ wCount=wInt,
+ wThreadB=wInt;
+
+struct DebugOptionsStruct
+{
+ char program[wFilename];
+ uint32 mode;
+ char args[widthFiles];
+ char tty[widthShort];
+ char rtype[widthShort];
+ char rparam[widthShort];
+};
+static int debugOpsNotIndicated=1;
+static DebugOptionsStruct dOps;
+// End of Variables for the configuration
+
+const int defaultTimeOut=MI_DEFAULT_TIME_OUT, defaultLinesMsg=1000;
+const int maxWDbgSt=20, maxWStatus=256;
+const unsigned miscNoBanner=1, miscMIv2=2, miscSymWA=4, miscNoSourceInAsm=8;
+
+const int modeX11=0, modeLinux=1;
+static int localMode;
+static MIDebugger *dbg=NULL;
+// Last async response
+static mi_stop *stoppedInfo=NULL;
+static char pendingStoppedInfo=0;
+static char killAfterStop=0;
+// CPU line
+static char *cpuLFile=NULL;
+static int cpuLLine;
+// Path for the binary
+static char *binReference=NULL;
+static int binReferenceLen=0;
+// Modification time
+static time_t binMTime;
+// Main function (main)
+static char *mainFunction=NULL;
+// Max. lines in debug window
+static int msgsInDebugWindow;
+
+// Some common messages
+static stTVIntl *icUnknown=NULL,
+ *icNotStarted=NULL,
+ *icDisconnected=NULL,
+ *icConnected=NULL,
+ *icReadyToRun=NULL,
+ *icRunning=NULL,
+ *icStopped=NULL,
+ *icDefault=NULL,
+ *icInspOk=NULL,
+ *icInspWait=NULL,
+ *icInspNoScope=NULL;
+static const char *cInspOk=__("Ok");
+static const char *cInspWait=__("Can't update");
+static const char *cInspNoScope=__("Out of scope");
+
+static void OpenInspector(const char *var);
+static TDialog *createEditExp(char *tit);
+static void ShowErrorInMsgBox();
+static void SaveExpandedRect(opstream &os, TRect &r, unsigned wS, unsigned hS);
+static void ReadExpandedRect(ipstream &is, TRect &r, unsigned wS, unsigned hS);
+static int IsDisAsmWinCurrent();
+
+static
+int IsEmpty(const char *s)
+{
+ for (;*s && ucisspace(*s); s++);
+ return *s==0;
+}
+
+static inline
+unsigned GetGDBTimeOut()
+{
+ return EnvirGetIntVar("SET_GDB_TIME_OUT",defaultTimeOut);
+}
+
+static inline
+void SetGDBTimeOut(unsigned val)
+{
+ EnvirSetIntVar("SET_GDB_TIME_OUT",val);
+}
+
+static inline
+unsigned GetMsgLines()
+{
+ return EnvirGetIntVar("SET_GDB_MSG_LINES",defaultLinesMsg);
+}
+
+static inline
+void SetMsgLines(unsigned val)
+{
+ EnvirSetIntVar("SET_GDB_MSG_LINES",val);
+ msgsInDebugWindow=val;
+}
+
+static inline
+unsigned GetGDBMisc()
+{
+ return EnvirGetIntVar("SET_GDB_MISC",0);
+}
+
+static inline
+void SetGDBMisc(unsigned val)
+{
+ EnvirSetIntVar("SET_GDB_MISC",val);
+ // It shouldn't be needed because the dialog is enabled only when dbg is NULL
+ // but in this way we are ready for future changes.
+ if (dbg)
+ {
+ if (val & miscMIv2)
+ dbg->ForceMIVersion(2,0,0);
+ else
+ dbg->ForceMIVersion(1,0,0);
+ }
+ mi_set_workaround(MI_PSYM_SEARCH,val & miscSymWA ? 0 : 1);
+}
+
+static inline
+const char *GetGDBExe()
+{
+ return GetVariable("SET_GDB_EXE",MIDebugger::GetGDBExe());
+}
+
+static inline
+const char *GetGDBExeNoD()
+{
+ return GetVariable("SET_GDB_EXE",NULL);
+}
+
+static inline
+void SetGDBExe(const char *name)
+{
+ InsertEnvironmentVar("SET_GDB_EXE",IsEmpty(name) ? NULL: name);
+}
+
+static inline
+const char *GetXTermExe()
+{
+ return GetVariable("SET_XTERM_EXE",MIDebugger::GetXTermExe());
+}
+
+static inline
+const char *GetXTermExeNoD()
+{
+ return GetVariable("SET_XTERM_EXE",NULL);
+}
+
+static inline
+void SetXTermExe(const char *name)
+{
+ InsertEnvironmentVar("SET_XTERM_EXE",IsEmpty(name) ? NULL: name);
+}
+
+static inline
+const char *GetMainFunc()
+{
+ if (mainFunction)
+ return mainFunction;
+ return MIDebugger::GetMainFunc();
+}
+
+static inline
+void SetMainFunc(const char *mf, Boolean copy)
+{
+ delete[] mainFunction;
+ mainFunction=copy ? newStr(mf) : (char *)mf;
+ return MIDebugger::SetMainFunc(mf);
+}
+
+static inline
+int IsStopped()
+{
+ return dbg && dbg->GetState()==MIDebugger::stopped;
+}
+
+/*****************************************************************************
+ Sources files cache:
+ This cache holds the list of files we know where are located.
+*****************************************************************************/
+
+struct stFileCache
+{
+ char *gdb;
+ char *real;
+};
+
+class TSourcesCache : public TNSSortedCollection
+{
+public:
+ TSourcesCache() : TNSSortedCollection(10,10) {};
+
+ void insert(const char *gdb, char *real, char *&newReal);
+ stFileCache *At(ccIndex pos) { return (stFileCache *)at(pos); };
+
+ virtual void *keyOf(void *item);
+ virtual int compare(void *s1, void *s2);
+ virtual void freeItem(void *s);
+};
+
+void *TSourcesCache::keyOf(void *item)
+{
+ return ((stFileCache *)item)->gdb;
+}
+
+int TSourcesCache::compare(void *s1, void *s2)
+{
+ return strcmp((char *)s1,(char *)s2);
+}
+
+void TSourcesCache::freeItem(void *s)
+{
+ stFileCache *p=(stFileCache *)s;
+ delete[] p->gdb;
+ delete[] p->real;
+ delete p;
+}
+
+void TSourcesCache::insert(const char *gdb, char *real, char *&newReal)
+{
+ stFileCache *p=new stFileCache;
+ p->gdb=newStr(gdb);
+ newReal=p->real=newStr(real);
+ TNSSortedCollection::insert(p);
+}
+
+TSourcesCache *sourcesCache=NULL;
+
+static inline
+void InitSourcesCache()
+{
+ if (!sourcesCache)
+ sourcesCache=new TSourcesCache();
+}
+
+static inline
+void DeInitSourcesCache()
+{
+ destroy0(sourcesCache);
+}
+
+static
+char *SolveFileName(const char *s)
+{
+ if (!s)
+ return NULL;
+ if (CheckIfPathAbsolute(s))
+ return edTestForFile(s) ? newStr(s) : NULL;
+ // Look if we already know about it
+ InitSourcesCache();
+ ccIndex pos;
+ if (sourcesCache->search((char *)s,pos))
+ {
+ stFileCache *p=sourcesCache->At(pos);
+ dbgPr("Found source in cache: %s\n",p->real);
+ return p->real;
+ }
+ // Nope, so we must do a deep search
+ char *fullName, *retName;
+ if (FindFile(s,fullName,binReference))
+ {
+ dbgPr("Adding %s to cache\n",fullName);
+ sourcesCache->insert(s,fullName,retName);
+ delete[] fullName;
+ return retName;
+ }
+ // Ask the user what to do
+ if (messageBox(mfWarning|mfYesButton|mfNoButton,
+ __("Do you want to provide the path for: '%s'."),s)==cmYes)
+ {
+ char buf[PATH_MAX];
+
+ // The file with * appended
+ const char *start=strrchr(s,'/');
+ if (start)
+ start++;
+ else
+ start=s;
+ CLY_snprintf(buf,PATH_MAX,"%s*",start);
+
+ // Bring a dialog to select it
+ if (GenericFileDialog(__("Source file"),buf,NULL,hID_DbgSourceLoc,
+ fdNoMask)!=cmCancel)
+ {
+ if (!edTestForFile(buf))
+ // Failed to stat or not regular file
+ messageBox(mfError|mfOKButton,__("Can't use: '%s'."),s);
+ else
+ {// Add to cache
+ sourcesCache->insert(s,buf,retName);
+ // May be also to the list of paths
+ char *last=strrchr(buf,'/');
+ if (last && last!=buf)
+ {
+ *last=0;
+ if (messageBox(mfConfirmation|mfYesButton|mfNoButton,
+ __("Add path to list: '%s'?"),buf)==cmYes)
+ {
+ PathListAdd(paliSource,buf);
+ if (dbg)
+ dbg->PathSources(buf);
+ }
+ }
+ return retName;
+ }
+ }
+ }
+ else
+ // The user is lazy or doesn't have the source code, don't bother again
+ sourcesCache->insert(s,NULL,retName);
+ dbgPr("Can't find %s file\n",s);
+ return NULL;
+}
+
+/*****************************************************************************
+ End of Sources files cache
+*****************************************************************************/
+
+/*****************************************************************************
+ Editor debug commands
+*****************************************************************************/
+
+void TSetEditorApp::DebugToggleBreakpoint()
+{
+ TCEditor *e=GetCurrentIfEditor();
+ if (e)
+ {
+ if (!DebugCheckStopped())
+ return;
+ int l=e->curPos.y+1, ol;
+ Boolean found;
+
+ // We use the expanded name for the SpLines
+ char s[PATH_MAX];
+ strcpy(s,e->fileName);
+ CLY_fexpand(s);
+
+ ol=SpLineGetOldValueOf(l,s,idsplBreak,&found);
+ if (found)
+ {
+ if (DBG_RemoveBreakpoint(s,ol))
+ SpLinesDeleteForId(idsplBreak,s,True,ol);
+ }
+ else
+ {
+ if (DBG_SetBreakpoint(s,l))
+ SpLinesAdd(s,l,idsplBreak,True);
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Initializes the debug object and related variables.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int TSetEditorApp::DebugInitVars()
+{
+ if (!dbg)
+ dbg=new MIDebugger();
+ return dbg!=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Releases the memory used. If the debug session still active it tries to
+stop the program and close the gdb connection.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugDeInitVars()
+{
+ if (dbg)
+ {
+ delete dbg; // It will close the debug session
+ dbg=NULL;
+ }
+ TProgram::deskTop->lock();
+ if (DEBUG_BREAKPOINTS_UPDATE)
+ dbgPr("DebugDeInitVars: Deleting all splines\n");
+ SpLinesDeleteForId(idsplBreak);
+ DBG_ReleaseMemory();
+ DebugMsgDeInit();
+ WatchesDeInit();
+ DebugCommonCleanUp();
+ TProgram::deskTop->unlock();
+ TVIntl::freeSt(icUnknown);
+ TVIntl::freeSt(icNotStarted);
+ TVIntl::freeSt(icDisconnected);
+ TVIntl::freeSt(icConnected);
+ TVIntl::freeSt(icReadyToRun);
+ TVIntl::freeSt(icRunning);
+ TVIntl::freeSt(icStopped);
+ TVIntl::freeSt(icDefault);
+ TVIntl::freeSt(icInspOk);
+ TVIntl::freeSt(icInspWait);
+ TVIntl::freeSt(icInspNoScope);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Actions shared between @x{::DebugDeInitVars} and @x{::DebugCloseSession}.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugCommonCleanUp()
+{
+ DebugClearCPULine();
+ mi_free_stop(stoppedInfo);
+ stoppedInfo=NULL;
+ pendingStoppedInfo=killAfterStop=0;
+ DebugCommandsForDisc();
+ delete[] binReference;
+ binReference=NULL;
+ binReferenceLen=0;
+ DeInitSourcesCache();
+ // TInspectors needs it, maybe others in the future.
+ message(TProgram::deskTop,evBroadcast,cmDbgChgState,NULL);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It verifies if the debugger is in a state that can accept things like
+breakpoints, watchpoints, etc. The possible states are target_specified and
+stopped. If the state is running we won't stop. For other states we will try
+to reach target_specified.@p
+ If @var{showConnect} is specified the message dialog will be selected to
+show success. On error it is always selected.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int TSetEditorApp::DebugCheckStopped(Boolean showConnect)
+{
+ if (!DebugInitVars())
+ return 0;
+ MIDebugger::eState st=dbg->GetState();
+ if (st==MIDebugger::running)
+ {
+ messageBox(__("The program is running and GDB/MI doesn't support async commands"),
+ mfOKButton | mfError);
+ return 0;
+ }
+ if (st==MIDebugger::disconnected)
+ {
+ if (!DebugConnect())
+ return 0;
+ st=dbg->GetState(); // Should be connected
+ }
+ if (st==MIDebugger::connected)
+ {
+ if (!DebugSelectTarget(showConnect))
+ return 0;
+ st=dbg->GetState(); // Should be target_specified
+ }
+ return (st==MIDebugger::stopped || st==MIDebugger::target_specified);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It verifies if the debugger is in a state that can accept commands. The
+possible states are target_specified, connected and stopped. If the state
+is running we won't stop. For other states we will try to reach
+connected.@p
+ If @var{showConnect} is specified the message dialog will be selected to
+show success. On error it is always selected.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int TSetEditorApp::DebugCheckAcceptCmd(Boolean showConnect)
+{
+ if (!DebugInitVars())
+ return 0;
+ MIDebugger::eState st=dbg->GetState();
+ if (st==MIDebugger::running)
+ {
+ messageBox(__("The program is running and GDB/MI doesn't support async commands"),
+ mfOKButton | mfError);
+ return 0;
+ }
+ if (st==MIDebugger::disconnected)
+ {
+ if (!DebugConnect())
+ return 0;
+ st=dbg->GetState(); // Should be connected
+ }
+ return (st==MIDebugger::stopped || st==MIDebugger::target_specified ||
+ st==MIDebugger::connected);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a callback called when a gdb response exceeds the time out. The
+dialog asks the user if s/he wants to wait more time or just take it as an
+error.
+
+ Return: !=0 continue waiting.
+
+***************************************************************************/
+
+int TSetEditorApp::DebugTimeOut(void *)
+{
+ return messageBox(__("Time out in gdb response. Continue waiting?"),
+ mfError|mfYesButton|mfNoButton)==cmYes;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Tries to connect to gdb. It doesn't check if we are initialized or in
+which state is the debugger. Call it only after checking.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int TSetEditorApp::DebugConnect()
+{
+ unsigned misc=GetGDBMisc();
+ mi_set_workaround(MI_PSYM_SEARCH,misc & miscSymWA ? 0 : 1);
+ const char *aux=GetGDBExeNoD();
+ if (aux)
+ dbg->SetGDBExe(aux);
+ aux=GetXTermExeNoD();
+ if (aux)
+ dbg->SetXTermExe(aux);
+ int res=dbg->Connect();
+ if (res)
+ {
+ DebugMsgClear();
+ DBG_SetCallBacks();
+ dbg->SetTimeOut(GetGDBTimeOut());
+ dbg->SetTimeOutCB(DebugTimeOut,NULL);
+ DebugMsgSetState();
+ if (!(misc & miscNoBanner) && !dbg->Version())
+ return 0;
+ if (misc & miscMIv2)
+ dbg->ForceMIVersion(2,0,0);
+ // Set the path for sources
+ char n[PATH_MAX];
+ if (dbg->PathSources(NULL))
+ {
+ for (int i=0; PathListGetItem(i,n,paliSource); i++)
+ if (!dbg->PathSources(n))
+ break;
+ // At the end so it becomes the fist in the list:
+ // Yet another gdb bug?? some gdbs need it
+ if (getcwd(n,PATH_MAX))
+ dbg->PathSources(n);
+ }
+ }
+ else
+ DebugMsgSetError();
+
+ return res;
+}
+
+
+static
+TDialog *createPidDlg()
+{
+ TSViewCol *col=new TSViewCol(__("PID (Process ID) of the running process"));
+
+ // EN: P
+ TSHzLabel *o1=new TSHzLabel(__("~P~ID:"),new TSInputLine(widthPID));
+
+ col->insert(xTSLeft,yTSUpSep,o1);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmGDBCommand);
+ delete col;
+ return d;
+}
+
+static
+int GetPID()
+{
+ char pid[widthPID];
+ pid[0]=0;
+ if (execDialog(createPidDlg(),pid)==cmOK)
+ return atoi(pid);
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ The sources reported in "frames" are relative to the binary or just
+absolute. If the user specifies "path/binary" we have to use the "path" to
+look for sources.
+
+***************************************************************************/
+
+static
+void ExtractBinReference()
+{
+ char b[PATH_MAX], path[PATH_MAX];
+ strcpy(b,dOps.program);
+ CLY_fexpand(b);
+ CLY_ExpandPath(b,path,NULL);
+ delete[] binReference;
+ binReferenceLen=strlen(path);
+ binReference=new char[binReferenceLen+1];
+ memcpy(binReference,path,binReferenceLen+1);
+ if (dbg)
+ dbg->PathSources(binReference);
+}
+
+static
+const char *getCurTTY()
+{
+ const char *tty=NULL;
+ if (dOps.tty[0])
+ tty=dOps.tty;
+ if (!tty)
+ tty=dbg->GetAuxTTY();
+ if (!tty)
+ tty=TVIntl::getText(__("default"),icDefault);
+ return tty;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Tries to select the target to debug. It doesn't check if we are
+initialized or in which state is the debugger. Call it only after checking.
+ If @var{showConnect} is specified the message dialog will be selected to
+show success. On error it is always selected.
+
+ Return: !=0 OK
+
+***************************************************************************/
+
+int TSetEditorApp::DebugSelectTarget(Boolean showConnect)
+{
+ if (debugOpsNotIndicated)
+ {// We don't even know what to debug ;-)
+ if (messageBox(__("You must set the debug options first. Do you want to do it now?"),
+ mfYesButton | mfNoButton)!=cmYes)
+ return 0;
+ // Give a chance to say what to debug and how
+ if (!DebugOptionsEdit())
+ return 0;
+ }
+
+ int res=0, pid;
+ char *args, *tty, *aux;
+ mi_frames *fr;
+
+ struct stat st;
+ if (!edTestForFile(dOps.program,st))
+ {// Don't even try if the program doesn't exist
+ messageBox(mfError | mfOKButton,__("The '%s' file doesn't exist"),dOps.program);
+ return 0;
+ }
+ switch (dOps.mode)
+ {
+ case dmLocal:
+ // Now try
+ args=dOps.args[0] ? dOps.args : NULL;
+ tty=dOps.tty[0] ? dOps.tty : NULL;
+ if (strcmp(TScreen::getDriverShortName(),"X11")==0)
+ {
+ localMode=modeX11;
+ res=dbg->SelectTargetX11(dOps.program,args,tty);
+ }
+ else
+ {
+ localMode=modeLinux;
+ res=dbg->SelectTargetLinux(dOps.program,args,tty);
+ if (res)
+ GiveAdvice(gadvDbgLinuxTTY);
+ }
+ break;
+
+ case dmPID:
+ pid=GetPID();
+ if (!pid)
+ return 0;
+ if (pid==getpid())
+ {
+ messageBox(__("Hey! That's my PID!"),mfError | mfOKButton);
+ return 0;
+ }
+ fr=dbg->SelectTargetPID(dOps.program,pid);
+ if (fr)
+ {
+ res=1;
+ char b[maxWStatus];
+ int l=TVIntl::snprintf(b,maxWStatus,__("Attached to PID %d"),pid);
+ DebugMsgJumpToFrame(fr,b,l);
+ mi_free_frames(fr);
+ }
+ break;
+
+ case dmRemote:
+ if (IsEmpty(dOps.rtype) || IsEmpty(dOps.rparam))
+ {// Don't even try if nothing to try ;-)
+ messageBox(__("Please fill both 'Remote target options'. Try extended-remote for the type and IP:PORT for location."),
+ mfError | mfOKButton);
+ return 0;
+ }
+ // Check if we have something that looks like TCP/IP location
+ aux=strchr(dOps.rparam,':');
+ if (aux)
+ {
+ *aux=0;
+ messageBox(mfInformation | mfOKButton,
+ __("At the '%s' machine run: 'gdbserver :%s program args...'"),
+ dOps.rparam,aux+1);
+ *aux=':';
+ }
+ else
+ {
+ messageBox(__("Run gdbserver at the remote machine"),
+ mfInformation | mfOKButton);
+ }
+ res=dbg->SelectTargetRemote(dOps.program,dOps.rparam,dOps.rtype);
+ break;
+ }
+
+ if (!res)
+ DebugMsgSetError();
+ else
+ {
+ DebugMsgSetState();
+ DebugMsgSetMode(showConnect);
+ ExtractBinReference();
+ binMTime=st.st_mtime;
+ // Apply breakpoints.
+ DBG_ApplyBkpts();
+ DBG_ApplyWpts();
+ }
+
+ return res;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function dis/enables the commands related to debug operations. It
+should be called each time we change the debug state.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugUpdateCommands()
+{
+ if (!dbg)
+ return;
+ MIDebugger::eState st=dbg->GetState();
+ switch (st)
+ {
+ case MIDebugger::disconnected:
+ DebugCommandsForDisc();
+ break;
+ case MIDebugger::connected:
+ TSetEditorApp::setCmdState(cmeDebugOptions,False);
+ TSetEditorApp::setCmdState(cmeDbgOptionsAdv,False);
+ TSetEditorApp::setCmdState(cmeDbgEndSession,True);
+ TSetEditorApp::setCmdState(cmeDbgCloseSession,True);
+ TSetEditorApp::setCmdState(cmGDBCommand,True);
+ TSetEditorApp::setCmdState(cmeDbgGoConnected,False);
+ TSetEditorApp::setCmdState(cmeDbgGoReadyToRun,True);
+ // When a PID exits we go directly to connected:
+ TSetEditorApp::setCmdState(cmeBreakpoint,True);
+ TSetEditorApp::setCmdState(cmeDbgRunContinue,True);
+ TSetEditorApp::setCmdState(cmeDbgStepOver,True);
+ TSetEditorApp::setCmdState(cmeDbgTraceInto,True);
+ TSetEditorApp::setCmdState(cmeDbgGoToCursor,True);
+ TSetEditorApp::setCmdState(cmeDbgStop,False);
+ TSetEditorApp::setCmdState(cmeDbgKill,False);
+ TSetEditorApp::setCmdState(cmeDbgCallStack,False);
+ break;
+ case MIDebugger::stopped:
+ TSetEditorApp::setCmdState(cmeDbgFinishFun,True);
+ TSetEditorApp::setCmdState(cmeDbgReturnNow,True);
+ TSetEditorApp::setCmdState(cmeDbgCallStack,True);
+ TSetEditorApp::setCmdState(cmeDbgInspector,True);
+ TSetEditorApp::setCmdState(cmeDbgDataWindow,True);
+ TSetEditorApp::setCmdState(cmeDbgStackWindow,True);
+ TSetEditorApp::setCmdState(cmeDbgDisAsmWin,True);
+ TSetEditorApp::setCmdState(cmeDbgThreadSel,True);
+ TSetEditorApp::setCmdState(cmeDbgDetach,Boolean(dOps.mode!=dmLocal));
+ case MIDebugger::target_specified:
+ TSetEditorApp::setCmdState(cmeBreakpoint,True);
+ TSetEditorApp::setCmdState(cmeDbgRunContinue,True);
+ TSetEditorApp::setCmdState(cmeDbgStepOver,True);
+ TSetEditorApp::setCmdState(cmeDbgTraceInto,True);
+ TSetEditorApp::setCmdState(cmeDbgGoToCursor,True);
+ TSetEditorApp::setCmdState(cmGDBCommand,True);
+ TSetEditorApp::setCmdState(cmeDbgEditBreakPts,True);
+ TSetEditorApp::setCmdState(cmeDbgStop,False);
+ TSetEditorApp::setCmdState(cmeDbgGoReadyToRun,False);
+ TSetEditorApp::setCmdState(cmeDbgCleanElem,True);
+ if (st!=MIDebugger::stopped)
+ {
+ TSetEditorApp::setCmdState(cmeDbgKill,False);
+ TSetEditorApp::setCmdState(cmeDbgCallStack,False);
+ TSetEditorApp::setCmdState(cmeDbgInspector,False);
+ TSetEditorApp::setCmdState(cmeDbgDataWindow,False);
+ TSetEditorApp::setCmdState(cmeDbgStackWindow,False);
+ TSetEditorApp::setCmdState(cmeDbgDetach,False);
+ }
+ break;
+ case MIDebugger::running:
+ TSetEditorApp::setCmdState(cmeBreakpoint,False);
+ TSetEditorApp::setCmdState(cmeDbgRunContinue,False);
+ TSetEditorApp::setCmdState(cmeDbgStepOver,False);
+ TSetEditorApp::setCmdState(cmeDbgTraceInto,False);
+ TSetEditorApp::setCmdState(cmeDbgGoToCursor,False);
+ TSetEditorApp::setCmdState(cmeDbgFinishFun,False);
+ TSetEditorApp::setCmdState(cmeDbgReturnNow,False);
+ TSetEditorApp::setCmdState(cmeDbgStop,True);
+ TSetEditorApp::setCmdState(cmeDbgKill,True);
+ TSetEditorApp::setCmdState(cmeDbgCallStack,False);
+ TSetEditorApp::setCmdState(cmGDBCommand,False);
+ TSetEditorApp::setCmdState(cmeDbgEditBreakPts,False);
+ TSetEditorApp::setCmdState(cmeDbgCleanElem,False);
+ TSetEditorApp::setCmdState(cmeDbgDisAsmWin,False);
+ TSetEditorApp::setCmdState(cmeDbgThreadSel,False);
+ TSetEditorApp::setCmdState(cmeDbgDetach,False);
+ break;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the commands for the disconnected state. Must be called when we
+asynchronously abort the debug session or at the beggining of the program.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugCommandsForDisc()
+{
+ TView::commandSetChanged=True;
+ TView::curCommandSet.enableCmd(cmeDbgFirstCommand,cmeDbgLastCommand);
+ TView::curCommandSet-=cmeDbgFinishFun;
+ TView::curCommandSet-=cmeDbgReturnNow;
+ TView::curCommandSet-=cmeDbgStop;
+ TView::curCommandSet-=cmeDbgKill;
+ TView::curCommandSet-=cmeDbgEndSession;
+ TView::curCommandSet-=cmeDbgCloseSession;
+ TView::curCommandSet-=cmGDBCommand;
+ TView::curCommandSet-=cmeDbgCleanElem;
+ TView::curCommandSet-=cmeDbgDisAsmWin;
+ TView::curCommandSet-=cmeDbgThreadSel;
+ TView::curCommandSet-=cmeDbgDetach;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Starts running the program or resumes execution. It tries to be smart.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugRunOrContinue()
+{
+ int wasStopped=IsStopped();
+ if (!DebugCheckStopped())
+ return;
+ DBG_RefreshIgnoreBkpts();
+ if (!wasStopped && dOps.mode==dmPID)
+ {// Just attach if that's the first run
+ DebugMsgSetState();
+ return;
+ }
+ if (dbg->RunOrContinue())
+ DebugMsgSetState();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to detach from a remote or pid target.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugDetach()
+{
+ if (dOps.mode==dmLocal || !IsStopped())
+ return;
+ if (dbg->TargetUnselect())
+ DebugMsgSetState();
+}
+
+static
+Boolean DeskTopIsModal()
+{
+ // Check if the desktop is executing a modal dialog
+ TView *p=TApplication::deskTop->current;
+ return (p && (p->state & sfModal)) ? True : False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Poll gdb looking for async responses. Must be called from idle. If an
+error is received it is displayed in the message window. If the program
+stops the line where we stopped is selected.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugPoll()
+{
+ if (!dbg)
+ return;
+
+ TDisAsmWin::updateCodeInfo();
+
+ // We want to communicate a change
+ if (pendingStoppedInfo)
+ {
+ if (DeskTopIsModal())
+ return;
+ pendingStoppedInfo=0;
+ if (stoppedInfo)
+ DebugMsgSetStopped();
+ else
+ {
+ DebugMsgSetError();
+ DebugMsgSetState();
+ }
+ return;
+ }
+
+ mi_stop *rs;
+ if (dbg->Poll(rs))
+ {
+ // Discard the previous info
+ mi_free_stop(stoppedInfo);
+ stoppedInfo=rs;
+ // Process the new one
+ if (DeskTopIsModal())
+ {// Wait until the desktop isn't modal
+ pendingStoppedInfo=1;
+ return;
+ }
+ if (stoppedInfo)
+ DebugMsgSetStopped();
+ else
+ {
+ DebugMsgSetError();
+ DebugMsgSetState();
+ }
+ }
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Steps in the code. It tries to be smart.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugStepOver()
+{
+ if (!DebugCheckStopped())
+ return;
+ if (dbg->StepOver(IsDisAsmWinCurrent()))
+ DebugMsgSetState();
+ else
+ DebugMsgSetError();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Steps in the code, following functio calls. It tries to be smart.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugTraceInto()
+{
+ if (!DebugCheckStopped())
+ return;
+ if (dbg->TraceInto(IsDisAsmWinCurrent()))
+ DebugMsgSetState();
+ else
+ DebugMsgSetError();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Executes until the cursor position. It tries to be smart.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugGoToCursor()
+{
+ if (!DebugCheckStopped())
+ return;
+
+ int res;
+ if (IsDisAsmWinCurrent())
+ {
+ res=TDisAsmWin::runToCursor();
+ }
+ else
+ {
+ TCEditor *e=GetCurrentIfEditor();
+ if (!e)
+ return;
+
+ // We use the full name
+ char s[PATH_MAX];
+ strcpy(s,e->fileName);
+ CLY_fexpand(s);
+
+ res=dbg->GoTo(s,e->curPos.y+1);
+ }
+
+ if (res)
+ DebugMsgSetState();
+ else
+ DebugMsgSetError();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Executes until the end of the current function. Not smart, only works for
+stopped state.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugFinishFun()
+{
+ if (!dbg || dbg->GetState()!=MIDebugger::stopped)
+ return;
+ if (dbg->FinishFun())
+ DebugMsgSetState();
+ else
+ DebugMsgSetError();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finishes current function and goes to the previous frame. Not smart, only
+works for stopped state.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugReturnNow()
+{
+ if (!dbg || dbg->GetState()!=MIDebugger::stopped)
+ return;
+ mi_frames *f=dbg->ReturnNow();
+ if (f)
+ {
+ char b[maxWStatus];
+ int l=DebugMsgFillReason(f,b,False);
+ DebugMsgJumpToFrame(f,b,l);
+ mi_free_frames(f);
+ }
+ else
+ DebugMsgSetError();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sends a SIGINT to the debugger so it stops the debug session. Lamentably
+GDB/MI isn't fully asynchronous and hence -exec-interrupt can't be used.
+Isn't smart and should be used only when running.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugStop()
+{
+ if (!dbg || dbg->GetState()!=MIDebugger::running)
+ return;
+ if (dbg->Stop())
+ DebugMsgSetState();
+ else
+ DebugMsgSetError();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Tries to kill the program. If we are running we must do it in two steps:
+1) We stop the program and recover gdb prompt and 2) We actually kill it.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugKill()
+{
+ if (!dbg)
+ return;
+ if (dbg->GetState()==MIDebugger::running)
+ {// We must recover gdb control first
+ DebugStop();
+ // We do it in 2 steps
+ killAfterStop=1;
+ return;
+ }
+ if (dbg->GetState()==MIDebugger::stopped)
+ {
+ if (dbg->Kill())
+ DebugMsgSetState();
+ else
+ DebugMsgSetError();
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sends the stack frames to the message window so you can browse the calling
+sequence. Isn't smart and must be used only during "stopped".
+
+***************************************************************************/
+
+void TSetEditorApp::DebugCallStack()
+{
+ if (!dbg || dbg->GetState()!=MIDebugger::stopped)
+ return;
+ mi_frames *f=dbg->CallStack(true), *r;
+ if (!f)
+ {
+ DebugMsgSetError();
+ return;
+ }
+
+ unsigned options;
+ FileInfo fI;
+ char b[maxWStatus];
+ int cnt;
+ DynStrCatStruct msg;
+ fI.Column=1;
+ fI.offset=-1;
+ fI.len=0;
+
+ for (cnt=0, r=f; r; r=r->next, cnt++)
+ {
+ options=0;
+ if (r==f) // First
+ options|=edsmRemoveOld;
+ if (r->next)
+ options|=edsmDontUpdate;
+ fI.Line=r->line;
+ // Convert the frame into something "human readable"
+ const char *unknown=TVIntl::getText(__("unknown"),icUnknown);
+ int l=TVIntl::snprintf(b,maxWStatus,__("%d: %s:%s:%d addr %p"),r->level,
+ r->func ? r->func : unknown,
+ r->file ? r->file : unknown,
+ r->line,r->addr);
+ DynStrCatInit(&msg,b,l);
+ // Add the function arguments.
+ mi_results *args=r->args;
+ if (args)
+ {
+ DynStrCat(&msg," args: (");
+ // messy ;-P
+ while (args)
+ {
+ if (args->type==t_tuple && args->v.rs)
+ {
+ mi_results *name=args->v.rs;
+ mi_results *val=name->next;
+ if (val && name->type==t_const && val->type==t_const)
+ {
+ l=CLY_snprintf(b,maxWStatus,"%s=%s",name->v.cstr,val->v.cstr);
+ DynStrCat(&msg,b,l);
+ }
+ }
+ args=args->next;
+ if (args)
+ DynStrCat(&msg,", ",2);
+ }
+ DynStrCat(&msg,")",1);
+ }
+ EdShowMessageFile(msg.str,fI,SolveFileName(r->file),options);
+ free(msg.str);
+ }
+ mi_free_frames(f);
+ if (cnt)
+ {
+ // Important note: we can't play with the edsmUpdateSpLines flag because
+ // not all splines will belong to the same file.
+ SpLinesUpdate();
+ EdJumpToFirstError();
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Evaluates the provided expression. Tries to be smart.
+
+ Return: The result, the error description or NULL for incorrect states.
+
+***************************************************************************/
+
+char *TSetEditorApp::DebugEvalExpression(char *exp)
+{
+ if (!DebugCheckAcceptCmd())
+ return NULL;
+ return dbg->EvalExpression(exp);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Modifies the provided expression. Tries to be smart.
+
+ Return: The result, the error description or NULL for incorrect states.
+
+***************************************************************************/
+
+char *TSetEditorApp::DebugModifyExpression(char *exp, char *newVal)
+{
+ if (!DebugCheckAcceptCmd())
+ return NULL;
+ return dbg->ModifyExpression(exp,newVal);
+}
+
+struct evalBox
+{
+ char exp[widthFiles];
+ char res[widthExpRes];
+ char val[widthShort];
+};
+
+
+class TDbgEvalModify : public TDialog
+{
+public:
+ TDbgEvalModify(evalBox *aBox) :
+ TWindowInit(&TDbgEvalModify::initFrame),
+ TDialog(TRect(1,1,1,1),__("Evaluate and Modify")) { box=aBox; };
+ virtual void handleEvent(TEvent &);
+
+ TInputLinePiped *exp;
+ TInputLinePiped *res;
+ TInputLine *val;
+
+ evalBox *box;
+};
+
+/**[txh]********************************************************************
+
+ Description:
+ Command loop for the Debug Evaluate & Modify dialog. It calls
+DebugEvalExpression and DebugModifyExpression and redirects copy/paste
+actions to the correct input line.
+
+***************************************************************************/
+
+void TDbgEvalModify::handleEvent(TEvent &event)
+{
+ char *ret;
+
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ switch (event.message.command)
+ {
+ case cmEval:
+ exp->getData(box->exp);
+ ret=TSetEditorApp::DebugEvalExpression(box->exp);
+ if (ret)
+ {
+ strncpyZ(box->res,ret,widthExpRes);
+ res->setData(box->res);
+ free(ret);
+ exp->selectAll(True);
+ }
+ clearEvent(event);
+ break;
+ case cmChange:
+ exp->getData(box->exp);
+ val->getData(box->val);
+ ret=TSetEditorApp::DebugModifyExpression(box->exp,box->val);
+ if (ret)
+ {
+ strncpyZ(box->res,ret,widthExpRes);
+ res->setData(box->res);
+ free(ret);
+ exp->selectAll(True);
+ }
+ clearEvent(event);
+ break;
+ case cmCaCopy:
+ event.message.command=cmtilCopy;
+ res->handleEvent(event);
+ break;
+ case cmCaPaste:
+ event.message.command=cmtilPaste;
+ exp->handleEvent(event);
+ break;
+ case cmDbgInspect:
+ endModal(cmDbgInspect);
+ clearEvent(event);
+ break;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Creates the debugger eval/modify dialog.
+
+ Return: TDialog pointer to the new dialog.
+
+***************************************************************************/
+
+TDbgEvalModify *createEvalModifyDialog(evalBox *box)
+{
+ TDbgEvalModify *d=new TDbgEvalModify(box);
+ TSViewCol *col=new TSViewCol(d);
+
+ TSInputLinePiped *sExp=
+ new TSInputLinePiped(widthFiles,1,hID_DbgEvalModifyExp,maxWBox);
+ TSInputLinePiped *sRes=
+ new TSInputLinePiped(widthExpRes,0,0,maxWBox,tilpNoPipe | tilpNoPaste);
+ TSInputLine *sVal=new TSInputLine(widthShort,1,hID_DbgEvalModifyNewV,maxWBox);
+ d->exp=(TInputLinePiped *)sExp->view;
+ d->res=(TInputLinePiped *)sRes->view;
+ d->val=(TInputLine *)sVal->view;
+ TSetEditorApp::setCmdState(cmDbgInspect,dbg->GetState()==MIDebugger::stopped ?
+ True : False);
+
+ // EN: CEHIPRNV
+ TSVeGroup *o1=
+ MakeVeGroup(0, // All together
+ new TSLabel(__("~E~xpression (escape \" characters: \\\")"),sExp),
+ new TSLabel(__("~R~esult"),sRes),
+ new TSLabel(__("~N~ew value"),sVal),
+ 0);
+ //o1->makeSameW();
+ TSHzGroup *o2=
+ MakeHzGroup(new TSButton(__("E~v~al"),cmEval,bfDefault),
+ new TSButton(__("C~h~ange"),cmChange),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("~C~opy"),cmCaCopy),
+ new TSButton(__("~P~aste"),cmCaPaste),
+ new TSButton(__("~I~nspect"),cmDbgInspect),
+ 0);
+
+ col->insert(xTSLeft,yTSUp,o1);
+ col->insert(xTSCenter,yTSDown,o2);
+
+ col->doItCenter(cmeDbgEvalModify);
+ delete col;
+ return d;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's the high level function to bring the Debug Evaluate & Modify
+dialog. It ensures the current state is correct and executes the dialog.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugEvalModify(char *startVal)
+{
+ if (!DebugCheckAcceptCmd())
+ return;
+ evalBox box;
+ memset(&box,0,sizeof(box));
+ if (startVal)
+ {
+ strncpyZ(box.exp,startVal,widthFiles);
+ delete[] startVal;
+ }
+
+ TDbgEvalModify *d=createEvalModifyDialog(&box);
+ if (execDialog(d,&box)==cmDbgInspect)
+ {
+ if (IsEmpty(box.exp))
+ messageBox(__("Nothing to inspect, please provide an expression"),
+ mfError | mfOKButton);
+ else
+ OpenInspector(box.exp);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Removes the "CPU Line". Currently it doesn't force a redraw. This have a
+side effect: CPU lines remains painted when the next CPU line isn't in the
+same file. I like it, but could change in the future, needs more testing.
+
+***************************************************************************/
+
+void DebugClearCPULine()
+{
+ if (!cpuLFile)
+ return;
+ SpLinesDeleteForId(idsplRunLine,cpuLFile,True,cpuLLine);
+ delete[] cpuLFile;
+ cpuLFile=NULL;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the "CPU Line" and remmembers its position to allow removing it using
+@x{DebugClearCPULine}. Is called from @x{GotoFileLine}.
+
+***************************************************************************/
+
+void DebugSetCPULine(int line, char *file)
+{
+ DebugClearCPULine();
+ SpLinesAdd(file,line,idsplRunLine,True);
+ cpuLFile=newStr(file);
+ cpuLLine=line;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Verifies if we have an active debug session. If that's the case asks the
+user if it's ok to end it. Should be called when closing the project,
+exiting the application, etc. Note it doesn't close the session. Use
+@x{::DebugDeInitVars} for this.
+
+ Return: !=0, ok, go ahead.
+
+***************************************************************************/
+
+int TSetEditorApp::DebugConfirmEndSession(Boolean directRequest)
+{
+ if (!dbg)
+ return 1; // Ok, we are not debugging.
+ MIDebugger::eState st=dbg->GetState();
+ if (st!=MIDebugger::stopped && st!=MIDebugger::running)
+ return 1; // We are just connected
+ return GiveAdvice(directRequest ? gadvDbgDestSes : gadvDbgSesActive)==cmYes;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a light alternative to @x{::DebugDeInitVars}. It doesn't kill the
+list of breakpoints, watchpoints, etc. It just closes gdb connection and
+hides the windows. Asks for confirmation if we are running or stopped.
+
+***************************************************************************/
+
+Boolean TSetEditorApp::DebugCloseSession(Boolean confirm)
+{
+ if (dbg)
+ {
+ MIDebugger::eState st=dbg->GetState();
+ if (st==MIDebugger::running || st==MIDebugger::stopped)
+ {
+ if (confirm && GiveAdvice(gadvDbgKillPrg)!=cmYes)
+ return False;
+ }
+ delete dbg; // It will close the debug session
+ dbg=NULL;
+ }
+ TProgram::deskTop->lock();
+ DebugMsgSetState();
+ DebugMsgClose();
+ WatchesClose();
+ DebugCommonCleanUp();
+ TProgram::deskTop->unlock();
+
+ return True;
+}
+
+// Small class to display frames
+class TFramesList : public TStringable
+{
+public:
+ TFramesList(mi_frames *theFrames);
+ ~TFramesList();
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ mi_frames *getItem(int index);
+
+protected:
+ mi_frames *frames;
+};
+
+TFramesList::~TFramesList()
+{
+ mi_free_frames(frames);
+}
+
+TFramesList::TFramesList(mi_frames *theFrames)
+{
+ frames=theFrames;
+ Count=0;
+ while (theFrames)
+ {
+ Count++;
+ theFrames=theFrames->next;
+ }
+}
+
+mi_frames *TFramesList::getItem(int num)
+{
+ mi_frames *p=frames;
+ while (num && p)
+ {
+ num--;
+ p=p->next;
+ }
+ return num ? NULL : p;
+}
+
+void TFramesList::getText(char *dest, unsigned item, int maxLen)
+{
+ mi_frames *r=getItem(item);
+ if (!r)
+ {
+ *dest=0;
+ return;
+ }
+ const char *unknown=TVIntl::getText(__("unknown"),icUnknown);
+ if (r->addr)
+ TVIntl::snprintf(dest,maxLen,__("%d: %s:%s:%d addr %p"),r->thread_id,
+ r->func ? r->func : unknown,
+ r->file ? r->file : unknown,
+ r->line,r->addr);
+ else
+ TVIntl::snprintf(dest,maxLen,"%d: %s:%s:%d",r->thread_id,
+ r->func ? r->func : unknown,
+ r->file ? r->file : unknown,
+ r->line);
+}
+
+void TSetEditorApp::DebugThreadSel()
+{
+ if (!IsStopped())
+ return;
+ // Find the possible ids
+ int *list=NULL;
+ int cant=dbg->ThreadListIDs(list);
+ if (cant<=1)
+ {
+ free(list);
+ messageBox(__("No threads to select"),mfError|mfOKButton);
+ return;
+ }
+ // Get info about them
+ mi_frames *f=dbg->ThreadList();
+ TFramesList *fl=new TFramesList(f);
+ if (fl->GetCount()!=(unsigned)cant)
+ {
+ delete fl;
+ messageBox(__("Inconsistent info from gdb"),mfError|mfOKButton);
+ return;
+ }
+ // Transfer the ids
+ mi_frames *c=f;
+ for (int i=0; i<cant; i++)
+ {
+ c->thread_id=list[i];
+ c=c->next;
+ }
+ // Create a dialog to select them
+ TSViewCol *col=new TSViewCol(__("Select Thread"));
+
+ int h=cant, hmax=GetDeskTopRows()-6, ops=0;
+ if (h>hmax)
+ {
+ h=hmax;
+ ops=tsslbVertical;
+ }
+ col->insert(xTSCenter,yTSUp,new TSLabel(__("ID"),
+ new TSStringableListBox(GetDeskTopCols()-6,h,ops)));
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmeDbgThreadSel);
+ delete col;
+ TStringableListBoxRec box;
+ box.items=fl;
+ box.selection=0;
+ // Get the current id from the stopped info
+ if (stoppedInfo && stoppedInfo->have_thread_id)
+ for (int i=0; i<cant; i++)
+ if (list[i]==stoppedInfo->thread_id)
+ {
+ box.selection=i;
+ break;
+ }
+ // Execute the dialog
+ if (execDialog(d,&box)==cmOK)
+ {
+ mi_frames *frame=fl->getItem(box.selection);
+ frame=dbg->ThreadSelect(frame->thread_id);
+ if (frame)
+ {
+ DebugMsgJumpToFrame(frame,NULL,0);
+ mi_free_frames(frame);
+ }
+ else
+ ShowErrorInMsgBox();
+ }
+ delete fl;
+ free(list);
+}
+
+//---------------------------------------------------------------------------
+
+const int disAsmAfterPC=500;
+const ulong disAsmMaxDist=20000;
+
+// Collection to convert an address into a line number inside the assembler text
+Boolean TAdd2Line::searchL(int line, ccIndex &pos)
+{
+ byLine=1;
+ Boolean ret=search((void *)(long)line,pos);
+ byLine=0;
+ return ret;
+}
+
+void *TAdd2Line::keyOf(void *item)
+{
+ stAdd2Line *p=(stAdd2Line *)item;
+ return byLine ? (void *)(long)p->line : p->addr;
+}
+
+int TAdd2Line::compare(void *s1, void *s2)
+{
+ return (char *)s1-(char *)s2;
+}
+
+void TAdd2Line::freeItem(void *s)
+{
+ delete (stAdd2Line *)s;
+}
+
+void TAdd2Line::insert(void *addr, int line, mi_asm_insns *sl, mi_asm_insn *al)
+{
+ stAdd2Line *p=new stAdd2Line;
+ p->addr=addr;
+ p->line=line;
+ p->sourceL=sl;
+ p->asmL=al;
+ TNSSortedCollection::insert(p);
+}
+
+TDisAsmEdWin::TDisAsmEdWin(const TRect &aR) :
+ TWindowInit(TDisAsmEdWin::initFrame),
+ TCEditWindow(aR,NULL,wnNoNumber,False)
+{// Can't be: moved, zoomed, resized, etc.
+ flags=0;
+ // Doesn't have a shadow
+ state&=~sfShadow;
+ // Usualy windows climbs to the top when selected. But here we are in a dialog
+ // and doing this changes the objects order generating a real mess.
+ // The net result is that after a couple of selections no TView can be
+ // selected.
+ options&=~ofTopSelect;
+ growMode=gfGrowHiX | gfGrowHiY;
+ // Enable some special hacks for this case
+ editor->isDisassemblerEditor=1;
+ // SPARC code have tabs
+ editor->tabSize=8;
+ editor->SeeTabs=False;
+ // We start without code
+ lines=NULL;
+ a2l=NULL;
+ from=to=NULL;
+ spLine=NULL;
+ curLine=NULL;
+
+ MIDebugger::archType tp=dbg ? dbg->GetTargetArchitecture() : MIDebugger::arUnknown;
+ int shlNum;
+ switch (tp)
+ {
+ case MIDebugger::arSPARC:
+ shlNum=SHLNumberOf("SPARC asm");
+ break;
+ // Use IA32 as default
+ case MIDebugger::arIA32:
+ default:
+ shlNum=SHLNumberOf("80x86 asm (AT&T syntax)");
+ }
+ editor->SetHighlightTo(shlGenericSyntax,shlNum);
+}
+
+const char *TDisAsmEdWin::getTitle(short)
+{
+ return __("Code");
+}
+
+TPalette &TDisAsmEdWin::getPalette() const
+{
+ static TPalette
+ pal(cpDisAsmEd,sizeof(cpDisAsmEd)-1);
+
+ return pal;
+}
+
+TDisAsmEdWin::~TDisAsmEdWin()
+{
+ mi_free_asm_insns(lines);
+ destroy0(a2l);
+ destroy0(spLine);
+}
+
+char *TDisAsmEdWin::getCodeInfo(char *b, int l)
+{// If we failed to get the code just abort
+ if (!a2l)
+ return NULL;
+ b[0]=0;
+ int line=editor->curPos.y+1;
+ ccIndex pos;
+ if (a2l->searchL(line,pos))
+ {
+ mi_asm_insn *p=a2l->At(pos)->asmL;
+ if (p->func)
+ CLY_snprintf(b,l,"%p <%s+%d>",p->addr,p->func,p->offset);
+ else
+ CLY_snprintf(b,l,"%p",p->addr);
+ }
+ return b;
+}
+
+int TDisAsmEdWin::runToCursor()
+{
+ if (!a2l)
+ // Pretend we succeed and avoid farther messages.
+ // The user should avoid going nowhere.
+ return 1;
+
+ int line=editor->curPos.y+1;
+ ccIndex pos;
+ void *addr=NULL;
+ if (a2l->searchL(line,pos))
+ {
+ mi_asm_insn *p=a2l->At(pos)->asmL;
+ addr=p->addr;
+ }
+ int res=1;
+ if (addr)
+ res=dbg->GoTo(addr);
+ else
+ messageBox(__("No address associated with this line"),mfError|mfOKButton);
+
+ return res;
+}
+
+void TDisAsmEdWin::setCode(mi_asm_insns *aLines)
+{
+ mi_free_asm_insns(lines);
+ lines=aLines;
+ destroy0(a2l);
+
+ // For the comments
+ editor->CacheSyntaxHLData(editor->GenericSHL);
+
+ // Create the new content
+ char *curFunc=NULL;
+ DynStrCatStruct tx;
+ DynStrCatInit(&tx);
+ mi_asm_insns *c=lines;
+ mi_asm_insn *a;
+ // First pass: create a list of jump targets
+ TStringCollection *col=new TStringCollection(10,10);
+ while (c)
+ {
+ a=c->ins;
+ while (a)
+ {
+ char *s=a->inst;
+ if (s)
+ {
+ int l=strlen(s);
+ if (l && s[l-1]=='>')
+ {
+ int ls=l-2;
+ for (; ls>=0 && s[ls]!='<'; ls--);
+ if (s[ls]=='<')
+ {
+ char *label=newStrL(s+ls+1,l-ls-2);
+ col->insert(label);
+ dbgPr("Label: <%s>\n",label);
+ }
+ }
+ }
+ a=a->next;
+ }
+ c=c->next;
+ }
+ // Second pass: generate the text
+ c=lines;
+ a2l=new TAdd2Line();
+ from=to=NULL;
+ int line=1;
+ // Variables used to obtain source lines
+ char *curFile=NULL;
+ LineHandler lh;
+ unsigned misc=GetGDBMisc();
+ while (c)
+ {// If source file info is available add it
+ if (c->file)
+ {// We insert the info commented
+ // The comment is architecture dependent
+ DynStrCat(&tx,TCEditor::strC.EOLCom1,TCEditor::strC.lEOLCom1);
+ DynStrCat(&tx," ",1);
+ char added=0;
+ if (!(misc & miscNoSourceInAsm))
+ {// Try adding the source code
+ if (!curFile || strcmp(curFile,c->file))
+ {
+ curFile=c->file;
+ TCEditWindow *edw=NULL;
+ char *curSolvedFile=SolveFileName(c->file);
+ if (curSolvedFile)
+ edw=GetEditorWindowForFile(curSolvedFile);
+ lh.setEditor(edw ? edw->editor : NULL);
+ }
+ unsigned len;
+ char *s=lh.getLine(c->line-1,len);
+ if (s && len)
+ {// Avoid mixing with a DOS EOL
+ if (len>1 && s[len-2]=='\r')
+ {
+ s[len-2]='\n';
+ len--;
+ }
+ DynStrCat(&tx,s,len);
+ // Ensure we have an EOL
+ if (s[len-1]!='\n')
+ DynStrCat(&tx,"\n",1);
+ added=1;
+ }
+ }
+ if (!added)
+ {// Failed or the user doesn't want source.
+ // So put the file and line number.
+ DynStrCat(&tx,c->file);
+ DynStrCat(&tx,":",1);
+ char b[32];
+ int l=CLY_snprintf(b,32,"%d\n",c->line);
+ DynStrCat(&tx,b,l);
+ }
+ line++;
+ }
+ a=c->ins;
+ while (a)
+ {
+ int lf=0;
+ if (a->func)
+ lf=strlen(a->func);
+ // Put a label if we changed function
+ if (a->func && (!curFunc || strcmp(curFunc,a->func)))
+ {
+ DynStrCat(&tx,a->func,lf);
+ DynStrCat(&tx,":\n",2);
+ curFunc=a->func;
+ line++;
+ }
+ // Put a jump label we detected a jump to this location
+ if (a->offset && a->func)
+ {
+ AllocLocalStr(b,lf+32);
+ int l=CLY_snprintf(b,lf+32,"%s+%d",a->func,a->offset);
+ ccIndex pos;
+ if (col->search(b,pos))
+ {
+ DynStrCat(&tx,b,l);
+ DynStrCat(&tx,":\n",2);
+ line++;
+ }
+ }
+ // Add the assembler code
+ DynStrCat(&tx," ",4);
+ if (a->inst)
+ {
+ DynStrCat(&tx,a->inst);
+ a2l->insert(a->addr,line,c,a);
+ }
+ DynStrCat(&tx,"\n",1);
+ line++;
+ if (!from)
+ to=from=a->addr;
+ else
+ to=a->addr;
+ a=a->next;
+ }
+ c=c->next;
+ }
+ destroy(col);
+ editor->lock();
+ // Clear the current content
+ if (editor->bufLen)
+ editor->setBufLen(0);
+ // Insert the new content
+ editor->isReadOnly=False;
+ editor->insertText(tx.str,tx.len,False);
+ editor->isReadOnly=True;
+ // Avoid the question about saving it ;-)
+ editor->modified=False;
+ editor->unlock();
+ free(tx.str);
+}
+
+int TDisAsmEdWin::dissasembleFrame(mi_frames *f)
+{
+ mi_asm_insns *r;
+ // Disassemble according to the info we have
+ if (f->file)
+ {// We have file & line. We can ask for the whole function.
+ r=dbg->Disassemble(f->file,f->line,-1,MI_DIS_SRC_ASM);
+ }
+ else
+ {// We don't know the source file so it doesn't have debug info.
+ if (!f->addr)
+ // Hope never happend
+ return 0;
+
+ char endB[32];
+ char startB[32];
+ ulong start=0;
+ // Disassemble upto addr+disAsmAfterPC
+ ulong end=(ulong)((char *)f->addr+disAsmAfterPC);
+
+ // Solve the starting point
+ if (f->func)
+ {// We know the function name and will try to get from the beggining
+ // Find if the function is valid
+ unsigned len=strlen(f->func)+20;
+ AllocLocalStr(b,len);
+ CLY_snprintf(b,len,"(unsigned long)%s",f->func);
+ char *res=TSetEditorApp::DebugEvalExpression(b);
+ if (res && MIDebugger::GetErrorNumber()==MI_OK)
+ {
+ start=atoi(res);
+ // Put some limits, some times gdb reports a wrong function
+ if (start>end || end-start>disAsmMaxDist)
+ start=0;
+ }
+ free(res);
+ }
+ if (!start)
+ start=(ulong)f->addr;
+
+ CLY_snprintf(startB,32,"0x%lx",start);
+ CLY_snprintf(endB,32,"0x%lx",end);
+ r=dbg->Disassemble(startB,endB,MI_DIS_ASM);
+ }
+ if (!r)
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+
+ if (0)
+ {// Debug code
+ mi_asm_insns *c=r;
+ mi_asm_insn *a;
+ while (c)
+ {
+ if (c->file)
+ printf("Source: %s:%d\n",c->file,c->line);
+ a=c->ins;
+ while (a)
+ {
+ printf("%p: %s [%s+%d]\n",a->addr,a->inst,a->func,a->offset);
+ a=a->next;
+ }
+ c=c->next;
+ }
+ mi_free_asm_insns(r);
+ }
+
+ setCode(r);
+ return 1;
+}
+
+int TDisAsmEdWin::jumpToFrame(mi_frames *f)
+{
+ Boolean newCode=False;
+ curLine=NULL;
+ // Make sure we have the address in our range
+ if (f->addr<from || f->addr>to)
+ {
+ if (!dissasembleFrame(f))
+ return 0;
+ newCode=True;
+ }
+ // Get the line for this address
+ ccIndex pos;
+ Boolean res=a2l->search(f->addr,pos);
+ if (!res)
+ printf("Oops! no line\n");
+ if (pos<0 || pos>=a2l->getCount())
+ return 0;
+ stAdd2Line *a=a2l->At(pos);
+ curLine=a->sourceL;
+ editor->lock();
+ editor->GoAndSelectLine(a->line,1,False);
+ editor->trackCursor(newCode);
+ // The CPU line
+ TSpCollection *nSpLine=new TSpCollection(1);
+ nSpLine->insert(a->line-1,idsplRunLine);
+ editor->SetSpecialLines(nSpLine);
+ destroy(spLine);
+ spLine=nSpLine;
+ // Unlock
+ editor->unlock();
+ return 1;
+}
+
+TRegisters::TRegisters(mi_chg_reg *aRegs, int cRegs)
+{
+ regs=aRegs;
+ Count=cRegs;
+}
+
+TRegisters::~TRegisters()
+{
+ mi_free_chg_reg(regs);
+}
+
+void TRegisters::getText(char *dest, unsigned item, int maxLen)
+{
+ mi_chg_reg *p=getItem(item);
+ CLY_snprintf(dest,maxLen,"%c %s=%s",p->updated ? '*' : ' ',p->name,p->val);
+}
+
+mi_chg_reg *TRegisters::getItem(int num)
+{
+ mi_chg_reg *p=regs;
+ while (num && p)
+ {
+ num--;
+ p=p->next;
+ }
+ return num ? NULL : p;
+}
+
+int TRegisters::update()
+{
+ return dbg->UpdateRegisters(regs);
+}
+
+TDisAsmWin::TDisAsmWin(const TRect &aR) :
+ TWindowInit(TDisAsmWin::initFrame),
+ TDialog(aR,__("Disassembler Window"))
+{
+ flags=wfMove | wfClose | wfGrow | wfZoom;
+ //growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+
+ // Code
+ TRect r=getExtent();
+ int rbx=r.b.x;
+ r.a.x++; r.a.y++; r.b.y-=2; r.b.x/=2;
+ edw=new TDisAsmEdWin(r);
+ // An editor inside a dialog!!
+ // That's the meaning of code reuse ;-)
+ insert(edw);
+
+ // Code Info
+ char b[81];
+ memset(b,' ',80);
+ b[80]=0;
+ int ray=r.a.y;
+ r.a.y=r.b.y; r.b.y=r.a.y+1;
+ codeInfo=new TNoStaticText(r,b);
+ codeInfo->growMode=gfGrowHiX | gfGrowHiY | gfGrowLoY;
+ insert(codeInfo);
+ codeInfoLine=-1;
+
+ int cRegs;
+ mi_chg_reg *rg=dbg->GetRegisterValues(&cRegs);
+ if (rg && !dbg->GetRegisterNames(rg))
+ {
+ mi_free_chg_reg(rg);
+ rg=NULL;
+ }
+ if (rg)
+ {
+ regs=new TRegisters(rg,cRegs);
+ // Registers
+ r.a.x=r.b.x; r.b.x=rbx-2; r.a.y=ray; r.b.y--;
+ TScrollBar *vScrollBar=new TScrollBar(TRect(r.b.x,1,r.b.x+1,r.b.y));
+ TScrollBar *hScrollBar=new TScrollBar(TRect(r.a.x,r.b.y,r.b.x,r.b.y+1));
+ hScrollBar->growMode=gfGrowAll;
+ hScrollBar->setRange(0,100);
+ bRegs=new TStringableListBox(r,1,hScrollBar,vScrollBar);
+ bRegs->newList(regs);
+ bRegs->growMode=gfGrowLoX | gfGrowHiX | gfGrowHiY;
+ insert(vScrollBar);
+ insert(hScrollBar);
+ insert(bRegs);
+ }
+ else
+ {
+ regs=NULL;
+ bRegs=NULL;
+ ShowErrorInMsgBox();
+ }
+
+ // Select the code window
+ selectNext(True);
+ theDisAsmWin=this;
+ helpCtx=hcDisassembler;
+}
+
+TDisAsmWin::~TDisAsmWin()
+{
+ delete regs;
+}
+
+static
+int DebugEvalExpressionNoRet(char *exp)
+{
+ free(TSetEditorApp::DebugEvalExpression(exp));
+ if (MIDebugger::GetErrorNumber()!=MI_OK)
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ return 1;
+}
+
+void TDisAsmWin::handleEvent(TEvent &event)
+{
+ TDialog::handleEvent(event);
+ if (bRegs &&
+ ((event.what==evBroadcast && event.message.command==cmListItemSelected) ||
+ (event.what==evCommand && event.message.command==cmModifyReg)))
+ {
+ char b[widthWtExp];
+ mi_chg_reg *r=regs->getItem(bRegs->focused);
+ if (r->val)
+ strncpyZ(b,r->val,widthWtExp);
+ else
+ b[0]=0;
+ if (r->name && execDialog(createEditExp(__("Modify register")),b)==cmOK)
+ {
+ char e[widthWtExp];
+ CLY_snprintf(e,widthWtExp,"$%s=%s",r->name,b);
+ if (DebugEvalExpressionNoRet(e))
+ {
+ regs->update();
+ bRegs->drawView();
+ }
+ }
+ clearEvent(event);
+ }
+}
+
+int IsDisAsmWinCurrent()
+{
+ return TDisAsmWin::isDisAsmWinCurrent();
+}
+
+int IsDisAsmWinAvailable()
+{
+ return TDisAsmWin::isDisAsmWinAvailable();
+}
+
+void TDisAsmWin::close(void)
+{
+ theDisAsmWin=NULL;
+ TDialog::close();
+}
+
+TPalette &TDisAsmWin::getPalette() const
+{
+ static TPalette
+ pal(cpDisAsmWin,sizeof(cpDisAsmWin)-1);
+
+ return pal;
+}
+
+void TDisAsmWin::upCodeInfo()
+{
+ int curL=edw->editor->curPos.y;
+ if (codeInfoLine!=curL)
+ {
+ codeInfoLine=curL;
+ char b[80];
+ char *res=edw->getCodeInfo(b,80);
+ if (res)
+ codeInfo->setText(res);
+ }
+}
+
+class TDskDbgDisasm : public TDskWin
+{
+public:
+ TDskDbgDisasm(TView *w);
+
+ char *GetText(char *dest, short maxLen);
+};
+
+TDskDbgDisasm::TDskDbgDisasm(TView *w)
+{
+ view=w;
+ type=dktDbgDisasm;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=0;
+ ZOrder=-1;
+}
+
+char *TDskDbgDisasm::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" Disassembler [%p-%p]"),
+ TDisAsmWin::getFrom(),
+ TDisAsmWin::getTo());
+ return dest;
+}
+
+static
+void DisAsmWin()
+{
+ if (TDisAsmWin::windowCreated())
+ {
+ TDisAsmWin::beSelected();
+ return;
+ }
+ TRect re=GetDeskTopSize();
+ re.grow(-4,-2);
+ AddAndInsertDskWin(new TDskDbgDisasm(new TDisAsmWin(re)));
+}
+
+void TSetEditorApp::DebugDisAsmWin()
+{
+ if (!IsStopped() || !stoppedInfo || !stoppedInfo->frame)
+ return;
+ DisAsmWin();
+ TDisAsmWin::jumpToFrame(stoppedInfo->frame);
+}
+
+/*****************************************************************************
+ End of Editor debug commands
+*****************************************************************************/
+
+/*****************************************************************************
+ TInspector class and functionality
+*****************************************************************************/
+
+class TPVarTree : public TStringable
+{
+public:
+ TPVarTree(const char *var, Boolean fake=False);
+ ~TPVarTree();
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+
+ mi_gvar *getItem(int index);
+ char *getExpression(int index);
+
+ void collapse(mi_gvar *p);
+ void expand(mi_gvar *p);
+ int countVisChildren(mi_gvar *p);
+ const char *mainVarName() { return var->name; }
+ const char *mainVarExp() { return var->exp; }
+ int markChanged(const char *name, int depth);
+ int recycle();
+ char *createTreeState(mi_gvar *p);
+ char *createTreeState() { return createTreeState(var); }
+ int applyTreeState(mi_gvar *p, const char *st);
+ int applyTreeState(const char *st) { return applyTreeState(var,st); };
+
+ int isOK() { return ok; }
+ void disable() { outOfScope=1; }
+ void undefine();
+ Boolean canBeDestroyed();
+
+protected:
+ mi_gvar *var;
+ int ok;
+ int outOfScope;
+ char *exp;
+
+ mi_gvar *init(const char *anExp);
+};
+
+Boolean TPVarTree::canBeDestroyed()
+{
+ if (!dbg || outOfScope)
+ return True;
+ // We can't delete the variable while running
+ return dbg->GetState()==MIDebugger::running ? False : True;
+}
+
+TPVarTree::~TPVarTree()
+{
+ if (var)
+ {
+ if (dbg && !outOfScope)
+ dbg->DelgVar(var);
+ mi_free_gvar(var);
+ }
+ delete[] exp;
+}
+
+TPVarTree::TPVarTree(const char *anExp, Boolean fake) :
+ TStringable()
+{
+ exp=NULL;
+ if (fake)
+ {
+ var=mi_alloc_gvar();
+ var->name=strdup(anExp);
+ outOfScope=1;
+ Count=1;
+ ok=1;
+ }
+ else
+ {
+ ok=0;
+ Count=0;
+ outOfScope=0;
+ var=NULL;
+ var=init(anExp);
+ }
+}
+
+const int tstOpened=1, tstHaveChild=2, tstLast=4,
+ tstBase=64; // Just to make them ASCII
+
+char *TPVarTree::createTreeState(mi_gvar *p)
+{
+ int l=1+p->vischild+1, i=0;
+ char *r=new char[l];
+ r[l-1]=0;
+
+ while (i<l && p)
+ {
+ r[i]=tstBase | (((unsigned)p->format)<<3);
+ if (p->numchild)
+ r[i]|=tstHaveChild;
+ if (!p->next)
+ r[i]|=tstLast;
+ if (p->child && p->opened)
+ {
+ r[i]|=tstOpened;
+ p=p->child;
+ }
+ else if (p->next)
+ {
+ p=p->next;
+ }
+ else
+ {
+ while (p && !p->next)
+ p=p->parent;
+ if (p)
+ p=p->next;
+ }
+ i++;
+ }
+ return r;
+}
+
+int TPVarTree::applyTreeState(mi_gvar *p, const char *st)
+{
+ enum mi_gvar_fmt fmt;
+ while (*st && p)
+ {
+ if ((*st & tstHaveChild) && !p->numchild)
+ return 0;
+ if ((*st & tstOpened) && !p->opened)
+ expand(p);
+ fmt=(enum mi_gvar_fmt)((*st>>3) & 7);
+ if (fmt!=p->format)
+ {
+ dbg->SetFormatgVar(p,fmt);
+ if (p->value)
+ p->changed=1;
+ }
+ if (p->child)
+ {
+ p=p->child;
+ }
+ else if (p->next)
+ {
+ p=p->next;
+ }
+ else
+ {
+ while (p && !p->next)
+ p=p->parent;
+ if (p)
+ p=p->next;
+ }
+ st++;
+ }
+ return !*st && !p;
+}
+
+void TPVarTree::undefine()
+{
+ if (dbg && !outOfScope)
+ dbg->DelgVar(var);
+ disable();
+}
+
+mi_gvar *TPVarTree::init(const char *anExp)
+{
+ mi_gvar *v=NULL;
+ if (dbg && dbg->GetState()==MIDebugger::stopped)
+ {
+ v=dbg->AddgVar(anExp);
+ if (v && dbg->EvalgVar(v))
+ {
+ if (v->numchild)
+ ok=dbg->GetChildgVar(v) && dbg->FillTypeVal(v->child);
+ else
+ ok=1;
+ if (!exp)
+ exp=newStr(anExp);
+ Count=1+v->numchild;
+ }
+ }
+ return v;
+}
+
+int TPVarTree::recycle()
+{
+ if (!outOfScope || !dbg || dbg->GetState()!=MIDebugger::stopped)
+ return 0;
+ mi_gvar *v=init(exp);
+ if (v)
+ {// Find which ones are expanded
+ char *st=createTreeState(var);
+ mi_free_gvar(var);
+ var=v;
+ outOfScope=0;
+ // Try to expand the same vars
+ applyTreeState(var,st);
+ delete[] st;
+ return 1;
+ }
+ return 0;
+}
+
+int TPVarTree::markChanged(const char *name, int depth)
+{
+ mi_gvar *p=var;
+ int curDepth=0;
+
+ while (p)
+ {
+ if (curDepth==depth && strcmp(p->name,name)==0)
+ {
+ p->changed=1;
+ dbgPr("Marked %s as changed\n",p->exp);
+ return 1;
+ }
+ if (p->child)
+ {
+ p=p->child;
+ curDepth++;
+ }
+ else if (p->next)
+ {
+ p=p->next;
+ }
+ else
+ {
+ while (p && !p->next)
+ {
+ p=p->parent;
+ curDepth--;
+ }
+ if (p)
+ p=p->next;
+ }
+ }
+ return 0;
+}
+
+mi_gvar *TPVarTree::getItem(int index)
+{
+ mi_gvar *p=var;
+ for (int i=0; p && i<index; )
+ {
+ int have=1+p->vischild;
+ if (i+have>index)
+ {// Go deeper
+ p=p->child;
+ i++;
+ }
+ else
+ {// Next in the list
+ p=p->next;
+ i+=have;
+ }
+ }
+ return p;
+}
+
+char *TPVarTree::getExpression(int index)
+{
+ DynStrCatStruct st;
+
+ DynStrCatInit(&st,"*(",2);
+ mi_gvar *p=var;
+ int first=1;
+ for (int i=0; p && i<index; )
+ {
+ int have=1+p->vischild;
+ if (i+have>index)
+ {// Go deeper
+ // Classes uses <class> to separate members
+ if (p->exp && p->type && p->type[0])
+ {
+ if (first)
+ DynStrCat(&st,"(",1);
+ DynStrCat(&st,p->exp);
+ if (first)
+ {
+ DynStrCat(&st,")",1);
+ first=0;
+ }
+ DynStrCat(&st,".",1);
+ }
+ p=p->child;
+ i++;
+ }
+ else
+ {// Next in the list
+ p=p->next;
+ i+=have;
+ }
+ }
+ if (!p)
+ {
+ free(st.str);
+ return NULL;
+ }
+ DynStrCat(&st,p->exp);
+ DynStrCat(&st,")",1);
+ return st.str;
+}
+
+void TPVarTree::getText(char *dest, unsigned item, int maxLen)
+{
+ mi_gvar *p=getItem(item);
+
+ // Indent
+ int spaces=p->depth*2;
+ if (spaces>=maxLen)
+ spaces=maxLen-1;
+ if (spaces)
+ {
+ memset(dest,' ',spaces);
+ dest+=spaces;
+ maxLen-=spaces;
+ if (maxLen==1)
+ {
+ *dest=0;
+ return;
+ }
+ }
+
+ if (p->numchild)
+ {
+ int size=CLY_snprintf(dest,maxLen,"%c ",p->opened ? '-' : '+');
+ dest+=size;
+ maxLen-=size;
+ }
+
+ // The following operations needs gdb in stopped state.
+ if (!outOfScope && dbg && dbg->GetState()==MIDebugger::stopped)
+ {
+ if (!p->numchild && p->attr==MI_ATTR_DONT_KNOW)
+ dbg->FillAttr(p);
+ if (p->changed)
+ {
+ p->changed=0;
+ ::free(p->value);
+ p->value=NULL;
+ dbgPr("Forcing update of %s\n",p->name);
+ }
+ if (!p->type || !p->value)
+ dbg->FillOneTypeVal(p);
+ }
+
+ if ((!p->type || *p->type==0) && (!p->value || *p->value==0))
+ CLY_snprintf(dest,maxLen,"%s",p->name);
+ else
+ CLY_snprintf(dest,maxLen,"%s [%s]=%s",p->exp,p->type,p->value);
+}
+
+void TPVarTree::collapse(mi_gvar *p)
+{
+ p->opened=0;
+ int reduce=p->vischild;
+ mi_gvar *r=p->parent;
+ p->vischild=0;
+ while (r)
+ {
+ r->vischild-=reduce;
+ r=r->parent;
+ }
+ Count=1+var->vischild;
+}
+
+int TPVarTree::countVisChildren(mi_gvar *p)
+{
+ mi_gvar *n=p->child;
+ int res=0;
+ while (n)
+ {
+ res+=1+n->vischild;
+ n=n->next;
+ }
+ return res;
+}
+
+void TPVarTree::expand(mi_gvar *p)
+{
+ if (p->numchild && !p->child)
+ {// First time we expand it
+ if (outOfScope || !dbg || dbg->GetState()!=MIDebugger::stopped)
+ // We will hang if running and get nothing for other states.
+ return;
+ dbg->GetChildgVar(p);
+ // That's too slow :-(. We just update what's needed.
+ //dbg->FillTypeVal(p->child);
+ }
+ p->opened=1;
+ int increase=countVisChildren(p);
+ p->vischild=increase;
+ mi_gvar *r=p->parent;
+ while (r)
+ {
+ r->vischild+=increase;
+ r=r->parent;
+ }
+ Count=1+var->vischild;
+}
+
+class TInspector : public TDialog
+{
+public:
+ TInspector(TPVarTree *p);
+ TInspector(const TRect &aR, char *anExp, char *aTState);
+ ~TInspector();
+
+ virtual void handleEvent(TEvent &event);
+ virtual void setState(uint16 aState, Boolean enable);
+ virtual Boolean valid(ushort command);
+
+ void inspect();
+ void expand();
+ void collapse();
+ void recycle();
+ int modify();
+ int format();
+ void updateCommands(Boolean all=True);
+ void updateVars(mi_gvar_chg *changed);
+ const char *getVar() { return tree ? tree->mainVarExp() : exp; }
+ char *getTreeState() { return tree ? tree->createTreeState() : newStr(tstate); }
+
+ static int getCountInspectors() { return cInspectors; }
+
+protected:
+ TPVarTree *tree, *fake;
+ mi_gvar *focused;
+ int nFocused;
+ TStringableListBox *theLBox;
+ TNoStaticText *status;
+ int outOfScope;
+ enum { stNone, stOk, stWaitGDB, stOutOfScope };
+ int iStatus;
+ TSNoStaticText *CreateStatus();
+
+ char *exp, *tstate;
+
+ static int cInspectors;
+};
+
+int TInspector::cInspectors=0;
+
+TInspector::~TInspector()
+{
+ delete tree;
+ delete fake;
+ delete[] exp;
+ delete[] tstate;
+ cInspectors--;
+}
+
+Boolean TInspector::valid(ushort command)
+{
+ if (command==cmClose && tree)
+ return tree->canBeDestroyed();
+ return TDialog::valid(command);
+}
+
+int TInspector::modify()
+{
+ if (!focused || !dbg)
+ return 0;
+ char exp[widthWtExp];
+ if (focused->value)
+ strncpyZ(exp,focused->value,widthWtExp);
+ else
+ exp[0]=0;
+ if (execDialog(createEditExp(__("Modify variable")),exp)==cmOK)
+ {
+ if (dbg->AssigngVar(focused,exp))
+ {
+ theLBox->drawView();
+ return 1;
+ }
+ ShowErrorInMsgBox();
+ }
+ return 0;
+}
+
+void TInspector::setState(uint16 aState, Boolean enable)
+{
+ TDialog::setState(aState,enable);
+ // Update the commands when we become active.
+ if (aState==sfActive && enable)
+ updateCommands();
+}
+
+void TInspector::recycle()
+{
+ if (!outOfScope)
+ return;
+ if (!tree && exp)
+ {// It was loaded from disk and we are recreating it
+ tree=new TPVarTree(exp);
+ if (tree->isOK())
+ {
+ delete[] exp; exp=NULL;
+ tree->applyTreeState(tstate);
+ delete[] tstate; tstate=NULL;
+ outOfScope=0;
+ theLBox->newList(tree);
+ // It was released by newList, don't try to release again
+ fake=NULL;
+ updateCommands();
+ }
+ else
+ delete tree;
+ return;
+ }
+ if (tree->recycle())
+ {
+ outOfScope=0;
+ theLBox->setRange(tree->GetCount());
+ theLBox->focusItem(0);
+ updateCommands();
+ }
+}
+
+void TInspector::expand()
+{
+ if (outOfScope || !focused || !focused->numchild || focused->opened)
+ return;
+ tree->expand(focused);
+ theLBox->setRange(tree->GetCount());
+ theLBox->drawView();
+ updateCommands();
+}
+
+void TInspector::collapse()
+{
+ if (outOfScope || !focused || !focused->numchild || !focused->opened)
+ return;
+ tree->collapse(focused);
+ theLBox->setRange(tree->GetCount());
+ theLBox->drawView();
+ updateCommands();
+}
+
+void TInspector::updateCommands(Boolean all)
+{
+ // Compute the new status:
+ int cond1=dbg && dbg->GetState()==MIDebugger::stopped;
+ int cond2=cond1 && focused;
+ int cond=cond2 && focused->numchild;
+ int niStatus;
+ const char *cStatus;
+ if (outOfScope)
+ {
+ niStatus=stOutOfScope;
+ cStatus=TVIntl::getText(cInspNoScope,icInspNoScope);
+ }
+ else if (!cond1)
+ {
+ niStatus=stWaitGDB;
+ cStatus=TVIntl::getText(cInspWait,icInspWait);
+ }
+ else
+ {
+ niStatus=stOk;
+ cStatus=TVIntl::getText(cInspOk,icInspOk);
+ }
+ // Update according it
+ if (all)
+ {
+ TSetEditorApp::setCmdState(cmDbgInspect,cond2 && focused->ispointer ?
+ True : False);
+ TSetEditorApp::setCmdState(cmExpand,cond && !focused->opened ? True : False);
+ TSetEditorApp::setCmdState(cmCollapse,cond && focused->opened ? True : False);
+ TSetEditorApp::setCmdState(cmRecycle,cond1 && outOfScope ? True : False);
+ TSetEditorApp::setCmdState(cmModifyIns,cond2 && !focused->numchild &&
+ focused->attr==MI_ATTR_EDITABLE ? True : False);
+ }
+ if (niStatus!=iStatus)
+ {
+ iStatus=niStatus;
+ status->setText(cStatus);
+ if (all)
+ TSetEditorApp::setCmdState(cmFormatIns,cond2 ? True : False);
+ }
+}
+
+void TInspector::updateVars(mi_gvar_chg *changed)
+{
+ if (outOfScope)
+ return;
+
+ mi_gvar_chg *ch=changed;
+ const char *n=tree->mainVarName();
+ int l=strlen(n);
+ int nchanged=0;
+
+ while (ch)
+ {
+ if (ch->name && strncmp(n,ch->name,l)==0 &&
+ (!ch->name[l] || ch->name[l]=='.'))
+ {
+ int depth=0;
+ char *s;
+ if (ch->name[l])
+ for (depth=1, s=ch->name+l+1; *s; s++)
+ if (*s=='.') depth++;
+ dbgPr("Changed var: %s (%d)\n",ch->name,depth);
+ if (depth==0 && (!ch->in_scope || ch->new_type))
+ {
+ if (ch->new_type)
+ printf("It happened!!! type changed for gdb var\n");
+ dbgPr("Disabling var\n");
+ tree->undefine();
+ outOfScope=1;
+ updateCommands();
+ return;
+ }
+ nchanged+=tree->markChanged(ch->name,depth);
+ }
+ ch=ch->next;
+ }
+ if (nchanged)
+ theLBox->drawView();
+}
+
+static
+TDialog *createFormatInst()
+{
+ TSViewCol *col=new TSViewCol(__("Format"));
+
+ // EN: BDHNO
+ col->insert(xTSLeft,yTSUp,
+ TSLabelRadio(__("Format"),
+ __("~N~atural"),
+ __("~B~inary"),
+ __("~D~ecimal"),
+ __("~H~exadecimal"),
+ __("~O~ctal"),0));
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmFormatIns);
+ delete col;
+ return d;
+}
+
+int TInspector::format()
+{
+ if (!dbg || !focused || iStatus!=stOk)
+ return 0;
+ uint32 box=(uint32)focused->format;
+ if (execDialog(createFormatInst(),&box)==cmOK)
+ {
+ if (dbg->SetFormatgVar(focused,(enum mi_gvar_fmt)box))
+ {
+ focused->changed=1;
+ theLBox->drawView();
+ return 1;
+ }
+ ShowErrorInMsgBox();
+ }
+ return 0;
+}
+
+void TInspector::handleEvent(TEvent &event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmDbgInspect:
+ inspect();
+ break;
+ case cmExpand:
+ expand();
+ break;
+ case cmCollapse:
+ collapse();
+ break;
+ case cmRecycle:
+ recycle();
+ break;
+ case cmClose:
+ close();
+ break;
+ case cmModifyIns:
+ modify();
+ break;
+ case cmFormatIns:
+ format();
+ break;
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+ else if (event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmListItemFocused:
+ nFocused=((TListViewer *)event.message.infoPtr)->focused;
+ focused=tree->getItem(nFocused);
+ updateCommands();
+ break;
+ case cmVarChanged:
+ updateVars((mi_gvar_chg *)event.message.infoPtr);
+ break;
+ case cmDbgChgState:
+ if (!dbg || (dbg->GetState()==MIDebugger::disconnected ||
+ dbg->GetState()==MIDebugger::connected))
+ {
+ if (tree)
+ tree->disable();
+ outOfScope=1;
+ }
+ updateCommands(owner->current==this ? True : False);
+ return;
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+}
+
+void TInspector::inspect()
+{
+ char *e=tree->getExpression(nFocused);
+ dbgPr("Expression: %s\n",e);
+ OpenInspector(e);
+ free(e);
+}
+
+TInspector::TInspector(TPVarTree *p) :
+ TWindowInit(TInspector::initFrame),
+ TDialog(TRect(-1,-1,-1,-1),__("Inspector"))
+{
+ flags=wfMove | wfClose | wfGrow | wfZoom;
+ growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ outOfScope=0;
+
+ focused=NULL;
+ exp=tstate=NULL;
+ fake=NULL;
+ TSetEditorApp::setCmdState(cmDbgInspect,False);
+ TSetEditorApp::setCmdState(cmExpand,False);
+ TSetEditorApp::setCmdState(cmCollapse,False);
+
+ TSViewCol *col=new TSViewCol(this);
+ TRect r=GetDeskTopSize();
+
+ tree=p;
+ int hMax=r.b.y-r.a.y-3-2-2;
+ int wMax=(r.b.x-r.a.x)*8/10, w;
+ int h=hMax;
+ w=wMax;
+
+ TSStringableListBox *lbox=new TSStringableListBox(w,h,tsslbVertical | tsslbHorizontal);
+ theLBox=(TStringableListBox *)(lbox->view);
+ theLBox->hScrollBar->setParams(0,0,5000,w,1);
+ theLBox->growMode=gfGrowHiX | gfGrowHiY;
+
+ col->insert(xTSLeft,yTSUp,MakeVeGroup(0,lbox,CreateStatus(),0));
+
+ col->doItCenter(hcInspector);
+ delete col;
+
+ cInspectors++;
+}
+
+TInspector::TInspector(const TRect &aR, char *anExp, char *aTState) :
+ TWindowInit(TInspector::initFrame),
+ TDialog(aR,__("Inspector"))
+{
+ flags=wfMove | wfClose | wfGrow | wfZoom;
+ growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+
+ outOfScope=1;
+ focused=NULL;
+ tree=NULL;
+ exp=anExp;
+ tstate=aTState;
+
+ TSViewCol *col=new TSViewCol(this);
+
+ int w=aR.b.x-aR.a.x-4;
+ int h=aR.b.y-aR.a.y-3;
+
+ TSStringableListBox *lbox=new TSStringableListBox(w,h,tsslbVertical | tsslbHorizontal);
+ theLBox=(TStringableListBox *)(lbox->view);
+ theLBox->hScrollBar->setParams(0,0,5000,w,1);
+ theLBox->growMode=gfGrowHiX | gfGrowHiY;
+ fake=new TPVarTree(anExp,True);
+ theLBox->newList(fake);
+
+ col->insert(xTSLeft,yTSUp,MakeVeGroup(0,lbox,CreateStatus(),0));
+
+ col->doIt();
+ helpCtx=hcInspector;
+ delete col;
+
+ updateCommands();
+
+ cInspectors++;
+}
+
+TSNoStaticText *TInspector::CreateStatus()
+{
+ const char *m1=TVIntl::getText(cInspOk,icInspOk);
+ const char *m2=TVIntl::getText(cInspWait,icInspWait);
+ const char *m3=TVIntl::getText(cInspNoScope,icInspNoScope);
+ int l1=strlen(m1), l2=strlen(m2), l=l1;
+ if (l2>l) l=l2;
+ l2=strlen(m3);
+ if (l2>l) l=l2;
+
+ char b[l+1];
+ memset(b,' ',l);
+ b[l]=0;
+ TSNoStaticText *st=new TSNoStaticText(b);
+ status=(TNoStaticText *)st->view;
+ status->growMode=gfGrowHiY | gfGrowLoY;
+ iStatus=stNone;
+
+ return st;
+}
+
+class TDskInspector : public TDskWin
+{
+public:
+ TDskInspector(TInspector *w);
+ ~TDskInspector() {};
+
+ char *GetText(char *dest, short maxLen);
+ void saveData(opstream &os);
+ static void readData(ipstream &is, char version);
+
+protected:
+ TInspector *inspector;
+};
+
+TDskInspector::TDskInspector(TInspector *w)
+{
+ view=inspector=w;
+ type=dktDbgIns;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=0;
+ ZOrder=-1;
+}
+
+char *TDskInspector::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" Inspector %s"),inspector->getVar());
+ return dest;
+}
+
+void TDskInspector::saveData(opstream &os)
+{
+ unsigned wS=TScreen::getCols();
+ unsigned hS=TScreen::getRows();
+ TRect size=inspector->getBounds();
+ // size
+ SaveExpandedRect(os,size,wS,hS);
+ // z-order
+ os << (int)(TProgram::deskTop->indexOf(view));
+ // expression
+ os.writeString(inspector->getVar());
+ // tree state
+ char *state=inspector->getTreeState();
+ os.writeString(state);
+ delete[] state;
+ // zoomRect
+ SaveExpandedRect(os,inspector->zoomRect,wS,hS);
+}
+
+void TDskInspector::readData(ipstream &is, char version)
+{
+ unsigned wS=TScreen::getCols();
+ unsigned hS=TScreen::getRows();
+ TRect size;
+
+ // size
+ ReadExpandedRect(is,size,wS,hS);
+ // z-order
+ int ZOrder;
+ is >> ZOrder;
+ // expression
+ char *exp=is.readString();
+ // tree state
+ char *tstate=is.readString();
+
+ // Recreate it
+ TInspector *d=new TInspector(size,exp,tstate);
+ // zoomRect
+ if (version>1)
+ ReadExpandedRect(is,d->zoomRect,wS,hS);
+ TDskInspector *win=new TDskInspector(d);
+ win->ZOrder=ZOrder;
+ AddNonEditorToHelper(win);
+ InsertInOrder(TProgram::deskTop,win);
+}
+
+static
+void OpenInspector(const char *var)
+{
+ TPVarTree *p=new TPVarTree(var);
+
+ if (p && p->isOK())
+ {
+ TInspector *d=new TInspector(p);
+
+ TStringableListBoxRec box;
+ box.items=p;
+ box.selection=0;
+ d->setData(&box);
+
+ TDskInspector *win=new TDskInspector(d);
+ AddAndInsertDskWin(win);
+ }
+ else
+ ShowErrorInMsgBox();
+}
+
+void TSetEditorApp::DebugInspector(char *startVal)
+{
+ char exp[widthWtExp];
+ if (startVal)
+ {
+ strncpyZ(exp,startVal,widthWtExp);
+ delete[] startVal;
+ }
+ else
+ exp[0]=0;
+ if (execDialog(createEditExp(__("Inspect variable")),exp)==cmOK)
+ OpenInspector(exp);
+}
+
+/*****************************************************************************
+ End of TInspector class and functionality
+*****************************************************************************/
+
+/*****************************************************************************
+ TBreakpoints class
+
+ RHIDE dialog to be compatible:
+ E/D file | line/function | Condition | Count
+ Buttons: ~M~odify ~N~ew" ~D~elete ~E~nable D~i~sable ~S~how
+
+*****************************************************************************/
+
+mi_bkpt *TBreakpoints::first=NULL;
+mi_bkpt *TBreakpoints::last=NULL;
+int TBreakpoints::count=0;
+stTVIntl *TBreakpoints::icNone=NULL;
+static TBreakpoints bkpts;
+
+
+mi_bkpt *TBreakpoints::getItem(int num)
+{
+ mi_bkpt *p=first;
+ while (num && p)
+ {
+ num--;
+ p=p->next;
+ }
+ return num ? NULL : p;
+}
+
+const int wThread=5, wTimes=5, wFormat=28;
+const char *eThread=" * ";
+const char *eTimes =" - ";
+
+static inline
+void ComputeBreakW(int &wWhere, int &wCond, int maxLen)
+{
+ int rest;
+
+ rest=maxLen-(7+wThread+wTimes);
+ wWhere=rest*60/100;
+ wCond=rest-wWhere;
+ // Add EOS
+ wWhere++; wCond++;
+}
+
+void TBreakpoints::getText(char *dest, unsigned item, int maxLen)
+{
+ mi_bkpt *p=getItem(item);
+ if (!p)
+ {
+ *dest=0;
+ dbgPr("Oops! item %d gives NULL\n",item);
+ return;
+ }
+ int wWhere, wCond;
+ ComputeBreakW(wWhere,wCond,maxLen);
+
+ AllocLocalStr(where,wWhere);
+ switch (p->mode)
+ {
+ case m_file_line:
+ CLY_snprintf(where,wWhere,"%s:%d",p->file,p->line);
+ break;
+ case m_function:
+ CLY_snprintf(where,wWhere,"%s",p->func);
+ break;
+ case m_file_function:
+ CLY_snprintf(where,wWhere,"%s:%s",p->file,p->func);
+ break;
+ case m_address:
+ CLY_snprintf(where,wWhere,"%p",p->addr);
+ break;
+ }
+
+ char format[wFormat];
+ CLY_snprintf(format,wFormat,"%%%dd",wThread);
+ char thread[wThread+1];
+ if (p->thread>=0)
+ CLY_snprintf(thread,wThread+1,format,p->thread);
+ else
+ strcpy(thread,eThread);
+
+ CLY_snprintf(format,wFormat,"%%%dd",wTimes);
+ char times[wTimes+1];
+ if (p->ignore>0)
+ CLY_snprintf(times,wTimes+1,format,p->ignore);
+ else
+ strcpy(times,eTimes);
+
+ CLY_snprintf(format,wFormat,"%%-%ds",wCond-1);
+ AllocLocalStr(cond,wCond);
+ CLY_snprintf(cond,wCond,format,p->cond ? p->cond :
+ TVIntl::getText(__("None"),icNone));
+
+ CLY_snprintf(format,wFormat,"%%c|%%-%ds|%%s|%%s|%%s",wWhere-1);
+ CLY_snprintf(dest,maxLen,format,p->enabled ? '*' : ' ',where,cond,times,
+ thread);
+}
+
+void TBreakpoints::add(mi_bkpt *b)
+{
+ if (first)
+ last->next=b;
+ else
+ first=b;
+ last=b;
+ // Solve the absolute name and cache it.
+ updateAbs(b);
+ count++;
+}
+
+void TBreakpoints::updateAbs(mi_bkpt *b)
+{
+ if (!b->file)
+ {
+ dbgPr("Breakpoint without file name\n");
+ return;
+ }
+ free(b->file_abs);
+ char *file=SolveFileName(b->file);
+ b->file_abs=strdup(file ? file : b->file);
+}
+
+void TBreakpoints::refreshBinRef()
+{
+ mi_bkpt *p=first;
+ while (p)
+ {
+ updateAbs(p);
+ p=p->next;
+ }
+}
+
+mi_bkpt *TBreakpoints::search(const char *source, int line)
+{
+ mi_bkpt *b=first;
+
+ while (b)
+ {
+ if (strcmp(b->file_abs,source)==0 && b->line==line)
+ return b;
+ b=b->next;
+ }
+ return b;
+}
+
+void TBreakpoints::remove(mi_bkpt *b)
+{
+ mi_bkpt *e=first, *ant=NULL;
+
+ while (e)
+ {
+ if (e==b)
+ {
+ if (ant)
+ ant->next=b->next;
+ else
+ first=b->next;
+ if (!b->next)
+ last=ant;
+ b->next=NULL;
+ mi_free_bkpt(b);
+ count--;
+ return;
+ }
+ ant=e;
+ e=e->next;
+ }
+ dbgPr("Oops! can't find bkp TBreakpoints::remove\n");
+}
+
+void TBreakpoints::replace(mi_bkpt *old, mi_bkpt *b)
+{
+ mi_bkpt *e=first, *ant=NULL;
+
+ while (e)
+ {
+ if (e==old)
+ {
+ if (ant)
+ ant->next=b;
+ else
+ first=b;
+ if (!old->next)
+ last=b;
+ b->next=old->next;
+ old->next=NULL;
+ mi_free_bkpt(old);
+ return;
+ }
+ ant=e;
+ e=e->next;
+ }
+ dbgPr("Oops! can't find bkp TBreakpoints::replace\n");
+}
+
+int TBreakpoints::set(const char *source, int line)
+{
+ mi_bkpt *b=dbg->Breakpoint(source,line);
+ if (b)
+ {
+ add(b);
+ return 1;
+ }
+ DebugMsgSetError();
+ return 0;
+}
+
+int TBreakpoints::unset(const char *source, int line)
+{
+ mi_bkpt *b=search(source,line);
+ if (!b)
+ {
+ dbgPr("Oops! where is bkpt %s:%d\n",source,line);
+ return 0;
+ }
+ if (!dbg->BreakDelete(b))
+ {
+ DebugMsgSetError();
+ return 0;
+ }
+ remove(b);
+ return 1;
+}
+
+void TBreakpoints::refreshIgnore()
+{// Only before running
+ if (!dbg || dbg->GetState()!=MIDebugger::target_specified)
+ return;
+ if (DEBUG_BREAKPOINTS_UPDATE)
+ dbgPr("TBreakpoints::refreshIgnore: Refreshing ignore field\n");
+ mi_bkpt *b=first;
+ while (b)
+ {
+ if (b->enabled && b->ignore>0)
+ dbg->BreakAfter(b);
+ b=b->next;
+ }
+}
+
+void TBreakpoints::apply()
+{
+ if (!dbg)
+ return;
+ if (DEBUG_BREAKPOINTS_UPDATE)
+ dbgPr("TBreakpoints::apply: Deleting all splines\n");
+ SpLinesDeleteForId(idsplBreak); // Ensure no previous bkpt survived ;-)
+ mi_bkpt *b=first, *aux;
+ // Disconnect current list, we will be creating a new one.
+ first=last=NULL;
+ count=0;
+ int disabledBkpts=0, killIt, applied=0;
+
+ while (b)
+ {
+ killIt=0;
+ if (b->enabled) // Avoid disabled ones.
+ {
+ mi_bkpt *nb=dbg->Breakpoint(b);
+ if (!nb)
+ {
+ b->enabled=0;
+ add(b);
+ disabledBkpts++;
+ }
+ else
+ {
+ add(nb);
+ killIt=1;
+ SpLinesAdd(nb->file_abs,nb->line,idsplBreak,False);
+ applied++;
+ }
+ }
+ else
+ // Pass unchanged
+ add(b);
+ aux=b->next;
+ if (killIt)
+ {
+ b->next=NULL;
+ mi_free_bkpt(b);
+ }
+ b=aux;
+ }
+ if (applied)
+ SpLinesUpdate();
+ if (disabledBkpts)
+ messageBox(mfWarning | mfOKButton,
+ __("%d breakpoints failed to apply, they are disabled now."),
+ disabledBkpts);
+}
+
+void TBreakpoints::save(opstream &os)
+{// Save them
+ os << bkptsVersion << (int32)count;
+ dbgPr("%d Breakpoints\n",count);
+ mi_bkpt *p=first;
+ while (p)
+ {
+ os.writeString(p->file);
+ os.writeString(p->cond);
+ os << (int32)p->line << p->enabled << (int32)p->ignore
+ << (char)p->type << (char)p->disp;
+ // v2
+ os.writeString(p->func);
+ os.write64(CLY_PointerToUI64(p->addr));
+ os << (char)p->mode << (int32)p->thread;
+ p=p->next;
+ }
+}
+
+static
+char *ReadStringC(ipstream &is)
+{
+ char *aux=is.readString(), *str;
+ if (!aux)
+ return NULL;
+ str=strdup(aux);
+ delete[] aux;
+ return str;
+}
+
+inline static
+int ReadInt32(ipstream &is)
+{
+ int32 aux;
+ is >> aux;
+ return aux;
+}
+
+inline static
+char ReadChar(ipstream &is)
+{
+ char aux;
+ is >> aux;
+ return aux;
+}
+
+void TBreakpoints::load(ipstream &is)
+{
+ char version;
+ int32 cnt;
+
+ is >> version >> cnt;
+ if (first)
+ dbgPr("Oops! loading breakpoints when we already have!!!\n");
+ dbgPr("%d breakpoints\n",cnt);
+ for (int32 i=0; i<cnt; i++)
+ {
+ mi_bkpt *b=mi_alloc_bkpt();
+ if (b)
+ {
+ b->file=ReadStringC(is);
+ b->cond=ReadStringC(is);
+ b->line=ReadInt32(is);
+ is >> b->enabled;
+ b->ignore=ReadInt32(is);
+ b->type=(enum mi_bkp_type)ReadChar(is);
+ b->disp=(enum mi_bkp_disp)ReadChar(is);
+ if (version>=2)
+ {// v2
+ b->func=ReadStringC(is);
+ b->addr=CLY_UI64ToPointer(is.read64());
+ b->mode=(enum mi_bkp_mode)ReadChar(is);
+ b->thread=ReadInt32(is);
+ }
+ if (b->file)
+ {
+ add(b);
+ SpLinesAdd(b->file_abs,b->line,idsplBreak,False);
+ }
+ }
+ }
+ if (count)
+ SpLinesUpdate();
+}
+
+void TBreakpoints::releaseAll()
+{
+ mi_free_bkpt(first);
+ first=last=NULL;
+ count=0;
+}
+
+TBreakpoints::~TBreakpoints()
+{
+ releaseAll();
+ TVIntl::freeSt(icNone);
+}
+
+struct stBrkEdit
+{
+ uint32 type;
+ char filename[wFilename],
+ function[wFunction],
+ line[wLine],
+ address[wAddress],
+ condition[wCondition],
+ count[wCount],
+ thread[wThreadB];
+ uint32 enabled;
+ uint32 hw;
+};
+
+
+class TDiagBrk : public TDialog
+{
+public:
+ TDiagBrk(const TRect &aR);
+
+ virtual void handleEvent(TEvent &event);
+
+ int Modify();
+ int Add();
+ int Delete();
+ int Enable();
+ int Disable();
+ int Go();
+ static void UpdateCommadsForCount(int c);
+ static int Delete(int which);
+
+ static const char *file;
+ static int line;
+
+protected:
+ int focusedB;
+ TStringableListBox *theLBox;
+ static TSView *sviews[4];
+ static uint32 vmasks[4];
+
+ TDialog *createEdit(const char *title);
+ static mi_bkpt *CreateBktFromBox(stBrkEdit &box);
+ static int DeleteFromGDBandSpLines(mi_bkpt *b);
+ static int ApplyBkt(mi_bkpt *nb, mi_bkpt *old, int enabled);
+ void UpdateCommandsFocused();
+};
+
+const char *TDiagBrk::file=NULL;
+// file,func,line,addr:
+TSView *TDiagBrk::sviews[4];
+uint32 TDiagBrk::vmasks[4]={0xA,0x4,0xC,0x1};
+int TDiagBrk::line=0;
+
+void TDiagBrk::UpdateCommadsForCount(int c)
+{
+ TSetEditorApp::setCmdState(cmBkModify,c ? True : False);
+ TSetEditorApp::setCmdState(cmBkDel,c ? True : False);
+ TSetEditorApp::setCmdState(cmBkGo,c ? True : False);
+}
+
+TDialog *TDiagBrk::createEdit(const char *title)
+{
+ TSViewCol *col=new TSViewCol(title);
+
+ // EN: CDEFHILNOSTUW
+ // ES: ABCDFHILORSUV
+ TSLabel *type=TSLabelRadio(__("Type"),
+ __("File/L~i~ne"),
+ __("Fu~n~ction"),
+ __("File/Functi~o~n"),
+ __("~A~ddress"),0);
+ // Same width
+ TSHzLabel *file=new TSHzLabel(__(" ~F~ilename"),
+ new TSInputLine(wFilename,1,hID_DbgBkFilename,wVisible));
+ // Same width
+ TSHzLabel *func=new TSHzLabel(__(" F~u~nction"),
+ new TSInputLine(wFunction,1,hID_DbgBkFunction,wVisible));
+ // Same width
+ TSHzLabel *line=new TSHzLabel(__(" ~L~ine"),
+ new TSInputLine(wLine,1,hID_DbgBkLine,wVisible));
+ // Same width
+ TSHzLabel *addr=new TSHzLabel(__(" Addre~s~s"),
+ new TSInputLine(wAddress,1,hID_DbgBkAddress,wVisible));
+ // Same width
+ TSHzLabel *cond=new TSHzLabel(__("Con~d~ition"),
+ new TSInputLine(wCondition,1,hID_DbgBkCondition,wVisible));
+ // Same width
+ TSHzLabel *coun=new TSHzLabel(__(" Coun~t~"),
+ new TSInputLine(wCount,1,hID_DbgBkCount,(wVisible-wLabels)/2));
+ TSHzLabel *thre=new TSHzLabel(__(" T~h~read"),
+ new TSInputLine(wThreadB,1,hID_DbgBkThread,(wVisible-wLabels)/2));
+ TSHzGroup *c_t=MakeHzGroup(coun,thre,0);
+ TSCheckBoxes *enable=new TSCheckBoxes(new TSItem(__("~E~nabled"),0));
+ TSCheckBoxes *hw=new TSCheckBoxes(new TSItem(__("Hard~w~are assisted"),0));
+
+ TSVeGroup *all=MakeVeGroup(0,type,file,func,line,addr,cond,c_t,enable,hw,0);
+ all->makeSameW();
+
+ // The dependencies:
+ sviews[3]=file;
+ sviews[2]=func;
+ sviews[1]=line;
+ sviews[0]=addr;
+ ((TSRadioButtons *)type->linked)->setEnableMask(vmasks,sviews,4);
+
+ col->insert(xTSLeft,yTSUp,all);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcEditBkpt);
+ delete col;
+ return d;
+}
+
+static
+void ShowErrorInMsgBox()
+{
+ int iErr=DebugGetErrorSt();
+ if (iErr==MI_OK)
+ {
+ messageBox(__("Sorry, you can't perform this operation right now"),
+ mfOKButton | mfError);
+ return;
+ }
+ char *cErr=TVIntl::getTextNew(MIDebugger::GetErrorStr());
+
+ if (iErr==MI_FROM_GDB)
+ messageBox(mfOKButton | mfError,
+ __("Error: %s (%d) [%s]"),cErr,iErr,MIDebugger::GetGDBError());
+ else
+ messageBox(mfOKButton | mfError,__("Error: %s (%d)"),cErr,iErr);
+ delete[] cErr;
+}
+
+mi_bkpt *TDiagBrk::CreateBktFromBox(stBrkEdit &box)
+{
+ // Create an structure to specify the new one
+ mi_bkpt *nb=mi_alloc_bkpt();
+ nb->mode=(enum mi_bkp_mode)box.type;
+ char *end;
+ switch (box.type)
+ {
+ case m_file_line:
+ nb->file=strdup(box.filename);
+ nb->line=atoi(box.line);
+ break;
+ case m_function:
+ nb->func=strdup(box.function);
+ break;
+ case m_file_function:
+ nb->file=strdup(box.filename);
+ nb->func=strdup(box.function);
+ break;
+ case m_address:
+ nb->addr=(void *)strtol(box.address,&end,0);
+ break;
+ }
+ if (!IsEmpty(box.count))
+ nb->ignore=atoi(box.count);
+ if (!IsEmpty(box.thread))
+ nb->thread=atoi(box.thread);
+ if (box.hw)
+ nb->type=t_hw;
+ if (!IsEmpty(box.condition))
+ nb->cond=strdup(box.condition);
+ TBreakpoints::updateAbs(nb);
+ nb->enabled=1;
+
+ return nb;
+}
+
+int TDiagBrk::DeleteFromGDBandSpLines(mi_bkpt *p)
+{
+ if (p->enabled)
+ {
+ if (!dbg->BreakDelete(p))
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ // Update splines
+ if (p->file_abs)
+ SpLinesDeleteForId(idsplBreak,p->file_abs,True,p->line);
+ }
+ return 1;
+}
+
+int TDiagBrk::ApplyBkt(mi_bkpt *nb, mi_bkpt *old, int enabled)
+{
+ mi_bkpt *nb_gdb=dbg->Breakpoint(nb);
+ if (nb!=old)
+ mi_free_bkpt(nb);
+ if (!nb_gdb)
+ {
+ ShowErrorInMsgBox();
+ // Recover the old breakpoint
+ if (old->enabled)
+ {
+ nb_gdb=dbg->Breakpoint(old);
+ if (nb_gdb)
+ {
+ bkpts.updateAbs(nb_gdb);
+ bkpts.replace(old,nb_gdb);
+ if (nb_gdb->file_abs)
+ SpLinesAdd(nb_gdb->file_abs,nb_gdb->line,idsplBreak,True);
+ }
+ }
+ return 0;
+ }
+ // Ok, we succeed to apply the breakpoint.
+ // Update our list:
+ nb_gdb->enabled=enabled;
+ bkpts.updateAbs(nb_gdb);
+ bkpts.replace(old,nb_gdb);
+ // If this breakpoint is disabled remove it.
+ if (!nb_gdb->enabled)
+ dbg->BreakDelete(nb_gdb);
+ else
+ if (nb_gdb->file_abs)
+ SpLinesAdd(nb_gdb->file_abs,nb_gdb->line,idsplBreak,True);
+
+ return 1;
+}
+
+int TDiagBrk::Modify()
+{
+ TDialog *d=createEdit(__("Modify breakpoint"));
+
+ stBrkEdit box;
+ mi_bkpt *p=bkpts.getItem(focusedB);
+
+ box.type=p->mode;
+ #define C(a,b,c) if (a) strncpyZ(b,a,c); else b[0]=0;
+ C(p->file,box.filename,wFilename);
+ C(p->func,box.function,wFunction);
+ C(p->cond,box.condition,wCondition);
+ #undef C
+ CLY_snprintf(box.line,wLine,"%d",p->line);
+ CLY_snprintf(box.address,wAddress,"%p",p->addr);
+ if (p->ignore>0)
+ CLY_snprintf(box.count,wCount,"%d",p->ignore);
+ else
+ box.count[0]=0;
+ if (p->thread>=0)
+ CLY_snprintf(box.thread,wThreadB,"%d",p->thread);
+ else
+ box.thread[0]=0;
+ box.enabled=p->enabled ? 1 : 0;
+ box.hw=p->type==t_breakpoint ? 0 : 1;
+
+ if (execDialog(d,&box)==cmOK)
+ {// Note: We know gdb is there. But this is complex.
+ // Delete the current breakpoint
+ if (!DeleteFromGDBandSpLines(p))
+ return 0;
+ // Create a structure to specify the new one
+ mi_bkpt *nb=CreateBktFromBox(box);
+ // Try to apply it
+ return ApplyBkt(nb,p,box.enabled);
+ }
+ return 0;
+}
+
+int TDiagBrk::Add()
+{
+ TDialog *d=createEdit(__("Add breakpoint"));
+
+ stBrkEdit box;
+ memset(&box,0,sizeof(box));
+ box.enabled=1;
+
+ if (execDialog(d,&box)==cmOK)
+ {// Note: We know gdb is there.
+ // Create a structure to specify the new one
+ mi_bkpt *nb=CreateBktFromBox(box);
+ // Try to apply it
+ mi_bkpt *nb_gdb=dbg->Breakpoint(nb);
+ mi_free_bkpt(nb);
+ if (!nb_gdb)
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ // Ok, we succeed to apply the breakpoint.
+ // Update our list:
+ nb_gdb->enabled=box.enabled;
+ bkpts.add(nb_gdb);
+ // If this breakpoint is disabled remove it.
+ if (!nb_gdb->enabled)
+ dbg->BreakDelete(nb_gdb);
+ else
+ if (nb_gdb->file_abs)
+ SpLinesAdd(nb_gdb->file_abs,nb_gdb->line,idsplBreak,True);
+ return 1;
+ }
+ return 0;
+}
+
+int TDiagBrk::Delete(int which)
+{
+ mi_bkpt *p=bkpts.getItem(which);
+ // Delete the current breakpoint
+ if (!DeleteFromGDBandSpLines(p))
+ return 0;
+ bkpts.remove(p);
+ return 1;
+}
+
+int TDiagBrk::Delete()
+{
+ return Delete(focusedB);
+}
+
+int TDiagBrk::Enable()
+{
+ mi_bkpt *p=bkpts.getItem(focusedB);
+ if (p->enabled)
+ return 0;
+ p->enabled=1;
+
+ return ApplyBkt(p,p,1);
+}
+
+int TDiagBrk::Disable()
+{
+ mi_bkpt *p=bkpts.getItem(focusedB);
+ if (!p->enabled)
+ return 0;
+
+ if (DeleteFromGDBandSpLines(p))
+ {
+ p->enabled=0;
+ return 1;
+ }
+ return 0;
+}
+
+void TDiagBrk::UpdateCommandsFocused()
+{
+ mi_bkpt *p=bkpts.getItem(focusedB);
+ TSetEditorApp::setCmdState(cmBkEnable,!p || p->enabled ? False : True);
+ TSetEditorApp::setCmdState(cmBkDisable,!p || !p->enabled ? False : True);
+}
+int TDiagBrk::Go()
+{
+ mi_bkpt *p=bkpts.getItem(focusedB);
+ if (p->file_abs)
+ {
+ file=p->file_abs;
+ line=p->line;
+ return 1;
+ }
+
+ return 0;
+}
+
+void TDiagBrk::handleEvent(TEvent &event)
+{
+ int range=0, drawV=0;
+
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {// Just in case
+ case cmBkModify:
+ case cmBkDel:
+ case cmBkEnable:
+ case cmBkDisable:
+ case cmBkGo:
+ if (!bkpts.GetCount())
+ {
+ clearEvent(event);
+ return;
+ }
+ }
+ switch (event.message.command)
+ {
+ case cmBkModify:
+ if (Modify())
+ drawV=1;
+ break;
+ case cmBkAdd:
+ if (Add())
+ drawV=range=1;
+ break;
+ case cmBkDel:
+ if (Delete())
+ drawV=range=1;
+ break;
+ case cmBkEnable:
+ if (Enable())
+ drawV=1;
+ break;
+ case cmBkDisable:
+ if (Disable())
+ drawV=1;
+ break;
+ case cmBkGo:
+ if (Go())
+ endModal(cmBkGo);
+ break;
+ default:
+ return;
+ }
+ if (range)
+ {
+ int c=bkpts.GetCount();
+ UpdateCommadsForCount(c);
+ theLBox->setRange(c);
+ }
+ if (drawV)
+ {
+ theLBox->drawView();
+ UpdateCommandsFocused();
+ }
+ clearEvent(event);
+ }
+ else if (event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmListItemFocused:
+ focusedB=((TListViewer *)event.message.infoPtr)->focused;
+ UpdateCommandsFocused();
+ break;
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+}
+
+TDiagBrk::TDiagBrk(const TRect &r) :
+ TWindowInit(TDiagBrk::initFrame),
+ TDialog(r,__("Breakpoints"))
+{
+ flags=wfMove | wfClose;
+ growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ focusedB=0;
+
+ TSetEditorApp::setCmdState(cmBkEnable,False);
+ TSetEditorApp::setCmdState(cmBkDisable,False);
+
+ TSViewCol *col=new TSViewCol(this);
+
+ int wWhere, wCond;
+ int width=r.b.x-r.a.x-4;
+ ComputeBreakW(wWhere,wCond,width);
+ char format[wFormat];
+ CLY_snprintf(format,wFormat," %%s %%-%ds %%-%ds %%-%ds %%-%ds",wWhere-1,
+ wCond-1,wTimes,wThread);
+ AllocLocalStr(cols,width+1);
+
+ // The following is quite annoying because we construct the format from its
+ // parts.
+ // Keep 1 char
+ char *cE=TVIntl::getTextNew(__("E"));
+ char *cWhere=TVIntl::getTextNew(__("Where"));
+ char *cCond=TVIntl::getTextNew(__("Condition"));
+ // Keep 5 chars
+ char *cCount=TVIntl::getTextNew(__("Count"));
+ // Keep 5 chars
+ char *cThread=TVIntl::getTextNew(__("Thre."));
+ CLY_snprintf(cols,width+1,format,cE,cWhere,cCond,cCount,cThread);
+ delete[] cE;
+ delete[] cWhere;
+ delete[] cCond;
+ delete[] cCount;
+ delete[] cThread;
+
+ int height=r.b.y-r.a.y-3;
+ TSStringableListBox *lbox=new TSStringableListBox(width,height,tsslbVertical);
+ theLBox=(TStringableListBox *)(lbox->view);
+ TSLabel *lb=new TSLabel(cols,lbox);
+
+ col->insert(xTSLeft,yTSUp,lb);
+ // EN: DEIMNSX
+ // ES: BDHIMNS
+ col->insert(xTSCenter,yTSDown,MakeHzGroup(
+ new TSButton(__("E~x~it") ,cmOK,bfDefault),
+ new TSButton(__("~M~odify") ,cmBkModify),
+ new TSButton(__("~N~ew") ,cmBkAdd),
+ new TSButton(__("~D~elete") ,cmBkDel),
+ new TSButton(__("~E~nable") ,cmBkEnable),
+ new TSButton(__("D~i~sable"),cmBkDisable),
+ new TSButton(__("~S~how") ,cmBkGo),0));
+
+ col->doItCenter(hcBkptDialog);
+ delete col;
+}
+
+void TSetEditorApp::DebugEditBreakPts()
+{
+ // Currently we allow editing breakpoints only if we can get feadback from
+ // gdb. I think its possible to avoid it, but I don't see the point and
+ // the consequences can be quite confusing.
+ if (!DebugCheckStopped())
+ return;
+
+ TRect r=GetDeskTopSize();
+ TDiagBrk *d=new TDiagBrk(TRect(0,0,r.b.x,r.b.y-3));
+ TDiagBrk::UpdateCommadsForCount(bkpts.GetCount());
+
+ TStringableListBoxRec box;
+ box.items=&bkpts;
+ box.selection=0;
+
+ if (execDialog(d,&box)==cmBkGo)
+ GotoFileLine(TDiagBrk::line,1,(char *)TDiagBrk::file);
+}
+
+static
+void MoveBreakpoint(const char *file, stSpLine *spline, void *data)
+{
+ mi_bkpt *b=bkpts.search(file,spline->oline+1);
+ if (b)
+ {
+ dbgPr("Moved %s:%d to line %d\n",file,spline->oline+1,spline->nline+1);
+ spline->oline=spline->nline;
+ b->line=spline->nline+1;
+ }
+ else
+ {
+ dbgPr("Don't know how to move %s:%d\n",file,spline->oline+1);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Transfers the SpLines movements to the list of breakpoints.
+
+***************************************************************************/
+
+void TSetEditorApp::DebugMoveBreakPts()
+{
+ struct stat st;
+
+ if (!edTestForFile(dOps.program,st))
+ return;
+ if (binMTime!=st.st_mtime)
+ {
+ binMTime=st.st_mtime;
+ SpLinesForEach(idsplBreak,MoveBreakpoint);
+ }
+}
+
+/*****************************************************************************
+ End of TBreakpoints class
+*****************************************************************************/
+
+/*****************************************************************************
+ TWatchpoints class
+*****************************************************************************/
+
+mi_wp *TWatchpoints::first=NULL;
+mi_wp *TWatchpoints::last=NULL;
+int TWatchpoints::count=0;
+static TWatchpoints wpts;
+
+
+mi_wp *TWatchpoints::getItem(int num)
+{
+ mi_wp *p=first;
+ while (num && p)
+ {
+ num--;
+ p=p->next;
+ }
+ return num ? NULL : p;
+}
+
+void TWatchpoints::getText(char *dest, unsigned item, int maxLen)
+{
+ mi_wp *p=getItem(item);
+ if (!p)
+ {
+ *dest=0;
+ dbgPr("Oops! item %d gives NULL\n",item);
+ return;
+ }
+ CLY_snprintf(dest,maxLen,"%c %c %c %s",p->enabled ? '*' : ' ',
+ (p->mode==wm_read || p->mode==wm_rw) ? 'R' : ' ',
+ (p->mode==wm_write|| p->mode==wm_rw) ? 'W' : ' ',
+ p->exp);
+}
+
+void TWatchpoints::add(mi_wp *b)
+{
+ if (first)
+ last->next=b;
+ else
+ first=b;
+ last=b;
+ count++;
+}
+
+void TWatchpoints::remove(mi_wp *b)
+{
+ mi_wp *e=first, *ant=NULL;
+
+ while (e)
+ {
+ if (e==b)
+ {
+ if (ant)
+ ant->next=b->next;
+ else
+ first=b->next;
+ if (!b->next)
+ last=ant;
+ b->next=NULL;
+ mi_free_wp(b);
+ count--;
+ return;
+ }
+ ant=e;
+ e=e->next;
+ }
+ dbgPr("Oops! can't find wp TWatchpoints::remove\n");
+}
+
+void TWatchpoints::replace(mi_wp *old, mi_wp *b)
+{
+ mi_wp *e=first, *ant=NULL;
+
+ while (e)
+ {
+ if (e==old)
+ {
+ if (ant)
+ ant->next=b;
+ else
+ first=b;
+ if (!old->next)
+ last=b;
+ b->next=old->next;
+ old->next=NULL;
+ mi_free_wp(old);
+ return;
+ }
+ ant=e;
+ e=e->next;
+ }
+ dbgPr("Oops! can't find wp TWatchpoints::replace\n");
+}
+
+void TWatchpoints::apply()
+{
+ if (!dbg)
+ return;
+ mi_wp *b=first, *aux;
+ // Disconnect current list, we will be creating a new one.
+ first=last=NULL;
+ count=0;
+ int disabledWpts=0, killIt, applied=0;
+
+ while (b)
+ {
+ killIt=0;
+ if (b->enabled) // Avoid disabled ones.
+ {
+ mi_wp *nb=dbg->Watchpoint(b->mode,b->exp);
+ if (!nb)
+ {
+ b->enabled=0;
+ add(b);
+ disabledWpts++;
+ }
+ else
+ {
+ add(nb);
+ killIt=1;
+ applied++;
+ }
+ }
+ else
+ // Pass unchanged
+ add(b);
+ aux=b->next;
+ if (killIt)
+ {
+ b->next=NULL;
+ mi_free_wp(b);
+ }
+ b=aux;
+ }
+ if (disabledWpts)
+ messageBox(mfWarning | mfOKButton,
+ __("%d watchpoints failed to apply, they are disabled now."),
+ disabledWpts);
+}
+
+void TWatchpoints::save(opstream &os)
+{// Save them
+ os << wptsVersion << (int32)count;
+ dbgPr("%d Watchpoints\n",count);
+ mi_wp *p=first;
+ while (p)
+ {
+ os << p->enabled << (char)p->mode;
+ os.writeString(p->exp);
+ p=p->next;
+ }
+}
+
+void TWatchpoints::load(ipstream &is, char version)
+{
+ int32 cnt;
+
+ is >> cnt;
+ if (first)
+ dbgPr("Oops! loading watchpoints when we already have!!!\n");
+ dbgPr("%d watchpoints\n",cnt);
+ for (int32 i=0; i<cnt; i++)
+ {
+ mi_wp *b=mi_alloc_wp();
+ if (b)
+ {
+ is >> b->enabled;
+ b->mode=(enum mi_wp_mode)ReadChar(is);
+ b->exp=ReadStringC(is);
+ add(b);
+ }
+ }
+}
+
+void TWatchpoints::releaseAll()
+{
+ mi_free_wp(first);
+ first=last=NULL;
+ count=0;
+}
+
+TWatchpoints::~TWatchpoints()
+{
+ releaseAll();
+}
+
+mi_wp *TWatchpoints::search(int num)
+{
+ mi_wp *b=first;
+
+ while (b)
+ {
+ if (b->number==num && b->enabled)
+ return b;
+ b=b->next;
+ }
+ return b;
+}
+
+int TWatchpoints::unset(int num)
+{
+ mi_wp *b=search(num);
+ if (!b)
+ {
+ dbgPr("Oops! where is wp %s\n",num);
+ return 0;
+ }
+ if (!dbg->WatchDelete(b))
+ {
+ DebugMsgSetError();
+ return 0;
+ }
+ b->enabled=0;
+ return 1;
+}
+
+const int wExp=256;
+
+struct stWpEdit
+{
+ char exp[wExp];
+ uint32 mode;
+ uint32 enabled;
+};
+
+
+class TDiagWp : public TDialog
+{
+public:
+ TDiagWp(const TRect &aR, const char *aStartVal);
+
+ virtual void handleEvent(TEvent &event);
+
+ int Modify();
+ int Add();
+ int Delete();
+ int Enable();
+ int Disable();
+ static void UpdateCommadsForCount(int c);
+ static int Delete(int which);
+
+protected:
+ int focusedB;
+ TStringableListBox *theLBox;
+ const char *startVal;
+
+ TDialog *createEdit(const char *title);
+ static mi_wp *CreateWpFromBox(stWpEdit &box);
+ static int DeleteFromGDB(mi_wp *b);
+ static int ApplyWp(mi_wp *nb, mi_wp *old, int enabled);
+ void UpdateCommandsFocused();
+};
+
+void TDiagWp::UpdateCommadsForCount(int c)
+{
+ TSetEditorApp::setCmdState(cmBkModify,c ? True : False);
+ TSetEditorApp::setCmdState(cmBkDel,c ? True : False);
+}
+
+TDialog *TDiagWp::createEdit(const char *title)
+{
+ TSViewCol *col=new TSViewCol(title);
+
+ // EN: AERTW
+ // ES: AELST
+ TSLabel *exp=new TSLabel(__("~E~xpression (escape \" characters: \\\")"),
+ new TSInputLinePiped(wExp,1,hID_DbgEvalModifyExp,wVisible));
+ TSLabel *type=TSLabelRadio(__("~T~ype"),
+ __("~W~rite"),
+ __("~R~ead"),
+ __("~A~ccess (read or write)"),0);
+ TSCheckBoxes *enable=new TSCheckBoxes(new TSItem(__("~E~nabled"),0));
+
+ TSVeGroup *all=MakeVeGroup(0,exp,type,enable,0);
+ all->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,all);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcEditWp);
+ delete col;
+ return d;
+}
+
+#define BoxMode2WpMode(a) ((enum mi_wp_mode)(a+1))
+
+mi_wp *TDiagWp::CreateWpFromBox(stWpEdit &box)
+{
+ // Create an structure to specify the new one
+ mi_wp *nb=mi_alloc_wp();
+ nb->mode=BoxMode2WpMode(box.mode);
+ nb->exp=strdup(box.exp);
+ nb->enabled=1;
+
+ return nb;
+}
+
+int TDiagWp::DeleteFromGDB(mi_wp *p)
+{
+ if (p->enabled)
+ {
+ if (!dbg->WatchDelete(p))
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int TDiagWp::Modify()
+{
+ TDialog *d=createEdit(__("Modify watchpoint"));
+
+ stWpEdit box;
+ mi_wp *p=wpts.getItem(focusedB);
+
+ box.mode=p->mode-1;
+ #define C(a,b,c) if (a) strncpyZ(b,a,c); else b[0]=0;
+ C(p->exp,box.exp,wExp);
+ #undef C
+ box.enabled=p->enabled ? 1 : 0;
+
+ if (execDialog(d,&box)==cmOK)
+ {// Note: We know gdb is there.
+ // Delete the current watchpoint
+ if (!DeleteFromGDB(p))
+ return 0;
+ if (box.enabled)
+ {// Apply it
+ mi_wp *nw_gdb=dbg->Watchpoint(BoxMode2WpMode(box.mode),box.exp);
+ if (!nw_gdb)
+ {
+ ShowErrorInMsgBox();
+ p->enabled=0;
+ return 0;
+ }
+ wpts.replace(p,nw_gdb);
+ }
+ else
+ {// Just modify it
+ free(p->exp);
+ p->exp=strdup(box.exp);
+ p->mode=BoxMode2WpMode(box.mode);
+ p->enabled=0;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+int TDiagWp::Add()
+{
+ TDialog *d=createEdit(__("Add watchpoint"));
+
+ stWpEdit box;
+ box.mode=0;
+ box.enabled=1;
+ if (startVal)
+ strncpyZ(box.exp,startVal,wExp);
+ else
+ box.exp[0]=0;
+
+ if (execDialog(d,&box)==cmOK)
+ {// Note: We know gdb is there.
+ if (box.enabled)
+ {// Apply it
+ mi_wp *nw_gdb=dbg->Watchpoint(BoxMode2WpMode(box.mode),box.exp);
+ if (!nw_gdb)
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ wpts.add(nw_gdb);
+ }
+ else
+ {// Just add to the list
+ wpts.add(CreateWpFromBox(box));
+ }
+ return 1;
+ }
+ return 0;
+}
+
+int TDiagWp::Delete(int which)
+{
+ mi_wp *p=wpts.getItem(which);
+ // Delete the current breakpoint
+ if (!DeleteFromGDB(p))
+ return 0;
+ wpts.remove(p);
+ return 1;
+}
+
+int TDiagWp::Delete()
+{
+ return Delete(focusedB);
+}
+
+int TDiagWp::Enable()
+{
+ mi_wp *p=wpts.getItem(focusedB);
+ if (p->enabled)
+ return 0;
+
+ mi_wp *nw_gdb=dbg->Watchpoint(p->mode,p->exp);
+ if (!nw_gdb)
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ wpts.replace(p,nw_gdb);
+
+ return 1;
+}
+
+int TDiagWp::Disable()
+{
+ mi_wp *p=wpts.getItem(focusedB);
+ if (!p->enabled)
+ return 0;
+
+ if (DeleteFromGDB(p))
+ {
+ p->enabled=0;
+ return 1;
+ }
+ return 0;
+}
+
+void TDiagWp::UpdateCommandsFocused()
+{
+ mi_wp *p=wpts.getItem(focusedB);
+ TSetEditorApp::setCmdState(cmBkEnable,!p || p->enabled ? False : True);
+ TSetEditorApp::setCmdState(cmBkDisable,!p || !p->enabled ? False : True);
+}
+
+void TDiagWp::handleEvent(TEvent &event)
+{
+ int range=0, drawV=0;
+
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {// Just in case
+ case cmBkModify:
+ case cmBkDel:
+ case cmBkEnable:
+ case cmBkDisable:
+ if (!wpts.GetCount())
+ {
+ clearEvent(event);
+ return;
+ }
+ }
+ switch (event.message.command)
+ {
+ case cmBkModify:
+ if (Modify())
+ drawV=1;
+ break;
+ case cmBkAdd:
+ if (Add())
+ drawV=range=1;
+ break;
+ case cmBkDel:
+ if (Delete())
+ drawV=range=1;
+ break;
+ case cmBkEnable:
+ if (Enable())
+ drawV=1;
+ break;
+ case cmBkDisable:
+ if (Disable())
+ drawV=1;
+ break;
+ default:
+ return;
+ }
+ if (range)
+ {
+ int c=wpts.GetCount();
+ UpdateCommadsForCount(c);
+ theLBox->setRange(c);
+ }
+ if (drawV)
+ {
+ theLBox->drawView();
+ UpdateCommandsFocused();
+ }
+ clearEvent(event);
+ }
+ else if (event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmListItemFocused:
+ focusedB=((TListViewer *)event.message.infoPtr)->focused;
+ UpdateCommandsFocused();
+ break;
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+}
+
+TDiagWp::TDiagWp(const TRect &r, const char *aStartVal) :
+ TWindowInit(TDiagWp::initFrame),
+ TDialog(r,__("Watchpoints"))
+{
+ flags=wfMove | wfClose;
+ growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ focusedB=0;
+ startVal=aStartVal;
+
+ TSetEditorApp::setCmdState(cmBkEnable,False);
+ TSetEditorApp::setCmdState(cmBkDisable,False);
+
+ TSViewCol *col=new TSViewCol(this);
+
+ int width=r.b.x-r.a.x-4;
+ int height=r.b.y-r.a.y-3;
+ TSStringableListBox *lbox=new TSStringableListBox(width,height,tsslbVertical);
+ theLBox=(TStringableListBox *)(lbox->view);
+ TSLabel *lb=new TSLabel(__(" E R/W Expression"),lbox);
+
+ col->insert(xTSLeft,yTSUp,lb);
+ // EN: DEIMNX
+ // ES: BDHMNS
+ col->insert(xTSCenter,yTSDown,MakeHzGroup(
+ new TSButton(__("E~x~it") ,cmOK,bfDefault),
+ new TSButton(__("~M~odify") ,cmBkModify),
+ new TSButton(__("~N~ew") ,cmBkAdd),
+ new TSButton(__("~D~elete") ,cmBkDel),
+ new TSButton(__("~E~nable") ,cmBkEnable),
+ new TSButton(__("D~i~sable"),cmBkDisable),0));
+
+ col->doItCenter(hcWpDialog);
+ delete col;
+}
+
+void TSetEditorApp::DebugEditWatchPts(char *startVal)
+{
+ // Currently we allow editing breakpoints only if we can get feadback from
+ // gdb. I think its possible to avoid it, but I don't see the point and
+ // the consequences can be quite confusing.
+ if (DebugCheckStopped())
+ {
+ TRect r=GetDeskTopSize();
+ TDiagWp *d=new TDiagWp(TRect(0,0,r.b.x,r.b.y-3),startVal);
+ TDiagWp::UpdateCommadsForCount(wpts.GetCount());
+
+ TStringableListBoxRec box;
+ box.items=&wpts;
+ box.selection=0;
+
+ execDialog(d,&box);
+ }
+ delete[] startVal;
+}
+
+/*****************************************************************************
+ End of TWatchpoints class
+*****************************************************************************/
+
+/*****************************************************************************
+ Data Window
+ From "DataWindow v0.10 Copyright (C) 1998 Laszlo Molnar" that was
+contributed to RHIDE.
+*****************************************************************************/
+
+/*
+ Palette:
+ 01 Normal text (active)
+ 02 Normal text (not active)
+ 03 Focused text
+ 04 Selected text
+ 05 Changed test
+ 06 reserved
+*/
+
+const uchar stNonAccess=1, stEdited=2, stChanged=4;
+const int addrLen=10; // "12345678: "
+
+// A little indicator: show endian mode, radix etc.
+class TDIndicator: public TIndicator
+{
+public:
+ TDIndicator(const TRect & bounds);
+ virtual TPalette &getPalette() const;
+
+ enum IndiType { iChanged=1, iEndian, iRadix, iAutofollow, iBaseAddress };
+ virtual void draw();
+ virtual void changeState(IndiType, int);
+ // Some wrappers to make things more clear
+ void setEndian(uchar endian)
+ {
+ changeState(iEndian,"eE"[endian & 1]);
+ }
+ void setRadix(uchar radix)
+ {
+ changeState(iRadix,"XD"[radix & 1]);
+ }
+ void setAutofollow(uchar autoFollow)
+ {
+ changeState(iAutofollow," A"[autoFollow & 1]);
+ }
+ void setBaseAddress(ulong baseAddress)
+ {
+ changeState(iBaseAddress,baseAddress ? 'B' : ' ');
+ }
+
+protected:
+ char thestate[10];
+};
+
+const int taddNone=-1, taddNewValue=0, taddFrom=1, taddTo=2, taddExp=3,
+ taddLength=4, taddValue=5, taddChangeOrig=0x100;
+const ulong maxBlockLen=0x100000, warnBlockLen=0x20000;
+
+class TDataViewer: public TView
+{
+public:
+ TDataViewer(const TRect &bounds, TScrollBar *aVScrollBar,
+ const char *addr_txt, TDIndicator *aIndi);
+ ~TDataViewer();
+ virtual TPalette &getPalette() const;
+ virtual void changeBounds(const TRect &bounds);
+ virtual void setState(ushort aState, Boolean enable);
+ virtual void draw();
+ virtual void handleEvent(TEvent & event);
+ void update(unsigned long address, Boolean external=False);
+ int getLine(char *buf, char *cols, int row);
+ void cursorHoriz(int);
+ void adjustWindow();
+ unsigned char *curs2memo();
+ void printCursorAddress(char *buf, Boolean deref=False);
+ void saveData(opstream &os);
+ static TDataViewer *readData(ipstream &is, uchar version,
+ const TRect &bounds, TScrollBar *aVScrollBar,
+ TDIndicator *aIndi);
+ void recycle();
+
+ // Wrappers to make things more clear
+ void setAutoFollow(uchar nVal)
+ {
+ autoFollow=nVal;
+ indi->setAutofollow(autoFollow);
+ }
+ void setEndian(uchar nVal)
+ {
+ endian=nVal;
+ indi->setEndian(endian);
+ }
+ void setRadix(uchar nVal)
+ {
+ radix=nVal;
+ indi->setRadix(radix);
+ }
+ void setBaseAddress(ulong nVal)
+ {
+ baseAddress=nVal;
+ indi->setBaseAddress(baseAddress);
+ }
+
+ TDIndicator *indi;
+ unsigned long memStart;
+ unsigned memLen;
+ uchar *memo;
+
+ unsigned long origAddr;
+ char *origAddrTxt;
+ unsigned bytesPerLine;
+
+ enum { dmBytes=0, dm2Bytes=1, dm4Bytes=2, dmChars=3, dmMAX=4 };
+ uchar dispMode;
+
+ enum { rxHex=0, rxDec=1, rxMAX=2 };
+ uchar radix;
+ uchar endian;
+
+ uchar autoFollow;
+ uchar outOfScope;
+ Boolean addressChanged;
+ unsigned long baseAddress;
+
+ TScrollBar *vs;
+ unsigned long memMin;
+ unsigned long memMax;
+ void UpdateScroll();
+
+ static int getCountDataViewers() { return cDataViewers; }
+
+protected:
+ static int cDataViewers;
+
+ static void setCommands(Boolean enable);
+ int EnterAddresses(const char *tit, int t1, ulong *v1,
+ const char *startVal=NULL, int t2=taddNone,
+ ulong *v2=NULL, int t3=taddNone, ulong *v3=NULL);
+ void updateIfOverlaps(ulong from, ulong len);
+};
+
+int TDataViewer::cDataViewers=0;
+
+static
+int isValidAddress(const char *taddr, unsigned long &addr)
+{
+ if (!dbg)
+ return 0;
+ int na, res;
+ uchar test;
+ int convAddr=!(isdigit(*taddr) || *taddr=='&' || *taddr=='$');
+
+ res=dbg->ReadMemory(taddr,1,&test,na,convAddr,&addr);
+ if (!res)
+ ShowErrorInMsgBox();
+ else if (na)
+ messageBox(__("Unaccessable memory address specified"),mfError|mfOKButton);
+
+ return res && !na;
+}
+
+static
+int isValidAddressNA(const char *taddr, unsigned long &addr)
+{
+ if (!dbg)
+ return 0;
+ int na, res;
+ uchar test;
+ int convAddr=!(isdigit(*taddr) || *taddr=='&' || *taddr=='$');
+
+ res=dbg->ReadMemory(taddr,1,&test,na,convAddr,&addr);
+ if (!res)
+ ShowErrorInMsgBox();
+
+ return res;
+}
+
+static
+int isValidUL(const char *exp, unsigned long &val)
+{
+ if (!dbg)
+ return 0;
+ char *res=dbg->EvalExpression(exp);
+ if (!res || MIDebugger::GetErrorNumber())
+ {
+ ShowErrorInMsgBox();
+ return 0;
+ }
+ char *end;
+ val=strtoul(res,&end,0);
+
+ int ret=1;
+ if (*end && !isspace(*end))
+ {
+ ret=0;
+ messageBox(__("Error in expression, an integer is needed"),mfError | mfOKButton);
+ }
+ free(res);
+
+ return ret;
+}
+
+//\\//\\//\\//\\//\\//\\ Memory handling
+
+/**[txh]********************************************************************
+
+ Description:
+ Reads @var{len} bytes from the specified @var{addr} to the @var{dest}
+buffer. It uses one gdb transfer, it means that transfering more than 8 KB
+can result in a gdb response of over than 64 KB. That's a data window of
+90 lines with 90 cols (270 physical cols). So I think that's ok for the data
+window, but not for other things.
+
+ Return: !=0 if the read succeed. Note that if just one byte can't be
+accessed gdb will refuse to read the rest.
+
+***************************************************************************/
+
+static
+int targetReadMemory(unsigned long addr, uchar *dest, unsigned len)
+{
+ if (!dbg)
+ return 0;
+ char b[64];
+ CLY_snprintf(b,64,"0x%lx",addr);
+ int na;
+ int res=dbg->ReadMemory(b,len,dest,na,0,NULL);
+
+ return res && !na;
+}
+
+const unsigned lenAssign=1024, lenBufAssign=48+lenAssign*4,
+ lenMultiAssign=8*lenAssign;
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes @var{len} bytes to memory address @var{addr} from @var{memo}. It
+does the transfers in blocks of 1 KB exploiting the "type[repeat]" cast
+implemented by gdb.
+
+ Return: !=0 OK, else at least one transfer failed and we aborted.
+
+***************************************************************************/
+
+int targetWriteMemory(ulong addr, uchar *memo, int len)
+{
+ char b[lenBufAssign];
+ while (len)
+ {
+ unsigned transfer=len;
+ if (transfer>lenAssign)
+ transfer=lenAssign;
+ int offset=CLY_snprintf(b,lenBufAssign,"(unsigned char[%d])*0x%lx={",
+ transfer,addr);
+ for (unsigned i=0; i<transfer; i++)
+ {
+ unsigned val=memo[i];
+ // Convert the number fast, avoid calling snprintf thousands of times
+ if (val>=200)
+ {
+ b[offset++]='2';
+ val-=200;
+ if (val<10)
+ b[offset++]='0';
+ }
+ else if (val>=100)
+ {
+ b[offset++]='1';
+ val-=100;
+ if (val<10)
+ b[offset++]='0';
+ }
+ if (val>=10)
+ {
+ unsigned d=val/10;
+ b[offset++]=d+'0';
+ val-=d*10;
+ }
+ b[offset++]=val+'0';
+ if ((i<transfer-1) || (len-transfer))
+ b[offset++]=',';
+ }
+ b[offset++]='}';
+ b[offset]=0;
+
+ if (!DebugEvalExpressionNoRet(b))
+ return 0;
+
+ len-=transfer;
+ addr+=transfer;
+ }
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a version of readBytes that just assumes that all the block can't
+be accessed if the read fails. Is called for small blocks that we assume
+are atomic. @x{readBytes}.
+
+***************************************************************************/
+
+static
+void readBytesFail(ulong addr, uchar *memo, unsigned len, unsigned clen)
+{
+ int ok=targetReadMemory(addr,memo,len);
+ memset(memo+clen,ok ? 0 : stNonAccess,len);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Read @var{len} bytes from @var{addr} to @var{memo}. The @var{memo} vector
+must hold at least twice the @var{len}. The bottom half is for the data and
+the rest for the flags indicating if the memory can be accessed or was
+edited. The @var{clen} is the offset of the flags.@*
+ This function will try to read the whole block in one transfer. If it
+fails it tries to read 8 bytes elements (aligned).
+
+***************************************************************************/
+
+static
+void readBytes(ulong addr, uchar *memo, unsigned len, unsigned clen)
+{
+ if (targetReadMemory(addr,memo,len))
+ {
+ memset(memo+clen,0,len);
+ return;
+ }
+ // Ok, the ML methode is too slow here. We will assume nothing is smaller
+ // than 8 bytes.
+ unsigned r=addr & 7;
+ if (r)
+ {
+ if (r>len) r=len;
+ readBytesFail(addr,memo,r,clen);
+ len-=r;
+ }
+ while (len>=8)
+ {
+ readBytesFail(addr+r,memo+r,8,clen);
+ len-=8;
+ r+=8;
+ }
+ if (len)
+ readBytesFail(addr+r,memo+r,len,clen);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Write @var{len} bytes from @var{memo} to @var{addr}. The @var{memo} vector
+must hold at least twice the @var{len}. The bottom half is for the data and
+the rest for the flags indicating if the memory can be accessed or was
+edited. The @var{clen} is the offset of the flags.@*
+
+***************************************************************************/
+
+static
+void writeBytes(ulong addr, uchar *memo, unsigned len, unsigned clen)
+{
+ if (!len)
+ return;
+
+ unsigned ic, jc;
+
+ // Skip memory we can't access at the beggining also unmodified
+ for (ic=0; ic<len && ((memo[ic+clen] & stNonAccess)
+ || !(memo[ic+clen] & stEdited)); ic++);
+ // Same at the end
+ for (jc=len-1; jc>ic && ((memo[jc+clen] & stNonAccess)
+ || !(memo[jc+clen] & stEdited)); jc--);
+ jc++;
+
+ len=jc-ic;
+ if (len)
+ {
+ if (targetWriteMemory(addr+ic,memo+ic,len))
+ {// Mark as not edited, but changed.
+ memo+=clen+ic;
+ for (ic=0; ic<len; ic++)
+ if (memo[ic] & stEdited)
+ {// This way we can add other flags
+ memo[ic]&=~stEdited;
+ memo[ic]|=stChanged;
+ }
+ }
+ }
+}
+
+static
+void targetFillMem(ulong to, unsigned len, unsigned value)
+{
+ uchar *mem=new uchar[min(lenMultiAssign,len)];
+ memset(mem,value,min(lenMultiAssign,len));
+
+ while (len)
+ {
+ unsigned size=min(lenMultiAssign,len);
+ if (!targetWriteMemory(to,mem,size))
+ break;
+ len-=size;
+ to+=size;
+ }
+ delete[] mem;
+}
+
+static
+void targetMoveMem(ulong from, ulong to, unsigned len)
+{
+ uchar *mem=new uchar[min(lenMultiAssign,len)];
+
+ while (len)
+ {
+ unsigned size=min(lenMultiAssign,len);
+ if (!targetReadMemory(from,mem,size))
+ break;
+ if (!targetWriteMemory(to,mem,size))
+ break;
+ len-=size;
+ to+=size;
+ from+=size;
+ }
+ delete[] mem;
+}
+
+static
+unsigned readFile(FILE *f, ulong to, unsigned len)
+{
+ unsigned bRead=0;
+ uchar *mem=new uchar[min(lenMultiAssign,len)];
+
+ while (len)
+ {
+ unsigned size=min(lenMultiAssign,len);
+ unsigned got=fread(mem,1,size,f);
+ bRead+=got;
+ if (!targetWriteMemory(to,mem,got))
+ break;
+ if (got!=size)
+ break;
+ len-=size;
+ }
+ delete[] mem;
+
+ return bRead;
+}
+
+static
+unsigned writeFile(FILE *f, ulong from, unsigned len)
+{
+ unsigned bWrote=0;
+ uchar *mem=new uchar[min(lenMultiAssign,len)];
+
+ while (len)
+ {
+ unsigned size=min(lenMultiAssign,len);
+ if (!targetReadMemory(from,mem,size))
+ break;
+ unsigned got=fwrite(mem,1,size,f);
+ bWrote+=got;
+ if (got!=size)
+ break;
+ len-=size;
+ }
+ delete[] mem;
+
+ return bWrote;
+}
+
+//\\//\\//\\//\\//\\//\\ TDataViewer
+
+const uchar enLittle=0, enBig=1;
+
+TDataViewer::TDataViewer(const TRect & bounds, TScrollBar * aVScrollBar,
+ const char *taddr, TDIndicator *aIndi):
+ TView(bounds),
+ memStart(0),
+ memo(0),
+ bytesPerLine(16),
+ dispMode(dmBytes),
+ radix(rxHex),
+ autoFollow(0),
+ addressChanged(False),
+ baseAddress(0)
+{
+ helpCtx=hcDataViewer;
+ growMode=gfGrowHiX | gfGrowHiY;
+ eventMask=evMouseDown | evKeyDown | evCommand | evBroadcast;
+ indi=aIndi; // They are created indicating little endian
+ endian=enLittle;
+ if (dbg && dbg->GetTargetEndian()==MIDebugger::enBig)
+ {
+ endian=enBig;
+ indi->setEndian(endian);
+ }
+ origAddrTxt=newStr(taddr);
+ isValidAddress(origAddrTxt,origAddr);
+ setCursor(addrLen,0);
+ showCursor();
+ vs=aVScrollBar;
+ memMin=0xFFFFFFFF;
+ memMax=0;
+ cDataViewers++;
+ outOfScope=0;
+}
+
+TDataViewer *TDataViewer::readData(ipstream &is, uchar , const TRect &bounds,
+ TScrollBar *aVScrollBar, TDIndicator *aIndi)
+{
+ char *taddr=is.readString();
+ TDataViewer *dv=new TDataViewer(bounds,aVScrollBar,taddr,aIndi);
+ // state
+ // iChanged and iBaseAddress not saved
+ // iEndian, iRadix, iAutofollow
+ uchar aux;
+ is >> aux;
+ dv->setEndian(aux);
+ is >> aux;
+ dv->setRadix(aux);
+ is >> aux;
+ dv->setAutoFollow(aux);
+ is >> dv->dispMode >> dv->bytesPerLine;
+ dv->outOfScope=1;
+ setCommands(False);
+
+ return dv;
+}
+
+void TDataViewer::recycle()
+{
+ if (outOfScope)
+ {
+ if (isValidAddress(origAddrTxt,origAddr))
+ {
+ setCommands(True);
+ update(origAddr);
+ TSetEditorApp::setCmdState(cmRecycle,False);
+ outOfScope=0;
+ }
+ }
+}
+
+TDataViewer::~TDataViewer()
+{
+ delete[] origAddrTxt;
+ free(memo);
+ cDataViewers--;
+}
+
+void TDataViewer::saveData(opstream &os)
+{
+ os.writeString(origAddrTxt);
+ // state
+ // iChanged and iBaseAddress not saved
+ // iEndian, iRadix, iAutofollow
+ os << endian << radix << autoFollow
+ << dispMode << bytesPerLine;
+}
+
+void TDataViewer::update(ulong addr, Boolean external)
+{
+ int memoIsNew=0;
+ if (!memo)
+ {
+ memLen=bytesPerLine*size.y;
+ memo=(uchar *)malloc(memLen*2);
+ memoIsNew=1;
+ }
+
+ indi->changeState(TDIndicator::iChanged,' ');
+ if (external && autoFollow)
+ {
+ addr=0;
+ addressChanged=False;
+ if (isValidAddress(origAddrTxt,addr))
+ {
+ addressChanged=origAddr!=addr ? True : False;
+ origAddr=addr;
+ }
+ }
+ Boolean otherAddress=addressChanged;
+ if (memStart!=addr)
+ otherAddress=True;
+ memStart=addr;
+
+ uchar *oldMemo=NULL;
+ if (!memoIsNew && !otherAddress)
+ {
+ oldMemo=new uchar[memLen*2];
+ memcpy(oldMemo,memo,memLen*2);
+ }
+
+ clock_t t1,t2;
+ struct timeval T1,T2;
+ double secs,secs2;
+
+ if (PROFILE)
+ {
+ t1=clock();
+ gettimeofday(&T1,0);
+ }
+
+ readBytes(addr,memo,size.y*bytesPerLine,memLen);
+
+ if (PROFILE)
+ {
+ t2=clock();
+ gettimeofday(&T2,0);
+ // Substract the reference
+ T2.tv_sec-=T1.tv_sec;
+ if (T2.tv_usec<T1.tv_usec)
+ {
+ T2.tv_sec--;
+ T2.tv_usec=T1.tv_usec-T2.tv_usec;
+ }
+ else
+ T2.tv_usec-=T1.tv_usec;
+ secs=T2.tv_sec+T2.tv_usec/1e6;
+ secs2=(t2-t1)/(double)CLOCKS_PER_SEC;
+ int bts=size.y*bytesPerLine;
+ printf("Time: %f seconds\nSpeed: %f bytes/second\n%5.2f%% Editor\n",
+ secs,bts/secs,secs2/secs*100);
+ }
+
+ if (oldMemo)
+ {
+ for (unsigned i=0; i<memLen; i++)
+ if (memo[i]!=oldMemo[i])
+ memo[i+memLen]|=stChanged;
+ delete[] oldMemo;
+ }
+
+ drawView();
+ UpdateScroll();
+}
+
+void TDataViewer::UpdateScroll()
+{
+ unsigned long mmax;
+
+ if (memStart<memMin)
+ memMin=memStart;
+ mmax=memStart+bytesPerLine*(size.y-1);
+ if (mmax>memMax)
+ memMax=mmax;
+ vs->setParams(memStart,memMin,memMax,(size.y-1)*bytesPerLine,bytesPerLine);
+ if (0)
+ messageBox(mfError | mfOKButton,"%lX %lX %lX %X %X",memStart,memMin,memMax,
+ (size.y-1)*bytesPerLine,bytesPerLine);
+}
+
+static const char *const notAccess="----------- ";
+static const uchar fieldLen[4][3]=
+{
+ {2, 3, 4}, {4, 5, 6}, {8, 10, 11}, {0, 0, 0},
+};
+
+static const char *fieldStr[4][2]=
+{
+ {"%02X ", "%3u "}, {"%04X ", "%5u "}, {"%08X ", "%10u "}, {NULL, NULL},
+};
+
+static const uchar fieldBytes[4]={1,2,4,1};
+
+static inline
+uchar toPrintable(uchar uc)
+{
+ if (0)
+ // I think that all current TV drivers supports all chars.
+ return (uc)<0x7e && (uc)>=32 ? (uc) : '.';
+ else
+ return uc ? uc : ' ';
+}
+
+int TDataViewer::getLine(char *buf, char *cols, int row)
+{
+ if (!memo)
+ {
+ *buf=0;
+ return 0;
+ }
+
+ unsigned ic;
+ const unsigned bpl=bytesPerLine;
+ uchar *mem=memo+row*bpl, *cmem=mem+memLen, uc;
+ ushort us;
+ const unsigned fl=fieldLen[dispMode][radix]+1;
+ const char *fs=fieldStr[dispMode][radix];
+ const char *notAcc=notAccess+12-fl;
+ const char *bufOri=buf;
+
+ switch (dispMode)
+ {
+ case dmBytes: // 1-byte-length unsigned integers
+ for (ic=0; ic<bpl; ic++, buf+=fl, cols+=fl)
+ {
+ if (cmem[ic] & stEdited)
+ memset(cols,1,fl-1);
+ if (cmem[ic] & stChanged)
+ memset(cols,2,fl-1);
+ sprintf(buf,cmem[ic] & stNonAccess ? notAcc : fs,mem[ic]);
+ }
+ if (radix==rxHex)
+ {
+ *buf++=' ';
+ for (ic=0; ic<bpl; ic++)
+ {
+ cols++;
+ if (cmem[ic] & stEdited)
+ *cols=1;
+ if (cmem[ic] & stChanged)
+ *cols=2;
+ *buf++=cmem[ic] & stNonAccess ? ' ' : toPrintable(mem[ic]);
+ }
+ }
+ break;
+ case dm2Bytes: // 2-byte-length unsigned integers
+ for (ic=0; ic<bpl; ic+=2, buf+=fl, cols+=fl)
+ {
+ uc=cmem[ic] | cmem[ic+1];
+ if (uc & stEdited)
+ memset(cols,1,fl-1);
+ if (uc & stChanged)
+ memset(cols,2,fl-1);
+ if (uc & stNonAccess)
+ {
+ memcpy(buf,notAcc,fl);
+ continue;
+ }
+ if (!endian)
+ us=mem[ic]+mem[ic+1]*0x100;
+ else
+ us=mem[ic+1]+mem[ic]*0x100;
+ sprintf(buf, fs, us);
+ }
+ break;
+ case dm4Bytes: // 4-byte-length unsigned integers
+ unsigned uw;
+
+ for (ic=0; ic<bpl; ic+=4, buf+=fl, cols+=fl)
+ {
+ uc=cmem[ic] | cmem[ic+1] | cmem[ic+2] | cmem[ic+3];
+ if (uc & stEdited)
+ memset(cols,1,fl-1);
+ if (uc & stChanged)
+ memset(cols,2,fl-1);
+ if (uc & stNonAccess)
+ {
+ memcpy(buf,notAcc,fl);
+ continue;
+ }
+ if (!endian)
+ uw=mem[ic]+mem[ic+1]*0x100+mem[ic+2]*0x10000+
+ mem[ic+3]*0x1000000;
+ else
+ uw=mem[ic+3]+mem[ic+2]*0x100+mem[ic+1]*0x10000+
+ mem[ic]*0x1000000;
+ sprintf(buf, fs, uw);
+ }
+ break;
+ case dmChars: // characters only
+ for (ic=0; ic<bpl; ic++, cols++)
+ {
+ if (cmem[ic] & stEdited)
+ *cols=1;
+ if (cmem[ic] & stChanged)
+ *cols=2;
+ *buf++=(cmem[ic] & stNonAccess) ? ' ' : toPrintable(mem[ic]);
+ }
+ break;
+ default:
+ break;
+ }
+ *buf=0;
+ return buf-bufOri;
+}
+
+void TDataViewer::draw()
+{
+ TDrawBuffer b;
+ uchar normalColor=getColor(1);
+ uchar modifiedColor=getColor(2);
+ uchar focusedColor=getColor(3);
+ uchar changedColor=getColor(5);
+ unsigned bpl=bytesPerLine;
+
+ int ic, jc;
+ AllocLocalStr(buf,addrLen+bpl*4+1);
+ AllocLocalStr(cols,addrLen+bpl*4+1); // should be enough
+
+ for (ic=0; ic<size.y; ic++)
+ {
+ uchar color;
+
+ memset(cols,0,size.x);
+ sprintf(buf,"%08lX: ",ic*bpl+memStart-baseAddress);
+ int len=addrLen+getLine(buf+addrLen,cols,ic);
+
+ color=normalColor;
+ b.moveBuf(0,buf,color,len);
+ if (len<size.x)
+ b.moveChar(len,' ',color,size.x-len);
+
+ if (addressChanged && origAddr==memStart+ic*bpl)
+ for (jc=0; jc<addrLen-2; jc++)
+ b.putAttribute(jc,modifiedColor);
+
+ for (jc=addrLen; jc<size.x; jc++)
+ if (cols[jc-addrLen]==1)
+ b.putAttribute(jc,modifiedColor);
+ else if (cols[jc-addrLen]==2)
+ b.putAttribute(jc,changedColor);
+
+ // colorize the "home" address
+ if (memStart+ic*bpl<=origAddr && memStart+ic*bpl+bpl>origAddr)
+ {
+ int fl, pos;
+
+ fl=fieldLen[dispMode][radix];
+ pos=addrLen+(origAddr-memStart-ic*bpl)/fieldBytes[dispMode]*(fl+1);
+ if (dispMode==dmChars)
+ fl=1;
+ for (jc=0; jc<fl; jc++)
+ b.putAttribute(pos+jc,focusedColor);
+ }
+
+ writeLine(0,ic,size.x,1,b);
+ }
+}
+
+void TDataViewer::setState(ushort aState, Boolean enable)
+{
+ TView::setState(aState,enable);
+ if (aState==sfActive)
+ {
+ vs->setState(sfVisible,enable);
+ indi->setState(sfActive,enable);
+ indi->drawView();
+ if (enable)
+ {// Check if we have to dis/enable the commands
+ if (outOfScope)
+ TSetEditorApp::setCmdState(cmRecycle,dbg &&
+ dbg->GetState()==MIDebugger::stopped ? True : False);
+ else
+ setCommands(dbg && dbg->GetState()==MIDebugger::stopped ? True : False);
+ }
+ }
+}
+
+#define cpDataViewer "\x06\x07\x08\x09\x0A\x0B"
+
+TPalette &TDataViewer::getPalette() const
+{
+ static TPalette
+ pal(cpDataViewer,sizeof(cpDataViewer)-1);
+
+ return pal;
+}
+
+void TDataViewer::cursorHoriz(int delta)
+{
+ int cx=cursor.x-addrLen;
+ unsigned fl=fieldLen[dispMode][radix];
+
+ if (fl)
+ cx=cx/(fl+1)*fl+(cx%(fl+1));
+ if (delta>0)
+ cx=min(cx+delta,
+ fl ? fl*bytesPerLine/fieldBytes[dispMode]-1 : bytesPerLine-1);
+ else
+ cx=max(cx+delta,0);
+ if (fl)
+ cx=cx/fl*(fl+1)+(cx%fl);
+ setCursor(addrLen+cx,cursor.y);
+}
+
+void TDataViewer::adjustWindow()
+{
+ unsigned xnew;
+
+ xnew=bytesPerLine/fieldBytes[dispMode]*(1+fieldLen[dispMode][radix]);
+ if (dispMode==dmBytes && radix==rxHex)
+ xnew+=bytesPerLine+2;
+ if (dispMode==dmChars)
+ xnew=bytesPerLine+1;
+ owner->growTo(xnew+3+addrLen,owner->size.y);
+}
+
+uchar *TDataViewer::curs2memo()
+{
+ return memo+bytesPerLine*cursor.y+
+ (cursor.x-addrLen)/(fieldLen[dispMode][radix]+1)*fieldBytes[dispMode];
+}
+
+const char *taddNames[]=
+{
+ __("~N~ew Value"),
+ __("~F~rom"),
+ __("~T~o"),
+ __("~E~xpression"),
+ __("~L~ength"),
+ __("~V~alue")
+};
+
+static
+struct
+{
+ char v1[widthWtExp], v2[widthWtExp], v3[widthWtExp];
+} boxEA;
+
+int TDataViewer::EnterAddresses(const char *tit, int t1, ulong *v1,
+ const char *startVal, int t2, ulong *v2,
+ int t3, ulong *v3)
+{
+ if (startVal)
+ strncpyZ(boxEA.v1,startVal,widthWtExp);
+ else
+ boxEA.v1[0]=0;
+ boxEA.v2[0]=boxEA.v3[0]=0;
+
+ Boolean changeOrigTxt=False;
+ if (t1 & taddChangeOrig)
+ {
+ t1&=~taddChangeOrig;
+ changeOrigTxt=True;
+ }
+
+ Boolean edit;
+ do
+ {
+ TSViewCol *col=new TSViewCol(tit);
+
+ // EN: EFLNT
+ TSLabel *o1=new TSLabel(taddNames[t1],
+ new TSInputLine(widthWtExp,1,hID_DbgEvalModifyExp,maxWtBox));
+ col->insert(xTSLeft,yTSUp,o1);
+ if (v2)
+ {
+ TSLabel *o2=new TSLabel(taddNames[t2],
+ new TSInputLine(widthWtExp,1,hID_DbgEvalModifyExp,maxWtBox));
+ o2->ySep=0;
+ col->insert(xTSLeft,yTSUnder,o2,NULL,o1);
+ if (v3)
+ {
+ TSLabel *o3=new TSLabel(taddNames[t3],
+ new TSInputLine(widthWtExp,1,hID_DbgEvalModifyExp,maxWtBox));
+ o3->ySep=0;
+ col->insert(xTSLeft,yTSUnder,o3,NULL,o2);
+ }
+ }
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcDataViewer);
+ delete col;
+
+ edit=True;
+ if (execDialog(d,&boxEA)!=cmOK)
+ edit=False;
+ else
+ {// Ensure all the requested values are filled.
+ if (IsEmpty(boxEA.v1) || (v2 && IsEmpty(boxEA.v2)) || (v3 && IsEmpty(boxEA.v3)))
+ {
+ messageBox(__("Please fill all the requested values"),mfError|mfOKButton);
+ continue;
+ }
+ if ((t1==taddNewValue ? isValidAddressNA(boxEA.v1,*v1) :
+ isValidAddress(boxEA.v1,*v1))
+ && (!v2 || (t2>=taddLength ? isValidUL(boxEA.v2,*v2) :
+ isValidAddress(boxEA.v2,*v2)))
+ && (!v3 || (t3>=taddLength ? isValidUL(boxEA.v3,*v3) :
+ isValidAddress(boxEA.v3,*v3))))
+ {// Avoid huge lengths, warn for large ones.
+ ulong *vLen=NULL;
+ if (t1==taddLength)
+ vLen=v1;
+ else if (t2==taddLength)
+ vLen=v2;
+ else if (t3==taddLength)
+ vLen=v3;
+ if (vLen)
+ {
+ if (*vLen>maxBlockLen)
+ {
+ messageBox(mfError|mfOKButton,
+ __("For security reasons the maximum length is limited to %lu bytes"),
+ maxBlockLen);
+ continue;
+ }
+ if (*vLen>warnBlockLen)
+ {
+ if (messageBox(__("This could be slow. Do you want to continue?"),
+ mfWarning|mfYesButton|mfNoButton)!=cmYes)
+ continue;
+ }
+ }
+
+ if (changeOrigTxt)
+ {
+ delete[] origAddrTxt;
+ origAddrTxt=newStr(boxEA.v1);
+ }
+ return 1;
+ }
+ }
+ }
+ while (edit);
+ return 0;
+}
+
+static
+int getFilename(char *buf, int typ)
+{
+ strcpy(buf,"*");
+ return GenericFileDialog(
+ typ ? __("Write block to file") : __("Read block from file"),buf,"*",
+ typ ? hID_FileSave : hID_FileOpen,fdDialogForSave)!=cmCancel;
+}
+
+void TDataViewer::printCursorAddress(char *buf, Boolean deref)
+{
+ sprintf(buf,deref ? "**0x%lx" : "0x%lx",curs2memo()-memo+memStart);
+}
+
+void TDataViewer::setCommands(Boolean enable)
+{
+ if (enable)
+ {
+ if (!TView::curCommandSet.has(cmDWFirstCommand))
+ {// Enable all
+ TView::commandSetChanged=True;
+ TView::curCommandSet.enableCmd(cmDWFirstCommand,cmDWLastCommand);
+ }
+ }
+ else
+ {
+ if (TView::curCommandSet.has(cmDWFirstCommand))
+ {// Disable all
+ TView::commandSetChanged=True;
+ TView::curCommandSet.disableCmd(cmDWFirstCommand,cmDWLastCommand);
+ }
+ }
+}
+
+void TDataViewer::updateIfOverlaps(ulong from, ulong len)
+{
+ ulong memEnd=memStart+memLen;
+ ulong to=from+len;
+ if (from<memEnd && to>=memStart)
+ update(memStart);
+}
+
+void TDataViewer::handleEvent(TEvent & event)
+{
+ char buf[PATH_MAX];
+ TView::handleEvent(event);
+
+ unsigned long newAddr=memStart, from, to, len, value;
+
+ if (event.what==evMouseDown)
+ {
+ clearEvent(event);
+ }
+ else if (event.what==evKeyDown)
+ {
+ switch (event.keyDown.keyCode)
+ {
+ case kbEsc:
+ message(owner,evCommand,cmClose,NULL);
+ clearEvent(event);
+ return;
+ default:
+ unsigned kc=event.keyDown.charScan.charCode;
+
+ //fprintf(stderr,"%c",kc);
+ if (dispMode==dmChars) // characters only
+ {
+ memo[cursor.y*bytesPerLine+cursor.x-addrLen]=kc;
+ // mark changed
+ memo[cursor.y*bytesPerLine+cursor.x-addrLen+memLen]|=stEdited;
+ indi->changeState(TDIndicator::iChanged,'*');
+ cursorHoriz(1);
+ drawView();
+ }
+ else if ((kc>='0' && kc<='9') || (radix==rxHex && (kc | 0x20)>='a'
+ && (kc | 0x20)<='f'))
+ {
+ getLine(buf,buf,cursor.y);
+ buf[cursor.x-addrLen]=kc;
+ for (kc=cursor.x-addrLen; kc && buf[kc]!=' '; kc--);
+ if (!sscanf(buf+kc,fieldStr[dispMode][radix],&kc))
+ break;
+ unsigned char *mem=curs2memo();
+
+ switch (dispMode)
+ {
+ case dmBytes:
+ *mem=kc;
+ break;
+ case dm2Bytes:
+ mem[endian]=kc;
+ mem[1-endian]=kc>>8;
+ break;
+ case dm4Bytes:
+ mem[3*endian]=kc;
+ mem[1+endian]=kc>>8;
+ mem[2-endian]=kc>>16;
+ mem[3-3*endian]=kc>>24;
+ break;
+ default:
+ break;
+ }
+ for (kc=0; kc<fieldBytes[dispMode]; kc++)
+ mem[memLen+kc]|=stEdited;
+ indi->changeState(TDIndicator::iChanged,'*');
+ cursorHoriz(1);
+ drawView();
+ }
+ break;
+ }
+ if (newAddr!=memStart)
+ update(newAddr);
+ clearEvent(event);
+ }
+ else if (event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmScrollBarChanged:
+ if (vs==event.message.infoPtr && (unsigned)vs->value!=memStart)
+ {
+ update(vs->value);
+ clearEvent(event);
+ }
+ break;
+ case cmDbgChgState:
+ if (dbg && dbg->GetState()==MIDebugger::stopped)
+ {
+ if (outOfScope)
+ {
+ if (owner && owner->current==this)
+ TSetEditorApp::setCmdState(cmRecycle,True);
+ }
+ else
+ {
+ setCommands(True);
+ update(memStart,True);
+ }
+ }
+ else
+ {// Any other state is useless
+ if (outOfScope)
+ {
+ if (owner && owner->current==this)
+ TSetEditorApp::setCmdState(cmRecycle,False);
+ }
+ else
+ setCommands(False);
+ }
+ break;
+ }
+ }
+ else if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ // Cursor movement
+ case cmDWUp:
+ if (cursor.y==0)
+ newAddr=memStart-bytesPerLine;
+ else
+ setCursor(cursor.x,cursor.y-1);
+ break;
+ case cmDWDown:
+ if (cursor.y==size.y-1)
+ newAddr=memStart+bytesPerLine;
+ else
+ setCursor(cursor.x,cursor.y+1);
+ break;
+ case cmDWRight:
+ cursorHoriz(1);
+ break;
+ case cmDWBaseIncrement:
+ newAddr=memStart+1;
+ break;
+ case cmDWLeft:
+ cursorHoriz(-1);
+ break;
+ case cmDWBaseDecrement:
+ newAddr=memStart-1;
+ break;
+ case cmDWPgDn:
+ newAddr=memStart+size.y*bytesPerLine;
+ break;
+ case cmDWPgUp:
+ newAddr=memStart-size.y*bytesPerLine;
+ break;
+ case cmDWFirstColumn:
+ setCursor(addrLen,cursor.y);
+ break;
+ case cmDWFirstRow:
+ setCursor(cursor.x,0);
+ break;
+ case cmDWLastRow:
+ setCursor(cursor.x,size.y-1);
+ break;
+ case cmDWLastColumn:
+ cursorHoriz(size.x);
+ break;
+ // End of cursor movement
+ case cmDWLessLines: // decrease bytes/line
+ if (bytesPerLine>fieldBytes[dispMode])
+ {
+ bytesPerLine-=fieldBytes[dispMode];
+ update(memStart);
+ adjustWindow();
+ setCursor(addrLen,cursor.y);
+ }
+ break;
+ case cmDWMoreLines: // increase bytes/line
+ bytesPerLine+=fieldBytes[dispMode];
+ free(memo);
+ memo=NULL;
+ update(memStart);
+ adjustWindow();
+ break;
+ case cmDWUpdateMemory: // update changes
+ writeBytes(memStart,memo,bytesPerLine*size.y,memLen);
+ drawView();
+ break;
+ case cmDWTogAutoF: // toggle auto follow mode
+ setAutoFollow(autoFollow^1);
+ break;
+ case cmDWBaseAddress: // set new base address
+ printCursorAddress(buf);
+ if (EnterAddresses(__("Base Address"),taddNewValue,&baseAddress,buf))
+ {
+ setBaseAddress(baseAddress);
+ drawView();
+ }
+ break;
+ case cmDWDispMode: // change display mode
+ dispMode=(dispMode+1) % dmMAX;
+ bytesPerLine&=~(fieldBytes[dispMode]-1);
+ update(memStart);
+ adjustWindow();
+ setCursor(addrLen,cursor.y);
+ break;
+ case cmDWTogEndian: // change endianness
+ setEndian(endian^1);
+ if (fieldBytes[dispMode]>1)
+ update(memStart);
+ break;
+ case cmDWFollowPointer: // follow pointer
+ printCursorAddress(buf,True);
+ if (isValidAddress(buf,newAddr))
+ {
+ origAddr=newAddr;
+ setCursor(addrLen,0);
+ }
+ break;
+ case cmDWGotoAddress: // goto to a new address
+ if (EnterAddresses(__("Data window"),taddExp | taddChangeOrig,
+ &newAddr,origAddrTxt))
+ {
+ setCursor(addrLen,0);
+ addressChanged=True;
+ }
+ break;
+ case cmDWRecompute: // reevalute the original address then go to there
+ if (isValidAddress(origAddrTxt,newAddr))
+ {
+ origAddr=newAddr;
+ setCursor(addrLen,0);
+ }
+ break;
+ case cmDWFill: // fill block
+ printCursorAddress(buf);
+ if (EnterAddresses(__("Fill Block"),taddFrom,&from,buf,
+ taddLength,&len,taddValue,&value))
+ {
+ targetFillMem(from,len,value);
+ updateIfOverlaps(from,len);
+ }
+ break;
+ case cmDWClear: // clear block
+ printCursorAddress(buf);
+ if (EnterAddresses(__("Clear Block"),taddFrom,&from,buf,
+ taddLength,&len) && len<maxBlockLen)
+ {
+ targetFillMem(from,len,0);
+ updateIfOverlaps(from,len);
+ }
+ break;
+ case cmDWMove: // move block
+ printCursorAddress(buf);
+ if (EnterAddresses(__("Move Block"),taddFrom,&from,buf,
+ taddTo,&to,taddLength,&len) && len<maxBlockLen)
+ {
+ targetMoveMem(from,to,len);
+ updateIfOverlaps(to,len);
+ }
+ break;
+ case cmDWFollowPtnNew: // follow pointer & open new window
+ printCursorAddress(buf,True);
+ TSetEditorApp::DebugDataWindow(newStr(buf));
+ break;
+ case cmDWRead: // read block
+ {
+ FILE *f1=NULL;
+
+ if (getFilename(buf,0) && (f1=fopen(buf,"rb"))!=NULL)
+ {
+ printCursorAddress(buf);
+ if (EnterAddresses(__("Read Block"),taddTo,&to,buf,taddLength,
+ &len) && len<maxBlockLen)
+ {
+ unsigned bRead=readFile(f1,to,len);
+ messageBox(mfOKButton | mfInformation,__("%u bytes read."),
+ bRead);
+ updateIfOverlaps(to,bRead);
+ }
+ fclose(f1);
+ }
+ break;
+ }
+ case cmDWWrite: // write block
+ printCursorAddress(buf);
+ if (EnterAddresses(__("Write Block"),taddFrom,&from,buf,taddLength,
+ &len) && len<maxBlockLen)
+ {// Now we have what to write ask for the file, not in the
+ // reverse order to avoid creating an empty file.
+ FILE *f;
+ if (getFilename(buf,1) && (f=fopen(buf,"wb"))!=NULL)
+ {
+ messageBox(mfOKButton | mfInformation,
+ __("%u bytes written."),writeFile(f,from,len));
+ fclose(f);
+ }
+ }
+ break;
+ case cmDWRadix: // change radix
+ setRadix((radix+1) % rxMAX);
+ update(memStart);
+ adjustWindow();
+ setCursor(addrLen,cursor.y);
+ break;
+ case cmRecycle:
+ recycle();
+ // Avoid an extra (and wrong) update
+ newAddr=memStart;
+ break;
+ default:
+ return;
+ }
+ if (newAddr!=memStart)
+ update(newAddr);
+ clearEvent(event);
+ }
+}
+
+void TDataViewer::changeBounds(const TRect &bounds)
+{
+ if (size.y<bounds.b.y-bounds.a.y)
+ {
+ free(memo);
+ memo=NULL;
+ }
+ setBounds(bounds);
+ update(memStart);
+ drawView();
+}
+
+//\\//\\//\\//\\//\\//\\ TDataWindow
+
+class TDataWindow: public TDialog
+{
+public:
+ TDataWindow(const TRect &, const char *aTitle);
+ virtual TPalette &getPalette() const;
+
+ static TDataWindow *createNew(const char *naddr=NULL, Boolean edit=False);
+ static TDataWindow *stackWindow();
+
+ void saveData(opstream &os) { viewer->saveData(os); };
+ static TDataWindow *readData(ipstream &is, char version, const TRect &bounds);
+
+protected:
+ TDataViewer *viewer;
+ TScrollBar *vs;
+ TDIndicator *indi;
+
+ void loadFromDisk(ipstream &is, char version);
+};
+
+#define cpDataWindow "\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1"
+
+TPalette &TDataWindow::getPalette() const
+{
+ static TPalette pal(cpDataWindow,sizeof(cpDataWindow)-1);
+
+ return pal;
+}
+
+TDataWindow::TDataWindow(const TRect &bounds, const char *aTitle) :
+ TWindowInit(TDataWindow::initFrame),
+ TDialog(bounds,aTitle)
+{
+ growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ flags|=wfGrow | wfZoom;
+ helpCtx=hcDataViewer;
+
+ TRect r=getExtent();
+ r.grow(-1,-1);
+
+ vs=new TScrollBar(TRect(r.b.x-1,r.a.y,r.b.x,r.b.y));
+ insert(vs);
+
+ indi=new TDIndicator(TRect(2,size.y-1,12,size.y));
+
+ if (aTitle)
+ {
+ r.b.x--;
+ viewer=new TDataViewer(r,vs,aTitle,indi);
+ insert(viewer);
+ insert(indi);
+ viewer->select();
+ }
+}
+
+TDataWindow *TDataWindow::readData(ipstream &is, char version,
+ const TRect &bounds)
+{// Two steps
+ TDataWindow *w=new TDataWindow(bounds,NULL);
+ w->loadFromDisk(is,version);
+
+ return w;
+}
+
+void TDataWindow::loadFromDisk(ipstream &is, char version)
+{
+ TRect r=getExtent();
+ r.grow(-1,-1);
+ r.b.x--;
+ viewer=TDataViewer::readData(is,version,r,vs,indi);
+ insert(viewer);
+ insert(indi);
+ viewer->select();
+ title=newStr(viewer->origAddrTxt);
+}
+
+TDataWindow *TDataWindow::createNew(const char *naddr, Boolean edit)
+{
+ static int winpos=0;
+ unsigned long addr;
+ char exp[widthWtExp];
+
+ if (!naddr || edit)
+ {
+ if (naddr)
+ strncpyZ(exp,naddr,widthWtExp);
+ else
+ exp[0]=0;
+ if (execDialog(createEditExp(__("Data window")),exp)!=cmOK)
+ return NULL;
+ naddr=exp;
+ }
+ if (!isValidAddress(naddr,addr))
+ return NULL;
+
+ TRect r(winpos,5+winpos,70,TScreen::getRows()-10+winpos);
+
+ winpos=(winpos+1) % 10;
+ TDataWindow *dw=new TDataWindow(r,naddr ? naddr : boxEA.v1);
+
+ //dw->viewer->update(addr); Will be updated by adjustWindow side effect
+ dw->viewer->memStart=addr; // But we need it.
+ dw->viewer->adjustWindow();
+ return dw;
+}
+
+TDataWindow *TDataWindow::stackWindow()
+{
+ if (!dbg)
+ return NULL;
+
+ const char *spReg;
+ switch (dbg->GetTargetArchitecture())
+ {
+ case MIDebugger::arIA32:
+ spReg="$esp"; // IA32: Extended Stack Pointer
+ break;
+ case MIDebugger::arSPARC:
+ spReg="$sp"; // SPARC: Stack Pointer
+ break;
+ default:
+ messageBox(__("Not implemented for your platform, please help to implement it"),
+ mfError|mfOKButton);
+ return NULL;
+ }
+
+ TDataWindow *dw=createNew(spReg,False);
+
+ if (dw)
+ {
+ dw->viewer->bytesPerLine=4;
+ dw->viewer->dispMode=TDataViewer::dm4Bytes;
+ dw->viewer->setAutoFollow(1);
+ dw->viewer->adjustWindow();
+ }
+ return dw;
+}
+
+//\\//\\//\\//\\//\\//\\ TIndicator
+
+TDIndicator::TDIndicator(const TRect &bounds):
+ TIndicator(bounds)
+{
+ strcpy(thestate," eX ");
+}
+
+void TDIndicator::draw()
+{
+ uchar color, frame;
+ TDrawBuffer b;
+
+ if (state & sfDragging)
+ {
+ color=getColor(2);
+ frame=normalFrame;
+ }
+ else if (state & sfActive)
+ {
+ color=getColor(1);
+ frame=dragFrame;
+ }
+ else
+ {
+ color=getColor(3);
+ frame=normalFrame;
+ }
+
+ b.moveChar(0,frame,color,size.x);
+ b.moveCStr(0,thestate,color);
+ writeBuf(0,0,size.x,1,b);
+}
+
+void TDIndicator::changeState(IndiType snum, int value)
+{
+ thestate[snum]=value;
+ drawView();
+}
+
+#define cpDIndicator "\x02\x03\x01"
+
+TPalette &TDIndicator::getPalette() const
+{
+ static TPalette
+ pal(cpDIndicator,sizeof(cpDIndicator)-1);
+
+ return pal;
+}
+
+/*****************************************************************************
+ Dsk wrapper for the data window
+*****************************************************************************/
+
+class TDskDataWin : public TDskWin
+{
+public:
+ TDskDataWin(TDataWindow *w);
+ ~TDskDataWin() {};
+
+ char *GetText(char *dest, short maxLen);
+ static void Insert(TDataWindow *w);
+
+ void saveData(opstream &os);
+ static void readData(ipstream &is, char version);
+
+protected:
+ TDataWindow *window;
+};
+
+TDskDataWin::TDskDataWin(TDataWindow *w)
+{
+ view=window=w;
+ type=dktDbgDataWin;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=0;
+ ZOrder=-1;
+}
+
+char *TDskDataWin::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" Data Window %s"),window->getTitle(maxLen));
+ return dest;
+}
+
+void TDskDataWin::Insert(TDataWindow *w)
+{
+ AddAndInsertDskWin(new TDskDataWin(w));
+}
+
+void TDskDataWin::saveData(opstream &os)
+{
+ unsigned wS=TScreen::getCols();
+ unsigned hS=TScreen::getRows();
+ TRect size=window->getBounds();
+ // size
+ SaveExpandedRect(os,size,wS,hS);
+ // z-order
+ os << (int)(TProgram::deskTop->indexOf(view));
+ // expression and state
+ window->saveData(os);
+ // zoomRect
+ SaveExpandedRect(os,window->zoomRect,wS,hS);
+}
+
+void TDskDataWin::readData(ipstream &is, char version)
+{
+ unsigned wS=TScreen::getCols();
+ unsigned hS=TScreen::getRows();
+ TRect size;
+
+ // size
+ ReadExpandedRect(is,size,wS,hS);
+ // z-order
+ int ZOrder;
+ is >> ZOrder;
+ // expression and state
+ TDataWindow *d=TDataWindow::readData(is,version,size);
+ // zoomRect
+ if (version>1)
+ ReadExpandedRect(is,d->zoomRect,wS,hS);
+ // Recreate it
+ TDskDataWin *win=new TDskDataWin(d);
+ win->ZOrder=ZOrder;
+ AddAndInsertDskWin(win);
+}
+
+/*****************************************************************************
+ TSetEditorApp members for the data window
+*****************************************************************************/
+
+void TSetEditorApp::DebugDataWindow(char *startVal)
+{
+ TDataWindow *dw=TDataWindow::createNew(startVal,True);
+ if (dw)
+ TDskDataWin::Insert(dw);
+ delete[] startVal;
+}
+
+void TSetEditorApp::DebugStackWindow()
+{
+ TDataWindow *dw=TDataWindow::stackWindow();
+ if (dw)
+ TDskDataWin::Insert(dw);
+}
+
+/*
+ done:
+ -----
+ + block(clear ^L,fill ^I,read ^R,write ^W,move ^M)
+ + goto ^G
+ + follow ^F
+ + follow and open new window ^O
+ + display(byte->half word->word->chars->float?->double?) ^D
+ + radix 16-10? ^X
+ + endian? ^E
+ + edit
+ + reevaluate & goto ^H
+ + bytesPerLine increase Gray+, decrease Gray-
+ + auto adjust window size
+ + base address mode ^B
+ + autoFollow ^A
+ + add mouse & scrollbar handling
+ + remove magic constants
+
+ Here are things that ML marked as thing to do and we did:
+ + data breakpoints, we have the watchpoints dialog.
+ + fix the FIXMEs
+ + popup menus, we have a hole menu for it.
+ + disassembler, we have a separated window for it.
+*/
+
+/*****************************************************************************
+ End of Data Window
+*****************************************************************************/
+
+
+/*****************************************************************************
+ GDB/MI interface
+*****************************************************************************/
+
+int DBG_SetBreakpoint(const char *source, int line)
+{
+ return bkpts.set(source,line);
+}
+
+int DBG_RemoveBreakpoint(const char *source, int line)
+{
+ return bkpts.unset(source,line);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Transfer our list to gdb and set the lines as special ones.
+
+***************************************************************************/
+
+void DBG_ApplyBkpts()
+{
+ bkpts.apply();
+}
+
+void DBG_RefreshIgnoreBkpts()
+{
+ bkpts.refreshIgnore();
+}
+
+void DBG_ApplyWpts()
+{
+ wpts.apply();
+}
+
+void DBG_SaveBreakpoints(opstream &os)
+{
+ bkpts.save(os);
+}
+
+void DBG_SaveWatchpoints(opstream &os)
+{
+ wpts.save(os);
+}
+
+void DBG_ReadBreakpoints(ipstream &is)
+{
+ bkpts.load(is);
+}
+
+void DBG_ReadWatchpoints(ipstream &is, char version)
+{
+ wpts.load(is,version);
+}
+
+void DBG_AddPathForSources(const char *path)
+{
+ if (IsStopped())
+ dbg->PathSources(path);
+}
+
+static
+char prefixList[]="CTL><";
+
+void DBG_GenericCB(const char *m, void *p)
+{
+ static DynStrCatStruct st={0,NULL};
+ int l=strlen(m);
+ if (!l)
+ return;
+
+ if (*((char *)p)!='>')
+ {
+ char *b=new char[l+4];
+ b[0]=*((char *)p);
+ b[1]=':';
+ b[2]=' ';
+ memcpy(b+3,m,l+1);
+ // Remove LF
+ if (b[l+2]=='\n')
+ b[l+2]=0;
+ DebugMsgAdd(b);
+ return;
+ }
+
+ // Concatenate commands sent to gdb until we get \n
+ if (st.str)
+ {// Concatenating
+ DynStrCat(&st,m,l);
+ if (m[l-1]=='\n')
+ {// EOL, send it
+ st.str[st.len-1]=0;
+ DebugMsgAdd(newStr(st.str));
+ free(st.str);
+ st.str=NULL;
+ }
+ }
+ else
+ {// First message
+ if (m[l-1]=='\n')
+ {// Whole line, send it
+ char *b=new char[l+4];
+ b[0]=*((char *)p);
+ b[1]=':';
+ b[2]=' ';
+ memcpy(b+3,m,l+1);
+ // Remove LF
+ b[l+2]=0;
+ DebugMsgAdd(b);
+ }
+ else
+ {// Partial line
+ char b[4];
+ b[0]=*((char *)p);
+ b[1]=':';
+ b[2]=' ';
+ b[3]=0;
+ DynStrCatInit(&st,b,3);
+ DynStrCat(&st,m,l);
+ }
+ }
+}
+
+void DBG_SetCallBacks()
+{
+ if (!dbg)
+ return;
+ dbg->SetConsoleCB(msgOps & msgConsole ? DBG_GenericCB : NULL,prefixList+0);
+ dbg->SetTargetCB(msgOps & msgTarget ? DBG_GenericCB : NULL,prefixList+1);
+ dbg->SetLogCB(msgOps & msgLog ? DBG_GenericCB : NULL,prefixList+2);
+ dbg->SetToGDBCB(msgOps & msgTo ? DBG_GenericCB : NULL,prefixList+3);
+ dbg->SetFromGDBCB(msgOps & msgFrom ? DBG_GenericCB : NULL,prefixList+4);
+}
+
+void DBG_ReleaseMemory()
+{
+ bkpts.releaseAll();
+ wpts.releaseAll();
+}
+
+/*****************************************************************************
+ End of GDB/MI interface
+*****************************************************************************/
+
+/*****************************************************************************
+
+ Debug Status and Messages Window
+
+/------------------------------------------------------------------------------\
+|C blabla ^|
+|> Blelelel ||
+|< Ppepepepep ||
+| V|
+|<---------------------------------------------------------------------------> |
+|------------------------------------------------------------------------------|
+|Mode: Remote (192.168.1.2:5000) [target.exe] |
+|Reason stopped: Hit a breakpoint |
+\-Running----------------------------------------------------------------------/
+
+|------------------------------------------------------------------------------|
+|Mode: X11 (/dev/pts/5) [target.exe] |
+|Error: From GDB (Not such a thing) |
+\-Stopped----------------------------------------------------------------------/
+
+*****************************************************************************/
+
+class TDebugMsgDialog : public TDialog
+{
+public:
+ TDebugMsgDialog(const TRect &aR, const char *tit);
+ void SetStatusGDB(const char *s) { statusF->setText(s); };
+ void SetStatusStop(const char *s) { status2->setText(s); };
+ void SetStatusError(const char *s) { status2->setText(s); };
+ void SetStatusMode(const char *s) { status1->setText(s); };
+ virtual void changeBounds(const TRect &r);
+ virtual void close();
+ virtual void handleEvent(TEvent &event);
+ virtual void setState(uint16 aState, Boolean enable);
+ void realClose() { TDialog::close(); };
+ void SendGDBCommand();
+ static void save(char *name);
+ static void copyClipboard(Boolean osClipboard);
+ static void saveAs();
+ void updateCommands();
+
+protected:
+ TNoStaticText *status1, *status2, *statusF;
+};
+
+// We need a TCollection for the TListBox.
+class TMsgCollection : public TCollection
+{
+public:
+ TMsgCollection(ccIndex lim, ccIndex delta) : TCollection(lim, delta) {}
+
+private:
+ virtual void *readItem( ipstream& ) { return 0; }
+ virtual void writeItem( void *, opstream& ) {}
+};
+
+/*****************************************************************************
+ Dsk Wrapper for Debug Status and Messages Window
+*****************************************************************************/
+
+class TDskDbgMsg : public TDskWin
+{
+public:
+ TDskDbgMsg(TView *w);
+ ~TDskDbgMsg();
+
+ //int GoAction(ccIndex i);
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+};
+
+TDskDbgMsg::TDskDbgMsg(TView *w)
+{
+ view=w;
+ type=dktDbgMsg;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=0;
+ ZOrder=-1;
+}
+
+TDskDbgMsg::~TDskDbgMsg()
+{
+}
+
+int TDskDbgMsg::DeleteAction(ccIndex, Boolean)
+{
+ view->hide();
+ return 0;
+}
+
+char *TDskDbgMsg::GetText(char *dest, short maxLen)
+{
+ const char *msg=DebugMsgStateName();
+ TVIntl::snprintf(dest,maxLen,__(" Debugger Window [%s]"),msg);
+ return dest;
+}
+
+/*****************************************************************************
+ End of Dsk Wrapper for Debug Status and Messages Window
+*****************************************************************************/
+
+static TDebugMsgDialog *MsgWindow=NULL;
+static TMsgCollection *MsgCol =NULL;
+static TListBox *MsgList =NULL;
+static TRect MsgWindowRect(-1,-1,-1,-1);
+
+TDebugMsgDialog::TDebugMsgDialog(const TRect &aR, const char *tit) :
+ TWindowInit(TDebugMsgDialog::initFrame),
+ TDialog(aR,tit)
+{
+ flags = wfMove | wfGrow | wfZoom | wfClose;
+ growMode = gfGrowLoY | gfGrowHiX | gfGrowHiY;
+
+ TRect r=getExtent();
+ r.grow(-1,-1);
+ r.b.y-=3;
+ r.b.x-=1;
+ unsigned width=r.b.x-r.a.x;
+
+ // Vertical scrollbar
+ TRect rs=r;
+ rs=TRect(r.b.x,r.a.y,r.b.x+1,r.b.y);
+ TScrollBar *scrBVe=new TScrollBar(rs);
+ insert(scrBVe);
+ scrBVe->options|=ofPostProcess;
+
+ // Horizontal scrollbar
+ rs=r;
+ rs=TRect(r.a.x,r.b.y,r.b.x,r.b.y+1);
+ TScrollBar *scrBHz=new TScrollBar(rs);
+ insert(scrBHz);
+ scrBHz->options|=ofPostProcess;
+ scrBHz->setParams(0,0,1000-width,40,1);
+
+ // List of messages
+ MsgList=new TListBox(r,1,scrBHz,scrBVe);
+ MsgList->growMode=gfGrowHiX | gfGrowHiY;
+ insert(MsgList);
+
+ // Two status lines
+ AllocLocalStr(empty,width+1);
+ memset(empty,' ',width);
+ empty[width]=0;
+ r.b.x++;
+ rs.move(0,1);
+ status1=new TNoStaticText(rs,empty);
+ status1->growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ insert(status1);
+ rs.move(0,1);
+ status2=new TNoStaticText(rs,empty);
+ status2->growMode=gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ insert(status2);
+
+ // The debug status
+ rs.move(0,1);
+ rs.a.x+=2;
+ rs.b.x=rs.a.x+maxWDbgSt;
+ empty[maxWDbgSt]=0;
+ statusF=new TNoStaticText(rs,empty);
+ statusF->growMode=gfGrowLoY | gfGrowHiY;
+ insert(statusF);
+
+ helpCtx=hcDebugMsgWin;
+}
+
+void TDebugMsgDialog::changeBounds(const TRect &r)
+{
+ TDialog::changeBounds(r);
+ MsgWindowRect=r;
+}
+
+void TDebugMsgDialog::close(void)
+{
+ hide();
+}
+
+void TDebugMsgDialog::handleEvent(TEvent &event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ switch (event.message.command)
+ {
+ case cmGDBCommand:
+ SendGDBCommand();
+ clearEvent(event);
+ break;
+ case cmcSaveAs:
+ saveAs();
+ clearEvent(event);
+ break;
+ case cmcCopy:
+ copyClipboard(False);
+ clearEvent(event);
+ break;
+ case cmcCopyClipWin:
+ copyClipboard(True);
+ clearEvent(event);
+ break;
+ }
+}
+
+static
+TDialog *createCmdDlg()
+{
+ TSViewCol *col=new TSViewCol(__("Send command to gdb"));
+
+ // EN: C
+ TSLabel *o1=new TSLabel(__("~C~ommand, be careful!"),
+ new TSInputLinePiped(widthGDBCom,1,hID_DbgCommand,maxGDBComBox));
+
+ col->insert(xTSLeft,yTSUp,o1);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmGDBCommand);
+ delete col;
+ return d;
+}
+
+void TDebugMsgDialog::SendGDBCommand()
+{
+ if (!dbg)
+ return;
+ char command[widthGDBCom];
+ command[0]=0;
+ if (execDialog(createCmdDlg(),command)==cmOK)
+ {
+ DBG_GenericCB(command,(void *)"U");
+ dbg->Send(command);
+ }
+}
+
+
+void TDebugMsgDialog::setState(uint16 aState, Boolean enable)
+{
+ TDialog::setState(aState,enable);
+ if (aState==sfActive)
+ updateCommands();
+}
+
+void TDebugMsgDialog::updateCommands()
+{
+ int enable=state & sfActive;
+ if (enable && MsgCol && MsgCol->getCount()!=0)
+ {
+ enableCommand(cmcCopy);
+ enableCommand(cmcCopyClipWin);
+ enableCommand(cmcSaveAs);
+ }
+ else
+ {
+ disableCommand(cmcCopy);
+ disableCommand(cmcCopyClipWin);
+ disableCommand(cmcSaveAs);
+ }
+}
+
+void TDebugMsgDialog::saveAs()
+{
+ char fileName[PATH_MAX];
+ strcpy(fileName,"messages.txt");
+
+ if (TCEditor::editorDialog(edSaveAs,fileName)!=cmCancel)
+ save(fileName);
+}
+
+void TDebugMsgDialog::save(char *name)
+{ // Reusing the editor's dialogs this function is very complet
+ if (access(name,F_OK)==0 && TCEditor::editorDialog(edFileExists,name,0)==cmNo)
+ return;
+ FILE *f=fopen(name,"wt");
+ if (!f)
+ {
+ TCEditor::editorDialog(edCreateError,name);
+ return;
+ }
+ if (MsgCol)
+ {
+ int c=MsgCol->getCount();
+ for (int i=0; i<c; i++)
+ {
+ fputs((char *)MsgCol->at(i),f);
+ fputs("\n",f);
+ }
+ }
+ if (ferror(f))
+ TCEditor::editorDialog(edWriteError,name,NULL);
+ fclose(f);
+}
+
+void TDebugMsgDialog::copyClipboard(Boolean osClipboard)
+{
+ if (!MsgCol || !TCEditor::clipboard)
+ return;
+
+ int c=MsgCol->getCount();
+ int len=1,i,lacu;
+ for (i=0; i<c; i++)
+ len+=strlen((char *)MsgCol->at(i))+CLY_LenEOL;
+
+ char *buffer=new char[len];
+ if (!buffer)
+ {
+ TCEditor::editorDialog(edOutOfMemory);
+ return;
+ }
+
+ for (lacu=0, i=0; i<c; i++)
+ {
+ char *s=(char *)MsgCol->at(i);
+ strcpy(buffer+lacu,s);
+ lacu+=strlen(s);
+ strcpy(buffer+lacu,CLY_crlf);
+ lacu+=CLY_LenEOL;
+ }
+
+ if (osClipboard)
+ {
+ if (TVOSClipboard::isAvailable())
+ TVOSClipboard::copy(0,buffer,lacu);
+ }
+ else
+ TCEditor::clipboard->insertText(buffer,lacu,True);
+
+ delete[] buffer;
+}
+
+
+TDebugMsgDialog *DebugMsgInit(Boolean hide, int ZOrder)
+{
+ if (MsgWindow)
+ return MsgWindow;
+ msgsInDebugWindow=GetMsgLines();
+ // Create the list:
+ if (!MsgCol)
+ MsgCol=new TMsgCollection(8,6);
+ // Create the dialog:
+ if (MsgWindowRect.a.x==-1)
+ {
+ MsgWindowRect=TProgram::deskTop->getExtent();
+ MsgWindowRect.a.y=MsgWindowRect.b.y-10;
+ }
+ MsgWindow=new TDebugMsgDialog(MsgWindowRect,__("Debugger Window"));
+ MsgList->newList(MsgCol);
+
+ // Insert in the helper
+ TDskWin *dskWin=SearchInHelperWin(dktDbgMsg,MsgWindow);
+ if (!dskWin)
+ {
+ TDskDbgMsg *p=new TDskDbgMsg(MsgWindow);
+ AddNonEditorToHelper(p);
+ TSetEditorApp::setCmdState(cmeSelDebugWin,True);
+ dskWin=p;
+ }
+
+ dskWin->ZOrder=ZOrder;
+ TProgram::deskTop->lock();
+ InsertInOrder(TProgram::deskTop,dskWin);
+ if (hide)
+ MsgWindow->hide();
+ TProgram::deskTop->unlock();
+
+ return MsgWindow;
+}
+
+void DebugMsgDeInit()
+{
+ if (MsgWindow)
+ {
+ MsgWindow->realClose();
+ MsgWindow=NULL;
+ }
+ destroy0(MsgCol);
+ MsgList=NULL;
+}
+
+void DebugMsgClose()
+{
+ if (MsgWindow)
+ MsgWindow->close();
+}
+
+void DebugMsgAdd(char *msg)
+{
+ DebugMsgInit();
+ ccIndex c=MsgCol->getCount();
+ MsgCol->insert(msg);
+ if (MsgWindow && c==1 && (MsgWindow->state & sfActive))
+ MsgWindow->updateCommands();
+ while (c>msgsInDebugWindow)
+ MsgCol->atFree(0);
+ DebugMsgUpdate(edsmDontSelect);
+}
+
+void DebugMsgClear()
+{
+ if (!MsgCol || !MsgList)
+ return;
+ MsgCol->removeAll();
+ MsgList->setRange(0);
+ if (MsgWindow && (MsgWindow->state & sfActive))
+ MsgWindow->updateCommands();
+}
+
+static
+void ResetHz()
+{
+ if (MsgList->hScrollBar)
+ MsgList->hScrollBar->setValue(0);
+}
+
+void DebugMsgUpdate(unsigned options)
+{
+ TProgram::deskTop->lock();
+ if (!(options & edsmNoHzReset))
+ ResetHz();
+ MsgWindow->show();
+ if (!(options & edsmDontSelect))
+ MsgWindow->select();
+ MsgList->setRange(MsgCol->getCount());
+ // Scroll it
+ uint32 opsScr=options & edsmScrollMask;
+ if (opsScr==edsmEverScroll ||
+ (opsScr==edsmScrollIfNoFocus && (MsgWindow->state & sfActive)==0))
+ {
+ if (MsgCol->getCount())
+ MsgList->focusItem(MsgCol->getCount()-1);
+ }
+ MsgList->drawView();
+ TProgram::deskTop->unlock();
+}
+
+const char *DebugMsgStateName()
+{
+ const char *msg=NULL;
+ if (dbg)
+ {
+ switch (dbg->GetState())
+ {
+ case MIDebugger::disconnected:
+ msg=TVIntl::getText(__("Disconnected"),icDisconnected);
+ break;
+ case MIDebugger::connected:
+ msg=TVIntl::getText(__("Connected"),icConnected);
+ break;
+ case MIDebugger::target_specified:
+ msg=TVIntl::getText(__("Ready to Run"),icReadyToRun);
+ break;
+ case MIDebugger::running:
+ msg=TVIntl::getText(__("Running"),icRunning);
+ break;
+ case MIDebugger::stopped:
+ msg=TVIntl::getText(__("Stopped"),icStopped);
+ break;
+ }
+ }
+ else
+ msg=TVIntl::getText(__("Not started"),icNotStarted);
+
+ return msg;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Updates the gdb status in the message window.
+
+***************************************************************************/
+
+void DebugMsgSetState()
+{
+ // If we changed the state then the commands must be updated.
+ TSetEditorApp::DebugUpdateCommands();
+ DebugMsgInit();
+ const char *msg=DebugMsgStateName();
+ // Execute associated actions
+ int cleanStop=1;
+ if (dbg)
+ switch (dbg->GetState())
+ {
+ case MIDebugger::disconnected:
+ break;
+ case MIDebugger::connected:
+ break;
+ case MIDebugger::target_specified:
+ DebugClearCPULine();
+ cleanStop=0;
+ break;
+ case MIDebugger::running:
+ DebugClearCPULine();
+ break;
+ case MIDebugger::stopped:
+ DebugUpdateWatches();
+ cleanStop=0;
+ break;
+ }
+ if (TInspector::getCountInspectors() || TDataViewer::getCountDataViewers())
+ message(TProgram::deskTop,evBroadcast,cmDbgChgState,NULL);
+
+ MsgWindow->SetStatusGDB(msg);
+ if (cleanStop)
+ MsgWindow->SetStatusStop("");
+ DebugMsgUpdate(edsmDontSelect);
+}
+
+int DebugGetErrorSt()
+{
+ if (!dbg)
+ return MIDebugger::GetErrorNumber();
+
+ MIDebugger::eState st=dbg->GetState();
+ int e=dbg->GetErrorNumberSt();
+ // This is a trick to detect gdb died
+ if (st!=dbg->GetState())
+ DebugMsgSetState();
+ return e;
+}
+
+void DebugMsgSetError()
+{
+ DebugMsgInit();
+
+ char b[maxWStatus];
+
+ char *cErr=TVIntl::getTextNew(MIDebugger::GetErrorStr());
+ int iErr=DebugGetErrorSt();
+
+ int l=TVIntl::snprintf(b,maxWStatus,__("Error: %s (%d)"),cErr,iErr);
+ delete[] cErr;
+
+ if (iErr==MI_FROM_GDB)
+ CLY_snprintf(b+l,maxWStatus-l," [%s]",MIDebugger::GetGDBError());
+
+ MsgWindow->SetStatusError(b);
+ DebugMsgUpdate();
+
+ if (killAfterStop)
+ // Something went wrong, forget about it.
+ killAfterStop=0;
+}
+
+void DebugMsgSetMode(Boolean select)
+{
+ DebugMsgInit();
+
+ char b[maxWStatus];
+ const char *tty;
+ b[0]=0;
+
+ switch (dOps.mode)
+ {
+ case dmLocal:
+ tty=getCurTTY();
+ TVIntl::snprintf(b,maxWStatus,__("Mode: %s (%s) [%s]"),
+ localMode==modeX11 ? "X11" : "Console",tty,dOps.program);
+ break;
+ case dmPID:
+ break;
+ case dmRemote:
+ TVIntl::snprintf(b,maxWStatus,__("Mode: Remote (%s) [%s]"),
+ dOps.rparam,dOps.program);
+ break;
+ }
+ MsgWindow->SetStatusMode(b);
+ DebugMsgUpdate(select ? 0 : edsmDontSelect);
+}
+
+int DebugMsgJumpToFrame(mi_frames *f, char *msg, int l)
+{
+ // Jump to the line where we stopped
+ int jumped=0;
+ if (f)
+ {
+ if (IsDisAsmWinCurrent())
+ {// The disassembler window is the active one, jump there
+ jumped=TDisAsmWin::jumpToFrame(f);
+ int line;
+ char *file=SolveFileName(TDisAsmWin::getFileLine(line));
+ if (file)
+ GotoFileLine(f->line,1,file,msg,-1,l,gflCPULine|gflDontSelect);
+ }
+ else
+ {// Try to jump to the source line.
+ if (f->file)
+ {
+ char *file=SolveFileName(f->file);
+ if (file && GotoFileLine(f->line,1,file,msg,-1,l,gflCPULine))
+ jumped=1;
+ if (IsDisAsmWinAvailable())
+ TDisAsmWin::jumpToFrame(f);
+ }
+ else
+ {// No file name => use disassembler window
+ DisAsmWin();
+ TDisAsmWin::jumpToFrame(f);
+ }
+ }
+ }
+ return jumped;
+}
+
+int DebugMsgFillReason(mi_frames *f, char *b, Boolean stop)
+{
+ int l;
+
+ if (stop)
+ {
+ char *reason=TVIntl::getTextNew(mi_reason_enum_to_str(stoppedInfo->reason));
+ l=TVIntl::snprintf(b,maxWStatus,__("Reason stopped: %s"),reason);
+ delete[] reason;
+ }
+ else
+ l=TVIntl::snprintf(b,maxWStatus,__("Returned immediatly"));
+
+ if (f && l+10<maxWStatus)
+ {
+ const char *unknown=TVIntl::getText(__("unknown"),icUnknown);
+ if (!f->file)
+ l+=CLY_snprintf(b+l,maxWStatus-l," [%s:%p]",
+ f->func ? f->func : unknown,f->addr);
+ else
+ l+=CLY_snprintf(b+l,maxWStatus-l," [%s:%s:%d]",
+ f->func ? f->func : unknown,
+ f->file ? f->file : unknown,
+ f->line);
+ }
+ MsgWindow->SetStatusStop(b);
+
+ return l;
+}
+
+void DebugMsgSetStopped()
+{
+ if (!stoppedInfo)
+ return;
+
+ char b[maxWStatus];
+ int l=DebugMsgFillReason(stoppedInfo->frame,b,True);
+
+ // If we stopped we changed the state
+ DebugMsgSetState();
+ // Jump to the line where we stopped
+ int jumped=DebugMsgJumpToFrame(stoppedInfo->frame,b,l);
+ // Update the window
+ DebugMsgUpdate(jumped ? edsmDontSelect : 0);
+
+ if (killAfterStop)
+ {
+ killAfterStop=0;
+ TSetEditorApp::DebugKill();
+ }
+ if (stoppedInfo->reason==sr_wp_scope && stoppedInfo->have_wpno)
+ {// Must be disabled
+ wpts.unset(stoppedInfo->wpno);
+ dbgPr("Disabling watchpoint %d, out of scope\n",stoppedInfo->wpno);
+ }
+}
+
+/*****************************************************************************
+ End of Debug Status and Messages Window
+*****************************************************************************/
+
+/*****************************************************************************
+
+ Watches Window
+
+ "~W~atch an expression"
+
+ I first implemented the "variable objects" mechanism provided by gdb
+(according to docs that's what Cygnus' Insight uses). But the way it works is
+confusing, specially for RHIDE users. So I added watches that works like the
+ones found in RHIDE and they are the "normal".
+ As the "v.o." mechanism takes care of the scope I named them "with scope".
+ For long lists the "with scope" watches should be faster because we know
+which ones changed and we don't evaluate all.
+
+/------------------------------------------------------------------------------\
+|00: exp value ^
+|01: exp value |
+| |
+| V
+\<---------------------------------------------------------------------------->/
+
+*****************************************************************************/
+
+struct gVar
+{
+ char *exp;
+ char type;
+ mi_gvar *v;
+ char *value;
+};
+
+const char gvtWScope=1, gvtNormal=0;
+
+class TGVarCollection : public TCollection, public TStringable
+{
+public:
+ TGVarCollection() :
+ TCollection(8,4),
+ TStringable() {}
+ virtual unsigned GetCount() { return getCount(); };
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual void freeItem(void *item);
+ int Insert(char *s, Boolean wScope);
+ int DeleteVar(ccIndex pos, Boolean removeIt=True);
+ void Refresh(ccIndex pos);
+ gVar *At(ccIndex pos) { return (gVar *)at(pos); };
+
+ static void MsgNotWhileRunning();
+
+ SetDefStreamMembers(TGVarCollection,TCollection);
+};
+
+SetDefStreamOperators(TGVarCollection);
+TStreamableClass RGVarCollection(TGVarCollection::name,TGVarCollection::build,
+ __DELTA(TGVarCollection));
+const char * const TGVarCollection::name="TGVarCollection";
+
+static TGVarCollection *WtCol=NULL;
+
+
+void *TGVarCollection::readItem(ipstream &is)
+{
+ gVar *gv=new gVar;
+ memset(gv,0,sizeof(gVar));
+ gv->exp=is.readString();
+ is >> gv->type;
+
+ return gv;
+}
+
+void TGVarCollection::writeItem(void *obj, opstream &os)
+{
+ gVar *gv=(gVar *)obj;
+ os.writeString(gv->exp);
+ os << gv->type;
+}
+
+void TGVarCollection::freeItem(void *item)
+{
+ gVar *gv=(gVar *)item;
+ delete[] gv->exp;
+ mi_free_gvar(gv->v);
+ ::free(gv->value);
+ delete gv;
+}
+
+void TGVarCollection::getText(char *dest, unsigned item, int maxLen)
+{
+ gVar *gv=At(item);
+ if (gv->v)
+ CLY_snprintf(dest,maxLen,"%s: [%s] %s",gv->exp,gv->v->type,gv->value);
+ else
+ {
+ if (gv->value)
+ CLY_snprintf(dest,maxLen,"%s: %s",gv->exp,gv->value);
+ else
+ TVIntl::snprintf(dest,maxLen,__("%s: Not yet in debugger"),gv->exp);
+ }
+}
+
+int TGVarCollection::Insert(char *s, Boolean wScope)
+{
+ gVar *gv=new gVar;
+ gv->type=wScope ? gvtWScope : gvtNormal;
+ gv->exp=newStr(s);
+ gv->v=NULL;
+ gv->value=NULL;
+ ccIndex pos=insert((void *)gv);
+ Refresh(pos);
+
+ return 1;
+}
+
+void TGVarCollection::MsgNotWhileRunning()
+{
+ messageBox(__("Wait until the process is stopped to delete this watch"),
+ mfError | mfOKButton);
+}
+
+int TGVarCollection::DeleteVar(ccIndex pos, Boolean removeIt)
+{
+ gVar *gv=At(pos);
+
+ if (gv->v)
+ {// GDB knows about it
+ if (dbg)
+ {
+ MIDebugger::eState st=dbg->GetState();
+ if (st==MIDebugger::running)
+ {// Not async op :-(
+ MsgNotWhileRunning();
+ return 0;
+ }
+ if (st==MIDebugger::stopped || st==MIDebugger::target_specified)
+ {// Must delete from gdb
+ if (!dbg->DelgVar(gv->v))
+ {
+ messageBox(__("Error deleting variable"),mfError | mfOKButton);
+ return 0;
+ }
+ }
+ }
+ // Just to be sure it won't be reused. freeItem releases it.
+ mi_free_gvar(gv->v);
+ gv->v=NULL;
+ }
+ if (removeIt)
+ atFree(pos);
+ else
+ {
+ delete[] gv->exp;
+ ::free(gv->value);
+ gv->exp=gv->value=NULL;
+ }
+
+ return 1;
+}
+
+void TGVarCollection::Refresh(ccIndex pos)
+{
+ if (!dbg || dbg->GetState()!=MIDebugger::stopped)
+ return;
+ // Ok, we can update it
+ gVar *gv=At(pos);
+ if (gv->type==gvtNormal)
+ {// Normal ones, they are just evaluated
+ ::free(gv->value);
+ gv->value=dbg->EvalExpression(gv->exp);
+ return;
+ }
+ // With scope, they use the "variable objects" mechanism
+ if (!gv->v)
+ {// Not yet defined for gdb
+ gv->v=dbg->AddgVar(gv->exp);
+ if (!gv->v) // Most probably a wrong expression or just out of scope
+ {
+ ::free(gv->value);
+ gv->value=strdup(dbg->GetGDBError());
+ }
+ }
+ if (gv->v)
+ {
+ ::free(gv->value);
+ gv->value=dbg->EvalExpression(gv->exp);
+ }
+}
+
+class TWatchesDialog : public TDialog
+{
+public:
+ TWatchesDialog(const TRect &aR, const char *tit);
+ virtual void changeBounds(const TRect &r);
+ virtual void close(void);
+ virtual void handleEvent(TEvent &event);
+
+ int AddWatch(Boolean wScope, char *val=NULL);
+ int DeleteWatch();
+ int EditWatch();
+ int EditExpression(char *exp, char *tit);
+ int InsertExp(char *exp, Boolean wScope);
+ void realClose() { TDialog::close(); };
+};
+
+/*****************************************************************************
+ Dsk Wrapper for Watches Window
+*****************************************************************************/
+
+class TDskDbgWt : public TDskWin
+{
+public:
+ TDskDbgWt(TView *w);
+ ~TDskDbgWt();
+
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+};
+
+TDskDbgWt::TDskDbgWt(TView *w)
+{
+ view=w;
+ type=dktDbgWt;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=0;
+ ZOrder=-1;
+}
+
+TDskDbgWt::~TDskDbgWt()
+{
+}
+
+int TDskDbgWt::DeleteAction(ccIndex, Boolean)
+{
+ view->hide();
+ return 0;
+}
+
+char *TDskDbgWt::GetText(char *dest, short maxLen)
+{
+ int watches=0;
+ if (WtCol)
+ watches=WtCol->getCount();
+ TVIntl::snprintf(dest,maxLen,__(" Watches Window (%d watches)"),watches);
+ return dest;
+}
+
+/*****************************************************************************
+ End of Dsk Wrapper for Watches Window
+*****************************************************************************/
+
+static TWatchesDialog *WtWindow=NULL;
+static TStringableListBox *WtList =NULL;
+static TRect WtWindowRect(-1,-1,-1,-1);
+
+TWatchesDialog::TWatchesDialog(const TRect &aR, const char *tit) :
+ TWindowInit(TWatchesDialog::initFrame),
+ TDialog(aR,tit)
+{
+ TScrollBar *scrollbar;
+
+ flags = wfMove | wfGrow | wfZoom | wfClose;
+ growMode = gfGrowLoY | gfGrowHiX | gfGrowHiY;
+
+ TRect r=getExtent();
+ r.grow(-1,-1);
+ scrollbar=standardScrollBar(sbVertical | sbHandleKeyboard);
+
+ WtList=new TStringableListBox(r,1,scrollbar);
+ WtList->growMode=gfGrowHiX | gfGrowHiY;
+
+ scrollbar=standardScrollBar(sbHorizontal | sbHandleKeyboard);
+ scrollbar->setParams(0,0,1000-(r.b.x-r.a.x),40,1);
+
+ WtList->hScrollBar=scrollbar;
+ insert(WtList);
+
+ helpCtx=hcWatchesWin;
+}
+
+void TWatchesDialog::changeBounds(const TRect &r)
+{
+ TDialog::changeBounds(r);
+ WtWindowRect=r;
+}
+
+void TWatchesDialog::close(void)
+{
+ hide();
+}
+
+int TWatchesDialog::InsertExp(char *exp, Boolean wScope)
+{
+ int res=WtCol->Insert(exp,wScope);
+ if (res)
+ {
+ WtList->setRange(WtCol->getCount());
+ WtList->drawView();
+ show();
+ if (owner->current!=this)
+ select();
+ }
+ return res;
+}
+
+TDialog *createEditExp(char *tit)
+{
+ TSViewCol *col=new TSViewCol(tit);
+
+ // EN: E
+ TSLabel *o1=new TSLabel(__("~E~xpression"),
+ new TSInputLinePiped(widthWtExp,1,hID_DbgEvalModifyExp,maxWtBox));
+
+ col->insert(xTSLeft,yTSUp,o1);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcWatchesWinEdit);
+ delete col;
+ return d;
+}
+
+int TWatchesDialog::EditExpression(char *exp, char *tit)
+{
+ if (execDialog(createEditExp(tit),exp)==cmOK)
+ return 1;
+ return 0;
+}
+
+int TWatchesDialog::AddWatch(Boolean wScope, char *val)
+{
+ char exp[widthWtExp];
+ if (val)
+ strncpyZ(exp,val,widthWtExp);
+ else
+ exp[0]=0;
+ if (!EditExpression(exp,__("Add to watch list")))
+ return 0;
+ InsertExp(exp,wScope);
+ return 1;
+}
+
+int TWatchesDialog::DeleteWatch()
+{
+ if (!WtCol || WtCol->getCount()==0)
+ return 0;
+ if (WtCol->DeleteVar(WtList->focused))
+ {
+ WtList->setRange(WtCol->getCount());
+ WtList->drawView();
+ return 1;
+ }
+ return 0;
+}
+
+int TWatchesDialog::EditWatch()
+{
+ if (!WtCol || WtCol->getCount()==0)
+ return 0;
+ if (dbg && dbg->GetState()==MIDebugger::running)
+ {
+ TGVarCollection::MsgNotWhileRunning();
+ return 0;
+ }
+
+ ccIndex pos=WtList->focused;
+ gVar *gv=WtCol->At(pos);
+
+ char exp[widthWtExp];
+ strcpy(exp,gv->exp);
+ if (!EditExpression(exp,__("Change the expression to watch")))
+ return 0;
+
+ if (!WtCol->DeleteVar(pos,False))
+ return 0;
+
+ gv->exp=newStr(exp);
+ WtCol->Refresh(pos);
+ WtList->drawView();
+ return 1;
+}
+
+void TWatchesDialog::handleEvent(TEvent &event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ switch (event.message.command)
+ {
+ case cmInsert:
+ AddWatch(False);
+ clearEvent(event);
+ break;
+ case cmInsertWScope:
+ AddWatch(True);
+ clearEvent(event);
+ break;
+ case cmDelete:
+ DeleteWatch();
+ clearEvent(event);
+ break;
+ case cmEditWatch:
+ EditWatch();
+ clearEvent(event);
+ break;
+ }
+}
+
+TWatchesDialog *WatchesInit(Boolean hide, int ZOrder)
+{
+ if (WtWindow)
+ return WtWindow;
+ // Create the list:
+ if (!WtCol)
+ WtCol=new TGVarCollection();
+ // Create the dialog:
+ if (WtWindowRect.a.x==-1)
+ {
+ WtWindowRect=TProgram::deskTop->getExtent();
+ WtWindowRect.a.y=WtWindowRect.b.y-7;
+ }
+ WtWindow=new TWatchesDialog(WtWindowRect,__("Watches"));
+ WtList->newList(WtCol);
+
+ // Insert in the helper
+ TDskWin *dskWin=SearchInHelperWin(dktDbgWt,WtWindow);
+ if (!dskWin)
+ {
+ TDskDbgWt *p=new TDskDbgWt(WtWindow);
+ AddNonEditorToHelper(p);
+ TSetEditorApp::setCmdState(cmeSelWatchesWin,True);
+ dskWin=p;
+ }
+
+ dskWin->ZOrder=ZOrder;
+ TProgram::deskTop->lock();
+ InsertInOrder(TProgram::deskTop,dskWin);
+ if (hide)
+ WtWindow->hide();
+ TProgram::deskTop->unlock();
+
+ return WtWindow;
+}
+
+void WatchesDeInit()
+{
+ if (WtWindow)
+ {
+ WtWindow->realClose();
+ WtWindow=NULL;
+ }
+ destroy0(WtCol);
+ WtList=NULL;
+}
+
+void WatchesClose()
+{
+ if (WtWindow)
+ WtWindow->close();
+}
+
+void TSetEditorApp::DebugWatchExp(Boolean wScope, char *val)
+{
+ WatchesInit();
+ WtWindow->AddWatch(wScope,val);
+ delete[] val;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Updates the watches. That's called when we switch to stopped.
+
+***************************************************************************/
+
+void DebugUpdateWatches()
+{
+ if (!WtWindow || !WtCol || !WtList || !WtCol->getCount())
+ {
+ if (TInspector::getCountInspectors())
+ {
+ mi_gvar_chg *changed;
+ if (!dbg || !dbg->ListChangedgVar(changed))
+ return;
+ message(TProgram::deskTop,evBroadcast,cmVarChanged,changed);
+ mi_free_gvar_chg(changed);
+ }
+ return;
+ }
+ ccIndex c=WtCol->getCount(), i;
+ int changedVars=0, deletedVars=0, withScope=0;
+ // First pass: try to define pending vars and evaluate normal ones.
+ for (i=0; i<c; i++)
+ {
+ gVar *gv=WtCol->At(i);
+ if (gv->type==gvtNormal || !gv->v)
+ {
+ WtCol->Refresh(i);
+ changedVars++;
+ }
+ else if (gv->type==gvtWScope)
+ withScope++;
+ }
+ if (!withScope && !TInspector::getCountInspectors())
+ {// Don't bother if we aren't using them
+ if (changedVars)
+ WtList->drawView();
+ return;
+ }
+ // Now find which variables changed
+ mi_gvar_chg *changed;
+ if (!dbg->ListChangedgVar(changed))
+ return;
+
+ mi_gvar_chg *ch;
+
+ if (0)
+ {// Debug code
+ ch=changed;
+ static int conta=0;
+ dbgPr("%d) list of changed variables:\n",conta);
+ conta++;
+ while (ch)
+ {
+ dbgPr("name: %s, in scope: %c ",ch->name,ch->in_scope ? 'y' : 'n');
+ if (ch->in_scope && ch->new_type)
+ {
+ dbgPr("new type: %s new num children: %d ",ch->new_type,ch->new_num_children);
+ }
+ ch=ch->next;
+ dbgPr("\n");
+ }
+ }
+
+ if (withScope)
+ {
+ ch=changed;
+ while (ch)
+ {
+ for (i=0; i<c; i++)
+ {
+ gVar *gv=WtCol->At(i);
+ if (gv->type==gvtWScope && gv->v && strcmp(gv->v->name,ch->name)==0)
+ {
+ // Mark used so TInspectors doesn't need to check it
+ free(ch->name);
+ ch->name=NULL;
+ if (!ch->in_scope)
+ {// Ok, no longer exists
+ if (WtCol->DeleteVar(i))
+ {
+ c=WtCol->getCount();
+ deletedVars++;
+ }
+ }
+ else
+ {
+ if (ch->new_type)
+ {// I know it from gdb sources but I don't know how can it happend.
+ ::free(gv->v->type);
+ gv->v->type=ch->new_type;
+ ch->new_type=NULL;
+ }
+ WtCol->Refresh(i);
+ changedVars++;
+ }
+ break;
+ }
+ }
+ ch=ch->next;
+ }
+ }
+ if (changed)
+ message(TProgram::deskTop,evBroadcast,cmVarChanged,changed);
+ mi_free_gvar_chg(changed);
+
+ if (changedVars || deletedVars)
+ {
+ if (deletedVars)
+ WtList->setRange(c);
+ WtList->drawView();
+ }
+}
+
+/*****************************************************************************
+ End of Watches Window
+*****************************************************************************/
+
+/*****************************************************************************
+ Configuration dialog
+*****************************************************************************/
+
+// Special TSView to select a file
+class TSChooseFile : public TSView
+{
+public:
+ TSChooseFile(const char *aText, unsigned anId, int wForce, const char *aMask);
+ virtual ~TSChooseFile() { delete linked; delete[] mask; };
+ virtual void insert(TDialog *);
+ virtual void setWidth(int aW);
+ virtual void setGrowMode(unsigned val);
+ unsigned getId() { return id; }
+ void setFileName(char *s) { linked->view->setData(s); }
+ char *mask;
+
+protected:
+ TSInputLine *linked;
+ TSButton *bt;
+ unsigned id;
+};
+
+static
+int ButtonCallBack(unsigned , void *data)
+{
+ TSChooseFile *cf=(TSChooseFile *)data;
+ char buf[wFilename];
+ strcpy(buf,cf->mask);
+ if (GenericFileDialog(__("Choose file"),buf,NULL,cf->getId(),fdNoMask)
+ !=cmCancel)
+ {
+ cf->setFileName(buf);
+ }
+ return btcbGoOn;
+}
+
+TSChooseFile::TSChooseFile(const char *aText, unsigned anId, int wForce,
+ const char *aMask) :
+ TSView()
+{
+ bt=new TSButton(__("Browse"),cmYes,bfNormal,ButtonCallBack,this);
+ linked=new TSInputLine(wFilename,1,anId,wForce-bt->w);
+ id=anId;
+ mask=newStr(aMask);
+
+ stTVIntl *cache=NULL;
+ const char *str=TVIntl::getText(aText,cache);
+ w=max(cstrlen(str)+1+bt->w,wForce);
+ h=2;
+ view=new TLabel(TRect(0,0,w,1),aText,linked->view,cache);
+}
+
+void TSChooseFile::insert(TDialog *d)
+{
+ TRect r(x-1,y,x-1+w-bt->w,y+1);
+ view->locate(r);
+ d->insert(view);
+ linked->x=x;
+ linked->y=y+1;
+ linked->insert(d);
+ bt->x=x+linked->w;
+ bt->y=y;
+ bt->insert(d);
+}
+
+void TSChooseFile::setWidth(int aW)
+{
+ w=aW-bt->w;
+ linked->setWidth(w);
+}
+
+void TSChooseFile::setGrowMode(unsigned val)
+{
+ view->growMode=val;
+ linked->setGrowMode(val);
+ bt->setGrowMode(val);
+}
+
+
+TDialog *createDebugOpsDialog(TSViewCol *&cl)
+{
+ TSViewCol *col=new TSViewCol(__("Debug Options"));
+
+ // EN: ADELMPRTU
+ // ES: ADEIMPRTU
+ TSVeGroup *o1=
+ MakeVeGroup(0, // All together
+ new TSChooseFile(__("~P~rogram to debug, with debug info"),
+ hID_DbgBinary,maxWBox,"*"),
+ TSLabelRadio(__("~M~ode"),
+ __("Local with ~e~xecutable"),
+ __("Local with r~u~nning process"),
+ __("Remote (g~d~bserver/stub)"),0),
+ new TSStaticText(__("Local target options")),
+ new TSLabel(__("Program ~a~rguments, not for remote mode"),
+ new TSInputLine(widthFiles,maxWBox)),
+ new TSLabel(__("Forced ~t~erminal, leave blank for auto"),
+ new TSInputLine(widthShort,maxWBox)),
+ new TSStaticText(__("Remote target options")),
+ new TSLabel(__("Remote p~r~otocol type"),
+ new TSInputLine(widthShort,maxWBox)),
+ new TSLabel(__("Remote ~l~ocation"),
+ new TSInputLine(widthShort,maxWBox)),
+ 0);
+ o1->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,o1);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcDebugOps);
+ cl=col;
+ return d;
+}
+
+int TSetEditorApp::DebugOptionsEdit()
+{
+ if (!IsPrjOpened())
+ GiveAdvice(gadvDbgNoPrj);
+ if (debugOpsNotIndicated)
+ {// Fill the structure with examples and recommendations
+ debugOpsNotIndicated=0;
+ char *fakeName=TVIntl::getTextNew(__("Your program compiled with -g"));
+ strcpy(dOps.program,fakeName);
+ delete[] fakeName;
+ dOps.mode=dmLocal;
+ dOps.args[0]=0;
+ dOps.tty[0]=0;
+ strcpy(dOps.rtype,"extended-remote");
+ strcpy(dOps.rparam,"192.168.1.2:5000");
+ }
+
+ DebugOptionsStruct edit;
+ memcpy(&edit,&dOps,sizeof(DebugOptionsStruct));
+
+ TSViewCol *cl;
+ int ret=0;
+ if (execDialog(createDebugOpsDialog(cl),&edit)==cmOK)
+ {
+ memcpy(&dOps,&edit,sizeof(DebugOptionsStruct));
+ ret=1;
+ }
+ delete cl;
+ return ret;
+}
+
+TDialog *createDebugOpsAdvDialog(TSViewCol *&cl)
+{
+ TSViewCol *col=new TSViewCol(__("Advanced Debug Options"));
+
+ // EN: BCFGILMSTX
+ // ES:
+ TSVeGroup *o1=
+ MakeVeGroup(0, // All together
+ new TSChooseFile(__("~G~DB executable"),hID_DbgGDB,wVisible,"gdb*"),
+ new TSChooseFile(__("~X~ terminal executable"),hID_DbgXTerm,wVisible,"xterm*"),
+ new TSLabel(__("~M~ain function"),
+ new TSInputLine(wFunction,1,hID_DbgMainFunc,wVisible)),
+ new TSHzGroup(
+ new TSHzLabel(__("GDB ~T~ime out [s]"),new TSInputLine(wTimeOut)),
+ new TSHzLabel(__("Max. ~l~ines in Debug window"),new TSInputLine(wLinesMsg))),
+ TSLabelCheck(__("M~i~scellaneous"),
+ __("No gdb ~b~anner after connecting"),
+ __("Enable MI v2 ~f~eatures"),
+ __("No ~s~ymbols bug workaround"),
+ __("No source ~c~ode in disasm. window"),0),0);
+ o1->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,o1);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(hcDebugAdvOps);
+ // Hack: the TSChooseFile object have important data needed during the
+ // execution of the dialog. We can't release this data right now and we
+ // have to wait until the dialog is destroyed.
+ //delete col;
+ cl=col;
+ return d;
+}
+
+struct DebugOptionsAdvStruct
+{
+ char gdb[wFilename];
+ char xterm[wFilename];
+ char main[wFunction];
+ char to[wTimeOut];
+ char lines[wLinesMsg];
+ uint32 misc;
+};
+
+int TSetEditorApp::DebugOptionsAdv()
+{
+ // Get current values
+ const char *gdb=GetGDBExe();
+ const char *xterm=GetXTermExe();
+ const char *mainf=GetMainFunc();
+ unsigned to=GetGDBTimeOut();
+ unsigned lines=GetMsgLines();
+ unsigned misc=GetGDBMisc();
+
+ // Transfer to the edit box
+ DebugOptionsAdvStruct box;
+ strncpyZ(box.gdb,gdb,wFilename);
+ strncpyZ(box.xterm,xterm,wFilename);
+ strncpyZ(box.main,mainf,wFunction);
+ CLY_snprintf(box.to,wTimeOut,"%d",to);
+ CLY_snprintf(box.lines,wLinesMsg,"%d",lines);
+ box.misc=misc;
+
+ TSViewCol *cl;
+ // Edit
+ if (execDialog(createDebugOpsAdvDialog(cl),&box)==cmOK)
+ {// Set the changed values
+ if (strcmp(box.gdb,gdb))
+ SetGDBExe(box.gdb);
+ if (strcmp(box.xterm,xterm))
+ SetXTermExe(box.xterm);
+ if (strcmp(box.main,mainf))
+ SetMainFunc(box.main,True);
+ unsigned bto=atoi(box.to);
+ if (bto<2) bto=2;
+ if (bto!=to)
+ SetGDBTimeOut(bto);
+ unsigned blines=atoi(box.lines);
+ if (blines<100) blines=100;
+ if (blines!=lines)
+ SetMsgLines(blines);
+ if (box.misc!=misc)
+ SetGDBMisc(box.misc);
+ return 1;
+ }
+ delete cl;
+ return 0;
+}
+
+TDialog *createDebugOptsMsgsDialog()
+{
+ TSViewCol *col=new TSViewCol(__("Messages"));
+
+ // EN: ACDFLT
+ // ES: CDELRT
+ TSLabel *o1=TSLabelCheck(__("~D~isplay messages related to"),
+ __("GDB ~c~onsole (CLI)"),
+ __("T~a~rget (not really implemented in gdb)"),
+ __("~L~og (gdb internal messages)"),
+ __("GDB/MI commands sent ~t~o gdb"),
+ __("GDB/MI responses ~f~rom gdb"),0);
+
+ col->insert(xTSLeft,yTSUp,o1);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmeDebugOptions);
+ delete col;
+ return d;
+}
+
+void TSetEditorApp::DebugOptsMsgs()
+{
+ uint32 edit=msgOps;
+
+ if (execDialog(createDebugOptsMsgsDialog(),&edit)==cmOK)
+ {
+ msgOps=edit;
+ DBG_SetCallBacks();
+ }
+}
+
+/*****************************************************************************
+ End of Configuration dialog
+*****************************************************************************/
+
+const unsigned ceBreakpoints=1, ceWatchpoints=2, ceWatches=4, ceInspectors=8,
+ ceDataWindows=16, ceAll=32-1;
+
+static
+void CloseNonEd(TDskWin *win, void *)
+{
+ TDskDataWin *w=(TDskDataWin *)win;
+ message(w->view,evCommand,cmClose,NULL);
+}
+
+void TSetEditorApp::DebugCleanElem()
+{
+ if (!DebugCheckStopped())
+ return;
+
+ TSViewCol *col=new TSViewCol(__("Clean elements"));
+
+ // EN: ABDIW
+ col->insert(xTSCenter,yTSUp,
+ TSLabelCheck(__("Elements"),
+ __("~B~reakpoints"),
+ __("~W~atchpoints"),
+ __("W~a~tches"),
+ __("~I~nspectors"),
+ __("~D~ata windows"),0));
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmeDbgCleanElem);
+ delete col;
+
+ uint32 what=ceAll;
+ if (execDialog(d,&what)==cmOK)
+ {
+ int c, i;
+
+ if (what & ceBreakpoints)
+ {
+ c=bkpts.GetCount();
+ for (i=0; i<c; i++)
+ TDiagBrk::Delete(i);
+ }
+ if (what & ceWatchpoints)
+ {
+ c=wpts.GetCount();
+ for (i=0; i<c; i++)
+ TDiagWp::Delete(i);
+ }
+ if (what & ceWatches)
+ WatchesDeInit();
+ if (what & ceInspectors)
+ TSetEditorApp::edHelper->forEachNonEditor(dktDbgIns,CloseNonEd,NULL);
+ if (what & ceDataWindows)
+ TSetEditorApp::edHelper->forEachNonEditor(dktDbgDataWin,CloseNonEd,NULL);
+ }
+}
+
+/*****************************************************************************
+ Persistence.
+ This information is stored only in project files, to do "persistent"
+debugging the user needs a project, for "casual" use the project isn't needed.
+*****************************************************************************/
+
+// Allow -2*size to 2*size
+const unsigned maxRef=1000000000;
+
+static
+int32 ExpandCoor(int coord, unsigned ref)
+{// Relative
+ double v=(double)coord/ref;
+ v*=maxRef;
+ // Round
+ if (v>=0.0)
+ v+=0.5;
+ else
+ v-=0.5;
+ // Clamp
+ if (v>INT_MAX)
+ v=INT_MAX;
+ else if (v<INT_MIN)
+ v=INT_MIN;
+ return (int32)v;
+}
+
+static
+void SaveExpandedRect(opstream &os, TRect &r, unsigned wS, unsigned hS)
+{
+ os << ExpandCoor(r.a.x,wS) << ExpandCoor(r.b.x,wS)
+ << ExpandCoor(r.a.y,hS) << ExpandCoor(r.b.y,hS);
+}
+
+static
+int CompactCoord(int32 coord, unsigned ref)
+{
+ double v=(double)coord/maxRef;
+ v*=ref;
+ // Round
+ if (v>=0.0)
+ v+=0.5;
+ else
+ v-=0.5;
+ return (int)v;
+}
+
+static
+void ReadExpandedRect(ipstream &is, TRect &r, unsigned wS, unsigned hS)
+{
+ int32 a, b;
+ is >> a >> b;
+ r.a.x=CompactCoord(a,wS);
+ r.b.x=CompactCoord(b,wS);
+ is >> a >> b;
+ r.a.y=CompactCoord(a,hS);
+ r.b.y=CompactCoord(b,hS);
+}
+
+static
+void SaveInspector(TDskWin *win, void *data)
+{
+ TDskInspector *w=(TDskInspector *)win;
+ opstream *os=(opstream *)data;
+ w->saveData(*os);
+}
+
+static
+void SaveDW(TDskWin *win, void *data)
+{
+ TDskDataWin *w=(TDskDataWin *)win;
+ opstream *os=(opstream *)data;
+ w->saveData(*os);
+}
+
+static
+void CountNonEditors(TDskWin *, void *data)
+{
+ int *i=(int *)data;
+ (*i)++;
+}
+
+void DebugSaveData(opstream &os)
+{
+ unsigned wS=TScreen::getCols();
+ unsigned hS=TScreen::getRows();
+
+ // CAUTION!!! update the dummy
+ os << debugDataVersion;
+
+ // Target options
+ os << (uchar)debugOpsNotIndicated;
+ if (!debugOpsNotIndicated)
+ {
+ dbgPr("debugOpsNotIndicated\n");
+ os.writeString(dOps.program);
+ os.writeString(dOps.args);
+ os.writeString(dOps.tty);
+ os.writeString(dOps.rtype);
+ os.writeString(dOps.rparam);
+ os << (uchar)dOps.mode;
+ }
+ // Type of Messages
+ os << (uchar)msgOps;
+ // Debug window information
+ if (MsgWindowRect.a.x!=-1)
+ {
+ dbgPr("MsgWindowRect\n");
+ os << svPresent;
+ SaveExpandedRect(os,MsgWindowRect,wS,hS);
+ if (MsgWindow)
+ {
+ dbgPr("MsgWindow\n");
+ os << msgWinVersion << (int)(TProgram::deskTop->indexOf(MsgWindow))
+ << (char)((MsgWindow->state & sfVisible) ? svYes : svNo);
+ SaveExpandedRect(os,MsgWindow->zoomRect,wS,hS);
+ }
+ else
+ os << svAbsent;
+ }
+ else
+ os << svAbsent;
+ // Watches
+ if (WtCol && WtCol->getCount())
+ {
+ dbgPr("WtCol\n");
+ os << svPresent << WtCol;
+ }
+ else
+ os << svAbsent;
+ // Watches window information
+ if (WtWindowRect.a.x!=-1)
+ {
+ dbgPr("WtWindowRect\n");
+ os << svPresent;
+ SaveExpandedRect(os,WtWindowRect,wS,hS);
+ if (WtWindow)
+ {
+ dbgPr("WtWindow\n");
+ os << watchWinVersion << (int)(TProgram::deskTop->indexOf(WtWindow))
+ << (char)((WtWindow->state & sfVisible) ? svYes : svNo);
+ SaveExpandedRect(os,WtWindow->zoomRect,wS,hS);
+ }
+ else
+ os << svAbsent;
+ }
+ else
+ os << svAbsent;
+ // Breakpoints
+ DBG_SaveBreakpoints(os);
+ // Watchpoints
+ DBG_SaveWatchpoints(os);
+ // Inspectors
+ os << inspVersion;
+ int inspectors=0;
+ TSetEditorApp::edHelper->forEachNonEditor(dktDbgIns,CountNonEditors,&inspectors);
+ os << inspectors;
+ if (inspectors)
+ TSetEditorApp::edHelper->forEachNonEditor(dktDbgIns,SaveInspector,&os);
+ // Data windows
+ os << dwVersion;
+ int dataWindows=0;
+ TSetEditorApp::edHelper->forEachNonEditor(dktDbgDataWin,CountNonEditors,&dataWindows);
+ os << dataWindows;
+ if (dataWindows)
+ TSetEditorApp::edHelper->forEachNonEditor(dktDbgDataWin,SaveDW,&os);
+ // Main Function
+ os << svPresent;
+ os.writeString(mainFunction);
+ // No more data
+ os << svAbsent;
+}
+
+void DebugReadData(ipstream &is)
+{
+ unsigned char version, aux;
+ unsigned wS=TScreen::getCols();
+ unsigned hS=TScreen::getRows();
+
+ is >> version;
+ // Target options
+ is >> aux;
+ debugOpsNotIndicated=aux;
+ if (!debugOpsNotIndicated)
+ {
+ dbgPr("debugOpsNotIndicated\n");
+ is.readString(dOps.program,sizeof(dOps.program));
+ is.readString(dOps.args,sizeof(dOps.args));
+ is.readString(dOps.tty,sizeof(dOps.tty));
+ is.readString(dOps.rtype,sizeof(dOps.rtype));
+ is.readString(dOps.rparam,sizeof(dOps.rparam));
+ is >> aux;
+ dOps.mode=aux;
+ ExtractBinReference();
+ }
+ // Type of Messages
+ is >> aux;
+ msgOps=aux;
+ // Debug window information
+ is >> aux;
+ if (aux)
+ {
+ dbgPr("MsgWindowRect\n");
+ ReadExpandedRect(is,MsgWindowRect,wS,hS);
+ is >> aux;
+ if (aux)
+ {
+ dbgPr("MsgWindow\n");
+ int ZOrder;
+ char visible;
+ is >> ZOrder >> visible;
+ DebugMsgInit(visible ? False : True,ZOrder);
+ if (aux>1)
+ ReadExpandedRect(is,MsgWindow->zoomRect,wS,hS);
+ }
+ }
+ // Watches
+ is >> aux;
+ if (aux)
+ {
+ dbgPr("WtCol\n");
+ is >> WtCol;
+ }
+ // Watches window information
+ is >> aux;
+ if (aux)
+ {
+ dbgPr("WtWindowRect\n");
+ ReadExpandedRect(is,WtWindowRect,wS,hS);
+ is >> aux;
+ if (aux)
+ {
+ dbgPr("WtWindow\n");
+ int ZOrder;
+ char visible;
+ is >> ZOrder >> visible;
+ WatchesInit(visible ? False : True,ZOrder);
+ if (aux>1)
+ ReadExpandedRect(is,WtWindow->zoomRect,wS,hS);
+ }
+ }
+ // Breakpoints
+ DBG_ReadBreakpoints(is);
+ // Watchpoints
+ is >> aux;
+ if (!aux)
+ return;
+ DBG_ReadWatchpoints(is,aux);
+ // Inspectors
+ is >> aux;
+ if (!aux)
+ return;
+ int inspectors;
+ is >> inspectors;
+ for (int i=0; i<inspectors; i++)
+ TDskInspector::readData(is,aux);
+ // Data Windows
+ is >> aux;
+ if (!aux)
+ return;
+ int dataWindows;
+ is >> dataWindows;
+ for (int i=0; i<dataWindows; i++)
+ TDskDataWin::readData(is,aux);
+ // Main Function
+ is >> aux;
+ if (!aux)
+ return;
+ char *mf=is.readString();
+ SetMainFunc(mf,False);
+ // No more data
+ is >> aux;
+}
+
+/*****************************************************************************
+ End of Persistence.
+*****************************************************************************/
+
+/*****************************************************************************
+ End of Data Window
+*****************************************************************************/
+#else // !HAVE_GDB_MI
+
+void TSetEditorApp::DebugCommandsForDisc() {}
+int TSetEditorApp::DebugConfirmEndSession(Boolean ) { return 1; }
+void TSetEditorApp::DebugToggleBreakpoint() {}
+int TSetEditorApp::DebugOptionsEdit() { return 0; }
+void TSetEditorApp::DebugRunOrContinue() {}
+void TSetEditorApp::DebugStepOver() {}
+void TSetEditorApp::DebugTraceInto() {}
+void TSetEditorApp::DebugGoToCursor() {}
+void TSetEditorApp::DebugFinishFun() {}
+void TSetEditorApp::DebugReturnNow() {}
+void TSetEditorApp::DebugStop() {}
+void TSetEditorApp::DebugKill() {}
+void TSetEditorApp::DebugCallStack() {}
+void TSetEditorApp::DebugEvalModify(char *startVal) { delete[] startVal; }
+void TSetEditorApp::DebugOptsMsgs() {}
+void TSetEditorApp::DebugWatchExp(Boolean , char *) {}
+void TSetEditorApp::DebugDeInitVars() {}
+Boolean TSetEditorApp::DebugCloseSession(Boolean ) { return True; }
+int TSetEditorApp::DebugCheckAcceptCmd(Boolean ) { return 0; }
+int TSetEditorApp::DebugCheckStopped(Boolean ) { return 1; }
+void TSetEditorApp::DebugEditBreakPts() {}
+void TSetEditorApp::DebugEditWatchPts(char *startVal) { delete[] startVal; }
+void TSetEditorApp::DebugInspector(char *startVal) { delete[] startVal; }
+void TSetEditorApp::DebugDataWindow(char *startVal) { delete[] startVal; }
+void TSetEditorApp::DebugCleanElem() {}
+void TSetEditorApp::DebugThreadSel() {}
+int TSetEditorApp::DebugTimeOut(void *) { return 0; }
+int TSetEditorApp::DebugOptionsAdv() { return 0; }
+void TSetEditorApp::DebugDisAsmWin() {}
+void TSetEditorApp::DebugStackWindow() {}
+void TSetEditorApp::DebugMoveBreakPts() {}
+void TSetEditorApp::DebugDetach() {}
+void DebugSetCPULine(int , char *) {}
+void TSetEditorApp::DebugPoll() {}
+void DebugReadData(ipstream &) {}
+
+void DBG_AddPathForSources(const char *) {}
+
+void DBG_SaveBreakpoints(opstream &os)
+{
+ int32 count=0;
+ // Save them
+ os << bkptsVersion << count;
+}
+
+void DebugSaveData(opstream &os)
+{
+ os << debugDataVersion;
+ // Target options
+ os << (uchar)1;
+ // Type of Messages
+ os << (uchar)msgOps;
+ // Debug window information
+ os << svAbsent;
+ // Watches
+ os << svAbsent;
+ // Watches window information
+ os << svAbsent;
+ // Breakpoints
+ DBG_SaveBreakpoints(os);
+ // No more data
+ os << svAbsent;
+}
+
+#endif // HAVE_GDB_MI
+
+#if 0
+__("Hit a breakpoint")
+__("Write watchpoint")
+__("Read watchpoint")
+__("Access watchpoint")
+__("Watchpoint out of scope")
+__("Function finished")
+__("Location reached")
+__("End of stepping")
+__("Exited signalled")
+__("Exited with error")
+__("Exited normally")
+__("Signal received")
+__("Unknown (temp bkp?)")
+__("natural")
+__("binary")
+__("decimal")
+__("hexadecimal")
+__("octal")
+__("unknown")
+__("Ok")
+__("Out of memory")
+__("Pipe creation")
+__("Fork failed")
+__("GDB not running")
+__("Parser failed")
+__("Unknown asyn response")
+__("Unknown result response")
+__("Error from gdb")
+__("Unknown")
+__("Time out in gdb response")
+__("GDB suddenly died")
+__("Can't execute X terminal")
+__("Failed to create temporal")
+__("Can't execute the debugger")
+#endif
+
diff --git a/setedit/setedit/dskascii.cc b/setedit/setedit/dskascii.cc
new file mode 100644
index 0000000..f4e1e78
--- /dev/null
+++ b/setedit/setedit/dskascii.cc
@@ -0,0 +1,70 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#include <stdio.h>
+#define Uses_TView
+#define Uses_TPoint
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TWindow
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskascii.h>
+
+#define Uses_SETAppVarious
+#include <setapp.h>
+
+#include <ascii.h>
+
+static TDskWinASCII *helper;
+
+TStreamable *TDskWinASCII::build()
+{
+ return new TDskWinASCII(streamableInit);
+}
+
+TDskWinASCII::TDskWinASCII()
+{
+ view=new TAsciiChart();
+ TProgram::deskTop->insert(view);
+ type=dktASCII;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=1;
+ helper=this;
+}
+
+char *TDskWinASCII::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" ASCII chart"));
+ return dest;
+}
+
+TDskWinASCII::~TDskWinASCII()
+{
+ helper=0;
+}
+
+void TDskWinASCII::write(opstream& os)
+{
+ os << (uchar)1 << view->origin << (int)(TProgram::deskTop->indexOf(view));
+}
+
+void *TDskWinASCII::read(ipstream& is)
+{
+ uchar version;
+ TPoint pos;
+ is >> version >> pos >> ZOrder;
+ view=new TAsciiChart();
+ view->moveTo(pos.x,pos.y);
+ helper=this;
+ return this;
+}
+
+void ASCIIWindow()
+{
+ if (helper)
+ helper->view->select();
+ else
+ AddNonEditorToHelper(new TDskWinASCII());
+}
diff --git a/setedit/setedit/dskcalen.cc b/setedit/setedit/dskcalen.cc
new file mode 100644
index 0000000..b13f46a
--- /dev/null
+++ b/setedit/setedit/dskcalen.cc
@@ -0,0 +1,80 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#include <stdio.h>
+#define Uses_string
+#define Uses_TView
+#define Uses_TPoint
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TWindow
+#define Uses_AllocLocal
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskcalen.h>
+
+#define Uses_SETAppVarious
+#include <setapp.h>
+
+#include <calendar.h>
+
+char *strncpyZ(char *dest, const char *orig, int size);
+
+static TDskWinCalendar *helper;
+
+TStreamable *TDskWinCalendar::build()
+{
+ return new TDskWinCalendar(streamableInit);
+}
+
+TDskWinCalendar::TDskWinCalendar()
+{
+ view=new TCalendarWindow();
+ TProgram::deskTop->insert(view);
+ type=dktCalendar;
+ CanBeDeletedFromDisk=0;
+ CanBeSaved=1;
+ helper=this;
+}
+
+char *TDskWinCalendar::GetText(char *dest, short max)
+{
+ char *calendar=TVIntl::getTextNew(__(" Calendar "));
+ int lCal=strlen(calendar);
+ AllocLocalStr(buffer,lCal+40+1);
+ strcpy(buffer,calendar);
+ ((TCalendarWindow *)view)->view->getMonthStr(buffer+lCal,40,0);
+ strncpyZ(dest,buffer,max);
+ DeleteArray(calendar);
+ return dest;
+}
+
+TDskWinCalendar::~TDskWinCalendar()
+{
+ helper=0;
+}
+
+void TDskWinCalendar::write(opstream& os)
+{
+ os << (uchar)1 << view->origin << (int)(TProgram::deskTop->indexOf(view));
+}
+
+void *TDskWinCalendar::read(ipstream& is)
+{
+ uchar version;
+ TPoint pos;
+ is >> version >> pos >> ZOrder;
+ view=new TCalendarWindow();
+ view->moveTo(pos.x,pos.y);
+ helper=this;
+ return this;
+}
+
+void CalendarWindow()
+{
+ if (helper)
+ helper->view->select();
+ else
+ AddNonEditorToHelper(new TDskWinCalendar());
+}
diff --git a/setedit/setedit/dskclip.cc b/setedit/setedit/dskclip.cc
new file mode 100644
index 0000000..f6d56bd
--- /dev/null
+++ b/setedit/setedit/dskclip.cc
@@ -0,0 +1,94 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+
+#define Uses_TApplication
+#define Uses_TStreamable
+#define Uses_TWindow
+#define Uses_TCEditWindow
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <ceditor.h>
+#define Uses_SETAppVarious
+#define Uses_TSetEditorApp
+#include <setapp.h>
+#include <dskwin.h>
+#include <dskclip.h>
+
+TStreamable *TDskWinClipboard::build()
+{
+ return new TDskWinClipboard( streamableInit );
+}
+
+void TDskWinClipboard::write( opstream& os )
+{
+ os << edw->origin << edw->size << (int)(edw->state & sfVisible)
+ << (int)(TProgram::deskTop->indexOf(edw));
+}
+
+void *TDskWinClipboard::read( ipstream& is )
+{
+ TPoint aux;
+
+ // Create a default clipboard
+ TRect r = TProgram::deskTop->getExtent();
+ TCEditWindow *p;
+
+ p = (TCEditWindow *)editorApp->validView( new TCEditWindow( r, 0, wnNoNumber ) );
+ p->hide();
+
+ edw=TSetEditorApp::clipWindow=p;
+ if (TSetEditorApp::clipWindow)
+ {
+ TCEditor::clipboard=TSetEditorApp::clipWindow->editor;
+ TCEditor::clipboard->canUndo=False;
+ }
+
+ // Now restore the last settings
+ is >> aux;
+ TSetEditorApp::clipWindow->moveTo(aux.x,aux.y);
+ is >> aux;
+ TSetEditorApp::clipWindow->growTo(aux.x,aux.y);
+ int vis;
+ is >> vis;
+ if (vis)
+ edw->show();
+ is >> ZOrder;
+ view=edw;
+
+ return this;
+}
+
+char *TDskWinClipboard::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" Clipboard (%d bytes)"),edw->editor->bufLen);
+ return dest;
+}
+
+TDskWinClipboard::TDskWinClipboard(TCEditWindow *EdW)
+{
+ view=edw=EdW;
+ type=dktClipboard;
+ CanBeSaved=1;
+ CanBeDeletedFromDisk=0;
+}
+
+int TDskWinClipboard::DeleteAction(ccIndex, Boolean)
+{
+ edw->hide();
+
+ return 0;
+}
+
+TDskWinClipboard::~TDskWinClipboard()
+{
+ //destroy(edw);
+ edw->close();
+ if (TSetEditorApp::clipWindow==edw)
+ TSetEditorApp::clipWindow=0;
+ edw=0;
+}
+
diff --git a/setedit/setedit/dskclose.cc b/setedit/setedit/dskclose.cc
new file mode 100644
index 0000000..634067c
--- /dev/null
+++ b/setedit/setedit/dskclose.cc
@@ -0,0 +1,103 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+#define Uses_string
+#define Uses_unistd
+
+#define Uses_TApplication
+#define Uses_TStreamable
+#define Uses_TWindow
+#define Uses_TCEditWindow
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TListBox
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <ceditor.h>
+#define Uses_SETAppVarious
+#define Uses_TSetEditorApp
+#include <setapp.h>
+#include <dskwin.h>
+#include <dskclose.h>
+#include <edcollec.h>
+
+TStreamable *TDskWinClosed::build()
+{
+ return new TDskWinClosed( streamableInit );
+}
+
+void TDskWinClosed::write( opstream& os )
+{
+ os.writeString(Name);
+ TCEditWindow::SaveResume(resume,os);
+}
+
+void *TDskWinClosed::read( ipstream& is )
+{
+ char fileName[PATH_MAX];
+ is.readString(fileName,PATH_MAX);
+ Name=newStr(fileName);
+ if (editorApp->deskTopVersion>=0x306)
+ TCEditWindow::ReadResume(resume,is);
+ else
+ {
+ TPoint origin,size,cursor;
+ is >> origin >> size >> cursor;
+ TCEditWindow::FillResumeWith(resume,origin,size,cursor);
+ }
+ ZOrder=-1;
+ view=0;
+
+ return this;
+}
+
+char *TDskWinClosed::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" Closed: "));
+ return TDskWin::GetText(dest,Name,maxLen);
+}
+
+TDskWinClosed::TDskWinClosed(TCEditWindow *edw)
+{
+ Name=newStr(edw->editor->fileName);
+ edw->FillResume(resume);
+ type=dktClosed;
+ CanBeSaved=1;
+ CanBeDeletedFromDisk=1;
+ view=0;
+}
+
+TDskWinClosed::~TDskWinClosed()
+{
+ delete[] Name;
+}
+
+int TDskWinClosed::GoAction(ccIndex i)
+{
+ TCEditWindow *ed;
+
+ // Remove from the closed list
+ TSetEditorApp::edHelper->atRemove(i);
+ TSetEditorApp::edHelper->Closed--;
+ // Lock the desktop to avoid lotz redraws
+ TProgram::deskTop->lock();
+ // Reopen the file
+ ed=editorApp->openEditor(Name,True,&resume);
+ // Indicate the new Top editor
+ setFocusTo=(TView *)ed;
+ focusChanged=True;
+
+ return 1;
+}
+
+int TDskWinClosed::DeleteAction(ccIndex i, Boolean fromDiskToo)
+{
+ if (fromDiskToo)
+ unlink(Name);
+ TSetEditorApp::edHelper->atRemove(i);
+ TSetEditorApp::edHelper->Closed--;
+
+ return 1;
+}
+
diff --git a/setedit/setedit/dskedito.cc b/setedit/setedit/dskedito.cc
new file mode 100644
index 0000000..44726aa
--- /dev/null
+++ b/setedit/setedit/dskedito.cc
@@ -0,0 +1,97 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+#define Uses_unistd
+
+#define Uses_TApplication
+#define Uses_TStreamable
+#define Uses_TWindow
+#define Uses_TCEditWindow
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TListBox
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <ceditor.h>
+#define Uses_SETAppVarious
+#define Uses_TSetEditorApp
+#include <setapp.h>
+#include <dskwin.h>
+#include <dskedito.h>
+#include <edcollec.h>
+
+void RemoveFromEditorsHelper(TCEditWindow *p);
+
+TStreamable *TDskWinEditor::build()
+{
+ return new TDskWinEditor( streamableInit );
+}
+
+void TDskWinEditor::write( opstream& os )
+{
+ os << number << edw << (int)(TProgram::deskTop->indexOf(edw));
+}
+
+void *TDskWinEditor::read( ipstream& is )
+{
+ is >> number >> edw >> ZOrder;
+ edw=(TCEditWindow *)editorApp->validView(edw);
+ if (edw)
+ {
+ edw->number=number;
+ edw->show();
+ // If the file is empty don't put it in the desktop and let the TEditorCollection
+ // close it.
+ view=(edw->editor->FailedToLoad) ? NULL : edw;
+ }
+ else
+ view=NULL;
+
+ return this;
+}
+
+char *TDskWinEditor::GetText(char *dest, short maxLen)
+{
+ TCEditor *ed=edw->editor;
+ sprintf(dest,"%2d%c ",number,ed->isReadOnly ? 'R' : (ed->modified ? '*' : ' '));
+ return TDskWin::GetText(dest,ed->fileName,maxLen);
+}
+
+
+int TDskWinEditor::DeleteAction(ccIndex , Boolean fromDiskToo)
+{
+ // It calls to close, close removes the object from the editor helper
+ // and calls to destroy
+ if (fromDiskToo)
+ {
+ unlink(edw->editor->fileName);
+ // We will be autodestroyed soon, for this reason we can't use the
+ // this pointer anymore. That's why we need a copy (efence reported).
+ TCEditWindow *oldEdw=edw;
+ TSetEditorApp::edHelper->removeEditor(edw,True);
+ CLY_destroy(oldEdw);
+ }
+ else
+ edw->close();
+
+ return 0;
+}
+
+TDskWinEditor::~TDskWinEditor()
+{
+ /* This isn't needed and generated double destroys.
+ destroy(edw);
+ edw=0;*/
+}
+
+int TDskWinEditor::GetNumber()
+{
+ return number;
+}
+
+void TDskWinEditor::SetNumber(int aNumber)
+{
+ edw->number=number=aNumber;
+}
+
diff --git a/setedit/setedit/dskhelp.cc b/setedit/setedit/dskhelp.cc
new file mode 100644
index 0000000..107c30c
--- /dev/null
+++ b/setedit/setedit/dskhelp.cc
@@ -0,0 +1,185 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_string
+#define Uses_TApplication
+#define Uses_TStreamable
+#define Uses_TWindow
+#define Uses_TCEditWindow
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TVCodePage
+#define Uses_TScreen
+// InfView requests
+#include <infr.h>
+#include <ceditor.h>
+#define Uses_SETAppVarious
+#define Uses_TSetEditorApp
+#include <setapp.h>
+#include <dskwin.h>
+#include <dskhelp.h>
+#include <stdio.h>
+#include <edcollec.h>
+
+inline void SetInfManager(TDskWinHelp *p)
+{
+ editorApp->InfManager=p;
+}
+
+inline TDskWinHelp *GetInfManager(void)
+{
+ return editorApp->InfManager;
+}
+
+TStreamable *TDskWinHelp::build()
+{
+ return new TDskWinHelp( streamableInit );
+}
+
+void TDskWinHelp::Goto(char *File, char *Node, char *word)
+{
+ char aux[MAX_NODE_NAME*2];
+ aux[0]='(';
+ aux[1]=0;
+ strcat(aux,File);
+ strcat(aux,")");
+ strcat(aux,Node);
+ window->viewer->switchToTopic(aux);
+ if (word)
+ window->viewer->findInTopic(word);
+}
+
+void TDskWinHelp::write( opstream& os )
+{
+ os << window << (int)(TProgram::deskTop->indexOf(window));
+}
+
+void *TDskWinHelp::read( ipstream& is )
+{
+ // In v0.4.25 I changed the name of the editor's help from editor to setedit. That's
+ // needed to avoid problems under Linux (future ones, not currently). As a draw back
+ // if you load an old desktop file it will scream about 'editor' help file not found
+ // to avoid it I convert the name for old desktop files.
+ if (editorApp->deskTopVersion<0x425)
+ TInfWindow::SetMagicEditorInfoTranslation();
+
+ if (editorApp->deskTopVersion<=0x215)
+ {
+ char File[MAX_NODE_NAME];
+ char Node[MAX_NODE_NAME];
+
+ is.readString(File,MAX_NODE_NAME);
+ is.readString(Node,MAX_NODE_NAME);
+
+ Create(File,Node);
+
+ TPoint aux;
+
+ is >> aux;
+ window->moveTo(aux.x,aux.y);
+ is >> aux;
+ window->growTo(aux.x,aux.y);
+ int vis;
+ is >> vis;
+ if (vis)
+ window->show();
+
+ is >> ZOrder;
+
+ int aux2;
+ is >> aux2;
+ window->isTheOne=aux2 ? True : False;
+ window->options&=~(ofCenterX | ofCenterY);
+
+ if (aux2)
+ SetInfManager(this);
+ }
+ else
+ {
+ is >> window >> ZOrder;
+
+ // Set up the alias pointers
+ file=window->viewer->hFile;
+ view=window;
+
+ // Set-Up the paste
+ window->viewer->InsertRoutine=CopyHelp2Clip;
+
+ if (window->isTheOne)
+ SetInfManager(this);
+ }
+
+ if (editorApp->deskTopVersion<0x425)
+ TInfWindow::ResetMagicEditorInfoTranslation();
+ return this;
+}
+
+char *TDskWinHelp::GetText(char *dest, short maxLen)
+{
+ if (window->isTheOne)
+ TVIntl::snprintf(dest,maxLen,__(" Main InfView (%s)%s"),file->NameOfFile,
+ window->viewer->topic->Node);
+ else
+ TVIntl::snprintf(dest,maxLen,__(" InfView (%s)%s"),file->NameOfFile,
+ window->viewer->topic->Node);
+ return dest;
+}
+
+void TDskWinHelp::Create(char *File, char *Node, Boolean TheOne)
+{
+ file = new TInfFile(File);
+ window = new TInfWindow(file,Node,NULL,CopyHelp2Clip,TheOne);
+ if ((window=(TInfWindow *)editorApp->validView(window))!=0)
+ window->hide();
+ view=window;
+}
+
+void TDskWinHelp::CreateModal(char *File, char *Node)
+{
+ TInfFile *aFile = new TInfFile(File);
+ TInfWindow *aWindow = new TInfWindow(aFile,Node,NULL,CopyHelp2Clip,False);
+ if ((aWindow=(TInfWindow *)editorApp->validView(aWindow))!=0)
+ TProgram::deskTop->execView(aWindow);
+ CLY_destroy(aWindow);
+}
+
+TDskWinHelp::TDskWinHelp(char *File, char *Node, Boolean TheOne)
+{
+ Create(File,Node,TheOne);
+ type=dktHelp;
+ CanBeSaved=1;
+ CanBeDeletedFromDisk=0;
+}
+
+TDskWinHelp::~TDskWinHelp()
+{
+ //if (file)
+ // delete file; Wrong! that's part of the view too I realized under Linux
+ if (GetInfManager()==this)
+ {
+ SetInfManager(0);
+ // The main InfView is never closed, just hided, now is time to kill it
+ //destroy(window);
+ window->close();
+ }
+ file=0;
+ window=0;
+}
+
+int TDskWinHelp::DeleteAction(ccIndex, Boolean)
+{
+ if (window->isTheOne)
+ window->hide();
+ else
+ closeView(window,NULL);
+
+ return 0;
+}
+
+void TDskWinHelp::MakeVisible(void)
+{
+ window->select();
+ window->show();
+}
+
+
diff --git a/setedit/setedit/dskman.cc b/setedit/setedit/dskman.cc
new file mode 100644
index 0000000..c93130f
--- /dev/null
+++ b/setedit/setedit/dskman.cc
@@ -0,0 +1,86 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define Uses_string
+#define Uses_unistd
+class TRect;
+#define Uses_TDialog
+#define Uses_TPoint
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TScroller
+#define Uses_TNSCollection
+#define Uses_MsgBox
+
+#include <tv.h>
+
+#include <dskwin.h>
+#include <dskman.h>
+
+#define Uses_TManWindow
+#define Uses_TManPageView
+#define Uses_TEnhancedText
+#include <manview.h>
+
+#define Uses_SETAppDialogs
+#define Uses_SETAppVarious
+#include <setapp.h>
+
+#include <rhutils.h>
+
+extern TView *setFocusTo;
+extern Boolean focusChanged;
+
+TStreamable *TDskWinMan::build()
+{
+ return new TDskWinMan(streamableInit);
+}
+
+void TDskWinMan::write(opstream& os)
+{
+ TManWindow *mw=(TManWindow *)view;
+ os << mw << (int)(TProgram::deskTop->indexOf(mw));
+}
+
+void *TDskWinMan::read(ipstream& is)
+{
+ TManWindow *mw;
+ is >> mw >> ZOrder;
+ view=mw;
+
+ return this;
+}
+
+char *TDskWinMan::GetText(char *dest, short maxLen)
+{
+ TManWindow *mw=(TManWindow *)view;
+ TVIntl::snprintf(dest,maxLen,__(" Man page: %s"),mw->getFileName());
+ return dest;
+}
+
+TDskWinMan::TDskWinMan(const char *file, const char *sections, const char *extraOps)
+{
+ type=dktMan;
+ CanBeSaved=1;
+ CanBeDeletedFromDisk=0;
+ view=CreateManWindow(file,sections,extraOps,CopyHelp2Clip);
+}
+
+TDskWinMan::~TDskWinMan()
+{
+}
+
+TDskWinMan *ManPageView(const char *name)
+{
+ ManPageOptions *op;
+ TDialog *d=ManPageViewSelect(name,&op);
+ TDskWinMan *ret=0;
+ if (execDialog(d,op)==cmOK)
+ {
+ ret=new TDskWinMan(op->program,op->section,op->options);
+ }
+ return ret;
+}
+
diff --git a/setedit/setedit/dskmessa.cc b/setedit/setedit/dskmessa.cc
new file mode 100644
index 0000000..962c8b7
--- /dev/null
+++ b/setedit/setedit/dskmessa.cc
@@ -0,0 +1,107 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+class TRect;
+class TSOSListBox;
+#define Uses_TDialog
+#define Uses_TPoint
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TApplication
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <ceditor.h>
+#include <edmsg.h>
+#include <dskwin.h>
+#include <dskmessa.h>
+#define Uses_TSetEditorApp
+#include <setapp.h>
+
+extern TView *setFocusTo;
+extern Boolean focusChanged;
+
+TStreamable *TDskWinMessage::build()
+{
+ return new TDskWinMessage( streamableInit );
+}
+
+void TDskWinMessage::write( opstream& os )
+{
+ TEdMsgDialog *edw=(TEdMsgDialog *)view;
+ os << edw->origin << edw->size << (int)(edw->state & sfVisible)
+ << edw->zoomRect
+ << (int)(TProgram::deskTop->indexOf(edw));
+}
+
+void *TDskWinMessage::read( ipstream& is )
+{
+ TPoint aux;
+
+ TEdMsgDialog *edw=EdMessageWindowInit(0);
+
+ // Now restore the last settings
+ is >> aux;
+ TRect r=TProgram::deskTop->getExtent();
+ // Don't let it outside the screen
+ if (TSetEditorApp::geFlags & geVertWindows)
+ {
+ if (TSetEditorApp::geFlags & geRightSide)
+ {
+ if (aux.x>=r.b.x)
+ aux.x=r.b.x-TSetEditorApp::widthVertWindows;
+ }
+ else
+ {
+ if (aux.x>=r.b.x)
+ aux.x=0;
+ }
+ if (aux.y>=r.b.y)
+ aux.y=0;
+ }
+ else
+ {
+ if (aux.x>=r.b.x)
+ aux.x=0;
+ if (aux.y>=r.b.y)
+ aux.y=r.b.y-7;
+ }
+ edw->moveTo(aux.x,aux.y);
+ is >> aux;
+ edw->growTo(aux.x,aux.y);
+ int vis;
+ is >> vis;
+/* if (vis)
+ edw->show();
+ else // It doesn't have any sense, if the window is visible and without messages...*/
+ edw->hide();
+ is >> edw->zoomRect >> ZOrder;
+ view=edw;
+
+ return this;
+}
+
+char *TDskWinMessage::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" Message Window (%d lines)"),EdMessageCantMessages());
+ return dest;
+}
+
+TDskWinMessage::TDskWinMessage(TEdMsgDialog *w)
+{
+ view=w;
+ type=dktMessage;
+ CanBeSaved=1;
+ CanBeDeletedFromDisk=0;
+}
+
+int TDskWinMessage::DeleteAction(ccIndex, Boolean)
+{
+ view->hide();
+ return 0;
+}
+
+TDskWinMessage::~TDskWinMessage()
+{
+}
+
diff --git a/setedit/setedit/dskmp3.cc b/setedit/setedit/dskmp3.cc
new file mode 100644
index 0000000..c9db40b
--- /dev/null
+++ b/setedit/setedit/dskmp3.cc
@@ -0,0 +1,90 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+
+#include <stdio.h>
+class TRect;
+#define Uses_TView
+#define Uses_TPoint
+#define Uses_TProgram
+#define Uses_TDeskTop
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskmp3.h>
+
+// setFocusTo and focusChanged
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <intermp3.h>
+#include <mixer.h>
+
+TStreamable *TDskWinMP3::build()
+{
+ return new TDskWinMP3(streamableInit);
+}
+
+TDskWinMP3::TDskWinMP3(TView *w)
+{
+ view=w;
+ type=dktMP3;
+ CanBeDeletedFromDisk=0;
+ // Before the MP3 engine
+ BoardMixerInit();
+#ifdef SUP_MP3
+ CanBeSaved=1;
+#else
+ CanBeSaved=0;
+#endif
+}
+
+char *TDskWinMP3::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" MP3 Control panel"));
+ return dest;
+}
+
+int TDskWinMP3::GoAction(ccIndex pos)
+{
+ TDskWin::GoAction(pos);
+ CanBeSaved=1;
+ return 0;
+}
+
+int TDskWinMP3::DeleteAction(ccIndex, Boolean)
+{
+ view->hide();
+ CanBeSaved=0;
+ return 0;
+}
+
+TDskWinMP3::~TDskWinMP3()
+{
+}
+
+#ifdef SUP_MP3
+void TDskWinMP3::write(opstream& os)
+{
+ if (!CanBeSaved)
+ return;
+
+ MP3WriteInfo(os,view);
+}
+
+void *TDskWinMP3::read(ipstream& is)
+{
+ // Before the MP3 engine
+ BoardMixerInit();
+ view=MP3ReadInfo(is,ZOrder,this);
+ return this;
+}
+#else
+void TDskWinMP3::write(opstream& )
+{
+}
+
+void *TDskWinMP3::read(ipstream& is)
+{
+ view=MP3ReadInfo(is,ZOrder,this);
+ return this;
+}
+#endif
diff --git a/setedit/setedit/dskwin.cc b/setedit/setedit/dskwin.cc
new file mode 100644
index 0000000..6d5afaf
--- /dev/null
+++ b/setedit/setedit/dskwin.cc
@@ -0,0 +1,265 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]**********************************************************************
+
+ Module: Desktop Windows Helper
+ Comments:
+ This classes are used to handle the windows of the editor. All are based
+on an abstract class called @x{TDskWin (class)}. This class provides the
+basic structure for all the windows supported in the editor.
+@p
+ In addition the editor uses a class called @x{TEditorCollection (class)},
+to hold the windows. This structure basically complements the concept of
+the desktop in TVision. From my point of view it could be part of the
+TDeskTop class.
+@p
+ The editor uses it:
+@p
+@<pre>
+ extern TEditorCollection *edHelper;
+@</pre>
+ Then the windows are inserted using:
+@p
+@<pre>
+ edHelper->addEditor(p,SelectHL);
+@</pre>
+for editors and:
+@p
+@<pre>
+ edHelper->addNonEditor(p);
+@</pre>
+for non editors.
+@p
+ For more information see the classes named above.
+
+***********/
+/**[txh]****
+
+ Class: TDskWin
+ Comments:
+ That's the base class for all the desktop helper windows. All the members
+are undefined except @x{TDskWin::GetText}.
+@p
+ The class is derived from TStreamable and helps to save any window in the
+desktop even when the window isn't a TStreamable one.
+@p
+@<subtitle>{Data members:}
+@<pre>
+int type;
+@</pre>
+ Is the type of the object. One important thing of this classes is that you
+can know to what class belongs each object. That's used for example to search
+a window of some kind exluding the rest.
+@p
+@<pre>
+int CanBeSaved;
+@</pre>
+ It says if the window can be saved to disk. Some special windows like
+the project window aren't saved with the rest.
+@p
+@<pre>
+int ZOrder;
+@</pre>
+ This value is used to restore the exact position of the window when reading
+a desktop file from disk.
+@p
+@<pre>
+TView *view;
+@</pre>
+ Point to the view of the window. Generally the derived classes have
+another member to use internally and with the correct type.
+
+*****************************************************************************/
+
+#define Uses_string
+#define Uses_TStreamable
+#define Uses_TProgram
+#define Uses_TDeskTop
+#include <ceditor.h>
+
+#include <dskwin.h>
+
+#define Uses_SETAppVarious
+#include <setapp.h> // closeView
+
+/**[txh]**********************************************************************
+
+ Function: GetText (3 vals)
+ Include: dskwin.h
+ Description:
+ The GetText member is used by the TListEditors to provide a
+description of the window in the List of windows dialog.
+See: @x{TListEditors (class)}.
+@p
+ This version is used to concatenate the contents of s with the dest
+contents without exceding maxLen. Is called by various of the derived
+classes. Isn't the one called by TListEditors.
+
+ Return:
+ A char pointer to the description of the window.
+
+*****************************************************************************/
+
+char *TDskWin::GetText(char *dest,char *s, short maxLen)
+{
+ int max=maxLen-strlen(dest);
+ int l=strlen(s);
+ if (l>=max)
+ {
+ strncat(dest,s,max);
+ dest[maxLen]=0;
+ }
+ else
+ strcat(dest,s);
+
+ return dest;
+}
+
+/**[txh]**********************************************************************
+
+ Function: GoAction
+ Prototype: int GoAction(ccIndex i)
+ Description:
+ This member is called when the user selects the Go button in the List of
+Windows dialog. It must select the window. This task is made in an indirect
+way using:
+@p
+@<pre>
+extern TView *setFocusTo;
+extern Boolean focusChanged;
+
+int TDskWinHelp::GoAction(ccIndex )
+{
+ TProgram::deskTop->lock();
+ setFocusTo=window;
+ focusChanged=True;
+
+ return 0;
+}
+@</pre>
+
+ But can be very different like in the case of the @x{TDskWinClosed (class)},
+where this action opens a previously closed editor.
+
+ Return:
+ 1 if the object must be deleted. That's used by closed windows.
+
+**************/
+
+int TDskWin::GoAction(ccIndex )
+{
+ TProgram::deskTop->lock();
+ setFocusTo=view;
+ focusChanged=True;
+
+ return 0;
+}
+
+/**[txh]*******
+
+ Description:
+ This member is called when the user selects the Delete button in the List of
+Windows dialog. It can close the window, hide it or remove it. The default
+behavior is call closeView passing the TView pointer.@p
+ The arguments are the position in the list and a Boolean value indicating
+if the associated file in disk must be deleted too.
+
+Return:
+ 1 if the object must be destroyed.
+
+**************/
+
+int TDskWin::DeleteAction(ccIndex, Boolean)
+{
+ closeView(view,0);
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to know the number of the window associated with it.
+
+ Return: The number of the window or a negative value if it doesn't have
+a number. The negative value is -type.
+
+***************************************************************************/
+
+int TDskWin::GetNumber()
+{
+ return -type;
+}
+
+/**[txh]*******
+
+ Function: Compare
+ Prototype: int Compare(void *view, int type)
+ Description:
+ Is used during searchs. If the view is the one owned by the class and
+the type is the right it must return a non zero value.
+
+ Return:
+ Non zero if the requested object is this.
+
+**************/
+/**[txh]*******
+
+ Function: GetText
+ Prototype: char *GetText(char *dest, short maxLen)
+ Description:
+ The GetText member is used by the TListEditors class to provide a
+description of the window in the List of windows dialog.
+See @x{TListEditors (class)}.
+@p
+ This version is the virtual one. It must copy to dest the description of
+the window limiting it to maxLen.
+
+ Return:
+ A char pointer to the description of the window.
+
+*****************************************************************************/
+
+void InsertInOrder(TDeskTop *dsk,TDskWin *win)
+{
+ int z=win->ZOrder;
+ TView *v=0;
+
+ if (z>=0)
+ {
+ if (z==0)
+ dsk->insertBefore(win->view,0);
+ else
+ {
+ v=dsk->at(z);
+ dsk->insertBefore(win->view,v);
+ }
+ }
+ else
+ dsk->insert(win->view);
+}
+
+void AddAndInsertDskWin(TDskWin *win)
+{
+ AddNonEditorToHelper(win);
+ InsertInOrder(TProgram::deskTop,win);
+}
+
+void TDskWin::write(opstream& os)
+{
+}
+
+void *TDskWin::read(ipstream& is)
+{
+ return this;
+}
+
+const char *TDskWin::streamableName() const
+{
+ return NULL;
+}
+
+int TDskWin::Compare(void *p, int t)
+{
+ return (t==type) && p==(void *)view;
+}
+
diff --git a/setedit/setedit/dstfile.cc b/setedit/setedit/dstfile.cc
new file mode 100644
index 0000000..48bdeaa
--- /dev/null
+++ b/setedit/setedit/dstfile.cc
@@ -0,0 +1,1474 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+//#define DEBUG
+#include <ceditint.h>
+
+#define Uses_fcntl
+#include <sys/stat.h> /* for mode definitions */
+#define Uses_dirent
+#define Uses_fnmatch
+#ifdef TVCompf_djgpp
+#include <dir.h>
+#endif
+
+#define Uses_string
+#define Uses_MsgBox
+#define Uses_fpstream
+#define Uses_TDeskTop
+#define Uses_TRect
+#define Uses_TApplication
+#define Uses_TListBox
+#define Uses_TPalette
+#define Uses_TScreen
+#define Uses_TGKey
+#define Uses_TCEditor_Internal
+#define Uses_TCEditWindow
+#define Uses_FileOpenAid
+#define Uses_TDeskTopClock
+#define Uses_TStringCollectionW
+#define Uses_TFileCollection
+#define Uses_TSOSListBox
+#define Uses_TVCodePage
+#define Uses_TScOptsCol
+#define Uses_TVFontCollection
+#define Uses_TVConfigFile
+#define Uses_TStreamableClass
+// InfView requests
+#include <infr.h>
+#include <ceditor.h>
+
+#define Uses_TSetEditorApp
+#define Uses_SETAppProject
+#define Uses_SETAppVarious
+#define Uses_SETAppFiles
+#include <setapp.h>
+
+#include <errno.h>
+#include <dskwin.h>
+#include <dskclip.h>
+#include <dskhelp.h>
+#include <edcollec.h>
+#include <tpaltext.h>
+#include <edprint.h>
+#include <ssyntax.h>
+#include <pathtool.h>
+#include <codepage.h>
+#include <mixer.h>
+#include <edspecs.h>
+#include <pathlist.h>
+#define Uses_TSOSListBoxMsg
+#include <edmsg.h>
+#include <tags.h>
+
+//#define DEBUG_CONFIG_TREE
+
+// Used by edprj.cc to know if we loaded the desktop file from this directory
+char DstLoadedHere=0;
+
+extern char *EditorFile;
+
+// Desktop file name
+const char *cDeskTopFileName=DeskTopFileName;
+#ifdef HIDDEN_DIFFERENT
+const char *cDeskTopFileNameHidden=DeskTopFileNameHidden;
+#endif
+static char *Signature="TEditorApp desktop file\x1A";
+const int EditorsDelta=10;
+const char *defaultDrvName="_Default";
+
+// Default Installation Options variables
+typedef struct
+{
+ const char *option;
+ int len,value;
+} stOption;
+
+static stOption Options[]=
+{
+ {"CentralDesktopFile",18,0},
+ {"TabsForIndent",13,0},
+ {"CreateBackUps",13,1}
+};
+
+const int numOptions=sizeof(Options)/sizeof(stOption);
+const char *dioFile="install.log";
+const int dioMaxLine=PATH_MAX;
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads settings configured during installation process. They are just a few
+general and important options.
+
+***************************************************************************/
+
+static
+void LoadInstallationDefaults()
+{
+ char *name=ExpandHome(dioFile);
+ FILE *f=fopen(name,"rt");
+ if (!f)
+ return;
+ char b[dioMaxLine],*s;
+ int i;
+ do
+ {
+ if (fgets(b,dioMaxLine,f) && *b!='#')
+ {
+ for (s=b; *s && ucisspace(*s); s++); // Eat spaces
+ for (i=0; i<numOptions; i++)
+ if (strncasecmp(s,Options[i].option,Options[i].len)==0)
+ break;
+ if (i!=numOptions)
+ {
+ s+=Options[i].len;
+ // Move after =
+ for (; *s && *s!='='; s++);
+ if (*s) s++;
+ for (; *s && ucisspace(*s); s++);
+ // Get the option
+ Options[i].value=*s=='1';
+ }
+ }
+ }
+ while (!feof(f));
+ fclose(f);
+
+ // CentralDesktopFile
+ if (Options[0].value)
+ EnvirResetBits("SET_CREATE_DST",dstCreate);
+ else
+ EnvirSetBits("SET_CREATE_DST",dstCreate);
+
+ // TabsForIndent
+ if (Options[1].value)
+ {
+ TCEditor::staticUseTabs=True;
+ TCEditor::staticAutoIndent=True;
+ TCEditor::staticIntelIndent=False;
+ TCEditor::staticOptimalFill=True;
+ TCEditor::staticNoInsideTabs=True;
+ TCEditor::staticTabIndents=False;
+ TCEditor::staticUseIndentSize=False;
+ TCEditor::staticBackSpUnindents=False;
+ }
+ else
+ {
+ TCEditor::staticUseTabs=False;
+ TCEditor::staticAutoIndent=True;
+ TCEditor::staticIntelIndent=False;
+ TCEditor::staticOptimalFill=False;
+ TCEditor::staticNoInsideTabs=True;
+ TCEditor::staticTabIndents=True;
+ TCEditor::staticUseIndentSize=False;
+ TCEditor::staticBackSpUnindents=True;
+ }
+
+ // CreateBackUps
+ if (Options[2].value)
+ TCEditor::editorFlags|=efBackupFiles;
+ else
+ TCEditor::editorFlags&=~efBackupFiles;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Helper function that looks for projects in the current directory. The name
+of the last found is stored in prjName.
+
+ Return: The number of projects found.
+
+***************************************************************************/
+
+static
+int LookForProjects(char *prjName)
+{
+ DIR *d;
+ d=opendir(".");
+
+ if (d)
+ {
+ struct dirent *de;
+ int c=0;
+ while ((de=readdir(d))!=0)
+ {
+ if (fnmatch("*" ProjectFileExt,de->d_name,0))
+ continue;
+ if (c==0)
+ {
+ strcpy(prjName,de->d_name);
+ c++;
+ }
+ else
+ {
+ c++;
+ break;
+ }
+ }
+ closedir(d);
+ return c;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Looks for a desktop file and loads it. The @var{LoadPrj} argument says if
+we are also looking for a project (0 when loaded the desktop associated to
+a desktop), the suggestedName is tested before trying to load. The
+@var{haveFilesCL} argument indicates if we have files specified listed in
+the command line. The @var{preLoad} argument indicates if we are pre-loading
+a desktop file to determine default screen options.
+
+***************************************************************************/
+
+void TSetEditorApp::loadEditorDesktop(int LoadPrj, char *suggestedName,
+ int haveFilesCL, int preLoad)
+{
+ TEditorCollection::HaveFilesCL=haveFilesCL;
+ DstLoadedHere=0;
+
+ // 0) If the user forces a project load it or if that's impossible create it
+ if (suggestedName && CLY_ValidFileName(suggestedName))
+ {
+ OpenProject(suggestedName,preLoad);
+ return;
+ }
+ // 1) Look for project files.
+ if (LoadPrj)
+ {
+ char prjName[PATH_MAX];
+ // If there are only one project
+ if (LookForProjects(prjName)==1)
+ {// Look again for the desktop
+ OpenProject(prjName,preLoad);
+ return;
+ }
+ }
+ // 2) Try with the desktop file here
+ if (edTestForFile(cDeskTopFileName))
+ {
+ if (retrieveDesktop(editorApp,cDeskTopFileName,True,preLoad))
+ {
+ DstLoadedHere=1;
+ return;
+ }
+ }
+ #ifdef HIDDEN_DIFFERENT
+ // 2.2) Same for hidden version
+ if (edTestForFile(cDeskTopFileNameHidden))
+ {
+ if (retrieveDesktop(editorApp,cDeskTopFileNameHidden,True,preLoad))
+ {
+ DstLoadedHere=1;
+ return;
+ }
+ }
+ #endif
+ // 3) Try with the default desktop file
+ char *s=ExpandHome(cDeskTopFileName);
+ if (edTestForFile(s))
+ {
+ if (retrieveDesktop(editorApp,(const char *)s,False,preLoad))
+ return;
+ }
+ #ifdef HIDDEN_DIFFERENT
+ // 3.2) Same for hidden
+ s=ExpandHome(cDeskTopFileNameHidden);
+ if (edTestForFile(s))
+ {
+ if (retrieveDesktop(editorApp,(const char *)s,False,preLoad))
+ return;
+ }
+ #endif
+ retrieveDesktop(editorApp,NULL,False,preLoad);
+ LoadInstallationDefaults();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This call back is used by TV to indicate which driver was detected. The
+driver isn't initialized yet, so we can set default options for the driver
+here.
+
+***************************************************************************/
+
+void TSetEditorApp::displayDetectCallBack()
+{
+ const char *drv=TScreen::getDriverShortName();
+ ccIndex pos;
+ int adjustVideoMode=0;
+
+ // Make "so" member point to a valid set of options
+ if (soCol->search((void *)drv,pos))
+ {
+ // Ok, we had the options for this driver
+ so=(stScreenOptions *)soCol->at(pos);
+ // The following is needed only if the desktop file was damaged by v0.5.0 to 0.5.2
+ if (!TScreen::codePageVariable())
+ {// This driver have a fixed screen code page, we must use it.
+ so->enForceScr=0;
+ }
+ }
+ else
+ {// We don't know about it ...
+ if (soCol->search((void *)defaultDrvName,pos))
+ {// but we have defaults, associate them with this driver
+ so=(stScreenOptions *)soCol->at(pos);
+ DeleteArray(so->driverName);
+ so->driverName=newStr(drv);
+ if (!TScreen::codePageVariable())
+ {// This driver have a fixed screen code page, we must use it.
+ so->enForceScr=0;
+ }
+ adjustVideoMode=1;
+ }
+ else
+ {// do we have at least one set of options?
+ if (soCol->getCount()==0)
+ {// Nope, so just create a default group of settings.
+ so=new stScreenOptions;
+ memset(so,0,sizeof(stScreenOptions));
+ so->driverName=newStr(drv);
+ so->enApp=so->enScr=so->enSnd=so->enInp=-1;
+ so->foPriW=8; so->foPriH=16;
+ so->scCharWidth=8; so->scCharHeight=16;
+ so->scModeNumber=3;
+ so->scWidth=80; so->scHeight=25;
+ soCol->Insert(so);
+ }
+ else
+ {// yes, use the first available
+ stScreenOptions *reference=(stScreenOptions *)soCol->at(0);
+ so=new stScreenOptions;
+ memcpy(so,reference,sizeof(stScreenOptions));
+ adjustVideoMode=strcmp(so->driverName,"DOS")==0 && strcmp(drv,"DOS")!=0;
+ so->driverName=newStr(drv);
+ #define CP(a) if (reference->a) so->a=newStr(reference->a);
+ CP(foPriName);
+ CP(foSecName);
+ CP(scCommand);
+ #undef CP
+ if (!TScreen::codePageVariable())
+ {// This driver have a fixed screen code page, we must use it.
+ so->enForceScr=0;
+ }
+ transferSetting2TV(so);
+ soCol->Insert(so);
+ }
+ }
+ }
+
+ // Now fill the needed fields
+ int setCallBack=0;
+ TVBitmapFontDescCol *fonts=NULL;
+ // Get the list of available fonts
+ if ((so->foPriLoad && so->foPriName) || (so->foSecLoad && so->foSecName))
+ fonts=TVFontCollection::CreateListOfFonts(GetVariable("SET_FILES"));
+ if (so->foPriLoad && so->foPriName)
+ {// We want a primary font
+ // Search the file name
+ if (fonts->search(so->foPriName,pos))
+ {// Ok!
+ so->foPriFile=newStr(((TVBitmapFontDesc *)fonts->at(pos))->file);
+ // Create a collection of fonts using the encoding we used last run
+ so->foPri=new TVFontCollection(so->foPriFile,so->enScr);
+ if (so->foPri->GetError())
+ {// We failed to load the file :-(
+ delete so->foPri;
+ so->foPri=NULL;
+ }
+ else
+ // Got the fonts, hook the font requester
+ setCallBack=1;
+ }
+ }
+ // Same for secondary font
+ if (so->foSecLoad && so->foSecName)
+ {
+ if (fonts->search(so->foSecName,pos))
+ {
+ so->foSecFile=newStr(((TVBitmapFontDesc *)fonts->at(pos))->file);
+ so->foSec=new TVFontCollection(so->foSecFile,so->enSnd);
+ if (so->foSec->GetError())
+ {
+ delete so->foSec;
+ so->foSec=NULL;
+ }
+ else
+ setCallBack=1;
+ }
+ }
+ if (setCallBack && !so->foCallBackSet)
+ {
+ TScreen::setFontRequestCallBack(FontRequestCallBack);
+ so->foCallBackSet=1;
+ }
+ CLY_destroy(fonts);
+
+ if (adjustVideoMode && so->scOptions==scfMode)
+ {// These settings come from DOS. Is much better to indicate resolutions.
+ unsigned w, h;
+ int fW, fH;
+ if (TDisplay::searchDOSModeInfo(so->scModeNumber,w,h,fW,fH))
+ {
+ so->scOptions=scfForced;
+ so->scWidth=w; so->scHeight=h;
+ so->scCharWidth=fW; so->scCharHeight=fH;
+ TVMainConfigFile::Add(drv,"ScreenWidth",w);
+ TVMainConfigFile::Add(drv,"ScreenHeight",h);
+ TVMainConfigFile::Add(drv,"FontWidth",fW);
+ TVMainConfigFile::Add(drv,"FontHeight",fH);
+ }
+ }
+ #ifdef DEBUG_CONFIG_TREE
+ fprintf(stderr,"TV config:\n");
+ TVMainConfigFile::Print(stderr);
+ #endif
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Called when we loaded a desktop v0.5.0+ without preload. That's when we
+close a project or open a new one.
+
+***************************************************************************/
+
+void TSetEditorApp::hotApplyScreenOptions()
+{// The following ensures so points to a valid set of options.
+ displayDetectCallBack();
+ // Ensure a simple state:
+ TScreen::restoreFonts();
+ // Code pages:
+ if (so->enForceApp || so->enForceScr || so->enForceInp)
+ TVCodePage::SetCodePage(so->enForceApp ? so->enApp : -1,
+ so->enForceScr ? so->enScr : -1,
+ so->enForceInp ? so->enInp : -1);
+ // Video mode:
+ fontCreated=0;
+ if (!so->foCallBackSet)
+ {
+ TScreen::setFontRequestCallBack(FontRequestCallBack);
+ so->foCallBackSet=1;
+ }
+ PreparePalForRestore(so->palette);
+ if (so->scOptions!=scfDontForce && TScreen::canSetVideoSize())
+ resetVideoMode();
+ else
+ RestorePaletteSystem();
+ // Fonts: fontCreated, should be loaded during the
+ if (!fontCreated && (so->foPriLoad || so->foSecLoad))
+ {
+ TScreenFont256 primary,secondary,*prF=NULL,*seF=NULL;
+ if (so->foPriLoad && so->foPri)
+ {
+ primary.w=so->foPriW;
+ primary.h=so->foPriH;
+ primary.data=so->foPri->GetFont(so->foPriW,so->foPriH);
+ if (primary.data)
+ prF=&primary;
+ }
+ if (so->foSecLoad && so->foSec)
+ {
+ secondary.w=so->foPriW;
+ secondary.h=so->foPriH;
+ secondary.data=so->foSec->GetFont(so->foPriW,so->foPriH);
+ if (secondary.data)
+ seF=&secondary;
+ }
+ TScreen::setFont(prF ? 1 : 0,prF,seF ? 1 : 0,seF,so->enScr);
+ if (prF) DeleteArray(prF->data);
+ if (seF) DeleteArray(seF->data);
+ }
+}
+
+void TSetEditorApp::preLoadDesktop(char *name, int haveFilesCL)
+{
+ if (!soCol)
+ {
+ soCol=new TScOptsCol();
+ TDisplay::setDetectCallBack(displayDetectCallBack);
+ }
+ so=NULL;
+ loadEditorDesktop(1,name,haveFilesCL,1);
+}
+
+void TSetEditorApp::finishPreLoadDesktop()
+{// We are initialized, now ask the palette system to read the actual palette
+ CacheActualPalette();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Restores the previously stored Desktop. The @var{preLoad} argument
+indicates if we just want to load the information needed before starting the
+application (screen options).
+
+***************************************************************************/
+
+Boolean TSetEditorApp::retrieveDesktop(TSetEditorApp *app, const char *name,
+ Boolean isLocal, int preLoad)
+{
+ Boolean ret=False;
+ if (name)
+ {
+ #ifdef BROKEN_CPP_OPEN_STREAM
+ // In this way we avoid the destruction of the file
+ int h=open(name,O_RDONLY | O_BINARY);
+ fpstream *f=new fpstream(h);
+ #else
+ fpstream *f=new fpstream(name,CLY_IOSIn | CLY_IOSBin);
+ #endif
+
+ if (!f)
+ {
+ if (!preLoad)
+ messageBox(__("Could not open desktop file"), mfOKButton | mfError);
+ }
+ else
+ {
+ if (preLoad)
+ ret=preLoadDesktop(*f);
+ else
+ ret=app->loadDesktop(*f,isLocal);
+ if (!f)
+ {
+ if (!preLoad)
+ messageBox(__("Error reading desktop file"), mfOKButton | mfError);
+ ret=False;
+ }
+ f->close();
+ }
+ delete f;
+ }
+ if (preLoad || !app)
+ return ret;
+
+ // Create all the necesary things if there is no desktop file
+ if (!edHelper)
+ edHelper=new TEditorCollection(EditorsDelta*2,EditorsDelta);
+
+ if (!clipWindow)
+ {
+ app->createClipBoard();
+ if (clipWindow)
+ edHelper->addNonEditor(new TDskWinClipboard(clipWindow));
+ }
+
+ if (!InfManager)
+ {
+ InfManager=new TDskWinHelp(EditorFile,"",True);
+ if (InfManager && InfManager->window)
+ {
+ deskTop->insert(InfManager->window);
+ edHelper->addNonEditor(InfManager);
+ }
+ }
+ return ret;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Saves the DeskTop by calling storeDesktop function
+
+***************************************************************************/
+
+void TSetEditorApp::saveDesktop(const char *fName, int makeBkp)
+{
+ if (makeBkp && edTestForFile(fName))
+ {// Try to keep the original file
+ char backupName[PATH_MAX];
+ strcpy(backupName,fName);
+ ReplaceExtension(backupName,".bkp");
+ rename(fName,backupName);
+ }
+ #ifdef BROKEN_CPP_OPEN_STREAM
+ int h=open(fName,O_WRONLY | O_BINARY | O_CREAT | O_TRUNC,S_IWUSR | S_IRUSR);
+ if (h<0) return;
+ fpstream *f=new fpstream(h);
+
+ dbprintf("Opened %s file, got %d handle\n",fName,h);
+ #else
+ fpstream *f=new fpstream(fName,CLY_IOSOut | CLY_IOSBin);
+ #endif
+
+ if (f)
+ {
+ TSetEditorApp::storeDesktop(*f);
+ if (!f)
+ {
+ messageBox(mfOKButton | mfError,__("Could not create %s."),fName);
+ f->close();
+ ::remove(fName);
+ }
+ else
+ f->close();
+ }
+ else
+ {
+ dbprintf("Fail! the fpstream object is unusable\n");
+ }
+ delete f;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Saves the palette information to disk, you must specify which of the three
+palettes must be saved.
+
+***************************************************************************/
+
+static
+void SavePalette(int what, fpstream& s)
+{
+ int oldMode=TProgram::appPalette;
+ // Select the mode to save
+ TProgram::appPalette=what;
+ // Save the palette
+ TPalette &palette=TProgram::application->getPalette();
+ int len=palette.data[0];
+ s << len;
+ s.writeBytes(&palette.data[1],len);
+ // Restore the mode
+ TProgram::appPalette=oldMode;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Stores the Desktop in a resource file.
+
+***************************************************************************/
+
+void TSetEditorApp::storeDesktop(fpstream& s)
+{
+ int i,j,c;
+ // Save a signature to identify the file
+ s.writeString(Signature);
+ // Save the version
+ s << TCEDITOR_VERSION;
+
+ // Save the video mode & font, first to avoid a lot of redraw
+ if (soCol)
+ {
+ if (so)
+ {// Refresh the information in the structure
+ if (so->scOptions==scfForced && !TScreen::canSetVideoSize())
+ so->scOptions=scfSameLast; // can't be forced ;-)
+ if (so->scOptions!=scfForced)
+ {
+ so->scWidth =TScreen::getCols();
+ so->scHeight=TScreen::getRows();
+ unsigned w,h;
+ if (TScreen::getFontGeometry(w,h))
+ {
+ so->scCharWidth=w;
+ so->scCharHeight=h;
+ }
+ }
+ ComputeChangedStatus();
+ so->palChanged=PaletteWasChanged();
+ if (so->palChanged)
+ PaletteCopy(so->palette);
+ }
+ s << (char)1 << soCol;
+ }
+ else
+ s << (char)0;
+ // Now the 3 palettes for same reason
+ SavePalette(apColor,s);
+ SavePalette(apMonochrome,s);
+ SavePalette(apBlackWhite,s);
+
+ s << TCEditor::staticTabSize
+ << TCEditor::staticIndentSize
+ << uchar(TCEditor::staticAutoIndent)
+ << uchar(TCEditor::staticIntelIndent)
+ << uchar(TCEditor::staticUseTabs)
+ << uchar(TCEditor::staticPersistentBlocks)
+ << uchar(TCEditor::staticCrossCursorInRow)
+ << uchar(TCEditor::staticCrossCursorInCol)
+ << uchar(TCEditor::staticShowMatchPair)
+ << uchar(TCEditor::staticShowMatchPairFly)
+ << uchar(TCEditor::staticTransparentSel)
+ << uchar(TCEditor::staticOptimalFill)
+ << uchar(TCEditor::staticNoMoveToEndPaste)
+ << uchar(TCEditor::staticSeeTabs)
+ << uchar(TCEditor::staticNoInsideTabs)
+ << uchar(TCEditor::staticWrapLine)
+ << uchar(TCEditor::staticTabIndents)
+ << uchar(TCEditor::staticBackSpUnindents)
+ << uchar(TCEditor::staticShowMatchPairNow)
+ << uchar(TCEditor::staticUseIndentSize)
+ << uchar(TCEditor::staticDontPurgeSpaces)
+ << uchar(TCEditor::staticColumnMarkers);
+ TCEditor::SaveColMarkers(s,TCEditor::staticColMarkers);
+ s << TCEditor::staticWrapCol
+ << TCEditor::editorFlags;
+
+ // Save the histories
+ s << hID_Cant;
+ for (j=hID_Start; j<hID_Start+hID_Cant; j++)
+ {
+ c=historyCount(j);
+ s << j << c;
+ for (i=c; i; --i)
+ s.writeString(historyStr(j,i-1));
+ }
+ SaveFileIDDirs(s);
+
+ // That saves the windowing system
+ s << edHelper;
+
+ SavePrintSetUp(&s);
+ SaveRunCommand(s);
+ SaveGrepData(s);
+ s << TDeskTopClock::mode;
+ s << ShowClock;
+ s << TSetEditorApp::UseScreenSaver << TSetEditorApp::screenSaverTime
+ << TSetEditorApp::screenSaverTimeMouse;
+ s.writeString(TSetEditorApp::WhichScrSaver);
+ s.writeString(TSetEditorApp::ExtScrSaverOpts);
+
+ // The search & replace options
+ s.writeString(TCEditor::findStr);
+ s << TCEditor::editorFlags << TCEditor::SearchInSel << TCEditor::FromWhere;
+ s << TCEditor::RegExStyle << TCEditor::ReplaceStyle << TCEditor::CanOptimizeRegEx;
+
+ SyntaxSearch_Save(s);
+
+ s << maxOpenEditorsSame << geFlags << widthVertWindows;
+
+ // If the user wants remember the backup files we created to kill'em latter
+ TStringCollectionW *fKill=GetFilesToKill();
+ if (DeleteFilesOnExit || (GetDSTOptions() & dstRemmeberFK)==0)
+ fKill=0;
+ if (fKill)
+ s << uchar(1) << fKill;
+ else
+ s << uchar(0);
+
+ // Desktop options
+ s << deskTop->getOptions();
+ // Directory listing options
+ s << TFileCollection::sortOptions;
+ // Code page conversion options
+ SaveConvCPOptions(s);
+ s << TGKey::GetKbdMapping(0);
+ BoardMixerSave(s);
+ PathListSave(s);
+ s << (uchar)TSOSListBoxMsg::opsEnd << (uchar)TSOSListBoxMsg::opsBeep;
+ TagsSave(s);
+ s << modifFilesOps << TCEditor::minDifModCheck;
+ s << 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads the palette information from disk, you must specify which of the
+three palettes must be saved.
+
+***************************************************************************/
+
+static
+void LoadPalette(int what, fpstream& s, int v)
+{
+ int oldMode=TProgram::appPalette;
+ TProgram::appPalette=what;
+
+ TPalette &palette=TProgram::application->getPalette();
+
+ int lenNew=palette.data[0];
+ int lenOld;
+ s >> lenOld;
+ // I assume the palette can only grow ;-)
+ char *palOld=new char[lenNew+1];
+ s.readBytes(palOld,lenOld);
+ if (lenOld<lenNew)
+ {
+ memcpy(palOld+lenOld,&(palette.data[lenOld+1]),lenNew-lenOld);
+ lenOld=lenNew;
+ }
+
+ // Patch for the palette according to the version
+ // Tabs
+ if (v<0x423 && palOld[0x79]==0 && palOld[0x7A]==0)
+ {
+ if (what==apMonochrome)
+ {
+ palOld[0x79]=0x70;
+ palOld[0x7A]=0x01;
+ }
+ else
+ {
+ palOld[0x79]=0x20;
+ palOld[0x7A]=0x40;
+ }
+ }
+ if (v<0x446 && palOld[0x3D]==0)
+ {
+ switch (what)
+ {
+ case apMonochrome:
+ case apBlackWhite:
+ palOld[0x3D]=0x07;
+ break;
+ default:
+ palOld[0x3D]=0x38;
+ }
+ }
+ if (v<0x450 && palOld[0x7B]==0)
+ {
+ switch (what)
+ {
+ case apMonochrome:
+ case apBlackWhite:
+ palOld[0x7B]=0x70;
+ break;
+ default:
+ palOld[0x7B]=0x20;
+ }
+ }
+
+ TPalette paletteNew(palOld,lenOld);
+ TProgram::application->getPalette()=paletteNew;
+ delete[] palOld;
+
+ // Restore the mode
+ TProgram::appPalette=oldMode;
+}
+
+#if 0
+ #define L(a) s >> aux; TCEditor::##a=(aux) ? True : False
+#else
+ #define L(a) s >> aux; TCEditor::a=(aux) ? True : False
+#endif
+
+inline unsigned MoveFlags(unsigned flags, unsigned mask, unsigned move)
+{
+ return (flags & mask) | ((flags & ~mask)<<move);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It loads the information from the desktop file.
+
+***************************************************************************/
+
+Boolean TSetEditorApp::loadDesktop(fpstream &s, Boolean isLocal)
+{
+ char buffer[80];
+ unsigned auxUN;
+ int auxINT;
+
+ s.readString(buffer,80);
+ if (strcmp(buffer,Signature)!=0)
+ {
+ messageBox(__("Wrong desktop file. May be owned by other user."),mfOKButton | mfError);
+ return False;
+ }
+ s >> deskTopVersion;
+ if (deskTopVersion<0x300)
+ {
+ messageBox(__("The desktop file is too old."), mfOKButton | mfError);
+ return False;
+ }
+ if (deskTopVersion>TCEDITOR_VERSION)
+ {
+ messageBox(__("You need a newer editor for this desktop file."), mfOKButton | mfError);
+ return False;
+ }
+
+ if (!DesktopPreloaded)
+ {// That's a desktop change, not the first load. So we must do a "hot swap" ;-)
+ if (deskTopVersion>=0x500)
+ {// New projects structure
+ char infoSaved;
+ s >> infoSaved;
+ if (infoSaved)
+ {// We have settings, load them replacing current settings
+ CLY_destroy(soCol);
+ s >> soCol;
+ hotApplyScreenOptions();
+ }
+ }
+ else
+ {// Load the old information and setup it
+ stScreenOptions *scrOps=loadOldDesktopScreenInfo(s);
+ scrOps->driverName=newStr(TScreen::getDriverShortName());
+ CLY_destroy(soCol);
+ soCol=new TScOptsCol();
+ soCol->Insert(scrOps);
+ hotApplyScreenOptions();
+ }
+ }
+ else
+ {// We already loaded the screen settings
+ if (deskTopVersion>=0x500)
+ {
+ char infoSaved;
+ s >> infoSaved;
+ if (infoSaved)
+ {
+ TScOptsCol *aux;
+ s >> aux;
+ CLY_destroy(aux);
+ // TODO: this is really inefficient, but lamentably TV saves the
+ // information using a crappy indexing stuff. If we skip it the
+ // indexes gets wrong.
+ }
+ }
+ else
+ s.seekg(posPreload);
+ DesktopPreloaded=0;
+ }
+
+ if (deskTopVersion>=0x307)
+ {
+ // Load the 3 palettes
+ LoadPalette(apColor,s,deskTopVersion);
+ LoadPalette(apMonochrome,s,deskTopVersion);
+ LoadPalette(apBlackWhite,s,deskTopVersion);
+ TCEditor::colorsCached=0;
+ TProgram::application->Redraw();
+ }
+
+ s >> TCEditor::staticTabSize;
+ if (deskTopVersion>0x450)
+ s >> TCEditor::staticIndentSize;
+ uchar aux;
+ L(staticAutoIndent);
+ L(staticIntelIndent);
+ L(staticUseTabs);
+ L(staticPersistentBlocks);
+ if (deskTopVersion>0x308)
+ {
+ L(staticCrossCursorInRow);
+ L(staticCrossCursorInCol);
+ L(staticShowMatchPair);
+ if (deskTopVersion>0x431)
+ { L(staticShowMatchPairFly); }
+ L(staticTransparentSel);
+ L(staticOptimalFill);
+ L(staticNoMoveToEndPaste);
+ }
+ if (deskTopVersion>0x427)
+ {
+ L(staticSeeTabs);
+ L(staticNoInsideTabs);
+ L(staticWrapLine);
+ }
+ if (deskTopVersion>=0x440)
+ {
+ L(staticTabIndents);
+ }
+ if (deskTopVersion>=0x445)
+ {
+ L(staticBackSpUnindents);
+ L(staticShowMatchPairNow);
+ }
+ else
+ { // Old desktop files with "Use Tabs" enabled globally have to disable it
+ if (TCEditor::staticUseTabs)
+ TCEditor::staticBackSpUnindents=False;
+ }
+ if (deskTopVersion>=0x448)
+ {
+ L(staticUseIndentSize);
+ L(staticDontPurgeSpaces);
+ }
+ if (deskTopVersion>=0x450)
+ {
+ L(staticColumnMarkers);
+ delete[] TCEditor::staticColMarkers;
+ TCEditor::staticColMarkers=TCEditor::LoadColMarkers(s);
+ }
+
+ if (deskTopVersion>0x401)
+ s >> TCEditor::staticWrapCol;
+ if (deskTopVersion>=0x406)
+ s >> TCEditor::editorFlags;
+
+ // Load histories
+ if (deskTopVersion<0x308)
+ { // -> v0.3.7 only the number 10
+ int i,j;
+ char *sp;
+ s >> j;
+ for (i=0; i<j; i++)
+ {
+ s.readString(buffer,80);
+ sp = new char[strlen(buffer)+1];
+ strcpy(sp,buffer);
+ historyAdd(hID_TextSearchEditor,sp);
+ }
+ }
+ else
+ {
+ int numHists,hist,numInHis,thisHist,strHis;
+ char *str;
+
+ s >> numHists;
+ for (hist=0; hist<numHists; hist++)
+ {
+ s >> thisHist >> numInHis;
+ for (strHis=0; strHis<numInHis; strHis++)
+ {
+ str=s.readString();
+ historyAdd(thisHist,str);
+ delete[] str;
+ }
+ }
+ }
+ if (deskTopVersion>=0x415)
+ LoadFileIDDirs(s,isLocal);
+
+ if (deskTop->valid(cmClose))
+ deskTop->forEach(::closeView, 0); // Clear the desktop
+
+ s >> edHelper;
+
+ if (deskTopVersion>=0x310)
+ LoadPrintSetUp(&s);
+
+ if (deskTopVersion>=0x407)
+ LoadRunCommand(s);
+
+ if (deskTopVersion>=0x408)
+ LoadGrepData(s);
+
+ if (deskTopVersion>=0x409)
+ s >> TDeskTopClock::mode >> ShowClock;
+
+ if (deskTopVersion>=0x410)
+ {
+ s >> TSetEditorApp::UseScreenSaver >> TSetEditorApp::screenSaverTime;
+ if (deskTopVersion>=0x430)
+ s >> TSetEditorApp::screenSaverTimeMouse;
+ delete[] TSetEditorApp::WhichScrSaver;
+ TSetEditorApp::WhichScrSaver=s.readString();
+ if (deskTopVersion>=0x434)
+ s.readString(TSetEditorApp::ExtScrSaverOpts,extscrsParMxLen);
+ }
+
+ // The search & replace options
+ if (deskTopVersion>=0x415)
+ {
+ s.readString(TCEditor::findStr,maxFindStrLen);
+ s >> TCEditor::editorFlags >> TCEditor::SearchInSel >> TCEditor::FromWhere;
+ }
+ if (deskTopVersion<0x431)
+ // I moved some options in 0.4.31 to left space for new ones
+ TCEditor::editorFlags=MoveFlags(TCEditor::editorFlags,7,2);
+ if (deskTopVersion<0x442)
+ TCEditor::editorFlags=MoveFlags(TCEditor::editorFlags,0x1F,1);
+ if (deskTopVersion>=0x416)
+ s >> TCEditor::RegExStyle >> TCEditor::ReplaceStyle >> TCEditor::CanOptimizeRegEx;
+ // Syntax Help
+ if (deskTopVersion>=0x418)
+ SyntaxSearch_Load(s);
+ else
+ SyntaxSearch_InitWithDefaults();
+
+ if (deskTopVersion>=0x420)
+ s >> maxOpenEditorsSame;
+ if (deskTopVersion>=0x457)
+ s >> geFlags >> widthVertWindows;
+
+ aux=0;
+ if (deskTopVersion>=0x429)
+ {
+ s >> aux;
+ if (aux)
+ {
+ TStringCollectionW *FilesToKill;
+ s >> FilesToKill;
+ SetFilesToKill(FilesToKill);
+ }
+ }
+ if (!aux)
+ SetFilesToKill(0);
+
+ if (deskTopVersion>=0x433)
+ {
+ s >> auxUN;
+ deskTop->setOptions(auxUN);
+ s >> TFileCollection::sortOptions;
+ }
+ if (deskTopVersion>=0x437)
+ LoadConvCPOptions(s);
+ if (deskTopVersion>=0x438)
+ {// Currently useless
+ s >> auxINT;
+ //TGKey::SetKbdMapping(auxINT ? TGKey::dosGreek737 : TGKey::dosUS);
+ }
+ if (deskTopVersion>=0x444)
+ BoardMixerLoad(s);
+ if (deskTopVersion>=0x449)
+ PathListLoad(s);
+ if (deskTopVersion>=0x456)
+ {
+ s >> aux; TSOSListBoxMsg::opsEnd=aux;
+ s >> aux; TSOSListBoxMsg::opsBeep=aux;
+ }
+ if (deskTopVersion>=0x501)
+ TagsLoad(s);
+ if (deskTopVersion>=0x502)
+ {
+ s >> modifFilesOps >> TCEditor::minDifModCheck;
+ }
+
+ // Even when 0.4.15 doesn't use the Config Files path we ensure it's pointing to
+ // the SET_FILES path
+ char *path=(GetFileIDDirBuffer(hID_ConfigFiles))->dir;
+
+ if (path && path[0]==0)
+ { // If the directory isn't configured
+ char *r=(char *)GetVariable("SET_FILES");
+ if (r)
+ SetFileIDDirValue(hID_ConfigFiles,r);
+ }
+ return True;
+}
+#undef L
+
+/**[txh]********************************************************************
+
+ Description:
+ Loads settings for fonts from desktops older than 0.5.0.
+
+***************************************************************************/
+void TSetEditorApp::loadOldFontInfo(fpstream& s, stScreenOptions *scrOps)
+{
+ char version,aux;
+ s >> version;
+ int cp1,cp2;
+
+ if (version && version<=3)
+ {// versions 1, 2 and 3
+ char *namePrim=s.readString();
+ if (version>=3)
+ {
+ s >> cp1;
+ scrOps->enForceScr=1;
+ scrOps->enScr=cp1;
+ }
+ char *nameSeco=0;
+
+ if (version>=2)
+ {
+ s >> aux;
+ if (aux)
+ {
+ nameSeco=s.readString();
+ if (version>=3)
+ {
+ s >> cp2;
+ scrOps->enForceSnd=1;
+ scrOps->enSnd=cp2;
+ }
+ }
+ }
+ if (namePrim && namePrim[0])
+ {
+ scrOps->foPriName=namePrim;
+ scrOps->foPriLoad=1;
+ }
+ if (nameSeco && nameSeco[0])
+ {
+ scrOps->foSecName=nameSeco;
+ scrOps->foSecLoad=1;
+ }
+ }
+ else
+ if (version>=4)
+ {// version 4
+ char *namePrim=NULL;
+ char *nameSeco=NULL;
+ s >> cp1 >> cp2;
+ s >> aux;
+ if (aux)
+ {
+ namePrim=s.readString();
+ s >> aux;
+ if (aux)
+ nameSeco=s.readString();
+ }
+ scrOps->enForceScr=1;
+ scrOps->enScr=cp1;
+ scrOps->enForceSnd=1;
+ scrOps->enSnd=cp2;
+ if (namePrim)
+ {
+ scrOps->foPriName=namePrim;
+ scrOps->foPriLoad=1;
+ }
+ if (nameSeco)
+ {
+ scrOps->foSecName=nameSeco;
+ scrOps->foSecLoad=1;
+ }
+ }
+}
+
+void TSetEditorApp::transferSetting2TV(void *aP, void *)
+{
+ stScreenOptions *p=(stScreenOptions *)aP;
+ // Driver section
+ const char *drv=p->driverName;
+ // The _Default goes to the root
+ if (*drv=='_')
+ drv=NULL;
+ TVMainConfigFile::Add(drv,"AppCP",p->enForceApp ? p->enApp : -1);
+ TVMainConfigFile::Add(drv,"ScrCP",p->enForceScr ? p->enScr : -1);
+ TVMainConfigFile::Add(drv,"InpCP",p->enForceInp ? p->enInp : -1);
+
+ if (p->foPriLoad || p->foSecLoad)
+ {
+ TVMainConfigFile::Add(drv,"FontWidth",p->foPriW);
+ TVMainConfigFile::Add(drv,"FontHeight",p->foPriH);
+ if (p->foSecLoad)
+ TVMainConfigFile::Add(drv,"LoadSecondaryFont",1);
+ }
+
+ if (p->scOptions!=scfDontForce && p->scWidth)
+ {
+ TVMainConfigFile::Add(drv,"ScreenWidth",p->scWidth);
+ TVMainConfigFile::Add(drv,"ScreenHeight",p->scHeight);
+ if (!p->foPriLoad && !p->foSecLoad)
+ {
+ TVMainConfigFile::Add(drv,"FontWidth",p->scCharWidth);
+ TVMainConfigFile::Add(drv,"FontHeight",p->scCharHeight);
+ }
+ }
+ if (p->scOptions==scfExternal)
+ {
+ TVMainConfigFile::Add(drv,"ExtProgVideoMode",p->scCommand);
+ }
+ else if (p->scOptions==scfMode)
+ {
+ TVMainConfigFile::Add(drv,"VideoMode",p->scModeNumber);
+ }
+
+ if (p->palChanged)
+ {// palChanged isn't enough
+ const TScreenColor *pal=TDisplay::getDefaultPalette();
+ unsigned i;
+ for (i=0; i<16; i++)
+ if (p->palette[i].R!=pal[i].R || p->palette[i].G!=pal[i].G ||
+ p->palette[i].B!=pal[i].B)
+ {
+ char b[192],*s=b;
+ for (i=0; i<16; i++)
+ {
+ s+=sprintf(s,"%d,%d,%d",p->palette[i].R,p->palette[i].G,p->palette[i].B);
+ if (i!=15)
+ *(s++)=',';
+ }
+ TVMainConfigFile::Add(drv,"ScreenPalette",b);
+ break;
+ }
+ }
+}
+
+stScreenOptions *TSetEditorApp::loadOldDesktopScreenInfo(fpstream &s)
+{
+ stScreenOptions *scrOps=new stScreenOptions;
+ memset(scrOps,0,sizeof(stScreenOptions));
+ if (deskTopVersion>=0x404)
+ loadOldFontInfo(s,scrOps);
+ #ifdef TVCompf_djgpp
+ if (deskTopVersion>=0x405)
+ LoadPaletteSystemDontSet(s,scrOps->palette);
+ #else
+ /* In v0.4.15 to v0.4.17 of the Linux editor I forgot to save it so here
+ I choose compatibility with these versions */
+ if (deskTopVersion>=0x418)
+ LoadPaletteSystemDontSet(s,scrOps->palette);
+ #endif
+ if (deskTopVersion>=0x403)
+ {
+ ushort mode;
+ s >> mode;
+ scrOps->scOptions=scfMode;
+ scrOps->scModeNumber=mode;
+ if (deskTopVersion>=0x411)
+ {
+ s >> UseExternPrgForMode;
+ char *extPrg=s.readString();
+ if (UseExternPrgForMode)
+ {
+ scrOps->scOptions=scfExternal;
+ scrOps->scCommand=extPrg;
+ }
+ else
+ DeleteArray(extPrg);
+ }
+ }
+ return scrOps;
+}
+
+Boolean TSetEditorApp::preLoadDesktop(fpstream &s)
+{
+ char buffer[80];
+
+ s.readString(buffer,80);
+ if (strcmp(buffer,Signature)!=0)
+ { // Wrong desktop file.
+ return False;
+ }
+ s >> deskTopVersion;
+ if (deskTopVersion<0x300 || deskTopVersion>TCEDITOR_VERSION)
+ { // The desktop file is too old or new
+ return False;
+ }
+ if (deskTopVersion<0x500)
+ {// The preLoad was introduced in the 0.4.x to 0.5.x change.
+ // We have to extract the information from the old structure.
+ stScreenOptions *scrOps=loadOldDesktopScreenInfo(s);
+ scrOps->driverName=newStr(defaultDrvName);
+ if (!soCol)
+ soCol=new TScOptsCol();
+ soCol->Insert(scrOps);
+ transferSetting2TV(scrOps);
+ }
+ else
+ {
+ char soColSaved;
+ s >> soColSaved;
+ if (soColSaved)
+ {
+ CLY_destroy(soCol);
+ s >> soCol;
+ soCol->transfer2TV();
+ }
+ if (!soCol)
+ soCol=new TScOptsCol();
+ }
+ DesktopPreloaded=1;
+ posPreload=s.tellg();
+ return True;
+}
+/******************** End of save/retrieve desktop functions ****************/
+
+void TSetEditorApp::createClipBoard(void)
+{
+ clipWindow=openEditor(0,False);
+ if (clipWindow)
+ {
+ TCEditor::clipboard=clipWindow->editor;
+ TCEditor::clipboard->canUndo=False;
+ }
+}
+
+TScOptsCol *TSetEditorApp::soCol=NULL;
+
+void *TScOptsCol::keyOf(void *item)
+{
+ return ((stScreenOptions *)item)->driverName;
+}
+
+int TScOptsCol::compare(void *key1, void *key2)
+{
+ return strcmp((char *)key1,(char *)key2);
+}
+
+void TScOptsCol::freeItem(void *item)
+{
+ stScreenOptions *p=(stScreenOptions *)item;
+ DeleteArray(p->driverName);
+ DeleteArray(p->foPriName);
+ DeleteArray(p->foSecName);
+ DeleteArray(p->foPriFile);
+ DeleteArray(p->foSecFile);
+ DeleteArray(p->scCommand);
+ CLY_destroy(p->foPri);
+ CLY_destroy(p->foSec);
+ delete p;
+}
+
+const char scOptsVer=2;
+
+void *TScOptsCol::readItem(ipstream &is)
+{
+ stScreenOptions *p=new stScreenOptions;
+ memset(p,0,sizeof(stScreenOptions));
+
+ char version;
+ is >> version;
+ p->driverName=is.readString();
+ p->foPriName =is.readString();
+ p->foSecName =is.readString();
+ p->scCommand =is.readString();
+ is >> p->enForceApp >> p->enForceScr >> p->enForceSnd >> p->enForceInp
+ >> p->enApp >> p->enScr >> p->enSnd >> p->enInp
+ >> p->foPriLoad >> p->foSecLoad
+ >> p->foPriW >> p->foPriH
+ >> p->scOptions >> p->scWidth >> p->scHeight
+ >> p->scCharWidth >> p->scCharHeight
+ >> p->scModeNumber;
+ if (version>=2)
+ is >> p->palChanged;
+ else
+ p->palChanged=1;
+ if (p->palChanged)
+ {
+ unsigned i;
+ for (i=0; i<16; i++)
+ is >> p->palette[i].R >> p->palette[i].G >> p->palette[i].B;
+ }
+ else
+ memcpy(p->palette,TDisplay::getDefaultPalette(),sizeof(TScreenColor)*16);
+ return p;
+}
+
+void TScOptsCol::writeItem(void *obj, opstream &os)
+{
+ stScreenOptions *p=(stScreenOptions *)obj;
+ os << scOptsVer;
+ os.writeString(p->driverName);
+ os.writeString(p->foPriName);
+ os.writeString(p->foSecName);
+ os.writeString(p->scCommand);
+ os << p->enForceApp << p->enForceScr << p->enForceSnd << p->enForceInp
+ << p->enApp << p->enScr << p->enSnd << p->enInp
+ << p->foPriLoad << p->foSecLoad
+ << p->foPriW << p->foPriH
+ << p->scOptions << p->scWidth << p->scHeight
+ << p->scCharWidth << p->scCharHeight
+ << p->scModeNumber<< p->palChanged;
+ if (p->palChanged)
+ {
+ unsigned i;
+ for (i=0; i<16; i++)
+ os << p->palette[i].R << p->palette[i].G << p->palette[i].B;
+ }
+}
+
+void TScOptsCol::Insert(stScreenOptions *p)
+{
+ ccIndex pos=indexOf(p);
+ if (pos==ccNotFound)
+ insert(p);
+ else
+ atReplace(pos,p);
+}
+
+void TScOptsCol::transfer2TV()
+{
+ forEach(TSetEditorApp::transferSetting2TV,NULL);
+}
+
+const char * const TScOptsCol::name="TScOptsCol";
+
+TStreamableClass RScOptsCol(TScOptsCol::name,TScOptsCol::build,__DELTA(TScOptsCol));
+
diff --git a/setedit/setedit/edcolor.cc b/setedit/setedit/edcolor.cc
new file mode 100644
index 0000000..b8391b4
--- /dev/null
+++ b/setedit/setedit/edcolor.cc
@@ -0,0 +1,202 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+#define Uses_TRect
+#define Uses_TColorDialog
+#define Uses_TColorGroup
+#define Uses_TColorItem
+#define Uses_TPalette
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TCEditWindow
+#define Uses_TStringable
+
+#define Uses_TSStringableListBox
+#define Uses_TSButton
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <diaghelp.h>
+
+static TPalette *temp_pal=0;
+// Used to export a palette as text suitable for an include file
+//#define EXPORT_PAL
+#ifdef EXPORT_PAL
+static FILE *f;
+static unsigned char *palData;
+static const char *nameColors[]=
+{
+ "Black",
+ "Blue",
+ "Green",
+ "Cyan",
+ "Red",
+ "Magenta",
+ "Brown",
+ "Lightgray",
+ "Darkgray",
+ "Lightblue",
+ "Lightgreen",
+ "Lightcyan",
+ "Lightred",
+ "Lightmagenta",
+ "Yellow",
+ "White"
+};
+#endif
+
+static void addItem(TColorGroup *&group,int index, const char *name, const char *group_name)
+{
+ if (strcmp(name,"reserved")==0)
+ {
+ #ifdef EXPORT_PAL
+ fprintf(f,"\\\n S(%02X,%s,%s,%s) \\\n",index,nameColors[palData[index]&0xF],nameColors[palData[index]>>4],name);
+ #endif
+ return;
+ }
+ if (*group_name)
+ {
+ if (!group)
+ group=new TColorGroup(group_name);
+ else
+ *group=*group + *new TColorGroup(group_name);
+ #ifdef EXPORT_PAL
+ fprintf(f,"\\\n SS(%02X,%s,%s,%s,%s) \\\n",index,nameColors[palData[index]&0xF],nameColors[palData[index]>>4],name,group_name);
+ #endif
+ }
+ #ifdef EXPORT_PAL
+ else
+ fprintf(f," S(%02X,%s,%s,%s) \\\n",index,nameColors[palData[index]&0xF],nameColors[palData[index]>>4],name);
+ #endif
+ *group=*group + *new TColorItem(name, index);
+}
+
+#include <pal.h>
+#undef S
+#undef SS
+#define S(index,foreground,background,name) \
+ addItem(group,0x##index,#name,"");
+#define SS(index,foreground,background,name,_group) \
+ addItem(group,0x##index,#name,#_group);
+
+static TColorDialog *GetColorDialog()
+{
+ TColorDialog *c;
+ TColorGroup *group = NULL;
+
+ #ifdef EXPORT_PAL
+ TPalette &palette=TProgram::application->getPalette();
+ palData=palette.data;
+ f=fopen("Exportada.Pal","wt");
+ // That creates the color items dynamically
+ #endif
+ SE_cpColor
+ #ifdef EXPORT_PAL
+ fclose(f);
+ #endif
+
+ c=new TColorDialog(&TProgram::application->getPalette(),group);
+ c->helpCtx=cmeSetColors;
+ temp_pal=new TPalette(TProgram::application->getPalette());
+ c->setData(&TProgram::application->getPalette());
+ return c;
+}
+
+void Colors()
+{
+ TColorDialog *c = GetColorDialog();
+ if (TProgram::application->validView(c)!=0)
+ {
+ if (TProgram::deskTop->execView( c )==cmCancel)
+ // restore the old palette
+ TProgram::application->getPalette()=*temp_pal;
+ // force to reread the cached colors for the editor
+ TCEditor::colorsCached = 0;
+
+ TProgram::application->Redraw();
+ CLY_destroy(c);
+ }
+ delete temp_pal;
+ temp_pal=0;
+}
+
+extern char SEcpColor[]; // Defined in editmain
+#undef S
+#undef SS
+#include <pal.h>
+#include <palfte.h>
+#include <palconv.h>
+#include <paldjd.h>
+#include <palbcc.h>
+#include <palmc.h>
+
+static char SEcpFTE[]={ SE_cpColorFTE 0 };
+static char SEcpDARKJDI[]={ SE_cpColorDarkJDI 0 };
+static char SEcpConsoleVIM[]={ SE_cpColorConsoleVIM 0 };
+static char SEcpColorBCC[]={ SE_cpColorBCC 0 };
+static char SEcpMidnight[]={ SE_cpMidnight 0 };
+
+typedef struct
+{
+ char name[20];
+ char *palette;
+} palTheme;
+
+static palTheme Themes[]=
+{
+ {"Default", SEcpColor },
+ {"FTE like", SEcpFTE },
+ {"Console + VIM", SEcpConsoleVIM },
+ {"Dark JDI", SEcpDARKJDI },
+ {"Classic Borland", SEcpColorBCC },
+ {"Midnight Commander", SEcpMidnight },
+};
+
+class TColorThemes : public TStringable
+{
+public:
+ TColorThemes() : TStringable() { Count=sizeof(Themes)/sizeof(palTheme); };
+ virtual ~TColorThemes() {};
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+};
+
+void TColorThemes::getText(char *dest, unsigned item, int maxLen)
+{
+ const char *ori=Themes[item].name;
+ strncpy(dest,ori,maxLen);
+ dest[maxLen]=EOS;
+}
+
+static TColorThemes cThemes;
+
+void ColorTheme()
+{
+ TSViewCol *col=new TSViewCol(__("Color Themes"));
+
+ col->insert(xTSCenter,yTSUp,new TSStringableListBox(20,GetDeskTopRows()-9,tsslbVertical));
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmeColorTheme);
+ delete col;
+
+ TStringableListBoxRec box;
+ box.items=&cThemes;
+ box.selection=0;
+
+ if (execDialog(d,&box)==cmOK)
+ {
+ temp_pal=new TPalette(TProgram::application->getPalette());
+ memcpy(temp_pal->data+1,Themes[box.selection].palette,temp_pal->data[0]);
+ TProgram::application->getPalette()=*temp_pal;
+ // force to reread the cached colors for the editor
+ TCEditor::colorsCached=0;
+ TProgram::application->Redraw();
+ }
+}
+
diff --git a/setedit/setedit/edfonts.cc b/setedit/setedit/edfonts.cc
new file mode 100644
index 0000000..9d5dcb1
--- /dev/null
+++ b/setedit/setedit/edfonts.cc
@@ -0,0 +1,184 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+#define Uses_TVCodePage
+#define Uses_TScreen
+#define Uses_TApplication
+#define Uses_TVFontCollection
+#include <tv.h>
+
+#define Uses_TSetEditorApp
+#include <setapp.h>
+
+void TSetEditorApp::SetEditorFontsEncoding(int priChanged, int enPri,
+ int sndChanged, int enSec)
+{
+ if (!so) return; // Sanity check
+ int prC=0, seC=0;
+ TScreenFont256 primary,secondary,*prF=NULL,*seF=NULL;
+
+ if (priChanged && so->foPriLoaded && so->foPri)
+ {
+ so->foPri->SetCodePage(enPri);
+ primary.w=so->foPriW;
+ primary.h=so->foPriH;
+ primary.data=so->foPri->GetFont(so->foPriW,so->foPriH);
+ prF=&primary;
+ prC=1;
+ }
+ if (sndChanged && so->foSecLoaded && so->foSec)
+ {
+ so->foSec->SetCodePage(enSec);
+ secondary.w=so->foPriW;
+ secondary.h=so->foPriH;
+ secondary.data=so->foSec->GetFont(so->foPriW,so->foPriH);
+ seF=&secondary;
+ seC=1;
+ }
+ if (prC || seC)
+ {
+ TScreen::setFont(prC,prF,seC,seF);
+ if (prF) DeleteArray(prF->data);
+ if (seF) DeleteArray(seF->data);
+ }
+}
+
+
+TScreenFont256 *TSetEditorApp::FontRequestCallBack(int which, unsigned w, unsigned h)
+{
+ if (!so) return NULL; // Sanity check
+ TVFontCollection *col=which ? so->foSec : so->foPri;
+ if (!col)
+ return NULL;
+ uchar *data=col->GetFont(w,h);
+ if (!data)
+ return NULL;
+ TScreenFont256 *f=new TScreenFont256;
+ so->foPriW=w;
+ so->foPriH=h;
+ f->data=data;
+ f->w=w;
+ f->h=h;
+ fontCreated=1;
+ if (which)
+ so->foSecLoaded=1;
+ else
+ so->foPriLoaded=1;
+ return f;
+}
+
+void TSetEditorApp::SetEditorFonts(uchar priUse, char *priName, char *priFile,
+ TVBitmapFontSize *priSize,
+ uchar secUse, char *secName, char *secFile)
+{
+ if (!so) return; // Sanity check
+ // Transfer the options
+ unsigned w,h;
+ w=priSize->w; h=priSize->h;
+ int sizeChanged=(w!=so->foPriW) || (h!=so->foPriH);
+ if (sizeChanged)
+ {
+ so->foPriW=w;
+ so->foPriH=h;
+ }
+
+ int priNameChanged=!so->foPriName || strcmp(so->foPriName,priName)!=0;
+ if (priNameChanged)
+ {
+ DeleteArray(so->foPriName);
+ so->foPriName=newStr(priName);
+ DeleteArray(so->foPriFile);
+ so->foPriFile=newStr(priFile);
+ }
+ else
+ {
+ DeleteArray(priName);
+ DeleteArray(priFile);
+ }
+
+ int priUseChanged=priUse!=so->foPriLoad;
+ so->foPriLoad=priUse;
+
+ int secNameChanged=!so->foSecName || strcmp(so->foSecName,secName)!=0;
+ if (secNameChanged)
+ {
+ DeleteArray(so->foSecName);
+ so->foSecName=newStr(secName);
+ DeleteArray(so->foSecFile);
+ so->foSecFile=newStr(secFile);
+ }
+ else
+ {
+ DeleteArray(secName);
+ DeleteArray(secFile);
+ }
+
+ int secUseChanged=secUse!=so->foSecLoad;
+ so->foSecLoad=secUse;
+
+ // Make it efective
+ int idDefScr, idDefApp, idDefInp;
+ TVCodePage::GetDefaultCodePages(idDefScr,idDefApp,idDefInp);
+ if (!TScreen::canSetBFont()) return;
+
+ TScreenFont256 primary,secondary,*prF=NULL,*seF=NULL;
+ int secChanged=0;
+ int priChanged=priNameChanged || priUseChanged || sizeChanged;
+ if (priNameChanged)
+ {// Create a collection for this font
+ if (so->enScr==-1) so->enScr=idDefScr;
+ if (so->foPri) delete so->foPri;
+ so->foPri=new TVFontCollection(so->foPriFile,so->enScr);
+ if (so->foPri->GetError())
+ {
+ if (so->foPri) delete so->foPri;
+ so->foPri=NULL;
+ }
+ }
+ if (priChanged && so->foPriLoad && so->foPri)
+ {
+ primary.w=so->foPriW;
+ primary.h=so->foPriH;
+ primary.data=so->foPri->GetFont(so->foPriW,so->foPriH);
+ prF=&primary;
+ }
+
+ if (TScreen::canSetSBFont())
+ {
+ secChanged=secNameChanged || secUseChanged || sizeChanged;
+ if (secNameChanged)
+ {// Create a collection for this font
+ if (so->enSnd==-1) so->enSnd=idDefScr;
+ if (so->foSec) delete so->foSec;
+ so->foSec=new TVFontCollection(so->foSecFile,so->enSnd);
+ if (so->foSec->GetError())
+ {
+ delete so->foSec;
+ so->foSec=NULL;
+ }
+ }
+ if (secChanged && so->foSecLoad && so->foSec)
+ {
+ secondary.w=so->foPriW;
+ secondary.h=so->foPriH;
+ secondary.data=so->foSec->GetFont(so->foPriW,so->foPriH);
+ seF=&secondary;
+ }
+ }
+ if (TScreen::setFont(priChanged,prF,secChanged,seF,so->enScr))
+ {
+ if (priChanged)
+ so->foPriLoaded=prF!=NULL;
+ if (secChanged)
+ so->foSecLoaded=seF!=NULL;
+ if (!so->foCallBackSet)
+ {
+ TScreen::setFontRequestCallBack(FontRequestCallBack);
+ so->foCallBackSet=1;
+ }
+ }
+ if (prF) DeleteArray(prF->data);
+ if (seF) DeleteArray(seF->data);
+}
+
+
diff --git a/setedit/setedit/editdiag.cc b/setedit/setedit/editdiag.cc
new file mode 100644
index 0000000..6f53c58
--- /dev/null
+++ b/setedit/setedit/editdiag.cc
@@ -0,0 +1,187 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// That's the first include because is used to configure the editor.
+#include <ceditint.h>
+
+#define Uses_stdio
+#define Uses_stdlib
+
+#define Uses_TDialog
+#define Uses_TDeskTop
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TCheckBoxes
+#define Uses_TSItem
+#define Uses_TStaticText
+#define Uses_TCEditor_Internal
+#define Uses_TScreen
+
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSTextScroller
+#define Uses_TSCheckBoxes
+#define Uses_TSVeGroup
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppVarious
+#include <setapp.h>
+
+#include <edspecs.h>
+#include <advice.h>
+#include <vername.h>
+
+static const char *cSlogan=__("\x3 A friendly text editor.");
+static const char *cFormatVersion=__("\x3Version: %lX.%lX.%lX Revision: %d");
+static const char *cFormatName=__("\x3That's SET's Editor \"%s\", (c) %s");
+static const char *cFormatPlatform=__("\x3Platform: %s Driver: %s");
+static const char *cSET=__("\x3 by Salvador Eduardo Tropea");
+
+ushort execDialog( TDialog *d, void *data )
+{
+ TView *p=TProgram::application->validView( d );
+ if (p==0)
+ return cmCancel;
+ else
+ {
+ if (data!=0)
+ p->setData(data);
+ ushort result=TProgram::deskTop->execView(p);
+ if (result!=cmCancel && data!=0)
+ p->getData( data );
+ TObject::CLY_destroy( p );
+ return result;
+ }
+}
+
+const int bufWidth=80;
+
+int AboutStartBox(void)
+{
+ if (EnvirGetBits("SET_VARIOUS1",svr1DontShowAbout))
+ return 0;
+
+ TSViewCol *col=new TSViewCol(__("About"));
+
+ char v1[bufWidth],v2[bufWidth];
+ TVIntl::snprintf(v1,bufWidth,cFormatName,VERSION_NAME,TCEDITOR_C_YEAR);
+ TVIntl::snprintf(v2,bufWidth,cFormatVersion,
+ TCEDITOR_VERSION>>16,(TCEDITOR_VERSION>>8) & 0xFF,
+ TCEDITOR_VERSION & 0xFF,VERSION_REV);
+
+ TSVeGroup *ant=
+ MakeVeGroup(tsveMakeSameW,
+ new TSStaticText(v1),
+ new TSStaticText(v2),
+ new TSStaticText(cSET),
+ new TSStaticText(cSlogan),0);
+
+ TSVeGroup *all=
+ MakeVeGroup(1 | tsveMakeSameW,
+ ant,
+ new TSCheckBoxes(new TSItem(__("Don't show it next time"),0)),
+ new TSButton(__("~O~K"),cmOK,bfDefault),0);
+
+ col->insert(xTSCenter,yTSUpSep,all);
+
+ TDialog *d=col->doItCenter();
+
+ uint32 op=0;
+ execDialog(d,&op);
+ if (op)
+ EnvirSetBits("SET_VARIOUS1",svr1DontShowAbout);
+
+ return 1;
+}
+
+#ifdef TVOS_UNIX
+void ShowUserScreenDialog()
+{
+ GiveAdvice(gadvUserScreen);
+}
+#endif
+
+// Platform ID
+#ifdef SEOSf_STR
+ #define PLAT_OS SEOS_STR "/" SEOSf_STR
+#else
+ #define PLAT_OS SEOS_STR
+#endif
+#ifdef SECompf_STR
+ #define PLAT_Comp SEComp_STR "/" SECompf_STR
+#else
+ #define PLAT_Comp SEComp_STR
+#endif
+#define PLAT_STR PLAT_OS "," SECPU_STR "," PLAT_Comp
+
+void FullAboutBox(void)
+{
+ TSViewCol *col=new TSViewCol(__("About"));
+
+ char v1[bufWidth],v2[bufWidth],v3[bufWidth];
+ TVIntl::snprintf(v1,bufWidth,cFormatName,VERSION_NAME,TCEDITOR_C_YEAR);
+ TVIntl::snprintf(v2,bufWidth,cFormatVersion,
+ TCEDITOR_VERSION>>16,(TCEDITOR_VERSION>>8) & 0xFF,
+ TCEDITOR_VERSION & 0xFF,VERSION_REV);
+ TVIntl::snprintf(v3,bufWidth,cFormatPlatform,PLAT_STR,
+ TScreen::getDriverShortName());
+
+ TSVeGroup *ant=
+ MakeVeGroup(tsveMakeSameW,
+ new TSStaticText(v1),
+ new TSStaticText(v2),
+ new TSStaticText(v3),
+ new TSStaticText(cSET),
+ new TSStaticText(cSlogan),0);
+
+ TNSCollection *text=new TNSCollection(12,5);
+ #define i(a) text->insert((void *)TVIntl::getTextNew(a));
+ i(__("The FSF and GNU people for such good tools"));
+ i(__("DJ Delorie and collaborators for porting it to DOS"));
+ i(__("Robert Hoehne for porting TVision and making RHIDE"));
+ i(__("Vadim Belodorov for contributing the first port of TV to Win32"));
+ i(__("Anatoli Soltan for porting to Win32 using BC++"));
+ i(__("VA Linux and the people who maintain Source Forge"));
+ i(__("The University of California, Berkeley and its contributors"));
+ #ifdef HAVE_PCRE_LIB
+ i(__("The University of Cambridge for the PCRE package"));
+ #endif
+ #ifdef HAVE_ALLEGRO
+ i(__("Shawn Hargreaves for Allegro; used as the sound engine"));
+ # ifdef SUP_MP3
+ i(__("Tomislav Uzelac for AMP, MP3 engine and Ove Kaaven for adapting to Allegro"));
+ # endif // SUP_MP3
+ #endif // HAVE_ALLEGRO
+ i(__("Jean-loup Gailly and Mark Adler for the zlib"));
+ #ifdef HAVE_BZIP2
+ i(__("Julian R. Seward for bzip2 routines included"));
+ #endif
+ i(__("Bjorn Reese for a lot of ideas about the stack debugger of UNIX"));
+ i(__("All my friends that support my project (Laszlo, Marek, Ivan,"));
+ i(__("Grzegorz, Andris, etc.)."));
+ #undef i
+ TSTextScroller *txt=new TSTextScroller(70,8,text,0,1,70);
+
+ TSVeGroup *thanks=
+ MakeVeGroup(tsveMakeSameW,
+ new TSStaticText(__("Thanks to:")),
+ txt,0);
+
+ TSVeGroup *all=
+ MakeVeGroup(1 | tsveMakeSameW,
+ ant,
+ new TSStaticText(__("\x3Made in Argentina")),
+ thanks,
+ new TSButton(__("~O~K"),cmOK,bfDefault),0);
+
+ col->insert(xTSCenter,yTSUpSep,all);
+ col->exec(0);
+ CLY_destroy(text);
+ delete col;
+}
+
diff --git a/setedit/setedit/editmain.cc b/setedit/setedit/editmain.cc
new file mode 100644
index 0000000..f5de2e8
--- /dev/null
+++ b/setedit/setedit/editmain.cc
@@ -0,0 +1,3395 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_BestWrite
+#include <ceditint.h>
+
+#ifdef TVCompf_djgpp
+#include <conio.h>
+#include <io.h>
+#include <dpmi.h>
+#endif
+
+#define Uses_TCEditWindow
+#define Uses_TCEditor_Commands
+#define Uses_TCEditor_Internal
+#define Uses_TApplication
+#define Uses_TWindow
+#define Uses_TPalette
+#define Uses_TDeskTop
+#define Uses_TRect
+#define Uses_TFileDialog
+#define Uses_TChDirDialog
+#define Uses_TStringCollection
+#define Uses_MsgBox
+#define Uses_TCollection
+#define Uses_TCommandSet
+#define Uses_TScreen
+#define Uses_TDeskTopClock
+#define Uses_TMenuBar
+#define Uses_TCalculator
+#define Uses_TFileCollection // To set the default sorting
+#define Uses_TNoSortedStringCollection
+#define Uses_TStreamableClass
+#define Uses_TGKey
+#define Uses_TSubMenu
+#define Uses_TMenu
+#define Uses_TVCodePage
+#define Uses_string
+#define Uses_alloca
+#define Uses_stdlib
+#define Uses_access
+#define Uses_getopt
+#define Uses_ctype
+#define Uses_unistd
+#define Uses_ProgBar // Needed for recoding stuff only!
+#define Uses_TVConfigFile
+#define Uses_TScOptsCol
+#ifndef SECompf_djgpp
+ #define Uses_TGKey
+#endif
+#define Uses_FileOpenAid
+// InfView requests
+#include <infr.h>
+#include <ceditor.h>
+#define Uses_SETAppAll
+#define Uses_SETAppHelper
+#define Uses_PrjFunctions
+#define Uses_TMultiMenu
+#include <setapp.h>
+#include <dskwin.h>
+#include <dskedito.h>
+#include <dskclose.h>
+#include <dskhelp.h>
+#include <dskman.h>
+#include <edcollec.h>
+#include <sdginter.h>
+#include <edprint.h>
+#include <edmsg.h>
+#include <tpaltext.h>
+#include <diaghelp.h>
+#include <splinman.h>
+#include <pathtool.h>
+#include <intermp3.h>
+#include <ssyntax.h>
+#include <gzfiles.h>
+
+#include <locale.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <loadkbin.h>
+#include <runprog.h>
+#include <loadcle.h>
+#include <mixer.h>
+#include <bufun.h>
+#include <edspecs.h>
+#include <stackdbg.h>
+#include <loadshl.h>
+#include <loadnobkp.h>
+#include <pathlist.h>
+#include <datetools.h>
+#define Uses_TagsOnlyFuncs
+#include <tags.h>
+#include <rhutils.h>
+#include <advice.h>
+#include <debug.h>
+
+const unsigned cmOpen=100;
+
+void AddToEditorsHelper(TCEditWindow *p, int SelectHL=0);
+static void PrintEditor(void);
+static void ExportAsHTML(void);
+int AskForClosedResume(EditorResume *r,char *fileName);
+extern int AskForProjectResume(EditorResume *r,char *fileName);
+void InitEditorSignals(char aStrategy, const char *prgName, const char *errFile);
+void ShowMenuLoadError(void);
+void UnLoadTVMenu(void);
+void SLPInterfaceInit(char *);
+void SLPInterfaceDeInit(void);
+// RHTV setting
+extern void setIntenseState(void);
+
+// That's the manager for InfView, we don't worry about the viewer all is handled by it
+TDskWinHelp *TSetEditorApp::InfManager=NULL;
+TEditorCollection *TSetEditorApp::edHelper=NULL;
+TCEditWindow *TSetEditorApp::clipWindow=NULL;
+TMultiMenuBar *TSetEditorApp::multiMenuBar=NULL;
+// For the tricky context latch
+int TSetEditorApp::helpRequest=0;
+ushort TSetEditorApp::helpCtxRequested=0;
+int TSetEditorApp::maxOpenEditorsSame=1;
+int TSetEditorApp::DeleteFilesOnExit=0;
+char TSetEditorApp::ExtScrSaverOpts[extscrsParMxLen]="";
+unsigned TSetEditorApp::geFlags=0;
+int TSetEditorApp::widthVertWindows=24;
+unsigned long
+ TSetEditorApp::deskTopVersion;
+uint32 TSetEditorApp::modifFilesOps=0;
+
+XYFStack stkPos;
+const char *KeyBindFName="keybind.dat";
+// Name specified by the user
+static char *KeyBindFNameUser=0;
+
+const char *cmeQuitDeleteMessage=__("Do you want to delete all the .BKP, desktop and project files?");
+
+const char *TipsFName="editor.tip";
+#ifdef NoHomeOrientedOS
+// Used to guess the info directory in DOS
+static char *EditorFileExt="setedit.inf";
+#endif
+char *EditorFile="setedit";
+DeclarePalette;
+
+TSetEditorApp *editorApp;
+#ifdef TEST_SPLINES
+int spLines[]={10-1,11-1,20-1,splEndOfList};
+#endif
+#ifdef USE_TSTRCOL
+TStrCol *ReservedWords;
+TStrCol *UserWords;
+TStrCol *PascalRWords;
+TStrCol *ClipperRWords;
+#else
+TStringCollection *ReservedWords;
+TStringCollection *UserWords;
+TStringCollection *PascalRWords;
+TStringCollection *ClipperRWords;
+#endif
+static int StdErrOri=STDERR_FILENO,StdErrNew=-1;
+static char *TemporalStdErr=0;
+
+extern void InsertProjectWindow(void);
+void StopStdErrRedirection();
+
+//
+// closeView() function
+//
+void closeView(TView *p, void *p1)
+{
+ if (p)
+ message(p, evCommand, cmClose, p1);
+}
+
+#include <pal.h>
+
+char SEcpColor[] ={ SE_cpColor 0 };
+char SEcpBlackWhite[]={ SE_cpBlackWhite 0 };
+char SEcpMonochrome[]={ SE_cpMonochrome 0 };
+
+TPalette& TSetEditorApp::getPalette() const
+{
+ static TPalette color ( SEcpColor, sizeof( SEcpColor )-1 );
+ static TPalette blackwhite( SEcpBlackWhite, sizeof( SEcpBlackWhite )-1 );
+ static TPalette monochrome( SEcpMonochrome, sizeof( SEcpMonochrome )-1 );
+ static TPalette *palettes[] =
+ {
+ &color,
+ &blackwhite,
+ &monochrome
+ };
+ return *(palettes[appPalette]);
+}
+
+static
+void FixUpName(char *fileName)
+{
+ if (!fileName) return;
+ // Correct the name
+ int l=strlen(fileName)-1;
+ if (fileName[l]=='.')
+ fileName[l]=0;
+}
+
+static
+unsigned Surface(TRect &r)
+{
+ TPoint dif=r.b-r.a;
+ if (dif.x<=0 || dif.y<=0)
+ return 0;
+ return dif.x*dif.y;
+}
+
+static
+void FindBestRect(TRect &avail, TRect &avoid, TRect &ret)
+{
+ TRect left;
+ left.a=avail.a;
+ left.b.x=avoid.a.x;
+ left.b.y=avail.b.y;
+
+ TRect right;
+ right.a.x=avoid.b.x;
+ right.a.y=avail.a.y;
+ right.b=avail.b;
+
+ TRect upper;
+ upper.a=avail.a;
+ upper.b.x=avail.b.x;
+ upper.b.y=avoid.a.y;
+
+ TRect lower;
+ lower.a.x=avail.a.x;
+ lower.a.y=avoid.b.y;
+ lower.b=avail.b;
+
+ unsigned sl=Surface(left);
+ unsigned sr=Surface(right);
+ unsigned su=Surface(upper);
+ unsigned so=Surface(lower);
+
+ if (sl>sr)
+ {
+ if (sl>su)
+ ret=sl>so ? left : lower;
+ else
+ ret=su>so ? upper : lower;
+ }
+ else
+ {
+ if (sr>su)
+ ret=sr>so ? right : lower;
+ else
+ ret=su>so ? upper : lower;
+ }
+}
+
+TCEditWindow *TSetEditorApp::openEditor(char *fileName, Boolean visible,
+ EditorResume *res, int options)
+{
+ Boolean openAsReadOnly=(options & oedForceRO) ? True : False;
+ int numEditors=0;
+ TCEditWindow *ain=NULL;
+
+ if (visible && fileName)
+ {
+ edHelper->reIdEditors();
+ ain=IsAlreadyOnDesktop(fileName,&numEditors);
+ }
+ TRect r=deskTop->getExtent();
+ TView *p;
+
+ // Let some space
+ Boolean sizeDetermined=False;
+ if (geFlags & geAvoidPrjAndMsg)
+ {// Avoid message and project windows
+ TRect prj, msg;
+ Boolean prjF, msgF;
+
+ prjF=ProjectGetSize(prj);
+ msgF=EdMessageGetSize(msg);
+ if (msgF || prjF)
+ {
+ TRect desk=r;
+ sizeDetermined=True;
+ if (prjF)
+ FindBestRect(r,prj,r);
+ if (msgF)
+ FindBestRect(r,msg,r);
+ // Ensure the result is usable
+ TPoint sz=r.b-r.a;
+ if (sz.x<24)
+ {
+ r.b.x=r.a.x+24;
+ if (r.b.x>desk.b.x)
+ {
+ int dif=r.b.x-desk.b.x;
+ r.b.x-=dif;
+ r.a.x-=dif;
+ }
+ }
+ if (sz.y<6)
+ {
+ r.b.y=r.a.y+6;
+ if (r.b.y>desk.b.y)
+ {
+ int dif=r.b.y-desk.b.y;
+ r.b.y-=dif;
+ r.a.y-=dif;
+ }
+ }
+ }
+ }
+ if (!sizeDetermined)
+ {
+ if (geFlags & geVertWindows)
+ {
+ if (geFlags & geRightSide)
+ r.b.x-=widthVertWindows;
+ else
+ r.a.x=widthVertWindows;
+ }
+ else
+ r.b.y-=7;
+ }
+ /* First check if the user wants more copies, in this case foget the one found */
+ if (ain && numEditors<maxOpenEditorsSame)
+ {
+ /* If we have only RO editors open it as !RO */
+ if (!openAsReadOnly && !ain->editor->isReadOnly)
+ openAsReadOnly=True;
+ ain=NULL;
+ }
+ if (ain)
+ {
+ if (options & oedForgetResume)
+ ain->editor->handleCommand(cmcTextStart);
+ if (options & oedNoSelect)
+ {
+ if (deskTop->current->prev()!=ain)
+ {
+ deskTop->lock();
+ TView *c=deskTop->current;
+ ain->options&= ~ofSelectable;
+ ain->makeFirst();
+ ain->options|=ofSelectable;
+ c->select();
+ deskTop->unlock();
+ }
+ }
+ else
+ ain->select();
+ p=(TView *)ain;
+ if (openAsReadOnly) // Could be forced
+ ain->editor->isReadOnly=True;
+ }
+ else
+ {
+ FixUpName(fileName);
+ // If the file is in the project open it using the relative path as if
+ // the file came from the project
+ char *relName=GetRelIfFileInPrj(fileName);
+ ain=new TCEditWindow(r,relName ? relName : fileName,wnNoNumber,openAsReadOnly);
+ string_free(relName);
+ if ((options & oedDontOpenEmpty) && ain->editor->FailedToLoad)
+ {
+ CLY_destroy(ain);
+ return 0;
+ }
+ p=validView(ain);
+ // If fail during load
+ if (!p)
+ return (TCEditWindow *)p;
+
+ ain=(TCEditWindow *)p;
+
+ // Transfer the special lines
+ TSpCollection *spL=SpLinesGetFor(fileName);
+ if (spL)
+ ain->editor->SetSpecialLines(spL);
+ #ifdef TEST_SPLINES
+ ain->editor->SetSpecialLines(spLines);
+ #endif
+
+ if (visible)
+ { // A local copy, we can use a pointer
+ int validResume=0;
+ EditorResume r;
+ if (res)
+ {
+ CopyEditorResume(&r,res);
+ validResume=1;
+ }
+ validResume|=AskForClosedResume(&r,fileName);
+ validResume|=AskForProjectResume(&r,fileName);
+ AddToEditorsHelper((TCEditWindow *)p,1);
+ unsigned dstOps=GetDSTOptions();
+ if (validResume && // If the user doesn't like memories forget it.
+ !(dstOps & (dstNoCursorPos | dstEdNever)) &&
+ !(options & oedForgetResume))
+ ain->ApplyResume(r);
+ if (options & oedNoSelect)
+ {
+ deskTop->lock();
+ TView *c=deskTop->current;
+ deskTop->insert(p);
+ c->select();
+ deskTop->unlock();
+ }
+ else
+ deskTop->insert(p);
+
+ if (!validResume)
+ {
+ int prjWinThere=IsPrjOpened() && IsPrjVisible();
+ switch (TSetEditorApp::geFlags & geMask2)
+ {
+ case geZoomedIfNoPrj:
+ // When the project is OFF zoom it
+ if (!prjWinThere)
+ ain->zoom();
+ break;
+ case geZoomedNPorZ:
+ if (!prjWinThere || IsPrjZoomed())
+ ain->zoom();
+ break;
+ case geAlwaysZoomed:
+ ain->zoom();
+ break;
+ }
+ }
+ }
+ else
+ {
+ p->hide();
+ deskTop->insert(p);
+ }
+ }
+ if (options & oedZoom)
+ {
+ TPoint minSize, maxSize;
+ ain->sizeLimits(minSize,maxSize);
+ if (ain->size!=maxSize)
+ ain->zoom();
+ }
+ return (TCEditWindow *)p;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Sets the window title. Of course it only works when windowed ;-)
+
+***************************************************************************/
+
+void TSetEditorApp::SetTitle(const char *str1, const char *str2)
+{
+ char *str0="SETEdit ";
+ int len=strlen(str0)+sizeof(TCEDITOR_VERSION_STR)+3;
+
+ if (!str1) str1=__("No project loaded");
+ char *istr1=TVIntl::getTextNew(str1);
+ len+=strlen(istr1);
+ if (str2)
+ len+=strlen(str2);
+ len++;
+
+ char *s=(char *)alloca(len);
+ strcpy(s,str0);
+ strcat(s,TCEDITOR_VERSION_STR);
+ strcat(s," - ");
+ strcat(s,istr1);
+ if (str2) strcat(s,str2);
+
+ if (!OriginalWindowTitle)
+ OriginalWindowTitle=(char *)TScreen::getWindowTitle();
+ TScreen::setWindowTitle(s);
+ DeleteArray(istr1);
+}
+
+TSetEditorApp::~TSetEditorApp()
+{
+ if (OriginalWindowTitle)
+ {
+ // That's just in case, but isn't really needed. Not at least in W9x
+ TScreen::setWindowTitle((const char *)OriginalWindowTitle);
+ delete[] OriginalWindowTitle;
+ }
+ CLY_destroy(soCol);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's a hook for the editor. The editor doesn't interact with the user
+directly instead most of the dialogs are created through calls
+TCEditor::editorDialog in this way we can change the behavior easilly. But
+this routine takes a variable number of arguments and hence is hard to
+"hook the hook". For this reason now I provide a default function in
+doedidia.cc that must be called indirectly by the editor. Synopsis: That's
+a hook for the hook function.
+
+***************************************************************************/
+
+unsigned doEditDialogLocal(int dialog, ...)
+{
+ typedef char *charPtr;
+ va_list arg;
+ char *str;
+ int flags;
+
+ va_start(arg,dialog);
+ switch(dialog)
+ {
+ case edFileExists:
+ str=va_arg(arg,charPtr);
+ flags=va_arg(arg,int);
+ if (!flags && IsAlreadyOnDesktop(str))
+ {
+ messageBox(__("This file is already open, close it first."),mfError | mfOKButton);
+ return cmNo;
+ }
+ break;
+ }
+ va_end(arg);
+
+ va_start(arg,dialog);
+ unsigned ret=doEditDialog(dialog,arg);
+ va_end(arg);
+ return ret;
+}
+
+TSetEditorApp::TSetEditorApp() :
+ TProgInit( TSetEditorApp::initStatusLine,
+ TSetEditorApp::initMenuBar,
+ TSetEditorApp::initDeskTop
+ ),
+ TApplication()
+{
+ TCommandSet ts;
+ ts.enableCmd(cmcSave);
+ ts.enableCmd(cmcSaveAs);
+ ts.enableCmd(cmcCut);
+ ts.enableCmd(cmcCopy);
+ ts.enableCmd(cmcPaste);
+ ts.enableCmd(cmcClear);
+ ts.enableCmd(cmcUndo);
+ ts.enableCmd(cmcRedo);
+ ts.enableCmd(cmcFind);
+ ts.enableCmd(cmcReplace);
+ ts.enableCmd(cmcSearchAgain);
+ ts.enableCmd(cmeClosePrj);
+ ts.enableCmd(cmeSavePrj);
+ ts.enableCmd(cmeExportPrj);
+ ts.enableCmd(cmeImportPrj);
+ if (TScreen::noUserScreen())
+ {
+ ts.enableCmd(cmeDosShell);
+ ts.enableCmd(cmeUserScreen);
+ }
+ disableCommands(ts);
+ DebugCommandsForDisc();
+
+ TCEditor::editorDialog=doEditDialogLocal;
+ doNotReleaseCPU=1;
+
+ // The clipboard is created during the load of the DeskTop
+ clipWindow=0;
+ OriginalWindowTitle=0;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the name of the keybinding file. Passing 1 for save the name
+returned should be valid for writing. If the user specified an special name
+in the command line that's the returned value.
+
+ Return:
+ keybind.dat file name.
+
+***************************************************************************/
+
+static
+char *GetKeyBindFName(int save)
+{
+ if (KeyBindFNameUser)
+ return KeyBindFNameUser;
+ return save ? ExpandHomeSave(KeyBindFName) : ExpandHome(KeyBindFName);
+}
+
+/* No longer used
+int FileOpenDialog(char *title, char *file)
+{
+ return
+ execDialog( new TFileDialog( file, title, __("~N~ame"), fdOpenButton, hID_FileOpen ),
+ file) != cmCancel;
+}*/
+
+
+void TSetEditorApp::fileOpen()
+{
+ char fileName[PATH_MAX];
+ strcpy(fileName,"*");
+
+ if (GenericFileDialog(__("Open File"),fileName,0,hID_FileOpen)!=cmCancel)
+ openEditor(fileName,True);
+}
+
+void TSetEditorApp::fileOpenCopy()
+{
+ TCEditor *e;
+
+ if ((e=GetCurrentIfEditor())!=0)
+ { // Open a RO copy
+ maxOpenEditorsSame++;
+ openEditor(e->fileName,True);
+ maxOpenEditorsSame--;
+ }
+ else
+ messageBox(__("You must select an editor window for this operation"),mfError | mfOKButton);
+}
+
+void TSetEditorApp::fileNew()
+{
+ openEditor( 0, True );
+}
+
+void TSetEditorApp::changeDir()
+{
+ TChDirDialog *d=new TChDirDialog(cdNormal,0);
+ d->helpCtx=cmeChangeDrct;
+ execDialog(d,0);
+}
+
+void FullSuspendScreen()
+{
+ //TProgram::deskTop->setState(sfVisible,False);
+ TProgram::application->suspend();
+}
+
+int ResetVideoMode(int mode, int redraw)
+{
+ int wasExt=0;
+ // Kill the clock because it's never resized correctly
+ editorApp->KillClock();
+ // Set the video mode
+ if (TSetEditorApp::UseExternPrgForMode)
+ {
+ TProgram::application->setScreenMode(0xFFFF,TSetEditorApp::ExternalPrgMode);
+ wasExt=1;
+ }
+ else
+ TProgram::application->setScreenMode(mode);
+ // We ever use intense mode I don't need blinks
+ //setIntenseState();
+ // Restore the user palette, we can lose it during the setScreenMode
+ RestorePaletteSystem();
+ // Redraw ALL
+ if (redraw)
+ { // Force a full redraw
+ TProgram::deskTop->setState(sfVisible,True);
+ TProgram::deskTop->redraw();
+ TProgram::application->redraw();
+ }
+ if (wasExt)
+ return 0;
+ // Check for succesfull change
+ if (mode==7 || mode==3)
+ return TScreen::screenMode!=mode;
+ return TScreen::screenMode==3 || TScreen::screenMode==7;
+}
+
+int TSetEditorApp::resetVideoMode(Boolean redraw)
+{
+ // Kill the clock because it's never resized correctly
+ editorApp->KillClock();
+ // Set the video mode
+ if (so->scOptions==scfSameLast || so->scOptions==scfForced)
+ TProgram::application->setScreenMode(so->scWidth,so->scHeight,so->scCharWidth,so->scCharHeight);
+ else if (so->scOptions==scfExternal && so->scCommand)
+ TProgram::application->setScreenMode(0xFFFF,so->scCommand);
+ else if (so->scOptions==scfMode)
+ TProgram::application->setScreenMode(so->scModeNumber);
+ // We ever use intense mode I don't need blinks
+ //setIntenseState();
+ // Restore the user palette, we can lose it during the setScreenMode
+ RestorePaletteSystem();
+ // Redraw ALL
+ if (redraw)
+ { // Force a full redraw
+ TProgram::deskTop->setState(sfVisible,True);
+ TProgram::deskTop->redraw();
+ TProgram::application->redraw();
+ }
+ if (so->scOptions==scfExternal && so->scCommand)
+ return 0;
+ // Check for succesfull change
+ if (so->scOptions==scfMode)
+ {
+ if (so->scOptions==7 || so->scOptions==3)
+ return (unsigned)TScreen::screenMode!=so->scOptions;
+ return TScreen::screenMode==3 || TScreen::screenMode==7;
+ }
+ return 0;// ?
+}
+
+void FullResumeScreen()
+{
+ TProgram::application->resume();
+ ResetVideoMode(TScreen::screenMode); // It resumes the palette too
+}
+
+void TSetEditorApp::showClip()
+{
+ clipWindow->select();
+ clipWindow->show();
+}
+
+void TSetEditorApp::tile()
+{
+ deskTop->tile(deskTop->getExtent());
+}
+
+void TSetEditorApp::cascade()
+{
+ deskTop->cascade(deskTop->getExtent());
+}
+
+void CopyHelp2Clip(char *b, long l)
+{
+ if (TSetEditorApp::clipWindow)
+ TSetEditorApp::clipWindow->editor->insertBuffer( b,0,(unsigned)l,False,True);
+}
+
+static
+void ExportAsHTML(void)
+{
+ TCEditor *e;
+
+ if ((e=GetCurrentIfEditor())!=0)
+ {
+ struct
+ {
+ uint32 flags;
+ uint32 color;
+ } flags;
+ flags.flags=xhtmlTitle | xhtmlBackground | xhtmlMonoFont | xhtmlBoldFont |
+ xhtmlUseCSS;
+ flags.color=0;
+ if (!TCEditor::editorDialog(edExportHTMLOps,&flags)) return;
+
+ char fileName[PATH_MAX];
+ strcpy(fileName,"*.html");
+
+ if (GenericFileDialog(__("Export file as"),fileName,"*",hID_FileSave,
+ fdDialogForSave)!=cmCancel)
+ {
+ if (access(fileName,F_OK)==0 &&
+ TCEditor::editorDialog(edFileExists,fileName,0)==cmNo)
+ return;
+ FILE *f=fopen(fileName,"wb");
+ if (f)
+ {/* Create a table with the palette */
+ unsigned pal[16];
+ GetRGBArrayPaletteSystem(pal);
+ unsigned flgs=flags.flags;
+ if (flags.color==0)
+ flgs|=xhtmlUseColors;
+ e->SourceToHTML(f,pal,flgs);
+ if (ferror(f))
+ TCEditor::editorDialog(edWriteError,fileName,NULL);
+ fclose(f);
+ }
+ else
+ TCEditor::editorDialog(edCreateError,fileName);
+ }
+ }
+}
+
+static
+char *GetWordUnderCursor(unsigned size, unsigned options=0)
+{
+ TCEditor *e;
+
+ if ((e=GetCurrentIfEditor())!=0)
+ return e->WordUnderCursor(size,options);
+ return 0;
+}
+
+static
+void MakeTagsWordCompletion()
+{
+ TCEditor *e;
+
+ if ((e=GetCurrentIfEditor())!=0)
+ {
+ char *word=e->WordUnderCursor(80,wucTakeOneLeft | wucIncludeColon | wucCanStartColon);
+ if (word)
+ {
+ unsigned l=strlen(word);
+ char *exp;
+ Boolean fullInsert=False;
+
+ if (l>2 && word[l-1]==':' && word[l-2]==':')
+ {// That's for C++ classes
+ word[l-2]=0;
+ exp=TagsWordCompletionClass(e->cursor.x+e->owner->origin.x,
+ e->cursor.y+e->owner->origin.y+1,word);
+ fullInsert=True;
+ }
+ else
+ exp=TagsWordCompletion(e->cursor.x+e->owner->origin.x,
+ e->cursor.y+e->owner->origin.y+1,word);
+ if (exp)
+ {
+ char *cursor=e->ColToPointerPost();
+ if (!fullInsert)
+ e->deleteRange(cursor-strlen(word),cursor,True);
+ e->insertText(exp,strlen(exp),False);
+ DeleteArray(exp);
+ }
+ DeleteArray(word);
+ }
+ }
+}
+
+static
+void PrintEditor(void)
+{
+ TCEditor *e;
+
+ if ((e=GetCurrentIfEditor())!=0)
+ {
+ if (e->IslineInEdition)
+ e->MakeEfectiveLineInEdition();
+ e->buffer[e->bufLen]=0;
+ char *s=strrchr(e->fileName,'/');
+ if (!s)
+ s=e->fileName;
+ else
+ s++;
+ PrintSource(e->buffer,s,e->tabSize);
+ }
+ else
+ messageBox(__("This window can't be printed. Select an editor window instead"),mfError | mfOKButton);
+}
+
+#define T(a) \
+case cme##a:\
+ event.message.command=cm##a;\
+ TApplication::handleEvent(event);\
+ return;
+#define TCheck(a) \
+case cme##a:\
+ if (TProgram::deskTop->current)\
+ {\
+ event.message.command=cm##a;\
+ TApplication::handleEvent(event);\
+ }\
+ return;
+
+void TSetEditorApp::getEvent(TEvent& event)
+{
+ // Why in the hell that's so tricky? If I don't get the context here but in the
+ // handleEvent the originating routine already lost the focus so I get nothing
+ TApplication::getEvent(event);
+ if (helpRequest && event.what==evNothing)
+ { // If we already got a request now pop-up the help
+ event.what=evCommand;
+ event.message.command=cmHelp;
+ }
+ switch (event.what)
+ {
+ case evCommand:
+ switch (event.message.command)
+ {
+ case cmHelp:
+ case cmeInfView:
+ if (!helpRequest)
+ { // It acts like a latch to hold the context until the help is displayed
+ helpRequest=1;
+ helpCtxRequested=getHelpCtx();
+ event.message.command=evNothing;
+ }
+ else
+ {
+ GetContextHelp();
+ clearEvent(event);
+ }
+ break;
+ }
+ break;
+ }
+}
+
+void TSetEditorApp::handleEvent( TEvent& event )
+{
+ TApplication::handleEvent( event );
+ if (event.what==evBroadcast)
+ {
+ if (event.message.command==cmClosingWindow && edHelper)
+ edHelper->removeWindow(event.message.infoPtr);
+ // We clear the event before returning
+ else
+ return;
+ }
+ else
+ if (event.what!=evCommand)
+ return;
+ else
+ {
+ switch (event.message.command)
+ {
+ case cmeOpen:
+ fileOpen();
+ break;
+
+ // Drag 'n' drop support for JASC's WinGr driver.
+ case cmOpen:
+ if (event.message.infoPtr)
+ openEditor((char *)event.message.infoPtr,True);
+ break;
+
+ case cmeNew:
+ fileNew();
+ break;
+
+ case cmeOpenROCopy:
+ fileOpenCopy();
+ break;
+
+ case cmeChangeDrct:
+ changeDir();
+ break;
+
+ case cmeDosShell:
+ dosShell();
+ break;
+
+ case cmeShowClip:
+ showClip();
+ break;
+
+ case cmeTile:
+ tile();
+ break;
+
+ case cmeCascade:
+ cascade();
+ break;
+
+ case cmeCalculator:
+ executeCalc(GetWordUnderCursor(250));
+ // In case the user copied to the clipboard.
+ UpdateEditorCommands();
+ break;
+
+ case cmePocketCalc:
+ pocketCalculator();
+ break;
+
+ case cmeGrepDialog:
+ if (RunExternalProgramNotRunning())
+ grepWindow(GetWordUnderCursor(maxGrepString));
+ break;
+
+ case cmeInfView:
+ GetContextHelp();
+ break;
+
+ case cmeLastHelp:
+ InfManager->MakeVisible();
+ break;
+
+ case cmeAnotherInfView:
+ {
+ TDskWinHelp *p;
+
+ p=new TDskWinHelp(EditorFile,"");
+ deskTop->insert(p->window);
+ edHelper->addNonEditor(p);
+ p->window->select();
+ p->window->show();
+ }
+ break;
+
+ case cmeManPageView:
+ {
+ TDskWinMan *p;
+ char *word=GetWordUnderCursor(80);
+
+ p=ManPageView(word);
+ if (p)
+ {
+ deskTop->insert(p->view);
+ edHelper->addNonEditor(p);
+ p->view->select();
+ p->view->show();
+ }
+ delete[] word;
+ }
+ break;
+
+ case cmeSyntaxHelp:
+ {
+ char *FileName,*NodeName,*VisibleName;
+ char *word=GetWordUnderCursor(MAX_NODE_NAME);
+ switch (SyntaxSearch_Search(word,FileName,NodeName,VisibleName))
+ {
+ case 0:
+ messageBox(__("Couldn't find any matching help"),mfOKButton);
+ break;
+ case 1:
+ InfManager->Goto(FileName,NodeName,
+ SyntaxSearch_GetJumpOption() ? VisibleName : 0);
+ InfManager->MakeVisible();
+ break;
+ }
+ delete[] word;
+ }
+ break;
+
+ case cmeSyntaxHelpOps:
+ SyntaxSearch_EditSettings();
+ break;
+
+ case cmeSyntaxHelpFiles:
+ SyntaxSearch_EditFilesList();
+ break;
+
+ case cmeTipOfTheDay:
+ ShowTips(ExpandHome(TipsFName),1);
+ break;
+
+ case cmeAboutBox:
+ FullAboutBox();
+ break;
+
+ case cmeListWin:
+ BringListOfWindows();
+ break;
+
+ case cmeUserScreen:
+ ShowUserScreen(event);
+ break;
+
+ case cmeEditKeyBind:
+ if (KeyBindEdit())
+ SaveKeyBind(GetKeyBindFName(1));
+ break;
+
+ case cmeSetUpAltKeys:
+ if (AltKeysSetUp())
+ SaveKeyBind(GetKeyBindFName(1));
+ break;
+
+ case cmeKbBackDefault:
+ if (KeyBackToDefault())
+ SaveKeyBind(GetKeyBindFName(1));
+ break;
+
+ case cmeKeyPadBehavior:
+ if (KeyPadSetUp())
+ SaveKeyBind(GetKeyBindFName(1));
+ break;
+
+ case cmeSeeScanCodes:
+ SeeScanCodes();
+ break;
+
+ case cmeOpenPrj:
+ if (DebugConfirmEndSession())
+ OpenProject();
+ break;
+
+ case cmeClosePrj:
+ if (DebugConfirmEndSession())
+ CloseProject(1);
+ break;
+
+ case cmeSavePrj:
+ SaveProject();
+ break;
+
+ case cmeSaveDesktop:
+ SaveDesktopHere();
+ break;
+
+ case cmeExportPrj:
+ ExportProjectItems();
+ break;
+
+ case cmeImportPrj:
+ ImportProjectItems();
+ break;
+
+ case cmeSDG:
+ if (RunExternalProgramNotRunning())
+ SDGInterfaceRun();
+ break;
+
+ case cmeSDGDialog:
+ SDGInterfaceDialog();
+ break;
+
+ case cmeSetColors:
+ Colors();
+ break;
+
+ case cmeColorTheme:
+ ColorTheme();
+ break;
+
+ case cmePrintEditor:
+ PrintEditor();
+ break;
+
+ case cmeSetUpPrinter:
+ PrintSetup();
+ break;
+
+ case cmeNextMessage:
+ EdMessageSelectNext();
+ break;
+
+ case cmePrevMessage:
+ EdMessageSelectPrev();
+ break;
+
+ case cmeSetScreenOps:
+ //SetScreenOps();
+ ScreenOptions();
+ break;
+
+ case cmeEditPalette:
+ EditPalette();
+ break;
+
+ case cmeEdGralOptions:
+ {
+ SetGeneralEditorOptions();
+ // The save-as-is option affects some commands.
+ UpdateEditorCommands();
+ }
+ break;
+
+ case cmeScreenSaverOpts:
+ SetScreenSaversOptions();
+ break;
+
+ case cmcSetGlobalOptions:
+ TCEditor::SetGlobalOptions();
+ break;
+
+ case cmeEditUserWords:
+ TCEditUserWords(ExpandHomeSave(GetNameOfUserWordsFile()),cmeEditUserWords);
+ edHelper->redrawEditors();
+ break;
+
+ case cmeEditDeflOpts:
+ TCEditDefaultOpts(ExpandHomeSave(GetNameOfDefaultOptsFile()),cmeEditDeflOpts);
+ break;
+
+ case cmeRunCommand:
+ if (RunExternalProgramNotRunning())
+ RunExternalProgram();
+ break;
+
+ case cmeConfRunCommand:
+ ConfigureRunCommand();
+ break;
+
+ case cmeStopChild:
+ RunExternalProgramStopChild();
+ break;
+
+ case cmeHTMLAccents:
+ HTMLAcc_Entry(False);
+ break;
+
+ case cmeHTMLTag2Accent:
+ HTMLAcc_Entry(True);
+ break;
+
+ case cmeExportAsHTML:
+ ExportAsHTML();
+ break;
+
+ case cmeQuitDelete:
+ DeleteFilesOnExit=1;
+ case cmeQuit:
+ if (RunExternalProgramRunning())
+ {
+ if (messageBox(__("A background task is still running, exit anyway?"),
+ mfYesButton | mfNoButton | mfConfirmation)==cmNo)
+ {
+ DeleteFilesOnExit=0;
+ break;
+ }
+ RunExternalProgramStopChild();
+ }
+ if (!DebugConfirmEndSession())
+ {
+ DeleteFilesOnExit=0;
+ break;
+ }
+ if (DeleteFilesOnExit)
+ {
+ int ret=messageBoxDSA(cmeQuitDeleteMessage,
+ mfYesButton | mfNoButton | mfWarning,"SET_CONFQUIT",cmYes);
+ if (ret!=cmYes)
+ {
+ DeleteFilesOnExit=0;
+ if (ret==cmCancel)
+ break;
+ }
+ }
+ event.message.command=cmQuit;
+ TApplication::handleEvent(event);
+ break;
+
+ case cmeDeleteBkps:
+ KillFilesToKill();
+ ReleaseFilesToKill();
+ break;
+
+ case cmeASCIIChart:
+ ASCIIWindow();
+ break;
+
+ case cmeCalendar:
+ CalendarWindow();
+ break;
+
+ case cmeFileOpenOptions:
+ SetFileOpenDialogOptions();
+ break;
+
+ case cmeRemapCodePage:
+ RemapCodePageEd();
+ break;
+
+ case cmeReDraw:
+ redraw();
+ break;
+
+ case cmeBoardMixer:
+ BoardMixerDialog();
+ break;
+
+ case cmeEditNoBkp:
+ NBKPEdit();
+ break;
+
+ case cmeIncludeList:
+ PathListEdit(paliInclude,cmeIncludeList);
+ break;
+
+ case cmeSourceList:
+ PathListEdit(paliSource,cmeSourceList);
+ break;
+
+ case cmeEncodings:
+ EncodingOptions();
+ break;
+
+ case cmeFonts:
+ FontsOptions();
+ break;
+
+ case cmeSaveAll:
+ SaveAllEditors();
+ break;
+
+ case cmeTagFiles:
+ EditTagFiles();
+ break;
+
+ case cmeSearchTag:
+ SearchTag(GetWordUnderCursor(80));
+ break;
+
+ case cmeClassBrowser:
+ TagsClassBrowser(GetWordUnderCursor(80));
+ break;
+
+ case cmeWordCompletion:
+ MakeTagsWordCompletion();
+ break;
+
+ case cmeTagsOps:
+ SetTagFilesGenerationOptions();
+ break;
+
+ case cmeTagsAutoRegen:
+ TagsAutoRegen();
+ break;
+
+ case cmeHolidaysConf:
+ ConfigureHolidays();
+ break;
+
+ case cmeSetModiCkOps:
+ SetModifCheckOptions();
+ break;
+
+ case cmeAdviceDiagConf:
+ AdviceManager();
+ break;
+
+ case cmeSelWinPrj:
+ SelectWindowNumber(-dktPrj);
+ break;
+
+ case cmeSelWinMessage:
+ SelectWindowNumber(-dktMessage);
+ break;
+
+ case cmeSelDebugWin:
+ SelectWindowNumber(-dktDbgMsg);
+ break;
+
+ case cmeSelWatchesWin:
+ SelectWindowNumber(-dktDbgWt);
+ break;
+
+ case cmeSelWindow1:
+ case cmeSelWindow2:
+ case cmeSelWindow3:
+ case cmeSelWindow4:
+ case cmeSelWindow5:
+ case cmeSelWindow6:
+ case cmeSelWindow7:
+ case cmeSelWindow8:
+ case cmeSelWindow9:
+ case cmeSelWindow10:
+ case cmeSelWindow11:
+ case cmeSelWindow12:
+ case cmeSelWindow13:
+ case cmeSelWindow14:
+ case cmeSelWindow15:
+ case cmeSelWindow16:
+ case cmeSelWindow17:
+ case cmeSelWindow18:
+ case cmeSelWindow19:
+ SelectWindowNumber(event.message.command-cmeSelWindow1+1);
+ break;
+
+ case cmeGPushCursorPos:
+ GPushCursorPos();
+ break;
+
+ case cmeGPopCursorPos:
+ GPopCursorPos();
+ break;
+
+ //********** DEBUG commands
+ case cmeBreakpoint:
+ DebugToggleBreakpoint();
+ break;
+
+ case cmeDebugOptions:
+ DebugOptionsEdit();
+ break;
+
+ case cmeDbgRunContinue:
+ DebugRunOrContinue();
+ break;
+
+ case cmeDbgStepOver:
+ DebugStepOver();
+ break;
+
+ case cmeDbgTraceInto:
+ DebugTraceInto();
+ break;
+
+ case cmeDbgGoToCursor:
+ DebugGoToCursor();
+ break;
+
+ case cmeDbgFinishFun:
+ DebugFinishFun();
+ break;
+
+ case cmeDbgReturnNow:
+ DebugReturnNow();
+ break;
+
+ case cmeDbgStop:
+ DebugStop();
+ break;
+
+ case cmeDbgKill:
+ DebugKill();
+ break;
+
+ case cmeDbgCallStack:
+ DebugCallStack();
+ break;
+
+ case cmeDbgEvalModify:
+ DebugEvalModify(GetWordUnderCursor(250));
+ break;
+
+ case cmeDbgOptsMsgs:
+ DebugOptsMsgs();
+ break;
+
+ case cmeDbgWatchExpNorm:
+ DebugWatchExp(False,GetWordUnderCursor(250));
+ break;
+
+ case cmeDbgWatchExpScp:
+ DebugWatchExp(True,GetWordUnderCursor(250));
+ break;
+
+ case cmeDbgEndSession:
+ if (DebugConfirmEndSession(True)) // Indicate that's user explicit request
+ DebugDeInitVars();
+ break;
+
+ case cmeDbgCloseSession:
+ DebugCloseSession(); // It asks for confirmation.
+ break;
+
+ case cmeDbgGoConnected:
+ DebugCheckAcceptCmd(True);
+ break;
+
+ case cmeDbgGoReadyToRun:
+ DebugCheckStopped(True);
+ break;
+
+ case cmeDbgEditBreakPts:
+ DebugEditBreakPts();
+ break;
+
+ case cmeDbgEditWatchPts:
+ DebugEditWatchPts(GetWordUnderCursor(250));
+ break;
+
+ case cmeDbgInspector:
+ DebugInspector(GetWordUnderCursor(250));
+ break;
+
+ case cmeDbgDataWindow:
+ DebugDataWindow(GetWordUnderCursor(250));
+ break;
+
+ case cmeDbgStackWindow:
+ DebugStackWindow();
+ break;
+
+ case cmeDbgCleanElem:
+ DebugCleanElem();
+ break;
+
+ case cmeDbgThreadSel:
+ DebugThreadSel();
+ break;
+
+ case cmeDbgOptionsAdv:
+ DebugOptionsAdv();
+ break;
+
+ case cmeDbgDisAsmWin:
+ DebugDisAsmWin();
+ break;
+
+ case cmeDbgDetach:
+ DebugDetach();
+ break;
+
+ // These commands are traslated to the original values
+ TCheck(Resize)
+ TCheck(Zoom)
+ TCheck(Next)
+ TCheck(Prev)
+ TCheck(Close)
+
+ default:
+ ProcessMP3Commands;
+ if (isAMacroInMenu(event.message.command)) break;
+ return;
+ }
+ }
+ clearEvent( event );
+}
+#undef T
+
+void TSetEditorApp::RemapCodePageEd(void)
+{
+ TCEditor *e;
+ int from,to;
+ unsigned ops;
+
+ if ((e=GetCurrentIfEditor())!=0 && ChooseConvCPs(from,to,ops))
+ e->RemapCodePageBuffer(from,to,ops);
+}
+
+void TSetEditorApp::pocketCalculator(void)
+{
+ #if HAVE_CALCULATOR
+ TCalculator *calc=(TCalculator *)validView(new TCalculator);
+
+ if (calc)
+ {
+ //calc->helpCtx = hcCalculator; very obvious to use
+ deskTop->insert(calc);
+ }
+ #else
+ messageBox(__("This functionality was disabled at compile time"),
+ mfError | mfOKButton);
+ #endif
+}
+
+char DumpStartName[]="\n\n>>>>>>>>>>>>>>\n";
+
+void DumpEditors(void)
+{
+ if (TSetEditorApp::edHelper)
+ {
+ int c=TSetEditorApp::edHelper->Editors;
+ if (c>0 && c<100)
+ {
+ int i;
+ TDskWinEditor *st;
+ for (i=0; i<c; i++)
+ {
+ st=(TDskWinEditor *)(TSetEditorApp::edHelper->at(i));
+ if (st)
+ {
+ TCEditWindow *edw=st->edw;
+ if (edw)
+ {
+ TCEditor *ed=edw->editor;
+ if (ed->modified==True)
+ {
+ unsigned l=ed->bufLen;
+ char *b=ed->buffer;
+ ed->fileName[PATH_MAX-1]=0;
+ BestWrite(DumpStartName,sizeof(DumpStartName)-1);
+ BestWrite(ed->fileName,strlen(ed->fileName));
+ BestWrite(DumpStartName,sizeof(DumpStartName)-1);
+ if (b && l<1000000)
+ BestWrite(b,l);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+static
+void WaitForKeyDown(TEvent &event)
+{
+ #ifdef SECompf_djgpp
+ do
+ {
+ editorApp->idle();
+ editorApp->clearEvent(event);
+ event.getKeyEvent();
+ }
+ while ((event.what & (evKeyDown)) == 0);
+ #endif
+ #ifdef SEOS_UNIX
+ // The Linux port is totally broken and needs this workaround
+ getchar();
+ editorApp->clearEvent(event);
+ #endif
+ #ifdef SEOS_Win32
+ //$todo: implement (SAA)
+ #endif
+}
+
+void TSetEditorApp::ShowUserScreen(TEvent &event)
+{
+ #ifdef SEOS_UNIX
+ ShowUserScreenDialog();
+ #endif
+
+ TProgram::deskTop->setState(sfVisible,False);
+ TProgram::application->suspend();
+ WaitForKeyDown(event);
+ clearEvent(event);
+ TProgram::application->resume();
+ ResetVideoMode(TScreen::screenMode);
+}
+
+//
+// Force to link some stream modules
+//
+__link(RBackground)
+__link(RCEditWindow)
+__link(RInfViewer)
+#ifdef SEOS_Win32
+// setedit/streams
+__link(RDskWinASCII)
+__link(RDskWinCalendar)
+__link(RDskWinClipboard)
+__link(RDskWinClosed)
+__link(RDskWinEditor)
+__link(RDskWinHelp)
+__link(RDskWinMan)
+__link(RDskWinPrj)
+__link(RDskWinMP3)
+__link(RDskWinMessage)
+__link(REditorCollection)
+__link(RManWindow)
+#endif
+
+//
+// Some of the following functions are just wrappers to hide
+// the implementation of the editor's collection. In this way
+// other files doesn't need to know about edHelper and your
+// class.
+//
+
+void AddToEditorsHelper(TCEditWindow *p, int SelectHL)
+{
+ TSetEditorApp::edHelper->addEditor(p,SelectHL);
+}
+
+int IsAnEditor(void *p)
+{
+ if (!TSetEditorApp::edHelper) return 0;
+ return TSetEditorApp::edHelper->search(p,dktEditor)>=0;
+}
+
+TCEditor *GetCurrentIfEditor()
+{
+ TView *p=editorApp->deskTop->current;
+ if (!p) return 0; // Avoid a search
+ if (IsAnEditor(p))
+ return ((TCEditWindow *)p)->editor;
+ return 0;
+}
+
+void UpdateEditorCommands()
+{
+ TCEditor *e=GetCurrentIfEditor();
+ if (e)
+ e->updateCommands(1);
+}
+
+TCEditWindow *GetCurrentIfEditorWindow()
+{
+ TView *p=editorApp->deskTop->current;
+ if (!p) return 0; // Avoid a search
+ if (IsAnEditor(p))
+ return (TCEditWindow *)p;
+ return 0;
+}
+
+TCEditWindow *IsAlreadyOnDesktop(char *fileName, int *cant, stEditorId *id)
+{
+ // First search by inode, the only way
+ ccIndex pos=TSetEditorApp::edHelper->searchEditorbyINode(id,fileName,cant);
+ if (pos<0)
+ return NULL;
+ TDskWinEditor *st=(TDskWinEditor *)TSetEditorApp::edHelper->at(pos);
+ return st->edw;
+}
+
+int AskForClosedResume(EditorResume *r,char *fileName)
+{
+ if (!fileName)
+ return 0;
+ ccIndex pos=TSetEditorApp::edHelper->search(fileName,dktClosed);
+ if (pos<0)
+ return 0;
+ CopyEditorResume(r,&(((TDskWinClosed *)TSetEditorApp::edHelper->at(pos))->resume));
+ return 2;
+}
+
+int SearchInHelper(int type, void *p)
+{
+ return TSetEditorApp::edHelper->search(p,type)>=0;
+}
+
+TDskWin *SearchInHelperWin(int type, void *p)
+{
+ ccIndex pos=TSetEditorApp::edHelper->search(p,type);
+ if (pos<0)
+ return NULL;
+ return (TDskWin *)TSetEditorApp::edHelper->at(pos);
+}
+
+/*Boolean View2WindowNumber(void *view, int &number)
+{
+ ccIndex pos=TSetEditorApp::edHelper->searchByView(view);
+ if (pos==-1)
+ return False;
+ number=((TDskWinClosed *)TSetEditorApp::edHelper->at(pos))->GetNumber();
+ return True;
+}*/
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to know the biggest number of editor window
+
+ Return: The biggest number or 0 if no editors.
+
+***************************************************************************/
+
+int GetMaxWindowNumber()
+{
+ return TSetEditorApp::edHelper->GetMaxWindowNumber();
+}
+
+void AddNonEditorToHelper(TDskWin *p)
+{
+ if (p)
+ TSetEditorApp::edHelper->addNonEditor(p);
+}
+
+
+static int NamesPrinted;
+static
+void EdPrintName(void *p, void *f)
+{
+ TDskWin *dsk=(TDskWin *)p;
+ if (dsk->type==dktEditor)
+ {
+ fprintf((FILE *)f," \"%s\" ",((TDskWinEditor *)p)->edw->editor->fileName);
+ NamesPrinted++;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Selects the window that matchs the provided number. The number can be
+negative indicating a type of DskWin object, in this case the first match
+is returned.
+
+ Return: !=0 if the window was selected.
+
+***************************************************************************/
+
+int SelectWindowNumber(int number)
+{
+ TDskWin *p=TSetEditorApp::edHelper->searchByNumber(number);
+ if (p)
+ {
+ p->GoAction(0);
+ FinishFocusChange();
+ }
+ return p!=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the requested window.
+
+ Return: !=0 if the window was there.
+
+***************************************************************************/
+
+int CloseWindowNumber(int number)
+{
+ TDskWin *p=TSetEditorApp::edHelper->searchByNumber(number);
+ if (p)
+ p->DeleteAction(0,False);
+ return p!=0;
+}
+
+/**[txh]********************************************************************
+
+ Description: Returns the number of cols for the indicated window.
+
+ Return: Window width-2 or 0 on error.
+
+***************************************************************************/
+
+int GetWindowCols(int number)
+{
+ TDskWin *p=TSetEditorApp::edHelper->searchByNumber(number);
+ int ret=-1;
+ if (p)
+ ret=p->view->size.x-2;
+ return ret<0 ? 0 : ret;
+}
+
+/**[txh]********************************************************************
+
+ Description: Returns the number of rows for the indicated window.
+
+ Return: Window height-2 or 0 on error.
+
+***************************************************************************/
+
+int GetWindowRows(int number)
+{
+ TDskWin *p=TSetEditorApp::edHelper->searchByNumber(number);
+ int ret=-1;
+ if (p)
+ ret=p->view->size.y-2;
+ return ret<0 ? 0 : ret;
+}
+
+/**[txh]********************************************************************
+
+ Description: Returns the wrap column for the indicated window.
+
+ Return: The column wrap setting or 0 if that isn't an editor.
+
+***************************************************************************/
+
+int GetWrapCol(int number)
+{
+ TDskWin *p=TSetEditorApp::edHelper->searchByNumber(number);
+ return p && p->type==dktEditor ? ((TDskWinEditor *)p)->edw->editor->WrapCol : 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes all the names of the opened windows to the stream f. The names are
+separated by spaces.@p
+ Used by the Grep Interface.@p
+
+ Returns:
+ The number of names sent to the stream.
+
+***************************************************************************/
+
+int WriteNamesOfOpenedTo(FILE *f)
+{
+ NamesPrinted=0;
+ if (TSetEditorApp::edHelper)
+ TSetEditorApp::edHelper->forEach(EdPrintName,f);
+ return NamesPrinted;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Shows the file and line specified. If the file isn't opened the routine
+opens it.
+
+***************************************************************************/
+
+int ShowFileLine(int line, int column, char *file)
+{
+ if (!line)
+ return 0;
+ TCEditWindow *edw=editorApp->openEditor(file,True,0,oedNoSelect | oedDontOpenEmpty);
+ if (edw)
+ {
+ TCEditor *ed=edw->editor;
+ ed->lock();
+ ed->GoAndSelectLine(line,column);
+ ed->trackCursor(True);
+ ed->update(ufView);
+ ed->unlock();
+ return 1;
+ }
+ return 0;
+}
+
+void XYFStack::Push(uint32 aX, uint32 aY, const char *aFile)
+{
+ XYFElement *p=new XYFElement(aX,aY,aFile);
+
+ if (last)
+ {
+ last->next=p;
+ p->prev=last;
+ last=p;
+ }
+ else
+ first=last=p;
+ // Put a limit
+ count++;
+ if (count>maxXYFStack)
+ {
+ count--;
+ p=first->next;
+ first->next=NULL;
+ delete first;
+ first=p;
+ }
+}
+
+XYFElement *XYFStack::Pop()
+{
+ if (!last)
+ return NULL;
+ XYFElement *ret=last;
+ if (last->prev)
+ {
+ last=last->prev;
+ last->next=NULL;
+ }
+ else
+ first=last=NULL;
+ count--;
+
+ return ret;
+}
+
+void GPushCursorPos()
+{
+ TCEditor *e=GetCurrentIfEditor();
+ if (!e)
+ return;
+ stkPos.Push(e->curPos.x,e->curPos.y,e->fileName);
+}
+
+void GPopCursorPos()
+{
+ XYFElement *p=stkPos.Pop();
+ if (p)
+ {
+ TCEditWindow *edw=editorApp->openEditor(p->file,True,NULL,oedDontOpenEmpty);
+ if (edw)
+ {
+ TCEditor *ed=edw->editor;
+ ed->MoveCursorTo(p->x,p->y,True);
+ ed->trackCursor(True);
+ }
+ delete p;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Goes to the file and line specified. If the file isn't opened the routine
+opens it.@p
+ The @var{normalLine} hack is currently used when debugging. In this case
+the line isn't "selected", instead we set the "CPU Line" for this line.
+
+***************************************************************************/
+
+int GotoFileLine(int line, int column, char *file, char *msg, int off,
+ int len, unsigned flags)
+{
+ if (!line)
+ {
+ messageBox(__("This line no longer exists"),mfOKButton);
+ return 0;
+ }
+ TView *oldCur=editorApp->deskTop->current;
+ int options=oedDontOpenEmpty;
+ if (flags & gflDontSelect)
+ options|=oedNoSelect;
+ TCEditWindow *edw=editorApp->openEditor(file,True,NULL,options);
+ Boolean notCPULine=flags & gflCPULine ? False : True;
+ if (edw)
+ {
+ TCEditor *ed=edw->editor;
+ ed->lock();
+ ed->GoAndSelectLine(line,column,notCPULine);
+ if (!notCPULine)
+ {
+ DebugSetCPULine(line,file);
+ ed->trackCursor(oldCur==editorApp->deskTop->current ? False : True);
+ }
+ else
+ ed->trackCursor(True);
+ if (notCPULine)
+ ed->update(ufView); // Be sure we cleared the last hit
+ if (msg)
+ {// Show only a portion if they asked for it
+ if (off>=0)
+ {
+ char oldV=msg[off+len];
+ msg[off+len]=0;
+ ed->setStatusLine(msg+off);
+ msg[off+len]=oldV;
+ }
+ else
+ ed->setStatusLine(msg);
+ }
+ ed->unlock();
+ return 1;
+ }
+ return 0;
+}
+
+TCEditWindow *GetEditorWindowForFile(char *file)
+{
+ return editorApp->openEditor(file,True,NULL,oedDontOpenEmpty | oedNoSelect);
+}
+
+int GotoFileText(char *search, char *file, char *msg, int off, int len)
+{
+ if (!search)
+ return 0;
+
+ TCEditWindow *edw=editorApp->openEditor(file,True,NULL,oedDontOpenEmpty);
+ if (edw)
+ {
+ TCEditor *ed=edw->editor;
+ ed->lock();
+ ed->SearchAndJump(search,efCaseSensitive | efWholeWordsOnly);
+ ed->trackCursor(True);
+ ed->update(ufView); // Be sure we cleared the last hit
+ if (msg)
+ {// Show only a portion if they asked for it
+ if (off>=0)
+ {
+ char oldV=msg[off+len];
+ msg[off+len]=0;
+ ed->setStatusLine(msg+off);
+ msg[off+len]=oldV;
+ }
+ else
+ ed->setStatusLine(msg);
+ }
+ ed->unlock();
+ return 1;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Called by the special lines manager to notify that some special lines list
+changed.
+
+***************************************************************************/
+
+void ApplySpLines(char *fileName, TSpCollection *spLines)
+{
+ TCEditWindow *edw=IsAlreadyOnDesktop(fileName);
+ if (edw)
+ edw->editor->SetSpecialLines(spLines);
+}
+
+void SaveAllEditors(void)
+{
+ if (TSetEditorApp::edHelper)
+ TSetEditorApp::edHelper->saveEditors();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ If a file with the provided name exists it is reloaded from disk.
+
+ Return: 1 if we reloaded.
+
+***************************************************************************/
+
+int EdReloadIfOpened(const char *name, stEditorId *id)
+{
+ TCEditWindow *edw=IsAlreadyOnDesktop((char *)name,0,id);
+ if (edw && !edw->editor->isReadOnly)
+ {
+ if (edw->editor->reLoadFile()==False)
+ closeView(edw,0);
+ return 1;
+ }
+ return 0;
+}
+
+static
+Boolean CheckForDiff()
+{
+ static Boolean isDiffInstalled=False;
+
+ if (!isDiffInstalled)
+ {
+ // We must rediret the error to avoid getting it in the stderr file
+ char *err=open_stderr_out();
+ TScreen::System("diff --version");
+ close_stderr_out();
+ // Check what we got
+ FILE *f=fopen(err,"r");
+ int ok=0;
+ if (f)
+ {
+ char resp[80];
+ fgets(resp,80,f);
+ fclose(f);
+ ok=strstr(resp,"GNU diff")!=0;
+ }
+ unlink(err);
+
+ if (ok)
+ isDiffInstalled=True;
+ }
+
+ return isDiffInstalled;
+}
+
+static
+Boolean TestDiffInstalled()
+{
+ Boolean ret=CheckForDiff();
+ if (!ret)
+ GiveAdvice(gadvDiffModOpts);
+
+ return ret;
+}
+
+static
+void ReOpen(TCEditWindow *edw)
+{
+ char *name=strdup(edw->editor->fileName);
+ closeView(edw,0);
+ editorApp->openEditor(name,True);
+ free(name);
+}
+
+const char *DiffError=__("Error creating the difference, aborting");
+
+// Handles the case where an editor contains a modified file that was
+// modified on disk. That's most probably a problem.
+static
+int SolveModifiedCollision(TCEditWindow *edw)
+{
+ Boolean haveDiff=TestDiffInstalled();
+ TDialog *d=createSolveModifCollision(haveDiff);
+ int ret=execDialog(d,NULL);
+ if (ret==cmCancel)
+ return 0;
+ TCEditor *e=edw->editor;
+ if (ret==cmOK)
+ {
+ e->modified=False; // The user wants to discard it, don't ask again
+ ReOpen(edw);
+ return 1;
+ }
+ // The user wants to see a diff
+ // Save the current buffer to a temporal
+ char *tmpFile=e->saveToTemp();
+ char *tmpDifFile=unique_name("di",NULL);
+ char *command=NULL;
+ int retDiff=1;
+ // Run diff
+ if (tmpFile && tmpDifFile)
+ {
+ string_cat(command,"diff -u ",tmpFile," ",e->fileName," > ",tmpDifFile,0);
+ if (command)
+ {
+ retDiff=TScreen::System(command);
+ if (retDiff>0xFF)
+ retDiff>>=8;
+ if (retDiff==1)
+ retDiff=0;
+ free(command);
+ }
+ }
+ // The temporal file must be deleted in any case
+ if (tmpFile)
+ {
+ unlink(tmpFile);
+ free(tmpFile);
+ }
+ // Check for errors
+ if (retDiff)
+ {
+ if (tmpDifFile)
+ {
+ unlink(tmpDifFile);
+ free(tmpDifFile);
+ }
+ messageBox(DiffError,mfError|mfOKButton);
+ return 0;
+ }
+ // Finally we have the diff so now we can discard the buffer (or not)
+ int retF=0;
+ if (ret==cmYes)
+ {
+ e->modified=False; // The user wants to discard it, don't ask again
+ ReOpen(edw);
+ retF=1;
+ }
+ // Open it read-only
+ editorApp->openEditor(tmpDifFile,True,NULL,oedForceRO | oedForgetResume | oedZoom);
+ // Don't let it on disk
+ unlink(tmpDifFile);
+ free(tmpDifFile);
+ return retF;
+}
+
+int AskReloadEditor(TCEditWindow *edw)
+{
+ char *fileName=edw->editor->fileName;
+ if (LimitedFileNameDialog(mfYesButton | mfNoButton | mfConfirmation,
+ __("The disk copy of %s is newer, reload it?"),fileName)==cmYes)
+ {// OK, but ... is this buffer modified?
+ if (edw->editor->modified)
+ // This is complex, handled in another function
+ return SolveModifiedCollision(edw);
+ // Just close it and open again
+ ReOpen(edw);
+ return 1;
+ }
+ return 0;
+}
+
+static
+int EdReLoad(void *p)
+{
+ TDskWin *dsk=(TDskWin *)p;
+ if (dsk->type==dktEditor)
+ {
+ TCEditWindow *edw=((TDskWinEditor *)p)->edw;
+ TCEditor *e=edw->editor;
+ if (e->checkDiskCopyChanged(True))
+ return AskReloadEditor(edw);
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes all the names of the opened windows to the stream f. The names are
+separated by spaces.@p
+ Used by the Grep Interface.@p
+
+ Returns:
+ The number of names sent to the stream.
+
+***************************************************************************/
+
+void ReLoadModifEditors(void)
+{
+ if (TSetEditorApp::edHelper &&
+ (TSetEditorApp::getModifFilesOps() & mfoDontCheckAfterRun)==0)
+ {
+ int again=1;
+ int c,i;
+ do
+ {
+ again=0;
+ c=TSetEditorApp::edHelper->getCount();
+ i=0;
+ while (i<c && !again)
+ again=EdReLoad(TSetEditorApp::edHelper->at(i++));
+ }
+ while (again);
+ }
+}
+
+clock_t TSetEditorApp::LastTimeUpdate=0;
+char TSetEditorApp::UseScreenSaver=1;
+char TSetEditorApp::ShowClock=1;
+char TSetEditorApp::UseExternPrgForMode=0;
+char TSetEditorApp::DesktopPreloaded=0;
+char TSetEditorApp::fontCreated=0;
+char *TSetEditorApp::WhichScrSaver=0;
+int TSetEditorApp::screenSaverTime=180;
+int TSetEditorApp::screenSaverTimeMouse=3;
+CLY_StreamPosT TSetEditorApp::posPreload;
+TDeskTopClock *TSetEditorApp::Clock=0;
+char TSetEditorApp::ExternalPrgMode[80]="c:/etc/stm -t c:/etc/TextConfig 108x30";
+
+const int ClockWidth=7;
+
+void TSetEditorApp::CreateClock()
+{
+ // Take the last ClockWidth characters for the clock
+ TRect r=menuBar->getExtent();
+ int start=r.a.x;
+ r.a.x=r.b.x-ClockWidth;
+ Clock=new TDeskTopClock(r);
+ insert(Clock);
+ // Reduce the menubar
+ r.b.x=r.a.x;
+ r.a.x=start;
+ menuBar->changeBounds(r);
+}
+
+void TSetEditorApp::KillClock()
+{
+ if (Clock)
+ {
+ remove(Clock);
+ CLY_destroy(Clock);
+ Clock=0;
+ // Enlarge the menuBar again
+ TRect r=menuBar->getExtent();
+ r.b.x+=ClockWidth;
+ menuBar->changeBounds(r);
+ }
+}
+
+void TSetEditorApp::setCmdState( uint16 command, Boolean enable )
+{
+ if (enable)
+ enableCommand(command);
+ else
+ disableCommand(command);
+}
+
+#ifdef SECompf_djgpp
+const int clockResolution=CLOCKS_PER_SEC;
+#elif defined(SEOS_UNIX)
+const int clockResolution=100;
+#elif defined(SEOS_Win32)
+const int clockResolution=(int)CLK_TCK;
+#endif
+
+void TSetEditorApp::idle()
+{
+ static unsigned scrollLockStatus=0;
+
+ ProcessMP3Idle;
+ // Look for async responses from gdb.
+ DebugPoll();
+ if (multiMenuBar)
+ multiMenuBar->update();
+ TApplication::idle();
+ clock_t DifLastTime=lastIdleClock-LastTimeUpdate;
+
+ /***** Scroll lock centers update *****/
+ // Period 100 ms
+ // It avoids surprises by centering the buffer as soon as posible.
+ if (DifLastTime>clockResolution/10)
+ {
+ unsigned newScrollLockStatus=TGKey::getShiftState() & kbScrollLockToggle;
+ if (!scrollLockStatus && newScrollLockStatus &&
+ (TCEditor::editorFlags & efScrollLock))
+ {
+ TCEditor *ed=GetCurrentIfEditor();
+ if (ed)
+ ed->trackCursor(True);
+ }
+ scrollLockStatus=newScrollLockStatus;
+ }
+
+ if (DifLastTime<clockResolution/2)
+ {
+ RunExternalProgramIncParse();
+ CLY_YieldProcessor(-1);
+ return;
+ }
+ // Update 2 times per second
+ LastTimeUpdate=lastIdleClock;
+ /***** Update cme Commands here *****/
+ // Now update commands
+ // cme commands must follow cm commands
+ setCmdState(cmeResize,commandEnabled(cmResize));
+ setCmdState(cmeZoom,commandEnabled(cmZoom));
+ setCmdState(cmeClose,commandEnabled(cmClose));
+ Boolean genState=commandEnabled(cmNext);
+ setCmdState(cmeNext,genState);
+ setCmdState(cmePrev,genState);
+ setCmdState(cmeTile,genState);
+ setCmdState(cmeCascade,genState);
+ setCmdState(cmeSaveDesktop,IsPrjOpened() ? False : True);
+ setCmdState(cmeGPopCursorPos,stkPos.getCount() ? True : False);
+ setCmdState(cmeTagsAutoRegen,GetAutoGenMode()==stfAutoCentral ? True : False);
+ // Disable "Local Options" if no editors are available
+ TCEditor *e;
+ if ((e=GetCurrentIfEditor())!=0)
+ {
+ setCmdState(cmePrintEditor,True);
+ setCmdState(cmeOpenROCopy,True);
+ setCmdState(cmeRemapCodePage,True);
+ setCmdState(cmeHTMLAccents,True);
+ setCmdState(cmeHTMLTag2Accent,True);
+ setCmdState(cmeGPushCursorPos,True);
+ if (e->ShowMatchPairFly)
+ e->handleCommand(cmcForceMatchPairHL);
+ }
+ else
+ {
+ setCmdState(cmePrintEditor,False);
+ setCmdState(cmeOpenROCopy,False);
+ setCmdState(cmeRemapCodePage,False);
+ setCmdState(cmeHTMLAccents,False);
+ setCmdState(cmeHTMLTag2Accent,False);
+ setCmdState(cmeGPushCursorPos,False);
+ }
+
+ if (!(modifFilesOps & mfoDontCheckInIdle) && e && e->checkDiskCopyChanged())
+ AskReloadEditor(GetCurrentIfEditorWindow());
+
+ if (ShowClock)
+ {
+ if (!Clock)
+ CreateClock();
+ Clock->update();
+ }
+ else
+ if (Clock)
+ KillClock();
+
+ if (UseScreenSaver && TScreen::useScreenSaver())
+ {
+ int seconds=inIdleTime/clockResolution;
+ if (seconds==screenSaverTimeMouse)
+ {
+ MouseEventType me;
+ TMouse::getEvent(me);
+ TRect r=deskTop->getExtent();
+ if (me.where.x==r.b.x-1 && me.where.y==0)
+ screenSaver();
+ }
+ else
+ if (seconds>=screenSaverTime)
+ screenSaver();
+ }
+}
+
+
+void OpenFileFromEditor(char *fullName)
+{
+ editorApp->openEditor(fullName,True);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Open the @<var>{fullName} file.
+
+ Return: opfAlreadyThere if the file was already opened, opfOpened if we
+opened it to fulfill this request and opfFail if the file doesn't exists.
+The @<var>{number} variable is filled with the window number.
+
+***************************************************************************/
+
+int OpenFileFromEditorRet(char *fullName, int &number)
+{
+ TCEditWindow *ain=NULL;
+ editorApp->edHelper->reIdEditors();
+ ain=IsAlreadyOnDesktop(fullName);
+ TCEditWindow *opened=editorApp->openEditor(fullName,True);
+ if (opened)
+ number=opened->number;
+
+ return ain ? opfAlreadyThere : (opened ? opfOpened : opfFail);
+}
+
+
+#define README_1ST "readme.1st"
+
+static
+void ShowAboutStartBox(void)
+{
+ if (AboutStartBox())
+ {// Check to avoid showing it more than ones
+ if (EnvirGetIntVar("SET_README_SHOWN")>=TCEDITOR_VERSION)
+ return;
+ EnvirSetIntVar("SET_README_SHOWN",TCEDITOR_VERSION);
+
+ // Load the readme.1st
+ #ifdef NoHomeOrientedOS
+ char Name[PATH_MAX];
+ GetPathRelativeToRunPoint(Name,"contrib/setedit.bin/",README_1ST);
+ if (!edTestForFile(Name)) // The simplified distribution have a more simple name
+ GetPathRelativeToRunPoint(Name,"texts/",README_1ST);
+ #else
+ char *Name=ExpandFileNameToThePointWhereTheProgramWasLoaded(README_1ST);
+ if (!edTestForFile(Name))
+ Name=ExpandFileNameToThePointWhereTheProgramWasLoaded(README_1ST ".gz");
+ #endif
+
+ if (!edTestForFile(Name))
+ {
+ messageBox(__("I can't find the readme.1st file, please look for it in the .ZIP and read the file."),mfOKButton);
+ //messageBox(Name,mfOKButton);
+ return;
+ }
+ editorApp->openEditor(Name,True,NULL,oedForceRO | oedForgetResume | oedZoom);
+ }
+}
+
+static
+int GuessOneSET_FILES(const char *OSShareDir, char isAbsolute)
+{
+ // The fool doesn't put SET_FILES in the autoexec.bat, will try to guess here
+ char Name[PATH_MAX];
+ char *end;
+
+ if (isAbsolute)
+ {
+ strcpy(Name,OSShareDir);
+ strcat(Name,"/share/setedit");
+ end=Name+strlen(Name);
+ strcat(Name,"/" SHLFile);
+ }
+ else
+ end=GetPathRelativeToRunPoint(Name,OSShareDir,SHLFile);
+
+ if (!edTestForFile(Name))
+ // Bad luck guessing
+ return 1;
+
+ *end=0;
+ char *b=new char[12+strlen(Name)];
+ sprintf(b,"SET_FILES=%s",Name);
+ putenv(b);
+ return 0;
+}
+
+const char *OSShareDir[]=
+{// First from the configuration script
+ CONFIG_PREFIX,
+ #ifdef NoHomeOrientedOS
+ "share/setedit/",
+ #else
+ "/usr",
+ "/usr/local",
+ #endif
+ 0
+};
+
+char OSShareDirT[]=
+{
+ 1,
+ #ifdef NoHomeOrientedOS
+ 0
+ #else
+ 1,1
+ #endif
+};
+
+static
+int GuessSET_FILES()
+{
+ int ret=1,i=0;
+ do
+ {
+ if (OSShareDir[i][0])
+ ret=GuessOneSET_FILES(OSShareDir[i],OSShareDirT[i]);
+ }
+ while (ret && OSShareDir[++i]);
+ return ret;
+}
+
+static
+int GuessOneSET_LIBS(const char *OSShareDir, char isAbsolute)
+{
+ char Name[PATH_MAX];
+ char *end;
+
+ if (isAbsolute)
+ {
+ strcpy(Name,OSShareDir);
+ strcat(Name,"/lib/setedit");
+ end=Name+strlen(Name);
+ strcat(Name,"/datetools.so");
+ }
+ else
+ end=GetPathRelativeToRunPoint(Name,OSShareDir,"datetools.so");
+
+ if (!edTestForFile(Name))
+ // Bad luck guessing
+ return 1;
+
+ *end=0;
+ char *b=new char[12+strlen(Name)];
+ sprintf(b,"SET_LIBS=%s",Name);
+ putenv(b);
+ return 0;
+}
+
+static
+int GuessSET_LIBS()
+{
+ int ret=1,i=0;
+ do
+ {
+ if (OSShareDir[i][0])
+ ret=GuessOneSET_LIBS(OSShareDir[i],OSShareDirT[i]);
+ }
+ while (ret && OSShareDir[++i]);
+ return ret;
+}
+
+#ifdef NoHomeOrientedOS
+static
+int GuessINFOPATH(void)
+{
+ char Name[PATH_MAX];
+ char *end=GetPathRelativeToRunPoint(Name,"info/",EditorFileExt);
+
+ if (!edTestForFile(Name))
+ return 1;
+
+ *end=0;
+ /**** No longer needed
+ sprintf(Val,"INFOPATH=%s",Name);
+ putenv(Val);
+ *****/
+ InfViewAddInfoDir(Name);
+ return 0;
+}
+#endif
+
+static
+void ShowInstallError(char *var, const char *suggest, int end)
+{
+ TScreen::suspend();
+ fprintf(stderr,_("\nWrong installation! You must define the %s environment variable.\n"),var);
+ fprintf(stderr,_("Read the readme.1st file included in the .zip distribution file.\n\n"));
+ #ifdef NoHomeOrientedOS
+ char *s=getenv("DJDIR");
+ if (s)
+ fprintf(stderr,_("I suggest that: SET %s=%s/%s\n\n"),var,s,suggest);
+ #else
+ fprintf(stderr,_("I suggest that: SET %s=%s\n\n"),var,suggest);
+ #endif
+ fflush(stderr);
+ if (end)
+ exit(1);
+ fprintf(stderr,_("press ENTER to continue\n"));
+ getchar();
+ TScreen::resume();
+}
+
+static
+void ShowErrorSET_FILES()
+{
+ TScreen::suspend();
+ fputs(_("\nYou defined SET_FILES wrongly, it doesn't point to a directory.\n\n"),stderr);
+ fflush(stderr);
+ exit(1);
+}
+
+extern void RestoreScreen();
+
+/*************************************************************************************
+ Memory full protection, I hope it will be usefull with djgpp v2.02
+*************************************************************************************/
+
+#if (defined(SEComp_GCC) && __GNUC__>=3) || !defined(SEComp_GCC)
+// Not present in gcc 3.0.1
+#define InitSafetyPool()
+#define DeInitSafetyPool()
+#else
+#include <tv/no_mss.h>
+#include NEW_HEADER
+#include <tv/yes_mss.h>
+
+static char *safetypool;
+
+static void mynewhandler(void)
+{
+ if (safetypool==NULL)
+ _exit(1); // We can't call exit because it can need malloc
+ delete [] safetypool;
+ safetypool=NULL;
+ set_new_handler(NULL);
+ messageBox(__("Memory is nearly full. Please exit, and restart."), mfOKButton | mfError);
+}
+
+static void InitSafetyPool()
+{
+ safetypool=new char [64000];
+ set_new_handler(mynewhandler);
+}
+
+static void DeInitSafetyPool()
+{
+ delete[] safetypool;
+}
+#endif
+/*************************************************************************************/
+
+static TNoSortedStringCollection *FilesToLoad=0;
+
+static
+void AddToListOfFilesToLoad(const char *fileName)
+{
+ if (!fileName) return;
+ FILE *f=fopen(fileName,"rt");
+ if (!f) return;
+ if (!FilesToLoad) FilesToLoad=new TNoSortedStringCollection(10,10);
+
+ char Name[PATH_MAX],*s,*b;
+ while (!feof(f))
+ {
+ b=fgets(Name,PATH_MAX,f);
+ if (b)
+ {
+ for (s=b; *s; s++)
+ if (*s=='\n') *s=0;
+ if (*b)
+ FilesToLoad->insert(newStr(b));
+ }
+ }
+ fclose(f);
+}
+
+/******* Command line parsing *******/
+static char *ProjectAskedByUser=0;
+static char RedirectStderr=1,CommandLineParsed=0,DisableBoardMixer=0;
+// SAA: CascadeWindows conflicts with the CascadeWindows Win32 API
+static char TileVertical=0,TileHorizontal=0,SE_CascadeWindows=0;
+// Red Hat 5.2 keyboard layout
+static char UseRH52=0;
+extern int use_mouse_handler;
+// By default dump the stack
+static char StackDbgStrategy=DBGST_DUMP_STACK;
+#ifdef SECompf_djgpp
+extern char useBIOS_VGA_State;
+#endif
+
+static
+int CountExtraCMDLine(char *s)
+{
+ int inStr=0;
+ int count=0;
+ while (*s)
+ {
+ for (;*s && ucisspace(*s); s++);
+ if (*s) count++;
+ for (;*s && (!ucisspace(*s) || inStr); s++)
+ {
+ if (*s=='\\' && s[1])
+ s++;
+ else
+ if (*s=='"')
+ inStr=1-inStr;
+ }
+ }
+ return count;
+}
+
+static
+void GetExtraCMDLine(char *s, char *a[])
+{
+ int inStr=0,i=0;
+ char *e,*n,*n2;
+ while (*s)
+ {
+ for (;*s && ucisspace(*s); s++);
+ for (e=s; *e && (!ucisspace(*e) || inStr); e++)
+ {
+ if (*e=='\\' && e[1])
+ e++;
+ else
+ if (*e=='"')
+ inStr=1-inStr;
+ }
+ n2=n=new char[e-s+1];
+ for (; s<e; s++)
+ {
+ if (*s=='"') continue;
+ if (*s=='\\' && s[1]=='"') { *(n2++)='"'; s++; continue; }
+ *(n2++)=*s;
+ }
+ *n2=0;
+ a[++i]=n;
+ }
+}
+
+int Argc,CMDLineDelete=0;
+char **Argv;
+
+static
+void DestroyCMDLine()
+{
+ if (CMDLineDelete)
+ {
+ for (int i=0; i<Argc; i++)
+ delete[] Argv[i];
+ delete[] Argv;
+ }
+}
+
+static
+struct CLY_option longopts[] =
+{
+ { "bios-keyb", 0, 0, 'b' }, // obsolete
+ { "no-bios-keyb", 0, 0, 'B' }, // obsolete
+ { "cascade", 0, 0, 'c' },
+ { "stack-dbg", 1, 0, 'd' },
+ { "file-list", 1, 0, 'f' },
+ { "help", 0, 0, 'h' },
+ { "use-rh-52-keys", 0, 0, 'k' },
+ { "keybind", 1, 0, 'K' },
+ { "force-no-lfn", 0, 0, 'l' },
+ { "force-lfn", 0, 0, 'L' },
+ { "no-mouse-hook", 0, 0, 'm' },
+ { "no-mixer", 1, 0, 'M' },
+ { "project", 1, 0, 'p' },
+ { "no-redirect", 0, 0, 'r' },
+ { "low-vga-save", 0, 0, 'S' },
+ { "tile-vert", 0, 0, 't' },
+ { "tile-horiz", 0, 0, 'T' },
+ { 0, 0, 0, 0 }
+};
+
+static
+void ParseCommandLine(int argc, char *argv[])
+{
+ if (CommandLineParsed)
+ return;
+ TProgInit::config=new TVMainConfigFile();
+
+ int optc;
+ char *ExtraCMDLine=getenv("SET_CMDLINE");
+ int c=0;
+ Argv=argv;
+ Argc=argc;
+
+ #ifdef SEOS_Win32
+ char* argv0 = Argv[0];
+ while (*argv0)
+ {
+ if (*argv0 == '\\') *argv0 = '/';
+ argv0++;
+ }
+ #endif
+
+ if (ExtraCMDLine)
+ {
+ c=CountExtraCMDLine(ExtraCMDLine);
+ if (c)
+ {
+ CMDLineDelete=1;
+ Argc+=c;
+ Argv=new char *[Argc];
+ Argv[0]=newStr(argv[0]);
+ GetExtraCMDLine(ExtraCMDLine,Argv);
+ for (int i=1; i<argc; i++)
+ Argv[i+c]=newStr(argv[i]); // Copy it because getopt_long can move entries
+ }
+ }
+
+ ExtraCMDLine=getenv("SET_STACKDBG");
+ if (ExtraCMDLine)
+ StackDbgStrategy=atoi(ExtraCMDLine);
+
+ while ((optc=CLY_getopt_long(Argc,Argv,"b:Bcd:fhkK:lLmMp:rStT:",longopts,0))!=EOF)
+ {
+ switch (optc)
+ {
+ case 'c':
+ SE_CascadeWindows=1;
+ break;
+ case 'd':
+ StackDbgStrategy=atoi(CLY_optarg);
+ break;
+ case 'f':
+ AddToListOfFilesToLoad(CLY_optarg);
+ break;
+ case 'k':
+ UseRH52=1;
+ break;
+ case 'K':
+ KeyBindFNameUser=newStr(CLY_optarg);
+ break;
+ case 'l':
+ putenv("LFN=N");
+ break;
+ case 'L':
+ putenv("LFN=Y");
+ break;
+ case 'm':
+ TVMainConfigFile::Add("DOS","PollMouse",1);
+ break;
+ case 'M':
+ DisableBoardMixer=1;
+ break;
+ case 'p':
+ ProjectAskedByUser=CLY_optarg;
+ break;
+ case 'r':
+ RedirectStderr=0;
+ break;
+ case 'S':
+ #ifdef SECompf_djgpp
+ useBIOS_VGA_State=0;
+ #endif
+ break;
+ case 't':
+ TileVertical=1;
+ break;
+ case 'T':
+ TileHorizontal=1;
+ break;
+
+ case 'b':
+ TVMainConfigFile::Add("DOS","BIOSKey",1);
+ break;
+
+ case 'B':
+ TVMainConfigFile::Add("DOS","BIOSKey",0L);
+ break;
+
+ case 'h':
+ default:
+ #define PrintHelp(a) printf(a)
+ #define FlushHelp() fflush(stdout)
+ TScreen::suspend();
+
+ PrintHelp(_("Setedit "));
+ PrintHelp(TCEDITOR_VERSION_STR);
+ PrintHelp(_(". Copyright (c) "));
+ PrintHelp(TCEDITOR_C_YEAR);
+ PrintHelp(_(" by Salvador E. Tropea\n\n"));
+
+ PrintHelp(_("setedit [options] [file_name ...]\n\n"));
+ PrintHelp(_("Valid options are:\n"));
+ PrintHelp(_("+[line number] jumps to the specified line. It only affects the next\n"
+ " file in the list and should be specified after the\n"
+ " options. If the line number is omitted you'll jump to\n"
+ " the end of the text. Example: +6 file\n"));
+ PrintHelp(_("-c, --cascade: arranges the windows using cascade style.\n"));
+ PrintHelp(_("-d, --stack-dbg=n: indicates which method will be used in the event of a\n"
+ " crash. The default method is 0.\n"
+ " 0: dump unsaved buffers and stack calls.\n"
+ " 1: do nothing (conservative).\n"));
+ #ifdef SEOS_UNIX
+ PrintHelp(_(" 2: dump unsaved buffers and call debugger to get\n"
+ " information. Then die.\n"
+ " 3: like 2 but stay in the debugger.\n"));
+ #endif
+ PrintHelp(_("-f, --file-list file_n: loads the files listed in file_n, each line in this\n"
+ " file must contain only one file name.\n"));
+ PrintHelp(_("-h, --help: displays this text ;-).\n\n"));
+ #ifdef SEOSf_Linux
+ PrintHelp(_("-k, --use-rh-52-keys: enables the Red Hat 5.2 style keyboard mapping.\n"));
+ #endif
+ PrintHelp(_("-K, --keybind file_name: uses the specified name as keybinding file.\n"));
+ #ifdef SECompf_djgpp // Don't name it under Linux
+ PrintHelp(_("-l, --force-no-lfn: avoids the use of long file names under W9x.\n"));
+ PrintHelp(_("-L, --force-lfn: forces the use of long file names under W9x.\n"));
+ PrintHelp(_("-m, --no-mouse-hook: don't hook the mouse interrupt, poll it.\n"));
+ #endif
+ #ifdef HAVE_MIXER
+ PrintHelp(_("-M, --no-mixer: disable board level mixer.\n"));
+ #endif
+ PrintHelp(_("-p, --project file_name: loads the indicated project, if the file doesn't exist\n"
+ " the editor creates a new one\n"));
+ PrintHelp(_("-r, --no-redirect: disables the stderr redirection. Only used during\n"
+ " debugging.\n"));
+ #ifdef SECompf_djgpp // Don't name it under Linux
+ PrintHelp(_("-S, --low-vga-save: use low level functions to save/restore VGA state.\n"));
+ #endif
+ PrintHelp(_("-t, --tile-vert: the windows are arranged vertically.\n"));
+ PrintHelp(_("-T, --tile-horiz: the windows are arranged horizontally.\n"));
+ FlushHelp();
+ exit(1);
+ break;
+ }
+ }
+ CommandLineParsed=1;
+}
+/******* End of Command line parsing *******/
+
+void TSetEditorApp::dosShell()
+{
+ if (TScreen::noUserScreen())
+ return;
+ SaveAllEditors(); // To avoid crashes and inconsistences
+ FullSuspendScreen();
+ if (RedirectStderr && StdErrNew!=-1)
+ dup2(StdErrOri,STDERR_FILENO); // Restore stderr
+ // Stop the playing engine
+ MP3Suspend;
+ TScreen::System(CLY_GetShellName());
+ MP3Resume;
+ if (RedirectStderr && StdErrNew!=-1)
+ dup2(StdErrNew,STDERR_FILENO); // Redirected again
+ FullResumeScreen();
+ ReLoadModifEditors();
+}
+
+
+#ifdef SECompf_djgpp
+// Command line options from crt0 module
+extern int __crt0_argc;
+extern char **__crt0_argv;
+// DJGPP share options
+extern int __djgpp_share_flags;
+
+static //__attribute__ ((constructor)) Fails for gcc 3.2.2
+void initProgram(void)
+{
+ // MUST BE ON or some frt files will fail
+ __system_flags|=__system_allow_multiple_cmds;
+ // Fine tune the share flags
+ __djgpp_share_flags=SH_DENYWR;
+ ParseCommandLine(__crt0_argc,__crt0_argv);
+}
+
+// This trick is needed to call the initProgram() function
+class WrapperClassToCallConstructor
+{
+public:
+ WrapperClassToCallConstructor() {initProgram();};
+};
+static WrapperClassToCallConstructor theInitCaller;
+#endif
+
+/**[txh]********************************************************************
+
+ Description:
+ Opens the specified file or sets the jump line. That's used only to files
+specified in the command line.
+
+***************************************************************************/
+
+static
+void LoadSpecifiedFile(char *name)
+{
+ static int LineToJump=-2;
+ char tmpPath[PATH_MAX];
+
+ if (name[0]=='+' && (name[1]==0 || ucisdigit(name[1])))
+ { // That's +line_number
+ if (!name[1]) // Nothing => jump to end
+ LineToJump=-1;
+ else
+ LineToJump=atoi(name+1);
+ }
+ else
+ {
+ strcpy(tmpPath,name);
+ CLY_fexpand(tmpPath);
+ TCEditWindow *ed=editorApp->openEditor(tmpPath,True);
+ if (ed && LineToJump!=-2)
+ {
+ if (LineToJump<0)
+ LineToJump=ed->editor->limit.y;
+ ed->editor->GoAndSelectLine(LineToJump);
+ ed->editor->trackCursor(True);
+ LineToJump=-2;
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ This function should be as safe as possible and just stop redirecting.
+ Is called during a catastrophic crash.
+
+***************************************************************************/
+
+void StopStdErrRedirection()
+{
+ if (RedirectStderr && StdErrNew!=-1)
+ {
+ dup2(StdErrOri,STDERR_FILENO);
+ close(StdErrNew);
+ close(StdErrOri);
+ }
+}
+
+// This helps to use memory debuggers like MSS. In this way we don't need to
+// compile libpcre with the memory debugger nor see spureous reports about
+// memory allocated by libpcre and freed by the editor.
+static
+void *My_pcre_malloc(size_t a)
+{
+ return malloc(a);
+}
+
+static
+void My_pcre_free(void *p)
+{
+ free(p);
+}
+
+static
+void InitPCRELibrary()
+{
+ if (SUP_PCRE)
+ {
+ pcre_malloc=My_pcre_malloc;
+ pcre_free=My_pcre_free;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ TSetEditorApp::oldCPCallBack=TVCodePage::SetCallBack(TSetEditorApp::cpCallBack);
+ // Avoid handling Alt+N for window selection in TV core.
+ TProgram::doNotHandleAltNumber=1;
+
+ ParseCommandLine(argc,argv);
+ CheckIfCurDirValid();
+
+ // The point where the exe was loaded is a reference. Before SET_FILES because I use
+ // it to guess.
+ SetReferencePath(Argv[0]);
+ // That's a new policy, after releasing v0.4.1 and saw that nobody bothers about
+ // reading the readme.1st (mainly because of the distribution structure) now the
+ // editor assumes that:
+ // [In 0.4.14 I added a guess to help fools]
+ char *set_files=getenv("SET_FILES");
+ if (set_files && !IsADirectory(set_files) && GuessSET_FILES())
+ ShowErrorSET_FILES();
+ if (!set_files && GuessSET_FILES())
+ ShowInstallError("SET_FILES",OSShareDir[1],1);
+
+ char *set_libs=getenv("SET_LIBS");
+ if (!set_libs)
+ GuessSET_LIBS();
+
+ // Redirect stderr to a unique file to catch any kind of errors.
+ // We want it as soon as possible so any errors can be dumped there.
+ // Note: We need SET_FILES to redirect under DOS, so it comes after SET_FILES stuff
+ if (RedirectStderr)
+ TemporalStdErr=RedirectStdErrToATemp(StdErrOri,StdErrNew);
+ // After redirecting the error we can enable the routines that
+ // traps signals and dumps important information.
+ InitEditorSignals(StackDbgStrategy,argv[0],TemporalStdErr);
+
+ InitPCRELibrary();
+
+ // That's better for me, easier for incremental searchs
+ TFileCollection::sortOptions=fcolAlphabetical | fcolCaseInsensitive;
+ // Be sure we can store temporals, or at least do our best
+ CheckForValidTMPDIR();
+
+ // After SET_FILES because it needs SET_FILES.
+ InitEnvirVariables();
+
+ // Check if the user have the INFOPATH defined. On UNIX InfView already makes a guess
+ #ifdef NoHomeOrientedOS
+ InfViewGetInfoDir();
+ GuessINFOPATH();
+ /****** Old code: I no longer test it, the installer avoids this situation.
+ I also need to add 2 places: djgpp one and editor's one, a djgpp user
+ installed the editor outside the djgpp tree and reported obvious problems.
+ LoadInfoEnviroment();
+ if (!getenv("INFOPATH") && GuessINFOPATH())
+ ShowInstallError("INFOPATH","info",0);
+ ********/
+ #endif
+
+ SetConfigDialogFunc(SetFileOpenDialogOptions);
+ InitPaletteSystem();
+ //#if TV_MAJOR_VERSION<2
+ //setIntenseState();
+ //#endif
+ if (DisableBoardMixer)
+ BoardMixerDisable();
+
+ TSetEditorApp::WhichScrSaver=GetDefaultScreenSaver();
+
+ InitSafetyPool();
+
+ #ifdef USE_TSTRCOL
+ ReservedWords = new TStrCol(20,5);
+ UserWords = new TStrCol(20,5);
+ PascalRWords = new TStrCol(20,5);
+ ClipperRWords = new TStrCol(20,5);
+ #else
+ ReservedWords = new TStringCollection(20,5);
+ UserWords = new TStringCollection(20,5);
+ PascalRWords = new TStringCollection(20,5);
+ ClipperRWords = new TStringCollection(20,5);
+ #endif
+
+ #define I(a) ReservedWords->insert((void *)a)
+ I("int"); I("char"); I("unsigned");
+ I("signed"); I("float"); I("double");
+ I("short"); I("long"); I("void");
+ I("bool");
+
+ I("for"); I("while"); I("do");
+ I("if"); I("else"); I("return");
+ I("continue"); I("goto"); I("true");
+ I("false");
+
+ I("static"); I("const"); I("enum");
+ I("struct"); I("extern"); I("sizeof");
+ I("union"); I("typedef"); I("inline");
+ I("register"); I("volatile");
+
+ I("switch"); I("case"); I("default");
+ I("break");
+
+ I("new"); I("delete");
+
+ I("class"); I("private"); I("protected");
+ I("public"); I("this"); I("template");
+ I("throw"); I("typename"); I("catch");
+ I("virtual"); I("friend"); I("operator");
+ I("try"); I("mutable");
+ // namespace stuff
+ I("namespace"); I("using");
+ ReservedWords->setOwnerShip(False);
+ #undef I
+
+ #define I(a) UserWords->insert((void *)a)
+ I("uchar"); I("ushort"); I("uint16");
+ I("uint32");
+ UserWords->setOwnerShip(False);
+ #undef I
+
+ // List of reserved words for Turbo Pascal 5.0, if some of them isn't
+ // reserved in GPC please comment this line.
+ #define I(a) PascalRWords->insert((void *)a)
+ I("absolute"); I("and"); I("array");
+ I("begin"); I("case"); I("const");
+ I("div"); I("do"); I("downto");
+ I("else"); I("end"); I("external");
+ I("file"); I("for"); I("forward");
+ I("function"); I("goto"); I("if");
+ I("implementation"); I("in");
+ I("inline"); I("interface"); I("interrupt");
+ I("label"); I("mod"); I("nil");
+ I("not"); I("of"); I("or");
+ I("packed"); I("procedure"); I("program");
+ I("record"); I("repeat"); I("set");
+ I("shl"); I("shr"); I("string");
+ I("then"); I("to"); I("type");
+ I("unit"); I("until"); I("uses");
+ I("var"); I("while"); I("with");
+ I("xor");
+ PascalRWords->setOwnerShip(False);
+ #undef I
+
+ // Taked from the Clipper.EXE 5.2e
+ #define I(a) ClipperRWords->insert((void *)a)
+ I("announce"); I("begin"); I("break");
+ I("call"); I("case"); I("declare");
+ I("do"); I("else"); I("elseif");
+ I("endcase"); I("enddo"); I("endif");
+ I("exit"); I("external"); I("field");
+ I("for"); I("function"); I("if");
+ I("iif"); I("in"); I("init");
+ I("local"); I("loop"); I("memvar");
+ I("next"); I("otherwise"); I("parameters");
+ I("private"); I("procedure"); I("public");
+ I("recover"); I("return"); I("sequence");
+ I("static"); I("step"); I("text");
+ I("to"); I("then"); I("using");
+ I("with"); I("while");
+ ClipperRWords->setOwnerShip(False);
+ #undef I
+
+ PrintSetDefaults();
+
+ LoadKeysForTCEditor(GetKeyBindFName(0));
+ TCEditor::SHLGenList=new TNoCaseStringCollection(5,5);
+ LoadSyntaxHighLightFile(ExpandHome(SHLFile),TCEditor::SHLArray,TCEditor::SHLGenList,
+ TCEditor::SHLCant);
+ CLESetFileName(ExpandHome(CLEFile));
+ // Setup the list of files we don't want to backup
+ TCEditor::MakeBkpForIt=NBKPMakeIt;
+ NBKPSetFileName(ExpandHome(NBKPFile),cmeEditNoBkp);
+ NBKPSetSaveFileName(ExpandHomeSave(NBKPFile));
+
+ //------ International support
+ #ifndef NO_INTL_SUP
+ #ifdef NoHomeOrientedOS
+ if (!TVIntl::autoInit(EditorFile,getenv("SET_LOCALEDIR")))
+ {
+ char localedir[PATH_MAX];
+ GetPathRelativeToRunPoint(localedir,"share/locale","");
+ TVIntl::autoInit(EditorFile,localedir);
+ }
+ #else
+ TVIntl::autoInit(EditorFile,getenv("SET_LOCALEDIR"));
+ #endif
+ #endif // NO_INTL_SUP
+ //------ end of int. support
+
+ // Initialize the MP3 Stuff, it must be done before loading the desktop.
+ // It just disable some commands
+ MP3Initialize;
+
+ // This is a pre-load pass. It just retrieves information that's useful before
+ // starting the application. A good example is the window size, is much better
+ // to create a window of the desired size than creating an 80x25 window and
+ // the resize.
+ TSetEditorApp::preLoadDesktop(ProjectAskedByUser,CLY_optind<Argc);
+ // Now create the application, it will init TV
+ editorApp=new TSetEditorApp();
+ // We finished the preload stuff
+ TSetEditorApp::finishPreLoadDesktop();
+ if (TScreen::avoidMoire)
+ TCEditor::TabChar=TCEditor::oTabChar='.';
+
+ // Set's the window title for our application (W9x,X,etc.)
+ editorApp->SetTitle();
+
+ TSetEditorApp::loadEditorDesktop(1,ProjectAskedByUser,CLY_optind<Argc);
+
+ // After loading the desktop, if we do it before the we can't insert the
+ // message window in the desktop (no helper created). Lamentably we
+ // could lose some messages.
+ GZFiles_SetMessageCallback(EdShowMessageS);
+
+ // Open all the files indicated in the command line
+ while (CLY_optind<Argc)
+ {
+ LoadSpecifiedFile(Argv[CLY_optind]);
+ CLY_optind++;
+ }
+ // Open files specified as lists
+ if (FilesToLoad)
+ {
+ int i,c=FilesToLoad->getCount();
+ for (i=0; i<c; i++)
+ LoadSpecifiedFile((char *)FilesToLoad->at(i));
+ }
+ destroy0(FilesToLoad);
+ if (TileVertical)
+ {
+ unsigned dsktOps=TApplication::deskTop->getOptions();
+ TApplication::deskTop->setOptions(dsktOps | dsktTileVertical);
+ editorApp->tile();
+ TApplication::deskTop->setOptions(dsktOps);
+ }
+ if (TileHorizontal)
+ {
+ unsigned dsktOps=TApplication::deskTop->getOptions();
+ TApplication::deskTop->setOptions(dsktOps & (~dsktTileVertical));
+ editorApp->tile();
+ TApplication::deskTop->setOptions(dsktOps);
+ }
+ if (SE_CascadeWindows)
+ editorApp->cascade();
+
+ ShowMenuLoadError();
+ ShowKeyBindError();
+ SLPInterfaceInit(ExpandHome("macros.slp"));
+
+ ShowAboutStartBox();
+ ShowTips(ExpandHome(TipsFName));
+ ShowSHLLoadErrors();
+
+ editorApp->run();
+
+ // That saves the desktop too, even if there isn't a project
+ SaveProject();
+ TSetEditorApp::DebugDeInitVars();
+ CLY_destroy(TSetEditorApp::edHelper);
+
+ if (TSetEditorApp::DeleteFilesOnExit)
+ {
+ KillFilesToKill();
+ DeleteWildcard("*.bkp");
+ DeleteWildcard("*.BKP");
+ DeleteWildcard("*.dst");
+ DeleteWildcard("*.epr");
+ }
+
+ ReleaseFilesToKill();
+ ShutDownPaletteSystem();
+ SaveEnviromentFile();
+
+ /*
+ Restore stderr
+ */
+ if (TemporalStdErr)
+ {
+ StopStdErrRedirection();
+
+ struct stat s;
+ if (stat(TemporalStdErr,&s)==0)
+ if (s.st_size==0)
+ unlink(TemporalStdErr);
+ free(TemporalStdErr);
+ }
+
+ MP3DeInitialize;
+ SyntaxSearch_ShutDown();
+ UnLoadSyntaxHighLightFile(TCEditor::SHLArray,TCEditor::SHLGenList,TCEditor::SHLCant);
+ UnloadCLEFile();
+ UnloadNBKP();
+ UnLoadTVMenu();
+ if (TCEditor::RightClickMenu)
+ delete TCEditor::RightClickMenu;
+ CLY_destroy(editorApp);
+ delete[] TSetEditorApp::WhichScrSaver; // static member
+ SLPInterfaceDeInit();
+ CLY_destroy(ReservedWords);
+ CLY_destroy(UserWords);
+ CLY_destroy(PascalRWords);
+ CLY_destroy(ClipperRWords);
+ DeInitEnvirVariables();
+ DeInitSafetyPool();
+ delete[] KeyBindFNameUser;
+ DestroyCMDLine();
+ DestroyFunctionList();
+ RunExternalProgramFreeMemory();
+ LoadKeysForTCEditorFreeMemory();
+ TagsFreeMemory();
+ PathListUnLoad();
+ SpLinesCleanUp();
+ op_cl_std_clean_up();
+
+ return 0;
+}
+END_OF_MAIN()
+
diff --git a/setedit/setedit/editmenu.cc b/setedit/setedit/editmenu.cc
new file mode 100644
index 0000000..14b01c4
--- /dev/null
+++ b/setedit/setedit/editmenu.cc
@@ -0,0 +1,460 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+#define Uses_stdio
+#define Uses_string
+
+#define Uses_TApplication
+#define Uses_TMenuBar
+#define Uses_TRect
+#define Uses_TMenu
+#define Uses_TSubMenu
+#define Uses_TMenuItem
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TPoint
+#define Uses_MsgBox
+#define Uses_TFileDialog
+#define Uses_TDeskTop
+#define Uses_TStringCollection
+#define Uses_TSortedListBox
+#define Uses_TKeys
+#define Uses_TVCodePage
+#define Uses_TScreen
+// InfView requests
+#include <infr.h>
+
+#define Uses_TInputLinePipedConst
+#define Uses_TCEditWindow
+#define Uses_TCEditor_Commands
+#include <ceditor.h>
+
+#include <setconst.h>
+
+#define Uses_TSetEditorApp
+#define Uses_TMultiMenu
+#define Uses_SETAppConst
+#define Uses_SETAppDialogs
+#include <setapp.h>
+
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include <inf.h>
+#include <editcoma.h>
+
+char *ExpandFileNameToThePointWhereTheProgramWasLoaded(const char *s);
+
+TMenuBar *TSetEditorApp::initMenuBar(TRect r)
+{
+ r.b.y = r.a.y+1;
+
+ multiMenuBar=GetTVMenu(ExpandFileNameToThePointWhereTheProgramWasLoaded("menubind.smn"),r);
+ if (multiMenuBar)
+ return multiMenuBar;
+
+ // Spanish: ABCEHMPRV
+ // English: CEFHMPSVW
+ TSubMenu& sub1 = *new TSubMenu( __("~F~ile"), kbAltF ) +
+ // E: ACHNOSUX
+ *new TMenuItem( __("~O~pen..."), cmeOpen, kbF3 ) +
+ *new TMenuItem( __("~N~ew"), cmeNew, kbNoKey ) +
+ *new TMenuItem( __("~S~ave"), cmcSave, kbF2, hcNoContext, "F2" ) +
+ *new TMenuItem( __("S~a~ve as..."), cmcSaveAs, kbNoKey ) +
+ *new TMenuItem( __("Save as ~U~NIX..."), cmcSaveAsConvertEOL, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("~C~hange dir..."), cmeChangeDrct, kbNoKey ) +
+ *new TMenuItem( __("S~h~ell"), cmeDosShell, kbNoKey ) +
+ *new TMenuItem( __("E~x~it"), cmeQuit, kbAltX, hcNoContext, "Alt-X" ) +
+ *new TMenuItem( __("~Q~uit"), cmeQuitDelete, kbAltQ, hcNoContext, "Alt-Q" );
+
+ TSubMenu& sub2 = *new TSubMenu( __("~E~dit"), kbAltE ) +
+ *new TMenuItem( __("~U~ndo"), cmcUndo, kbAltBack, hcNoContext, "Alt+BackSpace" ) +
+ *new TMenuItem( __("~R~edo"), cmcRedo, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("Cu~t~"), cmcCut, kbShiftDel, hcNoContext, "Shift-Del" ) +
+ *new TMenuItem( __("~C~opy"), cmcCopy, kbCtrlIns, hcNoContext, "Ctrl-Ins" ) +
+ *new TMenuItem( __("~P~aste"), cmcPaste, kbShiftIns, hcNoContext, "Shift-Ins" ) +
+ *new TMenuItem( __("~S~how clipboard"), cmeShowClip, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("~C~lear"), cmcClear, kbCtrlDel, hcNoContext, "Ctrl-Del" ) +
+ newLine() +
+ *new TMenuItem( __("S~e~t Local"), cmcSetLocalOptions, kbAltL, hcNoContext, "Alt-L" ) +
+ *new TMenuItem( __("Set ~G~lobal"), cmcSetGlobalOptions, kbAltG, hcNoContext, "Alt-G" ) +
+ newLine() +
+ *new TMenuItem( __("E~x~pand all tabs"), cmcExpandAllTabs, kbNoKey ) +
+ *new TMenuItem( __("C~o~mpact text"), cmcCompactBuffer, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("~J~ump to function"), cmcJumpToFunction, kbNoKey ) +
+ *new TMenuItem( __("~P~rofile Editor"), cmcProfileEditor, kbNoKey );
+
+ TSubMenu& sub3 = *new TSubMenu( __("~S~earch"), kbAltS ) +
+ *new TMenuItem( __("~F~ind..."), cmcFind, kbNoKey ) +
+ *new TMenuItem( __("~R~eplace..."), cmcReplace, kbNoKey ) +
+ *new TMenuItem( __("~S~earch again"), cmcSearchAgain, kbNoKey );
+
+ TSubMenu& sub4 = *new TSubMenu( __("~M~acro"), kbAltM ) +
+ *new TMenuItem( __("~R~ecord"), cmcRecordMacro, kbShiftF10, hcNoContext, "Shift+F10" ) +
+ *new TMenuItem( __("~S~top"), cmcStopMacro, kbAltF10, hcNoContext, "Alt+F10" ) +
+ *new TMenuItem( __("~P~lay"), cmcPlayMacro, kbCtrlF10, hcNoContext, "Ctrl+F10" );
+
+ TSubMenu& sub5 = *new TSubMenu( __("Re~c~tangle"), kbAltR ) +
+ *new TMenuItem( __("~S~tart"), cmcSelRectStart, kbNoKey ) +
+ *new TMenuItem( __("~E~nd"), cmcSelRectEnd, kbNoKey ) +
+ *new TMenuItem( __("~H~ide"), cmcSelRectHide, kbNoKey ) +
+ newLine() +
+ *new TMenuItem( __("~C~opy"), cmcSelRectCopy, kbNoKey ) +
+ *new TMenuItem( __("~P~aste"), cmcSelRectPaste, kbNoKey ) +
+ *new TMenuItem( __("Cu~t~"), cmcSelRectCut, kbNoKey ) +
+ *new TMenuItem( __("C~l~ear"), cmcSelRectDel, kbNoKey ) +
+ *new TMenuItem( __("~M~ove"), cmcSelRectMove, kbNoKey );
+
+ TSubMenu& sub6 = *new TSubMenu( __("~W~indows"), kbAltW ) +
+ *new TMenuItem( __("~S~ize/move"),cmeResize, kbCtrlF5, hcNoContext, "Ctrl-F5" ) +
+ *new TMenuItem( __("~Z~oom"), cmeZoom, kbF5, hcNoContext, "F5" ) +
+ *new TMenuItem( __("~T~ile"), cmeTile, kbNoKey ) +
+ *new TMenuItem( __("C~a~scade"), cmeCascade, kbNoKey ) +
+ *new TMenuItem( __("~N~ext"), cmeNext, kbF6, hcNoContext, "F6" ) +
+ *new TMenuItem( __("~P~revious"), cmePrev, kbShiftF6, hcNoContext, "Shift-F6" ) +
+ *new TMenuItem( __("~C~lose"), cmeClose, kbAltF3, hcNoContext, "Alt-F3" ) +
+ *new TMenuItem( __("~L~ist"), cmeListWin, kbAlt0, hcNoContext, "Alt-0" ) +
+ *new TMenuItem( __("~U~ser Screen"), cmeUserScreen, kbAltF5, hcNoContext, "Alt-F5" );
+
+ TSubMenu& sub7 = *new TSubMenu( __("~H~elp"), kbAltH ) +
+ *new TMenuItem( __("~I~NF View"), cmeInfView, kbF1, hcNoContext, "F1" ) +
+ *new TMenuItem( __("~A~nother InfView"), cmeAnotherInfView, kbNoKey );
+
+ TSubMenu& sub8 = *new TSubMenu( __("~V~arious"), kbAltV ) +
+ *new TMenuItem( __("~C~alculator"), cmeCalculator, kbAltF4, hcNoContext, "Alt+F4" ) +
+ *new TMenuItem( __("~S~DG"), cmeSDG, kbF9, hcNoContext, "F9" ) +
+ *new TMenuItem( __("SDG ~O~ptions"), cmeSDGDialog, hcNoContext, kbNoKey) +
+ *new TMenuItem( __("Copy to ~W~indows Clip."), cmcCopyClipWin, hcNoContext, kbNoKey) +
+ *new TMenuItem( __("Paste ~f~rom Wind. Clip."), cmcPasteClipWin, hcNoContext, kbNoKey) +
+ *new TMenuItem( __("Co~l~ors"), cmeSetColors, hcNoContext, kbNoKey);
+
+ TSubMenu& sub9 = *new TSubMenu( __("~P~roject"), kbAltP ) +
+ *new TMenuItem( __("~O~pen..."), cmeOpenPrj, kbNoKey ) +
+ *new TMenuItem( __("~C~lose"), cmeClosePrj, kbNoKey );
+
+ TMultiMenu *m=new TMultiMenu();
+ m->add(&(sub1+sub2+sub3+sub4+sub5+sub6+sub7+sub8+sub9));
+ multiMenuBar=new TMultiMenuBar(r,m);
+ return multiMenuBar;
+}
+
+
+TStatusLine *TSetEditorApp::initStatusLine( TRect r )
+{
+ // Note: any help context that belongs to a modal window (dialogs) must
+ // contain F1 to get help.
+ r.a.y = r.b.y-1;
+
+ TStatusLine *st=GetTVStatusLine(ExpandFileNameToThePointWhereTheProgramWasLoaded("menubind.smn"),r);
+ if (st)
+ return st;
+
+ st=
+ new TStatusLine( r,
+ *new TStatusDef( 0, 255 ) +
+ *new TStatusItem( __("~F2~ Save"), kbF2, cmcSave ) +
+ *new TStatusItem( __("~F3~ Open"), kbF3, cmeOpen ) +
+ *new TStatusItem( __("~Alt+F3~ Close"), kbAltF3, cmeClose ) +
+ *new TStatusItem( __("~F5~ Zoom"), kbF5, cmeZoom ) +
+ *new TStatusItem( __("~F6~ Next"), kbF6, cmeNext ) +
+ *new TStatusItem( __("~F10~ Menu"), kbF10, cmMenu ) +
+ *new TStatusItem( 0, kbCtrlF5, cmeResize ) +
+ *new TStatusItem( 0, kbAltF1, cmeLastHelp ) +
+ *new TStatusItem( 0, kbAltF8, cmeNextMessage ) +
+ *new TStatusItem( 0, kbAltF7, cmePrevMessage ) +
+ *new TStatusItem( 0, kbF1, cmeInfView ) +
+ *new TStatusDef( hcInfView, hcInfView+4 ) +
+ *new TStatusItem( __("~Alt+F1~ Back"), kbAltF1, cmInfBack ) +
+ *new TStatusItem( __("~Alt+F10~ Control"), kbAltF10, cmInfControl ) +
+ *new TStatusItem( __("~^H~ Help"), kbCtrlH, cmInfHelp ) +
+ *new TStatusItem( __("~ESC~ Close"), kbEsc, cmClose ) +
+ *new TStatusItem( __("~Alt+I~ Include"), kbAltI, cmInfPasteIn ) +
+ *new TStatusItem( __("~Alt+B~ Bookmark"), kbAltB, cmInfBookM ) +
+ *new TStatusItem( 0, kbF5, cmZoom ) +
+ *new TStatusDef( hcListWin, hcListWin+4 ) +
+ *new TStatusItem( __("~Del~ Close"), kbDel, cmDelete ) +
+ *new TStatusItem( __("~Ins~ Open"), kbIns, cmInsert ) +
+ *new TStatusItem( __("~F1~ Help"), kbF1, cmeInfView ) +
+ *new TStatusItem( __("~Ctrl+Del~ Delete File"), kbCtrlDel, cmDelFile ) +
+ *new TStatusDef( hcEditorProjectWindow, hcEditorProjectWindow+4 ) +
+ *new TStatusItem( __("~Ins~ Insert"), kbIns, cmInsert ) +
+ *new TStatusItem( __("~Del~ Delete"), kbDel, cmDelete ) +
+ *new TStatusItem( __("~F5~ Zoom"), kbF5, cmZoom ) +
+ *new TStatusItem( 0, kbAltF1, cmeLastHelp ) +
+ *new TStatusDef( hcMessageWindow, hcMessageWindow+1 ) +
+ *new TStatusItem( __("~Alt+F7~ Previous"), kbAltF7, cmePrevMessage ) +
+ *new TStatusItem( __("~Alt+F8~ Next"), kbAltF8, cmeNextMessage ) +
+ *new TStatusItem( __("~Ctrl+C~ Stop"), kbCtrlC, cmeStopChild ) +
+ *new TStatusItem( __("Save"), kbNoKey, cmcSaveAs ) +
+ *new TStatusItem( __("~Ctrl+Ins~ Copy"), kbCtrlIns, cmcCopy ) +
+ *new TStatusItem( 0, kbF5, cmZoom ) +
+ *new TStatusItem( 0, kbAltF1, cmeLastHelp ) +
+ *new TStatusDef( hcCalculator, hcCalculator+4 ) +
+ *new TStatusItem( __("~ENTER~ Evaluate"), kbEnter, cmEval ) +
+ *new TStatusItem( __("~Ctrl+Ins~ Copy"), kbCtrlIns, cmtilCopy ) +
+ *new TStatusItem( __("~Shift+Ins~ Paste"), kbShiftIns, cmtilPaste ) +
+ *new TStatusItem( __("~F1~ Help"), kbF1, cmeInfView ) +
+ // Default for all the othe contexts
+ *new TStatusDef( 0, 0xFFFF ) +
+ *new TStatusItem( __("~F1~ Help"), kbF1, cmeInfView ) +
+ *new TStatusItem( __("~F5~ Zoom"), kbF5, cmZoom )
+ );
+ return st;
+}
+
+void TSetEditorApp::outOfMemory()
+{
+ messageBox(__("Not enough memory for this operation."), mfError | mfOKButton);
+}
+
+#if 0
+// The following are here just for internationalization purposes
+_("Open Read-only ~c~opy")
+_("Save w/ same ~t~ime...")
+_("Save a~l~l")
+_("~P~rint")
+_("Pr~i~nt Setup...")
+_("S~e~t Local options")
+_("Set ~G~lobal options")
+_("Pus~h~ cursor position")
+_("Pop cursor pos~i~tion")
+_("C~a~se (upper/lower)")
+_("Block to ~u~pper")
+_("Block to ~l~ower")
+_("~C~haracter toggle")
+_("Block ~i~nvert")
+_("Block ~a~lternate")
+_("~G~o to line")
+_("Jump to ~p~rototype")
+_("~N~ame current function")
+_("~C~hoose...")
+_("R~e~peat")
+_("~G~enerate Code")
+_("Ru~n~ selected code")
+_("Enter c~o~de to run")
+_("Pse~u~do macros...")
+_("To ~u~pper")
+_("To l~o~wer")
+_("Poc~k~et calculator")
+_("~R~un program")
+_("~A~SCII Chart")
+_("Ca~l~endar")
+_("MP~3~ songs")
+_("~S~elect a song")
+_("~P~lay selected")
+_("S~t~op selected")
+_("~C~onvert to WAV")
+_("~E~dit/Create list")
+_("P~l~ay list")
+_("St~o~p list")
+_("~H~TML Accents")
+_("Convert ~a~ccents to tags")
+_("Convert ~t~ags to accents")
+_("E~x~port as HTML...")
+_("Re~m~ap code page...")
+_("~B~lock quoted printable decode")
+_("Un/~I~ndent block")
+_("Indent ~o~ne space")
+_("Unindent o~n~e character")
+_("Indent one ~t~ab/gap")
+_("~U~nindent one tab/gap")
+_("~C~omment indent")
+_("Comment unin~d~ent")
+_("~A~rbitrary indent")
+_("Paste ~E~macs mode")
+_("Test of macro from menu")
+_("~D~elete memorized backups")
+_("Redra~w~ screen")
+_("~C~olors")
+_("~C~ustomize...")
+_("~P~alette...")
+_("~T~heme...")
+_("~L~ocal edition...")
+_("Glo~b~al edition...")
+_("Editor ~G~eneral...")
+_("Scr~e~en saver...")
+_("S~D~G Options...")
+_("~R~un program (which one)...")
+_("~K~eyboard")
+_("~K~ey assignment")
+_("~S~etup Alt keys")
+_("Key ~p~ad behavior")
+_("~B~ack to defaults")
+_("Consult ~s~can codes")
+_("~S~creen Options...")
+_("Encod~i~ngs...")
+_("Fon~t~s...")
+_("~U~ser words...")
+_("De~f~ault global edition...")
+_("~O~pen file dialog...")
+_("Do~n~'t create backups for...")
+_("~T~ip of the day")
+_("~S~yntax help")
+_("~F~iles to search")
+_("~M~an page View")
+_("A~b~out")
+_("Searc~h~ files under cursor in...")
+_("Insert key ~n~ame")
+_("Sc~r~oll Up")
+_("Scroll ~D~own")
+_("Cop~y~ to file Clipboard")
+_("Paste ~f~rom file Clipboard")
+_("Copy to OS Clipboar~d~")
+_("Paste from OS Clip~b~oard")
+_("Save ~d~esktop here")
+_("Sa~v~e as DOS...")
+_("S~h~ell")
+_("T~a~g files")
+_("~L~ist of tag files...")
+_("~O~ptions...")
+_("Jump ~t~o symbol")
+_("~C~lass browser")
+_("~W~ord completion")
+_("E~x~port project")
+_("~I~mport project items")
+_("Save As")
+_("Calendar (holida~y~s)...")
+_("Checking for ~m~odified files...")
+_("Advice dialogs...")
+_("Jump to ~l~ast cursor position")
+_("Jump to last ~u~ndo position")
+_("Insert ~n~ew line (don't move)")
+_("Pro~j~ect Window")
+_("~M~essage Window")
+_("~E~dition Windows")
+_("Window ~2~")
+_("Window ~3~")
+_("Window ~4~")
+_("Window ~5~")
+_("Window ~6~")
+_("Window ~7~")
+_("Window ~8~")
+_("Window ~9~")
+_("Window 10")
+_("Window 11")
+_("Window 12")
+_("Window 13")
+_("Window 14")
+_("Window 15")
+_("Window 16")
+_("Window 17")
+_("Window 18")
+_("Window 19")
+_("Pus~h~ cursor position and window")
+_("P~o~p cursor position and window (tag ret)")
+_("Debu~g~ger Window")
+_("~W~atches Window")
+_("~D~ebug")
+_("~O~ptions")
+_("~P~rogram and mode...")
+_("Path for ~s~ources...")
+_("~M~essages displayed...")
+_("~A~dvanced...")
+_("Go to 'Connected' ~1~")
+_("Go to 'Ready to run' ~2~")
+_("~B~reakpoint")
+_("~R~un/Continue/Atach")
+_("~S~tep over")
+_("~T~race into")
+_("~G~o to cursor")
+_("~U~ntil return")
+_("Return ~n~ow")
+_("Sto~p~")
+_("Restart (~K~ill)")
+_("~E~valuate/Modify...")
+_("~W~atch an expression")
+_("~C~alling stack")
+_("~D~ebug session")
+_("De~t~ach")
+_("C~l~ose")
+_("~D~estroy (DANGER!)")
+_("~E/+~ Expand")
+_("~C/-~ Collapse")
+_("~+~ Enable")
+_("~-~ Disable")
+_("~Ins~ Send command")
+_("~Ctrl+A/+~ Add w/scope")
+_("~R~egenerate central file")
+_("Ed~i~t breakpoints...")
+_("Edit watchpoints... ~3~")
+_("Se~l~ect thread...")
+_("Disasse~m~bler Window...")
+_("~N~ormal watch...")
+_("~W~ith scope...")
+_("~U~sing the Inspector...")
+_("~D~ata window...")
+_("~S~tack window")
+_("Clear deb~u~g elements...")
+_("~R~ead block...")
+_("~W~rite block...")
+_("~U~p")
+_("~D~own")
+_("~R~ight")
+_("~L~eft")
+_("Page d~o~wn")
+_("Page u~p~")
+_("Fir~s~t column")
+_("L~a~st column")
+_("First ro~w~")
+_("Las~t~ row")
+_("First addr. ~i~ncrement")
+_("~F~irst addr. decrement")
+_("~A~ddress")
+_("Change ~b~ase address...")
+_("~G~o to new address...")
+_("Follow ~p~ointer")
+_("Follow pointer in ~n~ew window")
+_("~R~ecompute address")
+_("M~o~de")
+_("Toggle ~a~uto follow")
+_("Change ~d~isplay mode")
+_("Toggle ~e~ndian mode")
+_("Change ~r~adix")
+_("~B~lock")
+_("~F~ill...")
+_("~C~lear...")
+_("~M~ove...")
+_("~V~arious")
+_("~L~ess bytes per line")
+_("~M~ore bytes per line")
+_("~U~pdate memory")
+_("Go to st~a~te")
+_("~C~onnected")
+_("~R~eady to run")
+_("~O~pen info file...")
+_("Con~f~iguration dialog...")
+_("~B~ookmarks...")
+_("List of ~n~odes...")
+_("~G~o to '(file)node'...")
+_("~N~avigation")
+_("~L~ast visited topic")
+_("~N~ext topic")
+_("~P~revious topic")
+_("Go ~u~p in herarchy")
+_("Main menu for ~t~his file")
+_("Info ~d~irectory")
+_("~J~ump to last link")
+_("~G~o to link number")
+_("Link ~1~")
+_("Link ~2~")
+_("Link ~3~")
+_("Link ~4~")
+_("Link ~5~")
+_("Link ~6~")
+_("Link ~7~")
+_("Link ~8~")
+_("Link ~9~")
+_("How to use the ~h~elp")
+_("Con~t~rol dialog...")
+_("S~e~arch selection forward")
+_("Search selection ~b~ackward")
+_("Replace in ~a~ll opened...")
+_("Replace in all project ~i~tems...")
+#endif
+
diff --git a/setedit/setedit/editpale.cc b/setedit/setedit/editpale.cc
new file mode 100644
index 0000000..bd31a55
--- /dev/null
+++ b/setedit/setedit/editpale.cc
@@ -0,0 +1,306 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <configed.h>
+
+#include <stdio.h>
+
+#define Uses_TDialog
+#define Uses_TScrollBar
+#define Uses_TRadioButtons
+#define Uses_TRect
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TEvent
+#define Uses_TButton
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TStaticText
+#define Uses_TColorSelector
+#define Uses_MsgBox
+#define Uses_TScreen
+#include <tv.h>
+
+#include <tpaltext.h>
+#define Uses_SETAppVarious
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#include <setapp.h>
+
+const int MaxCompVal=255;
+
+static char *patterNumShow="123456789012";
+
+class TNumShow : public TStaticText
+{
+public:
+ TNumShow(const TRect &bounds);
+ void setValue(int val);
+};
+
+TNumShow::TNumShow(const TRect &bounds) :
+ TStaticText(bounds,patterNumShow)
+{
+ setValue(0);
+ noIntl=1;
+}
+
+void TNumShow::setValue(int val)
+{
+ sprintf((char *)(text+1),"%d",val);
+ *((char *)text)=3;
+ draw();
+}
+
+
+class TRadioCol : public TRadioButtons
+{
+public:
+ TRadioCol(const TRect &bounds, TSItem *items, TScrollBar *r, TScrollBar *g,
+ TScrollBar *b, TNumShow *rr, TNumShow *rg, TNumShow *rb) :
+ TRadioButtons(bounds,items),
+ red(r), green(g), blue(b), nred(rr), ngreen(rg), nblue(rb) { press(0); }
+ virtual void press(int item);
+ virtual void movedTo(int item);
+ unsigned getValue(void) { return value; }
+
+protected:
+ TScrollBar *red,*green,*blue;
+ TNumShow *nred,*ngreen,*nblue;
+ void SetBars(void);
+};
+
+void TRadioCol::SetBars(void)
+{
+ int r,g,b;
+ EditorPalette->GetOne(value,r,g,b);
+ red->setParams(r,0,MaxCompVal,32,1);
+ green->setParams(g,0,MaxCompVal,32,1);
+ blue->setParams(b,0,MaxCompVal,32,1);
+ nred->setValue(r);
+ ngreen->setValue(g);
+ nblue->setValue(b);
+}
+
+void TRadioCol::press(int item)
+{
+ value=item;
+ SetBars();
+}
+
+void TRadioCol::movedTo(int item)
+{
+ press(item);
+}
+
+class TDiaPal : public TDialog
+{
+public:
+ TDiaPal(void);
+ virtual void handleEvent(TEvent& event);
+ virtual void draw(void);
+ TRadioCol *colorsel;
+ TScrollBar *red;
+ TScrollBar *green;
+ TScrollBar *blue;
+ TNumShow *rn,*gn,*bn;
+};
+
+TDiaPal::TDiaPal(void) :
+ TWindowInit(&TDiaPal::initFrame),
+ TDialog(TRect(0,0,52,19),__("Palette editor"))
+{
+ options|=ofCentered;
+ helpCtx=cmeEditPalette;
+ TLabel *rl,*gl,*bl;
+
+ TRect r(14,1,50,2);
+ insert(new TStaticText(r,__("Color RGB composition")));
+ r.move(0,3);
+ red=new TScrollBar(r);
+ r.move(0,1);
+ rn=new TNumShow(r);
+ r.move(0,-2);
+ rl=new TLabel(r,__("Red"),red);
+ r.move(0,5);
+ green=new TScrollBar(r);
+ r.move(0,1);
+ gn=new TNumShow(r);
+ r.move(0,-2);
+ gl=new TLabel(r,__("Green"),green);
+ r.move(0,5);
+ blue=new TScrollBar(r);
+ r.move(0,1);
+ bn=new TNumShow(r);
+ r.move(0,-2);
+ bl=new TLabel(r,__("Blue"),blue);
+
+ colorsel=new TRadioCol(TRect(2,2,7,18),
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("",
+ new TSItem("", 0 )))))))))))))))),red,green,blue,rn,gn,bn);
+ insert(colorsel);
+ insert(new TLabel(TRect(1,1,10,2),__("Color"),colorsel));
+ insert(rl);
+ insert(red);
+ insert(rn);
+ insert(gl);
+ insert(green);
+ insert(gn);
+ insert(bl);
+ insert(blue);
+ insert(bn);
+ insert(new TButton(TRect(15,16,27,18),__("~O~K"),cmOK,bfDefault));
+ insert(new TButton(TRect(34,16,46,18),__("~D~efault"),cmYes,bfNormal));
+ selectNext(False);
+}
+
+void TDiaPal::draw(void)
+{
+ TDialog::draw();
+ ushort buf[5];
+ ushort col;
+ unsigned i,j;
+ for (i=0; i<16; i++)
+ {
+ col=(i<<8) | (uchar)TColorSelector::icon;
+ for (j=0; j<5; j++)
+ buf[j]=col;
+ writeBuf(7,i+2,5,1,buf);
+ }
+}
+
+void TDiaPal::handleEvent(TEvent& event)
+{
+ if (event.what==evBroadcast && event.message.command==cmScrollBarChanged)
+ {
+ int r,g,b;
+ TScrollBar *p=(TScrollBar *)event.message.infoPtr;
+ EditorPalette->GetOne(colorsel->getValue(),r,g,b);
+ if (p==red)
+ {
+ r=p->value;
+ rn->setValue(r);
+ }
+ else
+ if (p==green)
+ {
+ g=p->value;
+ gn->setValue(g);
+ }
+ else
+ if (p==blue)
+ {
+ b=p->value;
+ bn->setValue(b);
+ }
+
+ EditorPalette->SetOne(colorsel->getValue(),r,g,b);
+ }
+ else
+ if (event.what==evCommand && event.message.command==cmYes)
+ {
+ EditorPalette->BackToDefault();
+ endModal(cmYes);
+ clearEvent(event);
+ return;
+ }
+ else
+ if (event.what==evKeyDown && event.keyDown.keyCode==kbEsc)
+ {
+ endModal(cmCancel);
+ clearEvent(event);
+ return;
+ }
+ else
+ if (event.what==evKeyDown)
+ {
+ int aux;
+ switch (event.keyDown.keyCode)
+ {
+ case kbR:
+ aux=red->value;
+ if (aux>0)
+ {
+ aux--;
+ red->setValue(aux);
+ rn->setValue(aux);
+ }
+ break;
+ case kbShR:
+ aux=red->value;
+ if (aux<MaxCompVal)
+ {
+ aux++;
+ red->setValue(aux);
+ rn->setValue(aux);
+ }
+ break;
+ case kbG:
+ aux=green->value;
+ if (aux>0)
+ {
+ aux--;
+ green->setValue(aux);
+ gn->setValue(aux);
+ }
+ break;
+ case kbShG:
+ aux=green->value;
+ if (aux<MaxCompVal)
+ {
+ aux++;
+ green->setValue(aux);
+ gn->setValue(aux);
+ }
+ break;
+ case kbB:
+ aux=blue->value;
+ if (aux>0)
+ {
+ aux--;
+ blue->setValue(aux);
+ bn->setValue(aux);
+ }
+ break;
+ case kbShB:
+ aux=blue->value;
+ if (aux<MaxCompVal)
+ {
+ aux++;
+ blue->setValue(aux);
+ bn->setValue(aux);
+ }
+ break;
+ }
+ }
+
+ TDialog::handleEvent(event);
+}
+
+void EditPalette(void)
+{
+ if (!TScreen::canSetPalette())
+ {
+ messageBox(__("The hardware doesn't support this."),mfError | mfOKButton);
+ return;
+ }
+ PalCol *orig=EditorPalette->GetAllPal();
+ TDialog *d=new TDiaPal();
+ if (execDialog(d,0)==cmCancel)
+ EditorPalette->SetAllPal(orig);
+ DeleteArray(orig);
+}
+
diff --git a/setedit/setedit/edkeys.cc b/setedit/setedit/edkeys.cc
new file mode 100644
index 0000000..b68b926
--- /dev/null
+++ b/setedit/setedit/edkeys.cc
@@ -0,0 +1,634 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+
+#define Uses_AllocLocal
+#define Uses_TDialog
+#define Uses_TSortedListBox
+#define Uses_TRect
+#define Uses_MsgBox
+#define Uses_TScrollBar
+#define Uses_TButton
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TNoCaseNoOwnerStringCollection
+#define Uses_TNoCaseStringCollection
+#define Uses_TCEditor_Internal
+#define Uses_TCEditor_Commands
+#define Uses_TFileDialog
+#define Uses_TInputScanKey
+#define Uses_TRadioButtons
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TStringable
+#define Uses_TStringableListBox
+#define Uses_TStaticText
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TDialogAID
+#define Uses_TGKey
+
+#define Uses_TSLabelRadio
+#define Uses_TSLabel
+#define Uses_TSButton
+#define Uses_TSStaticText
+#define Uses_TSInputLine
+#define Uses_TSVeGroup
+#define Uses_TSNoStaticText
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_TMLIEditorDefs
+#include <mli.h>
+#include <loadkbin.h>
+#include <edmsg.h>
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <edhists.h>
+#include <ctype.h>
+#define Uses_TKeyTranslate
+#define Uses_TKeySeqCol
+#define Uses_TComSeqCol
+#include <keytrans.h>
+#include <diaghelp.h>
+// For the helpCtx:
+#include <editcoma.h>
+
+//------------------------------ Forward declarations
+
+static int InitVariables(void);
+static void DeInitVariables(void);
+static int DeleteKey(int wich);
+static int AddNewKey(void);
+static int DeleteKeyInSeq(int wich);
+static int AddNewKeyInSeq(void);
+static int InsNewKeyInSeq(int wich);
+static int DeleteComInSeq(int wich);
+static int AddNewComInSeq(void);
+static int InsNewComInSeq(int wich);
+static char *AddMacro(void);
+static TComSeqCol *AddCommands(void);
+static int addKey(TKeySeqCol *sKeys, void *data, int Type);
+static int OkApply(void);
+static int CancelApply(void);
+static int AddCommOrMacro(void);
+
+//------------------------------ Constants
+
+const int lNameKeys=32;
+const int lAddb=11,lDelb=10;
+const int lOKb=10,lCancelb=12,lSepb=2;
+const int ktyCommand=1,ktyMacro=2;
+// Columns for the dialogs
+const int col1=1,col2=12,col3=23,col4=34;
+
+//------------------------------ Types
+
+typedef struct
+{
+ TStringable *items;
+ int selected;
+ uint32 ops;
+} TStrLB;
+
+//------------------------------ Static variables
+
+static int Modified,wasModified;
+
+static TDialogAID *ChooseFirstDialog=0;
+static TStringableListBoxRec FirstSel;
+static char lGroupSetData;
+
+static TKeySeqCol *KSequence;
+static TComSeqCol *CSequence;
+
+static KeyTTable *Original;
+static int CanBeDeleted;
+
+static TDialog *MacrosDialog=0;
+static TListBoxRec MacBox;
+
+static TDialogAID *AddKeyDialog;
+static TStrLB NewKeyBox;
+
+static TDialogAID *AddComDialog;
+static TStringableListBoxRec NewComBox;
+
+static TDialog *CommandsDialog=0;
+static TListBoxRec ComBox;
+static TNoCaseNoOwnerStringCollection *Commands=0;
+
+static TDialog *sLispCodeDialog=0;
+
+//------------------------------ Helper functions, can be moved
+
+#define DisableCommands() \
+ Boolean oldOk=TView::commandEnabled(cmOKApply); \
+ Boolean oldDel=TView::commandEnabled(cmDeleteKey); \
+ Boolean oldIns=TView::commandEnabled(cmInsertKey); \
+ TView::disableCommand(cmOKApply); \
+ TView::disableCommand(cmDeleteKey); \
+ TView::disableCommand(cmInsertKey)
+
+#define RestoreCommands() \
+ if (oldOk) \
+ TView::enableCommand(cmOKApply); \
+ else \
+ TView::disableCommand(cmOKApply); \
+ if (oldDel) \
+ TView::enableCommand(cmDeleteKey); \
+ else \
+ TView::disableCommand(cmDeleteKey); \
+ if (oldIns) \
+ TView::enableCommand(cmInsertKey); \
+ else \
+ TView::disableCommand(cmInsertKey)
+
+//------------------------------ Classes
+
+class TDialogK : public TDialog
+{
+public:
+ TDialogK(const char *aTitle) :
+ TWindowInit(&TDialogK::initFrame),
+ TDialog(TRect(0,0,0,0),aTitle) {}
+ virtual void handleEvent(TEvent& event);
+};
+
+//---------- Entry point
+
+/**[txh]********************************************************************
+
+ Description:
+ Edits the keyboard binding data using a friendly interface.
+
+ Return:
+ 0 if no modifications were done.
+
+***************************************************************************/
+
+int KeyBindEdit(void)
+{
+ InitVariables();
+ TView::enableCommand(cmOKApply);
+ TView::enableCommand(cmAddKey);
+ TView::enableCommand(cmInsertKey);
+ execDialogNoDestroy(ChooseFirstDialog,&FirstSel,lGroupSetData);
+ DeInitVariables();
+ return wasModified;
+}
+
+//----------- Routines to init, deinit and apply the things done
+
+static int InitVariables(void)
+{
+ Original=KeyTrans.expand(CanBeDeleted);
+
+ ChooseFirstDialog=CreateAddInsDelDialog(col1,1,__("Key assignment"),12,lNameKeys+4,0);
+ ChooseFirstDialog->helpCtx=hcEditKeys;
+ FirstSel.items=&KeyTrans;
+ FirstSel.selection=0;
+ lGroupSetData=1;
+ ChooseFirstDialog->DelAction=DeleteKey;
+ ChooseFirstDialog->AddAction=AddNewKey;
+ ChooseFirstDialog->OkAction=OkApply;
+ ChooseFirstDialog->CancelAction=CancelApply;
+
+ Modified=0;
+ wasModified=0;
+
+ return 0;
+}
+
+static void ApplyChanges(void)
+{
+ wasModified=1;
+}
+
+static void DeInitVariables(void)
+{
+ if (wasModified)
+ {
+ if (CanBeDeleted)
+ delete Original;
+ KeyTrans.compact();
+ }
+ else
+ {
+ KeyTrans.ChangeTable(Original,CanBeDeleted ? kbtDynamic : kbtStatic);
+ }
+
+ Destroy(ChooseFirstDialog)
+ Destroy(CommandsDialog)
+ Destroy(Commands)
+ Destroy(MacrosDialog)
+ Destroy(sLispCodeDialog)
+}
+
+//---------- First dialog: Add/Delete keys
+
+// Action for delete button
+static int DeleteKey(int wich)
+{
+ KeyTrans.deleteKey(wich);
+ Modified=1;
+ return 1;
+}
+
+static
+int OkApply(void)
+{
+ if (Modified)
+ {
+ if (messageBox(__("Accepting that you'll change the SET's editor behavior"),mfOKCancel)==cmOK)
+ {
+ ApplyChanges();
+ return 1;
+ }
+ }
+ else
+ return 1;
+ return 0;
+}
+
+static
+int CancelApply(void)
+{
+ if (Modified)
+ {
+ if (messageBox(__("Do you really want to discard the changes?"),mfOKCancel)==cmOK)
+ return 1;
+ }
+ else
+ return 1;
+ return 0;
+}
+
+
+//---------- Second level of dialog: Add a key
+
+static int AddNewKey(void)
+{
+ AddKeyDialog=CreateAddInsDelDialog(col2,3,__("Sequence of keys"),6,24,
+ aidInsert | aidComMac | aidAssignedTo);
+ AddKeyDialog->helpCtx=hcEditKeysSeq;
+ KSequence=new TKeySeqCol(2,2);
+ NewKeyBox.items=KSequence;
+ NewKeyBox.selected=0;
+ NewKeyBox.ops=0;
+ AddKeyDialog->DelAction=DeleteKeyInSeq;
+ AddKeyDialog->AddAction=AddNewKeyInSeq;
+ AddKeyDialog->InsAction=InsNewKeyInSeq;
+ AddKeyDialog->OkAction=AddCommOrMacro;
+
+ DisableCommands();
+ int added=(execDialog(AddKeyDialog,&NewKeyBox)==cmOK);
+ RestoreCommands();
+
+ CLY_destroy(KSequence);
+ return added;
+}
+
+static
+TDialog *CreateLispCodeDialog()
+{
+ TSViewCol *col=new TSViewCol(__("sLisp code"));
+
+
+ col->insert(xTSCenter,yTSUpSep,
+ MakeVeGroup(new TSStaticText(__("Enter the sLisp code, it must start with (\n"
+ "and end with )")),
+ new TSInputLine(255,1,hID_sLispKeyCode,40),
+ 0));
+ EasyInsertOKCancel(col,3);
+
+ TDialog *d=col->doItCenter(hcEditKeysLisp);
+ delete col;
+ return d;
+}
+
+static
+char *AddsLispCode()
+{
+ char isFirstTime=1;
+
+ if (!MacrosDialog)
+ sLispCodeDialog=CreateLispCodeDialog();
+
+ char b[256];
+ strcpy(b,"()");
+ if (execDialogNoDestroy(sLispCodeDialog,b,isFirstTime)==cmCancel)
+ return 0;
+
+ return strdup(b);
+}
+
+static
+int AddCommOrMacro(void)
+{
+ AddKeyDialog->getData(&NewKeyBox);
+
+ if (NewKeyBox.ops==1) // Macro
+ {
+ char *m=AddMacro();
+ if (m)
+ return addKey(KSequence,strdup(m),kbtIsMacro);
+ }
+ else if (NewKeyBox.ops==2) // sLisp code
+ {
+ char *m=AddsLispCode();
+ if (m)
+ return addKey(KSequence,m,kbtIsMacro);
+ }
+ else
+ {
+ TComSeqCol *p=AddCommands();
+ if (p)
+ {
+ int ret=addKey(KSequence,p,kbtIsSeq);
+ CLY_destroy(p);
+ return ret;
+ }
+ }
+ return 0;
+}
+
+static
+int addKey(TKeySeqCol *sKeys, void *data, int Type)
+{
+ int ret=KeyTrans.addKey(sKeys,data,Type);
+ if (ret>=0)
+ {
+ if (messageBox(__("This key is already in use, do you want to replace it?"),mfYesButton | mfNoButton)==cmYes)
+ {
+ KeyTrans.deleteKey(ret);
+ KeyTrans.addKey(sKeys,data,Type);
+ Modified=1;
+ return 1;
+ }
+ return 0;
+ }
+ else
+ if (ret==-1)
+ {
+ messageBox(__("This sequence is used for more than one key, delete these assignments first"),mfOKButton);
+ return 0;
+ }
+ Modified=1;
+ return 1;
+}
+
+void TDialogK::handleEvent(TEvent& event)
+{
+ if (event.what==evKeyDown)
+ {
+ endModal(event.keyDown.keyCode);
+ clearEvent(event);
+ return;
+ }
+ TDialog::handleEvent(event);
+}
+
+unsigned short TCEditor_SelectAKey(void)
+{
+ TDialogK *d=new TDialogK(__("Key selector"));
+ TSViewCol *col=new TSViewCol(d);
+
+ col->insert(xTSCenter,yTSUpSep,new TSStaticText(__("Press a key")));
+ col->doItCenter(hcEditKeysSeq);
+ delete col;
+ return execDialog(d,0);
+}
+
+static
+void UpdateAssignedTo()
+{
+ if (!AddKeyDialog->nst)
+ return;
+ // Just look if the key is assigned
+ int ret=KSequence->getCount() ? KeyTrans.addKey(KSequence,NULL,0,NULL,True) : -3;
+ switch (ret)
+ {
+ case -1:
+ AddKeyDialog->nst->setText(__("Part of a sequence"));
+ break;
+ case -2:
+ AddKeyDialog->nst->setText(__("Unassigned"));
+ break;
+ case -3:
+ AddKeyDialog->nst->setText(" ");
+ break;
+ default:
+ {
+ char buffer[257];
+ KeyTrans.getText(buffer,ret,256);
+ AddKeyDialog->nst->setText(buffer);
+ }
+ }
+}
+
+static
+int DeleteKeyInSeq(int wich)
+{
+ KSequence->atRemove(wich);
+ UpdateAssignedTo();
+ return 1;
+}
+
+static
+int AddNewKeyInSeq(void)
+{
+ unsigned short k=TCEditor_SelectAKey();
+ if (k)
+ {
+ KSequence->insert(k);
+ UpdateAssignedTo();
+ return 1;
+ }
+ return 0;
+}
+
+static
+int InsNewKeyInSeq(int wich)
+{
+ unsigned short k=TCEditor_SelectAKey();
+ if (k)
+ {
+ KSequence->atInsert(wich,(void *)(unsigned long)k);
+ UpdateAssignedTo();
+ return 1;
+ }
+ return 0;
+}
+
+//---------- Third level of dialog: Add a Macro
+
+static
+char *AddMacro(void)
+{
+ char isFirstTime=0;
+
+ if (!MacrosDialog)
+ {
+ isFirstTime=1;
+ MacrosDialog=CreateChooseDialog(col3,5,__("Macros"),10,32);
+ MacrosDialog->helpCtx=hcEditKeysMac;
+ MacBox.items=GetMacrosList();
+ MacBox.selection=0;
+ }
+
+ if (execDialogNoDestroy(MacrosDialog,&MacBox,isFirstTime)==cmCancel)
+ return 0;
+ if (!MacBox.items->getCount())
+ return 0;
+ return (char *)(MacBox.items->at(MacBox.selection));
+}
+
+static
+TComSeqCol *AddCommands(void)
+{
+ AddComDialog=CreateAddInsDelDialog(col3,5,__("Commands"),6,32,aidInsert);
+ AddComDialog->helpCtx=hcEditKeysCom;
+ CSequence=new TComSeqCol(2,6);
+ NewComBox.items=CSequence;
+ NewComBox.selection=0;
+ AddComDialog->DelAction=DeleteComInSeq;
+ AddComDialog->AddAction=AddNewComInSeq;
+ AddComDialog->InsAction=InsNewComInSeq;
+
+ DisableCommands();
+ int ret=execDialog(AddComDialog,&NewComBox);
+ RestoreCommands();
+ if (ret==cmOK)
+ return CSequence;
+
+ CLY_destroy(CSequence);
+ return 0;
+}
+
+//---------- Fourth level of dialog: Choose a command
+
+static
+int SelectACom(void)
+{
+ char isFirstTime=0;
+
+ if (!CommandsDialog)
+ {
+ isFirstTime=1;
+ CommandsDialog=CreateChooseDialog(col4,7,__("A command"),10,20);
+ Commands=CreateEdCommandCol();
+ ComBox.items=Commands;
+ ComBox.selection=0;
+ }
+
+ if (execDialogNoDestroy(CommandsDialog,&ComBox,isFirstTime)==cmCancel)
+ return -1;
+
+ int command=SearchEdCommand((char *)(Commands->at(ComBox.selection)));
+ if (command>0)
+ command+=cmbBaseNumber;
+ return command;
+}
+
+static
+int DeleteComInSeq(int wich)
+{
+ CSequence->atRemove(wich);
+ return 1;
+}
+
+static
+int AddNewComInSeq(void)
+{
+ int c=SelectACom();
+ if (c>=0)
+ {
+ CSequence->insert(c);
+ return 1;
+ }
+ return 0;
+}
+
+static
+int InsNewComInSeq(int wich)
+{
+ long c=SelectACom();
+ if (c>=0)
+ {
+ CSequence->atInsert(wich,(void *)c);
+ return 1;
+ }
+ return 0;
+}
+
+//--------------- Other facilities
+
+void SeeScanCodes(void)
+{
+ TDialog *d=new TDialog(TRect(0,0,30,7),__("Scan Viewer"));
+ d->options|=ofCentered;
+ d->helpCtx=cmeSeeScanCodes;
+ TPoint p;
+ p.x=5; p.y=2;
+ d->insert(new TInputScanKey(p));
+ d->insert(new TButton(TRect(10,4,20,6),__("~O~k"),cmOK,bfNormal));
+ d->selectNext(False);
+ execDialog(d,0);
+}
+
+int AltKeysSetUp(void)
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Alt keys settings")));
+
+ TSLabel *Hotkey=TSLabelRadio(__("~K~eys used by the menues, etc."),
+ __("~L~eft Alt"),__("~R~ight Alt"),
+ __("~B~oth Alt"),0);
+
+ col->insert(2,2,Hotkey);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doIt();
+ d->options|=ofCentered;
+ d->helpCtx=cmeSetUpAltKeys;
+ delete col;
+
+ uint32 which=TGKey::GetAltSettings();
+
+ if (execDialog(d,&which)==cmOK)
+ {
+ TGKey::SetAltSettings(which);
+ return 1;
+ }
+ return 0;
+}
+
+int KeyPadSetUp(void)
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Key Pad behavior")));
+
+ TSLabel *Behave=TSLabelRadio(__("Behavior"),__("Use the ~B~IOS default"),
+ __("Always interpret shift+arrow as ~m~ovement"),0);
+ col->insert(2,2,Behave);
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doIt();
+ d->options|=ofCentered;
+ d->helpCtx=cmeKeyPadBehavior;
+ delete col;
+
+ uint32 b=TGKey::GetKbdMapping(TGKey::dosTranslateKeypad);
+ if (execDialog(d,&b)==cmOK)
+ {
+ TGKey::SetKbdMapping(b ? TGKey::dosTranslateKeypad : TGKey::dosNormalKeypad);
+ return 1;
+ }
+ return 0;
+}
+
diff --git a/setedit/setedit/edmsg.cc b/setedit/setedit/edmsg.cc
new file mode 100644
index 0000000..7b40ec2
--- /dev/null
+++ b/setedit/setedit/edmsg.cc
@@ -0,0 +1,831 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_string
+#define Uses_stdio
+#define Uses_access
+#define Uses_unistd
+
+#define Uses_AllocLocal
+#define Uses_TDialog
+#define Uses_TScrollBar
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TWindowList
+#define Uses_TListBox
+#define Uses_TSOSCol
+#define Uses_TSOSListBox
+#define Uses_SOStack
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TCEditor_Commands
+#define Uses_TCEditor_External
+#define Uses_TCEditor
+#define Uses_FileOpenAid
+#define Uses_MsgBox
+#define Uses_TVCodePage
+#define Uses_TScreen
+#define Uses_TDeskTop
+#define Uses_TVOSClipboard
+#define Uses_TPalette
+#include <ceditor.h>
+#define Uses_TSOSListBoxMsg
+#include <edmsg.h>
+#include <dskwin.h>
+#include <dskmessa.h>
+#define Uses_SETAppConst
+#define Uses_SETAppHelper
+#define Uses_SETAppVarious
+#define Uses_TSetEditorApp
+#include <setapp.h>
+#include <splinman.h>
+#include <codepage.h>
+#include <editcoma.h>
+#include <dyncat.h>
+
+static TEdMsgDialog *MsgWindow=NULL;
+static TSOSListBoxMsg *MsgList =NULL;
+static SOStack *Stack =NULL;
+static TSOSCol *MsgCol =NULL;
+static TRect MsgWindowRect(-1,-1,-1,-1);
+
+unsigned TSOSListBoxMsg::opsEnd=lbmReachedMsg;
+unsigned TSOSListBoxMsg::opsBeep=1;
+
+static
+void ResetHz()
+{
+ if (MsgList->hScrollBar)
+ MsgList->hScrollBar->setValue(0);
+}
+
+TEdMsgDialog::TEdMsgDialog(const TRect &aR,const char *t) :
+ TWindowInit(TEdMsgDialog::initFrame),
+ TDialog(aR,t)
+{
+ TScrollBar *scrollbar;
+ TRect r;
+ flags = wfMove | wfGrow | wfZoom | wfClose;
+ growMode = gfGrowLoY | gfGrowHiX | gfGrowHiY;
+ r=getExtent();
+ r.grow(-1,-1);
+ scrollbar=standardScrollBar(sbVertical | sbHandleKeyboard);
+ MsgList = new TSOSListBoxMsg(r,1,scrollbar);
+ MsgList->growMode = gfGrowHiX | gfGrowHiY;
+ scrollbar=standardScrollBar(sbHorizontal | sbHandleKeyboard);
+ scrollbar->setParams(0,0,1000-(r.b.x-r.a.x),40,1);
+ MsgList->hScrollBar = scrollbar;
+ insert(MsgList);
+ helpCtx=hcMessageWindow;
+}
+
+void TEdMsgDialog::changeBounds(const TRect &r)
+{
+ TDialog::changeBounds(r);
+ MsgWindowRect = r;
+}
+
+void TEdMsgDialog::close(void)
+{
+ hide();
+}
+
+void TEdMsgDialog::handleEvent(TEvent& event)
+{
+ if (event.what==evKeyDown && event.keyDown.keyCode==kbEsc)
+ {
+ close();
+ clearEvent(event);
+ return;
+ }
+ TDialog::handleEvent(event);
+}
+
+TEdMsgDialog::~TEdMsgDialog()
+{
+ if (Stack)
+ {
+ delete Stack;
+ Stack=0;
+ }
+ if (MsgCol)
+ {
+ delete MsgCol;
+ MsgCol=0;
+ }
+}
+
+// 1-5 Same as a cyan window, 6-8 same as a list viewer, 9-11 new colors
+#define cpEdMsgDialogPal "\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE"
+
+TPalette &TEdMsgDialog::getPalette() const
+{
+ static TPalette pal(cpEdMsgDialogPal,sizeof(cpEdMsgDialogPal)-1);
+ return pal;
+}
+
+
+static int avoidFocusAction=0;
+
+void TSOSListBoxMsg::focusItem(ccIndex item)
+{
+ ccIndex old=focused;
+ TSOSListBox::focusItem(item);
+ if (!avoidFocusAction && item!=old)
+ {
+ stkHandler aux=(stkHandler)(list()->at(focused));
+ aux=Stack->GetPreviousOf(aux);
+ FileInfo *fI=(FileInfo *)(Stack->GetPointerOf(aux));
+ if (fI->Line>=0)
+ {
+ //TApplication::deskTop->lock();
+ char *fileName=Stack->GetStrOf(Stack->GetPreviousOf(aux));
+ ShowFileLine(SpLineGetNewValueOf(fI->Line,fileName),fI->Column,fileName);
+ //this->owner->select();
+ //TApplication::deskTop->unlock();
+ }
+ }
+}
+
+void TSOSListBoxMsg::selectItem(ccIndex item)
+{
+ if (item>=list()->getCount()) return;
+ TSOSListBox::selectItem(item);
+ selectOK=0;
+ if (!avoidFocusAction)
+ {
+ ccIndex c=focused;
+
+ stkHandler aux=(stkHandler)(list()->at(c));
+ char *msg=Stack->GetStrOf(aux);
+ aux=Stack->GetPreviousOf(aux);
+ FileInfo *fI=(FileInfo *)(Stack->GetPointerOf(aux));
+
+ // Check if that's a continuation of a multiline error
+ if (focused && fI->Line<0 && (fI->type & fitCont))
+ {
+ do
+ {
+ c--;
+ aux=(stkHandler)(list()->at(c));
+ msg=Stack->GetStrOf(aux);
+ aux=Stack->GetPreviousOf(aux);
+ fI=(FileInfo *)(Stack->GetPointerOf(aux));
+ }
+ while (c && fI->Line<0 && (fI->type & fitCont));
+ }
+
+ if (fI->Line>=0)
+ {
+ char *fileName=Stack->GetStrOf(Stack->GetPreviousOf(aux));
+ int allocated=0, len=fI->len, offset=fI->offset;
+ // Check if the message continues in the next item
+ if (c+1<list()->getCount())
+ {
+ aux=(stkHandler)(list()->at(c+1));
+ char *msg2=Stack->GetStrOf(aux);
+ aux=Stack->GetPreviousOf(aux);
+ FileInfo *fI=(FileInfo *)(Stack->GetPointerOf(aux));
+ if (fI->type & fitCont)
+ {
+ DynStrCatStruct st;
+ DynStrCatInit(&st,msg+offset,len);
+ DynStrCat(&st,msg2+fI->offset,fI->len);
+ msg=st.str;
+ len=st.len;
+ offset=0;
+ allocated=1;
+ }
+ }
+ selectOK=GotoFileLine(SpLineGetNewValueOf(fI->Line,fileName),fI->Column,
+ fileName,msg,offset,len);
+ if (allocated)
+ free(msg);
+ }
+ }
+}
+
+void TSOSListBoxMsg::setState(uint16 aState, Boolean enable)
+{
+ TSOSListBox::setState(aState,enable);
+ if (aState==sfActive)
+ updateCommands(state & sfActive);
+}
+
+void TSOSListBoxMsg::updateCommands(int enable)
+{
+ TCollection *l=list();
+
+ if (MsgList && MsgList->haveJumpLines)
+ { // Don't disable it, they must be available even if the window isn't selected
+ enableCommand(cmeNextMessage);
+ enableCommand(cmePrevMessage);
+ }
+ else
+ {
+ disableCommand(cmeNextMessage);
+ disableCommand(cmePrevMessage);
+ }
+
+ if (enable && l && l->getCount()!=0)
+ {
+ enableCommand(cmcCopy);
+ enableCommand(cmcCopyClipWin);
+ enableCommand(cmcSaveAs);
+ }
+ else
+ {
+ disableCommand(cmcCopy);
+ disableCommand(cmcCopyClipWin);
+ disableCommand(cmcSaveAs);
+ }
+}
+
+void TSOSListBoxMsg::saveAs()
+{
+ char fileName[PATH_MAX];
+ strcpy(fileName,"messages.txt");
+
+ // Hey man, just reuse code ;-)
+ if (TCEditor::editorDialog(edSaveAs,fileName)!=cmCancel)
+ save(fileName);
+}
+
+void TSOSListBoxMsg::save(char *name)
+{ // Reusing the editor's dialogs this function is very complet
+ if (access(name,F_OK)==0 && TCEditor::editorDialog(edFileExists,name,0)==cmNo)
+ return;
+ FILE *f=fopen(name,"wt");
+ if (!f)
+ {
+ TCEditor::editorDialog(edCreateError,name);
+ return;
+ }
+ if (MsgCol)
+ {
+ int c=MsgCol->getCount();
+ for (int i=0; i<c; i++)
+ {
+ fputs(MsgCol->atStr(i),f);
+ fputs("\n",f);
+ }
+ }
+ if (ferror(f))
+ TCEditor::editorDialog(edWriteError,name,NULL);
+ fclose(f);
+}
+
+void TSOSListBoxMsg::copyClipboard(Boolean osClipboard)
+{
+ if (!MsgCol || !TCEditor::clipboard)
+ return;
+
+ int c=MsgCol->getCount();
+ int len=1,i,lacu;
+ for (i=0; i<c; i++)
+ len+=strlen(MsgCol->atStr(i))+CLY_LenEOL;
+
+ char *buffer=new char[len];
+ if (!buffer)
+ {
+ TCEditor::editorDialog(edOutOfMemory);
+ return;
+ }
+
+ for (lacu=0, i=0; i<c; i++)
+ {
+ char *s=MsgCol->atStr(i);
+ strcpy(buffer+lacu,s);
+ lacu+=strlen(s);
+ strcpy(buffer+lacu,CLY_crlf);
+ lacu+=CLY_LenEOL;
+ }
+
+ if (osClipboard)
+ {
+ if (TVOSClipboard::isAvailable())
+ TVOSClipboard::copy(0,buffer,lacu);
+ }
+ else
+ TCEditor::clipboard->insertText(buffer,lacu,True);
+
+ delete[] buffer;
+}
+
+
+void TSOSListBoxMsg::handleEvent(TEvent& event)
+{
+ if ((event.what==evKeyDown && event.keyDown.keyCode==kbEnter) ||
+ (event.what==evMouseDown && event.mouse.doubleClick))
+ {
+ selectItem(focused);
+ clearEvent(event);
+ return;
+ }
+ else
+ if (event.what==evKeyDown && event.keyDown.keyCode==kbDel)
+ {
+ TCollection *l=list();
+ if (l && focused<l->getCount())
+ {
+ l->atRemove(focused);
+ int c=l->getCount();
+ setRange(c);
+ if (!c)
+ updateCommands(0);
+ }
+ draw();
+ clearEvent(event);
+ return;
+ }
+ else
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmeNextMessage:
+ selectNext();
+ clearEvent(event);
+ return;
+ case cmePrevMessage:
+ selectPrev();
+ clearEvent(event);
+ return;
+ case cmcSaveAs:
+ saveAs();
+ clearEvent(event);
+ break;
+ case cmcCopy:
+ copyClipboard(False);
+ clearEvent(event);
+ break;
+ case cmcCopyClipWin:
+ copyClipboard(True);
+ clearEvent(event);
+ break;
+ }
+ }
+ TListBox::handleEvent(event);
+}
+
+int TSOSListBoxMsg::getLineOf(int pos)
+{
+ stkHandler aux=(stkHandler)(list()->at(pos));
+ aux=Stack->GetPreviousOf(aux);
+ FileInfo *fI=(FileInfo *)(Stack->GetPointerOf(aux));
+ return fI->Line;
+}
+
+unsigned TSOSListBoxMsg::getTypeOf(int pos)
+{
+ stkHandler aux=(stkHandler)(list()->at(pos));
+ aux=Stack->GetPreviousOf(aux);
+ FileInfo *fI=(FileInfo *)(Stack->GetPointerOf(aux));
+ return fI->type;
+}
+
+static inline
+void MakeBeep()
+{
+ CLY_Beep();
+}
+
+void TSOSListBoxMsg::selectNext(int offset)
+{
+ if (!haveJumpLines) return;
+ int nFocus=focused+offset;
+
+ while (nFocus<range)
+ {
+ if (getLineOf(nFocus)>=0)
+ {
+ TSOSListBox::focusItem(nFocus);
+ selectItem(focused);
+ ResetHz();
+ if (!selectOK)
+ owner->select();
+ return;
+ }
+ nFocus++;
+ }
+ if (opsBeep)
+ MakeBeep();
+ if (opsEnd==lbmReachedMsg)
+ messageBox(__("Last message in the list"),mfInformation | mfOKButton);
+ else if (opsEnd==lbmWrap)
+ {// Go to the first
+ focused=0;
+ selectNext(0);
+ return;
+ }
+ // Try to go to the last
+ selectPrev(0);
+}
+
+void TSOSListBoxMsg::selectPrev(int offset)
+{
+ if (!haveJumpLines) return;
+ int nFocus=focused-offset;
+
+ while (nFocus>=0)
+ {
+ if (getLineOf(nFocus)>=0)
+ {
+ TSOSListBox::focusItem(nFocus);
+ selectItem(focused);
+ ResetHz();
+ if (!selectOK)
+ owner->select();
+ return;
+ }
+ nFocus--;
+ }
+ if (opsBeep)
+ MakeBeep();
+ if (opsEnd==lbmReachedMsg)
+ messageBox(__("First message in the list"),mfInformation | mfOKButton);
+ else if (opsEnd==lbmWrap)
+ {// Go to the first
+ focused=range;
+ selectPrev(1);
+ return;
+ }
+ // Try to go to the first
+ selectNext(0);
+}
+
+// 1-3 same as a list viewer, 4-6 new colors
+#define cpSOSListBoxMsgPal "\x6\x6\x7\x8\x9\xA\xB"
+
+TPalette &TSOSListBoxMsg::getPalette() const
+{
+ static TPalette pal(cpSOSListBoxMsgPal,sizeof(cpSOSListBoxMsgPal)-1);
+ return pal;
+}
+
+void TSOSListBoxMsg::draw()
+{
+ int i, isSelAct, indent, scOff;
+ ccIndex item;
+ unsigned normalColor, selectedColor, focusedColor=0, color,
+ infoColor, warnColor, errColor;
+ TDrawBuffer b;
+
+ isSelAct=(state & (sfSelected | sfActive))==(sfSelected | sfActive);
+ if (isSelAct)
+ {// Selected & Active
+ normalColor=getColor(1);
+ focusedColor=getColor(3);
+ selectedColor=getColor(4);
+ }
+ else
+ {// !Selected | !Active
+ normalColor=getColor(2);
+ selectedColor=getColor(4);
+ }
+ infoColor=getColor(5);
+ warnColor=getColor(6);
+ errColor =getColor(7);
+
+ // Horizontal scroll bar offset
+ if (hScrollBar)
+ indent=hScrollBar->value;
+ else
+ indent=0;
+
+ // Render line by line
+ for (i=0; i<size.y; i++)
+ {
+ int width=size.x+1;
+ item=i+topItem;
+
+ // Solve the color according to the type
+ unsigned type=item<range ? getTypeOf(item) : fitNone;
+ switch (type & (~fitCont))
+ {
+ case fitInfo:
+ color=infoColor;
+ break;
+ case fitWarning:
+ color=warnColor;
+ break;
+ case fitError:
+ color=errColor;
+ break;
+ case fitNone:
+ default:
+ color=normalColor;
+ }
+
+ int isSel=item<range && isSelected(item);
+ if (isSelAct && focused==item && range>0)
+ {
+ color=(focusedColor & 0xF0) | (color & 0xF); // Keep the color for the type.
+ setCursor(1,i);
+ scOff=0;
+ }
+ else if (isSel)
+ {
+ scOff=2;
+ }
+ else
+ scOff=4;
+
+ // Clear the whole line
+ b.moveChar(0,' ',color,width);
+ if (item<range)
+ {
+ AllocLocalStr(text,width+indent+1);
+ AllocLocalStr(buf,width+1);
+ getText(text,item,width+indent);
+ int tl=strlen(text);
+ if (tl<=indent)
+ buf[0]=EOS;
+ else
+ {
+ memcpy(buf,text+indent,width);
+ buf[tl-indent]=EOS;
+ }
+ b.moveStr(1,buf,color);
+ if (showMarkers || isSel)
+ {
+ b.putChar(0,specialChars[scOff]);
+ b.putChar(width-2,specialChars[scOff+1]);
+ }
+ }
+ else if (i==0)
+ b.moveStr(1,_("<empty>"),getColor(1));
+ writeLine(0,i,size.x,1,b);
+ }
+}
+
+static void InsertInHelper(void)
+{
+ if (!SearchInHelper(dktMessage,MsgWindow))
+ {
+ TDskWinMessage *p=new TDskWinMessage(MsgWindow);
+ AddNonEditorToHelper(p);
+ }
+}
+
+TEdMsgDialog *EdMessageWindowInit(int Insert)
+{
+ SpLinesDeleteForId(idsplError);
+ // If already initialized clean & return
+ if (MsgWindow)
+ {
+ MsgCol->removeAll();
+ MsgList->setRange(0);
+ MsgList->haveJumpLines=0;
+ Stack->Clean();
+ MsgWindow->hide();
+ if (Insert)
+ InsertInHelper();
+ return MsgWindow;
+ }
+ // Create an stack for the messages:
+ Stack=new SOStack;
+ if (!Stack)
+ return MsgWindow;
+ // Create the list:
+ MsgCol=new TSOSCol(8,6,Stack);
+ if (!MsgCol)
+ return MsgWindow;
+ // Create the dialog:
+ if (MsgWindowRect.a.x==-1)
+ {
+ MsgWindowRect = TProgram::deskTop->getExtent();
+ if (TSetEditorApp::geFlags & geVertWindows)
+ {
+ if (TSetEditorApp::geFlags & geRightSide)
+ MsgWindowRect.a.x=MsgWindowRect.b.x-TSetEditorApp::widthVertWindows;
+ else
+ MsgWindowRect.b.x=TSetEditorApp::widthVertWindows;
+ }
+ else
+ MsgWindowRect.a.y=MsgWindowRect.b.y-7;
+ }
+ MsgWindow=new TEdMsgDialog(MsgWindowRect,__("Message Window"));
+ if (!MsgWindow)
+ return MsgWindow;
+ MsgList=MsgWindow->MsgList; // Global alias
+ MsgList->newList(MsgCol);
+ MsgList->haveJumpLines=0;
+
+ if (Insert)
+ {
+ // Insert it hided because is empty
+ TProgram::deskTop->lock();
+ TProgram::deskTop->insert(MsgWindow);
+ MsgWindow->hide();
+ TProgram::deskTop->unlock();
+ InsertInHelper();
+ }
+
+ return MsgWindow;
+}
+
+
+static
+stkHandler InsertFileInfo(FileInfo &p)
+{
+ stkHandler aux=Stack->alloc(sizeof(FileInfo));
+ if (aux!=stkNULL)
+ memcpy(Stack->GetPointerOf(aux),&p,sizeof(FileInfo));
+ return aux;
+}
+
+static
+stkHandler addString(const char *str)
+{
+ const char *s=str;
+ int x;
+
+ for (x=0; *s; s++)
+ {
+ if (*s=='\t')
+ x|=7;
+ else if (*s=='\r')
+ x++;
+ x++;
+ }
+ x++;
+ stkHandler stk=Stack->alloc(x);
+ if (stk==stkNULL)
+ return stk;
+
+ char *d=Stack->GetStrOf(stk);
+ for (x=0,s=str; *s; s++)
+ {
+ if (*s=='\t')
+ {
+ do
+ {
+ *(d++)=' ';
+ x++;
+ }
+ while (x & 7);
+ }
+ else if (*s=='\r')
+ {
+ *(d++)='^';
+ *(d++)='M';
+ x++;
+ }
+ else
+ {
+ x++;
+ *(d++)=*s;
+ }
+ }
+ *d=0;
+
+ return stk;
+}
+
+void EdShowMessageUpdate(unsigned Options)
+{
+ TProgram::deskTop->lock();
+ MsgList->updateCommands(1);
+ if (!(Options & edsmNoHzReset))
+ ResetHz();
+ MsgWindow->show();
+ if ((Options & edsmDontSelect)==0)
+ MsgWindow->select();
+ MsgList->setRange(MsgCol->getCount());
+ // Scroll it
+ uint32 opsScr=Options & edsmScrollMask;
+ if (opsScr==edsmEverScroll ||
+ (opsScr==edsmScrollIfNoFocus && (MsgWindow->state & sfActive)==0))
+ {
+ avoidFocusAction++;
+ MsgList->focusItem(MsgCol->getCount()-1);
+ avoidFocusAction--;
+ }
+ MsgList->drawView();
+ //MsgWindow->drawView(); It doesn't work, the above does
+ TProgram::deskTop->unlock();
+}
+
+void EdShowMessageFile(const char *msg, FileInfo &fInfo, char *fileName,
+ unsigned Options)
+{
+ if (!MsgWindow || (Options & edsmRemoveOld))
+ EdMessageWindowInit();
+ if (!msg)
+ return;
+ stkHandler aux;
+ if (fileName)
+ {
+ aux=Stack->addStr(fileName);
+ if (aux==stkNULL)
+ return;
+ }
+ aux=InsertFileInfo(fInfo);
+ if (aux==stkNULL)
+ return;
+ aux=addString(msg);
+ if (aux==stkNULL)
+ return;
+ MsgCol->insert(aux);
+ if (fileName && fInfo.Line>=0)
+ {
+ SpLinesAdd(fileName,fInfo.Line,idsplError,
+ Options & edsmUpdateSpLines ? True : False);
+ MsgList->haveJumpLines++;
+ }
+
+ if (Options & edsmDontUpdate)
+ return;
+ EdShowMessageUpdate(Options);
+}
+
+
+void EdShowMessageS(const char *msg)
+{
+ FileInfo dummy;
+ dummy.Line=-1;
+ EdShowMessageFile(msg,dummy,0,edsmNoHzReset|edsmDontSelect);
+}
+
+void EdShowMessage(const char *msg, Boolean remove_old, Boolean resetHz)
+{
+ FileInfo dummy;
+ dummy.Line=-1;
+ EdShowMessageFile(msg,dummy,0,(remove_old ? edsmRemoveOld : 0) |
+ (resetHz ? edsmNoHzReset : 0));
+}
+
+void EdShowMessageI(const char *msg, Boolean remove_old, Boolean resetHz)
+{
+ char *aux=TVIntl::getTextNew(msg);
+ EdShowMessage(aux,remove_old,resetHz);
+ DeleteArray(aux);
+}
+
+void EdShowMessage(const char *msg, unsigned Options)
+{
+ FileInfo dummy;
+ dummy.Line=-1;
+ EdShowMessageFile(msg,dummy,0,Options);
+}
+
+void EdShowMessageI(const char *msg, unsigned Options)
+{
+ char *aux=TVIntl::getTextNew(msg);
+ EdShowMessage(aux,Options);
+ DeleteArray(aux);
+}
+
+void EdJumpToMessage(ccIndex item)
+{
+ if (!MsgWindow)
+ EdMessageWindowInit();
+ if (item<MsgCol->getCount())
+ {
+ avoidFocusAction=1;
+ ResetHz();
+ MsgList->focusItem(item);
+ avoidFocusAction=0;
+ }
+}
+
+void EdJumpToFirstError(void)
+{
+ if (!MsgWindow || !MsgList)
+ return;
+ MsgList->focusItem(0);
+ EdMessageSelectNext();
+}
+
+int EdMessageCantMessages(void)
+{
+ return MsgCol->getCount();
+}
+
+void EdMessageSelectNext(void)
+{
+ if (MsgList && MsgList->range)
+ MsgList->selectNext();
+}
+
+void EdMessageSelectPrev(void)
+{
+ if (MsgList && MsgList->range)
+ MsgList->selectPrev();
+}
+
+Boolean EdMessageGetSize(TRect &r)
+{
+ if (!MsgWindow)
+ return False;
+ TRect dkt=TApplication::deskTop->getExtent();
+ TRect size=MsgWindow->getBounds();
+ if (dkt==size)
+ r=MsgWindow->zoomRect;
+ else
+ r=size;
+ return True;
+}
+
diff --git a/setedit/setedit/edprefs.cc b/setedit/setedit/edprefs.cc
new file mode 100644
index 0000000..83dc118
--- /dev/null
+++ b/setedit/setedit/edprefs.cc
@@ -0,0 +1,1352 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_string
+
+#define Uses_snprintf
+#define Uses_MsgBox
+#define Uses_TDialog
+#define Uses_TRadioButtons
+#define Uses_TButton
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TRect
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TScreen
+#define Uses_TInputLine
+#define Uses_TSortedListBox
+#define Uses_TScrollBar
+#define Uses_TStringCollection
+#define Uses_TCheckBoxes
+#define Uses_TCEditor
+#define Uses_TDeskTopClock
+#define Uses_TApplication
+#define Uses_TCEditWindow
+#define Uses_TStaticText
+#define Uses_fpstream
+#define Uses_TSOSListBox
+#define Uses_TVCodePage
+#define Uses_TVFontCollection
+
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSLabelRadio
+#define Uses_TSLabelCheck
+#define Uses_TSRadioButtons
+#define Uses_TSInputLine
+#define Uses_TSVeGroup
+#define Uses_TSSortedListBox
+#define Uses_TSHzGroup
+#define Uses_TSCheckBoxes
+#define Uses_TSHzLabel
+#define Uses_TSStaticText
+#define Uses_TFileCollection
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#include <diaghelp.h>
+#include <stdlib.h>
+#define Uses_SETAppVarious
+#define Uses_SETAppDialogs
+#define Uses_TSetEditorApp
+#define Uses_SETAppConst
+#define Uses_SETAppFiles
+#include <setapp.h>
+#include <codepage.h>
+#include <advice.h>
+#include <edcollec.h>
+#include <edspecs.h>
+#define STANDALONE
+#define Uses_TSOSListBoxMsg
+#include <edmsg.h>
+
+// Forced width of the encodings and fonts list boxes
+const int wForced=24;
+
+/******************************* File Open Dialog options ****************************/
+typedef struct
+{
+ uint32 sortType;
+ uint32 caseType;
+ uint32 parentSort;
+ uint32 dotFiles;
+ uint32 exclude;
+} BoxFO;
+
+class TDiaFO : public TDialog
+{
+public:
+ TDiaFO();
+ virtual void handleEvent(TEvent& event);
+ void updateState(unsigned sType);
+
+ int parentSortEnabled;
+ TRadioButtons32 *sortType;
+ TView *parentSort;
+};
+
+TDiaFO::TDiaFO() :
+ TWindowInit(&TDiaFO::initFrame),
+ TDialog(TRect(1,1,1,1),__("Open File options"))
+{
+ parentSortEnabled=1;
+}
+
+void TDiaFO::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evBroadcast)
+ {
+ if (event.message.command==cmClusterPress || event.message.command==cmClusterMovedTo)
+ { // OK, a child changed now see if that's the sortType
+ if (event.message.infoPtr==sortType)
+ { // I know how to use &&, but I preffer it ;-)
+ uint32 sType;
+ sortType->getData(&sType);
+ updateState(sType);
+ }
+ }
+ }
+}
+
+void TDiaFO::updateState(unsigned sType)
+{
+ if (parentSortEnabled && sType==fcolAlphabetical)
+ {
+ parentSort->setState(sfDisabled,True);
+ parentSortEnabled=0;
+ }
+ else
+ if (!parentSortEnabled && sType!=fcolAlphabetical)
+ {
+ parentSort->setState(sfDisabled,False);
+ parentSortEnabled=1;
+ }
+}
+
+int SetFileOpenDialogOptions(void)
+{
+ TDiaFO *d=new TDiaFO();
+ TSViewCol *col=new TSViewCol(d);
+
+ BoxFO box;
+ //-------------- Transfer options
+ unsigned oldOptions=TFileCollection::sortOptions;
+ box.sortType=TFileCollection::sortOptions & fcolTypeMask;
+ box.caseType=(TFileCollection::sortOptions & fcolCaseInsensitive) >> fcolCaseBit;
+ box.parentSort=(TFileCollection::sortOptions & fcolParentLast) >> fcolParentBit;
+ box.dotFiles=(TFileCollection::sortOptions & fcolDotsLast) >> fcolDotsBit;
+ box.exclude=(TFileCollection::sortOptions & fcolHideMask) >> fcolHideBit;
+
+ // ACDEFGIKLNPRSW
+ TSLabel *Sort=TSLabelRadio(__("~S~ort type"),__("~A~lphabetical"),
+ __("~D~irectories first"),__("~F~iles first"),0);
+ d->sortType=(TRadioButtons32 *)Sort->linked->view;
+ TSLabel *Case=TSLabelRadio(__("Case style"),__("~C~apital letters go first"),
+ __("Case ~i~nsensitive"),0);
+ TSLabel *Parent=TSLabelRadio(__("Parent directory (..)"),__("First in the ~l~ist"),
+ __("At the ~e~nd of the list"),0);
+ d->parentSort=Parent->linked->view;
+ d->updateState(box.sortType);
+
+ // Note: MinGW have a really nasty namespace pollution, the grp1 and grp2
+ // names are defined as numeric constants in dlgs.h, which I don't request.
+ // I'm sick of these faults, MinGW is really bad.
+ TSVeGroup *Grp1=MakeVeGroup(1,Sort,Case,Parent,0);
+ Grp1->makeSameW();
+
+ TSLabel *DotFiles=TSLabelRadio(__("Files starting with a dot"),__("~N~ormally sorted"),
+ __("After the ~r~est"),0);
+ TSLabel *Exclude=TSLabelCheck(__("Exclude files"),__("Ending ~w~ith tilde"),
+ __("Ending with .bk~p~"),__("Startin~g~ with ."),0);
+
+ TSVeGroup *Grp2=MakeVeGroup(1,DotFiles,Exclude,0);
+ Grp2->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,Grp1);
+ col->insert(xTSRightOf,yTSUp,Grp2,Grp1);
+ EasyInsertOKCancel(col);
+
+ col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeFileOpenOptions;
+
+ if (execDialog(d,&box)==cmOK)
+ {
+ //-------------- Transfer options
+ TFileCollection::sortOptions=box.sortType | (box.caseType << fcolCaseBit) |
+ (box.parentSort << fcolParentBit) | (box.dotFiles << fcolDotsBit) |
+ (box.exclude << fcolHideBit);
+ if (oldOptions!=TFileCollection::sortOptions)
+ { // Some things aren't really intuitive so give some comments:
+ if (box.sortType==fcolAlphabetical)
+ {
+ if (box.caseType==fcolCaseSensitive)
+ GiveAdvice(gadvFOShiftCase);
+ }
+ else
+ {
+ if (box.caseType==fcolCaseSensitive)
+ GiveAdvice(gadvFOShFuzzy);
+ else
+ GiveAdvice(gadvFOShiftDirs);
+ }
+ }
+ return 1;
+ }
+ return 0;
+}
+
+const int cmTestScrv=0x2220,cmInfoScrv=0x2221,cmHelpScrv=0x2222;
+
+class TDiaScrSaver : public TDialog
+{
+public:
+ TDiaScrSaver(void);
+ virtual void handleEvent(TEvent& event);
+ void UpdateCommands(char *s);
+ TCollection *savers;
+ TSortedListBox *list;
+ TView *xtOpt;
+ int commandsOn;
+};
+
+TDiaScrSaver::TDiaScrSaver(void) :
+ TWindowInit(&TDiaScrSaver::initFrame),
+ TDialog(TRect(1,1,1,1),__("Screen saver"))
+{
+ commandsOn=1;
+}
+
+
+static
+void ShowText(char *Text, char *Title)
+{
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),Title));
+
+ char *s=Text;
+ for (; *s; s++)
+ if (*s=='\r')
+ *s=' ';
+ TSStaticText *text=new TSStaticText(Text,72);
+ col->insert(xTSCenter,1,text);
+ col->insert(xTSCenter,yTSUnder,new TSButton(__("O~K~"),cmOK,bfDefault,10),0,text);
+
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+
+ execDialog(d,0);
+ delete[] Text;
+}
+
+void TDiaScrSaver::UpdateCommands(char *s)
+{
+ int type;
+ WichSaverIs(s,type);
+ if (type==scsvInternal)
+ {
+ if (commandsOn)
+ {
+ disableCommand(cmInfoScrv);
+ disableCommand(cmHelpScrv);
+ xtOpt->setState(sfDisabled,True);
+ commandsOn=0;
+ }
+ }
+ else
+ {
+ if (!commandsOn)
+ {
+ enableCommand(cmInfoScrv);
+ enableCommand(cmHelpScrv);
+ xtOpt->setState(sfDisabled,False);
+ commandsOn=1;
+ }
+ }
+}
+
+void TDiaScrSaver::handleEvent(TEvent& event)
+{
+ char *s,*s2,oldSaverState;
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmTestScrv:
+ // Keep current state
+ s=TSetEditorApp::WhichScrSaver;
+ oldSaverState=TSetEditorApp::UseScreenSaver;
+ // Set it for testing
+ TSetEditorApp::UseScreenSaver=1;
+ TSetEditorApp::WhichScrSaver=strdup((char *)(savers->at(list->focused)));
+ s2=strdup(TSetEditorApp::ExtScrSaverOpts);
+ xtOpt->getData(TSetEditorApp::ExtScrSaverOpts);
+ // Try it
+ editorApp->screenSaver();
+ // Restore all
+ strcpy(TSetEditorApp::ExtScrSaverOpts,s2);
+ free(s2);
+ delete TSetEditorApp::WhichScrSaver;
+ TSetEditorApp::WhichScrSaver=s;
+ TSetEditorApp::UseScreenSaver=oldSaverState;
+ break;
+
+ case cmInfoScrv:
+ s=GetScrSaverInfo((char *)(savers->at(list->focused)));
+ if (s)
+ ShowText(s,__("Information"));
+ break;
+
+ case cmHelpScrv:
+ s=GetScrSaverHelp((char *)(savers->at(list->focused)));
+ if (s)
+ ShowText(s,__("Help for screen saver"));
+ break;
+
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+ else
+ if (event.what==evBroadcast && event.message.command==cmListItemFocused)
+ { // The TListBox changed
+ UpdateCommands((char *)(savers->at(list->focused)));
+ clearEvent(event);
+ }
+}
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 scr_on CLY_Packed;
+ TCollection *savers CLY_Packed;
+ ccIndex scr_sel CLY_Packed;
+ char xtOp[extscrsParMxLen];// CLY_Packed;
+ char time[5];// CLY_Packed;
+ char timeM[5];// CLY_Packed;
+} BoxSavers;
+#pragma pack()
+
+void SetScreenSaversOptions(void)
+{
+ if (!TScreen::useScreenSaver())
+ {
+ messageBox(__("The screen saver can't be used on this terminal"),mfInformation | mfOKButton);
+ return;
+ }
+
+ // EFHIMNOPRTX
+ TDiaScrSaver *diaPrefs=new TDiaScrSaver();
+ TSViewCol *col=new TSViewCol(diaPrefs);
+
+ TSSortedListBox *scrv=new TSSortedListBox(24,5,tsslbVertical);
+ diaPrefs->list=(TSortedListBox *)scrv->view;
+ TSInputLine *extOptIn=new TSInputLine(extscrsParMxLen,24);
+ diaPrefs->xtOpt=extOptIn->view;
+ TSLabel *extOpts=new TSLabel(__("E~x~ternal options"),extOptIn);
+ TSVeGroup *Scrv=new TSVeGroup(
+ MakeVeGroup(0,TSLabelRadio(__("Sc~r~een saver (?)"),__("OF~F~"),__("O~N~"),0),
+ scrv,extOpts,0), // First 3 joined
+ MakeHzGroup(new TSButton(__("T~e~st"),cmTestScrv),
+ new TSButton(__("~I~nfo"),cmInfoScrv),
+ new TSButton(__("~H~elp"),cmHelpScrv),0)); // Buttons separated
+ Scrv->makeSameW();
+
+ TSHzLabel *timeL=new TSHzLabel(__("~T~ime"),new TSInputLine(5));
+ TSStaticText *seconds=new TSStaticText(__("seconds"));
+ TSHzGroup *Time=new TSHzGroup(timeL,seconds);
+ Scrv=new TSVeGroup(Scrv,Time,0);
+
+ TSHzGroup *TimeM=new TSHzGroup(new TSHzLabel(__("Ti~m~e"),new TSInputLine(5)),
+ new TSStaticText(__("mouse sec.")));
+ TSVeGroup *ScreenSaver=new TSVeGroup(Scrv,TimeM,0);
+
+ col->insert(2,1,ScreenSaver);
+ EasyInsertOKCancel(col,4);
+
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeEdGralOptions;
+
+ BoxSavers box;
+ memset(&box,0,sizeof(BoxSavers));
+
+ box.scr_on=TSetEditorApp::UseScreenSaver;
+
+ char buf[32];
+ sprintf(buf,"%d",TSetEditorApp::screenSaverTime);
+ strncpy(box.time,buf,4);
+ sprintf(buf,"%d",TSetEditorApp::screenSaverTimeMouse);
+ strncpy(box.timeM,buf,4);
+ strcpy(box.xtOp,TSetEditorApp::ExtScrSaverOpts);
+
+ diaPrefs->savers=box.savers=GetScreenSaverList();
+ ccIndex w;
+ if (TSetEditorApp::WhichScrSaver &&
+ ((TStringCollection *)box.savers)->search(TSetEditorApp::WhichScrSaver,w))
+ box.scr_sel=w;
+ else
+ box.scr_sel=0;
+ diaPrefs->UpdateCommands(TSetEditorApp::WhichScrSaver);
+
+ if (execDialog(d,&box)==cmOK)
+ {
+ TSetEditorApp::UseScreenSaver=box.scr_on;
+ delete TSetEditorApp::WhichScrSaver;
+ TSetEditorApp::WhichScrSaver=strdup((char *)(box.savers->at(box.scr_sel)));
+ TSetEditorApp::screenSaverTime=atoi(box.time);
+ TSetEditorApp::screenSaverTimeMouse=atoi(box.timeM);
+ strcpy(TSetEditorApp::ExtScrSaverOpts,box.xtOp);
+ }
+}
+
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 ops CLY_Packed;
+ uint32 clk_on CLY_Packed;
+ uint32 clk_mode CLY_Packed;
+ char editors[5];// CLY_Packed;
+ char closed[5];// CLY_Packed;
+} BoxGral;
+#pragma pack()
+
+static
+unsigned SetGeneralEditorOptionsMain(void)
+{
+ // ABCDEHIKLMOPRSTUVWY
+ TSViewCol *col=new TSViewCol(__("General editor options"));
+
+ TSLabel *tcb=TSLabelCheck(__("~S~ave/Desktop options"),
+ __("Make ~b~ackups"),
+ #define MAKE_BKPS 1
+ __("~U~NIX-style backups"),
+ #define UNIX_STYLE_BKPS 2
+ __("H~i~dden backups"),
+ #define HIDDEN_BKPS 4
+ __("R~e~member bkps to delete"),
+ #define REMM_BKPS 8
+ __("~D~on't create desktop files"),
+ #define DONT_CREATE_DST 16
+ __("Save desktop files ~h~idden"),
+ #define SAVE_HIDDEN_DST 32
+ __("Tile windows ~v~ertically first"),
+ #define TILE_VERT 64
+ #if defined(TVOS_DOS) || (defined(TVOS_Win32) && defined(TVCompf_Cygwin))
+ __("Save UNIX files ~a~s UNIX"),
+ #else
+ __("Save DOS files ~a~s DOS"),
+ #endif
+ #define SAVE_ASIS 128
+ __("Don't remember cursor ~p~osition"),
+ #define NO_CURSOR_POS 256
+ __("Don't ~w~arn about read-only files"),
+ #define NO_RO_WARNING 512
+ __("Open ~r~ead-only files as R.O. buffers"),
+ #define RO_AS_RO 1024
+ 0);
+
+ TSHzGroup *Clock=new TSHzGroup(TSLabelRadio(__("~C~lock"),__("OFF"),__("ON"),0),
+ TSLabelRadio(__("St~y~le"),__("AM/PM"),__("24 hs"),0));
+
+ TSHzLabel *MaxEds=new TSHzLabel(__("~M~ax. editor copies"),new TSInputLine(5));
+ TSHzLabel *MaxClo=new TSHzLabel(__("Max. c~l~osed to remember"),new TSInputLine(5));
+
+ TSVeGroup *FirstCol=MakeVeGroup(0,tcb,Clock,MaxEds,MaxClo,0);
+ FirstCol->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,FirstCol);
+ col->insert(xTSCenter,yTSDown,
+ MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("+ Desk~t~op"),cmYes),
+ new TSButton(__("+ Others"),cmNo),0));
+
+ TDialog *d=col->doItCenter(cmeEdGralOptions);
+ delete col;
+
+ BoxGral box;
+ memset(&box,0,sizeof(BoxGral));
+
+ //------ Arrange the "Save options" ----------
+ if (TCEditor::editorFlags & efBackupFiles)
+ box.ops|=MAKE_BKPS;
+ if (TCEditor::editorFlags & efSaveEOLasis)
+ box.ops|=SAVE_ASIS;
+ if (TCEditor::editorFlags & efUNIXBkpStyle)
+ box.ops|=UNIX_STYLE_BKPS;
+ if (TCEditor::editorFlags & efHiddenBkps)
+ box.ops|=HIDDEN_BKPS;
+ if (TCEditor::editorFlags & efDoNotWarnRO)
+ box.ops|=NO_RO_WARNING;
+ if (TCEditor::editorFlags & efROasRO)
+ box.ops|=RO_AS_RO;
+
+ // To avoid filling the disk with .dst files
+ unsigned DesktopFilesOptions=GetDSTOptions();
+ if (!(DesktopFilesOptions & dstCreate))
+ box.ops|=DONT_CREATE_DST;
+ // To be less annoying
+ if (DesktopFilesOptions & dstHide)
+ box.ops|=SAVE_HIDDEN_DST;
+ // If files are specified in the command line open only these files
+ if (DesktopFilesOptions & dstNoCursorPos)
+ box.ops|=NO_CURSOR_POS;
+ // Store the list of backups in the desktop file so an Alt+Q can delete it
+ if (DesktopFilesOptions & dstRemmeberFK)
+ box.ops|=REMM_BKPS;
+ // Better to compare files
+ unsigned dsktOps=TApplication::deskTop->getOptions();
+ if (dsktOps & dsktTileVertical)
+ box.ops|=TILE_VERT;
+ //------ End of the "Save options" ----------
+
+ box.clk_on=TSetEditorApp::ShowClock;
+ box.clk_mode=TDeskTopClock::mode;
+
+ char buf[32];
+ sprintf(buf,"%d",TSetEditorApp::maxOpenEditorsSame);
+ strncpy(box.editors,buf,4);
+ sprintf(buf,"%d",TEditorCollection::maxClosedToRemember);
+ strncpy(box.closed,buf,4);
+
+ unsigned command=execDialog(d,&box.ops);
+ if (command!=cmCancel)
+ {
+ //------ Decode the "Save options" ----------
+ #define O(a,b) if (box.ops & a) TCEditor::editorFlags|=b; else \
+ TCEditor::editorFlags&=~b
+ O(MAKE_BKPS, efBackupFiles);
+ O(UNIX_STYLE_BKPS, efUNIXBkpStyle);
+ O(HIDDEN_BKPS, efHiddenBkps);
+ O(NO_RO_WARNING, efDoNotWarnRO);
+ O(RO_AS_RO, efROasRO);
+ #undef O
+
+ // Filter options of this dialog
+ DesktopFilesOptions&=dstEdMask | dstOwMask | dstCfMask;
+ if (!(box.ops & DONT_CREATE_DST))
+ DesktopFilesOptions|=dstCreate;
+ if (box.ops & SAVE_HIDDEN_DST)
+ DesktopFilesOptions|=dstHide;
+ if (box.ops & NO_CURSOR_POS)
+ DesktopFilesOptions|=dstNoCursorPos;
+ if (box.ops & REMM_BKPS)
+ DesktopFilesOptions|=dstRemmeberFK;
+ if (box.ops & TILE_VERT)
+ TApplication::deskTop->setOptions(dsktOps | dsktTileVertical);
+ else
+ TApplication::deskTop->setOptions(dsktOps & (~dsktTileVertical));
+ EnvirSetIntVar("SET_CREATE_DST",DesktopFilesOptions);
+
+ if (box.ops & SAVE_ASIS)
+ TCEditor::editorFlags|=efSaveEOLasis;
+ else
+ TCEditor::editorFlags&=~efSaveEOLasis;
+ //------ End of the "Save options" ----------
+
+ TSetEditorApp::ShowClock=box.clk_on;
+ TDeskTopClock::mode=box.clk_mode;
+ TSetEditorApp::maxOpenEditorsSame=atoi(box.editors);
+ TEditorCollection::maxClosedToRemember=atoi(box.closed);
+ if (TEditorCollection::maxClosedToRemember<0)
+ TEditorCollection::maxClosedToRemember=0;
+ if (TEditorCollection::maxClosedToRemember>200)
+ TEditorCollection::maxClosedToRemember=200;
+ /* Avoid dangerous values */
+ if (TSetEditorApp::maxOpenEditorsSame<1)
+ TSetEditorApp::maxOpenEditorsSame=1;
+ }
+ return command;
+}
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 editors CLY_Packed;
+ uint32 otherWindows CLY_Packed;
+ uint32 closed CLY_Packed;
+} BoxMoreDst;
+#pragma pack()
+
+static
+uint32 DecodeMask(unsigned val, unsigned op1, unsigned op2, unsigned mask)
+{
+ val&=mask;
+ if (!val) return 0;
+ if (val==op1) return 1;
+ if (val==op2) return 2;
+ return 3;
+}
+
+static
+unsigned EncodeMask(uint32 val, unsigned op1, unsigned op2)
+{
+ if (val==1) return op1;
+ if (val==2) return op2;
+ return 0;
+}
+
+static
+unsigned SetGeneralEditorOptionsMoreDst(void)
+{
+ // CEKLMNORVY
+ TSViewCol *col=new TSViewCol(__("More desktop options"));
+
+ TSLabel *editors=TSLabelRadio(__("Remember editor windows"),
+ __("~A~lways"),__("~O~nly if no file specified"),__("~N~ever"),0);
+ TSLabel *others=TSLabelRadio(__("Remember other windows"),
+ __("Al~w~ays"),__("On~l~y if no file specified"),__("Neve~r~"),0);
+ TSLabel *closed=TSLabelRadio(__("Remember ~c~losed windows"),
+ __("Alway~s~"),__("Onl~y~ if no file specified"),__("Ne~v~er"),0);
+
+ col->insert(xTSLeft,yTSUp,MakeVeGroup(0,editors,others,closed,0));
+ col->insert(xTSCenter,yTSDown,
+ MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("~M~ain options"),cmYes),0));
+
+ TDialog *d=col->doItCenter(cmeEdGralOptions);
+ delete col;
+
+ BoxMoreDst box;
+ unsigned DstOption=GetDSTOptions();
+ box.editors=DecodeMask(DstOption,dstEdOnlyIfNoCL,dstEdNever,dstEdMask);
+ box.otherWindows=DecodeMask(DstOption,dstOwOnlyIfNoCL,dstOwNever,dstOwMask);
+ box.closed=DecodeMask(DstOption,dstCfOnlyIfNoCL,dstCfNever,dstCfMask);
+
+ unsigned command=execDialog(d,&box);
+ if (command!=cmCancel)
+ {
+ // Filter options of this dialog
+ DstOption&=~(dstEdMask | dstOwMask | dstCfMask);
+ DstOption|=EncodeMask(box.editors,dstEdOnlyIfNoCL,dstEdNever);
+ DstOption|=EncodeMask(box.otherWindows,dstOwOnlyIfNoCL,dstOwNever);
+ DstOption|=EncodeMask(box.closed,dstCfOnlyIfNoCL,dstCfNever);
+ EnvirSetIntVar("SET_CREATE_DST",DstOption);
+ }
+ return command;
+}
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 end CLY_Packed;
+ uint32 beep CLY_Packed;
+ uint32 opts CLY_Packed;
+ uint32 opsAv CLY_Packed;
+ char width[5];// CLY_Packed;
+ uint32 opsZoom CLY_Packed;
+} BoxOthers;
+#pragma pack()
+
+static
+unsigned SetGeneralEditorOptionsOthers(void)
+{
+ TSViewCol *col=new TSViewCol(__("Other options"));
+
+ // ENG: ACIJKLMNPRUVW
+ // ESP: ADEIKMNPRSUVY
+ TSVeGroup *MsgWin=MakeVeGroup(0,
+ TSLabelRadio(__("At the end of error list in message window"),
+ __("~J~ust stop"),
+ __("~I~ndicate with a message"),
+ __("Wrap (~c~ircular list)"),0),
+ new TSCheckBoxes(new TSItem(__("Make a beep"),0)),
+ TSLabelCheck(__("When creating message and similar windows"),
+ __("Use the ~v~ertical direction"),
+ __("Use the ~r~ight side"),0),
+ TSLabelRadio(__("When opening files"),
+ __("~U~se reserved width or 7 (hz dir)"),
+ __("~A~void message and project windows"),0),
+ new TSHzLabel(__("Reserved ~w~idth"),new TSInputLine(5)),
+ TSLabelRadio(__("Zoom windows when"),
+ __("No ~p~roject window"),
+ __("No prj. wi~n~dow or it's zoomed"),
+ __("A~l~ways"),0),
+ 0);
+ MsgWin->makeSameW();
+
+ col->insert(xTSLeft,yTSUp,MsgWin);
+ col->insert(xTSCenter,yTSDown,
+ MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("~M~ain options"),cmYes),0));
+
+ TDialog *d=col->doItCenter(cmeEdGralOptions);
+ delete col;
+
+ BoxOthers box;
+ box.end=TSOSListBoxMsg::opsEnd;
+ box.beep=TSOSListBoxMsg::opsBeep;
+ box.opts=TSetEditorApp::geFlags & geMask1;
+ box.opsAv=TSetEditorApp::geFlags & geAvoidPrjAndMsg ? 1 : 0;
+ char buf[32];
+ sprintf(buf,"%d",TSetEditorApp::widthVertWindows);
+ strncpy(box.width,buf,4);
+ box.opsZoom=(TSetEditorApp::geFlags & geMask2)>>geShift2;
+
+ unsigned command=execDialog(d,&box);
+ if (command!=cmCancel)
+ {
+ TSOSListBoxMsg::opsEnd=box.end;
+ TSOSListBoxMsg::opsBeep=box.beep;
+ TSetEditorApp::geFlags=box.opts;
+ if (box.opsAv)
+ TSetEditorApp::geFlags|=geAvoidPrjAndMsg;
+ if (box.opsZoom)
+ TSetEditorApp::geFlags|=(box.opsZoom<<geShift2) & geMask2;
+ TSetEditorApp::widthVertWindows=atoi(box.width);
+ if (TSetEditorApp::widthVertWindows<6)
+ TSetEditorApp::widthVertWindows=6;
+ int mWidth=TDisplay::getCols()-12;
+ if (TSetEditorApp::widthVertWindows>mWidth)
+ TSetEditorApp::widthVertWindows=mWidth;
+ }
+ return command;
+}
+
+void SetGeneralEditorOptions(void)
+{
+ int dialog=0;
+ unsigned command=0;
+ do
+ {
+ switch (dialog)
+ {
+ case 0:
+ command=SetGeneralEditorOptionsMain();
+ if (command==cmYes)
+ dialog=1;
+ else if (command==cmNo)
+ dialog=2;
+ break;
+ case 1:
+ command=SetGeneralEditorOptionsMoreDst();
+ if (command==cmYes)
+ dialog=0;
+ break;
+ case 2:
+ command=SetGeneralEditorOptionsOthers();
+ if (command==cmYes)
+ dialog=0;
+ break;
+ }
+ }
+ while (command==cmYes || command==cmNo);
+}
+
+/************************** Code page convert dialogs **************************/
+static int fromCP=-1, toCP=-1;
+static uint32 CPNoLow=0;
+const uchar Version=1;
+
+void SaveConvCPOptions(fpstream& s)
+{
+ s << Version << fromCP << toCP << (ushort)CPNoLow;
+}
+
+void LoadConvCPOptions(fpstream& s)
+{
+ uchar version;
+ ushort aux;
+ s >> version >> fromCP >> toCP >> aux;
+ CPNoLow=aux;
+}
+
+
+#pragma pack(1)
+typedef struct
+{
+ TCollection *lFrom CLY_Packed;
+ ccIndex sFrom CLY_Packed;
+ TCollection *lTo CLY_Packed;
+ ccIndex sTo CLY_Packed;
+ uint32 ops CLY_Packed;
+} FromToBox;
+#pragma pack()
+
+int TSetEditorApp::ChooseConvCPs(int &From, int &To, uint32 &ops)
+{
+ // Look for some default
+ int idDefScr, idDefApp, idDefInp;
+ TVCodePage::GetDefaultCodePages(idDefScr,idDefApp,idDefInp);
+ if (so && so->enForceApp)
+ idDefApp=so->enApp;
+ if (so && so->enForceScr)
+ idDefScr=so->enScr;
+
+ FromToBox box;
+ box.lFrom=box.lTo=TVCodePage::GetList();
+ box.sFrom=TVCodePage::IDToIndex(fromCP<0 ? idDefApp : fromCP);
+ box.sTo =TVCodePage::IDToIndex(toCP<0 ? idDefScr : toCP);
+ box.ops =CPNoLow;
+
+ TSHzGroup *cps=new TSHzGroup(
+ new TSLabel(__("~F~rom code page"),
+ new TSSortedListBox(wForced,6,tsslbVertical)),
+ new TSLabel(__("~T~o code page"),
+ new TSSortedListBox(wForced,6,tsslbVertical)));
+ TSVeGroup *all=new TSVeGroup(cps,
+ new TSCheckBoxes(
+ new TSItem(__("~D~on't remap codes below 32"),
+ new TSItem(__("~O~nly selected text"),0))));
+ all->makeSameW();
+
+ TSViewCol *col=new TSViewCol(__("Code page remap"));
+ col->insert(2,1,all);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeRemapCodePage;
+
+ int ret=execDialog(d,&box)==cmOK;
+ fromCP=From=TVCodePage::IndexToID(box.sFrom);
+ toCP=To=TVCodePage::IndexToID(box.sTo);
+ ops=CPNoLow=box.ops;
+
+ return ret;
+}
+
+char *TSetEditorApp::CreateTitle(const char *title)
+{
+ const char *t=TVIntl::getTextNew(title);
+ const char *d=TScreen::getDriverShortName();
+ char *res=new char[strlen(t)+3+strlen(d)+1];
+ strcpy(res,t);
+ strcat(res," - ");
+ strcat(res,d);
+ DeleteArray(t);
+ return res;
+}
+
+stScreenOptions *TSetEditorApp::so=NULL;
+
+/************************** Code pages dialogs **************************/
+#pragma pack(1)
+typedef struct
+{
+ uint32 appForce CLY_Packed;
+ TCollection *appList CLY_Packed;
+ ccIndex appCP CLY_Packed;
+ uint32 inpForce CLY_Packed;
+ TCollection *inpList CLY_Packed;
+ ccIndex inpCP CLY_Packed;
+ uint32 scrForce CLY_Packed;
+ TCollection *scrList CLY_Packed;
+ ccIndex scrCP CLY_Packed;
+ uint32 sndForce CLY_Packed;
+ TCollection *sndList CLY_Packed;
+ ccIndex sndCP CLY_Packed;
+} EncodingBox;
+#pragma pack()
+
+// New code pages dialogs
+void TSetEditorApp::EncodingOptions()
+{
+ if (!so) return; // Sanity check
+ // Compute the height of the list boxes to use most of the desktop
+ TRect dkt=TProgram::deskTop->getExtent();
+ int height=dkt.b.y-dkt.a.y-10;
+ if (TScreen::codePageVariable())
+ height=(height-2)/2;
+
+ TSVeGroup *appEncode=NULL,*scrEncode=NULL,*sndEncode=NULL,*inpEncode=NULL;
+
+ appEncode=new TSVeGroup(
+ TSLabelCheck(__("~A~pplication"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ appEncode->makeSameW();
+
+ inpEncode=new TSVeGroup(
+ TSLabelCheck(__("~I~nput"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ inpEncode->makeSameW();
+
+ TSView *upperCPs=MakeHzGroup(appEncode,inpEncode,0);
+ TSView *lowerCPs=NULL;
+
+ if (TScreen::codePageVariable())
+ {// Only if the code page is variable
+ scrEncode=new TSVeGroup(
+ TSLabelCheck(__("~S~creen"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ scrEncode->makeSameW();
+
+ if (TScreen::canSetSBFont())
+ {// Only if the secondary font exists
+ sndEncode=new TSVeGroup(
+ TSLabelCheck(__("Second ~f~ont"),__("Force encoding"),0),
+ new TSSortedListBox(wForced,height,tsslbVertical),
+ 0);
+ sndEncode->makeSameW();
+ lowerCPs=MakeHzGroup(scrEncode,sndEncode,0);
+ }
+ else
+ lowerCPs=scrEncode;
+ }
+
+
+ char *title=CreateTitle(__("Encodings"));
+ TSViewCol *col=new TSViewCol(title);
+ DeleteArray(title);
+ col->insert(xTSLeft,yTSUp,upperCPs);
+ if (lowerCPs)
+ col->insert(xTSCenter,yTSUnder,lowerCPs,0,upperCPs);
+ col->insert(xTSCenter,yTSDown,
+ MakeHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("Cancel"),cmCancel),
+ new TSButton(__("Set ~D~efaults"),cmYes),0));
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeEncodings;
+ EncodingBox box;
+
+ // Current TV settings
+ int idDefScr, idDefApp, idDefInp;
+ TVCodePage::GetDefaultCodePages(idDefScr,idDefApp,idDefInp);
+
+ //fprintf(stderr,"SO: App %d Inp %d Scr %d\n",so->enApp,so->enInp,so->enScr);
+ //fprintf(stderr,"DrvDef: App %d Inp %d Scr %d\n",idDefApp,idDefInp,idDefScr);
+
+ // Currently selected values
+ // Note: Here if the user isn't forcing the code page what we show is what the
+ // driver is currently using. The other option is to show what was selected last
+ // time it was forced but in this way:
+ // 1) The user doesn't know what's using currently, maybe s/he doesn't really want
+ // to force it.
+ // 2) The first code to handle v0.5.0 left it in 0 which is invalid.
+ int appCP, scrCP, sndCP, inpCP;
+ appCP=TVCodePage::IDToIndex(so->enForceApp && so->enApp!=-1 ? so->enApp : idDefApp);
+ inpCP=TVCodePage::IDToIndex(so->enForceInp && so->enInp!=-1 ? so->enInp : idDefInp);
+ scrCP=TVCodePage::IDToIndex(so->enForceScr && so->enScr!=-1 ? so->enScr : idDefScr);
+ sndCP=so->enSnd!=-1 ? TVCodePage::IDToIndex(so->enSnd) : scrCP;
+
+ // Data box
+ box.appForce=so->enForceApp;
+ box.inpForce=so->enForceInp;
+ box.scrForce=so->enForceScr;
+ box.sndForce=so->enForceSnd;
+ box.appCP=appCP;
+ box.inpCP=inpCP;
+ box.scrCP=scrCP;
+ box.sndCP=sndCP;
+ box.appList=box.inpList=box.scrList=box.sndList=TVCodePage::GetList();
+
+ unsigned ret=execDialog(d,&box);
+ if (ret==cmYes)
+ {// Set defaults
+ int priChanged=so->enForceScr || (so->enForceScr && idDefScr!=scrCP);
+ int sndChanged=so->enForceSnd || (so->enForceSnd && idDefScr!=sndCP);
+ so->enForceApp=so->enForceInp=so->enForceScr=so->enForceSnd=0;
+ so->enApp=idDefApp;
+ so->enInp=idDefInp;
+ so->enScr=so->enSnd=idDefScr;
+ TVCodePage::SetCodePage(so->enApp,so->enScr,so->enInp);
+ SetEditorFontsEncoding(priChanged,idDefScr,sndChanged,idDefScr);
+ // This is a full redraw, not just a refresh from the buffers
+ TProgram::application->Redraw();
+ }
+ else if (ret==cmOK)
+ {
+ int appChanged=box.appForce!=(uint32)so->enForceApp || (so->enForceApp && box.appCP!=appCP);
+ int inpChanged=box.inpForce!=(uint32)so->enForceInp || (so->enForceInp && box.inpCP!=inpCP);
+ int priChanged=box.scrForce!=(uint32)so->enForceScr || (so->enForceScr && box.scrCP!=scrCP);
+ int sndChanged=box.sndForce!=(uint32)so->enForceSnd || (so->enForceSnd && box.sndCP!=sndCP);
+ if (appChanged || inpChanged || priChanged || sndChanged)
+ {// At least one changed
+ so->enForceApp=box.appForce;
+ so->enForceInp=box.inpForce;
+ so->enForceScr=box.scrForce;
+ so->enForceSnd=box.sndForce;
+ // Transfer the settings or just revert to defaults
+ so->enApp=so->enForceApp ? TVCodePage::IndexToID(box.appCP) : idDefApp;
+ so->enInp=so->enForceInp ? TVCodePage::IndexToID(box.inpCP) : idDefInp;
+ so->enScr=so->enForceScr ? TVCodePage::IndexToID(box.scrCP) : idDefScr;
+ so->enSnd=so->enForceSnd ? TVCodePage::IndexToID(box.sndCP) : so->enScr;
+ TVCodePage::SetCodePage(so->enApp,so->enScr,so->enInp);
+ SetEditorFontsEncoding(priChanged,so->enForceScr ? so->enScr : idDefScr,
+ sndChanged,so->enForceSnd ? so->enSnd : idDefScr);
+ // This is a full redraw, not just a refresh from the buffers
+ TProgram::application->Redraw();
+ }
+ }
+}
+
+/***************************** Fonts dialogs ****************************/
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 priUse CLY_Packed;
+ TCollection *priList CLY_Packed;
+ ccIndex priFont CLY_Packed;
+ TCollection *priSizes CLY_Packed;
+ ccIndex priSize CLY_Packed;
+ uint32 secUse CLY_Packed;
+ TCollection *secList CLY_Packed;
+ ccIndex secFont CLY_Packed;
+} FontsBox;
+#pragma pack()
+
+// An easydiag wrapper for TVBitmapFontDescLBox
+ListBoxSpecialize(TSVBitmapFontDescLBox);
+ListBoxImplement(VBitmapFontDescLBox);
+// An easydiag wrapper for TVBitmapFontSizeLBox
+ListBoxSpecialize(TSVBitmapFontSizeLBox);
+ListBoxImplement(VBitmapFontSizeLBox);
+
+// A TDialog class to connect the primary font with the available sizes
+class TDiaFont : public TDialog
+{
+public:
+ TDiaFont(const char *aTitle);
+ virtual void handleEvent(TEvent& event);
+
+ TVBitmapFontDescLBox *pri;
+ TSortedListBox *sizes;
+ TVBitmapFontDescCol *fonts;
+ int selected;
+};
+
+TDiaFont::TDiaFont(const char *aTitle) :
+ TWindowInit(&TDiaFont::initFrame),
+ TDialog(TRect(1,1,1,1),aTitle)
+{
+ options|=ofCentered;
+ helpCtx=cmeFonts;
+}
+
+void TDiaFont::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evBroadcast)
+ {
+ if (event.message.command==cmListItemFocused &&
+ event.message.infoPtr==pri &&
+ pri->focused!=selected)
+ {
+ selected=pri->focused;
+ TVBitmapFontDesc *p=(TVBitmapFontDesc *)fonts->at(selected);
+
+ // Check if the sizes box is already initialized.
+ if (!sizes->list())
+ return;
+ TListBoxRec box;
+ if (!p->sizes->search((void *)sizes->list()->at(sizes->focused),box.selection))
+ {
+ unsigned w,h;
+ if (TScreen::getFontGeometry(w,h))
+ {
+ TVBitmapFontSize sz={w,h};
+ if (!p->sizes->search((void *)&sz,box.selection))
+ box.selection=0;
+ }
+ else
+ box.selection=0;
+ }
+ box.items=p->sizes;
+ sizes->setData(&box,False);
+ }
+ }
+}
+
+void TSetEditorApp::FontsOptions()
+{
+ if (!so) return; // Sanity check
+ if (!TScreen::canSetBFont())
+ {
+ messageBox(__("This terminal doesn't support changing fonts"),mfInformation | mfOKButton);
+ return;
+ }
+ unsigned wmin,wmax,hmin,hmax;
+ if (!TScreen::getFontGeometry(wmin,hmin))
+ {
+ messageBox(__("Can't determine fonts geometry"),mfError | mfOKButton);
+ return;
+ }
+ if (!TScreen::getFontGeometryRange(wmin,hmin,wmax,hmax))
+ {
+ wmax=wmin;
+ hmax=hmin;
+ }
+ TVBitmapFontDescCol *fonts=
+ TVFontCollection::CreateListOfFonts(GetVariable("SET_FILES"),wmin,wmax,
+ hmin,hmax);
+ if (!fonts)
+ {
+ messageBox(__("No fonts available for current video mode"),mfInformation | mfOKButton);
+ return;
+ }
+ // Ok, we have fonts and we can use them
+ // Fill the data box
+ FontsBox box;
+ box.priUse=so->foPriLoad;
+ box.secUse=so->foSecLoad;
+ box.priList=box.secList=fonts;
+ // That's a gcc 3.4 requirement:
+ ccIndex aux;
+ if (!so->foPriName || !fonts->search(so->foPriName,aux))
+ aux=0;
+ box.priFont=aux;
+ if (!so->foSecName || !fonts->search(so->foSecName,aux))
+ aux=0;
+ box.secFont=aux;
+
+ TVBitmapFontDesc *pri=(TVBitmapFontDesc *)fonts->at(box.priFont),*sec;
+ box.priSizes=pri->sizes;
+ int filled=0;
+ TVBitmapFontSize sizeSt;
+ sizeSt.w=so->foPriW; sizeSt.h=so->foPriH;
+ if (!so->foPriName || !pri->sizes->search(&sizeSt,aux))
+ {
+ unsigned w,h;
+ if (TScreen::getFontGeometry(w,h))
+ {
+ sizeSt.w=w; sizeSt.h=h;
+ if (pri->sizes->search(&sizeSt,aux))
+ filled=1;
+ }
+ if (!filled)
+ aux=0;
+ }
+ box.priSize=aux;
+
+ // Create the dialog
+ TRect dkt=TProgram::deskTop->getExtent();
+ int height=dkt.b.y-dkt.a.y-10;
+
+ int retry;
+ do
+ {
+ // Primary font label, check box and list
+ TSLabel *priLBl=TSLabelCheck(__("~P~rimary"),__("~L~oad font"),0);
+ TSVBitmapFontDescLBox *priLB=new TSVBitmapFontDescLBox(wForced,height-1,tsslbVertical);
+ TSVeGroup *priOps=new TSVeGroup(priLBl,priLB,0);
+ priOps->makeSameW();
+
+ // Size
+ TSVBitmapFontSizeLBox *priSz=new TSVBitmapFontSizeLBox(12,height,tsslbVertical);
+ TSLabel *priSzl=new TSLabel(__("S~i~ze"),priSz);
+
+ // Secondary font options, only if available
+ TSVeGroup *secOps=NULL;
+ if (TScreen::canSetSBFont())
+ {
+ secOps=new TSVeGroup(TSLabelCheck(__("~S~econdary"),__("Lo~a~d font"),0),
+ new TSVBitmapFontDescLBox(wForced,height-1,tsslbVertical),0);
+ secOps->makeSameW();
+ }
+
+ retry=0;
+ char *title=CreateTitle(__("Fonts"));
+ TDiaFont *d=new TDiaFont(title);
+ DeleteArray(title);
+ // Setup the members used to do the connection
+ d->pri=(TVBitmapFontDescLBox *)priLB->view;
+ d->sizes=(TSortedListBox *)priSz->view;
+ d->selected=box.priSize;
+ d->fonts=fonts;
+ // Now create the EasyDiag collection
+ TSViewCol *col=new TSViewCol(d);
+ col->insert(xTSLeft,yTSUp,MakeHzGroup(priOps,priSzl,secOps,0));
+ EasyInsertOKCancel(col);
+ col->doIt();
+ delete col;
+
+ if (execDialog(d,&box)==cmOK)
+ {
+ pri=(TVBitmapFontDesc *)fonts->at(box.priFont);
+ sec=(TVBitmapFontDesc *)fonts->at(box.secFont);
+ TVBitmapFontSize *fontSize=(TVBitmapFontSize *)pri->sizes->at(box.priSize);
+ // We know the requested size for the primary font will work, but we don't
+ // know if the secondary font supports it.
+ if (box.secUse)
+ {
+ TVBitmapFontSize *s;
+ if (box.priUse)
+ s=fontSize;
+ else
+ {
+ unsigned w=8,h=16;
+ TScreen::getFontGeometry(w,h);
+ sizeSt.w=w; sizeSt.h=h;
+ s=&sizeSt;
+ }
+ ccIndex pos;
+ if (!sec->sizes->search((void *)s,pos))
+ {
+ retry=1;
+ messageBox(mfError | mfOKButton,__("The selected secondary font doesn't support the primary size (%dx%d)"),s->w,s->h);
+ }
+ }
+ if (!retry)
+ SetEditorFonts(box.priUse,newStr(pri->name),newStr(pri->file),fontSize,
+ box.secUse,newStr(sec->name),newStr(sec->file));
+ }
+ }
+ while (retry);
+}
+
+/***************************** Screen dialogs ****************************/
+
+#pragma pack(1)
+typedef struct
+{
+ uint32 options CLY_Packed;
+ char sizeW[5];// CLY_Packed;
+ char sizeH[5];// CLY_Packed;
+ char sizeCW[5];// CLY_Packed;
+ char sizeCH[5];// CLY_Packed;
+ char command[80];// CLY_Packed;
+ char mode[10];// CLY_Packed;
+} ScreenSizeBox;
+#pragma pack()
+
+static
+void ToStr(int val, char *dest)
+{
+ char buf[32];
+ sprintf(buf,"%d",val);
+ strncpy(dest,buf,4);
+}
+
+void TSetEditorApp::ScreenOptions()
+{
+ if (!so) return; // Sanity check
+ if (!TScreen::canSetVideoSize())
+ {
+ messageBox(__("This terminal has a fixed size"),mfInformation | mfOKButton);
+ return;
+ }
+
+ ScreenSizeBox box;
+ box.options=so->scOptions;
+ ToStr(so->scWidth,box.sizeW);
+ ToStr(so->scHeight,box.sizeH);
+ ToStr(so->scCharWidth,box.sizeCW);
+ ToStr(so->scCharHeight,box.sizeCH);
+ sprintf(box.mode,"0x%03X",so->scModeNumber);
+ if (so->scCommand)
+ strcpy(box.command,so->scCommand);
+ else
+ box.command[0]=0;
+
+ int retry;
+ do
+ {
+ retry=0;
+ // CDEGHIMNSWX
+ TSLabel *options=TSLabelRadio(__("Screen size options"),
+ __("~D~on't force"),
+ __("~S~ame as last run"),
+ __("~E~xternal program"),
+ __("~C~losest to specified size"),
+ __("Specified ~m~ode number"),0);
+
+ TSHzGroup *sizes=MakeHzGroup(
+ new TSVeGroup(new TSHzLabel(__("~W~idth "),new TSInputLine(5)),
+ new TSHzLabel(__("~H~eight"),new TSInputLine(5)),0),
+ new TSVeGroup(new TSHzLabel(__("Chars w~i~dth "),new TSInputLine(5)),
+ new TSHzLabel(__("Chars hei~g~ht"),new TSInputLine(5)),0),
+ 0);
+
+ TSLabel *external=new TSLabel(__("E~x~ternal program"),
+ new TSInputLine(80,36));
+
+ TSHzLabel *mode=new TSHzLabel(__("Mode ~n~umber"),new TSInputLine(10));
+
+ TSVeGroup *all=MakeVeGroup(options,sizes,external,mode,0);
+ all->makeSameW();
+
+ char *title=CreateTitle(__("Screen size"));
+ TSViewCol *col=new TSViewCol(title);
+ DeleteArray(title);
+ col->insert(xTSLeft,yTSUp,all);
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeSetScreenOps;
+
+ if (execDialog(d,&box)==cmOK)
+ {
+ unsigned nW,nH,nCH,nCW;
+ nW=atoi(box.sizeW);
+ nH=atoi(box.sizeH);
+ nCW=atoi(box.sizeCW);
+ nCH=atoi(box.sizeCH);
+ if (nW<80 || nW>250 || nH<25 || nH>250)
+ {
+ messageBox(__("Please specify a screen size of at least 80x25 and no more than 250x250"),mfError | mfOKButton);
+ retry=1;
+ }
+ else if (nCW<5 || nCW>32 || nCH<7 || nCW>32)
+ {
+ messageBox(__("Please specify a character size of at least 5x7 and no more than 32x32"),mfError | mfOKButton);
+ retry=1;
+ }
+ else
+ {
+ char *end;
+ so->scOptions=box.options;
+ so->scWidth=atoi(box.sizeW);
+ so->scHeight=atoi(box.sizeH);
+ so->scCharWidth=atoi(box.sizeCW);
+ so->scCharHeight=atoi(box.sizeCH);
+ so->scModeNumber=strtol(box.mode,&end,0);
+ DeleteArray(so->scCommand);
+ so->scCommand=newStr(box.command);
+ resetVideoMode();
+ }
+ }
+ }
+ while (retry);
+}
+
+void TSetEditorApp::SetModifCheckOptions()
+{
+ TSViewCol *col=new TSViewCol(__("Checking for modified files"));
+
+ col->insert(xTSCenter,yTSUpSep,
+ MakeVeGroup(tsveMakeSameW,
+ new TSStaticText(__("When a file on disk is newer than a file in edition:\n")),
+ new TSHzLabel(__("Seconds between checks"),new TSInputLine(5)),
+ TSLabelCheck(__("Related options"),
+ __("~D~on't check after executing an external program"),
+ __("Don't check while ~i~dle"),0),
+ 0));
+ EasyInsertOKCancel(col);
+ TDialog *d=col->doItCenter(cmeSetModiCkOps);
+ delete col;
+
+ struct
+ {
+ char time[5];// CLY_Packed;
+ uint32 ops CLY_Packed;
+ } box;
+ CLY_snprintf(box.time,5,"%d",TCEditor::minDifModCheck);
+ box.ops=modifFilesOps;
+ if (execDialog(d,&box)==cmOK)
+ {
+ TCEditor::minDifModCheck=atoi(box.time);
+ modifFilesOps=box.ops;
+ }
+}
+
diff --git a/setedit/setedit/edprint.cc b/setedit/setedit/edprint.cc
new file mode 100644
index 0000000..6154d7b
--- /dev/null
+++ b/setedit/setedit/edprint.cc
@@ -0,0 +1,777 @@
+/*****************************************************************************
+
+ Printing Module. Copyright 1995-2003 by Salvador E. Tropea.
+
+ This module can be used by Robert Hoehne in RHIDE. Any other needs the
+permission of the author.
+ I put this limitation because I want to track any derivative work.
+
+ This module is an adaptation of an old program I did in 1995 to print a
+program for my university.
+
+*****************************************************************************/
+
+#include <ceditint.h>
+#define Uses_stdio
+#define Uses_string
+#include <time.h>
+#define Uses_stdlib
+#define Uses_unistd
+#define Uses_intl_fprintf
+
+#define Uses_MsgBox
+#define Uses_TDialog
+#define Uses_TRect
+#define Uses_TInputLine
+#define Uses_TLabel
+#define Uses_TCheckBoxes
+#define Uses_TSItem
+#define Uses_TButton
+#define Uses_fpstream
+#define Uses_TEvent
+
+#define Uses_TSHzGroup
+#define Uses_TSInputLine
+#define Uses_TSLabel
+#define Uses_TSCheckBoxes
+#define Uses_TSButton
+#define Uses_TSRadioButtons
+// First include creates the dependencies
+#include <easydia1.h>
+#include <tv.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppConst // For the help context
+#include <setapp.h>
+
+#include <edmsg.h>
+
+extern ushort execDialog( TDialog *d, void *data );
+
+#define MAX_COLS 256
+#define MAX_CCFG 80
+
+const int sizeNames=MAX_CCFG,
+ sizeComma=MAX_CCFG/2;
+
+static int iLineas,iLineasActu;
+static char TimeFormat[12];
+static char DateFormat[12];
+static char Dia[40];
+static char Hora[40];
+static int iCols,iColsActu;
+static int NumeLineas;
+static int iNumLin;
+static int iMargen;
+static int iOutType;
+static char Autor[sizeNames+1];
+static char Titulo[sizeNames+1];
+static char Output[sizeNames+1];
+static char *FileName;
+static char *PiePagina=__("Page: %d Lines: %d to %d Date: %s Time: %s%s");
+static char *Cabecera=__("* Source: %s * Title: %s * Author: %s\n\n");
+
+typedef struct
+{
+ uchar comm[sizeComma];
+ int size;
+} PrnComm;
+
+typedef struct
+{
+ char *inic;
+ char *an_cab;
+ char *de_cab;
+ char *an_pie;
+ char *de_pie;
+} PrnDef;
+
+// Reset and font, Empha., No empha., Italic, No italic
+static PrnDef Epson={ "\x1B@\x1B!\x1", "\x1B""E", "\x1B""F", "\x1B""4", "\x1B""5" };
+// Reset + CR/LF mode + PC437 code page + 12 CPI + TMS Roman
+static PrnDef HP={ "\x1B""E\x1B&k2G\x1B(10U\x1B(s12H\x1B(s5T",
+ "\x1B(s3B", "\x1B(s0B", "\x1B(s1S", "\x1B(s0S" };
+
+/* Inicializacin */
+static PrnComm ImpreInic;
+/* Cabecera */
+static PrnComm ImpAnCab;
+static PrnComm ImpDeCab;
+/* Pie */
+static PrnComm ImpAnPie;
+static PrnComm ImpDePie;
+
+static
+void FillComm(PrnComm &s, char *c)
+{
+ strcpy((char *)s.comm,c);
+ s.size=strlen(c);
+}
+
+static
+void CopyDefault(PrnDef &pr)
+{
+ FillComm(ImpreInic,pr.inic);
+ FillComm(ImpAnCab,pr.an_cab);
+ FillComm(ImpDeCab,pr.de_cab);
+ FillComm(ImpAnPie,pr.an_pie);
+ FillComm(ImpDePie,pr.de_pie);
+}
+
+opstream& operator << (opstream& ps, PrnComm &p)
+{
+ ps << p.size;
+ ps.writeBytes(p.comm,p.size);
+ return ps;
+}
+
+ipstream& operator >> (ipstream& ps, PrnComm &p)
+{
+ ps >> p.size;
+ ps.readBytes(p.comm,p.size);
+ return ps;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Converts the string pointed by Buf to a sequence of chars. Buf contains
+a string with values separated by commas. The sequence is stored in the
+array pointed by Com and the length is stored in Largo.
+ Is used to convert the printer commands from numbers to real commands.
+
+***************************************************************************/
+
+static
+void LeeComImpr(char *Buf, PrnComm &p)
+{
+ int Indice=0;
+ char *Pun;
+
+ p.size=0;
+ Pun=strtok(Buf,",");
+ while(Pun!=NULL)
+ {
+ p.comm[Indice++]=atoi(Pun);
+ p.size++;
+ Pun=strtok(NULL,",");
+ }
+}
+
+/********************
+That's no longer needed because now is stored/retreived different
+int LeerConfiguracion(void)
+{
+ FILE *fCon;
+ char Buffer[MAX_CCFG+1];
+ int Cont=0;
+
+ fCon=fopen("pf.cfg","rt");
+ if (fCon==NULL)
+ {
+ printf("Error no figura el archivo de configuracin\n");
+ return 1;
+ }
+
+ // Cantidad de lineas
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ iLineas=atoi(Buffer)-4;
+ if (iLineas<3)
+ {
+ printf("Error al menos 3 lineas\n");
+ return 1;
+ }
+ printf("Cortar cada: %d\n",iLineas);
+
+
+ // Cantidad de columnas
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ iCols=atoi(Buffer);
+ if (iCols<40 || iCols>MAX_COLS)
+ {
+ printf("Error el nmero de columnas debe ser entre 40 y %d\n",MAX_COLS);
+ return 1;
+ }
+ printf("Columnas: %d\n",iCols);
+
+ // Margen
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ iMargen=atoi(Buffer);
+ if (iMargen<0)
+ {
+ printf("Error el margen debe ser positivo\n");
+ return 1;
+ }
+
+ // Inversin de fecha
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ InvertirDia=atoi(Buffer);
+ if (InvertirDia)
+ printf("Invirtiendo da/mes\n");
+
+
+ // Numerar lneas
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ NumeLineas=atoi(Buffer);
+ if (NumeLineas)
+ printf("Numerando lneas\n");
+
+ // Ttulo
+ fgets(Buffer,MAX_CCFG,fCon);
+ Lee(Titulo,fCon);
+
+ // Autor
+ fgets(Buffer,MAX_CCFG,fCon);
+ Lee(Autor,fCon);
+
+ // Comando de inicializacin de la impresora
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ LeeComImpr(Buffer,ImpreInic,&LargoImpreInic);
+
+ // Comando antes de imprimir la cabecera
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ LeeComImpr(Buffer,ImpAnCab,&LargoImpAnCab);
+
+ // Comando despus de imprimir la cabecera
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ LeeComImpr(Buffer,ImpDeCab,&LargoImpDeCab);
+
+ // Comando antes de imprimir el pie de pgina
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ LeeComImpr(Buffer,ImpAnPie,&LargoImpAnPie);
+
+ // Comando despus de imprimir el pie de pgina
+ fgets(Buffer,MAX_CCFG,fCon);
+ fgets(Buffer,MAX_CCFG,fCon);
+ LeeComImpr(Buffer,ImpDePie,&LargoImpDePie);
+
+ fclose(fCon);
+ return 0;
+}
+******************/
+
+/**[txh]********************************************************************
+
+ Description:
+ Sends a sequence of commands to the printer. The stream f is the printer.
+
+***************************************************************************/
+
+static
+void MandaImpre(PrnComm &p, FILE *f)
+{
+ int i;
+
+ for (i=0;i<p.size;i++)
+ fputc(p.comm[i],f);
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Generates the margin just sending spaces.
+
+***************************************************************************/
+
+static
+void PoneMargen(FILE *f)
+{
+ int i;
+
+ for (i=0;i<iMargen;i++)
+ fputc(32,f);
+}
+
+static
+void GetTimeStrings()
+{
+ time_t t_Actu=time(0);
+ struct tm *tActu=localtime(&t_Actu);
+ strftime(Dia,40,DateFormat,tActu);
+ strftime(Hora,40,TimeFormat,tActu);
+}
+
+static
+void PrintHeader(FILE *fSal)
+{
+ MandaImpre(ImpAnCab,fSal);
+ PoneMargen(fSal);
+ TVIntl::fprintf(fSal,Cabecera,FileName,Titulo,Autor);
+ MandaImpre(ImpDeCab,fSal);
+}
+
+static
+void PrintFooter(FILE *fSal, int iPagina, int i, int iNumLin)
+{
+ GetTimeStrings();
+ MandaImpre(ImpAnPie,fSal);
+ fprintf(fSal,"\n");
+ PoneMargen(fSal);
+ TVIntl::fprintf(fSal,PiePagina,iPagina,i,iNumLin,Dia,Hora,"\r\f");
+ MandaImpre(ImpDePie,fSal);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Prints the buffer Buf to the printer (f). iCR indicates if a CR must be
+used after the line.
+
+***************************************************************************/
+
+static
+void MandarLinea(char *Buf,FILE *f,int *iLin,int *iPagina)
+{
+ ++iNumLin;
+ PoneMargen(f);
+ if (NumeLineas)
+ fprintf(f,"%4u: %s\n",iNumLin,Buf);
+ else
+ fprintf(f,"%s\n",Buf);
+
+ if (*iLin==iLineasActu)
+ {
+ PrintFooter(f,*iPagina,(*iPagina-1)*iLineasActu+1,*iPagina*iLineasActu);
+ PrintHeader(f);
+ ++*iPagina;
+ *iLin=1;
+ }
+ else
+ (*iLin)++;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fills all the structures with default values. Must be called at start-up
+to be sure there are data in the structures.
+
+***************************************************************************/
+
+void PrintSetDefaults(void)
+{
+ // Lines per page. That's the total including header and footer
+ iLineas=64;
+ // Columns of text, not including the margin
+ iCols=90;
+ // Left margin in characters
+ iMargen=7;
+ // Time and date formats
+ strcpy(TimeFormat,"%k:%M");
+ strcpy(DateFormat,"%d/%m/%Y");
+ // Print line numbers
+ NumeLineas=1;
+ // Title
+ strcpy(Titulo,"SET's editor ;-)");
+ // Autor
+ strcpy(Autor,"Salvador E. Tropea (SET)");
+ CopyDefault(Epson);
+ // Output file.
+ #ifdef TVOS_UNIX
+ strcpy(Output,"lpr");
+ iOutType=1;
+ #else
+ strcpy(Output,"prn");
+ iOutType=0;
+ #endif
+}
+
+static char *FileToScan;
+
+static inline
+void InitFileScan(char *b)
+{
+ FileToScan=b;
+}
+
+static
+int FGetS(char *Buffer, int size)
+{
+ int i;
+
+ if (*FileToScan==0)
+ return 0;
+
+ size--;
+ for (i=0; i<size && FileToScan[i]!='\n' && FileToScan[i]; i++)
+ Buffer[i]=FileToScan[i];
+
+ if (i && Buffer[i-1]=='\r')
+ Buffer[i-1]=0;
+ else
+ Buffer[i]=0;
+
+ FileToScan+=i;
+ if (*FileToScan)
+ FileToScan++;
+
+ return 1;
+}
+
+static
+char *ExpandTabs(const char *b, unsigned tabSize)
+{
+ unsigned x,count;
+ const char *s;
+ char *ret;
+
+ // First meassure it:
+ for (x=0, s=b; *s; s++)
+ if (*s=='\t')
+ x+=tabSize-(x % tabSize);
+ else
+ x++;
+ x++;
+ ret=new char[x];
+ // Expand it:
+ for (x=0, s=b; *s; s++)
+ if (*s=='\t')
+ {
+ count=tabSize-(x % tabSize);
+ while (count--)
+ ret[x++]=' ';
+ }
+ else
+ ret[x++]=*s;
+ ret[x]=0;
+ return ret;
+}
+
+int PrintSource(char *b, char *fileName, unsigned tabSize)
+{
+ FILE *fSal;
+ char Buffer[1024],BufLin[MAX_COLS+1];
+ int iLin,iPagina,iLargo,i,iPos,iLOr=0,isPipe=0;
+
+ InitFileScan(b);
+ EdShowMessageI(__("Starting printing module"),True);
+
+ if (iOutType==1)
+ {
+ isPipe=1;
+ fSal=popen(Output,"w");
+ }
+ else
+ fSal=fopen(Output,"wb");
+
+ if (fSal==NULL)
+ {
+ messageBox(__("Can't open output file for printing"),mfError | mfOKButton);
+ return 1;
+ }
+
+ FileName=fileName;
+
+ if (TVIntl::snprintf(Buffer,1024,Cabecera,FileName,Titulo,Autor)>(iCols+2))
+ {
+ messageBox(__("The header is too large, reduce the title and/or author lengths"),
+ mfError | mfOKButton);
+ EdShowMessage(Buffer);
+ sprintf(Buffer,__("Header length: %d Columns: %d"),(int)strlen(Buffer),iCols);
+ EdShowMessage(Buffer);
+ if (isPipe)
+ pclose(fSal);
+ else
+ fclose(fSal);
+ return 1;
+ }
+
+ iColsActu=iCols;
+ if (NumeLineas)
+ iColsActu-=6;
+
+ iLin=1;
+ iPagina=1;
+ iNumLin=0;
+ iLineasActu=iLineas-4;
+
+ MandaImpre(ImpreInic,fSal);
+ PrintHeader(fSal);
+
+ //printf("\nProcesando:\n\tPgina 1");
+ while (FGetS(Buffer,1024))
+ {
+ char *BufAux=ExpandTabs(Buffer,tabSize);
+ iLargo=strlen(BufAux);
+ iLOr++;
+ if (iLargo<(iColsActu+1))
+ MandarLinea(BufAux,fSal,&iLin,&iPagina);
+ else
+ {
+ BufLin[iColsActu]=0;
+ for (i=0,iPos=0;i<(iLargo/iColsActu);i++,iPos+=iColsActu)
+ {
+ strncpy(BufLin,BufAux+iPos,iColsActu);
+ MandarLinea(BufLin,fSal,&iLin,&iPagina);
+ }
+ strncpy(BufLin,BufAux+iPos,iColsActu);
+ MandarLinea(BufLin,fSal,&iLin,&iPagina);
+ }
+ delete[] BufAux;
+ }
+ for (i=iLin;i<=iLineasActu;i++)
+ fprintf(fSal,"\n");
+ i=(iPagina-1)*iLineasActu+1;
+
+ PrintFooter(fSal,iPagina,i,iNumLin);
+
+ TVIntl::snprintf(Buffer,1024,__("Processed: %d lines, total printed: %d lines"),iLOr,iNumLin);
+ EdShowMessage(Buffer);
+ if (isPipe)
+ pclose(fSal);
+ else
+ fclose(fSal);
+
+ return 0;
+}
+
+const int cmEpson=0x2250, cmHP=0x2251;
+
+// packed because TVision will count the lengths
+#pragma pack(1)
+typedef struct
+{
+ char title[sizeNames];
+ char author[sizeNames];
+ char lines[5];
+ char cols[5];
+ char margin[5];
+ uint32 lineNum;
+ char tformat[12];
+ char dformat[12];
+ char init[sizeNames];
+ char b_head[sizeNames];
+ char a_head[sizeNames];
+ char b_foot[sizeNames];
+ char a_foot[sizeNames];
+ char out[sizeNames];
+ uint32 o_type;
+} RectDiag;
+#pragma pack()
+
+static
+void ExpandComm(char *dest, PrnComm &p)
+{
+ int i;
+ char buf[8];
+
+ *dest=0;
+ for (i=0; i<p.size; i++)
+ {
+ if (i!=p.size-1)
+ sprintf(buf,"%d,",p.comm[i]);
+ else
+ sprintf(buf,"%d",p.comm[i]);
+ strcat(dest,buf);
+ }
+}
+
+static
+void ExpandComm(char *dest, char *s)
+{
+ char buf[8];
+
+ *dest=0;
+ for (; *s; s++)
+ {
+ if (*(s+1)!=0)
+ sprintf(buf,"%d,",(uchar)(*s));
+ else
+ sprintf(buf,"%d",uchar(*s));
+ strcat(dest,buf);
+ }
+}
+
+static
+void FillRectDiag(RectDiag &r)
+{
+ sprintf(r.lines,"%d",iLineas);
+ sprintf(r.cols,"%d",iCols);
+ sprintf(r.margin,"%d",iMargen);
+ strcpy(r.tformat,TimeFormat);
+ strcpy(r.dformat,DateFormat);
+ r.lineNum=NumeLineas;
+ strcpy(r.title,Titulo);
+ strcpy(r.author,Autor);
+ strcpy(r.out,Output);
+ ExpandComm(r.init ,ImpreInic);
+ ExpandComm(r.b_head,ImpAnCab);
+ ExpandComm(r.a_head,ImpDeCab);
+ ExpandComm(r.b_foot,ImpAnPie);
+ ExpandComm(r.a_foot,ImpDePie);
+ r.o_type=iOutType;
+}
+
+static
+void ExpandRectDiag(RectDiag &r)
+{
+ iLineas=atoi(r.lines);
+ iCols=atoi(r.cols);
+ iMargen=atoi(r.margin);
+ strcpy(TimeFormat,r.tformat);
+ strcpy(DateFormat,r.dformat);
+ NumeLineas=r.lineNum;
+ strcpy(Titulo,r.title);
+ strcpy(Autor,r.author);
+ strcpy(Output,r.out);
+ LeeComImpr(r.init, ImpreInic);
+ LeeComImpr(r.b_head,ImpAnCab);
+ LeeComImpr(r.a_head,ImpDeCab);
+ LeeComImpr(r.b_foot,ImpAnPie);
+ LeeComImpr(r.a_foot,ImpDePie);
+ iOutType=r.o_type;
+}
+
+class TDiaPrint : public TDialog
+{
+public:
+ TDiaPrint( TRect r, const char *name, RectDiag *dat ) :
+ TWindowInit( &TDiaPrint::initFrame ),
+ TDialog(r,name),
+ rd(dat) {};
+ virtual void handleEvent(TEvent& event);
+ RectDiag *rd;
+ void SetDefault(PrnDef &def);
+};
+
+void TDiaPrint::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand)
+ {
+ switch (event.message.command)
+ {
+ case cmEpson:
+ SetDefault(Epson);
+ break;
+ case cmHP:
+ SetDefault(HP);
+ break;
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+}
+
+void TDiaPrint::SetDefault(PrnDef &def)
+{
+ getData(rd);
+ ExpandComm(rd->init ,def.inic);
+ ExpandComm(rd->b_head,def.an_cab);
+ ExpandComm(rd->a_head,def.de_cab);
+ ExpandComm(rd->b_foot,def.an_pie);
+ ExpandComm(rd->a_foot,def.de_pie);
+ setData(rd);
+}
+
+void PrintSetup(void)
+{ //ABCDEFHILMOPRSTUVW
+ RectDiag r;
+ TSViewCol *col=new TSViewCol(new TDiaPrint(TRect(1,1,1,1),__("Printer Setup"),&r));
+
+ TSView::yDefSep=0;
+ TSHzLabel *tLines=new TSHzLabel(__("Total ~l~ines per page:"),new
+ TSInputLine(5));
+ TSHzLabel *cols =new TSHzLabel(__("Columns ~w~/o margin:"),new
+ TSInputLine(5));
+ TSHzLabel *margin=new TSHzLabel(__("Left ~m~argin:"),new TSInputLine(5));
+ TSCheckBoxes *pLines=new TSCheckBoxes(new TSItem(__("Print line numbers"),0));
+ TSHzLabel *time =new TSHzLabel(__("~T~ime format:"),new TSInputLine(12));
+ TSHzLabel *date =new TSHzLabel(__("~D~ate format:"),new TSInputLine(12));
+ #define C(var,str) TSLabel *var=new TSLabel(str,new TSInputLine(sizeNames,28))
+ C(title,__("T~i~tle"));
+ C(author,__("~A~uthor"));
+ C(bH,__("Before ~h~eading"));
+ C(aH,__("A~f~ter heading"));
+ C(bF,__("~B~efore footer"));
+ C(aF,__("After foote~r~"));
+ TSView::yDefSep=1;
+ C(init,__("~P~rinter initialization"));
+ C(output,__("O~u~tput file"));
+ TSRadioButtons *outType=new TSRadioButtons(new TSItem(__("Output is a de~v~ice/file"),
+ new TSItem(__("Output i~s~ a program"),0)));
+ #undef C
+ TSHzGroup *buttons=new TSHzGroup(new TSButton(__("~O~k"),cmOK,bfDefault),
+ new TSHzGroup(new TSButton(__("~C~ancel"),cmCancel),
+ new TSHzGroup(new TSButton("~E~pson",cmEpson),
+ new TSButton("HP",cmHP))));
+ buttons->Flags|=wSpan;
+
+ // Left side
+ EDForceSameWidth(tLines,margin,time,title,output,bH,bF,0);
+ // Right side
+ EDForceSameWidth(cols,pLines,date,author,outType,aH,aF,0);
+ init->setWidth(tLines->w+1+cols->w);
+
+ #define C(left,right,prev) col->insert(2,yTSUnder,left,0,prev);\
+ col->insert(xTSRightOf,yTSUnder,right,left,prev)
+ #define S(left,right) col->insert(2,1,left);\
+ col->insert(xTSRightOf,1,right,left);
+ S(title,author);
+ C(tLines,cols,title);
+ C(margin,pLines,tLines);
+ C(time,date,margin);
+ col->insert(2,yTSUnder,init,0,time);
+ C(bH,aH,init);
+ C(bF,aF,bH);
+ C(output,outType,bF);
+ #undef C
+ #undef S
+ col->insert(xTSCenter,yTSUnder,buttons,0,output);
+
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeSetUpPrinter;
+
+ FillRectDiag(r);
+
+ if (execDialog(d,&r)!=cmCancel)
+ ExpandRectDiag(r);
+}
+
+const int Version=3;
+
+void SavePrintSetUp(opstream* s)
+{
+ *s << Version;
+ *s << iLineas << iCols << iMargen << NumeLineas;
+ s->writeString(TimeFormat);
+ s->writeString(DateFormat);
+ s->writeString(Titulo);
+ s->writeString(Autor);
+ s->writeString(Output);
+ *s << ImpreInic << ImpAnCab << ImpDeCab << ImpAnPie << ImpDePie;
+ *s << iOutType;
+}
+
+void LoadPrintSetUp(ipstream* s)
+{
+ int Version;
+ *s >> Version;
+ if (Version==1)
+ return;
+ *s >> iLineas >> iCols >> iMargen >> NumeLineas;
+ s->readString(TimeFormat,12);
+ s->readString(DateFormat,12);
+ s->readString(Titulo,sizeNames);
+ s->readString(Autor,sizeNames);
+ s->readString(Output,sizeNames);
+ *s >> ImpreInic >> ImpAnCab >> ImpDeCab >> ImpAnPie >> ImpDePie;
+ if (Version>=3)
+ *s >> iOutType;
+ else
+ iOutType=strcmp(Output,"lpr")==0 ? 1 : 0;
+}
diff --git a/setedit/setedit/edprj.cc b/setedit/setedit/edprj.cc
new file mode 100644
index 0000000..dbb8fde
--- /dev/null
+++ b/setedit/setedit/edprj.cc
@@ -0,0 +1,1469 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_stdio
+#define Uses_getcwd
+#define Uses_string
+#define Uses_unistd
+
+#define Uses_TCEditWindow
+#define Uses_TStreamable
+#define Uses_TStreamableClass
+#define Uses_TScrollBar
+#define Uses_TRect
+#define Uses_TDialog
+#define Uses_TWindow
+#define Uses_TStringCollection
+#define Uses_TSortedListBox
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_MsgBox
+#define Uses_TKeys
+#define Uses_TFileDialog
+#define Uses_fpstream
+#define Uses_TFileList
+#define Uses_FileOpenAid
+#define Uses_TCEditor_Commands // For the code page update
+#define Uses_IOS_BIN
+#define Uses_fcntl
+#define Uses_filelength
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <ceditor.h>
+#include <editcoma.h>
+
+#define Uses_PrjFunctions
+#define Uses_SETAppAll
+#include <setapp.h>
+#include <dskwin.h>
+#include <dskprj.h>
+#include <edcollec.h>
+#include <sdginter.h>
+#include <codepage.h>
+#include <pathtool.h>
+#include <advice.h>
+#include <rhutils.h>
+#include <edspecs.h>
+#define Uses_TagsOnlyFuncs
+#include <tags.h>
+#include <debug.h>
+#include <pathlist.h>
+
+extern char *ExpandFileNameToThePointWhereTheProgramWasLoaded(const char *s);
+static TDskWinPrj *prjWin=NULL;
+#define PrjExists() (prjWin!=NULL)
+extern void closeView(TView *p, void *p1);
+
+static int LoadingPrjVersion;
+
+class TEditorProjectListBox : public TSortedListBox
+{
+public:
+ TEditorProjectListBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aScrollBar);
+ virtual void handleEvent(TEvent &);
+ virtual void selectItem(ccIndex item);
+ virtual void getText(char *dest, ccIndex item, short maxLen);
+ int addFile(char *name, Boolean interactive=True);
+ void delFile(void);
+ void changeSorting(int mode);
+ void toggleSorting();
+};
+
+class TEditorProjectWindow : public TDialog
+{
+public:
+ TEditorProjectListBox *list;
+ TEditorProjectWindow(const TRect &,const char *);
+ ~TEditorProjectWindow();
+ virtual void close();
+ virtual void handleEvent(TEvent& event);
+ virtual const char *getTitle(short maxSize);
+ static const int Version;
+ TScrollBar *scrollbar;
+ char *FileName;
+
+protected:
+ int sizeBufTitle;
+ char *bufTitle;
+ stTVIntl *titleCache;
+};
+
+typedef struct
+{
+ char *name;
+ char *shortName;
+ EditorResume resume;
+ uint32 forceTarget; // Read the header for more info
+} PrjItem;
+
+const int TEditorProjectWindow::Version=8;
+
+const int crtInteractive=1, crtUseFullName=2;
+const int prjShortName=0, prjName=1;
+
+class TPrjItemColl : public TStringCollection
+{
+public:
+ TPrjItemColl(ccIndex aLimit, ccIndex aDelta);
+ ~TPrjItemColl();
+ void atInsert(ccIndex pos, char *s, int flags=crtInteractive);
+ void freeItem(void *);
+ void *keyOf(void *item)
+ { return sortMode==prjShortName ? (void *)((PrjItem *)item)->shortName :
+ (void *)((PrjItem *)item)->name; };
+ const char *keyOf(ccIndex item) { return (const char *)keyOf(at(item)); }
+ char *referencePath;
+ char *referenceCurDelta;
+ Boolean Search(char *file, ccIndex &pos);
+ int addFile(char *name, ccIndex &pos, int flags=0, char **test=NULL);
+ void analizeReference(const char *filename);
+ char *applyPrjPath(const char *name);
+ void changeSorting(int mode);
+ void changeSorting(int mode, ccIndex &pos);
+ void toggleSorting(ccIndex &pos)
+ { changeSorting(sortMode==prjShortName ? prjName : prjShortName,pos); };
+ int getSortMode() { return sortMode; };
+ PrjItem *At(ccIndex pos) { return (PrjItem *)at(pos); };
+
+private:
+ PrjItem *createNewElement(char *name, int flags=0);
+
+ const char *streamableName() const
+ { return name; }
+ void *readItem( ipstream& is );
+ void writeItem( void *p, opstream &os );
+
+protected:
+ TPrjItemColl(StreamableInit);
+ int sortMode; // prjShortName or prjName
+ void initClass();
+
+public:
+ static const char *name;
+ static TStreamable *build() {return new TPrjItemColl( streamableInit );};
+};
+
+const char *TPrjItemColl::name="TPrjItemColl";
+
+SetDefStreamOperators(TPrjItemColl)
+
+static TPrjItemColl *ProjectList=NULL;
+
+TPrjItemColl::TPrjItemColl(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta)
+{
+ initClass();
+}
+
+TPrjItemColl::TPrjItemColl(StreamableInit) :
+ TStringCollection(streamableInit)
+{
+ initClass();
+}
+
+void TPrjItemColl::initClass()
+{
+ referencePath=getcwd(0,PATH_MAX);
+ referenceCurDelta=NULL;
+ if (!referencePath)
+ string_dup(referencePath,"");
+ sortMode=prjShortName;
+}
+
+TPrjItemColl::~TPrjItemColl()
+{
+ ::free(referencePath);
+ ::free(referenceCurDelta);
+}
+
+void TPrjItemColl::changeSorting(int mode)
+{
+ sortMode=mode;
+ reSort();
+}
+
+void TPrjItemColl::changeSorting(int mode, ccIndex &pos)
+{
+ if (pos==-1)
+ {
+ changeSorting(mode);
+ return;
+ }
+ void *p=at(pos);
+ changeSorting(mode);
+ search(keyOf(p),pos);
+}
+
+void TPrjItemColl::analizeReference(const char *filename)
+{
+ char b1[PATH_MAX], b2[PATH_MAX];
+ // Make this path absolute
+ strcpy(b1,filename);
+ CLY_fexpand(b1);
+ // Extract the dir part
+ CLY_ExpandPath(b1,b2,NULL);
+ char *endB2=b2+strlen(b2)-1;
+ if (CLY_IsValidDirSep(*endB2))
+ *endB2=0;
+ // Compare with the reference
+ if (strcmp(b2,referencePath)!=0)
+ { // This isn't the same reference
+ ::free(referencePath);
+ ::free(referenceCurDelta);
+ getcwd(b1,PATH_MAX);
+ if (strcmp(b1,b2)==0)
+ { // The reference is the current directory
+ // I think it never happends
+ referencePath=strdup(b1);
+ referenceCurDelta=NULL;
+ }
+ else
+ { // Different reference
+ char *s=NULL;
+ referencePath=strdup(b2);
+ string_dup(s,b2);
+ AbsToRelPath(b1,s,0);
+ referenceCurDelta=s;
+ }
+ }
+}
+
+void *TPrjItemColl::readItem( ipstream& is )
+{
+ char Buffer[PATH_MAX+1];
+
+ is.readString((char *)Buffer,PATH_MAX);
+ PrjItem *st;
+ if (LoadingPrjVersion<4)
+ st=createNewElement(Buffer);
+ else
+ {
+ char isSame;
+ is >> isSame;
+ st=createNewElement(Buffer,isSame ? crtUseFullName : 0);
+ }
+ if (LoadingPrjVersion>2)
+ TCEditWindow::ReadResume(st->resume,is);
+ if (LoadingPrjVersion>5)
+ is >> st->forceTarget;
+ return st;
+}
+
+void TPrjItemColl::writeItem( void *p, opstream &os )
+{
+ PrjItem *pi=(PrjItem *)p;
+ os.writeString(pi->name);
+ os << (char)(pi->shortName==pi->name);
+ TCEditWindow::SaveResume(pi->resume,os);
+ os << pi->forceTarget;
+}
+
+TStreamableClass RPrjItemColl( TPrjItemColl::name,
+ TPrjItemColl::build,
+ __DELTA(TPrjItemColl)
+ );
+
+void TPrjItemColl::freeItem(void *p)
+{
+ PrjItem *s=(PrjItem *)p;
+ if (s)
+ {
+ string_free(s->name);
+ delete s;
+ }
+}
+
+static char *GetShortName(char *name)
+{
+ char *slash=strrchr(name,'/');
+ if (slash)
+ return slash+1;
+ return name;
+}
+
+PrjItem *TPrjItemColl::createNewElement(char *name, int flags)
+{
+ PrjItem *st=new PrjItem;
+ if (st)
+ {// Initialize it to avoid saving garbage that could contain anything important
+ memset(st,0,sizeof(PrjItem));
+ char *s;
+ string_dup(s,name);
+ // Is name an absolute path? (relative values comes from disk, absolute from user)
+ if ((flags & crtInteractive) && CheckIfPathAbsolute(s))
+ {
+ if (!AbsToRelPath(referencePath,s,0))
+ { // Warning, it will generate problems if the project is moved
+ GiveAdvice(gadvAbsolutePath);
+ }
+ }
+ st->name=s;
+ if (flags & crtUseFullName)
+ st->shortName=st->name;
+ else
+ st->shortName=GetShortName(st->name);
+ // Indicate is empty
+ // - Side effect of the memset -
+ //st->resume.prj_flags=0;
+ }
+ return st;
+}
+
+Boolean TPrjItemColl::Search(char *name, ccIndex &pos)
+{
+ // Get the short name and relative name of this file
+ char *sName=GetShortName(name);
+ char *relName;
+ Boolean ret=False;
+ string_dup(relName,name);
+ AbsToRelPath(referencePath,relName,0);
+ int oldSortMode=sortMode;
+
+ if (sortMode!=prjShortName)
+ // We must be in short mode to make the next search
+ changeSorting(prjShortName);
+ // Search the short name
+ if (search(sName,pos))
+ {// We found it, now make sure that's the same file
+ PrjItem *st=(PrjItem *)ProjectList->at(pos);
+ if (strcmp(relName,st->name)==0 || // Is it?
+ search(relName,pos)) // Is the relative there?
+ ret=True;
+ }
+ else
+ {// The short name isn't there, but perhaps the relative is
+ ret=search(relName,pos);
+ }
+ string_free(relName);
+ if (oldSortMode!=sortMode)
+ // Revert the sorting adjusting the position
+ changeSorting(oldSortMode,pos);
+ return ret;
+}
+
+void TPrjItemColl::atInsert(ccIndex pos, char *s, int flags)
+{
+ PrjItem *st=createNewElement(s,flags);
+ if (st)
+ {
+ st->forceTarget=prjtAllTargets;
+ TStringCollection::atInsert(pos,st);
+ }
+}
+
+
+TEditorProjectListBox::TEditorProjectListBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aScrollBar) :
+ TSortedListBox(bounds,aNumCols,aScrollBar)
+{
+}
+
+void TEditorProjectListBox::changeSorting(int mode)
+{
+ TPrjItemColl *p=(TPrjItemColl *)list();
+ ccIndex newFocused=focused;
+ p->changeSorting(mode,newFocused);
+ if (newFocused!=-1)
+ focusItem(newFocused);
+}
+
+void TEditorProjectListBox::toggleSorting()
+{
+ TPrjItemColl *p=(TPrjItemColl *)list();
+ ccIndex newFocused=focused;
+ p->toggleSorting(newFocused);
+ if (newFocused!=-1)
+ focusItem(newFocused);
+}
+
+void TEditorProjectListBox::getText(char *dest,ccIndex item,short maxlen)
+{
+ TPrjItemColl *p=(TPrjItemColl *)list();
+ strncpy(dest,p->keyOf(item),maxlen);
+ dest[maxlen]=EOS;
+}
+
+
+char *TPrjItemColl::applyPrjPath(const char *name)
+{
+ if (CLY_IsUNC(name))
+ // Don't modify the name if that's a Windows UNC
+ return string_dup(name);
+ char *dest=NULL;
+ string_cat(dest,referenceCurDelta,DIRSEPARATOR_,name,0);
+ return dest;
+}
+
+extern void OpenFileFromEditor(char *fullName);
+
+void TEditorProjectListBox::selectItem(ccIndex item)
+{
+ PrjItem *st=(PrjItem *)(list()->at(item));
+
+ message( owner, evBroadcast, cmListItemSelected, list() );
+ if (ProjectList->referenceCurDelta)
+ {// The project was loaded from another directory, not curdir
+ char *dest=ProjectList->applyPrjPath(st->name);
+ OpenFileFromEditor(dest);
+ string_free(dest);
+ }
+ else
+ OpenFileFromEditor(st->name);
+}
+
+
+int TEditorProjectListBox::addFile(char *name, Boolean interactive)
+{
+ ccIndex pos;
+ int flags=interactive ? crtInteractive : 0;
+
+ if (!ProjectList->addFile(name,pos,flags))
+ {
+ if (interactive)
+ messageBox(__("File already in project"),mfOKButton | mfError);
+ return 0;
+ }
+ setRange(ProjectList->getCount());
+ focusItem(pos);
+ drawView();
+ return 1;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a file to the project file collection, but can be used to check if a
+file is already part of the collection.
+
+***************************************************************************/
+
+int TPrjItemColl::addFile(char *name, ccIndex &pos, int flags, char **test)
+{
+ char *sName=GetShortName(name);
+ char *relName=NULL;
+ int oldSortMode=sortMode, ret=1;
+
+ if (sortMode!=prjShortName)
+ // We must be in short mode to make the next search
+ changeSorting(prjShortName);
+ if (search(sName,pos))
+ {
+ PrjItem *st=At(pos);
+ string_dup(relName,name);
+ AbsToRelPath(referencePath,relName,0);
+ if (strcmp(relName,st->name)==0 || search(relName,pos))
+ {
+ ret=0;
+ pos=-1; // Avoid tracking it
+ }
+ flags|=crtUseFullName;
+ }
+ if (ret)
+ {// Can be inserted
+ if (test)
+ {
+ pos=-1;
+ *test=NULL;
+ }
+ else
+ {
+ atInsert(pos,name,flags);
+ PathListAddPathFor(at(pos),paliSource);
+ }
+ // Not returned, free it
+ string_free(relName);
+ }
+ else
+ {// Already there
+ if (test)
+ *test=relName;
+ else
+ string_free(relName);
+ }
+ if (oldSortMode!=sortMode)
+ // Revert the sorting adjusting the position
+ changeSorting(oldSortMode,pos);
+ return ret;
+}
+
+void TEditorProjectListBox::delFile(void)
+{
+ int c=ProjectList->getCount();
+
+ if (c>0)
+ {
+ ProjectList->atFree(focused);
+ setRange(c-1);
+ drawView();
+ }
+}
+
+void TEditorProjectListBox::handleEvent(TEvent &event)
+{
+ char name[PATH_MAX];
+
+ TSortedListBox::handleEvent(event);
+ switch (event.what)
+ {
+ case evKeyDown:
+ switch (event.keyDown.keyCode)
+ {
+ case kbEnter:
+ if (!list() || list()->getCount()==0)
+ return;
+ selectItem(focused);
+ break;
+ default:
+ return;
+ }
+ break;
+ case evCommand:
+ switch (event.message.command)
+ {
+ case cmDelete:
+ delFile();
+ break;
+ case cmInsert:
+ *name=0;
+ GenericFileDialog(__("Add File"),name,"*",hID_FileOpen,
+ fdMultipleSel | fdAddButton);
+ break;
+ case cmChangeSort:
+ toggleSorting();
+ draw();
+ break;
+ default:
+ return;
+ }
+ break;
+ case evBroadcast:
+ switch (event.message.command)
+ {
+ case cmFileDialogFileSelected:
+ addFile((char *)event.message.infoPtr);
+ break;
+ default:
+ return;
+ }
+ break;
+ }
+ clearEvent(event);
+}
+
+//class TEditorProjectListBox;
+
+TEditorProjectWindow::TEditorProjectWindow(const TRect & rect,
+ const char *tit) :
+ TWindowInit(TEditorProjectWindow::initFrame),
+ TDialog(rect,tit)
+{
+ if (!ProjectList)
+ ProjectList=new TPrjItemColl(5,5);
+ TRect r=getExtent();
+ r.grow(-1,-1);
+ scrollbar=standardScrollBar(sbVertical | sbHandleKeyboard);
+ list=new TEditorProjectListBox(r,(TSetEditorApp::geFlags & geVertWindows) ? 1 : 3,scrollbar);
+ growMode=gfGrowHiX | gfGrowHiY | gfGrowLoY;
+ list->growMode=gfGrowHiX | gfGrowHiY;
+ list->newList(ProjectList);
+ insert(list);
+ flags|=wfGrow | wfZoom;
+ options|=ofFirstClick;
+ helpCtx=hcEditorProjectWindow;
+ number=1;
+ sizeBufTitle=0;
+ bufTitle=0;
+ FileName=0;
+ titleCache=NULL;
+}
+
+TEditorProjectWindow::~TEditorProjectWindow()
+{
+ CLY_destroy(ProjectList);
+ ProjectList=NULL;
+ delete[] bufTitle;
+ delete[] FileName;
+ TVIntl::freeSt(titleCache);
+}
+
+void TEditorProjectWindow::handleEvent(TEvent& event)
+{
+ if (event.what==evKeyboard && event.keyDown.keyCode==kbEsc)
+ {
+ close();
+ clearEvent(event);
+ return;
+ }
+ TDialog::handleEvent(event);
+}
+
+void TEditorProjectWindow::close()
+{
+ hide();
+}
+
+const char *TEditorProjectWindow::getTitle(short maxSize)
+{
+ const char *intlTitle=TVIntl::getText(title,titleCache);
+ int len=strlen(intlTitle)+strlen(FileName)+4;
+ if (len>sizeBufTitle)
+ {
+ delete[] bufTitle;
+ bufTitle=new char[len];
+ }
+ sprintf(bufTitle,"%s - %s",intlTitle,FileName);
+
+ return bufTitle;
+}
+
+TStreamable *TDskWinPrj::build()
+{
+ return new TDskWinPrj( streamableInit );
+}
+
+static char *Signature="Editor project file\x1A";
+
+void TDskWinPrj::write( opstream& os )
+{
+ os << window->origin << window->size
+ << ProjectList << (int)(TProgram::deskTop->indexOf(window));
+}
+
+void *TDskWinPrj::read( ipstream& is )
+{
+ TRect pos;
+
+ is >> pos.a >> pos.b >> ProjectList >> ZOrder;
+ pos.b+=pos.a;
+ window=new TEditorProjectWindow(pos,__("Project Window"));
+ view=window;
+
+ return this;
+}
+
+char *TDskWinPrj::GetText(char *dest, short maxLen)
+{
+ TVIntl::snprintf(dest,maxLen,__(" 1 Project Window"));
+ return dest;
+}
+
+char *TDskWinPrj::getFileName()
+{
+ if (!window)
+ return 0;
+ return window->FileName;
+}
+
+void TDskWinPrj::setFileName(char *file)
+{
+ if (window)
+ {
+ delete[] window->FileName;
+ window->FileName=newStr(file);
+ ProjectList->analizeReference(file);
+ }
+}
+
+TDskWinPrj::TDskWinPrj(char *fName)
+{
+ TRect r=TProgram::deskTop->getExtent();
+ if (TSetEditorApp::geFlags & geVertWindows)
+ {
+ if (TSetEditorApp::geFlags & geRightSide)
+ r.a.x=r.b.x-TSetEditorApp::widthVertWindows;
+ else
+ r.b.x=TSetEditorApp::widthVertWindows;
+ }
+ else
+ r.a.y=r.b.y-7;
+ view=window=new TEditorProjectWindow(r,__("Project Window"));
+ setFileName(fName);
+ type=dktPrj;
+ CanBeSaved=0;
+ ZOrder=-1;
+ wS=TScreen::getCols();
+ hS=TScreen::getRows();
+}
+
+TDskWinPrj::~TDskWinPrj()
+{
+ CLY_destroy(window);
+ editorApp->SetTitle();
+}
+
+int TDskWinPrj::GoAction(ccIndex )
+{
+ TProgram::deskTop->lock();
+ setFocusTo=window;
+ focusChanged=True;
+
+ return 0;
+}
+
+
+int TDskWinPrj::DeleteAction(ccIndex, Boolean)
+{
+ //CloseProject(1); That's imposible because destroy the current object.
+ return 0;
+}
+
+void LoadProject(char *name)
+{
+ #ifdef BROKEN_CPP_OPEN_STREAM
+ int h=open(name, O_RDONLY | O_BINARY);
+ fpstream *f=new fpstream(h);
+ #else
+ fpstream *f=new fpstream(name,CLY_IOSIn | CLY_IOSBin);
+ #endif
+
+ if (!f)
+ messageBox(__("Could not open project file"), mfOKButton | mfError);
+ else
+ {
+ char buffer[80];
+
+ f->readString(buffer,80);
+ if (strcmp(buffer,Signature)!=0)
+ messageBox(__("Wrong project file."), mfOKButton | mfError);
+ else
+ {
+ *f >> LoadingPrjVersion;
+ ushort wS, hS;
+ if (LoadingPrjVersion>4)
+ *f >> wS >> hS;
+ else
+ {
+ wS=TScreen::getCols();
+ hS=TScreen::getRows();
+ }
+ *f >> prjWin;
+ if (LoadingPrjVersion>6)
+ {
+ char aux;
+ *f >> aux;
+ if (ProjectList)
+ ProjectList->changeSorting(aux);
+ }
+ prjWin->wS=wS;
+ prjWin->hS=hS;
+
+ if (LoadingPrjVersion>1)
+ SDGInterfaceReadData(f);
+ // KEEP it at the end, the load is conditional.
+ // We don't load it if libmigdb doesn't exist.
+ if (LoadingPrjVersion>=8)
+ DebugReadData(*f);
+ if (prjWin)
+ prjWin->setFileName(name);
+ if (GetAutoGenMode()==stfAutoCentral)
+ ProjectInsertAutoTagFiles();
+ }
+ if (!f)
+ messageBox(__("Error reading project file"), mfOKButton | mfError);
+ else
+ editorApp->SetTitle(__("Project: "),name);
+ f->close();
+ }
+ delete f;
+}
+
+static void UpdateResume(void *p, void *)
+{
+ PrjItem *item=(PrjItem *)p;
+ TCEditWindow *win=IsAlreadyOnDesktop(item->name);
+ if (win)
+ {
+ win->FillResume(item->resume);
+ // Indicate is used
+ item->resume.prj_flags|=1;
+ }
+}
+
+static void SaveOnlyProject(void)
+{
+ fpstream *f=new fpstream(prjWin->getFileName(),CLY_IOSOut | CLY_IOSBin);
+
+ if (f)
+ {
+ // Update the information about the windows
+ ProjectList->forEach(UpdateResume,0);
+ // Save a signature to identify the file
+ f->writeString(Signature);
+ // Save the version & project
+ ushort wS=TScreen::getCols(), hS=TScreen::getRows();
+ *f << TEditorProjectWindow::Version << wS << hS << prjWin
+ << (char)ProjectList->getSortMode();
+ SDGInterfaceSaveData(f);
+ DebugSaveData(*f);
+ if (!f)
+ {
+ messageBox(__("Could not save the project."), mfOKButton | mfError);
+ ::remove(prjWin->getFileName());
+ }
+ else
+ f->close();
+ }
+ delete f;
+}
+
+static
+void HideDesktop(const char *s, int DesktopFilesOptions)
+{
+ // In UNIX the file name changes and we must have space for it.
+ char buf[PATH_MAX];
+ strcpy(buf,s);
+ if (DesktopFilesOptions & dstHide)
+ MakeFileHidden(buf);
+ else
+ // If we are creating a non-hidden file be sure we don't left a hidden
+ // one. That's possible under UNIX.
+ RemoveFileHidden(buf);
+}
+
+void SaveProject(void)
+{
+ int DesktopFilesOptions=GetDSTOptions();
+ int remove=0,makeBackUp=0;
+ char *s=0;
+
+ if (PrjExists())
+ {
+ SaveOnlyProject();
+ s=strdup(prjWin->getFileName());
+ if (s)
+ {
+ ReplaceExtension(s,DeskTopFileExt,ProjectFileExt);
+ remove=1;
+ }
+ }
+ if (!s)
+ {
+ if ((DesktopFilesOptions & dstCreate) || DstLoadedHere)
+ s=(char *)cDeskTopFileName;
+ else
+ {// When we use just one desktop file try to back-up it
+ makeBackUp=1;
+ s=ExpandHomeSave(cDeskTopFileName);
+ }
+ }
+ editorApp->saveDesktop(s,makeBackUp);
+ HideDesktop(s,DesktopFilesOptions);
+ if (remove)
+ free(s);
+}
+
+void SaveDesktopHere(void)
+{
+ editorApp->saveDesktop(cDeskTopFileName,0);
+ HideDesktop(cDeskTopFileName,GetDSTOptions());
+}
+
+static int HaveExtention(char *name)
+{
+ char *slash=strrchr(name,'/');
+ char *point=strrchr(name,'.');
+ if (slash)
+ return point && point>slash;
+ return point!=NULL;
+}
+
+inline
+int range(int val, int min, int max)
+{
+ if (val<min)
+ return min;
+ else
+ if (val>max)
+ return max;
+ else
+ return val;
+}
+
+void OpenProject(char *name, int preLoad)
+{
+ char *s,fname[PATH_MAX];
+
+ if (!name)
+ {
+ strcpy(fname,"*" ProjectFileExt);
+ if (GenericFileDialog(__("Open Project"),fname,0,hID_ProjectFiles)!=cmCancel)
+ {
+ if (!HaveExtention(fname))
+ strcat(fname,ProjectFileExt);
+ s=fname;
+ }
+ else
+ return;
+ }
+ else
+ {
+ strcpy(fname,name);
+ s=fname;
+ }
+
+ // The user could specify it without extension
+ int prjFound=edTestForFile(s);
+ if (!prjFound && !strstr(s,".epr")) // TODO: strstr isn't the best, .epr could be in a directory name
+ {
+ strcat(s,".epr");
+ prjFound=edTestForFile(s);
+ }
+ if (prjFound)
+ { // Load it
+ if (!preLoad) CloseProject(0);
+ ReplaceExtension(s,DeskTopFileExt,ProjectFileExt);
+ char *hidden=0;
+ Boolean loaded=False;
+ if (!edTestForFile(s))
+ {
+ hidden=MakeItHiddenName(s);
+ if (hidden)
+ {
+ if (edTestForFile(hidden))
+ loaded=TSetEditorApp::retrieveDesktop(editorApp,hidden,True,preLoad);
+ delete[] hidden;
+ }
+ }
+ else
+ loaded=TSetEditorApp::retrieveDesktop(editorApp,s,True,preLoad);
+ if (!loaded)
+ TSetEditorApp::loadEditorDesktop(0,0,0,preLoad);
+ if (preLoad)
+ return;
+ LoadProject(ReplaceExtension(s,ProjectFileExt,DeskTopFileExt));
+ }
+ else
+ { // Is a new one
+ if (preLoad)
+ {
+ TSetEditorApp::loadEditorDesktop(0,NULL,0,preLoad);
+ return;
+ }
+ CloseProject(1);
+ prjWin=new TDskWinPrj(s);
+ editorApp->SetTitle(__("Project: "),s);
+ }
+ if (prjWin && prjWin->window)
+ {
+ editorApp->deskTop->lock();
+ InsertInOrder(editorApp->deskTop,prjWin);
+ // prjWin coordinates correction
+ TPoint dS;
+ dS.x=TScreen::getCols()-prjWin->wS;
+ dS.y=TScreen::getRows()-prjWin->hS;
+ if (dS.x!=0 || dS.y!=0)
+ {
+ TRect r;
+ r=prjWin->view->getBounds();
+ r.a.y+=dS.y;
+ r.b.y+=dS.y;
+ r.b.x+=dS.x;
+ if (r.a.y<0) r.a.y=0;
+ if (r.a.x<0) r.a.x=0;
+ // Ensure the window is bigger than the minimum size.
+ TPoint minLim, maxLim;
+ prjWin->view->sizeLimits(minLim,maxLim);
+ r.b.x=r.a.x+range(r.b.x-r.a.x,minLim.x,maxLim.x);
+ r.b.y=r.a.y+range(r.b.y-r.a.y,minLim.y,maxLim.y);
+ // Set the new size
+ prjWin->view->changeBounds(r);
+ }
+ editorApp->deskTop->unlock();
+
+ TSetEditorApp::edHelper->addNonEditor(prjWin);
+ editorApp->enableCommand(cmeClosePrj);
+ editorApp->enableCommand(cmeSavePrj);
+ editorApp->enableCommand(cmeImportPrj);
+ editorApp->enableCommand(cmeExportPrj);
+ editorApp->enableCommand(cmeSDG);
+ editorApp->enableCommand(cmeSelWinPrj);
+ }
+ else
+ prjWin=NULL;
+}
+
+// It close a project and the dektop
+void CloseProject(int openDesktop)
+{
+ editorApp->disableCommand(cmeClosePrj);
+ editorApp->disableCommand(cmeSavePrj);
+ editorApp->disableCommand(cmeImportPrj);
+ editorApp->disableCommand(cmeExportPrj);
+ editorApp->disableCommand(cmeSDG);
+ editorApp->disableCommand(cmeSelWinPrj);
+ if (PrjExists())
+ {
+ // Save the actual state
+ SaveProject();
+ }
+ // Abort any debug session
+ // Note: The interactive cmeOpenPrj and cmeClosePrj asks for confirmation,
+ // shouldn't be a surprise ;-)
+ TSetEditorApp::DebugDeInitVars();
+ // Close all the DeskTop windows
+ CLY_destroy(TSetEditorApp::edHelper);
+ TSetEditorApp::edHelper=0;
+ prjWin=0;
+ if (GetAutoGenMode()==stfAutoCentral)
+ RemoveAutoGenerated();
+ // Load a desktop, but not a project
+ if (openDesktop)
+ TSetEditorApp::loadEditorDesktop(0);
+}
+
+
+// That's the interface with the SDG module.
+// These routines must provide the buffers with sources from the project
+
+static ccIndex CountFiles;
+static ccIndex CantFiles;
+
+char *DskPrjGetNextFile(int &l, int &MustBeDeleted, char *FileName)
+{
+ FILE *f;
+ char *buffer,*pos,*name;
+ TCEditWindow *ed;
+
+ if (CountFiles<CantFiles)
+ {
+ name=((PrjItem *)(ProjectList->at(CountFiles)))->name;
+ CountFiles++;
+ ed=IsAlreadyOnDesktop(name);
+ if (ed)
+ {
+ buffer=ed->editor->buffer;
+ l=ed->editor->bufLen;
+ MustBeDeleted=0;
+ }
+ else
+ {
+ // Read the file
+ f=fopen(name,"rt");
+ if (!f)
+ {
+ messageBox(mfOKButton | mfError,__("Failed to open the file %s"),name);
+ return NULL;
+ }
+
+ l=filelength(fileno(f))+1;
+ buffer=new char[l];
+ if (!buffer)
+ {
+ fclose(f);
+ return NULL;
+ }
+ fread(buffer,l,1,f);
+ buffer[l-1]=0;
+ fclose(f);
+ MustBeDeleted=1;
+ }
+
+ // Let just the filename
+ pos=strrchr(name,'/');
+ if (pos)
+ pos++;
+ else
+ pos=name;
+ strcpy(FileName,pos);
+ return buffer;
+ }
+ return NULL;
+}
+
+// Initialize the counter to 0
+// 1 if error
+int DskPrjSDGInit(void)
+{
+ if (PrjExists())
+ {
+ CountFiles=0;
+ CantFiles=ProjectList->getCount();
+ if (CantFiles)
+ return 0;
+ }
+ return 1;
+}
+
+int AskForProjectResume(EditorResume *r,char *fileName)
+{
+ ccIndex pos;
+
+ if (!fileName || !PrjExists())
+ return 0;
+ if (ProjectList->Search(fileName,pos))
+ {
+ EditorResume *p=&(((PrjItem *)(ProjectList->at(pos)))->resume);
+ if (p->prj_flags & 1)
+ {
+ CopyEditorResume(r,p);
+ return 4;
+ }
+ }
+ return 0;
+}
+
+void UpdateProjectResumeFor(char *fileName, TCEditWindow *p)
+{
+ ccIndex pos;
+
+ if (PrjExists() && ProjectList->Search(fileName,pos))
+ {
+ EditorResume &r=((PrjItem *)(ProjectList->at(pos)))->resume;
+ p->FillResume(r);
+ r.prj_flags|=1;
+ }
+}
+
+int IsPrjOpened()
+{
+ return PrjExists();
+}
+
+int IsPrjVisible()
+{
+ if (!PrjExists())
+ return 0;
+ return prjWin->view->state & sfVisible;
+}
+
+int IsPrjZoomed()
+{
+ if (!PrjExists())
+ return 0;
+ TRect dkt=TApplication::deskTop->getExtent();
+ TRect size=prjWin->window->getBounds();
+ return dkt==size;
+}
+
+struct FileTm
+{
+ FILE *f;
+ time_t t;
+ int c;
+ uint32 mask;
+};
+
+static
+void PrintName(void *p, void *data)
+{
+ FileTm *st=(FileTm *)data;
+ fprintf(st->f," \"%s\" ",((PrjItem *)p)->name);
+ st->c++;
+}
+
+static
+void PrintNameLine(void *p, void *data)
+{
+ FileTm *st=(FileTm *)data;
+ fprintf(st->f,"%s\n",((PrjItem *)p)->name);
+ st->c++;
+}
+
+static
+void PrintNameTm(void *pt, void *data)
+{
+ FileTm *st=(FileTm *)data;
+ PrjItem *p=(PrjItem *)pt;
+ struct stat stS;
+
+ if ((p->forceTarget & st->mask) ||
+ (stat(p->name,&stS)==0 && difftime(stS.st_mtime,st->t)>0.0))
+ {
+ fprintf(st->f,"%s\n",p->name);
+ st->c++;
+ }
+}
+
+static
+void ClearTargets(void *pt, void *data)
+{
+ FileTm *st=(FileTm *)data;
+ PrjItem *p=(PrjItem *)pt;
+ p->forceTarget&= ~st->mask;
+}
+
+static
+void SetTargets(void *pt, void *data)
+{
+ FileTm *st=(FileTm *)data;
+ PrjItem *p=(PrjItem *)pt;
+ p->forceTarget|=st->mask;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Writes all the names of the project items to the stream f. The names are
+separated by spaces.@p
+ Used by the Grep Interface.@p
+
+ Returns:
+ The number of names sent to the stream.
+
+***************************************************************************/
+
+int WriteNamesOfProjectTo(FILE *f, unsigned mode)
+{
+ struct FileTm st;
+ st.f=f;
+ st.c=0;
+ if (PrjExists() && ProjectList)
+ {
+ switch (mode)
+ {
+ case wnopEspaceSep:
+ ProjectList->forEach(PrintName,&st);
+ break;
+ case wnopLineSep:
+ ProjectList->forEach(PrintNameLine,&st);
+ break;
+ }
+ }
+ return st.c;
+}
+
+int WriteNamesOfProjectToTime(FILE *f, time_t timeT, uint32 targetMask)
+{
+ struct FileTm st;
+ st.f=f;
+ st.c=0;
+ st.t=timeT;
+ st.mask=targetMask;
+ if (PrjExists() && ProjectList)
+ ProjectList->forEach(PrintNameTm,&st);
+
+ return st.c;
+}
+
+int ClearForceTargetBits(uint32 bits)
+{
+ struct FileTm st;
+ st.c=0;
+ st.mask=bits;
+ if (PrjExists() && ProjectList)
+ ProjectList->forEach(ClearTargets,&st);
+
+ return st.c;
+}
+
+int SetForceTargetBits(uint32 bits)
+{
+ struct FileTm st;
+ st.c=0;
+ st.mask=bits;
+ if (PrjExists() && ProjectList)
+ ProjectList->forEach(SetTargets,&st);
+
+ return st.c;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Finds the file name of the project item indicated by @<var>{number}.
+
+ Return: A newly allocated string (using malloc) containing the name. An
+empty string on fail (also allocated).
+
+***************************************************************************/
+
+char *GetProjectItem(int number)
+{
+ if (!(PrjExists() && ProjectList) || number>=ProjectList->getCount())
+ return string_dup(NULL);
+
+ char *item=((PrjItem *)ProjectList->at(number))->name;
+ if (!CheckIfPathAbsolute(item) && ProjectList->referenceCurDelta)
+ {// The project was loaded from another directory, not curdir
+ return ProjectList->applyPrjPath(item);
+ }
+
+ return string_dup(item);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to know how many items contains the project.
+
+ Return: The number of items, 0 on fail.
+
+***************************************************************************/
+
+int GetMaxProjectItem()
+{
+ if (!(PrjExists() && ProjectList))
+ return 0;
+ return ProjectList->getCount();
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Offers a dialog to choose a file name and exports the project items to
+the selected file. One project item per line.
+
+***************************************************************************/
+
+void ExportProjectItems()
+{
+ if (!(PrjExists() && ProjectList))
+ return;
+ char buffer[PATH_MAX];
+ strcpy(buffer,"*.txt");
+
+ if (GenericFileDialog(__("Export project items"),buffer,0,
+ hID_ExportProjectItems,fdDialogForSave)==cmCancel)
+ return;
+
+ if (edTestForFile(buffer) &&
+ doEditDialogLocal(edFileExists,buffer,0)==cmNo)
+ return;
+
+ FILE *f=fopen(buffer,"wt");
+ if (!f)
+ {
+ TCEditor::editorDialog(edCreateError,buffer);
+ return;
+ }
+ WriteNamesOfProjectTo(f,wnopLineSep);
+ int err=ferror(f);
+ if (fclose(f) || err)
+ TCEditor::editorDialog(edWriteError,buffer,NULL);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Asks for a file to read project items. The items are only added, never
+removed and only if the referred file already exists. The routine uses the
+facilities to detect duplicated files. The files are added "as-is", relative
+files are preserved and absolute files are added absolute.
+
+***************************************************************************/
+
+void ImportProjectItems()
+{
+ if (!(PrjExists() && ProjectList))
+ return;
+ char buffer[PATH_MAX];
+ strcpy(buffer,"*.txt");
+
+ if (GenericFileDialog(__("Import project items"),buffer,0,
+ hID_ExportProjectItems,fdSelectButton)==cmCancel)
+ return;
+
+ unsigned rejected=0, repeated=0, added=0;
+ FILE *f=fopen(buffer,"rt");
+ if (!f)
+ {
+ messageBox(__("Unable to open file"),mfError | mfOKButton);
+ return;
+ }
+ while (!feof(f))
+ {
+ if (fgets(buffer,PATH_MAX,f))
+ {
+ char *s;
+ for (s=buffer; *s && *s!='\r' && *s!='\n'; s++);
+ *s=0;
+ char *dest=buffer;
+ if (!CheckIfPathAbsolute(buffer) && ProjectList->referenceCurDelta)
+ {// The project was loaded from another directory, not curdir
+ dest=ProjectList->applyPrjPath(buffer);
+ }
+ if (edTestForFile(dest))
+ {
+ ccIndex pos;
+ if (ProjectList->addFile(dest,pos))
+ added++;
+ else
+ repeated++;
+ }
+ else
+ rejected++;
+ if (dest!=buffer)
+ string_free(dest);
+ }
+ }
+ prjWin->window->list->setRange(ProjectList->getCount());
+ prjWin->window->list->drawView();
+ int err=ferror(f);
+ if (fclose(f) || err)
+ TCEditor::editorDialog(edReadError,buffer,NULL);
+
+ messageBox(mfInformation|mfOKButton,
+ __("Results: added %d, already included: %d, rejected %d"),
+ added,repeated,rejected);
+}
+
+void ProjectInsertAutoTagFiles()
+{
+ if (!ProjectList)
+ return;
+ if (ProjectList->referenceCurDelta)
+ {
+ char *s=ProjectList->applyPrjPath("tags");
+ InsertAutoGenerated(s);
+ string_free(s);
+ }
+ else
+ InsertAutoGenerated("tags");
+}
+
+Boolean ProjectGetSize(TRect &r)
+{
+ if (!prjWin)
+ return False;
+ TRect dkt=TApplication::deskTop->getExtent();
+ TRect size=prjWin->window->getBounds();
+ if (dkt==size)
+ r=prjWin->window->zoomRect;
+ else
+ r=size;
+ return True;
+}
+
+char *GetRelIfFileInPrj(char *name)
+{
+ if (!prjWin || !name)
+ return NULL;
+ ccIndex pos;
+ char *relName;
+ // :-P
+ ((TPrjItemColl *)prjWin->window->list->list())->addFile(name,pos,0,&relName);
+
+ return relName;
+}
+
+char *GetAbsForNameInPrj(const char *name)
+{
+ ccIndex pos;
+
+ if (PrjExists() && ProjectList->Search((char *)name,pos))
+ return ((PrjItem *)(ProjectList->at(pos)))->name;
+ return NULL;
+}
+
+void ProjectApplyToItems(ccAppFunc action, void *arg)
+{
+ if (PrjExists() && ProjectList)
+ ProjectList->forEach(action,arg);
+}
+
+void ProjectGetNameFromItem(void *p, char *dest, int size)
+{
+ PrjItem *st=(PrjItem *)p;
+
+ if (ProjectList->referenceCurDelta)
+ {// The project was loaded from another directory, not curdir
+ char *ori=ProjectList->applyPrjPath(st->name);
+ strncpyZ(dest,ori,size);
+ string_free(ori);
+ }
+ else
+ strncpyZ(dest,st->name,size);
+}
+
diff --git a/setedit/setedit/getctxhl.cc b/setedit/setedit/getctxhl.cc
new file mode 100644
index 0000000..9cfb47b
--- /dev/null
+++ b/setedit/setedit/getctxhl.cc
@@ -0,0 +1,275 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+#define Uses_TApplication
+#define Uses_TEvent
+#define Uses_TRect
+#define Uses_TDeskTop
+#define Uses_TCEditWindow
+#define Uses_TCEditor_Commands
+#define Uses_TVCodePage
+#define Uses_TScreen
+// InfView requests
+#include <infr.h>
+#include <ceditor.h>
+
+#define Uses_SETAppConst
+#define Uses_TSetEditorApp
+#include <setapp.h>
+
+#include <dskwin.h>
+#include <dskhelp.h>
+// Various help context
+#include <editcoma.h>
+// File Open dialog help context
+#include <fileopen.h>
+
+typedef struct
+{
+ int context;
+ char *file;
+ char *node;
+} helpNode;
+
+static char *EditorFile="setedit";
+
+#define He(a) { cme##a, EditorFile, #a }
+#define HHe(a,b) { cme##a, EditorFile, b }
+#define Hc(a) { cmc##a, EditorFile, #a }
+#define HHc(a,b) { cmc##a, EditorFile, b }
+#define HC(a) { hc##a, EditorFile, #a }
+#define HHC(a,b) { hc##a, EditorFile, b }
+
+static helpNode helpList[]=
+{
+ He(Open),
+ HHC(FileOpen,"Open"),
+ He(New),
+ //HHe(ChangeDrct,"Change directory"),
+ HHe(OpenROCopy,"Open Read-only copy"),
+ HHe(DosShell,"Shell"),
+ He(Calculator),
+ HC(Calculator),
+ HHe(ShowClip,"Show clipboard"),
+ He(InfView),
+ HHe(ListWin,"List"),
+ HHC(ListWin,"List"),
+ He(LastHelp),
+ HHe(UserScreen,"User Screen"),
+ HHe(AnotherInfView,"Another InfView"),
+ HHe(TipOfTheDay,"Tip of the day"),
+ HHe(SyntaxHelpOps,"Options (Syntax help)"),
+ HHe(SyntaxHelpFiles,"Files to search (Syntax help)"),
+ HHe(SyntaxHelp,"Search (Syntax help)"),
+ HHe(OpenPrj,"Open (Project)"),
+ HHe(ClosePrj,"Close (Project)"),
+ HHe(SavePrj,"Save (Project)"),
+ HHe(SaveDesktop,"Save desktop here"),
+ HHe(ExportPrj,"Export project"),
+ HHe(ImportPrj,"Import project items"),
+ He(SDG),
+ HHe(SDGDialog,"SDG Options"),
+ HHe(SetColors,"Customize Colors"),
+ HHe(DeleteBkps,"Delete memorized backups"),
+ HHe(QuitDelete,"Quit"),
+ HHe(Quit,"Exit"),
+ HHe(Resize,"Size/move"),
+ He(Zoom),
+ He(Tile),
+ He(Cascade),
+ HHe(Next,"Next (Window)"),
+ HHe(Prev,"Previous (Window)"),
+ He(Close),
+ HHe(EditKeyBind,"Key assignment"),
+ He(LoadKeyScans),
+ HHe(SetUpAltKeys,"Setup Alt keys"),
+ HHe(KeyPadBehavior,"Key pad behavior"),
+ HHe(KbBackDefault,"Back to defaults"),
+ HHe(SeeScanCodes,"Consult scan codes"),
+ HHe(PrintEditor,"Print"),
+ HHe(SetUpPrinter,"Print Setup"),
+ HHe(GrepDialog,"Grep"),
+ HHe(HTMLAccents,"Convert accents to tags"),
+ HHe(HTMLTag2Accent,"Convert tags to accents"),
+ HHe(ExportAsHTML,"Export as HTML"),
+ HHc(InsertKeyName,"Insert key name"),
+ HHe(RemapCodePage,"Remap code page"),
+ HHe(ReDraw,"Redraw screen"),
+ HHc(QuotedPrintDecode,"Block quoted printable decode"),
+ HHc(IndentBlkOne,"Indent one space"),
+ HHc(UnIndentBlkOne,"Unindent one character"),
+ HHc(IndentBlk,"Indent one tab or gap"),
+ HHc(UnIndentBlk,"Unindent one tab or gap"),
+ HHc(CommentIndent,"Comment indent"),
+ HHc(CommentUnIndent,"Comment unindent"),
+ HHc(ArbitraryIndent,"Arbitrary indent"),
+ He(NextMessage),
+ He(PrevMessage),
+ HHe(SetScreenOps,"Screen Options"),
+ HHe(Encodings,"Encodings"),
+ HHe(Fonts,"Fonts"),
+ HHe(EditUserWords,"User Words"),
+ HHe(EditDeflOpts,"Default global edition"),
+ HHe(EditPalette,"Color Palette"),
+ HHe(ColorTheme,"Color Theme"),
+ HHe(EdGralOptions,"Editor General"),
+ HHe(SetModiCkOps,"Check for modified files"),
+ HHe(ScreenSaverOpts,"Screen Saver"),
+ HHe(FileOpenOptions,"Sort of the files and directories in the dialog"),
+ HHe(EditNoBkp,"Do not create backups for"),
+ HHe(IncludeList,"Search files under cursor in"),
+ HHe(TagFiles,"List of tag files"),
+ HHe(TagsOps,"Tag files options"),
+ HHe(HolidaysConf,"Calendar options"),
+ HHe(AdviceDiagConf,"Advice dialogs"),
+ HHe(RunCommand,"Run program"),
+ HHe(ConfRunCommand,"Run program (which one)"),
+ Hc(Save),
+ HHC(FileSave,"Save as"),
+ HHc(SaveAs,"Save as"),
+ HHc(SaveAsConvertEOL,"Save as UNIX or DOS"),
+ HHc(SaveAsNoConvertEOL,"Save as DOS or UNIX"),
+ HHc(SaveSameTime,"Save with same time"),
+ HHe(SaveAll,"Save all"),
+ Hc(Undo),
+ Hc(Redo),
+ Hc(Cut),
+ Hc(Copy),
+ Hc(Paste),
+ Hc(Clear),
+ HHc(SetLocalOptions,"Set Local"),
+ HHc(SetGlobalOptions,"Set Global"),
+ HHc(ExpandAllTabs,"Expand all tabs"),
+ HHc(CompactBuffer,"Compact text"),
+ HHc(PushCursorPos,"Push cursor position"),
+ HHc(PopCursorPos,"Pop cursor position"),
+ HHc(ToUpper,"Block to upper"),
+ HHc(ToLower,"Block to lower"),
+ HHc(ToggleCharCase,"Character toggle"),
+ HHc(InvertCase,"Block invert"),
+ HHc(AltCase,"Block alternate"),
+ HHc(JumpToFunction,"Jump to function"),
+ HHc(JumpToPrototype,"Jump to prototype"),
+ HHe(SearchTag,"Jump to symbol"),
+ HHc(GotoEditorLine,"Go to line"),
+ HHe(ClassBrowser,"Class browser"),
+ HHe(WordCompletion,"Word completion"),
+ HHc(CopyClipWin,"Copy to Windows Clipboard"),
+ HHc(PasteClipWin,"Paste from Windows Clipboard"),
+ HHc(CopyClipFile,"Copy to file Clipboard"),
+ HHc(PasteClipFile,"Paste from file Clipboard"),
+ HHc(RecordMacro,"Record (Macro)"),
+ HHc(StopMacro,"Stop (Macro)"),
+ HHc(PlayMacro,"Play (Macro)"),
+ HHc(ChooseMacro,"Choose (Macro)"),
+ HHc(RepeatMacro,"Repeat (Macro)"),
+ HHc(GenCodeForMacro,"Generate Code"),
+ HHc(ChoosePMacrosList,"Pseudo Macro (menu)"),
+ Hc(Find),
+ Hc(Replace),
+ HHc(SearchAgain,"Search again"),
+ HHc(SelRectStart,"Start (Rectangle)"),
+ HHc(SelRectEnd,"End (Rectangle)"),
+ HHc(SelRectHide,"Hide (Rectangle)"),
+ HHc(SelRectCopy,"Copy (Rectangle)"),
+ HHc(SelRectPaste,"Paste (Rectangle)"),
+ HHc(SelRectCut,"Cut (Rectangle)"),
+ HHc(SelRectDel,"Clear (Rectangle)"),
+ HHc(SelRectMove,"Move (Rectangle)"),
+ HHc(ProfileEditor,"Profile Editor"),
+ HHc(InsertNewLine,"Insert new line (do not move)"),
+ HHC(OpenInfo,"File Open"),
+ HHC(SaveBlock,"File Open"),
+ HHC(ConfigFiles,"File Open"),
+ HHC(OpenMP3,"File Open"),
+ HHC(SaveMP3,"File Open"),
+ HHC(GenOpenFile,"File Open"),
+ HHC(ProjectFiles,"Project"),
+ HHC(GenChDir,"Change directory"),
+ HHC(RegExOptions,"Regular Expressions Options"),
+ HHC(EditKeys,"How to configure the keyboard"),
+ HHC(EditKeysSeq,"How to configure the keyboard"),
+ HHC(EditKeysMac,"Assigning a sLisp macro"),
+ HHC(EditKeysCom,"Assigning a sequence of commands"),
+ HHC(EditorProjectWindow,"Project"),
+ // Debug
+ HHe(Breakpoint,"Breakpoints"),
+ HHe(DebugOptions,"Debug options"),
+ HHe(DbgRunContinue,"Running the program to debug"),
+ HHe(DbgStepOver,"Step over"),
+ HHe(DbgTraceInto,"Trace into"),
+ HHe(DbgGoToCursor,"Executing until cursor position is reached"),
+ HHe(DbgFinishFun,"Executing until return"),
+ HHe(DbgReturnNow,"Returning immediatly"),
+ HHe(DbgStop,"Stopping the program you are debugging"),
+ HHe(DbgKill,"Killing the program you are debugging"),
+ HHe(DbgCallStack,"Examining the calling stack"),
+ HHe(DbgEvalModify,"Evaluate or Modify expression"),
+ HHe(DbgOptsMsgs,"Messages displayed"),
+ HHe(DbgWatchExpNorm,"Watch an expression"),
+ HHe(DbgWatchExpScp,"Watch an expression with scope"),
+ HHe(DbgEditWatchPts,"Watchpoints"),
+ HHe(DbgInspector,"Inspectors"),
+ HHe(DbgEndSession,"Destroying the debug session"),
+ HHe(DbgCloseSession,"Closing the debug session"),
+ HHe(DbgGoConnected,"Going to the connected debug state"),
+ HHe(DbgGoReadyToRun,"Going to the ready to run debug state"),
+ HHe(DbgEditBreakPts,"Advanced breakpoint options"),
+ HHe(DbgDataWindow,"Data Window"),
+ HHe(DbgStackWindow,"Stack Window"),
+ HHe(DbgCleanElem,"Cleaning the debug session"),
+ HHe(DbgThreadSel,"Selecting the thread to debug"),
+ HHe(DbgOptionsAdv,"Advanced debug options"),
+ HHe(DbgDisAsmWin,"Disassembler Window"),
+ HHe(DbgDetach,"Debugging already running processes"),
+ HHe(SourceList,"Path for sources"),
+ HHC(DebugMsgWin,"Debug Messages Window"),
+ HHC(WatchesWin,"Watch an expression"),
+ HHC(WatchesWinEdit,"Editing a debug expression"),
+ HHC(EditBkpt,"Advanced breakpoint options"),
+ HHC(EditWp,"Watchpoints"),
+ HHC(BkptDialog,"Advanced breakpoint options"),
+ HHC(WpDialog,"Watchpoints"),
+ HHC(Inspector,"Inspectors"),
+ HHC(DataViewer,"Data Window"),
+ HHC(Disassembler,"Disassembler Window"),
+ HHC(SourceLoc,"Path for sources"),
+ HHC(DebugAdvOps,"Advanced debug options"),
+ HHC(DebugOps,"Debug options"),
+ { 0,EditorFile,""}
+};
+
+void TSetEditorApp::GetContextHelp(void)
+{
+ //fprintf(stderr,"%d\n",helpCtxRequested);
+ helpRequest=0;
+
+ int i=0;
+ while (helpList[i].context && helpList[i].context!=helpCtxRequested)
+ {
+ i++;
+ }
+
+ ShowHelpTopic(helpList[i].file,helpList[i].node);
+}
+
+void TSetEditorApp::ShowHelpTopic(char *file, char *node)
+{
+ TView *v=TProgram::deskTop->current;
+ if (v && (v->state & sfModal))
+ // When the help is called from a modal window we can't simply
+ // show the InfView because it won't get the events. Executing
+ // a modal help is the solution.
+ InfManager->CreateModal(file,node);
+ else
+ {
+ InfManager->Goto(file,node);
+ InfManager->MakeVisible();
+ }
+}
+
+// That's just a wrapper to avoid including a lot of things in other modules
+void ShowHelpTopic(char *file, char *node)
+{
+ editorApp->ShowHelpTopic(file,node);
+}
diff --git a/setedit/setedit/holidays.cc b/setedit/setedit/holidays.cc
new file mode 100644
index 0000000..8b8c5df
--- /dev/null
+++ b/setedit/setedit/holidays.cc
@@ -0,0 +1,351 @@
+/* Copyright (C) 2003-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Holidays
+ Description:
+ This modules handles the holidays plug-ins to mark the holidays in the
+calendar.
+
+***************************************************************************/
+
+#include <ceditint.h>
+#define Uses_stdio
+#define Uses_ctype
+#define Uses_stdlib
+#define Uses_string
+#define Uses_snprintf
+#define Uses_AllocLocal
+
+#define Uses_TProgram
+#define Uses_MsgBox
+
+#define Uses_TSLabelCheck
+#define Uses_TSRadioButtons
+#define Uses_TSVeGroup
+#define Uses_TSButton
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <tv.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#include <setapp.h>
+
+#include <editcoma.h>
+#include <edspecs.h>
+#include <datetools.h>
+
+#ifdef HAVE_DL_LIB
+ #define HolidaysOn 1
+ #include DL_HEADER_NAME
+#else
+ // This makes the code more maintainable and ensures the code will work if
+ // a compiler that didn't support it starts doing it.
+ // The optimizer should remove unreachable code.
+ #define HolidaysOn 0
+ extern char *dlerror();
+ extern void *dlopen(char *b, int flags);
+ extern void *dlsym(void *, const char *);
+ extern void dlclose(void *);
+ const int RTLD_NOW=0, RTLD_GLOBAL=0;
+ #if defined(SEComp_BCPP) || defined(SEComp_MSC)
+ // BC++ 5.5 is just crap in terms of optimization. It can't even see
+ // unreachable code like if (0) { dlopen() }
+ // MSVC: It knows how to remove it, but fails to do it if optimizations are
+ // disabled. It looks like it disables this optimization when people selects
+ // the "debug" mode.
+ char *dlerror() { return NULL; }
+ void *dlopen(char *, int ) { return NULL; }
+ void *dlsym(void *, const char *) { return NULL; }
+ void dlclose(void *) {};
+ #endif
+#endif
+
+#define DEBUG 0
+
+static char plugInLoaded=0;
+static char holidaysConfLoaded=0;
+static struct dayMonth *(*getlist)(int , int *);
+static int numCountries;
+static int lastError=0;
+static int numUsedCountry;
+
+const int maxLine=120;
+struct countryEntry
+{
+ char *lang;
+ char *country;
+ char *module;
+};
+static countryEntry *countries;
+static void *dlhDateTools;
+static void *dlhPlugIn;
+
+const char *holidaysConf="holidays.conf";
+const char *defHolidaysSo="defholidays.so";
+const char *exportedFunction="GetListOfHolidays";
+const char *dateToolsSo="datetools.so";
+const char *confVar="SET_FORCED_LANG";
+
+static
+const char *LookUpCountry(const char *lang, char *buffer, char *name)
+{
+ if (!HolidaysOn)
+ return NULL;
+ int i;
+ if (!holidaysConfLoaded)
+ {
+ char b[maxLine];
+ strcpy(name,holidaysConf);
+ FILE *f=fopen(buffer,"rt");
+ if (f)
+ {
+ if (fscanf(f,"%d\n",&numCountries)==1)
+ {
+ countries=new countryEntry[numCountries];
+ memset(countries,0,sizeof(countryEntry)*numCountries);
+ for (i=0; i<numCountries; i++)
+ {
+ fgets(b,maxLine,f);
+ char *s=b;
+ for (;*s && !ucisspace(*s); s++);
+ if (*s)
+ {
+ *s=0; s++;
+ countries[i].lang=newStr(b);
+ for (; *s && *s!='"'; s++);
+ if (*s=='"')
+ {
+ s++;
+ char *e;
+ for (e=s; *e && *e!='"'; e++);
+ if (*e=='"')
+ {
+ *e=0;
+ countries[i].country=newStr(s);
+ for (s=e+1; *s && ucisspace(*s); s++);
+ if (*s)
+ {
+ for (e=s+1; *e && !ucisspace(*e); e++);
+ *e=0;
+ countries[i].module=newStr(s);
+ }
+ }
+ }
+ }
+ if (DEBUG)
+ printf("%s %s %s\n",countries[i].lang,countries[i].country,
+ countries[i].module);
+ }
+ }
+ fclose(f);
+ holidaysConfLoaded=1;
+ }
+ }
+ if (holidaysConfLoaded)
+ {
+ numUsedCountry=0;
+ if (!lang)
+ lang="*";
+ for (numUsedCountry=0; numUsedCountry<numCountries; numUsedCountry++)
+ if (countries[numUsedCountry].lang && countries[numUsedCountry].module &&
+ strcmp(countries[numUsedCountry].lang,lang)==0)
+ return countries[numUsedCountry].module;
+ numUsedCountry--;
+ if (countries[numUsedCountry].module)
+ return countries[numUsedCountry].module;
+ }
+ return defHolidaysSo;
+}
+
+char *HolidaysGetLastError()
+{
+ if (!HolidaysOn)
+ return NULL;
+ switch (lastError)
+ {
+ case 1:
+ return TVIntl::getTextNew(__("Can't find plug-ins directory"));
+ case 2:
+ case 3:
+ case 4:
+ return newStr(dlerror());
+ }
+ return NULL;
+}
+
+static
+int LoadPlugIn()
+{
+ if (!HolidaysOn || plugInLoaded)
+ return 0;
+
+ char *dlpath=getenv("SET_LIBS");
+ if (!dlpath)
+ return lastError=1;
+
+ int l=strlen(dlpath);
+ AllocLocalStr(b,l+2+12);
+ memcpy(b,dlpath,l+1);
+ if (!CLY_IsValidDirSep(dlpath[l-1]))
+ {
+ b[l++]=DIRSEPARATOR;
+ b[l]=0;
+ }
+ char *name=b+l;
+
+ strcpy(name,dateToolsSo);
+ dlhDateTools=dlopen(b,RTLD_NOW | RTLD_GLOBAL);
+ if (!dlhDateTools)
+ return lastError=2;
+
+ const char *country;
+ const char *forcedCountry=GetVariable(confVar);
+ // Determine which one
+ country=LookUpCountry(forcedCountry ? forcedCountry : getenv("LANG"),
+ b,name);
+
+ if (DEBUG)
+ printf("Country: %s\n",country);
+ strcpy(name,country);
+ dlhPlugIn=dlopen(b,RTLD_NOW);
+ if (!dlhPlugIn)
+ return lastError=3;
+ getlist=(dayMonth *(*)(int , int *))dlsym(dlhPlugIn,exportedFunction);
+ if (!getlist)
+ return lastError=4;
+ plugInLoaded=1;
+
+ return 0;
+}
+
+static
+void UnloadPlugIn()
+{
+ if (!HolidaysOn || !plugInLoaded)
+ return;
+
+ dlclose(dlhPlugIn);
+ dlclose(dlhDateTools);
+ plugInLoaded=0;
+}
+
+struct dayMonth *GetHolidays(int year, int &cant)
+{
+ if (!HolidaysOn || LoadPlugIn())
+ return NULL;
+
+ dayMonth *listOfHolidays=getlist(year,&cant);
+ if (DEBUG)
+ {
+ int i;
+ printf("%d\n\n",cant);
+ for (i=0; i<cant; i++)
+ printf("%d/%d %s\n",listOfHolidays[i].day,listOfHolidays[i].month,
+ listOfHolidays[i].description);
+ }
+
+ return listOfHolidays;
+}
+
+void CleanUpHolidays()
+{
+ if (!HolidaysOn)
+ return;
+
+ UnloadPlugIn();
+ if (countries)
+ {
+ for (int i=0; i<numCountries; i++)
+ {
+ delete[] countries[i].lang;
+ delete[] countries[i].country;
+ delete[] countries[i].module;
+ }
+ delete[] countries;
+ countries=NULL;
+ holidaysConfLoaded=0;
+ }
+}
+
+static
+void BroadcastChange()
+{
+ if (!HolidaysOn)
+ return;
+
+ message(TProgram::application,evBroadcast,cmCalendarPlugIn,0);
+ if (DEBUG)
+ printf("Broadcast\n");
+}
+
+void ConfigureHolidays()
+{
+ if (!HolidaysOn)
+ {
+ messageBox(__("Holidays plug-ins not supported. Sorry."),mfError|mfOKButton);
+ return;
+ }
+
+ LoadPlugIn();
+ if (!holidaysConfLoaded)
+ {
+ messageBox(__("Failed to load holidays.conf"),mfError|mfOKButton);
+ return;
+ }
+
+ TSViewCol *col=new TSViewCol(__("Holidays country"));
+
+ TSItem *first=0,*last=0,*aux;
+ char b[48];
+ int i;
+ for (i=0; i<numCountries; i++)
+ {
+ CLY_snprintf(b,48,"%-24s %-6s",countries[i].country,countries[i].lang);
+ aux=new TSItem(b,0);
+ if (!first)
+ first=aux;
+ if (last)
+ last->next=aux;
+ last=aux;
+ }
+
+ col->insert(xTSCenter,yTSUp,
+ MakeVeGroup(tsveMakeSameW,TSLabelCheck(__("Country"),__("Force country"),0),
+ new TSRadioButtons(first),0));
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doItCenter(cmeHolidaysConf);
+ delete col;
+ struct
+ {
+ uint32 force;
+ uint32 country;
+ } box;
+ const char *forcedCountry=GetVariable(confVar);
+ box.force=forcedCountry ? 1 : 0;
+ box.country=numUsedCountry;
+ if (execDialog(d,&box)==cmOK)
+ {
+ if (box.force && !forcedCountry)
+ {
+ UnloadPlugIn();
+ numUsedCountry=box.country;
+ InsertEnvironmentVar(confVar,countries[numUsedCountry].lang);
+ if (DEBUG)
+ printf("Forced: %s\n",countries[numUsedCountry].lang);
+ BroadcastChange();
+ }
+ else if (!box.force && forcedCountry)
+ {
+ UnloadPlugIn();
+ InsertEnvironmentVar(confVar,NULL);
+ BroadcastChange();
+ }
+ }
+}
+
diff --git a/setedit/setedit/include/advice.h b/setedit/setedit/include/advice.h
new file mode 100644
index 0000000..e68dda3
--- /dev/null
+++ b/setedit/setedit/include/advice.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+const int
+gadvUserScreen =0,
+gadvAbsolutePath=1,
+gadvDeleteFile0 =2,
+gadvFOShiftCase =3,
+gadvFOShFuzzy =4,
+gadvFOShiftDirs =5,
+gadvTabsOps =6,
+gadvTagsOld =7,
+gadvNoTags =8,
+gadvDiffModOpts =9,
+gadvDbgNoPrj =10,
+gadvDbgDestSes =11,
+gadvDbgSesActive=12,
+gadvDbgKillPrg =13,
+gadvDbgLinuxTTY =14,
+gadvGPG =15;
+
+int GiveAdvice(int number);
+void AdviceManager();
diff --git a/setedit/setedit/include/ascii.h b/setedit/setedit/include/ascii.h
new file mode 100644
index 0000000..bd6ed3b
--- /dev/null
+++ b/setedit/setedit/include/ascii.h
@@ -0,0 +1,44 @@
+/*-------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Ascii.h: Header file for Ascii.cpp */
+/*-------------------------------------------------------*/
+
+#if !defined( __ASCII_H )
+#define __ASCII_H
+
+const int cmAsciiTableCmdBase = 590;
+const int cmCharFocused = 0;
+
+
+class TTable : public TView
+{
+public:
+ TTable( TRect& r );
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+ void charFocused();
+
+};
+
+
+class TReport : public TView
+{
+public:
+ TReport( TRect& r );
+ virtual void draw();
+ virtual void handleEvent( TEvent& event );
+
+private:
+ unsigned char asciiChar;
+};
+
+class TAsciiChart : public TWindow
+{
+public:
+ TAsciiChart();
+};
+
+#endif // __ASCII_H
diff --git a/setedit/setedit/include/calendar.h b/setedit/setedit/include/calendar.h
new file mode 100644
index 0000000..2d9da73
--- /dev/null
+++ b/setedit/setedit/include/calendar.h
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/* Calendar.h: Header file for Calendar.cpp */
+/*-------------------------------------------------------*/
+
+/* Modified by Salvador E. Tropea (SET) for SETEdit */
+
+#if !defined( __CALENDAR_H )
+#define __CALENDAR_H
+
+class TCalendarView : public TView
+{
+
+public:
+
+ TCalendarView(TRect & r);
+ ~TCalendarView();
+ virtual void handleEvent(TEvent& event);
+ virtual void draw();
+ char *getMonthStr(char *buffer, int size, int addArrows);
+
+ static char upArrowChar;
+ static char oupArrowChar;
+ static char downArrowChar;
+ static char odownArrowChar;
+
+private:
+
+ void updateYear();
+ Boolean isHoliday(int day, int month);
+ unsigned days, month, year;
+ unsigned curDay, curMonth, curYear;
+ stTVIntl *cNDays;
+ // Holidays
+ struct dayMonth *listOfHolidays;
+ int numOfHolidays;
+};
+
+class TCalendarWindow : public TWindow
+{
+public:
+ TCalendarWindow();
+ TCalendarView *view;
+ virtual void handleEvent(TEvent& event);
+};
+
+#endif // __CALENDAR_H
diff --git a/setedit/setedit/include/codepage.h b/setedit/setedit/include/codepage.h
new file mode 100644
index 0000000..998cd9a
--- /dev/null
+++ b/setedit/setedit/include/codepage.h
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TStringCollection;
+extern void RemapCharactersFor(int id);
+void RemapStringCodePage(uchar *n, uchar *o, ushort *map);
+void RemapNStringCodePage(uchar *n, uchar *o, ushort *map, int len);
+#ifdef Uses_fpstream
+void SaveConvCPOptions(fpstream& s);
+void LoadConvCPOptions(fpstream& s);
+#endif
+
+//const unsigned rbgDontRemapLow32=1, rbgOnlySelected=2;
diff --git a/setedit/setedit/include/debug.h b/setedit/setedit/include/debug.h
new file mode 100644
index 0000000..305165c
--- /dev/null
+++ b/setedit/setedit/include/debug.h
@@ -0,0 +1,251 @@
+/* Copyright (C) 2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+int DBG_SetBreakpoint(const char *source, int line);
+int DBG_RemoveBreakpoint(const char *source, int line);
+void DBG_SetCallBacks();
+void DBG_ReleaseMemory();
+void DBG_ApplyBkpts();
+void DBG_RefreshIgnoreBkpts();
+void DBG_ApplyWpts();
+void DBG_AddPathForSources(const char *path);
+
+class TDebugMsgDialog;
+class TWatchesDialog;
+struct mi_frames_struct;
+
+// Debug Status and Messages Window
+TDebugMsgDialog *DebugMsgInit(Boolean hide=True, int ZOrder=-1);
+TWatchesDialog *WatchesInit(Boolean hide=False, int ZOrder=-1);
+void DebugMsgDeInit();
+void WatchesDeInit();
+void DebugMsgClose();
+void WatchesClose();
+void DebugMsgAdd(char *msg);
+void DebugMsgClear();
+void DebugMsgUpdate(unsigned options=0);
+void DebugMsgSetState();
+void DebugMsgSetMode(Boolean select=False);
+void DebugMsgSetError();
+void DebugMsgSetStopped();
+int DebugMsgJumpToFrame(mi_frames_struct *f, char *msg, int l=0);
+int DebugMsgFillReason(mi_frames_struct *f, char *b, Boolean stop);
+int DebugGetErrorSt();
+void DebugClearCPULine();
+void DebugSetCPULine(int line, char *file);
+void DebugUpdateWatches();
+const char *DebugMsgStateName();
+void DebugSaveData(opstream &os);
+void DebugReadData(ipstream &is);
+int DebugConfirmEndSession();
+
+// Configuration dialog
+void DebugOptionsEdit();
+
+#if defined(Uses_TBreakpoints) && !defined(TBreakpoints_Defined)
+#define TBreakpoints_Defined
+class TBreakpoints : public TStringable
+{
+public:
+ TBreakpoints() :
+ TStringable() {}
+ ~TBreakpoints();
+
+ virtual unsigned GetCount() { return count; };
+ virtual void getText(char *dest, unsigned item, int maxLen);
+
+ static void add(mi_bkpt *);
+ static void remove(mi_bkpt *b);
+ static int set(const char *source, int line);
+ static int unset(const char *source, int line);
+ static mi_bkpt *search(const char *source, int line);
+ static void apply();
+ static void refreshIgnore();
+ static void refreshBinRef();
+ static mi_bkpt *getItem(int num);
+ static void releaseAll();
+ static void replace(mi_bkpt *old, mi_bkpt *n);
+
+ static void save(opstream &os);
+ static void load(ipstream &is);
+
+protected:
+ static mi_bkpt *first, *last;
+ static int count;
+ static stTVIntl *icNone;
+
+ static void updateAbs(mi_bkpt *b);
+
+ friend class TDiagBrk;
+};
+#endif // Uses_TBreakpoints
+
+#if defined(Uses_TWatchpoints) && !defined(TWatchpoints_Defined)
+#define TWatchpoints_Defined
+class TWatchpoints : public TStringable
+{
+public:
+ TWatchpoints() :
+ TStringable() {}
+ ~TWatchpoints();
+
+ virtual unsigned GetCount() { return count; };
+ virtual void getText(char *dest, unsigned item, int maxLen);
+
+ static void add(mi_wp *);
+ static void remove(mi_wp *b);
+ static void apply();
+ static mi_wp *getItem(int num);
+ static void releaseAll();
+ static void replace(mi_wp *old, mi_wp *n);
+ static int unset(int num);
+ static mi_wp *search(int num);
+
+ static void save(opstream &os);
+ static void load(ipstream &is, char version);
+
+protected:
+ static mi_wp *first, *last;
+ static int count;
+
+ friend class TDiagWp;
+};
+#endif // Uses_TWatchpoints
+
+#if defined(Uses_TDisAsmWin) && !defined(TDisAsmWin_Defined)
+#define TDisAsmWin_Defined
+struct stAdd2Line
+{
+ void *addr;
+ int line;
+ mi_asm_insns *sourceL;
+ mi_asm_insn *asmL;
+};
+
+class TAdd2Line : public TNSSortedCollection
+{
+public:
+ TAdd2Line() : TNSSortedCollection(50,50) { byLine=0; };
+
+ void insert(void *addr, int line, mi_asm_insns *sl, mi_asm_insn *al);
+ stAdd2Line *At(ccIndex pos) { return (stAdd2Line *)at(pos); };
+ Boolean searchL(int line, ccIndex &pos);
+
+ virtual void *keyOf(void *item);
+ virtual int compare(void *s1, void *s2);
+ virtual void freeItem(void *s);
+
+protected:
+ int byLine;
+};
+
+class TRegisters : public TStringable
+{
+public:
+ TRegisters(mi_chg_reg *aRegs, int cRegs);
+ ~TRegisters();
+
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ mi_chg_reg *getItem(int index);
+ int update();
+
+protected:
+ mi_chg_reg *regs;
+};
+
+#define cpDisAsmEd \
+ "\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C"\
+ "\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38"\
+ "\x39\x3A\x3B\x3C\x3D\x3E"
+
+class TDisAsmEdWin : public TCEditWindow
+{
+public:
+ TDisAsmEdWin(const TRect &aR);
+ ~TDisAsmEdWin();
+
+ virtual TPalette &getPalette() const;
+ virtual const char *getTitle(short);
+
+ int jumpToFrame(mi_frames *f);
+ char *getFileLine(int &line)
+ {
+ if (!curLine)
+ return NULL;
+ line=curLine->line;
+ return curLine->file;
+ }
+ char *getCodeInfo(char *b, int l);
+ void *getFrom() { return from; }
+ void *getTo() { return to; }
+ int runToCursor();
+
+protected:
+ mi_asm_insns *lines;
+ TAdd2Line *a2l;
+ void *from, *to;
+ TSpCollection *spLine;
+ mi_asm_insns *curLine;
+
+ void setCode(mi_asm_insns *aLines);
+ int dissasembleFrame(mi_frames *f);
+};
+
+// Hack: An editor inside a dialog needs a special palette:
+#define cpDisAsmWin \
+ /* TDialog palette */ \
+ "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"\
+ "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F"\
+ /* TCEditWindow palette */ \
+ "\x08\x09\x0A\x0B\x0C\x40\x41\x42\x43\x44\x45\x46"\
+ "\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x76"\
+ "\x77\x78\x79\x7A\x7B\x7C"
+
+class TDisAsmWin : public TDialog
+{
+public:
+ TDisAsmWin(const TRect &aR);
+ ~TDisAsmWin();
+
+ virtual TPalette &getPalette() const;
+ virtual void close(void);
+ virtual void handleEvent(TEvent &);
+
+ static int windowCreated() { return theDisAsmWin!=NULL; }
+ static void beSelected() { theDisAsmWin->select(); }
+ static int jumpToFrame(mi_frames *f)
+ {
+ int ret=theDisAsmWin->edw->jumpToFrame(f);
+ if (theDisAsmWin->regs && theDisAsmWin->regs->update())
+ theDisAsmWin->bRegs->drawView();
+ return ret;
+ }
+ static int isDisAsmWinCurrent()
+ { return theDisAsmWin && TProgram::deskTop->current==theDisAsmWin; }
+ static int isDisAsmWinAvailable()
+ { return theDisAsmWin!=NULL; }
+ static char *getFileLine(int &line)
+ { return theDisAsmWin->edw->getFileLine(line); }
+ static void updateCodeInfo()
+ { if (theDisAsmWin) theDisAsmWin->upCodeInfo(); }
+ static void *getFrom()
+ { return theDisAsmWin ? theDisAsmWin->edw->getFrom() : NULL; }
+ static void *getTo()
+ { return theDisAsmWin ? theDisAsmWin->edw->getTo() : NULL; }
+ static int runToCursor()
+ { return theDisAsmWin->edw->runToCursor(); }
+
+protected:
+ static TDisAsmWin *theDisAsmWin;
+ TDisAsmEdWin *edw;
+ TNoStaticText *codeInfo;
+ TStringableListBox *bRegs;
+ TRegisters *regs;
+
+ int codeInfoLine;
+ void upCodeInfo();
+};
+
+TDisAsmWin *TDisAsmWin::theDisAsmWin=NULL;
+#endif // Uses_TDisAsmWin
+
diff --git a/setedit/setedit/include/dskascii.h b/setedit/setedit/include/dskascii.h
new file mode 100644
index 0000000..f8eede6
--- /dev/null
+++ b/setedit/setedit/include/dskascii.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+class TDskWinASCII : public TDskWin
+{
+public:
+
+ TDskWinASCII();
+ ~TDskWinASCII();
+
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktASCII) && p==(void *)view; };
+
+ void write(opstream& os);
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinASCII( StreamableInit ) { type=dktASCII; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinASCII& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinASCII*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinASCII& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinASCII* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskcalen.h b/setedit/setedit/include/dskcalen.h
new file mode 100644
index 0000000..b618abc
--- /dev/null
+++ b/setedit/setedit/include/dskcalen.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+class TDskWinCalendar : public TDskWin
+{
+public:
+
+ TDskWinCalendar();
+ ~TDskWinCalendar();
+
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktCalendar) && p==(void *)view; };
+
+ void write(opstream& os);
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinCalendar( StreamableInit ) { type=dktCalendar; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinCalendar& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinCalendar*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinCalendar& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinCalendar* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskclip.h b/setedit/setedit/include/dskclip.h
new file mode 100644
index 0000000..b5bf728
--- /dev/null
+++ b/setedit/setedit/include/dskclip.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TDskWinClipboard : public TDskWin
+{
+public:
+
+ TDskWinClipboard(TCEditWindow *edw);
+ ~TDskWinClipboard();
+
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktClipboard) && p==(void *)edw; };
+
+ TCEditWindow *edw;
+
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinClipboard( StreamableInit ) { type=dktClipboard; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinClipboard& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinClipboard*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinClipboard& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinClipboard* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskclose.h b/setedit/setedit/include/dskclose.h
new file mode 100644
index 0000000..3ba09c2
--- /dev/null
+++ b/setedit/setedit/include/dskclose.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TDskWinClosed : public TDskWin
+{
+public:
+
+ TDskWinClosed(TCEditWindow *edw);
+ ~TDskWinClosed();
+
+ int GoAction(ccIndex i);
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktClosed) && (strcmp((char *)p,Name)==0); };
+
+ char *Name;
+ EditorResume resume;
+
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinClosed( StreamableInit ) { type=dktClosed; CanBeSaved=1; CanBeDeletedFromDisk=1; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinClosed& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinClosed*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinClosed& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinClosed* cl )
+ { return os << (TStreamable *)cl; }
+
+
diff --git a/setedit/setedit/include/dskedito.h b/setedit/setedit/include/dskedito.h
new file mode 100644
index 0000000..9981790
--- /dev/null
+++ b/setedit/setedit/include/dskedito.h
@@ -0,0 +1,45 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TDskWinEditor : public TDskWin
+{
+public:
+
+ TDskWinEditor(TCEditWindow *EdW,int Num) : edw(EdW), number(Num)
+ { type=dktEditor; CanBeSaved=1; CanBeDeletedFromDisk=1; view=EdW; };
+ ~TDskWinEditor();
+
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktEditor) && (p==edw); };
+ int GetNumber();
+ void SetNumber(int number);
+
+ TCEditWindow *edw;
+ int number;
+
+ void write( opstream& );
+ void *read(ipstream& );
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinEditor( StreamableInit ) { type=dktEditor; CanBeSaved=1; CanBeDeletedFromDisk=1; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinEditor& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinEditor*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinEditor& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinEditor* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskhelp.h b/setedit/setedit/include/dskhelp.h
new file mode 100644
index 0000000..9532630
--- /dev/null
+++ b/setedit/setedit/include/dskhelp.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <inf.h>
+
+class TInfFile;
+class TInfWindow;
+
+class TDskWinHelp : public TDskWin
+{
+public:
+
+ TDskWinHelp(char *File, char *Node, Boolean TheOne=False);
+ ~TDskWinHelp();
+
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *,int t) { return (t==dktHelp); };
+
+ TInfFile *file;
+ TInfWindow *window;
+
+ void Goto(char *File, char *Node, char *word=0);
+ void Create(char *File, char *Node, Boolean TheOne=False);
+ void CreateModal(char *File, char *Node);
+ void MakeVisible(void);
+
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinHelp( StreamableInit ) { type=dktHelp; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinHelp& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinHelp*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinHelp& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinHelp* cl )
+ { return os << (TStreamable *)cl; }
diff --git a/setedit/setedit/include/dskman.h b/setedit/setedit/include/dskman.h
new file mode 100644
index 0000000..1b2f2e2
--- /dev/null
+++ b/setedit/setedit/include/dskman.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TDskWinMan : public TDskWin
+{
+public:
+
+ TDskWinMan(const char *file, const char *sections, const char *extraOps);
+ ~TDskWinMan();
+
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktMan) && p==(void *)view; };
+
+ void write(opstream& os);
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinMan( StreamableInit ) { type=dktMan; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinMan& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinMan*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinMan& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinMan* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskmessa.h b/setedit/setedit/include/dskmessa.h
new file mode 100644
index 0000000..2d87fed
--- /dev/null
+++ b/setedit/setedit/include/dskmessa.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TEdMsgDialog;
+
+class TDskWinMessage : public TDskWin
+{
+public:
+
+ TDskWinMessage(TEdMsgDialog *w);
+ ~TDskWinMessage();
+
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktMessage) && p==(void *)view; };
+
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinMessage( StreamableInit ) { type=dktMessage; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinMessage& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinMessage*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinMessage& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinMessage* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskmp3.h b/setedit/setedit/include/dskmp3.h
new file mode 100644
index 0000000..d99420d
--- /dev/null
+++ b/setedit/setedit/include/dskmp3.h
@@ -0,0 +1,42 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TView;
+
+class TDskWinMP3 : public TDskWin
+{
+public:
+
+ TDskWinMP3(TView *w);
+ ~TDskWinMP3();
+
+ int GoAction(ccIndex i);
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *p,int t) { return (t==dktMP3) && p==(void *)view; };
+
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinMP3( StreamableInit ) { type=dktMP3; CanBeSaved=1; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinMP3& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinMP3*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinMP3& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinMP3* cl )
+ { return os << (TStreamable *)cl; }
+
diff --git a/setedit/setedit/include/dskprj.h b/setedit/setedit/include/dskprj.h
new file mode 100644
index 0000000..c4db715
--- /dev/null
+++ b/setedit/setedit/include/dskprj.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TEditorProjectWindow;
+
+class TDskWinPrj : public TDskWin
+{
+public:
+
+ TDskWinPrj(char *File);
+ ~TDskWinPrj();
+
+ int GoAction(ccIndex i);
+ int DeleteAction(ccIndex i, Boolean fromDiskToo=False);
+ char *GetText(char *dest, short maxLen);
+ int Compare(void *,int t) { return (t==dktPrj); };
+
+ TEditorProjectWindow *window;
+ void Create(char *File, char *Node, Boolean TheOne=False);
+ char *getFileName();
+ void setFileName(char *);
+
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+ ushort wS, hS;
+
+ const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TDskWinPrj( StreamableInit ) { type=dktPrj; CanBeSaved=0; CanBeDeletedFromDisk=0; };
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWinPrj& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWinPrj*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWinPrj& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWinPrj* cl )
+ { return os << (TStreamable *)cl; }
diff --git a/setedit/setedit/include/dskwin.h b/setedit/setedit/include/dskwin.h
new file mode 100644
index 0000000..37d10bf
--- /dev/null
+++ b/setedit/setedit/include/dskwin.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TDskWin : public TStreamable
+{
+public:
+ TDskWin() {};
+ virtual ~TDskWin() {};
+ int type;
+ int CanBeSaved;
+ int CanBeDeletedFromDisk;
+ int ZOrder;
+ TView *view;
+ virtual int GoAction(ccIndex i);
+ virtual int DeleteAction(ccIndex i, Boolean fromDiskToo);
+ virtual int Compare(void *p, int t);
+ virtual char *GetText(char *dest, short maxLen) = 0;
+ virtual int GetNumber();
+ char *GetText(char *dest, char *s, short maxLen);
+
+protected:
+ virtual void write(opstream& os);
+ virtual void *read(ipstream& is);
+
+private:
+ virtual const char *streamableName() const;
+};
+
+inline ipstream& operator >> ( ipstream& is, TDskWin& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TDskWin*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TDskWin& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TDskWin* cl )
+ { return os << (TStreamable *)cl; }
+
+// Identifiers used by SET's editor for the different classes
+// derived from TDskWin, in the type member.
+// This allows to identify an object derived from this class.
+const int
+ dktEditor = 1,
+ dktClosed = 2,
+ dktClipboard = 3,
+ dktHelp = 4,
+ dktPrj = 5,
+ dktMessage = 6,
+ dktMP3 = 7,
+ dktASCII = 8,
+ dktCalendar = 9,
+ dktMan =10,
+ dktDbgMsg =11,
+ dktDbgWt =12,
+ dktDbgIns =13,
+ dktDbgDataWin=14,
+ dktDbgDisasm =15;
+
+class TDeskTop;
+void InsertInOrder(TDeskTop *dsk, TDskWin *win);
+void AddAndInsertDskWin(TDskWin *win);
+
+
diff --git a/setedit/setedit/include/edcollec.h b/setedit/setedit/include/edcollec.h
new file mode 100644
index 0000000..2ad0ccf
--- /dev/null
+++ b/setedit/setedit/include/edcollec.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+struct stEditorId;
+class TCEditWindow;
+
+class TEditorCollection : public TCollection
+{
+public:
+
+ TEditorCollection(ccIndex aLimit, ccIndex aDelta);
+ virtual void freeItem(void *item);
+ void addEditor(TCEditWindow *p,int SelectHL=0);
+ void addNonEditor(TDskWin *p) { atInsert(Editors,p); nonEditors++; };
+ void removeEditor(TCEditWindow *p, Boolean dontAddClosed);
+ void removeNonEditor(void *p, int type);
+ void removeWindow(void *p);
+ void getText(char *dest, ccIndex item, short maxLen);
+ ccIndex search(void *p,int type);
+ ccIndex searchByView(void *view);
+ ccIndex searchEditorName(char *name, int *cant);
+ ccIndex searchEditorbyINode(char *name, int *cant);
+ ccIndex searchEditorbyINode(stEditorId *id, char *name, int *cant);
+ TDskWin *searchByNumber(int num);
+ void forEachEditor(void (*func)(TCEditWindow *));
+ void forEachNonEditor(int type, void (*func)(TDskWin *,void *), void *data);
+ void saveEditors(void);
+ void redrawEditors(void);
+ void reIdEditors(void);
+ void sortClosed(void);
+ int GetMaxWindowNumber(void);
+ void ReEnumerate();
+ int Editors;
+ int Closed;
+ int nonEditors;
+ static int maxClosedToRemember;
+ // Members used during the load to change the normal behavior
+ static char HaveFilesCL;
+ static char DontSortClosed;
+
+ const char *streamableName() const
+ { return name; }
+ void *readItem( ipstream& is );
+ void writeItem( void *p, opstream &os );
+ void write( opstream& os );
+ void *read(ipstream& is);
+
+protected:
+
+ TEditorCollection( StreamableInit ) : TCollection ( streamableInit ) {};
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+};
+
+inline ipstream& operator >> ( ipstream& is, TEditorCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TEditorCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TEditorCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TEditorCollection* cl )
+ { return os << (TStreamable *)cl; }
+
+
+class TListEditors : public TListBox
+{
+public:
+ TListEditors(const TRect& bounds, ushort aNumCols, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar, Boolean aCenterOps=False) :
+ TListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,aCenterOps) {};
+ virtual void getText(char *dest, ccIndex item, short maxLen);
+};
+
+#if defined(Uses_TSListEditors) && !defined(TSListEditorsDefined)
+// Easydiag object for it.
+ListBoxSpecialize(TSListEditors);
+#endif
diff --git a/setedit/setedit/include/editcoma.h b/setedit/setedit/include/editcoma.h
new file mode 100644
index 0000000..06beed8
--- /dev/null
+++ b/setedit/setedit/include/editcoma.h
@@ -0,0 +1,107 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+// Calculator and Debug Eval/Modif
+const int
+ cmEval =0x2200,
+ cmCaCopy =0x2201,
+ cmCaPaste =0x2202,
+ cmChange =0x2203,
+// Find & Replace dialog
+ cmRegExOptions =0x2218,
+// Local options dialog
+ cmSHLOptions =0x2219,
+// Calendar broadcast
+ cmCalendarPlugIn=0x221A,
+// List of windows (ALT+0) also project Window
+ cmGo =0x2290,
+ cmDelete =0x2291,
+ cmInsert =0x2292,
+ cmDelFile =0x2293,
+ cmChangeSort =0x2294,
+ cmReEnumerate =0x2295,
+// Debug Watches & other debug
+ cmEditWatch =0x22A0,
+ cmInsertWScope =0x22A1,
+ cmGDBCommand =0x22A2,
+ cmBkModify =0x22A3,
+ cmBkAdd =0x22A4,
+ cmBkDel =0x22A5,
+ cmBkEnable =0x22A6,
+ cmBkDisable =0x22A7,
+ cmBkGo =0x22A8,
+ cmDbgInspect =0x22A9,
+ cmExpand =0x22AA,
+ cmCollapse =0x22AB,
+ cmVarChanged =0x22AC, // Broadcast
+ cmDbgChgState =0x22AD, // To current or Broadcast for dis/connected
+ cmRecycle =0x22AE,
+ cmModifyIns =0x22AF,
+ cmFormatIns =0x22B0,
+ cmModifyReg =0x22B1,
+ //----------------------------
+ // Data Window commands.
+ //----------------------------
+ cmDWFirstCommand =0x2300,
+ //----------------------------
+ cmDWUp =0x2300,
+ cmDWDown =0x2301,
+ cmDWRight =0x2302,
+ cmDWBaseIncrement=0x2303,
+ cmDWLeft =0x2304,
+ cmDWBaseDecrement=0x2305,
+ cmDWPgDn =0x2306,
+ cmDWPgUp =0x2307,
+ cmDWFirstColumn =0x2308,
+ cmDWFirstRow =0x2309,
+ cmDWLastRow =0x230A,
+ cmDWLastColumn =0x230B,
+ cmDWBaseAddress =0x230C,
+ cmDWGotoAddress =0x230D,
+ cmDWFollowPointer=0x230E,
+ cmDWFollowPtnNew =0x230F,
+ cmDWRecompute =0x2310,
+ cmDWTogAutoF =0x2311,
+ cmDWDispMode =0x2312,
+ cmDWTogEndian =0x2313,
+ cmDWRadix =0x2314,
+ cmDWFill =0x2315,
+ cmDWClear =0x2316,
+ cmDWMove =0x2317,
+ cmDWLessLines =0x2318,
+ cmDWMoreLines =0x2319,
+ cmDWUpdateMemory =0x231A,
+ cmDWRead =0x231B,
+ cmDWWrite =0x231C,
+ //----------------------------
+ cmDWLastCommand =0x231D;
+ //----------------------------
+ // End of Data Window commands.
+ //----------------------------
+
+const int
+ hcListWin =0x2110,
+ hcEditorProjectWindow=0x2115,
+ hcMessageWindow =0x2130,
+ hcRegExOptions =0x2150,
+ hcDebugMsgWin =0x2151,
+ hcWatchesWin =0x2152,
+ hcWatchesWinEdit =0x2153,
+ hcEditBkpt =0x2154,
+ hcEditWp =0x2155,
+ hcBkptDialog =0x2156,
+ hcWpDialog =0x2157,
+ hcInspector =0x2158,
+ hcDataViewer =0x2159,
+ hcDisassembler =0x215A,
+ hcSourceLoc =0x215B,
+ hcDebugAdvOps =0x215C,
+ hcDebugOps =0x215D,
+ hcCalculator =0x2200,
+ hcEditKeys =0x2240,
+ hcEditKeysSeq =0x2241,
+ hcEditKeysMac =0x2242,
+ hcEditKeysCom =0x2243,
+ hcEditKeysLisp =0x2244,
+ hcPassphrase =0x2250;
+
+
diff --git a/setedit/setedit/include/edprint.h b/setedit/setedit/include/edprint.h
new file mode 100644
index 0000000..ad3b85e
--- /dev/null
+++ b/setedit/setedit/include/edprint.h
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void PrintSetup(void);
+int PrintSource(char *b, char *FileName, unsigned tabSize);
+void PrintSetDefaults(void);
+void SavePrintSetUp(opstream* s);
+void LoadPrintSetUp(ipstream* s);
+
diff --git a/setedit/setedit/include/loadcle.h b/setedit/setedit/include/loadcle.h
new file mode 100644
index 0000000..4022ef9
--- /dev/null
+++ b/setedit/setedit/include/loadcle.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Command Line Errors
+
+ This module handles the parsing of errors reported by external programs.
+
+*****************************************************************************/
+
+#include <ced_pcre.h>
+
+struct strCLE
+{
+ // Name of the program
+ char *Name;
+ // Pattern to match
+ pcre *Pattern;
+ // Subexpressions:
+ uchar File;
+ uchar Line;
+ uchar Severity;
+ uchar Description;
+ // Pattern to indicate the makefile changed the path
+ pcre *EnterDirPat;
+ uchar EnterDirDir;
+ // Flag to indicate this structure was loaded
+ char Loaded;
+ // This falg indicates we must use the internal parser. That's for the GNU parser
+ char UseInternal;
+ // Pattern to indicate the makefile went back one dir level
+ pcre *LeaveDir;
+ // Pattern for the "Severity" when it means "error"
+ pcre *SevError;
+ // Pattern for the "Severity" when it means "warning"
+ pcre *SevWarn;
+};
+
+extern strCLE *CLEValues;
+const int maxCLEFileWidth=256;
+
+class TStringCollection;
+
+extern void CLESetFileName(const char *name);
+extern void UnloadCLEFile();
+extern TStringCollection *CLEGetList();
+extern int CLEGetIndexOf(const char *name);
+extern int CLEGetIndexOfLoad(const char *name);
+extern int CLEDoSearch(char *search, int len, pcre *CompiledPCRE);
+extern int CLEGetMatch(int match, char *buf, int maxLen);
+extern void CLEGetMatch(int match, int &offset, int &len);
+extern pcre *CLECompileRegEx(char *text, int &subX);
diff --git a/setedit/setedit/include/loadnobkp.h b/setedit/setedit/include/loadnobkp.h
new file mode 100644
index 0000000..d67649a
--- /dev/null
+++ b/setedit/setedit/include/loadnobkp.h
@@ -0,0 +1,14 @@
+/* Copyright (C) 2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef LOADNOBKP_H_INCLUDED
+#define LOADNOBKP_H_INCLUDED
+
+const int NBKPMaxLineLen=1024;
+
+void NBKPSetFileName(const char *name, unsigned ctxHelp);
+void NBKPSetSaveFileName(const char *save);
+int NBKPMakeIt(const char *name);
+void UnloadNBKP();
+void NBKPEdit(void);
+
+#endif // LOADNOBKP_H_INCLUDED
diff --git a/setedit/setedit/include/pal.h b/setedit/setedit/include/pal.h
new file mode 100644
index 0000000..4838125
--- /dev/null
+++ b/setedit/setedit/include/pal.h
@@ -0,0 +1,441 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* That's the palette of the editor constructed with the Robert's macros */
+
+#define Black 0
+#define Blue 1
+#define Green 2
+#define Cyan 3
+#define Red 4
+#define Magenta 5
+#define Brown 6
+#define Lightgray 7
+#define Darkgray 8
+#define Lightblue 9
+#define Lightgreen A
+#define Lightcyan B
+#define Lightred C
+#define Lightmagenta D
+#define Yellow E
+#define White F
+
+//#define __S(color) #color
+//#define _S(bg,fg) __S(\x##bg##fg)
+#define SE_S(bg,fg) 0x##bg##fg ,
+#define S(index,foreground,background,name) SE_S(background,foreground)
+#define SS(index,foreground,background,name,group) SE_S(background,foreground)
+
+/* This is the palette for the system when in color mode */
+#define SE_cpColor\
+ SS( 1,Blue,Lightgray,Color,Desktop) \
+ \
+ SS( 2,Black,Lightgray,Normal,Menus) \
+ S( 3,Darkgray,Lightgray,Disabled) \
+ S( 4,Red,Lightgray,Shortcut) \
+ S( 5,Black,Green,Selected) \
+ S( 6,Darkgray,Green,Selected disabled) \
+ S( 7,Red,Green,Shortcut selected) \
+ \
+ SS( 8,Lightgray,Blue,Frame disabled,Blue Windows) \
+ S( 9,White,Blue,Frame) \
+ S( A,Lightgreen,Blue,Frame icons) \
+ S( B,Blue,Cyan,Scroll bar page) \
+ S( C,Blue,Cyan,Scroll bar icons) \
+ S( D,Yellow,Blue,Static text) \
+ S( E,Blue,Lightgray,Selected text) \
+ \
+ S( F,Black,Black,reserved) \
+ \
+ SS(10,Lightgray,Cyan,Frame disabled,Cyan Windows) \
+ S(11,White,Cyan,Frame) \
+ S(12,Lightgreen,Cyan,Frame icons) \
+ S(13,Cyan,Blue,Scroll bar page) \
+ S(14,Cyan,Blue,Scroll bar icons) \
+ S(15,Yellow,Cyan,Static text) \
+ S(16,Blue,Green,Selected text) \
+ \
+ S(17,Black,Black,Reserved) \
+ \
+ SS(18,Lightgray,Black,Frame disabled,Gray Windows ) \
+ S(19,White,Black,Frame) \
+ S(1A,White,Black,Frame icons) \
+ S(1B,Lightgray,Black,Scroll bar page) \
+ S(1C,White,Black,Scroll bar icons) \
+ S(1D,Lightgray,Black,Static text) \
+ S(1E,Black,Lightgray,Selected text) \
+ \
+ S(1F,Black,Black,Reserved) \
+ \
+ SS(20,Black,Lightgray,Frame disabled,Dialogs) \
+ S(21,White,Lightgray,Frame) \
+ S(22,Lightgreen,Lightgray,Frame icons) \
+ S(23,Cyan,Blue,Scroll bar page) \
+ S(24,Cyan,Blue,Scroll bar icons) \
+ S(25,Black,Lightgray,Static text) \
+ S(26,Black,Lightgray,Label normal) \
+ S(27,White,Lightgray,Label selected) \
+ S(28,Yellow,Lightgray,Label shortcut) \
+ S(29,Black,Green,Button normal) \
+ S(2A,Lightcyan,Green,Button default) \
+ S(2B,White,Green,Button selected) \
+ S(2C,Darkgray,Lightgray,Button disabled) \
+ S(2D,Yellow,Green,Button shortcut) \
+ S(2E,Black,Lightgray,Button shadow) \
+ S(2F,Black,Cyan,Cluster normal) \
+ S(30,White,Cyan,Cluster selected) \
+ S(31,Yellow,Cyan,Cluster shortcut) \
+ S(32,White,Blue,Input normal) \
+ S(33,White,Green,Input selected) \
+ S(34,Lightgreen,Blue,Input arrow) \
+ S(35,Black,Green,History button) \
+ S(36,Green,Lightgray,History sides) \
+ S(37,Blue,Cyan,History bar page) \
+ S(38,Blue,Cyan,History bar icons) \
+ S(39,Black,Cyan,List normal) \
+ S(3A,White,Green,List focused) \
+ S(3B,Yellow,Cyan,List selected) \
+ S(3C,Blue,Cyan,List divider) \
+ S(3D,Cyan,Blue,Information pane) \
+ S(3E,Darkgray,Cyan,Cluster disabled) \
+ \
+ S(3F,Black,Black,Reserved) \
+ \
+ SS(40,Yellow,Blue,Normal text,Blue Editor) \
+ S(41,Blue,Lightgray,Marked text) \
+ S(42,Lightgray,Blue,Comment) \
+ S(43,Lightblue,Blue,Reserved word) \
+ S(44,Yellow,Blue,Identifier) \
+ S(45,White,Blue,Symbol) \
+ S(46,Lightcyan,Blue,String) \
+ S(47,Magenta,Blue,Integer) \
+ S(48,Brown,Blue,Float) \
+ S(49,White,Cyan,Octal) \
+ S(4A,Lightcyan,Green,Hex) \
+ S(4B,Lightmagenta,Blue,Character) \
+ S(4C,Lightgreen,Blue,Preprocessor) \
+ S(4D,Black,Red,Illegal char) \
+ S(4E,Green,Blue,User defined words) \
+ S(4F,Black,Cyan,CPU line) \
+ S(50,White,Red,Breakpoint) \
+ S(51,Lightred,Blue,Symbol2) \
+ \
+ SS(52,Yellow,Blue,Normal text,Cyan Editor) \
+ S(53,Blue,Lightgray,Marked text) \
+ S(54,Lightgray,Blue,Comment) \
+ S(55,Lightblue,Blue,Reserved word) \
+ S(56,Yellow,Blue,Identifier) \
+ S(57,White,Blue,Symbol) \
+ S(58,Lightcyan,Blue,String) \
+ S(59,Magenta,Blue,Integer) \
+ S(5A,Brown,Blue,Float) \
+ S(5B,White,Cyan,Octal) \
+ S(5C,Lightcyan,Green,Hex) \
+ S(5D,Lightmagenta,Blue,Character) \
+ S(5E,Lightgreen,Blue,Preprocessor) \
+ S(5F,Black,Red,Illegal char) \
+ S(60,Green,Blue,User defined words) \
+ S(61,Black,Cyan,CPU line) \
+ S(62,White,Red,Breakpoint) \
+ S(63,Lightred,Blue,Symbol2) \
+ \
+ SS(64,Yellow,Blue,Normal text,Gray Editor) \
+ S(65,Blue,Lightgray,Marked text) \
+ S(66,Lightgray,Blue,Comment) \
+ S(67,Lightblue,Blue,Reserved word) \
+ S(68,Yellow,Blue,Identifier) \
+ S(69,White,Blue,Symbol) \
+ S(6A,Lightcyan,Blue,String) \
+ S(6B,Magenta,Blue,Integer) \
+ S(6C,Brown,Blue,Float) \
+ S(6D,White,Cyan,Octal) \
+ S(6E,Lightcyan,Green,Hex) \
+ S(6F,Lightmagenta,Blue,Character) \
+ S(70,Lightgreen,Blue,Preprocessor) \
+ S(71,Black,Red,Illegal char) \
+ S(72,Green,Blue,User defined words) \
+ S(73,Black,Cyan,CPU line) \
+ S(74,White,Red,Breakpoint) \
+ S(75,Lightred,Blue,Symbol2) \
+ \
+ SS(76,Lightgray,Black,Cross cursor,Specials for editors) \
+ S(77,Black,Lightgray,Editor statusline) \
+ S(78,Lightred,Lightgray,Parens matching) \
+ S(79,White,Magenta,Rectangle block) \
+ S(7A,Black,Green,Odd tab) \
+ S(7B,Black,Red,Even tab) \
+ S(7C,Black,Red,Column markers) \
+ \
+ S(7D,Black,Black,Reserved) \
+ S(7E,Black,Black,Reserved) \
+ S(7F,Black,Black,Reserved) \
+ \
+ SS(80,Lightgray,Cyan,Frame disabled,Info viewer) \
+ S(81,White,Cyan,Frame) \
+ S(82,Lightgreen,Cyan,Frame icons) \
+ S(83,Cyan,Blue,Scroll bar page) \
+ S(84,Cyan,Blue,Scroll bar icons) \
+ S(85,Black,Cyan,Normal text) \
+ S(86,Yellow,Cyan,Keyword) \
+ S(87,Yellow,Blue,Selected keyword) \
+ S(88,Yellow,Red,Marked keyword) \
+ S(89,Yellow,Green,Marked text) /* currently fixed to "\0x70" */ \
+ \
+ SS(8A,Lightgray,Cyan,Frame disabled,Man page viewer) \
+ S(8B,White,Cyan,Frame) \
+ S(8C,Lightgreen,Cyan,Frame icons) \
+ S(8D,Cyan,Blue,Scroll bar page) \
+ S(8E,Cyan,Blue,Scroll bar icons) \
+ S(8F,Black,Cyan,Static text) \
+ S(90,Blue,Green,Selected text) \
+ S(91,White,Cyan,Bold text) \
+ S(92,Yellow,Cyan,Underlined text) \
+ S(93,Black,Black,Reserved) \
+ S(94,Black,Black,Reserved) \
+ S(95,Black,Black,Reserved) \
+ S(96,Black,Black,Reserved) \
+ \
+ SS(97,Black,Lightgray,Frame disabled,DataWindow) \
+ S(98,White,Lightgray,Frame) \
+ S(99,Lightgreen,Lightgray,Frame icons) \
+ S(9A,Blue,Cyan,Scroll bar page) \
+ S(9B,Blue,Cyan,Scroll bar icons) \
+ S(9C,Black,Cyan,Normal Text(active)) \
+ S(9D,White,Cyan,Normal Text(inactive)) \
+ S(9E,White,Blue,Focused Text) \
+ S(9F,Black,Magenta,Selected Text) \
+ S(A0,Yellow,Cyan,Changed text) \
+ S(A1,Black,Cyan,Reserved) \
+ S(A2,Black,Cyan,Reserved) \
+ S(A3,Black,Cyan,Reserved) \
+ \
+ SS(A4,Lightgray,Cyan,Frame disabled,Message Window) \
+ S(A5,White,Cyan,Frame) \
+ S(A6,Lightgreen,Cyan,Frame icons) \
+ S(A7,Cyan,Blue,Scroll bar page) \
+ S(A8,Cyan,Blue,Scroll bar icons) \
+ S(A9,Black,Cyan,Normal) \
+ S(AA,White,Green,Focused) \
+ S(AB,Yellow,Cyan,Selected) \
+ S(AC,Lightblue,Cyan,Information) \
+ S(AD,Yellow,Cyan,Warnings) \
+ S(AE,Red,Cyan,Errors)
+
+#define Normal 07
+#define Light 0F
+#define Inverse 70
+#define Underline 01
+#define Empty 00
+
+//#define __M(color) #color
+//#define _M(col) __M(\x##col)
+#define SE_M(color) 0x##color ,
+#define M(index,color,name) SE_M(color)
+
+/* This is the palette for the system when in monochrome mode */
+#define SE_cpMonochrome\
+ M( 1,Normal,Color) /* Desktop */\
+ \
+ M( 2,Normal,normal text) /* Used by menus and statusline */\
+ M( 3,Normal,disabled text) \
+ M( 4,Underline,shortcut) \
+ M( 5,Inverse,normal selected) \
+ M( 6,Underline,disabled selected) \
+ M( 7,Inverse,shortcut selected) \
+ \
+ M( 8,Normal,passive frame) /* Used by blue windows */\
+ M( 9,Light,active frame) \
+ M( A,Normal,frame icons) \
+ M( B,Normal,scrollbar) \
+ M( C,Normal,scrollbar icons) \
+ M( D,Normal,normal text) \
+ M( E,Inverse,selected text) \
+ \
+ M( F,Empty,reserved) \
+ \
+ M(10,Normal,passive frame) /* Used by cyan windows */\
+ M(11,Light,active frame) \
+ M(12,Normal,frame icons) \
+ M(13,Normal,scrollbar) \
+ M(14,Normal,scrollbar icons) \
+ M(15,Normal,normal text) \
+ M(16,Inverse,selected text) \
+ \
+ M(17,Empty,reserved) \
+ \
+ M(18,Normal,passive frame) /* Used by gray windows */\
+ M(19,Light,active frame) \
+ M(1A,Normal,frame icons) \
+ M(1B,Normal,scrollbar) \
+ M(1C,Normal,scrollbar icons) \
+ M(1D,Normal,normal text) \
+ M(1E,Inverse,selected text) \
+ \
+ M(1F,Empty,reserved) \
+ \
+ M(20,Normal,passive frame) /* Used by dialogs */\
+ M(21,Light,active frame) \
+ M(22,Normal,frame icons) \
+ M(23,Normal,scrollbar) \
+ M(24,Normal,scrollbar icons) \
+ M(25,Normal,static text) \
+ M(26,Normal,label normal) \
+ M(27,Inverse,label selected) \
+ M(28,Underline,label shortcut) \
+ M(29,Inverse,button normal) \
+ M(2A,Underline,button default) \
+ M(2B,Inverse,button focused) \
+ M(2C,Normal,button disabled) \
+ M(2D,Normal,button shortcut) \
+ M(2E,Normal,button shadow) \
+ M(2F,Inverse,cluster normal) \
+ M(30,Normal,cluster selected) \
+ M(31,Light,cluster shortcut) \
+ M(32,Underline,inputline normal) \
+ M(33,Inverse,inputline selected) \
+ M(34,Normal,inputline arrows) \
+ M(35,Normal,history arrow) \
+ M(36,Normal,history side) \
+ M(37,Normal,history window scrollbar) \
+ M(38,Normal,history window scrollbar icons) \
+ M(39,Inverse,list normal) \
+ M(3A,Normal,list focused) \
+ M(3B,Underline,list selected) \
+ M(3C,Normal,list divider) \
+ M(3D,Normal,infopane) \
+ \
+ M(3E,Empty,reserved) \
+ M(3F,Empty,reserved) \
+ \
+ M(40,Normal,normal text) /* Used by blue editors */\
+ M(41,Inverse,marked text) \
+ M(42,Light,comment) \
+ M(43,Light,reserved word) \
+ M(44,Normal,identifier) \
+ M(45,Light,symbol) \
+ M(46,Light,string) \
+ M(47,Light,integer decimal) \
+ M(48,Light,float) \
+ M(49,Light,octal) \
+ M(4A,Light,hex) \
+ M(4B,Light,character) \
+ M(4C,Light,preprocessor) \
+ M(4D,Inverse,illegal character) \
+ M(4E,Light,user reserved word) \
+ M(4F,Underline,CPU line) \
+ M(50,Inverse,breakpoint) \
+ M(51,Light,symbol2) \
+ \
+ M(52,Normal,normal text) /* Used by cyan editors */\
+ M(53,Inverse,marked text) \
+ M(54,Light,comment) \
+ M(55,Light,reserved word) \
+ M(56,Normal,identifier) \
+ M(57,Light,symbol) \
+ M(58,Light,string) \
+ M(59,Light,integer decimal) \
+ M(5A,Light,float) \
+ M(5B,Light,octal) \
+ M(5C,Light,hex) \
+ M(5D,Light,character) \
+ M(5E,Light,preprocessor) \
+ M(5F,Inverse,illegal character) \
+ M(60,Light,user reserved word) \
+ M(61,Underline,CPU line) \
+ M(62,Inverse,breakpoint) \
+ M(63,Light,symbol2) \
+ \
+ M(64,Normal,normal text) /* Used by gray editors */\
+ M(65,Inverse,marked text) \
+ M(66,Light,comment) \
+ M(67,Light,reserved word) \
+ M(68,Normal,identifier) \
+ M(69,Light,symbol) \
+ M(6A,Light,string) \
+ M(6B,Light,integer decimal) \
+ M(6C,Light,float) \
+ M(6D,Light,octal) \
+ M(6E,Light,hex) \
+ M(6F,Light,character) \
+ M(70,Light,preprocessor) \
+ M(71,Inverse,illegal character) \
+ M(72,Light,user reserved word) \
+ M(73,Underline,CPU line) \
+ M(74,Inverse,breakpoint) \
+ M(75,Light,symbol2) \
+ \
+ M(76,Inverse,cross cursor) \
+ M(77,Inverse,editor statusline) \
+ M(78,Inverse,matching paranthesis) \
+ M(79,Inverse,rectangular blocks) \
+ M(7A,Inverse,odd tab) \
+ M(7B,Underline,even tab) \
+ M(7C,Inverse,column markers) \
+ \
+ M(7D,Empty,reserved) \
+ M(7E,Empty,reserved) \
+ M(7F,Empty,reserved) \
+ \
+ M(80,Normal,passive frame) /* Used by the help viewer */\
+ M(81,Light,active frame) \
+ M(82,Normal,Cyan) /* frame icons */\
+ M(83,Normal,scollbar) \
+ M(84,Normal,scrollbar icons) \
+ M(85,Normal,normal text) \
+ M(86,Underline,keyword) \
+ M(87,Inverse,selected keyword) \
+ M(88,Inverse,keyword in marked area) \
+ M(89,Inverse,marked text) /* Currently fixed to "\0x70" */\
+ \
+ M(8A,Normal,passive frame) /* Man page viewer */\
+ M(8B,Light,active frame) \
+ M(8C,Normal,frame icons) \
+ M(8D,Normal,scrollbar) \
+ M(8E,Normal,scrollbar icons) \
+ M(8F,Normal,normal text) \
+ M(90,Inverse,selected text) \
+ M(91,Light,bold text) \
+ M(92,Underline,underlined text) \
+ \
+ M(93,Empty,reserved) \
+ M(94,Empty,reserved) \
+ M(95,Empty,reserved) \
+ M(96,Empty,reserved) \
+ \
+ M(97,Normal,passive frame) /* Data window */\
+ M(98,Light,active frame) \
+ M(99,Normal,frame icons) \
+ M(9A,Normal,scrollbar) \
+ M(9B,Normal,scrollbar icons) \
+ M(9C,Normal,Normal Text(active)) \
+ M(9D,Normal,Normal Text(inactive)) \
+ M(9E,Light,Focused Text) \
+ M(9F,Light,Selected Text) \
+ M(A0,Empty,reserved) \
+ M(A1,Empty,reserved) \
+ M(A2,Empty,reserved) \
+ M(A3,Empty,reserved) \
+ \
+ M(A4,Normal,passive frame) /* Message Window */\
+ M(A5,Light,active frame) \
+ M(A6,Normal,frame icons) \
+ M(A7,Normal,scrollbar) \
+ M(A8,Normal,scrollbar icons) \
+ M(A9,Inverse,normal) \
+ M(AA,Normal,focused) \
+ M(AB,Underline,selected) \
+ M(AC,Inverse,information) \
+ M(AD,Inverse,warnings) \
+ M(AE,Inverse,errors)
+
+#define SE_cpBlackWhite SE_cpColor
+
+// SAA changed it but I don't think that's really needed
+// I keep the code just in case
+//#ifdef TVComp_BCPP
+//#define _S(bg,fg) 0x##bg##fg ,
+//extern char SE___cpColor[];
+// #define SE_cpColor SE___cpColor
+//#define SE_cpColor SE__cpColor GCC
+// editmain: Pull it as an array
+// char SE___cpColor[] = { SE__cpColor 0 };
+
diff --git a/setedit/setedit/include/palbcc.h b/setedit/setedit/include/palbcc.h
new file mode 100644
index 0000000..651697c
--- /dev/null
+++ b/setedit/setedit/include/palbcc.h
@@ -0,0 +1,195 @@
+/* Copyright (C) 2003-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* A palette like BC++ created by Oswald Buddenhagen. */
+
+#define SE_cpColorBCC \
+\
+ SS(01,Blue,Lightgray,Color,Desktop) \
+\
+ SS(02,Black,Lightgray,Normal,Menus) \
+ S(03,Darkgray,Lightgray,Disabled) \
+ S(04,Red,Lightgray,Shortcut) \
+ S(05,Black,Green,Selected) \
+ S(06,Darkgray,Green,Selected disabled) \
+ S(07,Red,Green,Shortcut selected) \
+\
+ SS(08,Lightgray,Blue,Frame disabled,Blue Windows) \
+ S(09,White,Blue,Frame) \
+ S(0A,Lightgreen,Blue,Frame icons) \
+ S(0B,Blue,Cyan,Scroll bar page) \
+ S(0C,Blue,Cyan,Scroll bar icons) \
+ S(0D,Yellow,Blue,Static text) \
+ S(0E,Blue,Lightgray,Selected text) \
+\
+ S(0F,Black,Black,reserved) \
+\
+ SS(10,Lightgray,Cyan,Frame disabled,Cyan Windows) \
+ S(11,White,Cyan,Frame) \
+ S(12,Lightgreen,Cyan,Frame icons) \
+ S(13,Cyan,Blue,Scroll bar page) \
+ S(14,Cyan,Blue,Scroll bar icons) \
+ S(15,Yellow,Cyan,Static text) \
+ S(16,Blue,Green,Selected text) \
+ S(17,Black,Black,Reserved) \
+\
+ SS(18,Lightgray,Black,Frame disabled,Gray Windows) \
+ S(19,White,Black,Frame) \
+ S(1A,White,Black,Frame icons) \
+ S(1B,Lightgray,Black,Scroll bar page) \
+ S(1C,White,Black,Scroll bar icons) \
+ S(1D,Lightgray,Black,Static text) \
+ S(1E,Black,Lightgray,Selected text) \
+ S(1F,Black,Black,Reserved) \
+\
+ SS(20,Black,Lightgray,Frame disabled,Dialogs) \
+ S(21,White,Lightgray,Frame) \
+ S(22,Lightgreen,Lightgray,Frame icons) \
+ S(23,Cyan,Blue,Scroll bar page) \
+ S(24,Cyan,Blue,Scroll bar icons) \
+ S(25,Black,Lightgray,Static text) \
+ S(26,Black,Lightgray,Label normal) \
+ S(27,White,Lightgray,Label selected) \
+ S(28,Yellow,Lightgray,Label shortcut) \
+ S(29,Black,Green,Button normal) \
+ S(2A,Lightcyan,Green,Button default) \
+ S(2B,White,Green,Button selected) \
+ S(2C,Darkgray,Lightgray,Button disabled) \
+ S(2D,Yellow,Green,Button shortcut) \
+ S(2E,Black,Lightgray,Button shadow) \
+ S(2F,Black,Cyan,Cluster normal) \
+ S(30,White,Cyan,Cluster selected) \
+ S(31,Yellow,Cyan,Cluster shortcut) \
+ S(32,White,Blue,Input normal) \
+ S(33,White,Green,Input selected) \
+ S(34,Lightgreen,Blue,Input arrow) \
+ S(35,Black,Green,History button) \
+ S(36,Green,Lightgray,History sides) \
+ S(37,Blue,Cyan,History bar page) \
+ S(38,Blue,Cyan,History bar icons) \
+ S(39,Black,Cyan,List normal) \
+ S(3A,White,Green,List focused) \
+ S(3B,Yellow,Cyan,List selected) \
+ S(3C,Blue,Cyan,List divider) \
+ S(3D,Cyan,Blue,Information pane) \
+ S(3E,Darkgray,Cyan,Cluster disabled) \
+ S(3F,Black,Black,Reserved) \
+\
+ SS(40,Yellow,Blue,Normal text,Blue Editor) \
+ S(41,Blue,Lightgray,Marked text) \
+ S(42,Lightgray,Blue,Comment) \
+ S(43,White,Blue,Reserved word) \
+ S(44,Yellow,Blue,Identifier) \
+ S(45,White,Blue,Symbol) \
+ S(46,Lightcyan,Blue,String) \
+ S(47,Lightcyan,Blue,Integer) \
+ S(48,Lightgreen,Blue,Float) \
+ S(49,Lightred,Blue,Octal) \
+ S(4A,Lightcyan,Blue,Hex) \
+ S(4B,Lightgreen,Blue,Character) \
+ S(4C,Lightgreen,Blue,Preprocessor) \
+ S(4D,Black,Red,Illegal char) \
+ S(4E,White,Blue,User defined words) \
+ S(4F,Black,Cyan,Reserved) \
+ S(50,White,Red,Reserved) \
+ S(51,White,Blue,Symbol2) \
+\
+ SS(52,Yellow,Blue,Normal text,Cyan Editor) \
+ S(53,Blue,Lightgray,Marked text) \
+ S(54,Lightgray,Blue,Comment) \
+ S(55,Lightblue,Blue,Reserved word) \
+ S(56,Yellow,Blue,Identifier) \
+ S(57,White,Blue,Symbol) \
+ S(58,Lightcyan,Blue,String) \
+ S(59,Magenta,Blue,Integer) \
+ S(5A,Brown,Blue,Float) \
+ S(5B,White,Cyan,Octal) \
+ S(5C,Lightcyan,Green,Hex) \
+ S(5D,Lightmagenta,Blue,Character) \
+ S(5E,Lightgreen,Blue,Preprocessor) \
+ S(5F,Black,Red,Illegal char) \
+ S(60,Green,Blue,User defined words) \
+ S(61,Black,Cyan,Reserved) \
+ S(62,White,Red,Reserved) \
+ S(63,Lightred,Blue,Symbol2) \
+\
+ SS(64,Yellow,Blue,Normal text,Gray Editor) \
+ S(65,Blue,Lightgray,Marked text) \
+ S(66,Lightgray,Blue,Comment) \
+ S(67,Lightblue,Blue,Reserved word) \
+ S(68,Yellow,Blue,Identifier) \
+ S(69,White,Blue,Symbol) \
+ S(6A,Lightcyan,Blue,String) \
+ S(6B,Magenta,Blue,Integer) \
+ S(6C,Brown,Blue,Float) \
+ S(6D,White,Cyan,Octal) \
+ S(6E,Lightcyan,Green,Hex) \
+ S(6F,Lightmagenta,Blue,Character) \
+ S(70,Lightgreen,Blue,Preprocessor) \
+ S(71,Black,Red,Illegal char) \
+ S(72,Green,Blue,User defined words) \
+ S(73,Black,Cyan,Reserved) \
+ S(74,White,Red,Reserved) \
+ S(75,Lightred,Blue,Symbol2) \
+\
+ SS(76,Lightgray,Black,Cross cursor,Specials for editors) \
+ S(77,Black,Lightgray,Editor statusline) \
+ S(78,Lightred,Lightgray,Parens matching) \
+ S(79,White,Magenta,Rectangle block) \
+ S(7A,Blue,Cyan,Odd tab) \
+ S(7B,Black,Cyan,Even tab) \
+ S(7C,Black,Red,Column markers) \
+ S(7D,Black,Black,Reserved) \
+ S(7E,Black,Black,Reserved) \
+ S(7F,Black,Black,Reserved) \
+\
+ SS(80,Lightgray,Cyan,Frame disabled,Info viewer) \
+ S(81,White,Cyan,Frame) \
+ S(82,Lightgreen,Cyan,Frame icons) \
+ S(83,Cyan,Blue,Scroll bar page) \
+ S(84,Cyan,Blue,Scroll bar icons) \
+ S(85,Black,Cyan,Normal text) \
+ S(86,Yellow,Cyan,Keyword) \
+ S(87,Yellow,Blue,Selected keyword) \
+ S(88,Yellow,Red,Marked keyword) \
+ S(89,Yellow,Green,Marked text) \
+\
+ SS(8A,Lightgray,Cyan,Frame disabled,Man page viewer) \
+ S(8B,White,Cyan,Frame) \
+ S(8C,Lightgreen,Cyan,Frame icons) \
+ S(8D,Cyan,Blue,Scroll bar page) \
+ S(8E,Cyan,Blue,Scroll bar icons) \
+ S(8F,Black,Cyan,Static text) \
+ S(90,Blue,Green,Selected text) \
+ S(91,White,Cyan,Bold text) \
+ S(92,Yellow,Cyan,Underlined text) \
+ S(93,Black,Black,Reserved) \
+ S(94,Black,Black,Reserved) \
+ S(95,Black,Black,Reserved) \
+ S(96,Black,Black,Reserved) \
+\
+ SS(97,Black,Lightgray,Frame disabled,DataWindow) \
+ S(98,White,Lightgray,Frame) \
+ S(99,Lightgreen,Lightgray,Frame icons) \
+ S(9A,Blue,Cyan,Scroll bar page) \
+ S(9B,Blue,Cyan,Scroll bar icons) \
+ S(9C,Black,Cyan,Normal Text(active)) \
+ S(9D,White,Cyan,Normal Text(inactive)) \
+ S(9E,White,Blue,Focused Text) \
+ S(9F,Black,Magenta,Selected Text) \
+ S(A0,Yellow,Cyan,Changed text) \
+ S(A1,Black,Cyan,Reserved) \
+ S(A2,Black,Cyan,Reserved) \
+ S(A3,Black,Cyan,Reserved) \
+\
+ SS(A4,Lightgray,Cyan,Frame disabled,Message Window) \
+ S(A5,White,Cyan,Frame) \
+ S(A6,Lightgreen,Cyan,Frame icons) \
+ S(A7,Cyan,Blue,Scroll bar page) \
+ S(A8,Cyan,Blue,Scroll bar icons) \
+ S(A9,Black,Cyan,Normal) \
+ S(AA,White,Green,Focused) \
+ S(AB,Yellow,Cyan,Selected) \
+ S(AC,Lightblue,Cyan,Information) \
+ S(AD,Yellow,Cyan,Warnings) \
+ S(AE,Red,Cyan,Errors)
+
diff --git a/setedit/setedit/include/palconv.h b/setedit/setedit/include/palconv.h
new file mode 100644
index 0000000..2ac1aa6
--- /dev/null
+++ b/setedit/setedit/include/palconv.h
@@ -0,0 +1,208 @@
+/* Copyright (C) 2002-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* That's an dark with some VIM like palette created by Thiago F.G. Albuquerque */
+
+#define SE_cpColorConsoleVIM \
+\
+ SS(01,Blue,Lightgray,Color,Desktop) \
+\
+ SS(02,Black,Lightgray,Normal,Menus) \
+ S(03,Darkgray,Lightgray,Disabled) \
+ S(04,Red,Lightgray,Shortcut) \
+ S(05,Black,Green,Selected) \
+ S(06,Darkgray,Green,Selected disabled) \
+ S(07,Red,Green,Shortcut selected) \
+\
+ SS(08,Lightgray,Black,Frame disabled,Blue Windows) \
+ S(09,White,Black,Frame) \
+ S(0A,Lightgreen,Black,Frame icons) \
+ S(0B,Cyan,Black,Scroll bar page) \
+ S(0C,Cyan,Black,Scroll bar icons) \
+ S(0D,Yellow,Black,Static text) \
+ S(0E,Blue,Black,Selected text) \
+\
+ S(0F,Black,Black,reserved) \
+\
+ SS(10,Lightgray,Cyan,Frame disabled,Cyan Windows) \
+ S(11,White,Cyan,Frame) \
+ S(12,Lightgreen,Cyan,Frame icons) \
+ S(13,Cyan,Blue,Scroll bar page) \
+ S(14,Cyan,Blue,Scroll bar icons) \
+ S(15,Yellow,Cyan,Static text) \
+ S(16,Blue,Green,Selected text) \
+\
+ S(17,Black,Black,reserved) \
+\
+ SS(18,Lightgray,Black,Frame disabled,Gray Windows) \
+ S(19,White,Black,Frame) \
+ S(1A,White,Black,Frame icons) \
+ S(1B,Lightgray,Black,Scroll bar page) \
+ S(1C,White,Black,Scroll bar icons) \
+ S(1D,Lightgray,Black,Static text) \
+ S(1E,Black,Lightgray,Selected text) \
+\
+ S(1F,Black,Black,reserved) \
+\
+ SS(20,Black,Lightgray,Frame disabled,Dialogs) \
+ S(21,White,Lightgray,Frame) \
+ S(22,Lightgreen,Lightgray,Frame icons) \
+ S(23,Cyan,Blue,Scroll bar page) \
+ S(24,Cyan,Blue,Scroll bar icons) \
+ S(25,Black,Lightgray,Static text) \
+ S(26,Black,Lightgray,Label normal) \
+ S(27,White,Lightgray,Label selected) \
+ S(28,Yellow,Lightgray,Label shortcut) \
+ S(29,Black,Green,Button normal) \
+ S(2A,Lightcyan,Green,Button default) \
+ S(2B,White,Green,Button selected) \
+ S(2C,Darkgray,Lightgray,Button disabled) \
+ S(2D,Yellow,Green,Button shortcut) \
+ S(2E,Black,Lightgray,Button shadow) \
+ S(2F,Black,Cyan,Cluster normal) \
+ S(30,White,Cyan,Cluster selected) \
+ S(31,Yellow,Cyan,Cluster shortcut) \
+ S(32,White,Blue,Input normal) \
+ S(33,White,Green,Input selected) \
+ S(34,Lightgreen,Blue,Input arrow) \
+ S(35,Black,Green,History button) \
+ S(36,Green,Lightgray,History sides) \
+ S(37,Blue,Cyan,History bar page) \
+ S(38,Blue,Cyan,History bar icons) \
+ S(39,Black,Cyan,List normal) \
+ S(3A,White,Green,List focused) \
+ S(3B,Yellow,Cyan,List selected) \
+ S(3C,Blue,Cyan,List divider) \
+ S(3D,Cyan,Blue,Information pane) \
+ S(3E,Darkgray,Cyan,Cluster disabled) \
+\
+ S(3F,Black,Black,reserved) \
+\
+ SS(40,Lightgray,Black,normal text,Blue Editor) \
+ S(41,Blue,Lightgray,marked text) \
+ S(42,Lightcyan,Black,comment) \
+ S(43,Lightgreen,Black,reserved word) \
+ S(44,Lightgray,Black,identifier) \
+ S(45,Lightgray,Black,symbol) \
+ S(46,Lightmagenta,Black,string) \
+ S(47,Lightred,Black,integer) \
+ S(48,Lightred,Black,float) \
+ S(49,Lightred,Black,octal) \
+ S(4A,Lightred,Black,hex) \
+ S(4B,Lightmagenta,Black,character) \
+ S(4C,Lightblue,Black,preprocessor) \
+ S(4D,Black,Red,illegal char) \
+ S(4E,Green,Black,user defined words) \
+\
+ S(4F,Black,Cyan,reserved) \
+\
+ S(50,White,Red,reserved) \
+ S(51,Lightgray,Black,symbol2) \
+\
+ SS(52,Yellow,Blue,normal text,Cyan Editor) \
+ S(53,Blue,Lightgray,marked text) \
+ S(54,Lightgray,Blue,comment) \
+ S(55,Green,Blue,reserved word) \
+ S(56,Yellow,Blue,identifier) \
+ S(57,White,Blue,symbol) \
+ S(58,Lightcyan,Blue,string) \
+ S(59,Magenta,Blue,integer) \
+ S(5A,Brown,Blue,float) \
+ S(5B,White,Cyan,octal) \
+ S(5C,Lightcyan,Green,hex) \
+ S(5D,Lightmagenta,Blue,character) \
+ S(5E,Lightgreen,Blue,preprocessor) \
+ S(5F,Black,Red,illegal char) \
+ S(60,Green,Blue,user defined words) \
+\
+ S(61,Black,Cyan,reserved) \
+\
+ S(62,White,Red,reserved) \
+ S(63,Lightred,Blue,symbol2) \
+\
+ SS(64,Yellow,Blue,normal text,Gray Editor) \
+ S(65,Blue,Lightgray,marked text) \
+ S(66,Lightgray,Blue,comment) \
+ S(67,Green,Blue,reserved word) \
+ S(68,Yellow,Blue,identifier) \
+ S(69,White,Blue,symbol) \
+ S(6A,Lightcyan,Blue,string) \
+ S(6B,Magenta,Blue,integer) \
+ S(6C,Brown,Blue,float) \
+ S(6D,White,Cyan,octal) \
+ S(6E,Lightcyan,Green,hex) \
+ S(6F,Lightmagenta,Blue,character) \
+ S(70,Lightgreen,Blue,preprocessor) \
+ S(71,Black,Red,illegal char) \
+ S(72,Green,Blue,user defined words) \
+\
+ S(73,Black,Cyan,reserved) \
+\
+ S(74,White,Red,reserved) \
+ S(75,Lightred,Blue,symbol2) \
+\
+ SS(76,Lightgray,Black,Cross cursor,Specials for editors) \
+ S(77,Black,Lightgray,editor statusline) \
+ S(78,Yellow,Black,parens matching) \
+ S(79,White,Magenta,rectangle block) \
+ S(7A,Black,Green,odd tab) \
+ S(7B,Black,Red,even tab) \
+ S(7C,Black,Green,column markers) \
+\
+ S(7D,Black,Black,reserved) \
+\
+ S(7E,Black,Black,reserved) \
+\
+ S(7F,Black,Black,reserved) \
+\
+ SS(80,Lightgray,Cyan,Frame disabled,Info viewer) \
+ S(81,White,Cyan,Frame) \
+ S(82,Lightgreen,Cyan,Frame icons) \
+ S(83,Cyan,Blue,Scroll bar page) \
+ S(84,Cyan,Blue,Scroll bar icons) \
+ S(85,Black,Cyan,Normal text) \
+ S(86,Yellow,Cyan,Keyword) \
+ S(87,Yellow,Blue,Selected keyword) \
+ S(88,Yellow,Red,Marked keyword) \
+ S(89,Yellow,Green,Marked text) \
+\
+ SS(8A,Lightgray,Cyan,Frame disabled,Man page viewer) \
+ S(8B,White,Cyan,Frame) \
+ S(8C,Lightgreen,Cyan,Frame icons) \
+ S(8D,Cyan,Blue,Scroll bar page) \
+ S(8E,Cyan,Blue,Scroll bar icons) \
+ S(8F,Yellow,Cyan,Static text) \
+ S(90,Blue,Green,Selected text) \
+ S(91,Black,Cyan,Bold text) \
+ S(92,White,Cyan,Underlined text) \
+\
+ S(93,Black,Black,reserved) \
+ S(94,Black,Black,Reserved) \
+ S(95,Black,Black,Reserved) \
+ S(96,Black,Black,Reserved) \
+\
+ SS(97,Black,Lightgray,Frame disabled,DataWindow) \
+ S(98,White,Lightgray,Frame) \
+ S(99,Lightgreen,Lightgray,Frame icons) \
+ S(9A,Blue,Cyan,Scroll bar page) \
+ S(9B,Blue,Cyan,Scroll bar icons) \
+ S(9C,Black,Cyan,Normal Text(active)) \
+ S(9D,White,Cyan,Normal Text(inactive)) \
+ S(9E,White,Blue,Focused Text) \
+ S(9F,Black,Magenta,Selected Text) \
+ S(A0,Black,Red,Reserved) \
+ S(A1,Black,Cyan,Reserved) \
+ S(A2,Black,Cyan,Reserved) \
+ S(A3,Black,Cyan,Reserved) \
+\
+ SS(A4,Lightgray,Cyan,Frame disabled,Message Window) \
+ S(A5,White,Cyan,Frame) \
+ S(A6,Lightgreen,Cyan,Frame icons) \
+ S(A7,Cyan,Blue,Scroll bar page) \
+ S(A8,Cyan,Blue,Scroll bar icons) \
+ S(A9,Black,Cyan,Normal) \
+ S(AA,White,Green,Focused) \
+ S(AB,Yellow,Cyan,Selected) \
+ S(AC,Lightblue,Cyan,Information) \
+ S(AD,Yellow,Cyan,Warnings) \
+ S(AE,Red,Cyan,Errors)
+
diff --git a/setedit/setedit/include/paldjd.h b/setedit/setedit/include/paldjd.h
new file mode 100644
index 0000000..de7eebc
--- /dev/null
+++ b/setedit/setedit/include/paldjd.h
@@ -0,0 +1,208 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* A dark palette created by Juan Diego Iannelli. */
+
+#define SE_cpColorDarkJDI \
+\
+ SS(01,Darkgray,Black,Color,Desktop) \
+\
+ SS(02,Lightgray,Black,Normal,Menus) \
+ S(03,Darkgray,Black,Disabled) \
+ S(04,Darkgray,Black,Shortcut) \
+ S(05,Yellow,Brown,Selected) \
+ S(06,Darkgray,Brown,Selected disabled) \
+ S(07,Darkgray,Brown,Shortcut selected) \
+\
+ SS(08,Darkgray,Black,Frame disabled,Blue Windows) \
+ S(09,Lightgray,Black,Frame) \
+ S(0A,Magenta,Black,Frame icons) \
+ S(0B,Lightgray,Black,Scroll bar page) \
+ S(0C,Lightgray,Black,Scroll bar icons) \
+ S(0D,Yellow,Black,Static text) \
+ S(0E,Blue,Black,Selected text) \
+\
+ S(0F,Black,Black,reserved) \
+\
+ SS(10,Darkgray,Black,Frame disabled,Cyan Windows) \
+ S(11,Lightgray,Black,Frame) \
+ S(12,White,Black,Frame icons) \
+ S(13,Lightgray,Black,Scroll bar page) \
+ S(14,White,Black,Scroll bar icons) \
+ S(15,Lightgray,Black,Static text) \
+ S(16,Black,Cyan,Selected text) \
+\
+ S(17,Black,Black,reserved) \
+\
+ SS(18,Darkgray,Black,Frame disabled,Gray Windows) \
+ S(19,Lightgray,Black,Frame) \
+ S(1A,White,Black,Frame icons) \
+ S(1B,Lightgray,Black,Scroll bar page) \
+ S(1C,White,Black,Scroll bar icons) \
+ S(1D,Lightgray,Black,Static text) \
+ S(1E,Black,Cyan,Selected text) \
+\
+ S(1F,Black,Black,reserved) \
+\
+ SS(20,Darkgray,Black,Frame disabled,Dialogs) \
+ S(21,White,Black,Frame) \
+ S(22,Magenta,Black,Frame icons) \
+ S(23,Lightgray,Black,Scroll bar page) \
+ S(24,Lightgray,Black,Scroll bar icons) \
+ S(25,Black,Lightgray,Static text) \
+ S(26,Lightblue,Black,Label normal) \
+ S(27,Yellow,Brown,Label selected) \
+ S(28,Lightred,Black,Label shortcut) \
+ S(29,Lightblue,Lightgray,Button normal) \
+ S(2A,Yellow,Brown,Button default) \
+ S(2B,Yellow,Brown,Button selected) \
+ S(2C,Darkgray,Black,Button disabled) \
+ S(2D,Lightred,Lightgray,Button shortcut) \
+ S(2E,Darkgray,Black,Button shadow) \
+ S(2F,Black,Lightgray,Cluster normal) \
+ S(30,Lightgray,Brown,Cluster selected) \
+ S(31,Lightred,Black,Cluster shortcut) \
+ S(32,Lightgray,Black,Input normal) \
+ S(33,Black,Lightgray,Input selected) \
+ S(34,Lightgreen,Blue,Input arrow) \
+ S(35,Black,Green,History button) \
+ S(36,Green,Lightgray,History sides) \
+ S(37,Blue,Cyan,History bar page) \
+ S(38,Blue,Cyan,History bar icons) \
+ S(39,Black,Lightgray,List normal) \
+ S(3A,Lightgray,Brown,List focused) \
+ S(3B,Brown,Lightgray,List selected) \
+ S(3C,Darkgray,Black,List divider) \
+ S(3D,Darkgray,Black,Information pane) \
+ S(3E,Darkgray,Black,Cluster disabled) \
+\
+ S(3F,Black,Black,reserved) \
+\
+ SS(40,Lightgray,Black,normal text,Blue Editor) \
+ S(41,Blue,Lightgray,marked text) \
+ S(42,Darkgray,Black,comment) \
+ S(43,Magenta,Black,reserved word) \
+ S(44,Lightgray,Black,identifier) \
+ S(45,White,Black,symbol) \
+ S(46,Cyan,Black,string) \
+ S(47,Lightred,Black,integer) \
+ S(48,Lightred,Black,float) \
+ S(49,Lightred,Black,octal) \
+ S(4A,Lightmagenta,Black,hex) \
+ S(4B,Lightmagenta,Black,character) \
+ S(4C,Green,Black,preprocessor) \
+ S(4D,Black,Red,illegal char) \
+ S(4E,Green,Black,user defined words) \
+\
+ S(4F,Black,Cyan,reserved) \
+\
+ S(50,White,Red,reserved) \
+ S(51,Lightgray,Black,symbol2) \
+\
+ SS(52,Yellow,Blue,normal text,Cyan Editor) \
+ S(53,Blue,Lightgray,marked text) \
+ S(54,Lightgray,Blue,comment) \
+ S(55,Lightblue,Blue,reserved word) \
+ S(56,Yellow,Blue,identifier) \
+ S(57,White,Blue,symbol) \
+ S(58,Lightcyan,Blue,string) \
+ S(59,Magenta,Blue,integer) \
+ S(5A,Brown,Blue,float) \
+ S(5B,White,Cyan,octal) \
+ S(5C,Lightcyan,Green,hex) \
+ S(5D,Lightmagenta,Blue,character) \
+ S(5E,Lightgreen,Blue,preprocessor) \
+ S(5F,Black,Red,illegal char) \
+ S(60,Green,Blue,user defined words) \
+\
+ S(61,Black,Cyan,reserved) \
+\
+ S(62,White,Red,reserved) \
+ S(63,Lightred,Blue,symbol2) \
+\
+ SS(64,Yellow,Blue,normal text,Gray Editor) \
+ S(65,Blue,Lightgray,marked text) \
+ S(66,Lightgray,Blue,comment) \
+ S(67,Lightblue,Blue,reserved word) \
+ S(68,Yellow,Blue,identifier) \
+ S(69,White,Blue,symbol) \
+ S(6A,Lightcyan,Blue,string) \
+ S(6B,Magenta,Blue,integer) \
+ S(6C,Brown,Blue,float) \
+ S(6D,White,Cyan,octal) \
+ S(6E,Lightcyan,Green,hex) \
+ S(6F,Lightmagenta,Blue,character) \
+ S(70,Lightgreen,Blue,preprocessor) \
+ S(71,Black,Red,illegal char) \
+ S(72,Green,Blue,user defined words) \
+\
+ S(73,Black,Cyan,reserved) \
+\
+ S(74,White,Red,reserved) \
+ S(75,Lightred,Blue,symbol2) \
+\
+ SS(76,Lightgray,Black,Cross cursor,Specials for editors) \
+ S(77,Black,Lightgray,editor statusline) \
+ S(78,Yellow,Black,parens matching) \
+ S(79,Black,Cyan,rectangle block) \
+ S(7A,Black,Blue,odd tab) \
+ S(7B,Black,Cyan,even tab) \
+ S(7C,Black,Red,column markers) \
+\
+ S(7D,Black,Black,reserved) \
+\
+ S(7E,Black,Black,reserved) \
+\
+ S(7F,Black,Black,reserved) \
+\
+ SS(80,Darkgray,Black,Frame disabled,Info viewer) \
+ S(81,Lightgray,Black,Frame) \
+ S(82,White,Black,Frame icons) \
+ S(83,Lightgray,Black,Scroll bar page) \
+ S(84,White,Black,Scroll bar icons) \
+ S(85,Lightgray,Black,Normal text) \
+ S(86,White,Black,Keyword) \
+ S(87,White,Blue,Selected keyword) \
+ S(88,Darkgray,Cyan,Marked keyword) \
+ S(89,Black,Cyan,Marked text) \
+\
+ SS(8A,Darkgray,Black,Frame disabled,Man page viewer) \
+ S(8B,Lightgray,Black,Frame) \
+ S(8C,White,Black,Frame icons) \
+ S(8D,Lightgray,Black,Scroll bar page) \
+ S(8E,White,Black,Scroll bar icons) \
+ S(8F,Lightgray,Black,Static text) \
+ S(90,Black,Cyan,Selected text) \
+ S(91,White,Black,Bold text) \
+ S(92,Lightred,Black,Underlined text) \
+\
+ S(93,Black,Black,reserved) \
+ S(94,Black,Black,Reserved) \
+ S(95,Black,Black,Reserved) \
+ S(96,Black,Black,Reserved) \
+\
+ SS(97,Black,Lightgray,Frame disabled,DataWindow) \
+ S(98,White,Lightgray,Frame) \
+ S(99,Lightgreen,Lightgray,Frame icons) \
+ S(9A,Blue,Cyan,Scroll bar page) \
+ S(9B,Blue,Cyan,Scroll bar icons) \
+ S(9C,Black,Cyan,Normal Text(active)) \
+ S(9D,White,Cyan,Normal Text(inactive)) \
+ S(9E,White,Blue,Focused Text) \
+ S(9F,Black,Magenta,Selected Text) \
+ S(A0,Black,Red,Reserved) \
+ S(A1,Black,Cyan,Reserved) \
+ S(A2,Black,Cyan,Reserved) \
+ S(A3,Black,Cyan,Reserved) \
+\
+ SS(A4,Lightgray,Cyan,Frame disabled,Message Window) \
+ S(A5,White,Cyan,Frame) \
+ S(A6,Lightgreen,Cyan,Frame icons) \
+ S(A7,Cyan,Blue,Scroll bar page) \
+ S(A8,Cyan,Blue,Scroll bar icons) \
+ S(A9,Black,Cyan,Normal) \
+ S(AA,White,Green,Focused) \
+ S(AB,Yellow,Cyan,Selected) \
+ S(AC,Lightblue,Cyan,Information) \
+ S(AD,Yellow,Cyan,Warnings) \
+ S(AE,Red,Cyan,Errors)
+
diff --git a/setedit/setedit/include/palfte.h b/setedit/setedit/include/palfte.h
new file mode 100644
index 0000000..e7c62eb
--- /dev/null
+++ b/setedit/setedit/include/palfte.h
@@ -0,0 +1,208 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* That's an FTE like palette created by Ivan Baldo */
+
+#define SE_cpColorFTE \
+\
+ SS(01,Lightgray,Black,Color,Desktop) \
+\
+ SS(02,Black,Lightgray,Normal,Menus) \
+ S(03,Darkgray,Lightgray,Disabled) \
+ S(04,Lightred,Lightgray,Shortcut) \
+ S(05,White,Blue,Selected) \
+ S(06,Lightgray,Blue,Selected disabled) \
+ S(07,Lightred,Blue,Shortcut selected) \
+\
+ SS(08,Darkgray,Black,Frame disabled,Blue Windows) \
+ S(09,Lightgray,Black,Frame) \
+ S(0A,White,Black,Frame icons) \
+ S(0B,Lightgray,Black,Scroll bar page) \
+ S(0C,White,Black,Scroll bar icons) \
+ S(0D,Lightgray,Black,Static text) \
+ S(0E,Black,Cyan,Selected text) \
+\
+ S(0F,Black,Black,reserved) \
+\
+ SS(10,Darkgray,Black,Frame disabled,Cyan Windows) \
+ S(11,Lightgray,Black,Frame) \
+ S(12,White,Black,Frame icons) \
+ S(13,Lightgray,Black,Scroll bar page) \
+ S(14,White,Black,Scroll bar icons) \
+ S(15,Lightgray,Black,Static text) \
+ S(16,Black,Cyan,Selected text) \
+\
+ S(17,Black,Black,reserved) \
+\
+ SS(18,Darkgray,Black,Frame disabled,Gray Windows) \
+ S(19,Lightgray,Black,Frame) \
+ S(1A,White,Black,Frame icons) \
+ S(1B,Lightgray,Black,Scroll bar page) \
+ S(1C,White,Black,Scroll bar icons) \
+ S(1D,Lightgray,Black,Static text) \
+ S(1E,Black,Cyan,Selected text) \
+\
+ S(1F,Black,Black,reserved) \
+\
+ SS(20,Darkgray,Black,Frame disabled,Dialogs) \
+ S(21,Lightgray,Black,Frame) \
+ S(22,White,Black,Frame icons) \
+ S(23,Lightgray,Black,Scroll bar page) \
+ S(24,White,Black,Scroll bar icons) \
+ S(25,Lightgray,Black,Static text) \
+ S(26,Lightgray,Black,Label normal) \
+ S(27,White,Black,Label selected) \
+ S(28,Lightred,Black,Label shortcut) \
+ S(29,Black,Lightgray,Button normal) \
+ S(2A,White,Lightgray,Button default) \
+ S(2B,White,Blue,Button selected) \
+ S(2C,Darkgray,Lightgray,Button disabled) \
+ S(2D,Lightred,Lightgray,Button shortcut) \
+ S(2E,Darkgray,Black,Button shadow) \
+ S(2F,Lightgray,Black,Cluster normal) \
+ S(30,White,Black,Cluster selected) \
+ S(31,Lightred,Black,Cluster shortcut) \
+ S(32,Lightgray,Black,Input normal) \
+ S(33,White,Black,Input selected) \
+ S(34,White,Black,Input arrow) \
+ S(35,Lightgray,Black,History button) \
+ S(36,White,Black,History sides) \
+ S(37,Lightgray,Black,History bar page) \
+ S(38,White,Black,History bar icons) \
+ S(39,Lightgray,Black,List normal) \
+ S(3A,White,Blue,List focused) \
+ S(3B,White,Black,List selected) \
+ S(3C,Lightgray,Black,List divider) \
+ S(3D,Lightgray,Black,Information pane) \
+ S(3E,Darkgray,Black,Cluster disabled) \
+\
+ S(3F,Black,Black,reserved) \
+\
+ SS(40,Lightgray,Black,normal text,Blue Editor) \
+ S(41,Black,Cyan,marked text) \
+ S(42,Brown,Black,comment) \
+ S(43,White,Black,reserved word) \
+ S(44,Lightgray,Black,identifier) \
+ S(45,Lightcyan,Black,symbol) \
+ S(46,Yellow,Black,string) \
+ S(47,Lightred,Black,integer) \
+ S(48,Lightred,Black,float) \
+ S(49,Lightred,Black,octal) \
+ S(4A,Lightmagenta,Black,hex) \
+ S(4B,Yellow,Black,character) \
+ S(4C,Lightcyan,Black,preprocessor) \
+ S(4D,Black,Red,illegal char) \
+ S(4E,White,Black,user defined words) \
+\
+ S(4F,Black,Cyan,reserved) \
+\
+ S(50,White,Red,reserved) \
+ S(51,Lightcyan,Black,symbol2) \
+\
+ SS(52,Yellow,Blue,normal text,Cyan Editor) \
+ S(53,Blue,Lightgray,marked text) \
+ S(54,Lightgray,Blue,comment) \
+ S(55,Lightblue,Blue,reserved word) \
+ S(56,Yellow,Blue,identifier) \
+ S(57,White,Blue,symbol) \
+ S(58,Lightcyan,Blue,string) \
+ S(59,Magenta,Blue,integer) \
+ S(5A,Brown,Blue,float) \
+ S(5B,White,Cyan,octal) \
+ S(5C,Lightcyan,Green,hex) \
+ S(5D,Lightmagenta,Blue,character) \
+ S(5E,Lightgreen,Blue,preprocessor) \
+ S(5F,Black,Red,illegal char) \
+ S(60,Green,Blue,user defined words) \
+\
+ S(61,Black,Cyan,reserved) \
+\
+ S(62,White,Red,reserved) \
+ S(63,Lightred,Blue,symbol2) \
+\
+ SS(64,Yellow,Blue,normal text,Gray Editor) \
+ S(65,Blue,Lightgray,marked text) \
+ S(66,Lightgray,Blue,comment) \
+ S(67,Lightblue,Blue,reserved word) \
+ S(68,Yellow,Blue,identifier) \
+ S(69,White,Blue,symbol) \
+ S(6A,Lightcyan,Blue,string) \
+ S(6B,Magenta,Blue,integer) \
+ S(6C,Brown,Blue,float) \
+ S(6D,White,Cyan,octal) \
+ S(6E,Lightcyan,Green,hex) \
+ S(6F,Lightmagenta,Blue,character) \
+ S(70,Lightgreen,Blue,preprocessor) \
+ S(71,Black,Red,illegal char) \
+ S(72,Green,Blue,user defined words) \
+\
+ S(73,Black,Cyan,reserved) \
+\
+ S(74,White,Red,reserved) \
+ S(75,Lightred,Blue,symbol2) \
+\
+ SS(76,Lightgray,Black,Cross cursor,Specials for editors) \
+ S(77,Black,Lightgray,editor statusline) \
+ S(78,White,Red,parens matching) \
+ S(79,Black,Cyan,rectangle block) \
+ S(7A,Black,Blue,odd tab) \
+ S(7B,Black,Cyan,even tab) \
+ S(7C,Black,Red,column markers) \
+\
+ S(7D,Black,Black,reserved) \
+\
+ S(7E,Black,Black,reserved) \
+\
+ S(7F,Black,Black,reserved) \
+\
+ SS(80,Darkgray,Black,Frame disabled,Info viewer) \
+ S(81,Lightgray,Black,Frame) \
+ S(82,White,Black,Frame icons) \
+ S(83,Lightgray,Black,Scroll bar page) \
+ S(84,White,Black,Scroll bar icons) \
+ S(85,Lightgray,Black,Normal text) \
+ S(86,White,Black,Keyword) \
+ S(87,White,Blue,Selected keyword) \
+ S(88,Darkgray,Cyan,Marked keyword) \
+ S(89,Black,Cyan,Marked text) \
+\
+ SS(8A,Darkgray,Black,Frame disabled,Man page viewer) \
+ S(8B,Lightgray,Black,Frame) \
+ S(8C,White,Black,Frame icons) \
+ S(8D,Lightgray,Black,Scroll bar page) \
+ S(8E,White,Black,Scroll bar icons) \
+ S(8F,Lightgray,Black,Static text) \
+ S(90,Black,Cyan,Selected text) \
+ S(91,White,Black,Bold text) \
+ S(92,Lightred,Black,Underlined text) \
+\
+ S(93,Black,Black,reserved) \
+ S(94,Black,Black,Reserved) \
+ S(95,Black,Black,Reserved) \
+ S(96,Black,Black,Reserved) \
+\
+ SS(97,Black,Lightgray,Frame disabled,DataWindow) \
+ S(98,White,Lightgray,Frame) \
+ S(99,Lightgreen,Lightgray,Frame icons) \
+ S(9A,Blue,Cyan,Scroll bar page) \
+ S(9B,Blue,Cyan,Scroll bar icons) \
+ S(9C,Black,Cyan,Normal Text(active)) \
+ S(9D,White,Cyan,Normal Text(inactive)) \
+ S(9E,White,Blue,Focused Text) \
+ S(9F,Black,Magenta,Selected Text) \
+ S(A0,Black,Red,Reserved) \
+ S(A1,Black,Cyan,Reserved) \
+ S(A2,Black,Cyan,Reserved) \
+ S(A3,Black,Cyan,Reserved) \
+\
+ SS(A4,Lightgray,Cyan,Frame disabled,Message Window) \
+ S(A5,White,Cyan,Frame) \
+ S(A6,Lightgreen,Cyan,Frame icons) \
+ S(A7,Cyan,Blue,Scroll bar page) \
+ S(A8,Cyan,Blue,Scroll bar icons) \
+ S(A9,Black,Cyan,Normal) \
+ S(AA,White,Green,Focused) \
+ S(AB,Yellow,Cyan,Selected) \
+ S(AC,Lightblue,Cyan,Information) \
+ S(AD,Yellow,Cyan,Warnings) \
+ S(AE,Red,Cyan,Errors)
+
diff --git a/setedit/setedit/include/palmc.h b/setedit/setedit/include/palmc.h
new file mode 100644
index 0000000..dbbf33c
--- /dev/null
+++ b/setedit/setedit/include/palmc.h
@@ -0,0 +1,195 @@
+/* Copyright (C) 2003-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* A palette like Midnight Commander created by Oswald Buddenhagen. */
+
+#define SE_cpMidnight \
+\
+ SS(01,Blue,Lightgray,Color,Desktop) \
+\
+ SS(02,White,Cyan,Normal,Menus) \
+ S(03,Darkgray,Cyan,Disabled) \
+ S(04,Yellow,Cyan,Shortcut) \
+ S(05,White,Black,Selected) \
+ S(06,Darkgray,Black,Selected disabled) \
+ S(07,Yellow,Black,Shortcut selected) \
+\
+ SS(08,Lightgray,Blue,Frame disabled,Blue Windows) \
+ S(09,White,Blue,Frame) \
+ S(0A,Lightgreen,Blue,Frame icons) \
+ S(0B,Blue,Cyan,Scroll bar page) \
+ S(0C,Blue,Cyan,Scroll bar icons) \
+ S(0D,Lightgray,Blue,Static text) \
+ S(0E,Black,Cyan,Selected text) \
+\
+ S(0F,Black,Black,reserved) \
+\
+ SS(10,Lightgray,Cyan,Frame disabled,Cyan Windows) \
+ S(11,White,Cyan,Frame) \
+ S(12,Lightgreen,Cyan,Frame icons) \
+ S(13,Cyan,Blue,Scroll bar page) \
+ S(14,Cyan,Blue,Scroll bar icons) \
+ S(15,Yellow,Cyan,Static text) \
+ S(16,Blue,Green,Selected text) \
+ S(17,Black,Black,Reserved) \
+\
+ SS(18,Lightgray,Black,Frame disabled,Gray Windows) \
+ S(19,White,Black,Frame) \
+ S(1A,White,Black,Frame icons) \
+ S(1B,Lightgray,Black,Scroll bar page) \
+ S(1C,White,Black,Scroll bar icons) \
+ S(1D,Lightgray,Black,Static text) \
+ S(1E,Black,Lightgray,Selected text) \
+ S(1F,Black,Black,Reserved) \
+\
+ SS(20,Black,Lightgray,Frame disabled,Dialogs) \
+ S(21,White,Lightgray,Frame) \
+ S(22,Lightgreen,Lightgray,Frame icons) \
+ S(23,Cyan,Blue,Scroll bar page) \
+ S(24,Cyan,Blue,Scroll bar icons) \
+ S(25,Black,Lightgray,Static text) \
+ S(26,Black,Lightgray,Label normal) \
+ S(27,White,Lightgray,Label selected) \
+ S(28,Yellow,Lightgray,Label shortcut) \
+ S(29,Black,Green,Button normal) \
+ S(2A,Lightcyan,Green,Button default) \
+ S(2B,White,Green,Button selected) \
+ S(2C,Darkgray,Lightgray,Button disabled) \
+ S(2D,Yellow,Green,Button shortcut) \
+ S(2E,Black,Lightgray,Button shadow) \
+ S(2F,Black,Cyan,Cluster normal) \
+ S(30,White,Cyan,Cluster selected) \
+ S(31,Yellow,Cyan,Cluster shortcut) \
+ S(32,White,Blue,Input normal) \
+ S(33,White,Green,Input selected) \
+ S(34,Lightgreen,Blue,Input arrow) \
+ S(35,Black,Green,History button) \
+ S(36,Green,Lightgray,History sides) \
+ S(37,Blue,Cyan,History bar page) \
+ S(38,Blue,Cyan,History bar icons) \
+ S(39,Black,Cyan,List normal) \
+ S(3A,White,Green,List focused) \
+ S(3B,Yellow,Cyan,List selected) \
+ S(3C,Blue,Cyan,List divider) \
+ S(3D,Cyan,Blue,Information pane) \
+ S(3E,Darkgray,Cyan,Cluster disabled) \
+ S(3F,Black,Black,Reserved) \
+\
+ SS(40,Lightgray,Blue,Normal text,Blue Editor) \
+ S(41,Black,Cyan,Marked text) \
+ S(42,Brown,Blue,Comment) \
+ S(43,Yellow,Blue,Reserved word) \
+ S(44,Lightgray,Blue,Identifier) \
+ S(45,Lightcyan,Blue,Symbol) \
+ S(46,Green,Blue,String) \
+ S(47,Lightgray,Blue,Integer) \
+ S(48,Lightgray,Blue,Float) \
+ S(49,Lightgray,Blue,Octal) \
+ S(4A,Lightgray,Blue,Hex) \
+ S(4B,Lightgreen,Blue,Character) \
+ S(4C,Lightred,Blue,Preprocessor) \
+ S(4D,Black,Red,Illegal char) \
+ S(4E,Yellow,Blue,User defined words) \
+ S(4F,Yellow,Cyan,Reserved) \
+ S(50,White,Red,Reserved) \
+ S(51,Yellow,Blue,Symbol2) \
+\
+ SS(52,Yellow,Blue,Normal text,Cyan Editor) \
+ S(53,Blue,Lightgray,Marked text) \
+ S(54,Lightgray,Blue,Comment) \
+ S(55,Lightblue,Blue,Reserved word) \
+ S(56,Yellow,Blue,Identifier) \
+ S(57,White,Blue,Symbol) \
+ S(58,Lightcyan,Blue,String) \
+ S(59,Magenta,Blue,Integer) \
+ S(5A,Brown,Blue,Float) \
+ S(5B,White,Cyan,Octal) \
+ S(5C,Lightcyan,Green,Hex) \
+ S(5D,Lightmagenta,Blue,Character) \
+ S(5E,Lightgreen,Blue,Preprocessor) \
+ S(5F,Black,Red,Illegal char) \
+ S(60,Green,Blue,User defined words) \
+ S(61,Black,Cyan,Reserved) \
+ S(62,White,Red,Reserved) \
+ S(63,Lightred,Blue,Symbol2) \
+\
+ SS(64,Yellow,Blue,Normal text,Gray Editor) \
+ S(65,Blue,Lightgray,Marked text) \
+ S(66,Lightgray,Blue,Comment) \
+ S(67,Lightblue,Blue,Reserved word) \
+ S(68,Yellow,Blue,Identifier) \
+ S(69,White,Blue,Symbol) \
+ S(6A,Lightcyan,Blue,String) \
+ S(6B,Magenta,Blue,Integer) \
+ S(6C,Brown,Blue,Float) \
+ S(6D,White,Cyan,Octal) \
+ S(6E,Lightcyan,Green,Hex) \
+ S(6F,Lightmagenta,Blue,Character) \
+ S(70,Lightgreen,Blue,Preprocessor) \
+ S(71,Black,Red,Illegal char) \
+ S(72,Green,Blue,User defined words) \
+ S(73,Black,Cyan,Reserved) \
+ S(74,White,Red,Reserved) \
+ S(75,Lightred,Blue,Symbol2) \
+\
+ SS(76,Lightgray,Black,Cross cursor,Specials for editors) \
+ S(77,Black,Lightgray,Editor statusline) \
+ S(78,Lightred,Lightgray,Parens matching) \
+ S(79,White,Magenta,Rectangle block) \
+ S(7A,Black,Green,Odd tab) \
+ S(7B,Black,Red,Even tab) \
+ S(7C,Black,Red,Column markers) \
+ S(7D,Black,Black,Reserved) \
+ S(7E,Black,Black,Reserved) \
+ S(7F,Black,Black,Reserved) \
+\
+ SS(80,Lightgray,Cyan,Frame disabled,Info viewer) \
+ S(81,White,Cyan,Frame) \
+ S(82,Lightgreen,Cyan,Frame icons) \
+ S(83,Cyan,Blue,Scroll bar page) \
+ S(84,Cyan,Blue,Scroll bar icons) \
+ S(85,Black,Cyan,Normal text) \
+ S(86,Yellow,Cyan,Keyword) \
+ S(87,Yellow,Blue,Selected keyword) \
+ S(88,Yellow,Red,Marked keyword) \
+ S(89,Yellow,Green,Marked text) \
+\
+ SS(8A,Lightgray,Cyan,Frame disabled,Man page viewer) \
+ S(8B,White,Cyan,Frame) \
+ S(8C,Lightgreen,Cyan,Frame icons) \
+ S(8D,Cyan,Blue,Scroll bar page) \
+ S(8E,Cyan,Blue,Scroll bar icons) \
+ S(8F,Black,Cyan,Static text) \
+ S(90,Blue,Green,Selected text) \
+ S(91,White,Cyan,Bold text) \
+ S(92,Yellow,Cyan,Underlined text) \
+ S(93,Black,Black,Reserved) \
+ S(94,Black,Black,Reserved) \
+ S(95,Black,Black,Reserved) \
+ S(96,Black,Black,Reserved) \
+\
+ SS(97,Black,Lightgray,Frame disabled,DataWindow) \
+ S(98,White,Lightgray,Frame) \
+ S(99,Lightgreen,Lightgray,Frame icons) \
+ S(9A,Blue,Cyan,Scroll bar page) \
+ S(9B,Blue,Cyan,Scroll bar icons) \
+ S(9C,Black,Cyan,Normal Text(active)) \
+ S(9D,White,Cyan,Normal Text(inactive)) \
+ S(9E,White,Blue,Focused Text) \
+ S(9F,Black,Magenta,Selected Text) \
+ S(A0,Yellow,Cyan,Changed text) \
+ S(A1,Black,Cyan,Reserved) \
+ S(A2,Black,Cyan,Reserved) \
+ S(A3,Black,Cyan,Reserved) \
+\
+ SS(A4,Lightgray,Cyan,Frame disabled,Message Window) \
+ S(A5,White,Cyan,Frame) \
+ S(A6,Lightgreen,Cyan,Frame icons) \
+ S(A7,Cyan,Blue,Scroll bar page) \
+ S(A8,Cyan,Blue,Scroll bar icons) \
+ S(A9,Black,Cyan,Normal) \
+ S(AA,White,Green,Focused) \
+ S(AB,Yellow,Cyan,Selected) \
+ S(AC,Lightblue,Cyan,Information) \
+ S(AD,Yellow,Cyan,Warnings) \
+ S(AE,Red,Cyan,Errors)
+
diff --git a/setedit/setedit/include/pathlist.h b/setedit/setedit/include/pathlist.h
new file mode 100644
index 0000000..4f81d1b
--- /dev/null
+++ b/setedit/setedit/include/pathlist.h
@@ -0,0 +1,13 @@
+/* Copyright (C) 2001-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class fpstream;
+
+void PathListEdit(int which, unsigned hCtx);
+void PathListSave(fpstream& s);
+void PathListLoad(fpstream& s);
+int PathListGetItem(ccIndex pos, char *buffer, int which);
+void PathListUnLoad();
+void PathListAdd(int which, const char *path);
+void PathListAddPathFor(void *item, int which);
+
+const int paliInclude=0, paliSource=1, paliLists=2;
diff --git a/setedit/setedit/include/setapp.h b/setedit/setedit/include/setapp.h
new file mode 100644
index 0000000..8afcbcb
--- /dev/null
+++ b/setedit/setedit/include/setapp.h
@@ -0,0 +1,655 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifdef Uses_SETAppAll
+#define Uses_SETAppConst
+#define Uses_TSetEditorApp
+#define Uses_SETAppDialogs
+#define Uses_SETAppVarious
+#define Uses_SETAppProject
+#define Uses_SETAppFiles
+#endif
+
+#if defined(Uses_SETAppConst) && !defined(__SETAppConst__)
+#define __SETAppConst__
+const int cmeBase=0x2500;
+const int
+ cmeOpen = cmeBase+0,
+ cmeNew = cmeBase+1,
+ cmeChangeDrct = cmeBase+2,
+ cmeDosShell = cmeBase+3,
+ cmeCalculator = cmeBase+4,
+ cmeShowClip = cmeBase+5,
+ cmeInfView = cmeBase+6,
+ cmeListWin = cmeBase+7,
+ cmeLastHelp = cmeBase+8,
+ cmeUserScreen = cmeBase+9,
+ cmeAnotherInfView = cmeBase+10,
+ cmeOpenPrj = cmeBase+11,
+ cmeClosePrj = cmeBase+12,
+ cmeSDG = cmeBase+13,
+ cmeSDGDialog = cmeBase+14,
+ cmeSetColors = cmeBase+15,
+ cmeQuitDelete = cmeBase+16,
+ cmeQuit = cmeBase+17,
+ cmeResize = cmeBase+18,
+ cmeZoom = cmeBase+19,
+ cmeTile = cmeBase+20,
+ cmeCascade = cmeBase+21,
+ cmeNext = cmeBase+22,
+ cmePrev = cmeBase+23,
+ cmeClose = cmeBase+24,
+ cmeEditKeyBind = cmeBase+25,
+ cmeLoadKeyScans = cmeBase+26,
+ cmeSetUpAltKeys = cmeBase+27,
+ cmeKbBackDefault = cmeBase+28,
+ cmeSeeScanCodes = cmeBase+29,
+ cmePrintEditor = cmeBase+30,
+ cmeSetUpPrinter = cmeBase+31,
+ cmeGrepDialog = cmeBase+32,
+ cmeNextMessage = cmeBase+33,
+ cmePrevMessage = cmeBase+34,
+ cmeSetScreenOps = cmeBase+35,
+ cmeEditPalette = cmeBase+36,
+ cmeEdGralOptions = cmeBase+37,
+ cmeRunCommand = cmeBase+38,
+ cmeConfRunCommand = cmeBase+39,
+ cmeTipOfTheDay = cmeBase+40,
+ cmeAboutBox = cmeBase+41,
+/* These constants are defined in mp3/intermp3.h so any change here must
+ be done there I did it because the editor NEVER uses the commands
+ directly.
+ cmeMP3Open = cmeBase+42,
+ cmeMP3Convert = cmeBase+43,
+ cmeMP3EditPlayList= cmeBase+44,
+ cmeMP3Start = cmeBase+45,
+ cmeMP3Stop = cmeBase+46,
+ cmeMP3PlayList = cmeBase+47,
+ cmeMP3StopList = cmeBase+48,
+*/
+ cmeKeyPadBehavior = cmeBase+49,
+ cmeSyntaxHelp = cmeBase+50,
+ cmeSyntaxHelpOps = cmeBase+51,
+ cmeSyntaxHelpFiles= cmeBase+52,
+ cmeHTMLAccents = cmeBase+53,
+ cmePocketCalc = cmeBase+54,
+ cmeDeleteBkps = cmeBase+55,
+ cmeOpenROCopy = cmeBase+56,
+ cmeEditUserWords = cmeBase+57,
+ cmeEditDeflOpts = cmeBase+58,
+ cmeASCIIChart = cmeBase+59,
+ cmeCalendar = cmeBase+60,
+ cmeFileOpenOptions= cmeBase+61,
+ cmeScreenSaverOpts= cmeBase+62,
+ cmeManPageView = cmeBase+63,
+ cmeExportAsHTML = cmeBase+64,
+ cmeRemapCodePage = cmeBase+65,
+ cmeKeyboardSetUp = cmeBase+66, // No longer used
+ cmeReDraw = cmeBase+67,
+ cmeHTMLTag2Accent = cmeBase+68,
+ cmeSavePrj = cmeBase+69,
+ cmeBoardMixer = cmeBase+70,
+ cmeStopChild = cmeBase+71,
+ cmeEditNoBkp = cmeBase+72,
+ cmeIncludeList = cmeBase+73,
+ cmeColorTheme = cmeBase+74,
+ cmeSaveDesktop = cmeBase+75,
+ cmeEncodings = cmeBase+76,
+ cmeFonts = cmeBase+77,
+ cmeSaveAll = cmeBase+78,
+ cmeTagFiles = cmeBase+79,
+ cmeSearchTag = cmeBase+80,
+ cmeClassBrowser = cmeBase+81,
+ cmeWordCompletion = cmeBase+82,
+ cmeExportPrj = cmeBase+83,
+ cmeImportPrj = cmeBase+84,
+ cmeTagsOps = cmeBase+85,
+ cmeHolidaysConf = cmeBase+86,
+ cmeSetModiCkOps = cmeBase+87,
+ cmeAdviceDiagConf = cmeBase+88,
+ cmeSelWindow1 = cmeBase+89,
+ cmeSelWindow2 = cmeBase+90,
+ cmeSelWindow3 = cmeBase+91,
+ cmeSelWindow4 = cmeBase+92,
+ cmeSelWindow5 = cmeBase+93,
+ cmeSelWindow6 = cmeBase+94,
+ cmeSelWindow7 = cmeBase+95,
+ cmeSelWindow8 = cmeBase+96,
+ cmeSelWindow9 = cmeBase+97,
+ cmeSelWindow10 = cmeBase+98,
+ cmeSelWindow11 = cmeBase+99,
+ cmeSelWindow12 = cmeBase+100,
+ cmeSelWindow13 = cmeBase+101,
+ cmeSelWindow14 = cmeBase+102,
+ cmeSelWindow15 = cmeBase+103,
+ cmeSelWindow16 = cmeBase+104,
+ cmeSelWindow17 = cmeBase+105,
+ cmeSelWindow18 = cmeBase+106,
+ cmeSelWindow19 = cmeBase+107,
+ cmeSelWinPrj = cmeBase+108,
+ cmeSelWinMessage = cmeBase+109,
+ // Debugger interface
+ // Not a command but a mark
+ cmeDbgFirstCommand= cmeBase+110,
+ //------------------------------
+ cmeBreakpoint = cmeBase+110,
+ cmeDebugOptions = cmeBase+111,
+ cmeDbgRunContinue = cmeBase+112,
+ cmeDbgStepOver = cmeBase+113,
+ cmeDbgTraceInto = cmeBase+114,
+ cmeDbgGoToCursor = cmeBase+115,
+ cmeDbgFinishFun = cmeBase+116,
+ cmeDbgReturnNow = cmeBase+117,
+ cmeDbgStop = cmeBase+118,
+ cmeDbgKill = cmeBase+119,
+ cmeDbgCallStack = cmeBase+120,
+ cmeDbgEvalModify = cmeBase+121,
+ cmeDbgOptsMsgs = cmeBase+122,
+ cmeDbgWatchExpNorm= cmeBase+123,
+ cmeDbgWatchExpScp = cmeBase+124,
+ cmeDbgEditWatchPts= cmeBase+125,
+ cmeDbgInspector = cmeBase+126,
+ cmeDbgEndSession = cmeBase+127,
+ cmeDbgCloseSession= cmeBase+128,
+ cmeDbgGoConnected = cmeBase+129,
+ cmeDbgGoReadyToRun= cmeBase+130,
+ cmeDbgEditBreakPts= cmeBase+131,
+ cmeDbgDataWindow = cmeBase+132,
+ cmeDbgStackWindow = cmeBase+133,
+ cmeDbgCleanElem = cmeBase+134,
+ cmeDbgThreadSel = cmeBase+135,
+ cmeDbgOptionsAdv = cmeBase+136,
+ cmeDbgDisAsmWin = cmeBase+137,
+ cmeDbgDetach = cmeBase+138,
+ // That isn't a command, is to know the last+1.
+ cmeDbgLastCommand = cmeBase+139,
+ //-------------------------------------------------------------------------
+ // That's messy, I'm reserving some commands for the "debug" group
+ //-------------------------------------------------------------------------
+ cmeSourceList = cmeBase+160,
+ cmeGPushCursorPos = cmeBase+161,
+ cmeGPopCursorPos = cmeBase+162,
+ cmeSelDebugWin = cmeBase+163,
+ cmeSelWatchesWin = cmeBase+164,
+ cmeTagsAutoRegen = cmeBase+165;
+
+#endif
+
+// TScOptsCol used to hold the screen options for each video driver.
+#if defined(Uses_TScOptsCol) && !defined(Defined_TScOptsCol)
+#define Defined_TScOptsCol 1
+struct stScreenOptions;
+
+class TScOptsCol : public TSortedCollection
+{
+public:
+ TScOptsCol() : TSortedCollection(8,2) {};
+ virtual void *keyOf(void *item);
+ virtual int compare(void *key1, void *key2);
+ virtual void freeItem(void* item);
+ void Insert(stScreenOptions *p);
+ void transfer2TV();
+ SetDefStreamMembers(TScOptsCol,TSortedCollection)
+};
+SetDefStreamOperators(TScOptsCol)
+#endif
+
+#if (defined(Uses_TMultiMenu) || defined(Uses_TMultiMenuBar)) && \
+ !defined(TMultiMenu_defined)
+#define TMultiMenu_defined
+class TMultiMenu : public TMenu
+{
+public:
+ TMultiMenu() : TMenu(), next(NULL), last(NULL) {};
+ ~TMultiMenu();
+ void add(TMenuItem *m);
+
+ TMultiMenu *next;
+ TMenuItem *last;
+ unsigned min, max;
+};
+
+class TMultiMenuBar : public TMenuBar
+{
+public:
+ TMultiMenuBar(const TRect &bounds, TMultiMenu *aMenu) :
+ TMenuBar(bounds,aMenu) { menuList=aMenu; helpCtx=(unsigned)-1; };
+ TMultiMenuBar(const TRect &bounds, TMultiMenu *aMenu, TMultiMenu *cur) :
+ TMenuBar(bounds,cur) { menuList=aMenu; helpCtx=(unsigned)-1; };
+ ~TMultiMenuBar();
+ void update();
+ void findMenu();
+ static TMultiMenuBar *createMultiMenuBar(const TRect &bounds,
+ TMultiMenu *aMenu);
+
+ unsigned helpCtx;
+ TMultiMenu *menuList;
+};
+
+int LoadMenuAndStatus(char *fileName, int forceReload=0);
+TMultiMenuBar *GetTVMenu(char *fileName, TRect &rect);
+TStatusLine *GetTVStatusLine(char *fileName, TRect &rect);
+#endif
+
+#if defined(Uses_TSetEditorApp) && !defined(__TSetEditorApp__)
+#define __TSetEditorApp__
+class TMenuBar;
+class TMultiMenuBar;
+class TMenu;
+class TStatusLine;
+class TEditWindow;
+class TDialog;
+class fpstream;
+class TDeskTopClock;
+class TDskWinHelp;
+class TApplication;
+class TCEditWindow;
+class TVFontCollection;
+struct EditorResume;
+struct TScreenFont256;
+struct TVBitmapFontSize;
+class TEditorCollection;
+#ifndef Defined_TScOptsCol
+class TScOptsCol;
+#endif
+
+class XYFElement
+{
+public:
+ XYFElement(uint32 aX, uint32 aY, const char *aFile)
+ { x=aX; y=aY; file=newStr(aFile); next=prev=NULL; }
+ ~XYFElement()
+ { delete[] file; delete next; }
+
+ uint32 x, y;
+ char *file;
+ XYFElement *next, *prev;
+};
+
+// I think that more than 32 means the user is leaking ;-)
+const int maxXYFStack=32;
+
+class XYFStack
+{
+public:
+ XYFStack()
+ { first=last=NULL; count=0; }
+ ~XYFStack()
+ { delete first; }
+
+ void Push(uint32 aX, uint32 aY, const char *aFile);
+ XYFElement *Pop();
+ int getCount() { return count; }
+
+protected:
+ XYFElement *first, *last;
+ int count;
+};
+
+const int extscrsParMxLen=80;
+
+struct stScreenOptions
+{
+ char *driverName;
+ // Encoding options
+ // !=0 if the encoding is forced. App=Application, Scr=Screen, Snd=Second Font
+ // Inp=Input.
+ uchar enForceApp, enForceScr, enForceSnd, enForceInp;
+ // Which encoding is used, -1 means default one.
+ int enApp, enScr, enSnd, enInp;
+
+ // Fonts options
+ // Which the user wants to loaded (Pri=Primary, Sec=Secondary)
+ uchar foPriLoad, foSecLoad;
+ // Names of the fonts
+ char *foPriName, *foSecName;
+ // Names of the font files
+ char *foPriFile, *foSecFile;
+ // Size of the primary (secondary must be of the same size)
+ unsigned foPriW,foPriH;
+ // The following are only valid at run-time
+ // Which one is really loaded
+ uchar foPriLoaded, foSecLoaded;
+ // Font callback installed
+ uchar foCallBackSet;
+ // Font collections
+ TVFontCollection *foPri, *foSec;
+
+ // Screen size options
+ // Behavior (set mode, use last resolution, etc.)
+ uint32 scOptions;
+ // Desired size
+ unsigned scWidth, scHeight;
+ // Desired char cell size
+ unsigned scCharWidth, scCharHeight;
+ // Video mode
+ unsigned scModeNumber;
+ // External program
+ char *scCommand;
+
+ // Is the palette different than the default one?
+ char palChanged;
+ // The screen colors palette, this is used during the load process.
+ // The real palette is handled by the TTextPalette class.
+ TScreenColor palette[16];
+};
+
+const uint32 scfDontForce=0, scfSameLast=1, scfExternal=2, scfForced=3, scfMode=4;
+
+class TSetEditorApp : public TApplication
+{
+public:
+ TSetEditorApp();
+ ~TSetEditorApp();
+
+ virtual void handleEvent( TEvent& event );
+ static TMenuBar *initMenuBar( TRect );
+ static TStatusLine *initStatusLine( TRect );
+ virtual void outOfMemory();
+ virtual TPalette& getPalette() const;
+ TCEditWindow *openEditor(char *fileName, Boolean visible, EditorResume *res=NULL,
+ int options=0);
+
+ void saveDesktop(const char *fName, int makeBkp);
+ void storeDesktop(fpstream& s);
+ Boolean loadDesktop(fpstream& s, Boolean isLocal);
+ static Boolean retrieveDesktop(TSetEditorApp *app, const char *name,
+ Boolean isLocal, int preLoad);
+ static Boolean preLoadDesktop(fpstream &s);
+ static void preLoadDesktop(char *name=0, int haveFilesCL=0);
+ static void finishPreLoadDesktop();
+ static void loadOldFontInfo(fpstream& s, stScreenOptions *scrOps);
+ static void loadEditorDesktop(int LoadPrj, char *name=0,
+ int haveFilesCL=0, int preLoad=0);
+ static void transferSetting2TV(void *p, void *arg=NULL);
+ static void displayDetectCallBack();
+ static void hotApplyScreenOptions();
+ static int resetVideoMode(Boolean redraw=False);
+ static stScreenOptions *loadOldDesktopScreenInfo(fpstream &s);
+ void ShowUserScreen(TEvent &event);
+ void createClipBoard(void);
+ virtual void idle();
+ virtual void getEvent(TEvent& event);
+ void screenSaver();
+ static void setCmdState(uint16 command,Boolean enable);
+ void GetContextHelp(void);
+ void pocketCalculator(void);
+ void RemapCodePageEd(void);
+ // Screen options routines
+ static void EncodingOptions(void);
+ static void FontsOptions(void);
+ static void ScreenOptions(void);
+ static void SetEditorFontsEncoding(int priChanged, int enPri, int sndChanged, int enSec);
+ static TScreenFont256 *FontRequestCallBack(int which, unsigned w, unsigned h);
+ static void SetEditorFonts(uchar priUse, char *priName, char *priFile,
+ TVBitmapFontSize *priSize,
+ uchar secUse, char *secName, char *secFile);
+ static int ChooseConvCPs(int &From, int &To, uint32 &ops);
+ static char *CreateTitle(const char *title);
+
+ static unsigned long deskTopVersion;
+
+ static char ShowClock;
+ static char UseScreenSaver;
+ static char UseExternPrgForMode;
+ static char DesktopPreloaded;
+ static char *WhichScrSaver;
+ static char ExtScrSaverOpts[extscrsParMxLen];
+ static int screenSaverTime;
+ static int screenSaverTimeMouse;
+ static char ExternalPrgMode[80];
+ static struct stScreenOptions *so;
+ static TScOptsCol *soCol;
+ void KillClock();
+
+ void ShowHelpTopic(char *file, char *node);
+ static TDskWinHelp *InfManager;
+ static TEditorCollection *edHelper;
+ static TCEditWindow *clipWindow;
+ static int helpRequest;
+ static ushort helpCtxRequested;
+ static int maxOpenEditorsSame;
+ static int DeleteFilesOnExit;
+ static unsigned geFlags;
+ static int widthVertWindows;
+ static TVCodePageCallBack oldCPCallBack;
+ static void cpCallBack(ushort *map);
+ static uint32 getModifFilesOps() { return modifFilesOps; }
+
+ void tile();
+ void cascade();
+ void SetTitle(const char *str1=0, const char *str2=0);
+
+ // Debugger interface
+ static void DebugToggleBreakpoint();
+ static int DebugOptionsEdit();
+ static int DebugInitVars();
+ static void DebugDeInitVars();
+ static int DebugCheckStopped(Boolean showConnect=False);
+ static int DebugCheckAcceptCmd(Boolean showConnect=False);
+ static int DebugConnect();
+ static int DebugSelectTarget(Boolean showConnect=False);
+ static void DebugUpdateCommands();
+ static void DebugRunOrContinue();
+ static void DebugPoll();
+ static void DebugStepOver();
+ static void DebugTraceInto();
+ static void DebugGoToCursor();
+ static void DebugFinishFun();
+ static void DebugReturnNow();
+ static void DebugStop();
+ static void DebugKill();
+ static void DebugCallStack();
+ static void DebugEvalModify(char *startVal);
+ static char *DebugEvalExpression(char *exp);
+ static char *DebugModifyExpression(char *exp, char *newVal);
+ static void DebugOptsMsgs();
+ static void DebugWatchExp(Boolean wScope, char *val);
+ static int DebugConfirmEndSession(Boolean directRequest=False);
+ static Boolean DebugCloseSession(Boolean confirm=True);
+ static void DebugCommandsForDisc();
+ static void DebugCommonCleanUp();
+ static void DebugEditBreakPts();
+ static void DebugEditWatchPts(char *startVal);
+ static void DebugMoveBreakPts();
+ static void DebugInspector(char *startVal);
+ static void DebugDataWindow(char *startVal);
+ static void DebugStackWindow();
+ static void DebugCleanElem();
+ static void DebugThreadSel();
+ static int DebugTimeOut(void *data);
+ static int DebugOptionsAdv();
+ static void DebugDisAsmWin();
+ static void DebugDetach();
+
+protected:
+
+ static void SetModifCheckOptions();
+ virtual void fileOpen();
+ void fileOpenCopy();
+ void fileNew();
+ void changeDir();
+ virtual void dosShell();
+ void showClip();
+
+ static clock_t LastTimeUpdate;
+ static TDeskTopClock *Clock;
+ void CreateClock();
+
+ char *OriginalWindowTitle;
+
+ static CLY_StreamPosT posPreload;
+ static char fontCreated;
+
+ static uint32 modifFilesOps;
+
+ static TMultiMenuBar *multiMenuBar;
+};
+
+// modifFilesOps:
+const uint32 mfoDontCheckAfterRun=1, mfoDontCheckInIdle=2;
+const int oedNoSelect=1,oedForceRO=2,oedZoom=4,oedForgetResume=8,
+ oedDontOpenEmpty=16;
+const unsigned geVertWindows=1,geRightSide=2,geAvoidPrjAndMsg=0x80000000,
+ geZoomedIfNoPrj=0, geZoomedNPorZ=0x10, geAlwaysZoomed=0x20,
+ geMask1=3, geMask2=0x30, geShift2=4;
+
+extern TSetEditorApp *editorApp;
+#endif
+
+#ifdef Uses_SETAppDialogs
+#include <stdarg.h>
+
+ushort execDialog( TDialog *d, void *data );
+unsigned doEditDialog( int dialog, va_list first );
+extern void executeCalc(char *startVal=NULL);
+const int maxGrepString=200;
+extern void grepWindow(char *patStart);
+extern void SetGeneralEditorOptions(void);
+extern int SetFileOpenDialogOptions(void);
+extern void SetScreenSaversOptions(void);
+extern int AboutStartBox(void);
+extern void FullAboutBox(void);
+extern void ShowUserScreenDialog();
+class TDskWinMan;
+extern TDskWinMan *ManPageView(const char *name); // From dskman.cc
+extern const char *cmeQuitDeleteMessage;
+#endif
+
+#ifdef Uses_SETAppVarious
+class fpstream;
+class TStringCollection;
+class TDskWinHelp;
+class TCEditor;
+class TCEditWindow;
+class TDskWin;
+struct stEditorId;
+
+const unsigned gflCPULine=1, gflDontSelect=2;
+
+extern TView *setFocusTo;
+extern Boolean focusChanged;
+extern void CopyHelp2Clip(char *b, long l);
+extern void ShowHelpTopic(char *file, char *node);
+extern void closeView(TView *p, void *p1);
+extern int ShowFileLine(int line, int column, char *name);
+extern int GotoFileLine(int line, int column, char *name, char *msg=0, int off=-1,
+ int len=0, unsigned flags=0);
+extern int GotoFileText(char *search, char *file, char *msg=0, int off=-1, int len=0);
+extern TCEditWindow *GetEditorWindowForFile(char *file);
+extern void GPushCursorPos();
+extern void GPopCursorPos();
+extern void SetScreenOps(void);
+extern void EditPalette(void);
+extern void SaveEnviromentFile(void);
+extern void ConfigureRunCommand(void);
+extern void SaveRunCommand(fpstream &s);
+extern void LoadRunCommand(fpstream &s);
+extern void SaveGrepData(fpstream &s);
+extern void LoadGrepData(fpstream &s);
+extern void ReLoadModifEditors(void);
+extern int EdReloadIfOpened(const char *name, stEditorId *id);
+extern int AskReloadEditor(TCEditWindow *edw);
+extern int ResetVideoMode(int mode,int redraw=1);
+const int scsvInternal=0, scsvExternal=1;
+extern TStringCollection *GetScreenSaverList(int forceReRead=0);
+extern void *WichSaverIs(char *name, int &type);
+extern char *GetDefaultScreenSaver(void);
+extern char *GetScrSaverInfo(char *name);
+extern char *GetScrSaverHelp(char *name);
+extern void ShowHelpTopic(char *file, char *node);
+extern void ShowTips(char *fileName, int forceDialog=0);
+extern int IsAnEditor(void *p);
+extern TCEditor *GetCurrentIfEditor();
+extern void UpdateEditorCommands();
+extern int SelectWindowNumber(int num);
+extern int CloseWindowNumber(int num);
+extern int GetWindowCols(int num);
+extern int GetWindowRows(int num);
+extern int GetWrapCol(int wn);
+extern void HTMLAcc_Entry(Boolean compact);
+TCEditWindow *IsAlreadyOnDesktop(char *fileName, int *cant=0, stEditorId *id=0);
+extern void ASCIIWindow();
+extern void CalendarWindow();
+//extern void RemoveFromEditorsHelper(TView *p, int type);
+extern void AddNonEditorToHelper(TDskWin *p);
+extern unsigned doEditDialogLocal(int dialog, ...);
+extern void BringListOfWindows(void);
+extern void FinishFocusChange();
+extern int GetMaxWindowNumber();
+
+extern char *TranslateCommandToMacro(unsigned command);
+extern int RegisterMacroCommand(char *name);
+extern int isAMacroInMenu(unsigned command);
+extern void UnRegisterMacroCommands(void);
+
+// From edcolor.cc
+extern void Colors();
+extern void ColorTheme();
+
+void FullSuspendScreen();
+void FullResumeScreen();
+// Open a file and insert it in the desktop
+extern void OpenFileFromEditor(char *fullName);
+extern int OpenFileFromEditorRet(char *fullName, int &number);
+// Defined in dstfile.cc to indicate we loaded the desktop file from the current
+// directory and not from the default one.
+extern char DstLoadedHere;
+#endif
+
+#ifdef Uses_SETAppProject
+class TRect;
+
+extern void OpenProject(char *name=NULL, int preLoad=0);
+extern void CloseProject(int openDesktop);
+extern void SaveProject();
+extern int IsPrjOpened();
+extern int IsPrjVisible();
+extern int IsPrjZoomed();
+extern void SaveDesktopHere(void);
+extern void ExportProjectItems();
+extern void ImportProjectItems();
+extern char *GetProjectItem(int number);
+extern int GetMaxProjectItem();
+const unsigned wnopEspaceSep=0, wnopLineSep=1;
+extern int WriteNamesOfProjectTo(FILE *f, unsigned mode=wnopEspaceSep);
+extern int WriteNamesOfProjectToTime(FILE *f, time_t timeT, uint32 targetMask=0);
+extern int ClearForceTargetBits(uint32 bits);
+extern int SetForceTargetBits(uint32 bits);
+extern void ProjectInsertAutoTagFiles();
+extern Boolean ProjectGetSize(TRect &r);
+extern char *GetRelIfFileInPrj(char *name);
+extern char *GetAbsForNameInPrj(const char *name);
+extern void ProjectApplyToItems(ccAppFunc action, void *arg);
+extern void ProjectGetNameFromItem(void *p, char *dest, int size);
+
+// The forceTarget is a bitmap for each target suported by the project.
+// Currently the only target is the TAGs file.
+// An item with forceTarget bit 1 means the entry is new and we should
+// take as newer than the target.
+const uint32 prjtTags=1, prjtAllTargets=1;
+#endif
+
+#ifdef Uses_SETAppFiles
+extern int FileOpenDialog(char *title, char *file);
+#define DeskTopFileName "tcedit.dst"
+#define DeskTopFileNameHidden ".tcedit.dst"
+#define CLEFile "errors.cle"
+#define NBKPFile "nobkp.txt"
+extern const char *cDeskTopFileName;
+extern const char *cDeskTopFileNameHidden;
+#if defined(TVOS_UNIX) || defined(TVCompf_Cygwin)
+ #define HIDDEN_DIFFERENT
+#endif
+#define ProjectFileExt ".epr"
+#define DeskTopFileExt ".dst"
+extern int edTestForFile(const char *name);
+#endif
+
+#ifdef Uses_SETAppHelper
+class TDskWin;
+int SearchInHelper(int ,void *);
+TDskWin *SearchInHelperWin(int type, void *p);
+void AddNonEditorToHelper(TDskWin *p);
+void SaveAllEditors(void);
+#endif
+
diff --git a/setedit/setedit/include/tpaltext.h b/setedit/setedit/include/tpaltext.h
new file mode 100644
index 0000000..f4343ff
--- /dev/null
+++ b/setedit/setedit/include/tpaltext.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+typedef TScreenColor PalCol;
+class fpstream;
+
+class TTextPalette
+{
+public:
+ TTextPalette() {};
+
+ static void SetOne(int color, int R, int G, int B);
+ static void GetOne(int color, int &R, int &G, int &B);
+ static void BackToDefault(void);
+ static void Load(fpstream &s, PalCol *pal=NULL);
+ static void GetArray(unsigned *pal);
+ static PalCol *GetAllPal();
+ static void Copy(PalCol *dest);
+ static void SetAllPal(PalCol *);
+ static void Restore();
+ static void Cache();
+ static void ComputeChanged();
+ static void PreparePal(PalCol *pal);
+ static char IsChanged() { return Changed; };
+
+protected:
+ static PalCol ActualPalette[16];
+ static char Changed;
+};
+
+extern TTextPalette *EditorPalette;
+#define DeclarePalette TTextPalette *EditorPalette
+#define InitPaletteSystem() EditorPalette=new TTextPalette()
+#define ShutDownPaletteSystem() delete EditorPalette
+#define LoadPaletteSystem(s) EditorPalette->Load(s)
+#define LoadPaletteSystemDontSet(s,p) EditorPalette->Load(s,p)
+#define GetRGBArrayPaletteSystem(a) EditorPalette->GetArray(a)
+#define RestorePaletteSystem() EditorPalette->Restore()
+#define CacheActualPalette() EditorPalette->Cache()
+#define ComputeChangedStatus() EditorPalette->ComputeChanged()
+#define PreparePalForRestore(p) EditorPalette->PreparePal(p)
+#define PaletteWasChanged() EditorPalette->IsChanged()
+#define PaletteCopy(p) EditorPalette->Copy(p)
+
diff --git a/setedit/setedit/intgrep.cc b/setedit/setedit/intgrep.cc
new file mode 100644
index 0000000..3b8636a
--- /dev/null
+++ b/setedit/setedit/intgrep.cc
@@ -0,0 +1,597 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_stdlib
+#define Uses_alloca
+#define Uses_stdio
+#define Uses_string
+#define Uses_unistd
+#define Uses_ctype
+#define Uses_dirent
+#define Uses_sys_stat
+#define Uses_getcwd
+#define Uses_chdir
+
+#define Uses_TDialog
+#define Uses_TDeskTop
+#define Uses_TProgram
+#define Uses_TApplication
+#define Uses_TObject
+#define Uses_TInputLine
+#define Uses_TLabel
+#define Uses_THistory
+#define Uses_TRect
+#define Uses_TCheckBoxes
+#define Uses_TRadioButtons
+#define Uses_TButton
+#define Uses_TButton
+#define Uses_MsgBox
+#define Uses_TSItem
+#define Uses_TCEditor
+#define Uses_TInputLinePiped
+#define Uses_TInputLinePipedConst
+#define Uses_TListBox
+#define Uses_TSOSListBox
+#define Uses_fpstream
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <ceditor.h>
+#define Uses_SETAppHelper
+#define Uses_SETAppConst
+#define Uses_SETAppVarious
+#define Uses_SETAppProject
+#include <setapp.h>
+
+// Prototypes for the message win.
+#include <edmsg.h>
+#include <splinman.h>
+#include <rhutils.h>
+#include <edhists.h>
+//#if !(defined(SEOS_Win32) || defined(SEOSf_FreeBSD))
+//#include <ftw.h>
+//#endif
+#include <dyncat.h>
+#include <pathtool.h>
+
+// From editmain.cc generates the list of opened editors
+extern int WriteNamesOfOpenedTo(FILE *f);
+extern ushort execDialog( TDialog *d, void *data );
+
+//const int tilpNoPipe=1,tilpNoCopy=2,tilpNoPaste=4;
+
+// This collection is a list of the visited directories to avoid loops when
+// a link points back in the tree.
+static TStringCollection *Visited=0;
+// Static to avoid consuming 1Kb by recursion in the stack
+static char TempDirName[PATH_MAX];
+
+void FullInputString(int x, int y, int w, int size,int histID,
+ const char *name, unsigned flags, TDialog *d)
+{
+ TInputLine *inp=new TInputLinePiped(TRect(x+1,y+1,x+w,y+2),size,flags);
+ d->insert(inp);
+ d->insert(new TLabel(TRect(x,y,x+w,y+1),name,inp));
+ d->insert(new THistory(TRect(x+w,y+1,x+w+3,y+2),inp,histID));
+}
+
+const int maxDirLen=80;
+
+typedef struct
+{
+ char pattern[200];
+ char files[80];
+ char dirs[maxDirLen];
+ uint16 sourP;
+ uint16 typeP;
+ uint16 where;
+ uint16 recurse;
+ uint16 ops;
+} GrepBoxOld;
+
+typedef struct
+{
+ char pattern[200];
+ char files[80];
+ char dirs[maxDirLen];
+ uint32 sourP;
+ uint32 typeP;
+ uint32 where;
+ uint32 recurse;
+ uint32 ops;
+} GrepBox;
+const uint32 grewFiles=0, grewOpened=1, grewProject=2;
+// empty,empty,Pattern box,Basic reg.,search in project,ignore case
+static GrepBox box={"","*.[ch]*",".",0,0,grewProject,0,1};
+
+const int Col1=1,Col2=40,End1=39,End2=72;
+
+static
+char *SaveClipToTemp(void)
+{
+ char *name=unique_name("cl");
+ if (!name || !TCEditor::clipboard || !TCEditor::clipboard->hasSelection())
+ {
+ messageBox(__("The clipboard is empty"),mfOKButton);
+ return 0;
+ }
+ FILE *f=fopen(name,"wt");
+ fwrite(TCEditor::clipboard->buffer+TCEditor::clipboard->selStart,
+ TCEditor::clipboard->selEnd-TCEditor::clipboard->selStart,1,f);
+ fclose(f);
+ return name;
+}
+
+static char ActualPath[PATH_MAX];
+
+static
+char *ParseFun(char *buf, FileInfo &fI, char *&fileName)
+{
+ char *endOfName,*endOfLine=0;
+ int offset=0;
+
+ fI.type=fitNone;
+ // Look for file name and line number
+ // It fails if: The file is absolute and starts with a number
+ if (TVCodePage::isAlpha(buf[0]) && buf[1]==':' && (!ucisdigit(buf[2])))
+ offset=2;
+ endOfName=strchr(buf+offset,':');
+ if (endOfName)
+ endOfLine=strchr(endOfName+1,':');
+ if (!endOfName || !endOfLine || !ucisdigit(endOfName[1]))
+ return 0;
+
+ char *ret;
+ fI.type=fitInfo;
+ fI.len=strlen(endOfLine+1);
+ fI.offset=endOfLine-buf+1;
+ ret=newStr(buf);
+ char bFile[PATH_MAX];
+ if (offset || buf[0]=='/' || buf[0]=='\\')
+ { // Absolute path
+ *endOfName=0;
+ strcpy(bFile,buf);
+ }
+ else
+ { // Relative path
+ // Put the actual directory
+ strcpy(bFile,ActualPath);
+ // Now the name
+ *endOfName=0;
+ strcat(bFile,buf);
+ }
+ // Fix it to avoid things like /dir/../dir/file
+ CLY_fexpand(bFile);
+ fileName=newStr(bFile);
+
+ *endOfLine=0;
+ fI.Line=atoi(endOfName+1);
+ fI.Column=1;
+
+ return ret;
+}
+
+/*
+ This routine checks if grep is there. If we can't find it we must put a warning
+*/
+static
+int CheckForGREP(void)
+{
+ static int isGREPInstalled=0;
+
+ if (!isGREPInstalled)
+ {
+ // We must rediret the error to avoid getting it in the stderr file
+ char *err=open_stderr_out();
+ TScreen::System("grep -V");
+ close_stderr_out();
+ // Check what we got
+ FILE *f=fopen(err,"r");
+ int ok=0;
+ if (f)
+ {
+ char resp[80];
+ fgets(resp,80,f);
+ fclose(f);
+ ok=strstr(resp,"GNU grep")!=0;
+ }
+ unlink(err);
+
+ if (ok)
+ isGREPInstalled=1;
+ else
+ messageBox(__("You must install GNU grep to use it!"), mfError | mfOKButton);
+ }
+
+ return isGREPInstalled;
+}
+
+static
+void RunGrep(char *command)
+{
+ char *out;
+ char *err;
+ if (!CheckForGREP())
+ return;
+
+ Boolean oldBusy=TScreen::showBusyState(True);
+
+ char b[PATH_MAX+60];
+ out=open_stdout();
+ err=open_stderr();
+ getcwd(ActualPath,PATH_MAX);
+ TVIntl::snprintf(b,PATH_MAX+60,__("Running grep in: %s"),ActualPath);
+ if (ActualPath[strlen(ActualPath)-1]!='/')
+ strcat(ActualPath,"/");
+ EdShowMessage(b);
+ #ifdef SECompf_djgpp
+ // Force the command.com because bash fails
+ // Is this use of putenv correct? I think not.
+ char *envShell=getenv("SHELL");
+ char *envShellCopy=0;
+ if (envShell)
+ {
+ envShellCopy=(char *)alloca(strlen(envShell)+1+6);
+ sprintf(envShellCopy,"SHELL=%s",envShell);
+ putenv("SHELL=");
+ }
+ // Call it
+ TScreen::System(command);
+ // Now restore the environment
+ if (envShell)
+ // IMPORTANT! we can do it with djgpp because djgpp makes a copy
+ // of the string we pass to putenv. Other implementations (like
+ // GNU libc) doesn't copy the string and this is invalid.
+ putenv(envShellCopy);
+ #else
+ // Call it
+ TScreen::System(command);
+ #endif
+ close_stdout();
+ close_stderr();
+
+ TScreen::showBusyState(oldBusy);
+
+ DumpFileToMessage(err,__("From stderr:"),edsmEverScroll);
+ DumpFileToMessage(out,__("From stdout:"),edsmEverScroll,ParseFun);
+}
+
+static int stopRecurse;
+
+// That's similar to ftw, I didn't used ftw because isn't in the libc.info of my
+// Linux so I don't know if that's so common.
+static
+void look_in(char *command)
+{
+ DIR *d;
+ struct dirent *f;
+ char *name,*pwdHere;
+ ccIndex pos;
+
+ // Keep record of our current location
+ getcwd(TempDirName,PATH_MAX);
+ pwdHere=newStr(TempDirName);
+ if (Visited->search(pwdHere,pos))
+ { // Hey we already scanned it!
+ delete pwdHere;
+ return;
+ }
+ Visited->atInsert(pos,pwdHere);
+
+ TEvent event;
+ TProgram::application->getEvent(event);
+ if (event.what==evCommand && event.message.command==cmeStopChild)
+ {
+ stopRecurse=1;
+ return;
+ }
+ RunGrep(command);
+
+ d=opendir(".");
+ if (d)
+ {
+ while ((f=readdir(d))!=0 && !stopRecurse)
+ {
+ name=f->d_name;
+ // Skip . and .. they aren't useful
+ if (name[0]=='.')
+ {
+ if (name[1]==0 || (name[1]=='.' && name[2]==0))
+ continue;
+ }
+ if (IsADirectory(name)) // It also checks valid access
+ { // Recurse
+ chdir(name);
+ look_in(command);
+ // We must go back to the previous location, .. isn't useful
+ // when we taked a link
+ chdir(pwdHere);
+ }
+ }
+ closedir(d);
+ }
+}
+
+static
+void RunRecurseGrep(char *command, int recurse)
+{
+ TView::disableCommand(cmeStopChild);
+
+ char dirTemp[maxDirLen];
+ // A copy to use strtok
+ strcpy(dirTemp,box.dirs);
+
+ char StartPoint[PATH_MAX];
+ getcwd(StartPoint,PATH_MAX);
+
+ CLY_destroy(Visited); // Just in case
+ Visited=new TStringCollection(10,5);
+
+ char *s=strtok(dirTemp,";, ");
+ while (s)
+ {
+ if (chdir(s))
+ {
+ char b[PATH_MAX+60];
+ TVIntl::snprintf(b,PATH_MAX+60,__("chdir error: %s"),s);
+ EdShowMessage(b);
+ }
+ else
+ {
+ if (recurse)
+ {
+ TView::enableCommand(cmeStopChild);
+ look_in(command);
+ TView::disableCommand(cmeStopChild);
+ }
+ else
+ RunGrep(command);
+ }
+
+ s=strtok(NULL,";, ");
+ chdir(StartPoint);
+ }
+
+ CLY_destroy(Visited);
+ Visited=0;
+}
+
+static
+void ArrangeGrepCommand(char *command, char *param)
+{
+ #if defined(SEOS_DOS) || defined(SEOS_Win32)
+ #define InitParametersFile()
+ #define SetAccessToParameters(a)
+ // In DOS/Win32 I use a response file to pass a very long list of parameters
+ sprintf(command,"grep @%s",param);
+ #endif
+
+ #ifdef SEOS_UNIX
+ #define InitParametersFile() fputs("grep ",f)
+ #define SetAccessToParameters(a) chmod(a,S_IXUSR | S_IRUSR)
+ // Response files aren't supported in UNIX :-(, so I just use a file that's
+ // in fact a script
+ strcpy(command,param);
+ #endif
+}
+
+void grepWindow(char *patStart)
+{
+ TDialog *d=new TDialog(TRect(0,0,74,18),__("Powered Grep by SET"));
+ d->options|=ofCentered;
+ d->helpCtx=cmeGrepDialog;
+
+ // ACDEFGIJKLNORPSTUWX
+ // Pattern section
+ FullInputString(Col1,1,End1-Col1-3,200,hID_TextSearchEditor,__("~P~attern box"),0,d);
+ FullInputString(Col2,1,End2-Col2-3,80,hID_GrepFiles,__("Files to ~s~earch"),tilpNoPipe,d);
+ FullInputString(Col1,3,End2-Col1-3,maxDirLen,hID_GrepPlaces,__("~D~irectories to search"),tilpNoPipe,d);
+
+ TRadioButtons32 *sourP=new TRadioButtons32(TRect(Col1+1,7,End1,10),
+ new TSItem(__("`Pattern box' is the pa~t~tern"),
+ new TSItem(__("`Pattern box' is a fi~l~e name"),
+ new TSItem(__("Use the ~c~lipboard selection"),0 ))));
+ d->insert(sourP);
+ d->insert(new TLabel(TRect(Col1,6,End1,7),__("Source of Pattern"),sourP));
+
+ TRadioButtons32 *typeP=new TRadioButtons32(TRect(Col1+1,11,End1,14),
+ new TSItem(__("Basic regular expression (-~G~)"),
+ new TSItem(__("~E~xtended regular expression (-E)"),
+ new TSItem(__("~F~ixed separated by CR (-F)"),0 ))));
+ d->insert(typeP);
+ d->insert(new TLabel(TRect(Col1,10,End1,11),__("Type of Pattern"),typeP));
+
+ TRadioButtons32 *where=new TRadioButtons32(TRect(Col2+1,7,End2,10),
+ new TSItem(__("~U~se `Files to search'"),
+ new TSItem(__("Search in ope~n~ed windows"),
+ new TSItem(__("Search in pro~j~ect"),0 ))));
+ d->insert(where);
+ d->insert(new TLabel(TRect(Col2,6,End2,7),__("Pl~a~ces to search"),where));
+ d->insert(new TCheckBoxes32(TRect(Col2+1,10,End2,11),
+ new TSItem(__("~R~ecurse in subdirs"),0 )));
+
+ TCheckBoxes32 *ops=new TCheckBoxes32( TRect(Col2+1,12,End2,16),
+ new TSItem(__("~I~gnore case (-i)"),
+ new TSItem(__("~W~hole words only (-w)"),
+ new TSItem(__("Whole line (-~x~)"),
+ new TSItem(__("In~v~erse matching (-v)"), 0 )))));
+ d->insert(ops);
+ d->insert(new TLabel(TRect(Col2,11,End2,12),__("~O~ptions"),ops));
+
+ d->insert(new TButton(TRect(2,15,14,17),__("O~K~"),cmOK,bfDefault));
+ d->insert(new TButton(TRect(18,15,30,17),__("Cancel"),cmCancel,bfNormal));
+
+ d->selectNext(False);
+
+ if (patStart)
+ {
+ strcpy(box.pattern,patStart);
+ delete[] patStart;
+ }
+
+ // If we have no project change this option
+ if (box.where==grewProject && !IsPrjOpened())
+ box.where=grewFiles;
+
+ if (execDialog(d,&box)!=cmCancel)
+ {
+ if (box.dirs[0]==0)
+ {
+ messageBox(__("You must provide at least one directory to search"),mfOKButton);
+ return;
+ }
+ char b[12];
+ char *param=0;
+ char command[PATH_MAX*2+80];
+ char *clipTemp=0;
+ int ok=1,absolute=0;
+
+ param=unique_name("pa");
+ FILE *f=fopen(param,"wb");
+ if (!f)
+ {
+ string_free(param);
+ return;
+ }
+ InitParametersFile();
+ int i=1;
+ b[0]='-';
+ // Always numbers
+ b[i++]='n';
+ // Options from the dialog
+ if (box.ops & 1)
+ b[i++]='i';
+ if (box.ops & 2)
+ b[i++]='w';
+ if (box.ops & 4)
+ b[i++]='x';
+ if (box.ops & 8)
+ b[i++]='v';
+ // Type of grep
+ switch (box.typeP)
+ {
+ case 1:
+ b[i++]='E';
+ break;
+ case 2:
+ b[i++]='F';
+ break;
+ default:
+ b[i++]='G';
+ break;
+ }
+ b[i++]=' ';
+ b[i]=0;
+ fputs(b,f);
+ // Pattern
+ switch (box.sourP)
+ {
+ case 1:
+ fputs("-f ",f);
+ fputs(box.pattern,f);
+ break;
+ case 2:
+ if ((clipTemp=SaveClipToTemp())==0)
+ ok=0;
+ else
+ {
+ fputs("-f ",f);
+ fputs(clipTemp,f);
+ }
+ break;
+ default:
+ fputs("-e ",f);
+ if (strchr(box.pattern,'\"')!=0)
+ { // If have " let as-is
+ fputs(box.pattern,f);
+ }
+ else
+ { // Try to preserve the spaces
+ fputc('\"',f);
+ fputs(box.pattern,f);
+ fputc('\"',f);
+ }
+ }
+ fputc(' ',f);
+ // Files
+ switch (box.where)
+ {
+ case 1:
+ if (!WriteNamesOfOpenedTo(f))
+ {
+ messageBox(__("There aren't any files open"),mfOKButton);
+ ok=0;
+ }
+ absolute=1;
+ break;
+ case 2:
+ if (!WriteNamesOfProjectTo(f))
+ {
+ messageBox(__("No files in project"),mfOKButton);
+ ok=0;
+ }
+ absolute=1;
+ break;
+ default:
+ fputs(box.files,f);
+ }
+ fputs(" /dev/null",f);
+ fclose(f);
+ SetAccessToParameters(param);
+
+ if (ok)
+ {
+ SaveAllEditors();
+ EdShowMessageI(__("Powered grep"),True);
+ stopRecurse=0;
+ if (absolute)
+ {
+ if (box.recurse)
+ EdShowMessageI(__("Recurse & dirs. ignored, using internal names"));
+ ArrangeGrepCommand(command,param);
+ RunGrep(command);
+ }
+ else
+ {
+ ArrangeGrepCommand(command,param);
+ RunRecurseGrep(command,box.recurse);
+ }
+ if (stopRecurse)
+ EdShowMessageI(__("Grep search aborted"));
+ else
+ EdShowMessageI(__("End of grep search"));
+ EdJumpToMessage(0);
+ SpLinesUpdate();
+ }
+
+ if (box.sourP==2)
+ unlink(clipTemp);
+ unlink(param);
+ string_free(param);
+ string_free(clipTemp);
+ }
+}
+
+void SaveGrepData(fpstream &s)
+{
+ s << (char)2; // version
+ s.writeBytes(&box,sizeof(GrepBox));
+}
+
+void LoadGrepData(fpstream &s)
+{
+ char version;
+ s >> version;
+ if (version<=1)
+ {
+ GrepBoxOld oldBox;
+ s.readBytes(&oldBox,sizeof(GrepBoxOld));
+ memcpy(&box,&oldBox,200+80+80);
+ box.sourP=oldBox.sourP;
+ box.typeP=oldBox.typeP;
+ box.where=oldBox.where;
+ box.recurse=oldBox.recurse;
+ box.ops=oldBox.ops;
+ }
+ else
+ s.readBytes(&box,sizeof(GrepBox));
+}
diff --git a/setedit/setedit/loadcle.cc b/setedit/setedit/loadcle.cc
new file mode 100644
index 0000000..73746b4
--- /dev/null
+++ b/setedit/setedit/loadcle.cc
@@ -0,0 +1,384 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_string
+#define Uses_ctype
+#define Uses_stdio
+#define Uses_stdlib
+
+#define Uses_TStringCollection
+#include <tv.h>
+
+#include <ced_pcre.h>
+#include <dyncat.h>
+#include <loadcle.h>
+
+strCLE *CLEValues=0;
+static int CLECant=0;
+static char CLELoaded=0;
+static char *CLEFile=0;
+static int CLEMaxSubEx=0;
+static int *PCREMatchs=0;
+static TStringCollection *CLEList=0;
+
+static void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+static char *MoveAfterEqual(char *s)
+{
+ for (; *s && *s!='='; s++);
+ if (*s) s++;
+ for (; *s && ucisspace(*s); s++);
+ return s;
+}
+
+static
+void LoadCLENames()
+{
+ FILE *f;
+ int i;
+ char *pos;
+
+ if (CLELoaded || !CLEFile)
+ return;
+
+ // We must have at least an empty list
+ destroy0(CLEList);
+ CLEList=new TStringCollection(6,4);
+
+ if ((f=fopen(CLEFile,"rt"))==NULL)
+ return;
+
+ char b[maxCLEFileWidth];
+ // Meassure the number of definitions
+ for (CLECant=0; !feof(f); )
+ {
+ fgets(b,maxCLEFileWidth,f);
+ if (!feof(f) && strncasecmp(b,"End",3)==0)
+ CLECant++;
+ }
+ CLELoaded=1;
+ if (!CLECant)
+ {
+ fclose(f);
+ return;
+ }
+
+ // Allocate enough memory
+ CLEValues=new strCLE[CLECant];
+ memset(CLEValues,0,sizeof(strCLE)*CLECant);
+
+ rewind(f);
+ for (i=0; i<CLECant && !feof(f); i++)
+ {
+ do
+ {
+ do
+ {
+ fgets(b,maxCLEFileWidth,f);
+ }
+ while (*b=='#' || ucisspace(*b));
+
+ if (strncasecmp(b,"Name",4)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ char *s=newStr(pos);
+ CLEValues[i].Name=s;
+ CLEList->insert(s);
+ }
+ else
+ // Avoid name pointing to NULL
+ if (strncasecmp(b,"End",3)==0 && !CLEValues[i].Name)
+ {
+ char *s=TVIntl::getTextNew(__("Unknown"));
+ CLEValues[i].Name=s;
+ CLEList->insert(s);
+ }
+ }
+ while (!feof(f) && strncasecmp(b,"End",3)!=0);
+ }
+ fclose(f);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the index of the CLE in the array.
+
+ Return:
+ Index or -1 if not found or load error.
+
+***************************************************************************/
+
+int CLEGetIndexOf(const char *name)
+{
+ if (!CLELoaded) LoadCLENames();
+ if (!CLELoaded) return -1;
+
+ int eureka,i;
+ // Look for name in the array
+ for (eureka=0, i=0; i<CLECant; i++)
+ {
+ eureka=strcmp(CLEValues[i].Name,name)==0;
+ if (eureka) break;
+ }
+ if (!eureka)
+ return -1;
+ return i;
+}
+
+#if 0
+ #define SubExVal(a) \
+ if (strncasecmp(b,#a,sizeof(#a)-1)==0) \
+ { \
+ pos=MoveAfterEqual(b); \
+ ReplaceCRby0(pos); \
+ CLEValues[i].##a=atoi(pos); \
+ }
+
+ #define ExpComp(a) \
+ if (strncasecmp(b,#a,sizeof(#a)-1)==0) \
+ { \
+ pos=MoveAfterEqual(b); \
+ ReplaceCRby0(pos); \
+ CLEValues[i].##a=CLECompileRegEx(pos,subExp); \
+ if (subExp>subExpMax) \
+ subExpMax=subExp; \
+ }
+#else
+ #define SubExVal(a) \
+ if (strncasecmp(b,#a,sizeof(#a)-1)==0) \
+ { \
+ pos=MoveAfterEqual(b); \
+ ReplaceCRby0(pos); \
+ CLEValues[i].a=atoi(pos); \
+ }
+
+ #define ExpComp(a) \
+ if (strncasecmp(b,#a,sizeof(#a)-1)==0) \
+ { \
+ pos=MoveAfterEqual(b); \
+ ReplaceCRby0(pos); \
+ CLEValues[i].a=CLECompileRegEx(pos,subExp); \
+ if (subExp>subExpMax) \
+ subExpMax=subExp; \
+ }
+#endif
+
+static
+void LoadOneCLE(const char *name)
+{
+ if (!SUP_PCRE)
+ return;
+ FILE *f;
+ int i,eureka,subExp,subExpMax=0,index;
+ char *pos;
+
+ index=CLEGetIndexOf(name);
+ if (index<0 || CLEValues[index].Loaded) return;
+ if ((f=fopen(CLEFile,"rt"))==NULL)
+ return;
+
+ char b[maxCLEFileWidth];
+ // Look for name in the file
+ for (eureka=0, i=0; i<CLECant && !eureka && !feof(f); i++)
+ {
+ do
+ {
+ do
+ {
+ fgets(b,maxCLEFileWidth,f);
+ }
+ while (*b=='#' || ucisspace(*b));
+
+ if (strncasecmp(b,"Name",4)==0)
+ {
+ pos=MoveAfterEqual(b);
+ ReplaceCRby0(pos);
+ if (strcmp(name,pos)==0)
+ eureka=1;
+ }
+ }
+ while (!eureka && !feof(f) && strncasecmp(b,"End",3)!=0);
+ }
+ if (!eureka)
+ {
+ fclose(f);
+ return;
+ }
+
+ i=index;
+ #define C(a) CLEValues[i].a=0xFF
+ C(File);
+ C(Line);
+ C(Severity);
+ C(Description);
+ C(EnterDirDir);
+ #undef C
+ // Load it.
+ do
+ {
+ do
+ {
+ fgets(b,maxCLEFileWidth,f);
+ }
+ while (*b=='#' || ucisspace(*b));
+
+ if (strncasecmp(b,"UseInternal",11)==0)
+ CLEValues[i].UseInternal=1;
+ else
+ ExpComp(Pattern)
+ else
+ SubExVal(File)
+ else
+ SubExVal(Line)
+ else
+ SubExVal(Severity)
+ else
+ SubExVal(Description)
+ else
+ ExpComp(EnterDirPat)
+ else
+ ExpComp(LeaveDir)
+ else
+ SubExVal(EnterDirDir)
+ else
+ ExpComp(SevError)
+ else
+ ExpComp(SevWarn)
+ }
+ while (!feof(f) && strncasecmp(b,"End",3)!=0);
+ CLEValues[i].Loaded=1;
+
+ if (subExpMax>CLEMaxSubEx)
+ {
+ delete PCREMatchs;
+ CLEMaxSubEx=subExpMax;
+ PCREMatchs=new int[CLEMaxSubEx];
+ }
+
+ fclose(f);
+}
+
+int CLEGetIndexOfLoad(const char *name)
+{
+ int i=CLEGetIndexOf(name);
+ if (!CLELoaded) return -1;
+ if (!CLEValues[i].Loaded) LoadOneCLE(name);
+ if (!CLEValues[i].Loaded || CLEValues[i].UseInternal) return -1;
+ return i;
+}
+
+void UnloadCLEFile()
+{
+ int i;
+ destroy0(CLEList);
+ if (CLECant && CLEValues)
+ {
+ for (i=0; i<CLECant; i++)
+ {
+ free(CLEValues[i].Pattern);
+ free(CLEValues[i].EnterDirPat);
+ free(CLEValues[i].LeaveDir);
+ // Part of the string collection!
+ //delete CLEValues[i].Name;
+ }
+ }
+ delete[] CLEValues;
+ CLEValues=0;
+ CLECant=0;
+ CLELoaded=0;
+ CLEMaxSubEx=0;
+ delete[] PCREMatchs;
+ PCREMatchs=0;
+ delete[] CLEFile;
+ CLEFile=0;
+}
+
+void CLESetFileName(const char *name)
+{
+ delete[] CLEFile;
+ CLEFile=newStr(name);
+}
+
+TStringCollection *CLEGetList()
+{
+ if (!CLELoaded) LoadCLENames();
+ return CLEList;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Compiles a RegEx.
+
+ Return: A pointer to the compiled RegEx or 0 if error.
+
+***************************************************************************/
+
+pcre *CLECompileRegEx(char *text, int &subX)
+{
+ if (!SUP_PCRE)
+ return NULL;
+ const char *error;
+ int errorOffset;
+ pcre *ret=pcre_compile(text,0,&error,&errorOffset,0);
+ if (!ret)
+ {
+ subX=0;
+ return 0;
+ }
+
+ subX=(pcre_info(ret,0,0)+1)*3;
+ return ret;
+}
+
+static int LastHits=0;
+static char *BufSearch;
+
+int CLEDoSearch(char *search, int len, pcre *CompiledPCRE)
+{
+ if (!SUP_PCRE)
+ return 0;
+ LastHits=pcre_exec(CompiledPCRE,0,search,len,PCRE206 0,PCREMatchs,CLEMaxSubEx);
+ BufSearch=search;
+
+ return LastHits<0 ? 0 : LastHits;
+}
+
+int CLEGetMatch(int match, char *buf, int maxLen)
+{
+ if (!SUP_PCRE)
+ return 0;
+ if (match<0 || match>LastHits)
+ {
+ *buf=0;
+ return 0;
+ }
+ int start=PCREMatchs[match*2];
+ int end=PCREMatchs[match*2+1];
+ int len=end-start;
+ if (len>maxLen-1)
+ len=maxLen-1;
+ memcpy(buf,BufSearch+start,len);
+ buf[len]=0;
+
+ return len;
+}
+
+void CLEGetMatch(int match, int &offset, int &len)
+{
+ if (!SUP_PCRE || match<0 || match>LastHits)
+ {
+ offset=-1; len=0;
+ return;
+ }
+ offset=PCREMatchs[match*2];
+ int end=PCREMatchs[match*2+1];
+ len=end-offset;
+}
+
diff --git a/setedit/setedit/loadnobkp.cc b/setedit/setedit/loadnobkp.cc
new file mode 100644
index 0000000..b335ce8
--- /dev/null
+++ b/setedit/setedit/loadnobkp.cc
@@ -0,0 +1,278 @@
+/* Copyright (C) 2001-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#define Uses_string
+#define Uses_stdio
+#define Uses_stdlib
+
+// TV
+#define Uses_TNSCollection
+#define Uses_MsgBox
+// EasyDiag
+#define Uses_TSHzLabel
+#define Uses_TSInputLine
+#define Uses_TSButton
+// SetTVUti
+#define Uses_TStringable
+#define Uses_TDialogAID
+// TCEditor
+#define Uses_TCEditor_External // execDialog
+#define Uses_EditorId
+#include <easydia1.h>
+#include <ceditor.h>
+#include <easydiag.h>
+
+#include <ced_pcre.h>
+#include <loadshl.h>
+#include <loadnobkp.h>
+#define Uses_SETAppVarious // EdReloadIfOpened
+#include <setapp.h>
+
+class TNBKPColl;
+typedef struct
+{
+ const char *texto;
+ pcre *regex;
+} strNBKP;
+
+static char *NBKPFile=0,*NBKPSaveFile=0;
+static TNBKPColl *NBKPList=0;
+static PCREData NBKPpcre={0,0};
+static int listChanged;
+static unsigned localCtxHelp;
+static char warnSaveDifDir=1;
+
+const char *Title=__("Don't create backups for");
+
+static
+void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+class TNBKPColl : public TNSCollection, public TStringable
+{
+public:
+ TNBKPColl() : TNSCollection(6,6), TStringable() {};
+ // TStringable:
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ // TNSCollection:
+ virtual void freeItem(void *item);
+ // TNBKPColl:
+ strNBKP *At(ccIndex item) { return (strNBKP *)(at(item)); };
+ int check(const char *name);
+ void Load(const char *file);
+ void Insert(const char *text, char NoCpText=0);
+ int Save(const char *file);
+};
+
+void TNBKPColl::getText(char *dest, unsigned item, int maxLen)
+{
+ const char *ori=At(item)->texto;
+ strncpy(dest,ori,maxLen);
+ dest[maxLen]=EOS;
+}
+
+void TNBKPColl::freeItem(void *item)
+{
+ strNBKP *p=(strNBKP *)item;
+ DeleteArray(p->texto);
+ ::free(p->regex);
+ delete p;
+}
+
+int TNBKPColl::check(const char *name)
+{
+ int i;
+ int l=strlen(name);
+ for (i=0; i<count; i++)
+ {
+ strNBKP *p=(strNBKP *)items[i];
+ if (p->regex && PCREDoSearch((char *)name,l,p->regex,NBKPpcre))
+ return 0;
+ }
+ return 1;
+}
+
+void TNBKPColl::Load(const char *file)
+{
+ FILE *f=fopen(file,"rt");
+ if (!f) return;
+ PCREInitCompiler(NBKPpcre);
+
+ char b[NBKPMaxLineLen];
+ while (!feof(f))
+ {
+ if (fgets(b,NBKPMaxLineLen-1,f))
+ {
+ ReplaceCRby0(b);
+ Insert(b);
+ }
+ }
+
+ PCREStopCompiler(NBKPpcre);
+ fclose(f);
+}
+
+int TNBKPColl::Save(const char *file)
+{
+ FILE *f=fopen(file,"wt");
+ if (!f) return 0;
+ int i;
+ for (i=0; i<count; i++)
+ {
+ strNBKP *p=(strNBKP *)items[i];
+ fputs(p->texto,f);
+ fputc('\n',f);
+ }
+ int ret=ferror(f)==0;
+ fclose(f);
+ return ret;
+}
+
+void TNBKPColl::Insert(const char *text, char NoCpText)
+{
+ strNBKP *p=new strNBKP;
+ p->texto=NoCpText ? text : newStr(text);
+ p->regex=PCRECompileRegEx((char *)text,NBKPpcre);
+ insert(p);
+}
+
+static
+void NBKPLoad()
+{
+ if (!NBKPFile) return;
+ NBKPList=new TNBKPColl();
+ NBKPList->Load(NBKPFile);
+}
+
+int NBKPMakeIt(const char *name)
+{
+ if (!NBKPList)
+ {
+ NBKPLoad();
+ if (!NBKPList)
+ return 1;
+ }
+ return NBKPList->check(name);
+}
+
+static
+int DeleteItem(int wich)
+{
+ NBKPList->atRemove(wich);
+ listChanged++;
+ return 1;
+}
+
+static
+char *EditItem(const char *s)
+{
+ char b[NBKPMaxLineLen];
+ TSViewCol *col=new TSViewCol(Title);
+
+ TSHzLabel *lineLabel=new TSHzLabel(__("Perl regular expression"),
+ new TSInputLine(NBKPMaxLineLen,50));
+
+ col->insert(xTSCenter,yTSUpSep,lineLabel);
+ EasyInsertOKCancel(col,3);
+
+ TDialog *d=col->doItCenter(localCtxHelp);
+ delete col;
+
+ strcpy(b,s);
+ unsigned ret=execDialog(d,b);
+ if (ret==cmOK)
+ return newStr(b);
+ return 0;
+}
+
+static
+int AddItem(void)
+{
+ char *s=EditItem("");
+ if (s)
+ {
+ NBKPList->Insert(s,1);
+ listChanged++;
+ return 1;
+ }
+ return 0;
+}
+
+static
+int CancelConfirm(void)
+{
+ if (listChanged)
+ return messageBox(__("Do you want to discard the changes?"),
+ mfWarning | mfYesButton | mfNoButton)==cmYes;
+ return 1;
+}
+
+void NBKPEdit(void)
+{
+ if (!NBKPList)
+ {
+ NBKPLoad();
+ if (!NBKPList || !NBKPSaveFile)
+ return;
+ }
+ TDialogAID *d=CreateAddInsDelDialog(-1,-1,Title,12,50,aidOKEnabled);
+ d->helpCtx=localCtxHelp;
+ d->DelAction=DeleteItem;
+ d->AddAction=AddItem;
+ d->CancelAction=CancelConfirm;
+
+ TStringableListBoxRec box;
+ box.items=NBKPList;
+ box.selection=0;
+ listChanged=0;
+
+ unsigned ret=execDialog(d,&box);
+ if (listChanged)
+ {
+ if (ret==cmOK)
+ {
+ stEditorId idFile;
+ int reLoad=FillEditorId(&idFile,NBKPSaveFile);
+ NBKPList->Save(NBKPSaveFile);
+ if (reLoad)
+ EdReloadIfOpened(NBKPSaveFile,&idFile);
+ if (warnSaveDifDir && strcmp(NBKPSaveFile,NBKPFile)!=0)
+ {
+ ShowSavePoint(NBKPSaveFile);
+ warnSaveDifDir=0;
+ }
+ }
+ else
+ {
+ NBKPList->freeAll();
+ NBKPList->Load(NBKPFile);
+ }
+ }
+}
+
+void NBKPSetFileName(const char *name, unsigned ctxHelp)
+{
+ DeleteArray(NBKPFile);
+ NBKPFile=newStr(name);
+ localCtxHelp=ctxHelp;
+}
+
+void NBKPSetSaveFileName(const char *save)
+{
+ DeleteArray(NBKPSaveFile);
+ NBKPSaveFile=newStr(save);
+}
+
+void UnloadNBKP()
+{
+ DeleteArray(NBKPFile);
+ NBKPFile=0;
+ DeleteArray(NBKPSaveFile);
+ NBKPSaveFile=0;
+ destroy0(NBKPList);
+ PCREDataDestroy(NBKPpcre);
+}
diff --git a/setedit/setedit/menuload.cc b/setedit/setedit/menuload.cc
new file mode 100644
index 0000000..e8e269d
--- /dev/null
+++ b/setedit/setedit/menuload.cc
@@ -0,0 +1,1498 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Menu Loader
+ Comments:
+ This module is used to load the editor's menu from a text file.
+
+***************************************************************************/
+#include <ceditint.h>
+#include <stdio.h>
+#define Uses_stdlib
+#define Uses_string
+#define Uses_ctype
+#define Uses_TMenu
+#define Uses_TMenuItem
+#define Uses_TSubMenu
+#define Uses_TMenuBar
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_MsgBox
+#define Uses_TCEditor
+#define Uses_TCEditor_Commands
+#define Uses_TStringCollection
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TVCodePage
+#define Uses_TScreen
+#define Uses_AllocLocal
+#define Uses_snprintf
+#include <ceditor.h>
+#define Uses_SETAppConst
+#define Uses_SETAppVarious
+#define Uses_TMultiMenu
+#include <setapp.h>
+
+#include <keytrans.h>
+#define Uses_TMLIEditorDefs
+#include <mli.h>
+
+const int maxLineLen=255;
+const int errMLExpectedStr=1,
+ errMLUnclosedStr=2,
+ errMLNoKeyInSubMenu=3,
+ errMLWrongKeyName=4,
+ errMLExtraCharsInLine=5,
+ errMLNoNumberForContext=6,
+ errMLSyntax=7,
+ errMLEmptySubMenu=8,
+ errMLUnclosedSubMenu=9,
+ errMLNoCommandInMenuItem=10,
+ errMLWrongCommandName=11,
+ errMLNoMenuDefinition=12,
+ errMLWrongCtxName=13,
+ errMLUnfinishedMacro=14,
+ errMLCantRegisterMacro=15,
+ errMLNoStatusDefinition=16,
+ errMLNoFromInRange=17,
+ errMLNoToInRange=18,
+ errMLNoNumber=19,
+ errMLFromLessTo=20,
+ errMLUnclosedStatusRange=21,
+ errMLEmptyStatusLine=22,
+ errMLNoHelpContext=23,
+ errMLTooDeep=24,
+ errMLUnmatchedEndIf=25,
+ errMLMacroRedefined=26;
+
+static const char *ErrorNames[] =
+{
+ __("No error"),
+ __("String expected"),
+ __("String not closed"),
+ __("No key for SubMenu"),
+ __("Wrong key name"),
+ __("Extra characters in line"),
+ __("No number for a context"),
+ __("Syntax error"),
+ __("Empty submenu"),
+ __("SubMenu not closed "),
+ __("Missing command value"),
+ __("Wrong command name"),
+ __("No menu definition"),
+ __("Wrong context name"),
+ __("Unfinished macro name"),
+ __("Unable to register macro"),
+ __("No status line definition"),
+ __("No `from' value in range"),
+ __("No `quantity' value in range"),
+ __("Number expected"),
+ __("Invalid range"),
+ __("StatusRange not closed"),
+ __("Empty status line"),
+ __("Wrong help context name or number"),
+ __("Too much conditionals nested"),
+ __("Unmatched $endif"),
+ __("Preprocessor value redefined")
+};
+
+static int Error=0;
+static int Line;
+static char *FileName=0;
+const int maxDepth=32;
+
+typedef struct
+{
+ char start;
+ char escape;
+ char *sIf,*sElse,*sEnd;
+ char *sDefined,*sIfDef,*sIfNDef;
+ char *sAnd,*sOr,sNot;
+ char *sDefine, *sUndef;
+ int depth;
+ char stack[maxDepth];
+} stPreproInfo;
+
+static stPreproInfo PreproInfo={'$',0,"if","else","endif","defined","ifdef","ifndef",
+ "and","or",'!',"define","undef"};
+static DynStrCatStruct res={0,NULL};
+
+const unsigned prliASCIIZ=1,prliNoASCIIZ=0;
+const unsigned prliEatSpaces=2,prliNoEatSpaces=0;
+const int prlisNoPL=0,prlisPLContinue=1,prlisPLOK=2;
+const int prlieNoErr=0,prlieSyntax=-1,prlieElse=2,prlieEnd=3;
+const int prlieNoOp=4,prlieAnd=5,prlieOr=6,prlieDefine=7,prlieUndef=8;
+
+class TDef;
+
+static int ReadPreprocessor(char *s, stPreproInfo *p, DynStrCatStruct *str,
+ int PreproValue, TDef *defs, char *buf, FILE *f);
+static char *ExpandPreprocessor(char *buf, stPreproInfo *p, TDef *defs);
+
+#define GetLine() { fgets(buf,maxLineLen,f); Line++; }
+
+struct stDef
+{
+ char *var;
+ char *val;
+};
+
+class TDef : public TStringCollection
+{
+public:
+ TDef() : TStringCollection(20,5) {};
+
+ stDef *At(ccIndex i) { return (stDef *)at(i); };
+ virtual void *keyOf(void *item);
+ virtual void freeItem(void *s);
+ void insert(const char *var, const char *val=NULL);
+ Boolean isDefined(char *s, int l);
+ stDef *getMacro(char *s, int l);
+ Boolean undef(char *s, int l);
+};
+
+Boolean TDef::isDefined(char *s, int l)
+{
+ char val=s[l];
+ s[l]=0;
+ ccIndex pos;
+ Boolean ret=search(s,pos);
+ s[l]=val;
+
+ return ret;
+}
+
+stDef *TDef::getMacro(char *s, int l)
+{
+ char val=s[l];
+ s[l]=0;
+ ccIndex pos;
+ Boolean ret=search(s,pos);
+ s[l]=val;
+
+ return ret ? At(pos) : NULL;
+}
+
+Boolean TDef::undef(char *s, int l)
+{
+ char val=s[l];
+ s[l]=0;
+ ccIndex pos;
+ Boolean ret=search(s,pos);
+ s[l]=val;
+ if (ret)
+ atFree(pos);
+
+ return ret;
+}
+
+void *TDef::keyOf(void *item)
+{
+ return ((stDef *)item)->var;
+}
+
+void TDef::freeItem(void *s)
+{
+ stDef *p=(stDef *)s;
+ delete[] p->var;
+ delete[] p->val;
+ delete p;
+}
+
+void TDef::insert(const char *var, const char *val)
+{
+ stDef *p=new stDef;
+ p->var=newStr(var);
+ p->val=newStr(val);
+ TStringCollection::insert(p);
+}
+
+char *SkipBlanks(char *buf)
+{
+ char *s;
+ for (s=buf; *s!='\n' && *s && ucisspace(*s); s++);
+ return s;
+}
+
+static
+char *SkipToEndNoBlanks(char *buf)
+{
+ char *s, *last;
+ for (last=s=buf; *s!='\n' && *s; s++)
+ if (!ucisspace(*s))
+ last=s;
+ if (!ucisspace(*last))
+ last++;
+ return last;
+}
+
+static
+char *GetString(char *s)
+{
+ if (*s!='\"')
+ {
+ Error=errMLExpectedStr;
+ return 0;
+ }
+ for (s++; *s && *s!='\n' && *s!='\"'; s++);
+ if (*s!='\"')
+ {
+ Error=errMLUnclosedStr;
+ return 0;
+ }
+ *s=0;
+ return s;
+}
+
+static
+char *GetNumber(char *s, int &key, int error1, int error2, int Optional=0,
+ int FirstInLine=0)
+{
+ char *ret;
+
+ s=SkipBlanks(s);
+ if (Optional && (*s=='\n' || *s==0))
+ return s;
+ if (!FirstInLine)
+ {
+ if (*s!=',')
+ {
+ Error=error1;
+ return 0;
+ }
+ s=SkipBlanks(s+1);
+ }
+ if (!ucisdigit(*s))
+ {
+ Error=error2;
+ return 0;
+ }
+ key=strtol(s,&ret,0);
+ return ret;
+}
+
+static
+char *GetKey(char *s, int &key, int error1, int Optional=0)
+{
+ char *ret;
+
+ s=SkipBlanks(s);
+ if (Optional && (*s=='\n' || *s==0))
+ return s;
+ if (*s!=',')
+ {
+ Error=error1;
+ return 0;
+ }
+ s=SkipBlanks(s+1);
+
+ if (*s!='k' || *(s+1)!='b')
+ {
+ Error=error1;
+ return 0;
+ }
+ s+=2;
+ for (ret=s; *ret && (TVCodePage::isAlNum(*ret) || *ret=='_'); ret++);
+ char v=*ret; *ret=0;
+ ushort code;
+ if (InterpretKeyName(s,code))
+ {
+ *ret=v;
+ Error=errMLWrongKeyName;
+ return 0;
+ }
+ *ret=v;
+ key=code;
+ return ret;
+}
+
+static
+char *GetCommand(char *s, int &command, int FirstInLine=0)
+{
+ char *ret;
+ int isAMacro=0;
+
+ s=SkipBlanks(s);
+ if (!FirstInLine)
+ {
+ if (*s!=',')
+ {
+ Error=errMLNoCommandInMenuItem;
+ return 0;
+ }
+ s=SkipBlanks(s+1);
+ }
+
+ if (*s!='c' || *(s+1)!='m')
+ {
+ Error=errMLNoCommandInMenuItem;
+ return 0;
+ }
+ s+=2;
+ /*if (*s!='c' && *s!='e' && *s!='(')
+ {
+ Error=errMLWrongCommandName;
+ return 0;
+ }*/
+ isAMacro= *s=='(';
+ s++;
+
+ if (isAMacro)
+ {
+ ret=s;
+ if (*ret=='(')
+ {// cm((lisp code))
+ char *end;
+ if (MLIEdIsolateCode(ret,end)!=SLP_OK)
+ {
+ Error=errMLUnfinishedMacro;
+ return 0;
+ }
+ ret=end+1;
+ }
+ else
+ // cm(macro name)
+ for (; *ret && *ret!=')'; ret++);
+ if (*ret!=')')
+ {
+ Error=errMLUnfinishedMacro;
+ return 0;
+ }
+ char v=*ret; *ret=0;
+ command=RegisterMacroCommand(s);
+ //printf("Registrando %s\n",s);
+ *ret=v;
+ ret++; // Skip the last parethesis
+ if (command==-1)
+ {
+ Error=errMLCantRegisterMacro;
+ return 0;
+ }
+ }
+ else
+ {
+ for (ret=s; *ret && (TVCodePage::isAlNum(*ret) || *ret=='_'); ret++);
+ char v=*ret; *ret=0;
+ if (*(s-1)=='c')
+ {
+ command=SearchEdCommand(s);
+ if (command>=0)
+ command+=cmbBaseNumber;
+ }
+ else
+ if (*(s-1)=='e')
+ {
+ command=SearchEditCommand(s);
+ if (command>=0)
+ command+=cmeBase;
+ }
+ else
+ command=SearchSimpleCommand(s-1);
+
+ *ret=v;
+ if (command==-1)
+ {
+ Error=errMLWrongCommandName;
+ return 0;
+ }
+ }
+ return ret;
+}
+
+static
+char *GetHelpCtx(char *s, int &context, int FirstInLine=0)
+{
+ char *ret;
+
+ s=SkipBlanks(s);
+ if (!FirstInLine)
+ {
+ if (*s!=',')
+ {
+ Error=errMLNoCommandInMenuItem;
+ return 0;
+ }
+ s=SkipBlanks(s+1);
+ }
+
+ if (*s!='h' || *(s+1)!='c')
+ return GetNumber(s,context,0,errMLNoHelpContext,0,1);
+ s+=2;
+
+ for (ret=s; *ret && (TVCodePage::isAlNum(*ret) || *ret=='_'); ret++);
+ char v=*ret; *ret=0;
+
+ context=SearchHelpCtxCommand(s);
+ if (context<0)
+ { // Try with an editor command, they are mapped one to one with the
+ // corresponding help context
+ context=SearchEdCommand(s);
+ if (context>=0)
+ context+=cmbBaseNumber;
+ else
+ {
+ context=SearchEditCommand(s);
+ if (context>=0)
+ context+=cmeBase;
+ }
+ }
+ *ret=v;
+ if (context<0)
+ {
+ Error=errMLNoHelpContext;
+ return 0;
+ }
+ return ret;
+}
+
+// MenuItem: "Name", Command[, Key [, Context [,"KeyName"]]]
+// MenuItemC: "Name", Command[, Key [,"KeyName"]] -> copyContext
+static
+TMenuItem *GetMenuItem(char *s,int copyContext)
+{
+ char *sEnd,*name,*extra=0;
+ int key=kbNoKey,context=hcNoContext,command;
+
+ // Now we'll parse the MenuItem definition.
+
+ // Get the name
+ s=SkipBlanks(s);
+ sEnd=GetString(s);
+ if (Error) return 0;
+ name=s+1;
+
+ // Get the command
+ //s=GetNumber(sEnd+1,command,errMLNoCommandInMenuItem,errMLNoNumberForCommand);
+ s=GetCommand(sEnd+1,command);
+ if (Error) return 0;
+ // Get the key
+ s=GetKey(s,key,errMLExtraCharsInLine,1);
+ if (Error) return 0;
+ // Get the context
+ if (copyContext)
+ context=command;
+ else
+ {
+ s=GetNumber(s,context,errMLExtraCharsInLine,errMLWrongCtxName,1);
+ if (Error) return 0;
+ }
+ // Get the extra string
+ s=SkipBlanks(s);
+ if (*s!='\n' && *s!=0)
+ {
+ if (*s!=',')
+ {
+ Error=errMLExtraCharsInLine;
+ return 0;
+ }
+ s=SkipBlanks(s+1);
+ sEnd=GetString(s);
+ if (Error) return 0;
+ extra=s+1;
+ }
+
+ return new TMenuItem(name,command,key,context,extra);
+}
+
+static
+TSubMenu *GetSubMenu(FILE *f, char *buf, char *s, stPreproInfo *PreproInfo,
+ DynStrCatStruct *Cat, TDef *defs, int &PreproValue)
+{
+ char *sEnd,*name;
+ int key,context=hcNoContext;
+
+ s=SkipBlanks(s);
+
+ // Now we'll parse the SubMenu definition.
+ // SubMenu: "Name", Key [,Context]
+
+ // Get the name
+ sEnd=GetString(s);
+ if (Error) return 0;
+ name=s+1;
+ // Get the key
+ s=GetKey(sEnd+1,key,errMLNoKeyInSubMenu);
+ if (Error) return 0;
+ // Get context
+ s=GetNumber(s,context,errMLExtraCharsInLine,errMLNoNumberForContext,1);
+ if (Error) return 0;
+
+ // We had luck ;-)
+ TSubMenu *sub=new TSubMenu(name,key,context);
+ TMenuItem *firstMenu=0;
+ TMenuItem *lastMenu=0;
+ TMenuItem *newMenu;
+
+ // Now we'll get the items:
+ GetLine();
+ while (!feof(f) && !Error)
+ {
+ s=SkipBlanks(buf);
+ if (*s=='$')
+ {
+ PreproValue=ReadPreprocessor(s,PreproInfo,Cat,PreproValue,defs,buf,f);
+ }
+ else
+ if (*s!='#' && *s!='\n' && PreproValue) // Skip comment lines
+ {
+ newMenu=0;
+ s=ExpandPreprocessor(s,PreproInfo,defs);
+ if (strncasecmp(s,"SubMenu:",8)==0)
+ { // Recursive menues
+ newMenu=(TMenuItem *)GetSubMenu(f,buf,s+8,PreproInfo,Cat,defs,PreproValue);
+ if (!newMenu)
+ return 0; // Fail
+ }
+ else
+ if (strncasecmp(s,"MenuItem:",9)==0)
+ { // Just an item
+ newMenu=GetMenuItem(s+9,0);
+ if (!newMenu)
+ return 0; // Fail
+ }
+ else
+ if (strncasecmp(s,"MenuItemC:",10)==0)
+ { // Just an item
+ newMenu=GetMenuItem(s+10,1);
+ if (!newMenu)
+ return 0; // Fail
+ }
+ else
+ if (strncasecmp(s,"MenuSeparator",13)==0)
+ { // A separator
+ newMenu=&newLine();
+ }
+ else
+ if (strncasecmp(s,"EndSubMenu",10)==0)
+ { // The end of the submenu
+ if (firstMenu)
+ {
+ sub->subMenu=new TMenu(*firstMenu);
+ return sub;
+ }
+ else
+ {
+ Error=errMLEmptySubMenu;
+ return 0;
+ }
+ }
+ else
+ {
+ Error=errMLSyntax;
+ return 0; // Fail
+ }
+ // Link it
+ if (newMenu)
+ {
+ if (firstMenu)
+ {
+ lastMenu->next=newMenu;
+ lastMenu=newMenu;
+ }
+ else
+ lastMenu=firstMenu=newMenu;
+ }
+ }
+ if (!Error)
+ GetLine();
+ }
+ if (!Error)
+ Error=errMLUnclosedSubMenu;
+ return 0;
+}
+
+// StatusEntry: "Name", Command, Key
+// StatusHiddenEntry: Command, Key -> hidden
+static
+TStatusItem *GetStatusItem(char *s, int hidden)
+{
+ char *name=0,*sEnd;
+ int command,key;
+
+ // Now we'll parse the StatusEntry definition.
+
+ s=SkipBlanks(s);
+ sEnd=s;
+ // Get the name
+ if (!hidden)
+ {
+ sEnd=GetString(s)+1;
+ if (Error) return 0;
+ name=s+1;
+ }
+
+ // Get the command
+ s=GetCommand(sEnd,command,hidden);
+ if (Error) return 0;
+ // Get the key
+ s=GetKey(s,key,errMLExtraCharsInLine);
+ if (Error) return 0;
+
+ return new TStatusItem(name ? name : 0,key,command);
+}
+
+
+static
+TStatusDef *GetStatusDef(FILE *f, char *buf, char *s, stPreproInfo *PreproInfo,
+ DynStrCatStruct *Cat, TDef *defs,
+ int &PreproValue)
+{
+ int from,quantity,to;
+
+ s=SkipBlanks(s);
+
+ // Now we'll parse the StatusRange definition.
+ // StatusRange: From, Quantity
+
+ // Get the from
+ s=GetHelpCtx(s,from,1);
+ if (Error) return 0;
+ // Get the quantity
+ s=GetNumber(s,quantity,errMLNoToInRange,errMLNoNumber);
+ if (Error) return 0;
+ to=from+quantity;
+ if (from>to)
+ {
+ Error=errMLFromLessTo;
+ return 0;
+ }
+
+ TStatusDef *def=new TStatusDef(from,to);
+ TStatusItem *firstItem=0;
+ TStatusItem *lastItem=0;
+ TStatusItem *newItem;
+
+ // Now we'll get the items:
+ GetLine();
+ while (!feof(f) && !Error)
+ {
+ s=SkipBlanks(buf);
+ if (*s=='$')
+ {
+ PreproValue=ReadPreprocessor(s,PreproInfo,Cat,PreproValue,defs,buf,f);
+ }
+ else
+ if (*s!='#' && *s!='\n' && PreproValue) // Skip comment lines
+ {
+ s=ExpandPreprocessor(s,PreproInfo,defs);
+ newItem=0;
+ if (strncasecmp(s,"StatusEntry:",12)==0)
+ {
+ newItem=GetStatusItem(s+12,0);
+ if (!newItem)
+ return 0; // Fail
+ }
+ else
+ if (strncasecmp(s,"StatusHiddenEntry:",18)==0)
+ {
+ newItem=GetStatusItem(s+18,1);
+ if (!newItem)
+ return 0; // Fail
+ }
+ else
+ if (strncasecmp(s,"EndStatusRange",14)==0)
+ {
+ if (firstItem)
+ {
+ def->items=firstItem;
+ return def;
+ }
+ else
+ {
+ Error=errMLEmptyStatusLine;
+ return 0;
+ }
+ }
+ else
+ {
+ Error=errMLSyntax;
+ return 0; // Fail
+ }
+ // Link it
+ if (newItem)
+ {
+ if (firstItem)
+ {
+ lastItem->next=newItem;
+ lastItem=newItem;
+ }
+ else
+ lastItem=firstItem=newItem;
+ }
+ }
+ if (!Error)
+ GetLine();
+ }
+ Error=errMLUnclosedStatusRange;
+ return 0;
+}
+
+static
+void GetNewMenuID(FILE *f, char *buf, char *s, unsigned &min, unsigned &max)
+{
+ int from,quantity,to;
+
+ // Same as StatusRange
+ s=SkipBlanks(s);
+ // Get the from
+ s=GetHelpCtx(s,from,1);
+ if (Error) return;
+ // Get the quantity
+ s=GetNumber(s,quantity,errMLNoToInRange,errMLNoNumber);
+ if (Error) return;
+ to=from+quantity;
+ if (from>to)
+ Error=errMLFromLessTo;
+ min=from;
+ max=to;
+}
+
+static
+int PreproLine_Start(char *line, unsigned len, unsigned flags, stPreproInfo *p,
+ DynStrCatStruct *str)
+{
+ char *s;
+
+ if (flags & prliASCIIZ)
+ len=strlen(line);
+ if (flags & prliEatSpaces)
+ {
+ s=SkipBlanks(line);
+ len-=s-line;
+ }
+ else
+ s=line;
+ // Eliminate the \n
+ if (s[len-1]=='\n')
+ {
+ len--;
+ s[len]=0;
+ }
+ // Is a valid preprocessor line
+ if (*s!=p->start)
+ return prlisNoPL;
+ // Skip de preprocessor character
+ s++;
+ len--;
+ // Start concatenating escaped lines
+ DynStrCatInit(str,s,len);
+ // Is multiline?
+ if (s[len-1]==p->escape)
+ { // Yes, ask for more and eliminate the escape char
+ str->str[len-1]=' ';
+ return prlisPLContinue;
+ }
+ return prlisPLOK;
+}
+
+static
+int PreproLine_Continue(char *line, unsigned len, unsigned flags, stPreproInfo *p,
+ DynStrCatStruct *str)
+{
+ if (flags & prliASCIIZ)
+ len=strlen(line);
+ // Eliminate the \n
+ if (line[len-1]=='\n')
+ {
+ len--;
+ line[len]=0;
+ }
+ // Concatenate
+ DynStrCat(str,line,len);
+ // Is multiline?
+ if (line[len-1]==p->escape)
+ { // Yes, ask for more and eliminate the escape char
+ str->str[len-1]=' ';
+ return prlisPLContinue;
+ }
+ return prlisPLOK;
+}
+
+static
+int GetLenOfToken(char *&str)
+{
+ char *s=str;
+ while (*s && ucisspace(*s)) s++;
+ str=s;
+ while (*s && !ucisspace(*s)) s++;
+ int r=s-str;
+ //str=s;
+ return r;
+}
+
+static
+int GetLenOfWord(char *&str)
+{
+ char *s=str;
+ while (*s && ucisspace(*s)) s++;
+ str=s;
+ while (*s && (TVCodePage::isAlNum(*s) || *s=='_')) s++;
+ int r=s-str;
+ //str=s;
+ return r;
+}
+
+static inline
+char *SkipString(char *s)
+{
+ for (s++; *s && *s!='\n' && *s!='\"'; s++);
+ if (*s=='"') s++;
+ return s;
+}
+
+static
+int GetLenOfWholeWord(char *&str)
+{
+ char *s=str;
+ while (*s && !(TVCodePage::isAlpha(*s) || *s=='_'))
+ {
+ if (*s=='"')
+ s=SkipString(s);
+ else
+ s++;
+ }
+ str=s;
+ while (*s && (TVCodePage::isAlNum(*s) || *s=='_')) s++;
+ int r=s-str;
+ return r;
+}
+
+static
+int PreproLine_InterpretIfDef(char *s, stPreproInfo *, TDef *defs,
+ int yes)
+{
+ int l=GetLenOfWord(s),Value;
+
+ Value=defs->isDefined(s,l)==True ? 1 : 0;
+
+ if (!yes)
+ Value=Value ? 0 : 1;
+
+ return Value;
+}
+
+static
+int PreproLine_InterpretIf(char *&str, stPreproInfo *p, TDef *defs,
+ int nested=0);
+
+static
+int PreproLine_SolveOperand(char *&str, stPreproInfo *p, TDef *defs)
+{
+ char *s=str;
+
+ s=SkipBlanks(s);
+ if (*s=='(')
+ {
+ str=s+1;
+ return PreproLine_InterpretIf(str,p,defs,1);
+ }
+ int invert=0;
+ if (*s==p->sNot)
+ {
+ s++;
+ s=SkipBlanks(s);
+ invert=1;
+ }
+ int Value=prlieSyntax;
+ int l=GetLenOfWord(s);
+ if (strncasecmp(s,p->sDefined,l)==0)
+ {
+ s+=l;
+ s=SkipBlanks(s);
+ if (*s!='(') return prlieSyntax;
+ s++;
+ s=SkipBlanks(s);
+ l=GetLenOfWord(s);
+ if (!l) return prlieSyntax;
+ Value=defs->isDefined(s,l)==True ? 1 : 0;
+ if (invert) Value=Value ? 0 : 1;
+ s+=l;
+ s=SkipBlanks(s);
+ if (*s!=')') return prlieSyntax;
+ s++;
+ }
+ else
+ {
+ if (!l) return prlieSyntax;
+ Value=defs->isDefined(s,l)==True ? 1 : 0;
+ if (invert) Value=Value ? 0 : 1;
+ s+=l;
+ }
+ str=s;
+ return Value;
+}
+
+static
+int PreproLine_GetOperation(char *&str, stPreproInfo *p, TDef *)
+{
+ int l=GetLenOfWord(str);
+ if (!l)
+ return prlieNoOp;
+ if (strncasecmp(str,p->sAnd,l)==0)
+ {
+ str+=l;
+ return prlieAnd;
+ }
+ else
+ if (strncasecmp(str,p->sOr,l)==0)
+ {
+ str+=l;
+ return prlieOr;
+ }
+
+ return prlieNoOp;
+}
+
+static
+int PreproLine_InterpretIf(char *&str, stPreproInfo *p, TDef *defs,
+ int nested)
+{
+ int Value,Operand=prlieNoOp,RetVal=prlieSyntax;
+ char *s=str;
+
+ if (!*s) return prlieSyntax;
+ while (*s)
+ {
+ Value=PreproLine_SolveOperand(s,p,defs);
+ if (Value==prlieSyntax) return prlieSyntax;
+ if (RetVal==prlieSyntax)
+ RetVal=Value;
+ else
+ {
+ switch (Operand)
+ {
+ case prlieAnd:
+ RetVal&=Value;
+ break;
+ case prlieOr:
+ RetVal|=Value;
+ break;
+ }
+ }
+ Operand=PreproLine_GetOperation(s,p,defs);
+ if (Operand==prlieSyntax) return prlieSyntax;
+ if (Operand==prlieNoOp)
+ {
+ if (nested)
+ {
+ if (*s==')')
+ {
+ s++;
+ break;
+ }
+ else
+ return prlieSyntax;
+ }
+ else
+ {
+ if (*s) return prlieSyntax;
+ }
+ }
+ }
+ str=s;
+ return RetVal;
+}
+
+static
+int PreproLine_InterpretDefine(char *str, stPreproInfo *p, TDef *defs,
+ int PreproValue)
+{
+ if (!PreproValue)
+ return prlieDefine;
+ char *s=str;
+
+ // Get macro name
+ // TODO: support for name(args)
+ int l=GetLenOfWord(s);
+ if (!l) return prlieSyntax;
+
+ // Is already there?
+ if (defs->isDefined(s,l))
+ {
+ Error=errMLMacroRedefined;
+ return prlieDefine;
+ }
+
+ // Copy the name
+ AllocLocalStr(name,l+1);
+ memcpy(name,s,l);
+ name[l]=0;
+
+ // Get the definition
+ s+=l;
+ s=SkipBlanks(s);
+ char *end=SkipToEndNoBlanks(s);
+ char v=*end; *end=0;
+ defs->insert(name,s);
+ *end=v;
+
+ return prlieDefine;
+}
+
+static
+int PreproLine_InterpretUndef(char *str, stPreproInfo *p, TDef *defs,
+ int PreproValue)
+{
+ if (PreproValue)
+ {
+ char *s=str;
+
+ // Get macro name
+ int l=GetLenOfWord(s);
+ if (!l) return prlieSyntax;
+
+ // Remove it
+ defs->undef(s,l);
+ }
+
+ return prlieUndef;
+}
+
+static
+int PreproLine_Interpret(stPreproInfo *p, DynStrCatStruct *str, TDef *defs,
+ int PreproValue)
+{
+ char *s=str->str;
+ int l,ret=prlieSyntax;
+
+ l=GetLenOfToken(s);
+ if (strncasecmp(s,p->sIf,l)==0)
+ {
+ s+=l;
+ ret=PreproLine_InterpretIf(s,p,defs);
+ }
+ else if (strncasecmp(s,p->sIfDef,l)==0)
+ ret=PreproLine_InterpretIfDef(s+l,p,defs,1);
+ else if (strncasecmp(s,p->sIfNDef,l)==0)
+ ret=PreproLine_InterpretIfDef(s+l,p,defs,0);
+ else if (strncasecmp(s,p->sElse,l)==0)
+ ret=prlieElse;
+ else if (strncasecmp(s,p->sEnd,l)==0)
+ ret=prlieEnd;
+ else if (strncasecmp(s,p->sDefine,l)==0)
+ ret=PreproLine_InterpretDefine(s+l,p,defs,PreproValue);
+ else if (strncasecmp(s,p->sUndef,l)==0)
+ ret=PreproLine_InterpretUndef(s+l,p,defs,PreproValue);
+ free(str->str);
+ return ret;
+}
+
+static inline
+int PreproPush(stPreproInfo *p, int PreproValue, int newState)
+{
+ if (p->depth>=maxDepth)
+ {
+ Error=errMLTooDeep;
+ return PreproValue;
+ }
+ p->stack[p->depth++]=PreproValue;
+ return PreproValue ? newState : 0;
+}
+
+static inline
+int PreproPop(stPreproInfo *p)
+{
+ if (p->depth==0)
+ {
+ Error=errMLUnmatchedEndIf;
+ return 0;
+ }
+ return p->stack[--p->depth];
+}
+
+static inline
+int PreproToggle(stPreproInfo *p, int PreproValue)
+{
+ int prev=1;
+ if (p->depth)
+ prev=p->stack[p->depth-1];
+ return prev ? (PreproValue ? 0 : 1) : 0;
+}
+
+static
+int ReadPreprocessor(char *s, stPreproInfo *p, DynStrCatStruct *str, int PreproValue,
+ TDef *defs, char *buf, FILE *f)
+{
+ int ret;
+ ret=PreproLine_Start(s,0,prliNoEatSpaces | prliASCIIZ,p,str);
+ if (ret==prlieSyntax)
+ Error=errMLSyntax;
+ else
+ {
+ while (ret==prlisPLContinue)
+ {
+ GetLine();
+ ret=PreproLine_Continue(buf,0,prliNoEatSpaces | prliASCIIZ,p,str);
+ }
+ if (ret==prlieSyntax)
+ Error=errMLSyntax;
+ else
+ {
+ ret=PreproLine_Interpret(p,str,defs,PreproValue);
+ switch (ret)
+ {
+ case 0:
+ PreproValue=PreproPush(p,PreproValue,0);
+ break;
+ case 1:
+ PreproValue=PreproPush(p,PreproValue,1);
+ break;
+ case prlieElse:
+ PreproValue=PreproToggle(p,PreproValue);
+ break;
+ case prlieEnd:
+ PreproValue=PreproPop(p);
+ break;
+ case prlieSyntax:
+ Error=errMLSyntax;
+ break;
+ }
+ }
+ }
+ return PreproValue;
+}
+
+static
+char *ExpandPreprocessor(char *buf, stPreproInfo *p, TDef *defs)
+{
+ int l;
+ char *s=buf, *prev=buf;
+ if (res.str)
+ {
+ free(res.str);
+ res.str=NULL;
+ }
+
+ do
+ {// Get by words
+ l=GetLenOfWholeWord(s);
+ if (l)
+ {// Search this word
+ stDef *p=defs->getMacro(s,l);
+ if (p)
+ {// Replace it
+ if (res.str==NULL)
+ {// Not started, copy upto here
+ DynStrCatInit(&res,buf,s-buf);
+ }
+ else
+ DynStrCat(&res,prev,s-prev);
+ if (p->val)
+ DynStrCat(&res,p->val);
+ s+=l;
+ prev=s;
+ }
+ else
+ {// Not found
+ s+=l;
+ }
+ }
+ }
+ while (l);
+
+ if (res.str)
+ {
+ if (prev!=s)
+ DynStrCat(&res,prev,s-prev);
+ return res.str;
+ }
+ return buf;
+}
+
+/*****************************************************************************
+ TMultiMenu and TMultiMenuBar members.
+*****************************************************************************/
+
+void TMultiMenu::add(TMenuItem *m)
+{
+ if (last)
+ {
+ last->next=m;
+ last=m;
+ }
+ else
+ items=last=m;
+}
+
+TMultiMenu::~TMultiMenu()
+{
+ if (next)
+ delete next;
+}
+
+TMultiMenuBar *TMultiMenuBar::createMultiMenuBar(const TRect &bounds,
+ TMultiMenu *aMenu)
+{
+ TMultiMenu *m=aMenu;
+ while (m->next)
+ m=m->next;
+ return new TMultiMenuBar(bounds,aMenu,m);
+}
+
+void TMultiMenuBar::findMenu()
+{// The last is the default
+ TMultiMenu *p=menuList;
+ while (p->next && (helpCtx<p->min || helpCtx>p->max))
+ p=p->next;
+ if (p!=menu)
+ {
+ menu=p;
+ computeLength();
+ drawView();
+ }
+}
+
+void TMultiMenuBar::update()
+{
+ // Avoid changing the menu if the user is using it ;-)
+ if (state & sfModal)
+ return;
+ TView *p=TopView();
+ unsigned h=p ? p->getHelpCtx() : hcNoContext;
+ if (helpCtx!=h)
+ {
+ helpCtx=h;
+ findMenu();
+ }
+}
+
+TMultiMenuBar::~TMultiMenuBar()
+{// Delete all of them
+ delete menuList;
+ // Prevent farther deletions in ~TMenuBar
+ menu=NULL;
+}
+
+/*****************************************************************************
+ Helpers to construct a TMultiMenu
+*****************************************************************************/
+
+static char MenuAndStatusLoaded=0;
+static TStatusDef *statusDef=NULL;
+// List of menues
+static TMultiMenu *firstMenu=NULL;
+
+static
+void InitAddSubMenu()
+{
+ firstMenu=new TMultiMenu();
+}
+
+static
+void AddNewMenu(unsigned min, unsigned max)
+{
+ TMultiMenu *mm=new TMultiMenu();
+ mm->min=min;
+ mm->max=max;
+ mm->next=firstMenu;
+ firstMenu=mm;
+}
+
+static
+void AddSubMenu(TSubMenu *m)
+{
+ firstMenu->add(m);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Reads the menu from the file fileName and creates a TMenuBar with the
+provided rectangle as size.
+
+ Return:
+ 0 if something fails. To display the error call @x{ShowMenuLoadError}.
+
+***************************************************************************/
+
+static
+int LoadTVMenuAndStatus(char *fileName)
+{
+ FILE *f;
+ char buf[maxLineLen+1];
+ char *s;
+ DynStrCatStruct Cat;
+ int PreproValue=1;
+ InitAddSubMenu();
+ TStatusDef *lastStatusDef=NULL;
+
+ Error=0; Line=0;
+ f=fopen(fileName,"rt");
+ if (!f)
+ return 0;
+ FileName=newStr(fileName);
+ TDef *defs=new TDef();
+
+ // All of the configuration details
+ defs->insert(SEOS_STR);
+ #ifdef SEOSf_STR
+ defs->insert(SEOSf_STR);
+ #endif
+ defs->insert(SECPU_STR);
+ defs->insert(SEComp_STR);
+ #ifdef SECompf_STR
+ defs->insert(SECompf_STR);
+ #endif
+ // The current TV driver
+ const char *drv=TScreen::getDriverShortName();
+ int l=strlen(drv)+4;
+ AllocLocalStr(drvName,l);
+ CLY_snprintf(drvName,l,"Drv%s",drv);
+ defs->insert(drvName);
+
+ // For compatibility (Win32!=WIN32)
+ #if defined(SEOS_Win32)
+ defs->insert("WIN32");
+ #endif
+
+ #if WITH_MP3
+ defs->insert("MP3");
+ #endif
+ #if HAVE_PCRE_LIB
+ defs->insert("PCRE");
+ #endif
+ #if HAVE_BZIP2
+ defs->insert("BZIP2");
+ #endif
+ #if HAVE_MIXER
+ defs->insert("MIXER");
+ #endif
+ #if HAVE_GDB_MI
+ defs->insert("DEBUG");
+ #endif
+ #if HAVE_CALCULATOR
+ defs->insert("CALCULATOR");
+ #endif
+ #if HAVE_CALENDAR
+ defs->insert("CALENDAR");
+ #endif
+
+ PreproInfo.depth=0;
+ GetLine();
+ while (!feof(f) && !Error)
+ {
+ s=SkipBlanks(buf);
+ if (*s=='$') // Preprocessor lines
+ {
+ PreproValue=ReadPreprocessor(s,&PreproInfo,&Cat,PreproValue,defs,buf,f);
+ }
+ else
+ if (*s!='#' && *s!='\n' && PreproValue) // Skip comment lines
+ {
+ s=ExpandPreprocessor(s,&PreproInfo,defs);
+ if (strncasecmp(s,"SubMenu:",8)==0)
+ {
+ TSubMenu *m=GetSubMenu(f,buf,s+8,&PreproInfo,&Cat,defs,PreproValue);
+ if (!Error)
+ {
+ if (strcasecmp(m->name,"Editor Right Click")==0)
+ TCEditor::RightClickMenu=m;
+ else
+ AddSubMenu(m);
+ }
+ }
+ else
+ if (strncasecmp(s,"NewMenu:",8)==0)
+ {
+ unsigned min, max;
+ GetNewMenuID(f,buf,s+8,min,max);
+ if (!Error)
+ AddNewMenu(min,max);
+ }
+ else
+ if (strncasecmp(s,"StatusRange:",12)==0)
+ {
+ TStatusDef *st=GetStatusDef(f,buf,s+12,&PreproInfo,&Cat,defs,PreproValue);
+ if (!Error)
+ {
+ if (statusDef)
+ {
+ lastStatusDef->next=st;
+ lastStatusDef=st;
+ }
+ else
+ statusDef=lastStatusDef=st;
+ }
+ }
+ else
+ Error=errMLSyntax;
+ }
+ if (!Error)
+ GetLine();
+ }
+
+ fclose(f);
+ CLY_destroy(defs);
+ if (!Error)
+ {
+ if (!firstMenu->items)
+ Error=errMLNoMenuDefinition;
+ else
+ if (!statusDef)
+ Error=errMLNoStatusDefinition;
+ else
+ return 1;
+ }
+ return 0;
+}
+
+int LoadMenuAndStatus(char *fileName, int forceReload)
+{
+ if (MenuAndStatusLoaded && !forceReload) return 1;
+ Error=0; firstMenu=NULL; statusDef=NULL;
+ return LoadTVMenuAndStatus(fileName);
+}
+
+TMultiMenuBar *GetTVMenu(char *fileName, TRect &rect)
+{
+ if (Error) return 0;
+ if (!firstMenu && !LoadMenuAndStatus(fileName)) return 0;
+ return TMultiMenuBar::createMultiMenuBar(rect,firstMenu);
+}
+
+TStatusLine *GetTVStatusLine(char *fileName, TRect &rect)
+{
+ if (Error) return 0;
+ if (!statusDef && !LoadMenuAndStatus(fileName)) return 0;
+ return new TStatusLine(rect,*statusDef);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ It just deletes anything allocated by this module.
+
+***************************************************************************/
+
+void UnLoadTVMenu(void)
+{
+ delete[] FileName;
+ FileName=0;
+ UnRegisterMacroCommands();
+ free(res.str);
+ res.str=NULL;
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Shows the error using a messageBox. If no error just returns.
+
+***************************************************************************/
+
+void ShowMenuLoadError(void)
+{
+ if (Error && FileName)
+ {
+ char *aux=TVIntl::getTextNew(ErrorNames[Error]);
+ messageBox(mfError | mfOKButton,__("Error loading menu: (%d) %s in line %d of %s."),
+ Error,aux,Line,FileName);
+ DeleteArray(aux);
+ Error=0;
+ delete FileName;
+ FileName=0;
+ }
+}
diff --git a/setedit/setedit/msignal.cc b/setedit/setedit/msignal.cc
new file mode 100644
index 0000000..7ed9d9b
--- /dev/null
+++ b/setedit/setedit/msignal.cc
@@ -0,0 +1,142 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_BestWrite
+#define Uses_itoa
+#include <ceditint.h>
+#include <signal.h>
+#define Uses_unistd
+#define Uses_string
+#define Uses_TScreen
+#define Uses_TEventQueue
+#include <ced_inte.h>
+#include <tv.h>
+#include <stackdbg.h>
+
+extern void StopStdErrRedirection();
+extern void DumpEditors(void);
+static const char *ErrFile=0;
+static char Strategy;
+
+#ifdef SEOS_UNIX
+static
+void WriteOut(const char *s)
+{
+ write(STDOUT_FILENO,s,strlen(s));
+}
+#endif
+
+static
+void EditorSignal(int num)
+{
+ static char msg[] = "Panic! got a signal, quiting\r\n";
+ static char msg1[] ="You asked for it, so quiting\r\n";
+ static char msg2[] ="That's from SET's editor " TCEDITOR_VERSION_STR "\r\n";
+ static char msg3[] ="Signal number: ";
+
+ // No signals now
+ signal(SIGABRT, SIG_IGN);
+ signal(SIGFPE, SIG_IGN);
+ signal(SIGILL, SIG_IGN);
+ signal(SIGSEGV, SIG_IGN);
+ signal(SIGTERM, SIG_IGN);
+ signal(SIGINT, SIG_IGN);
+ /* It doesn't have much sense, SIGKILL never reachs the application ;-)
+ #ifdef SIGKILL
+ signal(SIGKILL, SIG_IGN);
+ #endif */
+ #ifdef SIGQUIT
+ signal(SIGQUIT, SIG_IGN);
+ #endif
+
+ BestWrite(num==SIGINT ? msg1 : msg,sizeof(msg)-1);
+ BestWrite(msg2,sizeof(msg2)-1);
+ // Print which signal we received
+ BestWrite(msg3,sizeof(msg3)-1);
+ char cnum[33];
+ itoa(num,cnum,10);
+ BestWrite(cnum,strlen(cnum));
+ BestWrite("\r\n",2);
+ DumpEditors();
+
+ #ifdef SEOS_UNIX
+ // A dangerous thing but if we don't do it the keyboard will be messed
+ TEventQueue::suspend();
+ if (Strategy!=DBGST_DEBUG)
+ {
+ WriteOut("\rI'm sorry but I did something wrong :-(\r\n");
+ if (ErrFile)
+ {
+ WriteOut("Look in the file ");
+ WriteOut(ErrFile);
+ WriteOut(" for unsaved buffers and information.\r\n");
+ WriteOut("Please send this file to the author (set@ieee.org).\r\n");
+ }
+ }
+ #endif
+ if (Strategy==DBGST_DEBUG && !DebugStackSeparateTerminalWillBeUsed())
+ {// That's really dangerous, but if we don't do it the debugger will
+ // be useless
+ TScreen::suspend();
+ StopStdErrRedirection();
+ }
+ DebugStack(NULL);
+ // Generate the signal
+ signal(num, SIG_DFL);
+ raise(num);
+}
+
+#ifdef SECompf_djgpp
+#include <sys/exceptn.h>
+#include <go32.h>
+void CtrlCOff(void)
+{
+ // Interrupt key: RightShift+Ctrl+Del
+ __djgpp_set_sigint_key(0x553);
+ __djgpp_set_sigquit_key(0x553);
+ _go32_want_ctrl_break(1);
+}
+#endif
+
+#ifdef SEOS_UNIX
+void CtrlCOff(void)
+{
+ // Just ignore ^C and ^\ so people doesn't break the editor unintentionally
+ signal(SIGINT,SIG_IGN);
+ signal(SIGQUIT,SIG_IGN);
+}
+#endif
+
+#ifdef SEOS_Win32
+void CtrlCOff(void)
+{
+ // Ctrl-C and Ctrl-Break keys are disabled in TScreen so we
+ // do nothing here.
+}
+#endif
+
+void InitEditorSignals(char aStrategy, const char *prgName, const char *errFile)
+{
+ Strategy=DebugStackInstall(aStrategy,prgName);
+ if (Strategy==DBGST_DO_NOTHING)
+ {
+ CtrlCOff();
+ return;
+ }
+ ErrFile=errFile;
+
+ signal(SIGABRT, EditorSignal);
+ signal(SIGFPE, EditorSignal);
+ signal(SIGILL, EditorSignal);
+ signal(SIGSEGV, EditorSignal);
+ signal(SIGTERM, EditorSignal);
+ signal(SIGINT, EditorSignal);
+ /* It doesn't have much sense, SIGKILL never reachs the application ;-)
+ #ifdef SIGKILL
+ signal(SIGKILL, EditorSignal);
+ #endif */
+ #ifdef SIGQUIT
+ signal(SIGQUIT, EditorSignal);
+ #endif
+ CtrlCOff();
+}
+
diff --git a/setedit/setedit/pathlist.cc b/setedit/setedit/pathlist.cc
new file mode 100644
index 0000000..51d9da1
--- /dev/null
+++ b/setedit/setedit/pathlist.cc
@@ -0,0 +1,445 @@
+/* Copyright (C) 2001-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Module: Path Lists
+ Comments:
+ Handles the list of directories to search for when the user press ^+Enter
+over a file name. It is usually the path for include files.@*
+ It is handled as some kind of string collection (TPathList), it needs
+more memory and disk space but is much more easy to setup. [Note: Here I'm
+comparing it with the simple string used in RHIDE]
+
+***************************************************************************/
+
+#include <ceditint.h>
+#define Uses_string
+#define Uses_limits
+#define Uses_stdlib
+#define Uses_stdio
+#define Uses_unistd
+// TV
+#define Uses_TCollection
+#define Uses_TStreamableClass
+#define Uses_fpstream
+#define Uses_MsgBox
+#define Uses_TScreen
+// EasyDiag
+#define Uses_TSHzLabel
+#define Uses_TSInputLine
+#define Uses_TSButton
+#define Uses_AllocLocal
+// SetTVUti
+#define Uses_TStringable
+#define Uses_TDialogAID
+
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#define Uses_SETAppProject
+#include <setapp.h>
+#include <rhutils.h>
+#include <pathlist.h>
+#include <edspecs.h>
+#include <fileopen.h>
+#include <debug.h> // DBG_AddPathForSources
+
+class TPathList : public TCollection, public TStringable
+{
+public:
+ TPathList() : TCollection(5,2), TStringable() {};
+ // TStringable:
+ virtual void getText(char *dest, unsigned item, int maxLen);
+ virtual unsigned GetCount(void) { return getCount(); };
+ TPathList &operator = (const TPathList & pl);
+
+ SetDefStreamMembers(TPathList,TCollection)
+};
+
+const char * const TPathList::name="TPathList";
+TStreamableClass RPathList(TPathList::name,TPathList::build,__DELTA(TPathList));
+
+SetDefStreamOperators(TPathList);
+
+void *TPathList::readItem(ipstream& is)
+{
+ return (void *)is.readString();
+}
+
+void TPathList::writeItem(void *obj, opstream& os)
+{
+ os.writeString((const char *)obj);
+}
+
+void TPathList::getText(char *dest, unsigned item, int maxLen)
+{
+ const char *ori=(const char *)at(item);
+ strncpy(dest,ori,maxLen);
+ dest[maxLen]=EOS;
+}
+
+TPathList & TPathList::operator = (const TPathList & pl)
+{
+ ccIndex i;
+ freeAll();
+ for (i=0;i<pl.count;i++)
+ insert(newStr((char *)pl.items[i]));
+ return *this;
+}
+
+static TPathList *lists[paliLists]={NULL,NULL}, *lEdited;
+const char Version=2;
+const int MaxLineLen=PATH_MAX;
+static const char *Titles[paliLists]=
+{
+ __("Path to look for includes"),
+ __("Path to look for sources")
+};
+static const char *tEdited;
+static int listChanged;
+static unsigned hCtxEdited;
+
+void PathListSave(fpstream& s)
+{
+ s << Version;
+ s << (uchar)paliLists;
+ for (int i=0; i<paliLists; i++)
+ if (lists[i] && lists[i]->getCount())
+ s << (uchar)1 << lists[i];
+ else
+ s << (uchar)0;
+}
+
+void PathListUnLoad()
+{
+ for (int i=0; i<paliLists; i++)
+ destroy0(lists[i]);
+}
+
+void PathListLoad(fpstream& s)
+{
+ uchar aux, version, cant;
+ s >> version;
+ PathListUnLoad();
+ if (version>=2)
+ s >> cant;
+ else
+ cant=1;
+ for (int i=0; i<cant; i++)
+ {
+ s >> aux;
+ if (aux)
+ s >> lists[i];
+ }
+}
+
+static
+void PathListAddFromPrj(void *p, void *data)
+{
+ TPathList *l=(TPathList *)data;
+ char f[PATH_MAX];
+ ProjectGetNameFromItem(p,f,PATH_MAX);
+ // Find the "path" part
+ char *end=strrchr(f,'/');
+ if (end)
+ {
+ char aux=*end;
+ *end=0;
+ // Not sorted, so we must do a brut force search
+ int i, c=l->getCount(), found=0;
+ for (i=0; i<c; i++)
+ if (strcmp(f,(char *)l->at(i))==0)
+ {
+ found=1;
+ break;
+ }
+ if (!found)
+ {
+ //printf("Adding %s from project\n",f);
+ l->insert(newStr(f));
+ // It works only when "stopped"
+ DBG_AddPathForSources(f);
+ }
+ *end=aux;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Adds a path for a project item to the @var{which} list. Note that
+@var{item} must be a PrjItem pointer.
+
+***************************************************************************/
+
+void PathListAddPathFor(void *item, int which)
+{
+ if (lists[which])
+ PathListAddFromPrj(item,lists[which]);
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Fill the list of directories with the include directories. We use the
+output of cpp or a guess.
+
+ Return: !=0 if we got something from cpp
+
+***************************************************************************/
+
+int PathListPopulate(int which)
+{
+ if (which==paliInclude)
+ {
+ TPathList *IncludeList=new TPathList();
+ lists[paliInclude]=IncludeList;
+
+ // 1) Try invoking the GNU preprocessor
+ char *err=open_stderr_out();
+ TScreen::System("cpp -x c++ -v /dev/null");
+ close_stderr_out();
+ // Check what we got
+ FILE *f=fopen(err,"r");
+ if (f)
+ {
+ char resp[PATH_MAX];
+ int state=0;
+ while (!feof(f) && state!=2)
+ {
+ fgets(resp,PATH_MAX,f);
+ switch (state)
+ {
+ case 0:
+ if (strncmp(resp,"#include <",10)==0)
+ state=1;
+ break;
+ case 1:
+ if (resp[0]!=' ')
+ state=2;
+ else
+ {// Insert the path
+ int l=1;
+ char *s=resp;
+ for (; s[l] && CLY_IsntEOL(s[l]); l++);
+ s[l]=0;
+ char *path=new char[l];
+ memcpy(path,s+1,l);
+ IncludeList->insert(path);
+ //printf("Agregando <%s>\n",path);
+ }
+ break;
+ }
+ }
+ fclose(f);
+ }
+ unlink(err);
+
+ if (IncludeList->getCount())
+ return 1;
+
+ char buffer[PATH_MAX];
+ #ifdef SECompf_djgpp
+ char *djdir=getenv("DJDIR");
+ if (!djdir)
+ djdir="c:/djgpp";
+ strcpy(buffer,djdir);
+ strcat(buffer,"/include");
+ #else
+ strcpy(buffer,"/usr/include");
+ #endif
+ IncludeList->insert(newStr(buffer));
+ }
+ else if (which==paliSource)
+ {
+ TPathList *SourceList=new TPathList();
+ lists[paliSource]=SourceList;
+
+ if (IsPrjOpened())
+ ProjectApplyToItems(PathListAddFromPrj,SourceList);
+ }
+
+ return 0;
+}
+
+int PathListGetItem(ccIndex pos, char *buffer, int which)
+{
+ TPathList *p=lists[which];
+ if (!p)
+ PathListPopulate(which);
+ if (!p || pos>=p->getCount())
+ return 0;
+ const char *str=(const char *)p->at(pos);
+ const char *var=strstr(str,"$(");
+ int avail=PATH_MAX-1;
+ if (!var)
+ {
+ int l=min((int)strlen(str),avail);
+ memcpy(buffer,str,l);
+ buffer[l]=0;
+ }
+ else
+ {// This is some rudimentary $(VARIABLE) expansion
+ int offset=0;
+ do
+ {
+ int l=var-str;
+ if (offset+l>avail)
+ break;
+ memcpy(buffer+offset,str,l);
+ offset+=l;
+ str+=l+2;
+ var=strchr(str,')');
+ if (var)
+ {
+ l=var-str;
+ AllocLocalStr(v,l+1);
+ memcpy(v,str,l);
+ v[l]=0;
+ const char *vVar=GetVariable(v);
+ if (vVar)
+ {
+ int lVar=strlen(vVar);
+ if (offset+lVar>avail)
+ break;
+ memcpy(buffer+offset,vVar,lVar);
+ offset+=lVar;
+ }
+ str=var+1;
+ var=strstr(str,"$(");
+ if (!var)
+ {
+ if (offset+strlen(str)>(unsigned)avail)
+ break;
+ strcpy(buffer+offset,str);
+ }
+ }
+ else
+ buffer[offset]=0;
+ }
+ while (var);
+ //printf("Expandido: %s\n",buffer);
+ }
+ return 1;
+}
+
+static
+char *EditItem(const char *s)
+{
+ char b[MaxLineLen];
+ TSViewCol *col=new TSViewCol(tEdited);
+
+ TSHzLabel *lineLabel=new TSHzLabel(__("Directory"),
+ new TSInputLine(MaxLineLen,60));
+
+ col->insert(xTSCenter,yTSUpSep,lineLabel);
+ EasyInsertOKCancel(col,3);
+
+ TDialog *d=col->doItCenter(hCtxEdited);
+ delete col;
+
+ strcpy(b,s);
+ unsigned ret=execDialog(d,b);
+ if (ret==cmOK)
+ return newStr(b);
+ return 0;
+}
+
+static
+int AddItem(void)
+{
+ char *s=EditItem("");
+ if (s)
+ {
+ lEdited->insert(s);
+ if (lEdited==lists[paliSource])
+ // It works only when "stopped"
+ DBG_AddPathForSources(s);
+ listChanged++;
+ return 1;
+ }
+ return 0;
+}
+
+static
+int AddDir(void)
+{
+ char *s=ChooseDir();
+ if (s)
+ {
+ lEdited->insert(s);
+ if (lEdited==lists[paliSource])
+ // It works only when "stopped"
+ DBG_AddPathForSources(s);
+ listChanged++;
+ return 1;
+ }
+ return 0;
+}
+
+static
+int DeleteItem(int which)
+{
+ lEdited->atRemove(which);
+ listChanged++;
+ return 1;
+}
+
+static
+int CancelConfirm(void)
+{
+ if (listChanged)
+ return messageBox(__("Do you want to discard the changes?"),
+ mfWarning | mfYesButton | mfNoButton)==cmYes;
+ return 1;
+}
+
+void PathListEdit(int which, unsigned hCtx)
+{
+ lEdited=lists[which];
+ if (!lEdited)
+ {
+ PathListPopulate(which);
+ lEdited=lists[which];
+ if (!lEdited)
+ return;
+ }
+ tEdited=Titles[which];
+ TDialogAID *d=CreateAddInsDelDialog(-1,-1,tEdited,12,50,aidOKEnabled | aidBrowse);
+ d->helpCtx=hCtxEdited=hCtx;
+ d->DelAction=DeleteItem;
+ d->AddAction=AddItem;
+ d->CancelAction=CancelConfirm;
+ d->BrowseAction=AddDir;
+
+ TStringableListBoxRec box;
+ box.items=lEdited;
+ box.selection=0;
+ listChanged=0;
+
+ TPathList *backup=new TPathList();
+ *backup=*lEdited;
+
+ unsigned ret=execDialog(d,&box);
+ if (listChanged && ret!=cmOK)
+ *lEdited=*backup;
+
+ CLY_destroy(backup);
+}
+
+void PathListAdd(int which, const char *path)
+{
+ lEdited=lists[which];
+ if (!lEdited)
+ {
+ PathListPopulate(which);
+ lEdited=lists[which];
+ if (!lEdited)
+ return;
+ }
+ lEdited->insert(newStr(path));
+}
+
diff --git a/setedit/setedit/runprog.cc b/setedit/setedit/runprog.cc
new file mode 100644
index 0000000..0b435ad
--- /dev/null
+++ b/setedit/setedit/runprog.cc
@@ -0,0 +1,942 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+//#define DEBUG
+#include <ceditint.h>
+#define Uses_stdio
+#define Uses_stdlib
+#define Uses_AllocLocal
+#define Uses_string
+#define Uses_unistd
+#define Uses_ctype
+#define Uses_limits
+#define Uses_getcwd
+
+#define Uses_MsgBox
+#define Uses_fpstream
+#define Uses_TDialog
+#define Uses_SOStack
+#define Uses_TDialog
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TStringCollection
+#define Uses_TScreen
+#define Uses_TVCodePage
+
+#define Uses_TSInputLine
+#define Uses_TSLabel
+#define Uses_TSHzLabel
+#define Uses_TSLabelCheck
+#define Uses_TSLabelRadio
+#define Uses_TSButton
+#define Uses_TSSortedListBox
+#define Uses_TSVeGroup
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <ceditor.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppDialogs
+#define Uses_SETAppHelper
+#define Uses_SETAppVarious
+#define Uses_SETAppConst
+#define Uses_TSetEditorApp
+#include <setapp.h>
+
+#include <edmsg.h>
+#include <dyncat.h>
+#include <rhutils.h>
+#include <splinman.h>
+#include <intermp3.h>
+#include <runprog.h>
+#include <loadcle.h>
+#include <edhists.h>
+
+#ifdef TVOS_UNIX
+#include <sys/wait.h>
+#include <signal.h>
+#endif
+
+// Values for Options
+const unsigned opUseOSScreen=1,opNeverFork=2,opAlwaysBkgd=4,opJumpFirstError=8,
+ opNoRedirOut=16, opNoBeep=32, opNoDebugStop=64, opNoBkpMove=128,
+ opWarnDebugStop=256;
+const unsigned opshBegin=1,opshEachMessage=2,opshEnd=4;
+
+const int maxCommand=256;
+
+static char Command[maxCommand]="\x0";
+static uint32 Options=0;
+static uint32 OpsScrHz=opshBegin | opshEnd;
+static char *CurrentParser=NULL;
+static char *ErrorFile=NULL;
+static char *incCompiler;
+static int IndexCLE;
+static int incGoBack, incLines=20;
+static pid_t PidChild=0;
+static char ParsingErrors=0;
+static char PendingCleanUp=0;
+static SOStack *StackPath;
+static char *RedirInputFile=0;
+
+const char *Running=__("Running %s");
+const char *BackEd=__("Back in the editor");
+const char *FromPrg=__("From program:");
+
+void ConfigureRunCommand(void)
+{
+ if (!Command[0])
+ strcpy(Command,"make");
+
+ #pragma pack(1)
+ struct
+ {
+ char ComAux[maxCommand];// CLY_Packed;
+ uint32 Options CLY_Packed;
+ uint32 OpsScroll CLY_Packed;
+ uint32 OpsScrHz CLY_Packed;
+ char Lines[4];// CLY_Packed;
+ TListBoxRec tl CLY_Packed;
+ } box;
+ #pragma pack()
+ strcpy(box.ComAux,Command);
+ box.Options=Options & (~edsmScrollMask);
+ box.OpsScroll=(Options & edsmScrollMask)/edsmScrollShifter;
+ box.OpsScrHz=OpsScrHz;
+ sprintf(box.Lines,"%d",incLines);
+
+ TStringCollection *list=CLEGetList();
+ box.tl.items=list;
+ int validList=box.tl.items && list->getCount()!=0;
+ if (validList)
+ {
+ if (!CurrentParser)
+ CurrentParser=newStr("GNU");
+ ccIndex selection;
+ if (!list->search((void *)CurrentParser,selection))
+ selection=0;
+ box.tl.selection=selection;
+ }
+
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(1,1,1,1),__("Command to run")));
+ // EN: ABCDEFGHIJKLMNOPRSTUW
+ // ES: ACDEFKHIJLMNOPRSTUVZ
+ TSLabel *progInput=new TSLabel(__("~E~nter the program name"),
+ new TSInputLine(maxCommand,1,hID_RunProgram,40));
+ TSLabel *options=TSLabelCheck(__("~O~ptions"),
+ __("~U~se OS screen to run the program"),
+ __("~D~on't try to run in background"),
+ __("~A~lways parse in background"),
+ __("~J~ump to the first error"),
+ __("Don't ~r~edirect stdout"),
+ __("Don't make a beep when f~i~nished"),
+ __("Don't finish debu~g~ session"),
+ __("Don't move breakp~o~ints"),
+ __("~C~onfirm if stopping debug session"),0);
+ TSLabel *opsscroll=TSLabelRadio(__("Message window ~s~croll"),
+ __("Al~w~ays"),__("~N~ever"),__("Only if not ~f~ocused"),0);
+ TSVeGroup *grp=MakeVeGroup(0,progInput,options,opsscroll,0);
+ grp->makeSameW();
+ col->insert(2,1,grp);
+
+ TSLabel *optscrh=TSLabelCheck(__("~H~orizontal reset"),
+ __("At ~b~eggining"),
+ __("For each ~m~essage"),
+ __("At ~t~he end"),0);
+ TSHzLabel *linesInput=new TSHzLabel(__("~L~ines per pass"),new TSInputLine(4));
+ TSVeGroup *grp2=MakeVeGroup(0,optscrh,linesInput,0);
+
+ if (validList)
+ {
+ TSLabel *compilers=new TSLabel(__("Error ~p~arser"),
+ new TSSortedListBox(28,grp->h-1-grp2->h,tsslbVertical));
+ grp2=MakeVeGroup(0,grp2,compilers,0);
+ }
+ grp2->makeSameW();
+ col->insert(xTSRightOf,yTSUp,grp2,grp);
+
+ EasyInsertOKCancel(col);
+
+ TDialog *d=col->doIt();
+ delete col;
+ d->options|=ofCentered;
+ d->helpCtx=cmeConfRunCommand;
+
+ if (execDialog(d,&box)!=cmCancel)
+ {
+ strcpy(Command,box.ComAux);
+ Options=box.Options | (box.OpsScroll*edsmScrollShifter);
+ OpsScrHz=box.OpsScrHz;
+ incLines=atoi(box.Lines);
+ if (validList)
+ {
+ delete[] CurrentParser;
+ CurrentParser=newStr((char *)box.tl.items->at(box.tl.selection));
+ }
+ }
+}
+
+static inline
+void MakeBeep()
+{
+ if (!(Options & opNoBeep))
+ CLY_Beep();
+}
+
+static
+char *ParseFun(char *buf, FileInfo &fI, char *&fileName)
+{
+ char *endOfName,*endOfLine=0,*startOfColumn=0;
+ int offset=0;
+ int IsLineNumber=0;
+ static unsigned lastFIT=fitNone;
+ static const char *errorMsg=NULL, *warningMsg=NULL,
+ *enteringDir=NULL, *leavingDir=NULL;
+ // Error message from a GNU tool (i.e. gcc)
+ static const char errorMsgEN[]=__("error");
+ // Warning message from a GNU tool (i.e. gcc)
+ static const char warningMsgEN[]=__("warning");
+ // GNU Make message: Entering directory (partial)
+ static const char *enteringDirEN=__("ntering dir");
+ // GNU Make message: Leaving directory (partial)
+ static const char *leavingDirEN=__("eaving dir");
+ static size_t errorLen, warningLen,
+ errorLenEN=sizeof(errorMsgEN)-1,
+ warningLenEN=sizeof(warningMsgEN)-1;
+ static int initialized=0;
+
+ if (!initialized)
+ {// Cache the i18n messages.
+ initialized=1;
+ errorMsg=_(errorMsgEN);
+ errorLen=strlen(errorMsg);
+ if (errorLen==errorLenEN && strcmp(errorMsg,errorMsgEN)==0)
+ errorMsg=NULL;
+ warningMsg=_(warningMsgEN);
+ warningLen=strlen(warningMsg);
+ if (warningLen==warningLenEN && strcmp(warningMsg,warningMsgEN)==0)
+ warningMsg=NULL;
+ enteringDir=_(enteringDirEN);
+ if (strcmp(enteringDir,enteringDirEN)==0)
+ enteringDir=NULL;
+ leavingDir=_(leavingDirEN);
+ if (strcmp(leavingDir,leavingDirEN)==0)
+ leavingDir=NULL;
+ }
+
+ // gcc 3.x cuts long lines and indents the continuations
+ if (buf[0]==' ' && buf[1]==' ' && buf[2]==' ' && buf[3]!=' ')
+ {
+ fI.type=lastFIT | fitCont;
+ fI.Line=-1;
+ // We let 1 extra space.
+ fI.len=strlen(buf+2);
+ fI.offset=2;
+ fileName=NULL;
+ return strdup(buf);
+ }
+
+ // Look for file name and line number
+ // It fails if: The file is absolute and starts with a number
+ if (TVCodePage::isAlpha(buf[0]) && buf[1]==':' && (!ucisdigit(buf[2])))
+ offset=2;
+ endOfName=strchr(buf+offset,':');
+ if (endOfName)
+ endOfLine=strchr(endOfName+1,':');
+ /* Check if the line number is real */
+ if (endOfLine && ucisdigit(endOfName[1]))
+ {
+ char *s;
+ for (s=endOfName+2; *s!=':' && ucisdigit(*s); s++);
+ IsLineNumber=*s==':';
+ if (IsLineNumber)
+ {// Optional column
+ for (s=endOfLine+1; *s!=':' && ucisdigit(*s); s++);
+ if (*s==':')
+ {
+ startOfColumn=endOfLine+1;
+ endOfLine=s;
+ }
+ // Check if the error is empty ...
+ for (s=endOfLine+1; *s && ucisspace(*s); s++);
+ if (!*s) // in this case invalidate it
+ endOfName=0;
+ }
+ }
+ if (!endOfName || !endOfLine || !IsLineNumber)
+ {
+ lastFIT=fI.type=fitNone;
+ char *s=strstr(buf,enteringDirEN);
+ if (!s && enteringDir)
+ s=strstr(buf,enteringDir);
+ if (s)
+ {
+ // The people that makes make if funny:
+ s=strchr(s,'`');
+ if (s)
+ {
+ char *e=strrchr(s,'\'');
+ if (e)
+ {
+ char ActualPath[PATH_MAX];
+ char v=*e;
+ *e=0;
+ strcpy(ActualPath,s+1);
+ *e=v;
+ strcat(ActualPath,"/");
+ StackPath->addStr(ActualPath);
+ }
+ lastFIT=fI.type=fitInfo;
+ }
+ }
+ else
+ {
+ s=strstr(buf,leavingDirEN);
+ if (!s && leavingDir)
+ s=strstr(buf,leavingDir);
+ if (s)
+ {
+ StackPath->DestroyTop();
+ lastFIT=fI.type=fitInfo;
+ }
+ }
+ fI.Line=-1;
+ fileName=NULL;
+ return strdup(buf);
+ }
+
+ char *actPath=StackPath->GetStrOf(StackPath->GetTopHandle());
+
+ char *ret;
+ fI.len=strlen(endOfLine+1);
+ fI.offset=endOfLine-buf+1;
+ ret=strdup(buf);
+ char bFile[PATH_MAX];
+ if (offset || buf[0]=='/' || buf[0]=='\\')
+ { // Absolute path
+ *endOfName=0;
+ strcpy(bFile,buf);
+ }
+ else
+ { // Relative path
+ // Put the actual directory
+ strcpy(bFile,actPath);
+ // Now the name
+ *endOfName=0;
+ strcat(bFile,buf);
+ }
+ // Fix it to avoid things like /dir/../dir/file
+ CLY_fexpand(bFile);
+ fileName=strdup(bFile);
+
+ *endOfLine=0;
+ // Determine the kind of message
+ fI.type=fitNone;
+ char *errTest=endOfLine+1;
+ if (ucisspace(*errTest))
+ errTest++;
+ if (strncmp(errTest,errorMsgEN,errorLenEN)==0)
+ fI.type=fitError;
+ else if (strncmp(errTest,warningMsgEN,warningLenEN)==0)
+ fI.type=fitWarning;
+ else if (errorMsg && strncmp(errTest,errorMsg,errorLen)==0)
+ fI.type=fitError;
+ else if (warningMsg && strncmp(errTest,warningMsg,warningLen)==0)
+ fI.type=fitWarning;
+ else
+ fI.type=fitInfo;
+ lastFIT=fI.type;
+
+ fI.Line=atoi(endOfName+1);
+ fI.Column=startOfColumn ? atoi(startOfColumn) : 1;
+
+ return ret;
+}
+
+static
+char *ParseFunCLE(char *buf, FileInfo &fI, char *&fileName)
+{
+ fI.Line=-1;
+ fI.type=fitNone;
+ fileName=0;
+ if (!CLEValues[IndexCLE].Pattern)
+ return strdup(buf);
+
+ int hits,len=strlen(buf);
+ char fName[PATH_MAX];
+ if ((hits=CLEDoSearch(buf,len,CLEValues[IndexCLE].Pattern))==0)
+ { // No luck with the error pattern see others
+ if (CLEValues[IndexCLE].EnterDirPat &&
+ CLEValues[IndexCLE].EnterDirDir!=0xFF &&
+ CLEDoSearch(buf,len,CLEValues[IndexCLE].EnterDirPat)!=0)
+ { // Entering in a directory
+ CLEGetMatch(CLEValues[IndexCLE].EnterDirDir,fName,PATH_MAX);
+ StackPath->addStr(fName);
+ }
+ else
+ if (CLEValues[IndexCLE].LeaveDir &&
+ CLEDoSearch(buf,len,CLEValues[IndexCLE].LeaveDir)!=0)
+ {
+ StackPath->DestroyTop();
+ }
+ return strdup(buf);
+ }
+ // Ok, we have a match
+
+ char *actPath=StackPath->GetStrOf(StackPath->GetTopHandle());
+
+ CLEGetMatch(CLEValues[IndexCLE].File,fName,PATH_MAX);
+ if (fName[1]==':' || fName[0]=='/' || fName[0]=='\\')
+ { // Absolute path
+ CLY_fexpand(fName);
+ fileName=strdup(fName);
+ }
+ else
+ { // Relative path
+ char bFile[PATH_MAX];
+ strcpy(bFile,actPath);
+ int l=strlen(bFile);
+ if (l && actPath[l-1]!='/' && actPath[l-1]!='\\')
+ strcat(bFile,"/");
+ strcat(bFile,fName);
+ CLY_fexpand(bFile);
+ fileName=strdup(bFile);
+ }
+
+ CLEGetMatch(CLEValues[IndexCLE].Line,fName,PATH_MAX);
+ fI.Line=atoi(fName);
+ fI.Column=1;
+ CLEGetMatch(CLEValues[IndexCLE].Description,fI.offset,fI.len);
+
+ // Try to figure out the severity
+ if (CLEValues[IndexCLE].Severity!=0xFF)
+ {
+ char severity[32];
+ int len=CLEGetMatch(CLEValues[IndexCLE].Severity,severity,32);
+ if (CLEValues[IndexCLE].SevError &&
+ CLEDoSearch(severity,len,CLEValues[IndexCLE].SevError))
+ fI.type=fitError;
+ else if (CLEValues[IndexCLE].SevWarn &&
+ CLEDoSearch(severity,len,CLEValues[IndexCLE].SevWarn))
+ fI.type=fitWarning;
+ else
+ fI.type=fitInfo;
+ }
+ else
+ fI.type=fitError;
+
+ return strdup(buf);
+}
+
+static
+char *nullStr()
+{
+ char *s;
+ s=new char[1];
+ *s=0;
+ return s;
+}
+
+static
+void RemoveErrorFile()
+{
+ unlink(ErrorFile);
+ DeleteArray(ErrorFile);
+ ErrorFile=0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the content of the file where the last call to RunExternalProgram
+stored the redirected data. @x{RunExternalProgram}. You must pass the
+maximun allowed len and the function will return the real len.
+
+ Return:
+ A new allocated string even on error. If error ocurred the new string
+have 0 lenght.
+
+***************************************************************************/
+
+char *RunExternalProgramGetFile(int &len)
+{
+ char *s;
+ long lMax=len;
+
+ len=0;
+ if (!ErrorFile)
+ return nullStr();
+ FILE *f=fopen(ErrorFile,"rb");
+ if (!f)
+ s=nullStr();
+ else
+ {
+ long lFile;
+ fseek(f,0,SEEK_END);
+ lFile=ftell(f);
+ fseek(f,0,SEEK_SET);
+ if (lFile>lMax)
+ lFile=lMax;
+
+ s=new char[lFile+1];
+ if (fread(s,lFile,1,f)!=1)
+ {
+ delete s;
+ s=nullStr();
+ }
+ else
+ len=(int)lFile;
+ s[lFile]=0; // Make it ASCIIZ
+
+ fclose(f);
+ }
+
+ RemoveErrorFile();
+ return s;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Deletes the file where the redirection is stored.
+
+***************************************************************************/
+
+void RunExternalProgramKillFile(void)
+{
+ if (!ErrorFile)
+ return;
+ RemoveErrorFile();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the pid of owr child. If no child is running it returns 0.
+
+***************************************************************************/
+
+pid_t RunExternalProgramGetChildPid()
+{
+ return PidChild;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns True if we are running a command or parsir their ouptup and hence
+we can run another.
+
+***************************************************************************/
+
+Boolean RunExternalProgramRunning()
+{
+ return PidChild || ParsingErrors ? True : False;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ If we still collecting information from a child process it says the user
+we can't run another process.
+
+ Return:
+ True if we are free to run another process.
+
+***************************************************************************/
+
+Boolean RunExternalProgramNotRunning()
+{
+ if (RunExternalProgramRunning())
+ {
+ messageBox(__("A child process is running. Please wait or stop it."),
+ mfError | mfOKButton);
+ return False;
+ }
+ return True;
+}
+
+static
+void IncCleanUp()
+{
+ uint32 scrlOps=Options & edsmScrollMask;
+ if (!PendingCleanUp)
+ {
+ TView::disableCommand(cmeStopChild);
+ DumpFileToMessageEnd();
+ RemoveErrorFile();
+ delete StackPath;
+ StackPath=0;
+ DeleteArray(incCompiler);
+ }
+ // Check if the desktop is executing a modal dialog
+ TView *p=TApplication::deskTop->current;
+ if (p && (p->state & sfModal))
+ {// Yes, wait.
+ if (!PendingCleanUp)
+ {
+ uint32 op=scrlOps | edsmDontSelect;
+ PendingCleanUp=1;
+ if (!(OpsScrHz & opshEnd))
+ op|=edsmNoHzReset;
+ MakeBeep();
+ EdShowMessageI(__("Waiting ..."),op);
+ }
+ return;
+ }
+ else
+ MakeBeep();
+ // Ok, we can go on
+ ParsingErrors=0;
+ EdShowMessageI(BackEd,scrlOps |
+ ((OpsScrHz & opshEnd) ? 0 : edsmNoHzReset));
+ if (!(Options & opNoBkpMove))
+ TSetEditorApp::DebugMoveBreakPts();
+ if (incGoBack)
+ {
+ if (Options & opJumpFirstError)
+ EdJumpToFirstError();
+ else
+ if (scrlOps==edsmEverScroll)
+ EdJumpToMessage(0);
+ }
+ ReLoadModifEditors();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Incrementally parses the errors. Just one error will be parsed and only if
+available. Should be used when RunExternalProgram didn't parse the file
+and we won't to do it in "background", specially if our child is running in
+parallel.
+ It should be called from the TApplication::idle() member.
+
+***************************************************************************/
+
+void RunExternalProgramIncParse()
+{
+ if (!PidChild && !ParsingErrors)
+ return;
+ if (PidChild && !ParsingErrors)
+ {// First call
+ ParsingErrors=1;
+ if (PidChild==-1)
+ PidChild=0;
+ incGoBack=0;
+ IndexCLE=CLEGetIndexOfLoad(incCompiler);
+ uint32 op=Options & edsmScrollMask;
+ if (!(OpsScrHz & opshEachMessage))
+ op|=edsmNoHzReset;
+ DumpFileToMessageInit(ErrorFile,FromPrg,op,
+ IndexCLE<0 ? ParseFun : ParseFunCLE);
+ }
+
+ if (PidChild)
+ {
+ // See if our child still alive
+ #ifdef TVOS_UNIX
+ int status;
+ // If waitpid returns the number of our child means it communicated
+ // to as a termination status
+ if (waitpid(PidChild,&status,WNOHANG)==PidChild)
+ PidChild=0;
+ #else
+ PidChild=0;
+ #endif
+ }
+
+ int Finished=DumpFileToMessageParseMore(incLines,&incGoBack);
+
+ if (Finished && !PidChild)
+ {// Finished
+ IncCleanUp();
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Kills a running child and stops the "background" message parsing.
+
+***************************************************************************/
+
+void RunExternalProgramStopChild()
+{
+ if (!PidChild && !ParsingErrors)
+ return;
+ if (PidChild)
+ {
+ #ifdef TVOS_UNIX
+ // See if our child still alive
+ int status;
+ dbprintf("runprog: killing: %d\n",PidChild);
+ // 0 means the child doesn't communicate a termination status
+ if (waitpid(PidChild,&status,WNOHANG)==0)
+ {
+ dbprintf("runprog: sending SIGTERM\n");
+ // Kill the group (session in fact)
+ kill(-PidChild,SIGTERM);
+ // Wait a little bit to let the OS really kill it
+ usleep(100000);
+ if (waitpid(PidChild,&status,WNOHANG)==0)
+ {// It doesn't say is finished, ok force it to die
+ dbprintf("runprog: sending SIGKILL\n");
+ kill(-PidChild,SIGKILL);
+ waitpid(PidChild,&status,0);
+ }
+ }
+ #endif
+ PidChild=0;
+ }
+ EdShowMessageI(__("Process interrupted"),((OpsScrHz & opshEnd) ? 0 : edsmNoHzReset));
+ IncCleanUp();
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Saves the indicated data to a temporal file. It can be used to redirect
+the input of a program when calling RunExternalProgram with the repRedirIn
+option. Use RunExternalProgramRemoveInRedir to release the used resources.
+@x{RunExternalProgramRemoveInRedir}.
+
+***************************************************************************/
+
+void RunExternalProgramSetInRedir(const char *buffer, unsigned len)
+{
+ free(RedirInputFile);
+ RedirInputFile=unique_name("in");
+ FILE *f=fopen(RedirInputFile,"wb");
+ if (f)
+ {
+ fwrite(buffer,len,1,f);
+ fclose(f);
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Releases all the resourses allocated by RunExternalProgramSetInRedir.
+@x{RunExternalProgramSetInRedir}.
+
+***************************************************************************/
+
+void RunExternalProgramRemoveInRedir()
+{
+ if (RedirInputFile)
+ {
+ unlink(RedirInputFile);
+ free(RedirInputFile);
+ RedirInputFile=0;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Runs an external program passed as argument. The stderr and stdout are
+redirected and the result is showed in the message window. If you don't pass
+an argument the program specified by the configuration dialog is used.@*
+ Valid flags are:@*
+ repDontShowDialog: if the argument is null the dialog that tells about
+the configuration is not showed.@*
+ repDontShowAsMessage: the redirected information isn't showed in the
+message box, instead the file is available calling
+RunExternalProgramGetFile.@*
+ repRestoreScreen: Restore the screen after running the program.@*
+ repDontFork: Don't try to multitask.@*
+ repRedirIn: Redirect standard input and send the contents of
+RedirInputFile to it.@*
+ repNoRedirOut: Avoid redirecting stdout, useful for interactive
+applications that prints to stdout.@*
+
+***************************************************************************/
+
+void RunExternalProgram(char *Program, unsigned flags, char *compiler)
+{
+ // If for some reason we still running a command don't run another
+ if (PidChild || ParsingErrors) return;
+
+ char *s=Command;
+ if (Program)
+ s=Program;
+ if (!compiler)
+ compiler=CurrentParser;
+
+ if (!s || *s==0)
+ {
+ if ((flags & repDontShowDialog)==0)
+ messageBox(__("You must configure it first in the Options submenu"),mfError | mfOKButton);
+ return;
+ }
+
+ SaveAllEditors();
+
+ // Take the options from the flags
+ int useOSScreen=flags & repRestoreScreen;
+ int dontFork =flags & repDontFork;
+ int noRedirOut =flags & repNoRedirOut;
+ int noStopDebug=!(flags & repStopDebug);
+ // Should we use global defaults to complement flags?
+ if (flags & repFlagsFromOps)
+ {
+ useOSScreen=useOSScreen || (Options & opUseOSScreen);
+ dontFork =dontFork || (Options & opNeverFork);
+ noRedirOut =noRedirOut || (Options & opNoRedirOut);
+ noStopDebug=noStopDebug && (Options & opNoDebugStop);
+ }
+
+ if (!noStopDebug)
+ {// We have to stop the debug session
+ if (!TSetEditorApp::DebugCloseSession(Options & opWarnDebugStop ? True : False))
+ // The user canceled it, abort
+ return;
+ }
+
+ int saveScreen=!TScreen::noUserScreen() && useOSScreen;
+ if ((flags & repDontShowAsMessage)==0)
+ {
+ char b[1024];
+ TVIntl::snprintf(b,1024,Running,s);
+ EdShowMessage(b,True,((OpsScrHz & opshBegin) ? False : True));
+ }
+
+ // It must be done before redirecting stdout because UNIX terminals uses
+ // stdout for drawing. So if we redirect stdout to a file then it will
+ // fail.
+ if (saveScreen)
+ FullSuspendScreen();
+
+ int nherr;
+ char *err=noRedirOut ? open_stderr(&nherr) : open_stderr_out(&nherr);
+
+ StackPath=new SOStack();
+ char b[PATH_MAX];
+ //getwd(b); Declared as dangerous by glibc 2, reported by ld ?!
+ getcwd(b,PATH_MAX);
+ strcat(b,"/");
+ StackPath->addStr(b);
+
+ // Redirect the input if needed
+ strcpy(b,s);
+ if ((flags & repRedirIn) && RedirInputFile && strlen(RedirInputFile)+
+ strlen(s)+4<PATH_MAX)
+ {
+ strcat(b," < ");
+ strcat(b,RedirInputFile);
+ }
+
+ MP3Suspend;
+ TScreen::System(b,saveScreen || dontFork ? 0 : &PidChild,-1,
+ noRedirOut ? -1 : nherr,nherr);
+ MP3Resume;
+
+ if (noRedirOut)
+ close_stderr();
+ else
+ close_stderr_out();
+
+ // It must be done after closing the stdout redirection for the above
+ // mentioned reasons. The effect of doing it with the redirected file
+ // is even worst because a file is not a tty ;-)
+ if (saveScreen)
+ FullResumeScreen();
+
+ if (!PidChild && (flags & repDontShowAsMessage)==0)
+ {
+ if (Options & opAlwaysBkgd)
+ {
+ PidChild=-1;
+ ErrorFile=newStr(err);
+ }
+ else
+ {
+ int goBack=0;
+ uint32 scrlOps=Options & edsmScrollMask;
+ TProgram::deskTop->lock();
+ IndexCLE=CLEGetIndexOfLoad(compiler);
+ goBack=DumpFileToMessage(err,FromPrg,scrlOps | ((OpsScrHz & opshEachMessage) ? 0 : edsmNoHzReset),
+ IndexCLE<0 ? ParseFun : ParseFunCLE);
+ SpLinesUpdate();
+ ErrorFile=0;
+ MakeBeep();
+ EdShowMessageI(BackEd,scrlOps | ((OpsScrHz & opshEnd) ? 0 : edsmNoHzReset));
+ if (!(Options & opNoBkpMove))
+ TSetEditorApp::DebugMoveBreakPts();
+ if (goBack)
+ {
+ if (Options & opJumpFirstError)
+ EdJumpToFirstError();
+ else
+ if (scrlOps==edsmEverScroll)
+ EdJumpToMessage(0);
+ }
+ TProgram::deskTop->unlock();
+ }
+ }
+ else
+ ErrorFile=newStr(err);
+
+ if (PidChild)
+ {
+ incCompiler=newStr(compiler);
+ TView::enableCommand(cmeStopChild);
+ dbprintf("runprog: pid child: %d\n",PidChild);
+ }
+ else
+ {
+ delete StackPath;
+ StackPath=0;
+ ReLoadModifEditors();
+ }
+}
+
+void SaveRunCommand(fpstream &s)
+{
+ if (Command[0])
+ {
+ s << (char)5;
+ s.writeString(Command);
+ s << Options << (uchar)OpsScrHz << incLines;
+ s.writeString(CurrentParser);
+ return;
+ }
+ s << (char)0;
+}
+
+void LoadRunCommand(fpstream &s)
+{
+ char version;
+
+ s >> version;
+ if (version)
+ {
+ s.readString(Command,maxCommand);
+ if (version>=2)
+ s >> Options;
+ if (version>=5)
+ {
+ uchar aux;
+ s >> aux;
+ OpsScrHz=aux;
+ }
+ if (version>=4)
+ s >> incLines;
+ if (version>=3)
+ {
+ delete[] CurrentParser;
+ CurrentParser=s.readString();
+ }
+ }
+ if (!CurrentParser)
+ CurrentParser=newStr("GNU");
+}
+
+void RunExternalProgramFreeMemory()
+{
+ if (CurrentParser)
+ delete[] CurrentParser;
+}
diff --git a/setedit/setedit/scresave.cc b/setedit/setedit/scresave.cc
new file mode 100644
index 0000000..1b102b4
--- /dev/null
+++ b/setedit/setedit/scresave.cc
@@ -0,0 +1,1156 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+#define Uses_unistd
+#define Uses_string
+#define Uses_stdlib
+#define Uses_ctype
+#define Uses_fcntl
+#define Uses_sys_stat
+
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TEvent
+#define Uses_TEventQueue
+#define Uses_TCEditWindow
+#define Uses_TScreen
+#define Uses_TStringCollection
+#define Uses_TVCodePage
+
+#define Uses_TGKey
+#include <ceditor.h>
+#define Uses_TSetEditorApp
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <intermp3.h>
+#include <runprog.h>
+#include <pathtool.h>
+#include <dyncat.h>
+#include <rhutils.h>
+
+#define InlineAsm __asm__ __volatile__
+
+const unsigned scrsvNeedsResetVideoMode=1;
+
+typedef struct
+{
+ char Name[24];
+ void (*update)();
+ void (*start)();
+ void (*shutDown)();
+ unsigned flags;
+} ScrSaver;
+
+static TStringCollection *ScrSavers=0;
+
+static void CreateScrSaversList(void);
+static void KillAllocatedMemory(void);
+static const char *ExternalScrSavListFile="extrscsv.txt";
+
+#define MaxRow() TDisplay::getRows()
+#define MaxCol() TDisplay::getCols()
+
+class TAllScreen : public TView
+{
+public:
+ TAllScreen();
+ virtual void draw();
+ void printAt(int x, int y, const char *s);
+ void printAt(int x, int y, const char *s, char color);
+ void scrollUp(void);
+ char *buffer;
+ static uchar curColor;
+ int numRows,numCols;
+};
+
+uchar TAllScreen::curColor=7;
+
+void TAllScreen::draw()
+{
+ writeBuf(0,0,numCols,numRows,buffer);
+}
+
+TAllScreen::TAllScreen() : TView(TRect(0,0,TScreen::screenWidth,TScreen::screenHeight))
+{
+ numRows=TScreen::screenHeight;
+ numCols=TScreen::screenWidth;
+ buffer=new char[numRows*numCols*2];
+ memset(buffer,0,numRows*numCols*2);
+}
+
+void TAllScreen::printAt(int x, int y, const char *s)
+{
+ if (y>numRows-1)
+ return;
+ int off=(x+y*numCols)*2;
+ while (*s && x<numCols)
+ {
+ buffer[off]=*s;
+ buffer[off+1]=curColor;
+ off+=2;
+ s++;
+ x++;
+ }
+}
+
+void TAllScreen::printAt(int x, int y, const char *s, char color)
+{
+ char aux=curColor;
+ curColor=color;
+ printAt(x,y,s);
+ curColor=aux;
+}
+
+
+void TAllScreen::scrollUp(void)
+{
+ memcpy(buffer,buffer+numCols*2,numCols*(numRows-1)*2);
+ memset(buffer+numCols*(numRows-1)*2,0,numCols*2);
+}
+
+TAllScreen *scrn;
+
+//#define HIDE_MOUSE
+#ifdef TVCompf_djgpp
+extern int emulate_mouse;
+#define EmulateMouse(a) emulate_mouse=a
+#else
+#define EmulateMouse(a)
+#endif
+
+void TSetEditorApp::screenSaver()
+{
+ TEvent event;
+
+ if (!MaxRow() || !MaxCol())
+ return;
+
+ int type;
+ void *scrSav=WichSaverIs(WhichScrSaver,type);
+ if (!scrSav)
+ return;
+
+ if (type==scsvInternal)
+ {
+ ScrSaver *ss=(ScrSaver *)scrSav;
+ scrn=new TAllScreen();
+ int scrMode=TScreen::screenMode;
+
+ TProgram::deskTop->setState(sfVisible,False);
+ #ifndef HIDE_MOUSE
+ // I can't hide the mouse I don't know why so I preffer to disable it
+ TMouse::suspend();
+ #endif
+
+ ss->start();
+
+ #ifdef HIDE_MOUSE
+ TMouse::hide();
+ EmulateMouse(1);
+ TMouse::hide();
+ #endif
+ insert(scrn);
+ MP3Buffered;
+ ProcessMP3Idle;
+ do
+ {
+ ss->update();
+ #ifdef HIDE_MOUSE
+ TMouse::hide();
+ #endif
+ ProcessMP3Idle;
+ CLY_YieldProcessor(-1);
+ clearEvent(event);
+ event.getKeyEvent();
+ #ifdef HIDE_MOUSE
+ if (!(event.what & evKeyDown))
+ event.getMouseEvent();
+ #endif
+ }
+ while ((event.what & (evKeyDown | evMouseDown))==0);
+ #ifdef HIDE_MOUSE
+ TMouse::show();
+ EmulateMouse(0);
+ TMouse::show();
+ #endif
+ ss->shutDown();
+
+ remove(scrn);
+ CLY_destroy(scrn);
+ ProcessMP3Idle;
+ MP3UnBuffered;
+ if (ss->flags & scrsvNeedsResetVideoMode)
+ ResetVideoMode(scrMode);
+
+ #ifndef HIDE_MOUSE
+ TMouse::resume();
+ #endif
+ TProgram::deskTop->setState(sfVisible,True);
+ TProgram::resetIdleTime();
+
+ TProgram::deskTop->redraw();
+ TProgram::application->redraw();
+ }
+ else
+ {
+ // Create a file containing the screen contents
+ unsigned len=MaxRow()*MaxCol()*2;
+ char *buf;
+ buf=new char[len<80 ? 80 : len];
+
+ TScreen::getCharacters(0,(ushort *)buf,len/2);
+ char *name=unique_name("sc");
+ int h=open(name,O_RDWR | O_CREAT | O_TRUNC | O_BINARY,0);
+ if (h>=0)
+ {
+ ::write(h,buf,len);
+ #ifdef TVOS_UNIX
+ // In UNIX we can delete the file so nobody will know about it.
+ unlink(name);
+ #endif
+ }
+
+ // Create the command line
+ sprintf(buf," 0x%04X 0x%04X 0x%08X %d ",TScreen::screenWidth,TScreen::screenHeight,1,h);
+ DynStrCatStruct st;
+ DynStrCatInit(&st,ExpandHome((char *)scrSav));
+ DynStrCat(&st,buf);
+ DynStrCat(&st,ExtScrSaverOpts);
+ RunExternalProgram(st.str,repDontShowDialog | repDontShowAsMessage |
+ repRestoreScreen);
+ free(st.str);
+ if (h>=0)
+ {
+ close(h);
+ unlink(name);
+ }
+ delete[] buf;
+ string_free(name);
+ RunExternalProgramKillFile();
+ }
+}
+
+static
+void Dummy(void) {}
+
+static
+void UpdateSilly(void)
+{
+ static int i=0;
+ int k;
+
+ if (!(i%6))
+ {
+ k=i%60;
+ char *s=TVIntl::getTextNew(__("Screen saver. Press a key"));
+ scrn->printAt(k,scrn->numRows-1,s);
+ DeleteArray(s);
+ }
+ scrn->scrollUp();
+ scrn->draw();
+ i++;
+ CLY_YieldProcessor(55000);
+ CLY_YieldProcessor(55000);
+}
+
+ScrSaver Silly=
+{
+ "A very silly one",
+ UpdateSilly,Dummy,Dummy,
+ 0
+};
+
+ScrSaver Blanker=
+{
+ "Blanker",
+ Dummy,Dummy,Dummy,
+ 0
+};
+
+
+#if defined(TVCompf_djgpp) || defined(HAVE_AA)
+
+/***************************** Common plasma code ***********************************/
+// 0.5 degrees of resolution, 256==360 is faster but the resolution is too bad :-(
+#define TrigTableSize (360*2)
+#define TamReal (TrigTableSize*2+TrigTableSize/4) // 2*360+90 degrees
+#define cos_table (sin_table+TrigTableSize/4)
+static int *sin_table;
+//static uchar *screen_buffer; to the stack
+#define IncWithWrap(a) if (++a==TrigTableSize) a=0
+
+static int dsI7=0,dsX7=0,dsY7=0,direction7=1;
+
+typedef unsigned char RawPal[768];
+
+static
+void RPF_MakeBlueGreen_RedBars(unsigned char *Pal)
+{
+ int i, k;
+
+ for (i=0, k=0; i<64; i++)
+ {
+ Pal[k++] = 63-i;
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = i;
+ Pal[k++] = 63;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ Pal[k++] = 63;
+ }
+ for (i=0; i<64; i++)
+ {
+ Pal[k++] = i;
+ Pal[k++] = 0;
+ Pal[k++] = 63-i;
+ }
+}
+
+#endif // defined(TVCompf_djgpp) || defined(HAVE_AA)
+
+
+
+#ifdef TVCompf_djgpp
+
+/***************************** Red and Blue plasma ***********************************/
+// This code is relative compact under DOS
+#include <dpmi.h>
+#include <sys/movedata.h>
+#include <sys/segments.h>
+#include <math.h>
+#include <pc.h>
+#include <go32.h>
+
+extern __inline__ void RPF_SetAllPal(unsigned char *_pal_ptr)
+{//Sets all 768 6bit color component entries on the VGA.
+ int dummy;
+ InlineAsm (
+" movl $0x3c8, %%edx \n"
+" xorl %%eax, %%eax \n"
+" outb %%al, %%dx \n"
+" incl %%edx \n"
+" movl $768, %%ecx \n"
+" cli \n"
+" rep \n"
+" outsb \n"
+" sti \n"
+ : "=S" (dummy) : "S" (_pal_ptr) : "%eax", "%ecx", "%edx");
+}
+
+static
+void StartPlasmaRB1(void)
+{
+ __dpmi_regs r;
+ r.x.ax=0x13;
+ __dpmi_int(0x10,&r);
+ dsI7=0;
+ dsX7=0;
+ dsY7=0;
+ direction7=1;
+ sin_table=new int[TamReal];
+ //screen_buffer=new uchar[64000];
+
+ unsigned int i;
+ double temp;
+
+ for (i=0; i<TamReal; i++)
+ {
+ temp = sin((double)(i*PI/(180*(TrigTableSize/360)) ));
+ temp *= 255;
+ sin_table[i] = (int)temp;
+ }
+
+ RawPal BlueP1;
+ RPF_MakeBlueGreen_RedBars(BlueP1);
+ RPF_SetAllPal(BlueP1);
+}
+
+static
+void ShutDownPlasmaRB1(void)
+{
+ __dpmi_regs r;
+ r.x.ax=0x3;
+ __dpmi_int(0x10,&r);
+ delete sin_table;
+// delete screen_buffer;
+}
+
+
+static
+void owr_vsync()
+{
+ while (inportb(0x3DA) & 1);
+ while (!(inportb(0x3DA) & 8));
+}
+
+static
+void PLA1_Step320x200_7(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=sin_table[dsI7]+256;
+
+ for (Y=200; Y; Y--)
+ {
+ int temp=dsIl;
+ for (X=320; X; s++,X--)
+ {
+ IncWithWrap(temp);
+ *s=cos_table[X+dsX7]+sin_table[Y+dsY7]+sin_table[temp];
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI7);
+ if (dsY7==(TrigTableSize-200))
+ direction7=-1;
+ else
+ if (dsY7==0 && direction7==-1)
+ direction7=1;
+ dsY7+=direction7;
+ dsX7=(cos_table[dsI7]+256)>>1;
+}
+
+static
+void UpdatePlasmaRB1(void)
+{
+ uchar screen_buffer[64000]; // I think isn't so dangerous here
+ PLA1_Step320x200_7(screen_buffer);
+ owr_vsync();
+ _movedatal(_my_ds(),(unsigned)screen_buffer,_dos_ds,0xA0000,16000);
+}
+
+
+ScrSaver PlasmaRB1=
+{
+ "Plasma (Red/Blue)",
+ UpdatePlasmaRB1,StartPlasmaRB1,ShutDownPlasmaRB1,
+ scrsvNeedsResetVideoMode
+};
+
+
+/****************************** Inferno 1 **************************************/
+/***************************************************************************
+
+ Description:
+ I got it from the djgpp list posted by Rylan. Then I modified the code to
+really work and added some special touchs to make it really cool.
+
+***************************************************************************/
+
+/* 4 more because the bottom lines are too noisy */
+#define SIZE_INFERNO (320*104)
+
+static uchar *Inferno1VScreen;
+
+static
+void RPF_MakeRedPalette(unsigned char *Pal)
+{
+ int i,j;
+ uchar *s=Pal;
+
+ for (i=0; i<255; i++)
+ {
+ if (i<64)
+ j=0;
+ else
+ if (i<128)
+ j=i-64;
+ else
+ if (i<192)
+ j=191-i;
+ else
+ j=0;
+ *s=j;
+ *(s+1)=*(s+2)=0;
+ s+=3;
+ }
+}
+
+static
+void RPF_MakeGrayPalette(unsigned char *Pal)
+{
+ int i,j;
+ uchar *s=Pal;
+
+ for (i=0; i<255; i++)
+ {
+ if (i<64)
+ j=0;
+ else
+ if (i<128)
+ j=i-64;
+ else
+ if (i<192)
+ j=191-i;
+ else
+ j=0;
+ *s=*(s+1)=*(s+2)=j;
+ s+=3;
+ }
+}
+
+static
+void StartInferno1(void)
+{
+ __dpmi_regs r;
+ r.x.ax=0x13;
+ __dpmi_int(0x10,&r);
+
+ RawPal Red;
+ RPF_MakeRedPalette(Red);
+ RPF_SetAllPal(Red);
+
+ Inferno1VScreen=(uchar *)calloc(1,SIZE_INFERNO+2*320);
+}
+
+static
+void StartSmoker1(void)
+{
+ __dpmi_regs r;
+ r.x.ax=0x13;
+ __dpmi_int(0x10,&r);
+
+ RawPal Gray;
+ RPF_MakeGrayPalette(Gray);
+ RPF_SetAllPal(Gray);
+
+ Inferno1VScreen=(uchar *)calloc(1,SIZE_INFERNO+2*320);
+}
+
+static
+void ShutDownInferno1(void)
+{
+ __dpmi_regs r;
+ r.x.ax=0x3;
+ __dpmi_int(0x10,&r);
+ delete Inferno1VScreen;
+}
+
+
+void DibujarInferno1(uchar *screen)
+{
+ InlineAsm
+ (
+" movl $320,%%esi \n"
+" addl %0,%%esi \n"
+" movl %1,%%ecx \n"
+
+" movl $0,%%ebx \n"
+
+// Smooth
+"0: \n"
+" movl $0,%%eax \n"
+ // Current byte and increment
+" lodsb \n"
+ // Next
+" movb (%%esi),%%bl \n"
+" addl %%ebx,%%eax \n"
+ // Y+1
+" movb 319(%%esi),%%bl \n"
+" addl %%ebx,%%eax \n"
+ // Previous
+" movb -2(%%esi),%%bl \n"
+" addl %%ebx,%%eax \n"
+ // Average
+" shrl $2,%%eax \n"
+ // Put it in Y-1
+" movb %%al,-321(%%esi) \n"
+" loop 0b \n"
+
+" movl %1,%%edi \n"
+" addl %0,%%edi \n"
+" movl $320,%%ecx \n"
+
+// Randline
+"1: \n"
+" mull (%%edi) \n"
+" incl %%eax \n"
+" stosw \n"
+" decl %%edi \n"
+" loop 1b \n"
+ :
+ : "qm" (screen), "i" (SIZE_INFERNO)
+ : "edi","esi","eax","ebx","ecx","edx","memory"
+ );
+}
+
+static
+void UpdateInferno1(void)
+{
+ int d1,d2,d3;
+ DibujarInferno1(Inferno1VScreen);
+ owr_vsync();
+ InlineAsm(
+" pushl %%es \n"
+
+" movw %%ax,%%es \n"
+" movl $100,%%edx \n"
+"0: \n"
+" movl $80,%%ecx \n"
+"1: \n"
+" movl (%%esi),%%eax \n"
+" movl %%eax,%%es:(%%edi) \n"
+" movl %%eax,%%es:320(%%edi) \n"
+" addl $4,%%esi \n"
+" addl $4,%%edi \n"
+" loop 1b \n"
+" addl $320,%%edi \n"
+" decl %%edx \n"
+" jnz 0b \n"
+
+" popl %%es \n"
+ : "=S" (d1), "=D" (d2), "=a" (d3)
+ : "a" (_dos_ds), "S" (Inferno1VScreen), "D" (0xA0000)
+ : "ecx", "edx" );
+}
+
+ScrSaver Inferno1=
+{
+ "Inferno 1",
+ UpdateInferno1,StartInferno1,ShutDownInferno1,
+ scrsvNeedsResetVideoMode
+};
+
+ScrSaver Smoker1=
+{
+ "Smoker 1",
+ UpdateInferno1,StartSmoker1,ShutDownInferno1,
+ scrsvNeedsResetVideoMode
+};
+#endif // TVCompf_djgpp
+
+
+#ifdef HAVE_AA
+
+/************************ Red and Blue plasma adapted for AA-lib **************************/
+#include <aalib.h>
+#include <math.h>
+
+static aa_context *context=NULL;
+static unsigned aaW,aaH;
+static aa_palette pal;
+
+static
+void RPF_SetAllPalAA(unsigned char *pal_ptr)
+{
+ int i,j;
+ for (i=0,j=0; i<256; i++,j+=3)
+ aa_setpalette(pal,i,pal_ptr[j]*4,pal_ptr[j+1]*4,pal_ptr[j+2]*4);
+}
+
+static
+void StartPlasmaRB1AA(void)
+{
+ aa_defparams.supported|=AA_EXTENDED;
+ context=aa_autoinit(&aa_defparams);
+ if (!context)
+ return;
+ aaW=aa_imgwidth(context);
+ aaH=aa_imgheight(context);
+
+ dsI7=0;
+ dsX7=0;
+ dsY7=0;
+ direction7=1;
+ sin_table=new int[TamReal];
+ //screen_buffer=new uchar[64000];
+
+ unsigned int i;
+ double temp;
+
+ for (i=0; i<TamReal; i++)
+ {
+ temp = sin((double)(i*M_PI/(180*(TrigTableSize/360)) ));
+ temp *= 255;
+ sin_table[i] = (int)temp;
+ }
+
+ RawPal BlueP1;
+ RPF_MakeBlueGreen_RedBars(BlueP1);
+ RPF_SetAllPalAA(BlueP1);
+}
+
+static
+void ShutDownPlasmaRB1AA(void)
+{
+ delete sin_table;
+ if (context)
+ aa_close(context);
+ TScreen::setCursorType(TScreen::cursorLines);
+}
+
+
+static
+void PLA1_Step_7(unsigned char *screen_buffer)
+{
+ int X,Y;
+ unsigned char *s=screen_buffer;
+ int dsIl=sin_table[dsI7]+256;
+
+ for (Y=aaH; Y; Y--)
+ {
+ int temp=dsIl;
+ for (X=aaW; X; s++,X--)
+ {
+ IncWithWrap(temp);
+ *s=cos_table[X+dsX7]+sin_table[Y+dsY7]+sin_table[temp];
+ }
+ IncWithWrap(dsIl);
+ }
+ IncWithWrap(dsI7);
+ if (dsY7==(TrigTableSize-200))
+ direction7=-1;
+ else
+ if (dsY7==0 && direction7==-1)
+ direction7=1;
+ dsY7+=direction7;
+ dsX7=(cos_table[dsI7]+256)>>1;
+}
+
+static
+void UpdatePlasmaRB1AA()
+{
+ if (!context) return;
+ PLA1_Step_7(aa_image(context));
+ //aa_fastrender(context,0,0,aa_scrwidth(context),aa_scrheight(context));
+ aa_renderpalette(context,pal,&aa_defrenderparams,0,0,aa_scrwidth(context),aa_scrheight(context));
+ aa_flush(context);
+}
+
+
+ScrSaver PlasmaRB1AA=
+{
+ "AA-Plasma (Red/Blue)",
+ UpdatePlasmaRB1AA,StartPlasmaRB1AA,ShutDownPlasmaRB1AA,
+ scrsvNeedsResetVideoMode
+};
+#endif // HAVE_AA
+
+
+/************************** Text Stars saver *****************************/
+static char *cCartel1=__("Press a key to continue");
+
+static char s1[2]="";
+static char s2[2]="";
+static char s3[2]="";
+static char s4[2]="\xF";
+static char p1[2]="";
+static char p2[2]="";
+static char p3[2]="";
+static char p4[2]="\xF";
+char *cFormaScreenSaverStars[]={s1,s2,s3,s4};
+char *coFormaScreenSaverStars[]={p1,p2,p3,p4};
+static char cColor[]={0xB,0xB,0x7,0xF};
+static char anX[16],anY[16],anGrado[16];
+static char *cBorra;
+static int nFilRel,nColRel,nStepX,nRow;
+static const char *cCartel;
+
+static
+void InitTextStars(void)
+{
+ int nI,nJ;
+ cCartel=TVIntl::getTextNew(cCartel1);
+
+ nFilRel=MaxRow()/2;
+ nColRel=MaxCol()/2;
+
+ for (nI=0; nI<4; nI++)
+ for (nJ=0; nJ<4; nJ++)
+ anGrado[nJ*4+nI]=-nI;
+ for (nI=0; nI<16; nI++)
+ anX[nI]=anY[nI]=0;
+
+ int nLen=strlen(cCartel);
+ cBorra=new char[nLen+1];
+ memset(cBorra,' ',nLen);
+ cBorra[nLen]=0;
+ nStepX=0;
+ nRow=MaxRow()/2;
+ srand(0);
+}
+
+static
+void DeInitTextStars(void)
+{
+ DeleteArray(cBorra);
+ DeleteArray(cCartel);
+}
+
+static
+void UpdateTextStars(void)
+{
+ int nTot;
+ signed char nGrado,nJ;
+
+ int nLen=strlen(cCartel);
+ nTot=MaxCol()+nLen;
+
+ if (nStepX<nLen)
+ scrn->printAt(0,nRow,&cCartel[nLen-nStepX]);
+ else
+ scrn->printAt(nStepX-nLen,nRow,cCartel);
+ for (nJ=0; nJ<16; nJ++)
+ {
+ nGrado=anGrado[nJ];
+ if (nGrado==0)
+ {
+ scrn->printAt(anX[nJ],anY[nJ]," ");
+ anX[nJ]=rand()%MaxCol();
+ anY[nJ]=rand()%MaxRow();
+ }
+ if (nGrado>-1)
+ scrn->printAt(anX[nJ],anY[nJ],cFormaScreenSaverStars[nGrado],cColor[nGrado]);
+ if (nGrado==3)
+ anGrado[nJ]=0;
+ else
+ anGrado[nJ]=nGrado+1;
+ }
+ scrn->draw();
+ CLY_YieldProcessor(55000);
+ CLY_YieldProcessor(55000);
+ if (nStepX<nLen)
+ scrn->printAt(0,nRow,cBorra);
+ else
+ scrn->printAt(nStepX-nLen,nRow,cBorra);
+ nStepX++;
+ if (nStepX==nTot)
+ {
+ nStepX=0;
+ nRow=rand()%MaxRow();
+ }
+}
+
+ScrSaver TextStars=
+{
+ "Text Stars",
+ UpdateTextStars,InitTextStars,DeInitTextStars,
+ 0
+};
+/************************** End Text Stars saver *****************************/
+
+#ifdef TVCompf_djgpp
+/************************** Safe saver *****************************/
+static char *cCartel2=__("That's a 'safe' screen saver. The editor has a beautiful "
+ "plasma screen saver but currently it isn't the default "
+ "because some (really buggy) Winshit 9x video drivers "
+ "do strange things when a windowed DOS program switches "
+ "to video mode. I hate it ....");
+
+// Shared with Text Stars
+//#define MaxRow() TDisplay::getRows()
+//#define MaxCol() TDisplay::getCols()
+//static char *cCartel;
+
+static
+void InitSafeSaver(void)
+{
+ cCartel=TVIntl::getTextNew(cCartel2);
+
+ int nLen=strlen(cCartel);
+ cBorra=new char[nLen+1];
+ memset(cBorra,' ',nLen);
+ cBorra[nLen]=0;
+ nStepX=0;
+ nRow=MaxRow()/2;
+}
+
+static
+void DeInitSafeSaver(void)
+{
+ DeleteArray(cBorra);
+ DeleteArray(cCartel);
+}
+
+static
+void UpdateSafeSaver(void)
+{
+ int nTot,nW;
+ int nLen=strlen(cCartel);
+ nTot=MaxCol()+nLen;
+ nW=MaxCol()-1;
+
+ if (nStepX>nW)
+ scrn->printAt(0,nRow,cCartel+nStepX-nW);
+ else
+ scrn->printAt(nW-nStepX,nRow,cCartel);
+ scrn->draw();
+
+ CLY_YieldProcessor(55000);
+ CLY_YieldProcessor(55000);
+ CLY_YieldProcessor(55000);
+
+ scrn->printAt(0,nRow,cBorra);
+ nStepX++;
+ if (nStepX==nTot)
+ {
+ nStepX=0;
+ nRow=rand()%MaxRow();
+ }
+}
+
+ScrSaver SafeSaver=
+{
+ "'Safe' saver",
+ UpdateSafeSaver,InitSafeSaver,DeInitSafeSaver,
+ 0
+};
+/************************** End of Safe saver *****************************/
+#endif
+
+
+#ifdef TVCompf_djgpp
+#include <dos.h> // get_dos_version
+static
+void CreateScrSaversList(void)
+{
+ ScrSavers=new TStringCollection(3,1);
+ ScrSavers->insert(&PlasmaRB1);
+ ScrSavers->insert(&Silly);
+ ScrSavers->insert(&TextStars);
+ ScrSavers->insert(&SafeSaver);
+ ScrSavers->insert(&Inferno1);
+ ScrSavers->insert(&Smoker1);
+ ScrSavers->insert(&Blanker);
+ ScrSavers->setOwnerShip(False);
+ atexit(KillAllocatedMemory);
+}
+
+char *GetDefaultScreenSaver(void)
+{
+ // Use the 'safe' saver for crap 9x
+ unsigned short true_dos_version=_get_dos_version(1);
+ if (true_dos_version>=0x700)
+ return newStr(SafeSaver.Name);
+ // Fuck you Bill
+ return newStr(PlasmaRB1.Name);
+}
+#else
+static
+void CreateScrSaversList(void)
+{
+ ScrSavers=new TStringCollection(3,1);
+ #ifdef HAVE_AA
+ ScrSavers->insert(&PlasmaRB1AA);
+ #endif
+ ScrSavers->insert(&Silly);
+ ScrSavers->insert(&TextStars);
+ ScrSavers->setOwnerShip(False);
+ atexit(KillAllocatedMemory);
+}
+
+char *GetDefaultScreenSaver(void)
+{
+ #ifdef HAVE_AA
+ return newStr(PlasmaRB1AA.Name);
+ #else
+ return newStr(Silly.Name);
+ #endif
+}
+#endif
+
+static
+TStringCollection *GetScreenSaverListInt(void)
+{
+ if (!ScrSavers)
+ CreateScrSaversList();
+ return ScrSavers;
+}
+
+/************************ External Screen Savers ***************************/
+
+typedef struct
+{
+ char *name;
+ char *program;
+} ExtrScrSav;
+
+class TExtrScrSavList : public TStringCollection
+{
+public:
+ TExtrScrSavList();
+ virtual void freeItem(void *item);
+ virtual void *keyOf(void *item);
+ void insert(char *name, char *program);
+ char *atProgram(ccIndex pos);
+ CLY_DummyTStreamRW(TStringCollection)
+};
+
+TExtrScrSavList::TExtrScrSavList() :
+ TStringCollection(4,4)
+{
+}
+
+void TExtrScrSavList::freeItem(void *item)
+{
+ ExtrScrSav *p=(ExtrScrSav *)item;
+ delete[] p->name;
+ delete[] p->program;
+ delete p;
+}
+
+void *TExtrScrSavList::keyOf(void *item)
+{
+ return ((ExtrScrSav *)item)->name;
+}
+
+void TExtrScrSavList::insert(char *name, char *program)
+{
+ ExtrScrSav *p=new ExtrScrSav;
+ p->name=name;
+ p->program=program;
+ TStringCollection::insert(p);
+}
+
+char *TExtrScrSavList::atProgram(ccIndex pos)
+{
+ ExtrScrSav *p=(ExtrScrSav *)at(pos);
+ return p->program;
+}
+
+static void ReplaceCRby0(char *s)
+{
+ for (; *s && *s!='\n' && *s!='\r'; s++);
+ *s=0;
+}
+
+static TExtrScrSavList *ExtrScrSavList=0;
+
+static
+void CreateExtrScrSavList(int forceReRead)
+{
+ if (ExtrScrSavList)
+ {
+ if (forceReRead)
+ CLY_destroy(ExtrScrSavList);
+ else
+ return;
+ }
+ char *fileName=ExpandHome(ExternalScrSavListFile);
+ FILE *f=fopen(fileName,"rt");
+ if (!f)
+ return;
+ ExtrScrSavList=new TExtrScrSavList();
+ char buffer[PATH_MAX],*name;
+ while (fgets(buffer,PATH_MAX,f))
+ {// Skip blank or commented lines
+ if (*buffer=='#' || ucisspace(*buffer)) continue;
+ ReplaceCRby0(buffer);
+ name=newStr(buffer);
+ if (!fgets(buffer,PATH_MAX,f))
+ {
+ delete[] name;
+ break;
+ }
+ ReplaceCRby0(buffer);
+ ExtrScrSavList->insert(name,newStr(buffer));
+ }
+ fclose(f);
+}
+
+static
+TExtrScrSavList *GetScreenSaverListExt(int forceReRead)
+{
+ CreateExtrScrSavList(forceReRead);
+ return ExtrScrSavList;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ That's what the outside world sees.
+
+ Return:
+ A string collection with the list of all available screen saver. It must
+be destroyed by the caller.
+
+***************************************************************************/
+
+TStringCollection *GetScreenSaverList(int forceReRead)
+{
+ int cInt=0,cExt=0,i;
+ TStringCollection *internal=GetScreenSaverListInt();
+ TStringCollection *external=GetScreenSaverListExt(forceReRead);
+ if (internal)
+ cInt=internal->getCount();
+ if (external)
+ cExt=external->getCount();
+ TStringCollection *ret=new TStringCollection(cInt+cExt,4);
+
+ for (i=0; i<cInt; i++)
+ ret->insert(newStr((char *)internal->keyOf(internal->at(i))));
+ for (i=0; i<cExt; i++)
+ ret->insert(newStr((char *)external->keyOf(external->at(i))));
+
+ return ret;
+}
+
+void *WichSaverIs(char *name, int &type)
+{
+ TStringCollection *c=GetScreenSaverListInt();
+ if (name)
+ {
+ // Check if that's an internal
+ ccIndex pos;
+ if (c && c->search(name,pos))
+ {
+ type=scsvInternal;
+ return c->at(pos);
+ }
+ // Check if that's an external
+ TExtrScrSavList *ex=GetScreenSaverListExt(0);
+ if (ex && ex->search(name,pos))
+ {
+ type=scsvExternal;
+ return ex->atProgram(pos);
+ }
+ }
+
+ return c ? c->at(0) : 0;
+}
+
+static
+char *GetScrSaverOut(char *name, char *option)
+{
+ int type;
+ char *namePrg=(char *)WichSaverIs(name,type);
+ if (type!=scsvExternal)
+ return 0;
+ char *fullName=ExpandHome(namePrg);
+ if (!edTestForFile(fullName))
+ return 0;
+ strcat(fullName,option);
+ RunExternalProgram(fullName,repDontShowAsMessage);
+ type=2048;
+ return RunExternalProgramGetFile(type);
+}
+
+char *GetScrSaverInfo(char *name)
+{
+ return GetScrSaverOut(name," -i");
+}
+
+char *GetScrSaverHelp(char *name)
+{
+ return GetScrSaverOut(name," -h");
+}
+
+static
+void KillAllocatedMemory(void)
+{
+ destroy0(ScrSavers);
+ destroy0(ExtrScrSavList);
+}
+
+
+
+
diff --git a/setedit/setedit/streams/sdskasci.cc b/setedit/setedit/streams/sdskasci.cc
new file mode 100644
index 0000000..3a61ca1
--- /dev/null
+++ b/setedit/setedit/streams/sdskasci.cc
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <tv.h>
+#include <dskwin.h>
+#include <dskascii.h>
+
+TStreamableClass RDskWinASCII( TDskWinASCII::name,
+ TDskWinASCII::build,
+ __DELTA(TDskWinASCII)
+ );
+
diff --git a/setedit/setedit/streams/sdskcale.cc b/setedit/setedit/streams/sdskcale.cc
new file mode 100644
index 0000000..c01dd8a
--- /dev/null
+++ b/setedit/setedit/streams/sdskcale.cc
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <tv.h>
+#include <dskwin.h>
+#include <dskcalen.h>
+
+TStreamableClass RDskWinCalendar( TDskWinCalendar::name,
+ TDskWinCalendar::build,
+ __DELTA(TDskWinCalendar)
+ );
+
diff --git a/setedit/setedit/streams/sdskclip.cc b/setedit/setedit/streams/sdskclip.cc
new file mode 100644
index 0000000..3e732fd
--- /dev/null
+++ b/setedit/setedit/streams/sdskclip.cc
@@ -0,0 +1,16 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCEditWindow
+#define Uses_TWindow
+
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskclip.h>
+
+TStreamableClass RDskWinClipboard( TDskWinClipboard::name,
+ TDskWinClipboard::build,
+ __DELTA(TDskWinClipboard)
+ );
+
diff --git a/setedit/setedit/streams/sdskclos.cc b/setedit/setedit/streams/sdskclos.cc
new file mode 100644
index 0000000..b3434e9
--- /dev/null
+++ b/setedit/setedit/streams/sdskclos.cc
@@ -0,0 +1,17 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCEditWindow
+#define Uses_TWindow
+
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_string
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskclose.h>
+
+TStreamableClass RDskWinClosed( TDskWinClosed::name,
+ TDskWinClosed::build,
+ __DELTA(TDskWinClosed)
+ );
+
diff --git a/setedit/setedit/streams/sdskedit.cc b/setedit/setedit/streams/sdskedit.cc
new file mode 100644
index 0000000..eb2169a
--- /dev/null
+++ b/setedit/setedit/streams/sdskedit.cc
@@ -0,0 +1,16 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCEditWindow
+#define Uses_TWindow
+
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskedito.h>
+
+TStreamableClass RDskWinEditor( TDskWinEditor::name,
+ TDskWinEditor::build,
+ __DELTA(TDskWinEditor)
+ );
+
diff --git a/setedit/setedit/streams/sdskhelp.cc b/setedit/setedit/streams/sdskhelp.cc
new file mode 100644
index 0000000..2b6c06b
--- /dev/null
+++ b/setedit/setedit/streams/sdskhelp.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCEditWindow
+#define Uses_TWindow
+
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#define Uses_string
+// InfView requests
+#include <infr.h>
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskhelp.h>
+
+TStreamableClass RDskWinHelp( TDskWinHelp::name,
+ TDskWinHelp::build,
+ __DELTA(TDskWinHelp)
+ );
diff --git a/setedit/setedit/streams/sdskman.cc b/setedit/setedit/streams/sdskman.cc
new file mode 100644
index 0000000..b84b046
--- /dev/null
+++ b/setedit/setedit/streams/sdskman.cc
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <tv.h>
+#include <dskwin.h>
+#include <dskman.h>
+
+TStreamableClass RDskWinMan( TDskWinMan::name,
+ TDskWinMan::build,
+ __DELTA(TDskWinMan)
+ );
+
diff --git a/setedit/setedit/streams/sdskmess.cc b/setedit/setedit/streams/sdskmess.cc
new file mode 100644
index 0000000..d63ea67
--- /dev/null
+++ b/setedit/setedit/streams/sdskmess.cc
@@ -0,0 +1,15 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCEditWindow
+#define Uses_TWindow
+
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskmessa.h>
+
+TStreamableClass RDskWinPrj( TDskWinMessage::name,
+ TDskWinMessage::build,
+ __DELTA(TDskWinMessage)
+ );
diff --git a/setedit/setedit/streams/sdskmp3.cc b/setedit/setedit/streams/sdskmp3.cc
new file mode 100644
index 0000000..c4124cf
--- /dev/null
+++ b/setedit/setedit/streams/sdskmp3.cc
@@ -0,0 +1,13 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <tv.h>
+#include <dskwin.h>
+#include <dskmp3.h>
+
+TStreamableClass RDskWinMP3( TDskWinMP3::name,
+ TDskWinMP3::build,
+ __DELTA(TDskWinMP3)
+ );
+
diff --git a/setedit/setedit/streams/sdskprj.cc b/setedit/setedit/streams/sdskprj.cc
new file mode 100644
index 0000000..b6cfa84
--- /dev/null
+++ b/setedit/setedit/streams/sdskprj.cc
@@ -0,0 +1,15 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TCEditWindow
+#define Uses_TWindow
+
+#define Uses_TStreamableClass
+#define Uses_TStreamable
+#include <ceditor.h>
+#include <dskwin.h>
+#include <dskprj.h>
+
+TStreamableClass RDskWinMessage( TDskWinPrj::name,
+ TDskWinPrj::build,
+ __DELTA(TDskWinPrj)
+ );
diff --git a/setedit/setedit/streams/sedcolle.cc b/setedit/setedit/streams/sedcolle.cc
new file mode 100644
index 0000000..4ae7201
--- /dev/null
+++ b/setedit/setedit/streams/sedcolle.cc
@@ -0,0 +1,15 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TWindow
+#define Uses_TListBox
+#define Uses_TCEditWindow
+#include <ceditor.h>
+#include <dskwin.h>
+#include <edcollec.h>
+
+TStreamableClass REditorCollection( TEditorCollection::name,
+ TEditorCollection::build,
+ __DELTA(TEditorCollection)
+ );
+
diff --git a/setedit/setedit/tedcolle.cc b/setedit/setedit/tedcolle.cc
new file mode 100644
index 0000000..cc5b4dc
--- /dev/null
+++ b/setedit/setedit/tedcolle.cc
@@ -0,0 +1,956 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]**********************************************************************
+
+ Class: TEditorCollection
+ Comments:
+ This class is used to hold all the objects from @x{TDskWin (class)}. Is a
+collection specially adapted for this task.
+@p
+ The class support three different types of windows, they are: Editors,
+Closed and Non editors. For this reason the class keep track of the number
+of windows of each type in the members: Editors, Closed and nonEditors.
+The order in the list of classes is: Editors, Non editors and at the end
+Closed editors.
+
+**********/
+/**[txh]***
+
+ Class: TListEditors
+ Comments:
+ Is a derived class from TListBox used in the dialog of the list of windows.
+
+*****************************************************************************/
+
+#include <ceditint.h>
+#define Uses_string
+#define Uses_sys_stat
+#define Uses_alloca
+#define Uses_TCollection
+#define Uses_TListBox
+#define Uses_TStreamable
+#define Uses_TCEditWindow
+#define Uses_TWindow
+#define Uses_TApplication
+#define Uses_TDeskTop
+#define Uses_TScreen
+#define Uses_TSSortedListBox
+#define Uses_TCEditor_Commands
+#define Uses_TVCodePage
+#include <easydia1.h>
+#include <ceditor.h>
+#include <easydiag.h>
+
+#include <dskwin.h>
+#include <dskedito.h>
+#include <dskclose.h>
+#include <edcollec.h>
+#define Uses_TSetEditorApp
+#define Uses_SETAppVarious
+#include <setapp.h>
+#include <assert.h>
+#include <edspecs.h>
+
+// From edprj.cc
+void UpdateProjectResumeFor(char *fileName, TCEditWindow *p);
+// This class is quite particular. Only one object should exist at the same
+// time because it controls the desktop (which is only one). But isn't fully
+// static because it inherits from TCollection.
+// The only object that can exist is edHelper. During the read process the
+// class need this variable to be initialized.
+//extern TEditorCollection *edHelper; I moved it to SetEditorApp
+
+// Options for the sorting of closed files in removeEditor
+const char dscSort=0,dscNoSortPutLast=1,dscNoSortPutFirst=2;
+
+/**[txh]**********************************************************************
+
+ Include: edcollec.h
+ Module: Desktop Windows Helper
+ Description:
+ Just calls to the right getText of the @x{TEditorCollection (class)}.
+
+*****************************************************************************/
+
+void TListEditors::getText(char *dest, ccIndex item, short maxLen)
+{
+ TEditorCollection *lista=(TEditorCollection *)list();
+ lista->getText(dest,item,maxLen);
+}
+
+// It creates an EasyDiag version of TListEditors called TSListEditors
+ListBoxImplement(ListEditors);
+
+/**[txh]**********************************************************************
+
+ Description:
+ Initialize to zero the number of windows.
+
+*****************************************************************************/
+
+TEditorCollection::TEditorCollection(ccIndex aLimit, ccIndex aDelta)
+ : TCollection(aLimit,aDelta)
+{
+ Editors=Closed=nonEditors=0;
+ maxClosedToRemember=40;
+}
+
+const int edcVersion=2;
+
+/**[txh]**********************************************************************
+
+ Description:
+ Writes the collection to disk. It calls to the writeItem member of
+each object. See: @x{::writeItem}. The object with CanBeSaved in 0
+aren't saved and are discounted from the number of nonEditors.
+
+*****************************************************************************/
+
+void TEditorCollection::write( opstream& os )
+{
+ ccIndex idx,cant;
+ int nonEd=nonEditors;
+
+ unsigned dstOps=GetDSTOptions();
+ // Look if the user wants to remove those
+ int removeEditors=(dstOps & dstEdMask)==dstEdNever;
+ int removeOthers =(dstOps & dstOwMask)==dstOwNever;
+ int removeClosed =(dstOps & dstCfMask)==dstCfNever;
+
+ // Discount the non save ones or we'll compute a wrong count when loading
+ for (idx=Editors,cant=Editors+nonEditors; idx<cant; idx++)
+ if (!(((TDskWin *)items[idx])->CanBeSaved))
+ nonEd--;
+ os << -edcVersion << TScreen::screenWidth << TScreen::screenHeight;
+ os << (removeClosed ? 0 : Closed) // Remove these () and look how funny it gets
+ << (removeOthers ? 0 : nonEd)
+ << (removeEditors ? 0 : Editors)
+ << delta << maxClosedToRemember;
+ for (idx=0; idx<count; idx++)
+ {
+ TDskWin *p=(TDskWin *)items[idx];
+ if (!((p->type==dktEditor && removeEditors) ||
+ (p->type==dktClosed && removeClosed) ||
+ (p->type!=dktClosed && p->type!=dktEditor && removeOthers)))
+ writeItem(items[idx],os);
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Reads from disk a @x{TDskWin (class)}.
+
+*****************************************************************************/
+
+void *TEditorCollection::readItem( ipstream& is )
+{
+ TDskWin *p;
+ is >> p;
+ return p;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Saves to disk a @x{TDskWin (class)}.
+
+*****************************************************************************/
+
+void TEditorCollection::writeItem( void *p, opstream &os )
+{
+ if (((TDskWin *)p)->CanBeSaved)
+ os << (TDskWin *)p;
+}
+
+TStreamable *TEditorCollection::build()
+{
+ return new TEditorCollection( streamableInit );
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ It reads the whole collection from disk and inserts the windows in the
+deskTop using a global variable called editorApp that's the application.
+@p
+ After inserting the windows the function reorders the windows to recreate
+the original desTop. All is done with the deskTop locked.
+
+*****************************************************************************/
+
+void *TEditorCollection::read( ipstream& is )
+{
+ int version;
+ uchar wS,hS;
+ TDskWinEditor *ped=0;
+
+ unsigned dstOps=GetDSTOptions();
+ // Look if the user wants to remove those
+ int removeEditors,removeOthers,removeClosed;
+ if (HaveFilesCL)
+ {
+ removeEditors=(dstOps & dstEdMask)==dstEdOnlyIfNoCL;
+ removeOthers =(dstOps & dstOwMask)==dstOwOnlyIfNoCL;
+ removeClosed =(dstOps & dstCfMask)==dstCfOnlyIfNoCL;
+ }
+ else
+ removeEditors=removeOthers=removeClosed=0;
+ int forgetCursorPos=dstOps & dstNoCursorPos;
+
+ if (removeEditors)
+ TCEditor::DontLoadFile=1;
+
+ // That's needed if we want to remove some windows from the desktop
+ // Is silly but some users wants to remove windows if the command line
+ // contains names
+ TSetEditorApp::edHelper=this;
+ is >> version;
+ if (version>=0) // Again! sorry
+ {
+ Closed=version;
+ wS=TScreen::screenWidth;
+ hS=TScreen::screenHeight;
+ version=0;
+ }
+ else
+ {
+ version=-version;
+ is >> wS >> hS >> Closed;
+ }
+
+ is >> nonEditors >> Editors >> delta;
+ if (version>=2)
+ is >> maxClosedToRemember;
+ else
+ maxClosedToRemember=40;
+
+ count=Closed+nonEditors+Editors;
+ setLimit(0);
+ // The following is because the editors could pop-up dialogs
+ // during the load process. It will trigger the idle() member
+ // and it will do a search in the list of windows. If we have
+ // count set to the final value the search will involve unloaded
+ // items!
+ ccIndex countAux=count;
+ for (count=0; count<countAux; count++ )
+ items[count]=readItem(is);
+
+ // Now insert the views in the correct order
+ int c=count;
+ ccIndex i=0;
+ TDskWin *p;
+ int max=0;
+
+ // That's a problem in Linux where we don't set the video mode so if the
+ // editor is started with one resolution and then with another the windows
+ // aren't repositioned
+ TPoint dS;
+
+ dS.x=TScreen::screenWidth-wS;
+ dS.y=TScreen::screenHeight-hS;
+ int dChange=dS.x!=0 || dS.y!=0;
+
+ editorApp->deskTop->lock();
+ while (c)
+ {
+ p=(TDskWin *)at(i);
+ c--;
+ if (p->view)
+ {
+ editorApp->deskTop->insert(p->view);
+ if (dChange)
+ {
+ TRect r;
+ p->view->calcBounds(r,dS);
+ p->view->changeBounds(r);
+ }
+ if (p->ZOrder>max)
+ max=p->ZOrder;
+ }
+ i++;
+ }
+
+ while (max)
+ {
+ c=count; i=0;
+ do
+ {
+ p=(TDskWin *)at(i);
+ if (p->view)
+ {
+ if (p->ZOrder==max)
+ {
+ p->view->select();
+ break;
+ }
+ }
+ i++;
+ }
+ while (--c);
+ max--;
+ }
+
+ // Some of the windows could fail to be inserted. For example a read error for an
+ // editor invalidates it. Also non-exitant files.
+ if (removeClosed)
+ DontSortClosed=dscNoSortPutLast; // Don't sort closed by now
+ else
+ if (removeEditors)
+ DontSortClosed=dscNoSortPutFirst; // Don't sort closed by now
+ c=count;
+ i=0;
+ while (c)
+ {
+ p=(TDskWin *)at(i);
+ c--;
+ int cAnt=count;
+
+ // We have three different types of dskWin objects
+ // 1) Editors
+ if (p->type==dktEditor)
+ {
+ ped=(TDskWinEditor *)p;
+ if (!p->view || removeEditors)
+ {
+ int cEdAnt=Editors;
+ // We need it because we will delete ped in removeEditor
+ TCEditWindow *edw=ped->edw;
+ // If we just call close() and the object is 0 then the
+ // removeEditor will get the real pointer and won't be
+ // able to find what to remove, so we do it here.
+ if (!p->view)
+ removeEditor(edw,False);
+ // We can do it because we know edHelper is initialized
+ if (edw)
+ edw->close();
+ // When we succeed to remove the editor it created a closed window
+ // it makes cAnt==count, but we don't have to increment i
+ if (cAnt==count && cEdAnt!=Editors)
+ i--;
+ }
+ else
+ {
+ if (forgetCursorPos)
+ ped->edw->editor->handleCommand(cmcTextStart);
+ ped->edw->editor->update(ufUpdate);
+ }
+ }
+ else
+ // 2) Closed files
+ if (p->type==dktClosed)
+ {
+ if (removeClosed && p->DeleteAction(i,False))
+ delete p;
+ }
+ // 3) All the rest
+ else
+ {
+ if (!p->view || removeOthers)
+ if (p->DeleteAction(i,False))
+ delete p;
+ }
+ // If the item wasn't removed take the next
+ if (count==cAnt)
+ i++;
+ }
+ HaveFilesCL=0;
+ TCEditor::DontLoadFile=0;
+ if (DontSortClosed!=dscSort)
+ {
+ DontSortClosed=dscSort;
+ sortClosed();
+ }
+ if (dChange)
+ editorApp->deskTop->redraw();
+ editorApp->deskTop->unlock();
+ return this;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Overwrites the TCollection calling the TDskWin::GetText member of the
+item. See: @x{TDskWin::GetText}.
+
+*****************************************************************************/
+
+void TEditorCollection::getText(char *dest, ccIndex item, short maxLen)
+{
+ if (item>=getCount())
+ {
+ *dest=0;
+ return;
+ }
+ TDskWin *p=(TDskWin *)at(item);
+ p->GetText(dest,maxLen);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Adds a TCEditWindow object (p) to the collection. The second parameter was
+used when the syntax highlight wasn't selected by the TCEditor class.
+@p
+ The function fixes the name is it's ended with a point, assigns a number
+to the editor, creates a @x{TDskWinEditor (class)}, object for it and inserts
+it in the collection. Additionally it deletes any closed editor with the
+same name.
+@p
+ No checks are made to see if the editor is already on desktop because
+the object isn't inserted in the desktop. This task must be done by the
+calling routine.
+
+*****************************************************************************/
+
+void TEditorCollection::addEditor(TCEditWindow *p, int )
+{
+ int i=Editors;
+ int number=2; // 1 is for the project
+ ccIndex ind=0;
+ TDskWinEditor *st;
+
+ while (i)
+ {
+ st=(TDskWinEditor *)at(ind);
+ i--;
+ if (st->number!=number)
+ break;
+ number++;
+ ind++;
+ }
+ Editors++;
+ st=new TDskWinEditor(p,number);
+ p->number=number;
+ atInsert(ind,st);
+
+ // If there is a closed for it kill him
+ ind=search(p->editor->fileName,dktClosed);
+ if (ind!=-1)
+ {
+ TDskWinClosed *p=(TDskWinClosed *)at(ind);
+ atRemove(ind);
+ Closed--;
+ delete p;
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is used to search a view pointed by p of the specified type. It uses for it
+the member @x{TDskWin::Compare}.
+
+ Return:
+ The ccIndex of the object is found or -1 if not.
+
+*****************************************************************************/
+
+ccIndex TEditorCollection::search(void *p,int type)
+{
+ ccIndex pos=0;
+ TDskWin *st;
+
+ while (pos<count)
+ {
+ st=(TDskWin *)at(pos);
+ if (st->Compare(p,type))
+ return pos;
+ pos++;
+ }
+ return -1;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is used to search a view pointed by view of any type.
+
+ Return:
+ The ccIndex of the object is found or -1 if not.
+
+*****************************************************************************/
+
+ccIndex TEditorCollection::searchByView(void *view)
+{
+ ccIndex pos=0;
+ TDskWin *st;
+
+ while (pos<count)
+ {
+ st=(TDskWin *)at(pos);
+ if (st->view==view)
+ return pos;
+ pos++;
+ }
+ return -1;
+}
+
+
+/**[txh]**********************************************************************
+
+ Description:
+ Removes and editor from the collection. It adds the editor to the list of
+closed editors and deletes the object. Additionally it limits the number of
+closed editors to 40 and keeps the list sorted (Laszlo added it). Now the
+number is configurable.@p
+ This function *does not* delete the editor window itself. It is supposed to
+be called by the close() member so it will be destroyed soon. The call is
+done indirectly by sending a cmClosingWindow broadcast. If a function
+directly calls this function should then destroy the editor.
+
+*****************************************************************************/
+
+void TEditorCollection::removeEditor(TCEditWindow *p, Boolean dontAddClosed)
+{
+ ccIndex pos=search(p,dktEditor);
+
+ if (pos<0) return;
+ TDskWinEditor *st=(TDskWinEditor *)at(pos);
+ // The read-only copies doesn't have to be added to the closed list or we get
+ // duplicated names!
+ if (!p || p->editor->isReadOnly) dontAddClosed=True;
+ // Ask for saving
+ if (!dontAddClosed && st->edw && !st->edw->editor->valid(cmClose)) return;
+ atRemove(pos);
+ Editors--;
+
+ if (dontAddClosed ||
+ (p->editor->MakeBkpForIt!=0 && // Exclude files that doesn't have back-up
+ !p->editor->MakeBkpForIt(p->editor->fileName)) ||
+ !p->editor->fileName[0]) // Exclude "new" files
+ {
+ delete st;
+ return;
+ }
+ if (p)
+ UpdateProjectResumeFor(p->editor->fileName,p);
+ if (!st->edw)
+ return;
+
+ TDskWinClosed *nuevo=new TDskWinClosed(st->edw);
+ if (DontSortClosed==dscNoSortPutLast)
+ // That's used during the load. If we are adding a closed window
+ // means we are removing editors and closed windows will follow,
+ // so we must add at the end.
+ insert(nuevo);
+ else
+ // Add at the begining so we are sure it will survive to the
+ // limitation routine.
+ atInsert(Editors+nonEditors,nuevo);
+ delete st;
+ Closed++;
+
+ if (DontSortClosed==dscSort)
+ sortClosed();
+}
+
+void TEditorCollection::sortClosed(void)
+{
+ // Don't keep more than 40 closed, Laci needs much ;-)
+ while (Closed>maxClosedToRemember)
+ {
+ ccIndex posOlder, i, total;
+ posOlder=i=Editors+nonEditors;
+ total=i+Closed;
+ TDskWinClosed *p=(TDskWinClosed *)at(i);
+ time_t older=p->resume.dateResume;
+ for (i++; i<total; i++)
+ {
+ p=(TDskWinClosed *)at(i);
+ if (p->resume.dateResume<older)
+ {
+ older=p->resume.dateResume;
+ posOlder=i;
+ }
+ }
+ Closed--;
+ p=(TDskWinClosed *)at(posOlder);
+ atRemove(posOlder);
+ delete p;
+ }
+ // That's a modified version of the Laszlo's idea to keep the closed windows
+ // sorted that of course sorts the old desktop files.
+ TDskWinClosed **closedwins = (TDskWinClosed**)alloca(maxClosedToRemember * sizeof(TDskWinClosed*));
+ TDskWinClosed *tmp;
+ ccIndex ic,jc;
+ int sorted=0,need_change=0;
+
+ for (ic=0; ic<Closed; ic++)
+ closedwins[ic]=(TDskWinClosed *)at(ic+Editors+nonEditors);
+ for (ic=0; ic<Closed-1 && !sorted; ic++)
+ for (jc=ic+1,sorted=1; jc<Closed; jc++)
+ {
+ if (strcmp(closedwins[ic]->Name,closedwins[jc]->Name) > 0)
+ {
+ tmp=closedwins[ic];
+ closedwins[ic]=closedwins[jc];
+ closedwins[jc]=tmp;
+ sorted=0;
+ need_change=1;
+ }
+ }
+ if (need_change)
+ {
+ for (ic=0; ic<Closed; ic++)
+ atRemove(Editors+nonEditors);
+ for (ic=0; ic<Closed; ic++)
+ atInsert(Editors+nonEditors+ic,closedwins[ic]);
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Removes a non editor from the collection. You must provide the pointer and
+the type. The object is deleted.
+
+*****************************************************************************/
+
+void TEditorCollection::removeNonEditor(void *p, int type)
+{
+ ccIndex pos=search(p,type);
+
+ if (pos<0) return;
+ void *NonEditor=at(pos);
+ atRemove(pos);
+ freeItem(NonEditor);
+ nonEditors--;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Removes the desktop helper whose view member is the one passed.
+
+***************************************************************************/
+
+void TEditorCollection::removeWindow(void *p)
+{
+ ccIndex pos=searchByView(p);
+
+ if (pos<0) return;
+ TDskWin *st=(TDskWin *)at(pos);
+ if (st->type==dktEditor)
+ removeEditor((TCEditWindow *)p,False);
+ else
+ removeNonEditor(p,st->type);
+}
+
+
+/**[txh]**********************************************************************
+
+ Description:
+ Searchs an editor by name. For more details @x{::searchEditorbyINode}.
+
+ Return:
+ The index in the collection or -1 if not there.
+
+ Example:
+
+TCEditWindow *IsAlreadyOnDesktop(char *fileName, int *cant)
+{
+ ccIndex pos=edHelper->searchEditorName(fileName,cant);
+ if (pos<0)
+ return NULL;
+ TDskWinEditor *st=(TDskWinEditor *)edHelper->at(pos);
+ return st->edw;
+}
+
+*****************************************************************************/
+
+ccIndex TEditorCollection::searchEditorName(char *name, int *cant)
+{
+ int i=Editors;
+ ccIndex ind=0;
+ TDskWin *st;
+ int l;
+ TCEditor *ed;
+ /* Index of the best match */
+ ccIndex indFound=-1;
+ Boolean isIndReadOnly=True;
+ int Cant=0;
+
+ // If the name
+ l=strlen(name)-1;
+ if (l>=0 && name[l]=='.')
+ name[l]=0;
+ while (i)
+ {
+ st=(TDskWin *)at(ind);
+ if (st->type==dktEditor)
+ {
+ i--;
+ ed=((TDskWinEditor *)st)->edw->editor;
+ #if defined(SEOS_Win32) && !defined(SECompf_Cygwin)
+ char expanded_path1[PATH_MAX], expanded_path2[PATH_MAX];
+ strcpy(expanded_path1,ed->fileName);
+ strcpy(expanded_path2,name);
+ CLY_fexpand(expanded_path1);
+ CLY_fexpand(expanded_path2);
+ #else
+ const char *expanded_path1=ed->fileName;
+ const char *expanded_path2=name;
+ #endif
+ if (strcasecmp(expanded_path1,expanded_path2)==0)
+ {
+ Cant++;
+ if (indFound==-1 || (isIndReadOnly && !ed->isReadOnly))
+ {
+ isIndReadOnly=ed->isReadOnly;
+ indFound=ind;
+ }
+ }
+ }
+ ind++;
+ }
+
+ if (cant)
+ *cant=Cant;
+ return indFound;
+}
+
+static
+Boolean compareNumber(void *item, void *arg)
+{
+ TDskWin *p=(TDskWin *)item;
+ int number=*((int *)arg);
+ return p->GetNumber()==number ? True : False;
+}
+
+TDskWin *TEditorCollection::searchByNumber(int num)
+{
+ return (TDskWin *)firstThat(compareNumber,&num);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Searchs an editor using the I-Node/Device of the file. If the provided file
+name doesn't have an I-Node the routine makes a search by name.@*
+ The number of matches is returned in cant. If one editor no read only is
+present that's the index reported. If the index reported belongs to a read
+only editor it means all the rest are read only. The pointer cant can be NULL
+in this case the function doesn't use it.
+
+ Return:
+ The index in the collection or -1 is not there.
+
+ Example:
+
+TCEditWindow *IsAlreadyOnDesktop(char *fileName, int *cant)
+{
+ ccIndex pos=edHelper->searchEditorbyINode(fileName,cant);
+ if (pos<0)
+ return NULL;
+ TDskWinEditor *st=(TDskWinEditor *)edHelper->at(pos);
+ return st->edw;
+}
+
+*****************************************************************************/
+
+ccIndex TEditorCollection::searchEditorbyINode(char *name, int *cant)
+{
+ stEditorId id;
+ if (!FillEditorId(&id,name))
+ return searchEditorName(name,cant);
+ return searchEditorbyINode(&id,name,cant);
+}
+
+ccIndex TEditorCollection::searchEditorbyINode(stEditorId *id, char *name, int *cant)
+{// If no id use the name
+ if (!id)
+ return searchEditorbyINode(name,cant);
+ // We must be sure the provided id isn't fake
+ // Example: the case of BC++ 5.5 Win32
+ if (IsEmptyEditorId(id))
+ // If the id is invalid we search by name
+ return searchEditorName(name,cant);
+
+ int i=Editors;
+ ccIndex ind=0;
+ TDskWin *st;
+ TCEditor *ed;
+ /* Index of the best match */
+ ccIndex indFound=-1;
+ Boolean isIndReadOnly=True;
+ int Cant=0;
+
+ while (i)
+ {
+ st=(TDskWin *)at(ind);
+ if (st->type==dktEditor)
+ {
+ i--;
+ ed=((TDskWinEditor *)st)->edw->editor;
+ if (CompareEditorId(id,&(ed->EditorId)))
+ {
+ Cant++;
+ if (indFound==-1 || (isIndReadOnly && !ed->isReadOnly))
+ {
+ isIndReadOnly=ed->isReadOnly;
+ indFound=ind;
+ }
+ }
+ }
+ ind++;
+ }
+
+ if (cant)
+ *cant=Cant;
+ return indFound;
+}
+
+void TEditorCollection::forEachEditor(void (*func)(TCEditWindow *))
+{
+ int i=Editors;
+ ccIndex ind=0;
+ TDskWin *st;
+
+ while (i)
+ {
+ st=(TDskWin *)at(ind);
+ if (st->type==dktEditor)
+ {
+ TCEditWindow *p=((TDskWinEditor *)st)->edw;
+ i--;
+ func(p);
+ }
+ ind++;
+ }
+}
+
+void TEditorCollection::forEachNonEditor(int type, void (*func)(TDskWin *, void *),
+ void *data)
+{
+ ccIndex i, cant;
+ TDskWin *st;
+
+ for (i=Editors, cant=Editors+nonEditors; i<cant; i++)
+ {
+ st=(TDskWin *)at(i);
+ if (st->type==type)
+ {
+ func(st,data);
+ ccIndex c=Editors+nonEditors;
+ if (c!=cant)
+ {// The function closed it
+ cant=c;
+ i--;
+ }
+ }
+ }
+}
+
+static
+void SaveIt(TCEditWindow *p)
+{
+ if (p->editor->modified)
+ p->editor->save();
+}
+
+void TEditorCollection::saveEditors(void)
+{
+ forEachEditor(SaveIt);
+}
+
+static
+void RedrawIt(TCEditWindow *p)
+{
+ p->editor->update(ufView);
+}
+
+void TEditorCollection::redrawEditors(void)
+{
+ forEachEditor(RedrawIt);
+}
+
+static
+void RereadInode(TCEditWindow *p)
+{
+ stEditorId *id=&(p->editor->EditorId);
+ TCEditor *ed=p->editor;
+ // Check only files we have on disk
+ if (!IsEmptyEditorId(id))
+ {
+ stEditorId newId;
+ // Ever try to update the id
+ if (FillEditorId(&newId,ed->fileName) && !CompareEditorId(&newId,id))
+ {
+ // Code to debug it
+ #if 0
+ // Note: On Debian GNU/Linux v3.1 (Sarge) I saw problems with samba volumes.
+ // The reported inode seems to change without reason.
+ printf("File %s inode changed: dev:0x%lX/ino:0x%lX to dev:0x%lX/ino:0x%lX\n",
+ ed->fileName,(ulong)id->dev,(ulong)id->inode,(ulong)newId.dev,
+ (ulong)newId.inode);
+ #endif
+ *id=newId;
+ if (!ed->isReadOnly)
+ AskReloadEditor(p);
+ }
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ The editor uses device+inode to identify a file because names aren't
+reliable. But it could change if somebody replaced the file. Here I reread
+this information for all editors so a search by inode have more chances to
+succeed. Note that I trust that the modification time will also change so
+we can still detecting file changes.
+
+***************************************************************************/
+
+void TEditorCollection::reIdEditors(void)
+{
+ forEachEditor(RereadInode);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Overwrites the freeItem member. It just calls to the virtual destructor of
+the TDskWin object pointed by item.
+
+*****************************************************************************/
+
+void TEditorCollection::freeItem(void *item)
+{
+ delete (TDskWin *)item;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Used to know the biggest number of editor window
+
+ Return: The biggest number or 0 if no editors.
+
+***************************************************************************/
+
+int TEditorCollection::GetMaxWindowNumber()
+{
+ if (!Editors)
+ return 0;
+ TDskWinEditor *st=(TDskWinEditor *)at(Editors-1);
+
+ return st->number;
+}
+
+void TEditorCollection::ReEnumerate()
+{
+ if (!Editors)
+ return;
+ for (int i=0; i<Editors; i++)
+ {
+ TDskWinEditor *st=(TDskWinEditor *)at(i);
+ st->SetNumber(i+2);
+ }
+}
+
+int TEditorCollection::maxClosedToRemember;
+char TEditorCollection::HaveFilesCL=0;
+char TEditorCollection::DontSortClosed=0;
+
diff --git a/setedit/setedit/tips.cc b/setedit/setedit/tips.cc
new file mode 100644
index 0000000..346ec49
--- /dev/null
+++ b/setedit/setedit/tips.cc
@@ -0,0 +1,334 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#define Uses_string
+
+#define Uses_TStringCollection
+#define Uses_TApplication
+#define Uses_TDeskTop
+
+// EasyDiag requests
+#define Uses_TSButton
+#define Uses_TSRadioButtons
+#define Uses_TSTextScroller
+#define Uses_TSLabel
+#define Uses_TSHzGroup
+
+// First include creates the dependencies
+#include <easydia1.h>
+#include <tv.h>
+// Second request the headers
+#include <easydiag.h>
+
+#define Uses_SETAppVarious
+#define Uses_SETAppDialogs
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <edmsg.h>
+#include <edspecs.h>
+
+// 0 => no tips, 1 => dialog, 2 => message window
+static uint32 TipStyle=1;
+
+void getLineNoLF(char *b, int max, FILE *f)
+{
+ b[0]=0;
+ fgets(b,max,f);
+ int l=strlen(b);
+ if (b[l-1]=='\n')
+ {
+ b[l-1]=0;
+ if (b[l-2]=='\r')
+ b[l-2]=0;
+ }
+}
+
+typedef enum { findStart, findEnd, collectLinks, collectTip, endAll } stateTip;
+
+const char *strStart="~~~Start";
+const char *strEnd ="~~~End";
+
+#define getLine() getLineNoLF(lineBuf,80,f)
+
+void SearchTip(void (*ActionLine)(char *), void (*ActionLink)(char *),
+ char *fileName, int &tipNumber)
+{
+ char lineBuf[80];
+ stateTip state=findStart;
+ int tipCounter=0,buscar=1;
+
+ FILE *f=fopen(fileName,"rt");
+ if (!f)
+ return;
+ else
+ {
+ while (buscar)
+ {
+ getLine();
+ while (!feof(f) && state!=endAll)
+ {
+ switch (state)
+ {
+ case findStart:
+ if (strcmp(lineBuf,strStart)==0)
+ {
+ tipCounter++;
+ if (tipCounter==tipNumber)
+ state=collectTip;
+ else
+ state=findEnd;
+ }
+ break;
+ case findEnd:
+ if (strcmp(lineBuf,strEnd)==0)
+ state=findStart;
+ break;
+ case collectLinks:
+ if (strcmp(lineBuf,strStart)==0)
+ {
+ state=endAll;
+ buscar=0;
+ }
+ else
+ if (lineBuf[0]!=0) // Skip empty lines
+ ActionLink(lineBuf);
+ break;
+ case collectTip:
+ if (strcmp(lineBuf,strEnd)==0)
+ state=collectLinks;
+ else
+ ActionLine(lineBuf);
+ break;
+ case endAll:
+ break;
+ }
+ getLine();
+ }
+ if (state==findStart && buscar)
+ {
+ tipNumber=1;
+ tipCounter=0;
+ state=findStart;
+ rewind(f);
+ }
+ else
+ buscar=0;
+ }
+ }
+ fclose(f);
+}
+
+/****************************** Dialog Stuff **********************************/
+static TNSCollection *TipText,*TipLinks;
+static int maxWLink;
+
+void forDialogLine(char *text)
+{
+ TipText->insert(newStr(text));
+}
+
+void forDialogLink(char *text)
+{
+ TipLinks->insert(newStr(text));
+ int l=strlen(text);
+ if (l>maxWLink)
+ maxWLink=l;
+}
+
+const int cmBaseLinks=0x2260,cmNextTip=0x2280;
+
+class TDialogTips : public TDialog
+{
+public:
+ TDialogTips(const TRect& bounds, const char *aTitle) :
+ TWindowInit(&TDialogTips::initFrame),
+ TDialog(bounds,aTitle) {}
+ virtual void handleEvent(TEvent& event);
+};
+
+void TDialogTips::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand && event.message.command>=0x2260 &&
+ event.message.command<=cmNextTip)
+ {
+ endModal(event.message.command);
+ clearEvent(event);
+ }
+}
+
+
+static void ShowDialogTip(char *fileName, int &LastTip)
+{
+ int showNext=1;
+
+ while (showNext)
+ {
+ TipText=new TNSCollection(10,5);
+ TipLinks=new TNSCollection(4,2);
+ if (!TipText || !TipLinks)
+ return;
+
+ maxWLink=0;
+ SearchTip(forDialogLine,forDialogLink,fileName,LastTip);
+
+ int lines=TipText->getCount();
+ if (lines)
+ {
+ TSViewCol *col=new TSViewCol(new TDialogTips(TRect(1,1,1,1),__("Tip of the day")));
+
+ TSTextScroller *text=new TSTextScroller(40,10,TipText,0,lines>10,40);
+ char aux[40];
+ TVIntl::snprintf(aux,40,__("~T~ip %d"),LastTip);
+ TSLabel *Text=new TSLabel(aux,text);
+ col->insert(2,1,Text);
+
+ int tips=TipLinks->getCount(),i;
+ if (tips)
+ {
+ TSButton *btA=0,*bt;
+ maxWLink+=3;
+
+ for (i=0; i<tips; i++)
+ {
+ bt=new TSButton((char *)TipLinks->at(i),cmBaseLinks+i,bfNormal,maxWLink);
+ if (btA)
+ col->insert(xTSRightOf,yTSUnder,bt,Text,btA);
+ else
+ col->insert(xTSRightOf,2,bt,Text);
+ btA=bt;
+ }
+ }
+
+ TSRadioButtons *origin = new TSRadioButtons(
+ new TSItem(__("Don't ~s~how it again"),
+ new TSItem(__("Show it once a ~d~ay"),
+ new TSItem(__("Show it in the ~m~essage window"),0))));
+ TSLabel *Options=new TSLabel(__("Options"),origin);
+ col->insert(2,yTSUnder,Options,0,Text);
+
+ TSHzGroup *buttons=new TSHzGroup(new TSButton(__("O~K~"),cmOK,bfDefault),
+ new TSButton(__("~N~ext tip"),cmNextTip),4);
+ col->insert(xTSCenter,yTSDown,buttons);
+
+ TDialog *d=col->doIt();
+ d->helpCtx=cmeTipOfTheDay;
+ delete col;
+
+ d->options|=ofCentered;
+
+ int ret=execDialog(d,&TipStyle);
+
+ if (ret!=cmCancel)
+ {
+ if (ret>=cmBaseLinks && ret<cmNextTip)
+ {
+ ShowHelpTopic("setedit",(char *)TipLinks->at(ret-cmBaseLinks));
+ }
+ }
+ showNext=(ret==cmNextTip);
+ }
+ else
+ showNext=0;
+
+ CLY_destroy(TipText);
+ CLY_destroy(TipLinks);
+
+ LastTip++;
+ }
+}
+/****************************** End of Dialog Stuff **********************************/
+
+void forMessageLine(char *text)
+{
+ EdShowMessage(text);
+}
+
+void forMessageLink(char *)
+{
+}
+
+static void ShowMessageTip(char *fileName, int &LastTip)
+{
+ EdShowMessageI(__("Tip of the day"),True);
+ SearchTip(forMessageLine,forMessageLink,fileName,LastTip);
+ EdJumpToMessage(0);
+ LastTip++;
+}
+
+// Format: style,tip,time
+// style is 0,1 or 2
+// tip is the next tip to show (order in the list)
+// time of the last use
+//
+const char *envTipStyle="SET_TIP_INFO";
+
+void ShowTips(char *fileName, int forceDialog)
+{
+ int LastTip,oldTipStyle=-1;
+ char aux[60],day,today;
+ time_t LastUse,Today;
+ struct tm *t;
+
+ char *s=(char *)GetVariable(envTipStyle),*end;
+ if (s)
+ {
+ // No tip, dialog or message
+ TipStyle=strtol(s,&end,0);
+ if (TipStyle>2)
+ TipStyle=1;
+ else
+ oldTipStyle=TipStyle;
+
+ if (!TipStyle && !forceDialog)
+ return;
+
+ // Tip number
+ s=end+1;
+ LastTip=strtol(s,&end,0);
+ if (LastTip<=0)
+ LastTip=1;
+
+ // Time of the last show
+ s=end+1;
+ LastUse=(time_t)strtol(s,&end,0);
+
+ // Check a difference of 1 day
+ t=localtime(&LastUse);
+ day=t->tm_mday;
+ Today=time(NULL);
+ t=localtime(&Today);
+ today=t->tm_mday;
+ if (day==today && !forceDialog) // fails if one month
+ return;
+ }
+ else
+ {
+ TipStyle=1;
+ LastTip=1;
+ }
+
+
+ if (forceDialog)
+ ShowDialogTip(fileName,LastTip);
+ else
+ switch (TipStyle)
+ {
+ case 2:
+ ShowMessageTip(fileName,LastTip);
+ break;
+ case 1:
+ ShowDialogTip(fileName,LastTip);
+ break;
+ }
+
+ // Store the change if the user asked for it
+ Today=time(NULL);
+ sprintf(aux,"%d,%d,%ld",TipStyle,LastTip,(long)Today);
+ InsertEnvironmentVar((char *)envTipStyle,aux);
+}
+
+
diff --git a/setedit/setedit/tpaltext.cc b/setedit/setedit/tpaltext.cc
new file mode 100644
index 0000000..4b7b763
--- /dev/null
+++ b/setedit/setedit/tpaltext.cc
@@ -0,0 +1,148 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+#define Uses_stdio
+#define Uses_string
+#define Uses_fpstream
+#define Uses_TScreen
+#include <tv.h>
+#include <tpaltext.h>
+
+PalCol TTextPalette::ActualPalette[16];
+char TTextPalette::Changed=0;
+
+/*
+ In TV 2.0.0 I moved it to Turbo Vision, so that's a simple wrapper over
+ the TV code. It also acts as a cache
+*/
+
+void TTextPalette::SetOne(int color, int R, int G, int B)
+{
+ ActualPalette[color].R=R;
+ ActualPalette[color].G=G;
+ ActualPalette[color].B=B;
+ TScreen::setPaletteColors(color,1,&ActualPalette[color]);
+ // Re-compute the changed value
+ const TScreenColor *orig=TDisplay::getDefaultPalette()+color;
+ if (orig->R==R && orig->G==G && orig->B==B)
+ {// Restoring this color
+ if (Changed)
+ ComputeChangedStatus();
+ }
+ else
+ Changed=1;
+}
+
+void TTextPalette::ComputeChanged()
+{
+ const TScreenColor *orig=TDisplay::getDefaultPalette();
+ int i;
+ for (i=0; i<16; i++)
+ if (ActualPalette[i].R!=orig[i].R || ActualPalette[i].G!=orig[i].G ||
+ ActualPalette[i].B!=orig[i].B)
+ {
+ Changed=1;
+ return;
+ }
+ Changed=0;
+}
+
+void TTextPalette::GetOne(int color, int &R, int &G, int &B)
+{
+ R=ActualPalette[color].R;
+ G=ActualPalette[color].G;
+ B=ActualPalette[color].B;
+}
+
+void TTextPalette::BackToDefault(void)
+{
+ TScreen::resetPalette();
+ Changed=0;
+ Cache();
+}
+
+// This funtion exists only for compatibility with all desktop files.
+void TTextPalette::Load(fpstream &s, PalCol *pal)
+{
+ PalCol *dest=pal ? pal : ActualPalette;
+ char version;
+ s >> version;
+ int i;
+ for (i=0; i<16; i++)
+ s >> dest[i].R >> dest[i].G >> dest[i].B;
+ if (version==1)
+ { // v1 was stored with 0-63 values, 0-255 is much more generic.
+ int i;
+ for (i=0; i<16; i++)
+ {
+ dest[i].R<<=2;
+ dest[i].G<<=2;
+ dest[i].B<<=2;
+ }
+ }
+ // Old versions for Linux saved black palettes, we must avoid using them
+ int acum=0;
+ for (i=0; i<16 && !acum; i++)
+ acum+=dest[i].R+dest[i].G+dest[i].B;
+ if (!acum)
+ {
+ memcpy(dest,TDisplay::getDefaultPalette(),sizeof(ActualPalette));
+ Changed=0;
+ }
+ else
+ if (!pal)
+ {
+ ComputeChanged();
+ Restore();
+ }
+}
+
+void TTextPalette::Cache()
+{
+ TScreen::getPaletteColors(0,16,ActualPalette);
+ ComputeChanged();
+}
+
+void TTextPalette::GetArray(unsigned *pal)
+{
+ int i;
+ for (i=0; i<16; i++)
+ pal[i]=(ActualPalette[i].R<<16) | (ActualPalette[i].G<<8) | ActualPalette[i].B;
+}
+
+PalCol *TTextPalette::GetAllPal()
+{
+ PalCol *ret=new PalCol[16];
+ memcpy(ret,ActualPalette,sizeof(ActualPalette));
+ return ret;
+}
+
+void TTextPalette::SetAllPal(PalCol *pal)
+{
+ TScreen::setPaletteColors(0,16,pal);
+ memcpy(ActualPalette,pal,sizeof(ActualPalette));
+ ComputeChanged();
+}
+
+void TTextPalette::Restore()
+{
+ TScreen::setPaletteColors(0,16,ActualPalette);
+}
+
+/**[txh]********************************************************************
+ Description:
+ Used when Restore will be called soon and we just want to set a value for
+it.
+***************************************************************************/
+
+void TTextPalette::PreparePal(PalCol *pal)
+{
+ memcpy(ActualPalette,pal,sizeof(ActualPalette));
+ ComputeChanged();
+}
+
+void TTextPalette::Copy(PalCol *dest)
+{
+ memcpy(dest,ActualPalette,sizeof(ActualPalette));
+}
+
diff --git a/setedit/setedit/winlistd.cc b/setedit/setedit/winlistd.cc
new file mode 100644
index 0000000..7f0000f
--- /dev/null
+++ b/setedit/setedit/winlistd.cc
@@ -0,0 +1,170 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TRect
+#define Uses_TDialog
+#define Uses_TScrollBar
+#define Uses_TButton
+#define Uses_TDeskTop
+#define Uses_TApplication
+#define Uses_TProgram
+#define Uses_TCollection
+#define Uses_TListBox
+#define Uses_MsgBox
+#define Uses_TCEditWindow
+#define Uses_limits
+#define Uses_TSHzGroup
+#define Uses_TSButton
+#define Uses_TSListBox
+#define Uses_TVCodePage
+#define Uses_TScreen
+#include <easydia1.h>
+#include <ceditor.h>
+#include <easydiag.h>
+
+#include <dskwin.h>
+#define Uses_TSListEditors
+#include <edcollec.h>
+#include <editcoma.h>
+#define Uses_TSetEditorApp
+#define Uses_SETAppConst
+#include <setapp.h>
+#include <advice.h>
+
+TView *setFocusTo;
+Boolean focusChanged;
+
+class TListWindowsDiag : public TDialog
+{
+public:
+ TListWindowsDiag();
+ void handleEvent(TEvent &event);
+ TListEditors *tl;
+};
+
+TListWindowsDiag::TListWindowsDiag() :
+ TWindowInit(TListWindowsDiag::initFrame),
+ TDialog(TRect(1,1,1,1),__("Windows List"))
+{
+}
+
+void TListWindowsDiag::handleEvent(TEvent &event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand || event.what==evBroadcast)
+ {
+ ccIndex pos=tl ? tl->focused : 0;
+ if (pos>=TSetEditorApp::edHelper->getCount())
+ return;
+ TDskWin *obj=(TDskWin *)(TSetEditorApp::edHelper->at(pos));
+
+ switch( event.message.command )
+ {
+ case cmListItemSelected:
+ case cmGo:
+ if (obj->GoAction(pos))
+ delete obj;
+ tl->setRange(TSetEditorApp::edHelper->getCount());
+ break;
+
+ case cmDelete:
+ if (obj->DeleteAction(pos,False))
+ delete obj;
+ tl->setRange(TSetEditorApp::edHelper->getCount());
+ break;
+
+ case cmInsert:
+ message(editorApp,evCommand,cmeOpen,0);
+ break;
+
+ case cmDelFile:
+ if (obj->CanBeDeletedFromDisk)
+ {
+ if (GiveAdvice(gadvDeleteFile0)==cmYes)
+ {
+ if (obj->DeleteAction(pos,True))
+ delete obj;
+ tl->setRange(TSetEditorApp::edHelper->getCount());
+ }
+ else
+ {
+ clearEvent(event);
+ return;
+ }
+ }
+ else
+ {
+ messageBox(__("You can't delete this file"),mfOKButton);
+ clearEvent(event);
+ return;
+ }
+ break;
+
+ case cmReEnumerate:
+ TSetEditorApp::edHelper->ReEnumerate();
+ redraw();
+ return;
+
+ default:
+ return;
+ }
+ if (state & sfModal)
+ {
+ endModal(event.message.command);
+ clearEvent(event);
+ }
+ }
+}
+
+void FinishFocusChange()
+{
+ if (focusChanged)
+ {
+ setFocusTo->select();
+ setFocusTo->show();
+ TProgram::deskTop->unlock();
+ }
+}
+
+void BringListOfWindows(void)
+{
+ TRect r=TApplication::deskTop->getExtent();
+ int h=r.b.y-r.a.y-10;
+ int w=r.b.x-r.a.x-15;
+
+ TListWindowsDiag *d=new TListWindowsDiag();
+ TSViewCol *col=new TSViewCol(d);
+ TSListEditors *list=new TSListEditors(w,h,tsslbVertical | tsslbHorizontal,1,PATH_MAX);
+ d->tl=(TListEditors *)list->view;
+ TSHzGroup *buttons=MakeHzGroup(
+ new TSButton(__("~G~o"),cmGo,bfDefault),
+ new TSButton(__("~D~elete"),cmDelete),
+ new TSButton(__("~O~pen"),cmInsert),
+ new TSButton(__("Re~E~numerate"),cmReEnumerate),
+ new TSButton(__("Cancel"),cmCancel),0);
+ col->insert(xTSLeft,yTSUp,list);
+ col->insert(xTSCenter,yTSUnder,buttons,0,list);
+ col->doItCenter(hcListWin);
+ delete col;
+
+ TListBoxRec box;
+ box.items=TSetEditorApp::edHelper;
+ box.selection=0;
+ d->setData(&box);
+
+ focusChanged=False;
+ int i;
+
+ do
+ {
+ TProgram::deskTop->insert(d);
+ d->setState(sfModal,True);
+ i=d->execute();
+ TProgram::deskTop->remove(d);
+ }
+ while (i==cmDelete || i==cmDelFile);
+ d->tl=NULL; // No longer valid
+ CLY_destroy(d);
+
+ FinishFocusChange();
+}
+
diff --git a/setedit/settvuti/diaghelp.cc b/setedit/settvuti/diaghelp.cc
new file mode 100644
index 0000000..8d783d9
--- /dev/null
+++ b/setedit/settvuti/diaghelp.cc
@@ -0,0 +1,100 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TDialog
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TRect
+#define Uses_TButton
+#define Uses_MsgBox
+#include <tv.h>
+
+#include <edspecs.h>
+
+ushort execDialogNoDestroy(TDialog *d, void *data, char &lSet)
+{
+ TView *p=TProgram::application->validView(d);
+ if (p==0)
+ return cmCancel;
+ else
+ {
+ if (lSet && data!=0)
+ p->setData(data);
+ lSet=0;
+ ushort result=TProgram::deskTop->execView(p);
+ if (result!=cmCancel && data!=0)
+ p->getData(data);
+ return result;
+ }
+}
+
+const int lBotOK=10,lBotCan=11;
+
+void AddOKCancel(TDialog *d)
+{
+ TRect r=d->getExtent();
+
+ int sep=(r.b.x-lBotOK-lBotCan)/3;
+ TRect r2(sep,r.b.y-3,sep+lBotOK,r.b.y-1);
+ d->insert(new TButton(r2,__("~O~K"),cmOK,bfDefault));
+ r2.a.x=r2.b.x+sep;
+ r2.b.x=r2.a.x+lBotCan;
+ d->insert(new TButton(r2,__("Cancel"),cmCancel,bfNormal));
+}
+
+ushort messageBoxDSA(const char *msg, ushort aOptions, char *var,
+ ushort defComm)
+{
+ char *s=(char *)GetVariable(var);
+ if (!s || *s!='1')
+ {
+ ushort ret=messageBox(msg,aOptions | mfDontShowAgain);
+ if (ret & 0x8000)
+ {
+ ret&=0x7FFF;
+ InsertEnvironmentVar(var,"1");
+ }
+ return ret;
+ }
+ return defComm;
+}
+
+ushort messageBoxDSA(const char *msg, ushort aOptions, char *var,
+ unsigned mask, ushort defComm)
+{
+ unsigned val=EnvirGetBits(var,mask);
+ if (!val)
+ {
+ ushort ret=messageBox(msg,aOptions | mfDontShowAgain);
+ if (ret & 0x8000)
+ {
+ ret&=0x7FFF;
+ EnvirSetBits(var,mask);
+ }
+ return ret;
+ }
+ return defComm;
+}
+
+inline
+void MoveRectBut(TRect &r,int len,int sep)
+{
+ r.a.x=r.b.x+sep;
+ r.b.x=r.a.x+len;
+}
+
+int GetDeskTopCols()
+{
+ TRect r=TProgram::deskTop->getExtent();
+ return r.b.x-r.a.x;
+}
+
+int GetDeskTopRows()
+{
+ TRect r=TProgram::deskTop->getExtent();
+ return r.b.y-r.a.y;
+}
+
+TRect GetDeskTopSize()
+{
+ return TProgram::deskTop->getExtent();
+}
diff --git a/setedit/settvuti/dktclock.cc b/setedit/settvuti/dktclock.cc
new file mode 100644
index 0000000..91eb32f
--- /dev/null
+++ b/setedit/settvuti/dktclock.cc
@@ -0,0 +1,55 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <ceditint.h>
+#include <stdio.h>
+#define Uses_TView
+#define Uses_TDeskTopClock
+#include <settvuti.h>
+
+TDeskTopClock:: TDeskTopClock(const TRect & r) :
+ TView(r), curTime(0)
+{
+ growMode=gfGrowLoX | gfGrowHiX;
+ putSeparator=0;
+};
+
+void TDeskTopClock::update()
+{
+ time_t curtime;
+ time(&curtime);
+ if (curtime!=curTime)
+ {
+ curTime=curtime;
+ drawView();
+ }
+}
+
+void TDeskTopClock::draw()
+{
+ TDrawBuffer b;
+ uchar c = getColor(2);
+
+ if (curTime==0)
+ time(&curTime);
+ struct tm *timeStruct=localtime(&curTime);
+ char buffer[12];
+ // Not full international but digital clocks have only it ;-)
+ if (mode)
+ strftime(buffer,11,CLK24_FORMAT,timeStruct);
+ else
+ strftime(buffer,11,CLKAMPM_FORMAT,timeStruct);
+ if (putSeparator)
+ putSeparator=0;
+ else
+ {
+ putSeparator=1;
+ buffer[2]=' ';
+ }
+ b.moveStr(0,buffer,c);
+
+ writeLine(0,0,size.x,1,b);
+}
+
+int TDeskTopClock::mode=1; // 1 => 24hs 0 => AM/PM
+
+
diff --git a/setedit/settvuti/fileopen.cc b/setedit/settvuti/fileopen.cc
new file mode 100644
index 0000000..ae896fd
--- /dev/null
+++ b/setedit/settvuti/fileopen.cc
@@ -0,0 +1,378 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ That's an interesting way to make an Open dialog. The routine takes as
+parameter the title of the window ("Select a file", etc) and a char * with
+enough space for the filename containing the file mask.
+ The interesting thing is function remembers the directory where the
+user opened the last file and changes the curdir to it before showing the
+list. After the user selected the file the routines changes back the curdir
+to the one used by the program. It avoids saving files in other directories,
+that's a very annoying feature of the RHIDE 1.4 methode.
+ But to complet the thing it supports a history ID and a flag to set a mode
+where the dialog doesn't end when the user selects a file, instead the
+dialog sends a broadcast and if the message was received by someebody moves
+the selection to the next position. That's the same behavior used in the
+project window of the IDE and the editor but solved in a generic way (hey
+man! I'm loving these f*king messages ;-)
+
+ Return:
+ The button choosed by the user. cmCancel if aborted.
+
+***************************************************************************/
+#define Uses_unistd
+#define Uses_string
+#define Uses_getcwd
+#define Uses_chdir
+
+#define Uses_TFileDialog
+#define Uses_TFileList
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TEvent
+#define Uses_TButton
+#define Uses_TInputLine
+#define Uses_TChDirDialog
+#include <tv.h>
+
+#include <fileopen.h>
+
+class TFileDialogHome : public TFileDialog
+{
+public:
+ TFileDialogHome(const char *aWildCard, const char *aTitle,
+ const char *inputName, ushort aOptions, uchar histId,
+ const char *aHomeDir, unsigned aFlags, char *aSelDir,
+ TRect &dialogSize);
+ virtual void handleEvent(TEvent& event);
+ const char *homeDirectory;
+
+ TInputLine *link;
+ unsigned flags;
+ char letHistoryPass;
+ char *selDir;
+ TRect *returnSize;
+ static int (*ConfDiag)();
+};
+
+int (*TFileDialogHome::ConfDiag)()=0;
+
+static
+TButton *AddButton(TRect &r, const char *label, unsigned command)
+{
+ TButton *bt=new TButton(r,label,command,bfNormal);
+ bt->growMode=gfGrowLoX | gfGrowHiX;
+ r.a.y+=2; r.b.y+=2;
+ return bt;
+}
+
+TFileDialogHome::TFileDialogHome(const char *aWildCard, const char *aTitle,
+ const char *inputName, ushort aOptions,
+ uchar histId, const char *aHomeDir,
+ unsigned aFlags, char *aSelDir,
+ TRect &dialogSize) :
+ TWindowInit(&TFileDialogHome::initFrame),
+ TFileDialog(aWildCard,aTitle,inputName,aOptions,histId)
+{
+ // ugly:
+ TRect r(35,3,46,5);
+
+ #define shift(flag) if (aOptions & flag) { r.a.y+=2; r.b.y+=2; }
+ shift(fdOpenButton)
+ shift(fdOKButton)
+ shift(fdAddButton)
+ shift(fdReplaceButton)
+ shift(fdClearButton)
+ shift(fdHelpButton)
+ shift(fdSelectButton)
+ r.a.y+=2; r.b.y+=2;
+ #undef shift
+
+ insert(AddButton(r,__("Ho~m~e"),cmHomeDir));
+ insert(AddButton(r,__("~T~ree"),cmChangeDir));
+ if (ConfDiag)
+ insert(AddButton(r,__("O~p~tions"),cmFileOpenOptions));
+ selectNext(False);
+ link=(TInputLine *)current;
+
+ homeDirectory=aHomeDir;
+ flags=aFlags;
+ letHistoryPass=0;
+ selDir=aSelDir;
+
+ if (dialogSize.a.x || dialogSize.b.x)
+ {
+ if (dialogSize.b.x-dialogSize.a.x<49 || dialogSize.b.y-dialogSize.a.y<20)
+ // Avoid using a size smaller than 49x20
+ dialogSize=getBounds();
+ else
+ {
+ changeBounds(dialogSize);
+ options&=~ofCentered;
+ }
+ }
+ else
+ dialogSize=getBounds();
+ returnSize=&dialogSize;
+}
+
+
+char *ChooseDir(const char *startDir)
+{
+ char buf[PATH_MAX],buf2[PATH_MAX];
+
+ if (!getcwd(buf,PATH_MAX) || (startDir && !chdir(startDir)))
+ return NULL;
+
+ TChDirDialog *d=new TChDirDialog(cdNormal | cdHelpButton,0);
+ d->helpCtx=hcGenChDir;
+ unsigned ret=0;
+ TView *p=TProgram::application->validView(d);
+ if (p)
+ {
+ ret=TProgram::deskTop->execView(p);
+ TObject::CLY_destroy(p);
+ }
+ char *retVal=NULL;
+ if (ret==cmOK && getcwd(buf2,PATH_MAX))
+ {
+ if (strcmp(buf,buf2)!=0)
+ {
+ int l=strlen(buf2);
+ if (buf2[l-1]!='/' && l<PATH_MAX-2)
+ {
+ buf2[l]='/';
+ buf2[l+1]=0;
+ }
+ retVal=newStr(buf2);
+ }
+ }
+ chdir(buf);
+ return retVal;
+}
+
+void TFileDialogHome::handleEvent(TEvent& event)
+{
+ char buf[PATH_MAX],buf2[PATH_MAX];
+ char endIt=0,cancelIt=0,advance=1;
+ char *newDir;
+
+ if (event.what==evBroadcast)
+ {
+ if ((event.message.command==cmReleasedFocus && event.message.infoPtr==link)
+ || (event.message.command==cmRecordHistory && !letHistoryPass))
+ {
+ clearEvent(event);
+ return;
+ }
+ if (event.message.command==cmFileDoubleClicked)
+ {
+ event.what=evCommand;
+ event.message.command=cmFileOpen;
+ advance=0;
+ }
+ }
+ if (event.what==evCommand)
+ switch(event.message.command)
+ {
+ case cmHomeDir:
+ DeleteArray(directory);
+ directory=newStr(homeDirectory);
+ fileList->readDirectory(homeDirectory,wildCard);
+ clearEvent(event);
+ return;
+ case cmChangeDir:
+ newDir=ChooseDir(directory);
+ if (newDir)
+ {
+ DeleteArray(directory);
+ directory=newDir;
+ fileList->readDirectory(newDir,wildCard);
+ }
+ clearEvent(event);
+ return;
+ case cmFileOpen:
+ case cmFileReplace:
+ case cmFileClear:
+ case cmFileSelect:
+ if (valid(event.message.command))
+ { // Valid checks the name and change the directory if that's the case
+ if (flags & fdMultipleSel)
+ {// Copy the directory to remmember it
+ strcpy(selDir,directory);
+ getFileName(buf);
+ if (message(TProgram::deskTop,evBroadcast,
+ cmFileDialogFileSelected,buf))
+ {
+ if (advance)
+ {
+ int foc=fileList->focused+1;
+ if (foc<fileList->range)
+ fileList->focusItemNum(foc);
+ }
+ }
+ else
+ endIt=1;
+ }
+ else
+ endIt=1;
+ }
+ if (endIt)
+ {// Copy the directory to remmember it
+ strcpy(selDir,directory);
+ endModal(event.message.command);
+ link->getData(buf);
+ getFileName(buf2);
+ link->setData(buf2);
+ letHistoryPass=1;
+ message(this,evBroadcast,cmRecordHistory,0);
+ letHistoryPass=0;
+ if (strchr(buf,'/')==0)
+ {// If the user entered something that isn't here
+ // don't add this point
+ strcpy(buf2,directory);
+ strcat(buf2,wildCard);
+ link->setData(buf2);
+ event.what=evBroadcast;
+ event.message.command=cmRecordHistory;
+ }
+ else
+ {
+ clearEvent(event);
+ return;
+ }
+ }
+ else
+ {
+ clearEvent(event);
+ return;
+ }
+ break;
+ // If the user aborts also add it to the history, just in case s/he wants to
+ // reuse it.
+ case cmCancel:
+ endModal(event.message.command);
+ link->getData(buf);
+ strcpy(buf2,directory);
+ strcat(buf2,wildCard);
+ link->setData(buf2);
+ event.what=evBroadcast;
+ event.message.command=cmRecordHistory;
+ cancelIt=1;
+ break;
+ // Configuration dialog
+ case cmFileOpenOptions:
+ if (ConfDiag())
+ fileList->readDirectory(directory,wildCard);
+ clearEvent(event);
+ return;
+ /*case cmeZoom:
+ event.message.command=cmZoom;
+ TDialog::handleEvent(event);
+ break;*/
+ }
+ TDialog::handleEvent(event);
+ if (endIt)
+ link->setData(buf);
+ // Store the current size in the rectangle provided by the caller
+ if (endIt || cancelIt)
+ *returnSize=getBounds();
+}
+
+static char *LastMaskUsed=0;
+
+int GenericFileDialog(const char *title, char *file, char *mask, int histID, int buttons,
+ char *dir, unsigned flags, int ctx, TRect &dialogSize)
+{
+ char curDir[PATH_MAX];
+ char dirChanged=0;
+
+ getcwd(curDir,PATH_MAX);
+ strcat(curDir,"/");
+ if (dir[0])
+ {
+ chdir(dir);
+ dirChanged=1;
+ }
+ int fgButtons=buttons | fdHelpButton;
+ // If that's a wildcard the directory will be scanned by setdata, so avoid reading
+ // 2 directories.
+ if ((!mask || !mask[0]) && CLY_IsWild(file))
+ fgButtons|=fdNoLoadDir;
+ TFileDialogHome *d=new TFileDialogHome(mask,title,__("~N~ame"),fgButtons,histID,curDir,
+ flags,dir,dialogSize);
+ d->helpCtx=ctx;
+
+ int result=cmCancel;
+ TView *p=TProgram::application->validView(d);
+ if (p)
+ {
+ if (!mask || !mask[0])
+ p->setData(file);
+
+ result=TProgram::deskTop->execView(p);
+ if (result!=cmCancel)
+ p->getData(file);
+ delete[] LastMaskUsed;
+ LastMaskUsed=newStr(d->wildCard);
+
+ TObject::CLY_destroy(p);
+ }
+
+ if (dirChanged)
+ chdir(curDir);
+ return result;
+}
+
+char *GetLastMaskUsed()
+{
+ char *ret=LastMaskUsed;
+ LastMaskUsed=0;
+ return ret;
+}
+
+void SetConfigDialogFunc(int (*func)())
+{
+ TFileDialogHome::ConfDiag=func;
+}
+/*
+static char *dirForOpen=0;
+static char *dirForSave=0;
+
+int FileOpenDialog(char *title, char *file, int historyID, unsigned flags)
+{
+ if (!dirForOpen)
+ {
+ dirForOpen=new char[PATH_MAX];
+ getcwd(dirForOpen,PATH_MAX);
+ }
+ return GenericFileDialog(title,file,file,historyID,fdOpenButton,dirForOpen,flags,hcGenOpenFile);
+}
+
+int FileSaveDialog(char *title, char *file, int historyID, unsigned flags)
+{
+ if (!dirForSave)
+ {
+ dirForSave=new char[PATH_MAX];
+ getcwd(dirForSave,PATH_MAX);
+ }
+ return GenericFileDialog(title,file,file,historyID,fdOKButton,dirForSave,flags,hcGenOpenFile);
+}
+
+void SetDirForOpen(char *s)
+{
+ if (dirForOpen)
+ delete dirForOpen;
+ dirForOpen=s;
+}
+
+void SetDirForSave(char *s)
+{
+ if (dirForSave)
+ delete dirForSave;
+ dirForSave=s;
+}
+*/
+
diff --git a/setedit/settvuti/fiopeaid.cc b/setedit/settvuti/fiopeaid.cc
new file mode 100644
index 0000000..5cbe2ac
--- /dev/null
+++ b/setedit/settvuti/fiopeaid.cc
@@ -0,0 +1,304 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This module is a very particular case. It belongs to setedit, but is
+used by InfView and the editor class itself, so I created it in the
+library. Why? because IfView needs SetTVUti and the editor class needs
+it too and the standalone editor is in the same situation. So I think
+that's the neutral point.@*
+ The bad thing is that these definitions are dependent of the three at
+the same time. To avoid overheads the buffers are dynamically allocated.
+
+***************************************************************************/
+
+#define Uses_string
+#define Uses_stdlib
+#define Uses_limits
+
+#define Uses_FileOpenAid
+#define Uses_TFileDialog // For the buttons' constants
+#define Uses_fpstream // To save/load the dirs
+#define Uses_TApplication // To get desktop size
+#define Uses_TDeskTop
+#include <settvuti.h>
+#include <editcoma.h>
+
+static
+AsoID Convert[]={
+// Used by the standalone editor to open the files to edit
+{hID_FileOpen,0,0,hcFileOpen,0,0,0,0},
+// Used by the editmenu.cc to store the files under edition
+{hID_FileSave,0,0,hcFileSave,0,0,0,0},
+// Used by InfView to open a .info file
+{hID_OpenInfo,0,0,hcOpenInfo,0,0,0,0},
+// Used by the editor class to store/retreive blocks
+{hID_SaveBlock,0,0,hcSaveBlock,0,0,0,0},
+// Used by the standalone editor to store/retreive configuration files
+{hID_ConfigFiles,0,0,hcConfigFiles,0,0,0,0},
+// Used by the standalone editor to store/retreive project files
+{hID_ProjectFiles,0,0,hcProjectFiles,0,0,0,0},
+// Used by the standalone editor to load MP3 files
+{hID_OpenMP3,0,0,hcOpenMP3,0,0,0,0},
+// Used by the standalone editor to store WAV converted MP3 files
+{hID_SaveMP3,0,0,hcSaveMP3,0,0,0,0},
+// Used by the standalone editor to select TAG files
+{hID_SelectTagFile,0,0,hcSelTagFile,0,0,0,0},
+// Used to import/export the project items
+{hID_ExportProjectItems,0,0,hcExpPrjItems,0,0,0,0},
+// Used by the debugger code to indicate where is a file
+{hID_DbgSourceLoc,0,0,hcSourceLoc,0,0,0,0},
+// File choosers in the debug options
+{hID_DbgGDB,0,0,hcDebugAdvOps,0,0,0,0},
+{hID_DbgXTerm,0,0,hcDebugAdvOps,0,0,0,0},
+{hID_DbgBinary,0,0,hcDebugOps,0,0,0,0},
+{0,0}
+};
+
+
+/**[txh]********************************************************************
+
+ Description:
+ It just deallocates all atexit time.
+
+***************************************************************************/
+
+void DeInitialize(void)
+{
+ int i=0;
+ while (Convert[i].id)
+ {
+ delete[] Convert[i].dir;
+ Convert[i].dir=0;
+ delete[] Convert[i].mask;
+ Convert[i].mask=0;
+ i++;
+ }
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Allocates the directory buffers for each history id used for files.
+
+***************************************************************************/
+
+static
+int Initialize()
+{
+ if (Convert[0].dir==0)
+ {
+ int i=0;
+ while (Convert[i].id)
+ {
+ Convert[i].dir=new char[PATH_MAX];
+ if (!Convert[i].dir)
+ {
+ delete Convert[0].dir;
+ Convert[0].dir=0;
+ break;
+ }
+ else
+ Convert[i].dir[0]=0;
+ i++;
+ }
+ if (Convert[0].dir)
+ atexit(DeInitialize);
+ }
+ return Convert[0].dir==0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Returns the associated directory buffer. It contains the current
+directory for this ID. In case of fail it could return 0.
+
+***************************************************************************/
+
+AsoID *GetFileIDDirBuffer(int id)
+{
+ int i=0;
+
+ Initialize();
+ while (Convert[i].id)
+ {
+ if (Convert[i].id==id)
+ return &Convert[i];
+ i++;
+ }
+ return 0;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Allows to set the current directory for a desired id.
+
+***************************************************************************/
+
+void SetFileIDDirValue(int id, char *dir, char *mask)
+{
+ AsoID *s=GetFileIDDirBuffer(id);
+ if (s)
+ {
+ if (s->dir)
+ strncpy(s->dir,dir,PATH_MAX-1);
+ if (mask)
+ {
+ delete[] s->mask;
+ s->mask=newStr(mask);
+ }
+ }
+}
+
+
+/**[txh]********************************************************************
+
+ Description:
+ Calls to the GenericFileDialog located in fileopen.cc with the directory
+buffer used by the provided id and with the buttons according to the flags.
+
+***************************************************************************/
+
+int GenericFileDialog(const char *title, char *file, char *mask, int id, unsigned flags)
+{
+ char *dir=0;
+ int buttons=0,ctx;
+ AsoID *aso;
+
+ aso=GetFileIDDirBuffer(id);
+ if (!aso)
+ return cmCancel;
+ if (aso)
+ {
+ dir=aso->dir;
+ ctx=aso->helpCtx;
+ if (aso->mask && !(flags & fdNoMask))
+ mask=aso->mask;
+ }
+ if (Initialize() || !dir)
+ return cmCancel;
+
+ if (flags & fdSelectButton)
+ buttons|=fdSelectButton;
+ else
+ if (flags & fdAddButton)
+ buttons|=fdAddButton;
+ else
+ if (flags & (fdDialogForSave | fdMultipleSel))
+ buttons|=fdOKButton;
+ else
+ buttons|=fdOpenButton;
+
+ if (flags & fdMultipleSel)
+ buttons|=fdDoneButton;
+
+ if (!mask)
+ mask=file;
+
+ TRect r(0,0,0,0);
+ TRect dsz=TApplication::deskTop->getExtent();
+ if (aso->ax || aso->bx)
+ {// Size isn't the default
+ // Scale down to the desktop size
+ double scale=(dsz.b.x-dsz.a.x)/2e9;
+ r.a.x=int(aso->ax*scale+0.5);
+ r.b.x=int(aso->bx*scale+0.5);
+ scale=(dsz.b.y-dsz.a.y)/2e9;
+ r.a.y=int(aso->ay*scale+0.5);
+ r.b.y=int(aso->by*scale+0.5);
+ }
+ //printf("Antes %d;%d %d;%d\n",r.a.x,r.a.y,r.b.x,r.b.y);
+ int ret=GenericFileDialog(title,file,mask,id,buttons,dir,flags,ctx,r);
+ //printf("Despus %d;%d %d;%d\n",r.a.x,r.a.y,r.b.x,r.b.y);
+ // Store the size abstracting the desktop size
+ double scale=2e9/(dsz.b.x-dsz.a.x);
+ aso->ax=int(r.a.x*scale+0.5);
+ aso->bx=int(r.b.x*scale+0.5);
+ scale=2e9/(dsz.b.y-dsz.a.y);
+ aso->ay=int(r.a.y*scale+0.5);
+ aso->by=int(r.b.y*scale+0.5);
+
+ delete[] aso->mask;
+ aso->mask=GetLastMaskUsed();
+
+ return ret;
+}
+
+const int Version=3;
+
+void SaveFileIDDirs(fpstream &s)
+{
+ int i=0;
+ char *p;
+
+ s << -Version; // #@#!! I did it again :-(
+ while (Convert[i].id)
+ {
+ s << Convert[i].id;
+ p=Convert[i].dir;
+ if (p)
+ s.writeString(p);
+ else
+ s.writeString("");
+ p=Convert[i].mask;
+ if (p)
+ s.writeString(p);
+ else
+ s.writeString("");
+ s << (int32)Convert[i].ax << (int32)Convert[i].ay <<
+ (int32)Convert[i].bx << (int32)Convert[i].by;
+ i++;
+ }
+ s << 0;
+}
+
+void LoadFileIDDirs(fpstream &s, Boolean isLocal)
+{
+ int i,version=1;
+ char aux[PATH_MAX];
+
+ s >> i;
+ if (i<0)
+ {
+ version=-i;
+ s >> i;
+ }
+ do
+ {
+ if (i)
+ {
+ AsoID *p=GetFileIDDirBuffer(i);
+ // isLocal means the desktop file belongs to a project or the
+ // current directory, in this case we can use the directories
+ // but if that's a default desktop file we can't.
+ if (p && p->dir && isLocal)
+ {
+ s.readString(p->dir,PATH_MAX);
+ delete[] p->mask;
+ if (version>1)
+ p->mask=s.readString();
+ else
+ p->mask=0;
+ }
+ else
+ {
+ s.readString(aux,PATH_MAX);
+ if (version>1)
+ s.readString(aux,PATH_MAX);
+ }
+ if (version>=3)
+ {
+ int32 aux;
+ s >> aux; p->ax=aux;
+ s >> aux; p->ay=aux;
+ s >> aux; p->bx=aux;
+ s >> aux; p->by=aux;
+ }
+ }
+ s >> i;
+ }
+ while (i);
+}
diff --git a/setedit/settvuti/include/diaghelp.h b/setedit/settvuti/include/diaghelp.h
new file mode 100644
index 0000000..3e8850b
--- /dev/null
+++ b/setedit/settvuti/include/diaghelp.h
@@ -0,0 +1,20 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+class TDialog;
+ushort execDialogNoDestroy(TDialog *d, void *data, char &lSet);
+void AddOKCancel(TDialog *d);
+ushort messageBoxDSA(const char *msg, ushort aOptions, char *var, ushort defComm);
+ushort messageBoxDSA(const char *msg, ushort aOptions, char *var,
+ unsigned mask, ushort defComm);
+int GetDeskTopCols();
+int GetDeskTopRows();
+TRect GetDeskTopSize();
+
+extern __inline__
+void MoveRectBut(TRect &r,int len,int sep)
+{
+ r.a.x=r.b.x+sep;
+ r.b.x=r.a.x+len;
+}
+
+#define Destroy(p) { CLY_destroy(p); p=0; }
diff --git a/setedit/settvuti/include/dktclock.h b/setedit/settvuti/include/dktclock.h
new file mode 100644
index 0000000..994abac
--- /dev/null
+++ b/setedit/settvuti/include/dktclock.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TDeskTopClock) && !defined( __TDeskTopClock__ )
+#define __TDeskTopClock__
+
+class TDeskTopClock : public TView
+{
+public:
+ TDeskTopClock(const TRect & r);
+ void update(void);
+ virtual void draw();
+ static int mode; // 1 => 24hs 0 => AM/PM
+
+protected:
+ time_t curTime;
+ char putSeparator;
+};
+#endif
diff --git a/setedit/settvuti/include/edhists.h b/setedit/settvuti/include/edhists.h
new file mode 100644
index 0000000..e853771
--- /dev/null
+++ b/setedit/settvuti/include/edhists.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef EDHISTS_H_INCLUDED
+#define EDHISTS_H_INCLUDED
+/* Here I define the history IDs for the editor.
+ I start from 120 to avoid any conflict even when RHIDE workarounds it. */
+
+const int
+hID_Start = 120,
+hID_Cant = 36;
+
+const int
+hID_TextSearchEditor = hID_Start,
+hID_TextReplaceEditor = hID_Start+1,
+hID_TCalcDialogExp = hID_Start+2,
+hID_TextSearchInf = hID_Start+3,
+hID_GotoInf = hID_Start+4,
+hID_FileOpen = hID_Start+5,
+hID_OpenInfo = hID_Start+6,
+hID_SaveBlock = hID_Start+7,
+hID_GrepFiles = hID_Start+8,
+hID_GrepPlaces = hID_Start+9,
+hID_FileSave = hID_Start+10,
+hID_ConfigFiles = hID_Start+11,
+hID_ProjectFiles = hID_Start+12,
+hID_OpenMP3 = hID_Start+13,
+hID_SaveMP3 = hID_Start+14,
+hID_GotoLine = hID_Start+15,
+hID_sLispMacros = hID_Start+16,
+hID_SelectTagFile = hID_Start+17,
+hID_ExportProjectItems= hID_Start+18,
+hID_sLispKeyCode = hID_Start+19,
+hID_ArbitraryIndent = hID_Start+20,
+hID_RunProgram = hID_Start+21,
+hID_DbgEvalModifyExp = hID_Start+22,
+hID_DbgEvalModifyNewV = hID_Start+23,
+hID_DbgBkFilename = hID_Start+24,
+hID_DbgBkFunction = hID_Start+25,
+hID_DbgBkLine = hID_Start+26,
+hID_DbgBkAddress = hID_Start+27,
+hID_DbgBkCondition = hID_Start+28,
+hID_DbgBkCount = hID_Start+29,
+hID_DbgBkThread = hID_Start+30,
+hID_DbgCommand = hID_Start+31,
+hID_DbgGDB = hID_Start+32,
+hID_DbgXTerm = hID_Start+33,
+hID_DbgMainFunc = hID_Start+34,
+hID_DbgSourceLoc = hID_Start+35,
+hID_DbgBinary = hID_Start+36;
+#endif
diff --git a/setedit/settvuti/include/fileopen.h b/setedit/settvuti/include/fileopen.h
new file mode 100644
index 0000000..3765d3e
--- /dev/null
+++ b/setedit/settvuti/include/fileopen.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef FILEOPEN_H_INCLUDED
+#define FILEOPEN_H_INCLUDED
+extern int GenericFileDialog(const char *title, char *file, char *mask, int histID,
+ int buttons, char *dir, unsigned flags, int ctx,
+ TRect &r);
+extern int FileOpenDialog(char *title, char *file, int historyID,
+ unsigned flags=0);
+extern int FileSaveDialog(char *title, char *file, int historyID,
+ unsigned flags=0);
+extern void SetDirForOpen(char *s);
+extern void SetDirForSave(char *s);
+extern char *GetLastMaskUsed();
+extern void SetConfigDialogFunc(int (*func)());
+extern char *ChooseDir(const char *startDir=NULL);
+
+const int cmFileDialogFileSelected=0x2210;
+const int cmHomeDir=0x2211;
+const int cmFileOpenOptions=0x2212;
+const int
+hcGenOpenFile =0x220F,
+hcFileOpen =0x2210,
+hcFileSave =0x2211,
+hcOpenInfo =0x2212,
+hcSaveBlock =0x2213,
+hcConfigFiles =0x2214,
+hcProjectFiles=0x2215,
+hcOpenMP3 =0x2216,
+hcSaveMP3 =0x2217,
+hcGenChDir =0x2218,
+hcSelTagFile =0x2219,
+hcExpPrjItems =0x221A;
+
+// This flag allows to select various files without living the dialog
+const unsigned fdMultipleSel=0x10000,fdDialogForSave=0x80000000;
+const unsigned fdNoMask =0x20000;
+#endif
diff --git a/setedit/settvuti/include/fiopeaid.h b/setedit/settvuti/include/fiopeaid.h
new file mode 100644
index 0000000..26db222
--- /dev/null
+++ b/setedit/settvuti/include/fiopeaid.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#ifndef FIOPEAID_H__
+#define FIOPEAID_H__
+class fpstream;
+
+typedef struct
+{
+ int id;
+ char *dir;
+ char *mask;
+ int helpCtx;
+ int ax,ay,bx,by;
+} AsoID;
+
+AsoID *GetFileIDDirBuffer(int id);
+void SetFileIDDirValue(int id, char *dir, char *mask=0);
+int GenericFileDialog(const char *title, char *file, char *mask, int id, unsigned flags=0);
+void LoadFileIDDirs(fpstream &s, Boolean isLocal);
+void SaveFileIDDirs(fpstream &s);
+
+#endif
diff --git a/setedit/settvuti/include/inputsca.h b/setedit/settvuti/include/inputsca.h
new file mode 100644
index 0000000..04c5dd4
--- /dev/null
+++ b/setedit/settvuti/include/inputsca.h
@@ -0,0 +1,68 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/* ---------------------------------------------------------------------- */
+/* class TInputScanKey */
+/* */
+/* Palette layout */
+/* 1 = Passive */
+/* 2 = Active */
+/* 3 = Selected */
+/* 4 = Arrows */
+/* ---------------------------------------------------------------------- */
+
+#if defined( Uses_TInputScanKey ) && !defined( __TInputScanKey )
+#define __TInputScanKey
+
+class TRect;
+class TEvent;
+
+class TInputScanKey : public TView
+{
+
+public:
+
+ TInputScanKey(const TPoint& pos);
+ ~TInputScanKey();
+
+ virtual uint32 dataSize();
+ virtual void draw();
+ virtual void getData( void *rec );
+ virtual TPalette& getPalette() const;
+ virtual void handleEvent( TEvent& event );
+ virtual void setData( void *rec );
+
+ unsigned char Scan,Ascii;
+
+private:
+
+#if !defined( NO_STREAM )
+ virtual const char *streamableName() const
+ { return name; }
+
+protected:
+
+ TInputScanKey( StreamableInit );
+ virtual void write( opstream& );
+ virtual void *read( ipstream& );
+
+public:
+
+ static const char * const name;
+ static TStreamable *build();
+#endif // NO_STREAM
+};
+
+#if !defined( NO_STREAM )
+inline ipstream& operator >> ( ipstream& is, TInputScanKey& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TInputScanKey*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TInputScanKey& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TInputScanKey* cl )
+ { return os << (TStreamable *)cl; }
+#endif // NO_STREAM
+
+#endif // Uses_TInputScanKey
+
diff --git a/setedit/settvuti/include/nostatex.h b/setedit/settvuti/include/nostatex.h
new file mode 100644
index 0000000..727484e
--- /dev/null
+++ b/setedit/settvuti/include/nostatex.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TNoStaticText) && !defined(__TNoStaticText_Defined__)
+#define __TNoStaticText_Defined__
+
+class TNoStaticText : public TStaticText
+{
+public:
+ TNoStaticText(const TRect& bounds, const char *aText);
+ TNoStaticText(const TRect& bounds, const char *aText, stTVIntl *cache);
+ void setText(const char *s);
+ int getStartLen() { return startLen; };
+
+protected:
+ int startLen;
+};
+
+#endif
diff --git a/setedit/settvuti/include/sarray.cc b/setedit/settvuti/include/sarray.cc
new file mode 100644
index 0000000..53e0691
--- /dev/null
+++ b/setedit/settvuti/include/sarray.cc
@@ -0,0 +1,63 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Class: TSArray<T>
+ Comments:
+ I'm just playing with templates, that's my array. I think the way GCC
+implements templates sucks (sorry for the language). They are just a kind
+of macros wothout any kind of intelligence. GCC can't detect automatically
+where to create an instance of the template and ones he created one is
+unable to inline things.@p
+ This .cc file is an include for the instances of the class so is in the
+include dir.
+
+***************************************************************************/
+
+#include <stdlib.h>
+
+// All here and not in the class because GCC can't inline template members,
+// that's a real pain!
+
+template <class T>
+TSArray<T>::TSArray(int initSize, int aDelta) :
+ curSize(initSize),
+ delta(aDelta)
+{
+ array=(T *)malloc(sizeof(T)*initSize);
+}
+
+template <class T>
+TSArray<T>::~TSArray()
+{
+ free(array);
+}
+
+template <class T>
+void TSArray<T>::resize(int i)
+{
+ if (i<curSize)
+ return;
+ do
+ {
+ curSize+=delta;
+ }
+ while (curSize<=i);
+ array=(T *)realloc(array,sizeof(T)*curSize);
+}
+
+// GCC can't inline it!
+template <class T>
+T& TSArray<T>::operator()(int i)
+{
+ return array[i];
+}
+
+template <class T>
+T& TSArray<T>::operator[](int i)
+{
+ if (i>=curSize)
+ resize(i);
+ return array[i];
+}
+
diff --git a/setedit/settvuti/include/sarray.h b/setedit/settvuti/include/sarray.h
new file mode 100644
index 0000000..209f698
--- /dev/null
+++ b/setedit/settvuti/include/sarray.h
@@ -0,0 +1,21 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TSArray_Def) && !defined(__Uses_TSArray_Def__)
+#define __Uses_TSArray_Def__
+template <class T>
+class TSArray
+{
+public:
+ TSArray(int initSize, int aDelta);
+ ~TSArray();
+
+ void resize(int i);
+ T& operator[](int i);
+ T& operator()(int i);
+
+private:
+ T *array;
+ int curSize;
+ int delta;
+};
+#endif
diff --git a/setedit/settvuti/include/setstack.h b/setedit/settvuti/include/setstack.h
new file mode 100644
index 0000000..c4ca574
--- /dev/null
+++ b/setedit/settvuti/include/setstack.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ (c) 1997 by SET
+ Header for setstack.cc, read the other file for information.
+
+*****************************************************************************/
+
+#if defined(Uses_SOStack)
+
+#ifndef __SET_SOStack_H__
+#define __SET_SOStack_H__
+
+const int stkInitialMemPool=976;
+
+typedef size_t stkHandler;
+const size_t stkNULL=0xFFFFFFFF;
+
+class SOStack
+{
+ public:
+
+ SOStack();
+ ~SOStack();
+
+ void Clean(void);
+ stkHandler add(void *p, size_t size) { return AddItem(p,size,MakeRoomFor(size)); };
+ stkHandler alloc(size_t size) { return AddEmptyItem(MakeRoomFor(size)); };
+ stkHandler addStr(char *s);
+ void *GetTop();
+ stkHandler GetTopHandle();
+ stkHandler GetPreviousOf(stkHandler pos);
+ void *GetItemNumber(unsigned index);
+ char *GetStrNumber(unsigned index) { return (char *)GetItemNumber(index); };
+ void DestroyTop(int shrink=0);
+ void *GetPointerOf(stkHandler h) { return (void *)(Buffer+h); };
+ char *GetStrOf(stkHandler h) { return (char *)(Buffer+h); };
+
+ char *Buffer;
+
+ private:
+ size_t MemPool;
+ size_t Size;
+ size_t LastChunk;
+ unsigned Cant;
+
+ size_t MakeRoomFor(size_t bytes);
+ stkHandler AddItem(void *p, size_t size, size_t req);
+ stkHandler AddEmptyItem(size_t req);
+};
+
+#endif // __SET_SOStack_H__
+
+#endif // Uses_SOStack
+
diff --git a/setedit/settvuti/include/settvuti.h b/setedit/settvuti/include/settvuti.h
new file mode 100644
index 0000000..ff48b97
--- /dev/null
+++ b/setedit/settvuti/include/settvuti.h
@@ -0,0 +1,273 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ (c) 1997-1998 by SET
+
+ See the individual headers for details.
+
+*****************************************************************************/
+
+#ifdef Uses_TStreamableClass
+#define _INCL_TVSETUTI
+#endif
+
+#ifdef Uses_TDialogAID
+#define Uses_TGrowDialog
+#define Uses_TStringableListBox
+#define Uses_TScrollBar
+#define _INCL_TDIAGAID
+#endif
+
+#ifdef Uses_TNoCaseStringCollection
+#define _INCL_TNOCASTC
+#define _INCL_STRING
+#define _INCL_TVSETUTI
+#define Uses_TStringCollection
+#define Uses_string
+#endif
+
+#ifdef Uses_TStringCollectionW
+#define _INCL_TVSETUTI
+#define _INCL_TNOCASTC
+#define Uses_TStringCollection
+#endif
+
+#ifdef Uses_TNoSortedStringCollection
+#define _INCL_TNOSOSTR
+#define _INCL_TVSETUTI
+#define Uses_TStringCollection
+#endif
+
+#ifdef Uses_TNoCaseNoOwnerStringCollection
+#define _INCL_TNOCASTC
+#define _INCL_STRING
+#define Uses_TStringCollection
+#define Uses_string
+#endif
+
+#ifdef Uses_TSOSStringCollection
+#define Uses_TNoCaseSOSStringCollection
+#endif
+
+#ifdef Uses_TNoCaseSOSStringCollection
+#define _INCL_TNOCASTC
+#define Uses_SOStack
+#define Uses_TStringCollection
+#endif
+
+#ifdef Uses_TSOSSortedListBox
+#define _INCL_TNOCASTC
+#define Uses_SOStack
+#define Uses_TSortedListBox
+#endif
+
+#ifdef Uses_TGrowDialog
+#define _INCL_TDIAGROW
+#define Uses_TDialog
+#define Uses_TWindowInit
+#endif
+
+#ifdef Uses_TViewPlus
+#define _INCL_VIEWPLUS
+#define Uses_TView
+#endif
+
+#ifdef Uses_TInputLinePiped
+#define _INCL_TINPPIPE
+#define Uses_TInputLine
+#endif
+
+#ifdef Uses_TInputLinePipedConst
+#define _INCL_TINPPIPE
+#endif
+
+#ifdef Uses_TNSSOSCol
+#define _INCL_TNOCASTC
+#define Uses_SOStack
+#define Uses_TNSCollection
+#endif
+
+#ifdef Uses_TSOSCol
+#define _INCL_TNOCASTC
+#define Uses_SOStack
+#define Uses_TCollection
+#endif
+
+#ifdef Uses_TSArray_Dec
+#define Uses_TSArray_Def
+#define _INCL_SARRAY_CC
+#define _INCL_STDLIB
+#endif
+
+#ifdef Uses_TSArray_Def
+#define _INCL_SARRAY_H
+#endif
+
+#ifdef Uses_TInputScanKey
+#define Uses_TView
+#define Uses_TRect
+#define _INCL_INPUTSCAN_H
+#endif
+
+#ifdef Uses_TStringableListBox
+#define Uses_TListViewer
+#define Uses_TStringable
+#define _INCL_TSTRLBOX_H
+#endif
+
+#ifdef Uses_TStringable
+#define _INCL_TSTRINGA_H
+#endif
+
+#ifdef Uses_TDeskTopClock
+#define Uses_TView
+#define _INCL_DKTCLOCK_H
+#define _INCL_TIME
+#endif
+
+#ifdef Uses_FileOpenAid
+#define Uses_GenericFileDialog
+#define _INCL_HISTS_H
+#define _INCL_FIOPEAID_H
+#endif
+
+#ifdef Uses_GenericFileDialog
+#define _INCL_FILEOPEN_H
+#endif
+
+#ifdef Uses_TProgressBar
+#define _INCL_TPROGBAR_H
+#define _INCL_TVSETUTI
+#define Uses_TView
+#define Uses_TRect
+#endif
+
+#ifdef Uses_TProgress
+#define _INCL_TPROGRES_H
+#define _INCL_TVSETUTI
+#define Uses_TView
+#define Uses_TRect
+#endif
+
+#ifdef Uses_ProgBar
+#define _INCL_TPROBDIA_H
+#endif
+
+#ifdef Uses_Progress
+#define _INCL_TPROGRES_H
+#endif
+
+#ifdef Uses_TNoStaticText
+#define INCL_NOSTATEX
+#define Uses_TStaticText
+#endif
+
+#ifdef Uses_SOStack
+#define _INCL_SETSTACK
+#define _INCL_STDLIB
+#endif
+
+#ifdef _INCL_STDLIB
+#define Uses_stdlib
+#endif
+
+#ifdef _INCL_TIME
+#define Uses_time
+#endif
+
+#include <tv.h>
+
+extern char *strncpyZ(char *dest, const char *orig, int size);
+
+#ifdef INCL_NOSTATEX
+#include <nostatex.h>
+#endif
+
+#ifdef _INCL_TPROBDIA_H
+#include <tprogdia.h>
+#endif
+
+#ifdef _INCL_TPROGRES_H
+#include <tprogrdi.h>
+#endif
+
+#ifdef _INCL_TVSETUTI
+#include <tvsetuti.h>
+#endif
+
+#ifdef _INCL_TPROGBAR_H
+#include <tprogbar.h>
+#endif
+
+#ifdef _INCL_TPROGRES_H
+#include <tprogres.h>
+#endif
+
+#ifdef _INCL_FILEOPEN_H
+#include <fileopen.h>
+#endif
+
+#ifdef _INCL_HISTS_H
+#include <edhists.h>
+#endif
+
+#ifdef _INCL_FIOPEAID_H
+#include <fiopeaid.h>
+#endif
+
+#ifdef _INCL_DKTCLOCK_H
+#include <dktclock.h>
+#endif
+
+#ifdef _INCL_TSTRINGA_H
+#include <tstringa.h>
+#endif
+
+#ifdef _INCL_TSTRLBOX_H
+#include <tstrlbox.h>
+#endif
+
+#ifdef _INCL_INPUTSCAN_H
+#include <inputsca.h>
+#endif
+
+#ifdef _INCL_SARRAY_H
+#include <sarray.h>
+#endif
+
+#ifdef _INCL_SARRAY_CC
+#include <sarray.cc>
+#endif
+
+#ifdef _INCL_TINPPIPE
+#include <tinppipe.h>
+#endif
+
+#ifdef _INCL_SETSTACK
+#ifndef __SET_SOStack_H__
+#include <setstack.h>
+#endif
+#endif
+
+#ifdef _INCL_TDIAGROW
+#include <tdiagrow.h>
+#endif
+
+#ifdef _INCL_TNOCASTC
+#include <tnocastc.h>
+#endif
+
+#ifdef _INCL_TNOSOSTR
+#include <tnosostr.h>
+#endif
+
+#ifdef _INCL_VIEWPLUS
+#include <viewplus.h>
+#endif
+
+#ifdef _INCL_TDIAGAID
+#include <tdiagaid.h>
+#endif
+
+
diff --git a/setedit/settvuti/include/tdiagaid.h b/setedit/settvuti/include/tdiagaid.h
new file mode 100644
index 0000000..03a3d55
--- /dev/null
+++ b/setedit/settvuti/include/tdiagaid.h
@@ -0,0 +1,65 @@
+/* Copyright (C) 1996-2004 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TDialogAID) && !defined(__TDialogAID__)
+#define __TDialogAID__
+
+class TNoStaticText;
+class TDialogAID : public TGrowDialog
+{
+public:
+ TDialogAID(const TRect& bounds, const char *aTitle,
+ TStringableListBox *slb);
+ virtual void handleEvent(TEvent& event);
+ int (*AddAction)(void);
+ int (*InsAction)(int);
+ int (*DelAction)(int);
+ int (*OkAction)(void);
+ int (*CancelAction)(void);
+ int (*InfoAction)(int);
+ int (*BrowseAction)(void);
+ TStringableListBox *List;
+ unsigned flags;
+ TNoStaticText *nst;
+};
+
+const int
+ cmAddKey =0x2240,
+ cmDeleteKey =0x2241,
+ cmInsertKey =0x2242,
+ cmAddCommand =0x2243,
+ cmAddMacro =0x2244,
+ cmOKApply =0x2245,
+ cmCancelApply=0x2246,
+ cmInfoAID =0x2247,
+ cmBrowseAID =0x2248;
+const int aidInsert=1, aidComMac=2, aidOKEnabled=4, aidInfo=8, aidBrowse=16;
+// For CreateChooseDialog
+const int aidStringable=0x1000,aidHzScroll=0x2000,aidNoCancel=0x4000;
+// Special field for key sequence
+const int aidAssignedTo=0x10000;
+
+#if 1
+// Ugh! nasty, no? Fix me ... some day
+#define Uses_SETAppConst
+#include <../../setedit/include/setapp.h>
+#else
+#define cmeZoom cmZoom
+#endif
+
+// Used to create the dialogs
+TDialogAID *CreateAddInsDelDialog(int x, int y, const char *name, int h, int w,
+ int flags);
+TDialog *CreateChooseDialog(int x, int y, const char *name, int h, int w,
+ unsigned options=0);
+
+// Just handles cmeZoom
+class TGrowDialogZ : public TGrowDialog
+{
+public:
+ TGrowDialogZ( TRect r, const char *name, int extraOptions=0 ) :
+ TWindowInit( &TGrowDialogZ::initFrame ),
+ TGrowDialog(r,name,extraOptions) {};
+ void handleEvent(TEvent& event);
+};
+
+#endif
diff --git a/setedit/settvuti/include/tdiagrow.h b/setedit/settvuti/include/tdiagrow.h
new file mode 100644
index 0000000..74f86dc
--- /dev/null
+++ b/setedit/settvuti/include/tdiagrow.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Class TGrowDialog
+
+*****************************************************************************/
+
+#if defined(Uses_TGrowDialog) && !defined(__TGrowDialog__)
+#define __TGrowDialog__
+
+class TGrowDialog : public TDialog
+{
+ public:
+
+ TGrowDialog( TRect r, const char *name, int extraOptions=0 ) :
+ TWindowInit( &TGrowDialog::initFrame ),
+ TDialog(r,name)
+ {
+ growMode = gfGrowAll;
+ flags |= wfGrow | wfZoom;
+ options |= extraOptions;
+ minSize = r.b-r.a;
+ };
+ void sizeLimits(TPoint& min, TPoint& max);
+
+ TPoint minSize;
+};
+
+const int gfMoveBottomCorner = gfGrowHiX | gfGrowHiY;
+const int gfMoveAccording = gfGrowAll;
+
+#endif // defined(Uses_TGrowDialog) && !defined(__TGrowDialog__)
+
diff --git a/setedit/settvuti/include/tinppipe.h b/setedit/settvuti/include/tinppipe.h
new file mode 100644
index 0000000..3c27f28
--- /dev/null
+++ b/setedit/settvuti/include/tinppipe.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TInputLinePiped) && !defined(__SET_TInputLinePiped_H__)
+#define __SET_TInputLinePiped_H__
+#define Uses_TInputLinePipedConst
+
+class TCEditWindow;
+
+class TInputLinePiped : public TInputLine
+{
+public:
+ TInputLinePiped( const TRect& bounds, int aMaxLen, unsigned flags=0 );
+
+ // New members virtual to allow override
+ virtual int PipeLine(unsigned pos);
+ virtual void CopyToClip(void);
+ virtual void CopyFromClip(void);
+ virtual void CopyToClipOS(void);
+ virtual void CopyFromClipOS(void);
+ // Replacements
+ virtual void handleEvent( TEvent& event );
+ virtual void setState(uint16 aState,Boolean enable);
+
+ unsigned mFlags;
+};
+
+#endif
+
+#if defined(Uses_TInputLinePipedConst) && !defined(__SET_TInputLinePipedConst_H__)
+#define __SET_TInputLinePipedConst_H__
+const int cmtilCopy = 0x2230;
+const int cmtilPaste = 0x2231;
+const int cmtilCopyOS = 0x2232;
+const int cmtilPasteOS= 0x2233;
+const int tilpNoPipe=1,tilpNoCopy=2,tilpNoPaste=4;
+#endif
+
diff --git a/setedit/settvuti/include/tnocastc.h b/setedit/settvuti/include/tnocastc.h
new file mode 100644
index 0000000..d9f8359
--- /dev/null
+++ b/setedit/settvuti/include/tnocastc.h
@@ -0,0 +1,286 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*****************************************************************************
+
+ Class: TStringCollectionW
+
+ Description: A simple string collection that can be used for streams.
+
+ Class: TNoCaseStringCollection
+
+ Description: Is a TStringCollection but no case sensintive.
+
+ Class: TNoCaseNoOwnerStringCollection
+
+ Description: Is a TStringCollection but no case sensintive, and isn't
+ the owner ship, is used when the item MUST NOT be free.
+
+ Class: TNoCaseSOSStringCollection
+
+ Description: Is like TNoCaseNoOwnerStringCollection but the inserted
+ values are stkHandlers instead of pointers.
+
+ by SET
+
+*****************************************************************************/
+
+
+#if defined(Uses_TStringCollectionW) && !defined(__TStringCollectionW__)
+#define __TStringCollectionW__
+
+class TStringCollectionW : public TStringCollection
+{
+public:
+
+ TStringCollectionW(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) {};
+
+ SetDefStreamMembers(TStringCollectionW,TStringCollection)
+};
+
+SetDefStreamOperators(TStringCollectionW)
+
+#endif
+
+#if defined(Uses_TNoCaseStringCollection) && !defined(__TNoCaseStringCollection__)
+#define __TNoCaseStringCollection__
+
+class TNoCaseStringCollection : public TStringCollection
+{
+public:
+
+ TNoCaseStringCollection(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) {};
+ int compare(void *s1,void *s2) { return strcasecmp((char *)s1,(char *)s2); };
+
+ SetDefStreamMembers(TNoCaseStringCollection,TStringCollection)
+};
+
+SetDefStreamOperators(TNoCaseStringCollection)
+
+#endif
+
+
+#if defined(Uses_TNoCaseNoOwnerStringCollection) && \
+ !defined(__TNoCaseNoOwnerStringCollection__)
+#define __TNoCaseNoOwnerStringCollection__
+
+class TNoCaseNoOwnerStringCollection : public TStringCollection
+{
+public:
+ TNoCaseNoOwnerStringCollection(ccIndex aLimit, ccIndex aDelta) :
+ TStringCollection(aLimit,aDelta) {};
+ int compare(void *s1,void *s2) { return strcasecmp((char *)s1,(char *)s2); };
+ void freeItem(void *) {};
+};
+
+#endif
+
+#if defined(Uses_TNoCaseSOSStringCollection) && \
+ !defined(__TNoCaseSOSStringCollection__)
+#define __TNoCaseSOSStringCollection__
+
+class TNoCaseSOSStringCollection : public TStringCollection
+{
+public:
+ TNoCaseSOSStringCollection(ccIndex aLimit, ccIndex aDelta, SOStack *stk) :
+ TStringCollection(aLimit,aDelta)
+ { stkL=stk; };
+ int compare(void *s1,void *s2);
+ void freeItem(void *) {};
+ Boolean Search( char *key, ccIndex& index );
+ Boolean SearchCase( char *key, ccIndex& index );
+ void insert(stkHandler h) { TStringCollection::insert((void *)h); };
+ char *atStr(ccIndex index) { return GetString(at(index)); };
+ virtual char *GetString( void *h );
+ SOStack *stkL;
+};
+
+#endif
+
+#if defined(Uses_TSOSStringCollection) && \
+ !defined(__TSOSStringCollection__)
+#define __TSOSStringCollection__
+
+class TSOSStringCollection : public TNoCaseSOSStringCollection
+{
+public:
+ TSOSStringCollection(ccIndex aLimit, ccIndex aDelta, SOStack *stk) :
+ TNoCaseSOSStringCollection(aLimit,aDelta,stk) {};
+ Boolean SearchCase( char *key, ccIndex& index );
+ int compare(void *s1,void *s2);
+};
+
+#endif
+
+#if defined(Uses_TNCSAssociative) && \
+ !defined(__TNCSAssociative__)
+#define __TNCSAssociative__
+
+typedef struct
+{
+ stkHandler h; // Handler to the name of the element
+ stkHandler Cont; // Handler to the content of the element
+ TNoCaseSOSStringCollection *c; // Associated list
+} stNCSAssociative;
+
+class TNCSAssociative : public TNoCaseSOSStringCollection
+{
+public:
+ TNCSAssociative(ccIndex aLimit, ccIndex aDelta, SOStack *stk) :
+ TNoCaseSOSStringCollection(aLimit,aDelta,stk) {};
+ void freeItem(void *s);
+ void insert(char *s, stkHandler hv);
+ TNoCaseSOSStringCollection *atCol(ccIndex index);
+ virtual char *GetString( void *h );
+ void SetContent(char *s, char *cont);
+ char *GetContent(ccIndex index);
+};
+
+#endif
+
+
+#if defined(Uses_TSOSSortedListBox) && !defined(__TSOSSortedListBox__)
+#define __TSOSSortedListBox__
+
+class TSOSSortedListBox : public TSortedListBox
+{
+ public:
+ TSOSSortedListBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aScrollBar) :
+ TSortedListBox(bounds,aNumCols,aScrollBar)
+ { SearchPos=USHRT_MAX; ShiftState=0; };
+ TSOSSortedListBox(const TRect& bounds, ushort aNumCols,
+ TScrollBar *aHScrollBar,TScrollBar *aVScrollBar,
+ Boolean aCenterOps=False) :
+ TSortedListBox(bounds,aNumCols,aHScrollBar,aVScrollBar,aCenterOps)
+ { SearchPos=USHRT_MAX; ShiftState=0; };
+ void getText(char *dest, ccIndex item, short maxLen);
+ void handleEvent(TEvent& event);
+
+ private:
+ ushort SearchPos;
+ int ShiftState;
+};
+
+#endif
+
+#if defined(Uses_TSOSListBox) && !defined(__TSOSListBox__)
+#define __TSOSListBox__
+
+class TSOSListBox : public TListBox
+{
+ public:
+ TSOSListBox(const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar) :
+ TListBox(bounds,aNumCols,aScrollBar) {};
+ void getText(char *dest, ccIndex item, short maxLen);
+};
+
+#endif
+
+#if defined(Uses_TNSSOSCol) && \
+ !defined(__TNSSOSCol__)
+#define __TNSSOSCol__
+
+class TNSSOSCol : public TNSCollection
+{
+public:
+ TNSSOSCol(ccIndex aLimit, ccIndex aDelta, SOStack *stk) :
+ TNSCollection(aLimit,aDelta)
+ { stkL=stk; };
+ void freeItem(void *) {};
+ void insert(stkHandler h) { TNSCollection::insert((void *)h); };
+ char *atStr(ccIndex index) { return GetString(at(index)); };
+ virtual char *GetString( void *h );
+ SOStack *stkL;
+};
+
+#endif
+
+#if defined(Uses_TSOSCol) && \
+ !defined(__TSOSCol__)
+#define __TSOSCol__
+
+class TSOSCol : public TCollection
+{
+public:
+ TSOSCol(ccIndex aLimit, ccIndex aDelta, SOStack *stk) :
+ TCollection(aLimit,aDelta)
+ { stkL=stk; };
+ void freeItem(void *) {};
+ void insert(stkHandler h) { TNSCollection::insert((void *)h); };
+ char *atStr(ccIndex index) { return GetString(at(index)); };
+ virtual char *GetString( void *h );
+ SOStack *stkL;
+ virtual void *readItem(ipstream &) { return NULL; };
+ virtual void writeItem(void *,opstream &) {};
+};
+
+/*
+class TSOSCollection : public virtual TCollection
+{
+public:
+ TSOSCollection(ccIndex limit, ccIndex delta, SOStack *stk) :
+ TCollection(limit,delta) { stkL=stk; };
+ // Don't delete items
+ virtual void freeItem(void *) {};
+ // No virtual because is a wrapper for the virtual
+ char *atStr(ccIndex index) { return GetString(at(index)); };
+ // Gets the string, depends on the Collection, but we provide the most common
+ virtual char *GetString( void *h ) { return stkL->GetStrOf((stkHandler)h); };
+ // Another wrapper
+ void insert(stkHandler h) { TCollection::insert((void *)h); };
+ SOStack *stkL;
+
+private:
+ // These 2 silly versions are just to allow TSOSCollection objects that
+ // in fact aren't streamable
+// virtual void *readItem(ipstream &) { return NULL; };
+// virtual void writeItem(void *,opstream &) {};
+};
+
+class TSOSSortedCollection : public TSOSCollection,
+ public TSortedCollection
+{
+public:
+ TSOSSortedCollection(ccIndex limit, ccIndex delta, SOStack *stk) :
+ TSOSCollection(limit,delta,stk) {};
+ // The keyOf can't return the item
+ virtual void *keyOf(void *item) { return stkL->GetPointerOf((stkHandler)item); };
+ // Overwrites the one from TSOSCollection
+ void insert(stkHandler h) { TSortedCollection::insert((void *)h); };
+ // Compare remains virtual and hence that's a base class
+};
+
+class TSOSStringCollection : public TSOSSortedCollection,
+ public TStringCollection
+{
+public:
+ TSOSStringCollection(ccIndex limit, ccIndex delta, SOStack *stk) :
+ TSOSSortedCollection(limit,delta,stk) {};
+ void *keyOf(void *item) = TSOSSortedCollection::keyOf;
+};
+
+class TSOSNCStringCollection : virtual public TSOSStringCollection
+{
+public:
+ TSOSNCStringCollection(ccIndex limit, ccIndex delta, SOStack *stk) :
+ TSOSStringCollection(limit,delta,stk) {};
+ // Just No Case.
+ int compare(void *s1,void *s2) { return strcasecmp((char *)s1,(char *)s2); };
+}
+
+class TSOSListBox : public TListBox
+{
+public:
+ TSOSListBox( const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar ) :
+ TListBox(bounds,aNumCols,aScrollBar) {};
+ // Just a wrapper
+ virtual void newList( TSOSCollection *aList )
+ { TListBox::newList((TCollection *)aList); };
+ // A better getText to use atStr and not at
+ virtual void getText( char *dest, ccIndex item, short maxChars );
+};
+*/
+#endif
+
diff --git a/setedit/settvuti/include/tnosostr.h b/setedit/settvuti/include/tnosostr.h
new file mode 100644
index 0000000..e3b1556
--- /dev/null
+++ b/setedit/settvuti/include/tnosostr.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TNoSortedStringCollection) && !defined(__TNoSortedStringCollection__)
+#define __TNoSortedStringCollection__
+
+class TNoSortedStringCollection : public TCollection
+{
+public:
+ TNoSortedStringCollection(ccIndex aLimit, ccIndex aDelta) :
+ TCollection(aLimit,aDelta) {};
+
+ //**************** Stream stuff
+ virtual const char *streamableName() const { return name; }
+ virtual void writeItem( void *obj, opstream& os );
+ virtual void *readItem( ipstream& is );
+
+protected:
+ TNoSortedStringCollection(StreamableInit) :
+ TCollection(streamableInit) {};
+
+public:
+ static const char * const name;
+ static TStreamable *build()
+ { return new TNoSortedStringCollection(streamableInit);};
+};
+
+inline ipstream& operator >> ( ipstream& is, TNoSortedStringCollection& cl )
+ { return is >> (TStreamable&)cl; }
+inline ipstream& operator >> ( ipstream& is, TNoSortedStringCollection*& cl )
+ { return is >> (void *&)cl; }
+
+inline opstream& operator << ( opstream& os, TNoSortedStringCollection& cl )
+ { return os << (TStreamable&)cl; }
+inline opstream& operator << ( opstream& os, TNoSortedStringCollection* cl )
+ { return os << (TStreamable *)cl; }
+
+#endif
diff --git a/setedit/settvuti/include/tprogbar.h b/setedit/settvuti/include/tprogbar.h
new file mode 100644
index 0000000..6db37de
--- /dev/null
+++ b/setedit/settvuti/include/tprogbar.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined( Uses_TProgressBar ) && !defined( __TProgressBar )
+#define __TProgressBar
+
+class TRect;
+
+class TProgressBar : public TView
+{
+public:
+ // default the background char to 178, but you can pass any char you want
+ TProgressBar(const TRect& r, unsigned long iters, char abackChar='');
+ ~TProgressBar();
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void update(unsigned long aProgress);
+
+ inline unsigned long getTotal(); // get the maximum iteration
+ inline unsigned long getProgress(); // get the current iteration
+
+ // change the percentage ( calls the update function )
+ void setTotal(unsigned long newTotal); // set the maximum iteration
+ void setProgress(unsigned long newProgress); // set the current iteration
+
+protected:
+ char backChar; // background character
+ unsigned long total; // total iterations to complete 100 %
+ unsigned long progress; // current iteration value
+ char * bar; // thermometer bar
+ unsigned int dispLen; // length of bar
+ unsigned int curPercent; // current percentage
+ unsigned int curWidth;
+ unsigned int numOffset; // offset in the string to display the percentage
+ double charValue;
+
+private:
+ int calcPercent(); // calculate new percentage
+
+ SetDefStreamMembersCommon(TProgressBar,TView)
+};
+
+SetDefStreamOperators(TProgressBar)
+#endif // defined( Uses_TProgressBar ) && !defined( __TProgressBar )
diff --git a/setedit/settvuti/include/tprogdia.h b/setedit/settvuti/include/tprogdia.h
new file mode 100644
index 0000000..5ae39a6
--- /dev/null
+++ b/setedit/settvuti/include/tprogdia.h
@@ -0,0 +1,11 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void ProgBar_Init(const char *title, int max, const char *comment1=0, const char *comment2=0);
+void ProgBar_DeInit(void);
+void ProgBar_UpDate(int pos);
+void ProgBar_SetComments(const char *comment1, const char *comment2=0);
+// Default value, to be remapped if needed and then copied to current
+extern char ProgBar_DefaultChar;
+// Currently used
+extern char ProgBar_CurrentChar;
+
diff --git a/setedit/settvuti/include/tprogrdi.h b/setedit/settvuti/include/tprogrdi.h
new file mode 100644
index 0000000..205f487
--- /dev/null
+++ b/setedit/settvuti/include/tprogrdi.h
@@ -0,0 +1,6 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+void Progress_Init(const char *title, const char *comment);
+void Progress_DeInit(void);
+void Progress_UpDate(void);
+
diff --git a/setedit/settvuti/include/tprogres.h b/setedit/settvuti/include/tprogres.h
new file mode 100644
index 0000000..5cf982d
--- /dev/null
+++ b/setedit/settvuti/include/tprogres.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined( Uses_TProgress ) && !defined( __TProgress )
+#define __TProgress
+
+class TRect;
+
+class TProgress : public TView
+{
+public:
+ TProgress(const TRect& r, const char *aMessage);
+ ~TProgress();
+ virtual void draw();
+ virtual TPalette& getPalette() const;
+ virtual void update();
+
+protected:
+ char *message;
+ int state;
+ static char states[4];
+ int len;
+
+ SetDefStreamMembersCommon(TProgress,TView)
+};
+
+SetDefStreamOperators(TProgress)
+#endif // defined( Uses_TProgress ) && !defined( __TProgress )
diff --git a/setedit/settvuti/include/tstringa.h b/setedit/settvuti/include/tstringa.h
new file mode 100644
index 0000000..0f06e3e
--- /dev/null
+++ b/setedit/settvuti/include/tstringa.h
@@ -0,0 +1,20 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TStringable) && !defined(TSTRINGA_H_INCLUDED)
+#define TSTRINGA_H_INCLUDED
+class TStringable
+{
+public:
+ TStringable() {};
+ virtual ~TStringable() {};
+
+ virtual void getText(char *dest, unsigned item, int maxLen)=0;
+ virtual unsigned GetCount() { return Count; };
+ virtual Boolean taggingSupported() { return False; };
+ virtual Boolean isTagged(unsigned ) { return False; };
+ virtual Boolean setTag(unsigned , Boolean state) { return False; };
+
+protected:
+ unsigned Count;
+};
+#endif // TSTRINGA_H_INCLUDED
diff --git a/setedit/settvuti/include/tstrlbox.h b/setedit/settvuti/include/tstrlbox.h
new file mode 100644
index 0000000..e84b218
--- /dev/null
+++ b/setedit/settvuti/include/tstrlbox.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#if defined(Uses_TStringableListBox) && !defined(__TStringableListBox__)
+#define __TStringableListBox__
+class TRect;
+class TScrollBar;
+class TCollection;
+
+typedef struct
+{
+ TStringable *items;
+ ccIndex selection;
+} TStringableListBoxRec;
+
+class TStringableListBox : public TListViewer
+{
+public:
+ TStringableListBox(const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar);
+ TStringableListBox(const TRect& bounds, ushort aNumCols, TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar, Boolean aCenterOps=False);
+ ~TStringableListBox();
+
+ virtual uint32 dataSize();
+ virtual void getData(void *rec);
+ virtual void getText(char *dest, ccIndex item, short maxLen);
+ virtual void newList(TStringable *aList);
+ virtual void setData(void *rec);
+ virtual void handleEvent(TEvent& event);
+ void Update(void);
+
+ Boolean center;
+
+ TStringable *list();
+
+protected: // Why if protected is enough the idiots of Borland used private?
+ TStringable *items;
+};
+
+inline TStringable *TStringableListBox::list()
+{
+ return items;
+}
+#endif
diff --git a/setedit/settvuti/include/viewplus.h b/setedit/settvuti/include/viewplus.h
new file mode 100644
index 0000000..e6a9466
--- /dev/null
+++ b/setedit/settvuti/include/viewplus.h
@@ -0,0 +1,47 @@
+/****************************************************************************
+
+ TViewPlus class header, copyright (c) 1996 by Salvador E. Tropea (SET)
+
+ Designed for the TCEditor class to be used by Robert Hhne in your RHIDE.
+
+ You can use this file for any purpose if you left the copyrights untouched
+and give me some credit for these functionalities.
+
+ E-Mail: salvador@inti.edu.ar
+
+ Telephone: (+5411) 4759-0013
+
+ Postal Address:
+ Salvador E. Tropea
+ Curapalige 2124
+ (1678) Caseros - 3 de Febrero
+ Prov: Buenos Aires
+ Argentina
+
+ These class is designed ONLY to get access to private members of TView, do
+not add variables to it, only functions. If you really need to add vars take
+care about side effects, this class asumes that can use a TView or TGroup
+just like another TViewPlus casting the pointer.
+
+****************************************************************************/
+
+#if defined( Uses_TViewPlus ) && !defined( __TViewPlus )
+#define __TViewPlus
+
+class TViewPlus : public TView
+{
+
+public:
+
+ TViewPlus( const TRect& bounds ) : TView(bounds) {};
+ int setAttrOfCoor(int x, int y, char attr);
+ int getAttrsOfCol(int x, int y1, int y2, char *attr);
+ int getAttrsOfRow(int x1, int x2, int y, char *attr);
+
+protected:
+
+ TViewPlus( StreamableInit ) : TView( streamableInit ) {};
+
+};
+
+#endif // TViewPlus
diff --git a/setedit/settvuti/inputsca.cc b/setedit/settvuti/inputsca.cc
new file mode 100644
index 0000000..847a480
--- /dev/null
+++ b/setedit/settvuti/inputsca.cc
@@ -0,0 +1,131 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Class:
+ TInputScanKey
+
+ Comments:
+ That's a simple class to watch the scan codes and your ASCII. Is useful
+to configure non-US keyboards.@p
+ The class is basically TInputLine but super-simplified for this silly
+purppose.
+
+***************************************************************************/
+#define Uses_string
+#include <stdio.h>
+
+#define Uses_TInputScanKey
+#define Uses_TDrawBuffer
+#define Uses_TEvent
+//#define Uses_opstream
+//#define Uses_ipstream
+//#define Uses_TStreamableClass
+#define Uses_TPalette
+#include <settvuti.h>
+
+#define cpInputScanKey "\x13\x13\x14\x15"
+
+TInputScanKey::TInputScanKey( const TPoint &p ) :
+ TView(TRect(p.x,p.y,p.x+20,p.y+1)),
+ Scan(0),
+ Ascii(0)
+{
+ options |= ofSelectable | ofFirstClick;
+}
+
+TInputScanKey::~TInputScanKey()
+{
+}
+
+uint32 TInputScanKey::dataSize()
+{
+ return sizeof(unsigned short);
+}
+
+void TInputScanKey::draw()
+{
+ TDrawBuffer b;
+
+ uchar color=(state & sfFocused) ? getColor(2) : getColor(1);
+
+ char buf[256];
+ sprintf(buf," Scan: %02X ASCII: %02X ",Scan,Ascii);
+ b.moveStr(0,buf,color);
+
+ writeLine( 0, 0, size.x, size.y, b );
+}
+
+void TInputScanKey::getData( void *rec )
+{
+ unsigned short *p=(unsigned short *)rec;
+ *p=(Scan<<8) | Ascii;
+}
+
+TPalette& TInputScanKey::getPalette() const
+{
+ static TPalette palette( cpInputScanKey, sizeof( cpInputScanKey )-1 );
+ return palette;
+}
+
+
+void TInputScanKey::handleEvent( TEvent& event )
+{
+ TView::handleEvent(event);
+
+ if (event.what==evKeyDown)
+ {
+ Scan=event.keyDown.raw_scanCode;
+ Ascii=event.keyDown.charScan.charCode;
+ drawView();
+ clearEvent(event);
+ }
+}
+
+void TInputScanKey::setData(void *rec)
+{
+ unsigned short *p=(unsigned short *)rec;
+ Ascii=*p & 0xFF;
+ Scan=*p>>8;
+}
+
+/*void TInputScanKey::setState( ushort aState, Boolean enable )
+{
+ TView::setState( aState, enable );
+ if( aState == sfSelected ||
+ ( aState == sfActive && (state & sfSelected) != 0 )
+ )
+ selectAll( enable );
+}*/
+
+#if !defined( NO_STREAM )
+void TInputScanKey::write( opstream& os )
+{
+ TView::write(os);
+ os << Scan << Ascii;
+}
+
+void *TInputScanKey::read( ipstream& is )
+{
+ TView::read(is);
+ is >> Scan >> Ascii;
+ return this;
+}
+
+TStreamable *TInputScanKey::build()
+{
+ return new TInputScanKey( streamableInit );
+}
+
+TInputScanKey::TInputScanKey( StreamableInit ) : TView( streamableInit )
+{
+ Scan=Ascii=0;
+}
+#endif // NO_STREAM
+
+/*Boolean TInputScanKey::valid(ushort )
+{
+ return True;
+}*/
+
+
diff --git a/setedit/settvuti/names/ninputsc.cc b/setedit/settvuti/names/ninputsc.cc
new file mode 100644
index 0000000..16fa9fa
--- /dev/null
+++ b/setedit/settvuti/names/ninputsc.cc
@@ -0,0 +1,6 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TInputScanKey);
+
diff --git a/setedit/settvuti/names/nprogbar.cc b/setedit/settvuti/names/nprogbar.cc
new file mode 100644
index 0000000..7383d73
--- /dev/null
+++ b/setedit/settvuti/names/nprogbar.cc
@@ -0,0 +1,7 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TProgressBar);
+
+
diff --git a/setedit/settvuti/names/nprogres.cc b/setedit/settvuti/names/nprogres.cc
new file mode 100644
index 0000000..cdbc341
--- /dev/null
+++ b/setedit/settvuti/names/nprogres.cc
@@ -0,0 +1,7 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TProgress);
+
+
diff --git a/setedit/settvuti/names/ntnocast.cc b/setedit/settvuti/names/ntnocast.cc
new file mode 100644
index 0000000..d458c49
--- /dev/null
+++ b/setedit/settvuti/names/ntnocast.cc
@@ -0,0 +1,6 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TNoCaseStringCollection);
+n(TStringCollectionW);
diff --git a/setedit/settvuti/names/ntnosost.cc b/setedit/settvuti/names/ntnosost.cc
new file mode 100644
index 0000000..72e41d0
--- /dev/null
+++ b/setedit/settvuti/names/ntnosost.cc
@@ -0,0 +1,7 @@
+/* Copyright (C) 1996-2001 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_n
+#include <tv/tvutil.h>
+n(TNoSortedStringCollection);
+
+
diff --git a/setedit/settvuti/nostatex.cc b/setedit/settvuti/nostatex.cc
new file mode 100644
index 0000000..9c8b2eb
--- /dev/null
+++ b/setedit/settvuti/nostatex.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+
+#define Uses_TNoStaticText
+#include <settvuti.h>
+
+TNoStaticText::TNoStaticText(const TRect& bounds, const char *aText) :
+ TStaticText(bounds,aText)
+{
+ startLen=strlen(getText());
+}
+
+TNoStaticText::TNoStaticText(const TRect& bounds, const char *aText,
+ stTVIntl *cache) :
+ TStaticText(bounds,aText,cache)
+{
+ startLen=strlen(getText());
+}
+
+void TNoStaticText::setText(const char *s)
+{
+ if (0)
+ {// Old behavior, I don't think it really helps
+ int l=strlen(s);
+ int copy=min(startLen,l);
+ memcpy((char *)text,s,copy);
+ int rest=startLen-copy;
+ if (rest)
+ memset((char *)text+copy,' ',rest);
+ }
+ else
+ {// New behavior, the draw() member will limit the size and also pad with
+ // spaces.
+ delete[] text;
+ text=newStr(s);
+ startLen=strlen(getText());
+ }
+
+ TVIntl::freeSt(intlText); // Invalidate i18n cache
+ draw();
+}
diff --git a/setedit/settvuti/setstack.cc b/setedit/settvuti/setstack.cc
new file mode 100644
index 0000000..d3d529d
--- /dev/null
+++ b/setedit/settvuti/setstack.cc
@@ -0,0 +1,381 @@
+/**[txh]*********************************************************************
+
+ Class: SOStack
+ Comments:
+ Simple Object Stack (SOS), copyright (c) 1997 by Salvador E. Tropea (SET)
+@p
+ If you want to use this code contact me first.
+@p
+@<subtitle>{Purpose:}
+
+ The SOS was designed to reduce the number of memory allocations needed
+for string lists operations and to reduce the wasted space.
+@p
+ The overhead of each allocation is sizeof(size_t) plus the bytes needed
+to align the object to a Dowble Word boundary, so all the obejcts are
+32 bits aligned if size_t is 32 bits or 16 bits if size_t is 16 bits.
+@p
+ As the routines were designed with the DJGPP malloc scheme in mind the
+program takes memory in cuasi-2-power chunks, that's for example 976 bytes,
+1952, 3904, etc.
+@p
+ The class have only one chunk of memory that is managed as an stack, so
+the number of elements in the global heap is reduced. As this chunk of
+memory can be resized when all is used and that's involves a call to
+realloc the class can return pointers to the objects, instead returns
+handlers type stkHandler. To convert this handler to a pointer 2 members
+are provided: GetPointerOf and GetStrOf, basically are just the same
+but the second avoids a cast in string operations. The both are inline
+and are just an addittion so the overhead is minimal.
+@p
+@<subtitle>{Notes of application:}
+
+ I used it for lists of strings in dialog boxes, so I was forced to
+overwrite some classes:
+@p
+TNoCaseSOSStringCollection from TStringCollection:@*
+ Is a collection, no case sensitive that uses an SOStack for the strings,
+the class ISN'T the owner of the SOStack, so you must put the strings in
+the SOStack and insert the stkHandler in the collection. When the
+collection is destroyed the SOStack ISN'T destroyed.
+@p
+TSOSSortedListBox from public TSortedListBox:@*
+ Is a sorted listbox that support a TNoCaseSOSStringCollection as
+collection, that's needed because the original can't handle the stkHandler.
+The both are in tnocastc.cc and tnocastc.h
+@p
+
+@<pre>
+Contact me at:
+E-Mail: salvador@@inti.edu.ar
+Telephone: (+5411) 4759-0013
+Postal Address:
+Salvador E. Tropea
+Curapalige 2124
+(1678) Caseros - 3 de Febrero
+Prov: Buenos Aires
+Argentina
+@</pre>
+
+****************************************************************************/
+
+#define Uses_string
+#define Uses_SOStack
+#include <settvuti.h>
+
+/**[txh]**********************************************************************
+
+ Include: settvuti.h
+ Module: SET TV Utils
+ Description:
+ That's the constructor for the SOStack, it just initialize the vars and
+doesn't allocate any memory.
+
+*****************************************************************************/
+
+SOStack::SOStack()
+{
+ Buffer=NULL;
+ MemPool=0;
+ Size=0;
+ Cant=0;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ It cleans the SOStack without liberating the memory. The new objects added
+will overwrite the old ones so the old references loose sense.
+
+*****************************************************************************/
+
+void SOStack::Clean(void)
+{
+ Size=0;
+ Cant=0;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is the destructor. It frees the allocated memory.
+
+*****************************************************************************/
+
+SOStack::~SOStack()
+{
+ free(Buffer); // Allocated with realloc
+ Buffer=NULL;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ That's a private member. It makes enough space in the stack to hold
+"bytes" bytes. It calls to realloc so the old references can be
+invalidated.
+
+ Return:
+ A size_t that's the new top of the stack.
+
+*****************************************************************************/
+
+size_t SOStack::MakeRoomFor(size_t bytes)
+{
+ size_t rest=4-(bytes & 3);
+ size_t requested;
+
+ if (rest==4)
+ rest=0;
+ bytes+=rest+sizeof(size_t);
+ requested=Size+bytes;
+ if (requested>MemPool)
+ {
+ if (!MemPool)
+ MemPool=stkInitialMemPool;
+ while (MemPool<requested)
+ MemPool*=2;
+ Buffer=(char *)realloc(Buffer,MemPool);
+ }
+ return requested;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ It's a private member. It copies the memory pointed by "p" and with size
+"size" to the offset "req" in the buffer of the stack. It updates the
+LastChunk, Cant and Size members. The space must be allocated by MakeRoomFor
+first.
+
+ Return:
+ stkNULL if the Buffer is NULL.
+ The stkHandler of the added item if all Ok.
+
+*****************************************************************************/
+
+stkHandler SOStack::AddItem(void *p, size_t size, size_t req)
+{
+ if (Buffer)
+ {
+ stkHandler ret=Size;
+ memcpy(&Buffer[ret],p,size);
+ LastChunk=*((size_t *)(&Buffer[req-sizeof(size_t)]))=req-Size;
+ Size=req;
+ Cant++;
+ return ret;
+ }
+ return stkNULL;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ It's a private member. It just updates the LastChunk, Cant and Size members
+to keep space for a new element in the stack. The space must be allocated by
+MakeRoomFor first.
+
+ Return:
+ stkNULL if the Buffer is NULL.
+ The stkHandler of the added item if all Ok.
+
+*****************************************************************************/
+
+stkHandler SOStack::AddEmptyItem(size_t req)
+{
+ if (Buffer)
+ {
+ stkHandler ret=Size;
+ LastChunk=*((size_t *)(&Buffer[req-sizeof(size_t)]))=req-Size;
+ Size=req;
+ Cant++;
+ return ret;
+ }
+ return stkNULL;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ It adds an string to the stack.
+
+ Return: stkHandler to access later to it.
+
+*****************************************************************************/
+
+stkHandler SOStack::addStr(char *s)
+{
+ size_t l;
+
+ for (l=0; s[l]; l++);
+ return add(s,l+1);
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ This member is used to deallocate the last allocated element. If "shrink"
+is !=0 the class will deallocate the memory too, if not it will let the
+space for another element.
+
+*****************************************************************************/
+
+void SOStack::DestroyTop(int shrink)
+{
+ if (Buffer && Size)
+ {
+ Size-=LastChunk;
+ LastChunk=*((size_t *)(&Buffer[Size-sizeof(size_t)]));
+ Cant--;
+ if (shrink && Size*2<MemPool)
+ {
+ size_t newSize=MemPool;
+ size_t testSize=MemPool;
+
+ while (testSize>Size)
+ {
+ newSize=testSize;
+ testSize>>=1;
+ }
+ Buffer=(char *)realloc(Buffer,newSize);
+ MemPool=newSize;
+ }
+ }
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is used to get the pointer of the last element added.
+
+ Return: A void ponter to it or NULL if fails.
+
+*****************************************************************************/
+
+void *SOStack::GetTop()
+{
+ if (Buffer && Size)
+ return (void *)(&Buffer[Size-LastChunk]);
+ return NULL;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is used to find the stkHandler of the last added element.
+
+ Return: stkHandler of it or stkNULL if fails
+
+*****************************************************************************/
+
+stkHandler SOStack::GetTopHandle()
+{
+ if (Buffer && Size)
+ return Size-LastChunk;
+ return stkNULL;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is used to go though the stack from the last added element to the first one.
+
+ Return: The handler of the previous element of pos or stkNULL.
+
+*****************************************************************************/
+
+stkHandler SOStack::GetPreviousOf(stkHandler pos)
+{
+ if (Buffer && Size && pos)
+ return pos-*((stkHandler *)(&Buffer[pos-sizeof(size_t)]));
+ return stkNULL;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ Is used to get the pointer to the element number "index". The first element
+is the 0.
+
+ Return: a void pointer to it or NULL.
+
+*****************************************************************************/
+
+void *SOStack::GetItemNumber(unsigned index)
+{
+ if (Buffer && Size && index<Cant)
+ {
+ unsigned i=Cant;
+ size_t *Len=(size_t *)(Buffer+Size-sizeof(size_t));
+
+ do
+ {
+ Len=(size_t *)(((char *)Len)-*Len);
+ i--;
+ }
+ while (index!=i);
+ return (void *)(((char *)Len)+sizeof(size_t));
+ }
+ return NULL;
+}
+
+// Here is the description for the inline members:
+/**[txh]**********************************************************************
+
+ Function: add
+ Prototype: stkHandler add(void *p, size_t size)
+ Description:
+ Adds the data pointed by "p" with size "size" to the stack. Uses @x{::AddItem}.
+Is an inline member.
+
+ Return: The stkHandler of the data added or stkNULL if fails.
+
+**********/
+/**[txh]***
+
+ Function: alloc
+ Prototype: stkHandler alloc(size_t size)
+ Description:
+ Reserves "size" bytes in the stack to hold data. Uses @x{::AddEmptyItem}. Is an
+inline member.
+
+ Return: The stkHandler of the data added or stkNULL if fails.
+
+**********/
+/**[txh]***
+
+ Function: GetStrNumber
+ Prototype: char *GetStrNumber(unsigned index)
+ Description:
+ Is used to get the pointer to the string number "index". The first element
+is the 0. Is an inline cast of @x{SOStack::GetItemNumber}.
+
+ Return: a char pointer to it or NULL.
+
+**********/
+/**[txh]***
+
+ Function: GetPointerOf
+ Prototype: void *GetPointerOf(stkHandler h)
+ Description:
+ Is used to convert a handler into a void pointer. Is an inline addition.
+
+ Return: The void pointer to this element. No checks are made!
+
+**********/
+/**[txh]***
+
+ Function: GetStrOf
+ Prototype: char *GetStrOf(stkHandler h)
+ Description:
+ Is used to convert a handler into a char pointer. Is an inline addition.
+
+ Return: The char pointer to this element. No checks are made!
+
+*****************************************************************************/
+
+
+
+
+
+
diff --git a/setedit/settvuti/streams/sprogbar.cc b/setedit/settvuti/streams/sprogbar.cc
new file mode 100644
index 0000000..6fc2282
--- /dev/null
+++ b/setedit/settvuti/streams/sprogbar.cc
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TProgressBar
+#include <settvuti.h>
+
+s(ProgressBar);
+
diff --git a/setedit/settvuti/streams/sprogres.cc b/setedit/settvuti/streams/sprogres.cc
new file mode 100644
index 0000000..ad1ca25
--- /dev/null
+++ b/setedit/settvuti/streams/sprogres.cc
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TProgress
+#include <settvuti.h>
+
+s(Progress);
+
diff --git a/setedit/settvuti/streams/stnocast.cc b/setedit/settvuti/streams/stnocast.cc
new file mode 100644
index 0000000..48c20f4
--- /dev/null
+++ b/setedit/settvuti/streams/stnocast.cc
@@ -0,0 +1,23 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*------------------------------------------------------------*/
+/* filename - snocastc.cc */
+/* */
+/* Registeration objects for the following classes: */
+/* TNoCaseStringCollection */
+/*------------------------------------------------------------*/
+
+/*------------------------------------------------------------*/
+/* */
+/* Needed to write the objects to a stream. */
+/* */
+/*------------------------------------------------------------*/
+
+#define Uses_TStreamableClass
+#define Uses_TNoCaseStringCollection
+#define Uses_TStringCollectionW
+#include <settvuti.h>
+
+s(NoCaseStringCollection);
+s(StringCollectionW);
+
diff --git a/setedit/settvuti/streams/stnonost.cc b/setedit/settvuti/streams/stnonost.cc
new file mode 100644
index 0000000..d10ee8c
--- /dev/null
+++ b/setedit/settvuti/streams/stnonost.cc
@@ -0,0 +1,9 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TNoSortedStringCollection
+#include <settvuti.h>
+
+s(NoSortedStringCollection);
+
+
diff --git a/setedit/settvuti/tdiagaid.cc b/setedit/settvuti/tdiagaid.cc
new file mode 100644
index 0000000..28243e4
--- /dev/null
+++ b/setedit/settvuti/tdiagaid.cc
@@ -0,0 +1,322 @@
+/* Copyright (C) 1996-2005 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+//#define Uses_stdio // debug
+
+#define Uses_AllocLocal
+#define Uses_TDialogAID
+#define Uses_TKeys
+#define Uses_TKeys_Extended
+#define Uses_TEvent
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TRadioButtons
+#define Uses_TSItem
+#define Uses_TLabel
+#define Uses_TButton
+#define Uses_TRect
+#define Uses_TSortedListBox
+
+#define Uses_TSLabel
+#define Uses_TSButton
+#define Uses_TSHzGroup
+#define Uses_TSStringableListBox
+#define Uses_TSSortedListBox
+#define Uses_TSVeGroup
+#define Uses_TSLabelRadio
+#define Uses_TSNoStaticText
+#define Uses_TSStaticText
+
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+#include <diaghelp.h>
+
+
+TDialogAID::TDialogAID(const TRect& bounds, const char *aTitle,
+ TStringableListBox *slb ) :
+ TWindowInit(&TDialogAID::initFrame),
+ TGrowDialog(bounds,aTitle)
+{
+ List=slb;
+ AddAction=0;
+ InsAction=0;
+ DelAction=0;
+ OkAction=0;
+ CancelAction=0;
+ InfoAction=0;
+ nst=NULL;
+}
+
+static
+void EnableComms(void)
+{
+ TView::enableCommand(cmOKApply);
+ TView::enableCommand(cmDeleteKey);
+ TView::enableCommand(cmInsertKey);
+}
+
+static
+void DisableComms(unsigned leftOKEnabled)
+{
+ if (!leftOKEnabled)
+ TView::disableCommand(cmOKApply);
+ TView::disableCommand(cmDeleteKey);
+ TView::disableCommand(cmInsertKey);
+}
+
+
+void TDialogAID::handleEvent(TEvent& event)
+{
+ if (event.what==evKeyDown)
+ {
+ switch (event.keyDown.keyCode)
+ {
+ case kbEsc:
+ event.what=evCommand;
+ event.message.command=cmCancelApply;
+ break;
+ case kbInsert:
+ event.what=evCommand;
+ event.message.command=(List->list())->GetCount() ? cmInsertKey : cmAddKey;
+ if (event.message.command==cmInsertKey && InsAction==0)
+ event.message.command=cmAddKey;
+ break;
+ case kbDelete:
+ event.what=evCommand;
+ event.message.command=cmDeleteKey;
+ break;
+ default:
+ TDialog::handleEvent(event);
+ }
+ }
+ else
+ TDialog::handleEvent(event);
+
+ if ( event.what == evCommand || event.what == evBroadcast)
+ {
+ switch ( event.message.command )
+ {
+ case cmAddKey:
+ if (AddAction)
+ {
+ if (AddAction())
+ List->Update();
+ if ((List->list())->GetCount())
+ EnableComms();
+ }
+ break;
+ case cmInsertKey:
+ if (InsAction && (List->list())->GetCount())
+ {
+ if (InsAction(List->focused))
+ List->Update();
+ }
+ break;
+ case cmDeleteKey:
+ if (DelAction && (List->list())->GetCount())
+ {
+ if (DelAction(List->focused))
+ List->Update();
+ if ((List->list())->GetCount()==0)
+ DisableComms(flags & aidOKEnabled);
+ }
+ break;
+ case cmOKApply:
+ if (OkAction)
+ {
+ if (OkAction())
+ endModal(cmOK);
+ }
+ else
+ endModal(cmOK);
+ break;
+ case cmCancelApply:
+ if (CancelAction)
+ {
+ if (CancelAction())
+ endModal(cmCancel);
+ }
+ else
+ endModal(cmCancel);
+ break;
+ case cmInfoAID:
+ if (InfoAction)
+ InfoAction(List->focused);
+ break;
+ case cmBrowseAID:
+ if (BrowseAction)
+ {
+ if (BrowseAction())
+ List->Update();
+ if ((List->list())->GetCount())
+ EnableComms();
+ }
+ break;
+ case cmeZoom:
+ event.message.command=cmZoom;
+ TDialog::handleEvent(event);
+ break;
+ default:
+ return;
+ }
+ clearEvent(event);
+ }
+}
+
+static char *nbotAdd=__("~A~dd");
+static char *nbotIns=__("~I~nsert");
+static char *nbotDel=__("~D~elete");
+static char *nbotOk =__("~O~k");
+static char *nbotCan=__("~C~ancel");
+static char *nbotInfo=__("~I~nfo.");
+static char *nbotBrowse=__("~B~rowse");
+
+const int lSepb=2;
+
+TDialogAID *CreateAddInsDelDialog(int x, int y, const char *name, int h, int w,
+ int flags)
+{
+ unsigned options=0;
+ if (x<=0)
+ {
+ x=1;
+ options|=ofCenterX;
+ }
+ if (y<=0)
+ {
+ y=1;
+ options|=ofCenterY;
+ }
+
+ TSStringableListBox *slb=new TSStringableListBox(w,h+1,tsslbVertical);
+ TSView *upper=slb;
+ slb->view->growMode=gfMoveBottomCorner;
+
+ TDialogAID *d=new TDialogAID(TRect(x,y,1,1),name,
+ (TStringableListBox *)slb->view);
+ TSViewCol *col=new TSViewCol(d);
+
+ if (flags & aidAssignedTo)
+ {
+ AllocLocalStr(buffer,w+1);
+ memset(buffer,' ',w);
+ buffer[w]=0;
+ TSNoStaticText *snst=new TSNoStaticText(buffer);
+ d->nst=(TNoStaticText *)snst->view;
+ TSStaticText *labasig=new TSStaticText(__("Assigned to:"));
+ snst->setGrowMode(gfGrowHiX | gfGrowHiY | gfGrowLoY);
+ labasig->setGrowMode(gfGrowHiX | gfGrowHiY | gfGrowLoY);
+ upper=MakeVeGroup(0,upper,labasig,snst,0);
+ }
+
+ if (flags & aidComMac)
+ {
+ TSLabel *tl=TSLabelRadio(__("Assignmen~t~"),__("Command~s~"),__("~M~acro"),
+ __("s~L~isp code"),0);
+ tl->setGrowMode(gfGrowHiX | gfGrowHiY | gfGrowLoY);
+ upper=new TSVeGroup(upper,tl,0);
+ }
+ upper->Flags=wSpan;
+
+ TSButton *exBts[2];
+ exBts[0]=exBts[1]=NULL;
+ int idxEx=0;
+ if (flags & aidInfo)
+ exBts[idxEx++]=new TSButton(nbotInfo,cmInfoAID);
+ if (flags & aidBrowse)
+ exBts[idxEx++]=new TSButton(nbotBrowse,cmBrowseAID);
+ TSHzGroup *bt1=MakeHzGroup(new TSButton(nbotOk,cmOKApply,bfDefault),
+ new TSButton(nbotCan,cmCancelApply),
+ exBts[0],exBts[1],NULL);
+ bt1->setGrowMode(gfMoveAccording);
+ bt1->ySep=0;
+ TSHzGroup *bt2;
+ if (flags & aidInsert)
+ {
+ bt2=MakeHzGroup(new TSButton(nbotAdd,cmAddKey),
+ new TSButton(nbotIns,cmInsertKey),
+ new TSButton(nbotDel,cmDeleteKey),
+ 0);
+ }
+ else
+ {
+ bt2=MakeHzGroup(new TSButton(nbotAdd,cmAddKey),
+ new TSButton(nbotDel,cmDeleteKey),
+ 0);
+ }
+ bt2->setGrowMode(gfMoveAccording);
+
+ col->insert(xTSCenter,yTSUp,upper);
+ col->insert(xTSCenter,yTSUnder,bt2,0,upper);
+ col->insert(xTSCenter,yTSUnder,bt1,0,bt2);
+ col->doIt();
+ d->options|=options;
+ d->flags=flags;
+ return d;
+}
+
+// That creates the dialog, is generic and is reused
+// Used to: (1) Choose a comand (2) Choose a macro
+TDialog *CreateChooseDialog(int x, int y, const char *name, int h, int w,
+ unsigned options)
+{
+ unsigned opsDiag=0;
+ if (x<=0)
+ {
+ x=1;
+ opsDiag|=ofCenterX;
+ }
+ if (y<=0)
+ {
+ y=1;
+ opsDiag|=ofCenterY;
+ }
+ TSViewCol *col=new TSViewCol(new TDialog(TRect(x,y,1,1),name));
+
+ unsigned scrlBars=tsslbVertical;
+ unsigned hzMax=w;
+ if (options & aidHzScroll)
+ {
+ scrlBars|=tsslbHorizontal;
+ hzMax=256;
+ }
+ TSView *slb;
+ if (options & aidStringable)
+ slb=new TSStringableListBox(w,h+1,scrlBars,1,hzMax);
+ else
+ slb=new TSSortedListBox(w,h+1,scrlBars,1,hzMax);
+ col->insert(xTSCenter,yTSUp,slb);
+
+ TSView *bts;
+ if (options & aidNoCancel)
+ bts=new TSButton(nbotOk,cmOK,bfDefault);
+ else
+ bts=MakeHzGroup(new TSButton(nbotOk,cmOK,bfDefault),
+ new TSButton(nbotCan,cmCancel),0);
+ col->insert(xTSCenter,yTSDown,bts);
+
+ TDialog *d=col->doIt();
+ d->options|=opsDiag;
+
+ return d;
+}
+
+void TGrowDialogZ::handleEvent(TEvent& event)
+{
+ TDialog::handleEvent(event);
+ if (event.what==evCommand || event.what==evBroadcast)
+ {
+ switch (event.message.command)
+ {
+ case cmeZoom:
+ event.message.command=cmZoom;
+ TDialog::handleEvent(event);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
diff --git a/setedit/settvuti/tdiagrow.cc b/setedit/settvuti/tdiagrow.cc
new file mode 100644
index 0000000..1cfd9ae
--- /dev/null
+++ b/setedit/settvuti/tdiagrow.cc
@@ -0,0 +1,55 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]**********************************************************************
+
+ Class: TGrowDialog
+ Comments:
+
+ This is a TDialog that can grow, not shrink, simply grow. You can Zoom
+the dialog too.
+@p
+I defined 2 gfXXXXX constants:
+@p
+gfMoveBottomCorner: Used in TListBoxes, the uper-left corner still in
+your place and the bottom-right is moved according to the size of the dialog.@p
+
+gfMoveAccording: Used in the TButtons, the buttons are moved according
+to the new size of the dialog.@p
+
+The TScrollBars have grow attributes by default.@p
+
+*****************************************************************************/
+
+#define Uses_TGrowDialog
+#include <settvuti.h>
+
+/**[txh]**********************************************************************
+
+ Include: tdiagrow
+ Module: SET TV Utils
+ Description:
+ It overwrites the original sizeLimits to return the original size of the
+dialog instead of the minimun size. In this way the dialog can't be shrinked.
+
+*****************************************************************************/
+
+void TGrowDialog::sizeLimits(TPoint& min, TPoint& max)
+{
+ TDialog::sizeLimits(min,max);
+ min=minSize;
+}
+
+/**[txh]**********************************************************************
+
+ Function: TGrowDialog
+ Prototype: TGrowDialog( TRect r, const char *name, int extraOptions=0 )
+ Description:
+ Creates a dialog that can be enlarged. "r" is the initial and minimun size,
+"name" is the caption name and "extraOptions" is ored with the options of
+the dialog object.
+
+ It calls to the dialog constructor and sets the flags to allow the growing
+facility.
+
+*****************************************************************************/
+
diff --git a/setedit/settvuti/tinppipe.cc b/setedit/settvuti/tinppipe.cc
new file mode 100644
index 0000000..766f7e1
--- /dev/null
+++ b/setedit/settvuti/tinppipe.cc
@@ -0,0 +1,229 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]**********************************************************************
+
+ Class: TInputLinePiped
+ Comments:
+ This class is used to connect a TInputLine object to some text buffer. The
+typical application is to connect the "Find" dialog input line with the
+editor's buffer.
+
+ To use it you must provide a function to make this connection. See the
+@x{::TInputLinePiped}, constructor for details.
+
+*****************************************************************************/
+
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TInputLinePiped
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TCEditWindow
+#define Uses_TVOSClipboard
+#include <ceditor.h>
+
+
+/**[txh]**********************************************************************
+
+ Include: tinppipe
+ Module: SET TV Utils
+ Description:
+ This is the constructor. The "bounds" and "aMaxLen" parameters are the same
+used in TInpLine. "aPipe" is the pointer to a function that makes as nexus
+between the input line and the text buffer, see example.@p
+
+ Example:
+ Here is the function used in the editor:
+
+@<pre>
+static unsigned PipeOrigin;
+static char *PipeBuf;
+static unsigned PipeBufLen;
+
+int PipeTCEditor(unsigned PosRel)
+{
+ if (PosRel+PipeOrigin<PipeBufLen)
+ return PipeBuf[PosRel+PipeOrigin];
+ return -1;
+}
+@</pre>
+
+ Before creating the dialog the editor sets the values of these vars,
+PipeBuf is a pointer to the editors buffer, PipeOrigin is the offset of
+the start of the connected text and PipeBufLen is the length of the buffer.
+The input line calls to this function each time the cursor is moved to
+the right passing the end of the input buffer. The PosRel parameter is the
+relative offset.
+
+*****************************************************************************/
+
+TInputLinePiped::TInputLinePiped( const TRect& bounds, int aMaxLen,
+ unsigned flags ) :
+TInputLine(bounds,aMaxLen),
+mFlags(flags)
+{
+ if (!TCEditor::clipboard)
+ mFlags|=tilpNoCopy | tilpNoPaste;
+}
+
+/**[txh]**********************************************************************
+
+ Description:
+ The handleEvent was modified to ask for text using the provided function.
+
+*****************************************************************************/
+
+void TInputLinePiped::handleEvent( TEvent& event )
+{
+ int Pos,Ret;
+ switch (event.what)
+ {
+ case evKeyDown:
+ switch (ctrlToArrow(event.keyDown.keyCode))
+ {
+ case kbRight:
+ Pos=strlen(data);
+ if (curPos>=Pos)
+ if ((Ret=PipeLine(Pos))!=-1)
+ if (Ret!='\r' && Ret!='\n' && Ret!='\t')
+ {
+ event.keyDown.keyCode=0; // No key
+ event.keyDown.charScan.charCode=Ret; // ASCII
+ selStart = 0;
+ selEnd = 0;
+ }
+ break;
+ case kbCtrlIns:
+ CopyToClip();
+ clearEvent(event);
+ break;
+ case kbShiftIns:
+ CopyFromClip();
+ clearEvent(event);
+ break;
+ }
+ break;
+
+ case evCommand:
+ switch (event.message.command)
+ {
+ case cmtilCopy:
+ CopyToClip();
+ clearEvent(event);
+ break;
+ case cmtilPaste:
+ CopyFromClip();
+ clearEvent(event);
+ break;
+ case cmtilCopyOS:
+ CopyToClipOS();
+ clearEvent(event);
+ break;
+ case cmtilPasteOS:
+ CopyFromClipOS();
+ clearEvent(event);
+ break;
+ }
+ break;
+ }
+ TInputLine::handleEvent(event);
+}
+
+int TInputLinePiped::PipeLine(unsigned pos)
+{
+ if (mFlags & tilpNoPipe)
+ return -1;
+ return PipeTCEditor(pos);
+}
+
+void TInputLinePiped::CopyToClip(void)
+{
+ if (mFlags & tilpNoCopy)
+ return;
+ unsigned Len=strlen(data);
+ if (Len)
+ TCEditor::clipboard->insertBuffer(data,0,Len,False,True);
+}
+
+void TInputLinePiped::CopyFromClip(void)
+{
+ if (mFlags & tilpNoPaste)
+ return;
+ AllocLocalStr(b,maxLen);
+ TCEditor::clipboard->CopySelToBuffer(b,maxLen);
+ int size=strlen(b);
+ for (int i=0; i<size; i++)
+ {
+ TInputLine::insertChar(b[i]);
+ selStart=selEnd=0; // Reset the selection or we will delete the last insertion
+ }
+ makeVisible();
+ //drawView();
+}
+
+void TInputLinePiped::CopyToClipOS(void)
+{
+ if ((mFlags & tilpNoCopy) || !TVOSClipboard::isAvailable())
+ return;
+ unsigned Len=strlen(data);
+ if (Len)
+ TVOSClipboard::copy(0,data,Len);
+}
+
+void TInputLinePiped::CopyFromClipOS(void)
+{
+ if ((mFlags & tilpNoPaste) || !TVOSClipboard::isAvailable())
+ return;
+ unsigned size;
+ char *p=TVOSClipboard::paste(0,size);
+ if (p)
+ {
+ if (size>(unsigned)maxLen)
+ size=maxLen;
+ memcpy(data,p,size);
+ data[size]=0;
+ selStart=0;
+ curPos=selEnd=size;
+ drawView();
+ DeleteArray(p);
+ }
+}
+
+void TInputLinePiped::setState( uint16 aState, Boolean enable )
+{
+ TInputLine::setState(aState,enable);
+ if (aState==sfSelected)
+ {
+ if (enable)
+ {
+ if (mFlags & tilpNoPaste)
+ {
+ disableCommand(cmtilPaste);
+ disableCommand(cmtilPasteOS);
+ }
+ else
+ {
+ enableCommand(cmtilPaste);
+ enableCommand(cmtilPasteOS);
+ }
+ if (mFlags & tilpNoCopy)
+ {
+ disableCommand(cmtilCopy);
+ disableCommand(cmtilCopyOS);
+ }
+ else
+ {
+ enableCommand(cmtilCopy);
+ enableCommand(cmtilCopyOS);
+ }
+ }
+ else
+ {
+ disableCommand(cmtilPaste);
+ disableCommand(cmtilCopy);
+ disableCommand(cmtilPasteOS);
+ disableCommand(cmtilCopyOS);
+ }
+ }
+}
+
diff --git a/setedit/settvuti/tnocastc.cc b/setedit/settvuti/tnocastc.cc
new file mode 100644
index 0000000..9569d34
--- /dev/null
+++ b/setedit/settvuti/tnocastc.cc
@@ -0,0 +1,403 @@
+/* Copyright (C) 1996-2002 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_stdio
+#define Uses_TEvent
+#define Uses_TKeys
+#define Uses_TSOSSortedListBox
+#define Uses_TNoCaseStringCollection
+#define Uses_TStringCollectionW
+#define Uses_TNoCaseSOSStringCollection
+#define Uses_TSOSStringCollection
+#define Uses_TNCSAssociative
+#define Uses_TNSSOSCol
+#define Uses_TSOSCol
+#define Uses_TSOSListBox
+#define Uses_ctype
+#define Uses_TVCodePage
+#include <settvuti.h>
+
+#define shiftKeys (char)(event.keyDown.shiftState & 0xFF)
+
+void *TStringCollectionW::readItem( ipstream& is )
+{
+ return (void *)is.readString();
+}
+
+void TStringCollectionW::writeItem( void *obj, opstream& os )
+{
+ os.writeString((char *)obj);
+}
+
+void *TNoCaseStringCollection::readItem( ipstream& is )
+{
+ return (void *)is.readString();
+}
+
+void TNoCaseStringCollection::writeItem( void *obj, opstream& os )
+{
+ os.writeString((char *)obj);
+}
+
+
+void TSOSSortedListBox::getText(char *dest, ccIndex item, short maxChars)
+{
+ TNoCaseSOSStringCollection *i=(TNoCaseSOSStringCollection *)list();
+
+ if ( i != 0 )
+ {
+ strncpy( dest, (const char *)(i->atStr(item)), maxChars );
+ dest[maxChars] = '\0';
+ }
+ else
+ *dest = EOS;
+}
+
+void TSOSListBox::getText(char *dest, ccIndex item, short maxChars)
+{
+ TSOSCol *i=(TSOSCol*)list();
+
+ if ( i != 0 )
+ {
+ strncpy( dest, (const char *)(i->atStr(item)), maxChars );
+ dest[maxChars] = '\0';
+ }
+ else
+ *dest = EOS;
+}
+
+int TNoCaseSOSStringCollection::compare(void *s1,void *s2)
+{
+ return strcasecmp(GetString(s1),GetString(s2));
+}
+
+int TSOSStringCollection::compare(void *s1,void *s2)
+{
+ return strcmp(GetString(s1),GetString(s2));
+}
+
+char *TNoCaseSOSStringCollection::GetString( void *h )
+{
+ return stkL->GetStrOf((stkHandler)h);
+}
+
+Boolean TNoCaseSOSStringCollection::Search( char *key, ccIndex& index )
+{
+ ccIndex l = 0;
+ ccIndex h = count - 1;
+ Boolean res = False;
+ while( l <= h )
+ {
+ ccIndex i = (l + h) >> 1;
+ int c = strcasecmp( GetString(items[i]), key );
+ if( c < 0 )
+ l = i + 1;
+ else
+ {
+ h = i - 1;
+ if( c == 0 )
+ {
+ res = True;
+ if( !duplicates )
+ l = i;
+ }
+ }
+ }
+ index = l;
+ return res;
+}
+
+#if 1
+Boolean TSOSStringCollection::SearchCase( char *key, ccIndex& index )
+{
+ ccIndex l = 0;
+ ccIndex h = count - 1;
+ Boolean res = False;
+ while( l <= h )
+ {
+ ccIndex i = (l + h) >> 1;
+ int c = strcmp( GetString(items[i]), key );
+ if( c < 0 )
+ l = i + 1;
+ else
+ {
+ h = i - 1;
+ if( c == 0 )
+ {
+ res = True;
+ if( !duplicates )
+ l = i;
+ }
+ }
+ }
+ index = l;
+ return res;
+}
+#endif
+
+int StrCmp(char *s1,char *s2)
+{
+ int ret=strcmp(s1,s2),ret2;
+ if (ret==0)
+ return ret;
+ ret2=strcasecmp(s1,s2);
+ if (ret2!=0)
+ return ret2;
+ return -512;
+}
+
+Boolean TNoCaseSOSStringCollection::SearchCase( char *key, ccIndex& index )
+{
+ ccIndex l = 0;
+ ccIndex h = count - 1;
+ Boolean res = False;
+ while( l <= h )
+ {
+ ccIndex i = (l + h) >> 1;
+ int c = StrCmp( GetString(items[i]), key );
+ if (c==-512)
+ {
+ while (i && strcasecmp(GetString(items[i-1]),key)==0)
+ {
+ i--;
+ if (strcmp(GetString(items[i]),key)==0)
+ {
+ index=i;
+ return True;
+ }
+ }
+ i++;
+ while (i<count && strcasecmp(GetString(items[i]),key)==0)
+ {
+ if (strcmp(GetString(items[i]),key)==0)
+ {
+ index=i;
+ return True;
+ }
+ i++;
+ }
+ return False;
+ }
+ if( c < 0 )
+ l = i + 1;
+ else
+ {
+ h = i - 1;
+ if( c == 0 )
+ {
+ res = True;
+ if( !duplicates )
+ l = i;
+ }
+ }
+ }
+ index = l;
+ return res;
+}
+
+
+void TSOSSortedListBox::handleEvent(TEvent& event)
+{
+ char curString[256], newString[256];
+ int value, oldPos, oldValue;
+
+ oldValue = focused;
+ TListBox::handleEvent( event );
+ if( oldValue != focused )
+ SearchPos = USHRT_MAX;
+ if( event.what == evKeyDown )
+ {
+ if( event.keyDown.keyCode != kbEnter &&
+ ( event.keyDown.charScan.charCode != 0 ||
+ event.keyDown.keyCode == kbBack ) )
+ {
+ value = focused;
+ if( value < range )
+ getText( curString, value, 255 );
+ else
+ *curString = EOS;
+ oldPos = SearchPos;
+ if( event.keyDown.keyCode == kbBack )
+ {
+ if( SearchPos == USHRT_MAX )
+ return;
+ curString[SearchPos--] = EOS;
+ if( SearchPos == USHRT_MAX )
+ shiftState = shiftKeys;
+ }
+ else if( (event.keyDown.charScan.charCode == '.') )
+ {
+ char *loc = strchr( curString+
+ (SearchPos==USHRT_MAX ? 0 : SearchPos), '.' );
+ if( loc )
+ {
+ SearchPos = ushort(loc - curString);
+ if (oldPos == USHRT_MAX)
+ oldPos = 0;
+ }
+ else
+ {
+ if (SearchPos == USHRT_MAX)
+ {
+ SearchPos++;
+ curString[SearchPos] = '.';
+ curString[SearchPos+1] = EOS;
+ oldPos = 0;
+ }
+ }
+ }
+ else
+ {
+ SearchPos++;
+ if( SearchPos == 0 )
+ {
+ ShiftState = shiftKeys;
+ oldPos=0;
+ }
+ curString[SearchPos] = event.keyDown.charScan.charCode;
+ curString[SearchPos+1] = EOS;
+ }
+ ((TNoCaseSOSStringCollection *)list())->Search( curString, value );
+ if( value < range )
+ {
+ getText( newString, value, 255 );
+ if( strncasecmp( curString, newString, SearchPos+1 )==0 )
+ {
+ if( value != oldValue )
+ {
+ focusItem(value);
+ setCursor( cursor.x+SearchPos, cursor.y );
+ }
+ else
+ setCursor(cursor.x+(SearchPos-oldPos), cursor.y );
+ }
+ else
+ SearchPos = oldPos;
+ }
+ else
+ SearchPos = oldPos;
+ if( SearchPos != oldPos ||
+ TVCodePage::isAlpha( event.keyDown.charScan.charCode )
+ )
+ clearEvent(event);
+ }
+ }
+}
+
+void TNCSAssociative::freeItem(void *s)
+{
+ // Remove the collection asociated with this item
+ stNCSAssociative *st=(stNCSAssociative *)stkL->GetPointerOf((stkHandler)s);
+ if (st->c)
+ delete st->c;
+}
+
+void TNCSAssociative::insert(char *s, stkHandler hv)
+{
+ ccIndex pos;
+ stNCSAssociative *st;
+ stkHandler h,hs;
+
+ if (Search(s,pos))
+ { // There are already a collection for it
+ // Get the collection
+ h=(stkHandler)at(pos);
+ st=(stNCSAssociative *)stkL->GetPointerOf(h);
+ // Insert in the collection
+ st->c->insert(hv);
+ }
+ else
+ { // No yet
+ // Put the name in the stack
+ hs=stkL->addStr(s);
+ // Get space for the structure
+ h =stkL->alloc(sizeof(stNCSAssociative));
+ // Fill the structure
+ st=(stNCSAssociative *)stkL->GetPointerOf(h);
+ st->h=hs;
+ st->c=new TNoCaseSOSStringCollection(10,5,stkL);
+ st->c->insert(hv);
+ st->Cont=stkNULL;
+ TNoCaseSOSStringCollection::insert(h);
+ }
+}
+
+void TNCSAssociative::SetContent(char *s, char *cont)
+{
+ ccIndex pos;
+ stNCSAssociative *st;
+ stkHandler h,hCont,hs;
+
+ if (Search(s,pos))
+ { // Ok it exists
+ // First add the string to the stack or we can invalidate the pointers
+ // during the process
+ hCont=stkL->addStr(cont);
+ // Get the struct
+ h=(stkHandler)at(pos);
+ st=(stNCSAssociative *)stkL->GetPointerOf(h);
+ st->Cont=hCont;
+ }
+ else
+ { // No yet
+ // Put the name in the stack
+ hs=stkL->addStr(s);
+ // Put the content
+ hCont=stkL->addStr(cont);
+ // Get space for the structure
+ h =stkL->alloc(sizeof(stNCSAssociative));
+ // Fill the structure
+ st=(stNCSAssociative *)stkL->GetPointerOf(h);
+ st->h=hs;
+ st->Cont=hCont;
+ st->c=new TNoCaseSOSStringCollection(10,5,stkL);
+ TNoCaseSOSStringCollection::insert(h);
+ }
+}
+
+char *TNCSAssociative::GetString( void *h )
+{
+ stNCSAssociative *st;
+ st=(stNCSAssociative *)stkL->GetPointerOf((stkHandler)h);
+ return stkL->GetStrOf(st->h);
+}
+
+TNoCaseSOSStringCollection *TNCSAssociative::atCol(ccIndex index)
+{
+ stNCSAssociative *st;
+ st=(stNCSAssociative *)stkL->GetPointerOf((stkHandler)at(index));
+ return st->c;
+}
+
+char *TNCSAssociative::GetContent(ccIndex index)
+{
+ stNCSAssociative *st;
+ st=(stNCSAssociative *)stkL->GetPointerOf((stkHandler)at(index));
+ if (st->Cont==stkNULL)
+ return NULL;
+ return stkL->GetStrOf(st->Cont);
+}
+
+
+char *TNSSOSCol::GetString( void *h )
+{
+ return stkL->GetStrOf((stkHandler)h);
+}
+
+char *TSOSCol::GetString( void *h )
+{
+ return stkL->GetStrOf((stkHandler)h);
+}
+
+/*
+void TSOSListBox::getText( char *dest, ccIndex item, short maxChars )
+{
+ if (items != 0 )
+ {
+ strncpy( dest, (const char *)(items->atStr(item)), maxChars );
+ dest[maxChars] = '\0';
+ }
+ else
+ *dest = EOS;
+}
+
+*/
diff --git a/setedit/settvuti/tnosostr.cc b/setedit/settvuti/tnosostr.cc
new file mode 100644
index 0000000..1865ee1
--- /dev/null
+++ b/setedit/settvuti/tnosostr.cc
@@ -0,0 +1,18 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TNoSortedStringCollection
+#include <settvuti.h>
+
+__link(RNoSortedStringCollection)
+
+void TNoSortedStringCollection::writeItem( void *obj, opstream& os )
+{
+ os.writeString( (const char *)obj );
+}
+
+void *TNoSortedStringCollection::readItem( ipstream& is )
+{
+ return is.readString();
+}
+
diff --git a/setedit/settvuti/tprogbar.cc b/setedit/settvuti/tprogbar.cc
new file mode 100644
index 0000000..7ea92a0
--- /dev/null
+++ b/setedit/settvuti/tprogbar.cc
@@ -0,0 +1,179 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Class: TProgressBar
+ Description:
+ Progresive bar. Based on code of Jay Perez and Barnaby W. Falls. Looks
+like Jay based it on a C++ example of some library adapting it to TVision.
+
+***************************************************************************/
+#include <stdio.h> // sprintf()
+#define Uses_string // memset
+
+#define Uses_TProgressBar
+#define Uses_TView
+#define Uses_TRect
+#define Uses_TGroup
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_fpstream
+#define Uses_TPalette
+#include <settvuti.h>
+
+#define cpProgressBar "\x04"
+/*
+ Progress Bar Attrib Pair
+ cpProgressBar maps to TProgram::appPalette's index 4 which is, by
+default, used for the ScrollBar Page. cpProgressBar represents the normal
+progress bar color. In the constructor the foreground and background
+attributes are swapped to form the highlight color. Thus the highlight will
+always be the inverse of the bar color.
+*/
+
+TProgressBar::TProgressBar(const TRect& bounds, unsigned long aTotal, char abackChar) :
+ TView(bounds)
+{
+ backChar = abackChar;
+ total = aTotal;
+ numOffset = (size.x/2)-3;
+ bar = new char[size.x+1];
+ memset(bar,backChar,size.x);
+ bar[size.x] = '\0';
+ charValue = 100.0/size.x;
+ progress =
+ curPercent =
+ curWidth = 0;
+}
+
+TProgressBar::~TProgressBar()
+{
+ delete bar;
+}
+
+void TProgressBar::draw()
+{
+ char string[4];
+
+ // A value greater than 999 can damage the stack so avoid it
+ if (curPercent>100)
+ curPercent=100;
+ // That's slower but easier than the original
+ sprintf(string,"%3d",curPercent);
+ /* Original code, itoa isn't supported in glibc, hey man! no itoX, no tell,
+ what a hell ...
+ itoa(curPercent,string,10);
+ string[3] = '\0';
+ if (curPercent<10)
+ {
+ string[2] = string[0];
+ string[1] = string[0] = ' ';
+ }
+ else
+ if (curPercent<100 && curPercent>9)
+ {
+ string[2] = string[1];
+ string[1] = string[0];
+ string[0] = ' ';
+ }*/
+ TDrawBuffer nbuf;
+ uchar colorNormal, colorHiLite;
+ colorNormal = getColor(1);
+ uchar fore = colorNormal>>4;
+ colorHiLite = fore+((colorNormal-(fore<<4))<<4);
+ nbuf.moveChar(0,backChar,colorNormal,size.x);
+ nbuf.moveStr(numOffset,string,colorNormal);
+ nbuf.moveStr(numOffset+3," %",colorNormal);
+ for (unsigned i=0;i<curWidth;i++)
+ nbuf.putAttribute(i,colorHiLite);
+ writeLine(0, 0, size.x, 1, nbuf);
+}
+
+
+TPalette& TProgressBar::getPalette() const
+{
+ static TPalette palette( cpProgressBar, sizeof( cpProgressBar )-1 );
+ return palette;
+}
+
+
+void TProgressBar::update(unsigned long aProgress)
+{
+ progress = aProgress;
+ if (calcPercent())
+ drawView();
+}
+
+int TProgressBar::calcPercent()
+{
+ unsigned int percent;
+ unsigned int width;
+
+ // calculate the new percentage
+ percent = (int) ( ((double)progress/(double)total) * 100 );
+
+ // percentage change?
+ if (percent!=curPercent)
+ {
+ curPercent = percent; // save new percentage
+ width = (int)((double)curPercent/charValue);// calculate percentage bar width
+
+ // width change?
+ if (width!=curWidth)
+ curWidth = width; // save new width
+ return 1;
+ }
+ return 0;
+}
+
+// return the maximum iteration
+unsigned long TProgressBar::getTotal()
+{
+ return total;
+}
+
+// return the current iteration
+unsigned long TProgressBar::getProgress()
+{
+ return progress;
+}
+
+// set a new maximum iteration & update display
+void TProgressBar::setTotal(unsigned long newTotal)
+{
+ unsigned long tmp = total;
+ total = newTotal;
+ memset(bar,backChar,size.x);
+ curWidth = 0; // current width of percentage bar
+ progress = 0; // current iteration
+ curPercent = 0; // current percentage
+ if (tmp) // since it starts with 0, only update if changing
+ drawView(); // update the thermometer bar display
+}
+
+// set a new current iteration & update display
+void TProgressBar::setProgress(unsigned long newProgress)
+{
+ progress = newProgress;
+ if (calcPercent())
+ drawView(); // paint the thermometer bar
+}
+
+void TProgressBar::write( opstream& os )
+{
+ TView::write( os );
+ os.writeString( bar );
+ os << backChar << total << progress << dispLen <<
+ curPercent << curWidth << numOffset << charValue;
+}
+
+void *TProgressBar::read( ipstream& is )
+{
+ TView::read( is );
+ bar = is.readString();
+ is >> backChar >> total >> progress >> dispLen >>
+ curPercent >> curWidth >> numOffset >> charValue;
+ return this;
+}
+
+
diff --git a/setedit/settvuti/tprogdia.cc b/setedit/settvuti/tprogdia.cc
new file mode 100644
index 0000000..812afc5
--- /dev/null
+++ b/setedit/settvuti/tprogdia.cc
@@ -0,0 +1,75 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TProgressBar
+#define Uses_TDialog
+#define Uses_TRect
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TNoStaticText
+#include <easydia1.h>
+#include <settvuti.h>
+#include <easydiag.h>
+
+static TDialog *d;
+static TNoStaticText *c1;
+static TNoStaticText *c2;
+static TProgressBar *pbar;
+static TView *prevFocus;
+
+char ProgBar_DefaultChar='';
+char ProgBar_CurrentChar='';
+
+void ProgBar_Init(const char *title, int max, const char *comment1, const char *comment2)
+{
+ prevFocus=TProgram::deskTop->current;
+ // Calculate the height
+ int h=5;
+ if (comment1)
+ h++;
+ if (comment2)
+ h++;
+ if (comment1 || comment2)
+ h++;
+
+ d=new TDialog(TRect(0,0,64,h),title);
+ // Don't allow the user close it
+ d->flags&=~wfClose;
+ d->options|=ofCentered;
+
+ pbar=new TProgressBar(TRect(2,2,62,3),max,ProgBar_CurrentChar);
+ d->insert(pbar);
+
+ if (comment1)
+ {
+ c1=new TNoStaticText(TRect(2,4,62,5),comment1);
+ d->insert(c1);
+ }
+
+ if (comment2)
+ {
+ c2=new TNoStaticText(TRect(2,5,62,6),comment2);
+ d->insert(c2);
+ }
+
+ TProgram::deskTop->insert(d);
+}
+
+void ProgBar_DeInit(void)
+{
+ TProgram::deskTop->remove(d);
+ if (prevFocus)
+ prevFocus->setState(sfActive,True);
+}
+
+void ProgBar_UpDate(int pos)
+{
+ pbar->update(pos);
+}
+
+void ProgBar_SetComments(const char *comment1, const char *comment2)
+{
+ if (comment1)
+ c1->setText((char *)comment1);
+ if (comment2)
+ c2->setText((char *)comment2);
+}
diff --git a/setedit/settvuti/tprogrdi.cc b/setedit/settvuti/tprogrdi.cc
new file mode 100644
index 0000000..06ad6db
--- /dev/null
+++ b/setedit/settvuti/tprogrdi.cc
@@ -0,0 +1,44 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_string
+#define Uses_TProgress
+#define Uses_TDialog
+#define Uses_TRect
+#define Uses_TProgram
+#define Uses_TDeskTop
+#define Uses_TNoStaticText
+#include <settvuti.h>
+
+static TDialog *d;
+static TProgress *pbar;
+static TView *prevFocus;
+
+void Progress_Init(const char *title, const char *comment)
+{
+ prevFocus=TProgram::deskTop->current;
+ int l=strlen(_(comment))+2;
+
+ d=new TDialog(TRect(0,0,l+6,5),title);
+ // Don't allow the user close it
+ d->flags&=~wfClose;
+ d->options|=ofCentered;
+
+ pbar=new TProgress(TRect(3,2,l+3,3),comment);
+ d->insert(pbar);
+
+ TProgram::deskTop->insert(d);
+}
+
+void Progress_DeInit(void)
+{
+ TProgram::deskTop->remove(d);
+ if (prevFocus)
+ prevFocus->setState(sfActive,True);
+}
+
+void Progress_UpDate()
+{
+ pbar->update();
+}
+
+
diff --git a/setedit/settvuti/tprogres.cc b/setedit/settvuti/tprogres.cc
new file mode 100644
index 0000000..b3bc330
--- /dev/null
+++ b/setedit/settvuti/tprogres.cc
@@ -0,0 +1,80 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Class: TProgress
+ Description:
+ That's a very simply progress indicator used when we don't know how much
+items will be processed and we don't know the user could think the program
+hanged.
+
+***************************************************************************/
+#include <stdio.h> // sprintf()
+#define Uses_string
+#define Uses_AllocLocal
+#define Uses_TProgress
+#define Uses_TView
+#define Uses_TRect
+#define Uses_TGroup
+#define Uses_TDrawBuffer
+#define Uses_TStreamableClass
+#define Uses_fpstream
+#define Uses_TPalette
+#include <settvuti.h>
+
+// Same as static text, after all we are almost this
+#define cpProgress "\x06"
+
+TProgress::TProgress(const TRect& bounds, const char *aMessage) :
+ TView(bounds),
+ message(TVIntl::getTextNew(aMessage)),
+ state(0)
+{
+ len=strlen(message)+3;
+}
+
+TProgress::~TProgress()
+{
+ DeleteArray(message);
+}
+
+void TProgress::draw()
+{
+ AllocLocalStr(string,len);
+ sprintf(string,"%s %c",message,states[state]);
+
+ TDrawBuffer nbuf;
+ nbuf.moveStr(0,string,getColor(1));
+ writeLine(0,0,size.x,1,nbuf);
+}
+
+
+TPalette& TProgress::getPalette() const
+{
+ static TPalette palette(cpProgress,sizeof(cpProgress)-1);
+ return palette;
+}
+
+
+void TProgress::update()
+{
+ state++;
+ if (state>3)
+ state=0;
+ drawView();
+}
+
+void TProgress::write(opstream& os)
+{
+ TView::write(os);
+ os.writeString(message);
+}
+
+void *TProgress::read(ipstream& is)
+{
+ TView::read(is);
+ message=is.readString();
+ return this;
+}
+
+char TProgress::states[4]={'-','\\','|','/'};
diff --git a/setedit/settvuti/tstrlbox.cc b/setedit/settvuti/tstrlbox.cc
new file mode 100644
index 0000000..c9c069f
--- /dev/null
+++ b/setedit/settvuti/tstrlbox.cc
@@ -0,0 +1,102 @@
+/* Copyright (C) 1996-2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStringableListBox
+#define Uses_TEvent
+#define Uses_TKeys
+#include <settvuti.h>
+
+/* List Box used in the keybinding, I think that Borland was wrong in your
+ design, using it the list box isn't limited to collections and can be
+ applied to arrays, lists, etc. */
+TStringableListBox::TStringableListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aScrollBar ) :
+ TListViewer(bounds, aNumCols, 0, aScrollBar),
+ items(0)
+{
+ setRange(0);
+ center=False;
+}
+
+TStringableListBox::TStringableListBox( const TRect& bounds,
+ ushort aNumCols,
+ TScrollBar *aHScrollBar,
+ TScrollBar *aVScrollBar,
+ Boolean aCenterOps ) :
+ TListViewer(bounds, aNumCols, aHScrollBar, aVScrollBar),
+ items(0)
+{
+ setRange(0);
+ center=aCenterOps;
+}
+
+TStringableListBox::~TStringableListBox()
+{
+}
+
+uint32 TStringableListBox::dataSize()
+{
+ return sizeof(TStringableListBoxRec);
+}
+
+void TStringableListBox::getData( void * rec )
+{
+ TStringableListBoxRec *p = (TStringableListBoxRec *)rec;
+ p->items = items;
+ p->selection = focused;
+}
+
+void TStringableListBox::getText( char *dest, ccIndex item, short maxChars )
+{
+ if (items)
+ {
+ items->getText(dest,item,maxChars);
+ dest[maxChars]=EOS;
+ }
+ else
+ *dest=EOS;
+}
+
+void TStringableListBox::newList( TStringable *aList )
+{
+ delete items;
+ items=aList;
+ if (aList!=0)
+ setRange(aList->GetCount());
+ else
+ setRange(0);
+ if (range>0)
+ focusItem(0);
+ drawView();
+}
+
+void TStringableListBox::setData( void *rec )
+{
+ TStringableListBoxRec *p = (TStringableListBoxRec *)rec;
+ newList(p->items);
+ if (center)
+ focusItemCentered(p->selection);
+ else
+ focusItem(p->selection);
+ drawView();
+}
+
+void TStringableListBox::Update(void)
+{
+ setRange(items->GetCount());
+ drawView();
+}
+
+void TStringableListBox::handleEvent(TEvent& event)
+{
+ if (event.what==evKeyDown && event.keyDown.keyCode==kbSpace &&
+ items->taggingSupported())
+ {
+ items->setTag(focused,items->isTagged(focused) ? False : True);
+ drawView();
+ clearEvent(event);
+ return;
+ }
+ TListViewer::handleEvent(event);
+}
+
diff --git a/setedit/settvuti/uisarray.cc b/setedit/settvuti/uisarray.cc
new file mode 100644
index 0000000..fec9b3b
--- /dev/null
+++ b/setedit/settvuti/uisarray.cc
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSArray_Dec
+#include <settvuti.h>
+
+// That's an unsigned int array, the following line is expanded to the
+// full class. Acts just like a macro.
+template class TSArray<unsigned int>;
diff --git a/setedit/settvuti/ussarray.cc b/setedit/settvuti/ussarray.cc
new file mode 100644
index 0000000..aecab6c
--- /dev/null
+++ b/setedit/settvuti/ussarray.cc
@@ -0,0 +1,8 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TSArray_Dec
+#include <settvuti.h>
+
+// That's an unsigned short array, the following line is expanded to the
+// full class. Acts just like a macro.
+template class TSArray<unsigned short>;
diff --git a/setedit/settvuti/viewplus.cc b/setedit/settvuti/viewplus.cc
new file mode 100644
index 0000000..0df3a42
--- /dev/null
+++ b/setedit/settvuti/viewplus.cc
@@ -0,0 +1,249 @@
+/****************************************************************************
+
+ TViewPlus class, copyright (c) 1996 by Salvador E. Tropea (SET)
+
+ Designed for the TCEditor class to be used by Robert Hhne in your RHIDE.
+
+ You can use this file for any purpose if you left the copyrights untouched
+and give me some credit for these functionalities.
+
+ E-Mail: salvador@inti.edu.ar
+
+ Telephone: (+5411) 4759-0013
+
+ Postal Address:
+ Salvador E. Tropea
+ Curapalige 2124
+ (1678) Caseros - 3 de Febrero
+ Prov: Buenos Aires
+ Argentina
+
+ These routines are compatible with Borland's TVision 1.03 and the port of
+those routines to DJGPP.
+
+ The following routines are low level routines that could be putted in
+the TView class. But I made that in a separated class derived from TView
+to avoid the modfication of the original lib.
+
+ Conventions:
+ Returns:
+ 0 Ok, 1 Bad
+
+****************************************************************************/
+
+#define Uses_TView
+#define Uses_TGroup
+#define Uses_TScreen
+#define Uses_TEventQueue
+#include <tv.h>
+
+#define Uses_TViewPlus
+#include "viewplus.h"
+
+#ifdef TVCompf_djgpp
+#include <dos.h>
+#include <go32.h>
+#endif
+
+// From View.cc
+extern TPoint shadowSize;
+
+// SET: Be careful about nibble order
+#ifdef TV_BIG_ENDIAN
+ #define GetAttr(a) ((a) & 0xFF)
+ #define ChangeAttr(v,a) (uint16)(((v) & 0xFF00) | (a))
+ #define AttrOffset 0
+#else
+ #define GetAttr(a) ((a) << 8)
+ #define ChangeAttr(v,a) (((v) & 0xFF) | (a))
+ #define AttrOffset 1
+#endif
+
+// Set the attribute of the X,Y coordinate
+int TViewPlus::setAttrOfCoor(int x, int y, char attr)
+{
+ // Is visible
+ if (!(state & sfVisible)) return 1;
+ // Is inserted
+ if (owner==NULL) return 1;
+
+ // Is inside of the window
+ if (x<0 || x>size.x) return 1;
+ if (y<0 || y>size.y) return 1;
+
+ // Adjust the local x and y to the owner's coordinates
+ y+=origin.y;
+ x+=origin.x;
+
+ TRect *clip=&owner->clip;
+ // Is in the allowed part of screen
+ if (y<clip->a.y || y>=clip->b.y || x<clip->a.x || x>clip->b.x) return 1;
+
+ // Take the top of the views
+ TView *view=owner->last;
+ TView *target=this;
+
+ int aux;
+ #if 0
+ int IsUnderShadow=0;
+ #endif
+ #define Ytest aux
+ #define Xtest aux
+ while (1)
+ {
+ view=view->next;
+ if (view==target) break;
+
+ // If not visible forget it
+ if (!(view->state & sfVisible)) continue;
+
+ // Check the Y range
+ Ytest=view->origin.y;
+ if (y<Ytest) continue;
+ Ytest+=view->size.y;
+ #if 0 // For this application the shadow is like a solid thing
+ if (y>=Ytest)
+ {
+ // Test the shadow
+ if (!(view->state & sfShadow)) continue;
+ Ytest+=shadowSize.y;
+ if (y>=Ytest) continue;
+ // Ok the Y is under a shadow, now, is the X in the range of the
+ // shadow?
+ Xtest=view->origin.x+shadowSize.x;
+ if (x>=Xtest && x<Xtest+view->size.x) IsUnderShadow++;
+ continue;
+ }
+ #else
+ if (view->state & sfShadow)
+ Ytest+=shadowSize.y; // Add the shadow
+ if (y>=Ytest) continue;
+ #endif
+
+ // Check the X range
+ Xtest=view->origin.x;
+ if (x<Xtest) continue;
+ Xtest+=view->size.x;
+ #if 0 // For this application the shadow is like a solid thing
+ if (x>=Xtest)
+ {
+ // Test the shadow
+ if (!(view->state & sfShadow)) continue;
+ Xtest+=shadowSize.x;
+ if (x>=Xtest) continue;
+ // Ok the X is under a shadow, now, is the Y in the range of the
+ // shadow?
+ Ytest=view->origin.y+shadowSize.y;
+ if (y>=Ytest && y<Ytest+view->size.y) IsUnderShadow++;
+ continue;
+ }
+ #else
+ if (view->state & sfShadow)
+ Xtest+=shadowSize.x;
+ if (x>=Xtest) continue;
+ #endif
+
+ // OK is under this object, no draw needed
+ return 1;
+ }
+
+ // Well, this position is visible, now do it
+ if (owner->buffer)
+ {
+ // If the view have a buffer draw on it
+ unsigned offset = y*owner->size.x+x;
+ if (owner->buffer==TScreen::screenBuffer)
+ {
+ // Is to the screen
+ #if 0
+ disable();
+ #endif
+ int OverMouse = (y==TEventQueue::curMouse.where.y) && (x==TEventQueue::curMouse.where.x);
+ #if 0
+ enable();
+ #endif
+ if (OverMouse)
+ TMouse::hide();
+ // Ancient code: *(char *)(MK_FP(0xB800,1+(offset<<1)))=attr;
+ #ifdef TVCompf_djgpp
+
+ long _buffer;
+ #if 1 // def RHIDE // RHIDE supports dual display
+ _buffer = (TScreen::dual_display ? 0xb0000 : ScreenPrimary) + (offset<<1) + 1;
+ //TScreen::GetPage()*0x1000;
+ #else
+ _buffer = ScreenPrimary + (offset<<1) + 1 + TScreen::GetPage()*0x1000;
+ #endif
+ dosmemput((const void *)(&attr),1,_buffer);
+
+ #else // DJGPP
+ TScreen::setCharacter(offset,
+ ChangeAttr(TScreen::getCharacter(offset),
+ GetAttr((unsigned char)attr)));
+ #endif
+ if (OverMouse)
+ TMouse::show();
+ }
+ else
+ { // Is to the cache buffer
+ *((char *)(&owner->buffer[offset])+AttrOffset)=attr;
+ }
+ }
+ // Now see if is locked
+ if (owner->lockFlag) return 0;
+ // Nop, then pass the info to the owner, it's a recursive process, that stops
+ // when the real owner of the screen is updated.
+ ((TViewPlus *)owner)->setAttrOfCoor(x,y,attr);
+ return 0;
+}
+
+// read the attributes of a Column
+int TViewPlus::getAttrsOfCol(int x, int y1, int y2, char *attr)
+{
+ if (owner)
+ {
+ char *buffer=(char *)owner->buffer;
+
+ if (buffer)
+ {
+ y1+=origin.y;
+ y2+=origin.y;
+ x+=origin.x;
+ int sx=owner->size.x,i;
+ unsigned offset=((x+y1*sx)<<1)+1;
+ sx*=2;
+ for (i=0; y1<=y2; y1++, i++, offset+=sx)
+ attr[i]=buffer[offset];
+ }
+ else
+ return 1;
+ return 0;
+ }
+ return 1;
+}
+
+// read the attributes of a row
+int TViewPlus::getAttrsOfRow(int x1, int x2, int y, char *attr)
+ {
+ if (owner)
+ {
+ char *buffer=(char *)owner->buffer;
+
+ if (buffer)
+ {
+ y+=origin.y;
+ x1+=origin.x;
+ x2+=origin.x;
+ int sx=owner->size.x,i;
+ unsigned offset=((x1+y*sx)<<1)+1;
+ for (i=0; x1<=x2; x1++, i++, offset+=2)
+ attr[i]=buffer[offset];
+ }
+ else
+ return 1;
+ return 0;
+ }
+ return 1;
+}
+
+
diff --git a/setedit/snapshot.pl b/setedit/snapshot.pl
new file mode 100644
index 0000000..a30ea51
--- /dev/null
+++ b/setedit/snapshot.pl
@@ -0,0 +1,187 @@
+#!/usr/bin/perl
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+
+# Needs: cvs, cp, tar, gzip, zip, uname, chmod, dtou (only in DOS)
+
+# Configuration:
+$a=`uname`;
+$DOS= $a=~/DOS/;
+$pkg='setedit';
+
+
+if (length($ARGV[0])==0)
+ {
+ die "snapshot.pl Copyright (c) 1999 by Salvador E. Tropea
+
+ Creates a patch and new files needed to apply over a release to recreate
+the current state of the project. Some processing of the cvs output is
+needed for it.
+
+Use: snapshot.pl CVS_REVISION\n";
+ }
+
+if ($DOS)
+ {
+ $crlf="\n";
+ }
+else
+ {
+ $crlf="\r\n";
+ }
+
+# TODO enable it and do OS ok
+print "Running diff against revision: $ARGV[0]\n\n";
+system(RedirErrOut("cvs diff -u -r $ARGV[0]",'error.out','std.out'));
+
+($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst)=localtime();
+$mon++;
+$year+=1900;
+$snapdir="snap-shot-$pkg-";
+$fecha="$year";
+$fecha.='0' unless $mon>=10;
+$fecha.=$mon;
+$fecha.='0' unless $mday>=10;
+$fecha.=$mday;
+$snapdir.=$fecha;
+mkdir($snapdir,00755);
+
+# Process the diffs file to copy binary files that changed
+print "Looking for binary files that changed\n\n";
+open(FIL,'std.out');
+open(DEST,">$snapdir/main.pat");
+$used=1;
+while ($a=<FIL>)
+ {
+ if ($a =~ /RCS file: (\/[^\/]+)+\/$pkg\/([^,]+)/)
+ {
+ $curfile=$2;
+ if ($1=~/\/$pkg/) { $curfile=$pkg.'/'.$curfile; }
+ $used=0;
+ }
+ # The idiot just puts the name of the file, of course patch isn't magician
+ # and also needs to know the directory
+ if ($used==0 && $a =~ /\+\+\+ ([^\s]+)/)
+ {
+ $a =~ s/\+\+\+ ([^\s]+)/\+\+\+ $curfile/;
+ $used=1;
+ }
+ if ($a =~ /Binary files /)
+ {
+ print "$curfile is binary and changed, copying\n";
+ # Redirect the error because directories generates problems
+ system(RedirErr("cp -Pp $curfile $snapdir",'/dev/null'));
+ }
+ print DEST ($a);
+ }
+close FIL;
+close DEST;
+`rm std.out`;
+dtou("$snapdir/main.pat");
+
+# Process the new files
+print "\nCopying new files\n\n";
+open(FIL,'error.out');
+while ($a=<FIL>)
+ {
+ if ($a =~ /is not in file ([^\n]+)/)
+ {
+ print "$1 is a new file, copying";
+ system(RedirErr("cp -Pp $1 $snapdir",'/dev/null'));
+ $a=$1;
+ if ($a !~ /((.*)\.(gpr|a|h32|sft|dst|gdt|exe|o|pif|zip))/)
+ {
+ dtou("$snapdir/$a");
+ print "\n";
+ }
+ else
+ {
+ print " [Binary]\n";
+ }
+ }
+ }
+close FIL;
+`rm error.out`;
+
+# Generate a file to do the patch easier
+open(FIL,">$snapdir/doit.bat");
+print FIL ("patch -p0 < main.pat$crlf");
+close FIL;
+open(FIL,">$snapdir/doit");
+print FIL ("#!/bin/sh\npatch -p0 < main.pat\n");
+close FIL;
+dtou("$snapdir/doit");
+`chmod +x $snapdir/doit`;
+
+# Compress it
+print "\nCompressing the snap-shot\n";
+if ($DOS)
+ {
+ `tar -zcvf $snapdir.tar.gz $snapdir`;
+ `zip -9rm $snapdir $snapdir`;
+ }
+else
+ {
+ `tar -zcvf $snapdir.tar.gz $snapdir`;
+ `zip -9rm $snapdir $snapdir`;
+ }
+
+# Generate an HTML file with links to download the patches
+open(FIL,">snap-$pkg.html");
+print FIL ("<HTML><HEAD><TITLE>Patch for the last snap-shot of $pkg</TITLE></HEAD>\n");
+print FIL ('<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">'."\n");
+print FIL ("<Font size=+2><b>Snap shot $fecha</b></Font><Font size=+1><p>\n");
+print FIL ("Uncompress the file in a temporal directory, a $snapdir directory will be\n");
+print FIL ("created containing all the files and directories. Copy these\n");
+print FIL ("files and directories over the old sources ($ARGV[0]) and then run the <i>doit.bat</i>\n");
+print FIL ("script (or <i>doit</i> for Linux).<br>\n");
+print FIL ("Ignore errors from patch about non-existent files with .cvsignore\n");
+print FIL ("names, they are CVS specific and not distributed.<br>\n");
+print FIL ("<b><Font Color=#FFA0A0>DON'T FORGET TO ALSO UPGRADE THE TV LIBRARY TO THE LAST AVAILABLE SNAP-SHOT</Font></b><br>\n");
+print FIL ('<p>File zipped: <a href="'.$snapdir.'.zip">'.$snapdir.'.zip</a><p>');
+print FIL ('File tar/gzipped: <a href="'.$snapdir.'.tar.gz">'.$snapdir.'.tar.gz</a><p>');
+print FIL ("Note I: Both patch files are in UNIX format, that is because djgpp and SETEdit supports both type of files. I can't say the same about Linux's patch and gcc.<p>");
+print FIL ("Note II: This file was created by the script that creates the snap-shot, sorry if something looks funny.\n");
+print FIL ("</HTML></BODY>\n");
+close FIL;
+dtou("snap-$pkg.html");
+
+
+die "Chau!\n";
+
+sub dtou
+{
+ if ($DOS)
+ { # djgpp is better than Linux, both \n and \r\n are suported
+ `dtou $_[0]`;
+ }
+}
+
+sub RedirErr
+{
+ local $ret;
+ if ($DOS)
+ {
+ $ret="redir -e $_[1] $_[0]";
+ }
+ else
+ {
+ $ret="$_[0] 2> $_[1]";
+ }
+ $ret;
+}
+
+sub RedirErrOut
+{
+ local $ret;
+ if ($DOS)
+ {
+ $ret="redir -e $_[1] -o $_[2] $_[0]";
+ }
+ else
+ {
+ $ret="$_[0] 2> $_[1] > $_[2]";
+ }
+ $ret;
+}
diff --git a/setedit/streams/sceditor.cc b/setedit/streams/sceditor.cc
new file mode 100644
index 0000000..30b413c
--- /dev/null
+++ b/setedit/streams/sceditor.cc
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+
+/*------------------------------------------------------------*/
+/* filename - sceditor.cc */
+/* */
+/* Registeration objects for the following classes: */
+/* TCEditor */
+/* TCFileEditor */
+/* TCEditWindow */
+/*------------------------------------------------------------*/
+
+/*------------------------------------------------------------*/
+/* */
+/* Needed to write the objects to a stream. */
+/* */
+/*------------------------------------------------------------*/
+
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+
+#define Uses_TStringCollection
+#define Uses_TView
+#define Uses_TWindow
+#define Uses_TStreamableClass
+
+#define Uses_TCEditor
+#define Uses_TCFileEditor
+#define Uses_TCEditWindow
+#include "ceditor.h"
+
+__link( RView )
+__link( RWindow )
+__link( RScrollBar )
+__link( RSIndicator )
+// TIndicator is neede to read old desktop files. The patch from Robert to change
+// it by TSIndicator was incomplete and was a source of a bug in 0.4.23 release.
+__link( RIndicator )
+
+TStreamableClass RCEditor( TCEditor::name,
+ TCEditor::build,
+ __DELTA(TCEditor)
+ );
+
+TStreamableClass RCEditWindow( TCEditWindow::name,
+ TCEditWindow::build,
+ __DELTA(TCEditWindow)
+ );
diff --git a/setedit/streams/sedhelp.cc b/setedit/streams/sedhelp.cc
new file mode 100644
index 0000000..65e3bce
--- /dev/null
+++ b/setedit/streams/sedhelp.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/******************************************************************************
+
+ This file is part of the TCEditor class by SET.
+
+******************************************************************************/
+
+/*------------------------------------------------------------*/
+/* filename - sedhelp.cc */
+/* */
+/* Registeration objects for the following classes: */
+/* TEditorCollection */
+/*------------------------------------------------------------*/
+
+/*------------------------------------------------------------*/
+/* */
+/* Needed to write the objects to a stream. */
+/* */
+/*------------------------------------------------------------*/
+
+// That's the first include because is used to configure the editor.
+#include "ceditint.h"
+
+#define Uses_TCollection
+#define Uses_TListBox
+#define Uses_TStringCollection
+#define Uses_TWindow
+#define Uses_TStreamableClass
+#include <tv.h>
+
+#define Uses_TCEditor
+#define Uses_TCFileEditor
+#define Uses_TCEditWindow
+#include <ceditor.h>
+
+//#include <ed.h>
+
+TStreamableClass RDskWinHelp( TDskWinHelp::name,
+ TDskWinHelp::build,
+ __DELTA(TDskWinHelp)
+ );
diff --git a/setedit/streams/ssindica.cc b/setedit/streams/ssindica.cc
new file mode 100644
index 0000000..3a761a4
--- /dev/null
+++ b/setedit/streams/ssindica.cc
@@ -0,0 +1,12 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#define Uses_TStreamableClass
+#define Uses_TSIndicator
+#include <ceditor.h>
+__link( RView )
+
+TStreamableClass RSIndicator( TSIndicator::name,
+ TSIndicator::build,
+ __DELTA(TSIndicator)
+ );
+
diff --git a/setedit/tools/TVpo.pl b/setedit/tools/TVpo.pl
new file mode 100644
index 0000000..9680af9
--- /dev/null
+++ b/setedit/tools/TVpo.pl
@@ -0,0 +1,15 @@
+open(FIL,'tvision.po') || die;
+
+print "// This is a fake file containing the strings that should be
+// internationalized and are defined in Turbo Vision (outside
+// setedit).
+
+";
+
+while ($a=<FIL>)
+ {
+ if ($a=~/msgid \"(.*)\"/)
+ {
+ print "__(\"$1\")\n";
+ }
+ }
diff --git a/setedit/tools/applycvs.pl b/setedit/tools/applycvs.pl
new file mode 100755
index 0000000..ab9256d
--- /dev/null
+++ b/setedit/tools/applycvs.pl
@@ -0,0 +1,209 @@
+#!/usr/bin/perl
+# Copyright (C) 2002 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Used to synchronize my CVS copy using synmail output.
+# This script was designed to use the mails sent by syncmail installed
+# in the Source Forge CVS.
+# It takes a batch of mails and does the following tasks:
+# * Extracts the ci message.
+# * Applies the patches to the correct files, the patch isn't easy to
+# apply directly because patch doesn't know in which directory is the
+# file.
+# * If the process succeeds modifies change.log and does a check-in of
+# the patched files.
+# * In case of errors the process is reverted removing the patched files
+# and getting fresh copies from CVS. The ci message remains in
+# /tmp.mensaje and the last patch processed in /tmp/parche.
+#
+# IMPORTANT! the script assumes the files to patch are exactly the same
+# you'll get using a cvs update, if this isn't true the roll-back will
+# fail.
+#
+
+require "miscperl.pl";
+
+#$simulate=1;
+
+$estado=0;
+$LogMessage='';
+$toPatch;
+$toSkip=0;
+$errors=0;
+$applied=0;
+$dirNewFile='';
+$inNewFile=0;
+$files='change.log ';
+while ($a=<>)
+ {
+ if ($estado==1)
+ {
+ if ($a ne "\n")
+ {
+ $LogMessage.=$a;
+ print FIL $a;
+ }
+ else
+ {
+ $estado=0;
+ close(FIL);
+ print "Mensaje:\n$LogMessage";
+ }
+ }
+ elsif ($estado==2)
+ {
+ if ($a=~/^RCS file\: \/cvsroot\/([^\/]*)\/([^\/]*)\/(.*)\,v/)
+ {
+ $estado=3;
+ $toPatch=$3;
+ $toPatch=~s/Attic\///;
+ }
+ else
+ {
+ print $a;
+ }
+ }
+ elsif ($estado==3)
+ {
+ if ($a=~/diff /)
+ {
+ $estado=4;
+ open(FIL,">/tmp/parche") || die;
+ print FIL $a;
+ }
+ }
+ elsif ($estado==4)
+ {
+ if ($a=~/^(\*\*\*|\-\-\-) (.*)\t(.*)\t(.*)/)
+ {
+ print FIL "$1 $toPatch\t$3\t$4\n";
+ }
+ elsif ($a eq "***************\n")
+ {
+ print FIL $a;
+ $estado=5;
+ }
+ else
+ {
+ print FIL $a;
+ }
+ }
+ elsif ($estado==5)
+ {
+ if ($a=~/^(\*\*\*|\-\-\-) (\d*),(\d*) (\*\*\*\*|\-\-\-\-)\n/)
+ {
+ $toSkip=$3-$2+1;
+ print FIL $a;
+ $firstLine=1;
+ }
+ elsif ($a=~/^(\*\*\*|\-\-\-) (\d*) (\*\*\*\*|\-\-\-\-)\n/)
+ {
+ $toSkip=1;
+ print FIL $a;
+ $firstLine=1;
+ }
+ elsif (!$toSkip)
+ {
+ if (($a ne "***************\n") && ($a ne "\\ No newline at end of file\n"))
+ {
+ $estado=0;
+ close(FIL);
+ $ret=RunCommand("patch -p0 -i /tmp/parche");
+ print "Patch result: $ret\n";
+ if ($ret) { $errors++; }
+ $applied++;
+ $files.=$toPatch.' ';
+ }
+ else
+ {
+ print FIL $a;
+ }
+ }
+ else
+ {
+ print FIL $a;
+ $toSkip--;
+ if ($firstLine)
+ {
+ $firstLine=0;
+ if ($a eq "\n")
+ {
+ $estado=0;
+ close(FIL);
+ $ret=RunCommand("patch -p0 -i /tmp/parche");
+ print "Patch result: $ret\n";
+ if ($ret) { $errors++; }
+ $applied++;
+ $files.=$toPatch.' ';
+ }
+ }
+ }
+ }
+ elsif ($a=~/^Index\: (.*)/)
+ {
+ if ($inNewFile)
+ {
+ close FIL;
+ $inNewFile=0;
+ }
+ $estado=2 unless $1 eq 'change.log';
+ print "$1\n";
+ }
+ elsif ($a=~/\-\-\- NEW FILE: (.*) \-\-\-/)
+ {
+ if ($inNewFile)
+ {
+ close FIL;
+ }
+ $dirNewFile='.' if !$dirNewFile;
+ print "New file: $dirNewFile/$1\n";
+ open(FIL,">$dirNewFile/$1") || die;
+ $inNewFile=1;
+ $newFiles.="$dirNewFile/$1 ";
+ }
+ elsif ($inNewFile)
+ {
+ print FIL $a;
+ }
+ elsif ($a=~/Update of \/cvsroot(\/[^\/]*)(\/[^\/]*\/)(.*$)/)
+ {
+ $dirNewFile=$3;
+ }
+ elsif (!$LogMessage && $a=~/^Log Message\:/)
+ {
+ $estado=1;
+ open(FIL,">/tmp/mensaje") || die;
+ }
+ }
+if (!$errors && $applied)
+ {
+ print "Successful process, doing a check-in\n";
+ if ($newFiles)
+ {
+ RunCommand("cvs add $newFiles");
+ }
+ $a=cat('change.log');
+ $a=~s/\$Log\: (.*),v \$/\$Log\: $1,v \$\./;
+ replace('change.log',$a) unless $simulate;
+ RunCommand("cvs ci -F /tmp/mensaje $files $newFiles");
+ unlink('/tmp/mensaje','/tmp/parche');
+ }
+elsif ($applied)
+ {
+ print "Errors while patching, reverting patched files\n";
+ RunCommand("rm $files");
+ RunCommand("cvs update $files");
+ }
+
+sub RunCommand
+{
+ my ($command)=@_;
+
+ if ($simulate)
+ {
+ print "Ejecutes: $command\n";
+ return 0;
+ }
+ return system($command);
+}
+
diff --git a/setedit/tools/cmclist.c b/setedit/tools/cmclist.c
new file mode 100644
index 0000000..0e8ff3d
--- /dev/null
+++ b/setedit/tools/cmclist.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*
+ Este programa lo use para generar la lista ordenada alfabeticamente de los
+ comandos del editor.
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+typedef struct
+{
+ char *name;
+ int val;
+} str;
+
+int compara(const void *e1, const void *e2)
+{
+ return strcmp(((str *)e1)->name,((str *)e2)->name);
+}
+
+int main(void)
+{
+ FILE *f;
+ int cant=0,i;
+ char *s;
+ char buf[80];
+ str Lista[255];
+
+ f=fopen("menubind.h","rt");
+ fgets(buf,80,f);
+ while (!feof(f))
+ {
+ s=strtok(buf," ");
+ Lista[cant].name=strdup(s+3);
+ s=strtok(NULL," ");
+ Lista[cant].val=atoi(s);
+ cant++;
+ fgets(buf,80,f);
+ }
+ fclose(f);
+ qsort(Lista,cant,sizeof(str),compara);
+ for (i=0; i<cant; i++)
+ printf("{ \"%s\", %d },\n",Lista[i].name,Lista[i].val-600);
+}
+
diff --git a/setedit/tools/conv.cc b/setedit/tools/conv.cc
new file mode 100644
index 0000000..35c3309
--- /dev/null
+++ b/setedit/tools/conv.cc
@@ -0,0 +1,81 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*
+ Este programa lo use para convertir los viejos archivos .h de teclado al
+ nuevo formato (.lay)
+*/
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#define GetLine() fgets(buf,199,f)
+
+char buf[200];
+char Name[11];
+
+typedef char ScanNamesType[128][11];
+ScanNamesType ScanNames;
+
+int main(int argc, char *argv[])
+{
+ char *s;
+ int i,pos,unk,k;
+
+ if (argc==1)
+ {
+ printf("Uso: %s archivos ...\n",argv[0]);
+ return 1;
+ }
+ FILE *f;
+ for (k=1; k<argc; k++)
+ {
+ printf("Procesando: %s\n",argv[k]);
+ f=fopen(argv[k],"rt");
+ if (!f)
+ return 1;
+ for (i=0; i<128; i++)
+ ScanNames[i][0]=0;
+ GetLine();
+ while (!feof(f))
+ {
+ if (strncmp(buf,"#define",7)==0)
+ {
+ for (s=buf+7; *s && ucisspace(*s); s++);
+ if (*s)
+ {
+ for (i=0;i<10 && *s && ucisalnum(*s); s++) Name[i++]=*s;
+ Name[i]=0;
+ if (Name[0]=='U' && Name[1]=='N' && Name[2]=='K')
+ *Name=0;
+ if (ucisalnum(*s))
+ {
+ printf("Mide ms de 10!:\n%s",buf);
+ return 1;
+ }
+ for (; *s && ucisspace(*s); s++);
+ if (*s=='?')
+ pos=127;
+ else
+ pos=atoi(s);
+ if (pos>127)
+ {
+ printf("Cuidado scan %d\n%s",pos,buf);
+ pos&=127;
+ }
+ strcpy(ScanNames[pos],Name);
+ }
+ }
+ GetLine();
+ }
+ for (unk=1,i=0; i<128; i++)
+ if (ScanNames[i][0]==0)
+ sprintf(ScanNames[i],"UNK%d",unk++);
+ fclose(f);
+ f=fopen(argv[k],"wt");
+ for (i=0; i<128; i++)
+ fprintf(f,"%s %d\n",ScanNames[i],i);
+ fclose(f);
+ }
+ return 0;
+}
diff --git a/setedit/tools/cvssget b/setedit/tools/cvssget
new file mode 100644
index 0000000..c6b05d3
--- /dev/null
+++ b/setedit/tools/cvssget
@@ -0,0 +1,6 @@
+#!/bin/sh
+tools/cvssyncget setedit $1 "makes/*.mak mp3/libamp/*.mak mp3/mpegsound/*.mak" > cvsdiff
+gzip -9 cvsdiff
+echo "cvsdiff.gz and files.tar.gz generated"
+echo "Now tag this to be able to generate another delta in the future"
+
diff --git a/setedit/tools/cvssput b/setedit/tools/cvssput
new file mode 100755
index 0000000..e0e7a93
--- /dev/null
+++ b/setedit/tools/cvssput
@@ -0,0 +1,6 @@
+#!/bin/sh
+gzip -d cvsdiff.gz
+tools/cvssyncput cvsdiff files.tar.gz
+echo "CVS synchronized (I hope ;-)"
+echo "Now tag this for future reference"
+
diff --git a/setedit/tools/cvssyncget.cc b/setedit/tools/cvssyncget.cc
new file mode 100644
index 0000000..c4d066d
--- /dev/null
+++ b/setedit/tools/cvssyncget.cc
@@ -0,0 +1,397 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+typedef struct
+{
+ char *file;
+ char *chead;
+ char *ctag;
+ int rev;
+ int type;
+} stHeader;
+
+const int maxLine=1024;
+const int tfNorm=0, tfBin=1, tfMaskBinNorm=1, tfRemoved=2;
+
+static
+void ChopEOL(char *b)
+{
+ int l=strlen(b);
+ if (b[l-1]=='\n') b[l-1]=0;
+}
+
+int GetHeader(FILE *f, const char *tag, stHeader *h)
+{
+ char b[maxLine],*rev;
+ int tags=0;
+
+ free(h->file);
+ free(h->chead);
+ free(h->ctag);
+ h->file=h->chead=h->ctag=0;
+ h->type=0;
+ while (!feof(f))
+ {
+ if (fgets(b,maxLine-1,f))
+ {
+ ChopEOL(b);
+ if (tags)
+ {
+ if (*b=='\t')
+ {
+ char *e=strchr(b,':');
+ if (!e)
+ {
+ printf("Error, tag expected in:\n%s\n",b);
+ return 0;
+ }
+ *e=0;
+ if (strcmp(tag,b+1)==0)
+ {
+ free(h->ctag);
+ h->ctag=strdup(e+2);
+ }
+ continue;
+ }
+ tags=0;
+ }
+ if (strncmp(b,"Working file",12)==0)
+ {
+ free(h->file);
+ h->file=strdup(b+14);
+ }
+ else if (strncmp(b,"RCS file: ",10)==0)
+ {
+ if (strstr(b,"Attic"))
+ h->type|=tfRemoved;
+ }
+ else if (strncmp(b,"head: ",6)==0)
+ {
+ free(h->chead);
+ h->chead=strdup(b+6);
+ }
+ else if (strncmp(b,"symbolic names:",15)==0)
+ {
+ tags=1;
+ }
+ else if (strncmp(b,"keyword substitution: ",22)==0)
+ {
+ h->type|=*(b+22)=='b' ? tfBin : tfNorm;
+ }
+ else if ((rev=strstr(b,"selected revisions: "))!=0)
+ {
+ h->rev=atoi(rev+20);
+ }
+ else if (strncmp(b,"----------------------------",28)==0)
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static
+char *StrTok(char *str, char *from, int l)
+{
+ if (from-str>=l) return 0;
+ char *s;
+ for (s=from; *s && *s!='.'; s++);
+ *s=0;
+ return from;
+}
+
+static
+int CompareRev(const char *r1, const char *r2)
+{
+ int l1=strlen(r1);
+ char cr1[l1+1];
+ strcpy(cr1,r1);
+ int l2=strlen(r2);
+ char cr2[l2+1];
+ strcpy(cr2,r2);
+
+ char *vr1=StrTok(cr1,cr1,l1);
+ char *vr2=StrTok(cr2,cr2,l2);
+ while (vr1 && vr2)
+ {
+ int ir1=atoi(vr1);
+ int ir2=atoi(vr2);
+ if (ir1>ir2)
+ return 1;
+ if (ir1<ir2)
+ return -1;
+ vr1=StrTok(cr1,vr1+strlen(vr1)+1,l1);
+ vr2=StrTok(cr2,vr2+strlen(vr2)+1,l2);
+ }
+ if (vr1)
+ return 1;
+ if (vr2)
+ return -1;
+ return 0;
+}
+
+static
+int CreateTmpFile(char *s)
+{
+ strcpy(s,"/tmp/csXXXXXX");
+ return mkstemp(s);
+}
+
+typedef struct
+{
+ char *rev;
+ long start,end;
+} stLog;
+
+const int maxLogs=64;
+stLog Logs[maxLogs];
+const int maxBinFiles=128;
+char *BinFiles[maxBinFiles];
+int cantBinFiles=0;
+
+void DumpEntry(FILE *f, int index)
+{
+ fseek(f,Logs[index].start,SEEK_SET);
+ long len=Logs[index].end-Logs[index].start;
+ char buf[len+1];
+ fread(buf,len,1,f);
+ buf[len]=0;
+ fputs(buf,stdout);
+}
+
+void ProcessFile(const char *file, const char *tag, const char *module,
+ const char *spFiles, int JustShow)
+{
+ FILE *f=fopen(file,"rt");
+ if (!f)
+ {
+ printf("Error opening %s\n",file);
+ return;
+ }
+
+ stHeader h;
+ memset(&h,0,sizeof(h));
+ char b[maxLine];
+ int print,revsTot=0,newFiles=0;
+ long pos;
+ while (GetHeader(f,tag,&h))
+ {
+ int newFile=0;
+ fprintf(stderr,"%s\n",h.file);
+ if (!h.ctag)
+ {
+ if (h.type & tfRemoved)
+ {
+ //printf("Removed file? %s\n",h.file);
+ h.ctag=strdup("999");
+ }
+ else
+ {
+ //printf("New file? %s\n",h.file);
+ h.ctag=strdup("0");
+ newFile=1;
+ newFiles++;
+ }
+ fflush(stdout);
+ }
+ else
+ {
+ if (h.type & tfRemoved)
+ {
+ printf("Borrada %s\n",h.file);
+ return;
+ }
+ }
+ if (CompareRev(h.chead,h.ctag)==1)
+ {
+ printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+ printf("%sFile: \"%s\" (head: %s, tag==%s)\n",newFile ? "New " : "",h.file,
+ h.chead,h.ctag);
+ printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+ }
+ int index=0,end=0;
+ while (!end && !feof(f))
+ {
+ fgets(b,maxLine-1,f);
+ ChopEOL(b);
+ if (strncmp(b,"revision",8)!=0)
+ {
+ printf("Error revision expected in:\n%s\n",b);
+ return;
+ }
+ print=0;
+ if (CompareRev(b+9,h.ctag)>=0)
+ {
+ print=1;
+ Logs[index].rev=strdup(b+9);
+ }
+
+ //if (print)
+ // fprintf(stderr," Revision %s:\n",Logs[index].rev);
+ int start=0;
+ while (!feof(f))
+ {
+ pos=ftell(f);
+ if (fgets(b,maxLine-1,f))
+ {
+ ChopEOL(b);
+ if (strncmp(b,"----------------------------",28)==0 && b[28]!='-')
+ break;
+ if (strncmp(b,"============================",28)==0)
+ {
+ end=1;
+ break;
+ }
+ if (print && !start)
+ {
+ Logs[index].start=pos;
+ start=1;
+ }
+ }
+ }
+ if (print)
+ {
+ Logs[index].end=pos;
+ index++;
+ if (index==maxLogs)
+ {
+ printf("Too much logs (%s)\n",index);
+ return;
+ }
+ }
+ }
+ //if (CompareRev(h.chead,h.ctag)==1)
+ // printf("--------------------------\n");
+ int minEntries=newFile ? 0 : 1;
+ int orig=1,first=1,wasco;
+ if (index>minEntries)
+ {
+ //printf("Volcando %d-1 entradas:\n",index);
+ long pos=ftell(f);
+ for (index-=minEntries+1; index>=0; --index)
+ {
+ if (JustShow)
+ printf("* Log\n");
+ else
+ DumpEntry(f,index);
+ if ((h.type & tfMaskBinNorm)!=tfBin)
+ {
+ printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
+ if (newFile && orig)
+ {
+ sprintf(b,"cvs -z 9 co -p -r %s %s/%s",Logs[index].rev,module,h.file);
+ orig=0;
+ wasco=1;
+ }
+ else
+ {
+ sprintf(b,"cvs -z 9 diff -u -r %s -r %s %s",Logs[index+1].rev,Logs[index].rev,h.file);
+ revsTot++;
+ wasco=0;
+ }
+ if (JustShow)
+ puts(b);
+ else
+ {
+ fprintf(stderr,"%s\n",b);
+ FILE *d=popen(b,"r");
+ int start=wasco ? 1 : 0;
+ while (!feof(d))
+ {
+ if (fgets(b,maxLine-1,d))
+ {
+ if (!start && strncmp(b,"diff",4)==0)
+ start=1;
+ /*if (!start && strncmp(b,"***************",15)==0)
+ {
+ start=1;
+ continue;
+ }*/
+ if (start)
+ printf("%s",b);
+ }
+ }
+ pclose(d);
+ }
+ printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
+ }
+ if (newFile && first)
+ first=0;
+ else
+ free(Logs[index+1].rev);
+ }
+ fseek(f,pos,SEEK_SET);
+ if ((h.type & tfMaskBinNorm)==tfBin)
+ {
+ revsTot++;
+ if (cantBinFiles==maxBinFiles)
+ {
+ printf("Too much binary files (%d)\n",cantBinFiles);
+ return;
+ }
+ BinFiles[cantBinFiles++]=strdup(h.file);
+ }
+ }
+ if (index)
+ free(Logs[0].rev);
+ }
+ fprintf(stderr,"Total revisions: %d\nNew files: %d\n",revsTot,newFiles);
+ // Take changed binaries and special files
+ if (JustShow)
+ {
+ int i;
+ for (i=0; i<cantBinFiles; i++)
+ puts(BinFiles[i]);
+ }
+ else
+ {
+ char cft[16];
+ int ft=CreateTmpFile(cft);
+ if (cft>=0)
+ {
+ int i;
+ for (i=0; i<cantBinFiles; i++)
+ {
+ write(ft,BinFiles[i],strlen(BinFiles[i]));
+ write(ft," ",1);
+ }
+ write(ft,spFiles,strlen(spFiles));
+ close(ft);
+ sprintf(b,"tar zcf files.tar.gz `cat %s`",cft);
+ fprintf(stderr,"%s\n",b);
+ system(b);
+ unlink(cft);
+ }
+ }
+ fclose(f);
+}
+
+
+int main(int argc, char *argv[])
+{
+ if (argc!=4)
+ {
+ printf("cvssyncget Copyright (c) 2001 by Salvador E. Tropea\n");
+ printf("Generates files needed to synchronize two cvs trunks\n\n");
+ printf("Use: cvssyncget module tag special_files > dest_file\n\n");
+ return 1;
+ }
+ char cft[16];
+ int ft=CreateTmpFile(cft);
+ if (ft==-1)
+ {
+ printf("Error creating temporal file\n");
+ return 2;
+ }
+ char b[32];
+ sprintf(b,"cvs log -b > %s",cft);
+ system(b);
+
+ //ProcessFile(cft,"i0447","setedit","makes/*.mak",1);
+ //fprintf(stderr,"Tag: %s, proyecto: %s\n",argv[2],argv[1]);
+ ProcessFile(cft,argv[2],argv[1],argv[3],0);
+
+ unlink(cft);
+ return 0;
+}
diff --git a/setedit/tools/cvssyncput.cc b/setedit/tools/cvssyncput.cc
new file mode 100644
index 0000000..194862f
--- /dev/null
+++ b/setedit/tools/cvssyncput.cc
@@ -0,0 +1,181 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+const int maxLine=1024;
+const char *separator1="@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
+
+static
+void ChopEOL(char *b)
+{
+ int l=strlen(b);
+ if (b[l-1]=='\n') b[l-1]=0;
+}
+
+static
+char *GetFileName(char *s)
+{
+ if (*s!='"') return 0;
+ char *b;
+ for (b=s+1; *b && *b!='"'; b++);
+ *b=0;
+ return strdup(s+1);
+}
+
+static
+void CreateTmpFile(FILE *f, char *cf, int &endM)
+{
+ char b[maxLine];
+ long start=ftell(f),end;
+ do
+ {
+ end=ftell(f);
+ fgets(b,maxLine-1,f);
+ }
+ while (!feof(f) && *b!='~' && strncmp(b,separator1,sizeof(separator1)-1)!=0);
+ endM=*b=='@';
+ if (feof(f))
+ {
+ printf("Unexpected end of file\n");
+ exit(2);
+ }
+ long pos=ftell(f);
+ strcpy(cf,"/tmp/csXXXXXX");
+ int fh=mkstemp(cf);
+ if (fh==-1)
+ {
+ printf("Error creating temporal file\n");
+ exit(3);
+ }
+ long l=end-start;
+ char buf[l];
+ fseek(f,start,SEEK_SET);
+ fread(buf,l,1,f);
+ fseek(f,pos,SEEK_SET);
+ write(fh,buf,l);
+ close(fh);
+}
+
+void ProcessFile(const char *fileIn, int noCI)
+{
+ FILE *f=fopen(fileIn,"rt");
+ if (!f)
+ {
+ printf("Error opening %s\n",fileIn);
+ return;
+ }
+ char b[maxLine];
+ int first,newFile;
+ fgets(b,maxLine-1,f);
+ if (strncmp(b,separator1,sizeof(separator1)-1)!=0)
+ {
+ printf("Separator expected\n");
+ return;
+ }
+ char *file;
+ while (!feof(f))
+ {
+ // Get the file name
+ fgets(b,maxLine-1,f);
+ if (strncmp(b,"File: ",6)==0)
+ {
+ file=GetFileName(b+6);
+ printf("File: %s\n",file);
+ newFile=0;
+ }
+ else if (strncmp(b,"New File: ",10)==0)
+ {
+ file=GetFileName(b+10);
+ printf("New File: %s\n",file);
+ newFile=1;
+ }
+ else
+ {
+ printf("File expected\n");
+ return;
+ }
+ fgets(b,maxLine-1,f);
+ ChopEOL(b);
+ if (strncmp(b,separator1,sizeof(separator1)-1)!=0)
+ {
+ printf("Separator expected\n");
+ return;
+ }
+ first=1;
+ int endM;
+ // Now the patches
+ do
+ {
+ fgets(b,maxLine-1,f);
+ if (*b=='@' || feof(f))
+ break;
+ if (strncmp(b,"date: ",6)!=0)
+ {
+ printf("Date expected");
+ return;
+ }
+
+ char cfc[16]; *cfc=0;
+ char cfp[16]; *cfp=0;
+ CreateTmpFile(f,cfc,endM);
+ if (!endM)
+ {
+ CreateTmpFile(f,cfp,endM);
+ if (endM)
+ {
+ printf("What?!\n");
+ exit(4);
+ }
+ if (newFile && first)
+ sprintf(b,"cp %s %s",cfp,file);
+ else
+ sprintf(b,"patch %s %s",file,cfp);
+ fprintf(stderr,"%s\n",b);
+ system(b);
+ if (newFile && first)
+ {
+ sprintf(b,"cvs -z 9 add %s",file);
+ fprintf(stderr,"%s\n",b);
+ system(b);
+ }
+ }
+
+ if (strcmp(file,"change.log")!=0)
+ {
+ sprintf(b,"cvs -z 9 ci -F %s %s",cfc,file);
+ fprintf(stderr,"%s\n",b);
+ if (!noCI)
+ system(b);
+ }
+ unlink(cfc);
+ unlink(cfp);
+ first=0;
+ }
+ while (!feof(f) && !endM);
+ if (strcmp(file,"change.log")==0 && !noCI)
+ {// My change.log uses $Log
+ system("cvs -z 9 ci -m + change.log");
+ }
+ free(file);
+ }
+ fclose(f);
+}
+
+int main(int argc, char *argv[])
+{
+ if (argc!=3)
+ {
+ printf("cvssyncput Copyright (c) 2001 by Salvador E. Tropea.\n");
+ printf("Synchronizes two cvs trunks with information generated by cvssyncget.\n\n");
+ printf("Use: cvssyncput info_file extra.tar.gz\n\n");
+ return 1;
+ }
+
+ char b[12+strlen(argv[2])];
+ sprintf(b,"tar zxvf %s",argv[2]);
+ system(b);
+
+ ProcessFile(argv[1],0);
+ return 0;
+}
diff --git a/setedit/tools/kbv.c b/setedit/tools/kbv.c
new file mode 100644
index 0000000..cd73c01
--- /dev/null
+++ b/setedit/tools/kbv.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/*
+ Este programa lo use para convertir los cmbXXXX en keybind.h a cmcXXXXX
+ en menubind.h
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+int main(void)
+{
+ FILE *f,*d;
+ int val;
+ char buffer[200],*def;
+
+ f=fopen("keybind.h","rt");
+ d=fopen("keybind.hv","wt");
+ while (!feof(f))
+ {
+ fgets(buffer,200,f);
+ if (!ucisspace(buffer[0]) && !feof(f))
+ {
+ strtok(buffer," ");
+ def=strtok(NULL," ");
+ def[2]='c';
+ val=atoi(strtok(NULL," "))+600;
+ fprintf(d,"#define %s %d\n",def,val);
+ }
+ }
+
+ return 0;
+}
diff --git a/setedit/tools/lines.pl b/setedit/tools/lines.pl
new file mode 100644
index 0000000..5a50b6d
--- /dev/null
+++ b/setedit/tools/lines.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+require "../miscperl.pl";
+open(FIL,"<../makes/lista") || die;
+$c='';
+while ($a=<FIL>)
+ {
+ $b=substr($a,0,1);
+ chomp $a;
+ $a=substr($a,1) if ($b eq '+' || $b eq '-' || $b eq '*');
+ if ($a=~/\.c$/ || $a=~/\.cc$/ || $a=~/\.h$/ || $a=~/\.pl$/)
+ {
+ if (!($a=~/^gettext/ || $a=~/^libbzip2/ || $a=~/^libpcre/ ||
+ $a=~/^libz/ || $a=~/^mp3\/libamp/ || $a=~/^mp3\/mpegsound/))
+ {
+ #print "$a\n";
+ $c.="../$a ";
+ }
+ }
+ }
+system("wc $c");
diff --git a/setedit/tools/makediff.bat b/setedit/tools/makediff.bat
new file mode 100644
index 0000000..79baf5d
--- /dev/null
+++ b/setedit/tools/makediff.bat
@@ -0,0 +1,5 @@
+Rem Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+Rem see copyrigh file for details
+
+redir -e pp perl makediff.pl
+
diff --git a/setedit/tools/makediff.pl b/setedit/tools/makediff.pl
new file mode 100644
index 0000000..c55e410
--- /dev/null
+++ b/setedit/tools/makediff.pl
@@ -0,0 +1,119 @@
+# Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# Configuration variables
+
+# Convert text files to UNIX format
+#$convertUNIX=1;
+#$dontCopyBinaries=1;
+
+open(FIL,"listagcc");
+
+$orig=<FIL>; chop($orig);
+$diff=<FIL>; chop($diff);
+$dest=<FIL>; chop($dest);
+
+print "Original: $orig\nDestino: $dest\nDiffs en: $diff\n";
+
+$cant=0;
+
+# Clean the destination directories, is there any Perl for it?
+print "\nDeleting all the files in $dest ...\n";
+system("rm -r $dest*");
+print "Deleting all the files in $diff ...\n";
+system("rm -r $diff*");
+
+
+while (!eof(FIL))
+#while (!$a)
+ {
+ #$a=1;
+ $file=<FIL>; chop($file);
+ if (substr($file,0,1) eq "-")
+ {
+ $binary=1;
+ $file=substr($file,1,length($file)-1);
+ }
+ else
+ {
+ $binary=0;
+ }
+ print $file;
+ # die if the file doesn't exist in current version, buggy list
+ if (!(-e $file))
+ {
+ die("$file doesn't exist check listagcc");
+ }
+ # check if that's new
+ if (!(-e "$orig$file"))
+ {
+ # if that's new unconditionally copy it
+ print " is new ";
+ # is there any Perl for it?
+ system("cp -pP $file $diff");
+ print "-> copied ";
+ }
+ else
+ {
+ $t1=-M "$file";
+ $t2=-M "$orig$file";
+ if ($binary)
+ {
+ if ($t1!=$t2)
+ {
+ print " binary modified ";
+ system("cp -pP $file $diff");
+ print "-> copied ";
+ }
+ else
+ {
+ print " unchanged ";
+ }
+ }
+ else
+ {
+ if ($t1!=$t2 || &SizeOfFile("$orig$file")!=&SizeOfFile("$file"))
+ {
+ print " modified ",$t1!=$t2 ? "[T] " : "[S] ";
+ system("diff -u $orig$file $file >> $diff"."rest.dif");
+ print "-> diff ";
+ }
+ else
+ {
+ print " unchanged ";
+ }
+ }
+ }
+ if (!$dontCopyBinaries || !$binary)
+ {
+ system("cp -pP $file $dest");
+ ($binary || !$convertUNIX) ||
+ system("dtou $dest$file");
+ print "[copied]";
+ }
+ print "\n";
+ }
+
+close(FIL);
+
+#
+# This routine meassures the file length removing the CR+LF characters
+#
+sub SizeOfFile
+{
+ my($F1,@f,$l,$line);
+
+ open F1,$_[0];
+ #binmode(F1); used to test under DOS
+ @f=<F1>;
+ $l=0;
+ foreach $line (@f)
+ {
+ chop($line);
+ (substr($line,length($line)-1,1) ne "\r") ||
+ chop($line);
+ $l+=length($line);
+ }
+ #print "largo: $l ";
+ return $l;
+}
diff --git a/setedit/tools/mapa.cc b/setedit/tools/mapa.cc
new file mode 100755
index 0000000..4c54043
--- /dev/null
+++ b/setedit/tools/mapa.cc
@@ -0,0 +1,242 @@
+/* Copyright (C) 2003 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+/**[txh]********************************************************************
+
+ Description:
+ This program reads information from a linker map (-Map name for ld or
+-Wl,-M,name for gcc) and prints information about the size of the .text,
+.data, .bss, .text+.data and rest of sections.
+ Is very useful to know how much code comes from each static library.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <limits.h>
+#include <string.h>
+#include <stdlib.h>
+
+const int mxLen=PATH_MAX+80;
+const int szCode=0, szData=1, szBss=2, szOther=3, szExe=4;
+const int szCant=5;
+
+const char *typeNames[szCant]=
+{
+ "code (text)",
+ "data (data)",
+ "unitialized data (bss)",
+ "other (mostly debug)",
+ "code+data (stripped exe size)"
+};
+
+struct node;
+
+struct node
+{
+ char *name;
+ int size[szCant];
+ node *next;
+};
+
+static node *base=NULL;
+static node *last;
+static int nodes;
+static int whichSort;
+
+static
+node *SearchModule(const char *mod)
+{
+ node *p=base;
+ while (p)
+ {
+ if (strcmp(mod,p->name)==0)
+ return p;
+ p=p->next;
+ }
+ return p;
+}
+
+static
+void AddSizeNode(node *p, const char *section, int size)
+{
+ if (strcmp(section,"text")==0)
+ {
+ p->size[szCode]+=size;
+ p->size[szExe]+=size;
+ }
+ else if (strcmp(section,"data")==0)
+ {
+ p->size[szData]+=size;
+ p->size[szExe]+=size;
+ }
+ else if (strcmp(section,"bss")==0)
+ p->size[szBss]+=size;
+ else
+ p->size[szOther]+=size;
+}
+
+static
+void AddToModule(char *mod, const char *section, int size)
+{
+ int l=strlen(mod);
+ if (mod[l-2]=='.' && mod[l-1]=='o')
+ strcpy(mod,"object files");
+ if (!base)
+ {
+ base=new node;
+ memset(base,0,sizeof(node));
+ base->next=NULL;
+ base->name=strdup(mod);
+ AddSizeNode(base,section,size);
+ last=base;
+ nodes=1;
+ return;
+ }
+ node *p=SearchModule(mod);
+ if (p)
+ AddSizeNode(p,section,size);
+ else
+ {
+ last->next=new node;
+ last=last->next;
+ memset(last,0,sizeof(node));
+ last->next=NULL;
+ last->name=strdup(mod);
+ AddSizeNode(last,section,size);
+ nodes++;
+ }
+}
+
+static
+void ParseAndAdd(char *s, char *section)
+{
+ for (;*s && *s==' '; s++);
+ if (*s)
+ {
+ int modStart,modSize;
+ char mod[256];
+ sscanf(s,"0x%x 0x%x %256[^(\n]",&modStart,&modSize,mod);
+ //printf("Start: 0x%X Size: 0x%X module: %s\n",modStart,modSize,mod);
+ AddToModule(mod,section,modSize);
+ }
+}
+
+static
+int Compare(const void *e1, const void *e2)
+{
+ const node **p1=(const node **)e1;
+ const node **p2=(const node **)e2;
+ return (*p2)->size[whichSort]-(*p1)->size[whichSort];
+}
+
+static
+node **SortList(int which)
+{
+ node **table=new node *[nodes], *p;
+ int i;
+ for (p=base, i=0; i<nodes; p=p->next, i++)
+ table[i]=p;
+ whichSort=which;
+ qsort(table,nodes,sizeof(node *),Compare);
+ return table;
+}
+
+static
+void PrintList(int which)
+{
+ node **p=SortList(which);
+ int total=0, i;
+ for (i=0; i<nodes; i++)
+ total+=p[i]->size[which];
+ printf("\n\nValues for section: %s (size=%d)\n\n",typeNames[which],total);
+ for (i=0; i<nodes; i++)
+ printf("%-40s %8d (%6.2f %%)\n",p[i]->name,p[i]->size[which],
+ p[i]->size[which]/(double)total*100.0);
+ printf("----------------------------------------------------------------\n");
+ printf("%-40s %8d (%6.2f %%)\n","Total",total,100.0);
+ delete[] p;
+}
+
+int main(int argc, char *argv[])
+{
+ FILE *f;
+ char b[mxLen];
+ char secName[20];
+ f=fopen(argv[1],"rt");
+ if (!f)
+ {
+ printf("Can't open %s\n",argv[1]);
+ return 1;
+ }
+ while (!feof(f))
+ {
+ if (fgets(b,mxLen,f) && b[0]=='.' && b[1]!='.' && b[1]!='/')
+ break;
+ }
+ if (feof(f))
+ {
+ printf("Can't find any section\n");
+ return 2;
+ }
+ int secStart,secSize;
+ do
+ {
+ int re=sscanf(b,".%20s 0x%x 0x%x",secName,&secStart,&secSize);
+ int skip=0;
+ if (re!=3)
+ {
+ if (re==1)
+ {
+ fgets(b,mxLen,f);
+ char *s=b;
+ for (;*s && *s==' '; s++);
+ re=sscanf(s,"0x%x 0x%x",&secStart,&secSize);
+ if (re!=2)
+ {
+ skip=1;
+ printf("Skipping %s\n",secName);
+ }
+ }
+ else
+ {
+ printf("Wrong section format (1)\n");
+ return 3;
+ }
+ }
+ if (!skip)
+ printf("Section: %s Start: 0x%X Size: %d\n",secName,secStart,secSize);
+ int useNext=0;
+ do
+ {
+ if (fgets(b,mxLen,f))
+ {
+ if (useNext)
+ {
+ useNext=0;
+ ParseAndAdd(b,secName);
+ }
+ else if (b[0]==' ' && b[1]=='.')
+ {
+ char *s=b+2;
+ for (;*s && *s!=' '; s++);
+ if (*s)
+ {
+ for (;*s && *s==' '; s++);
+ if (*s)
+ ParseAndAdd(s,secName);
+ }
+ else
+ useNext=1;
+ }
+ else if (b[0]=='.')
+ break;
+ }
+ }
+ while (!feof(f));
+ }
+ while (!feof(f));
+ int i;
+ for (i=0; i<szCant; i++)
+ PrintList(i);
+ return 0;
+}
+
diff --git a/setedit/tools/mft.c b/setedit/tools/mft.c
new file mode 100644
index 0000000..b28de87
--- /dev/null
+++ b/setedit/tools/mft.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <ftw.h>
+#include <string.h>
+
+int extra;
+
+int func(const char *path, struct stat *stbuf, int flag)
+{
+ if (flag==FTW_F)
+ {
+ printf("%s\n",path+extra+1);
+ }
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ if (argc!=2)
+ {
+ printf("Use: mft path\n");
+ return 1;
+ }
+ extra=strlen(argv[1]);
+ ftw(argv[1],func,1);
+ return 0;
+}
diff --git a/setedit/tools/mft.gpr b/setedit/tools/mft.gpr
new file mode 100644
index 0000000..c574b4b
--- /dev/null
+++ b/setedit/tools/mft.gpr
Binary files differ
diff --git a/setedit/tools/mideline.cc b/setedit/tools/mideline.cc
new file mode 100644
index 0000000..7e0da49
--- /dev/null
+++ b/setedit/tools/mideline.cc
@@ -0,0 +1,100 @@
+/* Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),
+ see copyrigh file for details */
+#include <stdio.h>
+#include <sys/stat.h>
+
+int LineAlloc[32];
+
+int ProxPow(int a, int poner=0)
+{
+ int r=1,i=0;
+ if (a==0)
+ return 0;
+ a+=4; // malloc overhead
+ while (r<a) { r<<=1; i++; }
+
+ if (poner)
+ LineAlloc[i]++;
+
+ return r;
+}
+
+void Barra(int val, int max)
+{
+ int len=(int)(50.0*val/max);
+ while (len--)
+ {
+ printf("X");
+ }
+ printf("\n");
+}
+
+int main(int argc, char *argv[])
+{
+ char b[30000];
+
+ if (argc<2)
+ {
+ printf("Medidor de memoria usada por el editor\n");
+ printf("Uso: %s archivos\n",argv[0]);
+ }
+ int i=1,bbig,lines,bsmall,alines,aflags,afulls,afull;
+ int bigacu=0,smallacu=0,sm2acu=0,acul,lenl,acult=0,linet=0;
+ struct stat s;
+
+ for (i=0; i<32; i++)
+ LineAlloc[i]=0;
+
+ i=1;
+ while (i<argc)
+ {
+ if (stat(argv[i],&s)==0)
+ {
+ printf("%12s %7d",argv[i],s.st_size);
+ bbig=ProxPow(s.st_size+4084);
+ printf(" %7d",bbig);
+ lines=bsmall=0;
+ FILE *f=fopen(argv[i],"rt");
+ acul=0;
+ fgets(b,30000,f);
+ while (!feof(f))
+ {
+ lines++;
+ lenl=strlen(b)-1;
+ acul+=lenl;
+ bsmall+=ProxPow(lenl,1);
+ fgets(b,30000,f);
+ }
+ fclose(f);
+ acult+=acul;
+ linet+=lines;
+ alines=aflags=ProxPow(lines*2);
+ printf(" %6d %6d %6d %7d",lines,alines,aflags,bbig+alines+aflags);
+ bigacu+=bbig+alines+aflags;
+ afulls=ProxPow(lines*8);
+ printf(" %6d %7d %7d",afulls,bsmall,afulls+bsmall);
+ smallacu+=afulls+bsmall;
+ afull=ProxPow(lines*12);
+ sm2acu+=afull+bsmall;
+ printf(" %7d %3d",afull,(int)((double)acul/lines+.5));
+ printf("\n");
+ }
+ i++;
+ }
+ printf(
+"
+Actual: %d Nuevo: %d (%d)
+Tamao promedio de las lneas: %d
+Histograma de alocaciones de las lneas:
+",bigacu,smallacu,sm2acu,(int)((double)acult/linet+.5));
+ int max=0;
+ for (i=0; i<32; i++)
+ if (LineAlloc[i]>max)
+ max=LineAlloc[i];
+ for (i=0; i<32; i++)
+ {
+ printf("2^%2d (%10d): %6d ",i,1<<i,LineAlloc[i]);
+ Barra(LineAlloc[i],max);
+ }
+ return 0;
+}
diff --git a/setedit/tools/moverepo.pl b/setedit/tools/moverepo.pl
new file mode 100644
index 0000000..8d22707
--- /dev/null
+++ b/setedit/tools/moverepo.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+$newRoot=":ext:set\@setedit.cvs.sourceforge.net:/cvsroot/setedit\n";
+$maxDe=5;
+$pat='CVS/Root';
+while ($maxDe--)
+ {
+ @a=(@a,glob($pat));
+ $pat='*/'.$pat;
+ }
+
+print scalar(@a)." Root's found\nCross your fingers ...\n";
+foreach $b (@a)
+ {
+ print "$b\n";
+ open(FIL,">$b") || die "Can't create '$b' \n";
+ print FIL ($newRoot);
+ close(FIL);
+ }
+print "Ok, all changed\n";
+
+
diff --git a/setedit/tools/putcopyr.pl b/setedit/tools/putcopyr.pl
new file mode 100644
index 0000000..ac79fde
--- /dev/null
+++ b/setedit/tools/putcopyr.pl
@@ -0,0 +1,122 @@
+sub SaveIt;
+sub FindCopy;
+
+$Copy1="Copyright (C) 1996,1997,1998,1999,2000 by Salvador E. Tropea (SET),";
+$Copy2="see copyrigh file for details";
+$CopyCpp='/* '.$Copy1."\n ".$Copy2." */\n";
+$CopySHL='# '.$Copy1."\n# ".$Copy2."\n#\n";
+$CopyPMC='; '.$Copy1."\n; ".$Copy2."\n;\n";
+$CopyTX ='@c '.$Copy1."\n\@c ".$Copy2."\n\n";
+$CopyBAT='@Rem '.$Copy1."\n\@Rem ".$Copy2."\n@\n";
+
+print 'Copyright stuffer by SET'."\n\n";
+
+open(FI,"../makes/lista") || die "Can't open listagcc";
+@prgs=<FI>;
+close(FI);
+
+chdir('..');
+foreach $prg (@prgs)
+{
+ chop $prg;
+ length($prg) || next;
+ $a=substr($prg,0,1);
+ ($a ne '-') || next;
+ if (($a eq '*') or ($a eq '+'))
+ {
+ $prg=substr($prg,1,length($prg)-1);
+ }
+ $a=&cat($prg);
+ $ret=FindCopy($a);
+ if (!$ret)
+ {
+ print "No mine: $prg\n";
+ }
+ elsif ($ret eq 'Update')
+ {
+ $a =~ s/1999/1999,2000/;
+ print "Updated year: $prg ";
+ SaveIt($a,'');
+ }
+ elsif ($ret eq 'Save')
+ {
+ if ($prg =~ /\.(([ch]\w?)|(000)|(s))$/)
+ {
+ SaveIt($a,$CopyCpp);
+ }
+ elsif ($prg =~ /\.((shl)|(pl)|(smn))$/)
+ {
+ SaveIt($a,$CopySHL);
+ }
+ elsif ($prg =~ /\.tx$/)
+ {
+ SaveIt($a,$CopyTX);
+ }
+ elsif ($prg =~ /\.((pmc)|(slp))$/)
+ {
+ SaveIt($a,$CopyPMC);
+ }
+ elsif ($prg =~ /\.bat$/)
+ {
+ SaveIt($a,$CopyBAT);
+ }
+ else
+ {
+ print "Skipped: $prg\n";
+ }
+ }
+}
+chdir('tools');
+
+sub SaveIt
+{
+ open(FI,'>'.$prg);
+ print FI ($_[1]);
+ print FI ($_[0]);
+ close(FI);
+ print "* Altered: $prg\n";
+}
+
+sub FindCopy
+{
+ my $str=\$_[0]; # by reference
+ my $b;
+
+ if ($$str =~ /\(C\) tomislav/)
+ {
+ return 0;
+ }
+ if ($$str =~ /Ove Kaaven/)
+ {
+ return 0;
+ }
+ if ($$str =~ /Andrew Richards/)
+ {
+ return 0;
+ }
+ if ($$str =~ /[Cc]opyright(.*)$/gm)
+ {
+ if ($1 =~ /Salvador/)
+ {
+ if ($$str =~ /2000/)
+ {
+ return 1;
+ }
+ return 'Update';
+ }
+ return 0;
+ }
+ 'Save';
+}
+
+sub cat
+{
+ my ($file,$ret)=@_;
+ local $/;
+
+ open(MY_FILE,$file) || die "Can't open '$file'";
+ $ret=<MY_FILE>;
+ close(MY_FILE);
+ $ret;
+}
+
diff --git a/setedit/tools/sarge.supp b/setedit/tools/sarge.supp
new file mode 100644
index 0000000..3676939
--- /dev/null
+++ b/setedit/tools/sarge.supp
@@ -0,0 +1,536 @@
+{
+ X11_WriteV1
+ Memcheck:Param
+ writev(vector[...])
+ obj:/lib/tls/libc-2.3.2.so
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_X11TransWritev
+ fun:_XSend
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XPutImage
+ fun:_ZN10TScreenX1111writeLineCPEiiiPvj
+}
+# That's an invalid read/write inside a block freed by exit by exit's code.
+{
+ LibC_W1
+ Memcheck:Addr4
+ obj:/lib/tls/libc-2.3.2.so
+ obj:/lib/tls/libc-2.3.2.so
+ obj:/lib/tls/libc-2.3.2.so
+ obj:/lib/tls/libc-2.3.2.so
+ obj:/lib/tls/libc-2.3.2.so
+ fun:__libc_freeres
+ fun:_vgw__freeres
+ fun:exit
+ fun:__libc_start_main
+}
+# We free the cursors but we get this leak:
+{
+ X11Cursor1
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XrmGetStringDatabase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XGetDefault
+ fun:_XcursorGetDisplayInfo
+ fun:XcursorSupportsARGB
+ fun:XcursorTryShapeCursor
+ fun:_XTryShapeCursor
+ fun:XCreateGlyphCursor
+ fun:XCreateFontCursor
+ fun:_ZN10TScreenX1113createCursorsEv
+}
+{
+ X11Cursor2
+ Memcheck:Leak
+ fun:malloc
+ fun:_XrmDefaultInitParseInfo
+ fun:_XrmInitParseInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XrmGetStringDatabase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XGetDefault
+ fun:_XcursorGetDisplayInfo
+ fun:XcursorSupportsARGB
+ fun:XcursorTryShapeCursor
+ fun:_XTryShapeCursor
+ fun:XCreateGlyphCursor
+ fun:XCreateFontCursor
+ fun:_ZN10TScreenX1113createCursorsEv
+}
+{
+ X11Cursor3
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_map_object_deps
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XTryShapeCursor
+ fun:XCreateGlyphCursor
+ fun:XCreateFontCursor
+ fun:_ZN10TScreenX1113createCursorsEv
+}
+{
+ X11Cursor4
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/ld-2.3.2.so
+ fun:_dl_map_object
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XTryShapeCursor
+ fun:XCreateGlyphCursor
+ fun:XCreateFontCursor
+ fun:_ZN10TScreenX1113createCursorsEv
+}
+{
+ X11Cursor5
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XrmGetStringDatabase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XGetDefault
+ fun:_XcursorGetDisplayInfo
+ fun:XcursorSupportsARGB
+ fun:XcursorTryShapeCursor
+ fun:_XTryShapeCursor
+ fun:XCreateGlyphCursor
+ fun:XCreateFontCursor
+ fun:_ZN10TScreenX1113createCursorsEv
+}
+#
+# XCloseIM seems to leak?! don't know if that's my fault.
+#
+{
+ XOpenIM1
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
+ fun:_XimOpenIM
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XOpenIM
+}
+{
+ XOpenIM2
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM3
+ Memcheck:Leak
+ fun:realloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM4
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM5
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM6
+ Memcheck:Leak
+ fun:malloc
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM7
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM8
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcCreateLocaleDataBase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM9
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM10
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XrmInternalStringToQuark
+ fun:XrmStringToQuark
+ fun:_XlcGetCharSet
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM11
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_map_object
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM12
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_map_object_deps
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM13
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/ld-2.3.2.so
+ obj:/lib/ld-2.3.2.so
+ fun:_dl_map_object
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM14
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLocaleDataBase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM15
+ Memcheck:Leak
+ fun:malloc
+ fun:strdup
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM16
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLocaleDataBase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM17
+ Memcheck:Leak
+ fun:calloc
+ fun:_dl_check_map_versions
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM18
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLocaleDataBase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM19
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM20
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcAddCharSet
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM21
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcCreateDefaultCharSet
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM22
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcSetConverter
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM23
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcCreateDefaultCharSet
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM24
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLocaleDataBase
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM25
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcCreateDefaultCharSet
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM26
+ Memcheck:Leak
+ fun:calloc
+ obj:/lib/ld-2.3.2.so
+ obj:/lib/ld-2.3.2.so
+ fun:_dl_map_object
+ obj:/lib/tls/libc-2.3.2.so
+ fun:_dl_catch_error
+ fun:_dl_open
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:_dl_catch_error
+ obj:/lib/tls/libdl-2.3.2.so
+ fun:dlopen
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+{
+ XOpenIM27
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XrmInternalStringToQuark
+ fun:XrmStringToQuark
+ fun:_XlcGetCharSet
+ fun:_XlcAddCT
+ fun:_XlcInitCTInfo
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XlcDynamicLoad
+ fun:_XOpenLC
+ fun:XOpenIM
+}
+#
+# putenv needs a copy for glibc.
+#
+{
+ PutEnv1
+ Memcheck:Leak
+ fun:_Znaj
+ fun:_Z19CheckForValidTMPDIRv
+ fun:main
+}
+{
+ PutEnv2
+ Memcheck:Leak
+ fun:_Znaj
+ fun:_Z16GuessOneSET_LIBSPKcc
+ fun:_Z13GuessSET_LIBSv
+ fun:main
+}
+{
+ PutEnv3
+ Memcheck:Leak
+ fun:_Znaj
+ fun:_Z17GuessOneSET_FILESPKcc
+ fun:_Z14GuessSET_FILESv
+ fun:main
+}
+
diff --git a/setedit/tools/symify.cc b/setedit/tools/symify.cc
new file mode 100644
index 0000000..5406045
--- /dev/null
+++ b/setedit/tools/symify.cc
@@ -0,0 +1,264 @@
+/**[txh]********************************************************************
+
+ Copyright (c) 2001 by Salvador E. Tropea (SET) <set@ieee.org>
+ This program is covered by the GPL license you should get it with this
+program.
+ I based some routines (my_*) in Bjorn Reese <breese@mail1.stofanet.dk>
+code, but to be honest that's standard UNIX process manipulation. But I
+must give credit to Bjorn, your ideas helped me a lot in creating the code
+that attaches gdb to setedit to retrieve more information.
+
+ Description:
+ That's a small tool to convert a raw stack trace into human readable
+source points. The output format is the standard GNU errors one. It means
+you can feed setedit with it and browse the crashing points.
+ Is the equivalent to djgpp symify tool for Linux.
+ Note that the stack traces I'm generating are incomplete because I can't
+show the exact point of the signal, I should investigate how in the hell
+gdb achieves it. Any help will be appreciated.
+
+ Compilation:
+ g++ -o symify -O2 symify.cc
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <limits.h>
+#include <unistd.h>
+#include <signal.h>
+#include <sys/wait.h>
+
+const int maxLineL=512;
+typedef unsigned long ulong;
+typedef unsigned char uchar;
+#define SYS_ERROR -1
+
+/**[txh]********************************************************************
+
+ Description:
+ Runs the command as a child process redirecting the output, error and
+input to a us a.
+ By SET.
+
+ Return:
+ The file handle of a pipe connected to the child.
+
+***************************************************************************/
+static
+int my_popen(const char *command, pid_t *pid, int *aWc)
+{
+ int rc,wc;
+ int pipefd[2],pipefd2[2];
+
+ /* To make it bidireccional we need 2 pipes */
+ rc=pipe(pipefd);
+ if (rc==SYS_ERROR)
+ return rc;
+ wc=pipe(pipefd2);
+ if (wc==SYS_ERROR)
+ {
+ close(pipefd[0]);
+ close(pipefd[1]);
+ return wc;
+ }
+ if (rc!=SYS_ERROR && wc!=SYS_ERROR)
+ {
+ *pid=fork();
+ switch (*pid)
+ {
+ case SYS_ERROR:
+ wc = rc = SYS_ERROR;
+ close(pipefd[0]);
+ close(pipefd[1]);
+ close(pipefd2[0]);
+ close(pipefd2[1]);
+ break;
+
+ case 0: /* Child */
+ close(pipefd[0]);
+ dup2(pipefd[1], STDOUT_FILENO);
+ dup2(pipefd[1], STDERR_FILENO);
+ close(pipefd[1]);
+
+ close(pipefd2[1]);
+ dup2(pipefd2[0], STDIN_FILENO);
+ close(pipefd2[0]);
+ /*
+ * The System() call assumes that /bin/sh is
+ * always available, and so will we.
+ */
+ execl("/bin/sh", "/bin/sh", "-c", command, NULL);
+ _exit(EXIT_FAILURE);
+ break;
+
+ default: /* Parent */
+ close(pipefd[1]);
+ rc = pipefd[0];
+ close(pipefd2[0]);
+ wc = pipefd2[1];
+ break;
+ } /* switch */
+ }
+ *aWc=wc;
+ return rc;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Gets a line of text from the child.
+ By breese.
+
+ Return:
+ The ammount of bytes read.
+
+***************************************************************************/
+static
+int my_getline(int fd, char *buffer, int max)
+{
+ char c;
+ int i=0;
+
+ do
+ {
+ if (read(fd,&c,1)<1)
+ return 0;
+ if (i<max)
+ buffer[i++]=c;
+ }
+ while (c!='\n');
+ buffer[i]=(char)0;
+ return i;
+}
+
+/**[txh]********************************************************************
+
+ Description:
+ Closes the pipe and ensures the child dies.
+ Note: We must use wait or our child will become a zombie.
+ By SET.
+
+***************************************************************************/
+static
+void my_pclose(int rc, int wc, int pid)
+{
+ int wstatus,ret;
+ /* Close the pipe, it should kill the child with SIGPIPE */
+ close(rc);
+ close(wc);
+ /* Is already dead? */
+ ret=waitpid(pid,&wstatus,WNOHANG);
+ if (ret==0)
+ {/* Nope, wait a little bit */
+ /* I choose to sleep and no hang, perhaps setting an alarm
+ could be better */
+ usleep(100000);
+ /* Is dead? */
+ ret=waitpid(pid,&wstatus,WNOHANG);
+ if (ret==0)
+ {/* Nope, a diehard, or just too slow. */
+ /* Make sure the the child process has terminated */
+ kill(pid,SIGKILL);
+ /* The child can't block it so we can wait */
+ waitpid(pid,&wstatus,0);
+ }
+ }
+}
+
+void Solve(const char *file, const char *outFile, const char *binary)
+{
+ FILE *f;
+ if (strcmp(file,"-")==0)
+ f=stdin;
+ else
+ f=fopen(file,"rt");
+ if (!f)
+ {
+ perror("Error opening input file");
+ return;
+ }
+
+ FILE *out;
+ if (strcmp(outFile,"-")==0)
+ out=stdout;
+ else
+ out=fopen(outFile,"wt");
+ if (!out)
+ {
+ perror("Error creating output file");
+ return;
+ }
+
+ int l=32+strlen(binary);
+ if (l<maxLineL) l=maxLineL;
+ char b[l];
+ pid_t cp;
+ int wc,rc;
+ strcpy(b,"addr2line -Cfe ");
+ strcat(b,binary);
+ rc=my_popen(b,&cp,&wc);
+ if (rc<0)
+ {
+ perror("Error creating pipe");
+ return;
+ }
+
+ int count=0;
+ l--;
+ do
+ {
+ if (fgets(b,l,f))
+ {
+ fputs(b,out);
+ if (isxdigit(b[0]))
+ {
+ char *s,*end;
+ if (b[0]==0 && toupper((uchar)b[1])=='x') s+=2;
+ for (s=b; *s && isxdigit((uchar)*s); s++);
+ if (isspace((uchar)*s))
+ {// We must use address-1 because address is the *return* point and
+ // not the calling one
+ ulong address=strtoul(b,&end,16);
+ sprintf(b,"%X\n",address-1);
+ write(wc,b,strlen(b));
+ my_getline(rc,b,l);
+ fputs("Function: ",out);
+ fputs(b,out);
+ my_getline(rc,b,l);
+ int len=strlen(b);
+ if (b[len-1]=='\n') b[len-1]=0;
+ fputs(b,out);
+ // If no line is provided is because no debug info is available for
+ // it so avoid generating a valir error line
+ if (len>3 && strcmp(b+len-3,":0")==0)
+ fputc('\n',out);
+ else
+ fprintf(out,": frame %d\n",count);
+ count++;
+ }
+ }
+ }
+ }
+ while (!feof(f));
+ if (f!=stdin)
+ fclose(f);
+ if (out!=stdout)
+ fclose(out);
+ my_pclose(rc,wc,cp);
+}
+
+int main(int argc, char *argv[])
+{
+ printf("Symbols translator Copyright (c) 2001 by Salvador E. Tropea\n");
+ if (argc!=4)
+ {
+ printf("Use: %s input_file output_file executable\n",argv[0]);
+ printf("You can replace input and output file by - to use the standard ones.\n");
+ return 1;
+ }
+ Solve(argv[1],argv[2],argv[3]);
+ return 0;
+}
diff --git a/setedit/tools/valgrind.cmd b/setedit/tools/valgrind.cmd
new file mode 100644
index 0000000..58b479d
--- /dev/null
+++ b/setedit/tools/valgrind.cmd
@@ -0,0 +1 @@
+valgrind --tool=memcheck --leak-check=yes --gen-suppressions=yes --suppressions=/usr/src/setedit/tools/woody.supp --show-reachable=yes --num-callers=40 /usr/src/setedit/makes/editor.exe
diff --git a/setedit/tools/woody.supp b/setedit/tools/woody.supp
new file mode 100644
index 0000000..be958aa
--- /dev/null
+++ b/setedit/tools/woody.supp
@@ -0,0 +1,127 @@
+# General suppressions
+#
+# putenv needs a copy for glibc.
+#
+{
+ PutEnv1
+ Memcheck:Leak
+ fun:__builtin_vec_new
+ fun:CheckForValidTMPDIR__Fv
+ fun:main
+}
+{
+ PutEnv2
+ Memcheck:Leak
+ fun:__builtin_vec_new
+ fun:GuessOneSET_LIBS__FPCcc
+ fun:GuessSET_LIBS__Fv
+ fun:main
+}
+{
+ PutEnv3
+ Memcheck:Leak
+ fun:__builtin_vec_new
+ fun:GuessOneSET_FILES__FPCcc
+ fun:GuessSET_FILES__Fv
+ fun:main
+}
+#
+# XCloseIM seems to leak?! don't know if that's my fault.
+#
+{
+ XOpenIM_Unknown_Problem
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:XOpenIM
+}
+{
+ XOpenIM_Unknown_Problem_2
+ Memcheck:Leak
+ fun:malloc
+ fun:_XlcCreateLC
+ fun:_XlcDefaultLoader
+ fun:_XOpenLC
+}
+{
+ XOpenIM_Unknown_Problem_3
+ Memcheck:Leak
+ fun:realloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+}
+{
+ XOpenIM_Unknown_Problem_4
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+}
+{
+ XOpenIM_Unknown_Problem_5
+ Memcheck:Leak
+ fun:malloc
+ fun:_XOpenLC
+ fun:XOpenIM
+ fun:__10TScreenX11i
+}
+{
+ XOpenIM_Unknown_Problem_6
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_map_object_deps
+ obj:/lib/libc-2.2.5.so
+ fun:_dl_catch_error
+}
+{
+ XOpenIM_Unknown_Problem_7
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_new_object
+ fun:_dl_map_object_from_fd
+ fun:_dl_map_object
+}
+{
+ XOpenIM_Unknown_Problem_8
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_map_object
+ obj:/lib/libc-2.2.5.so
+ fun:_dl_catch_error
+}
+{
+ XOpenIM_Unknown_Problem_9
+ Memcheck:Leak
+ fun:calloc
+ fun:_dl_check_map_versions
+ obj:/lib/libc-2.2.5.so
+ fun:_dl_catch_error
+}
+{
+ XOpenIM_Unknown_Problem_10
+ Memcheck:Leak
+ fun:calloc
+ fun:_dl_new_object
+ fun:_dl_map_object_from_fd
+ fun:_dl_map_object
+}
+
+# Debian specific
+{
+ DlStartWoody
+ Memcheck:Cond
+ fun:_dl_start
+ obj:/lib/ld-2.2.5.so
+}
+{
+ X11WriteVWoody
+ Memcheck:Param
+ writev(vector[...])
+ fun:writev
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ fun:_X11TransWritev
+ fun:_XSend
+}
diff --git a/setedit/update b/setedit/update
new file mode 100755
index 0000000..dbb3549
--- /dev/null
+++ b/setedit/update
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Copyright (C) 2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This file updates the sources from CVS. I redirect the stderr to null
+# because I don't want to fill the screen with the directory names. You
+# must be careful because the errors are discarded.
+# The -d option updates new directories, without it they aren't
+# created.
+# The -P option purges empty directories, they are no longer used
+# directories that CVS keeps to allow recovering old tree structures.
+#
+echo
+echo Updating from CVS. Errors are discarded!
+echo
+cvs -z3 update -dP 2> /dev/null
diff --git a/setedit/update.bat b/setedit/update.bat
new file mode 100755
index 0000000..c214455
--- /dev/null
+++ b/setedit/update.bat
@@ -0,0 +1,15 @@
+:@Rem Copyright (C) 2003 by Salvador E. Tropea (SET),
+:@Rem see copyrigh file for details
+:@Rem
+:@Rem This file updates the sources from CVS. I redirect the stderr to null
+:@Rem because I don't want to fill the screen with the directory names. You
+:@Rem must be careful because the errors are discarded.
+:@Rem The -d option updates new directories, without it they aren't
+:@Rem created.
+:@Rem The -P option purges empty directories, they are no longer used
+:@Rem directories that CVS keeps to allow recovering old tree structures.
+:@Rem
+@echo .
+@echo Updating from CVS. Errors are discarded!
+@echo .
+@redir -e /dev/null cvs update -dP | less
diff --git a/setedit/updaterev.pl b/setedit/updaterev.pl
new file mode 100644
index 0000000..c3655d3
--- /dev/null
+++ b/setedit/updaterev.pl
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+# Copyright (C) 2003 by Salvador E. Tropea (SET),
+# see copyrigh file for details
+#
+# This script extracts the revision number from the change.log and puts the
+# value in the include/vername.h file.
+#
+
+require "miscperl.pl";
+
+# The time stamp is checked by the Makefile
+#if (-M 'change.log' < -M 'include/vername.h')
+
+print "Updating revision number\n";
+$vername=cat('include/vername.h');
+$changelog=cat('change.log');
+$changelog=~/Revision \d\.(\d*) /;
+$revision=$1;
+die "Can't determine the revision number\n" unless $revision;
+# Source Forge CVS was created around revision 1.515
+$revision+=514 unless $changelog=~/Revision 1\.926 2003\/06\/17 22\:09\:57 set/;
+$vername=~s/VERSION_REV\s+\d+/VERSION_REV $revision/;
+replace('include/vername.h',$vername);
+
diff --git a/setedit/version.txt b/setedit/version.txt
new file mode 100644
index 0000000..d1d899f
--- /dev/null
+++ b/setedit/version.txt
@@ -0,0 +1 @@
+0.5.5
diff --git a/setedit/windos.faq b/setedit/windos.faq
new file mode 100644
index 0000000..9f69b82
--- /dev/null
+++ b/setedit/windos.faq
@@ -0,0 +1,462 @@
+ Here I'll put some common and not so common questions about the editor
+running under DOS and Windows. These comments apply to the DOS version
+running on DOS and/or Windows and not the native Win32 version.
+
+1. Video questions.
+1.1 Screen goes black (or green or any strange option) when I exit the
+editor or call a shell.
+1.2 Running in a Win9x window rather than full screen.
+
+2. Incompatibilities with other programs and TSRs
+2.1 Problems with antivirus TSRs.
+
+3. Miscellaneous
+3.1 Do you really think your screen saver can be called screen saver?
+3.2 Why I can't access files in a directory called c:\dev?
+3.3 I'm using Windows NT (4.0, 2k, XP, etc.) and defined Set_Files but it
+doesn't work, why?
+3.4 I'm using Windows NT (4.0, 2k, XP, etc.) and I can copy/paste to/from the
+Windows clipboard, why?
+
+4. Mouse problems
+4.1 I don't get a mouse pointer while I'm in DOS, why?
+4.2 I can see both mouse pointers (graphical and text) when the editor is
+running windowed under W9x, why?
+4.3 The mouse works, but I can't see the mouse pointer!
+4.4 I'm using Windows 2000 or XP and I have problems with the mouse.
+
+5. Sound problems
+5.1 The sound is too noisy (crispy), why?
+
+6. Keyboard problems
+6.1 The editor doesn't catch all the keyboard combinations, why?
+6.2 I get random keys pressed all the time, why?
+
+7. sLisp macro language
+7.1 How can I extend it?
+
+8. Edition modes
+8.1 What options should I use to get real tabs (ascii 9)?
+
+=============================================================================
+1. Video questions.
+
+1.1 Q: My screen goes black (or green or any strange option) when I exit the
+editor or call a shell, what's up?
+
+A: I found that some video boards have a bug in the implementation of the VGA
+save/restore state (service 0x1C interrupt 0x10). Some Matrox boards have
+this problem.
+ You can try starting the editor with the --low-vga-save command line
+option. In this case the editor uses a low level routine (just in and outs)
+to do the job, it should work for any board that is 100% compatible with the
+IBM's VGA standard.
+ I found this solution thanks to the help of Anders Blom
+<blom@teorfys.lu.se>, he tested some programs I sent him until we found where
+the problem was. Also Nate Eldredge <nate@cartsys.com> tested some stuff in
+your Matrox video board using a brand new model and video drivers and all
+works ok, so perhaps you can just upgrade your BIOS/video drivers if you have
+one of these problematic boards.
+ Additionally Maurice Lombardi <Maurice.Lombardi@ujf-grenoble.fr> reported
+the problems with your Matrox Millenium II went away after upgrading
+BIOS/video drivers.
+
+-----------------------------------------------------------------------------
+1.2 Q: Is a good idea run the editor in a Win9x window? Should I use full
+screen?
+Q: If I use a graphic screen saver and it starts when the editor is windowed
+my Win95 hangs, what's wrong in your program?
+
+[Note: also see 1.1, could be the solution]
+A: In Win9x the windowed DOS tasks are emulated with the help of the video
+driver. Not all the video drivers works well, that's because:
+a) The drivers from Microsoft are poorly tested, they only test in your test
+bed machines.
+b) The drivers from the manufacturer have bugs because Microsoft development
+kits are cryptic.
+ So "your mileage may vary".
+ With my video board (Trident TGUI9440AGi) all works OK, but I know that
+people using old drivers for this board had problems.
+ Also I know that Diamond boards equiped with some S3 chips doesn't support
+the screen saver of the editor. In this boards if a windowed application
+calls BIOS to set the video mode 0x13 (320x200x256) Windows simply hangs. I
+saw it in one machine at work that uses a "Diamond Stealth 64" board with S3
+chipset.
+ Endlisnis <s257m@unb.ca> reported problems with the following setup:
+
+Name: ATI 3D Expression+
+Chip Type: Mach64: Rage II
+Software Version: 5.21-C9N-WEB
+Hardware Version: 065
+No VESA TSR loaded.
+
+ Using this board and changing the characters height to 12 (to get around 34
+lines) the DOS box crashes generating a GPF after the editor exits. The same
+happens if you are in full screen, exit the editor, wait some seconds and
+then press ALT+ENTER.
+
+ James Bunting <james@aic.co.uk> reported:
+
+"When I run programs through RHIDE my user screen background goes green and
+all of the character attributes get messed up. I know that this problem is
+been caused by my video card because I have tested it with another."
+
+Name: 8MB Matrox Productiva AGP
+
+ Similar reports were done by Matrox Millenium II users.
+
+ M. Heumann <manfred.heumann@uni-bielefeld.de> had problems running the
+applications windowed, but not in full screen. Card: Diamond Stealth 3D 2000
+Turbo.
+ Anders Blom <blom@lufysik.fysik.lu.se> kindly tested some small programs I
+wrote in one of these Matrox boards and the video drivers fails to restore
+the video when calling int 0x10 service AX=0x1c02. See question 1.1 for a
+solution.
+ Alexei A. Frounze <alex.fru@mtu-net.ru> reported that:
+
+Win95 OSR2 Rus (4.0 Build 1212 B) DirectX (4.06.00.0318)
+Cirrus Logic 5436 PCI gfx card (CL-GD5436 Rev 0, 4.10.00.1555 "4.10.00.1555"
+English Final Retail).
+
+ Shows problems if you change from full screen to windowed and then exit. He
+solved your problems using a PIF that runs RHIDE (same case as editor) full
+screen and disables the keys to make it windowed.
+ Hans Yperman <hyperman@eduserv1.rug.ac.be> reports similar problems using
+the Cirrus CL-GD5446.
+
+ The GeForce BIOSes seems to have problems very similar to the ones Anders
+found in Matrox cards. Andy <Bitland@aol.com> found a workaround and is
+looking for testers. He have a GeForce based card:
+
+Guillemot/Hercules 3D Prophet II MX
+BIOS-version 3.11.00.08 (coming with b3dpmx-do-08.exe 19/Oct/2000)
+NVIDIA Win-drivers 4.12.01.0635 (Guillemot-Version from 13/Oct/2000)
+
+ The workaround is based in the code that 1.1 question describes. Please
+read 1.1.
+
+ Why it happends with setedit and RHIDE but not with other software? I'm not
+sure about the answer but I'm almost sure is something related to the fact
+that we use the save/restore VGA state services not commonly used by other
+applications. In the future I'll make it optional, but by now we need it to
+debug applications that works at register level with the VGA card.
+=============================================================================
+2. Incompatibilities with other programs and TSRs
+
+2.1 Q: The editor and/or RHIDE makes conflict with my system, and even crash
+my computer.
+
+A: We found that some antivirus like old versions of NAV (Norton AntiVirus)
+and the VShield v3.2.0 doesn't really support our programs. We don't know why
+but these active antivirus are hooking some interrupt used by our programs
+that makes troubles when called from a protected mode application. I think
+they assume something that is clearly wrong when a DPMI application is
+working.
+
+"R.H." <rogerh40@aa.net> says: I am using McAfee Vshield 3.2.0 with scan
+engine 3.2.2. If I compile and run a simple hello program and then exit
+rhide, my system crashes. I know that it is caused by my Mcafee virus scanner
+as if I boot into my fat32 Win98 without the virus scanner, everything works
+fine.
+
+=============================================================================
+3. Miscellaneous
+
+3.1 Q: Do you really think your screen saver can be called screen saver?
+
+A: No. Look in "Tool&Ops|Options|Editor General", I put a question mark after
+the "Screen saver" label. Some of these screen savers aren't really screen
+savers, the best screen saver is a blanker (it just clears the screen), but
+I like the plasma a pseudo smoke ;-).
+ Also: Color monitors doesn't need real screen savers, monochrome does.
+ Plus: I added a blanker to the list.
+
+-----------------------------------------------------------------------------
+3.2 Q: Why I can't access files in a directory called c:\dev?
+
+A: Even when SETEdit is a DOS application uses the djgpp library which
+emulates a lot of UNIX details. In UNIX the /dev directory contains devices
+mapped to files, djgpp emulates it, so files in c:\dev, d:\dev, etc. have
+special meaning. Avoid using files en these directories.
+
+-----------------------------------------------------------------------------
+3.3 I'm using Windows NT (4.0, 2k, XP, etc.) and defined Set_Files but it
+doesn't work, why?
+
+A: NT is case sensitive for environment variable you *must* use SET_FILES
+(all capitals).
+
+-----------------------------------------------------------------------------
+3.4 I'm using Windows NT (4.0, 2k, XP, etc.) and I can copy/paste to/from the
+Windows clipboard, why?
+
+A: NT doesn't implement the WinOldAP API that allows DOS programs to access
+some Windows stuff like the clipboard. Blame Microsoft for that.
+=============================================================================
+4. Mouse problems
+
+4.1 Q: I don't get a mouse pointer while I'm in full screen, why?
+
+A: Be sure the mouse driver is loaded. That isn't needed when the Windows 9x
+GUI is loaded but is needed for pure DOS or Windows 3.1. If the mouse driver
+is loaded keep reading.
+ The Turbo Vision library currently needs a relative modern mouse driver. I
+know some old drivers doesn't provide all the mouse functions needed.
+ I know that the 7.83 version from Ultima Electronics dated in 1994 doesn't
+work, the Agile Mouse version 7.03 dated in 1992 works and modern Genius
+mouse drivers also works OK.
+
+-----------------------------------------------------------------------------
+4.2 Q: I can see both mouse pointers (graphical and text) when the editor is
+running windowed under W9x, why?
+
+A: If you are running with a non-standard (like 90x30) that's impossible to
+avoid. When running in this mode the mouse pointer must be controlled by the
+application because the mouse driver doesn't know how to do it. For this
+reason the editor draws the pointer. Lamentably there is no way to know if
+the program is windowed or not.
+
+-----------------------------------------------------------------------------
+4.3 Q: The mouse works, but I can't see the mouse pointer!
+
+A: Try with the --no-mouse-hook command line options.
+
+-----------------------------------------------------------------------------
+4.4 Q: I'm using Windows 2000 or XP and I have problems with the mouse.
+
+A: I personally don't have access to a W2k nor XP box and I don't really plan
+to do it any time soon. The following explanation was posted to RHIDE's
+mailing list and verified by two users:
+
+"Clicking on the logo on the top left of the DOS box.
+Going to properties.
+Unchecking Quick Edit mode and Insert mode.
+
+The mouse will work correctly the next time you open RHIDE and the problem
+will not reoccur."
+
+=============================================================================
+5. Sound problems
+
+5.1 The sound is too noisy (crispy), why?
+
+A: Most PCI cards have problems to emulate the Sound Blaster when a djgpp
+program is running.
+ I saw it using a Creative 128 PCI card and Andreas Martin
+<Bastardizer@t-online.de> reported similar problems with Creative Ensoniq
+AudioPCI (Soundblaster) card. This topic was also discussed in the Allegro
+mailing list.
+
+=============================================================================
+6. Keyboard problems
+
+6.1 The editor doesn't catch all the keyboard combinations, why?
+
+A: Some cases are obvious, like it: Windows 95 catches some keys and never
+pass them to the application it can be solved fine tunning the direct access
+or .pif file used.
+ Others are more obscure. Ctrl+ ` 1 4 5 7 8 9 0 = ; ' , . and / and the
+Macro key are never detected by BIOS. To detect this keys you can use a small
+resident (TSR) program included in the kextend.zip file of this distribution.
+ And other cases could be because you are using BIOS keyboard mode (to
+detect if a key was pressed and extract it). If you use the -b option you'll
+lose some keyboard combinations.
+
+-----------------------------------------------------------------------------
+6.2 I get random keys pressed all the time, why?
+
+A: We use special routines to extract keys directly from the BIOS queue, but
+some new motherboards seems to have a strange BIOS that handles the queue in
+a different way breaking this methode. You can try using the -b option to
+force the editor to use BIOS to extract keys. You'll lose some keyboard
+combinations.
+ We need volunteers that have this problem to help as find the problem, so,
+if you experiment it please send me an e-mail.
+
+=============================================================================
+7. sLisp macro language
+
+7.1 How can I extend it?
+
+A: You must have C++ skills. The important source files are located in the
+sdg directory and are prefixed with "mli". The header files are located in
+sdg/include. Here is a small text I wrote for a user (Thiago) that
+contributed an sLisp command. It helped Thiago so it could help you too:
+
+<---------------------
+> I've been reading the code of the sLisp interpreter, because I am
+> trying to implement 'cond'. But I am having a hard time trying to
+> understand it. Can you help me?
+
+Of course but be patient I don't have long amounts of time.
+
+> Can you give an overview of how is works?
+> How is the sLisp code stored in memory after it is read?
+
+There is a variable type for code, is basically some kind of string
+variable that holds a function.
+
+> I noticed that there is a "main" function in mli.cc. Is it possible
+> to make a stand-alone version of the interpreter? How?
+
+I think it was created for the first tests and trying to compile it
+now could be a challenge.
+
+> What is the difference between TLispCode and TLispCommand?
+
+When you define a macro you are creating some kind of function. This
+is stored in a code variable.
+A code variable is like a string that contains a sLisp function.
+When the parser tries to reduce a one statement like it (command ....)
+uses a Command variable. That's just like an integer that indicates
+which command must be applied to the arguments list.
+
+I think the most important thing you must know to achieve your
+objetive is how to extend the language.
+sLisp have a group of core functions, they are defined in mli.cc look
+for TMLIBase::cNames[MLIBaseCommands] and Command
+TMLIBase::cComms[MLIBaseCommands]. The MLIBaseCommands value is
+defined in mlibase.h, to add a new command or operator you must first
+increment the counter and then add the name and function that
+implements it to the arrays (char *TMLIBase::sNames[MLIBaseSymbols]
+and Command TMLIBase::sComms[MLIBaseSymbols] for operators).
+The core functionallity is extended by derived classes. One
+specializes sLisp for SDG and the other for the editor. Commands that
+only works for an edition buffer are defined in mliedito.cc (see char
+*TMLIEditor::cNames[MLIEditorCommands]) The number of defined commands
+is in mliedito.h.
+To reduce the ammount of typing sLisp commands implementations relies
+on some cleaver macros.
+One important detail is that Lisp language is evaluated just like a
+stack, things are ever nested. For this reason you'll see every
+function will release your arguments from this stack at exit.
+[Note: It applies to local copies of the arguments, the real arguments
+are automatically released].
+Let me show you a simple function:
+
+DecFun(MLIBaseLeft)
+{
+ int l;
+ LocVarStr(string);
+ LocVarInt(left);
+
+ CheckNumParams(cant!=2);
+ GetString(0,string);
+ GetInteger(1,left);
+
+ l=left->val;
+ if (l>string->len)
+ l=string->len;
+
+ MLIRetStrLen(string->str,l);
+
+ CleanUp:
+ destroyFloatVar(string);
+ destroyFloatVar(left);
+}
+
+DecFun macro declares the C arguments list for this function, all
+sLisp commands have the same so this macro abstracts it.
+LocVarStr(string); declares a sLisp variable of type String called
+string. That's just a pointer to object declaration.
+In a similar way LocVarInt(left); declares an integer variable called
+left.
+Those are just pointers and doesn't have any value, in fact they are
+null pointers.
+To check we got the right number of arguments we use:
+CheckNumParams(cant!=2); here if the number of arguments is !=2 a
+parser error is generated. Some arguments could be optional and is
+possible to implement functiona that takes a arbitrary number of
+arguments. The cant variable says how many arguments we got.
+To retrieve the arguments we use: GetString(0,string) and
+GetInteger(1,left) the first takes a string that is the first argument
+in the list (index 0) and the second takes an integer. They assign
+their value to the variables we defined at the beginning of the
+function. If the argument tipe doesn't match the code generates a
+syntax error (or something like that). You can retreive just a
+variable without speciying the type and act according the type.
+The next 3 lines implements the function core.
+To return a new string we use MLIRetStrLen(string->str,l).
+And finally comes a clean up. This is a label because the above
+mentioned macros jumps here in case of error.
+Here you must release any variable used.
+Take a look at mlibase.h to know about the available macros.
+As you can see the code is simple and clean thanks to the macros.
+
+Here is an interesting example: eval
+
+DecFun(MLIBaseEval)
+{
+ int i;
+ LocVar(Variable);
+
+ for (i=0; i<cant; i++)
+ {
+ GetVar(i,Variable);
+ if (i+1==cant)
+ MLIRetObj(Variable);
+ else
+ destroyFloatVar(Variable);
+ }
+ CleanUp:
+ return;
+}
+
+Looks quite simple and could be even confusing. The first interesting
+thing here is that we use LocVar and GetVar, they takes just a
+variable. It doesn't matter what type. When you take a variable it
+could be just a variable (string, integer, etc.) or it could be a Code
+variable. The GetVar applied to a Code variable evaluates it to reduce
+the Code into a simple variable. So here just getting each variable is
+enough to evaluate all the statements. The number of arguments is
+arbitrary and we just use a for. The code returns the last object we
+evaluated, not a copy, and that's why we destroy all but the last.
+And here is the if example. I don't remmember why but it is
+implemented without all the macros:
+
+void MLIBaseIf(TMLIBase *o,int start ,int cant)
+{
+ if (cant<2 || cant>3)
+ {
+ o->Error=MLINumParam;
+ MLIRetNULL();
+ return;
+ }
+ TLispVar *p=o->Solve(start);
+ int boolval=o->MLIBooleanValOf(p);
+ destroyFloatVar(p);
+ if (boolval)
+ MLIRetObj(o->Solve(start+1));
+ else
+ if (cant==3)
+ MLIRetObj(o->Solve(start+2));
+ else
+ MLIRetInt(0);
+}
+
+Here you can see what's inside the usual macros like GetxxxVar, the
+->Solve is needed to evaluate an argument.
+<---------------------
+
+If you need more information just e-mail me.
+
+=============================================================================
+8. Edition modes
+
+8.1 What options should I use to get real tabs (ascii 9)?
+
+A: Most users that indents code using tabs uses the following options (Alt+G
+or Alt+L):
+
+Autoindent: ON
+Use Tabs: ON
+Intelligent C indent: OFF
+Optimal Fill: ON
+Don't move inside tabs: ON
+Tab smart indents: OFF
+Use indent size: OFF
+Backspace unindents: OFF
+
+=============================================================================
+End of file
+
diff --git a/setedit/www-site/ComparativaGCC.html b/setedit/www-site/ComparativaGCC.html
new file mode 100644
index 0000000..15eb299
--- /dev/null
+++ b/setedit/www-site/ComparativaGCC.html
@@ -0,0 +1,191 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<HTML>
+<HEAD>
+
+ <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
+ <TITLE></TITLE>
+ <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
+ <META NAME="CREATED" CONTENT="20050617;13584800">
+ <META NAME="CHANGED" CONTENT="20050621;11261100">
+
+ <STYLE>
+ <!--
+ BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
+ -->
+ </STYLE>
+
+</HEAD>
+
+<BODY TEXT="#000000">
+<TABLE FRAME=VOID CELLSPACING=0 COLS=10 RULES=GROUPS BORDER=1>
+ <COLGROUP><COL WIDTH=142><COL WIDTH=113><COL WIDTH=104><COL WIDTH=127><COL WIDTH=127><COL WIDTH=89><COL WIDTH=89><COL WIDTH=89><COL WIDTH=89><COL WIDTH=89></COLGROUP>
+ <TBODY>
+ <TR>
+ <TD WIDTH=142 HEIGHT=18 ALIGN=LEFT>Versi&oacute;n de GCC</TD>
+ <TD WIDTH=113 ALIGN=LEFT>Compilar TV</TD>
+ <TD WIDTH=104 ALIGN=LEFT>Compilar Ed</TD>
+ <TD WIDTH=127 ALIGN=LEFT>Compilado Total</TD>
+ <TD WIDTH=127 ALIGN=LEFT>Prueba velocidad</TD>
+ <TD WIDTH=89 ALIGN=LEFT>Tama&ntilde;o TV</TD>
+ <TD WIDTH=89 ALIGN=LEFT>Tama&ntilde;o Ed</TD>
+ <TD WIDTH=89 ALIGN=LEFT>Tama&ntilde;o total</TD>
+ <TD WIDTH=89 ALIGN=LEFT><BR></TD>
+ <TD WIDTH=89 ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=17 ALIGN=LEFT>v2.95.4</TD>
+ <TD ALIGN=RIGHT SDVAL="43" SDNUM="11274;">43</TD>
+ <TD ALIGN=RIGHT SDVAL="91" SDNUM="11274;">91</TD>
+ <TD ALIGN=RIGHT SDVAL="134" SDNUM="11274;">134</TD>
+ <TD ALIGN=RIGHT SDVAL="6,35" SDNUM="11274;">6,35</TD>
+ <TD ALIGN=RIGHT SDVAL="862940" SDNUM="11274;">862940</TD>
+ <TD ALIGN=RIGHT SDVAL="1327920" SDNUM="11274;">1327920</TD>
+ <TD ALIGN=RIGHT SDVAL="2190860" SDNUM="11274;">2190860</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=17 ALIGN=LEFT SDNUM="11274;0;DD/MM/AA">v3.3.5</TD>
+ <TD ALIGN=RIGHT SDVAL="172" SDNUM="11274;">172</TD>
+ <TD ALIGN=RIGHT SDVAL="258" SDNUM="11274;">258</TD>
+ <TD ALIGN=RIGHT SDVAL="430" SDNUM="11274;">430</TD>
+ <TD ALIGN=RIGHT SDVAL="5,2" SDNUM="11274;">5,2</TD>
+ <TD ALIGN=RIGHT SDVAL="936592" SDNUM="11274;">936592</TD>
+ <TD ALIGN=RIGHT SDVAL="1283964" SDNUM="11274;">1283964</TD>
+ <TD ALIGN=RIGHT SDVAL="2220556" SDNUM="11274;">2220556</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=17 ALIGN=LEFT>v3.3.5 + SSC</TD>
+ <TD ALIGN=RIGHT SDVAL="52" SDNUM="11274;">52</TD>
+ <TD ALIGN=RIGHT SDVAL="132" SDNUM="11274;">132</TD>
+ <TD ALIGN=RIGHT SDVAL="184" SDNUM="11274;">184</TD>
+ <TD ALIGN=RIGHT SDVAL="5,25" SDNUM="11274;">5,25</TD>
+ <TD ALIGN=RIGHT SDVAL="866608" SDNUM="11274;">866608</TD>
+ <TD ALIGN=RIGHT SDVAL="1254908" SDNUM="11274;">1254908</TD>
+ <TD ALIGN=RIGHT SDVAL="2121516" SDNUM="11274;">2121516</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=18 ALIGN=LEFT>GCC version</TD>
+ <TD ALIGN=LEFT>TV compilation</TD>
+ <TD ALIGN=LEFT>Ed compilation</TD>
+ <TD ALIGN=LEFT>Compilation Total</TD>
+ <TD ALIGN=LEFT>Speed Test</TD>
+ <TD ALIGN=LEFT>TV Size</TD>
+ <TD ALIGN=LEFT>Ed Size</TD>
+ <TD ALIGN=LEFT>Total Size</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=17 ALIGN=LEFT>v2.95.4</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=RIGHT SDVAL="100" SDNUM="11274;">100</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=17 ALIGN=LEFT SDNUM="11274;0;DD/MM/AA">v3.3.5</TD>
+ <TD ALIGN=RIGHT SDVAL="25" SDNUM="11274;">25</TD>
+ <TD ALIGN=RIGHT SDVAL="35,2713178294574" SDNUM="11274;">35,27</TD>
+ <TD ALIGN=RIGHT SDVAL="31,1627906976744" SDNUM="11274;">31,16</TD>
+ <TD ALIGN=RIGHT SDVAL="122,115384615385" SDNUM="11274;">122,12</TD>
+ <TD ALIGN=RIGHT SDVAL="92,1361702854605" SDNUM="11274;">92,14</TD>
+ <TD ALIGN=RIGHT SDVAL="103,423460470854" SDNUM="11274;">103,42</TD>
+ <TD ALIGN=RIGHT SDVAL="98,6626772754211" SDNUM="11274;">98,66</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD HEIGHT=17 ALIGN=LEFT>v3.3.5 + SSC</TD>
+ <TD ALIGN=RIGHT SDVAL="82,6923076923077" SDNUM="11274;">82,69</TD>
+ <TD ALIGN=RIGHT SDVAL="68,9393939393939" SDNUM="11274;">68,94</TD>
+ <TD ALIGN=RIGHT SDVAL="72,8260869565217" SDNUM="11274;">72,83</TD>
+ <TD ALIGN=RIGHT SDVAL="120,952380952381" SDNUM="11274;">120,95</TD>
+ <TD ALIGN=RIGHT SDVAL="99,5767405793623" SDNUM="11274;">99,58</TD>
+ <TD ALIGN=RIGHT SDVAL="105,818115750318" SDNUM="11274;">105,82</TD>
+ <TD ALIGN=RIGHT SDVAL="103,268606034553" SDNUM="11274;">103,27</TD>
+ <TD ALIGN=LEFT><BR></TD>
+ <TD ALIGN=LEFT><BR></TD>
+ </TR>
+ <TR>
+ <TD COLSPAN=10 ROWSPAN=32 HEIGHT=549 ALIGN=LEFT><BR><IMG SRC="ComparativaGCC_html_m35e8e2b6.jpg" WIDTH=1050 HEIGHT=530 HSPACE=6 VSPACE=24>
+ </TD>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ <TR>
+ </TR>
+ </TBODY>
+</TABLE>
+<!-- ************************************************************************** -->
+</BODY>
+
+</HTML>
diff --git a/setedit/www-site/ComparativaGCC_html_m35e8e2b6.jpg b/setedit/www-site/ComparativaGCC_html_m35e8e2b6.jpg
new file mode 100644
index 0000000..3f480a4
--- /dev/null
+++ b/setedit/www-site/ComparativaGCC_html_m35e8e2b6.jpg
Binary files differ
diff --git a/setedit/www-site/Cygwin_install.txt b/setedit/www-site/Cygwin_install.txt
new file mode 100644
index 0000000..c3f8eeb
--- /dev/null
+++ b/setedit/www-site/Cygwin_install.txt
@@ -0,0 +1,135 @@
+Setedit-Cygwin_install-HOWTO
+for setedit-Win32-Cygwin-0_4_54 (unstable)
+
+
+INTRODUCTION
+
+This is just a kind of log of activities I did to get a running version
+of Setedit under my installation of Cygwin. So, if you find it useful
+for your own needs - that's great!
+
+The original home page for Setedit is:
+http://setedit.sourceforge.net
+
+
+BACKGROUND
+
+Right now (as of May 2002), there are two ready to use versions of
+Setedit: one is for DJGPP/DOS and second is for GNU/Linux. For Cygwin
+there is only an executable of Setedit without any accompanying files.
+
+Since Cygwin is a quite fine port of GNU tools onto the Win32 platform,
+I suggest to start with Linux version of Setedit. Then just merge most
+of its files with Cygwin installation and put the mentioned executable
+into Cygwin's /usr/bin.
+
+
+DOWNLOAD
+
+First of all, you need two things.
+
+Linux version of Setedit:
+http://prdownloads.sourceforge.net/setedit/setedit-0.4.54.bin.i386.elf.static.linux.tar.gz
+
+Cygwin executable of Setedit:
+http://prdownloads.sourceforge.net/setedit/setedit-Win32-Cygwin-0_4_54.zip
+
+Eventually, it's possible to use executable produced by free BC++ 5.5
+compiler. It may work fine for you, but we are concerned here with
+running a Cygwin version of Setedit, right? :-)
+
+
+HOW TO DO IT
+
+The idea is to use uncompressed version from home directory and to
+merge most of files from there with current installation of Cygwin.
+
+And now step by step instructions.
+
+
+STEP 1.
+Put the 'setedit-0.4.54.bin.i386.elf.static.linux.tar.gz' and
+'setedit-Win32-Cygwin-0_4_54.zip' files in home directory. Then
+execute the following command:
+
+$ tar -xzf setedit-0.4.54.bin.i386.elf.static.linux.tar.gz
+
+This in an effect should create a subdirectory 'setedit-0.4.54'.
+
+
+STEP 2.
+Merge (install) the Setedit files by executing following commands:
+
+$ cd setedit-0.4.54
+$ ./INSTALL.LINUX
+
+This will install Setedit as it would under GNU/Linux. But for Cygwin
+it's not yet useful! Proceed to STEP 3 to complete installation.
+
+Note 1:
+ The above worked for me well. If you want to check what will
+ be done, or to have a detailed log of the actions undertaken by
+ the INSTALL.LINUX script, you may try one of the following:
+
+* just print the commands, but don't execute them:
+ $ ./INSTALL.LINUX -n
+
+* install Setedit also creating an installation log:
+ ./INSTALL.LINUX | tee ~/setedit-install.log
+
+Note 2:
+ All the files which should go to the Cygwin's /usr/bin directory
+ are really placed in the /bin dir (easily seen in e.g. Windows
+ Explorer), and /usr/bin stays empty all the time -- for some reason,
+ which only people at Cygnus know. Anyway, I can live with it.
+
+
+STEP 3.
+Now one of the most important things - extract and copy Setedit for
+Cygwin executable instead of Linux version:
+
+$ rm /usr/bin/setedit
+$ unzip setedit-Win32-Cygwin-0_4_54.zip
+$ mv seteditW32.exe /usr/bin/setedit.exe
+
+
+STEP 4.
+Finally - polishing the Setedit installation.
+
+If you installed 'texinfo' under Cygwin, it will not read gzipped info
+files by default. It's possible to mess a little with configuration of
+info itself, but easier way is to gunzip Setedit info files by hand:
+
+$ gunzip /usr/info/infview.info.gz
+$ gunzip /usr/info/sdg.info.gz
+$ gunzip /usr/info/setedit.info.gz
+
+Almost the same stands for man page for Setedit, but this time man *do*
+reads the gzipped man pages by default. Anyway, for completness, man
+page may be also gunzipped (note this is not necessary):
+
+$ gunzip /usr/man/man1/setedit.1.gz
+
+If you didn't install XFree86 under Cygwin (which I didn't) or do not
+intend to use 'eterm' (which I don't), then you may freely remove
+the following directory:
+
+$ rm -rf /usr/share/setedit/eterm
+
+
+FINAL WORDS
+
+The above procedure should give you a working installation of Setedit
+under Cygwin. But 'working' and 'well-working' are not (yet) the same.
+Please test it and post your comments to the mailing list:
+
+http://lists.sourceforge.net/mailman/listinfo/setedit-users
+
+or to the autor, Salvador E. Tropea,
+e-mail: salvador@inti.gov.ar.
+
+
+Have fun with Setedit/Cygwin!
+
+Wiktor Wandachowicz,
+e-mail: wiktorw@ics.p.lodz.pl
diff --git a/setedit/www-site/announce.html b/setedit/www-site/announce.html
new file mode 100644
index 0000000..8bdaaa8
--- /dev/null
+++ b/setedit/www-site/announce.html
@@ -0,0 +1,266 @@
+<HTML><Title>announce for setedit</Title><Body><Pre>That's the announcement that I released the SET's editor Glaciar P.Moreno I release
+(v0.5.4):
+
+What's SET's editor?
+
+ SETEdit or setedit or SET's editor is a text mode oriented text editor
+with the look & feel of the old Borland's IDE. It have windows that can be
+overlapped, common widgets (buttons, menues, check and radio buttons,
+etc.), mouse support and old the funny things you usually find in a GUI
+editor (even when all is in text mode).
+ The editor is mainly oriented for programmers because it have tons of
+tools that helps writing programs, specially C/C++, but suitable to edit
+any kind of text file. In fact the code page and fonts handling options
+make it very suitable to edit text in different encodings and convert it
+back and forth from one encoding to another. Some nice widgets like
+graphical screen savers and MP3 player also makes the editor a funny
+environment.
+ For those who know about RHIDE: setedit is the same editor you can find
+inside RHIDE but without the IDE itself, as it's the last version have more
+features (and bugs?, I hope it have less ;-), seriously, I killed a huge
+number of bugs most small but some very annoying).
+ Is also true that some features takes a lot of time to be incorporated to
+RHIDE or just won't be incorporated to RHIDE at all. The standalone editor
+is also very suitable to be used for the parts of your project that are
+handled with makefiles.
+
+Main features:
+* Easy to use for DOS users because have a lot of CUA and Wordstar commands
+used in the editors of other compilers.
+* Full configurable keyboard.
+* Full configurable menu (OS dependent features and macros in menues).
+* Advanced features: Rectangular blocks, intelligent indent, configurable
+syntax highlight and more.
+* Simple macro language, will be expanded only if the people is interested
+and helps a bit (which is starting to happend).
+* PMacros for fast writing.
+* Real macros.
+* Debugger interface (only for Linux).
+* Documentation tool for libraries or large projects.
+* Fonts, code pages, screen modes and palette customization.
+* You can run make or grep from the editor collecting the errors/hints.
+* Clock and screen saver.
+* Linux and Win32 versions (FreeBSD, QNX and Solaris also supported).
+
+Why I could want to download it if RHIDE exists?
+
+ The editor is the newest version v0.5.4 and have a lot of differences with
+the one included in RHIDE 1.4 (v0.3.6). Attention! Robert released a new
+beta of RHIDE (1.4.9) containing one of the newest editors.
+ Here are some of the reasons you could have:
+
+1) You like the editor and want to use it without needing to start the whole
+IDE. The editor have a half of the size of RHIDE mainly because GDB isn't
+inside of the editor. I use my editor to edit all the files I create ;-).
+2) You are a RHIDE fanatic and want to test the new features or check if
+some bug was killed.
+3) You are a djgpp fanatic and want to collect anything made with djgpp (I'm
+one of these crazy mans ;-).
+4) You don't like RHIDE at all, you think it sucks, but you think you can
+help to make it a really good thing.
+
+...
+
+Ok, where can I get it?
+
+ http://setedit.sourceforge.net/
+
+(DOS/Linux/Win32 sources/binaries/cvs are available from this page
+ QNX/FreeBSD/Solaris versions must be compiled from sources).
+
+---------------------------------------------------------------------------
+[66 new things and 40 fixes]
+
+New [66 things]:
+
++ Debug [12] --&gt; NEW Functionality for *Linux* &lt;--
+
+* Dialogs to configure the debug mode (local, remote and running process), the
+command line options for the program, gdb binary, xterm binary, messages
+displayed, etc.
+* Breakpoints, simple ones and advanced options including conditional
+breakpoints, breakpoints at functions, ignore count, etc.
+* Watchpoints, they are data breakpoints.
+* Options to run, continue, step over, trace into, run upto return, etc.
+* Options to stop and kill the program.
+* Thread selection.
+* Evaluate and modify data.
+* Data Window and Satck to browse the memory (very complete and with its own
+menu).
+* Data Watches, like then ones in RHIDE and also with scope.
+* Data Inspectors, used to analyze complex data structures.
+* Disassembler Window, including syntax highlight and allowing to modify the
+registers.
+* Calling stack, with functionality to browse the call chain.
+
++ Various [15]
+
+* Alternative project sorting mode.
+* Commands to select any window, now Alt+Key is no longer hardcoded.
+* Sections in the docs to help finding what you need.
+* When asking for word completion if the word at the left looks like Class::
+then the editor looks for the class and offers the members.
+* Enhacements to the "Paste Emacs Mode" and the code to search Emacs
+variables.
+* Now if you don't specify any path to "search files under cursor" the editor
+tries to automagically fills this list using the output of cpp.
+* If the editor fails to find the file under cursor now it also looks for it
+in the project and the current directory.
+* Some rudimentary $(VARIABLE) expansion to the "File under cursor" files
+list.
+* A button to recompute window numbers in the list of windows.
+* "File open" dialogs remmembers its size and position.
+* Non interactive versions of the cmcExpandAllTabs and cmcCompactBuffer
+commands to be used from sLisp.
+* Two new commands: cmeGPushCursorPos and cmeGPopCursorPos. They are "global
+push/pop cursor pos". So they also remmember the file.
+* Options to zoom the editor windows when inserted in the desktop.
+* An option to regenerate the central tags file. Used to workaround ctags bug.
+* Modified behavior of the paste operation in input lines: Now the text is
+pasted without destroying the previous value (unless it is selected).
+
++ Menu files [4]
+
+* Context sensitive menues. Also extended the .smn file language to create
+such a thing. Currently used only for the data window and the help.
+* The conditionals in menu files can use the TV driver, CPU, OS, etc. for
+conditions.
+* More variables to check: MP3, PCRE, BZIP2, MIXER and UNIX.
+* $define and $undef and its expansion.
+
++ Compilation [2]
+
+* The posibility to override the "install" command in makefiles.
+* Unified compilation mechanism for BC++.
+
++ sLisp [9]
+
+* FindString, FindAgain, ReplaceString and ReplaceAgain for searches.
+* SelectWindowNumber used to change the focused window.
+* GetCurWindowNumber and GetMaxWindowNumber.
+* You can bind small portions of sLisp code to keys and menu entries.
+* KeyBindings and BindKey commands. With them you can change key bindings
+from sLisp.
+* prex to perform Perl regular expressions searches.
+* GetSystemInfo to know the current OS, TV driver, CPU, etc.
+* More macros examples.
+* Now you can send cme* commands.
+
++ Syntax highlight and pmacros [8]
+
+* Flat Assembler syntax.
+* Ruby syntax.
+* SPARC assembler syntax.
+* WML syntax and pmacros.
+* Errors parser for Perl.
+* C,H and CPP as valid C extensions as valid for C/C++.
+* HTML extensions as valid for HTML.
+* vbe and vst as VHDL extensions.
+
++ Cosmetic [16]
+
+* Project windows are "closed" (hided) when pressing ESC.
+* Windows are opened "zoomed" when the project window isn't visible.
+* When automatically opening a project item now its opened using the relative
+path.
+* Select the closest word when using double click and not the next.
+* History to the "arbitrary indent" and "run command" input lines.
+* To lock the screen while doing a search & replace operation to avoid
+"flashing" when doing a lot of S&R operations.
+* Modified: "Do not purge spaces" option to be "Keep trailing whitespace"
+that's more descriptive.
+* A new color scheme called "Classic Borland"
+* A new color scheme called "Midnight Commander"
+* If the Ctrl+Enter fails to find the file under cursor now that's informed
+in the "status line" of the current editor.
+* Most lists (like functions list) now centers the focused item when a match
+is selected.
+* OS/OS flavor,CPU,Compiler/Compiler flavor and Driver to the about box.
+* Configuration options to disable the calculator and calendar.
+* Now the meassure command reports the result in the status line.
+* A beep when "Run a program" finishes. Option to disable.
+* Busy indicator while we load the tags from disk.
+
+
+Fixed [40 things]:
+
++ Fatal [4]
+
+* The "Jump" button in the main window of the class browser.
+* Undo count for the first undo wasn't initialized. Unknown consequence.
+* Corrupted MP3 files could produce a crash.
+* Abort when doing word completion and the starting word was "bigger" than
+the last tag in the list.
+
++ Not fatal [17]
+
+* HTML export: missing body tag.
+* Errors in the conditionals parser for menu files.
+* Undo error when a character replaced a tab (overwrite enabled) and the
+cursor was inside the tab (not at the beggining).
+* Wrong match pair when the cursor was in the middle of a tab and the next
+character matched a pair (highlight in the middle of the tab).
+* No match pair after deleting some text and the cursor goes to a symbol.
+* When searching outside comments and the match was found in the first column
+of a line after a comment it was ignored.
+* When starting a project using a different window size the project window
+could get wrong size and even become outside the screen.
+* When aborting an overwrite (in save as) the name of the window was changed.
+* When pasting using the OS clipboard and the cursor was moved to the end of
+the selection it could go out of screen which is quite annoying.
+* When copying something from the calculator and the paste wasn't enabled
+before entering the calculator then you needed to at least move the cursor
+before you could paste.
+* Use of unitialized undo counter in some rectangular selection operations.
+* The heuristic C/C++ parser to support list of exceptions (function
+throw(...) {body}).
+* Some details in the heuristic C++ functions searcher. They address problems
+with the const and throw() attributes.
+* Various memory leaks.
+* "New" buffers shouldn't be added to the list of closed windows when closed.
+It generated a read out of bounds and a write of unitialized data to disk.
+* The menu files uses nested preprocessor directives but it wasn't supported.
+* cmcCutClipWin command not dis/enabled when selecting text.
+
++ Compilation [13]
+
+* Cygwin: Collision between strndup and calculator parser.
+* Some gcc versions needs explicit use of libstdc++ to link C++ and
+internac/getcolors didn't have it.
+* Removed two comments containing non-ASCII chars.
+* Various gcc 3.x compilation issues (including gcc 3.4.1 support).
+* Problems with newer versions of makeinfo.
+* The memcpy usage to be more portable. It worked for all supported targets,
+but now should also work for unsupported targets. Same for malloc/new/new[]
+v.s. free/delete/delete[] calls.
+* Missing va_end and abuse of va_list type. It gave problems for Linux PPC
+targets.
+* Use of "g++" in favor of "gcc -lstdc++".
+* strstr and strchr are declared different in C++ standard (compared to C
+standard). Needed to avoid BC++ compilation problems.
+* Various MSVC compilation issues.
+* --cxx-flags flag was reported as --cpp-flags in the help. Now both are
+valid.
+* Cygwin can execute the "make install" target, but it installed binaries
+without .exe extension.
+* Detection of pcre header for systems where the header is in pcre/pcre.h.
+Red Hat is an example.
+
++ Linux [3]
+
+* Code page problems when mixing console use and remote XTerm use.
+* RPM prereq for /sbin/install-info.
+* Problems to create the rpms using Fedora Core 2.
+
++ Cosmetic [3]
+
+* Some drawing variables not initialized. Could make the row/col cursor
+appear until a new redraw.
+* Now the cmc*Win (Copy,Cut,Paste) commands are called cmc*OS to reflect
+their real use. The old names remains as aliases.
+* The list for word completion had a wrong vertical size when we had repeated
+tags in the list to choose. Only one was visible but the size was computed
+counting the repetitions.
+
+
+</Pre></Body></HTML> \ No newline at end of file
diff --git a/setedit/www-site/change.html b/setedit/www-site/change.html
new file mode 100644
index 0000000..5e1af99
--- /dev/null
+++ b/setedit/www-site/change.html
@@ -0,0 +1,5928 @@
+<HTML><Title>change.log for setedit</Title><Body>$Log: change.html,v $
+<HTML><Title>change.log for setedit</Title><Body>Revision 1.3 2004/09/29 20:07:12 set
+<HTML><Title>change.log for setedit</Title><Body>* Fixed: [DOCs] Message about pressing F1 in the printed version. Also
+<HTML><Title>change.log for setedit</Title><Body>wrong copyright year.
+<HTML><Title>change.log for setedit</Title><Body>* Fixed: strdup vs delete[] in tips.cc, reported by valgrind.
+<HTML><Title>change.log for setedit</Title><Body>* Updated: [WWW] Main page, changes and readme. 0.5.4 is currently named
+<HTML><Title>change.log for setedit</Title><Body>as pre-release.
+<HTML><Title>change.log for setedit</Title><Body>-------- CVS TAG r0_5_4rc1
+<HTML><Title>change.log for setedit</Title><Body><br><b>Revision</b> 1.617 2004/09/24 18:59:51 set<br>
+<li> Fixed: The SF Rev 1.523 patch about holidays clean-up was buggy. It
+released the loaded stuff but didn't indicate it. So when opening the
+calendar again the code used freed memory.<p>
+<b>Revision</b> 1.616 2004/09/23 19:45:33 set<br>
+<li> Fixed: [sLisp] edf* constants not working. The WinDebugger definition was
+unsorted. Reported by Thiago.<p>
+<b>Revision</b> 1.615 2004/09/23 19:19:07 set<br>
+<li> Fixed: [RPMs] Problems to generate the RPMs using Red Hat 9.0. The
+changes introduced by bbcat should be enough (they are for Fedora Core 2),
+but more is needed to avoid problems with RH9.0. The problems are related
+to the generation of a RPM file with debug info.<p>
+<b>Revision</b> 1.614 2004/09/23 19:05:45 set<br>
+<li> Fixed: [BC++] The last change to support pcre/pcre.h needed changes in
+the configed.h file for Win32.<p>
+<b>Revision</b> 1.613 2004/09/22 18:45:13 set<br>
+<li> Fixed: [NHP] isDisassemblerEditor not initialized when loading from disk.<p>
+<b>Revision</b> 1.612 2004/09/20 14:16:01 set<br>
+<li> Fixed: [MSVC] When you compile for "Debug" the compiler disables *all*
+the optimizations. Including the dead code. For this reason MSVC also needs
+fake references.<p>
+<b>Revision</b> 1.611 2004/09/20 14:13:03 set<br>
+<li> Added: [Config] A command line option to specify a path for includes.
+This path is used for the configuration tests and for the editor.<p>
+<b>Revision</b> 1.610 2004/09/17 20:52:41 set<br>
+<li> Added: [WWW] Some changes towards the next release.<p>
+<b>Revision</b> 1.609 2004/09/17 18:51:55 set<br>
+<li> Fixed: [MSVC] Another min/max mix. Reported by Arnold.<p>
+<b>Revision</b> 1.608 2004/09/17 16:38:35 set<br>
+<li> Added: [Cygwin] Workaround for bugs in Cygwin's perl. Cygwin is
+configured to use DOS files, but when parsing DOS files you must match the
+/r char. DJGPP implementation is much more cleaver about it.<br>
+<li> Added: [Cygwin] libmigdb detection.<br>
+<li> Note: Current status of the editor using brand new Cygwin is "compile but
+the resulting binary is useless". Note that while compiling the editor I
+got SIGSEGVs from Perl and bash. It looks like Cygwin still alpha, at least
+for Windows 98 SE.<p>
+<b>Revision</b> 1.607 2004/09/17 16:25:59 set<br>
+<li> Modified: [Config] Now the .po files are regenerated only if the user
+configures enabling the maintainer mode. This should reduce CVS collisions.<p>
+<b>Revision</b> 1.606 2004/09/17 16:09:46 set<br>
+<li> Added: [Debug] An advice dialog when debugging in the Linux console
+indicating the program will be started in another VT. Also some explanation
+about it in the docs.<p>
+<b>Revision</b> 1.605 2004/09/16 20:59:51 set<br>
+<li> Added: [Config] AMD64 and NetBSD detection. It doesn't mean they are
+supported.<p>
+<b>Revision</b> 1.604 2004/09/15 13:10:06 set<br>
+<li> Fixed: [Config] wrong pcre header selected when using shipped pcre.
+Problem introduced by the recent patch to support pcre/pcre.h.<p>
+<b>Revision</b> 1.603 2004/09/14 19:01:11 set<br>
+<li> Added: [Config] Message warning about the lack of debug support.<br>
+<li> Added: [Distrib] The list of added/fixed things. 66 new things and 40
+fixes.<p>
+<b>Revision</b> 1.602 2004/09/10 19:55:06 set<br>
+<li> Modified: To include libmigdb in the distro (if available).<br>
+<li> Modified: [Config] To use the shipped libmigdb if none installed.<br>
+<li> Modified: [Config] To detect installations where pcre header is in the
+pcre directory. Red Hat seems to use it according to Vik Heyndrickx.<p>
+<b>Revision</b> 1.601 2004/09/10 18:11:57 set<br>
+<li> Added: Debug and InfView stuff to redmond.smn. InfView stuff to
+simple.smn.<br>
+<li> Added: [i18n] Data Window menu and missing debug menu entries to
+editmenu.cc.<br>
+<li> Updated: [i18n] Spanish translation.<p>
+<b>Revision</b> 1.600 2004/09/09 20:47:22 set<br>
+<li> Fixed: [Debug] various menu entries associated to dialogs that didn't
+indicate it using "...".<br>
+<li> Added: [i18n] various debug menu entries to editmenu.cc so they can be
+translated.<p>
+<b>Revision</b> 1.599 2004/09/08 20:19:43 set<br>
+<li> Added: [DOC] More debug documentation, now the core functionality is
+documented.<br>
+<li> Added: [Help] Linked debug help contexts to the documentation.<p>
+<b>Revision</b> 1.598 2004/09/08 18:14:32 set<br>
+<li> Added: [SHL] For SPARC assembler.<br>
+<li> Added: [Debug] syntax highlight for SPARC targets. Now the code can be
+adapted to other architectures with minor changes. Also tested stack window
+on an Ultra 60 machine.<p>
+<b>Revision</b> 1.597 2004/09/07 20:00:02 set<br>
+<li> Added: [Debug] Support for the Stack Window on SPARC machines. Not
+tested.<br>
+<li> Fixed: [Debug] The disassembler window to hide tabs and use 8 as tab
+size.<p>
+<b>Revision</b> 1.596 2004/09/06 17:15:46 set<br>
+<li> Fixed: [Debug] Problems with the registers list when using gdb 6.x.
+That's a workaround for gdb bug "mi/1770".<p>
+<b>Revision</b> 1.595 2004/09/06 16:25:32 set<br>
+<li> Fixed: [RHIDE] Another name collision (InsertEnviromentVar).<p>
+<b>Revision</b> 1.594 2004/09/06 13:30:20 set<br>
+<li> Fixed: [Debug] cmInspect command collision with RHIDE's command. Reported
+by Vik Heyndrickx <v/pandora/be>.<p>
+<b>Revision</b> 1.593 2004/09/01 20:24:44 set<br>
+<li> Fixed: [Debug] cmDWGotoAddress doesn't have to validate if the address
+is valid, that's just a reference.<br>
+<li> Fixed: [Debug] cmDWFollowPointer and cmDWFollowPtnNew failed because gdb
+interpreted "*0xXXXX" as just "0xXXXX". To avoid it and also avoid the
+mechanism we use to "take the address of"<br>
+<li> Fixed: [Debug] Wrong state displayed in the Debug Window after closing
+the debug session and making it visible.<br>
+<li> Modified: [Debug] Moved Data Window commands cmDWBaseIncrement and
+cmDWBaseDecrement to the movement submenu.<br>
+<li> Added: [Debug] Documentation for all the debug commands. Help contexts
+isn't linked, yet.<p>
+<b>Revision</b> 1.592 2004/08/30 15:34:05 set<br>
+<li> Fixed: [Tags] Abort when doing word completion and the starting word was
+"bigger" than the last tag in the list. Reported by Juan Pablo.<p>
+<b>Revision</b> 1.591 2004/08/27 18:27:00 set<br>
+<li> Fixed: [Debug] Data Window commands not enabled after recycling a data
+window.<br>
+<li> Fixed: [Debug] Data Window: Fill, Clear and Move operations didn't
+update the changes.<br>
+<li> Added: [Debug] Data Window: Explicit error when trying to use a block
+of more than 1 MB. Warning about speed for more than 128 KB. Not sure if
+those limits are good.<br>
+<li> Added: [Debug] Option to don't show again to 3 of the confirmations about
+closing the debug session and killing the debuggee.<br>
+<li> Added: [Debug] Advice about setting debug options without a project.<br>
+<li> Modified: [Debug] Data Window: When entering a wrong value in the block
+operations now we go back to the dialog so the user can fix the wrong
+value instead of entering all again.<br>
+<li> Modified: [Debug] Data Window: Warning about empty fields in the dialog
+for addresses. This is much more descriptive than an error from gdb ;-)<p>
+<b>Revision</b> 1.590 2004/08/26 20:49:05 set<br>
+<li> Fixed: [MSVC] Calls to min/max with different arguments (unsigned vs
+signed). They generate errors with MSVC 6.0. Patch by Arnold.<p>
+<b>Revision</b> 1.589 2004/08/25 20:51:54 set<br>
+<li> Fixed: [Debug] Crash when gdb failed to report registers. Found because
+a bug in gdb CVS 2004-08-25.<br>
+<li> Fixed: [Debug] TDataWindow go to new address not working.<br>
+<li> Fixed: [Debug] CPU line disapearing when setting a breakpoint in other
+line.<br>
+<li> Added: [Debug] "Go to cursor" for the disassembler window.<br>
+<li> Added: [Debug] Made more robust the code that disassembles. Now we first
+try to solve the function name and if it can be solved we use it otherwise
+we disassemble from the current code. We also check if the distance
+between the start of the function and the current point isn't huge, some
+times gdb fails to detect the real function.<br>
+<li> Added: [Debug] Command to detach from "PID target".<br>
+<li> Modified: [Debug] The Run/Continue to also mean "Atach"<p>
+<b>Revision</b> 1.588 2004/08/24 21:17:53 set<br>
+<li> Added: [DOC] More documentation about debug features.<br>
+<li> Fixed: [Cosmetic] Some menu entries that opens dialogs to indicate "..."<br>
+<li> Modified: [Debug] Avoid asking for confirmation when closing a debug
+session that isn't stopped nor running.<br>
+<li> Fixed: [Debug] If gdb failed to disassembler code we shortly SIGSEGVed in
+the idle update.<br>
+<li> Fixed: [Debug] The debug options dialog didn't return success.<p>
+<b>Revision</b> 1.587 2004/08/24 13:16:38 set<br>
+<li> Fixed: [Debug] A couple of typos in new code.<p>
+<b>Revision</b> 1.586 2004/08/24 00:01:16 set<br>
+<li> Added: [config] libmigdb version detection.<p>
+<b>Revision</b> 1.585 2004/08/23 15:54:41 set<br>
+<li> Fixed: [MSVC] The way the linker is called from the makefile. Arnold
+Wiegert's patch.<br>
+<li> Fixed: [MSVC] Lack of Boolean cast in ceditor.cc. From Arnold.<br>
+<li> Fixed: [MSVC] Lack of bool definition in pphp.c. From Arnold.<br>
+<li> Fixed: [RPMs] Wrong directive in specs. Patch from bbcat.<p>
+<b>Revision</b> 1.584 2004/08/22 22:45:16 set<br>
+<li> Fixed: [Debug] Debug Window, Watches Window, Inspector Windows and
+Data Windows now saves not only its current size but also the "unzoomed"
+size.<br>
+<li> Fixed: [Debug] Inspectors can't be closed while "running".<br>
+<li> Added: [Debug] Now when we add a file to the project its path is added
+to the list of paths for sources.<br>
+<li> Added: [Debug] When we add a path to the list of sources paths the path
+is also passed to gdb.<br>
+<li> Added: [Debug] The code to enable MI v2. Currently it only helps
+inspectors making them much faster.<br>
+<li> Added: [Debug] The code to disable the psym search workaround for the bug
+in gdb. It will allow faster startup when the bug is fixed without needing
+to change the editor.<br>
+<li> Added: [Tags] Busy indicator while we load the tags from disk.
+Lamentably only the X11 driver implements it.<br>
+<li> Modified: [Debug] The way "ignore" is interpreted: it means the times
+the breakpoint will be ignored when starting the program or when modifying
+or setting the breakpoint.<br>
+<li> Modified: [Debug] Instead of reporting "OK" as an error now we explain
+the operation can't be performed.<p>
+<b>Revision</b> 1.583 2004/08/20 16:10:53 set<br>
+<li> Added: [WWW] Links to the DOS precompiled snapshots.<br>
+<li> Added: [WWW] Image showing the editor debugging itself.<br>
+<li> Fixed: [RPM] Problems to create the rpms using Fedora Core 2. Patch by
+bbcat.<p>
+<b>Revision</b> 1.582 2004/08/19 18:07:39 set<br>
+<li> Added: [InfView] Its own menu.<br>
+<li> Modified: [InfView] Alt+B and Alt+I shortcuts to avoid menu collisions.<p>
+<b>Revision</b> 1.581 2004/08/18 14:15:42 set<br>
+<li> Fixed: [BC++] Lack of sys/time.h used in debug.cc.<p>
+<b>Revision</b> 1.580 2004/08/18 14:14:47 set<br>
+<li> Fixed: [gcc] Some gcc 3.4.1 requirements:
+1) Default argument values for function pointers no longer allowed.
+2) Missing string header in one of the screen savers.
+3) Passing pointers to packed struct elements no longer supported.
+4) vsync collision with allegro, didn't annoy gcc 2.9x<p>
+<b>Revision</b> 1.579 2004/08/17 15:06:50 set<br>
+<li> Fixed: [config] wrong makeinfo 4.7 detection. Patch by Andrea.<br>
+<li> Fixed: [Debug] missing dummies to compile without debug code.<br>
+<li> Updated: [i18n] spanish translation.<p>
+<b>Revision</b> 1.578 2004/08/16 21:24:50 set<br>
+<li> Fixed+Modified: The "paste" operation for TInputLinePiped views. Now the
+text is pasted without destroying the previous value (unless it is selected).
+The old mechanism was broken when linking to the Unicode branch of TV because
+the way it changed the "data" member was incomplete.<br>
+<li> Added: [Tags] an option to regenerate the central file. Some times ctags
+fails in the generation of incremental files and lets bogus registers. They
+can be very annoying and in this case the best is to just regenerate the
+whole file from scratch.<br>
+<li> Fixed: The list for word completion had a wrong vertical size when we had
+repeated tags in the list to choose. Only one was visible but the size was
+computed counting the repetitions.<br>
+<li> Modified: If the list of items in the word completion list box isn't bigger
+than the list's height we no longer add a useless scroll bar.<br>
+<li> Added: [Debug] Disassembler window!!! a cute one ;-) It have an editor so
+you can see the assembler with syntax highlight. If the information about
+the source code is available it also shows the source code mixed with the
+assembler.<br>
+<li> Added: [Debug] Optional key for the "add with scope" in the Watches Window.<br>
+<li> Modified: DynStrCat* to accept NULL pointer for initialization and take
+const char * arguments.<br>
+<li> Added: Moved the newStrL function from a static place to a public header,
+that's very useful.<br>
+<li> Modified: The way openEditor works when using oedNoSelect flag. It should
+be better but could affect the message window browsing.<p>
+<b>Revision</b> 1.577 2004/08/13 20:49:21 set<br>
+<li> Modified: [Debug] +/- keys in the inspector gives problems when using
+italian keyboards and Linux console. So now + can be replaced by E and -<br>by C (Expand/Collapse). Both work so the user can choose.<br>
+<li> Modified: [Debug] Added more error checking to the inspectors creation.
+A bug in gdb makes it die when evaluating some expressions. So now the code
+checks it and goes to "disconnected" state. It will need much more adjusts
+before a gdb crash doesn't affect the editor.<br>
+<li> Both from Andrea's reports.<p>
+<b>Revision</b> 1.576 2004/08/13 19:01:51 set<br>
+<li> Fixed: [DOC] txt generation details when using makeinfo 4.7. From more
+info provided by Andrea.<p>
+<b>Revision</b> 1.575 2004/08/13 18:10:17 set<br>
+<li> Added: [Debug] Options to configure: gdb binary, xterm binary, main
+function, max. number of lines in debug window, gdb response time
+out and disable gdb banner.<br>
+<li> Added: [Debug] The messages in the debug window are limited in
+number and cleared when a new session is started.<br>
+<li> Added: [Debug] A dialog to ask if we want to wait more when a time
+out in gdb response is detected. Not tested.<p>
+<b>Revision</b> 1.574 2004/08/12 21:07:32 set<br>
+<li> Fixed: [Debug] if we specified a path for sources when gdb wasn't running
+the editor crashed. It was only from the dialog to specify a file.<br>
+<li> Added: The "FindFile" function now also looks for the filename alone. So
+if we look for ./examples/ex3d.c FindFile will try with it and then with
+ex3d.c alone.<br>
+<li> Added: [Debug] frames of the available threads and also selection of
+current thread by default. So it can be used to display current threads.<p>
+<b>Revision</b> 1.573 2004/08/11 21:06:29 set<br>
+<li> Added: [Debug] Select thread option. But this is quite useless. GDB
+doesn't report any info, just the ID and doesn't remove finished threads
+from the list. Which is worst: selecting a finished thread doesn't return
+any error, the message is printed in the console. Yet another bug in gdb.<br>
+<li> Added: [Debug] An option to delete all the breakpoints, watchpoints, etc.<br>
+<li> Added: [Debug] When adding a watchpoint the word under cursor is used as
+starting point.<br>
+<li> Fixed: cmcCutClipWin command not dis/enabled when selecting text.
+Reported by Arnold Wiegert.<p>
+<b>Revision</b> 1.572 2004/08/11 16:30:07 set<br>
+<li> Fixed: [DOC] More makeinfo 4.7 details. From Andrea's feedback.<p>
+<b>Revision</b> 1.571 2004/08/11 15:08:37 set<br>
+<li> Added: [Debug] Persistence to the Data Windows. Of course they need to be
+"recycled".<br>
+<li> Added: [Debug] Shortcuts for "Run/Continue", "Inspectors" and "Calling
+Stack". The first could need to be exchanged with SDG shortcut, not sure.
+The other two are the same used in RHIDE.<p>
+<b>Revision</b> 1.570 2004/08/10 19:56:45 set<br>
+<li> Added: [Debug] A dialog asking for the file location when it couldn't be
+located in the current path for sources. It have a similar behavior to what
+RHIDE does.<br>
+<li> Fixed: [Debug] The "calling stack" command crashed if the functions were
+located at different files.<br>
+<li> Fixed: [Debug] The "calling stack" to add "solved filenames", not the
+names returned by gdb.<br>
+<li> Added: [Debug] The "calling stack" to jump to the "frame 1"<br>
+<li> Fixed: [Debug] When deleting recycled inspectors we deleted the "fake"
+tree twice.<br>
+<li> Added: [Debug] Now the data window disables all its commands when they
+can't be used.<br>
+<li> Fixed: [Debug] In one of the last optimizations in the watches window I
+forgot to redraw the window, so it looked like no item changed until we
+selected it.<br>
+<li> Fixed: Leak in TPrjItemColl::addFile when trying to verify if a file
+existed.<br>
+<li> Fixed: Leak in the TMultiMenuBar when the selected menu wasn't the first
+in the list.<p>
+<b>Revision</b> 1.569 2004/08/09 23:50:42 set<br>
+<li> Modified: [Cosmetic] The multi menu bar to avoid drawing the first menu
+and quickly switch to the default one (the last in the list).<p>
+<b>Revision</b> 1.568 2004/08/09 21:21:43 set<br>
+<li> Fixed: [DOC] @xref in sdg.tx without period.<br>
+<li> Fixed: DOS' end of file in djmdr.s.<br>
+<li> Both from Oswald.<p>
+<b>Revision</b> 1.567 2004/08/09 20:59:24 set<br>
+<li> Added: Context sensitive menues. Also extended the .smn file language to
+create such a thing. Currently used only for the data window.<br>
+<li> Fixed: Problems in the data window when trying to display the ASCII 0.
+Also modified to show the full characters range, not just ASCII range.<br>
+<li> Fixed: Data Window doing 2 reads when created.<p>
+<b>Revision</b> 1.566 2004/08/09 15:14:29 set<br>
+<li> Fixed: [DOC] Problems in the HTML generation using makeinfo 4.7.<br>
+<li> Fixed: [DOC] Problems in the DVI/PS generation (macro name collision).
+Again from info sent by Andrea Mazzoleni (amadvance/users/sourceforge/net).<p>
+<b>Revision</b> 1.565 2004/08/09 12:54:47 set<br>
+<li>** Data Window stuff:<br>
+<li>** Related to the new code<br>
+<li> Fixed: isValidUL not working.<br>
+<li> Fixed: No input box when starting from a value from the "word under
+cursor"<br>
+<li> Added: Implemented the memory write.<br>
+<li> Added: Error message to indicate a memory location can't be accessed when
+validating it. No silent fail.<br>
+<li> Added: Stack Window.<br>
+<li> Added: TDskWin wrapper.<br>
+<li> Added: Update when debuggy stops.<br>
+<li> Modified: EnterAddresses to show input lines without separation.<br>
+<li>** Also related to the original code<br>
+<li> Fixed: The FIXMEs about using smaller blocks.<br>
+<li> Fixed: Buffer to hold selected file name wasn't as long as PATH_MAX
+(SIGSEGV).<br>
+<li> Fixed: Lack of update after reading from a file.<br>
+<li> Fixed: Creation of empty files if the from or length was wrong.<br>
+<li> Fixed: When debugging two programs with different endian types without
+exiting the code taked only the first. Now it should work, but is hard to
+check ;-)<br>
+<li> Fixed: The stack window first detects the target architecture, if it
+isn't x86 gives an error.<br>
+<li> Fixed: Wrong color and frame of the indicator when the window wasn't
+selected.<br>
+<li> Added: ESC closes the window.<br>
+<li> Added: An attribute to show memory changes, that's really nice because
+you can see what changed in each program step very quickly.<br>
+<li> Modified: When updating the memory modified cells are now reset to "not
+edited"<br>
+<li> Modified: Removed %#lx in favor of 0x%lx, I think that's more portable.
+I encapsulated most of these printfs in one member.<br>
+<li> Modified: All the stuff about a linked list of windows, now they update
+itself using the broadcast that indicates the debugger changed its state.
+I keep a counter of windows to avoid sending a broadcast to nobody ;-)<p>
+<b>Revision</b> 1.564 2004/08/06 21:10:36 set<br>
+<li> Added: A first part of the Molnar Laszlo's "Data Window v0.1" that he
+contributed to RHIDE. A lot of things must be solved because things are
+quite different when you can directly access the debuggy memory :-(<br>
+<li> Fixed: A couple of leaks that happened when closing a project and loading
+another. Reported by Valgrind while debugging the "Data Window" stuff.<br>
+<li> Note: The debugging stuff is quite functional, Inspectors are great for
+complex structures like trees. But the whole thing isn't stable, more
+adjusts are needed.<p>
+<b>Revision</b> 1.563 2004/08/05 19:26:28 set<br>
+<li> Fixed(?): [DOC] The complement part of the "@end menu" makeinfo 4.7
+problem. This time for the @itemize.<br>
+<li> Fixed: [DOC] newer versions of the TeX package defines "html" macro which
+collides with the one in rhidemac.*.<br>
+<li> Added: [DOC] SDH command line option to avoid numbering chapters. It
+looks like makeinfo 4.7 does it by itself (and by default!).
+From info sent by Andrea Mazzoleni (amadvance/users/sourceforge/net).<p>
+<b>Revision</b> 1.562 2004/08/05 18:14:21 set<br>
+<li> Modified: [sLisp] CommentIndent macro, enhanced version from Thiago.<p>
+<b>Revision</b> 1.561 2004/08/04 20:09:47 set<br>
+<li> Added: Inspectors!!! They are quite different to the RHIDE inspectors.
+They are suitable for complex structures and you can have various in the
+desktop.<p>
+<b>Revision</b> 1.560 2004/08/02 15:23:03 set<br>
+<li> Fixed: makeinfo 4.7 enforces the use of @pxref for (@x{...}).<br>
+<li> Fixed(?): makeinfo 4.7 no longer supports "@end xxxx" commands inside
+macros :-( so I added an aditional intermediate file to avoid them.<p>
+<b>Revision</b> 1.559 2004/08/02 13:22:41 set<br>
+<li> Added: [sLisp] CommentIndent macro contributed by Thiago.<p>
+<b>Revision</b> 1.558 2004/08/02 12:50:45 set<br>
+<li> Added: Watchpoints!!!! now we can easily hunt wild writes ;-)<br>
+<li> Modified: The breakpoints are moved only if the target changed its time
+stamp.<br>
+<li> Added: i18n to the debug dialogs.<br>
+<li> Fixed: i18n of the project window title.<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.557 2004/08/02 12:44:28 set<br>
+<li> Fixed: When going step by step and the "match pair on the fly" was
+enabled the code to restore the highlighted pairs did a mess with the
+background color if the pair involved a "CPU line".<br>
+<li> Added: After using "Run a program" the editor updates the moved
+breakpoints. Also an option to disable it. Note: That's what made me create
+the splines, lamentably Robert never used them for RHIDE.<br>
+<li> Added: A beep when "Run a program" finishes. Option to disable.<br>
+<li> Added: Close the debug session before running the external program. An
+option to disable it. That's needed for OSs where we can't overwrite opened
+files and is also needed to woraround gdb bugs.<br>
+<li> Added: Option to ask for confirmation if the "Run program" will kill the
+current debug session.<br>
+<li> Added: [sLisp] edfRunStopDebug option to RunProgram.<p>
+<b>Revision</b> 1.556 2004/07/30 21:10:17 set<br>
+<li> Modified: Now the cmc*Win (Copy,Cut,Paste) commands are called cmc*OS to
+reflect their real use. The old names remains as aliases. From a suggestion
+by Thiago.<br>
+<li> Added: Ins,Del,+,- shortcuts in the status line for the breakpoints
+dialog.<br>
+<li> Added: [sLisp] new command GetSystemInfo to know the current OS, TV
+driver, CPU, etc. From a suggestion by Thiago.<br>
+<li> Updated: docs, not yet the debug stuff.<br>
+<li> Fixed: Error in the SpLines search that made funny things when trying to
+toggle a breakpoint (introduced during the structure change).<br>
+<li> Added: The dialog to add a "watch" now is piped to an editor and the word
+under cursor is used. It also have a history (shared with evaluate).<br>
+<li> Added: A history to the dialog to send gdb commands.<br>
+<li> Modified: The "CPU line" is centered only if we jumped to another source.
+It is less annoying.<br>
+<li> Added: The conditionals in menu files can use the TV driver, CPU, OS,
+etc. for conditions. From a suggestion by Thiago.<br>
+<li> Added: $define and $undef and its expansion in menu files. From a
+suggestion by Thiago.<br>
+<li> Fixed: The commands to select the watches and debug window are
+independent of the debugger state.<p>
+<b>Revision</b> 1.555 2004/07/29 20:33:37 set<br>
+<li> Added: The edit breakpoint dialog now disables the unneeded options. So
+if you will specify the location using file:line then you can't say the
+function or address.<p>
+<b>Revision</b> 1.554 2004/07/28 21:03:23 set<br>
+<li> Added: The second part of the "Breakpoints" dialog. Now is possible to
+add, modify, remove, enable, disable and jump to breakpoit locations. Some
+details remains to be adjusted and is lightly tested.<br>
+<li> Fixed: A leak in SpLines, the new structures needs atFree and not just
+atRemove, found using valgrind, debugged using the editor. Note: gdb is
+quite bad and is sooooo buggy, now that I'm using it from the editor I can
+verify when the problem is in gdb and that's too common :-(<p>
+<b>Revision</b> 1.553 2004/07/26 20:36:03 set<br>
+<li> Modified: Now breakpoints and frames are searched in the "path for
+sources" and not only in the binary reference.<br>
+<li> Modified: "Go To Line" now passes the full qualified name of the file to
+gdb. With both changes I debugged "rhgdb".<p>
+<b>Revision</b> 1.552 2004/07/26 16:06:40 set<br>
+<li> Modified: [MSVC] The WinNT/configed.h header to report "MSC" as compiler
+for MS compiler. Suggested by Arnold.<br>
+<li> Updated: Copyright year in main about box. Suggested by Arnold.<p>
+<b>Revision</b> 1.551 2004/07/26 15:35:37 set<br>
+<li> Modified: Once again makeinfo breaks something. This time makeinfo 4.6
+doesn't like:
+@item xxxx @il{xxxx
+yyyy}
+The @il must end in the same line or makeinfo gets confused.<p>
+<b>Revision</b> 1.550 2004/07/26 15:09:15 set<br>
+<li> Added: The first part of the "Breakpoints" dialog. Currently you can
+just see the breakpoint.<br>
+<li> Fixed: SpLineGetOldValueOf to match not only the position but also the
+spline id.<br>
+<li> Fixed: All the TCEditor::SetSpecialLines logic because it was wrong and
+it needed adjustments to the new structures.<br>
+<li> Modified: Moved all the breakpoint operations to a class so we can use
+it for a dialog.<p>
+<b>Revision</b> 1.549 2004/07/26 15:04:10 set<br>
+<li> Updated: Spanish translation.<br>
+<li> Fixed(?): The last modification to the special lines stuff had a major
+flaw. If we keep a copy in the TCEditor then is quite hard to know which
+lines were moved. I changed the insternal structures used by SpLinMan to
+solve it. The code changed too much to be considered stable.<br>
+<li> Modified: The internac/Makefile to update the translations every time a
+source that have strings to translate is modified. This will increase cvs
+traffic but will reduce collisions.<p>
+<b>Revision</b> 1.548 2004/07/23 21:22:31 set<br>
+<li> Fixed: [MSVC] The set_new_handler() function of MSVC 4.0 doesn't support
+NULL. It is possible to use _set_new_handler(), but as it is only tested
+for gcc I'm disabling this code for other compilers. From a report by
+Arnold. Note: with it Arnold compiled the editor for MSVC 4.0.<p>
+<b>Revision</b> 1.547 2004/07/23 20:53:22 set<br>
+<li> Added: Configuration options to disable the calculator and calendar.
+Suggested by Oswald.<br>
+<li> Modified: Optimized cmcMoveBlock. Suggested by Oswald. Consider it
+unstable.<br>
+<li> Modified: The meassure commanand to report the result in the status line.
+Suggested by Oswald.<br>
+<li> Modified: The insertBuffer member to support some copies from the same
+buffer.<br>
+<li> Fixed: Leak in tags code. Reported by valgrind.<br>
+<li> Added: Options to zoom the editor windows when inserted in the desktop.
+Suggested by Oswald.<br>
+<li> Fixed: Bug in stack position. Forgot to unlink the returned objects.<p>
+<b>Revision</b> 1.546 2004/07/23 13:00:50 set<br>
+<li> Fixed: [MSVC] Wrong prototype of LoadFileUnderCursor in ced_inte.h. Only
+reported by MSVC 4.0. From a report by Arnold.<p>
+<b>Revision</b> 1.545 2004/07/22 00:59:15 set<br>
+<li> Added: When using the tag search if we find a perfect match now we jump
+directly to the tag. Suggested by Thiago.<br>
+<li> Added: Two new commands: cmeGPushCursorPos and cmeGPopCursorPos. They are
+"global push/pop cursor pos". So they also remmember the file. They help to
+implement a "tag stack". From what Thiago suggested.<br>
+<li> Added: Before jumping to a tag the editor does a cmeGPushCursorPos.<p>
+<b>Revision</b> 1.544 2004/07/21 19:59:04 set<br>
+<li> Fixed: When deleting a breakpoint the editor could hang if the breakpoint
+couldn't be found.<br>
+<li> Added: Now if the program to debug (the copy with debug info) is in a
+directory other than the current one this directory becomes the reference
+for filenames. It allowed me to debug SETEdit from SETEdit and using the
+setedit.epr file which is in "../" from the point of view of the binary.<p>
+<b>Revision</b> 1.543 2004/07/20 20:45:00 set<br>
+<li> Added: Now we can attach to running processes. Nice, but it expossed more
+gdb bugs :-(<p>
+<b>Revision</b> 1.542 2004/07/20 19:33:17 set<br>
+<li> Fixed: Added dummies to allow compilation when libmigdb isn't installed.<p>
+<b>Revision</b> 1.541 2004/07/20 16:27:09 set<br>
+<li> Added: The first part of the code to support debugging using libmigdb.<br>
+<li> Synchronized some CVS details with my home CVS.<br>
+<li> Version 0.5.4 (Glaciar P.Moreno I)<p>
+<b>Revision</b> 1.540 2004/07/19 20:02:00 set<br>
+<li> Fixed: [Debian] Applied patch S.F. #993014 submitted by Baurjan Ismagulov
+(ibr): "Add an include file required by rhide".<p>
+<b>Revision</b> 1.539 2004/07/19 19:53:20 set<br>
+<li> Fixed: [config] --cxx-flags flag was reported as --cpp-flags in the help.
+Now both are valid. Reported by Ullal Devappa Kini (wmbfqj/vsnl/net).<br>
+<li> Fixed: [Win32] Cygwin can execute the "make install" target, but it
+installed binaries without .exe extension. That's quite annoying for Win32.
+I added a "--keep-extension" option to avoid it, isn't tested. Reported by
+Ullal Devappa Kini (wmbfqj/vsnl/net).<p>
+<b>Revision</b> 1.538 2004/06/29 14:27:11 set<br>
+<li> Fixed: [MSVC] The char */*name*/ sequence confused the compiler. Reported
+by Arnold.<p>
+<b>Revision</b> 1.537 2004/06/28 17:57:49 set<br>
+<li> Fixed: Corrupted MP3 files could produce a crash. It closes SF Bug
+#932091 reported by silverdirk, he sent me a file to reproduce the problem.<p>
+<b>Revision</b> 1.536 2004/06/28 17:56:48 set<br>
+<li> Fixed: The menu files uses nested preprocessor directives but it wasn't
+supported.<p>
+<b>Revision</b> 1.535 2004/06/28 17:56:07 set<br>
+<li> Fixed: [BC++] 5.5 can't really remove unreachable code. That's another
+evidence of the poor quality of Borland compilers in terms of optimization.<p>
+<b>Revision</b> 1.534 2004/06/28 17:55:02 set<br>
+<li> Fixed: Missing CleanUpHolidays() for targets that doesn't support dlopen.
+Additionaly I modified the code to use if (xxxx) instead of plain
+preprocessor.<br>
+<li> Fixed: [djgpp] Problems in calcu.cc because of unconditional definition
+of NULL in locale.h.<p>
+<b>Revision</b> 1.533 2004/06/25 19:46:21 set<br>
+<li> Fixed: SUP_PCRE could be redefined :-(, added protection.<p>
+<b>Revision</b> 1.532 2004/06/25 18:28:08 set<br>
+<li> Added: [sLisp] A new command called "prex" to perform Perl regular
+expressions searches. It is documented and I also added an example to
+macros.slp, it calls wc and shows the results in the status line.<br>
+<li> Modified: The SUP_PCRE macro to be 0 or 1 instead of un/defined. This
+could generate compilation problems for platforms where PCRE isn't
+supported, but the code is more clear now.<p>
+<b>Revision</b> 1.531 2004/06/23 20:10:00 set<br>
+<li> Fixed: Assignment of Boolean from int.<br>
+<li> Fixed: Use of bool type (instead of int or Boolean).<br>
+<li> Modified: "new" header inclusion to be selected by compatlayer.
+All from Arnold Wiegert information.<p>
+<b>Revision</b> 1.530 2004/06/23 19:33:21 set<br>
+<li> Modified: [MSVC] Use of /Tp<file> instead of /TP in makefiles. It looks
+like MSVC 4.0 only supports it. Reported by by Arnold Wiegert.<br>
+<li> Fixed: Leaks in TCEditWindow (intl stuff), List of windows and
+loadnobkp.cc. valgrind.<br>
+<li> Fixed: "New" buffers shouldn't be added to the list of closed windows
+when closed. It generated a read out of bounds and a write of unitialized
+data to disk. valgrind.<p>
+<b>Revision</b> 1.529 2004/06/22 20:34:12 set<br>
+<li> Fixed: [MSVC] References to make in the nmake files. Report and solution
+by Arnold Wiegert.<br>
+<li> Modified: [Makefiles] extrimk to generate the first dependency with
+relative path. I should allow .umk files to be used without the need of
+"vpath" or ".path" directives. That's because nmake lacks both directives.<p>
+<b>Revision</b> 1.528 2004/06/22 16:30:43 set<br>
+<li> Added: [sLisp] More macros from Thiago. They are short and quite
+interesting because they show how to add particular behaviors or
+funtionalities with small code.<p>
+<b>Revision</b> 1.527 2004/06/22 16:01:24 set<br>
+<li> Fixed: [Cosmetic] Added a ; after the ListBoxImplement(..) macros. They
+looks more "correct" and doesn't confuse my heuristic to search fro
+functions ;-)<p>
+<b>Revision</b> 1.526 2004/06/22 15:11:58 set<br>
+<li> Added: [sLisp] Experimental!!! now you can use cme* commands for
+SendCommands. They are propperly sent to the application instead of the
+current editor.<p>
+<b>Revision</b> 1.525 2004/06/18 14:21:19 set<br>
+<li> Fixed: Some details in the heuristic C++ functions searcher. They address
+problems with the const and throw() attributes.<br>
+<li> Modified: The program that extracts dependencies from the RHIDE's .mak
+files to avoid putting the creation date (I don't remmember why I needed it
+and it generates extra CVS traffic) and to sort dependencies (also reduces
+CVS traffic).<p>
+<b>Revision</b> 1.524 2004/06/17 16:50:32 set<br>
+<li> Added: Missing desktop examples. Reported as bug #974095 @ SF by Ognyan
+Kulev (ogi).<p>
+<b>Revision</b> 1.523 2004/06/14 16:40:42 set<br>- From valgrind<br>
+<li> Added: Holidays clean-up.<br>
+<li> Fixed: Memory leak in special lines.<br>
+<li> Fixed: malloc/delete missmatch in grep interface.<p>
+<b>Revision</b> 1.522 2004/06/14 14:39:20 set<br>
+<li> Added: now extrimk.cc can also solve vpath sources.<br>
+<li> Modified: valgrind command line script to report up-to 40 functions in
+the calling stack.<br>- From valgrind:<br>
+<li> Added: librhuti io and Special Lines clean-up at exit.<br>
+<li> Fixed: new[]/delete missmatches related to WordUnderCursor, errors
+parser, pathtool, special lines and Tips.<p>
+<b>Revision</b> 1.521 2004/06/14 14:34:15 set<br>- From valgrind:<br>
+<li> Fixed: duplicated keywords in syntaxhl.shl file. Additionaly now it
+doesn't leak memory.<br>
+<li> Added: PathList* clean-up.<p>
+<b>Revision</b> 1.520 2004/06/11 21:20:56 set<br>
+<li> Added: Messages in BC++ and MSVC makefiles instructing to try the new
+mechanism.<br>
+<li> Fixed: Warnings in holydays code now compiled with -Wall.<br>- From valgrind<br>
+<li> Fixed: Leak in TSetEditorApp::preLoadDesktop.<br>
+<li> Fixed: Ruby highlight lack of End.<br>
+<li> Fixed: new/delete[] missmatches in TInfIndex::TInfIndex and
+TFileEntryCollection::freeItem.<br>
+<li> Fixed: SIGKILL mask.<br>
+<li> Fixed: Potential portability problems with memcpy.<p>
+<b>Revision</b> 1.519 2004/06/09 15:40:42 set<br>
+<li> Modified: Removed from CVS various files that are generated by configure
+script. They are included in distribution but people using CVS must run
+the configure script.<p>
+<b>Revision</b> 1.518 2004/06/09 15:08:33 set<br>
+<li> Fixed: internac/gnumake.in didn't define CXX and instead replaced the
+two points where it was used. Suggested by Oswald.<br>
+<li> Added: libbzip2, libpcre and libz. Now have configurable makefiles.<br>
+<li> Modified: Now WinNT/Makefile* files are updated only in maintainer mode.<p>
+<b>Revision</b> 1.517 2004/06/09 12:29:40 set<br>
+<li> Fixed: [BC++] Wrong references to rhtv.lib instead of librhtv.lib.
+Reported by Arnold Wiegert (awiegert/telus/net).<p>
+<b>Revision</b> 1.516 2004/06/08 13:21:06 set<br>
+<li> Modified: [Debian] Applied patch #968507 S.F. submitted by Baurjan
+Ismagulov - ibr. Removes extra clean-up.<p>
+<b>Revision</b> 1.515 2004/06/04 19:19:58 set<br>
+<li> Fixed: Another strchr call.<p>
+<b>Revision</b> 1.514 2004/06/04 13:27:22 set<br>
+<li> Added: A small script to meassure the number of lines of code. Currently
+over than 108,000. It skips third party libs.<br>
+<li> Fixed: strstr and strchr are declared different in C++ standard. BC++
+does it (not gcc 2.95.4) and it generated compilation errors when using
+BC++. Reported by Arnold Wiegert.<p>
+<b>Revision</b> 1.513 2004/06/02 19:57:43 set<br>
+<li> Added: [SHL] vbe and vst as VHDL extensions. Used by Alliance for "Vhdl
+BEhavioral" and "Vhdl STructural". Suggested by Juan Pablo.<p>
+<b>Revision</b> 1.512 2004/05/31 14:09:22 set<br>
+<li> Modified: [Debian] Applied patch #962884 S.F. submitted by Baurjan
+Ismagulov - ibr. Related to the libset package. It needs some adjustments.<p>
+<b>Revision</b> 1.511 2004/05/31 13:44:16 set<br>
+<li> Added: OS/OS flavor,CPU,Compiler/Compiler flavor and Driver to the about
+box. Suggested by Arnold Wiegert (awiegert/telus/net)<br>
+<li> Added: C,H and CPP as valid C extensions for syntax highlight. C is the
+C++ extension for gcc and the others are for non-casesensitive OSs.<p>
+<b>Revision</b> 1.510 2004/05/24 14:38:27 set<br>
+<li> Modified: [config] Use of "g++" in favor of "gcc -lstdc++". This is
+because newer gcc 3.x compilers can't compile C++ code without doing a
+mess when we use the gcc frontend. From a report by Baurjan Ismagulov - ibr<p>
+<b>Revision</b> 1.509 2004/05/24 13:40:41 set<br>
+<li> Added: Applied patch #959018 Add libset-dev Debian package. Submitted by
+Baurjan Ismagulov - ibr (S.F.). It needs some adjustments but can be used.<p>
+<b>Revision</b> 1.508 2004/05/21 16:16:19 set<br>
+<li> Fixed: The heuristic C/C++ parser to support list of exceptions
+(function throw(...) {body}).<p>
+<b>Revision</b> 1.507 2004/05/17 14:06:40 set<br>
+<li> Fixed: Missing va_end and abuse of va_list type. It looks like the newer
+PPC's glibc implements things in a way that va_list variables can't be
+assigned to other va_list variables. Reported by MDaniel.<p>
+<b>Revision</b> 1.506 2004/05/12 14:21:25 set<br>
+<li> Modified: For the last changes to the TButton class.<p>
+<b>Revision</b> 1.505 2004/05/07 20:07:31 set<br>
+<li> Fixed: A couple of calls to memcpy to use CLY_memcpy. Reported by
+valgrind.<br>
+<li> Added: Avoid a no-op copy reported by Oswald.<br>
+<li> Fixed: Use of unitialized undo counter in some rectangular selection
+operations. Reported by valgrind.<p>
+<b>Revision</b> 1.504 2004/05/06 19:33:09 set<br>
+<li> Fixed: Some malloc/new/new[] v.s. free/delete/delete[] calls. Reported
+by Oswald using valgrind.<br>
+<li> Fixed: memcpy shouldn't be used if blocks overlaps, no matters the
+copying direction. That's a portability issue. Reported by Oswald using
+valgrind.<br>
+<li> Fixed: Undo count for the first undo wasn't initialized. Very dangerous.
+Reported by Oswald using valgrind.<br>
+<li> Fixed: Some drawing variables not initialized. Could make the row/col
+cursor appear until a new redraw. Reported by Oswald using valgrind.<p>
+<b>Revision</b> 1.503 2004/05/05 19:09:08 set<br>
+<li> Fixed: When copying something from the calculator and the paste wasn't
+enabled before entering the calculator then you needed to at least move the
+cursor before you could paste. Now the Paste status is updated without
+needing any extra action.<p>
+<b>Revision</b> 1.502 2004/04/22 19:09:28 set<br>
+<li> Fixed: [tools] Problems when applying patches from branches that uses new
+files and cvs marks them as from Attic.<p>
+<b>Revision</b> 1.501 2004/04/19 20:45:55 set<br>
+<li> Added: Code needed to test with the AlCon branch.<p>
+<b>Revision</b> 1.500 2004/04/13 18:21:44 set<br>
+<li> Added: [SHL] Syntax and pmacros for WML, contributed by Diego J. Brengi.<p>
+<b>Revision</b> 1.499 2004/04/12 13:17:13 set<br>
+<li> Fixed: [Holydays] bug in movement and fixed april 2 movement in
+argentinian holydays.<p>
+<b>Revision</b> 1.498 2004/04/06 19:10:48 set<br>
+<li> Fixed: Problems with some texinfo versions reported by Cosmin T. (ctruta\
+hotmail\com).<p>
+<b>Revision</b> 1.497 2004/03/30 14:54:36 set<br>
+<li> Added: Information about how to install the Red Hat 7.3 RPMs in Fedora
+Core 1. Contributed by Rohan Carly.<p>
+<b>Revision</b> 1.496 2004/03/25 20:11:29 set<br>
+<li> Added: Non interactive versions of the cmcExpandAllTabs and
+cmcCompactBuffer commands to be used from sLisp. Suggested by Grzegorz.<p>
+<b>Revision</b> 1.495 2004/03/17 20:50:23 set<br>
+<li> Updated: [SHL] Flat Assembler, contributed by Matt C.<p>
+<b>Revision</b> 1.494 2004/03/03 14:55:48 set<br>
+<li> Modified: [SHL] Flat Assembler definition. Patch by Matt.<p>
+<b>Revision</b> 1.493 2004/02/23 14:38:41 set<br>
+<li> Fixed: [DOCs] the ctags --field switch because makeinfo needs ---field.
+Reported by Grzegorz.<p>
+<b>Revision</b> 1.492 2004/02/02 16:13:50 set<br>
+<li> Added: [WWW] A note about Red Hat RPMs, a user (Jan Cnops) reported that
+the Red Hat 7.3 packages (newer than the Red Hat 8.0 packages) install OK
+on Red Hat 9.0 systems.<p>
+<b>Revision</b> 1.491 2004/02/02 14:52:50 set<br>
+<li> Added: [WWW] SuSE 9.0 release by bbcat.<p>
+<b>Revision</b> 1.490 2004/01/13 14:23:02 set<br>
+<li> Modified: [WWW] The page to be more clear about how to try the Win32
+version. Suggested by Philippe Baucour.<p>
+<b>Revision</b> 1.489 2004/01/06 15:54:37 set<br>
+<li> Fixed: [DOCs] the "strxlt" example said "sstr". Reported by Dominik
+Grzelak.<p>
+<b>Revision</b> 1.488 2004/01/06 15:42:01 set<br>
+<li> Updated: Flat Assembler syntax highlight. Contributed by Matt Childress.<p>
+<b>Revision</b> 1.487 2003/12/15 21:21:43 set<br>
+<li> Fixed: [RPM] The prereq seems to be /sbin/install-info and not
+/usr/bin/... At least that's what most specs found by Google shows ;-)
+I also added install and delete for the info files.<p>
+<b>Revision</b> 1.486 2003/12/15 14:59:16 set<br>
+<li> Fixed: When pasting using the OS clipboard and the cursor was moved to
+the end of the selection it could go out of screen which is quite annoying.<p>
+<b>Revision</b> 1.485 2003/12/15 14:58:36 set<br>
+<li> Fixed: A couple of details about the last option and when is greyed.<p>
+<b>Revision</b> 1.484 2003/12/15 14:56:46 set<br>
+<li> Fixed: Some int v.s. unsigned details related to the last patch.<br>
+<li> Modified: cmcSaveAsUNIX and cmcSaveAsDOS commands to be
+cmcSaveAsConvertEOL which is more clear.<br>
+<li> Added: A new command cmcSaveAsNoConvertEOL used to avoid automatic
+conversions when they are enabled. From a suggestion by Oswald.<p>
+<b>Revision</b> 1.483 2003/12/11 19:54:37 set<br>
+<li> Fixed: Compilation problems with gcc 3.x. Patch from Oswald:
+ - Missing \n at end of palbcc.h
+ - Missing explicit parent constructor call in mp3/ampdiag.cc
+ - Constant out of range in include/ced_exte.h (I also modified
+ edconst.cc accordingly)<p>
+<b>Revision</b> 1.482 2003/12/09 19:24:32 set<br>
+<li> Modified: The 'Compile' macro example. It was contributed by Thiago and
+now he added an example on how to choose the compiler according to the
+syntax.<p>
+<b>Revision</b> 1.481 2003/12/09 18:28:08 set<br>
+<li> Added: Errors parser for Perl. Contributed by Thiago.<p>
+<b>Revision</b> 1.480 2003/12/09 16:48:51 set<br>
+<li> Fixed: When aborting an overwrite (in save as) the name of the window
+was changed anyway :-P<p>
+<b>Revision</b> 1.479 2003/12/09 16:09:31 set<br>
+<li> Fixed: The new code needed a conditional to avoid ridiculous small sizes.<p>
+<b>Revision</b> 1.478 2003/12/09 16:07:51 set<br>
+<li> Added: "File open" dialogs remmembers its size and position. Each kind of
+dialog have its own values, so open and save as are independent. I know it
+could confuse some people but it allows better customization. From a
+suggestion by gradha.<p>
+<b>Revision</b> 1.477 2003/12/09 16:06:30 set<br>
+<li> Added: Most lists (like functions list) now centers the focused item when
+a match is selected. Suggested by gradha.<p>
+<b>Revision</b> 1.476 2003/12/03 14:44:21 set<br>
+<li> Fixed: Missing wrapper for RHIDE's version of FindFile. Reported by Kevin
+Alm.<p>
+<b>Revision</b> 1.475 2003/12/03 14:19:54 set<br>
+<li> Fixed: Removed two comments containing non-ASCII chars. It seems to annoy
+gcc 3.3.1 according to a report by Kevin Alm.<p>
+<b>Revision</b> 1.474 2003/11/24 15:54:29 set<br>
+<li> Added: A button to recompute window numbers in the list of windows.
+Suggested bt Grzegorz.<br>
+<li> Updated: The spanish traslation.<br>
+<li> Added: Documentation for the last "File under cursor" additions and the
+list of windows addition.<p>
+<b>Revision</b> 1.473 2003/11/24 15:48:19 set<br>
+<li> Added: Some rudimentary $(VARIABLE) expansion to the "File under cursor"
+files list. Suggested by Grzegorz.<br>
+<li> Added: To also search in the same directory where a file is located when
+using the "File under cursor" stuff. Suggested by Grzegorz.<p>
+<b>Revision</b> 1.472 2003/11/24 15:47:10 set<br>
+<li> Added: AltKeysSetting TV config keyword.<p>
+<b>Revision</b> 1.471 2003/11/24 15:44:19 set<br>
+<li> Fixed: Some gcc versions needs explicit use of libstdc++ to link C++ and
+intenac/getcolors didn't have it. Reported by Michel Catudal (bbcat).<p>
+<b>Revision</b> 1.470 2003/11/18 14:30:19 set<br>
+<li> Added: More cases to the code that detects "Emacs comments" at the end of
+the file. From information provided by Grzegorz.<p>
+<b>Revision</b> 1.469 2003/11/17 16:10:39 set<br>
+<li> Added: Now if you don't specify any path to "search files under cursor"
+the editor tries to automagically fills this list using the output of cpp.
+From a suggestion by Oswald.<br>
+<li> Added: If the Ctrl+Enter fails to find the file under cursor now that's
+informed in the "status line" of the current editor. Suggested by Oswald.<br>
+<li> Added: If the editor fails to find the file under cursor now it also
+looks for it in the project. From a suggestion by Oswald.<p>
+<b>Revision</b> 1.468 2003/11/17 16:09:45 set<br>
+<li> Fixed: When starting a project using a different window size the project
+window could get wrong size and even become outside the screen. Reported
+by Oswald.<p>
+<b>Revision</b> 1.467 2003/11/17 16:08:05 set<br>
+<li> Added: The posibility to override the "install" command in makefiles.
+Suggested by Oswald.<p>
+<b>Revision</b> 1.466 2003/11/12 15:03:36 set<br>
+<li> Added: More "intelligence" behind the "Paste Emacs Mode", now it only
+takes as valid entries that defines the "mode" variable.<br>
+<li> Modified: The position of "Emacs mode" insertion is now the same of a
+previous definition. Both things comes from a talk with Grzegorz.<p>
+<b>Revision</b> 1.465 2003/11/12 14:07:01 set<br>
+<li> Added: Looks like the "Emacs Mode" comments can appear more than once in
+the same file defining different variables. Now when the editor looks for
+it doesn't stop in the first match. Note that it doesn't affect the
+behavior on the "Paste Emacs Mode" which only searchs for the first
+occurrence. From a report by Grzegorz.<p>
+<b>Revision</b> 1.464 2003/11/05 18:51:11 set<br>
+<li> Fixed: I forgot that global options also mentioned "purge spaces".
+Pointed out by Oswald.<p>
+<b>Revision</b> 1.463 2003/11/03 16:19:53 set<br>
+<li> Added: When "TScreen::avoidMoire" is enabled selected tabs uses '.' to
+indicate they are selected. From a suggestion by Oswald.<p>
+<b>Revision</b> 1.462 2003/11/03 16:17:46 set<br>
+<li> Added: A new color scheme called "Midnight Commander" contributed by
+Oswald.<p>
+<b>Revision</b> 1.461 2003/11/03 16:15:52 set<br>
+<li> Added: A new color scheme called "Classic Borland" contributed by Oswald.<p>
+<b>Revision</b> 1.460 2003/10/28 21:09:42 set<br>
+<li> Added: When asking for word completion if the word at the left looks like
+Class:: then the editor looks for the class and offers the members.
+Suggested by Ivan.<p>
+<b>Revision</b> 1.459 2003/10/22 19:45:30 set<br>
+<li> Fixed: When searching outside comments and the match was found in the
+first column of a line after a comment it was ignored. Reported by Alain.<p>
+<b>Revision</b> 1.458 2003/10/20 15:33:02 set<br>
+<li> Fixed: While locking the editor in the S&R y did it wrong and the S&R
+confirmation didn't move to the correct coordinate.<p>
+<b>Revision</b> 1.457 2003/10/20 15:32:12 set<br>
+<li> Added: Now sLisp can replace things like ^K key binding even when it
+implies removing all the ^K-x assignments. It allows a complete
+replacement.<p>
+<b>Revision</b> 1.456 2003/10/20 15:31:16 set<br>
+<li> Modified: "Do not purge spaces" option to be "Keep trailing whitespace"
+that's more descriptive. Suggested by Oswald.<br>
+<li> Fixed: No match pair after deleting some text and the cursor goes to a
+symbol. Reported by Oswald.<br>
+<li> Modified: To lock the screen while doing a search & replace operation to
+avoid "flashing" when doing a lot of S&R operations. Suggested by Oswald.<br>
+<li> Fixed: Wrong match pair when the cursor was in the middle of a tab and
+the next character matched a pair (highlight in the middle of the tab).
+Reported by Oswald.<br>
+<li> Fixed: Undo error when a character replaced a tab (overwrite enabled) and
+the cursor was inside the tab (not at the beggining). Reported by Oswald.<br>
+<li> Added: History to the "arbitrary indent" and "run command" input lines.
+Suggested by Oswald.<p>
+<b>Revision</b> 1.455 2003/10/16 20:02:35 set<br>
+<li> Fixed: [Cygwin] Collision between strndup and calculator parser.
+Personally don't know mush about this issue but looks like a name space
+pollution in Cygwin.<p>
+<b>Revision</b> 1.454 2003/10/16 19:42:47 set<br>
+<li> Modified: To select the closest word when using double click and not the
+next. Suggested by Alain.<p>
+<b>Revision</b> 1.453 2003/10/16 19:41:54 set<br>
+<li> Fixed: A code page problem. A little bit complex to describe: If you
+started the editor for the first time in a Linux console and forced the
+encoding to "Latin 1u" (improperly configured system IMHO). Then you
+acessed remotly to this system using XTerm you got a messed code page and
+no way to fix it. This is because the editor tried to use Linux console
+settings but as XTerm can't change its code page you have no way to disable
+the "forced" check box for the screen code page. Now the editor avoids it.<p>
+<b>Revision</b> 1.452 2003/10/16 19:40:54 set<br>
+<li> Fixed: The "Jump" button in the main window of the class browser produced
+SIGSEGVs. I went too far reusing code ;-). Reported by Ivan.<p>
+<b>Revision</b> 1.451 2003/10/16 19:39:10 set<br>
+<li> Added: Some clarification in the docs about the meaning of the maximum
+number of R.O. copies.<br>
+<li> Added: Now when the message window (and other sources) request to open
+a file that is part of the project it is opened using the relative path
+and not an absolute path. It annoyed me for a long time and Oswald insisted
+on it ;-)<p>
+<b>Revision</b> 1.450 2003/10/16 19:38:02 set<br>
+<li> Added: Project windows are "closed" (hided) when pressing ESC. Suggested
+by Oswald Budden.<br>
+<li> Added: When opening new windows usually the editor checks if a project is
+opened, in this case windows aren't zoomed. Now if the project window isn't
+visible they are also zoomed, after all they weren't zoomed to avoid
+hidding the project window. Suggested by Oswald Budden.<p>
+<b>Revision</b> 1.449 2003/10/16 19:35:20 set<br>
+<li> Added: [sLisp] KeyBindings and BindKey commands. With them you can change
+key bindings from sLisp.<br>
+<li> Fixed: Errors in the conditionals parser for menu files.<br>
+<li> Added: More variables to check in menu files: MP3, PCRE, BZIP2, MIXER and
+UNIX. Suggested by Oswald.<br>
+<li> Added: A new chapter to the docs: Documentation guide. It can be used to
+find other chapters and sections according to the topic they are related
+to.<br>
+<li> Added: A new chapter to the docs: Menues configuration.<br>
+<li> Added: A new section to the docs: Configuration files location.<br>
+<li> Added: Now the index of the documentation also includes all the chapters,
+sections, etc.<p>
+<b>Revision</b> 1.448 2003/10/16 19:34:02 set<br>
+<li> Fixed: When the alternative sorting mode of the project window was
+enabled some internal searches failed because they expected the old sorting
+mode. Now the sorting mode is temporally changed.<br>
+<li> Fixed: When switching between sorting modes the focused item changed.<p>
+<b>Revision</b> 1.447 2003/10/16 19:12:45 set<br>
+<li> Modified: [Configuration] TV 2.0.3 dependency because I'm currently using
+a couple of additions to the API and hence users needs CVS version.<br>
+<li> Added: [sLisp] SelectWindowNumber used to change the focused window. when
+used for an edition window it also changes the sLisp target allowing to
+modify another buffer, not just the one selected when the macro was
+triggered.<br>
+<li> Added: [sLisp] GetCurWindowNumber and GetMaxWindowNumber they can be used
+to apply an operation to all the windows and also to go back to the
+original window.<br>
+<li> Modified: The Alt+window_number combination now belongs to the menues and
+isn't hardcoded in TV anymore.<br>
+<li> Added: Commands to select the project and message windows, also to select
+the first 19 editors. With the help of sLisp and last aditions now is
+possible to select any window using just a key or menu entry.<br>
+<li> Modified: To avoid status messages when running sLisp code binded to a
+key or menu entry.<br>
+<li> Added: Documented and translated to spanish.<br>
+<li> Version 0.5.3 (Iguazu II)<p>
+<b>Revision</b> 1.446 2003/10/16 19:03:29 set<br>
+<li> Added: [sLisp] now you can bind a small piece of sLisp code to a key or
+a menu entry. With it the user doesn't need to edit macros.slp for small
+stuff. It will also allow passing arguments when macros support it. I
+implemented it to solve a limitation pointed out by Alain.<p>
+<b>Revision</b> 1.445 2003/10/14 15:51:26 set<br>
+<li> Added: In the project window now you can choose between a way to display
+files that's easier to find by name and another suitable to find them by
+their directory. From suggestions by Sam Thursfield <samth@mail.ru> and
+Alain <alainm@pobox.com>, but I think others also asked for it.<p>
+<b>Revision</b> 1.444 2003/10/14 15:39:27 set<br>
+<li> Added: [sLisp] FindString, FindAgain, ReplaceString and ReplaceAgain sLisp
+commands. Based on code an ideas by Bernd.<p>
+<b>Revision</b> 1.443 2003/10/06 18:49:21 set<br>
+<li> Added: [WWW] Links to the Windows installer contributed by William.<p>
+<b>Revision</b> 1.442 2003/10/06 18:26:17 set<br>
+<li> Added: Some Ruby syntax highlighting. Contributed by William E. Cullen
+<WECullen@comcast.net>.<p>
+<b>Revision</b> 1.441 2003/09/02 13:49:37 set<br>
+<li> Updated: QNX configuration. Patch from Mike.<p>
+<b>Revision</b> 1.440 2003/09/01 13:50:58 set<br>
+<li> Fixed: Missing <body> tag when exporting as HTML, reported by Federico
+Bareilles <fede@lilen.fcaglp.unlp.edu.ar><p>
+<b>Revision</b> 1.439 2003/08/27 17:53:42 set<br>
+<li> Added: HTML as html extension.<br>
+<li> Fixed: The readme said it was a .0 release. Pointed out by Ivan.<br>
+<li> Fixed: The configure scripts to pass the arguments using "". From a
+problem reported by Ivan.<br>
+<li> Added: Nice screen shot contributed by Mike Conrad
+<conradme@email.uc.edu><br>
+<li> Fixed: An unhandled diff case in the applycvs.pl tool.<p>
+<b>Revision</b> 1.438 2003/08/15 18:51:32 set<br>
+<li> Fixed: [Configuration] The configure script didn't take the CXXFLAGS
+variable, instead always used rhtv-config output (only CXXFLAGS, no CFLAGS)
+I discovered it when Ivan starter to wonder why debian/rules wasn't able to
+change the compilation options ;-)<p>
+<b>Revision</b> 1.437 2003/08/13 18:38:07 set<br>
+<li> Added: A link to the "pure DOS" fix/test release to the web page and also
+made the more visible the link to S.F. summary page.<p>
+<b>Revision</b> 1.436 2003/08/11 01:53:33 terrible<br>
+<li> Updated: Debian version to 0.5.2-1.<p>
+<b>Revision</b> 1.435 2003/07/23 19:37:56 set<br>
+<li> Added: A small page about Iguaz to the site.<p>
+<b>Revision</b> 1.434 2003/07/23 18:12:59 set<br>
+<li> Fixed: If no tags files are present and you want to add one to the list
+now the editor doesn't suggest reading the docs.<br>
+<li> Added: Support for the tags files generated by objdump (this is my small
+contribution to GNU binutils project ;-). In these files I use some new
+"keys" not defined by ctags. It also contains prototypes.<p>
+<b>Revision</b> 1.433 2003/07/22 19:18:50 set<br>
+<li> More small adjustments for the final release. Web page and docs.<p>
+<b>Revision</b> 1.432 2003/07/22 14:52:22 set<br>
+<li> Modified: The web page to reflect the new release. I'm finishing the
+"Release Candidate" stage.<p>
+<b>Revision</b> 1.431 2003/07/16 13:33:37 set<br>
+<li> Modified: The RPM scripts to support an environment variable to indicate
+where to create the RPMs. I needed it when using S.F. Compiler Farm and
+Red Hat 7.3 which always failed when using a directory mounted with NFS.<br>
+<li> Modified: The source package creation to create the "result" directory
+if it doesn't exist.<p>
+<b>Revision</b> 1.430 2003/07/14 17:54:07 set<br>
+<li> Added: More SQL keywords. Contributed by Grzegorz.<p>
+<b>Revision</b> 1.429 2003/07/10 20:22:17 set<br>
+<li> Added: TVision configuration keyword. Note this keyword is currently
+available only in the experimental branch of TV.<p>
+<b>Revision</b> 1.428 2003/07/07 21:12:32 set<br>
+<li> Added: hh extension as C++ code. SAVANT/TyVis generates code with that
+extension.<br>
+<li> Added: very basic VHDL syntax highlight.<p>
+<b>Revision</b> 1.427 2003/07/07 15:29:41 set<br>
+<li> Added: The TAGs tutorial to the distribution. It is a big (because of the
+images) but I think it could help users to quickly start using these
+features.<p>
+<b>Revision</b> 1.426 2003/07/01 13:05:39 set<br>
+<li> Added: Errors parser for ANT Java Builder. Cotributed by Grzegorz.<br>
+<li> Added: Java emacs modes and throw keyword. Cotributed by Grzegorz.<p>
+<b>Revision</b> 1.425 2003/06/30 13:10:18 set<br>
+<li> Added: List of new and fixed stuff to the readme. Also the release name
+and revision.<br>
+<li> Added: Link to TAGs tutorial in the docs.<p>
+<b>Revision</b> 1.424 2003/06/30 13:09:15 set<br>
+<li> Fixed: [BC++] a bug in the EasyDiag label and radio buttons that made
+Alt+L and similars to generate GPFs. This is very interesting: the GPF was
+generated by code that I forgot to remove while adapting to the new i18n
+mechanism. The code was useless and hence gcc simply removed it (2.81 to
+3.3 versions tested) but BC++ 5.5/5.6 seems to be quite inferior optimizing
+and didn't remove the code. This code walked a single chained list but
+using wrong pointers (NULL or released).<p>
+<b>Revision</b> 1.423 2003/06/30 13:08:17 set<br>
+<li> Added: [Config] makes directory to the library search path. It makes
+RHIDE projects easier.<br>
+<li> Added: [Config] --libset to my DOS default config. I finally managed to
+compile RHIDE 1.5 CVS for DOS. It took me a day to figure out the problems
+in my system and workaround gdb make problems.<br>
+<li> Added: [Config] less to the DOS cvs update batch.<p>
+<b>Revision</b> 1.422 2003/06/30 13:07:09 set<br>
+<li> Added: A script to update from CVS using the options I use. A DOS batch
+file and a shell script are provided.<p>
+<b>Revision</b> 1.421 2003/06/27 19:52:07 set<br>
+<li> Added: Some SQL keywords. Contributed by Grzegorz.<p>
+<b>Revision</b> 1.420 2003/06/24 19:17:47 set<br>
+<li> Added: A tutorial explaining how to use tags stuff step by step. It have
+graphics but I'm not sure about distributing them, size issue.<br>
+<li> Fixed: Fails in the "Export as HTML" command when some text was selected.<br>
+<li> Fixed: When using completion words and the word to complete made match
+with the last symbols the editor crashed.<br>
+<li> Modified: added calls to gprexp and changed rules to create .imk files.<p>
+<b>Revision</b> 1.419 2003/06/23 21:09:09 set<br>
+<li> Updated: default .env files.<br>
+<li> Added: link to the new nightly snapshots to the web page.<p>
+<b>Revision</b> 1.418 2003/06/23 14:50:49 set<br>
+<li> Fixed: error in spanish translation. Reported by Andres Trapanotto
+<andres_t@inti.gov.ar>.<p>
+<b>Revision</b> 1.417 2003/06/23 14:31:44 set<br>
+<li> Added: some TODO entries I want to add after the next release.<br>
+<li> Updated: the copyrigh file.<br>
+<li> Updated: the readme files for distribution. Copyright dates and also a
+more accurate description about keyboard under X11.<p>
+<b>Revision</b> 1.416 2003/06/23 14:27:48 set<br>
+<li> Fixed: [InfView] the code to paste the current selection to the secondary
+OS clipboard wrongly computed the condition to determine if the selection
+was valid or not. As a result it tried to paste a negative line. The
+consequence ranged from nothing to an infinite loop, including SIGSEGVs and
+wrong text in the window. It was exposed by some double click conditions
+but also with simple clicks.<p>
+<b>Revision</b> 1.415 2003/06/23 14:21:10 set<br>
+<li>** New name for release: Iguazu I ***<br>
+<li> Added: now the releases will have names to identify them easier.<br>
+<li> Added: revision number to the about dialogs, suggested by Ivan. The
+number will be based on my local CVS revision number. The S.F. offset could
+need adjustments. The revision number is only updated when compiling with
+the maintainer mode enabled.<p>
+<b>Revision</b> 1.414 2003/06/18 19:55:12 set<br>
+<li> Added: Now ManView window can be closed with ESC. Suggested by Thiago.<br>
+<li> Added: Now you can copy from the message window to the OS clipboard.
+Suggested by Thiago.<p>
+<b>Revision</b> 1.413 2003/06/17 15:50:25 set<br>
+<li> Fixed: Find whole words and out/inside comments didn't work together.
+Reported by Alain <alainm@pobox.com>.<p>
+<b>Revision</b> 1.412 2003/06/17 14:43:45 set<br>
+<li> Added: SQL emacs modes and sequence keyword. Suggested by Grzegorz.<p>
+<b>Revision</b> 1.411 2003/06/17 14:36:37 set<br>
+<li> Added: cmcCommentIndent/cmcCommentUnIndent now indents the current line
+if nothing is selected. Suggested by Thiago.<br>
+<li> Added: [sLisp] a command to find which syntax highlight is in use. From an
+idea suggested by Thiago.<p>
+<b>Revision</b> 1.410 2003/06/17 13:09:25 set<br>
+<li> Added: install instructions for djgpp, Cygwin, MinGW and MSVC.<p>
+<b>Revision</b> 1.409 2003/06/17 13:04:19 set<br>
+<li> Modified: To support the new CLY_destroy mechanism.<p>
+<b>Revision</b> 1.408 2003/06/17 13:02:32 set<br>
+<li> Added: [Linux] an script to create TV and SETEdit RPMs in one call.<br>
+<li> Added: Documentation about compilation and installation for BC++, Linux
+and generic UNIX systems. Also explanation for the .deb files. I also
+removed the obsolete information found in the README that now points to
+INSTALL.txt and it points to individual files in doc/install.<p>
+<b>Revision</b> 1.407 2003/06/17 12:55:04 set<br>
+<li> Added: A script to generate the RPMs in an easy way.<br>
+<li> Modified: RPMs release version to 1.<p>
+<b>Revision</b> 1.406 2003/06/13 20:55:22 set<br>
+<li> Added: Files and instructions to create RPMs. They are bbcat's .spec
+files with some additions and corrections. Things I'm not sure they will
+remain:
+1) Need of tar.bz2 file.
+2) Use of package-version dir.<p>
+<b>Revision</b> 1.405 2003/06/13 12:22:11 set<br>
+<li> Added: [sLisp] (repeat times commands...) from code and ideas contributed
+by Bernd.<br>
+<li> Added: [sLisp] (= var value) as an alias for (setv ...<br>
+<li> Added: [sLisp] (++ "var_name") and (-- "var_name"), they behaves as their
+C counterparts.<br>
+<li> Added: Documentation for all of them.<p>
+<b>Revision</b> 1.404 2003/06/12 21:10:05 set<br>
+<li> Added: A new option to avoid redirecting stdout when running an external
+program. Useful for interactive applications that uses stdout. Documented.
+Translated to spanish.<br>
+<li> Fixed: [UNIX] When running an external program and using the "OS screen"
+the editor made a complete mess because the routine redirected stdout and
+then suspended. It made the UNIX/Linux console drivers to try to use the
+file as a console 8-P<br>
+<li> Fixed: [sLisp] The RunProgram command was affected by the options in the
+configuration dialog. Now they are independent.<br>
+<li> Added: [sLisp] Two constants to be used by RunProgram. They are for the
+old option (use OS/user screen) and the new option to avoid redirecting
+stdout.<br>
+<li> Added: The new sLisp commands and all the constants to syntaxhl.shl.<p>
+<b>Revision</b> 1.403 2003/06/12 21:07:53 set<br>
+<li> Added: [sLisp] GetCursorX, GetCursorY and SetCursorXY commands.
+Documented.<br>
+<li> Added: A new command that inserts a new line without moving the cursor
+nor indenting. This is the old WordStar ^N command. Replaced the old ^N
+assignment. Added to menues. Translated to spanish.<br>
+<li> Fixed: JumpLastCursorPos was interpreted as command 154 instead of 153
+when used from menues.<br>
+<li> Fixed: + and - should change month in calendar, but used a very all (and
+nasty) legacy mechanism.<br>
+<li> Added: Calendar windows can be closed pressing ESC.<p>
+<b>Revision</b> 1.402 2003/06/11 20:18:38 set<br>
+<li> Added: [sLisp] Find command, contributed by Bernd.<p>
+<b>Revision</b> 1.401 2003/06/10 15:27:03 set<br>
+<li> Added: [sLisp] loop and exitloop sentences, also ==, !=, ++ and --<br>operators. All of them have some basic behavior that could be extended but
+is enough for a <2.5 hours hack ;-) I added some documentation and a small
+example. I implemented to show to Bernd Becker how to implement loop
+sentence.<p>
+<b>Revision</b> 1.400 2003/06/05 20:12:29 set<br>
+<li> Added: Menu entries for cmcLastPosCur.<br>
+<li> Added: Documentation for both commands (new one and the older).<br>
+<li> Fixed: Need of flushLine in both commands to avoid messing the line under
+edition.<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.399 2003/06/05 20:11:20 set<br>
+<li> Fixed: When genimk fails it must delete the partially generated .imk and
+.umk to force a new generation after fixing the problems.<p>
+<b>Revision</b> 1.398 2003/06/05 20:08:57 set<br>
+<li> Fixed: Compilation problems with gcc 3.3 patch from Andris. It fixes:
+1) The order we call the contructors for the base classes.
+2) Multiline strings no longer supported by gcc.
+3) Gcc no longer supports char values as array index.
+Comments:
+1) I don't understand why, I think it should be enforced only if the
+sequence is ambiguous, after all compilers are supposed to help people.
+2) I don't understand why, is so easy to support.
+3) I don't understand why it can be promoted to int as in any other place.<p>
+<b>Revision</b> 1.397 2003/06/04 20:45:13 set<br>
+<li> Added: A new command called cmcJumpLastCursorPos. It works similar to
+cmcLastPosCur but uses a different mechanism. I assigned this command to
+^Q-P that according to Alain <alainm@pobox.com> is the WordStar command for
+it. Looking for feedback.<p>
+<b>Revision</b> 1.396 2003/06/04 17:36:39 set<br>
+<li> Added: Support for makeinfo 4.4 and newer. For some reason the new
+versions doesn't support _ inside names (only -). Really uncompatible from
+my point of view. Lamentably this is currently shipped in a few rare Linux
+distributions like Slackware 9.0.0 and SuSE 8.2 (no in previous releases,
+nor in any Debian nor Red Hat nor Mandrake distro). And Andris and Michel
+didn't sent me the intermediate file needed to find the problem.<p>
+<b>Revision</b> 1.395 2003/06/02 15:12:20 set<br>
+<li> Modified: Configuration script to adapt to the new TV directory
+structure. Now the resulting lib is in ../tvision/makes.<p>
+<b>Revision</b> 1.394 2003/05/30 19:51:37 set<br>
+<li> Fixed: Config: Moved TV detection to be before detecting CFLAGS so we can
+be sure be can get TV settings.<br>
+<li> Added: Config: Advices when using shipped libs.<br>
+<li> Fixed: Config: AA lib detection when running the configure script in a
+remote console.<br>
+<li> Removed: [Debian] recode as dependency.<br>
+<li> Removed: [Debian] .mak files from "files to back-up".<p>
+<b>Revision</b> 1.393 2003/05/26 14:30:58 set<br>
+<li> Modified: Makefile.nmk to be a wrapper for Makefile.bcc by just including
+it. The only difference is that it defines FOR_NMAKE=1 and this will force
+to use definitions for MSVC compiler.<p>
+<b>Revision</b> 1.392 2003/05/26 14:07:48 set<br>
+<li> Modified: The mkf, imk and umk files to allow more abstraction regrading
+to file extensions. So now objects can be .o or .obj or anything.<br>
+<li> Added: Makefiles to use the umk files with BC++. I successfully compiled
+the editor and infview using the .umk files called from a main Makefile.bcc
+I keep the old mechanism until this is more tested.<br>
+<li> Added: Files for nmake, but they aren't tested and I'm quite sure they
+will need adjusts. I need a volunteer.<p>
+<b>Revision</b> 1.391 2003/05/26 14:03:14 set<br>
+<li> Modified: The makefiles to maintain the .imk and .umk files only when
+the "Maintainer Mode" is enabled.<br>
+<li> Added: --no-prefix-h to configset because I use /usr as prefix and this
+is already in the list.<p>
+<b>Revision</b> 1.390 2003/05/23 20:19:45 set<br>
+<li> Modified: Sorted the configure options by category so people can find the
+needed option faster.<p>
+<b>Revision</b> 1.389 2003/05/23 19:19:47 set<br>
+<li> Modified: Now if you configure the editor without special options the
+makfiles avoids header dependencies. Using --enable-maintainer-mode enables
+the complex dependencies.<p>
+<b>Revision</b> 1.388 2003/05/23 16:10:32 set<br>
+<li> Added: Detection and use of rhtv-config even if it isn't installed.<br>
+<li> Added: Error message if rhtv-config can't be found.<br>
+<li> Removed: X11 headers stuff from configuration header. The editor doesn't
+really use it, is all abstracted by TV.<br>
+<li> Added: Rules so make detects the configuration scripts are newer and
+forces the user to reconfigure.<p>
+<b>Revision</b> 1.387 2003/05/23 13:23:52 set<br>
+<li> Fixed: [DOS] Details about the new configuration.<p>
+<b>Revision</b> 1.386 2003/05/23 13:20:05 set<br>
+<li> Modified: Some details about the configuration process. Now the scripts
+takes C flags, C++ flags, libraries and path to libraries from TV
+configuration using rhtv-config tool. I'm testing it so please be patient.
+Sorry for inconvenients.<p><br>--- CVS tag i0_5_2b ---<br>--- Tarball uploaded to S.F. ---<p>
+<b>Revision</b> 1.385 2003/05/22 20:47:31 set<br>
+<li> Added: Support for "DOS files" to the .mak parser. Just in case.<br>
+<li> Updated: .imk files to avoid the need of gpr2mak.<p>
+<b>Revision</b> 1.384 2003/05/22 19:24:45 set<br>
+<li> Fixed: It was wrong again ;-), if the source was newer than imks and the
+.exe didn't exist it failed. Thanks Kevin for the patience.<p>
+<b>Revision</b> 1.383 2003/05/21 21:13:45 set<br>
+<li> Fixed: Wrong dependencies for genimk and extrimk again! Hope this time
+they are ok. Reported by Kevin.<p>
+<b>Revision</b> 1.382 2003/05/21 20:34:08 set<br>
+<li> Fixed: A lot of pointer casts to compile for 64 bits processors. The code
+compiles for Itanium but isn't stable.<p>
+<b>Revision</b> 1.381 2003/05/20 19:02:32 set<br>
+<li> Modified: Some details of the powered grep to make it more friendly:
+1) During a blocking call to grep the "busy indicator" is enabled.
+2) During a recursive search you can stop the recursivity pressing ^C.
+3) Gives a change to update the screen after each run, very important for
+the X11 driver.<p>
+<b>Revision</b> 1.380 2003/05/20 17:29:24 set<br>
+<li> Added: Emacs modes for CSS files. From Grzegorz.<p>
+<b>Revision</b> 1.379 2003/05/20 14:12:42 set<br>
+<li> Added: A new couple of commands to copy and paste to/from the OS
+clipboard when using the TInputLinePiped input boxes. These commands must
+be used in menu files if you want to use the OS clipboard for it. They are
+called cmtilCopyOS and cmtilPasteOS. From a request by Thiago.<p>
+<b>Revision</b> 1.378 2003/05/19 21:03:48 set<br>
+<li> Fixed: When importing items to the project the editor:
+1) Didn't redraw the project window.
+2) Didn't use the base path for the project.
+From a report by Kevin.<p>
+<b>Revision</b> 1.377 2003/05/19 14:18:16 set<br>
+<li> Modified: [MinGW] Looks like pwd can be called from Perl, at least from
+the Perl I have. Most probably the problem is that MinGW have pwd only as
+an internal shell command.<br>
+<li> Fixed: [Win32] Collision between Win32 API and GetLastError from holidays
+module.<p>
+<b>Revision</b> 1.376 2003/05/19 14:12:56 set<br>
+<li> Modified: [MinGW] Looks like pwd can be called from Perl, at least from
+the Perl I have. Most probably the problem is that MinGW have pwd only as
+an internal shell command.<br>
+<li> Fixed: [Win32] Collision between Win32 API and GetLastError from holidays
+module.<p>
+<b>Revision</b> 1.375 2003/05/19 14:11:09 set<br>
+<li> Fixed: The confignt.pl script not collected all the object files needed
+for BC++ and MSVC.<br>
+<li> Fixed: Missing -I..\holidays for BC++ and MSVC.<br>
+<li> Modified: Disabled "Unreachable code" BC++ warning. The compiler
+generates it for code that was obviously coded to achieve it (if (0) ....).<br>
+<li> Fixed: I can't beleive I left a ; at the end of a while in the code fixed
+by revision 1.830 (home CVS number). Detected by BC++.<br>
+<li> Fixed: Assigment to Boolean from a boolean condition. Detected by BC++.<p>
+<b>Revision</b> 1.374 2003/05/19 14:09:57 set<br>
+<li> Fixed: The install.mkf needed settvuti path and also the addition of
+libwin.<br>
+<li> Fixed: The distribution contained common.imk twice.<p>
+<b>Revision</b> 1.373 2003/05/16 20:59:40 set<br>
+<li> Added: Some text about RHIDE to the web page and a link to a patch that
+allows creating an RHIDE compiled with the current CVS code.<p>
+<b>Revision</b> 1.372 2003/05/16 19:25:08 set<br>
+<li> Fixed: clean target of holidays directory didn't ignore errors.<br>
+<li> Fixed: extra \n at the end of distribution lists produced problems.<br>
+<li> Fixed: missing .mkf files in distro.<br>
+<li> Note: compiled (not tested) for Mandrake 9.1 and Red Hat 9.0. Compiled
+and tested for Solaris.<p>
+<b>Revision</b> 1.371 2003/05/16 15:30:32 set<br>
+<li> Fixed: Wrong dependencies for the .imk files. They depends on the imk
+generator, but the source, not the exe. The exe will be always newer than
+the imk files for fresh check outs and it forced to have gpr2mak. Seen on
+Solaris where I don't have grp2mak.<p>
+<b>Revision</b> 1.370 2003/05/16 12:53:29 set<br>
+<li> Fixed: Missing C++ lib for extrimk.cc and genimk.cc. Reported by Kevin
+Alm <kevinalm@shenessex.heartland.net>.<p>
+<b>Revision</b> 1.369 2003/05/16 12:41:30 set<br>
+<li> Modified: To ever include stdc++ as library in the worst case it will be
+listed twice.<p>
+<b>Revision</b> 1.368 2003/05/15 18:10:26 set<br>
+<li> Modified: configset to wait for ENTER instead of sleeping 2 seconds. As
+suggested by Ivan.<p>
+<b>Revision</b> 1.367 2003/05/15 18:04:42 set<br>
+<li> Fixed: The tool to transport patches from my home to SF CVS skipped some
+patches :-( I think it was the source for various misterious missing
+patches. I hope the new version really solves the problem.<p>
+<b>Revision</b> 1.366 2003/05/14 19:54:09 set<br>
+<li> Added: A check for makeinfo 4.5. It doesn't work and generates
+compilation problems. So now if that's detected the configuration assumes
+makeinfo isn't usable.<p>
+<b>Revision</b> 1.365 2003/05/14 16:23:19 set<br>
+<li> Modified: Moved the libset target to makes/Makefile so it is cleaner and
+includes the "makes" dependency.<p>
+<b>Revision</b> 1.364 2003/05/14 16:01:48 set<br>
+<li> Fixed: For some reason S.F. CVS had a configure script that didn't use
+libset.mkf (used the .mak).<br>
+<li> Fixed: The code to extract BC++ and MSVC objects failed with the new .imk
+format of 1 dependency by line.<br>
+<li> Added: RHIDE 1.5 CVS defines vpath for includes as all the include
+directories and then stripts these directories from dependencies. This is
+different to what previous versions used. Now the imks generator supports
+it.<br>
+<li> Added: RHIDE 1.5 CVS generates some absolute path dependencies, I'm not
+sure if it only happends for old .gpr files. Now the .imk generator tries
+to convert them into relative and scan again looking for the proper include
+directory before giving up.<br>
+<li> Fixed: The -m option was disabled during the TV 1.x to 2.x process, now
+is enabled again using TV 2.x mechanisms.<p>
+<b>Revision</b> 1.363 2003/05/13 14:58:18 set<br>
+<li> Fixed: Some details needed to compile RHIDE 1.5, CVS snapshot for today.<p>
+<b>Revision</b> 1.362 2003/05/13 12:51:18 set<br>
+<li> Fixed: More documentation details. Patch from Bernd.<p>
+<b>Revision</b> 1.361 2003/05/12 19:31:18 set<br>
+<li> Modified: Made the "Paste Emacs mode" more robust. If the first line is
+"#!..." the comment is pasted in the second. If the mode was already
+pasted by the editor it is first deleted. Suggested by Grzegorz.<p>
+<b>Revision</b> 1.360 2003/05/12 15:55:23 set<br>
+<li> Modified: Made more robust the "shell script" shl detection/ It now
+supports: "#!.../env command" => command and "#!.../commandVERSION" =>
+command (example python2.2 => python). From Grzegorz suggestions.<p>
+<b>Revision</b> 1.359 2003/05/12 15:23:33 set<br>
+<li> Modified: The imk generator to generate one dependency in each line. This
+makes files bigger (5.5 % for editor.imk) but reduces the CVS traffic
+because when a dependency is added only one line is affected and no all the
+lines after it.<p>
+<b>Revision</b> 1.358 2003/05/12 14:39:33 set<br>
+<li> Added: Emacs modes and shell names for Tcl and Python. Suggested by
+Grzegorz.<p>
+<b>Revision</b> 1.357 2003/05/12 13:45:50 set<br>
+<li> Added: A dialog to dis/enable any advice dialog (also the Quit + delete
+warning).<br>
+<li> Modified: Now when you "Quit" (cmeQuitDelete) and the warning dialog pops
+up you can press Escape to abort the process. Suggested by Alex Lozano.<br>
+<li> Added: Virtual members to TStringable to un/mark items. I used it for the
+new dialog.<br>
+<li> Added: Un/mark facilities to TStringableListBox for TStringables that
+reports support for it.<br>
+<li> Updated: Spanish translations.<br>
+<li> Documented: "Check for modified files" and "Advice dialogs" configuration
+options. Both linked to contexts.<p>
+<b>Revision</b> 1.356 2003/05/12 13:44:40 set<br>
+<li> Fixed: Also infview.mkf needed FOR_EDITOR as extra flags and libset.mkf
+needed FOR_LIBSET.<p>
+<b>Revision</b> 1.355 2003/05/12 13:43:36 set<br>
+<li> Added: A dialog to configure if the editor will check modification times
+after running an external program and/or periodically. Also how many seconds
+to wait between checks. Saved to desktop file.<br>
+<li> Fixed: When no project is available now the "Powered Grep" avoids using
+"search in projects" as default.<br>
+<li> Fixed: I forgot the C_EXTRA_FLAGS in editor.mkf.<br>
+<li> Fixed: The above mentioned error also existed for BC++ and MSVC producing
+wrong InfView colors.<br>
+<li> Updated: Spanish translations.<br>
+<li> Version 0.5.2<p>
+<b>Revision</b> 1.354 2003/05/12 13:41:34 set<br>
+<li> Added: Every 8 seconds and from the idle loop the editor checks if we
+are editing a file and in this case if the modification time of the file
+on disk changed.<br>
+<li> Added: Every time we focuse an editor the idle loop checks the
+modification time of the copy on disk.<br>
+<li> Added: When the editor detects the copy on disk is newer and that we also
+modified the copy in memory the editor asks for 4 options:
+1) Load the file from disk, it discards changes in the copy we have on
+memory.
+2) Don't do anything, the user must solve the problem.
+3) Like 1 but the editor invokes diff -u and shows the output.
+4) Like 2 but with diff like in 3.<br>
+<li> Added: If GNU diff isn't isntalled we show an advice dialog.<p>
+<b>Revision</b> 1.353 2003/05/12 13:40:08 set<br>
+<li> Fixed: Deatails about handling RHIDE 1.4.7 and 1.5 projects.<br>
+<li> Fixed: Difference between the criteria of return values between exit,
+djgpp, glibc and make.<br>
+<li> Fixed: sdgcline compilation issues.<br>
+<li> Added: Avoid to generate new rhide.env files if they won't change. Now
+they are dependencies.<br>
+<li> Added: Support for the new .imk files to the BC++ and MSVC configuration
+process (confignt.pl).<br>
+<li> Fixed: ../holidays shouldn't be in SUPPORT_INC.<br>
+<li> Modified: To avoid dependencies from $(TVISION_INC)/cl<p>
+<b>Revision</b> 1.352 2003/05/12 13:37:59 set<br>
+<li> Added: A new system for the makefiles. Expect all kind of compilation
+problems. It will simplify the configuration process and reduce CVS patches
+to .mak files.<br>
+<li> Fixed: libamp case sensitive include.<br>
+<li> Fixed: sdgcline details to allow clean compilation.<p>
+<b>Revision</b> 1.351 2003/05/09 13:09:03 set<br>
+<li> Added: A check to determine if the configure script is newer than the
+cache. If that's the case the cache is discarded.<p>
+<b>Revision</b> 1.350 2003/05/08 18:03:45 set<br>
+<li> Fixed: After loading a file from a desktop file with column cursor
+enabled it wasn't visible until the cursor was moved.<br>
+<li> Added: A bizarre desktop example with two fonts.<p>
+<b>Revision</b> 1.349 2003/05/08 18:00:46 set<br>
+<li> Added: Context sensitive help for the holidays configuration.<p>
+<b>Revision</b> 1.348 2003/05/07 19:53:46 set<br>
+<li> Fixed: Now the editor forces Tab==\t.<br>
+<li> Modified: The word completion key to be Ctrl+Tab as suggested by Grzegorz
+I'll give a try to this combination.<p>
+<b>Revision</b> 1.347 2003/05/07 19:44:21 set<br>
+<li> Fixed: EasyDiag meassured the width of the dialog's title using the
+untranslated string.<br>
+<li> Modified: The dialog to wait for a key during in the keyboard
+configuration to use EasyDiag.<p>
+<b>Revision</b> 1.346 2003/05/07 15:01:20 set<br>
+<li> Updated: Spanish translation for the fixed messages. Also committing a
+fresh german file that needs fixes.<p>
+<b>Revision</b> 1.345 2003/05/07 14:26:16 set<br>
+<li> Fixed: Applied a batch of patches from Bernd to fix messages in the code.<p>
+<b>Revision</b> 1.344 2003/05/07 12:41:15 set<br>
+<li> Added: holidays.cc to the project and makefiles. That's a whole update
+of the makefiles, please reconfigure the package if you are using CVS.<p>
+<b>Revision</b> 1.343 2003/05/07 12:34:42 set<br>
+<li> Fixed: The holidays directory must be used for includes even when
+dynamic libs are not supported.<p>
+<b>Revision</b> 1.342 2003/05/07 12:33:57 set<br>
+<li> Added: Some people to the list of contributors to the docs.<p>
+<b>Revision</b> 1.341 2003/05/07 12:33:16 set<br>
+<li> Fixed: Second lot of changes to docs from Bernd Becker
+<munin@munin.inka.de>.<p>
+<b>Revision</b> 1.340 2003/05/06 20:45:13 set<br>
+<li> Fixed: Tags: Some languages (the ones after PHP) had errors in the kind
+decoding.<br>
+<li> Added: HTML language and kind:a to the list of supported tags, Grzegorz
+have a modified E.Ctags that supports it.<p>
+<b>Revision</b> 1.339 2003/05/06 20:26:04 set<br>
+<li> Added: A dialog to force a plug-in for the calendar. Useful if the user
+doesn't define the LANG environment variable or if that isn't enough to
+determine the country.<br>
+<li> Modified: Moved most of holidays plug-in code to a separated file.<p>
+<b>Revision</b> 1.338 2003/05/06 12:34:04 set<br>
+<li> Added: a small doc explaining how to write a "holidays plug-in".<p>
+<b>Revision</b> 1.337 2003/05/06 12:32:41 set<br>
+<li> Fixed: A lot of typos and errors in docs. <b>Revision</b> by Bernd Becker
+<munin@munin.inka.de>.<p>
+<b>Revision</b> 1.336 2003/05/06 12:31:49 set<br>
+<li> Added: Conditional to compute statistics about the tags. Reports really
+interesting info.<br>
+<li> Modified: The way that Tags are displayed in lists to make them more
+readable as suggested by Grzegorz. I used the stats to determine the sizes.<p>
+<b>Revision</b> 1.335 2003/05/05 20:40:31 set<br>
+<li> Added: A configuration file for the "holiday plug-ins", it maps a value
+of the LANG environment variable to a country and .so.<br>
+<li> Added: A default plug-in with the most common holidays more or less used
+world-wide.<p>
+<b>Revision</b> 1.334 2003/05/05 14:34:35 set<br>
+<li> Added: yield to Python keywords (introduced in 2.2). Contributed by
+Grzegorz.<p>
+<b>Revision</b> 1.333 2003/05/05 14:08:41 set<br>
+<li> Added: The first step towards support for plug-ins to highlight holidays
+in the calendar. Currently is only supported for systems implementing
+dlopen() and I have a plug-in only for my country ;-). I'll soon make it
+selectable and write a mini-doc about how to write those plug-ins.<p>
+<b>Revision</b> 1.332 2003/05/05 14:06:06 set<br>
+<li> Modified: Now the dialog that shows the list of classes isn't case
+sensitive. That's why I feel that's much more intuitive and easier to use.<br>
+<li> Fixed: When searching in classes without a perfect match of the word
+under cursor and jumping to a member the editor jumped but offered the list
+of classes again.<br>
+<li> Fixed: The list of "functions" supports things that aren't strcitly
+programming languages, like texinfo sources, for this reason the "space"
+key should't act as item selector (can be part of the name in an
+incremental search).<br>
+<li> Fixed: When switching from a window with some syntax highlight to another
+with a different shl and using Alt+F2 it was common to get a wrong result
+because the editor used the old shl. Now the cmcJumpTo... ensures the shl
+cache is filled with the proper values.<br>
+<li> Added: A warning to the configset script as I did for DOS. BTW: What's
+the shell command to wait for a keystroke? I just put a sleep 2 but this
+isn't the best.<p>
+<b>Revision</b> 1.331 2003/05/05 14:03:21 set<br>
+<li> Added: A new option to control the size of newly opened files. When
+enabled the windows tries to avoid overlapping the message and project
+windows. The algorithm searchs for the bigger available rectangle that
+doesn't overlap. The code also ensures a minimal size of 24x6 and ensures
+the window is visible (not outside desktop). It was suggested by Ivn.<br>
+<li> Documented and updated spanish translations.<p>
+<b>Revision</b> 1.330 2003/05/05 13:57:49 set<br>
+<li> Fixed: Some pmacros (Perl was the most notable) didn't indicate the right
+editing mode flags. It could make them fail to generate properly indented
+text.<br>
+<li> Fixed: "Intelligent indent" mode needed "Backspace unindents" enabled in
+order to work as spected.<p>
+<b>Revision</b> 1.329 2003/05/05 13:53:14 set<br>
+<li> Added: A small tool I wrote to extract info from linker maps. Is quite
+useful for DOS to know how much comes from each lib.<p>
+<b>Revision</b> 1.328 2003/05/05 13:51:10 set<br>
+<li> Added: A warning to configset.bat because people thinks thats "set
+configuration" and not "configuration for SET" ;-)<br>
+<li> Added: Now if shell utils aren't installed (I think djgpp is the only
+that can lack it) the configuration stops and explains the problem.<br>
+<li> Modified: gcc 3.x doesn't like (unsigned char)var when var is unsigned.<br>
+<li> Modified: [DOS] looks like djgpp defines time_t in a way that gcc can't
+see the difference between time_t and unsigned.<br>
+<li> Modified: Looks like gcc 3.2.2 (may be all 3.x) doesn't support the
+__attribute__((constructor)) stuff for C++ code. So now I'm using C++ code
+for that, which is quite logical but ugly.<p>
+<b>Revision</b> 1.327 2003/05/05 13:45:13 set<br>
+<li> Modified: Now the tags file automagically maintained by the editor can't
+be removed manually from the list of tag files. Also: it isn't saved to the
+desktop file. Instead when you load a project the file is automatically
+inserted.<br>
+<li> Fixed: What Exuberant Ctags claims to be a regex isn't such a thing. For
+this reaso any "regex" containing a pointer type (*) fails. For this reason
+I changed the way it is used. Now I do a simple search but specifying
+"whole words", it can fail, but I think it won't be usual to get a fail.<p>
+<b>Revision</b> 1.326 2003/05/02 19:39:40 set<br>
+<li> Modified: Now is possible to load projects outside the current working
+directory. From a report by Grzegorz. Note it was tested only for Linux
+(don't tested using drive letters).<p>
+<b>Revision</b> 1.325 2003/05/02 12:45:16 set<br>
+<li> Fixed: The modified CreateChooseDialog used cmOKApply and cmCancelApply
+commands instead of cmOK and cmCancel. Reported by Grzegorz.<p>
+<b>Revision</b> 1.324 2003/04/30 20:28:34 set<br>
+<li> Fixed: The editor wrongly interpreted the basic/extended regex option so
+the real mode was in fact tied to the case sensitive option.<br>
+<li> Modified: Now the tags code uses real regex.<p>
+<b>Revision</b> 1.323 2003/04/30 19:34:19 set<br>
+<li> Added: A button to search for members of a class, struct, enum or union
+to the jump to tag dialog.<p>
+<b>Revision</b> 1.322 2003/04/30 18:00:19 set<br>
+<li> Fixed: TSortedListBox using SOStacks have a special incremental search,
+it had some bugs fixed in TV but not copied there.<p>
+<b>Revision</b> 1.321 2003/04/30 16:05:59 set<br>
+<li> Added: More documentation about tags.<br>
+<li> Updated: Spanish translations.<p>
+<b>Revision</b> 1.320 2003/04/30 14:23:02 set<br>
+<li> Added: When you add an item to the project it doesn't have to be newer
+than the TAGs file. For this reason I created a new filed in project items
+to indicate the item is new and that it wasn't yet included in the tags
+file. The concept currently allows the same for other 31 targets.<br>
+<li> Updated: Web page.<p>
+<b>Revision</b> 1.319 2003/04/30 13:18:25 set<br>
+<li> Added: An option to maintain a central tags file using the project items.
+This option checks if any of the project files is newer than the file
+"tags" and if that's the case calls ctags using the -a option and passing
+a list of files to scan. This makes ctags scan only the newer files saving
+time.<br>
+<li> Added: Support for tag files where "kind:" is implicit.<p>
+<b>Revision</b> 1.318 2003/04/29 18:23:35 set<br>
+<li> Added: Options to export the project items to a text file and to import
+file names from a text file. Documented and linked to the docs.<br>
+<li> Updated: Spanish translations.<p>
+<b>Revision</b> 1.317 2003/04/29 15:04:51 set<br>
+<li> Modified: CreateChooseDialog to use EasyDiag and made more configurable.<br>
+<li> Added: TGrowDialogZ as a TGrowDialog that can handle cmeZoom.<br>
+<li> Modified: TAGs code to reuse both things.<p>
+<b>Revision</b> 1.316 2003/04/29 12:52:11 set<br>
+<li> Added: A new member to EasyDiag objects to set the growMode option in an
+easier way (setGrowMode).<br>
+<li> Added: A button to the list of tag files to see the information stored by
+the tags program (format, program version, etc.).<br>
+<li> Modified: Redesigned the CreateAddInsDelDialog function using EasyDiag
+and added a new option for an "Info." button. The code is much more simple
+now.<p>
+<b>Revision</b> 1.315 2003/04/29 12:50:44 set<br>
+<li> Fixed: When doing a search in/outside comments close to the first line
+and having the cursor in the line of the first hit and this line was longer
+than the sum of the previous the editor evaluated line -1 generating a
+GPF. Reported by Bernd Becker <munin@munin.inka.de>.<p>
+<b>Revision</b> 1.314 2003/04/28 19:42:28 set<br>
+<li> Added: An advice dialog to warn about using tag files in format 1. And
+a button to jump to docs.<br>
+<li> Added: If the tags file to load is the default and couldn't be loaded
+an advice about it with option to read the docs is used. If the user
+doesn't go to the docs we detect if ctags is installed, if installed we
+offer to generate a new tags files. If not installed we indicate the URL
+of the homepage.<br>
+<li> Fixed: Tips code tried to jump to editor.inf which is no longer called
+like it. Does anybody read the tips?<p>
+<b>Revision</b> 1.313 2003/04/28 16:44:12 set<br>
+<li> Fixed: The tags code to support: original tags format (FORMAT=1), wrong
+tags files (Emacs tag files for example), backwards regex, etc. without
+crashing. Basically: made more robust when dealing with unexpected tag
+files.<p>
+<b>Revision</b> 1.312 2003/04/28 14:02:05 set<br>
+<li> Added: Some documentation about the new TAGS features.<br>
+<li> Added: Connected the context sensitive help values with the new
+documentation.<p>
+<b>Revision</b> 1.311 2003/04/28 14:00:31 set<br>
+<li> Updated: Spanish translations.<br>
+<li> Fixed: Shortcut collision in class browser.<br>
+<li> Removed: Some debugging printfs.<p>
+<b>Revision</b> 1.310 2003/04/28 13:58:19 set<br>
+<li> Added: Word completion stuff! is based on the code I wrote for sLisp and
+Lemur. I used Alt+Right for it but I'm not sure if that's a good idea.
+Currently is only on user request, some options about it could be added.<p>
+<b>Revision</b> 1.309 2003/04/28 13:56:15 set<br>
+<li> Added: A class browser based on TAGs info. It allows to know which are
+the parents and childs for a class, also which members are declared, jump
+to any of them, see a list of the members plus the members of the parents
+and more. I coded it in less than 5 hours, don't spect perfect code.<br>
+<li> Added: A new constant called tsveMakeSameW, when used (with or) for
+MakeVeGroup forces a call to makeSameW().<p>
+<b>Revision</b> 1.308 2003/04/28 13:54:25 set<br>
+<li> Fixed: When a directory contained a project with a desktop file newer
+than the current setedit version and a default desktop file from a version
+older than 0.5.0 the editor rejected the new file but preloaded it doing
+a mess at the time of loading the old file.<p>
+<b>Revision</b> 1.307 2003/04/28 13:53:33 set<br>
+<li> Added: When adding a tag file to list now the editor asks if we want to
+add it using a relative path.<br>
+<li> Modified: The dialog to select a tag file now uses "tags*".<br>
+<li> Added: The list of selected tag files is stored in the desktop file.<br>
+<li> Version 0.5.1<p>
+<b>Revision</b> 1.306 2003/04/25 18:41:43 set<br>
+<li> Fixed: When typing at the end of the visible area and a horizontal scroll
+is forced the editor have to draw the whole window. To minimize the impact
+the editor does an 8 columns scroll. But if this width was less than the
+width of the larger line this scroll was automatically neutralized by the
+horizontal scrollbar. It not only defeated the effect but also generated a
+second full draw making things even worst.<p>
+<b>Revision</b> 1.305 2003/04/25 18:15:10 set<br>
+<li> Fixed: When jumping to a hit in the message window and the first column
+contained a matching [{( and the editor was configure to do match pair on
+the fly: the message quickly dissapear.<p>
+<b>Revision</b> 1.304 2003/04/25 15:02:23 set<br>
+<li> Fixed: TSCheckBoxes computed the with using untranslated messages. Same
+for TSRadioButtons.<p>
+<b>Revision</b> 1.303 2003/04/25 12:22:25 set<br>
+<li> Added: Now you can jump to any symbol from the TAGS file! looks like I
+can't get it working using real regex and also looks like they aren't real
+regex, just full lines marked similar to regexs.<p>
+<b>Revision</b> 1.302 2003/04/24 20:05:11 set<br>
+<li> Added: A new color scheme contributed by Juan Diego (bach) Ianelli
+<jdibach@yahoo.com.ar>. Is called "Dark JDI".<p>
+<b>Revision</b> 1.301 2003/04/24 19:24:19 set<br>
+<li> At last!! finally I added some basic supoprt for TAGS. I had some code
+I wrote in 1998, but I discarded it because ectags changed a lot. Currently
+you can setup which tag files to use (the list isn't stored to disk) and
+do a search pressing ^F2, for repited entries you'll even be able to jump
+to the line where the symbol is defined, but in most cases the position is
+obtained using regex and it isn't implemented yet. Be careful that's really
+experimental. Also: forget about using it if the editor is linked with
+efence and the tags file is big. I tried it with a 1.1 MB file and the
+editor died after eating more than 240 MB of memory (efence seems to need
+real memory, not swap).<p>
+<b>Revision</b> 1.300 2003/04/22 15:32:56 set<br>
+<li> Modified: To support the --with-ssc TV option.<p>
+<b>Revision</b> 1.299 2003/04/21 19:38:34 set<br>
+<li> Fixed: wrong rules to create internac/colors.cc.<p>
+<b>Revision</b> 1.298 2003/04/21 18:30:05 set<br>
+<li> Modified: i18n files to remove TV messages, now they are in a separated
+catalog (tvision domain).<br>
+<li> Modified: The i18n initialization to use TVIntl::autoInit().<p>
+<b>Revision</b> 1.297 2003/04/21 18:25:37 set<br>
+<li> Added: Copy/paste to/from OS clipboard to the list of i18n strings.<br>
+<li> Fixed: Shortcut collision between it and file clipboard.<br>
+<li> Updated: Spanish translations, removed \r to shutup msgmerge.<p>
+<b>Revision</b> 1.296 2003/04/21 18:23:44 set<br>
+<li> Fixed: Color names now are coherent, all start with a capital letter.<br>
+<li> Fixed: The f*ck#ng gettext doesn't like values outside ASCII in msgids so
+I changed Robert's last name and put the correct value in the spanish
+translation. Some day I'll discard GNU gettext in favor of a forked and
+sane replacement.<br>
+<li> Added: A small tool to extract the names of the colors for i18n.<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.295 2003/04/21 18:16:20 set<br>
+<li> Adapted: Most of the remaining use of the old TV i18n API.<br>
+<li> Added: Various calls to snprintf (while adapting i18n).<br>
+<li> Added: A small tool to extract msgids from TV's .po file.<br>
+<li> Fixed: Spanish .po header (wrong encoding in comments).<br>
+<li> Updated: TV i18n messages.<br>
+<li> Fixed: Memory leak in about dialog.<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.294 2003/04/21 18:07:16 set<br>
+<li> Modified: No more use of strstream, now I use messageBox, easier code.<p>
+<b>Revision</b> 1.293 2003/04/16 20:29:42 set<br>
+<li> Modified: All messageBox calls to the new i18n API.<p>
+<b>Revision</b> 1.292 2003/04/10 21:39:42 set<br>
+<li> Modified: Now the i18n catalogs are in ISO-8859-1 encoding for all
+targets. Under DOS they are recoded on-the-fly to get CP850.<br>
+<li> Fixed: Some code in the installer that used _() as returning char *.<p>
+<b>Revision</b> 1.291 2003/04/08 19:18:25 set<br>
+<li> Modified: TWindow, TDialog and TButton use to follow TV.<p>
+<b>Revision</b> 1.290 2003/04/08 14:08:01 set<br>
+<li> Modified: Uses of TStaticText incarnations to follow new TV features. I
+hope the number of bugs is low ;-) This isn't really harmful but I think
+some bugs are there.<p>
+<b>Revision</b> 1.289 2003/04/07 13:48:38 set<br>
+<li> Modified: all uses of TCheckBoxes and TRadioButtons to match the new TV
+API. Now they also support code page changes on the fly.<br>
+<li> Fixed: In the last MinGW fix to avoid annoying messages from the
+configure script I forgot to assign the return value making recode,
+xgettext and makeinfo detection to fail.<p>
+<b>Revision</b> 1.288 2003/04/07 13:47:27 set<br>
+<li> Modified: The menu and status line creation for the new TV i18n API. Now
+they adapt to code page changes!<br>
+<li> Modified: The configuration to request TV 2.0.2.<p>
+<b>Revision</b> 1.287 2003/04/07 13:46:32 set<br>
+<li> Modified: To adapt to the new TVIntl class, just compilation details.
+More will come soon ;-)<p>
+<b>Revision</b> 1.286 2003/04/03 19:57:28 set<br>
+<li> Fixed: Even when gettext (intl library) returns a char * it should be
+used as a const char *. When I enforced it using the _() macro one wrong
+use was detected and this change allows compilations for const char * as
+return value.<p>
+<b>Revision</b> 1.285 2003/04/02 13:40:10 set<br>
+<li> Fixed: [MinGW] The configuration script shown the error messages created
+when running non-existent programs appear in the screen generating
+confusion. Now the command are executed redirecting stderr.<p>
+<b>Revision</b> 1.284 2003/04/02 13:39:02 set<br>
+<li> Fixed: Warnings about: return value in TCEditor::loadFile (this is
+because BC++ is idiot to detect the complete flow, but now the code is
+more clear for the compiler and also for humans ;-), Comparisson between
+unsigned char and unsigned int gave warnings (promotion to int?) in
+edprefs.cc and assigment of bool to a Boolean variable. All reported by
+BC++ 5.5 as warnings.<p>
+<b>Revision</b> 1.283 2003/04/01 17:31:34 set<br>
+<li> Added: The web site to CVS (for easier maintainance) and distro (for more
+information for the user).<br>
+<li> Updated: The web site for the last release.<p>
+<b>Revision</b> 1.282 2003/04/01 13:54:32 set<br>
+<li> Fixed: Attribute handling for big endian platforms in TViewPlus class.<p>
+<b>Revision</b> 1.281 2003/04/01 03:44:38 terrible<br>
+<li> Updated: Debian packaging to version 0.5.0-1.<br>
+<li> Modified: tell people to use the distribution name like for example
+potato/woody instead of unstable/stable.
+<hr>v0.5.0 [tagged as r0_5_0]<p>
+<b>Revision</b> 1.280 2003/03/21 18:02:58 set<br>
+<li> Fixed: Syntax highlight propagation in "last line - 1" after pasting.<p>
+<b>Revision</b> 1.279 2003/02/19 12:41:22 set<br>
+<li> Fixed: Heuristic Perl parser didn't pay attention to the \ character, the
+code looked for it but didn't increment the index properly. Reported by
+Juan Diego Iannelli <jdibach@yahoo.com.ar><br>
+<li> Added: New keywords used in experimental TV for their configuration file.<p>
+<b>Revision</b> 1.278 2003/02/11 13:41:01 set<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.277 2003/02/11 13:32:11 set<br>
+<li> Updated: Copyright date to include 2003 in the about dialog and also the
+date of the last documentation change.<p>
+<b>Revision</b> 1.276 2003/02/06 18:55:29 set<br>
+<li> Added: Save all option to save all unsaved editors. As suggested by
+lvaro (Cristina ;-) and Ivn.<p>
+<b>Revision</b> 1.275 2003/01/31 15:55:59 set<br>
+<li> Fixed: When "match pair on the fly" was enabled the editor forced a
+center cursor periodically interfering with the movement using the scroll
+bars. Reported by Ivn and lvaro.
+<hr>v0.5.0 Release Candidate 1<p>
+<b>Revision</b> 1.274 2003/01/29 12:45:58 set<br>
+<li> Updated: project and makefiles because I added the PHP parser to libset
+and we are preparing for a release candidate.<p>
+<b>Revision</b> 1.273 2003/01/28 12:56:50 set<br>
+<li> Added: Last changes to distrib files in order to release the RC1.<p>
+<b>Revision</b> 1.272 2003/01/17 17:56:19 set<br>
+<li> Modified: [Linux] glibc 2.3.x deprecates the use of sys_errlist and
+the replacement (strerror) is available in glibc 2.2.x so now for
+glibc>=2.2.0 I use it. Reported by Andris.<p>
+<b>Revision</b> 1.271 2003/01/17 14:34:08 set<br>
+<li> Fixed: The function list failed for namespace::class::member()
+declarations. Reported by Andris.<br>
+<li> Fixed: It also failed for function(namespace::identifier).<p>
+<b>Revision</b> 1.270 2003/01/08 15:01:33 set<br>
+<li> Fixed: Bug in match pair highlight on the fly, using the wrong line as
+shl reference. Reported by Ivan.<p>
+<b>Revision</b> 1.269 2003/01/07 19:57:31 set<br>
+<li> Fixed: Wrong SHL parsing of empty lines that propagates strings when they
+are under edition. Reported by Ivan.<p>
+<b>Revision</b> 1.268 2003/01/07 19:12:54 set<br>
+<li> Modified: The SQL syntax to properly understand MySQL and PostgreSQL
+comments.<br>
+<li> Modified: Gave more priority to comments than simple symbols, should be
+carefully tested but it made SQL comments to fail. From Ivan report.<p>
+<b>Revision</b> 1.267 2003/01/06 20:18:22 set<br>
+<li> Added: An explanation about how to install setedit in the home directory
+and use it from any machine with access to it. Contributed by Grzegorz.<br>
+<li> Modified: Some macros to work with the Texinfo provided by Woody.<p>
+<b>Revision</b> 1.266 2003/01/06 13:54:09 set<br>
+<li> Updated: Grzegorz example on how to use macros to externally process
+portions of text.<p>
+<b>Revision</b> 1.265 2002/12/30 15:28:22 set<br>
+<li> Updated: POVRay SHL, from Martijn.<p>
+<b>Revision</b> 1.264 2002/12/30 15:24:44 set<br>
+<li> Modified: Removed the line len limitation in the syntaxhighlight loader.
+Asked by Martijn, he used more than 100 columns for POVRay SHL ;-)<p>
+<b>Revision</b> 1.263 2002/12/27 12:40:40 set<br>
+<li> Fixed: Added/Removed entries to the list of files.<br>
+<li> Added: A chmod to make the INSTALL script executable when generating the
+packages.<p>
+<b>Revision</b> 1.262 2002/12/20 15:44:40 set<br>
+<li> Fixed: Ivan forgot to comment STANDALONE in pphp.cc.<br>
+<li> Added: A new environment variable: SET_LOCALEDIR. It tells to the editor
+where to look for i18n files. That's useful when you have to install in the
+home directory. From a problem pointed out by Grzegorz.<br>
+<li> Added: Info about the new environment variable to the manpage and the
+Linux FAQ.<p>
+<b>Revision</b> 1.261 2002/12/14 23:00:14 terrible<br>
+<li> Modified: PHP Functions Parser: added benchmark results and a EXTRA_INLINE
+macro to activate the inlines that cause bloat but speed things (yes! because
+they are on the hot path and used very often), the default is to not inline
+those extra functions when compiling for the editor but inlining when
+compiling standalone. The default parameters on the function definitions are
+commented out instead of just not being there, I prefer that for code
+clarity.<p>
+<b>Revision</b> 1.260 2002/12/12 19:05:39 set<br>
+<li> Removed the cmeKeyboardSetUp option, it no longer exists. Now this is
+controlled by the input code page.<p>
+<b>Revision</b> 1.259 2002/12/12 19:04:31 set<br>
+<li> Modified: The greek keyboard tweak no longer compiles. Removed the code
+that prevented compilation.<p>
+<b>Revision</b> 1.258 2002/12/10 18:32:00 set<br>
+<li> Added: The new cyrillic and greek "repeated" symbols to the fonts.<p>
+<b>Revision</b> 1.257 2002/12/10 18:27:55 set<br>
+<li> Added: Last TV config keyword.<p>
+<b>Revision</b> 1.256 2002/12/10 14:13:55 set<br>
+<li> Added: Missing header for fonts conversion utility.<p>
+<b>Revision</b> 1.255 2002/12/09 13:23:53 set<br>
+<li> Fixed: Commented out atStartOfComment in pphp.cc, it isn't used.<p>
+<b>Revision</b> 1.254 2002/12/09 13:23:11 set<br>
+<li> Modified: Removed a lot of inline declarations in pphp.cc. They aren't
+good candidates for inline functions (no speed gain and code bloated).
+BC++ 5.5 made warnings about them.<br>
+<li> Fixed: un/signed comparisson in editmain.cc.<br>
+<li> Modified: BC++ 5.5 doesn't like empty declarations produced by 2
+consecutive ;.<p>
+<b>Revision</b> 1.253 2002/12/09 13:21:39 set<br>
+<li> Fixed: [Win32] gdi32 is needed to link. (new WinGr driver)<br>
+<li> Fixed: configuration library to output less error messages during tests.<br>
+<li> Fixed: default values in function declarations used in pphp.cc.<br>
+<li> Modified: [MinGW] edprefs.cc to workaround a name space pollution in
+MinGW headers. (grp1 and grp2).<p>
+<b>Revision</b> 1.252 2002/12/09 13:07:08 set<br>
+<li> Fixed: [DOS] The greek hack. It should go away.<p>
+<b>Revision</b> 1.251 2002/12/09 13:06:10 set<br>
+<li> Fixed: A bug in the painting shl routine used for user defined syntax
+highlights. Failed for commented lines starting with blank spaces
+(specially tabs) and with text after the end of comment.<p>
+<b>Revision</b> 1.250 2002/12/05 17:09:43 set<br>
+<li> Added: Spanish translations for "Save as DOS" and "Shell". Pointed out
+by Ivan.<p>
+<b>Revision</b> 1.249 2002/12/04 21:25:46 terrible<br>
+<li> Corrected typo in change.log: spect should be expect.<br>
+<li> Tested the editor, the Debian packaging didn't need any changes!<p>
+<b>Revision</b> 1.248 2002/12/03 12:36:28 set<br>
+<li> Fixed: The editor configured the secondary font using "screen" encoding
+at start-up.<br>
+<li> Fixed: We didn't signal the need of loading a secondary font at start-up,
+I forgot to implement it in TV.<p>
+<b>Revision</b> 1.247 2002/12/03 12:35:53 set<br>
+<li> Added: [DOS] FAQ entry explaining that NT doesn't implement WinOldAP and
+hence you can't copy/paste using it.<br>
+<li> Modified: [Linux] I heavily modified the Linux FAQ because now we have
+the X11 driver and it should remove most of the annoying limitations. I
+also added an entry explaining how to give access to /dev/vcs* to users.<p>
+<b>Revision</b> 1.246 2002/12/03 12:35:10 set<br>
+<li> Modified: Default global settings to be more similar to what a Windows
+user expects. Suggested by Ivan.<p>
+<b>Revision</b> 1.245 2002/12/03 12:34:18 set<br>
+<li> Modified: Removed all the conditionals for TV<2 and modified the
+configure script to request TV>=2.0.1.<p>
+<b>Revision</b> 1.244 2002/12/03 12:32:44 set<br>
+<li> Fixed: The special lines that doesn't exist are 0 and not -1.<p>
+<b>Revision</b> 1.243 2002/12/03 12:31:56 set<br>
+<li> Fixed: The KeyPad behavior. It is only for DOS driver. TV 2.0.1 is
+needed.<p>
+<b>Revision</b> 1.242 2002/12/03 12:31:19 set<br>
+<li> Added: More InfView commands to the commands parser used for sLisp and
+Menu files. I renamed the chcd* commands to cmh* so they can be parsed.
+I added a test example to the menubind.smn file. Closes SF FR #645731
+created by Martijn.<p>
+<b>Revision</b> 1.241 2002/11/29 12:50:22 set<br>
+<li> Modified: Now TV provides CLY_Beep for all platforms.<p>
+<b>Revision</b> 1.240 2002/11/27 17:35:12 set<br>
+<li> Fixed: When using Linux (without VCS access) and XTerm drivers and
+calling a child process in background the child shared the output file
+handle producing a nasty side effect. Now the stdout and stderr are dup2'ed
+in the child using the redirected file.<br>
+<li> Fixed: When creating new entries in the project they had an empty resume
+and it made the editor bomb at load time. Introduced by Ivan's request ...
+I knew it will blow something ;-), now the editor fills the propper field
+before saving and also workarounds wrong projects.<p>
+<b>Revision</b> 1.239 2002/11/27 13:11:58 set<br>
+<li> Added: A resumed list of new and fixed stuff to the distribution list.<p>
+<b>Revision</b> 1.238 2002/11/26 12:51:12 set<br>
+<li> Added: An LRU algorithm to remove entries in the closed list, as
+suggested by Ivan. I changed (once again) the resume structure to add the
+time stamp of the resume. Expect all kind of stupid side effects, flames
+go to Ivan for the idea ;-)<p>
+<b>Revision</b> 1.237 2002/11/26 12:50:17 set<br>
+<li> Fixed: The GetSelection sLisp command read one extra character in a
+string copy. Only detectable thanks to efence (not harmful).<p>
+<b>Revision</b> 1.236 2002/11/20 17:33:51 terrible<br>
+<li> Fixed: the editor didn't like the carriage returns, tabs, etc. that the PHP
+parser was giving to him which is something very understandable, so we
+replace them toghether with comments (they disturb in the function list) by
+a single space.<br>
+<li> Fixed: off by 1 error on the PHP parser, tAddFunc function expects len to
+be the length of the string _including_ the ending 0 instead of the real
+length.<p>
+<b>Revision</b> 1.235 2002/11/12 14:09:15 set<br>
+<li> Fixed: [configuration] The --without-aa option didn't work. Reported by
+Martijn Versteegh.<br>
+<li> Fixed: [configuration] After disabling MP3 support it was impossible to
+enable it again without deleting the cache file. From a report by Martijn.<br>
+<li> Added: The new parser to BC++ and MSVC makefiles.<p>
+<b>Revision</b> 1.234 2002/11/12 13:12:39 set<br>
+<li> Added: Linked the PHP Parser that Ivn added to the list of available
+parsers. I'll think about the indentation, after all my "weird" indentation
+is almost the same used by GNU project ;-)<p>
+<b>Revision</b> 1.233 2002/11/11 21:47:40 terrible<br>
+<li> Modified: added bool, true, false, typename and using to the C++ syntax
+highlight (both the .shl file and editmain.cc).<br>
+<li> Added: PHP heuristic parser for function jumps and class recognition.
+Note: needs to be added to the building process and bufun.h, I don't have
+RHIDE so I can't do that myself, thanks :).
+Note 2: I am not as good as Salvador coding, but at least my indentation
+isn't so weird :-D, though if it is needed, I would indent it with Salvador's
+exotic style :-D, but if I am going to maintain it, I would prefer that it
+remains with my indentation style if possible.<p>
+<b>Revision</b> 1.232 2002/11/11 20:15:58 set<br>
+<li> Added: Now the matchpair and the complementary element jumps are affected
+by the syntax highlight. It was in the Feature Request for a long time and
+Ivan annoyed me to add it. It should be tested but seems to work,
+complementary elements only match if they belong to the same shl context.<p>
+<b>Revision</b> 1.231 2002/11/11 17:43:20 set<br>
+<li> Added: Now if you unindent uncommenting the editor checks that at least
+the first line is already indented, if not the operation is aborted.<br>
+<li> Fixed: When indenting a block using the arbitrary indent or comment
+indent the syntax highlight wasn't recomputed.<p>
+<b>Revision</b> 1.230 2002/11/11 16:21:22 set<br>
+<li> Fixed: A bug introduced by the 1.197 (SF number) revision. It fixed
+problems in the overwrite undo but introduced problems in the normal
+overwrite use ;-). Now I reverted part of the patch and added a specific
+fix. *** Overwrite still unstable ***<p>
+<b>Revision</b> 1.229 2002/11/08 12:42:45 set<br>
+<li> Added: Some keywords to HTML syntax highlight.<p>
+<b>Revision</b> 1.228 2002/11/08 12:40:44 set<br>
+<li> Added: A very limited XML syntax highlight, I'm trying to learn about it
+so it currently highlights what I know ;-)<p>
+<b>Revision</b> 1.227 2002/11/06 16:17:04 set<br>
+<li> Added: An option to generate HTML 4.01 + CSS in the HTML export.<p>
+<b>Revision</b> 1.226 2002/11/05 13:15:33 set<br>
+<li> Fixed: applycvs.pl failed to apply new files in the root of the module.<p>
+<b>Revision</b> 1.225 2002/11/05 13:13:33 set<br>
+<li> Fixed: Now when choosing to "never remember windows" the options "resume"
+isn't applied. Note it was possible to choose such a behavior by choosing
+not to remmember the cursor position. From a suggestion by Grzegorz.<p>
+<b>Revision</b> 1.224 2002/10/29 14:58:25 set<br>
+<li> Fixed: When specifying a new project from command line the preLoad
+mechanism failed giving a SIGSEGV. Reported by Grzegorz.<br>
+<li> Fixed: When specifying an existing project from command line the preload
+mechanism loaded the right desktop file but the second pass loaded the
+default desktop. From a report by Grzegorz.<br>
+<li> Added: Now is possible to indicate a project to load without the
+extension in the command line. From a report by Grzegorz.<p>
+<b>Revision</b> 1.223 2002/10/24 18:07:12 set<br>
+<li> Added: "latex" to the TeX extensions. Suggested by Grzegorz.<p>
+<b>Revision</b> 1.222 2002/10/07 19:25:22 set<br>
+<li> Fixed: The "insert key name" option was broken for TV 2.0.0.<br>
+<li> Added: / to PHP symbols as suggested by Ivan.<p>
+<b>Revision</b> 1.221 2002/10/04 01:01:10 terrible<br>
+<li> Updated: Debian packaging to version 0.5.0-0.4.<p>
+<b>Revision</b> 1.220 2002/10/02 13:08:30 set<br>
+<li> Added: A cursor restore after closing AAlib. That's just to test if it
+solves the SF issue #617251 submitted by Grzegorz. But I think this is a
+bug in AAlib or Linux kernel. I can't reproduce it in my system.<p>
+<b>Revision</b> 1.219 2002/10/02 12:59:50 set<br>
+<li> Added: Documentation for the new Screen, Encodings and Fonts options.<p>
+<b>Revision</b> 1.218 2002/09/23 12:45:07 set<br>
+<li> Fixed?: The TDskWin wrappers for InfView and the Clipboard deleted the
+windows intead of closing them. This can originate the use of already
+deleted objects because they remain inserted in the desktop. I saw it with
+efence, but I wonder why it wasn't exposed before, that's why I'm not sure
+about this fix.<br>
+<li> Fixed: The TDskWinPrj() objects didn't set the wS and hS members when a
+new project was created giving crazy window sizes when loading the desktop.<p>
+<b>Revision</b> 1.217 2002/09/23 12:43:30 set<br>
+<li> Added: More TV configuration file keywords.<p>
+<b>Revision</b> 1.216 2002/09/20 16:32:11 set<br>
+<li> Fixed: The editor didn't allow to save ReadOnly files using "Save As",
+that's the only way we have to make a ReadWrite copy, so now that's
+allowed. Before writing the status is changed to RW and if the save goes
+wrong is reverted to RO.<br>
+<li> Fixed: The selection adjust done when we leave a line under edition
+failed if the line had extra spaces at the end. I don't understand why the
+code comment said the right thing and the code had it wrong.<p>
+<b>Revision</b> 1.215 2002/09/18 12:33:44 set<br>
+<li> Added: DontMoveHiddenCursor to the tvrc syntax hl.<p>
+<b>Revision</b> 1.214 2002/09/18 12:32:43 set<br>
+<li> Added: The new TV config variables for DOS and XTerm drivers.<p>
+<b>Revision</b> 1.213 2002/09/16 14:43:08 set<br>
+<li> Fixed: The MP3 window character wasn't remapped after the last change.<br>
+<li> Added: The last TV configuration keywords to the shl file.<p>
+<b>Revision</b> 1.212 2002/09/13 12:30:31 set<br>
+<li> Fixed: Lack of string.h in edfonts.cc. Reported by Anton Ustyancev
+<anton@cinvest.chel.su>.<p>
+<b>Revision</b> 1.211 2002/09/13 12:28:07 set<br>
+<li> Fixed: [DOS] Lack of Uses_TVCodePage in loadfunc.cc when compiling using
+djgpp.<br>
+<li> Fixed: [DOS] When using the editor without djgpp the editor failed to
+find the internationalization files. Reported by Alex Lozano.<p>
+<b>Revision</b> 1.210 2002/09/12 18:15:27 set<br>
+<li> Modified: Removed code that used cmcUpdateCodePage, no longer needed.<br>
+<li> Fixed: When loading a desktop that used fonts the code didn't indicate
+the font was loaded and hence encoding changes didn't change the font
+encoding.<p>
+<b>Revision</b> 1.209 2002/09/12 18:14:17 set<br>
+<li> Fixed: When the desktop file for a project was missing the loading
+routine didn't signal the "pre-load" state skipping the screen data
+initialization and hence generating a SIGSEGV.<p>
+<b>Revision</b> 1.208 2002/09/12 18:13:31 set<br>
+<li> Modified: The default ManView colors as suggested by Ivan, now they are
+more coherent with InfView.<p>
+<b>Revision</b> 1.207 2002/09/12 01:16:26 terrible<br>
+<li> Fixed: typo in internac/es.po.<br>
+<li> Updated: Debian packaging to version 0.5.0-0.3.<p>
+<b>Revision</b> 1.206 2002/09/11 13:14:32 set<br>
+<li> Big code clean-up, I hope it isn't a big code breakage ;-)<br>
+<li> Modified: all references to ctype functions to use TVCodePage members.<br>
+<li> Added: application and input code page settings to InfView. Changed
+version to 0.2.8.<br>
+<li> Modified: Removed old code in codepage.cc and adapted InfView and SETEdit
+to only use the new TV code.<br>
+<li> Modified: Removed old code in edfonts.cc.<br>
+<li> Updated: Project dependencies.<p>
+<b>Revision</b> 1.205 2002/09/11 12:58:44 set<br>
+<li> Fixed: The encoding options dialog failed to revert default values when
+the user disabled the "force" option.<p>
+<b>Revision</b> 1.204 2002/09/10 19:07:29 set<br>
+<li> Fixed: [Big Endian] the hexadecimal syntax highlight could use unaligned
+memory.<p>
+<b>Revision</b> 1.203 2002/09/10 17:30:07 set<br>
+<li> Modified: The code pages dialog to show what currently is used by the
+driver in the cps that aren't forced.<p>
+<b>Revision</b> 1.202 2002/09/09 20:51:39 set [uid61297 <= Ugh! SF bug!]<br>
+<li> Modified: removed code used for old screen options dialog.<p>
+<b>Revision</b> 1.201 2002/09/09 13:33:54 set<br>
+<li> Fixed: InfView compilation detail, problem introduced in last rev (1.715
+in my home CVS 1.200 @SF)<p>
+<b>Revision</b> 1.200 2002/09/09 13:32:41 set<br>
+<li> Added: Support for the secondary OS clipboard to InfView (X11 selection).<br>
+<li> Added: Support fot copy from man page to: editor's clipboard, main OS
+clipboard and secondary OS clipboard.<br>
+<li> Removed: Old code I used to compile InfView with Sigala's port. Also
+removed some TV 1.x code.<p>
+<b>Revision</b> 1.199 2002/09/06 20:56:11 set<br>
+<li> Added: The first steps towards selection support in the manpage viewer.
+Isn't functional yet. Suggested by Ivan.<p>
+<b>Revision</b> 1.198 2002/09/06 18:47:01 terrible<br>
+<li> Updated Debian packaging to 0.5.0-2.<p>
+<b>Revision</b> 1.197 2002/09/06 16:12:11 set<br>
+<li> Fixed: A bug in the undo of text typed while using overwrite mode. It
+could unsynchronize the cursor position. Is amazing it was there after so
+much time. And the next is even worst:<br>
+<li> Fixed: When typing in overwrite mode the line length was wrongly
+computed. It wasn't too bad because it is computed again when the line is
+flushed but originated some nasty syntax highlight errors.<br>
+<li>** The fixes seems ok, but the overwrite mode should be temporally
+ considered unstable ***
+Both found while testing David's report.<p>
+<b>Revision</b> 1.196 2002/09/06 15:27:18 set<br>
+<li> Fixed: When restoring the settings of a closed window (or project item)
+the "overwrite" status wasn't reflected in the cursor shape. Reported by
+David A. Capello <dacap@users.sourceforge.net><p>
+<b>Revision</b> 1.195 2002/09/06 00:10:28 terrible<br>
+<li> Updated: Debian packaging to version 0.5.0-0.1.<p>
+<b>Revision</b> 1.194 2002/09/04 20:32:32 set<br>
+<li> Added: When the editor loads a file the "busy indicator" is used.<br>
+<li> Fixed: Added some rounding to the resume computations to make them more
+accurate.<br>
+<li> Fixed: Some problems that made the editor crash when opening a file from
+the windows list dialog and this process needed to show a messageBox. In
+this case the "closed file" entry was deleted but the list box didn't know
+it. So now is protected against it.<p>
+<b>Revision</b> 1.193 2002/09/04 18:16:48 set<br>
+<li> Modified: Now editor "resumes" stores coordinates in a relative way. The
+screen is 100% == 16384. When restoring the values they are computed
+according to the current screen size. In this way closed windows that were
+opened using another screen size are restored correctly.<p>
+<b>Revision</b> 1.192 2002/09/04 15:46:21 set<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.191 2002/09/04 13:14:37 set<br>
+<li> Added: The project windows are resized accroding to the desktop file when
+loading. Till now all the windows (from the dst) were resized but the
+project window (from the epr) wasn't. With this is quite smooth to load a
+project that was used with another desktop size.<p>
+<b>Revision</b> 1.190 2002/09/04 13:13:48 set<br>
+<li> Fixed: The TVOSClipboard::paste member returns a new[] allocated array
+and it should be freed usind delete[].<p>
+<b>Revision</b> 1.189 2002/09/04 13:13:04 set<br>
+<li> Modified: The middle button insert text at the cursor position not at the
+mouse position. I found the previous behavior annoying.<p>
+<b>Revision</b> 1.188 2002/09/03 13:48:26 set<br>
+<li> Fixed: Error in docs about delete left/right word. Reported by Chris
+Impens <ci@cage.rug.ac.be>.<p>
+<b>Revision</b> 1.187 2002/09/03 13:45:32 set<br>
+<li> Fixed: Now old desktop file information is also loaded translating to
+the new structure when isn't preloaded. Complex, no? :-P<br>
+<li> Modified: I reworked most of the palette stuff to adapt to the new
+scheme. Now the palettes are stored in disk only if changed.<p>
+<b>Revision</b> 1.186 2002/09/02 13:58:40 set<br>
+<li> Added: Now the driver dependent settings are stored in the desktop file.
+For this reason the desktop file format changed and I'm switching to
+version 0.5.0. Consider it ***UNSTABLE***<br>
+<li> Version: 0.5.0<br>
+<li> Added: The code needed to adapt to a desktop file change once we are
+already initialized (change of project for example). This seems to work,
+but I'm quite sure is full of bugs.<br>
+<li> Note: I was able to have different settings for X11 and Linux drivers in
+the same desktop file and properly handle a project with another fonts
+loaded. But it was hard to get working so I think a lot of work will be
+needed before it works for all the cases.<p>
+<b>Revision</b> 1.185 2002/09/02 13:54:41 set<br>
+<li> Modified: [DOS] Now -b/B are now deprecated in favor of the BIOSKey TV
+configuration option, but is supported.<br>
+<li> Modified: [DOS] Ctrl+Break is now blocked, the idiot that put Break just
+above PageUp should be killed.<br>
+<li> Added: BIOSKey TV config keyword.<p>
+<b>Revision</b> 1.184 2002/09/02 13:53:49 set<br>
+<li> Modified: [DOS] The installer now uses cwsdpmi and a regular stub. I
+changed it because A) A user reported problems in SF bug tracker and B)
+cwsdpmi is much more reliable than pmodedj. SF bug #594116.<p>
+<b>Revision</b> 1.183 2002/08/27 17:21:41 set<br>
+<li> Added: DontResizeToCells TV configuration keyword.<p>
+<b>Revision</b> 1.182 2002/08/26 13:41:48 set<br>
+<li> Added: ExtProgVideoMode and VideoMode TV config file keywords.<br>
+<li> Added: More code for the video mode options. Next step will be save the
+options.<p>
+<b>Revision</b> 1.181 2002/08/26 13:40:48 set<br>
+<li> Modified: Moved edHelper and clipWindow to the main class.<br>
+<li> Modified: Moved some global functions related to the load desktop to the
+class as statics. Also modified some code to adapt for it.<br>
+<li> Modified: More code for the driver settings stuff, added a function to
+transfer the loaded values to the "config file" TV tree, the so member is
+now a pointer to the settings for the current driver in the settings
+collection, etc.<p>
+<b>Revision</b> 1.180 2002/08/23 15:22:46 set<br>
+<li> Added: HideCursorWhenNoFocus tvrc keyword.<p>
+<b>Revision</b> 1.179 2002/08/23 14:10:21 set<br>
+<li> Added: ScreenPalette to the tvrc syntax highlight.<br>
+<li> Added: More code to the preLoadDesktop, now is loading all the screen
+information from old desktop files.<br>
+<li> Added: Implemented TScOptsCol this collection will hold the settings for
+each driver.<br>
+<li> Modified: Palette code to support the preload.<br>
+<li> Modified: Removed more TV 1.x compatibility code.<p>
+<b>Revision</b> 1.178 2002/08/20 14:23:28 set<br>
+<li> Added: First step towards loading screen options before starting TV. It
+implies a "pre-load" of the desktop file loading only the screen related
+stuff. Currently I'm implementing what will become the "compatibility"
+code. The new desktop files (0.5.0) will store it in a better way and will
+have separated options for each driver.<p>
+<b>Revision</b> 1.177 2002/08/13 13:38:59 set<br>
+<li> Added: UseSecondaryFont TVRC keyword.<br>
+<li> Fixed: I declared some const char * const members as const char *. MSVC
+detected the subtle difference, gcc nor BC++ detected it.<p>
+<b>Revision</b> 1.176 2002/08/12 16:34:15 set<br>
+<li> Modified: Moved all the new screen related options to a structure and
+it + the functions to the main program class.<p>
+<b>Revision</b> 1.175 2002/08/12 16:33:23 set<br>
+<li> Added: Configuration for the new "Input Code Page". I succesfully edited
+a text encoded in CP 850 using X. The library translated ISO-1 input into
+CP850 codes.<p>
+<b>Revision</b> 1.174 2002/08/12 16:32:26 set<br>
+<li> Modified: [MinGW] Configure script to avoid generating rules for doc and
+internac. The MinGW tools I tested fail to make this targets. I think the
+reasons are: buggy makeinfo and command line length limitations in gettext
+tools.<br>
+<li> Modified: Included internac/po_list in the distribution, it can be
+generated using Perl but MinGW and Cygwin generates GPFs when running the
+perl script.<p>
+<b>Revision</b> 1.173 2002/08/12 16:31:18 set<br>
+<li> Modified: The default menu to say "Shell" instead of "DOS shell".<br>
+<li> Added: "Window|User screen" disabled if it doesn't exist.<p>
+<b>Revision</b> 1.172 2002/08/12 16:30:31 set<br>
+<li> Added: Code to avoid calling a shell if TScreen::noUserScreen() returns
+True. Also for InfView and for the Run Program "Use OS screen" option.<br>
+<li> Modified: Removed some TV 1.x code.<p>
+<b>Revision</b> 1.171 2002/08/12 16:23:21 set<br>
+<li> Fixed: Read out of bounds in man page viewer (detected by efence).<br>
+<li> Fixed: The ASCII window grown after a window resize.<p>
+<b>Revision</b> 1.170 2002/08/12 16:22:27 set<br>
+<li> Added: Copyright information about the fonts and convpcf1.cc<br>
+<li> Modified: The fonts dialog to keep the sizes well sorted, the
+alphabetical way is useless. Now is sorted by width and height (in this
+order).<p>
+<b>Revision</b> 1.169 2002/08/12 16:18:20 set<br>
+<li> Added: Three incomplete SFT files and a simple program to generate them
+from raw fonts. They just contain the first 256 symbols (CP 437) and in
+some cases the real symbols are just in the ASCII range the others are
+regular.<p>
+<b>Revision</b> 1.168 2002/08/12 16:15:54 set<br>
+<li> Fixed: Memory leaks in the new fonts code.<p>
+<b>Revision</b> 1.167 2002/07/30 17:46:54 terrible<br>
+<li> Updated: Debian packaging to 0.4.57-0.4.<br>
+<li> Modified: my email changed from lubaldo to ibaldo.<br>
+<li> Broked: everything, this is a sabotage!, SET is on vacations!!!<p>
+<b>Revision</b> 1.166 2002/07/25 17:25:49 set<br>
+<li> Fixed: InfView changed to use unique_name, but as it was working it
+didn't copy the real file name to the referenced buffer and it made InfView
+fail to remove temporal files used to uncompress .info files. Now
+unique_name does the copy. It didn't affect UNIX systems.<br>
+<li> Modified: All the calls to unique_name using 0 as second parameter (is
+the default value).<br>
+<li> Added: A fonts request call back, so now if you change the video mode and
+the new mode uses a font with a different size the call back can provide
+it. Currently it only helps for DOS.<p>
+<b>Revision</b> 1.165 2002/07/24 20:03:22 set<br>
+<li> Added: The "Fonts" dialog now works, the options aren't stored to disk
+yet but you can play with it. I tested a 2 fonts configuration under X11
+and put a snapshot in the site.<br>
+<li> Fixed: The command line option -d N generated a SIGSEGV.<p>
+<b>Revision</b> 1.164 2002/07/23 16:38:25 set<br>
+<li> Added: [MSVC] /verbose to the link stage to get more information about
+the linking problems.<p>
+<b>Revision</b> 1.163 2002/07/22 20:39:13 set<br>
+<li> Fixed: [MSVC] makefile. Patch by WintiX.<br>
+<li> Modifed: [MSVC] the screensaver sources to investigate the sources of
+problems when linking with MSVC.<p>
+<b>Revision</b> 1.162 2002/07/22 19:41:14 set<br>
+<li> Added: Connected the primary font collection with the available sizes.<p>
+<b>Revision</b> 1.161 2002/07/22 19:40:35 set<br>
+<li> Added: A fonts dialog. Currently does nothing, just shows some options.<br>
+<li> Added: SFT files to UNIX distro.<br>
+<li> Removed: Some code from edfonts that I moved to TV.<p>
+<b>Revision</b> 1.160 2002/07/22 19:39:12 set<br>
+<li> Added: Font10x20 keyword to TV config files.<br>
+<li> Added: Warning about error in let.txt about 0x2578-0x257B unicodes that
+comes from Linux fonts errors.<br>
+<li> Added: A 10x20 SFT.<p>
+<b>Revision</b> 1.159 2002/07/22 19:20:38 set<br>
+<li> Modified: getopt calls to use the new CLY_* methode.<p>
+<b>Revision</b> 1.158 2002/07/19 20:45:54 set<br>
+<li> Roll back of bzlib patch.<br>
+<li> Modified: [MSVC] makefile to avoid command line limitations. Untested.<br>
+<li> Fixed: Collisions between spec.cc and edspec.cc reported by MSVC from
+output by WintiX.<p>
+<b>Revision</b> 1.157 2002/07/19 14:44:57 set<br>
+<li> Fixed: bzip2 newer than 1.x uses BZ2_bzlibVersion and my test only tried
+bzlibVersion. Pointed out by Andris.<br>
+<li> Added: Search for TV in /usr/local for all UNIX systems. Patch by Andris.<p>
+<b>Revision</b> 1.156 2002/07/19 14:03:49 set<br>
+<li> Fixed: Unconditional MP3 code pull in editmain.cc.<p>
+<b>Revision</b> 1.155 2002/07/17 17:27:32 set<br>
+<li> Fixed: [MSVC] The following sequence: type */* comment */ doesn't confuse
+gcc nor SETEdit, but makes MSC emit a warning. From output by WintiX.<p>
+<b>Revision</b> 1.154 2002/07/16 19:40:09 set<br>
+<li> Fixed: [MSVC] 3 more errors sent by WintiX (ceditor.cc).<p>
+<b>Revision</b> 1.153 2002/07/16 19:31:18 set<br>
+<li> Modified: MP3 dialog buttons to behave better after a recode.<br>
+<li> Added: TSButtonRef wrapper for TButtonRef.<br>
+<li> Added: First step to adapt the code to the new recoding scheme using a
+callback.<br>
+<li> Added: Code to the new Encodings dialog, now works but only if no fonts
+are loaded.<p>
+<b>Revision</b> 1.152 2002/07/16 13:19:28 set<br>
+<li> Added: The first part of the new encodings settings stuff. This is
+complex and implies important changes.<p>
+<b>Revision</b> 1.151 2002/07/15 18:13:52 set<br>
+<li> Added: AA-lib support for UNIX targets. Also ported the Plasma effect and
+made it support any resolution.<p>
+<b>Revision</b> 1.150 2002/07/12 16:48:42 set<br>
+<li> Modified: [MSVC] avoided the inclusion of bzlib.h from ceditor.cc because
+it includes windows.h and this hence collides. Also removed _WIN32 from
+bzlib compilation, it doesn't have any sense for static link. Problem
+found from cl preprocessor output sent by WintiX.<p>
+<b>Revision</b> 1.149 2002/07/11 19:14:00 set<br>
+<li> Fixed: [MSVC] Small details to get it compiled. Most of them just
+involves proper use of compatlayer. From output sent by WintiX.<p>
+<b>Revision</b> 1.148 2002/07/10 19:22:09 set<br>
+<li> Modified: Temporally disabled font support because it isn't compatible
+with last TV changes.<p>
+<b>Revision</b> 1.147 2002/07/08 15:43:31 set<br>
+<li> Fixed: [MSVC] Small details to get it compiled. Most of them just
+involves proper use of compatlayer. From output sent by WintiX.<p>
+<b>Revision</b> 1.146 2002/07/08 14:30:52 set<br>
+<li> Fixed: One preprocessor combination that fooled the functions parser.
+Reported by David A. Capello <dacap@users.sourceforge.net>.<p>
+<b>Revision</b> 1.145 2002/07/05 20:29:40 set<br>
+<li> Fixed: [MSVC] small makefile details from WintiX.<p>
+<b>Revision</b> 1.144 2002/07/05 12:49:54 set<br>
+<li> Fixed: [MSVC] libpcre should be linked statically, added -DSTATIC. From
+warning sent by WintiX.<br>
+<li> Fixed: [MSVC] minor details in makefiles. Suggested by WintiX.<p>
+<b>Revision</b> 1.143 2002/07/04 19:30:45 set<br>
+<li> Fixed: [MSVC] warnings from nmake in libz/Makefile.nmk. Patch from
+WintiX, he successfuly used it to create libz.lib.<br>
+<li> Added: [MSVC] libbzip2 and libpcre makefiles.<p>
+<b>Revision</b> 1.142 2002/07/03 18:27:49 set<br>
+<li> Added: First versions of MSVC makefile and libz makefile.<p>
+<b>Revision</b> 1.141 2002/07/02 20:50:00 set<br>
+<li> Added: Mouse Wheel support. Currently works with X11 driver.<p>
+<b>Revision</b> 1.140 2002/07/02 18:09:39 set<br>
+<li> Added: [UNIX] Xmu to the X11 libs. It isn't needed for dynamic linking.<p>
+<b>Revision</b> 1.139 2002/07/01 13:31:09 set<br>
+<li> Fixed: One spanish translation pointed out by Ivan.<p>
+<b>Revision</b> 1.138 2002/07/01 13:12:21 set<br>
+<li> Fixed: Crash in InfView when no desktop file was available.<p>
+<b>Revision</b> 1.137 2002/07/01 13:10:53 set<br>
+<li> Fixed: A read out of bounds in the InfView draw routine. Detected by
+efence (of by 1).<p>
+<b>Revision</b> 1.136 2002/07/01 13:09:50 set<br>
+<li> Added: Support for the new TVOSClipboard I added to Turbo Vision 2.0
+replacing the old extra/winoldap.cc code.<br>
+<li> Added: Support for a secondary OS clipboard used to copy/paste
+selections. That's for the X11 XA_PRIMARY selection mechanism. Now every
+time text is selected in the editor this is "copied" to X11 clipboard. The
+middle mouse button does the paste.<p>
+<b>Revision</b> 1.135 2002/06/28 12:37:20 set<br>
+<li> Fixed: A read out of bounds in the input line of the calculator. I must
+check it better because I think that's a bug in Turbo Vision. It isn't
+really important but isn't correct and efence SIGSEGVs.<p>
+<b>Revision</b> 1.134 2002/06/28 12:36:29 set<br>
+<li> Modified: The editor now checks if the screen saver is suitable for the
+current driver.<p>
+<b>Revision</b> 1.133 2002/06/27 18:08:58 set<br>
+<li> Fixed: Another use of a class after releasing the memory. Reported by
+efence.<p>
+<b>Revision</b> 1.132 2002/06/25 15:40:38 set<br>
+<li> Added: Syntax highlight for the Turbo Vision configuration files.<p>
+<b>Revision</b> 1.131 2002/06/24 19:48:28 set<br>
+<li> Added: PHP syntax highlight, contributed by "Richard Vrijhof"
+<R.J.Vrijhof@bigfoot.com>.<p>
+<b>Revision</b> 1.130 2002/06/24 16:03:27 set<br>
+<li> Fixed: [BC++] The sutil difference between struct Name and a typedef for
+it under C++. GCC treats both same way, but BC++ don't.<p>
+<b>Revision</b> 1.129 2002/06/24 16:02:14 set<br>
+<li> Fixed: Patchen.pl script.<p>
+<b>Revision</b> 1.128 2002/06/24 16:01:29 set<br>
+<li> Fixed: mp3play.h should be included only for the editor and not InfView
+in the codepage part.<p>
+<b>Revision</b> 1.127 2002/06/20 20:11:05 set<br>
+<li> Fixed: When starting the editor with a remmembered file that no longer
+exists located in a directory where we don't want backups the editor
+removed the dektop structure from the list and inmediatly used it. This
+wasn't detected until it happend with efence linked.<p>
+<b>Revision</b> 1.126 2002/06/20 20:09:42 set<br>
+<li> Modified: Now that TV can inform if the driver supports changing the
+shape of the cursor I use I/O indicator only if needed.<p>
+<b>Revision</b> 1.125 2002/06/19 15:01:19 set<br>
+<li> Fixed: The Desktop background recoding, it changed in new TV. Also added
+recode to the MP3 and calendar.<p>
+<b>Revision</b> 1.124 2002/06/19 15:00:19 set<br>
+<li> Modified: The applycvs.pl tool to support new files, needs some adjusts
+but can be used.<p>
+<b>Revision</b> 1.123 2002/06/19 14:59:24 set<br>
+<li> Added: Euro symbol to the fonts. I put the same drawing for all, this
+should be fixed, but that's better than nothing.<p>
+<b>Revision</b> 1.122 2002/06/18 16:30:35 set<br>
+<li> Added: Support for QNX to the configuration mechanism. Patches by Mike
+Gorchak <mike@malva.ua>.<p>
+<b>Revision</b> 1.121 2002/06/18 15:08:19 set<br>
+<li> Fixed: The config.pl failed to detect intl support becasue TV include
+was absent. Introduced in last changes. Reported by Ivan.<p>
+<b>Revision</b> 1.120 2002/06/18 15:06:41 set<br>
+<li> Added: Tasm 2.02 errors parser. Contributed by Alex Lozano.<p>
+<b>Revision</b> 1.119 2002/06/11 19:07:51 set<br>
+<li> Fixed: codepage code to support changes in TV 2.0.<p>
+<b>Revision</b> 1.118 2002/06/10 13:12:16 set<br>
+<li> Updated: README to clarify a little bit the available Win32 options. I
+tested MinGW+MSys+SiePerl as suggested by Thiago.<br>
+<li> Fixed: When no intl lib is available we must try using tvfintl (provided
+by TV lib).<br>
+<li> Fixed: Targets where the prefix have back-slashes. The prefix is used in
+the code and must contain escaped back-slashes.<br>
+<li> Added: palconv.h and palfte.h to the distribution.<br>
+<li> Fixed: patchenv.pl now is more cleaver and solves problems introduced in
+last RHIDE versions. I tried gprexp as Robert suggested but it make things
+even worst.<br>
+<li> Fixed: PCRE for Win32 targets defaults to a DLL, avoided in editmain.cc.<p>
+<b>Revision</b> 1.117 2002/06/10 13:11:19 set<br>
+<li> Modified: When the editor fails to load a desktop file (wrong version,
+corrupted file, wrong access rights, ect.) the editor tries to load the
+global desktop file.<p>
+<b>Revision</b> 1.116 2002/06/10 13:09:45 set<br>
+<li> Fixed: When browsing the list of errors and selecting an error reported
+in a non-existant file the editor opened an empty buffer.<p>
+<b>Revision</b> 1.115 2002/06/10 13:08:36 set<br>
+<li> Added: Support for try/catch not in the body of a C++ function for the
+list of functions. It passes a couple of tests Andris sent me.<br>
+<li> Fixed: C++ operators parsing in the list of functions.<br>
+<li> Modified: Now if we find two identical functions (most probably only one
+is really used at compile time) both are listed in the list of functions.
+To differentiate the functions the starting line is added.<br>
+<li> Fixed: A search in the list functions stack wasted extra stack space.<p>
+<b>Revision</b> 1.114 2002/06/10 13:07:28 set<br>
+<li> Added: A script to apply the synmail patches to my CVS copy at home.<p>
+<b>Revision</b> 1.113 2002/06/07 19:03:34 set<br>
+<li> Modified: [UNIX] the configuration to test if the X11 include directory
+is really needed. It looks like gcc 3.1 gives a warning if this is manually
+specified. Is a test because I don't have gcc 3.1 for Linux. Reported by
+Andris.<p>
+<b>Revision</b> 1.112 2002/06/07 02:18:36 terrible<br>
+<li> Updated: Debian packaging with small changes.<p>
+<b>Revision</b> 1.111 2002/06/06 19:41:12 set<br>
+<li> Added: [DOS] An entry to the FAQ about problems with the mouse while
+using NT, W2k, XP, and similar crap. From a post to RHIDE list posted by
+James Doyle and Tom Verhoeff.<p>
+<b>Revision</b> 1.110 2002/06/04 19:42:57 set<br>
+<li> Modified: Now the configuration determines the directories where extra
+libraries could be located and adds it to the list of directories.<p>
+<b>Revision</b> 1.109 2002/06/04 15:36:48 set<br>
+<li> Modified: To use the moved TView::specialChars (TV 2.0).<p>
+<b>Revision</b> 1.108 2002/06/04 13:26:30 set<br>
+<li> Modified: I dropped the code that workarounds all bugs in libstdc++. I
+think it was in gcc 2.7.x or perhaps 2.6.3. The code still there but just
+disabled. This will allow working with the new gcc 3.1 that drops any
+kind of C++ connected to a C stream/file handle.<p>
+<b>Revision</b> 1.107 2002/06/03 13:53:02 set<br>
+<li> Fixed: [DOS] TViewPlus to compile with TV 2.0.<p>
+<b>Revision</b> 1.106 2002/06/03 13:52:00 set<br>
+<li> Fixed: The shipped gettext is only usable for djgpp. Looks like MinGW
+target tried to use it with logical fails. Reported by Thiago.<p>
+<b>Revision</b> 1.105 2002/06/03 13:50:54 set<br>
+<li> Added: [Win32] According to Thiago newer versions of MinGW have their own
+uname command that reports MINGW32_<windows flavor>. Added to the
+conflib.pl.<p>
+<b>Revision</b> 1.104 2002/05/30 17:30:05 set<br>
+<li> Added: Support for the TV 2.0 palette handling. Seems to work for Linux
+console.<p>
+<b>Revision</b> 1.103 2002/05/27 19:58:17 set<br>
+<li> Modified: [Solaris] Removed debug printfs in audio code.<br>
+<li> Modified: [Linux] Added some code that should avoid big endian issues
+with the sample format, Martijn van Buul, needs testing.<p>
+<b>Revision</b> 1.102 2002/05/27 19:36:23 set<br>
+<li> Fixed: [Solaris] the audio problems, now we can play MP3!! The big endian
+issue was solved with the help of Martijn van Buul <pino@dohd.org> (PowerPC
+user of a library derived from splay) and Mikael Hedin <mikael.hedin@irf.se>
+currently maintainer of splay. I also fixed some stuff in the Solaris
+audio code, now seems to work quite nice.<p>
+<b>Revision</b> 1.101 2002/05/20 18:08:31 set<br>
+<li> Fixed: References to SendToTerminal, no longer used in TV 2.0.<p>
+<b>Revision</b> 1.100 2002/05/20 17:59:44 set<br>
+<li> Fixed: Removed linuxRH52 references no longer used by TV 2.0.<p>
+<b>Revision</b> 1.99 2002/05/20 16:52:07 set<br>
+<li> Added: Now InfView sets the window title. Suggested by Ivan.<p>
+<b>Revision</b> 1.98 2002/05/17 15:33:04 set<br>
+<li> Added: "Vertical project window" options, SF FR #553029. Saved to the
+desktop file, documented, updated spanish translations.<br>
+<li> Changed: version to 0.4.57.<p>
+<b>Revision</b> 1.97 2002/05/17 14:29:56 set<br>
+<li> Added: The first part of Grzegorz request about adding options to create
+message and project windows in the vertical direction.<p>
+<b>Revision</b> 1.96 2002/05/17 14:27:24 set<br>
+<li> Fixed: The show match pair on the fly without waiting had another
+interaction with the syntax highlight computation (I already fixed one).<p>
+<b>Revision</b> 1.95 2002/05/16 21:24:21 set<br>
+<li> Fixed: TV link in copyrigh.<p>
+<b>Revision</b> 1.94 2002/05/16 21:23:44 set<br>
+<li> Modified: When the editor generates code for a recorded macro it now uses
+\t instead of an ASCII 9 embedded in the string. Suggested by Thiago.<p>
+<b>Revision</b> 1.93 2002/05/15 19:05:39 set<br>
+<li> Fixed: Default CFLAGS for FreeBSD used -L/usr/local/include. Reported by
+miniEleph (Andrew 'Onyx' Shevtsov).<p>
+<b>Revision</b> 1.92 2002/05/14 14:40:12 set<br>
+<li> Added: Now mpegsound library should detect SPARC as big endian. I don't
+know if it will be enough to get it working for Suns.<p>
+<b>Revision</b> 1.91 2002/05/13 18:33:44 set<br>
+<li> Modified: [UNIX] tar detection according to miniEleph info and separated
+tar from gzip calls. Is easier to find tar + gzip than GNU tar (-z option)
++ gzip.<p>
+<b>Revision</b> 1.90 2002/05/13 15:59:49 set<br>
+<li> Fixed: Endian issues related to drawLines when filling the empty lines
+at the end of files. Tested in an Ultra SPARC 60 thanks to Alex.<p>
+<b>Revision</b> 1.89 2002/05/13 13:45:48 set<br>
+<li> Fixed: When I switched to unique_name the code that converts UNIX->DOS
+and DOS->UNIX left the temporal. Now fixed.<p>
+<b>Revision</b> 1.88 2002/05/13 12:50:21 set<br>
+<li> Test: for big endian issue.<p>
+<b>Revision</b> 1.87 2002/05/13 12:41:04 set<br>
+<li> Modified: [UNIX] Now the FHS detection is more strict, the existance of
+share/doc is not enough, share/man and shared/info must exist.<br>
+<li> Fixed: [UNIX] The FHS detection looks in $prefix and not in /usr.<br>
+<li> Added: [FreeBSD] According to miniEleph in this case /share/doc is used
+but not shared/info nor shared/man.<p>
+<b>Revision</b> 1.86 2002/05/13 12:36:53 set<br>
+<li> Modified: [UNIX] Now the INSTALL.LINUX script is just called INSTALL.
+The script will work for FreeBSD and Solaris and is stupid to ask a BSD
+user to run "INSTALL.LINUX" ;-)<p>
+<b>Revision</b> 1.85 2002/05/13 12:32:51 set<br>
+<li> Fixed: Currently gettext is preconfigured only for djgpp so we should
+copy the djgpp.h to config.h header anyways.<br>
+<li> Fixed: confignt.pl used winnt directory instead of WinNT.<br>
+<li> Modified: Now the INSTALL.MAK file is configured to reflect the
+configured prefix (it was failing) and to support Solaris install tool.<p>
+<b>Revision</b> 1.84 2002/05/13 12:30:28 set<br>
+<li> Modified: Commented what parts of the Rawplayer class is really needed by
+the editor and what sizes are used (bytes, not samples). I also modified
+Solaris code to implement things this way.<p>
+<b>Revision</b> 1.83 2002/05/08 13:48:54 set<br>
+<li> Added: A new color scheme contributed by Thiago. It is dark (console
+style) plus some VIM like SHL.<p>
+<b>Revision</b> 1.82 2002/05/07 12:54:46 set<br>
+<li> Fixed: palfte.h didn't end with \n and failed for gcc 3.x. Patch by
+Andris.<p>
+<b>Revision</b> 1.81 2002/05/06 15:13:46 set<br>
+<li> Added: [FreeBSD] Support for libintl. Changes suggested by miniEleph
+<nyxo@dnuc.polyn.kiae.su>.<p>
+<b>Revision</b> 1.80 2002/05/06 14:52:08 set.<br>
+<li> Added: X11R6 include directory to the configuration script. It looks like
+this directory isn't automagically included in FreeBSD. Also added options
+to configure it -x-include and -x-lib. Reported by miniEleph
+<nyxo@dnuc.polyn.kiae.su>.<p>
+<b>Revision</b> 1.79 2002/05/02 19:35:38 set<br>
+<li> Modified: The use of tmpnam, now I use unique_name, based on mkstemp. It
+seems to be more secure.<p>
+<b>Revision</b> 1.78 2002/05/02 19:34:13 set<br>
+<li> Added: Support for Electric Fence to the configuration script.<p>
+<b>Revision</b> 1.77 2002/05/02 19:33:22 set<br>
+<li> Added: libdl detection to config.pl. Looks like some new library
+combinations (XFree86 4.2.0 + glibc 2.2.5) needs it. Time will say if this
+should be more optional. From problems reported by Andris to create a
+static editor with X11 support.<p>
+<b>Revision</b> 1.76 2002/04/30 19:40:13 set<br>
+<li> Fixed: InfView to compile with TV 2.0. As Andris tried to test it and
+couldn't I though it was time to fix the problems ;-)<p>
+<b>Revision</b> 1.75 2002/04/30 18:08:57 set<br>
+<li> Added: Ctrl+Arrows support to InfView. Suggested by Thiago (I think other
+people asked for it, Ivan?).<p>
+<b>Revision</b> 1.74 2002/04/30 18:00:55 set<br>
+<li> Added: An option to save a desktop file in the current directory. Useful
+for users that use a central desktop and don't want to create a project.<p>
+<b>Revision</b> 1.73 2002/04/30 17:56:12 set<br>
+<li> Modified: Now ~/setedit/.tcedit.dst have more priority than ~/tcedit.dst.<p>
+<b>Revision</b> 1.72 2002/04/29 15:07:15 set<br>
+<li> Fixed: A rare crash in InfView. Reported by Andris.<p>
+<b>Revision</b> 1.71 2002/04/29 15:06:01 set<br>
+<li> Added: Syntax highlight for "Flat Assembler", contributed by "Matt C."
+<talktomatt@egl.net><p>
+<b>Revision</b> 1.70 2002/04/29 15:05:13 set<br>
+<li> Added: Example on how to bind a key to a filter, contributed by Grzegorz.<p>
+<b>Revision</b> 1.69 2002/04/29 15:02:11 set<br>
+<li> Added: An option to select a "Color Theme", currently only the "Default"
+and "FTE like" themes are available. Suggested by Ivan (he contributed the
+FTE Like theme).<p>
+<b>Revision</b> 1.68 2002/04/29 15:00:10 set<br>
+<li> Fixed: [Linux] Now ask_config is executed only once.<p>
+<b>Revision</b> 1.67 2002/04/29 14:58:24 set<br>
+<li> Fixed: roll-back of a FreeBSD patch that makes Linux use -lintl, this is
+not the way.<br>
+<li> Fixed: Now ask_config.sh is copied to the editor's distribution.<p>
+<b>Revision</b> 1.66 2002/04/22 19:00:05 set<br>
+<li> Modified: Some details to cleanly compile under FreeBSD. Some details
+still need a solution. Some things changed: use of gmake instead of make,
+use of time in favor of ftime, support for BSD find, use of intl lib,
+default prefix, etc. From patches by miniEleph <nyxo@dnuc.polyn.kiae.su><p>
+<b>Revision</b> 1.570 2002/04/21 14:57:19 set<br>
+<li> Fixed: Wrong separator detection in tools/cvssget.<p>
+<b>Revision</b> 1.569 2002/04/21 14:37:42 set<br>
+<li> Fixed: Some code that compiled only for TV 2.0.<p>
+<b>Revision</b> 1.65 2002/04/15 13:57:48 set<br>
+<li> Fixed: More potential buffer overflows because of the use of L_tmpnam.
+Patches suggested by Andris.<p>
+<b>Revision</b> 1.64 2002/04/08 14:11:53 set<br>
+<li> Fixed: Buffer overflow in temporary names created by infview. Patch by
+Andris.<p>
+<b>Revision</b> 1.63 2002/03/26 13:40:55 set<br>
+<li> Fixed: use of popen(...,"rt") that fails for glibc 2.2.5. Patch by Andris.<p>
+<b>Revision</b> 1.62 2002/02/22 12:27:51 set<p>
+<b>Revision</b> 1.568 2002/02/21 23:47:38 set<br>
+<li> Added: Support for TV 2.0.0, lamentably it doesn't work reliably (no
+target is working ok).<p>
+<b>Revision</b> 1.61 2002/02/20 19:56:44 set
+<b>Revision</b> 1.567 2002/02/20 01:13:21 set<br>
+<li> Fixed?: A potential source of reported SIGSEGVs in Tool&Ops|Options|Run
+program. If no desktop is loaded is possible to have CurrentParser==0 and
+it generates a GPF. Could fix a report by David Z Kil
+<zosodk69@fuckmicrosoft.com>.<p>
+<b>Revision</b> 1.566 2002/02/20 01:55:39 set
+<b>Revision</b> 1.59 2002/02/15 18:19:46 set<br>
+<li> Fixed: Missing functions in rhideint.cc and unused variable in dstfile.cc.
+Patch by Andris needed to compile last CVS of RHIDE.<p>
+<b>Revision</b> 1.565 2002/02/20 01:52:15 set
+<b>Revision</b> 1.58 SF 2002/02/08 00:33:59 terrible<br>
+<li> Modified: made distrib/ask_config.sh Unix bourne shell script based on
+distrib/ask_config.pl Perl script as Salvador wanted and removed the Perl
+script. I will reindent it if Salvador likes.<p>
+<b>Revision</b> 1.564 2002/02/20 01:46:24 set
+<b>Revision</b> 1.57 SF 2002/02/06 20:08:09 set<br>
+<li> Added: Configuration questions to the DOS installer. Closes SF FR #510516.<br>
+<li> Modified: Now the options are stored in install.log (already used by the
+DOS installer to store installation data).<br>
+<li> Updated: Spanish translation and german file.<p>
+<b>Revision</b> 1.563 2002/02/20 01:40:15 set
+<b>Revision</b> 1.56 SF 2002/02/06 15:49:25 set<br>
+<li> Added: Now if no desktop file can be found the editor looks for a plain
+text file containing some options to configure: 1) Creation of one central
+desktop or one each dir, 2) Use of tabs or spaces for indentation and 3)
+Backup files creation. Currently this file is created by a simple perl
+script called by INSTALL.LINUX but I'll incorporate it to DOS/Win32
+installer and maybe Ivan will add it to the .deb options. Suggested by Ivan<p>
+<b>Revision</b> 1.562 2002/02/20 01:34:47 set
+<b>Revision</b> 1.55 SF 2002/02/06 14:54:05 set<br>
+<li> Fixed: The code to use last patched TV 1.1.4 that solves gcc 3.x issues.<p>
+<b>Revision</b> 1.561 2002/02/20 01:26:54 set
+<b>Revision</b> 1.54 SF 2002/02/05 14:16:16 set<br>
+<li> Added: Now when the editor warms about a R.O. file the dialog says the
+name of the file.<p>
+<b>Revision</b> 1.560 2002/02/20 01:24:37 set
+<b>Revision</b> 1.53 SF 2002/02/05 13:56:13 set<br>
+<li> Added: Explanation about the difference between lat1 and lat1u fonts,
+also about the damaged lat1 fonts to Linux FAQ.<p>
+<b>Revision</b> 1.559 2002/02/04 23:58:22 set
+<b>Revision</b> 1.52 SF 2002/02/04 20:38:41 set<br>
+<li> Added: A clipboard mechanism based on a special file. This is specially
+useful for Linux where no clipboard can share data between X and the
+console. Suggested by Grzegorz. SF FR #479359.<br>
+<li> Added: Documentation and entry menues for it, also grayed the copy when
+nothing is available for copying.<br>
+<li> Fixed: The regular copy command (and others) wasn't grayed when a
+selection existed but was hidded.<p>
+<b>Revision</b> 1.558 2002/02/04 23:54:20 set
+<b>Revision</b> 1.51 SF 2002/02/04 19:29:13 set<br>
+<li> Added: Explanation about tabs settings in DOS and Linux FAQs, also to the
+documentation. Triggered by a question of Ivan and chris <sscanf@gmx.net>.<p>
+<b>Revision</b> 1.557 2002/02/04 23:52:07 set
+<b>Revision</b> 1.50 SF 2002/02/04 19:08:33 set<br>
+<li> Added: Now when the user sets the "Use Tabs" option the editor checks if
+other options commonly used with tabs are also coherent. If not an advice
+dialog is created. Suggeste by Ivan. SF FR # 510514.<p>
+<b>Revision</b> 1.556 2002/02/04 23:45:18 set
+<b>Revision</b> 1.49 SF 2002/02/04 15:32:08 set<br>
+<li> Fixed: ncurses 5.2 collision in intgrep.cc. Patch by Andris.<p>
+<b>Revision</b> 1.555 2002/02/04 23:43:26 set
+<b>Revision</b> 1.48 SF 2002/02/04 15:23:29 set<br>
+<li> Fixed: The use of tmpnam and mktemp is currently deprecated so I changed
+it to use mkstemp. Pointed out by Andris (last Linux tools reports it).<p>
+<b>Revision</b> 1.554 2002/02/04 23:39:11 set
+<b>Revision</b> 1.47 SF 2002/02/04 14:16:54 set<br>
+<li> Fixed: compilation problems with gcc 3.0.x in mixoss.c. Patch by Andris.<p>
+<b>Revision</b> 1.553 2002/02/04 23:35:58 set
+<b>Revision</b> 1.46 SF 2002/02/01 19:04:25 set<br>
+<li> Added: Options to avoid reseting the horizontal position of the message
+window when new entries are added. Suggested by David A. Capello
+<dacap@users.sourceforge.net>. SF FR # 513607.<br>
+<li> Changed to v0.4.55 to store new settings.<p>
+<b>Revision</b> 1.552 2002/02/04 23:30:54 set
+<b>Revision</b> 1.45 SF 2002/02/01 15:26:51 set<br>
+<li> Added: Lua syntax highlight. Contributed by David A. Capello
+<dacap@users.sourceforge.net>.<p>
+<b>Revision</b> 1.551 2002/02/04 23:24:45 set<hr>v0.4.54 1st stable release after 0.4.41<br>
+<li> Synchronized home with v0.4.54 release.<p>
+<b>Revision</b> 1.550 2002/02/04 23:15:54 set
+<b>Revision</b> 1.44 SF 2002/01/29 18:05:29 set<br>
+<li> Updated: Man page version and ~/* paths (now ~/.setedit/*).<p>
+<b>Revision</b> 1.549 2002/02/04 23:15:37 set
+<b>Revision</b> 1.43 SF 2002/01/29 17:53:33 set<br>
+<li> Updated: Documentation version.<p>
+<b>Revision</b> 1.548 2002/02/04 23:15:20 set
+<b>Revision</b> 1.42 SF 2002/01/29 17:50:03 set<br>
+<li> Fixed: Now the distrib-* targets depends on needed. It allows to use "make
+distrib" even without doing make first.<p>
+<b>Revision</b> 1.547 2002/02/04 23:14:52 set
+<b>Revision</b> 1.41 SF 2002/01/29 17:46:40 set<br>
+<li> Modified: The compression scripts to generate more descriptive name for
+the debug files.<p>
+<b>Revision</b> 1.546 2002/02/04 23:14:29 set
+<b>Revision</b> 1.40 SF 2002/01/29 17:42:43 set<br>
+<li> Modified: Included libamp in Linux sources distro again.<p>
+<b>Revision</b> 1.545 2002/02/04 23:14:05 set
+<b>Revision</b> 1.39 SF 2002/01/29 17:39:08 set<br>
+<li> Fixed: asm51.pmc and html.frt wasn't marked as files that must be
+converted to native EOL by fromdos/unix scripts.<p>
+<b>Revision</b> 1.544 2002/02/04 23:13:45 set
+<b>Revision</b> 1.38 SF 2002/01/29 04:38:07 terrible<br>
+<li> Updated: Debian packaging to the "Brothers of Argentina have problems, I
+ hope they can get through it soon!" release version 0.4.54-1.<p>
+<b>Revision</b> 1.543 2002/02/04 23:13:14 set
+<b>Revision</b> 1.37 SF 2002/01/28 15:40:39 set<br>
+<li> Synchronized with home CVS.<br>
+<li> Added: rel and rev keywords to HTML, suggested by Ivan.<p>
+<b>Revision</b> 1.542 2002/01/27 21:36:49 set<br>
+<li> Changed to version 0.4.54 for a new release.<p>
+<b>Revision</b> 1.541 2002/01/27 16:55:11 set<br>
+<li> Modified: debian/rules to avoid deleting doc/Makefile and
+internac/Makefile.<p>
+<b>Revision</b> 1.540 2002/01/27 16:37:55 set<br>
+<li> Added: Protection to avoid starting the screen saver if currently the TV
+library says the size of the screen is 0. It looks like Win32 code
+currently can do it if the window isn't visible. This check isn't a
+solution but avoids "div. by 0" problems. Reported by <James_Wilson@i2.com><p>
+<b>Revision</b> 1.539 2002/01/27 16:36:11 set<br>
+<li> Added: A FAQ comment and warnings in the readme about the fact that Windows
+NT (4.0, 2k, XP, etc.) is case sensitive when looking for environment
+variables. Jim <James_Wilson@i2.com> had problems and all was because he used
+Set_Files=....<p>
+<b>Revision</b> 1.538 2002/01/27 16:22:01 set<br>
+<li> Modified: Test for djgpp/Cygwin fileutils to use cp instead of rm, it seems
+to be more reliable (optimized by djgpp's libc?). Patch by Alex Lozano.<p>
+<b>Revision</b> 1.537 2002/01/27 16:19:23 set<br>
+<li> Fixed: Allegro 4.0 moved the datafile_type definition to a same header but
+another directory and added an underscore. Patch by Andris.<p>
+<b>Revision</b> 1.536 2002/01/27 15:43:59 set<br>
+<li> Fixed: pathtool "defined but not used" warning when compiling libset.a for
+RHIDE. Patch by Andris.<br>
+<li> Fixed: rhideint lack of tv.h. Patch by Andris.<p>
+<b>Revision</b> 1.535 2002/01/27 15:36:10 set<br>
+<li> Modified: Now Allegro 4.0 is released and supported for audio stuff. The
+configuration script now accepts it. Reported by Andris.<p>
+<b>Revision</b> 1.534 2002/01/08 02:25:18 set<br>
+<li> Fixed: The mpegsound library failed to load the ID3 data (my fault).
+Reported by Alex Lozano <alex@inti.gov.ar>.<p>
+<b>Revision</b> 1.36 SF 2002/01/09 03:42:23 terrible<br>
+<li> Updated: Debian packaging to the "Ivan hates computers after having good
+ vacations" release version 0.4.53-1.<p>
+<b>Revision</b> 1.35 SF 2002/01/04 14:54:01 set<br>
+<li> Synchronized with home CVS.
+
+<b>Revision</b> 1.533 2002/01/02 01:09:57 set<br>
+<li> Fixed: Missing TV for Linux and Win32 targets in config.pl.<br>
+<li> Modified: Some headers to use Uses_* intead of including other headers.
+That's needed because a bug in glibc that enforces the declaration of
+_GNU_SOURCE before any standard header is included so compatlayer *must*
+include the standard headers.<br>
+<li> Fixed: Need of ./ in internac makefile.<p>
+<b>Revision</b> 1.532 2002/01/02 00:46:35 set<br>
+<li> Modified: Moved getline replacement to TV compatlayer.<br>
+<li> Modified: Wow! we are in 2002, so I changed some dates to reflect it.<p>
+<b>Revision</b> 1.531 2002/01/02 00:08:03 set<br>
+<li> Modified: version to 0.4.53 for a new release.<p>
+<b>Revision</b> 1.530 2002/01/02 00:02:09 set<br>
+<li> Modified: At least in my Win98 SE box some calls to internac/fix.pl just
+reboots my system. I guess that's just some memory corruption on the Perl
+interpreter triggered by one of the regular expressions. I changed it by a
+small C program.<br>
+<li> Fixed: Lack of locale.h inclusion in infmain.cc hidded by the inclusion of
+libintl.h.<br>
+<li> Fixed: Another /n missing at the end of a file reported by gcc 3.1.<p>
+<b>Revision</b> 1.529 2001/12/31 22:02:19 set<br>
+<li> Fixed: A couple of printf format missmatches that gcc started to report
+after some changes in TV (don't ask me why).<p>
+<b>Revision</b> 1.528 2001/12/31 00:13:37 set<br>
+<li> Modified: Moved rhtv and z libraries to .env/configuration.<br>
+<li> Fixed: pcre library was mandatory.<br>
+<li> Added: MSS 1.2.1 support --with-mss configuration option.<br>
+<li> Modified: configuration batch files to support long command lines.<br>
+<li> Fixed: A doubly defined vpath keyword in syntaxhl.shl (MSS reported).<br>
+<li> Added: Some routines to free memory at exit, they help to reduce the
+ammount of problems reported by memory debuggers.<br>
+<li> Fixed: A lot of new/new[]/malloc/delete/delete[]/free missmatches reported
+by MSS.<p>
+<b>Revision</b> 1.527 2001/12/30 15:55:25 set<br>
+<li> Added: A pmc file fox x51 assembler and updated the syntax highlight for
+it. Contributed by Alex Lozano <alex@inti.gov.ar><p>
+<b>Revision</b> 1.526 2001/12/17 00:08:16 set<br>
+<li> Fixed: SDG determined the line number of a function using an old methode,
+now modified to work in machines where data must be aligned. Reported by
+Grzegorz.<p>
+<b>Revision</b> 1.525 2001/12/17 00:04:05 set<br>
+<li> Fixed: Thiago's example that used underscores at the beggining of defines
+(reserved for compiler/libc).<p>
+<b>Revision</b> 1.524 2001/12/16 23:42:44 set<br>
+<li> Updated: Some dates in the copyrigh file.<br>
+<li> Fixed: The section 9 of readme.1st to be more clear.<p>
+<b>Revision</b> 1.523 2001/12/16 23:28:55 set<br>
+<li> Fixed: Even when specifying not to save the sound mixer settings the
+editor initialized the sound system during start-up. As a result Windows
+reserved the sound board for the editor blocking the access to other
+applications. Reported by David J. Hughes <David.J.Hughes@nokia.com>.<br>
+<li> Updated: Distrib files (new sLisp commands).<p>
+<b>Revision</b> 1.522 2001/12/13 03:24:46 set<br>
+<li> Added: Documentation for the new sLisp commands. Also added to the syntax
+highlight.<p>
+<b>Revision</b> 1.521 2001/12/11 02:45:17 set<br>
+<li> Added: New example (IndentLineOrBlock) and extended the copy line
+(DuplicateLineOrSelection). Contributed by Thiago.<p>
+<b>Revision</b> 1.520 2001/12/11 02:42:50 set<br>
+<li> Added: TMLIEditor::SelectionExists() to help a new command from Thiago
+(he suggested a concept for it).<br>
+<li> Added: tostr and SelectionExists, contributed by Thiago.<p>
+<b>Revision</b> 1.519 2001/12/11 02:34:15 set<br>
+<li> Added and fixed some details in Thiago's macros. Patches by Thiago.<p>
+<b>Revision</b> 1.518 2001/12/11 00:22:11 set
+<b>Revision</b> 1.32 SF 2001/12/04 14:35:12 set<br>
+<li> Fixed: Applied patch from Robert for missing includes in the RHIDE interface
+module.<p>
+<b>Revision</b> 1.517 2001/12/11 00:19:55 set<br>
+<li> Fixed: The new ShowInMessageWindow function didn't return a value
+returning a command. Detected by a report from Thiago.<br>
+<li> Fixed: It was possible to crash the editor writing a recursive sLisp
+macro. Now the recursion is limited. Reported by Thiago.<p>
+<b>Revision</b> 1.516 2001/12/11 00:18:33 set<br>
+<li> Added: More examples from Thiago (EvalSelection_Print,
+EvalSelection_StatusLine and EvalSelection_MessageWindow).<p>
+<b>Revision</b> 1.515 2001/12/11 00:14:39 set<br>
+<li> Fixed: When using "generate code" for a macro while editing a line the
+editor forgot to flush the line. It generated a SIGSEGV when it happend at
+the end of file. Reported by Thiago.<p>
+<b>Revision</b> 1.514 2001/12/11 00:05:26 set
+<b>Revision</b> 1.33 SF 2001/12/04 15:15:17 set<br>
+<li> Modified: The macros.slp file, I commented Lemur macros until a copy is
+available for the public. I also added some macros contributed by Thiago.
+They are good examples but most of them are commented because they eat
+memory and aren't 100% generic.<p>
+<b>Revision</b> 1.31 SF 2001/12/04 13:57:13 set<br>
+<li> Synchronized with my personal CVS.<p>
+<b>Revision</b> 1.30 SF 2001/12/04 05:54:16 terrible<br>
+<li> Updated: Debian packaging to 0.4.52-2, no changes, just new debs.<p>
+<b>Revision</b> 1.513 2001/12/04 03:12:56 set<br>
+<li> Added: A new sLisp command ShowInMessageWindow to print information in
+the message window. Suggested by Thiago.<p>
+<b>Revision</b> 1.512 2001/12/04 02:28:14 set<br>
+<li> Added: A new sLisp command contributed by Thiago: EvalString, it
+evaluates a string as sLisp code.<br>
+<li> Fixed: Evaluate selected sLisp code didn't flush the line in edition.<br>
+<li> Fixed: The sLisp interpreter didn't release the objects in the sLisp
+stack when an error ocurred. It generated memory leaks. It was this way
+because in this way was easier to report the exact point of the error
+without risking to use memory that we freed. It changed the strategy and I
+think this code must be tested and perhaps a branch will be needed if we'll
+release a 0.4.52 again.
+To achieve it now the code snapshot is taked just when the error appears.<br>
+<li> Fixed: Some GetXXXX sLisp variable macros tried to use the returned
+object even if it was NULL generating SIGSEGVs.<br>
+<li> Note: Most of this was triggered by a report by Thiago about problems to
+implement the new command.<p>
+<b>Revision</b> 1.511 2001/12/03 23:55:52 set<br>
+<li> Fixed: The ^Z key had a collision in the "redmond.smn" file. It was
+assigned to undo and scroll up confusing users. Now this key is assigned
+only by the menu and the redmond.smn doesn't have a short-cut for scroll
+up. Reported by David J. Hughes <David.J.Hughes@nokia.com>.<br>
+<li> Added: Some notes about errors in xterm description shipped with Mandrake
+8.1 to Linux FAQ. From a report by ZhiJie <zhi4jie2@yahoo.com>.<p>
+<b>Revision</b> 1.29 SF 2001/11/29 17:59:50 set<br>
+<li> Synchronized with my personal CVS.<p>
+<b>Revision</b> 1.510 2001/11/29 00:10:33 set<br>
+<li> Fixed: The DOS' SET_FILES autodetection mechanism was failing. Reported
+by David J. Hughes <David.J.Hughes@nokia.com>.<p>
+<b>Revision</b> 1.509 2001/11/28 23:49:06 set<br>
+<li> Fixed: Some small details in the editor.tx file that made TeX fail to
+generate the documentation (also some box overflows).<p>
+<b>Revision</b> 1.508 2001/11/28 23:24:17 set<br>
+<li> Fixed: getline replacement details. (#ifdef 0 and lack of (char *) cast).<br>
+<li> Fixed: Use of strerror for Solaris. Another candidate for compatlayer. It
+exists on Linux too.<br>
+<li> Fixed: _S macro in pal.h (collides on Solaris). Never use _* ...<br>
+<li> Fixed: Missing getopt in Solaris (must go to compatlayer).<p>
+<b>Revision</b> 1.28 SF 2001/11/28 13:56:30 set<br>
+<li> Synchronized with my personal CVS.<p>
+<b>Revision</b> 1.507 2001/11/28 00:40:45 set<br>
+<li> Added: Now is possible to execute a selected sLisp code even if it have
+spaces at the beggining. Patch by Thiago.<br>
+<li> Added: When running a selected sLisp code the result is shown in the
+message window, like when running sLisp code entered in the dialog. Patch
+by Thiago.<p>
+<b>Revision</b> 1.506 2001/11/28 00:28:30 set<br>
+<li> Fixed: The editor didn't flush the line under edition before calling a
+sLisp macro. Reported by Grzegorz.<br>
+<li> Fixed: Some old kibind.dat files could have commands with garbage in the
+upper 16 bits, it produce problems to show the name of this commands. Now
+the editor limits the values to 16 bits before trying to find the name.
+Reported by Thiago.<p>
+<b>Revision</b> 1.505 2001/11/28 00:08:29 set<br>
+<li> Modified: The sLisp 'Test RunProgram Filter' example to avoid running or
+pasting empty strings.<br>
+<li> Fixed: sLisp if statement, it evaluated more than once the things. It was
+a side effect of a macro. Reported by Grzegorz.<br>
+<li> Fixed: It wasn't possible to use ' and " in sLisp commands, was
+interpreted as a string start.<br>
+<li> Fixed: It wasn't possible to put a comment just after a number in sLisp.<br>
+<li> Fixed: When calling RunProgram* sLisp command passing an empty string as
+command to execute it was telling something about configuring it in the
+options menu. Reported by Grzegorz.<br>
+<li> Fixed: In case of errors if a MLIRetObj was involved the editor generated
+a SIGSEGV.<p>
+<b>Revision</b> 1.27 2001/11/27 13:00:25 set<br>
+<li> Applied: Patch 485876: Tiny Info documentation changes for Debian by
+"terrible" (Ivan). It modifies the declared name of .info docs to avoid
+problems with the install-info found in Sid.<br>
+<li> Applied: Patch 485877: Changes to Debian packaging by "terrible" (Ivan)<p>
+<b>Revision</b> 1.26 2001/11/26 15:16:55 set<br>
+<li> Trying to switch to stable ;-)<p>
+<b>Revision</b> 1.504 2001/11/25 20:09:35 set<br>
+<li> Fixed: Some logic in the about box for the first run. Was changed
+recently.<br>
+<li> Added: Information in the README about the fact that now I'm switching to
+RHIDE 1.4.9.<p>
+<b>Revision</b> 1.503 2001/11/25 19:55:54 set<br>
+<li> Changed version to 0.4.52, a new stable release is coming soon ;-)<p>
+<b>Revision</b> 1.502 2001/11/25 19:49:18 set<br>
+<li> Added: More complete dependency solve in mli.h and settvuti.h to help
+compile RHIDE. Patches by Andris.<p>
+<b>Revision</b> 1.501 2001/11/25 19:02:20 set<br>
+<li> Fixed: EdReloadIfOpened(char const *, stEditorId *) in rhideint.cc and
+added a couple of support functions (plus comments) to help incorporate the
+new features in RHIDE. Andris tried to do it and reported these problems.<p>
+<b>Revision</b> 1.500 2001/11/24 15:17:35 set<br>
+<li> Fixed: Stack overflow in the closed windows sort under some particular
+cases. Reported by Grzegorz.<p>
+<b>Revision</b> 1.499 2001/11/24 15:14:07 set<br>
+<li> Modified: When a command assigned to a key is out-of range the returned
+name is Unknown instead of a NULL pointer. Somehow Thiago got a corrupted
+keybind.dat and the previous behavior made the program crash.<p>
+<b>Revision</b> 1.498 2001/11/24 15:02:22 set<br>
+<li> Modified: Some inline members in filter.cc and filter2.cc (Mpegsound) to
+avoid compilation problems reported by Thiago. I don't see the need to
+inline these big routines. May be I'll revert it but right now is better to
+avoid problems.<p>
+<b>Revision</b> 1.497 2001/11/24 14:53:49 set<br>
+<li> Fixed: Lack of string.h in some files, Reported by Thiago from RedHat 7.1.<p>
+<b>Revision</b> 1.25 2001/11/11 21:31:47 terrible<br>
+<li> Hello, it's me! I am trying to sabotage Salvador's editor while him is on
+vacations!!!<br>
+<li> Updated: Debian packaging to 0.4.51-4, no changes really.<br>
+<li> Fixed: Salvador mistakenly deleted change.log entry 0.23, it isn't that
+important, but anyway I enjoy contaminating this change.log.<p>
+<b>Revision</b> 1.496 2001/11/08 00:57:48 set<br>
+<li> Added: An explanation on how to extend sLisp in the DOS and Linux FAQ
+files. It is an e-mail I sent to Thiago answering some questions he had
+when tried to code cond.<p>
+<b>Revision</b> 1.495 2001/11/08 00:37:27 set<br>
+<li> Added: A temporal replacement for getline to be used in UNIX systems that
+doesn't have it. It must go to compatlayer but TV is frozen right now.<p>
+<b>Revision</b> 1.494 2001/11/08 00:25:57 set<br>
+<li> Fixed: Spanish translation of "Macro|Run selected code" have repeated
+shortcut.<p>
+<b>Revision</b> 1.493 2001/11/08 00:22:30 set<br>
+<li> Added: cond to the documentation and syntaxhl.shl.<br>
+<li> Added: The last new and fixed things to readme.<p>
+<b>Revision</b> 1.492 2001/11/08 00:14:50 set<br>
+<li> Fixed: Write block didn't check if the fopen succeed or not. I got a
+SIGSEGV in my Linux box when trying to overwrite a root's file ;-)<p>
+<b>Revision</b> 1.491 2001/11/08 00:07:08 set<br>
+<li> Added: sLisp command cond works like some kind of switch/case. Is similar
+to Clipper's do case. Contributed by Thiago.<br>
+<li> Fixed: [sLisp] When returning a variable that belongs to the stack (not a
+fresh copy) I used the MLIRetObj, but it didn't mark the variable as
+"floating" and hence was released from the stack. The result was that when
+used it was already released containing garbage or the original value or
+invalid pointers (random). I was exposed only if the variable wasn't the
+return value of a expression. It made cond to fail.<p>
+<b>Revision</b> 1.24 2001/11/07 13:08:02 set
+Synchronized S.F. with my home CVS.<p>
+<b>Revision</b> 1.490 2001/11/07 00:22:36 set<br>
+<li> Fixed: InfView crashed when loading desktops of older versions. Reported
+by Thiago.<p>
+<b>Revision</b> 1.489 2001/11/07 00:10:49 set<br>
+<li> Fixed: The indent uncomenting was taking an extra line. Reported by
+Thiago.<br>
+<li> Fixed: The undo of the indent commenting let the rectangle selection
+visible.<p>
+<b>Revision</b> 1.488 2001/11/06 01:17:37 set<br>
+<li> Modified: Reverted to non-BIOS keyboard by default. The BIOS stuff discards
+very used combinations. I put it in the FAQ and also modified the readme.<p>
+<b>Revision</b> 1.487 2001/11/06 01:04:10 set<br>
+<li> Added: Mazovia code page. That's a polish code page based on PC437. It
+discards some accents that aren't used by polish and puts the needed chars
+there. Piotr <piotr@asco.biz.pl> asked for it and helped me to add it.<p>
+<b>Revision</b> 1.23 2001/11/02 21:17:28 terrible<br>
+<li> Updated: Debian packaging to 0.4.51-3.<p>
+<b>Revision</b> 1.486 2001/10/31 03:03:07 set<br>
+<li> Fixed: When the editor was configured to forget about opened windows when
+specifying new files in the command line the editor put the old files in
+the list of closed files allowing to recover them easilly and remmembering
+things like window position and size. But the editor failed to remmember
+the cursor position. Reported by Ivan.<p>
+<b>Revision</b> 1.485 2001/10/31 01:57:14 set<br>
+<li> Fixed: The new compression scheme by "terrible" didn't apply to
+distribution (only installation). Also fixed the indentation.<p>
+<b>Revision</b> 1.484 2001/10/31 01:37:57 set<br>
+<li> Synchronized home CVS with S.F.<p>
+<b>Revision</b> 1.23 2001/11/02 21:17:28 terrible<br>
+<li> Updated: Debian packaging to 0.4.51-3.<p>
+<b>Revision</b> 1.22 2001/10/29 18:40:35 terrible<br>
+<li> Modified: added a '--comp-exe' switch to the configure script to force all
+executables produced to be compressed with UPX, and now the default behaviour
+is like before the modifications for the '--no-comp-exe' switch, in Unix the
+editor is not compressed but infview is, the rationale is that it is more
+common to have various editor instances than infview ones, and on other
+architectures they are both compressed since there is not much performance
+loss.<p>
+<b>Revision</b> 1.21 2001/10/29 14:40:18 set<br>
+<li> Added: --no-intl configuration option. Patch sent by jimmy@ncp.infonet.bg.<p>
+<b>Revision</b> 1.20 2001/10/29 14:15:25 set<br>
+<li> Synchronized S.F. CVS with changes made at home.<p>
+<b>Revision</b> 1.19 2001/10/28 19:48:44 terrible<br>
+<li> Added: --no-comp-exe option to configure script, to avoid compressing the
+executables with UPX.<br>
+<li> Modified: now default behaviour for all platforms is to compress
+executables with UPX, previously on Unix the editor executable was not
+compressed (only the infview was).<br>
+<li> Updated: Debian packaging to 0.4.51-2.<p>
+<b>Revision</b> 1.483 2001/10/27 19:51:12 set<br>
+<li> Added: ESC close the Message Window. Suggested by Thiago.<p>
+<b>Revision</b> 1.482 2001/10/27 19:41:56 set<br>
+<li> Added: sLisp command progn, that's just an alias for eval. This is how
+regular Lisp calls it. Suggested by Thiago.<br>
+<li> Added: The last changes to the readme.1st.<br>
+<li> Added: progn to the shl.<p>
+<b>Revision</b> 1.481 2001/10/27 19:25:26 set<br>
+<li> Added: The "Macro|Enter code to execute" gets the "macro under cursor"
+to offer it as code to execute.<br>
+<li> Added: When using it the returned value is displayed in the message
+window. Thiago suggested something like it.<br>
+<li> Added: A ~ operator to sLisp, it replaces the old not that now have a
+more coherent meaning (is like ! in C). Thiago reported problems about it.
+Documented.<br>
+<li> Added: Hexadecimal shl to sLisp shl because that's supported.<br>
+<li> Fixed: Now is possible to enter a negative integer in sLisp.<br>
+<li> Fixed: After running a macro if it generated an error posterior runs
+indicated the same error.<p>
+<b>Revision</b> 1.480 2001/10/27 17:21:47 set<br>
+<li> Fixed: The list of functions stores the name of the function and the line
+number to jump. As the length of the name is arbitrary the line number
+could be stored in memory missaligned. This is not a performance issue
+because the process itself is complex but in SPARC machines generates a
+SIGBUS.<p>
+<b>Revision</b> 1.479 2001/10/27 17:16:35 set<br>
+<li> Fixed: It looks like most systems include locale.h implicitly (with other
+headers) but not Solaris.<p>
+<b>Revision</b> 1.478 2001/10/27 17:08:29 set<br>
+<li> Fixed: InfView code assumed Linux is the only UNIX ;-). Seen on Solaris.<p>
+<b>Revision</b> 1.477 2001/10/27 16:09:07 set<br>
+<li> Added: An example on how to use an external filter with sLisp. The
+example is for formating e-mails and was contributed by Grzegorz. (is in
+the documentation).<p>
+<b>Revision</b> 1.476 2001/10/27 15:11:10 set<br>
+<li> Fixed: [Linux/PPC and SPARC] For some bizarre reason gcc 2.95.2 is
+generating references for the inline TCEditor::TurnOffHighLight() in all
+the files that includes the TCEditor definition. This tries to pull the
+ceditor.cc file where all data members are declared. This isn't a problem
+for the editor but for InfView. So now the codepage.cc file doesn't
+declare TCEditor if it isn't really needed (faster compilation ;-). I saw
+it only on big endian platforms.<p>
+<b>Revision</b> 1.475 2001/10/27 15:03:50 set<br>
+<li> Fixed: When trying to use AM/PM clock and the system had a locale that
+doesn't support it (i.e. LC_ALL=es) strftime doesn't put anything for the
+%p value. It made the buffer of the desktop clock to have 1 character less
+than expected and this character was random. I also enlarged the clock 1
+character to make AM and PM visible and not just A and P. Reported by Ivan.<p>
+<b>Revision</b> 1.474 2001/10/25 00:29:41 set<br>
+<li> Added: A user remind me that some special keyboard combinations (like
+Alt+arrow keys) aren't detected when we use BIOS to extract keystrokes from
+the queue. For this reason I explain it and how to revert to the old methode
+in the readme.1st and windos.faq.<p>
+<b>Revision</b> 1.473 2001/10/23 01:15:38 set<br>
+<li> Fixed: Debian package distributes readme.1st compressed so the editor
+failed to load it. Now the editor can also locate it. In the future I could
+also distribute the file compressed in the tarball.<p>
+<b>Revision</b> 1.472 2001/10/23 00:38:28 set<br>
+<li> Fixed: The search tables used in editorfo.cc were allocated in one memory
+chunk. This generates missaligment. This isn't critic in Intel platforms
+(unless the OS explicitly enables a processor flag), but generates a kernel
+warning log in Linux/PPC platforms and a SIGBUS in Linux/SPARC platforms.
+As I was modifying it I did some more changes to make the code a little bit
+compact.<p>
+<b>Revision</b> 1.471 2001/10/22 23:45:25 set<br>
+<li> Fixed: The KeyTNode structure had a union that contained a short and an
+int value. As C seems to promote integers to int type gcc was choosing the
+int member to store const unsigned short values (instead of the ushort
+version of the union and in a static initialization) as a result of it the
+value was wrongly stored in big endian platforms. Seen on PPC.<p>
+<b>Revision</b> 1.470 2001/10/22 23:40:31 set<br>
+<li> Fixed: The TInfViewer::draw() member uses a function called moveChar() it
+was filling the buffer with character/attribute in an endian dependent
+order. TV expects a fixed order no matters which endianess is used. Seen on
+a Power PC machine (IBM RS/6000 at Source Forge).<p>
+<b>Revision</b> 1.469 2001/10/22 23:29:24 set<br>
+<li> Synchronized with Source Forge CVS including new Debian files.<p>
+<b>Revision</b> 1.18 2001/10/22 13:27:34 set<br>
+<li> Synchronized with my repository.<p>
+<b>Revision</b> 1.16 2001/10/22 04:29:07 terrible
+Modified: Updated Debian packaging to version 0.4.51-1.<p>
+<b>Revision</b> 1.468 2001/10/20 16:45:08 set<br>
+<li> Fixed: [Win32] I forgot to put CONFIG_PREFIX in the BC++ 5.5 configuration
+file.<br>
+<li> Fixed: [Win32] BC++ 5.5 doesn't even define a dummy for chown, getuid and
+getgid. I must move it to compatlayer but currently TV is in frozen.<p>
+<b>Revision</b> 1.467 2001/10/20 15:12:33 set<br>
+<li> Added: Acknowledge to VA Linux and S.F. crew, this service helped me to
+get at least quite close to have support for other Linuxes and FreeBSD.<p>
+<b>Revision</b> 1.466 2001/10/20 15:07:36 set<br>
+<li> Fixed: In loadcle and a member of the editor I assumed a char variable
+can hold a negative value or at least the compiler is smart enough to
+assume it means 0xFF. It isn't true for Power PC platforms. I changed it to
+work with explicit unsigned chars.<br>
+<li> Fixed: The edspecs module used a non-endian clean code when saving the
+environment strings producing SIGSEGVs when loading the file in big endian
+systems. Lamentably I think it there are more things like it. Seen in Power
+PC.<br>
+<li> Note: I compiled the editor for Alpha and PPC thanks to Source Forge's
+Compiler Farm. The editor is corrupting the heap in Alpha and had those
+problems in PPC. I'll test a fixed version but I really need some user on
+these platforms to help me.<p>
+<b>Revision</b> 1.465 2001/10/20 01:16:54 set<br>
+<li> Fixed: Missleading information about Debian version in the policy.txt
+file.<p>
+<b>Revision</b> 1.464 2001/10/20 01:16:04 set<br>
+<li> Added: a fix to the configuration script to have it in sync with TV.<br>
+<li> Added: Now the editor can detect makefiles just because they have
+#!...make.<p>
+<b>Revision</b> 1.463 2001/10/20 00:27:47 set<br>
+<li> Fixed: [UNIX] some static functions in stackdbg.c weren't used in
+non-intel platforms generating warnings (seen in Power PC).<p>
+<b>Revision</b> 1.462 2001/10/20 00:22:49 set<br>
+<li> Fixed: When using the editor SUID root and the ~/.setedit directory
+wasn't yet created the editor created it as root because it didn't reach
+the point where priviledges are droped. Reported by Ivan.<p>
+<b>Revision</b> 1.461 2001/10/20 00:17:16 set<br>
+<li> Fixed: I was casting pointers to integers in the keyboard tables code. It
+doesn't work for the Alpha processor where sizeof(void *) == 8 and
+sizeof(int) == 4 ;-) I knew it, but is sometimes I forget such a details.<p>
+<b>Revision</b> 1.460 2001/10/20 00:10:15 set<br>
+<li> Added: A new target "internac" to the makefile, it creates the *.mo
+files.<br>
+<li> Added: Anew target "doc-basic" to the makefile, it creates the txt and
+info documentation.<br>
+<li> Modified: Now the needed target includes internac and doc-basic. It
+implies that "make editor" will also generate the i8n and doc files. It
+avoids generating the files while using "make install" that needs root and
+hence makes the files hard to delete. Reported by Grzegorz.<br>
+<li> Modified: [UNIX] Now InfView's REMOVE_UNNEEDED only removes obsolete
+files that belong to InfView. Thiago installed InfView 0.2.7 having setedit
+0.4.41 and it deleted the help files of setedit.<p>
+<b>Revision</b> 1.459 2001/10/19 23:26:44 set<br>
+<li> Fixed: [InfView] It was unconditionally closing the opened windows even
+if the command line indicated a .info file. It was introduced when I added
+code pages support so it was present only in 0.2.7 beta. Reported by Ivan.<p>
+<b>Revision</b> 1.458 2001/10/19 22:52:38 set<br>
+<li> Added: Ivan is maintaining a Debian repository for the editor and
+InfView. I documented it in the readmes.<p>
+<b>Revision</b> 1.457 2001/10/18 23:52:07 set<br>
+<li> Modified: I moved the changelog information generated before the use of CVS
+to a new file called change0.log. I reformated it to be more like the current
+change.log. The file contains 424 entries and ranges from 1996/12/03 to
+1998/11/19, about 2 years.<p>
+<b>Revision</b> 1.456 2001/10/17 23:38:16 set<br>
+<li> Added: Now the configuration script informs if the configuration header was
+changed.<br>
+<li> Copied some fixes in conflib.pl from TV to make them in sync.<br>
+<li> Fixed: a warning generated by gcc 2.8.1 about a variable that could be used
+unitialized (wrong warning).<p>
+<b>Revision</b> 1.455 2001/10/17 23:33:27 set<br>
+<li> Synchronized with S.F.<p>
+<b>Revision</b> 1.15 2001/10/15 13:57:48 set
++<p>
+<b>Revision</b> 1.454 2001/10/14 22:27:26 set<br>
+<li> Fixed: The detected CPU wasn't restored from the configure.cache
+producing a wrong configuration header.<br>
+<li> Fixed: SIGSEGV produced if we inserted text in a new buffer after a grep
+search or errors collection.<p>
+<b>Revision</b> 1.14 2001/10/14 06:44:45 terrible<br>
+<li> Updated: Debian packaging to the "Let's see if I can release while I am
+sleeping" release, version 0.4.50-1. See debian/changelog for details.<p>
+<b>Revision</b> 1.453 2001/10/13 22:17:46 set<br>
+<li> Fixed: v0.4.50 needs TV 1.1.3 and the config.pl didn't enforce it.<br>
+<li> Fixed: Global indent size wasn't stored in desktop files nor offered in
+the default global options based on the shl. Reported by Grzegorz.<br>
+<li> Fixed: Accelerator for "Indent" (d) clashed with "To all" in the spanish
+version. Reported by Grzegorz.<br>
+<li> Modified: version to 0.4.51.<p>
+<b>Revision</b> 1.13 2001/10/12 12:39:32 set
++<p>
+<b>Revision</b> 1.452 2001/10/12 02:50:38 set<br>
+<li> Fixed: When opening the readme.1st the editor tried to make it read-only
+but it didn't prevent the editor for issuing a warning if the file was
+really read-only. Now the class takes isReadOnly as parameter in the
+constructor.<br>
+<li> Fixed: [Linux] When using hidden desktop files and projects the editor
+failed to load the desktop file.<p>
+<b>Revision</b> 1.451 2001/10/11 23:55:39 set<br>
+<li> Updated the changes and fixes since 0.4.41 upto last revision.<p>
+<b>Revision</b> 1.450 2001/10/11 23:46:36 set<br>
+<li> Synchronized CVS with Source Forge.<p>
+<b>Revision</b> 1.449 2001/10/09 22:37:54 set<br>
+<li> Updated: Spanish translation.<p>
+<b>Revision</b> 1.448 2001/10/09 22:32:20 set<br>
+<li> Added: Column markers. That's another edition option and can be used to
+highlight columns. This is useful for languages that needs text in
+particular columns (Fortran and Cobol I think). I tested global and local
+settings and default global options. Documented. Suggested by Martijn
+Versteegh.<br>
+<li> Modified: version to 0.4.50.<p>
+<b>Revision</b> 1.447 2001/10/09 17:56:52 set<br>
+<li> Updated: Tcl/Tk syntax highlight. Patch by Philip Moore <FireEgl@EMail.com><br>
+<li> Added: Fortran syntax highlight. Contributed by Martijn Versteegh
+<versteegh@kvi.nl>.<p>
+<b>Revision</b> 1.446 2001/10/09 16:54:49 set<br>
+<li> Tested the editor with PCRE 3.2, all works OK, I don't include it because
+now uses autotools and fails to be configured for djgpp needing tricks.<br>
+<li> Fixed the allegro 3.9.38 headers to compile with gcc 3.1, will send patches
+to list.<p>
+<b>Revision</b> 1.445 2001/10/09 14:05:21 set<br>
+<li> Fixed: Typo in C/C++ parser (#elif)<br>
+<li> Bad news: The editor compiled with gcc 3.1 runs slower than compiled with
+2.8.1 and is bigger: 11 % slower 20 % bigger. At least for my K6-2 CPU using<br>-O2 optimization. That's really bad.<p>
+<b>Revision</b> 1.444 2001/10/08 22:09:33 set<br>
+<li> Added: Support for gcc 3.1. The code compiled OK, but I was forced to
+disable some part of Allegro's header :-(.<p>
+<b>Revision</b> 1.443 2001/10/08 19:30:01 set<br>
+<li> Added: Support for gcc 3.1 in the configuration scripts.<br>
+<li> Added: Support for string streams in doedidia.cc (str streams doesn't exist
+anymore).<br>
+<li> Added: Support for "namespace" and "using" C++ keywords to the internal
+syntax highlight.<p>
+<b>Revision</b> 1.11 2001/10/07 23:46:19 terrible<br>
+<li> Modified: updated Debian files to version 0.4.49-1.<br>
+<li> Fixed: unnecesary compile of shipped libbzip2 because of typo in config.pl.<p>
+<b>Revision</b> 1.442 2001/10/07 20:31:28 set<br>
+<li> Added: a small script to create the .debs as a regular user
+(debian/buildpackage).<p>
+<b>Revision</b> 1.441 2001/10/07 19:30:37 set<br>
+<li> Added: More mechanisms to make gettext work with the .po files. The main
+problem is that old tools destroys the information needed for the new ones.
+Now the scripts also updates version and revision time.<br>
+<li> Fixed: When running suid root the stderr redirected files were owned by
+root. Reported by Ivan.<br>
+<li> Fixed: When using a central dst file and loading another in a directory
+the settings were transferred to the central one. Reported by Ivan.<p>
+<b>Revision</b> 1.440 2001/10/07 14:30:57 set<br>
+<li> Added: A command line option called --debug to the configuration script.
+It selects switches that can be used for debug and testing purposes. They
+are generic and could not match with the ones used to compile TV. Suggested
+by Grzegorz.<p>
+<b>Revision</b> 1.439 2001/10/07 14:07:49 set<br>
+<li> Added: Now if SET_FILES wasn't defined the editor also tries to guess
+using the prefix indicated during configuration. I also added an option to
+the configuration script to disabled it because I compile the editor in
+e:/... for DOS and it could be the CD-ROM in some sytems producing a test
+for the CD which is slow and annoying. Under UNIX I use /usr which is
+already in the list to search, so my prefix isn't needed either.<p>
+<b>Revision</b> 1.438 2001/10/06 23:15:01 set<br>
+<li> Modified: Now is possible to set the number of closed windows to
+something less than 3. Suggested by Thiago.<br>
+<li> Added: Now ESC closes the man pages viewer. Suggested by Thiago.<p>
+<b>Revision</b> 1.437 2001/10/06 22:42:34 set<br>
+<li> Enhanced: Now the heuristic parser for C sources takes only one part of
+#if #elsif #else #endif sequences when they are inside a function. It
+solves a well known limitation. I hope it doesn't break all ;-) I did it
+after a report by Grzegorz, the funny thing is that limitation was clearly
+documented (RTFD).<p>
+<b>Revision</b> 1.436 2001/10/06 19:58:10 set<br>
+<li> Added: A couple of command to execute sLisp from the editor (selected
+text) or entering it in an input line. Documented. Suggested by Thiago.<br>
+<li> Updated: Spanish traslation.<br>
+<li> Modified: Now the Macros collection (list of sLisp macros defined by
+user) holds a copy of the macro code. It makes possible to define macros
+with the new mechanism without risking to lose them or leak memory.<br>
+<li> Added: Support for commands with _ in their names to the meuload
+mechanism. The new commands have it.<p>
+<b>Revision</b> 1.435 2001/10/06 17:22:41 set<br>
+<li> Fixed: Calculator parsers aren't "locale aware" but libc is so it
+generated a mess. Now the locale is set to C before running them. Reported
+by Ivan.<br>
+<li> Added: Some code to make the stackdbg module more robust when using
+strong optimizations.<br>
+<li> Modified: Debian release version used by the editor to -0.1 and not -1.<br>
+<li> Fixed: SIGSEGVs when using the -b command line option.<p>
+<b>Revision</b> 1.434 2001/10/06 16:04:40 set<br>
+<li> Fixed: [sLisp] The RunProgramRedir command was forking and hence didn't
+collect the external program output. Reported by Grzegorz.<br>
+<li> Added: [sLisp] A new optional parameter to RunProgramRedir. If provided
+is used for the stdin of the external program. Documented. Suggested by
+Grzegorz.<br>
+<li> Added: [sLisp] MessageBox command to communicate things to the user.
+Documented.<br>
+<li> Added: [sLisp] An example of how to use the new RunProgramRedir to run an
+external filter program. I tested it with "recode ISO8859-1..html".<p>
+<b>Revision</b> 1.433 2001/10/06 14:27:58 set<br>
+<li> Added: Now the files listed in the "no back-ups" list aren't remmebered
+in the closed list. They are usually temporal files that won't exist
+anymore. Documented.<p>
+<b>Revision</b> 1.432 2001/10/06 14:16:43 set<br>
+<li> Added: Support for "Jump to function" in assembler files. It takes the
+labels excluding local gcc labels (they start with .). Documented.<br>
+<li> Fixed: The syntax highlight for .s files didn't separate strings starting
+with " and '.<p>
+<b>Revision</b> 1.431 2001/10/06 13:30:49 set<br>
+<li> Added: New option to open R.O. files as R.O. buffers.<br>
+<li> Documented: New option "Open R.O. as R.O." plus all the new stuff in the
+editor's general options.<br>
+<li> Documented: Addition to menu: "Name current function"<br>
+<li> Synchronized Source Forge CVS, tag sf0449_2.<p>
+<b>Revision</b> 1.10 2001/10/05 13:13:08 set
++<p>
+<b>Revision</b> 1.430 2001/10/05 00:38:47 set<br>
+<li> Added: Name of current function to the menues. This command is old and is
+available as an option of find & replace but wasn't in the menues.<br>
+<li> Added: My CVS sync tools to the distribution list.<br>
+<li> Fixed: Now when jumping to a file reported by an external program and the
+file doesn't exist the editor doesn't open an empty window, it just ignores
+it.<p>
+<b>Revision</b> 1.429 2001/10/05 00:07:31 set<br>
+<li> Added: Comment about changes upto revision 1.386 of change.log to the
+readme file.<p>
+<b>Revision</b> 1.428 2001/10/04 01:54:16 set<br>
+<li> Added: Support for Allegro 3.9.x. It generates a bigger executable but
+support more sound systems. It also generates a marginally bigger installer
+(Not counting the editor increase). I provide a datafile replacement to avoid
+pulling another 80 Kb or so.<p>
+<b>Revision</b> 1.427 2001/10/02 00:51:23 set<br>
+<li> Modified: [DOS] If LFNs are supported and UNIX back-up style is selected
+the editor appends the ~ at the end as in UNIX. I think it could fail for
+remote file systems like Novell 3.12 ones but in this case the user should
+simply avoid using it.<p>
+<b>Revision</b> 1.426 2001/10/02 00:32:57 set<br>
+<li> Added: Documented that now Alt+F2 is not only for C. Also documented the
+browse button.<br>
+<li> Modified: The inf.h header included tv.h. It produced multiple inclusions
+of a big header. Now you include infr.h and then settvuti.h (it includes
+tv.h) finally you can include inf.h. In this way settvuti.h+tv.h and
+related headers are included just once.<p>
+<b>Revision</b> 1.425 2001/10/01 23:28:38 set<br>
+<li> Merged with SourceForge (patches from Ivan and last minute adjustements).<p>
+<b>Revision</b> 1.9 2001/10/01 17:28:06 set<br>
+<li> Remerged Ivan patches.<br>
+<li> Updated *.mak files.<br>
+<li> Commited some files that failed in the batch process.<p>
+<b>Revision</b> 1.7 2001/10/01 15:18:46 set<br>
+<li> Removed "fixme" labels from Ivan, things seems to be OK.<p>
+<b>Revision</b> 1.6 2001/10/01 13:33:14 set<br>
+<li> Removed: tcedit.dst file from CVS, it was there by accident.<p>
+<b>Revision</b> 1.5 2001/10/01 02:51:07 terrible
+Fixed: if we are not using shipped libbzip2 then use the system include files
+and not the shipped ones.
+Fixed: if we are not using shipped libbzip2, then not compile it.
+New: support old libbzip2 (before 1.0 version).
+Workaround: patchenv.pl checks if a variable needs replacing or not, the
+problem is that it only checks in the first occurence of the variable (in
+the .mak file), so if the first occurence of the variable not needed a
+change, then it didn't change the other occurences even if they had to be
+changed; so I have disabled that check and it always replaces the variables
+no matter what, a Perl guru should elaborate a correct solution to avoid
+changing everytime all the variables.
+To do: Salvador has to check the various "FIXME:"'s and correct my mistakes
+(though "It Works For Me TM" in Debian Potato and in Sid but maybe that's
+because of black magic).<p>
+<b>Revision</b> 1.4 2001/09/30 04:08:29 terrible
+Updated Debian packaging to 0.4.47-2.<p>
+<b>Revision</b> 1.3 2001/09/30 00:51:10 terrible
+Debian packaging updated to 0.4.47-1.<p>
+<b>Revision</b> 1.2 2001/09/29 14:58:35 terrible
+Updated Debian files to version 0.4.45-1.<p>
+<b>Revision</b> 1.424 2001/09/30 20:46:51 set<br>
+<li> Modified: The new tools.<p>
+<b>Revision</b> 1.423 2001/09/30 20:03:05 set<br>
+<li> Added: A experimental tool to synchronize my CVS with Source Forge's cvs.<p>
+<b>Revision</b> 1.422 2001/09/29 15:53:22 set<br>
+<li> Many fixes to cleanly compile with gcc 3.0.1:<br>
+<li> Modified: gcc 3 enforces /n at the end of files.<br>
+<li> Fixed: Preprocessor expansion "]##." is deprecated.<br>
+<li> Fixed: "#endif text" is deprecated.<br>
+<li> Fixed: "condition ? object_type1 : object_type2" deprecated (casts
+enforced).<br>
+<li> Fixed: Multi-line strings deprecated. That's a real pity because they are
+very convenient for inline assembler.<br>
+<li> Fixed: Use of ios::bin (now CLY_IOSBin) in mp3list.cc.<br>
+<li> Fixed: Missing memcpy prototype in mp3play.cc.<br>
+<li> Modified: Now gcc doesn't provide set_new_handler() anymore.<br>
+<li> Fixed: I put pathlist.h wrongly in the files list.<p>
+<b>Revision</b> 1.421 2001/09/26 02:37:31 set<br>
+<li> Adapted: The es.po, de.po, utod.pl and Makefile for internationalizations
+to work with gettext 0.10.39 tools (that seems to suppose files are in
+UTF-8 by default!!). I hope the old tools I use in Linux won't mess the
+whole thing.<p>
+<b>Revision</b> 1.420 2001/09/26 02:05:23 set<br>
+<li> Modified: [DOS] Now in TV the keyboard is by default handled by BIOS.
+Added command line switchs to revert it, documented and translated.
+F*ck|ng gettext package, it is a real piece of shit, I'm sick of te really
+stupid ideas incorporated to it.<p>
+<b>Revision</b> 1.419 2001/09/25 23:50:44 set<br>
+<li> Added: Now the first time the editor forces to load the readme.1st it is
+opened: 1) R.O. 2) Zoomed 3) With the cursor at the beginning.<p>
+<b>Revision</b> 1.418 2001/09/23 23:37:09 set<br>
+<li> Fixed: When running a program in background and it finished jumping to a
+source line the result was quite confusing if we were in a modal dialog. In
+this case the dialog remains with the keyboard focus but the select window
+is another, most probably oculting the dialog. Now the run program
+mechanism waits until we exit the dialog.<p>
+<b>Revision</b> 1.417 2001/09/23 23:16:26 set<br>
+<li> Fixed: When match on the fly was enabled and also no wait the editor
+failed to propagate some syntax highlight situations.<p>
+<b>Revision</b> 1.416 2001/09/23 21:25:06 set<br>
+<li> Updated: Calculator parsers that are and aren't compiled to compile with
+the changes in compatlayer.<p>
+<b>Revision</b> 1.415 2001/09/23 21:22:03 set<br>
+<li> Fixed: The routine that restores a line under edition failed to update
+the correct start of the selection when it purged spaces at the left of the
+cursor position.<br>
+<li> Fixed: The undo of BackSpace inserted spaces at the wrong column when
+they were completly purged during the action.<p>
+<b>Revision</b> 1.414 2001/09/23 20:11:34 set<br>
+<li> Modified: Moved all the macros to define if we need \r\n or \n from
+setedit to the compatlayer library.<p>
+<b>Revision</b> 1.413 2001/09/23 15:46:52 set<br>
+<li> Added: An option to indicate in which directories to search files we
+indicate with Ctrl+Enter. Usually include dirs. Stored in the desktop file,
+documented. Translated to spanish.<br>
+<li> Modified: version to 0.4.49.<br>
+<li> Modified: The algorithm that takes the name of a file under the cursor to
+be smarter.<p>
+<b>Revision</b> 1.412 2001/09/23 00:33:27 set<br>
+<li> Fixed: After jumping to a function name extending the selection usually
+generated strange results. It was like extending an old selection. Now the
+selected line is made with a temporal selection like in the search
+mechanism.<br>
+<li> Fixed: When jumping to a function already in the screen it wasn't
+highlighted.<p>
+<b>Revision</b> 1.411 2001/09/22 23:53:20 set<br>
+<li> Fixed: The C/C++ function parser failed with sequences like it: "\\\\".
+Reported by Grzegorz.<br>
+<li> Fixed: Alt+F7/F8 without hits gave a SIGSEGV (produced by the addition of
+re-select the last if we passed it).<p>
+<b>Revision</b> 1.410 2001/09/22 22:40:49 set<br>
+<li> Added: A new command cmcInsertKeyName to insert the name of the key in
+the text you are editing. Suggested by "Thiago F.G. Albuquerque"
+<tfga@zaz.com.br>. Documented.<p>
+<b>Revision</b> 1.409 2001/09/22 21:08:36 set<br>
+<li> Modified: The TeX syntax highlight with some stuff contributed by Jan
+Cnops <jan.cnops@hogent.be>.<p>
+<b>Revision</b> 1.408 2001/09/22 20:52:31 set<br>
+<li> Updated: [InfView] readme to reflect last aditions.<br>
+<li> Modified: [InfView] removed some unneeded code.<br>
+<li> Fixed: [InfView] the "shell" menu option.<br>
+<li> Added: [InfView] Internationalization files to the distro.<p>
+<b>Revision</b> 1.407 2001/09/22 20:12:36 set<br>
+<li> Fixed: [InfView] Now *all* the commands are enabled/disabled when an
+InfView gets/lose the focus.<br>
+<li> Added: [InfView] The man pages viewer.<br>
+<li> Added: [InfView] Screen configuration. No more broken frames for systems
+with ISO fonts! Ivan Baldo <lubaldo@adinet.com.uy> and Grzegorz Adam
+Hankiewicz <gradha@iname.com> were asking for it.<br>
+<li> Added: [InfView] Internationalization for messages.<br>
+<li> Updated: Spanish translations.<br>
+<li> Modified: [InfView] Moved the new window option to the file menu.<br>
+<li> Added: Code page support to the ManPageView scroll bars.<br>
+<li> Fixed: All ManPageView windows didn't remmember the position (just
+centered every time).<br>
+<li> Modified: edprefs.cc to use CLY_Packed.<p>
+<b>Revision</b> 1.406 2001/09/22 14:58:51 set<br>
+<li> Updated: [InfView] versions and dates in manpage and info file.<br>
+<li> Updated: [InfView] readme file, removed no longer pertinent stuff and
+added the most relevant changes since last release.<p>
+<b>Revision</b> 1.405 2001/09/22 14:46:03 set<br>
+<li> Fixed: The editor didn't store staticUseIndentSize and
+staticDontPurgeSpaces in the desktop file. Reported by Martijn Versteegh.<br>
+<li> Modified: version to 0.4.48.<p>
+<b>Revision</b> 1.404 2001/09/22 14:41:44 set<br>
+<li> Added: [InfView] Instructions about how to load info files stored in the
+current directory. Suggested by Thiago.<br>
+<li> Fixed: [InfView] Now most commands are grayed when no window is available
+reflecting the truth.<br>
+<li> Modidied: [InfView] version to 0.2.7. It have various changes since 0.2.6
+and nobody noticed it.<p>
+<b>Revision</b> 1.403 2001/09/22 02:20:47 set<br>
+<li> Added: An option to disable the R.O. file warning. In this case the
+editor will warn when you try to save so you have an oportunity to revert
+it. Suggested by Marc-Antoine Massicotte <marc.massicotte@videotron.ca>.<p>
+<b>Revision</b> 1.402 2001/09/21 02:25:19 set<br>
+<li> Added: [DOS] More fixes to avoid collisions between conio.h and shipped
+gettext.<br>
+<li> Fixed: New standards seems to enforce a \n at the end of all sources. At
+least gcc 3.0 says that. I added it to all the tests in the configuration
+scripts.<br>
+<li> Fixed: [DOS] GCC 3.0 doesn't compile C++ code using the C compiler. The
+configure script can detect it, but as it only happened with very old gcc
+versions the scripts were looking for gxx and currently the C++ compiler is
+inoked using gpp.<p>
+<b>Revision</b> 1.401 2001/09/21 01:24:38 set<br>
+<li> Modified: As now compatlayer defines uint* I needed to fix some
+collisions.<p>
+<b>Revision</b> 1.400 2001/09/20 01:45:21 set<br>
+<li> Modified: Now the configuration detects more details and defines
+preprocessor variables acording to it. The definitions are also less
+confusing. Now they are OS, OSf (subtype of OS), Comp (Compiler), Compf
+(subtype of compiler) and CPU. With it I removed almost all magic __*__ tests
+that are usually tricky and not so clear.<br>
+<li> Added: Better prefix detection for MinGW.<br>
+<li> Fixed: The version.txt file messed things if ended with \n, now is ok.<br>
+<li> Added: Code to viewplus that I hope will reduce the problems when porting
+to big endian systems. Related to the column/row cursor.<br>
+<li> Fixed: The Perl parser didn't include numbers in function names.<p>
+<b>Revision</b> 1.399 2001/09/16 22:38:45 set<br>
+<li> Added: A test to put the distrib target in the Makefile only if the needed
+tools are installed (zip for DOS and tar for UNIX).<br>
+<li> Added: [DOS] Same for the installer target. The list of needed tools is
+huge. This is a new target and creates the DOS installer.<br>
+<li> Added: [DOS] Instructions if the user doesn't have fileutils installed.<br>
+<li> Added: Configuration of ar for the gettext library.<br>
+<li> Added: A new target (needed) for the Makefile. It compiles any thing needed
+for the editor that isn't created by RHIDE projects.<br>
+<li> Fixed: [DOS] The shipped gettext assumed the user already patched your
+djgpp installation as explained in the gettext 0.10.39 distribution. That's
+impossible if the user never installed it. Now I tweaked the headers and code
+to avoid collisions with conio gettext.<br>
+<li> Fixed: [DOS] Some warnings from gcc 2.95.3 not detected by 2.95.2 for the
+installer.cc file. Related to implicit conversions.<br>
+<li> Fixed: [DOS] Some warnings from binutils 2.11.2 not reported by 2.8.1 in
+mixsurf.c. Related to EOL C++ comments in inline assembler (must be in a
+separated line).<p>
+<b>Revision</b> 1.398 2001/09/16 20:10:00 set<br>
+<li> Fixed: Now the clean target of the Makefile also cleans mpegsound
+objects. Reported by Ivan.<br>
+<li> Applied some fixes for the Debian stuff sent by Ivan.<br>
+<li> Fixed: Now the scripts of distribution updates debian/changelog with my
+name and stating it was a script. Sugested by Ivan.<p>
+<b>Revision</b> 1.397 2001/09/16 17:29:21 set<br>
+<li> Added: Architecture detection to the configure. It defines SECPU_$(Arch).<br>
+<li> Added: GNU make detection to the configure. It supports gmake as name.<br>
+<li> Added: GNU ar detection to the configure. It supports gar as name.<br>
+<li> Fixed: In systems different than Linux and DOS RHIDE makefiles doesn't
+include -lstdc++ (RHIDE_TYPED_LIBS_$(RHIDE_OS).cc is not defined). So now
+the configuration puts them as RHIDE_OS_LIBS. Seen on FreeBSD and Solaris.<br>
+<li> Added: Support for ncurses installed as -lcurses (I saw it in Solaris).<br>
+<li> Added: Now CFLAGS and CXXFLAGS can be passed to the configuration in the
+command line (must use the perl script directly, no the shell script!). It
+made the configset script usable with any UNIX shell (/bin/sh isn't bash in
+a lot of UNIX systems).<br>
+<li> Added: SunOS to the list of systems supported by the configuration. It
+doesn't mean the library is working there.<br>
+<li> Modified: References to __i386__ by SECPU_x86.<br>
+<li> Fixed: Now gpm is detected and not assumed.<br>
+<li> Fixed: The perl pmacros file made reference to an unexistant marker (@4).<br>
+<li> Fixed: When specifying an out of range marker in pmacros a stack
+corruption ocurred.<p>
+<b>Revision</b> 1.396 2001/09/15 22:52:13 set<br>
+<li> Modified: [DOS] The compress script now deletes old manifest/version files
+that could be left by an old version package in the directory where the
+distribution is created.<br>
+<li> Fixed: The arrangements in the order that main initializes things
+affected the SET_FILES error report (made invisible).<p>
+<b>Revision</b> 1.395 2001/09/15 21:56:37 set<br>
+<li> Fixed: If none file was loaded with syntax highlight pressing Atl+F2
+generated a SIGSEGV. Reported by Grzegorz.<br>
+<li> Added: Really simple parsers for .txi and .shl files. (For the Alt+F2).<br>
+<li> Fixed: Some small details to get libset.a compiled.<br>
+<li> Fixed: Is the editor remmembered a file that is read-only at start-up a
+dialog pop-ups asking if we want to revert it, but it happends while the
+editor is still loading files and the problem is that the idle() makes some
+searchs in the list of opened windows. As it isn't completly loaded the
+result was a SIGSEGV.<p>
+<b>Revision</b> 1.394 2001/09/15 19:28:45 set<br>
+<li> Modified: [Linux] Now by default the editor isn't distributed as a
+compressed executable. According to Ivan it could make the kernel waste
+memory.<p>
+<b>Revision</b> 1.393 2001/09/15 19:21:09 set<br>
+<li> Fixed: [Linux] all editor functions that collected word characters (like
+ctrl+right/left arrows) wrongly stopped in accents. The problem was that it
+didn't reflect the selected code page, just CP 437.<p>
+<b>Revision</b> 1.392 2001/09/15 18:45:43 set<br>
+<li> Added: EdReloadIfOpened to rhideint.cc to avoid unresolved references in
+RHIDE. But I'm not sure if that's enough.<p>
+<b>Revision</b> 1.391 2001/09/15 18:39:30 set<br>
+<li> Fixed: When modifying files like ~/.setedit/deflopts.txt with the menues
+and the file was opened by the editor the opened buffer got out of sync.
+Now the editor checks if it was changed and then reloads the file. The same
+applies to nobkp.txt and userword.txt files.<br>
+<li> Fixed: It was possible to fool the editor and open the same file twice
+if it was modified by an external program and saved with another i-node
+value. As a result:<br>
+<li> Modified: Now the editor checks if any of the opened files changed inode
+before opening a new one. That's needed to avoid opening it twice.<br>
+<li> Fixed: When collecting errors/messages the editor didn't check for names
+like it: /dir/../dir/file and similar situations. In this case the editor
+failed to find the information about this file in the project window. Now
+the editor shows only the name of the file as the external program repoted,
+internally adds the right path and ensures the name doesn't have such an
+artifacts.<br>
+<li> Modified: The way I hold the inode/dev is more abstract so other values
+can be used. Currently Win32 target lacks inode information and it could
+help. Also added a mechanism to reload a buffer without closing the window
+and a more generic dialog that limits the lenght of file names.<p>
+<b>Revision</b> 1.390 2001/09/14 02:09:15 set<br>
+<li> Modified: [Linux] Now also the er* files are created in ~/.setedit
+[DOS] If the user defines a home directory they are stored there. Sugested
+by Martijn Versteegh.<p>
+<b>Revision</b> 1.389 2001/09/14 01:50:34 set<br>
+<li> Modified: All the references to the web page to point to Source Forge,
+also some e-mail references and the mailing list address.<br>
+<li> Modified: The text of the readme files to better reflect the current
+situation.<p>
+<b>Revision</b> 1.388 2001/09/12 03:01:34 set<br>
+<li> Modified: Now when you jump to an error the editor puts in the status
+line only the description of the error and not the entire line generated by
+the compiler. That's very useful when you are in deep subdir and the file
+name is quite large using most of the space. After all the file name is the
+name of the window and the line is at the bottom of the window.<p>
+<b>Revision</b> 1.387 2001/09/12 01:04:26 set<br>
+<li> Added: A dialog to show where a file was stored. This dialog limits the
+file name to around 90 characters showing only the last characters and
+indicating with a ~ at the begining if the path was truncated.<br>
+<li> Modified: Cleaned the pathtool interface a little bit now only two
+functions should be used to load/save configuration files: ExpandHome and
+ExpandHomeSave.<br>
+<li> Modified: All modules to use the above mentioned functions.<br>
+<li> Added: Now the editor tries to save configuration files modified by a
+user to ~/.setedit/file. I did it to avoid polluting the home directory and
+to put the default tcedit.dst in a place that nobody should run the editor.
+The editor will load all files from ~/.file but will save them in the
+directory. In this case (or when you load the original file from
+/usr/share/setedit and now the editor is saving it in the home) the editor
+informs the user with a dialog indicating where the file was stored.<br>
+<li> Fixed: The editor failed to set the ShowMatchPairFly from the default
+flags file.<p>
+<b>Revision</b> 1.1.1.1 2001/09/11 13:58:18 set
+Imported sources.<p>
+<b>Revision</b> 1.386 2001/09/09 22:16:36 set<br>
+<li> Fixed: [BC++/Win32] Some unused parameter warnings.<br>
+<li> Fixed: [DOS] Missing header in stackdbg.c (code I blindly wrote on Linux)<br>
+<li> Fixed: Unreachable break detected by BC++.<br>
+<li> Fixed: BC++ doesn't like default argument values in the function itself.<br>
+<li> Fixed: Missing string.h in pperl.cc (gcc 2.95.2 doesn't report it for
+internal functions).<p>
+<b>Revision</b> 1.385 2001/09/09 20:31:58 set<br>
+<li> Added: A tool to find the empty and fuzzy entries in a .po file. Is
+called emptymsg. If you call it passing the names of the .po files to it
+from the editor you'll get a list of missing/fuzzy entries that you can
+browse using Alt+F7/F8. It combined with the special lines (it moves line
+hits as text is added/deleted) and the .po SHL makes much more easy to
+complete .po files.<p>
+<b>Revision</b> 1.384 2001/09/09 20:24:11 set<br>
+<li> Added: A new option to avoid making backups for some particular files.
+The setting is just a list of regex (Perl style) stored in a text file. If
+a file name matches any of the regex the editor doesn't create a backup.
+This option is only available in the standalone editor but is relative
+easy to hook the needed stuff to the class (for RHIDE).<br>
+<li> Added: The above mentioned option to the documentation. Also updated the
+File Open options and mentioned the Options button. Documented the new
+block case functions. Updated the list of SHLs supported.<br>
+<li> Added: A new macro to the docs called @p{} to replace @paragraph{}, it
+is much more convenient.<br>
+<li> Added: A separated header file for loadshl.cc.<br>
+<li> Updated: The spanish translation. Also generated the german file so any
+user could complete it. I think 148 translations are missing or incorrect
+(fuzzy filled) in the german file.<br>
+<li> Modified: [UNIX] Now the editor loads ~/.file first that ~/file for any
+configuration file. I did it because when saving the editor choose ~/.file
+first.<p>
+<b>Revision</b> 1.383 2001/09/09 00:26:11 set<br>
+<li> Fixed: When I changed from absolute to relative projects the memory of
+settings for project items got broken. It was long time ago but I didn't
+realize it because it worked for projects where all files are in the same
+directory and the closed windows also have memory. Now is fixed.<p>
+<b>Revision</b> 1.382 2001/09/08 23:29:25 set<br>
+<li> Added: Block invert case and alternate case. I reused the code of block
+toupper/lower and created those new funny functions.<br>
+<li> Fixed: [UNIX] One of the new messages printed at exit didn't check if we
+effectively redirected stderr trying to print a null pointer.<br>
+<li> Modified: Now File Open dialogs not only remmembers paths+masks but also
+file names (full qualified).<br>
+<li> Fixed: When adding items to a project the only way to exit is by pressing
+ESC, but then the editor didn't remmember the path we used and when
+inserting again we must get it from the history. Now remmembers it.<br>
+<li> Added: The number of lines of the saved text (not only size).<p>
+<b>Revision</b> 1.381 2001/09/08 21:40:39 set<br>
+<li> Added: Code page remap for a block of text (no the whole file). It have
+undo and I reused code from toupper/lower block.<p>
+<b>Revision</b> 1.380 2001/09/08 17:56:38 set<br>
+<li> Fixed: The "backspace unindents" could get confused with lines containing
+only spaces.<br>
+<li> Fixed: The my_popen code used in stackdbg.c and the derivated used in
+symify to close the right file handle and in the right order in the child
+process. I noticed it looking how libc's popen is implemented.<br>
+<li> Fixed: I completly rewrote the my_pclose function used in the above
+mentioned sources because it created zombie process. I also made it more
+robust. I must do some adjusts yet, but now works OK (is just slow).<br>
+<li> Fixed: If argv[0] was just a file name (no relative path and no absolute
+path) the code failed to detect if it had debug symbols.<br>
+<li> Added: Credits to Bjorn and Grzegorz in the about dialog.<br>
+<li> Added: A note about djgpp's implementation of putenv.<br>
+<li> Fixed: Now child processes created by run a program are put in a
+separated session and I kill the group. It is more effective when the child
+creates other processes and one of them hangs. Killing the first child is
+not enough, so now I kill the group. Note: it have an interesting side
+effect that will introduce some changes soon, but is better.<p>
+<b>Revision</b> 1.379 2001/09/08 00:16:36 set<br>
+<li> Modified: [UNIX] Now when expanding compressed info files the temporal
+file is removed just after opening it. Making it we don't let those
+temporals when the editor crashes or we debug it. Is only enabled for UNIX.<p>
+<b>Revision</b> 1.378 2001/09/07 23:48:53 set<br>
+<li> Added: [Linux] Now the editor also dumps a stack trace when crashes. I
+also added a message informing the user where the unsaved buffers and crash
+information can be found.<br>
+<li> Added: [Linux] Two new behaviors in case of a crash. One calls gdb to
+get a detailed stack trace and information about local variables the other
+not only does it but also gives the control to gdb so we can get more
+information. If we are in a X a separated xterm is created for gdb, that's
+really cool! I based it in code by Bjorn Reese <breese@mail1.stofanet.dk>
+that Grzegorz sent me.<br>
+<li> Added: A command line switch to select the behavior of the editor in case
+of a crash. It supersedes the --no-signal option. Also sorted the command
+line options. The name is --stack-dbg (d).<br>
+<li> Added: An environment variable to set the default behavior of -d option.<br>
+<li> Updated: man page to reflect the new command line. Also added two
+environment variables (the new one and other) and sorted the options
+alphabetically.<br>
+<li> Added: [Linux] A tool equivalent to djgpp's symify to process stack
+traces. (tools/symify.cc).<br>
+<li> Fixed: After adding some routines to edspecs.cc InfView gave undefined
+references, so I added a dummy to avoid it.<br>
+<li> Updated: Spanish messages.<br>
+<li> Fixed: I was damaging argv[0]. It was easy to see when running ps, the
+editor name had a space after the last slash.<br>
+<li> Added: A small script to install the editor without stripping debug
+information. It will allow me to start gdb each time the editor crashes on
+my system. I also added the needed code to the makefile and installation
+scripts.<br>
+<li> Modified: Now I call TEventQueue::suspend() from the signal handler
+instead of suspend_keyboard(). I know that's more dangerous but uses a
+standard mechanism.<br>
+<li> Added: Now the editor also prints the signal number in the error file.<p>
+<b>Revision</b> 1.377 2001/09/05 19:19:08 set<br>
+<li> Modified: More details in the routines that closes undesired editors.
+Damn is really tricky.<p>
+<b>Revision</b> 1.376 2001/09/05 17:45:27 set<br>
+<li> Added: A new option to the Run program options dialog. When enabled and
+we get errors from the child process the editor jumps to the first line
+with errors (like in RHIDE).<p>
+<b>Revision</b> 1.375 2001/09/05 17:19:43 set<br>
+<li> Fixed: When enabling the column cursor in a window that wasn't restored
+from disk it sometimes was shorter than what we expect. It was due to a
+wrong initialization of CrossCursorCol member, the same could happend with
+the row cursor.<p>
+<b>Revision</b> 1.374 2001/09/05 16:55:48 set<br>
+<li> Modified: Now I extended the option to forget the cursor position to also
+forget about other settings remmembered for closed and project files.<p>
+<b>Revision</b> 1.373 2001/09/05 16:45:59 set<br>
+<li> Added: Now the "Open only specified files" option is divided in various
+options to give more control about what is stored in the desktop file. Now
+the windows are divided in three types: Editor, Non editors and Closed
+Editors. For each group is possible to set if we want to: remmember it,
+remmember it but if the command line contains file names forget or just
+don't remmember. These nine options replaces the old one. I added it
+because some users didn't like the current behavior and wanted a
+differerent behavior to the one that Ivan sugested when I added it. In
+particular Tatu || Vantte Kilappa <elfire@kymp.net> wanted a middle ground
+behavior.<br>
+<li> Modified: Version to 0.4.47. So we can adapt the old setting and select
+three of the new ones that are equivalent.<br>
+<li> Added: An option to not remmember the cursor position while loading the
+desktop.<br>
+<li> Modified: The edpecs.cc calls. Now it have a separated header and some
+functions that are commonly used. It makes the code more compact and
+readable.<p>
+<b>Revision</b> 1.372 2001/09/05 01:43:28 set<br>
+<li> Fixed: The option to open only the editor indicated in command line was
+broken.<p>
+<b>Revision</b> 1.371 2001/09/04 19:54:40 set<br>
+<li> Added: Syntax highlight for "Cascading Style Sheets v2" contributed by
+S. M. Halloran <mitch@duzen.com.tr>.<br>
+<li> Added: Syntax highlight for "JavaScript" contributed by S. M. Halloran
+<mitch@duzen.com.tr>.<br>
+<li> Added: Syntax highlight for "PostScript" contributed by S. M. Halloran
+<mitch@duzen.com.tr>.<br>
+<li> Added: More tags to the HTML syntax highlight contributed by S. M.
+Halloran <mitch@duzen.com.tr>.<p>
+<b>Revision</b> 1.370 2001/09/04 19:27:19 set<br>
+<li> Fixed: [Win32+BC++] Inserted call to EmptyClipboard in the function that
+sets data in the windows clipboard. Without this call data set by editor
+was not seen by other application. It happened because we did not set
+editor as the clipboard owner. Call to EmptyClipboard does this. It only
+applies to Win32 target, patch from Anatoli Soltan <anatoli@iname.com>.<br>
+<li> Modified: The behavior of Paste from Win Clipboard to be consistent with
+what a regular windows user would expect. Now it just does not copy the
+previous selection to the clipboard and selects the pasted text only if
+persistent blocks are enabled. Patch from Anatoli Soltan
+<anatoli@iname.com>.<p>
+<b>Revision</b> 1.369 2001/09/04 18:04:04 set<br>
+<li> Modified: Now the default color for reserved words is light blue over
+blue and not green over blue.<br>
+<li> Fixed: It was impossible to use CFLAGS options that contained
+option=value because it confused patchenv.pl failing to configure the
+makefiles. Reported by Norberto Alfredo Bensa <nbensa@hotmail.com><p>
+<b>Revision</b> 1.368 2001/09/04 03:49:23 set<br>
+<li> Added: The TColorSelector::mark to the codepage remapper. It wasn't
+available before.<p>
+<b>Revision</b> 1.367 2001/09/04 00:16:18 set<br>
+<li> Added: A new color in the palette for the disabled clusters. Also added
+to the load process that if the palette we are loading doesn't have this
+color it is initialized to a default. So:<br>
+<li> Modified: Version to 0.4.46.<br>
+<li> Added: Now we can specify that one of the error parsers defined in the
+errors.cle file is the internal one. It should be used to use the internal
+GNU parser instead of the defined in the file. Why? is much more faster and
+supports internationalization.<br>
+<li> Modified: Syntax Highlight file to reflect it.<br>
+<li> Modified: Copyright dates in readme files and about dialogs.<br>
+<li> Added: A button to the file open/save/etc dialog to configure the sorting
+options.<br>
+<li> Added: The new options to hide .*/*~/*.bkp and sort .* to the end to the
+dialog to configure the file open dialog.<br>
+<li> Fixed: The above mentioned dialog was broken when I created the 32 bits
+clusters and generated SIGSEGVs.<br>
+<li> Fixed: The patch I did to avoid crashes when no CLE files were available
+disabled the other parsers.<br>
+<li> Fixed: The generic error parsers some times added an extra / generating
+file names with to consecutive / (invalid for UNIX).<p>
+<b>Revision</b> 1.366 2001/09/03 17:44:10 set<br>
+<li> Added: Documentation for the new Run Program options.<br>
+<li> Modified: Now words in italic are represented enclosed by `' in the text
+and info outputs.<p>
+<b>Revision</b> 1.365 2001/09/02 00:33:59 set<br>
+<li> Fixed: If no default options file was defined the default mask used to
+reset modes was just 16 bits and not 32 clearing "Use indent size",
+"Don't purge spaces" and "Backspace unindents". So they failed to be
+transfered from global to local options.<p>
+<b>Revision</b> 1.364 2001/09/02 00:07:08 set<br>
+<li> Fixed: [Linux] A bug in the use of putenv, it made the editor fail to
+detect the /tmp dir. As a result the editor created temporal files in the
+current directory.<p>
+<b>Revision</b> 1.363 2001/09/01 23:25:36 set<br>
+<li> Added: A warning message if when the user tries to exit the child still
+running or we still parsing the errors. If the user wants to exit anyways
+the editor first stops it.<p>
+<b>Revision</b> 1.362 2001/09/01 23:03:55 set<br>
+<li> Added: Status line shortcuts for the Message Window (in the 3 menu files
+and in editmenu.cc).<br>
+<li> Fixed: Now Prev/Next message are enabled only if the Message Window
+really have lines to jump to.<br>
+<li> Added: [Linux] The run external program option now can run the program
+in background. It can optionally disabled by the user.<br>
+<li> Added: The background process can be stopped just selecting the Message
+Window and pressing Ctrl+C. The status line indicates if that's available
+or not (the process is running or we still parsing their output).<br>
+<li> Added: Now the messages/errors from the external program can be parsed
+in background. Is slower but you can continue working. That's the default
+when the command runs in parallel, but can be enabled even if the process
+will block the editor.<br>
+<li> Added: Options to configure how often the Message Window is updated when
+the messages are parsed in parallel with the child program (the parameter
+is how many lines are processed before releasing the CPU to poll input
+devices). Also to configure if the window is forced to scroll or not.<br>
+<li> Updated: The spanish translation.<br>
+<li> Fixed: The new bufun.cc option to browse the functions didn't update the
+special lines arrays.<br>
+<li> Modified: The interface to show messages in the Message Window to add all
+of this gadgets. I wrote an equivalent in rhideint.cc I hope it won't break
+RHIDE.<br>
+<li> Fixed: Now the Message Window only scrolls to the first line only if we
+collected lines to jump. It was the original idea but was wrongly
+implemented.<br>
+<li> Added: Dialogs to avoid the user running a second child process in:
+Run External Program, SDG and Grep. Sure I missed something ;-)<br>
+<li> Fixed: Internationalized some messages I forgot while coding.<br>
+<li> Modified: Now is possible to enter comands upto 256 characters long in
+the run external program dialog (was 80).<br>
+<li> Fixed: When running `make' as the external program the editor keeps track
+of the various directory changes that makes does (nested makefiles). That's
+needed for programs that reports errors giving relative names. The problem
+was that when using spanish messages the editor got confused. Now the
+editor tries with english and if it fails tries translating it. Currently
+only english and spanish are supported but that's done with the .mo file
+so any language can be supported without recompiling.<br>
+<li> Fixed: The GNU errors parsed was fulled by some gcc messages like it:
+In file included by .....:line:\n
+Now those lines are discarded.<p>
+<b>Revision</b> 1.361 2001/08/31 19:32:09 set<br>
+<li> Modified: Now if the terminal have a fixed code page that we know and
+can't be changed then the editor disables the recoding mechanism. That's
+true for terminals like xterm (enhanced VT100).<p>
+<b>Revision</b> 1.360 2001/08/31 19:30:01 set<br>
+<li> Added: Perl function parser to the bufun.cc mechanism. Also added more
+information to the bufun.h file.<p>
+<b>Revision</b> 1.359 2001/08/29 23:41:50 set<br>
+<li> Added: A shell option to the Linux version. I ever thinked it wasn't a
+good idea but a user asked for it. Sugested by David Xu
+<davidx@viasoft.com.cn>.<p>
+<b>Revision</b> 1.358 2001/08/29 20:31:25 set<br>
+<li> Modified: Now when a file that was stored in the desktop file no longer
+exists the editor doesn't open an empty window. Sugested by Martijn
+Versteegh <m.versteegh@hccnet.nl><p>
+<b>Revision</b> 1.357 2001/08/29 16:39:42 set<br>
+<li> Added: Now is possible to specify the Turbo Vision library and includes
+path as parameters for the configuration script. That's useful for systems
+with prefixes like /opt. Sugested by Joel Soete <joel.soete@freebel.net>.<p>
+<b>Revision</b> 1.356 2001/08/29 00:40:50 set<br>
+<li> Fixed: When jumping to another manpage double clicking the name of the
+new one the window didn't update their title.<br>
+<li> Fixed: A bug introduce in the last changes to the manpage viewer. I was
+releasing twice the name of the temporary stderr file (because librhtv
+deletes it internally).<p>
+<b>Revision</b> 1.355 2001/08/28 18:37:24 set<br>
+<li> Added: Sources of gettext 0.10.39 configured to avoid libiconv. They are
+intended for DOS users that doesn't have gettext installed or want to get a
+much smaller executable (like me). I decided it after a discussion in the
+djgpp-workers list, even the DOS porter of gettext Juan Manuel Guerrero
+<st001906@hrz1.hrz.tu-darmstadt.de> sugested it for the editor's case.<p>
+<b>Revision</b> 1.354 2001/08/28 14:32:16 set<br>
+<li> Added: Support for gettext 0.10.37 and newer that needs libiconv. I tested
+it with 0.10.39 and 1.7. Even when that's supported the result is quite bad,
+for the DOS target the binary grows 829 Kb and when compressed 614 Kb. That's
+unacceptable. The size of the compressed editor is currently about 480 Kb and
+grows to 1094 Kb.<p>
+<b>Revision</b> 1.353 2001/08/27 20:37:06 set<br>
+<li> Modified: Removed the bufun.h inclusion in ced_exte.h to reduce
+dependencies.<br>
+<li> Fixed: If the errors.cle file wasn't there the editor crashed when you run
+external programs. Reported by Grzegorz.<p>
+<b>Revision</b> 1.352 2001/08/27 19:37:44 set<br>
+<li> Modified: I moved all the bufun.cc definitions to an independent header
+called bufun.h. Also renamed the buffers and exported them so other parsers
+can reuse it.<br>
+<li> Added: Now the Clipper parser detects the last line of functions and also
+adds information to the name indicating if the function is a procedure and
+if the static qualifier was used.<p>
+<b>Revision</b> 1.351 2001/08/26 00:36:52 set<br>
+<li> Added: Now the jump to function mechanism (bufun.cc) can support languages
+other than C/C++. I added Clipper support and Grzegorz is working on a LaTex
+parser.<p>
+<b>Revision</b> 1.350 2001/08/16 01:28:18 set<br>
+<li> Added: A patch to avoid problems when including ced_clas.h twice. From
+Robert.<br>
+<li> Fixed: A problem in the libset library used by RHIDE. Now rhideint.cc
+must provide EdJumpToMessage(), currently is just a dummy.<p>
+<b>Revision</b> 1.349 2001/08/14 22:56:21 set<br>
+<li> Added: A comment about buggy GeForce BIOSes in the Win/DOS FAQ. They seems
+to have similar bugs to Matrox BIOSes. Thanks to Andy <Bitland@aol.com>.<br>
+<li> Added: A button to the function list called "Browse". It sends the list of
+functions to the message window sorted alphabetically or by line number and
+then you can browse the source code jumping from function to function.
+Sugested by Grzegorz Adam Hankiewicz <gradha@iname.com>.
+It added a new parameter to SelectFunctionToJump.<br>
+<li> Added: Now when the user have one central desktop file the editor makes a
+back-up of it before writing a new one. This is quite useful for Windows
+systems that likes to crash and corrupt files. Sugested by S. M. Halloran
+<mitch@duzen.com.tr>.<p>
+<b>Revision</b> 1.348 2001/08/14 17:51:12 set<br>
+<li> Fixed: InfView's search dialog was broken due to aligment in the
+TFindInfDialogRec structure. Now is marked with pack(1) to avoid it, I guess
+that's something new with gcc 2.95.x.<p>
+<b>Revision</b> 1.347 2001/08/14 00:56:24 set<br>
+<li> Fixed: [Linux] When a manpage didn't exist Linux's man outputs to stderr
+a message. In the past the editor missed it giving no help to the user and
+also letting an error file in the home directory. Now stderr is also
+redirected and if stdout is empty stderr is shown. Reported by
+"GiBa" <giba@lacasilla.com.ar>.<br>
+<li> Fixed: utod.pl again.<br>
+<li> Modified: The makefile so makes/linux/compress.pl doesn't need to be
+executable (CVS likes to forget it because my CVS in a fat32 partition).<p>
+<b>Revision</b> 1.346 2001/08/13 23:16:50 set<br>
+<li> Fixed: A bug in "Intelligent C indent". A parenthesis after a / was not
+counted leading to wrong indentation. I hope the new code really fixed it
+without breaking other detail.<p>
+<b>Revision</b> 1.345 2001/08/13 22:38:37 set<br>
+<li> Modified: To make recode happy now the CP850 files are ever converted to
+DOS format (not only in Linux). I made utod.pl more reliable too.<br>
+<li> Added: SHL for .po files.<br>
+<li> Added: German translations, thanks to Oliver Schieche
+<oliver.schieche@d2mail.de>. Also added it to the Linux and DOS distribution
+and to the installer (was tricky).<br>
+<li> Added: All the Turbo Vision messages to the translations, so I updated the
+spanish translation.<br>
+<li> Fixed: The message window scrolled horizontally only 255 columns and lines
+are allowed to be 1000 columns (then are wrapped). So now you can fully
+scroll upto 1000 columns.<p>
+<b>Revision</b> 1.344 2001/08/13 18:13:21 set<br>
+<li> Added: Preload to C/C++, Perl and Makefile SHLs.<br>
+<li> Added: Objetive C and PDP 11 assembler SHLs contributed by Beni Cherniavsky
+<cben@crosswinds.net>.<br>
+<li> Added: Preload keyword to the .shl SHL.<br>
+<li> Added: The Emacs mode for .frt files as "sdg", also added to a couple of
+.frt files because they generate files with "texinfo" markers confusing the
+editor.<br>
+<li> Added: link and mailto commands to the html.frt as sugested by Florian
+Xaver.<p>
+<b>Revision</b> 1.343 2001/08/13 17:30:24 set<br>
+<li> Modified: Now the keywords of the syntax highlights aren't loaded at
+start-up, intead they are loaded on demand. The keywords and the search
+tables are the most memory consuming parts of the syntax highlight structure.<br>
+<li> Added: A Preload keyword to force the most commonly used SHL keywords to be
+loaded at start-up.<br>
+<li> Fixed: Added to the distribution a file I forgot in the upload of the last
+beta.<p>
+<b>Revision</b> 1.342 2001/08/12 17:50:39 set<br>
+<li> Compiled with BC++ 5.5:<br>
+<li> Added: A comment in BC++ 5.5 port making explicit where should be TV
+located.<br>
+<li> Fixed: A use of variable size array in ceditor.cc (AllocLocalStr now)
+(Win32).<br>
+<li> Fixed: Use of strcasecmp without Uses_string (Win32).<p>
+<b>Revision</b> 1.341 2001/08/12 16:07:46 set<br>
+<li> Merged patches from Andris addressing compiling issues when using gcc 2.97
+and newer releases:
+1) #endif at the end of files must have a new line character at the end.
+2) strlen and other internal functions now needs #include <string.h>
+3) The need for ## concatenation in macros is no longer needed when symbols
+are around the variable and now is deprecated. I left the old code (disabled)
+just in case it breaks very old gcc releases so we can just make it
+conditional.
+4) Is no longer valid to cast a pointer to a smaller integer, so now two
+consecutive casts are needed, one to convert the pointer into an integer and
+another to cut down the integer. This is used in the keyboard routines where
+collections uses void * to store 16 bits unsigned values.<br>
+<li> Added: Support for ".inf.gz" extension (from Andris patch)<p>
+<b>Revision</b> 1.340 2001/08/11 01:40:17 set<br>
+<li> Added: CommentIndent command, it indents a block with the EOLCom1
+definition. Sugested by Thiago.<br>
+<li> Added: CommentUnIndent, it unindents a block using the length of EOLCom1 as
+reference. Sugested by Thiago.<br>
+<li> Fixed: UnIndentBlock failed to update the syntax highlight, it was clear
+after removing the comments in the block.<br>
+<li> Fixed: The undo of the arbitrary indent used the starting selection instead
+of the final one generating problems for long blocks.<p>
+<b>Revision</b> 1.339 2001/08/10 02:50:36 set<br>
+<li> Added: sLisp commands:
+ OpenFile: opens a file as a new window. (Asked by "Thiago F.G. Albuquerque"
+ <tfga@zaz.com.br>)
+ length: returns the length of a string.
+ strcasecmp/strcmp: compares strings.
+ Operator -: for integers.<br>
+<li> Added: these new commands to the syntax highlight and documentation (also
+strstr).<p>
+<b>Revision</b> 1.338 2001/08/05 23:35:46 set<br>
+<li> Modified: The way the PREFIX is passed to the compress scripts to allow
+the main makefile to generate the distribution. It should be reworked.<p>
+<b>Revision</b> 1.337 2001/08/04 23:41:01 set<br>
+<li> Added: New configuration option to avoid using FHS structure and set it
+for my configuration.<br>
+<li> Added: Distribution targets to the main makefile they pass the FHS
+options to the makes/Makefile.<br>
+<li> Modified: The way the es_iso.po file is created to avoid stupid problems
+from recode. The recode and gettext are generating problems all the time.<p>
+<b>Revision</b> 1.336 2000/12/09 21:32:42 set<br>
+<li> Merged changes from Anatoli for the BC++ configuration process. Also makes
+pmacros files support DOS format in UNIX.<br>
+<li> Added: Comments in the FAQ about Cirrus boards that have problems under W9x<br>
+<li> Updated: the WinNT/readme.txt file to reflect the actual process.<br>
+<li> Fixed: The 'D' shortcut was used twice in the redmond.smn for the File
+menu. Reported by Jeremy W. Murphy <jwm@amc.com.au>.<br>
+<li> Added: A dialog asking if a compressed file saved with "save as" should be
+also saved compressed. Reported by Gregorio.<br>
+<li> Added: A TODO file.<br>
+<li> Fixed: More conflicts between gettext and conio.<br>
+<li> Fixed: Now when closing a project the window title (of the application)
+reverts to "No project loaded". Reported by Jeremy W. Murphy <jwm@amc.com.au>.<br>
+<li> Fixed: Compilation problems when PCRE wasn't available.<p>
+<b>Revision</b> 1.335 2000/08/09 23:30:23 set<br>
+<li> Fixed: The editor didn't preserve the UID/GID of files when creating
+back-ups.<br>
+<li> Fixed: When loading some old desktop files with black palettes (created by
+some really old versions of the editor) you got a black screen. Now the editor
+checks for such a silly situation and reverts to the default palette.<p>
+<b>Revision</b> 1.334 2000/06/27 02:37:03 set<br>
+<li> Modified: Now using gettext 0.10.35.<br>
+<li> Modified: Now using RHIDE 1.4.7.6.<p>
+<b>Revision</b> 1.333 2000/06/27 01:16:08 set<br>
+<li> Fixed: Some pmacros needed "back space unindents" *NHP*.<br>
+<li> Modified: Now using bzip2 v1.0, it is supposed to be more bullet-proof when
+uncompressing garbage. Thanks god I included it directly because the
+function names changed from 0.x to 1.0 (added BZ2_ prefix).<p>
+<b>Revision</b> 1.332 2000/06/13 23:36:49 set<br>
+<li> Added: Warning about Creative PCI boards not supported by Allegro.<br>
+<li> Modified: TMixDiag constructor to avoid calling gettext inlined because
+gcc 2.95.2 doesn't like it. I suspect that's a bug in gcc because 2.7.x and
+2.8.x doesn't reject it.<br>
+<li> Added: A desktop lock while parsing the errors output from external
+programs to reduce the redraw. Linux's frame buffer is poorly implemented and
+have a really bad performance producing amazingly huge delays. Reported by
+Grzegorz.<p>
+<b>Revision</b> 1.331 2000/06/06 00:49:03 set<br>
+<li> Added: A check and warning for/by makeinfo during configuration.<p>
+<b>Revision</b> 1.330 2000/06/06 00:41:40 set<br>
+<li> Added: A check for xgettext in the configuration script and a warning if
+recode isn't installed.<p>
+<b>Revision</b> 1.329 2000/06/06 00:19:36 set<br>
+<li> Fixed: Now the configure tells if recode wasn't found.<br>
+<li> Fixed: Warning in menuload.cc with gcc 2.7.2.3.<br>
+<li> Ignored doc/Makefile in the CVS.<p>
+<b>Revision</b> 1.328 2000/06/04 18:37:36 set<br>
+<li> Added: Now all modes are supported in the Mode setence used by the pmacros.<br>
+<li> Added: Now the $if command supports and/or operators for menu files.<br>
+<li> Added: The MP3 list can be loaded/saved as a WinAmp M3U list.<p>
+<b>Revision</b> 1.327 2000/05/25 19:12:56 set<br>
+<li> Added: An option to configure the BC++ port to generate a dynamic/static
+executable.<br>
+<li> Fixed: Now when passing a list of files to grep the filenames are quoted to
+avoid problems with file names containing spaces. Reported by Grzegorz.<br>
+<li> Modified: The check to see if grep is installed. It now checks for GNU grep
+to avoid problems with other implementations. In particular Inprise version
+that is quite far from POSIX.<br>
+<li> Warning: I discovered that BC++ and MingW libraries have a really buggy
+system function, it can just crash Windows 95 misserably when passing long
+command lines, lets say 3.5 Kb. It can affect the editor stability.<p>
+<b>Revision</b> 1.326 2000/05/25 15:21:33 set<br>
+<li> Added: Now the configure mechanism generates the BC++ makefiles. With it
+all the targets now uses the information found in the .gpr files to compile.
+It means I just need to keep updated the list of files to include in the
+distribution, all the other makefiles are generated from RHIDE's projects
+(djgpp/Linux/Win32 directly and BC++ indirectly).<p>
+<b>Revision</b> 1.325 2000/05/22 23:49:30 set<br>
+<li> New: Now the MingW port uses the same makefiles than the DOS and Linux
+targets. It means this port will be quite updated without taking special
+care.<br>
+<li> Modified: Now the configure script doesn't overwrite the configed.h file if
+it wasn't changed. That's good to avoid a masive recompile when it isn't in
+fact needed.<br>
+<li> Updated: The configuration library with changes in the TV version of it.<br>
+<li> Added: A mechanism to change more variables in RHIDE makefiles from the
+configure script.<br>
+<li> Fixed: EasyDiag's TSTextScroller size.<br>
+<li> Modified: Now the about box have a TSTextScroller because I added thanks to
+Vadim and Anatoli.<p>
+<b>Revision</b> 1.324 2000/05/20 13:19:03 set<br>
+<li> New: Now thanks to changes from Anatoli Soltan merged in TV the exe
+generated with BC++ runs under Win95 and NT.<br>
+<li> Added: Configuration mechanism to support the new syntax of recode 3.5. It
+also allows to make the editor in machines without recode.<br>
+<li> Added: Code to the configuration library to generate makefiles from
+templates of makefiles doing some search & replace.<br>
+<li> Merged small changes from Anantoli Soltan to the BC++ makefiles. They allow
+creating the help file (makeinfo for Win32 is shipped) and installing the
+compiled files.<br>
+<li> Added: A couple of new pmacros to Clipper.<br>
+<li> Fixed: The BC++ errors parsing definition (errors.cle).<br>
+<li> Fixed: A table in the manual (strftime options).<br>
+<li> Fixed: Now sdh.c uses getcwd (no getwd) because (a) getwd is deprecated (I
+saw it in Linux and Oswald Buddenhagen <ob6@inf.tu-dresden.de> asked to fix
+it) and (b) getwd doesn't exist for BC++ so Anatoli sent patches to replace
+it. Now the compatlayer is used for it.<br>
+<li> Fixed: The generation of .html files from the .txt ones. Now < and > are
+replaced. Reported by Neil Parks <nparks@torah.org>.<br>
+<li> Fixed: When following a list of errors/hits with Alt+F8 in some cases the
+previous hit wasn't cleared.<p>
+<b>Revision</b> 1.323 2000/05/17 23:09:36 set<br>
+<li> Modified: Some details in EasyDiag: OK+Cancel buttons to work in growable
+dialogs and xTSRight,xTSLeft and xTSLeftOf calculations (hope nothing got
+screwed).<br>
+<li> Modified: Now the list of functions lists members like this "member
+(class)" instead of C++ syntax "class::member". It makes the incremental
+search much more simple.<br>
+<li> Modified: The list of functions and list of windows now have horizontal
+scroll bar. Also: they are EasyDiag dialogs now.<p>
+<b>Revision</b> 1.322 2000/05/16 02:10:23 set<br>
+<li> Fixed: A crash when deleting all the items (and one more ;-) in the MP3
+list. Only happend if you did it very quickly.<br>
+<li> Added: An horizontal scroll bar to the MP3 list dialog.<br>
+<li> Added: Now easydiag list boxes can have two scroll bars. I modified TV a
+little bit to make it easier.<p>
+<b>Revision</b> 1.321 2000/05/16 00:17:29 set<br>
+<li> Fixed: The error pattern description for Borland C compilers. Now it works
+for BC++ 5.5. Grzegorz reported problems and I fixed it.<br>
+<li> Added: clear keyword to the HTML syntax. Suggested by Grzegorz.<br>
+<li> Fixed: The syntax hl for shell scripts needed EscapeAnywhere=1. Reported by
+Grzegorz.<br>
+<li> Added: SQL syntax. Contributed by Jeremy W. Murphy <jwm@amc.com.au>.<br>
+<li> Fixed: The editor added read-only copies to the list of closed windows when
+closing one of them. It produced a crash when opening the file from the
+closed list. Reported by Volker Kiefel"<volker.kiefel@med.uni-rostock.de>.<p>
+<b>Revision</b> 1.320 2000/05/15 01:00:28 root (set)<br>
+<li> Added: Palette support to the Linux version. Also changed the palette
+values to be 0-255 instead of 0-63 to be more generic. Lamentably it looks
+like Linux people forgot to add a get palette sequence, is that correct? if
+all half done?<p>
+<b>Revision</b> 1.319 2000/05/13 19:58:38 set<br>
+<li> Added: A new option that forces the editor to do the match pair 'on the
+fly' without waiting for idle. Suggested by Oswald Buddenhagen
+<ob6@inf.tu-dresden.de>.<br>
+<li> Modified: Now backspace behavior is not tied to the Real Tabs option. It
+have your own option. It was suggested by others in the past but Oswald
+finally made me do it ;-)<br>
+<li> Updated: The documentation to reflect all the new modes.<br>
+<li> Modified: accehtml.cc line 31 to workaround a bug in egcs (doesn't like
+calls to static members specifying an object!).<br>
+<li> Fixed: Now if you have two functions with the same name SDG will list both
+in the index. Reported by Gregorio.<br>
+<li> Modified: Version to 0.4.45.<p>
+<b>Revision</b> 1.318 2000/05/12 23:16:40 root (set)<br>
+<li> Fixed: The configure script was looking for the dinamic TV when static was
+specified.<br>
+<li> Fixed: infbase.cc request of filelength.<p>
+<b>Revision</b> 1.317 2000/05/12 02:19:46 set<br>
+<li> Incorporated the Win9x and WinNT versions. The WinNT version was introduced
+thanks to Anatoli Soltan <anatoli@iname.com> and is for BC++ 5.5 compiler.<br>
+<li> Moved some stuff to a new library (part of TV now) and will move even more
+things. The idea is to avoid an excess of conditionals. This introduced
+changes in almost all sources.<br>
+<li> Adapted to compile with MingW32 for Win32.<p>
+<b>Revision</b> 1.316 2000/04/29 17:55:05 root (set)<br>
+<li> Modified: Gave 2 more rows for the mixer sliders.<br>
+<li> Modified: Added more description to the mixer name.<p>
+<b>Revision</b> 1.315 2000/04/29 17:04:55 set<br>
+<li> Added: Board level sound mixer. As this is something I want and not all the
+people seems to agree that this is desirable I added options to: (a) disable
+it at compilation time (HAVE_MIXER and --without-mixer) and (b) a run time
+option (command line --no-mixer). Under DOS only SB Pro and SB 16 compatible
+mixers are supported. Under Linux OSS mixer is supported. The values can be
+optionally stored in the desktop file.<br>
+<li> Changed: I synchronized the configuration library with the one used by TV.<br>
+<li> Added: A new EasyDiag object called TSSlider. Is used for the volume
+settings in the mixer's dialog.<br>
+<li> Fixed: A GPF when the editor was stopped during a list play operation and
+it was restored in another run.<br>
+<li> Fixed: A small detail in mpegsound from 0.8.3 new version.<p>
+<b>Revision</b> 1.314 2000/04/20 19:16:19 set<br>
+<li> Added: </li keyword to HTML syntax. Suggested by Grzegorz.<br>
+<li> Added: A new option: Don't purge spaces. When enabled the spaces at the end
+of lines aren't automafically deleted by the editor. Suggested by Martijn
+Versteegh <versteegh@kvi.nl>, wasn't the first user.<br>
+<li> Added: Warning about bugs in xgettext in the makefile.<br>
+<li> Updated: The spanish traslation.<p>
+<b>Revision</b> 1.313 2000/04/16 20:17:03 root (set)<br>
+<li> Added: MP3 support to the Linux version.<p>
+<b>Revision</b> 1.312 2000/04/16 18:23:34 set<br>
+<li> Added: A new library for MP3 files. That's the library used by Linux's
+splay. I added support for MP3s inside wavs, damaged MP3 files, VBR encoded
+files and more to this code. Users should consider it under test.<br>
+<li> Added: The mpegsound library to the configuration process. I keep libamp
+and is possible to choose between the two engines.<br>
+<li> Fixed: The use of 2 sets of flags in the .mak files (one from the
+RHIDE_OS_FLAGS and the other from CFLAGS).<br>
+<li> Added: A set of C/C++ flags for parts of the project that needs strong
+optimization, like the MP3 engines.<br>
+<li> Fixed: Some problems with the version of the information stored for closed
+files. It wasn't present in releases, just in WIP versions.<br>
+<li> Fixed: Bug in relative paths interpretation of the code that parses
+messages from external programs.<p>
+<b>Revision</b> 1.311 2000/04/13 00:37:46 root (set)<br>
+<li> Updated: .gpr file and sources for the new TV dependencies (tv/...).<br>
+<li> Updated: version.txt file.<p>
+<b>Revision</b> 1.310 2000/02/27 20:14:19 set<br>
+<li> Added: Now tab size, indent size and wrap column are stored for closed
+files and project items.<br>
+<li> Fixed: InfView now doesn't hang if the node can't be found.<br>
+<li> Added: InfView now looks in all the file if the node isn't found in the
+first try. It helps for handedited/damaged info files I saw it in files that
+David Cabanillas Barbacil <davidc@ibernet.com> sent me (GPC help files).<p>
+<b>Revision</b> 1.309 2000/02/27 18:52:13 set<br>
+<li> Added: Yet another tab option: Now is possible to indent using spaces but
+also using an indentation ammount different than the tab size. The new option
+is called "Use indent size" and you can also configure the value of "indent
+size". In this way is possible to code like Allegro's guidelines say:
+"Basic Allegro style: K&R, with 3 space indentation. On disk, though, tab
+stops are 8 spaces, so if for example a line was indented by 12 spaces, this
+would be saved out as either 12 space characters or 1 tab and 4 spaces, not
+as 4 tabs.". It was proposed by Martijn Versteegh <versteegh@kvi.nl>.<br>
+<li> Modified: As a result of these new settings now we have 17 global flags, it
+overflowed the traditional TV limit of 16 bits. To overcome it I added a 32
+bits version of radio buttons and check boxes to TV. It isn't the final
+solution because I think these dialogs really need a new layout. Anyways, as
+I think 32 bits is more suitable for gcc now the editor uses 32 bits options
+in all places. To achieve it I was forced to modify a lot of structures and
+dialogs. Tested most of them, I hope no bugs were introduced.<br>
+<li> Modified: As a result of this I did a cleaning job in the editor dialogs. I
+added some EasyDiag goodies: a new TSViewCol constructor that creates a
+default dialog (that's the most common case), a variation of doIt that sets
+the dialog as centered and configures the help context (doItCentered), a new
+positioning option yTSUpSep it puts the object on top of the dialog but
+letting some space between the frame and the object and multicolumn radio
+buttons and check boxes. Now EasyDiag also defaults to 32 bits options, it
+can be disabled defining Dont_Use_32Bits_Clusters. I also added a callback to
+TV buttons and modified TSButton to reflect it. yTSUp was fixed.<br>
+<li> Modified: Version to 0.4.43.<p>
+<b>Revision</b> 1.308 2000/02/24 23:10:40 set<br>
+<li> Fixed: Applied some patches from Alex Lozano for EasyDiag. They fix
+problems with xTSLeft and yTSOver (I don't usually use them). I applied one
+of the patches with a small variant.<p>
+<b>Revision</b> 1.307 2000/02/23 00:31:22 set<br>
+<li> Added: A new option in Search & Replace, it shows the name of the function
+where the match was found (only for C/C++ and if the match is inside).
+Suggested by Jeremy W. Murphy <jwm@amc.com.au>.<br>
+<li> Modified: Version to 0.4.42 (change in S&R flags).<p>
+<b>Revision</b> 1.306 2000/02/22 01:25:57 set<br>
+<li> Added: A new command called cmcWhichFunctionIs. It determines the name of
+the function where the cursor is positioned. It isn't the fastest thing in
+the world because it collects the list of all functions, but as bufun.cc is
+really fast I think that's ok. It isn't associated to a key. I also commented
+how the magic heuristic of bufun.cc works. This addition is the first step
+to create a mechanism suggested by Jeremy W. Murphy.<p>
+<b>Revision</b> 1.305 2000/02/22 00:12:46 set<br>
+<li> Fixed: When using the match pair on the fly the editor always forced a line
+flush even if the cursor weren't in a potential match. Now that's done only
+if the cursor is over {, }, (, ), [ or ]. A side effect of this behavior was
+reported as a bug by Martijn Versteegh <versteegh@kvi.nl>.<p>
+<b>Revision</b> 1.304 2000/02/21 23:57:39 set<br>
+<li> Fixed: When loading .dst files older than 0.4.32 the memorized flags for
+closed files were converted in the wrong way. Some times enabling the cross
+cursor.<p>
+<b>Revision</b> 1.303 2000/02/21 23:21:49 set<br>
+<li> Fixed: Small typos in new documentation.<br>
+<li> Fixed: Uninitialized data in the cross cursor stuff that could generate
+GPFs.<p>
+<b>Revision</b> 1.302 2000/02/13 21:48:02 set<br>
+<li> Added: a new command (LineOrScrEnd), that's 100% equivalent to VI's g-end.
+The previously added (LastColInScreen) isn't 100% equal. The new one doesn't
+go to the last column of the screen if the end of line is first. Information
+provided by Leon <Leon@caresystems.com.au>.<p>
+<b>Revision</b> 1.301 2000/02/13 21:26:57 set<br>
+<li> Added: Now the calculator supports commas like in C code. Patch from
+Burton. I also documented more details of the new calculator.<br>
+<li> Fixed: The >= of the calculator had a typo that prevented it to work.<p>
+<b>Revision</b> 1.300 2000/02/13 20:55:18 set<br>
+<li> Added: shtml files to the html syntax. Suggested by Gregorio.<br>
+<li> Added: Real support for Texinfo 4.0's Ref: references. They jump to the
+correct node and positions the cursor at the right line.<br>
+<li> Added: Now is possible to have two files with the same file name in
+projects if they are different files (from different directories). After some
+talk with Gregorio.<p>
+<b>Revision</b> 1.299 2000/02/13 14:01:11 set<br>
+<li> Added: Now the list of functions takes the word under cursor including
+colons. That's needed for C++. Suggested by Alex.<br>
+<li> Added: Now the list of functions is more cleaver and looks for C++ members
+with the name of the word under cursor if no function with this name was
+found.<br>
+<li> Fixed: Some potential GPF and fails to update the new entries in the user
+words.<br>
+<li> Fixed: GPFs produced by the column and row cursors when the cursor was
+outside the visible area.<p>
+<b>Revision</b> 1.298 2000/02/05 21:44:25 set<br>
+<li> Fixed: Some spelling errors (remmember, allready and latter). Reported by
+Bernd Becker <munin@munin.inka.de> and Philip (FireEgl) <FireEgl@EMail.com>.<br>
+<li> Added: Now double clicking in Alt+0 window is the same as pressing the Go
+button. Suggested by Philip (FireEgl) <FireEgl@EMail.com>.<br>
+<li> Fixed: ESC doesn't reset the palette to defaults in the palette dialog.
+Reported by Philip (FireEgl) <FireEgl@EMail.com>.<br>
+<li> Modified: Now the FileOpen dialog used in the project and MP3 list says
+"Done" instead of "Cancel". Suggested by Waldemar Schultz
+<schultz@ma.tum.de>.<p>
+<b>Revision</b> 1.297 2000/02/03 01:19:08 set<br>
+<li> Modified: The version of some tools I use in the README.<br>
+<li> Added: [Linux] Explanation to one posible source of "can't open terminal"
+error in the FAQ.<br>
+<li> Fixed: [InfView] Now "Open InfView" works even if no InfView window is
+opened. Reported by Ivan.<br>
+<li> Modified: All the needed places to support the new location of TV headers.
+It changed the dependencies.<p>
+<b>Revision</b> 1.295 2000/01/26 00:41:53 set<br>
+<li> Added: Now InfView also looks for .info.bz2 and .bz2 files. So entering
+(editor) InfView will try to load editor.bz2 and editor.info.bz2. Only when
+bzip2 support is compiled.<p>
+<b>Revision</b> 1.294 2000/01/26 00:25:10 set<br>
+<li> Fixed: A small error in the MSVC errors parsing. Pointed out by Grzegorz.<br>
+<li> Added: Now the editor alters the W9x window title adding information about
+the version and loaded project. That's what "Jeremy W. Murphy"
+<jwm@amc.com.au> originally suggested. I do it in a way that it isn't
+permanent, even if the program crashes.<p>
+<b>Revision</b> 1.293 2000/01/22 17:57:49 set<br>
+<li> Added: A new calculator parser from Burton Radons. It adds conditionals,
+variables definitions and function definitions. The old parser and a small
+version of this new one can be selected during configuration.<p>
+<b>Revision</b> 1.292 2000/01/20 00:55:20 set<br>
+<li> Updated: Copyrights for year 2000.<br>
+<li> Added: Copyright of bzip2 and knowledgement in the about box. Also for
+Zlib.<br>
+<li> Added: Jump to last column, it could need some adjusts. Is supposed to be
+the equivalent of g-end in VI. Suggested by Leon <Leon@caresystems.com.au>.<p>
+<b>Revision</b> 1.291 2000/01/18 00:01:42 set<br>
+<li> Added: Configurable status line. So now is possible to configure all the
+keys used by the editor, specially Copy/Paste in input lines. Dean Limbaugh
+<edl@ns1.co.alachua.fl.us> and Bernd Becker <munin@munin.inka.de> were two of
+the users that asked for it, I just don't remember the rest.<br>
+<li> Added: Transparent support for bzip2 compressed files. It works for regular
+files and info files. The info file should have the same extension used by
+gz. I know Mandrake uses bzip2 compressed info files but don't know the exact
+name so I guess it will need some adjusts. It also means the executable is
+larger. And the memory requirements for saving bzip2 files are big. I added
+it after a report from Salazar <jsalaz3@almez.pntic.mec.es> talking about
+problems with Mandrake 6.0.
+<hr>v0.4.41 14th public release.<p>
+<b>Revision</b> 1.290 2000/01/02 19:31:56 set<br>
+<li>Fixed: Problems with project files. Reported by Ryan Owen <ryan@eyring.com>.<p>
+<b>Revision</b> 1.289 2000/01/02 16:40:06 set<br>
+<li> Adjustemnts to release v0.4.41.<p>
+<b>Revision</b> 1.288 1999/12/31 16:41:06 set<br>
+<li> Modified: more details to workaround bugs in makeinfo 4.0 related to the
+Table Of Contents.<p>
+<b>Revision</b> 1.287 1999/12/31 15:16:22 set<br>
+<li> Added: A new menu option to save the project manually. Suggested by
+"Jeremy W. Murphy" <jwm@amc.com.au><p>
+<b>Revision</b> 1.286 1999/12/29 23:46:37 root (set)<br>
+<li> Fixed: Abort when pressing ENTER in the message window without items.<p>
+<b>Revision</b> 1.285 1999/12/29 23:25:27 root (set)<br>
+<li> Fixed: [Linux] A bug introduced in 1.209/10 revisions when saving files
+in DOS format. Reported by Gregorio.<p>
+<b>Revision</b> 1.284 1999/12/29 00:56:53 set<br>
+<li> Added: Now the project window also says the name of the project file.
+Suggested by "Jeremy W. Murphy" <jwm@amc.com.au>.<br>
+<li> Applied: Changes to the Debian packaging files. Now the infview can be
+generated as another package. From Ivan.<p>
+<b>Revision</b> 1.283 1999/12/21 23:49:11 root (set)<br>
+<li> Fixed: A bug in sLisp when handling strings with escape sequences
+(\n, \t, etc.). Probably introduced in 1.187. Reported by Uwe Steinmann
+<steinm@majestix.fernuni-hagen.de>.<p>
+<b>Revision</b> 1.282 1999/12/19 21:48:31 root (set)<br>
+<li> Added: Now you can pass extra command line options using an environment
+variable called SET_CMDLINE.<p>
+<b>Revision</b> 1.281 1999/12/19 19:57:20 root (set)<br>
+<li> Added: Support for .info files created with texinfo 4.0 that includes Ref:
+tags in the indirect table. I didn't investigate how they work but the files
+can be used.<br>
+<li> Added: Support for makeinfo from texinfo 4.0 to generate the documentation.
+I needed to fool makeinfo adding an extra @contents at the top of the txt
+file, don't know why. Reported by Ivan who is using Potato (Debian 2.2).<br>
+<li> Added: New command line option +[line number], like in VI. Suggested by
+Ivan, looks like some tools uses it, in this way we can just replace VI by
+SETEdit when using these tools.<p>
+<b>Revision</b> 1.280 1999/12/05 16:16:42 root (set)<br>
+<li> Added: Now when calling the man page viewer the editor offers the word
+under cursor as man page.<p>
+<b>Revision</b> 1.279 1999/12/05 15:34:18 root (set)<br>
+<li> Modified: Version to 0.4.41.<br>
+<li> Fixed: [Linux] When switching from hidden to normal desktop files the
+editor left the hidden version of the desktop file generating potential
+confusions. Now the hidden file is removed. That's i just another annoyiance
+of the silly hidden files mechanism.<br>
+<li> Modified: [DOS] Now the editor also looks for HOME and HOMEDIR when loading
+configuration files. Also: the directory where the exe is located is the one
+looked at last.<p>
+<b>Revision</b> 1.278 1999/11/30 00:25:25 set<br>
+<li> Fixed: The ~K~eep short-cut in the SDG options was used for O~K~. Reported
+by Gregorio.<br>
+<li> Modified: Now the message window shows ^M if the line contains /r.<p>
+<b>Revision</b> 1.277 1999/11/29 23:33:31 set<br>
+<li> Fixed: GPF/SIGSEGV when using BackSpace in the functions list to delete the
+first letter in the incremental search. Reported by Gregorio.<p>
+<b>Revision</b> 1.276 1999/11/21 21:25:58 set<br>
+<li> Added: Configurable mechanism to parse the errors collected from an
+external application. It uses Perl RegEx to do the job. Suggested by
+Gregorio.<p>
+<b>Revision</b> 1.275 1999/11/21 14:37:44 set<br>
+<li> Added: A new shl flag "EscapeAnywhere" this switch makes the editor parse
+the escape character outside strings.<p>
+<b>Revision</b> 1.274 1999/11/21 12:49:57 set<br>
+<li> Changed: The way the INFOPATH is guessed under DOS. A djgpp user installed
+the editor outside the djgpp tree and then the editor used INFOPATH but
+failed to find the setedit.inf file. Now the editor also adds your tree even
+if INFOPATH is defined. Reported by Sylvia <smlew@ifocus.com.sg>.<p>
+<b>Revision</b> 1.273 1999/11/20 15:28:44 set<br>
+<li> Fixed: When inserting items to the project the editor used the *.epr mask
+instead of the one used to open regular files. Reported by Gregorio.<p>
+<b>Revision</b> 1.272 1999/11/20 14:41:23 set<br>
+<li> Added: Syntax highlight for PLM/51 contributed by Jari Korhonen
+<jari.korhonen@ponsse.fi>. (Intel's long-gone not-so-highlevel language for
+8051 CPUs).<p>
+<b>Revision</b> 1.271 1999/11/05 00:28:59 set<br>
+<li> Fixed: [DOS] Compilation problems with gcc 2.95 in the plasma stuff.<br>
+<li> Added: [Linux] ISO-8859-1 spanish messages.<p>
+<b>Revision</b> 1.270 1999/10/30 20:50:55 root (set)<br>
+<li> Added: Spanish messages to Linux distribution, that's the first try and
+needs more work.<p>
+<b>Revision</b> 1.269 1999/10/30 15:30:38 root (set)<br>
+<li> Added: A command line switch to specify files to load from an external list
+of files where each line is a file. Suggested by SpaZe.<p>
+<b>Revision</b> 1.268 1999/10/30 14:51:41 root (set)<br>
+<li> Added: New command line switches to the --help help and the man page.<p>
+<b>Revision</b> 1.267 1999/10/30 14:40:57 root (set)<br>
+<li> Modified: Now if you use "load only specified files" the editor doesn't
+really load the files to then close'm like before. Now the TCEditor class
+have a special flag to simulate the load without actually loading the file
+content. Only the InfView windows are actually loaded. It makes things
+faster.<br>
+<li> Added: Three command line switches: --tile-vert, --tile-horiz and --cascade
+to make these operations after loading the files from the desktop file or
+named in the command line. Suggested by Spaze.<p>
+<b>Revision</b> 1.266 1999/10/30 13:34:38 root (set)<br>
+<li> Modified: Now the new option to search the word when you press ^F1 inside
+the node takes the visible name you choose from the list and not the word
+under cursor. Suggested by Gregorio.<p>
+<b>Revision</b> 1.265 1999/10/29 01:48:14 root (set)<br>
+<li> Added: [Linux] call to dch to update the Debian version during the package
+creation. Suggested by Ivan.<br>
+<li> Added: [Linux] InfView man page. Pointed out by Ivan,<p>
+<b>Revision</b> 1.264 1999/10/29 00:54:28 set<br>
+<li> Added: The reverse operation for "HTML accents". Suggested by Gregorio.<p>
+<b>Revision</b> 1.263 1999/10/26 00:04:43 set<br>
+<li> Added: [Linux] Now the convert HTML accents feature also works in Linux,
+was just matter of enabling it.<br>
+<li> Added: Now the file open dialog is resizeble. Suggested by Gregorio.<br>
+<li> Modified: [Linux] Now the editor disables the Xon/Xoff mode of the terminal
+so ^Q/^S aren't used for it. It enables the use of ^Q and ^S when running in
+an Xterm, Eterm, etc.<p>
+<b>Revision</b> 1.262 1999/10/23 19:50:08 set<br>
+<li> Added: Yet another tab mode. "Tab indents", it is by default enabled
+because that's what the editor ever did. Disabling it the editor will behave
+like when using tabs but will insert spaces instead of tabs.<p>
+<b>Revision</b> 1.261 1999/10/23 18:51:04 set<br>
+<li> Fixed: Crashes when starting the editor and it was playing an MP3 file that
+don't exists anymore.
+.<hr>v0.4.39 13th public release.<p>
+<b>Revision</b> 1.260 1999/10/17 15:01:18 set<br>
+<li> Added: The spanish messages to the distribution.<br>
+<li> Added: The installer uses spanish messages when the system is configured
+for it.<br>
+<li> Prepared for a new release.<p>
+<b>Revision</b> 1.259 1999/10/17 00:36:49 set<br>
+<li> Added: Now the Alt+F2 functions serach can search C++ operators too. I hope
+it didn't break other thing ;-). Asked by Andris.<p>
+<b>Revision</b> 1.258 1999/10/16 01:13:04 set<br>
+<li> Added: An option to make InfView search the word under cursor when you did
+a syntax search, but inside the selected topic. Hmmm... how to explain it,
+just use ^F1 and see. Suggested by Grzegorz Adam Hankiewicz <gradha@iname.com><br>
+<li> Added: Now you can use double click to select an item in the ^F1 list of
+hints. Suggested by Jeremy W. Murphy <jwm@amc.com.au><br>
+<li> Added: [Linux] The no/overwrite status is showed in the indicator (at the
+right of the modified star). Suggested by Dean Limbaugh
+<edl@ns1.co.alachua.fl.us>.<p>
+<b>Revision</b> 1.257 1999/10/15 01:56:05 set<br>
+<li> Added: A new command to decode "quoted printable" text. I need it to
+demangle spanish mails in MIME format.<br>
+<li> Added: A new indentation command that allows to indent with any arbitrary
+text. I need it to quote parts of mails (usually using "> ").<br>
+<li> Added: These commands to the menu, documentation, context sensitive help
+and spanish translation. Also added the other indentation commands to the
+menu.<p>
+<b>Revision</b> 1.256 1999/10/14 01:17:33 root<br>
+<li> Removed the libamp from the Linux distribution, it isn't needed and the
+copyright could produce some confusion.<br>
+<li> Fixed: I forgot to add infview.mak to the list of makefiles to patch.<br>
+<li> Fixed: A multiline crossreference in the documentation.<p>
+<b>Revision</b> 1.255 1999/10/14 00:12:25 set<br>
+<li> Changed: kextend license to Public Domain so Debian purist can't complain.<br>
+<li> Added: Now the linux.faq is also installed in the docs directory as
+faq.txt.<p>
+<b>Revision</b> 1.254 1999/10/13 23:47:39 set<br>
+<li> Fixed: When using a central tcedit.dst file was possible to get the cursor
+unsynchronized with the no/overwrite mode. Reported by Grzegorz Adam
+Hankiewicz <gradha@iname.com>.<p>
+<b>Revision</b> 1.253 1999/10/13 00:49:19 set<br>
+<li> Added: Redraw command to the editor (in menu and documented).<br>
+<li> Updated: Debian files (from Ivan).<br>
+<li> Documented: sLisp AskString.<br>
+<li> Modified: Now the printer setup is saved/restored using i/opstream instead
+of fpstream to allow RHIDE save it. Patch from Robert.<br>
+<li> Updated: Spanish messages.<p>
+<b>Revision</b> 1.252 1999/10/10 22:41:12 set<br>
+<li> Added: sLisp command AskString, it pop-up a dialog asking for user input.<br>
+<li> Added: Some documentation about the mouse under Linux. Suggested by Ivan.<br>
+<li> Changed: The example of macro from menu is now more useful, it pop-ups a
+dialog and you can enter a command, the output of this command is inserted at
+the cursor position. Ivan asked for such an option from the menu.<br>
+<li> Added: Now the sLisp InsertText function doesn't allow the insertion of
+text with \n and not \r\n under DOS (not well tested).<p>
+<b>Revision</b> 1.251 1999/10/10 21:43:08 set<br>
+<li> Fixed: Target all must be the first in the makefile.<br>
+<li> Fixed: Target infview needs to be PHONY because doesn't have dependencies.<br>
+<li> Added: Now plasmas are also in the makefile.<br>
+<li> Fixed: Typo in windoldap.cc<br>
+<li> Added: Now when jumping to a line with errors the editor ever highlights it
+and also shows the error in the status line.<br>
+<li> Fixed: libamp can't be compiled with -Wall -Werro so pathenv.pl avoids it.<br>
+<li> Added: When an external program returns errors the editor jumps to the
+first line in the message window. Also, the editor adds a message to know the
+control is back again in the editor.<p>
+<b>Revision</b> 1.250 1999/10/10 14:47:54 set<br>
+<li> Added: DOS Greek keyboard support (code page 737). Requested by Pavlos to
+make accelerators work in both, english and greek, modes.<br>
+<li> Updated: The list of available characters in the editor's fonts.<br>
+<li> Added: Defaults for newer characters in the fonts.<br>
+<li> Added: [DOS] The keyboard mode is saved => v0.4.38.<br>
+<li> Fixed: One bug in the code page/fonts handling. Deleting a font twice.<br>
+<li> Added: Support for the following code pages:
+ Latin: DOS 775, 857, 861; UNIX 8859-3, 8859-4, 8859-9, 8859-14, 8859-15;
+ Windows 1250, 1252, 1254, 1257
+ Cyrillic: KOI-8 CRL, ISO-IR-111/153/146/147, Mac CP10007 (and Ukraininan
+ variant), U-Code R, KOI-7, Osnovnoj Variant Russian,
+ Alternativnyj Variant RU.
+ Greek: DOS 737, 869; Windows 1253 and UNIX 8859-7
+ A total of 27 code pages!
+ Pavlos and Alexander Bokovoy provided information for greek and cyrillic
+ code pages.<p>
+<b>Revision</b> 1.249 1999/10/02 21:48:12 set<br>
+<li> Added: Basic TeX syntax highlight, contributed by Alexander Bokovoy.<br>
+<li> Added: TCL syntax highlight, contributed by FireEgl <FireEgl@EMail.com>.<br>
+<li> Added: Wrapper example for collecting Turbo Pascal 7.0 errors. Contributed
+by Andreas Leidner <leidner@gmx.net>.<br>
+<li> Added: --libset option to the configure script, it creates targets in the
+makefile for libset.a (needed for RHIDE). Requested by Robert.<br>
+<li> Added: InfView to the configure mechanism and --no-infview to avoid
+compiling it.<br>
+<li> Modified: now the Makefile generated by configure script is more modular so
+you can do "make editor", "make infview", "make install-editor", etc.<p>
+<b>Revision</b> 1.248 1999/10/02 18:51:19 set<br>
+<li> Added: New sLisp command ShortFileName. Needed to pass SFNs to external
+programs. Requested by Andreas Leidner <leidner@gmx.net> to pass files to
+Turbo Pascal 7.0.<p>
+<b>Revision</b> 1.247 1999/10/02 14:50:40 set<br>
+<li> Fixed: A lot of warnings from gcc 2.95, don't know if all (const missing
+type, char * not const, assembler clobber lists, etc.).<br>
+<li> Added: Now the code page remapping routines converts symbols not found in
+the destination code page to similar ones. Example: accented letter to same
+letter not accented. It works for latin symbols, now I'm waiting for
+Alexander's tables for cyrilic symbols.<p>
+<b>Revision</b> 1.246 1999/09/30 02:58:16 set<br>
+<li> Added: Code page remaping. It should work for all the supported code pages.
+Documented, added to menues, translated to spanish, etc. I was thinking about
+adding it because I write some mails in DOS and then Alexander Bokovoy asked
+for it (for russian code pages, they are a mess). The last settings are
+stored in the desktop file so new version 0.4.37.<p>
+<b>Revision</b> 1.245 1999/09/29 00:39:39 set<br>
+<li> Added: A new editor command called cmcCutClipWin to cut text to Windows
+clipboard. Suggested by Spaze. I also mention it in the documentation and
+give an example in redmond.smn about how to use the Windows clipboard instead
+of the internal one.<p>
+<b>Revision</b> 1.244 1999/09/29 00:08:02 set<br>
+<li> Added: The emu387.dxe emulator so the editor can be installed in systems
+without coprocessor. Suggested and tested by "Eathan Clark"
+<eathan@cableone.net>.<p>
+<b>Revision</b> 1.243 1999/09/28 23:20:29 root (set)<br>
+<li> Fixed: Now if the message window is outside the screen that's fixed at load
+time. I don't really know the reason for it but Gregorio and me experimented
+it. Is something related with running the editor with different screen
+resolutions. Reported by Gregorio.<p>
+<b>Revision</b> 1.242 1999/09/28 23:06:39 root (set)<br>
+<li> Fixed: [Linux] Paste in input likes failed. Reported by Ivan.<br>
+<li> Fixed: When pasting in input lines not all the text was selected and the
+cursor wasn't well positioned.<br>
+<li> Fixed: The new special character shl feature wasn't parsed by the
+multilines parser, only for the painting parser. Reported by "FireEgl
+(Philip)" <FireEgl@EMail.com>.<br>
+<li> Added: Now if you double click over name(section) construction in a man
+page window the editor jumps to this manpage. Suggested by Ivan.<p>
+<b>Revision</b> 1.241 1999/09/28 03:32:55 root (set)<br>
+<li> Fixed: configure mechanism wasn't setting the static/dynamic exe correctly.<br>
+<li> Removed debian/rhide.env from CVS and makes/lista.<p>
+<b>Revision</b> 1.240 1999/09/28 03:03:07 root (set)<br>
+<li> Applied patches for the Debian package from Ivan.<br>
+<li> Fixed: The editor was creating a tcedit.dst file in /usr/share/setedit if
+you selected to save only one centralized file. That isn't correct, this
+directory could be read-only. If you want default options to be global for all
+the users you can copy tcedit.dst to /usr/share/setedit, but the editor won't
+save there; the HOME directory will be used instead. Reported by Ivan.<br>
+<li> Fixed: debian/doc-base was missing in the distribution.<br>
+<li> Fixed: Compilation problems with glibc 2.1.2 because the use of __USE_GNU
+instead of _GNU_SOURCE. Patch from Ivan.<p>
+<b>Revision</b> 1.239 1999/09/26 20:30:43 set<br>
+<li> Added: Jump to prototype command. That's very similar to jump to function.
+Suggested by Pavlos.<p>
+<b>Revision</b> 1.238 1999/09/26 16:34:58 set<br>
+<li> Added: MP3's ID3 genre field to the MP3 dialog. "Pavlos" <gtoub@otenet.gr>
+provided the first 100 names and I added another 42 from WinAmp 1.90.<p>
+<b>Revision</b> 1.237 1999/09/26 15:15:35 set<br>
+<li> Documented: The new match directives for SHL.<br>
+<li> Added: A rudimentary SHL for Makefiles.<p>
+<b>Revision</b> 1.236 1999/09/26 14:35:08 set<br>
+<li> Added: Conditional compilation for PCRE>=2.0 and <=2.05 from the configure
+script (was present manually).<br>
+<li> Added: Now is possible to associate a SHL with a file name using regular
+expressions (PCREs). You can give regex to match the file name or the whole
+path+name. It is needed for things like makefiles and was asked by Ivan and
+Gregorio. (NameMatch and FullNameMatch).<br>
+<li> Modified: Now the configure script for Linux can take any amount of
+parameters. Patch by Ivan.<p>
+<b>Revision</b> 1.235 1999/09/25 20:46:16 set<br>
+<li> Fixed: An error in the configure script, it wasn't saving the version of
+the detected zlib (the code tested instead ;-))<br>
+<li> Fixed: When adding new user words they wasn't visible until the next
+redraw, that's forced now.<br>
+<li> Fixed: It was posible to save a block with the name of an opened file. Even
+when the editor issued a warning about overwriting a file it could have bad
+side effects.<p>
+<b>Revision</b> 1.234 1999/09/25 19:30:07 set<br>
+<li> Added: Now is possible to indicate that EOLComment1 must be in the first
+column and EOLComment2 don't.<br>
+<li> Added: Now is also possible to tell to the editor that an EOLComment is
+valid if it's located in the first non-blank character. Seems to be needed
+for TCL. Suggested by "FireEgl (Philip)" <FireEgl@EMail.com>.<p>
+<b>Revision</b> 1.233 1999/09/25 18:01:51 set<br>
+<li> Fixed: [DOS] A bug in djgpp v2.02 libc system() function that left child
+exes opened leaking file handles and preventing external compilers to
+overwrite the file. It only happened for non-djgpp programs. "Andreas
+Leidner" <leidner@gmx.net>.<p>
+<b>Revision</b> 1.232 1999/09/25 16:52:49 set<br>
+<li> Fixed: One define in windoldap.h file. Reported by Pavlos.<br>
+<li> Fixed: An egcs warning (egcs bug) reported by Ilker Aksen
+<Ilker.Aksen@astrazeneca.com>.<br>
+<li> Fixed: [DOS] Wrong manifest file name for InfView. Reported by SpaZe/ST
+<stealth.tech@seznam.cz>.<br>
+<li> Fixed: Two typos (asigNment). Reported by Spaze.<br>
+<li> Fixed: The "Test" button in screen savers dialog only worked if the screen
+saver was ON before entering in the dialog. Reported by Spaze.<br>
+<li> Fixed: Wrong width of the dialog to choose a command. Reported by Spaze.<p>
+<b>Revision</b> 1.231 1999/09/25 16:34:57 root<br>
+<li> Fixed: [Linux] The editor was creating userwords.txt and default settings
+in /usr/share/setedit instead of user's home. Reported by Ilker Aksen
+<Ilker.Aksen@astrazeneca.com>.<br>
+<li> Fixed: [Linux] SIGSEGVs when using hidden desktop files. Reported by Ilker
+Aksen <Ilker.Aksen@astrazeneca.com>.<p>
+<b>Revision</b> 1.230 1999/09/25 14:31:02 set<br>
+<li> Fixed: When Match Pair and Wrap Columns were enabled and the match happened
+in the wrap column the editor did really stupid things.<p>
+<b>Revision</b> 1.229 1999/09/25 02:01:26 root (set)<br>
+<li> Fixed: A crash when a file failed to load [only seen in Linux]. Reported by
+Steve Wagor <stevew@uis.net>.<br>
+<li> Fixed: If the file had less than 2 bytes it was reported as a read error
+[only under Linux and when using glibc 2.1]. Reported by Steve Wagor
+<stevew@uis.net>.<p>
+<b>Revision</b> 1.228 1999/09/25 01:00:13 set<br>
+<li> Fixed: various typos in the web page, thanks to Steve Wagor <stevew@uis.net><p>
+<b>Revision</b> 1.227 1999/09/25 00:27:34 set<br>
+<li> Added: Now the editor pass to external screen savers a file handle for a
+file that contains the screen contents. It allows external screen savers
+based on the current screen contents. Suggested by Gregorio.<p>
+<b>Revision</b> 1.226 1999/09/24 02:55:09 set<br>
+<li> Fixed: The Info and Help buttons of the Screen Savers setup window were
+ever enabled and generated SIGSEGVs if used for internal screen savers.
+Reported by Gregorio. Also by Ilker Aksen <Ilker.Aksen@astrazeneca.com>.<p>
+<b>Revision</b> 1.225 1999/09/24 00:20:33 set<br>
+<li> Modified name to ForceUpdate because that's better and was the name I used
+in the list.<p>
+<b>Revision</b> 1.224 1999/09/24 00:17:27 set<br>
+<li> Added: New sLisp command: ForceRedraw asked by Endlisnis.<p>
+<b>Revision</b> 1.223 1999/09/21 00:39:43 set<br>
+<li> Fixed: When Alt+F2 didn't find any function it said No instead of Ok in the
+dialog. Reported by Jeremy.<br>
+<li> Added: sLisp constants for WhichEditor to avoid "magic numbers",
+documented.<br>
+<li> Added: GetSyntaxAtCursor sLisp command to know if the cursor is inside a
+comment, a preprocessor line or a string. Suggested by Endlisnis.<p>
+<b>Revision</b> 1.222 1999/09/19 20:53:44 set<br>
+<li> Added: Full list of Spanish messages. Also fixed some menu and dialog
+messages while testing the Spanish messages (cosmetic stuff).<p>
+<b>Revision</b> 1.221 1999/09/19 14:33:28 set<br>
+<li> Modified: Now the InfView desktop file is called infview.dkt.<br>
+<li> Fixed: InfView wasn't inserting the new infview windows as tileable so Tile
+didn't work. (Both also for the LDD).<p>
+<b>Revision</b> 1.220 1999/09/19 14:23:12 set<br>
+<li> Fixed: InfView didn't paint the first match in a search across a file that
+forced a node switch, other matchs in the same node were painted.<br>
+<li> Fixed: InfView left the match selection on after a node switch and was
+visible until the cursor was moved.<br>
+<li> Fixed: InfView v0.2.4 said v0.2.5.<br>
+<li> Fixed: InfView command line example said `info' instead of `infview'
+(imagine why ;-))<br>
+<li> Fixed: InfView was giving the same priority to partial matchs and perfect
+matchs when the partial appears first. (in search best match member).<br>
+<li> Fixed: The cmcForceMatchPairHL command was recorded when recording macros
+from keyboard so the length of the macro was enlarged without gaining any
+functionallity, now is filtered.
+<< All these bugs were detected by me while preparing a conference for the
+<< Linux Demo Day here in Buenos Aires ;-)<p>
+<b>Revision</b> 1.219 1999/09/17 03:43:42 root (set)<br>
+<li> Added: Support for FHS in the configure script and the Linux compress
+script.<br>
+<li> Fixed: Some details in the configure mechanism for Linux.<p>
+<b>Revision</b> 1.218 1999/09/16 02:25:38 set<br>
+<li> Added: Now the file dialog stores the path in the history even if you
+abort. It also remmembers the last mask used. Suggested by Pavlos.<p>
+<b>Revision</b> 1.217 1999/09/15 23:50:51 set<br>
+<li> Fixed: The calendar object was pretending to be an ASCII table so when its
+window was closed it didn't remove yourself from the list making Alt+0 to
+crash. Reported by "Jeremy W. Murphy" <jwm@amc.com.au> and "Pavlos"
+<gtoub@otenet.gr>.<p>
+<b>Revision</b> 1.216 1999/09/15 23:18:18 set<br>
+<li> Documented new commands and linked to the contex sensitive help.<br>
+<li> Fixed: The editor was trying a partial match for a reserved word before to
+check for a full match with a user reserved word. It could be experimented
+only with the Texinfo shl; I noticed it while updating the docs.<p>
+<b>Revision</b> 1.215 1999/09/15 22:50:30 set<br>
+<li> Added: cmcPushCursorPos and cmcPopCursorPos. They use a 12 levels (11
+usable) circular stack (to avoid memory leaks). Added to the Edit menu.<br>
+<li> Added: cmcToggleCharCase "This is vi's '~' command -- it toggles the
+case of the char under the cursor". Added to menu, also added block to
+upper/lower. Both additions were suggested by Thiago F.G. Albuquerque
+<thiagofga@ambr.com.br>.<p>
+<b>Revision</b> 1.214 1999/09/12 19:43:01 set<br>
+<li> Added: A lot of stuff for the configure mechanism, now it have the minimal
+functionallity needed and works OK. I also added comments to the README,
+added checks for consistency between the version.txt file and headers, fixed
+various problems with the libamp compilation, etc.<p>
+<b>Revision</b> 1.213 1999/09/12 00:18:22 set<br>
+<li> Fixed: [Linux] the editor didn't read the right keybind.dat file. So
+defining/undefining keys under Linux was quite hard. The file is created as
+.keybind.dat and the editor was looking for keybind.dat. I don't remmember
+when this problem was introduced.<br>
+<li> Fixed: Preprocessor lines that included a comment were drawn with an ASCII
+0 at the end of the line. That's usually invisible, but not when using
+ISO-LAT1U fonts (mainly Linux).<p>
+<b>Revision</b> 1.212 1999/09/12 00:09:35 set<br>
+<li> Fixed: A couple of bugs in the "delete file from disk" feature of the
+windows list: a) Using a freed pointer and b) Asking for save a file that
+will be erased anyways.<p>
+<b>Revision</b> 1.211 1999/09/08 00:13:22 root (set)<br>
+<li> Added: A check to see if the current directory is valid. Using bash you can
+easilly delete the current directory and be "in the land of nowhere". If you
+run the editor from such a place it gets really confused and does really
+stupid things so is better to just abort and ask the user to be serious.<p>
+<b>Revision</b> 1.210 1999/09/07 23:54:30 root (set)<br>
+<li> Fixed: Save files as DOS (under Linux) could fail. It was mostly related to
+the previous bug, but I added some code to make it independient.<p>
+<b>Revision</b> 1.209 1999/09/07 23:44:18 root (set)<br>
+<li> Fixed: Linux version wasn't converting DOS files to UNIX format. The result
+was mixed style files! Don't know why I never saw this error.<p>
+<b>Revision</b> 1.208 1999/09/07 23:00:27 set<br>
+<li> Fixed: Now ^C and ^/ are disabled in Linux.<p>
+<b>Revision</b> 1.207 1999/09/04 20:53:44 set<br>
+<li> Added: Now the pseudo macros can be selected from the menu. It helps
+people to learn what pmacros are available. To allow it now each pmacros have
+a descriptive name. This addition is to allow more powerful pmacros in the
+future. Documented.<br>
+<li> Added: Documentation for the Export as HTML feature.<br>
+<li> Added: An option to export the text as HTML but without using colors.
+.<hr>v0.4.35 12th public release.<p>
+<b>Revision</b> 1.206 1999/09/03 23:34:41 set<br>
+<li> Changed version to 0.4.35 to make a release.<p>
+<b>Revision</b> 1.205 1999/09/03 01:06:26 set<br>
+<li> Added: PMacros for HTML, they are very simple but could save some typing.<p>
+<b>Revision</b> 1.204 1999/09/03 00:24:48 root (set)<br>
+<li> Fixed: Problems when using more than 128 columns. Now the limit is 255x255.<br>
+<li> Fixed: Redraw needed when loading a desktop that was used with a big
+resolution in one smaller [under Linux]. Is funny to see how the editor
+reacts if you change from 80x25 to 132x60 using SVGATextMode in other console
+while the editor is running.<p>
+<b>Revision</b> 1.203 1999/09/02 00:17:50 set<br>
+<li> Added: Now the amount of closed windows remmembered in the Alt+0 list is
+configurable from Tool&Ops|Options|Editor General. Suggested by Jeremy W.
+Murphy <jwm@amc.com.au>.<p>
+<b>Revision</b> 1.202 1999/09/01 23:48:24 set<br>
+<li> Modified: Now sLisp commands (and ...) and (or ...) are logical operators.<br>
+<li> Added: New sLisp operators (& ...) and (| ...) bitwise counterparts.
+Suggested by Endlisnis.<br>
+<li> Fixed: Windows that had a "remmembered" mode with column cursor on produced
+SIGSEGVs because of some unitialized variable.<p>
+<b>Revision</b> 1.201 1999/09/01 02:14:24 set<br>
+<li> Fixed: The editor was asking for save when switching to other window and
+the current was modified.<br>
+<li> Added: Export as HTML option. Suggested by Pavlos.<p>
+<b>Revision</b> 1.200 1999/08/30 22:26:17 set<br>
+<li> Fixed: I forgot to include the extrscsv.txt file in the 0.4.34 distribution
+so external screen savers aren't accessable from the menu :-(. So only some
+users will be able to try'em.
+<hr>v0.4.34 11th public release. Released as beta because of problems.<p>
+<b>Revision</b> 1.199 1999/08/29 18:34:49 root (set)<br>
+<li> Added: Version of PCRE needed in the README.<br>
+<li> Fixed: a constant without type in manview.h.<br>
+<li> Added: Workaround for a bug in gcc 2.95 in runprog.cc.<p>
+<b>Revision</b> 1.198 1999/08/29 15:00:18 root (set)<br>
+<li> Fixed: SIGSEGV (under Linux and pure DOS) when trying to modify an empty
+list of user reserved words.<p>
+<b>Revision</b> 1.197 1999/08/29 14:46:08 set<br>
+<li> Added: Comments about the new switch for buggy BIOSes in the DOS/Windows
+FAQ.<br>
+<li> Fixed: uppercase user reserved words not working for C files. Reported by
+Pavlos.<br>
+<li> Fixed: OK button grayed when editing user reserved words and none was
+entered. Reported by Pavlos.<p>
+<b>Revision</b> 1.196 1999/08/26 01:57:20 set<br>
+<li> Cosmetic change in install.cc to avoid Allegro's color depths and joystick
+drivers to be included (I already ensure it in another way). Suggested by
+Pavlos.<br>
+<li> Fixed: An outdated command in the mp3 playing files about Allegro's low
+quality sound. Pointed out by Pavlos.<p>
+<b>Revision</b> 1.195 1999/08/26 01:39:31 set<br>
+<li> Fixed: A bug in the MP3 player PAUSE. Reported by Pavlos <gtoub@otenet.gr><p>
+<b>Revision</b> 1.194 1999/08/25 02:52:45 root (set)<br>
+<li> Added: The man page to the Linux package and installation process.<p>
+<b>Revision</b> 1.193 1999/08/25 01:18:44 root (set)<br>
+<li> Modified: The sleep time when idle under Linux. I reduced it to just 10
+microseconds because if I let 1 ms the keyboard repeat rate becomes erratic.
+Don't know exactly what's wrong. Doing it the editor doesn't eat CPU and works
+ok.<p>
+<b>Revision</b> 1.192 1999/08/25 00:04:43 set<br>
+<li> Fixed: Now the sLisp ComplChoose doesn't wait for keystrokes if no
+expression is provided or just one is provided. Pointed out by Endlisnis.<br>
+<li> Documented: The existence and use of the sLisp command "if". I exist since
+the starting days but never was documented.<br>
+<li> Added: New sLisp commands: and or not<p>
+<b>Revision</b> 1.191 1999/08/22 23:25:31 set<br>
+<li> Upgrade to PCRE 2.07.<br>
+<li> Fixed: various warnings from gcc 2.96.<br>
+<li> Fixed: Transparent blocks bug that was experimented when using white as
+selection color. I saw it while Agata was using the editor ... this girl will
+blow my brains in one or another way.<p>
+<b>Revision</b> 1.190 1999/08/22 21:03:24 set<br>
+<li> Added: Some FAQs to the DOS FAQs file about the mouse.<p>
+<b>Revision</b> 1.189 1999/08/22 20:44:28 set<br>
+<li> Modified: Some small details in the readme files to make them easier for
+Linux people. Looks like some of them are too much structured and fails to
+find things if they have a small difference. Suggested by Taura
+<learfox@deltanet.com>.<p>
+<b>Revision</b> 1.188 1999/08/22 20:29:04 set<br>
+<li> Fixed: Problems when pressing ^/ under W9x. This key triggers SIGQUIT in
+djgpp's library but for some reason this mechanism fails and finally makes
+W9x get upset. Reported by Jeremy W. Murphy <jwm@amc.com.au><p>
+<b>Revision</b> 1.187 1999/08/22 20:01:08 set<br>
+<li> Modified: Now sLisp strings supports escape sequences similar to the ones
+used for C. There are a small difference: /n is expanded as /r/n for DOS and
+to get just /n you must use /l (stands for Line feed). Previous behavior was
+expand the escape sequences only when inserting text to an editor buffer. I
+did it to fix some problems in an example provided by Endlisnis.<p>
+<b>Revision</b> 1.186 1999/08/21 02:32:33 set<br>
+<li> New!: Man page viewer incorporated to the editor.<br>
+<li> Fixed: One keywords line in the PICs shl.<br>
+<li> Modified: Easydiag input line to accomodate to the new feature in TV that
+fixed the need of an extra character for small input lines.<br>
+<li> Fixed: The "resume" information for project and closed windows now changed
+the version because in 0.4.31 the layout of the flags changed. *NHP*<br>
+<li> Added all the man page files to the source distribution.<br>
+<li> Added: A command line option to use the low level VGA routines to
+save/restore the video modes. It seems to help for some buggy Matrox drivers.<br>
+<li> Fixed: Streamable constructors of TDskWin classes didn't initialize the
+CanBeDeletedFromDisk flag. *NHP*.<br>
+<li> Added: Warning in the snap shot html page about the need of getting the
+last version available of TV to compile the editor (snap shot version).<p>
+<b>Revision</b> 1.185 1999/08/13 01:16:36 set<br>
+<li> Added: Optional flag to sLisp's RunProgram to restore the screen after
+running the program.<br>
+<li> Added: New sLisp command called strxlt to replace characters in strings.
+Both to solve inconvenients running some DOS programs like mpasm (Grzegorz
+pointed out the problems).<br>
+<li> Fixed: Problems when loading desktop files that makes references to syntax
+highlight modes not found in the syntahl.shl file.<p>
+<b>Revision</b> 1.184 1999/08/12 23:23:04 set<br>
+<li> Added: Some extra checks to the flush undo info (used by expand/compact
+tabs options) it could be the reason of some misterious crashes that Grzegorz
+reported.<p>
+<b>Revision</b> 1.183 1999/08/07 22:11:51 set<br>
+<li> Fixed: The editor was creating read-only desktop files so they weren't
+easy to update ;-). That's the default for open (I used it for a test).<p>
+<b>Revision</b> 1.182 1999/08/07 21:27:51 set<br>
+<li> Updated the license of Robert Hoehne.<p>
+<b>Revision</b> 1.181 1999/08/07 19:49:18 set<br>
+<li> Added: man pages for the editor and infview.<p>
+<b>Revision</b> 1.180 1999/08/07 15:09:03 set<br>
+<li> Added: External screen savers. Now you can write your own screen saver and
+plug it in the editor. Requested by Grzegorz Adam Hankiewicz <gah@iname.com>.<br>
+<li> Modified: Now the screen savers configuration have your own dialog because
+now there are more things to configure. Documented. Linked with the help.<br>
+<li> Added: Four plasma screen savers (external ones). The sources are also
+available (uses my plasma library). Added as optional in the DOS installer.<br>
+<li> Added: MakeHzGroup to easydiag.<br>
+<li> Added: Command line options for the external screen saver is stored in the
+desktop file so the version changed: v0.4.34.<br>
+<li> Changed: the default sorting for File Open dialog.<p>
+<b>Revision</b> 1.179 1999/08/03 02:56:10 set<br>
+<li> Added: Now the sorting criteria of the files and directories in the
+FileOpen dialogs can be customized. I added it to TV and now I added the
+needed dialogs to the editor, the options are stored in the desktop file,
+there are help available and the editor also gives some advices about the use
+of SHIFT key. I did it as a result of a thread in djgpp list started by
+Thiago <thiagofga@ambr.com.br>, supported by Clemens Valens
+<c.valens@mindless.com> and discussed by Rolf Campbell
+<cp1v45@nortelnetworks.com> and Eli Zaretskii <eliz@is.elta.co.il>.<p>
+<b>Revision</b> 1.178 1999/08/01 21:01:45 root (set)<br>
+<li> Fixed: The screen saver weren't working under Linux. Reported by Grzegorz.<br>
+<li> Modified: Now the text mode screen savers are adjusted to the size of the
+screen. Suggested by Grzegorz.<p>
+<b>Revision</b> 1.177 1999/08/01 19:43:55 set<br>
+<li> Fixed: In the overwrite warning the editor was checking if the user
+answered No, but then if the user pressed ESC the action was performed, which
+is really no intuitive.<p>
+<b>Revision</b> 1.176 1999/08/01 19:33:46 set<br>
+<li> Added: new sLisp command getenv, is just like the C version but also gives
+access to the internal environment variables. Documented. Suggested by Thiago
+<thiagofga@ambr.com.br>.<br>
+<li> Added: examples of getenv and the completion chooser to the examples.slp
+file.<br>
+<li> Added: comments about x:/dev under DOS to the FAQ.<p>
+<b>Revision</b> 1.175 1999/08/01 17:56:49 set<br>
+<li> Added: ASCII Chart and Calendar windows. First suggested by Jeremy W.
+Murphy <jwm@amc.com.au>, second just because I don't know in what day I live
+;-)). The code comes from the Robert's port of TVDemo with some small
+changes.<br>
+<li> Modified: The mechanism to remove windows from the Alt+0 list. I added a
+new broadcast to the library sent any time a window is closed. So now the
+main application class of SETEdit receives this broadcast and removes the
+window from the list. I hope I didn't break anything, the mechanism is really
+complex, even when it simplified things a lot.<p>
+<b>Revision</b> 1.174 1999/08/01 13:38:18 set<br>
+<li> Added: Now you can set the editor to tile windows first vertically (instead
+of horizontally). Is in the general options. Suggested by Grzegorz Adam
+Hankiewicz <gah@iname.com>. New version forced by stored value v0.4.33.<br>
+<li> Added: Warning about running windowed in Diamond Stealth 2000 Turbo boards.
+Diamond drivers are really buggy, specially stealth ones, I have a couple at
+work and they are really buggy.<p>
+<b>Revision</b> 1.173 1999/07/27 02:04:54 root (set)<br>
+<li> Added: (strstr target_string search_string [start_offset]) -> position or<br>-1 sLisp command. Suggested by Endlisnis.<br>
+<li> Fixed: [Linux] Now when the editor is started with a resolution different
+than the last used the windows are resized to fit in the new desktop size.
+Reported by Grzegorz.<p>
+<b>Revision</b> 1.172 1999/07/26 23:43:53 set<br>
+<li> Added: A couple of Q/A to the linux faq from problems experimented by
+Grzegorz.<p>
+<b>Revision</b> 1.171 1999/07/26 23:18:20 set<br>
+<li> Added: Now is possible to delete a file from the Alt+0 list for good, I
+mean really unlink it in the filesystem (delete, erase, kill, etc.). That's
+pressing Ctrl+Del and of course previous user confirmation that (of course
+again ;-) can be disabled. Suggested by Grzegorz Adam Hankiewicz
+<gradha@iname.com>.<p>
+<b>Revision</b> 1.170 1999/07/25 17:04:22 set<br>
+<li> Fixed: In jump to function, if the word under cursor was "greater" than the
+last function name (alphabetically) the dialog selected an invalid item.
+Reported by John Scott Kjellman <jkjellman@ameritech.net>.<p>
+<b>Revision</b> 1.169 1999/07/25 16:03:33 set<br>
+<li> Fixed: SaveAs was setting the title of new files even if the save failed.
+Reported by Jeremy.<p>
+<b>Revision</b> 1.168 1999/07/25 15:48:09 set<br>
+<li> Fixed: A typo in the Tip number 17. Reported by Enlisnis.<p>
+<b>Revision</b> 1.167 1999/07/25 15:09:00 set<br>
+<li> Added: Now the right button of the mouse pop-ups a menu. The menu is fully
+customizable from the menubind.smn file. By default it contains: syntax help,
+jump to function, find, replace, copy, paste and cut. I had it in mind for a
+long time and a suggestion from Jeremy W. Murphy <jwm@amc.com.au> made me
+incorporate it.<p>
+<b>Revision</b> 1.166 1999/07/25 00:28:43 set<br>
+<li> Added: New sLisp command: ComplChoose, it pop-ups a list of options at the
+cursor position. The pressed keys are used for incremental search, any valid
+symbol for the current SHL select the focused item most of other keystrokes
+rejects the selection returning an empty string. Is fully oriented to word
+completion. Suggested by Endlisnis for Lemur.<p>
+<b>Revision</b> 1.165 1999/07/22 00:25:30 set<br>
+<li> Fixed: Opened files failed to inherit the "See Tabs" and "No inside tabs"
+flags. Damn, I really forgot them in all the places. Reported by Jeremy W.
+Murphy <jwm@amc.com.au>.<br>
+<li> Added: A new option to highlight the matching pairs on the fly. It is
+called 500 ms after you stop typing to avoid slow downs because an excess of
+computations that aren't really needed. Suggested by Ivan.
+The setting is stored in the desktop files so the version is 0.4.32 now.<p>
+<b>Revision</b> 1.164 1999/07/21 01:11:46 set<br>
+<li> Fixed: The Tool&Ops|Options|Default global edition dialogs asked if the
+user wanted to lose the changes with the reverse logic (when the user tried
+to not lose ;-))<br>
+<li> Fixed: New file doesn't have syntax hl, but didn't inherit the default
+options for files without syntax hl.<br>
+<li> Added: Now the snap-shot script generates valid files for DOS and UNIX no
+matters what OS is used to generate the files.<p>
+<b>Revision</b> 1.163 1999/07/18 23:20:41 set<br>
+<li> Added: a Perl script to generate diffs between the current WIP and any CVS
+tag. This will allow me to upload diffs and snap-shots.<p>
+<b>Revision</b> 1.162 1999/07/17 22:26:11 root (set)<br>
+<li> Added needed scripts and modified small details to create and package
+InfView for Linux.<p>
+<b>Revision</b> 1.161 1999/07/17 21:41:05 set<br>
+<li> New!: A new standalone program can be created from the sources, is called
+infview and is just an standalone info viewer. It have a command line very
+similar to the FSF's info program. Many users asked for it.<p>
+<b>Revision</b> 1.160 1999/07/17 01:11:05 set<br>
+<li> Added: Search only in/outside comments options to the Find and Replace
+dialogs. It forced to rearrange the editorFlags so the version changed
+(v0.4.31). Suggested by Jeremy W. Murphy <jwm@amc.com.au><p>
+<b>Revision</b> 1.159 1999/07/16 22:53:37 set<br>
+<li> Fixed: Cursor moved outside the screen when using non-persistent blocks and
+replacing a selection by a typed character. Reported by Endlisnis.<p>
+<b>Revision</b> 1.158 1999/07/16 01:45:16 set<br>
+<li> Added: Now is possible to delete entries in the message box. I also added
+the possibility to save the messages to a text file or copy to the clipboard.
+All started with some suggestions from SpaZe.<p>
+<b>Revision</b> 1.157 1999/07/15 03:07:24 set<br>
+<li> Fixed: Now the editor commands are disabled during initialization, not only
+when an editor loses the focus. In this way if you start with a clean desktop
+the commands are disabled.<p>
+<b>Revision</b> 1.156 1999/07/15 03:05:01 set<br>
+<li> Added: The screen saver is activated if you left the mouse in the upper
+right corner for a configurable period of time. Suggested by Spaze.
+Also added to the general configuration and desktop file => v0.4.30.
+<hr>v0.4.29 10th public release. Scheduled uploads to DJ's server, my three
+sites, mails to Ivan and DanX, etc.<p>
+<b>Revision</b> 1.155 1999/07/14 23:31:16 set<br>
+<li> Fixed: 3 warnings from gcc 2.96.<br>
+<li> Fixed: I forgot dstfile.cc in the distribution.<br>
+<li> Fixed: If no dflopts.txt existed the flags to set the SHL were 0 (all local
+options disabled!).<br>
+<li> Fixed: The OK button was grayed when editing the default options. Also added
+a confirm before discarding potential changes.<br>
+<li> Fixed: multiline strings wrongly propagated if the contained an empty line
+in the middle (only Linux).<br>
+<li> Note: all of this just before releasing, it delayed the release.<p>
+<b>Revision</b> 1.154 1999/07/13 22:48:45 set<br>
+<li> Fixed: BASIC shl needed AllowedInsideNames=$. Patch by Endlisnis
+<s257m@unb.ca><p>
+<b>Revision</b> 1.153 1999/07/13 02:12:29 set<br>
+<li> Fixed: Problems to redirect the output of childs when TMPDIR (or equivalent
+variable) was defined as something like "x:/". That's because djgpp tools
+gets upset if you use a file name like it: "c://file" (even when c://file is
+valid both in djgpp and Linux). Is a very bad idea to define the variable
+like this because other programs also have problems, I saw it in CVS while
+comminting the changes.<br>
+<li> Note: Robert should do the same in RHIDE, in fact debugging it was slooowww
+because RHIDE was failing to create some temporals and for some reason mktemp
+becomes ultra-slow in this case.<p>
+<b>Revision</b> 1.152 1999/07/13 00:46:17 root (set)<br>
+<li> Added: Eterm theme, terminal description and full explanation.<br>
+<li> Added: Some hints about it in the readme.src and readme.1st.<br>
+<li> Added: All the changes and additions to the readme.1st.<p>
+<b>Revision</b> 1.151 1999/07/12 00:04:37 set<br>
+<li> New! "Default global edition" menu option. It was something I needed for
+months and didn't have time to add. It's a complement for the "Global
+Options" but sensitive to the syntax highlight for the current file. When the
+editor selects the shl also enables/disables some local options related to
+this shl. All of this is stored in an easy-to-edit text file, but also you
+can edit it with nice dialogs ;-). Is documented and pressing F1 explains
+how it works.<p>
+<b>Revision</b> 1.150 1999/07/11 14:16:08 set<br>
+<li> New! now you can define your own reserved words (user words) using dialogs
+or just editing a text file.<br>
+<li> Added: Documentation, F1 hook and tip for the user words.<br>
+<li> Modified: Some important internal structures were modified. The main
+important change is that I no longer use a SOSStack for the syntax highlight
+strings, now all are separated strings. So the call to
+LoadSyntaxHighLightFile changed a little bit.<br>
+<li> Note: This is all very new and not very well tested, don't expect 100%
+reliable behavior and report any strange thing.<p>
+<b>Revision</b> 1.149 1999/07/09 19:31:27 set<br>
+<li> Fixed: The documentation of RunProgram* to say @var{program_name} instead
+of @var{program name} to avoid confusion. Reported by Endlisnis.<br>
+<li> Added: Now (+ "Hello" 1) sLisp code returns "Hello1". Endlisnis reported
+a problem in one of the examples and instead of limiting the example I
+extended the language ;-)<br>
+<li> Fixed: Now when asigning a macro to a key the editor doesn't draw the
+intermediate steps, it avoid cleaning the status line. Reported by Endlisnis.<br>
+<li> Fixed: The RunProgramRedir was returning a non ASCIIZ string. Reported by
+Endlisnis.<br>
+<li> Fixed: The name of the sLisp command WhichEditor (was WichEditor).<br>
+<li> Added: A new optional parameter to sLisp command WordUnderCursor. (see docs)<br>
+<li> Added: A new editor's command: cmcGoEndOfWord. (see docs).<br>
+<li> Note: These modifications are to give better support to the Lemur v0.1a
+prototype completion macro+program created by Endlisnis.<p>
+<b>Revision</b> 1.148 1999/07/09 15:22:29 set<br>
+<li> Fixed: G was used twice as short-cut in the Find Dialog. Reported by
+Jeremy W. Murphy <jwm@amc.com.au>.<br>
+<li> Added: short-cut for the "RegEx Ops" button (O).<p>
+<b>Revision</b> 1.147 1999/07/07 23:59:42 set<br>
+<li> Added: Help for the "Open Read-only copy" option (documentation and F1).<p>
+<b>Revision</b> 1.146 1999/07/07 23:50:48 set<br>
+<li> Added: An option to open a read only copy of the current file we are
+editing from disk.<br>
+<li> Fixed: Disabled some commands when no editor is selected: Print, RO copy,
+etc.<br>
+<li> Fixed: Now the editor windows disables all the commands when they are
+unselected. You'll get a lot of gray options if you select a non-editor now.<br>
+<li> Fixed: Now InfView windows enables/disables your commands.<br>
+<li> Note: I changed some internal stuff: (a) Added a new member to TCommandSet
+class to enable/disable groups of commands (b) Added a parameter to
+updateCommands, it says if the update is a full one or the class needs to
+update just some commands and (c) the rectangular selection commands are
+enabled/disableb only after one command related to it is processed, not all
+the time.<p>
+<b>Revision</b> 1.145 1999/07/04 15:44:40 set<br>
+<li> Added: A progress bar when loading a file greater than 1Mb. The bar is
+displayed during the parse process (much slower than the load). I tested it
+with the disassebled code of the editor (15Mb ;-).<p>
+<b>Revision</b> 1.144 1999/07/04 15:21:29 set<br>
+<li> Added: A command to paste de Emacs mode associated with the current syntax
+highlight and the tabsize as a comment at the start of the file. Documented.
+Suggested by Ivan.<p>
+<b>Revision</b> 1.143 1999/07/04 13:58:01 set<br>
+<li> Added: Added EmacsModes and ShellScript shl commands. Looks like people was
+confused about the fact that Files was used for the three so now they are
+separated commands.<p>
+<b>Revision</b> 1.142 1999/07/03 19:16:19 set<br>
+<li> Added: A blanker to the screen savers. Suggested by SpaZe/ST
+<stealth.tech@seznam.cz>.<br>
+<li> Fixed: Now the mouse is hided when the screen saver is on. Reported by
+SpaZe.<br>
+<li> Added: A test button to make a preview of the screen savers. Suggested by
+SpaZe.<br>
+<li> Fixed: The name of the "global editor options", now is "general editor
+options" Reported by SpaZe.<br>
+<li> Added: F3 label in the File|Open menu. Suggested by SpaZe.<br>
+<li> Added: Now InfView copies all the #include directives with Alt+I, not just
+the first. Suggested by SpaZe.<p>
+<b>Revision</b> 1.141 1999/07/03 17:06:51 set<br>
+<li> Fixed: When redirecting the output of external files if the last line
+emitted by the external program didn't have /n it was discarded. Reported by
+Endlisnis <s257m@unb.ca>.<p><br>-- Sent the change.log to the editor's mailing list (recently created) --<br><b>Revision</b> 1.140 1999/07/02 02:39:37 set<br>
+<li> Fixed: Now project items are stored as relative names, not absolute. So you
+can move projects from one disk to another.<br>
+<li> Fixed: The example.zip (for SDG) used absoulte paths so was hard to use.<br>
+<li> Added: A warning when adding files that can't be expresed as relative in
+the project.<br>
+<li> Fixed: The command to go to the end of file didn't compute tabs so if the
+last line in the file had tabs the position wasn't the EOL. Reported by
+SpaZe / ST <stealth.tech@seznam.cz>.<br>
+<li> Fixed: When unindenting a block and the cursor was in the previous line of
+the first line of the block the editor included it in the selection.<br>
+<li> Added: Pseudo-macros for Clipper.<br>
+<li> Added: A simple mechanism for "Advice" dialogs (they explain something to
+the user and gives the option to not be displayed in the future). So they
+will start to appear in many places. I think they are very good to learn. I
+really liked it when I tried the VMware beta.<p>
+<b>Revision</b> 1.139 1999/06/30 02:39:34 set<br>
+<li> Added: Documentation for the #! stuff in shl files and warnings about the
+fact that the editor remmember the shl of files.<br>
+<li> Added: @comment as secondary comment for Texinfo files.<p>
+<b>Revision</b> 1.138 1999/06/30 02:16:04 set<br>
+<li> Added: --no-compress option to the compress scripts. It avoids the call to
+upx even when upx is installed in the system. Suggested by Ivan.<p>
+<b>Revision</b> 1.137 1999/06/30 02:08:13 set<br>
+<li> Added: A new command cmeDeleteBkps to delete all the backup files memorized
+by the editor so you don't need to exit with quit to do it. That's very
+useful when used in combination with "Remmember bkps to delete". I put it in
+the Tool&Ops menu.<br>
+<li> Added: Documentation for it and some entries in the concept index related to
+backups.<p>
+<b>Revision</b> 1.136 1999/06/30 00:52:00 set<br>
+<li> Fixed: If a comment works only when in first column and is found in other
+place the editor now pass it for the other checks (symbol, etc.).<br>
+<li> Modified: Small enhancements to the batch files hl. Now more things are
+symbol.<p>
+<b>Revision</b> 1.135 1999/06/30 00:34:49 set<br>
+<li> Added: New syntax hl. option: "RelaxNumbersCheck", when enabled words that
+start with a number aren't indicated as wrong. That's useful for batch files.<br>
+<li> Fixed: The '.' can be used inside names in assembler files.<p>
+<b>Revision</b> 1.134 1999/06/30 00:10:42 set<br>
+<li> Added: "Remmember bkps to delete" option. Useful for users of Alt+Q. It
+helps to keep delete the backup files which are useful but annoying.
+As that's stored in the desktop file that's a new version: v0.4.29.<p>
+<b>Revision</b> 1.133 1999/06/29 02:26:26 set<br>
+<li> Added: Syntax highlight for PICs assembler (16C7x syntax) contributed by
+Diego Brengi <brengi@inti.gov.ar>.<br>
+<li> Modified: My idea to save a directory read for the open dialog failed for
+save as where the setData doesn't pass a wildcard, so now in this case I read
+the directory first *NHP*<br>
+<li> Added: More checks in the installer for NT.<p>
+<b>Revision</b> 1.132 1999/06/27 20:17:13 set<br>
+<li> Updated the documentation for Tool&Ops|Options|Editor General, it was
+outdated. Added information for five undocumented options.<p>
+<b>Revision</b> 1.131 1999/06/27 20:07:13 set<br>
+<li> Added: An option to the editor's general options. It works this way: when
+enabled and if the user specifies at least one file name in the command line
+all the windows already opened are closed. In this way only the files
+specified in the commnad line are opened. Suggested by Ivan.<p>
+<b>Revision</b> 1.130 1999/06/27 19:37:58 set<br>
+<li> Modified: Now is possible to save the current file as UNIX/DOS. That's only
+possible for this special case, not saving as other opened file.
+Suggested by "Jeremy W. Murphy" <jwm@amc.com.au>.<p>
+<b>Revision</b> 1.129 1999/06/27 18:58:23 set<br>
+<li> Added: Documentation for the rectangular upper/lower commands.<br>
+<li> Fixed: The same bug that affected the rectangle paste was in block upper/
+lower.<br>
+<li> Modified: Now the message that a rectangle can't be pasted outside the text
+is reported by editorDialog.<br>
+<li> Fixed: When pasting rectangles outside the text using the move operation
+you could lose the original text, specially because the undo state was
+broken. Now the editor checks before deleting the text and also does it
+before starting to fill the undo structure. Reported by
+SpaZe/ST <stealth.tech@seznam.cz>.<p>
+<b>Revision</b> 1.128 1999/06/27 17:52:30 set<br>
+<li> Added: cmcSelRectToUpper and cmcSelRectToLower, they convert a rectangular
+selection to upper/lower case. They have a side effect: tabs inside and
+crossing the boundaries of the selection are converted into spaces. That's
+because I first cut the rectangle process the block and then paste it again.
+Any other solution will need much more code and make it more complex.
+Suggested by SpaZe/ST <stealth.tech@seznam.cz>.<br>
+<li> Fixed: A very old bug while using undo for rectangular selection operations.
+I don't know if anothers remains but it was clear: the paste wasn't
+initializing the member that indicates how many operations are grouped.
+Reported by Alex Lozano and recently by SpaZe/ST <stealth.tech@seznam.cz>.<p>
+<b>Revision</b> 1.127 1999/06/27 16:04:21 set<br>
+<li> Moved all the code for loading/storing desktop files from editmain.cc to
+a new file called dstfile.cc.<br>
+<li> Added: <noscript> and </noscript> to the html syntax hl. file. Suggested
+by SpaZe/ST <stealth.tech@seznam.cz>.<p>
+<b>Revision</b> 1.126 1999/06/27 14:50:39 set<br>
+<li> Fixed: Now the "See Tabs" and "No inside tabs" options are stored in the
+desktop file. As the desktop file changed that's: v0.4.28.<br>
+<li> Added: The "Wrap words" option can be set for all the windows from the
+global options dialog. Suggested by SpaZe/ST <stealth.tech@seznam.cz><p>
+<b>Revision</b> 1.125 1999/06/26 00:54:35 set<br>
+<li> Fixed: A bug when putting the PATH command in the autoexec.bat when the
+installer couldn't find the PATH definition. Reported by Ivan.<br>
+<li> Fixed: Now the installer is can detect more cases of the PATH definition.
+Reported by Ivan.<p>
+<b>Revision</b> 1.124 1999/06/24 23:25:08 set<br>
+<li> Added: Now I'm forcing some redraws when "See tabs" is enabled and I kill
+spaces at the end of a line. In this way the user can see how they disapear.
+Suggested by Ivan.<p>
+<b>Revision</b> 1.123 1999/06/24 22:06:32 set<br>
+<li> Added: a "pocket calculator", that's a simple calculator. From TV.<p>
+<b>Revision</b> 1.122 1999/06/23 23:11:16 set<br>
+<li> Modified: The OK button in the dialog to select MP3 files now says "Select".<br>
+<li> Fixed: Now double clicking adds the file to the MP3 list. (Reported by Ivan)<br>
+<li> Added: New button to the file open dialogs, it brings the change dir dialog.
+Added after some questions from Ivan.<br>
+<li> Fixed: An extra directory read when opening a File Dialog.<p>
+<b>Revision</b> 1.121 1999/06/22 22:34:35 set<br>
+<li> Added: SpecialSymbol and SpecialSymbolCont to the shl syntax. It allows to
+define special symbols constructed by two symbols that combined have a
+special meaning. That's very useful for $# in Perl and Bash scripts and @@
+for Texinfo files.<br>
+<li> Added: PartialKeywords to the shl file. That's used when keywords can be
+embedded in other words and still valid, like this @AA is a keyword and
+@AAxxxx is @AA keyword plus some text. In this mode the keywords search is
+considerably slower. I added it after some mail exchange with Burton Radons
+<loth@pacificcoast.net>.<p>
+<b>Revision</b> 1.120 1999/06/18 01:12:06 set<br>
+<li> Modified: Now the editor uses 32 bits flags for the syntax highlight stuff.
+It consumes more memory but allows me to add better shl.<br>
+<li> Added: String3 definition to the syntaxhl.shl files, that's propagated to
+the rest of the lines.<br>
+<li> Modified: String2 is now propagated too, the old behavior is obtained with
+a new command: ShortString.<br>
+<li> Fixed: This addition allowed me to fix an annoying problem in the Perl and
+Bash syntax highlight. These script languages supports three types of strings
+and the three are propagated across lines. Now it works OK.<br>
+<li>*Warning** I was careful with the changes and tested that no part is cutting
+the attributes to the old size (16 bits), but I can't be sure so this version
+is actually qualified as less stable than 0.4.26.<p>
+<b>Revision</b> 1.119 1999/06/17 02:04:28 set<br>
+<li> Added: Syntax Highlight for Texinfo files. Contributed by Burton Radons
+<loth@pacificcoast.net>.<br>
+<li> Fixed: if two shl keywords were different just in the caseness(?) only
+the first defined was taked. Example: @aa @AA. I was using a no case
+sensitive collection to colect the keywords. Reported by Burton.<br>
+<li> Modified (Fixed): Now the editor stores the name of the syntax highlight
+instead of the number. Before it if you inserted a definition in the middle
+of the shl file you surely created a mess. So desktop files changed and
+hence the version: v0.4.27.<br>
+<li> Added: Explanation where you must specify the Case keyword in the shl file
+in the docs. That's important and wasn't mentioned. Reported by Burton.<p>
+<b>Revision</b> 1.118 1999/06/16 01:35:29 root (set)<br>
+<li> Added: Now the editor can detect the syntax of a file looking for
+#!path/name. This line must be the first in the file. Suggested by Ivan.<br>
+<li> Added: Detection for Perl scripts without .pl extension.<br>
+<li> Added: Some very primitive syntax highlight for shell scripts. At least
+bash supports three strings and the editor just one so the support is weak.<p>
+<b>Revision</b> 1.117 1999/06/15 23:18:41 root (set)<br>
+<li> Added: ncurses, gpm and RegDOS credits in the copyrigh file.<br>
+<li> Fixed: A problem in the INSTALL.MAK that made it fail if the user already
+had the "e" symlink (it was included in the release of v0.4.26, just forgot
+to commit).<p>
+<b>Revision</b> 1.116 1999/06/15 23:11:30 set<br>
+<li> Fixed: The Global editor options was failing to disable the "See Tabs" and
+"Don't move inside tabs" options (I did a cut/paste and forgot to fix it ;-).
+Reported by Diego Brengi <brengi@inti.gov.ar> (If I can say it was a report)<br>
+<li> Fixed: Now the editor looks for ~/tcedit.dst and ~/.tcedit.dst, not only
+the last.<p>
+<b>Revision</b> 1.115 1999/06/15 22:55:49 set<br>
+<li> Fixed: Not restoring the attributes after saving a file. I forgot it in:
+<b>Revision</b> 1.94 1999/05/23 19:28:22. Reported by Dean Limbaugh
+<edl@ns1.co.alachua.fl.us>.<p>
+<b>Revision</b> 1.114 1999/06/11 00:15:46 set<br>
+<li> Modified: Now if the installer didn't change the autoexec.bat won't suggest
+rebooting ;-)<br>
+<li> Modified: Now the about box is coherent with the new slogan for the editor:
+"A friendly text editor". I changed as a result of some suggestions from
+Jose Lacal.<br>
+<li> Fixed and Added: a lot of details in the readme.1st file. When I release
+the editor I install it in many places so I read it ;-)<br>
+<li> Added: information about cwsdpmi, pmodedj and libwin in the copyright file.<br>
+<li> Fixed: some out-dated information in the copyright file.<br>
+<li> Updated: some information in infview documentation, now the name isn't
+uppercase.<br>
+<li> Fixed: typos in the windows/dos FAQ.
+.<hr>v0.4.26 9th public release. Uploaded to DJ's server (Simtelnet) and my home
+page.<p>
+<b>Revision</b> 1.113 1999/06/10 01:39:19 set<br>
+<li> Added: Forced LFN=y in installer or it will fail to update menu and desktop
+files.<br>
+<li> Added: Now the code modifies the .pif files to setup the working directory.
+It avoids the creation of tcedit.dst files in the desktop.<p>
+<b>Revision</b> 1.112 1999/06/08 23:53:01 set<br>
+<li> Modified: Now I use libwin for the installer, that's faster and not
+affected by the WinCrap bug I faced before.<br>
+<li> Added: Some (small) instructions about the installer in the readme.src.<br>
+<li> Fixed: Some versions and CPU model in readme.src.<p>
+<b>Revision</b> 1.111 1999/06/08 03:03:33 set<br>
+<li> Added: Finally I added the installer to the CVS tree. Currently is v1.02
+beta, but seems to work acceptable. I added a directory, the sources
+(including a patched version of datfile.c from Allegro to save 60Kb in the
+final distribution, around 140 in the .exe), changes in the makefiles, added
+to the list of files, project and a Perl script to generate the installer.<p>
+<b>Revision</b> 1.110 1999/06/06 16:50:53 set<br>
+<li> Modified: The readme and announce files for the new release.<br>
+<li> Added: More information about Alt+Mouse in the Linux FAQ.<br>
+<li> Fixed: Copyright year in the docs, last update, version, new description
+for the dir.info, the description isn't in small caps in the .info (pointed
+out by Ivan), fixed a chapter name containing ' (TeX gets confused), generated
+the documentation in .dvi, .ps and .html formats and more.<p>
+<b>Revision</b> 1.109 1999/06/05 23:24:14 set<br>
+<li> Fixed: 3 warnings reported by egcs 1.1.2 from potato (other snapshots
+didn't report it, all related to objects without specified type defaulting
+to int). Also added initialization to 2 variables that egcs reports (wrongly)
+that can be used unitialized. Warnings provided by Ivan.<p>
+<b>Revision</b> 1.108 1999/06/05 22:50:21 root (set)<br>
+<li> Applied: Patches to the Debian package files from Ivan. Not tested because
+I need the potato debhelpers.<p>
+<b>Revision</b> 1.107 1999/06/05 21:40:34 set<br>
+<li> Fixed: Typos in the tips file.<br>
+<li> Added: Simple menu, tips and desktop files in the distribution for people
+that want to use the editor but doesn't know about all of these strange
+options included.<br>
+<li> Added: EasyDiag features: Multiline support for TSStaticText and wrapping
+column. They are used by the WIP installer.<br>
+<li> Changed: Version number because desktop files changed. (v0.4.26)<br>
+<li> Added: Support for tabs in the printing. Now tabs looks the same as in the
+screen. Suggested by Richard Sanders <richard@stardate.bc.ca>.<br>
+<li> Changed: Prototype of the PrintSource routine to accept the tabs' size.<p>
+<b>Revision</b> 1.106 1999/05/29 03:01:21 root (set)<br>
+<li> Added: Now patchenv.pl also fixes the TV dependencies.<p>
+<b>Revision</b> 1.105 1999/05/29 01:35:11 root (set)<br>
+<li> Applied diffs for the Debian package files from Ivan.<p>
+<b>Revision</b> 1.104 1999/05/29 00:36:24 set<br>
+<li> Compiled with the NT additions in TV. Now the editor works in NT Server
+4.0 in a machine I have access, don't know others.<br>
+<li> Fixed: A syntax highlight bug in the generic engine:
+" molw/t0x00/t/t/t;Comment" in a .asm is an example.<p>
+<b>Revision</b> 1.103 1999/05/27 22:05:38 root (set)<br>
+<li> Added: The print configuration dialog is now an EasyDiag(tm) dialog and
+allows to choose between writing to a file or thru a program using a pipe.<br>
+<li> Added: A couple of functions to EasyDiag that makes easy to transfer the
+with of the widder object to the rest (Used in the print setup).<p>
+<b>Revision</b> 1.102 1999/05/27 00:41:13 root (set)<br>
+<li> Fixed: A nasty bug. When the editor retreives the settings of a closed file
+(you open a file that was previously opened and closed, then the editor
+uses the same position, settings, etc.) the closed object was released and
+the openFile function was accessing an already released block. Of course the
+effect was random and produced two possible things: a) The column cursor
+magically appears enabled b) SIGSEGV because (a) with ridiculous values.<br>
+<li> Fixed: Memory leak in the new backup list when creating more than one
+backup of the same file *NHP*<p>
+<b>Revision</b> 1.101 1999/05/26 00:31:36 set<br>
+<li> Modified: Now I include the "new" header instead of using hardcoded
+definitions (editmain.cc). Patch by Robert.<p>
+<b>Revision</b> 1.100 1999/05/26 00:25:35 set<br>
+<li> Wow! revision 100<br>
+<li> Modified: Went back to -gstabs+, now -gstabs+3. Suggested by Robert (I
+disabled it in the past to save memory while debugging).<p>
+<b>Revision</b> 1.99 1999/05/26 00:08:54 set<br>
+<li> Fixed: references to str[n]*icmp. Pointed out by Robert.<p>
+<b>Revision</b> 1.98 1999/05/24 00:35:08 root (set)<br>
+<li> Added: A warning when switching to the user screen for Linux, that's
+because currently the user must press ENTER which is not very intuitive and
+the user could think the editor hanged.<br>
+<li> Added: Support fot multiline TStatiText in EasyDiag.<p>
+<b>Revision</b> 1.97 1999/05/23 23:45:59 root (set)<br>
+<li> Added: More information in the profile editor option. It now gives more
+interesting information. I also fixed a problem in the Linux version which
+didn't meassured the time consumed by the OS which, in some cases, is very
+important. As an example: the editor can do 18560 lines/sec using VCSA and
+using all the CPU, but only 1318 using xterm where 80% of the time is spend
+by the OS to draw the text. VCSAs are about 5 times faster than using a
+ttypN locally and 14 times faster than xterm.<p>
+<b>Revision</b> 1.96 1999/05/23 21:33:35 set<br>
+<li> Added: Number of selected lines in the ^Q-L command.<p>
+<b>Revision</b> 1.95 1999/05/23 20:35:30 set<br>
+<li> Fixed: Now the editor will delete backups of files in other directories
+different than the working one, for that the editor keeps a list of created
+backups. It also helps to delete files with the new backup options (hidden and
+UNIX style).<p>
+<b>Revision</b> 1.94 1999/05/23 19:28:22 set<br>
+<li> Added: Hidden backups option.<br>
+<li> Modified: Now when a backup is created the editor will use a rename if the
+file isn't a symbolic link and a copy only if the file is s.l. That's faster,
+specially for large files.<p>
+<b>Revision</b> 1.93 1999/05/23 18:35:01 set<br>
+<li> Added: my old memmove again, that's twice faster the djgpp's libc version
+in my system.<p>
+<b>Revision</b> 1.92 1999/05/23 17:26:33 set<br>
+<li> Added: A .pif file for the editor. It have some settings I think are the
+best for the editor.<p>
+<b>Revision</b> 1.91 1999/05/21 14:06:00 root (set)<br>
+<li> Fixed: IsADirectory for Linux *NHP*<br>
+<li> Fixed: Now librhutils won't crash if we couldn't create the temporal file<br>
+<li>NHP*<p>
+<b>Revision</b> 1.90 1999/05/21 03:42:35 set<br>
+<li> Added: UNIX style bakup file names (name~).<p>
+<b>Revision</b> 1.89 1999/05/21 02:42:34 set<br>
+<li> Fixed: Now ".files" are backed-up as ".files.bkp" and not as ".bkp".<p>
+<b>Revision</b> 1.88 1999/05/21 02:32:09 set<br>
+<li> Added: Save DOS files as DOS for UNIX.<br>
+<li> Added: Save desktop files as hidden files.<p>
+<b>Revision</b> 1.87 1999/05/21 00:09:52 root (set)<br>
+<li> Added: Some mouse information in linux.faq (gpm and xterm issues).<p>
+<b>Revision</b> 1.86 1999/05/20 02:14:30 root (set)<br>
+<li> Fixed: The resize attributes of the clock where wrong. I saw it when
+resized an xterm from 80x24 to 95x33, the clock just disapear but left a
+hole in your place.<p>
+<b>Revision</b> 1.85 1999/05/20 01:48:31 root (set)<br>
+<li> Fixed: Some strange bug in Linux when generating the documentation using
+SDG, looks like I can't trust feof when fopening with "wt+". I don't
+understand it very well, but it filled my disk at work ;-).<p>
+<b>Revision</b> 1.84 1999/05/19 23:02:01 set<br>
+<li> Added: Some QBasic keywords to the BASIC shl. Contributed by Endlisnis
+<s257m@unb.ca>.<p>
+<b>Revision</b> 1.83 1999/05/19 22:57:06 set<br>
+<li> Fixed: Now the editor doesn't hang if you load a file with lines multiple
+of 0x10000. The editor now refuses to load such a files. Reported by
+Endlisnis <s257m@unb.ca>.<br>
+<li> Added: A message when the editor is interrupted with Ctrl+Alt+Break.<p>
+<b>Revision</b> 1.82 1999/05/16 22:27:36 root (set)<br>
+<li> Added: another .env file for Linux, it have more interesting settings
+(dynamic executable, no debug information, no warnings, linking with
+installed libPCRE and libZ, etc.). But I keep the other because is more
+bulletproof.<br>
+<li> Modified: the linux.faq because now Alt+8 doesn't generate 8 if the window
+8 isn't there.<br>
+<li> I did a lot of enhacements to the Linux screen, keyboard and mouse stuff.
+For details consult the Turbo Vision change.log.<p>
+<b>Revision</b> 1.81 1999/05/13 00:41:52 root (set)<br>
+<li> Modified: As Linux lacks access(name,D_OK) (bad, bad) I added a function
+called IsADirectory in pathtool. It checks: (1) name exists, (2) name is
+type directory and (3) user have execute access (it means user can use this
+directory).<p>
+<b>Revision</b> 1.80 1999/05/12 23:57:30 set<br>
+<li> Fixed: In the errors parser absolute paths starting with / where
+missinterpreted.<p>
+<b>Revision</b> 1.79 1999/05/12 00:03:15 set<br>
+<li> Fixed: Removing a secondary InfView from the list of windows produced a
+SIGSEGV or SIGILL because the same object was released twice.<br>
+<li> Fixed: When a secondary InfView was released it released the BookMark so:
+a) The rest of the InfViewer lost it. Most probably what Brett Porter
+<blp01@uow.edu.au> experimented and that I tried to avoid in revision 1.78.
+b) At exit when the main InfViewer was destroyed the BookMark was destroyed
+again producing a SIGSEGV.<p>
+<b>Revision</b> 1.78 1999/05/11 23:08:22 set<br>
+<li> Fixed: Looks like even when I taked all the precautions to avoid having an
+unitialized BookMark in InfView there is some way to achieve it so I added
+yet another check.<p>
+<b>Revision</b> 1.77 1999/05/11 22:49:51 set<br>
+<li> Added: Now people switching from djgpp v2.01 to v2.02 won't get "Can't open
+libc.inf" for projects where the libc.inf file was opened. Basically now
+InfView will try to find libc.info if libc.inf isn't there (same for any .inf
+file). Brett Porter <blp01@uow.edu.au> experimented such a problem.<p>
+<b>Revision</b> 1.76 1999/05/06 03:51:56 set<br>
+<li> Fixed: Now the clock reduces the size of the menuBar instead of just
+overlapping it. It didn't have any sense before, but now I added some code
+to the menuBar that enlarge the space between items if there are enough
+space so reducing the menuBar size could change the situation, in fact does
+it when using spanish menues.<p>
+<b>Revision</b> 1.75 1999/05/06 00:34:41 set<br>
+<li> Fixed: Some stuff in gettext library. When I added a free() call to the
+library to avoid leaks reports I didn't realized that when LANGUAGE and
+other environment variables aren't defined gettext uses static strings that
+makes free crash under plain DOS (Not W9x).<p>
+<b>Revision</b> 1.74 1999/05/04 03:03:47 set<br>
+<li>> I added some stuff related to a macro Endlisnis <s257m@unb.ca> was trying
+to do I also implemented some stuff I discussed with MDaniel
+<mdaniel@balug.org.ar> some time ago.<br>
+<li> Added: RunProgramRedir sLisp command, it runs an external program and
+redirects stderr and stdout to a file, the file is then returned as a string
+variable. That's ultra powerful (and dangerous ;-).<br>
+<li> Added: WordUnderCursor sLisp command, it returns the word under the cursor.
+Useful for external help and things like that.<br>
+<li> Added: ShowInSatusLine sLisp command, it shows an string in the status
+line. Useful to show results to the user.<br>
+<li>> Now from the internal side:<br>
+<li> Modified: The RunExternalProgram function to get some flags that controls
+the redirection. I added it to the rhideint.cc file, but the functionallity
+is not implemented in RHIDE.<br>
+<li> Added: RunExternalProgramGetFile to get the redirected file. I also added
+a dummy to rhideint.cc so it won't break the compilation, but is a dummy.<p>
+<b>Revision</b> 1.73 1999/05/01 16:02:07 set<br>
+<li> Added: Quotation of <rogerh40@aa.net> in the windos.faq about problems with
+VShield.<br>
+<li> Fixed: Short cut for "Regula expressions" was the same used for "Global" in
+the "Replace" dialog. Reported by Endlisnis <s257m@unb.ca>.<p>
+<b>Revision</b> 1.72 1999/05/01 14:39:24 set<br>
+<li> Fixed: When pressing end in a line that contained only tabs the editor was
+positioning the cursor at the end of the tabs but the visible cursor was
+positioned in the first column producing a confusing effect.<p>
+<b>Revision</b> 1.71 1999/05/01 01:01:32 set<br>
+<li> Added: Code to detect if SET_FILES point to an invalid point and in this
+case try to guess the right value and if it fails inform it and stop.<br>
+<li> Fixed: Now if the syntax highlight file can't be loaded the editor doesn't
+derreference a NULL pointer (SHLArray).<p>
+<b>Revision</b> 1.70 1999/05/01 00:00:26 set<br>
+<li> Fixed: Now if TMPDIR isn't defined or is wrongly defined the stderr/stdout
+redirection doesn't fail so easilly. Now I try with %TEMP%, %TMP%, /tmp, c:/
+or .<p>
+<b>Revision</b> 1.69 1999/04/30 23:06:38 set<br>
+<li> Added: Greek fonts. I'm in the middle of a big change in the code page
+stuff that will take some weeks.<br>
+<li> Fixed: "Home" button when no tcedit.dst was loaded (it used uninitialized
+data).
+.<hr>v0.4.25 8th public release. Uploaded to DJ's server (Simtelnet), my home
+page, BALUG home page, LUGAr, sent to Ivan, announced in Freshmeat and
+Linuxberg.<p>
+<b>Revision</b> 1.68 1999/04/21 23:07:13 set<br>
+<li> Fixed: Was not possible to load files with []=+, or ; from the open dialog
+even when LFNs where available. The problem was in TV. Reported by
+Endlisnis <s257m@unb.ca>.<br>
+<li> Fixed: The check for files modified after running an external program was
+wrong, I don't know why I was checking the creation time instead of the
+modification time. It also affected the Save with same time. I discovered it
+while processing some code pages with Perl scripts from inside the editor
+(using the run external program feature).<p>
+<b>Revision</b> 1.67 1999/04/18 23:33:44 set<br>
+<li> Changed: Now I use PCRE v2.04 for the Perl Regular Expressions. I was using
+v1.07 of feb 1998, the new one is dated feb 1999.<p>
+<b>Revision</b> 1.66 1999/04/18 22:14:55 root (set)<br>
+<li> Applied changes to the Debian files from Ivan.<p>
+<b>Revision</b> 1.65 1999/04/18 22:08:46 root (set)<br>
+<li> Changed: Now the Linux version is also compressed with UPX.<p>
+<b>Revision</b> 1.64 1999/04/18 21:57:29 root (set)<br>
+<li> Updated: The Linux installation script, now the text will tell the real
+default prefix (is stuffed by the Perl script), the text of the VCSA.SH
+script and the FAQ to reflect the current condition.<p>
+<b>Revision</b> 1.63 1999/04/18 21:50:16 set<br>
+<li> Fixed: Now if a syntax highlight indicates that the "escape" character is
+also a symbol it isn't displayed in red. That's the case of Perl where the
+\ can be used outside strings.<p>
+<b>Revision</b> 1.62 1999/04/18 21:40:40 set<br>
+<li> Changed: to UPX 0.70 and -9 compression. Tried --best but is too slow and
+doesn't help the editor.<p>
+<b>Revision</b> 1.61 1999/04/18 21:32:16 set<br>
+<li> Added: A workaround for a bug in the Windows 95 clipboard handling. Looks
+like the Windows 95 clipboard can't receive an arbitrary number of bytes for
+the clipboard (int 0x2F service 0x1703), instead you must (a) enlarge the
+number to be a multiple of 32 and (b) ensure the string is padded with 0s. If
+you pass a 32*n bytes string without doing it you kill the application that
+pastes the text. How said W95 is idiot? nah.... I found it after crashing
+Pegasus various times.<p>
+<b>Revision</b> 1.60 1999/04/16 02:28:31 root (set)<br>
+<li> Updated the linux.faq it had hints about things that no longer apply.<br>
+<li> Added: a file called version.txt to hold the number of the last release.<br>
+<li> Updated the INSTALL.LINUX because it had wrong information about the
+default prefix.<br>
+<li> Updated the readme.1st to reflect the last changes and explain some Linux
+specific stuff.<br>
+<li> Added: -f to the rm calls in Makefile to avoid error in the clean target.<br>
+<li> Modified: the compress scripts to use the version.txt.<br>
+<li> Removed the ../mp3/libamp.mak <-> rhide.env dependency from the makefile.<br>
+<li> Fixed: some wrong wording abour the default prefix in the makes/readme.txt.
+Reported by Ivan.<p>
+<b>Revision</b> 1.59 1999/04/13 01:09:25 set<br>
+<li> Added: Syntax highlight for Phyton. Contributed by David
+<david.stegbauer@cz.opel.com>.<br>
+<li> Added: A micro FAQ to the DOS version.<p>
+<b>Revision</b> 1.58 1999/04/13 01:06:47 set<br>
+<li> This file is to add common question that applies only to windows and DOS.<p>
+<b>Revision</b> 1.57 1999/04/11 00:31:56 set
+> The bugs and leaks will remmember this battle for years ;-))
+ I was hunting memory problems (malloc/free, out-of bounds and leaks) with
+YAMD by Nate Eldredge <nate@cartsys.com>. Was just to make sure the editor
+was clean. I was working in it five days, as a result:<br>
+<li> Various destructors of TVision were modified to release the allocated
+memory.<br>
+<li> I patched gettext library to release the allocated memory.<br>
+<li> Modified djgpp libc to release the atexit linked list. The patch was
+incorporated to the 2.03 WIP.<br>
+<li> Heavilly modified YAMD 0.23 to ignore allocations from putenv, __alloc_file
+and _invent_inode.<br>
+<li> Added code in many places to release the allocated memory at exit, some of
+these places are: a destructor for TCommToMacroCol and TMLIBase, a new class
+called TLispConstString to replace a static TLispString, hook in fstrcmp and
+many UnLoad... calls to routines that releases memory.
+ With these things I managed to get a 0 leaks report from YAMD and using it
+I found:<br>
+<li> An out-of bounds read in the copy of the fonts data to the transfer buffer.
+It could become dangerous in the future.<br>
+<li> A leak in the EasyDiag destructors.<br>
+<li> A leak in the calculator dialog (use of delete instead of destroy).<br>
+<li> A leak in the functions list when no functions were found or you exited
+with ESC.<br>
+<li> Powered Grep didn't delete the passed "word under cursor".<br>
+<li> A potentially important leak in the undo of the TCEditor class. The editor
+wasn't deleting it in the destructor.<br>
+<li> A leak in flushUndo (not killing the already used by undo cells).<br>
+<li> A leak in the rectangular blocks, propietary clipboard not deleted in the
+destructor.<br>
+<li> A leak when clearing a rectangular selection.<br>
+<li> A leak when copying to the rectangular selection clipboard and using undo
+plus redo.<br>
+<li> A leak in the "Screen Options" dialog (list of fonts not released).<br>
+<li> A leak in the project window (items not released when closing the project.
+Use of delete and not destroy).<br>
+<li> Another leak when deleting items from the project.<br>
+<li> A leak in the "Tip of the day" dialog (destroy).<br>
+<li> A leak in the syntax help search (not releasing the word under cursor).
+ Also and thanks to the heavy use of the memory when using YAMD I found:<br>
+<li> Fixed: Bug in insertBuffer failed when the buffer reallocation moved the
+base of the buffer and then we tried to undo this action.
+ In the middle time:<br>
+<li> Fixed: When a file had 0 bytes it was reported as read error.<br>
+<li> Fixed: When the editor failed to load a file it wasn't inserted in the
+desktop but was inserted in the ALT+0 list producing a GPF/SIGSEGV when
+asking for the list of windows. Reported by "Dean Limbaugh"
+<edl@ns1.co.alachua.fl.us> (a Linux user).<p>
+<b>Revision</b> 1.56 1999/04/02 18:49:51 set<br>
+<li> Fixed: Character 0xD0 in "IBM PC 850" code page.<br>
+<li> Fixed: Character 0xD8 in "IBM PC 852" code page.<br>
+<li> Changed: Some names of the code pages to be more clear.<br>
+<li> Added: Full documentation for the layout of my fonts with Unicode
+equivalence. I used tables that Fojtik Jaroslav <FOJTIK@vision.felk.cvut.cz>
+sent me to do the job.<p>
+<b>Revision</b> 1.55 1999/04/02 15:16:00 root (set)
+Many things related only to the Linux version:<br>
+<li> Now the executable is called setedit and the installer creates a symlink
+called e. That's more similar to DOS where I use e.bat.<br>
+<li> Changed: Now the docs are compressed with -9. (Ivan).<br>
+<li> Changed: The installation is to /usr by default now. (Ivan).<br>
+<li> Added: Search for files in /usr and not only /usr/local tree. (Ivan).<br>
+<li> Fixed: The message about wrong installation now displays ok. (Ivan).<br>
+<li> Fixed: ALT+F5 now waits for ENTER.<p>
+<b>Revision</b> 1.54 1999/04/01 23:24:50 set<br>
+<li> Changed: Now Optimal Fill doesn't use a tab when only one space can be used.<p>
+<b>Revision</b> 1.53 1999/04/01 22:56:19 set<br>
+<li> Added: A new target to the makefile called clean-docs to remove all the
+generated docs. Suggested by Ivan Baldo.<p>
+<b>Revision</b> 1.52 1999/04/01 22:46:26 set<br>
+<li> Added: A key to stop the DOS version, that's Right Shift+Control+Delete.
+That's just a test, don't know if that's definitive.<p>
+<b>Revision</b> 1.51 1999/04/01 22:16:15 set<br>
+<li> Applied the -2 and -3 diffs for the Debian package files from Ivan.<p>
+<b>Revision</b> 1.50 1999/04/01 21:48:00 set<br>
+<li> Added: History to the "Goto line" dialog. Suggested by Fojtik Jaroslav
+<FOJTIK@vision.felk.cvut.cz>.<p>
+<b>Revision</b> 1.49 1999/04/01 20:02:09 set<br>
+<li> Changed: The name of the editor's help. As the editor is officially called
+setedit is sensible to call the help file setedit.info and the language file
+setedit.mo (I changed it too). It was suggested by Ivan Baldo to avoid
+potential problems with the Debian alternatives which could create a symlink
+editor.info -> default_editor_name.info. It wasn't a simple change because
+just changing it all the old users will get "Can't find 'editor' help" when
+loading old desktop files. So I added an obscure feature: if the editor loads
+an old desktop file and it makes reference to a editor.info that's changed
+to setedit automagically. I know it could be bad, but will help in 99,99% of
+the cases.<p>
+<b>Revision</b> 1.48 1999/04/01 18:56:36 set<br>
+<li> After fixing my monitor (was a problem in the PCB, very silly, hard to
+find) I starting with the todo list of the day ;-) [the monitor was
+manufactured in march of 1991 ... and then I must read posts in the list
+about trashing three years old equipment ...] Added: a configuration variable
+to the .env files to setup the directory for the support headers. In this
+way you can use installed libraries instead of the provided ones. Requested
+by Ivan Baldo for the Debian package.<p>
+<b>Revision</b> 1.47 1999/04/01 01:25:57 set<br>
+<li> Added: Now you can enter a VESA mode in the "Screen Options" to use
+something like 132x60 (mode 0x10C). The fonts doesn't work (at least in my
+board). I added it because Grzegorz Adam Hankiewicz <gah@iname.com> asked about
+it.<p>
+<b>Revision</b> 1.46 1999/04/01 00:06:03 set<br>
+<li> Fixed: Now if you save the undo behaves taking in count that the
+"unmodified" copy is now the one on disk. Reported by Thiago F.G.
+Albuquerque <thiagofga@ambr.com.br>.<p>
+<b>Revision</b> 1.45 1999/03/31 23:31:27 set<br>
+<li> Added the libset.mak and other two .mak files to the source distribution
+because now Robert integrated the new version of the editor to RHIDE and
+people that needs to compile RHIDE without having RHIDE needs this .mak.<p>
+<b>Revision</b> 1.44 1999/03/31 23:15:49 set<br>
+<li> Added: The "Set Global Options" is now available even if no editors are
+opened. Is funny that I already designed all to support it (static class
+members) but never implemented it until a couple of users pointed it as a
+bug.<br>
+<li> Fixed: Now if no editor windows are opened the "Set Local Options" command
+is disabled. This and previous were reported/suggested by: Robin Y. Millette
+<millette@bigfoot.com> and Endlisnis <s257m@unb.ca>.<p>
+<b>Revision</b> 1.43 1999/03/31 22:47:44 set<br>
+<li> Added: a key mapping for cmcSmartUnIndent, I lost it when I did the new
+keyboard handling. Additionally I fixed some wrong explanations about this
+command found in the docs. Reported by Endlisnis <s257m@unb.ca>.<p>
+<b>Revision</b> 1.42 1999/03/31 22:26:02 set<br>
+<li> Fixed: a problem with the manifest file, it contained distrib/ as prefix
+for all the files and made impossible the uninstall making "rm @manifest/..."
+Reported by Endlisnis <s257m@unb.ca>.<p>
+<b>Revision</b> 1.41 1999/03/31 22:07:08 set<br>
+<li> Bug killed: GetDefaultScreenSaver() was returning a pointer to a static
+string and then in the Tool&Ops|Options|Editor General I was deleting this
+string. This bug was reported by different persons under different
+situations: Joerg Jungermann <Joerg_Jungermann@accident.cpp.de>, Ivan Baldo
+and Adam Schrotenboer <ajschrotenboer@lycosmail.com>.<p>
+<b>Revision</b> 1.40 1999/03/25 00:29:11 set<br>
+<li> Added the first Debian files from Ivan.<p>
+<b>Revision</b> 1.39 1999/03/23 00:45:10 set<br>
+<li> Changed: all the references to libtv.a to librhtv.a in the gprs because I
+changed the name of the library.<br>
+<li> Changed: Now the rhide.env file defines TVISION_INC as the directory where
+the Turbo Vision headers are located. That's needed for the Debian package.
+Before I was defining TVISION pointing to the place where the sources are
+located, but in Debian the sources doesn't need to be installed, just the
+binary package.<p>
+<b>Revision</b> 1.38 1999/03/22 23:45:40 set<br>
+<li> Fixed: a bug that prevented the use of Linux desktop files under DOS. It
+was very silly but is in all the older versions. The editor was saving a
+random palette and when used in DOS the result was unpredictable (normally a
+black palette). Now the Linux version saves the BIOS default palette.<p>
+<b>Revision</b> 1.37 1999/03/22 23:07:52 set<br>
+<li> Killed a bug in Tool&Ops|HTML Accents, I forgot to reload the base pointer
+of the buffer and it can be changed while inserting text. I found this bug
+while writing HTML pages about my vacations (the reason of no changes in
+weeks ;-)
+.<hr>v0.4.24 7th public release. Bug fix release.<p>
+<b>Revision</b> 1.36 1999/02/22 01:58:45 set<br>
+<li> Changed version number and updated readme.src.<p>
+<b>Revision</b> 1.35 1999/02/22 00:06:07 set<br>
+<li> Fixed a bug that made the editor crash while loading desktop files older
+than v0.4.20. Introduced by the 1999/02/07 12:55:02 change. From reports of
+Robin Y. Millette <millette@bigfoot.com>, Luis Pistoia <lu5gpl@arnet.com.ar>
+and Martijn Versteegh <VERSTEEGH@KVI.nl><br>
+<li> Enhanced the syntax highlight support for .BTM files. Additions by Robin
+Y. Millette <millette@bigfoot.com>.<br>
+<li> Applied a patch by Andris to librhutil, just to be syncronized because this
+function isn't used from this library.<p>
+<b>Revision</b> 1.34 1999/02/18 02:38:33 set<br>
+<li> Compiled with djgpp v2.02 and gcc 2.8.1. Removed the files needed to patch
+djgpp 2.01.
+<hr>v0.4.23 6th public release, sources and binaries uploaded to DJ's server,
+announced in the djgpp mailing list, binaries and sources uploaded to my
+home page and sources and binaries of the Linux version uploaded to my
+home page. (edi0423s.zip is around 1Mb).<p>
+<b>Revision</b> 1.33 1999/02/16 22:04:41 set<br>
+<li> Changed make by $(MAKE), the first fails in DOS.<br>
+<li> Added "hurry" chapter to readme.src.<p>
+<b>Revision</b> 1.32 1999/02/15 23:09:07 set<br>
+<li> Added more information in readme.src, mostly details.<p>
+<b>Revision</b> 1.31 1999/02/15 22:54:19 set<br>
+<li> Added a #error stop point in the libamp sources to warn the user if is
+trying to use Allegro 3.0.<br>
+<li> Added more instruction to compile the editor without MP3 support.<br>
+<li> Added a check in the DOS' compress.pl to see if the make of the docs
+was successful.<p>
+<b>Revision</b> 1.30 1999/02/15 22:33:11 set<br>
+<li> Fixed fromunix.pl and added a cp call to copy the djgppenv.env file as
+rhide.env. Similar change in the fromdos.pl.<br>
+<li> Some clarifications in the readme.src (Perl needed for installation).<br>
+<li> Added an 'editor' target to the make file (make -f editor.mak), made it the
+default target, made distrib and install depend on the 'editor' target.<br>
+<li> Added a -f to the rm calls in REMOVE_UNNEEDED to avoid a lot of messages
+from rm, added deletion for /usr and /usr/local locations.<br>
+<li> Added a check for gzip, makeinfo and successfully docs creation in the
+Linux's compress.pl. Added change.log.gz.<br>
+<li> Added quick instructions to compile the editor in the readme.txt.<br>
+<li> Updated the distribution readme.1st and announce (distrib1.txt and
+distrib2.txt) to reflect the last changes.<br>
+<li> Fixed: a strong bug in the editor, it was possible to select text outside
+the buffer if the last line didn't contain an end of line marker. Even when
+it looks harmless if you tried to delete a block with this 'feature' the
+editor generated a SIGSEGV.<p><br>
+<li>------- Tagged this point as ivan0423 and sent a copy to Ivan Baldo -------*<p>
+<b>Revision</b> 1.29 1999/02/15 00:20:45 set<br>
+<li> Modified: Now when the editor loads a default desktop file (not from the
+current directory or a project) the default load, save, etc. points are
+ignored. That's important for people that uses only one centralized desktop,
+if I don't do it the editor will remmember the last point where s/he saved
+the file and this is very confusing.<p>
+<b>Revision</b> 1.28 1999/02/14 23:52:34 set<br>
+<li> Added code to setup the tabs colors to a default for all desktop files
+where the value is 0.<br>
+<li> Added a default for the tabs in the mochrome palette.<p>
+<b>Revision</b> 1.27 1999/02/14 23:06:46 set<br>
+<li> Added the make install target to Linux.<br>
+<li> Added 'prefix' and 'install' parameters to the Linux compress.pl file.<br>
+<li> Changed: Now InfView by default searchs the info files in /usr/local/info
+and then in /usr/info.<br>
+<li> Modified the INSTALL.MAK file to handle the 'prefix' much better.<br>
+<li> Changed: Now the usage is printed to the stderr.<p>
+<b>Revision</b> 1.26 1999/02/14 20:48:35 set<br>
+<li> Added 'prefix' facility to the DOS compress.pl, using --prefix PREFIX, or
+the environment variables PREFIX and prefix.<br>
+<li> Added 'install' facility to the DOS compress.pl.<br>
+<li> Added install target to the makefile.<br>
+<li> Changed the contrib/setedit directory by contrib/setedit.bin in the binary
+distribution.<br>
+<li> Updated the year in the about box.<br>
+<li> Added explanation about the new targets in the readme.txt.<p>
+<b>Revision</b> 1.25 1999/02/14 15:23:32 set<br>
+<li> Updated the copyright year (1999).<br>
+<li> Updated my telephone number, ugh! now is huge.<p>
+<b>Revision</b> 1.24 1999/02/14 14:11:38 set<br>
+<li> Added help for the new edition modes, the file open dialog and other things.<br>
+<li> Fixed some typos in the help and menues.<br>
+<li> Changed all the cmbXXXX references in the help by cmcXXXX.<br>
+<li> Added context sensitive help to more menu entries, fixed for others.<br>
+<li> Added context sensitive help to most of the dialogs.<br>
+<li> Enabled SDG (was accidentally disabled in the 0.4.22/23 snapshots).<p>
+<b>Revision</b> 1.23 1999/02/13 15:17:16 set<br>
+<li> Added an example of menu configuration called redmond.smn, WinCrap users
+should like to try it. Triggered by a suggestion of Thomas Knudsen
+<tk@gfy.ku.dk> to use Ctrl+Tab for next window.<br>
+<li> Fixed: a problem in my v2.01 libc copy (no in the original) that messed
+some things when ^C was pressed. I don't know if it affected a public release
+of the editor.<p>
+<b>Revision</b> 1.22 1999/02/12 22:52:45 set<br>
+<li> Incorporated the last version of librhutil from Robert and applied the
+patches I did and forgot to tell Robert.<p>
+<b>Revision</b> 1.21 1999/02/12 22:28:19 set<br>
+<li> Changed SETFindFile to FindFiles again and did it available only when using
+STANDALONE, in this way Robert can overwrite it with your own version.<p>
+<b>Revision</b> 1.20 1999/02/12 22:16:41 set<br>
+<li> Fixed: When using Alt+F5 (Show user screen) the editor was polling the
+keyboard without calling idle() and hence eating CPU. Reported for RHIDE by
+Gili <sl@psycode.com>.<p>
+<b>Revision</b> 1.19 1999/02/11 00:38:50 set<br>
+<li> Version 0.4.23 reported by the editor. I already released snapshots of the
+editor with the number inside so is time to reflect it in about and in .dsts.<p>
+<b>Revision</b> 1.18 1999/02/11 00:32:08 set<br>
+<li> Fixed: Sometimes when opening a closed window the cursor position even when
+restored OK was showed in the wrong position giving a surprise when typing.<br>
+<li> Hey! what a night I killed more bugs today than all the bugs killed in
+december and january *;-)<p>
+<b>Revision</b> 1.17 1999/02/11 00:21:08 set<br>
+<li> Fixed: Tips of the day was using gmtime instead of localtime. It triggered
+the tips at 9:00 pm in my case ;-)<br>
+<li> Fixed: The printing routines used gmtime instead of localtime. I fixed it
+because I made a global search for gmtime ;-))<p>
+<b>Revision</b> 1.16 1999/02/11 00:14:35 set<br>
+<li> Added support for Windows clipboard in the InfView windows. Suggested by
+Ivan Baldo <lubaldo@adinet.com.uy>.<br>
+<li> Added a Makefile target called 'distrib' to call the distribution scripts.<p>
+<b>Revision</b> 1.15 1999/02/10 23:38:04 set<br>
+<li> Added: Now the command line is more POSIX compliant, well at least supports
+short and long commands. I used the GPL'd getopts_long function in DOS
+because djgpp lacks this functionallity.<p>
+<b>Revision</b> 1.14 1999/02/10 22:23:58 set<br>
+<li> Added: now when "Scroll lock centers" is on the searchs are centered too.
+Suggested by SpaZe / ST <stealth.tech@usa.net>.<p>
+<b>Revision</b> 1.13 1999/02/10 01:06:25 set<br>
+<li> Fixed the "Compact text" option. Now it doesn't replaces tabs by spaces
+when only one space will be replaced. Reported by Andy <andygoth@juno.com>.<p>
+<b>Revision</b> 1.12 1999/02/10 00:35:59 set<br>
+<li> Fixed a typo in the tips dialog. Reported by Stuart Hall
+<Stuart.Hall@aetna.com>.<p>
+<b>Revision</b> 1.11 1999/02/10 00:15:58 set<br>
+<li> Added a command line switch to enable the Red Hat 5.2 keyboard mapping
+style. Not tested yet (you can see it was under DOS). I found the keyboard
+differences with the help of Tom Aschenbrenner <tom@aschen.com>.<br>
+<li> Fixed the parsing routines to support strings inside preprocessor lines. An
+interesting thing is that a string opened inside a #define extends the
+#define. I hope it will work ok. Bug reported by SpaZe/ST
+<stealth.tech@usa.net>.<p>
+<b>Revision</b> 1.10 1999/02/09 23:10:28 set<br>
+<li> Some fixes in the documentation:
+ * Fixed some typos.
+ * Added better information about pmacros, was outdated. Suggested by Stuart
+ Hall <fprintf@iname.com>.
+ * Renamed a chapter that have the same name as other and was hided
+ (Miscellaneous).
+ * Added better information about the current license (GPL).<br>
+<li> Added the copying.* and copyrigh files to the binary distribution.<p>
+<b>Revision</b> 1.9 1999/02/09 00:29:46 set<br>
+<li> Added a new mode to the editor called "Don't move inside tabs". When this
+mode is on is very hard to put the cursor in the middle of a tab (I hope
+quite impossible ;-). When you try to do it the cursor is automagically moved
+to the start of the tab character so when you type you don't get surprises.
+A lot of people asked about it, here is a small list: "a.meyer"
+<hexx3000@schaltzentrale.mvnet.de>, MDaniel <mdaniel@balug.org.ar>, Sinan,
+Andy M Goth <andygoth@juno.com>, etc. With this second addition tabs users
+will get a big boost ;-)<p>
+<b>Revision</b> 1.8 1999/02/07 16:48:30 set<br>
+<li> Added code to support the new "Try" button in the Color Dialog that I added
+to TVision (see the TV package for more information).<br>
+<li> Added a new mode to the editor called "See Tabs". It paints the tabs, even
+when they are selected. Any similitude to the methode used in killtabs by
+Grzegorz Adam Hankiewicz <gah@iname.com> or the Midnight Commander editor is
+only coincidence ;-)). Additionally: I hope MDaniel will stop complaining
+about what hard is to locate tabs (the same for Andy <andygoth@juno.com>).<p>
+<b>Revision</b> 1.7 1999/02/07 12:55:02 set<br>
+<li> Minor fixes to make the code more RHIDE friendly: RSIndicator link request,
+Expand...() only in standalone (RHIDE uses your own replacement) and renamed
+FindFile to SETFindFile. All from suggestions of Robert after testing the
+first snapshot of 0.4.23 with the new directory structure.<p>
+<b>Revision</b> 1.6 1999/01/31 15:37:21 set<br>
+<li> Included the LibAmp sources in the package to avoid distributing the
+binaries.<br>
+<li> Linked with Allegro 3.1 and checked the 16 bits sound and additions to
+avoid linking the whole library were incorporated by Shawn (all OK).<p>
+<b>Revision</b> 1.5 1999/01/29 01:41:44 set<br>
+<li> Created the compress.pl Perl script to create the Linux distribution files.<p>
+<b>Revision</b> 1.4 1999/01/26 00:16:52 set<br>
+<li> Various small adjusts to compile under Linux.<p>
+<b>Revision</b> 1.3 1999/01/25 23:08:07 set<br>
+<li> Modified the name files to use the new Uses_n request for the n() macro.<p>
+<b>Revision</b> 1.2 1999/01/19 23:47:24 set<br>
+<li> Passed the files to a CVS repository.<p>
+
+<p>Converted to HTML by a simple Perl script &copy; by SET</Body></HTML> \ No newline at end of file
diff --git a/setedit/www-site/examples.css b/setedit/www-site/examples.css
new file mode 100644
index 0000000..d397485
--- /dev/null
+++ b/setedit/www-site/examples.css
@@ -0,0 +1,26 @@
+body { background:#0000A8 }
+b.Normal { color:#FCFC54; background:#0000A8; font-family:Courier New; }
+b.Marked { color:#0000A8; background:#A8A8A8; font-family:Courier New; }
+b.Comment { color:#A8A8A8; background:#0000A8; font-family:Courier New; }
+b.Reserved { color:#5454FC; background:#0000A8; font-family:Courier New; }
+b.Ident { color:#FCFC54; background:#0000A8; font-family:Courier New; }
+b.Symbol { color:#FCFCFC; background:#0000A8; font-family:Courier New; }
+b.String { color:#54FCFC; background:#0000A8; font-family:Courier New; }
+b.Integer { color:#A800A8; background:#0000A8; font-family:Courier New; }
+b.Float { color:#A85400; background:#0000A8; font-family:Courier New; }
+b.Octal { color:#FCFCFC; background:#00A8A8; font-family:Courier New; }
+b.Hex { color:#54FCFC; background:#00A800; font-family:Courier New; }
+b.Char { color:#FC54FC; background:#0000A8; font-family:Courier New; }
+b.Pre { color:#54FC54; background:#0000A8; font-family:Courier New; }
+b.Illegal { color:#000000; background:#A80000; font-family:Courier New; }
+b.User { color:#00A800; background:#0000A8; font-family:Courier New; }
+b.CPU { color:#000000; background:#00A8A8; font-family:Courier New; }
+b.Break { color:#FCFCFC; background:#A80000; font-family:Courier New; }
+b.Symbol2 { color:#FC5454; background:#0000A8; font-family:Courier New; }
+b.CrossCur { color:#A8A8A8; background:#000000; font-family:Courier New; }
+b.StatusLi { color:#000000; background:#A8A8A8; font-family:Courier New; }
+b.MPHighL { color:#FC5454; background:#A8A8A8; font-family:Courier New; }
+b.RectSel { color:#FCFCFC; background:#A800A8; font-family:Courier New; }
+b.OddTab { color:#000000; background:#00A800; font-family:Courier New; }
+b.EvenTab { color:#000000; background:#A80000; font-family:Courier New; }
+b.ColMark { color:#000000; background:#A80000; font-family:Courier New; }
diff --git a/setedit/www-site/iguazu.html b/setedit/www-site/iguazu.html
new file mode 100644
index 0000000..33d9a68
--- /dev/null
+++ b/setedit/www-site/iguazu.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+ <title>SETEDIT, a friendly text editor - Iguazu name</title>
+ <meta name="description" content="SETEdit a friendly text editor for DOS, Win32, Linux and other UNIXes">
+ <meta name="keywords" content="SETEdit, setedit, rhide, editor, linux, DOS, console, tui, djgpp, library, download, SET, Salvador, Eduardo, Tropea, PPC, SPARC, Alpha, FreeBSD, Solaris">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, salvador[at server]inti.gov.ar">
+</head>
+<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">
+
+<p><center>
+<table>
+<tr>
+<td><strong><h1>Iguaz</h1></strong></td>
+<td align=right><A href="http://sourceforge.net">
+ <IMG valign=center src="http://sourceforge.net/sflogo.php?group_id=32835"
+ width="88" height="31" border="0" alt="SourceForge Logo"></A></td>
+</tr>
+</table>
+</center></p>
+
+For those who dont know what is "Iguaz" (most of you I guess ;-): Thats a water falls
+system located in the Argentina-Brasil border.<br>
+Here is a description I found:<p>
+
+Iguaz: "Big Water" in Guarani language. The waterfalls of this place are a colossal wonder
+that must be experienced , lived and enjoyed with our five senses. They consist of 275
+falls with a height of up to 70m. One can go on exciting boat rides under the cascades and
+walk along the paths appreciating some of the typical animals of the subtropical forest.
+The "Devil's Gorge" is a different spectacle which, leaving Puerto Canoas, can be enjoyed
+in all its majestic splendor from a distance of only fifty meters.
+<p>
+
+<center>
+<img src="Iguazu_I.jpg" width=400 height=262>
+</center>
+
+</body>
+</html> \ No newline at end of file
diff --git a/setedit/www-site/index.html b/setedit/www-site/index.html
new file mode 100644
index 0000000..4bb6bf0
--- /dev/null
+++ b/setedit/www-site/index.html
@@ -0,0 +1,890 @@
+<html>
+<head>
+ <title>SETEDIT, a friendly text editor</title>
+ <meta name="description" content="SETEdit a friendly text editor for DOS, Win32, Linux and other UNIXes">
+ <meta name="keywords" content="SETEdit, setedit, rhide, editor, linux, DOS, console, tui, djgpp, library, download, SET, Salvador, Eduardo, Tropea, PPC, SPARC, Alpha, FreeBSD, Solaris">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, salvador inti.gov.ar">
+</head>
+<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">
+
+<p><center>
+<table>
+<tr>
+<td><strong><h1>SETEDIT</h1></strong></td>
+<td align=right><A href="http://sourceforge.net">
+ <IMG valign=center src="http://sourceforge.net/sflogo.php?group_id=32835"
+ width="88" height="31" border="0" alt="SourceForge Logo"></A></td>
+</tr>
+</table>
+</center></p>
+
+I provide a menu because some sections are large and perhaps you are not
+interested in reading all:
+<ul>
+<li> <b><a href="http://sourceforge.net/projects/setedit/" target="_top">Lastest news, downloads and summary of the project</a> [That's the Source Forge summary page]</b>
+ <p>
+<li> <a href="#intro">Introduction</a>
+<li> <a href="#features">Features</a>
+<li> <a href="#license">License</a>
+<li> <a href="#scrnsht">Screen shots</a>
+<li> <a href="#download">Download</a>
+<li> <a href="#contributing">Contributing</a>
+<li> <a href="#mail-l">Mailing list</a>
+<li> <a href="announce.html" target="_top">Announcement of the last release</a>
+<li> <a href="readme.html" target="_top">Readme first</a>
+<li> <a href="change.html" target="_top">Change log</a>
+<li> <a href="infview.html">The info viewer as an standalone program: InfView</a>
+<li> <a href="#gcc3">Comparison between gcc 3 and 2</a>
+<li> <a href="#rhide">A full IDE: RHIDE</a>
+<li> About the names of the releases
+ <ul>
+ <li> <a href="iguazu.html">Iguaz</a>
+ <li> <a href="pmoreno.html">Glaciar Perito Moreno</a>
+ </ul>
+</ul>
+
+<blink><big>New</big></blink>. New pre-release available. Code name: "Glaciar Perito Moreno II"
+(v0.5.5). It fixes an important bug and adds VHDL support among other things.<p>
+<!--
+<blink><big>New</big></blink> here are snapshots of the unstable X11 version of setedit:<br>
+Running on Linux using <b>2</b> different fonts: <a href="Snap2Fonts.gif">Only the window (10 Kb)</a>.<br>
+Running on Linux: <a href="setedit-X11.jpg">Only the window (70 Kb)</a>, <a href="setedit-X11-full.jpg">Full
+screen (252 Kb)</a> and <a href="setedit-X11-full-2.jpg">Full screen less compressed (450 Kb)</a>.<br>
+Running on Solaris: <a href="setedit2.sun.jpg">Full screen (268 Kb)</a> and <a href="setedit.sun.jpg">Full screen less compressed (447 Kb)</a>.
+Thanks goes to Alex Lozano for testing on Solaris and taking the snapshots.<p>
+ -->
+
+<a name="intro"></a>
+SETEDIT is my best program, I started it around june of 1996. When I
+discovered djgpp (<a href="#djgpp">read it if you don't know what djgpp is</a>)
+one thing that annoyed me was the lack of intuitive tools.
+I was a user of <a href="http://www.borland.com" target="_top">Borland</a> products since
+1993 and I really missed the BC++ IDE, but soon I found
+<a href="http://www.rhide.com/" target="_top">RHIDE</a>. Lamentably
+RHIDE was in your early beta stage, the editor was really dumb, no help
+system, no debugger, tons of bugs, etc. So, instead of giving up I started
+to help Robert with RHIDE. Very soon I solved the lack of help system with
+my InfView class and then I started with something bigger: replacing the old
+editor by a new one. I did it using the already existing one so we had
+something working pretty soon. My objective was to make an editor as good as
+the one found in BC++ 3.1.<p>
+Today I'm confident my editor is better than BC++'s one in most of the
+fields, here is a list of features:<p>
+
+<a name="features"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">FEATURES</th></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Supported platforms</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+
+<ul>
+<li> DOS or any other OS that can emulate DOS in a decent way.
+<li> GNU/Linux for i386. (The code runs for Alpha, AMD64, ARM, HPPA, Itanium (IA64), PPC and SPARC
+ but isn't fully tested).
+<li> Win32 (Windows 95, 98, ME, NT 4.0, 2000, XP, etc.) as a native application, not a DOS
+ application.
+<li> Darwin, FreeBSD, NetBSD and OpenBSD. May be also other BSD flavors.
+<li> Solaris (Tested on a SPARC64 machine and also an x86 machine)
+<li> QNX
+</ul>
+<p></td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Edition</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+
+<ul>
+<li> Selection:
+ <ul>
+ <li> Wordstar mode (^K-B/^K-K, etc.)
+ <li> Using shift key plus any movement
+ <li> Mouse
+ <li> Rectangular blocks supported, very useful to move/copy/delete columns
+ <li> Support for OS native clipboard (Windows clipboard, gpm (Linux) and X11 clipboard and
+ selection)
+ <li> Persistent and no persistent selections
+ <li> Read/write from/to disk
+ <li> Mark a line or word with one keystroke
+ <li> "Transparent" selections (you don't lose the highlight) [option]
+ </ul>
+<li> Indentation:
+ <ul>
+ <li> Autoindent [option]
+ <li> Tab indents/delete unindents [option]
+ <li> Block indent/unindent (one space, one tab or a level)
+ <li> Intelligent auto indent [option]
+ </ul>
+<li> Pairs of braces, brackets, etc.
+ <ul>
+ <li> Highlighting when you type [option]
+ <li> Reporting the position if the pair is outside the screen [option]
+ <li> Jump to the matching pair, for a specific or generic case
+ </ul>
+<li> Macros:
+ <ul>
+ <li> Pmacros, typing the first two letters you can expand a text or structure
+ <li> Recordable macros
+ <li> Small macro language based on Lisp
+ </ul>
+<li> Jump in the text:
+ <ul>
+ <li> Ten easy to access markers to jump
+ <li> Jump to a line
+ <li> Jump to a function, just place the cursor over the name of a function that's declared in the source and pressing a couple of keys you jump to it
+ <li> Jump to any defined symbol using <a href="#tags">TAGS</a>
+ </ul>
+<li> Search and Replace:
+ <ul>
+ <li> In the text using:
+ <ul>
+ <li> Normal text or basic, extended or Perl regular expressions
+ <li> Case sensitive or not
+ <li> Whole words or just part
+ <li> Inside the selected text or in the whole document
+ <li> From the cursor or for the full scope of the search
+ <li> Inside/outside comments
+ <li> Normal replace or expanding subexpressions (with $n like in Perl)
+ </ul>
+ <li> Outside the text:
+ <ul>
+ <li> Using all the power of grep
+ <li> Basic and extended regular expressions
+ <li> Case sensitive or not
+ <li> Whole words or just part
+ <li> Whole line or just part
+ <li> In the files of the project or in a list of directories
+ <li> You can specify the mask of files to search for
+ <li> Recursive search for subdirectories available
+ <li> To any symbol definition using <a href="#tags">TAGS</a>
+ </ul>
+ </ul>
+<li> Movement:
+ <ul>
+ <li> Arrow keys, page up, page down, home, end, etc.
+ <li> First/last line in the screen
+ <li> First/last character in file
+ <li> Next/previous word
+ <li> First/last character in the selection
+ <li> Cursor ever centered [option]
+ <li> Scroll window
+ </ul>
+<li> Tabs support:
+ <ul>
+ <li> Adjustable size
+ <li> Use tabs in the text or not
+ <li> Conversion of tabs into spaces and viceversa
+ <li> Optimal fill (fills gaps with tabs) [option]
+ <li> Visible tabs [option]
+ <li> Move inside or around tabs
+ </ul>
+<li> Miscellaneous:
+ <ul>
+ <li> Block toupper/lower
+ <li> Number of bytes selected
+ <li> Normal, column, line or cross cursor
+ <li> Un/comment block
+ </ul>
+</ul>
+<p></td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Other features</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+
+<ul>
+<li> Intuitive interface using windows and mouse. I use
+ <a href="http://tvision.sourceforge.net/" target="_top">Turbo Vision</a> for it.
+<li> The state of all windows is remembered
+<li> Configurable keyboard
+<li> Configurable menus
+<li> You can run external programs pressing a key or using the menu
+<li> Projects to group files with some common criteria
+<li> Undo
+<li> Documentation generator
+<li> Very fast (and yet configurable) syntax highlight for:
+ <ul>
+ <li> 4DOS batch files
+ <li> 80x86 assembler (AT&T syntax)
+ <li> 80x86 assembler (Intel syntax)
+ <li> 8x51 assembler
+ <li> Ada
+ <li> BASIC
+ <li> C/C++
+ <li> Cascading Style Sheets version 2
+ <li> Clipper 5.x
+ <li> Command Line Errors File
+ <li> Environment files
+ <li> Flat assembler
+ <li> Fortran
+ <li> HTML
+ <li> Internationalization files (.po)
+ <li> Java
+ <li> Java Script
+ <li> Lua
+ <li> Makefiles
+ <li> Menu files [config. file of the editor]
+ <li> Modula 2
+ <li> Netwide Assembler (NASM)
+ <li> Objetive C
+ <li> Pascal
+ <li> PDP11 assembler
+ <li> Perl
+ <li> PHP
+ <li> PIC assembler (Microchip)
+ <li> PLM/51
+ <li> PMacros files [config. file of the editor]
+ <li> PostScript
+ <li> POV-ray
+ <li> Python
+ <li> Ruby
+ <li> SDG format files [config. file of the editor]
+ <li> sLisp macros [config. file of the editor]
+ <li> SPARC assembler
+ <li> SQL
+ <li> The syntax highlight file itself [config. file of the editor]
+ <li> TCL/Tk
+ <li> TeX
+ <li> Texinfo
+ <li> Turbo Vision configuration files
+ <li> UNIX shell scripts
+ <li> VHDL
+ <li> XML
+ <li> WML
+ </ul>
+<li> Class browser using <a href="#tags">TAGS</a>
+<li> Word completion using <a href="#tags">TAGS</a>
+<li> Support for UNIX files for DOS and DOS files for Linux.
+<li> Transparent support for compressed text files (gzip and bzip2 formats)
+<li> Context sensitive help system
+<li> Syntax help system
+<li> Reader for .info help files with many features as bookmark, open more
+ than one window, search, mouse, etc.
+<li> Code pages support
+<li> Customizable colors
+<li> Clock
+<li> Calculator
+<li> Tips
+<li> Customizable palette of colors
+<li> Fonts
+<li> MP3 player!
+</ul>
+<p></td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Special features only available for DOS</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+<ul>
+<li> Various video modes, including VESA text modes
+</ul>
+<p></td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Special features only available for Linux</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+<ul>
+<li> Debug interface (using <a href="http://www.gnu.org/software/gdb/gdb.html">gdb</a>)
+ <ul>
+ <li> Dialogs to configure the debug mode (local, remote and running process), the
+ command line options for the program, gdb binary, xterm binary, messages
+ displayed, etc.
+ <li> Breakpoints, simple ones and advanced options including conditional
+ breakpoints, breakpoints at functions, ignore count, etc.
+ <li> Watchpoints, they are data breakpoints.
+ <li> Options to run, continue, step over, trace into, run upto return, etc.
+ <li> Options to stop and kill the program.
+ <li> Thread selection.
+ <li> Evaluate and modify data.
+ <li> Data Window and Stack to browse the memory (very complete and with its own menu).
+ <li> Data Watches, like then ones in RHIDE and also with scope.
+ <li> Data Inspectors, used to analyze complex data structures.
+ <li> Disassembler Window, including syntax highlight and allowing to modify the registers.
+ <li> Calling stack, with functionality to browse the call chain.
+ </ul>
+</ul>
+
+<p><hr><p>
+
+And much more things that I don't remember right now.<p>
+<p></td></tr>
+</table><p>
+
+<a name="license"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">LICENSE</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+<br>
+The editor is distributed under the <a href="http://www.gnu.org/copyleft/gpl.html" target="_top">GPL</a>
+license. It basically means the code is free and you don't need to pay for it
+and you are free to change it, but any derived work will become GPL too. Most
+of the software available for Linux is distributed under these terms. This
+license protects my rights over the code (I hold the copyright) and protects
+the users ensuring they are free to use the code. If you plan to use parts or
+the whole code of the editor be sure you read the GPL license carefully.<br>
+Note that GPL implies a disclaimer of guaranty, so if you must use it in an
+enterprise where you need to be able to sue software's authors in case of
+direct or indirect problems created by it just forget about the editor. By
+the way, I don't know about even one big company (Microsoft included) that doesn't
+included a disclaim of guaranty in your license.<br>
+Even when you don't need to pay for the editor I accept any kind of help ;-).
+The best way to help me is contributing in one of the ways I mention
+<a href="#help">here</a>.<br>
+ <br>
+</td></tr></table><p>
+
+<a name="scrnsht"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">Screen Shots</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>OS: Win95, 94x34, font: 8x16. Editors: C and Perl files. ASCII table,
+Calculator and Calendar</td>
+<td>
+<a href="se1.gif"><img border=0 src="se1t.gif" alt="29451 bytes" width=160 height=116></a>
+</td>
+<td>OS: Win95, 94x34, font: 8x16. Editors: C, Perl, Environment and Makefile.
+See the rectangular and regular selections. Also the visible tabs in the makefile</td>
+<td>
+<a href="se2.gif"><img border=0 src="se2t.gif" alt="22398 bytes" width=160 height=116></a>
+</td>
+</tr>
+<tr BGCOLOR="#80A0FF">
+<td>OS: Linux, using X11 driver and two different fonts</td>
+<td>
+<a href="Snap2Fonts.gif"><img border=0 src="se3t.gif" alt="10500 bytes" width=160 height=100></a>
+</td>
+<td>OS: Solaris, using X11 driver, this is from one of the first test versions.</td>
+<td>
+<a href="setedit2.sun.jpg"><img border=0 src="se4t.gif" alt="274865 bytes" width=160 height=128></a>
+</td>
+</tr>
+<tr BGCOLOR="#80A0FF">
+<td>OS: Linux, using X11 driver and a nice Enlightenment theme ;-)</td>
+<td>
+<a href="setedit-X11-full-2.jpg"><img border=0 src="se5t.gif" alt="487382 bytes" width=160 height=120></a>
+</td>
+<td>OS: Linux (Debian), 128x45, 6x12 Fixed Medium font, from an ETerm, and shows a
+Perl and a Java source file, and the MP3 menu. Contributed by Mike Conrad.</td>
+<td>
+<a href="SETEdit_SS.gif"><img border=0 src="SETEdit_SS_small.jpg" alt="52908 bytes" width=160 height=120></a>
+</td>
+</tr>
+<tr BGCOLOR="#80A0FF">
+<td>OS: Linux, using X11 driver.<br>Here you can see the editor debugging itself. A watch, an inspector and
+the disassembler window are in use.</td>
+<td>
+<a href="setedit_debug1.jpg"><img border=0 src="setedit_debug1s.jpg" alt="411415 bytes" width=160 height=120></a>
+</td>
+<td>More <a href="xterm.html">snapshots</a> of the editor running on remote systems. They
+ are for different systems, something similar to trophies ;-)</td>
+<td></td>
+</tr>
+</table>
+<p>
+
+<a name="download"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">DOWNLOAD</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td><br>Last release is `Glaciar Perito Moreno I' aka 0.5.4.<br>
+<br></td>
+</tr>
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">IMPORTANT!</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+<ol>
+<li> Only the most common files are listed here, for a complete list of available files go
+ to the Source Forge Summary page or click
+ <a href="http://sourceforge.net/project/showfiles.php?group_id=32835">here</a>.
+<li> Don't be afraid of the version numbers, 0.5.4 is very stable and mature, other people
+ could name it version 5.4.
+<li> You can download the files using <b>ftp</b>. For this use the upload.sf.net server.
+ Login as anonymous user and go to the /pub/sourceforge/s/se/setedit and
+ /pub/sourceforge/t/tv/tvision directories.
+</ol>
+<p>
+</td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">DOS</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+<ul>
+<li> <b>Sources</b>:
+ <ul>
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/edi054s.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/tv203s.zip">2.0.3</a>)
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/edi052s.zip">Iguaz I (v0.5.2)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/tv202s.zip">2.0.2</a>)
+ <li> Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/edi0454s.zip">v0.4.54</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/tv114s.zip">1.1.4</a>)
+ </ul>
+ All DOS packages are in .zip format and must be compiled using djgpp.<br>
+ You also need <a href="http://tvision.sourceforge.net/">Turbo Vision</a> sources,
+ uncompress both packages in your djgpp directory. After uncompressing the sources
+ will be in the <b>contrib</b> directory.<p>
+<li> <b>Binary installer</b>:
+ <ul>
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/edi054i.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release [Fix for "pure DOS" (not Windows emulating DOS) problems] <a href="http://prdownloads.sourceforge.net/setedit/edi052f1.zip">Iguaz I DOS fix/test (v0.5.2)</a> please report if it works or not
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/edi052i.zip">Iguaz I (v0.5.2)</a>
+ <li> Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/edi0454i.zip">v0.4.54</a><br>
+ </ul>
+ The installer is compressed using .zip format. Uncompress it and run the install.exe
+ program. The installer will ask installation options and optionally create a desktop
+ shortcut, menu item and modify autoexec.bat.<br>
+ This is the recommended package for djgpp and no-djgpp users.<p>
+<li> <b>Binary Windows installer</b>:
+ <ul>
+ <li> Last release (EXE) <a href="http://prdownloads.sourceforge.net/setedit/setedit-0_5_4-Win32Inst-DOSBin.exe">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release (EXE) [New installer] <a href="http://prdownloads.sourceforge.net/setedit/setedit-0_5_2Win32Inst-DOSBin.exe">Iguaz I (v0.5.2)</a>
+ <li> Previous release (EXE) <a href="http://prdownloads.sourceforge.net/setedit/setedit-0_5_2-Win32Inst.exe">Iguaz I (v0.5.2)</a>
+ <li> Previous release (MSI) <a href="http://prdownloads.sourceforge.net/setedit/setedit-0_5_2.msi">Iguaz I (v0.5.2)</a>
+ </ul>
+ This package was contributed by William Cullen. It uses the standard
+ Windows installers to install the <b>DOS version</b> of the editor.<br>
+ <b>For Windows 2000, XP and similar OSs:</b><br>
+ You should try the Win32 version. For this you must download and install the DOS
+ version first <b>and</b> then get one of the Win32 version binaries and finally
+ replace the setedit.exe.<p>
+<li> <b>Binary</b>:
+ <ul>
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/edi054b.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release [Fix for "pure DOS" (not Windows emulating DOS) problems] <a href="http://prdownloads.sourceforge.net/setedit/edi052f1.zip">Iguaz I DOS fix (v0.5.2)</a>
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/edi052b.zip">Iguaz I (v0.5.2)</a>
+ <li> All the available development releases: <a href="http://sourceforge.net/project/showfiles.php?group_id=32835&package_id=27730">SF</a>
+ <li> Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/edi0454b.zip">v0.4.54</a><br>
+ </ul>
+ It contains the binaries using a layout that matchs other djgpp applications. I
+ recommend using the installer, but this pacakge is provided in case the installer
+ fails or you don't like installers. Uncompress it in your djgpp directory like any
+ other djgpp package.
+</ul>
+<p>
+</td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Linux/Solaris/QNX/*BSD/etc.</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+<ul>
+<li> <b>Sources</b>:
+ <ul>
+ <li> CVS snapshot <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.5-2.tar.gz">Glaciar P. Moreno II (v0.5.5 r1235)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision_2.1.0-2.tar.gz">2.1.0</a>)
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.4.tar.gz">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-2.0.3.src.tar.gz">2.0.3</a>)
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.2.tar.gz">Iguaz I (v0.5.2)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-2.0.2.src.tar.gz">2.0.2</a>)
+ <li> Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.4.54.tar.gz">v0.4.54</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision-1.1.4.src.tar.gz">1.1.4</a>)
+ </ul>
+ All packages are in .tar.gz format and must be compiled using gcc. Note that if you
+ use a very new version of gcc you'll have to use the last release or the CVS code.<br>
+ You also need <a href="http://tvision.sourceforge.net/">Turbo Vision</a> sources.
+ I recommend uncompressing both packages in the same directory (i.e. /usr/src).<p>
+<li> <b>Important for binaries</b>:
+ <ol>
+ <li> Each Linux distribution uses a particular set of libraries so you can't install
+ a binary compiled for Red Hat 7.3 in a SuSE 8.0 machine. Some times it works
+ some times it fails.
+ <li> Statically linked binaries have more chances but it doesn't mean it will work.
+ Starting with Turbo Vision 2.0.0 the binary needs X11 libraries and they can't
+ be linked statically. So I don't distribute 0.5.0 and newer versions statically
+ linked.
+ <li> Consider downloading the sources if binaries for your distribution aren't
+ available. If you can't compile the sources please report it. If you can
+ generate binaries for your system in RPM, DEB or similar format please consider
+ contributing them so other people using your system can download it.
+ </ol>
+ <p>
+<li> <b>Debian GNU/Linux Sarge 3.1 (i386)</b>:
+ <ul>
+ <li> CVS snapshot <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.5-2_i386.deb">Glaciar P. Moreno II (v0.5.5 r1235)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-2_i386.deb">2.1.0</a>)
+ </ul>
+ <p>
+<li> <b>Debian GNU/Linux Sarge 3.1 (SPARC)</b>:
+ <ul>
+ <li> CVS snapshot <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.5-2_sparc.deb">Glaciar P. Moreno II (v0.5.5 r1235)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-2_sparc.deb">2.1.0</a>)
+ </ul>
+ <p>
+<li> <b>Debian GNU/Linux Woody 3.0 (i386)</b>:
+ <ul>
+ <li> A Debian repository is maintained by Ivan, you can add the following to your
+ /etc/apt/sources.list:<br>
+ deb http://setedit.sourceforge.net/debian woody main<br>
+ That's for Woody, replace woody by potato for Potato.
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.4-3_i386.deb">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3_2.0.3-3_i386.deb">2.0.3</a>)
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.2-0.1_i386.deb">Iguaz I (v0.5.2)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.2_2.0.2-0.1_i386.deb">2.0.2</a>)
+ </ul>
+ <p>
+<li> <b>Debian GNU/Linux Woody 3.0 (Alpha)</b>:
+ <ul>
+ <li> This should be considered experimental because it was compiled on a remote
+ machine and tested only using XTerm.
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.4-1_alpha.deb">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.0.3_2.0.3-2_alpha.deb">2.0.3</a>)
+ </ul>
+ <p>
+<li> <b>Debian GNU/Linux Potato 2.2 (i386)</b>:
+ <ul>
+ <li> Only an old release is available for Potato
+ <li> Old release <a href="http://setedit.sf.net/debian/dists/potato/main/binary-i386/setedit_0.5.0-1_i386.deb">v0.5.0</a>
+ (Use with TV <a href="http://setedit.sf.net/debian/dists/potato/main/binary-i386/rhtvision2.0.1_2.0.1-1_i386.deb">2.0.1</a>)
+ </ul>
+ <p>
+<li> <b>Debian GNU/Linux Potato 2.2 (Others)</b>:
+ <ul>
+ <li> Only an old release is available for Potato
+ <li> <b>Alpha</b>: Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.4.54-1_alpha.deb">v0.4.54</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/setedit/rhtvision1.1.4_1.1.4-0.1_alpha.deb">1.1.4</a>)
+ <li> <b>Power PC</b>: Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.4.54-1_powerpc.deb">v0.4.54</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/setedit/rhtvision1.1.4_1.1.4-0.1_powerpc.deb">1.1.4</a>)
+ <li> <b>SPARC</b>: Last stable in previous series <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.4.54-1_sparc.deb">v0.4.54</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/setedit/rhtvision1.1.4_1.1.4-0.1_sparc.deb">1.1.4</a>)
+ </ul>
+ <p>
+<li> <b>Fedora Core 3 (i586)</b>:
+ <ul>
+ <li> Last release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.4-1.bbcat.fc3.i586.rpm">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-4.bbcat.fc3.i586.rpm">2.0.3</a> and
+ libmigdb <a href="http://prdownloads.sourceforge.net/libmigdb/libmigdb-0.8.8-1.bbcat.fc3.i586.rpm">0.8.8</a>)
+ </ul>
+ <p>
+<li> <b>Fedora Core 2 (i686)</b>:
+ <ul>
+ <li> CVS release (20040113) <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.3-3.fc2.bbcat.i686.rpm">Iguaz II (v0.5.3 CVS)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-1.fc2.bbcat.i686.rpm">2.0.3 CVS</a>)
+ </ul>
+ <p>
+<li> <b>Fedora Core 1 (i386)</b>:<br>
+ Rohan Carly reported success installing the Red Hat 7.3 binaries like this:<br>
+ <xmp>
+ If I install this C++ library that comes with the distribution:
+ rpm -i compat-libstdc++-7.3-2.96.118.i386.rpm
+
+ ... then I can install your RPMS without much trouble:
+ rpm -i librhtv-2.0.2-3rh73.i386.rpm
+ rpm -i --nodeps setedit-0.5.2-1rh73.i386.rpm
+
+ The --nodeps for setedit is required because it thinks it
+ /usr/local/install-info is missing. In reality it resides in
+ /sbin/install-info.
+ </xmp>
+ <p>
+<li> <b>Mandrake/Mandriva 10.0 (i386)</b>:
+ <ul>
+ <li> Last pre-release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.4-1mk10.i586.rpm">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-3mk10.i586.rpm">2.0.3</a>)
+ </ul>
+ <p>
+<li> <b>Mandrake 9.1 (i386)</b>:
+ <ul>
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.2-1mk91.i586.rpm">Iguaz I (v0.5.2)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3mk91.i386.rpm">2.0.2</a>)
+ </ul>
+ <p>
+<li> <b>Red Hat 9.0 (i386)</b>:
+ <ul>
+ <li> Last pre-release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.4-1rh9.i386.rpm">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-3rh9.i386.rpm">2.0.3</a>)
+ </ul>
+ <p>
+<li> <b>Red Hat 8.0 (i386) [Also look in Red Hat 7.3 section]</b>:
+ <ul>
+ <li> Last pre-release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.4-1rh8.i386.rpm">Glaciar P. Moreno I (v0.5.4)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-3rh8.i386.rpm">2.0.3</a>)
+ </ul>
+ <p>
+<li> <b>Red Hat 7.3 (i386)</b>:
+ <br><b>Note:</b> users reported that these RPMs also works for Red Hat 9.0 without generating dependency problems.
+ <ul>
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.2-1rh73.i386.rpm">Iguaz I (v0.5.2)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3rh73.i386.rpm">2.0.2</a>)
+ </ul>
+ <p>
+<li> <b>SuSE 9.1 (i586)</b>:
+ <ul>
+ <li> CVS release (20040113) <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.3-4.SuSE9.1.bbcat.i586.rpm">Iguaz II (v0.5.3 CVS)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-2.SuSE9.1.bbcat.i586.rpm">2.0.3 CVS</a>)
+ </ul>
+ <p>
+<li> <b>SuSE 9.0 (i586)</b>:
+ <ul>
+ <li> CVS release (20040124) <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.3-1.i586.rpm">Iguaz II (v0.5.3 CVS)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.3-1.i586.rpm">2.0.3 CVS</a>)
+ </ul>
+ <p>
+<li> <b>SuSE 8.2 (i686)</b>:
+ <ul>
+ <li> Previous release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.2-2.i686.rpm">Iguaz I (v0.5.2)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.2-3.i686.rpm">2.0.2</a>)
+ </ul>
+ <p>
+<li> <b>SuSE 8.1 (i686)</b>:
+ <ul>
+ <li> Old release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.0-4.i686.rpm">v0.5.0</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-3.i686.rpm">2.0.1</a>)
+ </ul>
+ <p>
+<li> <b>SuSE 8.0 (i686)</b>:
+ <ul>
+ <li> Old release <a href="http://prdownloads.sourceforge.net/setedit/setedit-0.5.0-1.i686.rpm">v0.5.0</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/librhtv-2.0.1-1.i686.rpm">2.0.1</a>)
+ </ul>
+ <p>
+<li> <b>Ubuntu 6.10 (i386)</b>:
+ <ul>
+ <li> CVS snapshot <a href="http://prdownloads.sourceforge.net/setedit/setedit_0.5.5-2_i386.ubu61.deb">Glaciar P. Moreno II (v0.5.5 r1235)</a>
+ (Use with TV <a href="http://prdownloads.sourceforge.net/tvision/rhtvision2.1.0_2.1.0-2_i386.ubu61.deb">2.1.0</a>)
+ </ul>
+ <p>
+</ul>
+<p>
+</td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Win32</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+<p>
+<ul>
+<li> <b>IMPORTANT!! To try the Win32 native version you have to install the DOS version and then replace the
+ setedit.exe executable by one of the available Win32 executables.</b><p>
+<li> <b>General notes</b>:
+ This isn't 100% tested but all people that tried it reported good results. I recommend it
+ for Windows NT (2000, XP, etc.) users. I don't have any Windows XP box and some users
+ reported strange behavior when using the DOS version.<p>
+<li> <b>Cywin users</b>: <a href="mailto:wiktorw@ics.p.lodz.pl">Wiktor Wandachowicz</a> wrote a
+ step by step <a href="Cygwin_install.txt">tutorial</a> explaining how to install the editor
+ in a Cygwin system.<p>
+<li> <b>From sources</b>:
+ The editor can be compiled for Win32 using Borland C++ 5.5 <b>free</b> compiler.
+ To compile the editor you need BC++ 5.5 command line compiler and tools.
+ The compilation is quite similar to the DOS version, you just need the zip file used
+ for DOS (and <a href="http://tvision.sourceforge.net/" target="_top">Turbo Vision</a>).<p>
+<li> <b>Binaries</b>:
+ <ul>
+ <li> Last release (compiled with BC++ 5.5)
+ <a href="http://prdownloads.sourceforge.net/setedit/setedit-Win32-BCPP-0_5_4.zip">Glaciar P. Moreno I (v0.5.4)</a>.<br>
+ <li> Last release (compiled with Cygwin, needs Cygwin's DLL)
+ <a href="http://prdownloads.sourceforge.net/setedit/setedit-Win32-Cygwin-0_5_4.zip">Glaciar P. Moreno I (v0.5.4)</a>.<br>
+ <li> Previous release (compiled with BC++ 5.5)
+ <a href="http://prdownloads.sourceforge.net/setedit/setedit-Win32-BCPP-0_5_2.zip">Iguaz I (v0.5.2)</a>.<br>
+ </ul>
+ To use it just install the DOS version and replace setedit.exe by this executable.<br>
+ Note that even when this program looks like the DOS version it is a true Win32 application
+ and should behave much better under Windows NT, 2000, XP and similars.<br>
+</ul>
+<p>
+</td></tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">Documentation in other formats</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td>
+ <p>
+ <ul>
+ <li> <b>PDF</b>:
+ <ul>
+ <li> Last release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-pdf-0_5_4.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-pdf-0_5_2.zip">Iguaz I (v0.5.2)</a>
+ <li> Last stable in previous series: <a href="http://prdownloads.sourceforge.net/setedit/setedit-pdf-0454.zip">v0.4.54</a>
+ </ul>
+ <li> <b>HTML</b>:
+ <ul>
+ <li> Last release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-html-0_5_4.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-html-0_5_2.zip">Iguaz I (v0.5.2)</a>
+ <li> Last stable in previous series: <a href="http://prdownloads.sourceforge.net/setedit/setedit-html-0454.zip">v0.4.54</a>
+ </ul>
+ <li> <b>DVI</b>:
+ <ul>
+ <li> Last release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-dvi-0_5_4.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-dvi-0_5_2.zip">Iguaz I (v0.5.2)</a>
+ <li> Last stable in previous series: <a href="http://prdownloads.sourceforge.net/setedit/setedit-dvi-0454.zip">v0.4.54</a>
+ </ul>
+ <li> <b>PS (Postscript)</b>:
+ <ul>
+ <li> Last release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-ps-0_5_4.zip">Glaciar P. Moreno I (v0.5.4)</a>
+ <li> Previous release: <a href="http://prdownloads.sourceforge.net/setedit/setedit-ps-0_5_2.zip">Iguaz I (v0.5.2)</a>
+ <li> Last stable in previous series: <a href="http://prdownloads.sourceforge.net/setedit/setedit-ps-0454.zip">v0.4.54</a>
+ </ul>
+ </ul>
+ <p>
+</td>
+</tr>
+
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">CVS</th></tr>
+<tr BGCOLOR="#80A0FF">
+ <td><p><ul>
+ <li> Using CVS tool:
+ <ol>
+ <li> Check out the TV's CVS:<br>
+ cvs -d:pserver:anonymous@tvision.cvs.sourceforge.net:/cvsroot/tvision login<br>
+ cvs -z3 -d:pserver:anonymous@tvision.cvs.sourceforge.net:/cvsroot/tvision co tvision
+ <li> Check out the editor's CVS:<br>
+ cvs -d:pserver:anonymous@setedit.cvs.sourceforge.net:/cvsroot/setedit login<br>
+ cvs -z3 -d:pserver:anonymous@setedit.cvs.sourceforge.net:/cvsroot/setedit co setedit
+ </ol><p>
+ <li> CVS web: <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/setedit">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/setedit</a><p>
+ <li> Snapshot: See the <a href="snap.html">snap.html</a> page.<br>
+ For Turbo Vision consult it: <a href="http://tvision.sf.net/snap.html">http://tvision.sf.net/snap.html</a> page.<br>
+ </ul><p></td>
+</tr>
+
+</table>
+<p>
+
+<a name="contributing"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">CONTRIBUTING</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+<br>
+There are a lot of ways you can contribute, here are some of them:<p>
+
+<ul>
+<li> Giving useful bug reports, it means providing a good description of the
+ bug and how to reproduce it.
+<li> Helping with the documentation. Even when I try to keep the documentation
+ up to date that's a lot of work and there are a lot of issues not covered
+ by the documentation. You could just take one of these topics and
+ investigate about it to then write a small chapter about it.
+<li> Writing examples of use or <i>mini-howto</i>s. I'll be glad to include
+ them with the editor.
+<li> Helping with the web pages.
+<li> Helping with the distribution, e.g. if you have an internet host or you
+ can help with the announcements and uploads.
+<li> Packaging the editor. Currently
+ <a href="mailto:ibaldo in adinet.com.uy">Ivan Baldo</a> is working with the
+ Debian packages, perhaps you can do it for other formats or platforms.
+<li> Porting the code to other platforms. Currently the Linux/PPC and Linux/SPARC
+ are usable. The Linux/Alpha version needs some adjustments (is
+ corrupting memory). The FreeBSD target is supported but I don't have much
+ information about it. We are also working to get the editor compiled for
+ Solaris.
+<li> Helping with the internationalization. Even when my language is spanish
+ the editor have documentation and messages only in english, it means I
+ don't even have time to keep up to date the support for my own language.
+<li> Making additions to the code. I really need people writing code. I have
+ a lot of ideas but I can't code all.
+<li> Sending a post card from your city or some of the things I collect
+ (train tickets, cigarette envelopes and boxes, stamps, old money and
+ coins) you'll help to keep my interest in the project.
+<li> Of course I'll accept money from you or any hardware, but I know that's
+ very hard for most people, specially because I'm in Argentina.
+</ul>
+<p>
+</td></tr></table><p>
+
+
+<a name="mail-l"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">Mailing List</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+<br>
+That's a list to talk about the editor, proposed features, bugs, ideas, etc.<br>
+The list is hosted by <a href="http://www.sf.net" target="_top">Source Forge</a>.<br>
+To subscribe please visit:
+<a href="http://lists.sourceforge.net/mailman/listinfo/setedit-users">
+http://lists.sourceforge.net/mailman/listinfo/setedit-users</a>.<br>
+ <br>
+</td></tr></table><p>
+
+
+<a name="gcc3"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">Comparison between gcc 3 and 2</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+<br>
+If you can choose between gcc 2 and 3 to compile the editor you should consider the
+following comparison.<br>
+GCC 3.x seems to be better when optimizing for modern CPUs (like AMD Athlon). But the cost
+is a huge increase in compilation time.<br>
+Debian GNU/Linux v3.1 (Sarge) usually installs gcc 2.95.4 and gcc 3.3.5. That's because
+Linux kernels 2.4.x should be compiled using gcc 2 and kernels from the 2.6.x series with
+gcc 3. I have such a system and I compiled <a href="http://tvision.sourceforge.net/">Turbo Vision</a>
+and the editor using both. I found the following:<p>
+
+<ul>
+ <li> gcc 3.3.5 is much slower compiling C++ code. Mostly because it uses a much more
+ complex standard C++ library. It is much more ISO C++ 1998 compliant. But I think the
+ real reason is that gcc is quite bad handling templates and that's the real reason
+ (ISO C++ 1998 heavily uses templates). I found gcc 3.3.5 can be four times slower than
+ gcc 2.95.4.
+ <li> The generated code (using -O2) runs notably faster on an Athlon XP CPU. It looks like
+ the optimizations in 3.3.5 are much better tuned for modern CPUs. The editor performed
+ about 20% faster when compiled using 3.3.5.
+ <li> The size of the code is bigger for the dynamic library (unstripped) and smaller for
+ the editor itself. The result is quite similar to the size obtained using 2.95.4.
+</ul>
+
+To reduce the compilation time I tried using the SSC option provided by TV. It notably
+reduced the compilation time. The result wasn't as good as using 2.95.4.<br>
+My conclusion is that gcc 3.3.5 can be used for modern CPUs but you must avoid using the
+provided C++ library. Note that not all TV applications can be compiled using SSC.<br>
+Here are the results, note that the values were computed in a way that "more" always
+means "better". <a href="ComparativaGCC.html">Results</a>.<br>
+ <br>
+</td></tr></table><p>
+
+
+<a name="rhide"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">RHIDE</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+<br>
+RHIDE is a full IDE (Integrated Development Environment) using Turbo Vision, SETEdit and
+InfView and adding: make facilities and interface to the debugger (gdb integrated inside).
+You can find more information about RHIDE here:
+<a href="http://www.rhide.com/">http://www.rhide.com/</a>.<p>
+Lamentably precompiled binaries uses really old versions of my tools and aren't available
+for all targets.<p>
+If you want to compile RHIDE with the last TV and SETEdit code you'll have to get the code
+of RHIDE from a special CVS branch of RHIDE called "for_tvision_2". As Source Forge's CVS
+is currently working too slow (hardware problems) I'm generating nightly tarballs for
+this branch: <a href="http://rhide.sf.net/snapshots/snap.html">http://rhide.sf.net/snapshots/snap.html</a>.
+Of course you have to also get <a href="http://tvision.sf.net/">Turbo Vision</a> and
+SETEdit snapshots (see the <a href="#download">download</a> section).<p>
+It worked for my system (Debian GNU/Linux Woody) so I hope it will at least help you to
+get closer to compile in other systems.<p>
+Note 1: I used gdb 5.3 release to create RHIDE binaries. I also used 6.1.<p>
+Note 2: Precompiled binaries for DOS are available in the
+<a href="http://sourceforge.net/project/showfiles.php?group_id=32835&package_id=27741">Source Forge</a> page of the editor.<p>
+Note 3: The current release of the editor (Glaciar P, Moreno I) have debug features for Linux.
+<p>
+</td></tr></table><p>
+
+<i>Copyright &copy; 1999-2004 by Salvador E. Tropea, e-mail: <a href="mailto:set at host users.sf.net">set[at host]users.sf.net</a>.</i><br>
+<p><hr></p>
+
+Some notes:<p>
+
+<a name="djgpp"><b>What's djgpp?</b></a><p>
+Is a port of the GNU tools to the DOS environment. The main purpose is bring
+the power of the free GNU C/C++ compiler called gcc. You can find more about
+it in <a href="http://www.delorie.com" target="_top">http://www.delorie.com</a>.<p>
+
+<a name="tags"><b>What are tags?</b></a><p>
+TAGS files are plain text files containing a list of symbols from your source
+code. For each symbol the file indicates in which file it's located and how to
+find the symbol inside the file. Modern programs also include very important
+information like which type of symbol is defined and if this symbol is part of
+a bigger construct like a class.<br>
+An ilustrated tutorial showing how to use tags in SETEdit is available
+<a href="tags.html">here</a>.<p>
+
+<p><hr><p>
+<P>Visited since May 24, 1999: <a href="http://member.linkexchange.com/cgi-bin/fc/fastcounter-login?1289519" target="_top"><img border="0" src="http://fastcounter.linkexchange.com/fastcounter?1289519+2579045"></a><font face="arial" size="1"><a href="http://fastcounter.linkexchange.com/fc-join" target="_top">(FastCounter by LinkExchange)</a></font><br></p>
+<Font Size=-1>Last update: vie nov 17 10:30:44 ART 2006</Font>
+</body>
+</html>
diff --git a/setedit/www-site/infview.html b/setedit/www-site/infview.html
new file mode 100644
index 0000000..0f94c25
--- /dev/null
+++ b/setedit/www-site/infview.html
@@ -0,0 +1,165 @@
+<html>
+<head>
+ <title>InfView, an info files viewer</title>
+ <meta name="description" content="InfView, an info files viewer, good replacement for info">
+ <meta name="keywords" content="InfView, info, texinfo, viewer, SETEdit, setedit, rhide, editor, linux, DOS, console, tui, djgpp, library, download, SET, Salvador, Eduardo, Tropea">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, set@users.sf.net">
+</head>
+<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">
+
+<p><center>
+<table>
+<tr>
+<td><strong><h1>InfView</h1></strong></td>
+<td align=right><A href="http://sourceforge.net">
+ <IMG valign=center src="http://sourceforge.net/sflogo.php?group_id=32835"
+ width="88" height="31" border="0" alt="SourceForge Logo"></A></td>
+</tr>
+</table>
+</center></p>
+
+I provide a menu because some sections are large and perhaps you are not
+interested in reading all:
+<ul>
+<li> <a href="#intro">Introduction</a>
+<li> <a href="#features">Features</a>
+<li> <a href="#license">License</a>
+<li> <a href="#download">Download</a>
+<li> <a href="#contributing">Contributing</a>
+<li> <a href="readmeinf.html" target="_top">Readme first</a>
+</ul>
+
+<a name="intro"></a>
+InfView is an easy to use info viwer. The command line have the most relevant
+options provided by info and the user interface is much more intuitive. It
+makes InfView a good replacement for the info-stantalone program. The main
+objetive of InfView is to give to the user a friendly and easy to learn tool
+to browse the documentation found in info format. This format is used by the
+FSF for all the major tools and of course is used by djgpp.<p>
+The old info program was designed as a flexible UNIX tool so it have some
+features you won't find in InfView, as an example: InfView doesn't have
+options to write a documentation chapter to the standard output so you can
+capture it and display in other program. InfView was designed as an
+interactive tool instead.<p>
+InfView uses overlapping windows (real windows, not "screens"), fully
+supports mouse, have pull-down menues and pop-up windows, etc. As the name
+says the emphasis is in the visual component.<p>
+Unless graphical implementations the program is relative small and quite
+fast (263Kb installation for the first release, I know about one Win32
+implementation that needs over 5Mb and eats more than 5Mb of memory thanks to
+the run time of some visual script language from Redmond that I won't name
+here).<p>
+I started to develop InfView in 1996 to add help to
+<a href="http://www.rhide.com/" target="_top">RHIDE</a>. It was a
+big step for RHIDE. My next contribution was a text editor. Currently the
+editor is also distributed as an standalone program and of course have InfView
+as help system. I created a standalone InfView because many users asked for
+it. The advantages of an standalone program are:
+
+<ul>
+ <li> Smaller memory requirements.
+ <li> Specialized command line.
+ <li> Specialized menues.
+ <li> Specialized features (example: InfView windows are tileable).
+</ul>
+
+<a name="features"></a>
+The main features of InfView are:
+
+<ul>
+ <li> Free cursor movement with the keyboard arrows, page-up, etc.
+ <li> Mouse support.
+ <li> Highlighted cross references.
+ <li> Hide of the `*Note' and other confusing things of the info format.
+ <li> Previous, Next and Up node support.
+ <li> History support.
+ <li> Incremental search just typing the first letters of the cross reference.
+ <li> The same for the whole nodes list.
+ <li> Support for compressed info files.
+ <li> Search in the current node, the whole file or all the files.
+ <li> Bookmarks.
+ <li> History of the last 40 nodes visited.
+ <li> Dialog to browse the files on disk.
+ <li> info like command line for people already acustomed to info.
+ <li> Many overlapping windows containing different info files can be opened at the same time. Only limited by available memory.
+ <li> and more
+</ul>
+
+<a name="license"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th><Font Color="#FFFFFF">LICENSE</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+InfView is distributed under the <a href="http://www.gnu.org/copyleft/gpl.html" target="_top">GPL</a>
+license. It basically means the code is free and you don't need to pay for it
+and you are free to change it, but any derived work will become GPL too. Most
+of the software available for Linux is distributed under these terms. This
+license protects my rights over the code (I hold the copyright) and protects
+the users ensuring they are free to use the code. If you plan to use parts or
+the whole code of InfView be sure you read the GPL license carefully.<br>
+Note that GPL implies a disclaimer of guaranty, so if you must use it in an
+enterprise where you need to be able to sue software's authors in case of
+direct or indirect problems created by it just forget about InfView. By
+the way, I don't know about even one big company (Microsoft included) that doesn't
+included a disclaim of guaranty in your license.<br>
+Even when you don't need to pay for InfView I accept any kind of help ;-).
+The best way to help me is contributing in one of the ways I mention
+<a href="#help">here</a>.<br>
+</td></tr></table><p>
+
+<a name="download"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">DOWNLOAD<br>
+Important: check <a href="http://sourceforge.net/projects/setedit/">http://sourceforge.net/projects/setedit/</a>
+for the last news and beta releases.</th></tr>
+<tr BGCOLOR="#80A0FF"><th colspan=2>DOS v0.2.8</th><th colspan=2>Linux v0.2.8</th></tr>
+<tr BGCOLOR="#80A0FF">
+<td><Center><a href="http://prdownloads.sourceforge.net/setedit/inf028b.zip">Binaries</a></td>
+<td><Center><a href="http://setedit.sourceforge.net/">Sources</a></td>
+<td><Center><a href="http://prdownloads.sourceforge.net/setedit/infview_0.2.8-0.5.0-1_i386.deb">Debian Woody</a></td>
+<td><Center><a href="http://setedit.sourceforge.net/">Sources</a></td>
+</tr>
+<tr BGCOLOR="#80A0FF">
+<td colspan=4>The sources are the same as the sources for the editor so the
+links points to the editor's page. Get the last snap shot available.<br>
+To compile InfView you'll also need the
+<a href="http://tvision.sf.net/" target="_top">Turbo Vision</a> library.</td></tr>
+</table>
+<p>
+
+<a name="contributing"></a>
+<table width=100% cellspacing=0>
+<tr BGCOLOR="#000080"><th colspan=4><Font Color="#FFFFFF">CONTRIBUTING</th></tr>
+<tr BGCOLOR="#80A0FF"><td>
+There are a lot of ways you can contribute, here are some of them:<p>
+
+<ul>
+<li> Giving useful bug reports, it means providing a good description of the
+ bug and how to reproduce it.
+<li> Writing examples of use or <i>mini-howto</i>s. I'll be glad to include
+ them with InfView.
+<li> Helping with the web pages.
+<li> Helping with the distribution, e.g. if you have an internet host or you
+ can help with the announcements and uploads.
+<li> Packaging InfView.
+<li> Porting the code to other platforms. Currently
+ <a href="mailto:zager@post.comstar.ru">Dim Zegebart</a> is helping with the
+ Alpha/Linux platform.
+<li> Helping with the internationalization. Even when my language is spanish
+ InfView have documentation and messages only in english, it means I
+ don't even have time to keep upto date the support for my own language.
+<li> Making additions to the code.
+<li> Sending a post card from your city or some of the things I collect
+ (train tickets, cigarette envelopes and boxes, stamps, old money and
+ coins) you'll help to keep my interest in the project.
+<li> Of course I'll accept money from you or any hardware, but I know that's
+ very hard for most people, specially because I'm in Argentina.
+</ul>
+</td></tr></table><p>
+
+<i>Copyright &copy; 1999-2003 by Salvador E. Tropea, e-mail: <a href="mailto:set@users.sf.net">set@users.sf.net</a>.</i><br>
+<p><hr><p>
+<Font Size=-1>Last update: Tue Apr 01 17:49:57 (GMT) 2003</Font>
+</body>
+</html>
diff --git a/setedit/www-site/my_file1.html b/setedit/www-site/my_file1.html
new file mode 100644
index 0000000..6851533
--- /dev/null
+++ b/setedit/www-site/my_file1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML><HEAD>
+<Title>/usr/src/my_project/my_file.cc</Title><Meta name="GENERATOR" content="SETEdit v0.5.2">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<link rel=stylesheet type="text/css" href="examples.css">
+</HEAD><p><b class=Pre>#include &lt;stdio.h&gt;<br>
+<br>
+</b><b class=Reserved>int </b><b class=Ident>A_Variable</b><b class=Symbol2>=</b><b class=Integer>1</b><b class=Symbol>;<br>
+<br>
+</b><b class=Reserved>void </b><b class=Ident>That_is_my_function</b><b class=Symbol>() {}<br>
+<br>
+</b><b class=Reserved>int </b><b class=Ident>main</b><b class=Symbol>(</b><b class=Reserved>int </b><b class=Ident>argc</b><b class=Symbol>, </b><b class=Reserved>char </b><b class=Symbol2>*</b><b class=Ident>argv</b><b class=Symbol>[])<br>
+{<br>
+&nbsp;</b><b class=Ident>printf</b><b class=Symbol>(</b><b class=String>"Hello World\n"</b><b class=Symbol>);<br>
+&nbsp;</b><b class=Reserved>return </b><b class=Integer>0</b><b class=Symbol>;<br>
+}<br>
+</b></Body></HTML>
diff --git a/setedit/www-site/my_file2.html b/setedit/www-site/my_file2.html
new file mode 100644
index 0000000..23c3f27
--- /dev/null
+++ b/setedit/www-site/my_file2.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML><HEAD>
+<Title>/usr/src/my_project/my_file.cc</Title><Meta name="GENERATOR" content="SETEdit v0.5.2">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<link rel=stylesheet type="text/css" href="examples.css">
+</HEAD><p><b class=Pre>#include &lt;stdio.h&gt;<br>
+<br>
+</b><b class=Reserved>int </b><b class=Ident>A_Variable</b><b class=Symbol2>=</b><b class=Integer>1</b><b class=Symbol>;<br>
+<br>
+</b><b class=Reserved>void </b><b class=Ident>That_is_my_function</b><b class=Symbol>()<br>
+{<br>
+}<br>
+<br>
+</b><b class=Reserved>void </b><b class=Ident>That_is_not_my_function</b><b class=Symbol>()<br>
+{<br>
+}<br>
+<br>
+</b><b class=Reserved>int </b><b class=Ident>main</b><b class=Symbol>(</b><b class=Reserved>int </b><b class=Ident>argc</b><b class=Symbol>, </b><b class=Reserved>char </b><b class=Symbol2>*</b><b class=Ident>argv</b><b class=Symbol>[])<br>
+{<br>
+&nbsp;</b><b class=Ident>printf</b><b class=Symbol>(</b><b class=String>"Hello World\n"</b><b class=Symbol>);<br>
+&nbsp;</b><b class=Reserved>return </b><b class=Integer>0</b><b class=Symbol>;<br>
+}<br>
+</b></Body></HTML>
diff --git a/setedit/www-site/my_file3.html b/setedit/www-site/my_file3.html
new file mode 100644
index 0000000..1836691
--- /dev/null
+++ b/setedit/www-site/my_file3.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML><HEAD>
+<Title>my_file.cc</Title><Meta name="GENERATOR" content="SETEdit v0.5.2">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<link rel=stylesheet type="text/css" href="examples.css">
+</HEAD><p><b class=Pre>#include &lt;stdio.h&gt;<br>
+<br>
+</b><b class=Reserved>class </b><b class=Ident>Class_Parent<br>
+</b><b class=Symbol>{<br>
+</b><b class=Reserved>public</b><b class=Symbol2>:<br>
+&nbsp;</b><b class=Ident>Class_Parent</b><b class=Symbol>() {};<br>
+<br>
+&nbsp;</b><b class=Reserved>int </b><b class=Ident>data_member_1</b><b class=Symbol>;<br>
+};<br>
+<br>
+</b><b class=Reserved>class </b><b class=Ident>Class_Child </b><b class=Symbol2>: </b><b class=Reserved>public </b><b class=Ident>Class_Parent<br>
+</b><b class=Symbol>{<br>
+</b><b class=Reserved>public</b><b class=Symbol2>:<br>
+&nbsp;</b><b class=Ident>Class_Child</b><b class=Symbol>() {};<br>
+<br>
+&nbsp;</b><b class=Reserved>int </b><b class=Ident>data_member_2</b><b class=Symbol>;<br>
+};<br>
+<br>
+</b><b class=Reserved>int </b><b class=Ident>main</b><b class=Symbol>(</b><b class=Reserved>int </b><b class=Ident>argc</b><b class=Symbol>, </b><b class=Reserved>char </b><b class=Symbol2>*</b><b class=Ident>argv</b><b class=Symbol>[])<br>
+{<br>
+&nbsp;</b><b class=Ident>printf</b><b class=Symbol>(</b><b class=String>"Hello World\n"</b><b class=Symbol>);<br>
+&nbsp;</b><b class=Reserved>return </b><b class=Integer>0</b><b class=Symbol>;<br>
+}<br>
+</b></Body></HTML>
diff --git a/setedit/www-site/pmoreno.html b/setedit/www-site/pmoreno.html
new file mode 100644
index 0000000..e890471
--- /dev/null
+++ b/setedit/www-site/pmoreno.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+ <title>SETEDIT, a friendly text editor - Glaciar Perito Moreno name</title>
+ <meta name="description" content="SETEdit a friendly text editor for DOS, Win32, Linux and other UNIXes">
+ <meta name="keywords" content="SETEdit, setedit, rhide, editor, linux, DOS, console, tui, djgpp, library, download, SET, Salvador, Eduardo, Tropea, PPC, SPARC, Alpha, FreeBSD, Solaris">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, salvador[at server]inti.gov.ar">
+</head>
+<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">
+
+<p><center>
+<table>
+<tr>
+<td><strong><h1>Glaciar Perito Moreno</h1></strong></td>
+<td align=right><A href="http://sourceforge.net">
+ <IMG valign=center src="http://sourceforge.net/sflogo.php?group_id=32835"
+ width="88" height="31" border="0" alt="SourceForge Logo"></A></td>
+</tr>
+</table>
+</center></p>
+
+For those who dont know what is "Glaciar Perito Moreno" (most of you I guess ;-): Thats
+a huge glacier located in Argentina (Patagonia region).<br>
+<p>
+<center>
+<img src="pmoreno3.jpg" width=550 height=357>
+<img src="pmoreno4.jpg" width=550 height=360>
+</center>
+
+</body>
+</html> \ No newline at end of file
diff --git a/setedit/www-site/readme.html b/setedit/www-site/readme.html
new file mode 100644
index 0000000..afe700d
--- /dev/null
+++ b/setedit/www-site/readme.html
@@ -0,0 +1,578 @@
+<HTML><Title>readme.1st for setedit</Title><Body><Pre>
+
+ SET's editor "Glaciar P.Moreno I" release
+ v0.5.4 rev. 1130
+ by SET
+
+ That's the official distribution of SET's editor v0.5.4
+ The editor is Copyrighted by Salvador Eduardo Tropea &lt;set@users.sf.net&gt;.
+(c) 1996-2004 and distributed under the GPL license.
+ It's free and you don't need to pay for it. Any kind of donations are
+accepted ;-).
+
+INDEX:
+
+0. IMPORTANT (modifications and fixes in this release and the previous)
+1. REQUIREMENTS
+2. INSTALL
+3. MORE INFO
+4. MP3 player
+5. EXAMPLES (SDG, and others)
+6. LEGAL ISSUE
+7. KEYBOARD PREFERENCES
+8. KEYBOARD EXTENDER [DOS version only]
+9. KEYBOARD FEATURES UNDER X [Linux version only]
+10. DOWNLOAD
+11. MAILING LIST
+12. DONATIONS
+13. THANKS TO
+
+
+
+0. IMPORTANT:
+
+ Starting with "Glaciar Perito Moreno I" release the editor can be used as
+a frontend for GDB on Linux systems. It means you can use SETEdit as
+debugger.
+ Starting with "Iguazu II" release the editor changed the mechanism used to
+select a window. In previous versions the Alt+window_number was hardcoded in
+Turbo Vision library. Now this is no longer handled by TV. It have some
+advantages: you can change the key assignment and you can bind keys to select
+as many windows as you want. But it also means you have to have some binding
+in your menu files, if you have a custom menu file please consult the one
+shipped with the editor and copy the new entries in the Window menu.
+ Changes in v0.5.4 (for more details read the change.log file):
+[taking last stable release (0.5.2) as reference]
+[66 new things and 40 fixes]
+
+New [66 things]:
+
++ Debug [12] --&gt; NEW Functionality for *Linux* &lt;--
+
+* Dialogs to configure the debug mode (local, remote and running process), the
+command line options for the program, gdb binary, xterm binary, messages
+displayed, etc.
+* Breakpoints, simple ones and advanced options including conditional
+breakpoints, breakpoints at functions, ignore count, etc.
+* Watchpoints, they are data breakpoints.
+* Options to run, continue, step over, trace into, run upto return, etc.
+* Options to stop and kill the program.
+* Thread selection.
+* Evaluate and modify data.
+* Data Window and Satck to browse the memory (very complete and with its own
+menu).
+* Data Watches, like then ones in RHIDE and also with scope.
+* Data Inspectors, used to analyze complex data structures.
+* Disassembler Window, including syntax highlight and allowing to modify the
+registers.
+* Calling stack, with functionality to browse the call chain.
+
++ Various [15]
+
+* Alternative project sorting mode.
+* Commands to select any window, now Alt+Key is no longer hardcoded.
+* Sections in the docs to help finding what you need.
+* When asking for word completion if the word at the left looks like Class::
+then the editor looks for the class and offers the members.
+* Enhacements to the "Paste Emacs Mode" and the code to search Emacs
+variables.
+* Now if you don't specify any path to "search files under cursor" the editor
+tries to automagically fills this list using the output of cpp.
+* If the editor fails to find the file under cursor now it also looks for it
+in the project and the current directory.
+* Some rudimentary $(VARIABLE) expansion to the "File under cursor" files
+list.
+* A button to recompute window numbers in the list of windows.
+* "File open" dialogs remmembers its size and position.
+* Non interactive versions of the cmcExpandAllTabs and cmcCompactBuffer
+commands to be used from sLisp.
+* Two new commands: cmeGPushCursorPos and cmeGPopCursorPos. They are "global
+push/pop cursor pos". So they also remmember the file.
+* Options to zoom the editor windows when inserted in the desktop.
+* An option to regenerate the central tags file. Used to workaround ctags bug.
+* Modified behavior of the paste operation in input lines: Now the text is
+pasted without destroying the previous value (unless it is selected).
+
++ Menu files [4]
+
+* Context sensitive menues. Also extended the .smn file language to create
+such a thing. Currently used only for the data window and the help.
+* The conditionals in menu files can use the TV driver, CPU, OS, etc. for
+conditions.
+* More variables to check: MP3, PCRE, BZIP2, MIXER and UNIX.
+* $define and $undef and its expansion.
+
++ Compilation [2]
+
+* The posibility to override the "install" command in makefiles.
+* Unified compilation mechanism for BC++.
+
++ sLisp [9]
+
+* FindString, FindAgain, ReplaceString and ReplaceAgain for searches.
+* SelectWindowNumber used to change the focused window.
+* GetCurWindowNumber and GetMaxWindowNumber.
+* You can bind small portions of sLisp code to keys and menu entries.
+* KeyBindings and BindKey commands. With them you can change key bindings
+from sLisp.
+* prex to perform Perl regular expressions searches.
+* GetSystemInfo to know the current OS, TV driver, CPU, etc.
+* More macros examples.
+* Now you can send cme* commands.
+
++ Syntax highlight and pmacros [8]
+
+* Flat Assembler syntax.
+* Ruby syntax.
+* SPARC assembler syntax.
+* WML syntax and pmacros.
+* Errors parser for Perl.
+* C,H and CPP as valid C extensions as valid for C/C++.
+* HTML extensions as valid for HTML.
+* vbe and vst as VHDL extensions.
+
++ Cosmetic [16]
+
+* Project windows are "closed" (hided) when pressing ESC.
+* Windows are opened "zoomed" when the project window isn't visible.
+* When automatically opening a project item now its opened using the relative
+path.
+* Select the closest word when using double click and not the next.
+* History to the "arbitrary indent" and "run command" input lines.
+* To lock the screen while doing a search & replace operation to avoid
+"flashing" when doing a lot of S&R operations.
+* Modified: "Do not purge spaces" option to be "Keep trailing whitespace"
+that's more descriptive.
+* A new color scheme called "Classic Borland"
+* A new color scheme called "Midnight Commander"
+* If the Ctrl+Enter fails to find the file under cursor now that's informed
+in the "status line" of the current editor.
+* Most lists (like functions list) now centers the focused item when a match
+is selected.
+* OS/OS flavor,CPU,Compiler/Compiler flavor and Driver to the about box.
+* Configuration options to disable the calculator and calendar.
+* Now the meassure command reports the result in the status line.
+* A beep when "Run a program" finishes. Option to disable.
+* Busy indicator while we load the tags from disk.
+
+
+Fixed [40 things]:
+
++ Fatal [4]
+
+* The "Jump" button in the main window of the class browser.
+* Undo count for the first undo wasn't initialized. Unknown consequence.
+* Corrupted MP3 files could produce a crash.
+* Abort when doing word completion and the starting word was "bigger" than
+the last tag in the list.
+
++ Not fatal [17]
+
+* HTML export: missing body tag.
+* Errors in the conditionals parser for menu files.
+* Undo error when a character replaced a tab (overwrite enabled) and the
+cursor was inside the tab (not at the beggining).
+* Wrong match pair when the cursor was in the middle of a tab and the next
+character matched a pair (highlight in the middle of the tab).
+* No match pair after deleting some text and the cursor goes to a symbol.
+* When searching outside comments and the match was found in the first column
+of a line after a comment it was ignored.
+* When starting a project using a different window size the project window
+could get wrong size and even become outside the screen.
+* When aborting an overwrite (in save as) the name of the window was changed.
+* When pasting using the OS clipboard and the cursor was moved to the end of
+the selection it could go out of screen which is quite annoying.
+* When copying something from the calculator and the paste wasn't enabled
+before entering the calculator then you needed to at least move the cursor
+before you could paste.
+* Use of unitialized undo counter in some rectangular selection operations.
+* The heuristic C/C++ parser to support list of exceptions (function
+throw(...) {body}).
+* Some details in the heuristic C++ functions searcher. They address problems
+with the const and throw() attributes.
+* Various memory leaks.
+* "New" buffers shouldn't be added to the list of closed windows when closed.
+It generated a read out of bounds and a write of unitialized data to disk.
+* The menu files uses nested preprocessor directives but it wasn't supported.
+* cmcCutClipWin command not dis/enabled when selecting text.
+
++ Compilation [13]
+
+* Cygwin: Collision between strndup and calculator parser.
+* Some gcc versions needs explicit use of libstdc++ to link C++ and
+internac/getcolors didn't have it.
+* Removed two comments containing non-ASCII chars.
+* Various gcc 3.x compilation issues (including gcc 3.4.1 support).
+* Problems with newer versions of makeinfo.
+* The memcpy usage to be more portable. It worked for all supported targets,
+but now should also work for unsupported targets. Same for malloc/new/new[]
+v.s. free/delete/delete[] calls.
+* Missing va_end and abuse of va_list type. It gave problems for Linux PPC
+targets.
+* Use of "g++" in favor of "gcc -lstdc++".
+* strstr and strchr are declared different in C++ standard (compared to C
+standard). Needed to avoid BC++ compilation problems.
+* Various MSVC compilation issues.
+* --cxx-flags flag was reported as --cpp-flags in the help. Now both are
+valid.
+* Cygwin can execute the "make install" target, but it installed binaries
+without .exe extension.
+* Detection of pcre header for systems where the header is in pcre/pcre.h.
+Red Hat is an example.
+
++ Linux [3]
+
+* Code page problems when mixing console use and remote XTerm use.
+* RPM prereq for /sbin/install-info.
+* Problems to create the rpms using Fedora Core 2.
+
++ Cosmetic [3]
+
+* Some drawing variables not initialized. Could make the row/col cursor
+appear until a new redraw.
+* Now the cmc*Win (Copy,Cut,Paste) commands are called cmc*OS to reflect
+their real use. The old names remains as aliases.
+* The list for word completion had a wrong vertical size when we had repeated
+tags in the list to choose. Only one was visible but the size was computed
+counting the repetitions.
+
+
+ For information about older releases and more read the change.log file.
+
+Note for DOS users:
+ %DJDIR% == The content of the enviroment variable %DJDIR%, that's the
+ place where you installed djgpp. You don't need to set this variable,
+ setting DJGPP is enough.
+
+
+
+1. REQUIREMENTS:
+
+* PC 386 compatible or superior computer.
+* 2 Mb of memory or more.
+* 2.4 Mb of free disk during installation and about 1.5 Mb once installed.
+* DOS version 5.0 or posterior or any compatible OS (Win '9x, Win 3.1, OS/2,
+MS-DOS, etc.).
+Note: A native windows version is available but is just for testing.
+or
+* Linux with ELF support.
+or
+* FreeBSD, QNX and Solaris are supported but you'll need to compile from
+sources.
+* A VGA card.
+* DJGPP users normally have it.
+
+
+
+2. INSTALL:
+
+ *Important* To use the powered grep you need the grep program installed in
+your system. To use the man page viewer you need the man program installed in
+your system. Both are found in all Linux systems but not in all DOS systems.
+ Starting with v0.4.26 the DOS version of the editor is distributed with an
+installer, if you have it just run install.exe and follow the instructions.
+If you only have a .zip or .tar.gz file that contains a lot of files continue
+reading this chapter.
+ The following cases are explained:
+
+A) Installing in DOS for djgpp users.
+B) Installing in DOS for non-djgpp users.
+C) Installing in Linux.
+
+A) Installing in DOS for djgpp users:
+1) Uncompress the file over your djgpp installation in the same way you did
+ with the rest of packages.
+2) If you installed the editor preserving the directory structure you
+ won't need to do it so the following is usually optional:
+ Add the following to your autoexec.bat:
+
+ SET SET_FILES=c:/djgpp/share/setedit
+
+ Replacing c:/djgpp with the place where you installed djgpp.
+ IMPORTANT!! Windows NT (4.0, 2k, XP, etc.) is case sensitive for
+ environment variables, avoid defining things like Set_Files.
+
+B) Installing in DOS for non-djgpp users:
+ Attention: If you don't use the installer you must have some basic DOS
+ knowledge, including: how to set an environment variable, modify your
+ PATH and what is autoexec.bat. If you don't know it use the installer or
+ ask a friend.
+1) Uncompress the file in any directory you like preserving the directory
+ structure. Examples:
+
+ unzip edi0426b.zip
+ or
+ pkunzip -d edi0426b.zip
+ or
+ using WinZip (be careful to preserve the directories)
+
+ For the other sections I'll give examples assuming you uncompressed the
+ files in c:/setedit.
+2) If you installed the editor preserving the directory structure you
+ won't need to do it so the following is usually optional:
+ Add the following to your autoexec.bat:
+
+ SET SET_FILES=c:/setedit/share/setedit
+
+ IMPORTANT!! Windows NT (4.0, 2k, XP, etc.) is case sensitive for
+ environment variables, avoid defining things like Set_Files.
+
+ Replacing c:/setedit by the place where you uncompressed the editor.
+3) Add the c:\setedit\bin (don't forget to replace c:/setedit by the name
+ you used in 1) to the PATH in autoexec.bat.
+ Example:
+
+ PATH=.... &lt;= Line already existent in your autoexec.bat
+ SET PATH=c:\setedit\bin;%PATH%
+
+C) Installing in Linux:
+1) Uncompress the files in /tmp and run ./INSTALL_LINUX. If you want to setup
+ the destination directory read the INSTALL_LINUX script. You'll need the
+ make tool to run it, that's usually installed.
+ Also: the script contains useful information about access rights needed
+ to run the editor.
+2) If you installed the editor in /usr or /usr/local the following is
+ optional:
+
+ Define the following environment variable (bash syntax):
+
+ export SET_FILES="/usr/share/setedit"
+
+ Replacing /usr by the prefix you used, example: prefix /opt then the
+ editor is in /opt/bin and you must define:
+
+ export SET_FILES="/opt/share/setedit"
+3) Be sure the directory where setedit binary file is located is included in
+ your PATH environment variable.
+
+Note for bash users: the file where (2) and (3) should be defined is normally
+called .bash_profile or .bashrc in your home directory.
+
+
+
+3. MORE INFO:
+
+ From v0.4.0 the editor doesn't need external files to configure the
+keyboard so forget about the old xxx.txt files used in RHIDE 1.4.
+ You will need to customize the colors from Various|Options|Colors, the ones
+used by default aren't pretty.
+ To save the default colors and settings go to the %SET_FILES% (examples:
+c:/setedit/share/setedit, c:/djgpp/share/setedir, /usr/share/setedit)
+directory, start the editor and set all the options (colors and settings
+with Alt-G). Just exit and the editor will save a file called tcedit.dst.
+Each time you start the editor in a directory where there isn't any *.dst
+file the editor will load this default. Linux users that doesn't have write
+access to the /usr tree can create a default in their home directory. In
+this case the file should be created in ~/.setedit directory.
+ Users that want to have only one tcedit.dst file, and not one in each
+directory, must configure it in Tool&Ops|Options|Editor General.
+ If you are annoyed with the back-up files and .dst files created by the
+editor in all the places just exit with Alt+Q and the editor will delete
+these files. Also see the options available in Tool&Ops|Options|Editor
+General.
+
+
+
+4. MP3: [Only in the DOS, Linux and Solaris versions]
+
+ Linux users doesn't need to configure any special thing.
+ DOS users:
+ The editor supports the Allegro mixing routines with 16 bits of resolution
+(I contributed it to the Allegro project because I needed it for the editor).
+ If you want to enable it create a file called allegro.cfg with the following
+contents:
+
+-------- cut here --------
+[sound]
+sb_freq = 45454
+quality = 1
+-------- cut here --------
+
+ Put the file in the same directory where the editor is located.
+ It will enable the 16 bits routines and mix with the maximun mixing
+frequency.
+ Enable it only if you are a fanatic because it will eat your CPU ;-).
+
+
+
+5. EXAMPLES:
+
+ SDG Example:
+
+ To test the SDG tool you can uncompress the example.zip file in an empty
+directory. Then call the editor with e and follow these steps:
+
+1) Select the menu Project|Open and type test and enter. You'll get a new
+project.
+2) Press Insert and select the three .cc files pressing enter in each one,
+the press ESC. Now you have the project filled.
+3) Select Various|Options|SDG Options, and take a look to the selected
+options, if you have SET_FILES right all must be Ok, so just press ENTER.
+4) Press F9. The message window will appear with some messages.
+5) Open the file out.html, it was generated when you pressed F9 (look the
+syntax highlight).
+
+ Load the file with any web browser and look the results. If you like it
+for your code read the sdg.inf file (from the editor, if you don't know how
+press F1 and then Ctrl-H to learn more about the help system).
+
+ sLisp macros examples:
+
+ In addition to the macros included in macros.slp (you can access these
+macros from the Macros|Choose menu option) I included another, more simple,
+examples in a file called examples.slp. It is located in the same directory
+as the rest of the configuration files (/usr/share/setedit,
+c:/djgpp/share/setedit, etc.).
+
+ Turbo Pascal 7, also for other non-gnu compilers:
+
+ Andreas Leidner &lt;leidner@gmx.net&gt; contributed some wrapper to call TPC7
+from the editor and convert the errors into the FSF format so you can jump to
+the function that originated the error from inside of the editor. This
+examples is included in the directory where other .zip files are located
+(contrib/setedit.bin or texts) and is called calltpc7.zip.
+
+
+
+6. LEGAL ISSUE:
+
+ The editor is free software. It may be used or distributed in any manner
+you wish, as long as you do not violate the GPL license. You can't remove
+any copyrigth included in the editor and you can't distribute it without any
+of the original files. You will also distribute the sources if you distribute
+the binaries. The GPL license is included in the package so read it before
+distributing the editor.
+
+ The editor comes with ABSOLUTELY NO WARRANTY; excluding any and all implied
+warranties, including warranties of merchantability and fitness for a
+particular purpose. There is no warranty or representation, either express
+or implied, with respect to this program, its quality, performance,
+merchantability, or fitness for a particular purpose. The entire risk
+of using this program is with you. There will be no liability for special,
+incidental, or consequential damages arising out of or resulting from the use
+or modification of this program.
+
+
+
+7. KEYBOARD PREFERENCES
+
+ The keyboard is fully configurable from the Tool&Ops|Options|Keyboard|Key
+assignment menu option. But this configures the keys used only by the editor
+windows. The menu keys are defined in a text file with the .smn extension.
+The file loaded by the editor for this purpose is called menubind.smn. An
+example of how you can alter it to change some stuff is provided and called
+redmond.smn, I think you can guess what's the effect of this menu
+configuration ;-).
+ If you used the installer one of the options offered was about changing
+redmond.smn by menubind.smn.
+
+
+
+8. KEYBOARD EXTENDER [DOS version only]
+
+ In the contrib/setedit directory you'll find a small program called kextend
+that's a very simple TSR (only needs 432 bytes of memory in my system) to
+extend the BIOS functionallity.
+
+
+
+9. KEYBOARD FEATURES UNDER X [Linux/UNIX version only]
+
+ Currently the editor runs as a native X11 application. It means the
+keyboard is fully supported, even the most bizarre key combinations works.
+ Note that some Window Managers reserves some key combinations that are used
+by the editor. I recommend Enlightenment as W.M. it uses complex keyboard
+combinations and is also configurable so you can change them to avoid
+interference.
+ The support for XTerm and Eterm is also very good. I recommend using XTerm
+from XFree86 4.x project. So I recommend using it for remote conections,
+you'll get much better results making telnet to a remote machine using XTerm
+than using the Linux console. If you want to get the best results download
+the Turbo Vision sources (http://tvision.sf.net) and look the examples found
+in the examples directory, they show how to configure XTerm and Eterm to get
+even better results.
+
+
+
+10. DOWNLOAD:
+
+ All the OSs:
+ Stable and beta releases, mailing list, cvs, etc.:
+ http://setedit.sourceforge.net/
+
+ DOS: (only stable releases)
+ Any Simtelnet mirror, example:
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/edi*.zip
+
+ Linux:
+ The Linux tarballs can be found in Source Forge.
+
+ Debian GNU/Linux: (only stable releases)
+ A repository is maintained by Ivan in Source Forge.
+ To access the repository, just add the following line to your
+/etc/apt/sources.list:
+
+deb http://setedit.sourceforge.net/debian woody main
+
+ That's for the Woody version of Debian, you should substitute "woody" by the
+name of your distribution or by the synonym "stable".
+
+ Note that Ivan will upload stable editor releases. For betas look in the
+Source Forge pages.
+
+
+
+11. MAILING LIST
+
+ To subscribe visit:
+ http://lists.sourceforge.net/mailman/listinfo/setedit-users
+ I moved the old list at topica to Source Forge.
+
+
+
+12. DONATIONS:
+
+ If you really like the editor and/or the SET's Documentation Generator
+included on it you can send me anything as feedback.
+ If you want to send money I'll be happy, but if you don't have it and
+want to show your gratitude you can send me a postal card from your city
+or some of the things I collect (train tickets, cigarette envelopes and
+boxes, stamps, old money and coins).
+ For more information about how to contact me press F1 in the editor, select
+"Introduction" and then select "About the author".
+
+
+
+13. THANKS TO (random order):
+
+ Ivan Baldo: My Debian packager and friend.
+ Molnar Laszlo: He reported a lot of the fixed bugs and sugested a lot of
+things that I added in the first releases of the 0.4.x serie.
+ Grzegorz Adam Hankiewicz: Another tester and source of bug reports and
+good ideas to add to the editor.
+ Jos Angel Sanchez Caso: For contributing a lot of code to make TV
+working in other UNIX platforms, not just Linux. I didn't yet incorporated
+all the things he sent me.
+ Vadim Belodorov: For contributing the first port of TV to Win32.
+ Anatoli Soltan: For porting to Win32 using BC++.
+ Alexander Bokovoy: For the information on the russian code pages.
+ Marek Habersack & Martijn Versteegh: For sugestions about the mode that
+doesn't create .dst files in all the dirs.
+ Robert Hoehne: For starting RHIDE project and porting TV to djgpp, it
+made me start this project.
+ The FSF and GNU people for such a good tools.
+ DJ Delorie and colaborators for porting it to DOS.
+ Shawn Hargreaves: For Allegro, the best gaming library. I use the sound
+engine from Allegro.
+ Tomislav Uzelac: For AMP the MP3 engine.
+ Ove Kaaven: For LibAmp, an adaptation of AMP to Allegro.
+ Julian R. Seward: For the bzip2 library.
+ Jean-loup Gailly and Mark Adler: For the zlib.
+ Bjorn Reese: For a lot of ideas about the stack debugger for UNIX.
+ The University of Cambridge: For the Perl Regular expressions package.
+ The University of California, Berkeley and its contributors: after all I
+used your malloc upto v0.4.23, and perhaps I still using some libc function
+from Berkeley.
+
+SET
+</Pre></Body></HTML> \ No newline at end of file
diff --git a/setedit/www-site/readmeinf.html b/setedit/www-site/readmeinf.html
new file mode 100644
index 0000000..0b271bd
--- /dev/null
+++ b/setedit/www-site/readmeinf.html
@@ -0,0 +1,195 @@
+<HTML><Title>readme.1st for InfView</Title><Body><Pre>
+
+ InfView v0.2.8
+ by SET
+
+ That's the official distribution of InfView v0.2.8
+ The info viewer is Copyrighted by Salvador Eduardo Tropea. (c) 1996-2002
+and distributed under the GPL license.
+ The info viewer is free and you don't need to pay for it. Any kind of
+donations are accepted ;-).
+
+INDEX:
+
+1. INTRODUCTION
+2. IMPORTANT (modifications and fixes in this release and the previous)
+3. REQUIREMENTS
+4. INSTALL
+5. LEGAL ISSUE
+7. DOWNLOAD
+8. MAILING LIST
+9. DONATIONS
+
+
+
+1. INTRODUCTION
+
+ InfView is a good replacement for the info-stantalone program. The main
+objetive of InfView is to give to the user a friendly and easy to learn tool
+to browse the documentation found in info format. This format is used by the
+FSF for all the major tools and of course is used by djgpp.
+ The old info program was designed as a flexible UNIX tool so it have some
+features you won't find in InfView, as an example: InfView doesn't have
+options to write a documentation chapter to the standard output so you can
+capture it and display in other program. InfView was designed as an
+interactive tool instead.
+ InfView uses overlapping windows (real windows, not "screens"), fully
+supports mouse, have pull-down menues and pop-up windows, etc. As the name
+says the emphasis is in the visual component.
+ Unless graphical implementations the program is relative small and quite
+fast (263Kb installation for the first release, I know about one Win32
+implementation that needs over 5Mb and eats more than 5Mb of memory thanks to
+the run time of some visual script language from Redmond that I won't name
+here).
+ The main features of InfView are:
+
+ * Free cursor movement with the keyboard arrows, page-up, etc.
+ * Mouse support.
+ * Highlighted cross references.
+ * Hide of the `*Note' and other confusing things of the info format.
+ * Previous, Next and Up node support.
+ * History support.
+ * Incremental search just typing the first letters of the cross
+ reference.
+ * The same for the whole nodes list.
+ * Support for compressed info files.
+ * Search in the current node, the whole file or all the files.
+ * Bookmarks.
+ * History of the last 40 nodes visited.
+ * Dialog to browse the files on disk.
+ * and more
+
+
+
+2. IMPORTANT:
+
+ If you are a user of SETEdit you'll find this distribution very familiar
+and in fact follows the same gidelines used in the editor's distribution.
+ Changes since 0.2.6 release:
+
+Additions:
+ The last important addition was the man pages viewer.
+ Now is possible to use File|Open Infview if no window is already opened.
+ Added a configuration dialog to set the code page used by the OS screen.
+ Internationalization, currently only spanish is fully soported.
+
+Fixes:
+ Now all options not available when no window is opened are grayed.
+ The "Shell" menu option wasn't functional.
+
+
+3. REQUIREMENTS:
+
+* PC 386 compatible or superior computer.
+* 2 Mb of memory or more.
+* 2.4 Mb of free disk during installation and about 1.5 Mb once installed.
+* DOS version 5.0 or posterior or any compatible OS (Win '95, Win 3.1, OS/2,
+MS-DOS, etc.). The NT platform isn't fully supported, I don't have NT, if you
+need support for NT send me a licensed copy of NT ;-). I did my best to
+support it, but as I don't have one at home I can't do more.
+* Linux with ELF support for the Linux version. For console use you need gpm
+1.13, newer versions are incompatible.
+* A VGA card.
+* DJGPP users normally have it.
+
+
+
+4. INSTALL:
+
+A) Installing in DOS for djgpp users:
+ Uncompress the file over your djgpp installation in the same way you did
+ with the rest of packages.
+
+C) Installing in Linux:
+1) Uncompress the files in /tmp and run ./INSTALL_LINUX. If you want to setup
+ the destination directory read the INSTALL_LINUX script.
+ Also: the script contains useful information about access rights needed
+ to run infview.
+2) Be sure the directory where infview's binary file is located is included
+ in your PATH environment variable.
+
+
+
+5. LEGAL ISSUE:
+
+ InfView is free software. It may be used or distributed in any manner
+you wish, as long as you do not violate the GPL license. You can't remove
+any copyrigth included in the files and you can't distribute it without any
+of the original files. You will also distribute the sources if you distribute
+the binaries. The GPL license is included in the package so read it before
+distributing infview.
+
+ InfView comes with ABSOLUTELY NO WARRANTY; excluding any and all implied
+warranties, including warranties of merchantability and fitness for a
+particular purpose. There is no warranty or representation, either express
+or implied, with respect to this program, its quality, performance,
+merchantability, or fitness for a particular purpose. The entire risk
+of using this program is with you. There will be no liability for special,
+incidental, or consequential damages arising out of or resulting from the use
+or modification of this program.
+
+
+
+6. WHERE ARE THE SOURCES?
+
+ Even when I'm distributing the standalone InfView I don't the time,
+bandwidth, motivation, etc. to distribute yet another huge package of
+sources. For this reason the sources are only available in the editor's
+package (SETEdit). So download the editor's source. 90% of the code is shared
+with the editor.
+
+
+
+7. DOWNLOAD:
+
+ All the OSs:
+ Stable and beta releases, mailing list, cvs, etc.:
+ http://setedit.sourceforge.net/
+
+ DOS: (only stable releases)
+ Any Simtelnet mirror, example:
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/inf*.zip
+
+ Linux:
+ The Linux tarballs can be found in Source Forge.
+
+ Debian GNU/Linux: (only stable releases)
+ An experimental repository is maintained by Ivan in Source Forge.
+ To access the repository, just add the following line to your
+/etc/apt/sources.list:
+
+deb http://setedit.sourceforge.net/debian unstable main
+
+ That's for unstable branch of Debian (currently Sid) for the stable branch
+use:
+
+deb http://setedit.sourceforge.net/debian stable main
+
+ Note that Ivan will upload stable editor releases. For betas look in the
+Source Forge pages.
+
+
+
+8. MAILING LIST
+
+ The editor's list is more than suitable to discuse things related to the
+InfView program because it is part of the editor:
+ To subscribe visit:
+ http://lists.sourceforge.net/mailman/listinfo/setedit-users
+ I moved the old list at topica to Source Forge.
+
+
+
+9. DONATIONS:
+
+ If you really like the info viewer you can send me anything as feedback.
+ If you want to send money I'll be happy, but if you don't have it and
+want to show your gratitude you can send me a postal card from your city
+or some of the things I collect (train tickets, cigarette envelopes and
+boxes, stamps, old money and coins).
+ For more information about how to contact me see the select "Introduction"
+chapter and then select "About the author" in the help on help.
+
+
+SET
+</Pre></Body></HTML> \ No newline at end of file
diff --git a/setedit/www-site/tag_imgs/a_project.png b/setedit/www-site/tag_imgs/a_project.png
new file mode 100644
index 0000000..84f2685
--- /dev/null
+++ b/setedit/www-site/tag_imgs/a_project.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/advice_tags.png b/setedit/www-site/tag_imgs/advice_tags.png
new file mode 100644
index 0000000..530a92b
--- /dev/null
+++ b/setedit/www-site/tag_imgs/advice_tags.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/class_child1.png b/setedit/www-site/tag_imgs/class_child1.png
new file mode 100644
index 0000000..8465c07
--- /dev/null
+++ b/setedit/www-site/tag_imgs/class_child1.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/class_list.png b/setedit/www-site/tag_imgs/class_list.png
new file mode 100644
index 0000000..a17f1a6
--- /dev/null
+++ b/setedit/www-site/tag_imgs/class_list.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/d_tag_options.png b/setedit/www-site/tag_imgs/d_tag_options.png
new file mode 100644
index 0000000..c92e9bc
--- /dev/null
+++ b/setedit/www-site/tag_imgs/d_tag_options.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/generate_tags.png b/setedit/www-site/tag_imgs/generate_tags.png
new file mode 100644
index 0000000..abdf2a0
--- /dev/null
+++ b/setedit/www-site/tag_imgs/generate_tags.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/jump_symbol.png b/setedit/www-site/tag_imgs/jump_symbol.png
new file mode 100644
index 0000000..11ea96a
--- /dev/null
+++ b/setedit/www-site/tag_imgs/jump_symbol.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/name_project.png b/setedit/www-site/tag_imgs/name_project.png
new file mode 100644
index 0000000..8d5d4e1
--- /dev/null
+++ b/setedit/www-site/tag_imgs/name_project.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/project_open.png b/setedit/www-site/tag_imgs/project_open.png
new file mode 100644
index 0000000..3025271
--- /dev/null
+++ b/setedit/www-site/tag_imgs/project_open.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/sorted.png b/setedit/www-site/tag_imgs/sorted.png
new file mode 100644
index 0000000..cc3f749
--- /dev/null
+++ b/setedit/www-site/tag_imgs/sorted.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/symbols_example.png b/setedit/www-site/tag_imgs/symbols_example.png
new file mode 100644
index 0000000..69f2db3
--- /dev/null
+++ b/setedit/www-site/tag_imgs/symbols_example.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/tag_options.png b/setedit/www-site/tag_imgs/tag_options.png
new file mode 100644
index 0000000..ac54c3a
--- /dev/null
+++ b/setedit/www-site/tag_imgs/tag_options.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/this_and_parents.png b/setedit/www-site/tag_imgs/this_and_parents.png
new file mode 100644
index 0000000..0be15f4
--- /dev/null
+++ b/setedit/www-site/tag_imgs/this_and_parents.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/this_class.png b/setedit/www-site/tag_imgs/this_class.png
new file mode 100644
index 0000000..c620ba2
--- /dev/null
+++ b/setedit/www-site/tag_imgs/this_class.png
Binary files differ
diff --git a/setedit/www-site/tag_imgs/w_completion.png b/setedit/www-site/tag_imgs/w_completion.png
new file mode 100644
index 0000000..f953123
--- /dev/null
+++ b/setedit/www-site/tag_imgs/w_completion.png
Binary files differ
diff --git a/setedit/www-site/tags.html b/setedit/www-site/tags.html
new file mode 100644
index 0000000..313b5e8
--- /dev/null
+++ b/setedit/www-site/tags.html
@@ -0,0 +1,318 @@
+<html>
+<head>
+ <title>SETEDIT, a friendly text editor: How to use TAGs</title>
+ <meta name="description" content="SETEdit a friendly text editor for DOS, Win32, Linux and other UNIXes">
+ <meta name="keywords" content="SETEdit, setedit, rhide, editor, linux, DOS, console, tui, djgpp, library, download, SET, Salvador, Eduardo, Tropea, PPC, SPARC, Alpha, FreeBSD, Solaris, tags, ctags, exuberant">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, salvador[at host]inti.gov.ar">
+</head>
+<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">
+
+<p><center>
+<table>
+<tr>
+<td><strong><h1>SETEDIT</h1></strong></td>
+<td align=right><A href="http://sourceforge.net">
+ <IMG valign=center src="http://sourceforge.net/sflogo.php?group_id=32835"
+ width="88" height="31" border="0" alt="SourceForge Logo"></A></td>
+</tr>
+</table>
+</center></p>
+
+<h2>How to use tags</h2>
+<p>
+
+The editor's help have a good description about it, but this page contains an
+ilustrated tutorial.
+<p>
+This tutorial is a simplification of the process and I suggest reading the
+documentation to learn more. So use this tutorial as a quick start-up to get
+see how it works and once you start loving it read more in the docs.
+<p>
+Note: this tutorial can be used to learn other features of the editor. For
+this reason the explanations are very detailed. I'm sorry if you find it too
+detailed. On the other hand, if you find it confusing please report it
+explaining the problems.
+<p>
+
+<h3>What are tags?</h3>
+<p>
+
+TAGS files are plain text files containing a list of symbols from your source
+code. For each symbol the file indicates in which file it's located and how to
+find the symbol inside the file. Modern programs also include very important
+information like which type of symbol is defined and if this symbol is part of
+a bigger construct like a class.
+<p>
+
+This information is very useful to do searches. The editor implements
+facilities to jump to any defined symbol, browse classes and do word
+completion using information from tag files.
+<p>
+
+<h3>What can I do with tags?</h3>
+<p>
+
+With the tag files you can:<p>
+
+<ul>
+ <li> Jump to any defined symbol.
+ <li> Browse class hierarchy (tested only for C++ but other languages are
+supported).
+ <li> Ask the editor to complete a partially typed symbol.
+</ul>
+
+<h3>Which languages are supported?</h3>
+<p>
+
+All the languages supported by the tags tool. For
+<a href="http://ctags.sf.net/">Exuberant CTags</a> that's 33
+<a href="http://ctags.sf.net/">languages</a>.
+<p>
+
+<h3>Using it step by step</h3>
+<p>
+
+This is a really simplified way to use ctags with SETEdit. As with all
+simplified things you lose some control in favor of simplicity. For this
+reason I encourage reading the docs after you get it working and determine
+that's good for you. Note that tags generation could be too slow using the
+methode I describe here and if you are using a slow system and coding a big
+project you'll most probably need to learn more to improve the performance.
+<p>
+
+<h4>Step 1: Get the ctags program</h4>
+
+You'll need the Exuberant CTAGS program. May be other programs are ok but
+this is the only one I tested and it's free software.<p>
+The home page of the project is:
+<a href="http://ctags.sourceforge.net/">http://ctags.sourceforge.net/</a>.<p>
+Linux distributions, like Debian GNU/Linux, includes it and the best is to
+just install the corresponding package.<p>
+
+<h4>Step 2: Create a project for your program</h4>
+
+<ol>
+ <li> Change the working directory to the place where you have the files.
+(i.e. $ cd /usr/src/my_project).
+ <li> Start the editor. (i.e. $ e).
+ <li> Select the "Project | Open" menu option. Figure 1.
+ <li> Give a name to your project. (i.e. my_project). The editor will create
+a .epr file for it. Figure 2.
+ <li> Add the files to your project. You can do it using the insert key or by
+selecting "Project | Import project items" and providing a text file
+containing the names of the files to import.
+</ol>
+<table>
+<tr>
+<td>
+ <img src="tag_imgs/project_open.png" alt="Project|Open" width=496 height=259><br>
+ <center>Figure 1: The "Project | Open" menu option.</center>
+</td>
+<td>
+ <img src="tag_imgs/name_project.png" alt="Project name" width=416 height=259><br>
+ <center>Figure 2: Giving a name to the project.</center>
+</td>
+</tr>
+<tr>
+<td colspan=2>
+ <table>
+ <tr>
+ <td>
+ The ilustrations shows how to create a project called <i>my_project</i>
+ containing a trivial C file called <i>my_file.cc</i>.<br>
+ If you want to copy & paste the example file from your browser here I
+ provide a link to the file exported with the editor as HTML:
+ <a href="my_file1.html">my_file.cc</a>.<br>
+ <p>
+ Note 1: Isn't beautiful how the export works? ;-)<br>
+ Note 2: The snapshots are from a machine using Linux, pay attention to the
+ different font sizes. In other snapshots you'll see different fonts.
+ </td>
+ <td>
+ <img src="tag_imgs/a_project.png" alt="Project example" width=496 height=377><br>
+ <center>Figure 3: An example of a really trivial project.</center>
+ </td>
+ <td>
+ </tr>
+ </table>
+</td>
+</tr>
+</table>
+
+<h4>Step 3: Generate the tags using the easy way</h4>
+
+<ol>
+ <li> Select the "Search | Jump to symbol" menu option. This option have a
+default short-cut defined as Ctrl+F2, it can be changed editing the
+menubind.smn file. Figure 4.
+ <li> As you don't have a tags file in the working directory the editor will
+offer some advice. The dialog says "This option needs a tags file. Do you want
+to read more about it?". Answer <b>No</b> this time. Figure 5.
+ <li> Now the editor knows you are lazy and hence an information dialog will
+appear saying: "I can try to generate a tag file, go ahead?". Answer
+<b>Yes</b>, in this way the editor will invoke ctags to generate a tags file
+using some rasonable defaults. Figure 6.
+ <li> Finally you'll get the list of symbols defined in your project. You can
+incrementally search any symbol and pressing ENTER you'll jump to its
+definition. For most cases the information you see is not all and you have
+to scroll horizontally to read all. You can also use F5 to zoom the dialog.
+Figure 7.
+</ol>
+
+Note: The editor takes the word under the cursor to do a search in the list
+of symbols. For this reason you can place the cursor over a function call and
+then press Ctrl+F2, if the search matched you can just press ENTER and jump
+to the function definition.
+<p>
+
+<center>
+<table>
+<tr>
+<td>
+ <center><img src="tag_imgs/jump_symbol.png" alt="Search|Jump to symbol" width=449 height=259><br>
+ Figure 4: The "Search | Jump to symbol" menu option.</center>
+</td>
+<td>
+ <center><img src="tag_imgs/advice_tags.png" alt="Tags advice" width=401 height=259><br>
+ Figure 5: The advice suggesting to read the docs.</center>
+</td>
+</tr>
+<tr>
+<td colspan=2>
+ <center><img src="tag_imgs/generate_tags.png" alt="Autogenerate?" width=428 height=259><br>
+ Figure 6: The dialog asking if you want to create a tags file.</center>
+</td>
+</tr>
+<tr>
+<td colspan=2>
+ <center><img src="tag_imgs/symbols_example.png" alt="Symbols" width=656 height=426><br>
+ Figure 7: Symbols from the trivial example.</center>
+</td>
+</tr>
+</table>
+</center>
+
+<h4>Step 4: Configuring the editor to update the tags file</h4>
+
+<ol>
+ <li> Select the "Tool&Ops | Options | Tag Files | Options" menu option. This
+option will show a small dialog. Figure 8.
+ <li> Select the "Using central file" option and press the OK button. Figure
+9 (it shows the default option).
+</ol>
+
+Once you enable it the editor will check the modification date of the files
+you are editing and will update the tags file if you request any operation
+passing the list of modified files to ctags tool.
+<p>
+<b>IMPORTANT!</b> If for some reason the data in the tags file becomes
+inconsistent you can ask the editor to regenerate the tags file just deleting
+the file called <i>tags</i> from the working directory.
+<p>
+
+<center>
+<table>
+<tr>
+<td>
+ <center><img src="tag_imgs/tag_options.png" alt="Tags options menu" width=241 height=367><br>
+ Figure 8: The menu entry for tag options.</center>
+</td>
+<td>
+ <center><img src="tag_imgs/d_tag_options.png" alt="Tags options dialog" width=323 height=216><br>
+ Figure 9: The dialog for the options.</center>
+</td>
+</tr>
+</table>
+</center>
+
+<h4>Step 5: Word completion</h4>
+
+The information from the tags file can be used to ask the editor to complete
+a partially typed symbol. To ilustrate it a suggest adding another function
+to example called <b>That_is_not_my_function</b>. Here is the suggested
+source code: <a href="my_file2.html">my_file.cc</a>.<p>
+Now go to any place and type <i>That</i>, then choose the "Search | Word
+completion" menu option (or Ctrl+Tab). You'll get a list showing the
+available options to complete the name of the function. You can move the
+cursor or incrementally search until you reach the desired option. To confirm
+the selection press ENTER or type any symbol. In this case you can confirm
+typing the parenthesis. The figure 10 shows the mentioned example.
+<p>
+
+<center><img src="tag_imgs/w_completion.png" alt="Word completion" width=342 height=134><br>
+Figure 10: The word completion in action.</center>
+
+<h4>Step 6: Browsing classes</h4>
+
+For this example we'll need a more complex source code, here is the proposed
+source code: <a href="my_file3.html">my_file.cc</a>.<p>
+
+<ol>
+ <li> Select the "Search | Class browser" menu option. Note: it also looks
+for the word under cursor so you can use it when the cursor is over a class
+name.
+ <li> The editor will show a list of classes. Figure 11.
+ <li> Select the "Class_Child" class.
+ <li> You'll get a dialog showing the parents and children for this class (in
+this case it have only a parent and no children). Figure 12.
+ <li> From this dialog you can jump to related classes. In this example you
+can jump to "Class_Parent" selecting it and using the "Browse parent" button.
+But let this for another moment.
+ <li> Pressing the three first buttons you can get different information
+about the class. Suppose you are looking for information about the data member
+called "data_member_1" and you don't even know to which class belongs. Press
+the "This & parents" button. You'll get a list of members sorted by hierarchy
+(figure 13) and if you press the "Sorted" button you'll get it alphabetically
+sorted (figure 14).
+ <li> Select the "data_member_1" and then press the "View class" button.
+You'll get a dialog quite similar to the figure 12 but with information for
+the "Class_Parent" class.
+ <li> Now press the "This class" button. You'll get a list of the members for
+this class. Figure 15. Note: I resized the dialog to show it better in
+the picture.
+ <li> Select the "data_member_1" and press the "Jump" button (or just ENTER).
+The editor will show the line where this data member is defined.
+</ol>
+
+<center>
+<table>
+ <tr>
+ <td>
+ <center><img src="tag_imgs/class_list.png" alt="List of classes" width=401 height=259><br>
+ Figure 11: The list of classes available for browsing.</center>
+ </td>
+ <td>
+ <center><img src="tag_imgs/class_child1.png" alt="Class_Child" width=257 height=428><br>
+ Figure 12: The dialog showing Class_Child inheritance information.</center>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <center><img src="tag_imgs/this_and_parents.png" alt="This & parents" width=405 height=361><br>
+ Figure 13: The list of members for this class and its parents.</center>
+ </td>
+ <td>
+ <center><img src="tag_imgs/sorted.png" alt="Sorted" width=405 height=361><br>
+ Figure 14: The same list but alphabetically sorted.</center>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <center><img src="tag_imgs/this_class.png" alt="This class" width=763 height=205><br>
+ Figure 15: List of members for this class.</center>
+ </td>
+ </tr>
+</table>
+</center>
+
+<p>
+I think that's enough to show you how powerful are tags. Play a little bit
+with it, if you have a big project you'll soon discover how useful are tags.
+Then read the documentation of the editor and ctags to learn how to
+customize it and how to use more than one tags file.<p>
+Good luck!<p>
+
+</body>
+</html>
diff --git a/setedit/www-site/update b/setedit/www-site/update
new file mode 100755
index 0000000..a259a96
--- /dev/null
+++ b/setedit/www-site/update
@@ -0,0 +1,2 @@
+#!/bin/sh
+scp *.html *.txt *.css set@setedit.sourceforge.net:/home/groups/s/se/setedit/htdocs/
diff --git a/setedit/www-site/xterm.html b/setedit/www-site/xterm.html
new file mode 100644
index 0000000..1f989c3
--- /dev/null
+++ b/setedit/www-site/xterm.html
@@ -0,0 +1,63 @@
+<html>
+<head>
+ <title>SETEDIT, a friendly text editor - XTerm snapshots</title>
+ <meta name="description" content="SETEdit a friendly text editor for DOS, Win32, Linux and other UNIXes">
+ <meta name="keywords" content="SETEdit, setedit, rhide, editor, linux, DOS, console, tui, djgpp, library, download, SET, Salvador, Eduardo, Tropea, PPC, SPARC, Alpha, FreeBSD, Solaris">
+ <meta name="resource-type" content="document">
+ <meta name="distribution" content="global">
+ <meta name="Author" content="Salvador E. Tropea, salvador.inti.gov.ar">
+</head>
+<BODY BGCOLOR="#A0D0FF" TEXT="#000000" LINK="#FF0000" VLINK="#000000">
+
+<p><center>
+<table>
+<tr>
+<td><strong><h1>XTerm snapshots</h1></strong></td>
+<td align=right><A href="http://sourceforge.net">
+ <IMG valign=center src="http://sourceforge.net/sflogo.php?group_id=32835"
+ width="88" height="31" border="0" alt="SourceForge Logo"></A></td>
+</tr>
+</table>
+</center></p>
+
+The following snapshots are all using the XTerm driver and the editor is running on remote
+systems. They are UNIX like OSs using various types of CPUs.
+<p>
+
+<ul>
+ <li> Darwin (6.8 MacOS X 10.2)
+ <ul>
+ <li> <a href="Darwin_PPC.png">Power PC</a> (G4)
+ </ul>
+ <li> FreeBSD (4.10 Beta)
+ <ul>
+ <li> <a href="FreeBSD_x86.png">x86</a>
+ </ul>
+ <li> Linux
+ <ul>
+ <li> Debian Woody 3.0
+ <ul>
+ <li> <a href="Debian_Alpha.png">Alpha</a> (EV67 Tsunami/Catamaran 667MHz AlphaServer DS20E)
+ </ul>
+ <li> SuSE 8.1 (SLES)
+ <ul>
+ <li> <a href="SuSE_8_AMD64.png">AMD64</a> (AMD Opteron <b>Sample</b> 1594 MHz)
+ </ul>
+ </ul>
+ <li> NetBSD (1.6.1)
+ <ul>
+ <li> <a href="NetBSD_x86.png">x86</a>
+ </ul>
+ <li> OpenBSD (3.4)
+ <ul>
+ <li> <a href="OpenBSD_x86.png">x86</a>
+ </ul>
+ <li> Solaris (9)
+ <ul>
+ <li> <a href="Solaris_9_x86.png">x86</a>
+ <li> <a href="Solaris_9_SPARC.png">SPARC</a>
+ </ul>
+</ul>
+
+</body>
+</html> \ No newline at end of file
diff --git a/src/GNUmakefile b/src/GNUmakefile
index 13c8582..bc9284c 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -5,10 +5,10 @@ SUBDIRS =
INCLUDE_CPPFLAGS =
INCLUDE_LDFLAGS = \
- -L$(TOPDIR)/tvision/makes
+ -L$(TOPDIR)/rhtvision/makes
INCLUDE_DIRS = \
- -I. -I$(TOPDIR)/tvision/include
+ -I. -I$(TOPDIR)/rhtvision/include
INCLUDE_LIBS = \
-lrhtv