summaryrefslogtreecommitdiffstats
path: root/test/tmpf.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/tmpf.h')
-rw-r--r--test/tmpf.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/tmpf.h b/test/tmpf.h
index ce47191..cb1bda4 100644
--- a/test/tmpf.h
+++ b/test/tmpf.h
@@ -27,8 +27,20 @@ struct tmpf {
char path[PATH_MAX];
};
+/**
+ * Initialise a tmpf instance for use, creating a temporary file.
+ *
+ * @tmpf: A context to initialise with the provided template
+ * @template_str: A file basename in mkstemp(3) template form
+ *
+ * Returns 0 on success, or -1 on error with errno set appropriately
+ */
int tmpf_init(struct tmpf *tmpf, const char *template_str);
+/**
+ * Destroy a tmpf instance, closing the file descriptor and removing the
+ * temporary file.
+ */
void tmpf_destroy(struct tmpf *tmpf);
#endif /* MBOX_TEST_UTILS_H */
OpenPOWER on IntegriCloud