[gtk-doc] mkdb, fixxref: tag more data and filter warnings
- From: Stefan Kost <stefkost src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkdb, fixxref: tag more data and filter warnings
- Date: Fri, 27 Nov 2009 13:17:12 +0000 (UTC)
commit 7500cd2ed2ffa4e1909d327310eff753675152fb
Author: Stefan Kost <ensonic users sf net>
Date: Fri Nov 27 15:16:12 2009 +0200
mkdb, fixxref: tag more data and filter warnings
We use more markup, as this allows us to supress the majority of false broken
link warnings.
gtkdoc-common.pl.in | 4 ++--
gtkdoc-fixxref.in | 16 +++++++++++++++-
gtkdoc-mkdb.in | 16 ++++++++--------
3 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/gtkdoc-common.pl.in b/gtkdoc-common.pl.in
index 5b014cf..d54cd19 100644
--- a/gtkdoc-common.pl.in
+++ b/gtkdoc-common.pl.in
@@ -167,7 +167,7 @@ sub ParseStructDeclaration {
my $mod3 = defined($7) ? $7 : "";
my $name = $8;
my $func_params = $9;
- my $ptype = defined $typefunc ? $typefunc->($type) : $type;
+ my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
my $pname = defined $namefunc ? $namefunc->($name) : $name;
push @result, $name;
@@ -190,7 +190,7 @@ sub ParseStructDeclaration {
my $mod1 = defined($1) ? $1 : "";
if (defined($2)) { $mod1 .= $2; }
my $type = $3;
- my $ptype = defined $typefunc ? $typefunc->($type) : $type;
+ my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
my $mod2 = defined($4) ? " " . $4 : "";
my $list = $5;
diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in
index bee9a0f..09f3fae 100755
--- a/gtkdoc-fixxref.in
+++ b/gtkdoc-fixxref.in
@@ -343,8 +343,22 @@ sub MakeXRef {
#print " Fixing link: $id, $href, $text\n";
return "<a href=\"$href\">$text</a>";
} else {
+ my $warn = 1;
#print " no link for: $id, $text\n";
- if (!exists($NoLinks{$id})) {
+
+ # don't warn multiple times and also skip blacklisted (ctypes)
+ $warn = 0 if exists $NoLinks{$id};
+ # if its a function, don't warn if it does not contain a "_"
+ # - gnome coding style would use '_'
+ # - will avoid wrong warnings for ansi c functions
+ $warn = 0 if ($text =~ m/ class=\"function\"/ && $id !~ m/_/);
+ # if its a 'return value', don't warn (implizitely created link)
+ $warn = 0 if ($text =~ m/ class=\"returnvalue\"/);
+ # if its a 'type', don't warn if it starts with lowercase
+ # - gnome coding style would use CamelCase
+ $warn = 0 if ($text =~ m/ class=\"type\"/ && ($id =~ m/^[a-z]/));
+
+ if ($warn == 1) {
&LogWarning ($file, $line, "no link for: '$id' -> ($text).");
$NoLinks{$id} = 1;
}
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 37112ed..57cb6a8 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -1648,7 +1648,7 @@ sub OutputFunction {
my $type = $3;
my $pointer = $4;
#print "$symbol pointer is $pointer\n";
- my $xref = &MakeXRef ($type);
+ my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
my $start = "";
#if ($symbol_type eq 'USER_FUNCTION') {
# $start = "typedef ";
@@ -1755,7 +1755,7 @@ sub OutputFunction {
$pre = "";
}
- my $xref = &MakeXRef ($type);
+ my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
my $label = "$pre$xref $ptr$name$array";
#print "$symbol: '$pre' '$type' '$ptr' '$name' '$array'\n";
@@ -1791,7 +1791,7 @@ sub OutputFunction {
if ($ptr1 && $ptr1 !~ m/\*$/) { $ptr1 .= " "; }
$func_ptr =~ s/\s+//g;
- my $xref = &MakeXRef ($type);
+ my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
my $label = "$mod1$xref$ptr1$mod2 ($func_ptr$name) ($func_params)";
#print "Type: [$mod1][$xref][$ptr1][$mod2] ([$func_ptr][$name]) ($func_params)\n";
@@ -2993,7 +2993,7 @@ sub GetSignals {
my $type_modifier = defined($1) ? $1 : "";
my $type = $2;
my $pointer = $3;
- my $xref = &MakeXRef ($type);
+ my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
my $ret_type_len = length ($type_modifier) + length ($pointer)
+ length ($type);
@@ -3033,7 +3033,7 @@ sub GetSignals {
}
}
else {
- $xref = &MakeXRef ($type);
+ $xref = &MakeXRef ($type, &tagify($type, "type"));
$pad = ' ' x ($type_len - length($type) - length($pointer));
$desc .= "$xref$pad $pointer$name,\n";
$desc .= (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
@@ -3044,7 +3044,7 @@ sub GetSignals {
}
}
}
- $xref = &MakeXRef ("gpointer");
+ $xref = &MakeXRef ("gpointer", &tagify("gpointer", "type"));
$pad = ' ' x ($type_len - length("gpointer"));
$desc .= "$xref$pad user_data)";
@@ -3182,9 +3182,9 @@ sub GetArgs {
$type_output = &MakeXRef ("GtkSignalFunc") . ", "
. &MakeXRef ("gpointer");
} elsif ($type =~ m/^(\w+)\*$/) {
- $type_output = &MakeXRef ($1) . "*";
+ $type_output = &MakeXRef ($1, &tagify($1, "type")) . "*";
} else {
- $type_output = &MakeXRef ($type);
+ $type_output = &MakeXRef ($type, &tagify($type, "type"));
}
if ($flags =~ m/r/) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]