3 * \brief Initializations
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.
25 * \brief Initialize all internal static variables
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.
32 * (*) There are some exceptions to this rule. FIXME
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.
40 * lzma_init() initializes all internal static variables by calling
41 * lzma_init_encoder() and lzma_init_decoder().
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.
53 extern void lzma_init(void);
57 * \brief Initialize internal static variables needed by encoders
59 * If you need only the encoder functions, you may use this function to
60 * initialize only the things required by encoders.
62 * This function also calls lzma_init_check().
64 extern void lzma_init_encoder(void);
68 * \brief Initialize internal static variables needed by decoders
70 * If you need only the decoder functions, you may use this function to
71 * initialize only the things required by decoders.
73 * This function also calls lzma_init_check().
75 extern void lzma_init_decoder(void);
79 * \brief Initialize internal static variables needed by integrity checks
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.
85 extern void lzma_init_check(void);