From: Michal Vaner Date: Mon, 18 Aug 2008 14:37:40 +0000 (+0200) Subject: Documentation system: generate anchors/ids for functions X-Git-Tag: holmes-import~350 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6c9ee13722a767c028850ecea7267dab91b1897f;p=libucw.git Documentation system: generate anchors/ids for functions When a function documentation is found, a fun_name_of_the_function anchor (id html attribute) is added to it so links can jump there. --- diff --git a/build/docconfig b/build/docconfig index a80cdf65..16105434 100644 --- a/build/docconfig +++ b/build/docconfig @@ -1,3 +1,5 @@ [replacements] @(\w+)=\1 +!!f!((.*\W|)(\w+))(\([^()]*\).*)!!!=
!?\1!?\4!?
((\w+)\([^()]*\))=\1 +!\?((.*\W|)(\w+))!\?(\([^()]*\).*)!\?=\1\4 diff --git a/build/extract-doc.pl b/build/extract-doc.pl index 4b700c14..392dd409 100755 --- a/build/extract-doc.pl +++ b/build/extract-doc.pl @@ -26,9 +26,14 @@ sub formatNote( $$ ) { $head =~ s/(\S)[ ]+/$1 /g; print OUT "\n"; print OUT "''''\n"; - print OUT "..................\n"; - print OUT "$head\n"; - print OUT "..................\n\n"; + chomp $head; + if($head =~ /\w+\([^()]*\)/ && $head !~ /\n/) { + print OUT "!!f!$head!!!\n\n"; + } else { + print OUT "..................\n"; + print OUT "$head\n"; + print OUT "..................\n\n"; + } print OUT "$comment\n\n"; } diff --git a/ucw/fastbuf.h b/ucw/fastbuf.h index b912ca00..4a17bfdf 100644 --- a/ucw/fastbuf.h +++ b/ucw/fastbuf.h @@ -551,7 +551,8 @@ bdirect_write_commit(struct fastbuf *f, byte *pos) /** * printf into a fastbuf. **/ -int bprintf(struct fastbuf *b, const char *msg, ...) FORMAT_CHECK(printf,2,3); +int bprintf(struct fastbuf *b, const char *msg, ...) + FORMAT_CHECK(printf,2,3); int vbprintf(struct fastbuf *b, const char *msg, va_list args); /** vprintf into a fastbuf. **/ #endif