Category : UNIX Files
Archive   : RECOD324.ZIP
Filename : RECOD324.TAR

 
Output of file : RECOD324.TAR contained in archive : RECOD324.ZIP
recode-3.2.4/ 755 6206 22 0 5264656736 10435 5ustar djmumdrecode-3.2.4/README 644 6206 22 6200 5264656520 11362 0ustar djmumdREADME for recode - last revised 92-10-07.
Copyright (C) 1990-92 Free Software Foundation, Inc.
See file COPYING for copying conditions.

This is the 3.2.4 release of `recode', a tool whose purpose is
recoding various character sets to one another. Recoding is currently
possible between any pair of these character sets:

* usual 7-bit ASCII: without any diacritics, or else: using
backspace for overstriking; Unisys' ICON convention; TeX/LaTeX
coding; easy French conventions for electronic mail;

* 8-bit extensions to ASCII: ISO Latin-1, IBM's code for the PC,
Apple's code for the Macintosh;

* 6-bit escaped ASCII based on CDC display code: 6/12 code from NOS;
bang-bang code from Universite' de Montre'al;

* non-ASCII codes: EBCDIC as seen by Perkin Elmer; EBCDIC as seen by
Control Data;

WARNING
-------

*If* you got this package through shar files on UNIX, execute the
command:

touch configure merged.c recode.info

before proceeding any further.

INSTALLATION
------------

On various UNIXes, this program is distributed as a compressed tar
archive. Unpack, then follow the directions given in file INSTALL.
The wise would peek first at the HINTS section, below.

On MSDOS, this program is distributed in zoo format. To install,
merely extract `recode.exe' from the zoo archive and copy it where you
usually keep your executables. To reconstruct `recode.exe' from the
sources for some reason, type `make'. I ported recode to MSDOS using
Turbo C++ version 1.0 and the MSDOS port of GNU make.

If you develop new charsets, new methods, or anything along recode,
let me know and send me the code. If you modify or add an `.l' source
file, you will need GNU awk (or mawk or nawk) and Flex 2.3 (or better)
to reconstruct the file merged.c.

Mail suggestions and bug reports for this program (including
documentation errors) to Francois Pinard .

HINTS
-----

Here are a few hints which might help installing recode on some
systems. Most may be applied by temporary presetting environment
variables while calling `sh configure'. File INSTALL tells you more
about how to do this.

* Some C compilers, like Apollo's, have a real hard time compiling
merged.c. If this is your case, avoid compiler optimization and use:

DEFS=-DUSE_FPUTC sh configure

* For 80286 based systems, it has been reported that some compilers
generate wrong code while optimizing for `small' models. So, do:

DEFS=-Ml LDEFS=-Ml sh configure

to force large memory model. For 80286 Xenix compiler, the last time
it was tried a while ago, one ought to use:

DEFS='-Ml -F2000' LDEFS=-Ml sh configure

* Some smallish systems have poor `popen' support or trash heavily
when processes fork's. In this case, merely remove -DHAVE_POPEN and
-DHAVE_PIPE from Makefile's DEFS, just before doing `make'.

* There was a bug, reported only for Xenix compiler, in which enum
types where unusable if not declared int. If you have this bug, do:

DEFS=-DENUM_INT_BUG sh configure

If *you* have to define ENUM_INT_BUG, please contact me, so we can
develop an autoconfigurable test for it. If nobody reports about
this, I will remove ENUM_INT_BUG in some subsequent version.
recode-3.2.4/INSTALL 644 6206 22 12542 5250761604 11554 0ustar djmumdThis is a generic INSTALL file for utilities distributions.
If this package does not come with, e.g., installable documentation or
data files, please ignore the references to them below.

To compile this package:

1. Configure the package for your system. In the directory that this
file is in, type `./configure'. If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself.

The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and
creates the Makefile(s) (one in each subdirectory of the source
directory). In some packages it creates a C header file containing
system-dependent definitions. It also creates a file `config.status'
that you can run in the future to recreate the current configuration.

Running `configure' takes a minute or two. While it is running, it
prints some messages that tell what it is doing. If you don't want to
see the messages, run `configure' with its standard output redirected
to `/dev/null'; for example, `./configure >/dev/null'.

To compile the package in a different directory from the one
containing the source code, you must use a version of make that
supports the VPATH variable, such as GNU make. `cd' to the directory
where you want the object files and executables to go and run
`configure'. `configure' automatically checks for the source code in
the directory that `configure' is in and in `..'. If for some reason
`configure' is not in the source code directory that you are
configuring, then it will report that it can't find the source code.
In that case, run `configure' with the option `--srcdir=DIR', where
DIR is the directory that contains the source code.

By default, `make install' will install the package's files in
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
an installation prefix other than /usr/local by giving `configure' the
option `--prefix=PATH'. Alternately, you can do so by changing the
`prefix' variable in the Makefile that `configure' creates (the
Makefile in the top-level directory, if the package contains
subdirectories).

You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If
you give `configure' the option `--exec_prefix=PATH', the package will
use PATH as the prefix for installing programs and libraries. Data
files and documentation will still use the regular prefix. Normally,
all files are installed using the regular prefix.

You can tell `configure' to figure out the configuration for your
system, and record it in `config.status', without actually configuring
the package (creating `Makefile's and perhaps a configuration header
file). To do this, give `configure' the `--no-create' option. Later,
you can run `./config.status' to actually configure the package. This
option is useful mainly in `Makefile' rules for updating `config.status'
and `Makefile'. You can also give `config.status' the `--recheck'
option, which makes it re-run `configure' with the same arguments you
used before. This is useful if you change `configure'.

`configure' ignores any other arguments that you give it.

If your system requires unusual options for compilation or linking
that `configure' doesn't know about, you can give `configure' initial
values for some variables by setting them in the environment. In
Bourne-compatible shells, you can do that on the command line like
this:
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure

The `make' variables that you might want to override with environment
variables when running `configure' are:

(For these variables, any value given in the environment overrides the
value that `configure' would choose:)
CC C compiler program.
Default is `cc', or `gcc' if `gcc' is in your PATH.
INSTALL Program to use to install files.
Default is `install' if you have it, `cp' otherwise.

(For these variables, any value given in the environment is added to
the value that `configure' chooses:)
DEFS Configuration options, in the form `-Dfoo -Dbar ...'
LIBS Libraries to link with, in the form `-lfoo -lbar ...'

If you need to do unusual things to compile the package, we encourage
you to figure out how `configure' could check whether to do them, and
mail diffs or instructions to the address given in the README so we
can include them in the next release.

2. Type `make' to compile the package. If you want, you can override
the `make' variables CFLAGS and LDFLAGS like this:

make CFLAGS=-O2 LDFLAGS=-s

3. If the package comes with self-tests and you want to run them,
type `make check'. If you're not sure whether there are any, try it;
if `make' responds with something like
make: *** No way to make target `check'. Stop.
then the package does not come with self-tests.

4. Type `make install' to install programs, data files, and
documentation.

5. You can remove the program binaries and object files from the
source directory by typing `make clean'. To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make distclean'.

The file `configure.in' is used as a template to create `configure' by
a program called `autoconf'. You will only need it if you want to
regenerate `configure' using a newer version of `autoconf'.
recode-3.2.4/COPYING 444 6206 22 43076 5022247405 11555 0ustar djmumd 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.


Copyright (C) 19yy

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.

, 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.
recode-3.2.4/Buggestions 644 6206 22 1661 5104310034 12700 0ustar djmumdTue Jan 15 11:52:54 1991 Francois Pinard (pinard at icule)

* recode r--r--r-- aborts. It should rather try to make the file
writable, recode it, and write protect it afterwards.

Tue Mar 27 18:31:13 1990 Claude Goutier (goutier at jsp.umontreal.ca)

* Je trouve difficile a lire les sections ou tu mets entre
guillements des caracteres: `e'' etc. Il serait plus clair
d'utiliser ce qui se rapproche le plus des guillemets, a savoir
`"', ou encore des blancs supplementaires ou << et >>.

Fri Feb 9 18:51:59 1990 Francois Pinard (pinard at kovic)

* Intercept signals to cleanup the temporary file in any event.

Fri Feb 2 13:04:25 1990 Claude Goutier (6 at cc.umontreal.ca)

* Have charsets configurable out of recode at installation time,
maybe via steps.h or some new config.h file.

Fri Feb 2 13:04:25 1990 Alain Simon (alain at elevia)

* Implement VT320 support and related international character set
standards.

recode-3.2.4/ChangeLog 644 6206 22 35376 5264656621 12316 0ustar djmumdWed Oct 7 17:58:32 1992 Francois Pinard (pinard at icule)

* Version 3.2.4. Released to alt.sources.

Tue Oct 6 12:51:42 1992 Francois Pinard (pinard at icule)

* Makefile.in: Use exec_prefix. Add `uninstall'.

Tue Sep 29 14:57:26 1992 Francois Pinard (pinard at icule)

* recode.c: Define EXIT_SUCCESS and EXIT_FAILURE if not defined,
even after inclusion of , for SunOS 4.

* Makefile.in: Add a completion message to `make check'.

* configure.in: Make the `WARNING:' bigger if no Flex.

Fri Sep 25 11:36:47 1992 Francois Pinard (pinard at icule)

* Version 3.2.3.

* HINTS: New file, used to simplify README.
* Makefile.in: Distribute HINTS.

* configure.in: Remove tests for Apollo's and 286 systems.
* steps.h: Replace XENIX by ENUM_INT_BUG.
* HINTS: Tell about Apollo's and 286 systems installation hints.

Thu Sep 24 16:51:33 1992 Francois Pinard (pinard at icule)

* recode.c: Write `Recoding...' instead of `recoding...'.

* asciflat.c: Insure looking one character ahead at all times.
This also solves a bug by which the second diacritic of a pair of
two diacritics in a row was not properly flattened out.

Wed Aug 26 10:40:11 1992 Francois Pinard (pinard at icule)

* ltexlat1.l: Given `*' is a diacritic operation, insure
swallowing '{}' in `\*\i{}'. Recognize also `\*{\i}'.

* asciltex.l: Prefer `\c{c}' to `\c c'.
* lat1ltex.c: Idem.

* lat1ltex.c: Insure NULs will go through.

* recode.c: Implement the -d `diacritics_only' option for LaTeX.
* asciltex.l: Idem.
* lat1ltex.c: Idem.
* ltexasci.l: Idem.
* ltexlat1.l: Idem.

Sun Aug 23 07:50:38 1992 Francois Pinard (pinard at icule)

* recode.texi: Merging in some other separate documents.
* table.texi, DisplayCode: Deleted.
* Makefile.in: Adjusted.

* configure.in: Split FP_STDC_CHECK out into aclocal.m4.
* aclocal.m4: New.
* Makefile.in: Distribute aclocal.m4.

* version.c: Insure next version will be 3.2.3, skipping 3.2.1 and
3.2.2, jumping over parallel numbering at U. de Montre'al.

Wed Aug 19 16:33:25 1992 Francois Pinard (pinard at icule)

* ansi2knr: New, from Ghostscript distribution.
* configure.in: Check for __STDC__ and define U.
* Makefile.in: Use U and ansi2knr.
* All .c's: Remove many __STDC__ checks.
* mergelex.awk: Remove generation of __STDC__ checks.

Mon Jul 20 23:37:23 1992 Francois Pinard (pinard at icule)

* Makefile.in: Use various clean goals according to latest GNU
standards. Moreover, add a recode.dvi goal and a texclean goal.

Thu Jul 16 18:49:48 1992 Francois Pinard (pinard at icule)

* configure.in: Changes for Autoconf 0.120. Also test for popen,
even if almost any UNIX has it; so the user can later undefine it from
DEFS; avoid testing for pipe because of an old bug in this area.
* Makefile.in, recode.c, checkit, common.h: Replace all *_MISSING
by HAVE_*.

Thu Jun 18 07:44:58 1992 Francois Pinard (pinard at icule)

* Makefile.in: Changes for Autoconf 0.118. Use AWK and LEX
instead of GAWK and FLEX.

Thu Jun 4 21:48:53 1992 Francois Pinard (pinard at icule)

* Makefile.in: Changes for Autoconf 0.115. Use config.status to
recreate Makefile from Makefile.in.
* checkit: Retrieve DEFS value from config.status instead of
Makefile.

Mon Jun 1 23:06:44 1992 Francois Pinard (pinard at icule)

* Makefile.in, configure.in: Changes for Autoconf 0.112. Avoid
FP_PROG_MAKEINFO and use `makeinfo' directly.
* checkit: Get DEFS from Makefile instead of from config.status.

Sun Feb 2 16:23:11 1992 Francois Pinard (pinard at icule)

* recode.c (main): Returns int.

Thu Jan 30 12:14:44 1992 Francois Pinard (pinard at icule)

* Makefile.in: Use new names for clean goals.

Mon Dec 2 20:30:53 1991 Francois Pinard (pinard at icule)

* steps.h, recode.c: Removed comma at end of enum's.

* version.c: Added a few const's.

Sat Nov 30 23:40:39 1991 Francois Pinard (pinard at icule)

* recode.c: Use EXIT_FAILURE and EXIT_SUCCESS; define them if not
STDC_HEADERS.

* recode.c: Prototypes added for fstat, getopt, link, perror,
unlink and utime, if __STDC__.

Thu Nov 7 11:21:38 1991 Francois Pinard (pinard at icule)

* recode.texi: Should now be TeXable.
* Makefile.in: Insure distributing texinfo.tex.

* ibmpicon.c, iconibmp.c: Use 0x1E for QNX end of lines, 0x0E was
wrong.

* configure.in: Take care of POSIXish ISC.

Tue Nov 5 09:47:15 1991 Francois Pinard (pinard at icule)

* configure.in, Makefile.in: Do not absolutize $(srcdir), because
this could create problems with automounters.

* configure.in, Makefile.in: Remove IF_* devices, they were
solving a problem caused only by non timestamping shars, and
recode is now distributed in tar or zoo format.

Mon Nov 4 18:14:49 1991 Francois Pinard (pinard at icule)

* configure.in: Get rid of the head program, using sed. I would
also like, eventually, to get rid of file and grep programs too.

Fri Nov 1 12:30:59 1991 Francois Pinard (pinard at icule)

* recode.c (main): Use rename library routine if available.
* configure.in: Check for rename availability.

* Makefile.in: Insure gawk is executed in the source directory
while preparing merged.c.

* recode.c (execute_pipe_sequence): Close descriptor after dup2.
Still bugged.

* recode.c (code_index): Reject partial matches for keywords.
(Reported by Laurent Bourbeau ).

Mon Oct 28 14:39:36 1991 Francois Pinard (pinard at icule)

* configure.in: New.
* configure: Automatically regenerated from file configure.in
and David MacKenzie's autoconf.

Mon Oct 28 12:08:31 1991 Francois Pinard (pinard at icule)

* Version 3.2.

* all: Replace GPL version 1 by GPL version 2.

* Makefile.in: Use `sh checkit' instead of `./checkit'. For an
unknown reason, the Sparc requires this.

* recode.c: Define str[r]chr to be [r]index if not USG.

* recode.c: Force binary mode on files for MSDOS.

Sun Oct 27 11:03:07 1991 Francois Pinard (pinard at icule)

* recode.c: MSDOS port. tempnam(), utime(), link() and getopt()
were missing; replacements inspired from by Rahul Dhesi's flip.
* configdos.pl, config.tcc: New.
* getopt.c: New, AT&T freed code.
* Makefile.in: Adjustements for MSDOS port, dist.dos goal.

Fri Oct 25 09:35:10 1991 Francois Pinard (pinard at icule)

* recode.c (execute_popen_sequence, execute_pipe_sequence):
Accept non filter mode.
(execute_pipe_sequence): Wait for children. Still bugged.

* configure: Test dup2.
* recode.c: Have DUP2_MISSING imply PIPE_MISSING, for now.

* checkit: New.
* Makefile.in: Use checkit in check goal.

Wed Oct 23 13:14:33 1991 Francois Pinard (pinard at icule)

* recode.c: Revert back to -v instead of -q. Give the user some
more control on the sequencing strategy through -i, -o and -p.
Get rid of any USE_FILE, USE_POPEN and USE_PIPE. However, keep
POPEN_MISSING and PIPE_MISSING around, for MSDOS. Segregating
between `popen' and `pipe' is only experimental, while trying to
have `pipe' working correctly.

* configure, Makefile.in: New. Many new configuration features.
Among others, through IF_FLEX, be careful to never loose merged.c
on those systems which do not have the machinery to remake it.
* GNUmakefile, Makefile, Depends: deleted.

Sun Mar 31 17:50:04 1991 Francois Pinard (pinard at icule)

* mergelex.awk: remove exit() and read() definitions.

Tue Jan 22 13:58:43 1991 Francois Pinard (pinard at icule)

* ibmpicon.c, ibmplat1.c, ibmpmaci.c: Recognize old DOS end of
file (0x1A).

Mon Jan 21 09:28:47 1991 Francois Pinard (pinard at icule)

* lat1bang.c, lat1txte.c: Have the no-break space converted to a
single space.

Tue Jan 15 09:46:46 1991 Francois Pinard (pinard at icule)

* all: While/if ((var=exp) [test]) -> while/if (var=exp, var [test]),
switch (var=exp) -> var=exp; switch (var).

* recode.c (code_index): Use usage_and_exit (). Moved.
* recode.c (echo_sequence): Print format changed.
* recode.c: Issue `recoding FILE ...done' messages, unless -q.

* ibmplat1.c, lat1ibmp.c, ibmpmaci, maciibmp.c, txteibmp.c:
While reading MS-DOS files, 0x0D followed by 0x0A is converted
to an end of line; while writing MS-DOS files, end of lines
are converted to 0x0D 0x0A.
* ibmpicon.c, iconibmp.c: While reading QNX files, 0x0E is
converted to 0x0D 0x0A; while writing QNX files, 0x0D followed
by 0x0A is converted to 0x0E.

* txteibmp.l: Deleted.
* steps.h: Remove references to texte_ibmpc.

* steps.h: Remove DONT_LEX conditionals; merged.c is always
available for installation.

Wed Jul 4 19:01:56 1990 Francois Pinard (pinard at icule)

* all: Copyright directly assigned to the FSF.

Mon Mar 26 13:19:24 1990 Francois Pinard (pinard at icule)

* txteasci.l, txteibmp.l, txtelat1.l: Change occurrences of a NUL
terminated cursor by a counter from 0 to yyleng-1. This will
insure proper transmission of NULs through Flex, which can now
handle them.

* mergelex.awk: Make use of -8 option of Flex 2.2 alpha, adjust
documentation, insure proper pre-declarations of Flex variables
yytext, yyleng, yyint and yyout.

Fri Mar 23 19:24:08 1990 Francois Pinard (pinard at icule)

* recode.c (execute_popen_sequence): Get rid of unused variables.

* recode.c (code_index): Change index to counter, because on BSD
index is a library function.

Fri Mar 16 10:17:48 1990 Francois Pinard (pinard at icule)

* Version 3.1

Thu Mar 15 19:22:53 1990 Francois Pinard (pinard at icule)

* version.c, recode.c (usage_and_exit): Change -V to -C to give
the Copyright conditions, print version identification.

* txtelat1.l: Real strange bug aroud Flex. I ought to blindly
remove the specific case of a capital A with a diaeresis to get
rid of a `NULL in input' Flex diagnostic. Doing so, I introduce a
new bug to get rid of another :-(.

* all: Added missing prototypes declarations, missing void
specifications for functions, missing const; removed unused
variables.
* common.h: New.

Fri Feb 9 00:20:51 1990 Francois Pinard (pinard at icule)

* recode.c, Makefile: If no files are specified, recode stdin on
stdout as before. But if files are specified, each of them is now
recoded over itself, preserving its time stamps unless -t option
is used. To make it work on BSD, split execute_sequence in three,
get rid of USE_FILES and hide USE_PIPE in the Makefile. Also, see
the comment before execute_sequence routines, in recode.c.

* recode.c (main): Some code for -f, to be written later.

* recode.c (usage_and_exit): Rewritten.

Mon Feb 5 22:42:54 1990 Francois Pinard (pinard at kovic)

* recode.c (usage): Added commas to improve readability.

* lat1bang.c: Have lower case output instead of upper case, this
is more readable.

Sat Feb 3 07:31:50 1990 Francois Pinard (pinard at kovic)

* Version 3.0.1

* recode.c: Corrected bugs related to USE_POPEN; recode step path
is now echoed once, and diaeresis selection is now propagated.

Fri Feb 2 12:58:22 1990 Francois Pinard (pinard at kovic)

* mergelex.awk: Option USE_FPUTC, so to compile merged.c using
fputc instead of putc. It will hopefully ease Apollo C compiler,
which litterally trashes on merged.c.

Sat Jan 27 10:06:09 1990 Francois Pinard (pinard at kovic)

* all: Adaptation for Flex. A few yyleng problems short-circuited
here and there in some .l's.
* lexcom.c: Eliminated.
* mergelex.awk: New, for merging all .l's into a single merged.l.
This results in a shorter a.out, by a factor of 2 in fact.
* asciltex.l, ascitxte.l: Slight adjustments needed in asciltex.l
and ascitxte.l to escape <'s with backslashes.

* cdcnasci.c, banglat1.c: Too many putc's, simplified to shorten
the object modules.

* recode.c: Temporary files were improperly unlinked. Addition of
a -q option (quiet), removal of -d (debug): by default, choosen
step path is printed on stderr.

* lat1bang.c: Replacement for disappearing ascibang.l.
* ascibang.l: Removed.

Sun Nov 19 10:35:00 1989 Francois Pinard (pinard at icule)

* banglat1.c, lat1bang.c, iconibmp.c, cdcnasci.c, ascicdcn.c,
asciflat.c: Replacements for banglat1.l, ascibang.l, iconibmp.l,
cdcnasci.l, ascicdcn.l, asciflat.l. I will get rid of some
simpler lex routines, to get speed and save space.
* steps.h, version.c: Various adjustments for the preceeding
changes.

* Most files: Removal of the dash to restrict each file name
into eight character, for MS-DOS.

Fri Nov 10 09:03:11 1989 Francois Pinard (pinard at icule)

* version.c: Added.

* recode.c: Provision for -V option.

Sun Oct 29 13:02:53 1989 Francois Pinard (pinard at icule)

* Version 3.0

* txte-lat1.l, lat1-txte.c: Added.

* txte-ibmp.l: Capital E with acute accent now stays capital in
all cases.

* recode.c: Addition of USE_FILES feature for smaller machines.
PIPE_OUTSIDE renamed to USE_POPEN, PIPE_INSIDE to USE_PIPE.
Recognition of short keywords.

* ltex-asci.l, ltex-lat1.l: \$ now correctly translated into $.

* History from an old recode.texinfo:

August 1988:

Some tentative new charsets for TeX and texinfo, steps
merged and made more uniform, usage of Unix pipes
instead of translating chunks one at a time.

July 1988:

Ported to BSD Unix, bent to meet most GNU standards.

December 1987:

Ported to Microsoft C, tables frozen instead of being
computed by auxiliary programs at installation time,
translation sequences sought at execution time instead
of built-in in the program.

July 1985:

Adapted in Turbo-Pascal on an IBM-PC, translation
tables completely redesigned. Dropping of CAF, RUB
and INT support; ASCII now used as a common base.

* History from Cyber `secours,/s=codes,recode' documents:

March 1983:

Version 2.0

Merge of features from all versions. New extensive
documentation, in French. Handling of French for 95
character CDC printers.

November 1982:

Version 1.0

Modified to handle NOS (NOS 6/12 code), INT (Intercom 8/12
code), RUB (7.5 char per word tape format), support of
EBCDIC translations. Restructuration into a few main
modules, one of which is CODES. Made in preparation for
the Cray-1 at Canadian Meteorological Center.

December 1981:

Revision of comparison routines for French processing,
several suggestions from Francine Ouellette.

December 1980:

A few speedups and improvements. My own definition of
extended ASCII, quite compatible with various usages at
Universite' de Montre'al.

July 1980:

Module GEN broken into several modules: ASC (ascii), BNG
(bang-bang), CAF (format for CAFE project), DPC (usual
display code), and TEL (TELUM packing). Made in context
of some research for the PPMF group and the BLOPS project.

January 1980:

Unified module named GEN and program named GENCOP, in
Cyber Pascal and assembler, partly inspired from NOS/BE
Record Manager, partly from Claude Schne'egans' PESTUM
protocol.

Before 1980:

Several independant programs, most in Cyber COMPASS
assembler, to handle code conversions. A few tries to
get some useful, unified, general approach, but with
limited success.
recode-3.2.4/configure.in 644 6206 22 1062 5262120674 13006 0ustar djmumddnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(recode.c)
AC_SUBST(LDEFS)dnl
AC_SUBST(LIBOBJS)dnl (empty for UNIX, used for MSDOS)
# Default code is latin1 on UNIX, ibmpc on MSDOS.
AC_SUBST(DEFAULTCODE)DEFAULTCODE=${DEFAULTCODE-latin1}
AC_PROG_AWK
AC_PROG_LEX
test "$LEX" = flex || echo >&2 "WARNING: Cannot find Flex"

AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_ISC_POSIX
FP_STDC_CHECK
AC_STDC_HEADERS
AC_USG
# Add `pipe' to the following list whenever I correct *that* bug.
AC_HAVE_FUNCS(dup2 popen rename)
AC_OUTPUT(Makefile)
recode-3.2.4/aclocal.m4 644 6206 22 443 5245702276 12324 0ustar djmumddnl Local additions to Autoconf macros.
dnl Copyright (C) 1992 Free Software Foundation, Inc.
dnl Francois Pinard , 1992.
dnl
define(FP_STDC_CHECK,
[echo checking if __STDC__ defined
AC_TEST_CPP([#ifdef __STDC__
#include
#endif], [U=_])AC_SUBST(U)])
recode-3.2.4/Makefile.in 644 6206 22 16360 5264656462 12604 0ustar djmumd# Makefile for recode.
# Copyright (C) 1991 Free Software Foundation, Inc.
# Francois Pinard , 1988.

# 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., 675 Mass Ave, Cambridge, MA 02139, USA.

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = @srcdir@
VPATH = @srcdir@
U = @U@

# If you use gcc, you should either run the fixincludes script that
# comes with it or else use gcc with the -traditional option. Otherwise
# ioctl calls will be compiled incorrectly on some systems.
CC = @CC@
AR = ar
# Set RANLIB = echo if your system doesn't have or need ranlib.
RANLIB = @RANLIB@
# Use cp if you don't have install.
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
# GNU awk (or nawk) and Flex (2.3 or better) are required if merged.c
# is to be reconstructed.
AWK = @AWK@
LEX = @LEX@

# Things you might add to DEFS:
# -DDEFAULT_CODE=... Quoted string giving the default or usual code.
# -DSTDC_HEADERS If you have ANSI C headers and libraries.
# -DUSG If you have System V/ANSI C string and
# memory functions and headers.
# -DMSDOS If you are using Messy-DOS; implies USE_FPUTC.
# -DHAVE_DUP2 If the dup2(3) call is available.
# -DHAVE_PIPE If the pipe(2) call is available.
# -DHAVE_POPEN If the popen(3) call is available.
# -DUSE_FPUTC If merged.c overflows or thrashes the C compiler.
# -DXENIX If enum's are somewhat incompatible with int's.

DEFS = @DEFS@
LDEFS = @LDEFS@

CFLAGS = -g -I$(srcdir) $(DEFS) -DDEFAULT_CODE=\"@DEFAULTCODE@\"
LDFLAGS = -g $(LDEFS)
LIBS = @LIBS@

# Common prefix for installation directories.
# NOTE: Thess directories must exist when you start installation.
prefix = /usr/local
exec_prefix = $(prefix)
# Directory in which to put the executables.
bindir = $(exec_prefix)/bin
# Directory in which to put the Info documentation.
infodir = $(prefix)/info

#### End of system configuration section. ####

C_STEPS = asc8asc7.c ascicdcn.c asciflat.c banglat1.c cccaebcd.c \
cdcaebcd.c cdcnasci.c ebcdccca.c ebcdcdca.c ibmpicon.c \
ibmplat1.c ibmpmaci.c iconibmp.c lat1bang.c lat1ibmp.c \
lat1ltex.c lat1txte.c maciibmp.c
C_STEPOBJS = $Uasc8asc7.o $Uascicdcn.o $Uasciflat.o $Ubanglat1.o $Ucccaebcd.o \
$Ucdcaebcd.o $Ucdcnasci.o $Uebcdccca.o $Uebcdcdca.o $Uibmpicon.o \
$Uibmplat1.o $Uibmpmaci.o $Uiconibmp.o $Ulat1bang.o $Ulat1ibmp.o \
$Ulat1ltex.o $Ulat1txte.o $Umaciibmp.o

L_STEPS = asciltex.l ascitxte.l ltexasci.l ltexlat1.l txteasci.l txtelat1.l
L_STEPOBJS = $Umerged.o

LIBSRCS = getopt.c
LIBOBJS = @LIBOBJS@

HDRS = common.h steps.h
SRCS = recode.c version.c $(C_STEPS) $(L_STEPS) $(LIBSRCS)
OBJS = $Urecode.o $Uversion.o $(C_STEPOBJS) $(L_STEPOBJS) $(LIBOBJS)

DISTFILES = README INSTALL COPYING Buggestions ChangeLog \
configure.in aclocal.m4 Makefile.in configdos.pl config.tcc ansi2knr.c \
mergelex.awk recode.texi ISO-8859 texinfo.tex \
$(HDRS) $(SRCS) c-boxes.el checkit \
configure merged.c recode.info

MSDOS_OBJS = getopt.o

CHECKTEST = @sh $(srcdir)/checkit -v $(srcdir)/COPYING

all: recode recode.info
.PHONY: all

check: recode
$(CHECKTEST) txte txte
$(CHECKTEST) txte lat1
$(CHECKTEST) txte ibmp
$(CHECKTEST) txte icon
$(CHECKTEST) txte bang
$(CHECKTEST) asci ebcd
@echo "All checks completed successfully."
.PHONY: check

install: all
$(INSTALL_PROGRAM) recode $(bindir)/recode
$(INSTALL_DATA) $(srcdir)/recode.info $(infodir)/recode.info
.PHONY: install

uninstall: all
rm -f $(bindir)/recode $(infodir)/recode.info
.PHONY: uninstall

tags: $(SRCS)
ctags $(SRCS)
.PHONY: tags

TAGS: $(SRCS)
etags $(SRCS)
.PHONY: TAGS

texclean:
rm -f *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr
.PHONY: texclean

mostlyclean: texclean
rm -f *~ *.o core recode
.PHONY: mostlyclean

clean: mostlyclean
.PHONY: clean

distclean: clean
rm -f tags TAGS Makefile config.status
.PHONY: distclean

realclean: distclean
rm -f recode.info table.info merged.c
.PHONY: realclean

dist: $(DISTFILES)
echo recode-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
ln $(DISTFILES) `cat .fname`
tar chZf `cat .fname`.tar.Z `cat .fname`
rm -rf `cat .fname` .fname
.PHONY: dist

dist.dos: $(DISTFILES)
rm -rf dist.dos
rm -f recode.zoo
mkdir dist.dos
cp $(DISTFILES) dist.dos
perl configdos.pl config.tcc > dist.dos/makefile
echo "$(OBJS) $(MSDOS_OBJS)" \
| tr -s ' ' "\012" | sed 's/\.o$$/.obj/' > dist.dos/objects.lst
cd dist.dos; chmod +w *; ../recode :ibmpc *; zoo ahq ../recode *
rm -rf dist.dos
.PHONY: dist.dos

Makefile: Makefile.in config.status
./config.status

config.status: configure
./configure --no-create

configure: configure.in
autoconf

recode.info: recode.texi
makeinfo $(srcdir)/recode.texi

recode.dvi: recode.texi
tex $(srcdir)/recode.texi

table.info: table.texi
makeinfo $(srcdir)/table.texi

recode: $(OBJS)
$(CC) $(LDFLAGS) -o recode $(OBJS) $(LIBS)

merged.c: mergelex.awk $(L_STEPS)
(cd $(srcdir); $(AWK) -f mergelex.awk $(L_STEPS)) | $(LEX) -t8 > merged.tmp
rm -f $(srcdir)/mergelex.tmp
mv merged.tmp merged.c

ansi2knr: ansi2knr.c
$(CC) $(LDFLAGS) -o ansi2knr $(CFLAGS) $<
_recode.c: recode.c ansi2knr
./ansi2knr $(srcdir)/recode.c > _recode.c
_version.c: version.c ansi2knr
./ansi2knr $(srcdir)/version.c > _version.c
_asc8asc7.c: asc8asc7.c ansi2knr
./ansi2knr $(srcdir)/asc8asc7.c > _asc8asc7.c
_ascicdcn.c: ascicdcn.c ansi2knr
./ansi2knr $(srcdir)/ascicdcn.c > _ascicdcn.c
_asciflat.c: asciflat.c ansi2knr
./ansi2knr $(srcdir)/asciflat.c > _asciflat.c
_banglat1.c: banglat1.c ansi2knr
./ansi2knr $(srcdir)/banglat1.c > _banglat1.c
_cccaebcd.c: cccaebcd.c ansi2knr
./ansi2knr $(srcdir)/cccaebcd.c > _cccaebcd.c
_cdcaebcd.c: cdcaebcd.c ansi2knr
./ansi2knr $(srcdir)/cdcaebcd.c > _cdcaebcd.c
_cdcnasci.c: cdcnasci.c ansi2knr
./ansi2knr $(srcdir)/cdcnasci.c > _cdcnasci.c
_ebcdccca.c: ebcdccca.c ansi2knr
./ansi2knr $(srcdir)/ebcdccca.c > _ebcdccca.c
_ebcdcdca.c: ebcdcdca.c ansi2knr
./ansi2knr $(srcdir)/ebcdcdca.c > _ebcdcdca.c
_ibmpicon.c: ibmpicon.c ansi2knr
./ansi2knr $(srcdir)/ibmpicon.c > _ibmpicon.c
_ibmplat1.c: ibmplat1.c ansi2knr
./ansi2knr $(srcdir)/ibmplat1.c > _ibmplat1.c
_ibmpmaci.c: ibmpmaci.c ansi2knr
./ansi2knr $(srcdir)/ibmpmaci.c > _ibmpmaci.c
_iconibmp.c: iconibmp.c ansi2knr
./ansi2knr $(srcdir)/iconibmp.c > _iconibmp.c
_lat1bang.c: lat1bang.c ansi2knr
./ansi2knr $(srcdir)/lat1bang.c > _lat1bang.c
_lat1ibmp.c: lat1ibmp.c ansi2knr
./ansi2knr $(srcdir)/lat1ibmp.c > _lat1ibmp.c
_lat1ltex.c: lat1ltex.c ansi2knr
./ansi2knr $(srcdir)/lat1ltex.c > _lat1ltex.c
_lat1txte.c: lat1txte.c ansi2knr
./ansi2knr $(srcdir)/lat1txte.c > _lat1txte.c
_maciibmp.c: maciibmp.c ansi2knr
./ansi2knr $(srcdir)/maciibmp.c > _maciibmp.c
_merged.c: merged.c ansi2knr
./ansi2knr $(srcdir)/merged.c > _merged.c

$Urecode.o: steps.h
$(OBJS): common.h
recode-3.2.4/configdos.pl 644 6206 22 10040 5103044222 13005 0ustar djmumd# Convert `Makefile.in' into a Makefile for MSDOS.
# Copyright (C) 1991 Free Software Foundation, Inc.
# Francois Pinard , 1991

# Standard Input contains a substitution list quite similar to what is
# found in `config.status', but adapted for MSDOS. These are studied
# and used for turning `Makefile.in' into a usable Makefile for MSDOS
# on Standard Output. It is assumed that the MSDOS port of GNU make
# is used on the MSDOS side.

# Remember all the substitutions indicated by Standard Input.

while (<>)
{
next if /^$/;
next if /^#/;
if (/^PROGS="(.*)"/ || /^PROGS=(.*)/)
{
foreach $prog (split (' ', $1))
{
$cache{$prog} = &filename ("$prog.exe");
}
}
elsif (/^(\w+)="(.*)"$/)
{
($var, $value) = ($1, $2);
$value =~ s/\\"/"/g;
$config{$var} = $value;
}
elsif (/^(\w+)=(.*)/)
{
$config{$1} = $2;
}
else
{
print STDERR "*** Error on line $.: $_";
next;
}
}


# Beware the clash between TAGS and tags.

$cache{"TAGS"} = "tagse";


# Transform `Makefile.in' into `makefile.dos'.

open (INPUT, "Makefile.in") || die "Cannot read Makefile.in\n";
print "# Generated automatically by `configdos.pl'.\n";
while ()
{
# Execute @...@ substitutions.

while (/(.*)@(\w+)@(.*)/)
{
$_ = $1 . $config{$2} . $3 . "\n";
}

# Get rid of comments right now.

if (/^\#/)
{
print;
next;
}

# Some macros annonce list of files. Study them.

if (/^(DISTFILES|\w*SOURCES|\w*SRCS|\w*OBJECTS|\w*OBJS)\s*=\s*(.*)/)
{
&studylist ($2);
$studylist = 1;
}
elsif ($studylist)
{
&studylist ($_);
}

if ($studylist && ! /\\$/)
{
$studylist = "";
}

# Extract each word of the line and process it.

($_, $line) = /^(\w+\s*=\s*)?(.*)/;
while ($line =~ /[-.\w\/]+/)
{
$_ .= $`;
$line = $';

if ($cache{$&})
{
# Execute any previously saved substitution.

$value = $cache{$&};
}
else
{
$value = $&;
if ($value =~ /^[^.]+\.[^.]+$/)
{
# Normalize anything resembling a file name.

$value = &filename ($value);
}
}
$_ .= $value;
}
$_ .= $line . "\n";

# Check for other special modifications.

if (/^SHELL\s*=/)
{
s/^/#/;
}
elsif (/^CC\s*=/)
{
$_ = "CC = tcc\n";
}
elsif (/^CFLAGS\s*=/)
{
s/-[gO]\b//g;
s/=/= -v -N/;
}
elsif (/^LDFLAGS\s*=/)
{
s/-\w+//g;
}
elsif (/^ \$\(CC\).*-o\s/)
{
s/-o\s+/-e/;
s/\$\(OBJECTS\)/@objects.lst/;
}
elsif (/^\w+\s*=\s*:\b/ || /^ :\b/)
{
s/:/rem/;
}
elsif (/^\w+\s*=\s*cp\b/ || /^ cp\b/)
{
s/cp(\s+-\w+)*/copy/;
}
elsif (/^\w+\s*=\s*rm\b/ || /^ rm\b/)
{
s/rm(\s+-\w+)*/erase/;
}

print;
}
close INPUT;
exit 0;


# Prepare substitutions for the given list of files.

sub studylist
{
$list = $_[0];
$list =~ s/\$\(\w+\)//g;
$list =~ s/\\$//;
while ($list =~ /([-.\w\/]+)/)
{
$list = $';
$value = $&;
$cache{$value} = &filename ($&);
}
}


# Turn the argument into an MSDOS file name.

sub filename
{
# If no period at all, let flow characters after the 8th into the
# the extension.

if ($_[0] =~ /^(.*\/)?([^.\/]+)$/)
{
($prefix, $name, $ext) = ($1, $2, "");
$prefix =~ y/A-Z/a-z/;
$name =~ y/A-Z/a-z/;
if (length ($name) > 8)
{
$ext = substr ($name, 8);
$name = substr ($name, 0, 8);
$ext = substr ($ext, 0, 3) if length ($ext) > 3;
return "$prefix$name.$ext";
}
return "$prefix$name";
}

# If only one period, truncate to 8 characters before it and to 3
# characters after it.

if ($_[0] =~ /^(.*\/)?([^.\/]+)\.([^.\/]+)$/)
{
($prefix, $name, $ext) = ($1, $2, $3);
$prefix =~ y/A-Z/a-z/;
$name =~ y/A-Z/a-z/;
$ext =~ y/A-Z/a-z/;
$name = substr ($name, 0, 8) if length ($name) > 8;
if ($ext eq "o")
{
$ext = "obj";
}
elsif ($ext eq "texi" || $ext eq "texinfo")
{
$ext = "ti";
}
elsif (length ($ext) > 3)
{
$ext = substr ($ext, 0, 3);
}
return "$prefix$name.$ext";
}

# In other cases, return the argument unchanged.

return $_[0];
}
recode-3.2.4/config.tcc 644 6206 22 537 5105527742 12426 0ustar djmumd# Configure assignments required for MSDOS.
# Copyright (C) 1991 Free Software Foundation, Inc.
# Francois Pinard , 1991

srcdir=.
VPATH=""
DEFS="-DMSDOS -DUSG -DSTDC_HEADERS"
LIBS=""
LIBOBJS="getopt.obj"
DEFAULTCODE="ibmpc"
GAWK=""
FLEX=""
CC="gcc"
RANLIB="rem"
INSTALL="copy"
INSTALLDATA="copy"
MAKEINFO="rem"

PROGS=recode
recode-3.2.4/ansi2knr.c 644 6206 22 20005 5244465435 12415 0ustar djmumd/* Copyright (C) 1989, 1991 Aladdin Enterprises. All rights reserved.
Distributed by Free Software Foundation, Inc.

This file is part of Ghostscript.

Ghostscript is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
to anyone for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing. Refer
to the Ghostscript General Public License for full details.

Everyone is granted permission to copy, modify and redistribute
Ghostscript, but only under the conditions described in the Ghostscript
General Public License. A copy of this license is supposed to have been
given to you along with Ghostscript so you can know your rights and
responsibilities. It should be in a file named COPYING. Among other
things, the copyright notice and this notice must be preserved on all
copies. */

/* ansi2knr.c */
/* Convert ANSI function declarations to K&R syntax */
#include
#include
extern char *xmalloc ();
#ifndef USG
extern char *index ();
#define strchr index
#else /* USG */
extern char *strchr ();
#endif /* USG */

/* Usage:
ansi2knr input_file output_file
* If no output_file is supplied, output goes to stdout.
* There are no error messages.
*
* ansi2knr recognizes functions by seeing a non-keyword identifier
* at the left margin, followed by a left parenthesis,
* with a right parenthesis as the last character on the line.
* It will recognize a multi-line header if the last character
* on each line but the last is a left parenthesis or comma.
* These algorithms ignore whitespace and comments, except that
* the function name must be the first thing on the line.
* The following constructs will confuse it:
- Any other construct that starts at the left margin and
follows the above syntax (such as a macro or function call).
- Macros that tinker with the syntax of the function header.
*/

/* Scanning macros */
#define isidchar(ch) (isalnum(ch) || (ch) == '_')
#define isidfirstchar(ch) (isalpha(ch) || (ch) == '_')

main(argc, argv)
int argc;
char *argv[];
{ FILE *in, *out;
#define bufsize 500 /* arbitrary size */
char buf[bufsize];
char *line;
switch ( argc )
{
default:
printf("Usage: ansi2knr input_file [output_file]\n");
exit(0);
case 2:
out = stdout; break;
case 3:
out = fopen(argv[2], "w");
if ( out == NULL )
{ fprintf(stderr, "Cannot open %s\n", argv[2]);
exit(1);
}
}
in = fopen(argv[1], "r");
if ( in == NULL )
{ fprintf(stderr, "Cannot open %s\n", argv[1]);
exit(1);
}
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
line = buf;
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
{ switch ( test1(buf) )
{
case 1: /* a function */
convert1(buf, out);
break;
case -1: /* maybe the start of a function */
line = buf + strlen(buf);
continue;
default: /* not a function */
fputs(buf, out);
break;
}
line = buf;
}
if ( line != buf ) fputs(buf, out);
fclose(out);
fclose(in);
return 0;
}

/* Skip over space and comments, in either direction. */
char *
skipspace(p, dir)
register char *p;
register int dir; /* 1 for forward, -1 for backward */
{ for ( ; ; )
{ while ( isspace(*p) ) p += dir;
if ( !(*p == '/' && p[dir] == '*') ) break;
p += dir; p += dir;
while ( !(*p == '*' && p[dir] == '/') )
{ if ( *p == 0 ) return p; /* multi-line comment?? */
p += dir;
}
p += dir; p += dir;
}
return p;
}

/*
* Write blanks over part of a string.
*/
void
writeblanks(start, end)
char *start;
char *end;
{ char *p;
for ( p = start; p < end; p++ ) *p = ' ';
}

/*
* Test whether the string in buf is a function definition.
* The string may contain and/or end with a newline.
* Return as follows:
* 0 - definitely not a function definition;
* 1 - definitely a function definition;
* -1 - may be the beginning of a function definition,
* append another line and look again.
*/
test1(buf)
char *buf;
{ register char *p = buf;
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
bend = skipspace(buf + strlen(buf) - 1, -1);
switch ( *bend )
{
case ')': contin = 1; break;
case '(':
case ',': contin = -1; break;
default: return 0; /* not a function */
}
while ( isidchar(*p) ) p++;
endfn = p;
p = skipspace(p, 1);
if ( *p++ != '(' )
return 0; /* not a function */
p = skipspace(p, 1);
if ( *p == ')' )
return 0; /* no parameters */
/* Check that the apparent function name isn't a keyword. */
/* We only need to check for keywords that could be followed */
/* by a left parenthesis (which, unfortunately, is most of them). */
{ static char *words[] =
{ "asm", "auto", "case", "char", "const", "double",
"extern", "float", "for", "if", "int", "long",
"register", "return", "short", "signed", "sizeof",
"static", "switch", "typedef", "unsigned",
"void", "volatile", "while", 0
};
char **key = words;
char *kp;
int len = endfn - buf;
while ( (kp = *key) != 0 )
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
return 0; /* name is a keyword */
key++;
}
}
return contin;
}

convert1(buf, out)
char *buf;
FILE *out;
{ char *endfn = strchr(buf, '(') + 1;
register char *p;
char **breaks;
unsigned num_breaks = 2; /* for testing */
char **btop;
char **bp;
char **ap;
top: p = endfn;
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
if ( breaks == 0 )
{ /* Couldn't allocate break table, give up */
fprintf(stderr, "Unable to allocate break table!\n");
fputs(buf, out);
return -1;
}
btop = breaks + num_breaks * 2 - 2;
bp = breaks;
/* Parse the argument list */
do
{ int level = 0;
char *end = NULL;
if ( bp >= btop )
{ /* Filled up break table. */
/* Allocate a bigger one and start over. */
free((char *)breaks);
num_breaks <<= 1;
goto top;
}
*bp++ = p;
/* Find the end of the argument */
for ( ; end == NULL; p++ )
{ switch(*p)
{
case ',': if ( !level ) end = p; break;
case '(': level++; break;
case ')': if ( --level < 0 ) end = p; break;
case '/': p = skipspace(p, 1) - 1; break;
default: ;
}
}
p--; /* back up over terminator */
/* Find the name being declared. */
/* This is complicated because of procedure and */
/* array modifiers. */
for ( ; ; )
{ p = skipspace(p - 1, -1);
switch ( *p )
{
case ']': /* skip array dimension(s) */
case ')': /* skip procedure args OR name */
{ int level = 1;
while ( level )
switch ( *--p )
{
case ']': case ')': level++; break;
case '[': case '(': level--; break;
case '/': p = skipspace(p, -1) + 1; break;
default: ;
}
}
if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
{ /* We found the name being declared */
while ( !isidfirstchar(*p) )
p = skipspace(p, 1) + 1;
goto found;
}
break;
default: goto found;
}
}
found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
{ p++;
if ( bp == breaks + 1 ) /* sole argument */
writeblanks(breaks[0], p);
else
writeblanks(bp[-1] - 1, p);
bp--;
}
else
{ while ( isidchar(*p) ) p--;
*bp++ = p+1;
}
p = end;
}
while ( *p++ == ',' );
*bp = p;
/* Make a special check for 'void' arglist */
if ( bp == breaks+2 )
{ p = skipspace(breaks[0], 1);
if ( !strncmp(p, "void", 4) )
{ p = skipspace(p+4, 1);
if ( p == breaks[2] - 1 )
{ bp = breaks; /* yup, pretend arglist is empty */
writeblanks(breaks[0], p + 1);
}
}
}
/* Put out the function name */
p = buf;
while ( p != endfn ) putc(*p, out), p++;
/* Put out the declaration */
for ( ap = breaks+1; ap < bp; ap += 2 )
{ p = *ap;
while ( isidchar(*p) ) putc(*p, out), p++;
if ( ap < bp - 1 ) fputs(", ", out);
}
fputs(") ", out);
/* Put out the argument declarations */
for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';';
fputs(breaks[0], out);
free((char *)breaks);
return 0;
}
recode-3.2.4/mergelex.awk 644 6206 22 6507 5244526106 13022 0ustar djmumd# Conversion of files between different charsets and usages.
# Copyright (C) 1990 Free Software Foundation, Inc.
# Francois Pinard , 1990.
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.


# This awk script merges several lex sources intended for recode.

BEGIN {
TEMP_FILE = "mergelex.tmp"

print "%{"
print "#include \"common.h\""
print "#ifdef USE_FPUTC"
print "#define output(ch) fputc (ch, yyout)"
print "#else"
print "#define output(ch) putc (ch, yyout)"
print "#endif"
print "extern YY_CHAR *yytext;"
print "extern int yyleng;"
print "extern FILE *yyin, *yyout;"
print "%}"
}

# A %{ comment in column 1 signals the start of a new file and of a
# C code section ended by a %} line. This could be followed by a
# few lex definitions.
#
# A %% in column 1 signals the beginning of lex rules.

/^%\{/ {
section = 1
c_code = 1
print
next
}

/^%\}/ {
print
c_code = 0
next
}

/^%%/ {
print "%x X_" step_name
section = 2
next
}

# Remove block C comments. It is assumed that, when a /* comment
# starts in column 1, there is no code following the closing */ on
# its line. Also, remove all white lines.

/^\/\*/ {
while (!match ($0, /\*\//))
getline
next
}

/^[ ]*$/ {
next
}

# In section 1, %{ delimited C code is copied almost verbatim. For
# the `#define STEP' line, the step name is noted and added to the
# list of known step names, and a start declaration will be generated
# later, when the %% will be met.

$1 == "#define" && $2 == "STEP" {
step_name = $3
step_names[$3]++
next
}

c_code {
print
next
}

# Declarations are studied, declarations having the same name are kept
# only if their definition differ, so to generate a lex error later.

/^[^ ]/ && section == 1 {
if ($1 in rules) {
if ($0 == rules[$1]) {
next
}
}
else {
rules[$1] = $0
}
print
next
}

# In section 2, every line is copied to a temporary file. While
# doing so, each lex rule is prefixed by a start name derived from
# the step name.

/^[ ]/ && section == 2 {
print > TEMP_FILE
next
}

section == 2 {
print "" $0 > TEMP_FILE
next
}

# At end, a single %% line is output followed by the contents of the
# temporary file. Then, a second %% is output and followed by
# generated interfaces, one routine for each step name.

END {
print "%%"

close (TEMP_FILE)
while (getline print
close (TEMP_FILE)

print "%%"
for (step_name in step_names) {
print "void"
print step_name " (FILE *input_file, FILE *output_file)"
print "{"
print " yy_init = 1;"
print " yyin = input_file;"
print " yyout = output_file;"
print " BEGIN X_" step_name ";"
print " yylex ();"
print "}"
}
}

recode-3.2.4/recode.texi 644 6206 22 120623 5245753717 12711 0ustar djmumd\input texinfo
@c %**start of header (This is for running Texinfo on a region.)
@settitle @code{recode} reference manual
@setfilename recode.info
@c %**end of header (This is for running Texinfo on a region.)
Copyright @copyright{} 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.

@node Top, Usage, (dir), (dir)
@chapter Conversion of files between different charsets and usages

This @samp{recode} program has the purpose of converting files between
various character sets and usages. When exact transliterations are not
possible, as it is often the case, the program may get rid of the offending
characters or fall back on approximations.

Let us coin the term @dfn{charset} to represent, without distinction, a
character set ``per se'' or a particular usage of a character set. This
program recognizes or produces a little more than a dozen of such charsets.
Since it can convert each charset to almost any other one, more than one
hundred different conversions are possible.

This tool pays special attention to superimposition of diacritics,
particularily for French representation. This orientation is mostly
historical, it does not impair the usefulness, generality or extensibility
of the program. In fact, this program evolved for several years, through
several programming languages and computer brands, because I used a lot of
different coding for French characters on different machines, each system
having its own peculiarities.

You may find in this document:

@menu
* Usage:: How to use this program
* Charsets:: Character sets recognized of produced
* Easy French:: Easy French conventions
* Internals:: Internal aspects
* Future:: Future things

--- The Detailed Node Listing ---

Character sets recognized of produced

* applemac:: ASCII 8-bits for Apple's Macintosh
* ascii:: ASCII 7-bits, @key{BS} to overstrike
* bangbang:: ASCII ``bang bang'', escapes are ! and !!
* cccascii:: ASCII 8-bits as seen by Perkin Elmer
* cdcascii:: ASCII 8-bits a seen by Control Data
* cdcnos:: ASCII 6/12 from NOS, escapes are ^ and @@
* ebcdic:: EBCDIC with no further comments
* flat:: ASCII without diacritics nor underline
* ibmpc:: ASCII 8-bits for IBM's PC
* iconqnx:: ASCII as coded on Unisys' ICON
* latex:: ASCII with LaTeX codes
* latin1:: ASCII extended by Latin Alphabet 1
* texte:: ASCII with easy French conventions

ASCII 7-bits, @key{BS} to overstrike

* Commented ASCII::
* Octal ASCII::
* Decimal ASCII::
* Hexadecimal ASCII::

ASCII ``bang bang'', escapes are ! and !!

* Display Code:: Control Data's Display Code

ASCII extended by Latin Alphabet 1

* Commented Latin-1::
* Octal Latin-1::
* Decimal Latin-1::
* Hexadecimal Latin-1::

Easy French conventions

* French quotes:: How to type them.
* Latin ligatures:: They are not representable.
* Diacritics:: How to type them, things to know.
* Ending diaeresis:: List of words ending with diaeresis.
* Easy French History:: When, How and Who.

Internal aspects

* Main flow:: Overall organization of the program.
* Piping:: Distinction between internal or external piping.
* Limitations:: A few limitations of the choosen implementation.
* New charsets:: How to proceed in adding new charsets.
@end menu

@node Usage, Charsets, Top, Top
@section How to use this program

The general format of the program call is:

@example
recode [@var{OPTION}]@dots{} [@var{before}]:[@var{after}] [@var{file}]@dots{}
@end example

Each file @var{file} will be read assuming it is coded with charset
@var{before}, it will be recoded over itself so to use the charset
@var{after}. If there is no such @var{FILE}, the program rather acts as
a filter and recode standard input to standard output.

The available options are:

@table @code

@item -C
Given this option, all other parameters and options are ignored. The
program prints briefly the Copyright and copying conditions. See the
file @file{COPYING} in the distribution for full statement of the
Copyright and copying conditions.

@item -c
With Easy French conventions, use the column @kbd{:} instead of the
double-quote @kbd{"} for marking diaeresis.
See: @xref{Easy French}.

@item -f
This option is recognized, but otherwise ignored. Eventually, this
option will be necessary for a file to be replaced by its recoded
contents, if it is found that the recoding is not fully reversible. In
this version, the replacement is unconditionnaly done.

@item -i
When the recoding requires a combination of two or more elementary
recoding steps, this option forces many passes over the data, using
intermediate files between passes. This is the default behaviour when
files are recoded over themselves. If this option is selected in filter
mode, that is, when the program reads standard input and writes standard
output, it might take longer for programs further down the pipe chain to
start receiving some recoded data.

@item -o
When the recoding requires a combination of two or more elementary
recoding steps, this option forces the creation of a chain of program
instances initiated through the @code{popen(3)} library call, all
operating in parallel. In filter mode, at cost of some overhead,
recoded data will be available soon after the program starts, even if
many elementary recoding steps are required.

If, at installation time, the @code{popen(3)} call is said to be
unavailable, selecting option @code{-o} is equivalent to selecting
option @code{-i}.

@item -p
When the recoding requires a combination of two or more elementary
recoding steps, this option forces the program to fork itself into a few
copies interconnected with pipes, using the @code{pipe(2)} system call.
All copies of the program operate in parallel. This method is similar
to the method used through option @code{-o}, but is slightly more
efficient. This is the default behaviour in filter mode. If this
option is used when files are recoded over themselves, this should save
some disk accesses and some disk space, at cost of more system overhead.

If, at installation time, the @code{pipe(2)} call is said to be
unavailable, selecting option @code{-p} is equivalent to selecting
option @code{-o}. If both @code{pipe(2)} and @code{popen(3)} are
unavailable, selecting option @code{-p} is equivalent to selecting
option @code{-i}.

@item -t
The @emph{touch} option is meaningful only when files are recoded over
themselves. Without it, the timestamps associated with files are
preserved, to reflect the fact that changing the code of a file does not
really alter its informational contents. When the user wants the
recoded files to be timestamped at the recoding time; this option
inhibits the automatic protection of the timestamps.

@item -v
Before proceeding, the program will print on @file{stderr} the list and
order of application of elementary conversions which are planned to achieve
the global conversion. Then, the program will print on @file{stderr}
one message per @var{file} recoded, so to let the user informed of the
progress of its command.

@end table

One or both of the @var{before} or @var{after} keywords may be omitted,
but the colon which separates them cannot. An omitted keyword implies
the usual or default code in usage on the system where this program is
installed. Usually, this default code is @code{latin1} for UNIX systems
or @code{ibmpc} for MS-DOS machines, but it might be changed to any
other supported code when this program is installed.

@node Charsets, Easy French, Usage, Top
@section Character sets recognized of produced

The possible values for charset @var{before} or charset @var{after} are
provided as the keys in the following menu.

@menu
* applemac:: ASCII 8-bits for Apple's Macintosh
* ascii:: ASCII 7-bits, @key{BS} to overstrike
* bangbang:: ASCII ``bang bang'', escapes are ! and !!
* cccascii:: ASCII 8-bits as seen by Perkin Elmer
* cdcascii:: ASCII 8-bits a seen by Control Data
* cdcnos:: ASCII 6/12 from NOS, escapes are ^ and @@
* ebcdic:: EBCDIC with no further comments
* flat:: ASCII without diacritics nor underline
* ibmpc:: ASCII 8-bits for IBM's PC
* iconqnx:: ASCII as coded on Unisys' ICON
* latex:: ASCII with LaTeX codes
* latin1:: ASCII extended by Latin Alphabet 1
* texte:: ASCII with easy French conventions
@end menu

@node applemac, ascii, Charsets, Charsets
@subsection ASCII 8-bits for Apple's Macintosh

The file has been obtained or is aimed to a Macintosh micro-computer from
Apple. This is an eight bit code. The file is the data fork only.

@node ascii, bangbang, applemac, Charsets
@subsection ASCII 7-bits, @key{BS} to overstrike

The file is straight ASCII, seven bits only. According to the definition
of ASCII: diacritics are applied by a sequence of three characters: the
letter, one @key{BS}, the diacritic mark. We deviate slightly from this
by exchanging the diacritic mark and the letter so, on a screen device, the
diacritic will disappear and let the letter alone. At recognition time,
both methods are acceptable.

The French quotes are coded by the sequences: @kbd{< @key{BS} "} or @kbd{"
@key{BS} <} for the opening quote and @kbd{> @key{BS} "} or @kbd{"
@key{BS} >} for the closing quote. This artifical convention was
inherited in straight @code{ascii} from habits around @code{bangbang}
entry, and is not well known. But we decided to stick to it so that
@code{ascii} charset will not loose French quotes.

@menu
* Commented ASCII::
* Octal ASCII::
* Decimal ASCII::
* Hexadecimal ASCII::
@end menu

@node Commented ASCII, Octal ASCII, ascii, ascii
@subsubsection Commented ASCII

@example
oct dec hex name description

000 0 0 nul null character
001 1 1 soh start of header
002 2 2 stx start of text
003 3 3 etx end of text
004 4 4 eot end of transmission
005 5 5 enq enquiry
006 6 6 ack acknowledge
007 7 7 bel bell
010 8 8 bs back space
011 9 9 ht horizontal tab
012 10 a nl new line
013 11 b vt vertical tab
014 12 c np new page
015 13 d cr carriage return
016 14 e so shift out
017 15 f si shift in
020 16 10 dle data link escape
021 17 11 dc1 device control 1
022 18 12 dc2 device control 2
023 19 13 dc3 device control 3
024 20 14 dc4 device control 4
025 21 15 nak negative acknowledge
026 22 16 syn synchronize
027 23 17 etb end of transmitted block
030 24 18 can cancel
031 25 19 em end of medium
032 26 1a sub substitute
033 27 1b esc escape
034 28 1c fs file separator
035 29 1d gs group separator
036 30 1e rs record separator
037 31 1f us unit separator
040 32 20 sp space

177 127 7f del delete
@end example

@node Octal ASCII, Decimal ASCII, Commented ASCII, ascii
@subsubsection Octal ASCII

@example
000 nul 020 dle 040 sp 060 0 100 @@ 120 P 140 ` 160 p
001 soh 021 dc1 041 ! 061 1 101 A 121 Q 141 a 161 q
002 stx 022 dc2 042 " 062 2 102 B 122 R 142 b 162 r
003 etx 023 dc3 043 # 063 3 103 C 123 S 143 c 163 s
004 eot 024 dc4 044 $ 064 4 104 D 124 T 144 d 164 t
005 enq 025 nak 045 % 065 5 105 E 125 U 145 e 165 u
006 ack 026 syn 046 & 066 6 106 F 126 V 146 f 166 v
007 bel 027 etb 047 ' 067 7 107 G 127 W 147 g 167 w
010 bs 030 can 050 ( 070 8 110 H 130 X 150 h 170 x
011 ht 031 em 051 ) 071 9 111 I 131 Y 151 i 171 y
012 nl 032 sub 052 * 072 : 112 J 132 Z 152 j 172 z
013 vt 033 esc 053 + 073 ; 113 K 133 [ 153 k 173 @{
014 np 034 fs 054 , 074 < 114 L 134 \ 154 l 174 |
015 cr 035 gs 055 - 075 = 115 M 135 ] 155 m 175 @}
016 so 036 rs 056 . 076 > 116 N 136 ^ 156 n 176 ~
017 si 037 us 057 / 077 ? 117 O 137 _ 157 o 177 del
@end example

@node Decimal ASCII, Hexadecimal ASCII, Octal ASCII, ascii
@subsubsection Decimal ASCII

@example
0 nul 16 dle 32 sp 48 0 64 @@ 80 P 96 ` 112 p
1 soh 17 dc1 33 ! 49 1 65 A 81 Q 97 a 113 q
2 stx 18 dc2 34 " 50 2 66 B 82 R 98 b 114 r
3 etx 19 dc3 35 # 51 3 67 C 83 S 99 c 115 s
4 eot 20 dc4 36 $ 52 4 68 D 84 T 100 d 116 t
5 enq 21 nak 37 % 53 5 69 E 85 U 101 e 117 u
6 ack 22 syn 38 & 54 6 70 F 86 V 102 f 118 v
7 bel 23 etb 39 ' 55 7 71 G 87 W 103 g 119 w
8 bs 24 can 40 ( 56 8 72 H 88 X 104 h 120 x
9 ht 25 em 41 ) 57 9 73 I 89 Y 105 i 121 y
10 nl 26 sub 42 * 58 : 74 J 90 Z 106 j 122 z
11 vt 27 esc 43 + 59 ; 75 K 91 [ 107 k 123 @{
12 np 28 fs 44 , 60 < 76 L 92 \ 108 l 124 |
13 cr 29 gs 45 - 61 = 77 M 93 ] 109 m 125 @}
14 so 30 rs 46 . 62 > 78 N 94 ^ 110 n 126 ~
15 si 31 us 47 / 63 ? 79 O 95 _ 111 o 127 del
@end example

@node Hexadecimal ASCII, , Decimal ASCII, ascii
@subsubsection Hexadecimal ASCII

@example
00 nul 10 dle 20 sp 30 0 40 @@ 50 P 60 ` 70 p
01 soh 11 dc1 21 ! 31 1 41 A 51 Q 61 a 71 q
02 stx 12 dc2 22 " 32 2 42 B 52 R 62 b 72 r
03 etx 13 dc3 23 # 33 3 43 C 53 S 63 c 73 s
04 eot 14 dc4 24 $ 34 4 44 D 54 T 64 d 74 t
05 enq 15 nak 25 % 35 5 45 E 55 U 65 e 75 u
06 ack 16 syn 26 & 36 6 46 F 56 V 66 f 76 v
07 bel 17 etb 27 ' 37 7 47 G 57 W 67 g 77 w
08 bs 18 can 28 ( 38 8 48 H 58 X 68 h 78 x
09 ht 19 em 29 ) 39 9 49 I 59 Y 69 i 79 y
0a nl 1a sub 2a * 3a : 4a J 5a Z 6a j 7a z
0b vt 1b esc 2b + 3b ; 4b K 5b [ 6b k 7b @{
0c np 1c fs 2c , 3c < 4c L 5c \ 6c l 7c |
0d cr 1d gs 2d - 3d = 4d M 5d ] 6d m 7d @}
0e so 1e rs 2e . 3e > 4e N 5e ^ 6e n 7e ~
0f si 1f us 2f / 3f ? 4f O 5f _ 6f o 7f del
@end example

@node bangbang, cccascii, ascii, Charsets
@subsection ASCII ``bang bang'', escapes are ! and !!

This is the local code in use on Cybers at Universite de Montreal, which
grave and serious people there prefer to name @dfn{ASCII code display}.
This code is also known as @dfn{Bang-bang}. It is based on a six bits
character set in which capitals, French diacritics and a few others are
coded using an @kbd{!} escape followed by a single character, and control
characters using a double @kbd{!} escape followed by a single
character.

The routines given here presume that the six bits code is already expressed
in ASCII by the communication channel, with embedded ASCII @kbd{!}
escapes.

Here is a table showing which characters are being used to encode each
ASCII character.

@example
000 !!@@ 020 !!P 040 060 0 100 @@ 120 !P 140 !@@ 160 P
001 !!A 021 !!Q 041 !" 061 1 101 !A 121 !Q 141 A 161 Q
002 !!B 022 !!R 042 " 062 2 102 !B 122 !R 142 B 162 R
003 !!C 023 !!S 043 # 063 3 103 !C 123 !S 143 C 163 S
004 !!D 024 !!T 044 $ 064 4 104 !D 124 !T 144 D 164 T
005 !!E 025 !!U 045 % 065 5 105 !E 125 !U 145 E 165 U
006 !!F 026 !!V 046 & 066 6 106 !F 126 !V 146 F 166 V
007 !!G 027 !!W 047 ' 067 7 107 !G 127 !W 147 G 167 W
010 !!H 030 !!X 050 ( 070 8 110 !H 130 !X 150 H 170 X
011 !!I 031 !!Y 051 ) 071 9 111 !I 131 !Y 151 I 171 Y
012 !!J 032 !!Z 052 * 072 : 112 !J 132 !Z 152 J 172 Z
013 !!K 033 !![ 053 + 073 ; 113 !K 133 [ 153 K 173 ![
014 !!L 034 !!\ 054 , 074 < 114 !L 134 \ 154 L 174 !\
015 !!M 035 !!] 055 - 075 = 115 !M 135 ] 155 M 175 !]
016 !!N 036 !!^ 056 . 076 > 116 !N 136 ^ 156 N 176 !^
017 !!O 037 !!_ 057 / 077 ? 117 !O 137 _ 157 O 177 !_
@end example

@menu
* Display Code:: Control Data's Display Code
@end menu

@node Display Code, , bangbang, bangbang
@subsubsection Control Data's Display Code

@example
Octal display code to graphic Octal display code to octal ASCII

00 : 20 P 40 5 60 # 00 072 20 120 40 065 60 043
01 A 21 Q 41 6 61 [ 01 101 21 121 41 066 61 133
02 B 22 R 42 7 62 ] 02 102 22 122 42 067 62 135
03 C 23 S 43 8 63 % 03 103 23 123 43 070 63 045
04 D 24 T 44 9 64 " 04 104 24 124 44 071 64 042
05 E 25 U 45 + 65 _ 05 105 25 125 45 053 65 137
06 F 26 V 46 - 66 ! 06 106 26 126 46 055 66 041
07 G 27 W 47 * 67 & 07 107 27 127 47 052 67 046
10 H 30 X 50 / 70 ' 10 110 30 130 50 057 70 047
11 I 31 Y 51 ( 71 ? 11 111 31 131 51 050 71 077
12 J 32 Z 52 ) 72 < 12 112 32 132 52 051 72 074
13 K 33 0 53 $ 73 > 13 113 33 060 53 044 73 076
14 L 34 1 54 = 74 @@ 14 114 34 061 54 075 74 100
15 M 35 2 55 75 \ 15 115 35 062 55 040 75 134
16 N 36 3 56 , 76 ^ 16 116 36 063 56 054 76 136
17 O 37 4 57 . 77 ; 17 117 37 064 57 056 77 073
@end example

@node cccascii, cdcascii, bangbang, Charsets
@subsection ASCII 8-bits as seen by Perkin Elmer

This charset represents the way Concurrent Computer Corporation (formerly
Perkin Elmer) expresses EBCDIC using ASCII.

@node cdcascii, cdcnos, cccascii, Charsets
@subsection ASCII 8-bits a seen by Control Data

This charset represents the way Control Data Corporation relates EBCDIC to
ASCII. We also select the lower half of this table to do straigth ASCII to
EBCDIC conversions, back and forth.

@node cdcnos, ebcdic, cdcascii, Charsets
@subsection ASCII 6/12 from NOS, escapes are ^ and @@

This is one of the charset in use on CDC Cyber NOS systems to represent
ASCII, sometimes named @dfn{NOS 6/12} code for coding ASCII. This code is
also known as @dfn{caret ASCII}. It is based on a six bits character set
in which small letters and control characters are coded using a @kbd{^}
escape and, sometimes, a @kbd{@@} escape.

The routines given here presume that the six bits code is already expressed
in ASCII by the communication channel, with embedded ASCII @kbd{^} and
@kbd{@@} escapes.

Here is a table showing which characters are being used to encode each
ASCII character.

@example
000 ^5 020 ^# 040 060 0 100 @@A 120 P 140 @@G 160 ^P
001 ^6 021 ^[ 041 ! 061 1 101 A 121 Q 141 ^A 161 ^Q
002 ^7 022 ^] 042 " 062 2 102 B 122 R 142 ^B 162 ^R
003 ^8 023 ^% 043 # 063 3 103 C 123 S 143 ^C 163 ^S
004 ^9 024 ^" 044 $ 064 4 104 D 124 T 144 ^D 164 ^T
005 ^+ 025 ^_ 045 % 065 5 105 E 125 U 145 ^E 165 ^U
006 ^- 026 ^! 046 & 066 6 106 F 126 V 146 ^F 166 ^V
007 ^* 027 ^& 047 ' 067 7 107 G 127 W 147 ^G 167 ^W
010 ^/ 030 ^' 050 ( 070 8 110 H 130 X 150 ^H 170 ^X
011 ^( 031 ^? 051 ) 071 9 111 I 131 Y 151 ^I 171 ^Y
012 ^) 032 ^< 052 * 072 @@D 112 J 132 Z 152 ^J 172 ^Z
013 ^$ 033 ^> 053 + 073 ; 113 K 133 [ 153 ^K 173 ^0
014 ^= 034 ^@@ 054 , 074 < 114 L 134 \ 154 ^L 174 ^1
015 ^ 035 ^\ 055 - 075 = 115 M 135 ] 155 ^M 175 ^2
016 ^, 036 ^^ 056 . 076 > 116 N 136 @@B 156 ^N 176 ^3
017 ^. 037 ^; 057 / 077 ? 117 O 137 _ 157 ^O 177 ^4
@end example

@node ebcdic, flat, cdcnos, Charsets
@subsection EBCDIC with no further comments

This charset is the IBM's external binary coded decimal for interchange
coding. This is an eight bits code.

@node flat, ibmpc, ebcdic, Charsets
@subsection ASCII without diacritics nor underline

This code is ASCII expunged of all diacritics and underlines, as long as
they are applied using three character sequences, with @key{BS} in the
middle. Also, despite slightly unrelated, each control character is
represented by a sequence of two or three graphic characters. The newline
character, however, keeps its functionnality and is not represented.

Note that charset @code{flat} is a terminal charset. We can convert
@emph{to} @code{flat}, but not @emph{from} it.

@node ibmpc, iconqnx, flat, Charsets
@subsection ASCII 8-bits for IBM's PC

The file was obtained or is aimed towards a PC microcomputer from IBM or
any compatible. This is an eight-bit code.

@node iconqnx, latex, ibmpc, Charsets
@subsection ASCII for the Unisys' ICON

The file is using Unisys' ICON way to represent diacritics with 0x19 escape
sequences. This is a seven-bit code, even if eight-bit codes can flow
through as part of IBM-PC charset.

@node latex, latin1, iconqnx, Charsets
@subsection ASCII with LaTeX codes

This charset is an ASCII file coded to be read by La@TeX{} or, in certain
cases, by @TeX{}.

@node latin1, texte, latex, Charsets
@subsection ASCII extended by Latin Alphabet 1

This charset corresponds to the ISO Latin Alphabet 1. It is an eight-bit
code which coincides with ASCII for the lower half.

@menu
* Commented Latin-1::
* Octal Latin-1::
* Decimal Latin-1::
* Hexadecimal Latin-1::
@end menu

@node Commented Latin-1, Octal Latin-1, latin1, latin1
@subsubsection Commented Latin-1

@example
oct dec hex description

240 160 a0 no-break space
241 161 a1 inverted exclamation mark
242 162 a2 cent sign
243 163 a3 pound sign
244 164 a4 currency sign
245 165 a5 yen sign
246 166 a6 broken bar
247 167 a7 paragraph sign, section sign
250 168 a8 diaeresis
251 169 a9 copyright sign
252 170 aa feminine ordinal indicator
253 171 ab left angle quotation mark
254 172 ac not sign
255 173 ad soft hyphen
256 174 ae registered trade mark sign
257 175 af macron
260 176 b0 degree sign
261 177 b1 plus-minus sign
262 178 b2 superscript two
263 179 b3 superscript three
264 180 b4 acute accent
265 181 b5 small greek mu, micro sign
266 182 b6 pilcrow sign
267 183 b7 middle dot
270 184 b8 cedilla
271 185 b9 superscript one
272 186 ba masculine ordinal indicator
273 187 bb right angle quotation mark
274 188 bc vulgar fraction one quarter
275 189 bd vulgar fraction one half
276 190 be vulgar fraction three quarters
277 191 bf inverted question mark
300 192 c0 capital A with grave accent
301 193 c1 capital A with acute accent
302 194 c2 capital A with circumflex accent
303 195 c3 capital A with tilde
304 196 c4 capital A diaeresis
305 197 c5 capital A with ring above
306 198 c6 capital diphthong A with E
307 199 c7 capital C with cedilla
310 200 c8 capital E with grave accent
311 201 c9 capital E with acute accent
312 202 ca capital E with circumflex accent
313 203 cb capital E with diaeresis
314 204 cc capital I with grave accent
315 205 cd capital I with acute accent
316 206 ce capital I with circumflex accent
317 207 cf capital I with diaeresis
320 208 d0 capital icelandic ETH
321 209 d1 capital N with tilde
322 210 d2 capital O with grave accent
323 211 d3 capital O with acute accent
324 212 d4 capital O with circumflex accent
325 213 d5 capital O with tilde
326 214 d6 capital O with diaeresis
327 215 d7 multiplication sign
330 216 d8 capital O with oblique stroke
331 217 d9 capital U with grave accent
332 218 da capital U with acute accent
333 219 db capital U with circumflex accent
334 220 dc capital U with diaeresis
335 221 dd capital Y with acute accent
336 222 de capital icelandic THORN
337 223 df small german sharp s
340 224 e0 small a with grave accent
341 225 e1 small a with acute accent
342 226 e2 small a with circumflex accent
343 227 e3 small a with tilde
344 228 e4 small a with diaeresis
345 229 e5 small a with ring above
346 230 e6 small diphthong a with e
347 231 e7 small c with cedilla
350 232 e8 small e with grave accent
351 233 e9 small e with acute accent
352 234 ea small e with circumflex accent
353 235 eb small e with diaeresis
354 236 ec small i with grave accent
355 237 ed small i with acute accent
356 238 ee small i with circumflex accent
357 239 ef small i with diaeresis
360 240 f0 small icelandic eth
361 241 f1 small n with tilde
362 242 f2 small o with grave accent
363 243 f3 small o with acute accent
364 244 f4 small o with circumflex accent
365 245 f5 small o with tilde
366 246 f6 small o with diaeresis
367 247 f7 division sign
370 248 f8 small o with oblique stroke
371 249 f9 small u with grave accent
372 250 fa small u with acute accent
373 251 fb small u with circumflex accent
374 252 fc small u with diaeresis
375 253 fd small y with acute accent
376 254 fe small icelandic thorn
377 255 ff small y with diaeresis
@end example

@node Octal Latin-1, Decimal Latin-1, Commented Latin-1, latin1
@subsubsection Octal Latin-1

@example
200 220 240 nsp 260 ++ 300 A` 320 DD 340 a` 360 dd
201 221 241 !! 261 +- 301 A' 321 N~ 341 a' 361 n~
202 222 242 c| 262 22 302 A^ 322 O` 342 a^ 362 o`
203 223 243 ## 263 33 303 A~ 323 O' 343 a~ 363 o'
204 224 244 cur 264 @'@' 304 A" 324 O^ 344 a" 364 o^
205 225 245 y- 265 uu 305 A+ 325 O~ 345 a+ 365 o~
206 226 246 || 266 pil 306 AE 326 O" 346 ae 366 o"
207 227 247 $$ 267 .. 307 C, 327 xx 347 c, 367 //
210 230 250 "" 270 ,, 310 E` 330 O/ 350 e` 370 o/
211 231 251 cO 271 11 311 E' 331 U` 351 e' 371 u`
212 232 252 a- 272 o- 312 E^ 332 U' 352 e^ 372 u'
213 233 253 << 273 >> 313 E" 333 U^ 353 e" 373 u^
214 234 254 -. 274 14 314 I` 334 U" 354 i` 374 u"
215 235 255 -- 275 12 315 I' 335 Y' 355 i' 375 y'
216 236 256 tO 276 34 316 I^ 336 PP 356 i^ 376 pp
217 237 257 mac 277 ?? 317 I" 337 ss 357 i" 377 y"
@end example

@node Decimal Latin-1, Hexadecimal Latin-1, Octal Latin-1, latin1
@subsubsection Decimal Latin-1

@example
128 144 160 nsp 176 ++ 192 A` 208 DD 224 a` 240 dd
129 145 161 !! 177 +- 193 A' 209 N~ 225 a' 241 n~
130 146 162 c| 178 22 194 A^ 210 O` 226 a^ 242 o`
131 147 163 ## 179 33 195 A~ 211 O' 227 a~ 243 o'
132 148 164 cur 180 @'@' 196 A" 212 O^ 228 a" 244 o^
133 149 165 y- 181 uu 197 A+ 213 O~ 229 a+ 245 o~
134 150 166 || 182 pil 198 AE 214 O" 230 ae 246 o"
135 151 167 $$ 183 .. 199 C, 215 xx 231 c, 247 //
136 152 168 "" 184 ,, 200 E` 216 O/ 232 e` 248 o/
137 153 169 cO 185 11 201 E' 217 U` 233 e' 249 u`
138 154 170 a- 186 o- 202 E^ 218 U' 234 e^ 250 u'
139 155 171 << 187 >> 203 E" 219 U^ 235 e" 251 u^
140 156 172 -. 188 14 204 I` 220 U" 236 i` 252 u"
141 157 173 -- 189 12 205 I' 221 Y' 237 i' 253 y'
142 158 174 tO 190 34 206 I^ 222 PP 238 i^ 254 pp
143 159 175 mac 191 ?? 207 I" 223 ss 239 i" 255 y"
@end example

@node Hexadecimal Latin-1, , Decimal Latin-1, latin1
@subsubsection Hexadecimal Latin-1

@example
80 90 a0 nsp b0 ++ c0 A` d0 DD e0 a` f0 dd
81 91 a1 !! b1 +- c1 A' d1 N~ e1 a' f1 n~
82 92 a2 c| b2 22 c2 A^ d2 O` e2 a^ f2 o`
83 93 a3 ## b3 33 c3 A~ d3 O' e3 a~ f3 o'
84 94 a4 cur b4 @'@' c4 A" d4 O^ e4 a" f4 o^
85 95 a5 y- b5 uu c5 A+ d5 O~ e5 a+ f5 o~
86 96 a6 || b6 pil c6 AE d6 O" e6 ae f6 o"
87 97 a7 $$ b7 .. c7 C, d7 xx e7 c, f7 //
88 98 a8 "" b8 ,, c8 E` d8 O/ e8 e` f8 o/
89 99 a9 cO b9 11 c9 E' d9 U` e9 e' f9 u`
8a 9a aa a- ba o- ca E^ da U' ea e^ fa u'
8b 9b ab << bb >> cb E" db U^ eb e" fb u^
8c 9c ac -. bc 14 cc I` dc U" ec i` fc u"
8d 9d ad -- bd 12 cd I' dd Y' ed i' fd y'
8e 9e ae tO be 34 ce I^ de PP ee i^ fe pp
8f 9f af mac bf ?? cf I" df ss ef i" ff y"
@end example

@node texte, , latin1, Charsets
@subsection ASCII with easy French conventions

This charset is identical to @code{ascii}, save for French diacritics which
are noted using a slightly different convention.

See @xref{Easy French} for more details.

@node Easy French, Internals, Charsets, Top
@section Easy French conventions

These conventions are used in @code{texte} and @code{latexte} charsets,
which are seven bits codes. At text entry time, these conventions
provide a little speed up. At read time, they slightly improve the
readability. Of course, it would better to have a specialized keyboard
to make direct eight bits entries and fonts for immediately displaying
eight bit ISO Latin-1 characters. But not everybody is so fortunate.
In several mailing environment, the eight bit is often willfully
destroyed (an horrible Crime that most people do not care to straighten
up).

See:
@menu
* French quotes:: How to type them.
* Latin ligatures:: They are not representable.
* Diacritics:: How to type them, things to know.
* Ending diaeresis:: List of words ending with diaeresis.
* Easy French History:: When, How and Who.
@end menu

@node French quotes, Latin ligatures, Easy French, Easy French
@subsection French quotes

French quotes (sometimes called ``angle quotes'') are noted the same way
English quotes are noted in @TeX{}, @emph{id est} by @kbd{``} and
@kbd{''}.

@node Latin ligatures, Diacritics, French quotes, Easy French
@subsection Latin ligatures

No effort has been put to preserve Latin ligatures (@kbd{ae}, @kbd{oe})
which are representable in several other charsets. So, these ligatures may
be lost through Easy French conventions.

@node Diacritics, Ending diaeresis, Latin ligatures, Easy French
@subsection Diacritics

This is almost the French convention for simplified diacritics entry:

@table @kbd
@item e'
Acute accent
@item e`
Grave accent
@item e^
Circumflex accent
@item e"
Diaeresis
@item c,
Cedilla
@end table

In some countries, @kbd{:} is used instead of @kbd{"} to mark diaeresis.
@samp{recode} support one convention on a single call, depending on the
@code{-c} option of the @code{recode} command.

The convention is prone to loosing information, because the diacritic
meaning overloads some characters that already have other uses. To
alleviate this, some knowledge of the French language is insufflated into
the recognition routines. So, the following subtleties are systematically
obeyed by the various recognizers.

@itemize @bullet
@item
A single quote which follows a @kbd{e} does not necessarily means an acute
accent if it is followed by a single other one. For example:

@table @kbd
@item e'
will give an @kbd{e} with an acute accent.
@item e''
will give a simple @kbd{e}, with a closing quotation mark.
@item e'''
will give an @kbd{e} with an acute accent, followed by a closing quotation
mark.
@end table

There is a problem induced by this convention if there are English
citations with a French text. In sentences like:

@quotation
There's a meeting at Archie's restaurant.
@end quotation

the single quotes will be mistaken twice for acute accents. So English
contractions and suffix possessives could be mangled.

@item
A double quote or colon, depending on @code{-c} option, which follows a
vowel is interpreted as diaeresis only if it is followd by another letter.
But there are in French several words that @emph{end} with a diaeresis, the
program also recognizes them.

See @xref{Ending diaeresis} for a study of all the problematic cases.

@item
A comma which follows a @kbd{c} is interpreted as a cedilla only if it is
followd by one of the vowels @kbd{a}, @kbd{o} and @kbd{u}.

@end itemize

@node Ending diaeresis, Easy French History, Diacritics, Easy French
@subsection List of words ending with diaeresis

Here is a classification of all cases of a diaeresis at the end of a French
word:

@itemize @bullet
@item
Words ending in ``igue''

@itemize -
@item
Feminine words without a relative masculine:

@example
besaigue" cigue"
@end example

@item
Feminine words with a relative masculine: (1)

@example
aigue" ambigue" contigue" exigue" subaigue" suraigue"
@end example

@end itemize

@item
Words not ending in ``igue''

@itemize -
@item
Ended by ``i'': (2)

@example
ai" congai" goi" hai"kai" inoui" sai" samurai" thai" tokai"
@end example

@item
Ended by ``e'':

@example
canoe"
@end example

@item
Ended by ``u'': (3)

@example
Esau"
@end example

@end itemize
@end itemize

Notes:

@enumerate
@item
There are supposed to be seven words in this case. So, one is missing.

@item
Look at the following sentence:

@quotation
"Ai"e! Voici le proble`me que j'ai"
@end quotation

or, using the @code{-c} option:

@quotation
Ai:e! Voici le proble`me que j'ai:
@end quotation

There is an ambiguity between an @emph{ai"}, the small animal, and the
indicative future of @emph{avoir} (first person singular), when followed by
what could be a diaeresis mark. Hopefully, the case is solved by the fact
that an apostrophe always precedes the verb and almost never the animal.

@item
I did not pay attention to proper nouns, but this one showed up as being
fairly evident.

@end enumerate

Just to complete this topic, note that it would be wrong to make a rule for
all words ending in ``igue'' as needing a diaerisis. Here are
counter-examples:

@example
becfigue be`sigue bigue bordigue bourdigue brigue contre-digue
digue d'intrigue fatigue figue garrigue gigue igue intrigue
ligue prodigue sarigue zigue
@end example

@node Easy French History, , Ending diaeresis, Easy French
@subsection When, How and Who.

Easy French has been in use in France for a while. Loic Dachary
first exposed me to this particular convention.
I only slightly adapted it (the diaeresis option) to make it more
comfortable to several usages in Que'bec originating from Universite' de
Montre'al.

In fact, the main problem for me was not to necessarily to invent Easy
French, but to recognize the ``best'' convention to use, (best is not
being defined, here) and to try to solve the main pithfalls associated
with the selected convention. I'm particularily grateful to Claude
Goutier <6@@cc.umontreal.ca> whom, through numerous discussions in
August 1988, was quite helpful in evaluating various hypothesis.

@node Internals, Future, Easy French, Top
@section Internal aspects

This information is organized in:

@menu
* Main flow:: Overall organization of the program.
* Piping:: Distinction between internal or external piping.
* Limitations:: A few limitations of the choosen implementation.
* New charsets:: How to proceed in adding new charsets.
@end menu

@node Main flow, Piping, Internals, Internals
@subsection Overall organization

The main driver has a table giving the conversion routines available and
for each, the starting charset and the ending charset. It then tries to
figure out the shortest sequence of conversions that will transform the
input charset into the final charset. Let us consider these charsets as
being the nodes of a directed graph. @samp{recode} has internally a few
elementary recoding methods, called @dfn{single-step}s, each of which may
be considered as oriented arc from one node to the other. A cost is
attributed to each single-step. Given a starting code and a goal code,
@samp{recode} computes the most economical route through the elementary
recodings.

The main part of @samp{recode} is written in C, as are most
single-steps. A few single-steps which need to recognize sequences of
multiple characters are written in @samp{lex}.

@node Piping, Limitations, Main flow, Internals
@subsection Internal vs external piping

Suppose that four elementary steps are selected at path optimization
time. Then @samp{recode} will split itself into four different tasks
interconnected with pipes, logically equivalent to:

@example
step1 output
@end example

@node Limitations, New charsets, Piping, Internals
@subsection Some limitations

Here are some limitations of the program.

@itemize @bullet
@item
There is a limit (currently 10) on the number of steps allowed in one
single recodification work. It should stay sufficient for quite a while,
maybe for ever. This is a simple compilation @code{#define}, in any
case.

@end itemize

@node New charsets, , Limitations, Internals
@subsection Adding new charsets

It is fairly easy for a programmer to add a new charset to @samp{recode}.
All it requires is making two routines, modifying a few tables, and
@code{make}ing @samp{recode} again.

One of the routine should convert from any previous charset to the new
one. Any previous charset will do, but try to select it so you will not
loose too much information while converting. If you have to read
multiple bytes of the old charset before recognizing the character to
produce, you might write this routine in @samp{lex}; otherwize, use C.
Prototype your routine after one of those which exists, so to keep the
sources uniform.

The other routine should convert from the new charset to any older one.
You do not have to select the same old charset than what you selected
for the previous routine. Select any charset for which you will not
loose too much information while converting. If the routine has to read
multiple bytes of the new charset before deciding which character it
will produce, you might write this routine in @samp{lex}; otherwize, use
C. Prototype your routine after one of those which exists, so to keep
the sources uniform.

Edit @file{Makefile} to add the object name of your two routines to the
@code{C_STEPS} or @code{L_STEPS} macro definition, depending on the fact
your routines is written in C or in @samp{lex}. Then edit
@file{steps.h} in the four following places:

@enumerate
@item
Create a symbol for your new charset in @code{enum TYPE_code}
definition.

@item
Add the option name of your new charset in @code{code_keywords}
initialization.

@item
Add two @code{extern} declarations for your routines at the appropriate
places.

@item
Add two lines in @code{single_steps} array initialization to declare your
routines. For each line, include the four following fields:

@enumerate
@item
The function name of your routine.
@item
The starting code @code{enum} constant, that is, the code your routine
@emph{reads}.
@item
The goal code @code{enum} constant, that is, the code your routine
@emph{produces}.
@item
The cost of your routine, using the predefined constants @code{STEP},
@code{LOOSE}, @code{EXACT}, @code{SLOW} and @code{FAST}. See the comments
for the exact meaning of each of these and follow the examples. Respect
these meanings and be honest with the costs!
@end enumerate

In some circumstances, one of your routines would be a mere copy. It is
better in this case to not provide the routine, but still declare it in
@code{single_steps} using @code{NULL} as its function name and
@code{ALREADY} @emph{alone} as its cost.
@end enumerate

@node Future, , Internals, Top
@section Future things

I will be glad to hear critics and suggestions, even for details. This
program is made up of hundreds of details, in fact. Write to
@code{pinard@@iro.umontreal.ca}.

Some notes and suggestions.

@itemize @bullet
@item
Accept abbreviations for charsets on the command call. Accept more
than one conversion with intermediate filters in a single call.

@item
Support Universite de Montreal ``accent'' convention.

@item
Support @code{[nt]roff} diacritics.

@item
Support the Atari-ST internal code.

@item
Segregate charsets and usages.

@item
Is there some way of specifying that recode should not contract
something that looks like an accent? Like "There\'s a meeting at
Archie\'s restaurant"? (With corresponding insertion of backslashes or
whatevers when converting the other way, of course - the transformation
from accented to ascii should be exactly invertable in all cases.)
Of course, There\'s will not be contracted.
@end itemize

@c Local Variables:
@c texinfo-column-for-description: 24
@c End:

@bye
recode-3.2.4/ISO-8859 644 6206 22 14000 5104337535 11502 0ustar djmumdFrom: [email protected] (Erland Sommarskog) (in Stockholm)

* ISO-Latin/1 *

The byte value is in the document represented by a notation
xx/yy, where xx is the upper nibble (four bits), and yy is the lower
nibble (in decimal). The lower part of the table, i.e. positions
02/00 to 07/14 is exactly the same as ASCII.

The upper part of the table contains the characters we can't
live without in large parts of the world. Since I do not know how to
send pictures in a standardised way (is macpaint documents OK?), I
here include a table from ISO No.1:

(Note: This was the draft. See below for more info)

10/00 NO-BREAK SPACE
10/01 INVERTED EXCLAMATION MARK
10/02 CENT SIGN
10/03 POUND SIGN
10/04 CURRENCY SIGN
10/05 YEN SIGN
10/06 BROKEN BAR
10/07 PARAGRAPH SIGN, SECTION SIGN
10/08 DIAERESIS
10/09 COPYRIGHT SIGN
10/10 FEMININE ORDINAL INDICATOR
10/11 LEFT ANGLE QUOTATION MARK
10/12 NOT SIGN
10/13 SOFT HYPHEN
10/14 REGISTERED TRADE MARK SIGN
10/15 MACRON
11/00 DEGREE SIGN
11/01 PLUS-MINUS SIGN
11/02 SUPERSCRIPT TWO
11/03 SUPERSCRIPT THREE
11/04 ACUTE ACCENT
11/05 SMALL GREEK LETTER MU, MICRO SIGN
11/06 PILCROW SIGN
11/07 MIDDLE DOT
11/08 CEDILLA
11/09 SUPERSCRIPT ONE
11/10 MASCULINE ORDINAL INDICATOR
11/11 RIGHT ANGLE QUOTATION MARK
11/12 VULGAR FRACTION ONE QUARTER
11/13 VULGAR FRACTION ONE HALF
11/14 VULGAR FRACTION THREE QUARTERS
11/15 INVERTED QUESTION MARK
12/00 CAPITAL LETTER A WITH GRAVE ACCENT
12/01 CAPITAL LETTER A WITH ACUTE ACCENT
12/02 CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
12/03 CAPITAL LETTER A WITH TILDE
12/04 CAPITAL LETTER A DIAERESIS
12/05 CAPITAL LETTER A WITH RING ABOVE
12/06 CAPITAL DIPHTHONG A WITH E
12/07 CAPITAL LETTER C WITH CEDILLA
12/08 CAPITAL LETTER E WITH GRAVE ACCENT
12/09 CAPITAL LETTER E WITH ACUTE ACCENT
12/10 CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
12/11 CAPITAL LETTER E WITH DIAERESIS
12/12 CAPITAL LETTER I WITH GRAVE ACCENT
12/13 CAPITAL LETTER I WITH ACUTE ACCENT
12/14 CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
12/15 CAPITAL LETTER I WITH DIAERESIS
13/00 CAPITAL ICELANDIC LETTER ETH
13/01 CAPITAL LETTER N WITH TILDE
13/02 CAPITAL LETTER O WITH GRAVE ACCENT
13/03 CAPITAL LETTER O WITH ACUTE ACCENT
13/04 CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
13/05 CAPITAL LETTER O WITH TILDE
13/06 CAPITAL LETTER O WITH DIAERESIS
13/07 (This position shall not be used)
13/08 CAPITAL LETTER O WITH OBLIQUE STROKE
13/09 CAPITAL LETTER U WITH GRAVE ACCENT
13/10 CAPITAL LETTER U WITH ACUTE ACCENT
13/11 CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
13/12 CAPITAL LETTER U WITH DIAERESIS
13/13 CAPITAL LETTER Y WITH ACUTE ACCENT
13/14 CAPITAL ICELANDIC LETTER THORN
13/15 SMALL GERMAN LETTER SHARP s
14/00 SMALL LETTER a WITH GRAVE ACCENT
14/01 SMALL LETTER a WITH ACUTE ACCENT
14/02 SMALL LETTER a WITH CIRCUMFLEX ACCENT
14/03 SMALL LETTER a WITH TILDE
14/04 SMALL LETTER a WITH DIAERESIS
14/05 SMALL LETTER a WITH RING ABOVE
14/06 SMALL DIPHTHONG a WITH e
14/07 SMALL LETTER c WITH CEDILLA
14/08 SMALL LETTER e WITH GRAVE ACCENT
14/09 SMALL LETTER e WITH ACUTE ACCENT
14/10 SMALL LETTER e WITH CIRCUMFLEX ACCENT
14/11 SMALL LETTER e WITH DIAERESIS
14/12 SMALL LETTER i WITH GRAVE ACCENT
14/13 SMALL LETTER i WITH ACUTE ACCENT
14/14 SMALL LETTER i WITH CIRCUMFLEX ACCENT
14/15 SMALL LETTER i WITH DIAERESIS
15/00 SMALL ICELANDIC LETTER ETH
15/01 SMALL LETTER n WITH TILDE
15/02 SMALL LETTER o WITH GRAVE ACCENT
15/03 SMALL LETTER o WITH ACUTE ACCENT
15/04 SMALL LETTER o WITH CIRCUMFLEX ACCENT
15/05 SMALL LETTER o WITH TILDE
15/06 SMALL LETTER o WITH DIAERESIS
15/07 (This position shall not be used)
15/08 SMALL LETTER o WITH OBLIQUE STROKE
15/09 SMALL LETTER u WITH GRAVE ACCENT
15/10 SMALL LETTER u WITH ACUTE ACCENT
15/11 SMALL LETTER u WITH CIRCUMFLEX ACCENT
15/12 SMALL LETTER u WITH DIAERESIS
15/13 SMALL LETTER y WITH ACUTE ACCENT
15/14 SMALL ICELANDIC LETTER THORN
15/15 SMALL LETTER y WITH DIAERESIS

End of table

--------------------------------

Note from [email protected] (Tim Lasko) about ISO-Latin/1:

ISO Latin-1, or more completely ISO Latin Alphabet No 1, is now an
international standard as of February 1987 (IS 8859, Part 1).
For those American USEnet'rs that care, the 8-bit ASCII standard,
which is essentially the same code, is going through the final
administrative processes prior to publication.

The code table that was posted earlier by Mr. Sommarskog to the net is from
an earlier draft of the standard, the following changes have been made:

OLD DRAFT:

13/07 (This position shall not be used)
15/07 (This position shall not be used)

FINAL STANDARD:

13/07 MULTIPLICATION SIGN
15/07 DIVISION SIGN

Those two characters were added mainly out of the fear that individual vendors
would use the positions for non-interchangeable and incompatible purposes,
thus defeating the idea of the standard. The two symbols chosen were more
or less a compromise from a large list of eligible characters.

ISO Latin-1 (IS 8859/1) is actually one of an entire family of eight-bit
one-byte character sets, all having ASCII on the left hand side, and with
varying repertoires on the right hand side:

Pt 1. Latin Alphabet No 1 (caters to Western Europe - now approved)
Pt 2. Latin Alphabet No 2 (caters to Eastern Europe - now approved)
Pt 3. Latin Alphabet No 3 (caters to SE Europe + others - in draft ballot)
Pt 4. Latin Alphabet No 4 (caters to Northern Europe - in draft ballot)
Pt 5. Latin-Cyrillic alphabet (right half all Cyrillic - processing
currently suspended pending USSR input)
Pt 6. Latin-Arabic alphabet (right half all Arabic - now approved)
Pt 7. Latin-Greek alphabet (right half Greek + symbols - in draft ballot)
Pt 8. Latin-Hebrew alphabet (right half Hebrew + symbols - proposed)

I expect to update this list shortly, because next week I'm attending the
meeting of the ISO Working Group concerned with these standards is being held.
(ISO TC97/SC2/WG3 for those that can decipher that.)
recode-3.2.4/texinfo.tex 444 6206 22 341662 5251247257 12753 0ustar djmumd%% TeX macros to handle texinfo files

% Copyright (C) 1985, 86, 88, 90, 91, 92 Free Software Foundation, Inc.

%This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
%to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
%USA.


%In other words, you are welcome to use, share and improve this program.
%You are forbidden to forbid anyone else to use, share and improve
%what you give them. Help stamp out software-hoarding!

\def\texinfoversion{2.81}
\message{Loading texinfo package [Version \texinfoversion]:}
\message{}

% Print the version number if in a .fmt file.
\everyjob{\message{[Texinfo version \texinfoversion]}\message{}}

% Save some parts of plain tex whose names we will redefine.

\let\ptexlbrace=\{
\let\ptexrbrace=\}
\let\ptexdots=\dots
\let\ptexdot=\.
\let\ptexstar=\*
\let\ptexend=\end
\let\ptexbullet=\bullet
\let\ptexb=\b
\let\ptexc=\c
\let\ptexi=\i
\let\ptext=\t
\let\ptexl=\l
\let\ptexL=\L

\def\tie{\penalty 10000\ } % Save plain tex definition of ~.

\message{Basics,}
\chardef\other=12

% If this character appears in an error message or help string, it
% starts a new line in the output.
\newlinechar = `^^J

% Ignore a token.
%
\def\gobble#1{}

\hyphenation{ap-pen-dix}
\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell}

% Margin to add to right of even pages, to left of odd pages.
\newdimen \bindingoffset \bindingoffset=0pt
\newdimen \normaloffset \normaloffset=\hoffset
\newdimen\pagewidth \newdimen\pageheight
\pagewidth=\hsize \pageheight=\vsize

% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
% since that produces some useless output on the terminal.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
\def\loggingall{\tracingcommands2 \tracingstats2
\tracingpages1 \tracingoutput1 \tracinglostchars1
\tracingmacros2 \tracingparagraphs1 \tracingrestores1
\showboxbreadth\maxdimen\showboxdepth\maxdimen
}%

%---------------------Begin change-----------------------
%
%%%% For @cropmarks command.
% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
%
\newdimen\cornerlong \newdimen\cornerthick
\newdimen \topandbottommargin
\newdimen \outerhsize \newdimen \outervsize
\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
\outerhsize=7in
%\outervsize=9.5in
% Alternative @smallbook page size is 9.25in
\outervsize=9.25in
\topandbottommargin=.75in
%
%---------------------End change-----------------------

% \onepageout takes a vbox as an argument. Note that \pagecontents
% does insertions itself, but you have to call it yourself.
\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
\def\onepageout#1{\hoffset=\normaloffset
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
{\escapechar=`\\\relax % makes sure backslash is used in output files.
\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
{\let\hsize=\pagewidth \makefootline}}}%
\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}

%%%% For @cropmarks command %%%%

% Here is a modification of the main output routine for Near East Publications
% This provides right-angle cropmarks at all four corners.
% The contents of the page are centerlined into the cropmarks,
% and any desired binding offset is added as an \hskip on either
% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
%
\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
\shipout
\vbox to \outervsize{\hsize=\outerhsize
\vbox{\line{\ewtop\hfill\ewtop}}
\nointerlineskip
\line{\vbox{\moveleft\cornerthick\nstop}
\hfill
\vbox{\moveright\cornerthick\nstop}}
\vskip \topandbottommargin
\centerline{\ifodd\pageno\hskip\bindingoffset\fi
\vbox{
{\let\hsize=\pagewidth \makeheadline}
\pagebody{#1}
{\let\hsize=\pagewidth \makefootline}}
\ifodd\pageno\else\hskip\bindingoffset\fi}
\vskip \topandbottommargin plus1fill minus1fill
\boxmaxdepth\cornerthick
\line{\vbox{\moveleft\cornerthick\nsbot}
\hfill
\vbox{\moveright\cornerthick\nsbot}}
\nointerlineskip
\vbox{\line{\ewbot\hfill\ewbot}}
}
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi}
%
% Do @cropmarks to get crop marks
\def\cropmarks{\let\onepageout=\croppageout }

\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
{\catcode`\@ =11
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
\dimen@=\dp#1 \unvbox#1
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}

%
% Here are the rules for the cropmarks. Note that they are
% offset so that the space between them is truly \outerhsize or \outervsize
% (P. A. MacKay, 12 November, 1986)
%
\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
\def\nstop{\vbox
{\hrule height\cornerthick depth\cornerlong width\cornerthick}}
\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
\def\nsbot{\vbox
{\hrule height\cornerlong depth\cornerthick width\cornerthick}}

% Parse an argument, then pass it to #1. The argument is the rest of
% the input line (except we remove a trailing comment). #1 should be a
% macro which expects an ordinary undelimited TeX argument.
%
\def\parsearg#1{%
\let\next = #1%
\begingroup
\obeylines
\futurelet\temp\parseargx
}

% If the next token is an obeyed space (from an @example environment or
% the like), remove it and recurse. Otherwise, we're done.
\def\parseargx{%
\ifx\obeyedspace\temp
\expandafter\parseargdiscardspace
\else
\expandafter\parseargline
\fi
}

% Remove a single space (as the delimiter token to the macro call).
{\obeyspaces %
\gdef\parseargdiscardspace {\futurelet\temp\parseargx}}

\gdef\obeyedspace{\ }

{\obeylines %
\gdef\parseargline#1^^M{%
\endgroup % End of the group started in \parsearg.
%
% First remove any @c comment, then any @comment.
% Result of each macro is put in \toks0.
\argremovec #1\c\relax %
\expandafter\argremovecomment \the\toks0 \comment\relax %
%
% Call the caller's macro, saved as \next in \parsearg.
\expandafter\next\expandafter{\the\toks0}%
}%
}

% Since all \c{,omment} does is throw away the argument, we can let TeX
% do that for us. The \relax here is matched by the \relax in the call
% in \parseargline; it could be more or less anything, its purpose is
% just to delimit the argument to the \c.
\def\argremovec#1\c#2\relax{\toks0 = {#1}}
\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}

% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
% @end itemize @c foo
% will have two active spaces as part of the argument with the
% `itemize'. Here we remove all active spaces from #1, and assign the
% result to \toks0.
%
% This loses if there are any *other* active characters besides spaces
% in the argument -- _ ^ +, for example -- since they get expanded.
% Fortunately, Texinfo does not define any such commands. (If it ever
% does, the catcode of the characters in questionwill have to be changed
% here.) But this means we cannot call \removeactivespaces as part of
% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
% that \parsearg gets might well have any character at all in it.
%
\def\removeactivespaces#1{%
\begingroup
\ignoreactivespaces
\edef\temp{#1}%
\global\toks0 = \expandafter{\temp}%
\endgroup
}

% Change the active space to expand to nothing.
%
\begingroup
\obeyspaces
\gdef\ignoreactivespaces{\obeyspaces\let =\empty}
\endgroup


\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}

%% These are used to keep @begin/@end levels from running away
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
\ifENV\errmessage{Still within an environment. Type Return to continue.}
\endgroup\fi} % This is not perfect, but it should reduce lossage

% @begin foo is the same as @foo, for now.
\newhelp\EMsimple{Type to continue.}

\outer\def\begin{\parsearg\beginxxx}

\def\beginxxx #1{%
\expandafter\ifx\csname #1\endcsname\relax
{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
\csname #1\endcsname\fi}

% @end foo executes the definition of \Efoo.
%
\def\end{\parsearg\endxxx}
\def\endxxx #1{%
\removeactivespaces{#1}%
\edef\endthing{\the\toks0}%
%
\expandafter\ifx\csname E\endthing\endcsname\relax
\expandafter\ifx\csname \endthing\endcsname\relax
% There's no \foo, i.e., no ``environment'' foo.
\errhelp = \EMsimple
\errmessage{Undefined command `@end \endthing'}%
\else
% There is an environment foo, but it hasn't been started.
\errhelp = \EMsimple
\errmessage{This `@end \endthing' doesn't have a matching `@\endthing'}%
\fi
\else
% Everything's ok; the right environment has been started.
\csname E\endthing\endcsname
\fi
}


% Single-spacing is done by various environments.

\newskip\singlespaceskip \singlespaceskip = \baselineskip
\def\singlespace{%
{\advance \baselineskip by -\singlespaceskip
\kern \baselineskip}%
\baselineskip=\singlespaceskip
}

%% Simple single-character @ commands

% @@ prints an @
% Kludge this until the fonts are right (grr).
\def\@{{\tt \char '100}}

% Define @` and @' to be the same as ` and '
% but suppressing ligatures.
\def\`{{`}}
\def\'{{'}}

% Used to generate quoted braces.

\def\mylbrace {{\tt \char '173}}
\def\myrbrace {{\tt \char '175}}
\let\{=\mylbrace
\let\}=\myrbrace

% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }

% @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces}

% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }

% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
% produce a whole line of output instead of starting the paragraph.
\def\w#1{\leavevmode\hbox{#1}}

% @group ... @end group forces ... to be all on one page, by enclosing
% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
% to keep its height that of a normal line. According to the rules for
% \topskip (p.114 of the TeXbook), the glue inserted is
% max (\topskip - \ht (first item), 0). If that height is large,
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
%
\def\group{\begingroup
\ifnum\catcode13=\active \else
\errhelp = \groupinvalidhelp
\errmessage{@group invalid in context where filling is enabled}%
\fi
%
% If we don't do the \strut ... \nointerlineskip, we wind up with a
% box with a large depth, and hence get (typically) \lineskip leading
% (1pt), instead of the usual interline space (\baselineskip). See
% p.82 of the TeXbook.
\def\Egroup{%
\strut % Put in the normal leading.
\egroup % End the \vtop.
\endgroup % End the \group.
\nointerlineskip % We inserted our own leading.
}%
%
\vtop\bgroup
% We do @comment here in case we are called inside an environment,
% such as @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
% the `@group' to put extra space in the output. Since @group
% should appear on a line by itself (according to the Texinfo
% manual), we don't worry about eating any user text.
\comment
}
%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% message, so this ends up printing `@group can only ...'.
%
\newhelp\groupinvalidhelp{%
group can only be used in environments such as @example,^^J%
where each line of input produces a line of output.}

% @need space-in-mils
% forces a page break if there is not space-in-mils remaining.

\newdimen\mil \mil=0.001in

\def\need{\parsearg\needx}

% Old definition--didn't work.
%\def\needx #1{\par %
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
%\prevdepth=-1000pt
%}}

\def\needx#1{%
% Go into vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
% Don't add any leading before our big empty box, but allow a page
% break, since the best break might be right here.
\allowbreak
\nointerlineskip
\vtop to #1\mil{\vfil}%
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
% empty box we just added fits on the page, we must make it consider
% page breaks. On the other hand, we don't want to actually break the
% page after the empty box. So we use a penalty of 9999.
%
% There is an extremely small chance that TeX will actually break the
% page at this \penalty, if there are no other feasible breakpoints in
% sight. (If the user is using lots of big @group commands, which
% almost-but-not-quite fill up a page, TeX will have a hard time doing
% good page breaking, for example.) However, I could not construct an
% example where a page broke at this \penalty; if it happens in a real
% document, then we can reconsider our strategy.
\penalty9999
%
% Back up by the size of the box, whether we did a page break or not.
\kern -#1\mil
%
% Do not allow a page break right after this kern.
\nobreak
}

% @br forces paragraph break

\let\br = \par

% @dots{} output some dots

\def\dots{$\ldots$}

% @page forces the start of a new page

\def\page{\par\vfill\supereject}

% @exdent text....
% outputs text on separate line in roman font, starting at standard page margin

% This records the amount of indent in the innermost environment.
% That's how much \exdent should take out.
\newskip\exdentamount

% This defn is used inside fill environments such as @defun.
\def\exdent{\parsearg\exdentyyy}
\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}

% This defn is used inside nofill environments such as @example.
\def\nofillexdent{\parsearg\nofillexdentyyy}
\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
\leftline{\hskip\leftskip{\rm#1}}}}

%\hbox{{\rm#1}}\hfil\break}}

% @include file insert text of that file as input.

\def\include{\parsearg\includezzz}
\def\includezzz #1{{\def\thisfile{#1}\input #1
}}

\def\thisfile{}

% @center line outputs that line, centered

\def\center{\parsearg\centerzzz}
\def\centerzzz #1{{\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\centerline{#1}}}

% @sp n outputs n lines of vertical space

\def\sp{\parsearg\spxxx}
\def\spxxx #1{\par \vskip #1\baselineskip}

% @comment ...line which is ignored...
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment

\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
\parsearg \commentxxx}

\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }

\let\c=\comment

% Prevent errors for section commands.
% Used in @ignore and in failing conditionals.
\def\ignoresections{%
\let\chapter=\relax
\let\unnumbered=\relax
\let\top=\relax
\let\unnumberedsec=\relax
\let\unnumberedsection=\relax
\let\unnumberedsubsec=\relax
\let\unnumberedsubsection=\relax
\let\unnumberedsubsubsec=\relax
\let\unnumberedsubsubsection=\relax
\let\section=\relax
\let\subsec=\relax
\let\subsubsec=\relax
\let\subsection=\relax
\let\subsubsection=\relax
\let\appendix=\relax
\let\appendixsec=\relax
\let\appendixsection=\relax
\let\appendixsubsec=\relax
\let\appendixsubsection=\relax
\let\appendixsubsubsec=\relax
\let\appendixsubsubsection=\relax
\let\contents=\relax
\let\smallbook=\relax
\let\titlepage=\relax
}

\def\ignore{\begingroup\ignoresections
% Make sure that spaces turn into tokens that match what \ignorexxx wants.
\catcode32=10
\ignorexxx}
\long\def\ignorexxx #1\end ignore{\endgroup\ignorespaces}

\def\direntry{\begingroup\direntryxxx}
\long\def\direntryxxx #1\end direntry{\endgroup\ignorespaces}

% Conditionals to test whether a flag is set.

\def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}

\def\ifsetxxx #1{\endgroup
\expandafter\ifx\csname SET#1\endcsname\relax \let\temp=\ifsetfail
\else \let\temp=\relax \fi
\temp}
\def\Eifset{}
\def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
\long\def\ifsetfailxxx #1\end ifset{\endgroup\ignorespaces}

\def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}

\def\ifclearxxx #1{\endgroup
\expandafter\ifx\csname SET#1\endcsname\relax \let\temp=\relax
\else \let\temp=\ifclearfail \fi
\temp}
\def\Eifclear{}
\def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
\long\def\ifclearfailxxx #1\end ifclear{\endgroup\ignorespaces}

% @set foo
% to set the flag named foo to a default value (empty)
% @set foo REST-OF-LINE
% to set the flag named foo to a text string REST-OF-LINE
% @clear foo to clear the flag named foo.
% @value{foo} to set the text saved in foo
%
% @set command, work macro \setyyy
%
\def\setyyy#1 #2\endsetyyy{\expandafter\xdef\csname SET#1\endcsname{#2\unskip}}
%
\def\setxxx#1{\setyyy#1 \endsetyyy}
\def\set{\parsearg\setxxx}

\def\clear{\parsearg\clearxxx}
\def\clearxxx #1{
\expandafter\let\csname SET#1\endcsname=\relax}

\def\value#1{\expandafter
\ifx\csname SET#1\endcsname\relax
{\{No value for ``#1''\}}
\else \csname SET#1\endcsname \fi}

% Some texinfo constructs that are trivial in tex

\def\iftex{}
\def\Eiftex{}
\def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
\long\def\ifinfoxxx #1\end ifinfo{\endgroup\ignorespaces}

\long\def\menu #1\end menu{}
\def\asis#1{#1}

% @math means output in math mode.
% We don't use $'s directly in the definition of \math because control
% sequences like \math are expanded when the toc file is written. Then,
% we read the toc file back, the $'s will be normal characters (as they
% should be, according to the definition of Texinfo). So we must use a
% control sequence to switch into and out of math mode.
%
% This isn't quite enough for @math to work properly in indices, but it
% seems unlikely it will ever be needed there.
%
\let\implicitmath = $
\def\math#1{\implicitmath #1\implicitmath}

\def\node{\ENVcheck\parsearg\nodezzz}
\def\nodezzz#1{\nodexxx [#1,]}
\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
\let\lastnode=\relax

\def\donoderef{\ifx\lastnode\relax\else
\expandafter\expandafter\expandafter\setref{\lastnode}\fi
\let\lastnode=\relax}

\def\unnumbnoderef{\ifx\lastnode\relax\else
\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
\let\lastnode=\relax}

\def\appendixnoderef{\ifx\lastnode\relax\else
\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
\let\lastnode=\relax}

\let\refill=\relax

% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
\readauxfile
\opencontents
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
\comment % Ignore the actual filename.
}

\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}

\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}},
node \samp{\losespace#1{}}}
\def\losespace #1{#1}

\message{fonts,}

% Font-change commands.

% Texinfo supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
\let\li = \sf % Sometimes we call it \li, not \sf.

%% Try out Computer Modern fonts at \magstephalf
\let\mainmagstep=\magstephalf

\ifx\bigger\relax
\let\mainmagstep=\magstep1
\font\textrm=cmr12
\font\texttt=cmtt12
\else
\font\textrm=cmr10 scaled \mainmagstep
\font\texttt=cmtt10 scaled \mainmagstep
\fi
% Instead of cmb10, you many want to use cmbx10.
% cmbx10 is a prettier font on its own, but cmb10
% looks better when embedded in a line with cmr10.
\font\textbf=cmb10 scaled \mainmagstep
\font\textit=cmti10 scaled \mainmagstep
\font\textsl=cmsl10 scaled \mainmagstep
\font\textsf=cmss10 scaled \mainmagstep
\font\textsc=cmcsc10 scaled \mainmagstep
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep

% A few fonts for @defun, etc.
\font\defbf=cmbx10 scaled \magstep1 %was 1314
\font\deftt=cmtt10 scaled \magstep1
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}

% Fonts for indices and small examples.
% We actually use the slanted font rather than the italic,
% because texinfo normally uses the slanted fonts for that.
% Do not make many font distinctions in general in the index, since they
% aren't very useful.
\font\ninett=cmtt9
\font\indrm=cmr9
\font\indit=cmsl9
\let\indsl=\indit
\let\indtt=\ninett
\let\indsf=\indrm
\let\indbf=\indrm
\let\indsc=\indrm
\font\indi=cmmi9
\font\indsy=cmsy9

% Fonts for headings
\font\chaprm=cmbx12 scaled \magstep2
\font\chapit=cmti12 scaled \magstep2
\font\chapsl=cmsl12 scaled \magstep2
\font\chaptt=cmtt12 scaled \magstep2
\font\chapsf=cmss12 scaled \magstep2
\let\chapbf=\chaprm
\font\chapsc=cmcsc10 scaled\magstep3
\font\chapi=cmmi12 scaled \magstep2
\font\chapsy=cmsy10 scaled \magstep3

\font\secrm=cmbx12 scaled \magstep1
\font\secit=cmti12 scaled \magstep1
\font\secsl=cmsl12 scaled \magstep1
\font\sectt=cmtt12 scaled \magstep1
\font\secsf=cmss12 scaled \magstep1
\font\secbf=cmbx12 scaled \magstep1
\font\secsc=cmcsc10 scaled\magstep2
\font\seci=cmmi12 scaled \magstep1
\font\secsy=cmsy10 scaled \magstep2

% \font\ssecrm=cmbx10 scaled \magstep1 % This size an font looked bad.
% \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
% \font\ssecsl=cmsl10 scaled \magstep1
% \font\ssectt=cmtt10 scaled \magstep1
% \font\ssecsf=cmss10 scaled \magstep1

%\font\ssecrm=cmb10 scaled 1315 % Note the use of cmb rather than cmbx.
%\font\ssecit=cmti10 scaled 1315 % Also, the size is a little larger than
%\font\ssecsl=cmsl10 scaled 1315 % being scaled magstep1.
%\font\ssectt=cmtt10 scaled 1315
%\font\ssecsf=cmss10 scaled 1315

%\let\ssecbf=\ssecrm

\font\ssecrm=cmbx12 scaled \magstephalf
\font\ssecit=cmti12 scaled \magstephalf
\font\ssecsl=cmsl12 scaled \magstephalf
\font\ssectt=cmtt12 scaled \magstephalf
\font\ssecsf=cmss12 scaled \magstephalf
\font\ssecbf=cmbx12 scaled \magstephalf
\font\ssecsc=cmcsc10 scaled \magstep1
\font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled \magstep1
% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
% but that is not a standard magnification.

% Fonts for title page:
\font\titlerm = cmbx12 scaled \magstep3
\let\authorrm = \secrm

% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since
% texinfo doesn't allow for producing subscripts and superscripts, we
% don't bother to reset \scriptfont and \scriptscriptfont (which would
% also require loading a lot more fonts).
%
\def\resetmathfonts{%
\textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
\textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
\textfont\ttfam = \tentt \textfont\sffam = \tensf
}


% The font-changing commands redefine the meanings of \tenSTYLE, instead
% of just \STYLE. We do this so that font changes will continue to work
% in math mode, where it is the current \fam that is relevant in most
% cases, not the current. Plain TeX does, for example,
% \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need
% to redefine \bf itself.
\def\textfonts{%
\let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
\resetmathfonts}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
\resetmathfonts}
\def\secfonts{%
\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
\let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
\resetmathfonts}
\def\subsecfonts{%
\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
\resetmathfonts}
\def\indexfonts{%
\let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
\let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
\let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
\resetmathfonts}

% Set up the default fonts, so we can use them for creating boxes.
%
\textfonts

% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0

% Fonts for short table of contents.
\font\shortcontrm=cmr12
\font\shortcontbf=cmbx12
\font\shortcontsl=cmsl12

%% Add scribe-like font environments, plus @l for inline lisp (usually sans
%% serif) and @ii for TeX italic

% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}

\let\i=\smartitalic
\let\var=\smartitalic
\let\dfn=\smartitalic
\let\emph=\smartitalic
\let\cite=\smartitalic

\def\b#1{{\bf #1}}
\let\strong=\b

\def\t#1{{\tt \exhyphenpenalty=10000\rawbackslash \frenchspacing #1}\null}
\let\ttfont = \t
%\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
\def\samp #1{`\tclose{#1}'\null}
\def\key #1{{\tt \exhyphenpenalty=10000\uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}

\let\file=\samp

% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
\newdimen\tclosesave
\newdimen\tcloserm
\def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
\fontdimen2\font=\tcloserm
% prevent breaking lines at hyphens.
\exhyphenpenalty=10000
\def\ {{\fontdimen2\font=\tclosesave{} }}%
\rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
\let\code=\tclose
%\let\exp=\tclose %Was temporary

% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.

\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
\else\tclose{\look}\fi
\else\tclose{\look}\fi}

% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
% argument is to make the input look right: @dmn{pt} instead of
% @dmn{}pt.
%
\def\dmn#1{\thinspace #1}

\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}

\def\l#1{{\li #1}\null} %

\def\r#1{{\rm #1}} % roman font
% Use of \lowercase was suggested.
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font

\message{page headings,}

\newskip\titlepagetopglue \titlepagetopglue = 1.5in
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc

% First the title page. Must do @settitle before @titlepage.
\def\titlefont#1{{\titlerm #1}}

\newtoks\realeverypar
\newif\ifseenauthor
\newif\iffinishedtitlepage

\def\titlepage{\begingroup \parindent=0pt \textfonts
\let\subtitlerm=\tenrm
% I deinstalled the following change because \cmr12 is undefined.
% This change was not in the ChangeLog anyway. --rms.
% \let\subtitlerm=\cmr12
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
%
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
%
% Leave some space at the very top of the page.
\vglue\titlepagetopglue
%
% Now you can print the title using @title.
\def\title{\parsearg\titlezzz}%
\def\titlezzz##1{\leftline{\titlefont{##1}}
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt \vskip4pt}%
% No rule at page bottom unless we print one at the top with @title.
\finishedtitlepagetrue
%
% Now you can put text using @subtitle.
\def\subtitle{\parsearg\subtitlezzz}%
\def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
%
% @author should come last, but may come many times.
\def\author{\parsearg\authorzzz}%
\def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
{\authorfont \leftline{##1}}}%
%
% Most title ``pages'' are actually two pages long, with space
% at the top of the second. We don't want the ragged left on the second.
\let\oldpage = \page
\def\page{%
\iffinishedtitlepage\else
\finishtitlepage
\fi
\oldpage
\let\page = \oldpage
\hbox{}}%
% \def\page{\oldpage \hbox{}}
}

\def\Etitlepage{%
\iffinishedtitlepage\else
\finishtitlepage
\fi
% It is important to do the page break before ending the group,
% because the headline and footline are only empty inside the group.
% If we use the new definition of \page, we always get a blank page
% after the title page, which we certainly don't want.
\oldpage
\endgroup
\HEADINGSon
}

\def\finishtitlepage{%
\vskip4pt \hrule height 2pt
\vskip\titlepagebottomglue
\finishedtitlepagetrue
}

%%% Set up page headings and footings.

\let\thispage=\folio

\newtoks \evenheadline % Token sequence for heading line of even pages
\newtoks \oddheadline % Token sequence for heading line of odd pages
\newtoks \evenfootline % Token sequence for footing line of even pages
\newtoks \oddfootline % Token sequence for footing line of odd pages

% Now make Tex use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
\else \the\evenheadline \fi}}
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
\else \the\evenfootline \fi}\HEADINGShook}
\let\HEADINGShook=\relax

% Commands to set those variables.
% For example, this is what @headings on does
% @evenheading @thistitle|@thispage|@thischapter
% @oddheading @thischapter|@thispage|@thistitle
% @evenfooting @thisfile||
% @oddfooting ||@thisfile

\def\evenheading{\parsearg\evenheadingxxx}
\def\oddheading{\parsearg\oddheadingxxx}
\def\everyheading{\parsearg\everyheadingxxx}

\def\evenfooting{\parsearg\evenfootingxxx}
\def\oddfooting{\parsearg\oddfootingxxx}
\def\everyfooting{\parsearg\everyfootingxxx}

{\catcode`\@=0 %

\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}

\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}

\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}

\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}

\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}

\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
%
}% unbind the catcode of @.

% @headings double turns headings on for double-sided printing.
% @headings single turns headings on for single-sided printing.
% @headings off turns them off.
% @headings on same as @headings double, retained for compatibility.
% @headings after turns on double-sided headings after this page.
% @headings doubleafter turns on double-sided headings after this page.
% @headings singleafter turns on single-sided headings after this page.
% By default, they are off.

\def\headings #1 {\csname HEADINGS#1\endcsname}

\def\HEADINGSoff{
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
\HEADINGSoff
% When we turn headings on, set the page number to 1.
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
\def\HEADINGSdouble{
%\pagealignmacro
\global\pageno=1
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
}
% For single-sided printing, chapter title goes across top left of page,
% page number on top right.
\def\HEADINGSsingle{
%\pagealignmacro
\global\pageno=1
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
}
\def\HEADINGSon{\HEADINGSdouble}

\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
\let\HEADINGSdoubleafter=\HEADINGSafter
\def\HEADINGSdoublex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
}

\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
\def\HEADINGSsinglex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
}

% Subroutines used in generating headings
% Produces Day Month Year style of output.
\def\today{\number\day\space
\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\year}

% Use this if you want the Month Day, Year style of output.
%\def\today{\ifcase\month\or
%January\or February\or March\or April\or May\or June\or
%July\or August\or September\or October\or November\or December\fi
%\space\number\day, \number\year}

% @settitle line... specifies the title of the document, for headings
% It generates no output of its own

\def\thistitle{No Title}
\def\settitle{\parsearg\settitlezzz}
\def\settitlezzz #1{\gdef\thistitle{#1}}

\message{tables,}

% @tabs -- simple alignment

% These don't work. For one thing, \+ is defined as outer.
% So these macros cannot even be defined.

%\def\tabs{\parsearg\tabszzz}
%\def\tabszzz #1{\settabs\+#1\cr}
%\def\tabline{\parsearg\tablinezzz}
%\def\tablinezzz #1{\+#1\cr}
%\def\&{&}

% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).

% default indentation of table text
\newdimen\tableindent \tableindent=.8in
% default indentation of @itemize and @enumerate text
\newdimen\itemindent \itemindent=.3in
% margin between end of table item and start of table text.
\newdimen\itemmargin \itemmargin=.1in

% used internally for \itemindent minus \itemmargin
\newdimen\itemmax

% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
% these defs.
% They also define \itemindex
% to index the item name in whatever manner is desired (perhaps none).

\def\internalBitem{\smallbreak \parsearg\itemzzz}
\def\internalBitemx{\par \parsearg\itemzzz}

\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}

\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
\def\internalBkitemx{\par \parsearg\kitemzzz}

\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
\itemzzz {#1}}

\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
\itemzzz {#1}}

\def\itemzzz #1{\begingroup %
\advance\hsize by -\rightskip
\advance\hsize by -\tableindent
\setbox0=\hbox{\itemfont{#1}}%
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
% Be sure we are not still in the middle of a paragraph.
\parskip=0in
\par
%
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
% command is, e.g., @kindex, the whatsit would get put into the
% horizontal list on a line by itself, resulting in extra blank space.
\ifdim \wd0>\itemmax
\setbox0=\hbox{\hskip \leftskip \hskip -\tableindent \unhbox0}\box0
\nobreak
\else
% The item text fits into the space. Start a paragraph, so that the
% following text (if any) will end up on the same line. Since that
% text will be indented by \tableindent, we make the item text be in
% a zero-width box.
\noindent
\rlap{\hskip -\tableindent\box0}%
\fi
\endgroup
}

\def\item{\errmessage{@item while not in a table}}
\def\itemx{\errmessage{@itemx while not in a table}}
\def\kitem{\errmessage{@kitem while not in a table}}
\def\kitemx{\errmessage{@kitemx while not in a table}}
\def\xitem{\errmessage{@xitem while not in a table}}
\def\xitemx{\errmessage{@xitemx while not in a table}}

%% Contains a kludge to get @end[description] to work
\def\description{\tablez{\dontindex}{1}{}{}{}{}}

\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
{\obeylines\obeyspaces%
\gdef\tablex #1^^M{%
\tabley\dontindex#1 \endtabley}}

\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
{\obeylines\obeyspaces%
\gdef\ftablex #1^^M{%
\tabley\fnitemindex#1 \endtabley
\def\Eftable{\endgraf\endgroup\afterenvbreak}%
\let\Etable=\relax}}

\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
{\obeylines\obeyspaces%
\gdef\vtablex #1^^M{%
\tabley\vritemindex#1 \endtabley
\def\Evtable{\endgraf\endgroup\afterenvbreak}%
\let\Etable=\relax}}

\def\dontindex #1{}
\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
\def\vritemindex #1{\doind {vr}{\code{#1}}}%

{\obeyspaces %
\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}

\def\tablez #1#2#3#4#5#6{%
\aboveenvbreak %
\begingroup %
\def\Edescription{\Etable}% Neccessary kludge.
\let\itemindex=#1%
\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
\ifnum 0#4>0 \tableindent=#4\mil \fi %
\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
\def\itemfont{#2}%
\itemmax=\tableindent %
\advance \itemmax by -\itemmargin %
\advance \leftskip by \tableindent %
\exdentamount=\tableindent
\parindent = 0pt
\parskip = \smallskipamount
\ifdim \parskip=0pt \parskip=2pt \fi%
\def\Etable{\endgraf\endgroup\afterenvbreak}%
\let\item = \internalBitem %
\let\itemx = \internalBitemx %
\let\kitem = \internalBkitem %
\let\kitemx = \internalBkitemx %
\let\xitem = \internalBxitem %
\let\xitemx = \internalBxitemx %
}

% This is the counter used by @enumerate, which is really @itemize

\newcount \itemno

\def\itemize{\parsearg\itemizezzz}

\def\itemizezzz #1{%
\begingroup % ended by the @end itemsize
\itemizey {#1}{\Eitemize}
}

\def\itemizey #1#2{%
\aboveenvbreak %
\itemmax=\itemindent %
\advance \itemmax by -\itemmargin %
\advance \leftskip by \itemindent %
\exdentamount=\itemindent
\parindent = 0pt %
\parskip = \smallskipamount %
\ifdim \parskip=0pt \parskip=2pt \fi%
\def#2{\endgraf\endgroup\afterenvbreak}%
\def\itemcontents{#1}%
\let\item=\itemizeitem}

\def\bullet{$\ptexbullet$}
\def\minus{$-$}

% Set sfcode to normal for the chars that usually have another value.
% These are `.?!:;,'
\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
\sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }

% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
%
\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%

% Allow an optional argument of an uppercase letter, lowercase letter,
% or number, to specify the first label in the enumerated list. No
% argument is the same as `1'.
%
\def\enumerate{\parsearg\enumeratezzz}
\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
\def\enumeratey #1 #2\endenumeratey{%
\begingroup % ended by the @end enumerate
%
% If we were given no argument, pretend we were given `1'.
\def\thearg{#1}%
\ifx\thearg\empty \def\thearg{1}\fi
%
% Detect if the argument is a single token. If so, it might be a
% letter. Otherwise, the only valid thing it can be is a number.
% (We will always have one token, because of the test we just made.
% This is a good thing, since \splitoff doesn't work given nothing at
% all -- the first parameter is undelimited.)
\expandafter\splitoff\thearg\endmark
\ifx\rest\empty
% Only one token in the argument. It could still be anything.
% A ``lowercase letter'' is one whose \lccode is nonzero.
% An ``uppercase letter'' is one whose \lccode is both nonzero, and
% not equal to itself.
% Otherwise, we assume it's a number.
%
% We need the \relax at the end of the \ifnum lines to stop TeX from
% continuing to look for a .
%
\ifnum\lccode\expandafter`\thearg=0\relax
\numericenumerate % a number (we hope)
\else
% It's a letter.
\ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
\lowercaseenumerate % lowercase letter
\else
\uppercaseenumerate % uppercase letter
\fi
\fi
\else
% Multiple tokens in the argument. We hope it's a number.
\numericenumerate
\fi
}

% An @enumerate whose labels are integers. The starting integer is
% given in \thearg.
%
\def\numericenumerate{%
\itemno = \thearg
\startenumeration{\the\itemno}%
}

% The starting (lowercase) letter is in \thearg.
\def\lowercaseenumerate{%
\itemno = \expandafter`\thearg
\startenumeration{%
% Be sure we're not beyond the end of the alphabet.
\ifnum\itemno=0
\errmessage{No more lowercase letters in @enumerate; get a bigger
alphabet}%
\fi
\char\lccode\itemno
}%
}

% The starting (uppercase) letter is in \thearg.
\def\uppercaseenumerate{%
\itemno = \expandafter`\thearg
\startenumeration{%
% Be sure we're not beyond the end of the alphabet.
\ifnum\itemno=0
\errmessage{No more uppercase letters in @enumerate; get a bigger
alphabet}
\fi
\char\uccode\itemno
}%
}

% Call itemizey, adding a period to the first argument and supplying the
% common last two arguments. Also subtract one from the initial value in
% \itemno, since @item increments \itemno.
%
\def\startenumeration#1{%
\advance\itemno by -1
\itemizey{#1.}\Eenumerate\flushcr
}

% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
% to @enumerate.
%
\def\alphaenumerate{\enumerate{a}}
\def\capsenumerate{\enumerate{A}}
\def\Ealphaenumerate{\Eenumerate}
\def\Ecapsenumerate{\Eenumerate}

% Definition of @item while inside @itemize.

\def\itemizeitem{%
\advance\itemno by 1
{\let\par=\endgraf \smallbreak}%
\ifhmode \errmessage{\in hmode at itemizeitem}\fi
{\parskip=0in \hskip 0pt
\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
\vadjust{\penalty 1200}}%
\flushcr}

\message{indexing,}
% Index generation facilities

% Define \newwrite to be identical to plain tex's \newwrite
% except not \outer, so it can be used within \newindex.
{\catcode`\@=11
\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}

% \newindex {foo} defines an index named foo.
% It automatically defines \fooindex such that
% \fooindex ...rest of line... puts an entry in the index foo.
% It also defines \fooindfile to be the number of the output channel for
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.

\def\newindex #1{
\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\doindex {#1}}
}

% @defindex foo == \newindex{foo}

\def\defindex{\parsearg\newindex}

% Define @defcodeindex, like @defindex except put all entries in @code.

\def\newcodeindex #1{
\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\docodeindex {#1}}
}

\def\defcodeindex{\parsearg\newcodeindex}

% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
\def\synindex #1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\doindex {#2}}%
}

% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
\def\syncodeindex #1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\docodeindex {#2}}%
}

% Define \doindex, the driver for all \fooindex macros.
% Argument #1 is generated by the calling \fooindex macro,
% and it is "foo", the name of the index.

% \doindex just uses \parsearg; it calls \doind for the actual work.
% This is because \doind is more useful to call from other macros.

% There is also \dosubind {index}{topic}{subtopic}
% which makes an entry in a two-level index such as the operation index.

\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
\def\singleindexer #1{\doind{\indexname}{#1}}

% like the previous two, but they put @code around the argument.
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}

\def\indexdummies{%
\def\_{{\realbackslash _}}%
\def\w{\realbackslash w }%
\def\bf{\realbackslash bf }%
\def\rm{\realbackslash rm }%
\def\sl{\realbackslash sl }%
\def\sf{\realbackslash sf}%
\def\tt{\realbackslash tt}%
\def\gtr{\realbackslash gtr}%
\def\less{\realbackslash less}%
\def\hat{\realbackslash hat}%
\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }%
\def\copyright{\realbackslash copyright }%
\def\tclose##1{\realbackslash tclose {##1}}%
\def\code##1{\realbackslash code {##1}}%
\def\samp##1{\realbackslash samp {##1}}%
\def\t##1{\realbackslash r {##1}}%
\def\r##1{\realbackslash r {##1}}%
\def\i##1{\realbackslash i {##1}}%
\def\b##1{\realbackslash b {##1}}%
\def\cite##1{\realbackslash cite {##1}}%
\def\key##1{\realbackslash key {##1}}%
\def\file##1{\realbackslash file {##1}}%
\def\var##1{\realbackslash var {##1}}%
\def\kbd##1{\realbackslash kbd {##1}}%
}

% \indexnofonts no-ops all font-change commands.
% This is used when outputting the strings to sort the index by.
\def\indexdummyfont#1{#1}
\def\indexdummytex{TeX}
\def\indexdummydots{...}

\def\indexnofonts{%
\let\w=\indexdummyfont
\let\t=\indexdummyfont
\let\r=\indexdummyfont
\let\i=\indexdummyfont
\let\b=\indexdummyfont
\let\emph=\indexdummyfont
\let\strong=\indexdummyfont
\let\cite=\indexdummyfont
\let\sc=\indexdummyfont
%Don't no-op \tt, since it isn't a user-level command
% and is used in the definitions of the active chars like <, >, |...
%\let\tt=\indexdummyfont
\let\tclose=\indexdummyfont
\let\code=\indexdummyfont
\let\file=\indexdummyfont
\let\samp=\indexdummyfont
\let\kbd=\indexdummyfont
\let\key=\indexdummyfont
\let\var=\indexdummyfont
\let\TeX=\indexdummytex
\let\dots=\indexdummydots
}

% To define \realbackslash, we must make \ not be an escape.
% We must first make another character (@) an escape
% so we do not become unable to do a definition.

{\catcode`\@=0 \catcode`\\=\other
@gdef@realbackslash{\}}

\let\indexbackslash=0 %overridden during \printindex.

\def\doind #1#2{%
{\count10=\lastpenalty %
{\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\%
{\let\folio=0% Expand all macros now EXCEPT \folio
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash in the indx.
%
% Now process the index-string once, with all font commands turned off,
% to get the string to sort the index by.
{\indexnofonts
\xdef\temp1{#2}%
}%
% Now produce the complete index entry. We process the index-string again,
% this time with font commands expanded, to get what to print in the index.
\edef\temp{%
\write \csname#1indfile\endcsname{%
\realbackslash entry {\temp1}{\folio}{#2}}}%
\temp }%
}\penalty\count10}}

\def\dosubind #1#2#3{%
{\count10=\lastpenalty %
{\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\%
{\let\folio=0%
\def\rawbackslashxx{\indexbackslash}%
%
% Now process the index-string once, with all font commands turned off,
% to get the string to sort the index by.
{\indexnofonts
\xdef\temp1{#2 #3}%
}%
% Now produce the complete index entry. We process the index-string again,
% this time with font commands expanded, to get what to print in the index.
\edef\temp{%
\write \csname#1indfile\endcsname{%
\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
\temp }%
}\penalty\count10}}

% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
% \entry {sortstring}{page}{topic}{subtopic}
% The texindex program reads in these files and writes files
% containing these kinds of lines:
% \initial {c}
% before the first topic whose initial is c
% \entry {topic}{pagelist}
% for a topic that is used without subtopics
% \primary {topic}
% for the beginning of a topic that is used with subtopics
% \secondary {subtopic}{pagelist}
% for each subtopic.

% Define the user-accessible indexing commands
% @findex, @vindex, @kindex, @cindex.

\def\findex {\fnindex}
\def\kindex {\kyindex}
\def\cindex {\cpindex}
\def\vindex {\vrindex}
\def\tindex {\tpindex}
\def\pindex {\pgindex}

\def\cindexsub {\begingroup\obeylines\cindexsub}
{\obeylines %
\gdef\cindexsub "#1" #2^^M{\endgroup %
\dosubind{cp}{#2}{#1}}}

% Define the macros used in formatting output of the sorted index material.

% This is what you call to cause a particular index to get printed.
% Write
% @unnumbered Function Index
% @printindex fn

\def\printindex{\parsearg\doprintindex}

\def\doprintindex#1{%
\tex
\dobreak \chapheadingskip {10000}
\catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
\catcode`\$=\other\catcode`\_=\other
\catcode`\~=\other
%
% The following don't help, since the chars were translated
% when the raw index was written, and their fonts were discarded
% due to \indexnofonts.
%\catcode`\"=\active
%\catcode`\^=\active
%\catcode`\_=\active
%\catcode`\|=\active
%\catcode`\<=\active
%\catcode`\>=\active
% %
\def\indexbackslash{\rawbackslashxx}
\indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
\begindoublecolumns
%
% See if the index file exists and is nonempty.
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
% and it loses the chapter title and the aux file entries for the
% index. The easiest way to prevent this problem is to make sure
% there is some text.
(Index is nonexistent)
\else
%
% If the index file exists but is empty, then \openin leaves \ifeof
% false. We have to make TeX try to read something from the file, so
% it can discover if there is anything in it.
\read 1 to \temp
\ifeof 1
(Index is empty)
\else
\input \jobname.#1s
\fi
\fi
\closein 1
\enddoublecolumns
\Etex
}

% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.

% Same as \bigskipamount except no shrink.
% \balancecolumns gets confused if there is any shrink.
\newskip\initialskipamount \initialskipamount 12pt plus4pt

\def\initial #1{%
{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
\ifdim\lastskip<\initialskipamount
\removelastskip \penalty-200 \vskip \initialskipamount\fi
\line{\secbf#1\hfill}\kern 2pt\penalty10000}}

\def\entry #1#2{\begingroup
\parfillskip=0in \parskip=0in \parindent=0in
%
% Do not prefer a separate line ending with a hyphen to fewer lines.
\finalhyphendemerits = 0
%
% \hangindent is only relevant when the entry text and page number
% don't both fit on one line. In that case, bob suggests starting the
% dots pretty far over on the line. Unfortunately, a large
% indentation looks wrong when the entry text itself is broken across
% lines. So we use a small indentation and put up with long leaders.
%
% \hangafter is reset to 1 (which is the value we want) at the start
% of each paragraph, so we need not do anything with that.
\hangindent=2em
%
% When the entry text needs to be broken, just fill out the first line
% with blank space.
\rightskip = 0pt plus1fil
%
% Start a ``paragraph'' for the index entry so the line breaking
% parameters we've set above will have an effect.
\noindent
%
% Insert the text of the index entry. TeX will do line-breaking on it.
#1%
%
% If we must, put the page number on a line of its own, and fill out
% this line with blank space. (The \hfil is overwhelmed with the
% fill leaders glue in \indexdotfill if the page number does fit.)
\hfil\penalty50
\null\nobreak\indexdotfill % Have leaders before the page number.
%
% The `\ ' here is removed by the implicit \unskip that TeX does as
% part of (the primitive) \par. Without it, a spurious underfull
% \hbox ensues.
\ #2% The page number ends the paragraph.
\par
\endgroup}

% Like \dotfill except takes at least 1 em.
\def\indexdotfill{\cleaders
\hbox{$\mathsurround=0pt \mkern1.5mu . \mkern1.5mu$}\hskip 1em plus 1fill}

\def\primary #1{\line{#1\hfil}}

\newskip\secondaryindent \secondaryindent=0.5cm

\def\secondary #1#2{
{\parfillskip=0in \parskip=0in
\hangindent =1in \hangafter=1
\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
}}

%% Define two-column mode, which is used in indexes.
%% Adapted from the TeXbook, page 416.
\catcode `\@=11

\newbox\partialpage

\newdimen\doublecolumnhsize
\newdimen\availdimen@

\def\begindoublecolumns{\begingroup
% Grab any single-column material above us.
\output = {\global\setbox\partialpage
=\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
\eject
%
% Now switch to the double-column output routine.
\output={\doublecolumnout}%
%
% Change the page size parameters. We could do this once outside this
% routine, in each of @smallbook, @afourpaper, and the default 8.5x11
% format, but then we repeat the same computation. Repeating a couple
% of assignments once per index is clearly meaningless for the
% execution time, so we may as well do it once.
%
% First we halve the line length, less a little for the gutter between
% the columns. We compute the gutter based on the line length, so it
% changes automatically with the paper format. The magic constant
% below is chosen so that the gutter has the same value (well, +- <
% 1pt) as it did when we hard-coded it.
%
% We put the result in a separate register, \doublecolumhsize, so we
% can restore it in \pagesofar, after \hsize itself has (potentially)
% been clobbered.
%
\doublecolumnhsize = \hsize
\advance\doublecolumnhsize by -.04154\hsize
\divide\doublecolumnhsize by 2
\hsize = \doublecolumnhsize
%
% Double the \vsize as well. (We don't need a separate register here,
% since nobody clobbers \vsize.)
\vsize = 2\vsize
}

\def\enddoublecolumns{\output={\balancecolumns}\eject
\endgroup \pagegoal=\vsize}

\def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
\dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
\def\pagesofar{\unvbox\partialpage %
\hsize=\doublecolumnhsize % have to restore this since output routine
% changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
\wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
\def\balancecolumns{%
% Unset the glue.
\setbox255=\vbox{\unvbox255}
\dimen@=\ht255
\advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
\divide\dimen@ by2
\availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
% If the remaining data is too big for one page,
% output one page normally, then work with what remains.
\ifdim \dimen@>\availdimen@
{
\splittopskip=\topskip \splitmaxdepth=\maxdepth
\dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar
}
% Recompute size of what remains, in case we just output some of it.
\dimen@=\ht255
\advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
\divide\dimen@ by2
\fi
\setbox0=\vbox{\unvbox255}
\splittopskip=\topskip
{\vbadness=10000 \loop \global\setbox3=\copy0
\global\setbox1=\vsplit3 to\dimen@
\ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
\setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3}
\pagesofar}

\catcode `\@=\other
\message{sectioning,}
% Define chapters, sections, etc.

\newcount \chapno
\newcount \secno \secno=0
\newcount \subsecno \subsecno=0
\newcount \subsubsecno \subsubsecno=0

% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount \appendixno \appendixno = `\@
\def\appendixletter{\char\the\appendixno}

\newwrite \contentsfile
% This is called from \setfilename.
\def\opencontents{\openout \contentsfile = \jobname.toc}

% Each @chapter defines this as the name of the chapter.
% page headings and footings can use it. @section does likewise

\def\thischapter{} \def\thissection{}
\def\seccheck#1{\if \pageno<0 %
\errmessage{@#1 not allowed after generating table of contents}\fi
%
}

\def\chapternofonts{%
\let\rawbackslash=\relax%
\let\frenchspacing=\relax%
\def\result{\realbackslash result}
\def\equiv{\realbackslash equiv}
\def\expansion{\realbackslash expansion}
\def\print{\realbackslash print}
\def\TeX{\realbackslash TeX}
\def\dots{\realbackslash dots}
\def\copyright{\realbackslash copyright}
\def\tt{\realbackslash tt}
\def\bf{\realbackslash bf }
\def\w{\realbackslash w}
\def\less{\realbackslash less}
\def\gtr{\realbackslash gtr}
\def\hat{\realbackslash hat}
\def\char{\realbackslash char}
\def\tclose##1{\realbackslash tclose {##1}}
\def\code##1{\realbackslash code {##1}}
\def\samp##1{\realbackslash samp {##1}}
\def\r##1{\realbackslash r {##1}}
\def\b##1{\realbackslash b {##1}}
\def\key##1{\realbackslash key {##1}}
\def\file##1{\realbackslash file {##1}}
\def\kbd##1{\realbackslash kbd {##1}}
% These are redefined because @smartitalic wouldn't work inside xdef.
\def\i##1{\realbackslash i {##1}}
\def\cite##1{\realbackslash cite {##1}}
\def\var##1{\realbackslash var {##1}}
\def\emph##1{\realbackslash emph {##1}}
\def\dfn##1{\realbackslash dfn {##1}}
}

\def\thischaptername{No Chapter Title}
\outer\def\chapter{\parsearg\chapterzzz}
\def\chapterzzz #1{\seccheck{chapter}%
\secno=0 \subsecno=0 \subsubsecno=0
\global\advance \chapno by 1 \message{Chapter \the\chapno}%
\chapmacro {#1}{\the\chapno}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
% We don't substitute the actual chapter name into \thischapter
% because we don't want its macros evaluated now.
\xdef\thischapter{Chapter \the\chapno: \noexpand\thischaptername}%
{\chapternofonts%
\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\donoderef %
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
}}

\outer\def\appendix{\parsearg\appendixzzz}
\def\appendixzzz #1{\seccheck{appendix}%
\secno=0 \subsecno=0 \subsubsecno=0
\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
\chapmacro {#1}{Appendix \appendixletter}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}%
{\chapternofonts%
\edef\temp{{\realbackslash chapentry
{#1}{Appendix \appendixletter}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\appendixnoderef %
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
}}

\outer\def\top{\parsearg\unnumberedzzz}
\outer\def\unnumbered{\parsearg\unnumberedzzz}
\def\unnumberedzzz #1{\seccheck{unnumbered}%
\secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
\unnumbchapmacro {#1}%
\gdef\thischapter{#1}\gdef\thissection{#1}%
{\chapternofonts%
\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\unnumbnoderef %
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
}}

\outer\def\numberedsec{\parsearg\seczzz}
\def\seczzz #1{\seccheck{section}%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
{\chapternofonts%
\edef\temp{{\realbackslash secentry %
{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\donoderef %
\penalty 10000 %
}}

\outer\def\appendixsection{\parsearg\appendixsectionzzz}
\outer\def\appendixsec{\parsearg\appendixsectionzzz}
\def\appendixsectionzzz #1{\seccheck{appendixsection}%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
{\chapternofonts%
\edef\temp{{\realbackslash secentry %
{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\appendixnoderef %
\penalty 10000 %
}}

\outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
\plainsecheading {#1}\gdef\thissection{#1}%
{\chapternofonts%
\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\unnumbnoderef %
\penalty 10000 %
}}

\outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
\def\numberedsubseczzz #1{\seccheck{subsection}%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
{\chapternofonts%
\edef\temp{{\realbackslash subsecentry %
{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\donoderef %
\penalty 10000 %
}}

\outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
{\chapternofonts%
\edef\temp{{\realbackslash subsecentry %
{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\appendixnoderef %
\penalty 10000 %
}}

\outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
\plainsecheading {#1}\gdef\thissection{#1}%
{\chapternofonts%
\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\unnumbnoderef %
\penalty 10000 %
}}

\outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
{\chapternofonts%
\edef\temp{{\realbackslash subsubsecentry %
{#1}
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\donoderef %
\penalty 10000 %
}}

\outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
{\chapternofonts%
\edef\temp{{\realbackslash subsubsecentry{#1}%
{\appendixletter}
{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\appendixnoderef %
\penalty 10000 %
}}

\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
\plainsecheading {#1}\gdef\thissection{#1}%
{\chapternofonts%
\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
\escapechar=`\\%
\write \contentsfile \temp %
\unnumbnoderef %
\penalty 10000 %
}}

% These are variants which are not "outer", so they can appear in @ifinfo.
% Actually, they should now be obsolete; ordinary section commands should work.
\def\infotop{\parsearg\unnumberedzzz}
\def\infounnumbered{\parsearg\unnumberedzzz}
\def\infounnumberedsec{\parsearg\unnumberedseczzz}
\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}

\def\infoappendix{\parsearg\appendixzzz}
\def\infoappendixsec{\parsearg\appendixseczzz}
\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}

\def\infochapter{\parsearg\chapterzzz}
\def\infosection{\parsearg\sectionzzz}
\def\infosubsection{\parsearg\subsectionzzz}
\def\infosubsubsection{\parsearg\subsubsectionzzz}

% These macros control what the section commands do, according
% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
% Define them by default for a numbered chapter.
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec

% Define @majorheading, @heading and @subheading

% NOTE on use of \vbox for chapter headings, section headings, and
% such:
% 1) We use \vbox rather than the earlier \line to permit
% overlong headings to fold.
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
% heading is obnoxious; this forbids it.
% 3) Likewise, headings look best if no \parindent is used, and
% if justification is not attempted. Hence \raggedright.


\def\majorheading{\parsearg\majorheadingzzz}
\def\majorheadingzzz #1{%
{\advance\chapheadingskip by 10pt \chapbreak }%
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}\bigskip \par\penalty 200}

\def\chapheading{\parsearg\chapheadingzzz}
\def\chapheadingzzz #1{\chapbreak %
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}\bigskip \par\penalty 200}

\def\heading{\parsearg\secheadingi}

\def\subheading{\parsearg\subsecheadingi}

\def\subsubheading{\parsearg\subsubsecheadingi}

% These macros generate a chapter, section, etc. heading only
% (including whitespace, linebreaking, etc. around it),
% given all the information in convenient, parsed form.

%%% Args are the skip and penalty (usually negative)
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}

\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}

%%% Define plain chapter starts, and page on/off switching for it
% Parameter controlling skip before chapter headings (if needed)

\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt

\def\chapbreak{\dobreak \chapheadingskip {-4000}}
\def\chappager{\par\vfill\supereject}
\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}

\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}

\def\CHAPPAGoff{
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}

\def\CHAPPAGon{
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
\global\def\HEADINGSon{\HEADINGSsingle}}

\def\CHAPPAGodd{
\global\let\pchapsepmacro=\chapoddpage
\global\let\pagealignmacro=\chapoddpage
\global\def\HEADINGSon{\HEADINGSdouble}}

\CHAPPAGon

\def\CHAPFplain{
\global\let\chapmacro=\chfplain
\global\let\unnumbchapmacro=\unnchfplain}

\def\chfplain #1#2{%
\pchapsepmacro
{%
\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #2\enspace #1}%
}%
\bigskip
\penalty5000
}

\def\unnchfplain #1{%
\pchapsepmacro %
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}\bigskip \par\penalty 10000 %
}
\CHAPFplain % The default

\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}\bigskip \par\penalty 10000 %
}

\def\chfopen #1#2{\chapoddpage {\chapfonts
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\par\penalty 5000 %
}

\def\CHAPFopen{
\global\let\chapmacro=\chfopen
\global\let\unnumbchapmacro=\unnchfopen}

% Parameter controlling skip before section headings.

\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}

\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
\def\secheadingbreak{\dobreak \secheadingskip {-1000}}

% @paragraphindent is defined for the Info formatting commands only.
\let\paragraphindent=\comment

% Section fonts are the base font at magstep2, which produces
% a size a bit more than 14 points in the default situation.

\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
\def\plainsecheading #1{\secheadingi {#1}}
\def\secheadingi #1{{\advance \secheadingskip by \parskip %
\secheadingbreak}%
{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }


% Subsection fonts are the base font at magstep1,
% which produces a size of 12 points.

\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
\subsecheadingbreak}%
{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }

\def\subsubsecfonts{\subsecfonts} % Maybe this should change:
% Perhaps make sssec fonts scaled
% magstep half
\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
\subsecheadingbreak}%
{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}


\message{toc printing,}

% Finish up the main text and prepare to read what we've written
% to \contentsfile.

\newskip\contentsrightmargin \contentsrightmargin=1in
\def\startcontents#1{%
\pagealignmacro
\immediate\closeout \contentsfile
\ifnum \pageno>0
\pageno = -1 % Request roman numbered pages.
\fi
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\unnumbchapmacro{#1}\def\thischapter{}%
\begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
}


% Normal (long) toc.
\outer\def\contents{%
\startcontents{Table of Contents}%
\input \jobname.toc
\endgroup
\vfill \eject
}

% And just the chapters.
\outer\def\summarycontents{%
\startcontents{Short Contents}%
%
\let\chapentry = \shortchapentry
\let\unnumbchapentry = \shortunnumberedentry
% We want a true roman here for the page numbers.
\secfonts
\let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
\rm
\advance\baselineskip by 1pt % Open it up a little.
\def\secentry ##1##2##3##4{}
\def\unnumbsecentry ##1##2{}
\def\subsecentry ##1##2##3##4##5{}
\def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{}
\def\unnumbsubsubsecentry ##1##2{}
\input \jobname.toc
\endgroup
\vfill \eject
}
\let\shortcontents = \summarycontents

% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The last argument is the page number.
% The arguments in between are the chapter number, section number, ...

% Chapter-level things, for both the long and short contents.
\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}

% See comments in \dochapentry re vbox and related settings
\def\shortchapentry#1#2#3{%
\vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\strut\raggedright
{\shortchaplabel{#2}\labelspace #1}\dotfill\doshortpageno{#3}}%
}

% Typeset the label for a chapter or appendix for the short contents.
% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
% We could simplify the code here by writing out an \appendixentry
% command in the toc file for appendices, instead of using \chapentry
% for both, but it doesn't seem worth it.
\setbox0 = \hbox{\shortcontrm Appendix }
\newdimen\shortappendixwidth \shortappendixwidth = \wd0

\def\shortchaplabel#1{%
% We typeset #1 in a box of constant width, regardless of the text of
% #1, so the chapter titles will come out aligned.
\setbox0 = \hbox{#1}%
\dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
%
% This space should be plenty, since a single number is .5em, and the
% widest letter (M) is 1em, at least in the Computer Modern fonts.
% (This space doesn't include the extra space that gets added after
% the label; that gets put in in \shortchapentry above.)
\advance\dimen0 by 1.1em
\hbox to \dimen0{#1\hfil}%
}

\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
\def\shortunnumberedentry#1#2{%
\vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\strut\raggedright
#1\dotfill\doshortpageno{#2}}%
}

% Sections.
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}

% Subsections.
\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}

% And subsubsections.
\def\subsubsecentry#1#2#3#4#5#6{%
\dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}


% This parameter controls the indentation of the various levels.
\newdimen\tocindent \tocindent = 3pc

% Now for the actual typesetting. In all these, #1 is the text and #2 is the
% page number.
%
% If the toc has to be broken over pages, we would want to be at chapters
% if at all possible; hence the \penalty.
\def\dochapentry#1#2{%
\penalty-300 \vskip\baselineskip
% This \vbox (and similar ones in dosecentry etc.) used to be a
% \line; changed to permit linebreaks for long headings. See
% comments above \majorheading. Here we also use \strut to
% keep the top end of the vbox from jamming up against the previous
% entry in the table of contents.
\vbox{\chapentryfonts
\hyphenpenalty=10000\tolerance=5000 % this line and next introduced
\parindent=0pt\strut\raggedright % with \line -> \vbox change
#1\dotfill
\dopageno{#2}}%
\nobreak\vskip .25\baselineskip
}

\def\dosecentry#1#2{%
\vbox{\secentryfonts \leftskip=\tocindent
\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\strut\raggedright #1\dotfill
\dopageno{#2}}%
}

\def\dosubsecentry#1#2{%
\vbox{\subsecentryfonts \leftskip=2\tocindent
\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\strut\raggedright #1\dotfill
\dopageno{#2}}%
}

\def\dosubsubsecentry#1#2{%
\vbox{\subsubsecentryfonts \leftskip=3\tocindent
\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\strut\raggedright #1\dotfill
\dopageno{#2}}%
}

% Space between chapter (or whatever) number and the title.
\def\labelspace{\hskip1em \relax}

\def\dopageno#1{{\rm #1}}
\def\doshortpageno#1{{\rm #1}}

\def\chapentryfonts{\secfonts \rm}
\def\secentryfonts{\textfonts}
\let\subsecentryfonts = \textfonts
\let\subsubsecentryfonts = \textfonts


\message{environments,}

% Since these characters are used in examples, it should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
% Furthermore, these definitions must come after we define our fonts.
\newbox\dblarrowbox \newbox\longdblarrowbox
\newbox\pushcharbox \newbox\bullbox
\newbox\equivbox \newbox\errorbox

\let\ptexequiv = \equiv

%{\tentt
%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
% Adapted from the manmac format (p.420 of TeXbook)
%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
% depth .1ex\hfil}
%}

\def\point{$\star$}

\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}

\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}

% Adapted from the TeXbook's \boxit.
{\tentt \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}

\global\setbox\errorbox=\hbox to \dimen0{\hfil
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
\advance\hsize by -2\dimen2 % Rules.
\vbox{
\hrule height\dimen2
\hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
\vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
\kern3pt\vrule width\dimen2}% Space to right.
\hrule height\dimen2}
\hfil}

% The @error{} command.
\def\error{\leavevmode\lower.7ex\copy\errorbox}

% @tex ... @end tex escapes into raw Tex temporarily.
% One exception: @ is still an escape character, so that @end tex works.
% But \@ or @@ will get a plain tex @ character.

\def\tex{\begingroup
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
\catcode `\%=14
\catcode 43=12
\catcode`\"=12
\catcode`\==12
\catcode`\|=12
\catcode`\<=12
\catcode`\>=12
\escapechar=`\\
%
\let\{=\ptexlbrace
\let\}=\ptexrbrace
\let\.=\ptexdot
\let\*=\ptexstar
\let\dots=\ptexdots
\def\@{@}%
\let\bullet=\ptexbullet
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
\let\L=\ptexL
%
\let\Etex=\endgroup}

% Define @lisp ... @endlisp.
% @lisp does a \begingroup so it can rebind things,
% including the definition of @endlisp (which normally is erroneous).

% Amount to narrow the margins by for @lisp.
\newskip\lispnarrowing \lispnarrowing=0.4in

% This is the definition that ^M gets inside @lisp
% phr: changed space to \null, to avoid overfull hbox problems.
{\obeyspaces%
\gdef\lisppar{\null\endgraf}}

% Cause \obeyspaces to make each Space cause a word-separation
% rather than the default which is that it acts punctuation.
% This is because space in tt font looks funny.
{\obeyspaces %
\gdef\sepspaces{\def {\ }}}

% This space is always present above and below environments.
\newskip\envskipamount \envskipamount = 0pt

% Make spacing and below environment symmetrical.
\def\aboveenvbreak{{\advance\envskipamount by \parskip
\endgraf \ifdim\lastskip<\envskipamount
\removelastskip \penalty-50 \vskip\envskipamount \fi}}

\let\afterenvbreak = \aboveenvbreak

% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
\let\nonarrowing=\relax

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \cartouche: draw rectangle w/rounded corners around argument
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
\newskip\normbskip\newskip\normpskip\newskip\normlskip
\circthick=\fontdimen8\circle
%
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctr{{\hskip 6pt\circle\char'010}}
\def\cbl{{\circle\char'012\hskip -6pt}}
\def\cbr{{\hskip 6pt\circle\char'011}}
\def\carttop{\hbox to \cartouter{\hskip\lskip
\ctl\leaders\hrule height\circthick\hfil\ctr
\hskip\rskip}}
\def\cartbot{\hbox to \cartouter{\hskip\lskip
\cbl\leaders\hrule height\circthick\hfil\cbr
\hskip\rskip}}
%
\newskip\lskip\newskip\rskip

\long\def\cartouche{%
\begingroup
\lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt %we want these *outside*.
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
\advance\cartouter by 18pt % allow for 3pt kerns on either
% side, and for 6pt waste from
% each corner char
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing=\comment
\vbox\bgroup
\baselineskip=0pt\parskip=0pt\lineskip=0pt
\carttop
\hbox\bgroup
\hskip\lskip
\vrule\kern3pt
\vbox\bgroup
\hsize=\cartinner
\kern3pt
\begingroup
\baselineskip=\normbskip
\lineskip=\normlskip
\parskip=\normpskip
\vskip -\parskip
\def\Ecartouche{%
\endgroup
\kern3pt
\egroup
\kern3pt\vrule
\hskip\rskip
\egroup
\cartbot
\egroup
\endgroup
}}

\def\lisp{\aboveenvbreak
\begingroup\inENV % This group ends at the end of the @lisp body
\hfuzz=12truept % Don't be fussy
% Make spaces be word-separators rather than space tokens.
\sepspaces %
% Single space lines
\singlespace %
% The following causes blank lines not to be ignored
% by adding a space to the end of each line.
\let\par=\lisppar
\def\Elisp{\endgroup\afterenvbreak}%
\parskip=0pt
% @cartouche defines \nonarrowing to inhibit narrowing
% at next level down.
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\exdentamount=\lispnarrowing
\let\exdent=\nofillexdent
\let\nonarrowing=\relax
\fi
\parindent=0pt
\obeyspaces \obeylines \tt \rawbackslash
\gobble
}

% Define the \E... control sequence only if we are inside the
% environment, so the error checking in \end will work.
%
% We must call \lisp last in the definition, since it reads the
% return following the @example (or whatever) command.
%
\def\example{\begingroup \def\Eexample{\Elisp\endgroup}\lisp}
\def\smallexample{\begingroup \def\Esmallexample{\Elisp\endgroup}\lisp}

% Macro for 9 pt. examples, necessary to print with 5" lines.
% From Pavel@xerox. This is not really used unless the
% @smallbook command is given.

\def\smalllispx{\aboveenvbreak\begingroup\inENV
% This group ends at the end of the @lisp body
\hfuzz=12truept % Don't be fussy
% Make spaces be word-separators rather than space tokens.
\sepspaces %
% Single space lines
\singlespace %
% The following causes blank lines not to be ignored
% by adding a space to the end of each line.
\let\par=\lisppar
\def\Esmalllisp{\endgroup\afterenvbreak}%
%%%% Smaller baseline skip for small examples.
\baselineskip 10pt
\parskip=0pt
% @cartouche defines \nonarrowing to inhibit narrowing
% at next level down.
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\exdentamount=\lispnarrowing
\let\exdent=\nofillexdent
\let\nonarrowing=\relax
\fi
\parindent=0pt
\obeyspaces \obeylines \ninett \indexfonts \rawbackslash
\def\next##1{}\next}

% This is @display; same as @lisp except use roman font.

\def\display{\begingroup\inENV %This group ends at the end of the @display body
\aboveenvbreak
% Make spaces be word-separators rather than space tokens.
\sepspaces %
% Single space lines
\singlespace %
% The following causes blank lines not to be ignored
% by adding a space to the end of each line.
\let\par=\lisppar
\def\Edisplay{\endgroup\afterenvbreak}%
\parskip=0pt
% @cartouche defines \nonarrowing to inhibit narrowing
% at next level down.
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\exdentamount=\lispnarrowing
\let\exdent=\nofillexdent
\let\nonarrowing=\relax
\fi
\parindent=0pt
\obeyspaces \obeylines
\def\next##1{}\next}

% This is @format; same as @lisp except use roman font and don't narrow margins

\def\format{\begingroup\inENV %This group ends at the end of the @format body
\aboveenvbreak
% Make spaces be word-separators rather than space tokens.
\sepspaces %
\singlespace %
% The following causes blank lines not to be ignored
% by adding a space to the end of each line.
\let\par=\lisppar
\def\Eformat{\endgroup\afterenvbreak}
\parskip=0pt \parindent=0pt
\obeyspaces \obeylines
\def\next##1{}\next}

% @flushleft and @flushright

\def\flushleft{%
\begingroup\inENV %This group ends at the end of the @format body
\aboveenvbreak
% Make spaces be word-separators rather than space tokens.
\sepspaces %
% The following causes blank lines not to be ignored
% by adding a space to the end of each line.
% This also causes @ to work when the directive name
% is terminated by end of line.
\let\par=\lisppar
\def\Eflushleft{\endgroup\afterenvbreak}%
\parskip=0pt \parindent=0pt
\obeyspaces \obeylines
\def\next##1{}\next}

\def\flushright{%
\begingroup\inENV %This group ends at the end of the @format body
\aboveenvbreak
% Make spaces be word-separators rather than space tokens.
\sepspaces %
% The following causes blank lines not to be ignored
% by adding a space to the end of each line.
% This also causes @ to work when the directive name
% is terminated by end of line.
\let\par=\lisppar
\def\Eflushright{\endgroup\afterenvbreak}%
\parskip=0pt \parindent=0pt
\advance \leftskip by 0pt plus 1fill
\obeyspaces \obeylines
\def\next##1{}\next}

% @quotation - narrow the margins.

\def\quotation{%
\begingroup\inENV %This group ends at the end of the @quotation body
{\parskip=0pt % because we will skip by \parskip too, later
\aboveenvbreak}%
\singlespace
\parindent=0pt
\def\Equotation{\par\endgroup\afterenvbreak}%
% @cartouche defines \nonarrowing to inhibit narrowing
% at next level down.
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\advance \rightskip by \lispnarrowing
\exdentamount=\lispnarrowing
\let\nonarrowing=\relax
\fi}

\message{defuns,}
% Define formatter for defuns
% First, allow user to change definition object font (\df) internally
\def\setdeffont #1 {\csname DEF#1\endcsname}

\newskip\defbodyindent \defbodyindent=.4in
\newskip\defargsindent \defargsindent=50pt
\newskip\deftypemargin \deftypemargin=12pt
\newskip\deflastargmargin \deflastargmargin=18pt

\newcount\parencount
% define \functionparens, which makes ( and ) and & do special things.
% \functionparens affects the group it is contained in.
\def\activeparens{%
\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
\catcode`\[=\active \catcode`\]=\active}

% Make control sequences which act like normal parenthesis chars.
\let\lparen = ( \let\rparen = )

{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)

% Be sure that we always have a definition for `(', etc. For example,
% if the fn name has parens in it, \boldbrax will not be in effect yet,
% so TeX would otherwise complain about undefined control sequence.
\global\let(=\lparen \global\let)=\rparen
\global\let[=\lbrack \global\let]=\rbrack

\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}

% Definitions of (, ) and & used in args for functions.
% This is the definition of ( outside of all parentheses.
\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
\global\advance\parencount by 1 }
%
% This is the definition of ( when already inside a level of parens.
\gdef\opnested{\char`\(\global\advance\parencount by 1 }
%
\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
% also in that case restore the outer-level definition of (.
\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
\global\advance \parencount by -1 }
% If we encounter &foo, then turn on ()-hacking afterwards
\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ }
%
\gdef\normalparens{\boldbrax\let&=\ampnr}
} % End of definition inside \activeparens
%% These parens (in \boldbrax) actually are a little bolder than the
%% contained text. This is especially needed for [ and ]
\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}

% First, defname, which formats the header line itself.
% #1 should be the function name.
% #2 should be the type of definition, such as "Function".

\def\defname #1#2{%
% Get the values of \leftskip and \rightskip as they were
% outside the @def...
\dimen2=\leftskip
\advance\dimen2 by -\defbodyindent
\dimen3=\rightskip
\advance\dimen3 by -\defbodyindent
\noindent %
\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
\parshape 2 0in \dimen0 \defargsindent \dimen1 %
% Now output arg 2 ("Function" or some such)
% ending at \deftypemargin from the right margin,
% but stuck inside a box of width 0 so it does not interfere with linebreaking
{% Adjust \hsize to exclude the ambient margins,
% so that \rightline will obey them.
\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
% Make all lines underfull and no complaints:
\tolerance=10000 \hbadness=10000
\advance\leftskip by -\defbodyindent
\exdentamount=\defbodyindent
{\df #1}\enskip % Generate function name
}

% Actually process the body of a definition
% #1 should be the terminating control sequence, such as \Edefun.
% #2 should be the "another name" control sequence, such as \defunx.
% #3 should be the control sequence that actually processes the header,
% such as \defunheader.

\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active %
\obeylines\activeparens\spacesplit#3}

\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}

\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}

% These parsing functions are similar to the preceding ones
% except that they do not make parens into active characters.
% These are used for "variables" since they have no arguments.

\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\spacesplit#3}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active %
\obeylines\spacesplit#3}

\def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\spacesplit{#3{#4}}}

\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\spacesplit{#3{##2}}}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\spacesplit{#3{#5}}}

% Split up #2 at the first space token.
% call #1 with two arguments:
% the first is all of #2 before the space token,
% the second is all of #2 after that space token.
% If #2 contains no space token, all of it is passed as the first arg
% and the second is passed as empty.

{\obeylines
\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
\ifx\relax #3%
#1{#2}{}\else #1{#2}{#3#4}\fi}}

% So much for the things common to all kinds of definitions.

% Define @defun.

% First, define the processing that is wanted for arguments of \defun
% Use this to expand the args and terminate the paragraph they make up

\def\defunargs #1{\functionparens \sl
% Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar.
\hyphenchar\tensl=0
#1%
\hyphenchar\tensl=45
\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
}

\def\deftypefunargs #1{%
% Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar.
\functionparens
\code{#1}%
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
}

% Do complete processing of one @defun or @defunx line already parsed.

% @deffn Command forward-char nchars

\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}

\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}

% @defun == @deffn Function

\def\defun{\defparsebody\Edefun\defunx\defunheader}

\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{Function}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}

% @deftypefun int foobar (int @var{foo}, float @var{bar})

\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}

% #1 is the data type. #2 is the name and args.
\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
% #1 is the data type, #2 the name, #3 the args.
\def\deftypefunheaderx #1#2 #3\relax{%
\doind {fn}{\code{#2}}% Make entry in function index
\begingroup\defname {\code{#1} #2}{Function}%
\deftypefunargs {#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}

% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})

\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}

% #1 is the classification. #2 is the data type. #3 is the name and args.
\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
% #1 is the classification, #2 the data type, #3 the name, #4 the args.
\def\deftypefnheaderx #1#2#3 #4\relax{%
\doind {fn}{\code{#3}}% Make entry in function index
\begingroup\defname {\code{#2} #3}{#1}%
\deftypefunargs {#4}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}

% @defmac == @deffn Macro

\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}

\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{Macro}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}

% @defspec == @deffn Special Form

\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}

\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{Special Form}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}

% This definition is run if you use @defunx
% anywhere other than immediately after a @defun or @defunx.

\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
\def\defunx #1 {\errmessage{@defunx in invalid context}}
\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}

% @defmethod, and so on

% @defop {Funny Method} foo-class frobnicate argument

\def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype}

\def\defopheader #1#2#3{%
\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
\begingroup\defname {#2}{\defoptype{} on #1}%
\defunargs {#3}\endgroup %
}

% @defmethod == @defop Method

\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}

\def\defmethodheader #1#2#3{%
\dosubind {fn}{\code{#2}}{on #1}% entry in function index
\begingroup\defname {#2}{Method on #1}%
\defunargs {#3}\endgroup %
}

% @defcv {Class Option} foo-class foo-flag

\def\defcv #1 {\def\defcvtype{#1}%
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}

\def\defcvarheader #1#2#3{%
\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
\begingroup\defname {#2}{\defcvtype{} of #1}%
\defvarargs {#3}\endgroup %
}

% @defivar == @defcv {Instance Variable}

\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}

\def\defivarheader #1#2#3{%
\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
\begingroup\defname {#2}{Instance Variable of #1}%
\defvarargs {#3}\endgroup %
}

% These definitions are run if you use @defmethodx, etc.,
% anywhere other than immediately after a @defmethod, etc.

\def\defopx #1 {\errmessage{@defopx in invalid context}}
\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
\def\defivarx #1 {\errmessage{@defivarx in invalid context}}

% Now @defvar

% First, define the processing that is wanted for arguments of @defvar.
% This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
\interlinepenalty=10000
\endgraf\penalty 10000\vskip -\parskip\penalty 10000}

% @defvr Counter foo-count

\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}

\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}

% @defvar == @defvr Variable

\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}

\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
\begingroup\defname {#1}{Variable}%
\defvarargs {#2}\endgroup %
}

% @defopt == @defvr {User Option}

\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}

\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
\begingroup\defname {#1}{User Option}%
\defvarargs {#2}\endgroup %
}

% @deftypevar int foobar

\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}

% #1 is the data type. #2 is the name.
\def\deftypevarheader #1#2{%
\doind {vr}{\code{#2}}% Make entry in variables index
\begingroup\defname {\code{#1} #2}{Variable}%
\interlinepenalty=10000
\endgraf\penalty 10000\vskip -\parskip\penalty 10000
\endgroup}

% @deftypevr {Global Flag} int enable

\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}

\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
\begingroup\defname {\code{#2} #3}{#1}
\interlinepenalty=10000
\endgraf\penalty 10000\vskip -\parskip\penalty 10000
\endgroup}

% This definition is run if you use @defvarx
% anywhere other than immediately after a @defvar or @defvarx.

\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}

% Now define @deftp
% Args are printed in bold, a slight difference from @defvar.

\def\deftpargs #1{\bf \defvarargs{#1}}

% @deftp Class window height width ...

\def\deftp{\defvrparsebody\Edeftp\deftpx\deftpheader}

\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}

% This definition is run if you use @deftpx, etc
% anywhere other than immediately after a @deftp, etc.

\def\deftpx #1 {\errmessage{@deftpx in invalid context}}

\message{cross reference,}
% Define cross-reference macros
\newwrite \auxfile

\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.

% \setref{foo} defines a cross-reference point named foo.

\def\setref#1{%
%\dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{Ysectionnumberandtype}}

\def\unnumbsetref#1{%
%\dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{Ynothing}}

\def\appendixsetref#1{%
%\dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{Yappendixletterandtype}}

% \xref, \pxref, and \ref generate cross-references to specified points.
% For \xrefX, #1 is the node name, #2 the name of the Info
% cross-reference, #3 the printed node name, #4 the name of the Info
% file, #5 the name of the printed manual. All but the node name can be
% omitted.
%
\def\pxref#1{see \xrefX[#1,,,,,,,]}
\def\xref#1{See \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
\def\printedmanual{\ignorespaces #5}%
\def\printednodename{\ignorespaces #3}%
%
\setbox1=\hbox{\printedmanual}%
\setbox0=\hbox{\printednodename}%
\ifdim \wd0=0pt%
\def\printednodename{\ignorespaces #1}%
%%% Uncommment the following line to make the actual chapter or section title
%%% appear inside the square brackets.
%\def\printednodename{#1-title}%
\fi%
%
%
% If we use \unhbox0 and \unhbox1 to print the node names, TeX does
% not insert empty discretionaries after hyphens, which means that it
% will not find a line break at a hyphen in a node names. Since some
% manuals are best written with fairly long node names, containing
% hyphens, this is a loss. Therefore, we simply give the text of
% the node name again, so it is as if TeX is seeing it for the first
% time.
\ifdim \wd1>0pt
section ``\printednodename'' in \cite{\printedmanual}%
\else%
\turnoffactive%
\refx{#1-snt}{} [\printednodename], page\tie\refx{#1-pg}{}%
\fi
\endgroup}

% \dosetq is the interface for calls from other macros

% Use \turnoffactive so that punctuation chars such as underscore
% work in node names.
\def\dosetq #1#2{{\let\folio=0 \turnoffactive%
\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
\next}}

% \internalsetq {foo}{page} expands into
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
% When the aux file is read, ' is the escape character

\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}

% Things to be expanded by \internalsetq

\def\Ypagenumber{\folio}

\def\Ytitle{\thischapter}

\def\Ynothing{}

\def\Ysectionnumberandtype{%
\ifnum\secno=0 Chapter\xreftie\the\chapno %
\else \ifnum \subsecno=0 Section\xreftie\the\chapno.\the\secno %
\else \ifnum \subsubsecno=0 %
Section\xreftie\the\chapno.\the\secno.\the\subsecno %
\else %
Section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
\fi \fi \fi }

\def\Yappendixletterandtype{%
\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{}%
\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %
\else \ifnum \subsubsecno=0 %
Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
\else %
Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
\fi \fi \fi }

\gdef\xreftie{'tie}

% Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything.
%
\ifx\inputlineno\thisisundefined
\let\linenumber = \empty % Non-3.0.
\else
\def\linenumber{\the\inputlineno:\space}
\fi

% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward.

\def\refx#1#2{%
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
$\langle$un\-de\-fined$\rangle$%
\ifhavexrefs
\message{\linenumber Undefined cross reference `#1'.}%
\else
\ifwarnedxrefs\else
\global\warnedxrefstrue
\message{Cross reference values unknown; you must run TeX again.}%
\fi
\fi
\else
% It's defined, so just use it.
\csname X#1\endcsname
\fi
#2% Output the suffix in any case.
}

% Read the last existing aux file, if any. No error if none exists.

% This is the macro invoked by entries in the aux file.
\def\xrdef #1#2{
{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}

\def\readauxfile{%
\begingroup
\catcode `\^^@=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\^^C=\other
\catcode `\^^D=\other
\catcode `\^^E=\other
\catcode `\^^F=\other
\catcode `\^^G=\other
\catcode `\^^H=\other
\catcode `\ =\other
\catcode `\^^L=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode `\=\other
\catcode 26=\other
\catcode `\^^[=\other
\catcode `\^^\=\other
\catcode `\^^]=\other
\catcode `\^^^=\other
\catcode `\^^_=\other
\catcode `\@=\other
\catcode `\^=\other
\catcode `\~=\other
\catcode `\[=\other
\catcode `\]=\other
\catcode`\"=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode `\$=\other
\catcode `\#=\other
\catcode `\&=\other
% `\+ does not work, so use 43.
\catcode 43=\other
% the aux file uses ' as the escape.
% Turn off \ as an escape so we do not lose on
% entries which were dumped with control sequences in their names.
% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
% Reference to such entries still does not work the way one would wish,
% but at least they do not bomb out when the aux file is read in.
\catcode `\{=1 \catcode `\}=2
\catcode `\%=\other
\catcode `\'=0
\catcode `\\=\other
\openin 1 \jobname.aux
\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
\fi
% Open the new aux file. Tex will close it automatically at exit.
\openout \auxfile=\jobname.aux
\endgroup}


% Footnotes.

\newcount \footnoteno

% The trailing space in the following definition for supereject is
% vital for proper filling; pages come out unaligned when you do a
% pagealignmacro call if that space before the closing brace is
% removed.
\def\supereject{\par\penalty -20000\footnoteno =0 }

% @footnotestyle is meaningful for info output only..
\let\footnotestyle=\comment

\let\ptexfootnote=\footnote

{\catcode `\@=11
\long\gdef\footnote #1{\global\advance \footnoteno by \@ne
\unskip
\edef\thisfootno{$^{\the\footnoteno}$}%
\let\@sf\empty
\ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
\thisfootno\@sf \footnotezzz{#1}}
% \parsearg\footnotezzz}

\long\gdef\footnotezzz #1{\insert\footins{
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox \floatingpenalty\@MM
\leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
\footstrut\parindent=\defaultparindent\hang\textindent{\thisfootno}#1\strut}}

}%end \catcode `\@=11

% End of control word definitions.

\message{and turning on texinfo input format.}

\def\openindices{%
\newindex{cp}%
\newcodeindex{fn}%
\newcodeindex{vr}%
\newcodeindex{tp}%
\newcodeindex{ky}%
\newcodeindex{pg}%
}

% Set some numeric style parameters, for 8.5 x 11 format.

%\hsize = 6.5in
\newdimen\defaultparindent \defaultparindent = 15pt
\parindent = \defaultparindent
\parskip 18pt plus 1pt
\baselineskip 15pt
\advance\topskip by 1.2cm

% Prevent underfull vbox error messages.
\vbadness=10000

% Following George Bush, just get rid of widows and orphans.
\widowpenalty=10000
\clubpenalty=10000

% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
% \hsize. This makes it come to about 9pt for the 8.5x11 format.
%
\ifx\emergencystretch\thisisundefined \else
\emergencystretch = \hsize
\divide\emergencystretch by 45
\fi

% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
\def\smallbook{

% These values for secheadingskip and subsecheadingskip are
% experiments. RJC 7 Aug 1992
\global\secheadingskip = 17pt plus 6pt minus 3pt
\global\subsecheadingskip = 14pt plus 6pt minus 3pt

\global\lispnarrowing = 0.3in
\global\baselineskip 12pt
\advance\topskip by -1cm
\global\parskip 3pt plus 1pt
\global\hsize = 5in
\global\vsize=7.5in
\global\tolerance=700
\global\hfuzz=1pt
\global\contentsrightmargin=0pt

\global\pagewidth=\hsize
\global\pageheight=\vsize

\global\let\smalllisp=\smalllispx
\global\let\smallexample=\smalllispx
\global\def\Esmallexample{\Esmalllisp}
}

% Use @afourpaper to print on European A4 paper.
\def\afourpaper{
\global\tolerance=700
\global\hfuzz=1pt
\global\baselineskip=12pt
\global\parskip 15pt plus 1pt

\global\vsize= 53\baselineskip
\advance\vsize by \topskip
%\global\hsize= 5.85in % A4 wide 10pt
\global\hsize= 6.5in
\global\outerhsize=\hsize
\global\advance\outerhsize by 0.5in
\global\outervsize=\vsize
\global\advance\outervsize by 0.6in

\global\pagewidth=\hsize
\global\pageheight=\vsize
}

%% For a final copy, take out the rectangles
%% that mark overfull boxes (in case you have decided
%% that the text looks ok even though it passes the margin).
\def\finalout{\overfullrule=0pt}

% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
\catcode`\~=\other
\catcode`\^=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode`\+=\other
\def\normaldoublequote{"}
\def\normaltilde{~}
\def\normalcaret{^}
\def\normalunderscore{_}
\def\normalverticalbar{|}
\def\normalless{<}
\def\normalgreater{>}
\def\normalplus{+}

% This macro is used to make a character print one way in ttfont
% where it can probably just be output, and another way in other fonts,
% where something hairier probably needs to be done.
%
% #1 is what to print if we are indeed using \tt; #2 is what to print
% otherwise. Since all the Computer Modern typewriter fonts have zero
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
%
\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}

% Turn off all special characters except @
% (and those which the user can use as if they were ordinary).
% Most of these we simply print from the \tt font, but for some, we can
% use math or other variants that look better in normal text.

\catcode`\"=\active
\def\activedoublequote{{\tt \char '042}}
\let"=\activedoublequote
\catcode`\~=\active
\def~{{\tt \char '176}}
\chardef\hat=`\^
\catcode`\^=\active
\def^{{\tt \hat}}

\catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_}
% Subroutine for the previous macro.
\def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}

% \lvvmode is equivalent in function to \leavevmode.
% Using \leavevmode runs into trouble when written out to
% an index file due to the expansion of \leavevmode into ``\unhbox
% \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
% magic tricks with @.
\def\lvvmode{\vbox to 0pt{}}

\catcode`\|=\active
\def|{{\tt \char '174}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
\chardef \gtr=`\>
\catcode`\>=\active
\def>{{\tt \gtr}}
\catcode`\+=\active
\def+{{\tt \char 43}}
%\catcode 27=\active
%\def^^[{$\diamondsuit$}

% Used sometimes to turn off (effectively) the active characters
% even after parsing them.
\def\turnoffactive{\let"=\normaldoublequote
\let~=\normaltilde
\let^=\normalcaret
\let_=\normalunderscore
\let|=\normalverticalbar
\let<=\normalless
\let>=\normalgreater
\let+=\normalplus}

% Set up an active definition for =, but don't enable it most of the time.
{\catcode`\==\active
\global\def={{\tt \char 61}}}

\catcode`\@=0

% \rawbackslashxx output one backslash character in current font
\global\chardef\rawbackslashxx=`\\
%{\catcode`\\=\other
%@gdef@rawbackslashxx{\}}

% \rawbackslash redefines \ as input to do \rawbackslashxx.
{\catcode`\\=\active
@gdef@rawbackslash{@let\=@rawbackslashxx }}

% \normalbackslash outputs one backslash in fixed width font.
\def\normalbackslash{{\tt\rawbackslashxx}}

% Say @foo, not \foo, in error messages.
\escapechar=`\@

% \catcode 17=0 % Define control-q
\catcode`\\=\active

% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
% That is what \eatinput is for; after that, the `\' should revert to printing
% a backslash.
%
@gdef@eatinput input texinfo{@fixbackslash}
@global@let\ = @eatinput

% On the other hand, perhaps the file did not have a `\input texinfo'. Then
% the first `\{ in the file would cause an error. This macro tries to fix
% that, assuming it is called before the first `\' could plausibly occur.
%
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}

%% These look ok in all fonts, so just make them not special. The @rm below
%% makes sure that the current font starts out as the newly loaded cmr10
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other

@textfonts
@rm

@c Local variables:
@c page-delimiter: "^\\\\message"
@c End:
recode-3.2.4/common.h 644 6206 22 1747 5244525435 12154 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1990.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/* ANSI C specifiers. */

#ifndef __STDC__
#define const
#define volatile
#endif

/* MSDOS non-features. */

#ifdef MSDOS
#define USE_FPUTC
#endif
recode-3.2.4/steps.h 644 6206 22 15002 5260631013 12013 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/* The following declarations are included by the main program only.

The purpose of this separate file is to keep the main program pure of any
particular character set, while providing the linking mechanism between the
general algorithm with the currently available conversion routines.

Adding a new character set or usage requires a single file for the
conversion tables and routines, and modifying this inclusion file.
*/

typedef enum /* Codes for available charsets */
{
CODE_APPLEMAC, /* ASCII 8 bits for Apple's Macintosh */
CODE_ASCII, /* ASCII 7 bits, to overstrike */
CODE_BANGBANG, /* ASCII "bang bang", escapes are ! and !! */
CODE_CCCASCII, /* ASCII 8 bits as seen by Perkin Elmer */
CODE_CDCASCII, /* ASCII 8 bits as seen by Control Data */
CODE_CDCNOS, /* ASCII 6/12 from NOS, escapes are ^ and @ */
CODE_EBCDIC, /* EBCDIC */
CODE_FLAT, /* ASCII without diacritics nor underline */
CODE_IBMPC, /* ASCII 8 bits for IBM's PC */
CODE_ICONQNX, /* ASCII with diacritics for Unisys'ICON */
CODE_LATEX, /* ASCII with LaTeX codes */
CODE_LATIN1, /* ASCII extended by Latin Alphabet 1 */
CODE_TEXTE /* ASCII with easy French conventions */
}
TYPE_code;

#ifdef ENUM_INT_BUG
#define TYPE_code int
#endif

/* The following array provides strings to represent available codes, and is
parallel to TYPE_code declaration. Each entry contains two strings:
first a short form containing four letters, the same four letters used to
name the conversion routines of this package; then a long form giving a
more explicit strings. */

struct keyword_struct
{
const char *s;
const char *l;
}
code_keywords[] =
{
{ "maci", "applemac" },
{ "asci", "ascii" },
{ "bang", "bangbang" },
{ "ccca", "cccascii" },
{ "cdca", "cdcascii" },
{ "cdcn", "cdcnos" },
{ "ebcd", "ebcdic" },
{ "flat", "flat" },
{ "ibmp", "ibmpc" },
{ "icon", "iconqnx" },
{ "ltex", "latex" },
{ "lat1", "latin1" },
{ "txte", "texte" },
};

#define NUMBER_OF_KEYWORDS \
(sizeof (code_keywords) / sizeof (struct keyword_struct))

/* Description of all available conversion routines. */

#ifndef __STDC__
#define PARAMLIST ()
#else
#define PARAMLIST (FILE *, FILE *)
#endif

extern void applemac_ibmpc PARAMLIST;
extern void ascii_cdcnos PARAMLIST;
extern void ascii_flat PARAMLIST;
extern void ascii_latex PARAMLIST;
extern void ascii_texte PARAMLIST;
extern void bangbang_latin1 PARAMLIST;
extern void cccascii_ebcdic PARAMLIST;
extern void ascii8_ascii7 PARAMLIST;
extern void cdcascii_ebcdic PARAMLIST;
extern void cdcnos_ascii PARAMLIST;
extern void ebcdic_cccascii PARAMLIST;
extern void ebcdic_cdcascii PARAMLIST;
extern void ibmpc_applemac PARAMLIST;
extern void ibmpc_iconqnx PARAMLIST;
extern void ibmpc_latin1 PARAMLIST;
extern void iconqnx_ibmpc PARAMLIST;
extern void latex_ascii PARAMLIST;
extern void latex_latin1 PARAMLIST;
extern void latin1_bangbang PARAMLIST;
extern void latin1_ibmpc PARAMLIST;
extern void latin1_latex PARAMLIST;
extern void latin1_texte PARAMLIST;
extern void texte_ascii PARAMLIST;
extern void texte_latin1 PARAMLIST;

#undef PARAMLIST

/* Constants for conversion costs. */

#define NOWAY 10000 /* No way for this conversion */

#define STEP 100 /* Nominal value for each step */
#define ALREADY 0 /* The code injects, no conversion */

#define LOOSE +10 /* Some characters are thrown away */
#define EXACT -10 /* The conversion would be reversible */

#define SLOW +1 /* Multiple characters to one */
#define FAST -1 /* One character to one */

typedef struct
{
#ifndef __STDC__
void (*routine) (); /* Address of conversion routine */
#else
void (*routine) (FILE *, FILE *); /* Address of conversion routine */
#endif
TYPE_code code_before; /* Code of charset before conversion */
TYPE_code code_after; /* Code of charset after conversion */
int conversion_cost; /* Bonuses and penalties */
}
TYPE_of_step;

TYPE_of_step single_steps[] = /* Table of elementary conversions */
{
{ applemac_ibmpc, CODE_APPLEMAC, CODE_IBMPC, STEP LOOSE FAST },
{ NULL, CODE_ASCII, CODE_CDCASCII, ALREADY },
{ ascii_cdcnos, CODE_ASCII, CODE_CDCNOS, STEP EXACT },
{ ascii_flat, CODE_ASCII, CODE_FLAT, STEP LOOSE },
{ ascii_latex, CODE_ASCII, CODE_LATEX, STEP LOOSE SLOW },
{ ascii_texte, CODE_ASCII, CODE_TEXTE, STEP SLOW },
{ bangbang_latin1, CODE_BANGBANG, CODE_LATIN1, STEP EXACT },
{ cccascii_ebcdic, CODE_CCCASCII, CODE_EBCDIC, STEP EXACT FAST },
{ ascii8_ascii7, CODE_CDCASCII, CODE_ASCII, STEP LOOSE FAST },
{ cdcascii_ebcdic, CODE_CDCASCII, CODE_EBCDIC, STEP EXACT FAST },
{ cdcnos_ascii, CODE_CDCNOS, CODE_ASCII, STEP EXACT },
{ ebcdic_cccascii, CODE_EBCDIC, CODE_CCCASCII, STEP EXACT FAST },
{ ebcdic_cdcascii, CODE_EBCDIC, CODE_CDCASCII, STEP EXACT FAST },
{ ibmpc_applemac, CODE_IBMPC, CODE_APPLEMAC, STEP LOOSE FAST },
{ ibmpc_iconqnx, CODE_IBMPC, CODE_ICONQNX, STEP },
{ ibmpc_latin1, CODE_IBMPC, CODE_LATIN1, STEP LOOSE },
{ iconqnx_ibmpc, CODE_ICONQNX, CODE_IBMPC, STEP LOOSE SLOW },
{ latex_ascii, CODE_LATEX, CODE_ASCII, STEP LOOSE SLOW },
{ latex_latin1, CODE_LATEX, CODE_LATIN1, STEP LOOSE SLOW },
{ latin1_bangbang, CODE_LATIN1, CODE_BANGBANG, STEP LOOSE FAST },
{ latin1_ibmpc, CODE_LATIN1, CODE_IBMPC, STEP LOOSE },
{ latin1_latex, CODE_LATIN1, CODE_LATEX, STEP LOOSE },
{ latin1_texte, CODE_LATIN1, CODE_TEXTE, STEP LOOSE },
{ texte_ascii, CODE_TEXTE, CODE_ASCII, STEP SLOW },
{ texte_latin1, CODE_TEXTE, CODE_LATIN1, STEP LOOSE SLOW }
};

#define NUMBER_OF_SINGLE_STEPS (sizeof (single_steps) / sizeof (TYPE_of_step))
recode-3.2.4/recode.c 644 6206 22 55004 5262123674 12132 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1990.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/* Global declarations and definitions. */

#include
#include
#include
#include
#ifdef USG
#include
#else
#include
#define strchr index
#define strrchr rindex
#endif

#include "common.h"
#include "steps.h"

#ifdef MSDOS

#include
#define unlink dummy1
#include
#undef unlink
#include

#endif

/* Standard declarations. */

#ifdef STDC_HEADERS
#include
#endif

/* Some systems do not define EXIT_*, even with STDC_HEADERS. */
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif

#ifdef __STDC__

extern int fstat (int, struct stat *);
extern int getopt (int, const char **, const char *);
extern int link (const char *, const char *);
extern void perror (const char *);
extern int unlink (const char *);
#ifndef MSDOS
extern int utime (const char *, time_t[2]);
#endif

#endif /* __STDC__ */

/* Prototypes specific to the program. */

#ifndef __STDC__
void print_version ();
void print_copyright ();
#else
void print_version (void);
void print_copyright (void);
#endif

/* In the `BEFORE:AFTER' parameter, there is a default supplied whenever
`:AFTER' or `BEFORE:' are used. */

#ifdef MSDOS
#define DEFAULT_CODE "ibmpc"
#else
#define DEFAULT_CODE "latin1"
#endif

/* It is expected that no conversion sequence will need more than this
number of steps. */

#define MAX_CONVERSIONS 10

/* Program name. */

const char *program_name;

/* If the recoding yields some problems in reversability, the replacement is
normally not completed and the file is left unrecoded. The following
option forces the replacement even if the case the recoding is not
reversible. But if recode is used as a mere filter, there is no file
replacement and this option is then irrelevant. */

int force_option = 0;

/* By selecting the following option, the program will echo to stderr the
sequence of elementary recoding steps which will be taken to effect
the requested recoding. */

int verbose_option = 0;

/* When a file is recoded over itself, precautions are taken to move the
timestamps of the original file into the recoded file, so to make the
recoding the most transparent possible to make, and other tools.
However, selecting the following option inhibit the timestamps handling,
thus effectively `touching' the file. */

int touch_option = 0;

/* In `texte' charset, some countries use double quotes to mark diaeresis,
while other countries prefer colons. The following variable contains the
diaeresis character for `texte' charset. Nominally set to a double
quote, it can be forced to a colon by an option on recode command. */

char diaeresis_char = '"';

/* For `latex' charset, it is often convenient to convert the diacritics
only, while letting other LaTeX code using backslashes unconverted.
In the other charset, one can edit text as well as LaTeX directives. */

int diacritics_only = 0;

/* Tells how various passes will be interconnected. */

enum sequence_strategy
{
STRATEGY_UNDECIDED, /* sequencing strategy is undecided yet */
SEQUENCE_WITH_FILES, /* do not fork, use intermediate files */
SEQUENCE_WITH_POPEN, /* use `popen(3)' to fork processes */
SEQUENCE_WITH_PIPE /* fork processes connected with `pipe(2)' */
};
enum sequence_strategy sequence_strategy = STRATEGY_UNDECIDED;


/* Sequence manipulation routines. */

TYPE_of_step
*sequence[MAX_CONVERSIONS]; /* sequence of conversions */
int length_of_sequence; /* length of conversion sequence */

/*-------------------------------------------------------------------------.
| Give code index of name into code_keywords. Returns a negative value if |
| keyword not recognized. |
`-------------------------------------------------------------------------*/

int
code_index (const char *keyword, int length)
{
int counter;

/* If keyword not provided, supply the default code if known. */

#ifdef DEFAULT_CODE
if (length == 0)
{
keyword = DEFAULT_CODE;
length = strlen (DEFAULT_CODE);
}
#endif /* DEFAULT_CODE */

/* Search for the keyword. */

for (counter = 0; counter < NUMBER_OF_KEYWORDS; counter++)
if ((strlen (code_keywords[counter].s) == length
&& strncmp (keyword, code_keywords[counter].s, length) == 0)
|| (strlen (code_keywords[counter].l) == length
&& strncmp (keyword, code_keywords[counter].l, length) == 0))
return counter;

return -1;
}

/*----------------------------------------------------------.
| Find a sequence of single_steps to achieve a conversion. |
`----------------------------------------------------------*/

void
find_sequence (TYPE_code start, TYPE_code goal)
{
struct
{
TYPE_of_step *step; /* step who will bring us nearer to goal */
int cost; /* cost from here through goal */
}
critical_tree[NUMBER_OF_KEYWORDS]; /* critical path tree */

int code; /* current code */
TYPE_of_step *step; /* cursor in possible single_steps */
int cost; /* cost under consideration */
int modified; /* != 0 if modified since last iteration */

for (code = 0; code < NUMBER_OF_KEYWORDS; code++)
{
critical_tree[code].step = NULL;
critical_tree[code].cost = NOWAY;
}
critical_tree[(int) goal].cost = ALREADY;
modified = 1;

while (modified)
{
modified = 0;
for (step = single_steps;
step < single_steps + NUMBER_OF_SINGLE_STEPS;
step++)
if ((cost = critical_tree[(int) step->code_after].cost) != NOWAY)
{
cost += step->conversion_cost;
code = (int) step->code_before;
if (cost < critical_tree[code].cost)
{
critical_tree[code].step = step;
critical_tree[code].cost = cost;
modified = 1;
}
}
}

if (critical_tree[(int) start].cost == NOWAY)
{
fprintf (stderr, "recode: no way to convert from %s to %s.\n",
code_keywords[(int) start].l, code_keywords[(int) goal].l);
exit (EXIT_FAILURE);
}

length_of_sequence = 0;
for (code = (int) start; code != (int) goal; code = (int) step->code_after)
{
step = critical_tree[code].step;
if (step->routine != NULL)
if (length_of_sequence < MAX_CONVERSIONS)
sequence[length_of_sequence++] = step;
else
{
fprintf (stderr, "recode: conversion is too complex.\n");
exit (EXIT_FAILURE);
}
}
}

/*-------------------------------------------------------------------.
| Execute the conversion sequence, using several passes with two |
| alternating intermediate files. This routine assumes at least one |
| needed recoding step. |
`-------------------------------------------------------------------*/

void
execute_pass_sequence (const char *input_name, const char *output_name)
{
int sequence_index; /* index into sequence */
char *temp_input_name; /* step input file name */
char *temp_output_name; /* step output file name */
#ifdef MSDOS
char temp_name_1[13]; /* one temporary file name */
char temp_name_2[13]; /* another temporary file name */
#endif
FILE *input_file; /* input file to recoding step */
FILE *output_file; /* output file from recoding step */
char *exchange_temp; /* for exchanging temporary names */

/* Choose names for intermediate files. */

#ifdef MSDOS
strcpy (temp_name_1, "recodex1.tmp");
strcpy (temp_name_2, "recodex2.tmp");
temp_input_name = temp_name_1;
temp_output_name = temp_name_2;
#else
temp_input_name = tempnam (NULL, "recode.");
temp_output_name = tempnam (NULL, "recode.");
#endif

/* Execute one pass for each step of the sequence. */

for (sequence_index = 0;
sequence_index < length_of_sequence;
sequence_index++)
{

/* Select the input file for this step. */

if (sequence_index == 0)
if (input_name)
{
input_file = fopen (input_name, "r");
assert (input_file);
}
else
input_file = stdin;
else
{
input_file = fopen (temp_input_name, "r");
assert (input_file);
}

/* Select the output file for this step. */

if (sequence_index == length_of_sequence - 1)
if (output_name)
{
output_file = fopen (output_name, "w");
assert (output_file);
}
else
output_file = stdout;
else
{
output_file = fopen (temp_output_name, "w");
assert (output_file);
}

/* Execute one recoding step. */

(*sequence[sequence_index]->routine) (input_file, output_file);

/* Close the input file, unlink it if it was temporary. */

if (sequence_index == 0)
{
if (!input_name)
fclose (input_file);
}
else
{
fclose (input_file);
unlink (temp_input_name);
}

/* Close the output file, exchange names for subsequent step. */

if (sequence_index == length_of_sequence - 1)
{
if (output_name)
fclose (output_file);
}
else
{
fclose (output_file);

exchange_temp = temp_input_name;
temp_input_name = temp_output_name;
temp_output_name = exchange_temp;
}
}

#ifndef MSDOS
free (temp_input_name);
free (temp_output_name);
#endif
}

/*-------------------------------------------------------------------------.
| Execute the conversion sequence, using a chain of invocations of the |
| program through popen. This routine assumes that more than one recoding |
| step is needed. |
`-------------------------------------------------------------------------*/

#ifdef HAVE_POPEN

void
execute_popen_sequence (const char *input_name, const char *output_name)
{
FILE *input_file; /* input file to recoding step */
FILE *output_file; /* output file from recoding step */
char popen_command[80]; /* to receive command string */
int status; /* status to be asserted */

/* Construct a `recode' command for all recoding steps but the first. */

sprintf (popen_command, "%s -o %s %s:%s %s%s",
program_name,
diaeresis_char == ':' ? " -c" : "",
code_keywords[(int) sequence[1]->code_before].l,
code_keywords[(int) sequence[length_of_sequence-1]->code_after].l,
output_name ? "> " : "",
output_name ? output_name : "");

/* Execute the first recoding step. */

if (!input_name)
input_file = stdin;
else if ((input_file = fopen (input_name, "r")) == NULL)
{
perror (input_name);
exit (EXIT_FAILURE);
}

if ((output_file = popen (popen_command, "w")) == NULL)
{
perror (popen_command);
exit (EXIT_FAILURE);
}

(*sequence[0]->routine) (input_file, output_file);

if (input_name)
fclose (input_file);
status = pclose (output_file);
assert (status == 0);
}

#endif /* HAVE_POPEN */

/*-------------------------------------------------------------------------.
| Execute the conversion sequence, forking the program many times for all |
| elementary steps, interconnecting them with pipes. This routine assumes |
| at least one recoding step is needed. |
`-------------------------------------------------------------------------*/

#ifndef HAVE_DUP2
#undef HAVE_PIPE
#endif

#ifdef HAVE_PIPE

void
execute_pipe_sequence (const char *input_name, const char *output_name)
{
int sequence_index; /* index into sequence */
TYPE_of_step *step; /* pointer into single_steps */

FILE *input_file; /* input file to recoding step */
FILE *output_file; /* output file from recoding step */
int pipe_pair[2]; /* pair of file descriptors for a pipe */
int child_process; /* child process number, zero if child */
int status; /* status to be asserted */

/* Prepare the final output file. */

if (output_name)
{
output_file = fopen (output_name, "w");
assert (output_file);
}
else
output_file = stdout;

/* Create all subprocesses and interconnect them. */

for (sequence_index = length_of_sequence - 1;
sequence_index > 0;
sequence_index--)
{
status = pipe (pipe_pair);
assert (status == 0);
child_process = fork ();
assert (child_process >= 0);
if (child_process == 0)
{

/* The child executes its recoding step, reading from the pipe
and writing to the current output file; then it exits. */

status = close (pipe_pair[1]);
assert (status == 0);
input_file = fdopen (pipe_pair[0], "r");
assert (input_file);

(*sequence[sequence_index]->routine) (input_file, output_file);

fclose (input_file);
if (sequence_index < length_of_sequence - 1 || output_name)
fclose (output_file);
exit (EXIT_SUCCESS);
}
else
{

/* The parent redirects the current output file to the pipe. */

status = dup2 (pipe_pair[1], fileno (output_file));
assert (status != -1);
status = close (pipe_pair[0]);
assert (status == 0);
status = close (pipe_pair[1]);
assert (status == 0);
}
}

/* All the children are created, blocked on read. Now, feed the whole
chain of processes with the output of the first recoding step. */

if (!input_name)
input_file = stdin;
else
{
input_file = fopen (input_name, "r");
assert (input_file);
}

(*sequence[0]->routine) (input_file, output_file);

if (input_name)
fclose (input_file);
if (output_name)
fclose (output_file);

/* Wait on all children, mainly to avoid synchronisation problems on
output file contents, but also to reduce the number of zombie
processes in case the user recodes many files at once. */

while (wait (NULL) > 0)
;
}

#endif /* HAVE_PIPE */

/*-----------------------------------------------------------------------.
| Execute the conversion sequence, using the selected strategy whenever |
| more than one conversion step is needed. If no conversion are needed, |
| merely copy the input onto the output. |
`-----------------------------------------------------------------------*/

/* If some sequencing strategies are missing, this routine automatically
uses fallback strategies. */

void
execute_sequence (const char *input_name, const char *output_name)
{
FILE *input_file; /* input file to recoding step */
FILE *output_file; /* output file from recoding step */
int character; /* the whole file will go through */

#ifdef MSDOS
if (!input_name)
setmode (fileno (stdin), O_BINARY);
if (!output_name)
setmode (fileno (stdout), O_BINARY);
_fmode = O_BINARY;
#endif

if (verbose_option && input_name)
{
fprintf (stderr, "Recoding %s...", input_name);
fflush (stderr);
}

if (length_of_sequence > 1)
switch (sequence_strategy)
{
case STRATEGY_UNDECIDED:
assert (0);

case SEQUENCE_WITH_PIPE:
#ifdef HAVE_PIPE
execute_pipe_sequence (input_name, output_name);
break;
#endif

case SEQUENCE_WITH_POPEN:
#ifdef HAVE_POPEN
execute_popen_sequence (input_name, output_name);
break;
#endif

case SEQUENCE_WITH_FILES:
execute_pass_sequence (input_name, output_name);
break;
}
else
{

/* This is a single-step recoding or a mere copy. Do it. */

if (!input_name)
input_file = stdin;
else if ((input_file = fopen (input_name, "r")) == NULL)
{
perror (input_name);
exit (EXIT_FAILURE);
}

if (!output_name)
output_file = stdout;
else if ((output_file = fopen (output_name, "w")) == NULL)
{
perror (output_name);
exit (EXIT_FAILURE);
}

if (length_of_sequence == 1)
(*sequence[0]->routine) (input_file, output_file);
else
while ((character = getc (input_file)) != EOF)
putc (character, output_file);

if (input_name)
fclose (input_file);
if (output_name)
fclose (output_file);
}

if (verbose_option && input_name)
{
fprintf (stderr, " done\n");
fflush (stderr);
}
}


/* Main program. */

void
echo_sequence (void)
{
int sequence_index; /* index into sequence */
TYPE_of_step *step; /* pointer into single_steps */

if (length_of_sequence == 0)
fprintf (stderr, "Recoding by mere copying\n");
else
{
fprintf (stderr, "Recoding through ");
for (sequence_index = 0;
sequence_index < length_of_sequence;
sequence_index++)
{
step = sequence[sequence_index];
fprintf (stderr, "%s%s:%s",
sequence_index == 0 ? "" : " | ",
code_keywords[(int) step->code_before].l,
code_keywords[(int) step->code_after].l);
}
fprintf (stderr, "\n");
}
}

void
usage_and_exit (void)
{
int keyword_index;

print_version ();

fprintf (stderr, "\
usage: recode [OPTION]... [BEFORE]:[AFTER] [FILE]...\n\
-C display Copyright and copying conditions, then exit\n\
-c use colons instead of double quotes for diaeresis\n\
-d limit conversion to diacritics or alike for LaTeX\n\
-f force file replacement even if non reversible\n\
-i use intermediate files for sequencing passes\n\
");
#ifdef HAVE_POPEN
fprintf (stderr, "\
-o use popen machinery for sequencing passes\n\
");
#else
fprintf (stderr, "\
-o interpreted as -i on this system\n\
");
#endif
#ifdef HAVE_PIPE
fprintf (stderr, "\
-p use pipe machinery for sequencing passes\n\
");
#else
fprintf (stderr, "\
-p interpreted as -o on this system\n\
");
#endif
fprintf (stderr, "\
-t touch the recoded files after replacement\n\
-v be verbose, tell elementary steps sequence\n\
");

for (keyword_index = 0;
keyword_index < NUMBER_OF_KEYWORDS;
keyword_index++)
{
if (keyword_index % 4 == 0)
fprintf (stderr, keyword_index == 0 ? " CODE" : "\n");
fprintf (stderr, "\t%s %s",
code_keywords[keyword_index].s,
code_keywords[keyword_index].l);
}
fprintf (stderr, "\n");

fprintf (stderr, "\
Each FILE is recoded over itself, destroying the original. If no\n\
FILE is specified, then act as a filter and recode stdin to stdout.\n\
If none of -i, -o and -p are given, presume -p if no FILE, else -i.\n\
Beware that option `-f' is always selected, even if not given.\n\
\n");

exit (EXIT_FAILURE);
}

int
main (int argc, const char *argv[])
{
extern int optind; /* index of argument */
int option_char; /* option character */
int start_index; /* index of starting code */
int end_index; /* index of end code */
const char *input_name; /* input file name */
char output_name[200]; /* output file name */
FILE *file; /* file to check or stat */
char *cursor; /* all purpose cursor */
#ifdef MSDOS
struct ftime stamp_stat; /* input file time stamps */
#else
struct stat stamp_stat; /* input file time stamps */
time_t stamp_utime[2]; /* recoded file time stamps */
#endif

/* Decode command options. */

program_name = argv[0];

while ((option_char = getopt (argc, argv, "Ccdfioptv")) != EOF)
switch (option_char)
{
case 'C':
print_version ();
print_copyright ();
exit (EXIT_SUCCESS);

case 'c':
diaeresis_char = ':';
break;

case 'd':
diacritics_only = 1;
break;

case 'f':
force_option = 1;
break;

case 'i':
sequence_strategy = SEQUENCE_WITH_FILES;
break;

case 'o':
sequence_strategy = SEQUENCE_WITH_POPEN;
break;

case 'p':
sequence_strategy = SEQUENCE_WITH_PIPE;
break;

case 't':
touch_option = 1;
break;

case 'v':
verbose_option = 1;
break;

default:
usage_and_exit ();
}

/* Decode the BEFORE:AFTER argument. */

if (optind+1 > argc)
usage_and_exit ();

cursor = strchr (argv[optind], ':');
if (!cursor)
usage_and_exit ();
start_index = code_index (argv[optind], cursor - argv[optind]);
if (start_index < 0)
usage_and_exit ();
cursor++;
end_index = code_index (cursor, strlen(cursor));
if (end_index < 0)
usage_and_exit ();
optind++;

/* Establish the sequence of recoding steps. */

length_of_sequence = 0;
find_sequence (start_index, end_index);

if (verbose_option)
echo_sequence ();

/* If there is no input file, act as a filter. Else, recode all files
over themselves. */

if (optind < argc)
{

/* When reading and writing files, unless the user selected otherwise,
avoid forking and use intermediate files. */

if (sequence_strategy == STRATEGY_UNDECIDED)
sequence_strategy = SEQUENCE_WITH_FILES;

/* In case files are recoded over themselves and there is no
recoding step at all, do not even try to touch the files. */

if (length_of_sequence > 0)

/* Process files, one at a time. */

for (; optind < argc; optind++)
{
input_name = argv[optind];

/* Check if the file can be read and rewritten. */

if ((file = fopen (input_name, "r+")) == NULL)
{
perror (input_name);
exit (EXIT_FAILURE);
}

/* Save the input file time stamp. */

if (!touch_option)
{
#ifdef MSDOS
getftime (fileno (file), &stamp_stat);
#else
fstat (fileno (file), &stamp_stat);
#endif
}

fclose (file);

/* Choose an output file in the same directory. */

strcpy (output_name, input_name);
for (cursor = output_name + strlen (output_name);
cursor > output_name && cursor[-1] != '/'
#ifdef MSDOS
&& cursor[-1] != '\\' && cursor[-1] != ':'
#endif
; cursor--)
;
strcpy (cursor, "recodeXX.TMP");

/* Recode the file. */

execute_sequence (input_name, output_name);

/* Move the new file over the original. */

unlink (input_name);
#ifdef HAVE_RENAME
rename (output_name, input_name);
#else
link (output_name, input_name);
unlink (output_name);
#endif

/* Adjust the time stamp for the new file. */

if (!touch_option)
{
#ifdef MSDOS
file = fopen (input_name, "r");
assert (file);
setftime (fileno (file), &stamp_stat);
fclose (file);
#else
stamp_utime[0] = stamp_stat.st_atime;
stamp_utime[1] = stamp_stat.st_mtime;
utime (input_name, stamp_utime);
#endif
}
}
}
else
{

/* When reading stdin and writing stdout, unless the user selected
otherwise, fork processes interconnected with pipes. */

if (sequence_strategy == STRATEGY_UNDECIDED)
sequence_strategy = SEQUENCE_WITH_PIPE;

execute_sequence (NULL, NULL);
}
exit (EXIT_SUCCESS);
}
recode-3.2.4/version.c 644 6206 22 3300 5264655102 12324 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1989.
*/

#ifndef __STDC__
#define const
#define volatile
#endif

#include

/* Should stay one a single line, for `make dist' to work. */
const char *version_string = "\nrecode version 3.2.4\n";

const char *copyright_line
= "Copyright (C) 1991, 1992 Free Software Foundation, Inc.\n";

/*-----------------------------------------------------------.
| Prints package name and version, and the short Copyright. |
`-----------------------------------------------------------*/

void
print_version (void)
{
fprintf (stderr, "%s%s", version_string, copyright_line);
}

/*-----------------------------------.
| Prints a more detailed Copyright. |
`-----------------------------------*/

void
print_copyright (void)
{
fprintf (stderr, "\n\
This program is free software; you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
the Free Software Foundation; either version 2, or (at your option)\n\
any later version.\n\
\n\
This program is distributed in the hope that it will be useful,\n\
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
GNU General Public License for more details.\n\
\n\
You should have received a copy of the GNU General Public License\n\
along with this program; if not, write to the Free Software\n\
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\
\n\
Mail all suggestions and bug reports for this program to its author,\n\
Francois Pinard .\n\
\n");
}
recode-3.2.4/asc8asc7.c 644 6206 22 2157 5244525236 12266 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ascii8_ascii7
#include
#include "common.h"

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while ((input_char = getc (input_file)) != EOF)
if ((input_char & 0200) == 0)
putc (input_char, output_file);
}
recode-3.2.4/ascicdcn.c 644 6206 22 10421 5246715171 12433 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ascii_cdcnos
#include
#include "common.h"

static const char *translation_table[128] =
{
"^5", /* \000 */
"^6", /* \001 */
"^7", /* \002 */
"^8", /* \003 */
"^9", /* \004 */
"^+", /* \005 */
"^-", /* \006 */
"^*", /* \007 */
"^/", /* \010 */
"^(", /* \011 */
"^)", /* \012 */
"^$", /* \013 */
"^=", /* \014 */
"^ ", /* \015 */
"^,", /* \016 */
"^.", /* \017 */
"^#", /* \020 */
"^[", /* \021 */
"^]", /* \022 */
"^%", /* \023 */
"^\"", /* \024 */
"^_", /* \025 */
"^!", /* \026 */
"^&", /* \027 */
"^'", /* \030 */
"^?", /* \031 */
"^<", /* \032 */
"^>", /* \033 */
"^@", /* \034 */
"^\\", /* \035 */
"^^", /* \036 */
"^;", /* \037 */
" ", /* \040 */
"!", /* \041 */
"\"", /* \042 */
"#", /* \043 */
"$", /* \044 */
"%", /* \045 */
"&", /* \046 */
"'", /* \047 */
"(", /* \050 */
")", /* \051 */
"*", /* \052 */
"+", /* \053 */
",", /* \054 */
"-", /* \055 */
".", /* \056 */
"/", /* \057 */
"0", /* \060 */
"1", /* \061 */
"2", /* \062 */
"3", /* \063 */
"4", /* \064 */
"5", /* \065 */
"6", /* \066 */
"7", /* \067 */
"8", /* \070 */
"9", /* \071 */
"@D", /* \072 */
";", /* \073 */
"<", /* \074 */
"=", /* \075 */
">", /* \076 */
"?", /* \077 */
"@A", /* \100 */
"A", /* \101 */
"B", /* \102 */
"C", /* \103 */
"D", /* \104 */
"E", /* \105 */
"F", /* \106 */
"G", /* \107 */
"H", /* \110 */
"I", /* \111 */
"J", /* \112 */
"K", /* \113 */
"L", /* \114 */
"M", /* \115 */
"N", /* \116 */
"O", /* \117 */
"P", /* \120 */
"Q", /* \121 */
"R", /* \122 */
"S", /* \123 */
"T", /* \124 */
"U", /* \125 */
"V", /* \126 */
"W", /* \127 */
"X", /* \130 */
"Y", /* \131 */
"Z", /* \132 */
"[", /* \133 */
"\\", /* \134 */
"]", /* \135 */
"@B", /* \136 */
"_", /* \137 */
"@G", /* \140 */
"^A", /* \141 */
"^B", /* \142 */
"^C", /* \143 */
"^D", /* \144 */
"^E", /* \145 */
"^F", /* \146 */
"^G", /* \147 */
"^H", /* \150 */
"^I", /* \151 */
"^J", /* \152 */
"^K", /* \153 */
"^L", /* \154 */
"^M", /* \155 */
"^N", /* \156 */
"^O", /* \157 */
"^P", /* \160 */
"^Q", /* \161 */
"^R", /* \162 */
"^S", /* \163 */
"^T", /* \164 */
"^U", /* \165 */
"^V", /* \166 */
"^W", /* \167 */
"^X", /* \170 */
"^Y", /* \171 */
"^Z", /* \172 */
"^0", /* \173 */
"^1", /* \174 */
"^2", /* \175 */
"^3", /* \176 */
"^4", /* \177 */
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
const char *output_string; /* translated characters */

while (input_char = getc (input_file), input_char != EOF)
if (input_char == '\n')
putc ('\n', output_file);
else if (input_char & 0200)
putc (input_char, output_file);
else if (output_string = translation_table[input_char], output_string)
while (*output_string)
{
putc (*output_string, output_file);
output_string++;
}
}
recode-3.2.4/asciflat.c 644 6206 22 7107 5260640531 12432 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ascii_flat
#include
#include "common.h"

/* Previous obsolete lex code:

\n { ECHO; }

\000 { output ('^'); output ('@'); }
\001 { output ('^'); output ('A'); }
\002 { output ('^'); output ('B'); }
\003 { output ('^'); output ('C'); }
\004 { output ('^'); output ('D'); }
\005 { output ('^'); output ('E'); }
\006 { output ('^'); output ('F'); }
\007 { output ('\\'); output ('a'); }
\010 { output ('\\'); output ('b'); }
\011 { output ('\\'); output ('t'); }
\012 { output ('\\'); output ('n'); }
\013 { output ('^'); output ('K'); }
\014 { output ('^'); output ('L'); }
\015 { output ('^'); output ('M'); }
\016 { output ('^'); output ('N'); }
\017 { output ('^'); output ('O'); }
\020 { output ('^'); output ('P'); }
\021 { output ('^'); output ('Q'); }
\022 { output ('^'); output ('R'); }
\023 { output ('^'); output ('S'); }
\024 { output ('^'); output ('T'); }
\025 { output ('^'); output ('U'); }
\026 { output ('^'); output ('V'); }
\027 { output ('^'); output ('W'); }
\030 { output ('^'); output ('X'); }
\031 { output ('^'); output ('Y'); }
\032 { output ('^'); output ('Z'); }
\033 { output ('^'); output ('['); }
\034 { output ('^'); output ('\\'); }
\035 { output ('^'); output (']'); }
\036 { output ('^'); output ('^'); }
\037 { output ('^'); output ('_'); }

\177 { output ('D'); output ('E'); output ('L'); }

['`^",_]\b. { output (yytext[2]); }
.\b['`^",_] { output (yytext[0]); }

*/

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
int temp_char; /* look ahead character */

input_char = getc (input_file);
while (1)
switch (input_char)
{
case EOF:
return;

case '\n':
putc ('\n', output_file);
input_char = getc (input_file);
break;

case '\b':
input_char = getc (input_file);
switch (input_char)
{
case EOF:
putc ('^', output_file);
putc ('H', output_file);
return;

case '\'':
case '`':
case '^':
case '"':
case ',':
case '_':
input_char = getc (input_file);
break;

default:
putc ('^', output_file);
putc ('H', output_file);
}
break;

case '\'':
case '`':
case '^':
case '"':
case ',':
case '_':
temp_char = getc (input_file);
if (temp_char == '\b')
input_char = getc (input_file);
else
{
putc (input_char, output_file);
input_char = temp_char;
}
break;

default:
if (input_char & 0200)
{
putc ('M', output_file);
putc ('-', output_file);
input_char &= 0177;
}
if (input_char < ' ' || input_char == 0177)
{
putc ('^', output_file);
input_char ^= 0100;
}
putc (input_char, output_file);
input_char = getc (input_file);
}
}
recode-3.2.4/banglat1.c 644 6206 22 10367 5244525277 12372 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP bangbang_latin1
#include
#include "common.h"

/* Previous obsolete lex code:

[A-Z] { output (yytext[0]-'A'+'a'); }

!\" { output ('!'); }

!0 { output ('\340'); /+ a` +/ }
!1 { output ('\342'); /+ a^ +/ }
!2 { output ('\351'); /+ e' +/ }
!3 { output ('\350'); /+ e` +/ }
!4 { output ('\353'); /+ e" +/ }
!5 { output ('\352'); /+ e^ +/ }
!6 { output ('\354'); /+ e" +/ }
!7 { output ('\356'); /+ i^ +/ }
!8 { output ('\364'); /+ o^ +/ }
!9 { output ('\371'); /+ u` +/ }
!: { output ('\373'); /+ u^ +/ }

!= { output ('\347'); /+ c, +/ }
!> { output ('\253'); /+ `` +/ }
!\? { output ('\273'); /+ '' +/ }

!@ { output ('`'); }

![A-Z] { output (yytext[1]); }

!\[ { output ('{'); }
!\\ { output ('|'); }
!] { output ('}'); }
!^ { output ('~'); }

!_ { output ('\177'); }

![a-z] { output (yytext[1]-'a'+'A'); }

!!@ { output ('\000'); }

!![A-Z] { output (yytext[2]-'A'+1); }

!!\[ { output ('\033'); }
!!\\ { output ('\034'); }
!!] { output ('\035'); }
!!^ { output ('\036'); }
!!_ { output ('\037'); }

!![a-z] { output (yytext[2]-'a'+1); }

*/

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while ((input_char = getc (input_file)) != EOF)
{
if (input_char >= 'A' && input_char <= 'Z')
input_char += 'a' - 'A';
else if (input_char == '!')
{
input_char = getc (input_file);
if (input_char >= 'a' && input_char <= 'z')
input_char += 'A' - 'a';
else if (input_char < 'A' || input_char > 'Z')
switch (input_char)
{
case '"': input_char = '!'; break;
case '0': input_char = '\340'; break; /* a` */
case '1': input_char = '\342'; break; /* a^ */
case '2': input_char = '\351'; break; /* e' */
case '3': input_char = '\350'; break; /* e` */
case '4': input_char = '\353'; break; /* e" */
case '5': input_char = '\352'; break; /* e^ */
case '6': input_char = '\354'; break; /* e" */
case '7': input_char = '\356'; break; /* i^ */
case '8': input_char = '\364'; break; /* o^ */
case '9': input_char = '\371'; break; /* u` */
case ':': input_char = '\373'; break; /* u^ */
case '=': input_char = '\347'; break; /* c, */
case '>': input_char = '\253'; break; /* `` */
case '?': input_char = '\273'; break; /* '' */
case '@': input_char = '`'; break;
case '[': input_char = '{'; break;
case '\\': input_char = '|'; break;
case ']': input_char = '}'; break;
case '^': input_char = '~'; break;
case '_': input_char = '\177'; break; /* del */

case '!':
input_char = getc (input_file);
if (input_char >= 'A' && input_char <= 'Z')
input_char += 1 - 'A';
else if (input_char >= 'a' && input_char <= 'z')
input_char += 1 - 'a';
else
switch (input_char)
{
case '@': input_char = '\000'; break;
case '[': input_char = '\033'; break;
case '\\': input_char = '\034'; break;
case ']': input_char = '\035'; break;
case '^': input_char = '\036'; break;
case '_': input_char = '\037'; break;

default:
putc ('!', output_file);
putc ('!', output_file);
if (input_char == EOF)
return;
}
break;

default:
putc ('!', output_file);
if (input_char == EOF)
return;
}
}
putc (input_char, output_file);
}
}
recode-3.2.4/cccaebcd.c 644 6206 22 6501 5244525211 12347 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP cccascii_ebcdic
#include
#include "common.h"

static unsigned char translation_table[256] =
{
'\000', '\001', '\002', '\003', '\067', '\055', '\056', '\057',
'\026', '\005', '\045', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\074', '\075', '\062', '\046',
'\030', '\031', '\077', '\047', '\034', '\035', '\036', '\037',
'\100', '\132', '\177', '\173', '\133', '\154', '\120', '\175',
'\115', '\135', '\134', '\116', '\153', '\140', '\113', '\141',
'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
'\370', '\371', '\172', '\136', '\114', '\176', '\156', '\157',
'\174', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
'\310', '\311', '\321', '\322', '\323', '\324', '\325', '\326',
'\327', '\330', '\331', '\342', '\343', '\344', '\345', '\346',
'\347', '\350', '\351', '\112', '\340', '\117', '\137', '\155',
'\171', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
'\210', '\211', '\221', '\222', '\223', '\224', '\225', '\226',
'\227', '\230', '\231', '\242', '\243', '\244', '\245', '\246',
'\247', '\250', '\251', '\300', '\152', '\320', '\241', '\007',
'\004', '\006', '\010', '\011', '\012', '\024', '\025', '\027',
'\032', '\033', '\212', '\213', '\214', '\215', '\216', '\217',
'\040', '\041', '\042', '\043', '\044', '\050', '\051', '\052',
'\053', '\054', '\232', '\233', '\234', '\235', '\236', '\237',
'\060', '\061', '\063', '\064', '\065', '\066', '\070', '\071',
'\072', '\073', '\252', '\253', '\254', '\255', '\256', '\257',
'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
'\200', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
'\110', '\111', '\312', '\313', '\314', '\315', '\316', '\317',
'\220', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
'\130', '\131', '\332', '\333', '\334', '\335', '\336', '\337',
'\240', '\341', '\142', '\143', '\144', '\145', '\146', '\147',
'\150', '\151', '\352', '\353', '\354', '\355', '\356', '\357',
'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
'\170', '\076', '\372', '\373', '\374', '\375', '\376', '\377',
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while (input_char = getc (input_file), input_char != EOF)
putc (translation_table[input_char], output_file);
}
recode-3.2.4/cdcaebcd.c 644 6206 22 6501 5244525347 12362 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP cdcascii_ebcdic
#include
#include "common.h"

static unsigned char translation_table[256] =
{
'\000', '\001', '\002', '\003', '\067', '\055', '\056', '\057',
'\026', '\005', '\045', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\074', '\075', '\062', '\046',
'\030', '\031', '\077', '\047', '\034', '\035', '\036', '\037',
'\100', '\117', '\177', '\173', '\133', '\154', '\120', '\175',
'\115', '\135', '\134', '\116', '\153', '\140', '\113', '\141',
'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
'\370', '\371', '\172', '\136', '\114', '\176', '\156', '\157',
'\174', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
'\310', '\311', '\321', '\322', '\323', '\324', '\325', '\326',
'\327', '\330', '\331', '\342', '\343', '\344', '\345', '\346',
'\347', '\350', '\351', '\112', '\340', '\132', '\137', '\155',
'\171', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
'\210', '\211', '\221', '\222', '\223', '\224', '\225', '\226',
'\227', '\230', '\231', '\242', '\243', '\244', '\245', '\246',
'\247', '\250', '\251', '\300', '\152', '\320', '\241', '\007',
'\040', '\041', '\042', '\043', '\044', '\025', '\006', '\027',
'\050', '\051', '\052', '\053', '\054', '\011', '\012', '\033',
'\060', '\061', '\032', '\063', '\064', '\065', '\066', '\010',
'\070', '\071', '\072', '\073', '\004', '\024', '\076', '\341',
'\101', '\102', '\103', '\104', '\105', '\106', '\107', '\110',
'\111', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
'\130', '\131', '\142', '\143', '\144', '\145', '\146', '\147',
'\150', '\151', '\160', '\161', '\162', '\163', '\164', '\165',
'\166', '\167', '\170', '\200', '\212', '\213', '\214', '\215',
'\216', '\217', '\220', '\232', '\233', '\234', '\235', '\236',
'\237', '\240', '\252', '\253', '\254', '\255', '\256', '\257',
'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
'\312', '\313', '\314', '\315', '\316', '\317', '\332', '\333',
'\334', '\335', '\336', '\337', '\352', '\353', '\354', '\355',
'\356', '\357', '\372', '\373', '\374', '\375', '\376', '\377',
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while (input_char = getc (input_file), input_char != EOF)
putc (translation_table[input_char], output_file);
}
recode-3.2.4/cdcnasci.c 644 6206 22 11145 5244525413 12433 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP cdcnos_ascii
#include
#include "common.h"

/* Previous obsolete lex code:

@A { output ('@'); }
@B { output ('^'); }
@D { output (':'); }
@G { output ('`'); }

\^\040 { output ('\015'); }
\^! { output ('\026'); }
\^\" { output ('\024'); }
\^# { output ('\020'); }
\^$ { output ('\013'); }
\^\% { output ('\023'); }
\^& { output ('\027'); }
\^' { output ('\030'); }
\^\( { output ('\011'); }
\^\) { output ('\012'); }
\^\* { output ('\007'); }
\^\+ { output ('\005'); }
\^\, { output ('\016'); }
\^- { output ('\006'); }
\^\. { output ('\017'); }
\^\/ { output ('\010'); }

\^0 { output ('{'); }
\^1 { output ('|'); }
\^2 { output ('}'); }
\^3 { output ('~'); }
\^4 { output ('\177'); }

\^5 { output ('\000'); }
\^6 { output ('\001'); }
\^7 { output ('\002'); }
\^8 { output ('\003'); }
\^9 { output ('\004'); }

\^; { output ('\037'); }
\^< { output ('\032'); }
\^= { output ('\014'); }
\^> { output ('\033'); }
\^? { output ('\031'); }
\^@ { output ('\034'); }

\^[A-Z] { output (yytext[1]-'A'+'a'); }

\^\[ { output ('\021'); }
\^\\ { output ('\035'); }
\^] { output ('\022'); }
\^\^ { output ('\036'); }
\^_ { output ('\025'); }

\^[a-z] { output (yytext[1]); }

*/

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while ((input_char = getc (input_file)) != EOF)
{
switch (input_char)
{
case '@':
switch ((input_char = getc (input_file)))
{
case 'A': case 'a': input_char = '@'; break;
case 'B': case 'b': input_char = '^'; break;
case 'D': case 'd': input_char = ':'; break;
case 'G': case 'g': input_char = '`'; break;

default:
putc ('@', output_file);
if (input_char == EOF)
return;
}
break;

case '^':
input_char = getc (input_file);
if (input_char >= 'A' && input_char <= 'Z')
input_char += 'a' - 'A';
else if (input_char < 'a' || input_char > 'z')
switch (input_char)
{
case ' ': input_char = '\015'; break;
case '!': input_char = '\026'; break;
case '"': input_char = '\024'; break;
case '#': input_char = '\020'; break;
case '$': input_char = '\013'; break;
case '%': input_char = '\023'; break;
case '&': input_char = '\027'; break;
case '\'': input_char = '\030'; break;
case '(': input_char = '\011'; break;
case ')': input_char = '\012'; break;
case '*': input_char = '\007'; break;
case '+': input_char = '\005'; break;
case ',': input_char = '\016'; break;
case '-': input_char = '\006'; break;
case '.': input_char = '\017'; break;
case '/': input_char = '\010'; break;
case '0': input_char = '{'; break;
case '1': input_char = '|'; break;
case '2': input_char = '}'; break;
case '3': input_char = '~'; break;
case '4': input_char = '\177'; break;
case '5': input_char = '\000'; break;
case '6': input_char = '\001'; break;
case '7': input_char = '\002'; break;
case '8': input_char = '\003'; break;
case '9': input_char = '\004'; break;
case ';': input_char = '\037'; break;
case '<': input_char = '\032'; break;
case '=': input_char = '\014'; break;
case '>': input_char = '\033'; break;
case '?': input_char = '\031'; break;
case '@': input_char = '\034'; break;
case '[': input_char = '\021'; break;
case '\\': input_char = '\035'; break;
case ']': input_char = '\022'; break;
case '^': input_char = '\036'; break;
case '_': input_char = '\025'; break;

default:
putc ('^', output_file);
if (input_char == EOF)
return;
}
break;
}
putc (input_char, output_file);
}
}
recode-3.2.4/ebcdccca.c 644 6206 22 6443 5244525465 12367 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ebcdic_cccascii
#include
#include "common.h"

static unsigned char translation_table[256] =
{
'\000', '\001', '\002', '\003', '\200', '\011', '\201', '\177',
'\202', '\203', '\204', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\205', '\206', '\010', '\207',
'\030', '\031', '\210', '\211', '\034', '\035', '\036', '\037',
'\220', '\221', '\222', '\223', '\224', '\012', '\027', '\033',
'\225', '\226', '\227', '\230', '\231', '\005', '\006', '\007',
'\240', '\241', '\026', '\242', '\243', '\244', '\245', '\004',
'\246', '\247', '\250', '\251', '\024', '\025', '\371', '\032',
'\040', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
'\310', '\311', '\133', '\056', '\074', '\050', '\053', '\135',
'\046', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
'\330', '\331', '\041', '\044', '\052', '\051', '\073', '\136',
'\055', '\057', '\342', '\343', '\344', '\345', '\346', '\347',
'\350', '\351', '\174', '\054', '\045', '\137', '\076', '\077',
'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
'\370', '\140', '\072', '\043', '\100', '\047', '\075', '\042',
'\300', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
'\150', '\151', '\212', '\213', '\214', '\215', '\216', '\217',
'\320', '\152', '\153', '\154', '\155', '\156', '\157', '\160',
'\161', '\162', '\232', '\233', '\234', '\235', '\236', '\237',
'\340', '\176', '\163', '\164', '\165', '\166', '\167', '\170',
'\171', '\172', '\252', '\253', '\254', '\255', '\256', '\257',
'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
'\173', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
'\110', '\111', '\312', '\313', '\314', '\315', '\316', '\317',
'\175', '\112', '\113', '\114', '\115', '\116', '\117', '\120',
'\121', '\122', '\332', '\333', '\334', '\335', '\336', '\337',
'\134', '\341', '\123', '\124', '\125', '\126', '\127', '\130',
'\131', '\132', '\352', '\353', '\354', '\355', '\356', '\357',
'\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
'\070', '\071', '\372', '\373', '\374', '\375', '\376', '\377',
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while (input_char = getc (input_file), input_char != EOF)
putc (translation_table[input_char], output_file);
}
recode-3.2.4/ebcdcdca.c 644 6206 22 6443 5244525504 12362 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ebcdic_cdcascii
#include
#include "common.h"

static unsigned char translation_table[256] =
{
'\000', '\001', '\002', '\003', '\234', '\011', '\206', '\177',
'\227', '\215', '\216', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\235', '\205', '\010', '\207',
'\030', '\031', '\222', '\217', '\034', '\035', '\036', '\037',
'\200', '\201', '\202', '\203', '\204', '\012', '\027', '\033',
'\210', '\211', '\212', '\213', '\214', '\005', '\006', '\007',
'\220', '\221', '\026', '\223', '\224', '\225', '\226', '\004',
'\230', '\231', '\232', '\233', '\024', '\025', '\236', '\032',
'\040', '\240', '\241', '\242', '\243', '\244', '\245', '\246',
'\247', '\250', '\133', '\056', '\074', '\050', '\053', '\041',
'\046', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
'\260', '\261', '\135', '\044', '\052', '\051', '\073', '\136',
'\055', '\057', '\262', '\263', '\264', '\265', '\266', '\267',
'\270', '\271', '\174', '\054', '\045', '\137', '\076', '\077',
'\272', '\273', '\274', '\275', '\276', '\277', '\300', '\301',
'\302', '\140', '\072', '\043', '\100', '\047', '\075', '\042',
'\303', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
'\150', '\151', '\304', '\305', '\306', '\307', '\310', '\311',
'\312', '\152', '\153', '\154', '\155', '\156', '\157', '\160',
'\161', '\162', '\313', '\314', '\315', '\316', '\317', '\320',
'\321', '\176', '\163', '\164', '\165', '\166', '\167', '\170',
'\171', '\172', '\322', '\323', '\324', '\325', '\326', '\327',
'\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
'\173', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
'\110', '\111', '\350', '\351', '\352', '\353', '\354', '\355',
'\175', '\112', '\113', '\114', '\115', '\116', '\117', '\120',
'\121', '\122', '\356', '\357', '\360', '\361', '\362', '\363',
'\134', '\237', '\123', '\124', '\125', '\126', '\127', '\130',
'\131', '\132', '\364', '\365', '\366', '\367', '\370', '\371',
'\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
'\070', '\071', '\372', '\373', '\374', '\375', '\376', '\377',
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while (input_char = getc (input_file), input_char != EOF)
putc (translation_table[input_char], output_file);
}
recode-3.2.4/ibmpicon.c 644 6206 22 4642 5244525540 12451 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ibmpc_iconqnx
#include
#include "common.h"

#define DOS_EOF 0x1A /* MS-DOS old end-of-file */
#define ESCAPE 0x19 /* Escape for diacritic application */
#define ENDLINE 0x1E /* End-line code for QNX */

#define TRANSLATE_AND_BREAK(c2, c3) \
putc (ESCAPE, output_file); \
putc (c2, output_file); \
putc (c3, output_file); \
input_char = getc (input_file); \
break;

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char;

input_char = getc (input_file);
while (input_char != EOF && input_char != DOS_EOF)
switch (input_char)
{
case 0x85: TRANSLATE_AND_BREAK ('A', 'a');
case 0x8A: TRANSLATE_AND_BREAK ('A', 'e');
case 0x97: TRANSLATE_AND_BREAK ('A', 'u');
case 0x82: TRANSLATE_AND_BREAK ('B', 'e');
case 0x90: TRANSLATE_AND_BREAK ('B', 'E');
case 0x83: TRANSLATE_AND_BREAK ('C', 'a');
case 0x88: TRANSLATE_AND_BREAK ('C', 'e');
case 0x8C: TRANSLATE_AND_BREAK ('C', 'i');
case 0x93: TRANSLATE_AND_BREAK ('C', 'o');
case 0x96: TRANSLATE_AND_BREAK ('C', 'u');
case 0x89: TRANSLATE_AND_BREAK ('H', 'e');
case 0x8B: TRANSLATE_AND_BREAK ('H', 'i');
case 0x81: TRANSLATE_AND_BREAK ('H', 'u');
case 0x87: TRANSLATE_AND_BREAK ('K', 'c');
case 0x80: TRANSLATE_AND_BREAK ('K', 'C');

case 0x0D:
input_char = getc (input_file);
if (input_char == 0x0A)
{
putc (ENDLINE, output_file);
input_char = getc (input_file);
}
else
putc (0x0D, output_file);
break;

default:
putc (input_char, output_file);
input_char = getc (input_file);
}
}
recode-3.2.4/ibmplat1.c 644 6206 22 12076 5244525570 12405 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ibmpc_latin1
#include
#include "common.h"

#define DOS_EOF 0x1A /* MS-DOS old end-of-file */

static const char *translation_table[128] =
{
"\307", /* \200 C, */
"\374", /* \201 u" */
"\351", /* \202 e' */
"\342", /* \203 a^ */
"\344", /* \204 a" */
"\340", /* \205 a` */
"\345", /* \206 aa */
"\347", /* \207 c, */
"\352", /* \210 e^ */
"\353", /* \211 e" */
"\350", /* \212 e` */
"\357", /* \213 i" */
"\356", /* \214 i^ */
"\354", /* \215 i` */
"\304", /* \216 A" */
"\305", /* \217 AA */
"\311", /* \220 E' */
"\346", /* \221 ae */
"\306", /* \222 AE */
"\364", /* \223 o^ */
"\366", /* \224 o" */
"\362", /* \225 o` */
"\373", /* \226 u^ */
"\371", /* \227 u` */
"\377", /* \230 y" */
"\326", /* \231 O" */
"\334", /* \232 U" */
"\242", /* \233 \cent */
"\243", /* \234 \pound */
"\245", /* \235 \yen */
"", /* \236 */
"", /* \237 */
"\341", /* \240 a' */
"\355", /* \241 i' */
"\363", /* \242 o' */
"\372", /* \243 u' */
"\361", /* \244 n~ */
"\321", /* \245 N~ */
"\252", /* \246 a_ */
"\272", /* \247 o_ */
"\277", /* \250 ?' */
"<->", /* \251 */
"\254", /* \252 \neg */
"\274", /* \253 1/2 */
"\273", /* \254 1/4 */
"\241", /* \255 !` */
"\253", /* \256 `` */
"\273", /* \257 '' */
"#", /* \260 */
"#", /* \261 */
"#", /* \262 */
"|", /* \263 */
"+", /* \264 */
"|", /* \265 */
"+", /* \266 */
"+", /* \267 */
"=", /* \270 */
"=", /* \271 */
"|", /* \272 */
"=", /* \273 */
"=", /* \274 */
"+", /* \275 */
"=", /* \276 */
"+", /* \277 */
"+", /* \300 */
"+", /* \301 */
"+", /* \302 */
"+", /* \303 */
"-", /* \304 */
"+", /* \305 */
"|", /* \306 */
"+", /* \307 */
"=", /* \310 */
"=", /* \311 */
"=", /* \312 */
"=", /* \313 */
"=", /* \314 */
"=", /* \315 */
"=", /* \316 */
"=", /* \317 */
"+", /* \320 */
"=", /* \321 */
"+", /* \322 */
"+", /* \323 */
"=", /* \324 */
"=", /* \325 */
"+", /* \326 */
"+", /* \327 */
"=", /* \330 */
"+", /* \331 */
"+", /* \332 */
"#", /* \333 */
"#", /* \334 */
"#", /* \335 */
"#", /* \336 */
"#", /* \337 */
"", /* \340 */
"\337", /* \341 \ss */
"", /* \342 */
"", /* \343 */
"", /* \344 */
"", /* \345 */
"\265", /* \346 \micro */
"", /* \347 */
"", /* \350 */
"", /* \351 */
"", /* \352 */
"", /* \353 */
"", /* \354 */
"", /* \355 */
"", /* \356 */
"", /* \357 */
"", /* \360 */
"\261", /* \361 +- */
">=", /* \362 */
"<=", /* \363 */
"", /* \364 */
"", /* \365 */
"\327", /* \366 \div */
"", /* \367 */
"\260", /* \370 \deg */
"<*>", /* \371 */
"\267", /* \372 \cdot */
"", /* \373 */
"<^n>", /* \374 */
"\262", /* \375 ^2 */
"<#>", /* \376 */
"\240", /* \377 \ */
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
const char *output_string; /* translated characters */

input_char = getc (input_file);
while (input_char != EOF && input_char != DOS_EOF)
if ((input_char & 0377) < 0200)
if (input_char == 0x0D)
{
input_char = getc (input_file);
if (input_char == 0x0A)
{
putc ('\n', output_file);
input_char = getc (input_file);
}
else
putc (0x0D, output_file);
}
else
{
putc (input_char, output_file);
input_char = getc (input_file);
}
else
{
if (output_string = translation_table[input_char & 0177],
output_string)
while (*output_string)
{
putc (*output_string, output_file);
output_string++;
}
input_char = getc (input_file);
}
}
recode-3.2.4/ibmpmaci.c 644 6206 22 6204 5244525617 12433 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ibmpc_applemac
#include
#include "common.h"

#define DOS_EOF 0x1A /* MS-DOS old end-of-file */

static unsigned char translation_table[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, /* 11 */
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, /* 23 */
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, /* 35 */
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 47 */
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 59 */
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, /* 71 */
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, /* 83 */
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 95 */
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, /* 107 */
108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 119 */
120, 121, 122, 123, 124, 125, 126, 127, 130, 159, 142, 137, /* 131 */
138, 136, 140, 141, 144, 145, 143, 149, 148, 147, 128, 129, /* 143 */
131, 190, 174, 153, 154, 152, 158, 157, 0, 133, 134, 162, /* 155 */
163, 180, 0, 196, 135, 146, 151, 156, 150, 132, 187, 188, /* 167 */
192, 169, 170, 171, 172, 193, 199, 200, 0, 0, 0, 0, /* 179 */
0, 0, 0, 0, 184, 0, 186, 0, 0, 0, 0, 191, /* 191 */
0, 0, 194, 195, 0, 0, 198, 0, 0, 201, 202, 203, /* 203 */
204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 0, 215, /* 215 */
216, 217, 218, 219, 220, 221, 222, 223, 224, 167, 226, 185, /* 227 */
183, 229, 181, 231, 232, 233, 189, 182, 176, 237, 238, 239, /* 239 */
240, 177, 179, 178, 244, 245, 214, 197, 161, 249, 165, 251, /* 251 */
252, 253, 254, 255,
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
int output_char; /* translated character */

input_char = getc (input_file);
while (input_char != EOF && input_char != DOS_EOF)
if (input_char == 0x0D)
{
input_char = getc (input_file);
if (input_char == 0x0A)
{
putc ('\n', output_file);
input_char = getc (input_file);
}
else
putc (0x0D, output_file);
}
else
{
if ((output_char = translation_table[input_char]) != '\0')
putc (output_char, output_file);
input_char = getc (input_file);
}
}
recode-3.2.4/iconibmp.c 644 6206 22 7245 5244525652 12457 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP iconqnx_ibmpc
#include
#include "common.h"

/* Previous obsolete lex code:

Esc \031

%%

{Esc}Aa { output (0x85); }
{Esc}Ae { output (0x8A); }
{Esc}Au { output (0x97); }

{Esc}Be { output (0x82); }
{Esc}BE { output (0x90); }

{Esc}Ca { output (0x83); }
{Esc}Ce { output (0x88); }
{Esc}Ci { output (0x8C); }
{Esc}Co { output (0x93); }
{Esc}Cu { output (0x96); }

{Esc}He { output (0x89); }
{Esc}Hi { output (0x8B); }
{Esc}Hu { output (0x81); }

{Esc}Kc { output (0x87); }
{Esc}KC { output (0x80); }

*/

#define ESCAPE 0x19 /* Escape for diacritic application */
#define ENDLINE 0x1E /* End-line code for QNX */

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */

while (input_char = getc (input_file), input_char != EOF)
{
switch (input_char)
{
case ENDLINE:
putc (0x0D, output_file);
putc (0x0A, output_file);
break;

case ESCAPE:
input_char = getc (input_file);
switch (input_char)
{
case 'A':
input_char = getc (input_file);
switch (input_char)
{
case 'a': input_char = 0x85; break;
case 'e': input_char = 0x8a; break;
case 'u': input_char = 0x97; break;

default:
putc (ESCAPE, output_file);
putc ('A', output_file);
if (input_char == EOF)
return;
}
break;

case 'B':
input_char = getc (input_file);
switch (input_char)
{
case 'e': input_char = 0x82; break;
case 'E': input_char = 0x90; break;

default:
putc (ESCAPE, output_file);
putc ('B', output_file);
if (input_char == EOF)
return;
}
break;

case 'C':
input_char = getc (input_file);
switch (input_char)
{
case 'a': input_char = 0x83; break;
case 'e': input_char = 0x88; break;
case 'i': input_char = 0x8c; break;
case 'o': input_char = 0x93; break;
case 'u': input_char = 0x96; break;

default:
putc (ESCAPE, output_file);
putc ('C', output_file);
if (input_char == EOF)
return;
}
break;

case 'H':
input_char = getc (input_file);
switch (input_char)
{
case 'e': input_char = 0x89; break;
case 'i': input_char = 0x8b; break;
case 'u': input_char = 0x81; break;

default:
putc (ESCAPE, output_file);
putc ('H', output_file);
if (input_char == EOF)
return;
}
break;

case 'K':
input_char = getc (input_file);
switch (input_char)
{
case 'c': input_char = 0x87; break;
case 'C': input_char = 0x80; break;

default:
putc (ESCAPE, output_file);
putc ('K', output_file);
if (input_char == EOF)
return;
}
break;

default:
putc (ESCAPE, output_file);
if (input_char == EOF)
return;
}
/* fall through */

default:
putc (input_char, output_file);
}
}
}
recode-3.2.4/lat1bang.c 644 6206 22 22417 5244525700 12360 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP latin1_bangbang
#include
#include "common.h"

static const char *translation_table[256] =
{
"!!@", /* \000 */
"!!a", /* \001 */
"!!b", /* \002 */
"!!c", /* \003 */
"!!d", /* \004 */
"!!e", /* \005 */
"!!f", /* \006 */
"!!g", /* \007 */
"!!h", /* \010 */
"!!i", /* \011 */
"!!j", /* \012 */
"!!k", /* \013 */
"!!l", /* \014 */
"!!m", /* \015 */
"!!n", /* \016 */
"!!o", /* \017 */
"!!p", /* \020 */
"!!q", /* \021 */
"!!r", /* \022 */
"!!s", /* \023 */
"!!t", /* \024 */
"!!u", /* \025 */
"!!v", /* \026 */
"!!w", /* \027 */
"!!x", /* \030 */
"!!y", /* \031 */
"!!z", /* \032 */
"!![", /* \033 */
"!!\\", /* \034 */
"!!]", /* \035 */
"!!^", /* \036 */
"!!_", /* \037 */
" ", /* \040 */
"!\"", /* \041 */
"\"", /* \042 */
"#", /* \043 */
"$", /* \044 */
"%", /* \045 */
"&", /* \046 */
"'", /* \047 */
"(", /* \050 */
")", /* \051 */
"*", /* \052 */
"+", /* \053 */
",", /* \054 */
"-", /* \055 */
".", /* \056 */
"/", /* \057 */
"0", /* \060 */
"1", /* \061 */
"2", /* \062 */
"3", /* \063 */
"4", /* \064 */
"5", /* \065 */
"6", /* \066 */
"7", /* \067 */
"8", /* \070 */
"9", /* \071 */
":", /* \072 */
";", /* \073 */
"<", /* \074 */
"=", /* \075 */
">", /* \076 */
"?", /* \077 */
"@", /* \100 */
"!a", /* \101 */
"!b", /* \102 */
"!c", /* \103 */
"!d", /* \104 */
"!e", /* \105 */
"!f", /* \106 */
"!g", /* \107 */
"!h", /* \110 */
"!i", /* \111 */
"!j", /* \112 */
"!k", /* \113 */
"!l", /* \114 */
"!m", /* \115 */
"!n", /* \116 */
"!o", /* \117 */
"!p", /* \120 */
"!q", /* \121 */
"!r", /* \122 */
"!s", /* \123 */
"!t", /* \124 */
"!u", /* \125 */
"!v", /* \126 */
"!w", /* \127 */
"!x", /* \130 */
"!y", /* \131 */
"!z", /* \132 */
"[", /* \133 */
"\\", /* \134 */
"]", /* \135 */
"^", /* \136 */
"_", /* \137 */
"!@", /* \140 */
"a", /* \141 */
"b", /* \142 */
"c", /* \143 */
"d", /* \144 */
"e", /* \145 */
"f", /* \146 */
"g", /* \147 */
"h", /* \150 */
"i", /* \151 */
"j", /* \152 */
"k", /* \153 */
"l", /* \154 */
"m", /* \155 */
"n", /* \156 */
"o", /* \157 */
"p", /* \160 */
"q", /* \161 */
"r", /* \162 */
"s", /* \163 */
"t", /* \164 */
"u", /* \165 */
"v", /* \166 */
"w", /* \167 */
"x", /* \170 */
"y", /* \171 */
"z", /* \172 */
"![", /* \173 */
"!\\", /* \174 */
"!]", /* \175 */
"!^", /* \176 */
"!_", /* \177 */

NULL, /* \200 */
NULL, /* \201 */
NULL, /* \202 */
NULL, /* \203 */
NULL, /* \204 */
NULL, /* \205 */
NULL, /* \206 */
NULL, /* \207 */
NULL, /* \210 */
NULL, /* \211 */
NULL, /* \212 */
NULL, /* \213 */
NULL, /* \214 */
NULL, /* \215 */
NULL, /* \216 */
NULL, /* \217 */
NULL, /* \220 */
NULL, /* \221 */
NULL, /* \222 */
NULL, /* \223 */
NULL, /* \224 */
NULL, /* \225 */
NULL, /* \226 */
NULL, /* \227 */
NULL, /* \230 */
NULL, /* \231 */
NULL, /* \232 */
NULL, /* \233 */
NULL, /* \234 */
NULL, /* \235 */
NULL, /* \236 */
NULL, /* \237 */

" ", /* \240 no-break space */
NULL, /* \241 inverted exclamation mark */
NULL, /* \242 cent sign */
NULL, /* \243 pound sign */
NULL, /* \244 currency sign */
NULL, /* \245 yen sign */
NULL, /* \246 broken bar */
NULL, /* \247 paragraph sign, section sign */
NULL, /* \250 diaeresis */
NULL, /* \251 copyright sign */
NULL, /* \252 feminine ordinal indicator */
"!>", /* \253 left angle quotation mark */
NULL, /* \254 not sign */
NULL, /* \255 soft hyphen */
NULL, /* \256 registered trade mark sign */
NULL, /* \257 macron */
NULL, /* \260 degree sign */
NULL, /* \261 plus-minus sign */
NULL, /* \262 superscript two */
NULL, /* \263 superscript three */
NULL, /* \264 acute accent */
NULL, /* \265 small greek mu, micro sign */
NULL, /* \266 pilcrow sign */
NULL, /* \267 middle dot */
NULL, /* \270 cedilla */
NULL, /* \271 superscript one */
NULL, /* \272 masculine ordinal indicator */
"!?", /* \273 right angle quotation mark */
NULL, /* \274 vulgar fraction one quarter */
NULL, /* \275 vulgar fraction one half */
NULL, /* \276 vulgar fraction three quarters */
NULL, /* \277 inverted question mark */
NULL, /* \300 capital A with grave accent */
NULL, /* \301 capital A with acute accent */
NULL, /* \302 capital A with circumflex accent */
NULL, /* \303 capital A with tilde */
NULL, /* \304 capital A diaeresis */
NULL, /* \305 capital A with ring above */
NULL, /* \306 capital diphthong A with E */
NULL, /* \307 capital C with cedilla */
NULL, /* \310 capital E with grave accent */
NULL, /* \311 capital E with acute accent */
NULL, /* \312 capital E with circumflex accent */
NULL, /* \313 capital E with diaeresis */
NULL, /* \314 capital I with grave accent */
NULL, /* \315 capital I with acute accent */
NULL, /* \316 capital I with circumflex accent */
NULL, /* \317 capital I with diaeresis */
NULL, /* \320 capital icelandic ETH */
NULL, /* \321 capital N with tilde */
NULL, /* \322 capital O with grave accent */
NULL, /* \323 capital O with acute accent */
NULL, /* \324 capital O with circumflex accent */
NULL, /* \325 capital O with tilde */
NULL, /* \326 capital O with diaeresis */
NULL, /* \327 multiplication sign */
NULL, /* \330 capital O with oblique stroke */
NULL, /* \331 capital U with grave accent */
NULL, /* \332 capital U with acute accent */
NULL, /* \333 capital U with circumflex accent */
NULL, /* \334 capital U with diaeresis */
NULL, /* \335 capital Y with acute accent */
NULL, /* \336 capital icelandic THORN */
NULL, /* \337 small german sharp s */
"!0", /* \340 small a with grave accent */
NULL, /* \341 small a with acute accent */
"!1", /* \342 small a with circumflex accent */
NULL, /* \343 small a with tilde */
NULL, /* \344 small a with diaeresis */
NULL, /* \345 small a with ring above */
NULL, /* \346 small diphthong a with e */
"!=", /* \347 small c with cedilla */
"!3", /* \350 small e with grave accent */
"!2", /* \351 small e with acute accent */
"!5", /* \352 small e with circumflex accent */
"!4", /* \353 small e with diaeresis */
NULL, /* \354 small i with grave accent */
NULL, /* \355 small i with acute accent */
"!7", /* \356 small i with circumflex accent */
"!6", /* \357 small i with diaeresis */
NULL, /* \360 small icelandic eth */
NULL, /* \361 small n with tilde */
NULL, /* \362 small o with grave accent */
NULL, /* \363 small o with acute accent */
"!8", /* \364 small o with circumflex accent */
NULL, /* \365 small o with tilde */
NULL, /* \366 small o with diaeresis */
NULL, /* \367 division sign */
NULL, /* \370 small o with oblique stroke */
"!9", /* \371 small u with grave accent */
NULL, /* \372 small u with acute accent */
"!:", /* \373 small u with circumflex accent */
NULL, /* \374 small u with diaeresis */
NULL, /* \375 small y with acute accent */
NULL, /* \376 small icelandic thorn */
NULL, /* \377 small y with diaeresis */
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
const char *output_string; /* translated characters */

while (input_char = getc (input_file), input_char != EOF)
if (input_char == '\n')
putc ('\n', output_file);
else if (output_string = translation_table[input_char], output_string)
while (*output_string)
{
putc (*output_string, output_file);
output_string++;
}
}
recode-3.2.4/lat1ibmp.c 644 6206 22 11336 5244525723 12403 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP latin1_ibmpc
#include
#include "common.h"

static const char *translation_table[128] =
{
NULL, /* \200 */
NULL, /* \201 */
NULL, /* \202 */
NULL, /* \203 */
NULL, /* \204 */
NULL, /* \205 */
NULL, /* \206 */
NULL, /* \207 */
NULL, /* \210 */
NULL, /* \211 */
NULL, /* \212 */
NULL, /* \213 */
NULL, /* \214 */
NULL, /* \215 */
NULL, /* \216 */
NULL, /* \217 */
NULL, /* \220 */
NULL, /* \221 */
NULL, /* \222 */
NULL, /* \223 */
NULL, /* \224 */
NULL, /* \225 */
NULL, /* \226 */
NULL, /* \227 */
NULL, /* \230 */
NULL, /* \231 */
NULL, /* \232 */
NULL, /* \233 */
NULL, /* \234 */
NULL, /* \235 */
NULL, /* \236 */
NULL, /* \237 */

"\377", /* \240 \ */
"\255", /* \241 !` */
"\233", /* \242 \cent */
"\234", /* \243 \pound */
NULL, /* \244 */
"\235", /* \245 \yen */
NULL, /* \246 */
NULL, /* \247 */
NULL, /* \250 */
NULL, /* \251 */
"\246", /* \252 a_ */
"\256", /* \253 `` */
"\252", /* \254 \neg */
NULL, /* \255 */
NULL, /* \256 */
NULL, /* \257 */
"\370", /* \260 \deg */
"\361", /* \261 +- */
"\375", /* \262 ^2 */
NULL, /* \263 */
NULL, /* \264 */
"\346", /* \265 \micro */
NULL, /* \266 */
"\372", /* \267 \cdot */
NULL, /* \270 */
NULL, /* \271 */
"\247", /* \272 o_ */
"\257", /* \273 '' */
"\254", /* \274 1/4 */
"\253", /* \275 1/2 */
NULL, /* \276 */
"\250", /* \277 ?' */
NULL, /* \300 */
NULL, /* \301 */
NULL, /* \302 */
NULL, /* \303 */
"\216", /* \304 A" */
"\217", /* \305 AA */
"\222", /* \306 AE */
"\200", /* \307 C, */
NULL, /* \310 */
"\220", /* \311 E' */
NULL, /* \312 */
NULL, /* \313 */
NULL, /* \314 */
NULL, /* \315 */
NULL, /* \316 */
NULL, /* \317 */
NULL, /* \320 */
"\245", /* \321 N~ */
NULL, /* \322 */
NULL, /* \323 */
NULL, /* \324 */
NULL, /* \324 */
"\231", /* \326 O" */
"\366", /* \327 \div */
NULL, /* \330 */
NULL, /* \331 */
NULL, /* \332 */
NULL, /* \333 */
"\232", /* \334 U" */
NULL, /* \335 */
NULL, /* \336 */
"\341", /* \337 \ss */
"\205", /* \340 a` */
"\240", /* \341 a' */
"\203", /* \342 a^ */
NULL, /* \343 */
"\204", /* \344 a" */
"\206", /* \345 aa */
"\221", /* \346 ae */
"\207", /* \347 c, */
"\212", /* \350 e` */
"\202", /* \351 e' */
"\210", /* \352 e^ */
"\211", /* \353 e" */
"\215", /* \354 i` */
"\241", /* \355 i' */
"\214", /* \356 i^ */
"\213", /* \357 i" */
NULL, /* \360 */
"\244", /* \361 n~ */
"\225", /* \362 o` */
"\242", /* \363 o' */
"\223", /* \364 o^ */
NULL, /* \365 */
"\224", /* \366 o" */
NULL, /* \367 */
NULL, /* \370 */
"\227", /* \371 u` */
"\243", /* \372 u' */
"\226", /* \373 u^ */
"\201", /* \374 u" */
NULL, /* \375 */
NULL, /* \376 */
"\230", /* \377 y" */
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
const char *output_string; /* translated characters */

while (input_char = getc (input_file), input_char != EOF)
if ((input_char & 0377) < 0200)
if (input_char == '\n')
{
putc (0x0D, output_file);
putc (0x0A, output_file);
}
else
putc (input_char, output_file);
else
if (output_string = translation_table[input_char & 0177], output_string)
while (*output_string)
{
putc (*output_string, output_file);
output_string++;
}
}
recode-3.2.4/lat1ltex.c 644 6206 22 14573 5246722217 12435 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP latin1_latex
#include
#include "common.h"

extern int diacritics_only;

struct translation
{
int code; /* code being translated */
char *string; /* translation string */
};

struct translation diacritic_translations [] =
{
{0300, "\\`A"}, /* capital A with grave accent */
{0301, "\\'A"}, /* capital A with acute accent */
{0302, "\\^A"}, /* capital A with circumflex accent */
{0303, "\\~A"}, /* capital A with tilde */
{0304, "\\\"A"}, /* capital A diaeresis */
{0305, "\\AA{}"}, /* capital A with ring above */
{0306, "\\AE{}"}, /* capital diphthong A with E */
{0307, "\\c{C}"}, /* capital C with cedilla */
{0310, "\\`E"}, /* capital E with grave accent */
{0311, "\\'E"}, /* capital E with acute accent */
{0312, "\\^E"}, /* capital E with circumflex accent */
{0313, "\\\"E"}, /* capital E with diaeresis */
{0314, "\\`I"}, /* capital I with grave accent */
{0315, "\\'I"}, /* capital I with acute accent */
{0316, "\\^I"}, /* capital I with circumflex accent */
{0317, "\\\"I"}, /* capital I with diaeresis */
{0321, "\\~N"}, /* capital N with tilde */
{0322, "\\`O"}, /* capital O with grave accent */
{0323, "\\'O"}, /* capital O with acute accent */
{0324, "\\^O"}, /* capital O with circumflex accent */
{0325, "\\~O"}, /* capital O with tilde */
{0326, "\\\"O"}, /* capital O with diaeresis */
{0330, "\\O{}"}, /* capital O with oblique stroke */
{0331, "\\`U"}, /* capital U with grave accent */
{0332, "\\'U"}, /* capital U with acute accent */
{0333, "\\^U"}, /* capital U with circumflex accent */
{0334, "\\\"U"}, /* capital U with diaeresis */
{0335, "\\'Y"}, /* capital Y with acute accent */
{0337, "\\ss{}"}, /* small german sharp s */
{0340, "\\`a"}, /* small a with grave accent */
{0341, "\\'a"}, /* small a with acute accent */
{0342, "\\^a"}, /* small a with circumflex accent */
{0343, "\\~a"}, /* small a with tilde */
{0344, "\\\"a"}, /* small a with diaeresis */
{0345, "\\aa{}"}, /* small a with ring above */
{0346, "\\ae{}"}, /* small diphthong a with e */
{0347, "\\c{c}"}, /* small c with cedilla */
{0350, "\\`e"}, /* small e with grave accent */
{0351, "\\'e"}, /* small e with acute accent */
{0352, "\\^e"}, /* small e with circumflex accent */
{0353, "\\\"e"}, /* small e with diaeresis */
{0354, "\\`\\i{}"}, /* small i with grave accent */
{0355, "\\'\\i{}"}, /* small i with acute accent */
{0356, "\\^\\i{}"}, /* small i with circumflex accent */
{0357, "\\\"\\i{}"}, /* small i with diaeresis */
{0361, "\\~n"}, /* small n with tilde */
{0362, "\\`o"}, /* small o with grave accent */
{0363, "\\'o"}, /* small o with acute accent */
{0364, "\\^o"}, /* small o with circumflex accent */
{0365, "\\~o"}, /* small o with tilde */
{0366, "\\\"o"}, /* small o with diaeresis */
{0370, "\\o{}"}, /* small o with oblique stroke */
{0371, "\\`u"}, /* small u with grave accent */
{0372, "\\'u"}, /* small u with acute accent */
{0373, "\\^u"}, /* small u with circumflex accent */
{0374, "\\\"u"}, /* small u with diaeresis */
{0375, "\\'y"}, /* small y with acute accent */
{0377, "\\\"y"}, /* small y with diaeresis */
{0, NULL}
};

struct translation other_translations [] =
{
{0043, "\\#"},
{0044, "\\$"},
{0045, "\\%"},
{0046, "\\&"},
{0134, "\\backslash{}"},
{0137, "\\_"},
{0173, "\\{"},
{0175, "\\}"},
{0240, "\\ "}, /* no-break space */
{0241, "!'"}, /* inverted exclamation mark */
{0247, "\\S{}"}, /* paragraph sign, section sign */
{0250, "\\\"{}"}, /* diaeresis */
{0253, "``"}, /* left angle quotation mark */
{0254, "\\neg{}"}, /* not sign */
{0255, "\\-"}, /* soft hyphen */
{0260, "\\mbox{$^\\circ$}"}, /* degree sign */
{0261, "\\mbox{$\\pm$}"}, /* plus-minus sign */
{0262, "\\mbox{$^2$}"}, /* superscript two */
{0263, "\\mbox{$^3$}"}, /* superscript three */
{0264, "\\'{}"}, /* acute accent */
{0265, "\\mbox{$\\mu$}"}, /* small greek mu, micro sign */
{0267, "\\cdotp"}, /* middle dot */
{0270, "\\,{}"}, /* cedilla */
{0271, "\\mbox{$^1$}"}, /* superscript one */
{0273, "''"}, /* right angle quotation mark */
{0274, "\\frac1/4{}"}, /* vulgar fraction one quarter */
{0275, "\\frac1/2{}"}, /* vulgar fraction one half */
{0276, "\\frac3/4{}"}, /* vulgar fraction three quarters */
{0277, "?'"}, /* inverted question mark */
{0, NULL}
};

void
STEP (FILE *input_file, FILE *output_file)
{
char *translation_table[256]; /* one string for each character */
char character_pool[256]; /* for some strings of translation_table */
struct translation *cursor; /* cursor in translation arrays */
int input_char; /* current character */
const char *output_string; /* translated characters */

for (input_char = 0; input_char < 128; input_char++)
{
translation_table[input_char] = character_pool + 2*input_char;
translation_table[input_char][0] = input_char;
translation_table[input_char][1] = '\0';
}
for (input_char = 128; input_char < 256; input_char++)
translation_table[input_char] = NULL;

for (cursor = diacritic_translations; cursor->code; cursor++)
translation_table[cursor->code] = cursor->string;
if (!diacritics_only)
for (cursor = other_translations; cursor->code; cursor++)
translation_table[cursor->code] = cursor->string;

while (input_char = getc (input_file), input_char != EOF)
if (output_string = translation_table[input_char], output_string)
do
{
putc (*output_string, output_file);
output_string++;
}
while (*output_string);
}
recode-3.2.4/lat1txte.c 644 6206 22 14717 5244525772 12452 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP latin1_texte
#include
#include "common.h"

static const char *translation_table[128] =
{
NULL, /* \200 */
NULL, /* \201 */
NULL, /* \202 */
NULL, /* \203 */
NULL, /* \204 */
NULL, /* \205 */
NULL, /* \206 */
NULL, /* \207 */
NULL, /* \210 */
NULL, /* \211 */
NULL, /* \212 */
NULL, /* \213 */
NULL, /* \214 */
NULL, /* \215 */
NULL, /* \216 */
NULL, /* \217 */
NULL, /* \220 */
NULL, /* \221 */
NULL, /* \222 */
NULL, /* \223 */
NULL, /* \224 */
NULL, /* \225 */
NULL, /* \226 */
NULL, /* \227 */
NULL, /* \230 */
NULL, /* \231 */
NULL, /* \232 */
NULL, /* \233 */
NULL, /* \234 */
NULL, /* \235 */
NULL, /* \236 */
NULL, /* \237 */

" ", /* \240 no-break space */
NULL, /* \241 inverted exclamation mark */
NULL, /* \242 cent sign */
NULL, /* \243 pound sign */
NULL, /* \244 currency sign */
NULL, /* \245 yen sign */
NULL, /* \246 broken bar */
NULL, /* \247 paragraph sign, section sign */
NULL, /* \250 diaeresis */
NULL, /* \251 copyright sign */
NULL, /* \252 feminine ordinal indicator */
"``", /* \253 left angle quotation mark */
NULL, /* \254 not sign */
NULL, /* \255 soft hyphen */
NULL, /* \256 registered trade mark sign */
NULL, /* \257 macron */
NULL, /* \260 degree sign */
NULL, /* \261 plus-minus sign */
NULL, /* \262 superscript two */
NULL, /* \263 superscript three */
NULL, /* \264 acute accent */
NULL, /* \265 small greek mu, micro sign */
NULL, /* \266 pilcrow sign */
NULL, /* \267 middle dot */
NULL, /* \270 cedilla */
NULL, /* \271 superscript one */
NULL, /* \272 masculine ordinal indicator */
"''", /* \273 right angle quotation mark */
NULL, /* \274 vulgar fraction one quarter */
NULL, /* \275 vulgar fraction one half */
NULL, /* \276 vulgar fraction three quarters */
NULL, /* \277 inverted question mark */
"A`", /* \300 capital A with grave accent */
NULL, /* \301 capital A with acute accent */
"A^", /* \302 capital A with circumflex accent */
NULL, /* \303 capital A with tilde */
"A\"", /* \304 capital A diaeresis */
NULL, /* \305 capital A with ring above */
NULL, /* \306 capital diphthong A with E */
"C,", /* \307 capital C with cedilla */
"E`", /* \310 capital E with grave accent */
"E\'", /* \311 capital E with acute accent */
"E^", /* \312 capital E with circumflex accent */
"E\"", /* \313 capital E with diaeresis */
NULL, /* \314 capital I with grave accent */
NULL, /* \315 capital I with acute accent */
"I^", /* \316 capital I with circumflex accent */
"I\"", /* \317 capital I with diaeresis */
NULL, /* \320 capital icelandic ETH */
NULL, /* \321 capital N with tilde */
"O`", /* \322 capital O with grave accent */
NULL, /* \323 capital O with acute accent */
"O^", /* \324 capital O with circumflex accent */
NULL, /* \325 capital O with tilde */
"O\"", /* \326 capital O with diaeresis */
NULL, /* \327 multiplication sign */
NULL, /* \330 capital O with oblique stroke */
"U`", /* \331 capital U with grave accent */
NULL, /* \332 capital U with acute accent */
"U^", /* \333 capital U with circumflex accent */
"U\"", /* \334 capital U with diaeresis */
NULL, /* \335 capital Y with acute accent */
NULL, /* \336 capital icelandic THORN */
NULL, /* \337 small german sharp s */
"a`", /* \340 small a with grave accent */
NULL, /* \341 small a with acute accent */
"a^", /* \342 small a with circumflex accent */
NULL, /* \343 small a with tilde */
"a\"", /* \344 small a with diaeresis */
NULL, /* \345 small a with ring above */
NULL, /* \346 small diphthong a with e */
"c,", /* \347 small c with cedilla */
"e`", /* \350 small e with grave accent */
"e\'", /* \351 small e with acute accent */
"e^", /* \352 small e with circumflex accent */
"e\"", /* \353 small e with diaeresis */
NULL, /* \354 small i with grave accent */
NULL, /* \355 small i with acute accent */
"i^", /* \356 small i with circumflex accent */
"i\"", /* \357 small i with diaeresis */
NULL, /* \360 small icelandic eth */
NULL, /* \361 small n with tilde */
"o`", /* \362 small o with grave accent */
NULL, /* \363 small o with acute accent */
"o^", /* \364 small o with circumflex accent */
NULL, /* \365 small o with tilde */
"o\"", /* \366 small o with diaeresis */
NULL, /* \367 division sign */
NULL, /* \370 small o with oblique stroke */
"u`", /* \371 small u with grave accent */
NULL, /* \372 small u with acute accent */
"u^", /* \373 small u with circumflex accent */
"u\"", /* \374 small u with diaeresis */
NULL, /* \375 small y with acute accent */
NULL, /* \376 small icelandic thorn */
NULL, /* \377 small y with diaeresis */
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
const char *output_string; /* translated characters */

while (input_char = getc (input_file), input_char != EOF)
if ((input_char & 0377) < 0200)
putc (input_char, output_file);
else
if (output_string = translation_table[input_char & 0177], output_string)
while (*output_string)
{
putc (*output_string, output_file);
output_string++;
}
}
recode-3.2.4/maciibmp.c 644 6206 22 5635 5244526024 12433 0ustar djmumd/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP applemac_ibmpc
#include
#include "common.h"

static unsigned char translation_table[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, /* 11 */
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, /* 23 */
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, /* 35 */
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 47 */
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 59 */
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, /* 71 */
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, /* 83 */
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 95 */
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, /* 107 */
108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 119 */
120, 121, 122, 123, 124, 125, 126, 127, 142, 143, 128, 144, /* 131 */
165, 153, 154, 160, 133, 131, 132, 0, 134, 135, 130, 138, /* 143 */
136, 137, 161, 141, 140, 139, 164, 162, 149, 147, 148, 0, /* 155 */
163, 151, 150, 129, 0, 248, 155, 156, 0, 250, 0, 225, /* 167 */
0, 169, 170, 171, 172, 0, 146, 0, 236, 241, 243, 242, /* 179 */
157, 230, 235, 228, 184, 227, 186, 166, 167, 234, 145, 191, /* 191 */
168, 173, 194, 195, 159, 247, 198, 174, 175, 201, 202, 203, /* 203 */
204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 246, 215, /* 215 */
216, 217, 218, 219, 220, 221, 222, 223, 224, 0, 226, 0, /* 227 */
0, 229, 0, 231, 232, 233, 0, 0, 0, 237, 238, 239, /* 239 */
240, 0, 0, 0, 244, 245, 0, 0, 0, 249, 0, 251, /* 251 */
252, 253, 254, 255,
};

void
STEP (FILE *input_file, FILE *output_file)
{
int input_char; /* current character */
int output_char; /* translated character */

while (input_char = getc (input_file), input_char != EOF)
if (input_char == '\n')
{
putc (0x0D, output_file);
putc (0x0A, output_file);
}
else
if (output_char = translation_table[input_char], output_char != '\0')
putc (output_char, output_file);
}
recode-3.2.4/asciltex.l 644 6206 22 4356 5246722476 12511 0ustar djmumd%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ascii_latex

extern int diacritics_only;

%}

%%
# { if (!diacritics_only) output ('\\'); output ('#'); }
\$ { if (!diacritics_only) output ('\\'); output ('$'); }
% { if (!diacritics_only) output ('\\'); output ('%'); }
& { if (!diacritics_only) output ('\\'); output ('&'); }
_ { if (!diacritics_only) output ('\\'); output ('_'); }
\{ { if (!diacritics_only) output ('\\'); output ('{'); }
\} { if (!diacritics_only) output ('\\'); output ('}'); }

\\ { const char *cursor;

if (diacritics_only)
output ('\\');
else
for (cursor = "\\backslash{}"; *cursor; cursor++)
output (*cursor);
}

\"\b\<|\<\b\" { output ('`'); output ('`'); }
\"\b\>|\>\b\" { output ('\''); output ('\''); }

'\b[Ee] { output ('\\'); output ('\''); output (yytext[2]); }
[Ee]\b' { output ('\\'); output ('\''); output (yytext[0]); }

[`^"]\b[AaEeIOoUu] { output ('\\'); output (yytext[0]);
output (yytext[2]); }
[`^"]\bi { output ('\\'); output (yytext[0]); output ('\\');
output ('i'); output (' '); }
[AaEeIOoUu]\b[`^"] { output ('\\'); output (yytext[2]);
output (yytext[0]); }
i\b[`^"] { output ('\\'); output (yytext[2]); output ('\\');
output ('i'); output (' '); }
\,\b[Cc] { output ('\\'); output ('c'); output ('{');
output (yytext[2]); output ('}'); }
[Cc]\b\, { output ('\\'); output ('c'); output ('{');
output (yytext[0]); output ('}'); }
recode-3.2.4/ascitxte.l 644 6206 22 2362 5244525056 12505 0ustar djmumd%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP ascii_texte

extern char diaeresis_char; /* Character for diaeresis */
%}

%%
\"\b\<|\<\b\" { output ('`'); output ('`'); }
\"\b\>|\>\b\" { output ('\''); output ('\''); }

['`^,]\b. { output (yytext[2]); output (yytext[0]); }
.\b['`^,] { output (yytext[0]); output (yytext[2]); }

\"\b. { output (yytext[2]); output (diaeresis_char); }
.\b\" { output (yytext[0]); output (diaeresis_char); }
recode-3.2.4/ltexasci.l 644 6206 22 3465 5246715000 12472 0ustar djmumd%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP latex_ascii

extern int diacritics_only;

%}

After [ \t]*(\{\})?

%%
\\# { if (diacritics_only) ECHO; else output ('#'); }
\\\$ { if (diacritics_only) ECHO; else output ('$'); }
\\% { if (diacritics_only) ECHO; else output ('%'); }
\\& { if (diacritics_only) ECHO; else output ('&'); }
\\_ { if (diacritics_only) ECHO; else output ('_'); }
\\\{ { if (diacritics_only) ECHO; else output ('{'); }
\\\} { if (diacritics_only) ECHO; else output ('}'); }

\\backslash{After} { if (diacritics_only) ECHO; else output ('\\'); }


\\['`^"]\{\\i\} { output ('i'); output ('\b'); output (yytext[1]); }
\\['`^"]\\i{After} { output ('i'); output ('\b'); output (yytext[1]); }
\\['`^"]\{.\} { output (yytext[3]); output ('\b');
output (yytext[1]); }
\\['`^"]. { output (yytext[2]); output ('\b');
output (yytext[1]); }

\\c\{.\} { output (','); output ('\b'); output (yytext[3]); }
\\c[ /t/n]+. { output (','); output ('\b');
output (yytext[yyleng-1]); }
recode-3.2.4/ltexlat1.l 644 6206 22 11223 5246723711 12433 0ustar djmumd%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP latex_latin1

extern int diacritics_only;

%}

After [ \t]*(\{\})?

%%
\\# { if (diacritics_only) ECHO; else output ('#'); }
\\\$ { if (diacritics_only) ECHO; else output ('$'); }
\\% { if (diacritics_only) ECHO; else output ('%'); }
\\& { if (diacritics_only) ECHO; else output ('&'); }
\\_ { if (diacritics_only) ECHO; else output ('_'); }
\\\{ { if (diacritics_only) ECHO; else output ('{'); }
\\\} { if (diacritics_only) ECHO; else output ('}'); }

\\backslash{After} { if (diacritics_only) ECHO; else output ('\\'); }
"\\ " { if (diacritics_only) ECHO; else output ('\240'); }
"!'" { if (diacritics_only) ECHO; else output ('\241'); }





"\\S{}" { if (diacritics_only) ECHO; else output ('\247'); }
"\\\"{}" { if (diacritics_only) ECHO; else output ('\250'); }


"``" { if (diacritics_only) ECHO; else output ('\253'); }
"\\neg{}" { if (diacritics_only) ECHO; else output ('\254'); }
"\\-" { if (diacritics_only) ECHO; else output ('\255'); }


"\\mbox{$^\\circ$}" { if (diacritics_only) ECHO; else output ('\260'); }
"\\mbox{$\\pm$}" { if (diacritics_only) ECHO; else output ('\261'); }
"\\mbox{$^2$}" { if (diacritics_only) ECHO; else output ('\262'); }
"\\mbox{$^3$}" { if (diacritics_only) ECHO; else output ('\263'); }
"\\'{}" { if (diacritics_only) ECHO; else output ('\264'); }
"\\mbox{$\\mu$}" { if (diacritics_only) ECHO; else output ('\265'); }

"\\cdotp" { if (diacritics_only) ECHO; else output ('\267'); }
"\\,{}" { if (diacritics_only) ECHO; else output ('\270'); }
"\\mbox{$^1$}" { if (diacritics_only) ECHO; else output ('\271'); }

"''" { if (diacritics_only) ECHO; else output ('\273'); }
"\\frac1/4{}" { if (diacritics_only) ECHO; else output ('\274'); }
"\\frac1/2{}" { if (diacritics_only) ECHO; else output ('\275'); }
"\\frac3/4{}" { if (diacritics_only) ECHO; else output ('\276'); }
"?'" { if (diacritics_only) ECHO; else output ('\277'); }
"\\`A" { output ('\300'); }
"\\'A" { output ('\301'); }
"\\^A" { output ('\302'); }
"\\~A" { output ('\303'); }
"\\\"A" { output ('\304'); }
"\\AA{}" { output ('\305'); }
"\\AE{}" { output ('\306'); }
"\\c C" { output ('\307'); }
"\\c{C}" { output ('\307'); }
"\\`E" { output ('\310'); }
"\\'E" { output ('\311'); }
"\\^E" { output ('\312'); }
"\\\"E" { output ('\313'); }
"\\`I" { output ('\314'); }
"\\'I" { output ('\315'); }
"\\^I" { output ('\316'); }
"\\\"I" { output ('\317'); }

"\\~N" { output ('\321'); }
"\\`O" { output ('\322'); }
"\\'O" { output ('\323'); }
"\\^O" { output ('\324'); }
"\\~O" { output ('\325'); }
"\\\"O" { output ('\326'); }

"\\O{}" { output ('\330'); }
"\\`U" { output ('\331'); }
"\\'U" { output ('\332'); }
"\\^U" { output ('\333'); }
"\\\"U" { output ('\334'); }
"\\'Y" { output ('\335'); }

"\\ss{}" { output ('\337'); }
"\\`a" { output ('\340'); }
"\\'a" { output ('\341'); }
"\\^a" { output ('\342'); }
"\\~a" { output ('\343'); }
"\\\"a" { output ('\344'); }
"\\aa{}" { output ('\345'); }
"\\ae{}" { output ('\346'); }
"\\c c" { output ('\347'); }
"\\c{c}" { output ('\347'); }
"\\`e" { output ('\350'); }
"\\'e" { output ('\351'); }
"\\^e" { output ('\352'); }
"\\\"e" { output ('\353'); }
"\\`\\i{}" { output ('\354'); }
"\\`{\\i}" { output ('\354'); }
"\\'\\i{}" { output ('\355'); }
"\\'{\\i}" { output ('\355'); }
"\\^\\i{}" { output ('\356'); }
"\\^{\\i}" { output ('\356'); }
"\\\"\\i{}" { output ('\357'); }
"\\\"{\\i}" { output ('\357'); }

"\\~n" { output ('\361'); }
"\\`o" { output ('\362'); }
"\\'o" { output ('\363'); }
"\\^o" { output ('\364'); }
"\\~o" { output ('\365'); }
"\\\"o" { output ('\366'); }

"\\o{}" { output ('\370'); }
"\\`u" { output ('\371'); }
"\\'u" { output ('\372'); }
"\\^u" { output ('\373'); }
"\\\"u" { output ('\374'); }
"\\'y" { output ('\375'); }

"\\\"y" { output ('\377'); }
recode-3.2.4/txteasci.l 644 6206 22 5406 5244526415 12507 0ustar djmumd%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP texte_ascii

extern char diaeresis_char; /* Character for diaeresis */

void
texte_ascii_diaeresis (void)
{
int counter;

for (counter = 0; counter < yyleng; counter++)
if (yytext[counter+1] == diaeresis_char)
{
output ('"');
output ('\b');
output (yytext[counter]);
counter++;
}
else
output (yytext[counter]);
}
%}

s (^|[^a-zA-Z])
d [:"]
l [a-zA-Z]

%%
[eE]''' { output ('\''); output ('\b'); output (yytext[0]);
output ('"'); output ('\b'); output ('>'); }
[eE]'' { output (yytext[0]);
output ('"'); output ('\b'); output ('>'); }
[eE]' { output ('\''); output ('\b'); output (yytext[0]); }
[aAeEiIoOuU][`^] { output (yytext[1]); output ('\b');
output (yytext[0]); }
[cC]\,/[aAoOuU] { output (','); output ('\b'); output (yytext[0]); }
[aAeEiIoOuU]{d}/{l} { output ('"'); output ('\b'); output (yytext[0]); }

{s}[Bb]esaigue{d} { texte_ascii_diaeresis (); }
{s}[Cc]igue{d} { texte_ascii_diaeresis (); }
{s}[Aa]igue{d} { texte_ascii_diaeresis (); }
{s}[Aa]mbigue{d} { texte_ascii_diaeresis (); }
{s}[Cc]ontigue{d} { texte_ascii_diaeresis (); }
{s}[Ee]xigue{d} { texte_ascii_diaeresis (); }
{s}[Ss]ubaigue{d} { texte_ascii_diaeresis (); }
{s}[Ss]uraigue{d} { texte_ascii_diaeresis (); }
{s}[Aa]i{d} { texte_ascii_diaeresis (); }
{s}[Cc]ongai{d} { texte_ascii_diaeresis (); }
{s}[Gg]oi{d} { texte_ascii_diaeresis (); }
{s}[Hh]ai{d}kai{d} { if (yytext[4] == diaeresis_char)
texte_ascii_diaeresis ();
else
ECHO;
}
{s}[Ii]noui{d} { texte_ascii_diaeresis (); }
[JjTtLl]'[Aa][Ii]{d} { ECHO; }
{s}[Ss]ai{d} { texte_ascii_diaeresis (); }
{s}[Ss]amurai{d} { texte_ascii_diaeresis (); }
{s}[Tt]hai{d} { texte_ascii_diaeresis (); }
{s}[Tt]okai{d} { texte_ascii_diaeresis (); }
{s}[Cc]anoe{d} { texte_ascii_diaeresis (); }
{s}Esau{d} { texte_ascii_diaeresis (); }

`` { output ('"'); output ('\b'); output ('<'); }
'' { output ('"'); output ('\b'); output ('>'); }
recode-3.2.4/txtelat1.l 644 6206 22 10010 5244526447 12441 0ustar djmumd%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard , 1989.

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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define STEP texte_latin1

extern char diaeresis_char; /* Character for diaeresis */

void
texte_latin1_diaeresis (void)
{
int counter;

for (counter = 0; counter < yyleng; counter++)
if (yytext[counter+1] == diaeresis_char)
{
switch (yytext[counter])
{
/* The following #ifdef removes the case 'A': this seemingly
unrelated line triggers a `NULL in input' diagnostic in flex.
Would you believe? */
#if 0
case 'A': output ('\304'); break;
#endif
case 'E': output ('\313'); break;
case 'I': output ('\317'); break;
case 'O': output ('\326'); break;
case 'U': output ('\334'); break;
case 'a': output ('\344'); break;
case 'e': output ('\353'); break;
case 'i': output ('\357'); break;
case 'o': output ('\366'); break;
case 'u': output ('\374'); break;
case 'y': output ('\377'); break;
default: output (yytext[counter]);
}
counter++;
}
else
output (yytext[counter]);
}
%}

s (^|[^a-zA-Z])
d [:"]
l [a-zA-Z]

%%

`` { output ('\253'); }
'' { output ('\273'); }

A` { output ('\300'); }
A^ { output ('\302'); }
A{d}/{l} { output ('\304'); }
a` { output ('\340'); }
a^ { output ('\342'); }
a{d}/{l} { output ('\344'); }

C\,/[aAoOuU] { output ('\307'); }
c\,/[aAoOuU] { output ('\347'); }

E` { output ('\310'); }
E''' { output ('\311'); output ('\273'); }
E'' { output ('E'); output ('\273'); }
E' { output ('\311'); }
E^ { output ('\312'); }
E{d}/{l} { output ('\313'); }
e` { output ('\350'); }
e''' { output ('\351'); output ('\273'); }
e'' { output ('e'); output ('\273'); }
e' { output ('\351'); }
e^ { output ('\352'); }
e{d}/{l} { output ('\353'); }

I` { output ('\314'); }
I^ { output ('\316'); }
I{d}/{l} { output ('\317'); }
i` { output ('\354'); }
i^ { output ('\356'); }
i{d}/{l} { output ('\357'); }

O` { output ('\322'); }
O^ { output ('\324'); }
O{d}/{l} { output ('\326'); }
o` { output ('\362'); }
o^ { output ('\364'); }
o{d}/{l} { output ('\366'); }

U` { output ('\331'); }
U^ { output ('\333'); }
U{d}/{l} { output ('\334'); }
u` { output ('\371'); }
u^ { output ('\373'); }
u{d}/{l} { output ('\374'); }

Y{d}/{l} { output ('Y'); }
y{d}/{l} { output ('\337'); }

{s}[Bb]esaigue{d} { texte_latin1_diaeresis (); }
{s}[Cc]igue{d} { texte_latin1_diaeresis (); }
{s}[Aa]igue{d} { texte_latin1_diaeresis (); }
{s}[Aa]mbigue{d} { texte_latin1_diaeresis (); }
{s}[Cc]ontigue{d} { texte_latin1_diaeresis (); }
{s}[Ee]xigue{d} { texte_latin1_diaeresis (); }
{s}[Ss]ubaigue{d} { texte_latin1_diaeresis (); }
{s}[Ss]uraigue{d} { texte_latin1_diaeresis (); }
{s}[Aa]i{d} { texte_latin1_diaeresis (); }
{s}[Cc]ongai{d} { texte_latin1_diaeresis (); }
{s}[Gg]oi{d} { texte_latin1_diaeresis (); }
{s}[Hh]ai{d}kai{d} { if (yytext[4] == diaeresis_char)
texte_latin1_diaeresis ();
else
ECHO;
}
{s}[Ii]noui{d} { texte_latin1_diaeresis (); }
[JjTtLl]'[Aa][Ii]{d} { ECHO; }
{s}[Ss]ai{d} { texte_latin1_diaeresis (); }
{s}[Ss]amurai{d} { texte_latin1_diaeresis (); }
{s}[Tt]hai{d} { texte_latin1_diaeresis (); }
{s}[Tt]okai{d} { texte_latin1_diaeresis (); }
{s}[Cc]anoe{d} { texte_latin1_diaeresis (); }
{s}Esau{d} { texte_latin1_diaeresis (); }
recode-3.2.4/getopt.c 644 6206 22 5135 5102555455 12152 0ustar djmumd/* ::[[ @(#) getopt.c 1.5 89/07/02 00:18:19 ]]:: */
#ifndef LINT
static char sccsid[]="::[[ @(#) getopt.c 1.5 89/07/02 00:18:19 ]]::";
#endif

/*
* Here's something you've all been waiting for: the AT&T public domain
* source for getopt(3). It is the code which was given out at the 1985
* UNIFORUM conference in Dallas. I obtained it by electronic mail
* directly from AT&T. The people there assure me that it is indeed
* in the public domain.
*
* There is no manual page. That is because the one they gave out at
* UNIFORUM was slightly different from the current System V Release 2
* manual page. The difference apparently involved a note about the
* famous rules 5 and 6, recommending using white space between an option
* and its first argument, and not grouping options that have arguments.
* Getopt itself is currently lenient about both of these things White
* space is allowed, but not mandatory, and the last option in a group can
* have an argument. That particular version of the man page evidently
* has no official existence, and my source at AT&T did not send a copy.
* The current SVR2 man page reflects the actual behavor of this getopt.
* However, I am not about to post a copy of anything licensed by AT&T.
*/

/*
Minor modifications by Rahul Dhesi, 1989
Minor modifications by Francois Pinard, 1991
*/

#include
#include

/* Avoid possible compiler warning if we simply redefine NULL or EOF */
#define XNULL 0
#define XEOF (-1)

#define ERR(szz,czz) if(opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);}

int opterr = 1;
int optind = 1;
int optopt;
char *optarg;

int
getopt(argc, argv, opts)
int argc;
char **argv, *opts;
{
static int sp = 1;
register int c;
register char *cp;

if(sp == 1)
if(optind >= argc ||
argv[optind][0] != '-' || argv[optind][1] == '\0')
return(XEOF);
else if(strcmp(argv[optind], "--") == XNULL) {
optind++;
return(XEOF);
}
optopt = c = argv[optind][sp];
if(c == ':' || (cp=strchr(opts, c)) == XNULL) {
ERR(": illegal option -- ", c);
if(argv[optind][++sp] == '\0') {
optind++;
sp = 1;
}
return('?');
}
if(*++cp == ':') {
if(argv[optind][sp+1] != '\0')
optarg = &argv[optind++][sp+1];
else if(++optind >= argc) {
ERR(": option requires an argument -- ", c);
sp = 1;
return('?');
} else
optarg = argv[optind++];
sp = 1;
} else {
if(argv[optind][++sp] == '\0') {
sp = 1;
optind++;
}
optarg = XNULL;
}
return(c);
}
recode-3.2.4/c-boxes.el 444 6206 22 25013 5241455000 12366 0ustar djmumd;;; Boxed comments for C mode.
;;; Copyright (C) 1991 Free Software Foundation, Inc.
;;; Francois Pinard , April 1991.
;;;
;;; I use this hack by putting, in my .emacs file:
;;;
;;; (setq c-mode-hook
;;; '(lambda ()
;;; (define-key c-mode-map "\M-q" 'reindent-c-comment)))
;;; (autoload 'reindent-c-comment "c-boxes" nil t)
;;;
;;; The cursor should be within a comment before reindent-c-comment to
;;; be given, or else it should be between two comments, in which case
;;; the command applies to the next comment. When the command is
;;; given without prefix, the current comment box type is recognized
;;; and preserved. Given 0 as a prefix, the comment box disappears
;;; and the comment stays between a single opening `/*' and a single
;;; closing `*/'. Given 1 or 2 as a prefix, a single or doubled lined
;;; comment box is forced. Given 3 as a prefix, a Taarna style box is
;;; forced, but you do not even want to hear about those.
;;;
;;; I observed rounded corners first in some code from Warren Tucker
;;; .

(defvar c-mode-taarna-style nil "*Non-nil for Taarna team C-style.")
(defvar c-comment-box-style 'single "*Preferred style for box comments.")

;;; Set or reset the Taarna team C mode style.

(defun taarna-mode ()
(interactive)
(if c-mode-taarna-style
(progn

(setq c-mode-taarna-style nil)
(setq c-indent-level 2)
(setq c-continued-statement-offset 2)
(setq c-brace-offset 0)
(setq c-argdecl-indent 5)
(setq c-label-offset -2)
(setq c-tab-always-indent t)
(setq c-auto-newline nil)
(setq c-comment-box-style 'single)
(message "C mode: GNU style"))

(setq c-mode-taarna-style t)
(setq c-indent-level 4)
(setq c-continued-statement-offset 4)
(setq c-brace-offset -4)
(setq c-argdecl-indent 4)
(setq c-label-offset -4)
(setq c-tab-always-indent t)
(setq c-auto-newline t)
(setq c-comment-box-style 'taarna)
(message "C mode: Taarna style")))

;;; Return the minimum value of the left margin of all lines, or -1 if
;;; all lines are empty.

(defun buffer-left-margin ()
(let ((margin -1))
(goto-char (point-min))
(while (not (eobp))
(skip-chars-forward " \t")
(if (not (looking-at "\n"))
(setq margin
(if (< margin 0)
(current-column)
(min margin (current-column)))))
(forward-line 1))
margin))

;;; Return the maximum value of the right margin of all lines. Any
;;; sentence ending a line has a space guaranteed before the margin.

(defun buffer-right-margin ()
(let ((margin 0) period)
(goto-char (point-min))
(while (not (eobp))
(end-of-line)
(if (bobp)
(setq period 0)
(backward-char 1)
(setq period (if (looking-at "[.?!]") 1 0))
(forward-char 1))
(setq margin (max margin (+ (current-column) period)))
(forward-char 1))
margin))

;;; Indent or reindent a C comment box.

(defun reindent-c-comment (flag)
(interactive "P")
(save-restriction
(let ((marked-point (point-marker))
(saved-point (point))
box-style left-margin right-margin)

;; First, find the limits of the block of comments following or
;; enclosing the cursor, or return an error if the cursor is not
;; within such a block of comments, narrow the buffer, and
;; untabify it.

;; - insure the point is into the following comment, if any

(skip-chars-forward " \t\n")
(if (looking-at "/\\*")
(forward-char 2))

(let ((here (point)) start end temp)

;; - identify a minimal comment block

(search-backward "/*")
(setq temp (point))
(beginning-of-line)
(setq start (point))
(skip-chars-forward " \t")
(if (< (point) temp)
(progn
(goto-char saved-point)
(error "text before comment's start")))
(search-forward "*/")
(setq temp (point))
(end-of-line)
(forward-char 1)
(setq end (point))
(skip-chars-backward " \t\n")
(if (> (point) temp)
(progn
(goto-char saved-point)
(error "text after comment's end")))
(if (< end here)
(progn
(goto-char saved-point)
(error "outside any comment block")))

;; - try to extend the comment block backwards

(goto-char start)
(while (and (not (bobp))
(progn (previous-line 1)
(beginning-of-line)
(looking-at "[ \t]*/\\*.*\\*/[ \t]*$")))
(setq start (point)))

;; - try to extend the comment block forward

(goto-char end)
(while (looking-at "[ \t]*/\\*.*\\*/[ \t]*$")
(forward-line 1)
(beginning-of-line)
(setq end (point)))

;; - narrow the whole block of comments

(narrow-to-region start end))

;; Second, remove all the comment marks, and move all the text
;; rigidly to the left to insure the left margin stays at the
;; same place. At the same time, recognize and save the box
;; style in BOX-STYLE.

(let ((previous-margin (buffer-left-margin))
actual-margin)

;; - remove all comment marks

(goto-char (point-min))
(replace-regexp "\\*/[ \t]*/\\*" " ")
(goto-char (point-min))
(while (not (eobp))
(skip-chars-forward " \t")
(if (looking-at "/\\*")
(replace-match " ")
(if (looking-at "|")
(replace-match " ")))
(end-of-line)
(skip-chars-backward " \t")
(backward-char 2)
(if (looking-at "\\*/")
(replace-match "")
(forward-char 1)
(if (looking-at "|")
(replace-match "")
(forward-char 1)))
(forward-line 1))

;; - remove the first and last dashed lines

(setq box-style 'plain)
(goto-char (point-min))
(if (looking-at "^[ \t]*-*[.\+\\]?[ \t]*\n")
(progn
(setq box-style 'single)
(replace-match ""))
(if (looking-at "^[ \t]*=*[.\+\\]?[ \t]*\n")
(progn
(setq box-style 'double)
(replace-match ""))))
(goto-char (point-max))
(previous-line 1)
(beginning-of-line)
(if (looking-at "^[ \t]*[`\+\\]?*[-=]+[ \t]*\n")
(progn
(if (eq box-style 'plain)
(setq box-style 'taarna))
(replace-match "")))

;; - remove all spurious whitespace

(goto-char (point-min))
(replace-regexp "[ \t]+$" "")
(goto-char (point-min))
(if (looking-at "\n+")
(replace-match ""))
(goto-char (point-max))
(skip-chars-backward "\n")
(if (looking-at "\n\n+")
(replace-match "\n"))
(goto-char (point-min))
(replace-regexp "\n\n\n+" "\n\n")

;; - move the text left is adequate

(setq actual-margin (buffer-left-margin))
(if (not (= previous-margin actual-margin))
(indent-rigidly (point-min) (point-max)
(- previous-margin actual-margin))))

;; Third, select the new box style from the old box style and
;; the argument, choose the margins for this style and refill
;; each paragraph.

;; - modify box-style only if flag is defined

(if flag
(setq box-style
(cond ((eq flag '0) 'plain)
((eq flag '1) 'single)
((eq flag '2) 'double)
((eq flag '3) 'taarna)
(c-mode-taarna-style 'taarna)
(t 'single))))

;; - compute the left margin

(setq left-margin (buffer-left-margin))

;; - temporarily set the fill prefix and column, then refill

(untabify (point-min) (point-max))
(let ((fill-prefix (make-string left-margin ? ))
(fill-column (- fill-column
(if (memq box-style '(single double)) 4 6))))
(fill-region (point-min) (point-max)))

;; - compute the right margin after refill

(setq right-margin (buffer-right-margin))

;; Fourth, put the narrowed buffer back into a comment box,
;; according to the value of box-style. Values may be:
;; plain: insert between a single pair of comment delimiters
;; single: complete box, overline and underline with dashes
;; double: complete box, overline and underline with equal signs
;; taarna: comment delimiters on each line, underline with dashes

;; - move the right margin to account for left inserts

(setq right-margin (+ right-margin
(if (memq box-style '(single double))
2
3)))

;; - construct the box comment, from top to bottom

(goto-char (point-min))
(cond ((eq box-style 'plain)

;; - construct a plain style comment

(skip-chars-forward " " (+ (point) left-margin))
(insert (make-string (- left-margin (current-column)) ? )
"/* ")
(end-of-line)
(forward-char 1)
(while (not (eobp))
(skip-chars-forward " " (+ (point) left-margin))
(insert (make-string (- left-margin (current-column)) ? )
" ")
(end-of-line)
(forward-char 1))
(backward-char 1)
(insert " */"))
((eq box-style 'single)

;; - construct a single line style comment

(indent-to left-margin)
(insert "/*")
(insert (make-string (- right-margin (current-column)) ?-)
"-.\n")
(while (not (eobp))
(skip-chars-forward " " (+ (point) left-margin))
(insert (make-string (- left-margin (current-column)) ? )
"| ")
(end-of-line)
(indent-to right-margin)
(insert " |")
(forward-char 1))
(indent-to left-margin)
(insert "`")
(insert (make-string (- right-margin (current-column)) ?-)
"*/\n"))
((eq box-style 'double)

;; - construct a double line style comment

(indent-to left-margin)
(insert "/*")
(insert (make-string (- right-margin (current-column)) ?=)
"=\\\n")
(while (not (eobp))
(skip-chars-forward " " (+ (point) left-margin))
(insert (make-string (- left-margin (current-column)) ? )
"| ")
(end-of-line)
(indent-to right-margin)
(insert " |")
(forward-char 1))
(indent-to left-margin)
(insert "\\")
(insert (make-string (- right-margin (current-column)) ?=)
"*/\n"))
((eq box-style 'taarna)

;; - construct a Taarna style comment

(while (not (eobp))
(skip-chars-forward " " (+ (point) left-margin))
(insert (make-string (- left-margin (current-column)) ? )
"/* ")
(end-of-line)
(indent-to right-margin)
(insert " */")
(forward-char 1))
(indent-to left-margin)
(insert "/* ")
(insert (make-string (- right-margin (current-column)) ?-)
" */\n"))
(t (error "unknown box style")))

;; Fifth, retabify and restore the point position.

; Retabify before left margin only. Adapted from tabify.el.
(goto-char (point-min))
(while (re-search-forward "^[ \t][ \t][ \t]*" nil t)
(let ((column (current-column))
(indent-tabs-mode t))
(delete-region (match-beginning 0) (point))
(indent-to column)))
(goto-char (marker-position marked-point)))))
recode-3.2.4/checkit 755 6206 22 4244 5231400041 12023 0ustar djmumd:
# Script to help checking `recode'.
# Copyright (C) 1991 Free Software Foundation, Inc.
# Francois Pinard , 1991.

# 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., 675 Mass Ave, Cambridge, MA 02139, USA.

# Use this script by `checkit [-v] FILE BEFORE AFTER'. It does
# various check of recoding FILE from BEFORE to AFTER or vice-versa.
# The -v parameter gives more verbose output. Exit with a non-zero
# status if any error found.

if test "$1" = -v; then
shift
verbose=1
fi

# Select methods to be tested by studying `configure' output.

eval `grep '^DEFS=' config.status`
methods=i
case "$DEFS" in
*HAVE_POPEN*) methods="$methods o" ;;
esac
case "$DEFS" in
*HAVE_PIPE*) methods="$methods p" ;;
esac

# Echo the tested sequence of steps.

if test -n "$verbose"; then
./recode -vi < /dev/null $2:$3
./recode -vi < /dev/null $3:$2
fi

# Try all methods, both in filter and in non-filter modes.

for method in $methods; do
test -n "$verbose" && echo "Checking -$method between $2 and $3 on stdin"
./recode -$method < $1 $2:$3 | ./recode -$method $3:$2 > checkit.tmp
if diff $1 checkit.tmp; then
:
else
echo
echo "*** error in: recode -$method < $1 $2:$3 [or $3:$2]"
rm checkit.tmp
exit 1
fi

test -n "$verbose" && echo "Checking -$method between $2 and $3 on file"
cp $1 checkit.tmp
./recode -$method $2:$3 checkit.tmp
./recode -$method $3:$2 checkit.tmp
if diff $1 checkit.tmp; then
:
else
echo
echo "*** error in: recode -$method $1 $2:$3 [or $3:$2]"
rm checkit.tmp
exit 1
fi
done

# Return success.

rm checkit.tmp
exit 0
recode-3.2.4/configure 755 6206 22 22743 5262120704 12427 0ustar djmumd
#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992 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., 675 Mass Ave, Cambridge, MA 02139, USA.

# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
# [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
# Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.

trap 'rm -f conftest* core; exit 1' 1 3 15

for arg
do
# Handle --exec_prefix with a space before the argument.
if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
# Handle --host with a space before the argument.
elif test x$next_host = xyes; then next_host=
# Handle --prefix with a space before the argument.
elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
# Handle --srcdir with a space before the argument.
elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
else
case $arg in
-exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
next_exec_prefix=yes ;;

-gas | --gas | --ga | --g) ;;

-host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
-host | --host | --hos | --ho | --h)
next_host=yes ;;

-nfp | --nfp | --nf) ;;

-no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
no_create=1 ;;

-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
next_prefix=yes ;;

-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
next_srcdir=yes ;;

-with-* | --with-*) ;;

*) ;;
esac
fi
done

rm -f conftest*
compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
unique_file=recode.c

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
srcdirdefaulted=yes; srcdir=.
if test ! -r $unique_file; then srcdir=..; fi
fi
if test ! -r $srcdir/$unique_file; then
if test x$srcdirdefaulted = xyes; then
echo "configure: Can not find sources in \`.' or \`..'." 1>&2
else
echo "configure: Can not find sources in \`${srcdir}'." 1>&2
fi
exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
.|/*|~*) ;;
*) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac

# Default code is latin1 on UNIX, ibmpc on MSDOS.
DEFAULTCODE=${DEFAULTCODE-latin1}
for p in mawk gawk nawk awk
do
if test -z "$AWK"; then
echo checking for $p
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/$p; then
AWK="$p"
break
fi
done
IFS="$saveifs"
fi
test -z "$AWK" && AWK=""

test -n "$AWK" && break
done

if test -z "$LEX"; then
echo checking for flex
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/flex; then
LEX="flex"
break
fi
done
IFS="$saveifs"
fi
test -z "$LEX" && LEX="lex"

if test -z "$LEXLIB"
then
case "$LEX" in
flex*)
if test -r /usr/local/lib/libfl.a
then LEXLIB=/usr/local/lib/libfl.a
elif test -r ${prefix}/lib/libfl.a
then LEXLIB=${prefix}/lib/libfl.a
else LEXLIB="-lfl"
fi
;;
*) LEXLIB="-ll" ;;
esac
fi
test "$LEX" = flex || echo >&2 "WARNING: Cannot find Flex"

if test -z "$CC"; then
echo checking for gcc
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/gcc; then
CC="gcc"
break
fi
done
IFS="$saveifs"
fi
test -z "$CC" && CC="cc"

# Find out if we are using GNU C, under whatever name.
cat < conftest.c
#ifdef __GNUC__
yes
#endif
EOF
${CC-cc} -E conftest.c > conftest.out 2>&1
if egrep yes conftest.out >/dev/null 2>&1; then
GCC=1 # For later tests.
CC="$CC -O"
fi
rm -f conftest*

if test -z "$RANLIB"; then
echo checking for ranlib
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/ranlib; then
RANLIB="ranlib"
break
fi
done
IFS="$saveifs"
fi
test -z "$RANLIB" && RANLIB="@:"

# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory.
if test -z "$INSTALL"; then
echo checking for install
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
case $dir in
/etc|/usr/sbin|/usr/etc) ;;
*)
if test -f $dir/install; then
INSTALL="$dir/install -c"
INSTALL_PROGRAM='$(INSTALL)'
INSTALL_DATA='$(INSTALL) -m 644'
break
fi
;;
esac
done
IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}

echo checking for POSIXized ISC
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
ISC=1 # If later tests want to check for ISC.
DEFS="$DEFS -D_POSIX_SOURCE=1"
if test -n "$GCC"; then
CC="$CC -posix"
else
CC="$CC -Xp"
fi
fi

echo checking if __STDC__ defined
echo checking how to run the C preprocessor
if test -z "$CPP"; then
CPP='${CC-cc} -E'
cat < conftest.c

#include
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
:
else
CPP=/lib/cpp
fi
rm -f conftest*
fi

cat < conftest.c

#ifdef __STDC__
#include
#endif
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
U=_
fi
rm -f conftest*
echo checking for ANSI C header files
cat < conftest.c

#include
#include
#include
#include
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -DSTDC_HEADERS=1"
fi
rm -f conftest*

echo checking for BSD string and memory functions
echo "#include
main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
if eval $compile; then
:
else
DEFS="$DEFS -DUSG=1"
fi
rm -f conftest*

# Add `pipe' to the following list whenever I correct *that* bug.
for func in dup2 popen rename
do
trfrom='[a-z]' trto='[A-Z]'
echo checking for ${func}
echo "
main() { exit(0); } t() {
/* Override any gcc2 internal prototype to avoid an error. */
extern char ${func}(); ${func}(); }" > conftest.c
if eval $compile; then
DEFS="$DEFS -DHAVE_`echo $func|tr "$trfrom" "$trto"`=1"
fi
rm -f conftest*
done

if test -n "$prefix"; then
test -z "$exec_prefix" && exec_prefix='$(prefix)'
prsub="s,^prefix[ ]*=.*$,prefix = $prefix,"
fi
if test -n "$exec_prefix"; then
prsub="$prsub
s,^exec_prefix[ ]*=.*$,exec_prefix = $exec_prefix,"
fi

trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
rm -f config.status
cat < config.status
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows:
# $0 $*

case "\$1" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
exec /bin/sh $0 $* ;;
esac

trap 'rm -f Makefile; exit 1' 1 3 15
LDEFS='$LDEFS'
LIBOBJS='$LIBOBJS'
DEFAULTCODE='$DEFAULTCODE'
AWK='$AWK'
LEX='$LEX'
LEXLIB='$LEXLIB'
CC='$CC'
RANLIB='$RANLIB'
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
CPP='$CPP'
U='$U'
LIBS='$LIBS'
srcdir='$srcdir'
DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
EOF
cat <<\EOF >> config.status

top_srcdir=$srcdir
for file in Makefile; do
srcdir=$top_srcdir
# Remove last slash and all that follows it. Not all systems have dirname.
dir=`echo $file|sed 's,/[^/][^/]*$,,'`
if test "$dir" != "$file"; then
test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
test ! -d $dir && mkdir $dir
fi
echo creating $file
rm -f $file
echo "# Generated automatically from `basename $file`.in by configure." > $file
sed -e "
$prsub
s,@LDEFS@,$LDEFS,g
s,@LIBOBJS@,$LIBOBJS,g
s,@DEFAULTCODE@,$DEFAULTCODE,g
s,@AWK@,$AWK,g
s,@LEX@,$LEX,g
s,@LEXLIB@,$LEXLIB,g
s,@CC@,$CC,g
s,@RANLIB@,$RANLIB,g
s,@INSTALL@,$INSTALL,g
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,g
s,@INSTALL_DATA@,$INSTALL_DATA,g
s,@CPP@,$CPP,g
s,@U@,$U,g
s,@LIBS@,$LIBS,g
s,@srcdir@,$srcdir,g
s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
done

EOF
chmod +x config.status
test -n "$no_create" || ./config.status

recode-3.2.4/merged.c 644 6206 22 216152 5260642057 12156 0ustar djmumd/* A lexical scanner generated by flex */

/* scanner skeleton version:
* $Header: /usr0/tmp/flex-2.3.7/RCS/flex.skel 1.1 1992/07/30 00:15:54 pinard Exp pinard $
*/

#define FLEX_SCANNER

#include


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include
#include

/* use prototypes in function declarations */
#define YY_USE_PROTOS

/* the "const" storage-class-modifier is valid */
#define YY_USE_CONST

#else /* ! __cplusplus */

#ifdef __STDC__

#ifdef __GNUC__
#include
void *malloc( size_t );
void free( void* );
#else
#include
#endif /* __GNUC__ */

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif /* __STDC__ */
#endif /* ! __cplusplus */


#ifdef __TURBOC__
#define YY_USE_CONST
#endif


#ifndef YY_USE_CONST
#define const
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
/* we can't get here if it's an ANSI C compiler, or a C++ compiler,
* so it's got to be a K&R compiler, and therefore there's no standard
* place from which to include these definitions
*/
char *malloc();
int free();
int read();
#endif


/* amount of stuff to slurp up with each read */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* returned upon end-of-file */
#define YY_END_TOK 0

/* copy whatever the last rule matched to the standard output */

/* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
/* this used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite()
*/
#define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )

/* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#define YY_INPUT(buf,result,max_size) \
if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
YY_FATAL_ERROR( "read() in flex scanner failed" );
#define YY_NULL 0

/* no semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#define yyterminate() return ( YY_NULL )

/* report a fatal error */

/* The funky do-while is used to turn this macro definition into
* a single C statement (which needs a semi-colon terminator).
* This avoids problems with code like:
*
* if ( something_happens )
* YY_FATAL_ERROR( "oops, the something happened" );
* else
* everything_okay();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the YY_FATAL_ERROR() call.
*/

#define YY_FATAL_ERROR(msg) \
do \
{ \
(void) fputs( msg, stderr ); \
(void) putc( '\n', stderr ); \
exit( 1 ); \
} \
while ( 0 )

/* default yywrap function - always treat EOF as an EOF */
#define yywrap() 1

/* enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN
*/
#define BEGIN yy_start = 1 + 2 *

/* action number for EOF rule of a given start state */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* special action meaning "start processing a new file" */
#define YY_NEW_FILE \
do \
{ \
yy_init_buffer( yy_current_buffer, yyin ); \
yy_load_buffer_state(); \
} \
while ( 0 )

/* default declaration of generated scanner - a define so the user can
* easily add parameters
*/
#define YY_DECL int yylex YY_PROTO(( void ))

/* code executed at the end of each rule */
#define YY_BREAK break;

#define YY_END_OF_BUFFER_CHAR 0

#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
#endif

typedef struct yy_buffer_state *YY_BUFFER_STATE;

#define YY_CHAR unsigned char
# line 1 ""
#define INITIAL 0
# line 2 ""
#include "common.h"
#ifdef USE_FPUTC
#define output(ch) fputc (ch, yyout)
#else
#define output(ch) putc (ch, yyout)
#endif
extern YY_CHAR *yytext;
extern int yyleng;
extern FILE *yyin, *yyout;
# line 13 ""
extern int diacritics_only;
#define X_ascii_latex 1
# line 17 ""
extern char diaeresis_char; /* Character for diaeresis */
#define X_ascii_texte 2
# line 21 ""
extern int diacritics_only;
#define X_latex_ascii 3
# line 26 ""
extern int diacritics_only;
#define X_latex_latin1 4
# line 30 ""
extern char diaeresis_char; /* Character for diaeresis */
void
texte_ascii_diaeresis (void)
{
int counter;
for (counter = 0; counter < yyleng; counter++)
if (yytext[counter+1] == diaeresis_char)
{
output ('"');
output ('\b');
output (yytext[counter]);
counter++;
}
else
output (yytext[counter]);
}
#define X_texte_ascii 5
# line 52 ""
extern char diaeresis_char; /* Character for diaeresis */
void
texte_latin1_diaeresis (void)
{
int counter;
for (counter = 0; counter < yyleng; counter++)
if (yytext[counter+1] == diaeresis_char)
{
switch (yytext[counter])
{
/* The following #ifdef removes the case 'A': this seemingly
unrelated line triggers a `NULL in input' diagnostic in flex.
Would you believe? */
#if 0
case 'A': output ('\304'); break;
#endif
case 'E': output ('\313'); break;
case 'I': output ('\317'); break;
case 'O': output ('\326'); break;
case 'U': output ('\334'); break;
case 'a': output ('\344'); break;
case 'e': output ('\353'); break;
case 'i': output ('\357'); break;
case 'o': output ('\366'); break;
case 'u': output ('\374'); break;
case 'y': output ('\377'); break;
default: output (yytext[counter]);
}
counter++;
}
else
output (yytext[counter]);
}
#define X_texte_latin1 6
# line 87 ""

/* done after the current pattern has been matched and before the
* corresponding action - sets up yytext
*/
#define YY_DO_BEFORE_ACTION \
yytext = yy_bp; \
yyleng = yy_cp - yy_bp; \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* return all but the first 'n' matched characters back to the input stream */
#define yyless(n) \
do \
{ \
/* undo effects of setting up yytext */ \
*yy_cp = yy_hold_char; \
yy_c_buf_p = yy_cp = yy_bp + n; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )

#define unput(c) yyunput( c, yytext )


struct yy_buffer_state
{
FILE *yy_input_file;

YY_CHAR *yy_ch_buf; /* input buffer */
YY_CHAR *yy_buf_pos; /* current position in input buffer */

/* size of input buffer in bytes, not including room for EOB characters */
int yy_buf_size;

/* number of characters read into yy_ch_buf, not including EOB characters */
int yy_n_chars;

int yy_eof_status; /* whether we've seen an EOF on this buffer */
#define EOF_NOT_SEEN 0
/* "pending" happens when the EOF has been seen but there's still
* some text process
*/
#define EOF_PENDING 1
#define EOF_DONE 2
};

static YY_BUFFER_STATE yy_current_buffer;

/* we provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state"
*/
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed */
static YY_CHAR yy_hold_char;

static int yy_n_chars; /* number of characters read into yy_ch_buf */



#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

#ifndef YY_USER_INIT
#define YY_USER_INIT
#endif

extern YY_CHAR *yytext;
extern int yyleng;
extern FILE *yyin, *yyout;

YY_CHAR *yytext;
int yyleng;

FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;

#define YY_END_OF_BUFFER 223
typedef int yy_state_type;
static const short int yy_accept[652] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 223, 222, 222, 1, 2, 3,
4, 222, 222, 222, 222, 222, 222, 222, 8, 222,
5, 222, 6, 7, 222, 222, 222, 222, 222, 222,
222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
222, 222, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 25, 26,
27, 28, 29, 0, 0, 30, 31, 48, 63, 67,

47, 0, 39, 40, 41, 42, 0, 0, 53, 0,
0, 0, 0, 43, 0, 0, 0, 0, 0, 0,
0, 0, 0, 44, 45, 0, 51, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 159, 0, 135,
0, 134, 0, 158, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 161, 0, 163, 162, 0, 0,
173, 174, 170, 0, 183, 182, 0, 0, 189, 188,
0, 195, 194, 0, 160, 0, 166, 165, 0, 0,
179, 180, 176, 0, 186, 185, 0, 192, 191, 0,
198, 197, 0, 9, 10, 13, 14, 11, 17, 15,

18, 12, 16, 24, 22, 23, 23, 22, 19, 20,
21, 21, 21, 19, 20, 36, 36, 36, 0, 0,
0, 72, 80, 84, 90, 95, 0, 102, 110, 124,
129, 131, 0, 69, 78, 82, 87, 93, 96, 0,
99, 108, 121, 127, 130, 0, 0, 0, 0, 0,
0, 70, 79, 83, 88, 94, 0, 100, 109, 122,
128, 0, 68, 77, 81, 86, 92, 0, 98, 107,
120, 126, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 71, 85, 89, 101, 119, 123,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 137, 136, 133, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 164, 168, 175, 172, 184, 0,
190, 196, 200, 167, 169, 181, 178, 187, 193, 199,
201, 34, 0, 0, 0, 38, 38, 0, 0, 0,
50, 0, 0, 58, 61, 0, 0, 91, 49, 0,
0, 0, 0, 0, 0, 0, 75, 105, 0, 0,
0, 0, 0, 0, 125, 0, 146, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 132, 0, 210, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 171, 0, 177, 34, 0, 35,
0, 0, 37, 0, 0, 0, 0, 73, 74, 0,
0, 0, 0, 103, 104, 0, 0, 76, 106, 0,
0, 0, 97, 0, 0, 0, 0, 0, 0, 0,
0, 0, 148, 0, 0, 152, 0, 0, 0, 0,
0, 151, 0, 0, 0, 0, 0, 0, 0, 0,
0, 212, 0, 0, 216, 0, 0, 0, 0, 0,
215, 34, 33, 0, 117, 118, 113, 114, 115, 116,
111, 112, 0, 60, 0, 0, 0, 52, 0, 0,

0, 0, 0, 0, 0, 157, 0, 0, 0, 0,
0, 0, 154, 0, 0, 0, 0, 0, 0, 0,
0, 221, 0, 0, 0, 0, 0, 0, 218, 0,
0, 0, 0, 0, 0, 140, 0, 0, 156, 139,
0, 0, 0, 0, 150, 0, 0, 0, 155, 204,
0, 0, 220, 203, 0, 0, 0, 0, 214, 0,
0, 0, 219, 0, 0, 0, 0, 0, 0, 0,
0, 0, 147, 0, 143, 0, 0, 0, 0, 0,
0, 211, 0, 207, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 141,

0, 0, 149, 153, 0, 0, 205, 0, 0, 213,
217, 0, 0, 32, 46, 65, 64, 66, 0, 0,
0, 0, 0, 0, 138, 142, 144, 145, 202, 206,
208, 209, 32, 0, 46, 0, 0, 0, 62, 56,
57, 0, 32, 46, 59, 55, 0, 0, 0, 54,
0
} ;

static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 2, 3, 4,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 5, 6, 7, 8, 9, 10, 11, 12, 1,
1, 1, 1, 13, 14, 1, 15, 1, 16, 17,
18, 19, 1, 1, 1, 1, 1, 20, 1, 21,
1, 22, 23, 1, 24, 25, 26, 27, 28, 27,
29, 30, 31, 32, 27, 32, 27, 33, 34, 27,
27, 27, 35, 36, 37, 27, 27, 27, 38, 27,
1, 39, 1, 40, 41, 42, 43, 44, 45, 46,

47, 48, 49, 50, 51, 32, 52, 53, 54, 55,
56, 57, 27, 58, 59, 60, 61, 27, 27, 62,
63, 27, 64, 1, 65, 66, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,

1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;

static const YY_CHAR yy_meta[67] =
{ 0,
1, 1, 1, 2, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3, 3, 1, 4, 5, 5, 5, 4, 5, 5,
4, 5, 5, 4, 5, 5, 4, 5, 1, 1,
1, 1, 4, 5, 5, 5, 4, 5, 5, 5,
4, 5, 5, 5, 5, 4, 5, 5, 5, 5,
4, 5, 5, 1, 1, 1
} ;

static const short int yy_base[674] =
{ 0,
0, 0, 0, 0, 45, 56, 931, 930, 32, 47,
98, 0, 164, 0, 968, 971, 965, 971, 971, 971,
971, 964, 963, 962, 961, 960, 959, 958, 971, 957,
971, 956, 971, 971, 955, 954, 953, 952, 951, 224,
940, 939, 938, 285, 907, 328, 936, 55, 934, 230,
934, 0, 903, 365, 932, 231, 930, 234, 237, 930,
238, 241, 7, 0, 899, 242, 927, 294, 295, 303,
340, 9, 234, 7, 46, 932, 931, 8, 924, 306,
265, 39, 390, 406, 410, 422, 426, 236, 971, 971,
971, 971, 971, 893, 248, 971, 971, 971, 971, 971,

971, 445, 971, 971, 971, 971, 486, 871, 971, 8,
870, 869, 527, 971, 568, 33, 889, 319, 873, 886,
882, 864, 868, 971, 971, 447, 971, 39, 879, 196,
181, 869, 881, 868, 261, 32, 860, 971, 0, 971,
470, 909, 49, 971, 315, 873, 325, 308, 863, 875,
862, 331, 255, 854, 971, 0, 971, 971, 498, 0,
903, 971, 971, 0, 971, 971, 318, 0, 971, 971,
0, 971, 971, 0, 971, 0, 971, 971, 519, 0,
902, 971, 971, 0, 971, 971, 0, 971, 971, 0,
971, 971, 0, 971, 971, 971, 971, 971, 971, 971,

971, 971, 971, 971, 971, 971, 971, 971, 971, 971,
971, 971, 971, 971, 971, 971, 862, 873, 866, 436,
0, 971, 971, 971, 971, 971, 859, 971, 971, 971,
971, 971, 252, 971, 971, 971, 971, 971, 971, 858,
971, 971, 971, 971, 971, 346, 843, 843, 842, 840,
839, 971, 971, 971, 971, 971, 852, 971, 971, 971,
971, 863, 971, 971, 971, 971, 971, 850, 971, 971,
971, 971, 861, 835, 834, 852, 360, 840, 381, 852,
838, 844, 827, 827, 971, 971, 971, 971, 971, 971,
429, 846, 830, 833, 838, 831, 842, 833, 832, 831,

825, 386, 263, 837, 827, 971, 971, 866, 353, 436,
833, 817, 820, 825, 818, 829, 820, 819, 818, 812,
391, 362, 824, 814, 971, 971, 971, 853, 971, 416,
971, 971, 971, 971, 971, 971, 852, 971, 971, 971,
971, 20, 798, 393, 810, 971, 484, 796, 796, 808,
971, 794, 806, 971, 971, 791, 790, 971, 971, 790,
802, 788, 800, 785, 784, 796, 971, 971, 787, 781,
780, 799, 781, 778, 971, 776, 971, 779, 788, 795,
781, 775, 34, 774, 785, 10, 13, 772, 450, 771,
788, 787, 778, 785, 971, 452, 971, 766, 775, 782,

768, 762, 405, 761, 772, 454, 480, 759, 491, 758,
775, 774, 765, 772, 971, 498, 971, 472, 749, 971,
748, 753, 971, 746, 745, 744, 743, 971, 971, 742,
741, 740, 739, 971, 971, 744, 745, 971, 971, 437,
737, 735, 971, 752, 749, 746, 749, 748, 751, 742,
508, 731, 971, 739, 739, 971, 731, 737, 733, 514,
728, 971, 727, 694, 687, 686, 670, 673, 663, 520,
652, 971, 660, 660, 971, 652, 658, 657, 545, 656,
971, 971, 971, 652, 971, 971, 971, 971, 971, 971,
971, 971, 651, 971, 688, 687, 692, 971, 553, 639,

650, 556, 561, 647, 648, 971, 649, 652, 562, 651,
644, 643, 971, 564, 565, 630, 641, 570, 580, 638,
639, 971, 640, 643, 586, 642, 635, 634, 971, 588,
639, 638, 476, 661, 220, 971, 632, 617, 971, 971,
590, 616, 594, 625, 971, 624, 613, 612, 971, 971,
625, 610, 971, 971, 596, 609, 597, 618, 971, 617,
606, 605, 971, 606, 605, 599, 598, 597, 406, 602,
602, 606, 971, 602, 971, 605, 606, 581, 551, 614,
547, 971, 542, 971, 616, 620, 539, 532, 528, 517,
492, 483, 481, 484, 484, 528, 521, 510, 471, 971,

623, 624, 971, 971, 626, 628, 971, 630, 631, 971,
971, 632, 635, 642, 651, 971, 971, 971, 503, 488,
421, 418, 366, 370, 971, 971, 971, 971, 971, 971,
971, 971, 654, 334, 655, 333, 297, 290, 971, 971,
971, 280, 971, 971, 971, 971, 287, 322, 202, 971,
971, 719, 724, 727, 731, 736, 741, 743, 745, 747,
749, 751, 753, 755, 757, 759, 761, 763, 765, 767,
772, 777, 782
} ;

static const short int yy_def[674] =
{ 0,
652, 652, 652, 3, 653, 653, 652, 652, 652, 652,
651, 11, 651, 13, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 46, 651, 651, 651,
651, 46, 46, 651, 54, 651, 651, 651, 651, 651,
651, 651, 651, 54, 54, 651, 651, 651, 651, 651,
651, 651, 654, 651, 651, 651, 651, 651, 651, 651,
654, 651, 651, 655, 656, 651, 651, 657, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 658, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 659, 651, 651, 651, 660,
651, 651, 651, 661, 651, 651, 651, 662, 651, 651,
663, 651, 651, 664, 651, 665, 651, 651, 651, 666,
651, 651, 651, 667, 651, 651, 668, 651, 651, 669,
651, 651, 670, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 671, 651, 672,
673, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 672, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
0, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651
} ;

static const short int yy_nxt[1038] =
{ 0,
651, 651, 651, 651, 651, 651, 17, 18, 19, 20,
21, 22, 23, 174, 200, 193, 453, 651, 651, 454,
24, 25, 418, 26, 418, 27, 174, 28, 193, 453,
26, 248, 454, 26, 198, 249, 26, 41, 29, 30,
31, 30, 26, 42, 27, 203, 28, 200, 16, 200,
32, 36, 41, 198, 43, 26, 37, 37, 42, 16,
26, 139, 36, 33, 34, 38, 39, 37, 37, 43,
44, 199, 309, 45, 139, 274, 38, 39, 203, 275,
203, 304, 449, 419, 37, 44, 37, 305, 45, 291,
199, 309, 292, 450, 140, 37, 140, 37, 46, 46,

46, 46, 46, 46, 46, 46, 46, 46, 46, 47,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 48, 16, 49, 16, 50, 16, 16, 48, 51,
16, 48, 16, 51, 48, 16, 46, 52, 46, 53,
48, 16, 49, 16, 50, 16, 16, 16, 48, 16,
51, 16, 16, 48, 16, 16, 16, 51, 48, 16,
16, 46, 46, 46, 54, 54, 54, 54, 54, 54,
54, 54, 54, 54, 54, 55, 54, 54, 54, 54,
54, 54, 54, 54, 54, 54, 54, 56, 16, 57,
16, 58, 16, 16, 59, 60, 16, 61, 16, 60,

62, 63, 54, 64, 54, 65, 66, 16, 67, 16,
68, 16, 16, 16, 69, 16, 60, 16, 16, 70,
16, 16, 16, 60, 71, 16, 72, 54, 54, 54,
88, 89, 90, 91, 92, 88, 139, 156, 294, 297,
160, 142, 298, 164, 168, 161, 295, 171, 176, 139,
156, 296, 220, 160, 194, 195, 164, 168, 569, 570,
171, 176, 220, 88, 93, 88, 650, 94, 95, 140,
157, 140, 158, 162, 217, 163, 165, 169, 166, 170,
172, 177, 173, 178, 197, 651, 651, 96, 97, 101,
350, 102, 103, 104, 105, 106, 107, 108, 109, 218,

180, 184, 220, 302, 323, 181, 391, 220, 110, 187,
324, 221, 200, 180, 184, 197, 351, 202, 111, 112,
392, 303, 187, 277, 113, 114, 115, 116, 117, 118,
649, 648, 119, 182, 185, 183, 186, 647, 120, 121,
122, 330, 188, 123, 189, 200, 190, 200, 124, 125,
126, 128, 129, 130, 646, 131, 132, 133, 134, 190,
330, 645, 135, 136, 278, 310, 316, 313, 311, 317,
128, 129, 130, 321, 137, 314, 132, 133, 134, 191,
315, 192, 279, 396, 353, 367, 135, 136, 145, 146,
147, 322, 148, 149, 150, 151, 204, 644, 643, 152,

153, 205, 205, 396, 368, 411, 370, 145, 146, 147,
354, 154, 207, 149, 150, 151, 212, 208, 208, 412,
642, 213, 213, 152, 153, 371, 209, 210, 214, 205,
641, 205, 215, 205, 205, 377, 389, 205, 205, 390,
347, 409, 397, 421, 410, 208, 416, 208, 377, 213,
347, 213, 495, 468, 496, 397, 456, 420, 462, 594,
472, 205, 595, 205, 469, 205, 416, 205, 222, 456,
285, 462, 223, 472, 418, 224, 418, 378, 225, 286,
287, 226, 640, 227, 398, 639, 473, 228, 347, 288,
347, 229, 566, 307, 567, 347, 638, 475, 347, 473,

230, 289, 290, 307, 481, 231, 307, 232, 233, 234,
475, 637, 307, 235, 506, 624, 236, 481, 623, 237,
513, 326, 238, 239, 240, 307, 522, 506, 241, 622,
307, 326, 242, 513, 326, 419, 621, 620, 347, 522,
326, 243, 335, 347, 619, 618, 244, 617, 245, 246,
252, 529, 335, 326, 253, 335, 616, 254, 326, 536,
255, 335, 539, 256, 529, 257, 615, 540, 545, 258,
549, 550, 536, 259, 335, 539, 553, 614, 613, 335,
540, 545, 260, 549, 550, 612, 554, 261, 609, 553,
262, 263, 559, 608, 563, 264, 573, 606, 265, 554,

575, 266, 582, 584, 267, 559, 268, 563, 600, 573,
269, 603, 604, 575, 270, 582, 584, 596, 597, 598,
607, 600, 610, 271, 603, 604, 611, 605, 272, 625,
626, 273, 627, 607, 628, 610, 629, 630, 631, 611,
599, 632, 625, 626, 633, 627, 633, 628, 602, 629,
630, 631, 601, 635, 632, 635, 633, 635, 633, 635,
593, 592, 591, 590, 589, 588, 587, 586, 585, 583,
581, 580, 579, 578, 577, 576, 574, 572, 571, 568,
565, 564, 562, 561, 560, 558, 557, 556, 555, 552,
551, 548, 547, 546, 544, 543, 542, 541, 538, 537,

535, 534, 533, 532, 531, 634, 530, 528, 527, 526,
525, 524, 523, 521, 636, 520, 519, 634, 636, 16,
16, 16, 16, 16, 35, 35, 35, 35, 35, 196,
196, 206, 518, 206, 206, 206, 211, 517, 211, 211,
211, 216, 516, 216, 216, 216, 306, 306, 325, 325,
327, 327, 329, 329, 331, 331, 332, 332, 333, 333,
334, 334, 336, 336, 338, 338, 339, 339, 340, 340,
341, 341, 343, 515, 343, 343, 343, 346, 514, 346,
346, 346, 348, 512, 348, 348, 348, 511, 510, 509,
508, 507, 505, 504, 503, 502, 501, 500, 499, 498,

497, 494, 493, 492, 491, 490, 489, 488, 487, 486,
485, 484, 483, 482, 480, 479, 478, 477, 476, 474,
471, 470, 467, 466, 465, 464, 463, 461, 460, 459,
458, 457, 455, 452, 451, 448, 447, 446, 445, 444,
443, 442, 441, 440, 439, 438, 437, 436, 435, 434,
433, 432, 431, 430, 429, 428, 427, 426, 425, 424,
423, 422, 420, 417, 415, 414, 413, 408, 407, 406,
405, 404, 403, 402, 401, 400, 399, 395, 394, 393,
388, 387, 386, 385, 384, 383, 382, 381, 380, 379,
376, 375, 374, 373, 372, 369, 366, 365, 364, 363,

362, 361, 360, 359, 358, 357, 356, 355, 352, 349,
345, 344, 342, 337, 328, 317, 320, 319, 318, 312,
308, 298, 301, 300, 299, 293, 284, 283, 282, 281,
280, 276, 251, 250, 247, 219, 201, 195, 194, 179,
175, 167, 159, 155, 144, 143, 141, 138, 127, 100,
99, 98, 87, 86, 85, 84, 83, 82, 81, 80,
79, 78, 77, 76, 75, 74, 73, 651, 40, 40,
15, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651
} ;

static const short int yy_chk[1038] =
{ 0,
0, 0, 0, 0, 0, 0, 3, 3, 3, 3,
3, 3, 3, 63, 78, 72, 386, 0, 0, 387,
3, 3, 342, 3, 342, 3, 63, 3, 72, 386,
3, 110, 387, 3, 74, 110, 3, 9, 3, 3,
3, 3, 3, 9, 3, 82, 3, 78, 5, 78,
3, 5, 10, 74, 9, 3, 5, 5, 10, 6,
3, 48, 6, 3, 3, 5, 5, 6, 6, 10,
9, 75, 143, 9, 48, 116, 6, 6, 82, 116,
82, 136, 383, 342, 5, 10, 5, 136, 10, 128,
75, 143, 128, 383, 48, 6, 48, 6, 11, 11,

11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 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, 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, 13, 13,
40, 40, 40, 40, 40, 40, 50, 56, 130, 131,
58, 50, 131, 59, 61, 58, 130, 62, 66, 50,
56, 130, 95, 58, 73, 73, 59, 61, 535, 535,
62, 66, 95, 40, 40, 40, 649, 40, 40, 50,
56, 50, 56, 58, 88, 58, 59, 61, 59, 61,
62, 66, 62, 66, 73, 81, 81, 40, 40, 44,
233, 44, 44, 44, 44, 44, 44, 44, 44, 88,

68, 69, 95, 135, 153, 68, 303, 95, 44, 70,
153, 95, 80, 68, 69, 81, 233, 80, 44, 44,
303, 135, 70, 118, 44, 44, 44, 44, 44, 44,
648, 647, 44, 68, 69, 68, 69, 642, 44, 44,
44, 167, 70, 44, 70, 80, 71, 80, 44, 44,
44, 46, 46, 46, 638, 46, 46, 46, 46, 71,
167, 637, 46, 46, 118, 145, 148, 147, 145, 148,
46, 46, 46, 152, 46, 147, 46, 46, 46, 71,
147, 71, 118, 309, 246, 277, 46, 46, 54, 54,
54, 152, 54, 54, 54, 54, 83, 636, 634, 54,

54, 83, 83, 309, 277, 322, 279, 54, 54, 54,
246, 54, 84, 54, 54, 54, 85, 84, 84, 322,
624, 85, 85, 54, 54, 279, 84, 84, 86, 83,
623, 83, 87, 86, 86, 291, 302, 87, 87, 302,
220, 321, 310, 344, 321, 84, 330, 84, 291, 85,
220, 85, 440, 403, 440, 310, 389, 344, 396, 569,
406, 86, 569, 86, 403, 87, 330, 87, 102, 389,
126, 396, 102, 406, 418, 102, 418, 291, 102, 126,
126, 102, 622, 102, 310, 621, 407, 102, 347, 126,
220, 102, 533, 141, 533, 220, 620, 409, 347, 407,

102, 126, 126, 141, 416, 102, 141, 102, 102, 107,
409, 619, 141, 107, 451, 599, 107, 416, 598, 107,
460, 159, 107, 107, 107, 141, 470, 451, 107, 597,
141, 159, 107, 460, 159, 418, 596, 595, 347, 470,
159, 107, 179, 347, 594, 593, 107, 592, 107, 107,
113, 479, 179, 159, 113, 179, 591, 113, 159, 499,
113, 179, 502, 113, 479, 113, 590, 503, 509, 113,
514, 515, 499, 113, 179, 502, 518, 589, 588, 179,
503, 509, 113, 514, 515, 587, 519, 113, 583, 518,
113, 115, 525, 581, 530, 115, 541, 579, 115, 519,

543, 115, 555, 557, 115, 525, 115, 530, 571, 541,
115, 576, 577, 543, 115, 555, 557, 570, 570, 570,
580, 571, 585, 115, 576, 577, 586, 578, 115, 601,
602, 115, 605, 580, 606, 585, 608, 609, 612, 586,
570, 613, 601, 602, 614, 605, 614, 606, 574, 608,
609, 612, 572, 615, 613, 615, 633, 635, 633, 635,
568, 567, 566, 565, 564, 562, 561, 560, 558, 556,
552, 551, 548, 547, 546, 544, 542, 538, 537, 534,
532, 531, 528, 527, 526, 524, 523, 521, 520, 517,
516, 512, 511, 510, 508, 507, 505, 504, 501, 500,

497, 496, 495, 493, 484, 614, 480, 478, 477, 476,
474, 473, 471, 469, 615, 468, 467, 633, 635, 652,
652, 652, 652, 652, 653, 653, 653, 653, 653, 654,
654, 655, 466, 655, 655, 655, 656, 465, 656, 656,
656, 657, 464, 657, 657, 657, 658, 658, 659, 659,
660, 660, 661, 661, 662, 662, 663, 663, 664, 664,
665, 665, 666, 666, 667, 667, 668, 668, 669, 669,
670, 670, 671, 463, 671, 671, 671, 672, 461, 672,
672, 672, 673, 459, 673, 673, 673, 458, 457, 455,
454, 452, 450, 449, 448, 447, 446, 445, 444, 442,

441, 437, 436, 433, 432, 431, 430, 427, 426, 425,
424, 422, 421, 419, 414, 413, 412, 411, 410, 408,
405, 404, 402, 401, 400, 399, 398, 394, 393, 392,
391, 390, 388, 385, 384, 382, 381, 380, 379, 378,
376, 374, 373, 372, 371, 370, 369, 366, 365, 364,
363, 362, 361, 360, 357, 356, 353, 352, 350, 349,
348, 345, 343, 337, 328, 324, 323, 320, 319, 318,
317, 316, 315, 314, 313, 312, 311, 308, 305, 304,
301, 300, 299, 298, 297, 296, 295, 294, 293, 292,
284, 283, 282, 281, 280, 278, 276, 275, 274, 273,

268, 262, 257, 251, 250, 249, 248, 247, 240, 227,
219, 218, 217, 181, 161, 154, 151, 150, 149, 146,
142, 137, 134, 133, 132, 129, 123, 122, 121, 120,
119, 117, 112, 111, 108, 94, 79, 77, 76, 67,
65, 60, 57, 55, 53, 51, 49, 47, 45, 43,
42, 41, 39, 38, 37, 36, 35, 32, 30, 28,
27, 26, 25, 24, 23, 22, 17, 15, 8, 7,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,

651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
651, 651, 651, 651, 651, 651, 651
} ;

static yy_state_type yy_last_accepting_state;
static YY_CHAR *yy_last_accepting_cpos;

/* the intent behind this definition is that it'll catch
* any uses of REJECT which flex missed
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0

/* these variables are all declared out here so that section 3 code can
* manipulate them
*/
/* points to current character in buffer */
static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */

/* flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;

static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));

#define yy_new_buffer yy_create_buffer

#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif

YY_DECL
{
register yy_state_type yy_current_state;
register YY_CHAR *yy_cp, *yy_bp;
register int yy_act;



if ( yy_init )
{
YY_USER_INIT;

if ( ! yy_start )
yy_start = 1; /* first start state */

if ( ! yyin )
yyin = stdin;

if ( ! yyout )
yyout = stdout;

if ( yy_current_buffer )
yy_init_buffer( yy_current_buffer, yyin );
else
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

yy_load_buffer_state();

yy_init = 0;
}

while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yy_c_buf_p;

/* support of yytext */
*yy_cp = yy_hold_char;

/* yy_bp points to the position in yy_ch_buf of the start of the
* current run.
*/
yy_bp = yy_cp;

yy_current_state = yy_start;
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[*yy_cp];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 652 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 651 );
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;

yy_find_action:
yy_act = yy_accept[yy_current_state];

YY_DO_BEFORE_ACTION;
YY_USER_ACTION;

do_action: /* this label is used only to access EOF actions */


switch ( yy_act )
{
case 0: /* must backtrack */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
goto yy_find_action;

case 1:
# line 88 ""
{ if (!diacritics_only) output ('\\'); output ('#'); }
YY_BREAK
case 2:
# line 89 ""
{ if (!diacritics_only) output ('\\'); output ('$'); }
YY_BREAK
case 3:
# line 90 ""
{ if (!diacritics_only) output ('\\'); output ('%'); }
YY_BREAK
case 4:
# line 91 ""
{ if (!diacritics_only) output ('\\'); output ('&'); }
YY_BREAK
case 5:
# line 92 ""
{ if (!diacritics_only) output ('\\'); output ('_'); }
YY_BREAK
case 6:
# line 93 ""
{ if (!diacritics_only) output ('\\'); output ('{'); }
YY_BREAK
case 7:
# line 94 ""
{ if (!diacritics_only) output ('\\'); output ('}'); }
YY_BREAK
case 8:
# line 95 ""
{ const char *cursor;
if (diacritics_only)
output ('\\');
else
for (cursor = "\\backslash{}"; *cursor; cursor++)
output (*cursor);
}
YY_BREAK
case 9:
# line 102 ""
{ output ('`'); output ('`'); }
YY_BREAK
case 10:
# line 103 ""
{ output ('\''); output ('\''); }
YY_BREAK
case 11:
# line 104 ""
{ output ('\\'); output ('\''); output (yytext[2]); }
YY_BREAK
case 12:
# line 105 ""
{ output ('\\'); output ('\''); output (yytext[0]); }
YY_BREAK
case 13:
# line 106 ""
{ output ('\\'); output (yytext[0]);
output (yytext[2]); }
YY_BREAK
case 14:
# line 108 ""
{ output ('\\'); output (yytext[0]); output ('\\');
output ('i'); output (' '); }
YY_BREAK
case 15:
# line 110 ""
{ output ('\\'); output (yytext[2]);
output (yytext[0]); }
YY_BREAK
case 16:
# line 112 ""
{ output ('\\'); output (yytext[2]); output ('\\');
output ('i'); output (' '); }
YY_BREAK
case 17:
# line 114 ""
{ output ('\\'); output ('c'); output ('{');
output (yytext[2]); output ('}'); }
YY_BREAK
case 18:
# line 116 ""
{ output ('\\'); output ('c'); output ('{');
output (yytext[0]); output ('}'); }
YY_BREAK
case 19:
# line 118 ""
{ output ('`'); output ('`'); }
YY_BREAK
case 20:
# line 119 ""
{ output ('\''); output ('\''); }
YY_BREAK
case 21:
# line 120 ""
{ output (yytext[2]); output (yytext[0]); }
YY_BREAK
case 22:
# line 121 ""
{ output (yytext[0]); output (yytext[2]); }
YY_BREAK
case 23:
# line 122 ""
{ output (yytext[2]); output (diaeresis_char); }
YY_BREAK
case 24:
# line 123 ""
{ output (yytext[0]); output (diaeresis_char); }
YY_BREAK
case 25:
# line 124 ""
{ if (diacritics_only) ECHO; else output ('#'); }
YY_BREAK
case 26:
# line 125 ""
{ if (diacritics_only) ECHO; else output ('$'); }
YY_BREAK
case 27:
# line 126 ""
{ if (diacritics_only) ECHO; else output ('%'); }
YY_BREAK
case 28:
# line 127 ""
{ if (diacritics_only) ECHO; else output ('&'); }
YY_BREAK
case 29:
# line 128 ""
{ if (diacritics_only) ECHO; else output ('_'); }
YY_BREAK
case 30:
# line 129 ""
{ if (diacritics_only) ECHO; else output ('{'); }
YY_BREAK
case 31:
# line 130 ""
{ if (diacritics_only) ECHO; else output ('}'); }
YY_BREAK
case 32:
# line 131 ""
{ if (diacritics_only) ECHO; else output ('\\'); }
YY_BREAK
case 33:
# line 132 ""
{ output ('i'); output ('\b'); output (yytext[1]); }
YY_BREAK
case 34:
# line 133 ""
{ output ('i'); output ('\b'); output (yytext[1]); }
YY_BREAK
case 35:
# line 134 ""
{ output (yytext[3]); output ('\b');
output (yytext[1]); }
YY_BREAK
case 36:
# line 136 ""
{ output (yytext[2]); output ('\b');
output (yytext[1]); }
YY_BREAK
case 37:
# line 138 ""
{ output (','); output ('\b'); output (yytext[3]); }
YY_BREAK
case 38:
# line 139 ""
{ output (','); output ('\b');
output (yytext[yyleng-1]); }
YY_BREAK
case 39:
# line 141 ""
{ if (diacritics_only) ECHO; else output ('#'); }
YY_BREAK
case 40:
# line 142 ""
{ if (diacritics_only) ECHO; else output ('$'); }
YY_BREAK
case 41:
# line 143 ""
{ if (diacritics_only) ECHO; else output ('%'); }
YY_BREAK
case 42:
# line 144 ""
{ if (diacritics_only) ECHO; else output ('&'); }
YY_BREAK
case 43:
# line 145 ""
{ if (diacritics_only) ECHO; else output ('_'); }
YY_BREAK
case 44:
# line 146 ""
{ if (diacritics_only) ECHO; else output ('{'); }
YY_BREAK
case 45:
# line 147 ""
{ if (diacritics_only) ECHO; else output ('}'); }
YY_BREAK
case 46:
# line 148 ""
{ if (diacritics_only) ECHO; else output ('\\'); }
YY_BREAK
case 47:
# line 149 ""
{ if (diacritics_only) ECHO; else output ('\240'); }
YY_BREAK
case 48:
# line 150 ""
{ if (diacritics_only) ECHO; else output ('\241'); }
YY_BREAK
case 49:
# line 151 ""
{ if (diacritics_only) ECHO; else output ('\247'); }
YY_BREAK
case 50:
# line 152 ""
{ if (diacritics_only) ECHO; else output ('\250'); }
YY_BREAK
case 51:
# line 153 ""
{ if (diacritics_only) ECHO; else output ('\253'); }
YY_BREAK
case 52:
# line 154 ""
{ if (diacritics_only) ECHO; else output ('\254'); }
YY_BREAK
case 53:
# line 155 ""
{ if (diacritics_only) ECHO; else output ('\255'); }
YY_BREAK
case 54:
# line 156 ""
{ if (diacritics_only) ECHO; else output ('\260'); }
YY_BREAK
case 55:
# line 157 ""
{ if (diacritics_only) ECHO; else output ('\261'); }
YY_BREAK
case 56:
# line 158 ""
{ if (diacritics_only) ECHO; else output ('\262'); }
YY_BREAK
case 57:
# line 159 ""
{ if (diacritics_only) ECHO; else output ('\263'); }
YY_BREAK
case 58:
# line 160 ""
{ if (diacritics_only) ECHO; else output ('\264'); }
YY_BREAK
case 59:
# line 161 ""
{ if (diacritics_only) ECHO; else output ('\265'); }
YY_BREAK
case 60:
# line 162 ""
{ if (diacritics_only) ECHO; else output ('\267'); }
YY_BREAK
case 61:
# line 163 ""
{ if (diacritics_only) ECHO; else output ('\270'); }
YY_BREAK
case 62:
# line 164 ""
{ if (diacritics_only) ECHO; else output ('\271'); }
YY_BREAK
case 63:
# line 165 ""
{ if (diacritics_only) ECHO; else output ('\273'); }
YY_BREAK
case 64:
# line 166 ""
{ if (diacritics_only) ECHO; else output ('\274'); }
YY_BREAK
case 65:
# line 167 ""
{ if (diacritics_only) ECHO; else output ('\275'); }
YY_BREAK
case 66:
# line 168 ""
{ if (diacritics_only) ECHO; else output ('\276'); }
YY_BREAK
case 67:
# line 169 ""
{ if (diacritics_only) ECHO; else output ('\277'); }
YY_BREAK
case 68:
# line 170 ""
{ output ('\300'); }
YY_BREAK
case 69:
# line 171 ""
{ output ('\301'); }
YY_BREAK
case 70:
# line 172 ""
{ output ('\302'); }
YY_BREAK
case 71:
# line 173 ""
{ output ('\303'); }
YY_BREAK
case 72:
# line 174 ""
{ output ('\304'); }
YY_BREAK
case 73:
# line 175 ""
{ output ('\305'); }
YY_BREAK
case 74:
# line 176 ""
{ output ('\306'); }
YY_BREAK
case 75:
# line 177 ""
{ output ('\307'); }
YY_BREAK
case 76:
# line 178 ""
{ output ('\307'); }
YY_BREAK
case 77:
# line 179 ""
{ output ('\310'); }
YY_BREAK
case 78:
# line 180 ""
{ output ('\311'); }
YY_BREAK
case 79:
# line 181 ""
{ output ('\312'); }
YY_BREAK
case 80:
# line 182 ""
{ output ('\313'); }
YY_BREAK
case 81:
# line 183 ""
{ output ('\314'); }
YY_BREAK
case 82:
# line 184 ""
{ output ('\315'); }
YY_BREAK
case 83:
# line 185 ""
{ output ('\316'); }
YY_BREAK
case 84:
# line 186 ""
{ output ('\317'); }
YY_BREAK
case 85:
# line 187 ""
{ output ('\321'); }
YY_BREAK
case 86:
# line 188 ""
{ output ('\322'); }
YY_BREAK
case 87:
# line 189 ""
{ output ('\323'); }
YY_BREAK
case 88:
# line 190 ""
{ output ('\324'); }
YY_BREAK
case 89:
# line 191 ""
{ output ('\325'); }
YY_BREAK
case 90:
# line 192 ""
{ output ('\326'); }
YY_BREAK
case 91:
# line 193 ""
{ output ('\330'); }
YY_BREAK
case 92:
# line 194 ""
{ output ('\331'); }
YY_BREAK
case 93:
# line 195 ""
{ output ('\332'); }
YY_BREAK
case 94:
# line 196 ""
{ output ('\333'); }
YY_BREAK
case 95:
# line 197 ""
{ output ('\334'); }
YY_BREAK
case 96:
# line 198 ""
{ output ('\335'); }
YY_BREAK
case 97:
# line 199 ""
{ output ('\337'); }
YY_BREAK
case 98:
# line 200 ""
{ output ('\340'); }
YY_BREAK
case 99:
# line 201 ""
{ output ('\341'); }
YY_BREAK
case 100:
# line 202 ""
{ output ('\342'); }
YY_BREAK
case 101:
# line 203 ""
{ output ('\343'); }
YY_BREAK
case 102:
# line 204 ""
{ output ('\344'); }
YY_BREAK
case 103:
# line 205 ""
{ output ('\345'); }
YY_BREAK
case 104:
# line 206 ""
{ output ('\346'); }
YY_BREAK
case 105:
# line 207 ""
{ output ('\347'); }
YY_BREAK
case 106:
# line 208 ""
{ output ('\347'); }
YY_BREAK
case 107:
# line 209 ""
{ output ('\350'); }
YY_BREAK
case 108:
# line 210 ""
{ output ('\351'); }
YY_BREAK
case 109:
# line 211 ""
{ output ('\352'); }
YY_BREAK
case 110:
# line 212 ""
{ output ('\353'); }
YY_BREAK
case 111:
# line 213 ""
{ output ('\354'); }
YY_BREAK
case 112:
# line 214 ""
{ output ('\354'); }
YY_BREAK
case 113:
# line 215 ""
{ output ('\355'); }
YY_BREAK
case 114:
# line 216 ""
{ output ('\355'); }
YY_BREAK
case 115:
# line 217 ""
{ output ('\356'); }
YY_BREAK
case 116:
# line 218 ""
{ output ('\356'); }
YY_BREAK
case 117:
# line 219 ""
{ output ('\357'); }
YY_BREAK
case 118:
# line 220 ""
{ output ('\357'); }
YY_BREAK
case 119:
# line 221 ""
{ output ('\361'); }
YY_BREAK
case 120:
# line 222 ""
{ output ('\362'); }
YY_BREAK
case 121:
# line 223 ""
{ output ('\363'); }
YY_BREAK
case 122:
# line 224 ""
{ output ('\364'); }
YY_BREAK
case 123:
# line 225 ""
{ output ('\365'); }
YY_BREAK
case 124:
# line 226 ""
{ output ('\366'); }
YY_BREAK
case 125:
# line 227 ""
{ output ('\370'); }
YY_BREAK
case 126:
# line 228 ""
{ output ('\371'); }
YY_BREAK
case 127:
# line 229 ""
{ output ('\372'); }
YY_BREAK
case 128:
# line 230 ""
{ output ('\373'); }
YY_BREAK
case 129:
# line 231 ""
{ output ('\374'); }
YY_BREAK
case 130:
# line 232 ""
{ output ('\375'); }
YY_BREAK
case 131:
# line 233 ""
{ output ('\377'); }
YY_BREAK
case 132:
# line 234 ""
{ output ('\''); output ('\b'); output (yytext[0]);
output ('"'); output ('\b'); output ('>'); }
YY_BREAK
case 133:
# line 236 ""
{ output (yytext[0]);
output ('"'); output ('\b'); output ('>'); }
YY_BREAK
case 134:
# line 238 ""
{ output ('\''); output ('\b'); output (yytext[0]); }
YY_BREAK
case 135:
# line 239 ""
{ output (yytext[1]); output ('\b');
output (yytext[0]); }
YY_BREAK
case 136:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 241 ""
{ output (','); output ('\b'); output (yytext[0]); }
YY_BREAK
case 137:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 242 ""
{ output ('"'); output ('\b'); output (yytext[0]); }
YY_BREAK
case 138:
# line 243 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 139:
# line 244 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 140:
# line 245 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 141:
# line 246 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 142:
# line 247 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 143:
# line 248 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 144:
# line 249 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 145:
# line 250 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 146:
# line 251 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 147:
# line 252 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 148:
# line 253 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 149:
# line 254 ""
{ if (yytext[4] == diaeresis_char)
texte_ascii_diaeresis ();
else
ECHO;
}
YY_BREAK
case 150:
# line 259 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 151:
# line 260 ""
{ ECHO; }
YY_BREAK
case 152:
# line 261 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 153:
# line 262 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 154:
# line 263 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 155:
# line 264 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 156:
# line 265 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 157:
# line 266 ""
{ texte_ascii_diaeresis (); }
YY_BREAK
case 158:
# line 267 ""
{ output ('"'); output ('\b'); output ('<'); }
YY_BREAK
case 159:
# line 268 ""
{ output ('"'); output ('\b'); output ('>'); }
YY_BREAK
case 160:
# line 269 ""
{ output ('\253'); }
YY_BREAK
case 161:
# line 270 ""
{ output ('\273'); }
YY_BREAK
case 162:
# line 271 ""
{ output ('\300'); }
YY_BREAK
case 163:
# line 272 ""
{ output ('\302'); }
YY_BREAK
case 164:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 273 ""
{ output ('\304'); }
YY_BREAK
case 165:
# line 274 ""
{ output ('\340'); }
YY_BREAK
case 166:
# line 275 ""
{ output ('\342'); }
YY_BREAK
case 167:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 276 ""
{ output ('\344'); }
YY_BREAK
case 168:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 277 ""
{ output ('\307'); }
YY_BREAK
case 169:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 278 ""
{ output ('\347'); }
YY_BREAK
case 170:
# line 279 ""
{ output ('\310'); }
YY_BREAK
case 171:
# line 280 ""
{ output ('\311'); output ('\273'); }
YY_BREAK
case 172:
# line 281 ""
{ output ('E'); output ('\273'); }
YY_BREAK
case 173:
# line 282 ""
{ output ('\311'); }
YY_BREAK
case 174:
# line 283 ""
{ output ('\312'); }
YY_BREAK
case 175:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 284 ""
{ output ('\313'); }
YY_BREAK
case 176:
# line 285 ""
{ output ('\350'); }
YY_BREAK
case 177:
# line 286 ""
{ output ('\351'); output ('\273'); }
YY_BREAK
case 178:
# line 287 ""
{ output ('e'); output ('\273'); }
YY_BREAK
case 179:
# line 288 ""
{ output ('\351'); }
YY_BREAK
case 180:
# line 289 ""
{ output ('\352'); }
YY_BREAK
case 181:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 290 ""
{ output ('\353'); }
YY_BREAK
case 182:
# line 291 ""
{ output ('\314'); }
YY_BREAK
case 183:
# line 292 ""
{ output ('\316'); }
YY_BREAK
case 184:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 293 ""
{ output ('\317'); }
YY_BREAK
case 185:
# line 294 ""
{ output ('\354'); }
YY_BREAK
case 186:
# line 295 ""
{ output ('\356'); }
YY_BREAK
case 187:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 296 ""
{ output ('\357'); }
YY_BREAK
case 188:
# line 297 ""
{ output ('\322'); }
YY_BREAK
case 189:
# line 298 ""
{ output ('\324'); }
YY_BREAK
case 190:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 299 ""
{ output ('\326'); }
YY_BREAK
case 191:
# line 300 ""
{ output ('\362'); }
YY_BREAK
case 192:
# line 301 ""
{ output ('\364'); }
YY_BREAK
case 193:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 302 ""
{ output ('\366'); }
YY_BREAK
case 194:
# line 303 ""
{ output ('\331'); }
YY_BREAK
case 195:
# line 304 ""
{ output ('\333'); }
YY_BREAK
case 196:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 305 ""
{ output ('\334'); }
YY_BREAK
case 197:
# line 306 ""
{ output ('\371'); }
YY_BREAK
case 198:
# line 307 ""
{ output ('\373'); }
YY_BREAK
case 199:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 308 ""
{ output ('\374'); }
YY_BREAK
case 200:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 309 ""
{ output ('Y'); }
YY_BREAK
case 201:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
# line 310 ""
{ output ('\337'); }
YY_BREAK
case 202:
# line 311 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 203:
# line 312 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 204:
# line 313 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 205:
# line 314 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 206:
# line 315 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 207:
# line 316 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 208:
# line 317 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 209:
# line 318 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 210:
# line 319 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 211:
# line 320 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 212:
# line 321 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 213:
# line 322 ""
{ if (yytext[4] == diaeresis_char)
texte_latin1_diaeresis ();
else
ECHO;
}
YY_BREAK
case 214:
# line 327 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 215:
# line 328 ""
{ ECHO; }
YY_BREAK
case 216:
# line 329 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 217:
# line 330 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 218:
# line 331 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 219:
# line 332 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 220:
# line 333 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 221:
# line 334 ""
{ texte_latin1_diaeresis (); }
YY_BREAK
case 222:
# line 335 ""
ECHO;
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(X_ascii_latex):
case YY_STATE_EOF(X_ascii_texte):
case YY_STATE_EOF(X_latex_ascii):
case YY_STATE_EOF(X_latex_latin1):
case YY_STATE_EOF(X_texte_ascii):
case YY_STATE_EOF(X_texte_latin1):
yyterminate();

case YY_END_OF_BUFFER:
{
/* amount of text matched not including the EOB char */
int yy_amount_of_matched_text = yy_cp - yytext - 1;

/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;

/* note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the end-
* of-buffer state). Contrast this with the test in yyinput().
*/
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* this was really a NUL */
{
yy_state_type yy_next_state;

yy_c_buf_p = yytext + yy_amount_of_matched_text;

yy_current_state = yy_get_previous_state();

/* okay, we're now positioned to make the
* NUL transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we
* don't want to build jamming into it because
* then it will run more slowly)
*/

yy_next_state = yy_try_NUL_trans( yy_current_state );

yy_bp = yytext + YY_MORE_ADJ;

if ( yy_next_state )
{
/* consume the NUL */
yy_cp = ++yy_c_buf_p;
yy_current_state = yy_next_state;
goto yy_match;
}

else
{
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
goto yy_find_action;
}
}

else switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
yy_did_buffer_switch_on_eof = 0;

if ( yywrap() )
{
/* note: because we've taken care in
* yy_get_next_buffer() to have set up yytext,
* we can now set up yy_c_buf_p so that if some
* total hoser (like flex itself) wants
* to call the scanner after we return the
* YY_NULL, it'll still work - another YY_NULL
* will get returned.
*/
yy_c_buf_p = yytext + YY_MORE_ADJ;

yy_act = YY_STATE_EOF((yy_start - 1) / 2);
goto do_action;
}

else
{
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
}
break;

case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext + yy_amount_of_matched_text;

yy_current_state = yy_get_previous_state();

yy_cp = yy_c_buf_p;
yy_bp = yytext + YY_MORE_ADJ;
goto yy_match;

case EOB_ACT_LAST_MATCH:
yy_c_buf_p =
&yy_current_buffer->yy_ch_buf[yy_n_chars];

yy_current_state = yy_get_previous_state();

yy_cp = yy_c_buf_p;
yy_bp = yytext + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}

default:
#ifdef FLEX_DEBUG
printf( "action # %d\n", yy_act );
#endif
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
}
}
}


/* yy_get_next_buffer - try to read in a new buffer
*
* synopsis
* int yy_get_next_buffer();
*
* returns a code representing an action
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/

static int yy_get_next_buffer()

{
register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
register int number_to_move, i;
int ret_val;

if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );

/* try to read more data */

/* first move last chars to start of buffer */
number_to_move = yy_c_buf_p - yytext;

for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);

if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_n_chars = 0;

else
{
int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;

if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;

else if ( num_to_read <= 0 )
YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );

/* read in more data */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
}

if ( yy_n_chars == 0 )
{
if ( number_to_move - YY_MORE_ADJ == 1 )
{
ret_val = EOB_ACT_END_OF_FILE;
yy_current_buffer->yy_eof_status = EOF_DONE;
}

else
{
ret_val = EOB_ACT_LAST_MATCH;
yy_current_buffer->yy_eof_status = EOF_PENDING;
}
}

else
ret_val = EOB_ACT_CONTINUE_SCAN;

yy_n_chars += number_to_move;
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

/* yytext begins at the second character in yy_ch_buf; the first
* character is the one which preceded it before reading in the latest
* buffer; it needs to be kept around in case it's a newline, so
* yy_get_previous_state() will have with '^' rules active
*/

yytext = &yy_current_buffer->yy_ch_buf[1];

return ( ret_val );
}


/* yy_get_previous_state - get the state just before the EOB char was reached
*
* synopsis
* yy_state_type yy_get_previous_state();
*/

static yy_state_type yy_get_previous_state()

{
register yy_state_type yy_current_state;
register YY_CHAR *yy_cp;

yy_current_state = yy_start;

for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 652 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}

return ( yy_current_state );
}


/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
register yy_state_type yy_current_state;
#endif

{
register int yy_is_jam;
register YY_CHAR *yy_cp = yy_c_buf_p;

register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = yy_def[yy_current_state];
if ( yy_current_state >= 652 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 651);

return ( yy_is_jam ? 0 : yy_current_state );
}


#ifdef YY_USE_PROTOS
static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
#else
static void yyunput( c, yy_bp )
YY_CHAR c;
register YY_CHAR *yy_bp;
#endif

{
register YY_CHAR *yy_cp = yy_c_buf_p;

/* undo effects of setting up yytext */
*yy_cp = yy_hold_char;

if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
register YY_CHAR *dest =
&yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
register YY_CHAR *source =
&yy_current_buffer->yy_ch_buf[number_to_move];

while ( source > yy_current_buffer->yy_ch_buf )
*--dest = *--source;

yy_cp += dest - source;
yy_bp += dest - source;
yy_n_chars = yy_current_buffer->yy_buf_size;

if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}

if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
yy_cp[-2] = '\n';

*--yy_cp = c;

/* note: the formal parameter *must* be called "yy_bp" for this
* macro to now work correctly
*/
YY_DO_BEFORE_ACTION; /* set up yytext again */
}


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif

{
int c;
YY_CHAR *yy_cp = yy_c_buf_p;

*yy_cp = yy_hold_char;

if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* this was really a NUL */
*yy_c_buf_p = '\0';

else
{ /* need more input */
yytext = yy_c_buf_p;
++yy_c_buf_p;

switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
{
yy_c_buf_p = yytext + YY_MORE_ADJ;
return ( EOF );
}

YY_NEW_FILE;

#ifdef __cplusplus
return ( yyinput() );
#else
return ( input() );
#endif
}
break;

case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext + YY_MORE_ADJ;
break;

case EOB_ACT_LAST_MATCH:
#ifdef __cplusplus
YY_FATAL_ERROR( "unexpected last match in yyinput()" );
#else
YY_FATAL_ERROR( "unexpected last match in input()" );
#endif
}
}
}

c = *yy_c_buf_p;
yy_hold_char = *++yy_c_buf_p;

return ( c );
}


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif

{
yy_init_buffer( yy_current_buffer, input_file );
yy_load_buffer_state();
}


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif

{
if ( yy_current_buffer == new_buffer )
return;

if ( yy_current_buffer )
{
/* flush out information for old buffer */
*yy_c_buf_p = yy_hold_char;
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
yy_current_buffer->yy_n_chars = yy_n_chars;
}

yy_current_buffer = new_buffer;
yy_load_buffer_state();

/* we don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yy_did_buffer_switch_on_eof = 1;
}


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif

{
yy_n_chars = yy_current_buffer->yy_n_chars;
yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
yyin = yy_current_buffer->yy_input_file;
yy_hold_char = *yy_c_buf_p;
}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif

{
YY_BUFFER_STATE b;

b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );

if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

b->yy_buf_size = size;

/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );

if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

yy_init_buffer( b, file );

return ( b );
}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif

{
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;

free( (char *) b->yy_ch_buf );
free( (char *) b );
}


#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif

{
b->yy_input_file = file;

/* we put in the '\n' and start reading from [1] so that an
* initial match-at-newline will be true.
*/

b->yy_ch_buf[0] = '\n';
b->yy_n_chars = 1;

/* we always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;

b->yy_buf_pos = &b->yy_ch_buf[1];

b->yy_eof_status = EOF_NOT_SEEN;
}
# line 335 ""

void
latex_latin1 (FILE *input_file, FILE *output_file)
{
yy_init = 1;
yyin = input_file;
yyout = output_file;
BEGIN X_latex_latin1;
yylex ();
}
void
latex_ascii (FILE *input_file, FILE *output_file)
{
yy_init = 1;
yyin = input_file;
yyout = output_file;
BEGIN X_latex_ascii;
yylex ();
}
void
texte_ascii (FILE *input_file, FILE *output_file)
{
yy_init = 1;
yyin = input_file;
yyout = output_file;
BEGIN X_texte_ascii;
yylex ();
}
void
ascii_latex (FILE *input_file, FILE *output_file)
{
yy_init = 1;
yyin = input_file;
yyout = output_file;
BEGIN X_ascii_latex;
yylex ();
}
void
ascii_texte (FILE *input_file, FILE *output_file)
{
yy_init = 1;
yyin = input_file;
yyout = output_file;
BEGIN X_ascii_texte;
yylex ();
}
void
texte_latin1 (FILE *input_file, FILE *output_file)
{
yy_init = 1;
yyin = input_file;
yyout = output_file;
BEGIN X_texte_latin1;
yylex ();
}
recode-3.2.4/recode.info 644 6206 22 126733 5245753730 12676 0ustar djmumdThis is Info file recode.info, produced by Makeinfo-1.47 from the input
file recode.texi.

Copyright (C) 1990 Free Software Foundation, Inc. Francois Pinard
, 1988.

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., 675 Mass Ave, Cambridge, MA 02139, USA.


File: recode.info, Node: Top, Next: Usage, Prev: (dir), Up: (dir)

Conversion of files between different charsets and usages
*********************************************************

This `recode' program has the purpose of converting files between
various character sets and usages. When exact transliterations are not
possible, as it is often the case, the program may get rid of the
offending characters or fall back on approximations.

Let us coin the term "charset" to represent, without distinction, a
character set "per se" or a particular usage of a character set. This
program recognizes or produces a little more than a dozen of such
charsets. Since it can convert each charset to almost any other one,
more than one hundred different conversions are possible.

This tool pays special attention to superimposition of diacritics,
particularily for French representation. This orientation is mostly
historical, it does not impair the usefulness, generality or
extensibility of the program. In fact, this program evolved for
several years, through several programming languages and computer
brands, because I used a lot of different coding for French characters
on different machines, each system having its own peculiarities.

You may find in this document:

* Menu:

* Usage:: How to use this program
* Charsets:: Character sets recognized of produced
* Easy French:: Easy French conventions
* Internals:: Internal aspects
* Future:: Future things

-- The Detailed Node Listing --

Character sets recognized of produced

* applemac:: ASCII 8-bits for Apple's Macintosh
* ascii:: ASCII 7-bits, BS to overstrike
* bangbang:: ASCII "bang bang", escapes are ! and !!
* cccascii:: ASCII 8-bits as seen by Perkin Elmer
* cdcascii:: ASCII 8-bits a seen by Control Data
* cdcnos:: ASCII 6/12 from NOS, escapes are ^ and @
* ebcdic:: EBCDIC with no further comments
* flat:: ASCII without diacritics nor underline
* ibmpc:: ASCII 8-bits for IBM's PC
* iconqnx:: ASCII as coded on Unisys' ICON
* latex:: ASCII with LaTeX codes
* latin1:: ASCII extended by Latin Alphabet 1
* texte:: ASCII with easy French conventions

ASCII 7-bits, BS to overstrike

* Commented ASCII::
* Octal ASCII::
* Decimal ASCII::
* Hexadecimal ASCII::

ASCII "bang bang", escapes are ! and !!

* Display Code:: Control Data's Display Code

ASCII extended by Latin Alphabet 1

* Commented Latin-1::
* Octal Latin-1::
* Decimal Latin-1::
* Hexadecimal Latin-1::

Easy French conventions

* French quotes:: How to type them.
* Latin ligatures:: They are not representable.
* Diacritics:: How to type them, things to know.
* Ending diaeresis:: List of words ending with diaeresis.
* Easy French History:: When, How and Who.

Internal aspects

* Main flow:: Overall organization of the program.
* Piping:: Distinction between internal or external piping.
* Limitations:: A few limitations of the choosen implementation.
* New charsets:: How to proceed in adding new charsets.


File: recode.info, Node: Usage, Next: Charsets, Prev: Top, Up: Top

How to use this program
=======================

The general format of the program call is:

recode [OPTION]... [BEFORE]:[AFTER] [FILE]...

Each file FILE will be read assuming it is coded with charset
BEFORE, it will be recoded over itself so to use the charset AFTER. If
there is no such FILE, the program rather acts as a filter and recode
standard input to standard output.

The available options are:

`-C'
Given this option, all other parameters and options are ignored.
The program prints briefly the Copyright and copying conditions.
See the file `COPYING' in the distribution for full statement of
the Copyright and copying conditions.

`-c'
With Easy French conventions, use the column `:' instead of the
double-quote `"' for marking diaeresis. See: *Note Easy French::.

`-f'
This option is recognized, but otherwise ignored. Eventually, this
option will be necessary for a file to be replaced by its recoded
contents, if it is found that the recoding is not fully
reversible. In this version, the replacement is unconditionnaly
done.

`-i'
When the recoding requires a combination of two or more elementary
recoding steps, this option forces many passes over the data, using
intermediate files between passes. This is the default behaviour
when files are recoded over themselves. If this option is
selected in filter mode, that is, when the program reads standard
input and writes standard output, it might take longer for
programs further down the pipe chain to start receiving some
recoded data.

`-o'
When the recoding requires a combination of two or more elementary
recoding steps, this option forces the creation of a chain of
program instances initiated through the `popen(3)' library call,
all operating in parallel. In filter mode, at cost of some
overhead, recoded data will be available soon after the program
starts, even if many elementary recoding steps are required.

If, at installation time, the `popen(3)' call is said to be
unavailable, selecting option `-o' is equivalent to selecting
option `-i'.

`-p'
When the recoding requires a combination of two or more elementary
recoding steps, this option forces the program to fork itself into
a few copies interconnected with pipes, using the `pipe(2)' system
call. All copies of the program operate in parallel. This method
is similar to the method used through option `-o', but is slightly
more efficient. This is the default behaviour in filter mode. If
this option is used when files are recoded over themselves, this
should save some disk accesses and some disk space, at cost of
more system overhead.

If, at installation time, the `pipe(2)' call is said to be
unavailable, selecting option `-p' is equivalent to selecting
option `-o'. If both `pipe(2)' and `popen(3)' are unavailable,
selecting option `-p' is equivalent to selecting option `-i'.

`-t'
The *touch* option is meaningful only when files are recoded over
themselves. Without it, the timestamps associated with files are
preserved, to reflect the fact that changing the code of a file
does not really alter its informational contents. When the user
wants the recoded files to be timestamped at the recoding time;
this option inhibits the automatic protection of the timestamps.

`-v'
Before proceeding, the program will print on `stderr' the list and
order of application of elementary conversions which are planned
to achieve the global conversion. Then, the program will print on
`stderr' one message per FILE recoded, so to let the user informed
of the progress of its command.

One or both of the BEFORE or AFTER keywords may be omitted, but the
colon which separates them cannot. An omitted keyword implies the
usual or default code in usage on the system where this program is
installed. Usually, this default code is `latin1' for UNIX systems or
`ibmpc' for MS-DOS machines, but it might be changed to any other
supported code when this program is installed.


File: recode.info, Node: Charsets, Next: Easy French, Prev: Usage, Up: Top

Character sets recognized of produced
=====================================

The possible values for charset BEFORE or charset AFTER are provided
as the keys in the following menu.

* Menu:

* applemac:: ASCII 8-bits for Apple's Macintosh
* ascii:: ASCII 7-bits, BS to overstrike
* bangbang:: ASCII "bang bang", escapes are ! and !!
* cccascii:: ASCII 8-bits as seen by Perkin Elmer
* cdcascii:: ASCII 8-bits a seen by Control Data
* cdcnos:: ASCII 6/12 from NOS, escapes are ^ and @
* ebcdic:: EBCDIC with no further comments
* flat:: ASCII without diacritics nor underline
* ibmpc:: ASCII 8-bits for IBM's PC
* iconqnx:: ASCII as coded on Unisys' ICON
* latex:: ASCII with LaTeX codes
* latin1:: ASCII extended by Latin Alphabet 1
* texte:: ASCII with easy French conventions


File: recode.info, Node: applemac, Next: ascii, Prev: Charsets, Up: Charsets

ASCII 8-bits for Apple's Macintosh
----------------------------------

The file has been obtained or is aimed to a Macintosh micro-computer
from Apple. This is an eight bit code. The file is the data fork only.


File: recode.info, Node: ascii, Next: bangbang, Prev: applemac, Up: Charsets

ASCII 7-bits, BS to overstrike
------------------------------

The file is straight ASCII, seven bits only. According to the
definition of ASCII: diacritics are applied by a sequence of three
characters: the letter, one BS, the diacritic mark. We deviate
slightly from this by exchanging the diacritic mark and the letter so,
on a screen device, the diacritic will disappear and let the letter
alone. At recognition time, both methods are acceptable.

The French quotes are coded by the sequences: `< BS "' or `" BS <'
for the opening quote and `> BS "' or `" BS >' for the closing quote.
This artifical convention was inherited in straight `ascii' from habits
around `bangbang' entry, and is not well known. But we decided to
stick to it so that `ascii' charset will not loose French quotes.

* Menu:

* Commented ASCII::
* Octal ASCII::
* Decimal ASCII::
* Hexadecimal ASCII::


File: recode.info, Node: Commented ASCII, Next: Octal ASCII, Prev: ascii, Up: ascii

Commented ASCII
...............

oct dec hex name description

000 0 0 nul null character
001 1 1 soh start of header
002 2 2 stx start of text
003 3 3 etx end of text
004 4 4 eot end of transmission
005 5 5 enq enquiry
006 6 6 ack acknowledge
007 7 7 bel bell
010 8 8 bs back space
011 9 9 ht horizontal tab
012 10 a nl new line
013 11 b vt vertical tab
014 12 c np new page
015 13 d cr carriage return
016 14 e so shift out
017 15 f si shift in
020 16 10 dle data link escape
021 17 11 dc1 device control 1
022 18 12 dc2 device control 2
023 19 13 dc3 device control 3
024 20 14 dc4 device control 4
025 21 15 nak negative acknowledge
026 22 16 syn synchronize
027 23 17 etb end of transmitted block
030 24 18 can cancel
031 25 19 em end of medium
032 26 1a sub substitute
033 27 1b esc escape
034 28 1c fs file separator
035 29 1d gs group separator
036 30 1e rs record separator
037 31 1f us unit separator
040 32 20 sp space

177 127 7f del delete


File: recode.info, Node: Octal ASCII, Next: Decimal ASCII, Prev: Commented ASCII, Up: ascii

Octal ASCII
...........

000 nul 020 dle 040 sp 060 0 100 @ 120 P 140 ` 160 p
001 soh 021 dc1 041 ! 061 1 101 A 121 Q 141 a 161 q
002 stx 022 dc2 042 " 062 2 102 B 122 R 142 b 162 r
003 etx 023 dc3 043 # 063 3 103 C 123 S 143 c 163 s
004 eot 024 dc4 044 $ 064 4 104 D 124 T 144 d 164 t
005 enq 025 nak 045 % 065 5 105 E 125 U 145 e 165 u
006 ack 026 syn 046 & 066 6 106 F 126 V 146 f 166 v
007 bel 027 etb 047 ' 067 7 107 G 127 W 147 g 167 w
010 bs 030 can 050 ( 070 8 110 H 130 X 150 h 170 x
011 ht 031 em 051 ) 071 9 111 I 131 Y 151 i 171 y
012 nl 032 sub 052 * 072 : 112 J 132 Z 152 j 172 z
013 vt 033 esc 053 + 073 ; 113 K 133 [ 153 k 173 {
014 np 034 fs 054 , 074 < 114 L 134 \ 154 l 174 |
015 cr 035 gs 055 - 075 = 115 M 135 ] 155 m 175 }
016 so 036 rs 056 . 076 > 116 N 136 ^ 156 n 176 ~
017 si 037 us 057 / 077 ? 117 O 137 _ 157 o 177 del


File: recode.info, Node: Decimal ASCII, Next: Hexadecimal ASCII, Prev: Octal ASCII, Up: ascii

Decimal ASCII
.............

0 nul 16 dle 32 sp 48 0 64 @ 80 P 96 ` 112 p
1 soh 17 dc1 33 ! 49 1 65 A 81 Q 97 a 113 q
2 stx 18 dc2 34 " 50 2 66 B 82 R 98 b 114 r
3 etx 19 dc3 35 # 51 3 67 C 83 S 99 c 115 s
4 eot 20 dc4 36 $ 52 4 68 D 84 T 100 d 116 t
5 enq 21 nak 37 % 53 5 69 E 85 U 101 e 117 u
6 ack 22 syn 38 & 54 6 70 F 86 V 102 f 118 v
7 bel 23 etb 39 ' 55 7 71 G 87 W 103 g 119 w
8 bs 24 can 40 ( 56 8 72 H 88 X 104 h 120 x
9 ht 25 em 41 ) 57 9 73 I 89 Y 105 i 121 y
10 nl 26 sub 42 * 58 : 74 J 90 Z 106 j 122 z
11 vt 27 esc 43 + 59 ; 75 K 91 [ 107 k 123 {
12 np 28 fs 44 , 60 < 76 L 92 \ 108 l 124 |
13 cr 29 gs 45 - 61 = 77 M 93 ] 109 m 125 }
14 so 30 rs 46 . 62 > 78 N 94 ^ 110 n 126 ~
15 si 31 us 47 / 63 ? 79 O 95 _ 111 o 127 del


File: recode.info, Node: Hexadecimal ASCII, Prev: Decimal ASCII, Up: ascii

Hexadecimal ASCII
.................

00 nul 10 dle 20 sp 30 0 40 @ 50 P 60 ` 70 p
01 soh 11 dc1 21 ! 31 1 41 A 51 Q 61 a 71 q
02 stx 12 dc2 22 " 32 2 42 B 52 R 62 b 72 r
03 etx 13 dc3 23 # 33 3 43 C 53 S 63 c 73 s
04 eot 14 dc4 24 $ 34 4 44 D 54 T 64 d 74 t
05 enq 15 nak 25 % 35 5 45 E 55 U 65 e 75 u
06 ack 16 syn 26 & 36 6 46 F 56 V 66 f 76 v
07 bel 17 etb 27 ' 37 7 47 G 57 W 67 g 77 w
08 bs 18 can 28 ( 38 8 48 H 58 X 68 h 78 x
09 ht 19 em 29 ) 39 9 49 I 59 Y 69 i 79 y
0a nl 1a sub 2a * 3a : 4a J 5a Z 6a j 7a z
0b vt 1b esc 2b + 3b ; 4b K 5b [ 6b k 7b {
0c np 1c fs 2c , 3c < 4c L 5c \ 6c l 7c |
0d cr 1d gs 2d - 3d = 4d M 5d ] 6d m 7d }
0e so 1e rs 2e . 3e > 4e N 5e ^ 6e n 7e ~
0f si 1f us 2f / 3f ? 4f O 5f _ 6f o 7f del


File: recode.info, Node: bangbang, Next: cccascii, Prev: ascii, Up: Charsets

ASCII "bang bang", escapes are ! and !!
---------------------------------------

This is the local code in use on Cybers at Universite de Montreal,
which grave and serious people there prefer to name "ASCII code
display". This code is also known as "Bang-bang". It is based on a six
bits character set in which capitals, French diacritics and a few
others are coded using an `!' escape followed by a single character,
and control characters using a double `!' escape followed by a single
character.

The routines given here presume that the six bits code is already
expressed in ASCII by the communication channel, with embedded ASCII `!'
escapes.

Here is a table showing which characters are being used to encode
each ASCII character.

000 !!@ 020 !!P 040 060 0 100 @ 120 !P 140 !@ 160 P
001 !!A 021 !!Q 041 !" 061 1 101 !A 121 !Q 141 A 161 Q
002 !!B 022 !!R 042 " 062 2 102 !B 122 !R 142 B 162 R
003 !!C 023 !!S 043 # 063 3 103 !C 123 !S 143 C 163 S
004 !!D 024 !!T 044 $ 064 4 104 !D 124 !T 144 D 164 T
005 !!E 025 !!U 045 % 065 5 105 !E 125 !U 145 E 165 U
006 !!F 026 !!V 046 & 066 6 106 !F 126 !V 146 F 166 V
007 !!G 027 !!W 047 ' 067 7 107 !G 127 !W 147 G 167 W
010 !!H 030 !!X 050 ( 070 8 110 !H 130 !X 150 H 170 X
011 !!I 031 !!Y 051 ) 071 9 111 !I 131 !Y 151 I 171 Y
012 !!J 032 !!Z 052 * 072 : 112 !J 132 !Z 152 J 172 Z
013 !!K 033 !![ 053 + 073 ; 113 !K 133 [ 153 K 173 ![
014 !!L 034 !!\ 054 , 074 < 114 !L 134 \ 154 L 174 !\
015 !!M 035 !!] 055 - 075 = 115 !M 135 ] 155 M 175 !]
016 !!N 036 !!^ 056 . 076 > 116 !N 136 ^ 156 N 176 !^
017 !!O 037 !!_ 057 / 077 ? 117 !O 137 _ 157 O 177 !_

* Menu:

* Display Code:: Control Data's Display Code


File: recode.info, Node: Display Code, Prev: bangbang, Up: bangbang

Control Data's Display Code
...........................

Octal display code to graphic Octal display code to octal ASCII

00 : 20 P 40 5 60 # 00 072 20 120 40 065 60 043
01 A 21 Q 41 6 61 [ 01 101 21 121 41 066 61 133
02 B 22 R 42 7 62 ] 02 102 22 122 42 067 62 135
03 C 23 S 43 8 63 % 03 103 23 123 43 070 63 045
04 D 24 T 44 9 64 " 04 104 24 124 44 071 64 042
05 E 25 U 45 + 65 _ 05 105 25 125 45 053 65 137
06 F 26 V 46 - 66 ! 06 106 26 126 46 055 66 041
07 G 27 W 47 * 67 & 07 107 27 127 47 052 67 046
10 H 30 X 50 / 70 ' 10 110 30 130 50 057 70 047
11 I 31 Y 51 ( 71 ? 11 111 31 131 51 050 71 077
12 J 32 Z 52 ) 72 < 12 112 32 132 52 051 72 074
13 K 33 0 53 $ 73 > 13 113 33 060 53 044 73 076
14 L 34 1 54 = 74 @ 14 114 34 061 54 075 74 100
15 M 35 2 55 75 \ 15 115 35 062 55 040 75 134
16 N 36 3 56 , 76 ^ 16 116 36 063 56 054 76 136
17 O 37 4 57 . 77 ; 17 117 37 064 57 056 77 073


File: recode.info, Node: cccascii, Next: cdcascii, Prev: bangbang, Up: Charsets

ASCII 8-bits as seen by Perkin Elmer
------------------------------------

This charset represents the way Concurrent Computer Corporation
(formerly Perkin Elmer) expresses EBCDIC using ASCII.


File: recode.info, Node: cdcascii, Next: cdcnos, Prev: cccascii, Up: Charsets

ASCII 8-bits a seen by Control Data
-----------------------------------

This charset represents the way Control Data Corporation relates
EBCDIC to ASCII. We also select the lower half of this table to do
straigth ASCII to EBCDIC conversions, back and forth.


File: recode.info, Node: cdcnos, Next: ebcdic, Prev: cdcascii, Up: Charsets

ASCII 6/12 from NOS, escapes are ^ and @
----------------------------------------

This is one of the charset in use on CDC Cyber NOS systems to
represent ASCII, sometimes named "NOS 6/12" code for coding ASCII.
This code is also known as "caret ASCII". It is based on a six bits
character set in which small letters and control characters are coded
using a `^' escape and, sometimes, a `@' escape.

The routines given here presume that the six bits code is already
expressed in ASCII by the communication channel, with embedded ASCII
`^' and `@' escapes.

Here is a table showing which characters are being used to encode
each ASCII character.

000 ^5 020 ^# 040 060 0 100 @A 120 P 140 @G 160 ^P
001 ^6 021 ^[ 041 ! 061 1 101 A 121 Q 141 ^A 161 ^Q
002 ^7 022 ^] 042 " 062 2 102 B 122 R 142 ^B 162 ^R
003 ^8 023 ^% 043 # 063 3 103 C 123 S 143 ^C 163 ^S
004 ^9 024 ^" 044 $ 064 4 104 D 124 T 144 ^D 164 ^T
005 ^+ 025 ^_ 045 % 065 5 105 E 125 U 145 ^E 165 ^U
006 ^- 026 ^! 046 & 066 6 106 F 126 V 146 ^F 166 ^V
007 ^* 027 ^& 047 ' 067 7 107 G 127 W 147 ^G 167 ^W
010 ^/ 030 ^' 050 ( 070 8 110 H 130 X 150 ^H 170 ^X
011 ^( 031 ^? 051 ) 071 9 111 I 131 Y 151 ^I 171 ^Y
012 ^) 032 ^< 052 * 072 @D 112 J 132 Z 152 ^J 172 ^Z
013 ^$ 033 ^> 053 + 073 ; 113 K 133 [ 153 ^K 173 ^0
014 ^= 034 ^@ 054 , 074 < 114 L 134 \ 154 ^L 174 ^1
015 ^ 035 ^\ 055 - 075 = 115 M 135 ] 155 ^M 175 ^2
016 ^, 036 ^^ 056 . 076 > 116 N 136 @B 156 ^N 176 ^3
017 ^. 037 ^; 057 / 077 ? 117 O 137 _ 157 ^O 177 ^4


File: recode.info, Node: ebcdic, Next: flat, Prev: cdcnos, Up: Charsets

EBCDIC with no further comments
-------------------------------

This charset is the IBM's external binary coded decimal for
interchange coding. This is an eight bits code.


File: recode.info, Node: flat, Next: ibmpc, Prev: ebcdic, Up: Charsets

ASCII without diacritics nor underline
--------------------------------------

This code is ASCII expunged of all diacritics and underlines, as
long as they are applied using three character sequences, with BS in the
middle. Also, despite slightly unrelated, each control character is
represented by a sequence of two or three graphic characters. The
newline character, however, keeps its functionnality and is not
represented.

Note that charset `flat' is a terminal charset. We can convert *to*
`flat', but not *from* it.


File: recode.info, Node: ibmpc, Next: iconqnx, Prev: flat, Up: Charsets

ASCII 8-bits for IBM's PC
-------------------------

The file was obtained or is aimed towards a PC microcomputer from
IBM or any compatible. This is an eight-bit code.


File: recode.info, Node: iconqnx, Next: latex, Prev: ibmpc, Up: Charsets

ASCII for the Unisys' ICON
--------------------------

The file is using Unisys' ICON way to represent diacritics with 0x19
escape sequences. This is a seven-bit code, even if eight-bit codes
can flow through as part of IBM-PC charset.


File: recode.info, Node: latex, Next: latin1, Prev: iconqnx, Up: Charsets

ASCII with LaTeX codes
----------------------

This charset is an ASCII file coded to be read by LaTeX or, in
certain cases, by TeX.


File: recode.info, Node: latin1, Next: texte, Prev: latex, Up: Charsets

ASCII extended by Latin Alphabet 1
----------------------------------

This charset corresponds to the ISO Latin Alphabet 1. It is an
eight-bit code which coincides with ASCII for the lower half.

* Menu:

* Commented Latin-1::
* Octal Latin-1::
* Decimal Latin-1::
* Hexadecimal Latin-1::


File: recode.info, Node: Commented Latin-1, Next: Octal Latin-1, Prev: latin1, Up: latin1

Commented Latin-1
.................

oct dec hex description

240 160 a0 no-break space
241 161 a1 inverted exclamation mark
242 162 a2 cent sign
243 163 a3 pound sign
244 164 a4 currency sign
245 165 a5 yen sign
246 166 a6 broken bar
247 167 a7 paragraph sign, section sign
250 168 a8 diaeresis
251 169 a9 copyright sign
252 170 aa feminine ordinal indicator
253 171 ab left angle quotation mark
254 172 ac not sign
255 173 ad soft hyphen
256 174 ae registered trade mark sign
257 175 af macron
260 176 b0 degree sign
261 177 b1 plus-minus sign
262 178 b2 superscript two
263 179 b3 superscript three
264 180 b4 acute accent
265 181 b5 small greek mu, micro sign
266 182 b6 pilcrow sign
267 183 b7 middle dot
270 184 b8 cedilla
271 185 b9 superscript one
272 186 ba masculine ordinal indicator
273 187 bb right angle quotation mark
274 188 bc vulgar fraction one quarter
275 189 bd vulgar fraction one half
276 190 be vulgar fraction three quarters
277 191 bf inverted question mark
300 192 c0 capital A with grave accent
301 193 c1 capital A with acute accent
302 194 c2 capital A with circumflex accent
303 195 c3 capital A with tilde
304 196 c4 capital A diaeresis
305 197 c5 capital A with ring above
306 198 c6 capital diphthong A with E
307 199 c7 capital C with cedilla
310 200 c8 capital E with grave accent
311 201 c9 capital E with acute accent
312 202 ca capital E with circumflex accent
313 203 cb capital E with diaeresis
314 204 cc capital I with grave accent
315 205 cd capital I with acute accent
316 206 ce capital I with circumflex accent
317 207 cf capital I with diaeresis
320 208 d0 capital icelandic ETH
321 209 d1 capital N with tilde
322 210 d2 capital O with grave accent
323 211 d3 capital O with acute accent
324 212 d4 capital O with circumflex accent
325 213 d5 capital O with tilde
326 214 d6 capital O with diaeresis
327 215 d7 multiplication sign
330 216 d8 capital O with oblique stroke
331 217 d9 capital U with grave accent
332 218 da capital U with acute accent
333 219 db capital U with circumflex accent
334 220 dc capital U with diaeresis
335 221 dd capital Y with acute accent
336 222 de capital icelandic THORN
337 223 df small german sharp s
340 224 e0 small a with grave accent
341 225 e1 small a with acute accent
342 226 e2 small a with circumflex accent
343 227 e3 small a with tilde
344 228 e4 small a with diaeresis
345 229 e5 small a with ring above
346 230 e6 small diphthong a with e
347 231 e7 small c with cedilla
350 232 e8 small e with grave accent
351 233 e9 small e with acute accent
352 234 ea small e with circumflex accent
353 235 eb small e with diaeresis
354 236 ec small i with grave accent
355 237 ed small i with acute accent
356 238 ee small i with circumflex accent
357 239 ef small i with diaeresis
360 240 f0 small icelandic eth
361 241 f1 small n with tilde
362 242 f2 small o with grave accent
363 243 f3 small o with acute accent
364 244 f4 small o with circumflex accent
365 245 f5 small o with tilde
366 246 f6 small o with diaeresis
367 247 f7 division sign
370 248 f8 small o with oblique stroke
371 249 f9 small u with grave accent
372 250 fa small u with acute accent
373 251 fb small u with circumflex accent
374 252 fc small u with diaeresis
375 253 fd small y with acute accent
376 254 fe small icelandic thorn
377 255 ff small y with diaeresis


File: recode.info, Node: Octal Latin-1, Next: Decimal Latin-1, Prev: Commented Latin-1, Up: latin1

Octal Latin-1
.............

200 220 240 nsp 260 ++ 300 A` 320 DD 340 a` 360 dd
201 221 241 !! 261 +- 301 A' 321 N~ 341 a' 361 n~
202 222 242 c| 262 22 302 A^ 322 O` 342 a^ 362 o`
203 223 243 ## 263 33 303 A~ 323 O' 343 a~ 363 o'
204 224 244 cur 264 '' 304 A" 324 O^ 344 a" 364 o^
205 225 245 y- 265 uu 305 A+ 325 O~ 345 a+ 365 o~
206 226 246 || 266 pil 306 AE 326 O" 346 ae 366 o"
207 227 247 $$ 267 .. 307 C, 327 xx 347 c, 367 //
210 230 250 "" 270 ,, 310 E` 330 O/ 350 e` 370 o/
211 231 251 cO 271 11 311 E' 331 U` 351 e' 371 u`
212 232 252 a- 272 o- 312 E^ 332 U' 352 e^ 372 u'
213 233 253 << 273 >> 313 E" 333 U^ 353 e" 373 u^
214 234 254 -. 274 14 314 I` 334 U" 354 i` 374 u"
215 235 255 -- 275 12 315 I' 335 Y' 355 i' 375 y'
216 236 256 tO 276 34 316 I^ 336 PP 356 i^ 376 pp
217 237 257 mac 277 ?? 317 I" 337 ss 357 i" 377 y"


File: recode.info, Node: Decimal Latin-1, Next: Hexadecimal Latin-1, Prev: Octal Latin-1, Up: latin1

Decimal Latin-1
...............

128 144 160 nsp 176 ++ 192 A` 208 DD 224 a` 240 dd
129 145 161 !! 177 +- 193 A' 209 N~ 225 a' 241 n~
130 146 162 c| 178 22 194 A^ 210 O` 226 a^ 242 o`
131 147 163 ## 179 33 195 A~ 211 O' 227 a~ 243 o'
132 148 164 cur 180 '' 196 A" 212 O^ 228 a" 244 o^
133 149 165 y- 181 uu 197 A+ 213 O~ 229 a+ 245 o~
134 150 166 || 182 pil 198 AE 214 O" 230 ae 246 o"
135 151 167 $$ 183 .. 199 C, 215 xx 231 c, 247 //
136 152 168 "" 184 ,, 200 E` 216 O/ 232 e` 248 o/
137 153 169 cO 185 11 201 E' 217 U` 233 e' 249 u`
138 154 170 a- 186 o- 202 E^ 218 U' 234 e^ 250 u'
139 155 171 << 187 >> 203 E" 219 U^ 235 e" 251 u^
140 156 172 -. 188 14 204 I` 220 U" 236 i` 252 u"
141 157 173 -- 189 12 205 I' 221 Y' 237 i' 253 y'
142 158 174 tO 190 34 206 I^ 222 PP 238 i^ 254 pp
143 159 175 mac 191 ?? 207 I" 223 ss 239 i" 255 y"


File: recode.info, Node: Hexadecimal Latin-1, Prev: Decimal Latin-1, Up: latin1

Hexadecimal Latin-1
...................

80 90 a0 nsp b0 ++ c0 A` d0 DD e0 a` f0 dd
81 91 a1 !! b1 +- c1 A' d1 N~ e1 a' f1 n~
82 92 a2 c| b2 22 c2 A^ d2 O` e2 a^ f2 o`
83 93 a3 ## b3 33 c3 A~ d3 O' e3 a~ f3 o'
84 94 a4 cur b4 '' c4 A" d4 O^ e4 a" f4 o^
85 95 a5 y- b5 uu c5 A+ d5 O~ e5 a+ f5 o~
86 96 a6 || b6 pil c6 AE d6 O" e6 ae f6 o"
87 97 a7 $$ b7 .. c7 C, d7 xx e7 c, f7 //
88 98 a8 "" b8 ,, c8 E` d8 O/ e8 e` f8 o/
89 99 a9 cO b9 11 c9 E' d9 U` e9 e' f9 u`
8a 9a aa a- ba o- ca E^ da U' ea e^ fa u'
8b 9b ab << bb >> cb E" db U^ eb e" fb u^
8c 9c ac -. bc 14 cc I` dc U" ec i` fc u"
8d 9d ad -- bd 12 cd I' dd Y' ed i' fd y'
8e 9e ae tO be 34 ce I^ de PP ee i^ fe pp
8f 9f af mac bf ?? cf I" df ss ef i" ff y"


File: recode.info, Node: texte, Prev: latin1, Up: Charsets

ASCII with easy French conventions
----------------------------------

This charset is identical to `ascii', save for French diacritics
which are noted using a slightly different convention.

See *Note Easy French:: for more details.


File: recode.info, Node: Easy French, Next: Internals, Prev: Charsets, Up: Top

Easy French conventions
=======================

These conventions are used in `texte' and `latexte' charsets, which
are seven bits codes. At text entry time, these conventions provide a
little speed up. At read time, they slightly improve the readability.
Of course, it would better to have a specialized keyboard to make
direct eight bits entries and fonts for immediately displaying eight
bit ISO Latin-1 characters. But not everybody is so fortunate. In
several mailing environment, the eight bit is often willfully destroyed
(an horrible Crime that most people do not care to straighten up).

See:

* Menu:

* French quotes:: How to type them.
* Latin ligatures:: They are not representable.
* Diacritics:: How to type them, things to know.
* Ending diaeresis:: List of words ending with diaeresis.
* Easy French History:: When, How and Who.


File: recode.info, Node: French quotes, Next: Latin ligatures, Prev: Easy French, Up: Easy French

French quotes
-------------

French quotes (sometimes called "angle quotes") are noted the same
way English quotes are noted in TeX, *id est* by ```' and `'''.


File: recode.info, Node: Latin ligatures, Next: Diacritics, Prev: French quotes, Up: Easy French

Latin ligatures
---------------

No effort has been put to preserve Latin ligatures (`ae', `oe')
which are representable in several other charsets. So, these ligatures
may be lost through Easy French conventions.


File: recode.info, Node: Diacritics, Next: Ending diaeresis, Prev: Latin ligatures, Up: Easy French

Diacritics
----------

This is almost the French convention for simplified diacritics entry:

`e''
Acute accent

`e`'
Grave accent

`e^'
Circumflex accent

`e"'
Diaeresis

`c,'
Cedilla

In some countries, `:' is used instead of `"' to mark diaeresis.
`recode' support one convention on a single call, depending on the `-c'
option of the `recode' command.

The convention is prone to loosing information, because the diacritic
meaning overloads some characters that already have other uses. To
alleviate this, some knowledge of the French language is insufflated
into the recognition routines. So, the following subtleties are
systematically obeyed by the various recognizers.

* A single quote which follows a `e' does not necessarily means an
acute accent if it is followed by a single other one. For example:

`e''
will give an `e' with an acute accent.

`e'''
will give a simple `e', with a closing quotation mark.

`e''''
will give an `e' with an acute accent, followed by a closing
quotation mark.

There is a problem induced by this convention if there are English
citations with a French text. In sentences like:

There's a meeting at Archie's restaurant.

the single quotes will be mistaken twice for acute accents. So
English contractions and suffix possessives could be mangled.

* A double quote or colon, depending on `-c' option, which follows a
vowel is interpreted as diaeresis only if it is followd by another
letter. But there are in French several words that *end* with a
diaeresis, the program also recognizes them.

See *Note Ending diaeresis:: for a study of all the problematic
cases.

* A comma which follows a `c' is interpreted as a cedilla only if it
is followd by one of the vowels `a', `o' and `u'.


File: recode.info, Node: Ending diaeresis, Next: Easy French History, Prev: Diacritics, Up: Easy French

List of words ending with diaeresis
-----------------------------------

Here is a classification of all cases of a diaeresis at the end of a
French word:

* Words ending in "igue"

- Feminine words without a relative masculine:

besaigue" cigue"

- Feminine words with a relative masculine: (1)

aigue" ambigue" contigue" exigue" subaigue" suraigue"

* Words not ending in "igue"

- Ended by "i": (2)

ai" congai" goi" hai"kai" inoui" sai" samurai" thai" tokai"

- Ended by "e":

canoe"

- Ended by "u": (3)

Esau"

Notes:

1. There are supposed to be seven words in this case. So, one is
missing.

2. Look at the following sentence:

"Ai"e! Voici le proble`me que j'ai"

or, using the `-c' option:

Ai:e! Voici le proble`me que j'ai:

There is an ambiguity between an *ai"*, the small animal, and the
indicative future of *avoir* (first person singular), when
followed by what could be a diaeresis mark. Hopefully, the case
is solved by the fact that an apostrophe always precedes the verb
and almost never the animal.

3. I did not pay attention to proper nouns, but this one showed up as
being fairly evident.


Just to complete this topic, note that it would be wrong to make a
rule for all words ending in "igue" as needing a diaerisis. Here are
counter-examples:

becfigue be`sigue bigue bordigue bourdigue brigue contre-digue
digue d'intrigue fatigue figue garrigue gigue igue intrigue
ligue prodigue sarigue zigue


File: recode.info, Node: Easy French History, Prev: Ending diaeresis, Up: Easy French

When, How and Who.
------------------

Easy French has been in use in France for a while. Loic Dachary
first exposed me to this particular convention. I
only slightly adapted it (the diaeresis option) to make it more
comfortable to several usages in Que'bec originating from Universite' de
Montre'al.

In fact, the main problem for me was not to necessarily to invent
Easy French, but to recognize the "best" convention to use, (best is not
being defined, here) and to try to solve the main pithfalls associated
with the selected convention. I'm particularily grateful to Claude
Goutier <[email protected]> whom, through numerous discussions in
August 1988, was quite helpful in evaluating various hypothesis.


File: recode.info, Node: Internals, Next: Future, Prev: Easy French, Up: Top

Internal aspects
================

This information is organized in:

* Menu:

* Main flow:: Overall organization of the program.
* Piping:: Distinction between internal or external piping.
* Limitations:: A few limitations of the choosen implementation.
* New charsets:: How to proceed in adding new charsets.


File: recode.info, Node: Main flow, Next: Piping, Prev: Internals, Up: Internals

Overall organization
--------------------

The main driver has a table giving the conversion routines available
and for each, the starting charset and the ending charset. It then
tries to figure out the shortest sequence of conversions that will
transform the input charset into the final charset. Let us consider
these charsets as being the nodes of a directed graph. `recode' has
internally a few elementary recoding methods, called "single-step"s,
each of which may be considered as oriented arc from one node to the
other. A cost is attributed to each single-step. Given a starting
code and a goal code, `recode' computes the most economical route
through the elementary recodings.

The main part of `recode' is written in C, as are most single-steps.
A few single-steps which need to recognize sequences of multiple
characters are written in `lex'.


File: recode.info, Node: Piping, Next: Limitations, Prev: Main flow, Up: Internals

Internal vs external piping
---------------------------

Suppose that four elementary steps are selected at path optimization
time. Then `recode' will split itself into four different tasks
interconnected with pipes, logically equivalent to:

step1 output


File: recode.info, Node: Limitations, Next: New charsets, Prev: Piping, Up: Internals

Some limitations
----------------

Here are some limitations of the program.

* There is a limit (currently 10) on the number of steps allowed in
one single recodification work. It should stay sufficient for
quite a while, maybe for ever. This is a simple compilation
`#define', in any case.


File: recode.info, Node: New charsets, Prev: Limitations, Up: Internals

Adding new charsets
-------------------

It is fairly easy for a programmer to add a new charset to `recode'.
All it requires is making two routines, modifying a few tables, and
`make'ing `recode' again.

One of the routine should convert from any previous charset to the
new one. Any previous charset will do, but try to select it so you
will not loose too much information while converting. If you have to
read multiple bytes of the old charset before recognizing the character
to produce, you might write this routine in `lex'; otherwize, use C.
Prototype your routine after one of those which exists, so to keep the
sources uniform.

The other routine should convert from the new charset to any older
one. You do not have to select the same old charset than what you
selected for the previous routine. Select any charset for which you
will not loose too much information while converting. If the routine
has to read multiple bytes of the new charset before deciding which
character it will produce, you might write this routine in `lex';
otherwize, use C. Prototype your routine after one of those which
exists, so to keep the sources uniform.

Edit `Makefile' to add the object name of your two routines to the
`C_STEPS' or `L_STEPS' macro definition, depending on the fact your
routines is written in C or in `lex'. Then edit `steps.h' in the four
following places:

1. Create a symbol for your new charset in `enum TYPE_code'
definition.

2. Add the option name of your new charset in `code_keywords'
initialization.

3. Add two `extern' declarations for your routines at the appropriate
places.

4. Add two lines in `single_steps' array initialization to declare
your routines. For each line, include the four following fields:

1. The function name of your routine.

2. The starting code `enum' constant, that is, the code your
routine *reads*.

3. The goal code `enum' constant, that is, the code your routine
*produces*.

4. The cost of your routine, using the predefined constants
`STEP', `LOOSE', `EXACT', `SLOW' and `FAST'. See the comments
for the exact meaning of each of these and follow the
examples. Respect these meanings and be honest with the
costs!

In some circumstances, one of your routines would be a mere copy.
It is better in this case to not provide the routine, but still
declare it in `single_steps' using `NULL' as its function name and
`ALREADY' *alone* as its cost.


File: recode.info, Node: Future, Prev: Internals, Up: Top

Future things
=============

I will be glad to hear critics and suggestions, even for details.
This program is made up of hundreds of details, in fact. Write to
`[email protected]'.

Some notes and suggestions.

* Accept abbreviations for charsets on the command call. Accept more
than one conversion with intermediate filters in a single call.

* Support Universite de Montreal "accent" convention.

* Support `[nt]roff' diacritics.

* Support the Atari-ST internal code.

* Segregate charsets and usages.

* Is there some way of specifying that recode should not contract
something that looks like an accent? Like "There\'s a meeting at
Archie\'s restaurant"? (With corresponding insertion of
backslashes or whatevers when converting the other way, of course
- the transformation from accented to ascii should be exactly
invertable in all cases.) Of course, There\'s will not be
contracted.



Tag Table:
Node: Top850
Node: Usage4110
Node: Charsets8392
Node: applemac9422
Node: ascii9723
Node: Commented ASCII10698
Node: Octal ASCII12314
Node: Decimal ASCII13465
Node: Hexadecimal ASCII14542
Node: bangbang15575
Node: Display Code17531
Node: cccascii18896
Node: cdcascii19180
Node: cdcnos19529
Node: ebcdic21422
Node: flat21679
Node: ibmpc22291
Node: iconqnx22544
Node: latex22865
Node: latin123083
Node: Commented Latin-123457
Node: Octal Latin-127856
Node: Decimal Latin-129048
Node: Hexadecimal Latin-130246
Node: texte31334
Node: Easy French31640
Node: French quotes32607
Node: Latin ligatures32876
Node: Diacritics33198
Node: Ending diaeresis35198
Node: Easy French History36949
Node: Internals37782
Node: Main flow38219
Node: Piping39174
Node: Limitations39562
Node: New charsets39971
Node: Future42609

End Tag Table


  3 Responses to “Category : UNIX Files
Archive   : RECOD324.ZIP
Filename : RECOD324.TAR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/