Re: [Doxygen-users] How to document #define parameterized macros
Brought to you by:
dimitri
From: Marcel L. <lo...@as...> - 2010-01-14 08:37:28
|
Another way to solve this is to use a filter that mangles your #define into the function prototype you would like to document. That way, you don't lose the connection between code and docs. See the docs on INPUT_FILTER. You may have to pull some tricks though, because I guess you don't want to mangle *all* #defines into function prototypes. Best regards, Marcel Loose. On Thu, 2010-01-14 at 08:37 +0100, Fabian Cenedese wrote: > >you pass in an array it works correctly or if you pass in a float or an unsigned long, etc... What I would like to do is to document these macro functions so that in the documentation it looks like a real C function (or set of overloaded functions) with C types, etc... Here are two examples from my NXCDefs.h header file: > snip > > >I'd like to be able to generate documentation using doxygen that shows sprintf as a function that returns an int and takes a string & str, const string & format, and void value type (or something that indicates an untyped value parameter). When I tried using \fn I got warnings or errors saying that it couldn't match up the parameter names or something along those lines. Does anyone have suggestions for how I can make this work as I would like? > > Doxygen supports compiler directives, so you could wrap code in #if(n)def doxygen_doc and > write the documentation as if it were a function. Of course like that you would lose the hard > connection between code and docs, so if you change the code you must remember yourself > to also change the docs as doxygen can't warn you about a mismatch anymore. > > >A related issue that I would like to find a solution for is how to generate documentation for functions that simply do not exist anywhere in the header files. At present there are several API functions for NXC which are > > With the same trick (#ifdef doxygen_doc) you can also write function headers that only > exist for the documentation and not while compiling the real program. > > After that you need to adjust the doxygen config file to make the doxygen_doc known > and to have it expanded. There are many examples on which settings you need to > change (don't know them right know) > > bye Fabi > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Doxygen-users mailing list > Dox...@li... > https://lists.sourceforge.net/lists/listinfo/doxygen-users |