some added missing function

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1500 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-12-28 10:39:46 +00:00
parent 7409fccbd9
commit 7f05ce838a
2 changed files with 18 additions and 4 deletions

View File

@ -131,7 +131,7 @@ xaccSessionGetFilePath (Session *sess)
/* ============================================================== */ /* ============================================================== */
AccountGroup * AccountGroup *
xaccSessionBegin (Session *sess, char * sid) xaccSessionBegin (Session *sess, const char * sid)
{ {
AccountGroup *retval; AccountGroup *retval;
@ -165,7 +165,7 @@ xaccSessionBegin (Session *sess, char * sid)
} }
AccountGroup * AccountGroup *
xaccSessionBeginFile (Session *sess, char * filefrag) xaccSessionBeginFile (Session *sess, const char * filefrag)
{ {
struct stat statbuf; struct stat statbuf;
char pathbuf[PATH_MAX]; char pathbuf[PATH_MAX];
@ -331,6 +331,17 @@ xaccSessionDestroy (Session *sess)
free (sess); free (sess);
} }
/* ============================================================== */
/* hack alert -- implement this function.
* if $HOME/.gnucash/data directory doesn't exist, then create it
* this helps us slide by install errors made by naive users.
*/
static void
MakeHomeDir (void)
{}
/* ============================================================== */ /* ============================================================== */
/* hack alert -- we should be yanking this out of /* hack alert -- we should be yanking this out of
@ -408,6 +419,9 @@ xaccResolveFilePath (const char * filefrag)
} }
} }
/* make sure that the gnucash home dir exists. */
MakeHomeDir();
/* OK, we didn't find the file */ /* OK, we didn't find the file */
/* Lets try creating a new file in $HOME/.gnucash/data */ /* Lets try creating a new file in $HOME/.gnucash/data */
path = getenv ("HOME"); path = getenv ("HOME");

View File

@ -149,8 +149,8 @@ void xaccSessionDestroy (Session *);
* *
*/ */
AccountGroup * xaccSessionBegin (Session *, char * sessionid); AccountGroup * xaccSessionBegin (Session *, const char * sessionid);
AccountGroup * xaccSessionBeginFile (Session *, char * filename); AccountGroup * xaccSessionBeginFile (Session *, const char * filename);
int xaccSessionGetError (Session *); int xaccSessionGetError (Session *);
AccountGroup * xaccSessionGetGroup (Session *); AccountGroup * xaccSessionGetGroup (Session *);
void xaccSessionSetGroup (Session *, AccountGroup *topgroup); void xaccSessionSetGroup (Session *, AccountGroup *topgroup);