Audacious
$Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
#include <glib.h>
#include <inttypes.h>
#include "vfs.h"
#include "audstrings.h"
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <string.h>
#include "config.h"
Go to the source code of this file.
Classes | |
struct | VFSFile |
VFSFile objects describe an opened VFS stream, basically being similar in purpose as stdio FILE More... | |
Macros | |
#define | VFS_SIG ('V' | ('F' << 8) | ('S' << 16)) |
Functions | |
EXPORT void | vfs_set_lookup_func (VFSConstructor *(*func)(const char *scheme)) |
EXPORT void | vfs_set_verbose (bool_t set) |
static void | logger (const char *format,...) |
EXPORT VFSFile * | vfs_new (const char *path, VFSConstructor *vtable, void *handle) |
EXPORT const char * | vfs_get_filename (VFSFile *file) |
EXPORT void * | vfs_get_handle (VFSFile *file) |
EXPORT VFSFile * | vfs_fopen (const char *path, const char *mode) |
Opens a stream from a VFS transport using one of the registered VFSConstructor handlers. | |
EXPORT int | vfs_fclose (VFSFile *file) |
Closes a VFS stream and destroys a VFSFile object. | |
EXPORT int64_t | vfs_fread (void *ptr, int64_t size, int64_t nmemb, VFSFile *file) |
Reads from a VFS stream. | |
EXPORT int64_t | vfs_fwrite (const void *ptr, int64_t size, int64_t nmemb, VFSFile *file) |
Writes to a VFS stream. | |
EXPORT int | vfs_getc (VFSFile *file) |
Reads a character from a VFS stream. | |
EXPORT int | vfs_ungetc (int c, VFSFile *file) |
Pushes a character back to the VFS stream. | |
EXPORT int | vfs_fseek (VFSFile *file, int64_t offset, int whence) |
Performs a seek in given VFS stream. | |
EXPORT void | vfs_rewind (VFSFile *file) |
Rewinds a VFS stream. | |
EXPORT int64_t | vfs_ftell (VFSFile *file) |
Returns the current position in the VFS stream's buffer. | |
EXPORT bool_t | vfs_feof (VFSFile *file) |
Returns whether or not the VFS stream has reached EOF. | |
EXPORT int | vfs_ftruncate (VFSFile *file, int64_t length) |
Truncates a VFS stream to a certain size. | |
EXPORT int64_t | vfs_fsize (VFSFile *file) |
Returns size of the file. | |
EXPORT char * | vfs_get_metadata (VFSFile *file, const char *field) |
Returns metadata about the stream. | |
EXPORT bool_t | vfs_file_test (const char *path, int test) |
Wrapper for g_file_test(). | |
EXPORT bool_t | vfs_is_writeable (const char *path) |
Tests if a file is writeable. | |
EXPORT bool_t | vfs_is_remote (const char *path) |
Tests if a path is remote uri. | |
EXPORT bool_t | vfs_is_streaming (VFSFile *file) |
Tests if a file is associated to streaming. | |
Variables | |
static VFSConstructor *(* | lookup_func )(const char *scheme) = NULL |
static bool_t | verbose = FALSE |
#define VFS_SIG ('V' | ('F' << 8) | ('S' << 16)) |
Definition at line 34 of file vfs.c.
Referenced by vfs_fclose(), vfs_feof(), vfs_fread(), vfs_fseek(), vfs_fsize(), vfs_ftell(), vfs_ftruncate(), vfs_fwrite(), vfs_getc(), vfs_new(), vfs_rewind(), and vfs_ungetc().
|
static |
Definition at line 68 of file vfs.c.
Referenced by vfs_fclose(), vfs_feof(), vfs_fopen(), vfs_fseek(), vfs_fsize(), vfs_ftell(), vfs_ftruncate(), vfs_fwrite(), vfs_getc(), vfs_rewind(), and vfs_ungetc().
Closes a VFS stream and destroys a VFSFile object.
file | A VFSFile object to destroy. |
Definition at line 166 of file vfs.c.
Referenced by file_find_decoder(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_thread(), playlist_load(), playlist_save(), probe_buffer_fclose(), save_preset_file(), and vfs_file_get_contents().
Returns whether or not the VFS stream has reached EOF.
file | VFSFile object that represents the VFS stream. |
Definition at line 335 of file vfs.c.
Referenced by probe_buffer_feof().
Wrapper for g_file_test().
path | A path to test. |
test | A GFileTest to run. |
Definition at line 408 of file vfs.c.
Referenced by add_generic(), and playlist_remove_failed().
EXPORT VFSFile* vfs_fopen | ( | const char * | path, |
const char * | mode | ||
) |
Opens a stream from a VFS transport using one of the registered VFSConstructor handlers.
path | The path or URI to open. |
mode | The preferred access privileges (not guaranteed). |
Definition at line 124 of file vfs.c.
Referenced by check_opened(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_thread(), playlist_load(), playlist_save(), probe_buffer_new(), save_preset_file(), and vfs_file_get_contents().
EXPORT int64_t vfs_fread | ( | void * | ptr, |
int64_t | size, | ||
int64_t | nmemb, | ||
VFSFile * | file | ||
) |
Reads from a VFS stream.
ptr | A pointer to the destination buffer. |
size | The size of each element to read. |
nmemb | The number of elements to read. |
file | VFSFile object that represents the VFS stream. |
Definition at line 195 of file vfs.c.
Referenced by import_winamp_eqf(), increase_buffer(), vfs_fget_be16(), vfs_fget_be32(), vfs_fget_be64(), vfs_fget_le16(), vfs_fget_le32(), vfs_fget_le64(), and vfs_file_get_contents().
Performs a seek in given VFS stream.
Standard C-style values of whence can be used to indicate desired action.
file | VFSFile object that represents the VFS stream. |
offset | The offset to seek to. |
whence | Type of the seek: SEEK_CUR, SEEK_SET or SEEK_END. |
Definition at line 279 of file vfs.c.
Referenced by import_winamp_eqf(), and probe_func().
EXPORT int64_t vfs_fsize | ( | VFSFile * | file | ) |
Returns size of the file.
file | VFSFile object that represents the VFS stream. |
Definition at line 370 of file vfs.c.
Referenced by probe_buffer_fsize(), vfs_file_get_contents(), and vfs_is_streaming().
EXPORT int64_t vfs_ftell | ( | VFSFile * | file | ) |
EXPORT int64_t vfs_fwrite | ( | const void * | ptr, |
int64_t | size, | ||
int64_t | nmemb, | ||
VFSFile * | file | ||
) |
Writes to a VFS stream.
ptr | A const pointer to the source buffer. |
size | The size of each element to write. |
nmemb | The number of elements to write. |
file | VFSFile object that represents the VFS stream. |
Definition at line 217 of file vfs.c.
Referenced by save_preset_file(), vfs_fput_be16(), vfs_fput_be32(), vfs_fput_be64(), vfs_fput_le16(), vfs_fput_le32(), vfs_fput_le64(), vfs_fputc(), and vfs_fputs().
EXPORT const char* vfs_get_filename | ( | VFSFile * | file | ) |
Definition at line 105 of file vfs.c.
Referenced by import_winamp_eqf().
EXPORT void* vfs_get_handle | ( | VFSFile * | file | ) |
Definition at line 110 of file vfs.c.
Referenced by probe_buffer_fclose(), probe_buffer_feof(), probe_buffer_fread(), probe_buffer_fseek(), probe_buffer_fsize(), probe_buffer_ftell(), and probe_buffer_get_metadata().
EXPORT char* vfs_get_metadata | ( | VFSFile * | file, |
const char * | field | ||
) |
Returns metadata about the stream.
file | VFSFile object that represents the VFS stream. |
field | The string constant field name to get. |
Definition at line 390 of file vfs.c.
Referenced by probe_buffer_get_metadata(), and probe_by_mime().
Reads a character from a VFS stream.
file | VFSFile object that represents the VFS stream. |
Definition at line 237 of file vfs.c.
Referenced by vfs_fgets().
EXPORT bool_t vfs_is_remote | ( | const char * | path | ) |
Tests if a path is remote uri.
path | A path to test. |
Definition at line 476 of file vfs.c.
Referenced by check_opened().
EXPORT bool_t vfs_is_writeable | ( | const char * | path | ) |
EXPORT VFSFile* vfs_new | ( | const char * | path, |
VFSConstructor * | vtable, | ||
void * | handle | ||
) |
Definition at line 95 of file vfs.c.
Referenced by probe_buffer_new(), and vfs_fopen().
EXPORT void vfs_rewind | ( | VFSFile * | file | ) |
EXPORT void vfs_set_lookup_func | ( | VFSConstructor *(*)(const char *scheme) | func | ) |
Definition at line 56 of file vfs.c.
Referenced by start_plugins_one(), and stop_plugins_one().
EXPORT void vfs_set_verbose | ( | bool_t | set | ) |
Definition at line 63 of file vfs.c.
Referenced by init_two().
|
static |
Definition at line 54 of file vfs.c.
Referenced by vfs_fopen(), and vfs_set_lookup_func().
Definition at line 61 of file vfs.c.
Referenced by init_two(), and parse_options().