mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2003-03-15 Christian Stimming <stimming@tuhh.de>
* src/engine/gnc-book.h, src/engine/*.h: Added a lot of documentation comments, improved doxygen output. At least the most important header files will now show up in doxygen. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8081 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
60a5555f59
commit
4cb98c9779
@ -1,3 +1,9 @@
|
||||
2003-03-15 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/engine/gnc-book.h, src/engine/*.h: Added a lot of
|
||||
documentation comments, improved doxygen output. At least the most
|
||||
important header files will now show up in doxygen.
|
||||
|
||||
2003-03-13 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/app-utils/option-util.c (gnc_option_get_range_info): Reapply
|
||||
|
@ -68,6 +68,6 @@ uninstall-hook:
|
||||
doxygen.cfg: doxygen.cfg.in Makefile
|
||||
rm -f $@.tmp
|
||||
sed < $< > $@.tmp \
|
||||
-e 's:@-top_srcdir-@:${top_srcdir}:g'
|
||||
-e 's:@-top_srcdir-@:${top_srcdir}:g; s:@-VERSION-@:${VERSION}:g'
|
||||
mv $@.tmp $@
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
# General configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = GnuCash
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = @-VERSION-@
|
||||
OUTPUT_DIRECTORY =
|
||||
OUTPUT_LANGUAGE = English
|
||||
EXTRACT_ALL = NO
|
||||
@ -13,7 +13,6 @@ EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
@ -48,7 +47,7 @@ SHOW_USED_FILES = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_FORMAT =
|
||||
@ -61,7 +60,7 @@ FILE_PATTERNS =
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = YES
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_PATTERNS = *P.h
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
@ -135,8 +134,6 @@ MAN_LINKS = NO
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -1,13 +1,22 @@
|
||||
|
||||
/*! \mainpage GnuCash design and developer's manual
|
||||
/*! \mainpage GnuCash design and developer's reference
|
||||
|
||||
\section intro Introduction
|
||||
This is the new GnuCash developper and design manual for GnuCash. Previous documentation will slowly be integrated into this, and eventually it should always be up to date since it is generated directly from the source files using Doxygen.
|
||||
|
||||
This is the new GnuCash developer and design manual for GnuCash.
|
||||
Previous documentation will slowly be integrated into this, and
|
||||
eventually it should always be up to date since it is generated
|
||||
directly from the source files using Doxygen.
|
||||
|
||||
\section hacking Hacking on this documentation
|
||||
I will eventually post a style guide for documenting, and document one of the files "by the book". Until then, feel free to start documenting or playing with doxygen configuration.
|
||||
|
||||
I will eventually post a style guide for documenting, and document one
|
||||
of the files "by the book". Until then, feel free to start
|
||||
documenting or playing with doxygen configuration. This main page can
|
||||
be found in src/doc/doxygen_main_page.c .
|
||||
|
||||
\subsection config Editing Doxygen configuration
|
||||
|
||||
To edit the doxygen configuration, you can use:
|
||||
*
|
||||
cd src/doc
|
||||
@ -15,6 +24,7 @@ cd src/doc
|
||||
doxywizard doxygen.cfg &
|
||||
|
||||
\subsection reference Doxygen reference documentation
|
||||
|
||||
The Doxygen web site (http://www.stack.nl/~dimitri/doxygen/) has a complete user manual. For the impatient, here are the most interesting sections:
|
||||
- How to write documentation blocks for files, functions, variables, etc.: http://www.stack.nl/~dimitri/doxygen/docblocks.html.
|
||||
Do not forget to add a file documentation block (@file) at the top of your file,
|
||||
|
@ -254,9 +254,11 @@ const char * xaccAccountGetLastNum (Account *account);
|
||||
* New commodity access routines.
|
||||
*
|
||||
* The account structure no longer stores two commodities ('currency'
|
||||
* and 'security'). Instead it stores only one commodity, that is the
|
||||
* one formerly known as 'security'. Use xaccAccountSetCommodity()
|
||||
* and xaccAccountGetCommodity() to set and fetch it.
|
||||
* and 'security'). Instead it stores only one commodity. This single
|
||||
* commodity is the one formerly known as 'security'. Use
|
||||
* xaccAccountSetCommodity() and xaccAccountGetCommodity() to set and
|
||||
* fetch it. (This transition has been done between version 1.6.x and
|
||||
* 1.7.0.)
|
||||
*
|
||||
* Basically, the engine eliminates the 'currency' field of the
|
||||
* Account structure. Instead, the common currency is stored with the
|
||||
|
@ -22,11 +22,8 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/*
|
||||
* FILE:
|
||||
* AccountP.h
|
||||
/** @file AccountP.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* This is the *private* header for the account structure.
|
||||
* No one outside of the engine should ever include this file.
|
||||
*
|
||||
@ -53,6 +50,12 @@
|
||||
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
|
||||
/** This is the data that describes an account.
|
||||
*
|
||||
* This is the *private* header for the account structure.
|
||||
* No one outside of the engine should ever include this file.
|
||||
*/
|
||||
struct account_s
|
||||
{
|
||||
/* public data, describes account */
|
||||
|
@ -22,11 +22,8 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/*
|
||||
* FILE:
|
||||
* Backend.h
|
||||
/** @file Backend.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* The 'backend' is a pseudo-object providing an interface between the
|
||||
* engine and a persistant data store (e.g. a server, a database, or
|
||||
* a file). There are no backend functions that are 'public' to
|
||||
@ -39,7 +36,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/* NOTE: if you modify GNCBackendError, please update src/scm/gnc.gwp */
|
||||
/** NOTE: if you modify GNCBackendError, please update src/scm/gnc.gwp */
|
||||
typedef enum {
|
||||
ERR_BACKEND_NO_ERR = 0,
|
||||
ERR_BACKEND_NO_BACKEND, /* Backend * pointer was null the err routine */
|
||||
@ -93,6 +90,14 @@ typedef enum {
|
||||
} GNCBackendError;
|
||||
/* NOTE: if you modify GNCBackendError, please update src/scm/gnc.gwp */
|
||||
|
||||
/** The Backend is a pseudo-object providing an interface between the
|
||||
* engine and a persistant data store (e.g. a server, a database, or
|
||||
* a file).
|
||||
*
|
||||
* There are no backend functions that are 'public' to users of the
|
||||
* engine. The backend can, however, report errors to the GUI & other
|
||||
* front-end users.
|
||||
*/
|
||||
typedef struct backend_s Backend;
|
||||
|
||||
typedef void (*GNCBePercentageFunc) (const char *message, double percent);
|
||||
|
@ -1,8 +1,5 @@
|
||||
/*
|
||||
* FILE:
|
||||
* Period.h
|
||||
/** @file Period.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* Implement accounting periods.
|
||||
*
|
||||
* CAUTION: this is currently a semi-functional, untested implementation
|
||||
@ -22,7 +19,7 @@
|
||||
#include "Query.h"
|
||||
|
||||
|
||||
/* The gnc_book_close_period() routine will 'close' a book at
|
||||
/** The gnc_book_close_period() routine will 'close' a book at
|
||||
* the indicated date. It returns a pointer to the closed book,
|
||||
* while the argument remains open. This routine will move
|
||||
* all of the older transactions from the open book to the
|
||||
@ -105,7 +102,7 @@ GNCBook * gnc_book_close_period (GNCBook *, Timespec,
|
||||
Account *equity_acct,
|
||||
const char *memo);
|
||||
|
||||
/* The gnc_book_partition() uses the result of the indicated query
|
||||
/** The gnc_book_partition() uses the result of the indicated query
|
||||
* to move a set of transactions from the "src" book to the "dest"
|
||||
* book. Before moving the transactions, it will first place a
|
||||
* copy of all of the accounts in "src" into "dest". This is done
|
||||
@ -135,7 +132,7 @@ GNCBook * gnc_book_close_period (GNCBook *, Timespec,
|
||||
*/
|
||||
void gnc_book_partition (GNCBook *dest, GNCBook *src, Query *);
|
||||
|
||||
/* The gnc_book_insert_trans_clobber() routine takes an existing
|
||||
/** The gnc_book_insert_trans_clobber() routine takes an existing
|
||||
* transaction that is located in one book, and moves it to
|
||||
* another book. It moves all of the splits as well. In the
|
||||
* course of the move, the transaction is literally deleted
|
||||
|
@ -22,7 +22,7 @@
|
||||
\********************************************************************/
|
||||
|
||||
/**
|
||||
* @addtogroup Engine
|
||||
* @addtogroup SchedXaction
|
||||
* @{ */
|
||||
/**
|
||||
* @file SchedXaction.h
|
||||
|
@ -20,14 +20,14 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/*
|
||||
* FILE:
|
||||
* Scrub.h
|
||||
/** @file Scrub.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* Provides a set of functions and utilities for scrubbing clean
|
||||
* single-entry accounts so that they can be promoted into
|
||||
* self-consistent, clean double-entry accounts.
|
||||
* Provides a set of functions and utilities for checking and
|
||||
* repairing (formerly called 'scrubbing') clean single-entry accounts
|
||||
* so that they can be promoted into self-consistent, clean
|
||||
* double-entry accounts. Basically and additionally, this file
|
||||
* collects all functions that turn old (deprecated) data structures
|
||||
* into the current new data model.
|
||||
*
|
||||
* HISTORY:
|
||||
* Created by Linas Vepstas December 1998
|
||||
@ -40,7 +40,7 @@
|
||||
#include "Group.h"
|
||||
#include "gnc-engine.h"
|
||||
|
||||
/* The ScrubOrphans() methods search for transacations that contain
|
||||
/** The ScrubOrphans() methods search for transacations that contain
|
||||
* splits that do not have a parent account. These "orphaned splits"
|
||||
* are placed into an "orphan account" which the user will have to
|
||||
* go into and clean up. Kind of like the unix "Lost+Found" directory
|
||||
@ -64,7 +64,7 @@ void xaccAccountScrubOrphans (Account *acc, GNCBook *book);
|
||||
void xaccAccountTreeScrubOrphans (Account *acc, GNCBook *book);
|
||||
void xaccGroupScrubOrphans (AccountGroup *grp, GNCBook *book);
|
||||
|
||||
/* The ScrubSplit methods ensure that splits with the same commodity
|
||||
/** The ScrubSplit methods ensure that splits with the same commodity
|
||||
* and command currency have the same amount and value.
|
||||
*/
|
||||
void xaccSplitScrub (Split *split);
|
||||
@ -73,7 +73,7 @@ void xaccAccountScrubSplits (Account *account);
|
||||
void xaccAccountTreeScrubSplits (Account *account);
|
||||
void xaccGroupScrubSplits (AccountGroup *group);
|
||||
|
||||
/* The xaccScrubImbalance() method searches for transactions that do
|
||||
/** The xaccScrubImbalance() method searches for transactions that do
|
||||
* not balance to zero. If any such transactions are found, a split
|
||||
* is created to offset this amount and is added to an "imbalance"
|
||||
* account.
|
||||
@ -84,16 +84,16 @@ void xaccAccountScrubImbalance (Account *acc, GNCBook *book);
|
||||
void xaccAccountTreeScrubImbalance (Account *acc, GNCBook *book);
|
||||
void xaccGroupScrubImbalance (AccountGroup *grp, GNCBook *book);
|
||||
|
||||
/* The xaccTransScrubCurrency method fixes transactions without a
|
||||
/** The xaccTransScrubCurrency method fixes transactions without a
|
||||
* common_currency by using the old account currency and security
|
||||
* fields of the parent accounts of the transaction's splits. */
|
||||
void xaccTransScrubCurrency (Transaction *trans, GNCBook *book);
|
||||
|
||||
/* The xaccAccountScrubCommodity method fixed accounts without
|
||||
/** The xaccAccountScrubCommodity method fixed accounts without
|
||||
* a commodity by using the old account currency and security. */
|
||||
void xaccAccountScrubCommodity (Account *account, GNCBook *book);
|
||||
|
||||
/* The xaccGroupScrubCommodities will scrub the currency/commodity
|
||||
/** The xaccGroupScrubCommodities will scrub the currency/commodity
|
||||
* of all accounts & transactions in the group. */
|
||||
void xaccGroupScrubCommodities (AccountGroup *group, GNCBook *book);
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/** @file TransLog.h The transaction logger */
|
||||
|
||||
#ifndef XACC_TRANS_LOG_H
|
||||
#define XACC_TRANS_LOG_H
|
||||
|
||||
|
@ -111,7 +111,7 @@ Transaction * xaccMallocTransaction (GNCBook *book);
|
||||
original order. */
|
||||
void xaccTransDestroy (Transaction *trans);
|
||||
|
||||
/** @brief DOCUMENT ME!*/
|
||||
/** DOCUMENT ME!*/
|
||||
gboolean xaccTransEqual(const Transaction *ta,
|
||||
const Transaction *tb,
|
||||
gboolean check_guids,
|
||||
@ -186,26 +186,26 @@ void xaccTransSetTxnType (Transaction *trans, char type);
|
||||
char xaccTransGetTxnType (const Transaction *trans);
|
||||
|
||||
|
||||
/** @brief Sets the transaction Number (or ID) field*/
|
||||
/** Sets the transaction Number (or ID) field*/
|
||||
void xaccTransSetNum (Transaction *trans, const char *num);
|
||||
/** @brief Sets the transaction Description */
|
||||
/** Sets the transaction Description */
|
||||
void xaccTransSetDescription (Transaction *trans, const char *desc);
|
||||
/** @brief Sets the transaction Notes
|
||||
/** Sets the transaction Notes
|
||||
*
|
||||
The Notes field is only visible in the register in double-line mode */
|
||||
void xaccTransSetNotes (Transaction *trans, const char *notes);
|
||||
|
||||
/** @brief Gets the transaction Number (or ID) field*/
|
||||
/** Gets the transaction Number (or ID) field*/
|
||||
const char * xaccTransGetNum (const Transaction *trans);
|
||||
/** @brief Gets the transaction Description */
|
||||
/** Gets the transaction Description */
|
||||
const char * xaccTransGetDescription (const Transaction *trans);
|
||||
/** @brief Gets the transaction Notes
|
||||
/** Gets the transaction Notes
|
||||
*
|
||||
The Notes field is only visible in the register in double-line mode */
|
||||
const char * xaccTransGetNotes (const Transaction *trans);
|
||||
|
||||
|
||||
/** @brief Add a split to the transaction
|
||||
/** Add a split to the transaction
|
||||
*
|
||||
The xaccTransAppendSplit() method will append the indicated
|
||||
split to the collection of splits in this transaction.
|
||||
@ -306,8 +306,10 @@ int xaccTransOrder (const Transaction *ta, const Transaction *tb);
|
||||
void xaccTransSetDate (Transaction *trans,
|
||||
int day, int mon, int year);
|
||||
|
||||
/** The xaccTransSetDateSecs() method will modify the posted date of
|
||||
the transaction, specified by a time_t (see ctime(3)). */
|
||||
/** The xaccTransSetDateSecs() method will modify the <i>posted</i>
|
||||
date of the transaction, specified by a time_t (see ctime(3)). The
|
||||
posted date is the date when this transaction was posted at the
|
||||
bank. */
|
||||
void xaccTransSetDateSecs (Transaction *trans, time_t time);
|
||||
|
||||
/** xaccTransSetDatePostedSecs() is just an alias for
|
||||
@ -319,28 +321,43 @@ void xaccTransSetDatePostedSecs (Transaction *trans, time_t time);
|
||||
void xaccTransSetDatePostedTS (Transaction *trans,
|
||||
const Timespec *ts);
|
||||
|
||||
/** @brief Modify the date of when the transaction was entered. */
|
||||
/** Modify the date of when the transaction was entered. The entered
|
||||
* date is the date when the register entry was made. */
|
||||
void xaccTransSetDateEnteredSecs (Transaction *trans, time_t time);
|
||||
/** @brief Modify the date of when the transaction was entered. */
|
||||
/** Modify the date of when the transaction was entered. The entered
|
||||
* date is the date when the register entry was made. */
|
||||
void xaccTransSetDateEnteredTS (Transaction *trans,
|
||||
const Timespec *ts);
|
||||
|
||||
/** Dates and txn-type for A/R and A/P "invoice" postings */
|
||||
void xaccTransSetDateDueTS (Transaction *trans, const Timespec *ts);
|
||||
|
||||
/** Retrieve the posted date of the transaction. (Although having
|
||||
different function names, GetDate and GetDatePosted refer to the
|
||||
same single date.)*/
|
||||
/** Retrieve the posted date of the transaction. The posted date is
|
||||
the date when this transaction was posted at the bank. (Although
|
||||
having different function names, GetDate and GetDatePosted refer
|
||||
to the same single date.)*/
|
||||
time_t xaccTransGetDate (const Transaction *trans);
|
||||
/** Retrieve the posted date of the transaction. The posted date is
|
||||
the date when this transaction was posted at the bank. (Although
|
||||
having different function names, GetDate and GetDatePosted refer
|
||||
to the same single date.)*/
|
||||
void xaccTransGetDatePostedTS (const Transaction *trans, Timespec *ts);
|
||||
/** Retrieve the posted date of the transaction. The posted date is
|
||||
the date when this transaction was posted at the bank. (Although
|
||||
having different function names, GetDate and GetDatePosted refer
|
||||
to the same single date.)*/
|
||||
Timespec xaccTransRetDatePostedTS (const Transaction *trans);
|
||||
|
||||
/** Retrieve the date of when the transaction was entered. */
|
||||
/** Retrieve the date of when the transaction was entered. The entered
|
||||
* date is the date when the register entry was made.*/
|
||||
void xaccTransGetDateEnteredTS (const Transaction *trans, Timespec *ts);
|
||||
/** Retrieve the date of when the transaction was entered. The entered
|
||||
* date is the date when the register entry was made.*/
|
||||
Timespec xaccTransRetDateEnteredTS (const Transaction *trans);
|
||||
|
||||
/** Dates and txn-type for A/R and A/P "invoice" postings */
|
||||
Timespec xaccTransRetDateDueTS (const Transaction *trans);
|
||||
/** Dates and txn-type for A/R and A/P "invoice" postings */
|
||||
void xaccTransGetDateDueTS (const Transaction *trans, Timespec *ts);
|
||||
|
||||
/**@}*/
|
||||
|
@ -20,11 +20,8 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/*
|
||||
* FILE:
|
||||
* gnc-book.h
|
||||
/** @file gnc-book.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* Encapsulate all the information about a gnucash dataset.
|
||||
* See src/docs/books.txt for implementation overview.
|
||||
*
|
||||
@ -46,7 +43,7 @@
|
||||
GNCBook * gnc_book_new (void);
|
||||
void gnc_book_destroy (GNCBook *book);
|
||||
|
||||
/*
|
||||
/**
|
||||
* The gnc_book_get_guid() routine returns the GUID for this book.
|
||||
* The gnc_book_get_slots() method will return the kvp data
|
||||
* for the book
|
||||
@ -65,7 +62,7 @@ gnc_commodity_table * gnc_book_get_commodity_table(GNCBook *book);
|
||||
GList * gnc_book_get_schedxactions( GNCBook *book );
|
||||
AccountGroup * gnc_book_get_template_group( GNCBook *book );
|
||||
|
||||
/* The gnc_book_set_data() and gnc_book_get_data() routines allow
|
||||
/** The gnc_book_set_data() and gnc_book_get_data() routines allow
|
||||
* arbitrary pointers to structs to be stored in GNCBook.
|
||||
* This is the "prefered" method for extending GNCBook to hold
|
||||
* new data types.
|
||||
@ -86,25 +83,25 @@ gpointer gnc_book_get_backend (GNCBook *book);
|
||||
*/
|
||||
gboolean gnc_book_not_saved (GNCBook *book);
|
||||
|
||||
/* Call this function when you change the book kvp, to make sure the book
|
||||
/** Call this function when you change the book kvp, to make sure the book
|
||||
* is marked 'dirty'.
|
||||
*/
|
||||
void gnc_book_kvp_changed (GNCBook *book);
|
||||
|
||||
/* The gnc_book_equal() method returns TRUE if the engine data
|
||||
/** The gnc_book_equal() method returns TRUE if the engine data
|
||||
* in the two given books is equal. */
|
||||
gboolean gnc_book_equal (GNCBook *book_1, GNCBook *book_2);
|
||||
|
||||
/* XXX FIXME count_transactions is a utility function, needs
|
||||
/** XXX FIXME count_transactions is a utility function, needs
|
||||
* to be moved to some utility/support file. */
|
||||
guint gnc_book_count_transactions(GNCBook *book);
|
||||
|
||||
/* This will 'get and increment' the named counter for this book.
|
||||
/** This will 'get and increment' the named counter for this book.
|
||||
* The return value is -1 on error or the incremented counter.
|
||||
*/
|
||||
gint64 gnc_book_get_counter (GNCBook *book, const char *counter_name);
|
||||
|
||||
/* Book parameter names */
|
||||
/** Book parameter names */
|
||||
|
||||
#define BOOK_KVP "kvp"
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
* Author: Linas Vepstas (linas@linas.org) *
|
||||
\********************************************************************/
|
||||
|
||||
/** @file gnc-engine-util.h @brief GnuCash engine utility functions */
|
||||
|
||||
#ifndef GNC_ENGINE_UTIL_H
|
||||
#define GNC_ENGINE_UTIL_H
|
||||
|
||||
|
@ -21,55 +21,188 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
* *
|
||||
********************************************************************/
|
||||
/** @addtogroup Engine
|
||||
@{ */
|
||||
/** @file gnc-engine.h
|
||||
@brief All type declarations for the whole Gnucash engine
|
||||
@author Copyright (C) 1997 Robin D. Clark
|
||||
@author Copyright (C) 1997-2001 Linas Vepstas <linas@linas.org>
|
||||
*/
|
||||
|
||||
#ifndef GNC_ENGINE_H
|
||||
#define GNC_ENGINE_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
/** TYPES **********************************************************/
|
||||
/* TYPES **********************************************************/
|
||||
|
||||
/** @brief Account in Gnucash.
|
||||
*
|
||||
* This is the typename for an account. The actual structure is
|
||||
* defined in the private header AccountP.h, but no one outside the
|
||||
* engine should include that file. Instead, access that data only
|
||||
* through the functions in Account.h .*/
|
||||
typedef struct account_s Account;
|
||||
|
||||
/** @brief A group of accounts in Gnucash.
|
||||
*/
|
||||
typedef struct account_group_s AccountGroup;
|
||||
|
||||
/** @brief Split in Gnucash.
|
||||
*
|
||||
* A "split" is more commonly refered to as a "entry" in a
|
||||
* "transaction". Each split belongs to one Account and one
|
||||
* Transaction. The split is one out of several parts a Transaction is
|
||||
* divided into.
|
||||
*
|
||||
* This is the typename for a split. The actual structure is defined
|
||||
* in the private header TransactionP.h, but no one outside the engine
|
||||
* should include that file. Instead, access that data only through
|
||||
* the functions in Transaction.h .*/
|
||||
typedef struct split_s Split;
|
||||
|
||||
/** @brief Transaction in Gnucash.
|
||||
*
|
||||
* A Transaction is a piece of business done; the transfer of money
|
||||
* from one account to one or more other accounts. Each Transaction is
|
||||
* divided into one or more Splits (usually two).
|
||||
*
|
||||
* This is the typename for a transaction. The actual structure is
|
||||
* defined in the private header TransactionP.h, but no one outside
|
||||
* the engine should include that file. Instead, access that data only
|
||||
* through the functions in Transaction.h .*/
|
||||
typedef struct transaction_s Transaction;
|
||||
|
||||
/** @brief Encapsulates all the information about a dataset
|
||||
* manipulated by GnuCash.
|
||||
*
|
||||
* A GNCBook holds the actual data.
|
||||
*/
|
||||
typedef struct gnc_book_struct GNCBook;
|
||||
|
||||
/** @brief An article that is bought and sold.
|
||||
*
|
||||
* A Commodity is the most general term of what an account keeps track
|
||||
* of. Usually this is a monetary currency, but it can also be a stock
|
||||
* share or even a precious metal. Every account keeps track of
|
||||
* exactly one gnc_commodity.
|
||||
*
|
||||
* (Up to version 1.6.x, we used to have currencies and
|
||||
* securities. Now these concepts have been merged into this
|
||||
* gnc_commodity. See the comments at xaccAccountSetCommodity() for
|
||||
* more about that.)
|
||||
*
|
||||
* This is the typename for a gnc_commodity. The actual structure is
|
||||
* defined in a private source file. For accessing that data, only use
|
||||
* the functions in gnc-commodity.h .*/
|
||||
typedef struct gnc_commodity_s gnc_commodity;
|
||||
|
||||
/** @brief A gnc_commodity_table is a database of commodity info. */
|
||||
typedef struct gnc_commodity_table_s gnc_commodity_table;
|
||||
|
||||
/**
|
||||
* A GNCLot implements the fundamental conceptual idea behind
|
||||
* invoices, inventory lots, and stock market investment lots.
|
||||
*
|
||||
* See the file src/doc/lots.txt for implmentation overview.
|
||||
*/
|
||||
typedef struct gnc_lot_struct GNCLot;
|
||||
|
||||
/** @brief Encapsulates a connection to a GnuCash backend.
|
||||
*
|
||||
* A GNCSession manages the connection to a persistant data store,
|
||||
* whereas the backend is the thing that performs the actual datastore
|
||||
* access.
|
||||
*
|
||||
* This class provides several important services:
|
||||
*
|
||||
* 1) It resolves and loads the appropriate backend, based on
|
||||
* the URL.
|
||||
*
|
||||
* 2) It reports backend errors (e.g. network errors, storage
|
||||
* corruption errors) through a single, backend-independent
|
||||
* API.
|
||||
*
|
||||
* 3) It reports non-error events received from the backend.
|
||||
*
|
||||
* 4) It helps manage global dataset locks. For example, for the
|
||||
* file backend, the lock prevents multiple users from editing
|
||||
* the same file at the same time, thus avoiding lost data due
|
||||
* to race conditions. Thus, an open session implies that the
|
||||
* associated file is locked.
|
||||
*
|
||||
* 5) Misc utilities, such as a search path for the file to be
|
||||
* edited, and/or other URL resolution utilities. This should
|
||||
* simplify install & maintenance problems for naive users who
|
||||
* may not have a good grasp on what a file system is, or where
|
||||
* they want to keep their data files.
|
||||
*
|
||||
* 6) In the future, this class is probably a good place to manage
|
||||
* a portion of the user authentication process, and hold user
|
||||
* credentials/cookies/keys/tokens. This is because at the
|
||||
* coarsest level, authorization can happen at the datastore
|
||||
* level: i.e. does this user even have the authority to connect
|
||||
* to and open this datastore?
|
||||
*
|
||||
* A brief note about books & sessions: A GNCBook encapsulates the
|
||||
* datasets manipulated by GnuCash. A GNCBook holds the actual data.
|
||||
* By contrast, the session mediates the connection between a book
|
||||
* (the thing that lives in virtual memory in the local process) and
|
||||
* the datastore (the place where book data lives permanently, e.g.,
|
||||
* file, database).
|
||||
*
|
||||
* In the current design, a session may hold multiple books. For
|
||||
* now, exactly what this means is somewhat vague, and code in
|
||||
* various places makes some implicit assumptions: first, only
|
||||
* one book is 'current' and open for editing. Next, its assumed
|
||||
* that all of the books in a session are related in some way.
|
||||
* i.e. that they are all earlier accounting periods of the
|
||||
* currently open book. In particular, the backends probably
|
||||
* make that assumption, in order to store the different accounting
|
||||
* periods in a clump so that one can be found, given another.
|
||||
*/
|
||||
typedef struct gnc_session_struct GNCSession;
|
||||
|
||||
/** GList of Account */
|
||||
typedef GList AccountList;
|
||||
/** GList of GNCBook */
|
||||
typedef GList BookList;
|
||||
/** GList of GNCLot */
|
||||
typedef GList LotList;
|
||||
/** GList of Split */
|
||||
typedef GList SplitList;
|
||||
/** GList of Transaction */
|
||||
typedef GList TransList;
|
||||
|
||||
/** GList of GUIDs of a Account */
|
||||
typedef GList AccountGUIDList;
|
||||
/** GList of GUIDs of a GNCBook */
|
||||
typedef GList BookGUIDList;
|
||||
|
||||
/** Function type for init hooks in the engine. */
|
||||
typedef void (* gnc_engine_init_hook_t)(int, char **);
|
||||
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
|
||||
/* GnuCash version number infomation. */
|
||||
/** GnuCash version number infomation. */
|
||||
unsigned int gnucash_major_version (void);
|
||||
/** GnuCash version number infomation. */
|
||||
unsigned int gnucash_minor_version (void);
|
||||
/** GnuCash version number infomation. */
|
||||
unsigned int gnucash_micro_version (void);
|
||||
|
||||
/* gnc_engine_init MUST be called before gnc engine functions can
|
||||
/** gnc_engine_init MUST be called before gnc engine functions can
|
||||
* be used. */
|
||||
void gnc_engine_init(int argc, char ** argv);
|
||||
|
||||
/* called to shutdown the engine */
|
||||
/** Called to shutdown the engine */
|
||||
void gnc_engine_shutdown (void);
|
||||
|
||||
/* pass a function pointer to gnc_engine_add_init_hook and
|
||||
/** Pass a function pointer to gnc_engine_add_init_hook and
|
||||
* it will be called during the evaluation of gnc_engine_init */
|
||||
void gnc_engine_add_init_hook(gnc_engine_init_hook_t hook);
|
||||
|
||||
/* Many strings used throughout the engine are likely to be duplicated.
|
||||
/** Many strings used throughout the engine are likely to be duplicated.
|
||||
* So we provide a reference counted cache system for the strings, which
|
||||
* shares strings whenever possible.
|
||||
*
|
||||
@ -91,3 +224,4 @@ void gnc_engine_add_init_hook(gnc_engine_init_hook_t hook);
|
||||
GCache* gnc_engine_get_string_cache(void);
|
||||
|
||||
#endif
|
||||
/** @} */
|
||||
|
@ -20,11 +20,8 @@
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* FILE:
|
||||
* gnc-lot.h
|
||||
/** @file gnc-lot.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* Lots implement the fundamental conceptual idea behind invoices,
|
||||
* inventory lots, and stock market investment lots. See the file
|
||||
* src/doc/lots.txt for implmentation overview.
|
||||
@ -47,13 +44,13 @@ const GUID * gnc_lot_get_guid (GNCLot *p);
|
||||
GNCLot * gnc_lot_lookup (const GUID *guid, GNCBook *book);
|
||||
GNCBook * gnc_lot_get_book (GNCLot *);
|
||||
|
||||
/* The gnc_lot_add_split() routine adds a split to this lot. Note
|
||||
/** The gnc_lot_add_split() routine adds a split to this lot. Note
|
||||
* that *all* splits in a lot must also be in the same account.
|
||||
*/
|
||||
void gnc_lot_add_split (GNCLot *, Split *);
|
||||
void gnc_lot_remove_split (GNCLot *, Split *);
|
||||
|
||||
/* The gnc_lot_get_split_list() routine returns a GList of all the
|
||||
/** The gnc_lot_get_split_list() routine returns a GList of all the
|
||||
* splits in this lot. Do *not* not free this list when done;
|
||||
* it is a pointer straight into the lots intenal list. Do
|
||||
* *not* add to or remove from this list directly. Calling
|
||||
@ -63,23 +60,23 @@ void gnc_lot_remove_split (GNCLot *, Split *);
|
||||
SplitList * gnc_lot_get_split_list (GNCLot *);
|
||||
gint gnc_lot_count_splits (GNCLot *);
|
||||
|
||||
/* The gnc_lot_get_account() routine returns the account with which
|
||||
/** The gnc_lot_get_account() routine returns the account with which
|
||||
* this lot is associated. */
|
||||
Account * gnc_lot_get_account (GNCLot *);
|
||||
|
||||
/* The gnc_lot_get_balance() routine returns the balance of the lot.
|
||||
/** The gnc_lot_get_balance() routine returns the balance of the lot.
|
||||
* The commodity in which this balance is expressed is the commodity
|
||||
* of the account. */
|
||||
gnc_numeric gnc_lot_get_balance (GNCLot *);
|
||||
|
||||
/* The gnc_lot_is_closed() routine returns a boolean flag: is this
|
||||
/** The gnc_lot_is_closed() routine returns a boolean flag: is this
|
||||
* lot closed? A lot is closed if its balance is zero. This
|
||||
* routine is faster than using gnc_lot_get_balance() because
|
||||
* once the balance goes to zero, this fact is cached.
|
||||
*/
|
||||
gboolean gnc_lot_is_closed (GNCLot *);
|
||||
|
||||
/* Every lot has a place to hang kvp data. This routine returns that
|
||||
/** Every lot has a place to hang kvp data. This routine returns that
|
||||
* place.
|
||||
* */
|
||||
kvp_frame * gnc_lot_get_slots (GNCLot *);
|
||||
|
@ -21,6 +21,8 @@
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
/** @file gnc-numeric.h @brief An exact-number library for gnucash.*/
|
||||
|
||||
#ifndef GNC_NUMERIC_H
|
||||
#define GNC_NUMERIC_H
|
||||
|
||||
@ -31,14 +33,17 @@ struct _gnc_numeric {
|
||||
gint64 denom;
|
||||
};
|
||||
|
||||
/** @brief An exact-number type for gnucash.
|
||||
*
|
||||
* This is a rational number, defined by nominator and denominator. */
|
||||
typedef struct _gnc_numeric gnc_numeric;
|
||||
|
||||
/* bitmasks for HOW flags */
|
||||
/** bitmasks for HOW flags */
|
||||
#define GNC_NUMERIC_RND_MASK 0x0000000f
|
||||
#define GNC_NUMERIC_DENOM_MASK 0x000000f0
|
||||
#define GNC_NUMERIC_SIGFIGS_MASK 0x0000ff00
|
||||
|
||||
/* rounding/truncation modes for operations */
|
||||
/** rounding/truncation modes for operations */
|
||||
enum {
|
||||
GNC_RND_FLOOR = 0x01,
|
||||
GNC_RND_CEIL = 0x02,
|
||||
@ -50,7 +55,7 @@ enum {
|
||||
GNC_RND_NEVER = 0x08
|
||||
};
|
||||
|
||||
/* auto-denominator types */
|
||||
/** auto-denominator types */
|
||||
enum {
|
||||
GNC_DENOM_EXACT = 0x10,
|
||||
GNC_DENOM_REDUCE = 0x20,
|
||||
@ -59,10 +64,10 @@ enum {
|
||||
GNC_DENOM_SIGFIG = 0x50
|
||||
};
|
||||
|
||||
/* bits 8-15 of 'how' are reserved for the number of significant
|
||||
/** bits 8-15 of 'how' are reserved for the number of significant
|
||||
* digits to use in the output with GNC_DENOM_SIGFIG */
|
||||
|
||||
/* errors */
|
||||
/** errors */
|
||||
enum {
|
||||
GNC_ERROR_OK = 0,
|
||||
GNC_ERROR_ARG = -1,
|
||||
@ -77,29 +82,29 @@ enum {
|
||||
#define GNC_DENOM_SIGFIGS( a ) ( ((( a ) & 0xff) << 8) | GNC_DENOM_SIGFIG)
|
||||
#define GNC_NUMERIC_GET_SIGFIGS( a ) ( (( a ) & 0xff00 ) >> 8)
|
||||
|
||||
/* make a gnc_numeric from numerator and denominator */
|
||||
/** make a gnc_numeric from numerator and denominator */
|
||||
gnc_numeric gnc_numeric_create(gint64 num, gint64 denom);
|
||||
|
||||
/* create a zero-value gnc_numeric */
|
||||
/** create a zero-value gnc_numeric */
|
||||
gnc_numeric gnc_numeric_zero(void);
|
||||
|
||||
/* make a special error-signalling gnc_numeric */
|
||||
/** make a special error-signalling gnc_numeric */
|
||||
gnc_numeric gnc_numeric_error(int error_code);
|
||||
|
||||
/* check for error signal in value */
|
||||
/** check for error signal in value */
|
||||
int gnc_numeric_check(gnc_numeric a);
|
||||
|
||||
/* get parts */
|
||||
/** get parts */
|
||||
gint64 gnc_numeric_num(gnc_numeric a);
|
||||
gint64 gnc_numeric_denom(gnc_numeric a);
|
||||
|
||||
/* tests */
|
||||
/** tests */
|
||||
int gnc_numeric_zero_p(gnc_numeric a); /* 1 if 0, 0 else */
|
||||
int gnc_numeric_compare(gnc_numeric a, gnc_numeric b);
|
||||
int gnc_numeric_negative_p(gnc_numeric a);
|
||||
int gnc_numeric_positive_p(gnc_numeric a);
|
||||
|
||||
/* equivalence predicates :
|
||||
/** equivalence predicates :
|
||||
* eq : a and b are exactly the same (same numerator and denominator)
|
||||
* equal : a and b represent exactly the same number (ratio of numerator
|
||||
* to denominator is exactly equal)
|
||||
@ -111,7 +116,7 @@ int gnc_numeric_equal(gnc_numeric a, gnc_numeric b);
|
||||
int gnc_numeric_same(gnc_numeric a, gnc_numeric b,
|
||||
gint64 denom, gint how);
|
||||
|
||||
/* arithmetic operations */
|
||||
/** arithmetic operations */
|
||||
gnc_numeric gnc_numeric_add(gnc_numeric a, gnc_numeric b,
|
||||
gint64 denom, gint how);
|
||||
gnc_numeric gnc_numeric_sub(gnc_numeric a, gnc_numeric b,
|
||||
@ -123,11 +128,11 @@ gnc_numeric gnc_numeric_div(gnc_numeric a, gnc_numeric b,
|
||||
gnc_numeric gnc_numeric_neg(gnc_numeric a);
|
||||
gnc_numeric gnc_numeric_abs(gnc_numeric a);
|
||||
|
||||
/* some shortcuts for common operations */
|
||||
/** some shortcuts for common operations */
|
||||
gnc_numeric gnc_numeric_add_fixed(gnc_numeric a, gnc_numeric b);
|
||||
gnc_numeric gnc_numeric_sub_fixed(gnc_numeric a, gnc_numeric b);
|
||||
|
||||
/* arithmetic functions with exact error returns */
|
||||
/** arithmetic functions with exact error returns */
|
||||
gnc_numeric gnc_numeric_add_with_error(gnc_numeric a, gnc_numeric b,
|
||||
gint64 denom, gint how,
|
||||
gnc_numeric * error);
|
||||
@ -141,7 +146,7 @@ gnc_numeric gnc_numeric_div_with_error(gnc_numeric a, gnc_numeric b,
|
||||
gint64 denom, gint how,
|
||||
gnc_numeric * error);
|
||||
|
||||
/* change the denominator of a gnc_numeric value */
|
||||
/** change the denominator of a gnc_numeric value */
|
||||
gnc_numeric gnc_numeric_convert(gnc_numeric in, gint64 denom,
|
||||
gint how);
|
||||
|
||||
@ -149,17 +154,17 @@ gnc_numeric gnc_numeric_convert_with_error(gnc_numeric in, gint64 denom,
|
||||
gint how,
|
||||
gnc_numeric * error);
|
||||
|
||||
/* reduce by GCF elimination */
|
||||
/** reduce by GCF elimination */
|
||||
gnc_numeric gnc_numeric_reduce(gnc_numeric in);
|
||||
|
||||
/* convert to and from floating-point values */
|
||||
/** convert to and from floating-point values */
|
||||
gnc_numeric double_to_gnc_numeric(double in, gint64 denom,
|
||||
gint how);
|
||||
double gnc_numeric_to_double(gnc_numeric in);
|
||||
|
||||
gchar *gnc_numeric_to_string(gnc_numeric n);
|
||||
|
||||
/* Read a gnc_numeric from str, skipping any leading whitespace, and
|
||||
/** Read a gnc_numeric from str, skipping any leading whitespace, and
|
||||
returning a pointer to just past the last byte read. Return NULL
|
||||
on error. */
|
||||
const gchar *string_to_gnc_numeric(const gchar* str, gnc_numeric *n);
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/**********************************************************************\
|
||||
* @file gnc-pricedb.h
|
||||
|
||||
Introduction:
|
||||
|
||||
@ -50,9 +51,9 @@
|
||||
*/
|
||||
|
||||
|
||||
/**********************************************************************\
|
||||
/* *********************************************************************/
|
||||
|
||||
GNCPrice:
|
||||
/** GNCPrice:
|
||||
|
||||
Each price in the database represents an "instantaneous" quote for
|
||||
a given commodity with respect to another commodity. For example,
|
||||
@ -112,18 +113,18 @@
|
||||
are pointer unique.
|
||||
|
||||
*/
|
||||
|
||||
typedef struct gnc_price_s GNCPrice;
|
||||
/** */
|
||||
typedef struct gnc_price_lookup_s GNCPriceLookup;
|
||||
|
||||
/****************/
|
||||
/* constructors */
|
||||
|
||||
/* gnc_price_create - returns a newly allocated and initialized price
|
||||
/** gnc_price_create - returns a newly allocated and initialized price
|
||||
with a reference count of 1. */
|
||||
GNCPrice *gnc_price_create(GNCBook *book);
|
||||
|
||||
/* gnc_price_clone - returns a newly allocated price that's a
|
||||
/** 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_clone(GNCPrice* p, GNCBook *book);
|
||||
@ -131,11 +132,11 @@ GNCPrice *gnc_price_clone(GNCPrice* p, GNCBook *book);
|
||||
/*********************/
|
||||
/* memory management */
|
||||
|
||||
/* gnc_price_ref - indicate your need for a given price to stick
|
||||
/** gnc_price_ref - indicate your need for a given price to stick
|
||||
around (i.e. increase its reference count by 1). */
|
||||
void gnc_price_ref(GNCPrice *p);
|
||||
|
||||
/* gnc_price_ref - indicate you're finished with a price
|
||||
/** gnc_price_ref - indicate you're finished with a price
|
||||
(i.e. decrease its reference count by 1). */
|
||||
void gnc_price_unref(GNCPrice *p);
|
||||
|
||||
@ -166,7 +167,7 @@ void gnc_price_set_version(GNCPrice *p, gint32 versn);
|
||||
/***********/
|
||||
/* getters */
|
||||
|
||||
/* As mentioned above all of the getters return data that's internal
|
||||
/** As mentioned above all of the getters return data that's internal
|
||||
to the GNCPrice, not copies, so don't free these values. */
|
||||
GNCPrice * gnc_price_lookup (const GUID *guid, GNCBook *book);
|
||||
const GUID * gnc_price_get_guid (GNCPrice *p);
|
||||
@ -181,8 +182,8 @@ gnc_numeric gnc_price_get_value(GNCPrice *p);
|
||||
gint32 gnc_price_get_version(GNCPrice *p);
|
||||
gboolean gnc_price_equal(GNCPrice *p1, GNCPrice *p2);
|
||||
|
||||
/**********************************************************************
|
||||
GNCPrice lists:
|
||||
/* ******************************************************************** */
|
||||
/** GNCPrice lists:
|
||||
|
||||
The database communicates multiple prices in and out via gnc price
|
||||
lists. These are just time sorted GLists of GNCPrice pointers.
|
||||
@ -195,20 +196,20 @@ gboolean gnc_price_equal(GNCPrice *p1, GNCPrice *p2);
|
||||
|
||||
*/
|
||||
|
||||
/* gnc_price_list_insert - insert a price into the given list, calling
|
||||
/** gnc_price_list_insert - insert a price into the given list, calling
|
||||
gnc_price_ref on it during the process. */
|
||||
gboolean gnc_price_list_insert(GList **prices, GNCPrice *p);
|
||||
/* gnc_price_list_remove - remove the price, p, from the given list,
|
||||
/** gnc_price_list_remove - remove the price, p, from the given list,
|
||||
calling gnc_price_unref on it during the process. */
|
||||
gboolean gnc_price_list_remove(GList **prices, GNCPrice *p);
|
||||
/* gnc_price_list_destroy - destroy the given price list, calling
|
||||
/** gnc_price_list_destroy - destroy the given price list, calling
|
||||
gnc_price_unref on all the prices included in the list. */
|
||||
void gnc_price_list_destroy(GList *prices);
|
||||
|
||||
gboolean gnc_price_list_equal(GList *prices1, GList *prices2);
|
||||
|
||||
/**********************************************************************
|
||||
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
|
||||
@ -220,43 +221,42 @@ gboolean gnc_price_list_equal(GList *prices1, GList *prices2);
|
||||
it/them.
|
||||
|
||||
*/
|
||||
|
||||
typedef struct gnc_price_db_s GNCPriceDB;
|
||||
|
||||
|
||||
/* gnc_pricedb_create - create a new pricedb. Normally you won't need
|
||||
/** gnc_pricedb_create - create a new pricedb. Normally you won't need
|
||||
this; you will get the pricedb via gnc_book_get_pricedb. */
|
||||
GNCPriceDB * gnc_pricedb_create(GNCBook *book);
|
||||
|
||||
/* gnc_pricedb_destroy - destroy the given pricedb and unref all of
|
||||
/** 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. */
|
||||
void gnc_pricedb_destroy(GNCPriceDB *db);
|
||||
|
||||
/* gnc_pricedb_add_price - add a price to the pricedb, you may drop
|
||||
/** 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. */
|
||||
gboolean gnc_pricedb_add_price(GNCPriceDB *db, GNCPrice *p);
|
||||
|
||||
/* gnc_pricedb_remove_price - removes the given price, p, from the
|
||||
/** gnc_pricedb_remove_price - removes the given price, p, from the
|
||||
pricedb. Returns TRUE if successful, FALSE otherwise. */
|
||||
gboolean gnc_pricedb_remove_price(GNCPriceDB *db, GNCPrice *p);
|
||||
|
||||
/* gnc_pricedb_lookup_latest - find the most recent price for the
|
||||
/** gnc_pricedb_lookup_latest - find the most recent price for the
|
||||
given commodity in the given currency. Returns NULL on
|
||||
failure. */
|
||||
GNCPrice * gnc_pricedb_lookup_latest(GNCPriceDB *db,
|
||||
gnc_commodity *commodity,
|
||||
gnc_commodity *currency);
|
||||
|
||||
/* gnc_pricedb_get_prices - return all the prices for a given
|
||||
/** 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_get_prices(GNCPriceDB *db,
|
||||
gnc_commodity *commodity,
|
||||
gnc_commodity *currency);
|
||||
|
||||
/* gnc_pricedb_lookup_at_time - return all prices that match the given
|
||||
/** 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(GNCPriceDB *db,
|
||||
@ -264,7 +264,7 @@ GList * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
|
||||
gnc_commodity *currency,
|
||||
Timespec t);
|
||||
|
||||
/* gnc_pricedb_lookup_day - return all prices that match the given
|
||||
/** 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(GNCPriceDB *db,
|
||||
@ -272,7 +272,7 @@ GList * gnc_pricedb_lookup_day(GNCPriceDB *db,
|
||||
gnc_commodity *currency,
|
||||
Timespec t);
|
||||
|
||||
/* gnc_pricedb_lookup_nearest_in_time - return the price for the given
|
||||
/** gnc_pricedb_lookup_nearest_in_time - return the price for the given
|
||||
commodity in the given currency nearest to the given time t. */
|
||||
GNCPrice *
|
||||
gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
|
||||
@ -280,7 +280,7 @@ gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
|
||||
gnc_commodity *currency,
|
||||
Timespec t);
|
||||
|
||||
/* gnc_pricedb_foreach_price - call f once for each price in db, until
|
||||
/** 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
|
||||
@ -291,17 +291,17 @@ gboolean gnc_pricedb_foreach_price(GNCPriceDB *db,
|
||||
gpointer user_data,
|
||||
gboolean stable_order);
|
||||
|
||||
/* gnc_pricedb_dirty - return FALSE if the database has not been
|
||||
/** gnc_pricedb_dirty - return FALSE if the database has not been
|
||||
modified. */
|
||||
gboolean gnc_pricedb_dirty(GNCPriceDB *db);
|
||||
|
||||
/* gnc_pricedb_get_num_prices - return the number of prices
|
||||
/** gnc_pricedb_get_num_prices - return the number of prices
|
||||
in the database. */
|
||||
guint gnc_pricedb_get_num_prices(GNCPriceDB *db);
|
||||
|
||||
gboolean gnc_pricedb_equal (GNCPriceDB *db1, GNCPriceDB *db2);
|
||||
|
||||
/* semi-lame debugging code */
|
||||
/** semi-lame debugging code */
|
||||
void gnc_price_print(GNCPrice *db, FILE *f, int indent);
|
||||
void gnc_pricedb_print_contents(GNCPriceDB *db, FILE *f);
|
||||
|
||||
|
@ -20,9 +20,7 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/*
|
||||
* FILE:
|
||||
* gnc-session.h
|
||||
/** @file gnc-session.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* Encapsulates a connection to a GnuCash backend. That is, it
|
||||
@ -97,12 +95,12 @@ void gnc_session_destroy (GNCSession *session);
|
||||
GNCSession * gnc_get_current_session (void);
|
||||
void gnc_set_current_session (GNCSession *session);
|
||||
|
||||
/* The gnc_session_swap_data () method swaps the book of
|
||||
/** The gnc_session_swap_data () method swaps the book of
|
||||
* the two given sessions. It is useful
|
||||
* for 'Save As' type functionality. */
|
||||
void gnc_session_swap_data (GNCSession *session_1, GNCSession *session_2);
|
||||
|
||||
/* The gnc_session_begin () method begins a new session.
|
||||
/** The gnc_session_begin () method begins a new session.
|
||||
* It takes as an argument the book id. The book id must be a string
|
||||
* in the form of a URI/URL.
|
||||
* In the current implementation, the following URL's are supported
|
||||
@ -142,7 +140,7 @@ void gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
gboolean ignore_lock, gboolean create_if_nonexistent);
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* The gnc_session_load() method causes the GNCBook to be made ready to
|
||||
* to use with this URL/datastore. When the URL points at a file,
|
||||
* then this routine would load the data from the file. With remote
|
||||
@ -157,7 +155,7 @@ gboolean gnc_session_export (GNCSession *tmp_session,
|
||||
GNCSession *real_session,
|
||||
GNCPercentageFunc percentage_func);
|
||||
|
||||
/* The gnc_session_get_error() routine can be used to obtain the reason
|
||||
/** The gnc_session_get_error() routine can be used to obtain the reason
|
||||
* for any failure. Calling this routine returns the current error.
|
||||
*
|
||||
* The gnc_session_pop_error() routine can be used to obtain the reason
|
||||
@ -177,7 +175,7 @@ GNCBackendError gnc_session_pop_error (GNCSession *session);
|
||||
GNCBook * gnc_session_get_book (GNCSession *session);
|
||||
void gnc_session_set_book (GNCSession *session, GNCBook *book);
|
||||
|
||||
/* The gnc_session_get_file_path() routine returns the fully-qualified file
|
||||
/** The gnc_session_get_file_path() routine returns the fully-qualified file
|
||||
* path for the session. That is, if a relative or partial filename
|
||||
* was for the session, then it had to have been fully resolved to
|
||||
* open the session. This routine returns the result of this resolution.
|
||||
@ -193,16 +191,16 @@ void gnc_session_set_book (GNCSession *session, GNCBook *book);
|
||||
const char * gnc_session_get_file_path (GNCSession *session);
|
||||
const char * gnc_session_get_url (GNCSession *session);
|
||||
|
||||
/*
|
||||
/**
|
||||
* The gnc_session_not_saved() subroutine will return TRUE
|
||||
* if any data in the session hasn't been saved to long-term storage.
|
||||
*/
|
||||
gboolean gnc_session_not_saved(GNCSession *session);
|
||||
|
||||
/* FIXME: This isn't as thorough as we might want it to be... */
|
||||
/** FIXME: This isn't as thorough as we might want it to be... */
|
||||
gboolean gnc_session_save_may_clobber_data (GNCSession *session);
|
||||
|
||||
/* The gnc_session_save() method will commit all changes that have been
|
||||
/** The gnc_session_save() method will commit all changes that have been
|
||||
* made to the session. For the file backend, this is nothing
|
||||
* more than a write to the file of the current AccountGroup & etc.
|
||||
* For the SQL backend, this is typically a no-op (since all data
|
||||
@ -219,7 +217,7 @@ void gnc_session_save (GNCSession *session,
|
||||
GNCPercentageFunc percentage_func);
|
||||
void gnc_session_end (GNCSession *session);
|
||||
|
||||
/* The gnc_session_events_pending() method will return TRUE if the backend
|
||||
/** The gnc_session_events_pending() method will return TRUE if the backend
|
||||
* has pending events which must be processed to bring the engine
|
||||
* up to date with the backend.
|
||||
*
|
||||
@ -230,7 +228,7 @@ void gnc_session_end (GNCSession *session);
|
||||
gboolean gnc_session_events_pending (GNCSession *session);
|
||||
gboolean gnc_session_process_events (GNCSession *session);
|
||||
|
||||
/* The xaccResolveFilePath() routine is a utility that will accept
|
||||
/** The xaccResolveFilePath() routine is a utility that will accept
|
||||
* a fragmentary filename as input, and resolve it into a fully
|
||||
* qualified path in the file system, i.e. a path that begins with
|
||||
* a leading slash. First, the current working directory is
|
||||
@ -243,7 +241,7 @@ gboolean gnc_session_process_events (GNCSession *session);
|
||||
char * xaccResolveFilePath (const char * filefrag);
|
||||
char * xaccResolveURL (const char * pathfrag);
|
||||
|
||||
/* Run the RPC Server */
|
||||
/** Run the RPC Server */
|
||||
void gnc_run_rpc_server (void);
|
||||
|
||||
#endif /* GNC_SESSION_H */
|
||||
|
@ -21,6 +21,8 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
/** @file kvp_frame.h @brief A key-value frame system for gnucash.*/
|
||||
|
||||
#ifndef KVP_FRAME_H
|
||||
#define KVP_FRAME_H
|
||||
|
||||
@ -30,7 +32,7 @@
|
||||
#include "guid.h"
|
||||
#include "date.h"
|
||||
|
||||
/* a kvp_frame is a set of associations between character strings
|
||||
/** a kvp_frame is a set of associations between character strings
|
||||
* (keys) and kvp_value structures. A kvp_value is a union with
|
||||
* possible types enumerated in the kvp_value_t enum.
|
||||
*
|
||||
@ -41,7 +43,12 @@
|
||||
* kvp_frame_delete and kvp_value_delete are deep (recursive) deletes.
|
||||
* kvp_frame_copy and kvp_value_copy are deep value copies.
|
||||
*/
|
||||
typedef struct _kvp_frame kvp_frame;
|
||||
|
||||
/** */
|
||||
typedef struct _kvp_value kvp_value;
|
||||
|
||||
/** */
|
||||
typedef enum {
|
||||
KVP_TYPE_GINT64,
|
||||
KVP_TYPE_DOUBLE,
|
||||
@ -54,11 +61,9 @@ typedef enum {
|
||||
KVP_TYPE_FRAME
|
||||
} kvp_value_t;
|
||||
|
||||
typedef struct _kvp_frame kvp_frame;
|
||||
typedef struct _kvp_value kvp_value;
|
||||
|
||||
|
||||
/* kvp_frame functions */
|
||||
/** kvp_frame functions */
|
||||
kvp_frame * kvp_frame_new(void);
|
||||
void kvp_frame_delete(kvp_frame * frame);
|
||||
kvp_frame * kvp_frame_copy(const kvp_frame * frame);
|
||||
@ -70,7 +75,7 @@ gchar* kvp_value_glist_to_string(const GList *list);
|
||||
|
||||
GHashTable* kvp_frame_get_hash(const kvp_frame *frame);
|
||||
|
||||
/* The kvp_frame_set_slot() routine copies the value into the frame,
|
||||
/** The kvp_frame_set_slot() routine copies the value into the frame,
|
||||
* associating it with 'key'.
|
||||
* The kvp_frame_set_slot_nc() routine puts the value (without copying
|
||||
* it) into the frame, associating it with 'key'. This routine is
|
||||
@ -86,7 +91,7 @@ void kvp_frame_set_slot_nc(kvp_frame * frame,
|
||||
kvp_value * kvp_frame_get_slot(kvp_frame * frame,
|
||||
const char * key);
|
||||
|
||||
/* The kvp_frame_set_slot_path() routines walk the hierarchy,
|
||||
/** The kvp_frame_set_slot_path() routines walk the hierarchy,
|
||||
* using the key values to pick each branch. When the terminal node
|
||||
* is reached, the value is copied into it.
|
||||
*/
|
||||
@ -98,7 +103,7 @@ void kvp_frame_set_slot_path_gslist (kvp_frame *frame,
|
||||
const kvp_value *value,
|
||||
GSList *key_path);
|
||||
|
||||
/* The following routines return the last frame of the path.
|
||||
/** The following routines return the last frame of the path.
|
||||
* If the frame path doesn't exist, it is created.
|
||||
*
|
||||
* The kvp_frame_get_frame_slash() routine takes a single string
|
||||
@ -118,7 +123,7 @@ kvp_frame * kvp_frame_get_frame_gslist (kvp_frame *frame,
|
||||
kvp_frame * kvp_frame_get_frame_slash (kvp_frame *frame,
|
||||
const char *path);
|
||||
|
||||
/* The following routines return the value at the end of the
|
||||
/** The following routines return the value at the end of the
|
||||
* path, or NULL if any portion of the path doesn't exist.
|
||||
*/
|
||||
kvp_value * kvp_frame_get_slot_path (kvp_frame *frame,
|
||||
@ -137,20 +142,20 @@ kvp_value * kvp_value_copy(const kvp_value * value);
|
||||
**/
|
||||
gint kvp_value_compare(const kvp_value *va, const kvp_value *vb);
|
||||
|
||||
/* list convenience funcs. */
|
||||
/** list convenience funcs. */
|
||||
gint kvp_glist_compare(const GList * list1, const GList * list2);
|
||||
|
||||
/* kvp_glist_copy() performs a deep copy: same as mapping
|
||||
/** kvp_glist_copy() performs a deep copy: same as mapping
|
||||
* kvp_value_copy() over the elements and then copying the spine.
|
||||
*/
|
||||
GList * kvp_glist_copy(const GList * list);
|
||||
|
||||
/* kvp_glist_delete() performs a deep delete: same as mapping
|
||||
/** kvp_glist_delete() performs a deep delete: same as mapping
|
||||
* kvp_value_delete() over the elements and then deleting the GList.
|
||||
*/
|
||||
void kvp_glist_delete(GList * list);
|
||||
|
||||
/* The following routines are constructors for kvp_value.
|
||||
/** The following routines are constructors for kvp_value.
|
||||
* Those with pointer arguments copy in the value.
|
||||
* The *_nc() versions do *not* copy in thier values,
|
||||
* but use them directly.
|
||||
@ -165,13 +170,13 @@ kvp_value * kvp_value_new_binary(const void * data, guint64 datasize);
|
||||
kvp_value * kvp_value_new_glist(const GList * value);
|
||||
kvp_value * kvp_value_new_frame(const kvp_frame * value);
|
||||
|
||||
/* value constructors (non-copying - kvp_value takes pointer ownership)
|
||||
/** value constructors (non-copying - kvp_value takes pointer ownership)
|
||||
values *must* have been allocated via glib allocators! (gnew, etc.) */
|
||||
kvp_value * kvp_value_new_binary_nc(void * data, guint64 datasize);
|
||||
kvp_value * kvp_value_new_glist_nc(GList *lst);
|
||||
kvp_value * kvp_value_new_frame_nc(kvp_frame * value);
|
||||
|
||||
/* Value accessors. Those for GUID, binary, GList, kvp_frame and
|
||||
/** Value accessors. Those for GUID, binary, GList, kvp_frame and
|
||||
string are non-copying -- the caller can modify the value directly.
|
||||
|
||||
Note that the above non-copying list did not include the
|
||||
@ -193,14 +198,14 @@ Timespec kvp_value_get_timespec(const kvp_value * value);
|
||||
|
||||
gchar* kvp_value_to_string(const kvp_value *val);
|
||||
|
||||
/* manipulators */
|
||||
/** manipulators */
|
||||
|
||||
gboolean kvp_value_binary_append(kvp_value *v, void *data, guint64 size);
|
||||
/* copying - but more efficient than creating a new kvp_value manually. */
|
||||
|
||||
/* iterators */
|
||||
|
||||
/* Traverse all of the slots in the given kvp_frame. This function
|
||||
/** Traverse all of the slots in the given kvp_frame. This function
|
||||
does not descend recursively to traverse any kvp_frames stored as
|
||||
slot values. You must handle that in proc, with a suitable
|
||||
recursive call if desired. */
|
||||
|
@ -19,6 +19,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
\********************************************************************/
|
||||
|
||||
/** @file messages.h @brief National-language messages for GnuCash */
|
||||
|
||||
#ifndef XACC_MESSAGES_H
|
||||
#define XACC_MESSAGES_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user