annotate Doc/lib/libbinhex.tex @ 25838:8540887bcec6 2.2

Backport of 2.183: Fix memory leak in add_subclass() found by NealN with valgrind.
author Guido van Rossum <guido@python.org>
date Fri, 18 Oct 2002 13:42:21 +0000
parents fad071fb4141
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{binhex} ---
10251
d83935d14084 Shorten a few section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
2 Encode and decode binhex4 files}
d83935d14084 Shorten a few section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
4 \declaremodule{standard}{binhex}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
5 \modulesynopsis{Encode and decode files in binhex4 format.}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7875
diff changeset
6
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
7
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
8 This module encodes and decodes files in binhex4 format, a format
21062
bc02c3b09626 Clean up some markup cruft. A number of the macros that take no
Fred Drake <fdrake@acm.org>
parents: 15261
diff changeset
9 allowing representation of Macintosh files in \ASCII. On the Macintosh,
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
10 both forks of a file and the finder information are encoded (or
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
11 decoded), on other platforms only the data fork is handled.
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
12
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
13 The \module{binhex} module defines the following functions:
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
14
7712
0cbc9df882b6 Change "\," to just "," in function signatures. This is easier to maintain,
Fred Drake <fdrake@acm.org>
parents: 7390
diff changeset
15 \begin{funcdesc}{binhex}{input, output}
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
16 Convert a binary file with filename \var{input} to binhex file
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
17 \var{output}. The \var{output} parameter can either be a filename or a
10716
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
18 file-like object (any object supporting a \method{write()} and
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
19 \method{close()} method).
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
20 \end{funcdesc}
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
21
7712
0cbc9df882b6 Change "\," to just "," in function signatures. This is easier to maintain,
Fred Drake <fdrake@acm.org>
parents: 7390
diff changeset
22 \begin{funcdesc}{hexbin}{input\optional{, output}}
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
23 Decode a binhex file \var{input}. \var{input} may be a filename or a
10716
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
24 file-like object supporting \method{read()} and \method{close()} methods.
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
25 The resulting file is written to a file named \var{output}, unless the
10716
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
26 argument is omitted in which case the output filename is read from the
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
27 binhex file.
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
28 \end{funcdesc}
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
29
22549
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
30 The following exception is also defined:
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
31
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
32 \begin{excdesc}{Error}
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
33 Exception raised when something can't be encoded using the binhex
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
34 format (for example, a filename is too long to fit in the filename
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
35 field), or when input is not properly encoded binhex data.
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
36 \end{excdesc}
fad071fb4141 Added description of binhex.Error.
Fred Drake <fdrake@acm.org>
parents: 21062
diff changeset
37
10716
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
38
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
39 \begin{seealso}
15261
bc4f89eefb04 Make all the \seemodule explanations consistent: start with a capitalized
Fred Drake <fdrake@acm.org>
parents: 10716
diff changeset
40 \seemodule{binascii}{Support module containing \ASCII-to-binary
bc4f89eefb04 Make all the \seemodule explanations consistent: start with a capitalized
Fred Drake <fdrake@acm.org>
parents: 10716
diff changeset
41 and binary-to-\ASCII{} conversions.}
10716
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
42 \end{seealso}
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
43
baf66d6e1bc1 Fix some glaring markup consistency problems (presentation was
Fred Drake <fdrake@acm.org>
parents: 10251
diff changeset
44
10251
d83935d14084 Shorten a few section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
45 \subsection{Notes \label{binhex-notes}}
d83935d14084 Shorten a few section titles.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
46
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
47 There is an alternative, more powerful interface to the coder and
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
48 decoder, see the source for details.
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
49
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
50 If you code or decode textfiles on non-Macintosh platforms they will
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
51 still use the Macintosh newline convention (carriage-return as end of
7390
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
52 line).
223433038a47 Separate binhex and binuu documentation from binascii. Support better
Fred Drake <fdrake@acm.org>
parents:
diff changeset
53
7875
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
54 As of this writing, \function{hexbin()} appears to not work in all
8f425f8f4be2 Remove obsolete \setindexsubitem macros.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
55 cases.