[gtk-doc] indent: convert tabs to spaces in perl files
- From: Stefan Kost <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] indent: convert tabs to spaces in perl files
- Date: Fri, 15 Apr 2011 20:52:14 +0000 (UTC)
commit a099085e64f71a424f370779a86c62e3a0e2948a
Author: Stefan Kost <ensonic users sf net>
Date: Fri Apr 15 06:40:43 2011 +0300
indent: convert tabs to spaces in perl files
gtkdoc-check.in | 6 +-
gtkdoc-common.pl.in | 328 +++---
gtkdoc-fixxref.in | 84 +-
gtkdoc-mkdb.in | 3453 ++++++++++++++++++++++++++-------------------------
gtkdoc-mktmpl.in | 1246 ++++++++++----------
gtkdoc-scan.in | 820 ++++++------
gtkdoc-scangobj.in | 238 ++--
gtkdoc-scanobj.in | 64 +-
8 files changed, 3127 insertions(+), 3112 deletions(-)
---
diff --git a/gtkdoc-check.in b/gtkdoc-check.in
index b2d71b6..560d69b 100755
--- a/gtkdoc-check.in
+++ b/gtkdoc-check.in
@@ -22,8 +22,8 @@
#############################################################################
# Script : gtkdoc-check
# Description : Runs various checks on built documentation and outputs test
-# results. Can be run druring make check, by adding this to the
-# documentations Makefile.am: TESTS = $(GTKDOC_CHECK)
+# results. Can be run druring make check, by adding this to the
+# documentations Makefile.am: TESTS = $(GTKDOC_CHECK)
#############################################################################
use strict;
@@ -33,7 +33,7 @@ my $PRINT_VERSION;
my $PRINT_HELP;
my %optctl = ('version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP);
+ 'help' => \$PRINT_HELP);
GetOptions(\%optctl, "version", "help");
if ($PRINT_VERSION) {
diff --git a/gtkdoc-common.pl.in b/gtkdoc-common.pl.in
index bf11058..4807e91 100644
--- a/gtkdoc-common.pl.in
+++ b/gtkdoc-common.pl.in
@@ -31,16 +31,16 @@
#############################################################################
# Function : UpdateFileIfChanged
# Description : Compares the old version of the file with the new version and
-# if the file has changed it moves the new version into the old
-# versions place. This is used so we only change files if
-# needed, so we can do proper dependency tracking and we don't
-# needlessly check files into version control systems that haven't
+# if the file has changed it moves the new version into the old
+# versions place. This is used so we only change files if
+# needed, so we can do proper dependency tracking and we don't
+# needlessly check files into version control systems that haven't
# changed.
-# It returns 0 if the file hasn't changed, and 1 if it has.
+# It returns 0 if the file hasn't changed, and 1 if it has.
# Arguments : $old_file - the pathname of the old file.
-# $new_file - the pathname of the new version of the file.
-# $make_backup - 1 if a backup of the old file should be kept.
-# It will have the .bak suffix added to the file name.
+# $new_file - the pathname of the new version of the file.
+# $make_backup - 1 if a backup of the old file should be kept.
+# It will have the .bak suffix added to the file name.
#############################################################################
sub UpdateFileIfChanged {
@@ -52,31 +52,31 @@ sub UpdateFileIfChanged {
my $exit_code = 1;
if (-e $old_file) {
- `cmp -s "$old_file" "$new_file"`;
- $exit_code = $? >> 8;
- # TRACE@(" cmp exit code: $exit_code ($?)";
+ `cmp -s "$old_file" "$new_file"`;
+ $exit_code = $? >> 8;
+ # TRACE@(" cmp exit code: $exit_code ($?)";
}
if ($exit_code > 1) {
- die "Error running 'cmp $old_file $new_file'";
+ die "Error running 'cmp $old_file $new_file'";
}
if ($exit_code == 1) {
# TRACE@(" files changed - replacing old version with new version.");
- if ($make_backup && -e $old_file) {
- rename ($old_file, "$old_file.bak")
- || die "Can't move $old_file to $old_file.bak: $!";
- }
- rename ($new_file, $old_file)
- || die "Can't move $new_file to $old_file: $!";
-
- return 1;
+ if ($make_backup && -e $old_file) {
+ rename ($old_file, "$old_file.bak")
+ || die "Can't move $old_file to $old_file.bak: $!";
+ }
+ rename ($new_file, $old_file)
+ || die "Can't move $new_file to $old_file: $!";
+
+ return 1;
} else {
# TRACE@(" files the same - deleting new version.");
- unlink ("$new_file")
- || die "Can't delete file: $new_file: $!";
+ unlink ("$new_file")
+ || die "Can't delete file: $new_file: $!";
- return 0;
+ return 0;
}
}
@@ -105,9 +105,9 @@ sub ParseStructDeclaration {
# For objects, assume private
if ($is_object) {
- $declaration =~ s!((?:struct|union)\s+\w*\s*\{)
- .*?
- (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!$1!msgx;
+ $declaration =~ s!((?:struct|union)\s+\w*\s*\{)
+ .*?
+ (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!$1!msgx;
}
# Remove private symbols
@@ -121,12 +121,12 @@ sub ParseStructDeclaration {
my @result = ();
if ($declaration =~ /^\s*$/) {
- return @result;
+ return @result;
}
# Prime match after "struct/union {" declaration
if (!scalar($declaration =~ m/(?:struct|union)\s+\w*\s*\{/msg)) {
- die "Declaration '$declaration' does not begin with struct/union [NAME] {\n";
+ die "Declaration '$declaration' does not begin with struct/union [NAME] {\n";
}
# TRACE@("public fields in struct/union: $declaration");
@@ -134,12 +134,12 @@ sub ParseStructDeclaration {
# Treat lines in sequence, allowing singly nested anonymous structs
# and unions.
while ($declaration =~ m/\s*([^{;]+(\{[^\}]*\}[^{;]+)?);/msg) {
- my $line = $1;
+ my $line = $1;
- last if $line =~ /^\s*\}\s*\w*\s*$/;
+ last if $line =~ /^\s*\}\s*\w*\s*$/;
- # FIXME: Just ignore nested structs and unions for now
- next if $line =~ /{/;
+ # FIXME: Just ignore nested structs and unions for now
+ next if $line =~ /{/;
# ignore preprocessor directives
while ($line =~ /^#.*?\n\s*(.*)/msg) {
@@ -149,89 +149,89 @@ sub ParseStructDeclaration {
last if $line =~ /^\s*\}\s*\w*\s*$/;
# Try to match structure members which are functions
- if ($line =~ m/^
- (const\s+|G_CONST_RETURN\s+|unsigned\s+|signed\s+|long\s+|short\s+)*(struct\s+|enum\s+)? # mod1
- (\w+)\s* # type
- (\**(?:\s*restrict)?)\s* # ptr1
- (const\s+)? # mod2
- (\**\s*) # ptr2
- (const\s+)? # mod3
- \(\s*\*\s*(\w+)\s*\)\s* # name
- \(([^)]*)\)\s* # func_params
- $/x) {
-
- my $mod1 = defined($1) ? $1 : "";
- if (defined($2)) { $mod1 .= $2; }
- my $type = $3;
- my $ptr1 = $4;
- my $mod2 = defined($5) ? $5 : "";
- my $ptr2 = $6;
- my $mod3 = defined($7) ? $7 : "";
- my $name = $8;
- my $func_params = $9;
- my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
- my $pname = defined $namefunc ? $namefunc->($name) : $name;
-
- push @result, $name;
-
- if ($output_function_params) {
- push @result, "$mod1$ptype$ptr1$mod2$ptr2$mod3 (*$pname) ($func_params)";
- } else {
- push @result, "$pname ()";
- }
-
-
- # Try to match normal struct fields of comma-separated variables/
- } elsif ($line =~ m/^
- ((?:const\s+|volatile\s+|unsigned\s+|signed\s+|short\s+|long\s+)?)(struct\s+|enum\s+)? # mod1
- (\w+)\s* # type
- (\** \s* const\s+)? # mod2
- (.*) # variables
- $/x) {
-
- my $mod1 = defined($1) ? $1 : "";
- if (defined($2)) { $mod1 .= $2; }
- my $type = $3;
- my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
- my $mod2 = defined($4) ? " " . $4 : "";
- my $list = $5;
+ if ($line =~ m/^
+ (const\s+|G_CONST_RETURN\s+|unsigned\s+|signed\s+|long\s+|short\s+)*(struct\s+|enum\s+)? # mod1
+ (\w+)\s* # type
+ (\**(?:\s*restrict)?)\s* # ptr1
+ (const\s+)? # mod2
+ (\**\s*) # ptr2
+ (const\s+)? # mod3
+ \(\s*\*\s*(\w+)\s*\)\s* # name
+ \(([^)]*)\)\s* # func_params
+ $/x) {
+
+ my $mod1 = defined($1) ? $1 : "";
+ if (defined($2)) { $mod1 .= $2; }
+ my $type = $3;
+ my $ptr1 = $4;
+ my $mod2 = defined($5) ? $5 : "";
+ my $ptr2 = $6;
+ my $mod3 = defined($7) ? $7 : "";
+ my $name = $8;
+ my $func_params = $9;
+ my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
+ my $pname = defined $namefunc ? $namefunc->($name) : $name;
+
+ push @result, $name;
+
+ if ($output_function_params) {
+ push @result, "$mod1$ptype$ptr1$mod2$ptr2$mod3 (*$pname) ($func_params)";
+ } else {
+ push @result, "$pname ()";
+ }
+
+
+ # Try to match normal struct fields of comma-separated variables/
+ } elsif ($line =~ m/^
+ ((?:const\s+|volatile\s+|unsigned\s+|signed\s+|short\s+|long\s+)?)(struct\s+|enum\s+)? # mod1
+ (\w+)\s* # type
+ (\** \s* const\s+)? # mod2
+ (.*) # variables
+ $/x) {
+
+ my $mod1 = defined($1) ? $1 : "";
+ if (defined($2)) { $mod1 .= $2; }
+ my $type = $3;
+ my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
+ my $mod2 = defined($4) ? " " . $4 : "";
+ my $list = $5;
# TRACE@("'$mod1' '$type' '$mod2' '$list'");
- $mod1 =~ s/ / /g;
- $mod2 =~ s/ / /g;
-
- my @names = split /,/, $list;
- for my $n (@names) {
- # Each variable can have any number of '*' before the
- # identifier, and be followed by any number of pairs of
- # brackets or a bit field specifier.
- # e.g. *foo, ***bar, *baz[12][23], foo : 25.
- if ($n =~ m/^\s* (\**(?:\s*restrict\b)?) \s* (\w+) \s* (?: ((?:\[[^\]]*\]\s*)+) | (:\s*\d+)?) \s* $/x) {
- my $ptrs = $1;
- my $name = $2;
- my $array = defined($3) ? $3 : "";
- my $bits = defined($4) ? " $4" : "";
-
- if ($ptrs && $ptrs !~ m/\*$/) { $ptrs .= " "; }
- $array =~ s/ / /g;
- $bits =~ s/ / /g;
-
- push @result, $name;
- if (defined $namefunc) {
- $name = $namefunc->($name);
- }
- push @result, "$mod1$ptype$mod2 $ptrs$name$array$bits;";
-
- # TRACE@("Matched line: $mod1$ptype$mod2 $ptrs$name$array$bits");
- } else {
- print "WARNING: Couldn't parse struct field: $n\n";
- }
- }
-
- } else {
- print "WARNING: Cannot parse structure field: \"$line\"\n";
- }
+ $mod1 =~ s/ / /g;
+ $mod2 =~ s/ / /g;
+
+ my @names = split /,/, $list;
+ for my $n (@names) {
+ # Each variable can have any number of '*' before the
+ # identifier, and be followed by any number of pairs of
+ # brackets or a bit field specifier.
+ # e.g. *foo, ***bar, *baz[12][23], foo : 25.
+ if ($n =~ m/^\s* (\**(?:\s*restrict\b)?) \s* (\w+) \s* (?: ((?:\[[^\]]*\]\s*)+) | (:\s*\d+)?) \s* $/x) {
+ my $ptrs = $1;
+ my $name = $2;
+ my $array = defined($3) ? $3 : "";
+ my $bits = defined($4) ? " $4" : "";
+
+ if ($ptrs && $ptrs !~ m/\*$/) { $ptrs .= " "; }
+ $array =~ s/ / /g;
+ $bits =~ s/ / /g;
+
+ push @result, $name;
+ if (defined $namefunc) {
+ $name = $namefunc->($name);
+ }
+ push @result, "$mod1$ptype$mod2 $ptrs$name$array$bits;";
+
+ # TRACE@("Matched line: $mod1$ptype$mod2 $ptrs$name$array$bits");
+ } else {
+ print "WARNING: Couldn't parse struct field: $n\n";
+ }
+ }
+
+ } else {
+ print "WARNING: Cannot parse structure field: \"$line\"\n";
+ }
}
return @result;
@@ -250,7 +250,7 @@ sub ParseEnumDeclaration {
# For forward enum declarations just return an empty array.
if ($declaration =~ m/enum\s+\S+\s*;/msg) {
- return ();
+ return ();
}
# Remove private symbols
@@ -264,7 +264,7 @@ sub ParseEnumDeclaration {
my @result = ();
if ($declaration =~ /^\s*$/) {
- return @result;
+ return @result;
}
# Remove parenthesized expressions (in macros like GTK_BLAH = BLAH(1,3))
@@ -281,40 +281,40 @@ sub ParseEnumDeclaration {
# Prime match after "typedef enum {" declaration
if (!scalar($declaration =~ m/(typedef\s+)?enum\s*(\S+\s*)?\{/msg)) {
- die "Enum declaration '$declaration' does not begin with 'typedef enum {' or 'enum XXX {'\n";
+ die "Enum declaration '$declaration' does not begin with 'typedef enum {' or 'enum XXX {'\n";
}
# Treat lines in sequence.
while ($declaration =~ m/\s*([^,\}]+)([,\}])/msg) {
- my $line = $1;
- my $terminator = $2;
+ my $line = $1;
+ my $terminator = $2;
# ignore preprocessor directives
while ($line =~ /^#.*?\n\s*(.*)/msg) {
$line=$1;
}
- if ($line =~ m/^(\w+)\s*(=.*)?$/msg) {
- push @result, $1;
+ if ($line =~ m/^(\w+)\s*(=.*)?$/msg) {
+ push @result, $1;
- # Special case for GIOCondition, where the values are specified by
- # macros which expand to include the equal sign like '=1'.
- } elsif ($line =~ m/^(\w+)\s*GLIB_SYSDEF_POLL/msg) {
- push @result, $1;
+ # Special case for GIOCondition, where the values are specified by
+ # macros which expand to include the equal sign like '=1'.
+ } elsif ($line =~ m/^(\w+)\s*GLIB_SYSDEF_POLL/msg) {
+ push @result, $1;
- # Special case include of <gdk/gdkcursors.h>, just ignore it
- } elsif ($line =~ m/^#include/) {
- last;
+ # Special case include of <gdk/gdkcursors.h>, just ignore it
+ } elsif ($line =~ m/^#include/) {
+ last;
- # Special case for #ifdef/#else/#endif, just ignore it
- } elsif ($line =~ m/^#(?:if|else|endif)/) {
- last;
+ # Special case for #ifdef/#else/#endif, just ignore it
+ } elsif ($line =~ m/^#(?:if|else|endif)/) {
+ last;
- } else {
- warn "Cannot parse enumeration member \"$line\"";
- }
+ } else {
+ warn "Cannot parse enumeration member \"$line\"";
+ }
- last if $terminator eq '}';
+ last if $terminator eq '}';
}
return @result;
@@ -362,17 +362,17 @@ sub ParseFunctionDeclaration {
# Try to match a standard parameter
# $1 $2 $3 $4 $5
} elsif ($declaration =~ s/^\s*((?:(?:G_CONST_RETURN|G_GNUC_[A-Z_]+\s+|unsigned long|unsigned short|signed long|signed short|unsigned|signed|long|short|volatile|const)\s+)*)((?:struct\b|enum\b)?\s*\w+)\s*((?:(?:const\b|restrict\b|G_GNUC_[A-Z_]+\b)?\s*\*?\s*(?:const\b|restrict\b|G_GNUC_[A-Z_]+\b)?\s*)*)(\w+)?\s*((?:\[\S*\])*)\s*[,\n]//) {
- my $pre = defined($1) ? $1 : "";
- my $type = $2;
- my $ptr = defined($3) ? $3 : "";
- my $name = defined($4) ? $4 : "";
- my $array = defined($5) ? $5 : "";
-
- $pre =~ s/\s+/ /g;
- $type =~ s/\s+/ /g;
- $ptr =~ s/\s+/ /g;
- $ptr =~ s/\s+$//;
- if ($ptr && $ptr !~ m/\*$/) { $ptr .= " "; }
+ my $pre = defined($1) ? $1 : "";
+ my $type = $2;
+ my $ptr = defined($3) ? $3 : "";
+ my $name = defined($4) ? $4 : "";
+ my $array = defined($5) ? $5 : "";
+
+ $pre =~ s/\s+/ /g;
+ $type =~ s/\s+/ /g;
+ $ptr =~ s/\s+/ /g;
+ $ptr =~ s/\s+$//;
+ if ($ptr && $ptr !~ m/\*$/) { $ptr .= " "; }
# TRACE@("$symbol: '$pre' '$type' '$ptr' '$name' '$array'");
@@ -390,7 +390,7 @@ sub ParseFunctionDeclaration {
push @result, $name;
my $xref = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
- my $label = "$pre$xref $ptr$name$array";
+ my $label = "$pre$xref $ptr$name$array";
if (defined $namefunc) {
$label = $namefunc->($label)
}
@@ -398,25 +398,25 @@ sub ParseFunctionDeclaration {
# Try to match parameters which are functions
# $1 $2 $3 $4 $5 $6 $7 $8
- } elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|G_GNUC_[A-Z_]+\s+|signed\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict\b)?\s*(const\s+)?\(\s*(\*[\s\*]*)\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
- my $mod1 = defined($1) ? $1 : "";
- if (defined($2)) { $mod1 .= $2; }
- my $type = $3;
- my $ptr1 = $4;
- my $mod2 = defined($5) ? $5 : "";
- my $func_ptr = $6;
- my $name = $7;
- my $func_params = defined($8) ? $8 : "";
+ } elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|G_GNUC_[A-Z_]+\s+|signed\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict\b)?\s*(const\s+)?\(\s*(\*[\s\*]*)\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
+ my $mod1 = defined($1) ? $1 : "";
+ if (defined($2)) { $mod1 .= $2; }
+ my $type = $3;
+ my $ptr1 = $4;
+ my $mod2 = defined($5) ? $5 : "";
+ my $func_ptr = $6;
+ my $name = $7;
+ my $func_params = defined($8) ? $8 : "";
#if (!defined($type)) { print "## no type\n"; };
#if (!defined($ptr1)) { print "## no ptr1\n"; };
#if (!defined($func_ptr)) { print "## no func_ptr\n"; };
#if (!defined($name)) { print "## no name\n"; };
- if ($ptr1 && $ptr1 !~ m/\*$/) { $ptr1 .= " "; }
- $func_ptr =~ s/\s+//g;
+ if ($ptr1 && $ptr1 !~ m/\*$/) { $ptr1 .= " "; }
+ $func_ptr =~ s/\s+//g;
- push @result, $name;
+ push @result, $name;
my $xref = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
# TRACE@("Type: [$mod1][$xref][$ptr1][$mod2] ([$func_ptr][$name]) ($func_params)");
my $label = "$mod1$xref$ptr1$mod2 ($func_ptr$name) ($func_params)";
@@ -449,17 +449,17 @@ sub ParseMacroDeclaration {
my @result = ();
if ($declaration =~ m/^\s*#\s*define\s+\w+\(([^\)]*)\)/) {
- my $params = $1;
+ my $params = $1;
- $params =~ s/\\\n//g;
- foreach $param (split (/,/, $params)) {
+ $params =~ s/\\\n//g;
+ foreach $param (split (/,/, $params)) {
$param =~ s/^\s+//;
$param =~ s/\s*$//;
if ($param =~ m/\S/) {
push @result, $param;
push @result, defined $namefunc ? $namefunc->($param) : $param;
}
- }
+ }
}
return @result;
@@ -470,8 +470,8 @@ sub ParseMacroDeclaration {
# Function : LogWarning
# Description : Log a warning in gcc style format
# Arguments : $file - the file the error comes from
-# $line - line number for the wrong entry
-# $message - description of the issue
+# $line - line number for the wrong entry
+# $message - description of the issue
#############################################################################
sub LogWarning {
@@ -504,7 +504,7 @@ sub LogTrace {
# hyphens ("-"), underscores ("_"), colons (":"), and
# periods (".")."
#
-# NOTE: When creating SGML IDS, we append ":CAPS" to all
+# NOTE: When creating SGML IDS, we append ":CAPS" to all
# all-caps identifiers to prevent name clashes (SGML ids are
# case-insensitive). (It basically never is the case that
# mixed-case identifiers would collide.)
diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in
index 9f53852..11de642 100755
--- a/gtkdoc-fixxref.in
+++ b/gtkdoc-fixxref.in
@@ -42,13 +42,13 @@ my $PRINT_VERSION;
my $PRINT_HELP;
my %optctl = ('module' => \$MODULE,
- 'module-dir' => \$MODULE_DIR,
- 'html-dir' => \$HTML_DIR,
- 'extra-dir' => \ EXTRA_DIRS,
- 'version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP);
+ 'module-dir' => \$MODULE_DIR,
+ 'html-dir' => \$HTML_DIR,
+ 'extra-dir' => \ EXTRA_DIRS,
+ 'version' => \$PRINT_VERSION,
+ 'help' => \$PRINT_HELP);
GetOptions(\%optctl, "module=s", "module-dir=s", "html-dir:s", "extra-dir=s@",
- "version", "help");
+ "version", "help");
if ($PRINT_VERSION) {
print "@VERSION \n";
@@ -125,15 +125,15 @@ if (-d $dir && $dir ne $HTML_DIR) {
if (defined ($ENV{"GNOME2_PATH"})) {
foreach $dir (split (/:/, $ENV{"GNOME2_PATH"})) {
$dir = $dir . "/share/gtk-doc/html";
- if (-d $dir && $dir ne $HTML_DIR) {
- #print "Scanning GNOME2_PATH directory: $dir\n";
- if ($dir !~ m%^\Q$path_prefix\E/%) {
+ if (-d $dir && $dir ne $HTML_DIR) {
+ #print "Scanning GNOME2_PATH directory: $dir\n";
+ if ($dir !~ m%^\Q$path_prefix\E/%) {
&ScanIndices ($dir, 1);
} else {
&ScanIndices ($dir, 0);
}
push (@VisitedPaths, $dir);
- }
+ }
# ubuntu started to compress this as index.sgml.gz :/
# https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/77138
}
@@ -217,13 +217,13 @@ sub ScanIndices {
opendir (HTMLDIR, $scan_dir) || return;
my $file;
foreach $file (readdir (HTMLDIR)) {
- if ($file eq '.' || $file eq '..') {
- next;
- } elsif (-d "$scan_dir/$file") {
- push (@subdirs, $file);
- } elsif ($file eq "index.sgml") {
- &ScanIndex ("$scan_dir/$file", $use_absolute_links);
- }
+ if ($file eq '.' || $file eq '..') {
+ next;
+ } elsif (-d "$scan_dir/$file") {
+ push (@subdirs, $file);
+ } elsif ($file eq "index.sgml") {
+ &ScanIndex ("$scan_dir/$file", $use_absolute_links);
+ }
# ubuntu started to compress this as index.sgml.gz :/
# https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/77138
}
@@ -232,7 +232,7 @@ sub ScanIndices {
# Now recursively scan the subdirectories.
my $dir;
foreach $dir (@subdirs) {
- &ScanIndices ("$scan_dir/$dir", $use_absolute_links);
+ &ScanIndices ("$scan_dir/$dir", $use_absolute_links);
}
}
@@ -252,12 +252,12 @@ sub ScanIndex {
}
open (INDEXFILE, $file)
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
while (<INDEXFILE>) {
- if (m/^<ANCHOR\s+id\s*=\s*"([^"]*)"\s+href\s*=\s*"([^"]*)"\s*>/) {
- #print "Found id: $1 href: $2\n";
- $Links{$1} = "$dir$2";
- }
+ if (m/^<ANCHOR\s+id\s*=\s*"([^"]*)"\s+href\s*=\s*"([^"]*)"\s*>/) {
+ #print "Found id: $1 href: $2\n";
+ $Links{$1} = "$dir$2";
+ }
}
close (INDEXFILE);
}
@@ -267,14 +267,14 @@ sub FixCrossReferences {
my ($scan_dir) = @_;
opendir (HTMLDIR, $scan_dir)
- || die "Can't open HTML directory $scan_dir: $!";
+ || die "Can't open HTML directory $scan_dir: $!";
my $file;
foreach $file (readdir (HTMLDIR)) {
- if ($file eq '.' || $file eq '..') {
- next;
- } elsif ($file =~ m/.html?$/) {
- &FixHTMLFile ("$scan_dir/$file");
- }
+ if ($file eq '.' || $file eq '..') {
+ next;
+ } elsif ($file =~ m/.html?$/) {
+ &FixHTMLFile ("$scan_dir/$file");
+ }
}
closedir (HTMLDIR);
}
@@ -285,11 +285,11 @@ sub FixHTMLFile {
#print "Fixing file: $file\n";
open (HTMLFILE, $file)
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
undef $/;
my $entire_file = <HTMLFILE>;
close (HTMLFILE);
-
+
if ("@HIGHLIGHT@" ne "") {
# FIXME: ideally we'd pass a clue about the example language to the highligher
# unfortunately the "language" attribute is not appearing in the html output
@@ -303,7 +303,7 @@ sub FixHTMLFile {
# this just broke existing GTKDOCLINK tags
# <GTKDOCLINK HREF="GST-PAD-SINK:CAPS">GST_PAD_SINK</GTKDOCLINK>
$entire_file =~ s%\<GTKDOCLINK\s+HREF=\"(.*?)\"\>(.*?)\</GTKDOCLINK\>%\<GTKDOCLINK\ HREF=\"$1\"\>$2\</GTKDOCLINK\>%gs;
-
+
# from the highlighter we get all the functions marked up
# now we could turn them into GTKDOCLINK items
$entire_file =~ s%(<span class=\"function\">)(.*?)(</span>)%&MakeGtkDocLink($1,$2,$3);%gse;
@@ -321,21 +321,21 @@ sub FixHTMLFile {
$entire_file = join("\n",@lines);
open (NEWFILE, ">$file.new")
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
print NEWFILE $entire_file;
close (NEWFILE);
unlink ($file)
- || die "Can't delete $file: $!";
+ || die "Can't delete $file: $!";
rename ("$file.new", $file)
- || die "Can't rename $file.new: $!";
+ || die "Can't rename $file.new: $!";
}
sub MakeXRef {
my ($file, $line, $id, $text) = @_;
my $href = $Links{$id};
-
+
# this is a workaround for some inconsitency we have with CreateValidSGMLID
if (!$href && $id =~ m/:/) {
my $tid = $id;
@@ -378,7 +378,7 @@ sub MakeXRef {
&LogWarning ($file, $line, "no link for: '$id' -> ($text).");
$NoLinks{$id} = 1;
}
- return $text;
+ return $text;
}
}
@@ -417,9 +417,9 @@ sub HighlightSource {
open (NEWFILE, ">$temp_source_file") || die "Can't open $temp_source_file: $!";
print NEWFILE $source;
close (NEWFILE);
-
+
#print" running @HIGHLIGHT@ @HIGHLIGHT_OPTIONS $temp_source_file \n";
-
+
# format source
my $highlighted_source=` HIGHLIGHT@ @HIGHLIGHT_OPTIONS $temp_source_file`;
if ("@HIGHLIGHT@" =~ m%/source-highlight$%) {
@@ -441,7 +441,7 @@ sub HighlightSource {
}
# remove temp file
unlink ($temp_source_file)
- || die "Can't delete $temp_source_file: $!";
+ || die "Can't delete $temp_source_file: $!";
return &HighlightSourcePostprocess($type, $highlighted_source);
}
@@ -488,9 +488,9 @@ sub HighlightSourceVim {
# remove temp files
unlink ($temp_source_file)
- || die "Can't delete $temp_source_file: $!";
+ || die "Can't delete $temp_source_file: $!";
unlink ("$temp_source_file.html")
- || die "Can't delete $temp_source_file.html: $!";
+ || die "Can't delete $temp_source_file.html: $!";
return &HighlightSourcePostprocess($type, $highlighted_source);
}
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index a4f8bf4..a97cfc9 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -53,23 +53,23 @@ my $OUTPUT_ALL_SYMBOLS;
my $OUTPUT_SYMBOLS_WITHOUT_SINCE;
my %optctl = ('module' => \$MODULE,
- 'source-dir' => \ SOURCE_DIRS,
- 'source-suffixes' => \$SOURCE_SUFFIXES,
- 'ignore-files' => \$IGNORE_FILES,
- 'output-dir' => \$SGML_OUTPUT_DIR,
- 'tmpl-dir' => \$TMPL_DIR,
- 'version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP,
- 'main-sgml-file' => \$MAIN_SGML_FILE,
- 'expand-content-files' => \$EXPAND_CONTENT_FILES,
- 'sgml-mode' => \$INLINE_MARKUP_MODE,
- 'xml-mode' => \$INLINE_MARKUP_MODE,
- 'default-stability' => \$DEFAULT_STABILITY,
- 'default-includes' => \$DEFAULT_INCLUDES,
- 'output-format' => \$OUTPUT_FORMAT,
- 'name-space' => \$NAME_SPACE,
- 'outputallsymbols' => \$OUTPUT_ALL_SYMBOLS,
- 'outputsymbolswithoutsince' => \$OUTPUT_SYMBOLS_WITHOUT_SINCE
+ 'source-dir' => \ SOURCE_DIRS,
+ 'source-suffixes' => \$SOURCE_SUFFIXES,
+ 'ignore-files' => \$IGNORE_FILES,
+ 'output-dir' => \$SGML_OUTPUT_DIR,
+ 'tmpl-dir' => \$TMPL_DIR,
+ 'version' => \$PRINT_VERSION,
+ 'help' => \$PRINT_HELP,
+ 'main-sgml-file' => \$MAIN_SGML_FILE,
+ 'expand-content-files' => \$EXPAND_CONTENT_FILES,
+ 'sgml-mode' => \$INLINE_MARKUP_MODE,
+ 'xml-mode' => \$INLINE_MARKUP_MODE,
+ 'default-stability' => \$DEFAULT_STABILITY,
+ 'default-includes' => \$DEFAULT_INCLUDES,
+ 'output-format' => \$OUTPUT_FORMAT,
+ 'name-space' => \$NAME_SPACE,
+ 'outputallsymbols' => \$OUTPUT_ALL_SYMBOLS,
+ 'outputsymbolswithoutsince' => \$OUTPUT_SYMBOLS_WITHOUT_SINCE
);
GetOptions(\%optctl, "module=s", "source-dir:s", "source-suffixes:s",
"ignore-files:s", "output-dir:s", "tmpl-dir:s", "version", "outputallsymbols",
@@ -152,22 +152,22 @@ if ($OUTPUT_FORMAT eq "xml") {
if (-e $MAIN_SGML_FILE) {
open(INPUT, "<$MAIN_SGML_FILE") || die "Can't open $MAIN_SGML_FILE";
- $doctype_header = "";
- while (<INPUT>) {
- if (/^\s*<(book|chapter|article)/) {
- # check that the top-level tag or the doctype decl contain the xinclude namespace decl
- if (($_ !~ m/http:\/\/www.w3.org\/200[13]\/XInclude/) && ($doctype_header !~ m/http:\/\/www.w3.org\/200[13]\/XInclude/m)) {
- $doctype_header = "";
- }
- last;
- }
- $doctype_header .= $_;
- }
- close(INPUT);
- $doctype_header =~ s/<!DOCTYPE \w+/<!DOCTYPE refentry/;
- # if there are SYSTEM ENTITIES here, we should prepend "../" to the path
- # FIXME: not sure if we can do this now, as people already work-around the problem
- # $doctype_header =~ s#<!ENTITY % ([a-zA-Z-]+) SYSTEM \"([^/][a-zA-Z./]+)\">#<!ENTITY % $1 SYSTEM \"../$2\">#g;
+ $doctype_header = "";
+ while (<INPUT>) {
+ if (/^\s*<(book|chapter|article)/) {
+ # check that the top-level tag or the doctype decl contain the xinclude namespace decl
+ if (($_ !~ m/http:\/\/www.w3.org\/200[13]\/XInclude/) && ($doctype_header !~ m/http:\/\/www.w3.org\/200[13]\/XInclude/m)) {
+ $doctype_header = "";
+ }
+ last;
+ }
+ $doctype_header .= $_;
+ }
+ close(INPUT);
+ $doctype_header =~ s/<!DOCTYPE \w+/<!DOCTYPE refentry/;
+ # if there are SYSTEM ENTITIES here, we should prepend "../" to the path
+ # FIXME: not sure if we can do this now, as people already work-around the problem
+ # $doctype_header =~ s#<!ENTITY % ([a-zA-Z-]+) SYSTEM \"([^/][a-zA-Z./]+)\">#<!ENTITY % $1 SYSTEM \"../$2\">#g;
} else {
$doctype_header =
"<?xml version=\"1.0\"?>\n" .
@@ -210,22 +210,22 @@ my $ARGS_FILE = "$ROOT_DIR/$MODULE.args";
# These global arrays store information on signals. Each signal has an entry
# in each of these arrays at the same index, like a multi-dimensional array.
-my @SignalObjects; # The GtkObject which emits the signal.
-my @SignalNames; # The signal name.
-my @SignalReturns; # The return type.
-my @SignalFlags; # Flags for the signal
-my @SignalPrototypes; # The rest of the prototype of the signal handler.
+my @SignalObjects; # The GtkObject which emits the signal.
+my @SignalNames; # The signal name.
+my @SignalReturns; # The return type.
+my @SignalFlags; # Flags for the signal
+my @SignalPrototypes; # The rest of the prototype of the signal handler.
# These global arrays store information on Args. Each Arg has an entry
# in each of these arrays at the same index, like a multi-dimensional array.
-my @ArgObjects; # The GtkObject which has the Arg.
-my @ArgNames; # The Arg name.
-my @ArgTypes; # The Arg type - gint, GtkArrowType etc.
-my @ArgFlags; # How the Arg can be used - readable/writable etc.
-my @ArgNicks; # The nickname of the Arg.
+my @ArgObjects; # The GtkObject which has the Arg.
+my @ArgNames; # The Arg name.
+my @ArgTypes; # The Arg type - gint, GtkArrowType etc.
+my @ArgFlags; # How the Arg can be used - readable/writable etc.
+my @ArgNicks; # The nickname of the Arg.
my @ArgBlurbs; # Docstring of the Arg.
my @ArgDefaults; # Default value of the Arg.
-my @ArgRanges; # The range of the Arg type
+my @ArgRanges; # The range of the Arg type
# These global hashes store declaration info keyed on a symbol name.
my %Declarations;
my %DeclarationTypes;
@@ -323,7 +323,7 @@ my %AnnotationDefinition = (
# Create the root DocBook output directory if it doens't exist.
if (! -e $SGML_OUTPUT_DIR) {
mkdir ("$SGML_OUTPUT_DIR", 0777)
- || die "Can't create directory: $SGML_OUTPUT_DIR";
+ || die "Can't create directory: $SGML_OUTPUT_DIR";
}
# Function and other declaration output settings.
@@ -412,7 +412,7 @@ if ($changed || ! -e "$ROOT_DIR/sgml.stamp") {
&OutputAnnotationGlossary;
open (TIMESTAMP, ">$ROOT_DIR/sgml.stamp")
- || die "Can't create $ROOT_DIR/sgml.stamp: $!";
+ || die "Can't create $ROOT_DIR/sgml.stamp: $!";
print (TIMESTAMP "timestamp");
close (TIMESTAMP);
}
@@ -420,9 +420,9 @@ if ($changed || ! -e "$ROOT_DIR/sgml.stamp") {
#############################################################################
# Function : OutputObjectList
# Description : This outputs the alphabetical list of objects, in a columned
-# table.
+# table.
# FIXME: Currently this also outputs ancestor objects
-# which may not actually be in this module.
+# which may not actually be in this module.
# Arguments : none
#############################################################################
@@ -435,7 +435,7 @@ sub OutputObjectList {
my $new_object_index = "$SGML_OUTPUT_DIR/object_index.new";
open (OUTPUT, ">$new_object_index")
- || die "Can't create $new_object_index: $!";
+ || die "Can't create $new_object_index: $!";
if ($OUTPUT_FORMAT eq "xml") {
my $header = $doctype_header;
@@ -456,15 +456,15 @@ EOF
my $count = 0;
my $object;
foreach $object (sort (@Objects)) {
- my $xref = &MakeXRef ($object);
- if ($count % $cols == 0) { print (OUTPUT "<row>\n"); }
- print (OUTPUT "<entry>$xref</entry>\n");
- if ($count % $cols == ($cols - 1)) { print (OUTPUT "</row>\n"); }
- $count++;
+ my $xref = &MakeXRef ($object);
+ if ($count % $cols == 0) { print (OUTPUT "<row>\n"); }
+ print (OUTPUT "<entry>$xref</entry>\n");
+ if ($count % $cols == ($cols - 1)) { print (OUTPUT "</row>\n"); }
+ $count++;
}
if ($count == 0) {
# emit an empty row, since empty tables are invalid
- print (OUTPUT "<row><entry> </entry></row>\n");
+ print (OUTPUT "<row><entry> </entry></row>\n");
}
else {
if ($count % $cols > 0) {
@@ -484,10 +484,10 @@ EOF
#############################################################################
# Function : OutputSGML
# Description : This collects the output for each section of the docs, and
-# outputs each file when the end of the section is found.
+# outputs each file when the end of the section is found.
# Arguments : $file - the $MODULE-sections.txt file which contains all of
-# the functions/macros/structs etc. being documented, organised
-# into sections and subsections.
+# the functions/macros/structs etc. being documented, organised
+# into sections and subsections.
#############################################################################
sub OutputSGML {
@@ -495,7 +495,7 @@ sub OutputSGML {
#print "Reading: $file\n";
open (INPUT, $file)
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
my $filename = "";
my $book_top = "";
my $book_bottom = "";
@@ -530,37 +530,37 @@ sub OutputSGML {
&MergeSourceDocumentation;
while (<INPUT>) {
- if (m/^#/) {
- next;
-
- } elsif (m/^<SECTION>/) {
- $synopsis = "";
- $details = "";
- $num_symbols = 0;
- $in_section = 1;
- @file_objects = ();
- %symbol_def_line = ();
-
- } elsif (m/^<SUBSECTION\s*(.*)>/i) {
- $synopsis .= "\n";
- $subsection = $1;
-
- } elsif (m/^<SUBSECTION>/) {
-
- } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
- $title = $1;
- #print "Section: $title\n";
-
- # We don't want warnings if object & class structs aren't used.
- $DeclarationOutput{$title} = 1;
- $DeclarationOutput{"${title}Class"} = 1;
- $DeclarationOutput{"${title}Iface"} = 1;
- $DeclarationOutput{"${title}Interface"} = 1;
-
- } elsif (m/^<FILE>(.*)<\/FILE>/) {
- $filename = $1;
- if (! defined $templates{$filename}) {
- if (&ReadTemplateFile ("$TMPL_DIR/$filename", 1)) {
+ if (m/^#/) {
+ next;
+
+ } elsif (m/^<SECTION>/) {
+ $synopsis = "";
+ $details = "";
+ $num_symbols = 0;
+ $in_section = 1;
+ @file_objects = ();
+ %symbol_def_line = ();
+
+ } elsif (m/^<SUBSECTION\s*(.*)>/i) {
+ $synopsis .= "\n";
+ $subsection = $1;
+
+ } elsif (m/^<SUBSECTION>/) {
+
+ } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
+ $title = $1;
+ #print "Section: $title\n";
+
+ # We don't want warnings if object & class structs aren't used.
+ $DeclarationOutput{$title} = 1;
+ $DeclarationOutput{"${title}Class"} = 1;
+ $DeclarationOutput{"${title}Iface"} = 1;
+ $DeclarationOutput{"${title}Interface"} = 1;
+
+ } elsif (m/^<FILE>(.*)<\/FILE>/) {
+ $filename = $1;
+ if (! defined $templates{$filename}) {
+ if (&ReadTemplateFile ("$TMPL_DIR/$filename", 1)) {
&MergeSourceDocumentation;
$templates{$filename}=$.;
}
@@ -570,47 +570,47 @@ sub OutputSGML {
}
if (($title eq "") and (defined $SourceSymbolDocs{"$TMPL_DIR/$filename:Title"})) {
$title = $SourceSymbolDocs{"$TMPL_DIR/$filename:Title"};
- # Remove trailing blanks
- $title =~ s/\s+$//;
+ # Remove trailing blanks
+ $title =~ s/\s+$//;
}
- } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
- if ($in_section) {
- $section_includes = $1;
- } else {
- if (defined $DEFAULT_INCLUDES) {
+ } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
+ if ($in_section) {
+ $section_includes = $1;
+ } else {
+ if (defined $DEFAULT_INCLUDES) {
&LogWarning ($file, $., "Default <INCLUDE> being overridden by command line option.");
- }
- else {
- $includes = $1;
- }
- }
+ }
+ else {
+ $includes = $1;
+ }
+ }
- } elsif (m/^<\/SECTION>/) {
+ } elsif (m/^<\/SECTION>/) {
#print "End of section: $title\n";
- if ($num_symbols > 0) {
- # collect documents
- if ($OUTPUT_FORMAT eq "xml") {
- $book_bottom .= " <xi:include href=\"xml/$filename.xml\"/>\n";
- } else {
- $book_top.="<!ENTITY $section_id SYSTEM \"sgml/$filename.sgml\">\n";
- $book_bottom .= " &$section_id;\n";
- }
-
- if (defined ($SourceSymbolDocs{"$TMPL_DIR/$filename:Include"})) {
- if ($section_includes) {
- &LogWarning ($file, $., "Section <INCLUDE> being overridden by inline comments.");
- }
- $section_includes = $SourceSymbolDocs{"$TMPL_DIR/$filename:Include"};
- }
- if ($section_includes eq "") {
- $section_includes = $includes;
- }
+ if ($num_symbols > 0) {
+ # collect documents
+ if ($OUTPUT_FORMAT eq "xml") {
+ $book_bottom .= " <xi:include href=\"xml/$filename.xml\"/>\n";
+ } else {
+ $book_top.="<!ENTITY $section_id SYSTEM \"sgml/$filename.sgml\">\n";
+ $book_bottom .= " &$section_id;\n";
+ }
+
+ if (defined ($SourceSymbolDocs{"$TMPL_DIR/$filename:Include"})) {
+ if ($section_includes) {
+ &LogWarning ($file, $., "Section <INCLUDE> being overridden by inline comments.");
+ }
+ $section_includes = $SourceSymbolDocs{"$TMPL_DIR/$filename:Include"};
+ }
+ if ($section_includes eq "") {
+ $section_includes = $includes;
+ }
$signals_synop =~ s/^\n*//g;
$signals_synop =~ s/\n+$/\n/g;
- if ($signals_synop ne '') {
- $signals_synop = <<EOF;
+ if ($signals_synop ne '') {
+ $signals_synop = <<EOF;
<refsect1 id="$section_id.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
@@ -620,18 +620,18 @@ EOF
$signals_desc =~ s/^\n*//g;
$signals_desc =~ s/\n+$/\n/g;
$signals_desc =~ s/(\s|\n)+$//ms;
- $signals_desc = <<EOF;
+ $signals_desc = <<EOF;
<refsect1 id="$section_id.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
$signals_desc
</refsect1>
EOF
- }
+ }
$args_synop =~ s/^\n*//g;
$args_synop =~ s/\n+$/\n/g;
- if ($args_synop ne '') {
- $args_synop = <<EOF;
+ if ($args_synop ne '') {
+ $args_synop = <<EOF;
<refsect1 id="$section_id.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
@@ -641,18 +641,18 @@ EOF
$args_desc =~ s/^\n*//g;
$args_desc =~ s/\n+$/\n/g;
$args_desc =~ s/(\s|\n)+$//ms;
- $args_desc = <<EOF;
+ $args_desc = <<EOF;
<refsect1 id="$section_id.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
$args_desc
</refsect1>
EOF
- }
+ }
$child_args_synop =~ s/^\n*//g;
$child_args_synop =~ s/\n+$/\n/g;
- if ($child_args_synop ne '') {
- $args_synop .= <<EOF;
+ if ($child_args_synop ne '') {
+ $args_synop .= <<EOF;
<refsect1 id="$section_id.child-properties" role="child_properties">
<title role="child_properties.title">Child Properties</title>
<synopsis>
@@ -662,18 +662,18 @@ EOF
$child_args_desc =~ s/^\n*//g;
$child_args_desc =~ s/\n+$/\n/g;
$child_args_desc =~ s/(\s|\n)+$//ms;
- $args_desc .= <<EOF;
+ $args_desc .= <<EOF;
<refsect1 id="$section_id.child-property-details" role="child_property_details">
<title role="child_property_details.title">Child Property Details</title>
$child_args_desc
</refsect1>
EOF
- }
+ }
$style_args_synop =~ s/^\n*//g;
$style_args_synop =~ s/\n+$/\n/g;
- if ($style_args_synop ne '') {
- $args_synop .= <<EOF;
+ if ($style_args_synop ne '') {
+ $args_synop .= <<EOF;
<refsect1 id="$section_id.style-properties" role="style_properties">
<title role="style_properties.title">Style Properties</title>
<synopsis>
@@ -683,114 +683,114 @@ EOF
$style_args_desc =~ s/^\n*//g;
$style_args_desc =~ s/\n+$/\n/g;
$style_args_desc =~ s/(\s|\n)+$//ms;
- $args_desc .= <<EOF;
+ $args_desc .= <<EOF;
<refsect1 id="$section_id.style-property-details" role="style_properties_details">
<title role="style_properties_details.title">Style Property Details</title>
$style_args_desc
</refsect1>
EOF
- }
+ }
$hierarchy =~ s/^\n*//g;
$hierarchy =~ s/\n+$/\n/g;
$hierarchy =~ s/(\s|\n)+$//ms;
- if ($hierarchy ne "") {
- $hierarchy = <<EOF;
+ if ($hierarchy ne "") {
+ $hierarchy = <<EOF;
<refsect1 id="$section_id.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
$hierarchy
</refsect1>
EOF
- }
+ }
$interfaces =~ s/^\n*//g;
$interfaces =~ s/\n+$/\n/g;
$interfaces =~ s/(\s|\n)+$//ms;
- if ($interfaces ne "") {
- $interfaces = <<EOF;
+ if ($interfaces ne "") {
+ $interfaces = <<EOF;
<refsect1 id="$section_id.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
$interfaces
</refsect1>
EOF
- }
+ }
$implementations =~ s/^\n*//g;
$implementations =~ s/\n+$/\n/g;
$implementations =~ s/(\s|\n)+$//ms;
- if ($implementations ne "") {
- $implementations = <<EOF;
+ if ($implementations ne "") {
+ $implementations = <<EOF;
<refsect1 id="$section_id.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
$implementations
</refsect1>
EOF
- }
+ }
$prerequisites =~ s/^\n*//g;
$prerequisites =~ s/\n+$/\n/g;
$prerequisites =~ s/(\s|\n)+$//ms;
- if ($prerequisites ne "") {
- $prerequisites = <<EOF;
+ if ($prerequisites ne "") {
+ $prerequisites = <<EOF;
<refsect1 id="$section_id.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
$prerequisites
</refsect1>
EOF
- }
+ }
$derived =~ s/^\n*//g;
$derived =~ s/\n+$/\n/g;
$derived =~ s/(\s|\n)+$//ms;
- if ($derived ne "") {
- $derived = <<EOF;
+ if ($derived ne "") {
+ $derived = <<EOF;
<refsect1 id="$section_id.derived-interfaces" role="derived_interfaces">
<title role="derived_interfaces.title">Known Derived Interfaces</title>
$derived
</refsect1>
EOF
- }
-
- $synopsis =~ s/^\n*//g;
- $synopsis =~ s/\n+$/\n/g;
- my $file_changed = &OutputSGMLFile ($filename, $title, $section_id,
- $section_includes,
- \$synopsis, \$details,
- \$signals_synop, \$signals_desc,
- \$args_synop, \$args_desc,
- \$hierarchy, \$interfaces,
- \$implementations,
- \$prerequisites, \$derived,
- \ file_objects);
- if ($file_changed) {
- $changed = 1;
- }
- }
- $title = "";
- $section_id = "";
- $subsection = "";
- $in_section = 0;
- $section_includes = "";
- $signals_synop = "";
- $signals_desc = "";
- $args_synop = "";
- $child_args_synop = "";
- $style_args_synop = "";
- $args_desc = "";
- $child_args_desc = "";
- $style_args_desc = "";
- $hierarchy = "";
- $interfaces = "";
- $implementations = "";
- $prerequisites = "";
- $derived = "";
-
- } elsif (m/^(\S+)/) {
- my $symbol = $1;
- #print " Symbol: $symbol\n";
+ }
+
+ $synopsis =~ s/^\n*//g;
+ $synopsis =~ s/\n+$/\n/g;
+ my $file_changed = &OutputSGMLFile ($filename, $title, $section_id,
+ $section_includes,
+ \$synopsis, \$details,
+ \$signals_synop, \$signals_desc,
+ \$args_synop, \$args_desc,
+ \$hierarchy, \$interfaces,
+ \$implementations,
+ \$prerequisites, \$derived,
+ \ file_objects);
+ if ($file_changed) {
+ $changed = 1;
+ }
+ }
+ $title = "";
+ $section_id = "";
+ $subsection = "";
+ $in_section = 0;
+ $section_includes = "";
+ $signals_synop = "";
+ $signals_desc = "";
+ $args_synop = "";
+ $child_args_synop = "";
+ $style_args_synop = "";
+ $args_desc = "";
+ $child_args_desc = "";
+ $style_args_desc = "";
+ $hierarchy = "";
+ $interfaces = "";
+ $implementations = "";
+ $prerequisites = "";
+ $derived = "";
+
+ } elsif (m/^(\S+)/) {
+ my $symbol = $1;
+ #print " Symbol: $symbol\n";
# check for duplicate entries
- if (! defined $symbol_def_line{$symbol}) {
+ if (! defined $symbol_def_line{$symbol}) {
my $declaration = $Declarations{$symbol};
if (defined ($declaration)) {
# We don't want standard macros/functions of GObjects,
@@ -866,7 +866,7 @@ EOF
&LogWarning ($file, $., "Double symbol entry for $symbol. ".
"Previous occurrence on line ".$symbol_def_line{$symbol}.".");
}
- }
+ }
}
close (INPUT);
@@ -875,17 +875,17 @@ EOF
&OutputUnusedSymbols;
if ($OUTPUT_ALL_SYMBOLS) {
- &OutputAllSymbols;
+ &OutputAllSymbols;
}
if ($OUTPUT_SYMBOLS_WITHOUT_SINCE) {
- &OutputSymbolsWithoutSince;
+ &OutputSymbolsWithoutSince;
}
for $filename (split (' ', $EXPAND_CONTENT_FILES)) {
- my $file_changed = &OutputExtraFile ($filename);
- if ($file_changed) {
- $changed = 1;
- }
+ my $file_changed = &OutputExtraFile ($filename);
+ if ($file_changed) {
+ $changed = 1;
+ }
}
&OutputBook ($book_top, $book_bottom);
@@ -910,7 +910,7 @@ sub OutputIndex {
my $short_symbol;
open (OUTPUT, ">$new_index")
- || die "Can't create $new_index";
+ || die "Can't create $new_index";
my $header = $doctype_header;
$header =~ s/<!DOCTYPE \w+/<!DOCTYPE indexdiv/;
@@ -1089,7 +1089,7 @@ rerun:
}
open (OUTPUT, ">$new_glossary")
- || die "Can't create $new_glossary";
+ || die "Can't create $new_glossary";
my $header = $doctype_header;
$header =~ s/<!DOCTYPE \w+/<!DOCTYPE glossary/;
@@ -1139,8 +1139,8 @@ EOF
# Description : This collects the names of non-private symbols from the
# $MODULE-sections.txt file.
# Arguments : $file - the $MODULE-sections.txt file which contains all of
-# the functions/macros/structs etc. being documented, organised
-# into sections and subsections.
+# the functions/macros/structs etc. being documented, organised
+# into sections and subsections.
#############################################################################
sub ReadKnownSymbols {
@@ -1150,45 +1150,45 @@ sub ReadKnownSymbols {
#print "Reading: $file\n";
open (INPUT, $file)
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
while (<INPUT>) {
- if (m/^#/) {
- next;
+ if (m/^#/) {
+ next;
- } elsif (m/^<SECTION>/) {
- $subsection = "";
+ } elsif (m/^<SECTION>/) {
+ $subsection = "";
- } elsif (m/^<SUBSECTION\s*(.*)>/i) {
- $subsection = $1;
+ } elsif (m/^<SUBSECTION\s*(.*)>/i) {
+ $subsection = $1;
- } elsif (m/^<SUBSECTION>/) {
- next;
+ } elsif (m/^<SUBSECTION>/) {
+ next;
- } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
+ } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
next;
- } elsif (m/^<FILE>(.*)<\/FILE>/) {
+ } elsif (m/^<FILE>(.*)<\/FILE>/) {
$KnownSymbols{"$TMPL_DIR/$1:Long_Description"} = 1;
$KnownSymbols{"$TMPL_DIR/$1:Short_Description"} = 1;
next;
- } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
+ } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
next;
- } elsif (m/^<\/SECTION>/) {
+ } elsif (m/^<\/SECTION>/) {
next;
- } elsif (m/^(\S+)/) {
- my $symbol = $1;
+ } elsif (m/^(\S+)/) {
+ my $symbol = $1;
- if ($subsection ne "Standard" && $subsection ne "Private") {
- $KnownSymbols{$symbol} = 1;
- }
- else {
- $KnownSymbols{$symbol} = 0;
- }
- }
+ if ($subsection ne "Standard" && $subsection ne "Private") {
+ $KnownSymbols{$symbol} = 1;
+ }
+ else {
+ $KnownSymbols{$symbol} = 0;
+ }
+ }
}
close (INPUT);
}
@@ -1197,9 +1197,9 @@ sub ReadKnownSymbols {
#############################################################################
# Function : OutputDeclaration
# Description : Returns the synopsis and detailed description DocBook
-# describing one function/macro etc.
+# describing one function/macro etc.
# Arguments : $symbol - the name of the function/macro begin described.
-# $declaration - the declaration of the function/macro.
+# $declaration - the declaration of the function/macro.
#############################################################################
sub OutputDeclaration {
@@ -1207,23 +1207,23 @@ sub OutputDeclaration {
my $type = $DeclarationTypes {$symbol};
if ($type eq 'MACRO') {
- return &OutputMacro ($symbol, $declaration);
+ return &OutputMacro ($symbol, $declaration);
} elsif ($type eq 'TYPEDEF') {
- return &OutputTypedef ($symbol, $declaration);
+ return &OutputTypedef ($symbol, $declaration);
} elsif ($type eq 'STRUCT') {
- return &OutputStruct ($symbol, $declaration);
+ return &OutputStruct ($symbol, $declaration);
} elsif ($type eq 'ENUM') {
- return &OutputEnum ($symbol, $declaration);
+ return &OutputEnum ($symbol, $declaration);
} elsif ($type eq 'UNION') {
- return &OutputUnion ($symbol, $declaration);
+ return &OutputUnion ($symbol, $declaration);
} elsif ($type eq 'VARIABLE') {
- return &OutputVariable ($symbol, $declaration);
+ return &OutputVariable ($symbol, $declaration);
} elsif ($type eq 'FUNCTION') {
- return &OutputFunction ($symbol, $declaration, $type);
+ return &OutputFunction ($symbol, $declaration, $type);
} elsif ($type eq 'USER_FUNCTION') {
- return &OutputFunction ($symbol, $declaration, $type);
+ return &OutputFunction ($symbol, $declaration, $type);
} else {
- die "Unknown symbol type";
+ die "Unknown symbol type";
}
}
@@ -1239,10 +1239,10 @@ sub OutputSymbolTraits {
my $desc = "";
if (exists $Since{$symbol}) {
- $desc .= "<para role=\"since\">Since $Since{$symbol}</para>";
+ $desc .= "<para role=\"since\">Since $Since{$symbol}</para>";
}
if (exists $StabilityLevel{$symbol}) {
- $desc .= "<para role=\"stability\">Stability Level: $StabilityLevel{$symbol}</para>";
+ $desc .= "<para role=\"stability\">Stability Level: $StabilityLevel{$symbol}</para>";
}
return $desc;
}
@@ -1305,7 +1305,7 @@ EOF
# Function : OutputMacro
# Description : Returns the synopsis and detailed description of a macro.
# Arguments : $symbol - the macro.
-# $declaration - the declaration of the macro.
+# $declaration - the declaration of the macro.
#############################################################################
sub OutputMacro {
@@ -1349,19 +1349,19 @@ sub OutputMacro {
# longer than 2 lines, otherwise we get lots of complicated macros like
# g_assert.
if (!defined ($DeclarationConditional{$symbol}) && ($symbol !~ m/^g_/)
- && ($symbol !~ m/^_?gnome_/) && (($declaration =~ tr/\n//) < 2)) {
- my $decl_out = &CreateValidSGML ($declaration);
- $desc .= "<programlisting>$decl_out</programlisting>\n";
+ && ($symbol !~ m/^_?gnome_/) && (($declaration =~ tr/\n//) < 2)) {
+ my $decl_out = &CreateValidSGML ($declaration);
+ $desc .= "<programlisting>$decl_out</programlisting>\n";
} else {
- $desc .= "<programlisting>" . &MakeReturnField("#define") . "$symbol";
- if ($declaration =~ m/^\s*#\s*define\s+\w+(\([^\)]*\))/) {
+ $desc .= "<programlisting>" . &MakeReturnField("#define") . "$symbol";
+ if ($declaration =~ m/^\s*#\s*define\s+\w+(\([^\)]*\))/) {
my $args = $1;
my $pad = ' ' x ($RETURN_TYPE_FIELD_WIDTH - length ("#define "));
# Align each line so that if should all line up OK.
$args =~ s/\n/\n$pad/gm;
$desc .= &CreateValidSGML ($args);
}
- $desc .= "</programlisting>\n";
+ $desc .= "</programlisting>\n";
}
$desc .= &MakeDeprecationNote($symbol);
@@ -1370,18 +1370,18 @@ sub OutputMacro {
my $parameters_output = 0;
if (defined ($SymbolDocs{$symbol})) {
- my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
- # Try to insert the parameter table at the author's desired position.
- # Otherwise we need to tag it onto the end.
- if ($symbol_docs =~ s/<!--PARAMETERS-->/$parameters/) {
- $parameters_output = 1;
- }
- $desc .= $symbol_docs;
+ # Try to insert the parameter table at the author's desired position.
+ # Otherwise we need to tag it onto the end.
+ if ($symbol_docs =~ s/<!--PARAMETERS-->/$parameters/) {
+ $parameters_output = 1;
+ }
+ $desc .= $symbol_docs;
}
if ($parameters_output == 0) {
- $desc .= $parameters;
+ $desc .= $parameters;
}
$desc .= OutputSymbolTraits ($symbol);
@@ -1394,8 +1394,8 @@ sub OutputMacro {
# Function : OutputTypedef
# Description : Returns the synopsis and detailed description of a typedef.
# Arguments : $symbol - the typedef.
-# $declaration - the declaration of the typedef,
-# e.g. 'typedef unsigned int guint;'
+# $declaration - the declaration of the typedef,
+# e.g. 'typedef unsigned int guint;'
#############################################################################
sub OutputTypedef {
@@ -1410,14 +1410,14 @@ sub OutputTypedef {
$desc .= OutputSymbolExtraLinks($symbol);
if (!defined ($DeclarationConditional{$symbol})) {
- my $decl_out = &CreateValidSGML ($declaration);
- $desc .= "<programlisting>$decl_out</programlisting>\n";
+ my $decl_out = &CreateValidSGML ($declaration);
+ $desc .= "<programlisting>$decl_out</programlisting>\n";
}
$desc .= &MakeDeprecationNote($symbol);
if (defined ($SymbolDocs{$symbol})) {
- $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
}
$desc .= OutputSymbolTraits ($symbol);
$desc .= "</refsect2>\n";
@@ -1428,12 +1428,12 @@ sub OutputTypedef {
#############################################################################
# Function : OutputStruct
# Description : Returns the synopsis and detailed description of a struct.
-# We check if it is a object struct, and if so we only output
-# parts of it that are noted as public fields.
-# We also use a different SGML ID for object structs, since the
-# original ID is used for the entire RefEntry.
+# We check if it is a object struct, and if so we only output
+# parts of it that are noted as public fields.
+# We also use a different SGML ID for object structs, since the
+# original ID is used for the entire RefEntry.
# Arguments : $symbol - the struct.
-# $declaration - the declaration of the struct.
+# $declaration - the declaration of the struct.
#############################################################################
sub OutputStruct {
@@ -1442,19 +1442,19 @@ sub OutputStruct {
my $is_object_struct = 0;
my $default_to_public = 1;
if (&CheckIsObject ($symbol)) {
- #print "Found object struct: $symbol\n";
- $is_object_struct = 1;
- $default_to_public = 0;
+ #print "Found struct gtype: $symbol\n";
+ $is_gtype = 1;
+ $default_to_public = 0;
}
my $id;
my $condition;
- if ($is_object_struct) {
- $id = &CreateValidSGMLID ($symbol . "_struct");
+ if ($is_gtype) {
+ $id = &CreateValidSGMLID ($symbol . "_struct");
$condition = &MakeConditionDescription ($symbol . "_struct");
} else {
- $id = &CreateValidSGMLID ($symbol);
- $condition = &MakeConditionDescription ($symbol);
+ $id = &CreateValidSGMLID ($symbol);
+ $condition = &MakeConditionDescription ($symbol);
}
# Determine if it is a simple struct or it also has a typedef.
@@ -1468,10 +1468,10 @@ sub OutputStruct {
if ($has_typedef) {
# For structs with typedefs we just output the struct name.
$synop = &MakeReturnField("") . "<link linkend=\"$id\">$symbol</link>;\n";
- $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>$symbol</title>\n";
+ $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>$symbol</title>\n";
} else {
$synop = &MakeReturnField("struct") . "<link linkend=\"$id\">$symbol</link>;\n";
- $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>struct $symbol</title>\n";
+ $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>struct $symbol</title>\n";
}
$desc .= MakeIndexterms($symbol, $id);
@@ -1482,58 +1482,58 @@ sub OutputStruct {
my $decl_out = "";
if ($declaration =~ m/^\s*$/) {
- #print "Found opaque struct: $symbol\n";
- $decl_out = "typedef struct _$symbol $symbol;";
+ #print "Found opaque struct: $symbol\n";
+ $decl_out = "typedef struct _$symbol $symbol;";
} elsif ($declaration =~ m/^\s*struct\s+\w+\s*;\s*$/) {
- #print "Found opaque struct: $symbol\n";
- $decl_out = "struct $symbol;";
+ #print "Found opaque struct: $symbol\n";
+ $decl_out = "struct $symbol;";
} else {
- my $public = $default_to_public;
- my $new_declaration = "";
- my $decl_line;
- my $decl = $declaration;
-
- if ($decl =~ m/^\s*(typedef\s+)?struct\s*\w*\s*(?:\/\*.*\*\/)?\s*{(.*)}\s*\w*\s*;\s*$/s) {
- my $struct_contents = $2;
-
- foreach $decl_line (split (/\n/, $struct_contents)) {
- #print "Struct line: $decl_line\n";
- if ($decl_line =~ m%/\*\s*<\s*public\s*>\s*\*/%) {
- $public = 1;
- } elsif ($decl_line =~ m%/\*\s*<\s*(private|protected)\s*>\s*\*/%) {
- $public = 0;
- } elsif ($public) {
- $new_declaration .= $decl_line . "\n";
- }
- }
-
- if ($new_declaration) {
- # Strip any blank lines off the ends.
- $new_declaration =~ s/^\s*\n//;
- $new_declaration =~ s/\n\s*$/\n/;
-
- if ($has_typedef) {
- $decl_out = "typedef struct {\n" . $new_declaration
- . "} $symbol;\n";
- } else {
- $decl_out = "struct $symbol {\n" . $new_declaration
- . "};\n";
- }
- }
- } else {
- &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
+ my $public = $default_to_public;
+ my $new_declaration = "";
+ my $decl_line;
+ my $decl = $declaration;
+
+ if ($decl =~ m/^\s*(typedef\s+)?struct\s*\w*\s*(?:\/\*.*\*\/)?\s*{(.*)}\s*\w*\s*;\s*$/s) {
+ my $struct_contents = $2;
+
+ foreach $decl_line (split (/\n/, $struct_contents)) {
+ #print "Struct line: $decl_line\n";
+ if ($decl_line =~ m%/\*\s*<\s*public\s*>\s*\*/%) {
+ $public = 1;
+ } elsif ($decl_line =~ m%/\*\s*<\s*(private|protected)\s*>\s*\*/%) {
+ $public = 0;
+ } elsif ($public) {
+ $new_declaration .= $decl_line . "\n";
+ }
+ }
+
+ if ($new_declaration) {
+ # Strip any blank lines off the ends.
+ $new_declaration =~ s/^\s*\n//;
+ $new_declaration =~ s/\n\s*$/\n/;
+
+ if ($has_typedef) {
+ $decl_out = "typedef struct {\n" . $new_declaration
+ . "} $symbol;\n";
+ } else {
+ $decl_out = "struct $symbol {\n" . $new_declaration
+ . "};\n";
+ }
+ }
+ } else {
+ &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Couldn't parse struct:\n$declaration");
- }
+ }
- # If we couldn't parse the struct or it was all private, output an
- # empty struct declaration.
- if ($decl_out eq "") {
- if ($has_typedef) {
- $decl_out = "typedef struct _$symbol $symbol;";
- } else {
- $decl_out = "struct $symbol;";
- }
- }
+ # If we couldn't parse the struct or it was all private, output an
+ # empty struct declaration.
+ if ($decl_out eq "") {
+ if ($has_typedef) {
+ $decl_out = "typedef struct _$symbol $symbol;";
+ } else {
+ $decl_out = "struct $symbol;";
+ }
+ }
}
$decl_out = &CreateValidSGML ($decl_out);
@@ -1542,7 +1542,7 @@ sub OutputStruct {
$desc .= &MakeDeprecationNote($symbol);
if (defined ($SymbolDocs{$symbol})) {
- $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
}
# Create a table of fields and descriptions
@@ -1551,10 +1551,10 @@ sub OutputStruct {
# improve the output in most situations ... except for function
# members of structs!
my @fields = ParseStructDeclaration($declaration, !$default_to_public,
- 0, \&MakeXRef,
- sub {
- "<structfield id=\"".&CreateValidSGMLID("$id.$_[0]")."\">$_[0]</structfield>";
- });
+ 0, \&MakeXRef,
+ sub {
+ "<structfield id=\"".&CreateValidSGMLID("$id.$_[0]")."\">$_[0]</structfield>";
+ });
my $params = $SymbolParams{$symbol};
# If no parameters are filled in, we don't generate the description
@@ -1562,49 +1562,49 @@ sub OutputStruct {
my $found = 0;
if (defined $params) {
- for (my $i = 1; $i <= $#$params; $i += $PARAM_FIELD_COUNT) {
- if ($params->[$i] =~ /\S/) {
- $found = 1;
- last;
- }
- }
+ for (my $i = 1; $i <= $#$params; $i += $PARAM_FIELD_COUNT) {
+ if ($params->[$i] =~ /\S/) {
+ $found = 1;
+ last;
+ }
+ }
}
if ($found) {
- my %field_descrs = @$params;
- my $missing_parameters = "";
- my $unused_parameters = "";
+ my %field_descrs = @$params;
+ my $missing_parameters = "";
+ my $unused_parameters = "";
$desc .= "<variablelist role=\"struct\">\n";
- while (@fields) {
- my $field_name = shift @fields;
- my $text = shift @fields;
- my $field_descr = $field_descrs{$field_name};
+ while (@fields) {
+ my $field_name = shift @fields;
+ my $text = shift @fields;
+ my $field_descr = $field_descrs{$field_name};
my $param_annotations = "";
- $desc .= "<varlistentry><term>$text</term>\n";
- if (defined $field_descr) {
+ $desc .= "<varlistentry><term>$text</term>\n";
+ if (defined $field_descr) {
($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
- $field_descr = &ExpandAbbreviations($symbol, $field_descr);
- $field_descr .= $param_annotations;
- # trim
- $field_descr =~ s/^(\s|\n)+//msg;
- $field_descr =~ s/(\s|\n)+$//msg;
- $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n";
- delete $field_descrs{$field_name};
- } else {
- &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
+ $field_descr = &ExpandAbbreviations($symbol, $field_descr);
+ $field_descr .= $param_annotations;
+ # trim
+ $field_descr =~ s/^(\s|\n)+//msg;
+ $field_descr =~ s/(\s|\n)+$//msg;
+ $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n";
+ delete $field_descrs{$field_name};
+ } else {
+ &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Field description for $symbol"."::"."$field_name is missing in source code comment block.");
- if ($missing_parameters ne "") {
+ if ($missing_parameters ne "") {
$missing_parameters .= ", ".$field_name;
} else {
$missing_parameters = $field_name;
}
- $desc .= "<listitem />\n";
- }
+ $desc .= "<listitem />\n";
+ }
$desc .= "</varlistentry>\n";
- }
- $desc .= "</variablelist>";
+ }
+ $desc .= "</variablelist>";
foreach my $field_name (keys %field_descrs) {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Field description for $symbol"."::"."$field_name is not used from source code comment block.");
@@ -1615,7 +1615,7 @@ sub OutputStruct {
}
}
- # remember missing/unused parameters (needed in tmpl-free build)
+ # remember missing/unused parameters (needed in tmpl-free build)
if (($missing_parameters ne "") and (! exists ($AllIncompleteSymbols{$symbol}))) {
$AllIncompleteSymbols{$symbol}=$missing_parameters;
}
@@ -1643,7 +1643,7 @@ sub OutputStruct {
# Function : OutputUnion
# Description : Returns the synopsis and detailed description of a union.
# Arguments : $symbol - the union.
-# $declaration - the declaration of the union.
+# $declaration - the declaration of the union.
#############################################################################
sub OutputUnion {
@@ -1679,7 +1679,7 @@ sub OutputUnion {
$desc .= &MakeDeprecationNote($symbol);
if (defined ($SymbolDocs{$symbol})) {
- $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
}
# Create a table of fields and descriptions
@@ -1688,10 +1688,10 @@ sub OutputUnion {
# improve the output in most situations ... except for function
# members of structs!
my @fields = ParseStructDeclaration($declaration, 0,
- 0, \&MakeXRef,
- sub {
- "<structfield id=\"".&CreateValidSGMLID("$id.$_[0]")."\">$_[0]</structfield>";
- });
+ 0, \&MakeXRef,
+ sub {
+ "<structfield id=\"".&CreateValidSGMLID("$id.$_[0]")."\">$_[0]</structfield>";
+ });
my $params = $SymbolParams{$symbol};
# If no parameters are filled in, we don't generate the description
@@ -1699,49 +1699,49 @@ sub OutputUnion {
my $found = 0;
if (defined $params) {
- for (my $i = 1; $i <= $#$params; $i += $PARAM_FIELD_COUNT) {
- if ($params->[$i] =~ /\S/) {
- $found = 1;
- last;
- }
- }
+ for (my $i = 1; $i <= $#$params; $i += $PARAM_FIELD_COUNT) {
+ if ($params->[$i] =~ /\S/) {
+ $found = 1;
+ last;
+ }
+ }
}
if ($found) {
- my %field_descrs = @$params;
- my $missing_parameters = "";
- my $unused_parameters = "";
+ my %field_descrs = @$params;
+ my $missing_parameters = "";
+ my $unused_parameters = "";
$desc .= "<variablelist role=\"union\">\n";
- while (@fields) {
- my $field_name = shift @fields;
- my $text = shift @fields;
- my $field_descr = $field_descrs{$field_name};
+ while (@fields) {
+ my $field_name = shift @fields;
+ my $text = shift @fields;
+ my $field_descr = $field_descrs{$field_name};
my $param_annotations = "";
- $desc .= "<varlistentry><term>$text</term>\n";
- if (defined $field_descr) {
+ $desc .= "<varlistentry><term>$text</term>\n";
+ if (defined $field_descr) {
($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
- $field_descr = &ExpandAbbreviations($symbol, $field_descr);
- $field_descr .= $param_annotations;
- # trim
- $field_descr =~ s/^(\s|\n)+//msg;
- $field_descr =~ s/(\s|\n)+$//msg;
- $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n";
- delete $field_descrs{$field_name};
- } else {
- &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
+ $field_descr = &ExpandAbbreviations($symbol, $field_descr);
+ $field_descr .= $param_annotations;
+ # trim
+ $field_descr =~ s/^(\s|\n)+//msg;
+ $field_descr =~ s/(\s|\n)+$//msg;
+ $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n";
+ delete $field_descrs{$field_name};
+ } else {
+ &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Field description for $symbol"."::"."$field_name is missing in source code comment block.");
if ($missing_parameters ne "") {
$missing_parameters .= ", ".$field_name;
} else {
$missing_parameters = $field_name;
}
- $desc .= "<listitem />\n";
- }
+ $desc .= "<listitem />\n";
+ }
$desc .= "</varlistentry>\n";
- }
- $desc .= "</variablelist>";
+ }
+ $desc .= "</variablelist>";
foreach my $field_name (keys %field_descrs) {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Field description for $symbol"."::"."$field_name is not used from source code comment block.");
@@ -1752,7 +1752,7 @@ sub OutputUnion {
}
}
- # remember missing/unused parameters (needed in tmpl-free build)
+ # remember missing/unused parameters (needed in tmpl-free build)
if (($missing_parameters ne "") and (! exists ($AllIncompleteSymbols{$symbol}))) {
$AllIncompleteSymbols{$symbol}=$missing_parameters;
}
@@ -1780,13 +1780,28 @@ sub OutputUnion {
# Function : OutputEnum
# Description : Returns the synopsis and detailed description of a enum.
# Arguments : $symbol - the enum.
-# $declaration - the declaration of the enum.
+# $declaration - the declaration of the enum.
#############################################################################
sub OutputEnum {
my ($symbol, $declaration) = @_;
- my $id = &CreateValidSGMLID ($symbol);
- my $condition = &MakeConditionDescription ($symbol);
+
+ my $is_gtype = 0;
+ if (&CheckIsObject ($symbol)) {
+ #print "Found enum gtype: $symbol\n";
+ $is_gtype = 1;
+ }
+
+ my $id;
+ my $condition;
+ if ($is_gtype) {
+ $id = &CreateValidSGMLID ($symbol . "_enum");
+ $condition = &MakeConditionDescription ($symbol . "_enum");
+ } else {
+ $id = &CreateValidSGMLID ($symbol);
+ $condition = &MakeConditionDescription ($symbol);
+ }
+
my $synop = &MakeReturnField("enum") . "<link linkend=\"$id\">$symbol</link>;\n";
my $desc = "<refsect2 id=\"$id\" role=\"enum\"$condition>\n<title>enum $symbol</title>\n";
@@ -1800,7 +1815,7 @@ sub OutputEnum {
$desc .= &MakeDeprecationNote($symbol);
if (defined ($SymbolDocs{$symbol})) {
- $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
}
# Create a table of fields and descriptions
@@ -1813,45 +1828,45 @@ sub OutputEnum {
my $found = 0;
if (defined $params) {
- for (my $i = 1; $i <= $#$params; $i += $PARAM_FIELD_COUNT) {
- if ($params->[$i] =~ /\S/) {
- $found = 1;
- last;
- }
- }
+ for (my $i = 1; $i <= $#$params; $i += $PARAM_FIELD_COUNT) {
+ if ($params->[$i] =~ /\S/) {
+ $found = 1;
+ last;
+ }
+ }
}
if ($found) {
- my %field_descrs = @$params;
- my $missing_parameters = "";
- my $unused_parameters = "";
+ my %field_descrs = @$params;
+ my $missing_parameters = "";
+ my $unused_parameters = "";
$desc .= "<variablelist role=\"enum\">\n";
- for my $field_name (@fields) {
- my $field_descr = $field_descrs{$field_name};
+ for my $field_name (@fields) {
+ my $field_descr = $field_descrs{$field_name};
my $param_annotations = "";
- $id = &CreateValidSGMLID ($field_name);
- $condition = &MakeConditionDescription ($field_name);
- $desc .= "<varlistentry id=\"$id\" role=\"constant\"$condition>\n<term><literal>$field_name</literal></term>\n";
- if (defined $field_descr) {
+ $id = &CreateValidSGMLID ($field_name);
+ $condition = &MakeConditionDescription ($field_name);
+ $desc .= "<varlistentry id=\"$id\" role=\"constant\"$condition>\n<term><literal>$field_name</literal></term>\n";
+ if (defined $field_descr) {
($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
$field_descr = &ExpandAbbreviations($symbol, $field_descr);
- $desc .= "<listitem><simpara>$field_descr$param_annotations</simpara></listitem>\n";
- delete $field_descrs{$field_name};
- } else {
- &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
+ $desc .= "<listitem><simpara>$field_descr$param_annotations</simpara></listitem>\n";
+ delete $field_descrs{$field_name};
+ } else {
+ &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Value description for $symbol"."::"."$field_name is missing in source code comment block.");
- if ($missing_parameters ne "") {
+ if ($missing_parameters ne "") {
$missing_parameters .= ", ".$field_name;
} else {
$missing_parameters = $field_name;
}
- $desc .= "<listitem />\n";
- }
+ $desc .= "<listitem />\n";
+ }
$desc .= "</varlistentry>\n";
- }
- $desc .= "</variablelist>";
+ }
+ $desc .= "</variablelist>";
foreach my $field_name (keys %field_descrs) {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Value description for $symbol"."::"."$field_name is not used from source code comment block.");
@@ -1862,7 +1877,7 @@ sub OutputEnum {
}
}
- # remember missing/unused parameters (needed in tmpl-free build)
+ # remember missing/unused parameters (needed in tmpl-free build)
if (($missing_parameters ne "") and (! exists ($AllIncompleteSymbols{$symbol}))) {
$AllIncompleteSymbols{$symbol}=$missing_parameters;
}
@@ -1890,7 +1905,7 @@ sub OutputEnum {
# Function : OutputVariable
# Description : Returns the synopsis and detailed description of a variable.
# Arguments : $symbol - the extern'ed variable.
-# $declaration - the declaration of the variable.
+# $declaration - the declaration of the variable.
#############################################################################
sub OutputVariable {
@@ -1900,13 +1915,13 @@ sub OutputVariable {
my $synop;
if ($declaration =~ m/^\s*extern\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)(\s*)([A-Za-z]\w*)\s*;/) {
- my $mod = defined ($1) ? $1 : "";
- my $ptr = defined ($3) ? $3 : "";
- my $space = defined ($4) ? $4 : "";
- $synop = &MakeReturnField("extern") . "$mod$ptr$space<link linkend=\"$id\">$symbol</link>;\n";
+ my $mod = defined ($1) ? $1 : "";
+ my $ptr = defined ($3) ? $3 : "";
+ my $space = defined ($4) ? $4 : "";
+ $synop = &MakeReturnField("extern") . "$mod$ptr$space<link linkend=\"$id\">$symbol</link>;\n";
} else {
- $synop = &MakeReturnField("extern") . "<link linkend=\"$id\">$symbol</link>;\n";
+ $synop = &MakeReturnField("extern") . "<link linkend=\"$id\">$symbol</link>;\n";
}
my $desc = "<refsect2 id=\"$id\" role=\"variable\"$condition>\n<title>$symbol</title>\n";
@@ -1921,7 +1936,7 @@ sub OutputVariable {
$desc .= &MakeDeprecationNote($symbol);
if (defined ($SymbolDocs{$symbol})) {
- $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
}
$desc .= OutputSymbolTraits ($symbol);
$desc .= "</refsect2>\n";
@@ -1933,7 +1948,7 @@ sub OutputVariable {
# Function : OutputFunction
# Description : Returns the synopsis and detailed description of a function.
# Arguments : $symbol - the function.
-# $declaration - the declaration of the function.
+# $declaration - the declaration of the function.
#############################################################################
sub OutputFunction {
@@ -1960,41 +1975,41 @@ sub OutputFunction {
$pointer =~ s/^\s+/ /g;
my $ret_type_len = length ($start) + length ($type_modifier)+ length ($type)
- + length ($pointer);
+ + length ($pointer);
my $ret_type_output;
my $symbol_len;
if ($ret_type_len < $RETURN_TYPE_FIELD_WIDTH) {
- $ret_type_output = "$start$type_modifier$xref$pointer"
- . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));
- $symbol_len = 0;
+ $ret_type_output = "$start$type_modifier$xref$pointer"
+ . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));
+ $symbol_len = 0;
} else {
#$ret_type_output = "$start$type_modifier$xref$pointer\n" . (' ' x $RETURN_TYPE_FIELD_WIDTH);
- $ret_type_output = "$start$type_modifier$xref$pointer ";
- $symbol_len = $ret_type_len + 1 - $RETURN_TYPE_FIELD_WIDTH;
+ $ret_type_output = "$start$type_modifier$xref$pointer ";
+ $symbol_len = $ret_type_len + 1 - $RETURN_TYPE_FIELD_WIDTH;
}
# TRACE@("$symbol ret type output: [$ret_type_output], $ret_type_len");
$symbol_len += length ($symbol);
my $char1 = my $char2 = my $char3 = "";
if ($symbol_type eq 'USER_FUNCTION') {
- $symbol_len += 3;
- $char1 = "(";
- $char2 = "*";
- $char3 = ")";
+ $symbol_len += 3;
+ $char1 = "(";
+ $char2 = "*";
+ $char3 = ")";
}
my ($symbol_output, $symbol_desc_output);
if ($symbol_len < $SYMBOL_FIELD_WIDTH) {
- $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3"
- . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
- $symbol_desc_output = "$char1$char2$symbol$char3"
- . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
+ $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3"
+ . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
+ $symbol_desc_output = "$char1$char2$symbol$char3"
+ . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
} else {
- $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3\n"
- . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
- $symbol_desc_output = "$char1$char2$symbol$char3\n"
- . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
+ $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3\n"
+ . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
+ $symbol_desc_output = "$char1$char2$symbol$char3\n"
+ . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
}
my $synop = $ret_type_output . $symbol_output . '(';
@@ -2007,9 +2022,9 @@ sub OutputFunction {
$desc .= "<programlisting>${ret_type_output}$symbol_desc_output(";
my @fields = ParseFunctionDeclaration($declaration, \&MakeXRef,
- sub {
- &tagify($_[0],"parameter");
- });
+ sub {
+ &tagify($_[0],"parameter");
+ });
for (my $i = 1; $i <= $#fields; $i += 2) {
my $field_name = $fields[$i];
@@ -2041,20 +2056,20 @@ sub OutputFunction {
my $parameters_output = 0;
if (defined ($SymbolDocs{$symbol})) {
- my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
-
- # Try to insert the parameter table at the author's desired position.
- # Otherwise we need to tag it onto the end.
- # FIXME: document that in the user manual and make it useable for other
- # types too
- if ($symbol_docs =~ s/<!--PARAMETERS-->/$parameters/) {
- $parameters_output = 1;
- }
- $desc .= $symbol_docs;
+ my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+
+ # Try to insert the parameter table at the author's desired position.
+ # Otherwise we need to tag it onto the end.
+ # FIXME: document that in the user manual and make it useable for other
+ # types too
+ if ($symbol_docs =~ s/<!--PARAMETERS-->/$parameters/) {
+ $parameters_output = 1;
+ }
+ $desc .= $symbol_docs;
}
if ($parameters_output == 0) {
- $desc .= $parameters;
+ $desc .= $parameters;
}
$desc .= OutputSymbolTraits ($symbol);
@@ -2066,10 +2081,10 @@ sub OutputFunction {
#############################################################################
# Function : OutputParamDescriptions
# Description : Returns the DocBook output describing the parameters of a
-# function, macro or signal handler.
+# function, macro or signal handler.
# Arguments : $symbol_type - 'FUNCTION', 'MACRO' or 'SIGNAL'. Signal
-# handlers have an implicit user_data parameter last.
-# $symbol - the name of the function/macro being described.
+# handlers have an implicit user_data parameter last.
+# $symbol - the name of the function/macro being described.
# @fields - parsed fields from the declaration, used to determine
# undocumented/unused entries
#############################################################################
@@ -2088,16 +2103,16 @@ sub OutputParamDescriptions {
}
if (defined $params) {
- my $returns = "";
- my $params_desc = "";
- my $missing_parameters = "";
- my $unused_parameters = "";
- my $j;
-
- for ($j = 0; $j <= $#$params; $j += $PARAM_FIELD_COUNT) {
- my $param_name = $$params[$j];
- my $param_desc = $$params[$j + 1];
- my $param_annotations = "";
+ my $returns = "";
+ my $params_desc = "";
+ my $missing_parameters = "";
+ my $unused_parameters = "";
+ my $j;
+
+ for ($j = 0; $j <= $#$params; $j += $PARAM_FIELD_COUNT) {
+ my $param_name = $$params[$j];
+ my $param_desc = $$params[$j + 1];
+ my $param_annotations = "";
($param_desc,$param_annotations) = & ExpandAnnotation($symbol, $param_desc);
$param_desc = &ExpandAbbreviations($symbol, $param_desc);
@@ -2105,12 +2120,12 @@ sub OutputParamDescriptions {
# trim
$param_desc =~ s/^(\s|\n)+//msg;
$param_desc =~ s/(\s|\n)+$//msg;
- if ($param_name eq "Returns") {
- $returns = "$param_desc";
- } elsif ($param_name eq "void") {
- #print "!!!! void in params for $symbol?\n";
- } else {
- if (@fields) {
+ if ($param_name eq "Returns") {
+ $returns = "$param_desc";
+ } elsif ($param_name eq "void") {
+ #print "!!!! void in params for $symbol?\n";
+ } else {
+ if (@fields) {
if (!defined $field_descrs{$param_name}) {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Parameter description for $symbol"."::"."$param_name is not used from source code comment block.");
@@ -2123,15 +2138,15 @@ sub OutputParamDescriptions {
delete $field_descrs{$param_name};
}
}
- if ($param_name eq "Varargs") {
- $param_name = "...";
- }
- if($param_desc ne "") {
- $params_desc .= "<varlistentry><term><parameter>$param_name</parameter> :</term>\n<listitem><simpara>$param_desc</simpara></listitem></varlistentry>\n";
- $num_params++;
- }
+ if ($param_name eq "Varargs") {
+ $param_name = "...";
+ }
+ if($param_desc ne "") {
+ $params_desc .= "<varlistentry><term><parameter>$param_name</parameter> :</term>\n<listitem><simpara>$param_desc</simpara></listitem></varlistentry>\n";
+ $num_params++;
+ }
}
- }
+ }
foreach my $param_name (keys %field_descrs) {
&LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Parameter description for $symbol"."::"."$param_name is missing in source code comment block.");
@@ -2142,29 +2157,29 @@ sub OutputParamDescriptions {
}
}
- # Signals have an implicit user_data parameter which we describe.
- if ($symbol_type eq "SIGNAL") {
- $params_desc .= "<varlistentry><term><parameter>user_data</parameter> :</term>\n<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>\n";
- }
-
- # Start a table if we need one.
- if ($params_desc || $returns) {
- $output .= "<variablelist role=\"params\">\n";
- if ($params_desc ne "") {
- #$output .= "<varlistentry><term>Parameters:</term><listitem></listitem></varlistentry>\n";
- $output .= $params_desc;
- }
-
- # Output the returns info last
- if ($returns) {
- $output .= "<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>$returns</simpara></listitem></varlistentry>\n";
- }
-
- # Finish the table.
- $output .= "</variablelist>";
- }
-
- # remember missing/unused parameters (needed in tmpl-free build)
+ # Signals have an implicit user_data parameter which we describe.
+ if ($symbol_type eq "SIGNAL") {
+ $params_desc .= "<varlistentry><term><parameter>user_data</parameter> :</term>\n<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>\n";
+ }
+
+ # Start a table if we need one.
+ if ($params_desc || $returns) {
+ $output .= "<variablelist role=\"params\">\n";
+ if ($params_desc ne "") {
+ #$output .= "<varlistentry><term>Parameters:</term><listitem></listitem></varlistentry>\n";
+ $output .= $params_desc;
+ }
+
+ # Output the returns info last
+ if ($returns) {
+ $output .= "<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>$returns</simpara></listitem></varlistentry>\n";
+ }
+
+ # Finish the table.
+ $output .= "</variablelist>";
+ }
+
+ # remember missing/unused parameters (needed in tmpl-free build)
if (($missing_parameters ne "") and (! exists ($AllIncompleteSymbols{$symbol}))) {
$AllIncompleteSymbols{$symbol}=$missing_parameters;
}
@@ -2187,8 +2202,8 @@ sub OutputParamDescriptions {
# Description : Parses a stability level and outputs a warning if it isn't
# valid.
# Arguments : $stability - the stability text.
-# $file, $line - context for error message
-# $message - description of where the level is from, to use in
+# $file, $line - context for error message
+# $message - description of where the level is from, to use in
# any error message.
# Returns : The parsed stability level string.
#############################################################################
@@ -2216,13 +2231,13 @@ sub ParseStabilityLevel {
# Function : OutputSGMLFile
# Description : Outputs the final DocBook file for one section.
# Arguments : $file - the name of the file.
-# $title - the title from the $MODULE-sections.txt file, which
-# will be overridden by the title in the template file.
-# $section_id - the SGML id to use for the toplevel tag.
-# $includes - comma-separates list of include files added at top
-# of synopsis, with '<' '>' around them (if not already enclosed in "").
-# $synopsis - reference to the DocBook for the Synopsis part.
-# $details - reference to the DocBook for the Details part.
+# $title - the title from the $MODULE-sections.txt file, which
+# will be overridden by the title in the template file.
+# $section_id - the SGML id to use for the toplevel tag.
+# $includes - comma-separates list of include files added at top
+# of synopsis, with '<' '>' around them (if not already enclosed in "").
+# $synopsis - reference to the DocBook for the Synopsis part.
+# $details - reference to the DocBook for the Details part.
# $signal_synop - reference to the DocBook for the Signal Synopsis part
# $signal_desc - reference to the DocBook for the Signal Description part
# $args_synop - reference to the DocBook for the Arg Synopsis part
@@ -2243,46 +2258,46 @@ sub OutputSGMLFile {
# The edited title overrides the one from the sections file.
my $new_title = $SymbolDocs{"$TMPL_DIR/$file:Title"};
if (defined ($new_title) && $new_title !~ m/^\s*$/) {
- $title = $new_title;
- #print "Found title: $title\n";
+ $title = $new_title;
+ #print "Found title: $title\n";
}
my $short_desc = $SymbolDocs{"$TMPL_DIR/$file:Short_Description"};
if (!defined ($short_desc) || $short_desc =~ m/^\s*$/) {
- $short_desc = "";
+ $short_desc = "";
} else {
- $short_desc = &ExpandAbbreviations("$title:Short_description",
- $short_desc);
- #print "Found short_desc: $short_desc";
+ $short_desc = &ExpandAbbreviations("$title:Short_description",
+ $short_desc);
+ #print "Found short_desc: $short_desc";
}
my $long_desc = $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
if (!defined ($long_desc) || $long_desc =~ m/^\s*$/) {
- $long_desc = "";
+ $long_desc = "";
} else {
- $long_desc = &ExpandAbbreviations("$title:Long_description",
- $long_desc);
- #print "Found long_desc: $long_desc";
+ $long_desc = &ExpandAbbreviations("$title:Long_description",
+ $long_desc);
+ #print "Found long_desc: $long_desc";
}
my $see_also = $SymbolDocs{"$TMPL_DIR/$file:See_Also"};
if (!defined ($see_also) || $see_also =~ m%^\s*(<para>)?\s*(</para>)?\s*$%) {
- $see_also = "";
+ $see_also = "";
} else {
- $see_also = &ExpandAbbreviations("$title:See_Also", $see_also);
- #print "Found see_also: $see_also";
+ $see_also = &ExpandAbbreviations("$title:See_Also", $see_also);
+ #print "Found see_also: $see_also";
}
if ($see_also) {
- $see_also = "<refsect1 id=\"$section_id.see-also\">\n<title>See Also</title>\n$see_also\n</refsect1>\n";
+ $see_also = "<refsect1 id=\"$section_id.see-also\">\n<title>See Also</title>\n$see_also\n</refsect1>\n";
}
my $stability = $SymbolDocs{"$TMPL_DIR/$file:Stability_Level"};
if (!defined ($stability) || $stability =~ m/^\s*$/) {
- $stability = "";
+ $stability = "";
} else {
$stability = &ParseStabilityLevel($stability, $file, $., "Section stability level");
#print "Found stability: $stability";
}
if ($stability) {
- $stability = "<refsect1 id=\"$section_id.stability-level\">\n<title>Stability Level</title>\n$stability, unless otherwise indicated\n</refsect1>\n";
+ $stability = "<refsect1 id=\"$section_id.stability-level\">\n<title>Stability Level</title>\n$stability, unless otherwise indicated\n</refsect1>\n";
} elsif ($DEFAULT_STABILITY) {
- $stability = "<refsect1 id=\"$section_id.stability-level\">\n<title>Stability Level</title>\n$DEFAULT_STABILITY, unless otherwise indicated\n</refsect1>\n";
+ $stability = "<refsect1 id=\"$section_id.stability-level\">\n<title>Stability Level</title>\n$DEFAULT_STABILITY, unless otherwise indicated\n</refsect1>\n";
}
my $image = $SymbolDocs{"$TMPL_DIR/$file:Image"};
@@ -2308,7 +2323,7 @@ sub OutputSGMLFile {
}
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
- gmtime (time);
+ gmtime (time);
my $month = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$mon];
$year += 1900;
@@ -2319,7 +2334,7 @@ sub OutputSGMLFile {
$include_output .= "#include ${include}\n";
}
else {
- $include =~ s/^\s+|\s+$//gs;
+ $include =~ s/^\s+|\s+$//gs;
$include_output .= "#include <${include}>\n";
}
}
@@ -2333,14 +2348,14 @@ sub OutputSGMLFile {
my $new_sgml_file = "$SGML_OUTPUT_DIR/$file.$OUTPUT_FORMAT.new";
open (OUTPUT, ">$new_sgml_file")
- || die "Can't create $new_sgml_file: $!";
+ || die "Can't create $new_sgml_file: $!";
my $object_anchors = "";
foreach my $object (@$file_objects) {
- next if ($object eq $section_id);
- my $id = CreateValidSGMLID($object);
+ next if ($object eq $section_id);
+ my $id = CreateValidSGMLID($object);
#print "Debug: Adding anchor for $object\n";
- $object_anchors .= "<anchor id=\"$id\"$empty_element_end";
+ $object_anchors .= "<anchor id=\"$id\"$empty_element_end";
}
# We used to output this, but is messes up our UpdateFileIfChanged code
@@ -2409,12 +2424,12 @@ sub OutputExtraFile {
open(EXTRA_FILE, "<$file") || die "Can't open $file";
{
- local $/;
- $contents = <EXTRA_FILE>;
+ local $/;
+ $contents = <EXTRA_FILE>;
}
open (OUTPUT, ">$new_sgml_file")
- || die "Can't create $new_sgml_file: $!";
+ || die "Can't create $new_sgml_file: $!";
print OUTPUT &ExpandAbbreviations ("$basename file", $contents);
close (OUTPUT);
@@ -2424,11 +2439,11 @@ sub OutputExtraFile {
#############################################################################
# Function : OutputBook
# Description : Outputs the SGML entities that need to be included into the
-# main SGML file for the module.
+# main SGML file for the module.
# Arguments : $book_top - the declarations of the entities, which are added
-# at the top of the main SGML file.
-# $book_bottom - the references to the entities, which are
-# added in the main SGML file at the desired position.
+# at the top of the main SGML file.
+# $book_bottom - the references to the entities, which are
+# added in the main SGML file at the desired position.
#############################################################################
sub OutputBook {
@@ -2438,7 +2453,7 @@ sub OutputBook {
my $new_file = "$SGML_OUTPUT_DIR/$MODULE-doc.top.new";
open (OUTPUT, ">$new_file")
- || die "Can't create $new_file: $!";
+ || die "Can't create $new_file: $!";
print OUTPUT $book_top;
close (OUTPUT);
@@ -2449,7 +2464,7 @@ sub OutputBook {
$new_file = "$SGML_OUTPUT_DIR/$MODULE-doc.bottom.new";
open (OUTPUT, ">$new_file")
- || die "Can't create $new_file: $!";
+ || die "Can't create $new_file: $!";
print OUTPUT $book_bottom;
close (OUTPUT);
@@ -2460,10 +2475,10 @@ sub OutputBook {
# The user can tweak it later.
if ($MAIN_SGML_FILE && ! -e $MAIN_SGML_FILE) {
open (OUTPUT, ">$MAIN_SGML_FILE")
- || die "Can't create $MAIN_SGML_FILE: $!";
+ || die "Can't create $MAIN_SGML_FILE: $!";
if ($OUTPUT_FORMAT eq "xml") {
- print OUTPUT <<EOF;
+ print OUTPUT <<EOF;
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
@@ -2473,7 +2488,7 @@ sub OutputBook {
<book id="index">
EOF
} else {
- print OUTPUT <<EOF;
+ print OUTPUT <<EOF;
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
$book_top
]>
@@ -2527,13 +2542,13 @@ EOF
#############################################################################
# Function : CreateValidSGML
# Description : This turns any chars which are used in SGML into entities,
-# e.g. '<' into '<'
+# e.g. '<' into '<'
# Arguments : $text - the text to turn into proper SGML.
#############################################################################
sub CreateValidSGML {
my ($text) = @_;
- $text =~ s/&/&/g; # Do this first, or the others get messed up.
+ $text =~ s/&/&/g; # Do this first, or the others get messed up.
$text =~ s/</</g;
$text =~ s/>/>/g;
# browers render single tabs inconsistently
@@ -2557,15 +2572,15 @@ sub ConvertSGMLChars {
if ($INLINE_MARKUP_MODE) {
# For the XML/SGML mode only convert to entities outside CDATA sections.
return &ModifyXMLElements ($text, $symbol,
- "<!\\[CDATA\\[|<programlisting[^>]*>",
- \&ConvertSGMLCharsEndTag,
- \&ConvertSGMLCharsCallback);
+ "<!\\[CDATA\\[|<programlisting[^>]*>",
+ \&ConvertSGMLCharsEndTag,
+ \&ConvertSGMLCharsCallback);
} else {
# For the simple non-sgml mode, convert to entities everywhere.
- $text =~ s/&/&/g; # Do this first, or the others get messed up.
- $text =~ s/</</g;
- $text =~ s/>/>/g;
- return $text;
+ $text =~ s/&/&/g; # Do this first, or the others get messed up.
+ $text =~ s/</</g;
+ $text =~ s/>/>/g;
+ return $text;
}
}
@@ -2584,12 +2599,12 @@ sub ConvertSGMLCharsCallback {
if ($tag =~ m/^<programlisting/) {
# We can handle <programlisting> specially here.
return &ModifyXMLElements ($text, $symbol,
- "<!\\[CDATA\\[",
- \&ConvertSGMLCharsEndTag,
- \&ConvertSGMLCharsCallback2);
+ "<!\\[CDATA\\[",
+ \&ConvertSGMLCharsEndTag,
+ \&ConvertSGMLCharsCallback2);
} elsif ($tag eq "") {
# If we're not in CDATA convert to entities.
- $text =~ s/&(?![a-zA-Z#]+;)/&/g; # Do this first, or the others get messed up.
+ $text =~ s/&(?![a-zA-Z#]+;)/&/g; # Do this first, or the others get messed up.
$text =~ s/<(?![a-zA-Z\/!])/</g;
$text =~ s/(?<![a-zA-Z0-9"'\/-])>/>/g;
@@ -2607,7 +2622,7 @@ sub ConvertSGMLCharsCallback2 {
# We could handle <programlisting> differently, though I'm not sure it helps.
if ($tag eq "") {
# replace only if its not a tag
- $text =~ s/&(?![a-zA-Z#]+;)/&/g; # Do this first, or the others get messed up.
+ $text =~ s/&(?![a-zA-Z#]+;)/&/g; # Do this first, or the others get messed up.
$text =~ s/<(?![a-zA-Z\/!])/</g;
$text =~ s/(?<![a-zA-Z0-9"'\/-])>/>/g;
@@ -2622,7 +2637,7 @@ sub ConvertSGMLCharsCallback2 {
# Function : ExpandAnnotation
# Description : This turns annotations into acronym tags.
# Arguments : $symbol - the symbol being documented, for error messages.
-# $text - the text to expand.
+# $text - the text to expand.
#############################################################################
sub ExpandAnnotation {
my ($symbol, $param_desc) = @_;
@@ -2675,10 +2690,10 @@ sub ExpandAnnotation {
#############################################################################
# Function : ExpandAbbreviations
# Description : This turns the abbreviations function(), macro(), @param,
-# %constant, and #symbol into appropriate DocBook markup.
+# %constant, and #symbol into appropriate DocBook markup.
# CDATA sections and <programlisting> parts are skipped.
# Arguments : $symbol - the symbol being documented, for error messages.
-# $text - the text to expand.
+# $text - the text to expand.
#############################################################################
sub ExpandAbbreviations {
@@ -2694,9 +2709,9 @@ sub ExpandAbbreviations {
# keep CDATA unmodified, preserve ulink tags (ideally we preseve all tags
# as such)
return &ModifyXMLElements ($text, $symbol,
- "<!\\[CDATA\\[|<ulink[^>]*>|<programlisting[^>]*>|<!DOCTYPE",
- \&ExpandAbbreviationsEndTag,
- \&ExpandAbbreviationsCallback);
+ "<!\\[CDATA\\[|<ulink[^>]*>|<programlisting[^>]*>|<!DOCTYPE",
+ \&ExpandAbbreviationsEndTag,
+ \&ExpandAbbreviationsCallback);
}
@@ -2720,9 +2735,9 @@ sub ExpandAbbreviationsCallback {
if ($tag =~ m/^<programlisting/) {
# Handle any embedded CDATA sections.
return &ModifyXMLElements ($text, $symbol,
- "<!\\[CDATA\\[",
- \&ExpandAbbreviationsEndTag,
- \&ExpandAbbreviationsCallback2);
+ "<!\\[CDATA\\[",
+ \&ExpandAbbreviationsEndTag,
+ \&ExpandAbbreviationsCallback2);
} elsif ($tag eq "") {
# We are outside any CDATA or <programlisting> sections, so we expand
# any gtk-doc abbreviations.
@@ -2848,18 +2863,18 @@ sub ModifyXMLElements {
$end_tag_regexp = &$end_tag_func ($start_tag);
if ($text =~ m/$end_tag_regexp/s) {
- $before_tag = $`;
- $end_tag = $&;
- $text = $';
+ $before_tag = $`;
+ $end_tag = $&;
+ $text = $';
- $result .= &$callback ($before_tag, $symbol, $start_tag);
- $result .= $end_tag;
+ $result .= &$callback ($before_tag, $symbol, $start_tag);
+ $result .= $end_tag;
} else {
- &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
+ &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Can't find tag end: $end_tag_regexp in docs for: $symbol.");
- # Just assume it is all inside the tag.
- $result .= &$callback ($text, $symbol, $start_tag);
- $text = "";
+ # Just assume it is all inside the tag.
+ $result .= &$callback ($text, $symbol, $start_tag);
+ $text = "";
}
}
@@ -2884,8 +2899,8 @@ sub tagify {
#############################################################################
# Function : MakeXRef
# Description : This returns a cross-reference link to the given symbol.
-# Though it doesn't try to do this for a few standard C types
-# that it knows won't be in the documentation.
+# Though it doesn't try to do this for a few standard C types
+# that it knows won't be in the documentation.
# Arguments : $symbol - the symbol to try to create a XRef to.
# $text - text text to put inside the XRef, defaults to $symbol
#############################################################################
@@ -2897,7 +2912,7 @@ sub MakeXRef {
$symbol =~ s/\s+$//;
if (!defined($text)) {
- $text = $symbol;
+ $text = $symbol;
# Get rid of special '-struct' suffix.
$text =~ s/-struct$//;
@@ -2966,22 +2981,22 @@ sub MakeDeprecationNote {
my $desc = "";
my $note = "";
if (exists $Deprecated{$symbol}) {
- $desc .= "<warning>";
+ $desc .= "<warning>";
- if ($Deprecated{$symbol} =~ /^\s*([0-9\.]+)\s*:/) {
- $desc .= "<para><literal>$symbol</literal> has been deprecated since version $1 and should not be used in newly-written code.";
+ if ($Deprecated{$symbol} =~ /^\s*([0-9\.]+)\s*:/) {
+ $desc .= "<para><literal>$symbol</literal> has been deprecated since version $1 and should not be used in newly-written code.";
} else {
- $desc .= "<para><literal>$symbol</literal> is deprecated and should not be used in newly-written code.";
- }
- if ($Deprecated{$symbol} ne "") {
- $note = &ExpandAbbreviations($symbol, $Deprecated{$symbol});
- $note =~ s/^\s*([0-9\.]+)\s*:\s*//;
- $note =~ s/^\s+//;
- $note =~ s/\s+$//;
- $note =~ s%\n{2,}%\n</para>\n<para>\n%g;
- $desc .= " " . $note;
- }
- $desc .= "</para></warning>\n";
+ $desc .= "<para><literal>$symbol</literal> is deprecated and should not be used in newly-written code.";
+ }
+ if ($Deprecated{$symbol} ne "") {
+ $note = &ExpandAbbreviations($symbol, $Deprecated{$symbol});
+ $note =~ s/^\s*([0-9\.]+)\s*:\s*//;
+ $note =~ s/^\s+//;
+ $note =~ s/\s+$//;
+ $note =~ s%\n{2,}%\n</para>\n<para>\n%g;
+ $desc .= " " . $note;
+ }
+ $desc .= "</para></warning>\n";
}
return $desc;
}
@@ -2997,31 +3012,31 @@ sub MakeConditionDescription {
my $desc = "";
if (exists $Deprecated{$symbol}) {
- if ($desc ne "") {
+ if ($desc ne "") {
$desc .= "|";
}
- if ($Deprecated{$symbol} =~ /^\s*(.*?)\s*$/) {
- $desc .= "deprecated:$1";
+ if ($Deprecated{$symbol} =~ /^\s*(.*?)\s*$/) {
+ $desc .= "deprecated:$1";
} else {
- $desc .= "deprecated";
- }
+ $desc .= "deprecated";
+ }
}
if (exists $Since{$symbol}) {
- if ($desc ne "") {
+ if ($desc ne "") {
$desc .= "|";
}
- if ($Since{$symbol} =~ /^\s*(.*?)\s*$/) {
- $desc .= "since:$1";
+ if ($Since{$symbol} =~ /^\s*(.*?)\s*$/) {
+ $desc .= "since:$1";
} else {
- $desc .= "since";
- }
+ $desc .= "since";
+ }
}
if (exists $StabilityLevel{$symbol}) {
- if ($desc ne "") {
+ if ($desc ne "") {
$desc .= "|";
}
$desc .= "stability:".$StabilityLevel{$symbol};
@@ -3052,22 +3067,22 @@ sub GetHierarchy {
my $level;
my $j;
for ($i = 0; $i < @Objects; $i++) {
- if ($found) {
- if ($ObjectLevels[$i] <= $level) {
- last;
- }
- elsif ($ObjectLevels[$i] == $level + 1) {
- push (@children, $Objects[$i]);
- }
- }
- elsif ($Objects[$i] eq $object) {
- $found = 1;
- $j = $i;
- $level = $ObjectLevels[$i];
- }
+ if ($found) {
+ if ($ObjectLevels[$i] <= $level) {
+ last;
+ }
+ elsif ($ObjectLevels[$i] == $level + 1) {
+ push (@children, $Objects[$i]);
+ }
+ }
+ elsif ($Objects[$i] eq $object) {
+ $found = 1;
+ $j = $i;
+ $level = $ObjectLevels[$i];
+ }
}
if (!$found) {
- return "";
+ return "";
}
# Walk up the hierarchy, pushing ancestors onto the ancestors array.
@@ -3075,33 +3090,33 @@ sub GetHierarchy {
push (@ancestors, $object);
#print "Level: $level\n";
while ($level > 1) {
- $j--;
- if ($ObjectLevels[$j] < $level) {
- push (@ancestors, $Objects[$j]);
- $level = $ObjectLevels[$j];
- #print "Level: $level\n";
- }
+ $j--;
+ if ($ObjectLevels[$j] < $level) {
+ push (@ancestors, $Objects[$j]);
+ $level = $ObjectLevels[$j];
+ #print "Level: $level\n";
+ }
}
# Output the ancestors list, indented and with links.
my $hierarchy = "<synopsis>\n";
$level = 0;
for ($i = $#ancestors; $i >= 0; $i--) {
- my $link_text;
- # Don't add a link to the current object, i.e. when i == 0.
- if ($i > 0) {
- my $ancestor_id = &CreateValidSGMLID ($ancestors[$i]);
- $link_text = "<link linkend=\"$ancestor_id\">$ancestors[$i]</link>";
- } else {
- $link_text = "$ancestors[$i]";
- }
- if ($level == 0) {
- $hierarchy .= " $link_text\n";
- } else {
-# $hierarchy .= ' ' x ($level * 6 - 3) . "|\n";
- $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n";
- }
- $level++;
+ my $link_text;
+ # Don't add a link to the current object, i.e. when i == 0.
+ if ($i > 0) {
+ my $ancestor_id = &CreateValidSGMLID ($ancestors[$i]);
+ $link_text = "<link linkend=\"$ancestor_id\">$ancestors[$i]</link>";
+ } else {
+ $link_text = "$ancestors[$i]";
+ }
+ if ($level == 0) {
+ $hierarchy .= " $link_text\n";
+ } else {
+# $hierarchy .= ' ' x ($level * 6 - 3) . "|\n";
+ $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n";
+ }
+ $level++;
}
for ($i = 0; $i <= $#children; $i++) {
my $id = &CreateValidSGMLID ($children[$i]);
@@ -3129,24 +3144,24 @@ sub GetInterfaces {
# Find object in the objects array.
if (exists($Interfaces{$object})) {
my @ifaces = split(' ', $Interfaces{$object});
- $text = <<EOF;
+ $text = <<EOF;
<para>
$object implements
EOF
- for ($i = 0; $i <= $#ifaces; $i++) {
- my $id = &CreateValidSGMLID ($ifaces[$i]);
- $text .= " <link linkend=\"$id\">$ifaces[$i]</link>";
- if ($i < $#ifaces - 1) {
- $text .= ', ';
- }
- elsif ($i < $#ifaces) {
- $text .= ' and ';
- }
- else {
- $text .= '.';
- }
- }
- $text .= <<EOF;
+ for ($i = 0; $i <= $#ifaces; $i++) {
+ my $id = &CreateValidSGMLID ($ifaces[$i]);
+ $text .= " <link linkend=\"$id\">$ifaces[$i]</link>";
+ if ($i < $#ifaces - 1) {
+ $text .= ', ';
+ }
+ elsif ($i < $#ifaces) {
+ $text .= ' and ';
+ }
+ else {
+ $text .= '.';
+ }
+ }
+ $text .= <<EOF;
</para>
EOF
}
@@ -3167,30 +3182,30 @@ sub GetImplementations {
my $text = "";
my $i;
foreach my $key (keys %Interfaces) {
- if ($Interfaces{$key} =~ /\b$object\b/) {
- push (@impls, $key);
- }
+ if ($Interfaces{$key} =~ /\b$object\b/) {
+ push (@impls, $key);
+ }
}
if ($#impls >= 0) {
- @impls = sort @impls;
- $text = <<EOF;
+ @impls = sort @impls;
+ $text = <<EOF;
<para>
$object is implemented by
EOF
for ($i = 0; $i <= $#impls; $i++) {
- my $id = &CreateValidSGMLID ($impls[$i]);
- $text .= " <link linkend=\"$id\">$impls[$i]</link>";
- if ($i < $#impls - 1) {
- $text .= ', ';
- }
- elsif ($i < $#impls) {
- $text .= ' and ';
- }
- else {
- $text .= '.';
- }
- }
- $text .= <<EOF;
+ my $id = &CreateValidSGMLID ($impls[$i]);
+ $text .= " <link linkend=\"$id\">$impls[$i]</link>";
+ if ($i < $#impls - 1) {
+ $text .= ', ';
+ }
+ elsif ($i < $#impls) {
+ $text .= ' and ';
+ }
+ else {
+ $text .= '.';
+ }
+ }
+ $text .= <<EOF;
</para>
EOF
}
@@ -3211,25 +3226,25 @@ sub GetPrerequisites {
my $i;
if (exists($Prerequisites{$iface})) {
- $text = <<EOF;
+ $text = <<EOF;
<para>
$iface requires
EOF
- my @prereqs = split(' ', $Prerequisites{$iface});
- for ($i = 0; $i <= $#prereqs; $i++) {
- my $id = &CreateValidSGMLID ($prereqs[$i]);
- $text .= " <link linkend=\"$id\">$prereqs[$i]</link>";
- if ($i < $#prereqs - 1) {
- $text .= ', ';
- }
- elsif ($i < $#prereqs) {
- $text .= ' and ';
- }
- else {
- $text .= '.';
- }
- }
- $text .= <<EOF;
+ my @prereqs = split(' ', $Prerequisites{$iface});
+ for ($i = 0; $i <= $#prereqs; $i++) {
+ my $id = &CreateValidSGMLID ($prereqs[$i]);
+ $text .= " <link linkend=\"$id\">$prereqs[$i]</link>";
+ if ($i < $#prereqs - 1) {
+ $text .= ', ';
+ }
+ elsif ($i < $#prereqs) {
+ $text .= ' and ';
+ }
+ else {
+ $text .= '.';
+ }
+ }
+ $text .= <<EOF;
</para>
EOF
}
@@ -3250,30 +3265,30 @@ sub GetDerived {
my @derived = ();
foreach my $key (keys %Prerequisites) {
- if ($Prerequisites{$key} =~ /\b$iface\b/) {
- push (@derived, $key);
- }
+ if ($Prerequisites{$key} =~ /\b$iface\b/) {
+ push (@derived, $key);
+ }
}
if ($#derived >= 0) {
- @derived = sort @derived;
- $text = <<EOF;
+ @derived = sort @derived;
+ $text = <<EOF;
<para>
$iface is required by
EOF
- for ($i = 0; $i <= $#derived; $i++) {
- my $id = &CreateValidSGMLID ($derived[$i]);
- $text .= " <link linkend=\"$id\">$derived[$i]</link>";
- if ($i < $#derived - 1) {
- $text .= ', ';
- }
- elsif ($i < $#derived) {
- $text .= ' and ';
- }
- else {
- $text .= '.';
- }
- }
- $text .= <<EOF;
+ for ($i = 0; $i <= $#derived; $i++) {
+ my $id = &CreateValidSGMLID ($derived[$i]);
+ $text .= " <link linkend=\"$id\">$derived[$i]</link>";
+ if ($i < $#derived - 1) {
+ $text .= ', ';
+ }
+ elsif ($i < $#derived) {
+ $text .= ' and ';
+ }
+ else {
+ $text .= '.';
+ }
+ }
+ $text .= <<EOF;
</para>
EOF
}
@@ -3284,7 +3299,7 @@ EOF
#############################################################################
# Function : GetSignals
# Description : Returns the synopsis and detailed description DocBook output
-# for the signal handlers of a given GtkObject subclass.
+# for the signal handlers of a given GtkObject subclass.
# Arguments : $object - the GtkObject subclass, e.g. 'GtkButton'.
#############################################################################
@@ -3295,83 +3310,83 @@ sub GetSignals {
my $i;
for ($i = 0; $i <= $#SignalObjects; $i++) {
- if ($SignalObjects[$i] eq $object) {
- #print "Found signal: $SignalNames[$i]\n";
- my $name = $SignalNames[$i];
- my $symbol = "${object}::${name}";
- my $id = &CreateValidSGMLID ("$object-$name");
-
- my $pad = ' ' x (46 - length($name));
- $synop .= " "<link linkend=\"$id\">$name</link>"$pad ";
-
- $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>"$name"</literal> signal</title>\n";
- $desc .= MakeIndexterms($symbol, $id);
- $desc .= "\n";
- $desc .= OutputSymbolExtraLinks($symbol);
-
- $desc .= "<programlisting>";
-
- $SignalReturns[$i] =~ m/\s*(const\s+)?(\w+)\s*(\**)/;
- my $type_modifier = defined($1) ? $1 : "";
- my $type = $2;
- my $pointer = $3;
- my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
-
- my $ret_type_len = length ($type_modifier) + length ($pointer)
- + length ($type);
- my $ret_type_output = "$type_modifier$xref$pointer"
- . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));
-
- $desc .= "${ret_type_output}user_function " . &MakeReturnField("") . " (";
-
- my $sourceparams = $SourceSymbolParams{$symbol};
- my @params = split ("\n", $SignalPrototypes[$i]);
- my $j;
- my $l;
+ if ($SignalObjects[$i] eq $object) {
+ #print "Found signal: $SignalNames[$i]\n";
+ my $name = $SignalNames[$i];
+ my $symbol = "${object}::${name}";
+ my $id = &CreateValidSGMLID ("$object-$name");
+
+ my $pad = ' ' x (46 - length($name));
+ $synop .= " "<link linkend=\"$id\">$name</link>"$pad ";
+
+ $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>"$name"</literal> signal</title>\n";
+ $desc .= MakeIndexterms($symbol, $id);
+ $desc .= "\n";
+ $desc .= OutputSymbolExtraLinks($symbol);
+
+ $desc .= "<programlisting>";
+
+ $SignalReturns[$i] =~ m/\s*(const\s+)?(\w+)\s*(\**)/;
+ my $type_modifier = defined($1) ? $1 : "";
+ my $type = $2;
+ my $pointer = $3;
+ my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
+
+ my $ret_type_len = length ($type_modifier) + length ($pointer)
+ + length ($type);
+ my $ret_type_output = "$type_modifier$xref$pointer"
+ . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));
+
+ $desc .= "${ret_type_output}user_function " . &MakeReturnField("") . " (";
+
+ my $sourceparams = $SourceSymbolParams{$symbol};
+ my @params = split ("\n", $SignalPrototypes[$i]);
+ my $j;
+ my $l;
my $type_len = length("gpointer");
my $name_len = length("user_data");
# do two passes, the first one is to calculate padding
- for ($l = 0; $l < 2; $l++) {
- for ($j = 0; $j <= $#params; $j++) {
- # allow alphanumerics, '_', '[' & ']' in param names
- if ($params[$j] =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)\s*$/) {
- $type = $1;
- $pointer = $2;
- if (defined($sourceparams)) {
- $name = $$sourceparams[$PARAM_FIELD_COUNT * $j];
- }
- else {
- $name = $3;
- }
- if (!defined($name)) {
- $name = "arg$j";
- }
+ for ($l = 0; $l < 2; $l++) {
+ for ($j = 0; $j <= $#params; $j++) {
+ # allow alphanumerics, '_', '[' & ']' in param names
+ if ($params[$j] =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)\s*$/) {
+ $type = $1;
+ $pointer = $2;
+ if (defined($sourceparams)) {
+ $name = $$sourceparams[$PARAM_FIELD_COUNT * $j];
+ }
+ else {
+ $name = $3;
+ }
+ if (!defined($name)) {
+ $name = "arg$j";
+ }
if ($l == 0) {
- if (length($type) + length($pointer) > $type_len) {
+ if (length($type) + length($pointer) > $type_len) {
$type_len = length($type) + length($pointer);
- }
- if (length($name) > $name_len) {
+ }
+ if (length($name) > $name_len) {
$name_len = length($name);
- }
+ }
}
else {
- $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));
- }
- } else {
- &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
+ $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));
+ }
+ } else {
+ &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
"Can't parse arg: $params[$j]\nArgs:$SignalPrototypes[$i]");
- }
- }
- }
- $xref = &MakeXRef ("gpointer", &tagify("gpointer", "type"));
- $pad = ' ' x ($type_len - length("gpointer"));
- $desc .= "$xref$pad user_data)";
+ }
+ }
+ }
+ $xref = &MakeXRef ("gpointer", &tagify("gpointer", "type"));
+ $pad = ' ' x ($type_len - length("gpointer"));
+ $desc .= "$xref$pad user_data)";
- my $flags = $SignalFlags[$i];
- my $flags_string = "";
+ my $flags = $SignalFlags[$i];
+ my $flags_string = "";
if (defined ($flags)) {
if ($flags =~ m/f/) {
@@ -3402,46 +3417,46 @@ sub GetSignals {
}
}
- if ($flags_string)
- {
- $synop .= ": $flags_string\n";
-
- $pad = ' ' x (5 + $name_len - length("user_data"));
- $desc .= "$pad : $flags_string</programlisting>\n";
- }
- else
- {
- $synop .= "\n";
- $desc .= "</programlisting>\n";
- }
-
- $desc .= &MakeDeprecationNote($symbol);
-
- my $parameters = &OutputParamDescriptions ("SIGNAL", $symbol);
- my $parameters_output = 0;
-
- $AllSymbols{$symbol} = 1;
- if (defined ($SymbolDocs{$symbol})) {
- my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
-
- # Try to insert the parameter table at the author's desired
- # position. Otherwise we need to tag it onto the end.
- if ($symbol_docs =~ s/<!--PARAMETERS-->/$parameters/) {
- $parameters_output = 1;
- }
- $desc .= $symbol_docs;
-
- if (!IsEmptyDoc($SymbolDocs{$symbol})) {
- $AllDocumentedSymbols{$symbol} = 1;
- }
- }
-
- if ($parameters_output == 0) {
- $desc .= $parameters;
- }
- $desc .= OutputSymbolTraits ($symbol);
- $desc .= "</refsect2>";
- }
+ if ($flags_string)
+ {
+ $synop .= ": $flags_string\n";
+
+ $pad = ' ' x (5 + $name_len - length("user_data"));
+ $desc .= "$pad : $flags_string</programlisting>\n";
+ }
+ else
+ {
+ $synop .= "\n";
+ $desc .= "</programlisting>\n";
+ }
+
+ $desc .= &MakeDeprecationNote($symbol);
+
+ my $parameters = &OutputParamDescriptions ("SIGNAL", $symbol);
+ my $parameters_output = 0;
+
+ $AllSymbols{$symbol} = 1;
+ if (defined ($SymbolDocs{$symbol})) {
+ my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+
+ # Try to insert the parameter table at the author's desired
+ # position. Otherwise we need to tag it onto the end.
+ if ($symbol_docs =~ s/<!--PARAMETERS-->/$parameters/) {
+ $parameters_output = 1;
+ }
+ $desc .= $symbol_docs;
+
+ if (!IsEmptyDoc($SymbolDocs{$symbol})) {
+ $AllDocumentedSymbols{$symbol} = 1;
+ }
+ }
+
+ if ($parameters_output == 0) {
+ $desc .= $parameters;
+ }
+ $desc .= OutputSymbolTraits ($symbol);
+ $desc .= "</refsect2>";
+ }
}
return ($synop, $desc);
}
@@ -3450,7 +3465,7 @@ sub GetSignals {
#############################################################################
# Function : GetArgs
# Description : Returns the synopsis and detailed description DocBook output
-# for the Args of a given GtkObject subclass.
+# for the Args of a given GtkObject subclass.
# Arguments : $object - the GtkObject subclass, e.g. 'GtkButton'.
#############################################################################
@@ -3465,119 +3480,119 @@ sub GetArgs {
my $i;
for ($i = 0; $i <= $#ArgObjects; $i++) {
- if ($ArgObjects[$i] eq $object) {
- #print "Found arg: $ArgNames[$i]\n";
- my $name = $ArgNames[$i];
- my $flags = $ArgFlags[$i];
- my $flags_string = "";
- my $kind = "";
- my $id_sep = "";
-
- if ($flags =~ m/c/) {
- $kind = "child property";
- $id_sep = "c-";
- }
- elsif ($flags =~ m/s/) {
- $kind = "style property";
- $id_sep = "s-";
- }
- else {
- $kind = "property";
- }
-
- # Remember only one colon so we don't clash with signals.
- my $symbol = "${object}:${name}";
- # use two dashes and ev. an extra separator here for the same reason.
- my $id = &CreateValidSGMLID ("$object--$id_sep$name");
-
- my $type = $ArgTypes[$i];
- my $type_output;
- my $range = $ArgRanges[$i];
- my $range_output = CreateValidSGML ($range);
- my $default = $ArgDefaults[$i];
- my $default_output = CreateValidSGML ($default);
-
- if ($type eq "GtkString") {
- $type = "char*";
- }
- if ($type eq "GtkSignal") {
- $type = "GtkSignalFunc, gpointer";
- $type_output = &MakeXRef ("GtkSignalFunc") . ", "
- . &MakeXRef ("gpointer");
- } elsif ($type =~ m/^(\w+)\*$/) {
- $type_output = &MakeXRef ($1, &tagify($1, "type")) . "*";
- } else {
- $type_output = &MakeXRef ($type, &tagify($type, "type"));
- }
-
- if ($flags =~ m/r/) {
- $flags_string = "Read";
- }
- if ($flags =~ m/w/) {
- if ($flags_string) { $flags_string .= " / "; }
- $flags_string .= "Write";
- }
- if ($flags =~ m/x/) {
- if ($flags_string) { $flags_string .= " / "; }
- $flags_string .= "Construct";
- }
- if ($flags =~ m/X/) {
- if ($flags_string) { $flags_string .= " / "; }
- $flags_string .= "Construct Only";
- }
-
- $AllSymbols{$symbol} = 1;
- my $blurb;
- if (defined($SymbolDocs{$symbol}) &&
- !IsEmptyDoc($SymbolDocs{$symbol})) {
- $blurb = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
+ if ($ArgObjects[$i] eq $object) {
+ #print "Found arg: $ArgNames[$i]\n";
+ my $name = $ArgNames[$i];
+ my $flags = $ArgFlags[$i];
+ my $flags_string = "";
+ my $kind = "";
+ my $id_sep = "";
+
+ if ($flags =~ m/c/) {
+ $kind = "child property";
+ $id_sep = "c-";
+ }
+ elsif ($flags =~ m/s/) {
+ $kind = "style property";
+ $id_sep = "s-";
+ }
+ else {
+ $kind = "property";
+ }
+
+ # Remember only one colon so we don't clash with signals.
+ my $symbol = "${object}:${name}";
+ # use two dashes and ev. an extra separator here for the same reason.
+ my $id = &CreateValidSGMLID ("$object--$id_sep$name");
+
+ my $type = $ArgTypes[$i];
+ my $type_output;
+ my $range = $ArgRanges[$i];
+ my $range_output = CreateValidSGML ($range);
+ my $default = $ArgDefaults[$i];
+ my $default_output = CreateValidSGML ($default);
+
+ if ($type eq "GtkString") {
+ $type = "char*";
+ }
+ if ($type eq "GtkSignal") {
+ $type = "GtkSignalFunc, gpointer";
+ $type_output = &MakeXRef ("GtkSignalFunc") . ", "
+ . &MakeXRef ("gpointer");
+ } elsif ($type =~ m/^(\w+)\*$/) {
+ $type_output = &MakeXRef ($1, &tagify($1, "type")) . "*";
+ } else {
+ $type_output = &MakeXRef ($type, &tagify($type, "type"));
+ }
+
+ if ($flags =~ m/r/) {
+ $flags_string = "Read";
+ }
+ if ($flags =~ m/w/) {
+ if ($flags_string) { $flags_string .= " / "; }
+ $flags_string .= "Write";
+ }
+ if ($flags =~ m/x/) {
+ if ($flags_string) { $flags_string .= " / "; }
+ $flags_string .= "Construct";
+ }
+ if ($flags =~ m/X/) {
+ if ($flags_string) { $flags_string .= " / "; }
+ $flags_string .= "Construct Only";
+ }
+
+ $AllSymbols{$symbol} = 1;
+ my $blurb;
+ if (defined($SymbolDocs{$symbol}) &&
+ !IsEmptyDoc($SymbolDocs{$symbol})) {
+ $blurb = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});
#print ".. [$SymbolDocs{$symbol}][$blurb]\n";
- $AllDocumentedSymbols{$symbol} = 1;
- }
- else {
- if (!($ArgBlurbs[$i] eq "")) {
- $AllDocumentedSymbols{$symbol} = 1;
- } else {
+ $AllDocumentedSymbols{$symbol} = 1;
+ }
+ else {
+ if (!($ArgBlurbs[$i] eq "")) {
+ $AllDocumentedSymbols{$symbol} = 1;
+ } else {
# FIXME: print a warning?
#print ".. no description\n";
}
- $blurb = "<para>" . &CreateValidSGML ($ArgBlurbs[$i]) . "</para>";
- }
-
- my $pad1 = " " x (24 - length ($name));
- my $pad2 = " " x (20 - length ($type));
-
- my $arg_synop = " "<link linkend=\"$id\">$name</link>"$pad1 $type_output $pad2 : $flags_string\n";
- my $arg_desc = "<refsect2 id=\"$id\" role=\"property\"><title>The <literal>"$name"</literal> $kind</title>\n";
- $arg_desc .= MakeIndexterms($symbol, $id);
- $arg_desc .= "\n";
- $arg_desc .= OutputSymbolExtraLinks($symbol);
-
- $arg_desc .= "<programlisting> "$name"$pad1 $type_output $pad2 : $flags_string</programlisting>\n";
- $arg_desc .= &MakeDeprecationNote($symbol);
- $arg_desc .= $blurb;
- if ($range ne "") {
- $arg_desc .= "<para>Allowed values: $range_output</para>\n";
- }
- if ($default ne "") {
- $arg_desc .= "<para>Default value: $default_output</para>\n";
- }
- $arg_desc .= OutputSymbolTraits ($symbol);
- $arg_desc .= "</refsect2>\n";
-
- if ($flags =~ m/c/) {
- $child_synop .= $arg_synop;
- $child_desc .= $arg_desc;
- }
- elsif ($flags =~ m/s/) {
- $style_synop .= $arg_synop;
- $style_desc .= $arg_desc;
- }
- else {
- $synop .= $arg_synop;
- $desc .= $arg_desc;
- }
- }
+ $blurb = "<para>" . &CreateValidSGML ($ArgBlurbs[$i]) . "</para>";
+ }
+
+ my $pad1 = " " x (24 - length ($name));
+ my $pad2 = " " x (20 - length ($type));
+
+ my $arg_synop = " "<link linkend=\"$id\">$name</link>"$pad1 $type_output $pad2 : $flags_string\n";
+ my $arg_desc = "<refsect2 id=\"$id\" role=\"property\"><title>The <literal>"$name"</literal> $kind</title>\n";
+ $arg_desc .= MakeIndexterms($symbol, $id);
+ $arg_desc .= "\n";
+ $arg_desc .= OutputSymbolExtraLinks($symbol);
+
+ $arg_desc .= "<programlisting> "$name"$pad1 $type_output $pad2 : $flags_string</programlisting>\n";
+ $arg_desc .= &MakeDeprecationNote($symbol);
+ $arg_desc .= $blurb;
+ if ($range ne "") {
+ $arg_desc .= "<para>Allowed values: $range_output</para>\n";
+ }
+ if ($default ne "") {
+ $arg_desc .= "<para>Default value: $default_output</para>\n";
+ }
+ $arg_desc .= OutputSymbolTraits ($symbol);
+ $arg_desc .= "</refsect2>\n";
+
+ if ($flags =~ m/c/) {
+ $child_synop .= $arg_synop;
+ $child_desc .= $arg_desc;
+ }
+ elsif ($flags =~ m/s/) {
+ $style_synop .= $arg_synop;
+ $style_desc .= $arg_desc;
+ }
+ else {
+ $synop .= $arg_synop;
+ $desc .= $arg_desc;
+ }
+ }
}
return ($synop, $child_synop, $style_synop, $desc, $child_desc, $style_desc);
}
@@ -3586,15 +3601,15 @@ sub GetArgs {
#############################################################################
# Function : ReadSourceDocumentation
# Description : This reads in the documentation embedded in comment blocks
-# in the source code (for Gnome).
+# in the source code (for Gnome).
#
-# Parameter descriptions override any in the template files.
-# Function descriptions are placed before any description from
-# the template files.
+# Parameter descriptions override any in the template files.
+# Function descriptions are placed before any description from
+# the template files.
#
-# It recursively descends the source directory looking for .c
-# files and scans them looking for specially-formatted comment
-# blocks.
+# It recursively descends the source directory looking for .c
+# files and scans them looking for specially-formatted comment
+# blocks.
#
# Arguments : $source_dir - the directory to scan.
#############m###############################################################
@@ -3620,28 +3635,28 @@ sub ReadSourceDocumentation {
@suffix_list = split (/,/, $SOURCE_SUFFIXES);
opendir (SRCDIR, $source_dir)
- || die "Can't open source directory $source_dir: $!";
+ || die "Can't open source directory $source_dir: $!";
foreach $file (readdir (SRCDIR)) {
if ($file =~ /^\./) {
- next;
+ next;
} elsif (-d "$source_dir/$file") {
- push (@subdirs, $file);
+ push (@subdirs, $file);
} elsif (@suffix_list) {
- foreach $suffix (@suffix_list) {
- if ($file =~ m/\.\Q${suffix}\E$/) {
- &ScanSourceFile ("$source_dir/$file");
- }
- }
+ foreach $suffix (@suffix_list) {
+ if ($file =~ m/\.\Q${suffix}\E$/) {
+ &ScanSourceFile ("$source_dir/$file");
+ }
+ }
} elsif ($file =~ m/\.[ch]$/) {
- &ScanSourceFile ("$source_dir/$file");
+ &ScanSourceFile ("$source_dir/$file");
}
}
closedir (SRCDIR);
# Now recursively scan the subdirectories.
foreach $dir (@subdirs) {
- &ReadSourceDocumentation ("$source_dir/$dir");
+ &ReadSourceDocumentation ("$source_dir/$dir");
}
}
@@ -3649,9 +3664,9 @@ sub ReadSourceDocumentation {
#############################################################################
# Function : ScanSourceFile
# Description : Scans one source file looking for specially-formatted comment
-# blocks. Later &MergeSourceDocumentation is used to merge any
-# documentation found with the documentation already read in
-# from the template files.
+# blocks. Later &MergeSourceDocumentation is used to merge any
+# documentation found with the documentation already read in
+# from the template files.
#
# Arguments : $file - the file to scan.
#############################################################################
@@ -3670,10 +3685,10 @@ sub ScanSourceFile {
}
if ($file =~ m/^.*[\/\\]([^\/\\]*)$/) {
- $basename = $1;
+ $basename = $1;
} else {
- &LogWarning ($file, 1, "Can't find basename for this filename.");
- $basename = $file;
+ &LogWarning ($file, 1, "Can't find basename for this filename.");
+ $basename = $file;
}
# Check if the basename is in the list of files to ignore.
@@ -3685,7 +3700,7 @@ sub ScanSourceFile {
@TRACE@("Scanning source file: $file");
open (SRCFILE, $file)
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
my $in_comment_block = 0;
my $symbol;
my ($in_description, $in_return, $in_since, $in_stability, $in_deprecated);
@@ -3695,55 +3710,55 @@ sub ScanSourceFile {
my $ignore_broken_returns;
my @params;
while (<SRCFILE>) {
- # Look for the start of a comment block.
- if (!$in_comment_block) {
- if (m%^\s*/\*.*\*/%) {
- #one-line comment - not gtkdoc
- } elsif (m%^\s*/\*\*\s%) {
- #print "Found comment block start\n";
-
- $in_comment_block = 1;
-
- # Reset all the symbol data.
- $symbol = "";
- $in_description = 0;
- $in_return = 0;
- $in_since = 0;
- $in_deprecated = 0;
- $in_stability = 0;
- $description = "";
- $return_desc = "";
- $return_style = "";
- $since_desc = "";
- $deprecated_desc = "";
- $stability_desc = "";
- $current_param = -1;
- $ignore_broken_returns = 0;
- @params = ();
- }
- next;
- }
-
- # We're in a comment block. Check if we've found the end of it.
- if (m%^\s*\*+/%) {
- if (!$symbol) {
- # maybe its not even meant to be a gtk-doc comment?
- &LogWarning ($file, $., "Symbol name not found at the start of the comment block.");
- } else {
- # Add the return value description onto the end of the params.
- if ($return_desc) {
- push (@params, "Returns");
- push (@params, $return_desc);
- if ($return_style eq 'broken') {
- &LogWarning ($file, $., "Free-form return value description in $symbol. Use `Returns:' to avoid ambiguities.");
- }
- }
+ # Look for the start of a comment block.
+ if (!$in_comment_block) {
+ if (m%^\s*/\*.*\*/%) {
+ #one-line comment - not gtkdoc
+ } elsif (m%^\s*/\*\*\s%) {
+ #print "Found comment block start\n";
+
+ $in_comment_block = 1;
+
+ # Reset all the symbol data.
+ $symbol = "";
+ $in_description = 0;
+ $in_return = 0;
+ $in_since = 0;
+ $in_deprecated = 0;
+ $in_stability = 0;
+ $description = "";
+ $return_desc = "";
+ $return_style = "";
+ $since_desc = "";
+ $deprecated_desc = "";
+ $stability_desc = "";
+ $current_param = -1;
+ $ignore_broken_returns = 0;
+ @params = ();
+ }
+ next;
+ }
+
+ # We're in a comment block. Check if we've found the end of it.
+ if (m%^\s*\*+/%) {
+ if (!$symbol) {
+ # maybe its not even meant to be a gtk-doc comment?
+ &LogWarning ($file, $., "Symbol name not found at the start of the comment block.");
+ } else {
+ # Add the return value description onto the end of the params.
+ if ($return_desc) {
+ push (@params, "Returns");
+ push (@params, $return_desc);
+ if ($return_style eq 'broken') {
+ &LogWarning ($file, $., "Free-form return value description in $symbol. Use `Returns:' to avoid ambiguities.");
+ }
+ }
# Convert special SGML characters
$description = &ConvertSGMLChars ($symbol, $description);
my $k;
for ($k = 1; $k <= $#params; $k += $PARAM_FIELD_COUNT) {
- $params[$k] = &ConvertSGMLChars ($symbol, $params[$k]);
- }
+ $params[$k] = &ConvertSGMLChars ($symbol, $params[$k]);
+ }
# Handle Section docs
if ($symbol =~ m/SECTION:\s*(.*)/) {
@@ -3799,7 +3814,7 @@ sub ScanSourceFile {
$SourceSymbolSourceLine{$symbol} = $.;
}
- if ($since_desc) {
+ if ($since_desc) {
($since_desc, my @extra_lines) = split ("\n", $since_desc);
$since_desc =~ s/^\s+//;
$since_desc =~ s/\s+$//;
@@ -3808,17 +3823,17 @@ sub ScanSourceFile {
if(scalar @extra_lines) {
&LogWarning ($file, $., "multi-line since docs found");
}
- }
+ }
- if ($stability_desc) {
- $stability_desc = &ParseStabilityLevel($stability_desc, $file, $., "Stability level for $symbol");
- $StabilityLevel{$symbol} = &ConvertSGMLChars ($symbol, $stability_desc);
- }
+ if ($stability_desc) {
+ $stability_desc = &ParseStabilityLevel($stability_desc, $file, $., "Stability level for $symbol");
+ $StabilityLevel{$symbol} = &ConvertSGMLChars ($symbol, $stability_desc);
+ }
- if ($deprecated_desc) {
- if (exists $Deprecated{$symbol}) {
- }
- else {
+ if ($deprecated_desc) {
+ if (exists $Deprecated{$symbol}) {
+ }
+ else {
# don't warn for signals and properties
#if ($symbol !~ m/::?(.*)/) {
if (defined $DeclarationTypes{$symbol}) {
@@ -3826,252 +3841,252 @@ sub ScanSourceFile {
"$symbol is deprecated in the inline comments, but no deprecation guards were found around the declaration.".
" (See the --deprecated-guards option for gtkdoc-scan.)");
}
- }
- $Deprecated{$symbol} = &ConvertSGMLChars ($symbol, $deprecated_desc);
- }
- }
-
- $in_comment_block = 0;
- next;
- }
-
- # Get rid of ' * ' at start of every line in the comment block.
- s%^\s*\*\s?%%;
- # But make sure we don't get rid of the newline at the end.
- if (!$_) {
- $_ = "\n";
- }
- #print "DEBUG: scanning :$_";
-
- # If we haven't found the symbol name yet, look for it.
- if (!$symbol) {
- if (m%^\s*(SECTION:\s*\S+)%) {
- $symbol = $1;
- #print "SECTION DOCS found in source for : '$symbol'\n";
- $ignore_broken_returns = 1;
- } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([a-z ]+\)\s*)*$%) {
- $symbol = $1;
- #print "SYMBOL DOCS found in source for : '$symbol'\n";
- }
- next;
- }
-
- # If we're in the return value description, add it to the end.
- if ($in_return) {
- # If we find another valid returns line, we assume that the first
- # one was really part of the description.
- if (m/^\s*(returns:|return\s+value:)/i) {
- if ($return_style eq 'broken') {
- $description .= $return_start . $return_desc;
- }
- $return_start = $1;
- if ($return_style eq 'sane') {
- &LogWarning ($file, $., "Multiple Returns for $symbol.");
- }
- $return_style = 'sane';
- $ignore_broken_returns = 1;
- $return_desc = $';
- } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
- $description .= $return_start . $return_desc;
- $return_start = $1;
- $return_style = 'broken';
- $return_desc = $';
- } elsif (m%^\s*since:%i) {
- $since_desc = $';
- $in_since = 1;
- $in_return = 0;
- } elsif (m%^\s*stability:%i) {
- $stability_desc = $';
- $in_stability = 1;
- $in_return = 0;
- } elsif (m%^\s*deprecated:%i) {
- $deprecated_desc = $';
- $in_deprecated = 1;
- $in_return = 0;
- } else {
- $return_desc .= $_;
- }
- next;
- }
-
- if ($in_since) {
- if (m/^\s*(returns:|return\s+value:)/i) {
- if ($return_style eq 'broken') {
- $description .= $return_start . $return_desc;
- }
- $return_start = $1;
- if ($return_style eq 'sane') {
- &LogWarning ($file, $., "Multiple Returns for $symbol.");
- }
- $return_style = 'sane';
- $ignore_broken_returns = 1;
- $return_desc = $';
- $in_return = 1;
- $in_since = 0;
- } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
- $return_start = $1;
- $return_style = 'broken';
- $return_desc = $';
- $in_return = 1;
- $in_since = 0;
- } elsif (m%^\s*deprecated:%i) {
- $deprecated_desc = $';
- $in_deprecated = 1;
- $in_since = 0;
- } elsif (m%^\s*stability:%i) {
- $stability_desc = $';
- $in_stability = 1;
- $in_since = 0;
- } else {
- $since_desc .= $_;
- }
- next;
- }
-
- if ($in_stability) {
- if (m/^\s*(returns:|return\s+value:)/i) {
- if ($return_style eq 'broken') {
- $description .= $return_start . $return_desc;
- }
- $return_start = $1;
- if ($return_style eq 'sane') {
- &LogWarning ($file, $., "Multiple Returns for $symbol.");
- }
- $return_style = 'sane';
- $ignore_broken_returns = 1;
- $return_desc = $';
- $in_return = 1;
- $in_stability = 0;
- } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
- $return_start = $1;
- $return_style = 'broken';
- $return_desc = $';
- $in_return = 1;
- $in_stability = 0;
- } elsif (m%^\s*deprecated:%i) {
- $deprecated_desc = $';
- $in_deprecated = 1;
- $in_stability = 0;
- } elsif (m%^\s*since:%i) {
- $since_desc = $';
- $in_since = 1;
- $in_stability = 0;
- } else {
- $stability_desc .= $_;
- }
- next;
- }
-
- if ($in_deprecated) {
- if (m/^\s*(returns:|return\s+value:)/i) {
- if ($return_style eq 'broken') {
- $description .= $return_start . $return_desc;
- }
- $return_start = $1;
- if ($return_style eq 'sane') {
- &LogWarning ($file, $., "Multiple Returns for $symbol.");
- }
- $return_style = 'sane';
- $ignore_broken_returns = 1;
- $return_desc = $';
- $in_return = 1;
- $in_deprecated = 0;
- } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
- $return_start = $1;
- $return_style = 'broken';
- $return_desc = $';
- $in_return = 1;
- $in_deprecated = 0;
- } elsif (m%^\s*since:%i) {
- $since_desc = $';
- $in_since = 1;
- $in_deprecated = 0;
- } elsif (m%^\s*stability:%i) {
- $stability_desc = $';
- $in_stability = 1;
- $in_deprecated = 0;
- } else {
- $deprecated_desc .= $_;
- }
- next;
- }
-
- # If we're in the description part, check for the 'Returns:' line.
- # If that isn't found, add the text to the end.
- if ($in_description) {
- # Get rid of 'Description:'
- s%^\s*Description:%%;
-
- if (m/^\s*(returns:|return\s+value:)/i) {
- if ($return_style eq 'broken') {
- $description .= $return_start . $return_desc;
- }
- $return_start = $1;
- if ($return_style eq 'sane') {
- &LogWarning ($file, $., "Multiple Returns for $symbol.");
- }
- $return_style = 'sane';
- $ignore_broken_returns = 1;
- $return_desc = $';
- $in_return = 1;
- next;
- } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
- $return_start = $1;
- $return_style = 'broken';
- $return_desc = $';
- $in_return = 1;
- next;
- } elsif (m%^\s*since:%i) {
- $since_desc = $';
- $in_since = 1;
- next;
- } elsif (m%^\s*deprecated:%i) {
- $deprecated_desc = $';
- $in_deprecated = 1;
- next;
- } elsif (m%^\s*stability:%i) {
- $stability_desc = $';
- $in_stability = 1;
- next;
- }
-
- $description .= $_;
- next;
- }
-
- # We must be in the parameters. Check for the empty line below them.
- if (m%^\s*$%) {
- $in_description = 1;
- next;
- }
-
- # Look for a parameter name.
- if (m%^\s*@(\S+)\s*:\s*%) {
- my $param_name = $1;
- my $param_desc = $';
-
- #print "Found parameter: $param_name\n";
- # Allow '...' as the Varargs parameter.
- if ($param_name eq "...") {
- $param_name = "Varargs";
- }
- if ("\L$param_name" eq "returns") {
- $return_style = 'sane';
- $ignore_broken_returns = 1;
- }
- push (@params, $param_name);
- push (@params, $param_desc);
- $current_param += $PARAM_FIELD_COUNT;
- next;
- }
-
- # We must be in the middle of a parameter description, so add it on
- # to the last element in @params.
- if ($current_param == -1) {
- &LogWarning ($file, $., "Parsing comment block file : parameter expected.");
- } else {
- $params[$#params] .= $_;
- }
+ }
+ $Deprecated{$symbol} = &ConvertSGMLChars ($symbol, $deprecated_desc);
+ }
+ }
+
+ $in_comment_block = 0;
+ next;
+ }
+
+ # Get rid of ' * ' at start of every line in the comment block.
+ s%^\s*\*\s?%%;
+ # But make sure we don't get rid of the newline at the end.
+ if (!$_) {
+ $_ = "\n";
+ }
+ #print "DEBUG: scanning :$_";
+
+ # If we haven't found the symbol name yet, look for it.
+ if (!$symbol) {
+ if (m%^\s*(SECTION:\s*\S+)%) {
+ $symbol = $1;
+ #print "SECTION DOCS found in source for : '$symbol'\n";
+ $ignore_broken_returns = 1;
+ } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([a-z ]+\)\s*)*$%) {
+ $symbol = $1;
+ #print "SYMBOL DOCS found in source for : '$symbol'\n";
+ }
+ next;
+ }
+
+ # If we're in the return value description, add it to the end.
+ if ($in_return) {
+ # If we find another valid returns line, we assume that the first
+ # one was really part of the description.
+ if (m/^\s*(returns:|return\s+value:)/i) {
+ if ($return_style eq 'broken') {
+ $description .= $return_start . $return_desc;
+ }
+ $return_start = $1;
+ if ($return_style eq 'sane') {
+ &LogWarning ($file, $., "Multiple Returns for $symbol.");
+ }
+ $return_style = 'sane';
+ $ignore_broken_returns = 1;
+ $return_desc = $';
+ } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
+ $description .= $return_start . $return_desc;
+ $return_start = $1;
+ $return_style = 'broken';
+ $return_desc = $';
+ } elsif (m%^\s*since:%i) {
+ $since_desc = $';
+ $in_since = 1;
+ $in_return = 0;
+ } elsif (m%^\s*stability:%i) {
+ $stability_desc = $';
+ $in_stability = 1;
+ $in_return = 0;
+ } elsif (m%^\s*deprecated:%i) {
+ $deprecated_desc = $';
+ $in_deprecated = 1;
+ $in_return = 0;
+ } else {
+ $return_desc .= $_;
+ }
+ next;
+ }
+
+ if ($in_since) {
+ if (m/^\s*(returns:|return\s+value:)/i) {
+ if ($return_style eq 'broken') {
+ $description .= $return_start . $return_desc;
+ }
+ $return_start = $1;
+ if ($return_style eq 'sane') {
+ &LogWarning ($file, $., "Multiple Returns for $symbol.");
+ }
+ $return_style = 'sane';
+ $ignore_broken_returns = 1;
+ $return_desc = $';
+ $in_return = 1;
+ $in_since = 0;
+ } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
+ $return_start = $1;
+ $return_style = 'broken';
+ $return_desc = $';
+ $in_return = 1;
+ $in_since = 0;
+ } elsif (m%^\s*deprecated:%i) {
+ $deprecated_desc = $';
+ $in_deprecated = 1;
+ $in_since = 0;
+ } elsif (m%^\s*stability:%i) {
+ $stability_desc = $';
+ $in_stability = 1;
+ $in_since = 0;
+ } else {
+ $since_desc .= $_;
+ }
+ next;
+ }
+
+ if ($in_stability) {
+ if (m/^\s*(returns:|return\s+value:)/i) {
+ if ($return_style eq 'broken') {
+ $description .= $return_start . $return_desc;
+ }
+ $return_start = $1;
+ if ($return_style eq 'sane') {
+ &LogWarning ($file, $., "Multiple Returns for $symbol.");
+ }
+ $return_style = 'sane';
+ $ignore_broken_returns = 1;
+ $return_desc = $';
+ $in_return = 1;
+ $in_stability = 0;
+ } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
+ $return_start = $1;
+ $return_style = 'broken';
+ $return_desc = $';
+ $in_return = 1;
+ $in_stability = 0;
+ } elsif (m%^\s*deprecated:%i) {
+ $deprecated_desc = $';
+ $in_deprecated = 1;
+ $in_stability = 0;
+ } elsif (m%^\s*since:%i) {
+ $since_desc = $';
+ $in_since = 1;
+ $in_stability = 0;
+ } else {
+ $stability_desc .= $_;
+ }
+ next;
+ }
+
+ if ($in_deprecated) {
+ if (m/^\s*(returns:|return\s+value:)/i) {
+ if ($return_style eq 'broken') {
+ $description .= $return_start . $return_desc;
+ }
+ $return_start = $1;
+ if ($return_style eq 'sane') {
+ &LogWarning ($file, $., "Multiple Returns for $symbol.");
+ }
+ $return_style = 'sane';
+ $ignore_broken_returns = 1;
+ $return_desc = $';
+ $in_return = 1;
+ $in_deprecated = 0;
+ } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
+ $return_start = $1;
+ $return_style = 'broken';
+ $return_desc = $';
+ $in_return = 1;
+ $in_deprecated = 0;
+ } elsif (m%^\s*since:%i) {
+ $since_desc = $';
+ $in_since = 1;
+ $in_deprecated = 0;
+ } elsif (m%^\s*stability:%i) {
+ $stability_desc = $';
+ $in_stability = 1;
+ $in_deprecated = 0;
+ } else {
+ $deprecated_desc .= $_;
+ }
+ next;
+ }
+
+ # If we're in the description part, check for the 'Returns:' line.
+ # If that isn't found, add the text to the end.
+ if ($in_description) {
+ # Get rid of 'Description:'
+ s%^\s*Description:%%;
+
+ if (m/^\s*(returns:|return\s+value:)/i) {
+ if ($return_style eq 'broken') {
+ $description .= $return_start . $return_desc;
+ }
+ $return_start = $1;
+ if ($return_style eq 'sane') {
+ &LogWarning ($file, $., "Multiple Returns for $symbol.");
+ }
+ $return_style = 'sane';
+ $ignore_broken_returns = 1;
+ $return_desc = $';
+ $in_return = 1;
+ next;
+ } elsif (!$ignore_broken_returns && m/^\s*(returns\b\s*)/i) {
+ $return_start = $1;
+ $return_style = 'broken';
+ $return_desc = $';
+ $in_return = 1;
+ next;
+ } elsif (m%^\s*since:%i) {
+ $since_desc = $';
+ $in_since = 1;
+ next;
+ } elsif (m%^\s*deprecated:%i) {
+ $deprecated_desc = $';
+ $in_deprecated = 1;
+ next;
+ } elsif (m%^\s*stability:%i) {
+ $stability_desc = $';
+ $in_stability = 1;
+ next;
+ }
+
+ $description .= $_;
+ next;
+ }
+
+ # We must be in the parameters. Check for the empty line below them.
+ if (m%^\s*$%) {
+ $in_description = 1;
+ next;
+ }
+
+ # Look for a parameter name.
+ if (m%^\s*@(\S+)\s*:\s*%) {
+ my $param_name = $1;
+ my $param_desc = $';
+
+ #print "Found parameter: $param_name\n";
+ # Allow '...' as the Varargs parameter.
+ if ($param_name eq "...") {
+ $param_name = "Varargs";
+ }
+ if ("\L$param_name" eq "returns") {
+ $return_style = 'sane';
+ $ignore_broken_returns = 1;
+ }
+ push (@params, $param_name);
+ push (@params, $param_desc);
+ $current_param += $PARAM_FIELD_COUNT;
+ next;
+ }
+
+ # We must be in the middle of a parameter description, so add it on
+ # to the last element in @params.
+ if ($current_param == -1) {
+ &LogWarning ($file, $., "Parsing comment block file : parameter expected.");
+ } else {
+ $params[$#params] .= $_;
+ }
}
close (SRCFILE);
}
@@ -4188,12 +4203,12 @@ sub OutputUndeclaredSymbols {
my $new_undeclared_file = "$ROOT_DIR/$MODULE-undeclared.new";
open(UNDECLARED, ">$new_undeclared_file")
- || die "Can't create $new_undeclared_file";
+ || die "Can't create $new_undeclared_file";
if (%UndeclaredSymbols) {
- print UNDECLARED (join("\n", sort keys %UndeclaredSymbols));
- print UNDECLARED "\n";
- print "See $MODULE-undeclared.txt for the list of undeclared symbols.\n"
+ print UNDECLARED (join("\n", sort keys %UndeclaredSymbols));
+ print UNDECLARED "\n";
+ print "See $MODULE-undeclared.txt for the list of undeclared symbols.\n"
}
close(UNDECLARED);
@@ -4214,13 +4229,13 @@ sub OutputUnusedSymbols {
my $new_unused_file = "$ROOT_DIR/$MODULE-unused.new";
open (UNUSED, ">$new_unused_file")
- || die "Can't open $new_unused_file";
+ || die "Can't open $new_unused_file";
my ($symbol);
foreach $symbol (sort keys (%Declarations)) {
- if (!defined ($DeclarationOutput{$symbol})) {
- print (UNUSED "$symbol\n");
- $num_unused++;
- }
+ if (!defined ($DeclarationOutput{$symbol})) {
+ print (UNUSED "$symbol\n");
+ $num_unused++;
+ }
}
foreach $symbol (sort (keys (%AllUnusedSymbols))) {
print (UNUSED "$symbol(" . $AllUnusedSymbols{$symbol} . ")\n");
@@ -4290,11 +4305,11 @@ sub OutputSymbolsWithoutSince {
#############################################################################
# Function : MergeSourceDocumentation
# Description : This merges documentation read from a source file into the
-# documentation read in from a template file.
+# documentation read in from a template file.
#
-# Parameter descriptions override any in the template files.
-# Function descriptions are placed before any description from
-# the template files.
+# Parameter descriptions override any in the template files.
+# Function descriptions are placed before any description from
+# the template files.
#
# Arguments : none
#############################################################################
@@ -4332,33 +4347,33 @@ sub MergeSourceDocumentation {
foreach $symbol (@Symbols) {
$AllSymbols{$symbol} = 1;
- my $have_tmpl_docs = 0;
-
- ## see if the symbol is documented in template
- my $tmpl_doc = defined ($SymbolDocs{$symbol}) ? $SymbolDocs{$symbol} : "";
- my $check_tmpl_doc =$tmpl_doc;
- # remove all xml-tags and whitespaces
- $check_tmpl_doc =~ s/<.*?>//g;
- $check_tmpl_doc =~ s/\s//g;
- # anything left ?
- if ($check_tmpl_doc ne "") {
- $have_tmpl_docs = 1;
+ my $have_tmpl_docs = 0;
+
+ ## see if the symbol is documented in template
+ my $tmpl_doc = defined ($SymbolDocs{$symbol}) ? $SymbolDocs{$symbol} : "";
+ my $check_tmpl_doc =$tmpl_doc;
+ # remove all xml-tags and whitespaces
+ $check_tmpl_doc =~ s/<.*?>//g;
+ $check_tmpl_doc =~ s/\s//g;
+ # anything left ?
+ if ($check_tmpl_doc ne "") {
+ $have_tmpl_docs = 1;
#print "## [$check_tmpl_doc]\n";
- } else {
- # if the docs have just an empty para, don't merge that.
- $check_tmpl_doc = $tmpl_doc;
- $check_tmpl_doc =~ s/(\s|\n)//msg;
- if ($check_tmpl_doc eq "<para></para>") {
- $tmpl_doc = "";
- }
- }
-
- if (exists ($SourceSymbolDocs{$symbol})) {
- my $type = $DeclarationTypes {$symbol};
+ } else {
+ # if the docs have just an empty para, don't merge that.
+ $check_tmpl_doc = $tmpl_doc;
+ $check_tmpl_doc =~ s/(\s|\n)//msg;
+ if ($check_tmpl_doc eq "<para></para>") {
+ $tmpl_doc = "";
+ }
+ }
+
+ if (exists ($SourceSymbolDocs{$symbol})) {
+ my $type = $DeclarationTypes {$symbol};
#print "merging [$symbol] from source\n";
- my $item = "Parameter";
+ my $item = "Parameter";
if (defined ($type)) {
if ($type eq 'STRUCT') {
$item = "Field";
@@ -4371,33 +4386,33 @@ sub MergeSourceDocumentation {
$type="SIGNAL";
}
- my $src_doc = $SourceSymbolDocs{$symbol};
- # remove leading and training whitespaces
- $src_doc =~ s/^\s+//;
- $src_doc =~ s/\s+$//;
+ my $src_doc = $SourceSymbolDocs{$symbol};
+ # remove leading and training whitespaces
+ $src_doc =~ s/^\s+//;
+ $src_doc =~ s/\s+$//;
- # Don't output warnings for overridden titles as titles are
- # automatically generated in the -sections.txt file, and thus they
- # are often overridden.
- if ($have_tmpl_docs && $symbol !~ m/:Title$/) {
- # check if content is different
+ # Don't output warnings for overridden titles as titles are
+ # automatically generated in the -sections.txt file, and thus they
+ # are often overridden.
+ if ($have_tmpl_docs && $symbol !~ m/:Title$/) {
+ # check if content is different
if ($tmpl_doc ne $src_doc) {
#print "[$tmpl_doc] [$src_doc]\n";
&LogWarning ($SourceSymbolSourceFile{$symbol}, $SourceSymbolSourceLine{$symbol},
"Documentation in template ".$SymbolSourceFile{$symbol}.":".$SymbolSourceLine{$symbol}." for $symbol being overridden by inline comments.");
}
- }
+ }
if ($src_doc ne "") {
$AllDocumentedSymbols{$symbol} = 1;
}
- # Convert <!--PARAMETERS--> with any blank lines around it to
- # a </para> followed by <!--PARAMETERS--> followed by <para>.
- $src_doc =~ s%\n+\s*<!--PARAMETERS-->\s*\n+%\n</para>\n<!--PARAMETERS-->\n<para>\n%g;
+ # Convert <!--PARAMETERS--> with any blank lines around it to
+ # a </para> followed by <!--PARAMETERS--> followed by <para>.
+ $src_doc =~ s%\n+\s*<!--PARAMETERS-->\s*\n+%\n</para>\n<!--PARAMETERS-->\n<para>\n%g;
- # Do not add <para> to nothing, it breaks missing docs checks.
- my $src_doc_para = "";
+ # Do not add <para> to nothing, it breaks missing docs checks.
+ my $src_doc_para = "";
if ($src_doc ne "") {
# Expand markdown (and do paragraphs)
$src_doc_para = &ConvertMarkDown ($src_doc, $symbol);
@@ -4413,24 +4428,24 @@ sub MergeSourceDocumentation {
$SymbolDocs{$symbol} = "$src_doc_para$tmpl_doc";
} elsif ($symbol =~ m/$TMPL_DIR\/.+:.+/) {
# For the title/summary/see also section docs we don't want to
- # add any <para> tags.
+ # add any <para> tags.
$SymbolDocs{$symbol} = "$src_doc"
} else {
$SymbolDocs{$symbol} = "$src_doc_para$tmpl_doc";
}
- # merge parameters
- if ($symbol =~ m/.*::.*/) {
- # For signals we prefer the param names from the source docs,
- # since the ones from the templates are likely to contain the
- # artificial argn names which are generated by gtkdoc-scangobj.
- $SymbolParams{$symbol} = $SourceSymbolParams{$symbol};
- # FIXME: we need to check for empty docs here as well!
- } else {
- # The templates contain the definitive parameter names and order,
- # so we will not change that. We only override the actual text.
- my $tmpl_params = $SymbolParams{$symbol};
- if (!defined ($tmpl_params)) {
+ # merge parameters
+ if ($symbol =~ m/.*::.*/) {
+ # For signals we prefer the param names from the source docs,
+ # since the ones from the templates are likely to contain the
+ # artificial argn names which are generated by gtkdoc-scangobj.
+ $SymbolParams{$symbol} = $SourceSymbolParams{$symbol};
+ # FIXME: we need to check for empty docs here as well!
+ } else {
+ # The templates contain the definitive parameter names and order,
+ # so we will not change that. We only override the actual text.
+ my $tmpl_params = $SymbolParams{$symbol};
+ if (!defined ($tmpl_params)) {
#print "No merge needed for $symbol\n";
$SymbolParams{$symbol} = $SourceSymbolParams{$symbol};
# FIXME: we still like to get the number of params and merge
@@ -4438,7 +4453,7 @@ sub MergeSourceDocumentation {
# 2) we would catch undocumented params
# params are not (yet) exported in -decl.txt so that we
# could easily grab them :/
- } else {
+ } else {
my $params = $SourceSymbolParams{$symbol};
my $j;
#print "Merge needed for $symbol, tmpl_params: ",$#$tmpl_params,", source_params: ",$#$params," \n";
@@ -4500,24 +4515,24 @@ sub MergeSourceDocumentation {
"$item described in source code comment block but does not exist. $type: $symbol $item: $param_name.");
}
}
- }
- }
- } else {
- if ($have_tmpl_docs) {
- $AllDocumentedSymbols{$symbol} = 1;
- #print "merging [$symbol] from template\n";
+ }
+ }
+ } else {
+ if ($have_tmpl_docs) {
+ $AllDocumentedSymbols{$symbol} = 1;
+ #print "merging [$symbol] from template\n";
}
else {
- #print "[$symbol] undocumented\n";
+ #print "[$symbol] undocumented\n";
}
- }
-
- # if this symbol is documented, check if docs are complete
- $check_tmpl_doc = defined ($SymbolDocs{$symbol}) ? $SymbolDocs{$symbol} : "";
- # remove all xml-tags and whitespaces
- $check_tmpl_doc =~ s/<.*?>//g;
- $check_tmpl_doc =~ s/\s//g;
- if ($check_tmpl_doc ne "") {
+ }
+
+ # if this symbol is documented, check if docs are complete
+ $check_tmpl_doc = defined ($SymbolDocs{$symbol}) ? $SymbolDocs{$symbol} : "";
+ # remove all xml-tags and whitespaces
+ $check_tmpl_doc =~ s/<.*?>//g;
+ $check_tmpl_doc =~ s/\s//g;
+ if ($check_tmpl_doc ne "") {
my $tmpl_params = $SymbolParams{$symbol};
if (defined ($tmpl_params)) {
my $type = $DeclarationTypes {$symbol};
@@ -4584,7 +4599,7 @@ sub IsEmptyDoc {
}
if ($doc =~ /^\s*<para>\s*(FIXME)?\s*<\/para>\s*$/) {
- return 1;
+ return 1;
}
return 0;
@@ -4610,9 +4625,9 @@ sub ConvertMarkDown {
# convert
$text = &ModifyXMLElements ($text, $symbol,
- "<!\\[CDATA\\[|<programlisting[^>]*>|\\|\\[",
- \&ConvertMarkDownEndTag,
- \&ConvertMarkDownCallback);
+ "<!\\[CDATA\\[|<programlisting[^>]*>|\\|\\[",
+ \&ConvertMarkDownEndTag,
+ \&ConvertMarkDownCallback);
# encapsulate and terminate
$text = "<para>\n$text\n</para>";
if ($md_in_refsect2==1) {
@@ -4648,22 +4663,22 @@ sub ConvertMarkDownCallback {
}
# Setext-style headers:
- # Header 1
- # ========
+ # Header 1
+ # ========
#
- # Header 2
- # --------
+ # Header 2
+ # --------
#
if($text =~ s%^\n(.+)[ \t]*\n=+[ \t]*\n\n%$end_of_section<refsect2><title>$1</title><para>\n%gm) {
$md_in_refsect2=1;
}
# atx-style headers:
- # # Header 1
- # ## Header 2
- # ## Header 2 with closing hashes ##
- # ...
- # ###### Header 6
+ # # Header 1
+ # ## Header 2
+ # ## Header 2 with closing hashes ##
+ # ...
+ # ###### Header 6
#
if($text =~ s%^\n\#[ \t]*(.+?)[ \t]*\#\n+%$end_of_section<refsect2><title>$1</title><para>\n%gm) {
$md_in_refsect2=1;
@@ -4693,127 +4708,127 @@ sub ConvertMarkDownCallback {
#############################################################################
-# LIBRARY FUNCTIONS - These functions are used in both gtkdoc-mkdb and
-# gtkdoc-mktmpl and should eventually be moved to a
-# separate library.
+# LIBRARY FUNCTIONS - These functions are used in both gtkdoc-mkdb and
+# gtkdoc-mktmpl and should eventually be moved to a
+# separate library.
#############################################################################
#############################################################################
# Function : ReadDeclarationsFile
# Description : This reads in a file containing the function/macro/enum etc.
-# declarations.
+# declarations.
#
-# Note that in some cases there are several declarations with
-# the same name, e.g. for conditional macros. In this case we
-# set a flag in the %DeclarationConditional hash so the
-# declaration is not shown in the docs.
+# Note that in some cases there are several declarations with
+# the same name, e.g. for conditional macros. In this case we
+# set a flag in the %DeclarationConditional hash so the
+# declaration is not shown in the docs.
#
-# If a macro and a function have the same name, e.g. for
-# gtk_object_ref, the function declaration takes precedence.
+# If a macro and a function have the same name, e.g. for
+# gtk_object_ref, the function declaration takes precedence.
#
-# Some opaque structs are just declared with 'typedef struct
-# _name name;' in which case the declaration may be empty.
-# The structure may have been found later in the header, so
-# that overrides the empty declaration.
+# Some opaque structs are just declared with 'typedef struct
+# _name name;' in which case the declaration may be empty.
+# The structure may have been found later in the header, so
+# that overrides the empty declaration.
#
# Arguments : $file - the declarations file to read
-# $override - if declarations in this file should override
-# any current declaration.
+# $override - if declarations in this file should override
+# any current declaration.
#############################################################################
sub ReadDeclarationsFile {
my ($file, $override) = @_;
if ($override == 0) {
- %Declarations = ();
- %DeclarationTypes = ();
- %DeclarationConditional = ();
- %DeclarationOutput = ();
+ %Declarations = ();
+ %DeclarationTypes = ();
+ %DeclarationConditional = ();
+ %DeclarationOutput = ();
}
open (INPUT, $file)
- || die "Can't open $file: $!";
+ || die "Can't open $file: $!";
my $declaration_type = "";
my $declaration_name;
my $declaration;
my $is_deprecated = 0;
while (<INPUT>) {
- if (!$declaration_type) {
- if (m/^<([^>]+)>/) {
- $declaration_type = $1;
- $declaration_name = "";
- #print "Found declaration: $declaration_type\n";
- $declaration = "";
- }
- } else {
- if (m%^<NAME>(.*)</NAME>%) {
- $declaration_name = $1;
+ if (!$declaration_type) {
+ if (m/^<([^>]+)>/) {
+ $declaration_type = $1;
+ $declaration_name = "";
+ #print "Found declaration: $declaration_type\n";
+ $declaration = "";
+ }
+ } else {
+ if (m%^<NAME>(.*)</NAME>%) {
+ $declaration_name = $1;
} elsif (m%^<DEPRECATED/>%) {
$is_deprecated = 1;
} elsif (m%^</$declaration_type>%) {
- #print "Found end of declaration: $declaration_name\n";
- # Check that the declaration has a name
- if ($declaration_name eq "") {
- print "ERROR: $declaration_type has no name $file:$.\n";
- }
-
- # If the declaration is an empty typedef struct _XXX XXX
- # set the flag to indicate the struct has a typedef.
- if ($declaration_type eq 'STRUCT'
- && $declaration =~ m/^\s*$/) {
- #print "Struct has typedef: $declaration_name\n";
- $StructHasTypedef{$declaration_name} = 1;
- }
-
- # Check if the symbol is already defined.
- if (defined ($Declarations{$declaration_name})
- && $override == 0) {
- # Function declarations take precedence.
- if ($DeclarationTypes{$declaration_name} eq 'FUNCTION') {
- # Ignore it.
- } elsif ($declaration_type eq 'FUNCTION') {
- if ($is_deprecated) {
- $Deprecated{$declaration_name} = "";
- }
- $Declarations{$declaration_name} = $declaration;
- $DeclarationTypes{$declaration_name} = $declaration_type;
- } elsif ($DeclarationTypes{$declaration_name}
- eq $declaration_type) {
- # If the existing declaration is empty, or is just a
- # forward declaration of a struct, override it.
- if ($declaration_type eq 'STRUCT') {
- if ($Declarations{$declaration_name} =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
- if ($is_deprecated) {
- $Deprecated{$declaration_name} = "";
- }
- $Declarations{$declaration_name} = $declaration;
- } elsif ($declaration =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
- # Ignore an empty or forward declaration.
- } else {
- &LogWarning ($file, $., "Structure $declaration_name has multiple definitions.");
- }
- } else {
- # set flag in %DeclarationConditional hash for
- # multiply defined macros/typedefs.
- $DeclarationConditional{$declaration_name} = 1;
- }
- } else {
- &LogWarning ($file, $., "$declaration_name has multiple definitions.");
- }
- } else {
- if ($is_deprecated) {
- $Deprecated{$declaration_name} = "";
- }
- $Declarations{$declaration_name} = $declaration;
- $DeclarationTypes{$declaration_name} = $declaration_type;
- }
-
- $declaration_type = "";
+ #print "Found end of declaration: $declaration_name\n";
+ # Check that the declaration has a name
+ if ($declaration_name eq "") {
+ print "ERROR: $declaration_type has no name $file:$.\n";
+ }
+
+ # If the declaration is an empty typedef struct _XXX XXX
+ # set the flag to indicate the struct has a typedef.
+ if ($declaration_type eq 'STRUCT'
+ && $declaration =~ m/^\s*$/) {
+ #print "Struct has typedef: $declaration_name\n";
+ $StructHasTypedef{$declaration_name} = 1;
+ }
+
+ # Check if the symbol is already defined.
+ if (defined ($Declarations{$declaration_name})
+ && $override == 0) {
+ # Function declarations take precedence.
+ if ($DeclarationTypes{$declaration_name} eq 'FUNCTION') {
+ # Ignore it.
+ } elsif ($declaration_type eq 'FUNCTION') {
+ if ($is_deprecated) {
+ $Deprecated{$declaration_name} = "";
+ }
+ $Declarations{$declaration_name} = $declaration;
+ $DeclarationTypes{$declaration_name} = $declaration_type;
+ } elsif ($DeclarationTypes{$declaration_name}
+ eq $declaration_type) {
+ # If the existing declaration is empty, or is just a
+ # forward declaration of a struct, override it.
+ if ($declaration_type eq 'STRUCT') {
+ if ($Declarations{$declaration_name} =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
+ if ($is_deprecated) {
+ $Deprecated{$declaration_name} = "";
+ }
+ $Declarations{$declaration_name} = $declaration;
+ } elsif ($declaration =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
+ # Ignore an empty or forward declaration.
+ } else {
+ &LogWarning ($file, $., "Structure $declaration_name has multiple definitions.");
+ }
+ } else {
+ # set flag in %DeclarationConditional hash for
+ # multiply defined macros/typedefs.
+ $DeclarationConditional{$declaration_name} = 1;
+ }
+ } else {
+ &LogWarning ($file, $., "$declaration_name has multiple definitions.");
+ }
+ } else {
+ if ($is_deprecated) {
+ $Deprecated{$declaration_name} = "";
+ }
+ $Declarations{$declaration_name} = $declaration;
+ $DeclarationTypes{$declaration_name} = $declaration_type;
+ }
+
+ $declaration_type = "";
$is_deprecated = 0;
- } else {
- $declaration .= $_;
- }
- }
+ } else {
+ $declaration .= $_;
+ }
+ }
}
close (INPUT);
}
@@ -4822,14 +4837,14 @@ sub ReadDeclarationsFile {
#############################################################################
# Function : ReadSignalsFile
# Description : This reads in an existing file which contains information on
-# all GTK signals. It creates the arrays @SignalNames and
-# @SignalPrototypes containing info on the signals. The first
-# line of the SignalPrototype is the return type of the signal
-# handler. The remaining lines are the parameters passed to it.
-# The last parameter, "gpointer user_data" is always the same
-# so is not included.
+# all GTK signals. It creates the arrays @SignalNames and
+# @SignalPrototypes containing info on the signals. The first
+# line of the SignalPrototype is the return type of the signal
+# handler. The remaining lines are the parameters passed to it.
+# The last parameter, "gpointer user_data" is always the same
+# so is not included.
# Arguments : $file - the file containing the signal handler prototype
-# information.
+# information.
#############################################################################
sub ReadSignalsFile {
@@ -4850,47 +4865,47 @@ sub ReadSignalsFile {
@SignalPrototypes = ();
if (! -f $file) {
- return;
+ return;
}
if (!open (INPUT, $file)) {
- warn "Can't open $file - skipping signals\n";
- return;
+ warn "Can't open $file - skipping signals\n";
+ return;
}
while (<INPUT>) {
- if (!$in_signal) {
- if (m/^<SIGNAL>/) {
- $in_signal = 1;
- $signal_object = "";
- $signal_name = "";
- $signal_returns = "";
- $signal_prototype = "";
- }
- } else {
- if (m/^<NAME>(.*)<\/NAME>/) {
- $signal_name = $1;
- if ($signal_name =~ m/^(.*)::(.*)$/) {
- $signal_object = $1;
- ($signal_name = $2) =~ s/_/-/g;
- #print "Found signal: $signal_name\n";
- } else {
- &LogWarning ($file, $., "Invalid signal name: $signal_name.");
- }
- } elsif (m/^<RETURNS>(.*)<\/RETURNS>/) {
- $signal_returns = $1;
- } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
- $signal_flags = $1;
- } elsif (m%^</SIGNAL>%) {
- #print "Found end of signal: ${signal_object}::${signal_name}\nReturns: ${signal_returns}\n${signal_prototype}";
- push (@SignalObjects, $signal_object);
- push (@SignalNames, $signal_name);
- push (@SignalReturns, $signal_returns);
- push (@SignalFlags, $signal_flags);
- push (@SignalPrototypes, $signal_prototype);
- $in_signal = 0;
- } else {
- $signal_prototype .= $_;
- }
- }
+ if (!$in_signal) {
+ if (m/^<SIGNAL>/) {
+ $in_signal = 1;
+ $signal_object = "";
+ $signal_name = "";
+ $signal_returns = "";
+ $signal_prototype = "";
+ }
+ } else {
+ if (m/^<NAME>(.*)<\/NAME>/) {
+ $signal_name = $1;
+ if ($signal_name =~ m/^(.*)::(.*)$/) {
+ $signal_object = $1;
+ ($signal_name = $2) =~ s/_/-/g;
+ #print "Found signal: $signal_name\n";
+ } else {
+ &LogWarning ($file, $., "Invalid signal name: $signal_name.");
+ }
+ } elsif (m/^<RETURNS>(.*)<\/RETURNS>/) {
+ $signal_returns = $1;
+ } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
+ $signal_flags = $1;
+ } elsif (m%^</SIGNAL>%) {
+ #print "Found end of signal: ${signal_object}::${signal_name}\nReturns: ${signal_returns}\n${signal_prototype}";
+ push (@SignalObjects, $signal_object);
+ push (@SignalNames, $signal_name);
+ push (@SignalReturns, $signal_returns);
+ push (@SignalFlags, $signal_flags);
+ push (@SignalPrototypes, $signal_prototype);
+ $in_signal = 0;
+ } else {
+ $signal_prototype .= $_;
+ }
+ }
}
close (INPUT);
}
@@ -4899,15 +4914,15 @@ sub ReadSignalsFile {
#############################################################################
# Function : ReadTemplateFile
# Description : This reads in the manually-edited documentation file
-# corresponding to the file currently being created, so we can
-# insert the documentation at the appropriate places.
-# It outputs %SymbolTypes, %SymbolDocs and %SymbolParams, which
-# is a hash of arrays.
-# NOTE: This function is duplicated in gtkdoc-mktmpl (but
-# slightly different).
+# corresponding to the file currently being created, so we can
+# insert the documentation at the appropriate places.
+# It outputs %SymbolTypes, %SymbolDocs and %SymbolParams, which
+# is a hash of arrays.
+# NOTE: This function is duplicated in gtkdoc-mktmpl (but
+# slightly different).
# Arguments : $docsfile - the template file to read in.
-# $skip_unused_params - 1 if the unused parameters should be
-# skipped.
+# $skip_unused_params - 1 if the unused parameters should be
+# skipped.
#############################################################################
sub ReadTemplateFile {
@@ -4915,8 +4930,8 @@ sub ReadTemplateFile {
my $template = "$docsfile.sgml";
if (! -f $template) {
- #print "File doesn't exist: $template\n";
- return 0;
+ #print "File doesn't exist: $template\n";
+ return 0;
}
#print "Reading $template\n";
@@ -4926,116 +4941,116 @@ sub ReadTemplateFile {
%SymbolTypes = ();
%SymbolParams = ();
- my $current_type = ""; # Type of symbol being read.
- my $current_symbol = ""; # Name of symbol being read.
- my $symbol_doc = ""; # Description of symbol being read.
- my @params; # Parameter names and descriptions of current
- # function/macro/function typedef.
- my $current_param = -1; # Index of parameter currently being read.
- # Note that the param array contains pairs
- # of param name & description.
- my $in_unused_params = 0; # True if we are reading in the unused params.
+ my $current_type = ""; # Type of symbol being read.
+ my $current_symbol = ""; # Name of symbol being read.
+ my $symbol_doc = ""; # Description of symbol being read.
+ my @params; # Parameter names and descriptions of current
+ # function/macro/function typedef.
+ my $current_param = -1; # Index of parameter currently being read.
+ # Note that the param array contains pairs
+ # of param name & description.
+ my $in_unused_params = 0; # True if we are reading in the unused params.
my $in_deprecated = 0;
my $in_since = 0;
my $in_stability = 0;
open (DOCS, "$template")
- || die "Can't open $template: $!";
+ || die "Can't open $template: $!";
while (<DOCS>) {
- if (m/^<!-- ##### ([A-Z_]+) (\S+) ##### -->/) {
- my $type = $1;
- my $symbol = $2;
- if ($symbol eq "Title"
- || $symbol eq "Short_Description"
- || $symbol eq "Long_Description"
- || $symbol eq "See_Also"
- || $symbol eq "Stability_Level"
- || $symbol eq "Include"
- || $symbol eq "Image") {
-
- $symbol = $docsfile . ":" . $symbol;
- }
-
- #print "Found symbol: $symbol\n";
- # Remember file and line for the symbol
- $SymbolSourceFile{$symbol} = $template;
- $SymbolSourceLine{$symbol} = $.;
-
- # Store previous symbol, but remove any trailing blank lines.
- if ($current_symbol ne "") {
- $symbol_doc =~ s/\s+$//;
- $SymbolTypes{$current_symbol} = $current_type;
- $SymbolDocs{$current_symbol} = $symbol_doc;
-
- # Check that the stability level is valid.
- if ($StabilityLevel{$current_symbol}) {
- $StabilityLevel{$current_symbol} = &ParseStabilityLevel($StabilityLevel{$current_symbol}, $template, $., "Stability level for $current_symbol");
- }
-
- if ($current_param >= 0) {
- $SymbolParams{$current_symbol} = [ @params ];
- } else {
- # Delete any existing params in case we are overriding a
- # previously read template.
- delete $SymbolParams{$current_symbol};
- }
- }
- $current_type = $type;
- $current_symbol = $symbol;
- $current_param = -1;
- $in_unused_params = 0;
- $in_deprecated = 0;
- $in_since = 0;
- $in_stability = 0;
- $symbol_doc = "";
- @params = ();
-
- } elsif (m/^<!-- # Unused Parameters # -->/) {
- #print "DEBUG: Found unused parameters\n";
- $in_unused_params = 1;
- next;
-
- } elsif ($in_unused_params && $skip_unused_params) {
- # When outputting the DocBook we skip unused parameters.
- #print "DEBUG: Skipping unused param: $_";
- next;
-
- } else {
- # Check if param found. Need to handle "..." and "format...".
- if (s/^\@([\w\.]+):\040?//) {
- my $param_name = $1;
- my $param_desc = $_;
- # Allow variations of 'Returns'
- if ($param_name =~ m/^[Rr]eturns?$/) {
- $param_name = "Returns";
- }
-
- # strip trailing whitespaces and blank lines
- s/\s+\n$/\n/m;
- s/\n+$/\n/sm;
- #print "Found param for symbol $current_symbol : '$param_name'= '$_'";
-
- if ($param_name eq "Deprecated") {
- $in_deprecated = 1;
- $Deprecated{$current_symbol} = $_;
- } elsif ($param_name eq "Since") {
- $in_since = 1;
- chomp;
- $Since{$current_symbol} = $_;
- } elsif ($param_name eq "Stability") {
- $in_stability = 1;
- $StabilityLevel{$current_symbol} = $_;
- } else {
- push (@params, $param_name);
- push (@params, $param_desc);
- $current_param += $PARAM_FIELD_COUNT;
- }
- } else {
- # strip trailing whitespaces and blank lines
- s/\s+\n$/\n/m;
- s/\n+$/\n/sm;
-
- if (!m/^\s+$/) {
+ if (m/^<!-- ##### ([A-Z_]+) (\S+) ##### -->/) {
+ my $type = $1;
+ my $symbol = $2;
+ if ($symbol eq "Title"
+ || $symbol eq "Short_Description"
+ || $symbol eq "Long_Description"
+ || $symbol eq "See_Also"
+ || $symbol eq "Stability_Level"
+ || $symbol eq "Include"
+ || $symbol eq "Image") {
+
+ $symbol = $docsfile . ":" . $symbol;
+ }
+
+ #print "Found symbol: $symbol\n";
+ # Remember file and line for the symbol
+ $SymbolSourceFile{$symbol} = $template;
+ $SymbolSourceLine{$symbol} = $.;
+
+ # Store previous symbol, but remove any trailing blank lines.
+ if ($current_symbol ne "") {
+ $symbol_doc =~ s/\s+$//;
+ $SymbolTypes{$current_symbol} = $current_type;
+ $SymbolDocs{$current_symbol} = $symbol_doc;
+
+ # Check that the stability level is valid.
+ if ($StabilityLevel{$current_symbol}) {
+ $StabilityLevel{$current_symbol} = &ParseStabilityLevel($StabilityLevel{$current_symbol}, $template, $., "Stability level for $current_symbol");
+ }
+
+ if ($current_param >= 0) {
+ $SymbolParams{$current_symbol} = [ @params ];
+ } else {
+ # Delete any existing params in case we are overriding a
+ # previously read template.
+ delete $SymbolParams{$current_symbol};
+ }
+ }
+ $current_type = $type;
+ $current_symbol = $symbol;
+ $current_param = -1;
+ $in_unused_params = 0;
+ $in_deprecated = 0;
+ $in_since = 0;
+ $in_stability = 0;
+ $symbol_doc = "";
+ @params = ();
+
+ } elsif (m/^<!-- # Unused Parameters # -->/) {
+ #print "DEBUG: Found unused parameters\n";
+ $in_unused_params = 1;
+ next;
+
+ } elsif ($in_unused_params && $skip_unused_params) {
+ # When outputting the DocBook we skip unused parameters.
+ #print "DEBUG: Skipping unused param: $_";
+ next;
+
+ } else {
+ # Check if param found. Need to handle "..." and "format...".
+ if (s/^\@([\w\.]+):\040?//) {
+ my $param_name = $1;
+ my $param_desc = $_;
+ # Allow variations of 'Returns'
+ if ($param_name =~ m/^[Rr]eturns?$/) {
+ $param_name = "Returns";
+ }
+
+ # strip trailing whitespaces and blank lines
+ s/\s+\n$/\n/m;
+ s/\n+$/\n/sm;
+ #print "Found param for symbol $current_symbol : '$param_name'= '$_'";
+
+ if ($param_name eq "Deprecated") {
+ $in_deprecated = 1;
+ $Deprecated{$current_symbol} = $_;
+ } elsif ($param_name eq "Since") {
+ $in_since = 1;
+ chomp;
+ $Since{$current_symbol} = $_;
+ } elsif ($param_name eq "Stability") {
+ $in_stability = 1;
+ $StabilityLevel{$current_symbol} = $_;
+ } else {
+ push (@params, $param_name);
+ push (@params, $param_desc);
+ $current_param += $PARAM_FIELD_COUNT;
+ }
+ } else {
+ # strip trailing whitespaces and blank lines
+ s/\s+\n$/\n/m;
+ s/\n+$/\n/sm;
+
+ if (!m/^\s+$/) {
if ($in_deprecated) {
$Deprecated{$current_symbol} .= $_;
} elsif ($in_since) {
@@ -5048,30 +5063,30 @@ sub ReadTemplateFile {
} else {
$symbol_doc .= $_;
}
- }
- }
- }
+ }
+ }
+ }
}
# Remember to finish the current symbol doccs.
if ($current_symbol ne "") {
- $symbol_doc =~ s/\s+$//;
- $SymbolTypes{$current_symbol} = $current_type;
- $SymbolDocs{$current_symbol} = $symbol_doc;
+ $symbol_doc =~ s/\s+$//;
+ $SymbolTypes{$current_symbol} = $current_type;
+ $SymbolDocs{$current_symbol} = $symbol_doc;
- # Check that the stability level is valid.
- if ($StabilityLevel{$current_symbol}) {
- $StabilityLevel{$current_symbol} = &ParseStabilityLevel($StabilityLevel{$current_symbol}, $template, $., "Stability level for $current_symbol");
- }
+ # Check that the stability level is valid.
+ if ($StabilityLevel{$current_symbol}) {
+ $StabilityLevel{$current_symbol} = &ParseStabilityLevel($StabilityLevel{$current_symbol}, $template, $., "Stability level for $current_symbol");
+ }
- if ($current_param >= 0) {
- $SymbolParams{$current_symbol} = [ @params ];
- } else {
- # Delete any existing params in case we are overriding a
- # previously read template.
- delete $SymbolParams{$current_symbol};
- }
+ if ($current_param >= 0) {
+ $SymbolParams{$current_symbol} = [ @params ];
+ } else {
+ # Delete any existing params in case we are overriding a
+ # previously read template.
+ delete $SymbolParams{$current_symbol};
+ }
}
close (DOCS);
@@ -5082,11 +5097,11 @@ sub ReadTemplateFile {
#############################################################################
# Function : ReadObjectHierarchy
# Description : This reads in the $MODULE-hierarchy.txt file containing all
-# the GtkObject subclasses described in this module (and their
-# ancestors).
-# It places them in the @Objects array, and places their level
-# in the object hierarchy in the @ObjectLevels array, at the
-# same index. GtkObject, the root object, has a level of 1.
+# the GtkObject subclasses described in this module (and their
+# ancestors).
+# It places them in the @Objects array, and places their level
+# in the object hierarchy in the @ObjectLevels array, at the
+# same index. GtkObject, the root object, has a level of 1.
#
# FIXME: the version in gtkdoc-mkdb also generates tree_index.sgml
# as it goes along, this should be split out into a separate
@@ -5100,11 +5115,11 @@ sub ReadObjectHierarchy {
@ObjectLevels = ();
if (! -f $OBJECT_TREE_FILE) {
- return;
+ return;
}
if (!open (INPUT, $OBJECT_TREE_FILE)) {
- warn "Can't open $OBJECT_TREE_FILE - skipping object tree\n";
- return;
+ warn "Can't open $OBJECT_TREE_FILE - skipping object tree\n";
+ return;
}
# FIXME: use $OUTPUT_FORMAT
@@ -5113,7 +5128,7 @@ sub ReadObjectHierarchy {
my $new_tree_index = "$SGML_OUTPUT_DIR/tree_index.new";
open (OUTPUT, ">$new_tree_index")
- || die "Can't create $new_tree_index: $!";
+ || die "Can't create $new_tree_index: $!";
if ($OUTPUT_FORMAT eq "xml") {
my $tree_header = $doctype_header;
@@ -5131,33 +5146,33 @@ sub ReadObjectHierarchy {
my @pending_levels = ();
while (<INPUT>) {
if (m/\S+/) {
- my $object = $&;
- my $level = (length($`)) / 2 + 1;
+ my $object = $&;
+ my $level = (length($`)) / 2 + 1;
my $xref = "";
- while (($#pending_levels >= 0) && ($pending_levels[$#pending_levels] >= $level)) {
- my $pobject = pop(@pending_objects);
- my $plevel = pop(@pending_levels);
- }
+ while (($#pending_levels >= 0) && ($pending_levels[$#pending_levels] >= $level)) {
+ my $pobject = pop(@pending_objects);
+ my $plevel = pop(@pending_levels);
+ }
- push (@pending_objects, $object);
- push (@pending_levels, $level);
+ push (@pending_objects, $object);
+ push (@pending_levels, $level);
if (exists($KnownSymbols{$object}) && $KnownSymbols{$object} == 1) {
- while ($#pending_levels >= 0) {
+ while ($#pending_levels >= 0) {
$object = shift @pending_objects;
- $level = shift @pending_levels;
- $xref = &MakeXRef ($object);
+ $level = shift @pending_levels;
+ $xref = &MakeXRef ($object);
- print (OUTPUT ' ' x ($level * 4), "$xref\n");
- push (@Objects, $object);
- push (@ObjectLevels, $level);
+ print (OUTPUT ' ' x ($level * 4), "$xref\n");
+ push (@Objects, $object);
+ push (@ObjectLevels, $level);
}
}
#else {
# LogWarning ($OBJECT_TREE_FILE, $., "unknown type $object");
#}
- }
+ }
}
print (OUTPUT "</screen>\n");
@@ -5180,11 +5195,11 @@ sub ReadInterfaces {
%Interfaces = ();
if (! -f $INTERFACES_FILE) {
- return;
+ return;
}
if (!open (INPUT, $INTERFACES_FILE)) {
- warn "Can't open $INTERFACES_FILE - skipping interfaces\n";
- return;
+ warn "Can't open $INTERFACES_FILE - skipping interfaces\n";
+ return;
}
while (<INPUT>) {
@@ -5194,11 +5209,11 @@ sub ReadInterfaces {
my @knownIfaces = ();
# filter out private interfaces, but leave foreign interfaces
- foreach my $iface (@ifaces) {
- if (!exists($KnownSymbols{$iface}) || $KnownSymbols{$iface} == 1) {
+ foreach my $iface (@ifaces) {
+ if (!exists($KnownSymbols{$iface}) || $KnownSymbols{$iface} == 1) {
push (@knownIfaces, $iface);
- }
- }
+ }
+ }
$Interfaces{$object} = join(' ', @knownIfaces);
}
@@ -5217,11 +5232,11 @@ sub ReadPrerequisites {
%Prerequisites = ();
if (! -f $PREREQUISITES_FILE) {
- return;
+ return;
}
if (!open (INPUT, $PREREQUISITES_FILE)) {
- warn "Can't open $PREREQUISITES_FILE - skipping prerequisites\n";
- return;
+ warn "Can't open $PREREQUISITES_FILE - skipping prerequisites\n";
+ return;
}
while (<INPUT>) {
@@ -5231,11 +5246,11 @@ sub ReadPrerequisites {
my @knownPrereqs = ();
# filter out private prerequisites, but leave foreign prerequisites
- foreach my $prereq (@prereqs) {
- if (!exists($KnownSymbols{$prereq}) || $KnownSymbols{$prereq} == 1) {
+ foreach my $prereq (@prereqs) {
+ if (!exists($KnownSymbols{$prereq}) || $KnownSymbols{$prereq} == 1) {
push (@knownPrereqs, $prereq);
- }
- }
+ }
+ }
$Prerequisites{$iface} = join(' ', @knownPrereqs);
}
@@ -5246,8 +5261,8 @@ sub ReadPrerequisites {
#############################################################################
# Function : ReadArgsFile
# Description : This reads in an existing file which contains information on
-# all GTK args. It creates the arrays @ArgObjects, @ArgNames,
-# @ArgTypes, @ArgFlags, @ArgNicks and @ArgBlurbs containing info
+# all GTK args. It creates the arrays @ArgObjects, @ArgNames,
+# @ArgTypes, @ArgFlags, @ArgNicks and @ArgBlurbs containing info
# on the args.
# Arguments : $file - the file containing the arg information.
#############################################################################
@@ -5276,64 +5291,64 @@ sub ReadArgsFile {
@ArgRanges = ();
if (! -f $file) {
- return;
+ return;
}
if (!open (INPUT, $file)) {
- warn "Can't open $file - skipping args\n";
- return;
+ warn "Can't open $file - skipping args\n";
+ return;
}
while (<INPUT>) {
- if (!$in_arg) {
- if (m/^<ARG>/) {
- $in_arg = 1;
- $arg_object = "";
- $arg_name = "";
- $arg_type = "";
- $arg_flags = "";
- $arg_nick = "";
- $arg_blurb = "";
- $arg_default = "";
- $arg_range = "";
- }
- } else {
- if (m/^<NAME>(.*)<\/NAME>/) {
- $arg_name = $1;
- if ($arg_name =~ m/^(.*)::(.*)$/) {
- $arg_object = $1;
- ($arg_name = $2) =~ s/_/-/g;
- #print "Found arg: $arg_name\n";
- } else {
- &LogWarning ($file, $., "Invalid argument name: $arg_name");
- }
- } elsif (m/^<TYPE>(.*)<\/TYPE>/) {
- $arg_type = $1;
- } elsif (m/^<RANGE>(.*)<\/RANGE>/) {
- $arg_range = $1;
- } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
- $arg_flags = $1;
- } elsif (m/^<NICK>(.*)<\/NICK>/) {
- $arg_nick = $1;
- } elsif (m/^<BLURB>(.*)<\/BLURB>/) {
- $arg_blurb = $1;
- if ($arg_blurb eq "(null)") {
- $arg_blurb = "";
- &LogWarning ($file, $., "Property ${arg_object}:${arg_name} has no documentation.");
- }
- } elsif (m/^<DEFAULT>(.*)<\/DEFAULT>/) {
- $arg_default = $1;
- } elsif (m%^</ARG>%) {
- #print "Found end of arg: ${arg_object}::${arg_name}\n${arg_type} : ${arg_flags}\n";
- push (@ArgObjects, $arg_object);
- push (@ArgNames, $arg_name);
- push (@ArgTypes, $arg_type);
- push (@ArgRanges, $arg_range);
- push (@ArgFlags, $arg_flags);
- push (@ArgNicks, $arg_nick);
- push (@ArgBlurbs, $arg_blurb);
- push (@ArgDefaults, $arg_default);
- $in_arg = 0;
- }
- }
+ if (!$in_arg) {
+ if (m/^<ARG>/) {
+ $in_arg = 1;
+ $arg_object = "";
+ $arg_name = "";
+ $arg_type = "";
+ $arg_flags = "";
+ $arg_nick = "";
+ $arg_blurb = "";
+ $arg_default = "";
+ $arg_range = "";
+ }
+ } else {
+ if (m/^<NAME>(.*)<\/NAME>/) {
+ $arg_name = $1;
+ if ($arg_name =~ m/^(.*)::(.*)$/) {
+ $arg_object = $1;
+ ($arg_name = $2) =~ s/_/-/g;
+ #print "Found arg: $arg_name\n";
+ } else {
+ &LogWarning ($file, $., "Invalid argument name: $arg_name");
+ }
+ } elsif (m/^<TYPE>(.*)<\/TYPE>/) {
+ $arg_type = $1;
+ } elsif (m/^<RANGE>(.*)<\/RANGE>/) {
+ $arg_range = $1;
+ } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
+ $arg_flags = $1;
+ } elsif (m/^<NICK>(.*)<\/NICK>/) {
+ $arg_nick = $1;
+ } elsif (m/^<BLURB>(.*)<\/BLURB>/) {
+ $arg_blurb = $1;
+ if ($arg_blurb eq "(null)") {
+ $arg_blurb = "";
+ &LogWarning ($file, $., "Property ${arg_object}:${arg_name} has no documentation.");
+ }
+ } elsif (m/^<DEFAULT>(.*)<\/DEFAULT>/) {
+ $arg_default = $1;
+ } elsif (m%^</ARG>%) {
+ #print "Found end of arg: ${arg_object}::${arg_name}\n${arg_type} : ${arg_flags}\n";
+ push (@ArgObjects, $arg_object);
+ push (@ArgNames, $arg_name);
+ push (@ArgTypes, $arg_type);
+ push (@ArgRanges, $arg_range);
+ push (@ArgFlags, $arg_flags);
+ push (@ArgNicks, $arg_nick);
+ push (@ArgBlurbs, $arg_blurb);
+ push (@ArgDefaults, $arg_default);
+ $in_arg = 0;
+ }
+ }
}
close (INPUT);
}
@@ -5342,9 +5357,9 @@ sub ReadArgsFile {
#############################################################################
# Function : CheckIsObject
# Description : Returns 1 if the given name is a GObject or a subclass.
-# It uses the global @Objects array.
-# Note that the @Objects array only contains classes in the
-# current module and their ancestors - not all GObject classes.
+# It uses the global @Objects array.
+# Note that the @Objects array only contains classes in the
+# current module and their ancestors - not all GObject classes.
# Arguments : $name - the name to check.
#############################################################################
@@ -5353,9 +5368,9 @@ sub CheckIsObject {
my $object;
foreach $object (@Objects) {
- if ($object eq $name) {
- return 1;
- }
+ if ($object eq $name) {
+ return 1;
+ }
}
return 0;
}
diff --git a/gtkdoc-mktmpl.in b/gtkdoc-mktmpl.in
index b572335..72ada86 100755
--- a/gtkdoc-mktmpl.in
+++ b/gtkdoc-mktmpl.in
@@ -22,33 +22,33 @@
#############################################################################
# Script : gtkdoc-mktmpl
# Description : This creates or updates the template files which contain the
-# manually-edited documentation. (A 'template' is a simple text
-# form which is filled in with the description of a function,
-# macro, enum, or struct. For functions and macros it also
-# contains fields for describing the parameters.)
+# manually-edited documentation. (A 'template' is a simple text
+# form which is filled in with the description of a function,
+# macro, enum, or struct. For functions and macros it also
+# contains fields for describing the parameters.)
#
-# This script reads in the existing templates, found in
-# tmpl/*.sgml, moves these files to tmpl/*.sgml.bak, and then
-# recreates the .sgml files according to the structure given in
-# the file $MODULE-sections.txt.
+# This script reads in the existing templates, found in
+# tmpl/*.sgml, moves these files to tmpl/*.sgml.bak, and then
+# recreates the .sgml files according to the structure given in
+# the file $MODULE-sections.txt.
#
-# Any new templates added, or new function parameters, are
-# marked with 'FIXME' so you can do a grep to see which parts
-# need updating.
+# Any new templates added, or new function parameters, are
+# marked with 'FIXME' so you can do a grep to see which parts
+# need updating.
#
-# Any templates which are no longer used (i.e. they are remove
-# from $MODULE-sections.txt) are placed in the file
-# tmpl/$MODULE-unused.sgml. If they are included again later
-# they are automatically copied back into position.
-# If you are certain that these templates will never be used
-# again you can delete them from tmpl/$MODULE-unused.sgml.
+# Any templates which are no longer used (i.e. they are remove
+# from $MODULE-sections.txt) are placed in the file
+# tmpl/$MODULE-unused.sgml. If they are included again later
+# they are automatically copied back into position.
+# If you are certain that these templates will never be used
+# again you can delete them from tmpl/$MODULE-unused.sgml.
#
-# Any parameters to functions which are no longer used are
-# separated from the rest of the parameters with the line
-# '<!-- # Unused Parameters # -->'. It may be that the parameter
-# name has just been changed, in which case you can copy the
-# description to the parameter with the new name. You can delete
-# the unused parameter descriptions when no longer needed.
+# Any parameters to functions which are no longer used are
+# separated from the rest of the parameters with the line
+# '<!-- # Unused Parameters # -->'. It may be that the parameter
+# name has just been changed, in which case you can copy the
+# description to the parameter with the new name. You can delete
+# the unused parameter descriptions when no longer needed.
#############################################################################
use strict;
@@ -68,11 +68,11 @@ my $PRINT_HELP;
my $ONLY_SECTION_TMPL;
my %optctl = ('module' => \$MODULE,
- 'flag-changes' => \$FLAG_CHANGES,
- 'output-dir' => \$TMPL_DIR,
- 'only-section-tmpl' => \$ONLY_SECTION_TMPL,
- 'version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP);
+ 'flag-changes' => \$FLAG_CHANGES,
+ 'output-dir' => \$TMPL_DIR,
+ 'only-section-tmpl' => \$ONLY_SECTION_TMPL,
+ 'version' => \$PRINT_VERSION,
+ 'help' => \$PRINT_HELP);
GetOptions(\%optctl, "module=s", "flag-changes!", "output-dir:s", "only-section-tmpl!", "version", "help");
if ($PRINT_VERSION) {
@@ -117,18 +117,18 @@ my $CHANGES_FLAG = $FLAG_CHANGES ? "FIXME" : "";
# These global arrays store information on signals. Each signal has an entry
# in each of these arrays at the same index, like a multi-dimensional array.
-my @SignalObjects; # The GtkObject which emits the signal.
-my @SignalNames; # The signal name.
-my @SignalReturns; # The return type.
-my @SignalFlags; # Flags for the signal
-my @SignalPrototypes; # The rest of the prototype of the signal handler.
+my @SignalObjects; # The GtkObject which emits the signal.
+my @SignalNames; # The signal name.
+my @SignalReturns; # The return type.
+my @SignalFlags; # Flags for the signal
+my @SignalPrototypes; # The rest of the prototype of the signal handler.
# These global arrays store information on Args. Each Arg has an entry
# in each of these arrays at the same index, like a multi-dimensional array.
-my @ArgObjects; # The GtkObject which has the Arg.
-my @ArgNames; # The Arg name.
-my @ArgTypes; # The Arg type - gint, GtkArrowType etc.
-my @ArgFlags; # How the Arg can be used - readable/writable etc.
+my @ArgObjects; # The GtkObject which has the Arg.
+my @ArgNames; # The Arg name.
+my @ArgTypes; # The Arg type - gint, GtkArrowType etc.
+my @ArgFlags; # How the Arg can be used - readable/writable etc.
# These global hashes store declaration info keyed on a symbol name.
my %Declarations;
@@ -169,7 +169,7 @@ if (&CheckAllDeclarationsOutput) {
if ($changed || ! -e "$ROOT_DIR/tmpl.stamp") {
open (TIMESTAMP, ">$ROOT_DIR/tmpl.stamp")
- || die "Can't create $ROOT_DIR/tmpl.stamp";
+ || die "Can't create $ROOT_DIR/tmpl.stamp";
print (TIMESTAMP "timestamp");
close (TIMESTAMP);
}
@@ -177,8 +177,8 @@ if ($changed || ! -e "$ROOT_DIR/tmpl.stamp") {
#############################################################################
# Function : ReadExistingTemplates
# Description : This reads in all the existing documentation, into the global
-# variables %SymbolDocs, %SymbolTypes, and %SymbolParams (a
-# hash of arrays).
+# variables %SymbolDocs, %SymbolTypes, and %SymbolParams (a
+# hash of arrays).
# Arguments : none
#############################################################################
@@ -191,16 +191,16 @@ sub ReadExistingTemplates {
# (though this shouldn't happen often).
my $unused_doc = "$TMPL_DIR/$MODULE-unused.sgml";
if (-e $unused_doc) {
- &ReadTemplateFile ($unused_doc, 0);
+ &ReadTemplateFile ($unused_doc, 0);
}
while (<$TMPL_DIR/*.sgml>) {
-# print "Reading $_\n";
- if ($_ eq $unused_doc) {
-# print "skipping $unused_doc\n";
- } else {
- &ReadTemplateFile ($_, 0);
- }
+# print "Reading $_\n";
+ if ($_ eq $unused_doc) {
+# print "skipping $unused_doc\n";
+ } else {
+ &ReadTemplateFile ($_, 0);
+ }
}
}
@@ -208,7 +208,7 @@ sub ReadExistingTemplates {
#############################################################################
# Function : UpdateTemplates
# Description : This collects the output for each section of the docs, and
-# outputs each file when the end of the section is found.
+# outputs each file when the end of the section is found.
# Arguments : $file - the file containing the sections of the docs.
#############################################################################
@@ -217,12 +217,12 @@ sub UpdateTemplates {
# print "Reading: $file\n";
open (INPUT, $file)
- || die "Can't open $file";
+ || die "Can't open $file";
# Create the top output directory if it doesn't exist.
if (! -e $TMPL_DIR) {
- mkdir ("$TMPL_DIR", 0777)
- || die "Can't create directory: $TMPL_DIR";
+ mkdir ("$TMPL_DIR", 0777)
+ || die "Can't create directory: $TMPL_DIR";
}
my $filename = "";
@@ -231,69 +231,69 @@ sub UpdateTemplates {
my $output;
my $changed = 0;
while (<INPUT>) {
- if (m/^#/) {
- next;
+ if (m/^#/) {
+ next;
- } elsif (m/^<SECTION>/) {
- $output = "";
+ } elsif (m/^<SECTION>/) {
+ $output = "";
- } elsif (m/^<SUBSECTION\s*(.*)>/i) {
- $subsection = $1;
- next;
+ } elsif (m/^<SUBSECTION\s*(.*)>/i) {
+ $subsection = $1;
+ next;
- } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
- $title = $1;
-# print "Section: $title\n";
+ } elsif (m/^<TITLE>(.*)<\/TITLE>/) {
+ $title = $1;
+# print "Section: $title\n";
- } elsif (m/^<FILE>(.*)<\/FILE>/) {
- $filename = $1;
+ } elsif (m/^<FILE>(.*)<\/FILE>/) {
+ $filename = $1;
- } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
- next;
+ } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) {
+ next;
- } elsif (m/^<\/SECTION>/) {
- if ($title eq "") {
- $title = $filename;
- }
-# print "End of section: $title\n";
+ } elsif (m/^<\/SECTION>/) {
+ if ($title eq "") {
+ $title = $filename;
+ }
+# print "End of section: $title\n";
- $filename =~ s/\s/_/g;
- $filename .= ".sgml";
+ $filename =~ s/\s/_/g;
+ $filename .= ".sgml";
- if (&OutputTemplateFile ($filename, $title, \$output)) {
- $changed = 1;
- }
+ if (&OutputTemplateFile ($filename, $title, \$output)) {
+ $changed = 1;
+ }
- $title = "";
- $subsection = "";
+ $title = "";
+ $subsection = "";
- } elsif (m/^(\S+)/) {
- my $symbol = $1;
-# print " Symbol: $symbol\n";
+ } elsif (m/^(\S+)/) {
+ my $symbol = $1;
+# print " Symbol: $symbol\n";
- my $declaration = $Declarations{$1};
- if (defined ($declaration)) {
- # We don't want templates for standard macros/functions of
- # GObjects or private declarations.
- if ($subsection ne "Standard" && $subsection ne "Private") {
- $output .= &OutputDeclaration ($DeclarationTypes {$symbol},
- $symbol, $declaration);
+ my $declaration = $Declarations{$1};
+ if (defined ($declaration)) {
+ # We don't want templates for standard macros/functions of
+ # GObjects or private declarations.
+ if ($subsection ne "Standard" && $subsection ne "Private") {
+ $output .= &OutputDeclaration ($DeclarationTypes {$symbol},
+ $symbol, $declaration);
- $output .= &OutputSignalTemplates ($symbol);
- $output .= &OutputArgTemplates ($symbol);
- }
+ $output .= &OutputSignalTemplates ($symbol);
+ $output .= &OutputArgTemplates ($symbol);
+ }
- # Note that the declaration has been output.
- $DeclarationOutput{$symbol} = 1;
+ # Note that the declaration has been output.
+ $DeclarationOutput{$symbol} = 1;
- if ($declaration eq '##conditional##') {
-# print "Conditional $DeclarationTypes{$symbol}\n";
- }
+ if ($declaration eq '##conditional##') {
+# print "Conditional $DeclarationTypes{$symbol}\n";
+ }
- } else {
- &LogWarning ($file, $., "No declaration found for: $1");
- }
- }
+ } else {
+ &LogWarning ($file, $., "No declaration found for: $1");
+ }
+ }
}
close (INPUT);
@@ -304,10 +304,10 @@ sub UpdateTemplates {
#############################################################################
# Function : CheckAllDeclarationsOutput
# Description : This steps through all the declarations that were loaded, and
-# makes sure that each one has been output, by checking the
-# corresponding flag in the %DeclarationOutput hash. It is
-# intended to check that any new declarations in new versions
-# of the module get added to the $MODULE-sections.txt file.
+# makes sure that each one has been output, by checking the
+# corresponding flag in the %DeclarationOutput hash. It is
+# intended to check that any new declarations in new versions
+# of the module get added to the $MODULE-sections.txt file.
# Arguments : none
#############################################################################
@@ -318,13 +318,13 @@ sub CheckAllDeclarationsOutput {
my $new_unused_file = "$ROOT_DIR/$MODULE-unused.new";
open (UNUSED, ">$new_unused_file")
- || die "Can't open $new_unused_file";
+ || die "Can't open $new_unused_file";
my ($symbol);
foreach $symbol (sort keys (%Declarations)) {
- if (!defined ($DeclarationOutput{$symbol})) {
- print (UNUSED "$symbol\n");
- $num_unused++;
- }
+ if (!defined ($DeclarationOutput{$symbol})) {
+ print (UNUSED "$symbol\n");
+ $num_unused++;
+ }
}
close (UNUSED);
if ($num_unused != 0) {
@@ -339,11 +339,11 @@ sub CheckAllDeclarationsOutput {
#############################################################################
# Function : OutputDeclaration
# Description : This returns the template for one symbol & declaration.
-# Note that it uses the global %SymbolDocs and %SymbolParams to
-# lookup any existing documentation.
+# Note that it uses the global %SymbolDocs and %SymbolParams to
+# lookup any existing documentation.
# Arguments : $type - the type of the symbol ('FUNCTION'/'MACRO' etc.)
-# $symbol - the symbol name.
-# $declaration - the declaration of the symbol.
+# $symbol - the symbol name.
+# $declaration - the declaration of the symbol.
#############################################################################
sub OutputDeclaration {
@@ -356,11 +356,11 @@ sub OutputDeclaration {
my ($symbol_desc) = $SymbolDocs{$symbol};
my ($template_exists);
if (defined ($symbol_desc)) {
- $template_exists = 1;
- $symbol_desc =~ s/\s+$//;
+ $template_exists = 1;
+ $symbol_desc =~ s/\s+$//;
} else {
- $template_exists = 0;
- $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>";
+ $template_exists = 0;
+ $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>";
}
$output .= <<EOF;
@@ -372,37 +372,37 @@ EOF
# For functions, function typedefs and macros, we output the arguments.
# For functions and function typedefs we also output the return value.
if ($type eq "FUNCTION" || $type eq "USER_FUNCTION") {
- # Take out the return type
- $declaration =~ s/<RETURNS>\s*(.*?)<\/RETURNS>\n//;
- my $ret_type_decl = $1;
- my $ret_type_modifier;
- my $ret_type;
- my $ret_type_pointer;
+ # Take out the return type
+ $declaration =~ s/<RETURNS>\s*(.*?)<\/RETURNS>\n//;
+ my $ret_type_decl = $1;
+ my $ret_type_modifier;
+ my $ret_type;
+ my $ret_type_pointer;
if ($ret_type_decl =~ m/((const\s+|G_CONST_RETURN\s+|unsigned\s+|signed\s+|long\s+|short\s+|struct\s+|enum\s+)*)(\w+)\s*(\**\s*(const|G_CONST_RETURN)?\s*\**\s*(restrict)?\s*)/) {
- $ret_type_modifier = defined($1) ? $1 : "";
- $ret_type = $3;
- $ret_type_pointer = $4;
- } else {
- $ret_type = "void";
- }
-
- my @fields = ParseFunctionDeclaration($declaration);
-
- for (my $i = 0; $i <= $#fields; $i += 2) {
- my $field_name = $fields[$i];
- $output .= &OutputParam ($symbol, $field_name, $template_exists, 1, "");
- }
-
- if ($ret_type ne "void" || $ret_type_modifier || $ret_type_pointer) {
- $output .= &OutputParam ($symbol, "Returns", $template_exists, 1, "");
- }
-
- $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
- $output .= &OutputOldParams ($symbol);
- $output .= "\n";
+ $ret_type_modifier = defined($1) ? $1 : "";
+ $ret_type = $3;
+ $ret_type_pointer = $4;
+ } else {
+ $ret_type = "void";
+ }
+
+ my @fields = ParseFunctionDeclaration($declaration);
+
+ for (my $i = 0; $i <= $#fields; $i += 2) {
+ my $field_name = $fields[$i];
+ $output .= &OutputParam ($symbol, $field_name, $template_exists, 1, "");
+ }
+
+ if ($ret_type ne "void" || $ret_type_modifier || $ret_type_pointer) {
+ $output .= &OutputParam ($symbol, "Returns", $template_exists, 1, "");
+ }
+
+ $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
+ $output .= &OutputOldParams ($symbol);
+ $output .= "\n";
}
if ($type eq "MACRO") {
@@ -414,44 +414,44 @@ EOF
$output .= &OutputParam ($symbol, $field_name, $template_exists,
1, "");
}
- $output .= &OutputParam ($symbol, "Returns", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
- $output .= &OutputOldParams ($symbol);
- $output .= "\n";
+ $output .= &OutputParam ($symbol, "Returns", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
+ $output .= &OutputOldParams ($symbol);
+ $output .= "\n";
}
if ($type eq "STRUCT") {
- my $is_object_struct = CheckIsObject ($symbol);
- my @fields = ParseStructDeclaration($declaration, $is_object_struct, 1);
-
- for (my $i = 0; $i <= $#fields; $i += 2) {
- my $field_name = $fields[$i];
- $output .= &OutputParam ($symbol, $field_name, $template_exists, 1, "");
- }
- $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
+ my $is_object_struct = CheckIsObject ($symbol);
+ my @fields = ParseStructDeclaration($declaration, $is_object_struct, 1);
+
+ for (my $i = 0; $i <= $#fields; $i += 2) {
+ my $field_name = $fields[$i];
+ $output .= &OutputParam ($symbol, $field_name, $template_exists, 1, "");
+ }
+ $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
}
if ($type eq "ENUM") {
- my @members = ParseEnumDeclaration($declaration);
-
- for my $member (@members) {
- $output .= &OutputParam ($symbol, $member, $template_exists, 1, "");
- }
- $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
- $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
+ my @members = ParseEnumDeclaration($declaration);
+
+ for my $member (@members) {
+ $output .= &OutputParam ($symbol, $member, $template_exists, 1, "");
+ }
+ $output .= &OutputParam ($symbol, "Deprecated", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Since", $template_exists, 0, "");
+ $output .= &OutputParam ($symbol, "Stability", $template_exists, 0, "");
}
$output .= "\n";
# Remove the used docs from the hashes.
if ($template_exists) {
- delete $SymbolDocs{$symbol};
- delete $SymbolParams{$symbol};
+ delete $SymbolDocs{$symbol};
+ delete $SymbolParams{$symbol};
}
return $output;
@@ -461,57 +461,57 @@ EOF
#############################################################################
# Function : OutputParam
# Description : This outputs the part of a template for one parameter.
-# It first checks if the parameter is already described, and if
-# so it uses that description, and clears it so it isn't output
-# as an old param.
+# It first checks if the parameter is already described, and if
+# so it uses that description, and clears it so it isn't output
+# as an old param.
# Arguments : $symbol - the symbol (function or macro) name.
-# $param_to_output - the parameter to add.
-# $template_exists - TRUE if the template already existed in
-# template files. If it did, then we will flag any changes
-# with 'FIXME'.
-# $force_output - TRUE if the parameter should be output even
-# if it didn't already exist in the template. (The return
-# values of macros are added manually if required, and so we
-# never add it here - we only copy it if it already exists.)
-# $default_description - the default description of the
-# parameter to be used if it doesn't already exist. (Signal
-# handlers have a few common parameters.)
+# $param_to_output - the parameter to add.
+# $template_exists - TRUE if the template already existed in
+# template files. If it did, then we will flag any changes
+# with 'FIXME'.
+# $force_output - TRUE if the parameter should be output even
+# if it didn't already exist in the template. (The return
+# values of macros are added manually if required, and so we
+# never add it here - we only copy it if it already exists.)
+# $default_description - the default description of the
+# parameter to be used if it doesn't already exist. (Signal
+# handlers have a few common parameters.)
#############################################################################
sub OutputParam {
my ($symbol, $param_to_output, $template_exists,
- $force_output, $default_description) = @_;
+ $force_output, $default_description) = @_;
my ($j);
my ($params) = $SymbolParams{$symbol};
if (defined ($params)) {
- for ($j = 0; $j <= $#$params; $j += 2) {
- my $param_name = $$params[$j];
- my $param_desc = $$params[$j + 1];
-
- if ($param_name eq $param_to_output) {
- $param_desc =~ s/\s+$//;
- $$params[$j] = "";
- $$params[$j + 1] = "";
- return "\ $param_name: $param_desc\n";
- }
- }
+ for ($j = 0; $j <= $#$params; $j += 2) {
+ my $param_name = $$params[$j];
+ my $param_desc = $$params[$j + 1];
+
+ if ($param_name eq $param_to_output) {
+ $param_desc =~ s/\s+$//;
+ $$params[$j] = "";
+ $$params[$j + 1] = "";
+ return "\ $param_name: $param_desc\n";
+ }
+ }
}
# If the template was already in a file, flag the new parameter.
# If not, the template itself will be flagged, so we don't need to flag
# all the new parameters as well.
if ($force_output) {
- if ($default_description ne "") {
- $default_description =~ s/\s+$//;
- return "\ $param_to_output: $default_description\n";
- } else {
- if ($template_exists) {
- return "\ $param_to_output: $CHANGES_FLAG\n";
- } else {
- return "\ $param_to_output: \n";
- }
- }
+ if ($default_description ne "") {
+ $default_description =~ s/\s+$//;
+ return "\ $param_to_output: $default_description\n";
+ } else {
+ if ($template_exists) {
+ return "\ $param_to_output: $CHANGES_FLAG\n";
+ } else {
+ return "\ $param_to_output: \n";
+ }
+ }
}
return "";
}
@@ -520,8 +520,8 @@ sub OutputParam {
#############################################################################
# Function : OutputOldParams
# Description : This returns all the existing documentation for parameters of
-# the given function/macro/signal symbol which are unused, with
-# a comment before them.
+# the given function/macro/signal symbol which are unused, with
+# a comment before them.
# Arguments : $symbol - the symbol (function/macro/signal) name.
#############################################################################
@@ -531,23 +531,23 @@ sub OutputOldParams {
my ($params) = $SymbolParams{$symbol};
if (defined ($params)) {
- my $j;
- for ($j = 0; $j <= $#$params; $j += 2) {
- my $param_name = $$params[$j];
- my $param_desc = $$params[$j + 1];
-
- if ($param_name ne "") {
- $param_desc =~ s/\s+$//;
-
- # There's no point keeping it if it has no docs.
- if ($param_desc ne "") {
- $output .= "\ $param_name: $param_desc\n";
- }
- }
- }
+ my $j;
+ for ($j = 0; $j <= $#$params; $j += 2) {
+ my $param_name = $$params[$j];
+ my $param_desc = $$params[$j + 1];
+
+ if ($param_name ne "") {
+ $param_desc =~ s/\s+$//;
+
+ # There's no point keeping it if it has no docs.
+ if ($param_desc ne "") {
+ $output .= "\ $param_name: $param_desc\n";
+ }
+ }
+ }
}
if ($output) {
- $output = "<!-- # Unused Parameters # -->\n" . $output;
+ $output = "<!-- # Unused Parameters # -->\n" . $output;
}
return $output;
}
@@ -557,9 +557,9 @@ sub OutputOldParams {
# Function : OutputTemplateFile
# Description : This outputs one template file.
# Arguments : $file - the basename of the file to output.
-# $title - the title from the $MODULE-sections.txt file. This
-# will be overridden by any title given in the template file.
-# $output - reference to the templates to output.
+# $title - the title from the $MODULE-sections.txt file. This
+# will be overridden by any title given in the template file.
+# $output - reference to the templates to output.
#############################################################################
sub OutputTemplateFile {
@@ -568,38 +568,38 @@ sub OutputTemplateFile {
my ($short_desc, $long_desc, $see_also, $stability, $image);
if (defined ($SymbolDocs{"$TMPL_DIR/$file:Title"})) {
- $title = $SymbolDocs{"$TMPL_DIR/$file:Title"};
- delete $SymbolDocs{"$TMPL_DIR/$file:Title"};
+ $title = $SymbolDocs{"$TMPL_DIR/$file:Title"};
+ delete $SymbolDocs{"$TMPL_DIR/$file:Title"};
}
if (defined ($SymbolDocs{"$TMPL_DIR/$file:Short_Description"})) {
- $short_desc = $SymbolDocs{"$TMPL_DIR/$file:Short_Description"};
- delete $SymbolDocs{"$TMPL_DIR/$file:Short_Description"};
+ $short_desc = $SymbolDocs{"$TMPL_DIR/$file:Short_Description"};
+ delete $SymbolDocs{"$TMPL_DIR/$file:Short_Description"};
} else {
- $short_desc = "";
+ $short_desc = "";
}
if (defined ($SymbolDocs{"$TMPL_DIR/$file:Long_Description"})) {
- $long_desc = $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
- delete $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
+ $long_desc = $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
+ delete $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
} else {
- $long_desc = "<para>\n\n</para>\n";
+ $long_desc = "<para>\n\n</para>\n";
}
if (defined ($SymbolDocs{"$TMPL_DIR/$file:See_Also"})) {
- $see_also = $SymbolDocs{"$TMPL_DIR/$file:See_Also"};
- delete $SymbolDocs{"$TMPL_DIR/$file:See_Also"};
+ $see_also = $SymbolDocs{"$TMPL_DIR/$file:See_Also"};
+ delete $SymbolDocs{"$TMPL_DIR/$file:See_Also"};
} else {
- $see_also = "<para>\n\n</para>\n";
+ $see_also = "<para>\n\n</para>\n";
}
if (defined ($SymbolDocs{"$TMPL_DIR/$file:Stability_Level"})) {
- $stability = $SymbolDocs{"$TMPL_DIR/$file:Stability_Level"};
- delete $SymbolDocs{"$TMPL_DIR/$file:Stability_Level"};
+ $stability = $SymbolDocs{"$TMPL_DIR/$file:Stability_Level"};
+ delete $SymbolDocs{"$TMPL_DIR/$file:Stability_Level"};
} else {
- $stability = "";
+ $stability = "";
}
if (defined ($SymbolDocs{"$TMPL_DIR/$file:Image"})) {
- $image = $SymbolDocs{"$TMPL_DIR/$file:Image"};
- delete $SymbolDocs{"$TMPL_DIR/$file:Image"};
+ $image = $SymbolDocs{"$TMPL_DIR/$file:Image"};
+ delete $SymbolDocs{"$TMPL_DIR/$file:Image"};
} else {
- $image = "";
+ $image = "";
}
@@ -607,7 +607,7 @@ sub OutputTemplateFile {
my $new_tmpl_file = "$TMPL_DIR/$file.new";
open (OUTPUT, ">$new_tmpl_file")
- || die "Can't create $new_tmpl_file";
+ || die "Can't create $new_tmpl_file";
print (OUTPUT <<EOF);
<!-- ##### SECTION Title ##### -->
@@ -641,8 +641,8 @@ EOF
# Function : OutputSignalTemplates
# Description : Outputs templates for signal handlers.
# Arguments : $title - the title from the $MODULE-sections.txt file. If the
-# file is describing a GtkObject subclass, the title should
-# be the name of the class, e.g. 'GtkButton'.
+# file is describing a GtkObject subclass, the title should
+# be the name of the class, e.g. 'GtkButton'.
#############################################################################
sub OutputSignalTemplates {
@@ -651,65 +651,65 @@ sub OutputSignalTemplates {
my $output = "";
my ($i, $template_exists);
for ($i = 0; $i <= $#SignalObjects; $i++) {
- if ($SignalObjects[$i] eq $title) {
-# print "Found signal: $SignalObjects[$i]\n";
- my ($symbol) = "$SignalObjects[$i]::$SignalNames[$i]";
-
- # See if symbol already has a description.
- my ($symbol_desc) = $SymbolDocs{$symbol};
- if (defined ($symbol_desc)) {
- $template_exists = 1;
- $symbol_desc =~ s/\s+$//;
- delete $SymbolDocs{$symbol};
- } else {
- $template_exists = 0;
- $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>";
- }
-
- $output .= <<EOF;
+ if ($SignalObjects[$i] eq $title) {
+# print "Found signal: $SignalObjects[$i]\n";
+ my ($symbol) = "$SignalObjects[$i]::$SignalNames[$i]";
+
+ # See if symbol already has a description.
+ my ($symbol_desc) = $SymbolDocs{$symbol};
+ if (defined ($symbol_desc)) {
+ $template_exists = 1;
+ $symbol_desc =~ s/\s+$//;
+ delete $SymbolDocs{$symbol};
+ } else {
+ $template_exists = 0;
+ $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>";
+ }
+
+ $output .= <<EOF;
<!-- ##### SIGNAL $symbol ##### -->
$symbol_desc
EOF
- my $sourceparams = $SymbolParams{$symbol};
- my @params = split ("[,\n]", $SignalPrototypes[$i]);
- my ($j, $name);
- for ($j = 0; $j <= $#params; $j++) {
- my $param = $params[$j];
- $param =~ s/^\s+//;
- $param =~ s/\s*$//;
- if ($param =~ m/^\s*$/) { next; }
- if ($param =~ m/^void$/) { next; }
-
- if ($param =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)?\s*$/) {
- if (defined ($sourceparams)) {
- $name = $$sourceparams[2 * $j];
- } else {
- $name = $3;
- }
-
- if (!defined ($name)) {
- $name = "Param" . ($j + 1);
- }
-
- if ($j == 0) {
- $output .= &OutputParam ($symbol, $name,
- $template_exists, 1,
- "the object which received the signal.");
- } else {
- $output .= &OutputParam ($symbol, $name,
- $template_exists, 1, "");
- }
- }
- }
-
- if ($SignalReturns[$i] ne "void") {
- $output .= &OutputParam ($symbol, "Returns", $template_exists,
- 1, "");
- }
- $output .= &OutputOldParams ($symbol);
- $output .= "\n";
- }
+ my $sourceparams = $SymbolParams{$symbol};
+ my @params = split ("[,\n]", $SignalPrototypes[$i]);
+ my ($j, $name);
+ for ($j = 0; $j <= $#params; $j++) {
+ my $param = $params[$j];
+ $param =~ s/^\s+//;
+ $param =~ s/\s*$//;
+ if ($param =~ m/^\s*$/) { next; }
+ if ($param =~ m/^void$/) { next; }
+
+ if ($param =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)?\s*$/) {
+ if (defined ($sourceparams)) {
+ $name = $$sourceparams[2 * $j];
+ } else {
+ $name = $3;
+ }
+
+ if (!defined ($name)) {
+ $name = "Param" . ($j + 1);
+ }
+
+ if ($j == 0) {
+ $output .= &OutputParam ($symbol, $name,
+ $template_exists, 1,
+ "the object which received the signal.");
+ } else {
+ $output .= &OutputParam ($symbol, $name,
+ $template_exists, 1, "");
+ }
+ }
+ }
+
+ if ($SignalReturns[$i] ne "void") {
+ $output .= &OutputParam ($symbol, "Returns", $template_exists,
+ 1, "");
+ }
+ $output .= &OutputOldParams ($symbol);
+ $output .= "\n";
+ }
}
return $output;
}
@@ -719,8 +719,8 @@ EOF
# Function : OutputArgTemplates
# Description : Outputs templates for Args.
# Arguments : $title - the title from the $MODULE-sections.txt file. If the
-# file is describing a GtkObject subclass, the title should
-# be the name of the class, e.g. 'GtkButton'.
+# file is describing a GtkObject subclass, the title should
+# be the name of the class, e.g. 'GtkButton'.
#############################################################################
sub OutputArgTemplates {
@@ -729,26 +729,26 @@ sub OutputArgTemplates {
my $output = "";
my $i;
for ($i = 0; $i <= $#ArgObjects; $i++) {
- if ($ArgObjects[$i] eq $title) {
-# print "Found arg: $ArgObjects[$i]\n";
- # I've only used one colon so we don't clash with signals.
- my ($symbol) = "$ArgObjects[$i]:$ArgNames[$i]";
-
- # See if symbol already has a description.
- my ($symbol_desc) = $SymbolDocs{$symbol};
- if (defined ($symbol_desc)) {
- delete $SymbolDocs{$symbol};
- $symbol_desc =~ s/\s+$//;
- } else {
- $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>";
- }
-
- $output .= <<EOF;
+ if ($ArgObjects[$i] eq $title) {
+# print "Found arg: $ArgObjects[$i]\n";
+ # I've only used one colon so we don't clash with signals.
+ my ($symbol) = "$ArgObjects[$i]:$ArgNames[$i]";
+
+ # See if symbol already has a description.
+ my ($symbol_desc) = $SymbolDocs{$symbol};
+ if (defined ($symbol_desc)) {
+ delete $SymbolDocs{$symbol};
+ $symbol_desc =~ s/\s+$//;
+ } else {
+ $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>";
+ }
+
+ $output .= <<EOF;
<!-- ##### ARG $symbol ##### -->
$symbol_desc
EOF
- }
+ }
}
return $output;
}
@@ -765,20 +765,20 @@ sub OutputUnusedTemplates {
my ($new_unused_file) = "$TMPL_DIR/$MODULE-unused.new";
open (UNUSED, ">$new_unused_file")
- || die "Can't open file: $new_unused_file";
+ || die "Can't open file: $new_unused_file";
my $output = "";
my ($symbol, $symbol_desc);
for $symbol (sort keys %SymbolDocs) {
$symbol_desc = $SymbolDocs{$symbol};
-# print "Unused: $symbol\n";
+# print "Unused: $symbol\n";
- my $type = $SymbolTypes{$symbol};
- if (!defined ($type)) {
- $type = "UNKNOWN";
- &LogWarning ($SymbolSourceFile{$symbol},$SymbolSourceLine{$symbol}, "Unused symbol $symbol has unknown type.");
- }
+ my $type = $SymbolTypes{$symbol};
+ if (!defined ($type)) {
+ $type = "UNKNOWN";
+ &LogWarning ($SymbolSourceFile{$symbol},$SymbolSourceLine{$symbol}, "Unused symbol $symbol has unknown type.");
+ }
$output .= <<EOF;
<!-- ##### $type $symbol ##### -->
@@ -786,17 +786,17 @@ $symbol_desc
EOF
- my ($params) = $SymbolParams{$symbol};
- if (defined ($params)) {
- my $j;
- for ($j = 0; $j <= $#$params; $j += 2) {
- my $param_name = $$params[$j];
- my $param_desc = $$params[$j + 1];
- $param_desc =~ s/\s+$//;
- $output .= "\ $param_name: $param_desc\n";
- }
- }
- $output .= "\n";
+ my ($params) = $SymbolParams{$symbol};
+ if (defined ($params)) {
+ my $j;
+ for ($j = 0; $j <= $#$params; $j += 2) {
+ my $param_name = $$params[$j];
+ my $param_desc = $$params[$j + 1];
+ $param_desc =~ s/\s+$//;
+ $output .= "\ $param_name: $param_desc\n";
+ }
+ }
+ $output .= "\n";
}
print UNUSED $output;
@@ -807,109 +807,109 @@ EOF
#############################################################################
-# LIBRARY FUNCTIONS - These functions are used in both gtkdoc-mkdb and
-# gtkdoc-mktmpl and should eventually be moved to a
-# separate library.
+# LIBRARY FUNCTIONS - These functions are used in both gtkdoc-mkdb and
+# gtkdoc-mktmpl and should eventually be moved to a
+# separate library.
#############################################################################
#############################################################################
# Function : ReadDeclarationsFile
# Description : This reads in a file containing the function/macro/enum etc.
-# declarations.
+# declarations.
#
-# Note that in some cases there are several declarations with
-# the same name, e.g. for conditional macros. In this case we
-# set a flag in the %DeclarationConditional hash so the
-# declaration is not shown in the docs.
+# Note that in some cases there are several declarations with
+# the same name, e.g. for conditional macros. In this case we
+# set a flag in the %DeclarationConditional hash so the
+# declaration is not shown in the docs.
#
-# If a macro and a function have the same name, e.g. for
-# gtk_object_ref, the function declaration takes precedence.
+# If a macro and a function have the same name, e.g. for
+# gtk_object_ref, the function declaration takes precedence.
#
-# Some opaque structs are just declared with 'typedef struct
-# _name name;' in which case the declaration may be empty.
-# The structure may have been found later in the header, so
-# that overrides the empty declaration.
+# Some opaque structs are just declared with 'typedef struct
+# _name name;' in which case the declaration may be empty.
+# The structure may have been found later in the header, so
+# that overrides the empty declaration.
#
# Arguments : $file - the declarations file to read
-# $override - if declarations in this file should override
-# any current declaration.
+# $override - if declarations in this file should override
+# any current declaration.
#############################################################################
sub ReadDeclarationsFile {
my ($file, $override) = @_;
if ($override == 0) {
- %Declarations = ();
- %DeclarationTypes = ();
- %DeclarationConditional = ();
- %DeclarationOutput = ();
+ %Declarations = ();
+ %DeclarationTypes = ();
+ %DeclarationConditional = ();
+ %DeclarationOutput = ();
}
open (INPUT, $file)
- || die "Can't open $file";
+ || die "Can't open $file";
my $declaration_type = "";
my $declaration_name;
my $declaration;
while (<INPUT>) {
- if (!$declaration_type) {
- if (m/^<([^>]+)>/) {
- $declaration_type = $1;
- $declaration_name = "";
-# print "Found declaration: $declaration_type\n";
- $declaration = "";
- }
- } else {
- if (m%^<NAME>(.*)</NAME>%) {
- $declaration_name = $1;
- } elsif (m%<DEPRECATED/>%) {
+ if (!$declaration_type) {
+ if (m/^<([^>]+)>/) {
+ $declaration_type = $1;
+ $declaration_name = "";
+# print "Found declaration: $declaration_type\n";
+ $declaration = "";
+ }
+ } else {
+ if (m%^<NAME>(.*)</NAME>%) {
+ $declaration_name = $1;
+ } elsif (m%<DEPRECATED/>%) {
# do nothing, just skip the line; we handle this
# in mkdb
} elsif (m%^</$declaration_type>%) {
-# print "Found end of declaration: $declaration_name\n";
- # Check that the declaration has a name
- if ($declaration_name eq "") {
- print "ERROR: $declaration_type has no name $file:$.\n";
- }
-
- # Check if the symbol is already defined.
- if (defined ($Declarations{$declaration_name})
- && $override == 0) {
- # Function declarations take precedence.
- if ($DeclarationTypes{$declaration_name} eq 'FUNCTION') {
- # Ignore it.
- } elsif ($declaration_type eq 'FUNCTION') {
- $Declarations{$declaration_name} = $declaration;
- $DeclarationTypes{$declaration_name} = $declaration_type;
- } elsif ($DeclarationTypes{$declaration_name}
- eq $declaration_type) {
- # If the existing declaration is empty, or is just a
- # forward declaration of a struct, override it.
- if ($declaration_type eq 'STRUCT') {
- if ($Declarations{$declaration_name} =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
- $Declarations{$declaration_name} = $declaration;
- } elsif ($declaration =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
- # Ignore an empty or forward declaration.
- } else {
- &LogWarning ($file, $., "Structure $declaration_name has multiple definitions.");
- }
-
- } else {
- # set flag in %DeclarationConditional hash for
- # multiply defined macros/typedefs.
- $DeclarationConditional{$declaration_name} = 1;
- }
- } else {
- &LogWarning ($file, $., "$declaration_name has multiple definitions.");
- }
- } else {
- $Declarations{$declaration_name} = $declaration;
- $DeclarationTypes{$declaration_name} = $declaration_type;
- }
- $declaration_type = "";
- } else {
- $declaration .= $_;
- }
- }
+# print "Found end of declaration: $declaration_name\n";
+ # Check that the declaration has a name
+ if ($declaration_name eq "") {
+ print "ERROR: $declaration_type has no name $file:$.\n";
+ }
+
+ # Check if the symbol is already defined.
+ if (defined ($Declarations{$declaration_name})
+ && $override == 0) {
+ # Function declarations take precedence.
+ if ($DeclarationTypes{$declaration_name} eq 'FUNCTION') {
+ # Ignore it.
+ } elsif ($declaration_type eq 'FUNCTION') {
+ $Declarations{$declaration_name} = $declaration;
+ $DeclarationTypes{$declaration_name} = $declaration_type;
+ } elsif ($DeclarationTypes{$declaration_name}
+ eq $declaration_type) {
+ # If the existing declaration is empty, or is just a
+ # forward declaration of a struct, override it.
+ if ($declaration_type eq 'STRUCT') {
+ if ($Declarations{$declaration_name} =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
+ $Declarations{$declaration_name} = $declaration;
+ } elsif ($declaration =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) {
+ # Ignore an empty or forward declaration.
+ } else {
+ &LogWarning ($file, $., "Structure $declaration_name has multiple definitions.");
+ }
+
+ } else {
+ # set flag in %DeclarationConditional hash for
+ # multiply defined macros/typedefs.
+ $DeclarationConditional{$declaration_name} = 1;
+ }
+ } else {
+ &LogWarning ($file, $., "$declaration_name has multiple definitions.");
+ }
+ } else {
+ $Declarations{$declaration_name} = $declaration;
+ $DeclarationTypes{$declaration_name} = $declaration_type;
+ }
+ $declaration_type = "";
+ } else {
+ $declaration .= $_;
+ }
+ }
}
close (INPUT);
}
@@ -918,14 +918,14 @@ sub ReadDeclarationsFile {
#############################################################################
# Function : ReadSignalsFile
# Description : This reads in an existing file which contains information on
-# all GObject signals. It creates the arrays @SignalNames and
-# @SignalPrototypes containing info on the signals. The first
-# line of the SignalPrototype is the return type of the signal
-# handler. The remaining lines are the parameters passed to it.
-# The last parameter, "gpointer user_data" is always the same
-# so is not included.
+# all GObject signals. It creates the arrays @SignalNames and
+# @SignalPrototypes containing info on the signals. The first
+# line of the SignalPrototype is the return type of the signal
+# handler. The remaining lines are the parameters passed to it.
+# The last parameter, "gpointer user_data" is always the same
+# so is not included.
# Arguments : $file - the file containing the signal handler prototype
-# information.
+# information.
#############################################################################
sub ReadSignalsFile {
@@ -946,47 +946,47 @@ sub ReadSignalsFile {
@SignalPrototypes = ();
if (! -f $file) {
- return;
+ return;
}
if (!open (INPUT, $file)) {
- warn "Can't open $file - skipping signals\n";
- return;
+ warn "Can't open $file - skipping signals\n";
+ return;
}
while (<INPUT>) {
- if (!$in_signal) {
- if (m/^<SIGNAL>/) {
- $in_signal = 1;
- $signal_object = "";
- $signal_name = "";
- $signal_returns = "";
- $signal_prototype = "";
- }
- } else {
- if (m/^<NAME>(.*)<\/NAME>/) {
- $signal_name = $1;
- if ($signal_name =~ m/^(.*)::(.*)$/) {
- $signal_object = $1;
- ($signal_name = $2) =~ s/_/-/g;
-# print "Found signal: $signal_name\n";
- } else {
- print "Invalid signal name: $signal_name\n";
- }
- } elsif (m/^<RETURNS>(.*)<\/RETURNS>/) {
- $signal_returns = $1;
- } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
- $signal_flags = $1;
- } elsif (m%^</SIGNAL>%) {
-# print "Found end of signal: ${signal_object}::${signal_name}\nReturns: ${signal_returns}\n${signal_prototype}";
- push (@SignalObjects, $signal_object);
- push (@SignalNames, $signal_name);
- push (@SignalReturns, $signal_returns);
- push (@SignalFlags, $signal_flags);
- push (@SignalPrototypes, $signal_prototype);
- $in_signal = 0;
- } else {
- $signal_prototype .= $_;
- }
- }
+ if (!$in_signal) {
+ if (m/^<SIGNAL>/) {
+ $in_signal = 1;
+ $signal_object = "";
+ $signal_name = "";
+ $signal_returns = "";
+ $signal_prototype = "";
+ }
+ } else {
+ if (m/^<NAME>(.*)<\/NAME>/) {
+ $signal_name = $1;
+ if ($signal_name =~ m/^(.*)::(.*)$/) {
+ $signal_object = $1;
+ ($signal_name = $2) =~ s/_/-/g;
+# print "Found signal: $signal_name\n";
+ } else {
+ print "Invalid signal name: $signal_name\n";
+ }
+ } elsif (m/^<RETURNS>(.*)<\/RETURNS>/) {
+ $signal_returns = $1;
+ } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
+ $signal_flags = $1;
+ } elsif (m%^</SIGNAL>%) {
+# print "Found end of signal: ${signal_object}::${signal_name}\nReturns: ${signal_returns}\n${signal_prototype}";
+ push (@SignalObjects, $signal_object);
+ push (@SignalNames, $signal_name);
+ push (@SignalReturns, $signal_returns);
+ push (@SignalFlags, $signal_flags);
+ push (@SignalPrototypes, $signal_prototype);
+ $in_signal = 0;
+ } else {
+ $signal_prototype .= $_;
+ }
+ }
}
close (INPUT);
}
@@ -995,15 +995,15 @@ sub ReadSignalsFile {
#############################################################################
# Function : ReadTemplateFile
# Description : This reads in the manually-edited documentation file
-# corresponding to the file currently being created, so we can
-# insert the documentation at the appropriate places.
-# It outputs %SymbolTypes, %SymbolDocs and %SymbolParams, which
-# is a hash of arrays.
-# NOTE: This function is duplicated in gtkdoc-mkdb (but
-# slightly different).
+# corresponding to the file currently being created, so we can
+# insert the documentation at the appropriate places.
+# It outputs %SymbolTypes, %SymbolDocs and %SymbolParams, which
+# is a hash of arrays.
+# NOTE: This function is duplicated in gtkdoc-mkdb (but
+# slightly different).
# Arguments : $docsfile - the template file to read in.
-# $skip_unused_params - 1 if the unused parameters should be
-# skipped.
+# $skip_unused_params - 1 if the unused parameters should be
+# skipped.
#############################################################################
sub ReadTemplateFile {
@@ -1011,122 +1011,122 @@ sub ReadTemplateFile {
# print "Reading $docsfile\n";
if (! -f $docsfile) {
- print "File doesn't exist: $docsfile\n";
- return 0;
+ print "File doesn't exist: $docsfile\n";
+ return 0;
}
- my $CurrentType = ""; # Type of symbol being read.
- my $CurrentSymbol = ""; # Name of symbol being read.
- my $SymbolDoc = ""; # Description of symbol being read.
- my @Params; # Parameter names and descriptions of current
- # function/macro/function typedef.
- my $CurrentParam = -1; # Index of parameter currently being read.
- # Note that the param array contains pairs
- # of param name & description.
- my $InUnusedParameters = 0; # True if we are reading in the unused params.
+ my $CurrentType = ""; # Type of symbol being read.
+ my $CurrentSymbol = ""; # Name of symbol being read.
+ my $SymbolDoc = ""; # Description of symbol being read.
+ my @Params; # Parameter names and descriptions of current
+ # function/macro/function typedef.
+ my $CurrentParam = -1; # Index of parameter currently being read.
+ # Note that the param array contains pairs
+ # of param name & description.
+ my $InUnusedParameters = 0; # True if we are reading in the unused params.
open (DOCS, $docsfile)
- || die "Can't open file $docsfile: $!";
+ || die "Can't open file $docsfile: $!";
while (<DOCS>) {
- if (m/^<!-- ##### ([A-Z_]+) (\S+) ##### -->/) {
- my $type = $1;
- my $symbol = $2;
- if ($symbol eq "Title"
- || $symbol eq "Short_Description"
- || $symbol eq "Long_Description"
- || $symbol eq "See_Also"
- || $symbol eq "Stability_Level"
- || $symbol eq "Image") {
- $symbol = $docsfile . ":" . $symbol;
- }
-
- #print "Found symbol: $symbol\n";
- # Remember file and line for the symbol
- $SymbolSourceFile{$symbol} = $docsfile;
- $SymbolSourceLine{$symbol} = $.;
-
- # Canonicalize signal and argument names to have -, not _
- if ($type eq "ARG" || $type eq "SIGNAL") {
+ if (m/^<!-- ##### ([A-Z_]+) (\S+) ##### -->/) {
+ my $type = $1;
+ my $symbol = $2;
+ if ($symbol eq "Title"
+ || $symbol eq "Short_Description"
+ || $symbol eq "Long_Description"
+ || $symbol eq "See_Also"
+ || $symbol eq "Stability_Level"
+ || $symbol eq "Image") {
+ $symbol = $docsfile . ":" . $symbol;
+ }
+
+ #print "Found symbol: $symbol\n";
+ # Remember file and line for the symbol
+ $SymbolSourceFile{$symbol} = $docsfile;
+ $SymbolSourceLine{$symbol} = $.;
+
+ # Canonicalize signal and argument names to have -, not _
+ if ($type eq "ARG" || $type eq "SIGNAL") {
$symbol =~ s/_/-/g;
}
- # Store previous symbol, but remove any trailing blank lines.
- if ($CurrentSymbol ne "") {
- $SymbolDoc =~ s/\s+$//;
- $SymbolTypes{$CurrentSymbol} = $CurrentType;
- $SymbolDocs{$CurrentSymbol} = $SymbolDoc;
-
- if ($CurrentParam >= 0) {
- $SymbolParams{$CurrentSymbol} = [ @Params ];
- } else {
- # Delete any existing params in case we are overriding a
- # previously read template.
- delete $SymbolParams{$CurrentSymbol};
- }
- }
- $CurrentType = $type;
- $CurrentSymbol = $symbol;
- $CurrentParam = -1;
- $InUnusedParameters = 0;
- $SymbolDoc = "";
- @Params = ();
-
- } elsif (m/^<!-- # Unused Parameters # -->/) {
- $InUnusedParameters = 1;
- next;
-
- } else {
- # Workaround for an old bug that left a mess in the templates.
- # This happened with macros with args spread over several lines.
- if (m/^\ \\$/) {
- # Skip the next line.
- $_ = <DOCS>;
- next;
- }
-
- # Workaround for an old bug that left '@:' at start of lines.
- if (m/^\@:$/) {
- next;
- }
-
-
- # Check if param found. Need to handle "..." and "format...".
- if (s/^\@([\w\.]+):\040?//) {
- my $param_name = $1;
- # Allow variations of 'Returns'
- if ($param_name =~ m/^[Rr]eturns?$/) {
- $param_name = "Returns";
- }
-# print "Found param: $param_name\n";
- push (@Params, $param_name);
- push (@Params, $_);
- $CurrentParam += 2;
- next;
- }
-
- # When outputting the DocBook we skip unused parameters.
- if (!$InUnusedParameters || !$skip_unused_params) {
- if ($CurrentParam >= 0) {
- $Params[$CurrentParam] .= $_;
- } else {
- $SymbolDoc .= $_;
- }
- }
- }
+ # Store previous symbol, but remove any trailing blank lines.
+ if ($CurrentSymbol ne "") {
+ $SymbolDoc =~ s/\s+$//;
+ $SymbolTypes{$CurrentSymbol} = $CurrentType;
+ $SymbolDocs{$CurrentSymbol} = $SymbolDoc;
+
+ if ($CurrentParam >= 0) {
+ $SymbolParams{$CurrentSymbol} = [ @Params ];
+ } else {
+ # Delete any existing params in case we are overriding a
+ # previously read template.
+ delete $SymbolParams{$CurrentSymbol};
+ }
+ }
+ $CurrentType = $type;
+ $CurrentSymbol = $symbol;
+ $CurrentParam = -1;
+ $InUnusedParameters = 0;
+ $SymbolDoc = "";
+ @Params = ();
+
+ } elsif (m/^<!-- # Unused Parameters # -->/) {
+ $InUnusedParameters = 1;
+ next;
+
+ } else {
+ # Workaround for an old bug that left a mess in the templates.
+ # This happened with macros with args spread over several lines.
+ if (m/^\ \\$/) {
+ # Skip the next line.
+ $_ = <DOCS>;
+ next;
+ }
+
+ # Workaround for an old bug that left '@:' at start of lines.
+ if (m/^\@:$/) {
+ next;
+ }
+
+
+ # Check if param found. Need to handle "..." and "format...".
+ if (s/^\@([\w\.]+):\040?//) {
+ my $param_name = $1;
+ # Allow variations of 'Returns'
+ if ($param_name =~ m/^[Rr]eturns?$/) {
+ $param_name = "Returns";
+ }
+# print "Found param: $param_name\n";
+ push (@Params, $param_name);
+ push (@Params, $_);
+ $CurrentParam += 2;
+ next;
+ }
+
+ # When outputting the DocBook we skip unused parameters.
+ if (!$InUnusedParameters || !$skip_unused_params) {
+ if ($CurrentParam >= 0) {
+ $Params[$CurrentParam] .= $_;
+ } else {
+ $SymbolDoc .= $_;
+ }
+ }
+ }
}
# Remember to finish the current symbol doccs.
if ($CurrentSymbol ne "") {
- $SymbolDoc =~ s/\s+$//;
- $SymbolTypes{$CurrentSymbol} = $CurrentType;
- $SymbolDocs{$CurrentSymbol} = $SymbolDoc;
+ $SymbolDoc =~ s/\s+$//;
+ $SymbolTypes{$CurrentSymbol} = $CurrentType;
+ $SymbolDocs{$CurrentSymbol} = $SymbolDoc;
- if ($CurrentParam >= 0) {
- $SymbolParams{$CurrentSymbol} = [ @Params ];
- } else {
- delete $SymbolParams{$CurrentSymbol};
- }
+ if ($CurrentParam >= 0) {
+ $SymbolParams{$CurrentSymbol} = [ @Params ];
+ } else {
+ delete $SymbolParams{$CurrentSymbol};
+ }
}
close (DOCS);
@@ -1137,11 +1137,11 @@ sub ReadTemplateFile {
#############################################################################
# Function : ReadObjectHierarchy
# Description : This reads in the $MODULE-hierarchy.txt file containing all
-# the GtkObject subclasses described in this module (and their
-# ancestors).
-# It places them in the @Objects array, and places their level
-# in the widget hierarchy in the @ObjectLevels array, at the
-# same index. GtkObject, the root object, has a level of 1.
+# the GtkObject subclasses described in this module (and their
+# ancestors).
+# It places them in the @Objects array, and places their level
+# in the widget hierarchy in the @ObjectLevels array, at the
+# same index. GtkObject, the root object, has a level of 1.
#
# FIXME: the version in gtkdoc-mkdb also generates tree_index.sgml
# as it goes along, this should be split out into a separate
@@ -1155,20 +1155,20 @@ sub ReadObjectHierarchy {
@ObjectLevels = ();
if (! -f $OBJECT_TREE_FILE) {
- return;
+ return;
}
if (!open (INPUT, $OBJECT_TREE_FILE)) {
- warn "Can't open $OBJECT_TREE_FILE - skipping object tree\n";
- return;
+ warn "Can't open $OBJECT_TREE_FILE - skipping object tree\n";
+ return;
}
while (<INPUT>) {
if (m/\S+/) {
- my $object = $&;
- my $level = (length($`)) / 2 + 1;
+ my $object = $&;
+ my $level = (length($`)) / 2 + 1;
# print ("Level: $level Object: $object\n");
- push (@Objects, $object);
- push (@ObjectLevels, $level);
+ push (@Objects, $object);
+ push (@ObjectLevels, $level);
}
}
@@ -1179,8 +1179,8 @@ sub ReadObjectHierarchy {
#############################################################################
# Function : ReadArgsFile
# Description : This reads in an existing file which contains information on
-# all GObject args. It creates the arrays @ArgObjects, @ArgNames,
-# @ArgTypes and @ArgFlags containing info on the args.
+# all GObject args. It creates the arrays @ArgObjects, @ArgNames,
+# @ArgTypes and @ArgFlags containing info on the args.
# Arguments : $file - the file containing the arg information.
#############################################################################
@@ -1200,44 +1200,44 @@ sub ReadArgsFile {
@ArgFlags = ();
if (! -f $file) {
- return;
+ return;
}
if (!open (INPUT, $file)) {
- warn "Can't open $file - skipping args\n";
- return;
+ warn "Can't open $file - skipping args\n";
+ return;
}
while (<INPUT>) {
- if (!$in_arg) {
- if (m/^<ARG>/) {
- $in_arg = 1;
- $arg_object = "";
- $arg_name = "";
- $arg_type = "";
- $arg_flags = "";
- }
- } else {
- if (m/^<NAME>(.*)<\/NAME>/) {
- $arg_name = $1;
- if ($arg_name =~ m/^(.*)::(.*)$/) {
- $arg_object = $1;
- ($arg_name = $2) =~ s/_/-/g;
-# print "Found arg: $arg_name\n";
- } else {
- print "Invalid arg name: $arg_name\n";
- }
- } elsif (m/^<TYPE>(.*)<\/TYPE>/) {
- $arg_type = $1;
- } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
- $arg_flags = $1;
- } elsif (m%^</ARG>%) {
-# print "Found end of arg: ${arg_object}::${arg_name}\n${arg_type} : ${arg_flags}\n";
- push (@ArgObjects, $arg_object);
- push (@ArgNames, $arg_name);
- push (@ArgTypes, $arg_type);
- push (@ArgFlags, $arg_flags);
- $in_arg = 0;
- }
- }
+ if (!$in_arg) {
+ if (m/^<ARG>/) {
+ $in_arg = 1;
+ $arg_object = "";
+ $arg_name = "";
+ $arg_type = "";
+ $arg_flags = "";
+ }
+ } else {
+ if (m/^<NAME>(.*)<\/NAME>/) {
+ $arg_name = $1;
+ if ($arg_name =~ m/^(.*)::(.*)$/) {
+ $arg_object = $1;
+ ($arg_name = $2) =~ s/_/-/g;
+# print "Found arg: $arg_name\n";
+ } else {
+ print "Invalid arg name: $arg_name\n";
+ }
+ } elsif (m/^<TYPE>(.*)<\/TYPE>/) {
+ $arg_type = $1;
+ } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) {
+ $arg_flags = $1;
+ } elsif (m%^</ARG>%) {
+# print "Found end of arg: ${arg_object}::${arg_name}\n${arg_type} : ${arg_flags}\n";
+ push (@ArgObjects, $arg_object);
+ push (@ArgNames, $arg_name);
+ push (@ArgTypes, $arg_type);
+ push (@ArgFlags, $arg_flags);
+ $in_arg = 0;
+ }
+ }
}
close (INPUT);
}
@@ -1246,9 +1246,9 @@ sub ReadArgsFile {
#############################################################################
# Function : CheckIsObject
# Description : Returns 1 if the given name is a GObject or a subclass.
-# It uses the global @Objects array.
-# Note that the @Objects array only contains classes in the
-# current module and their ancestors - not all GObject classes.
+# It uses the global @Objects array.
+# Note that the @Objects array only contains classes in the
+# current module and their ancestors - not all GObject classes.
# Arguments : $name - the name to check.
#############################################################################
@@ -1257,9 +1257,9 @@ sub CheckIsObject {
my $object;
foreach $object (@Objects) {
- if ($object eq $name) {
- return 1;
- }
+ if ($object eq $name) {
+ return 1;
+ }
}
return 0;
}
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index d9942d8..a5a4238 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -22,18 +22,18 @@
#############################################################################
# Script : gtkdoc-scan
# Description : Extracts declarations of functions, macros, enums, structs
-# and unions from header files.
+# and unions from header files.
#
-# It is called with a module name, an optional source directory,
-# an optional output directory, and the header files to scan.
+# It is called with a module name, an optional source directory,
+# an optional output directory, and the header files to scan.
#
-# It outputs all declarations found to a file named
-# '$MODULE-decl.txt', and the list of decarations to another
-# file '$MODULE-decl-list.txt'.
+# It outputs all declarations found to a file named
+# '$MODULE-decl.txt', and the list of decarations to another
+# file '$MODULE-decl-list.txt'.
#
-# This second list file is typically copied to
-# '$MODULE-sections.txt' and organized into sections ready to
-# output the SGML pages.
+# This second list file is typically copied to
+# '$MODULE-sections.txt' and organized into sections ready to
+# output the SGML pages.
#############################################################################
use strict;
@@ -62,18 +62,18 @@ my $DEPRECATED_GUARDS;
my $IGNORE_DECORATORS;
my %optctl = (module => \$MODULE,
- 'source-dir' => \ SOURCE_DIRS,
- 'ignore-headers' => \$IGNORE_HEADERS,
- 'output-dir' => \$OUTPUT_DIR,
- 'rebuild-types' => \$REBUILD_TYPES,
+ 'source-dir' => \ SOURCE_DIRS,
+ 'ignore-headers' => \$IGNORE_HEADERS,
+ 'output-dir' => \$OUTPUT_DIR,
+ 'rebuild-types' => \$REBUILD_TYPES,
'rebuild-sections' => \$REBUILD_SECTIONS,
- 'version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP,
- 'deprecated-guards' => \$DEPRECATED_GUARDS,
- 'ignore-decorators' => \$IGNORE_DECORATORS);
+ 'version' => \$PRINT_VERSION,
+ 'help' => \$PRINT_HELP,
+ 'deprecated-guards' => \$DEPRECATED_GUARDS,
+ 'ignore-decorators' => \$IGNORE_DECORATORS);
GetOptions(\%optctl, "module=s", "source-dir:s", "ignore-headers:s",
- "output-dir:s", "rebuild-types", "rebuild-sections", "version",
- "help", "deprecated-guards:s", "ignore-decorators:s");
+ "output-dir:s", "rebuild-types", "rebuild-sections", "version",
+ "help", "deprecated-guards:s", "ignore-decorators:s");
if ($PRINT_VERSION) {
print "@VERSION \n";
@@ -135,7 +135,7 @@ open (DECL, ">$new_decl")
|| die "Can't open $new_decl";
if ($REBUILD_TYPES) {
open (TYPES, ">$new_types")
- || die "Can't open $new_types";
+ || die "Can't open $new_types";
}
my $main_list = "";
@@ -200,9 +200,9 @@ if (! -e $overrides_file) {
# Description : This scans a directory tree looking for header files.
#
# Arguments : $source_dir - the directory to scan.
-# $object_list - a reference to the list of object functions &
-# declarations.
-# $main_list - a reference to the list of other declarations.
+# $object_list - a reference to the list of object functions &
+# declarations.
+# $main_list - a reference to the list of other declarations.
#############################################################################
sub ScanHeaders {
@@ -213,24 +213,24 @@ sub ScanHeaders {
my (@subdirs) = ();
opendir (SRCDIR, $source_dir)
- || die "Can't open source directory $source_dir: $!";
+ || die "Can't open source directory $source_dir: $!";
my $file;
foreach $file (readdir (SRCDIR)) {
- if ($file eq '.' || $file eq '..' || $file =~ /^\./) {
- next;
- } elsif (-d "$source_dir/$file") {
- push (@subdirs, $file);
- } elsif ($file =~ m/\.h$/) {
- &ScanHeader ("$source_dir/$file", $object_list, $main_list);
- }
+ if ($file eq '.' || $file eq '..' || $file =~ /^\./) {
+ next;
+ } elsif (-d "$source_dir/$file") {
+ push (@subdirs, $file);
+ } elsif ($file =~ m/\.h$/) {
+ &ScanHeader ("$source_dir/$file", $object_list, $main_list);
+ }
}
closedir (SRCDIR);
# Now recursively scan the subdirectories.
my $dir;
foreach $dir (@subdirs) {
- next if ($IGNORE_HEADERS =~ m/(\s|^)\Q${dir}\E(\s|$)/);
- &ScanHeaders ("$source_dir/$dir", $object_list, $main_list);
+ next if ($IGNORE_HEADERS =~ m/(\s|^)\Q${dir}\E(\s|$)/);
+ &ScanHeaders ("$source_dir/$dir", $object_list, $main_list);
}
}
@@ -238,40 +238,40 @@ sub ScanHeaders {
#############################################################################
# Function : ScanHeader
# Description : This scans a header file, looking for declarations of
-# functions, macros, typedefs, structs and unions, which it
-# outputs to the DECL file.
+# functions, macros, typedefs, structs and unions, which it
+# outputs to the DECL file.
# Arguments : $input_file - the header file to scan.
-# $object_list - a reference to the list of object functions &
-# declarations.
-# $main_list - a reference to the list of other declarations.
+# $object_list - a reference to the list of object functions &
+# declarations.
+# $main_list - a reference to the list of other declarations.
# Returns : it adds declarations to the appropriate list.
#############################################################################
sub ScanHeader {
my ($input_file, $object_list, $main_list) = @_;
- my $list = ""; # Holds the resulting list of declarations.
- my ($in_comment) = 0; # True if we are in a comment.
- my ($in_declaration) = ""; # The type of declaration we are in, e.g.
- # 'function' or 'macro'.
- my ($skip_block) = 0; # True if we should skip a block.
- my ($symbol); # The current symbol being declared.
- my ($decl); # Holds the declaration of the current symbol.
- my ($ret_type); # For functions and function typedefs this
- # holds the function's return type.
+ my $list = ""; # Holds the resulting list of declarations.
+ my ($in_comment) = 0; # True if we are in a comment.
+ my ($in_declaration) = ""; # The type of declaration we are in, e.g.
+ # 'function' or 'macro'.
+ my ($skip_block) = 0; # True if we should skip a block.
+ my ($symbol); # The current symbol being declared.
+ my ($decl); # Holds the declaration of the current symbol.
+ my ($ret_type); # For functions and function typedefs this
+ # holds the function's return type.
my ($pre_previous_line) = ""; # The pre-previous line read in - some Gnome
- # functions have the return type on one
- # line, the function name on the next,
- # and the rest of the declaration after.
- my ($previous_line) = ""; # The previous line read in - some Gnome
- # functions have the return type on one line
- # and the rest of the declaration after.
- my ($first_macro) = 1; # Used to try to skip the standard #ifdef XXX
- # #define XXX at the start of headers.
- my ($level); # Used to handle structs/unions which contain
- # nested structs or unions.
- my @objects = (); # Holds declarations that look like GtkObject
- # subclasses, which we remove from the list.
+ # functions have the return type on one
+ # line, the function name on the next,
+ # and the rest of the declaration after.
+ my ($previous_line) = ""; # The previous line read in - some Gnome
+ # functions have the return type on one line
+ # and the rest of the declaration after.
+ my ($first_macro) = 1; # Used to try to skip the standard #ifdef XXX
+ # #define XXX at the start of headers.
+ my ($level); # Used to handle structs/unions which contain
+ # nested structs or unions.
+ my @objects = (); # Holds declarations that look like GtkObject
+ # subclasses, which we remove from the list.
my ($internal) = 0; # Set to 1 for internal symbols, we need to
# fully parse, but don't add them to docs
my %forward_decls = (); # hashtable of forward declarations, we skip
@@ -294,42 +294,42 @@ sub ScanHeader {
$seen_headers{$canonical_input_file} = 1;
if ($input_file =~ m/^.*[\/\\](.*)\.h+$/) {
- $file_basename = $1;
+ $file_basename = $1;
} else {
- LogWarning(__FILE__,__LINE__,"Can't find basename of file $input_file");
- $file_basename = $input_file;
+ LogWarning(__FILE__,__LINE__,"Can't find basename of file $input_file");
+ $file_basename = $input_file;
}
# Check if the basename is in the list of headers to ignore.
if ($IGNORE_HEADERS =~ m/(\s|^)\Q${file_basename}\E\.h(\s|$)/) {
- @TRACE@("File ignored: $input_file");
- return;
+ @TRACE@("File ignored: $input_file");
+ return;
}
if (! -f $input_file) {
- LogWarning(__FILE__,__LINE__,"File doesn't exist: $input_file");
- return;
+ LogWarning(__FILE__,__LINE__,"File doesn't exist: $input_file");
+ return;
}
@TRACE@("Scanning $input_file");
open(INPUT, $input_file)
- || die "Can't open $input_file: $!";
+ || die "Can't open $input_file: $!";
while(<INPUT>) {
- # If this is a private header, skip it.
- if (m%^\s*/\*\s*<\s*private_header\s*>\s*\*/%) {
- close(INPUT);
- return;
- }
-
- # Skip to the end of the current comment.
- if ($in_comment) {
- @TRACE@("Comment: $_");
- if (m%\*/%) {
- $in_comment = 0;
- }
- next;
- }
+ # If this is a private header, skip it.
+ if (m%^\s*/\*\s*<\s*private_header\s*>\s*\*/%) {
+ close(INPUT);
+ return;
+ }
+
+ # Skip to the end of the current comment.
+ if ($in_comment) {
+ @TRACE@("Comment: $_");
+ if (m%\*/%) {
+ $in_comment = 0;
+ }
+ next;
+ }
# Keep a count of #if, #ifdef, #ifndef nesting,
# and if we enter a deprecation-symbol-bracketed
@@ -373,76 +373,76 @@ sub ScanHeader {
next;
}
- if (!$in_declaration) {
- # Skip top-level comments.
- if (s%^\s*/\*%%) {
- if (m%\*/%) {
- @TRACE@("Found one-line comment: $_");
- } else {
- $in_comment = 1;
- @TRACE@("Found start of comment: $_");
- }
- next;
- }
+ if (!$in_declaration) {
+ # Skip top-level comments.
+ if (s%^\s*/\*%%) {
+ if (m%\*/%) {
+ @TRACE@("Found one-line comment: $_");
+ } else {
+ $in_comment = 1;
+ @TRACE@("Found start of comment: $_");
+ }
+ next;
+ }
@TRACE@("0: $_");
- # MACROS
-
- if (m/^\s*#\s*define\s+(\w+)/) {
- $symbol = $1;
- $decl = $_;
- # We assume all macros which start with '_' are private, but
- # we accept '_' itself which is the standard gettext macro.
- # We also try to skip the first macro if it looks like the
- # standard #ifndef HEADER_FILE #define HEADER_FILE etc.
- # And we only want TRUE & FALSE defined in GLib (libdefs.h in
- # libgnome also defines them if they are not already defined).
- if (($symbol !~ m/^_/
- && ($previous_line !~ m/#ifndef\s+$symbol/
- || $first_macro == 0)
- && (($symbol ne 'TRUE' && $symbol ne 'FALSE')
- || $MODULE eq 'glib'))
- || $symbol eq "_") {
- $in_declaration = "macro";
- @TRACE@("Macro: $symbol");
- } else {
- @TRACE@("skipping Macro: $symbol");
- $in_declaration = "macro";
- $internal = 1;
- }
- $first_macro = 0;
-
-
- # TYPEDEF'D FUNCTIONS (i.e. user functions)
+ # MACROS
+
+ if (m/^\s*#\s*define\s+(\w+)/) {
+ $symbol = $1;
+ $decl = $_;
+ # We assume all macros which start with '_' are private, but
+ # we accept '_' itself which is the standard gettext macro.
+ # We also try to skip the first macro if it looks like the
+ # standard #ifndef HEADER_FILE #define HEADER_FILE etc.
+ # And we only want TRUE & FALSE defined in GLib (libdefs.h in
+ # libgnome also defines them if they are not already defined).
+ if (($symbol !~ m/^_/
+ && ($previous_line !~ m/#ifndef\s+$symbol/
+ || $first_macro == 0)
+ && (($symbol ne 'TRUE' && $symbol ne 'FALSE')
+ || $MODULE eq 'glib'))
+ || $symbol eq "_") {
+ $in_declaration = "macro";
+ @TRACE@("Macro: $symbol");
+ } else {
+ @TRACE@("skipping Macro: $symbol");
+ $in_declaration = "macro";
+ $internal = 1;
+ }
+ $first_macro = 0;
+
+
+ # TYPEDEF'D FUNCTIONS (i.e. user functions)
# $1 $3 $4 $5
- } elsif (m/^\s*typedef\s+((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/) {
- my $p3 = defined($3) ? $3 : "";
- $ret_type = "$1$p3 $4";
- $symbol = $5;
- $decl = $';
- $in_declaration = "user_function";
- @TRACE@("user function (1): $symbol, Returns: $ret_type");
+ } elsif (m/^\s*typedef\s+((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/) {
+ my $p3 = defined($3) ? $3 : "";
+ $ret_type = "$1$p3 $4";
+ $symbol = $5;
+ $decl = $';
+ $in_declaration = "user_function";
+ @TRACE@("user function (1): $symbol, Returns: $ret_type");
# $1 $3 $4 $5
- } elsif (($previous_line =~ m/^\s*typedef\s*/) && m/^\s*((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/) {
- my $p3 = defined($3) ? $3 : "";
- $ret_type = "$1$p3 $4";
- $symbol = $5;
- $decl = $';
- $in_declaration = "user_function";
- @TRACE@("user function (2): $symbol, Returns: $ret_type");
+ } elsif (($previous_line =~ m/^\s*typedef\s*/) && m/^\s*((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/) {
+ my $p3 = defined($3) ? $3 : "";
+ $ret_type = "$1$p3 $4";
+ $symbol = $5;
+ $decl = $';
+ $in_declaration = "user_function";
+ @TRACE@("user function (2): $symbol, Returns: $ret_type");
# $1 $2
- } elsif (($previous_line =~ m/^\s*typedef\s*/) && m/^\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/) {
- $ret_type = $1;
- $symbol = $2;
- $decl = $';
- # $1 $3
- if ($previous_line =~ m/^\s*typedef\s*((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*/) {
- my $p3 = defined($3) ? $3 : "";
- $ret_type = "$1$p3 ".$ret_type;
+ } elsif (($previous_line =~ m/^\s*typedef\s*/) && m/^\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/) {
+ $ret_type = $1;
+ $symbol = $2;
+ $decl = $';
+ # $1 $3
+ if ($previous_line =~ m/^\s*typedef\s*((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*/) {
+ my $p3 = defined($3) ? $3 : "";
+ $ret_type = "$1$p3 ".$ret_type;
$in_declaration = "user_function";
@TRACE@("user function (3): $symbol, Returns: $ret_type");
@@ -450,138 +450,138 @@ sub ScanHeader {
# FUNCTION POINTER VARIABLES
# $1 $3 $4 $5
} elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((const\s+|G_CONST_RETURN\s+)?\w+)(\s+const)?\s*(\**)\s*\(\*\s*(\w+)\)\s*\(/o) {
- my $p3 = defined($3) ? $3 : "";
- $ret_type = "$1$p3 $4";
- $symbol = $5;
+ my $p3 = defined($3) ? $3 : "";
+ $ret_type = "$1$p3 $4";
+ $symbol = $5;
$decl = $';
$in_declaration = "user_function";
@TRACE@("function pointer variable: $symbol, Returns: $ret_type");
- # ENUMS
-
- } elsif (s/^\s*enum\s+_(\w+)\s+\{/enum $1 {/) {
- # We assume that 'enum _<enum_name> {' is really the
- # declaration of enum <enum_name>.
- $symbol = $1;
- @TRACE@("plain enum: $symbol");
- $decl = $_;
- $in_declaration = "enum";
-
- } elsif (m/^\s*typedef\s+enum\s+_?(\w+)\s+\1\s*;/) {
- # We skip 'typedef enum <enum_name> _<enum_name>;' as the enum will
- # be declared elsewhere.
- @TRACE@("skipping enum typedef: $1");
-
- } elsif (m/^\s*typedef\s+enum/) {
- $symbol = "";
- @TRACE@("typedef enum: -");
- $decl = $_;
- $in_declaration = "enum";
-
-
- # STRUCTS AND UNIONS
-
- } elsif (m/^\s*typedef\s+(struct|union)\s+_(\w+)\s+\2\s*;/) {
- # We've found a 'typedef struct _<name> <name>;'
- # This could be an opaque data structure, so we output an
- # empty declaration. If the structure is actually found that
- # will override this.
- my $structsym = uc $1;
- @TRACE@("$structsym typedef: $2");
- $forward_decls{$2} = "<$structsym>\n<NAME>$2</NAME>\n$deprecated</$structsym>\n"
-
- } elsif (m/^\s*(?:struct|union)\s+_(\w+)\s*;/) {
- # Skip private structs/unions.
+ # ENUMS
+
+ } elsif (s/^\s*enum\s+_(\w+)\s+\{/enum $1 {/) {
+ # We assume that 'enum _<enum_name> {' is really the
+ # declaration of enum <enum_name>.
+ $symbol = $1;
+ @TRACE@("plain enum: $symbol");
+ $decl = $_;
+ $in_declaration = "enum";
+
+ } elsif (m/^\s*typedef\s+enum\s+_?(\w+)\s+\1\s*;/) {
+ # We skip 'typedef enum <enum_name> _<enum_name>;' as the enum will
+ # be declared elsewhere.
+ @TRACE@("skipping enum typedef: $1");
+
+ } elsif (m/^\s*typedef\s+enum/) {
+ $symbol = "";
+ @TRACE@("typedef enum: -");
+ $decl = $_;
+ $in_declaration = "enum";
+
+
+ # STRUCTS AND UNIONS
+
+ } elsif (m/^\s*typedef\s+(struct|union)\s+_(\w+)\s+\2\s*;/) {
+ # We've found a 'typedef struct _<name> <name>;'
+ # This could be an opaque data structure, so we output an
+ # empty declaration. If the structure is actually found that
+ # will override this.
+ my $structsym = uc $1;
+ @TRACE@("$structsym typedef: $2");
+ $forward_decls{$2} = "<$structsym>\n<NAME>$2</NAME>\n$deprecated</$structsym>\n"
+
+ } elsif (m/^\s*(?:struct|union)\s+_(\w+)\s*;/) {
+ # Skip private structs/unions.
@TRACE@("private struct/union");
- } elsif (m/^\s*(struct|union)\s+(\w+)\s*;/) {
- # Do a similar thing for normal structs as for typedefs above.
- # But we output the declaration as well in this case, so we
- # can differentiate it from a typedef.
- my $structsym = uc $1;
- @TRACE@("$structsym: $2");
+ } elsif (m/^\s*(struct|union)\s+(\w+)\s*;/) {
+ # Do a similar thing for normal structs as for typedefs above.
+ # But we output the declaration as well in this case, so we
+ # can differentiate it from a typedef.
+ my $structsym = uc $1;
+ @TRACE@("$structsym: $2");
$forward_decls{$2} = "<$structsym>\n<NAME>$2</NAME>\n$_$deprecated</$structsym>\n";
- } elsif (m/^\s*typedef\s+(struct|union)\s*\w*\s*{/) {
- $symbol = "";
- $decl = $_;
- $level = 0;
- $in_declaration = $1;
- @TRACE@("typedef struct/union $1");
-
- # OTHER TYPEDEFS
-
- } elsif (m/^\s*typedef\s+(?:struct|union)\s+\w+[\s\*]+(\w+)\s*;/) {
- @TRACE@("Found struct/union(*) typedef $1: $_");
- if (&AddSymbolToList (\$list, $1)) {
- print DECL "<TYPEDEF>\n<NAME>$1</NAME>\n$deprecated$_</TYPEDEF>\n";
- }
-
- } elsif (m/^\s*(G_GNUC_EXTENSION\s+)?typedef\s+(.+[\s\*])(\w+)(\s*\[[^\]]+\])*\s*;/) {
- if ($2 !~ m/^struct\s/ && $2 !~ m/^union\s/) {
- @TRACE@("Found typedef: $_");
- if (&AddSymbolToList (\$list, $3)) {
- print DECL "<TYPEDEF>\n<NAME>$3</NAME>\n$deprecated$_</TYPEDEF>\n";
- }
- }
- } elsif (m/^\s*typedef\s+/) {
- @TRACE@("Skipping typedef: $_");
-
-
- # VARIABLES (extern'ed variables)
-
- } elsif (m/^\s*(extern|[A-Za-z_]+VAR)\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*;/) {
- $symbol = $5;
- s/^\s*([A-Za-z_]+VAR)\b/extern/;
- @TRACE@("Possible extern: $_");
- if (&AddSymbolToList (\$list, $symbol)) {
- print DECL "<VARIABLE>\n<NAME>$symbol</NAME>\n$deprecated$_</VARIABLE>\n";
- }
-
-
- # FUNCTIONS
-
- # We assume that functions which start with '_' are private, so
- # we skip them.
- # $1 $2 $3
- } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+)((?:\s+|\*)+(?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*(_[A-Za-z]\w*)\s*\(/o) {
- $ret_type = $1;
- if (defined ($2)) { $ret_type .= " $2"; }
- $symbol = $3;
- $decl = $';
- @TRACE@("internal Function: $symbol, Returns: [$1][$2]");
- $in_declaration = "function";
- $internal = 1;
- if (m/^\s*G_INLINE_FUNC/) {
- @TRACE@("skip block after inline function");
- # now we we need to skip a whole { } block
- $skip_block = 1;
- }
-
- # $1 $2 $3
- } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+)((?:\s+|\*)+(?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*([A-Za-z]\w*)\s*\(/o) {
- $ret_type = $1;
- if (defined ($2)) { $ret_type .= " $2"; }
- $symbol = $3;
- $decl = $';
- @TRACE@("Function (1): $symbol, Returns: [$1][$2]");
- $in_declaration = "function";
- if (m/^\s*G_INLINE_FUNC/) {
- @TRACE@("skip block after inline function");
- # now we we need to skip a whole { } block
- $skip_block = 1;
- }
-
- # Try to catch function declarations which have the return type on
- # the previous line. But we don't want to catch complete functions
- # which have been declared G_INLINE_FUNC, e.g. g_bit_nth_lsf in
- # glib, or 'static inline' functions.
- } elsif (m/^\s*([A-Za-z]\w*)\s*\(/) {
- $symbol = $1;
- $decl = $';
-
- if ($previous_line !~ m/^\s*G_INLINE_FUNC/) {
- if ($previous_line !~ m/^\s*static\s+/) {
+ } elsif (m/^\s*typedef\s+(struct|union)\s*\w*\s*{/) {
+ $symbol = "";
+ $decl = $_;
+ $level = 0;
+ $in_declaration = $1;
+ @TRACE@("typedef struct/union $1");
+
+ # OTHER TYPEDEFS
+
+ } elsif (m/^\s*typedef\s+(?:struct|union)\s+\w+[\s\*]+(\w+)\s*;/) {
+ @TRACE@("Found struct/union(*) typedef $1: $_");
+ if (&AddSymbolToList (\$list, $1)) {
+ print DECL "<TYPEDEF>\n<NAME>$1</NAME>\n$deprecated$_</TYPEDEF>\n";
+ }
+
+ } elsif (m/^\s*(G_GNUC_EXTENSION\s+)?typedef\s+(.+[\s\*])(\w+)(\s*\[[^\]]+\])*\s*;/) {
+ if ($2 !~ m/^struct\s/ && $2 !~ m/^union\s/) {
+ @TRACE@("Found typedef: $_");
+ if (&AddSymbolToList (\$list, $3)) {
+ print DECL "<TYPEDEF>\n<NAME>$3</NAME>\n$deprecated$_</TYPEDEF>\n";
+ }
+ }
+ } elsif (m/^\s*typedef\s+/) {
+ @TRACE@("Skipping typedef: $_");
+
+
+ # VARIABLES (extern'ed variables)
+
+ } elsif (m/^\s*(extern|[A-Za-z_]+VAR)\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*;/) {
+ $symbol = $5;
+ s/^\s*([A-Za-z_]+VAR)\b/extern/;
+ @TRACE@("Possible extern: $_");
+ if (&AddSymbolToList (\$list, $symbol)) {
+ print DECL "<VARIABLE>\n<NAME>$symbol</NAME>\n$deprecated$_</VARIABLE>\n";
+ }
+
+
+ # FUNCTIONS
+
+ # We assume that functions which start with '_' are private, so
+ # we skip them.
+ # $1 $2 $3
+ } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+)((?:\s+|\*)+(?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*(_[A-Za-z]\w*)\s*\(/o) {
+ $ret_type = $1;
+ if (defined ($2)) { $ret_type .= " $2"; }
+ $symbol = $3;
+ $decl = $';
+ @TRACE@("internal Function: $symbol, Returns: [$1][$2]");
+ $in_declaration = "function";
+ $internal = 1;
+ if (m/^\s*G_INLINE_FUNC/) {
+ @TRACE@("skip block after inline function");
+ # now we we need to skip a whole { } block
+ $skip_block = 1;
+ }
+
+ # $1 $2 $3
+ } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+)((?:\s+|\*)+(?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*([A-Za-z]\w*)\s*\(/o) {
+ $ret_type = $1;
+ if (defined ($2)) { $ret_type .= " $2"; }
+ $symbol = $3;
+ $decl = $';
+ @TRACE@("Function (1): $symbol, Returns: [$1][$2]");
+ $in_declaration = "function";
+ if (m/^\s*G_INLINE_FUNC/) {
+ @TRACE@("skip block after inline function");
+ # now we we need to skip a whole { } block
+ $skip_block = 1;
+ }
+
+ # Try to catch function declarations which have the return type on
+ # the previous line. But we don't want to catch complete functions
+ # which have been declared G_INLINE_FUNC, e.g. g_bit_nth_lsf in
+ # glib, or 'static inline' functions.
+ } elsif (m/^\s*([A-Za-z]\w*)\s*\(/) {
+ $symbol = $1;
+ $decl = $';
+
+ if ($previous_line !~ m/^\s*G_INLINE_FUNC/) {
+ if ($previous_line !~ m/^\s*static\s+/) {
# $1 $2
if ($previous_line =~ m/^\s*(?:\b(?:extern|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+)((?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*$/o) {
$ret_type = $1;
@@ -603,7 +603,7 @@ sub ScanHeader {
}
}
else {
- if ($previous_line !~ m/^\s*static\s+/) {
+ if ($previous_line !~ m/^\s*static\s+/) {
@TRACE@("skip block after inline function");
# now we we need to skip a whole { } block
$skip_block = 1;
@@ -615,20 +615,20 @@ sub ScanHeader {
$in_declaration = "function";
}
}
- }
-
- # Try to catch function declarations with the return type and name
- # on the previous line(s), and the start of the parameters on this.
- } elsif (m/^\s*\(/) {
- $decl = $';
- if ($previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|enum\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*$/o) {
- $ret_type = "$1 $2";
- $symbol = $3;
- @TRACE@("Function (5): $symbol, Returns: $ret_type");
- $in_declaration = "function";
-
- } elsif ($previous_line =~ m/^\s*\w+\s*$/
- && $pre_previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|struct\s+|union\s+|enum\s+)*\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*$/o) {
+ }
+
+ # Try to catch function declarations with the return type and name
+ # on the previous line(s), and the start of the parameters on this.
+ } elsif (m/^\s*\(/) {
+ $decl = $';
+ if ($previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|enum\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*$/o) {
+ $ret_type = "$1 $2";
+ $symbol = $3;
+ @TRACE@("Function (5): $symbol, Returns: $ret_type");
+ $in_declaration = "function";
+
+ } elsif ($previous_line =~ m/^\s*\w+\s*$/
+ && $pre_previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|struct\s+|union\s+|enum\s+)*\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*$/o) {
$ret_type = $1;
$ret_type =~ s/\s*\n//;
$in_declaration = "function";
@@ -637,48 +637,48 @@ sub ScanHeader {
$symbol =~ s/^\s+//;
$symbol =~ s/\s*\n//;
@TRACE@("Function (6): $symbol, Returns: $ret_type");
- }
+ }
- #} elsif (m/^extern\s+/) {
- #print "DEBUG: Skipping extern: $_";
+ #} elsif (m/^extern\s+/) {
+ #print "DEBUG: Skipping extern: $_";
- # STRUCTS
+ # STRUCTS
- } elsif (m/^\s*struct\s+_(\w+)\s*\*/) {
- # Skip 'struct _<struct_name> *', since it could be a
- # return type on its own line.
+ } elsif (m/^\s*struct\s+_(\w+)\s*\*/) {
+ # Skip 'struct _<struct_name> *', since it could be a
+ # return type on its own line.
- } elsif (m/^\s*struct\s+_(\w+)/) {
- # We assume that 'struct _<struct_name>' is really the
- # declaration of struct <struct_name>.
- $symbol = $1;
- $decl = $_;
+ } elsif (m/^\s*struct\s+_(\w+)/) {
+ # We assume that 'struct _<struct_name>' is really the
+ # declaration of struct <struct_name>.
+ $symbol = $1;
+ $decl = $_;
# we will find the correct level as below we do $level += tr/{//;
- $level = 0;
- $in_declaration = "struct";
- @TRACE@("Struct(_): $symbol");
+ $level = 0;
+ $in_declaration = "struct";
+ @TRACE@("Struct(_): $symbol");
- # UNIONS
+ # UNIONS
- } elsif (m/^\s*union\s+_(\w+)\s*\*/) {
- # Skip 'union _<union_name> *' (see above)
- } elsif (m/^\s*union\s+_(\w+)/) {
- $symbol = $1;
- $decl = $_;
- $level = 0;
- $in_declaration = "union";
+ } elsif (m/^\s*union\s+_(\w+)\s*\*/) {
+ # Skip 'union _<union_name> *' (see above)
+ } elsif (m/^\s*union\s+_(\w+)/) {
+ $symbol = $1;
+ $decl = $_;
+ $level = 0;
+ $in_declaration = "union";
@TRACE@("Union(_): $symbol");
- }
+ }
- } else {
+ } else {
@TRACE@("1: [$skip_block] $_");
- # If we were already in the middle of a declaration, we simply add
- # the current line onto the end of it.
- if ($skip_block == 0) {
- $decl .= $_;
- } else {
+ # If we were already in the middle of a declaration, we simply add
+ # the current line onto the end of it.
+ if ($skip_block == 0) {
+ $decl .= $_;
+ } else {
if (m%(.*?){%) {
if ($skip_block == 1) {
$decl .= $1;
@@ -698,23 +698,23 @@ sub ScanHeader {
}
}
}
- }
+ }
#if ($in_declaration ne '') {
# print "$in_declaration = $decl\n";
#}
- # Note that sometimes functions end in ') G_GNUC_PRINTF (2, 3);' or
- # ') __attribute__ (...);'.
- if ($in_declaration eq 'function') {
- if ($decl =~ s/\)\s*(G_GNUC_.*|${IGNORE_DECORATORS}\s*|__attribute__\s*\(.*\)\s*)?;.*$//) {
- if ($internal == 0) {
- $decl =~ s%/\*.*?\*/%%gs; # remove comments.
- #$decl =~ s/^\s+//; # remove leading whitespace.
- #$decl =~ s/\s+$//; # remove trailing whitespace.
- $decl =~ s/\s*\n\s*/ /gs; # consolidate whitespace at start
+ # Note that sometimes functions end in ') G_GNUC_PRINTF (2, 3);' or
+ # ') __attribute__ (...);'.
+ if ($in_declaration eq 'function') {
+ if ($decl =~ s/\)\s*(G_GNUC_.*|${IGNORE_DECORATORS}\s*|__attribute__\s*\(.*\)\s*)?;.*$//) {
+ if ($internal == 0) {
+ $decl =~ s%/\*.*?\*/%%gs; # remove comments.
+ #$decl =~ s/^\s+//; # remove leading whitespace.
+ #$decl =~ s/\s+$//; # remove trailing whitespace.
+ $decl =~ s/\s*\n\s*/ /gs; # consolidate whitespace at start
# and end of lines.
- $ret_type =~ s%/\*.*?\*/%%g; # remove comments in ret type.
+ $ret_type =~ s%/\*.*?\*/%%g; # remove comments in ret type.
if (&AddSymbolToList (\$list, $symbol)) {
print DECL "<FUNCTION>\n<NAME>$symbol</NAME>\n$deprecated<RETURNS>$ret_type</RETURNS>\n$decl\n</FUNCTION>\n";
if ($REBUILD_TYPES) {
@@ -730,77 +730,77 @@ sub ScanHeader {
}
$in_declaration = "";
$skip_block = 0;
- }
- }
-
- if ($in_declaration eq 'user_function') {
- if ($decl =~ s/\).*$//) {
- if (&AddSymbolToList (\$list, $symbol)) {
- print DECL "<USER_FUNCTION>\n<NAME>$symbol</NAME>\n$deprecated<RETURNS>$ret_type</RETURNS>\n$decl</USER_FUNCTION>\n";
- }
- $in_declaration = "";
- }
- }
-
- if ($in_declaration eq 'macro') {
- if ($decl !~ m/\\\s*$/) {
- if ($internal == 0) {
+ }
+ }
+
+ if ($in_declaration eq 'user_function') {
+ if ($decl =~ s/\).*$//) {
+ if (&AddSymbolToList (\$list, $symbol)) {
+ print DECL "<USER_FUNCTION>\n<NAME>$symbol</NAME>\n$deprecated<RETURNS>$ret_type</RETURNS>\n$decl</USER_FUNCTION>\n";
+ }
+ $in_declaration = "";
+ }
+ }
+
+ if ($in_declaration eq 'macro') {
+ if ($decl !~ m/\\\s*$/) {
+ if ($internal == 0) {
if (&AddSymbolToList (\$list, $symbol)) {
print DECL "<MACRO>\n<NAME>$symbol</NAME>\n$deprecated$decl</MACRO>\n";
}
- } else {
+ } else {
$internal = 0;
- }
- $in_declaration = "";
- }
- }
-
- if ($in_declaration eq 'enum') {
- if ($decl =~ m/\}\s*(\w+)?;\s*$/) {
- if ($symbol eq "") {
- $symbol = $1;
- }
- if (&AddSymbolToList (\$list, $symbol)) {
- print DECL "<ENUM>\n<NAME>$symbol</NAME>\n$deprecated$decl</ENUM>\n";
- }
- $in_declaration = "";
- }
- }
-
- # We try to handle nested stucts/unions, but unmatched brackets in
- # comments will cause problems.
- if ($in_declaration eq 'struct' or $in_declaration eq 'union') {
- if ($level <= 1 && $decl =~ m/\}\s*(\w*);\s*$/) {
- if ($symbol eq "") {
- $symbol = $1;
- }
-
- if ($symbol =~ m/^(\S+)(Class|Iface|Interface)\b/) {
- my $objectname = $1;
- @TRACE@("Found object: $1");
- $list = "<TITLE>$objectname</TITLE>\n$list";
- push (@objects, $objectname);
- }
- @TRACE@("Store struct: $symbol");
- if (&AddSymbolToList (\$list, $symbol)) {
- my $structsym = uc $in_declaration;
- print DECL "<$structsym>\n<NAME>$symbol</NAME>\n$deprecated$decl</$structsym>\n";
- if (defined($forward_decls{$symbol})) {
- undef($forward_decls{$symbol});
- }
- }
- $in_declaration = "";
- } else {
- # We use tr to count the brackets in the line, and adjust
- # $level accordingly.
- $level += tr/{//;
- $level -= tr/}//;
- @TRACE@("struct/union level : $level");
- }
- }
-
- $pre_previous_line = $previous_line;
- $previous_line = $_;
+ }
+ $in_declaration = "";
+ }
+ }
+
+ if ($in_declaration eq 'enum') {
+ if ($decl =~ m/\}\s*(\w+)?;\s*$/) {
+ if ($symbol eq "") {
+ $symbol = $1;
+ }
+ if (&AddSymbolToList (\$list, $symbol)) {
+ print DECL "<ENUM>\n<NAME>$symbol</NAME>\n$deprecated$decl</ENUM>\n";
+ }
+ $in_declaration = "";
+ }
+ }
+
+ # We try to handle nested stucts/unions, but unmatched brackets in
+ # comments will cause problems.
+ if ($in_declaration eq 'struct' or $in_declaration eq 'union') {
+ if ($level <= 1 && $decl =~ m/\}\s*(\w*);\s*$/) {
+ if ($symbol eq "") {
+ $symbol = $1;
+ }
+
+ if ($symbol =~ m/^(\S+)(Class|Iface|Interface)\b/) {
+ my $objectname = $1;
+ @TRACE@("Found object: $1");
+ $list = "<TITLE>$objectname</TITLE>\n$list";
+ push (@objects, $objectname);
+ }
+ @TRACE@("Store struct: $symbol");
+ if (&AddSymbolToList (\$list, $symbol)) {
+ my $structsym = uc $in_declaration;
+ print DECL "<$structsym>\n<NAME>$symbol</NAME>\n$deprecated$decl</$structsym>\n";
+ if (defined($forward_decls{$symbol})) {
+ undef($forward_decls{$symbol});
+ }
+ }
+ $in_declaration = "";
+ } else {
+ # We use tr to count the brackets in the line, and adjust
+ # $level accordingly.
+ $level += tr/{//;
+ $level -= tr/}//;
+ @TRACE@("struct/union level : $level");
+ }
+ }
+
+ $pre_previous_line = $previous_line;
+ $previous_line = $_;
}
close(INPUT);
@@ -820,31 +820,31 @@ sub ScanHeader {
my ($class) = "";
my ($standard_decl) = "";
if ($list =~ m/^\S+_IS_(\S*)_CLASS/m) {
- $class = $1;
+ $class = $1;
} elsif ($list =~ m/^\S+_IS_(\S*)/m) {
- $class = $1;
+ $class = $1;
}
if ($class ne "") {
- if ($list =~ s/^\S+_IS_$class\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_TYPE_$class\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_.*_get_type\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_${class}_CLASS\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_IS_${class}_CLASS\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_${class}_GET_CLASS\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_${class}_GET_IFACE\n//m) { $standard_decl .= $&; }
- if ($list =~ s/^\S+_${class}_GET_INTERFACE\n//m) { $standard_decl .= $&; }
-
- # We do this one last, otherwise it tends to be caught by the IS_$class macro
- if ($list =~ s/^\S+_$class\n//m) { $standard_decl = $& . $standard_decl; }
+ if ($list =~ s/^\S+_IS_$class\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_TYPE_$class\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_.*_get_type\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_${class}_CLASS\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_IS_${class}_CLASS\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_${class}_GET_CLASS\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_${class}_GET_IFACE\n//m) { $standard_decl .= $&; }
+ if ($list =~ s/^\S+_${class}_GET_INTERFACE\n//m) { $standard_decl .= $&; }
+
+ # We do this one last, otherwise it tends to be caught by the IS_$class macro
+ if ($list =~ s/^\S+_$class\n//m) { $standard_decl = $& . $standard_decl; }
if ($standard_decl ne "") {
- $list .= "<SUBSECTION Standard>\n$standard_decl";
- }
+ $list .= "<SUBSECTION Standard>\n$standard_decl";
+ }
- if ($list ne "") {
- $$object_list .= "<SECTION>\n<FILE>$file_basename</FILE>\n$list</SECTION>\n\n";
- }
+ if ($list ne "") {
+ $$object_list .= "<SECTION>\n<FILE>$file_basename</FILE>\n$list</SECTION>\n\n";
+ }
} else {
if ($list ne "") {
$$main_list .= "<SECTION>\n<FILE>$file_basename</FILE>\n$list</SECTION>\n\n";
@@ -856,9 +856,9 @@ sub ScanHeader {
#############################################################################
# Function : AddSymbolToList
# Description : This adds the symbol to the list of declarations, but only if
-# it is not already in the list.
+# it is not already in the list.
# Arguments : $list - reference to the list of symbols, one on each line.
-# $symbol - the symbol to add to the list.
+# $symbol - the symbol to add to the list.
#############################################################################
sub AddSymbolToList {
@@ -869,7 +869,7 @@ sub AddSymbolToList {
# we return 0 to skip outputting another entry to -decl.txt
# this is to avoid redeclarations (e.g. in conditional
# sections).
- return 0;
+ return 0;
}
$$list .= "$symbol\n";
return 1;
diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
index ca0daca..8090c7d 100644
--- a/gtkdoc-scangobj.in
+++ b/gtkdoc-scangobj.in
@@ -43,14 +43,14 @@ my $QUERY_CHILD_PROPERTIES;
# --nogtkinit is deprecated, as it is the default now anyway.
%optctl = (module => \$MODULE,
- types => \$TYPES_FILE,
- nogtkinit => \$NO_GTK_INIT,
- 'type-init-func' => \$TYPE_INIT_FUNC,
- 'query-child-properties' => \$QUERY_CHILD_PROPERTIES,
- 'output-dir' => \$OUTPUT_DIR,
- 'verbose' => \$VERBOSE,
- 'version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP);
+ types => \$TYPES_FILE,
+ nogtkinit => \$NO_GTK_INIT,
+ 'type-init-func' => \$TYPE_INIT_FUNC,
+ 'query-child-properties' => \$QUERY_CHILD_PROPERTIES,
+ 'output-dir' => \$OUTPUT_DIR,
+ 'verbose' => \$VERBOSE,
+ 'version' => \$PRINT_VERSION,
+ 'help' => \$PRINT_HELP);
GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "nogtkinit", "type-init-func:s", "query-child-properties:s", "verbose", "version", "help");
@@ -110,17 +110,17 @@ $includes = "";
for (<TYPES>) {
if (/^#include/) {
- $includes .= $_;
+ $includes .= $_;
} elsif (/^gnome_keyring_item_info_get_type$/) {
# HACK: This isn't really a GObject type so skip it.
next;
} elsif (/^%/) {
- next;
+ next;
} elsif (/^\s*$/) {
- next;
+ next;
} else {
- chomp;
- push @types, $_;
+ chomp;
+ push @types, $_;
}
}
@@ -139,7 +139,7 @@ if ($includes) {
print OUTPUT $includes;
} else {
for (@types) {
- print OUTPUT "extern GType $_ (void);\n";
+ print OUTPUT "extern GType $_ (void);\n";
}
}
@@ -205,24 +205,24 @@ const gchar *args_filename = "$new_args_filename";
static void output_signals (void);
static void output_object_signals (FILE *fp,
- GType object_type);
+ GType object_type);
static void output_object_signal (FILE *fp,
- const gchar *object_class_name,
- guint signal_id);
+ const gchar *object_class_name,
+ guint signal_id);
static const gchar * get_type_name (GType type,
- gboolean * is_pointer);
+ gboolean * is_pointer);
static void output_object_hierarchy (void);
static void output_hierarchy (FILE *fp,
- GType type,
- guint level);
+ GType type,
+ guint level);
static void output_object_interfaces (void);
static void output_interfaces (FILE *fp,
- GType type);
+ GType type);
static void output_interface_prerequisites (void);
static void output_prerequisites (FILE *fp,
- GType type);
+ GType type);
static void output_args (void);
static void output_object_args (FILE *fp, GType object_type);
@@ -301,8 +301,8 @@ output_object_signals (FILE *fp, GType object_type)
/* This outputs one signal. */
static void
output_object_signal (FILE *fp,
- const gchar *object_name,
- guint signal_id)
+ const gchar *object_name,
+ guint signal_id)
{
GSignalQuery query_info;
const gchar *type_name, *ret_type, *object_arg, *arg_name;
@@ -360,7 +360,7 @@ output_object_signal (FILE *fp,
for (i = 0; signal_name[i]; i++)
{
if (signal_name[i] == '-')
- signal_name[i] = '_';
+ signal_name[i] = '_';
}
/* Output the signal parameters. */
@@ -428,8 +428,8 @@ output_object_signal (FILE *fp,
ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
fprintf (fp,
- "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s%s</RETURNS>\\n<FLAGS>%s</FLAGS>\\n%s</SIGNAL>\\n\\n",
- object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer);
+ "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s%s</RETURNS>\\n<FLAGS>%s</FLAGS>\\n%s</SIGNAL>\\n\\n",
+ object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer);
}
@@ -561,8 +561,8 @@ output_object_hierarchy (void)
/* This is called recursively to output the hierarchy of a object. */
static void
output_hierarchy (FILE *fp,
- GType type,
- guint level)
+ GType type,
+ guint level)
{
guint i;
GType *children;
@@ -610,7 +610,7 @@ static void output_object_interfaces (void)
static void
output_interfaces (FILE *fp,
- GType type)
+ GType type)
{
guint i;
GType *children, *interfaces;
@@ -654,7 +654,7 @@ static void output_interface_prerequisites (void)
static void
output_prerequisites (FILE *fp,
- GType type)
+ GType type)
{
#if GLIB_CHECK_VERSION(2,1,0)
guint i;
@@ -851,13 +851,13 @@ describe_type (GParamSpec *spec)
lower = describe_signed_constant (sizeof(gchar), pspec->minimum);
upper = describe_signed_constant (sizeof(gchar), pspec->maximum);
if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == G_MININT8)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXINT8)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -868,13 +868,13 @@ describe_type (GParamSpec *spec)
lower = describe_unsigned_constant (sizeof(guchar), pspec->minimum);
upper = describe_unsigned_constant (sizeof(guchar), pspec->maximum);
if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == 0)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXUINT8)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -885,13 +885,13 @@ describe_type (GParamSpec *spec)
lower = describe_signed_constant (sizeof(gint), pspec->minimum);
upper = describe_signed_constant (sizeof(gint), pspec->maximum);
if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == G_MININT)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXINT)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -902,13 +902,13 @@ describe_type (GParamSpec *spec)
lower = describe_unsigned_constant (sizeof(guint), pspec->minimum);
upper = describe_unsigned_constant (sizeof(guint), pspec->maximum);
if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == 0)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXUINT)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -919,13 +919,13 @@ describe_type (GParamSpec *spec)
lower = describe_signed_constant (sizeof(glong), pspec->minimum);
upper = describe_signed_constant (sizeof(glong), pspec->maximum);
if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == G_MINLONG)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXLONG)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -936,13 +936,13 @@ describe_type (GParamSpec *spec)
lower = describe_unsigned_constant (sizeof(gulong), pspec->minimum);
upper = describe_unsigned_constant (sizeof(gulong), pspec->maximum);
if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == 0)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXULONG)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -953,13 +953,13 @@ describe_type (GParamSpec *spec)
lower = describe_signed_constant (sizeof(gint64), pspec->minimum);
upper = describe_signed_constant (sizeof(gint64), pspec->maximum);
if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == G_MININT64)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXINT64)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -970,13 +970,13 @@ describe_type (GParamSpec *spec)
lower = describe_unsigned_constant (sizeof(guint64), pspec->minimum);
upper = describe_unsigned_constant (sizeof(guint64), pspec->maximum);
if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64)
- desc = g_strdup ("");
+ desc = g_strdup ("");
else if (pspec->minimum == 0)
- desc = g_strdup_printf ("<= %s", upper);
+ desc = g_strdup_printf ("<= %s", upper);
else if (pspec->maximum == G_MAXUINT64)
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -987,16 +987,16 @@ describe_type (GParamSpec *spec)
lower = describe_double_constant (pspec->minimum);
upper = describe_double_constant (pspec->maximum);
if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT))
- {
- if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
- desc = g_strdup ("");
- else
- desc = g_strdup_printf ("<= %s", upper);
- }
+ {
+ if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
+ desc = g_strdup ("");
+ else
+ desc = g_strdup_printf ("<= %s", upper);
+ }
else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -1007,16 +1007,16 @@ describe_type (GParamSpec *spec)
lower = describe_double_constant (pspec->minimum);
upper = describe_double_constant (pspec->maximum);
if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE))
- {
- if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
- desc = g_strdup ("");
- else
- desc = g_strdup_printf ("<= %s", upper);
- }
+ {
+ if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
+ desc = g_strdup ("");
+ else
+ desc = g_strdup_printf ("<= %s", upper);
+ }
else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
- desc = g_strdup_printf (">= %s", lower);
+ desc = g_strdup_printf (">= %s", lower);
else
- desc = g_strdup_printf ("[%s,%s]", lower, upper);
+ desc = g_strdup_printf ("[%s,%s]", lower, upper);
g_free (lower);
g_free (upper);
}
@@ -1112,9 +1112,9 @@ describe_default (GParamSpec *spec)
GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec);
if (g_unichar_isprint (pspec->default_value))
- desc = g_strdup_printf ("'%c'", pspec->default_value);
+ desc = g_strdup_printf ("'%c'", pspec->default_value);
else
- desc = g_strdup_printf ("%u", pspec->default_value);
+ desc = g_strdup_printf ("%u", pspec->default_value);
}
else if (G_IS_PARAM_SPEC_ENUM (spec))
{
@@ -1122,9 +1122,9 @@ describe_default (GParamSpec *spec)
GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value);
if (value)
- desc = g_strdup_printf ("%s", value->value_name);
+ desc = g_strdup_printf ("%s", value->value_name);
else
- desc = g_strdup_printf ("%d", pspec->default_value);
+ desc = g_strdup_printf ("%d", pspec->default_value);
}
else if (G_IS_PARAM_SPEC_FLAGS (spec))
{
@@ -1136,26 +1136,26 @@ describe_default (GParamSpec *spec)
acc = g_string_new ("");
while (default_value)
- {
- GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value);
+ {
+ GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value);
- if (!value)
- break;
+ if (!value)
+ break;
- if (acc->len > 0)
- g_string_append (acc, "|");
- g_string_append (acc, value->value_name);
+ if (acc->len > 0)
+ g_string_append (acc, "|");
+ g_string_append (acc, value->value_name);
- default_value &= ~value->value;
- }
+ default_value &= ~value->value;
+ }
if (default_value == 0)
- desc = g_string_free (acc, FALSE);
+ desc = g_string_free (acc, FALSE);
else
- {
- desc = g_strdup_printf ("%d", pspec->default_value);
- g_string_free (acc, TRUE);
- }
+ {
+ desc = g_strdup_printf ("%d", pspec->default_value);
+ g_string_free (acc, TRUE);
+ }
}
else if (G_IS_PARAM_SPEC_FLOAT (spec))
{
@@ -1184,15 +1184,15 @@ describe_default (GParamSpec *spec)
GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec);
if (pspec->default_value)
- {
- gchar *esc = g_strescape (pspec->default_value, NULL);
+ {
+ gchar *esc = g_strescape (pspec->default_value, NULL);
- desc = g_strdup_printf ("\\"%s\\"", esc);
+ desc = g_strdup_printf ("\\"%s\\"", esc);
- g_free (esc);
- }
+ g_free (esc);
+ }
else
- desc = g_strdup_printf ("NULL");
+ desc = g_strdup_printf ("NULL");
}
#if GLIB_CHECK_VERSION (2, 25, 9)
else if (G_IS_PARAM_SPEC_VARIANT (spec))
@@ -1200,9 +1200,9 @@ describe_default (GParamSpec *spec)
GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec);
if (pspec->default_value)
- desc = g_variant_print (pspec->default_value, TRUE);
+ desc = g_variant_print (pspec->default_value, TRUE);
else
- desc = g_strdup ("NULL");
+ desc = g_strdup ("NULL");
}
#endif
else
@@ -1234,7 +1234,7 @@ output_object_args (FILE *fp, GType object_type)
{
class = g_type_class_peek (object_type);
if (!class)
- return;
+ return;
properties = g_object_class_list_properties (class, &n_properties);
}
@@ -1244,7 +1244,7 @@ output_object_args (FILE *fp, GType object_type)
class = g_type_default_interface_ref (object_type);
if (!class)
- return;
+ return;
properties = g_object_interface_list_properties (class, &n_properties);
}
@@ -1270,17 +1270,17 @@ output_object_args (FILE *fp, GType object_type)
pos = flags;
/* We use one-character flags for simplicity. */
if (child_prop && !style_prop)
- *pos++ = 'c';
+ *pos++ = 'c';
if (style_prop)
- *pos++ = 's';
+ *pos++ = 's';
if (spec->flags & G_PARAM_READABLE)
- *pos++ = 'r';
+ *pos++ = 'r';
if (spec->flags & G_PARAM_WRITABLE)
- *pos++ = 'w';
+ *pos++ = 'w';
if (spec->flags & G_PARAM_CONSTRUCT)
- *pos++ = 'x';
+ *pos++ = 'x';
if (spec->flags & G_PARAM_CONSTRUCT_ONLY)
- *pos++ = 'X';
+ *pos++ = 'X';
*pos = 0;
nick = g_param_spec_get_nick (spec);
@@ -1293,13 +1293,13 @@ output_object_args (FILE *fp, GType object_type)
dot = ".";
}
- type_desc = describe_type (spec);
- default_value = describe_default (spec);
- type_name = get_type_name (spec->value_type, &is_pointer);
+ type_desc = describe_type (spec);
+ default_value = describe_default (spec);
+ type_name = get_type_name (spec->value_type, &is_pointer);
fprintf (fp, "<ARG>\\n<NAME>%s::%s</NAME>\\n<TYPE>%s%s</TYPE>\\n<RANGE>%s</RANGE>\\n<FLAGS>%s</FLAGS>\\n<NICK>%s</NICK>\\n<BLURB>%s%s</BLURB>\\n<DEFAULT>%s</DEFAULT>\\n</ARG>\\n\\n",
- object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value);
- g_free (type_desc);
- g_free (default_value);
+ object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value);
+ g_free (type_desc);
+ g_free (default_value);
}
g_free (properties);
diff --git a/gtkdoc-scanobj.in b/gtkdoc-scanobj.in
index 36da178..5745cff 100755
--- a/gtkdoc-scanobj.in
+++ b/gtkdoc-scanobj.in
@@ -38,11 +38,11 @@ my $OUTPUT_DIR;
my $PRINT_VERSION;
%optctl = (module => \$MODULE,
- types => \$TYPES_FILE,
- nogtkinit => \$NO_GTK_INIT,
- 'output-dir' => \$OUTPUT_DIR,
- 'version' => \$PRINT_VERSION,
- 'help' => \$PRINT_HELP);
+ types => \$TYPES_FILE,
+ nogtkinit => \$NO_GTK_INIT,
+ 'output-dir' => \$OUTPUT_DIR,
+ 'version' => \$PRINT_VERSION,
+ 'help' => \$PRINT_HELP);
GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "nogtkinit", "version", "help");
@@ -89,14 +89,14 @@ $includes = "";
for (<TYPES>) {
if (/^#include/) {
- $includes .= $_;
+ $includes .= $_;
} elsif (/^%/) {
- next;
+ next;
} elsif (/^\s*$/) {
- next;
+ next;
} else {
- chomp;
- push @types, $_;
+ chomp;
+ push @types, $_;
}
}
@@ -140,17 +140,17 @@ gchar *args_filename = "$new_args_filename";
static void output_signals (void);
static void output_widget_signals (FILE *fp,
- GtkType object_type);
+ GtkType object_type);
static void output_widget_signal (FILE *fp,
- GtkType object_type,
- gchar *object_class_name,
- guint signal_id);
+ GtkType object_type,
+ gchar *object_class_name,
+ guint signal_id);
static gchar * get_type_name (GtkType type,
- gboolean * is_pointer);
+ gboolean * is_pointer);
static void output_widget_hierarchy (void);
static void output_hierarchy (FILE *fp,
- GtkType type,
- guint level);
+ GtkType type,
+ guint level);
static void output_args (void);
static void output_widget_args (FILE *fp, GtkType object_type);
@@ -224,7 +224,7 @@ output_widget_signals (FILE *fp, GtkType object_type)
}
output_widget_signal (fp, object_type, object_class_name,
- class->signals[sig]);
+ class->signals[sig]);
}
}
@@ -232,9 +232,9 @@ output_widget_signals (FILE *fp, GtkType object_type)
/* This outputs one signal. */
static void
output_widget_signal (FILE *fp,
- GtkType object_type,
- gchar *object_name,
- guint signal_id)
+ GtkType object_type,
+ gchar *object_name,
+ guint signal_id)
{
GtkSignalQuery *query_info;
gchar *ret_type, *pos, *type_name, *arg_name, *object_arg, *object_arg_start;
@@ -290,7 +290,7 @@ output_widget_signal (FILE *fp,
for (i = 0; signal_name[i]; i++)
{
if (signal_name[i] == '-')
- signal_name[i] = '_';
+ signal_name[i] = '_';
}
/* Output the signal parameters. */
@@ -335,8 +335,8 @@ output_widget_signal (FILE *fp,
ret_type = get_type_name (query_info->return_val, &is_pointer);
fprintf (fp,
- "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s%s</RETURNS>\\n%s</SIGNAL>\\n\\n",
- object_name, query_info->signal_name, ret_type, is_pointer ? "*" : "", buffer);
+ "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s%s</RETURNS>\\n%s</SIGNAL>\\n\\n",
+ object_name, query_info->signal_name, ret_type, is_pointer ? "*" : "", buffer);
g_free (query_info);
}
@@ -426,8 +426,8 @@ output_widget_hierarchy (void)
/* This is called recursively to output the hierarchy of a widget. */
static void
output_hierarchy (FILE *fp,
- GtkType type,
- guint level)
+ GtkType type,
+ guint level)
{
GList *list;
guint i;
@@ -494,19 +494,19 @@ output_widget_args (FILE *fp, GtkType object_type)
pos = flags;
/* We use one-character flags for simplicity. */
if (arg_flags[arg] & GTK_ARG_READABLE)
- *pos++ = 'r';
+ *pos++ = 'r';
if (arg_flags[arg] & GTK_ARG_WRITABLE)
- *pos++ = 'w';
+ *pos++ = 'w';
if (arg_flags[arg] & GTK_ARG_CONSTRUCT)
- *pos++ = 'x';
+ *pos++ = 'x';
if (arg_flags[arg] & GTK_ARG_CONSTRUCT_ONLY)
- *pos++ = 'X';
+ *pos++ = 'X';
if (arg_flags[arg] & GTK_ARG_CHILD_ARG)
- *pos++ = 'c';
+ *pos++ = 'c';
*pos = 0;
fprintf (fp, "<ARG>\\n<NAME>%s</NAME>\\n<TYPE>%s</TYPE>\\n<FLAGS>%s</FLAGS>\\n</ARG>\\n\\n",
- args[arg].name, gtk_type_name (args[arg].type), flags);
+ args[arg].name, gtk_type_name (args[arg].type), flags);
}
g_free (args);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]