27 @export_comments = ();
28 $export_param_num = 0;
29 $export_is_function = 0;
32 'stk' => '(STK Import)'
56 open ( SOURCE
, $file ) || printf " cannot open file \n";
59 if ( /\/\
*\
! \\class\s
*(\w
*)/ ) {
62 #print "dox for $1\n";
63 $doc_brief{$doc_class_name} = "";
64 $doc_data{$doc_class_name} = "";
66 elsif ( $doc_info_open ) {
68 $doc_data{$doc_class_name} .= $1;
72 elsif ( /\\brief (.*)/ ) {
73 $doc_brief{$doc_class_name} = $1;
76 $doc_data{$doc_class_name} .= $_;
83 $outfile = substr ( $file, rindex($file, "/" ) + 1 );
84 $outfile =~ s/(\.cpp|\.c)/.html/;
85 print "file: $file : generating documentation in $outfile\n";
86 open ( HTML
, ">" , "$outfile" ) || die "outfile could not be opened";
90 <title>chuck documentation</title>
91 <link rel=\"stylesheet\" type=\"text/css\" href=\"ckdoc.css\">
94 <div class=\"library\">
95 <div class=\"exportlist\">
98 open ( SOURCE
, $file ) || printf " cannot open file \n";
101 if ( /\/\
*\
! \\example\s
*(\w
*)/ ) {
105 elsif ( $example_open ) {
107 push ( @example_lines, $1 );
110 if ( !$export_open && !$ugen_open ) {
115 push ( @example_lines, $_ );
120 # if ( /\/\/\!\s*\\(section\w*)\s+(.*)$/ ) { //in comment case
122 if ( /\/\
/\!\s*(.*)$/ ) {
125 if ( $comm =~ /\\(section\w*)\s+(.*)/ ) {
126 print_section
( $2, $1 );
129 push @comments, $comm;
133 if ( /DLL_QUERY\s+(\w*)_query/ ) {
135 $lib_note = $library_notes{$1};
138 if ( /QUERY->ugen_add\s*\(\s*(.*?)\)/ ) {
139 open_ugen
( split ( /[\s,\"]+/ , $1 ) , @comments);
142 if ( /QUERY->ugen_extends\s*\(\s*(.*?)\)/ ) {
143 print_extends
( split ( /[\s,\"]+/ , $1 ) , @comments);
146 if ( /QUERY->ugen_ctrl\s*\(\s*(.*?)\)/ ) {
147 print_function
( split ( /[\s,\"]+/ , $1 ) , @comments);
151 if ( /QUERY->set_name\s*\(\s*(.*?)\)/ ) {
152 open_namespace
( split ( /[\s,\"]+/ , $1 ) , @comments);
157 if ( /^\s*QUERY->add_export\s*\(\s*(.*?)\)/ ) {
158 open_export
( split ( /[\s,\"]+/ , $1 ) , @comments);
162 if ( /^\s*QUERY->add_param\s*\(\s*(.*?)\)/ ) {
163 add_param
( split ( /[\s,\"]+/ , $1 ) , @comments);
167 #stupid lazy shortcuts in ckx libs
168 if ( /^\s*(\w+)_CKADDEXPORT\s*\(\s*(.*?)\)/ ) {
169 my ( $type, $name ) = split ( /[\s,\"]+/ , $2 );
170 @stdargs = ( "QUERY", $type, $name, lc($1).$name."_impl", "TRUE");
171 open_export
( @stdargs , @comments);
175 #more laziness biting me in the ass
176 if ( /^\s*(\w+)_CKADDPARAM\s*\(\s*(.*?)\)/ ) {
177 @expargs = split ( /[\s,\"]+/ , $2 );
178 @stdargs = ( "QUERY", @expargs );
179 add_param
( @stdargs , @comments);
187 print HTML
"\n</div></div></body></html>";
195 my ( $query, $name, $arg2, @comments ) = @_;
199 $brief = $doc_brief{$ugen_name};
200 $data = $doc_data{$ugen_name};
201 if ( $brief ne "" ) { @comments = ( $brief, @comments ); }
206 <h3><a class=\"heading\" name=\"$ugen_name\">[ugen]</a>: <span class=\"name\">$ugen_name</span> $lib_note</h3>
207 <div class=\"comments\"><ul>
209 foreach ( @comments ) { print HTML
"<li> $_</li>\n"; }
210 print HTML
"</ul></div>\n";
211 if ( $data ne "" ) { print HTML
"<pre class=\"data\">$data</pre>"; }
217 if ( $flist_open ) { close_flist
(); }
218 if ( $example_ready ) { print_example
(); }
220 print HTML
"</div>\n";
227 my ( $query, $parent ) = @_;
228 print HTML
"<h4>extends <b><a href=\"#$parent\">$parent</a></b></h4>";
233 if ( $ugen_open == 1) { close_ugen
(); }
234 if ( $export_open == 1) { close_export
(); }
240 <div class=\"members\">
247 print HTML
"</ul></div>\n";
252 my ($query, $ctor, $cget, $type, $name, @comments) = @_;
253 if ( !$flist_open ) { open_flist
(); }
255 $comm = join ( "<br />", @comments);
258 if ( $ctor ne "NULL" && $cget ne "NULL" ) { $access = "READ/WRITE"; }
259 elsif ( $ctor ne "NULL" ) { $access = "WRITE only" }
260 elsif ( $cget ne "NULL" ) { $access = "READ only" }
261 print HTML
"<li><b>.$name</b> - ( $type , $access ) - <span class=\"comment\">$comm</span></li>\n";
262 # print HTML "---member $type $name $ctor $cget -- $comm\n";
269 <div class=\"example\">[example]<br />
270 <div class=\"code\">";
271 foreach ( @example_lines ) { print HTML
substr($_,5);}
272 print HTML
"</div></div>";
278 cleanup
(); #sections end current class...
279 my ( $name, $type ) = @_;
280 print HTML
"<div class=\"$type\">$name</div>";
284 my ( $query, $name ) = @_;
288 sub close_namespace
{
293 my ( $query, $type, $name, $func, $flag, @comments ) = @_;
295 @export_comments=@comments;
297 if ( $flag eq "TRUE" ) {
298 print HTML
"<div class=\"export\"><h3>
299 <a class=\"heading\" name=\"$name\">[function]</a>:
300 $type <b class=\"name\">$name</b> ( ";
301 $export_is_function = 1;
305 print HTML
"<div class=\"export\"><h3>
306 <a class=\"heading\" name=\"$name\">[constant]</a>:
307 $type <b class=\"name\">$name</b></h3>\n";
308 $export_is_function = 0;
310 $export_param_num = 0;
316 if ( $export_is_function == 1 ) { print HTML
" );</h3>\n"; }
317 if ( scalar( @export_comments ) > 0 ) {
318 print HTML
"<div class=\"comments\"><ul>\n";
319 foreach ( @export_comments ) { print HTML
"<li>$_</li>\n"; }
320 print HTML
"</ul></div>\n";
322 if ( $example_ready ) { print_example
(); }
323 print HTML
"</div>\n";
330 my ($query, $type, $name, @comments ) = @_;
331 push ( @export_comments, @comments );
333 if ( $export_param_num ) { $sep = ", "; }
334 print HTML
"$sep$type <b class=\"arg\">$name</b>";
335 $export_param_num ++;