From 628f33ba894825e9d08a84ed0e8961406e6fc5b8 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Sun, 3 Jan 2010 13:33:54 +0200 Subject: [PATCH] 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 deletion(-) 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 { ]]> - Use /*< private >*/ before the private struct fields you + Use /*< private >*/ before the private struct fields you want to hide. Use /*< public >*/ for the reverse behavirour. @@ -1008,10 +1008,17 @@ typedef struct _FooWidget { typedef enum { SOMETHING_FOO, SOMETHING_BAR, + /*< private >*/ + SOMETHING_COUNT } Something; ]]> + + Use /*< private >*/ before the private enum values + you want to hide. Use /*< public >*/ for the reverse + behavirour. + -- 2.11.4.GIT