FIDAL - Financial Data Access Library |
| NAME
DATA STRUCTURE typedef struct Allocate and return a table representing ALL the symbols belonging to a particular category. 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. Not specifying a category (using NULL) will return all symbols under the default category called "ZZ.OTHER.OTHER". The table returned by this function should be considered read only. Modifying size and/or string can have unpredictable consequence. The whole table can be freed by calling FD_SymbolTableFree. The string returned in the table will not exceed the number of bytes specified by FD_SYMBOL_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_SymbolTableFree , FD_CategoryTableAlloc , FD_Initialize , FD_AddDataSource EXAMPLE
#include <stdio.h>
#include "fidal.h"
void showAllSymbols( FD_UDBase *udBase,
const char *theCategory )
{
FD_StringTable *table;
FD_RetCode retCode;
int i;
printf( "The category %s contains\n", theCategory );
printf( "the following symbols:\n" );
retCode = FD_SymbolTableAlloc( udBase, theCategory, &table );
if( retCode == FD_SUCCESS )
{
for( i=0; i < table->size; i++ )
printf( "%s\n", table->string[i] );
FD_SymbolTableFree( table );
}
}
|
|