From: Jo-Philipp Wich Date: Wed, 15 Feb 2017 23:01:58 +0000 (+0100) Subject: libopkg: expose abstract_pkg_fetch_by_name() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f13f4c18908c0b806abc80bac083c8cb4a76a239;p=oweals%2Fopkg-lede.git libopkg: expose abstract_pkg_fetch_by_name() 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 --- diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c index f5c0495..821cc71 100644 --- a/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c @@ -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, diff --git a/libopkg/pkg_hash.h b/libopkg/pkg_hash.h index d879278..e72ffed 100644 --- a/libopkg/pkg_hash.h +++ b/libopkg/pkg_hash.h @@ -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,