From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Raw3z-0005wk-VF for qemu-devel@nongnu.org; Wed, 14 Dec 2011 16:08:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Raw3u-0007ag-Ug for qemu-devel@nongnu.org; Wed, 14 Dec 2011 16:08:31 -0500 Received: from mail-yw0-f45.google.com ([209.85.213.45]:37182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Raw3u-0007aL-Q6 for qemu-devel@nongnu.org; Wed, 14 Dec 2011 16:08:26 -0500 Received: by yhgg71 with SMTP id g71so1884934yhg.4 for ; Wed, 14 Dec 2011 13:08:26 -0800 (PST) Message-ID: <4EE91045.9070109@codemonkey.ws> Date: Wed, 14 Dec 2011 15:08:21 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1323892874-13234-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040007040908010101090304" Subject: Re: [Qemu-devel] [PATCH v2 0/4] GTK-DOC build integration (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Marc-Andr=E9_Lureau?= Cc: Peter Maydell , Avi Kivity , qemu-devel@nongnu.org, Stefan Weil This is a multi-part message in MIME format. --------------040007040908010101090304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 12/14/2011 02:54 PM, Marc-André Lureau wrote: > Hi > > On Wed, Dec 14, 2011 at 9:01 PM, Anthony Liguoriwrote: > >> For v2, I'm relying on a fork of gtk-doc that removes the underscore >> requirements. I really hate to do this but I like it better than not >> having >> documentation. I'm poking in the gtk+ community to see if there's an >> upstream >> compromise possible. >> > > Can you point out a discussion/bug, What is the "underscode requirements"? The following is what I need to make it work. I'm still trying to find out where to even have this discussion. Regards, Anthony Liguori > > thanks > --------------040007040908010101090304 Content-Type: text/x-patch; name="0001-Don-t-assume-struct-names-are-prefixed-with-_.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Don-t-assume-struct-names-are-prefixed-with-_.patch" >>From f3894f803b417bbfc19d282fda348ff9e0d6ce26 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Wed, 14 Dec 2011 13:23:12 -0600 Subject: [PATCH] Don't assume struct names are prefixed with '_'. --- gtkdoc-mkdb.in | 4 ++-- gtkdoc-scan.in | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in index 339203e..096266d 100755 --- a/gtkdoc-mkdb.in +++ b/gtkdoc-mkdb.in @@ -1489,7 +1489,7 @@ sub OutputStruct { my $decl_out = ""; if ($declaration =~ m/^\s*$/) { #print "Found opaque struct: $symbol\n"; - $decl_out = "typedef struct _$symbol $symbol;"; + $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;"; @@ -1535,7 +1535,7 @@ sub OutputStruct { # empty struct declaration. if ($decl_out eq "") { if ($has_typedef) { - $decl_out = "typedef struct _$symbol $symbol;"; + $decl_out = "typedef struct _?$symbol $symbol;"; } else { $decl_out = "struct $symbol;"; } diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in index 04bfb4a..b435a20 100755 --- a/gtkdoc-scan.in +++ b/gtkdoc-scan.in @@ -461,7 +461,7 @@ sub ScanHeader { # ENUMS - } elsif (s/^\s*enum\s+_(\w+)\s+\{/enum $1 {/) { + } elsif (s/^\s*enum\s+_?(\w+)\s+\{/enum $1 {/) { # We assume that 'enum _ {' is really the # declaration of enum . $symbol = $1; @@ -483,7 +483,7 @@ sub ScanHeader { # STRUCTS AND UNIONS - } elsif (m/^\s*typedef\s+(struct|union)\s+_(\w+)\s+\2\s*;/) { + } elsif (m/^\s*typedef\s+(struct|union)\s+_?(\w+)\s+\2\s*;/) { # We've found a 'typedef struct _ ;' # This could be an opaque data structure, so we output an # empty declaration. If the structure is actually found that @@ -492,11 +492,11 @@ sub ScanHeader { @TRACE@("$structsym typedef: $2"); $forward_decls{$2} = "<$structsym>\n$2\n$deprecated\n" - } elsif (m/^\s*(?:struct|union)\s+_(\w+)\s*;/) { + } elsif (m/^\s*(?:struct|union)\s+_?(\w+)\s*;/) { # Skip private structs/unions. @TRACE@("private struct/union"); - } elsif (m/^\s*(struct|union)\s+(\w+)\s*;/) { + } 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. @@ -504,7 +504,7 @@ sub ScanHeader { @TRACE@("$structsym: $2"); $forward_decls{$2} = "<$structsym>\n$2\n$_$deprecated\n"; - } elsif (m/^\s*typedef\s+(struct|union)\s*\w*\s*{/) { + } elsif (m/^\s*typedef\s+(struct|union)\s*_?\w*\s*{/) { $symbol = ""; $decl = $_; $level = 0; @@ -659,11 +659,11 @@ sub ScanHeader { # STRUCTS - } elsif (m/^\s*struct\s+_(\w+)\s*\*/) { + } elsif (m/^\s*struct\s+_?(\w+)\s*\*/) { # Skip 'struct _ *', since it could be a # return type on its own line. - } elsif (m/^\s*struct\s+_(\w+)/) { + } elsif (m/^\s*struct\s+_?(\w+)/) { # We assume that 'struct _' is really the # declaration of struct . $symbol = $1; @@ -676,9 +676,9 @@ sub ScanHeader { # UNIONS - } elsif (m/^\s*union\s+_(\w+)\s*\*/) { + } elsif (m/^\s*union\s+_?(\w+)\s*\*/) { # Skip 'union _ *' (see above) - } elsif (m/^\s*union\s+_(\w+)/) { + } elsif (m/^\s*union\s+_?(\w+)/) { $symbol = $1; $decl = $_; $level = 0; -- 1.7.4.1 --------------040007040908010101090304--