Debian Codegraph @

runtime/zlibw.h

raw
1 /* The zlibw object. It encapsulates the zlib functionality. The primary
2 * purpose of this wrapper class is to enable rsyslogd core to be build without
3 * zlib libraries.
4 *
5 * Copyright 2009-2022 Adiscon GmbH.
6 *
7 * This file is part of the rsyslog runtime library.
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 * -or-
15 * see COPYING.ASL20 in the source distribution
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
22 */
23 #ifndef INCLUDED_ZLIBW_H
24 #define INCLUDED_ZLIBW_H
25
26 #include <zlib.h>
27
28 #include "errmsg.h"
29
30 /* interfaces */
31 BEGINinterface(zlibw) /* name must also be changed in ENDinterface macro! */
32 int (*DeflateInit)(z_streamp strm, int);
33 int (*DeflateInit2)(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy);
34 int (*Deflate)(z_streamp strm, int);
35 int (*DeflateEnd)(z_streamp strm);
36 rsRetVal (*doStrmWrite)(strm_t *pThis, uchar *const pBuf, const size_t lenBuf, const int bFlush,
37 rsRetVal (*strmPhysWrite)(strm_t *pThis, uchar *pBuf, size_t lenBuf));
38 rsRetVal (*doCompressFinish)(strm_t *pThis, rsRetVal (*Destruct)(strm_t *pThis, uchar *pBuf, size_t lenBuf));
39 rsRetVal (*Destruct)(strm_t *pThis);
40 ENDinterface(zlibw)
41 #define zlibwCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */
42
43
44 /* prototypes */
45 PROTOTYPEObj(zlibw);
46
47 /* the name of our library binary */
48 #define LM_ZLIBW_FILENAME "lmzlibw"
49
50 #endif /* #ifndef INCLUDED_ZLIBW_H */