diff options
| author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2009-01-12 19:42:13 +0000 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2009-01-28 12:25:24 -0800 |
| commit | ced645ea9ca4170bd75c17cb9c2c8f19f935491d (patch) | |
| tree | f2e2e7e17751b629cc3c13b0a7d0cab059cd1df4 /src/util.h | |
| parent | 66a4bfac99c07b79d75c015aed8f5972f0a4a336 (diff) | |
| download | libgit2-ced645ea9ca4170bd75c17cb9c2c8f19f935491d.tar.gz | |
Add git__dirname and git__basename utility routines
These routines are intended to extract the directory and
base name from a path string. Note that these routines
do not interact with any filesystem and work only on the
text of the path.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 8f0c4b543..3f541ffa6 100644 --- a/src/util.h +++ b/src/util.h @@ -31,6 +31,9 @@ extern int git__fmt(char *, size_t, const char *, ...) extern int git__prefixcmp(const char *str, const char *prefix); extern int git__suffixcmp(const char *str, const char *suffix); +extern int git__dirname(char *dir, size_t n, char *path); +extern int git__basename(char *base, size_t n, char *path); + /** @return true if p fits into the range of a size_t */ GIT_INLINE(int) git__is_sizet(off_t p) { |
