From ceda19dfdbdfa5594e3f6985f88780f1d4272849 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sun, 27 Dec 1998 20:57:13 +0000 Subject: [PATCH] make the direct fileio routines privatge git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1490 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/FileIO.h | 18 +++++------------- src/engine/FileIOP.h | 37 +++++++++++++++++++++++++++++++++++++ src/engine/Session.c | 1 + 3 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 src/engine/FileIOP.h diff --git a/src/engine/FileIO.h b/src/engine/FileIO.h index a4b8e11f98..1ad81147eb 100644 --- a/src/engine/FileIO.h +++ b/src/engine/FileIO.h @@ -1,7 +1,8 @@ /********************************************************************\ - * FileIO.h -- read from and writing to a datafile for xacc * + * FileIO.h -- read from and writing to a datafile for gnucash * * (X-Accountant) * * Copyright (C) 1997 Robin D. Clark * + * Copyright (C) 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 * @@ -23,10 +24,9 @@ * Huntington Beach, CA 92648-4632 * \********************************************************************/ -#ifndef __FILEIO_H__ -#define __FILEIO_H__ +#ifndef __XACC_FILEIO_H__ +#define __XACC_FILEIO_H__ -#include "config.h" #include "Group.h" #define ERR_FILEIO_NO_ERROR 0 @@ -37,17 +37,9 @@ #define ERR_FILEIO_FILE_TOO_OLD 5 /** PROTOTYPES ******************************************************/ -/* - * NOTE: - * The Read and WriteAccountGroup routines should not be used directly. - * They are not "safe" against file-locking errors. Use the Session - * object instead. - */ -AccountGroup *xaccReadAccountGroup (char *datafile); -int xaccWriteAccountGroup (char *datafile, AccountGroup *grp); int xaccGetFileIOError (void); AccountGroup *xaccReadQIFAccountGroup (char *datafile); int xaccGetQIFIOError (void); -#endif /* __FILEIO_H__ */ +#endif /* __XACC_FILEIO_H__ */ diff --git a/src/engine/FileIOP.h b/src/engine/FileIOP.h new file mode 100644 index 0000000000..6f868e73ef --- /dev/null +++ b/src/engine/FileIOP.h @@ -0,0 +1,37 @@ +/********************************************************************\ + * FileIOP.h -- private header to read from and writing to a * + * datafile for gnucash (X-Accountant) * + * Copyright (C) 1997 Robin D. Clark * + * Copyright (C) 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. * +\********************************************************************/ + +#ifndef __XACC_FILEIO_P_H__ +#define __XACC_FILEIO_P_H__ + +#include "Group.h" + +/** PROTOTYPES ******************************************************/ +/* + * NOTE: + * The Read and WriteAccountGroup routines should not be used directly. + * They are not "safe" against file-locking errors. Use the Session + * object instead. + */ +AccountGroup *xaccReadAccountGroup (char *datafile); +int xaccWriteAccountGroup (char *datafile, AccountGroup *grp); + +#endif /* __XACC_FILEIO_P_H__ */ diff --git a/src/engine/Session.c b/src/engine/Session.c index ccb0bdfd35..33dd2f24c4 100644 --- a/src/engine/Session.c +++ b/src/engine/Session.c @@ -37,6 +37,7 @@ #include #include "FileIO.h" +#include "FileIOP.h" #include "Group.h" #include "Session.h" #include "util.h"