xref: /freebsd/contrib/pkgconf/cli/spdxtool/generate.h (revision 592efe252472a3385acf36b1f49ecf710a7f3d9c)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  *​ Copyright (c) 2025 The FreeBSD Foundation
5  *​
6  *​ Portions of this software were developed by
7  * Tuukka Pasanen <tuukka.pasanen@ilmi.fi> under sponsorship from
8  * the FreeBSD Foundation
9  */
10 
11 #ifndef SPDXTOOL_GENERATE_H
12 #define SPDXTOOL_GENERATE_H
13 
14 #include <stdio.h>
15 #include <libpkgconf/libpkgconf.h>
16 
17 /*
18  * Build an SPDX SBOM for a solved dependency graph and write it to *out*.
19  *
20  * The dependency graph rooted at *world* must already have been solved (e.g.
21  * with pkgconf_queue_solve) so that every package's match is populated.  The
22  * spdxtool_util_set_* configuration (URI root, separator, version, license)
23  * must have been applied to *client* beforehand.
24  */
25 bool spdxtool_generate(pkgconf_client_t *client, pkgconf_pkg_t *world, FILE *out,
26 	int maxdepth, const char *creation_time, const char *creation_id,
27 	const char *agent_name);
28 
29 #endif
30