libpkgconf: split virtual/static package state (this is API/ABI safe, static packages are always treated as virtual when it comes to mutation)

feature/tap-sh
William Pitcock 2017-01-22 23:26:01 -06:00
parent 987cf94a7f
commit 0c01a81299
2 changed files with 9 additions and 8 deletions

View File

@ -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;

View File

@ -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,