From 0c01a8129996bae13ccfcdda9f14a5c9a97c6708 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 22 Jan 2017 23:26:01 -0600 Subject: [PATCH] libpkgconf: split virtual/static package state (this is API/ABI safe, static packages are always treated as virtual when it comes to mutation) --- libpkgconf/libpkgconf.h | 11 ++++++----- libpkgconf/pkg.c | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libpkgconf/libpkgconf.h b/libpkgconf/libpkgconf.h index a32eb0b..b58390e 100644 --- a/libpkgconf/libpkgconf.h +++ b/libpkgconf/libpkgconf.h @@ -96,11 +96,12 @@ struct pkgconf_path_ { void *handle_device; }; -#define PKGCONF_PKG_PROPF_NONE 0x0 -#define PKGCONF_PKG_PROPF_VIRTUAL 0x1 -#define PKGCONF_PKG_PROPF_CACHED 0x2 -#define PKGCONF_PKG_PROPF_SEEN 0x4 -#define PKGCONF_PKG_PROPF_UNINSTALLED 0x8 +#define PKGCONF_PKG_PROPF_NONE 0x00 +#define PKGCONF_PKG_PROPF_STATIC 0x01 +#define PKGCONF_PKG_PROPF_CACHED 0x02 +#define PKGCONF_PKG_PROPF_SEEN 0x04 +#define PKGCONF_PKG_PROPF_UNINSTALLED 0x08 +#define PKGCONF_PKG_PROPF_VIRTUAL 0x10 struct pkgconf_pkg_ { pkgconf_node_t cache_iter; diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index d84427a..439b939 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -331,7 +331,7 @@ pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *filename, void pkgconf_pkg_free(pkgconf_client_t *client, pkgconf_pkg_t *pkg) { - if (pkg == NULL || pkg->flags & PKGCONF_PKG_PROPF_VIRTUAL) + if (pkg == NULL || pkg->flags & PKGCONF_PKG_PROPF_STATIC) return; pkgconf_cache_remove(client, pkg); @@ -768,7 +768,7 @@ static pkgconf_pkg_t pkg_config_virtual = { .description = "virtual package defining pkg-config API version supported", .url = PACKAGE_BUGREPORT, .version = PACKAGE_VERSION, - .flags = PKGCONF_PKG_PROPF_VIRTUAL, + .flags = PKGCONF_PKG_PROPF_STATIC, .vars = { .head = &(pkgconf_node_t){ .prev = NULL, @@ -788,7 +788,7 @@ static pkgconf_pkg_t pkgconf_virtual = { .description = "virtual package defining pkgconf API version supported", .url = PACKAGE_BUGREPORT, .version = PACKAGE_VERSION, - .flags = PKGCONF_PKG_PROPF_VIRTUAL, + .flags = PKGCONF_PKG_PROPF_STATIC, .vars = { .head = &(pkgconf_node_t){ .prev = NULL,