Logo Search packages:      
Sourcecode: herrie version File versions  Download package

vfs.c File Reference


Detailed Description

Virtual filesystem.

Definition in file vfs.c.

#include "stdinc.h"
#include "config.h"
#include "vfs.h"
#include "vfs_modules.h"

Go to the source code of this file.

Classes

struct  vfswriter
 Playlist writing module object. Matching is performed by extension. More...

Defines

#define NUM_MODULES   (sizeof(modules) / sizeof(struct vfsmodule))
 The number of virtual file system modules currently available in the application.
#define NUM_WRITERS   (sizeof(writers) / sizeof(struct vfswriter))
 The number of VFS writing modules currently available in the application.

Functions

void vfs_close (struct vfsref *vr)
 Decrease the reference count of the entity and deallocate the entity when no references are left. The reference itself is also deallocated.
static void vfs_dealloc (struct vfsent *ve)
 Deallocates the data structures for a VFS entity.
int vfs_delete (const char *filename)
 Delete a local file. Use with caution. ;-).
struct vfsrefvfs_dup (const struct vfsref *vr)
 Duplicate the reference by increasing the reference count.
int vfs_fgets (char *str, size_t size, FILE *fp)
 fgets()-like routine that performs newline-stripping.
FILE * vfs_fopen (const char *filename, const char *mode)
 fopen()-like routine that uses VFS path expansino.
void vfs_locate (struct vfslist *vl, const struct vfsref *vr, const struct vfsmatch *vm)
 Recursively search through a VFS reference and add all matching objects to a list. The VFS reference itself will be excluded from the results.
const char * vfs_lockup (void)
 Try to lock the application in a specified directory on startup. This function returns an error message.
void vfs_match_free (struct vfsmatch *vm)
 Deallocate a compiled regular expression.
struct vfsmatchvfs_match_new (const char *str)
 Compile a regular expression for matching.
struct vfsrefvfs_open (const char *filename, const char *name, const char *basepath, int strict)
 Create a VFS reference from a filename. The name argument is optional. It only allows you to display entities with a different name (inside playlists). When setting the basepath variable, all relative pathnames are appended to the basepath. When unset, it can only open absolute filenames. When forcing strict pathnames, application-implemented features like ~ are discarded.
static char * vfs_path_concat (const char *dir, const char *file, int strict)
 Concatenate a path- and filename. The resulting filename will not contain /./'s and /../'s.
int vfs_populate (const struct vfsref *vr)
 Populate the VFS entity with references to its children.
void vfs_unfold (struct vfslist *vl, const struct vfsref *vr)
 Recursively expand a VFS reference to all their usable children and append them to the specified list.
struct vfsrefvfs_write_playlist (const struct vfslist *vl, const struct vfsref *vr, const char *filename)
 Write a VFS list to a PLS file on disk.

Variables

static struct vfsmodule modules []
 List of available virtual filesystem modules and their options and functions.
static struct vfswriter writers []
 List of VFS writing modules. The first item in the list is used when no matching extension was found. In that case, the extension of the first item will be appended to the filename.


Generated by  Doxygen 1.6.0   Back to index