OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ftgzip.h */ | 3 /* ftgzip.h */ |
4 /* */ | 4 /* */ |
5 /* Gzip-compressed stream support. */ | 5 /* Gzip-compressed stream support. */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2002, 2003, 2004, 2006 by */ | 7 /* Copyright 2002-2004, 2006, 2013 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
18 | 18 |
19 #ifndef __FTGZIP_H__ | 19 #ifndef __FTGZIP_H__ |
20 #define __FTGZIP_H__ | 20 #define __FTGZIP_H__ |
21 | 21 |
22 #include "../ft2build.h" | 22 #include <ft2build.h> |
23 #include "freetype.h" | 23 #include FT_FREETYPE_H |
24 | 24 |
25 #ifdef FREETYPE_H | 25 #ifdef FREETYPE_H |
26 #error "freetype.h of FreeType 1 has been loaded!" | 26 #error "freetype.h of FreeType 1 has been loaded!" |
27 #error "Please fix the directory search order for header files" | 27 #error "Please fix the directory search order for header files" |
28 #error "so that freetype.h of FreeType 2 is found first." | 28 #error "so that freetype.h of FreeType 2 is found first." |
29 #endif | 29 #endif |
30 | 30 |
31 | 31 |
32 FT_BEGIN_HEADER | 32 FT_BEGIN_HEADER |
33 | 33 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 * compressed file, the library will try to open a gzipped stream from | 84 * compressed file, the library will try to open a gzipped stream from |
85 * it and re-open the face with it. | 85 * it and re-open the face with it. |
86 * | 86 * |
87 * This function may return `FT_Err_Unimplemented_Feature' if your build | 87 * This function may return `FT_Err_Unimplemented_Feature' if your build |
88 * of FreeType was not compiled with zlib support. | 88 * of FreeType was not compiled with zlib support. |
89 */ | 89 */ |
90 FT_EXPORT( FT_Error ) | 90 FT_EXPORT( FT_Error ) |
91 FT_Stream_OpenGzip( FT_Stream stream, | 91 FT_Stream_OpenGzip( FT_Stream stream, |
92 FT_Stream source ); | 92 FT_Stream source ); |
93 | 93 |
94 /* */ | 94 |
| 95 /************************************************************************ |
| 96 * |
| 97 * @function: |
| 98 * FT_Gzip_Uncompress |
| 99 * |
| 100 * @description: |
| 101 * Decompress a zipped input buffer into an output buffer. This function |
| 102 * is modeled after zlib's `uncompress' function. |
| 103 * |
| 104 * @input: |
| 105 * memory :: |
| 106 * A FreeType memory handle. |
| 107 * |
| 108 * input :: |
| 109 * The input buffer. |
| 110 * |
| 111 * input_len :: |
| 112 * The length of the input buffer. |
| 113 * |
| 114 * @output: |
| 115 * output:: |
| 116 * The output buffer. |
| 117 * |
| 118 * @inout: |
| 119 * output_len :: |
| 120 * Before calling the function, this is the the total size of the |
| 121 * output buffer, which must be large enough to hold the entire |
| 122 * uncompressed data (so the size of the uncompressed data must be |
| 123 * known in advance). After calling the function, `output_len' is the |
| 124 * size of the used data in `output'. |
| 125 * |
| 126 * @return: |
| 127 * FreeType error code. 0~means success. |
| 128 * |
| 129 * @note: |
| 130 * This function may return `FT_Err_Unimplemented_Feature' if your build |
| 131 * of FreeType was not compiled with zlib support. |
| 132 */ |
| 133 FT_EXPORT( FT_Error ) |
| 134 FT_Gzip_Uncompress( FT_Memory memory, |
| 135 FT_Byte* output, |
| 136 FT_ULong* output_len, |
| 137 const FT_Byte* input, |
| 138 FT_ULong input_len ); |
| 139 |
| 140 /* */ |
95 | 141 |
96 | 142 |
97 FT_END_HEADER | 143 FT_END_HEADER |
98 | 144 |
99 #endif /* __FTGZIP_H__ */ | 145 #endif /* __FTGZIP_H__ */ |
100 | 146 |
101 | 147 |
102 /* END */ | 148 /* END */ |
OLD | NEW |