Doxygen packed definition - doxygen

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

Related

Doxygen doesn't generate any documentation

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.

Generate man pages from doxygen style comments

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.

Does progress 4GL language support hierarchical queries?

The simple question subscribed on progress site:
Does progress 4GL language support hierarchical queries like Oracle (Connect by clause) or Sql Server(CTE)?
I have the following table:
Name parent
-----------------------
Elizabeth II null
Charles Elizabeth II
Andrew Elizabeth II
Edward Elizabeth II
Harry Charles
William Chales
James Edward
George William
Is there a script in progress that will generate the following output?
Elizabeth II
|_Charles
|_William
|_George
|_Harry
|_Andrew
|_Edward
|_James
Since Progress 4GL (actually ABL since a couple years) is a complete turing complete language you can. However perhaps not in a single query...
This recursive example does it, you could do in a number of different ways. You can start with this code but you might need to have more error checks etc.
DEFINE TEMP-TABLE ttPerson NO-UNDO
FIELD PersonName AS CHARACTER FORMAT "x(20)"
FIELD PersonParent AS CHARACTER.
/* A procedure for loading example data */
PROCEDURE createPerson:
DEFINE INPUT PARAMETER pcName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcParent AS CHARACTER NO-UNDO.
CREATE ttPerson.
ASSIGN
ttPerson.personName = pcName
ttPerson.personParent = pcParent.
END.
/* Load some data */
RUN createPerson("Elizabeth II", "").
RUN createPerson("Charles", "Elizabeth II").
RUN createPerson("Andrew", "Elizabeth II").
RUN createPerson("Edward", "Elizabeth II").
RUN createPerson("Harry", "Charles").
RUN createPerson("William", "Charles").
RUN createPerson("James", "Edward").
RUN createPerson("George", "William").
/* Define a frame where the result will be displayed */
DEFINE FRAME f1 ttPerson.personName WITH 20 DOWN.
/* The recursive prodecure */
/* pcPerson - the person where to start track heritage (or perhaps it should have been lineage?*/
/* piDepth, just to format the output */
PROCEDURE trackHeritage:
DEFINE INPUT PARAMETER pcPerson AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER piDepth AS INTEGER NO-UNDO.
piDepth = piDepth + 1.
/* Find the tracked person */
FIND FIRST ttPerson NO-LOCK WHERE ttPerson.personName = pcPerson NO-ERROR.
IF AVAILABLE ttperson THEN DO:
DISPLAY FILL(" ", piDepth) + "|_" + ttPerson.personName # ttPerson.personName WITH FRAME f1.
DOWN 1 WITH FRAME f1.
/* Track all available children to the person */
FOR EACH ttPerson NO-LOCK WHERE ttPerson.personParent = pcPerson:
RUN trackHeritage(ttPerson.personName, piDepth).
END.
END.
END.
/* Start tracking */
RUN trackHeritage("Elizabeth II", 0).
MESSAGE "Done" VIEW-AS ALERT-BOX.

How to export data from browser widget to CSV in Progress 4Gl

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.

RC special variable in REXX?

how to assign a value to RC special variable in REXX?
/* REXX */
"LISTDS ?" /* Command that sets RC to 12 */
SAY 'RC IS' RC /* RC is 12 */
RC = X /* RC set to X */
SAY 'RC IS' RC /* RC is X */
The above works, there is nothing special about the RC variable except it will be over written by the return code from the last command.
So you can set it to whatever you want at least on a mainframe running Zos.
Maybe you need to provide more detail in your question like what type of Rexx it is (Classic or OO) and what environment you are using.
If you want to set the return value of your method you need to use the "return" commend and to get the return code with the "result", for example:
/* REXX - program A */
SAY "THIS IS PROG. A WITH RC = 4"
RETURN 4
/* REXX - PROGRAM B */
SAY "CALLING PROGRAM A..."
CALL PROG_A
RC = RESULT
SAY "RC = "RC " RETURN FROM PROGRAM A..."
As Deuian said before, RC is set by last command executed and more detail should be provided to get a precise answer (environment, goal/task, batch/interactive etc.).
A silly working way to set RC on Zos REXX is to make a buffer: RC is set to the buffer count (so if you need RC = 100 you should create 100 buffers...), see the example (I do not endorse the usage of this method, it's just a conjecture)
/* rexx */
'MAKEBUF'
say RC
'MAKEBUF'
say RC
'DROPBUF'
say RC
/* exec output */
1
2
0
***
Beware that the previous code leaves a buffer active! (another DROPBUF needed)
The SAY instructions will send screen prompts or include text in the output. If you want to set the RC to something that can be interpreted by subsequent steps in a job, try:
/* REXX */
setrc = X /* set a variable for RC to X */
exit(setrc)