NAME FD_Report - C Function SYNOPSIS #include <stdio.h> #include "fidal.h"
FD_RetCode FD_Report( const FD_UDBase *dbase, FILE *out, FD_ReportFlags flags );
DESCRIPTION Allows to output information about the contents of an unified database. The generated report can be sent to stdout, stderr or to any files the user has previously opened. PARAMETER 'flags' Can be a combination of any of the following definition (can be or'ed using the '|' operator) | FD_REPORT_SYMBOL | All symbols in the unified database are going to be reported. | | FD_REPORT_CATEGORY | All category in the unified database are going to be reported. If FD_REPORT_SYMBOL is also defined, the symbols are going to be visually placed under each corresponding category. | | FD_REPORT_SOURCE | Indicate the data source used by the unified database. If FD_REPORT_SYMBOL and/or FD_REPORT_SYMBOL is also defined, the data source corresponding to each category/symbol is output. More than one data source can be output for the same category/symbol. | | FD_REPORT_TOTAL | Add the total number of distinct categories and symbols at the end of the output. |
RETURN VALUE
| FD_SUCCESS | Operation is successful | | FD_ALLOC_ERR | Cannot allocate memory, or memory corruption detected | | FD_UNKNOWN_ERR | Operation failed for unknown reason |
For other error code, or to match a number to an error description, check the FD_RetCode enumeration in "FIDAL/c/include/fd_common.h" SEE ALSO FD_Initialize , FD_AddDataSource EXAMPLE
#include <stdio.h>
#include "fidal.h"
void outputReports( FD_UDBase *dbase )
{
FILE *myFile;
/* Print on stdout the number of category and symbols. */
FD_Report( dbase, stdout, FD_REPORT_TOTAL );
/* Print in a file the list of category and symbols */
myFile = fopen( "output.txt", "w" );
if( myFile != 0 )
{
FD_Report( dbase, myFile, FD_REPORT_SYMBOL|FD_REPORT_CATEGORY );
fclose( myFile );
}
}
|