diff --git a/include/freerdp/codec/mppc.h b/include/freerdp/codec/mppc.h deleted file mode 100644 index bdeef8129..000000000 --- a/include/freerdp/codec/mppc.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol Implementation - * MPPC Bulk Data Compression - * - * Copyright 2014 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FREERDP_MPPC_H -#define FREERDP_MPPC_H - -#include -#include - -#include - -#include - -typedef struct s_MPPC_CONTEXT MPPC_CONTEXT; - -#ifdef __cplusplus -extern "C" -{ -#endif - - FREERDP_API int mppc_compress(MPPC_CONTEXT* mppc, const BYTE* pSrcData, UINT32 SrcSize, - BYTE* pDstBuffer, const BYTE** ppDstData, UINT32* pDstSize, - UINT32* pFlags); - FREERDP_API int mppc_decompress(MPPC_CONTEXT* mppc, const BYTE* pSrcData, UINT32 SrcSize, - const BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); - - FREERDP_API void mppc_set_compression_level(MPPC_CONTEXT* mppc, DWORD CompressionLevel); - - FREERDP_API void mppc_context_reset(MPPC_CONTEXT* mppc, BOOL flush); - - FREERDP_API MPPC_CONTEXT* mppc_context_new(DWORD CompressionLevel, BOOL Compressor); - FREERDP_API void mppc_context_free(MPPC_CONTEXT* mppc); - -#ifdef __cplusplus -} -#endif - -#endif /* FREERDP_MPPC_H */ diff --git a/libfreerdp/CMakeLists.txt b/libfreerdp/CMakeLists.txt index 1c98b051b..aea995011 100644 --- a/libfreerdp/CMakeLists.txt +++ b/libfreerdp/CMakeLists.txt @@ -125,6 +125,8 @@ endif () # codec set(CODEC_SRCS + codec/bulk.c + codec/bulk.h codec/dsp.c codec/color.c codec/audio.c diff --git a/libfreerdp/core/bulk.c b/libfreerdp/codec/bulk.c similarity index 99% rename from libfreerdp/core/bulk.c rename to libfreerdp/codec/bulk.c index aa7686080..07662d713 100644 --- a/libfreerdp/core/bulk.c +++ b/libfreerdp/codec/bulk.c @@ -22,6 +22,9 @@ #include #include "bulk.h" +#include "../codec/mppc.h" +#include "../codec/ncrush.h" +#include "../codec/xcrush.h" #define TAG "com.freerdp.core" diff --git a/libfreerdp/core/bulk.h b/libfreerdp/codec/bulk.h similarity index 92% rename from libfreerdp/core/bulk.h rename to libfreerdp/codec/bulk.h index 7ec182c9d..94dc230ef 100644 --- a/libfreerdp/core/bulk.h +++ b/libfreerdp/codec/bulk.h @@ -22,12 +22,8 @@ typedef struct rdp_bulk rdpBulk; -#include "rdp.h" - #include -#include -#include -#include +#include #define BULK_COMPRESSION_FLAGS_MASK 0xE0 #define BULK_COMPRESSION_TYPE_MASK 0x0F diff --git a/libfreerdp/codec/mppc.c b/libfreerdp/codec/mppc.c index a67d611ca..573890824 100644 --- a/libfreerdp/codec/mppc.c +++ b/libfreerdp/codec/mppc.c @@ -26,7 +26,7 @@ #include #include -#include +#include "mppc.h" #define TAG FREERDP_TAG("codec.mppc") diff --git a/include/freerdp/codec/ncrush.h b/libfreerdp/codec/mppc.h similarity index 61% rename from include/freerdp/codec/ncrush.h rename to libfreerdp/codec/mppc.h index 1fa84f58a..a4b3c48bf 100644 --- a/include/freerdp/codec/ncrush.h +++ b/libfreerdp/codec/mppc.h @@ -1,6 +1,6 @@ /** * FreeRDP: A Remote Desktop Protocol Implementation - * NCrush (RDP6) Bulk Data Compression + * MPPC Bulk Data Compression * * Copyright 2014 Marc-Andre Moreau * @@ -17,36 +17,38 @@ * limitations under the License. */ -#ifndef FREERDP_CODEC_NCRUSH_H -#define FREERDP_CODEC_NCRUSH_H +#ifndef FREERDP_MPPC_H +#define FREERDP_MPPC_H #include #include -#include - #include -typedef struct s_NCRUSH_CONTEXT NCRUSH_CONTEXT; +#include + +typedef struct s_MPPC_CONTEXT MPPC_CONTEXT; #ifdef __cplusplus extern "C" { #endif - FREERDP_API int ncrush_compress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, UINT32 SrcSize, + FREERDP_LOCAL int mppc_compress(MPPC_CONTEXT* mppc, const BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstBuffer, const BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); - FREERDP_API int ncrush_decompress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, UINT32 SrcSize, + FREERDP_LOCAL int mppc_decompress(MPPC_CONTEXT* mppc, const BYTE* pSrcData, UINT32 SrcSize, const BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); - FREERDP_API void ncrush_context_reset(NCRUSH_CONTEXT* ncrush, BOOL flush); + FREERDP_LOCAL void mppc_set_compression_level(MPPC_CONTEXT* mppc, DWORD CompressionLevel); - FREERDP_API NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor); - FREERDP_API void ncrush_context_free(NCRUSH_CONTEXT* ncrush); + FREERDP_LOCAL void mppc_context_reset(MPPC_CONTEXT* mppc, BOOL flush); + + FREERDP_LOCAL MPPC_CONTEXT* mppc_context_new(DWORD CompressionLevel, BOOL Compressor); + FREERDP_LOCAL void mppc_context_free(MPPC_CONTEXT* mppc); #ifdef __cplusplus } #endif -#endif /* FREERDP_CODEC_NCRUSH_H */ +#endif /* FREERDP_MPPC_H */ diff --git a/libfreerdp/codec/ncrush.c b/libfreerdp/codec/ncrush.c index 6e12fce3c..808623498 100644 --- a/libfreerdp/codec/ncrush.c +++ b/libfreerdp/codec/ncrush.c @@ -28,7 +28,7 @@ #include #include -#include +#include "ncrush.h" #define TAG FREERDP_TAG("codec") diff --git a/libfreerdp/codec/ncrush.h b/libfreerdp/codec/ncrush.h new file mode 100644 index 000000000..bc752ce2e --- /dev/null +++ b/libfreerdp/codec/ncrush.h @@ -0,0 +1,53 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * NCrush (RDP6) Bulk Data Compression + * + * Copyright 2014 Marc-Andre Moreau + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FREERDP_CODEC_NCRUSH_H +#define FREERDP_CODEC_NCRUSH_H + +#include +#include + +#include "mppc.h" + +#include + +typedef struct s_NCRUSH_CONTEXT NCRUSH_CONTEXT; + +#ifdef __cplusplus +extern "C" +{ +#endif + + FREERDP_LOCAL int ncrush_compress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, UINT32 SrcSize, + BYTE* pDstBuffer, const BYTE** ppDstData, UINT32* pDstSize, + UINT32* pFlags); + FREERDP_LOCAL int ncrush_decompress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, + UINT32 SrcSize, const BYTE** ppDstData, UINT32* pDstSize, + UINT32 flags); + + FREERDP_LOCAL void ncrush_context_reset(NCRUSH_CONTEXT* ncrush, BOOL flush); + + FREERDP_LOCAL NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor); + FREERDP_LOCAL void ncrush_context_free(NCRUSH_CONTEXT* ncrush); + +#ifdef __cplusplus +} +#endif + +#endif /* FREERDP_CODEC_NCRUSH_H */ diff --git a/libfreerdp/codec/test/TestFreeRDPCodecMppc.c b/libfreerdp/codec/test/TestFreeRDPCodecMppc.c index d884cb7d2..6c213d4b0 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecMppc.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecMppc.c @@ -3,9 +3,10 @@ #include #include -#include #include +#include "../mppc.h" + static const BYTE TEST_RDP5_COMPRESSED_DATA[] = { 0x24, 0x02, 0x03, 0x09, 0x00, 0x20, 0x0c, 0x05, 0x10, 0x01, 0x40, 0x0a, 0xbf, 0xdf, 0xc3, 0x20, 0x80, 0x00, 0x1f, 0x0a, 0x00, 0x00, 0x07, 0x43, 0x4e, 0x00, 0x68, 0x02, 0x00, 0x22, 0x00, 0x34, diff --git a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c index 7896a45da..bba4c2a05 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c @@ -1,7 +1,7 @@ #include #include -#include +#include "../ncrush.h" static const BYTE TEST_BELLS_DATA[] = "for.whom.the.bell.tolls,.the.bell.tolls.for.thee!"; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c index a644882e4..3df4721ae 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c @@ -1,7 +1,7 @@ #include #include -#include +#include "../xcrush.h" static const BYTE TEST_BELLS_DATA[] = "for.whom.the.bell.tolls,.the.bell.tolls.for.thee!"; diff --git a/libfreerdp/codec/xcrush.c b/libfreerdp/codec/xcrush.c index 4b3de2a7a..775df9b8b 100644 --- a/libfreerdp/codec/xcrush.c +++ b/libfreerdp/codec/xcrush.c @@ -27,7 +27,7 @@ #include #include -#include +#include "xcrush.h" #define TAG FREERDP_TAG("codec") diff --git a/include/freerdp/codec/xcrush.h b/libfreerdp/codec/xcrush.h similarity index 60% rename from include/freerdp/codec/xcrush.h rename to libfreerdp/codec/xcrush.h index 09fc450a6..5997c21b4 100644 --- a/include/freerdp/codec/xcrush.h +++ b/libfreerdp/codec/xcrush.h @@ -23,7 +23,7 @@ #include #include -#include +#include "mppc.h" typedef struct s_XCRUSH_CONTEXT XCRUSH_CONTEXT; @@ -32,16 +32,17 @@ extern "C" { #endif - FREERDP_API int xcrush_compress(XCRUSH_CONTEXT* xcrush, const BYTE* pSrcData, UINT32 SrcSize, - BYTE* pDstBuffer, const BYTE** ppDstData, UINT32* pDstSize, - UINT32* pFlags); - FREERDP_API int xcrush_decompress(XCRUSH_CONTEXT* xcrush, const BYTE* pSrcData, UINT32 SrcSize, - const BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); + FREERDP_LOCAL int xcrush_compress(XCRUSH_CONTEXT* xcrush, const BYTE* pSrcData, UINT32 SrcSize, + BYTE* pDstBuffer, const BYTE** ppDstData, UINT32* pDstSize, + UINT32* pFlags); + FREERDP_LOCAL int xcrush_decompress(XCRUSH_CONTEXT* xcrush, const BYTE* pSrcData, + UINT32 SrcSize, const BYTE** ppDstData, UINT32* pDstSize, + UINT32 flags); - FREERDP_API void xcrush_context_reset(XCRUSH_CONTEXT* xcrush, BOOL flush); + FREERDP_LOCAL void xcrush_context_reset(XCRUSH_CONTEXT* xcrush, BOOL flush); - FREERDP_API XCRUSH_CONTEXT* xcrush_context_new(BOOL Compressor); - FREERDP_API void xcrush_context_free(XCRUSH_CONTEXT* xcrush); + FREERDP_LOCAL XCRUSH_CONTEXT* xcrush_context_new(BOOL Compressor); + FREERDP_LOCAL void xcrush_context_free(XCRUSH_CONTEXT* xcrush); #ifdef __cplusplus } diff --git a/libfreerdp/core/CMakeLists.txt b/libfreerdp/core/CMakeLists.txt index 344d41134..c51f90340 100644 --- a/libfreerdp/core/CMakeLists.txt +++ b/libfreerdp/core/CMakeLists.txt @@ -52,8 +52,6 @@ set(${MODULE_PREFIX}_GATEWAY_SRCS set(${MODULE_PREFIX}_SRCS utils.c utils.h - bulk.c - bulk.h streamdump.c activation.c activation.h diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index bf81d7e06..e3c90b2bf 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -31,6 +31,7 @@ #include "mcs.h" #include "redirection.h" +#include #include #include diff --git a/libfreerdp/core/rdp.h b/libfreerdp/core/rdp.h index 0f195e9a2..46b138296 100644 --- a/libfreerdp/core/rdp.h +++ b/libfreerdp/core/rdp.h @@ -26,7 +26,7 @@ #include "nla.h" #include "mcs.h" #include "tpkt.h" -#include "bulk.h" +#include "../codec/bulk.h" #include "fastpath.h" #include "tpdu.h" #include "nego.h"