Thread: [Doxygen-users] Dollar signs in function names
Brought to you by:
dimitri
|
From: Uwe S. <u.s...@gm...> - 2015-01-09 15:06:59
|
Hi,
I'm trying to document C code with doxygen for an OpenVOS System.
There, they are using a special C dialect ("VOS C").
For the system there I am working on there exist so-called system
subroutines. These subroutines are basically simple C-functions.
But to distinguish them from "normal" functions, they all have
the common name style "s$foo_bar". Note the Dollar sign!
See this link [*] for a list of common Stratus subroutines.
Unfortunately, doxygen can not handle them correctly. Here is an
example to test this for your own:
1: Generate a Doxyfile with "doxygen -g"
2: Set EXTRACT_ALL to YES
3: Do echo "void s$foo_bar();" > foo.c
4: Run doxygen.
Now, the HTML output of doxygen tells me that this function
declaration is in the source code:
"void s $foo_bar ()"
One can even better realize what's going on when activating
"SOURCE_BROWSER = YES" in Doxyfile. Then, you can click only on
"$foo_bar" when you open the xource code page in your web browser.
What I would expect here is "s$foo_bar" as the (clickable) function
name.
Can this be solved somehow? I wouldn't say that this is a bug
because VOS C is a rare C dialect. But I would like to know if
Dollar ($) signs in C function names can be correctly parsed by
Doxygen somehow.
Thanks for any help
Uwe
[*]
http://stratadoc.stratus.com/vos/17.1.1/r068-12/wwhelp/wwhimpl/common/html/wwhelp.htm?context=r068-12&file=prefacer068-12.html
|
|
From: Uwe S. <u.s...@gm...> - 2015-01-10 17:54:21
|
Uwe Scholz <u.s...@gm...> schrieb am [Sa, 10.01.2015 13:56]: > Here is what I did so far: > 1: doxygen -g > 2: Set EXTRACT_ALL to YES I forgot to write the following after point 2: INPUT_FILTER = "sed 's/s\$/__sdollar__/g'" FILTER_SOURCE_FILES = YES > 3: echo "void s$foo_bar();" > foo.c > 4: doxygen > 5: for II in $(find html/ -type f); do sed 's/__sdollar__/s\$/g' -i $II; done Regards Uwe |
|
From: Dimitri v. H. <do...@gm...> - 2015-01-10 18:17:14
|
> On 10 Jan 2015, at 13:56 , Uwe Scholz <u.s...@gm...> wrote:
>
> Hi Dimitri,
>
> Dimitri van Heesch <do...@gm...> schrieb am [Sa, 10.01.2015 11:38]:
>> Hi Uwe,
>>
>> What you could do is write an input filter (see the INPUT_FILTER option)
>> that lets doxygen replace the 's$' by something that can be part of an identifier, e.g. '__sdollar__'
>> Then you need to post-process the output and replace the '__sdollar__'s back to 's$'.
>
> Great! Thank you for this tip, it helped me already!
>
> But there is still one (small) problem regarding the HTML search field now:
>
> Here is what I did so far:
> 1: doxygen -g
> 2: Set EXTRACT_ALL to YES
> 3: echo "void s$foo_bar();" > foo.c
> 4: doxygen
> 5: for II in $(find html/ -type f); do sed 's/__sdollar__/s\$/g' -i $II; done
>
> It is not possible to find "s$foo_bar" in the HTML-search field from the
> doxygen HTML pages. Modifying "find html/ -type f" to "find html/
> -maxdepth 1 -type f" in step 5 makes it possible that all these
> s$-functions can be found by typing "__sdollar__...".
>
> So, there seems to be a problem with the doxygen search-engine and
> function names with dollar signs.
This is a bit more tricky indeed.
In the html/search directory there are a number of .js files.
You need to replace '_5f_5fsdollar_5f_5f' with 's_24' there,
and also make sure the searchdata.js file has the letter 's' in indexSectionsWithContent for
the rows matching 'all' and 'functions', i.e.
var indexSectionsWithContent =
{
0: "st",
1: "t",
2: "s"
};
in your example.
Regards,
Dimitri
|
|
From: Uwe S. <u.s...@gm...> - 2015-01-10 21:41:26
|
Dimitri van Heesch <do...@gm...> schrieb am [Sa, 10.01.2015 19:17]:
> > On 10 Jan 2015, at 13:56 , Uwe Scholz <u.s...@gm...> wrote:
> > It is not possible to find "s$foo_bar" in the HTML-search field from the
> > doxygen HTML pages. Modifying "find html/ -type f" to "find html/
> > -maxdepth 1 -type f" in step 5 makes it possible that all these
> > s$-functions can be found by typing "__sdollar__...".
> >
> > So, there seems to be a problem with the doxygen search-engine and
> > function names with dollar signs.
>
> This is a bit more tricky indeed.
>
> In the html/search directory there are a number of .js files.
> You need to replace '_5f_5fsdollar_5f_5f' with 's_24' there,
> and also make sure the searchdata.js file has the letter 's' in indexSectionsWithContent for
> the rows matching 'all' and 'functions', i.e.
>
I did this with the following scripts:
for II in $(find html/ -type f); do sed 's/__sdollar__/s\$/g' -i $II; done
for II in $(find html/search/*.js -type f); do sed 's/_5f_5fsdollar_5f_5f/s_24/g' -i $II; done
After this, indexSectionsWithContent in search.js looks still like this:
var indexSectionsWithContent =
{
0: "_f",
1: "f",
2: "_"
};
and replacing "_" with "s" makes that one can find "s$foo_bar" in the
html search field. Great!
Unfortunately, this is not working when there is another function
definition in foo.c, starting with "s" already:
void s$foo_bar(){}
void search(){}
After executing doxygen and the two sed scripts from above,
indexSectionsWithContent in search.js still looks like this:
var indexSectionsWithContent =
{
0: "_fs",
1: "f",
2: "_s"
};
and typing "s" in the html search field yields only the function
"search" in foo.c. Typing "_" yields nothing. Removing "_" in search.js
even shows no single search result when typing one of "s", "_" or "f".
I don't really get what is the cause for this behaviour and how to find
"s$foo_bar", when there already is another function beginning with "s"
in my C file. :-)
But up to now: Thank you very much! I think I can also live with
searching for "__sdollar__ in the html search field.
Regards
Uwe
|