Audacious
$Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
Main API header for accessing Audacious VFS functionality. More...
#include <glib.h>
#include <stdio.h>
#include <sys/types.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... | |
struct | VFSConstructor |
VFSConstructor objects contain the base vtables used for extrapolating a VFS stream. More... | |
Defines | |
#define | WARN_RETURN |
Functions | |
VFSFile * | vfs_fopen (const gchar *path, const gchar *mode) WARN_RETURN |
Opens a stream from a VFS transport using one of the registered VFSConstructor handlers. | |
VFSFile * | vfs_dup (VFSFile *in) WARN_RETURN |
Increments the amount of references that are using this FD. | |
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) WARN_RETURN |
Reads from a VFS stream. | |
gint64 | vfs_fwrite (const void *ptr, gint64 size, gint64 nmemb, VFSFile *file) WARN_RETURN |
Writes to a VFS stream. | |
gint | vfs_getc (VFSFile *stream) WARN_RETURN |
Reads a character from a VFS stream. | |
gint | vfs_ungetc (gint c, VFSFile *stream) WARN_RETURN |
Pushes a character back to the VFS stream. | |
gchar * | vfs_fgets (gchar *s, gint n, VFSFile *stream) WARN_RETURN |
Reads a string of characters from a stream, ending in newline or EOF. | |
gboolean | vfs_feof (VFSFile *file) WARN_RETURN |
Returns whether or not the VFS stream has reached EOF. | |
gint | vfs_fprintf (VFSFile *stream, gchar const *format,...) __attribute__((__format__(__printf__ |
gint gint | vfs_fseek (VFSFile *file, gint64 offset, gint whence) WARN_RETURN |
Performs a seek in given VFS stream. | |
void | vfs_rewind (VFSFile *file) |
Rewinds a VFS stream. | |
glong | vfs_ftell (VFSFile *file) WARN_RETURN |
Returns the current position in the VFS stream's buffer. | |
gint64 | vfs_fsize (VFSFile *file) WARN_RETURN |
Returns size of the file. | |
gint | vfs_ftruncate (VFSFile *file, gint64 length) WARN_RETURN |
Truncates a VFS stream to a certain size. | |
gboolean | vfs_fget_le16 (guint16 *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 16-bit Little Endian value from the stream into native endian format. | |
gboolean | vfs_fget_le32 (guint32 *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 32-bit Little Endian value from the stream into native endian format. | |
gboolean | vfs_fget_le64 (guint64 *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 64-bit Little Endian value from the stream into native endian format. | |
gboolean | vfs_fget_be16 (guint16 *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 16-bit Big Endian value from the stream into native endian format. | |
gboolean | vfs_fget_be32 (guint32 *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 32-bit Big Endian value from the stream into native endian format. | |
gboolean | vfs_fget_be64 (guint64 *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 64-bit Big Endian value from the stream into native endian format. | |
gboolean | vfs_fput_le16 (guint16 value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 16-bit native endian value into the stream as a Little Endian value. | |
gboolean | vfs_fput_le32 (guint32 value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value. | |
gboolean | vfs_fput_le64 (guint64 value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value. | |
gboolean | vfs_fput_be16 (guint16 value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 16-bit native endian value into the stream as a Big Endian value. | |
gboolean | vfs_fput_be32 (guint32 value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value. | |
gboolean | vfs_fput_be64 (guint64 value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value. | |
gboolean | vfs_is_streaming (VFSFile *file) WARN_RETURN |
Tests if a file is associated to streaming. | |
gchar * | vfs_get_metadata (VFSFile *file, const gchar *field) WARN_RETURN |
Returns metadata about the stream. | |
gboolean | vfs_file_test (const gchar *path, GFileTest test) WARN_RETURN |
Wrapper for g_file_test(). | |
gboolean | vfs_is_writeable (const gchar *path) WARN_RETURN |
Tests if a file is writeable. | |
gboolean | vfs_is_remote (const gchar *path) WARN_RETURN |
Tests if a path is remote uri. | |
void | vfs_file_get_contents (const gchar *filename, void **buf, gint64 *size) |
Gets contents of the file into a buffer. | |
void | vfs_register_transport (VFSConstructor *vtable) |
Registers a VFSConstructor vtable with the VFS system. |
Main API header for accessing Audacious VFS functionality.
Provides functions for VFS transport registration and file access.
Definition in file vfs.h.
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 110 of file vfs.c.
Referenced by buffered_file_vfs_fclose_impl(), file_find_decoder(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_monitor_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 254 of file vfs.c.
Referenced by buffered_file_vfs_feof_impl(), and probe_buffer_feof().
Reads an unsigned 16-bit Big Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. |
stream | A VFSFile object representing the stream. |
Definition at line 246 of file vfs_common.c.
Reads an unsigned 32-bit Big Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. |
stream | A VFSFile object representing the stream. |
Definition at line 262 of file vfs_common.c.
Reads an unsigned 64-bit Big Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. |
stream | A VFSFile object representing the stream. |
Definition at line 278 of file vfs_common.c.
Reads an unsigned 16-bit Little Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. |
stream | A VFSFile object representing the stream. |
Definition at line 197 of file vfs_common.c.
Reads an unsigned 32-bit Little Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. |
stream | A VFSFile object representing the stream. |
Definition at line 213 of file vfs_common.c.
Reads an unsigned 64-bit Little Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. |
stream | A VFSFile object representing the stream. |
Definition at line 229 of file vfs_common.c.
Reads a string of characters from a stream, ending in newline or EOF.
s | A buffer to put the string in. |
n | The amount of characters to read. |
stream | A VFSFile object representing the stream. |
Definition at line 54 of file vfs_common.c.
void vfs_file_get_contents | ( | const gchar * | filename, |
void ** | buf, | ||
gint64 * | size | ||
) |
Gets contents of the file into a buffer.
Buffer of filesize bytes is allocated by this function as necessary.
filename | URI of the file to read in. |
buf | Pointer to a pointer variable of buffer. |
size | Pointer to gsize variable that will hold the amount of read data e.g. filesize. |
Definition at line 140 of file vfs_common.c.
Referenced by vfs_async_file_get_contents_worker().
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 318 of file vfs.c.
Referenced by add_list().
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 82 of file vfs.c.
Referenced by check_opened(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_monitor_thread(), probe_buffer_new(), save_preset_file(), vfs_buffered_file_new_from_uri(), and vfs_file_get_contents().
Writes an unsigned 16-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 337 of file vfs_common.c.
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 351 of file vfs_common.c.
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 365 of file vfs_common.c.
Writes an unsigned 16-bit native endian value into the stream as a Little Endian value.
value | Value to write into the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 295 of file vfs_common.c.
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 309 of file vfs_common.c.
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 323 of file vfs_common.c.
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 138 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 208 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 284 of file vfs.c.
Referenced by buffered_file_vfs_fsize_impl(), probe_buffer_fsize(), and vfs_file_get_contents().
glong 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 239 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 155 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 300 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 170 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 381 of file vfs.c.
Referenced by check_opened().
gboolean vfs_is_writeable | ( | const gchar * | path | ) |
void vfs_register_transport | ( | VFSConstructor * | vtable | ) |
Registers a VFSConstructor vtable with the VFS system.
vtable | The VFSConstructor vtable to register. |
void vfs_rewind | ( | VFSFile * | file | ) |
Rewinds a VFS stream.
file | VFSFile object that represents the VFS stream. |
Definition at line 224 of file vfs.c.
Referenced by buffered_file_vfs_rewind_impl(), and vfs_buffered_file_new_from_uri().