]>
git.ipfire.org Git - thirdparty/kmod.git/blob - test/test-get-dependencies.c
11 int main(int argc
, char *argv
[])
15 struct kmod_module
*mod
;
16 struct kmod_list
*list
, *l
;
19 printf("libkmod version %s\n", VERSION
);
22 fprintf(stderr
, "ERR: Provide a module name\n");
28 ctx
= kmod_new(NULL
, NULL
);
32 err
= kmod_module_new_from_name(ctx
, name
, &mod
);
38 list
= kmod_module_get_dependencies(mod
);
39 printf("Module: %s\nDependency list:\n", name
);
41 kmod_list_foreach(l
, list
) {
42 struct kmod_module
*m
= kmod_module_get_module(l
);
43 printf("\t%s\n", kmod_module_get_name(m
));
47 kmod_module_unref_list(list
);
48 kmod_module_unref(mod
);