Add lookup to create modules list from alias

We return a kmod_list when searching for an alias. Right now, it only
search for aliases in config files.

To use it, we create a list:
	list = NULL;
	kmod_module_new_from_lookup(..., &list);

And iterate over it to get the modules and their details:

	kmod_list_foreach(l, list) {
		struct kmod_mod *mod = kmod_module_get_module(l);
		...
		... kmod_module_get_name(mod);
		... kmod_module_get_path(mod);
	}

Aliases might contain globs and are match by using fnmatch().
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 889874c..7466805 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -33,6 +33,7 @@
 
 #include "libkmod.h"
 #include "libkmod-private.h"
+//#include "libkmod-index.h"
 
 /**
  * kmod_module:
@@ -152,6 +153,40 @@
 	return mod;
 }
 
+KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
+						const char *alias,
+						struct kmod_list **list)
+{
+
+	int err;
+
+	if (ctx == NULL || alias == NULL)
+		return -ENOENT;
+
+
+	if (list == NULL || *list != NULL) {
+		ERR(ctx, "An empty list is needed to create lookup\n");
+		return -ENOSYS;
+	}
+
+	err = kmod_lookup_alias_from_config(ctx, alias, list);
+
+	if (err < 0) {
+		kmod_module_unref_list(*list);
+		*list = NULL;
+	}
+
+	return err;
+}
+
+KMOD_EXPORT int kmod_module_unref_list(struct kmod_list *list)
+{
+	for (; list != NULL; list = kmod_list_remove(list))
+		kmod_module_unref(list->data);
+
+	return 0;
+}
+
 KMOD_EXPORT struct kmod_module *kmod_module_get_module(struct kmod_list *l)
 {
 	struct kmod_module *mod = l->data;