xref: /freebsd/contrib/pkgconf/cli/spdxtool/core.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 CLI__SPDXTOOL__CORE_H
12*592efe25SPierre Pronchery #define CLI__SPDXTOOL__CORE_H
13*592efe25SPierre Pronchery 
14*592efe25SPierre Pronchery #include <stdlib.h>
15*592efe25SPierre Pronchery #include "util.h"
16*592efe25SPierre Pronchery #include "serialize.h"
17*592efe25SPierre Pronchery 
18*592efe25SPierre Pronchery #ifdef __cplusplus
19*592efe25SPierre Pronchery extern "C" {
20*592efe25SPierre Pronchery #endif
21*592efe25SPierre Pronchery 
22*592efe25SPierre Pronchery spdxtool_core_agent_t *
23*592efe25SPierre Pronchery spdxtool_core_agent_new(pkgconf_client_t *client, const char *creation_id, const char *name);
24*592efe25SPierre Pronchery 
25*592efe25SPierre Pronchery void
26*592efe25SPierre Pronchery spdxtool_core_agent_free(spdxtool_core_agent_t *agent);
27*592efe25SPierre Pronchery 
28*592efe25SPierre Pronchery spdxtool_serialize_value_t *
29*592efe25SPierre Pronchery spdxtool_core_agent_to_object(pkgconf_client_t *client, const spdxtool_core_agent_t *agent);
30*592efe25SPierre Pronchery 
31*592efe25SPierre Pronchery spdxtool_core_creation_info_t *
32*592efe25SPierre Pronchery spdxtool_core_creation_info_new(pkgconf_client_t *client, const char *agent_id, const char *id, const char *time);
33*592efe25SPierre Pronchery 
34*592efe25SPierre Pronchery void
35*592efe25SPierre Pronchery spdxtool_core_creation_info_free(spdxtool_core_creation_info_t *creation);
36*592efe25SPierre Pronchery 
37*592efe25SPierre Pronchery spdxtool_serialize_value_t *
38*592efe25SPierre Pronchery spdxtool_core_creation_info_to_object(pkgconf_client_t *client, const spdxtool_core_creation_info_t *creation);
39*592efe25SPierre Pronchery 
40*592efe25SPierre Pronchery spdxtool_core_spdx_document_t *
41*592efe25SPierre Pronchery spdxtool_core_spdx_document_new(pkgconf_client_t *client, const char *spdx_id, const char *creation_id, const char *agent_id);
42*592efe25SPierre Pronchery 
43*592efe25SPierre Pronchery bool
44*592efe25SPierre Pronchery spdxtool_core_spdx_document_is_license(pkgconf_client_t *client, const spdxtool_core_spdx_document_t *spdx, const char *license);
45*592efe25SPierre Pronchery 
46*592efe25SPierre Pronchery bool
47*592efe25SPierre Pronchery spdxtool_core_spdx_document_add_license(pkgconf_client_t *client, spdxtool_core_spdx_document_t *spdx, const char *license);
48*592efe25SPierre Pronchery 
49*592efe25SPierre Pronchery bool
50*592efe25SPierre Pronchery spdxtool_core_spdx_document_add_relationship(pkgconf_client_t *client, spdxtool_core_spdx_document_t *spdx, spdxtool_core_relationship_t *relationship);
51*592efe25SPierre Pronchery 
52*592efe25SPierre Pronchery bool
53*592efe25SPierre Pronchery spdxtool_core_spdx_document_add_package(pkgconf_client_t *client, spdxtool_core_spdx_document_t *spdx, pkgconf_pkg_t *pkg);
54*592efe25SPierre Pronchery 
55*592efe25SPierre Pronchery bool
56*592efe25SPierre Pronchery spdxtool_core_spdx_document_add_element(pkgconf_client_t *client, spdxtool_core_spdx_document_t *spdx, const char *element);
57*592efe25SPierre Pronchery 
58*592efe25SPierre Pronchery const char *
59*592efe25SPierre Pronchery spdxtool_core_spdx_document_add_maintainer(pkgconf_client_t *client, spdxtool_core_spdx_document_t *spdx, const char *name);
60*592efe25SPierre Pronchery 
61*592efe25SPierre Pronchery void
62*592efe25SPierre Pronchery spdxtool_core_spdx_document_free(spdxtool_core_spdx_document_t *spdx);
63*592efe25SPierre Pronchery 
64*592efe25SPierre Pronchery spdxtool_serialize_value_t *
65*592efe25SPierre Pronchery spdxtool_core_spdx_document_to_object(pkgconf_client_t *client, spdxtool_core_spdx_document_t *spdx);
66*592efe25SPierre Pronchery 
67*592efe25SPierre Pronchery spdxtool_core_relationship_t *
68*592efe25SPierre Pronchery spdxtool_core_relationship_new(pkgconf_client_t *client, const char *creation_info_id, const char *spdx_id, const char *from, pkgconf_list_t *to, const char *relationship_type);
69*592efe25SPierre Pronchery 
70*592efe25SPierre Pronchery bool
71*592efe25SPierre Pronchery spdxtool_core_relationship_set_scope(pkgconf_client_t *client, spdxtool_core_relationship_t *relationship, const char *scope);
72*592efe25SPierre Pronchery 
73*592efe25SPierre Pronchery void
74*592efe25SPierre Pronchery spdxtool_core_relationship_free(spdxtool_core_relationship_t *relationship);
75*592efe25SPierre Pronchery 
76*592efe25SPierre Pronchery spdxtool_serialize_value_t *
77*592efe25SPierre Pronchery spdxtool_core_relationship_to_object(pkgconf_client_t *client, const spdxtool_core_relationship_t *relationship);
78*592efe25SPierre Pronchery 
79*592efe25SPierre Pronchery #ifdef __cplusplus
80*592efe25SPierre Pronchery }
81*592efe25SPierre Pronchery #endif
82*592efe25SPierre Pronchery 
83*592efe25SPierre Pronchery #endif
84