xine-lib: xine-lib-1.2.13/src/input/input_file.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Functions | Variables
input_file.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <unistd.h>`
`#include <fcntl.h>`
`#include <string.h>`
`#include <time.h>`
`#include <errno.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/compat.h>`
`#include <xine/input_plugin.h>`
`#include "input_helper.h"`

## Data Structures
struct | file_input_class_t
struct | file_input_plugin_t

## Macros
#define | LOG_MODULE "input_file"
#define | LOG_VERBOSE
#define | MAXFILES 65535
#define | O_BINARY 0
#define | S_ISLNK(mode) 0
#define | S_ISFIFO(mode) 0
#define | S_ISSOCK(mode) 0
#define | S_ISCHR(mode) 0
#define | S_ISBLK(mode) 0
#define | S_ISREG(mode) 0
#define | S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
#define | S_N 0x0
#define | S_I 0x4
#define | S_F 0x8
#define | S_Z 0xC
#define | CMP 2
#define | LEN 3
#define | ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
#define | INPUT_FILE_CATALOG { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "FILE", XINE_VERSION_CODE, NULL, file_input_init_plugin }

## Functions
static void | file_input_size (file_input_plugin_t *this, const struct stat *sbuf)
static uint32_t | file_input_get_capabilities (input_plugin_t *this_gen)
static off_t | file_input_read (input_plugin_t *this_gen, void *buf, off_t len)
static buf_element_t * | file_input_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t todo)
static off_t | file_input_seek (input_plugin_t *this_gen, off_t offset, int origin)
static off_t | file_input_get_current_pos (input_plugin_t *this_gen)
static off_t | file_input_get_length (input_plugin_t *this_gen)
static int | file_input_is_dir (const char *filepathname)
static const char * | file_input_get_mrl (input_plugin_t *this_gen)
static void | file_input_dispose (input_plugin_t *this_gen)
static char * | file_input_decode_uri (char *uri)
static int | file_input_open (input_plugin_t *this_gen)
static int | file_input_get_optional_data (input_plugin_t *this_gen, void *data, int data_type)
static input_plugin_t * | file_input_get_instance (input_class_t *cls_gen, xine_stream_t *stream, const char *mrl)
static void | file_input_origin_change_cb (void *data, xine_cfg_entry_t *cfg)
static int | file_input_strverscmp (const char *s1, const char *s2)
static int | file_input_sortfiles_default (const xine_mrl_t *s1, const xine_mrl_t *s2)
static uint32_t | file_input_get_file_type (char *filepathname, char *origin, xine_t *xine)
static off_t | file_input_get_file_size (const char *filepathname, const char *origin)
static xine_mrl_t ** | file_input_class_get_dir (input_class_t *this_gen, const char *filename, int *nFiles)
static void | file_input_class_dispose (input_class_t *this_gen)
static void * | file_input_init_plugin (xine_t *xine, const void *data)

## Variables
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ CMP

#define CMP 2

Referenced by file_input_strverscmp().

## ◆ INPUT_FILE_CATALOG

#define INPUT_FILE_CATALOG { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "FILE", XINE_VERSION_CODE, NULL, file_input_init_plugin }

## ◆ ISDIGIT

#define ISDIGIT | ( |  | c | ) | ((unsigned) (c) - '0' <= 9)

Referenced by file_input_strverscmp().

## ◆ LEN

#define LEN 3

Referenced by file_input_strverscmp().

## ◆ LOG_MODULE

#define LOG_MODULE "input_file"

Referenced by file_input_get_capabilities(), file_input_open(), file_input_read(), and file_input_size().

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAXFILES

#define MAXFILES 65535

Referenced by file_input_class_get_dir().

## ◆ O_BINARY

#define O_BINARY 0

Referenced by file_input_open().

## ◆ S_F

#define S_F 0x8

Referenced by file_input_strverscmp().

## ◆ S_I

#define S_I 0x4

Referenced by file_input_strverscmp().

## ◆ S_ISBLK

#define S_ISBLK | ( |  | mode | ) | 0

Referenced by file_input_get_file_type().

## ◆ S_ISCHR

#define S_ISCHR | ( |  | mode | ) | 0

Referenced by file_input_get_file_type().

## ◆ S_ISFIFO

#define S_ISFIFO | ( |  | mode | ) | 0

Referenced by _x_rip_plugin_get_instance(), and file_input_get_file_type().

## ◆ S_ISLNK

#define S_ISLNK | ( |  | mode | ) | 0

Referenced by file_input_get_file_type(), and xine_realpath().

## ◆ S_ISREG

#define S_ISREG | ( |  | mode | ) | 0

Referenced by _gnutls_load_certs(), file_input_get_capabilities(), file_input_get_file_type(), file_input_open(), file_input_size(), load_channels(), xine_config_save(), and xine_open().

## ◆ S_ISSOCK

#define S_ISSOCK | ( |  | mode | ) | 0

Referenced by file_input_get_file_type().

## ◆ S_IXUGO

#define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)

Referenced by file_input_get_file_type().

## ◆ S_N

#define S_N 0x0

Referenced by file_input_strverscmp().

## ◆ S_Z

#define S_Z 0xC

Referenced by file_input_strverscmp().

## Function Documentation

## ◆ file_input_class_dispose()

static void file_input_class_dispose | ( | input_class_t * | this_gen | ) |
| static

References _x_freep(), MRL_ZERO, NULL, and config_values_s::unregister_callbacks.

Referenced by file_input_init_plugin().

## ◆ file_input_class_get_dir()

static xine_mrl_t ** file_input_class_get_dir | ( | input_class_t * | this_gen,
|  | const char * | filename,
|  | int * | nFiles )
| static

References _x_asprintf(), _x_freep(), _x_input_get_show_hidden_files(), file_input_get_file_size(), file_input_get_file_type(), file_input_is_dir(), file_input_sortfiles_default(), xine_mrl_s::link, MAXFILES, xine_mrl_s::mrl, mrl_file_symlink, MRL_ZERO, NULL, xine_mrl_s::origin, xine_mrl_s::size, type, xine_mrl_s::type, xine_get_homedir(), XINE_NAME_MAX, XINE_PATH_MAX, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by file_input_init_plugin().

## ◆ file_input_decode_uri()

static char * file_input_decode_uri | ( | char * | uri | ) |
| static

References _x_mrl_unescape().

Referenced by file_input_open().

## ◆ file_input_dispose()

static void file_input_dispose | ( | input_plugin_t * | this_gen | ) |
| static

References _x_freep().

Referenced by file_input_get_instance().

## ◆ file_input_get_capabilities()

static uint32_t file_input_get_capabilities | ( | input_plugin_t * | this_gen | ) |
| static

References file_input_size(), INPUT_CAP_CLONE, INPUT_CAP_SEEKABLE, LOG_MODULE, S_ISREG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by file_input_get_instance().

## ◆ file_input_get_current_pos()

static off_t file_input_get_current_pos | ( | input_plugin_t * | this_gen | ) |
| static

Referenced by file_input_get_instance().

## ◆ file_input_get_file_size()

static off_t file_input_get_file_size | ( | const char * | filepathname,
|  | const char * | origin )
| static

References XINE_NAME_MAX, and XINE_PATH_MAX.

Referenced by file_input_class_get_dir().

## ◆ file_input_get_file_type()

static uint32_t file_input_get_file_type | ( | char * | filepathname,
|  | char * | origin,
|  | xine_t * | xine )
| static

References lprintf, mode(), mrl_file, mrl_file_backup, mrl_file_blockdev, mrl_file_chardev, mrl_file_directory, mrl_file_exec, mrl_file_fifo, mrl_file_normal, mrl_file_sock, mrl_file_symlink, mrl_unknown, S_ISBLK, S_ISCHR, S_ISFIFO, S_ISLNK, S_ISREG, S_ISSOCK, S_IXUGO, XINE_NAME_MAX, and XINE_PATH_MAX.

Referenced by file_input_class_get_dir().

## ◆ file_input_get_instance()

static input_plugin_t * file_input_get_instance | ( | input_class_t * | cls_gen,
|  | xine_stream_t * | stream,
|  | const char * | mrl )
| static

References _x_input_default_get_blocksize(), file_input_dispose(), file_input_get_capabilities(), file_input_get_current_pos(), file_input_get_length(), file_input_get_mrl(), file_input_get_optional_data(), file_input_open(), file_input_read(), file_input_read_block(), file_input_seek(), lprintf, and NULL.

Referenced by file_input_get_optional_data(), and file_input_init_plugin().

## ◆ file_input_get_length()

static off_t file_input_get_length | ( | input_plugin_t * | this_gen | ) |
| static

References file_input_size().

Referenced by file_input_get_instance(), and file_input_open().

## ◆ file_input_get_mrl()

static const char * file_input_get_mrl | ( | input_plugin_t * | this_gen | ) |
| static

Referenced by file_input_get_instance().

## ◆ file_input_get_optional_data()

static int file_input_get_optional_data | ( | input_plugin_t * | this_gen,
|  | void * | data,
|  | int | data_type )
| static

References file_input_get_instance(), INPUT_OPTIONAL_DATA_CLONE, INPUT_OPTIONAL_SUCCESS, and INPUT_OPTIONAL_UNSUPPORTED.

Referenced by file_input_get_instance().

## ◆ file_input_init_plugin()

static void * file_input_init_plugin | ( | xine_t * | xine,
|  | const void * | data )
| static

References _, _x_input_register_show_hidden_files(), xine_s::config, file_input_class_dispose(), file_input_class_get_dir(), file_input_get_instance(), file_input_origin_change_cb(), N_, NULL, config_values_s::register_filename, XINE_CONFIG_STRING_IS_DIRECTORY_NAME, and XINE_PATH_MAX.

## ◆ file_input_is_dir()

static int file_input_is_dir | ( | const char * | filepathname | ) |
| static

Referenced by file_input_class_get_dir().

## ◆ file_input_open()

static int file_input_open | ( | input_plugin_t * | this_gen | ) |
| static

References _, _x_freep(), _x_message(), file_input_decode_uri(), file_input_get_length(), LOG_MODULE, lprintf, now(), NULL, O_BINARY, S_ISREG, xine_log(), XINE_LOG_MSG, XINE_MSG_FILE_EMPTY, XINE_MSG_FILE_NOT_FOUND, XINE_MSG_PERMISSION_ERROR, xine_open_cloexec(), XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by file_input_get_instance().

## ◆ file_input_origin_change_cb()

static void file_input_origin_change_cb | ( | void * | data,
|  | xine_cfg_entry_t * | cfg )
| static

References xine_cfg_entry_s::str_value.

Referenced by file_input_init_plugin().

## ◆ file_input_read()

static off_t file_input_read | ( | input_plugin_t * | this_gen,
|  | void * | buf,
|  | off_t | len )
| static

References _x_demux_called_from(), _x_io_select(), LOG_MODULE, XINE_VERBOSITY_DEBUG, XIO_ABORTED, XIO_READ_READY, and xprintf.

Referenced by file_input_get_instance().

## ◆ file_input_read_block()

static buf_element_t * file_input_read_block | ( | input_plugin_t * | this_gen,
|  | fifo_buffer_t * | fifo,
|  | off_t | todo )
| static

References _x_input_default_read_block(), BUF_DEMUX_BLOCK, fifo_buffer_s::buffer_pool_alloc, buf_element_s::content, buf_element_s::free_buffer, buf_element_s::max_size, NULL, buf_element_s::size, and buf_element_s::type.

Referenced by file_input_get_instance().

## ◆ file_input_seek()

static off_t file_input_seek | ( | input_plugin_t * | this_gen,
|  | off_t | offset,
|  | int | origin )
| static

Referenced by file_input_get_instance().

## ◆ file_input_size()

static void file_input_size | ( | file_input_plugin_t * | this,
|  | const struct stat * | sbuf )
| static

References LOG_MODULE, S_ISREG, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by file_input_get_capabilities(), and file_input_get_length().

## ◆ file_input_sortfiles_default()

static int file_input_sortfiles_default | ( | const xine_mrl_t * | s1,
|  | const xine_mrl_t * | s2 )
| static

References file_input_strverscmp(), and xine_mrl_s::mrl.

Referenced by file_input_class_get_dir().

## ◆ file_input_strverscmp()

static int file_input_strverscmp | ( | const char * | s1,
|  | const char * | s2 )
| static

References CMP, ISDIGIT, LEN, S_F, S_I, S_N, and S_Z.

Referenced by file_input_sortfiles_default().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "FILE", XINE_VERSION_CODE, NULL, file_input_init_plugin } ,
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
file_input_init_plugin
static void * file_input_init_plugin(xine_t *xine, const void *data)
Definition input_file.c:1043
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
NULL
Definition xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition xine_plugin.h:29
PLUGIN_MUST_PRELOAD
#define PLUGIN_MUST_PRELOAD
Definition xine_plugin.h:46
PLUGIN_INPUT
#define PLUGIN_INPUT
Definition xine_plugin.h:30