309
VFSFile * daap_aud_vfs_fopen_impl(const gchar * path, const gchar * mode)
309
VFSFile * daap_vfs_fopen_impl(const gchar * path, const gchar * mode)
311
311
VFSFile *file=NULL;
312
312
daap_handle_t *handle = g_new0(daap_handle_t, 1);
366
size_t daap_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
366
size_t daap_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
368
368
daap_handle_t *handle= (daap_handle_t *)file->handle;
381
size_t daap_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
381
size_t daap_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
386
gint daap_aud_vfs_getc_impl(VFSFile * file)
386
gint daap_vfs_getc_impl(VFSFile * file)
389
389
daap_handle_t *handle = (daap_handle_t *)file->handle;
404
gint daap_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
404
gint daap_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
409
gint daap_aud_vfs_ungetc_impl(gint c, VFSFile * stream)
409
gint daap_vfs_ungetc_impl(gint c, VFSFile * stream)
414
void daap_aud_vfs_rewind_impl(VFSFile * stream)
414
void daap_vfs_rewind_impl(VFSFile * stream)
419
glong daap_aud_vfs_ftell_impl(VFSFile * stream)
419
glong daap_vfs_ftell_impl(VFSFile * stream)
421
421
daap_handle_t *handle=stream->handle;
422
422
return handle->pos;
425
gboolean daap_aud_vfs_feof_impl(VFSFile * file)
425
gboolean daap_vfs_feof_impl(VFSFile * file)
427
427
daap_handle_t *handle=file->handle;
428
off_t at = daap_aud_vfs_ftell_impl(file);
428
off_t at = daap_vfs_ftell_impl(file);
429
429
return (gboolean) (at >= handle->length) ? TRUE : FALSE;
432
gint daap_aud_vfs_truncate_impl(VFSFile * file, glong size)
432
gint daap_vfs_truncate_impl(VFSFile * file, glong size)
436
off_t daap_aud_vfs_fsize_impl(VFSFile * file)
436
off_t daap_vfs_fsize_impl(VFSFile * file)
441
gchar *daap_aud_vfs_metadata_impl(VFSFile * file, const gchar * field)
441
gchar *daap_vfs_metadata_impl(VFSFile * file, const gchar * field)
443
443
daap_handle_t *handle;
444
444
g_print("Requested metadata: '%s' \n",field);
463
463
VFSConstructor daap_const = {
465
daap_aud_vfs_fopen_impl,
466
daap_aud_vfs_fclose_impl,
467
daap_aud_vfs_fread_impl,
468
daap_aud_vfs_fwrite_impl,
469
daap_aud_vfs_getc_impl,
470
daap_aud_vfs_ungetc_impl,
471
daap_aud_vfs_fseek_impl,
472
daap_aud_vfs_rewind_impl,
473
daap_aud_vfs_ftell_impl,
474
daap_aud_vfs_feof_impl,
475
daap_aud_vfs_truncate_impl,
476
daap_aud_vfs_fsize_impl,
477
daap_aud_vfs_metadata_impl
466
daap_vfs_fclose_impl,
468
daap_vfs_fwrite_impl,
470
daap_vfs_ungetc_impl,
472
daap_vfs_rewind_impl,
475
daap_vfs_truncate_impl,
477
daap_vfs_metadata_impl
480
480
static void init(void)
482
482
mutex_init = g_mutex_new();
483
483
mutex_discovery = g_mutex_new();
484
aud_vfs_register_transport(&daap_const);
484
vfs_register_transport(&daap_const);
485
485
daap_mdns_initialize ();
486
486
if (!login_sessions)
487
487
login_sessions = g_hash_table_new (g_str_hash, g_str_equal);