From 34580c58e3ec1bd2abc4a92d3905d6d9e0c08543 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sun, 20 Dec 1998 00:38:15 +0000 Subject: [PATCH] Some general Scrb cleanups git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1454 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Scrub.c | 36 +--------------------------------- src/engine/Scrub.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 35 deletions(-) create mode 100644 src/engine/Scrub.h diff --git a/src/engine/Scrub.c b/src/engine/Scrub.c index 6519957a4b..5271c794c1 100644 --- a/src/engine/Scrub.c +++ b/src/engine/Scrub.c @@ -12,41 +12,6 @@ * Copyright (c) 1998 Linas Vepstas */ -#ifndef __XACC_SCRUB_H__ -#define __XACC_SCRUB_H__ -#include "Account.h" -#include "Transaction.h" - -/* 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 - * for orphaned inodes. - * - * The xaccAccountScrubOrphans() method performs this scrub only for the - * indicated account, and not for any of its children. - * - * The xaccAccountTreeScrubOrphans() method performs this scrub for the - * indicated account and its children. - * - * The xaccGroupScrubOrphans() method performs this scrub for the - * child accounts of this group. - */ -void xaccAccountScrubOrphans (Account *acc); -void xaccAccountTreeScrubOrphans (Account *acc); -void xaccGroupScrubOrphans (AccountGroup *grp); - -/* 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. - */ -void xaccAccountScrubImbalance (Account *acc); -void xaccAccountTreeScrubImbalance (Account *acc); -void xaccGroupScrubImbalance (AccountGroup *grp); - -#endif /* __XACC_SCRUB_H__ */ - #include #include #include @@ -55,6 +20,7 @@ void xaccGroupScrubImbalance (AccountGroup *grp); #include "Account.h" #include "Group.h" #include "GroupP.h" +#include "Scrub.h" #include "Transaction.h" #include "util.h" diff --git a/src/engine/Scrub.h b/src/engine/Scrub.h new file mode 100644 index 0000000000..6f9b37b56d --- /dev/null +++ b/src/engine/Scrub.h @@ -0,0 +1,49 @@ +/* + * 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. + * + * HISTORY: + * Created by Linas Vepstas December 1998 + * Copyright (c) 1998 Linas Vepstas + */ + +#ifndef __XACC_SCRUB_H__ +#define __XACC_SCRUB_H__ + +#include "Account.h" +#include "Group.h" + +/* 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 + * for orphaned inodes. + * + * The xaccAccountScrubOrphans() method performs this scrub only for the + * indicated account, and not for any of its children. + * + * The xaccAccountTreeScrubOrphans() method performs this scrub for the + * indicated account and its children. + * + * The xaccGroupScrubOrphans() method performs this scrub for the + * child accounts of this group. + */ +void xaccAccountScrubOrphans (Account *acc); +void xaccAccountTreeScrubOrphans (Account *acc); +void xaccGroupScrubOrphans (AccountGroup *grp); + +/* 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. + */ +void xaccAccountScrubImbalance (Account *acc); +void xaccAccountTreeScrubImbalance (Account *acc); +void xaccGroupScrubImbalance (AccountGroup *grp); + +#endif /* __XACC_SCRUB_H__ */