diff options
| author | root <root@dc13.lemmi> | 2020-07-21 10:00:46 +0200 |
|---|---|---|
| committer | root <root@dc13.lemmi> | 2020-07-21 10:00:46 +0200 |
| commit | 1192c4575ea7afdf38e3fa0df4587a08620af11e (patch) | |
| tree | 6910a62487c282d0840d2e668aa7eb40b7c8a3fd /project/src/lib-pack.h | |
| parent | 76de8a89f7c1d1b4522eb66e8f89d248e8c1781f (diff) | |
SZS v2.18a
Diffstat (limited to 'project/src/lib-pack.h')
| -rw-r--r-- | project/src/lib-pack.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/project/src/lib-pack.h b/project/src/lib-pack.h new file mode 100644 index 0000000..ab343ec --- /dev/null +++ b/project/src/lib-pack.h @@ -0,0 +1,104 @@ + +/*************************************************************************** + * _______ _______ _______ * + * | ___ |____ | ___ | * + * | | |_| / /| | |_| * + * | |_____ / / | |_____ * + * |_____ | / / |_____ | * + * _ | | / / _ | | * + * | |___| |/ /____| |___| | * + * |_______|_______|_______| * + * * + * Wiimms SZS Tools * + * https://szs.wiimm.de/ * + * * + *************************************************************************** + * * + * This file is part of the SZS project. * + * Visit https://szs.wiimm.de/ for project details and sources. * + * * + * Copyright (c) 2011-2020 by Dirk Clemens <wiimm@wiimm.de> * + * * + *************************************************************************** + * * + * This program 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 2 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 General Public License for more details. * + * * + * See file gpl-2.0.txt or http://www.gnu.org/licenses/gpl-2.0.txt * + * * + ***************************************************************************/ + +/////////////////////////////////////////////////////////////////////////////// + +#ifndef SZS_LIB_PACK_H +#define SZS_LIB_PACK_H 1 + +#include "lib-szs.h" + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// PACK support /////////////// +/////////////////////////////////////////////////////////////////////////////// + +#define PACK_MAGIC "PACK" +#define PACK_MAGIC_NUM 0x5041434b + +#define PACK_METRIC_ALIGN 0x10 +#define PACK_SUBFILE_ALIGN 0x20 + +/////////////////////////////////////////////////////////////////////////////// + +typedef struct pack_header_t +{ + u32 magic; // := PACK_MAGIC_NUM + u32 file_size; // total size of pack file + u32 n_files; // total number of subfiles + u32 offset_metric; // offset to (offset,size) table + char name_pool[0]; // pool with names +} +__attribute__ ((packed)) pack_header_t; + +/////////////////////////////////////////////////////////////////////////////// + +typedef struct pack_metric_t +{ + u32 offset; // offset of subfile + u32 size; // size of subfile +} +__attribute__ ((packed)) pack_metric_t; + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// PACK interface /////////////// +/////////////////////////////////////////////////////////////////////////////// + +int IterateFilesPACK +( + struct szs_iterator_t *it, // iterator struct with all infos + bool term // true: termination hint +); + +/////////////////////////////////////////////////////////////////////////////// + +enumError CreatePACK +( + szs_file_t * szs, // valid szs + ccp source_dir, // NULL or path to source dir + u8 * source_data, // NULL or source data + u32 total_size, // total file size + SetupParam_t * setup_param // NULL or setup parameters +); + +// +/////////////////////////////////////////////////////////////////////////////// +/////////////// END /////////////// +/////////////////////////////////////////////////////////////////////////////// + +#endif // SZS_LIB_PACK_H |
