#ifndef HARFBUZZ_GLOBAL_H
#define HARFBUZZ_GLOBAL_H
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
#ifdef __cplusplus
#define HB_BEGIN_HEADER extern "C" {
#define HB_END_HEADER }
HB_BEGIN_HEADER
+typedef unsigned char HB_Byte;
+typedef signed char HB_Char;
typedef unsigned short HB_UShort;
typedef signed short HB_Short;
typedef unsigned int HB_UInt;
typedef signed int HB_Int;
typedef int HB_Bool;
+typedef void *HB_Pointer;
typedef enum {
#endif
/* only used internally */
-static FT_Pointer
+static HB_Pointer
_hb_qalloc( HB_UInt size,
HB_Error *perror )
{
HB_Error error = 0;
- FT_Pointer block = NULL;
+ HB_Pointer block = NULL;
if ( size > 0 )
{
#define QALLOC(ptr,size) ( (ptr) = _hb_qalloc( (size), &error ), error != 0 )
-HB_INTERNAL FT_Pointer
+HB_INTERNAL HB_Pointer
_hb_alloc( HB_UInt size,
HB_Error *perror )
{
HB_Error error = 0;
- FT_Pointer block = NULL;
+ HB_Pointer block = NULL;
if ( size > 0 )
{
}
-HB_INTERNAL FT_Pointer
-_hb_realloc( FT_Pointer block,
+HB_INTERNAL HB_Pointer
+_hb_realloc( HB_Pointer block,
HB_UInt new_size,
HB_Error *perror )
{
- FT_Pointer block2 = NULL;
+ HB_Pointer block2 = NULL;
HB_Error error = 0;
block2 = realloc( block, new_size );
HB_INTERNAL void
-_hb_free( FT_Pointer block )
+_hb_free( HB_Pointer block )
{
if ( block )
free( block );
#define GET_Byte() (*stream->cursor++)
#define GET_Short() (stream->cursor += 2, (HB_Short)( \
- (*(((FT_Byte*)stream->cursor)-2) << 8) | \
- *(((FT_Byte*)stream->cursor)-1) \
+ (*(((HB_Byte*)stream->cursor)-2) << 8) | \
+ *(((HB_Byte*)stream->cursor)-1) \
))
#define GET_Long() (stream->cursor += 4, (HB_Int)( \
- (*(((FT_Byte*)stream->cursor)-4) << 24) | \
- (*(((FT_Byte*)stream->cursor)-3) << 16) | \
- (*(((FT_Byte*)stream->cursor)-2) << 8) | \
- *(((FT_Byte*)stream->cursor)-1) \
+ (*(((HB_Byte*)stream->cursor)-4) << 24) | \
+ (*(((HB_Byte*)stream->cursor)-3) << 16) | \
+ (*(((HB_Byte*)stream->cursor)-2) << 8) | \
+ *(((HB_Byte*)stream->cursor)-1) \
))
-#define GET_Char() ((FT_Char)GET_Byte())
+#define GET_Char() ((HB_Char)GET_Byte())
#define GET_UShort() ((HB_UShort)GET_Short())
#define GET_ULong() ((HB_UInt)GET_Long())
#define GET_Tag4() GET_ULong()
#define ERR(err) _hb_err (err)
-HB_INTERNAL FT_Pointer
+HB_INTERNAL HB_Pointer
_hb_alloc( HB_UInt size,
HB_Error *perror_ );
-HB_INTERNAL FT_Pointer
-_hb_realloc( FT_Pointer block,
+HB_INTERNAL HB_Pointer
+_hb_realloc( HB_Pointer block,
HB_UInt new_size,
HB_Error *perror_ );
HB_INTERNAL void
-_hb_free( FT_Pointer block );
+_hb_free( HB_Pointer block );
/* helper func to set a breakpoint on */