1*a3cefe7fSPierre Pronchery 2*a3cefe7fSPierre Proncherylibpkgconf `cache` module 3*a3cefe7fSPierre Pronchery========================= 4*a3cefe7fSPierre Pronchery 5*a3cefe7fSPierre ProncheryThe libpkgconf `cache` module manages a package/module object cache, allowing it to 6*a3cefe7fSPierre Proncheryavoid loading duplicate copies of a package/module. 7*a3cefe7fSPierre Pronchery 8*a3cefe7fSPierre ProncheryA cache is tied to a specific pkgconf client object, so package objects should not 9*a3cefe7fSPierre Proncherybe shared across threads. 10*a3cefe7fSPierre Pronchery 11*a3cefe7fSPierre Pronchery.. c:function:: pkgconf_pkg_t *pkgconf_cache_lookup(const pkgconf_client_t *client, const char *id) 12*a3cefe7fSPierre Pronchery 13*a3cefe7fSPierre Pronchery Looks up a package in the cache given an `id` atom, 14*a3cefe7fSPierre Pronchery such as ``gtk+-3.0`` and returns the already loaded version 15*a3cefe7fSPierre Pronchery if present. 16*a3cefe7fSPierre Pronchery 17*a3cefe7fSPierre Pronchery :param pkgconf_client_t* client: The client object to access. 18*a3cefe7fSPierre Pronchery :param char* id: The package atom to look up in the client object's cache. 19*a3cefe7fSPierre Pronchery :return: A package object if present, else ``NULL``. 20*a3cefe7fSPierre Pronchery :rtype: pkgconf_pkg_t * 21*a3cefe7fSPierre Pronchery 22*a3cefe7fSPierre Pronchery.. c:function:: void pkgconf_cache_add(pkgconf_client_t *client, pkgconf_pkg_t *pkg) 23*a3cefe7fSPierre Pronchery 24*a3cefe7fSPierre Pronchery Adds an entry for the package to the package cache. 25*a3cefe7fSPierre Pronchery The cache entry must be removed if the package is freed. 26*a3cefe7fSPierre Pronchery 27*a3cefe7fSPierre Pronchery :param pkgconf_client_t* client: The client object to modify. 28*a3cefe7fSPierre Pronchery :param pkgconf_pkg_t* pkg: The package object to add to the client object's cache. 29*a3cefe7fSPierre Pronchery :return: nothing 30*a3cefe7fSPierre Pronchery 31*a3cefe7fSPierre Pronchery.. c:function:: void pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg) 32*a3cefe7fSPierre Pronchery 33*a3cefe7fSPierre Pronchery Deletes a package from the client object's package cache. 34*a3cefe7fSPierre Pronchery 35*a3cefe7fSPierre Pronchery :param pkgconf_client_t* client: The client object to modify. 36*a3cefe7fSPierre Pronchery :param pkgconf_pkg_t* pkg: The package object to remove from the client object's cache. 37*a3cefe7fSPierre Pronchery :return: nothing 38*a3cefe7fSPierre Pronchery 39*a3cefe7fSPierre Pronchery.. c:function:: void pkgconf_cache_free(pkgconf_client_t *client) 40*a3cefe7fSPierre Pronchery 41*a3cefe7fSPierre Pronchery Releases all resources related to a client object's package cache. 42*a3cefe7fSPierre Pronchery This function should only be called to clear a client object's package cache, 43*a3cefe7fSPierre Pronchery as it may release any package in the cache. 44*a3cefe7fSPierre Pronchery 45*a3cefe7fSPierre Pronchery :param pkgconf_client_t* client: The client object to modify. 46