example_util: add ExUtilSetBinaryMode

use it in dwebp when dealing with 'stdout'

Change-Id: I8b8a0b0de9e73731e913ac3c83b5e2b33c693175
This commit is contained in:
James Zern
2014-08-29 19:07:17 -07:00
parent 30f3b75b33
commit 5927e15bc7
3 changed files with 21 additions and 14 deletions

View File

@ -13,12 +13,17 @@
#ifndef WEBP_EXAMPLES_EXAMPLE_UTIL_H_
#define WEBP_EXAMPLES_EXAMPLE_UTIL_H_
#include <stdio.h>
#include "webp/decode.h"
#ifdef __cplusplus
extern "C" {
#endif
// Reopen file in binary (O_BINARY) mode.
// Returns 'file' on success, NULL otherwise.
FILE* ExUtilSetBinaryMode(FILE* file);
// Allocates storage for entire file 'file_name' and returns contents and size
// in 'data' and 'data_size'. Returns 1 on success, 0 otherwise. '*data' should
// be deleted using free().