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