Add fucntion to API to get dependencies

This commit is contained in:
Lucas De Marchi 2011-12-01 20:06:08 -02:00
parent c11e62bfd4
commit 0835fc3bf9
4 changed files with 16 additions and 0 deletions

5
TODO
View File

@ -23,3 +23,8 @@ Features:
* when preloading stuff, give the possibility to preload binary files. We need
to create alternative index_search* functions to operate on mmapped files.
Then on ctx creation we mmap all the files
* kmod_module: calculate fields on demand if not available:
- name
- path
- dependency

View File

@ -259,6 +259,15 @@ KMOD_EXPORT int kmod_module_unref_list(struct kmod_list *list)
return 0;
}
/*
* We don't increase the refcount. Maybe we should.
*/
KMOD_EXPORT struct kmod_list *kmod_module_get_dependency(struct kmod_module *mod)
{
// FIXME calculate dependency if it's not initialized
return mod->dep;
}
KMOD_EXPORT struct kmod_module *kmod_module_get_module(struct kmod_list *l)
{
struct kmod_module *mod = l->data;

View File

@ -109,6 +109,7 @@ struct kmod_module *kmod_module_ref(struct kmod_module *mod);
struct kmod_module *kmod_module_unref(struct kmod_module *mod);
int kmod_module_unref_list(struct kmod_list *list);
struct kmod_module *kmod_module_get_module(struct kmod_list *l);
struct kmod_list *kmod_module_get_dependency(struct kmod_module *mod);
int kmod_module_remove_module(struct kmod_module *mod, unsigned int flags);
int kmod_module_insert_module(struct kmod_module *mod, unsigned int flags);

View File

@ -27,6 +27,7 @@ global:
kmod_module_remove_module;
kmod_module_insert_module;
kmod_module_get_dependency;
kmod_module_get_module;
kmod_module_get_name;