rtxStreamZlib.h
00001 /* 00002 * Copyright (c) 2003-2009 Objective Systems, Inc. 00003 * 00004 * This software is furnished under a license and may be used and copied 00005 * only in accordance with the terms of such license and with the 00006 * inclusion of the above copyright notice. This software or any other 00007 * copies thereof may not be provided or otherwise made available to any 00008 * other person. No title to and ownership of the software is hereby 00009 * transferred. 00010 * 00011 * The information in this software is subject to change without notice 00012 * and should not be construed as a commitment by Objective Systems, Inc. 00013 * 00014 * PROPRIETARY NOTICE 00015 * 00016 * This software is an unpublished work subject to a confidentiality agreement 00017 * and is protected by copyright and trade secret law. Unauthorized copying, 00018 * redistribution or other use of this work is prohibited. 00019 * 00020 * The above notice of copyright on this source code product does not indicate 00021 * any actual or intended publication of such source code. 00022 * 00023 *****************************************************************************/ 00024 /* 00025 * @file rtxStreamZlib.h 00026 */ 00027 #ifndef _RTXSTREAMZLIB_H_ 00028 #define _RTXSTREAMZLIB_H_ 00029 00030 #include "rtxsrc/osSysTypes.h" 00031 #include "rtxsrc/rtxExternDefs.h" 00032 #include "rtxsrc/rtxStream.h" 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif 00037 00038 /* 00039 * This function initializes a zlib compressed stream. This function should 00040 * be called first before any operation with a zlib compressed stream. 00041 * 00042 * @param pctxt Pointer to context structure variable. 00043 * @param flags Specifies the access mode for the stream: 00044 * - OSRTSTRMF_INPUT = input (reading) stream; 00045 * - OSRTSTRMF_OUTPUT = output (writing) stream. 00046 * @return Completion status of operation: 0 (0) = success, 00047 * negative return value is error. 00048 */ 00049 EXTERNRT int rtxStreamZlibAttach (OSCTXT* pctxt, OSUINT16 flags); 00050 00051 /* 00052 * This function finish compressed block. Stream switched to transparent mode. 00053 * 00054 * @param pctxt Pointer to context structure variable. 00055 * @return Completion status of operation: 0 (0) = success, 00056 * negative return value is error. 00057 */ 00058 EXTERNRT int rtxStreamZlibEnd (OSCTXT* pctxt); 00059 00060 /* 00061 * This function free a zlib compressed stream and restore underlying stream. 00062 * 00063 * @param pctxt Pointer to context structure variable. 00064 * @return Completion status of operation: 0 (0) = success, 00065 * negative return value is error. 00066 */ 00067 EXTERNRT int rtxStreamZlibFree (OSCTXT* pctxt); 00068 00069 /* 00070 * This function finish compressed block and start new block. 00071 * Stream remained in compressed mode. 00072 * 00073 * @param pctxt Pointer to context structure variable. 00074 * @return Completion status of operation: 0 (0) = success, 00075 * negative return value is error. 00076 */ 00077 EXTERNRT int rtxStreamZlibReset (OSCTXT* pctxt); 00078 00079 /* 00080 * This function start compression parameters. 00081 * 00082 * @param pctxt Pointer to context structure variable. 00083 * @param level Set compression level 0..9. 00084 * 0 - Z_NO_COMPRESSION 00085 * 1 - Z_BEST_SPEED 00086 * 9 - Z_BEST_COMPRESSION 00087 * -1 - Z_DEFAULT_COMPRESSION - like level 6 00088 * @param windowBits Set decompression window size. 00089 * 8..15 - ZLIB header (RFC 1950) 00090 * -8..-15 - header is absent (RFC 1951) 00091 * (8..15) + 16 - GZIP header (RFC 1952) 00092 * @param memLevel Set memory usage level 1..9. 00093 * 1 - use minimum memory 00094 * 9 - use maximum memory 00095 * @param strategy Set copression algorithm. 00096 * 0 - Z_DEFAULT_STRATEGY - common method any data 00097 * other possible values defined in zlib.h 00098 * @return Completion status of operation: 0 (0) = success, 00099 * negative return value is error. 00100 */ 00101 EXTERNRT int rtxStreamZlibSetDeflateParams 00102 (OSCTXT* pctxt, int level, int windowBits, int memLevel, int strategy); 00103 00104 /* 00105 * This function start decompression parameter. 00106 * 00107 * @param pctxt Pointer to context structure variable. 00108 * @param windowBits Set decompression window size. 00109 * 8..15 - ZLIB header (RFC 1950) 00110 * -8..-15 - header is absent (RFC 1951) 00111 * (8..15) + 16 - GZIP header (RFC 1952) 00112 * @return Completion status of operation: 0 (0) = success, 00113 * negative return value is error. 00114 */ 00115 EXTERNRT int rtxStreamZlibSetInflateParams 00116 (OSCTXT* pctxt, int windowBits); 00117 00118 /* 00119 * This function start compressed block. 00120 * 00121 * @param pctxt Pointer to context structure variable. 00122 * @return Completion status of operation: 0 (0) = success, 00123 * negative return value is error. 00124 */ 00125 EXTERNRT int rtxStreamZlibStart (OSCTXT* pctxt); 00126 00127 #ifdef __cplusplus 00128 } 00129 #endif 00130 00131 #endif /* _RTXSTREAMZLIB_H_ */ 00132