syslog-ng source
compression.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 One Identity LLC.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 
24 #ifndef SYSLOG_NG_COMPRESSION_H
25 #define SYSLOG_NG_COMPRESSION_H
26 
27 #include "syslog-ng.h"
28 #include "compat/curl.h"
29 
30 #define SYSLOG_NG_HTTP_COMPRESSION_ENABLED 0
31 #if SYSLOG_NG_HAVE_ZLIB
32 #if defined(CURL_VERSION_LIBZ)
33 #undef SYSLOG_NG_HTTP_COMPRESSION_ENABLED
34 #define SYSLOG_NG_HTTP_COMPRESSION_ENABLED 1
35 #endif
36 #endif
37 
39 {
41 
46 };
47 
48 extern gchar *CURL_COMPRESSION_LITERAL_ALL;
49 
50 typedef struct Compressor Compressor;
51 
52 const gchar *compressor_get_encoding_name(Compressor *self);
53 gboolean compressor_compress(Compressor *self, GString *compressed, const GString *message);
54 void compressor_free(Compressor *self);
55 
56 #if SYSLOG_NG_HTTP_COMPRESSION_ENABLED
57 typedef struct GzipCompressor GzipCompressor;
58 
59 Compressor *gzip_compressor_new(void);
60 
61 typedef struct DeflateCompressor DeflateCompressor;
62 
63 Compressor *deflate_compressor_new(void);
64 #endif
65 
66 Compressor *
69 compressor_lookup_type(const gchar *name);
70 
71 #endif //SYSLOG_NG_COMPRESSION_H
enum CurlCompressionTypes compressor_lookup_type(const gchar *name)
Definition: compression.c:304
void compressor_free(Compressor *self)
Definition: compression.c:55
CurlCompressionTypes
Definition: compression.h:39
@ CURL_COMPRESSION_DEFLATE
Definition: compression.h:45
@ CURL_COMPRESSION_GZIP
Definition: compression.h:44
@ CURL_COMPRESSION_DEFAULT
Definition: compression.h:43
@ CURL_COMPRESSION_UNCOMPRESSED
Definition: compression.h:42
@ CURL_COMPRESSION_UNKNOWN
Definition: compression.h:40
const gchar * compressor_get_encoding_name(Compressor *self)
Definition: compression.c:43
Compressor * construct_compressor_by_type(enum CurlCompressionTypes type)
Definition: compression.c:281
gboolean compressor_compress(Compressor *self, GString *compressed, const GString *message)
Definition: compression.c:49
gchar * CURL_COMPRESSION_LITERAL_ALL
Definition: compression.c:32
const gchar * name
Definition: debugger.c:265
Definition: compression.c:36