VirtualBox

source: vbox/trunk/include/iprt/formats/xar.h

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 * IPRT - Extensible Archiver (XAR) format.
3 */
4
5/*
6 * Copyright (C) 2013-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef IPRT_INCLUDED_formats_xar_h
37#define IPRT_INCLUDED_formats_xar_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <iprt/types.h>
43#include <iprt/assertcompile.h>
44
45
46/** @defgroup grp_rt_formats_xar Extensible Archive (XAR) format
47 * @ingroup grp_rt_formats
48 *
49 * @{ */
50
51#pragma pack(4) /* Misdesigned header, not 8-byte aligned size. */
52typedef struct XARHEADER
53{
54 /** The magic number 'xar!' (XAR_HEADER_MAGIC). */
55 uint32_t u32Magic;
56 /** The size of this header structure. */
57 uint16_t cbHeader;
58 /** The header version structure. */
59 uint16_t uVersion;
60 /** The size of the compressed table of content (TOC). */
61 uint64_t cbTocCompressed;
62 /** The size of the table of context (TOC) when not compressed. */
63 uint64_t cbTocUncompressed;
64 /** Which cryptographic hash function is used (XAR_HASH_XXX). */
65 uint32_t uHashFunction;
66} XARHEADER;
67#pragma pack()
68AssertCompileSize(XARHEADER, 28);
69/** Pointer to a XAR header. */
70typedef XARHEADER *PXARHEADER;
71/** Pointer to a const XAR header. */
72typedef XARHEADER const *PCXARHEADER;
73
74/** XAR magic value (on disk endian). */
75#define XAR_HEADER_MAGIC RT_H2LE_U32(RT_MAKE_U32_FROM_U8('x', 'a', 'r', '!'))
76/** The current header version value (host endian). */
77#define XAR_HEADER_VERSION 1
78
79/** @name XAR hashing functions.
80 * @{ */
81#define XAR_HASH_NONE 0
82#define XAR_HASH_SHA1 1
83#define XAR_HASH_MD5 2
84#define XAR_HASH_MAX 2
85/** @} */
86
87/** @} */
88
89#endif /* !IPRT_INCLUDED_formats_xar_h */
90
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use