Re: [PATCH libmnl] src: fix doxygen function documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, Oct 06, 2019 at 09:55:25PM +1100, Duncan Roe wrote:
> Hi Pablo,
> 
> On Mon, Sep 30, 2019 at 04:17:53PM +0200, Pablo Neira Ayuso wrote:
> > On Wed, Sep 25, 2019 at 03:14:19PM +0200, Fernando Fernandez Mancera wrote:
> > > Currently clang requires EXPORT_SYMBOL() to be above the function
> > > implementation. At the same time doxygen is not generating the proper
> > > documentation because of that.
> > >
> > > This patch solves that problem but EXPORT_SYMBOL looks less like the Linux
> > > kernel way exporting symbols.
> >
> > Applied, thanks.
> 
> I missed this earlier - take a look at the man pages / html doc with this patch.
> 
> E.g. man attr:
> 
> > attr(3)                             libmnl                            attr(3)
> >
> >
> >
> > NAME
> >        attr - Netlink attribute helpers
> >
> >    Functions
> >        EXPORT_SYMBOL uint16_t mnl_attr_get_type (const struct nlattr *attr)
> >        EXPORT_SYMBOL uint16_t mnl_attr_get_len (const struct nlattr *attr)
> >        EXPORT_SYMBOL uint16_t mnl_attr_get_payload_len (const struct nlattr
> >            *attr)
> >        EXPORT_SYMBOL void * mnl_attr_get_payload (const struct nlattr *attr)
> >        EXPORT_SYMBOL bool mnl_attr_ok (const struct nlattr *attr, int len)
> 
> The web pages are the same.
> 
> Shunting all the EXPORT_SYMBOL lines to the start of the file as in my rejected
> patch might have been ugly, but at least it left the documentation looking as it
> should.
> 
> I just finished making a patch for libnetfilter_queue using the redefined
> EXPORT_SYMBOL as above but taking care to avoid generating lines over 80 chars
> and preserving (or fixing!) alignment of subsequent parameter lines. But I won't
> submit it, because it results in the same horrible documentation.
> 
> I think it should be not too onerous to move the EXPORT_SYMBOL lines to before
> the start of documentation, which should satisfy both doxygen adn clang. Would
> you like me to go ahead with that?

Just sent you a patch for libmnl to remove the EXPORT_SYMBOL from the
doxygen output.
>From f8b59f25120d992ceb31b153ff297f308cf517f0 Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Date: Sun, 6 Oct 2019 19:45:29 +0200
Subject: [PATCH] libmnl: doxygen: remove EXPORT_SYMBOL from the output

Add input filter to remove the internal EXPORT_SYMBOL macro that turns
on the compiler visibility attribute.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 doxygen.cfg.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doxygen.cfg.in b/doxygen.cfg.in
index ee8fdfae97ce..31f01028aff6 100644
--- a/doxygen.cfg.in
+++ b/doxygen.cfg.in
@@ -77,7 +77,7 @@ EXAMPLE_PATH           =
 EXAMPLE_PATTERNS       = 
 EXAMPLE_RECURSIVE      = NO
 IMAGE_PATH             = 
-INPUT_FILTER           = 
+INPUT_FILTER           = "sed 's/EXPORT_SYMBOL//g'"
 FILTER_PATTERNS        = 
 FILTER_SOURCE_FILES    = NO
 SOURCE_BROWSER         = YES
-- 
2.11.0


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux