diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-16 15:21:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-16 17:12:37 +0200 |
commit | 885158c887384c6da247cc061458f2e53367e6b5 (patch) | |
tree | d915138f0a53ec1862a0e7782ade014cd0810957 /libavutil/file.h | |
parent | 7f16ec61e17ddc039e68637f1ca27844718312a6 (diff) | |
download | ffmpeg-885158c887384c6da247cc061458f2e53367e6b5.tar.gz |
Move av_tempfile() into libavutil, it is a generically usefull thing and its small.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/file.h')
-rw-r--r-- | libavutil/file.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/file.h b/libavutil/file.h index f28627c9d8..c6d2692d52 100644 --- a/libavutil/file.h +++ b/libavutil/file.h @@ -49,4 +49,13 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, */ void av_file_unmap(uint8_t *bufptr, size_t size); +/** + * Wrapper to work around the lack of mkstemp() on mingw. + * Also, tries to create file in /tmp first, if possible. + * *prefix can be a character constant; *filename will be allocated internally. + * @return file descriptor of opened file (or -1 on error) + * and opened file name in **filename. + */ +int av_tempfile(const char *prefix, char **filename); + #endif /* AVUTIL_FILE_H */ |