Create Temporary Files. More...
#include <stdio.h>
Go to the source code of this file.
Macros | |
#define | buf_mktemp(buf) buf_mktemp_pfx_sfx(buf, "neomutt", NULL) |
#define | buf_mktemp_pfx_sfx(buf, prefix, suffix) buf_mktemp_full(buf, prefix, suffix, __FILE__, __LINE__) |
#define | mutt_file_mkstemp() mutt_file_mkstemp_full(__FILE__, __LINE__, __func__) |
Functions | |
void | buf_mktemp_full (struct Buffer *buf, const char *prefix, const char *suffix, const char *src, int line) |
Create a temporary file. | |
FILE * | mutt_file_mkstemp_full (const char *file, int line, const char *func) |
Create temporary file safely. | |
Create Temporary Files.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file tmp.h.
#define buf_mktemp | ( | buf | ) | buf_mktemp_pfx_sfx(buf, "neomutt", NULL) |
#define buf_mktemp_pfx_sfx | ( | buf, | |
prefix, | |||
suffix | |||
) | buf_mktemp_full(buf, prefix, suffix, __FILE__, __LINE__) |
#define mutt_file_mkstemp | ( | ) | mutt_file_mkstemp_full(__FILE__, __LINE__, __func__) |
void buf_mktemp_full | ( | struct Buffer * | buf, |
const char * | prefix, | ||
const char * | suffix, | ||
const char * | src, | ||
int | line | ||
) |
Create a temporary file.
buf | Buffer for result |
prefix | Prefix for filename |
suffix | Suffix for filename |
src | Source file of caller |
line | Source line number of caller |
Definition at line 50 of file tmp.c.
FILE * mutt_file_mkstemp_full | ( | const char * | file, |
int | line, | ||
const char * | func | ||
) |
Create temporary file safely.
file | Source file of caller |
line | Source line number of caller |
func | Function name of caller |
ptr | FILE handle |
NULL | Error, see errno |
Create and immediately unlink a temp file using mkstemp().
Definition at line 76 of file tmp.c.