2025-08-01 21:10:36 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Aaru Data Preservation Suite.
|
|
|
|
|
* Copyright (c) 2019-2025 Natalia Portillo.
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library 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
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LIBAARUFORMAT_INTERNAL_H
|
|
|
|
|
#define LIBAARUFORMAT_INTERNAL_H
|
|
|
|
|
|
|
|
|
|
#include "utarray.h"
|
|
|
|
|
|
|
|
|
|
UT_array *process_index_v1(aaruformatContext *ctx);
|
|
|
|
|
int32_t verify_index_v1(aaruformatContext *ctx);
|
2025-08-01 21:18:48 +01:00
|
|
|
UT_array *process_index_v2(aaruformatContext *ctx);
|
|
|
|
|
int32_t verify_index_v2(aaruformatContext *ctx);
|
2025-08-03 17:45:20 +01:00
|
|
|
UT_array *process_index_v3(aaruformatContext *ctx);
|
|
|
|
|
int32_t verify_index_v3(aaruformatContext *ctx);
|
2025-08-02 14:25:15 +01:00
|
|
|
int32_t process_data_block(aaruformatContext *ctx, IndexEntry *entry);
|
2025-09-30 15:11:27 +01:00
|
|
|
int32_t process_ddt_v1(aaruformatContext *ctx, IndexEntry *entry, bool *found_user_data_ddt);
|
|
|
|
|
int32_t process_ddt_v2(aaruformatContext *ctx, IndexEntry *entry, bool *found_user_data_ddt);
|
2025-08-02 16:11:26 +01:00
|
|
|
void process_metadata_block(aaruformatContext *ctx, const IndexEntry *entry);
|
|
|
|
|
void process_geometry_block(aaruformatContext *ctx, const IndexEntry *entry);
|
2025-08-02 16:17:57 +01:00
|
|
|
void process_tracks_block(aaruformatContext *ctx, const IndexEntry *entry);
|
2025-08-02 16:21:50 +01:00
|
|
|
void process_cicm_block(aaruformatContext *ctx, const IndexEntry *entry);
|
2025-08-02 16:46:04 +01:00
|
|
|
void process_dumphw_block(aaruformatContext *ctx, const IndexEntry *entry);
|
2025-08-02 16:49:53 +01:00
|
|
|
void process_checksum_block(aaruformatContext *ctx, const IndexEntry *entry);
|
2025-08-03 17:45:20 +01:00
|
|
|
void add_subindex_entries(aaruformatContext *ctx, UT_array *index_entries, IndexEntry *subindex_entry);
|
2025-09-30 15:11:27 +01:00
|
|
|
int32_t decode_ddt_entry_v1(aaruformatContext *ctx, uint64_t sector_address, uint64_t *offset, uint64_t *block_offset,
|
|
|
|
|
uint8_t *sector_status);
|
|
|
|
|
int32_t decode_ddt_entry_v2(aaruformatContext *ctx, uint64_t sector_address, uint64_t *offset, uint64_t *block_offset,
|
|
|
|
|
uint8_t *sector_status);
|
|
|
|
|
int32_t decode_ddt_single_level_v2(aaruformatContext *ctx, uint64_t sector_address, uint64_t *offset,
|
|
|
|
|
uint64_t *block_offset, uint8_t *sector_status);
|
|
|
|
|
int32_t decode_ddt_multi_level_v2(aaruformatContext *ctx, uint64_t sector_address, uint64_t *offset,
|
|
|
|
|
uint64_t *block_offset, uint8_t *sector_status);
|
2025-09-30 18:47:38 +01:00
|
|
|
bool set_ddt_entry_v2(aaruformatContext *ctx, uint64_t sector_address, uint64_t offset, uint64_t block_offset,
|
2025-09-30 15:11:27 +01:00
|
|
|
uint8_t sector_status);
|
2025-09-30 18:47:38 +01:00
|
|
|
bool set_ddt_single_level_v2(aaruformatContext *ctx, uint64_t sector_address, bool negative, uint64_t offset,
|
2025-09-30 15:11:27 +01:00
|
|
|
uint64_t block_offset, uint8_t sector_status);
|
2025-09-30 18:47:38 +01:00
|
|
|
bool set_ddt_multi_level_v2(aaruformatContext *ctx, uint64_t sector_address, bool negative, uint64_t offset,
|
2025-09-30 15:11:27 +01:00
|
|
|
uint64_t block_offset, uint8_t sector_status);
|
2025-08-07 15:43:35 +01:00
|
|
|
aaru_options parse_options(const char *options);
|
|
|
|
|
uint64_t get_filetime_uint64();
|
2025-08-13 16:17:45 +01:00
|
|
|
int32_t aaruf_close_current_block(aaruformatContext *ctx);
|
2025-08-01 21:10:36 +01:00
|
|
|
|
|
|
|
|
#endif // LIBAARUFORMAT_INTERNAL_H
|