aboutsummaryrefslogtreecommitdiff
path: root/src/os/fs.c
diff options
context:
space:
mode:
authorThomas Wienecke <wienecke.t@gmail.com>2014-03-28 20:15:17 +0100
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-31 07:36:00 -0300
commit54782ecfe0d0489b6019075879ba85093c559373 (patch)
tree7df37c722ef383ab036d1025c6407c2e3b757083 /src/os/fs.c
parent6f681faba787187b4413bb5872a21f85f87ff9c6 (diff)
downloadrneovim-54782ecfe0d0489b6019075879ba85093c559373.tar.gz
rneovim-54782ecfe0d0489b6019075879ba85093c559373.tar.bz2
rneovim-54782ecfe0d0489b6019075879ba85093c559373.zip
Add doxygen-style comments to functions from os/fs.c.
Diffstat (limited to 'src/os/fs.c')
-rw-r--r--src/os/fs.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/os/fs.c b/src/os/fs.c
index 8d3e8d1627..711262740e 100644
--- a/src/os/fs.c
+++ b/src/os/fs.c
@@ -16,8 +16,6 @@ int os_chdir(const char *path) {
return uv_chdir(path);
}
-// Get name of current directory into buffer 'buf' of length 'len' bytes.
-// Return OK for success, FAIL for failure.
int os_dirname(char_u *buf, size_t len)
{
assert(buf && len);
@@ -30,10 +28,10 @@ int os_dirname(char_u *buf, size_t len)
return OK;
}
-// Get the absolute name of the given relative directory.
-//
-// parameter directory: Directory name, relative to current directory.
-// return FAIL for failure, OK for success
+/// 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)
{
int retval = OK;
@@ -110,12 +108,6 @@ int append_path(char *path, const char *to_append, int max_len)
return OK;
}
-// Get absolute file name into "buf[len]".
-//
-// parameter force: Also expand when the given path in 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)
{
char_u *p;
@@ -142,15 +134,11 @@ int os_get_absolute_path(char_u *fname, char_u *buf, int len, int force)
return append_path((char *) buf, (char *) end_of_path, len);
}
-// Return TRUE if "fname" does not depend on the current directory.
int os_is_absolute_path(const char_u *fname)
{
return *fname == '/' || *fname == '~';
}
-// return TRUE if "name" is a directory
-// return FALSE if "name" is not a directory
-// return FALSE for error
int os_isdir(const char_u *name)
{
int32_t mode = os_getperm(name);
@@ -168,8 +156,6 @@ int os_isdir(const char_u *name)
static int is_executable(const char_u *name);
static int is_executable_in_path(const char_u *name);
-// Return TRUE if "name" is executable and can be found in $PATH, is absolute
-// or relative to current dir, FALSE if not.
int os_can_exe(const char_u *name)
{
// If it's an absolute or relative path don't need to use $PATH.
@@ -199,8 +185,9 @@ static int is_executable(const char_u *name)
return FALSE;
}
-// Return TRUE if "name" can be found in $PATH and executed, FALSE if not or an
-// error occurs.
+/// Check if a file is inside the $PATH and is executable.
+///
+/// @return `TRUE` if `name` is an executable inside $PATH.
static int is_executable_in_path(const char_u *name)
{
const char *path = getenv("PATH");
@@ -248,8 +235,6 @@ static int is_executable_in_path(const char_u *name)
return FALSE;
}
-// Get file permissions for 'name'.
-// Returns -1 when it doesn't exist.
int32_t os_getperm(const char_u *name)
{
uv_fs_t request;
@@ -265,8 +250,6 @@ int32_t os_getperm(const char_u *name)
}
}
-// Set file permission for 'name' to 'perm'.
-// Returns FAIL for failure, OK otherwise.
int os_setperm(const char_u *name, int perm)
{
uv_fs_t request;
@@ -281,7 +264,6 @@ int os_setperm(const char_u *name, int perm)
}
}
-// return TRUE if "name" exists.
int os_file_exists(const char_u *name)
{
uv_fs_t request;