FIDAL - Financial Data Access Library |
| NAME
DATA STRUCTURE Allocate and return a table representing ALL the categories actually contained in the unified database. The categories are optionally specified when doing FD_AddDataSource. A category will typically represent the exchange to which the symbols can belong. But in practice, a category can be any string ("NASDAQ", "AMEX", "MY STOCK LIST", "TECH GROUP"). There is ALWAYS at least one existing category. It is called the "ZZ.OTHER.OTHER" category and it is used when a symbol was added without specifying a category with FD_AddDataSource. The table returned by this function should be considered read only. Modifying the size and/or string fields can have unpredictable consequence. The whole table can be freed by calling FD_CategoryTableFree. The string returned in the table will not exceed the number of bytes specified by FD_CATEGORY_MAX_LENGTH.
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_CategoryTableFree , FD_SymbolTableAlloc , FD_Initialize , FD_AddDataSource EXAMPLE
#include <stdio.h>
#include "fidal.h"
void showAllCategory( FD_UDBase *udBase )
{
FD_StringTable *table;
FD_RetCode retCode;
int i;
printf( "This unified database contains the\n" );
printf( "following categories:\n" );
retCode = FD_CategoryTableAlloc( udBase, &table );
if( retCode == FD_SUCCESS )
{
for( i=0; i < table->size; i++ )
printf( "%s\n", table->string[i] );
FD_CategoryTableFree( table );
}
}
|
|