2
* Copyright (C) 1998-2004 David Turner and Werner Lemberg
3
* Copyright (C) 2006 Behdad Esfahbod
5
* This is part of HarfBuzz, an OpenType Layout engine library.
7
* Permission is hereby granted, without written agreement and without
8
* license or royalty fees, to use, copy, modify, and distribute this
9
* software and its documentation for any purpose, provided that the
10
* above copyright notice and the following two paragraphs appear in
11
* all copies of this software.
13
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
19
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
26
#ifndef HARFBUZZ_STREAM_PRIVATE_H
27
#define HARFBUZZ_STREAM_PRIVATE_H
29
#include "harfbuzz-impl.h"
33
typedef FT_Stream HB_Stream;
36
_hb_stream_pos( HB_Stream stream );
39
_hb_stream_seek( HB_Stream stream,
43
_hb_stream_frame_enter( HB_Stream stream,
47
_hb_stream_frame_exit( HB_Stream stream );
50
_hb_font_goto_table( HB_Font font,
53
/* convenience macros */
55
#define SET_ERR(c) ( (error = (c)) != 0 )
57
#define GOTO_Table(tag) SET_ERR( _hb_font_goto_table( font, tag ) )
58
#define FILE_Pos() _hb_stream_pos( stream )
59
#define FILE_Seek(pos) SET_ERR( _hb_stream_seek( stream, pos ) )
60
#define ACCESS_Frame(size) SET_ERR( _hb_stream_frame_enter( stream, size ) )
61
#define FORGET_Frame() _hb_stream_frame_exit( stream )
63
#define GET_Byte() (*stream->cursor++)
64
#define GET_Short() (stream->cursor += 2, (HB_Short)( \
65
(*(((HB_Byte*)stream->cursor)-2) << 8) | \
66
*(((HB_Byte*)stream->cursor)-1) \
68
#define GET_Long() (stream->cursor += 4, (HB_Int)( \
69
(*(((HB_Byte*)stream->cursor)-4) << 24) | \
70
(*(((HB_Byte*)stream->cursor)-3) << 16) | \
71
(*(((HB_Byte*)stream->cursor)-2) << 8) | \
72
*(((HB_Byte*)stream->cursor)-1) \
76
#define GET_Char() ((HB_Char)GET_Byte())
77
#define GET_UShort() ((HB_UShort)GET_Short())
78
#define GET_ULong() ((HB_UInt)GET_Long())
79
#define GET_Tag4() GET_ULong()
83
#endif /* HARFBUZZ_STREAM_PRIVATE_H */