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

vfs.h File Reference


Detailed Description

Virtual filesystem.

Definition in file vfs.h.

Go to the source code of this file.

Classes

struct  vfsent
 A VFS entity is an object representing a single file or directory on disk. Each VFS entity is handled by some kind of VFS module. By default, a VFS entity only contains the filename and a reference count. It must be manually populated to get its actual contents. More...
struct  vfslist
 List structure that can contain a lot of VFS references. More...
struct  vfsmatch
 Compiled regular expression or string matching data. More...
struct  vfsmodule
 Module representing a type of file or directory on disk, containing functions to read its contents (populate it). More...
struct  vfsref
 Reference to a VFS entity including list pointers. More...

Defines

#define VFS_LIST_FOREACH(vl, vr)   for (vr = vfs_list_first(vl); vr != NULL; vr = vfs_list_next(vr))
 Loop through all items in the VFS list.
#define VFS_LIST_FOREACH_REVERSE(vl, vr)   for (vr = vfs_list_last(vl); vr != NULL; vr = vfs_list_prev(vr))
 Reverse loop through all items in the VFS list.
#define VFSLIST_INITIALIZER   { NULL, NULL, 0 }
 Contents of an empty VFS list structure.

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.
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.
static const char * vfs_filename (const struct vfsref *vr)
 Get the full pathname of the current VFS reference.
FILE * vfs_fopen (const char *filename, const char *mode)
 fopen()-like routine that uses VFS path expansino.
static FILE * vfs_handle (const struct vfsref *vr)
 Open a new filehandle to the entity.
static int vfs_list_empty (const struct vfslist *vl)
 Return whether the VFS list is empty or not.
static struct vfsrefvfs_list_first (const struct vfslist *vl)
 Return the first item in a VFS list.
static void vfs_list_init (struct vfslist *vl)
 Run-time initialize a VFS list structure.
static void vfs_list_insert_after (struct vfslist *vl, struct vfsref *nvr, struct vfsref *lvr)
 Insert the VFS reference after another one in the VFS list.
static void vfs_list_insert_before (struct vfslist *vl, struct vfsref *nvr, struct vfsref *lvr)
 Insert the VFS reference before another one in the VFS list.
static void vfs_list_insert_head (struct vfslist *vl, struct vfsref *vr)
 Insert the VFS reference at the head of the VFS list.
static void vfs_list_insert_tail (struct vfslist *vl, struct vfsref *vr)
 Insert the VFS reference at the tail of the VFS list.
static unsigned int vfs_list_items (const struct vfslist *vl)
 Return the amount of items in the VFS list.
static struct vfsrefvfs_list_last (const struct vfslist *vl)
 Return the last item in a VFS list.
static void vfs_list_move (struct vfslist *vdst, struct vfslist *vsrc)
 Move the contents of one list to another.
static struct vfsrefvfs_list_next (const struct vfsref *vr)
 Return the next item in the VFS list.
static struct vfsrefvfs_list_prev (const struct vfsref *vr)
 Return the preivous item in the VFS list.
static void vfs_list_remove (struct vfslist *vl, struct vfsref *vr)
 Remove the VFS reference from the VFS list.
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.
static void vfs_mark (struct vfsref *vr)
 Mark the current reference.
static int vfs_marked (const struct vfsref *vr)
 Return whether the current reference is marked.
static char vfs_marking (const struct vfsref *vr)
 Get the character that should be used to mark the file with in the filebrowser.
static int vfs_match_compare (const struct vfsmatch *vm, const char *name)
 Match a VFS reference with a regular expression.
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.
static const char * vfs_match_value (const struct vfsmatch *vm)
 Return the search string that the user has entered.
static const char * vfs_name (const struct vfsref *vr)
 Get the friendly name of the current VFS reference.
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 int vfs_playable (const struct vfsref *vr)
 Determine if a VFS entity is playable audio.
static int vfs_populatable (const struct vfsref *vr)
 Determine if the VFS entity can have population.
int vfs_populate (const struct vfsref *vr)
 Populate the VFS entity with references to its children.
static struct vfslistvfs_population (const struct vfsref *vr)
 Return a pointer to the VFS list inside the VFS reference.
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.
static void vfs_unmark (struct vfsref *vr)
 Unmark the current reference.
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.


Generated by  Doxygen 1.6.0   Back to index