3 * \brief Handling of Extra Records in Metadata
5 * \author Copyright (C) 1999-2006 Igor Pavlov
6 * \author Copyright (C) 2007 Lasse Collin
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
19 #ifndef LZMA_H_INTERNAL
20 # error Never include this file directly. Use <lzma.h> instead.
27 * See the .lzma file format specification for description what each
28 * Extra Record type exactly means.
30 * If you ever need to update .lzma files with Extra Records, note that
31 * the Record IDs are divided in two categories:
32 * - Safe-to-Copy Records may be preserved as is when the
33 * Stream is modified in ways that don't change the actual
34 * uncompressed data. Examples of such operatings include
35 * recompressing and adding, modifying, or deleting unrelated
37 * - Unsafe-to-Copy Records should be removed (and possibly
38 * recreated) when any kind of changes are made to the Stream.
41 #define LZMA_EXTRA_PADDING 0x00
42 #define LZMA_EXTRA_OPENPGP 0x01
43 #define LZMA_EXTRA_FILTERS 0x02
44 #define LZMA_EXTRA_COMMENT 0x03
45 #define LZMA_EXTRA_CHECKS 0x04
46 #define LZMA_EXTRA_FILENAME 0x05
47 #define LZMA_EXTRA_MTIME 0x07
48 #define LZMA_EXTRA_MTIME_HR 0x09
49 #define LZMA_EXTRA_MIME_TYPE 0x0B
50 #define LZMA_EXTRA_HOMEPAGE 0x0D
54 * \brief Extra Records
56 * The .lzma format provides a way to store custom information along
57 * the actual compressed content. Information about these Records
58 * are passed to and from liblzma via this linked list.
60 typedef struct lzma_extra_s lzma_extra;
63 * \brief Pointer to the next Extra Record
65 * This is NULL on the last Extra Record.
72 * Extra Record IDs are divided in three categories:
73 * - Zero is a special case used for padding. It doesn't have
74 * Size of Data fields.
75 * - Odd IDs (1, 3, 5, ...) are Safe-to-Copy IDs.
76 * These can be preserved as is if the Stream is
77 * modified in a way that doesn't alter the actual
78 * uncompressed content.
79 * - Even IDs (2, 4, 6, ...) are Unsafe-to-Copy IDs.
80 * If the .lzma Stream is modified in any way,
81 * the Extra Records having a sensitive ID should
82 * be removed or updated accordingly.
84 * Refer to the .lzma file format specification for
85 * the up to date list of Extra Record IDs.
90 * \brief Size of the Record data
92 * In case of strings, this should not include the
100 * Record data is often a string in UTF-8 encoding,
101 * but it can be arbitrary binary data. In case of
102 * strings, the trailing '\0' is usually not stored
105 * To ease working with Extra Records containing strings,
106 * liblzma always adds '\0' to the end of data even when
107 * it wasn't present in the .lzma file. This '\0' is not
108 * counted in the size of the data.
114 extern void lzma_extra_free(lzma_extra *extra, lzma_allocator *allocator);