FFmpeg
Data Structures | Macros | Functions | Variables
file_open.c File Reference
#include "config.h"
#include "internal.h"
#include "mem.h"
#include <stdarg.h>
#include <fcntl.h>
#include <sys/stat.h>

Go to the source code of this file.

Data Structures

struct  FileLogContext
 

Macros

#define O_BINARY   0
 
#define O_EXCL   0
 

Functions

int avpriv_open (const char *filename, int flags,...)
 A wrapper for open() setting O_CLOEXEC. More...
 
int avpriv_tempfile (const char *prefix, char **filename, int log_offset, void *log_ctx)
 Wrapper to work around the lack of mkstemp() on mingw. More...
 
FILE * av_fopen_utf8 (const char *path, const char *mode)
 Open a file using a UTF-8 filename. More...
 

Variables

static const AVClass file_log_ctx_class
 

Macro Definition Documentation

#define O_BINARY   0
#define O_EXCL   0

Referenced by avpriv_tempfile().

Function Documentation

int avpriv_open ( const char *  filename,
int  flags,
  ... 
)
int avpriv_tempfile ( const char *  prefix,
char **  filename,
int  log_offset,
void log_ctx 
)

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.

Returns
file descriptor of opened file (or negative value corresponding to an AVERROR code on error) and opened file name in **filename.
Note
On very old libcs it is necessary to set a secure umask before calling this, av_tempfile() can't call umask itself as it is used in libraries and could interfere with the calling application.

Definition at line 110 of file file_open.c.

Referenced by av_tempfile(), cache_open(), ff_rint64_clip(), and xvid_encode_init().

Variable Documentation

const AVClass file_log_ctx_class
static
Initial value:
= {
.class_name = "TEMPFILE",
.item_name = av_default_item_name,
.option = NULL,
.log_level_offset_offset = 0x42,
.parent_log_context_offset = 0x42,
}
#define NULL
Definition: coverity.c:32
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191

Definition at line 101 of file file_open.c.

Referenced by avpriv_tempfile().