From 9ed2430baaf3558d0844c8bc74fa904007133db7 Mon Sep 17 00:00:00 2001 From: Benjamin Beasley Date: Tue, 20 Oct 2020 14:43:05 -0400 Subject: Use only Zopfli public API functions from zopfli.h. The Zopfli library is normally installed only with zopfli.h (and zopflipng_lib.h). Using only APIs in this header makes it easier to use an external Zopfli library. This means including zopfli.h instead of zlib_container.h, and calling ZopfliCompress with ZOPFLI_FORMAT_ZLIB instead of calling ZopfliZlibCompress directly. --- woff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/woff.c b/woff.c index c0f1192..dc77c42 100644 --- a/woff.c +++ b/woff.c @@ -42,7 +42,7 @@ #include #include #include -#include "zlib_container.h" +#include "zopfli.h" #ifdef WOFF_MOZILLA_CLIENT /* define this when building as part of Gecko */ # include "prmem.h" @@ -288,7 +288,7 @@ woffEncode(const uint8_t * sfntData, uint32_t sfntLen, FAIL(eWOFF_invalid); } - ZopfliZlibCompress(&options, (const uint8_t *) (sfntData + sourceOffset), sourceLen, &dest, &destLen); + ZopfliCompress(&options, ZOPFLI_FORMAT_ZLIB, (const uint8_t *) (sfntData + sourceOffset), sourceLen, &dest, &destLen); if (destLen < sourceLen) { /* compressed table was smaller */ @@ -548,7 +548,7 @@ woffSetMetadata(const uint8_t * woffData, uint32_t * woffLen, ZopfliOptions options; ZopfliInitOptions(&options); - ZopfliZlibCompress(&options, (const uint8_t *) metaData, metaLen, &compData, &compLen); + ZopfliCompress(&options, ZOPFLI_FORMAT_ZLIB, (const uint8_t *) metaData, metaLen, &compData, &compLen); } woffData = rebuildWoff(woffData, woffLen, -- cgit v1.2.3