#ifndef ASSETS_H #define ASSETS_H #include "quotes.h" #include #define FOREACH_ASSET_TYPE(M) \ M(STOCK) \ M(OPTION) \ M(CRYPTO) \ M(TOTAL) #define GENERATE_ENUM(T) T, #define GENERATE_STRING(T) #T, enum asset_type { FOREACH_ASSET_TYPE(GENERATE_ENUM) }; // FIXME PREFIX extern char *ASSET_TYPE_NAMES[]; struct asset { char *symbol; enum asset_type type; bool usd, btc; double amt, usd_pr, usd_ch, usd_tot, btc_pr, btc_ch, btc_tot; }; void asset_free(struct asset *a); int asset_cmp(const void *a, const void *b); void add_quotes_to_assets(struct asset **, int, struct quote **, int); int add_totals(struct asset **, int); #endif