]> git.sesse.net Git - cubemap/blob - util.h
Support configurable BACKLOG_SIZE (per-stream). No support for changing across restar...
[cubemap] / util.h
1 #ifndef _UTIL_H
2 #define _UTIL_H
3
4 // Some utilities for reading and writing to temporary files.
5
6 #include <string>
7
8 // Make a file in /tmp, unlink it, and write <contents> to it.
9 // Returns the opened file descriptor, or -1 on failure.
10 int make_tempfile(const std::string &contents);
11
12 // Opposite of make_tempfile(). Returns false on failure.
13 bool read_tempfile(int fd, std::string *contents);
14
15 #endif  // !defined(_UTIL_H