deconst the client on pkgconf_dependency_add()
parent
4144d506bb
commit
c547edd07f
|
@ -73,7 +73,7 @@ find_colliding_dependency(const pkgconf_dependency_t *dep, const pkgconf_list_t
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline pkgconf_dependency_t *
|
static inline pkgconf_dependency_t *
|
||||||
add_or_replace_dependency_node(const pkgconf_client_t *client, pkgconf_dependency_t *dep, pkgconf_list_t *list)
|
add_or_replace_dependency_node(pkgconf_client_t *client, pkgconf_dependency_t *dep, pkgconf_list_t *list)
|
||||||
{
|
{
|
||||||
char depbuf[PKGCONF_ITEM_SIZE];
|
char depbuf[PKGCONF_ITEM_SIZE];
|
||||||
pkgconf_dependency_t *dep2 = find_colliding_dependency(dep, list);
|
pkgconf_dependency_t *dep2 = find_colliding_dependency(dep, list);
|
||||||
|
@ -119,7 +119,7 @@ add_or_replace_dependency_node(const pkgconf_client_t *client, pkgconf_dependenc
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline pkgconf_dependency_t *
|
static inline pkgconf_dependency_t *
|
||||||
pkgconf_dependency_addraw(const pkgconf_client_t *client, pkgconf_list_t *list, const char *package, size_t package_sz, const char *version, size_t version_sz, pkgconf_pkg_comparator_t compare, unsigned int flags)
|
pkgconf_dependency_addraw(pkgconf_client_t *client, pkgconf_list_t *list, const char *package, size_t package_sz, const char *version, size_t version_sz, pkgconf_pkg_comparator_t compare, unsigned int flags)
|
||||||
{
|
{
|
||||||
pkgconf_dependency_t *dep;
|
pkgconf_dependency_t *dep;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ pkgconf_dependency_addraw(const pkgconf_client_t *client, pkgconf_list_t *list,
|
||||||
* :rtype: pkgconf_dependency_t *
|
* :rtype: pkgconf_dependency_t *
|
||||||
*/
|
*/
|
||||||
pkgconf_dependency_t *
|
pkgconf_dependency_t *
|
||||||
pkgconf_dependency_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags)
|
pkgconf_dependency_add(pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags)
|
||||||
{
|
{
|
||||||
if (version != NULL)
|
if (version != NULL)
|
||||||
return pkgconf_dependency_addraw(client, list, package, strlen(package), version, strlen(version), compare, flags);
|
return pkgconf_dependency_addraw(client, list, package, strlen(package), version, strlen(version), compare, flags);
|
||||||
|
@ -286,7 +286,7 @@ pkgconf_dependency_free(pkgconf_list_t *list)
|
||||||
* :return: nothing
|
* :return: nothing
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pkgconf_dependency_parse_str(const pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags)
|
pkgconf_dependency_parse_str(pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags)
|
||||||
{
|
{
|
||||||
parse_state_t state = OUTSIDE_MODULE;
|
parse_state_t state = OUTSIDE_MODULE;
|
||||||
pkgconf_pkg_comparator_t compare = PKGCONF_CMP_ANY;
|
pkgconf_pkg_comparator_t compare = PKGCONF_CMP_ANY;
|
||||||
|
@ -432,7 +432,7 @@ pkgconf_dependency_parse_str(const pkgconf_client_t *client, pkgconf_list_t *dep
|
||||||
* :return: nothing
|
* :return: nothing
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist, const char *depends, unsigned int flags)
|
pkgconf_dependency_parse(pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist, const char *depends, unsigned int flags)
|
||||||
{
|
{
|
||||||
char *kvdepends = pkgconf_tuple_parse(client, &pkg->vars, depends);
|
char *kvdepends = pkgconf_tuple_parse(client, &pkg->vars, depends);
|
||||||
|
|
||||||
|
|
|
@ -319,12 +319,12 @@ PKGCONF_API pkgconf_pkg_t *pkgconf_scan_all(pkgconf_client_t *client, void *ptr,
|
||||||
|
|
||||||
/* parse.c */
|
/* parse.c */
|
||||||
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *path, FILE *f);
|
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *path, FILE *f);
|
||||||
PKGCONF_API void pkgconf_dependency_parse_str(const pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags);
|
PKGCONF_API void pkgconf_dependency_parse_str(pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags);
|
||||||
PKGCONF_API void pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags);
|
PKGCONF_API void pkgconf_dependency_parse(pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags);
|
||||||
PKGCONF_API void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail);
|
PKGCONF_API void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail);
|
||||||
PKGCONF_API void pkgconf_dependency_free(pkgconf_list_t *list);
|
PKGCONF_API void pkgconf_dependency_free(pkgconf_list_t *list);
|
||||||
PKGCONF_API void pkgconf_dependency_free_one(pkgconf_dependency_t *dep);
|
PKGCONF_API void pkgconf_dependency_free_one(pkgconf_dependency_t *dep);
|
||||||
PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags);
|
PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_add(pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags);
|
||||||
PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_ref(pkgconf_client_t *client, pkgconf_dependency_t *dep);
|
PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_ref(pkgconf_client_t *client, pkgconf_dependency_t *dep);
|
||||||
PKGCONF_API void pkgconf_dependency_unref(pkgconf_client_t *client, pkgconf_dependency_t *dep);
|
PKGCONF_API void pkgconf_dependency_unref(pkgconf_client_t *client, pkgconf_dependency_t *dep);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ pkg_get_parent_dir(pkgconf_pkg_t *pkg)
|
||||||
return strdup(buf);
|
return strdup(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*pkgconf_pkg_parser_keyword_func_t)(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value);
|
typedef void (*pkgconf_pkg_parser_keyword_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value);
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *keyword;
|
const char *keyword;
|
||||||
const pkgconf_pkg_parser_keyword_func_t func;
|
const pkgconf_pkg_parser_keyword_func_t func;
|
||||||
|
@ -78,7 +78,7 @@ static int pkgconf_pkg_parser_keyword_pair_cmp(const void *key, const void *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pkgconf_pkg_parser_tuple_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
pkgconf_pkg_parser_tuple_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
||||||
{
|
{
|
||||||
(void) keyword;
|
(void) keyword;
|
||||||
(void) lineno;
|
(void) lineno;
|
||||||
|
@ -88,7 +88,7 @@ pkgconf_pkg_parser_tuple_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pkgconf_pkg_parser_version_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
pkgconf_pkg_parser_version_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
||||||
{
|
{
|
||||||
(void) keyword;
|
(void) keyword;
|
||||||
(void) lineno;
|
(void) lineno;
|
||||||
|
@ -113,7 +113,7 @@ pkgconf_pkg_parser_version_func(const pkgconf_client_t *client, pkgconf_pkg_t *p
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pkgconf_pkg_parser_fragment_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
pkgconf_pkg_parser_fragment_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
||||||
{
|
{
|
||||||
pkgconf_list_t *dest = (pkgconf_list_t *)((char *) pkg + offset);
|
pkgconf_list_t *dest = (pkgconf_list_t *)((char *) pkg + offset);
|
||||||
bool ret = pkgconf_fragment_parse(client, dest, &pkg->vars, value);
|
bool ret = pkgconf_fragment_parse(client, dest, &pkg->vars, value);
|
||||||
|
@ -126,7 +126,7 @@ pkgconf_pkg_parser_fragment_func(const pkgconf_client_t *client, pkgconf_pkg_t *
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pkgconf_pkg_parser_dependency_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
pkgconf_pkg_parser_dependency_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
||||||
{
|
{
|
||||||
(void) keyword;
|
(void) keyword;
|
||||||
(void) lineno;
|
(void) lineno;
|
||||||
|
@ -137,7 +137,7 @@ pkgconf_pkg_parser_dependency_func(const pkgconf_client_t *client, pkgconf_pkg_t
|
||||||
|
|
||||||
/* a variant of pkgconf_pkg_parser_dependency_func which colors the dependency node as an "internal" dependency. */
|
/* a variant of pkgconf_pkg_parser_dependency_func which colors the dependency node as an "internal" dependency. */
|
||||||
static void
|
static void
|
||||||
pkgconf_pkg_parser_internal_dependency_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
pkgconf_pkg_parser_internal_dependency_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
|
||||||
{
|
{
|
||||||
(void) keyword;
|
(void) keyword;
|
||||||
(void) lineno;
|
(void) lineno;
|
||||||
|
|
Loading…
Reference in New Issue