5 Jan 2007 17:58
Re: Newbie Doxygen DLL extern question
Clemens Feige <c.feige <at> osypkamed.com>
2007-01-05 16:58:46 GMT
2007-01-05 16:58:46 GMT
On 5 Jan 2007 at 9:31, Jeffrey Dufseth wrote:
> /// This function does blah blah blah.
> [DllImport("mydll.Dll")]
> private static extern ushort myFunction();
>
> Thanks for the suggestion, Clemens. I took the DLL import out as you said,
> and Doxygen worked fine.
OK Jeffrey. Now here is my suggestion.
You can use an input filter for doxygen with the INPUT_FILTER option
in the config file. Use the program SED which orignally comes from
the unix world but is also available for Win. For Windows this is
just a simple 200K sed.exe, you can download it from the internet. It
is for free. (You can also have a copy from me).
SED is a nice tool that serves very well with REGULAR EXPRESSIONS.
You'll have to create a regular expression for SED that searches for
all lines with [DllImport("mydll.Dll")]. Then remove that
[DllImport("mydll.Dll")] from the line an feed everything else to
doxygen.
Note that your source files will not be changed.
You will still have your full code for your compiler
[DllImport("mydll.Dll")] private static extern ushort myFunction();
but Doxygen only gets a filtered version, where all occurrence of
[DllImport("mydll.Dll")] in all files are missing. Well, you will not
notice in Doxygen documenation that this is a DLL-import. But simply
make a manual textual note.
In the config file you have
INPUT_FILTER = "sed -r s/\[DllImport[(]\".*\"[)]\]//"
The s/xxx/yyy/ is the regular expression for "substitute".
It replaces XXX by YYY.
XXX is a search pattern for [DllImport("any text")], it is replaced
by nothing i.e. it is removed. Therefore YYY is empty.
I hope the regular expression I gave you is correct. I have not
tested it specificly. For one of my own project I use this SED-method
(ofcourse with something else than your DLLimport) very successfully.
Don't get discouraged by the "awfull" regular expressions. They are
very usefull also for many other things not only with SED.
I you decide to try this method, I can give you more help.
Good luck
Clemens
> [DllImport("mydll.Dll")]
> /// <summary>
> /// This function does blah blah blah.
> /// </summary>
> /// <returns></returns>
>
>
> However, I still got the same Doxygen error when I did it this way. Oddly
> enough, the error was for the line the function is declared, not the DLL
> import line. I also tried putting a new line in-between DLLImport and
> ///<summary>. That didn't produce any different results.
>
> It looks like the DLLImport statement is offsetting things or otherwise
> messing things up. Does anyone know a workaround to that problem?
>
> Thank you for your help,
> Deeder
>
-----------------------------------
Dipl. Ing. Clemens Feige
Osypka Medical GmbH
c.feige <at> osypkamed.com
www.osypkamed.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
RSS Feed