I have added doxygen comments all through-out my code. They are in this format:-
/**
* #brief
* functionName() - function description
*
* #param[in] variable_in - datatype
*
* #par Side-Effects: none
*
* #par MT-Unsafe
*
* #return target return type
*
*/
My requirement is to generate man pages through these. How do I do this? There seems to be no straight-forward way to do this, as far as I have researched.
Related
No documentation is generated for any of the functions for my C repo
My configuration:
# Difference with default Doxyfile 1.9.1
PROJECT_NAME = WLib
OUTPUT_DIRECTORY = doxy
OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_ALL = YES
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = YES
INPUT = .
FILE_PATTERNS = *.c \
*.h
RECURSIVE = YES
Edit the code:
/** \fn Array Fill
* \param sa size of the array A in bytes
* \param a the array A
* \param sb size of the array B in bytes
* \param b the array B
* \brief Takes two arrays and their sizes. Fills the array A with as many
* instances of array B as the size of array A can handle.
* \return The array A
* Method:
* -# If /e a = NULL, then the array of size /e sa will be allocated
* -# If /e b = NULL and /e sb = 0, then array will be filled with zeros
* -# If /e sb = 0, the function does nothing and returns NULL
* -# Declares a variable /e i, this is be the pointer offset
* -# Assignes array /e b to array /e a offsetted by /e i, and incriments
* /e i by /e sb. This step is repeated until less than sb bytes are
* left untreated
* -# Assignes the remaining part of array /e a with whatever piece of
* array /e b fits
*/
VO* afl(register const U16 sa,
register VO* a,
register U8 sb,
register const VO* b ) {
...
}
The supplied code gives directly an answer when running it, it gives the warning:
warning: documented symbol 'Array Fill' was not declared or defined.
when looking at the code we see here:
\fn Array Fill
but from the documentation we learn:
\fn (function declaration)
Indicates that a comment block contains documentation for a function
(either global or as a member of a class). This command is only needed
if a comment block is not placed in front (or behind) the function
declaration or definition.
If your comment block is in front of the function declaration or
definition this command can (and to avoid redundancy should) be
omitted.
A full function declaration including arguments should be specified
after the \fn command on a single line, since the argument ends at the
end of the line!
and furthermore in the given example in the documentaion:
const char *member(char,int) throw(std::out_of_range);
and
/*! \fn const char *Fn_Test::member(char c,int n)
* \brief A member function.
* \param c a character.
* \param n an integer.
* \exception std::out_of_range parameter is out of range.
* \return a character pointer.
*/
in other words the syntax for the \fn command should be in this case:
\fn VO* afl(register const U16 sa, register VO* a, register U8 sb, register const VO* b)
Note:
the \fn command is typically for the usage when the documentation of a function is not directly in font of the function. In the case of the issue the \fn command is not necessary.
It looks like that the \fn here is used in the context of the \brief command and the used \brief command in the context of the \details command.
I use ASCIIdoc macros, and I would like to embedded counter in a substitution macro, but it doesn't work as expected.
source document:
:macro-with-counter: foo-{counter:id}
* {macro-with-counter}: bar-one
* {macro-with-counter}: bar-two
* {macro-with-counter}: bar-three
expected rendering with an incrementing counter:
foo-1: bar-one
foo-2: bar-two
foo-3: bar-three
actual rendering:
foo-1: bar-one
foo-1: bar-two
foo-1: bar-three
Is it possible to nest a counter in a substitution macro in ASCIIdoc?
Try this code:
foo-id: 0
* foo-{counter:foo-id}: bar-one
* foo-{counter:foo-id}: bar-two
* foo-{counter:foo-id}: bar-three
Simple answer: it is not possible to nest macros in ASCIIdoc. This implies a recursion capability that isn't there.
In my .h file of my C program I have a function:
/** Calculates foo using algorithm A1.
* \param[in] v1 first input
* \param[in] v2 second input
* \param[in] s1 first string
* \param[in] s2 second string
* \return foo(v1,v2)
*/
int foo( int v1, int v2, char *s1, char *s2);
Now in the beginning of the file I want to discuss the function. So I say:
/** To facilitate such operations I have:
* #li int foo( int v1, int v2, char *s1, char *s2)
*
* which allows me to blah.
*/
Now in my doxygen file, the word foo is not linked to the function definition section at the end. However, if I say:
/** To facilitate such operations I have:
* #li int foo()
*
* which allows me to blah.
*/
The autolinking works fine. Including the arguments breaks the autolinking function and I can't for the life of me figure out why. This happens to all my functions which have > 1 input arguments. foo() and foo(int i) work but foo(int i, int j, int k, int m) does not work. Does anyone have any idea why this occurs?
I am trying to document a packed type with Doxygen but I can't figure it out : I don't have the description of each item, do you have an idea of how can I do this ? In the final output, I just have my #brief & detailled description..
/**
* #typedef Pack
*
* #brief Description
* Detailled description
*
*/
typedef enum
__packed
{
A = 0, //!< Description 1
B = 1, //!< Description 2
C = 2 //!< Description 3
}Pack, *PPack;
Thanks for your help !
The comment of #albert is correct but probably a bit short.
For your comfort I state the information form the Doxygen manual that Albert refers to.
To make doxygen understand the __packed keyword you have to adjust your doxygen configuration file like this:
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = __packed
Here you find more information: http://www.doxygen.nl/manual/preprocessing.html
Did anyone tried to export data directly from browser to CSV? We are populating data to browser which has complex logic. If i can get data directly from browser to CSV that would be helpful.
Thanks,
MSK
Are you referring to a browse widget? A browse widget visualizes the data in an underlying query -- the query result set would be what you want to export. There is no EXPORT method for a query so, unfortunately you will need to roll your own. Something like this (many details omitted):
function exportData returns logical ( input bh as handle ):
define variable bf as handle no-undo. /* handle to the field */
define variable f as integer no-undo. /* field number */
define variable i as integer no-undo. /* array index */
do f = 1 to bh:num-fields: /* for each field... */
bf = bh:buffer-field( f ). /* get a pointer to the field */
if f > 1 then put stream expFile unformatted field_sep. /* output field separator */
if bf:extent = 0 then /* is it an array? */
put stream expFile unformatted
( if bf:data-type = "character" then /* character data needs to be quoted to */
quoter( string( bf:buffer-value )) /* handle (potential) embedded delimiters */
else /* and quotes within quotes! */
string( bf:buffer-value ) /* other data types should not be quoted */
)
.
else /* array fields need special handling */
do i = 1 to bf:extent: /* each extent is exported individually */
if i > 1 then put stream expFile unformatted field_sep. /* and a field separator */
put stream expFile unformatted
( if bf:data-type = "character" then /* see above... */
quoter( string( bf:buffer-value( i )))
else
string( bf:buffer-value( i ))
)
field_sep
.
end.
end.
put stream expFile skip. /* don't forget the newline! ;-) */
return true.
end.
/* main block...
*/
/* skipping a few things like defining variables and setting up the query that you have, presumably, already done... */
output to "output.dat".
qh:get-first( no-lock ) no-error. /* try to fetch the first record */
do while ( qh:query-off-end = no ): /* loop while there is data being fetched */
exportData( bh ). /* write it to the output file! */
assign /* track the number of records written... */
r = r + 1 /* per table */
.
qh:get-next( no-lock ) no-error. /* fetch the next record */
end.