diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-05-02 18:21:58 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-05-02 18:21:58 +0200 |
commit | 4616ca981ed37dde25105e7ebd5d9d1b7717a022 (patch) | |
tree | 3b61407ece3c31c662268181e5e3c03db7d79f06 /doc/it | |
parent | 1836b40a4a7866200a98e5aa7cb18e41ed7ae0b5 (diff) | |
download | weechat-4616ca981ed37dde25105e7ebd5d9d1b7717a022.zip |
Add function "string_expand_home" in plugin API, fix bug with replacement of home in paths
Diffstat (limited to 'doc/it')
-rw-r--r-- | doc/it/weechat_plugin_api.it.txt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index 65fb41f4a..4258dd5c8 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -747,6 +747,38 @@ char *str = weechat_string_replace ("test", "s", "x"); /* result: "text" */ free (str); ---------------------------------------- +weechat_string_expand_home +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Replace leading `~` by string with home directory. If string does not start +with `~`, then same string is returned. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_expand_home (const char *path); +---------------------------------------- + +Arguments: + +* 'path': path + +Return value: + +* path with leading `~` replaced by home directory (must be freed by calling + "free" after use) + +C example: + +[source,C] +---------------------------------------- +char *str = weechat_string_expand_home ("~/file.txt"); +/* result: "/home/xxx/file.txt" */ +/* ... */ +free (str); +---------------------------------------- + weechat_string_remove_quotes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |