blob: 57a19eda1808029e7507d17424d82bfe04129b98 [file] [log] [blame]
Fred Drake6659c301998-03-03 22:02:19 +00001# python.perl by Fred L. Drake, Jr. <fdrake@acm.org> -*- perl -*-
2#
3# Heavily based on Guido van Rossum's myformat.perl (now obsolete).
4#
5# Extension to LaTeX2HTML for documents using myformat.sty.
6# Subroutines of the form do_cmd_<name> here define translations
7# for LaTeX commands \<name> defined in the corresponding .sty file.
8
9package main;
10
11
Fred Drake08932051998-04-17 02:15:42 +000012sub next_argument{
Fred Drakeccc62721999-01-05 22:16:29 +000013 my $param;
14 $param = missing_braces()
15 unless ((s/$next_pair_pr_rx/$param=$2;''/eo)
16 ||(s/$next_pair_rx/$param=$2;''/eo));
Fred Drake62e43691998-08-10 19:40:44 +000017 return $param;
Fred Drake08932051998-04-17 02:15:42 +000018}
19
20sub next_optional_argument{
21 my($param,$rx) = ('', "^\\s*(\\[([^]]*)\\])?");
Fred Drake5ccf3301998-04-17 20:04:09 +000022 s/$rx/$param=$2;''/eo;
Fred Drake62e43691998-08-10 19:40:44 +000023 return $param;
Fred Drake08932051998-04-17 02:15:42 +000024}
25
Fred Drakee16f6791998-05-15 04:28:37 +000026
27# This is a fairly simple hack; it supports \let when it is used to create
28# (or redefine) a macro to exactly be some other macro: \let\newname=\oldname.
Fred Drake5b73cdf1998-05-15 16:59:38 +000029# Many possible uses of \let aren't supported or aren't supported correctly.
Fred Drakee16f6791998-05-15 04:28:37 +000030#
31sub do_cmd_let{
32 local($_) = @_;
33 my $matched = 0;
Fred Drake7a4ad0f1998-05-15 13:45:54 +000034 s/[\\]([a-zA-Z]+)\s*(=\s*)?[\\]([a-zA-Z]*)/$matched=1; ''/e;
Fred Drakee16f6791998-05-15 04:28:37 +000035 if ($matched) {
36 my($new, $old) = ($1, $3);
37 eval "sub do_cmd_$new { do_cmd_$old" . '(@_); }';
38 print "\ndefining handler for \\$new using \\$old\n";
39 }
Fred Drake7a4ad0f1998-05-15 13:45:54 +000040 else {
41 s/[\\]([a-zA-Z]+)\s*(=\s*)?([^\\])/$matched=1; ''/es;
42 if ($matched) {
43 my($new, $char) = ($1, $3);
44 eval "sub do_cmd_$new { \"\\$char\" . \@_[0]; }";
45 print "\ndefining handler for \\$new to insert '$char'\n";
46 }
47 else {
48 write_warnings("Could not interpret \\let construct...");
49 }
50 }
Fred Drake62e43691998-08-10 19:40:44 +000051 return $_;
Fred Drakee16f6791998-05-15 04:28:37 +000052}
53
54
Fred Drake6659c301998-03-03 22:02:19 +000055# words typeset in a special way (not in HTML though)
56
57sub do_cmd_ABC{ 'ABC' . @_[0]; }
58sub do_cmd_UNIX{ 'Unix'. @_[0]; }
59sub do_cmd_ASCII{ 'ASCII' . @_[0]; }
60sub do_cmd_POSIX{ 'POSIX' . @_[0]; }
61sub do_cmd_C{ 'C' . @_[0]; }
62sub do_cmd_Cpp{ 'C++' . @_[0]; }
63sub do_cmd_EOF{ 'EOF' . @_[0]; }
64sub do_cmd_NULL{ '<tt>NULL</tt>' . @_[0]; }
65
66sub do_cmd_e{ '&#92;' . @_[0]; }
67
Fred Draked07868a1998-05-14 21:00:28 +000068$DEVELOPER_ADDRESS = '';
Fred Drake6659c301998-03-03 22:02:19 +000069$PYTHON_VERSION = '';
70
71sub do_cmd_version{ $PYTHON_VERSION . @_[0]; }
72sub do_cmd_release{
73 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +000074 $PYTHON_VERSION = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +000075 return $_;
Fred Drake6659c301998-03-03 22:02:19 +000076}
77
78sub do_cmd_authoraddress{
79 local($_) = @_;
Fred Draked07868a1998-05-14 21:00:28 +000080 $DEVELOPER_ADDRESS = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +000081 return $_;
Fred Drake6659c301998-03-03 22:02:19 +000082}
83
Fred Drakee16f6791998-05-15 04:28:37 +000084#sub do_cmd_developer{ do_cmd_author(@_[0]); }
85#sub do_cmd_developers{ do_cmd_author(@_[0]); }
86#sub do_cmd_developersaddress{ do_cmd_authoraddress(@_[0]); }
Fred Draked07868a1998-05-14 21:00:28 +000087
Fred Drake6659c301998-03-03 22:02:19 +000088sub do_cmd_hackscore{
89 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +000090 next_argument();
Fred Drake62e43691998-08-10 19:40:44 +000091 return '_' . $_;
Fred Drake6659c301998-03-03 22:02:19 +000092}
93
Fred Drake08932051998-04-17 02:15:42 +000094sub use_wrappers{
95 local($_,$before,$after) = @_;
96 my $stuff = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +000097 return $before . $stuff . $after . $_;
Fred Drake08932051998-04-17 02:15:42 +000098}
99
Fred Drake62e43691998-08-10 19:40:44 +0000100sub use_sans_serif{
Fred Drakeccc62721999-01-05 22:16:29 +0000101 return use_wrappers(@_[0], '<font face="sans-serif">', '</font>');
Fred Drake62e43691998-08-10 19:40:44 +0000102}
103sub use_italics{
104 return use_wrappers(@_[0], '<i>', '</i>');
105}
Fred Drake08932051998-04-17 02:15:42 +0000106
Fred Drake6659c301998-03-03 22:02:19 +0000107sub do_cmd_optional{
Fred Drake62e43691998-08-10 19:40:44 +0000108 return use_wrappers(@_[0], "</var><big>\[</big><var>",
109 "</var><big>\]</big><var>");
Fred Drake6659c301998-03-03 22:02:19 +0000110}
111
Fred Drakec9a44381998-03-17 06:29:13 +0000112# Logical formatting (some based on texinfo), needs to be converted to
113# minimalist HTML. The "minimalist" is primarily to reduce the size of
114# output files for users that read them over the network rather than
115# from local repositories.
Fred Drake6659c301998-03-03 22:02:19 +0000116
Fred Drake2cafcbb1999-03-25 16:57:04 +0000117# \file and \samp are at the end of this file since they screw up fontlock.
118
Fred Drake2ff880e1999-02-05 18:31:29 +0000119sub do_cmd_pytype{ return @_[0]; }
120sub do_cmd_makevar{ return @_[0]; }
Fred Drake90fdda51999-02-16 20:27:42 +0000121sub do_cmd_code{
122 return use_wrappers(@_[0], '<tt>', '</tt>'); }
123sub do_cmd_module{
124 return use_wrappers(@_[0], '<tt class=module>', '</tt>'); }
125sub do_cmd_keyword{
126 return use_wrappers(@_[0], '<tt class=keyword>', '</tt>'); }
127sub do_cmd_exception{
128 return use_wrappers(@_[0], '<tt class=exception>', '</tt>'); }
129sub do_cmd_class{
130 return use_wrappers(@_[0], '<tt class=class>', '</tt>'); }
131sub do_cmd_function{
132 return use_wrappers(@_[0], '<tt class=function>', '</tt>'); }
133sub do_cmd_constant{
134 return use_wrappers(@_[0], '<tt class=constant>', '</tt>'); }
135sub do_cmd_member{
136 return use_wrappers(@_[0], '<tt class=member>', '</tt>'); }
137sub do_cmd_method{
138 return use_wrappers(@_[0], '<tt class=method>', '</tt>'); }
139sub do_cmd_cfunction{
140 return use_wrappers(@_[0], '<tt class=cfunction>', '</tt>'); }
141sub do_cmd_cdata{
142 return use_wrappers(@_[0], '<tt class=cdata>', '</tt>'); }
143sub do_cmd_ctype{
144 return use_wrappers(@_[0], '<tt class=ctype>', '</tt>'); }
145sub do_cmd_regexp{
146 return use_wrappers(@_[0], '<tt class=regexp>', '</tt>'); }
147sub do_cmd_character{
148 return use_wrappers(@_[0], '"<tt class=character>', '</tt>"'); }
149sub do_cmd_program{
150 return use_wrappers(@_[0], '<b class=program>', '</b>'); }
Fred Drakec9f5fe01999-11-09 16:59:42 +0000151sub do_cmd_programopt{
152 return use_wrappers(@_[0], '<b class="programopt">', '</b>'); }
Fred Drake90fdda51999-02-16 20:27:42 +0000153sub do_cmd_email{
154 return use_wrappers(@_[0], '<span class=email>', '</span>'); }
155sub do_cmd_mimetype{
156 return use_wrappers(@_[0], '<span class=mimetype>', '</span>'); }
157sub do_cmd_var{
158 return use_wrappers(@_[0], "<var>", "</var>"); }
159sub do_cmd_dfn{
160 return use_wrappers(@_[0], '<i class=dfn>', '</i>'); }
161sub do_cmd_emph{
162 return use_italics(@_); }
163sub do_cmd_file{
Fred Drakef74e5b71999-04-28 14:58:49 +0000164 return use_wrappers(@_[0], '<tt class=file>', '</tt>'); }
165sub do_cmd_filenq{
166 return use_wrappers(@_[0], '<tt class=file>', '</tt>'); }
Fred Drake90fdda51999-02-16 20:27:42 +0000167sub do_cmd_samp{
168 return use_wrappers(@_[0], '"<tt class=samp>', '</tt>"'); }
169sub do_cmd_kbd{
170 return use_wrappers(@_[0], '<kbd>', '</kbd>'); }
171sub do_cmd_strong{
172 return use_wrappers(@_[0], '<b>', '</b>'); }
Fred Drake2cafcbb1999-03-25 16:57:04 +0000173sub do_cmd_textbf{
174 return use_wrappers(@_[0], '<b>', '</b>'); }
175sub do_cmd_textit{
176 return use_wrappers(@_[0], '<i>', '</i>'); }
177
Fred Drakec9a44381998-03-17 06:29:13 +0000178
Fred Drake25817041999-01-13 17:06:34 +0000179sub do_cmd_refmodule{
180 # Insert the right magic to jump to the module definition.
181 local($_) = @_;
182 my $key = next_optional_argument();
183 my $module = next_argument();
184 $key = $module
185 unless $key;
Fred Drake90fdda51999-02-16 20:27:42 +0000186 return "<tt class=module><a href=\"module-$key.html\">$module</a></tt>" . $_;
Fred Drake25817041999-01-13 17:06:34 +0000187}
188
Fred Drake1a7af391998-04-01 22:44:56 +0000189sub do_cmd_newsgroup{
190 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000191 my $newsgroup = next_argument();
Fred Draked37cecf1999-09-23 16:45:08 +0000192 my $stuff = "<a class=newsgroup href=\"news:$newsgroup\">$newsgroup</a>";
Fred Drake62e43691998-08-10 19:40:44 +0000193 return $stuff . $_;
Fred Drake1a7af391998-04-01 22:44:56 +0000194}
Fred Drakefc16e781998-03-12 21:03:26 +0000195
196sub do_cmd_envvar{
197 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000198 my $envvar = next_argument();
199 my($name,$aname,$ahref) = new_link_info();
Fred Drake166abba1998-04-08 23:10:54 +0000200 # The <tt> here is really to keep buildindex.py from making
201 # the variable name case-insensitive.
202 add_index_entry("environment variables!$envvar@<tt>\$$envvar</tt>",
203 $ahref);
Fred Drake42b31a51998-03-27 05:16:10 +0000204 add_index_entry("$envvar@\$$envvar", $ahref);
Fred Draked37cecf1999-09-23 16:45:08 +0000205 $aname =~ s/<a/<a class=envvar/;
206 return "$aname\$$envvar</a>" . $_;
Fred Drakefc16e781998-03-12 21:03:26 +0000207}
208
Fred Drake6659c301998-03-03 22:02:19 +0000209sub do_cmd_url{
210 # use the URL as both text and hyperlink
211 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000212 my $url = next_argument();
Fred Drake6659c301998-03-03 22:02:19 +0000213 $url =~ s/~/&#126;/g;
Fred Draked37cecf1999-09-23 16:45:08 +0000214 return "<a class=url href=\"$url\">$url</a>" . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000215}
216
217sub do_cmd_manpage{
218 # two parameters: \manpage{name}{section}
219 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000220 my $page = next_argument();
221 my $section = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000222 return "<span class=manpage><i>$page</i>($section)</span>" . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000223}
224
225sub do_cmd_rfc{
226 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000227 my $rfcnumber = next_argument();
228 my $id = "rfcref-" . ++$global{'max_id'};
Fred Drake2eff3c51998-12-22 18:02:25 +0000229 my $href =
230 "http://info.internet.isi.edu/in-notes/rfc/files/rfc$rfcnumber.txt";
Fred Drake6659c301998-03-03 22:02:19 +0000231 # Save the reference
Fred Drake08932051998-04-17 02:15:42 +0000232 my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
Fred Drakeccc62721999-01-05 22:16:29 +0000233 $index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
Fred Draked52879c1999-09-22 19:58:51 +0000234 return ("<a class=rfc name=\"$id\"\nhref=\"$href\">RFC $rfcnumber</a>"
235 . $_);
Fred Drake6659c301998-03-03 22:02:19 +0000236}
237
Fred Drakec9f5fe01999-11-09 16:59:42 +0000238sub do_cmd_citetitle{
239 local($_) = @_;
240 my $url = next_optional_argument();
241 my $title = next_argument();
242 my $repl = '';
243 if ($url) {
244 $repl = ("<em class='citetitle'><a\n"
245 . " href='$url'\n"
246 . " title='$title'\n"
247 . " >$title</a></em>");
248 }
249 else {
250 $repl = "<em class='citetitle'\n >$title</em>";
251 }
252 return $repl . $_;
253}
254
Fred Drake6659c301998-03-03 22:02:19 +0000255sub do_cmd_deprecated{
256 # two parameters: \deprecated{version}{whattodo}
257 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000258 my $release = next_argument();
259 my $reason = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +0000260 return "<b>Deprecated since release $release.</b>\n$reason<p>" . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000261}
262
Fred Drake897d12b1998-07-27 20:33:17 +0000263sub do_cmd_versionadded{
264 # one parameter: \versionadded{version}
265 local($_) = @_;
266 my $release = next_argument();
Fred Drake2116d981999-02-02 18:02:48 +0000267 return "\nNew in version $release.\n" . $_;
Fred Drake897d12b1998-07-27 20:33:17 +0000268}
269
270sub do_cmd_versionchanged{
271 # one parameter: \versionchanged{version}
272 local($_) = @_;
273 my $release = next_argument();
Fred Drake2116d981999-02-02 18:02:48 +0000274 return "\nChanged in version $release.\n" . $_;
Fred Drake897d12b1998-07-27 20:33:17 +0000275}
276
Fred Drake557460c1999-03-02 16:05:35 +0000277#
Fred Drake2cafcbb1999-03-25 16:57:04 +0000278# These function handle platform dependency tracking.
Fred Drake557460c1999-03-02 16:05:35 +0000279#
280sub do_cmd_platform{
281 local($_) = @_;
282 my $platform = next_argument();
283 $ModulePlatforms{$THIS_MODULE} = $platform;
284 $platform = "Macintosh"
Fred Drake085b8121999-04-21 14:00:29 +0000285 if $platform eq 'Mac';
Fred Drake557460c1999-03-02 16:05:35 +0000286 return "\n<p class=availability>Availability: <span"
287 . "\n class=platform>$platform</span>.</p>\n" . $_;
288}
289
Fred Drake557460c1999-03-02 16:05:35 +0000290$IGNORE_PLATFORM_ANNOTATION = '';
291sub do_cmd_ignorePlatformAnnotation{
292 local($_) = @_;
293 $IGNORE_PLATFORM_ANNOTATION = next_argument();
294 return $_;
295}
296
Fred Drake6659c301998-03-03 22:02:19 +0000297
298# index commands
299
300$INDEX_SUBITEM = "";
301
302sub get_indexsubitem{
Fred Drake7d45f6d1999-01-05 14:39:27 +0000303 return $INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
Fred Drake6659c301998-03-03 22:02:19 +0000304}
305
306sub do_cmd_setindexsubitem{
307 local($_) = @_;
Fred Drake2e1ee3e1999-02-10 21:17:04 +0000308 $INDEX_SUBITEM = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +0000309 return $_;
Fred Drake6659c301998-03-03 22:02:19 +0000310}
311
Fred Drakefc16e781998-03-12 21:03:26 +0000312sub do_cmd_withsubitem{
Fred Drake7d45f6d1999-01-05 14:39:27 +0000313 # We can't really do the right thing, because LaTeX2HTML doesn't
Fred Drakefc16e781998-03-12 21:03:26 +0000314 # do things in the right order, but we need to at least strip this stuff
315 # out, and leave anything that the second argument expanded out to.
316 #
317 local($_) = @_;
Fred Drake7d45f6d1999-01-05 14:39:27 +0000318 my $oldsubitem = $INDEX_SUBITEM;
319 $INDEX_SUBITEM = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000320 my $stuff = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000321 my $br_id = ++$globals{'max_id'};
322 my $marker = "$O$br_id$C";
Fred Drake7d45f6d1999-01-05 14:39:27 +0000323 return
324 $stuff
Fred Drakeccc62721999-01-05 22:16:29 +0000325 . "\\setindexsubitem$marker$oldsubitem$marker"
Fred Drake7d45f6d1999-01-05 14:39:27 +0000326 . $_;
Fred Drakefc16e781998-03-12 21:03:26 +0000327}
328
Fred Drake08932051998-04-17 02:15:42 +0000329# This is the prologue macro which is required to start writing the
Fred Drakeab032151999-05-13 18:36:54 +0000330# mod\jobname.idx file; we can just ignore it. (Defining this suppresses
331# a warning that \makemodindex is unknown.)
Fred Drake08932051998-04-17 02:15:42 +0000332#
Fred Drake62e43691998-08-10 19:40:44 +0000333sub do_cmd_makemodindex{ return @_[0]; }
Fred Drakefc16e781998-03-12 21:03:26 +0000334
Fred Drake42b31a51998-03-27 05:16:10 +0000335# We're in the document subdirectory when this happens!
Fred Drake166abba1998-04-08 23:10:54 +0000336#
Fred Drake08932051998-04-17 02:15:42 +0000337open(IDXFILE, '>index.dat') || die "\n$!\n";
338open(INTLABELS, '>intlabels.pl') || die "\n$!\n";
Fred Drake166abba1998-04-08 23:10:54 +0000339print INTLABELS "%internal_labels = ();\n";
340print INTLABELS "1; # hack in case there are no entries\n\n";
341
342# Using \0 for this is bad because we can't use common tools to work with the
343# resulting files. Things like grep can be useful with this stuff!
344#
345$IDXFILE_FIELD_SEP = "\1";
346
Fred Drakeccc62721999-01-05 22:16:29 +0000347sub write_idxfile{
348 my ($ahref, $str) = @_;
349 print IDXFILE $ahref, $IDXFILE_FIELD_SEP, $str, "\n";
Fred Drake42b31a51998-03-27 05:16:10 +0000350}
351
Fred Drake42b31a51998-03-27 05:16:10 +0000352
353sub gen_link{
354 my($node,$target) = @_;
355 print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
Fred Drake62e43691998-08-10 19:40:44 +0000356 return "<a href=\"$node#$target\">";
Fred Drake42b31a51998-03-27 05:16:10 +0000357}
358
Fred Drake42b31a51998-03-27 05:16:10 +0000359sub add_index_entry{
360 # add an entry to the index structures; ignore the return value
361 my($str,$ahref) = @_;
362 $str = gen_index_id($str, '');
363 $index{$str} .= $ahref;
Fred Drakeccc62721999-01-05 22:16:29 +0000364 write_idxfile($ahref, $str);
Fred Drake42b31a51998-03-27 05:16:10 +0000365}
366
Fred Drakeccc62721999-01-05 22:16:29 +0000367sub new_link_info{
368 my $name = "l2h-" . ++$globals{'max_id'};
369 my $aname = '<a name="' . $name . '">';
Fred Drake42b31a51998-03-27 05:16:10 +0000370 my $ahref = gen_link($CURRENT_FILE, $name);
371 return ($name, $aname, $ahref);
372}
373
Fred Drakeab032151999-05-13 18:36:54 +0000374$IndexMacroPattern = '';
375sub define_indexing_macro{
376 my $count = @_;
377 my $i = 0;
378 for (; $i < $count; ++$i) {
379 my $name = @_[$i];
380 my $cmd = "idx_cmd_$name";
381 die "\nNo function $cmd() defined!\n"
382 if (!defined &$cmd);
383 eval ("sub do_cmd_$name { return process_index_macros("
384 . "\@_[0], '$name'); }");
385 if (length($IndexMacroPattern) == 0) {
386 $IndexMacroPattern = "$name";
387 }
388 else {
389 $IndexMacroPattern .= "|$name";
390 }
391 }
392}
393
394$DEBUG_INDEXING = 0;
395sub process_index_macros{
Fred Drake42b31a51998-03-27 05:16:10 +0000396 local($_) = @_;
Fred Drakeab032151999-05-13 18:36:54 +0000397 my $cmdname = @_[1]; # This is what triggered us in the first place;
398 # we know it's real, so just process it.
Fred Drakeccc62721999-01-05 22:16:29 +0000399 my($name,$aname,$ahref) = new_link_info();
Fred Drakeab032151999-05-13 18:36:54 +0000400 my $cmd = "idx_cmd_$cmdname";
401 print "\nIndexing: \\$cmdname"
402 if $DEBUG_INDEXING;
403 &$cmd($ahref); # modifies $_ and adds index entries
404 while (/^[\s\n]*\\($IndexMacroPattern)</) {
405 $cmdname = "$1";
406 print " \\$cmdname"
407 if $DEBUG_INDEXING;
408 $cmd = "idx_cmd_$cmdname";
409 if (!defined &$cmd) {
410 last;
411 }
412 else {
413 s/^[\s\n]*\\$cmdname//;
414 &$cmd($ahref);
415 }
416 }
Fred Drake62e43691998-08-10 19:40:44 +0000417 return "$aname$anchor_invisible_mark</a>" . $_;
Fred Drake42b31a51998-03-27 05:16:10 +0000418}
419
Fred Drakeab032151999-05-13 18:36:54 +0000420define_indexing_macro('index');
421sub idx_cmd_index{
Fred Drakeccc62721999-01-05 22:16:29 +0000422 my $str = next_argument();
Fred Drakeab032151999-05-13 18:36:54 +0000423 add_index_entry("$str", @_[0]);
Fred Drake2e7edb81998-05-11 18:31:17 +0000424}
425
Fred Drakeab032151999-05-13 18:36:54 +0000426define_indexing_macro('kwindex');
427sub idx_cmd_kwindex{
428 my $str = next_argument();
429 add_index_entry("<tt>$str</tt>!keyword", @_[0]);
430 add_index_entry("keyword!<tt>$str</tt>", @_[0]);
431}
432
433define_indexing_macro('indexii');
434sub idx_cmd_indexii{
Fred Drakeccc62721999-01-05 22:16:29 +0000435 my $str1 = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000436 my $str2 = next_argument();
Fred Drakeab032151999-05-13 18:36:54 +0000437 add_index_entry("$str1!$str2", @_[0]);
438 add_index_entry("$str2!$str1", @_[0]);
Fred Drake6659c301998-03-03 22:02:19 +0000439}
440
Fred Drakeab032151999-05-13 18:36:54 +0000441define_indexing_macro('indexiii');
442sub idx_cmd_indexiii{
Fred Drakeccc62721999-01-05 22:16:29 +0000443 my $str1 = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000444 my $str2 = next_argument();
445 my $str3 = next_argument();
Fred Drakeab032151999-05-13 18:36:54 +0000446 add_index_entry("$str1!$str2 $str3", @_[0]);
447 add_index_entry("$str2!$str3, $str1", @_[0]);
448 add_index_entry("$str3!$str1 $str2", @_[0]);
Fred Drake6659c301998-03-03 22:02:19 +0000449}
450
Fred Drakeab032151999-05-13 18:36:54 +0000451define_indexing_macro('indexiv');
452sub idx_cmd_indexiv{
Fred Drakeccc62721999-01-05 22:16:29 +0000453 my $str1 = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000454 my $str2 = next_argument();
455 my $str3 = next_argument();
456 my $str4 = next_argument();
Fred Drakeab032151999-05-13 18:36:54 +0000457 add_index_entry("$str1!$str2 $str3 $str4", @_[0]);
458 add_index_entry("$str2!$str3 $str4, $str1", @_[0]);
459 add_index_entry("$str3!$str4, $str1 $str2", @_[0]);
460 add_index_entry("$str4!$$str1 $str2 $str3", @_[0]);
Fred Drake6659c301998-03-03 22:02:19 +0000461}
462
Fred Drakeab032151999-05-13 18:36:54 +0000463define_indexing_macro('ttindex');
464sub idx_cmd_ttindex{
Fred Drakeccc62721999-01-05 22:16:29 +0000465 my $str = next_argument();
466 my $entry = $str . get_indexsubitem();
Fred Drakeab032151999-05-13 18:36:54 +0000467 add_index_entry($entry, @_[0]);
Fred Drakec9a44381998-03-17 06:29:13 +0000468}
Fred Drake6659c301998-03-03 22:02:19 +0000469
470sub my_typed_index_helper{
Fred Drakeab032151999-05-13 18:36:54 +0000471 my($word,$ahref) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000472 my $str = next_argument();
Fred Drake42b31a51998-03-27 05:16:10 +0000473 add_index_entry("$str $word", $ahref);
474 add_index_entry("$word!$str", $ahref);
Fred Drake6659c301998-03-03 22:02:19 +0000475}
476
Fred Drakeab032151999-05-13 18:36:54 +0000477define_indexing_macro('stindex', 'opindex', 'exindex', 'obindex');
478sub idx_cmd_stindex{ my_typed_index_helper('statement', @_[0]); }
479sub idx_cmd_opindex{ my_typed_index_helper('operator', @_[0]); }
480sub idx_cmd_exindex{ my_typed_index_helper('exception', @_[0]); }
481sub idx_cmd_obindex{ my_typed_index_helper('object', @_[0]); }
Fred Drake6659c301998-03-03 22:02:19 +0000482
Fred Drakeab032151999-05-13 18:36:54 +0000483define_indexing_macro('bifuncindex');
484sub idx_cmd_bifuncindex{
Fred Drakeccc62721999-01-05 22:16:29 +0000485 my $str = next_argument();
Fred Drakeab032151999-05-13 18:36:54 +0000486 add_index_entry("<tt>$str()</tt> (built-in function)", @_[0]);
Fred Drake6659c301998-03-03 22:02:19 +0000487}
488
489
Fred Drake6659c301998-03-03 22:02:19 +0000490sub make_mod_index_entry{
Fred Drakeccc62721999-01-05 22:16:29 +0000491 my($str,$define) = @_;
492 my($name,$aname,$ahref) = new_link_info();
Fred Drake42b31a51998-03-27 05:16:10 +0000493 # equivalent of add_index_entry() using $define instead of ''
Fred Drake2e1ee3e1999-02-10 21:17:04 +0000494 $ahref =~ s/\#[-_a-zA-Z0-9]*\"/\"/
495 if ($define eq 'DEF');
Fred Drake42b31a51998-03-27 05:16:10 +0000496 $str = gen_index_id($str, $define);
497 $index{$str} .= $ahref;
Fred Drakeccc62721999-01-05 22:16:29 +0000498 write_idxfile($ahref, $str);
Fred Drake42b31a51998-03-27 05:16:10 +0000499
Fred Drakec9a44381998-03-17 06:29:13 +0000500 if ($define eq 'DEF') {
Fred Drake42b31a51998-03-27 05:16:10 +0000501 # add to the module index
Fred Drakec9a44381998-03-17 06:29:13 +0000502 my($nstr,$garbage) = split / /, $str, 2;
Fred Drake42b31a51998-03-27 05:16:10 +0000503 $Modules{$nstr} .= $ahref;
Fred Drake6659c301998-03-03 22:02:19 +0000504 }
Fred Drake62e43691998-08-10 19:40:44 +0000505 return "$aname$anchor_invisible_mark</a>";
Fred Drake6659c301998-03-03 22:02:19 +0000506}
507
Fred Drake557460c1999-03-02 16:05:35 +0000508
Fred Drakec9a44381998-03-17 06:29:13 +0000509$THIS_MODULE = '';
Fred Drake42b31a51998-03-27 05:16:10 +0000510$THIS_CLASS = '';
Fred Drakec9a44381998-03-17 06:29:13 +0000511
Fred Drakea0f4c941998-07-24 22:16:04 +0000512sub define_module{
513 my($word,$name) = @_;
Fred Drakec9a44381998-03-17 06:29:13 +0000514 my $section_tag = join('', @curr_sec_id);
Fred Drake3e4c6141999-05-17 15:00:32 +0000515 if ($word ne "built-in" && $word ne "extension"
516 && $word ne "standard" && $word ne "") {
517 write_warnings("Bad module type '$word'"
518 . " for \\declaremodule (module $name)");
519 $word = "";
520 }
Fred Drake6659c301998-03-03 22:02:19 +0000521 $word = "$word " if $word;
Fred Drakea0f4c941998-07-24 22:16:04 +0000522 $THIS_MODULE = "$name";
Fred Drake2e1ee3e1999-02-10 21:17:04 +0000523 $INDEX_SUBITEM = "(in $name)";
524 print "[$name]";
Fred Drakeccc62721999-01-05 22:16:29 +0000525 return make_mod_index_entry("<tt>$name</tt> (${word}module)", 'DEF');
Fred Drakea0f4c941998-07-24 22:16:04 +0000526}
527
528sub my_module_index_helper{
529 local($word, $_) = @_;
530 my $name = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +0000531 return define_module($word, $name) . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000532}
533
Fred Drake62e43691998-08-10 19:40:44 +0000534sub do_cmd_modindex{ return my_module_index_helper('', @_); }
535sub do_cmd_bimodindex{ return my_module_index_helper('built-in', @_); }
536sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); }
537sub do_cmd_stmodindex{ return my_module_index_helper('standard', @_); }
Fred Drake6659c301998-03-03 22:02:19 +0000538
Fred Drakeab032151999-05-13 18:36:54 +0000539sub ref_module_index_helper{
540 local($word, $ahref) = @_;
541 my $str = next_argument();
542 $word = "$word " if $word;
543 $str = "<tt>$str</tt> (${word}module)";
544 # can't use add_index_entry() since the 2nd arg to gen_index_id() is used;
545 # just inline it all here
546 $str = gen_index_id($str, 'REF');
547 $index{$str} .= $ahref;
548 write_idxfile($ahref, $str);
549}
550
Fred Drake6659c301998-03-03 22:02:19 +0000551# these should be adjusted a bit....
Fred Drakeab032151999-05-13 18:36:54 +0000552define_indexing_macro('refmodindex', 'refbimodindex',
553 'refexmodindex', 'refstmodindex');
554sub idx_cmd_refmodindex{ return ref_module_index_helper('', @_); }
555sub idx_cmd_refbimodindex{ return ref_module_index_helper('built-in', @_); }
556sub idx_cmd_refexmodindex{ return ref_module_index_helper('extension', @_); }
557sub idx_cmd_refstmodindex{ return ref_module_index_helper('standard', @_); }
Fred Drake6659c301998-03-03 22:02:19 +0000558
Fred Drake62e43691998-08-10 19:40:44 +0000559sub do_cmd_nodename{ return do_cmd_label(@_); }
Fred Drake6659c301998-03-03 22:02:19 +0000560
561sub init_myformat{
Fred Drake08932051998-04-17 02:15:42 +0000562# $anchor_invisible_mark = '';
Fred Drake6659c301998-03-03 22:02:19 +0000563 $anchor_mark = '';
564 $icons{'anchor_mark'} = '';
Fred Drake6659c301998-03-03 22:02:19 +0000565}
Fred Drake42b31a51998-03-27 05:16:10 +0000566init_myformat();
Fred Drake6659c301998-03-03 22:02:19 +0000567
Fred Drakeab032151999-05-13 18:36:54 +0000568# Create an index entry, but include the string in the target anchor
Fred Drake6659c301998-03-03 22:02:19 +0000569# instead of the dummy filler.
570#
571sub make_str_index_entry{
Fred Drakeccc62721999-01-05 22:16:29 +0000572 my($str) = @_;
573 my($name,$aname,$ahref) = new_link_info();
Fred Drake42b31a51998-03-27 05:16:10 +0000574 add_index_entry($str, $ahref);
Fred Drake62e43691998-08-10 19:40:44 +0000575 return "$aname$str</a>";
Fred Drake6659c301998-03-03 22:02:19 +0000576}
577
Fred Drake6659c301998-03-03 22:02:19 +0000578sub do_env_cfuncdesc{
579 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000580 my $return_type = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000581 my $function_name = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000582 my $arg_list = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000583 my $idx = make_str_index_entry("<tt class=cfunction>$function_name()</tt>"
Fred Drakeccc62721999-01-05 22:16:29 +0000584 . get_indexsubitem());
Fred Drake08932051998-04-17 02:15:42 +0000585 $idx =~ s/ \(.*\)//;
586 $idx =~ s/\(\)//; # ????
Fred Drake2e1ee3e1999-02-10 21:17:04 +0000587 return "<dl><dt>$return_type <b>$idx</b> (<var>$arg_list</var>)\n<dd>"
Fred Drake62e43691998-08-10 19:40:44 +0000588 . $_
589 . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000590}
591
592sub do_env_ctypedesc{
593 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000594 my $type_name = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000595 my $idx = make_str_index_entry("<tt class=ctype>$type_name</tt>"
596 . get_indexsubitem());
Fred Drake08932051998-04-17 02:15:42 +0000597 $idx =~ s/ \(.*\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000598 return "<dl><dt><b>$idx</b>\n<dd>"
599 . $_
600 . '</dl>'
Fred Drake6659c301998-03-03 22:02:19 +0000601}
602
603sub do_env_cvardesc{
604 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000605 my $var_type = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000606 my $var_name = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000607 my $idx = make_str_index_entry("<tt class=cdata>$var_name</tt>"
608 . get_indexsubitem());
Fred Drake08932051998-04-17 02:15:42 +0000609 $idx =~ s/ \(.*\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000610 return "<dl><dt>$var_type <b>$idx</b>\n"
611 . '<dd>'
612 . $_
613 . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000614}
615
616sub do_env_funcdesc{
617 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000618 my $function_name = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000619 my $arg_list = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000620 my $idx = make_str_index_entry("<tt class=function>$function_name()</tt>"
Fred Drake08932051998-04-17 02:15:42 +0000621 . get_indexsubitem());
622 $idx =~ s/ \(.*\)//;
Fred Drakeccc62721999-01-05 22:16:29 +0000623 $idx =~ s/\(\)<\/tt>/<\/tt>/;
Fred Drake62e43691998-08-10 19:40:44 +0000624 return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000625}
626
627sub do_env_funcdescni{
628 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000629 my $function_name = next_argument();
630 my $arg_list = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000631 return "<dl><dt><b><tt class=function>$function_name</tt></b>"
632 . " (<var>$arg_list</var>)\n"
633 . '<dd>'
634 . $_
635 . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000636}
637
638sub do_cmd_funcline{
639 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000640 my $function_name = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000641 my $arg_list = next_argument();
Fred Drakeca675e41999-04-21 15:58:58 +0000642 my $prefix = "<tt class=function>$function_name()</tt>";
643 my $idx = make_str_index_entry($prefix . get_indexsubitem());
644 $prefix =~ s/\(\)//;
645
646 return "<dt><b>$prefix</b> (<var>$arg_list</var>)\n<dd>" . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000647}
648
Fred Drake6b3fb781999-07-12 16:50:09 +0000649sub do_cmd_funclineni{
650 local($_) = @_;
651 my $function_name = next_argument();
652 my $arg_list = next_argument();
653 my $prefix = "<tt class=function>$function_name</tt>";
654
655 return "<dt><b>$prefix</b> (<var>$arg_list</var>)\n<dd>" . $_;
656}
657
Fred Drake6659c301998-03-03 22:02:19 +0000658# Change this flag to index the opcode entries. I don't think it's very
659# useful to index them, since they're only presented to describe the dis
660# module.
661#
662$INDEX_OPCODES = 0;
663
664sub do_env_opcodedesc{
665 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000666 my $opcode_name = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000667 my $arg_list = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000668 my $idx;
669 if ($INDEX_OPCODES) {
Fred Drakeccc62721999-01-05 22:16:29 +0000670 $idx = make_str_index_entry(
Fred Drake90fdda51999-02-16 20:27:42 +0000671 "<tt class=opcode>$opcode_name</tt> (byte code instruction)");
Fred Drake08932051998-04-17 02:15:42 +0000672 $idx =~ s/ \(byte code instruction\)//;
673 }
674 else {
Fred Drake90fdda51999-02-16 20:27:42 +0000675 $idx = "<tt class=opcode>$opcode_name</tt>";
Fred Drake08932051998-04-17 02:15:42 +0000676 }
677 my $stuff = "<dl><dt><b>$idx</b>";
Fred Drake6659c301998-03-03 22:02:19 +0000678 if ($arg_list) {
679 $stuff .= "&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
680 }
Fred Drake62e43691998-08-10 19:40:44 +0000681 return $stuff . "\n<dd>" . $_ . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000682}
683
684sub do_env_datadesc{
685 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000686 my $dataname = next_argument();
687 my $idx = make_str_index_entry("<tt>$dataname</tt>" . get_indexsubitem());
Fred Drake08932051998-04-17 02:15:42 +0000688 $idx =~ s/ \(.*\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000689 return "<dl><dt><b>$idx</b>\n<dd>"
690 . $_
691 . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000692}
693
694sub do_env_datadescni{
695 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000696 my $idx = next_argument();
697 if (! $STRING_INDEX_TT) {
698 $idx = "<tt>$idx</tt>";
Fred Drake6659c301998-03-03 22:02:19 +0000699 }
Fred Drake62e43691998-08-10 19:40:44 +0000700 return "<dl><dt><b>$idx</b>\n<dd>" . $_ . '</dl>';
Fred Drake6659c301998-03-03 22:02:19 +0000701}
702
703sub do_cmd_dataline{
704 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000705 my $data_name = next_argument();
706 my $idx = make_str_index_entry("<tt>$data_name</tt>" . get_indexsubitem());
Fred Drake6659c301998-03-03 22:02:19 +0000707 $idx =~ s/ \(.*\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000708 return "<dt><b>$idx</b><dd>" . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000709}
710
Fred Drake42b31a51998-03-27 05:16:10 +0000711sub do_env_excdesc{
712 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +0000713 my $excname = next_argument();
Fred Drake90fdda51999-02-16 20:27:42 +0000714 my $idx = make_str_index_entry("<tt class=exception>$excname</tt>");
Fred Drake62e43691998-08-10 19:40:44 +0000715 return "<dl><dt><b>$idx</b>\n<dd>" . $_ . '</dl>'
Fred Drake42b31a51998-03-27 05:16:10 +0000716}
717
Fred Drake62e43691998-08-10 19:40:44 +0000718sub do_env_fulllineitems{ return do_env_itemize(@_); }
Fred Drake6659c301998-03-03 22:02:19 +0000719
720
Fred Drakec9a44381998-03-17 06:29:13 +0000721sub do_env_classdesc{
722 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000723 $THIS_CLASS = next_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000724 my $arg_list = next_argument();
725 $idx = make_str_index_entry(
Fred Drake90fdda51999-02-16 20:27:42 +0000726 "<tt class=class>$THIS_CLASS</tt> (class in $THIS_MODULE)" );
Fred Drake08932051998-04-17 02:15:42 +0000727 $idx =~ s/ \(.*\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000728 return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>';
Fred Drakec9a44381998-03-17 06:29:13 +0000729}
730
Fred Drake42b31a51998-03-27 05:16:10 +0000731
732sub do_env_methoddesc{
733 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000734 my $class_name = next_optional_argument();
735 $class_name = $THIS_CLASS
736 unless $class_name;
Fred Drake5a0ca4e1999-01-12 04:16:51 +0000737 my $method = next_argument();
Fred Drake08932051998-04-17 02:15:42 +0000738 my $arg_list = next_argument();
739 my $extra = '';
740 if ($class_name) {
741 $extra = " ($class_name method)";
Fred Drake42b31a51998-03-27 05:16:10 +0000742 }
Fred Drake90fdda51999-02-16 20:27:42 +0000743 my $idx = make_str_index_entry("<tt class=method>$method()</tt>$extra");
Fred Drake08932051998-04-17 02:15:42 +0000744 $idx =~ s/ \(.*\)//;
745 $idx =~ s/\(\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000746 return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>';
Fred Drake42b31a51998-03-27 05:16:10 +0000747}
748
749
Fred Drake7d45f6d1999-01-05 14:39:27 +0000750sub do_cmd_methodline{
751 local($_) = @_;
752 my $class_name = next_optional_argument();
753 $class_name = $THIS_CLASS
754 unless $class_name;
755 my $method = next_argument();
756 my $arg_list = next_argument();
757 my $extra = '';
758 if ($class_name) {
759 $extra = " ($class_name method)";
760 }
Fred Drake90fdda51999-02-16 20:27:42 +0000761 my $idx = make_str_index_entry("<tt class=method>$method()</tt>$extra");
Fred Drake7d45f6d1999-01-05 14:39:27 +0000762 $idx =~ s/ \(.*\)//;
763 $idx =~ s/\(\)//;
764 return "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>"
765 . $_;
766}
767
768
Fred Draked64a40d1998-09-10 18:59:13 +0000769sub do_cmd_methodlineni{
770 local($_) = @_;
771 next_optional_argument();
772 my $method = next_argument();
773 my $arg_list = next_argument();
774 return "<dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
775 . $_;
776}
777
Fred Drake42b31a51998-03-27 05:16:10 +0000778sub do_env_methoddescni{
779 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000780 next_optional_argument();
781 my $method = next_argument();
782 my $arg_list = next_argument();
Fred Drake62e43691998-08-10 19:40:44 +0000783 return "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
784 . $_
785 . '</dl>';
Fred Drake42b31a51998-03-27 05:16:10 +0000786}
787
788
789sub do_env_memberdesc{
790 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000791 my $class = next_optional_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000792 my $member = next_argument();
Fred Drake42b31a51998-03-27 05:16:10 +0000793 $class = $THIS_CLASS
794 unless $class;
Fred Drake08932051998-04-17 02:15:42 +0000795 my $extra = '';
Fred Drake085b8121999-04-21 14:00:29 +0000796 $extra = " ($class attribute)"
797 if ($class ne '');
798 my $idx = make_str_index_entry("<tt class=member>$member</tt>$extra");
Fred Drake42b31a51998-03-27 05:16:10 +0000799 $idx =~ s/ \(.*\)//;
800 $idx =~ s/\(\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000801 return "<dl><dt><b>$idx</b>\n<dd>" . $_ . '</dl>';
Fred Drake42b31a51998-03-27 05:16:10 +0000802}
803
804
Fred Drake5ccf3301998-04-17 20:04:09 +0000805sub do_cmd_memberline{
806 local($_) = @_;
807 my $class = next_optional_argument();
Fred Drakeccc62721999-01-05 22:16:29 +0000808 my $member = next_argument();
Fred Drake5ccf3301998-04-17 20:04:09 +0000809 $class = $THIS_CLASS
810 unless $class;
811 my $extra = '';
Fred Drake085b8121999-04-21 14:00:29 +0000812 $extra = " ($class attribute)"
813 if ($class ne '');
Fred Drake90fdda51999-02-16 20:27:42 +0000814 my $idx = make_str_index_entry("<tt class=member>$member</tt>$extra");
Fred Drake5ccf3301998-04-17 20:04:09 +0000815 $idx =~ s/ \(.*\)//;
816 $idx =~ s/\(\)//;
Fred Drake62e43691998-08-10 19:40:44 +0000817 return "<dt><b>$idx</b><dd>" . $_;
Fred Drake5ccf3301998-04-17 20:04:09 +0000818}
819
Fred Drake42b31a51998-03-27 05:16:10 +0000820sub do_env_memberdescni{
821 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000822 next_optional_argument();
823 my $member = next_argument();
Fred Drake085b8121999-04-21 14:00:29 +0000824 return "<dl><dt><b><tt class=member>$member</tt></b>\n<dd>" . $_ . '</dl>';
Fred Drake42b31a51998-03-27 05:16:10 +0000825}
826
827
Fred Drake5ccf3301998-04-17 20:04:09 +0000828sub do_cmd_memberlineni{
829 local($_) = @_;
830 next_optional_argument();
831 my $member = next_argument();
Fred Drake085b8121999-04-21 14:00:29 +0000832 return "<dt><b><tt class=member>$member</tt></b><dd>" . $_;
Fred Drake5ccf3301998-04-17 20:04:09 +0000833}
834
Fred Drakea0f4c941998-07-24 22:16:04 +0000835@col_aligns = ("<td>", "<td>", "<td>", "<td>");
Fred Drake6659c301998-03-03 22:02:19 +0000836
Fred Drake15799ed1999-02-12 19:23:17 +0000837$TABLE_HEADER_BGCOLOR = $NAV_BGCOLOR;
838
Fred Drake79189b51999-04-28 13:54:30 +0000839sub get_th{
840 my $a = @_[0];
841 my $r = '<th>';
842 if ($a eq 'l')
843 { $r = '<th align=left>'; }
844 elsif (substr($a, 0, 1) eq 'p')
845 { $r = '<th align=left>'; }
846 elsif ($a eq 'r')
847 { $r = '<th align=right>'; }
848 return $r;
849}
850
Fred Drakef74e5b71999-04-28 14:58:49 +0000851sub fix_font{
852 # do a little magic on a font name to get the right behavior in the first
853 # column of the output table
854 my $font = @_[0];
855 if ($font eq 'textrm') {
856 $font = '';
857 }
858 elsif ($font eq 'file' || $font eq 'filenq') {
859 $font = 'tt class=file';
860 }
861 return $font;
862}
863
Fred Drake6659c301998-03-03 22:02:19 +0000864sub setup_column_alignments{
865 local($_) = @_;
Fred Drakea0f4c941998-07-24 22:16:04 +0000866 my($a1,$a2,$a3,$a4) = split(/[|]/,$_);
867 my($th1,$th2,$th3,$th4) = ('<th>', '<th>', '<th>', '<th>');
Fred Drakeea07f271999-04-28 17:11:21 +0000868 $col_aligns[0] = (($a1 eq 'c') ? '<td align=center valign=baseline>'
869 : '<td valign=baseline>');
Fred Drake08932051998-04-17 02:15:42 +0000870 $col_aligns[1] = (($a2 eq 'c') ? '<td align=center>' : '<td>');
871 $col_aligns[2] = (($a3 eq 'c') ? '<td align=center>' : '<td>');
Fred Drakea0f4c941998-07-24 22:16:04 +0000872 $col_aligns[3] = (($a4 eq 'c') ? '<td align=center>' : '<td>');
Fred Drake79189b51999-04-28 13:54:30 +0000873 # return the aligned header start tags
874 return (get_th($a1), get_th($a2), get_th($a3), get_th($a4));
Fred Drake6659c301998-03-03 22:02:19 +0000875}
876
877sub do_env_tableii{
878 local($_) = @_;
Fred Drakea0f4c941998-07-24 22:16:04 +0000879 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
Fred Drakef74e5b71999-04-28 14:58:49 +0000880 my $font = fix_font(next_argument());
Fred Drake08932051998-04-17 02:15:42 +0000881 my $h1 = next_argument();
882 my $h2 = next_argument();
Fred Drakef74e5b71999-04-28 14:58:49 +0000883 s/[\s\n]+//;
Fred Drake08932051998-04-17 02:15:42 +0000884 $globals{'lineifont'} = $font;
Fred Drakeab032151999-05-13 18:36:54 +0000885 return '<table border align=center style="border-collapse: collapse">'
Fred Drakef74e5b71999-04-28 14:58:49 +0000886 . "\n <thead>"
887 . "\n <tr$TABLE_HEADER_BGCOLOR>"
Fred Drakeab032151999-05-13 18:36:54 +0000888 . "\n $th1<b>$h1</b>\&nbsp;\&nbsp;</th>"
889 . "\n $th2<b>$h2</b>\&nbsp;\&nbsp;</th>"
Fred Drakef74e5b71999-04-28 14:58:49 +0000890 . "\n </thead>"
891 . "\n <tbody valign=baseline>"
Fred Drake62e43691998-08-10 19:40:44 +0000892 . $_
Fred Drakef74e5b71999-04-28 14:58:49 +0000893 . "\n </tbody>"
894 . "\n</table>";
Fred Drake6659c301998-03-03 22:02:19 +0000895}
896
897sub do_cmd_lineii{
898 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000899 my $c1 = next_argument();
900 my $c2 = next_argument();
Fred Drakef74e5b71999-04-28 14:58:49 +0000901 s/[\s\n]+//;
Fred Drake08932051998-04-17 02:15:42 +0000902 my($font,$sfont,$efont) = ($globals{'lineifont'}, '', '');
Fred Drake58b2bfd1998-04-02 20:14:04 +0000903 if ($font) {
Fred Drake5cca42e1998-04-09 17:59:11 +0000904 $sfont = "<$font>";
Fred Drake58b2bfd1998-04-02 20:14:04 +0000905 $efont = "</$font>";
Fred Drakef74e5b71999-04-28 14:58:49 +0000906 $efont =~ s/ .*>/>/;
Fred Drake58b2bfd1998-04-02 20:14:04 +0000907 }
Fred Drakec9a44381998-03-17 06:29:13 +0000908 my($c1align,$c2align) = @col_aligns[0,1];
Fred Drakef74e5b71999-04-28 14:58:49 +0000909 return "\n <tr>$c1align$sfont$c1$efont</td>\n"
910 . " $c2align$c2\&nbsp;</td>"
Fred Drake62e43691998-08-10 19:40:44 +0000911 . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000912}
913
914sub do_env_tableiii{
915 local($_) = @_;
Fred Drakea0f4c941998-07-24 22:16:04 +0000916 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
Fred Drakef74e5b71999-04-28 14:58:49 +0000917 my $font = fix_font(next_argument());
Fred Drake08932051998-04-17 02:15:42 +0000918 my $h1 = next_argument();
919 my $h2 = next_argument();
920 my $h3 = next_argument();
Fred Drakef74e5b71999-04-28 14:58:49 +0000921 s/[\s\n]+//;
Fred Drake08932051998-04-17 02:15:42 +0000922 $globals{'lineifont'} = $font;
Fred Drakeab032151999-05-13 18:36:54 +0000923 return '<table border align=center style="border-collapse: collapse">'
Fred Drakef74e5b71999-04-28 14:58:49 +0000924 . "\n <thead>"
925 . "\n <tr$TABLE_HEADER_BGCOLOR>"
Fred Drakeab032151999-05-13 18:36:54 +0000926 . "\n $th1<b>$h1</b>\&nbsp;\&nbsp;</th>"
927 . "\n $th2<b>$h2</b>\&nbsp;\&nbsp;</th>"
928 . "\n $th3<b>$h3</b>\&nbsp;\&nbsp;</th>"
Fred Drakef74e5b71999-04-28 14:58:49 +0000929 . "\n </thead>"
930 . "\n <tbody valign=baseline>"
Fred Drake62e43691998-08-10 19:40:44 +0000931 . $_
Fred Drakef74e5b71999-04-28 14:58:49 +0000932 . "\n </tbody>"
933 . "\n</table>";
Fred Drake6659c301998-03-03 22:02:19 +0000934}
935
936sub do_cmd_lineiii{
937 local($_) = @_;
Fred Drake08932051998-04-17 02:15:42 +0000938 my $c1 = next_argument();
939 my $c2 = next_argument();
940 my $c3 = next_argument();
Fred Drakef74e5b71999-04-28 14:58:49 +0000941 s/[\s\n]+//;
Fred Drake08932051998-04-17 02:15:42 +0000942 my($font,$sfont,$efont) = ($globals{'lineifont'}, '', '');
Fred Drake58b2bfd1998-04-02 20:14:04 +0000943 if ($font) {
Fred Drake5cca42e1998-04-09 17:59:11 +0000944 $sfont = "<$font>";
Fred Drake58b2bfd1998-04-02 20:14:04 +0000945 $efont = "</$font>";
Fred Drakef74e5b71999-04-28 14:58:49 +0000946 $efont =~ s/ .*>/>/;
Fred Drake58b2bfd1998-04-02 20:14:04 +0000947 }
Fred Drakea0f4c941998-07-24 22:16:04 +0000948 my($c1align,$c2align,$c3align) = @col_aligns[0,1,2];
Fred Drakef74e5b71999-04-28 14:58:49 +0000949 return "\n <tr>$c1align$sfont$c1$efont</td>\n"
950 . " $c2align$c2</td>\n"
951 . " $c3align$c3\&nbsp;</td>"
Fred Drake62e43691998-08-10 19:40:44 +0000952 . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000953}
954
Fred Drakea0f4c941998-07-24 22:16:04 +0000955sub do_env_tableiv{
956 local($_) = @_;
957 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
Fred Drakef74e5b71999-04-28 14:58:49 +0000958 my $font = fix_font(next_argument());
Fred Drakea0f4c941998-07-24 22:16:04 +0000959 my $h1 = next_argument();
960 my $h2 = next_argument();
961 my $h3 = next_argument();
962 my $h4 = next_argument();
Fred Drakef74e5b71999-04-28 14:58:49 +0000963 s/[\s\n]+//;
Fred Drakea0f4c941998-07-24 22:16:04 +0000964 $globals{'lineifont'} = $font;
Fred Drakeab032151999-05-13 18:36:54 +0000965 return '<table border align=center style="border-collapse: collapse">'
Fred Drakef74e5b71999-04-28 14:58:49 +0000966 . "\n <thead>"
967 . "\n <tr$TABLE_HEADER_BGCOLOR>"
Fred Drakeab032151999-05-13 18:36:54 +0000968 . "\n $th1<b>$h1</b>\&nbsp;\&nbsp;</th>"
969 . "\n $th2<b>$h2</b>\&nbsp;\&nbsp;</th>"
970 . "\n $th3<b>$h3</b>\&nbsp;\&nbsp;</th>"
971 . "\n $th4<b>$h4</b>\&nbsp;\&nbsp;</th>"
Fred Drakef74e5b71999-04-28 14:58:49 +0000972 . "\n </thead>"
973 . "\n <tbody valign=baseline>"
Fred Drake62e43691998-08-10 19:40:44 +0000974 . $_
Fred Drakef74e5b71999-04-28 14:58:49 +0000975 . "\n </tbody>"
976 . "\n</table>";
Fred Drake6659c301998-03-03 22:02:19 +0000977}
978
Fred Drakea0f4c941998-07-24 22:16:04 +0000979sub do_cmd_lineiv{
Fred Drake6659c301998-03-03 22:02:19 +0000980 local($_) = @_;
Fred Drakea0f4c941998-07-24 22:16:04 +0000981 my $c1 = next_argument();
982 my $c2 = next_argument();
983 my $c3 = next_argument();
984 my $c4 = next_argument();
Fred Drakef74e5b71999-04-28 14:58:49 +0000985 s/[\s\n]+//;
Fred Drakea0f4c941998-07-24 22:16:04 +0000986 my($font,$sfont,$efont) = ($globals{'lineifont'}, '', '');
987 if ($font) {
988 $sfont = "<$font>";
989 $efont = "</$font>";
Fred Drakef74e5b71999-04-28 14:58:49 +0000990 $efont =~ s/ .*>/>/;
Fred Drakea0f4c941998-07-24 22:16:04 +0000991 }
992 my($c1align,$c2align,$c3align,$c4align) = @col_aligns;
Fred Drakef74e5b71999-04-28 14:58:49 +0000993 return "\n <tr>$c1align$sfont$c1$efont</td>\n"
994 . " $c2align$c2</td>\n"
995 . " $c3align$c3</td>\n"
996 . " $c4align$c4\&nbsp;</td>"
Fred Drake62e43691998-08-10 19:40:44 +0000997 . $_;
Fred Drake6659c301998-03-03 22:02:19 +0000998}
999
Fred Drake6659c301998-03-03 22:02:19 +00001000sub do_cmd_maketitle {
1001 local($_) = @_;
Fred Drake90fdda51999-02-16 20:27:42 +00001002 my $the_title = "\n<div class=titlepage><center>";
Fred Drake6659c301998-03-03 22:02:19 +00001003 if ($t_title) {
Fred Drake90fdda51999-02-16 20:27:42 +00001004 $the_title .= "\n<h1>$t_title</h1>";
Fred Drake08932051998-04-17 02:15:42 +00001005 } else { write_warnings("\nThis document has no title."); }
Fred Drake6659c301998-03-03 22:02:19 +00001006 if ($t_author) {
1007 if ($t_authorURL) {
Fred Drake08932051998-04-17 02:15:42 +00001008 my $href = translate_commands($t_authorURL);
Fred Drake2d1f81e1999-02-09 16:03:31 +00001009 $href = make_named_href('author', $href,
1010 "<b><font size='+2'>$t_author</font></b>");
Fred Drakec9a44381998-03-17 06:29:13 +00001011 $the_title .= "\n<p>$href</p>";
Fred Drake6659c301998-03-03 22:02:19 +00001012 } else {
Fred Drake2d1f81e1999-02-09 16:03:31 +00001013 $the_title .= ("\n<p><b><font size='+2'>$t_author</font></b></p>");
Fred Drake6659c301998-03-03 22:02:19 +00001014 }
Fred Drake08932051998-04-17 02:15:42 +00001015 } else { write_warnings("\nThere is no author for this document."); }
Fred Drake6659c301998-03-03 22:02:19 +00001016 if ($t_institute) {
Fred Drakec9a44381998-03-17 06:29:13 +00001017 $the_title .= "\n<p>$t_institute</p>";}
Fred Draked07868a1998-05-14 21:00:28 +00001018 if ($DEVELOPER_ADDRESS) {
1019 $the_title .= "\n<p>$DEVELOPER_ADDRESS</p>";}
Fred Drake6659c301998-03-03 22:02:19 +00001020 if ($t_affil) {
Fred Drakec9a44381998-03-17 06:29:13 +00001021 $the_title .= "\n<p><i>$t_affil</i></p>";}
Fred Drake6659c301998-03-03 22:02:19 +00001022 if ($t_date) {
Fred Drakec9a44381998-03-17 06:29:13 +00001023 $the_title .= "\n<p><strong>$t_date</strong>";
Fred Drake6659c301998-03-03 22:02:19 +00001024 if ($PYTHON_VERSION) {
1025 $the_title .= "<br><strong>Release $PYTHON_VERSION</strong>";}
1026 $the_title .= "</p>"
1027 }
1028 if ($t_address) {
Fred Drakec9a44381998-03-17 06:29:13 +00001029 $the_title .= "\n<p>$t_address</p>";
1030 } else { $the_title .= "\n<p>"}
Fred Drake6659c301998-03-03 22:02:19 +00001031 if ($t_email) {
Fred Drakec9a44381998-03-17 06:29:13 +00001032 $the_title .= "\n<p>$t_email</p>";
1033 }# else { $the_title .= "</p>" }
Fred Drake90fdda51999-02-16 20:27:42 +00001034 $the_title .= "\n</center></div>";
Fred Drake62e43691998-08-10 19:40:44 +00001035 return $the_title . $_ ;
Fred Drake6659c301998-03-03 22:02:19 +00001036}
1037
1038
Fred Drake885215c1998-05-20 21:32:09 +00001039#
Fred Drakea0f4c941998-07-24 22:16:04 +00001040# Module synopsis support
1041#
1042
1043require SynopsisTable;
1044
Fred Drakef7685d71998-07-25 03:31:46 +00001045sub get_chapter_id(){
1046 my $id = do_cmd_thechapter('');
Fred Drake45f26011998-08-04 22:07:18 +00001047 $id =~ s/<SPAN CLASS="arabic">(\d+)<\/SPAN>/\1/;
1048 $id =~ s/\.//;
Fred Drakef7685d71998-07-25 03:31:46 +00001049 return $id;
Fred Drakea0f4c941998-07-24 22:16:04 +00001050}
1051
Fred Drakef7685d71998-07-25 03:31:46 +00001052%ModuleSynopses = ('chapter' => 'SynopsisTable instance');
1053
1054sub get_synopsis_table($){
1055 my($chap) = @_;
Fred Drakea0f4c941998-07-24 22:16:04 +00001056 my $st = $ModuleSynopses{$chap};
Fred Drakef7685d71998-07-25 03:31:46 +00001057 my $key;
1058 foreach $key (keys %ModuleSynopses) {
1059 if ($key eq $chap) {
1060 return $ModuleSynopses{$chap};
1061 }
Fred Drakea0f4c941998-07-24 22:16:04 +00001062 }
Fred Drakef7685d71998-07-25 03:31:46 +00001063 $st = SynopsisTable->new();
1064 $ModuleSynopses{$chap} = $st;
Fred Drakea0f4c941998-07-24 22:16:04 +00001065 return $st;
1066}
1067
Fred Drake62e43691998-08-10 19:40:44 +00001068sub do_cmd_moduleauthor{
1069 local($_) = @_;
1070 next_argument();
1071 next_argument();
1072 return $_;
1073}
1074
1075sub do_cmd_sectionauthor{
1076 local($_) = @_;
1077 next_argument();
1078 next_argument();
1079 return $_;
1080}
1081
Fred Drakea0f4c941998-07-24 22:16:04 +00001082sub do_cmd_declaremodule{
1083 local($_) = @_;
1084 my $key = next_optional_argument();
1085 my $type = next_argument();
1086 my $name = next_argument();
1087 my $st = get_synopsis_table(get_chapter_id());
1088 #
1089 $key = $name unless $key;
1090 $type = 'built-in' if $type eq 'builtin';
1091 $st->declare($name, $key, $type);
1092 define_module($type, $name);
Fred Drake62e43691998-08-10 19:40:44 +00001093 return anchor_label("module-$key",$CURRENT_FILE,$_)
Fred Drakea0f4c941998-07-24 22:16:04 +00001094}
1095
1096sub do_cmd_modulesynopsis{
1097 local($_) = @_;
1098 my $st = get_synopsis_table(get_chapter_id());
Fred Drake1cc58991999-04-13 22:08:59 +00001099 $st->set_synopsis($THIS_MODULE, translate_commands(next_argument()));
Fred Drake62e43691998-08-10 19:40:44 +00001100 return $_;
Fred Drakea0f4c941998-07-24 22:16:04 +00001101}
1102
1103sub do_cmd_localmoduletable{
1104 local($_) = @_;
Fred Drakea0f4c941998-07-24 22:16:04 +00001105 my $chap = get_chapter_id();
Fred Drake557460c1999-03-02 16:05:35 +00001106 return "<tex2html-localmoduletable><$chap>\\tableofchildlinks[off]" . $_;
Fred Drakea0f4c941998-07-24 22:16:04 +00001107}
1108
1109sub process_all_localmoduletables{
Fred Drake557460c1999-03-02 16:05:35 +00001110 while (/<tex2html-localmoduletable><(\d+)>/) {
Fred Drakef7685d71998-07-25 03:31:46 +00001111 my $match = $&;
Fred Drakea0f4c941998-07-24 22:16:04 +00001112 my $chap = $1;
1113 my $st = get_synopsis_table($chap);
1114 my $data = $st->tohtml();
Fred Drakef7685d71998-07-25 03:31:46 +00001115 s/$match/$data/;
Fred Drakea0f4c941998-07-24 22:16:04 +00001116 }
1117}
Fred Drake557460c1999-03-02 16:05:35 +00001118sub process_python_state{
1119 process_all_localmoduletables();
Fred Drake557460c1999-03-02 16:05:35 +00001120}
Fred Drakea0f4c941998-07-24 22:16:04 +00001121
1122
1123#
1124# "See also:" -- references placed at the end of a \section
1125#
1126
1127sub do_env_seealso{
Fred Drake90fdda51999-02-16 20:27:42 +00001128 return "<div class=seealso>\n "
Fred Drake2cafcbb1999-03-25 16:57:04 +00001129 . "<p class=heading><b>See Also:</b></p>\n"
Fred Drake90fdda51999-02-16 20:27:42 +00001130 . @_[0]
1131 . '</div>';
Fred Drakea0f4c941998-07-24 22:16:04 +00001132}
1133
1134sub do_cmd_seemodule{
1135 # Insert the right magic to jump to the module definition. This should
1136 # work most of the time, at least for repeat builds....
1137 local($_) = @_;
1138 my $key = next_optional_argument();
1139 my $module = next_argument();
1140 my $text = next_argument();
Fred Drake84bd6f31999-05-11 15:42:51 +00001141 my $period = '.';
Fred Drakea0f4c941998-07-24 22:16:04 +00001142 $key = $module
1143 unless $key;
Fred Drake84bd6f31999-05-11 15:42:51 +00001144 if ($text =~ /\.$/) {
1145 $period = '';
1146 }
1147 return '<dl compact class=seemodule>'
1148 . "\n <dt>Module <b><tt class=module><a href=\"module-$key.html\">"
1149 . "$module</a></tt>:</b>"
1150 . "\n <dd>$text$period\n </dl>"
Fred Drake90fdda51999-02-16 20:27:42 +00001151 . $_;
Fred Drakea0f4c941998-07-24 22:16:04 +00001152}
1153
1154sub do_cmd_seetext{
Fred Drake79189b51999-04-28 13:54:30 +00001155 local($_) = @_;
1156 my $content = next_argument();
1157 return '<div class=seetext><p>' . $content . '</div>' . $_;
Fred Drakea0f4c941998-07-24 22:16:04 +00001158}
1159
1160
1161#
Fred Drake885215c1998-05-20 21:32:09 +00001162# Definition list support.
1163#
1164
1165sub do_env_definitions{
1166 local($_) = @_;
Fred Drake90fdda51999-02-16 20:27:42 +00001167 return "<dl class=definitions>$_</dl>\n";
Fred Drake885215c1998-05-20 21:32:09 +00001168}
1169
1170sub do_cmd_term{
1171 local($_) = @_;
Fred Drakeccc62721999-01-05 22:16:29 +00001172 my $term = next_argument();
1173 my($name,$aname,$ahref) = new_link_info();
Fred Drake885215c1998-05-20 21:32:09 +00001174 # could easily add an index entry here...
Fred Drake62e43691998-08-10 19:40:44 +00001175 return "<dt><b>$aname" . $term . "</a></b>\n<dd>" . $_;
Fred Drake885215c1998-05-20 21:32:09 +00001176}
1177
1178
Fred Drake2ff880e1999-02-05 18:31:29 +00001179process_commands_wrap_deferred(<<_RAW_ARG_DEFERRED_CMDS_);
1180code # {}
Fred Drake2e1ee3e1999-02-10 21:17:04 +00001181declaremodule # [] # {} # {}
1182memberline # [] # {}
1183methodline # [] # {} # {}
1184modulesynopsis # {}
Fred Drake557460c1999-03-02 16:05:35 +00001185platform # {}
Fred Drake2ff880e1999-02-05 18:31:29 +00001186samp # {}
Fred Drake2e1ee3e1999-02-10 21:17:04 +00001187setindexsubitem # {}
Fred Drakef32834c1999-02-12 22:06:32 +00001188withsubitem # {} # {}
Fred Drake2ff880e1999-02-05 18:31:29 +00001189_RAW_ARG_DEFERRED_CMDS_
1190
1191
Fred Drake6659c301998-03-03 22:02:19 +000011921; # This must be the last line