From 6c9ee13722a767c028850ecea7267dab91b1897f Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Mon, 18 Aug 2008 16:37:40 +0200 Subject: [PATCH] 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. --- build/docconfig | 2 ++ build/extract-doc.pl | 11 ++++++++--- ucw/fastbuf.h | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) 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 -- 2.39.2