From 24eaffd8fe71604b2ab9f304b92dc92ffbb3fda5 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Fri, 20 Mar 1998 08:17:58 +0000 Subject: [PATCH] finally, data hiding for the account group git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@679 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Account.c | 1 + src/engine/Account.h | 1 + src/engine/FileIO.c | 1 + src/engine/Group.c | 1 + src/engine/Group.h | 18 +------------ src/engine/GroupP.h | 58 ++++++++++++++++++++++++++++++++++++++++ src/engine/LedgerUtils.c | 1 + src/engine/QIFIO.c | 2 ++ 8 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 src/engine/GroupP.h diff --git a/src/engine/Account.c b/src/engine/Account.c index e29514f4f7..7f70e20277 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -30,6 +30,7 @@ #include "Account.h" #include "AccountP.h" #include "Group.h" +#include "GroupP.h" #include "date.h" #include "messages.h" #include "Transaction.h" diff --git a/src/engine/Account.h b/src/engine/Account.h index a0f5aa442f..52f3052e5b 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -1,6 +1,7 @@ /********************************************************************\ * Account.h -- the Account data structure * * Copyright (C) 1997 Robin D. Clark * + * Copyright (C) 1997, 1998 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * diff --git a/src/engine/FileIO.c b/src/engine/FileIO.c index 0244ff2d07..d53a6337f1 100644 --- a/src/engine/FileIO.c +++ b/src/engine/FileIO.c @@ -87,6 +87,7 @@ #include "AccountP.h" #include "FileIO.h" #include "Group.h" +#include "GroupP.h" #include "messages.h" #include "TransactionP.h" #include "util.h" diff --git a/src/engine/Group.c b/src/engine/Group.c index 1d808f66c1..ab78735940 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -28,6 +28,7 @@ #include "Account.h" #include "AccountP.h" #include "Group.h" +#include "GroupP.h" #include "TransactionP.h" #include "util.h" diff --git a/src/engine/Group.h b/src/engine/Group.h index 170302cc98..680a7755f1 100644 --- a/src/engine/Group.h +++ b/src/engine/Group.h @@ -1,7 +1,7 @@ /********************************************************************\ * Group.h -- the main data structure of the program * * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997 Linas Vepstas * + * Copyright (C) 1997, 1998 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -30,22 +30,6 @@ #include "Account.h" -/** STRUCTS *********************************************************/ -struct _account_group { - /* The flags: */ - unsigned int saved : 1; - unsigned int new : 1; - - Account *parent; /* back-pointer to parent */ - - int numAcc; /* number of accounts in array */ - Account **account; /* array of account pointers */ - - /* cached parameters */ - double balance; - -}; - /** PROTOTYPES ******************************************************/ AccountGroup *xaccMallocAccountGroup( void ); void xaccFreeAccountGroup( AccountGroup *account_group ); diff --git a/src/engine/GroupP.h b/src/engine/GroupP.h new file mode 100644 index 0000000000..8154e5f567 --- /dev/null +++ b/src/engine/GroupP.h @@ -0,0 +1,58 @@ +/* + * FILE: + * GroupP.h + * + * FUNCTION: + * This is the *private* account group structure. + * This header should *not* be included by any code outside of the + * engine. + * + */ +/********************************************************************\ + * GroupP.h -- the main data structure of the program * + * Copyright (C) 1997 Robin D. Clark * + * Copyright (C) 1997, 1998 Linas Vepstas * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * + * * + * Author: Rob Clark * + * Internet: rclark@cs.hmc.edu * + * Address: 609 8th Street * + * Huntington Beach, CA 92648-4632 * +\********************************************************************/ + +#ifndef __XACC_ACCOUNT_GROUP_P_H__ +#define __XACC_ACCOUNT_GROUP_P_H__ + +#include "config.h" +#include "Transaction.h" + +/** STRUCTS *********************************************************/ +struct _account_group { + /* The flags: */ + unsigned int saved : 1; + unsigned int new : 1; + + Account *parent; /* back-pointer to parent */ + + int numAcc; /* number of accounts in array */ + Account **account; /* array of account pointers */ + + /* cached parameters */ + double balance; + +}; + +#endif /* __XACC_ACCOUNT_GROUP_P_H__ */ diff --git a/src/engine/LedgerUtils.c b/src/engine/LedgerUtils.c index 77db0edb13..c273711930 100644 --- a/src/engine/LedgerUtils.c +++ b/src/engine/LedgerUtils.c @@ -23,6 +23,7 @@ #include "Account.h" #include "AccountP.h" #include "Group.h" +#include "GroupP.h" #include "Transaction.h" #include "util.h" diff --git a/src/engine/QIFIO.c b/src/engine/QIFIO.c index 0f42dee6cd..54baf8ec69 100644 --- a/src/engine/QIFIO.c +++ b/src/engine/QIFIO.c @@ -36,7 +36,9 @@ #include "Account.h" #include "AccountP.h" #include "Group.h" +#include "GroupP.h" #include "FileIO.h" +#include "Transaction.h" #include "TransactionP.h" #include "util.h"