Main Page Modules Alphabetical List Data Structures File List Data Fields Globals

# gnc-pricedb.h File Reference

a simple price database for gnucash. More...

`#include "date.h"`
`#include "gnc-commodity.h"`
`#include "gnc-numeric.h"`
`#include "gnc-engine.h"`
`#include "guid.h"`
`#include <stdio.h>`

## Typedefs

typedef gnc_price_s | GNCPrice
typedef gnc_price_lookup_s | GNCPriceLookup
typedef gnc_price_db_s | GNCPriceDB

## Functions

GNCPrice * | gnc_price_create (GNCBook *book)
GNCPrice * | gnc_price_clone (GNCPrice *p, GNCBook *book)
void | gnc_price_ref (GNCPrice *p)
void | gnc_price_unref (GNCPrice *p)
void | gnc_price_begin_edit (GNCPrice *p)
void | gnc_price_commit_edit (GNCPrice *p)
void | gnc_price_set_commodity (GNCPrice *p, gnc_commodity *c)
void | gnc_price_set_currency (GNCPrice *p, gnc_commodity *c)
void | gnc_price_set_time (GNCPrice *p, Timespec t)
void | gnc_price_set_source (GNCPrice *p, const char *source)
void | gnc_price_set_type (GNCPrice *p, const char *type)
void | gnc_price_set_value (GNCPrice *p, gnc_numeric value)
void | gnc_price_set_version (GNCPrice *p, gint32 versn)
GNCPrice * | gnc_price_lookup (const GUID *guid, GNCBook *book)
const GUID * | gnc_price_get_guid (GNCPrice *p)
const GUID | gnc_price_return_guid (GNCPrice *p)
GNCBook * | gnc_price_get_book (GNCPrice *p)
gnc_commodity * | gnc_price_get_commodity (GNCPrice *p)
gnc_commodity * | gnc_price_get_currency (GNCPrice *p)
Timespec | gnc_price_get_time (GNCPrice *p)
const char * | gnc_price_get_source (GNCPrice *p)
const char * | gnc_price_get_type (GNCPrice *p)
gnc_numeric | gnc_price_get_value (GNCPrice *p)
gint32 | gnc_price_get_version (GNCPrice *p)
gboolean | gnc_price_equal (GNCPrice *p1, GNCPrice *p2)
gboolean | gnc_price_list_insert (GList **prices, GNCPrice *p)
gboolean | gnc_price_list_remove (GList **prices, GNCPrice *p)
void | gnc_price_list_destroy (GList *prices)
gboolean | gnc_price_list_equal (GList *prices1, GList *prices2)
GNCPriceDB * | gnc_pricedb_create (GNCBook *book)
void | gnc_pricedb_destroy (GNCPriceDB *db)
gboolean | gnc_pricedb_add_price (GNCPriceDB *db, GNCPrice *p)
gboolean | gnc_pricedb_remove_price (GNCPriceDB *db, GNCPrice *p)
GNCPrice * | gnc_pricedb_lookup_latest (GNCPriceDB *db, gnc_commodity *commodity, gnc_commodity *currency)
GList * | gnc_pricedb_lookup_latest_any_currency (GNCPriceDB *db, gnc_commodity *commodity)
GList * | gnc_pricedb_get_prices (GNCPriceDB *db, gnc_commodity *commodity, gnc_commodity *currency)
GList * | gnc_pricedb_lookup_at_time (GNCPriceDB *db, gnc_commodity *commodity, gnc_commodity *currency, Timespec t)
GList * | gnc_pricedb_lookup_at_time_any_currency (GNCPriceDB *db, gnc_commodity *c, Timespec t)
GList * | gnc_pricedb_lookup_day (GNCPriceDB *db, gnc_commodity *commodity, gnc_commodity *currency, Timespec t)
GList * | gnc_pricedb_lookup_day_any_currency (GNCPriceDB *db, gnc_commodity *c, Timespec t)
GNCPrice * | gnc_pricedb_lookup_nearest_in_time (GNCPriceDB *db, gnc_commodity *c, gnc_commodity *currency, Timespec t)
GList * | gnc_pricedb_lookup_nearest_in_time_any_currency (GNCPriceDB *db, gnc_commodity *c, Timespec t)
gnc_numeric | gnc_pricedb_convert_balance_latest_price (GNCPriceDB *pdb, gnc_numeric balance, gnc_commodity *balance_currency, gnc_commodity *new_currency)
gnc_numeric | gnc_pricedb_convert_balance_nearest_price (GNCPriceDB *pdb, gnc_numeric balance, gnc_commodity *balance_currency, gnc_commodity *new_currency, Timespec t)
gboolean | gnc_pricedb_foreach_price (GNCPriceDB *db, gboolean(*f)(GNCPrice *p, gpointer user_data), gpointer user_data, gboolean stable_order)
gboolean | gnc_pricedb_dirty (GNCPriceDB *db)
guint | gnc_pricedb_get_num_prices (GNCPriceDB *db)
gboolean | gnc_pricedb_equal (GNCPriceDB *db1, GNCPriceDB *db2)
void | gnc_price_print (GNCPrice *db, FILE *f, int indent)
void | gnc_pricedb_print_contents (GNCPriceDB *db, FILE *f)

## Detailed Description

a simple price database for gnucash.

The PriceDB is intended to be a database of price quotes, or more specifically, a database of GNCPrices. For the time being, it is still a fairly simple database supporting only fairly simple queries. It is expected that new queries will be added as needed, and that there is some advantage to delaying complex queries for now in the hope that we get a real DB implementation before they're really needed.

Every GNCBook contains a GNCPriceDB, accessable via gnc_book_get_pricedb.