~ubuntu-branches/ubuntu/karmic/pango1.0/karmic-security

« back to all changes in this revision

Viewing changes to pango/opentype/harfbuzz-stream-private.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-08-10 21:23:54 UTC
  • mfrom: (1.5.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090810212354-2mq9f0t90khvon6k
Tags: 1.25.1-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 1998-2004  David Turner and Werner Lemberg
3
 
 * Copyright (C) 2006  Behdad Esfahbod
4
 
 *
5
 
 *  This is part of HarfBuzz, an OpenType Layout engine library.
6
 
 *
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.
12
 
 *
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
17
 
 * DAMAGE.
18
 
 *
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.
24
 
 */
25
 
 
26
 
#ifndef HARFBUZZ_STREAM_PRIVATE_H
27
 
#define HARFBUZZ_STREAM_PRIVATE_H
28
 
 
29
 
#include "harfbuzz-impl.h"
30
 
 
31
 
HB_BEGIN_HEADER
32
 
 
33
 
typedef FT_Stream HB_Stream;
34
 
 
35
 
HB_INTERNAL HB_Int
36
 
_hb_stream_pos( HB_Stream stream );
37
 
 
38
 
HB_INTERNAL HB_Error
39
 
_hb_stream_seek( HB_Stream stream,
40
 
                 HB_UInt   pos );
41
 
 
42
 
HB_INTERNAL HB_Error
43
 
_hb_stream_frame_enter( HB_Stream stream,
44
 
                        HB_UInt   size );
45
 
 
46
 
HB_INTERNAL void
47
 
_hb_stream_frame_exit( HB_Stream stream );
48
 
 
49
 
HB_INTERNAL HB_Error
50
 
_hb_font_goto_table( HB_Font   font,
51
 
                     HB_UInt   tag );
52
 
 
53
 
/* convenience macros */
54
 
 
55
 
#define  SET_ERR(c)   ( (error = (c)) != 0 )
56
 
 
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 )
62
 
 
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) \
67
 
                         ))
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) \
73
 
                         ))
74
 
 
75
 
 
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()
80
 
 
81
 
HB_END_HEADER
82
 
 
83
 
#endif /* HARFBUZZ_STREAM_PRIVATE_H */