aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/helpers.h
diff options
context:
space:
mode:
authorNicolas Hillegeer <nicolas@hillegeer.com>2014-05-17 22:01:57 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-18 06:45:39 -0300
commit9eb68075d80a755bf546b20f99a36a542de1ecfd (patch)
treee644d09ee94d72c528e9ae8b95b74395497d5467 /src/nvim/api/helpers.h
parentb591447f772ed5411e207854b2125bff08902bf7 (diff)
downloadrneovim-9eb68075d80a755bf546b20f99a36a542de1ecfd.tar.gz
rneovim-9eb68075d80a755bf546b20f99a36a542de1ecfd.tar.bz2
rneovim-9eb68075d80a755bf546b20f99a36a542de1ecfd.zip
api/helpers: implement C string to String helper
Use it in buffers.c
Diffstat (limited to 'src/nvim/api/helpers.h')
-rw-r--r--src/nvim/api/helpers.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/api/helpers.h b/src/nvim/api/helpers.h
index c9c7e9cdc8..f93487d62f 100644
--- a/src/nvim/api/helpers.h
+++ b/src/nvim/api/helpers.h
@@ -86,5 +86,12 @@ win_T * find_window(Window window, Error *err);
/// @return the tabpage pointer
tabpage_T * find_tab(Tabpage tabpage, Error *err);
+/// Copies a C string into a String (binary safe string, characters + length)
+///
+/// @param str the C string to copy
+/// @return the resulting String, if the input string was NULL, then an
+/// empty String is returned
+String cstr_to_string(const char *str);
+
#endif // NVIM_API_HELPERS_H