mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
api: add function string_eval_path_home()
This commit is contained in:
@@ -574,6 +574,47 @@ API_FUNC(string_eval_expression)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(string_eval_path_home)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *path, *result;
|
||||
struct t_hashtable *pointers, *extra_vars, *options;
|
||||
int i;
|
||||
|
||||
API_INIT_FUNC(1, "string_eval_path_home", API_RETURN_EMPTY);
|
||||
if (objc < 5)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
path = Tcl_GetStringFromObj (objv[1], &i);
|
||||
pointers = weechat_tcl_dict_to_hashtable (
|
||||
interp, objv[2],
|
||||
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_POINTER);
|
||||
extra_vars = weechat_tcl_dict_to_hashtable (
|
||||
interp, objv[3],
|
||||
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING);
|
||||
options = weechat_tcl_dict_to_hashtable (
|
||||
interp, objv[4],
|
||||
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING);
|
||||
|
||||
result = weechat_string_eval_path_home (path, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(mkdir_home)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
@@ -5356,6 +5397,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
|
||||
API_DEF_FUNC(string_is_command_char);
|
||||
API_DEF_FUNC(string_input_for_buffer);
|
||||
API_DEF_FUNC(string_eval_expression);
|
||||
API_DEF_FUNC(string_eval_path_home);
|
||||
API_DEF_FUNC(mkdir_home);
|
||||
API_DEF_FUNC(mkdir);
|
||||
API_DEF_FUNC(mkdir_parents);
|
||||
|
||||
Reference in New Issue
Block a user