summaryrefslogtreecommitdiff
path: root/vdr-vdrmanager/compressor.cpp
diff options
context:
space:
mode:
authorbju <bju@maxi.fritz.box>2014-01-23 22:05:58 +0100
committerbju <bju@maxi.fritz.box>2014-01-23 22:05:58 +0100
commitb58cae86e52d1f34c8e007e04f2dbc28650d8789 (patch)
tree2fd8c5739f7ab4f76279a61dec6539a8532b486d /vdr-vdrmanager/compressor.cpp
parent612e0e00b8d55b70d4b83d13fc75e7ddd78d2b58 (diff)
downloadvdr-manager-b58cae86e52d1f34c8e007e04f2dbc28650d8789.tar.gz
vdr-manager-b58cae86e52d1f34c8e007e04f2dbc28650d8789.tar.bz2
- Giving VDRMANAGER_USE_{SSL,GZIP,ZLIB}=0 (default is 1) to the make call
SSL support and the compression methods can be disabled. This eliminates the compile time and also the runtime dependencies. - The Gentoo ebuils uses the USE flags "ssl", "gzip" and "zlib" to control the SSL and compress features.
Diffstat (limited to 'vdr-vdrmanager/compressor.cpp')
-rw-r--r--vdr-vdrmanager/compressor.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/vdr-vdrmanager/compressor.cpp b/vdr-vdrmanager/compressor.cpp
index c8322b8..b4c9051 100644
--- a/vdr-vdrmanager/compressor.cpp
+++ b/vdr-vdrmanager/compressor.cpp
@@ -5,14 +5,21 @@
* Author: bju
*/
-#include "compressor.h"
+#if VDRMANAGER_USE_ZLIB || VDRMANAGER_USE_GZIP
-#include <zlib.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
+
+#include "compressor.h"
+
+#if VDRMANAGER_USE_ZLIB
+#include <zlib.h>
#define CHUNK 16384
+#endif
+
cCompressor::cCompressor() {
size = 0;
@@ -23,6 +30,8 @@ cCompressor::~cCompressor() {
}
+#if VDRMANAGER_USE_GZIP
+
bool cCompressor::CompressGzip(string text) {
int in_fd[2];
@@ -94,6 +103,10 @@ bool cCompressor::CompressGzip(string text) {
return true;
}
+#endif
+
+#if VDRMANAGER_USE_ZLIB
+
bool cCompressor::CompressZlib(string text) {
int ret, flush;
@@ -160,6 +173,8 @@ bool cCompressor::CompressZlib(string text) {
return true;
}
+#endif
+
char * cCompressor::GetData() {
return data;
}
@@ -168,3 +183,4 @@ size_t cCompressor::getDataSize() {
return size;
}
+#endif