153 |
} |
} |
154 |
|
|
155 |
|
|
156 |
|
FT_BASE_DEF( FT_ULong ) |
157 |
|
FT_Stream_TryRead( FT_Stream stream, |
158 |
|
FT_Byte* buffer, |
159 |
|
FT_ULong count ) |
160 |
|
{ |
161 |
|
FT_ULong read_bytes = 0; |
162 |
|
|
163 |
|
|
164 |
|
if ( stream->pos >= stream->size ) |
165 |
|
goto Exit; |
166 |
|
|
167 |
|
if ( stream->read ) |
168 |
|
read_bytes = stream->read( stream, stream->pos, buffer, count ); |
169 |
|
else |
170 |
|
{ |
171 |
|
read_bytes = stream->size - stream->pos; |
172 |
|
if ( read_bytes > count ) |
173 |
|
read_bytes = count; |
174 |
|
|
175 |
|
FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes ); |
176 |
|
} |
177 |
|
|
178 |
|
stream->pos += read_bytes; |
179 |
|
|
180 |
|
Exit: |
181 |
|
return read_bytes; |
182 |
|
} |
183 |
|
|
184 |
|
|
185 |
FT_BASE_DEF( FT_Error ) |
FT_BASE_DEF( FT_Error ) |
186 |
FT_Stream_ExtractFrame( FT_Stream stream, |
FT_Stream_ExtractFrame( FT_Stream stream, |
187 |
FT_ULong count, |
FT_ULong count, |