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