Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-02-17 03:13:34 +0400
committerVicent Martí <tanoku@gmail.com>2012-03-06 03:43:10 +0400
commit1a48112342932e9fcd45a1ff5935f1c9c53b83d1 (patch)
treefbb18cfe64e65025c6e1790972d1a106eea4cc54 /src/path.h
parent45d387ac78bcf3167d69b736d0b322717bc492d4 (diff)
error-handling: References
Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/path.h b/src/path.h
index 981fdd6a4..e885d875e 100644
--- a/src/path.h
+++ b/src/path.h
@@ -113,21 +113,21 @@ extern int git_path_fromurl(git_buf *local_path_out, const char *file_url);
/**
* Check if a file exists and can be accessed.
- * @return GIT_SUCCESS if file exists, < 0 otherwise.
+ * @return true or false
*/
-extern int git_path_exists(const char *path);
+extern bool git_path_exists(const char *path);
/**
* Check if the given path points to a directory.
- * @return GIT_SUCCESS if it is a directory, < 0 otherwise.
+ * @return true or false
*/
-extern int git_path_isdir(const char *path);
+extern bool git_path_isdir(const char *path);
/**
* Check if the given path points to a regular file.
- * @return GIT_SUCCESS if it is a regular file, < 0 otherwise.
+ * @return true or false
*/
-extern int git_path_isfile(const char *path);
+extern bool git_path_isfile(const char *path);
/**
* Check if the parent directory contains the item.
@@ -136,25 +136,27 @@ extern int git_path_isfile(const char *path);
* @param item Item that might be in the directory.
* @return GIT_SUCCESS if item exists in directory, <0 otherwise.
*/
-extern int git_path_contains(git_buf *dir, const char *item);
+extern bool git_path_contains(git_buf *dir, const char *item);
/**
* Check if the given path contains the given subdirectory.
*
* @param parent Directory path that might contain subdir
* @param subdir Subdirectory name to look for in parent
- * @return GIT_SUCCESS if subdirectory exists, < 0 otherwise.
+ * @param append_if_exists If true, then subdir will be appended to the parent path if it does exist
+ * @return true if subdirectory exists, false otherwise.
*/
-extern int git_path_contains_dir(git_buf *parent, const char *subdir);
+extern bool git_path_contains_dir(git_buf *parent, const char *subdir);
/**
* Check if the given path contains the given file.
*
* @param dir Directory path that might contain file
* @param file File name to look for in parent
- * @return GIT_SUCCESS if file exists, < 0 otherwise.
+ * @param append_if_exists If true, then file will be appended to the path if it does exist
+ * @return true if file exists, false otherwise.
*/
-extern int git_path_contains_file(git_buf *dir, const char *file);
+extern bool git_path_contains_file(git_buf *dir, const char *file);
/**
* Clean up path, prepending base if it is not already rooted.