Debian Codegraph @

Documentation/Reference/class.plg

raw ◀ ▶
2 Debian patches touch this file
1 use strict;
2 use POSIX qw(strftime);
3 sub plugin {
4 my $global=shift;
5 print "Generation class documentation\n";
6 print_class_index($global);
7 print_classes($global);
8 print "Done with classes\n";
9 }
10
11 sub print_classes {
12 my $space=shift;
13 foreach (sort byfullname $space->all()) {
14 next if (!$_->is_class());
15 print_class($_);
16 }
17 }
18
19 my %see_also;
20
21 # Remember to set $new_line_flag = 0 before using this function
22 my $new_line_flag = 0;
23 my @classes;
24 sub print_description {
25 my $mydesc=shift;
26 foreach (@classes) {
27 my $item = $_;
28 my $name = $$item{fullname};
29 # Find comment cross reference
30 my $mylink=$item->href($$item{fullname});
31 $mydesc=~s/([. ,()])${name}([. ,()])/${1}${mylink}${2}/g;
32 $mydesc=~s/([. ,()])${name}$/${1}${mylink}/g;
33 $mydesc=~s/^${name}([. ,()])/${mylink}${1}/g;
34 }
35 # Check if new lines are required
36 if ($mydesc=~/<p>/) {
37 $new_line_flag = 1;
38 $mydesc=~s/<p>//g;
39 }
40 if ($mydesc=~/<\/p>/) {
41 $new_line_flag = 0;
42 $mydesc=~s/<\/p>//g;
43 }
44 $mydesc = &addCrossRef($mydesc);
45 if ($new_line_flag eq 0) {
46 print FILE "$mydesc<br>";
47 }else {
48 print FILE "$mydesc";
49 }
50
51 }
52
53 sub addCrossRef {
54 my $text = shift;
55 # my @sortedClasses = sort { $$b{fullname} cmp $$a{fullname} } @classes;
56
57 foreach (@classes) {
58 my $name = $$_{fullname};
59 my $loc = $name . ".html";
60 # $text =~ s/${name}/<a href="$loc">$name<\/a>/g;
61 if ($text =~ /${name}/) {
62 $see_also{$name} = "<a href=\"$loc\">$name<\/a>";
63 }
64 }
65 return $text;
66 }
67
68 sub print_html_header {
69 my $html_name=shift;
70 my $index_number=shift;
71 my $colour=shift;
72 print FILE '
73 <!-- clanlib header begin -->
74 <HTML>
75 <HEAD>
76 <TITLE>', $html_name, ' - ClanLib Game SDK</TITLE>
77 <STYLE TYPE="text/css"><!--
78 HTML BODY
79 {
80 font-family: verdana, helvetica, sans-serif;
81 font-size: 12px;
82 }
83 H1 { font-size: 22px; }
84 H2 { font-size: 18px; }
85 H3 { font-size: 16px; }
86 H4 { font-size: 14px; }
87 P { font-size: 12px; }
88 LI { font-size: 12px; }
89 --></STYLE>
90 </HEAD>
91
92 <body bgcolor=white text=black link=blue vlink=#800080>
93
94 <!-- clanlib header end -->
95
96 <center>
97 <p>
98 <a href="http://clanlib.org/docs.html">Home</a> |
99 <a href="classes.html">All Classes</a> |
100 <a href="modules.html">Grouped Classes</a> |
101 <a href="index.html">Index</a> |
102 <a href="search.html">Search</a>
103 </p>
104 </center>
105 ';
106
107 # if ($index_number eq 1)
108 # {
109 # print FILE "<td>Entire Class Index</td>\n";
110 # }else
111 # {
112 # print FILE "<td><a href=\"entire_class_index.html\">Entire Class Index</a></td>\n";
113 # }
114 #
115 # if ($index_number eq 2)
116 # {
117 # print FILE "<td>Main Class Index</td>\n";
118 # }else
119 # {
120 # print FILE "<td><a href=\"class_index.html\">Main Class Index</a></td>\n";
121 # }
122 #
123 #: if ($index_number eq 3)
124 # {
125 # print FILE "<td>Cross Index</td>\n";
126 # }else
127 # {
128 # print FILE "<td><a href=\"cross_index.html\">Cross Index</a></td>\n";
129 # }
130 #
131 # if ($index_number eq 4)
132 # {
133 # print FILE "<td>Global Index</td>\n";
134 # }else
135 # {
136 # print FILE "<td><a href=\"global_index.html\">Global Index</a></td>\n";
137 # }
138 # print FILE "</table>";
139 }
140
141 sub print_html_footer {
142 print FILE '
143
144 <!-- clanlib footer begin -->
145
146 <center><br><br><font color="#a0a0a0">
147 Questions or comments, write to the <a href="http://clanlib.org/contact.html">ClanLib mailing list</a>.
148 </font></center>
149
150 </body>
151 </html>
152 <!-- clanlib footer end -->';
153 }
154
155 my $last_group;
156 my $last_section;
157 my $file_open_flag;
158 sub print_class_index {
159 my $space=shift;
160 my $clan_group;
161 my $clan_section;
162 my $id;
163 my %hash;
164 my %classname_hash;
165 my $time_string = strftime "%e %b %Y", gmtime;
166 my @alpha_classes;
167 # Get the class in order of Group / Section / Name
168 $id = 0;
169 foreach (all $space) {
170 if ($_->is_class())
171 {
172 my $cname = $_->name;
173 $clan_group = "";
174 $clan_section = "";
175
176 foreach (split("\n",$$_{unique_string})) {
177 /^!.(.*)$/;
178 my $workbuffer;
179 $workbuffer=$1;
180 if (substr($workbuffer,0,4) eq "clan")
181 {
182 $workbuffer = substr($workbuffer,4);
183 ($clan_group, $clan_section)=split(/=/, $workbuffer);
184 $clan_section=~s/\"//g;
185 }
186 }
187 my $name = "$clan_group=$clan_section=$cname=$id\n";
188 $hash{$name}=[] if (!$hash{$name});
189
190 my $classname = "$cname=$clan_group=$clan_section=$id\n";
191 $classname_hash{$classname}=[] if (!$classname_hash{$classname});
192 }
193 $id = $id + 1;
194 }
195 my @entire_list = $space->all();
196
197 foreach (sort keys %hash)
198 {
199 my $cname;
200 ($clan_group, $clan_section, $cname, $id) = split(/=/, $_);
201 if ($cname =~ /^CL_/)
202 {
203 push(@classes, $entire_list[$id]);
204 }
205 }
206
207 my $num_alpha = 0;
208 foreach (sort keys %classname_hash)
209 {
210 my $cname;
211 ($cname, $clan_group, $clan_section, $id) = split(/=/, $_);
212 if ($cname =~ /^CL_/)
213 {
214 push(@alpha_classes, $entire_list[$id]);
215 $num_alpha = $num_alpha + 1;
216 }
217 }
218
219 open(FILE,">html/classes.html");
220 print_html_header("All Classes", 1, "green");
221 print FILE "<h1>All Classes</h1>\n";
222
223 print FILE "<table width=100%>\n";
224 print FILE "<tr><td valign=top><p>\n";
225
226 my $last_letter="";
227
228 my $next_tr = int ($num_alpha/3-5);
229 foreach (@alpha_classes) {
230
231 my $cname = $_->name;
232 $cname =~ /CL_(.)/;
233 my $letter = $1;
234
235 if ($last_letter ne $letter)
236 {
237 if ($next_tr < 3)
238 {
239 print FILE "</p></td>\n<td valign=top><p>\n";
240 $next_tr = int ($num_alpha/3-5);
241 }
242
243 if ($next_tr < int ($num_alpha/3-5))
244 {
245 print FILE "<br>";
246 $next_tr = $next_tr - 1;
247 }
248 print FILE "<b>$letter</b><br>\n";
249 $last_letter = $letter;
250 $next_tr = $next_tr - 1;
251 }
252
253 print FILE "<a href=\"$$_{name}.html\">$$_{name}</a><br>\n";
254 $next_tr = $next_tr - 1;
255 if ($next_tr == 0)
256 {
257 print FILE "</p></td>\n<td valign=top><p>\n";
258 $next_tr = int ($num_alpha/3-5);
259 }
260 }
261 print FILE "</p></td></tr>\n";
262 print FILE "</table>\n";
263 print_html_footer();
264 close(FILE);
265
266
267 open(FILE,">html/modules.html");
268 print_html_header("Grouped Classes", 1, "green");
269 print FILE "<h1>Grouped Classes</h1>\n";
270
271 print FILE "<table width=100%>\n";
272 print FILE "<tr><td valign=top><p>\n";
273
274 my $last_group="";
275 my $last_section="";
276 my %func_hash;
277 my %empty;
278
279 my $next_tr = int ($num_alpha/2)-22;
280 foreach (@classes) {
281
282 my $cname = $_->name;
283
284 $clan_group = "";
285 $clan_section = "";
286
287 foreach (split("\n",$$_{unique_string})) {
288 /^!.(.*)$/;
289 my $workbuffer;
290 $workbuffer=$1;
291 if (substr($workbuffer,0,4) eq "clan")
292 {
293 $workbuffer = substr($workbuffer,4);
294 ($clan_group, $clan_section)=split(/=/, $workbuffer);
295 $clan_section=~s/\"//g;
296 }
297 }
298
299 if ($last_group ne $clan_group || $last_section ne $clan_section)
300 {
301 my $key;
302 foreach $key (sort keys %func_hash)
303 {
304 print FILE $func_hash{$key};
305 $next_tr = $next_tr - 1;
306 if ($next_tr <= 0)
307 {
308 print FILE "</p></td>\n<td valign=top><p>\n";
309 $next_tr = int ($num_alpha/2)-22;
310 }
311 }
312 %func_hash = %empty;
313
314 if ($next_tr < 3)
315 {
316 print FILE "</p></td>\n<td valign=top><p>\n";
317 $next_tr = int ($num_alpha/2)-22;
318 }
319
320 if ($next_tr < int ($num_alpha/2-22))
321 {
322 print FILE "<br>";
323 $next_tr = $next_tr - 1;
324 }
325
326 if ($last_group ne $clan_group)
327 {
328 print FILE "<b>$clan_group</b><br>\n";
329 $next_tr = $next_tr - 1;
330 }
331
332 print FILE "<i>$clan_section</i><br>\n";
333 $next_tr = $next_tr - 1;
334
335 $last_group = $clan_group;
336 $last_section = $clan_section;
337 }
338
339 $func_hash{$$_{name}} = "<a href=\"$$_{name}.html\">$$_{name}</a><br>\n";
340
341 }
342
343
344 my $key;
345 foreach $key (sort keys %func_hash)
346 {
347 print FILE $func_hash{$key};
348 $next_tr = $next_tr - 1;
349 if ($next_tr <= 0)
350 {
351 print FILE "</p></td>\n<td valign=top><p>\n";
352 $next_tr = int ($num_alpha/2)-22;
353 }
354 }
355 %func_hash = %empty;
356
357
358 print FILE "</p></td></tr>\n";
359 print FILE "</table>\n";
360 print_html_footer();
361 close(FILE);
362
363 # Print index:
364 my %index;
365 foreach (sort byfullname $space->all()) {
366 next if (!$_->is_class());
367
368 my $dfilename = $$_{fullname};
369 $dfilename=~s/::/__/g;
370 $index{$$_{fullname}} .= "<dd><a href=\"$dfilename.html\">$$_{fullname}</a></dd>\n";
371
372 if ($_->functions()) {
373 my $access;
374 foreach $access ($Enum::PUBLIC, $Enum::PROTECTED, $Enum::PRIVATE) {
375 foreach ($_->get_by_access($access)) {
376 next if ($$_{name} =~ /^~/); # no destructors please.
377
378 # Replace :: with __ for filenames
379 my $dummyfilename = $$_{fullname};
380 $dummyfilename=~s/::/__/g;
381
382 my $func_ref = "<dd><a href=\"$dummyfilename.html\">$$_{fullname}</a></dd>\n";
383 $index{$$_{name}} .= $func_ref if ($_->is_function());
384 # $index{$$_{name}} .= $func_ref if ($_->is_function() && !($index{$$_{name}} =~ /$func_ref/));
385 }
386 }
387 }
388 }
389
390 open(FILE,">html/index.html");
391 print_html_header("Index", 1, "green");
392 print FILE "<h1>Index</h1>\n";
393
394 my $key;
395 foreach $key (sort keys %index) {
396 print FILE "<p><dt>$key</dt>\n$index{$key}</p>\n";
397 }
398
399 print_html_footer();
400 close(FILE);
401
402
403 open(FILE,">html/search.html");
404 print_html_header("Search", 1, "green");
405 print FILE "<h1>Search</h1>\n";
406
407 print FILE "<table width=100% topmargin=0 leftmargin=0 cellpadding=0 cellspacing=0 border=0 align=center>\n";
408 print FILE "<tr><td valign=top>\n";
409 print FILE "<table cellpadding=4 cellspacing=0 border=0>\n";
410 print FILE "<tr><td>\n";
411 print FILE "<form\n";
412 print FILE " action=\"http://search.ankiro.dk/s/search_3a5812cd894444669a903e56c7414ecb.asp\"\n";
413 print FILE " method=\"get\"\n";
414 print FILE " id=\"SearchForm\"\n";
415 print FILE " name=\"SearchForm\">\n";
416 print FILE "<input type=\"text\" name=\"q\">\n";
417 print FILE "<input type=\"submit\" value=\"Search\" id=\"submitButton\" name=\"submitButton\">\n";
418 print FILE "</form>\n";
419 print FILE "</td></tr>\n";
420 print FILE "</table>\n";
421 print FILE "</td></tr>\n";
422 print FILE "</table>\n";
423
424 print_html_footer();
425 close(FILE);
426
427
428
429 # open(FILE,">html/entire_class_index.html");
430 # print_html_header("Entire Class Index", 1, "green");
431 # print FILE "<h1 align=center>Entire Class Index</h1>\n<ul type=disc>\n";
432 # $last_group="E R R O R";
433 # $last_section="E R R O R";
434 # foreach (@classes) {
435 # print_class_full_index($_);
436 # }
437 # print FILE "</ul>Documentation Created : $time_string\n</body></html>";
438 # print_html_footer();
439 # close(FILE);
440 #
441 # open(FILE,">html/class_index.html");
442 # print_html_header("Main Index", 2, "orange");
443 # print FILE "<h1 align=center>Main Index</h1>\n<ul type=disc>\n";
444 # $last_group="E R R O R";
445 # $last_section="E R R O R";
446 # foreach (@classes) {
447 # print_class_main_index($_);
448 # }
449 # print FILE "</ul>Documentation Created : $time_string\n</body></html>";
450 # print_html_footer();
451 # close(FILE);
452 #
453 # $last_group="E R R O R";
454 # $last_section="E R R O R";
455 # $file_open_flag = 0;
456 # foreach (@classes) {
457 # print_class_section_index($_);
458 # }
459 #
460 # # Close the old file
461 # if ($file_open_flag ne 0)
462 # {
463 # $file_open_flag = 0;
464 # print_html_footer();
465 # close(FILE);
466 # }
467
468 }
469
470 sub print_class_section_index {
471 my $item=shift;
472
473 my $clan_group="";
474 my $clan_section="";
475 my $workbuffer;
476
477 foreach (split("\n",$$_{unique_string})) {
478 /^!.(.*)$/;
479 $workbuffer=$1;
480 if (substr($workbuffer,0,4) eq "clan")
481 {
482 $workbuffer = substr($workbuffer,4);
483 ($clan_group, $clan_section)=split(/=/, $workbuffer);
484 $clan_section=~s/\"//g;
485 }
486 }
487 # Start of a new group
488 if ($clan_group ne $last_group)
489 {
490 # Close the old file
491 if ($file_open_flag ne 0)
492 {
493 $file_open_flag = 0;
494 print_html_footer();
495 close(FILE);
496 }
497 # Open a new file
498 open(FILE,">html/${clan_group}_index.html");
499 print_html_header("$clan_group Index", 0, "orange");
500 print FILE "<h1 align=center>$clan_group Index</h1>\n<ul type=disc>\n";
501 $file_open_flag = 1;
502 $last_group = $clan_group;
503 $last_section = "E R R O R";
504 }
505
506 # Start of a new section
507 if ($clan_section ne $last_section )
508 {
509 print FILE '<hr size="1" width="70%" align="left" noshade="noshade">';
510 print FILE "<h3>$clan_group - $clan_section </h3>";
511 $last_section = $clan_section;
512 }
513 print FILE "<li><b>",$item->href($$item{fullname}),"</b>\n";
514 }
515
516 #sub print_class_main_index {
517 # my $item=shift;
518 #
519 # my $clan_group="";
520 # my $clan_section="";
521 # my $workbuffer;
522 # my $comment_found_flag = 0;
523 #
524 # foreach (split("\n",$$_{unique_string})) {
525 # /^!.(.*)$/;
526 # $workbuffer=$1;
527 # if (substr($workbuffer,0,4) eq "clan")
528 # {
529 # $workbuffer = substr($workbuffer,4);
530 # ($clan_group, $clan_section)=split(/=/, $workbuffer);
531 # }
532 # }
533 # if ($clan_group ne $last_group)
534 # {
535 #
536 # print FILE '<hr size="1" width="70%" align="left" noshade="noshade">';
537 # print FILE "<li><b><a href=\"${clan_group}_index.html\"> $clan_group </a> </b><br>\n";
538 # $last_group = $clan_group;
539 #
540 # $new_line_flag = 0;
541 # foreach (split("\n", $file_global_string))
542 # {
543 # /(.*)$/;
544 # my $mydesc = $1;
545 #
546 # # A new comment found - it will always need processing
547 # if (substr($mydesc,0, 2) eq "! ")
548 # {
549 # $comment_found_flag = 0;
550 # }
551 #
552 # if ($comment_found_flag eq 0)
553 # {
554 # # Find the correct comment
555 # if ($mydesc eq "! ${clan_group}")
556 # {
557 # $comment_found_flag = 1;
558 # }
559 # }else
560 # {
561 # $mydesc = substr($mydesc, 1);
562 # print_description($mydesc);
563 # }
564 # }
565 # }
566 #}
567 #
568 #
569 #sub print_class_full_index {
570 # my $item=shift;
571 #
572 # my $clan_group="";
573 # my $clan_section="";
574 # my $workbuffer;
575 #
576 # foreach (split("\n",$$_{unique_string})) {
577 # /^!.(.*)$/;
578 # $workbuffer=$1;
579 # if (substr($workbuffer,0,4) eq "clan")
580 # {
581 # $workbuffer = substr($workbuffer,4);
582 # ($clan_group, $clan_section)=split(/=/, $workbuffer);
583 # $clan_section=~s/\"//g;
584 # }
585 # }
586 # if (($clan_group ne $last_group) || ($clan_section ne $last_section ))
587 # {
588 # print FILE '<hr size="1" width="70%" align="left" noshade="noshade">';
589 # print FILE "<h3>$clan_group - $clan_section </h3>";
590 # $last_group = $clan_group;
591 # $last_section = $clan_section;
592 # }
593 #
594 # print FILE "<li><b>",$item->href($$item{fullname}),"</b>\n";
595 #}
596
597 sub print_class {
598 $_=shift;
599
600 # Replace :: with __ for filenames
601 my $dummyfilename = $$_{fullname};
602 $dummyfilename=~s/::/__/g;
603
604 print "Generating $$_{fullname}\n";
605 open(FILE,">html/$dummyfilename.html");
606
607 my $classname = $$_{fullname};
608 my $classfilename = $dummyfilename;
609
610 print_html_header("$$_{fullname}", 0, "purple");
611 print FILE "<h1>Class $$_{fullname}</h1>\n";
612
613 my $workbuffer="";
614 my $clan_group="";
615 my $clan_section="";
616 my $clan_header="";
617 foreach (split("\n",$$_{unique_string})) {
618 /^!.(.*)$/;
619 $workbuffer=$1;
620 if (substr($workbuffer,0, 7) eq "header=")
621 {
622 $clan_header = substr($workbuffer, 7);
623 }
624 if (substr($workbuffer,0,4) eq "clan")
625 {
626 $workbuffer = substr($workbuffer,4);
627 ($clan_group, $clan_section)=split(/=/, $workbuffer);
628 $clan_section=~s/\"//g;
629 }
630 }
631
632 print FILE "<p>$$_{short} <a href=\"#description\">More...</a></p>\n";
633
634 # Print containing space
635 my $space=$$_{space};
636 my $tempname = $space->href($$space{fullname});
637 # Fix to change global to global_index
638 $tempname=~s/global.html/global_index.html/g;
639 # print FILE "Contained in: ",$tempname,"<br>\n";
640
641 # Print base classes
642 print FILE "<p>Derived from:\n";
643 if ($_->parents()) {
644 foreach (sort byname parents $_) {
645 print FILE $_->href("$$_{fullname}"),"\n";
646 }
647 }
648 else {print FILE "<i>none</i>\n"; }
649 print FILE "<br>\n";
650
651 # Print derived classes
652 print FILE "Derived by:\n";
653 if ($_->children()) {
654 foreach (sort byname children $_) {
655
656 # Replace :: with __ for filenames
657 $dummyfilename = $$_{fullname};
658 $dummyfilename=~s/::/__/g;
659
660 print FILE "<a href=\"$dummyfilename.html\">$$_{fullname}</a>\n";
661 #print FILE "<a href=\"$$_{fullname}.html\">$$_{fullname}</a>\n";
662 }
663 }
664 else { print FILE "<i>none</i>\n"; }
665
666 print FILE "<br>Group: $clan_group ($clan_section)</p>\n";
667
668 print FILE "<p>\n";
669 print FILE "#include \&lt;ClanLib/$clan_header\&gt;\n";
670 print FILE "<p>\n";
671
672 my %functions;
673
674 if ($_->functions()) {
675 my $access;
676
677 my $current_function_type = "";
678
679 print FILE "<table border=0 width=100%>\n";
680 foreach $access ($Enum::PUBLIC, $Enum::PROTECTED) {
681
682 my @group;
683 foreach ($_->get_by_access($access)) {
684 push(@group,$_); # if ($_->is_function());
685 }
686 next if (!@group);
687
688
689 foreach (@group) {
690 # See if a different function type required (using the "! c=" identifier)
691 my $this_name="";
692 my $this_value="";
693 foreach (split("\n",$$_{unique_string})) {
694 /(.*)$/;
695 ($this_name, $this_value)=split(/=/, $1);
696 if ($this_name eq "! c")
697 {
698 if ($this_value ne $current_function_type)
699 {
700 print FILE "</table>\n";
701 $current_function_type = $this_value;
702 print FILE "<p><b>$this_value</b></p>\n";
703 print FILE "<table border=0 width=100%>\n";
704 }
705 }
706 }
707
708 next if ($$_{name} =~ /^~/); # Skip destructors.
709 next if ($current_function_type eq "Implementation"); # Skip Implementation group.
710
711 # Replace :: with __ for filenames
712 my $dummyfilename = $$_{fullname};
713 $dummyfilename=~s/::/__/g;
714
715 if (!$functions{$dummyfilename}) # Only write function description once.
716 {
717 my $hint = "";
718 $hint = " <i>static</i>" if ($$_{type} =~ /^static/);
719 print FILE "<tr><td width=30% valign=top><p><a href=\"$dummyfilename.html\">$$_{name}</a>$hint</p></td><td valign=top><p>$$_{short}</p></td></tr>";
720 $functions{$dummyfilename} = [];
721 }
722 }
723 }
724 print FILE "</table>\n";
725 }
726
727 print FILE "<a name=\"#description\"><p><b>Detailed description:</b></p>\n";
728
729 # print FILE "<p>";
730 #
731 # $new_line_flag = 0;
732 # foreach (split("\n",$$_{long})) {
733 # /(.*)$/;
734 # print_description($1);
735 # }
736 # print FILE "</p>\n";
737
738 print FILE "$$_{long}\n";
739
740 print_html_footer();
741 close(FILE);
742
743 my %funcname;
744 my %funcshort;
745 my %funcproto;
746 my %funcparams;
747 my %funcretval;
748 my %funcdesc;
749
750 my $access;
751 foreach $access ($Enum::PUBLIC, $Enum::PROTECTED) {
752 foreach ($_->get_by_access($access)) {
753
754 # if ($_->functions()) {
755 # foreach (sort byname $_->functions()) {
756 my $impl;
757
758 # Replace :: with __ for filenames
759 my $filename = $$_{fullname};
760 $filename=~s/::/__/g;
761
762 my $proto = "";
763 $proto .= "\n\t";
764 $proto .= "$$_{type} " if ($$_{type} ne "");
765 $proto .= "$$_{name}";
766
767 if ($_->is_function()) {
768 $proto .= "(";
769 $proto .= "\n\t\t$$_{args}" if ($$_{args});
770 $proto .= ")";
771 }
772
773 $proto .= ";\n";
774
775 # Html. Replace < and > with &lt; and &gt;
776 $proto =~ s/</\&lt;/g;
777 $proto =~ s/>/\&gt;/g;
778
779 my $retval;
780 my $params;
781 my $param_name;
782 my $param_value;
783 foreach (split("\n",$$_{comments})) {
784 if (/^param (.+?): (.+)$/) {
785 if ($param_name ne $1) {
786 if ($param_name)
787 {
788 $params .= "<dt><i>$param_name</i></dt><dd>$param_value</dd>\n";
789 }
790 $param_name = $1;
791 $param_value = "";
792 }
793 $param_value .= $2;
794 }
795 elsif (/^return: (.+)$/) {
796 $retval .= $1;
797 }
798 }
799 if ($param_name)
800 {
801 $params .= "<dt><i>$param_name</i></dt><dd>$param_value</dd>\n";
802 }
803
804 $funcname{$filename} = $$_{fullname};
805 $funcshort{$filename} .= $$_{short};
806 $funcproto{$filename} .= $proto;
807 $funcparams{$filename} .= $params;
808 $funcretval{$filename} .= $retval if ($retval);
809 $funcdesc{$filename} .= $$_{long};
810 }
811 }
812
813 my $filename;
814 foreach $filename (keys %funcname)
815 {
816 my %empty;
817 %see_also = %empty;
818
819 open(FILE,">html/$filename.html");
820
821 print_html_header("$funcname{$filename}", 0, "purple");
822 print FILE "<h1>$funcname{$filename}</h1>\n";
823
824 print FILE &addCrossRef("<p>$funcshort{$filename}</p>\n");
825
826 print FILE &addCrossRef("<pre>$funcproto{$filename}</pre>\n");
827
828 if ($funcparams{$filename})
829 {
830 print FILE "<p><b>Parameters:</b></p>\n";
831
832 print FILE "<dl>\n";
833 print FILE &addCrossRef("$funcparams{$filename}");
834 print FILE "</dl>\n";
835 }
836
837 if ($funcretval{$filename})
838 {
839 print FILE "<p><b>Return value:</b></p>\n";
840 print FILE "<p>";
841 print_description(&addCrossRef($funcretval{$filename}));
842 print FILE "</p>\n";
843 }
844
845 if ($funcdesc{$filename}) {
846 print FILE "<p><b>Detailed description:</b></p>";
847 print FILE &addCrossRef("$funcdesc{$filename}\n");
848
849 # my $longhtmlstring = $funcdesc{$filename};
850 # $longhtmlstring=~s/\n/<br>/g;
851 # print FILE "<br><blockquote>$longhtmlstring</blockquote>\n";
852 }
853
854 print FILE "<p><b>See also:</b></p>\n";
855 # print FILE "<p><a href=\"$classfilename.html\">$classname</a>\n";
856
857 $see_also{$classname} = "<a href=\"$classfilename.html\">$classname</a>";
858
859 my $str;
860 my $cur_also;
•861 foreach $cur_also (sort keys %see_also)
862 {
863 $str .= " | " if ($str ne "");
864 $str .= $see_also{$cur_also};
865 }
866
867 print FILE "<p>$str</p>\n";
868
869 print_html_footer();
870 close(FILE);
871 }
872 }