]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/init.h
Removed src/liblzma/common/sysdefs.h symlink, which was
[icculus/xz.git] / src / liblzma / api / lzma / init.h
1 /**
2  * \file        lzma/init.h
3  * \brief       Initializations
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       Initialize all internal static variables
26  *
27  * Depending on the build options, liblzma may have some internal static
28  * variables, that must be initialized before using any other part of
29  * the library (*). It is recommended to do these initializations in the very
30  * beginning of the application by calling appropriate initialization function.
31  *
32  * (*) There are some exceptions to this rule. FIXME
33  *
34  * The initialization functions are not necessarily thread-safe, thus the
35  * required initializations must be done before creating any threads. (The
36  * rest of the functions of liblzma are thread-safe.) Calling the
37  * initialization functions multiple times does no harm, although it
38  * still shouldn't be done when there are multiple threads running.
39  *
40  * lzma_init() initializes all internal static variables by calling
41  * lzma_lzma_init_encoder() and lzma_init_decoder().
42  *
43  * If you need only encoder, decoder, or neither-encoder-nor-decoder
44  * functions, you may use other initialization functions, which initialize
45  * only a subset of liblzma's internal static variables. Using those
46  * functions have the following advantages:
47  *  - When linking statically against liblzma, less useless functions will
48  *    get linked into the binary. E.g. if you need only the decoder functions,
49  *    using lzma_init_decoder() avoids linking bunch of encoder related code.
50  *  - There is less things to initialize, making the initialization
51  *    process slightly faster.
52  */
53 extern void lzma_init(void);
54
55
56 /**
57  * \brief       Initialize internal static variables needed by encoders
58  *
59  * If you need only the encoder functions, you may use this function to
60  * initialize only the things required by encoders.
61  *
62  * This function also calls lzma_init_check().
63  */
64 extern void lzma_init_encoder(void);
65
66
67 /**
68  * \brief       Initialize internal static variables needed by decoders
69  *
70  * If you need only the decoder functions, you may use this function to
71  * initialize only the things required by decoders.
72  *
73  * This function also calls lzma_init_check().
74  */
75 extern void lzma_init_decoder(void);
76
77
78 /**
79  * \brief       Initialize internal static variables needed by integrity checks
80  *
81  * Currently this initializes CRC32 and CRC64 lookup tables if precalculated
82  * tables haven't been built into the library. This function can be useful
83  * if the only thing you need from liblzma is the integrity check functions.
84  */
85 extern void lzma_init_check(void);