1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Various api doc related fixes and cleanups

This commit is contained in:
Jonas Fonseca 2006-01-13 08:09:06 +01:00 committed by Jonas Fonseca
parent c7022f50e9
commit 686166d5e6
2 changed files with 36 additions and 33 deletions

View File

@ -95,7 +95,8 @@ api/$(2).txt: $(1)
API_TXT += api/$(2).txt API_TXT += api/$(2).txt
endef endef
$(foreach api,$(API),$(eval $(call api_doc,$(api),$(shell sed -n 's/.*API Doc\s*::\s*\([^ ]*\).*/\1/p' < $(api)),))) api_name = $(shell sed -n 's/.*API Doc\s*::\s*\([^ ]*\).*/\1/p' < $(1))
$(foreach api,$(API),$(eval $(call api_doc,$(api),$(call api_name,$(api)))))
## Se the default doc rules ## Se the default doc rules
@ -167,11 +168,11 @@ man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\"
%.html: %.txt asciidoc.conf %.html: %.txt asciidoc.conf
$(call cmd,asciidoc,xhtml11) $(call cmd,asciidoc,xhtml11)
@-sed -n 's/include::\(.*\)\[.*/$@: \1/p' < $< > .deps/$@ @-sed -n 's#include::\(.*\)\[.*#$@: \1#p' < $< > .deps/$(@F)
%.xml: %.txt asciidoc.conf %.xml: %.txt asciidoc.conf
$(call cmd,asciidoc,docbook) $(call cmd,asciidoc,docbook)
@-sed -n 's/include::\(.*\)\[.*/$@: \1/p' < $< > .deps/$@ @-sed -n 's#include::\(.*\)\[.*#$@: \1#p' < $< > .deps/$(@F)
%.1: %.1.xml %.1: %.1.xml
$(call cmd,xmlto,man) $(call cmd,xmlto,man)

View File

@ -59,10 +59,13 @@ while (<>)
my $orig_title = $title; my $orig_title = $title;
if (not /^#define\s/) {
# Combine multi-line declarations to one. Break at empty
# for #define ...
while (not /(struct|enum|typedef|[^=])*[\s*](\w+).*[\[:,;{]/) { while (not /(struct|enum|typedef|[^=])*[\s*](\w+).*[\[:,;{]/) {
my $line = $_;
$_ .= <>; $_ .= <>;
} last if $_ eq $line
} }
if (/struct\s+(\w+)\s*{/) { if (/struct\s+(\w+)\s*{/) {
@ -73,37 +76,36 @@ while (<>)
$title = "enum:$1" . "[$title]"; $title = "enum:$1" . "[$title]";
$idpath = ""; $idpath = "";
} elsif (/#define\s+(\w+)[(]/) { } elsif (/#define/) {
if (/#define\s+(\w+)[(]/) {
$title = "func:$1" . "[$title]"; $title = "func:$1" . "[$title]";
$idpath = "";
} elsif (/#define\s+(\w+)/) { } elsif (/#define\s+(\w+)/) {
$title = "macro:$1" . "[$title]"; $title = "macro:$1" . "[$title]";
}
$idpath = ""; $idpath = "";
} else { } elsif (/typedef/) {
if (/typedef/) {
if (/.*\(\*(\w+)\)\(/) { if (/.*\(\*(\w+)\)\(/) {
$title = "typedef:$1" . "[$title]"; $title = "typedef:$1" . "[$title]";
} elsif (/typedef.*\s(\w+);/) { } elsif (/typedef.*\s(\w+);/) {
$title = "typedef:$1" . "[$title]"; $title = "typedef:$1" . "[$title]";
} }
$idpath = ""; $idpath = "";
} else {
if (/.*[\s*](\w+)\(/) { } elsif (/.*[\s*](\w+)\(/) {
$title = "func:$1" . "[$title]"; $title = "func:$1" . "[$title]";
$idpath = ""; $idpath = "";
} elsif (/.*\(\*(\w+)\)\(/) { } elsif (/.*\(\*(\w+)\)\(/) {
$body = "#newline#" . $title if not $body; $body = "#newline#" . $title if not $body;
$title = "id:[$idpath$1]::"; $title = "id:[$idpath$1]::";
$indent = "\t"; $indent = "\t";
} elsif (/[^=]*[\s*](\w+)[\[\s,:;]/) { } elsif (/[^=]*[\s*](\w+)[\[\s,:;]/) {
$body = "#newline#" . $title if not $body; $body = "#newline#" . $title if not $body;
$title = "id:[$idpath$1]::"; $title = "id:[$idpath$1]::";
$indent = "\t"; $indent = "\t";
} }
}
}
put_section if $orig_title ne $title; put_section if $orig_title ne $title;
next; next;
} }