Some general Scrb cleanups

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1454 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-12-20 00:38:15 +00:00
parent 4800694855
commit 34580c58e3
2 changed files with 50 additions and 35 deletions

View File

@ -12,41 +12,6 @@
* Copyright (c) 1998 Linas Vepstas * 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 <nana.h> #include <nana.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -55,6 +20,7 @@ void xaccGroupScrubImbalance (AccountGroup *grp);
#include "Account.h" #include "Account.h"
#include "Group.h" #include "Group.h"
#include "GroupP.h" #include "GroupP.h"
#include "Scrub.h"
#include "Transaction.h" #include "Transaction.h"
#include "util.h" #include "util.h"

49
src/engine/Scrub.h Normal file
View File

@ -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__ */