libpkgconf dependency module

The dependency module provides support for building dependency lists (the basic component of the overall dependency graph) and dependency nodes which store dependency information.

pkgconf_dependency_t *pkgconf_dependency_add(pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare)

Adds a parsed dependency to a dependency list as a dependency node.

Parameters:
  • client (pkgconf_client_t*) – The client object that owns the package this dependency list belongs to.
  • list (pkgconf_list_t*) – The dependency list to add a dependency node to.
  • package (char*) – The package atom to set on the dependency node.
  • version (char*) – The package version to set on the dependency node.
  • compare (pkgconf_pkg_comparator_t) – The comparison operator to set on the dependency node.
Returns:

A dependency node.

Return type:

pkgconf_dependency_t *

void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail)

Adds a dependency node to a pre-existing dependency list.

Parameters:
  • list (pkgconf_list_t*) – The dependency list to add a dependency node to.
  • tail (pkgconf_dependency_t*) – The dependency node to add to the tail of the dependency list.
Returns:

nothing

void pkgconf_dependency_free(pkgconf_list_t *list)

Release a dependency list and it’s child dependency nodes.

Parameters:
  • list (pkgconf_list_t*) – The dependency list to release.
Returns:

nothing

void pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)

Parse a dependency declaration into a dependency list. Commas are counted as whitespace to allow for constructs such as @SUBSTVAR@, zlib being processed into , zlib.

Parameters:
  • client (pkgconf_client_t*) – The client object that owns the package this dependency list belongs to.
  • deplist_head (pkgconf_list_t*) – The dependency list to populate with dependency nodes.
  • depends (char*) – The dependency data to parse.
Returns:

nothing

void pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist, const char *depends)

Preprocess dependency data and then process that dependency declaration into a dependency list. Commas are counted as whitespace to allow for constructs such as @SUBSTVAR@, zlib being processed into , zlib.

Parameters:
  • client (pkgconf_client_t*) – The client object that owns the package this dependency list belongs to.
  • pkg (pkgconf_pkg_t*) – The package object that owns this dependency list.
  • deplist (pkgconf_list_t*) – The dependency list to populate with dependency nodes.
  • depends (char*) – The dependency data to parse.
Returns:

nothing