commit 5f79acfd8d24264ea0698c01f0422b4f0ee59c15
parent 549021b5ddbc7cce51d604b6cee3ae900dd5628d
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Thu, 9 Aug 2018 16:33:43 +0200
storage: Expose get_network_file_path in the header
Diffstat:
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/storage.c b/src/storage.c
@@ -169,7 +169,7 @@ error_create_dirs:
return r;
}
-static char *get_network_file_path(enum security type, const char *ssid)
+char *storage_get_network_file_path(enum security type, const char *ssid)
{
char *path;
const char *c;
@@ -260,7 +260,7 @@ struct l_settings *storage_network_open(enum security type, const char *ssid)
if (ssid == NULL)
return NULL;
- path = get_network_file_path(type, ssid);
+ path = storage_get_network_file_path(type, ssid);
settings = l_settings_new();
if (!l_settings_load_from_file(settings, path)) {
@@ -280,7 +280,7 @@ int storage_network_touch(enum security type, const char *ssid)
if (ssid == NULL)
return -EINVAL;
- path = get_network_file_path(type, ssid);
+ path = storage_get_network_file_path(type, ssid);
ret = utimensat(0, path, NULL, 0);
l_free(path);
@@ -300,7 +300,7 @@ int storage_network_get_mtime(enum security type, const char *ssid,
if (ssid == NULL)
return -EINVAL;
- path = get_network_file_path(type, ssid);
+ path = storage_get_network_file_path(type, ssid);
ret = stat(path, &sb);
l_free(path);
@@ -323,7 +323,7 @@ void storage_network_sync(enum security type, const char *ssid,
size_t length = 0;
char *path;
- path = get_network_file_path(type, ssid);
+ path = storage_get_network_file_path(type, ssid);
data = l_settings_to_data(settings, &length);
write_file(data, length, "%s", path);
l_free(data);
@@ -335,7 +335,7 @@ int storage_network_remove(enum security type, const char *ssid)
char *path;
int ret;
- path = get_network_file_path(type, ssid);
+ path = storage_get_network_file_path(type, ssid);
ret = unlink(path);
l_free(path);
diff --git a/src/storage.h b/src/storage.h
@@ -33,6 +33,7 @@ ssize_t write_file(const void *buffer, size_t len, const char *path_fmt, ...)
const char *storage_network_ssid_from_path(const char *path,
enum security *type);
+char *storage_get_network_file_path(enum security type, const char *ssid);
struct l_settings *storage_network_open(enum security type, const char *ssid);
int storage_network_touch(enum security type, const char *ssid);