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

# Engine

## Files

file | Account.h
| Account handling public routines.

file | gnc-pricedb.h
| a simple price database for gnucash.

file | SchedXaction.h
| Scheduled Transactions public handling routines.

file | Transaction.h
| API for Transactions and Splits (journal entries).

file | TransLog.h
| API for the transaction logger.

## Account parameter names

#define | ACCOUNT_KVP "kvp"
#define | ACCOUNT_NAME_ "name"
#define | ACCOUNT_CODE_ "code"
#define | ACCOUNT_DESCRIPTION_ "desc"
#define | ACCOUNT_NOTES_ "notes"
#define | ACCOUNT_BALANCE_ "balance"
#define | ACCOUNT_CLEARED_ "cleared"
#define | ACCOUNT_RECONCILED_ "reconciled"
#define | ACCOUNT_PRESENT_ "present"
#define | ACCOUNT_FUTURE_MINIMUM_ "future-minimum"
#define | ACCOUNT_TAX_RELATED "tax-related-p"

## Split Reconciled field values

If you change these be sure to change gnc-ui-util.c:gnc_get_reconciled_str() and associated functions
#define | CREC 'c' /**< The Split has been cleared */
#define | YREC 'y' /**< The Split has been reconciled */
#define | FREC 'f' /**< frozen into accounting period */
#define | NREC 'n' /**< not reconciled or cleared */
#define | VREC 'v' /**< split is void */

## Transaction Type field values

#define | TXN_TYPE_NONE '\0' /**< No transaction type */
#define | TXN_TYPE_INVOICE 'I' /**< Transaction is an invoice */
#define | TXN_TYPE_PAYMENT 'P' /**< Transaction is a payment */

## Split Parameter names

Note, if you want to get the equivalent of "ACCT_MATCH_ALL" you need to create a search on the following parameter list: SPLIT->SPLIT_TRANS->TRANS_SPLITLIST->SPLIT_ACCOUNT_GUID. If you do this, you might want to use the ACCOUNT_MATCH_ALL_TYPE as the override so the gnome-search dialog displays the right type.
#define | SPLIT_KVP "kvp"
#define | SPLIT_DATE_RECONCILED "date-reconciled"
#define | SPLIT_BALANCE "balance"
#define | SPLIT_CLEARED_BALANCE "cleared-balance"
#define | SPLIT_RECONCILED_BALANCE "reconciled-balance"
#define | SPLIT_MEMO "memo"
#define | SPLIT_ACTION "action"
#define | SPLIT_RECONCILE "reconcile-flag"
#define | SPLIT_AMOUNT "amount"
#define | SPLIT_SHARE_PRICE "share-price"
#define | SPLIT_VALUE "value"
#define | SPLIT_TYPE "type"
#define | SPLIT_VOIDED_AMOUNT "voided-amount"
#define | SPLIT_VOIDED_VALUE "voided-value"
#define | SPLIT_LOT "lot"
#define | SPLIT_TRANS "trans"
#define | SPLIT_ACCOUNT "account"
#define | SPLIT_ACCOUNT_GUID "account-guid" /**< for guid_match_all */
#define | SPLIT_ACCT_FULLNAME "acct-fullname"
#define | SPLIT_CORR_ACCT_NAME "corr-acct-fullname"
#define | SPLIT_CORR_ACCT_CODE "corr-acct-code"

## Transaction Parameter names

#define | TRANS_KVP "kvp"
#define | TRANS_NUM "num"
#define | TRANS_DESCRIPTION "desc"
#define | TRANS_DATE_ENTERED "date-entered"
#define | TRANS_DATE_POSTED "date-posted"
#define | TRANS_DATE_DUE "date-due"
#define | TRANS_IMBALANCE "trans-imbalance"
#define | TRANS_IS_BALANCED "trans-balanced?"
#define | TRANS_NOTES "notes"
#define | TRANS_TYPE "type"
#define | TRANS_VOID_STATUS "void-p"
#define | TRANS_VOID_REASON "void-reason"
#define | TRANS_VOID_TIME "void-time"
#define | TRANS_SPLITLIST "split-list"

## Account Placeholder getters/setters

enum | GNCPlaceholderType { PLACEHOLDER_NONE, PLACEHOLDER_THIS, PLACEHOLDER_CHILD }
gboolean | xaccAccountGetPlaceholder (Account *account)
void | xaccAccountSetPlaceholder (Account *account, gboolean option)
GNCPlaceholderType | xaccAccountGetDescendantPlaceholder (Account *account)

## Account Conversion routines

Conversion routines for the account types to/from strings that are used in persistant storage, communications. These strings should *not& be translated to the local language. Typical converstion is INCOME -> "INCOME".
char * | xaccAccountTypeEnumAsString (GNCAccountType type)
gboolean | xaccAccountStringToType (const char *str, GNCAccountType *type)
GNCAccountType | xaccAccountStringToEnum (const char *str)

## Account Constructors/Destructors and Edit/Commit

Account * | xaccMallocAccount (GNCBook *book)
Account * | xaccCloneAccount (const Account *from, GNCBook *book)
Account * | xaccCloneAccountSimple (const Account *from, GNCBook *book)
void | xaccAccountBeginEdit (Account *account)
void | xaccAccountCommitEdit (Account *account)
void | xaccAccountDestroy (Account *account)

## Account kvp_frame getters/setters

kvp_frame * | xaccAccountGetSlots (Account *account)
void | xaccAccountSetSlots_nc (Account *account, kvp_frame *frame)

## Account GUID subroutines

const GUID * | xaccAccountGetGUID (Account *account)
GUID | xaccAccountReturnGUID (Account *account)
Account * | xaccAccountLookup (const GUID *guid, GNCBook *book)
Account * | xaccAccountLookupDirect (GUID guid, GNCBook *book)

## Account general setters/getters

void | xaccAccountSetType (Account *account, GNCAccountType)
void | xaccAccountSetName (Account *account, const char *name)
void | xaccAccountSetCode (Account *account, const char *code)
void | xaccAccountSetDescription (Account *account, const char *desc)
void | xaccAccountSetNotes (Account *account, const char *notes)
void | xaccAccountSetLastNum (Account *account, const char *num)
GNCAccountType | xaccAccountGetType (Account *account)
const char * | xaccAccountGetName (Account *account)
const char * | xaccAccountGetCode (Account *account)
const char * | xaccAccountGetDescription (Account *account)
const char * | xaccAccountGetNotes (Account *account)
const char * | xaccAccountGetLastNum (Account *account)

## [NOHEADER]

void | xaccAccountSetCommodity (Account *account, gnc_commodity *comm)
gnc_commodity * | xaccAccountGetCommodity (Account *account)
int | xaccAccountGetCommoditySCU (Account *account)
int | xaccAccountGetCommoditySCUi (Account *account)
void | xaccAccountSetCommoditySCU (Account *account, int frac)
void | xaccAccountSetCommoditySCUandFlag (Account *account, int frac)
void | xaccAccountSetNonStdSCU (Account *account, gboolean flag)
gboolean | xaccAccountGetNonStdSCU (Account *account)
gnc_numeric | xaccAccountGetBalance (Account *account)
gnc_numeric | xaccAccountGetClearedBalance (Account *account)
gnc_numeric | xaccAccountGetReconciledBalance (Account *account)
gnc_numeric | xaccAccountGetPresentBalance (Account *account)
gnc_numeric | xaccAccountGetProjectedMinimumBalance (Account *account)
gnc_numeric | xaccAccountGetBalanceAsOfDate (Account *account, time_t date)
gnc_numeric | xaccAccountConvertBalanceToCurrency (Account *account, gnc_numeric balance, gnc_commodity *balance_currency, gnc_commodity *new_currency)
gnc_numeric | xaccAccountConvertBalanceToCurrencyAsOfDate (Account *account, gnc_numeric balance, gnc_commodity *balance_currency, gnc_commodity *new_currency, time_t date)
gnc_numeric | xaccAccountGetBalanceInCurrency (Account *account, gnc_commodity *report_commodity, gboolean include_children)
gnc_numeric | xaccAccountGetClearedBalanceInCurrency (Account *account, gnc_commodity *report_commodity, gboolean include_children)
gnc_numeric | xaccAccountGetReconciledBalanceInCurrency (Account *account, gnc_commodity *report_commodity, gboolean include_children)
gnc_numeric | xaccAccountGetPresentBalanceInCurrency (Account *account, gnc_commodity *report_commodity, gboolean include_children)
gnc_numeric | xaccAccountGetProjectedMinimumBalanceInCurrency (Account *account, gnc_commodity *report_commodity, gboolean include_children)

## Account Deprecated currency/security access routines.

Deprecated:
  The current API associates only one thing with an account: the 'commodity'. Use xaccAccountGetCommodity() to fetch it.

void | DxaccAccountSetCurrency (Account *account, gnc_commodity *currency, GNCBook *book)
void | DxaccAccountSetSecurity (Account *account, gnc_commodity *security, GNCBook *book)
gnc_commodity * | DxaccAccountGetCurrency (Account *account, GNCBook *book)
gnc_commodity * | DxaccAccountGetSecurity (Account *account, GNCBook *book)
void | DxaccAccountSetCurrencySCU (Account *account, int frac)
int | DxaccAccountGetCurrencySCU (Account *account)

## Account Children and Parent getters/setters

AccountGroup * | xaccAccountGetChildren (Account *account)
AccountGroup * | xaccAccountGetParent (Account *account)
Account * | xaccAccountGetParentAccount (Account *account)
GList * | xaccAccountGetDescendants (Account *account)
void | xaccAccountSetReconcileChildrenStatus (Account *account, gboolean status)
gboolean | xaccAccountGetReconcileChildrenStatus (Account *account)

## Account Tax related getters/setters

gboolean | xaccAccountGetTaxRelated (Account *account)
void | xaccAccountSetTaxRelated (Account *account, gboolean tax_related)
const char * | xaccAccountGetTaxUSCode (Account *account)
void | xaccAccountSetTaxUSCode (Account *account, const char *code)
const char * | xaccAccountGetTaxUSPayerNameSource (Account *account)
void | xaccAccountSetTaxUSPayerNameSource (Account *account, const char *source)

## Account Reconciliation information getters/setters

gboolean | xaccAccountGetReconcileLastDate (Account *account, time_t *last_date)
void | xaccAccountSetReconcileLastDate (Account *account, time_t last_date)
gboolean | xaccAccountGetReconcileLastInterval (Account *account, int *months, int *days)
void | xaccAccountSetReconcileLastInterval (Account *account, int months, int days)
gboolean | xaccAccountGetReconcilePostponeDate (Account *account, time_t *postpone_date)
void | xaccAccountSetReconcilePostponeDate (Account *account, time_t postpone_date)
gboolean | xaccAccountGetReconcilePostponeBalance (Account *account, gnc_numeric *balance)
void | xaccAccountSetReconcilePostponeBalance (Account *account, gnc_numeric balance)
void | xaccAccountClearReconcilePostpone (Account *account)

## Account AutoInterest getters/setters

Note:
  FIXME: What is this?

gboolean | xaccAccountGetAutoInterestXfer (Account *account, gboolean default_value)
void | xaccAccountSetAutoInterestXfer (Account *account, gboolean option)

## Configuration ForceDoubleEntry getters/setters

void | xaccConfigSetForceDoubleEntry (int force)
int | xaccConfigGetForceDoubleEntry (void)

## Transaction creation and editing

Transaction * | xaccMallocTransaction (GNCBook *book)
void | xaccTransDestroy (Transaction *trans)
gboolean | xaccTransEqual (const Transaction *ta, const Transaction *tb, gboolean check_guids, gboolean check_splits)
| DOCUMENT ME!
void | xaccTransBeginEdit (Transaction *trans)
void | xaccTransCommitEdit (Transaction *trans)
void | xaccTransRollbackEdit (Transaction *trans)
gboolean | xaccTransIsOpen (const Transaction *trans)
Transaction * | xaccTransLookup (const GUID *guid, GNCBook *book)
Transaction * | xaccTransLookupDirect (GUID guid, GNCBook *book)

## Transaction general getters/setters

const GUID * | xaccTransGetGUID (const Transaction *trans)
GUID | xaccTransReturnGUID (const Transaction *trans)
GNCBook * | xaccTransGetBook (const Transaction *trans)
kvp_frame * | xaccTransGetSlots (const Transaction *trans)
void | xaccTransSetSlots_nc (Transaction *t, kvp_frame *frm)
void | xaccTransSetTxnType (Transaction *trans, char type)
char | xaccTransGetTxnType (const Transaction *trans)
void | xaccTransSetNum (Transaction *trans, const char *num)
| Sets the transaction Number (or ID) field.
void | xaccTransSetDescription (Transaction *trans, const char *desc)
| Sets the transaction Description.
void | xaccTransSetNotes (Transaction *trans, const char *notes)
| Sets the transaction Notes. More...
const char * | xaccTransGetNum (const Transaction *trans)
| Gets the transaction Number (or ID) field.
const char * | xaccTransGetDescription (const Transaction *trans)
| Gets the transaction Description.
const char * | xaccTransGetNotes (const Transaction *trans)
| Gets the transaction Notes. More...
void | xaccTransAppendSplit (Transaction *trans, Split *split)
| Add a split to the transaction. More...
Split * | xaccTransGetSplit (const Transaction *trans, int i)
SplitList * | xaccTransGetSplitList (const Transaction *trans)
void | xaccTransSetReadOnly (Transaction *trans, const char *reason)
void | xaccTransClearReadOnly (Transaction *trans)
const char * | xaccTransGetReadOnly (const Transaction *trans)
gboolean | xaccTransWarnReadOnly (const Transaction *trans)
int | xaccTransCountSplits (const Transaction *trans)
gboolean | xaccTransHasReconciledSplits (const Transaction *trans)
gboolean | xaccTransHasReconciledSplitsByAccount (const Transaction *trans, const Account *account)
gnc_commodity * | xaccTransGetCurrency (const Transaction *trans)
void | xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr)
gnc_numeric | xaccTransGetImbalance (const Transaction *trans)
gnc_numeric | xaccTransGetAccountValue (const Transaction *trans, const Account *account)
int | xaccTransOrder (const Transaction *ta, const Transaction *tb)

## Transaction date setters/getters

void | xaccTransSetDate (Transaction *trans, int day, int mon, int year)
void | xaccTransSetDateSecs (Transaction *trans, time_t time)
void | xaccTransSetDatePostedSecs (Transaction *trans, time_t time)
void | xaccTransSetDatePostedTS (Transaction *trans, const Timespec *ts)
void | xaccTransSetDateEnteredSecs (Transaction *trans, time_t time)
| Modify the date of when the transaction was entered.
void | xaccTransSetDateEnteredTS (Transaction *trans, const Timespec *ts)
| Modify the date of when the transaction was entered.
void | xaccTransSetDateDueTS (Transaction *trans, const Timespec *ts)
time_t | xaccTransGetDate (const Transaction *trans)
void | xaccTransGetDatePostedTS (const Transaction *trans, Timespec *ts)
Timespec | xaccTransRetDatePostedTS (const Transaction *trans)
void | xaccTransGetDateEnteredTS (const Transaction *trans, Timespec *ts)
Timespec | xaccTransRetDateEnteredTS (const Transaction *trans)
Timespec | xaccTransRetDateDueTS (const Transaction *trans)
void | xaccTransGetDateDueTS (const Transaction *trans, Timespec *ts)

## Split general getters/setters

Split * | xaccMallocSplit (GNCBook *book)
gboolean | xaccSplitDestroy (Split *split)
GNCBook * | xaccSplitGetBook (const Split *split)
Account * | xaccSplitGetAccount (const Split *split)
Transaction * | xaccSplitGetParent (const Split *split)
GNCLot * | xaccSplitGetLot (const Split *split)
kvp_frame * | xaccSplitGetSlots (const Split *split)
void | xaccSplitSetSlots_nc (Split *s, kvp_frame *frm)
const GUID * | xaccSplitGetGUID (const Split *split)
GUID | xaccSplitReturnGUID (const Split *split)
void | xaccSplitSetMemo (Split *split, const char *memo)
const char * | xaccSplitGetMemo (const Split *split)
void | xaccSplitSetAction (Split *split, const char *action)
const char * | xaccSplitGetAction (const Split *split)

## Split Date getters/setters

void | xaccSplitSetReconcile (Split *split, char reconciled_flag)
char | xaccSplitGetReconcile (const Split *split)
void | xaccSplitSetDateReconciledSecs (Split *split, time_t time)
void | xaccSplitSetDateReconciledTS (Split *split, Timespec *ts)
void | xaccSplitGetDateReconciledTS (const Split *split, Timespec *ts)
Timespec | xaccSplitRetDateReconciledTS (const Split *split)

## Split amount getters/setters

'value' vs. 'amount' of a Split: The 'value' is the amount of the _transaction_ balancing commodity (i.e. currency) involved, 'amount' is the amount of the _account's_ commodity involved.
void | xaccSplitSetAmount (Split *split, gnc_numeric amount)
gnc_numeric | xaccSplitGetAmount (const Split *split)
void | xaccSplitSetValue (Split *split, gnc_numeric value)
gnc_numeric | xaccSplitGetValue (const Split *split)
void | xaccSplitSetSharePriceAndAmount (Split *split, gnc_numeric price, gnc_numeric amount)
gnc_numeric | xaccSplitGetSharePrice (const Split *split)
void | xaccSplitSetBaseValue (Split *split, gnc_numeric value, const gnc_commodity *base_currency)
gnc_numeric | xaccSplitGetBaseValue (const Split *split, const gnc_commodity *base_currency)
gnc_numeric | xaccSplitGetBalance (const Split *split)
gnc_numeric | xaccSplitGetClearedBalance (const Split *split)
gnc_numeric | xaccSplitGetReconciledBalance (const Split *split)

## Split utility functions

gboolean | xaccSplitEqual (const Split *sa, const Split *sb, gboolean check_guids, gboolean check_txn_splits)
Split * | xaccSplitLookup (const GUID *guid, GNCBook *book)
Split * | xaccSplitLookupDirect (GUID guid, GNCBook *book)
Split * | xaccSplitGetOtherSplit (const Split *split)
gboolean | xaccIsPeerSplit (const Split *split_1, const Split *split_2)
const char * | xaccSplitGetType (const Split *s)
void | xaccSplitMakeStockSplit (Split *s)
int | xaccSplitDateOrder (const Split *sa, const Split *sb)
int | xaccSplitCompareAccountFullNames (Split *sa, Split *sb)
int | xaccSplitCompareAccountCodes (Split *sa, Split *sb)
int | xaccSplitCompareOtherAccountFullNames (Split *sa, Split *sb)
int | xaccSplitCompareOtherAccountCodes (Split *sa, Split *sb)
char * | xaccSplitGetCorrAccountFullName (const Split *sa, char seperator)
const char * | xaccSplitGetCorrAccountName (const Split *sa)
const char * | xaccSplitGetCorrAccountCode (const Split *sa)

## Split deprecated functions

void | xaccSplitSetSharePrice (Split *split, gnc_numeric price)
void | DxaccSplitSetAmount (Split *s, double damt)
void | DxaccSplitSetValue (Split *split, double value)
double | DxaccSplitGetValue (const Split *split)
void | DxaccSplitSetSharePriceAndAmount (Split *split, double price, double amount)
void | DxaccSplitSetShareAmount (Split *split, double amount)
double | DxaccSplitGetShareAmount (const Split *split)
void | DxaccSplitSetSharePrice (Split *split, double price)
double | DxaccSplitGetSharePrice (const Split *split)
void | DxaccSplitSetBaseValue (Split *split, double value, const gnc_commodity *base_currency)

## Transaction voiding

void | xaccTransVoid (Transaction *transaction, const char *reason)
gboolean | xaccTransGetVoidStatus (const Transaction *transaction)
char * | xaccTransGetVoidReason (const Transaction *transaction)
gnc_numeric | xaccSplitVoidFormerAmount (const Split *split)
gnc_numeric | xaccSplitVoidFormerValue (const Split *split)
Timespec | xaccTransGetVoidTime (const Transaction *tr)

## Defines

#define | ACCOUNT_MATCH_ALL_TYPE "account-match-all"
#define | GNC_SX_ID "sched-xaction"
#define | GNC_SX_ACCOUNT "account"
#define | GNC_SX_CREDIT_FORMULA "credit-formula"
#define | GNC_SX_DEBIT_FORMULA "debit-formula"
#define | GNC_SX_SHARES "shares"
#define | GNC_SX_AMOUNT "amnt"
#define | GNC_SX_FROM_SCHED_XACTION "from-sched-xaction"
#define | RECONCILED_MATCH_TYPE "reconciled-match"

## Typedefs

typedef gnc_numeric(* | xaccGetBalanceFn )(Account *account)
typedef gnc_numeric(* | xaccGetBalanceInCurrencyFn )(Account *account, gnc_commodity *report_commodity, gboolean include_children)
typedef gpointer(* | SplitCallback )(Split *s, gpointer data)
typedef gboolean(* | TransactionCallback )(Transaction *t, void *data)
typedef gnc_price_s | GNCPrice
typedef gnc_price_lookup_s | GNCPriceLookup
typedef gnc_price_db_s | GNCPriceDB
typedef gncp_SchedXaction | SchedXaction

## Enumerations

enum | GNCAccountType { BAD_TYPE = -1, NO_TYPE = -1, BANK = 0, CASH = 1, CREDIT = 3, ASSET = 2, LIABILITY = 4, STOCK = 5, MUTUAL = 6, CURRENCY = 7, INCOME = 8, EXPENSE = 9, EQUITY = 10, RECEIVABLE = 11, PAYABLE = 12, NUM_ACCOUNT_TYPES = 13, CHECKING = 13, SAVINGS = 14, MONEYMRKT = 15, CREDITLINE = 16 }

## Functions

const char * | xaccAccountGetTypeStr (GNCAccountType type)
GNCAccountType | xaccAccountGetTypeFromStr (const gchar *str)
gboolean | xaccAccountTypesCompatible (GNCAccountType parent_type, GNCAccountType child_type)
GNCBook * | xaccAccountGetBook (Account *account)
Account * | xaccAccountLookupTwin (Account *acc, GNCBook *book)
gboolean | xaccAccountEqual (Account *a, Account *b, gboolean check_guids)
void | xaccAccountInsertLot (Account *, GNCLot *)
void | xaccAccountRemoveLot (Account *, GNCLot *)
void | xaccAccountInsertSplit (Account *account, Split *split)
void | xaccAccountFixSplitDateOrder (Account *account, Split *split)
void | xaccTransFixSplitDateOrder (Transaction *trans)
int | xaccAccountOrder (Account **account_1, Account **account_2)
void | xaccAccountDeleteOldData (Account *account)
SplitList * | xaccAccountGetSplitList (Account *account)
LotList * | xaccAccountGetLotList (Account *account)
LotList * | xaccAccountFindOpenLots (Account *acc, gboolean(*match_func)(GNCLot *lot, gpointer user_data), gpointer user_data, GCompareFunc sort_func)
char * | xaccAccountGetFullName (Account *account, const char separator)
gboolean | xaccAccountHasAncestor (Account *account, Account *ancestor)
void | xaccAccountSetMark (Account *account, short mark)
short | xaccAccountGetMark (Account *account)
void | xaccClearMark (Account *account, short val)
void | xaccClearMarkDown (Account *account, short val)
void | xaccClearMarkDownGr (AccountGroup *group, short val)
void | xaccAccountSetPriceSrc (Account *account, const char *src)
const char * | xaccAccountGetPriceSrc (Account *account)
void | xaccAccountSetQuoteTZ (Account *account, const char *tz)
const char * | xaccAccountGetQuoteTZ (Account *account)
gpointer | xaccAccountForEachSplit (Account *account, SplitCallback, gpointer data)
gboolean | xaccAccountForEachTransaction (Account *account, TransactionCallback, void *data)
gboolean | xaccAccountVisitUnvisitedTransactions (Account *account, TransactionCallback, void *data, GHashTable *visited_txns)
Transaction * | xaccAccountFindTransByDesc (Account *account, const char *description)
Split * | xaccAccountFindSplitByDesc (Account *account, const char *description)
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)
SchedXaction * | xaccSchedXactionMalloc (GNCBook *book)
gboolean | xaccSchedXactionIsDirty (SchedXaction *sx)
void | xaccSchedXactionSetDirtyness (SchedXaction *sx, gboolean dirty_p)
void | xaccSchedXactionFree (SchedXaction *sx)
FreqSpec * | xaccSchedXactionGetFreqSpec (SchedXaction *sx)
void | xaccSchedXactionSetFreqSpec (SchedXaction *sx, FreqSpec *fs)
gchar * | xaccSchedXactionGetName (SchedXaction *sx)
void | xaccSchedXactionSetName (SchedXaction *sx, const gchar *newName)
GDate * | xaccSchedXactionGetStartDate (SchedXaction *sx)
void | xaccSchedXactionSetStartDate (SchedXaction *sx, GDate *newStart)
int | xaccSchedXactionHasEndDate (SchedXaction *sx)
GDate * | xaccSchedXactionGetEndDate (SchedXaction *sx)
void | xaccSchedXactionSetEndDate (SchedXaction *sx, GDate *newEnd)
GDate * | xaccSchedXactionGetLastOccurDate (SchedXaction *sx)
void | xaccSchedXactionSetLastOccurDate (SchedXaction *sx, GDate *newLastOccur)
gboolean | xaccSchedXactionHasOccurDef (SchedXaction *sx)
gint | xaccSchedXactionGetNumOccur (SchedXaction *sx)
void | xaccSchedXactionSetNumOccur (SchedXaction *sx, gint numNum)
gint | xaccSchedXactionGetRemOccur (SchedXaction *sx)
void | xaccSchedXactionSetRemOccur (SchedXaction *sx, gint numRemain)
gint | gnc_sx_get_instance_count (SchedXaction *sx, void *stateData)
void | gnc_sx_set_instance_count (SchedXaction *sx, gint instanceNum)
GList * | xaccSchedXactionGetSplits (SchedXaction *sx)
void | xaccSchedXactionSetSplits (SchedXaction *sx, GList *newSplits)
void | xaccSchedXactionGetAutoCreate (SchedXaction *sx, gboolean *outAutoCreate, gboolean *outNotify)
void | xaccSchedXactionSetAutoCreate (SchedXaction *sx, gboolean newAutoCreate, gboolean newNotify)
gint | xaccSchedXactionGetAdvanceCreation (SchedXaction *sx)
void | xaccSchedXactionSetAdvanceCreation (SchedXaction *sx, gint createDays)
gint | xaccSchedXactionGetAdvanceReminder (SchedXaction *sx)
void | xaccSchedXactionSetAdvanceReminder (SchedXaction *sx, gint reminderDays)
kvp_frame * | xaccSchedXactionGetSlots (SchedXaction *sx)
void | xaccSchedXactionSetSlots (SchedXaction *sx, kvp_frame *frm)
kvp_value * | xaccSchedXactionGetSlot (SchedXaction *sx, const char *slot)
void | xaccSchedXactionSetSlot (SchedXaction *sx, const char *slot, const kvp_value *value)
const GUID * | xaccSchedXactionGetGUID (SchedXaction *sx)
void | xaccSchedXactionSetGUID (SchedXaction *sx, GUID g)
void * | gnc_sx_create_temporal_state (SchedXaction *sx)
void | gnc_sx_incr_temporal_state (SchedXaction *sx, void *stateData)
void | gnc_sx_revert_to_temporal_state (SchedXaction *sx, void *stateData)
void | gnc_sx_destroy_temporal_state (void *stateData)
void * | gnc_sx_clone_temporal_state (void *stateData)
GDate | xaccSchedXactionGetNextInstance (SchedXaction *sx, void *stateData)
GDate | xaccSchedXactionGetInstanceAfter (SchedXaction *sx, GDate *date, void *stateData)
void | xaccSchedXactionSetTemplateTrans (SchedXaction *sx, GList *t_t_list, GNCBook *book)
void | gnc_sx_add_defer_instance (SchedXaction *sx, void *deferStateData)
void | gnc_sx_remove_defer_instance (SchedXaction *sx, void *deferStateData)
GList * | gnc_sx_get_defer_instances (SchedXaction *sx)
Account * | xaccGetAccountByName (Transaction *trans, const char *name)
Account * | xaccGetAccountByFullName (Transaction *trans, const char *name, const char separator)
void | xaccOpenLog (void)
void | xaccCloseLog (void)
void | xaccTransWriteLog (Transaction *, char)
void | xaccLogEnable (void)
void | xaccLogDisable (void)
void | xaccLogSetBaseName (const char *)

## Define Documentation

#define ACCOUNT_MATCH_ALL_TYPE "account-match-all"

| This is the type-override when you want to match all accounts. Used in the gnome-search parameter list. Be carefull when you use this.

## Typedef Documentation

typedef struct gnc_price_s GNCPrice

GNCPrice:

Each price in the database represents an "instantaneous" quote for a given commodity with respect to another commodity. For example, a given price might represent the value of LNUX in USD on 2001-02-03.

Fields:

commodity: the item being priced.

currency: the denomination of the value of the item being priced.

value: the value of the item being priced.

time: the time the price was valid.

source: a string describing the source of the quote. These strings will be something like this: "Finance::Quote", "user:misc", "user:foo", etc. If the quote came from a user, as a matter of policy, you *must* prefix the string you give with "user:". For now, the only other reserved values are "Finance::Quote" and "old-file-import". Any string used must be added to the source_list array in dialog-price-edit-db.c so that it can be properly translated. (There are unfortunately many strings in users databased, so this string must be translated on output instead of always being used intranslated form.)

type: the type of quote - types possible right now are bid, ask, last, nav, and unknown.

Implementation Details:

NOTE: for source and type, NULL and the empty string are considered the same, so if one of these is "", then after a file save/restore, it might be NULL. Behave accordingly.

GNCPrices are reference counted. When you gnc_price_create one or clone it, the new price's count is set to 1. When you are finished with a price, call gnc_price_unref. If you hand the price pointer to some other code that needs to keep it, make sure it calls gnc_price_ref to indicate its interest in that price, and calls gnc_price_unref when it's finished with the price. For those unfamiliar with reference counting, basically each price stores an integer count which starts at 1 and is incremented every time someone calls gnc_price_ref. Conversely, the count is decremented every time someone calls gnc_price_unref. If the count ever reaches 0, the price is destroyed.

All of the getters return data that's internal to the GNCPrice, not copies, so don't free these values.

All of the setters store copies of the data given, with the exception of the commodity field which just stores the pointer given. It is assumed that commodities are a global resource and are pointer unique.

typedef struct gnc_price_db_s GNCPriceDB

GNCPriceDB

Whenever a you store a price in the pricedb, the pricedb adds its own reference to the price, so you can safely unref that price after inserting it into the DB if you're finished with it otherwise.

Similarly, when the pricedb returns a price to you, either singly, or in a price list, the price will have had a ref added for you, so you only need to unref the price(s) when you're finished with it/them.

typedef struct gncp_SchedXaction SchedXaction

| The SchedXaction data.

typedef gpointer(* SplitCallback)(Split *s, gpointer data)

| Unimplemented

## Enumeration Type Documentation

enum GNCAccountType

The account types are used to determine how the transaction data in the account is displayed. These values can be safely changed from one release to the next. Note that if values are added, the file IO translation routines need to be updated. Note also that GUI code depends on these numbers.

Note:
  ***IMPORTANT***: If you do change the enumeration names (not the numbers), you need to update xaccAccountTypeEnumAsString --- used for text file exports

Enumeration values:

  NO_TYPE | Not a type
  BANK | The bank account type denotes a savings or checking account held at a bank. Often interest bearing.
  CASH | The cash account type is used to denote a shoe-box or pillowcase stuffed with cash.
  CREDIT | The Credit card account is used to denote credit (e.g. amex) and debit (e.g. visa, mastercard) card accounts
  ASSET | asset (and liability) accounts indicate generic, generalized accounts that are none of the above.
  LIABILITY | liability (and asset) accounts indicate generic, generalized accounts that are none of the above.
  STOCK | Stock accounts will typically be shown in registers which show three columns: price, number of shares, and value.
  MUTUAL | Mutual Fund accounts will typically be shown in registers which show three columns: price, number of shares, and value.
  CURRENCY | The currency account type indicates that the account is a currency trading account. In many ways, a currency trading account is like a stock trading account, where both values and share quantities are set. @note: DEPRECATED?
  INCOME | Income accounts are used to denote income
  EXPENSE | Expense accounts are used to denote expenses.
  EQUITY | Equity account is used to balance the balance sheet.
  RECEIVABLE | A/R account type
  PAYABLE | A/P account type
  NUM_ACCOUNT_TYPES | stop here; the following types just aren't ready for prime time
  CREDITLINE | line of credit

## Function Documentation

gnc_commodity* DxaccAccountGetCurrency | ( | Account * | account,
|  | GNCBook * | book
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

int DxaccAccountGetCurrencySCU | ( | Account * | account | ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

gnc_commodity* DxaccAccountGetSecurity | ( | Account * | account,
|  | GNCBook * | book
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccAccountSetCurrency | ( | Account * | account,
|  | gnc_commodity * | currency,
|  | GNCBook * | book
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics. these two funcs take control of their gnc_commodity args. Don't free

void DxaccAccountSetCurrencySCU | ( | Account * | account,
|  | int | frac
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccAccountSetSecurity | ( | Account * | account,
|  | gnc_commodity * | security,
|  | GNCBook * | book
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics. these two funcs take control of their gnc_commodity args. Don't free

double DxaccSplitGetShareAmount | ( | const Split * | split | ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

double DxaccSplitGetSharePrice | ( | const Split * | split | ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

double DxaccSplitGetValue | ( | const Split * | split | ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccSplitSetAmount | ( | Split * | s,
|  | double | damt
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccSplitSetBaseValue | ( | Split * | split,
|  | double | value,
|  | const gnc_commodity * | base_currency
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccSplitSetShareAmount | ( | Split * | split,
|  | double | amount
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccSplitSetSharePrice | ( | Split * | split,
|  | double | price
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccSplitSetSharePriceAndAmount | ( | Split * | split,
|  | double | price,
|  | double | amount
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

void DxaccSplitSetValue | ( | Split * | split,
|  | double | value
| ) |

Deprecated:
  Don't use doubles anymore, only use gnc_numerics.

WARNING: The xaccSplitSetValue and DxaccSplitSetValue do NOT have the same behavior. The later divides the value given by the current value and set's the result as the new split value. Is that a but or just strange undocumented feature? Benoit Grégoire 2002-6-12

GNCPrice* gnc_price_clone | ( | GNCPrice * | p,
|  | GNCBook * | book
| ) |

| gnc_price_clone - returns a newly allocated price that's a content-wise duplicate of the given price, p. The returned clone will have a reference count of 1.

GNCPrice* gnc_price_create | ( | GNCBook * | book | ) |

| gnc_price_create - returns a newly allocated and initialized price with a reference count of 1.

void gnc_price_list_destroy | ( | GList * | prices | ) |

| gnc_price_list_destroy - destroy the given price list, calling gnc_price_unref on all the prices included in the list.

gboolean gnc_price_list_insert | ( | GList ** | prices,
|  | GNCPrice * | p
| ) |

| gnc_price_list_insert - insert a price into the given list, calling gnc_price_ref on it during the process.

gboolean gnc_price_list_remove | ( | GList ** | prices,
|  | GNCPrice * | p
| ) |

| gnc_price_list_remove - remove the price, p, from the given list, calling gnc_price_unref on it during the process.

GNCPrice* gnc_price_lookup | ( | const GUID * | guid,
|  | GNCBook * | book
| ) |

| As mentioned above all of the getters return data that's internal to the GNCPrice, not copies, so don't free these values.

void gnc_price_print | ( | GNCPrice * | db,
|  | FILE * | f,
|  | int | indent
| ) |

| semi-lame debugging code

void gnc_price_ref | ( | GNCPrice * | p | ) |

| gnc_price_ref - indicate your need for a given price to stick around (i.e. increase its reference count by 1).

void gnc_price_unref | ( | GNCPrice * | p | ) |

| gnc_price_ref - indicate you're finished with a price (i.e. decrease its reference count by 1).

gboolean gnc_pricedb_add_price | ( | GNCPriceDB * | db,
|  | GNCPrice * | p
| ) |

| gnc_pricedb_add_price - add a price to the pricedb, you may drop your reference to the price (i.e. call unref) after this succeeds, whenever you're finished with the price.

gnc_numeric gnc_pricedb_convert_balance_latest_price | ( | GNCPriceDB * | pdb,
|  | gnc_numeric | balance,
|  | gnc_commodity * | balance_currency,
|  | gnc_commodity * | new_currency
| ) |

| gnc_pricedb_convert_balance_latest_price - Convert a balance from one currency to another.

gnc_numeric gnc_pricedb_convert_balance_nearest_price | ( | GNCPriceDB * | pdb,
|  | gnc_numeric | balance,
|  | gnc_commodity * | balance_currency,
|  | gnc_commodity * | new_currency,
|  | Timespec | t
| ) |

| gnc_pricedb_convert_balance_nearest_price - Convert a balance from one currency to another.

GNCPriceDB* gnc_pricedb_create | ( | GNCBook * | book | ) |

| gnc_pricedb_create - create a new pricedb. Normally you won't need this; you will get the pricedb via gnc_book_get_pricedb.

void gnc_pricedb_destroy | ( | GNCPriceDB * | db | ) |

| gnc_pricedb_destroy - destroy the given pricedb and unref all of the prices it contains. This may not deallocate all of those prices. Other code may still be holding references to them.

gboolean gnc_pricedb_dirty | ( | GNCPriceDB * | db | ) |

| gnc_pricedb_dirty - return FALSE if the database has not been modified.

gboolean gnc_pricedb_foreach_price | ( | GNCPriceDB * | db,
|  | gboolean(* | f)(GNCPrice *p, gpointer user_data),
|  | gpointer | user_data,
|  | gboolean | stable_order
| ) |

| gnc_pricedb_foreach_price - call f once for each price in db, until and unless f returns FALSE. If stable_order is not FALSE, make sure the ordering of the traversal is stable (i.e. the same order every time given the same db contents -- stable traversals may be less efficient).

guint gnc_pricedb_get_num_prices | ( | GNCPriceDB * | db | ) |

| gnc_pricedb_get_num_prices - return the number of prices in the database.

GList* gnc_pricedb_get_prices | ( | GNCPriceDB * | db,
|  | gnc_commodity * | commodity,
|  | gnc_commodity * | currency
| ) |

| gnc_pricedb_get_prices - return all the prices for a given commodity in the given currency. Returns NULL on failure. The result is a GNCPrice list (see above).

GList* gnc_pricedb_lookup_at_time | ( | GNCPriceDB * | db,
|  | gnc_commodity * | commodity,
|  | gnc_commodity * | currency,
|  | Timespec | t
| ) |

| gnc_pricedb_lookup_at_time - return all prices that match the given commodity, currency, and timespec. Prices will be returned as a GNCPrice list (see above).

GList* gnc_pricedb_lookup_at_time_any_currency | ( | GNCPriceDB * | db,
|  | gnc_commodity * | c,
|  | Timespec | t
| ) |

| gnc_pricedb_lookup_at_time_any_currency - return all prices that match the given commodity and timespec in any available currency. Prices will be returned as a GNCPrice list (see above).

GList* gnc_pricedb_lookup_day | ( | GNCPriceDB * | db,
|  | gnc_commodity * | commodity,
|  | gnc_commodity * | currency,
|  | Timespec | t
| ) |

| gnc_pricedb_lookup_day - return all prices that match the given commodity, currency, and timespec. Prices will be returned as a GNCPrice list (see above).

GList* gnc_pricedb_lookup_day_any_currency | ( | GNCPriceDB * | db,
|  | gnc_commodity * | c,
|  | Timespec | t
| ) |

| gnc_pricedb_lookup_day_any_currency - return all prices that match the given commodity and timespec in any available currency. Prices will be returned as a GNCPrice list (see above).

GNCPrice* gnc_pricedb_lookup_latest | ( | GNCPriceDB * | db,
|  | gnc_commodity * | commodity,
|  | gnc_commodity * | currency
| ) |

| gnc_pricedb_lookup_latest - find the most recent price for the given commodity in the given currency. Returns NULL on failure.

GList* gnc_pricedb_lookup_latest_any_currency | ( | GNCPriceDB * | db,
|  | gnc_commodity * | commodity
| ) |

| gnc_pricedb_lookup_latest_any_currency - find the most recent prices for the given commodity in any available currency. Prices will be returned as a GNCPrice list (see above).

GNCPrice* gnc_pricedb_lookup_nearest_in_time | ( | GNCPriceDB * | db,
|  | gnc_commodity * | c,
|  | gnc_commodity * | currency,
|  | Timespec | t
| ) |

| gnc_pricedb_lookup_nearest_in_time - return the price for the given commodity in the given currency nearest to the given time t.

GList* gnc_pricedb_lookup_nearest_in_time_any_currency | ( | GNCPriceDB * | db,
|  | gnc_commodity * | c,
|  | Timespec | t
| ) |

| gnc_pricedb_lookup_nearest_in_time_any_currency - return all prices that match the given commodity and timespec in any available currency. Prices will be returned as a GNCPrice list (see above).

gboolean gnc_pricedb_remove_price | ( | GNCPriceDB * | db,
|  | GNCPrice * | p
| ) |

| gnc_pricedb_remove_price - removes the given price, p, from the pricedb. Returns TRUE if successful, FALSE otherwise.

void gnc_sx_add_defer_instance | ( | SchedXaction * | sx,
|  | void * | deferStateData
| ) |

| Adds an instance to the deferred list of the SX. Added instances are added in (date-)sorted order.

void* gnc_sx_clone_temporal_state | ( | void * | stateData | ) |

| Allocates and returns a copy of the given temporal state. Destroy with gnc_sx_destroy_temporal_state(), as you'd expect.

void* gnc_sx_create_temporal_state | ( | SchedXaction * | sx | ) |

| Temporal state data. These functions allow us to opaquely save the entire temporal state of ScheduledTransactions. This is used by the "since-last-run" dialog to store the initial state of SXes before modification ... if it later becomes necessary to revert an entire set of changes, we can 'revert' the SX without having to rollback all the individual state changes.

GList* gnc_sx_get_defer_instances | ( | SchedXaction * | sx | ) |

| Returns the defer list from the SX; this is a (date-)sorted temporal-state-data instance list. The list should not be modified by the caller; use the gnc_sx_{add,remove}_defer_instance() functions to modifiy the list.

gint gnc_sx_get_instance_count | ( | SchedXaction * | sx,
|  | void * | stateData
| ) |

Set the instance count. This is incremented by one for every created instance of the SX. Returns the instance num of the SX unless stateData is non-null, in which case it returns the instance num from the state data.

Parameters:

  stateData | may be NULL.

void gnc_sx_remove_defer_instance | ( | SchedXaction * | sx,
|  | void * | deferStateData
| ) |

| Removes an instance from the deferred list. If the instance is no longer useful; gnc_sx_destroy_temporal_state() it.

void gnc_sx_set_instance_count | ( | SchedXaction * | sx,
|  | gint | instanceNum
| ) |

| Sets the instance count to something other than the default. As the default is the incorrect value '0', callers should DTRT here.

void xaccAccountBeginEdit | ( | Account * | account | ) |

| The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account updates.

void xaccAccountCommitEdit | ( | Account * | account | ) |

| ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account updates.

void xaccAccountDeleteOldData | ( | Account * | account | ) |

| Delete any old data in the account's kvp data. This includes the old currency and security fields.

void xaccAccountDestroy | ( | Account * | account | ) |

| The xaccAccountDestroy() routine can be used to get rid of an account. The account should have been opened for editing (by calling xaccAccountBeginEdit()) before calling this routine.

gboolean xaccAccountEqual | ( | Account * | a,
|  | Account * | b,
|  | gboolean | check_guids
| ) |

| Compare two accounts for equality - this is a deep compare.

LotList* xaccAccountFindOpenLots | ( | Account * | acc,
|  | gboolean(* | match_func)(GNCLot *lot, gpointer user_data),
|  | gpointer | user_data,
|  | GCompareFunc | sort_func
| ) |

| Find a list of open lots that match the match_func. Sort according to sort_func. If match_func is NULL, then all open lots are returned. If sort_func is NULL, then the returned list has no particular order. The caller must free to returned list.

Split* xaccAccountFindSplitByDesc | ( | Account * | account,
|  | const char * | description
| ) |

| Returns a pointer to the split, not a copy.

Transaction* xaccAccountFindTransByDesc | ( | Account * | account,
|  | const char * | description
| ) |

| Returns a pointer to the transaction, not a copy.

void xaccAccountFixSplitDateOrder | ( | Account * | account,
|  | Split * | split
| ) |

| The xaccAccountFixSplitDateOrder() subroutine checks to see if a split is in proper sorted date order with respect to the other splits in this account.

gpointer xaccAccountForEachSplit | ( | Account * | account,
|  | SplitCallback | ,
|  | gpointer | data
| ) |

| Unimplemented

gboolean xaccAccountForEachTransaction | ( | Account * | account,
|  | TransactionCallback | ,
|  | void * | data
| ) |

The xaccAccountForEachTransaction() routine will traverse all of the transactions in the given account. Continue processing IFF proc does not return FALSE. This function does not descend recursively to traverse transactions in child accounts.

Proc will be called exactly once for each transaction that is pointed to by at least one split in the given account.

Note too, that if you call this function on two separate accounts and those accounts share transactions, proc will be called once per account for the shared transactions.

The result of this function will not be FALSE if-and-only-if every relevant transaction was traversed exactly once.

GNCBook* xaccAccountGetBook | ( | Account * | account | ) |

Returns:
  The book where the account is stored

char* xaccAccountGetFullName | ( | Account * | account,
|  | const char | separator
| ) |

The xaccAccountGetFullName routine returns the fully qualified name of the account using the given separator char. The name must be g_free'd after use. The fully qualified name of an account is the concatenation of the names of the account and all its ancestor accounts starting with the topmost account and ending with the given account. Each name is separated by the given character.

@note: WAKE UP! Unlike all other gets, the string returned by xaccAccountGetFullName() must be freed by you the user !!! hack alert -- since it breaks the rule of string allocation, maybe this routine should not be in this library, but some utility library?

const GUID* xaccAccountGetGUID | ( | Account * | account | ) |

| The xaccAccountGetGUID() subroutine will return the globally unique id associated with that account.

LotList* xaccAccountGetLotList | ( | Account * | account | ) |

| The xaccAccountGetLotList() routine returns a pointer to the GList of the lots in this account. The same warnings as above apply.

short xaccAccountGetMark | ( | Account * | account | ) |

| Get the mark set by xaccAccountSetMark

const char* xaccAccountGetQuoteTZ | ( | Account * | account | ) |

Deprecated:

SplitList* xaccAccountGetSplitList | ( | Account * | account | ) |

The xaccAccountGetSplitList() routine returns a pointer to a GList of the splits in the account.

Note:
  This GList is the account's internal data structure: do not delete it when done; treat it as a read-only structure. Note that some routines (such as xaccAccountRemoveSplit()) modify this list directly, and could leave you with a corrupted pointer.

const char* xaccAccountGetTypeStr | ( | GNCAccountType | type | ) |

| The xaccAccountGetTypeStr() routine returns a string suitable for use in the GUI/Interface. These strings should be translated to the local language.

gboolean xaccAccountHasAncestor | ( | Account * | account,
|  | Account * | ancestor
| ) |

| Returns true if the account has 'ancestor' as an ancestor. Returns false if either is NULL.

void xaccAccountInsertLot | ( | Account * | ,
|  | GNCLot * |
| ) |

| The xaccAccountInsertLot() method will register the indicated lot with this account. Any splits later inserted into this lot must belong to this account. If the lot is already in another account, the lot, and all of the splits in it, will be moved from that account to this account.

void xaccAccountInsertSplit | ( | Account * | account,
|  | Split * | split
| ) |

| The xaccAccountInsertSplit() method will insert the indicated split into the indicated account. If the split already belongs to another account, it will be removed from that account first.

Account* xaccAccountLookup | ( | const GUID * | guid,
|  | GNCBook * | book
| ) |

| The xaccAccountLookup() subroutine will return the account associated with the given id, or NULL if there is no such account.

Account* xaccAccountLookupDirect | ( | GUID | guid,
|  | GNCBook * | book
| ) |

| xaccAccountLookupDirect performs the same function as xaccAccountLookup but takes a GUID struct directly.

Account* xaccAccountLookupTwin | ( | Account * | acc,
|  | GNCBook * | book
| ) |

The xaccAccountLookupTwin() routine will find the "twin" of this account (if it exists) in another book. When accounts are copied or cloned, both of the pair are marked with the guid of thier copy, thus allowing the sibling-copy of an account to be found. Since the sibling may end up in a different book, we need a way of finding it, given only that we know the book, and that we know its twin. That's what this routine does. Given some book 'book', and an account 'acc', it will find the sibling account of 'acc' that is in 'book', and return it. If not found, it returns NULL. This routine uses the 'gemini' kvp values to do its work.

int xaccAccountOrder | ( | Account ** | account_1,
|  | Account ** | account_2
| ) |

The xaccAccountOrder() subroutine defines a sorting order on accounts. It takes pointers to two accounts, and returns -1 if the first account is "less than" the second, returns +1 if the first is "greater than" the second, and 0 if they are equal. To determine the sort order, first the account codes are compared, and if these are equal, then account types, and, if these are equal, the account names.

GUID xaccAccountReturnGUID | ( | Account * | account | ) |

| The xaccAccountReturnGUID() subroutine returns the same GUID as xaccAccountGetGUID, but as a struct.

void xaccAccountSetLastNum | ( | Account * | account,
|  | const char * | num
| ) |

| Set the last num field of an Account

void xaccAccountSetMark | ( | Account * | account,
|  | short | mark
| ) |

| Set a mark on the account. The meaning of this mark is completely undefined. Its presented here as a utility for the programmer, to use as desired. Handy for performing customer traversals over the account tree. The mark is *not* stored in the database/file format. When accounts are newly created, the mark is set to zero.

void xaccAccountSetPriceSrc | ( | Account * | account,
|  | const char * | src
| ) |

| The xaccAccountSetPriceSrc() and xaccAccountGetPriceSrc() routines are used to get and set a string that identifies the Finance::Quote backend that should be used to retrieve online prices. See price-quotes.scm for more information.

void xaccAccountSetQuoteTZ | ( | Account * | account,
|  | const char * | tz
| ) |

xaccAccountGetQuoteTZ() and xaccAccountSetQuoteTZ() set the timezone to be used when interpreting the results from a given Finance::Quote backend. Unfortunately, the upstream sources don't label their output, so the user has to specify this bit.

Deprecated:
  Since prices are not going to be stored in the accounts in the future, and since the whole commodities infrastructure is changing radically as we speak, this interface is not long for this world.

gboolean xaccAccountTypesCompatible | ( | GNCAccountType | parent_type,
|  | GNCAccountType | child_type
| ) |

| Return TRUE if accounts of type parent_type can have accounts of type child_type as children.

gboolean xaccAccountVisitUnvisitedTransactions | ( | Account * | account,
|  | TransactionCallback | ,
|  | void * | data,
|  | GHashTable * | visited_txns
| ) |

The xaccAccountVisitUnvisitedTransactions() routine will visit every transaction in the account that hasn't already been visited exactly once. visited_txns must be a hash table created via guid_hash_table_new() and is the authority about which transactions have already been visited. Further, when this procedure returns visited_txns will have been modified to reflect all the newly visited transactions.

The result of this function will not be FALSE if-and-only-if every relevant transaction was traversed exactly once.

void xaccClearMark | ( | Account * | account,
|  | short | val
| ) |

| The xaccClearMark will find the topmost group, and clear the mark in the entire group tree.

void xaccClearMarkDown | ( | Account * | account,
|  | short | val
| ) |

| The xaccClearMarkDown will clear the mark only in this and in sub-accounts.

void xaccClearMarkDownGr | ( | AccountGroup * | group,
|  | short | val
| ) |

| Will clear the mark for all the accounts of the AccountGroup .

Account* xaccCloneAccount | ( | const Account * | from,
|  | GNCBook * | book
| ) |

| The xaccCloneAccount() does the same as xaccCloneAccountSimple, except that it also uses the 'gemini' kvp value to mark the account from which it was copied.

Account* xaccCloneAccountSimple | ( | const Account * | from,
|  | GNCBook * | book
| ) |

| The xaccCloneAccountSimple() routine makes a simple copy of the indicated account, placing it in the indicated book. It copies the account type, name, description, and the kvp values; it does not copy splits/transactions. Note also that it does NOT use the 'gemini' kvp value to indicate where it was copied from.

int xaccConfigGetForceDoubleEntry | ( | void |  | ) |

| The xaccConfigSetForceDoubleEntry() and xaccConfigGetForceDoubleEntry() set and get the "force_double_entry" flag. This flag determines how the splits in a transaction will be balanced.

void xaccConfigSetForceDoubleEntry | ( | int | force | ) |

The xaccConfigSetForceDoubleEntry() and xaccConfigGetForceDoubleEntry() set and get the "force_double_entry" flag. This flag determines how the splits in a transaction will be balanced.

The following values have significance:

0 -- anything goes

1 -- The sum of all splits in a transaction will be forced to be zero, even if this requires the creation of additional splits. Note that a split whose value is zero (e.g. a stock price) can exist by itself. Otherwise, all splits must come in at least pairs.

2 -- splits without parents will be forced into a lost & found account. (Not implemented)

Account* xaccGetAccountByFullName | ( | Transaction * | trans,
|  | const char * | name,
|  | const char | separator
| ) |

| The xaccGetAccountByFullName routine is similar to xaccGetAccountByName, but uses full names using the given separator.

Account* xaccGetAccountByName | ( | Transaction * | trans,
|  | const char * | name
| ) |

| The xaccGetAccountByName() is a convenience routine that is essentially identical to xaccGetPeerAccountFromName(), except that it accepts the handy transaction as root.

gboolean xaccIsPeerSplit | ( | const Split * | split_1,
|  | const Split * | split_2
| ) |

| The xaccIsPeerSplit() is a convenience routine that returns TRUE (a non-zero value) if the two splits share a common parent transaction, else it returns FALSE (zero).

void xaccLogDisable | ( | void |  | ) |

| document me

void xaccLogEnable | ( | void |  | ) |

| document me

void xaccLogSetBaseName | ( | const char * |  | ) |

| The xaccLogSetBaseName() method sets the base filepath and the root part of the journal file name. If the journal file is already open, it will close it and reopen it with the new base name.

Account* xaccMallocAccount | ( | GNCBook * | book | ) |

| Constructor

Split* xaccMallocSplit | ( | GNCBook * | book | ) |

| Constructor.

Transaction* xaccMallocTransaction | ( | GNCBook * | book | ) |

| The xaccMallocTransaction() will malloc memory and initialize it. Once created, it is usually unsafe to merely "free" this memory; the xaccTransDestroy() method should be called.

void xaccSchedXactionFree | ( | SchedXaction * | sx | ) |

| Cleans up and frees a SchedXaction and it's associated data.

GDate* xaccSchedXactionGetEndDate | ( | SchedXaction * | sx | ) |

| Returns invalid date when there is no end-date specified.

GDate xaccSchedXactionGetNextInstance | ( | SchedXaction * | sx,
|  | void * | stateData
| ) |

Returns the next occurance of a scheduled transaction. If the transaction hasn't occured, then it's based off the start date. Otherwise, it's based off the last-occurance date.

If state data is NULL, the current value of the SX is used for computation. Otherwise, the values in the state data are used. This allows the caller to correctly create a set of instances into the future for possible action without modifying the SX state until action is actually taken.

kvp_value* xaccSchedXactionGetSlot | ( | SchedXaction * | sx,
|  | const char * | slot
| ) |

| Use the following two functions in preference to the above two . . .

gboolean xaccSchedXactionHasOccurDef | ( | SchedXaction * | sx | ) |

| Returns true if the scheduled transaction has a defined number of occurances, false if not.

gboolean xaccSchedXactionIsDirty | ( | SchedXaction * | sx | ) |

Returns:
  True if the scheduled transaction is dirty and needs to be saved.

SchedXaction* xaccSchedXactionMalloc | ( | GNCBook * | book | ) |

| Creates and initializes a scheduled transaction.

void xaccSchedXactionSetDirtyness | ( | SchedXaction * | sx,
|  | gboolean | dirty_p
| ) |

| Set dirtyness state. Only save/load code should modify this outside SX engine CODE . . . (set it to FALSE after backend completes reading in data FIXME: put this into a private header . . . .

void xaccSchedXactionSetEndDate | ( | SchedXaction * | sx,
|  | GDate * | newEnd
| ) |

| Set to an invalid GDate to turn off 'end-date' definition.

void xaccSchedXactionSetFreqSpec | ( | SchedXaction * | sx,
|  | FreqSpec * | fs
| ) |

| The FreqSpec is given to the SchedXaction for mem mgmt; it should not be freed by the external code.

void xaccSchedXactionSetName | ( | SchedXaction * | sx,
|  | const gchar * | newName
| ) |

| A copy of the name is made.

void xaccSchedXactionSetNumOccur | ( | SchedXaction * | sx,
|  | gint | numNum
| ) |

| Set to '0' to turn off number-of-occurances definition.

void xaccSchedXactionSetSlots | ( | SchedXaction * | sx,
|  | kvp_frame * | frm
| ) |

| Sets the SX kvp data to the given kvp_frame. NOTE: This is not copied, but set directly.

int xaccSplitCompareAccountCodes | ( | Split * | sa,
|  | Split * | sb
| ) |

| Compare two splits by code of account. Returns similar to strcmp.

int xaccSplitCompareAccountFullNames | ( | Split * | sa,
|  | Split * | sb
| ) |

| Compare two splits by full name of account. Returns similar to strcmp.

int xaccSplitCompareOtherAccountCodes | ( | Split * | sa,
|  | Split * | sb
| ) |

| Compare two splits by code of the other account. Returns similar to strcmp. This function attempts to find the split on the other side of a transaction and compare on it.

int xaccSplitCompareOtherAccountFullNames | ( | Split * | sa,
|  | Split * | sb
| ) |

| Compare two splits by full name of the other account. Returns similar to strcmp. This function attempts to find the split on the other side of a transaction and compare on it.

int xaccSplitDateOrder | ( | const Split * | sa,
|  | const Split * | sb
| ) |

The xaccSplitDateOrder(sa,sb) method is useful for sorting. if sa and sb have different transactions, return their xaccTransOrder return a negative value if split sa has a smaller currency-value than sb, return a positive value if split sa has a larger currency-value than sb, return a negative value if split sa has a smaller share-price than sb, return a positive value if split sa has a larger share-price than sb, then compares memo and action using the strcmp() c-library routine, returning what strcmp would return. Then it compares the reconciled flags, then the reconciled dates, Finally, it returns zero if all of the above match.

gboolean xaccSplitDestroy | ( | Split * | split | ) |

Destructor.

The xaccSplitDestroy() method will update its parent account and transaction in a consistent manner, resulting in the complete unlinking of the split, and the freeing of its associated memory. The goal of this routine is to perform the removal and destruction of the split in an atomic fashion, with no chance of accidentally leaving the accounting structure out-of-balance or otherwise inconsistent.

If the deletion of the split leaves the transaction with no splits, then the transaction will be marked for deletion. (It will not be deleted until the xaccTransCommitEdit() routine is called.)

Returns:
  TRUE upon successful deletion of the split. FALSE when the parenting Transaction is a read-only one.

gboolean xaccSplitEqual | ( | const Split * | sa,
|  | const Split * | sb,
|  | gboolean | check_guids,
|  | gboolean | check_txn_splits
| ) |

Equality.

Parameters:

  sa | First split to compare
  sb | Second split to compare
  check_guids | If TRUE, try a guid_equal() on the GUIDs of both splits if their pointers are not equal in the first place.
  check_txn_splits | If the pointers are not equal, but everything else so far is equal (including memo, amount, value, kvp_frame), then, when comparing the parenting transactions with xaccTransEqual(), set its argument check_splits to be TRUE.

Account* xaccSplitGetAccount | ( | const Split * | split | ) |

| Returns the account of this split, which was set through xaccAccountInsertSplit().

const char* xaccSplitGetAction | ( | const Split * | split | ) |

| Returns the action string.

gnc_numeric xaccSplitGetAmount | ( | const Split * | split | ) |

| Returns the amount of the split in the account's commodity.

gnc_numeric xaccSplitGetBalance | ( | const Split * | split | ) |

| Returns the running balance up to and including the indicated split. The balance is the currency-denominated balance. For accounts with non-unit share prices, it is correctly adjusted for share prices. The following three subroutines return the running balance up to & including the indicated split. (The function xaccSplitGetShareBalance seems to have silently disappeared.)

gnc_numeric xaccSplitGetBaseValue | ( | const Split * | split,
|  | const gnc_commodity * | base_currency
| ) |

Depending on the base_currency, return either the value or the amount of this split: If the base_curreny is the transaction's commodity, return the value. If it is the account's commodity, return the amount. If it is neither and the force_double_entry flag is false, return the value. If is is neither and force_double_entry is true, print a warning message and return gnc_numeric_zero().

Note:
  FIXME: is this function deprecated, or is this function supposed to be used?

GNCBook* xaccSplitGetBook | ( | const Split * | split | ) |

| Returns the book of this split, i.e. the entity where this split is stored.

gnc_numeric xaccSplitGetClearedBalance | ( | const Split * | split | ) |

| The cleared-balance is the currency-denominated balance of all transactions that have been marked as cleared or reconciled. It is correctly adjusted for price fluctuations.

const char* xaccSplitGetCorrAccountCode | ( | const Split * | sa | ) |

| document me

char* xaccSplitGetCorrAccountFullName | ( | const Split * | sa,
|  | char | seperator
| ) |

These functions take a split, get the corresponding split on the "other side" of the transaction, and extract either the name or code of that split, reverting to returning a constant "Split" if the transaction has more than one split on the "other side". These were added for the transaction report, and is in C because the code was already written in C for the above functions and duplication is silly.

const char* xaccSplitGetCorrAccountName | ( | const Split * | sa | ) |

| document me

void xaccSplitGetDateReconciledTS | ( | const Split * | split,
|  | Timespec * | ts
| ) |

| Get the date on which this split was reconciled by having it written into the Timespec that 'ts' is pointing to.

const GUID* xaccSplitGetGUID | ( | const Split * | split | ) |

| The xaccSplitGetGUID() subroutine will return the globally unique id associated with that split.

GNCLot* xaccSplitGetLot | ( | const Split * | split | ) |

| Returns the pointer to the debited/credited Lot where this split belongs to, or NULL if it doesn't belong to any.

const char* xaccSplitGetMemo | ( | const Split * | split | ) |

| Returns the memo string.

Split* xaccSplitGetOtherSplit | ( | const Split * | split | ) |

| The xaccSplitGetOtherSplit() is a convenience routine that returns the other of a pair of splits. If there are more than two splits, it returns NULL.

Transaction* xaccSplitGetParent | ( | const Split * | split | ) |

| Returns the parent transaction of the split, which was set through xaccTransAppendSplit().

char xaccSplitGetReconcile | ( | const Split * | split | ) |

| Returns the value of the reconcile flag.

gnc_numeric xaccSplitGetReconciledBalance | ( | const Split * | split | ) |

| Returns the reconciled-balance of this split. The reconciled-balance is the currency-denominated balance of all transactions that have been marked as reconciled.

gnc_numeric xaccSplitGetSharePrice | ( | const Split * | split | ) |

| Returns the price of the split, that is, the value divided by the amount. If the amount is zero, returns a gnc_numeric of value one.

kvp_frame* xaccSplitGetSlots | ( | const Split * | split | ) |

| Returns the kvp_frame slots of this split for direct editing. Split slots are used to store arbitrary strings, numbers, and structures which aren't members of the transaction struct. See kvp_doc.txt for reserved slot names.

const char* xaccSplitGetType | ( | const Split * | s | ) |

| Returns the split type, which is either the string "normal", or "stock-split" for a split from a stock split (pun intended? :-).

gnc_numeric xaccSplitGetValue | ( | const Split * | split | ) |

| Returns the value of this split in the transaction's commodity.

Split* xaccSplitLookup | ( | const GUID * | guid,
|  | GNCBook * | book
| ) |

| The xaccSplitLookup() subroutine will return the split associated with the given id, or NULL if there is no such split.

Split* xaccSplitLookupDirect | ( | GUID | guid,
|  | GNCBook * | book
| ) |

| Returns the split associated with the given id, or NULL if there is no such split.

void xaccSplitMakeStockSplit | ( | Split * | s | ) |

| Mark a split to be of type stock split - after this, you shouldn't modify the value anymore, just the amount.

Timespec xaccSplitRetDateReconciledTS | ( | const Split * | split | ) |

| Returns the date (as Timespec) on which this split was reconciled.

GUID xaccSplitReturnGUID | ( | const Split * | split | ) |

| xaccSplitReturnGUID also returns the guid (globally unique id), but in a GUID struct.

void xaccSplitSetAction | ( | Split * | split,
|  | const char * | action
| ) |

| The Action is an arbitrary user-assigned string. The action field is an arbitrary user-assigned value. It is meant to be a very short (one to ten cahracter) string that signifies the "type" of this split, such as e.g. Buy, Sell, Div, Withdraw, Deposit, ATM, Check, etc. The idea is that this field can be used to create custom reports or graphs of data.

void xaccSplitSetAmount | ( | Split * | split,
|  | gnc_numeric | amount
| ) |

The xaccSplitSetAmount() (formerly xaccSplitSetShareAmount) method sets the amount in the account's commodity that the split should have.

The following four setter functions set the prices and amounts. All of the routines always maintain balance: that is, invoking any of them will cause other splits in the transaction to be modified so that the net value of the transaction is zero.

IMPORTANT: The split should be parented by an account before any of these routines are invoked! This is because the actual setting of amounts/values requires SCU settings from the account. If these are not available, then amounts/values will be set to -1/0, which is an invalid value. I beleive this order dependency is a bug, but I'm too lazy to find, fix & test at the moment ...

Note:
  If you use this on a newly created transaction, make sure that the 'value' is also set so that it doesn't remain zero.

void xaccSplitSetBaseValue | ( | Split * | split,
|  | gnc_numeric | value,
|  | const gnc_commodity * | base_currency
| ) |

Depending on the base_currency, set either the value or the amount of this split or both: If the base_currency is the transaction's commodity, set the value. If it's the account's commodity, set the amount. If both, set both.

Note:
  This function is useful when filling in the value/amount for a newly created transaction, since otherwise you have to manually make sure that both Value and Amount are correctly set (and not that value or amount remains zero).

void xaccSplitSetDateReconciledSecs | ( | Split * | split,
|  | time_t | time
| ) |

| Set the date on which this split was reconciled by specifying the time as time_t.

void xaccSplitSetDateReconciledTS | ( | Split * | split,
|  | Timespec * | ts
| ) |

| Set the date on which this split was reconciled by specifying the time as Timespec.

void xaccSplitSetMemo | ( | Split * | split,
|  | const char * | memo
| ) |

| The memo is an arbitrary string associated with a split. It is intended to hold a short (zero to forty character) string that is displayed by the GUI along with this split. Users typically type in free form text from the GUI.

void xaccSplitSetReconcile | ( | Split * | split,
|  | char | reconciled_flag
| ) |

| Set the reconcile flag. The Reconcile flag is a single char, whose values are typically are 'n', 'y', 'c'. In Transaction.h, macros are defined for typical values (e.g. CREC, YREC).

void xaccSplitSetSharePrice | ( | Split * | split,
|  | gnc_numeric | price
| ) |

Deprecated:
  The xaccSplitSetSharePrice() method sets the price of the split. DEPRECATED - set the value and amount instead.

void xaccSplitSetSharePriceAndAmount | ( | Split * | split,
|  | gnc_numeric | price,
|  | gnc_numeric | amount
| ) |

| The xaccSplitSetSharePriceAndAmount() method will simultaneously update the share price and the number of shares. This is a utility routine that is equivalent to a xaccSplitSetSharePrice() followed by and xaccSplitSetAmount(), except that it incurs the processing overhead of balancing only once, instead of twice.

void xaccSplitSetSlots_nc | ( | Split * | s,
|  | kvp_frame * | frm
| ) |

| Set the kvp_frame slots of this split to the given frm by directly using the frm pointer (i.e. non-copying).

void xaccSplitSetValue | ( | Split * | split,
|  | gnc_numeric | value
| ) |

The xaccSplitSetValue() method sets the value of this split in the transaction's commodity.

Note:
  If you use this on a newly created transaction, make sure that the 'amount' is also set so that it doesn't remain zero.

gnc_numeric xaccSplitVoidFormerAmount | ( | const Split * | split | ) |

| document me

gnc_numeric xaccSplitVoidFormerValue | ( | const Split * | split | ) |

| document me

void xaccTransAppendSplit | ( | Transaction * | trans,
|  | Split * | split
| ) |

Add a split to the transaction.

The xaccTransAppendSplit() method will append the indicated split to the collection of splits in this transaction.

Note:
  If the split is already a part of another transaction, it will be removed from that transaction first.

void xaccTransBeginEdit | ( | Transaction * | trans | ) |

| The xaccTransBeginEdit() method must be called before any changes are made to a transaction or any of its component splits. If this is not done, errors will result.

void xaccTransCommitEdit | ( | Transaction * | trans | ) |

| The xaccTransCommitEdit() method indicates that the changes to the transaction and its splits are complete and should be made permanent. Note this routine may result in the deletion of the transaction, if the transaction is "empty" (has no splits), or of xaccTransDestroy() was called on the transaction.

int xaccTransCountSplits | ( | const Transaction * | trans | ) |

| Returns the number of splits in this transaction.

void xaccTransDestroy | ( | Transaction * | trans | ) |

| The xaccTransDestroy() method will remove all of the splits from each of their accounts, free the memory associated with them. This routine must be followed by either an xaccTransCommitEdit(), in which case the transaction memory will be freed, or by xaccTransRollbackEdit(), in which case nothing at all is freed, and everything is put back into original order.

void xaccTransFixSplitDateOrder | ( | Transaction * | trans | ) |

| The xaccTransFixSplitDateOrder() checks to see if all of the splits in this transaction are in proper date order.

gnc_numeric xaccTransGetAccountValue | ( | const Transaction * | trans,
|  | const Account * | account
| ) |

| The xaccTransGetAccountValue() method returns the total value applied to a particular account. In some cases there may be multiple Splits in a single Transaction applied to one account (in particular when trying to balance Lots) -- this function is just a convienience to view everything at once.

GNCBook* xaccTransGetBook | ( | const Transaction * | trans | ) |

| Returns the book in which the transaction is stored

gnc_commodity* xaccTransGetCurrency | ( | const Transaction * | trans | ) |

Returns the commodity of this transaction.

Each transaction's 'currency' is by definition the balancing common currency for the splits in that transaction.

Note:
  What happens if the Currency isn't set?

time_t xaccTransGetDate | ( | const Transaction * | trans | ) |

| Retrieve the posted date of the transaction. (Although having different function names, GetDate and GetDatePosted refer to the same single date.)

void xaccTransGetDateEnteredTS | ( | const Transaction * | trans,
|  | Timespec * | ts
| ) |

| Retrieve the date of when the transaction was entered.

const GUID* xaccTransGetGUID | ( | const Transaction * | trans | ) |

| The xaccTransGetGUID() subroutine will return the globally unique id associated with that transaction.

gnc_numeric xaccTransGetImbalance | ( | const Transaction * | trans | ) |

The xaccTransGetImbalance() method returns the total value of the transaction. In a pure double-entry system, this imbalance should be exactly zero, and if it is not, something is broken. However, when double-entry semantics are not enforced, unbalanced transactions can sneak in, and this routine can be used to find out how much things are off by. The value returned is denominated in the currency that is returned by the xaccTransFindCommonCurrency() method.

const char* xaccTransGetNotes | ( | const Transaction * | trans | ) |

| Gets the transaction Notes. The Notes field is only visible in the register in double-line mode

const char* xaccTransGetReadOnly | ( | const Transaction * | trans | ) |

| FIXME: document me

kvp_frame* xaccTransGetSlots | ( | const Transaction * | trans | ) |

| Returns the transaction's kvp_frame slots. Transaction slots are used to store arbitrary strings, numbers, and structures which aren't members of the transaction struct.

Split* xaccTransGetSplit | ( | const Transaction * | trans,
|  | int | i
| ) |

The xaccTransGetSplit() method returns a pointer to each of the splits in this transaction.

Parameters:

  trans | The transaction
  i | The split number. Valid values for i are zero to (number_of__splits-1). An invalid value of i will cause NULL to be returned. A convenient way of cycling through all splits is to start at zero, and keep incrementing until a null value is returned.

SplitList* xaccTransGetSplitList | ( | const Transaction * | trans | ) |

The xaccTransGetSplitList() method returns a GList of the splits in a transaction.

Returns:
  The list of splits. This list must NOT be modified. Do *NOT* free this list when you are done with it.

char xaccTransGetTxnType | ( | const Transaction * | trans | ) |

| Returns the Transaction Type See define TXN_TYPE_NONE, TXN_TYPE_INVOICE and TXN_TYPE_PAYMENT

char* xaccTransGetVoidReason | ( | const Transaction * | transaction | ) |

| document me

gboolean xaccTransGetVoidStatus | ( | const Transaction * | transaction | ) |

| document me

Timespec xaccTransGetVoidTime | ( | const Transaction * | tr | ) |

| document me

gboolean xaccTransHasReconciledSplits | ( | const Transaction * | trans | ) |

| FIXME: document me

gboolean xaccTransHasReconciledSplitsByAccount | ( | const Transaction * | trans,
|  | const Account * | account
| ) |

| FIXME: document me

gboolean xaccTransIsOpen | ( | const Transaction * | trans | ) |

| The xaccTransIsOpen() method returns TRUE if the transaction is open for editing. Otherwise, it returns false.

Transaction* xaccTransLookup | ( | const GUID * | guid,
|  | GNCBook * | book
| ) |

| The xaccTransLookup() subroutine will return the transaction associated with the given id, or NULL if there is no such transaction.

Transaction* xaccTransLookupDirect | ( | GUID | guid,
|  | GNCBook * | book
| ) |

| The xaccTransLookup() subroutine will return the transaction associated with the given id, or NULL if there is no such transaction.

int xaccTransOrder | ( | const Transaction * | ta,
|  | const Transaction * | tb
| ) |

The xaccTransOrder(ta,tb) method is useful for sorting. return a negative value if transaction ta is dated earlier than tb, return a positive value if transaction ta is dated later than tb, then compares num and description values, using the strcmp() c-library routine, returning what strcmp would return. Finally, it returns zero if all of the above match. Note that it does *NOT* compare its member splits.

Timespec xaccTransRetDateDueTS | ( | const Transaction * | trans | ) |

| Dates and txn-type for A/R and A/P "invoice" postings

GUID xaccTransReturnGUID | ( | const Transaction * | trans | ) |

| xaccTransReturnGUID() will returns a GUID struct associated with that transaction.

void xaccTransRollbackEdit | ( | Transaction * | trans | ) |

| The xaccTransRollbackEdit() routine rejects all edits made, and sets the transaction back to where it was before the editing started. This includes restoring any deleted splits, removing any added splits, and undoing the effects of xaccTransDestroy, as well as restoring share quantities, memos, descriptions, etc.

void xaccTransSetCurrency | ( | Transaction * | trans,
|  | gnc_commodity * | curr
| ) |

| Set the commodity of this transaction.

void xaccTransSetDate | ( | Transaction * | trans,
|  | int | day,
|  | int | mon,
|  | int | year
| ) |

| The xaccTransSetDate() method does the same thing as xaccTransSetDate[Posted]Secs(), but takes a convenient day-month-year format. (Footnote: this shouldn't matter to a user, but anyone modifying the engine should understand that when xaccTransCommitEdit() is called, the date order of each of the component splits will be checked, and will be restored in ascending date order.)

void xaccTransSetDateDueTS | ( | Transaction * | trans,
|  | const Timespec * | ts
| ) |

| Dates and txn-type for A/R and A/P "invoice" postings

void xaccTransSetDatePostedSecs | ( | Transaction * | trans,
|  | time_t | time
| ) |

| xaccTransSetDatePostedSecs() is just an alias for xaccTransSetDateSecs() -- both functions access the same date.

void xaccTransSetDatePostedTS | ( | Transaction * | trans,
|  | const Timespec * | ts
| ) |

| The xaccTransSetDatePostedTS() method does the same thing as xaccTransSetDate[Posted]Secs(), but takes a struct timespec64.

void xaccTransSetDateSecs | ( | Transaction * | trans,
|  | time_t | time
| ) |

| The xaccTransSetDateSecs() method will modify the posted date of the transaction, specified by a time_t (see ctime(3)).

void xaccTransSetNotes | ( | Transaction * | trans,
|  | const char * | notes
| ) |

| Sets the transaction Notes. The Notes field is only visible in the register in double-line mode

void xaccTransSetReadOnly | ( | Transaction * | trans,
|  | const char * | reason
| ) |

| Set the transaction to be ReadOnly

void xaccTransSetSlots_nc | ( | Transaction * | t,
|  | kvp_frame * | frm
| ) |

| Set the kvp_frame slots of this transaction to the given frm by directly using the frm pointer (i.e. non-copying).

void xaccTransSetTxnType | ( | Transaction * | trans,
|  | char | type
| ) |

| Set the Transaction Type See define TXN_TYPE_NONE, TXN_TYPE_INVOICE and TXN_TYPE_PAYMENT

void xaccTransVoid | ( | Transaction * | transaction,
|  | const char * | reason
| ) |

| xaccTransactionVoid voids a transaction. A void transaction has no values, is unaffected by reconciliation, and, by default is not included in any queries. A voided transaction should not be altered (and we'll try to make it so it can't be). voiding is irreversible. Once voided, a transaction cannot be un-voided.

gboolean xaccTransWarnReadOnly | ( | const Transaction * | trans | ) |

| FIXME: document me

void xaccTransWriteLog | ( | Transaction * | ,
|  | char |
| ) |

Parameters:

  char

  The engine currently uses the log mechanism with flag char set as follows: 'B' for 'begin edit' (followed by the transaction as it looks before any changes, i.e. the 'old value') 'D' for delete (i.e. delete the previous B; echoes the data in the 'old B') 'C' for commit (i.e. accept a previous B; data that follows is the 'new value') 'R' for rollback (i.e. revert to previous B; data that follows should be identical to old B)