aboutsummaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2014-04-03 18:06:34 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-08 21:56:05 -0300
commit4348d1e6f74a87af55c6c01e7a0cb292e9dec114 (patch)
tree86f6e5da3cd9961f675b9aec046b2967e4db756e /src/path.h
parent49f5e5d0b132747048f45e10cf5cafef7e07ab7d (diff)
downloadrneovim-4348d1e6f74a87af55c6c01e7a0cb292e9dec114.tar.gz
rneovim-4348d1e6f74a87af55c6c01e7a0cb292e9dec114.tar.bz2
rneovim-4348d1e6f74a87af55c6c01e7a0cb292e9dec114.zip
Move functions from os/fs.c into path.c
Move unit tests from os/fs.moon to path.moon
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/path.h b/src/path.h
index d90ccfcb62..07451ec4c9 100644
--- a/src/path.h
+++ b/src/path.h
@@ -87,4 +87,39 @@ int expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u *
**file,
int flags);
int match_suffix(char_u *fname);
+
+/// Get the absolute name of the given relative directory.
+///
+/// @param directory Directory name, relative to current directory.
+/// @return `FAIL` for failure, `OK` for success.
+int os_full_dir_name(char *directory, char *buffer, int len);
+
+// Append to_append to path with a slash in between.
+int append_path(char *path, const char *to_append, int max_len);
+
+/// Expand a given file to its absolute path.
+///
+/// @param fname The filename which should be expanded.
+/// @param buf Buffer to store the absolute path of `fname`.
+/// @param len Length of `buf`.
+/// @param force Also expand when `fname` is already absolute.
+/// @return `FAIL` for failure, `OK` for success.
+int os_get_absolute_path(char_u *fname, char_u *buf, int len, int force);
+
+/// Check if the given file is absolute.
+///
+/// This just checks if the file name starts with '/' or '~'.
+/// @return `TRUE` if "fname" is absolute.
+int os_is_absolute_path(const char_u *fname);
+
+/// Check if the given path represents an executable file.
+///
+/// @return `TRUE` if `name` is executable and
+/// - can be found in $PATH,
+/// - is relative to current dir or
+/// - is absolute.
+///
+/// @return `FALSE` otherwise.
+int os_can_exe(const char_u *name);
+
#endif