2 * Functions for handling UObject package search paths.
3 * Copyright (C) 2009 Nick Bowler
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef U_OBJECT_VFS_H_
19 #define U_OBJECT_VFS_H_
22 * Insert a local package to the VFS. A "local package" is an explicit
23 * association of a name to a file, and thus can be located outside the normal
24 * search path. Local packages are searched before any other location.
26 * Returns a pointer to an internal copy of name on success, or NULL on
27 * failure. The returned name must not be modified or freed. If name is
28 * NULL, it is determined automatically from the filename.
30 const char *u_pkg_vfs_add_local(const char *name, const char *file);
33 * Remove a local package from the VFS by name.
35 void u_pkg_vfs_del_local(const char *name);
38 * Find a package by name in the VFS. Names are case-insensitive.
40 const char *u_pkg_vfs_lookup(const char *name);
43 * Initialize the UObject VFS system. Returns 0 on success, -1 otherwise.
44 * The VFS system can be safely initialized multiple times.
46 int u_pkg_vfs_init(void);
49 * Shutdown the UObject VFS system.
50 * The VFS system is only shut down when this function has been called as
51 * many times as u_pkg_vfs_init.
53 void u_pkg_vfs_exit(void);