#include #include #include "defs.h" #include "data.h" /* * SYMBOL_NAME 32 * TYPE 1 * LENGTH 2 * initialisation */ /** * a constructor :-) */ void create_initials() { int i; for (i=0; i> 8; initials_table_ptr[index + 1] = 0xff & value; length++; initials_table_ptr[INIT_LENGTH] = (0xff00 & length) >> 8; initials_table_ptr[INIT_LENGTH+1] = 0xff & length; } /** * get number of data items for given symbol * @param symbol_name * @return */ int get_size(char *symbol_name) { int result = 0; if (find_symbol(symbol_name) != 0) { result = ((unsigned char)initials_table_ptr[INIT_LENGTH] << 8) + (unsigned char)initials_table_ptr[INIT_LENGTH+1]; } return result; } /** * get item at position * @param symbol_name * @param position * @return */ int get_item_at(char *symbol_name, int position) { int result = 0; if (find_symbol(symbol_name) != 0) { int index = NAMESIZE + 1 + 2 + (2 * position); result = (initials_table_ptr[index] << 8) + (unsigned char)initials_table_ptr[index+1]; } return result; }