summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/common.h b/common.h
index 9957d42..0458ba5 100644
--- a/common.h
+++ b/common.h
@@ -1,8 +1,10 @@
#define psizeof(a) (sizeof(a) / sizeof(*(a)))
-
-static inline void *memdup(void *src, size_t size) {
- void *r = malloc(size);
- memcpy(r, src, size);
- return r;
-}
#define ifree(p) do { if (p) { free(p); p = NULL; } } while (0)
+
+
+typedef struct {
+ FILE *f;
+ pid_t pid;
+} fh;
+extern fh fh_open(const char *name);
+extern void fh_close(fh *f);