mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
type-safety tweaks
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6027 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
7a4c1571ec
commit
7f8b1e824e
@ -1126,8 +1126,9 @@ xaccQueryCompileTerms (Query *q)
|
||||
* Run the search.
|
||||
********************************************************************/
|
||||
|
||||
GList *
|
||||
xaccQueryGetSplits(Query * q) {
|
||||
SplitList *
|
||||
xaccQueryGetSplits(Query * q)
|
||||
{
|
||||
GList * matching_splits=NULL;
|
||||
GList * or_ptr, * and_ptr, * mptr;
|
||||
GList * all_accts, * node;
|
||||
@ -1267,7 +1268,7 @@ xaccQueryGetSplits(Query * q) {
|
||||
* Get splits but no more than one from a given transaction.
|
||||
********************************************************************/
|
||||
|
||||
GList *
|
||||
SplitList *
|
||||
xaccQueryGetSplitsUniqueTrans(Query *q)
|
||||
{
|
||||
GList * splits = xaccQueryGetSplits(q);
|
||||
@ -1299,7 +1300,8 @@ xaccQueryGetSplitsUniqueTrans(Query *q)
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
query_match_all_filter_func(gpointer key, gpointer value, gpointer user_data) {
|
||||
query_match_all_filter_func(gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
Transaction * t = key;
|
||||
int num_matches = GPOINTER_TO_INT(value);
|
||||
GList ** matches = user_data;
|
||||
@ -1310,14 +1312,16 @@ query_match_all_filter_func(gpointer key, gpointer value, gpointer user_data) {
|
||||
}
|
||||
|
||||
static void
|
||||
query_match_any_filter_func(gpointer key, gpointer value, gpointer user_data) {
|
||||
query_match_any_filter_func(gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
Transaction * t = key;
|
||||
GList ** matches = user_data;
|
||||
*matches = g_list_prepend(*matches, t);
|
||||
}
|
||||
|
||||
GList *
|
||||
xaccQueryGetTransactions (Query * q, query_run_t runtype) {
|
||||
TransList *
|
||||
xaccQueryGetTransactions (Query * q, query_run_t runtype)
|
||||
{
|
||||
GList * splits = xaccQueryGetSplits(q);
|
||||
GList * current = NULL;
|
||||
GList * retval = NULL;
|
||||
|
@ -282,9 +282,9 @@ int xaccQueryNumTerms(Query * q);
|
||||
|
||||
|
||||
/* after the query has been set up, call this to run the query */
|
||||
GList * xaccQueryGetSplits(Query * q);
|
||||
GList * xaccQueryGetSplitsUniqueTrans(Query *q);
|
||||
GList * xaccQueryGetTransactions(Query * q, query_run_t type);
|
||||
SplitList * xaccQueryGetSplits(Query * q);
|
||||
SplitList * xaccQueryGetSplitsUniqueTrans(Query *q);
|
||||
TransList * xaccQueryGetTransactions(Query * q, query_run_t type);
|
||||
|
||||
/* compare two queries for equality. this is a simplistic
|
||||
* implementation -- logical equivalences between different
|
||||
|
@ -40,6 +40,7 @@ typedef struct gnc_session_struct GNCSession;
|
||||
|
||||
typedef GList AccountList;
|
||||
typedef GList SplitList;
|
||||
typedef GList TransList;
|
||||
|
||||
|
||||
typedef void (* gnc_engine_init_hook_t)(int, char **);
|
||||
|
Loading…
Reference in New Issue
Block a user