2023-01-12 20:04:52 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022-2023, apio.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*
|
|
|
|
* tar.h: tar header structure.
|
|
|
|
*/
|
|
|
|
|
2022-11-05 19:10:48 +00:00
|
|
|
#ifndef MINITAR_TAR_H
|
|
|
|
#define MINITAR_TAR_H
|
|
|
|
|
2022-11-23 19:52:18 +00:00
|
|
|
// Format of a raw standard tar header.
|
|
|
|
|
2023-01-08 11:47:09 +00:00
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
2022-11-06 10:02:26 +00:00
|
|
|
struct tar_header
|
|
|
|
{
|
|
|
|
char name[100];
|
|
|
|
char mode[8];
|
|
|
|
char uid[8];
|
|
|
|
char gid[8];
|
|
|
|
char size[12];
|
|
|
|
char mtime[12];
|
|
|
|
char chksum[8];
|
|
|
|
char typeflag;
|
|
|
|
char linkname[100];
|
|
|
|
char magic[6];
|
|
|
|
char version[2];
|
|
|
|
char uname[32];
|
|
|
|
char gname[32];
|
|
|
|
char devmajor[8];
|
|
|
|
char devminor[8];
|
|
|
|
char prefix[155];
|
2022-11-23 19:52:18 +00:00
|
|
|
|
|
|
|
char padding[12]; // Not part of the header, only used to make the structure 512 bytes
|
2023-01-08 11:47:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
2022-11-05 19:10:48 +00:00
|
|
|
|
2022-12-31 11:51:47 +00:00
|
|
|
#endif
|