aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-08-29 03:23:14 +0000
committerChristian Grothoff <christian@grothoff.org>2008-08-29 03:23:14 +0000
commit48d5da0ba7a3561cd530e9ee71dafcd8e4416c29 (patch)
tree512d015f132b9e0c2abf43af983be48446d5f7a7
parent32202485b0e088eb28c21be21dba7fe80d7773ef (diff)
downloadlibmicrohttpd-48d5da0ba7a3561cd530e9ee71dafcd8e4416c29.tar.gz
libmicrohttpd-48d5da0ba7a3561cd530e9ee71dafcd8e4416c29.zip
chapters/
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/texinfo.tex2424
-rw-r--r--src/daemon/https/tls/gnutls_global.c8
-rw-r--r--src/daemon/https/tls/gnutls_x509.c449
-rw-r--r--src/daemon/https/tls/gnutls_x509.h1
-rw-r--r--src/daemon/https/x509/dn.c22
6 files changed, 2110 insertions, 796 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index b51e9847..dcb18539 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -3,5 +3,5 @@ EXTRA_DIST = $(man_MANS) Doxyfile
3 3
4DISTCLEANFILES = microhttpd.cps tutorial.cps 4DISTCLEANFILES = microhttpd.cps tutorial.cps
5info_TEXINFOS = microhttpd.texi tutorial.texi 5info_TEXINFOS = microhttpd.texi tutorial.texi
6microhttpd_TEXINFOS = lgpl.texi basicauthentication.inc bibliography.inc exploringrequests.inc fdl-1.2.texi hellobrowser.inc introduction.inc processingpost.inc responseheaders.inc 6microhttpd_TEXINFOS = lgpl.texi chapters/basicauthentication.inc chapters/bibliography.inc chapters/exploringrequests.inc fdl-1.2.texi chapters/hellobrowser.inc chapters/introduction.inc chapters/processingpost.inc chapters/responseheaders.inc
7 7
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index ff2c4065..d2b264dd 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,16 +3,16 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2005-07-05.19} 6\def\texinfoversion{2007-12-02.17}
7% 7%
8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 2007,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10% Foundation, Inc. 10% 2007 Free Software Foundation, Inc.
11% 11%
12% This texinfo.tex file is free software; you can redistribute it and/or 12% This texinfo.tex file is free software: you can redistribute it and/or
13% modify it under the terms of the GNU General Public License as 13% modify it under the terms of the GNU General Public License as
14% published by the Free Software Foundation; either version 2, or (at 14% published by the Free Software Foundation, either version 3 of the
15% your option) any later version. 15% License, or (at your option) any later version.
16% 16%
17% This texinfo.tex file is distributed in the hope that it will be 17% This texinfo.tex file is distributed in the hope that it will be
18% useful, but WITHOUT ANY WARRANTY; without even the implied warranty 18% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
@@ -20,9 +20,7 @@
20% General Public License for more details. 20% General Public License for more details.
21% 21%
22% You should have received a copy of the GNU General Public License 22% You should have received a copy of the GNU General Public License
23% along with this texinfo.tex file; see the file COPYING. If not, write 23% along with this program. If not, see <http://www.gnu.org/licenses/>.
24% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25% Boston, MA 02110-1301, USA.
26% 24%
27% As a special exception, when this file is read by TeX when processing 25% As a special exception, when this file is read by TeX when processing
28% a Texinfo source document, you may use the result without 26% a Texinfo source document, you may use the result without
@@ -67,7 +65,7 @@
67\everyjob{\message{[Texinfo version \texinfoversion]}% 65\everyjob{\message{[Texinfo version \texinfoversion]}%
68 \catcode`+=\active \catcode`\_=\active} 66 \catcode`+=\active \catcode`\_=\active}
69 67
70\message{Basics,} 68
71\chardef\other=12 69\chardef\other=12
72 70
73% We never want plain's \outer definition of \+ in Texinfo. 71% We never want plain's \outer definition of \+ in Texinfo.
@@ -153,28 +151,22 @@
153\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi 151\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
154\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi 152\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
155 153
156% In some macros, we cannot use the `\? notation---the left quote is 154% Since the category of space is not known, we have to be careful.
157% in some cases the escape char. 155\chardef\spacecat = 10
158\chardef\backChar = `\\ 156\def\spaceisspace{\catcode`\ =\spacecat}
157
158% sometimes characters are active, so we need control sequences.
159\chardef\colonChar = `\: 159\chardef\colonChar = `\:
160\chardef\commaChar = `\, 160\chardef\commaChar = `\,
161\chardef\dashChar = `\-
161\chardef\dotChar = `\. 162\chardef\dotChar = `\.
162\chardef\exclamChar= `\! 163\chardef\exclamChar= `\!
163\chardef\plusChar = `\+ 164\chardef\lquoteChar= `\`
164\chardef\questChar = `\? 165\chardef\questChar = `\?
166\chardef\rquoteChar= `\'
165\chardef\semiChar = `\; 167\chardef\semiChar = `\;
166\chardef\underChar = `\_ 168\chardef\underChar = `\_
167 169
168\chardef\spaceChar = `\ %
169\chardef\spacecat = 10
170\def\spaceisspace{\catcode\spaceChar=\spacecat}
171
172{% for help with debugging.
173 % example usage: \expandafter\show\activebackslash
174 \catcode`\! = 0 \catcode`\\ = \active
175 !global!def!activebackslash{\}
176}
177
178% Ignore a token. 170% Ignore a token.
179% 171%
180\def\gobble#1{} 172\def\gobble#1{}
@@ -285,6 +277,50 @@
285\newdimen\cornerthick \cornerthick=.3pt 277\newdimen\cornerthick \cornerthick=.3pt
286\newdimen\topandbottommargin \topandbottommargin=.75in 278\newdimen\topandbottommargin \topandbottommargin=.75in
287 279
280% Output a mark which sets \thischapter, \thissection and \thiscolor.
281% We dump everything together because we only have one kind of mark.
282% This works because we only use \botmark / \topmark, not \firstmark.
283%
284% A mark contains a subexpression of the \ifcase ... \fi construct.
285% \get*marks macros below extract the needed part using \ifcase.
286%
287% Another complication is to let the user choose whether \thischapter
288% (\thissection) refers to the chapter (section) in effect at the top
289% of a page, or that at the bottom of a page. The solution is
290% described on page 260 of The TeXbook. It involves outputting two
291% marks for the sectioning macros, one before the section break, and
292% one after. I won't pretend I can describe this better than DEK...
293\def\domark{%
294 \toks0=\expandafter{\lastchapterdefs}%
295 \toks2=\expandafter{\lastsectiondefs}%
296 \toks4=\expandafter{\prevchapterdefs}%
297 \toks6=\expandafter{\prevsectiondefs}%
298 \toks8=\expandafter{\lastcolordefs}%
299 \mark{%
300 \the\toks0 \the\toks2
301 \noexpand\or \the\toks4 \the\toks6
302 \noexpand\else \the\toks8
303 }%
304}
305% \topmark doesn't work for the very first chapter (after the title
306% page or the contents), so we use \firstmark there -- this gets us
307% the mark with the chapter defs, unless the user sneaks in, e.g.,
308% @setcolor (or @url, or @link, etc.) between @contents and the very
309% first @chapter.
310\def\gettopheadingmarks{%
311 \ifcase0\topmark\fi
312 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
313}
314\def\getbottomheadingmarks{\ifcase1\botmark\fi}
315\def\getcolormarks{\ifcase2\topmark\fi}
316
317% Avoid "undefined control sequence" errors.
318\def\lastchapterdefs{}
319\def\lastsectiondefs{}
320\def\prevchapterdefs{}
321\def\prevsectiondefs{}
322\def\lastcolordefs{}
323
288% Main output routine. 324% Main output routine.
289\chardef\PAGE = 255 325\chardef\PAGE = 255
290\output = {\onepageout{\pagecontents\PAGE}} 326\output = {\onepageout{\pagecontents\PAGE}}
@@ -302,7 +338,9 @@
302 % 338 %
303 % Do this outside of the \shipout so @code etc. will be expanded in 339 % Do this outside of the \shipout so @code etc. will be expanded in
304 % the headline as they should be, not taken literally (outputting ''code). 340 % the headline as they should be, not taken literally (outputting ''code).
341 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
305 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% 342 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
343 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
306 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% 344 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
307 % 345 %
308 {% 346 {%
@@ -311,6 +349,13 @@
311 % before the \shipout runs. 349 % before the \shipout runs.
312 % 350 %
313 \indexdummies % don't expand commands in the output. 351 \indexdummies % don't expand commands in the output.
352 \normalturnoffactive % \ in index entries must not stay \, e.g., if
353 % the page break happens to be in the middle of an example.
354 % We don't want .vr (or whatever) entries like this:
355 % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
356 % "\acronym" won't work when it's read back in;
357 % it needs to be
358 % {\code {{\tt \backslashcurfont }acronym}
314 \shipout\vbox{% 359 \shipout\vbox{%
315 % Do this early so pdf references go to the beginning of the page. 360 % Do this early so pdf references go to the beginning of the page.
316 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi 361 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
@@ -338,9 +383,9 @@
338 \pagebody{#1}% 383 \pagebody{#1}%
339 \ifdim\ht\footlinebox > 0pt 384 \ifdim\ht\footlinebox > 0pt
340 % Only leave this space if the footline is nonempty. 385 % Only leave this space if the footline is nonempty.
341 % (We lessened \vsize for it in \oddfootingxxx.) 386 % (We lessened \vsize for it in \oddfootingyyy.)
342 % The \baselineskip=24pt in plain's \makefootline has no effect. 387 % The \baselineskip=24pt in plain's \makefootline has no effect.
343 \vskip 2\baselineskip 388 \vskip 24pt
344 \unvbox\footlinebox 389 \unvbox\footlinebox
345 \fi 390 \fi
346 % 391 %
@@ -374,7 +419,7 @@
374% marginal hacks, juha@viisa.uucp (Juha Takala) 419% marginal hacks, juha@viisa.uucp (Juha Takala)
375\ifvoid\margin\else % marginal info is present 420\ifvoid\margin\else % marginal info is present
376 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi 421 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
377\dimen@=\dp#1 \unvbox#1 422\dimen@=\dp#1\relax \unvbox#1\relax
378\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi 423\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
379\ifr@ggedbottom \kern-\dimen@ \vfil \fi} 424\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
380} 425}
@@ -396,7 +441,7 @@
396% 441%
397\def\parsearg{\parseargusing{}} 442\def\parsearg{\parseargusing{}}
398\def\parseargusing#1#2{% 443\def\parseargusing#1#2{%
399 \def\next{#2}% 444 \def\argtorun{#2}%
400 \begingroup 445 \begingroup
401 \obeylines 446 \obeylines
402 \spaceisspace 447 \spaceisspace
@@ -427,8 +472,7 @@
427\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% 472\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
428 \def\temp{#3}% 473 \def\temp{#3}%
429 \ifx\temp\empty 474 \ifx\temp\empty
430 % We cannot use \next here, as it holds the macro to run; 475 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
431 % thus we reuse \temp.
432 \let\temp\finishparsearg 476 \let\temp\finishparsearg
433 \else 477 \else
434 \let\temp\argcheckspaces 478 \let\temp\argcheckspaces
@@ -440,14 +484,14 @@
440% If a _delimited_ argument is enclosed in braces, they get stripped; so 484% If a _delimited_ argument is enclosed in braces, they get stripped; so
441% to get _exactly_ the rest of the line, we had to prevent such situation. 485% to get _exactly_ the rest of the line, we had to prevent such situation.
442% We prepended an \empty token at the very beginning and we expand it now, 486% We prepended an \empty token at the very beginning and we expand it now,
443% just before passing the control to \next. 487% just before passing the control to \argtorun.
444% (Similarily, we have to think about #3 of \argcheckspacesY above: it is 488% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
445% either the null string, or it ends with \^^M---thus there is no danger 489% either the null string, or it ends with \^^M---thus there is no danger
446% that a pair of braces would be stripped. 490% that a pair of braces would be stripped.
447% 491%
448% But first, we have to remove the trailing space token. 492% But first, we have to remove the trailing space token.
449% 493%
450\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}} 494\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
451 495
452% \parseargdef\foo{...} 496% \parseargdef\foo{...}
453% is roughly equivalent to 497% is roughly equivalent to
@@ -1051,9 +1095,9 @@ where each line of input produces a line of output.}
1051% _ active, and distinguish by seeing if the current family is \slfam, 1095% _ active, and distinguish by seeing if the current family is \slfam,
1052% which is what @var uses. 1096% which is what @var uses.
1053{ 1097{
1054 \catcode\underChar = \active 1098 \catcode`\_ = \active
1055 \gdef\mathunderscore{% 1099 \gdef\mathunderscore{%
1056 \catcode\underChar=\active 1100 \catcode`\_=\active
1057 \def_{\ifnum\fam=\slfam \_\else\sb\fi}% 1101 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
1058 } 1102 }
1059} 1103}
@@ -1096,15 +1140,24 @@ where each line of input produces a line of output.}
1096\def\minus{$-$} 1140\def\minus{$-$}
1097 1141
1098% @dots{} outputs an ellipsis using the current font. 1142% @dots{} outputs an ellipsis using the current font.
1099% We do .5em per period so that it has the same spacing in a typewriter 1143% We do .5em per period so that it has the same spacing in the cm
1100% font as three actual period characters. 1144% typewriter fonts as three actual period characters; on the other hand,
1145% in other typewriter fonts three periods are wider than 1.5em. So do
1146% whichever is larger.
1101% 1147%
1102\def\dots{% 1148\def\dots{%
1103 \leavevmode 1149 \leavevmode
1104 \hbox to 1.5em{% 1150 \setbox0=\hbox{...}% get width of three periods
1105 \hskip 0pt plus 0.25fil 1151 \ifdim\wd0 > 1.5em
1106 .\hfil.\hfil.% 1152 \dimen0 = \wd0
1107 \hskip 0pt plus 0.5fil 1153 \else
1154 \dimen0 = 1.5em
1155 \fi
1156 \hbox to \dimen0{%
1157 \hskip 0pt plus.25fil
1158 .\hskip 0pt plus1fil
1159 .\hskip 0pt plus1fil
1160 .\hskip 0pt plus.5fil
1108 }% 1161 }%
1109} 1162}
1110 1163
@@ -1197,28 +1250,28 @@ where each line of input produces a line of output.}
1197 \fi 1250 \fi
1198\fi 1251\fi
1199 1252
1200% PDF uses PostScript string constants for the names of xref targets, to 1253% PDF uses PostScript string constants for the names of xref targets,
1201% for display in the outlines, and in other places. Thus, we have to 1254% for display in the outlines, and in other places. Thus, we have to
1202% double any backslashes. Otherwise, a name like "\node" will be 1255% double any backslashes. Otherwise, a name like "\node" will be
1203% interpreted as a newline (\n), followed by o, d, e. Not good. 1256% interpreted as a newline (\n), followed by o, d, e. Not good.
1204% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html 1257% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
1205% (and related messages, the final outcome is that it is up to the TeX 1258% (and related messages, the final outcome is that it is up to the TeX
1206% user to double the backslashes and otherwise make the string valid, so 1259% user to double the backslashes and otherwise make the string valid, so
1207% that's we do). 1260% that's what we do).
1208 1261
1209% double active backslashes. 1262% double active backslashes.
1210% 1263%
1211{\catcode`\@=0 \catcode`\\=\active 1264{\catcode`\@=0 \catcode`\\=\active
1212 @gdef@activebackslash{@catcode`@\=@active @otherbackslash}
1213 @gdef@activebackslashdouble{% 1265 @gdef@activebackslashdouble{%
1214 @catcode@backChar=@active 1266 @catcode`@\=@active
1215 @let\=@doublebackslash} 1267 @let\=@doublebackslash}
1216} 1268}
1217 1269
1218% To handle parens, we must adopt a different approach, since parens are 1270% To handle parens, we must adopt a different approach, since parens are
1219% not active characters. hyperref.dtx (which has the same problem as 1271% not active characters. hyperref.dtx (which has the same problem as
1220% us) handles it with this amazing macro to replace tokens. I've 1272% us) handles it with this amazing macro to replace tokens, with minor
1221% tinkered with it a little for texinfo, but it's definitely from there. 1273% changes for Texinfo. It is included here under the GPL by permission
1274% from the author, Heiko Oberdiek.
1222% 1275%
1223% #1 is the tokens to replace. 1276% #1 is the tokens to replace.
1224% #2 is the replacement. 1277% #2 is the replacement.
@@ -1243,21 +1296,87 @@ where each line of input produces a line of output.}
1243\def\backslashparens#1{% 1296\def\backslashparens#1{%
1244 \xdef#1{#1}% redefine it as its expansion; the definition is simply 1297 \xdef#1{#1}% redefine it as its expansion; the definition is simply
1245 % \lastnode when called from \setref -> \pdfmkdest. 1298 % \lastnode when called from \setref -> \pdfmkdest.
1246 \HyPsdSubst{(}{\backslashlparen}{#1}% 1299 \HyPsdSubst{(}{\realbackslash(}{#1}%
1247 \HyPsdSubst{)}{\backslashrparen}{#1}% 1300 \HyPsdSubst{)}{\realbackslash)}{#1}%
1248} 1301}
1249 1302
1250{\catcode\exclamChar = 0 \catcode\backChar = \other 1303\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1251 !gdef!backslashlparen{\(}% 1304with PDF output, and none of those formats could be found. (.eps cannot
1252 !gdef!backslashrparen{\)}% 1305be supported due to the design of the PDF format; use regular TeX (DVI
1253} 1306output) for that.)}
1254 1307
1255\ifpdf 1308\ifpdf
1256 \input pdfcolor 1309 %
1257 \pdfcatalog{/PageMode /UseOutlines}% 1310 % Color manipulation macros based on pdfcolor.tex.
1311 \def\cmykDarkRed{0.28 1 1 0.35}
1312 \def\cmykBlack{0 0 0 1}
1313 %
1314 \def\pdfsetcolor#1{\pdfliteral{#1 k}}
1315 % Set color, and create a mark which defines \thiscolor accordingly,
1316 % so that \makeheadline knows which color to restore.
1317 \def\setcolor#1{%
1318 \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
1319 \domark
1320 \pdfsetcolor{#1}%
1321 }
1322 %
1323 \def\maincolor{\cmykBlack}
1324 \pdfsetcolor{\maincolor}
1325 \edef\thiscolor{\maincolor}
1326 \def\lastcolordefs{}
1327 %
1328 \def\makefootline{%
1329 \baselineskip24pt
1330 \line{\pdfsetcolor{\maincolor}\the\footline}%
1331 }
1332 %
1333 \def\makeheadline{%
1334 \vbox to 0pt{%
1335 \vskip-22.5pt
1336 \line{%
1337 \vbox to8.5pt{}%
1338 % Extract \thiscolor definition from the marks.
1339 \getcolormarks
1340 % Typeset the headline with \maincolor, then restore the color.
1341 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1342 }%
1343 \vss
1344 }%
1345 \nointerlineskip
1346 }
1347 %
1348 %
1349 \pdfcatalog{/PageMode /UseOutlines}
1350 %
1351 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1258 \def\dopdfimage#1#2#3{% 1352 \def\dopdfimage#1#2#3{%
1259 \def\imagewidth{#2}% 1353 \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1260 \def\imageheight{#3}% 1354 \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1355 %
1356 % pdftex (and the PDF format) support .png, .jpg, .pdf (among
1357 % others). Let's try in that order.
1358 \let\pdfimgext=\empty
1359 \begingroup
1360 \openin 1 #1.png \ifeof 1
1361 \openin 1 #1.jpg \ifeof 1
1362 \openin 1 #1.jpeg \ifeof 1
1363 \openin 1 #1.JPG \ifeof 1
1364 \openin 1 #1.pdf \ifeof 1
1365 \errhelp = \nopdfimagehelp
1366 \errmessage{Could not find image file #1 for pdf}%
1367 \else \gdef\pdfimgext{pdf}%
1368 \fi
1369 \else \gdef\pdfimgext{JPG}%
1370 \fi
1371 \else \gdef\pdfimgext{jpeg}%
1372 \fi
1373 \else \gdef\pdfimgext{jpg}%
1374 \fi
1375 \else \gdef\pdfimgext{png}%
1376 \fi
1377 \closein 1
1378 \endgroup
1379 %
1261 % without \immediate, pdftex seg faults when the same image is 1380 % without \immediate, pdftex seg faults when the same image is
1262 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) 1381 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1263 \ifnum\pdftexversion < 14 1382 \ifnum\pdftexversion < 14
@@ -1265,31 +1384,38 @@ where each line of input produces a line of output.}
1265 \else 1384 \else
1266 \immediate\pdfximage 1385 \immediate\pdfximage
1267 \fi 1386 \fi
1268 \ifx\empty\imagewidth\else width \imagewidth \fi 1387 \ifdim \wd0 >0pt width \imagewidth \fi
1269 \ifx\empty\imageheight\else height \imageheight \fi 1388 \ifdim \wd2 >0pt height \imageheight \fi
1270 \ifnum\pdftexversion<13 1389 \ifnum\pdftexversion<13
1271 #1.pdf% 1390 #1.\pdfimgext
1272 \else 1391 \else
1273 {#1.pdf}% 1392 {#1.\pdfimgext}%
1274 \fi 1393 \fi
1275 \ifnum\pdftexversion < 14 \else 1394 \ifnum\pdftexversion < 14 \else
1276 \pdfrefximage \pdflastximage 1395 \pdfrefximage \pdflastximage
1277 \fi} 1396 \fi}
1397 %
1278 \def\pdfmkdest#1{{% 1398 \def\pdfmkdest#1{{%
1279 % We have to set dummies so commands such as @code, and characters 1399 % We have to set dummies so commands such as @code, and characters
1280 % such as \, aren't expanded when present in a section title. 1400 % such as \, aren't expanded when present in a section title.
1281 \atdummies 1401 \indexnofonts
1402 \turnoffactive
1282 \activebackslashdouble 1403 \activebackslashdouble
1404 \makevalueexpandable
1283 \def\pdfdestname{#1}% 1405 \def\pdfdestname{#1}%
1284 \backslashparens\pdfdestname 1406 \backslashparens\pdfdestname
1285 \pdfdest name{\pdfdestname} xyz% 1407 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1286 }}% 1408 }}
1287 % 1409 %
1288 % used to mark target names; must be expandable. 1410 % used to mark target names; must be expandable.
1289 \def\pdfmkpgn#1{#1}% 1411 \def\pdfmkpgn#1{#1}
1412 %
1413 % by default, use a color that is dark enough to print on paper as
1414 % nearly black, but still distinguishable for online viewing.
1415 \def\urlcolor{\cmykDarkRed}
1416 \def\linkcolor{\cmykDarkRed}
1417 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1290 % 1418 %
1291 \let\linkcolor = \Blue % was Cyan, but that seems light?
1292 \def\endlink{\Black\pdfendlink}
1293 % Adding outlines to PDF; macros for calculating structure of outlines 1419 % Adding outlines to PDF; macros for calculating structure of outlines
1294 % come from Petr Olsak 1420 % come from Petr Olsak
1295 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% 1421 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
@@ -1390,8 +1516,8 @@ where each line of input produces a line of output.}
1390 % now, I guess we'll just let the pdf reader have its way. 1516 % now, I guess we'll just let the pdf reader have its way.
1391 \indexnofonts 1517 \indexnofonts
1392 \setupdatafile 1518 \setupdatafile
1393 \activebackslash 1519 \catcode`\\=\active \otherbackslash
1394 \input \jobname.toc 1520 \input \tocreadfilename
1395 \endgroup 1521 \endgroup
1396 } 1522 }
1397 % 1523 %
@@ -1409,11 +1535,19 @@ where each line of input produces a line of output.}
1409 \else 1535 \else
1410 \let \startlink \pdfstartlink 1536 \let \startlink \pdfstartlink
1411 \fi 1537 \fi
1538 % make a live url in pdf output.
1412 \def\pdfurl#1{% 1539 \def\pdfurl#1{%
1413 \begingroup 1540 \begingroup
1414 \normalturnoffactive\def\@{@}% 1541 % it seems we really need yet another set of dummies; have not
1542 % tried to figure out what each command should do in the context
1543 % of @url. for now, just make @/ a no-op, that's the only one
1544 % people have actually reported a problem with.
1545 %
1546 \normalturnoffactive
1547 \def\@{@}%
1548 \let\/=\empty
1415 \makevalueexpandable 1549 \makevalueexpandable
1416 \leavevmode\Red 1550 \leavevmode\setcolor{\urlcolor}%
1417 \startlink attr{/Border [0 0 0]}% 1551 \startlink attr{/Border [0 0 0]}%
1418 user{/Subtype /Link /A << /S /URI /URI (#1) >>}% 1552 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1419 \endgroup} 1553 \endgroup}
@@ -1440,13 +1574,14 @@ where each line of input produces a line of output.}
1440 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} 1574 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1441 \def\pdflink#1{% 1575 \def\pdflink#1{%
1442 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} 1576 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1443 \linkcolor #1\endlink} 1577 \setcolor{\linkcolor}#1\endlink}
1444 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} 1578 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1445\else 1579\else
1446 \let\pdfmkdest = \gobble 1580 \let\pdfmkdest = \gobble
1447 \let\pdfurl = \gobble 1581 \let\pdfurl = \gobble
1448 \let\endlink = \relax 1582 \let\endlink = \relax
1449 \let\linkcolor = \relax 1583 \let\setcolor = \gobble
1584 \let\pdfsetcolor = \gobble
1450 \let\pdfmakeoutlines = \relax 1585 \let\pdfmakeoutlines = \relax
1451\fi % \ifx\pdfoutput 1586\fi % \ifx\pdfoutput
1452 1587
@@ -1481,6 +1616,7 @@ where each line of input produces a line of output.}
1481% We don't need math for this font style. 1616% We don't need math for this font style.
1482\def\ttsl{\setfontstyle{ttsl}} 1617\def\ttsl{\setfontstyle{ttsl}}
1483 1618
1619
1484% Default leading. 1620% Default leading.
1485\newdimen\textleading \textleading = 13.2pt 1621\newdimen\textleading \textleading = 13.2pt
1486 1622
@@ -1492,8 +1628,12 @@ where each line of input produces a line of output.}
1492\def\strutheightpercent{.70833} 1628\def\strutheightpercent{.70833}
1493\def\strutdepthpercent {.29167} 1629\def\strutdepthpercent {.29167}
1494% 1630%
1631% can get a sort of poor man's double spacing by redefining this.
1632\def\baselinefactor{1}
1633%
1495\def\setleading#1{% 1634\def\setleading#1{%
1496 \normalbaselineskip = #1\relax 1635 \dimen0 = #1\relax
1636 \normalbaselineskip = \baselinefactor\dimen0
1497 \normallineskip = \lineskipfactor\normalbaselineskip 1637 \normallineskip = \lineskipfactor\normalbaselineskip
1498 \normalbaselines 1638 \normalbaselines
1499 \setbox\strutbox =\hbox{% 1639 \setbox\strutbox =\hbox{%
@@ -1502,10 +1642,279 @@ where each line of input produces a line of output.}
1502 }% 1642 }%
1503} 1643}
1504 1644
1645% PDF CMaps. See also LaTeX's t1.cmap.
1646%
1647% do nothing with this by default.
1648\expandafter\let\csname cmapOT1\endcsname\gobble
1649\expandafter\let\csname cmapOT1IT\endcsname\gobble
1650\expandafter\let\csname cmapOT1TT\endcsname\gobble
1651
1652% if we are producing pdf, and we have \pdffontattr, then define cmaps.
1653% (\pdffontattr was introduced many years ago, but people still run
1654% older pdftex's; it's easy to conditionalize, so we do.)
1655\ifpdf \ifx\pdffontattr\undefined \else
1656 \begingroup
1657 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1658 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1659%%DocumentNeededResources: ProcSet (CIDInit)
1660%%IncludeResource: ProcSet (CIDInit)
1661%%BeginResource: CMap (TeX-OT1-0)
1662%%Title: (TeX-OT1-0 TeX OT1 0)
1663%%Version: 1.000
1664%%EndComments
1665/CIDInit /ProcSet findresource begin
166612 dict begin
1667begincmap
1668/CIDSystemInfo
1669<< /Registry (TeX)
1670/Ordering (OT1)
1671/Supplement 0
1672>> def
1673/CMapName /TeX-OT1-0 def
1674/CMapType 2 def
16751 begincodespacerange
1676<00> <7F>
1677endcodespacerange
16788 beginbfrange
1679<00> <01> <0393>
1680<09> <0A> <03A8>
1681<23> <26> <0023>
1682<28> <3B> <0028>
1683<3F> <5B> <003F>
1684<5D> <5E> <005D>
1685<61> <7A> <0061>
1686<7B> <7C> <2013>
1687endbfrange
168840 beginbfchar
1689<02> <0398>
1690<03> <039B>
1691<04> <039E>
1692<05> <03A0>
1693<06> <03A3>
1694<07> <03D2>
1695<08> <03A6>
1696<0B> <00660066>
1697<0C> <00660069>
1698<0D> <0066006C>
1699<0E> <006600660069>
1700<0F> <00660066006C>
1701<10> <0131>
1702<11> <0237>
1703<12> <0060>
1704<13> <00B4>
1705<14> <02C7>
1706<15> <02D8>
1707<16> <00AF>
1708<17> <02DA>
1709<18> <00B8>
1710<19> <00DF>
1711<1A> <00E6>
1712<1B> <0153>
1713<1C> <00F8>
1714<1D> <00C6>
1715<1E> <0152>
1716<1F> <00D8>
1717<21> <0021>
1718<22> <201D>
1719<27> <2019>
1720<3C> <00A1>
1721<3D> <003D>
1722<3E> <00BF>
1723<5C> <201C>
1724<5F> <02D9>
1725<60> <2018>
1726<7D> <02DD>
1727<7E> <007E>
1728<7F> <00A8>
1729endbfchar
1730endcmap
1731CMapName currentdict /CMap defineresource pop
1732end
1733end
1734%%EndResource
1735%%EOF
1736 }\endgroup
1737 \expandafter\edef\csname cmapOT1\endcsname#1{%
1738 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1739 }%
1740%
1741% \cmapOT1IT
1742 \begingroup
1743 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1744 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1745%%DocumentNeededResources: ProcSet (CIDInit)
1746%%IncludeResource: ProcSet (CIDInit)
1747%%BeginResource: CMap (TeX-OT1IT-0)
1748%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1749%%Version: 1.000
1750%%EndComments
1751/CIDInit /ProcSet findresource begin
175212 dict begin
1753begincmap
1754/CIDSystemInfo
1755<< /Registry (TeX)
1756/Ordering (OT1IT)
1757/Supplement 0
1758>> def
1759/CMapName /TeX-OT1IT-0 def
1760/CMapType 2 def
17611 begincodespacerange
1762<00> <7F>
1763endcodespacerange
17648 beginbfrange
1765<00> <01> <0393>
1766<09> <0A> <03A8>
1767<25> <26> <0025>
1768<28> <3B> <0028>
1769<3F> <5B> <003F>
1770<5D> <5E> <005D>
1771<61> <7A> <0061>
1772<7B> <7C> <2013>
1773endbfrange
177442 beginbfchar
1775<02> <0398>
1776<03> <039B>
1777<04> <039E>
1778<05> <03A0>
1779<06> <03A3>
1780<07> <03D2>
1781<08> <03A6>
1782<0B> <00660066>
1783<0C> <00660069>
1784<0D> <0066006C>
1785<0E> <006600660069>
1786<0F> <00660066006C>
1787<10> <0131>
1788<11> <0237>
1789<12> <0060>
1790<13> <00B4>
1791<14> <02C7>
1792<15> <02D8>
1793<16> <00AF>
1794<17> <02DA>
1795<18> <00B8>
1796<19> <00DF>
1797<1A> <00E6>
1798<1B> <0153>
1799<1C> <00F8>
1800<1D> <00C6>
1801<1E> <0152>
1802<1F> <00D8>
1803<21> <0021>
1804<22> <201D>
1805<23> <0023>
1806<24> <00A3>
1807<27> <2019>
1808<3C> <00A1>
1809<3D> <003D>
1810<3E> <00BF>
1811<5C> <201C>
1812<5F> <02D9>
1813<60> <2018>
1814<7D> <02DD>
1815<7E> <007E>
1816<7F> <00A8>
1817endbfchar
1818endcmap
1819CMapName currentdict /CMap defineresource pop
1820end
1821end
1822%%EndResource
1823%%EOF
1824 }\endgroup
1825 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
1826 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1827 }%
1828%
1829% \cmapOT1TT
1830 \begingroup
1831 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1832 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1833%%DocumentNeededResources: ProcSet (CIDInit)
1834%%IncludeResource: ProcSet (CIDInit)
1835%%BeginResource: CMap (TeX-OT1TT-0)
1836%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
1837%%Version: 1.000
1838%%EndComments
1839/CIDInit /ProcSet findresource begin
184012 dict begin
1841begincmap
1842/CIDSystemInfo
1843<< /Registry (TeX)
1844/Ordering (OT1TT)
1845/Supplement 0
1846>> def
1847/CMapName /TeX-OT1TT-0 def
1848/CMapType 2 def
18491 begincodespacerange
1850<00> <7F>
1851endcodespacerange
18525 beginbfrange
1853<00> <01> <0393>
1854<09> <0A> <03A8>
1855<21> <26> <0021>
1856<28> <5F> <0028>
1857<61> <7E> <0061>
1858endbfrange
185932 beginbfchar
1860<02> <0398>
1861<03> <039B>
1862<04> <039E>
1863<05> <03A0>
1864<06> <03A3>
1865<07> <03D2>
1866<08> <03A6>
1867<0B> <2191>
1868<0C> <2193>
1869<0D> <0027>
1870<0E> <00A1>
1871<0F> <00BF>
1872<10> <0131>
1873<11> <0237>
1874<12> <0060>
1875<13> <00B4>
1876<14> <02C7>
1877<15> <02D8>
1878<16> <00AF>
1879<17> <02DA>
1880<18> <00B8>
1881<19> <00DF>
1882<1A> <00E6>
1883<1B> <0153>
1884<1C> <00F8>
1885<1D> <00C6>
1886<1E> <0152>
1887<1F> <00D8>
1888<20> <2423>
1889<27> <2019>
1890<60> <2018>
1891<7F> <00A8>
1892endbfchar
1893endcmap
1894CMapName currentdict /CMap defineresource pop
1895end
1896end
1897%%EndResource
1898%%EOF
1899 }\endgroup
1900 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
1901 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1902 }%
1903\fi\fi
1904
1905
1505% Set the font macro #1 to the font named #2, adding on the 1906% Set the font macro #1 to the font named #2, adding on the
1506% specified font prefix (normally `cm'). 1907% specified font prefix (normally `cm').
1507% #3 is the font's design size, #4 is a scale factor 1908% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
1508\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} 1909% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
1910% empty to omit).
1911\def\setfont#1#2#3#4#5{%
1912 \font#1=\fontprefix#2#3 scaled #4
1913 \csname cmap#5\endcsname#1%
1914}
1915% This is what gets called when #5 of \setfont is empty.
1916\let\cmap\gobble
1917% emacs-page end of cmaps
1509 1918
1510% Use cm as the default font prefix. 1919% Use cm as the default font prefix.
1511% To specify the font prefix, you must define \fontprefix 1920% To specify the font prefix, you must define \fontprefix
@@ -1530,118 +1939,297 @@ where each line of input produces a line of output.}
1530\def\scshape{csc} 1939\def\scshape{csc}
1531\def\scbshape{csc} 1940\def\scbshape{csc}
1532 1941
1942% Definitions for a main text size of 11pt. This is the default in
1943% Texinfo.
1944%
1945\def\definetextfontsizexi{%
1533% Text fonts (11.2pt, magstep1). 1946% Text fonts (11.2pt, magstep1).
1534\def\textnominalsize{11pt} 1947\def\textnominalsize{11pt}
1535\edef\mainmagstep{\magstephalf} 1948\edef\mainmagstep{\magstephalf}
1536\setfont\textrm\rmshape{10}{\mainmagstep} 1949\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
1537\setfont\texttt\ttshape{10}{\mainmagstep} 1950\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
1538\setfont\textbf\bfshape{10}{\mainmagstep} 1951\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
1539\setfont\textit\itshape{10}{\mainmagstep} 1952\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
1540\setfont\textsl\slshape{10}{\mainmagstep} 1953\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
1541\setfont\textsf\sfshape{10}{\mainmagstep} 1954\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
1542\setfont\textsc\scshape{10}{\mainmagstep} 1955\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
1543\setfont\textttsl\ttslshape{10}{\mainmagstep} 1956\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
1544\font\texti=cmmi10 scaled \mainmagstep 1957\font\texti=cmmi10 scaled \mainmagstep
1545\font\textsy=cmsy10 scaled \mainmagstep 1958\font\textsy=cmsy10 scaled \mainmagstep
1959\def\textecsize{1095}
1546 1960
1547% A few fonts for @defun names and args. 1961% A few fonts for @defun names and args.
1548\setfont\defbf\bfshape{10}{\magstep1} 1962\setfont\defbf\bfshape{10}{\magstep1}{OT1}
1549\setfont\deftt\ttshape{10}{\magstep1} 1963\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
1550\setfont\defttsl\ttslshape{10}{\magstep1} 1964\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
1551\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} 1965\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
1552 1966
1553% Fonts for indices, footnotes, small examples (9pt). 1967% Fonts for indices, footnotes, small examples (9pt).
1554\def\smallnominalsize{9pt} 1968\def\smallnominalsize{9pt}
1555\setfont\smallrm\rmshape{9}{1000} 1969\setfont\smallrm\rmshape{9}{1000}{OT1}
1556\setfont\smalltt\ttshape{9}{1000} 1970\setfont\smalltt\ttshape{9}{1000}{OT1TT}
1557\setfont\smallbf\bfshape{10}{900} 1971\setfont\smallbf\bfshape{10}{900}{OT1}
1558\setfont\smallit\itshape{9}{1000} 1972\setfont\smallit\itshape{9}{1000}{OT1IT}
1559\setfont\smallsl\slshape{9}{1000} 1973\setfont\smallsl\slshape{9}{1000}{OT1}
1560\setfont\smallsf\sfshape{9}{1000} 1974\setfont\smallsf\sfshape{9}{1000}{OT1}
1561\setfont\smallsc\scshape{10}{900} 1975\setfont\smallsc\scshape{10}{900}{OT1}
1562\setfont\smallttsl\ttslshape{10}{900} 1976\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
1563\font\smalli=cmmi9 1977\font\smalli=cmmi9
1564\font\smallsy=cmsy9 1978\font\smallsy=cmsy9
1979\def\smallecsize{0900}
1565 1980
1566% Fonts for small examples (8pt). 1981% Fonts for small examples (8pt).
1567\def\smallernominalsize{8pt} 1982\def\smallernominalsize{8pt}
1568\setfont\smallerrm\rmshape{8}{1000} 1983\setfont\smallerrm\rmshape{8}{1000}{OT1}
1569\setfont\smallertt\ttshape{8}{1000} 1984\setfont\smallertt\ttshape{8}{1000}{OT1TT}
1570\setfont\smallerbf\bfshape{10}{800} 1985\setfont\smallerbf\bfshape{10}{800}{OT1}
1571\setfont\smallerit\itshape{8}{1000} 1986\setfont\smallerit\itshape{8}{1000}{OT1IT}
1572\setfont\smallersl\slshape{8}{1000} 1987\setfont\smallersl\slshape{8}{1000}{OT1}
1573\setfont\smallersf\sfshape{8}{1000} 1988\setfont\smallersf\sfshape{8}{1000}{OT1}
1574\setfont\smallersc\scshape{10}{800} 1989\setfont\smallersc\scshape{10}{800}{OT1}
1575\setfont\smallerttsl\ttslshape{10}{800} 1990\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
1576\font\smalleri=cmmi8 1991\font\smalleri=cmmi8
1577\font\smallersy=cmsy8 1992\font\smallersy=cmsy8
1993\def\smallerecsize{0800}
1578 1994
1579% Fonts for title page (20.4pt): 1995% Fonts for title page (20.4pt):
1580\def\titlenominalsize{20pt} 1996\def\titlenominalsize{20pt}
1581\setfont\titlerm\rmbshape{12}{\magstep3} 1997\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
1582\setfont\titleit\itbshape{10}{\magstep4} 1998\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
1583\setfont\titlesl\slbshape{10}{\magstep4} 1999\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
1584\setfont\titlett\ttbshape{12}{\magstep3} 2000\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
1585\setfont\titlettsl\ttslshape{10}{\magstep4} 2001\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
1586\setfont\titlesf\sfbshape{17}{\magstep1} 2002\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
1587\let\titlebf=\titlerm 2003\let\titlebf=\titlerm
1588\setfont\titlesc\scbshape{10}{\magstep4} 2004\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
1589\font\titlei=cmmi12 scaled \magstep3 2005\font\titlei=cmmi12 scaled \magstep3
1590\font\titlesy=cmsy10 scaled \magstep4 2006\font\titlesy=cmsy10 scaled \magstep4
1591\def\authorrm{\secrm} 2007\def\authorrm{\secrm}
1592\def\authortt{\sectt} 2008\def\authortt{\sectt}
2009\def\titleecsize{2074}
1593 2010
1594% Chapter (and unnumbered) fonts (17.28pt). 2011% Chapter (and unnumbered) fonts (17.28pt).
1595\def\chapnominalsize{17pt} 2012\def\chapnominalsize{17pt}
1596\setfont\chaprm\rmbshape{12}{\magstep2} 2013\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
1597\setfont\chapit\itbshape{10}{\magstep3} 2014\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
1598\setfont\chapsl\slbshape{10}{\magstep3} 2015\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
1599\setfont\chaptt\ttbshape{12}{\magstep2} 2016\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
1600\setfont\chapttsl\ttslshape{10}{\magstep3} 2017\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
1601\setfont\chapsf\sfbshape{17}{1000} 2018\setfont\chapsf\sfbshape{17}{1000}{OT1}
1602\let\chapbf=\chaprm 2019\let\chapbf=\chaprm
1603\setfont\chapsc\scbshape{10}{\magstep3} 2020\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
1604\font\chapi=cmmi12 scaled \magstep2 2021\font\chapi=cmmi12 scaled \magstep2
1605\font\chapsy=cmsy10 scaled \magstep3 2022\font\chapsy=cmsy10 scaled \magstep3
2023\def\chapecsize{1728}
1606 2024
1607% Section fonts (14.4pt). 2025% Section fonts (14.4pt).
1608\def\secnominalsize{14pt} 2026\def\secnominalsize{14pt}
1609\setfont\secrm\rmbshape{12}{\magstep1} 2027\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
1610\setfont\secit\itbshape{10}{\magstep2} 2028\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
1611\setfont\secsl\slbshape{10}{\magstep2} 2029\setfont\secsl\slbshape{10}{\magstep2}{OT1}
1612\setfont\sectt\ttbshape{12}{\magstep1} 2030\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
1613\setfont\secttsl\ttslshape{10}{\magstep2} 2031\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
1614\setfont\secsf\sfbshape{12}{\magstep1} 2032\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
1615\let\secbf\secrm 2033\let\secbf\secrm
1616\setfont\secsc\scbshape{10}{\magstep2} 2034\setfont\secsc\scbshape{10}{\magstep2}{OT1}
1617\font\seci=cmmi12 scaled \magstep1 2035\font\seci=cmmi12 scaled \magstep1
1618\font\secsy=cmsy10 scaled \magstep2 2036\font\secsy=cmsy10 scaled \magstep2
2037\def\sececsize{1440}
1619 2038
1620% Subsection fonts (13.15pt). 2039% Subsection fonts (13.15pt).
1621\def\ssecnominalsize{13pt} 2040\def\ssecnominalsize{13pt}
1622\setfont\ssecrm\rmbshape{12}{\magstephalf} 2041\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
1623\setfont\ssecit\itbshape{10}{1315} 2042\setfont\ssecit\itbshape{10}{1315}{OT1IT}
1624\setfont\ssecsl\slbshape{10}{1315} 2043\setfont\ssecsl\slbshape{10}{1315}{OT1}
1625\setfont\ssectt\ttbshape{12}{\magstephalf} 2044\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
1626\setfont\ssecttsl\ttslshape{10}{1315} 2045\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
1627\setfont\ssecsf\sfbshape{12}{\magstephalf} 2046\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
1628\let\ssecbf\ssecrm 2047\let\ssecbf\ssecrm
1629\setfont\ssecsc\scbshape{10}{1315} 2048\setfont\ssecsc\scbshape{10}{1315}{OT1}
1630\font\sseci=cmmi12 scaled \magstephalf 2049\font\sseci=cmmi12 scaled \magstephalf
1631\font\ssecsy=cmsy10 scaled 1315 2050\font\ssecsy=cmsy10 scaled 1315
2051\def\ssececsize{1200}
1632 2052
1633% Reduced fonts for @acro in text (10pt). 2053% Reduced fonts for @acro in text (10pt).
1634\def\reducednominalsize{10pt} 2054\def\reducednominalsize{10pt}
1635\setfont\reducedrm\rmshape{10}{1000} 2055\setfont\reducedrm\rmshape{10}{1000}{OT1}
1636\setfont\reducedtt\ttshape{10}{1000} 2056\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
1637\setfont\reducedbf\bfshape{10}{1000} 2057\setfont\reducedbf\bfshape{10}{1000}{OT1}
1638\setfont\reducedit\itshape{10}{1000} 2058\setfont\reducedit\itshape{10}{1000}{OT1IT}
1639\setfont\reducedsl\slshape{10}{1000} 2059\setfont\reducedsl\slshape{10}{1000}{OT1}
1640\setfont\reducedsf\sfshape{10}{1000} 2060\setfont\reducedsf\sfshape{10}{1000}{OT1}
1641\setfont\reducedsc\scshape{10}{1000} 2061\setfont\reducedsc\scshape{10}{1000}{OT1}
1642\setfont\reducedttsl\ttslshape{10}{1000} 2062\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
1643\font\reducedi=cmmi10 2063\font\reducedi=cmmi10
1644\font\reducedsy=cmsy10 2064\font\reducedsy=cmsy10
2065\def\reducedecsize{1000}
2066
2067% reset the current fonts
2068\textfonts
2069\rm
2070} % end of 11pt text font size definitions
2071
2072
2073% Definitions to make the main text be 10pt Computer Modern, with
2074% section, chapter, etc., sizes following suit. This is for the GNU
2075% Press printing of the Emacs 22 manual. Maybe other manuals in the
2076% future. Used with @smallbook, which sets the leading to 12pt.
2077%
2078\def\definetextfontsizex{%
2079% Text fonts (10pt).
2080\def\textnominalsize{10pt}
2081\edef\mainmagstep{1000}
2082\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2083\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2084\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2085\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2086\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2087\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2088\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2089\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2090\font\texti=cmmi10 scaled \mainmagstep
2091\font\textsy=cmsy10 scaled \mainmagstep
2092\def\textecsize{1000}
2093
2094% A few fonts for @defun names and args.
2095\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2096\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2097\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2098\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
2099
2100% Fonts for indices, footnotes, small examples (9pt).
2101\def\smallnominalsize{9pt}
2102\setfont\smallrm\rmshape{9}{1000}{OT1}
2103\setfont\smalltt\ttshape{9}{1000}{OT1TT}
2104\setfont\smallbf\bfshape{10}{900}{OT1}
2105\setfont\smallit\itshape{9}{1000}{OT1IT}
2106\setfont\smallsl\slshape{9}{1000}{OT1}
2107\setfont\smallsf\sfshape{9}{1000}{OT1}
2108\setfont\smallsc\scshape{10}{900}{OT1}
2109\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2110\font\smalli=cmmi9
2111\font\smallsy=cmsy9
2112\def\smallecsize{0900}
2113
2114% Fonts for small examples (8pt).
2115\def\smallernominalsize{8pt}
2116\setfont\smallerrm\rmshape{8}{1000}{OT1}
2117\setfont\smallertt\ttshape{8}{1000}{OT1TT}
2118\setfont\smallerbf\bfshape{10}{800}{OT1}
2119\setfont\smallerit\itshape{8}{1000}{OT1IT}
2120\setfont\smallersl\slshape{8}{1000}{OT1}
2121\setfont\smallersf\sfshape{8}{1000}{OT1}
2122\setfont\smallersc\scshape{10}{800}{OT1}
2123\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2124\font\smalleri=cmmi8
2125\font\smallersy=cmsy8
2126\def\smallerecsize{0800}
2127
2128% Fonts for title page (20.4pt):
2129\def\titlenominalsize{20pt}
2130\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2131\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2132\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2133\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2134\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2135\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2136\let\titlebf=\titlerm
2137\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2138\font\titlei=cmmi12 scaled \magstep3
2139\font\titlesy=cmsy10 scaled \magstep4
2140\def\authorrm{\secrm}
2141\def\authortt{\sectt}
2142\def\titleecsize{2074}
2143
2144% Chapter fonts (14.4pt).
2145\def\chapnominalsize{14pt}
2146\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2147\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2148\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2149\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2150\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2151\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2152\let\chapbf\chaprm
2153\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2154\font\chapi=cmmi12 scaled \magstep1
2155\font\chapsy=cmsy10 scaled \magstep2
2156\def\chapecsize{1440}
2157
2158% Section fonts (12pt).
2159\def\secnominalsize{12pt}
2160\setfont\secrm\rmbshape{12}{1000}{OT1}
2161\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2162\setfont\secsl\slbshape{10}{\magstep1}{OT1}
2163\setfont\sectt\ttbshape{12}{1000}{OT1TT}
2164\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2165\setfont\secsf\sfbshape{12}{1000}{OT1}
2166\let\secbf\secrm
2167\setfont\secsc\scbshape{10}{\magstep1}{OT1}
2168\font\seci=cmmi12
2169\font\secsy=cmsy10 scaled \magstep1
2170\def\sececsize{1200}
2171
2172% Subsection fonts (10pt).
2173\def\ssecnominalsize{10pt}
2174\setfont\ssecrm\rmbshape{10}{1000}{OT1}
2175\setfont\ssecit\itbshape{10}{1000}{OT1IT}
2176\setfont\ssecsl\slbshape{10}{1000}{OT1}
2177\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2178\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2179\setfont\ssecsf\sfbshape{10}{1000}{OT1}
2180\let\ssecbf\ssecrm
2181\setfont\ssecsc\scbshape{10}{1000}{OT1}
2182\font\sseci=cmmi10
2183\font\ssecsy=cmsy10
2184\def\ssececsize{1000}
2185
2186% Reduced fonts for @acro in text (9pt).
2187\def\reducednominalsize{9pt}
2188\setfont\reducedrm\rmshape{9}{1000}{OT1}
2189\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2190\setfont\reducedbf\bfshape{10}{900}{OT1}
2191\setfont\reducedit\itshape{9}{1000}{OT1IT}
2192\setfont\reducedsl\slshape{9}{1000}{OT1}
2193\setfont\reducedsf\sfshape{9}{1000}{OT1}
2194\setfont\reducedsc\scshape{10}{900}{OT1}
2195\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2196\font\reducedi=cmmi9
2197\font\reducedsy=cmsy9
2198\def\reducedecsize{0900}
2199
2200% reduce space between paragraphs
2201\divide\parskip by 2
2202
2203% reset the current fonts
2204\textfonts
2205\rm
2206} % end of 10pt text font size definitions
2207
2208
2209% We provide the user-level command
2210% @fonttextsize 10
2211% (or 11) to redefine the text font size. pt is assumed.
2212%
2213\def\xword{10}
2214\def\xiword{11}
2215%
2216\parseargdef\fonttextsize{%
2217 \def\textsizearg{#1}%
2218 \wlog{doing @fonttextsize \textsizearg}%
2219 %
2220 % Set \globaldefs so that documents can use this inside @tex, since
2221 % makeinfo 4.8 does not support it, but we need it nonetheless.
2222 %
2223 \begingroup \globaldefs=1
2224 \ifx\textsizearg\xword \definetextfontsizex
2225 \else \ifx\textsizearg\xiword \definetextfontsizexi
2226 \else
2227 \errhelp=\EMsimple
2228 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2229 \fi\fi
2230 \endgroup
2231}
2232
1645 2233
1646% In order for the font changes to affect most math symbols and letters, 2234% In order for the font changes to affect most math symbols and letters,
1647% we have to define the \textfont of the standard families. Since 2235% we have to define the \textfont of the standard families. Since
@@ -1753,7 +2341,7 @@ where each line of input produces a line of output.}
1753 2341
1754% Set up the default fonts, so we can use them for creating boxes. 2342% Set up the default fonts, so we can use them for creating boxes.
1755% 2343%
1756\textfonts \rm 2344\definetextfontsizexi
1757 2345
1758% Define these so they can be easily changed for other fonts. 2346% Define these so they can be easily changed for other fonts.
1759\def\angleleft{$\langle$} 2347\def\angleleft{$\langle$}
@@ -1763,10 +2351,10 @@ where each line of input produces a line of output.}
1763\newcount\fontdepth \fontdepth=0 2351\newcount\fontdepth \fontdepth=0
1764 2352
1765% Fonts for short table of contents. 2353% Fonts for short table of contents.
1766\setfont\shortcontrm\rmshape{12}{1000} 2354\setfont\shortcontrm\rmshape{12}{1000}{OT1}
1767\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12 2355\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
1768\setfont\shortcontsl\slshape{12}{1000} 2356\setfont\shortcontsl\slshape{12}{1000}{OT1}
1769\setfont\shortconttt\ttshape{12}{1000} 2357\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
1770 2358
1771%% Add scribe-like font environments, plus @l for inline lisp (usually sans 2359%% Add scribe-like font environments, plus @l for inline lisp (usually sans
1772%% serif) and @ii for TeX italic 2360%% serif) and @ii for TeX italic
@@ -1829,7 +2417,7 @@ where each line of input produces a line of output.}
1829 \null 2417 \null
1830} 2418}
1831\def\samp#1{`\tclose{#1}'\null} 2419\def\samp#1{`\tclose{#1}'\null}
1832\setfont\keyrm\rmshape{8}{1000} 2420\setfont\keyrm\rmshape{8}{1000}{OT1}
1833\font\keysy=cmsy9 2421\font\keysy=cmsy9
1834\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% 2422\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
1835 \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% 2423 \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
@@ -1837,6 +2425,7 @@ where each line of input produces a line of output.}
1837 \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% 2425 \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
1838 \kern-0.4pt\hrule}% 2426 \kern-0.4pt\hrule}%
1839 \kern-.06em\raise0.4pt\hbox{\angleright}}}} 2427 \kern-.06em\raise0.4pt\hbox{\angleright}}}}
2428\def\key #1{{\nohyphenation \uppercase{#1}}\null}
1840% The old definition, with no lozenge: 2429% The old definition, with no lozenge:
1841%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} 2430%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1842\def\ctrl #1{{\tt \rawbackslash \hat}#1} 2431\def\ctrl #1{{\tt \rawbackslash \hat}#1}
@@ -1878,11 +2467,14 @@ where each line of input produces a line of output.}
1878% and arrange explicitly to hyphenate at a dash. 2467% and arrange explicitly to hyphenate at a dash.
1879% -- rms. 2468% -- rms.
1880{ 2469{
1881 \catcode`\-=\active 2470 \catcode`\-=\active \catcode`\_=\active
1882 \catcode`\_=\active 2471 \catcode`\'=\active \catcode`\`=\active
1883 % 2472 %
1884 \global\def\code{\begingroup 2473 \global\def\code{\begingroup
1885 \catcode`\-=\active \catcode`\_=\active 2474 \catcode\rquoteChar=\active \catcode\lquoteChar=\active
2475 \let'\codequoteright \let`\codequoteleft
2476 %
2477 \catcode\dashChar=\active \catcode\underChar=\active
1886 \ifallowcodebreaks 2478 \ifallowcodebreaks
1887 \let-\codedash 2479 \let-\codedash
1888 \let_\codeunder 2480 \let_\codeunder
@@ -2118,6 +2710,35 @@ where each line of input produces a line of output.}
2118 \thiseurofont 2710 \thiseurofont
2119} 2711}
2120 2712
2713% Hacks for glyphs from the EC fonts similar to \euro. We don't
2714% use \let for the aliases, because sometimes we redefine the original
2715% macro, and the alias should reflect the redefinition.
2716\def\guillemetleft{{\ecfont \char"13}}
2717\def\guillemotleft{\guillemetleft}
2718\def\guillemetright{{\ecfont \char"14}}
2719\def\guillemotright{\guillemetright}
2720\def\guilsinglleft{{\ecfont \char"0E}}
2721\def\guilsinglright{{\ecfont \char"0F}}
2722\def\quotedblbase{{\ecfont \char"12}}
2723\def\quotesinglbase{{\ecfont \char"0D}}
2724%
2725\def\ecfont{%
2726 % We can't distinguish serif/sanserif and italic/slanted, but this
2727 % is used for crude hacks anyway (like adding French and German
2728 % quotes to documents typeset with CM, where we lose kerning), so
2729 % hopefully nobody will notice/care.
2730 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
2731 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
2732 \ifx\curfontstyle\bfstylename
2733 % bold:
2734 \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
2735 \else
2736 % regular:
2737 \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
2738 \fi
2739 \thisecfont
2740}
2741
2121% @registeredsymbol - R in a circle. The font for the R should really 2742% @registeredsymbol - R in a circle. The font for the R should really
2122% be smaller yet, but lllsize is the best we can do for now. 2743% be smaller yet, but lllsize is the best we can do for now.
2123% Adapted from the plain.tex definition of \copyright. 2744% Adapted from the plain.tex definition of \copyright.
@@ -2128,6 +2749,10 @@ where each line of input produces a line of output.}
2128 }$% 2749 }$%
2129} 2750}
2130 2751
2752% @textdegree - the normal degrees sign.
2753%
2754\def\textdegree{$^\circ$}
2755
2131% Laurent Siebenmann reports \Orb undefined with: 2756% Laurent Siebenmann reports \Orb undefined with:
2132% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 2757% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
2133% so we'll define it if necessary. 2758% so we'll define it if necessary.
@@ -2136,6 +2761,12 @@ where each line of input produces a line of output.}
2136\def\Orb{\mathhexbox20D} 2761\def\Orb{\mathhexbox20D}
2137\fi 2762\fi
2138 2763
2764% Quotes.
2765\chardef\quotedblleft="5C
2766\chardef\quotedblright=`\"
2767\chardef\quoteleft=`\`
2768\chardef\quoteright=`\'
2769
2139 2770
2140\message{page headings,} 2771\message{page headings,}
2141 2772
@@ -2299,12 +2930,39 @@ where each line of input produces a line of output.}
2299 % 2930 %
2300 % Leave some space for the footline. Hopefully ok to assume 2931 % Leave some space for the footline. Hopefully ok to assume
2301 % @evenfooting will not be used by itself. 2932 % @evenfooting will not be used by itself.
2302 \global\advance\pageheight by -\baselineskip 2933 \global\advance\pageheight by -12pt
2303 \global\advance\vsize by -\baselineskip 2934 \global\advance\vsize by -12pt
2304} 2935}
2305 2936
2306\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} 2937\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
2307 2938
2939% @evenheadingmarks top \thischapter <- chapter at the top of a page
2940% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
2941%
2942% The same set of arguments for:
2943%
2944% @oddheadingmarks
2945% @evenfootingmarks
2946% @oddfootingmarks
2947% @everyheadingmarks
2948% @everyfootingmarks
2949
2950\def\evenheadingmarks{\headingmarks{even}{heading}}
2951\def\oddheadingmarks{\headingmarks{odd}{heading}}
2952\def\evenfootingmarks{\headingmarks{even}{footing}}
2953\def\oddfootingmarks{\headingmarks{odd}{footing}}
2954\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
2955 \headingmarks{odd}{heading}{#1} }
2956\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
2957 \headingmarks{odd}{footing}{#1} }
2958% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
2959\def\headingmarks#1#2#3 {%
2960 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
2961 \global\expandafter\let\csname get#1#2marks\endcsname \temp
2962}
2963
2964\everyheadingmarks bottom
2965\everyfootingmarks bottom
2308 2966
2309% @headings double turns headings on for double-sided printing. 2967% @headings double turns headings on for double-sided printing.
2310% @headings single turns headings on for single-sided printing. 2968% @headings single turns headings on for single-sided printing.
@@ -2959,6 +3617,7 @@ where each line of input produces a line of output.}
2959 3617
2960\def\doignore#1{\begingroup 3618\def\doignore#1{\begingroup
2961 % Scan in ``verbatim'' mode: 3619 % Scan in ``verbatim'' mode:
3620 \obeylines
2962 \catcode`\@ = \other 3621 \catcode`\@ = \other
2963 \catcode`\{ = \other 3622 \catcode`\{ = \other
2964 \catcode`\} = \other 3623 \catcode`\} = \other
@@ -2979,16 +3638,16 @@ where each line of input produces a line of output.}
2979 \gdef\dodoignore#1{% 3638 \gdef\dodoignore#1{%
2980 % #1 contains the command name as a string, e.g., `ifinfo'. 3639 % #1 contains the command name as a string, e.g., `ifinfo'.
2981 % 3640 %
2982 % Define a command to find the next `@end #1', which must be on a line 3641 % Define a command to find the next `@end #1'.
2983 % by itself. 3642 \long\def\doignoretext##1^^M@end #1{%
2984 \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}% 3643 \doignoretextyyy##1^^M@#1\_STOP_}%
3644 %
2985 % And this command to find another #1 command, at the beginning of a 3645 % And this command to find another #1 command, at the beginning of a
2986 % line. (Otherwise, we would consider a line `@c @ifset', for 3646 % line. (Otherwise, we would consider a line `@c @ifset', for
2987 % example, to count as an @ifset for nesting.) 3647 % example, to count as an @ifset for nesting.)
2988 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% 3648 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
2989 % 3649 %
2990 % And now expand that command. 3650 % And now expand that command.
2991 \obeylines %
2992 \doignoretext ^^M% 3651 \doignoretext ^^M%
2993 }% 3652 }%
2994} 3653}
@@ -3018,7 +3677,12 @@ where each line of input produces a line of output.}
3018} 3677}
3019 3678
3020% Finish off ignored text. 3679% Finish off ignored text.
3021\def\enddoignore{\endgroup\ignorespaces} 3680{ \obeylines%
3681 % Ignore anything after the last `@end #1'; this matters in verbatim
3682 % environments, where otherwise the newline after an ignored conditional
3683 % would result in a blank line in the output.
3684 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
3685}
3022 3686
3023 3687
3024% @set VAR sets the variable VAR to an empty value. 3688% @set VAR sets the variable VAR to an empty value.
@@ -3221,12 +3885,39 @@ where each line of input produces a line of output.}
3221 \escapechar = `\\ % use backslash in output files. 3885 \escapechar = `\\ % use backslash in output files.
3222 \def\@{@}% change to @@ when we switch to @ as escape char in index files. 3886 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
3223 \def\ {\realbackslash\space }% 3887 \def\ {\realbackslash\space }%
3888 %
3224 % Need these in case \tex is in effect and \{ is a \delimiter again. 3889 % Need these in case \tex is in effect and \{ is a \delimiter again.
3225 % But can't use \lbracecmd and \rbracecmd because texindex assumes 3890 % But can't use \lbracecmd and \rbracecmd because texindex assumes
3226 % braces and backslashes are used only as delimiters. 3891 % braces and backslashes are used only as delimiters.
3227 \let\{ = \mylbrace 3892 \let\{ = \mylbrace
3228 \let\} = \myrbrace 3893 \let\} = \myrbrace
3229 % 3894 %
3895 % I don't entirely understand this, but when an index entry is
3896 % generated from a macro call, the \endinput which \scanmacro inserts
3897 % causes processing to be prematurely terminated. This is,
3898 % apparently, because \indexsorttmp is fully expanded, and \endinput
3899 % is an expandable command. The redefinition below makes \endinput
3900 % disappear altogether for that purpose -- although logging shows that
3901 % processing continues to some further point. On the other hand, it
3902 % seems \endinput does not hurt in the printed index arg, since that
3903 % is still getting written without apparent harm.
3904 %
3905 % Sample source (mac-idx3.tex, reported by Graham Percival to
3906 % help-texinfo, 22may06):
3907 % @macro funindex {WORD}
3908 % @findex xyz
3909 % @end macro
3910 % ...
3911 % @funindex commtest
3912 %
3913 % The above is not enough to reproduce the bug, but it gives the flavor.
3914 %
3915 % Sample whatsit resulting:
3916 % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
3917 %
3918 % So:
3919 \let\endinput = \empty
3920 %
3230 % Do the redefinitions. 3921 % Do the redefinitions.
3231 \commondummies 3922 \commondummies
3232} 3923}
@@ -3244,6 +3935,7 @@ where each line of input produces a line of output.}
3244 % 3935 %
3245 % Do the redefinitions. 3936 % Do the redefinitions.
3246 \commondummies 3937 \commondummies
3938 \otherbackslash
3247} 3939}
3248 3940
3249% Called from \indexdummies and \atdummies. 3941% Called from \indexdummies and \atdummies.
@@ -3311,12 +4003,23 @@ where each line of input produces a line of output.}
3311 \definedummyword\equiv 4003 \definedummyword\equiv
3312 \definedummyword\error 4004 \definedummyword\error
3313 \definedummyword\euro 4005 \definedummyword\euro
4006 \definedummyword\guillemetleft
4007 \definedummyword\guillemetright
4008 \definedummyword\guilsinglleft
4009 \definedummyword\guilsinglright
3314 \definedummyword\expansion 4010 \definedummyword\expansion
3315 \definedummyword\minus 4011 \definedummyword\minus
3316 \definedummyword\pounds 4012 \definedummyword\pounds
3317 \definedummyword\point 4013 \definedummyword\point
3318 \definedummyword\print 4014 \definedummyword\print
4015 \definedummyword\quotedblbase
4016 \definedummyword\quotedblleft
4017 \definedummyword\quotedblright
4018 \definedummyword\quoteleft
4019 \definedummyword\quoteright
4020 \definedummyword\quotesinglbase
3319 \definedummyword\result 4021 \definedummyword\result
4022 \definedummyword\textdegree
3320 % 4023 %
3321 % We want to disable all macros so that they are not expanded by \write. 4024 % We want to disable all macros so that they are not expanded by \write.
3322 \macrolist 4025 \macrolist
@@ -3330,63 +4033,62 @@ where each line of input produces a line of output.}
3330 4033
3331% \commondummiesnofonts: common to \commondummies and \indexnofonts. 4034% \commondummiesnofonts: common to \commondummies and \indexnofonts.
3332% 4035%
3333% Better have this without active chars. 4036\def\commondummiesnofonts{%
3334{ 4037 % Control letters and accents.
3335 \catcode`\~=\other 4038 \definedummyletter\!%
3336 \gdef\commondummiesnofonts{% 4039 \definedummyaccent\"%
3337 % Control letters and accents. 4040 \definedummyaccent\'%
3338 \definedummyletter\!% 4041 \definedummyletter\*%
3339 \definedummyaccent\"% 4042 \definedummyaccent\,%
3340 \definedummyaccent\'% 4043 \definedummyletter\.%
3341 \definedummyletter\*% 4044 \definedummyletter\/%
3342 \definedummyaccent\,% 4045 \definedummyletter\:%
3343 \definedummyletter\.% 4046 \definedummyaccent\=%
3344 \definedummyletter\/% 4047 \definedummyletter\?%
3345 \definedummyletter\:% 4048 \definedummyaccent\^%
3346 \definedummyaccent\=% 4049 \definedummyaccent\`%
3347 \definedummyletter\?% 4050 \definedummyaccent\~%
3348 \definedummyaccent\^% 4051 \definedummyword\u
3349 \definedummyaccent\`% 4052 \definedummyword\v
3350 \definedummyaccent\~% 4053 \definedummyword\H
3351 \definedummyword\u 4054 \definedummyword\dotaccent
3352 \definedummyword\v 4055 \definedummyword\ringaccent
3353 \definedummyword\H 4056 \definedummyword\tieaccent
3354 \definedummyword\dotaccent 4057 \definedummyword\ubaraccent
3355 \definedummyword\ringaccent 4058 \definedummyword\udotaccent
3356 \definedummyword\tieaccent 4059 \definedummyword\dotless
3357 \definedummyword\ubaraccent 4060 %
3358 \definedummyword\udotaccent 4061 % Texinfo font commands.
3359 \definedummyword\dotless 4062 \definedummyword\b
3360 % 4063 \definedummyword\i
3361 % Texinfo font commands. 4064 \definedummyword\r
3362 \definedummyword\b 4065 \definedummyword\sc
3363 \definedummyword\i 4066 \definedummyword\t
3364 \definedummyword\r 4067 %
3365 \definedummyword\sc 4068 % Commands that take arguments.
3366 \definedummyword\t 4069 \definedummyword\acronym
3367 % 4070 \definedummyword\cite
3368 % Commands that take arguments. 4071 \definedummyword\code
3369 \definedummyword\acronym 4072 \definedummyword\command
3370 \definedummyword\cite 4073 \definedummyword\dfn
3371 \definedummyword\code 4074 \definedummyword\emph
3372 \definedummyword\command 4075 \definedummyword\env
3373 \definedummyword\dfn 4076 \definedummyword\file
3374 \definedummyword\emph 4077 \definedummyword\kbd
3375 \definedummyword\env 4078 \definedummyword\key
3376 \definedummyword\file 4079 \definedummyword\math
3377 \definedummyword\kbd 4080 \definedummyword\option
3378 \definedummyword\key 4081 \definedummyword\pxref
3379 \definedummyword\math 4082 \definedummyword\ref
3380 \definedummyword\option 4083 \definedummyword\samp
3381 \definedummyword\samp 4084 \definedummyword\strong
3382 \definedummyword\strong 4085 \definedummyword\tie
3383 \definedummyword\tie 4086 \definedummyword\uref
3384 \definedummyword\uref 4087 \definedummyword\url
3385 \definedummyword\url 4088 \definedummyword\var
3386 \definedummyword\var 4089 \definedummyword\verb
3387 \definedummyword\verb 4090 \definedummyword\w
3388 \definedummyword\w 4091 \definedummyword\xref
3389 }
3390} 4092}
3391 4093
3392% \indexnofonts is used when outputting the strings to sort the index 4094% \indexnofonts is used when outputting the strings to sort the index
@@ -3445,12 +4147,23 @@ where each line of input produces a line of output.}
3445 \def\equiv{==}% 4147 \def\equiv{==}%
3446 \def\error{error}% 4148 \def\error{error}%
3447 \def\euro{euro}% 4149 \def\euro{euro}%
4150 \def\guillemetleft{<<}%
4151 \def\guillemetright{>>}%
4152 \def\guilsinglleft{<}%
4153 \def\guilsinglright{>}%
3448 \def\expansion{==>}% 4154 \def\expansion{==>}%
3449 \def\minus{-}% 4155 \def\minus{-}%
3450 \def\pounds{pounds}% 4156 \def\pounds{pounds}%
3451 \def\point{.}% 4157 \def\point{.}%
3452 \def\print{-|}% 4158 \def\print{-|}%
4159 \def\quotedblbase{"}%
4160 \def\quotedblleft{"}%
4161 \def\quotedblright{"}%
4162 \def\quoteleft{`}%
4163 \def\quoteright{'}%
4164 \def\quotesinglbase{,}%
3453 \def\result{=>}% 4165 \def\result{=>}%
4166 \def\textdegree{degrees}%
3454 % 4167 %
3455 % We need to get rid of all macros, leaving only the arguments (if present). 4168 % We need to get rid of all macros, leaving only the arguments (if present).
3456 % Of course this is not nearly correct, but it is the best we can do for now. 4169 % Of course this is not nearly correct, but it is the best we can do for now.
@@ -3490,11 +4203,7 @@ where each line of input produces a line of output.}
3490 % 4203 %
3491 \edef\writeto{\csname#1indfile\endcsname}% 4204 \edef\writeto{\csname#1indfile\endcsname}%
3492 % 4205 %
3493 \ifvmode 4206 \safewhatsit\dosubindwrite
3494 \dosubindsanitize
3495 \else
3496 \dosubindwrite
3497 \fi
3498 }% 4207 }%
3499 \fi 4208 \fi
3500} 4209}
@@ -3531,13 +4240,13 @@ where each line of input produces a line of output.}
3531 \temp 4240 \temp
3532} 4241}
3533 4242
3534% Take care of unwanted page breaks: 4243% Take care of unwanted page breaks/skips around a whatsit:
3535% 4244%
3536% If a skip is the last thing on the list now, preserve it 4245% If a skip is the last thing on the list now, preserve it
3537% by backing up by \lastskip, doing the \write, then inserting 4246% by backing up by \lastskip, doing the \write, then inserting
3538% the skip again. Otherwise, the whatsit generated by the 4247% the skip again. Otherwise, the whatsit generated by the
3539% \write will make \lastskip zero. The result is that sequences 4248% \write or \pdfdest will make \lastskip zero. The result is that
3540% like this: 4249% sequences like this:
3541% @end defun 4250% @end defun
3542% @tindex whatever 4251% @tindex whatever
3543% @defun ... 4252% @defun ...
@@ -3561,25 +4270,31 @@ where each line of input produces a line of output.}
3561% 4270%
3562\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} 4271\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
3563% 4272%
4273\newskip\whatsitskip
4274\newcount\whatsitpenalty
4275%
3564% ..., ready, GO: 4276% ..., ready, GO:
3565% 4277%
3566\def\dosubindsanitize{% 4278\def\safewhatsit#1{%
4279\ifhmode
4280 #1%
4281\else
3567 % \lastskip and \lastpenalty cannot both be nonzero simultaneously. 4282 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
3568 \skip0 = \lastskip 4283 \whatsitskip = \lastskip
3569 \edef\lastskipmacro{\the\lastskip}% 4284 \edef\lastskipmacro{\the\lastskip}%
3570 \count255 = \lastpenalty 4285 \whatsitpenalty = \lastpenalty
3571 % 4286 %
3572 % If \lastskip is nonzero, that means the last item was a 4287 % If \lastskip is nonzero, that means the last item was a
3573 % skip. And since a skip is discardable, that means this 4288 % skip. And since a skip is discardable, that means this
3574 % -\skip0 glue we're inserting is preceded by a 4289 % -\whatsitskip glue we're inserting is preceded by a
3575 % non-discardable item, therefore it is not a potential 4290 % non-discardable item, therefore it is not a potential
3576 % breakpoint, therefore no \nobreak needed. 4291 % breakpoint, therefore no \nobreak needed.
3577 \ifx\lastskipmacro\zeroskipmacro 4292 \ifx\lastskipmacro\zeroskipmacro
3578 \else 4293 \else
3579 \vskip-\skip0 4294 \vskip-\whatsitskip
3580 \fi 4295 \fi
3581 % 4296 %
3582 \dosubindwrite 4297 #1%
3583 % 4298 %
3584 \ifx\lastskipmacro\zeroskipmacro 4299 \ifx\lastskipmacro\zeroskipmacro
3585 % If \lastskip was zero, perhaps the last item was a penalty, and 4300 % If \lastskip was zero, perhaps the last item was a penalty, and
@@ -3593,13 +4308,14 @@ where each line of input produces a line of output.}
3593 % Description. 4308 % Description.
3594 % would allow a break between the index-whatever whatsit 4309 % would allow a break between the index-whatever whatsit
3595 % and the "Description." paragraph. 4310 % and the "Description." paragraph.
3596 \ifnum\count255>9999 \penalty\count255 \fi 4311 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
3597 \else 4312 \else
3598 % On the other hand, if we had a nonzero \lastskip, 4313 % On the other hand, if we had a nonzero \lastskip,
3599 % this make-up glue would be preceded by a non-discardable item 4314 % this make-up glue would be preceded by a non-discardable item
3600 % (the whatsit from the \write), so we must insert a \nobreak. 4315 % (the whatsit from the \write), so we must insert a \nobreak.
3601 \nobreak\vskip\skip0 4316 \nobreak\vskip\whatsitskip
3602 \fi 4317 \fi
4318\fi
3603} 4319}
3604 4320
3605% The index entry written in the file actually looks like 4321% The index entry written in the file actually looks like
@@ -3642,6 +4358,7 @@ where each line of input produces a line of output.}
3642 % 4358 %
3643 \smallfonts \rm 4359 \smallfonts \rm
3644 \tolerance = 9500 4360 \tolerance = 9500
4361 \plainfrenchspacing
3645 \everypar = {}% don't want the \kern\-parindent from indentation suppression. 4362 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
3646 % 4363 %
3647 % See if the index file exists and is nonempty. 4364 % See if the index file exists and is nonempty.
@@ -3771,11 +4488,8 @@ where each line of input produces a line of output.}
3771 % The following is kludged to not output a line of dots in the index if 4488 % The following is kludged to not output a line of dots in the index if
3772 % there are no page numbers. The next person who breaks this will be 4489 % there are no page numbers. The next person who breaks this will be
3773 % cursed by a Unix daemon. 4490 % cursed by a Unix daemon.
3774 \def\tempa{{\rm }}% 4491 \setbox\boxA = \hbox{#1}%
3775 \def\tempb{#1}% 4492 \ifdim\wd\boxA = 0pt
3776 \edef\tempc{\tempa}%
3777 \edef\tempd{\tempb}%
3778 \ifx\tempc\tempd
3779 \ % 4493 \ %
3780 \else 4494 \else
3781 % 4495 %
@@ -3799,9 +4513,9 @@ where each line of input produces a line of output.}
3799 \endgroup 4513 \endgroup
3800} 4514}
3801 4515
3802% Like \dotfill except takes at least 1 em. 4516% Like plain.tex's \dotfill, except uses up at least 1 em.
3803\def\indexdotfill{\cleaders 4517\def\indexdotfill{\cleaders
3804 \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} 4518 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
3805 4519
3806\def\primary #1{\line{#1\hfil}} 4520\def\primary #1{\line{#1\hfil}}
3807 4521
@@ -3911,6 +4625,34 @@ where each line of input produces a line of output.}
3911% 4625%
3912% All done with double columns. 4626% All done with double columns.
3913\def\enddoublecolumns{% 4627\def\enddoublecolumns{%
4628 % The following penalty ensures that the page builder is exercised
4629 % _before_ we change the output routine. This is necessary in the
4630 % following situation:
4631 %
4632 % The last section of the index consists only of a single entry.
4633 % Before this section, \pagetotal is less than \pagegoal, so no
4634 % break occurs before the last section starts. However, the last
4635 % section, consisting of \initial and the single \entry, does not
4636 % fit on the page and has to be broken off. Without the following
4637 % penalty the page builder will not be exercised until \eject
4638 % below, and by that time we'll already have changed the output
4639 % routine to the \balancecolumns version, so the next-to-last
4640 % double-column page will be processed with \balancecolumns, which
4641 % is wrong: The two columns will go to the main vertical list, with
4642 % the broken-off section in the recent contributions. As soon as
4643 % the output routine finishes, TeX starts reconsidering the page
4644 % break. The two columns and the broken-off section both fit on the
4645 % page, because the two columns now take up only half of the page
4646 % goal. When TeX sees \eject from below which follows the final
4647 % section, it invokes the new output routine that we've set after
4648 % \balancecolumns below; \onepageout will try to fit the two columns
4649 % and the final section into the vbox of \pageheight (see
4650 % \pagebody), causing an overfull box.
4651 %
4652 % Note that glue won't work here, because glue does not exercise the
4653 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
4654 \penalty0
4655 %
3914 \output = {% 4656 \output = {%
3915 % Split the last of the double-column material. Leave it on the 4657 % Split the last of the double-column material. Leave it on the
3916 % current page, no automatic page break. 4658 % current page, no automatic page break.
@@ -4020,11 +4762,15 @@ where each line of input produces a line of output.}
4020 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 4762 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
4021 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} 4763 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
4022 4764
4023% Each @chapter defines this as the name of the chapter. 4765% Each @chapter defines these (using marks) as the number+name, number
4024% page headings and footings can use it. @section does likewise. 4766% and name of the chapter. Page headings and footings can use
4025% However, they are not reliable, because we don't use marks. 4767% these. @section does likewise.
4026\def\thischapter{} 4768\def\thischapter{}
4769\def\thischapternum{}
4770\def\thischaptername{}
4027\def\thissection{} 4771\def\thissection{}
4772\def\thissectionnum{}
4773\def\thissectionname{}
4028 4774
4029\newcount\absseclevel % used to calculate proper heading level 4775\newcount\absseclevel % used to calculate proper heading level
4030\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count 4776\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
@@ -4325,7 +5071,20 @@ where each line of input produces a line of output.}
4325 5071
4326\def\chapbreak{\dobreak \chapheadingskip {-4000}} 5072\def\chapbreak{\dobreak \chapheadingskip {-4000}}
4327\def\chappager{\par\vfill\supereject} 5073\def\chappager{\par\vfill\supereject}
4328\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} 5074% Because \domark is called before \chapoddpage, the filler page will
5075% get the headings for the next chapter, which is wrong. But we don't
5076% care -- we just disable all headings on the filler page.
5077\def\chapoddpage{%
5078 \chappager
5079 \ifodd\pageno \else
5080 \begingroup
5081 \evenheadline={\hfil}\evenfootline={\hfil}%
5082 \oddheadline={\hfil}\oddfootline={\hfil}%
5083 \hbox to 0pt{}%
5084 \chappager
5085 \endgroup
5086 \fi
5087}
4329 5088
4330\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} 5089\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
4331 5090
@@ -4359,41 +5118,72 @@ where each line of input produces a line of output.}
4359\def\Yappendixkeyword{Yappendix} 5118\def\Yappendixkeyword{Yappendix}
4360% 5119%
4361\def\chapmacro#1#2#3{% 5120\def\chapmacro#1#2#3{%
5121 % Insert the first mark before the heading break (see notes for \domark).
5122 \let\prevchapterdefs=\lastchapterdefs
5123 \let\prevsectiondefs=\lastsectiondefs
5124 \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
5125 \gdef\thissection{}}%
5126 %
5127 \def\temptype{#2}%
5128 \ifx\temptype\Ynothingkeyword
5129 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
5130 \gdef\thischapter{\thischaptername}}%
5131 \else\ifx\temptype\Yomitfromtockeyword
5132 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
5133 \gdef\thischapter{}}%
5134 \else\ifx\temptype\Yappendixkeyword
5135 \toks0={#1}%
5136 \xdef\lastchapterdefs{%
5137 \gdef\noexpand\thischaptername{\the\toks0}%
5138 \gdef\noexpand\thischapternum{\appendixletter}%
5139 \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum:
5140 \noexpand\thischaptername}%
5141 }%
5142 \else
5143 \toks0={#1}%
5144 \xdef\lastchapterdefs{%
5145 \gdef\noexpand\thischaptername{\the\toks0}%
5146 \gdef\noexpand\thischapternum{\the\chapno}%
5147 \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum:
5148 \noexpand\thischaptername}%
5149 }%
5150 \fi\fi\fi
5151 %
5152 % Output the mark. Pass it through \safewhatsit, to take care of
5153 % the preceding space.
5154 \safewhatsit\domark
5155 %
5156 % Insert the chapter heading break.
4362 \pchapsepmacro 5157 \pchapsepmacro
5158 %
5159 % Now the second mark, after the heading break. No break points
5160 % between here and the heading.
5161 \let\prevchapterdefs=\lastchapterdefs
5162 \let\prevsectiondefs=\lastsectiondefs
5163 \domark
5164 %
4363 {% 5165 {%
4364 \chapfonts \rm 5166 \chapfonts \rm
4365 % 5167 %
4366 % Have to define \thissection before calling \donoderef, because the 5168 % Have to define \lastsection before calling \donoderef, because the
4367 % xref code eventually uses it. On the other hand, it has to be called 5169 % xref code eventually uses it. On the other hand, it has to be called
4368 % after \pchapsepmacro, or the headline will change too soon. 5170 % after \pchapsepmacro, or the headline will change too soon.
4369 \gdef\thissection{#1}% 5171 \gdef\lastsection{#1}%
4370 \gdef\thischaptername{#1}%
4371 % 5172 %
4372 % Only insert the separating space if we have a chapter/appendix 5173 % Only insert the separating space if we have a chapter/appendix
4373 % number, and don't print the unnumbered ``number''. 5174 % number, and don't print the unnumbered ``number''.
4374 \def\temptype{#2}%
4375 \ifx\temptype\Ynothingkeyword 5175 \ifx\temptype\Ynothingkeyword
4376 \setbox0 = \hbox{}% 5176 \setbox0 = \hbox{}%
4377 \def\toctype{unnchap}% 5177 \def\toctype{unnchap}%
4378 \gdef\thischapter{#1}%
4379 \else\ifx\temptype\Yomitfromtockeyword 5178 \else\ifx\temptype\Yomitfromtockeyword
4380 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry 5179 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
4381 \def\toctype{omit}% 5180 \def\toctype{omit}%
4382 \gdef\thischapter{}%
4383 \else\ifx\temptype\Yappendixkeyword 5181 \else\ifx\temptype\Yappendixkeyword
4384 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% 5182 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
4385 \def\toctype{app}% 5183 \def\toctype{app}%
4386 % We don't substitute the actual chapter name into \thischapter
4387 % because we don't want its macros evaluated now. And we don't
4388 % use \thissection because that changes with each section.
4389 %
4390 \xdef\thischapter{\putwordAppendix{} \appendixletter:
4391 \noexpand\thischaptername}%
4392 \else 5184 \else
4393 \setbox0 = \hbox{#3\enspace}% 5185 \setbox0 = \hbox{#3\enspace}%
4394 \def\toctype{numchap}% 5186 \def\toctype{numchap}%
4395 \xdef\thischapter{\putwordChapter{} \the\chapno:
4396 \noexpand\thischaptername}%
4397 \fi\fi\fi 5187 \fi\fi\fi
4398 % 5188 %
4399 % Write the toc entry for this chapter. Must come before the 5189 % Write the toc entry for this chapter. Must come before the
@@ -4409,6 +5199,7 @@ where each line of input produces a line of output.}
4409 \donoderef{#2}% 5199 \donoderef{#2}%
4410 % 5200 %
4411 % Typeset the actual heading. 5201 % Typeset the actual heading.
5202 \nobreak % Avoid page breaks at the interline glue.
4412 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright 5203 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
4413 \hangindent=\wd0 \centerparametersmaybe 5204 \hangindent=\wd0 \centerparametersmaybe
4414 \unhbox0 #1\par}% 5205 \unhbox0 #1\par}%
@@ -4471,45 +5262,95 @@ where each line of input produces a line of output.}
4471% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the 5262% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
4472% section number. 5263% section number.
4473% 5264%
5265\def\seckeyword{sec}
5266%
4474\def\sectionheading#1#2#3#4{% 5267\def\sectionheading#1#2#3#4{%
4475 {% 5268 {%
4476 % Switch to the right set of fonts. 5269 % Switch to the right set of fonts.
4477 \csname #2fonts\endcsname \rm 5270 \csname #2fonts\endcsname \rm
4478 % 5271 %
5272 \def\sectionlevel{#2}%
5273 \def\temptype{#3}%
5274 %
5275 % Insert first mark before the heading break (see notes for \domark).
5276 \let\prevsectiondefs=\lastsectiondefs
5277 \ifx\temptype\Ynothingkeyword
5278 \ifx\sectionlevel\seckeyword
5279 \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
5280 \gdef\thissection{\thissectionname}}%
5281 \fi
5282 \else\ifx\temptype\Yomitfromtockeyword
5283 % Don't redefine \thissection.
5284 \else\ifx\temptype\Yappendixkeyword
5285 \ifx\sectionlevel\seckeyword
5286 \toks0={#1}%
5287 \xdef\lastsectiondefs{%
5288 \gdef\noexpand\thissectionname{\the\toks0}%
5289 \gdef\noexpand\thissectionnum{#4}%
5290 \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
5291 \noexpand\thissectionname}%
5292 }%
5293 \fi
5294 \else
5295 \ifx\sectionlevel\seckeyword
5296 \toks0={#1}%
5297 \xdef\lastsectiondefs{%
5298 \gdef\noexpand\thissectionname{\the\toks0}%
5299 \gdef\noexpand\thissectionnum{#4}%
5300 \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
5301 \noexpand\thissectionname}%
5302 }%
5303 \fi
5304 \fi\fi\fi
5305 %
5306 % Output the mark. Pass it through \safewhatsit, to take care of
5307 % the preceding space.
5308 \safewhatsit\domark
5309 %
4479 % Insert space above the heading. 5310 % Insert space above the heading.
4480 \csname #2headingbreak\endcsname 5311 \csname #2headingbreak\endcsname
4481 % 5312 %
4482 % Only insert the space after the number if we have a section number. 5313 % Now the second mark, after the heading break. No break points
4483 \def\sectionlevel{#2}% 5314 % between here and the heading.
4484 \def\temptype{#3}% 5315 \let\prevsectiondefs=\lastsectiondefs
5316 \domark
4485 % 5317 %
5318 % Only insert the space after the number if we have a section number.
4486 \ifx\temptype\Ynothingkeyword 5319 \ifx\temptype\Ynothingkeyword
4487 \setbox0 = \hbox{}% 5320 \setbox0 = \hbox{}%
4488 \def\toctype{unn}% 5321 \def\toctype{unn}%
4489 \gdef\thissection{#1}% 5322 \gdef\lastsection{#1}%
4490 \else\ifx\temptype\Yomitfromtockeyword 5323 \else\ifx\temptype\Yomitfromtockeyword
4491 % for @headings -- no section number, don't include in toc, 5324 % for @headings -- no section number, don't include in toc,
4492 % and don't redefine \thissection. 5325 % and don't redefine \lastsection.
4493 \setbox0 = \hbox{}% 5326 \setbox0 = \hbox{}%
4494 \def\toctype{omit}% 5327 \def\toctype{omit}%
4495 \let\sectionlevel=\empty 5328 \let\sectionlevel=\empty
4496 \else\ifx\temptype\Yappendixkeyword 5329 \else\ifx\temptype\Yappendixkeyword
4497 \setbox0 = \hbox{#4\enspace}% 5330 \setbox0 = \hbox{#4\enspace}%
4498 \def\toctype{app}% 5331 \def\toctype{app}%
4499 \gdef\thissection{#1}% 5332 \gdef\lastsection{#1}%
4500 \else 5333 \else
4501 \setbox0 = \hbox{#4\enspace}% 5334 \setbox0 = \hbox{#4\enspace}%
4502 \def\toctype{num}% 5335 \def\toctype{num}%
4503 \gdef\thissection{#1}% 5336 \gdef\lastsection{#1}%
4504 \fi\fi\fi 5337 \fi\fi\fi
4505 % 5338 %
4506 % Write the toc entry (before \donoderef). See comments in \chfplain. 5339 % Write the toc entry (before \donoderef). See comments in \chapmacro.
4507 \writetocentry{\toctype\sectionlevel}{#1}{#4}% 5340 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
4508 % 5341 %
4509 % Write the node reference (= pdf destination for pdftex). 5342 % Write the node reference (= pdf destination for pdftex).
4510 % Again, see comments in \chfplain. 5343 % Again, see comments in \chapmacro.
4511 \donoderef{#3}% 5344 \donoderef{#3}%
4512 % 5345 %
5346 % Interline glue will be inserted when the vbox is completed.
5347 % That glue will be a valid breakpoint for the page, since it'll be
5348 % preceded by a whatsit (usually from the \donoderef, or from the
5349 % \writetocentry if there was no node). We don't want to allow that
5350 % break, since then the whatsits could end up on page n while the
5351 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
5352 \nobreak
5353 %
4513 % Output the actual section heading. 5354 % Output the actual section heading.
4514 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright 5355 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
4515 \hangindent=\wd0 % zero if no section number 5356 \hangindent=\wd0 % zero if no section number
@@ -4572,7 +5413,7 @@ where each line of input produces a line of output.}
4572 \edef\temp{% 5413 \edef\temp{%
4573 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% 5414 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
4574 \temp 5415 \temp
4575 } 5416 }%
4576 \fi 5417 \fi
4577 \fi 5418 \fi
4578 % 5419 %
@@ -4607,7 +5448,7 @@ where each line of input produces a line of output.}
4607\def\readtocfile{% 5448\def\readtocfile{%
4608 \setupdatafile 5449 \setupdatafile
4609 \activecatcodes 5450 \activecatcodes
4610 \input \jobname.toc 5451 \input \tocreadfilename
4611} 5452}
4612 5453
4613\newskip\contentsrightmargin \contentsrightmargin=1in 5454\newskip\contentsrightmargin \contentsrightmargin=1in
@@ -4626,7 +5467,6 @@ where each line of input produces a line of output.}
4626 % 5467 %
4627 % Don't need to put `Contents' or `Short Contents' in the headline. 5468 % Don't need to put `Contents' or `Short Contents' in the headline.
4628 % It is abundantly clear what they are. 5469 % It is abundantly clear what they are.
4629 \def\thischapter{}%
4630 \chapmacro{#1}{Yomitfromtoc}{}% 5470 \chapmacro{#1}{Yomitfromtoc}{}%
4631 % 5471 %
4632 \savepageno = \pageno 5472 \savepageno = \pageno
@@ -4638,11 +5478,16 @@ where each line of input produces a line of output.}
4638 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi 5478 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
4639} 5479}
4640 5480
5481% redefined for the two-volume lispref. We always output on
5482% \jobname.toc even if this is redefined.
5483%
5484\def\tocreadfilename{\jobname.toc}
4641 5485
4642% Normal (long) toc. 5486% Normal (long) toc.
5487%
4643\def\contents{% 5488\def\contents{%
4644 \startcontents{\putwordTOC}% 5489 \startcontents{\putwordTOC}%
4645 \openin 1 \jobname.toc 5490 \openin 1 \tocreadfilename\space
4646 \ifeof 1 \else 5491 \ifeof 1 \else
4647 \readtocfile 5492 \readtocfile
4648 \fi 5493 \fi
@@ -4680,7 +5525,7 @@ where each line of input produces a line of output.}
4680 \let\numsubsubsecentry = \numsecentry 5525 \let\numsubsubsecentry = \numsecentry
4681 \let\appsubsubsecentry = \numsecentry 5526 \let\appsubsubsecentry = \numsecentry
4682 \let\unnsubsubsecentry = \numsecentry 5527 \let\unnsubsubsecentry = \numsecentry
4683 \openin 1 \jobname.toc 5528 \openin 1 \tocreadfilename\space
4684 \ifeof 1 \else 5529 \ifeof 1 \else
4685 \readtocfile 5530 \readtocfile
4686 \fi 5531 \fi
@@ -4824,7 +5669,7 @@ where each line of input produces a line of output.}
4824{\tentt \global\dimen0 = 3em}% Width of the box. 5669{\tentt \global\dimen0 = 3em}% Width of the box.
4825\dimen2 = .55pt % Thickness of rules 5670\dimen2 = .55pt % Thickness of rules
4826% The text. (`r' is open on the right, `e' somewhat less so on the left.) 5671% The text. (`r' is open on the right, `e' somewhat less so on the left.)
4827\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} 5672\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
4828% 5673%
4829\setbox\errorbox=\hbox to \dimen0{\hfil 5674\setbox\errorbox=\hbox to \dimen0{\hfil
4830 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. 5675 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -5015,12 +5860,18 @@ where each line of input produces a line of output.}
5015\let\SETdispenvsize\relax 5860\let\SETdispenvsize\relax
5016\def\setnormaldispenv{% 5861\def\setnormaldispenv{%
5017 \ifx\SETdispenvsize\smallword 5862 \ifx\SETdispenvsize\smallword
5863 % end paragraph for sake of leading, in case document has no blank
5864 % line. This is redundant with what happens in \aboveenvbreak, but
5865 % we need to do it before changing the fonts, and it's inconvenient
5866 % to change the fonts afterward.
5867 \ifnum \lastpenalty=10000 \else \endgraf \fi
5018 \smallexamplefonts \rm 5868 \smallexamplefonts \rm
5019 \fi 5869 \fi
5020} 5870}
5021\def\setsmalldispenv{% 5871\def\setsmalldispenv{%
5022 \ifx\SETdispenvsize\nosmallword 5872 \ifx\SETdispenvsize\nosmallword
5023 \else 5873 \else
5874 \ifnum \lastpenalty=10000 \else \endgraf \fi
5024 \smallexamplefonts \rm 5875 \smallexamplefonts \rm
5025 \fi 5876 \fi
5026} 5877}
@@ -5047,11 +5898,10 @@ where each line of input produces a line of output.}
5047% 5898%
5048\maketwodispenvs {lisp}{example}{% 5899\maketwodispenvs {lisp}{example}{%
5049 \nonfillstart 5900 \nonfillstart
5050 \tt 5901 \tt\quoteexpand
5051 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. 5902 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
5052 \gobble % eat return 5903 \gobble % eat return
5053} 5904}
5054
5055% @display/@smalldisplay: same as @lisp except keep current font. 5905% @display/@smalldisplay: same as @lisp except keep current font.
5056% 5906%
5057\makedispenv {display}{% 5907\makedispenv {display}{%
@@ -5179,6 +6029,34 @@ where each line of input produces a line of output.}
5179\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount 6029\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
5180% 6030%
5181\def\starttabbox{\setbox0=\hbox\bgroup} 6031\def\starttabbox{\setbox0=\hbox\bgroup}
6032
6033% Allow an option to not replace quotes with a regular directed right
6034% quote/apostrophe (char 0x27), but instead use the undirected quote
6035% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
6036% the default, but it works for pasting with more pdf viewers (at least
6037% evince), the lilypond developers report. xpdf does work with the
6038% regular 0x27.
6039%
6040\def\codequoteright{%
6041 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
6042 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
6043 '%
6044 \else \char'15 \fi
6045 \else \char'15 \fi
6046}
6047%
6048% and a similar option for the left quote char vs. a grave accent.
6049% Modern fonts display ASCII 0x60 as a grave accent, so some people like
6050% the code environments to do likewise.
6051%
6052\def\codequoteleft{%
6053 \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
6054 \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
6055 `%
6056 \else \char'22 \fi
6057 \else \char'22 \fi
6058}
6059%
5182\begingroup 6060\begingroup
5183 \catcode`\^^I=\active 6061 \catcode`\^^I=\active
5184 \gdef\tabexpand{% 6062 \gdef\tabexpand{%
@@ -5191,7 +6069,16 @@ where each line of input produces a line of output.}
5191 \wd0=\dimen0 \box0 \starttabbox 6069 \wd0=\dimen0 \box0 \starttabbox
5192 }% 6070 }%
5193 } 6071 }
6072 \catcode`\'=\active
6073 \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}%
6074 %
6075 \catcode`\`=\active
6076 \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}%
6077 %
6078 \gdef\quoteexpand{\rquoteexpand \lquoteexpand}%
5194\endgroup 6079\endgroup
6080
6081% start the verbatim environment.
5195\def\setupverbatim{% 6082\def\setupverbatim{%
5196 \let\nonarrowing = t% 6083 \let\nonarrowing = t%
5197 \nonfillstart 6084 \nonfillstart
@@ -5200,6 +6087,7 @@ where each line of input produces a line of output.}
5200 \def\par{\leavevmode\egroup\box0\endgraf}% 6087 \def\par{\leavevmode\egroup\box0\endgraf}%
5201 \catcode`\`=\active 6088 \catcode`\`=\active
5202 \tabexpand 6089 \tabexpand
6090 \quoteexpand
5203 % Respect line breaks, 6091 % Respect line breaks,
5204 % print special symbols as themselves, and 6092 % print special symbols as themselves, and
5205 % make each space count 6093 % make each space count
@@ -5284,27 +6172,35 @@ where each line of input produces a line of output.}
5284 \endgroup 6172 \endgroup
5285} 6173}
5286 6174
6175
5287\message{defuns,} 6176\message{defuns,}
5288% @defun etc. 6177% @defun etc.
5289 6178
5290\newskip\defbodyindent \defbodyindent=.4in 6179\newskip\defbodyindent \defbodyindent=.4in
5291\newskip\defargsindent \defargsindent=50pt 6180\newskip\defargsindent \defargsindent=50pt
5292\newskip\deflastargmargin \deflastargmargin=18pt 6181\newskip\deflastargmargin \deflastargmargin=18pt
6182\newcount\defunpenalty
5293 6183
5294% Start the processing of @deffn: 6184% Start the processing of @deffn:
5295\def\startdefun{% 6185\def\startdefun{%
5296 \ifnum\lastpenalty<10000 6186 \ifnum\lastpenalty<10000
5297 \medbreak 6187 \medbreak
6188 \defunpenalty=10003 % Will keep this @deffn together with the
6189 % following @def command, see below.
5298 \else 6190 \else
5299 % If there are two @def commands in a row, we'll have a \nobreak, 6191 % If there are two @def commands in a row, we'll have a \nobreak,
5300 % which is there to keep the function description together with its 6192 % which is there to keep the function description together with its
5301 % header. But if there's nothing but headers, we need to allow a 6193 % header. But if there's nothing but headers, we need to allow a
5302 % break somewhere. Check specifically for penalty 10002, inserted 6194 % break somewhere. Check specifically for penalty 10002, inserted
5303 % by \defargscommonending, instead of 10000, since the sectioning 6195 % by \printdefunline, instead of 10000, since the sectioning
5304 % commands also insert a nobreak penalty, and we don't want to allow 6196 % commands also insert a nobreak penalty, and we don't want to allow
5305 % a break between a section heading and a defun. 6197 % a break between a section heading and a defun.
5306 % 6198 %
5307 \ifnum\lastpenalty=10002 \penalty2000 \fi 6199 % As a minor refinement, we avoid "club" headers by signalling
6200 % with penalty of 10003 after the very first @deffn in the
6201 % sequence (see above), and penalty of 10002 after any following
6202 % @def command.
6203 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
5308 % 6204 %
5309 % Similarly, after a section heading, do not allow a break. 6205 % Similarly, after a section heading, do not allow a break.
5310 % But do insert the glue. 6206 % But do insert the glue.
@@ -5322,7 +6218,7 @@ where each line of input produces a line of output.}
5322 % 6218 %
5323 % As above, allow line break if we have multiple x headers in a row. 6219 % As above, allow line break if we have multiple x headers in a row.
5324 % It's not a great place, though. 6220 % It's not a great place, though.
5325 \ifnum\lastpenalty=10002 \penalty3000 \fi 6221 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
5326 % 6222 %
5327 % And now, it's time to reuse the body of the original defun: 6223 % And now, it's time to reuse the body of the original defun:
5328 \expandafter\gobbledefun#1% 6224 \expandafter\gobbledefun#1%
@@ -5340,7 +6236,7 @@ where each line of input produces a line of output.}
5340 \advance\rightskip by 0pt plus 1fil 6236 \advance\rightskip by 0pt plus 1fil
5341 \endgraf 6237 \endgraf
5342 \nobreak\vskip -\parskip 6238 \nobreak\vskip -\parskip
5343 \penalty 10002 % signal to \startdefun and \dodefunx 6239 \penalty\defunpenalty % signal to \startdefun and \dodefunx
5344 % Some of the @defun-type tags do not enable magic parentheses, 6240 % Some of the @defun-type tags do not enable magic parentheses,
5345 % rendering the following check redundant. But we don't optimize. 6241 % rendering the following check redundant. But we don't optimize.
5346 \checkparencounts 6242 \checkparencounts
@@ -5609,12 +6505,14 @@ where each line of input produces a line of output.}
5609 \ifnum\parencount=0 \else \badparencount \fi 6505 \ifnum\parencount=0 \else \badparencount \fi
5610 \ifnum\brackcount=0 \else \badbrackcount \fi 6506 \ifnum\brackcount=0 \else \badbrackcount \fi
5611} 6507}
6508% these should not use \errmessage; the glibc manual, at least, actually
6509% has such constructs (when documenting function pointers).
5612\def\badparencount{% 6510\def\badparencount{%
5613 \errmessage{Unbalanced parentheses in @def}% 6511 \message{Warning: unbalanced parentheses in @def...}%
5614 \global\parencount=0 6512 \global\parencount=0
5615} 6513}
5616\def\badbrackcount{% 6514\def\badbrackcount{%
5617 \errmessage{Unbalanced square braces in @def}% 6515 \message{Warning: unbalanced square brackets in @def...}%
5618 \global\brackcount=0 6516 \global\brackcount=0
5619} 6517}
5620 6518
@@ -5649,7 +6547,6 @@ where each line of input produces a line of output.}
5649 \spaceisspace 6547 \spaceisspace
5650 % 6548 %
5651 % Append \endinput to make sure that TeX does not see the ending newline. 6549 % Append \endinput to make sure that TeX does not see the ending newline.
5652 %
5653 % I've verified that it is necessary both for e-TeX and for ordinary TeX 6550 % I've verified that it is necessary both for e-TeX and for ordinary TeX
5654 % --kasal, 29nov03 6551 % --kasal, 29nov03
5655 \scantokens{#1\endinput}% 6552 \scantokens{#1\endinput}%
@@ -5710,6 +6607,10 @@ where each line of input produces a line of output.}
5710% all characters are catcode 10, 11 or 12, except \ which is active 6607% all characters are catcode 10, 11 or 12, except \ which is active
5711% (as in normal texinfo). It is necessary to change the definition of \. 6608% (as in normal texinfo). It is necessary to change the definition of \.
5712 6609
6610% Non-ASCII encodings make 8-bit characters active, so un-activate
6611% them to avoid their expansion. Must do this non-globally, to
6612% confine the change to the current group.
6613
5713% It's necessary to have hard CRs when the macro is executed. This is 6614% It's necessary to have hard CRs when the macro is executed. This is
5714% done by making ^^M (\endlinechar) catcode 12 when reading the macro 6615% done by making ^^M (\endlinechar) catcode 12 when reading the macro
5715% body, and then making it the \newlinechar in \scanmacro. 6616% body, and then making it the \newlinechar in \scanmacro.
@@ -5724,6 +6625,7 @@ where each line of input produces a line of output.}
5724 \catcode`\_=\other 6625 \catcode`\_=\other
5725 \catcode`\|=\other 6626 \catcode`\|=\other
5726 \catcode`\~=\other 6627 \catcode`\~=\other
6628 \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
5727} 6629}
5728 6630
5729\def\scanargctxt{% 6631\def\scanargctxt{%
@@ -5916,11 +6818,11 @@ where each line of input produces a line of output.}
5916% {. If so it reads up to the closing }, if not, it reads the whole 6818% {. If so it reads up to the closing }, if not, it reads the whole
5917% line. Whatever was read is then fed to the next control sequence 6819% line. Whatever was read is then fed to the next control sequence
5918% as an argument (by \parsebrace or \parsearg) 6820% as an argument (by \parsebrace or \parsearg)
5919\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} 6821\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
5920\def\braceorlinexxx{% 6822\def\braceorlinexxx{%
5921 \ifx\nchar\bgroup\else 6823 \ifx\nchar\bgroup\else
5922 \expandafter\parsearg 6824 \expandafter\parsearg
5923 \fi \next} 6825 \fi \macnamexxx}
5924 6826
5925 6827
5926% @alias. 6828% @alias.
@@ -5941,7 +6843,6 @@ where each line of input produces a line of output.}
5941\message{cross references,} 6843\message{cross references,}
5942 6844
5943\newwrite\auxfile 6845\newwrite\auxfile
5944
5945\newif\ifhavexrefs % True if xref values are known. 6846\newif\ifhavexrefs % True if xref values are known.
5946\newif\ifwarnedxrefs % True if we warned once that they aren't known. 6847\newif\ifwarnedxrefs % True if we warned once that they aren't known.
5947 6848
@@ -5986,7 +6887,7 @@ where each line of input produces a line of output.}
5986 6887
5987% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an 6888% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
5988% anchor), which consists of three parts: 6889% anchor), which consists of three parts:
5989% 1) NAME-title - the current sectioning name taken from \thissection, 6890% 1) NAME-title - the current sectioning name taken from \lastsection,
5990% or the anchor name. 6891% or the anchor name.
5991% 2) NAME-snt - section number and type, passed as the SNT arg, or 6892% 2) NAME-snt - section number and type, passed as the SNT arg, or
5992% empty for anchors. 6893% empty for anchors.
@@ -6005,10 +6906,10 @@ where each line of input produces a line of output.}
6005 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef 6906 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
6006 ##1}{##2}}% these are parameters of \writexrdef 6907 ##1}{##2}}% these are parameters of \writexrdef
6007 }% 6908 }%
6008 \toks0 = \expandafter{\thissection}% 6909 \toks0 = \expandafter{\lastsection}%
6009 \immediate \writexrdef{title}{\the\toks0 }% 6910 \immediate \writexrdef{title}{\the\toks0 }%
6010 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. 6911 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
6011 \writexrdef{pg}{\folio}% will be written later, during \shipout 6912 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
6012 }% 6913 }%
6013 \fi 6914 \fi
6014} 6915}
@@ -6054,7 +6955,8 @@ where each line of input produces a line of output.}
6054 \ifpdf 6955 \ifpdf
6055 \leavevmode 6956 \leavevmode
6056 \getfilename{#4}% 6957 \getfilename{#4}%
6057 {\turnoffactive 6958 {\indexnofonts
6959 \turnoffactive
6058 % See comments at \activebackslashdouble. 6960 % See comments at \activebackslashdouble.
6059 {\activebackslashdouble \xdef\pdfxrefdest{#1}% 6961 {\activebackslashdouble \xdef\pdfxrefdest{#1}%
6060 \backslashparens\pdfxrefdest}% 6962 \backslashparens\pdfxrefdest}%
@@ -6067,7 +6969,7 @@ where each line of input produces a line of output.}
6067 goto name{\pdfmkpgn{\pdfxrefdest}}% 6969 goto name{\pdfmkpgn{\pdfxrefdest}}%
6068 \fi 6970 \fi
6069 }% 6971 }%
6070 \linkcolor 6972 \setcolor{\linkcolor}%
6071 \fi 6973 \fi
6072 % 6974 %
6073 % Float references are printed completely differently: "Figure 1.2" 6975 % Float references are printed completely differently: "Figure 1.2"
@@ -6085,7 +6987,7 @@ where each line of input produces a line of output.}
6085 % If the user specified the print name (third arg) to the ref, 6987 % If the user specified the print name (third arg) to the ref,
6086 % print it instead of our usual "Figure 1.2". 6988 % print it instead of our usual "Figure 1.2".
6087 \ifdim\wd0 = 0pt 6989 \ifdim\wd0 = 0pt
6088 \refx{#1-snt}% 6990 \refx{#1-snt}{}%
6089 \else 6991 \else
6090 \printedrefname 6992 \printedrefname
6091 \fi 6993 \fi
@@ -6105,7 +7007,7 @@ where each line of input produces a line of output.}
6105 % is a loss. Therefore, we give the text of the node name again, so it 7007 % is a loss. Therefore, we give the text of the node name again, so it
6106 % is as if TeX is seeing it for the first time. 7008 % is as if TeX is seeing it for the first time.
6107 \ifdim \wd1 > 0pt 7009 \ifdim \wd1 > 0pt
6108 \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% 7010 \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
6109 \else 7011 \else
6110 % _ (for example) has to be the character _ for the purposes of the 7012 % _ (for example) has to be the character _ for the purposes of the
6111 % control sequence corresponding to the node, but it has to expand 7013 % control sequence corresponding to the node, but it has to expand
@@ -6201,10 +7103,18 @@ where each line of input produces a line of output.}
6201% collisions). But if this is a float type, we have more work to do. 7103% collisions). But if this is a float type, we have more work to do.
6202% 7104%
6203\def\xrdef#1#2{% 7105\def\xrdef#1#2{%
6204 \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. 7106 {% The node name might contain 8-bit characters, which in our current
7107 % implementation are changed to commands like @'e. Don't let these
7108 % mess up the control sequence name.
7109 \indexnofonts
7110 \turnoffactive
7111 \xdef\safexrefname{#1}%
7112 }%
7113 %
7114 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
6205 % 7115 %
6206 % Was that xref control sequence that we just defined for a float? 7116 % Was that xref control sequence that we just defined for a float?
6207 \expandafter\iffloat\csname XR#1\endcsname 7117 \expandafter\iffloat\csname XR\safexrefname\endcsname
6208 % it was a float, and we have the (safe) float type in \iffloattype. 7118 % it was a float, and we have the (safe) float type in \iffloattype.
6209 \expandafter\let\expandafter\floatlist 7119 \expandafter\let\expandafter\floatlist
6210 \csname floatlist\iffloattype\endcsname 7120 \csname floatlist\iffloattype\endcsname
@@ -6219,7 +7129,8 @@ where each line of input produces a line of output.}
6219 % 7129 %
6220 % Remember this xref in the control sequence \floatlistFLOATTYPE, 7130 % Remember this xref in the control sequence \floatlistFLOATTYPE,
6221 % for later use in \listoffloats. 7131 % for later use in \listoffloats.
6222 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% 7132 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
7133 {\safexrefname}}%
6223 \fi 7134 \fi
6224} 7135}
6225 7136
@@ -6323,6 +7234,7 @@ where each line of input produces a line of output.}
6323 \input\jobname.#1 7234 \input\jobname.#1
6324\endgroup} 7235\endgroup}
6325 7236
7237
6326\message{insertions,} 7238\message{insertions,}
6327% including footnotes. 7239% including footnotes.
6328 7240
@@ -6515,7 +7427,7 @@ where each line of input produces a line of output.}
6515 % above and below. 7427 % above and below.
6516 \nobreak\vskip\parskip 7428 \nobreak\vskip\parskip
6517 \nobreak 7429 \nobreak
6518 \line\bgroup\hss 7430 \line\bgroup
6519 \fi 7431 \fi
6520 % 7432 %
6521 % Output the image. 7433 % Output the image.
@@ -6528,7 +7440,7 @@ where each line of input produces a line of output.}
6528 \epsfbox{#1.eps}% 7440 \epsfbox{#1.eps}%
6529 \fi 7441 \fi
6530 % 7442 %
6531 \ifimagevmode \hss \egroup \bigbreak \fi % space after the image 7443 \ifimagevmode \egroup \bigbreak \fi % space after the image
6532\endgroup} 7444\endgroup}
6533 7445
6534 7446
@@ -6595,13 +7507,13 @@ where each line of input produces a line of output.}
6595 \global\advance\floatno by 1 7507 \global\advance\floatno by 1
6596 % 7508 %
6597 {% 7509 {%
6598 % This magic value for \thissection is output by \setref as the 7510 % This magic value for \lastsection is output by \setref as the
6599 % XREFLABEL-title value. \xrefX uses it to distinguish float 7511 % XREFLABEL-title value. \xrefX uses it to distinguish float
6600 % labels (which have a completely different output format) from 7512 % labels (which have a completely different output format) from
6601 % node and anchor labels. And \xrdef uses it to construct the 7513 % node and anchor labels. And \xrdef uses it to construct the
6602 % lists of floats. 7514 % lists of floats.
6603 % 7515 %
6604 \edef\thissection{\floatmagic=\safefloattype}% 7516 \edef\lastsection{\floatmagic=\safefloattype}%
6605 \setref{\floatlabel}{Yfloat}% 7517 \setref{\floatlabel}{Yfloat}%
6606 }% 7518 }%
6607 \fi 7519 \fi
@@ -6669,6 +7581,7 @@ where each line of input produces a line of output.}
6669 % caption if specified, else the full caption if specified, else nothing. 7581 % caption if specified, else the full caption if specified, else nothing.
6670 {% 7582 {%
6671 \atdummies 7583 \atdummies
7584 %
6672 % since we read the caption text in the macro world, where ^^M 7585 % since we read the caption text in the macro world, where ^^M
6673 % is turned into a normal character, we have to scan it back, so 7586 % is turned into a normal character, we have to scan it back, so
6674 % we don't write the literal three characters "^^M" into the aux file. 7587 % we don't write the literal three characters "^^M" into the aux file.
@@ -6689,8 +7602,9 @@ where each line of input produces a line of output.}
6689 % 7602 %
6690 % place the captured inserts 7603 % place the captured inserts
6691 % 7604 %
6692 % BEWARE: when the floats start float, we have to issue warning whenever an 7605 % BEWARE: when the floats start floating, we have to issue warning
6693 % insert appears inside a float which could possibly float. --kasal, 26may04 7606 % whenever an insert appears inside a float which could possibly
7607 % float. --kasal, 26may04
6694 % 7608 %
6695 \checkinserts 7609 \checkinserts
6696} 7610}
@@ -6734,7 +7648,7 @@ where each line of input produces a line of output.}
6734 7648
6735% #1 is the control sequence we are passed; we expand into a conditional 7649% #1 is the control sequence we are passed; we expand into a conditional
6736% which is true if #1 represents a float ref. That is, the magic 7650% which is true if #1 represents a float ref. That is, the magic
6737% \thissection value which we \setref above. 7651% \lastsection value which we \setref above.
6738% 7652%
6739\def\iffloat#1{\expandafter\doiffloat#1==\finish} 7653\def\iffloat#1{\expandafter\doiffloat#1==\finish}
6740% 7654%
@@ -6795,39 +7709,871 @@ where each line of input produces a line of output.}
6795 \writeentry 7709 \writeentry
6796}} 7710}}
6797 7711
7712
6798\message{localization,} 7713\message{localization,}
6799% and i18n.
6800 7714
6801% @documentlanguage is usually given very early, just after 7715% @documentlanguage is usually given very early, just after
6802% @setfilename. If done too late, it may not override everything 7716% @setfilename. If done too late, it may not override everything
6803% properly. Single argument is the language abbreviation. 7717% properly. Single argument is the language (de) or locale (de_DE)
6804% It would be nice if we could set up a hyphenation file here. 7718% abbreviation. It would be nice if we could set up a hyphenation file.
6805% 7719%
6806\parseargdef\documentlanguage{% 7720{
7721 \catcode`\_ = \active
7722 \globaldefs=1
7723\parseargdef\documentlanguage{\begingroup
7724 \let_=\normalunderscore % normal _ character for filenames
6807 \tex % read txi-??.tex file in plain TeX. 7725 \tex % read txi-??.tex file in plain TeX.
6808 % Read the file if it exists. 7726 % Read the file by the name they passed if it exists.
6809 \openin 1 txi-#1.tex 7727 \openin 1 txi-#1.tex
6810 \ifeof 1 7728 \ifeof 1
6811 \errhelp = \nolanghelp 7729 \documentlanguagetrywithoutunderscore{#1_\finish}%
6812 \errmessage{Cannot read language file txi-#1.tex}%
6813 \else 7730 \else
6814 \input txi-#1.tex 7731 \input txi-#1.tex
6815 \fi 7732 \fi
6816 \closein 1 7733 \closein 1
6817 \endgroup 7734 \endgroup
7735\endgroup}
7736}
7737%
7738% If they passed de_DE, and txi-de_DE.tex doesn't exist,
7739% try txi-de.tex.
7740%
7741\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
7742 \openin 1 txi-#1.tex
7743 \ifeof 1
7744 \errhelp = \nolanghelp
7745 \errmessage{Cannot read language file txi-#1.tex}%
7746 \else
7747 \input txi-#1.tex
7748 \fi
7749 \closein 1
6818} 7750}
7751%
6819\newhelp\nolanghelp{The given language definition file cannot be found or 7752\newhelp\nolanghelp{The given language definition file cannot be found or
6820is empty. Maybe you need to install it? In the current directory 7753is empty. Maybe you need to install it? In the current directory
6821should work if nowhere else does.} 7754should work if nowhere else does.}
6822 7755
7756% Set the catcode of characters 128 through 255 to the specified number.
7757%
7758\def\setnonasciicharscatcode#1{%
7759 \count255=128
7760 \loop\ifnum\count255<256
7761 \global\catcode\count255=#1\relax
7762 \advance\count255 by 1
7763 \repeat
7764}
6823 7765
6824% @documentencoding should change something in TeX eventually, most 7766\def\setnonasciicharscatcodenonglobal#1{%
6825% likely, but for now just recognize it. 7767 \count255=128
6826\let\documentencoding = \comment 7768 \loop\ifnum\count255<256
7769 \catcode\count255=#1\relax
7770 \advance\count255 by 1
7771 \repeat
7772}
6827 7773
7774% @documentencoding sets the definition of non-ASCII characters
7775% according to the specified encoding.
7776%
7777\parseargdef\documentencoding{%
7778 % Encoding being declared for the document.
7779 \def\declaredencoding{\csname #1.enc\endcsname}%
7780 %
7781 % Supported encodings: names converted to tokens in order to be able
7782 % to compare them with \ifx.
7783 \def\ascii{\csname US-ASCII.enc\endcsname}%
7784 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
7785 \def\latone{\csname ISO-8859-1.enc\endcsname}%
7786 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
7787 \def\utfeight{\csname UTF-8.enc\endcsname}%
7788 %
7789 \ifx \declaredencoding \ascii
7790 \asciichardefs
7791 %
7792 \else \ifx \declaredencoding \lattwo
7793 \setnonasciicharscatcode\active
7794 \lattwochardefs
7795 %
7796 \else \ifx \declaredencoding \latone
7797 \setnonasciicharscatcode\active
7798 \latonechardefs
7799 %
7800 \else \ifx \declaredencoding \latnine
7801 \setnonasciicharscatcode\active
7802 \latninechardefs
7803 %
7804 \else \ifx \declaredencoding \utfeight
7805 \setnonasciicharscatcode\active
7806 \utfeightchardefs
7807 %
7808 \else
7809 \message{Unknown document encoding #1, ignoring.}%
7810 %
7811 \fi % utfeight
7812 \fi % latnine
7813 \fi % latone
7814 \fi % lattwo
7815 \fi % ascii
7816}
7817
7818% A message to be logged when using a character that isn't available
7819% the default font encoding (OT1).
7820%
7821\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
7822
7823% Take account of \c (plain) vs. \, (Texinfo) difference.
7824\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
7825
7826% First, make active non-ASCII characters in order for them to be
7827% correctly categorized when TeX reads the replacement text of
7828% macros containing the character definitions.
7829\setnonasciicharscatcode\active
7830%
7831% Latin1 (ISO-8859-1) character definitions.
7832\def\latonechardefs{%
7833 \gdef^^a0{~}
7834 \gdef^^a1{\exclamdown}
7835 \gdef^^a2{\missingcharmsg{CENT SIGN}}
7836 \gdef^^a3{{\pounds}}
7837 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
7838 \gdef^^a5{\missingcharmsg{YEN SIGN}}
7839 \gdef^^a6{\missingcharmsg{BROKEN BAR}}
7840 \gdef^^a7{\S}
7841 \gdef^^a8{\"{}}
7842 \gdef^^a9{\copyright}
7843 \gdef^^aa{\ordf}
7844 \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}}
7845 \gdef^^ac{$\lnot$}
7846 \gdef^^ad{\-}
7847 \gdef^^ae{\registeredsymbol}
7848 \gdef^^af{\={}}
7849 %
7850 \gdef^^b0{\textdegree}
7851 \gdef^^b1{$\pm$}
7852 \gdef^^b2{$^2$}
7853 \gdef^^b3{$^3$}
7854 \gdef^^b4{\'{}}
7855 \gdef^^b5{$\mu$}
7856 \gdef^^b6{\P}
7857 %
7858 \gdef^^b7{$^.$}
7859 \gdef^^b8{\cedilla\ }
7860 \gdef^^b9{$^1$}
7861 \gdef^^ba{\ordm}
7862 %
7863 \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}}
7864 \gdef^^bc{$1\over4$}
7865 \gdef^^bd{$1\over2$}
7866 \gdef^^be{$3\over4$}
7867 \gdef^^bf{\questiondown}
7868 %
7869 \gdef^^c0{\`A}
7870 \gdef^^c1{\'A}
7871 \gdef^^c2{\^A}
7872 \gdef^^c3{\~A}
7873 \gdef^^c4{\"A}
7874 \gdef^^c5{\ringaccent A}
7875 \gdef^^c6{\AE}
7876 \gdef^^c7{\cedilla C}
7877 \gdef^^c8{\`E}
7878 \gdef^^c9{\'E}
7879 \gdef^^ca{\^E}
7880 \gdef^^cb{\"E}
7881 \gdef^^cc{\`I}
7882 \gdef^^cd{\'I}
7883 \gdef^^ce{\^I}
7884 \gdef^^cf{\"I}
7885 %
7886 \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}}
7887 \gdef^^d1{\~N}
7888 \gdef^^d2{\`O}
7889 \gdef^^d3{\'O}
7890 \gdef^^d4{\^O}
7891 \gdef^^d5{\~O}
7892 \gdef^^d6{\"O}
7893 \gdef^^d7{$\times$}
7894 \gdef^^d8{\O}
7895 \gdef^^d9{\`U}
7896 \gdef^^da{\'U}
7897 \gdef^^db{\^U}
7898 \gdef^^dc{\"U}
7899 \gdef^^dd{\'Y}
7900 \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}}
7901 \gdef^^df{\ss}
7902 %
7903 \gdef^^e0{\`a}
7904 \gdef^^e1{\'a}
7905 \gdef^^e2{\^a}
7906 \gdef^^e3{\~a}
7907 \gdef^^e4{\"a}
7908 \gdef^^e5{\ringaccent a}
7909 \gdef^^e6{\ae}
7910 \gdef^^e7{\cedilla c}
7911 \gdef^^e8{\`e}
7912 \gdef^^e9{\'e}
7913 \gdef^^ea{\^e}
7914 \gdef^^eb{\"e}
7915 \gdef^^ec{\`{\dotless i}}
7916 \gdef^^ed{\'{\dotless i}}
7917 \gdef^^ee{\^{\dotless i}}
7918 \gdef^^ef{\"{\dotless i}}
7919 %
7920 \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}}
7921 \gdef^^f1{\~n}
7922 \gdef^^f2{\`o}
7923 \gdef^^f3{\'o}
7924 \gdef^^f4{\^o}
7925 \gdef^^f5{\~o}
7926 \gdef^^f6{\"o}
7927 \gdef^^f7{$\div$}
7928 \gdef^^f8{\o}
7929 \gdef^^f9{\`u}
7930 \gdef^^fa{\'u}
7931 \gdef^^fb{\^u}
7932 \gdef^^fc{\"u}
7933 \gdef^^fd{\'y}
7934 \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}}
7935 \gdef^^ff{\"y}
7936}
7937
7938% Latin9 (ISO-8859-15) encoding character definitions.
7939\def\latninechardefs{%
7940 % Encoding is almost identical to Latin1.
7941 \latonechardefs
7942 %
7943 \gdef^^a4{\euro}
7944 \gdef^^a6{\v S}
7945 \gdef^^a8{\v s}
7946 \gdef^^b4{\v Z}
7947 \gdef^^b8{\v z}
7948 \gdef^^bc{\OE}
7949 \gdef^^bd{\oe}
7950 \gdef^^be{\"Y}
7951}
7952
7953% Latin2 (ISO-8859-2) character definitions.
7954\def\lattwochardefs{%
7955 \gdef^^a0{~}
7956 \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}}
7957 \gdef^^a2{\u{}}
7958 \gdef^^a3{\L}
7959 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
7960 \gdef^^a5{\v L}
7961 \gdef^^a6{\'S}
7962 \gdef^^a7{\S}
7963 \gdef^^a8{\"{}}
7964 \gdef^^a9{\v S}
7965 \gdef^^aa{\cedilla S}
7966 \gdef^^ab{\v T}
7967 \gdef^^ac{\'Z}
7968 \gdef^^ad{\-}
7969 \gdef^^ae{\v Z}
7970 \gdef^^af{\dotaccent Z}
7971 %
7972 \gdef^^b0{\textdegree}
7973 \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}}
7974 \gdef^^b2{\missingcharmsg{OGONEK}}
7975 \gdef^^b3{\l}
7976 \gdef^^b4{\'{}}
7977 \gdef^^b5{\v l}
7978 \gdef^^b6{\'s}
7979 \gdef^^b7{\v{}}
7980 \gdef^^b8{\cedilla\ }
7981 \gdef^^b9{\v s}
7982 \gdef^^ba{\cedilla s}
7983 \gdef^^bb{\v t}
7984 \gdef^^bc{\'z}
7985 \gdef^^bd{\H{}}
7986 \gdef^^be{\v z}
7987 \gdef^^bf{\dotaccent z}
7988 %
7989 \gdef^^c0{\'R}
7990 \gdef^^c1{\'A}
7991 \gdef^^c2{\^A}
7992 \gdef^^c3{\u A}
7993 \gdef^^c4{\"A}
7994 \gdef^^c5{\'L}
7995 \gdef^^c6{\'C}
7996 \gdef^^c7{\cedilla C}
7997 \gdef^^c8{\v C}
7998 \gdef^^c9{\'E}
7999 \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}}
8000 \gdef^^cb{\"E}
8001 \gdef^^cc{\v E}
8002 \gdef^^cd{\'I}
8003 \gdef^^ce{\^I}
8004 \gdef^^cf{\v D}
8005 %
8006 \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}}
8007 \gdef^^d1{\'N}
8008 \gdef^^d2{\v N}
8009 \gdef^^d3{\'O}
8010 \gdef^^d4{\^O}
8011 \gdef^^d5{\H O}
8012 \gdef^^d6{\"O}
8013 \gdef^^d7{$\times$}
8014 \gdef^^d8{\v R}
8015 \gdef^^d9{\ringaccent U}
8016 \gdef^^da{\'U}
8017 \gdef^^db{\H U}
8018 \gdef^^dc{\"U}
8019 \gdef^^dd{\'Y}
8020 \gdef^^de{\cedilla T}
8021 \gdef^^df{\ss}
8022 %
8023 \gdef^^e0{\'r}
8024 \gdef^^e1{\'a}
8025 \gdef^^e2{\^a}
8026 \gdef^^e3{\u a}
8027 \gdef^^e4{\"a}
8028 \gdef^^e5{\'l}
8029 \gdef^^e6{\'c}
8030 \gdef^^e7{\cedilla c}
8031 \gdef^^e8{\v c}
8032 \gdef^^e9{\'e}
8033 \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}}
8034 \gdef^^eb{\"e}
8035 \gdef^^ec{\v e}
8036 \gdef^^ed{\'\i}
8037 \gdef^^ee{\^\i}
8038 \gdef^^ef{\v d}
8039 %
8040 \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}}
8041 \gdef^^f1{\'n}
8042 \gdef^^f2{\v n}
8043 \gdef^^f3{\'o}
8044 \gdef^^f4{\^o}
8045 \gdef^^f5{\H o}
8046 \gdef^^f6{\"o}
8047 \gdef^^f7{$\div$}
8048 \gdef^^f8{\v r}
8049 \gdef^^f9{\ringaccent u}
8050 \gdef^^fa{\'u}
8051 \gdef^^fb{\H u}
8052 \gdef^^fc{\"u}
8053 \gdef^^fd{\'y}
8054 \gdef^^fe{\cedilla t}
8055 \gdef^^ff{\dotaccent{}}
8056}
8057
8058% UTF-8 character definitions.
8059%
8060% This code to support UTF-8 is based on LaTeX's utf8.def, with some
8061% changes for Texinfo conventions. It is included here under the GPL by
8062% permission from Frank Mittelbach and the LaTeX team.
8063%
8064\newcount\countUTFx
8065\newcount\countUTFy
8066\newcount\countUTFz
6828 8067
6829% Page size parameters. 8068\gdef\UTFviiiTwoOctets#1#2{\expandafter
8069 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
8070%
8071\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
8072 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
6830% 8073%
8074\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
8075 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
8076
8077\gdef\UTFviiiDefined#1{%
8078 \ifx #1\relax
8079 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
8080 \else
8081 \expandafter #1%
8082 \fi
8083}
8084
8085\begingroup
8086 \catcode`\~13
8087 \catcode`\"12
8088
8089 \def\UTFviiiLoop{%
8090 \global\catcode\countUTFx\active
8091 \uccode`\~\countUTFx
8092 \uppercase\expandafter{\UTFviiiTmp}%
8093 \advance\countUTFx by 1
8094 \ifnum\countUTFx < \countUTFy
8095 \expandafter\UTFviiiLoop
8096 \fi}
8097
8098 \countUTFx = "C2
8099 \countUTFy = "E0
8100 \def\UTFviiiTmp{%
8101 \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
8102 \UTFviiiLoop
8103
8104 \countUTFx = "E0
8105 \countUTFy = "F0
8106 \def\UTFviiiTmp{%
8107 \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
8108 \UTFviiiLoop
8109
8110 \countUTFx = "F0
8111 \countUTFy = "F4
8112 \def\UTFviiiTmp{%
8113 \xdef~{\noexpand\UTFviiiFourOctets\string~}}
8114 \UTFviiiLoop
8115\endgroup
8116
8117\begingroup
8118 \catcode`\"=12
8119 \catcode`\<=12
8120 \catcode`\.=12
8121 \catcode`\,=12
8122 \catcode`\;=12
8123 \catcode`\!=12
8124 \catcode`\~=13
8125
8126 \gdef\DeclareUnicodeCharacter#1#2{%
8127 \countUTFz = "#1\relax
8128 \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
8129 \begingroup
8130 \parseXMLCharref
8131 \def\UTFviiiTwoOctets##1##2{%
8132 \csname u8:##1\string ##2\endcsname}%
8133 \def\UTFviiiThreeOctets##1##2##3{%
8134 \csname u8:##1\string ##2\string ##3\endcsname}%
8135 \def\UTFviiiFourOctets##1##2##3##4{%
8136 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
8137 \expandafter\expandafter\expandafter\expandafter
8138 \expandafter\expandafter\expandafter
8139 \gdef\UTFviiiTmp{#2}%
8140 \endgroup}
8141
8142 \gdef\parseXMLCharref{%
8143 \ifnum\countUTFz < "A0\relax
8144 \errhelp = \EMsimple
8145 \errmessage{Cannot define Unicode char value < 00A0}%
8146 \else\ifnum\countUTFz < "800\relax
8147 \parseUTFviiiA,%
8148 \parseUTFviiiB C\UTFviiiTwoOctets.,%
8149 \else\ifnum\countUTFz < "10000\relax
8150 \parseUTFviiiA;%
8151 \parseUTFviiiA,%
8152 \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
8153 \else
8154 \parseUTFviiiA;%
8155 \parseUTFviiiA,%
8156 \parseUTFviiiA!%
8157 \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
8158 \fi\fi\fi
8159 }
8160
8161 \gdef\parseUTFviiiA#1{%
8162 \countUTFx = \countUTFz
8163 \divide\countUTFz by 64
8164 \countUTFy = \countUTFz
8165 \multiply\countUTFz by 64
8166 \advance\countUTFx by -\countUTFz
8167 \advance\countUTFx by 128
8168 \uccode `#1\countUTFx
8169 \countUTFz = \countUTFy}
8170
8171 \gdef\parseUTFviiiB#1#2#3#4{%
8172 \advance\countUTFz by "#10\relax
8173 \uccode `#3\countUTFz
8174 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
8175\endgroup
8176
8177\def\utfeightchardefs{%
8178 \DeclareUnicodeCharacter{00A0}{\tie}
8179 \DeclareUnicodeCharacter{00A1}{\exclamdown}
8180 \DeclareUnicodeCharacter{00A3}{\pounds}
8181 \DeclareUnicodeCharacter{00A8}{\"{ }}
8182 \DeclareUnicodeCharacter{00A9}{\copyright}
8183 \DeclareUnicodeCharacter{00AA}{\ordf}
8184 \DeclareUnicodeCharacter{00AB}{\guillemetleft}
8185 \DeclareUnicodeCharacter{00AD}{\-}
8186 \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
8187 \DeclareUnicodeCharacter{00AF}{\={ }}
8188
8189 \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
8190 \DeclareUnicodeCharacter{00B4}{\'{ }}
8191 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
8192 \DeclareUnicodeCharacter{00BA}{\ordm}
8193 \DeclareUnicodeCharacter{00BB}{\guillemetright}
8194 \DeclareUnicodeCharacter{00BF}{\questiondown}
8195
8196 \DeclareUnicodeCharacter{00C0}{\`A}
8197 \DeclareUnicodeCharacter{00C1}{\'A}
8198 \DeclareUnicodeCharacter{00C2}{\^A}
8199 \DeclareUnicodeCharacter{00C3}{\~A}
8200 \DeclareUnicodeCharacter{00C4}{\"A}
8201 \DeclareUnicodeCharacter{00C5}{\AA}
8202 \DeclareUnicodeCharacter{00C6}{\AE}
8203 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
8204 \DeclareUnicodeCharacter{00C8}{\`E}
8205 \DeclareUnicodeCharacter{00C9}{\'E}
8206 \DeclareUnicodeCharacter{00CA}{\^E}
8207 \DeclareUnicodeCharacter{00CB}{\"E}
8208 \DeclareUnicodeCharacter{00CC}{\`I}
8209 \DeclareUnicodeCharacter{00CD}{\'I}
8210 \DeclareUnicodeCharacter{00CE}{\^I}
8211 \DeclareUnicodeCharacter{00CF}{\"I}
8212
8213 \DeclareUnicodeCharacter{00D1}{\~N}
8214 \DeclareUnicodeCharacter{00D2}{\`O}
8215 \DeclareUnicodeCharacter{00D3}{\'O}
8216 \DeclareUnicodeCharacter{00D4}{\^O}
8217 \DeclareUnicodeCharacter{00D5}{\~O}
8218 \DeclareUnicodeCharacter{00D6}{\"O}
8219 \DeclareUnicodeCharacter{00D8}{\O}
8220 \DeclareUnicodeCharacter{00D9}{\`U}
8221 \DeclareUnicodeCharacter{00DA}{\'U}
8222 \DeclareUnicodeCharacter{00DB}{\^U}
8223 \DeclareUnicodeCharacter{00DC}{\"U}
8224 \DeclareUnicodeCharacter{00DD}{\'Y}
8225 \DeclareUnicodeCharacter{00DF}{\ss}
8226
8227 \DeclareUnicodeCharacter{00E0}{\`a}
8228 \DeclareUnicodeCharacter{00E1}{\'a}
8229 \DeclareUnicodeCharacter{00E2}{\^a}
8230 \DeclareUnicodeCharacter{00E3}{\~a}
8231 \DeclareUnicodeCharacter{00E4}{\"a}
8232 \DeclareUnicodeCharacter{00E5}{\aa}
8233 \DeclareUnicodeCharacter{00E6}{\ae}
8234 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
8235 \DeclareUnicodeCharacter{00E8}{\`e}
8236 \DeclareUnicodeCharacter{00E9}{\'e}
8237 \DeclareUnicodeCharacter{00EA}{\^e}
8238 \DeclareUnicodeCharacter{00EB}{\"e}
8239 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
8240 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
8241 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
8242 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
8243
8244 \DeclareUnicodeCharacter{00F1}{\~n}
8245 \DeclareUnicodeCharacter{00F2}{\`o}
8246 \DeclareUnicodeCharacter{00F3}{\'o}
8247 \DeclareUnicodeCharacter{00F4}{\^o}
8248 \DeclareUnicodeCharacter{00F5}{\~o}
8249 \DeclareUnicodeCharacter{00F6}{\"o}
8250 \DeclareUnicodeCharacter{00F8}{\o}
8251 \DeclareUnicodeCharacter{00F9}{\`u}
8252 \DeclareUnicodeCharacter{00FA}{\'u}
8253 \DeclareUnicodeCharacter{00FB}{\^u}
8254 \DeclareUnicodeCharacter{00FC}{\"u}
8255 \DeclareUnicodeCharacter{00FD}{\'y}
8256 \DeclareUnicodeCharacter{00FF}{\"y}
8257
8258 \DeclareUnicodeCharacter{0100}{\=A}
8259 \DeclareUnicodeCharacter{0101}{\=a}
8260 \DeclareUnicodeCharacter{0102}{\u{A}}
8261 \DeclareUnicodeCharacter{0103}{\u{a}}
8262 \DeclareUnicodeCharacter{0106}{\'C}
8263 \DeclareUnicodeCharacter{0107}{\'c}
8264 \DeclareUnicodeCharacter{0108}{\^C}
8265 \DeclareUnicodeCharacter{0109}{\^c}
8266 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
8267 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
8268 \DeclareUnicodeCharacter{010C}{\v{C}}
8269 \DeclareUnicodeCharacter{010D}{\v{c}}
8270 \DeclareUnicodeCharacter{010E}{\v{D}}
8271
8272 \DeclareUnicodeCharacter{0112}{\=E}
8273 \DeclareUnicodeCharacter{0113}{\=e}
8274 \DeclareUnicodeCharacter{0114}{\u{E}}
8275 \DeclareUnicodeCharacter{0115}{\u{e}}
8276 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
8277 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
8278 \DeclareUnicodeCharacter{011A}{\v{E}}
8279 \DeclareUnicodeCharacter{011B}{\v{e}}
8280 \DeclareUnicodeCharacter{011C}{\^G}
8281 \DeclareUnicodeCharacter{011D}{\^g}
8282 \DeclareUnicodeCharacter{011E}{\u{G}}
8283 \DeclareUnicodeCharacter{011F}{\u{g}}
8284
8285 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
8286 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
8287 \DeclareUnicodeCharacter{0124}{\^H}
8288 \DeclareUnicodeCharacter{0125}{\^h}
8289 \DeclareUnicodeCharacter{0128}{\~I}
8290 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
8291 \DeclareUnicodeCharacter{012A}{\=I}
8292 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
8293 \DeclareUnicodeCharacter{012C}{\u{I}}
8294 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
8295
8296 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
8297 \DeclareUnicodeCharacter{0131}{\dotless{i}}
8298 \DeclareUnicodeCharacter{0132}{IJ}
8299 \DeclareUnicodeCharacter{0133}{ij}
8300 \DeclareUnicodeCharacter{0134}{\^J}
8301 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
8302 \DeclareUnicodeCharacter{0139}{\'L}
8303 \DeclareUnicodeCharacter{013A}{\'l}
8304
8305 \DeclareUnicodeCharacter{0141}{\L}
8306 \DeclareUnicodeCharacter{0142}{\l}
8307 \DeclareUnicodeCharacter{0143}{\'N}
8308 \DeclareUnicodeCharacter{0144}{\'n}
8309 \DeclareUnicodeCharacter{0147}{\v{N}}
8310 \DeclareUnicodeCharacter{0148}{\v{n}}
8311 \DeclareUnicodeCharacter{014C}{\=O}
8312 \DeclareUnicodeCharacter{014D}{\=o}
8313 \DeclareUnicodeCharacter{014E}{\u{O}}
8314 \DeclareUnicodeCharacter{014F}{\u{o}}
8315
8316 \DeclareUnicodeCharacter{0150}{\H{O}}
8317 \DeclareUnicodeCharacter{0151}{\H{o}}
8318 \DeclareUnicodeCharacter{0152}{\OE}
8319 \DeclareUnicodeCharacter{0153}{\oe}
8320 \DeclareUnicodeCharacter{0154}{\'R}
8321 \DeclareUnicodeCharacter{0155}{\'r}
8322 \DeclareUnicodeCharacter{0158}{\v{R}}
8323 \DeclareUnicodeCharacter{0159}{\v{r}}
8324 \DeclareUnicodeCharacter{015A}{\'S}
8325 \DeclareUnicodeCharacter{015B}{\'s}
8326 \DeclareUnicodeCharacter{015C}{\^S}
8327 \DeclareUnicodeCharacter{015D}{\^s}
8328 \DeclareUnicodeCharacter{015E}{\cedilla{S}}
8329 \DeclareUnicodeCharacter{015F}{\cedilla{s}}
8330
8331 \DeclareUnicodeCharacter{0160}{\v{S}}
8332 \DeclareUnicodeCharacter{0161}{\v{s}}
8333 \DeclareUnicodeCharacter{0162}{\cedilla{t}}
8334 \DeclareUnicodeCharacter{0163}{\cedilla{T}}
8335 \DeclareUnicodeCharacter{0164}{\v{T}}
8336
8337 \DeclareUnicodeCharacter{0168}{\~U}
8338 \DeclareUnicodeCharacter{0169}{\~u}
8339 \DeclareUnicodeCharacter{016A}{\=U}
8340 \DeclareUnicodeCharacter{016B}{\=u}
8341 \DeclareUnicodeCharacter{016C}{\u{U}}
8342 \DeclareUnicodeCharacter{016D}{\u{u}}
8343 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
8344 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
8345
8346 \DeclareUnicodeCharacter{0170}{\H{U}}
8347 \DeclareUnicodeCharacter{0171}{\H{u}}
8348 \DeclareUnicodeCharacter{0174}{\^W}
8349 \DeclareUnicodeCharacter{0175}{\^w}
8350 \DeclareUnicodeCharacter{0176}{\^Y}
8351 \DeclareUnicodeCharacter{0177}{\^y}
8352 \DeclareUnicodeCharacter{0178}{\"Y}
8353 \DeclareUnicodeCharacter{0179}{\'Z}
8354 \DeclareUnicodeCharacter{017A}{\'z}
8355 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
8356 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
8357 \DeclareUnicodeCharacter{017D}{\v{Z}}
8358 \DeclareUnicodeCharacter{017E}{\v{z}}
8359
8360 \DeclareUnicodeCharacter{01C4}{D\v{Z}}
8361 \DeclareUnicodeCharacter{01C5}{D\v{z}}
8362 \DeclareUnicodeCharacter{01C6}{d\v{z}}
8363 \DeclareUnicodeCharacter{01C7}{LJ}
8364 \DeclareUnicodeCharacter{01C8}{Lj}
8365 \DeclareUnicodeCharacter{01C9}{lj}
8366 \DeclareUnicodeCharacter{01CA}{NJ}
8367 \DeclareUnicodeCharacter{01CB}{Nj}
8368 \DeclareUnicodeCharacter{01CC}{nj}
8369 \DeclareUnicodeCharacter{01CD}{\v{A}}
8370 \DeclareUnicodeCharacter{01CE}{\v{a}}
8371 \DeclareUnicodeCharacter{01CF}{\v{I}}
8372
8373 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
8374 \DeclareUnicodeCharacter{01D1}{\v{O}}
8375 \DeclareUnicodeCharacter{01D2}{\v{o}}
8376 \DeclareUnicodeCharacter{01D3}{\v{U}}
8377 \DeclareUnicodeCharacter{01D4}{\v{u}}
8378
8379 \DeclareUnicodeCharacter{01E2}{\={\AE}}
8380 \DeclareUnicodeCharacter{01E3}{\={\ae}}
8381 \DeclareUnicodeCharacter{01E6}{\v{G}}
8382 \DeclareUnicodeCharacter{01E7}{\v{g}}
8383 \DeclareUnicodeCharacter{01E8}{\v{K}}
8384 \DeclareUnicodeCharacter{01E9}{\v{k}}
8385
8386 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
8387 \DeclareUnicodeCharacter{01F1}{DZ}
8388 \DeclareUnicodeCharacter{01F2}{Dz}
8389 \DeclareUnicodeCharacter{01F3}{dz}
8390 \DeclareUnicodeCharacter{01F4}{\'G}
8391 \DeclareUnicodeCharacter{01F5}{\'g}
8392 \DeclareUnicodeCharacter{01F8}{\`N}
8393 \DeclareUnicodeCharacter{01F9}{\`n}
8394 \DeclareUnicodeCharacter{01FC}{\'{\AE}}
8395 \DeclareUnicodeCharacter{01FD}{\'{\ae}}
8396 \DeclareUnicodeCharacter{01FE}{\'{\O}}
8397 \DeclareUnicodeCharacter{01FF}{\'{\o}}
8398
8399 \DeclareUnicodeCharacter{021E}{\v{H}}
8400 \DeclareUnicodeCharacter{021F}{\v{h}}
8401
8402 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
8403 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
8404 \DeclareUnicodeCharacter{0228}{\cedilla{E}}
8405 \DeclareUnicodeCharacter{0229}{\cedilla{e}}
8406 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
8407 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
8408
8409 \DeclareUnicodeCharacter{0232}{\=Y}
8410 \DeclareUnicodeCharacter{0233}{\=y}
8411 \DeclareUnicodeCharacter{0237}{\dotless{j}}
8412
8413 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
8414 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
8415 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
8416 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
8417 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
8418 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
8419 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
8420 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
8421 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
8422 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
8423 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
8424 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
8425
8426 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
8427 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
8428
8429 \DeclareUnicodeCharacter{1E20}{\=G}
8430 \DeclareUnicodeCharacter{1E21}{\=g}
8431 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
8432 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
8433 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
8434 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
8435 \DeclareUnicodeCharacter{1E26}{\"H}
8436 \DeclareUnicodeCharacter{1E27}{\"h}
8437
8438 \DeclareUnicodeCharacter{1E30}{\'K}
8439 \DeclareUnicodeCharacter{1E31}{\'k}
8440 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
8441 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
8442 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
8443 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
8444 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
8445 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
8446 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
8447 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
8448 \DeclareUnicodeCharacter{1E3E}{\'M}
8449 \DeclareUnicodeCharacter{1E3F}{\'m}
8450
8451 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
8452 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
8453 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
8454 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
8455 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
8456 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
8457 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
8458 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
8459 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
8460 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
8461
8462 \DeclareUnicodeCharacter{1E54}{\'P}
8463 \DeclareUnicodeCharacter{1E55}{\'p}
8464 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
8465 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
8466 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
8467 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
8468 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
8469 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
8470 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
8471 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
8472
8473 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
8474 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
8475 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
8476 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
8477 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
8478 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
8479 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
8480 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
8481 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
8482 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
8483
8484 \DeclareUnicodeCharacter{1E7C}{\~V}
8485 \DeclareUnicodeCharacter{1E7D}{\~v}
8486 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
8487 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
8488
8489 \DeclareUnicodeCharacter{1E80}{\`W}
8490 \DeclareUnicodeCharacter{1E81}{\`w}
8491 \DeclareUnicodeCharacter{1E82}{\'W}
8492 \DeclareUnicodeCharacter{1E83}{\'w}
8493 \DeclareUnicodeCharacter{1E84}{\"W}
8494 \DeclareUnicodeCharacter{1E85}{\"w}
8495 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
8496 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
8497 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
8498 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
8499 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
8500 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
8501 \DeclareUnicodeCharacter{1E8C}{\"X}
8502 \DeclareUnicodeCharacter{1E8D}{\"x}
8503 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
8504 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
8505
8506 \DeclareUnicodeCharacter{1E90}{\^Z}
8507 \DeclareUnicodeCharacter{1E91}{\^z}
8508 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
8509 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
8510 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
8511 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
8512 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
8513 \DeclareUnicodeCharacter{1E97}{\"t}
8514 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
8515 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
8516
8517 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
8518 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
8519
8520 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
8521 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
8522 \DeclareUnicodeCharacter{1EBC}{\~E}
8523 \DeclareUnicodeCharacter{1EBD}{\~e}
8524
8525 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
8526 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
8527 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
8528 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
8529
8530 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
8531 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
8532
8533 \DeclareUnicodeCharacter{1EF2}{\`Y}
8534 \DeclareUnicodeCharacter{1EF3}{\`y}
8535 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
8536
8537 \DeclareUnicodeCharacter{1EF8}{\~Y}
8538 \DeclareUnicodeCharacter{1EF9}{\~y}
8539
8540 \DeclareUnicodeCharacter{2013}{--}
8541 \DeclareUnicodeCharacter{2014}{---}
8542 \DeclareUnicodeCharacter{2018}{\quoteleft}
8543 \DeclareUnicodeCharacter{2019}{\quoteright}
8544 \DeclareUnicodeCharacter{201A}{\quotesinglbase}
8545 \DeclareUnicodeCharacter{201C}{\quotedblleft}
8546 \DeclareUnicodeCharacter{201D}{\quotedblright}
8547 \DeclareUnicodeCharacter{201E}{\quotedblbase}
8548 \DeclareUnicodeCharacter{2022}{\bullet}
8549 \DeclareUnicodeCharacter{2026}{\dots}
8550 \DeclareUnicodeCharacter{2039}{\guilsinglleft}
8551 \DeclareUnicodeCharacter{203A}{\guilsinglright}
8552 \DeclareUnicodeCharacter{20AC}{\euro}
8553
8554 \DeclareUnicodeCharacter{2192}{\expansion}
8555 \DeclareUnicodeCharacter{21D2}{\result}
8556
8557 \DeclareUnicodeCharacter{2212}{\minus}
8558 \DeclareUnicodeCharacter{2217}{\point}
8559 \DeclareUnicodeCharacter{2261}{\equiv}
8560}% end of \utfeightchardefs
8561
8562
8563% US-ASCII character definitions.
8564\def\asciichardefs{% nothing need be done
8565 \relax
8566}
8567
8568% Make non-ASCII characters printable again for compatibility with
8569% existing Texinfo documents that may use them, even without declaring a
8570% document encoding.
8571%
8572\setnonasciicharscatcode \other
8573
8574
8575\message{formatting,}
8576
6831\newdimen\defaultparindent \defaultparindent = 15pt 8577\newdimen\defaultparindent \defaultparindent = 15pt
6832 8578
6833\chapheadingskip = 15pt plus 4pt minus 2pt 8579\chapheadingskip = 15pt plus 4pt minus 2pt
@@ -6840,7 +8586,7 @@ should work if nowhere else does.}
6840% Don't be so finicky about underfull hboxes, either. 8586% Don't be so finicky about underfull hboxes, either.
6841\hbadness = 2000 8587\hbadness = 2000
6842 8588
6843% Following George Bush, just get rid of widows and orphans. 8589% Following George Bush, get rid of widows and orphans.
6844\widowpenalty=10000 8590\widowpenalty=10000
6845\clubpenalty=10000 8591\clubpenalty=10000
6846 8592
@@ -6887,6 +8633,10 @@ should work if nowhere else does.}
6887 \ifpdf 8633 \ifpdf
6888 \pdfpageheight #7\relax 8634 \pdfpageheight #7\relax
6889 \pdfpagewidth #8\relax 8635 \pdfpagewidth #8\relax
8636 % if we don't reset these, they will remain at "1 true in" of
8637 % whatever layout pdftex was dumped with.
8638 \pdfhorigin = 1 true in
8639 \pdfvorigin = 1 true in
6890 \fi 8640 \fi
6891 % 8641 %
6892 \setleading{\textleading} 8642 \setleading{\textleading}
@@ -6901,7 +8651,7 @@ should work if nowhere else does.}
6901 \textleading = 13.2pt 8651 \textleading = 13.2pt
6902 % 8652 %
6903 % If page is nothing but text, make it come out even. 8653 % If page is nothing but text, make it come out even.
6904 \internalpagesizes{46\baselineskip}{6in}% 8654 \internalpagesizes{607.2pt}{6in}% that's 46 lines
6905 {\voffset}{.25in}% 8655 {\voffset}{.25in}%
6906 {\bindingoffset}{36pt}% 8656 {\bindingoffset}{36pt}%
6907 {11in}{8.5in}% 8657 {11in}{8.5in}%
@@ -6913,7 +8663,7 @@ should work if nowhere else does.}
6913 \textleading = 12pt 8663 \textleading = 12pt
6914 % 8664 %
6915 \internalpagesizes{7.5in}{5in}% 8665 \internalpagesizes{7.5in}{5in}%
6916 {\voffset}{.25in}% 8666 {-.2in}{0in}%
6917 {\bindingoffset}{16pt}% 8667 {\bindingoffset}{16pt}%
6918 {9.25in}{7in}% 8668 {9.25in}{7in}%
6919 % 8669 %
@@ -6957,7 +8707,7 @@ should work if nowhere else does.}
6957 % \global\normaloffset = -6mm 8707 % \global\normaloffset = -6mm
6958 % \global\bindingoffset = 10mm 8708 % \global\bindingoffset = 10mm
6959 % @end tex 8709 % @end tex
6960 \internalpagesizes{51\baselineskip}{160mm} 8710 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
6961 {\voffset}{\hoffset}% 8711 {\voffset}{\hoffset}%
6962 {\bindingoffset}{44pt}% 8712 {\bindingoffset}{44pt}%
6963 {297mm}{210mm}% 8713 {297mm}{210mm}%
@@ -7022,7 +8772,7 @@ should work if nowhere else does.}
7022 \parskip = 3pt plus 2pt minus 1pt 8772 \parskip = 3pt plus 2pt minus 1pt
7023 \setleading{\textleading}% 8773 \setleading{\textleading}%
7024 % 8774 %
7025 \dimen0 = #1 8775 \dimen0 = #1\relax
7026 \advance\dimen0 by \voffset 8776 \advance\dimen0 by \voffset
7027 % 8777 %
7028 \dimen2 = \hsize 8778 \dimen2 = \hsize
@@ -7117,6 +8867,13 @@ should work if nowhere else does.}
7117% \otherifyactive is called near the end of this file. 8867% \otherifyactive is called near the end of this file.
7118\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} 8868\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
7119 8869
8870% Used sometimes to turn off (effectively) the active characters even after
8871% parsing them.
8872\def\turnoffactive{%
8873 \normalturnoffactive
8874 \otherbackslash
8875}
8876
7120\catcode`\@=0 8877\catcode`\@=0
7121 8878
7122% \backslashcurfont outputs one backslash character in current font, 8879% \backslashcurfont outputs one backslash character in current font,
@@ -7124,28 +8881,29 @@ should work if nowhere else does.}
7124\global\chardef\backslashcurfont=`\\ 8881\global\chardef\backslashcurfont=`\\
7125\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work 8882\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
7126 8883
7127% \rawbackslash defines an active \ to do \backslashcurfont.
7128% \otherbackslash defines an active \ to be a literal `\' character with
7129% catcode other.
7130{\catcode`\\=\active
7131 @gdef@rawbackslash{@let\=@backslashcurfont}
7132 @gdef@otherbackslash{@let\=@realbackslash}
7133}
7134
7135% \realbackslash is an actual character `\' with catcode other, and 8884% \realbackslash is an actual character `\' with catcode other, and
7136% \doublebackslash is two of them (for the pdf outlines). 8885% \doublebackslash is two of them (for the pdf outlines).
7137{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} 8886{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
7138 8887
7139% \normalbackslash outputs one backslash in fixed width font. 8888% In texinfo, backslash is an active character; it prints the backslash
7140\def\normalbackslash{{\tt\backslashcurfont}} 8889% in fixed width font.
7141
7142\catcode`\\=\active 8890\catcode`\\=\active
8891@def@normalbackslash{{@tt@backslashcurfont}}
8892% On startup, @fixbackslash assigns:
8893% @let \ = @normalbackslash
8894
8895% \rawbackslash defines an active \ to do \backslashcurfont.
8896% \otherbackslash defines an active \ to be a literal `\' character with
8897% catcode other.
8898@gdef@rawbackslash{@let\=@backslashcurfont}
8899@gdef@otherbackslash{@let\=@realbackslash}
7143 8900
7144% Used sometimes to turn off (effectively) the active characters 8901% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
7145% even after parsing them. 8902% the literal character `\'.
7146@def@turnoffactive{% 8903%
8904@def@normalturnoffactive{%
8905 @let\=@normalbackslash
7147 @let"=@normaldoublequote 8906 @let"=@normaldoublequote
7148 @let\=@realbackslash
7149 @let~=@normaltilde 8907 @let~=@normaltilde
7150 @let^=@normalcaret 8908 @let^=@normalcaret
7151 @let_=@normalunderscore 8909 @let_=@normalunderscore
@@ -7157,12 +8915,6 @@ should work if nowhere else does.}
7157 @unsepspaces 8915 @unsepspaces
7158} 8916}
7159 8917
7160% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
7161% the literal character `\'. (Thus, \ is not expandable when this is in
7162% effect.)
7163%
7164@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
7165
7166% Make _ and + \other characters, temporarily. 8918% Make _ and + \other characters, temporarily.
7167% This is canceled by @fixbackslash. 8919% This is canceled by @fixbackslash.
7168@otherifyactive 8920@otherifyactive
@@ -7175,7 +8927,7 @@ should work if nowhere else does.}
7175@global@let\ = @eatinput 8927@global@let\ = @eatinput
7176 8928
7177% On the other hand, perhaps the file did not have a `\input texinfo'. Then 8929% On the other hand, perhaps the file did not have a `\input texinfo'. Then
7178% the first `\{ in the file would cause an error. This macro tries to fix 8930% the first `\' in the file would cause an error. This macro tries to fix
7179% that, assuming it is called before the first `\' could plausibly occur. 8931% that, assuming it is called before the first `\' could plausibly occur.
7180% Also turn back on active characters that might appear in the input 8932% Also turn back on active characters that might appear in the input
7181% file name, in case not using a pre-dumped format. 8933% file name, in case not using a pre-dumped format.
diff --git a/src/daemon/https/tls/gnutls_global.c b/src/daemon/https/tls/gnutls_global.c
index a086b1f4..97ff1825 100644
--- a/src/daemon/https/tls/gnutls_global.c
+++ b/src/daemon/https/tls/gnutls_global.c
@@ -94,14 +94,6 @@ MHD_gtls_global_set_log_level (int level)
94 _gnutls_log_level = level; 94 _gnutls_log_level = level;
95} 95}
96 96
97extern gnutls_alloc_function gnutls_secure_malloc;
98extern gnutls_alloc_function gnutls_malloc;
99extern gnutls_free_function gnutls_free;
100extern int (*_gnutls_is_secure_memory) (const void *);
101extern gnutls_realloc_function gnutls_realloc;
102extern char *(*gnutls_strdup) (const char *);
103extern void *(*gnutls_calloc) (size_t, size_t);
104
105int _gnutls_is_secure_mem_null (const void *); 97int _gnutls_is_secure_mem_null (const void *);
106 98
107/** 99/**
diff --git a/src/daemon/https/tls/gnutls_x509.c b/src/daemon/https/tls/gnutls_x509.c
index 067d78da..35322db4 100644
--- a/src/daemon/https/tls/gnutls_x509.c
+++ b/src/daemon/https/tls/gnutls_x509.c
@@ -249,8 +249,8 @@ _gnutls_check_key_cert_match (mhd_gtls_cert_credentials_t res)
249} 249}
250 250
251/* Reads a DER encoded certificate list from memory and stores it to 251/* Reads a DER encoded certificate list from memory and stores it to
252 * a gnutls_cert structure. This is only called if PKCS7 read fails. 252 * a gnutls_cert structure.
253 * returns the number of certificates parsed (1) 253 * Returns the number of certificates parsed.
254 */ 254 */
255static int 255static int
256parse_crt_mem (gnutls_cert ** cert_list, unsigned *ncerts, 256parse_crt_mem (gnutls_cert ** cert_list, unsigned *ncerts,
@@ -284,8 +284,8 @@ parse_crt_mem (gnutls_cert ** cert_list, unsigned *ncerts,
284} 284}
285 285
286/* Reads a DER encoded certificate list from memory and stores it to 286/* Reads a DER encoded certificate list from memory and stores it to
287 * a gnutls_cert structure. This is only called if PKCS7 read fails. 287 * a gnutls_cert structure.
288 * returns the number of certificates parsed (1) 288 * Returns the number of certificates parsed.
289 */ 289 */
290static int 290static int
291parse_der_cert_mem (gnutls_cert ** cert_list, unsigned *ncerts, 291parse_der_cert_mem (gnutls_cert ** cert_list, unsigned *ncerts,
@@ -319,134 +319,6 @@ parse_der_cert_mem (gnutls_cert ** cert_list, unsigned *ncerts,
319 return ret; 319 return ret;
320} 320}
321 321
322#define CERT_PEM 1
323
324
325/* Reads a PKCS7 base64 encoded certificate list from memory and stores it to
326 * a gnutls_cert structure.
327 * returns the number of certificate parsed
328 */
329static int
330parse_pkcs7_cert_mem (gnutls_cert ** cert_list, unsigned *ncerts, const
331 void *input_cert, int input_cert_size, int flags)
332{
333#ifdef ENABLE_PKI
334 int i, j, count;
335 gnutls_datum_t tmp, tmp2;
336 int ret;
337 opaque *pcert = NULL;
338 size_t pcert_size;
339 gnutls_pkcs7_t pkcs7;
340
341 ret = gnutls_pkcs7_init (&pkcs7);
342 if (ret < 0)
343 {
344 gnutls_assert ();
345 return ret;
346 }
347 tmp.data = (opaque * ) input_cert;
348 tmp.size = input_cert_size;
349 if (flags & CERT_PEM)
350 ret = gnutls_pkcs7_import (pkcs7, &tmp, GNUTLS_X509_FMT_PEM);
351 else
352 ret = gnutls_pkcs7_import (pkcs7, &tmp, GNUTLS_X509_FMT_DER);
353 if (ret < 0)
354 {
355 /* if we failed to read the structure,
356 * then just try to decode a plain DER
357 * certificate.
358 */
359 gnutls_assert ();
360 gnutls_pkcs7_deinit (pkcs7);
361#endif
362 return parse_der_cert_mem (cert_list, ncerts,
363 input_cert, input_cert_size);
364#ifdef ENABLE_PKI
365 }
366
367 i = *ncerts + 1;
368
369 /* tmp now contains the decoded certificate list */
370 tmp.data = (opaque *) input_cert;
371 tmp.size = input_cert_size;
372
373 ret = gnutls_pkcs7_get_crt_count (pkcs7);
374
375 if (ret < 0)
376 {
377 gnutls_assert ();
378 gnutls_pkcs7_deinit (pkcs7);
379 return ret;
380 }
381 count = ret;
382
383 j = count - 1;
384 do
385 {
386 pcert_size = 0;
387 ret = gnutls_pkcs7_get_crt_raw (pkcs7, j, NULL, &pcert_size);
388 if (ret != GNUTLS_E_MEMORY_ERROR)
389 {
390 count--;
391 continue;
392 }
393
394 pcert = gnutls_malloc (pcert_size);
395 if (ret == GNUTLS_E_MEMORY_ERROR)
396 {
397 gnutls_assert ();
398 count--;
399 continue;
400 }
401
402 /* read the certificate
403 */
404 ret = gnutls_pkcs7_get_crt_raw (pkcs7, j, pcert, &pcert_size);
405
406 j--;
407
408 if (ret >= 0)
409 {
410 *cert_list =
411 (gnutls_cert *) mhd_gtls_realloc_fast (*cert_list,
412 i * sizeof (gnutls_cert));
413
414 if (*cert_list == NULL)
415 {
416 gnutls_assert ();
417 gnutls_free (pcert);
418 return GNUTLS_E_MEMORY_ERROR;
419 }
420
421 tmp2.data = pcert;
422 tmp2.size = pcert_size;
423
424 ret =
425 mhd_gtls_x509_raw_cert_to_gcert (&cert_list[0][i - 1], &tmp2, 0);
426
427 if (ret < 0)
428 {
429 gnutls_assert ();
430 gnutls_pkcs7_deinit (pkcs7);
431 gnutls_free (pcert);
432 return ret;
433 }
434
435 i++;
436 }
437
438 gnutls_free (pcert);
439
440 }
441 while (ret >= 0 && j >= 0);
442
443 *ncerts = i - 1;
444
445 gnutls_pkcs7_deinit (pkcs7);
446 return count;
447#endif
448}
449
450/* Reads a base64 encoded certificate list from memory and stores it to 322/* Reads a base64 encoded certificate list from memory and stores it to
451 * a gnutls_cert structure. Returns the number of certificate parsed. 323 * a gnutls_cert structure. Returns the number of certificate parsed.
452 */ 324 */
@@ -460,18 +332,6 @@ parse_pem_cert_mem (gnutls_cert ** cert_list, unsigned *ncerts,
460 gnutls_datum_t tmp; 332 gnutls_datum_t tmp;
461 int ret, count; 333 int ret, count;
462 334
463#ifdef ENABLE_PKI
464 if ((ptr = memmem (input_cert, input_cert_size,
465 PEM_PKCS7_SEP, sizeof (PEM_PKCS7_SEP) - 1)) != NULL)
466 {
467 size = strlen (ptr);
468
469 ret = parse_pkcs7_cert_mem (cert_list, ncerts, ptr, size, CERT_PEM);
470
471 return ret;
472 }
473#endif
474
475 /* move to the certificate 335 /* move to the certificate
476 */ 336 */
477 ptr = memmem (input_cert, input_cert_size, 337 ptr = memmem (input_cert, input_cert_size,
@@ -493,7 +353,7 @@ parse_pem_cert_mem (gnutls_cert ** cert_list, unsigned *ncerts,
493 do 353 do
494 { 354 {
495 355
496 siz2 = _gnutls_fbase64_decode (NULL, ptr, size, &ptr2); 356 siz2 = _gnutls_fbase64_decode (NULL, (const unsigned char*) ptr, size, &ptr2);
497 357
498 if (siz2 < 0) 358 if (siz2 < 0)
499 { 359 {
@@ -590,9 +450,9 @@ read_cert_mem (mhd_gtls_cert_credentials_t res, const void *cert,
590 res->cert_list_length[res->ncerts] = 0; 450 res->cert_list_length[res->ncerts] = 0;
591 451
592 if (type == GNUTLS_X509_FMT_DER) 452 if (type == GNUTLS_X509_FMT_DER)
593 ret = parse_pkcs7_cert_mem (&res->cert_list[res->ncerts], 453 ret = parse_der_cert_mem (&res->cert_list[res->ncerts],
594 &res->cert_list_length[res->ncerts], 454 &res->cert_list_length[res->ncerts],
595 cert, cert_size, 0); 455 cert, cert_size);
596 else 456 else
597 ret = 457 ret =
598 parse_pem_cert_mem (&res->cert_list[res->ncerts], 458 parse_pem_cert_mem (&res->cert_list[res->ncerts],
@@ -672,11 +532,13 @@ _gnutls_x509_raw_privkey_to_gkey (gnutls_privkey * privkey,
672 532
673 ret = gnutls_x509_privkey_import (tmpkey, raw_key, type); 533 ret = gnutls_x509_privkey_import (tmpkey, raw_key, type);
674 534
535#ifdef ENABLE_PKI
675 /* If normal key decoding doesn't work try decoding a plain PKCS #8 key */ 536 /* If normal key decoding doesn't work try decoding a plain PKCS #8 key */
676 if (ret < 0) 537 if (ret < 0)
677 ret = 538 ret =
678 gnutls_x509_privkey_import_pkcs8 (tmpkey, raw_key, type, NULL, 539 gnutls_x509_privkey_import_pkcs8 (tmpkey, raw_key, type, NULL,
679 GNUTLS_PKCS_PLAIN); 540 GNUTLS_PKCS_PLAIN);
541#endif
680 542
681 if (ret < 0) 543 if (ret < 0)
682 { 544 {
@@ -1088,7 +950,7 @@ parse_pem_ca_mem (gnutls_x509_crt_t ** cert_list, unsigned *ncerts,
1088 ptr3 = memmem (ptr, size, 950 ptr3 = memmem (ptr, size,
1089 PEM_CERT_SEP2, sizeof (PEM_CERT_SEP2) - 1); 951 PEM_CERT_SEP2, sizeof (PEM_CERT_SEP2) - 1);
1090 952
1091 ptr = ptr3; 953 ptr = (const opaque *) ptr3;
1092 size = input_cert_size - (ptr - input_cert); 954 size = input_cert_size - (ptr - input_cert);
1093 } 955 }
1094 else 956 else
@@ -1106,8 +968,8 @@ parse_pem_ca_mem (gnutls_x509_crt_t ** cert_list, unsigned *ncerts,
1106} 968}
1107 969
1108/* Reads a DER encoded certificate list from memory and stores it to 970/* Reads a DER encoded certificate list from memory and stores it to
1109 * a gnutls_cert structure. This is only called if PKCS7 read fails. 971 * a gnutls_cert structure.
1110 * returns the number of certificates parsed (1) 972 * returns the number of certificates parsed.
1111 */ 973 */
1112static int 974static int
1113parse_der_ca_mem (gnutls_x509_crt_t ** cert_list, unsigned *ncerts, 975parse_der_ca_mem (gnutls_x509_crt_t ** cert_list, unsigned *ncerts,
@@ -1218,7 +1080,7 @@ MHD_gnutls_certificate_set_x509_trust_file (mhd_gtls_cert_credentials_t
1218{ 1080{
1219 int ret, ret2; 1081 int ret, ret2;
1220 size_t size; 1082 size_t size;
1221 char *data = read_binary_file (cafile, &size); 1083 unsigned char *data = (unsigned char*) read_binary_file (cafile, &size);
1222 1084
1223 if (data == NULL) 1085 if (data == NULL)
1224 { 1086 {
@@ -1292,8 +1154,8 @@ parse_pem_crl_mem (gnutls_x509_crl_t ** crl_list, unsigned *ncrls,
1292 gnutls_assert (); 1154 gnutls_assert ();
1293 return ret; 1155 return ret;
1294 } 1156 }
1295 1157
1296 tmp.data = (char *) ptr; 1158 tmp.data = (unsigned char *) ptr;
1297 tmp.size = size; 1159 tmp.size = size;
1298 1160
1299 ret = 1161 ret =
@@ -1329,8 +1191,8 @@ parse_pem_crl_mem (gnutls_x509_crl_t ** crl_list, unsigned *ncrls,
1329} 1191}
1330 1192
1331/* Reads a DER encoded certificate list from memory and stores it to 1193/* Reads a DER encoded certificate list from memory and stores it to
1332 * a gnutls_cert structure. This is only called if PKCS7 read fails. 1194 * a gnutls_cert structure.
1333 * returns the number of certificates parsed (1) 1195 * returns the number of certificates parsed.
1334 */ 1196 */
1335static int 1197static int
1336parse_der_crl_mem (gnutls_x509_crl_t ** crl_list, unsigned *ncrls, 1198parse_der_crl_mem (gnutls_x509_crl_t ** crl_list, unsigned *ncrls,
@@ -1461,7 +1323,7 @@ MHD_gnutls_certificate_set_x509_crl_file (mhd_gtls_cert_credentials_t
1461{ 1323{
1462 int ret; 1324 int ret;
1463 size_t size; 1325 size_t size;
1464 char *data = read_binary_file (crlfile, &size); 1326 unsigned char *data = (unsigned char*) read_binary_file (crlfile, &size);
1465 1327
1466 if (data == NULL) 1328 if (data == NULL)
1467 { 1329 {
@@ -1489,281 +1351,6 @@ MHD_gnutls_certificate_set_x509_crl_file (mhd_gtls_cert_credentials_t
1489 1351
1490#include <pkcs12.h> 1352#include <pkcs12.h>
1491 1353
1492static int
1493parse_pkcs12 (mhd_gtls_cert_credentials_t res,
1494 gnutls_pkcs12_t p12,
1495 const char *password,
1496 gnutls_x509_privkey_t * key,
1497 gnutls_x509_crt_t * cert, gnutls_x509_crl_t * crl)
1498{
1499 gnutls_pkcs12_bag_t bag = NULL;
1500 int index = 0;
1501 int ret;
1502
1503 for (;;)
1504 {
1505 int elements_in_bag;
1506 int i;
1507
1508 ret = gnutls_pkcs12_bag_init (&bag);
1509 if (ret < 0)
1510 {
1511 bag = NULL;
1512 gnutls_assert ();
1513 goto done;
1514 }
1515
1516 ret = gnutls_pkcs12_get_bag (p12, index, bag);
1517 if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
1518 break;
1519 if (ret < 0)
1520 {
1521 gnutls_assert ();
1522 goto done;
1523 }
1524
1525 ret = gnutls_pkcs12_bag_get_type (bag, 0);
1526 if (ret < 0)
1527 {
1528 gnutls_assert ();
1529 goto done;
1530 }
1531
1532 if (ret == GNUTLS_BAG_ENCRYPTED)
1533 {
1534 ret = gnutls_pkcs12_bag_decrypt (bag, password);
1535 if (ret < 0)
1536 {
1537 gnutls_assert ();
1538 goto done;
1539 }
1540 }
1541
1542 elements_in_bag = gnutls_pkcs12_bag_get_count (bag);
1543 if (elements_in_bag < 0)
1544 {
1545 gnutls_assert ();
1546 goto done;
1547 }
1548
1549 for (i = 0; i < elements_in_bag; i++)
1550 {
1551 int type;
1552 gnutls_datum_t data;
1553
1554 type = gnutls_pkcs12_bag_get_type (bag, i);
1555 if (type < 0)
1556 {
1557 gnutls_assert ();
1558 goto done;
1559 }
1560
1561 ret = gnutls_pkcs12_bag_get_data (bag, i, &data);
1562 if (ret < 0)
1563 {
1564 gnutls_assert ();
1565 goto done;
1566 }
1567
1568 switch (type)
1569 {
1570 case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY:
1571 case GNUTLS_BAG_PKCS8_KEY:
1572 ret = gnutls_x509_privkey_init (key);
1573 if (ret < 0)
1574 {
1575 gnutls_assert ();
1576 goto done;
1577 }
1578
1579 ret = gnutls_x509_privkey_import_pkcs8
1580 (*key, &data, GNUTLS_X509_FMT_DER, password,
1581 type == GNUTLS_BAG_PKCS8_KEY ? GNUTLS_PKCS_PLAIN : 0);
1582 if (ret < 0)
1583 {
1584 gnutls_assert ();
1585 goto done;
1586 }
1587 break;
1588
1589 case GNUTLS_BAG_CERTIFICATE:
1590 ret = gnutls_x509_crt_init (cert);
1591 if (ret < 0)
1592 {
1593 gnutls_assert ();
1594 goto done;
1595 }
1596
1597 ret =
1598 gnutls_x509_crt_import (*cert, &data, GNUTLS_X509_FMT_DER);
1599 if (ret < 0)
1600 {
1601 gnutls_assert ();
1602 goto done;
1603 }
1604 break;
1605
1606 case GNUTLS_BAG_CRL:
1607 ret = gnutls_x509_crl_init (crl);
1608 if (ret < 0)
1609 {
1610 gnutls_assert ();
1611 goto done;
1612 }
1613
1614 ret = gnutls_x509_crl_import (*crl, &data, GNUTLS_X509_FMT_DER);
1615 if (ret < 0)
1616 {
1617 gnutls_assert ();
1618 goto done;
1619 }
1620 break;
1621
1622 case GNUTLS_BAG_ENCRYPTED:
1623 /* XXX Bother to recurse one level down? Unlikely to
1624 use the same password anyway. */
1625 case GNUTLS_BAG_EMPTY:
1626 default:
1627 break;
1628 }
1629 }
1630
1631 index++;
1632 gnutls_pkcs12_bag_deinit (bag);
1633 }
1634
1635 ret = 0;
1636
1637done:
1638 if (bag)
1639 gnutls_pkcs12_bag_deinit (bag);
1640
1641 return ret;
1642}
1643
1644/**
1645 * gnutls_certificate_set_x509_simple_pkcs12_file:
1646 * @res: is an #mhd_gtls_cert_credentials_t structure.
1647 * @pkcs12file: filename of file containing PKCS#12 blob.
1648 * @type: is PEM or DER of the @pkcs12file.
1649 * @password: optional password used to decrypt PKCS#12 file, bags and keys.
1650 *
1651 * This function sets a certificate/private key pair and/or a CRL in
1652 * the mhd_gtls_cert_credentials_t structure. This function may
1653 * be called more than once (in case multiple keys/certificates exist
1654 * for the server).
1655 *
1656 * MAC:ed PKCS#12 files are supported. Encrypted PKCS#12 bags are
1657 * supported. Encrypted PKCS#8 private keys are supported. However,
1658 * only password based security, and the same password for all
1659 * operations, are supported.
1660 *
1661 * The private keys may be RSA PKCS#1 or DSA private keys encoded in
1662 * the OpenSSL way.
1663 *
1664 * PKCS#12 file may contain many keys and/or certificates, and there
1665 * is no way to identify which key/certificate pair you want. You
1666 * should make sure the PKCS#12 file only contain one key/certificate
1667 * pair and/or one CRL.
1668 *
1669 * It is believed that the limitations of this function is acceptable
1670 * for most usage, and that any more flexibility would introduce
1671 * complexity that would make it harder to use this functionality at
1672 * all.
1673 *
1674 * Returns: %GNUTLS_E_SUCCESS on success, or an error code.
1675 **/
1676//int
1677// gnutls_certificate_set_x509_simple_pkcs12_file
1678// (mhd_gtls_cert_credentials_t res, const char *pkcs12file,
1679// gnutls_x509_crt_fmt_t type, const char *password)
1680//{
1681// gnutls_pkcs12_t p12;
1682// gnutls_datum_t p12blob;
1683// gnutls_x509_privkey_t key = NULL;
1684// gnutls_x509_crt_t cert = NULL;
1685// gnutls_x509_crl_t crl = NULL;
1686// int ret;
1687// size_t size;
1688//
1689// ret = gnutls_pkcs12_init (&p12);
1690// if (ret < 0)
1691// {
1692// gnutls_assert ();
1693// return ret;
1694// }
1695//
1696// p12blob.data = read_binary_file (pkcs12file, &size);
1697// p12blob.size = (unsigned int) size;
1698// if (p12blob.data == NULL)
1699// {
1700// gnutls_assert ();
1701// gnutls_pkcs12_deinit (p12);
1702// return GNUTLS_E_FILE_ERROR;
1703// }
1704//
1705// ret = gnutls_pkcs12_import (p12, &p12blob, type, 0);
1706// free (p12blob.data);
1707// if (ret < 0)
1708// {
1709// gnutls_assert ();
1710// gnutls_pkcs12_deinit (p12);
1711// return ret;
1712// }
1713//
1714// if (password)
1715// {
1716// ret = gnutls_pkcs12_verify_mac (p12, password);
1717// if (ret < 0)
1718// {
1719// gnutls_assert ();
1720// gnutls_pkcs12_deinit (p12);
1721// return ret;
1722// }
1723// }
1724//
1725// ret = parse_pkcs12 (res, p12, password, &key, &cert, &crl);
1726// gnutls_pkcs12_deinit (p12);
1727// if (ret < 0)
1728// {
1729// gnutls_assert ();
1730// return ret;
1731// }
1732//
1733// if (key && cert)
1734// {
1735// ret = gnutls_certificate_set_x509_key (res, &cert, 1, key);
1736// if (ret < 0)
1737// {
1738// gnutls_assert ();
1739// goto done;
1740// }
1741// }
1742//
1743// if (crl)
1744// {
1745// ret = gnutls_certificate_set_x509_crl (res, &crl, 1);
1746// if (ret < 0)
1747// {
1748// gnutls_assert ();
1749// goto done;
1750// }
1751// }
1752//
1753// ret = 0;
1754//
1755//done:
1756// if (cert)
1757// gnutls_x509_crt_deinit (cert);
1758// if (key)
1759// gnutls_x509_privkey_deinit (key);
1760// if (crl)
1761// gnutls_x509_crl_deinit (crl);
1762//
1763// return ret;
1764//}
1765
1766
1767/** 1354/**
1768 * MHD_gnutls_certificate_free_crls - Used to free all the CRLs from a mhd_gtls_cert_credentials_t structure 1355 * MHD_gnutls_certificate_free_crls - Used to free all the CRLs from a mhd_gtls_cert_credentials_t structure
1769 * @sc: is an #mhd_gtls_cert_credentials_t structure. 1356 * @sc: is an #mhd_gtls_cert_credentials_t structure.
diff --git a/src/daemon/https/tls/gnutls_x509.h b/src/daemon/https/tls/gnutls_x509.h
index d252051a..b0135d95 100644
--- a/src/daemon/https/tls/gnutls_x509.h
+++ b/src/daemon/https/tls/gnutls_x509.h
@@ -29,7 +29,6 @@ int _gnutls_x509_cert_verify_peers (mhd_gtls_session_t session,
29 29
30#define PEM_CERT_SEP2 "-----BEGIN X509 CERTIFICATE" 30#define PEM_CERT_SEP2 "-----BEGIN X509 CERTIFICATE"
31#define PEM_CERT_SEP "-----BEGIN CERTIFICATE" 31#define PEM_CERT_SEP "-----BEGIN CERTIFICATE"
32#define PEM_PKCS7_SEP "-----BEGIN PKCS7"
33 32
34#define PEM_CRL_SEP "-----BEGIN X509 CRL" 33#define PEM_CRL_SEP "-----BEGIN X509 CRL"
35 34
diff --git a/src/daemon/https/x509/dn.c b/src/daemon/https/x509/dn.c
index 27c53084..0c6a2f7a 100644
--- a/src/daemon/https/x509/dn.c
+++ b/src/daemon/https/x509/dn.c
@@ -759,13 +759,12 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid,
759} 759}
760 760
761/* This will write the AttributeTypeAndValue field. The data must be already DER encoded. 761/* This will write the AttributeTypeAndValue field. The data must be already DER encoded.
762 * 'multi' must be zero if writing an AttributeTypeAndValue, and 1 if Attribute.
763 * In all cases only one value is written. 762 * In all cases only one value is written.
764 */ 763 */
765int 764static int
766_gnutls_x509_write_attribute (const char *given_oid, 765_gnutls_x509_write_attribute (const char *given_oid,
767 ASN1_TYPE asn1_struct, const char *where, 766 ASN1_TYPE asn1_struct, const char *where,
768 const void *_data, int sizeof_data, int multi) 767 const void *_data, int sizeof_data)
769{ 768{
770 char tmp[128]; 769 char tmp[128];
771 int result; 770 int result;
@@ -776,21 +775,6 @@ _gnutls_x509_write_attribute (const char *given_oid,
776 mhd_gtls_str_cpy (tmp, sizeof (tmp), where); 775 mhd_gtls_str_cpy (tmp, sizeof (tmp), where);
777 mhd_gtls_str_cat (tmp, sizeof (tmp), ".value"); 776 mhd_gtls_str_cat (tmp, sizeof (tmp), ".value");
778 777
779 if (multi != 0)
780 { /* if not writing an AttributeTypeAndValue, but an Attribute */
781 mhd_gtls_str_cat (tmp, sizeof (tmp), "s"); /* values */
782
783 result = asn1_write_value (asn1_struct, tmp, "NEW", 1);
784 if (result != ASN1_SUCCESS)
785 {
786 gnutls_assert ();
787 return mhd_gtls_asn2err (result);
788 }
789
790 mhd_gtls_str_cat (tmp, sizeof (tmp), ".?LAST");
791
792 }
793
794 result = asn1_write_value (asn1_struct, tmp, _data, sizeof_data); 778 result = asn1_write_value (asn1_struct, tmp, _data, sizeof_data);
795 if (result < 0) 779 if (result < 0)
796 { 780 {
@@ -938,7 +922,7 @@ _gnutls_x509_set_dn_oid (ASN1_TYPE asn1_struct,
938 { 922 {
939 result = 923 result =
940 _gnutls_x509_write_attribute (given_oid, asn1_struct, 924 _gnutls_x509_write_attribute (given_oid, asn1_struct,
941 tmp, name, sizeof_name, 0); 925 tmp, name, sizeof_name);
942 } 926 }
943 927
944 if (result < 0) 928 if (result < 0)