doxygen index C functions - c

How can I index the C functions for the search engine? E.g. I have the following piece of code documented.
/**
....
* #defgroup MyGroup
*
* #{
*/
/**
* Initialize TCN.
...
*/
int myfunction(void);
...
The myfunction is documented on the HTML under MyGroup. With the search engine I get only the structures not the functions. I'm using the client search engine.
Thanks

Based upon your comment style, you could try to use JAVADOC_AUTOBRIEF = YES to have doxygen interpret the first line within a comment header as a brief description.
You can also set EXTRACT_ALL = YES to have doxygen behave as if all functions are documented even if no documentation is available. It will extract all functions except private class members.
To also include private class members include EXTRACT_PRIVATE = YES
Good luck.

Related

Doxygen custom tag with a placeholder

Is it somehow possible in Doxygen to create a custom tag, which creates a documentation using a placeholder tag as its input?
What I want to accomplish is to create a custom tag for requirements. As our DOORS Urls are quite long, and diverge from SW-component to SW-component, I want to create something similar to this:
#file somefile.c
#doorsdocurl <URL to DOORS document> -> this is going to be my placeholder
...
...
...
/**
* #brief somedescription
* #req{doorsdocurl: <reqID1, reqID2,...> } -> this is going to be the second custom tag
*/
void jambo()
{
}
Is this somehow achievable with Doxygen? From what I have read, one has to put his custom tags within the ALIASES variable
In your Doxyfile you would need something like:
ALIASES = "doorsdocurl_sw_1=<URL to DOORS document>" \
"req{2}=\1 \2<br>"
and the code would look like:
/**
* #brief somedescription
*
* #req{#doorsdocurl_sw_1,reqID1}
* #req{#doorsdocurl_sw_1,reqID2}
*/
void jambo()
{
}
The \req command can of course be extended with other commands, in this respect the command xrefitem might be useful, see the manual (http://www.doxygen.nl/manual/commands.html#cmdxrefitem)

Extended Module/Group Documentation in external file

I have a maybe simple problem, but my Google-Fu produced no results.
I have a doxygen documented header file like this:
/**
* #file filename.h
*
* #date today
* #author me
*
* #defgroup mygroup grouptitle
* #brief my nice functions
*
* Here is a medium sized description, 4-5 lines, which outline the
* functions and the way these functions work together, what is init,
* what is the main function of this module and maybe additional
* information on used hardware (as it is mainly embedded software).
*
* Here starts another description block, typical length around 20-50
* lines. Detailed Hardware description, code snippets as examples and
* so on. I want to remove this section from the header file and
* replace it by something like
* /special_doyxgen_command_to_insert extended_doc_mygroup.md
*
* \addtogroup mygroup
* #{
*/
here are function definitions, enums, defines and what else
/** #} */
I have no idea if this is possible but I have an additional mygroup.md in which some examples are given and and the general usage is shown. Depending on the file it has 10 - 50 lines, mostly 1 or 2 code examples.
In the past I inserted the examples in the header/sourcefiles, but I don't like that approach, so I created a markdown file and linked to this via the doxygen ref functions.
What I would like is a 'insert' tag that inserts the .md contend in the 'Detailed Description' Section of my Group Documentation (the HTML and Latex files).
Is there such a command (or a set of commands to get my approach?)
There are many commands existing to include external code examples in your documentation. Have a look at configuration tag EXAMPLE_PATH and the special commands #include and #snippet. You could create a directory called "examples" where you put your example files into and tell doxygen by entering this directory in the EXAMPLE_PATH tag:
EXAMPLE_PATH = ./examples
Then you create some example files, e.g: examples_1.c
/// [Example1]
/// Here some more text to explain the example which is not shown by the \#snippet command.
// But normal comments are shown as a part of the code
for(;;)
{
doSomething();
}
/// [Example1]
/// [Example2]
while(1)
{
doSomething2();
}
/// [Example2]
Now you can add these code snippets using the #snippet command in your group documentation:
/**
* #defgroup ...
* ...
* #snippet examples_1.c Example1
* ...
* #snippet examples_1.c Example2
*/
Alternatively you can include the code of a whole source file:
/**
* ...
* #include examples_2.c
* ...
*/
Another aprroach you should look at is the usage of the #copydoc and #copydetails command.
Hope this answers your question.

doxygen in c: grouping of defines

I'm documenting C code with doxygen. To make the documentation more readable I want to at least add code in every .c/.h file pair to one group using #defgroup and #ingroup. Inside these groups I want to group some defines together using #name blocks.
The result in the "file" pages looks closely to what I expected: Everything that's documented in the file is listed there and more or less nicely grouped.
In the "module" pages on the other hand only functions and variables are listed and the defines before the first #name block are listed under "variables". All other defines and enums are missing.
Removing the #name blocks lists all defines/typedefs/enums under "variables". No own sections for macros or enums and no further grouping on these pages.
How do I get all defines and enums in a group listed on the module/group page like on the file pages where the defines/functions etc. are documented?
I use doxygen 1.8.9.1 windows binarires.
My code looks similar to this:
.h file:
/** #file
* blabla
* #author bla
*/
/// #ingroup MY_GRP
/// #{
#define SOMEDEF1 1
/// #name Special defs
/// #{
#define SOMEDEF2 2
/// #}
enum someenum {
foo,
bar
};
extern int some_variables;
extern void some_proc(int baz);
/// #}
.c file looks like this:
/** #file
* blabla
* #author bla
*/
/** #defgroup MY_GRP A test group.
* Description
*/
/// #{
#include "my.h"
/// Important variable.
int some_variable;
/** Important proc
* Description
* #param baz need this
*/
void some_proc(int baz) {
// code
}
/// #}
I let doxygen wizzard generate a doxyfile and also generated a DoxygenLayout.xml file.
When playing arround with the layout file I found that the "defines" tags on the group pages are empty (they apparently do nothing) while the "defines" in the variables section are generated by a "membergroups" tag... Don't know what to make of this.
Any help is much appreciated. If you need the doxyfile or anything else let me know.
Adding all members of a file to a group can be accomplished using the #addtogroup tag.
The same question is already answered here:
Doxygen: Can file members inherit a module grouping if they are in a file that is grouped?

Accessing the methods of a preprocessor name dataset in Progress 4GL

I'm trying to access the methods of a dataset in Progress, where the dataset is defined as a preprocessor item. I'm just learning 4GL... maybe this isn't even possible? Here is the scenario in code:
/*My Procedure*/
{Receipt/Receipt_ds.i}
def var hReceipt as handle no-undo.
def var hDataSet as handle no-undo.
run Receipt/Receipt.p persistent set hReceipt.
run GetData in hReceipt ({&input-output_dataset_ReceiptDataSet}).
/* do some stuff */
/* get the handle to the dataset??? Obvious syntax issue here. */
hDataSet = DATASET {&input-output_dataset_ReceiptDataSet}:HANDLE.
/* Empty the DataSet (this is what I want to do)*/
hDataSet:EMPTY-DATASET().
and here's my include file:
/*Receipt/Recipt_ds.i*/
define dataset ReceiptDataSet for
ttRcvHead,
ttRcvDtl,
data-relation for ttRcvHead, ttRcvDtl relation-fields(
stuff, stuff
).
&global-define input-output_dataset_ReceiptDataSet input-output dataset ReceiptDataSet
Clearly my code does not have the correct syntax as mentioned in my comment. Does anyone know what the right way of doing this would be?
This piece:
hDataSet = DATASET {&input-output_dataset_ReceiptDataSet}:HANDLE
is doing this:
hDataSet = DATASET input-output dataset ReceiptDataSet:HANDLE
which isn't working as you've discerned. You need to get to this form instead:
hDataSet = DATASET ReceiptDataSet:HANDLE
If you put a
&GLOBAL-DEFINE pdsName ReceiptDataSet
in your include file and then referenced that where appropriate, then this construct would work:
hDataSet = DATASET {&pdsName}:HANDLE
For starters you need to define a pre-processor before you attempt to use it.
Not at the end of the file.
The next thing that comes to mind is why? Why are you trying to use a pre-processor for this purpose? It clearly isn't to make the code any shorter or more understandable. One reason might be because your code snippet is some sort of common template but that doesn't seem to be the case here.

Missing MSDN documentation to develop xll add ins?

I spent quite a lot of time in looking for the full documentation of all the C API XLM Functions without success.
I found this page which illustrate a few of them:
http://msdn.microsoft.com/en-us/library/office/bb687910%28v=office.12%29.aspx
But for instance I wanted to understand and use xlfAddMenu, and I cannot find a page on MSDN that explain me.
Do you know if there is any documentation available? Apparently it is not so easy to get there.
There is no exhaustive official documentation for all C API XLM functions. However, as the documentation says following regarding C API XLM functions:
Many more functions are exposed by Excel via the C API that are useful
when you are developing XLLs. They correspond to the Excel worksheet
functions and functions and commands that are available from XLM macro
sheets."
Also, the EXAMPLE.[C,H] files which comme with the installation of the SDK use some of these functions and you can use it to learn how to use them. For instance, the xlfAddMenu is used in the xlAutoOpen callback function.
// In the following block of code, the Generic drop-down menu is created.
// Before creation, a check is made to determine if Generic already
// exists. If not, it is added. If the menu needs to be added, memory is
// allocated to hold the array of menu items. The g_rgMenu[] table is then
// transferred into the newly created array. The array is passed as an
// argument to xlfAddMenu to actually add the drop-down menu before the
// help menu. As a last step the memory allocated for the array is
// released.
//
// This block uses TempStr12() and TempNum12(). Both create a temporary
// XLOPER12. The XLOPER12 created by TempStr12() contains the string passed to
// it. The XLOPER12 created by TempNum12() contains the number passed to it.
// The Excel12f() function frees the allocated temporary memory. Both
// functions are part of the framework library.
Excel12f(xlfGetBar, &xTest, 3, TempInt12(10), TempStr12(L"Generic"), TempInt12(0));
if (xTest.xltype == xltypeErr)
{
hMenu = GlobalAlloc(GMEM_MOVEABLE,sizeof(XLOPER12) * g_rgMenuCols * g_rgMenuRows);
px = pxMenu = (LPXLOPER12) GlobalLock(hMenu);
for (i=0; i < g_rgMenuRows; i++)
{
for (j=0; j < g_rgMenuCols; j++)
{
px->xltype = xltypeStr;
px->val.str = TempStr12(g_rgMenu[i][j])->val.str;
px++;
}
}
xMenu.xltype = xltypeMulti;
xMenu.val.array.lparray = pxMenu;
xMenu.val.array.rows = g_rgMenuRows;
xMenu.val.array.columns = g_rgMenuCols;
Excel12f(xlfAddMenu,0,3,TempNum12(10),(LPXLOPER12)&xMenu,TempStr12(L"Help"));
GlobalUnlock(hMenu);
GlobalFree(hMenu);
}
According to me the best documentation (but not updated..) is the following book : Financial Applications using Excel Add-in Development in C / C++, 2nd Edition by Steve Dalton. You can find description of the xlfAddMenu function page 332. You can also find some useful information in the chm file of the Microsoft Excel XLL Software Development Kit, including codes examples (note I did not found the xlfAddMenu in it so I guess it is a depreciated function).

Resources