Audacious
$Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
Main API header for accessing Audacious VFS functionality. More...
Go to the source code of this file.
Classes | |
struct | _VFSConstructor |
VFSConstructor objects contain the base vtables used for extrapolating a VFS stream. More... | |
Macros | |
#define | VFS_IS_REGULAR (1 << 0) |
#define | VFS_IS_SYMLINK (1 << 1) |
#define | VFS_IS_DIR (1 << 2) |
#define | VFS_IS_EXECUTABLE (1 << 3) |
#define | VFS_EXISTS (1 << 4) |
#define | WARN_RETURN |
Typedefs | |
typedef const struct _VFSConstructor | VFSConstructor |
Functions | |
VFSFile * | vfs_new (const char *path, VFSConstructor *vtable, void *handle) WARN_RETURN |
const char * | vfs_get_filename (VFSFile *file) WARN_RETURN |
void * | vfs_get_handle (VFSFile *file) WARN_RETURN |
VFSFile * | vfs_fopen (const char *path, const char *mode) WARN_RETURN |
Opens a stream from a VFS transport using one of the registered VFSConstructor handlers. More... | |
int | vfs_fclose (VFSFile *file) |
Closes a VFS stream and destroys a VFSFile object. More... | |
int64_t | vfs_fread (void *ptr, int64_t size, int64_t nmemb, VFSFile *file) WARN_RETURN |
Reads from a VFS stream. More... | |
int64_t | vfs_fwrite (const void *ptr, int64_t size, int64_t nmemb, VFSFile *file) WARN_RETURN |
Writes to a VFS stream. More... | |
int | vfs_getc (VFSFile *stream) WARN_RETURN |
Reads a character from a VFS stream. More... | |
int | vfs_ungetc (int c, VFSFile *stream) WARN_RETURN |
Pushes a character back to the VFS stream. More... | |
char * | vfs_fgets (char *s, int n, VFSFile *stream) WARN_RETURN |
Reads a string of characters from a stream, ending in newline or EOF. More... | |
int | vfs_fputs (const char *s, VFSFile *stream) WARN_RETURN |
Writes a string to a VFS stream. More... | |
bool_t | vfs_feof (VFSFile *file) WARN_RETURN |
Returns whether or not the VFS stream has reached EOF. More... | |
int | vfs_fprintf (VFSFile *stream, char const *format,...) __attribute__((__format__(__printf__ |
int int | vfs_fseek (VFSFile *file, int64_t offset, int whence) WARN_RETURN |
Performs a seek in given VFS stream. More... | |
void | vfs_rewind (VFSFile *file) |
Rewinds a VFS stream. More... | |
int64_t | vfs_ftell (VFSFile *file) WARN_RETURN |
Returns the current position in the VFS stream's buffer. More... | |
int64_t | vfs_fsize (VFSFile *file) WARN_RETURN |
Returns size of the file. More... | |
int | vfs_ftruncate (VFSFile *file, int64_t length) WARN_RETURN |
Truncates a VFS stream to a certain size. More... | |
bool_t | vfs_fget_le16 (uint16_t *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 16-bit Little Endian value from the stream into native endian format. More... | |
bool_t | vfs_fget_le32 (uint32_t *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 32-bit Little Endian value from the stream into native endian format. More... | |
bool_t | vfs_fget_le64 (uint64_t *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 64-bit Little Endian value from the stream into native endian format. More... | |
bool_t | vfs_fget_be16 (uint16_t *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 16-bit Big Endian value from the stream into native endian format. More... | |
bool_t | vfs_fget_be32 (uint32_t *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 32-bit Big Endian value from the stream into native endian format. More... | |
bool_t | vfs_fget_be64 (uint64_t *value, VFSFile *stream) WARN_RETURN |
Reads an unsigned 64-bit Big Endian value from the stream into native endian format. More... | |
bool_t | vfs_fput_le16 (uint16_t value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 16-bit native endian value into the stream as a Little Endian value. More... | |
bool_t | vfs_fput_le32 (uint32_t value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value. More... | |
bool_t | vfs_fput_le64 (uint64_t value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value. More... | |
bool_t | vfs_fput_be16 (uint16_t value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 16-bit native endian value into the stream as a Big Endian value. More... | |
bool_t | vfs_fput_be32 (uint32_t value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value. More... | |
bool_t | vfs_fput_be64 (uint64_t value, VFSFile *stream) WARN_RETURN |
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value. More... | |
bool_t | vfs_is_streaming (VFSFile *file) WARN_RETURN |
Tests if a file is associated to streaming. More... | |
char * | vfs_get_metadata (VFSFile *file, const char *field) WARN_RETURN |
Returns metadata about the stream. More... | |
bool_t | vfs_file_test (const char *path, int test) WARN_RETURN |
Wrapper for g_file_test(). More... | |
bool_t | vfs_is_writeable (const char *path) WARN_RETURN |
Tests if a file is writeable. More... | |
bool_t | vfs_is_remote (const char *path) WARN_RETURN |
Tests if a path is remote uri. More... | |
void | vfs_file_get_contents (const char *filename, void **buf, int64_t *size) |
Gets contents of the file into a buffer. More... | |
void | vfs_set_lookup_func (VFSConstructor *(*func)(const char *scheme)) |
void | vfs_set_verbose (bool_t verbose) |
Main API header for accessing Audacious VFS functionality.
Provides functions for VFS transport registration and file access.
Definition in file vfs.h.
#define VFS_EXISTS (1 << 4) |
Definition at line 39 of file vfs.h.
Referenced by vfs_file_test().
#define VFS_IS_DIR (1 << 2) |
Definition at line 37 of file vfs.h.
Referenced by vfs_file_test().
#define VFS_IS_EXECUTABLE (1 << 3) |
Definition at line 38 of file vfs.h.
Referenced by vfs_file_test().
#define VFS_IS_REGULAR (1 << 0) |
Definition at line 35 of file vfs.h.
Referenced by vfs_file_test().
#define VFS_IS_SYMLINK (1 << 1) |
Definition at line 36 of file vfs.h.
Referenced by vfs_file_test().
typedef const struct _VFSConstructor VFSConstructor |
Closes a VFS stream and destroys a VFSFile object.
file | A VFSFile object to destroy. |
Definition at line 164 of file vfs.c.
Referenced by file_find_decoder(), file_read_image(), file_read_tuple(), file_write_tuple(), playback_cleanup(), 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 333 of file vfs.c.
Referenced by 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 255 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 271 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 287 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 206 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 222 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 238 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 63 of file vfs_common.c.
void vfs_file_get_contents | ( | const char * | filename, |
void ** | buf, | ||
int64_t * | 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 149 of file vfs_common.c.
Referenced by art_get_data_real(), and vfs_async_file_get_contents_worker().
Wrapper for g_file_test().
path | A path to test. |
test | A GFileTest to run. |
Definition at line 406 of file vfs.c.
Referenced by add_generic(), and playlist_remove_failed().
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 122 of file vfs.c.
Referenced by 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().
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 346 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 360 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 374 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 304 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 318 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 332 of file vfs_common.c.
Writes a string to a VFS stream.
s | A string to write to the stream. |
stream | A VFSFile object representing the stream. |
Definition at line 95 of file vfs_common.c.
Referenced by vfs_vfprintf().
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 193 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 277 of file vfs.c.
Referenced by import_winamp_eqf(), and probe_func().
int64_t vfs_fsize | ( | VFSFile * | file | ) |
Returns size of the file.
file | VFSFile object that represents the VFS stream. |
Definition at line 368 of file vfs.c.
Referenced by probe_buffer_fsize(), vfs_file_get_contents(), and vfs_is_streaming().
int64_t vfs_ftell | ( | VFSFile * | file | ) |
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 215 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().
const char* vfs_get_filename | ( | VFSFile * | file | ) |
Definition at line 103 of file vfs.c.
Referenced by import_winamp_eqf().
void* vfs_get_handle | ( | VFSFile * | file | ) |
Definition at line 108 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().
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 388 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 235 of file vfs.c.
Referenced by vfs_fgets().
bool_t vfs_is_remote | ( | const char * | path | ) |
bool_t vfs_is_writeable | ( | const char * | path | ) |
VFSFile* vfs_new | ( | const char * | path, |
VFSConstructor * | vtable, | ||
void * | handle | ||
) |
Definition at line 93 of file vfs.c.
Referenced by probe_buffer_new(), and vfs_fopen().
void vfs_rewind | ( | VFSFile * | file | ) |
Rewinds a VFS stream.
file | VFSFile object that represents the VFS stream. |
Definition at line 297 of file vfs.c.
Referenced by playback_thread().
void vfs_set_lookup_func | ( | VFSConstructor *(*)(const char *scheme) | func | ) |
Definition at line 54 of file vfs.c.
Referenced by start_plugins_one(), and stop_plugins_one().
void vfs_set_verbose | ( | bool_t | verbose | ) |
Definition at line 61 of file vfs.c.
Referenced by init_two().