1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

core: split WeeChat home in 4 directories, use XDG directories by default (issue #1285)

The 4 directories (which can be the same):

- config: configuration files, certificates
- data: log/upgrade files, local plugins, scripts, xfer files
- cache: script repository, scripts downloaded (temporary location)
- runtime: FIFO pipe, relay UNIX sockets
This commit is contained in:
Sébastien Helleu
2021-05-02 11:56:25 +02:00
parent 4c5fcb743b
commit 0f9640a5f3
38 changed files with 1129 additions and 363 deletions
+25 -2
View File
@@ -431,13 +431,36 @@ plugin_api_modifier_eval_path_home_cb (const void *pointer, void *data,
const char *modifier_data,
const char *string)
{
struct t_hashtable *options;
const char *ptr_directory;
char *result;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) modifier;
(void) modifier_data;
return string_eval_path_home (string, NULL, NULL, NULL);
options = NULL;
ptr_directory = (modifier_data
&& (strncmp (modifier_data, "directory=", 10) == 0)) ?
modifier_data + 10 : NULL;
if (ptr_directory)
{
options = hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
if (options)
hashtable_set (options, "directory", ptr_directory);
}
result = string_eval_path_home (string, NULL, NULL, options);
if (options)
hashtable_free (options);
return result;
}
/*