X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=81ceb7f906da563df8907d692b2628709ea8f660;hb=fce338a5433d34f119457c0f6e6560799ba14022;hp=c4f4e15036577bc0c55d19cef26fd0ce26b233ad;hpb=f62e53c897c359b5885c474c41341d83845a78f6;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index c4f4e1503..81ceb7f90 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -164,6 +164,13 @@ extern char *gitbasename(char *); #define PATH_SEP ':' #endif +#ifdef HAVE_PATHS_H +#include +#endif +#ifndef _PATH_DEFPATH +#define _PATH_DEFPATH "/usr/local/bin:/usr/bin:/bin" +#endif + #ifndef STRIP_EXTENSION #define STRIP_EXTENSION "" #endif @@ -356,7 +363,8 @@ static inline void *gitmempcpy(void *dest, const void *src, size_t n) extern void release_pack_memory(size_t, int); -extern void set_try_to_free_routine(void (*routine)(size_t)); +typedef void (*try_to_free_t)(size_t); +extern try_to_free_t set_try_to_free_routine(try_to_free_t); extern char *xstrdup(const char *str); extern void *xmalloc(size_t size); @@ -481,5 +489,14 @@ void git_qsort(void *base, size_t nmemb, size_t size, * Always returns the return value of unlink(2). */ int unlink_or_warn(const char *path); +/* + * Likewise for rmdir(2). + */ +int rmdir_or_warn(const char *path); +/* + * Calls the correct function out of {unlink,rmdir}_or_warn based on + * the supplied file mode. + */ +int remove_or_warn(unsigned int mode, const char *path); #endif