From 9eb68075d80a755bf546b20f99a36a542de1ecfd Mon Sep 17 00:00:00 2001 From: Nicolas Hillegeer Date: Sat, 17 May 2014 22:01:57 +0200 Subject: api/helpers: implement C string to String helper Use it in buffers.c --- src/nvim/api/helpers.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/api/helpers.h') 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 -- cgit