2001-05-31 Dave Peticolas <dave@krondo.com>

* src/doc/design/gnucash-design.texinfo: update docs

	* src/doc/design/engine.texinfo: document commodites & their API

	* doc/sgml/C/xacc-price-editor.sgml: fix warnings


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4338 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-05-31 08:36:56 +00:00
parent e82a0e38c8
commit 6793ceb6cf
4 changed files with 149 additions and 3 deletions
+8
View File
@@ -1,3 +1,11 @@
2001-05-31 Dave Peticolas <dave@krondo.com>
* src/doc/design/gnucash-design.texinfo: update docs
* src/doc/design/engine.texinfo: document commodites & their API
* doc/sgml/C/xacc-price-editor.sgml: fix warnings
2001-05-31 Robert Graham Merkel <rgmerk@mira.net>
* doc/sgml/C/xacc-ticker.sgml: renamed xacc-price-sources.sgml
+5 -1
View File
@@ -72,7 +72,7 @@
<para><emphasis>Ask</emphasis> prices indicates what
the dealers are prepared to sell a stock for - naturally,
this is slightly higher than the bid price.
<para>
</para>
</listitem>
<listitem>
<para><emphasis>Last</emphasis> prices indicate the
@@ -105,6 +105,8 @@
clicking on the appropriate "Sort by . . ." radio button
directly below the price list.
</para>
</sect1>
<sect1>
<title>
Updating prices manually
@@ -152,6 +154,8 @@
GnuCash 1.4 had a helper script for getting price quotes,
but this is no longer needed.
</para>
</sect1>
</article>
<!-- Local variables: -->
+129 -2
View File
@@ -25,6 +25,7 @@ be created as a shared library for use by other programs.
* Numeric Library::
* Key-Value Pair Frames::
* Events::
* Commodities::
* Splits::
* Transactions::
* Accounts::
@@ -1118,7 +1119,7 @@ the caller and should not be accessed after the function returns.
@end deftypefun
@node Events, Splits, Key-Value Pair Frames, Engine
@node Events, Commodities, Key-Value Pair Frames, Engine
@section Events
The Engine supports the concept of @dfn{Events} which notify
@@ -1192,7 +1193,133 @@ Resume engine event generation.
@end deftypefun
@node Splits, Transactions, Events, Engine
@node Commodities, Splits, Events, Engine
@section Commodities
@tindex gnc_commodity
A Commodity is the Engine abstraction of a tradable quantity,
like a national currency or shares of a stock. A commodity
object contains the following pieces of information:
@table @asis
@item A mnemonic name
The `short' name for the commodity. For national currencies
this is the 3-letter ISO4217 code (USD, AUD, etc.). For stocks
this is generally the exchange symbol (RHAT, IBM, etc.).
@item A namespace
A string identifying the context in which the mnemonic is meaninful.
@item A full name
The `long' name for the commodity, such as "US Dollar" or "IBM Common
Stock".
@item A printable name
The name used to print out a string describing the commodity to
a user. This name is generally long -- in some contexts it may
be better to use the mnemonic instead. The printable name is
determined by the namespace and mnemonic.
@item A unique name
A canonical name for the commodity that cannot be identical to
another commodity's unique name. The unique name is determined
by the namespace and mnemonic.
@item An exchange code
A code used to identify the commodity in its namespace context.
For example, stocks have a unique code assigned to them by the
exchange they are listed on.
@item A fraction
An integer N which specifies that 1/N is generally the smallest
fraction of the commodity which can be traded. For example, most
currencies are tradable in 1/100ths, so the fraction would be 100.
@end table
@menu
* General Commodity API::
* Commodity Getters::
* Commodity Setters::
@end menu
@node General Commodity API, Commodity Getters, Commodities, Commodities
@subsection General Commodity API
@deftypefun {gnc_commodity *} gnc_commodity_new (const char * @var{fullname}, const char * @var{namespace}, const char * @var{mnemonic}, const char * @var{exchange_code}, int @var{fraction})
Create and return a new commodity object with the given values, or
@code{NULL} if any of the values are invalid.
@end deftypefun
@deftypefun void gnc_commodity_destroy (gnc_commodity * @var{cm})
Destroy the given commodity and free all associated memory.
@end deftypefun
@deftypefun gboolean gnc_commodity_equiv (const gnc_commodity * @var{a}, const gnc_commodity * @var{b})
Return true if the two given commodities are equivalent. Two commodities
are equivalent when they have the same namespace and the same mnemonic.
@end deftypefun
@node Commodity Getters, Commodity Setters, General Commodity API, Commodities
@subsection Commodity Getters
@deftypefun {const char *} gnc_commodity_get_mnemonic (const gnc_commodity * @var{cm})
Return the mnemonic of @var{cm}.
@end deftypefun
@deftypefun {const char *} gnc_commodity_get_namespace (const gnc_commodity * @var{cm})
Return the namespace of @var{cm}.
@end deftypefun
@deftypefun {const char *} gnc_commodity_get_fullname (const gnc_commodity * @var{cm})
Return the full name of @var{cm}.
@end deftypefun
@deftypefun {const char *} gnc_commodity_get_printname (const gnc_commodity * @var{cm})
Return the print name of @var{cm}.
@end deftypefun
@deftypefun {const char *} gnc_commodity_get_exchange_code (const gnc_commodity * @var{cm})
Return the exchange code of @var{cm}.
@end deftypefun
@deftypefun {const char *} gnc_commodity_get_unique_name (const gnc_commodity * @var{cm})
Return the unique name of @var{cm}.
@end deftypefun
@deftypefun int gnc_commodity_get_fraction (const gnc_commodity * @var{cm})
Return the smallest tradable fraction of @var{cm}.
@end deftypefun
@node Commodity Setters, , Commodity Getters, Commodities
@subsection Commodity Setters
@deftypefun void gnc_commodity_set_mnemonic (gnc_commodity * @var{cm}, const char * @var{mnemonic})
Set the mnemonic of @var{cm} to @var{mnemonic}.
@end deftypefun
@deftypefun void gnc_commodity_set_namespace (gnc_commodity * @var{cm}, const char * @var{namespace})
Set the namespace of @var{cm} to @var{namespace}.
@end deftypefun
@deftypefun void gnc_commodity_set_fullname (gnc_commodity * @var{cm}, const char * @var{fullname})
Set the fullname of @var{cm} to @var{fullname}.
@end deftypefun
@deftypefun void gnc_commodity_set_exchange_code (gnc_commodity * @var{cm}, const char * @var{exchange_code})
Set the exchange code of @var{cm} to @var{exchange_code}.
@end deftypefun
@deftypefun void gnc_commodity_set_fraction (gnc_commodity * @var{cm}, int @var{smallest_fraction})
Set the fraction of @var{cm} to @var{fraction}.
@end deftypefun
@node Splits, Transactions, Commodities, Engine
@section Splits
@tindex Split
+7
View File
@@ -86,6 +86,7 @@ Engine
* Numeric Library::
* Key-Value Pair Frames::
* Events::
* Commodities::
* Splits::
* Transactions::
* Accounts::
@@ -124,6 +125,12 @@ Events
* Event API::
Commodities
* General Commodity API::
* Commodity Getters::
* Commodity Setters::
Splits
* General Split API::