/*
 * This file is part of VoidArchiveTool.
 *
 * Copyright (C) 2025 Yanczi
 *
 * Void Archive Toolis 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 program.  If not, see <https://www.gnu.org/licenses/>.
 */

#pragma once

#include <cstdint>
#include <string>

#define EXTENSION "pak"
#define SIGNATURE "XPAK"

#define SIGNATURE_KEY_FILE   1497713496  // XKEY

#define VERSION	  300

enum StoreMethod
{
	FILTERING		 = -1,
	RAW				 = 0,
	COMPRESS		 = 1,
	ENCRYPT			 = 2,
	COMPRESSxENCRYPT = 3
};


//Prgoram title
#define PROGRAM_TITLE     "eXtendet PAK"
#define PROGRAM_VERSION   "v1.3"
#define PROGRAM_AUTHOR    "Yanczi"
#define PROGRAM_COMPILING "16 November 2025"
#define PROGRAM_LICENSE   "GNU LGPL v3"

//Limity
#define MAX_FILE_SIZE   2147483648    // 2GB
#define MAX_PAK_SIZE    8796093022208 // 8TB

// Metody zapisania pliku
#define RAW_FILE    0
#define ZIP_FILE    1
#define CRYPT_FILE  2
#define CRYPT_ZIP   3

struct CargoHead
{
	std::string signature;
	int16_t version;
	uint32_t files;
	uint64_t table;
};

struct FilesTable
{
	int16_t nameLen;
	std::string nameFile;
	uint64_t hashName;
	uint64_t offset;
	uint32_t size;
	uint64_t crc;
	int16_t flag;
};