From f6d08dddf88f982b7afc3ed0312371a76a0e1fe2 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Mon, 28 Dec 1998 04:32:33 +0000 Subject: [PATCH] add file path retreival git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1492 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Session.c | 9 +++++++++ src/engine/Session.h | 16 +++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/engine/Session.c b/src/engine/Session.c index 9fb88da15f..33a2e7e7f5 100644 --- a/src/engine/Session.c +++ b/src/engine/Session.c @@ -121,6 +121,15 @@ xaccSessionSetGroup (Session *sess, AccountGroup *grp) /* ============================================================== */ +char * +xaccSessionGetFilePath (Session *sess) +{ + if (!sess) return NULL; + return (sess->fullpath); +} + +/* ============================================================== */ + /* hack alert -- we should be yanking this out of * some config file */ diff --git a/src/engine/Session.h b/src/engine/Session.h index e94fd98294..c336a20754 100644 --- a/src/engine/Session.h +++ b/src/engine/Session.h @@ -70,6 +70,11 @@ void xaccSessionDestroy (Session *); * The xaccSessionBeginFile() routine is identical to the xaccSessionBegin() * routine, except that the argument is a filename (i.e. the five * letters "file:" should not be prepended). + * + * The xaccSessionGetFilePath() routine returns the fully-qualified file + * path for the session. That is, if a relative or partial filename + * was for the session, then it had to have been fully resolved to + * open the session. This routine returns the result of this resolution. * * The xaccSessionGetError() routine can be used to obtain the reason for * any failure. Standard errno values are used. Calling this routine resets @@ -135,11 +140,12 @@ void xaccSessionDestroy (Session *); * */ -AccountGroup * xaccSessionBegin (Session *, char * sessionid); -AccountGroup * xaccSessionBeginFile (Session *, char * filename); -int xaccSessionGetError (Session *); -AccountGroup * xaccSessionGetGroup (Session *); -void xaccSessionSetGroup (Session *, AccountGroup *topgroup); +AccountGroup * xaccSessionBegin (Session *, char * sessionid); +AccountGroup * xaccSessionBeginFile (Session *, char * filename); +int xaccSessionGetError (Session *); +AccountGroup * xaccSessionGetGroup (Session *); +void xaccSessionSetGroup (Session *, AccountGroup *topgroup); +char * xaccSessionGetFilePath (Session *); void xaccSessionSave (Session *); void xaccSessionEnd (Session *);