summaryrefslogtreecommitdiff
path: root/src/basic/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/util.h')
-rw-r--r--src/basic/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h
index 5c0130d265..426b7f7d16 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -71,6 +71,7 @@ size_t page_size(void) _pure_;
#define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0)
bool streq_ptr(const char *a, const char *b) _pure_;
+int strcmp_ptr(const char *a, const char *b) _pure_;
#define new(t, n) ((t*) malloc_multiply(sizeof(t), (n)))
@@ -84,6 +85,11 @@ bool streq_ptr(const char *a, const char *b) _pure_;
#define malloc0(n) (calloc((n), 1))
+static inline void *mfree(void *memory) {
+ free(memory);
+ return NULL;
+}
+
static inline const char* yes_no(bool b) {
return b ? "yes" : "no";
}
@@ -918,3 +924,6 @@ int parse_mode(const char *s, mode_t *ret);
int mount_move_root(const char *path);
int reset_uid_gid(void);
+
+int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink);
+int fgetxattr_malloc(int fd, const char *name, char **value);