Audacious $Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
#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 <mowgli.h>
Go to the source code of this file.
Classes | |
struct | LookupNode |
Functions | |
void | vfs_set_lookup_func (VFSConstructor *(*func)(const gchar *scheme)) |
static VFSConstructor * | do_lookup (const gchar *scheme, gboolean prepare) |
void | vfs_prepare (const gchar *scheme) |
void | vfs_prepare_filename (const gchar *path) |
void | vfs_set_verbose (gboolean set) |
static void | logger (const gchar *format,...) |
VFSFile * | vfs_fopen (const gchar *path, const gchar *mode) |
Opens a stream from a VFS transport using one of the registered VFSConstructor handlers. | |
gint | vfs_fclose (VFSFile *file) |
Closes a VFS stream and destroys a VFSFile object. | |
gint64 | vfs_fread (void *ptr, gint64 size, gint64 nmemb, VFSFile *file) |
Reads from a VFS stream. | |
gint64 | vfs_fwrite (const void *ptr, gint64 size, gint64 nmemb, VFSFile *file) |
Writes to a VFS stream. | |
gint | vfs_getc (VFSFile *file) |
Reads a character from a VFS stream. | |
gint | vfs_ungetc (gint c, VFSFile *file) |
Pushes a character back to the VFS stream. | |
gint | vfs_fseek (VFSFile *file, gint64 offset, gint whence) |
Performs a seek in given VFS stream. | |
void | vfs_rewind (VFSFile *file) |
Rewinds a VFS stream. | |
gint64 | vfs_ftell (VFSFile *file) |
Returns the current position in the VFS stream's buffer. | |
gboolean | vfs_feof (VFSFile *file) |
Returns whether or not the VFS stream has reached EOF. | |
gint | vfs_ftruncate (VFSFile *file, gint64 length) |
Truncates a VFS stream to a certain size. | |
gint64 | vfs_fsize (VFSFile *file) |
Returns size of the file. | |
gchar * | vfs_get_metadata (VFSFile *file, const gchar *field) |
Returns metadata about the stream. | |
gboolean | vfs_file_test (const gchar *path, GFileTest test) |
Wrapper for g_file_test(). | |
gboolean | vfs_is_writeable (const gchar *path) |
Tests if a file is writeable. | |
VFSFile * | vfs_dup (VFSFile *in) |
Increments the amount of references that are using this FD. | |
gboolean | vfs_is_remote (const gchar *path) |
Tests if a path is remote uri. | |
gboolean | vfs_is_streaming (VFSFile *file) |
Tests if a file is associated to streaming. | |
Variables | |
static GStaticMutex | mutex = G_STATIC_MUTEX_INIT |
static GThread * | lookup_thread = NULL |
static VFSConstructor *(* | lookup_func )(const gchar *scheme) = NULL |
static mowgli_patricia_t * | lookup_table = NULL |
static gboolean | verbose = FALSE |
static VFSConstructor* do_lookup | ( | const gchar * | scheme, |
gboolean | prepare | ||
) | [static] |
Definition at line 61 of file vfs.c.
Referenced by vfs_fopen(), and vfs_prepare().
static void logger | ( | const gchar * | format, |
... | |||
) | [static] |
Definition at line 119 of file vfs.c.
Referenced by vfs_feof(), vfs_fopen(), vfs_fread(), vfs_fseek(), vfs_fsize(), vfs_ftell(), vfs_ftruncate(), vfs_fwrite(), vfs_getc(), vfs_rewind(), and vfs_ungetc().
Increments the amount of references that are using this FD.
References are removed by calling vfs_fclose on the handle returned from this function. If the amount of references reaches zero, then the file will be closed.
in | The VFSFile handle to mark as duplicated. |
Closes a VFS stream and destroys a VFSFile object.
file | A VFSFile object to destroy. |
Definition at line 200 of file vfs.c.
Referenced by buffered_file_vfs_fclose_impl(), file_find_decoder(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_thread(), probe_buffer_fclose(), save_preset_file(), vfs_buffered_file_new_from_uri(), vfs_buffered_file_release_live_fd(), 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 372 of file vfs.c.
Referenced by buffered_file_vfs_feof_impl(), and probe_buffer_feof().
gboolean vfs_file_test | ( | const gchar * | path, |
GFileTest | test | ||
) |
Wrapper for g_file_test().
path | A path to test. |
test | A GFileTest to run. |
Definition at line 445 of file vfs.c.
Referenced by add_list(), and playlist_remove_failed().
VFSFile* vfs_fopen | ( | const gchar * | path, |
const gchar * | 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 155 of file vfs.c.
Referenced by check_opened(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_thread(), probe_buffer_new(), save_preset_file(), vfs_buffered_file_new_from_uri(), and vfs_file_get_contents().
gint64 vfs_fread | ( | void * | ptr, |
gint64 | size, | ||
gint64 | 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 232 of file vfs.c.
Referenced by buffered_file_vfs_fread_impl(), import_winamp_eqf(), increase_buffer(), vfs_buffered_file_new_from_uri(), 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 316 of file vfs.c.
Referenced by buffered_file_vfs_fread_impl(), buffered_file_vfs_fseek_impl(), buffered_file_vfs_getc_impl(), import_winamp_eqf(), and probe_func().
gint64 vfs_fsize | ( | VFSFile * | file | ) |
Returns size of the file.
file | VFSFile object that represents the VFS stream. |
Definition at line 407 of file vfs.c.
Referenced by buffered_file_vfs_fsize_impl(), probe_buffer_fsize(), and vfs_file_get_contents().
gint64 vfs_ftell | ( | VFSFile * | file | ) |
Returns the current position in the VFS stream's buffer.
file | VFSFile object that represents the VFS stream. |
Definition at line 353 of file vfs.c.
Referenced by buffered_file_vfs_fread_impl(), buffered_file_vfs_fseek_impl(), buffered_file_vfs_ftell_impl(), and buffered_file_vfs_getc_impl().
gint64 vfs_fwrite | ( | const void * | ptr, |
gint64 | size, | ||
gint64 | 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 254 of file vfs.c.
Referenced by buffered_file_vfs_fwrite_impl(), 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().
gchar* vfs_get_metadata | ( | VFSFile * | file, |
const gchar * | 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 427 of file vfs.c.
Referenced by buffered_file_vfs_metadata_impl(), 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 274 of file vfs.c.
Referenced by buffered_file_vfs_getc_impl(), and vfs_fgets().
gboolean vfs_is_remote | ( | const gchar * | path | ) |
Tests if a path is remote uri.
path | A path to test. |
Definition at line 508 of file vfs.c.
Referenced by check_opened().
gboolean vfs_is_writeable | ( | const gchar * | path | ) |
void vfs_prepare | ( | const gchar * | scheme | ) |
Definition at line 94 of file vfs.c.
Referenced by vfs_prepare_filename().
void vfs_prepare_filename | ( | const gchar * | path | ) |
Definition at line 101 of file vfs.c.
Referenced by playback_start(), scan_next(), and vfs_async_file_get_contents().
void vfs_rewind | ( | VFSFile * | file | ) |
Rewinds a VFS stream.
file | VFSFile object that represents the VFS stream. |
Definition at line 336 of file vfs.c.
Referenced by buffered_file_vfs_rewind_impl(), and vfs_buffered_file_new_from_uri().
void vfs_set_lookup_func | ( | VFSConstructor *(*)(const gchar *scheme) | func | ) |
Definition at line 48 of file vfs.c.
Referenced by start_plugins_one(), and stop_plugins_one().
void vfs_set_verbose | ( | gboolean | set | ) |
Definition at line 114 of file vfs.c.
Referenced by init_two().
VFSConstructor*(* lookup_func)(const gchar *scheme) = NULL [static] |
Definition at line 45 of file vfs.c.
Referenced by do_lookup(), vfs_fopen(), and vfs_set_lookup_func().
mowgli_patricia_t* lookup_table = NULL [static] |
Definition at line 46 of file vfs.c.
Referenced by do_lookup(), and vfs_set_lookup_func().
GThread* lookup_thread = NULL [static] |
Definition at line 44 of file vfs.c.
Referenced by do_lookup(), and vfs_set_lookup_func().
GStaticMutex mutex = G_STATIC_MUTEX_INIT [static] |
Definition at line 43 of file vfs.c.
Referenced by send_audio(), send_clear(), vfs_fopen(), vfs_prepare(), vfs_set_lookup_func(), vis_runner_add_hook(), vis_runner_lock(), vis_runner_remove_hook(), and vis_runner_unlock().