| OLD | NEW |
| 1 /////////////////////////////////////////////////////////////////////////////// | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 // | 2 // |
| 3 /// \file common.h | 3 /// \file common.h |
| 4 /// \brief Definitions common to the whole liblzma library | 4 /// \brief Definitions common to the whole liblzma library |
| 5 // | 5 // |
| 6 // Author: Lasse Collin | 6 // Author: Lasse Collin |
| 7 // | 7 // |
| 8 // This file has been put into the public domain. | 8 // This file has been put into the public domain. |
| 9 // You can do whatever you want with this file. | 9 // You can do whatever you want with this file. |
| 10 // | 10 // |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 bool supported_actions[4]; | 198 bool supported_actions[4]; |
| 199 | 199 |
| 200 /// If true, lzma_code will return LZMA_BUF_ERROR if no progress was | 200 /// If true, lzma_code will return LZMA_BUF_ERROR if no progress was |
| 201 /// made (no input consumed and no output produced by next.code). | 201 /// made (no input consumed and no output produced by next.code). |
| 202 bool allow_buf_error; | 202 bool allow_buf_error; |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 | 205 |
| 206 /// Allocates memory | 206 /// Allocates memory |
| 207 extern void *lzma_alloc(size_t size, lzma_allocator *allocator) | 207 extern void *lzma_alloc(size_t size, lzma_allocator *allocator) |
| 208 » » lzma_attribute((malloc)); | 208 » » lzma_attribute((__malloc__)) lzma_attr_alloc_size(1); |
| 209 | 209 |
| 210 /// Frees memory | 210 /// Frees memory |
| 211 extern void lzma_free(void *ptr, lzma_allocator *allocator); | 211 extern void lzma_free(void *ptr, lzma_allocator *allocator); |
| 212 | 212 |
| 213 | 213 |
| 214 /// Allocates strm->internal if it is NULL, and initializes *strm and | 214 /// Allocates strm->internal if it is NULL, and initializes *strm and |
| 215 /// strm->internal. This function is only called via lzma_next_strm_init macro. | 215 /// strm->internal. This function is only called via lzma_next_strm_init macro. |
| 216 extern lzma_ret lzma_strm_init(lzma_stream *strm); | 216 extern lzma_ret lzma_strm_init(lzma_stream *strm); |
| 217 | 217 |
| 218 /// Initializes the next filter in the chain, if any. This takes care of | 218 /// Initializes the next filter in the chain, if any. This takes care of |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return_if_error(lzma_strm_init(strm)); \ | 275 return_if_error(lzma_strm_init(strm)); \ |
| 276 const lzma_ret ret_ = func(&(strm)->internal->next, \ | 276 const lzma_ret ret_ = func(&(strm)->internal->next, \ |
| 277 (strm)->allocator, __VA_ARGS__); \ | 277 (strm)->allocator, __VA_ARGS__); \ |
| 278 if (ret_ != LZMA_OK) { \ | 278 if (ret_ != LZMA_OK) { \ |
| 279 lzma_end(strm); \ | 279 lzma_end(strm); \ |
| 280 return ret_; \ | 280 return ret_; \ |
| 281 } \ | 281 } \ |
| 282 } while (0) | 282 } while (0) |
| 283 | 283 |
| 284 #endif | 284 #endif |
| OLD | NEW |