summaryrefslogtreecommitdiffstats
path: root/third_party/brotli/dec/streams.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/brotli/dec/streams.c')
-rw-r--r--third_party/brotli/dec/streams.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/third_party/brotli/dec/streams.c b/third_party/brotli/dec/streams.c
index b33f7a4..f7060a9 100644
--- a/third_party/brotli/dec/streams.c
+++ b/third_party/brotli/dec/streams.c
@@ -71,38 +71,6 @@ BrotliOutput BrotliInitMemOutput(uint8_t* buffer, size_t length,
return output;
}
-int BrotliStdinInputFunction(void* data, uint8_t* buf, size_t count) {
- (void) data; /* Shut up LLVM */
-#ifndef _WIN32
- return (int)read(STDIN_FILENO, buf, count);
-#else
- return -1;
-#endif
-}
-
-BrotliInput BrotliStdinInput() {
- BrotliInput in;
- in.cb_ = BrotliStdinInputFunction;
- in.data_ = NULL;
- return in;
-}
-
-int BrotliStdoutOutputFunction(void* data, const uint8_t* buf, size_t count) {
- (void) data; /* Shut up LLVM */
-#ifndef _WIN32
- return (int)write(STDOUT_FILENO, buf, count);
-#else
- return -1;
-#endif
-}
-
-BrotliOutput BrotliStdoutOutput() {
- BrotliOutput out;
- out.cb_ = BrotliStdoutOutputFunction;
- out.data_ = NULL;
- return out;
-}
-
int BrotliFileInputFunction(void* data, uint8_t* buf, size_t count) {
return (int)fread(buf, 1, count, (FILE*)data);
}
@@ -125,6 +93,18 @@ BrotliOutput BrotliFileOutput(FILE* f) {
return out;
}
+int BrotliNullOutputFunction(void* data , const uint8_t* buf, size_t count) {
+ BROTLI_UNUSED(data);
+ BROTLI_UNUSED(buf);
+ return (int)count;
+}
+
+BrotliOutput BrotliNullOutput() {
+ BrotliOutput out;
+ out.cb_ = BrotliNullOutputFunction;
+ out.data_ = NULL;
+ return out;
+}
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */