2020-10-09 10:58:53 +01:00
|
|
|
/*
|
|
|
|
* legal_info.h
|
|
|
|
*
|
2024-04-12 10:47:36 +01:00
|
|
|
* Copyright (c) 2020-2024, DarkMatterCore <pabloacurielz@gmail.com>.
|
2020-10-09 10:58:53 +01:00
|
|
|
*
|
|
|
|
* This file is part of nxdumptool (https://github.com/DarkMatterCore/nxdumptool).
|
|
|
|
*
|
2021-03-25 19:26:58 +00:00
|
|
|
* nxdumptool is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2020-10-09 10:58:53 +01:00
|
|
|
*
|
2021-03-25 19:26:58 +00:00
|
|
|
* nxdumptool is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2020-10-09 10:58:53 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-03-25 19:26:58 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2020-10-09 10:58:53 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef __LEGAL_INFO_H__
|
|
|
|
#define __LEGAL_INFO_H__
|
|
|
|
|
2022-07-05 00:25:28 +01:00
|
|
|
#include "romfs.h"
|
2020-10-09 10:58:53 +01:00
|
|
|
|
2021-03-24 17:25:19 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-10-09 10:58:53 +01:00
|
|
|
typedef struct {
|
|
|
|
NcaContext *nca_ctx; ///< Pointer to the NCA context for the LegalInformation NCA from which XML data is retrieved.
|
|
|
|
char *authoring_tool_xml; ///< Pointer to a dynamically allocated, NULL-terminated buffer that holds AuthoringTool-like XML data.
|
|
|
|
u64 authoring_tool_xml_size; ///< Size for the AuthoringTool-like XML. This is essentially the same as using strlen() on 'authoring_tool_xml'.
|
|
|
|
} LegalInfoContext;
|
|
|
|
|
|
|
|
/// Initializes a LegalInfoContext using a previously initialized NcaContext (which must belong to a LegalInformation NCA).
|
|
|
|
bool legalInfoInitializeContext(LegalInfoContext *out, NcaContext *nca_ctx);
|
|
|
|
|
|
|
|
/// Helper inline functions.
|
|
|
|
|
|
|
|
NX_INLINE void legalInfoFreeContext(LegalInfoContext *legal_info_ctx)
|
|
|
|
{
|
|
|
|
if (!legal_info_ctx) return;
|
|
|
|
if (legal_info_ctx->authoring_tool_xml) free(legal_info_ctx->authoring_tool_xml);
|
|
|
|
memset(legal_info_ctx, 0, sizeof(LegalInfoContext));
|
|
|
|
}
|
|
|
|
|
2021-03-23 14:06:52 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2021-03-24 17:25:19 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __LEGAL_INFO_H__ */
|