Files
freebsd-src/cli/spdxtool/util.h
T
Pierre Pronchery fe9da42ef1 Vendor import of pkgconf 3.0.9
Obtained from https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-3.0.9.tar.gz

SHA1: a390f016a7a5ff419c9eef9e2b2c01fe86c11971  -
SHA256: 32310a33bb97425ebc0707cb5af59f9dc05d10282dcd4db628a45ed904993dc6  -
SHA512: 30776d31f860910286b96fbf60a19b5a6d1e73cb6a1077a019d763ae6e5ed1e8d81bc3649978c83f40e5e90ae779f7e530c513b700c8e73bb6399883dd6ef7ab  -

Sponsored by:	The FreeBSD Foundation
2026-11-02 00:28:01 +01:00

139 lines
2.9 KiB
C
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* SPDX-License-Identifier: BSD-2-Clause
*
*​ Copyright (c) 2025 The FreeBSD Foundation
*​
*​ Portions of this software were developed by
* Tuukka Pasanen <[email protected]> under sponsorship from
* the FreeBSD Foundation
*/
#ifndef CLI__SPDXTOOL__UTIL_H
#define CLI__SPDXTOOL__UTIL_H
#include <libpkgconf/libpkgconf.h>
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SPDXTOOL_SEPARATOR_COLON 0x80
typedef struct spdxtool_core_agent_
{
char *spdx_id;
const char *type;
char *creation_info;
char *name;
} spdxtool_core_agent_t;
typedef struct spdxtool_core_tool_
{
char *spdx_id;
const char *type;
char *creation_info;
char *name;
} spdxtool_core_tool_t;
typedef struct spdxtool_core_creation_info_
{
char *id;
const char *type;
char *created;
char *created_by;
char *create_using;
char *created_using;
char *spec_version;
} spdxtool_core_creation_info_t;
typedef struct spdxtool_core_spdx_document
{
const char *type;
char *spdx_id;
char *creation_info;
char *agent;
pkgconf_list_t licenses;
pkgconf_list_t element;
pkgconf_list_t rootElement;
pkgconf_list_t relationships;
pkgconf_list_t packages;
pkgconf_list_t maintainers;
} spdxtool_core_spdx_document_t;
typedef struct spdxtool_software_sbom_
{
char *spdx_id;
const char *type;
char *creation_info;
char *sbom_type;
spdxtool_core_spdx_document_t *spdx_document;
pkgconf_pkg_t *rootElement;
} spdxtool_software_sbom_t;
typedef struct spdxtool_simplelicensing_license_expression_
{
const char *type;
char *spdx_id;
char *license_expression;
} spdxtool_simplelicensing_license_expression_t;
typedef struct spdxtool_core_relationship_
{
const char *type;
char *spdx_id;
char *creation_info;
char *from;
pkgconf_list_t *to;
char *relationship_type;
char *scope;
} spdxtool_core_relationship_t;
void
spdxtool_util_set_key(pkgconf_client_t *client, const char *key, const char *key_value, const char *key_default);
void
spdxtool_util_set_uri_root(pkgconf_client_t *client, const char *uri_root);
void
spdxtool_util_set_uri_separator_colon(pkgconf_client_t *client, bool sep);
char
spdxtool_util_get_uri_separator(pkgconf_client_t *client);
const char *
spdxtool_util_get_uri_root(pkgconf_client_t *client);
void
spdxtool_util_set_spdx_version(pkgconf_client_t *client, const char *spdx_version);
const char *
spdxtool_util_get_spdx_version(pkgconf_client_t *client);
void
spdxtool_util_set_spdx_license(pkgconf_client_t *client, const char *spdx_license);
char *
spdxtool_util_get_spdx_id_int(pkgconf_client_t *client, const char *part);
char *
spdxtool_util_get_spdx_id_string(pkgconf_client_t *client, const char *part, const char *string_id);
char *
spdxtool_util_get_iso8601_time(time_t *wanted_time);
char *
spdxtool_util_get_current_iso8601_time(void);
char *
spdxtool_util_string_correction(char *str);
char *
spdxtool_util_tuple_lookup(pkgconf_client_t *client, pkgconf_list_t *vars, const char *key);
#ifdef __cplusplus
}
#endif
#endif