aboutsummaryrefslogtreecommitdiffstats
path: root/tempfile.h
blob: bfccf4741f7be5f723d52cdd14f92a05f82f8c63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef TEMPFILE_H
#define TEMPFILE_H

#include "compiler.h"

enum temp_file_mode {
    TF_BINARY,			/* Raw binary */
    TF_TEXT,			/* Text mode compatible with ASCII */
    TF_UNICODE			/* Platform preferred Unicode encoding */
};

struct temp_file {
    FILE *f;
    int fd;
    enum temp_file_mode mode;
    char filename[1];
};

extern struct temp_file *temp_file(enum temp_file_mode mode);
extern int close_temp(struct temp_file **temp);

#endif /* TEMPFILE_H */