struct vfsref* vfs_write_playlist ( const struct vfslist vl,
const struct vfsref vr,
const char *  filename 
) [read]

Write a VFS list to a PLS file on disk.

Definition at line 405 of file vfs.c.

00407 {
00408         const char *base = NULL;
00409         char *fn, *nfn;
00410         struct vfsref *rvr = NULL;
00411         struct vfswriter *wr;
00412         unsigned int i;
00413 
00414         if (vr != NULL)
00415                 base = vfs_filename(vr);
00416         fn = vfs_path_concat(base, filename, 0);
00417         if (fn == NULL)
00418                 return (NULL);
00419         
00420         /* Search for a matching extension */
00421         for (i = 0; i < NUM_WRITERS; i++) {
00422                 if (g_str_has_suffix(fn, writers[i].ext)) {
00423                         wr = &writers[i];
00424                         goto match;
00425                 }
00426         }
00427 
00428         /* No extension matched, use default format */
00429         wr = &writers[0];
00430         nfn = g_strdup_printf("%s%s", fn, wr->ext);
00431         g_free(fn);
00432         fn = nfn;
00433 match:
00434         /* Write the playlist to disk */
00435         if (wr->write(vl, fn) == 0)
00436                 rvr = vfs_lookup(fn, NULL, NULL, 0);
00437 
00438         g_free(fn);
00439         return (rvr);
00440 }

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:54 2010 for herrie by  doxygen 1.6.3