forked from ariadne/pkgconf
libpkgconf: pkg: rename pkgconf_pkg_t.requires to pkgconf_pkg_t.required (closes #154)
C++20 makes requires a keyword, so we need to not use it in headers.feature/tap-sh
parent
4fea62b08e
commit
e0bf4009cb
|
@ -131,7 +131,7 @@ struct pkgconf_pkg_ {
|
||||||
pkgconf_list_t cflags;
|
pkgconf_list_t cflags;
|
||||||
pkgconf_list_t cflags_private;
|
pkgconf_list_t cflags_private;
|
||||||
|
|
||||||
pkgconf_list_t requires;
|
pkgconf_list_t required; /* this used to be requires but that is now a reserved keyword */
|
||||||
pkgconf_list_t requires_private;
|
pkgconf_list_t requires_private;
|
||||||
pkgconf_list_t conflicts;
|
pkgconf_list_t conflicts;
|
||||||
pkgconf_list_t provides;
|
pkgconf_list_t provides;
|
||||||
|
|
|
@ -181,7 +181,7 @@ static const pkgconf_pkg_parser_keyword_pair_t pkgconf_pkg_parser_keyword_funcs[
|
||||||
{"LIBS.private", pkgconf_pkg_parser_fragment_func, offsetof(pkgconf_pkg_t, libs_private)},
|
{"LIBS.private", pkgconf_pkg_parser_fragment_func, offsetof(pkgconf_pkg_t, libs_private)},
|
||||||
{"Name", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, realname)},
|
{"Name", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, realname)},
|
||||||
{"Provides", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, provides)},
|
{"Provides", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, provides)},
|
||||||
{"Requires", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, requires)},
|
{"Requires", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, required)},
|
||||||
{"Requires.private", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, requires_private)},
|
{"Requires.private", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, requires_private)},
|
||||||
{"Version", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, version)},
|
{"Version", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, version)},
|
||||||
};
|
};
|
||||||
|
@ -423,7 +423,7 @@ pkgconf_pkg_free(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
||||||
|
|
||||||
pkgconf_cache_remove(client, pkg);
|
pkgconf_cache_remove(client, pkg);
|
||||||
|
|
||||||
pkgconf_dependency_free(&pkg->requires);
|
pkgconf_dependency_free(&pkg->required);
|
||||||
pkgconf_dependency_free(&pkg->requires_private);
|
pkgconf_dependency_free(&pkg->requires_private);
|
||||||
pkgconf_dependency_free(&pkg->conflicts);
|
pkgconf_dependency_free(&pkg->conflicts);
|
||||||
pkgconf_dependency_free(&pkg->provides);
|
pkgconf_dependency_free(&pkg->provides);
|
||||||
|
@ -1421,7 +1421,7 @@ pkgconf_pkg_walk_conflicts_list(pkgconf_client_t *client,
|
||||||
if (*parentnode->package == '\0')
|
if (*parentnode->package == '\0')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(root->requires.head, childnode)
|
PKGCONF_FOREACH_LIST_ENTRY(root->required.head, childnode)
|
||||||
{
|
{
|
||||||
pkgconf_pkg_t *pkgdep;
|
pkgconf_pkg_t *pkgdep;
|
||||||
pkgconf_dependency_t *depnode = childnode->data;
|
pkgconf_dependency_t *depnode = childnode->data;
|
||||||
|
@ -1497,7 +1497,7 @@ pkgconf_pkg_traverse(pkgconf_client_t *client,
|
||||||
}
|
}
|
||||||
|
|
||||||
PKGCONF_TRACE(client, "%s: walking requires list", root->id);
|
PKGCONF_TRACE(client, "%s: walking requires list", root->id);
|
||||||
eflags = pkgconf_pkg_walk_list(client, root, &root->requires, func, data, maxdepth);
|
eflags = pkgconf_pkg_walk_list(client, root, &root->required, func, data, maxdepth);
|
||||||
if (eflags != PKGCONF_PKG_ERRF_OK)
|
if (eflags != PKGCONF_PKG_ERRF_OK)
|
||||||
return eflags;
|
return eflags;
|
||||||
|
|
||||||
|
|
|
@ -77,10 +77,10 @@ pkgconf_queue_compile(pkgconf_client_t *client, pkgconf_pkg_t *world, pkgconf_li
|
||||||
pkgconf_queue_t *pkgq;
|
pkgconf_queue_t *pkgq;
|
||||||
|
|
||||||
pkgq = iter->data;
|
pkgq = iter->data;
|
||||||
pkgconf_dependency_parse(client, world, &world->requires, pkgq->package);
|
pkgconf_dependency_parse(client, world, &world->required, pkgq->package);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (world->requires.head != NULL);
|
return (world->required.head != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
20
main.c
20
main.c
|
@ -169,7 +169,7 @@ print_requires(pkgconf_pkg_t *pkg)
|
||||||
{
|
{
|
||||||
pkgconf_node_t *node;
|
pkgconf_node_t *node;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(pkg->requires.head, node)
|
PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = node->data;
|
pkgconf_dependency_t *dep = node->data;
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ apply_provides(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, int
|
||||||
(void) unused;
|
(void) unused;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -246,7 +246,7 @@ print_digraph_node(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *unused)
|
||||||
|
|
||||||
printf("\"%s\" [fontname=Sans fontsize=8]\n", pkg->id);
|
printf("\"%s\" [fontname=Sans fontsize=8]\n", pkg->id);
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(pkg->requires.head, node)
|
PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = node->data;
|
pkgconf_dependency_t *dep = node->data;
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ apply_modversion(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, i
|
||||||
(void) unused;
|
(void) unused;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -300,7 +300,7 @@ apply_variables(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, in
|
||||||
(void) unused;
|
(void) unused;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -319,7 +319,7 @@ apply_path(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, int max
|
||||||
(void) unused;
|
(void) unused;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -348,7 +348,7 @@ apply_variable(pkgconf_client_t *client, pkgconf_pkg_t *world, void *variable, i
|
||||||
pkgconf_node_t *iter;
|
pkgconf_node_t *iter;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -481,7 +481,7 @@ apply_requires(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, int
|
||||||
(void) unused;
|
(void) unused;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -500,7 +500,7 @@ apply_requires_private(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unu
|
||||||
(void) unused;
|
(void) unused;
|
||||||
(void) maxdepth;
|
(void) maxdepth;
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
|
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = iter->data;
|
pkgconf_dependency_t *dep = iter->data;
|
||||||
pkgconf_pkg_t *pkg = dep->match;
|
pkgconf_pkg_t *pkg = dep->match;
|
||||||
|
@ -546,7 +546,7 @@ print_graph_node(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data)
|
||||||
if (pkg->version != NULL)
|
if (pkg->version != NULL)
|
||||||
printf(" version = '%s';\n", pkg->version);
|
printf(" version = '%s';\n", pkg->version);
|
||||||
|
|
||||||
PKGCONF_FOREACH_LIST_ENTRY(pkg->requires.head, n)
|
PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, n)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep = n->data;
|
pkgconf_dependency_t *dep = n->data;
|
||||||
printf(" dependency '%s'", dep->package);
|
printf(" dependency '%s'", dep->package);
|
||||||
|
|
Loading…
Reference in New Issue