Virtual filesystem. More...

Go to the source code of this file.
Data Structures | |
| struct | vfslist |
| List structure that can contain a lot of VFS references. More... | |
| struct | vfsmodule |
| Module representing a type of file or directory on disk, containing functions to read its contents (populate it). More... | |
| 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 | vfsref |
| Reference to a VFS entity including list pointers. More... | |
| struct | vfsmatch |
| Compiled regular expression or string matching data. More... | |
Defines | |
| #define | VFSLIST_INITIALIZER { NULL, NULL, 0 } |
| Contents of an empty VFS list structure. | |
| #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. | |
Functions | |
| static void | vfs_list_init (struct vfslist *vl) |
| Run-time initialize a VFS list structure. | |
| static void | vfs_list_move (struct vfslist *vdst, const struct vfslist *vsrc) |
| Move the contents of one list to another. | |
| static struct vfsref * | vfs_list_first (const struct vfslist *vl) |
| Return the first item in a VFS list. | |
| static struct vfsref * | vfs_list_last (const struct vfslist *vl) |
| Return the last item in a VFS list. | |
| static int | vfs_list_empty (const struct vfslist *vl) |
| Return whether the VFS list is empty or not. | |
| static unsigned int | vfs_list_items (const struct vfslist *vl) |
| Return the amount of items in the VFS list. | |
| static struct vfsref * | vfs_list_next (const struct vfsref *vr) |
| Return the next item in the VFS list. | |
| static struct vfsref * | vfs_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. | |
| 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 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_after (struct vfslist *vl, struct vfsref *nvr, struct vfsref *lvr) |
| Insert the VFS reference after another one in the VFS list. | |
| const char * | vfs_lockup (void) |
| Try to lock the application in a specified directory on startup. This function returns an error message. | |
| struct vfsref * | vfs_lookup (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. | |
| struct vfsref * | vfs_dup (const struct vfsref *vr) |
| Duplicate the reference by increasing the reference count. | |
| 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_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. | |
| 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. | |
| struct vfsref * | vfs_write_playlist (const struct vfslist *vl, const struct vfsref *vr, const char *filename) |
| Write a VFS list to a PLS file on disk. | |
| int | vfs_delete (const char *filename) |
| Delete a local file. Use with caution. ;-). | |
| FILE * | vfs_fopen (const char *filename, const char *mode) |
| fopen()-like routine that uses VFS path expansion. | |
| int | vfs_fgets (char *str, size_t size, FILE *fp) |
| fgets()-like routine that performs newline-stripping. | |
| static const char * | vfs_name (const struct vfsref *vr) |
| Get the friendly name of the current VFS reference. | |
| static const char * | vfs_filename (const struct vfsref *vr) |
| Get the full pathname of the current VFS reference. | |
| static int | vfs_playable (const struct vfsref *vr) |
| Determine if a VFS entity is playable audio. | |
| static FILE * | vfs_open (const struct vfsref *vr) |
| Open a new filehandle to the entity. | |
| static int | vfs_populatable (const struct vfsref *vr) |
| Determine if the VFS entity can have population. | |
| static char | vfs_marking (const struct vfsref *vr) |
| Get the character that should be used to mark the file with in the filebrowser. | |
| static struct vfslist * | vfs_population (const struct vfsref *vr) |
| Return a pointer to the VFS list inside the VFS reference. | |
| static int | vfs_marked (const struct vfsref *vr) |
| Return whether the current reference is marked. | |
| static void | vfs_mark (struct vfsref *vr) |
| Mark the current reference. | |
| static void | vfs_unmark (struct vfsref *vr) |
| Unmark the current reference. | |
| struct vfsmatch * | vfs_match_new (const char *str) |
| Compile a regular expression for matching. | |
| void | vfs_match_free (struct vfsmatch *vm) |
| Deallocate a compiled regular expression. | |
| static int | vfs_match_compare (const struct vfsmatch *vm, const char *name) |
| Match a VFS reference with a regular expression. | |
| static const char * | vfs_match_value (const struct vfsmatch *vm) |
| Return the search string that the user has entered. | |
Virtual filesystem.
Definition in file vfs.h.
1.6.3