aboutsummaryrefslogtreecommitdiff
path: root/c/include
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas.ru@gmail.com>2021-11-10 10:34:39 +0100
committerGitHub <noreply@github.com>2021-11-10 10:34:39 +0100
commit8376f72ed6a8ca01548aad1a4f4f1df33094d3e0 (patch)
tree98093e0b6e558634b4f2533f1f3406f361dae2be /c/include
parent62662f87cdd96deda90ac817de94e3c4af75226a (diff)
downloadbrotli-8376f72ed6a8ca01548aad1a4f4f1df33094d3e0.zip
brotli-8376f72ed6a8ca01548aad1a4f4f1df33094d3e0.tar.gz
brotli-8376f72ed6a8ca01548aad1a4f4f1df33094d3e0.tar.bz2
Prepare for copybara (#939)
Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
Diffstat (limited to 'c/include')
-rw-r--r--c/include/brotli/encode.h7
-rw-r--r--c/include/brotli/port.h24
2 files changed, 31 insertions, 0 deletions
diff --git a/c/include/brotli/encode.h b/c/include/brotli/encode.h
index 72668e1..b2c6f61 100644
--- a/c/include/brotli/encode.h
+++ b/c/include/brotli/encode.h
@@ -479,6 +479,13 @@ BROTLI_ENC_API BROTLI_BOOL BrotliEncoderHasMoreOutput(
BROTLI_ENC_API const uint8_t* BrotliEncoderTakeOutput(
BrotliEncoderState* state, size_t* size);
+/* Returns the estimated peak memory usage (in bytes) of the BrotliCompress()
+ function, not counting the memory needed for the input and output. */
+BROTLI_ENC_EXTRA_API size_t BrotliEncoderEstimatePeakMemoryUsage(
+ int quality, int lgwin, size_t input_size);
+/* Returns 0 if dictionary is not valid; otherwise returns allocation size. */
+BROTLI_ENC_EXTRA_API size_t BrotliEncoderGetPreparedDictionarySize(
+ const BrotliEncoderPreparedDictionary* dictionary);
/**
* Gets an encoder library version.
diff --git a/c/include/brotli/port.h b/c/include/brotli/port.h
index 395b29b..a681ac4 100644
--- a/c/include/brotli/port.h
+++ b/c/include/brotli/port.h
@@ -247,6 +247,24 @@
#define BROTLI_PUBLIC
#endif
+/* BROTLI_INTERNAL could be defined to override visibility, e.g. for tests. */
+#if !defined(BROTLI_INTERNAL)
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define BROTLI_INTERNAL
+#elif BROTLI_GNUC_VERSION_CHECK(3, 3, 0) || \
+ BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(13, 1, 0) || \
+ BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
+ (BROTLI_TI_VERSION_CHECK(7, 3, 0) && \
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__) && defined(__TI_EABI__))
+#define BROTLI_INTERNAL __attribute__ ((visibility ("hidden")))
+#else
+#define BROTLI_INTERNAL
+#endif
+#endif
+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(__STDC_NO_VLA__) && !defined(__cplusplus) && \
!defined(__PGI) && !defined(__PGIC__) && !defined(__TINYC__) && \
@@ -286,4 +304,10 @@
#define BROTLI_ENC_API
#endif
+#if defined(BROTLI_BUILD_ENC_EXTRA_API)
+#define BROTLI_ENC_EXTRA_API BROTLI_ENC_API
+#else
+#define BROTLI_ENC_EXTRA_API BROTLI_INTERNAL
+#endif
+
#endif /* BROTLI_COMMON_PORT_H_ */