blob: 54d1ebe2ecfe25800b552bffbd0c05abf51bd25b [file] [log] [blame]
James Zern061263a2012-05-11 16:00:57 -07001// Copyright 2012 Google Inc. All Rights Reserved.
2//
3// This code is licensed under the same terms as WebM:
4// Software License Agreement: http://www.webmproject.org/license/software/
5// Additional IP Rights Grant: http://www.webmproject.org/license/additional/
6// -----------------------------------------------------------------------------
7//
8// Utility functions used by the example programs.
9//
10
11#ifndef WEBP_EXAMPLES_EXAMPLE_UTIL_H_
12#define WEBP_EXAMPLES_EXAMPLE_UTIL_H_
13
14#include "webp/types.h"
15
16#if defined(__cplusplus) || defined(c_plusplus)
17extern "C" {
18#endif
19
20// Allocates storage for entire file 'file_name' and returns contents and size
21// in 'data' and 'data_size'. Returns 1 on success, 0 otherwise. '*data' should
22// be deleted using free().
23int ExUtilReadFile(const char* const file_name,
24 const uint8_t** data, size_t* data_size);
25
26#if defined(__cplusplus) || defined(c_plusplus)
27} // extern "C"
28#endif
29
30#endif // WEBP_EXAMPLES_EXAMPLE_UTIL_H_