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
William Pitcock 2017-12-12 00:21:21 -06:00
parent 4fea62b08e
commit e0bf4009cb
4 changed files with 17 additions and 17 deletions

View File

@ -131,7 +131,7 @@ struct pkgconf_pkg_ {
pkgconf_list_t cflags;
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 conflicts;
pkgconf_list_t provides;

View File

@ -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)},
{"Name", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, realname)},
{"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)},
{"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_dependency_free(&pkg->requires);
pkgconf_dependency_free(&pkg->required);
pkgconf_dependency_free(&pkg->requires_private);
pkgconf_dependency_free(&pkg->conflicts);
pkgconf_dependency_free(&pkg->provides);
@ -1421,7 +1421,7 @@ pkgconf_pkg_walk_conflicts_list(pkgconf_client_t *client,
if (*parentnode->package == '\0')
continue;
PKGCONF_FOREACH_LIST_ENTRY(root->requires.head, childnode)
PKGCONF_FOREACH_LIST_ENTRY(root->required.head, childnode)
{
pkgconf_pkg_t *pkgdep;
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);
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)
return eflags;

View File

@ -77,10 +77,10 @@ pkgconf_queue_compile(pkgconf_client_t *client, pkgconf_pkg_t *world, pkgconf_li
pkgconf_queue_t *pkgq;
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
View File

@ -169,7 +169,7 @@ print_requires(pkgconf_pkg_t *pkg)
{
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;
@ -226,7 +226,7 @@ apply_provides(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, int
(void) unused;
(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_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);
PKGCONF_FOREACH_LIST_ENTRY(pkg->requires.head, node)
PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node)
{
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) maxdepth;
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
{
pkgconf_dependency_t *dep = iter->data;
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) maxdepth;
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
{
pkgconf_dependency_t *dep = iter->data;
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) maxdepth;
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
{
pkgconf_dependency_t *dep = iter->data;
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;
(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_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) maxdepth;
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
{
pkgconf_dependency_t *dep = iter->data;
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) maxdepth;
PKGCONF_FOREACH_LIST_ENTRY(world->requires.head, iter)
PKGCONF_FOREACH_LIST_ENTRY(world->required.head, iter)
{
pkgconf_dependency_t *dep = iter->data;
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)
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;
printf(" dependency '%s'", dep->package);