aboutsummaryrefslogtreecommitdiff
path: root/libbb/git.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/git.h')
-rw-r--r--libbb/git.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libbb/git.h b/libbb/git.h
new file mode 100644
index 000000000..3274af34d
--- /dev/null
+++ b/libbb/git.h
@@ -0,0 +1,21 @@
1ssize_t write_in_full(int fd, const void *buf, size_t count);
2
3#define alloc_nr(x) (((x)+16)*3/2)
4
5#define ALLOC_GROW(x, nr, alloc) \
6 do { \
7 if ((nr) > alloc) { \
8 if (alloc_nr(alloc) < (nr)) \
9 alloc = (nr); \
10 else \
11 alloc = alloc_nr(alloc); \
12 x = xrealloc((x), alloc * sizeof(*(x))); \
13 } \
14 } while(0)
15
16static inline int is_absolute_path(const char *path)
17{
18 return path[0] == '/' || has_dos_drive_prefix(path);
19}
20
21#define NORETURN ATTRIBUTE_NORETURN