diff options
Diffstat (limited to 'archival/libarchive/unxz/xz.h')
-rw-r--r-- | archival/libarchive/unxz/xz.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/archival/libarchive/unxz/xz.h b/archival/libarchive/unxz/xz.h index c6c071c4a..e0b22db56 100644 --- a/archival/libarchive/unxz/xz.h +++ b/archival/libarchive/unxz/xz.h | |||
@@ -19,6 +19,10 @@ | |||
19 | # include <stdint.h> | 19 | # include <stdint.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifdef __cplusplus | ||
23 | extern "C" { | ||
24 | #endif | ||
25 | |||
22 | /* In Linux, this is used to make extern functions static when needed. */ | 26 | /* In Linux, this is used to make extern functions static when needed. */ |
23 | #ifndef XZ_EXTERN | 27 | #ifndef XZ_EXTERN |
24 | # define XZ_EXTERN extern | 28 | # define XZ_EXTERN extern |
@@ -70,7 +74,7 @@ enum xz_mode { | |||
70 | * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding | 74 | * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding |
71 | * is still possible in multi-call mode by simply | 75 | * is still possible in multi-call mode by simply |
72 | * calling xz_dec_run() again. | 76 | * calling xz_dec_run() again. |
73 | * NOTE: This return value is used only if | 77 | * Note that this return value is used only if |
74 | * XZ_DEC_ANY_CHECK was defined at build time, | 78 | * XZ_DEC_ANY_CHECK was defined at build time, |
75 | * which is not used in the kernel. Unsupported | 79 | * which is not used in the kernel. Unsupported |
76 | * check types return XZ_OPTIONS_ERROR if | 80 | * check types return XZ_OPTIONS_ERROR if |
@@ -105,7 +109,7 @@ enum xz_mode { | |||
105 | * stream that is truncated or otherwise corrupt. | 109 | * stream that is truncated or otherwise corrupt. |
106 | * | 110 | * |
107 | * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer | 111 | * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer |
108 | * is too small, or the compressed input is corrupt in a way that makes the | 112 | * is too small or the compressed input is corrupt in a way that makes the |
109 | * decoder produce more output than the caller expected. When it is | 113 | * decoder produce more output than the caller expected. When it is |
110 | * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR | 114 | * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR |
111 | * is used instead of XZ_BUF_ERROR. | 115 | * is used instead of XZ_BUF_ERROR. |
@@ -207,8 +211,8 @@ XZ_EXTERN struct xz_dec * XZ_FUNC xz_dec_init( | |||
207 | * The possible return values depend on build options and operation mode. | 211 | * The possible return values depend on build options and operation mode. |
208 | * See enum xz_ret for details. | 212 | * See enum xz_ret for details. |
209 | * | 213 | * |
210 | * NOTE: If an error occurs in single-call mode (return value is not | 214 | * Note that if an error occurs in single-call mode (return value is not |
211 | * XZ_STREAM_END), b->in_pos and b->out_pos are not modified, and the | 215 | * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the |
212 | * contents of the output buffer from b->out[b->out_pos] onward are | 216 | * contents of the output buffer from b->out[b->out_pos] onward are |
213 | * undefined. This is true even after XZ_BUF_ERROR, because with some filter | 217 | * undefined. This is true even after XZ_BUF_ERROR, because with some filter |
214 | * chains, there may be a second pass over the output buffer, and this pass | 218 | * chains, there may be a second pass over the output buffer, and this pass |
@@ -268,4 +272,9 @@ XZ_EXTERN void XZ_FUNC xz_crc32_init(void); | |||
268 | XZ_EXTERN uint32_t XZ_FUNC xz_crc32( | 272 | XZ_EXTERN uint32_t XZ_FUNC xz_crc32( |
269 | const uint8_t *buf, size_t size, uint32_t crc); | 273 | const uint8_t *buf, size_t size, uint32_t crc); |
270 | #endif | 274 | #endif |
275 | |||
276 | #ifdef __cplusplus | ||
277 | } | ||
278 | #endif | ||
279 | |||
271 | #endif | 280 | #endif |