2011-07-25 02:03:17 +00:00
|
|
|
/*
|
2015-09-06 16:37:20 +00:00
|
|
|
* libpkgconf.h
|
|
|
|
* Global include file for everything in libpkgconf.
|
2011-07-25 02:03:17 +00:00
|
|
|
*
|
2015-09-06 16:37:20 +00:00
|
|
|
* Copyright (c) 2011, 2015 pkgconf authors (see AUTHORS).
|
2011-07-25 02:03:17 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
2012-07-20 19:29:58 +00:00
|
|
|
* This software is provided 'as is' and without any warranty, express or
|
|
|
|
* implied. In no event shall the authors be liable for any damages arising
|
|
|
|
* from the use of this software.
|
2011-07-25 02:03:17 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-06 16:37:20 +00:00
|
|
|
#ifndef LIBPKGCONF__LIBPKGCONF_H
|
|
|
|
#define LIBPKGCONF__LIBPKGCONF_H
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2017-09-18 04:38:25 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdbool.h>
|
2018-03-07 05:27:54 +00:00
|
|
|
#include <libpkgconf/libpkgconf-api.h>
|
2015-09-06 14:35:08 +00:00
|
|
|
#include <libpkgconf/iter.h>
|
|
|
|
#include <libpkgconf/bsdstubs.h>
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2017-09-13 19:35:28 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-12-01 04:15:13 +00:00
|
|
|
/* pkg-config uses ';' on win32 as ':' is part of path */
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define PKG_CONFIG_PATH_SEP_S ";"
|
|
|
|
#else
|
|
|
|
#define PKG_CONFIG_PATH_SEP_S ":"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define PKG_DIR_SEP_S '\\'
|
|
|
|
#else
|
|
|
|
#define PKG_DIR_SEP_S '/'
|
|
|
|
#endif
|
|
|
|
|
2019-03-24 03:27:05 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
|
|
|
|
#endif
|
|
|
|
|
2015-09-06 16:29:56 +00:00
|
|
|
#define PKGCONF_BUFSIZE (65535)
|
2011-07-25 02:03:17 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2016-08-26 15:54:37 +00:00
|
|
|
PKGCONF_CMP_NOT_EQUAL,
|
|
|
|
PKGCONF_CMP_ANY,
|
2015-09-06 16:34:09 +00:00
|
|
|
PKGCONF_CMP_LESS_THAN,
|
|
|
|
PKGCONF_CMP_LESS_THAN_EQUAL,
|
|
|
|
PKGCONF_CMP_EQUAL,
|
2016-08-26 15:54:37 +00:00
|
|
|
PKGCONF_CMP_GREATER_THAN,
|
|
|
|
PKGCONF_CMP_GREATER_THAN_EQUAL
|
2015-09-06 15:57:26 +00:00
|
|
|
} pkgconf_pkg_comparator_t;
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2016-09-09 04:54:57 +00:00
|
|
|
#define PKGCONF_CMP_COUNT 7
|
|
|
|
|
2015-09-06 16:20:48 +00:00
|
|
|
typedef struct pkgconf_pkg_ pkgconf_pkg_t;
|
2015-09-06 15:38:30 +00:00
|
|
|
typedef struct pkgconf_dependency_ pkgconf_dependency_t;
|
2015-09-06 15:41:40 +00:00
|
|
|
typedef struct pkgconf_tuple_ pkgconf_tuple_t;
|
2015-09-06 15:44:10 +00:00
|
|
|
typedef struct pkgconf_fragment_ pkgconf_fragment_t;
|
2016-12-01 04:15:13 +00:00
|
|
|
typedef struct pkgconf_path_ pkgconf_path_t;
|
2016-12-01 21:05:03 +00:00
|
|
|
typedef struct pkgconf_client_ pkgconf_client_t;
|
2018-05-09 21:54:21 +00:00
|
|
|
typedef struct pkgconf_cross_personality_ pkgconf_cross_personality_t;
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2016-05-19 21:51:47 +00:00
|
|
|
#define PKGCONF_ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
|
|
|
|
|
2015-09-06 15:31:21 +00:00
|
|
|
#define PKGCONF_FOREACH_LIST_ENTRY(head, value) \
|
2011-07-25 02:03:17 +00:00
|
|
|
for ((value) = (head); (value) != NULL; (value) = (value)->next)
|
|
|
|
|
2015-09-06 15:31:21 +00:00
|
|
|
#define PKGCONF_FOREACH_LIST_ENTRY_SAFE(head, nextiter, value) \
|
2012-05-07 01:36:59 +00:00
|
|
|
for ((value) = (head), (nextiter) = (head) != NULL ? (head)->next : NULL; (value) != NULL; (value) = (nextiter), (nextiter) = (nextiter) != NULL ? (nextiter)->next : NULL)
|
2012-05-07 01:15:45 +00:00
|
|
|
|
2015-09-06 15:31:21 +00:00
|
|
|
#define PKGCONF_FOREACH_LIST_ENTRY_REVERSE(tail, value) \
|
2015-05-22 04:06:38 +00:00
|
|
|
for ((value) = (tail); (value) != NULL; (value) = (value)->prev)
|
|
|
|
|
2020-05-24 20:44:01 +00:00
|
|
|
#define LIBPKGCONF_VERSION 10700
|
|
|
|
#define LIBPKGCONF_VERSION_STR "1.7.0"
|
2019-01-14 19:52:04 +00:00
|
|
|
|
2015-09-06 15:44:10 +00:00
|
|
|
struct pkgconf_fragment_ {
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_node_t iter;
|
2012-05-03 19:25:33 +00:00
|
|
|
|
|
|
|
char type;
|
|
|
|
char *data;
|
2017-12-10 06:39:39 +00:00
|
|
|
|
|
|
|
bool merged;
|
2012-05-03 19:25:33 +00:00
|
|
|
};
|
|
|
|
|
2015-09-06 15:38:30 +00:00
|
|
|
struct pkgconf_dependency_ {
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_node_t iter;
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2011-07-25 04:20:22 +00:00
|
|
|
char *package;
|
2015-09-06 15:57:26 +00:00
|
|
|
pkgconf_pkg_comparator_t compare;
|
2011-07-25 02:03:17 +00:00
|
|
|
char *version;
|
2015-09-06 16:20:48 +00:00
|
|
|
pkgconf_pkg_t *parent;
|
2017-12-05 23:34:01 +00:00
|
|
|
pkgconf_pkg_t *match;
|
2018-03-18 23:01:59 +00:00
|
|
|
|
|
|
|
unsigned int flags;
|
2011-07-25 02:03:17 +00:00
|
|
|
};
|
|
|
|
|
2015-09-06 15:41:40 +00:00
|
|
|
struct pkgconf_tuple_ {
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_node_t iter;
|
2011-07-25 02:03:17 +00:00
|
|
|
|
|
|
|
char *key;
|
|
|
|
char *value;
|
|
|
|
};
|
|
|
|
|
2016-12-01 04:15:13 +00:00
|
|
|
struct pkgconf_path_ {
|
|
|
|
pkgconf_node_t lnode;
|
|
|
|
|
|
|
|
char *path;
|
2016-12-30 17:39:45 +00:00
|
|
|
void *handle_path;
|
|
|
|
void *handle_device;
|
2016-12-01 04:15:13 +00:00
|
|
|
};
|
|
|
|
|
2017-01-23 05:26:01 +00:00
|
|
|
#define PKGCONF_PKG_PROPF_NONE 0x00
|
|
|
|
#define PKGCONF_PKG_PROPF_STATIC 0x01
|
|
|
|
#define PKGCONF_PKG_PROPF_CACHED 0x02
|
|
|
|
#define PKGCONF_PKG_PROPF_SEEN 0x04
|
|
|
|
#define PKGCONF_PKG_PROPF_UNINSTALLED 0x08
|
|
|
|
#define PKGCONF_PKG_PROPF_VIRTUAL 0x10
|
2012-05-07 01:38:48 +00:00
|
|
|
|
2015-09-06 16:20:48 +00:00
|
|
|
struct pkgconf_pkg_ {
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_node_t cache_iter;
|
2013-02-24 14:14:23 +00:00
|
|
|
|
2013-02-26 05:29:57 +00:00
|
|
|
int refcount;
|
2011-07-27 01:37:01 +00:00
|
|
|
char *id;
|
2011-07-25 02:03:17 +00:00
|
|
|
char *filename;
|
|
|
|
char *realname;
|
|
|
|
char *version;
|
|
|
|
char *description;
|
|
|
|
char *url;
|
|
|
|
char *pc_filedir;
|
2012-05-03 19:25:59 +00:00
|
|
|
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_list_t libs;
|
|
|
|
pkgconf_list_t libs_private;
|
|
|
|
pkgconf_list_t cflags;
|
|
|
|
pkgconf_list_t cflags_private;
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2017-12-12 06:21:21 +00:00
|
|
|
pkgconf_list_t required; /* this used to be requires but that is now a reserved keyword */
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_list_t requires_private;
|
|
|
|
pkgconf_list_t conflicts;
|
2016-08-26 17:14:32 +00:00
|
|
|
pkgconf_list_t provides;
|
2013-03-01 16:45:55 +00:00
|
|
|
|
2015-09-06 15:31:21 +00:00
|
|
|
pkgconf_list_t vars;
|
2012-05-06 04:00:20 +00:00
|
|
|
|
2012-05-07 01:38:48 +00:00
|
|
|
unsigned int flags;
|
2017-12-05 23:32:00 +00:00
|
|
|
|
|
|
|
pkgconf_client_t *owner;
|
2018-05-10 00:56:30 +00:00
|
|
|
|
|
|
|
/* these resources are owned by the package and do not need special management,
|
|
|
|
* under no circumstance attempt to allocate or free objects belonging to these pointers
|
|
|
|
*/
|
|
|
|
pkgconf_tuple_t *orig_prefix;
|
|
|
|
pkgconf_tuple_t *prefix;
|
2011-07-25 02:03:17 +00:00
|
|
|
};
|
|
|
|
|
2016-12-01 21:05:03 +00:00
|
|
|
typedef bool (*pkgconf_pkg_iteration_func_t)(const pkgconf_pkg_t *pkg, void *data);
|
2017-01-20 00:17:29 +00:00
|
|
|
typedef void (*pkgconf_pkg_traverse_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data);
|
2017-01-19 23:32:38 +00:00
|
|
|
typedef bool (*pkgconf_queue_apply_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int maxdepth);
|
2016-12-13 18:03:59 +00:00
|
|
|
typedef bool (*pkgconf_error_handler_func_t)(const char *msg, const pkgconf_client_t *client, const void *data);
|
2016-12-01 21:05:03 +00:00
|
|
|
|
|
|
|
struct pkgconf_client_ {
|
|
|
|
pkgconf_list_t dir_list;
|
2016-12-02 06:29:33 +00:00
|
|
|
pkgconf_list_t pkg_cache;
|
2016-12-01 21:05:03 +00:00
|
|
|
|
|
|
|
pkgconf_list_t filter_libdirs;
|
|
|
|
pkgconf_list_t filter_includedirs;
|
|
|
|
|
|
|
|
pkgconf_list_t global_vars;
|
|
|
|
|
2016-12-13 18:03:59 +00:00
|
|
|
void *error_handler_data;
|
2017-02-05 00:46:33 +00:00
|
|
|
void *warn_handler_data;
|
2017-02-05 00:57:21 +00:00
|
|
|
void *trace_handler_data;
|
2017-02-05 00:46:33 +00:00
|
|
|
|
2016-12-01 21:05:03 +00:00
|
|
|
pkgconf_error_handler_func_t error_handler;
|
2017-02-05 00:37:58 +00:00
|
|
|
pkgconf_error_handler_func_t warn_handler;
|
2017-02-05 00:57:21 +00:00
|
|
|
pkgconf_error_handler_func_t trace_handler;
|
2016-12-02 06:34:48 +00:00
|
|
|
|
|
|
|
FILE *auditf;
|
2016-12-10 02:41:39 +00:00
|
|
|
|
|
|
|
char *sysroot_dir;
|
|
|
|
char *buildroot_dir;
|
2017-01-19 23:22:20 +00:00
|
|
|
|
|
|
|
unsigned int flags;
|
2017-01-20 01:16:00 +00:00
|
|
|
|
|
|
|
char *prefix_varname;
|
2017-09-09 00:48:31 +00:00
|
|
|
|
|
|
|
bool already_sent_notice;
|
2016-12-01 21:05:03 +00:00
|
|
|
};
|
|
|
|
|
2018-05-09 21:54:21 +00:00
|
|
|
struct pkgconf_cross_personality_ {
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
pkgconf_list_t dir_list;
|
|
|
|
|
|
|
|
pkgconf_list_t filter_libdirs;
|
|
|
|
pkgconf_list_t filter_includedirs;
|
|
|
|
|
|
|
|
char *sysroot_dir;
|
2019-10-19 05:56:17 +00:00
|
|
|
|
|
|
|
bool want_default_static;
|
2021-03-18 11:59:54 +00:00
|
|
|
bool want_default_pure;
|
2018-05-09 21:54:21 +00:00
|
|
|
};
|
|
|
|
|
2016-12-01 21:05:03 +00:00
|
|
|
/* client.c */
|
2018-05-09 21:54:21 +00:00
|
|
|
PKGCONF_API void pkgconf_client_init(pkgconf_client_t *client, pkgconf_error_handler_func_t error_handler, void *error_handler_data, const pkgconf_cross_personality_t *personality);
|
|
|
|
PKGCONF_API pkgconf_client_t * pkgconf_client_new(pkgconf_error_handler_func_t error_handler, void *error_handler_data, const pkgconf_cross_personality_t *personality);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_client_deinit(pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_free(pkgconf_client_t *client);
|
|
|
|
PKGCONF_API const char *pkgconf_client_get_sysroot_dir(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_sysroot_dir(pkgconf_client_t *client, const char *sysroot_dir);
|
|
|
|
PKGCONF_API const char *pkgconf_client_get_buildroot_dir(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_buildroot_dir(pkgconf_client_t *client, const char *buildroot_dir);
|
|
|
|
PKGCONF_API unsigned int pkgconf_client_get_flags(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_flags(pkgconf_client_t *client, unsigned int flags);
|
|
|
|
PKGCONF_API const char *pkgconf_client_get_prefix_varname(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_prefix_varname(pkgconf_client_t *client, const char *prefix_varname);
|
|
|
|
PKGCONF_API pkgconf_error_handler_func_t pkgconf_client_get_warn_handler(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_warn_handler(pkgconf_client_t *client, pkgconf_error_handler_func_t warn_handler, void *warn_handler_data);
|
|
|
|
PKGCONF_API pkgconf_error_handler_func_t pkgconf_client_get_error_handler(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_error_handler(pkgconf_client_t *client, pkgconf_error_handler_func_t error_handler, void *error_handler_data);
|
|
|
|
PKGCONF_API pkgconf_error_handler_func_t pkgconf_client_get_trace_handler(const pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_client_set_trace_handler(pkgconf_client_t *client, pkgconf_error_handler_func_t trace_handler, void *trace_handler_data);
|
2018-05-09 22:07:26 +00:00
|
|
|
PKGCONF_API void pkgconf_client_dir_list_build(pkgconf_client_t *client, const pkgconf_cross_personality_t *personality);
|
2016-12-01 21:05:03 +00:00
|
|
|
|
2018-05-09 21:54:21 +00:00
|
|
|
/* personality.c */
|
2018-05-10 03:52:27 +00:00
|
|
|
PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_default(void);
|
2018-05-10 03:39:39 +00:00
|
|
|
PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_find(const char *triplet);
|
2021-06-11 06:00:47 +00:00
|
|
|
PKGCONF_API void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality);
|
2018-05-09 21:54:21 +00:00
|
|
|
|
2015-12-07 10:04:31 +00:00
|
|
|
#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned int)(c)))
|
2015-09-06 16:39:55 +00:00
|
|
|
#define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=')
|
2012-05-06 02:26:15 +00:00
|
|
|
|
2017-02-27 15:54:02 +00:00
|
|
|
#define PKGCONF_PKG_PKGF_NONE 0x0000
|
|
|
|
#define PKGCONF_PKG_PKGF_SEARCH_PRIVATE 0x0001
|
|
|
|
#define PKGCONF_PKG_PKGF_ENV_ONLY 0x0002
|
|
|
|
#define PKGCONF_PKG_PKGF_NO_UNINSTALLED 0x0004
|
|
|
|
#define PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL 0x0008
|
|
|
|
#define PKGCONF_PKG_PKGF_MERGE_PRIVATE_FRAGMENTS 0x0010
|
|
|
|
#define PKGCONF_PKG_PKGF_SKIP_CONFLICTS 0x0020
|
|
|
|
#define PKGCONF_PKG_PKGF_NO_CACHE 0x0040
|
|
|
|
#define PKGCONF_PKG_PKGF_SKIP_ERRORS 0x0080
|
|
|
|
#define PKGCONF_PKG_PKGF_ITER_PKG_IS_PRIVATE 0x0100
|
|
|
|
#define PKGCONF_PKG_PKGF_SKIP_PROVIDES 0x0200
|
|
|
|
#define PKGCONF_PKG_PKGF_REDEFINE_PREFIX 0x0400
|
|
|
|
#define PKGCONF_PKG_PKGF_DONT_RELOCATE_PATHS 0x0800
|
|
|
|
#define PKGCONF_PKG_PKGF_SIMPLIFY_ERRORS 0x1000
|
2018-03-18 23:01:59 +00:00
|
|
|
#define PKGCONF_PKG_PKGF_DONT_FILTER_INTERNAL_CFLAGS 0x2000
|
2020-05-24 20:40:47 +00:00
|
|
|
#define PKGCONF_PKG_PKGF_DONT_MERGE_SPECIAL_FRAGMENTS 0x4000
|
2021-03-18 12:22:11 +00:00
|
|
|
#define PKGCONF_PKG_PKGF_FDO_SYSROOT_RULES 0x8000
|
2018-03-18 23:01:59 +00:00
|
|
|
|
|
|
|
#define PKGCONF_PKG_DEPF_INTERNAL 0x1
|
2015-09-06 16:45:00 +00:00
|
|
|
|
|
|
|
#define PKGCONF_PKG_ERRF_OK 0x0
|
|
|
|
#define PKGCONF_PKG_ERRF_PACKAGE_NOT_FOUND 0x1
|
|
|
|
#define PKGCONF_PKG_ERRF_PACKAGE_VER_MISMATCH 0x2
|
|
|
|
#define PKGCONF_PKG_ERRF_PACKAGE_CONFLICT 0x4
|
|
|
|
#define PKGCONF_PKG_ERRF_DEPGRAPH_BREAK 0x8
|
2012-05-03 17:42:04 +00:00
|
|
|
|
2015-09-06 17:01:12 +00:00
|
|
|
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
|
|
|
#define PRINTFLIKE(fmtarg, firstvararg) \
|
|
|
|
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
|
|
|
|
#define DEPRECATED \
|
|
|
|
__attribute__((deprecated))
|
|
|
|
#else
|
|
|
|
#define PRINTFLIKE(fmtarg, firstvararg)
|
|
|
|
#define DEPRECATED
|
|
|
|
#endif /* defined(__INTEL_COMPILER) || defined(__GNUC__) */
|
|
|
|
|
2018-05-10 02:21:39 +00:00
|
|
|
/* parser.c */
|
|
|
|
typedef void (*pkgconf_parser_operand_func_t)(void *data, const size_t lineno, const char *key, const char *value);
|
|
|
|
typedef void (*pkgconf_parser_warn_func_t)(void *data, const char *fmt, ...);
|
|
|
|
|
|
|
|
PKGCONF_API void pkgconf_parser_parse(FILE *f, void *data, const pkgconf_parser_operand_func_t *ops, const pkgconf_parser_warn_func_t warnfunc, const char *filename);
|
|
|
|
|
|
|
|
/* pkg.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API bool pkgconf_error(const pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3);
|
|
|
|
PKGCONF_API bool pkgconf_warn(const pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3);
|
|
|
|
PKGCONF_API bool pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t lineno, const char *funcname, const char *format, ...) PRINTFLIKE(5, 6);
|
|
|
|
PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, const void *data);
|
2015-09-06 17:01:12 +00:00
|
|
|
|
2019-05-06 20:15:41 +00:00
|
|
|
#ifndef PKGCONF_LITE
|
2017-02-05 01:49:59 +00:00
|
|
|
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
|
|
|
#define PKGCONF_TRACE(client, ...) do { \
|
|
|
|
pkgconf_trace(client, __FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__); \
|
|
|
|
} while (0);
|
|
|
|
#else
|
|
|
|
#define PKGCONF_TRACE(client, ...) do { \
|
|
|
|
pkgconf_trace(client, __FILE__, __LINE__, __func__, __VA_ARGS__); \
|
|
|
|
} while (0);
|
|
|
|
#endif
|
2019-05-06 20:15:41 +00:00
|
|
|
#else
|
|
|
|
#define PKGCONF_TRACE(client, ...)
|
|
|
|
#endif
|
2017-02-05 01:49:59 +00:00
|
|
|
|
2017-12-05 23:32:00 +00:00
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_ref(pkgconf_client_t *client, pkgconf_pkg_t *pkg);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_pkg_unref(pkgconf_client_t *client, pkgconf_pkg_t *pkg);
|
|
|
|
PKGCONF_API void pkgconf_pkg_free(pkgconf_client_t *client, pkgconf_pkg_t *pkg);
|
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_find(pkgconf_client_t *client, const char *name);
|
2018-03-18 23:04:02 +00:00
|
|
|
PKGCONF_API unsigned int pkgconf_pkg_traverse(pkgconf_client_t *client, pkgconf_pkg_t *root, pkgconf_pkg_traverse_func_t func, void *data, int maxdepth, unsigned int skip_flags);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API unsigned int pkgconf_pkg_verify_graph(pkgconf_client_t *client, pkgconf_pkg_t *root, int depth);
|
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_verify_dependency(pkgconf_client_t *client, pkgconf_dependency_t *pkgdep, unsigned int *eflags);
|
|
|
|
PKGCONF_API const char *pkgconf_pkg_get_comparator(const pkgconf_dependency_t *pkgdep);
|
|
|
|
PKGCONF_API unsigned int pkgconf_pkg_cflags(pkgconf_client_t *client, pkgconf_pkg_t *root, pkgconf_list_t *list, int maxdepth);
|
|
|
|
PKGCONF_API unsigned int pkgconf_pkg_libs(pkgconf_client_t *client, pkgconf_pkg_t *root, pkgconf_list_t *list, int maxdepth);
|
|
|
|
PKGCONF_API pkgconf_pkg_comparator_t pkgconf_pkg_comparator_lookup_by_name(const char *name);
|
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_builtin_pkg_get(const char *name);
|
|
|
|
|
|
|
|
PKGCONF_API int pkgconf_compare_version(const char *a, const char *b);
|
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_scan_all(pkgconf_client_t *client, void *ptr, pkgconf_pkg_iteration_func_t func);
|
2015-09-06 16:00:46 +00:00
|
|
|
|
2011-07-25 02:03:17 +00:00
|
|
|
/* parse.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *path, FILE *f);
|
2018-03-18 23:01:59 +00:00
|
|
|
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(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail);
|
|
|
|
PKGCONF_API void pkgconf_dependency_free(pkgconf_list_t *list);
|
2018-03-18 23:01:59 +00:00
|
|
|
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);
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2012-05-03 18:59:14 +00:00
|
|
|
/* argvsplit.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API int pkgconf_argv_split(const char *src, int *argc, char ***argv);
|
|
|
|
PKGCONF_API void pkgconf_argv_free(char **argv);
|
2012-05-03 18:59:14 +00:00
|
|
|
|
2012-05-03 20:22:19 +00:00
|
|
|
/* fragment.c */
|
2017-12-08 01:13:35 +00:00
|
|
|
typedef struct pkgconf_fragment_render_ops_ {
|
|
|
|
size_t (*render_len)(const pkgconf_list_t *list, bool escape);
|
|
|
|
void (*render_buf)(const pkgconf_list_t *list, char *buf, size_t len, bool escape);
|
|
|
|
} pkgconf_fragment_render_ops_t;
|
|
|
|
|
2017-01-20 00:23:25 +00:00
|
|
|
typedef bool (*pkgconf_fragment_filter_func_t)(const pkgconf_client_t *client, const pkgconf_fragment_t *frag, void *data);
|
2017-09-20 02:48:53 +00:00
|
|
|
PKGCONF_API bool pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string);
|
|
|
|
PKGCONF_API void pkgconf_fragment_copy(const pkgconf_client_t *client, pkgconf_list_t *list, const pkgconf_fragment_t *base, bool is_private);
|
2019-01-14 19:48:02 +00:00
|
|
|
PKGCONF_API void pkgconf_fragment_copy_list(const pkgconf_client_t *client, pkgconf_list_t *list, const pkgconf_list_t *base);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_fragment_delete(pkgconf_list_t *list, pkgconf_fragment_t *node);
|
|
|
|
PKGCONF_API void pkgconf_fragment_free(pkgconf_list_t *list);
|
|
|
|
PKGCONF_API void pkgconf_fragment_filter(const pkgconf_client_t *client, pkgconf_list_t *dest, pkgconf_list_t *src, pkgconf_fragment_filter_func_t filter_func, void *data);
|
2017-12-08 01:13:35 +00:00
|
|
|
PKGCONF_API size_t pkgconf_fragment_render_len(const pkgconf_list_t *list, bool escape, const pkgconf_fragment_render_ops_t *ops);
|
|
|
|
PKGCONF_API void pkgconf_fragment_render_buf(const pkgconf_list_t *list, char *buf, size_t len, bool escape, const pkgconf_fragment_render_ops_t *ops);
|
|
|
|
PKGCONF_API char *pkgconf_fragment_render(const pkgconf_list_t *list, bool escape, const pkgconf_fragment_render_ops_t *ops);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API bool pkgconf_fragment_has_system_dir(const pkgconf_client_t *client, const pkgconf_fragment_t *frag);
|
2012-05-03 20:22:19 +00:00
|
|
|
|
2012-05-04 03:21:51 +00:00
|
|
|
/* fileio.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API char *pkgconf_fgetline(char *line, size_t size, FILE *stream);
|
2012-05-04 03:21:51 +00:00
|
|
|
|
2012-05-07 01:06:48 +00:00
|
|
|
/* tuple.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API pkgconf_tuple_t *pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *parent, const char *key, const char *value, bool parse);
|
|
|
|
PKGCONF_API char *pkgconf_tuple_find(const pkgconf_client_t *client, pkgconf_list_t *list, const char *key);
|
|
|
|
PKGCONF_API char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *list, const char *value);
|
|
|
|
PKGCONF_API void pkgconf_tuple_free(pkgconf_list_t *list);
|
|
|
|
PKGCONF_API void pkgconf_tuple_free_entry(pkgconf_tuple_t *tuple, pkgconf_list_t *list);
|
|
|
|
PKGCONF_API void pkgconf_tuple_add_global(pkgconf_client_t *client, const char *key, const char *value);
|
|
|
|
PKGCONF_API char *pkgconf_tuple_find_global(const pkgconf_client_t *client, const char *key);
|
|
|
|
PKGCONF_API void pkgconf_tuple_free_global(pkgconf_client_t *client);
|
|
|
|
PKGCONF_API void pkgconf_tuple_define_global(pkgconf_client_t *client, const char *kv);
|
2012-05-07 01:06:48 +00:00
|
|
|
|
2012-07-29 08:49:56 +00:00
|
|
|
/* queue.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_queue_push(pkgconf_list_t *list, const char *package);
|
|
|
|
PKGCONF_API bool pkgconf_queue_compile(pkgconf_client_t *client, pkgconf_pkg_t *world, pkgconf_list_t *list);
|
|
|
|
PKGCONF_API void pkgconf_queue_free(pkgconf_list_t *list);
|
|
|
|
PKGCONF_API bool pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queue_apply_func_t func, int maxdepth, void *data);
|
|
|
|
PKGCONF_API bool pkgconf_queue_validate(pkgconf_client_t *client, pkgconf_list_t *list, int maxdepth);
|
2012-07-29 08:49:56 +00:00
|
|
|
|
2013-02-25 23:36:09 +00:00
|
|
|
/* cache.c */
|
2017-12-05 23:32:00 +00:00
|
|
|
PKGCONF_API pkgconf_pkg_t *pkgconf_cache_lookup(pkgconf_client_t *client, const char *id);
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_cache_add(pkgconf_client_t *client, pkgconf_pkg_t *pkg);
|
|
|
|
PKGCONF_API void pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg);
|
|
|
|
PKGCONF_API void pkgconf_cache_free(pkgconf_client_t *client);
|
2013-02-25 23:36:09 +00:00
|
|
|
|
2016-07-10 20:03:58 +00:00
|
|
|
/* audit.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_audit_set_log(pkgconf_client_t *client, FILE *auditf);
|
|
|
|
PKGCONF_API void pkgconf_audit_log(pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3);
|
|
|
|
PKGCONF_API void pkgconf_audit_log_dependency(pkgconf_client_t *client, const pkgconf_pkg_t *dep, const pkgconf_dependency_t *depnode);
|
2016-07-10 20:03:58 +00:00
|
|
|
|
2016-12-01 04:15:13 +00:00
|
|
|
/* path.c */
|
2017-06-05 21:00:02 +00:00
|
|
|
PKGCONF_API void pkgconf_path_add(const char *text, pkgconf_list_t *dirlist, bool filter);
|
|
|
|
PKGCONF_API size_t pkgconf_path_split(const char *text, pkgconf_list_t *dirlist, bool filter);
|
|
|
|
PKGCONF_API size_t pkgconf_path_build_from_environ(const char *envvarname, const char *fallback, pkgconf_list_t *dirlist, bool filter);
|
|
|
|
PKGCONF_API bool pkgconf_path_match_list(const char *path, const pkgconf_list_t *dirlist);
|
|
|
|
PKGCONF_API void pkgconf_path_free(pkgconf_list_t *dirlist);
|
|
|
|
PKGCONF_API bool pkgconf_path_relocate(char *buf, size_t buflen);
|
2018-05-09 21:35:21 +00:00
|
|
|
PKGCONF_API void pkgconf_path_copy_list(pkgconf_list_t *dst, const pkgconf_list_t *src);
|
2016-12-01 04:15:13 +00:00
|
|
|
|
2017-09-13 19:35:28 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-07-25 02:03:17 +00:00
|
|
|
#endif
|