--- /dev/null
+#ifndef _UTIL_H
+#define _UTIL_H
+
+// Some utilities for reading and writing to temporary files.
+
+#include <string>
+
+// Make a file in /tmp, unlink it, and write <contents> to it.
+// Returns the opened file descriptor, or -1 on failure.
+int make_tempfile(const std::string &contents);
+
+// Opposite of make_tempfile(). Returns false on failure.
+bool read_tempfile(int fd, std::string *contents);
+
+#endif // !defined(_UTIL_H