libopkg: expose abstract_pkg_fetch_by_name()
authorJo-Philipp Wich <jo@mein.io>
Wed, 15 Feb 2017 23:01:58 +0000 (00:01 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 16:02:30 +0000 (17:02 +0100)
We need this function in other places later in order to be able to fetch
abstract packages without implicitely creating them.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg_hash.c
libopkg/pkg_hash.h

index f5c0495..821cc71 100644 (file)
@@ -221,11 +221,6 @@ int pkg_hash_load_status_files(void)
        return 0;
 }
 
-static abstract_pkg_t *abstract_pkg_fetch_by_name(const char *pkg_name)
-{
-       return (abstract_pkg_t *) hash_table_get(&conf->pkg_hash, pkg_name);
-}
-
 pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
                                                  int (*constraint_fcn) (pkg_t *
                                                                         pkg,
index d879278..e72ffed 100644 (file)
@@ -36,6 +36,11 @@ int pkg_hash_load_status_files(void);
 
 void hash_insert_pkg(pkg_t * pkg, int set_status);
 
+static inline abstract_pkg_t *abstract_pkg_fetch_by_name(const char *pkg_name)
+{
+   return (abstract_pkg_t *) hash_table_get(&conf->pkg_hash, pkg_name);
+}
+
 abstract_pkg_t *ensure_abstract_pkg_by_name(const char *pkg_name);
 void pkg_hash_fetch_all_installed(pkg_vec_t * installed);
 pkg_t *pkg_hash_fetch_by_name_version(const char *pkg_name,