12
12
#ifndef NRF_COMPRESS_IMPLEMENTATION_H_
13
13
#define NRF_COMPRESS_IMPLEMENTATION_H_
14
14
15
+ #include "lzma_types.h"
15
16
#include <stdint.h>
16
17
#include <stdlib.h>
17
18
#include <zephyr/kernel.h>
@@ -32,7 +33,8 @@ extern "C" {
32
33
* @typedef nrf_compress_init_func_t
33
34
* @brief Initialize compression implementation.
34
35
*
35
- * @param[in] inst Reserved for future use, must be NULL.
36
+ * @param[in] inst Implementation specific initialization context.
37
+ * Concrete implementation may cast it to predefined type.
36
38
*
37
39
* @retval 0 Success.
38
40
* @retval -errno Negative errno code on other failure.
@@ -43,7 +45,8 @@ typedef int (*nrf_compress_init_func_t)(void *inst);
43
45
* @typedef nrf_compress_deinit_func_t
44
46
* @brief De-initialize compression implementation.
45
47
*
46
- * @param[in] inst Reserved for future use, must be NULL.
48
+ * @param[in] inst Implementation specific initialization context.
49
+ * Concrete implementation may cast it to predefined type.
47
50
*
48
51
* @retval 0 Success.
49
52
* @retval -errno Negative errno code on other failure.
@@ -55,7 +58,8 @@ typedef int (*nrf_compress_deinit_func_t)(void *inst);
55
58
* @brief Reset compression state function. Used to abort current compression or
56
59
* decompression task before starting a new one.
57
60
*
58
- * @param[in] inst Reserved for future use, must be NULL.
61
+ * @param[in] inst Implementation specific initialization context.
62
+ * Concrete implementation may cast it to predefined type.
59
63
*
60
64
* @retval 0 Success.
61
65
* @retval -errno Negative errno code on other failure.
@@ -66,7 +70,8 @@ typedef int (*nrf_compress_reset_func_t)(void *inst);
66
70
* @typedef nrf_compress_compress_func_t
67
71
* @brief Placeholder function for future use, do not use.
68
72
*
69
- * @param[in] inst Reserved for future use, must be NULL.
73
+ * @param[in] inst Implementation specific initialization context.
74
+ * Concrete implementation may cast it to predefined type.
70
75
*
71
76
* @retval 0 Success.
72
77
* @retval -errno Negative errno code on other failure.
@@ -80,7 +85,8 @@ typedef int (*nrf_compress_compress_func_t)(void *inst);
80
85
* be provided if more is not available (for example, end of data or data is
81
86
* is being streamed).
82
87
*
83
- * @param[in] inst Reserved for future use, must be NULL.
88
+ * @param[in] inst Implementation specific initialization context.
89
+ * Concrete implementation may cast it to predefined type.
84
90
*
85
91
* @retval Positive value Success indicating chunk size.
86
92
* @retval -errno Negative errno code on other failure.
@@ -92,7 +98,8 @@ typedef size_t (*nrf_compress_decompress_bytes_needed_t)(void *inst);
92
98
* be called one or more times with compressed data to decompress it
93
99
* into its natural form.
94
100
*
95
- * @param[in] inst Reserved for future use, must be NULL.
101
+ * @param[in] inst Implementation specific initialization context.
102
+ * Concrete implementation may cast it to predefined type.
96
103
* @param[in] input Input data buffer, containing the compressed data.
97
104
* @param[in] input_size Size of the input data buffer.
98
105
* @param[in] last_part Last part of compressed data. This should be set to true if this is
@@ -103,9 +110,13 @@ typedef size_t (*nrf_compress_decompress_bytes_needed_t)(void *inst);
103
110
* offset the input data buffer by this amount of bytes.
104
111
* @param[out] output Output data buffer pointer to pointer. This will be set to the
105
112
* compression's output buffer when decompressed data is available to
106
- * be used or copied.
107
- * @param[out] output_size Size of data in output data buffer pointer. Data should only be
108
- * read when the value in this pointer is greater than 0.
113
+ * be used or copied. WARNING: For LZMA implementation, it is only
114
+ * valid if no external dictionary is used. For external dictionary
115
+ * variant (indicated by *inst parameter in init function), this
116
+ * will be set to NULL and user should read from ones own dictionary.
117
+ * @param[out] output_size Size of data in output data buffer pointer (or in external
118
+ * dictionary). Data should only be read when the value in this pointer
119
+ * is greater than 0.
109
120
*
110
121
* @retval 0 Success.
111
122
* @retval -errno Negative errno code on other failure.
0 commit comments