|
||||
File indexing completed on 2025-01-17 09:55:47
0001 /* 0002 LZ4 file library 0003 Header File 0004 Copyright (C) 2022, Xiaomi Inc. 0005 BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 0006 0007 Redistribution and use in source and binary forms, with or without 0008 modification, are permitted provided that the following conditions are 0009 met: 0010 0011 * Redistributions of source code must retain the above copyright 0012 notice, this list of conditions and the following disclaimer. 0013 * Redistributions in binary form must reproduce the above 0014 copyright notice, this list of conditions and the following disclaimer 0015 in the documentation and/or other materials provided with the 0016 distribution. 0017 0018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 0019 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 0020 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 0021 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 0022 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 0023 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 0024 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 0025 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 0026 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 0027 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 0028 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0029 0030 You can contact the author at : 0031 - LZ4 source repository : https://github.com/lz4/lz4 0032 - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c 0033 */ 0034 #if defined (__cplusplus) 0035 extern "C" { 0036 #endif 0037 0038 #ifndef LZ4FILE_H 0039 #define LZ4FILE_H 0040 0041 #include <stdio.h> /* FILE* */ 0042 #include "lz4frame_static.h" 0043 0044 typedef struct LZ4_readFile_s LZ4_readFile_t; 0045 typedef struct LZ4_writeFile_s LZ4_writeFile_t; 0046 0047 /*! LZ4F_readOpen() : 0048 * Set read lz4file handle. 0049 * `lz4f` will set a lz4file handle. 0050 * `fp` must be the return value of the lz4 file opened by fopen. 0051 */ 0052 LZ4FLIB_STATIC_API LZ4F_errorCode_t LZ4F_readOpen(LZ4_readFile_t** lz4fRead, FILE* fp); 0053 0054 /*! LZ4F_read() : 0055 * Read lz4file content to buffer. 0056 * `lz4f` must use LZ4_readOpen to set first. 0057 * `buf` read data buffer. 0058 * `size` read data buffer size. 0059 */ 0060 LZ4FLIB_STATIC_API size_t LZ4F_read(LZ4_readFile_t* lz4fRead, void* buf, size_t size); 0061 0062 /*! LZ4F_readClose() : 0063 * Close lz4file handle. 0064 * `lz4f` must use LZ4_readOpen to set first. 0065 */ 0066 LZ4FLIB_STATIC_API LZ4F_errorCode_t LZ4F_readClose(LZ4_readFile_t* lz4fRead); 0067 0068 /*! LZ4F_writeOpen() : 0069 * Set write lz4file handle. 0070 * `lz4f` will set a lz4file handle. 0071 * `fp` must be the return value of the lz4 file opened by fopen. 0072 */ 0073 LZ4FLIB_STATIC_API LZ4F_errorCode_t LZ4F_writeOpen(LZ4_writeFile_t** lz4fWrite, FILE* fp, const LZ4F_preferences_t* prefsPtr); 0074 0075 /*! LZ4F_write() : 0076 * Write buffer to lz4file. 0077 * `lz4f` must use LZ4F_writeOpen to set first. 0078 * `buf` write data buffer. 0079 * `size` write data buffer size. 0080 */ 0081 LZ4FLIB_STATIC_API size_t LZ4F_write(LZ4_writeFile_t* lz4fWrite, const void* buf, size_t size); 0082 0083 /*! LZ4F_writeClose() : 0084 * Close lz4file handle. 0085 * `lz4f` must use LZ4F_writeOpen to set first. 0086 */ 0087 LZ4FLIB_STATIC_API LZ4F_errorCode_t LZ4F_writeClose(LZ4_writeFile_t* lz4fWrite); 0088 0089 #endif /* LZ4FILE_H */ 0090 0091 #if defined (__cplusplus) 0092 } 0093 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |