]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/index.h
Imported to git.
[icculus/xz.git] / src / liblzma / api / lzma / index.h
1 /**
2  * \file        lzma/index.h
3  * \brief       Handling of Index lists
4  *
5  * \author      Copyright (C) 1999-2006 Igor Pavlov
6  * \author      Copyright (C) 2007 Lasse Collin
7  *
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.
12  *
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.
17  */
18
19 #ifndef LZMA_H_INTERNAL
20 #       error Never include this file directly. Use <lzma.h> instead.
21 #endif
22
23
24 /**
25  * \brief
26  *
27  * FIXME desc
28  */
29 typedef struct lzma_index_s lzma_index;
30 struct lzma_index_s {
31         /**
32          * \brief       Total Size of the Block
33          *
34          * This includes Block Header, Compressed Data, and Block Footer.
35          */
36         lzma_vli total_size;
37
38         /**
39          * \brief       Uncompressed Size of the Block
40          */
41         lzma_vli uncompressed_size;
42
43         /**
44          * \brief       Pointer to the next Index Record
45          *
46          * This is NULL on the last Index Record.
47          */
48         lzma_index *next;
49 };
50
51
52 /**
53  * \brief       Duplicates an Index list
54  *
55  * \return      A copy of the Index list, or NULL if memory allocation
56  *              failed or the original Index was empty.
57  */
58 extern lzma_index *lzma_index_dup(
59                 const lzma_index *index, lzma_allocator *allocator);
60
61
62 /**
63  * \brief       Frees an Index list
64  *
65  * All Index Recors in the list are freed. This function is convenient when
66  * getting rid of lzma_metadata structures containing an Index.
67  */
68 extern void lzma_index_free(lzma_index *index, lzma_allocator *allocator);
69
70
71 /**
72  * \brief       Calculates information about the Index
73  *
74  * \return      LZMA_OK on success, LZMA_PROG_ERROR on error. FIXME
75  */
76 extern lzma_ret lzma_index_count(const lzma_index *index, size_t *count,
77                 lzma_vli *lzma_restrict total_size,
78                 lzma_vli *lzma_restrict uncompressed_size);
79
80
81 /**
82  * \brief       Compares if two Index lists are identical
83  */
84 extern lzma_bool lzma_index_is_equal(const lzma_index *a, const lzma_index *b);