X-Git-Url: http://git.draconx.ca/gitweb/upkg.git/blobdiff_plain/0a55ae84545c5e5a45e2240c06bd77a1917f7d3e..aa3d8014ba02b49656689d1b4951ea79de76a414:/src/uobject/vfs.h diff --git a/src/uobject/vfs.h b/src/uobject/vfs.h index d986aec..bc835a7 100644 --- a/src/uobject/vfs.h +++ b/src/uobject/vfs.h @@ -18,6 +18,8 @@ #ifndef U_OBJECT_VFS_H_ #define U_OBJECT_VFS_H_ +#include + /* * Insert a local package to the VFS. A "local package" is an explicit * association of a name to a file, and thus can be located outside the normal @@ -35,9 +37,23 @@ const char *u_pkg_vfs_add_local(const char *name, const char *file); void u_pkg_vfs_del_local(const char *name); /* - * Find a package by name in the VFS. Names are case-insensitive. + * Opens a package file by name. First, local packages are searched for a + * match. If a local match is found, the global search path is never + * consulted. If no local match is found, the directories in the global search + * path are examined, in order. + * + * When searching the global search path, the first file found which both + * matches the given name and can be opened successfully is used. A file + * foo.EXT matches the name if foo is equal to name (without regard to case) + * and EXT is one of u, utx, uax, umx or unr. If multiple extensions + * are valid, they are tried in this order. + * + * Note that the particular file extension used does not make any difference + * as to what sort of objects can be contained in a package. + * + * Returns the opened package on success, or NULL on failure. */ -const char *u_pkg_vfs_lookup(const char *name); +struct upkg *u_pkg_vfs_open_by_name(const char *name); /* * Initialize the UObject VFS system. Returns 0 on success, -1 otherwise.