lsi: Dedupe into common

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2017-10-22 00:03:51 +01:00
parent a932486826
commit 1811ff5225
2 changed files with 5 additions and 32 deletions
+2 -32
View File
@@ -26,6 +26,8 @@
#include "nica/hashmap.h"
#include "nica/inifile.h"
#include "../common/files.h"
/**
* Configuration file suffix, i.e. ~/.config/linux-steam-integration.conf
*/
@@ -42,38 +44,6 @@
*/
#define LSI_VENDOR_CONFIG_FILE VENDORDIR "/ " LSI_CONFIG_FILE
/**
* Determine the home directory
*/
static const char *lsi_get_home_dir(void)
{
char *c = NULL;
struct passwd *p = NULL;
c = getenv("HOME");
if (c) {
return c;
}
p = getpwuid(getuid());
if (!p) {
return NULL;
}
return p->pw_dir;
}
/**
* Determine the home config directory
*/
static char *lsi_get_user_config_dir(void)
{
const char *home = lsi_get_home_dir();
char *c = NULL;
if (asprintf(&c, "%s/.config", home) < 0) {
return NULL;
}
return c;
}
/**
* Build the user config file path
*/
+3
View File
@@ -9,6 +9,9 @@ if shim_behaviour != 'none' or with_frontend == true
lib_lsi = static_library(
'lsi-lsi',
sources: lsi_sources + nica_sources,
dependencies: [
link_lsi_common,
],
include_directories: nica_includes,
)
link_lsi = declare_dependency(