Reuben Thomas [Tue, 23 Jan 2018 22:26:42 +0000 (22:26 +0000)]
Remove built-in applemac module
Resolve differences with RFC 1345 code. They were caused simply by extra
characters in the latter missing from the former (I compared the two tables
character by character, by eye).
Reuben Thomas [Mon, 22 Jan 2018 23:35:27 +0000 (23:35 +0000)]
Allow pipe filters to signal when they are interrupted again
Make the interrupted variable, previously static in main,
recode_interrupted, defined in task.c (hence in librecode), so that it can
now be tested at the end of a pipe recode.
Reuben Thomas [Mon, 22 Jan 2018 22:22:09 +0000 (22:22 +0000)]
Remove --sequence=files
Assume that any reasonable target OS has virtual memory (on which holding
the data in memory has much the same performance implications as using
files).
Reuben Thomas [Sat, 20 Jan 2018 00:01:53 +0000 (00:01 +0000)]
Overhaul error handling in transform steps (fixes Debian bug #215285)
Three main principles were applied:
1. Check all return codes (this fixes Debian bug #215285, data is lost when
no space left on device).
2. Ensure that resources are not leaked (memory and file descriptors).
3. Consistently use the recode error signalling mechanism: rather than
arbitrarily signalling failure on an I/O error, set error level
RECODE_SYSTEM_ERROR, and signal failure according to fail_level.
It proved to be useful to merge perform_{memory,pass}_sequence.
Reuben Thomas [Thu, 18 Jan 2018 00:36:48 +0000 (00:36 +0000)]
TODO: overhaul
Replace François’s email address with mine, remove things that are either
done or seem to refer to personal files of François, and the section on the
MS-DOS port (assumed defunct).
Reuben Thomas [Wed, 17 Jan 2018 22:43:10 +0000 (22:43 +0000)]
Try to diagnose untranslatable input when using iconv
See Debian bug #348909.
The problem starts with the fact that iconv returns EILSEQ (invalid input)
when in fact the input is merely untranslatable.
It is possible to diagnose this situation by running another conversion with
the output encoding the same as the input (so that it will always succeed on
valid input) at the same point. This is what we now do. Unfortunately,
there’s no way I can see to work out how much input to skip (i.e. the length
of the untranslatable character in the source encoding). Hence, we still
just skip one byte. The typical result is that invalid input is diagnosed on
the next step, resulting in the same problem as at present.
Two possible workarounds are to not use iconv, or to set abort_level to
RECODE_UNTRANSLATABLE (this is what test_2 in t80_error.py does).
Reuben Thomas [Wed, 17 Jan 2018 13:13:12 +0000 (13:13 +0000)]
base64.c: fix handling of EOF and LF (fixes Debian bug #271939)
LF can occur before the end of a full line (76 characters) if it’s
immediately followed by EOF.
The last line can be any number of quadruplets long; it need not be 76
characters. (I suspect this was an attempt to deal with LF without the extra
call to get_byte and goto.)
Reuben Thomas [Tue, 16 Jan 2018 10:37:48 +0000 (10:37 +0000)]
Recode.pyx: minor improvements
size_t is supported natively these days, so don’t make a dangerous guess as
to its value (in particular, should never hard-wire things determined in
config.h!).
Use libcpp’s bool instead of hand-defining a bool enum.
Use True for C true (will be automatically coerced).
Reuben Thomas [Tue, 16 Jan 2018 01:06:51 +0000 (01:06 +0000)]
varia.c: resolve various conflicts
Rather than compile-time macros for two different options:
1. Resolve the Kamenický encoding by referring to the Wikipedia version at
https://en.wikipedia.org/wiki/Kamenick%C3%BD_encoding
2. Allow the extra characters in the Cork encoding table.
Also fill in some missing Unicode code points, fixing some FIXMEs.
Reuben Thomas [Sun, 14 Jan 2018 13:03:21 +0000 (13:03 +0000)]
Neither cleaner.h nor recodext.h needs to be generated
So don’t generate them, and move cleaner.h into src; this fixes dependency
tracking, and prevents system headers from installations of librecode being
used erroneously.
Also remove defunct symbols from cleaner.h.
Also fix a wrong dependency: charname.lo depends on charname.h, not
rfc1345.h.