diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h index 600337e83..2e80022ed 100644 --- a/include/freetype/config/ftconfig.h +++ b/include/freetype/config/ftconfig.h @@ -175,8 +175,8 @@ #define BASE_DEF(x) static x #define BASE_FUNC(x) static x #else -#define BASE_DEF(x) extern x -#define BASE_FUNC(x) extern x /* nothing */ +#define BASE_DEF(x) extern x +#define BASE_FUNC(x) extern x #endif #ifndef EXPORT_DEF @@ -184,7 +184,7 @@ #endif #ifndef EXPORT_FUNC -#define EXPORT_FUNC(x) extern x +#define EXPORT_FUNC(x) extern x #endif #ifndef EXPORT_VAR diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index b7b3a04d9..c4cfa42bc 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -18,7 +18,6 @@ #ifndef FREETYPE_H #define FREETYPE_H - /*************************************************************************/ /* */ /* The `raster' component duplicates some of the declarations in */ @@ -53,373 +52,13 @@ #endif #include -#include -#include +#include #ifdef __cplusplus extern "C" { #endif - /*************************************************************************/ - /* */ - /* */ - /* FT_Bool */ - /* */ - /* */ - /* A typedef of unsigned char, used for simple booleans. */ - /* */ - typedef unsigned char FT_Bool; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FWord */ - /* */ - /* */ - /* A signed 16-bit integer used to store a distance in original font */ - /* units. */ - /* */ - typedef signed short FT_FWord; /* Distance in FUnits */ - - - /*************************************************************************/ - /* */ - /* */ - /* FT_UFWord */ - /* */ - /* */ - /* An unsigned 16-bit integer used to store a distance in original */ - /* font units. */ - /* */ - typedef unsigned short FT_UFWord; /* Unsigned distance */ - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Char */ - /* */ - /* */ - /* A simple typedef for the _signed_ char type. */ - /* */ - typedef signed char FT_Char; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Byte */ - /* */ - /* */ - /* A simple typedef for the _unsigned_ char type. */ - /* */ - typedef unsigned char FT_Byte; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_String */ - /* */ - /* */ - /* A simple typedef for the char type, usually used for strings. */ - /* */ - typedef char FT_String; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Short */ - /* */ - /* */ - /* A typedef for signed short. */ - /* */ - typedef signed short FT_Short; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_UShort */ - /* */ - /* */ - /* A typedef for unsigned short. */ - /* */ - typedef unsigned short FT_UShort; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Int */ - /* */ - /* */ - /* A typedef for the int type. */ - /* */ - typedef int FT_Int; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_UInt */ - /* */ - /* */ - /* A typedef for the unsigned int type. */ - /* */ - typedef unsigned int FT_UInt; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Long */ - /* */ - /* */ - /* A typedef for signed long. */ - /* */ - typedef signed long FT_Long; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_ULong */ - /* */ - /* */ - /* A typedef for unsigned long. */ - /* */ - typedef unsigned long FT_ULong; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_F2Dot14 */ - /* */ - /* */ - /* A signed 2.14 fixed float type used for unit vectors. */ - /* */ - typedef signed short FT_F2Dot14; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_F26Dot6 */ - /* */ - /* */ - /* A signed 26.6 fixed float type used for vectorial pixel */ - /* coordinates. */ - /* */ - typedef signed long FT_F26Dot6; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Fixed */ - /* */ - /* */ - /* This type is used to store 16.16 fixed float values, like scales */ - /* or matrix coefficients. */ - /* */ - typedef signed long FT_Fixed; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Error */ - /* */ - /* */ - /* The FreeType error code type. A value of 0 is always interpreted */ - /* as a successful operation. */ - /* */ - typedef int FT_Error; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Pointer */ - /* */ - /* */ - /* A simple typedef for a typeless pointer. */ - /* */ - typedef void* FT_Pointer; - - /*************************************************************************/ - /* */ - /* */ - /* FT_UnitVector */ - /* */ - /* */ - /* A simple structure used to store a 2d vector unit vector. Uses */ - /* FT_F2Dot14 types. */ - /* */ - /* */ - /* x :: Horizontal coordinate. */ - /* y :: Vertical coordinate. */ - /* */ - typedef struct FT_UnitVector_ - { - FT_F2Dot14 x; - FT_F2Dot14 y; - - } FT_UnitVector; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Matrix */ - /* */ - /* */ - /* A simple structure used to store a 2x2 matrix. Coefficients are */ - /* in 16.16 fixed float format. The computation performed is: */ - /* */ - /* { */ - /* x' = x*xx + y*xy */ - /* y' = x*yx + y*yy */ - /* } */ - /* */ - /* */ - /* xx :: Matrix coefficient. */ - /* xy :: Matrix coefficient. */ - /* yx :: Matrix coefficient. */ - /* yy :: Matrix coefficient. */ - /* */ - typedef struct FT_Matrix_ - { - FT_Fixed xx, xy; - FT_Fixed yx, yy; - - } FT_Matrix; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_BBox */ - /* */ - /* */ - /* A structure used to hold an outline's bounding box, i.e., the */ - /* coordinates of its extrema in the horizontal and vertical */ - /* directions. */ - /* */ - /* */ - /* xMin :: The horizontal minimum (left-most). */ - /* yMin :: The vertical minimum (bottom-most). */ - /* xMax :: The horizontal maximum (right-most). */ - /* yMax :: The vertical maximum (top-most). */ - /* */ - typedef struct FT_BBox_ - { - FT_Pos xMin, yMin; - FT_Pos xMax, yMax; - - } FT_BBox; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_MAKE_TAG */ - /* */ - /* */ - /* This macro converts four letter tags which are used to label */ - /* TrueType tables into an unsigned long to be used within FreeType. */ - /* */ -#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ - (((FT_ULong)_x1 << 24) | \ - ((FT_ULong)_x2 << 16) | \ - ((FT_ULong)_x3 << 8) | \ - (FT_ULong)_x4) - - - /*************************************************************************/ - /*************************************************************************/ - /* */ - /* L I S T M A N A G E M E N T */ - /* */ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* FT_ListNode */ - /* */ - /* */ - /* Many elements and objects in FreeType are listed through a */ - /* FT_List record (see FT_ListRec). As its name suggests, a */ - /* FT_ListNode is a handle to a single list element. */ - /* */ - typedef struct FT_ListNodeRec_* FT_ListNode; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_List */ - /* */ - /* */ - /* A handle to a list record (see FT_ListRec). */ - /* */ - typedef struct FT_ListRec_* FT_List; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_ListNodeRec */ - /* */ - /* */ - /* A structure used to hold a single list element. */ - /* */ - /* */ - /* prev :: Previous element in the list. NULL if first. */ - /* next :: Next element in the list. NULL if last. */ - /* data :: Typeless pointer to the listed object. */ - /* */ - typedef struct FT_ListNodeRec_ - { - FT_ListNode prev; - FT_ListNode next; - void* data; - - } FT_ListNodeRec; - - - /*************************************************************************/ - /* */ - /* */ - /* FT_ListRec */ - /* */ - /* */ - /* A structure used to hold a simple doubly-linked list. These are */ - /* used in many parts of FreeType. */ - /* */ - /* */ - /* head :: Head (first element) of doubly-linked list. */ - /* tail :: Tail (last element) of doubly-linked list. */ - /* */ - typedef struct FT_ListRec_ - { - FT_ListNode head; - FT_ListNode tail; - - } FT_ListRec; - - -#define FT_IS_EMPTY(list) ( (list).head == 0 ) - - /*************************************************************************/ /*************************************************************************/ /* */ diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h new file mode 100644 index 000000000..3d679d541 --- /dev/null +++ b/include/freetype/fttypes.h @@ -0,0 +1,384 @@ +/***************************************************************************/ +/* */ +/* fttypes.h */ +/* */ +/* FreeType simple types definitions */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#ifndef FTTYPES_H +#define FTTYPES_H + +#include +#include + + /*************************************************************************/ + /* */ + /* */ + /* FT_Bool */ + /* */ + /* */ + /* A typedef of unsigned char, used for simple booleans. */ + /* */ + typedef unsigned char FT_Bool; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_FWord */ + /* */ + /* */ + /* A signed 16-bit integer used to store a distance in original font */ + /* units. */ + /* */ + typedef signed short FT_FWord; /* Distance in FUnits */ + + + /*************************************************************************/ + /* */ + /* */ + /* FT_UFWord */ + /* */ + /* */ + /* An unsigned 16-bit integer used to store a distance in original */ + /* font units. */ + /* */ + typedef unsigned short FT_UFWord; /* Unsigned distance */ + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Char */ + /* */ + /* */ + /* A simple typedef for the _signed_ char type. */ + /* */ + typedef signed char FT_Char; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Byte */ + /* */ + /* */ + /* A simple typedef for the _unsigned_ char type. */ + /* */ + typedef unsigned char FT_Byte; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_String */ + /* */ + /* */ + /* A simple typedef for the char type, usually used for strings. */ + /* */ + typedef char FT_String; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Short */ + /* */ + /* */ + /* A typedef for signed short. */ + /* */ + typedef signed short FT_Short; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_UShort */ + /* */ + /* */ + /* A typedef for unsigned short. */ + /* */ + typedef unsigned short FT_UShort; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Int */ + /* */ + /* */ + /* A typedef for the int type. */ + /* */ + typedef int FT_Int; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_UInt */ + /* */ + /* */ + /* A typedef for the unsigned int type. */ + /* */ + typedef unsigned int FT_UInt; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Long */ + /* */ + /* */ + /* A typedef for signed long. */ + /* */ + typedef signed long FT_Long; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_ULong */ + /* */ + /* */ + /* A typedef for unsigned long. */ + /* */ + typedef unsigned long FT_ULong; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_F2Dot14 */ + /* */ + /* */ + /* A signed 2.14 fixed float type used for unit vectors. */ + /* */ + typedef signed short FT_F2Dot14; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_F26Dot6 */ + /* */ + /* */ + /* A signed 26.6 fixed float type used for vectorial pixel */ + /* coordinates. */ + /* */ + typedef signed long FT_F26Dot6; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Fixed */ + /* */ + /* */ + /* This type is used to store 16.16 fixed float values, like scales */ + /* or matrix coefficients. */ + /* */ + typedef signed long FT_Fixed; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Error */ + /* */ + /* */ + /* The FreeType error code type. A value of 0 is always interpreted */ + /* as a successful operation. */ + /* */ + typedef int FT_Error; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Pointer */ + /* */ + /* */ + /* A simple typedef for a typeless pointer. */ + /* */ + typedef void* FT_Pointer; + + /*************************************************************************/ + /* */ + /* */ + /* FT_UnitVector */ + /* */ + /* */ + /* A simple structure used to store a 2d vector unit vector. Uses */ + /* FT_F2Dot14 types. */ + /* */ + /* */ + /* x :: Horizontal coordinate. */ + /* y :: Vertical coordinate. */ + /* */ + typedef struct FT_UnitVector_ + { + FT_F2Dot14 x; + FT_F2Dot14 y; + + } FT_UnitVector; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Matrix */ + /* */ + /* */ + /* A simple structure used to store a 2x2 matrix. Coefficients are */ + /* in 16.16 fixed float format. The computation performed is: */ + /* */ + /* { */ + /* x' = x*xx + y*xy */ + /* y' = x*yx + y*yy */ + /* } */ + /* */ + /* */ + /* xx :: Matrix coefficient. */ + /* xy :: Matrix coefficient. */ + /* yx :: Matrix coefficient. */ + /* yy :: Matrix coefficient. */ + /* */ + typedef struct FT_Matrix_ + { + FT_Fixed xx, xy; + FT_Fixed yx, yy; + + } FT_Matrix; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_BBox */ + /* */ + /* */ + /* A structure used to hold an outline's bounding box, i.e., the */ + /* coordinates of its extrema in the horizontal and vertical */ + /* directions. */ + /* */ + /* */ + /* xMin :: The horizontal minimum (left-most). */ + /* yMin :: The vertical minimum (bottom-most). */ + /* xMax :: The horizontal maximum (right-most). */ + /* yMax :: The vertical maximum (top-most). */ + /* */ + typedef struct FT_BBox_ + { + FT_Pos xMin, yMin; + FT_Pos xMax, yMax; + + } FT_BBox; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_MAKE_TAG */ + /* */ + /* */ + /* This macro converts four letter tags which are used to label */ + /* TrueType tables into an unsigned long to be used within FreeType. */ + /* */ +#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ + (((FT_ULong)_x1 << 24) | \ + ((FT_ULong)_x2 << 16) | \ + ((FT_ULong)_x3 << 8) | \ + (FT_ULong)_x4) + + + /*************************************************************************/ + /*************************************************************************/ + /* */ + /* L I S T M A N A G E M E N T */ + /* */ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* FT_ListNode */ + /* */ + /* */ + /* Many elements and objects in FreeType are listed through a */ + /* FT_List record (see FT_ListRec). As its name suggests, a */ + /* FT_ListNode is a handle to a single list element. */ + /* */ + typedef struct FT_ListNodeRec_* FT_ListNode; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_List */ + /* */ + /* */ + /* A handle to a list record (see FT_ListRec). */ + /* */ + typedef struct FT_ListRec_* FT_List; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_ListNodeRec */ + /* */ + /* */ + /* A structure used to hold a single list element. */ + /* */ + /* */ + /* prev :: Previous element in the list. NULL if first. */ + /* next :: Next element in the list. NULL if last. */ + /* data :: Typeless pointer to the listed object. */ + /* */ + typedef struct FT_ListNodeRec_ + { + FT_ListNode prev; + FT_ListNode next; + void* data; + + } FT_ListNodeRec; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_ListRec */ + /* */ + /* */ + /* A structure used to hold a simple doubly-linked list. These are */ + /* used in many parts of FreeType. */ + /* */ + /* */ + /* head :: Head (first element) of doubly-linked list. */ + /* tail :: Tail (last element) of doubly-linked list. */ + /* */ + typedef struct FT_ListRec_ + { + FT_ListNode head; + FT_ListNode tail; + + } FT_ListRec; + + +#define FT_IS_EMPTY(list) ( (list).head == 0 ) + +#endif /* FTTYPES_H */ +/* END */ + diff --git a/include/freetype/internal/ftmemory.h b/include/freetype/internal/ftmemory.h new file mode 100644 index 000000000..587531185 --- /dev/null +++ b/include/freetype/internal/ftmemory.h @@ -0,0 +1,121 @@ +/***************************************************************************/ +/* */ +/* ftmemory.h */ +/* */ +/* The FreeType memory management macros */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#ifndef FTMEMORY_H +#define FTMEMORY_H + +#include +#include + + /*************************************************************************/ + /* */ + /* */ + /* FT_SET_ERROR */ + /* */ + /* */ + /* This macro is used to set an implicit `error' variable to a given */ + /* expression's value (usually a function call), and convert it to a */ + /* boolean which is set whenever the value is != 0. */ + /* */ +#undef FT_SET_ERROR +#define FT_SET_ERROR( expression ) \ + ( (error = (expression)) != 0 ) + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** M E M O R Y ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + BASE_DEF(FT_Error) FT_Alloc( FT_Memory memory, + FT_Long size, + void** P ); + + BASE_DEF(FT_Error) FT_Realloc( FT_Memory memory, + FT_Long current, + FT_Long size, + void** P ); + + BASE_DEF(void) FT_Free( FT_Memory memory, + void** P ); + + + + /* This include is needed by the MEM_xxx() macros, it should be */ + /* available on every platform we know !! */ +#include + +#define MEM_Set( dest, byte, count ) memset( dest, byte, count ) + +#ifdef HAVE_MEMCPY +#define MEM_Copy( dest, source, count ) memcpy( dest, source, count ) +#else +#define MEM_Copy( dest, source, count ) bcopy( source, dest, count ) +#endif + +#define MEM_Move( dest, source, count ) memmove( dest, source, count ) + + + /*************************************************************************/ + /* */ + /* We now support closures to produce completely reentrant code. This */ + /* means the allocation functions now takes an additional argument */ + /* (`memory'). It is a handle to a given memory object, responsible for */ + /* all low-level operations, including memory management and */ + /* synchronisation. */ + /* */ + /* In order to keep our code readable and use the same macros in the */ + /* font drivers and the rest of the library, MEM_Alloc(), ALLOC(), and */ + /* ALLOC_ARRAY() now use an implicit variable, `memory'. It must be */ + /* defined at all locations where a memory operation is queried. */ + /* */ + + /* */ + /* Note that ALL memory allocation functions need an IMPLICIT argument */ + /* called `memory' to point to the current memory object. */ + /* */ +#define MEM_Alloc( _pointer_, _size_ ) \ + FT_Alloc( memory, _size_, (void**)&(_pointer_) ) + +#define MEM_Realloc( _pointer_, _current_, _size_ ) \ + FT_Realloc( memory, _current_, _size_, (void**)&(_pointer_) ) + +#define ALLOC( _pointer_, _size_ ) \ + FT_SET_ERROR( MEM_Alloc( _pointer_, _size_ ) ) + +#define REALLOC( _pointer_, _current_, _size_ ) \ + FT_SET_ERROR( MEM_Realloc( _pointer_, _current_, _size_ ) ) + +#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \ + FT_SET_ERROR( MEM_Alloc( _pointer_, (_count_)*sizeof (_type_) ) ) + +#define REALLOC_ARRAY( _pointer_, _current_, _count_, _type_ ) \ + FT_SET_ERROR( MEM_Realloc( _pointer_, (_current_)*sizeof(_type_), \ + (_count_)*sizeof(_type_) ) ) + +#define FREE( _pointer_ ) FT_Free( memory, (void**)&(_pointer_) ) + +#endif /* FTMEMORY_H */ + +/* END */ diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index f3f78ed09..55eefab07 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (specification). */ /* */ -/* Copyright 1996-1999 by */ +/* Copyright 1996-2000 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -25,8 +25,7 @@ #ifndef FTOBJS_H #define FTOBJS_H -#include -#include +#include #include /*************************************************************************/ @@ -67,101 +66,6 @@ #define ABS( a ) ( (a) < 0 ? -(a) : (a) ) #endif - /*************************************************************************/ - /* */ - /* */ - /* FT_SET_ERROR */ - /* */ - /* */ - /* This macro is used to set an implicit `error' variable to a given */ - /* expression's value (usually a function call), and convert it to a */ - /* boolean which is set whenever the value is != 0. */ - /* */ -#undef FT_SET_ERROR -#define FT_SET_ERROR( expression ) \ - ( (error = (expression)) != 0 ) - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** M E M O R Y ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - BASE_DEF(FT_Error) FT_Alloc( FT_Memory memory, - FT_Long size, - void** P ); - - BASE_DEF(FT_Error) FT_Realloc( FT_Memory memory, - FT_Long current, - FT_Long size, - void** P ); - - BASE_DEF(void) FT_Free( FT_Memory memory, - void** P ); - - - - /* This include is needed by the MEM_xxx() macros, it should be */ - /* available on every platform we know !! */ -#include - -#define MEM_Set( dest, byte, count ) memset( dest, byte, count ) - -#ifdef HAVE_MEMCPY -#define MEM_Copy( dest, source, count ) memcpy( dest, source, count ) -#else -#define MEM_Copy( dest, source, count ) bcopy( source, dest, count ) -#endif - -#define MEM_Move( dest, source, count ) memmove( dest, source, count ) - - - /*************************************************************************/ - /* */ - /* We now support closures to produce completely reentrant code. This */ - /* means the allocation functions now takes an additional argument */ - /* (`memory'). It is a handle to a given memory object, responsible for */ - /* all low-level operations, including memory management and */ - /* synchronisation. */ - /* */ - /* In order to keep our code readable and use the same macros in the */ - /* font drivers and the rest of the library, MEM_Alloc(), ALLOC(), and */ - /* ALLOC_ARRAY() now use an implicit variable, `memory'. It must be */ - /* defined at all locations where a memory operation is queried. */ - /* */ - - /* */ - /* Note that ALL memory allocation functions need an IMPLICIT argument */ - /* called `memory' to point to the current memory object. */ - /* */ -#define MEM_Alloc( _pointer_, _size_ ) \ - FT_Alloc( memory, _size_, (void**)&(_pointer_) ) - -#define MEM_Realloc( _pointer_, _current_, _size_ ) \ - FT_Realloc( memory, _current_, _size_, (void**)&(_pointer_) ) - -#define ALLOC( _pointer_, _size_ ) \ - FT_SET_ERROR( MEM_Alloc( _pointer_, _size_ ) ) - -#define REALLOC( _pointer_, _current_, _size_ ) \ - FT_SET_ERROR( MEM_Realloc( _pointer_, _current_, _size_ ) ) - -#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \ - FT_SET_ERROR( MEM_Alloc( _pointer_, (_count_)*sizeof (_type_) ) ) - -#define REALLOC_ARRAY( _pointer_, _current_, _count_, _type_ ) \ - FT_SET_ERROR( MEM_Realloc( _pointer_, (_current_)*sizeof(_type_), \ - (_count_)*sizeof(_type_) ) ) - -#define FREE( _pointer_ ) FT_Free( memory, (void**)&(_pointer_) ) - EXPORT_DEF(FT_Error) FT_New_Size( FT_Face face,