[gtk-doc] common: also allow scope comments in enums
- From: Stefan Kost <stefkost src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk-doc] common: also allow scope comments in enums
- Date: Sun, 3 Jan 2010 11:35:22 +0000 (UTC)
commit 628f33ba894825e9d08a84ed0e8961406e6fc5b8
Author: Stefan Kost <ensonic users sf net>
Date: Sun Jan 3 13:33:54 2010 +0200
common: also allow scope comments in enums
This allows to e.g. hide a last XXX_COUNT enum value that is used internaly only.
Update docs accordingly.
gtkdoc-common.pl.in | 4 ++++
help/manual/C/gtk-doc-manual.xml | 9 ++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc-common.pl.in b/gtkdoc-common.pl.in
index ce7a96c..f1a75c0 100644
--- a/gtkdoc-common.pl.in
+++ b/gtkdoc-common.pl.in
@@ -252,6 +252,10 @@ sub ParseEnumDeclaration {
if ($declaration =~ m/enum\s+\S+\s*;/msg) {
return ();
}
+
+ # Remove private symbols
+ # Assume end of declaration if line begins with '}'
+ $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx;
# Remove comments
$declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g;
diff --git a/help/manual/C/gtk-doc-manual.xml b/help/manual/C/gtk-doc-manual.xml
index aae49fc..cf6e4af 100644
--- a/help/manual/C/gtk-doc-manual.xml
+++ b/help/manual/C/gtk-doc-manual.xml
@@ -988,7 +988,7 @@ typedef struct _FooWidget {
]]>
</programlisting>
<para>
- Use <code>/*< private >*/</code> before the private struct fields you
+ Use <code>/*< private >*/</code> before the private struct fields
you want to hide. Use <code>/*< public >*/</code> for the reverse
behavirour.
</para>
@@ -1008,10 +1008,17 @@ typedef struct _FooWidget {
typedef enum {
SOMETHING_FOO,
SOMETHING_BAR,
+ /*< private >*/
+ SOMETHING_COUNT
} Something;
]]>
</programlisting>
</example>
+ <para>
+ Use <code>/*< private >*/</code> before the private enum values
+ you want to hide. Use <code>/*< public >*/</code> for the reverse
+ behavirour.
+ </para>
</sect1>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]