GnuCash  4.6-313-gb6cbc9786+
gnc-commodity.h
Go to the documentation of this file.
1 /********************************************************************
2  * gnc-commodity.h -- API for tradable commodities (incl. currency) *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20  * *
21  *******************************************************************/
22 
46 #ifndef GNC_COMMODITY_H
47 #define GNC_COMMODITY_H
48 
49 typedef struct _GncCommodityClass gnc_commodityClass;
50 typedef struct _GncCommodityNamespaceClass gnc_commodity_namespaceClass;
51 
52 #ifdef __cplusplus
53 extern "C++" {
54 #include <glib.h>
55 #include <glib/gi18n.h>
56 }
57 #endif
58 
59 #include "gnc-engine.h"
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /* --- type macros --- */
66 #define GNC_TYPE_COMMODITY (gnc_commodity_get_type ())
67 #define GNC_COMMODITY(o) \
68  (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_COMMODITY, gnc_commodity))
69 #define GNC_COMMODITY_CLASS(k) \
70  (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_COMMODITY, gnc_commodityClass))
71 #define GNC_IS_COMMODITY(o) \
72  (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_COMMODITY))
73 #define GNC_IS_COMMODITY_CLASS(k) \
74  (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_COMMODITY))
75 #define GNC_COMMODITY_GET_CLASS(o) \
76  (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_COMMODITY, gnc_commodityClass))
77 GType gnc_commodity_get_type(void);
78 
79 /* --- type macros --- */
80 #define GNC_TYPE_COMMODITY_NAMESPACE (gnc_commodity_namespace_get_type ())
81 #define GNC_COMMODITY_NAMESPACE(o) \
82  (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_COMMODITY_NAMESPACE, gnc_commodity_namespace))
83 #define GNC_COMMODITY_NAMESPACE_CLASS(k) \
84  (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_COMMODITY_NAMESPACE, gnc_commodity_namespaceClass))
85 #define GNC_IS_COMMODITY_NAMESPACE(o) \
86  (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_COMMODITY_NAMESPACE))
87 #define GNC_IS_COMMODITY_NAMESPACE_CLASS(k) \
88  (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_COMMODITY_NAMESPACE))
89 #define GNC_COMMODITY_NAMESPACE_GET_CLASS(o) \
90  (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_COMMODITY_NAMESPACE, gnc_commodity_namespaceClass))
91 GType gnc_commodity_namespace_get_type(void);
92 
93 
94 #define GNC_COMMODITY_TABLE "gnc_commodity_table"
95 
107 #define GNC_COMMODITY_NS_LEGACY "GNC_LEGACY_CURRENCIES"
108 #define GNC_COMMODITY_NS_TEMPLATE "template"
109 /* The ISO define is deprecated in favor of CURRENCY */
110 #define GNC_COMMODITY_NS_ISO "ISO4217"
111 #define GNC_COMMODITY_NS_CURRENCY "CURRENCY"
112 #define GNC_COMMODITY_NS_NASDAQ "NASDAQ"
113 #define GNC_COMMODITY_NS_NYSE "NYSE"
114 #define GNC_COMMODITY_NS_EUREX "EUREX"
115 #define GNC_COMMODITY_NS_MUTUAL "FUND"
116 #define GNC_COMMODITY_NS_AMEX "AMEX"
117 #define GNC_COMMODITY_NS_ASX "ASX"
118 #define GNC_COMMODITY_NS_NONCURRENCY _("All non-currency")
119 /* Delay translation of this one, we use it in both translated and untranslated form
120  when presenting the currency related namespace to the user */
121 #define GNC_COMMODITY_NS_ISO_GUI N_("Currencies")
122 
126 #define GNC_COMMODITY_MAX_FRACTION 1000000000
127 
128 typedef GList CommodityList;
129 
138 typedef enum
139 {
151  SOURCE_MAX,
152  SOURCE_CURRENCY = SOURCE_MAX,
154 
161 gboolean gnc_quote_source_fq_installed (void);
162 
169 const char* gnc_quote_source_fq_version (void);
170 
180 void gnc_quote_source_set_fq_installed (const char* version_string,
181  const GList *sources_list);
182 
190 
202 gnc_quote_source *gnc_quote_source_add_new(const char * name, gboolean supported);
203 
212 /*@ dependent @*/
213 gnc_quote_source *gnc_quote_source_lookup_by_internal(const char * internal_name);
214 
225 gnc_quote_source *gnc_quote_source_lookup_by_ti(QuoteSourceType type, gint index);
226 
235 gboolean gnc_quote_source_get_supported (const gnc_quote_source *source);
236 
244 QuoteSourceType gnc_quote_source_get_type (const gnc_quote_source *source);
245 
253 gint gnc_quote_source_get_index (const gnc_quote_source *source);
254 
263 /*@ dependent @*/
264 const char *gnc_quote_source_get_user_name (const gnc_quote_source *source);
265 
274 /*@ dependent @*/
275 const char *gnc_quote_source_get_internal_name (const gnc_quote_source *source);
276 
316 /*@ dependent @*/
317 gnc_commodity * gnc_commodity_new(QofBook *book,
318  /*@ null @*/ const char * fullname,
319  /*@ null @*/ const char * commodity_namespace,
320  /*@ null @*/ const char * mnemonic,
321  /*@ null @*/ const char * cusip,
322  int fraction);
323 
329 void gnc_commodity_destroy(gnc_commodity * cm);
330 
332 void gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src);
333 
335 gnc_commodity * gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book);
353 const char * gnc_commodity_get_mnemonic(const gnc_commodity * cm);
354 
364 const char * gnc_commodity_get_namespace(const gnc_commodity * cm);
365 
374 gnc_commodity_namespace *gnc_commodity_get_namespace_ds(const gnc_commodity * cm);
375 
385 const char * gnc_commodity_get_fullname(const gnc_commodity * cm);
386 
397 const char * gnc_commodity_get_printname(const gnc_commodity * cm);
398 
414 const char * gnc_commodity_get_cusip(const gnc_commodity * cm);
415 
427 const char * gnc_commodity_get_unique_name(const gnc_commodity * cm);
428 
439 int gnc_commodity_get_fraction(const gnc_commodity * cm);
440 
450 gboolean gnc_commodity_get_quote_flag(const gnc_commodity *cm);
451 
460 /*@ dependent @*/
461 gnc_quote_source* gnc_commodity_get_quote_source(const gnc_commodity *cm);
462 /*@ dependent @*/
463 gnc_quote_source* gnc_commodity_get_default_quote_source(const gnc_commodity *cm);
464 
475 const char* gnc_commodity_get_quote_tz(const gnc_commodity *cm);
476 
487 const char* gnc_commodity_get_user_symbol(const gnc_commodity *cm);
488 
498 const char* gnc_commodity_get_default_symbol(const gnc_commodity *cm);
499 
510 const char*gnc_commodity_get_nice_symbol(const gnc_commodity *cm);
527 void gnc_commodity_set_mnemonic(gnc_commodity * cm, const char * mnemonic);
528 
539 void gnc_commodity_set_namespace(gnc_commodity * cm, const char * new_namespace);
540 
551 void gnc_commodity_set_fullname(gnc_commodity * cm, const char * fullname);
552 
567 void gnc_commodity_set_cusip(gnc_commodity * cm, const char * cusip);
568 
579 void gnc_commodity_set_fraction(gnc_commodity * cm, int smallest_fraction);
580 
595 void gnc_commodity_user_set_quote_flag(gnc_commodity *cm,
596  const gboolean flag);
597 
607 void gnc_commodity_set_quote_flag(gnc_commodity *cm, const gboolean flag);
608 
618 void gnc_commodity_set_quote_source(gnc_commodity *cm, gnc_quote_source *src);
619 
631 void gnc_commodity_set_quote_tz(gnc_commodity *cm, const char *tz);
632 
641 void gnc_commodity_set_user_symbol(gnc_commodity *cm, const char *user_symbol);
654 void
655 gnc_commodity_increment_usage_count(gnc_commodity *cm);
656 
663 void
664 gnc_commodity_decrement_usage_count(gnc_commodity *cm);
678 gboolean gnc_commodity_equiv(const gnc_commodity * a, const gnc_commodity * b);
679 
684 gboolean gnc_commodity_equal(const gnc_commodity * a, const gnc_commodity * b);
685 
693 int gnc_commodity_compare(const gnc_commodity * a, const gnc_commodity * b);
694 
699 int gnc_commodity_compare_void(const void * a, const void * b);
713 gboolean gnc_commodity_namespace_is_iso(const char *commodity_namespace);
714 
720 gboolean gnc_commodity_is_iso(const gnc_commodity * cm);
721 
728 gboolean gnc_commodity_is_currency(const gnc_commodity *cm);
729 
733 /* =============================================================== */
740 /*@ dependent @*/
741 gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book);
742 
744 /* ---------------------------------------------------------- */
748 gnc_commodity * gnc_commodity_table_lookup(const gnc_commodity_table * table,
749  const char * commodity_namespace,
750  const char * mnemonic);
751 gnc_commodity *
752 gnc_commodity_table_lookup_unique(const gnc_commodity_table *table,
753  const char * unique_name);
754 gnc_commodity * gnc_commodity_table_find_full(const gnc_commodity_table * t,
755  const char * commodity_namespace,
756  const char * fullname);
757 
758 /*@ dependent @*/
759 gnc_commodity * gnc_commodity_find_commodity_by_guid(const GncGUID *guid,
760  QofBook *book);
761 
763 /* ---------------------------------------------------------- */
764 
783 /*@ dependent @*/
784 gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table * table,
785  gnc_commodity * comm);
786 
793 void gnc_commodity_table_remove(gnc_commodity_table * table,
794  gnc_commodity * comm);
795 
804 gboolean gnc_commodity_table_add_default_data(gnc_commodity_table *table, QofBook *book);
805 
807 /* ---------------------------------------------------------- */
818 const char * gnc_commodity_namespace_get_name (const gnc_commodity_namespace *ns) ;
819 
831 const char * gnc_commodity_namespace_get_gui_name (const gnc_commodity_namespace *ns) ;
832 
833 
840 GList * gnc_commodity_namespace_get_commodity_list(const gnc_commodity_namespace * ns);
841 
842 
851 int gnc_commodity_table_has_namespace(const gnc_commodity_table * table,
852  const char * commodity_namespace);
853 
861 GList * gnc_commodity_table_get_namespaces(const gnc_commodity_table * t);
862 
870 GList * gnc_commodity_table_get_namespaces_list(const gnc_commodity_table * t);
871 
882 gnc_commodity_namespace * gnc_commodity_table_add_namespace(gnc_commodity_table * table,
883  const char * commodity_namespace,
884  QofBook *book);
885 
894 gnc_commodity_namespace * gnc_commodity_table_find_namespace(const gnc_commodity_table * table,
895  const char * commodity_namespace);
896 
906 void gnc_commodity_table_delete_namespace(gnc_commodity_table * table,
907  const char * commodity_namespace);
909 /* ---------------------------------------------------------- */
920 guint gnc_commodity_table_get_size(const gnc_commodity_table* tbl);
921 
935  const gnc_commodity_table * table, const char * commodity_namespace);
936 
955  const gnc_commodity_table * table);
956 
967 gboolean gnc_commodity_table_foreach_commodity(const gnc_commodity_table * table,
968  gboolean (*f)(gnc_commodity *cm,
969  gpointer user_data),
970  gpointer user_data);
974 /* ---------------------------------------------------------- */
983 gnc_commodity_table * gnc_commodity_table_new(void);
984 void gnc_commodity_table_destroy(gnc_commodity_table * table);
985 
991 gnc_commodity * gnc_commodity_obtain_twin (const gnc_commodity *findlike, QofBook *book);
992 
997 gboolean gnc_commodity_table_register (void);
998 
999 void gnc_commodity_begin_edit (gnc_commodity *cm);
1000 void gnc_commodity_commit_edit (gnc_commodity *cm);
1001 
1005 #define gnc_commodity_get_kvp_frame(cm) \
1006  qof_instance_get_slots(QOF_INSTANCE(cm))
1007 
1014 {
1015  gnc_commodity *commodity;
1016  gnc_numeric value;
1017 };
1018 
1019 typedef struct _gnc_monetary gnc_monetary;
1020 
1021 /* A list of monetary values. This could be a hash table, but as currently
1022 * used it rarely contains more than one or two different commodities so
1023 * it doesn't seem worth the trouble.
1024 */
1025 typedef GList MonetaryList;
1026 
1030 static inline
1031 gnc_monetary gnc_monetary_create(gnc_commodity *commod, gnc_numeric val)
1032 {
1033  gnc_monetary out;
1034  out.commodity = commod;
1035  out.value = val;
1036  return out;
1037 }
1043 static inline
1044 gnc_commodity * gnc_monetary_commodity(gnc_monetary a)
1045 {
1046  return a.commodity;
1047 }
1048 
1049 static inline
1050 gnc_numeric gnc_monetary_value(gnc_monetary a)
1051 {
1052  return a.value;
1053 }
1061 MonetaryList *gnc_monetary_list_add_monetary(MonetaryList *list, gnc_monetary mon);
1062 
1064 static inline
1065 MonetaryList *gnc_monetary_list_add_value(MonetaryList *list,
1066  gnc_commodity *commod,
1067  gnc_numeric value)
1068 {
1069  return gnc_monetary_list_add_monetary(list,
1070  gnc_monetary_create(commod, value));
1071 }
1072 
1074 MonetaryList *gnc_monetary_list_delete_zeros(MonetaryList *list);
1075 
1077 void gnc_monetary_list_free(MonetaryList *list);
1082 #ifdef __cplusplus
1083 } /* extern "C" */
1084 #endif
1085 
1086 #endif /* GNC_COMMODITY_H */
1087 
gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table *table, gnc_commodity *comm)
Add a new commodity to the commodity table.
const char * gnc_commodity_get_cusip(const gnc_commodity *cm)
Retrieve the &#39;exchange code&#39; for the specified commodity.
gboolean gnc_commodity_table_foreach_commodity(const gnc_commodity_table *table, gboolean(*f)(gnc_commodity *cm, gpointer user_data), gpointer user_data)
Call a function once for each commodity in the commodity table.
gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book)
Returns the commodity table associated with a book.
gboolean gnc_commodity_is_currency(const gnc_commodity *cm)
Checks to see if the specified commodity is an ISO 4217 recognized currency or a legacy currency...
int gnc_commodity_get_fraction(const gnc_commodity *cm)
Retrieve the fraction for the specified commodity.
gboolean gnc_commodity_table_add_default_data(gnc_commodity_table *table, QofBook *book)
Add all the standard namespaces and currencies to the commodity table.
const char * gnc_quote_source_get_user_name(const gnc_quote_source *source)
Given a gnc_quote_source data structure, return the user friendly name of this quote source...
const char * gnc_commodity_get_mnemonic(const gnc_commodity *cm)
Retrieve the mnemonic for the specified commodity.
This quote source pulls from a single specific web site.
gnc_quote_source * gnc_quote_source_add_new(const char *name, gboolean supported)
Create a new quote source.
const char * gnc_commodity_namespace_get_gui_name(const gnc_commodity_namespace *ns)
Return the textual name of a namespace data structure in a form suitable to present to the user...
gboolean gnc_commodity_get_quote_flag(const gnc_commodity *cm)
Retrieve the automatic price quote flag for the specified commodity.
const char * gnc_commodity_get_user_symbol(const gnc_commodity *cm)
Retrieve the user-defined symbol for the specified commodity.
void gnc_commodity_set_quote_tz(gnc_commodity *cm, const char *tz)
Set the automatic price quote timezone for the specified commodity.
void gnc_commodity_decrement_usage_count(gnc_commodity *cm)
Decrement a commodity&#39;s internal counter that tracks how many accounts are using that commodity...
const char * gnc_commodity_get_quote_tz(const gnc_commodity *cm)
Retrieve the automatic price quote timezone for the specified commodity.
void gnc_commodity_set_fraction(gnc_commodity *cm, int smallest_fraction)
Set the fraction for the specified commodity.
gboolean gnc_commodity_equal(const gnc_commodity *a, const gnc_commodity *b)
This routine returns TRUE if the two commodities are equal.
gboolean gnc_quote_source_get_supported(const gnc_quote_source *source)
Given a gnc_quote_source data structure, return the flag that indicates whether this particular quote...
QuoteSourceType gnc_quote_source_get_type(const gnc_quote_source *source)
Given a gnc_quote_source data structure, return the type of this particular quote source...
The special currency quote source.
int gnc_commodity_compare_void(const void *a, const void *b)
A wrapper around gnc_commodity_compare() which offers the function declaration that is needed for g_l...
gnc_commodity * gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book)
allocate and copy
This is a locally installed quote source that gnucash knows nothing about.
const char * gnc_commodity_get_namespace(const gnc_commodity *cm)
Retrieve the namespace for the specified commodity.
void gnc_commodity_set_quote_flag(gnc_commodity *cm, const gboolean flag)
Set the automatic price quote flag for the specified commodity.
QuoteSourceType
The quote source type enum account types are used to determine how the transaction data in the accoun...
gnc_quote_source * gnc_quote_source_lookup_by_ti(QuoteSourceType type, gint index)
Given the type/index of a quote source, find the data structure identified by this pair...
void gnc_commodity_user_set_quote_flag(gnc_commodity *cm, const gboolean flag)
Set the automatic price quote flag for the specified commodity, based on user input.
gnc_commodity_namespace * gnc_commodity_table_add_namespace(gnc_commodity_table *table, const char *commodity_namespace, QofBook *book)
This function adds a new string to the list of commodity namespaces.
GList * gnc_commodity_namespace_get_commodity_list(const gnc_commodity_namespace *ns)
Return a list of all commodity data structures in the specified namespace.
void gnc_commodity_set_user_symbol(gnc_commodity *cm, const char *user_symbol)
Set a user-defined symbol for the specified commodity.
const char * gnc_commodity_namespace_get_name(const gnc_commodity_namespace *ns)
Return the textual name of a namespace data structure.
void gnc_quote_source_set_fq_installed(const char *version_string, const GList *sources_list)
Update gnucash internal tables based on what Finance::Quote sources are installed.
MonetaryList * gnc_monetary_list_delete_zeros(MonetaryList *list)
Delete all the zero-value entries from a list.
void gnc_commodity_set_quote_source(gnc_commodity *cm, gnc_quote_source *src)
Set the automatic price quote source for the specified commodity.
gint gnc_quote_source_num_entries(QuoteSourceType type)
Return the number of entries for a given type of quote source.
GList * gnc_commodity_table_get_namespaces(const gnc_commodity_table *t)
Return a list of all namespaces in the commodity table.
gboolean gnc_commodity_table_register(void)
You should probably not be using gnc_commodity_table_register() It is an internal routine for registe...
void gnc_commodity_increment_usage_count(gnc_commodity *cm)
Increment a commodity&#39;s internal counter that tracks how many accounts are using that commodity...
void gnc_commodity_set_cusip(gnc_commodity *cm, const char *cusip)
Set the &#39;exchange code&#39; for the specified commodity.
void gnc_monetary_list_free(MonetaryList *list)
Free a monetary list and all the items it points to.
gnc_commodity * gnc_commodity_new(QofBook *book, const char *fullname, const char *commodity_namespace, const char *mnemonic, const char *cusip, int fraction)
Create a new commodity.
int gnc_commodity_table_has_namespace(const gnc_commodity_table *table, const char *commodity_namespace)
Test to see if the indicated namespace exits in the commodity table.
void gnc_commodity_table_delete_namespace(gnc_commodity_table *table, const char *commodity_namespace)
This function deletes a string from the list of commodity namespaces.
gboolean gnc_commodity_namespace_is_iso(const char *commodity_namespace)
Checks to see if the specified commodity namespace is the namespace for ISO 4217 currencies.
const char * gnc_commodity_get_fullname(const gnc_commodity *cm)
Retrieve the full name for the specified commodity.
const char * gnc_commodity_get_nice_symbol(const gnc_commodity *cm)
Retrieve a symbol for the specified commodity, suitable for display to the user.
All type declarations for the whole Gnucash engine.
const char * gnc_quote_source_fq_version(void)
This function returns the version of the Finance::Quote module installed on a user&#39;s computer...
CommodityList * gnc_commodity_table_get_commodities(const gnc_commodity_table *table, const char *commodity_namespace)
Return a list of all commodities in the commodity table that are in the given namespace.
gnc_quote_source * gnc_quote_source_lookup_by_internal(const char *internal_name)
Given the internal (gnucash or F::Q) name of a quote source, find the data structure identified by th...
const char * gnc_commodity_get_printname(const gnc_commodity *cm)
Retrieve the &#39;print&#39; name for the specified commodity.
int gnc_commodity_compare(const gnc_commodity *a, const gnc_commodity *b)
This routine returns 0 if the two commodities are equal, 1 otherwise.
void gnc_commodity_set_fullname(gnc_commodity *cm, const char *fullname)
Set the full name for the specified commodity.
This quote source may pull from multiple web sites.
gnc_quote_source * gnc_commodity_get_quote_source(const gnc_commodity *cm)
Retrieve the automatic price quote source for the specified commodity.
gnc_commodity_namespace * gnc_commodity_table_find_namespace(const gnc_commodity_table *table, const char *commodity_namespace)
This function finds a commodity namespace in the set of existing commodity namespaces.
void gnc_commodity_set_mnemonic(gnc_commodity *cm, const char *mnemonic)
Set the mnemonic for the specified commodity.
const char * gnc_commodity_get_default_symbol(const gnc_commodity *cm)
Retrieve the default symbol for the specified commodity.
CommodityList * gnc_commodity_table_get_quotable_commodities(const gnc_commodity_table *table)
This function returns a list of commodities for which price quotes should be retrieved.
gnc_commodity_table * gnc_commodity_table_new(void)
You probably shouldn&#39;t be using gnc_commodity_table_new() directly, its for internal use only...
gint gnc_quote_source_get_index(const gnc_quote_source *source)
Given a gnc_quote_source data structure, return the index of this particular quote source within its ...
gnc_commodity_namespace * gnc_commodity_get_namespace_ds(const gnc_commodity *cm)
Retrieve the namespace data structure for the specified commodity.
const char * gnc_commodity_get_unique_name(const gnc_commodity *cm)
Retrieve the &#39;unique&#39; name for the specified commodity.
MonetaryList * gnc_monetary_list_add_monetary(MonetaryList *list, gnc_monetary mon)
Add a gnc_monetary to the list.
void gnc_commodity_table_remove(gnc_commodity_table *table, gnc_commodity *comm)
Remove a commodity from the commodity table.
void gnc_commodity_set_namespace(gnc_commodity *cm, const char *new_namespace)
Set the namespace for the specified commodity.
guint gnc_commodity_table_get_size(const gnc_commodity_table *tbl)
Returns the number of commodities in the commodity table.
const char * gnc_quote_source_get_internal_name(const gnc_quote_source *source)
Given a gnc_quote_source data structure, return the internal name of this quote source.
The type used to store guids in C.
Definition: guid.h:75
void gnc_commodity_copy(gnc_commodity *dest, const gnc_commodity *src)
Copy src into dest.
GList * gnc_commodity_table_get_namespaces_list(const gnc_commodity_table *t)
Return a list of all namespace data structures in the commodity table.
gnc_commodity * gnc_commodity_obtain_twin(const gnc_commodity *findlike, QofBook *book)
Given the commodity &#39;findlike&#39;, this routine will find and return the equivalent commodity (commodity...
void gnc_commodity_destroy(gnc_commodity *cm)
Destroy a commodity.
gboolean gnc_commodity_equiv(const gnc_commodity *a, const gnc_commodity *b)
This routine returns TRUE if the two commodities are equivalent.
gboolean gnc_commodity_is_iso(const gnc_commodity *cm)
Checks to see if the specified commodity is an ISO 4217 recognized currency.
gboolean gnc_quote_source_fq_installed(void)
This function indicates whether or not the Finance::Quote module is installed on a user&#39;s computer...