#include <strings.h>
#include <uobject/vfs.h>
+#include <upkg.h>
#include <ltdl.h>
#include "avl.h"
free(item);
}
-const char *u_pkg_vfs_lookup(const char *name)
+struct upkg *u_pkg_vfs_open_by_name(const char *name)
{
struct local_pkg spec = { .name = (char *)name }, *item;
- if (!local_tree)
+ if (!initialized)
return NULL;
item = avl_find(local_tree, &spec);
- if (!item)
- return NULL;
- return item->file;
+ if (item)
+ return upkg_fopen(item->file);
+ return NULL;
}
int u_pkg_vfs_init(void)