Re: [Doxygen-users] char_varying type in VOS C and doxygen
Brought to you by:
dimitri
From: Ron W <ron...@gm...> - 2015-01-23 17:06:49
|
On Thu, Jan 22, 2015 at 11:14 PM, < dox...@li...> wrote: > Date: Thu, 22 Jan 2015 13:47:52 +0100 > From: "Uwe Scholz" <u.s...@gm...> > Subject: [Doxygen-users] char_varying type in VOS C and doxygen > > I have a new issue to solve with doxygen: In VOS C there exists the type > char_varying(n), where n is the number of characters of the variable. > > Imagine this file is given: > ---------------------- > /** @file foo.c > */ > char_varying(256) var; > main(){} > ----------------------(1) > > Doxygen assumes that char_varying is a function here, but as said above, > this is just the type, and var is the variable. The doxygen html output > in this case is just: > ---------------------- > foo.c File Reference > Functions > char_varying (256) > ----------------------(2) > > Is there any possibility to solve this somehow? > > What I tried already: > > MACRO_EXPANSION = YES > EXPAND_ONLY_PREDEF = YES > PREDEFINED = char_varying()= > Try: PREDEFINED = char_varying()=char_varying If want the length to be captured, you would need a custom filter to preprocess your VOS C sources. In Perl, something like the following should work: #!perl -w use strict; use warnings; while (<>) { s/char_varying\s*[(]\s*(\d+)\s*[)]\s+([_A-Za-z][_A-Za-z0-9]*)\s*[;]/char_varying $2[$1];/; print $_; } Note that the above will expect an actual, decimal (or octal) number between the parenthesis after char_varying. For it to accept a number or symbol, try replacing: (\d+) with: ([_A-Za-z0-9]+) This alternate expression will also match hexadecimal numbers. |