Simplify all code that used rootdir and flags passed via xbps-bin.

Add util funcs to get/set global values for them:
 * xbps_[gs]et_rootdir()
 * xbps_[gs]et_flags()

--HG--
extra : convert_revision : 2584b098e68a684e7b0eeac57c2b1df4aba6589d
This commit is contained in:
Juan RP 2009-03-17 00:32:26 +01:00
parent bc1e2c8dcd
commit a67374bd66
12 changed files with 114 additions and 108 deletions

View file

@ -35,6 +35,7 @@
#include <xbps_api.h>
static const char *rootdir;
static int flags;
int
xbps_check_file_hash(const char *path, const char *sha256)
@ -238,6 +239,24 @@ xbps_set_rootdir(const char *dir)
rootdir = dir;
}
const char *
xbps_get_rootdir(void)
{
return rootdir;
}
void
xbps_set_flags(int lflags)
{
flags = lflags;
}
int
xbps_get_flags(void)
{
return flags;
}
char *
xbps_append_full_path(bool use_rootdir, const char *basedir, const char *plist)
{