1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00: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
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
@ -167,11 +168,11 @@ man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\"
%.html: %.txt asciidoc.conf
$(call cmd,asciidoc,xhtml11)
@-sed -n 's/include::\(.*\)\[.*/$@: \1/p' < $< > .deps/$@
@-sed -n 's#include::\(.*\)\[.*#$@: \1#p' < $< > .deps/$(@F)
%.xml: %.txt asciidoc.conf
$(call cmd,asciidoc,docbook)
@-sed -n 's/include::\(.*\)\[.*/$@: \1/p' < $< > .deps/$@
@-sed -n 's#include::\(.*\)\[.*#$@: \1#p' < $< > .deps/$(@F)
%.1: %.1.xml
$(call cmd,xmlto,man)

View File

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